From d7e8f86cc0b60d3564fee8396b769449980350bc Mon Sep 17 00:00:00 2001 From: vayne Date: Fri, 12 Jul 2024 14:34:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=99=BA=E6=85=A7=E5=9B=AD=E5=8C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jnpf-java-boot/.gitignore | 76 + jnpf-java-boot/Dockerfile | 22 + jnpf-java-boot/README.md | 369 + jnpf-java-boot/jnpf-admin/pom.xml | 170 + .../main/java/jnpf/JnpfAdminApplication.java | 29 + .../java/jnpf/aop/DataSourceBindAspect.java | 86 + .../java/jnpf/aop/PermissionAdminAspect.java | 111 + .../java/jnpf/aop/PermissionAdminBase.java | 40 + .../java/jnpf/aop/PermissionOrgAspect.java | 121 + .../jnpf/aop/PermissionPositionAspect.java | 93 + .../java/jnpf/aop/PermissionRoleAspect.java | 155 + .../java/jnpf/aop/PermissionUserAspect.java | 151 + .../main/java/jnpf/aop/RequestLogAspect.java | 202 + .../main/java/jnpf/aop/VisiualOpaAspect.java | 49 + .../jnpf/constant/PermissionConstant.java | 73 + .../src/main/java/jnpf/filter/AuthFilter.java | 115 + .../src/main/java/jnpf/util/GatewayWhite.java | 181 + .../java/jnpf/util/PermissionAspectUtil.java | 165 + .../main/resources/AntiSamy_zh_CN.properties | 34 + .../resources/antisamy-ebay-imgonlybase64.xml | 2453 ++++++ .../src/main/resources/antisamy-ebay.xml | 2455 ++++++ .../src/main/resources/antisamy-empty.xml | 73 + .../src/main/resources/application-dev.yml | 232 + .../main/resources/application-preview.yml | 194 + .../src/main/resources/application-pro.yml | 194 + .../src/main/resources/application-test.yml | 194 + .../src/main/resources/application.yml | 128 + .../src/main/resources/logback-spring.xml | 339 + .../resources/mapper/extend/BigDataMapper.xml | 9 + .../mapper/extend/DocumentMapper.xml | 46 + .../main/resources/mapper/form/FormMapper.xml | 15 + .../mapper/system/AuthorizeMapper.xml | 157 + .../mapper/system/ImContentMapper.xml | 30 + .../resources/mapper/system/ImReplyMapper.xml | 35 + .../resources/mapper/system/MessageMapper.xml | 45 + .../mapper/system/PortalManageMapper.xml | 88 + .../mapper/system/PositionMapper.xml | 45 + .../resources/mapper/system/RoleMapper.xml | 64 + .../mapper/system/SysconfigMapper.xml | 15 + .../resources/mapper/system/UserMapper.xml | 42 + .../mapper/workflow/engine/FlowTaskMapper.xml | 317 + .../src/main/resources/sharding-sphere.yml | 52 + jnpf-java-boot/jnpf-app/jnpf-app-biz/pom.xml | 41 + .../main/java/jnpf/mapper/AppDataMapper.java | 16 + .../java/jnpf/service/AppDataService.java | 88 + .../main/java/jnpf/service/AppService.java | 28 + .../jnpf/service/impl/AppDataServiceImpl.java | 171 + .../jnpf/service/impl/AppServiceImpl.java | 157 + .../jnpf-app/jnpf-app-controller/pom.xml | 23 + .../jnpf/controller/AppDataController.java | 129 + .../jnpf/controller/AppMenuController.java | 93 + .../jnpf/controller/AppUserController.java | 62 + .../jnpf/controller/AppVersionController.java | 45 + .../jnpf-app/jnpf-app-entity/pom.xml | 22 + .../main/java/jnpf/entity/AppDataEntity.java | 46 + .../main/java/jnpf/model/AppDataCrForm.java | 30 + .../java/jnpf/model/AppDataListAllVO.java | 40 + .../main/java/jnpf/model/AppDataListVO.java | 24 + .../java/jnpf/model/AppFlowListAllVO.java | 30 + .../main/java/jnpf/model/AppMenuListVO.java | 40 + .../main/java/jnpf/model/AppPositionVO.java | 22 + .../main/java/jnpf/model/AppUserInfoVO.java | 37 + .../src/main/java/jnpf/model/AppUsersVO.java | 50 + jnpf-java-boot/jnpf-app/pom.xml | 20 + .../jnpf-example/jnpf-example-biz/pom.xml | 27 + .../main/java/jnpf/mapper/ContractMapper.java | 16 + .../java/jnpf/service/ContractService.java | 28 + .../service/impl/ContractServiceImpl.java | 82 + .../jnpf-example-controller/pom.xml | 22 + .../jnpf/controller/ContractController.java | 123 + .../jnpf-example/jnpf-example-entity/pom.xml | 22 + .../main/java/jnpf/entity/ContractEntity.java | 33 + .../main/java/jnpf/model/ContractForm.java | 26 + .../main/java/jnpf/model/ContractInfoVO.java | 27 + .../main/java/jnpf/model/ContractListVO.java | 16 + jnpf-java-boot/jnpf-example/pom.xml | 20 + jnpf-java-boot/jnpf-exception/pom.xml | 31 + .../java/jnpf/controller/LogController.java | 144 + .../src/main/java/jnpf/entity/LogEntity.java | 107 + .../main/java/jnpf/enums/LogLevelEnum.java | 76 + .../src/main/java/jnpf/enums/LogSortEnum.java | 84 + .../java/jnpf/exception/ResultException.java | 281 + .../src/main/java/jnpf/mapper/LogMapper.java | 18 + .../src/main/java/jnpf/model/ErrorLogVO.java | 27 + .../src/main/java/jnpf/model/HandleLogVO.java | 63 + .../src/main/java/jnpf/model/LogDelForm.java | 18 + .../src/main/java/jnpf/model/LoginLogVO.java | 27 + .../java/jnpf/model/PaginationLogModel.java | 34 + .../main/java/jnpf/model/RequestLogVO.java | 31 + .../main/java/jnpf/service/LogService.java | 83 + .../jnpf/service/impl/LogServiceImpl.java | 182 + .../src/main/java/jnpf/util/JsonUtilEx.java | 78 + .../jnpf-extend/jnpf-extend-biz/pom.xml | 40 + .../main/java/jnpf/mapper/BigDataMapper.java | 19 + .../main/java/jnpf/mapper/CustomerMapper.java | 17 + .../main/java/jnpf/mapper/DocumentMapper.java | 41 + .../java/jnpf/mapper/DocumentShareMapper.java | 18 + .../java/jnpf/mapper/EmailConfigMapper.java | 18 + .../java/jnpf/mapper/EmailReceiveMapper.java | 17 + .../java/jnpf/mapper/EmailSendMapper.java | 18 + .../main/java/jnpf/mapper/EmployeeMapper.java | 18 + .../java/jnpf/mapper/OrderEntryMapper.java | 17 + .../main/java/jnpf/mapper/OrderMapper.java | 17 + .../jnpf/mapper/OrderReceivableMapper.java | 17 + .../java/jnpf/mapper/ProductEntryMapper.java | 18 + .../java/jnpf/mapper/ProductGoodsMapper.java | 17 + .../main/java/jnpf/mapper/ProductMapper.java | 18 + .../jnpf/mapper/ProductclassifyMapper.java | 17 + .../java/jnpf/mapper/ProjectGanttMapper.java | 18 + .../java/jnpf/mapper/TableExampleMapper.java | 18 + .../main/java/jnpf/mapper/WorkLogMapper.java | 18 + .../java/jnpf/mapper/WorkLogShareMapper.java | 18 + .../java/jnpf/service/BigDataService.java | 34 + .../java/jnpf/service/CustomerService.java | 29 + .../java/jnpf/service/DocumentService.java | 141 + .../jnpf/service/DocumentShareService.java | 17 + .../java/jnpf/service/EmailConfigService.java | 17 + .../jnpf/service/EmailReceiveService.java | 149 + .../java/jnpf/service/EmailSendService.java | 17 + .../java/jnpf/service/EmployeeService.java | 90 + .../java/jnpf/service/OrderEntryService.java | 16 + .../jnpf/service/OrderReceivableService.java | 16 + .../main/java/jnpf/service/OrderService.java | 112 + .../jnpf/service/ProductEntryService.java | 22 + .../jnpf/service/ProductGoodsService.java | 31 + .../java/jnpf/service/ProductService.java | 30 + .../jnpf/service/ProductclassifyService.java | 28 + .../jnpf/service/ProjectGanttService.java | 109 + .../jnpf/service/TableExampleService.java | 90 + .../java/jnpf/service/WorkLogService.java | 64 + .../jnpf/service/WorkLogShareService.java | 17 + .../jnpf/service/impl/BigDataServiceImpl.java | 135 + .../service/impl/CustomerServiceImpl.java | 79 + .../service/impl/DocumentServiceImpl.java | 222 + .../impl/DocumentShareServiceImpl.java | 19 + .../service/impl/EmailConfigServiceImpl.java | 20 + .../service/impl/EmailReceiveServiceImpl.java | 427 + .../service/impl/EmailSendServiceImpl.java | 20 + .../service/impl/EmployeeServiceImpl.java | 307 + .../service/impl/OrderEntryServiceImpl.java | 20 + .../impl/OrderReceivableServiceImpl.java | 19 + .../jnpf/service/impl/OrderServiceImpl.java | 265 + .../service/impl/ProductEntryServiceImpl.java | 48 + .../service/impl/ProductGoodsServiceImpl.java | 102 + .../jnpf/service/impl/ProductServiceImpl.java | 130 + .../impl/ProductclassifyServiceImpl.java | 65 + .../service/impl/ProjectGanttServiceImpl.java | 167 + .../service/impl/TableExampleServiceImpl.java | 161 + .../jnpf/service/impl/WorkLogServiceImpl.java | 138 + .../service/impl/WorkLogShareServiceImpl.java | 21 + .../jnpf-extend-controller/pom.xml | 32 + .../jnpf/controller/BarCodeController.java | 50 + .../jnpf/controller/BigDataController.java | 68 + .../jnpf/controller/CustomerController.java | 140 + .../jnpf/controller/DocumentController.java | 648 ++ .../controller/DocumentPreviewController.java | 127 + .../java/jnpf/controller/EmailController.java | 351 + .../jnpf/controller/EmployeeController.java | 493 ++ .../java/jnpf/controller/OrderController.java | 409 + .../jnpf/controller/ProductController.java | 186 + .../controller/ProductGoodsController.java | 178 + .../controller/ProductclassifyController.java | 138 + .../controller/ProjectGanttController.java | 320 + .../controller/ReportManageController.java | 77 + .../controller/ReportTemplateController.java | 140 + .../controller/TableExampleController.java | 450 + .../jnpf/controller/WorkLogController.java | 171 + .../jnpf-extend/jnpf-extend-entity/pom.xml | 22 + .../main/java/jnpf/entity/BigDataEntity.java | 33 + .../main/java/jnpf/entity/CustomerEntity.java | 50 + .../main/java/jnpf/entity/DocumentEntity.java | 81 + .../java/jnpf/entity/DocumentShareEntity.java | 40 + .../java/jnpf/entity/EmailSendEntity.java | 80 + .../main/java/jnpf/entity/EmployeeEntity.java | 106 + .../main/java/jnpf/entity/OrderEntity.java | 119 + .../java/jnpf/entity/OrderEntryEntity.java | 100 + .../jnpf/entity/OrderReceivableEntity.java | 66 + .../main/java/jnpf/entity/ProductEntity.java | 185 + .../java/jnpf/entity/ProductEntryEntity.java | 94 + .../java/jnpf/entity/ProductGoodsEntity.java | 62 + .../jnpf/entity/ProductclassifyEntity.java | 32 + .../java/jnpf/entity/ProjectGanttEntity.java | 95 + .../java/jnpf/entity/TableExampleEntity.java | 119 + .../main/java/jnpf/entity/WorkLogEntity.java | 51 + .../java/jnpf/entity/WorkLogShareEntity.java | 40 + .../main/java/jnpf/model/EmployeeModel.java | 64 + .../java/jnpf/model/ReportManageModel.java | 22 + .../jnpf/model/bidata/BigBigDataListVO.java | 15 + .../jnpf/model/customer/CustomerCrForm.java | 26 + .../jnpf/model/customer/CustomerInfoVO.java | 28 + .../jnpf/model/customer/CustomerListVO.java | 30 + .../jnpf/model/customer/CustomerUpForm.java | 16 + .../jnpf/model/document/DocumentCrForm.java | 19 + .../document/DocumentFolderTreeModel.java | 11 + .../model/document/DocumentFolderTreeVO.java | 22 + .../jnpf/model/document/DocumentInfoVO.java | 21 + .../jnpf/model/document/DocumentListVO.java | 30 + .../model/document/DocumentShareForm.java | 10 + .../model/document/DocumentSoutListVO.java | 18 + .../model/document/DocumentStomeListVO.java | 19 + .../model/document/DocumentSuserListVO.java | 17 + .../model/document/DocumentTrashListVO.java | 15 + .../jnpf/model/document/DocumentUpForm.java | 8 + .../jnpf/model/document/DocumentUploader.java | 14 + .../jnpf/model/document/PageDocument.java | 10 + .../model/documentpreview/FileInfoVO.java | 10 + .../java/jnpf/model/email/EmailCheckForm.java | 32 + .../jnpf/model/email/EmailCofigInfoVO.java | 32 + .../java/jnpf/model/email/EmailCrForm.java | 36 + .../jnpf/model/email/EmailDraftListVO.java | 17 + .../java/jnpf/model/email/EmailInfoModel.java | 12 + .../java/jnpf/model/email/EmailInfoVO.java | 31 + .../jnpf/model/email/EmailReceiveListVO.java | 26 + .../jnpf/model/email/EmailSendCrForm.java | 37 + .../jnpf/model/email/EmailSentListVO.java | 17 + .../jnpf/model/email/EmailStarredListVO.java | 23 + .../jnpf/model/email/PaginationEmail.java | 10 + .../emailconfig/EmailConfigCheckForm.java | 36 + .../emailconfig/EmailConfigSavaForm.java | 34 + .../jnpf/model/employee/EmployeeCrForm.java | 43 + .../jnpf/model/employee/EmployeeExportVO.java | 138 + .../jnpf/model/employee/EmployeeImportVO.java | 35 + .../model/employee/EmployeeInfoModel.java | 66 + .../jnpf/model/employee/EmployeeInfoVO.java | 36 + .../jnpf/model/employee/EmployeeListVO.java | 40 + .../jnpf/model/employee/EmployeeUpForm.java | 7 + .../model/employee/PaginationEmployee.java | 14 + .../jnpf/model/order/OrderCustomerVO.java | 21 + .../jnpf/model/order/OrderEntryListVO.java | 39 + .../jnpf/model/order/OrderEntryModel.java | 65 + .../jnpf/model/order/OrderExportModel.java | 43 + .../main/java/jnpf/model/order/OrderForm.java | 61 + .../java/jnpf/model/order/OrderGoodsVO.java | 27 + .../model/order/OrderInfoOrderEntryModel.java | 48 + .../order/OrderInfoOrderReceivableModel.java | 39 + .../java/jnpf/model/order/OrderInfoVO.java | 63 + .../java/jnpf/model/order/OrderListVO.java | 37 + .../model/order/OrderReceivableListVO.java | 30 + .../model/order/OrderReceivableModel.java | 45 + .../jnpf/model/order/PaginationOrder.java | 18 + .../jnpf/model/product/ProductCrForm.java | 60 + .../jnpf/model/product/ProductInfoVO.java | 61 + .../jnpf/model/product/ProductListVO.java | 41 + .../jnpf/model/product/ProductPagination.java | 25 + .../jnpf/model/product/ProductUpForm.java | 17 + .../productEntry/ProductEntryInfoVO.java | 33 + .../productEntry/ProductEntryListVO.java | 29 + .../model/productEntry/ProductEntryMdoel.java | 27 + .../ProductclassifyCrForm.java | 20 + .../ProductclassifyInfoVO.java | 23 + .../ProductclassifyListVO.java | 27 + .../productclassify/ProductclassifyModel.java | 22 + .../ProductclassifyUpForm.java | 17 + .../productgoods/ProductGoodsCrForm.java | 29 + .../productgoods/ProductGoodsInfoVO.java | 32 + .../productgoods/ProductGoodsListVO.java | 33 + .../productgoods/ProductGoodsPagination.java | 23 + .../productgoods/ProductGoodsUpForm.java | 15 + .../projectgantt/ProjectGanttCrForm.java | 46 + .../projectgantt/ProjectGanttInfoVO.java | 29 + .../projectgantt/ProjectGanttListVO.java | 29 + .../ProjectGanttManagerIModel.java | 11 + .../projectgantt/ProjectGanttTaskInfoVO.java | 31 + .../ProjectGanttTaskTreeModel.java | 10 + .../projectgantt/ProjectGanttTaskTreeVO.java | 31 + .../projectgantt/ProjectGanttTreeModel.java | 20 + .../projectgantt/ProjectGanttTreeVO.java | 29 + .../projectgantt/ProjectGanttTsakCrForm.java | 46 + .../projectgantt/ProjectGanttTsakUpForm.java | 8 + .../projectgantt/ProjectGanttUpForm.java | 9 + .../jnpf/model/schedule/ScheduleCrForm.java | 33 + .../jnpf/model/schedule/ScheduleInfoVO.java | 29 + .../jnpf/model/schedule/ScheduleListVO.java | 17 + .../jnpf/model/schedule/ScheduleTime.java | 11 + .../jnpf/model/schedule/ScheduleTimes.java | 9 + .../jnpf/model/schedule/ScheduleUpForm.java | 8 + .../tableexample/PaginationTableExample.java | 10 + .../tableexample/TableExampleCityListVO.java | 15 + .../tableexample/TableExampleCrForm.java | 48 + .../TableExampleIndustryListVO.java | 17 + .../tableexample/TableExampleInfoVO.java | 9 + .../tableexample/TableExampleListAllVO.java | 51 + .../tableexample/TableExampleListDTO.java | 81 + .../tableexample/TableExampleListVO.java | 57 + .../tableexample/TableExampleRowUpForm.java | 54 + .../tableexample/TableExampleSignUpForm.java | 14 + .../tableexample/TableExampleTreeModel.java | 15 + .../tableexample/TableExampleUpForm.java | 8 + .../tableexample/postil/PostilInfoVO.java | 10 + .../tableexample/postil/PostilModel.java | 10 + .../tableexample/postil/PostilSendForm.java | 9 + .../jnpf/model/worklog/WorkLogCrForm.java | 24 + .../jnpf/model/worklog/WorkLogInfoVO.java | 23 + .../jnpf/model/worklog/WorkLogListVO.java | 21 + .../jnpf/model/worklog/WorkLogUpForm.java | 8 + jnpf-java-boot/jnpf-extend/pom.xml | 20 + .../jnpf-file/jnpf-file-biz/pom.xml | 37 + .../src/main/java/jnpf/mapper/FileMapper.java | 17 + .../main/java/jnpf/service/YozoService.java | 85 + .../jnpf/service/impl/YozoServiceImpl.java | 148 + .../src/main/java/jnpf/utils/YozoUtils.java | 209 + .../jnpf/yozo/client/AppAuthenticator.java | 7 + .../jnpf/yozo/client/UaaAppAuthenticator.java | 98 + .../jnpf/yozo/client/UaaAppConfigClient.java | 28 + .../jnpf/yozo/constants/EnumResultCode.java | 36 + .../java/jnpf/yozo/constants/UaaConstant.java | 9 + .../java/jnpf/yozo/utils/DefaultResult.java | 86 + .../jnpf/yozo/utils/HttpRequestUtils.java | 25 + .../main/java/jnpf/yozo/utils/IResult.java | 11 + .../jnpf/yozo/utils/SecretSignatureUtils.java | 28 + .../jnpf-file/jnpf-file-controller/pom.xml | 22 + .../java/jnpf/controller/UtilsController.java | 741 ++ .../jnpf/controller/YozoFileController.java | 305 + .../jnpf-file/jnpf-file-entity/pom.xml | 23 + .../src/main/java/jnpf/entity/FileEntity.java | 44 + .../java/jnpf/enums/FilePreviewTypeEnum.java | 24 + .../src/main/java/jnpf/model/Chunk.java | 59 + .../src/main/java/jnpf/model/ChunkRes.java | 24 + .../src/main/java/jnpf/model/FileForm.java | 18 + .../src/main/java/jnpf/model/LanguageVO.java | 13 + .../main/java/jnpf/model/MergeChunkDto.java | 53 + .../main/java/jnpf/model/PathTypeModel.java | 24 + .../main/java/jnpf/model/PreviewParams.java | 22 + .../main/java/jnpf/model/SuffixParams.java | 49 + .../src/main/java/jnpf/model/UploaderVO.java | 21 + .../main/java/jnpf/model/YozoFileParams.java | 48 + .../src/main/java/jnpf/model/YozoParams.java | 56 + .../main/java/jnpf/utils/SplicingUrlUtil.java | 44 + jnpf-java-boot/jnpf-file/pom.xml | 20 + .../jnpf-form/jnpf-form-biz/pom.xml | 32 + .../java/jnpf/mapper/FlowFormDataMapper.java | 15 + .../main/java/jnpf/mapper/FlowFormMapper.java | 21 + .../jnpf/mapper/FlowFormRelationMapper.java | 17 + .../jnpf/service/FlowFormRelationService.java | 36 + .../java/jnpf/service/FlowFormService.java | 120 + .../java/jnpf/service/FormDataService.java | 64 + .../service/impl/FlowDataServiceImpl.java | 123 + .../impl/FlowFormRelationServiceImpl.java | 49 + .../service/impl/FlowFormServiceImpl.java | 353 + .../main/java/jnpf/util/ConcurrencyUtils.java | 141 + .../jnpf/util/DateTimeFormatConstant.java | 74 + .../java/jnpf/util/FlowFormCustomUtils.java | 337 + .../main/java/jnpf/util/FlowFormDataUtil.java | 1472 ++++ .../java/jnpf/util/FlowFormHttpReqUtils.java | 99 + .../main/java/jnpf/util/FormCheckUtils.java | 187 + .../main/java/jnpf/util/FormInfoUtils.java | 117 + .../main/java/jnpf/util/FormPublicUtils.java | 617 ++ .../main/java/jnpf/util/ServiceBaseUtil.java | 266 + .../java/jnpf/util/VisualDevTableCre.java | 327 + .../jnpf-form/jnpf-form-controller/pom.xml | 22 + .../jnpf/controller/FlowFormController.java | 315 + .../jnpf-form/jnpf-form-entity/pom.xml | 27 + .../main/java/jnpf/entity/FlowFormEntity.java | 97 + .../jnpf/entity/FlowFormRelationEntity.java | 31 + .../main/java/jnpf/model/flow/DataModel.java | 51 + .../jnpf/model/flow/FlowFormDataModel.java | 27 + .../jnpf/model/flow/FlowTempInfoModel.java | 24 + .../java/jnpf/model/form/DraftJsonModel.java | 20 + .../java/jnpf/model/form/FlowFieldModel.java | 40 + .../java/jnpf/model/form/FlowFormModel.java | 86 + .../java/jnpf/model/form/FlowFormPage.java | 26 + .../main/java/jnpf/model/form/FlowFormVo.java | 99 + .../java/jnpf/model/form/FlowSelectVo.java | 42 + .../java/jnpf/model/form/FormCheckModel.java | 23 + .../jnpf/model/form/FormDraftJsonModel.java | 24 + .../jnpf/model/form/MultipleControlEnum.java | 43 + .../jnpf/model/form/VisualTableModel.java | 34 + jnpf-java-boot/jnpf-form/pom.xml | 20 + .../jnpf-message/jnpf-message-biz/pom.xml | 36 + .../jnpf/message/config/WebsocketConfig.java | 24 + .../message/mapper/AccountConfigMapper.java | 19 + .../jnpf/message/mapper/ImContentMapper.java | 29 + .../jnpf/message/mapper/ImReplyMapper.java | 26 + .../jnpf/message/mapper/MessageMapper.java | 27 + .../message/mapper/MessageMonitorMapper.java | 19 + .../mapper/MessageTemplateConfigMapper.java | 18 + .../message/mapper/MessagereceiveMapper.java | 18 + .../mapper/SendConfigTemplateMapper.java | 19 + .../mapper/SendMessageConfigMapper.java | 19 + .../jnpf/message/mapper/ShortLInkMapper.java | 19 + .../jnpf/message/mapper/SmsFieldMapper.java | 19 + .../message/mapper/SynThirdInfoMapper.java | 17 + .../message/mapper/TemplateParamMapper.java | 19 + .../jnpf/message/mapper/UserDeviceMapper.java | 19 + .../jnpf/message/mapper/WechatUserMapper.java | 19 + .../message/service/ImContentService.java | 74 + .../jnpf/message/service/ImReplyService.java | 49 + .../message/service/UserDeviceService.java | 33 + .../impl/AccountConfigServiceImpl.java | 419 + .../service/impl/ImContentServiceImpl.java | 169 + .../service/impl/ImReplyServiceImpl.java | 154 + .../impl/MessageMonitorServiceImpl.java | 205 + .../service/impl/MessageServiceImpl.java | 861 ++ .../MessageTemplateConfigServiceImpl.java | 505 ++ .../impl/MessagereceiveServiceImpl.java | 22 + .../impl/SendConfigTemplateServiceImpl.java | 88 + .../impl/SendMessageConfigServiceImpl.java | 336 + .../service/impl/ShortLinkServiceImpl.java | 135 + .../service/impl/SmsFieldServiceImpl.java | 95 + .../impl/SynThirdDingTalkServiceImpl.java | 3347 ++++++++ .../service/impl/SynThirdInfoServiceImpl.java | 302 + .../service/impl/SynThirdQyServiceImpl.java | 3078 +++++++ .../impl/TemplateParamServiceImpl.java | 72 + .../service/impl/UserDeviceServiceImpl.java | 80 + .../service/impl/WechatUserServiceImpl.java | 68 + .../jnpf-message-controller/pom.xml | 22 + .../controller/AccountConfigController.java | 537 ++ .../message/controller/ImReplyController.java | 126 + .../message/controller/MessageController.java | 388 + .../controller/MessageMonitorController.java | 233 + .../MessageTemplateConfigController.java | 612 ++ .../SendMessageConfigController.java | 782 ++ .../controller/ShortLinkController.java | 126 + .../controller/WxGZHFunctionController.java | 269 + .../jnpf/message/websocket/WebSocket.java | 476 ++ .../jnpf-message/jnpf-message-entity/pom.xml | 47 + .../message/entity/AccountConfigEntity.java | 107 + .../jnpf/message/entity/ImContentEntity.java | 58 + .../jnpf/message/entity/ImReplyEntity.java | 40 + .../jnpf/message/entity/MessageEntity.java | 124 + .../message/entity/MessageMonitorEntity.java | 54 + .../message/entity/MessageReceiveEntity.java | 58 + .../entity/MessageTemplateConfigEntity.java | 53 + .../jnpf/message/entity/QyWebChatModel.java | 27 + .../entity/SendConfigRecordEntity.java | 37 + .../entity/SendConfigTemplateEntity.java | 54 + .../entity/SendMessageConfigEntity.java | 41 + .../jnpf/message/entity/ShortLinkEntity.java | 57 + .../jnpf/message/entity/SmsFieldEntity.java | 39 + .../message/entity/SynThirdInfoEntity.java | 49 + .../message/entity/TemplateParamEntity.java | 30 + .../jnpf/message/entity/UserDeviceEntity.java | 28 + .../jnpf/message/entity/WechatUserEntity.java | 36 + .../jnpf/message/enums/MessageTypeEnum.java | 83 + .../jnpf/message/model/ImReplyListModel.java | 78 + .../jnpf/message/model/ImReplyListVo.java | 66 + .../jnpf/message/model/ImReplySavaModel.java | 27 + .../jnpf/message/model/ImUnreadNumModel.java | 44 + .../java/jnpf/message/model/NoticeModel.java | 11 + .../jnpf/message/model/NoticePagination.java | 16 + .../jnpf/message/model/UserOnlineModel.java | 33 + .../java/jnpf/message/model/UserOnlineVO.java | 27 + .../jnpf/message/model/WxgzhMessageModel.java | 27 + .../accountconfig/AccountConfigForm.java | 209 + .../accountconfig/AccountConfigInfoVO.java | 195 + .../accountconfig/AccountConfigListVO.java | 108 + .../AccountConfigPagination.java | 75 + .../model/message/DingTalkDeptModel.java | 143 + .../message/model/message/DingTalkModel.java | 22 + .../model/message/DingTalkUserModel.java | 162 + .../message/model/message/EmailModel.java | 27 + .../message/model/message/MessageInfoVO.java | 48 + .../model/message/MessageNoticeVO.java | 58 + .../model/message/MessageRecordForm.java | 17 + .../message/model/message/NoticeCrForm.java | 39 + .../message/model/message/NoticeInfoVO.java | 56 + .../message/model/message/NoticeUpForm.java | 14 + .../jnpf/message/model/message/NoticeVO.java | 49 + .../model/message/OraganizeListVO.java | 30 + .../model/message/PaginationMessage.java | 28 + .../model/message/QyWebChatDeptModel.java | 35 + .../model/message/QyWebChatUserModel.java | 115 + .../model/message/SentMessageForm.java | 83 + .../model/message/SynThirdInfoCrForm.java | 78 + .../model/message/SynThirdInfoUpForm.java | 16 + .../messagedatatype/MessageDataTypeForm.java | 61 + .../MessageDataTypeInfoVO.java | 56 + .../MessageDataTypeListVO.java | 82 + .../MessageDataTypePagination.java | 48 + .../messagemonitor/MessageMonitorForm.java | 85 + .../messagemonitor/MessageMonitorInfoVO.java | 102 + .../messagemonitor/MessageMonitorListVO.java | 59 + .../MessageMonitorPagination.java | 66 + .../model/messagemonitor/MsgDelForm.java | 18 + .../MessageTemplateConfigForm.java | 118 + .../MessageTemplateConfigInfoVO.java | 160 + .../MessageTemplateConfigListVO.java | 146 + .../MessageTemplateConfigPagination.java | 66 + .../messagetemplateconfig/SmsFieldModel.java | 24 + .../TemplateParamModel.java | 40 + .../SendConfigRecordForm.java | 61 + .../SendConfigRecordInfoVO.java | 79 + .../SendConfigRecordListVO.java | 72 + .../SendConfigRecordPagination.java | 42 + .../MsgTemplateJsonModel.java | 22 + .../sendmessageconfig/SendConfigListVO.java | 47 + .../SendConfigTemplateModel.java | 50 + .../SendConfigTestResultModel.java | 33 + .../SendMessageConfigForm.java | 66 + .../SendMessageConfigInfoVO.java | 106 + .../SendMessageConfigListVO.java | 118 + .../SendMessageConfigPagination.java | 59 + .../model/websocket/MessageListVo.java | 34 + .../websocket/PaginationMessageModel.java | 31 + .../model/websocket/PaginationMessageVo.java | 36 + .../model/websocket/SendMessageModel.java | 33 + .../model/websocket/model/MessageModel.java | 20 + .../model/websocket/onclose/OnCloseModel.java | 25 + .../onconnettion/OnConnectionModel.java | 42 + .../websocket/onconnettion/OnLineModel.java | 28 + .../receivemessage/ReceiveMessageModel.java | 39 + .../receivemessage/ReceiveMessageVO.java | 35 + .../websocket/savafile/ImageMessageModel.java | 28 + .../websocket/savafile/MessageTypeModel.java | 20 + .../websocket/savafile/VoiceMessageModel.java | 25 + .../savamessage/SavaMessageModel.java | 45 + .../java/jnpf/message/util/Base64Util.java | 41 + .../jnpf/message/util/ConnectionType.java | 23 + .../java/jnpf/message/util/DingTalkUtil.java | 141 + .../java/jnpf/message/util/EmailUtil.java | 94 + .../jnpf/message/util/JnpfMessageUtil.java | 41 + .../jnpf/message/util/MessageChannelType.java | 43 + .../message/util/MessageParameterEnum.java | 37 + .../jnpf/message/util/MyBatisPrimaryBase.java | 88 + .../jnpf/message/util/OnlineUserModel.java | 45 + .../jnpf/message/util/OnlineUserProvider.java | 152 + .../java/jnpf/message/util/QyWebChatUtil.java | 91 + .../message/util/SendMessageTypeEnum.java | 43 + .../jnpf/message/util/SynThirdConsts.java | 72 + .../java/jnpf/message/util/SynThirdTotal.java | 49 + .../java/jnpf/message/util/WebHookUtil.java | 411 + .../jnpf/message/util/unipush/UinPush.java | 26 + .../util/weixingzh/WXGZHWebChatUtil.java | 371 + .../message/util/weixingzh/WxTemplateMsg.java | 64 + .../util/weixingzh/aes/AesException.java | 59 + .../message/util/weixingzh/aes/ByteGroup.java | 26 + .../util/weixingzh/aes/PKCS7Encoder.java | 67 + .../jnpf/message/util/weixingzh/aes/SHA1.java | 60 + .../util/weixingzh/aes/WXBizMsgCrypt.java | 287 + .../message/util/weixingzh/aes/XMLParse.java | 72 + jnpf-java-boot/jnpf-message/pom.xml | 21 + .../jnpf-oauth/jnpf-oauth-api/pom.xml | 22 + .../main/java/jnpf/service/AuthService.java | 15 + .../src/main/java/jnpf/util/AuthUtil.java | 100 + .../jnpf-oauth/jnpf-oauth-biz/pom.xml | 77 + .../jnpf/granter/PasswordTokenGranter.java | 245 + .../jnpf/granter/SocialsTokenGranter.java | 289 + .../jnpf/granter/TempUserTokenGranter.java | 134 + .../main/java/jnpf/listener/JnpfListener.java | 29 + .../java/jnpf/listener/LoginListener.java | 91 + .../jnpf/service/impl/AuthServiceImpl.java | 77 + .../jnpf/service/impl/LoginServiceImpl.java | 867 ++ .../UserDetailsByUserAccountServiceImpl.java | 37 + .../impl/UserDetailsByUserIdServiceImpl.java | 39 + .../src/main/java/jnpf/util/LoginHolder.java | 27 + .../jnpf-oauth/jnpf-oauth-controller/pom.xml | 22 + .../java/jnpf/controller/LoginController.java | 345 + .../jnpf-oauth/jnpf-oauth-entity/pom.xml | 32 + .../main/java/jnpf/entity/TenantEntity.java | 51 + .../java/jnpf/entity/TenantlogEntity.java | 82 + .../jnpf/model/BuildUserCommonInfoModel.java | 23 + .../java/jnpf/model/LoginConfigModel.java | 45 + .../src/main/java/jnpf/model/LoginModel.java | 43 + .../src/main/java/jnpf/model/LoginVO.java | 13 + .../java/jnpf/model/SocialUnbindModel.java | 20 + .../src/main/java/jnpf/model/UserLogForm.java | 17 + jnpf-java-boot/jnpf-oauth/pom.xml | 22 + .../jnpf-permission-biz/pom.xml | 46 + .../permission/constant/AuthorizeConst.java | 52 + .../permission/mapper/AuthorizeMapper.java | 51 + .../mapper/ColumnsPurviewMapper.java | 15 + .../jnpf/permission/mapper/GroupMapper.java | 17 + .../mapper/OrganizeAdminIsTratorMapper.java | 17 + .../permission/mapper/OrganizeMapper.java | 18 + .../mapper/OrganizeRelationMapper.java | 17 + .../mapper/PermissionGroupMapper.java | 7 + .../permission/mapper/PositionMapper.java | 27 + .../jnpf/permission/mapper/RoleMapper.java | 28 + .../permission/mapper/SocialsUserMapper.java | 16 + .../jnpf/permission/mapper/UserMapper.java | 33 + .../mapper/UserOldPasswordMapper.java | 17 + .../permission/mapper/UserRelationMapper.java | 18 + .../jnpf/permission/rest/PullUserUtil.java | 45 + .../service/ColumnsPurviewService.java | 33 + .../jnpf/permission/service/GroupService.java | 108 + .../service/OrganizeRelationService.java | 147 + .../permission/service/PositionService.java | 193 + .../jnpf/permission/service/RoleService.java | 211 + .../service/SocialsUserService.java | 51 + .../service/UserOldPasswordService.java | 32 + .../service/impl/AuthorizeServiceImpl.java | 809 ++ .../impl/ColumnsPurviewServiceImpl.java | 52 + .../service/impl/GroupServiceImpl.java | 153 + .../OrganizeAdministratorServiceImpl.java | 414 + .../impl/OrganizeRelationServiceImpl.java | 351 + .../service/impl/OrganizeServiceImpl.java | 948 +++ .../impl/PermissionGroupServiceImpl.java | 525 ++ .../service/impl/PositionServiceImpl.java | 430 + .../service/impl/RoleServiceImpl.java | 410 + .../service/impl/SocialsUserServiceImpl.java | 54 + .../service/impl/UserInfoServiceImpl.java | 73 + .../impl/UserOldPasswordServiceImpl.java | 51 + .../service/impl/UserRelationServiceImpl.java | 387 + .../service/impl/UserServiceImpl.java | 2165 +++++ .../jnpf/permission/util/PermissionUtil.java | 124 + .../util/socials/AuthCallbackNew.java | 17 + .../util/socials/AuthDefaultSourceNew.java | 57 + .../util/socials/AuthDingTalkNewRequest.java | 123 + .../util/socials/AuthSocialsUtil.java | 439 + .../socials/AuthWechatAppletsRequest.java | 88 + .../util/socials/SocialsAuthEnum.java | 102 + .../util/socials/SocialsConfig.java | 135 + .../jnpf-permission-controller/pom.xml | 32 + .../controller/AuthorizeController.java | 645 ++ .../controller/GroupController.java | 254 + .../OrganizeAdministratorController.java | 950 +++ .../controller/OrganizeController.java | 992 +++ .../controller/PermissionGroupController.java | 285 + .../controller/PositionController.java | 502 ++ .../permission/controller/RoleController.java | 727 ++ .../controller/SocialsUserController.java | 438 + .../permission/controller/UserController.java | 1471 ++++ .../controller/UserRelationController.java | 115 + .../controller/UserSettingController.java | 869 ++ .../jnpf-permission-entity/pom.xml | 31 + .../permission/entity/AuthorizeEntity.java | 46 + .../entity/ColumnsPurviewEntity.java | 33 + .../jnpf/permission/entity/GroupEntity.java | 43 + .../entity/OrganizeAdministratorEntity.java | 90 + .../permission/entity/OrganizeEntity.java | 60 + .../entity/OrganizeRelationEntity.java | 46 + .../entity/PermissionEntityBase.java | 41 + .../entity/PermissionGroupEntity.java | 30 + .../permission/entity/PositionEntity.java | 35 + .../jnpf/permission/entity/RoleEntity.java | 39 + .../jnpf/permission/entity/SignEntity.java | 34 + .../permission/entity/SocialsUserEntity.java | 46 + .../jnpf/permission/entity/UserEntity.java | 315 + .../entity/UserOldPasswordEntity.java | 47 + .../permission/entity/UserRelationEntity.java | 40 + .../authorize/AuthorizeConditionEnum.java | 89 + .../authorize/AuthorizeConditionModel.java | 17 + .../model/authorize/AuthorizeDataModel.java | 28 + .../authorize/AuthorizeDataReturnModel.java | 25 + .../authorize/AuthorizeDataReturnVO.java | 24 + .../model/authorize/AuthorizeDataUpForm.java | 33 + .../model/authorize/AuthorizeDataVO.java | 21 + .../authorize/AuthorizeDataValuesVO.java | 19 + .../authorize/AuthorizeItemObjIdsVO.java | 19 + .../model/authorize/AuthorizeModel.java | 20 + .../model/authorize/AuthorizeVO.java | 64 + .../model/authorize/ConditionModel.java | 34 + .../model/authorize/DataValuesQuery.java | 21 + .../authorize/OnlineDynamicSqlModel.java | 45 + .../model/authorize/ResourceVO.java | 27 + .../model/authorize/SaveAuthForm.java | 21 + .../model/authorize/SaveBatchForm.java | 34 + .../columnspurview/ColumnsPurviewUpForm.java | 24 + .../datainterface/DataInterfaceVarConst.java | 60 + .../model/organize/OrganizeByAuthModel.java | 13 + .../organize/OrganizeConditionModel.java | 22 + .../model/organize/OrganizeCrForm.java | 32 + .../model/organize/OrganizeCrModel.java | 38 + .../model/organize/OrganizeDepartCrForm.java | 34 + .../model/organize/OrganizeDepartInfoVO.java | 38 + .../model/organize/OrganizeDepartListVO.java | 39 + .../OrganizeDepartSelectorByAuthListVO.java | 20 + .../OrganizeDepartSelectorListVO.java | 38 + .../model/organize/OrganizeDepartUpForm.java | 14 + .../model/organize/OrganizeInfoVO.java | 37 + .../model/organize/OrganizeListVO.java | 53 + .../model/organize/OrganizeModel.java | 30 + .../organize/OrganizeSelectorByAuthVO.java | 43 + .../model/organize/OrganizeSelectorVO.java | 41 + .../model/organize/OrganizeTreeVO.java | 29 + .../model/organize/OrganizeUpForm.java | 14 + .../ModuleSelectorModel.java | 40 + .../ModuleSelectorVO.java | 34 + .../OrganizeAdminIsTratorCrForm.java | 40 + .../OrganizeAdministratorCrModel.java | 43 + .../OrganizeAdministratorListVo.java | 33 + .../OrganizeAdministratorModel.java | 27 + .../OrganizeAdministratorSelectedVO.java | 27 + .../OrganizeAdministratorSelectorModel.java | 38 + .../OrganizeAdministratorSelectorVO.java | 46 + .../SystemSelectorVO.java | 33 + .../model/permission/PermissionModel.java | 26 + .../model/permission/PermissionVoBase.java | 21 + .../PermissionGroupListVO.java | 24 + .../permissiongroup/PermissionGroupModel.java | 23 + .../AuthorizePortalManagePrimary.java | 45 + .../model/position/PaginationPosition.java | 18 + .../model/position/PosOrgConditionModel.java | 21 + .../model/position/PosOrgModel.java | 37 + .../position/PositionConditionSelectorVO.java | 25 + .../model/position/PositionCrForm.java | 37 + .../model/position/PositionInfoVO.java | 39 + .../model/position/PositionListAllVO.java | 20 + .../model/position/PositionListVO.java | 36 + .../model/position/PositionSelectorVO.java | 40 + .../model/position/PositionUpForm.java | 14 + .../permission/model/position/PositionVo.java | 22 + .../permission/model/role/RoleCrForm.java | 37 + .../permission/model/role/RoleInfoVO.java | 40 + .../permission/model/role/RoleListVO.java | 34 + .../jnpf/permission/model/role/RoleModel.java | 45 + .../permission/model/role/RolePagination.java | 9 + .../permission/model/role/RoleSelectorVO.java | 43 + .../permission/model/role/RoleUpForm.java | 15 + .../model/socails/SocialsUserInfo.java | 21 + .../model/socails/SocialsUserModel.java | 48 + .../model/socails/SocialsUserVo.java | 42 + .../permission/model/user/UserIdListVo.java | 51 + .../permission/model/user/UserLogForm.java | 17 + .../model/user/WorkHandoverModel.java | 21 + .../model/user/form/UserAppDataForm.java | 15 + .../model/user/form/UserCrForm.java | 99 + .../model/user/form/UserInfoForm.java | 31 + .../model/user/form/UserLanguageForm.java | 19 + .../user/form/UserModifyPasswordForm.java | 28 + .../model/user/form/UserPasswordForm.java | 17 + .../user/form/UserResetPasswordForm.java | 25 + .../model/user/form/UserSettingForm.java | 26 + .../model/user/form/UserThemeForm.java | 19 + .../model/user/form/UserUpAdminForm.java | 22 + .../model/user/form/UserUpForm.java | 15 + .../model/user/mod/UserAllModel.java | 33 + .../model/user/mod/UserAuthorizeModel.java | 25 + .../model/user/mod/UserByRoleModel.java | 34 + .../model/user/mod/UserConditionModel.java | 58 + .../model/user/mod/UserIdModel.java | 40 + .../model/user/mod/UserIdModelByPage.java | 16 + .../model/user/mod/UserImportModel.java | 65 + .../model/user/mod/UserSelectorModel.java | 24 + .../model/user/mod/UserUpModel.java | 26 + .../model/user/mod/UsersByPositionModel.java | 19 + .../permission/model/user/page/PageUser.java | 21 + .../model/user/page/PaginationUser.java | 23 + .../model/user/vo/ImUserListVo.java | 22 + .../permission/model/user/vo/UserAdminVO.java | 16 + .../permission/model/user/vo/UserAllVO.java | 23 + .../model/user/vo/UserAuthorizeVO.java | 24 + .../model/user/vo/UserBaseInfoVO.java | 73 + .../permission/model/user/vo/UserBaseVO.java | 24 + .../model/user/vo/UserByRoleVO.java | 45 + .../model/user/vo/UserExportExceptionVO.java | 61 + .../model/user/vo/UserExportVO.java | 85 + .../model/user/vo/UserImportVO.java | 38 + .../permission/model/user/vo/UserInfoVO.java | 76 + .../permission/model/user/vo/UserListVO.java | 41 + .../permission/model/user/vo/UserLogVO.java | 26 + .../model/user/vo/UserSelectorVO.java | 39 + .../model/user/vo/UserSubordinateVO.java | 29 + .../model/usergroup/GroupCrForm.java | 54 + .../model/usergroup/GroupInfoVO.java | 54 + .../model/usergroup/GroupPaginationVO.java | 35 + .../model/usergroup/GroupSelectorVO.java | 42 + .../model/usergroup/GroupTreeModel.java | 22 + .../model/usergroup/GroupUpForm.java | 57 + .../model/userrelation/UserRelationDel.java | 15 + .../model/userrelation/UserRelationForm.java | 21 + .../model/userrelation/UserRelationIdsVO.java | 17 + .../userrelation/UserRelationListVO.java | 31 + .../userrelation/UserRelationTreeModel.java | 26 + jnpf-java-boot/jnpf-permission/pom.xml | 21 + .../jnpf-public/jnpf-common-all/pom.xml | 36 + .../java/jnpf/model/AppDataInfoModel.java | 68 + .../java/jnpf/model/AppObjectDataModel.java | 21 + .../src/main/java/jnpf/model/LoginForm.java | 47 + .../java/jnpf/model/app/AppMenuModel.java | 21 + .../jnpf/onlinedev/model/OnlineDevData.java | 65 + .../jnpf-public/jnpf-generater-base/pom.xml | 33 + .../java/jnpf/model/FieLdsModelExcel.java | 14 + .../src/main/java/jnpf/model/QueryModel.java | 29 + .../src/main/java/jnpf/util/GenUtil.java | 501 ++ .../java/jnpf/util/GeneraterSwapUtil.java | 2545 ++++++ .../src/main/java/jnpf/util/QueryUtil.java | 239 + .../jnpf-public/jnpf-provider/pom.xml | 65 + .../base/service/DictionaryDataService.java | 160 + .../base/service/ModuleButtonService.java | 118 + .../base/service/ModuleColumnService.java | 148 + .../ModuleDataAuthorizeSchemeService.java | 102 + .../jnpf/base/service/ModuleFormService.java | 125 + .../java/jnpf/base/service/ModuleService.java | 198 + .../java/jnpf/base/service/SystemService.java | 126 + .../jnpf/engine/service/FlowTaskService.java | 212 + .../message/service/AccountConfigService.java | 93 + .../service/MessageMonitorService.java | 55 + .../jnpf/message/service/MessageService.java | 234 + .../service/MessageTemplateConfigService.java | 96 + .../service/MessagereceiveService.java | 18 + .../service/SendConfigTemplateService.java | 41 + .../service/SendMessageConfigService.java | 110 + .../message/service/ShortLinkService.java | 26 + .../jnpf/message/service/SmsFieldService.java | 31 + .../service/SynThirdDingTalkService.java | 244 + .../message/service/SynThirdInfoService.java | 82 + .../message/service/SynThirdQyService.java | 124 + .../message/service/TemplateParamService.java | 28 + .../message/service/WechatUserService.java | 29 + .../permission/service/AuthorizeService.java | 136 + .../service/OrganizeAdministratorService.java | 115 + .../permission/service/OrganizeService.java | 400 + .../service/PermissionGroupService.java | 137 + .../service/UserRelationService.java | 189 + .../jnpf/permission/service/UserService.java | 399 + .../jnpf-scheduletask-biz/pom.xml | 32 + .../task/ScheduleTaskHandler.java | 138 + .../jnpf-scheduletask-controller/pom.xml | 22 + .../controller/TimeTaskController.java | 186 + jnpf-java-boot/jnpf-scheduletask/pom.xml | 20 + .../jnpf-system/jnpf-system-biz/pom.xml | 50 + .../jnpf/base/mapper/AdvancedQueryMapper.java | 8 + .../jnpf/base/mapper/BaseComFieldsMapper.java | 16 + .../java/jnpf/base/mapper/BillRuleMapper.java | 18 + .../jnpf/base/mapper/CommonWordsMapper.java | 16 + .../base/mapper/DataInterfaceLogMapper.java | 17 + .../jnpf/base/mapper/DataInterfaceMapper.java | 19 + .../base/mapper/DataInterfaceUserMapper.java | 17 + .../mapper/DataInterfaceVariateMapper.java | 17 + .../java/jnpf/base/mapper/DataMapMapper.java | 19 + .../java/jnpf/base/mapper/DbLinkMapper.java | 18 + .../java/jnpf/base/mapper/DbTableMapper.java | 13 + .../base/mapper/DictionaryDataMapper.java | 18 + .../base/mapper/DictionaryTypeMapper.java | 18 + .../base/mapper/InterfaceOauthMapper.java | 18 + .../base/mapper/MessageTemplateMapper.java | 21 + .../jnpf/base/mapper/ModuleButtonMapper.java | 18 + .../jnpf/base/mapper/ModuleColumnMapper.java | 18 + .../ModuleDataAuthorizeLinkDataMapper.java | 19 + .../mapper/ModuleDataAuthorizeMapper.java | 18 + .../ModuleDataAuthorizeSchemeMapper.java | 18 + .../jnpf/base/mapper/ModuleFormMapper.java | 18 + .../java/jnpf/base/mapper/ModuleMapper.java | 18 + .../jnpf/base/mapper/PortalManageMapper.java | 32 + .../java/jnpf/base/mapper/PrintDevMapper.java | 16 + .../java/jnpf/base/mapper/PrintLogMapper.java | 11 + .../jnpf/base/mapper/ProvinceAtlasMapper.java | 16 + .../java/jnpf/base/mapper/ProvinceMapper.java | 18 + .../jnpf/base/mapper/ScheduleLogMapper.java | 16 + .../jnpf/base/mapper/ScheduleNewMapper.java | 16 + .../base/mapper/ScheduleNewUserMapper.java | 16 + .../java/jnpf/base/mapper/SignMapper.java | 15 + .../jnpf/base/mapper/SmsTemplateMapper.java | 19 + .../jnpf/base/mapper/SysconfigMapper.java | 23 + .../java/jnpf/base/mapper/SystemMapper.java | 18 + .../base/service/AdvancedQueryService.java | 26 + .../jnpf/base/service/BillRuleService.java | 145 + .../jnpf/base/service/ComFieldsService.java | 65 + .../jnpf/base/service/CommonWordsService.java | 41 + .../base/service/DataInterfaceLogService.java | 54 + .../base/service/DataInterfaceService.java | 145 + .../service/DataInterfaceUserService.java | 40 + .../service/DataInterfaceVariateService.java | 83 + .../jnpf/base/service/DataMapService.java | 84 + .../java/jnpf/base/service/DbLinkService.java | 112 + .../java/jnpf/base/service/DbSyncService.java | 59 + .../jnpf/base/service/DbTableService.java | 168 + .../base/service/DictionaryTypeService.java | 99 + .../jnpf/base/service/IPrintDevService.java | 93 + .../base/service/InterfaceOauthService.java | 86 + .../base/service/MessageTemplateService.java | 83 + .../ModuleDataAuthorizeLinkDataService.java | 24 + .../service/ModuleDataAuthorizeService.java | 66 + .../base/service/PortalManageService.java | 37 + .../jnpf/base/service/PrintLogService.java | 8 + .../base/service/ProvinceAtlasService.java | 20 + .../jnpf/base/service/ProvinceService.java | 142 + .../jnpf/base/service/ScheduleLogService.java | 51 + .../jnpf/base/service/ScheduleNewService.java | 108 + .../base/service/ScheduleNewUserService.java | 47 + .../java/jnpf/base/service/SignService.java | 50 + .../jnpf/base/service/SmsTemplateService.java | 88 + .../jnpf/base/service/SysconfigService.java | 79 + .../jnpf/base/service/UserOnlineService.java | 32 + .../impl/AdvancedQueryServiceImpl.java | 49 + .../service/impl/BillRuleServiceImpl.java | 285 + .../service/impl/ComFieldsServiceImpl.java | 82 + .../service/impl/CommonWordsServiceImpl.java | 80 + .../impl/DataInterfaceLogServiceImpl.java | 106 + .../impl/DataInterfaceServiceImpl.java | 1330 +++ .../impl/DataInterfaceUserServiceImpl.java | 88 + .../impl/DataInterfaceVariateServiceImpl.java | 96 + .../base/service/impl/DataMapServiceImpl.java | 118 + .../base/service/impl/DbLinkServiceImpl.java | 237 + .../base/service/impl/DbSyncServiceImpl.java | 334 + .../base/service/impl/DbTableServiceImpl.java | 340 + .../impl/DictionaryDataServiceImpl.java | 328 + .../impl/DictionaryTypeServiceImpl.java | 162 + .../impl/InterfaceOauthServiceImpl.java | 112 + .../impl/MessageTemplateServiceImpl.java | 116 + .../service/impl/ModuleButtonServiceImpl.java | 150 + .../service/impl/ModuleColumnServiceImpl.java | 227 + ...oduleDataAuthorizeLinkDataServiceImpl.java | 35 + .../ModuleDataAuthorizeSchemeServiceImpl.java | 131 + .../impl/ModuleDataAuthorizeServiceImpl.java | 79 + .../service/impl/ModuleFormServiceImpl.java | 159 + .../base/service/impl/ModuleServiceImpl.java | 546 ++ .../service/impl/PortalManageServiceImpl.java | 129 + .../service/impl/PrintDevServiceImpl.java | 419 + .../service/impl/PrintLogServiceImpl.java | 12 + .../impl/ProvinceAtlasServiceImpl.java | 42 + .../service/impl/ProvinceServiceImpl.java | 218 + .../service/impl/ScheduleLogServiceImpl.java | 76 + .../service/impl/ScheduleNewServiceImpl.java | 416 + .../impl/ScheduleNewUserServiceImpl.java | 78 + .../base/service/impl/SignServiceImpl.java | 93 + .../service/impl/SmsTemplateServiceImpl.java | 134 + .../service/impl/SysconfigServiceImpl.java | 166 + .../base/service/impl/SystemServiceImpl.java | 227 + .../service/impl/UserOnlineServiceImpl.java | 72 + .../java/jnpf/base/util/AnnotationType.java | 32 + .../main/java/jnpf/base/util/ClassUtil.java | 62 + .../base/util/DataInterfaceParamUtil.java | 38 + .../java/jnpf/base/util/FileManageUtil.java | 70 + .../main/java/jnpf/base/util/MonitorUtil.java | 198 + .../java/jnpf/base/util/OptimizeUtil.java | 53 + .../main/java/jnpf/base/util/Pop3Util.java | 527 ++ .../java/jnpf/base/util/PrintDevUtil.java | 40 + .../main/java/jnpf/base/util/RegexUtils.java | 173 + .../java/jnpf/base/util/SentMessageUtil.java | 1344 +++ .../java/jnpf/base/util/SmsAliYunUtil.java | 142 + .../jnpf/base/util/SmsTenCentCloudUtil.java | 165 + .../src/main/java/jnpf/base/util/SmsUtil.java | 68 + .../main/java/jnpf/base/util/SmtpUtil.java | 167 + .../main/java/jnpf/base/util/SourceUtil.java | 55 + .../java/jnpf/base/util/SynDingTalkUtil.java | 580 ++ .../java/jnpf/base/util/SynQyWebChatUtil.java | 458 ++ .../java/jnpf/base/util/TempJsonUtil.java | 1611 ++++ .../jnpf/base/util/TestSendConfigUtil.java | 1073 +++ .../java/jnpf/base/util/dbutil/TableUtil.java | 60 + .../util/interfaceUtil/InterfaceUtil.java | 133 + .../java/jnpf/base/util/job/Schedule.java | 62 + .../jnpf/base/util/job/ScheduleConfig.java | 28 + .../jnpf/base/util/job/ScheduleJobUtil.java | 92 + .../util/visualUtil/ChooseFiledTypeUtil.java | 41 + .../base/util/visualUtil/PubulishUtil.java | 580 ++ .../jnpf-system-controller/pom.xml | 27 + .../controller/AdvancedQueryController.java | 140 + .../jnpf/base/controller/AreaController.java | 285 + .../base/controller/BillRuleController.java | 304 + .../controller/CacheManageController.java | 138 + .../base/controller/ComFieldsController.java | 139 + .../controller/CommonWordsController.java | 179 + .../controller/DataInterfaceController.java | 654 ++ .../DataInterfaceLogController.java | 68 + .../DataInterfaceVariateController.java | 276 + .../base/controller/DbLinkController.java | 275 + .../base/controller/DbSyncController.java | 293 + .../base/controller/DbTableController.java | 400 + .../controller/DictionaryDataController.java | 444 + .../controller/DictionaryTypeController.java | 264 + .../controller/InterfaceOauthController.java | 301 + .../controller/MessageTemplateController.java | 270 + .../controller/ModuleButtonController.java | 206 + .../controller/ModuleColumnController.java | 388 + .../base/controller/ModuleController.java | 653 ++ .../ModuleDataAuthorizeController.java | 306 + .../ModuleDataAuthorizeLinkController.java | 184 + .../ModuleDataAuthorizeSchemeController.java | 163 + .../base/controller/ModuleFormController.java | 351 + .../base/controller/MonitorController.java | 42 + .../controller/PortalManageController.java | 96 + .../base/controller/PrintDevController.java | 452 ++ .../base/controller/PrintLogController.java | 125 + .../controller/ProvinceAtlasController.java | 198 + .../controller/ScheduleNewController.java | 258 + .../controller/SmsTemplateController.java | 234 + .../controller/SynThirdInfoController.java | 886 ++ .../base/controller/SysConfigController.java | 225 + .../base/controller/SystemController.java | 232 + .../base/controller/UserOnlineController.java | 86 + .../jnpf-system/jnpf-system-entity/pom.xml | 22 + .../jnpf/base/entity/AdvancedQueryEntity.java | 45 + .../java/jnpf/base/entity/BillRuleEntity.java | 86 + .../jnpf/base/entity/ComFieldsEntity.java | 37 + .../jnpf/base/entity/CommonWordsEntity.java | 42 + .../jnpf/base/entity/DataInterfaceEntity.java | 100 + .../base/entity/DataInterfaceLogEntity.java | 71 + .../base/entity/DataInterfaceUserEntity.java | 39 + .../entity/DataInterfaceVariateEntity.java | 39 + .../java/jnpf/base/entity/DbBackupEntity.java | 56 + .../base/entity/DictionaryDataEntity.java | 62 + .../base/entity/DictionaryTypeEntity.java | 57 + .../jnpf/base/entity/EmailConfigEntity.java | 75 + .../jnpf/base/entity/EmailReceiveEntity.java | 91 + .../base/entity/InterfaceOauthEntity.java | 74 + .../base/entity/MessageTemplateEntity.java | 97 + .../jnpf/base/entity/ModuleButtonEntity.java | 68 + .../jnpf/base/entity/ModuleColumnEntity.java | 80 + .../entity/ModuleDataAuthorizeEntity.java | 98 + .../entity/ModuleDataAuthorizeLinkEntity.java | 41 + .../ModuleDataAuthorizeSchemeEntity.java | 68 + .../java/jnpf/base/entity/ModuleEntity.java | 113 + .../jnpf/base/entity/ModuleFormEntity.java | 73 + .../base/entity/OperatorRecordEntity.java | 133 + .../jnpf/base/entity/PortalManageEntity.java | 41 + .../java/jnpf/base/entity/PrintDevEntity.java | 83 + .../java/jnpf/base/entity/PrintLogEntity.java | 34 + .../jnpf/base/entity/ProvinceAtlasEntity.java | 68 + .../java/jnpf/base/entity/ProvinceEntity.java | 56 + .../jnpf/base/entity/ScheduleLogEntity.java | 152 + .../jnpf/base/entity/ScheduleNewEntity.java | 134 + .../base/entity/ScheduleNewUserEntity.java | 38 + .../jnpf/base/entity/SmsTemplateEntity.java | 86 + .../jnpf/base/entity/SysConfigEntity.java | 45 + .../java/jnpf/base/entity/SystemEntity.java | 66 + .../jnpf/base/entity/VisualDataMapEntity.java | 98 + .../IdentDataInterfaceLogVO.java | 56 + .../IdentInterfaceListModel.java | 22 + .../InterfaceOauth/InterfaceIdentForm.java | 53 + .../InterfaceOauth/InterfaceIdentListVo.java | 53 + .../InterfaceOauth/InterfaceIdentVo.java | 90 + .../InterfaceOauth/InterfaceUserForm.java | 24 + .../model/InterfaceOauth/InterfaceUserVo.java | 25 + .../InterfaceOauth/PaginationIntrfaceLog.java | 17 + .../model/InterfaceOauth/PaginationOauth.java | 17 + .../java/jnpf/base/model/MailAccount.java | 23 + .../main/java/jnpf/base/model/MailFile.java | 12 + .../main/java/jnpf/base/model/MailModel.java | 23 + .../java/jnpf/base/model/PaginationPrint.java | 15 + .../jnpf/base/model/PrintDevTreeModel.java | 123 + .../jnpf/base/model/PrintTableTreeModel.java | 19 + .../base/model/RequestParameterModel.java | 27 + .../base/model/ResponseParametersModel.java | 27 + .../advancedquery/AdvancedQueryListVO.java | 10 + .../AdvancedQuerySchemeForm.java | 31 + .../jnpf/base/model/base/SystemBaeModel.java | 18 + .../jnpf/base/model/base/SystemCrModel.java | 47 + .../jnpf/base/model/base/SystemListVO.java | 56 + .../jnpf/base/model/base/SystemPageVO.java | 21 + .../jnpf/base/model/base/SystemUpModel.java | 15 + .../java/jnpf/base/model/base/SystemVO.java | 46 + .../base/model/billrule/BillRuleCrForm.java | 44 + .../base/model/billrule/BillRuleInfoVO.java | 39 + .../base/model/billrule/BillRuleListVO.java | 40 + .../model/billrule/BillRulePagination.java | 12 + .../base/model/billrule/BillRuleUpForm.java | 15 + .../jnpf/base/model/button/ButtonListVO.java | 22 + .../jnpf/base/model/button/ButtonModel.java | 19 + .../model/button/ButtonTreeListModel.java | 24 + .../model/button/ButtonTreeListSelectVO.java | 21 + .../base/model/button/ButtonTreeListVO.java | 37 + .../java/jnpf/base/model/button/ButtonVO.java | 29 + .../base/model/button/ModuleButtonCrForm.java | 32 + .../base/model/button/ModuleButtonInfoVO.java | 23 + .../base/model/button/ModuleButtonUpForm.java | 14 + .../model/cachemanage/CacheManageInfoVO.java | 19 + .../model/cachemanage/CacheManageListVO.java | 21 + .../base/model/column/ColumnBatchForm.java | 31 + .../jnpf/base/model/column/ColumnListVO.java | 27 + .../jnpf/base/model/column/ColumnModel.java | 19 + .../base/model/column/ModuleColumnCrForm.java | 46 + .../base/model/column/ModuleColumnInfoVO.java | 47 + .../base/model/column/ModuleColumnUpForm.java | 39 + .../base/model/comfields/ComFieldsCrForm.java | 33 + .../base/model/comfields/ComFieldsInfoVO.java | 31 + .../base/model/comfields/ComFieldsListVO.java | 23 + .../base/model/comfields/ComFieldsUpForm.java | 15 + .../model/commonword/ComWordsPagination.java | 23 + .../model/commonword/ComWordsTreeModel.java | 64 + .../model/commonword/CommonWordsForm.java | 39 + .../base/model/commonword/CommonWordsVO.java | 44 + .../model/datainterface/ApiDateModel.java | 24 + .../datainterface/DataConfigJsonModel.java | 22 + .../DataInterfaceActionModel.java | 29 + .../datainterface/DataInterfaceActionVo.java | 20 + .../datainterface/DataInterfaceCrForm.java | 49 + .../datainterface/DataInterfaceGetListVO.java | 38 + .../DataInterfaceInvokeModel.java | 36 + .../datainterface/DataInterfaceListVO.java | 27 + .../datainterface/DataInterfaceLogVO.java | 42 + .../datainterface/DataInterfaceMarkModel.java | 21 + .../datainterface/DataInterfaceModel.java | 26 + .../datainterface/DataInterfacePage.java | 42 + .../datainterface/DataInterfacePageModel.java | 28 + .../DataInterfaceParamModel.java | 22 + .../datainterface/DataInterfaceTreeModel.java | 12 + .../datainterface/DataInterfaceTreeVO.java | 21 + .../datainterface/DataInterfaceUpForm.java | 7 + .../model/datainterface/DataInterfaceVo.java | 44 + .../base/model/datainterface/ExtraModel.java | 15 + .../base/model/datainterface/FieldModel.java | 18 + .../base/model/datainterface/HeadModel.java | 13 + .../model/datainterface/PageParamModel.java | 15 + .../PaginationDataInterface.java | 25 + .../PaginationDataInterfaceModel.java | 24 + .../base/model/datainterface/ParamModel.java | 26 + .../model/datainterface/SqlDateModel.java | 14 + .../DataInterfaceVariateListVO.java | 16 + .../DataInterfaceVariateModel.java | 17 + .../DataInterfaceVariateSelectorVO.java | 15 + .../DataInterfaceVariateVO.java | 11 + .../base/model/dbbackup/DbBackupListVO.java | 31 + .../base/model/dblink/DbLinkBaseForm.java | 100 + .../base/model/dblink/DbLinkCreUpForm.java | 23 + .../jnpf/base/model/dblink/DbLinkInfoVO.java | 51 + .../jnpf/base/model/dblink/DbLinkListVO.java | 45 + .../jnpf/base/model/dblink/DbLinkModel.java | 24 + .../model/dblink/DbLinkSelectorListVO.java | 46 + .../base/model/dblink/PaginationDbLink.java | 21 + .../jnpf/base/model/dbsync/DbSyncForm.java | 36 + .../base/model/dbsync/DbSyncPrintForm.java | 42 + .../java/jnpf/base/model/dbsync/DbSyncVo.java | 35 + .../model/dbtable/dto/DbTableFieldDTO.java | 83 + .../base/model/dbtable/form/DbFieldForm.java | 47 + .../base/model/dbtable/form/DbTableForm.java | 29 + .../jnpf/base/model/dbtable/vo/DbFieldVO.java | 49 + .../base/model/dbtable/vo/DbTableInfoVO.java | 42 + .../base/model/dbtable/vo/DbTableListVO.java | 31 + .../jnpf/base/model/dbtable/vo/DbTableVO.java | 33 + .../DictionaryDataAllModel.java | 17 + .../dictionarydata/DictionaryDataAllVO.java | 23 + .../dictionarydata/DictionaryDataCrForm.java | 37 + .../DictionaryDataExportModel.java | 102 + .../dictionarydata/DictionaryDataInfoVO.java | 31 + .../DictionaryDataListTreeVO.java | 24 + .../dictionarydata/DictionaryDataListVO.java | 25 + .../dictionarydata/DictionaryDataModel.java | 22 + .../DictionaryDataSelectVO.java | 33 + .../dictionarydata/DictionaryDataUpForm.java | 15 + .../dictionarydata/PageDictionaryData.java | 18 + .../dictionarytype/DictionaryExportModel.java | 31 + .../dictionarytype/DictionaryTypeCrForm.java | 36 + .../dictionarytype/DictionaryTypeInfoVO.java | 31 + .../dictionarytype/DictionaryTypeListVO.java | 30 + .../dictionarytype/DictionaryTypeModel.java | 15 + .../DictionaryTypeSelectModel.java | 20 + .../DictionaryTypeSelectVO.java | 30 + .../dictionarytype/DictionaryTypeUpForm.java | 14 + .../jnpf/base/model/dto/PrintDevFormDTO.java | 68 + .../base/model/dto/PrintDevPaginationDTO.java | 125 + .../jnpf/base/model/form/FormBatchForm.java | 28 + .../base/model/form/ModuleFormCrForm.java | 38 + .../base/model/form/ModuleFormInfoVO.java | 42 + .../base/model/form/ModuleFormListVO.java | 38 + .../jnpf/base/model/form/ModuleFormModel.java | 19 + .../base/model/form/ModuleFormUpForm.java | 15 + .../MessageTemplateCrForm.java | 97 + .../MessageTemplateListVO.java | 78 + .../MessageTemplateSelector.java | 30 + .../MessageTemplateUpForm.java | 18 + .../messagetemplate/MessageTemplateVO.java | 98 + .../jnpf/base/model/module/MenuListVO.java | 42 + .../base/model/module/MenuSelectAllVO.java | 48 + .../jnpf/base/model/module/MenuSelectVO.java | 49 + .../jnpf/base/model/module/ModuleCrForm.java | 50 + .../base/model/module/ModuleExportModel.java | 24 + .../jnpf/base/model/module/ModuleInfoVO.java | 17 + .../jnpf/base/model/module/ModuleModel.java | 27 + .../model/module/ModulePermissionModel.java | 23 + .../base/model/module/ModulePermissionVO.java | 23 + .../jnpf/base/model/module/ModuleUpForm.java | 15 + .../java/jnpf/base/model/module/ModuleVO.java | 27 + .../base/model/module/PaginationMenu.java | 18 + .../base/model/module/PropertyJsonModel.java | 17 + .../DataAuthorizeCrForm.java | 41 + .../DataAuthorizeInfoVO.java | 38 + .../DataAuthorizeLinkForm.java | 29 + .../DataAuthorizeListVO.java | 45 + .../DataAuthorizeTableNameVO.java | 16 + .../DataAuthorizeUpForm.java | 15 + .../DataAuthorizeSchemeCrForm.java | 35 + .../DataAuthorizeSchemeInfoVO.java | 36 + .../DataAuthorizeSchemeListVO.java | 34 + .../DataAuthorizeSchemeUpForm.java | 6 + .../jnpf/base/model/monitor/CpuModel.java | 31 + .../jnpf/base/model/monitor/DiskModel.java | 23 + .../jnpf/base/model/monitor/MemoryModel.java | 23 + .../base/model/monitor/MonitorListVO.java | 25 + .../jnpf/base/model/monitor/SwapModel.java | 18 + .../jnpf/base/model/monitor/SystemModel.java | 21 + .../jnpf/base/model/online/AuthFlieds.java | 56 + .../base/model/online/BatchOnlineModel.java | 18 + .../jnpf/base/model/online/PerColModels.java | 44 + .../base/model/online/VisualMenuModel.java | 55 + .../portalManage/PortalManageCreForm.java | 57 + .../model/portalManage/PortalManagePage.java | 47 + .../portalManage/PortalManagePageDO.java | 66 + .../portalManage/PortalManagePrimary.java | 47 + .../portalManage/PortalManageUpForm.java | 54 + .../model/portalManage/PortalManageVO.java | 65 + .../model/portalManage/PortalPagination.java | 29 + .../jnpf/base/model/print/PrintOption.java | 12 + .../base/model/printlog/PrintLogInfo.java | 23 + .../base/model/printlog/PrintLogQuery.java | 15 + .../jnpf/base/model/province/AreaModel.java | 17 + .../model/province/AtlasFeaturesModel.java | 10 + .../base/model/province/AtlasJsonModel.java | 20 + .../base/model/province/AtlasPropModel.java | 18 + .../base/model/province/ProvinceCrForm.java | 39 + .../base/model/province/ProvinceInfoVO.java | 40 + .../model/province/ProvinceListTreeVO.java | 32 + .../base/model/province/ProvinceListVO.java | 33 + .../model/province/ProvinceSelectListVO.java | 23 + .../base/model/province/ProvinceUpForm.java | 15 + .../base/model/query/PrintDevDataQuery.java | 38 + .../base/model/query/PrintDevFieldsQuery.java | 33 + .../base/model/resource/ResourceModel.java | 21 + .../model/schedule/ScheduleDetailModel.java | 15 + .../base/model/schedule/ScheduleJobModel.java | 16 + .../model/schedule/ScheduleNewAppListVO.java | 19 + .../model/schedule/ScheduleNewCrForm.java | 49 + .../schedule/ScheduleNewDetailInfoVO.java | 18 + .../model/schedule/ScheduleNewInfoVO.java | 19 + .../model/schedule/ScheduleNewListVO.java | 70 + .../base/model/schedule/ScheduleNewTime.java | 15 + .../model/schedule/ScheduleNewUpForm.java | 6 + .../java/jnpf/base/model/sign/SignForm.java | 25 + .../java/jnpf/base/model/sign/SignListVO.java | 24 + .../model/smstemplate/SmsTemplateCrForm.java | 47 + .../model/smstemplate/SmsTemplateListVO.java | 24 + .../smstemplate/SmsTemplateSelector.java | 19 + .../model/smstemplate/SmsTemplateUpForm.java | 16 + .../base/model/smstemplate/SmsTemplateVO.java | 27 + .../model/systemconfig/EmailTestForm.java | 36 + .../model/systemconfig/SaveSysConfigForm.java | 17 + .../base/model/systemconfig/SmsModel.java | 29 + .../model/systemconfig/SysConfigListVO.java | 17 + .../model/systemconfig/SysConfigModel.java | 272 + .../jnpf/base/model/vo/PrintDevListVO.java | 35 + .../java/jnpf/base/model/vo/PrintDevVO.java | 124 + .../java/jnpf/base/model/vo/PrintLogVO.java | 30 + jnpf-java-boot/jnpf-system/pom.xml | 20 + .../jnpf-visualdata-biz/pom.xml | 27 + .../mapper/VisualCategoryMapper.java | 16 + .../mapper/VisualComponentMapper.java | 16 + .../visualdata/mapper/VisualConfigMapper.java | 16 + .../visualdata/mapper/VisualDbMapper.java | 16 + .../visualdata/mapper/VisualMapMapper.java | 16 + .../jnpf/visualdata/mapper/VisualMapper.java | 16 + .../visualdata/mapper/VisualRecordMapper.java | 16 + .../service/VisualCategoryService.java | 73 + .../service/VisualComponentService.java | 64 + .../service/VisualConfigService.java | 55 + .../visualdata/service/VisualDbService.java | 82 + .../visualdata/service/VisualMapService.java | 66 + .../service/VisualRecordService.java | 64 + .../visualdata/service/VisualService.java | 79 + .../impl/VisualCategoryServiceImpl.java | 78 + .../impl/VisualComponentServiceImpl.java | 69 + .../service/impl/VisualConfigServiceImpl.java | 56 + .../service/impl/VisualDbServiceImpl.java | 112 + .../service/impl/VisualMapServiceImpl.java | 70 + .../service/impl/VisualRecordServiceImpl.java | 68 + .../service/impl/VisualServiceImpl.java | 106 + .../jnpf-visualdata-controller/pom.xml | 22 + .../controller/VisualCategoryController.java | 155 + .../controller/VisualComponentController.java | 152 + .../controller/VisualController.java | 431 + .../controller/VisualDbController.java | 209 + .../controller/VisualMapController.java | 149 + .../controller/VisualRecordController.java | 156 + .../controller/aop/VisualBindAspect.java | 74 + .../utils/VisualDataPermissionUtil.java | 35 + .../jnpf-visualdata-entity/pom.xml | 29 + .../entity/VisualCategoryEntity.java | 41 + .../entity/VisualComponentEntity.java | 46 + .../visualdata/entity/VisualConfigEntity.java | 41 + .../visualdata/entity/VisualDbEntity.java | 83 + .../jnpf/visualdata/entity/VisualEntity.java | 75 + .../visualdata/entity/VisualMapEntity.java | 37 + .../visualdata/entity/VisualRecordEntity.java | 88 + .../jnpf/visualdata/enums/VisualImgEnum.java | 71 + .../jnpf/visualdata/model/VisualPageVO.java | 43 + .../visualdata/model/VisualPagination.java | 37 + .../model/visual/VisualApiRequest.java | 32 + .../model/visual/VisualCrModel.java | 21 + .../visualdata/model/visual/VisualCrform.java | 21 + .../model/visual/VisualInfoModel.java | 19 + .../visualdata/model/visual/VisualInfoVO.java | 21 + .../visualdata/model/visual/VisualListVO.java | 28 + .../visualdata/model/visual/VisualModel.java | 22 + .../model/visual/VisualPaginationModel.java | 21 + .../model/visual/VisualProxyModel.java | 36 + .../model/visual/VisualSelectorVO.java | 25 + .../model/visual/VisualUpModel.java | 21 + .../visualdata/model/visual/VisualUpform.java | 21 + .../visualcategory/VisualCategoryCrForm.java | 21 + .../visualcategory/VisualCategoryInfoVO.java | 23 + .../visualcategory/VisualCategoryListVO.java | 23 + .../visualcategory/VisualCategoryUpForm.java | 17 + .../VisualComponentCrForm.java | 31 + .../VisualComponentInfoVO.java | 15 + .../VisualComponentListVO.java | 27 + .../VisualComponentPaginationModel.java | 20 + .../VisualComponentUpForm.java | 15 + .../visualconfig/VisualConfigCrForm.java | 19 + .../visualconfig/VisualConfigInfoModel.java | 19 + .../visualconfig/VisualConfigUpForm.java | 19 + .../model/visualdb/VisualDbCrForm.java | 27 + .../model/visualdb/VisualDbInfoVO.java | 50 + .../model/visualdb/VisualDbListVO.java | 30 + .../model/visualdb/VisualDbQueryForm.java | 19 + .../model/visualdb/VisualDbSelectVO.java | 22 + .../model/visualdb/VisualDbUpForm.java | 19 + .../visualdata/model/visualfile/ImageVO.java | 23 + .../model/visualmap/VisualMapCrForm.java | 19 + .../model/visualmap/VisualMapInfoVO.java | 21 + .../model/visualmap/VisualMapListVO.java | 19 + .../model/visualmap/VisualMapUpForm.java | 17 + .../visualrecord/VisualRecordCrForm.java | 61 + .../visualrecord/VisualRecordInfoVO.java | 15 + .../visualrecord/VisualRecordListVO.java | 25 + .../visualrecord/VisualRecordUpForm.java | 15 + jnpf-java-boot/jnpf-visualdata/pom.xml | 20 + .../jnpf-visualdev-base-biz/pom.xml | 53 + .../java/jnpf/base/mapper/FilterMapper.java | 10 + .../jnpf/base/mapper/VisualdevMapper.java | 17 + .../base/mapper/VisualdevReleaseMapper.java | 17 + .../base/mapper/VisualdevShortLinkMapper.java | 14 + .../java/jnpf/base/service/FilterService.java | 25 + .../base/service/VisualdevReleaseService.java | 27 + .../jnpf/base/service/VisualdevService.java | 76 + .../service/VisualdevShortLinkService.java | 14 + .../base/service/impl/FilterServiceImpl.java | 188 + .../impl/VisualdevReleaseServiceImpl.java | 44 + .../service/impl/VisualdevServiceImpl.java | 424 + .../impl/VisualdevShortLinkServiceImpl.java | 19 + .../java/jnpf/base/util/OnlineFilterUtil.java | 744 ++ .../main/java/jnpf/base/util/ReadFile.java | 95 + .../main/java/jnpf/base/util/SourceUtil.java | 49 + .../jnpf/base/util/VisualFlowFormUtil.java | 290 + .../main/java/jnpf/base/util/VisualUtil.java | 448 + .../main/java/jnpf/base/util/VisualUtils.java | 688 ++ .../java/jnpf/base/util/app/AppGenModel.java | 77 + .../java/jnpf/base/util/app/AppGenUtil.java | 987 +++ .../base/util/common/DataControlUtils.java | 106 + .../jnpf/base/util/common/FormCommonUtil.java | 207 + .../util/common/FunctionFormPublicUtil.java | 233 + .../jnpf/base/util/common/SuperQueryUtil.java | 48 + .../base/util/custom/CustomGenerator.java | 171 + .../util/custom/CustomTemplateEngine.java | 75 + .../jnpf/base/util/custom/VelocityEnum.java | 20 + .../jnpf/base/util/form/FormGenModel.java | 83 + .../java/jnpf/base/util/form/FormGenUtil.java | 2001 +++++ .../util/fuctionFormVue3/GenerateForm.java | 39 + .../fuctionFormVue3/GenerateFormFlow.java | 40 + .../fuctionFormVue3/GenerateFormList.java | 56 + .../fuctionFormVue3/GenerateFormListFlow.java | 54 + .../fuctionFormVue3/GenerateWorkFlow.java | 36 + .../common/GenerateCommon.java | 612 ++ .../common/GenerateConstant.java | 31 + .../common/GenerateInterface.java | 30 + .../common/GenerateParamModel.java | 61 + .../util/functionForm/CodeGenerateUtil.java | 53 + .../base/util/functionForm/FlowFormUtil.java | 810 ++ .../base/util/functionForm/FormListUtil.java | 2030 +++++ .../jnpf/base/util/functionForm/FormUtil.java | 772 ++ .../util/functionForm/FunctionFlowUtil.java | 2006 +++++ .../jnpf/base/util/workFlow/WorkGenModel.java | 72 + .../jnpf/base/util/workFlow/WorkGenUtil.java | 1408 ++++ .../jnpf-visualdev-base-controller/pom.xml | 27 + .../base/controller/FilterController.java | 80 + .../base/controller/VisualdevController.java | 626 ++ .../VisualdevShortLinkController.java | 399 + .../jnpf-visualdev-base-entity/pom.xml | 22 + .../java/jnpf/base/entity/FilterEntity.java | 29 + .../jnpf/base/entity/VisualdevEntity.java | 110 + .../base/entity/VisualdevReleaseEntity.java | 111 + .../base/entity/VisualdevShortLinkEntity.java | 109 + .../java/jnpf/base/model/ColumnDataModel.java | 121 + .../jnpf/base/model/DownloadCodeForm.java | 49 + .../jnpf/base/model/ExportSelectedModel.java | 12 + .../java/jnpf/base/model/FormDataField.java | 14 + .../jnpf/base/model/PaginationVisualdev.java | 35 + .../base/model/Template6/AuthorityModel.java | 29 + .../jnpf/base/model/Template6/BtnData.java | 9 + .../base/model/Template6/ColumnListField.java | 34 + .../model/Template6/IndexGridField6Model.java | 18 + .../base/model/Template6/Template6Model.java | 64 + .../base/model/Template7/ChildrenModel.java | 20 + .../jnpf/base/model/Template7/HtmlModel.java | 26 + .../jnpf/base/model/Template7/KeyModel.java | 12 + .../jnpf/base/model/Template7/MastModel.java | 16 + .../model/Template7/Template7DataModel.java | 13 + .../base/model/Template7/Template7Model.java | 149 + .../java/jnpf/base/model/VisualDevCrForm.java | 53 + .../java/jnpf/base/model/VisualDevInfoVO.java | 55 + .../jnpf/base/model/VisualDevJsonModel.java | 67 + .../java/jnpf/base/model/VisualDevListVO.java | 23 + .../jnpf/base/model/VisualDevPubModel.java | 30 + .../java/jnpf/base/model/VisualDevUpForm.java | 17 + .../jnpf/base/model/VisualFunctionModel.java | 84 + .../java/jnpf/base/model/VisualTreeModel.java | 25 + .../jnpf/base/model/VisualWebTypeEnum.java | 34 + .../base/model/VisualdevTreeChildModel.java | 14 + .../java/jnpf/base/model/VisualdevTreeVO.java | 29 + .../jnpf/base/model/filter/FilterInfo.java | 13 + .../jnpf/base/model/filter/FilterQuery.java | 13 + .../java/jnpf/base/model/filter/RuleInfo.java | 50 + .../java/jnpf/base/model/read/ReadEnum.java | 72 + .../java/jnpf/base/model/read/ReadListVO.java | 18 + .../java/jnpf/base/model/read/ReadModel.java | 18 + .../shortLink/VisualdevShortLinkConfigVo.java | 42 + .../shortLink/VisualdevShortLinkForm.java | 44 + .../shortLink/VisualdevShortLinkModel.java | 22 + .../shortLink/VisualdevShortLinkPwd.java | 26 + .../model/shortLink/VisualdevShortLinkVo.java | 48 + .../jnpf-visualdev-base/pom.xml | 21 + .../jnpf-visualdev-generater-biz/pom.xml | 46 + .../factory/CodeGenerateFactory.java | 36 + .../factory/CodeGenerateFactoryV3.java | 1296 +++ .../service/VisualdevGenService.java | 29 + .../service/impl/VisualdevGenServiceImpl.java | 332 + .../pom.xml | 22 + .../controller/VisualdevGenController.java | 212 + .../jnpf-visualdev-generater-entity/pom.xml | 22 + .../FormDesign/ColumnChildListModel.java | 21 + .../model/FormDesign/ColumnListDataModel.java | 78 + .../model/FormDesign/ColumnListModel.java | 247 + .../FormDesign/ListSearchGroupModel.java | 37 + .../model/FormDesign/SearchTypeModel.java | 47 + .../model/FormDesign/TemplateMethodEnum.java | 30 + .../jnpf/generater/model/GenBaseInfo.java | 35 + .../generater/model/GenFileNameSuffix.java | 50 + .../jnpf-visualdev-generater/pom.xml | 21 + .../jnpf-visualdev-integrate-biz/pom.xml | 38 + .../integrate/config/IntegrateConfig.java | 29 + .../integrate/config/IntegrateListener.java | 51 + .../java/jnpf/integrate/job/Integrate.java | 87 + .../jnpf/integrate/job/IntegrateJobUtil.java | 71 + .../integrate/job/IntegrateQueryJobUtil.java | 104 + .../java/jnpf/integrate/job/QuartzUtil.java | 74 + .../integrate/mapper/IntegrateMapper.java | 8 + .../integrate/mapper/IntegrateNodeMapper.java | 9 + .../mapper/IntegrateQueueMapper.java | 9 + .../integrate/mapper/IntegrateTaskMapper.java | 8 + .../service/IntegrateNodeService.java | 25 + .../service/IntegrateQueueService.java | 20 + .../integrate/service/IntegrateService.java | 31 + .../service/IntegrateTaskService.java | 22 + .../impl/IntegrateNodeServiceImpl.java | 98 + .../impl/IntegrateQueueServiceImpl.java | 55 + .../service/impl/IntegrateServiceImpl.java | 214 + .../impl/IntegrateTaskServiceImpl.java | 96 + .../jnpf/integrate/util/IntegrateUtil.java | 867 ++ .../pom.xml | 23 + .../controller/IntegrateController.java | 257 + .../controller/IntegrateTaskController.java | 150 + .../jnpf-visualdev-integrate-entity/pom.xml | 24 + .../integrate/entity/IntegrateEntity.java | 53 + .../integrate/entity/IntegrateNodeEntity.java | 97 + .../entity/IntegrateQueueEntity.java | 44 + .../integrate/entity/IntegrateTaskEntity.java | 80 + .../model/childnode/IntegrateChildNode.java | 19 + .../model/childnode/IntegrateMsgModel.java | 20 + .../model/childnode/IntegrateParamModel.java | 19 + .../model/childnode/IntegrateProperties.java | 58 + .../childnode/IntegrateTemplateModel.java | 28 + .../model/childnode/TransferModel.java | 18 + .../model/integrate/IntegrateCrForm.java | 28 + .../model/integrate/IntegrateInfoVO.java | 30 + .../model/integrate/IntegrateListVO.java | 37 + .../model/integrate/IntegratePageModel.java | 23 + .../model/integrate/IntegratePagination.java | 18 + .../model/integrate/IntegrateUpForm.java | 14 + .../integratetask/IntegrateQueueListVO.java | 16 + .../integratetask/IntegrateTaskInfo.java | 18 + .../integratetask/IntegrateTaskListVO.java | 20 + .../integratetask/IntegrateTaskModel.java | 25 + .../nodeJson/IntegrateChildNodeList.java | 24 + .../nodeJson/IntegrateChildNodeModel.java | 35 + .../model/nodeJson/IntegrateModel.java | 24 + .../jnpf-visualdev-integrate/pom.xml | 21 + .../jnpf-visualdev-onlinedev-biz/pom.xml | 42 + .../mapper/VisualdevModelDataMapper.java | 17 + .../service/VisualDevInfoService.java | 31 + .../service/VisualDevListService.java | 79 + .../service/VisualdevModelDataService.java | 65 + .../impl/VisualDevInfoServiceImpl.java | 438 + .../impl/VisualDevListServiceImpl.java | 850 ++ .../impl/VisualdevModelDataServiceImpl.java | 456 ++ .../jnpf/onlinedev/util/AutoFeildsUtil.java | 136 + .../jnpf/onlinedev/util/OnlineDevDbUtil.java | 219 + .../onlineDevUtil/OnlineDatabaseUtils.java | 172 + .../onlineDevUtil/OnlineDevInfoUtils.java | 679 ++ .../onlineDevUtil/OnlineDevListUtils.java | 642 ++ .../onlineDevUtil/OnlineProductSqlUtils.java | 926 +++ .../util/onlineDevUtil/OnlinePublicUtils.java | 520 ++ .../onlineDevUtil/OnlineQuerySqlUtils.java | 187 + .../onlineDevUtil/OnlineSwapDataUtils.java | 2358 ++++++ .../util/onlineDevUtil/RelationFormUtils.java | 41 + .../pom.xml | 28 + .../VisualdevModelAppController.java | 80 + .../VisualdevModelDataController.java | 1063 +++ .../jnpf-visualdev-onlinedev-entity/pom.xml | 27 + .../entity/VisualdevModelDataEntity.java | 54 + .../jnpf/onlinedev/model/BaseDevModelVO.java | 62 + .../onlinedev/model/BatchRemoveIdsVo.java | 20 + .../onlinedev/model/ColumnDataInfoVO.java | 15 + .../java/jnpf/onlinedev/model/DataInfoVO.java | 22 + .../onlinedev/model/ExcelImFieldModel.java | 29 + .../jnpf/onlinedev/model/FormDataInfoVO.java | 15 + .../jnpf/onlinedev/model/OnlineDevData.java | 64 + .../model/OnlineDevEnum/CacheKeyEnum.java | 45 + .../OnlineDevEnum/MultipleControlEnum.java | 43 + .../OnlineDevEnum/OnlineDataTypeEnum.java | 53 + .../OnlineColumnChildFieldModel.java | 35 + .../OnlineColumnFieldModel.java | 33 + .../OnlineDevListModel/OnlineConfigModel.java | 65 + .../OnlineDevListDataVO.java | 18 + .../OnlineDevListModel/OnlineFieldsModel.java | 21 + .../OnlineListSqlModel.java | 25 + .../OnlineDevListModel/PropsFatherModel.java | 15 + .../model/OnlineDevListModel/PropsModel.java | 18 + .../model/OnlineDevListModel/SlotModel.java | 18 + .../VisualColumnSearchVO.java | 74 + .../model/OnlineImport/ExcelImportModel.java | 41 + .../model/OnlineImport/ImportDataModel.java | 12 + .../OnlineImport/ImportExcelFieldModel.java | 19 + .../ImportFormCheckUniqueModel.java | 33 + .../OnlineImport/OnlineExportExceptionVO.java | 15 + .../model/OnlineImport/VisualImportModel.java | 26 + .../jnpf/onlinedev/model/PaginationModel.java | 32 + .../model/PaginationModelExport.java | 22 + .../onlinedev/model/PortalDefaultDTO.java | 28 + .../model/VisualdevModelDataCrForm.java | 31 + .../model/VisualdevModelDataInfoVO.java | 17 + .../model/VisualdevModelDataListVO.java | 17 + .../model/VisualdevModelDataUpForm.java | 18 + .../model/fields/autosize/AutosizeModel.java | 8 + .../fields/options/ColumnOptionModel.java | 15 + .../model/fields/options/OptionsModel.java | 12 + .../fields/picker/PickerOptionsModel.java | 7 + .../model/fields/style/StyleModel.java | 7 + .../model/fields/style/textStyleModel.java | 11 + .../visualdevmodelApp/AppDataInfoVO.java | 14 + .../jnpf-visualdev-onlinedev/pom.xml | 21 + .../jnpf-visualdev-portal-biz/pom.xml | 37 + .../jnpf/portal/mapper/PortalDataMapper.java | 17 + .../java/jnpf/portal/mapper/PortalMapper.java | 16 + .../portal/service/PortalDataService.java | 70 + .../jnpf/portal/service/PortalService.java | 68 + .../service/impl/PortalDataServiceImpl.java | 381 + .../service/impl/PortalServiceImpl.java | 315 + .../jnpf-visualdev-portal-controller/pom.xml | 32 + .../controller/DashboardController.java | 157 + .../portal/controller/PortalController.java | 305 + .../controller/PortalDataController.java | 121 + .../jnpf-visualdev-portal-entity/pom.xml | 22 + .../jnpf/portal/constant/PortalConst.java | 37 + .../jnpf/portal/entity/PortalDataEntity.java | 45 + .../java/jnpf/portal/entity/PortalEntity.java | 51 + .../main/java/jnpf/portal/model/EmailVO.java | 12 + .../main/java/jnpf/portal/model/FlowTodo.java | 12 + .../jnpf/portal/model/FlowTodoCountVO.java | 10 + .../java/jnpf/portal/model/FlowTodoVO.java | 35 + .../java/jnpf/portal/model/MyFlowTodoVO.java | 11 + .../java/jnpf/portal/model/PortalCrForm.java | 43 + .../portal/model/PortalCustomPrimary.java | 58 + .../jnpf/portal/model/PortalDataForm.java | 26 + .../jnpf/portal/model/PortalDefaultDTO.java | 28 + .../jnpf/portal/model/PortalExportDataVo.java | 56 + .../jnpf/portal/model/PortalInfoAuthVO.java | 29 + .../java/jnpf/portal/model/PortalInfoVO.java | 28 + .../jnpf/portal/model/PortalListModel.java | 26 + .../java/jnpf/portal/model/PortalListVO.java | 28 + .../jnpf/portal/model/PortalModPrimary.java | 40 + .../jnpf/portal/model/PortalPagination.java | 30 + .../jnpf/portal/model/PortalReleaseForm.java | 28 + .../portal/model/PortalReleasePrimary.java | 44 + .../jnpf/portal/model/PortalReleaseVO.java | 22 + .../jnpf/portal/model/PortalSelectModel.java | 20 + .../jnpf/portal/model/PortalSelectVO.java | 34 + .../jnpf/portal/model/PortalTreeModel.java | 23 + .../java/jnpf/portal/model/PortalUpForm.java | 28 + .../jnpf/portal/model/PortalViewPrimary.java | 37 + .../java/jnpf/portal/model/ReleaseModel.java | 23 + .../jnpf-visualdev-portal/pom.xml | 21 + jnpf-java-boot/jnpf-visualdev/pom.xml | 23 + jnpf-java-boot/jnpf-web/.editorconfig | 14 + jnpf-java-boot/jnpf-web/.env.development | 3 + jnpf-java-boot/jnpf-web/.env.production | 5 + jnpf-java-boot/jnpf-web/.eslintignore | 5 + jnpf-java-boot/jnpf-web/.eslintrc.js | 198 + jnpf-java-boot/jnpf-web/.gitignore | 70 + jnpf-java-boot/jnpf-web/Dockerfile | 11 + jnpf-java-boot/jnpf-web/README.md | 130 + jnpf-java-boot/jnpf-web/babel.config.js | 14 + jnpf-java-boot/jnpf-web/build/index.js | 37 + jnpf-java-boot/jnpf-web/conf/default.conf | 66 + jnpf-java-boot/jnpf-web/jest.config.js | 24 + jnpf-java-boot/jnpf-web/plopfile.js | 9 + jnpf-java-boot/jnpf-web/postcss.config.js | 5 + .../public/cdn/echarts/echarts.min.js | 45 + .../browser/ui/codicons/codicon/codicon.ttf | Bin 0 -> 61024 bytes .../monaco-editor/base/worker/workerMain.js | 160 + .../basic-languages/abap/abap.js | 7 + .../basic-languages/apex/apex.js | 7 + .../basic-languages/azcli/azcli.js | 7 + .../monaco-editor/basic-languages/bat/bat.js | 7 + .../basic-languages/cameligo/cameligo.js | 7 + .../basic-languages/clojure/clojure.js | 7 + .../basic-languages/coffee/coffee.js | 7 + .../monaco-editor/basic-languages/cpp/cpp.js | 7 + .../basic-languages/csharp/csharp.js | 7 + .../monaco-editor/basic-languages/csp/csp.js | 7 + .../monaco-editor/basic-languages/css/css.js | 7 + .../basic-languages/dart/dart.js | 7 + .../basic-languages/dockerfile/dockerfile.js | 7 + .../basic-languages/fsharp/fsharp.js | 7 + .../monaco-editor/basic-languages/go/go.js | 7 + .../basic-languages/graphql/graphql.js | 7 + .../basic-languages/handlebars/handlebars.js | 7 + .../monaco-editor/basic-languages/hcl/hcl.js | 7 + .../basic-languages/html/html.js | 7 + .../monaco-editor/basic-languages/ini/ini.js | 7 + .../basic-languages/java/java.js | 7 + .../basic-languages/javascript/javascript.js | 7 + .../basic-languages/julia/julia.js | 7 + .../basic-languages/kotlin/kotlin.js | 7 + .../basic-languages/less/less.js | 7 + .../basic-languages/lexon/lexon.js | 7 + .../monaco-editor/basic-languages/lua/lua.js | 7 + .../basic-languages/markdown/markdown.js | 7 + .../basic-languages/mips/mips.js | 7 + .../basic-languages/msdax/msdax.js | 7 + .../basic-languages/mysql/mysql.js | 7 + .../objective-c/objective-c.js | 7 + .../basic-languages/pascal/pascal.js | 7 + .../basic-languages/pascaligo/pascaligo.js | 7 + .../basic-languages/perl/perl.js | 7 + .../basic-languages/pgsql/pgsql.js | 7 + .../monaco-editor/basic-languages/php/php.js | 7 + .../basic-languages/postiats/postiats.js | 7 + .../basic-languages/powerquery/powerquery.js | 7 + .../basic-languages/powershell/powershell.js | 7 + .../monaco-editor/basic-languages/pug/pug.js | 7 + .../basic-languages/python/python.js | 7 + .../cdn/monaco-editor/basic-languages/r/r.js | 7 + .../basic-languages/razor/razor.js | 7 + .../basic-languages/redis/redis.js | 7 + .../basic-languages/redshift/redshift.js | 7 + .../restructuredtext/restructuredtext.js | 7 + .../basic-languages/ruby/ruby.js | 7 + .../basic-languages/rust/rust.js | 7 + .../monaco-editor/basic-languages/sb/sb.js | 7 + .../basic-languages/scala/scala.js | 7 + .../basic-languages/scheme/scheme.js | 7 + .../basic-languages/scss/scss.js | 7 + .../basic-languages/shell/shell.js | 7 + .../basic-languages/solidity/solidity.js | 7 + .../basic-languages/sophia/sophia.js | 7 + .../monaco-editor/basic-languages/sql/sql.js | 7 + .../monaco-editor/basic-languages/st/st.js | 7 + .../basic-languages/swift/swift.js | 10 + .../systemverilog/systemverilog.js | 7 + .../monaco-editor/basic-languages/tcl/tcl.js | 7 + .../basic-languages/twig/twig.js | 7 + .../basic-languages/typescript/typescript.js | 7 + .../monaco-editor/basic-languages/vb/vb.js | 7 + .../monaco-editor/basic-languages/xml/xml.js | 7 + .../basic-languages/yaml/yaml.js | 7 + .../cdn/monaco-editor/editor/editor.main.css | 6 + .../cdn/monaco-editor/editor/editor.main.js | 2368 ++++++ .../editor/editor.main.nls.de.js | 42 + .../editor/editor.main.nls.es.js | 42 + .../editor/editor.main.nls.fr.js | 43 + .../editor/editor.main.nls.it.js | 43 + .../editor/editor.main.nls.ja.js | 31 + .../monaco-editor/editor/editor.main.nls.js | 39 + .../editor/editor.main.nls.ko.js | 31 + .../editor/editor.main.nls.ru.js | 42 + .../editor/editor.main.nls.zh-cn.js | 26 + .../editor/editor.main.nls.zh-tw.js | 27 + .../cdn/monaco-editor/language/css/cssMode.js | 7 + .../monaco-editor/language/css/cssWorker.js | 7 + .../monaco-editor/language/html/htmlMode.js | 7 + .../monaco-editor/language/html/htmlWorker.js | 7 + .../monaco-editor/language/json/jsonMode.js | 7 + .../monaco-editor/language/json/jsonWorker.js | 7 + .../language/typescript/tsMode.js | 7 + .../language/typescript/tsWorker.js | 21 + .../public/cdn/monaco-editor/loader.js | 38 + .../jnpf-web/public/cdn/socials/dingtalk.png | Bin 0 -> 1258 bytes .../jnpf-web/public/cdn/socials/feishu.png | Bin 0 -> 1869 bytes .../jnpf-web/public/cdn/socials/gitHub.png | Bin 0 -> 2735 bytes .../jnpf-web/public/cdn/socials/qq.png | Bin 0 -> 3207 bytes .../public/cdn/socials/wechat_open.png | Bin 0 -> 1607 bytes .../jnpf-web/public/cdn/socials/wxWork.png | Bin 0 -> 1884 bytes .../public/cdn/tinymce/langs/zh_CN.js | 389 + .../cdn/tinymce/plugins/advlist/plugin.min.js | 9 + .../cdn/tinymce/plugins/anchor/plugin.min.js | 9 + .../tinymce/plugins/autolink/plugin.min.js | 9 + .../tinymce/plugins/autosave/plugin.min.js | 9 + .../cdn/tinymce/plugins/charmap/plugin.min.js | 9 + .../cdn/tinymce/plugins/code/plugin.min.js | 9 + .../tinymce/plugins/codesample/plugin.min.js | 9 + .../plugins/directionality/plugin.min.js | 9 + .../plugins/emoticons/js/emojis.min.js | 2 + .../tinymce/plugins/emoticons/plugin.min.js | 9 + .../tinymce/plugins/fullscreen/plugin.min.js | 9 + .../cdn/tinymce/plugins/help/plugin.min.js | 9 + .../cdn/tinymce/plugins/hr/plugin.min.js | 9 + .../cdn/tinymce/plugins/image/plugin.min.js | 9 + .../tinymce/plugins/imagetools/plugin.min.js | 9 + .../tinymce/plugins/importcss/plugin.min.js | 9 + .../plugins/insertdatetime/plugin.min.js | 9 + .../tinymce/plugins/lineheight/plugin.min.js | 58 + .../cdn/tinymce/plugins/link/plugin.min.js | 9 + .../cdn/tinymce/plugins/lists/plugin.min.js | 9 + .../cdn/tinymce/plugins/media/plugin.min.js | 9 + .../tinymce/plugins/nonbreaking/plugin.min.js | 9 + .../tinymce/plugins/noneditable/plugin.min.js | 9 + .../tinymce/plugins/pagebreak/plugin.min.js | 9 + .../cdn/tinymce/plugins/paste/plugin.min.js | 9 + .../cdn/tinymce/plugins/preview/plugin.min.js | 9 + .../cdn/tinymce/plugins/print/plugin.min.js | 9 + .../tinymce/plugins/quickbars/plugin.min.js | 9 + .../tinymce/plugins/rowspacing/plugin.min.js | 97 + .../cdn/tinymce/plugins/save/plugin.min.js | 9 + .../plugins/searchreplace/plugin.min.js | 9 + .../cdn/tinymce/plugins/table/plugin.min.js | 9 + .../tinymce/plugins/textpattern/plugin.min.js | 9 + .../cdn/tinymce/plugins/toc/plugin.min.js | 9 + .../plugins/visualblocks/plugin.min.js | 9 + .../tinymce/plugins/visualchars/plugin.min.js | 9 + .../tinymce/plugins/wordcount/plugin.min.js | 9 + .../skins/content/default/content.min.css | 8 + .../tinymce/skins/ui/wukong/content.min.css | 7 + .../cdn/tinymce/skins/ui/wukong/skin.min.css | 7 + .../cdn/tinymce/themes/silver/theme.min.js | 9 + .../public/cdn/tinymce/tinymce.min.js | 9 + jnpf-java-boot/jnpf-web/public/favicon.ico | Bin 0 -> 9662 bytes jnpf-java-boot/jnpf-web/public/index.html | 27 + jnpf-java-boot/jnpf-web/src/App.vue | 11 + jnpf-java-boot/jnpf-web/src/api/common.js | 83 + .../jnpf-web/src/api/extend/bigData.js | 16 + .../jnpf-web/src/api/extend/document.js | 129 + .../src/api/extend/documentPreview.js | 17 + .../jnpf-web/src/api/extend/email.js | 99 + .../jnpf-web/src/api/extend/employee.js | 48 + .../jnpf-web/src/api/extend/order.js | 68 + .../jnpf-web/src/api/extend/projectGantt.js | 78 + .../jnpf-web/src/api/extend/saleOrder.js | 85 + .../jnpf-web/src/api/extend/tableExample.js | 116 + jnpf-java-boot/jnpf-web/src/api/home.js | 39 + .../src/api/msgCenter/accountConfig.js | 61 + .../jnpf-web/src/api/msgCenter/msgMonitor.js | 31 + .../jnpf-web/src/api/msgCenter/msgTemplate.js | 61 + .../jnpf-web/src/api/msgCenter/sendConfig.js | 70 + .../jnpf-web/src/api/onlineDev/dataReport.js | 39 + .../jnpf-web/src/api/onlineDev/dataV.js | 9 + .../jnpf-web/src/api/onlineDev/integrate.js | 106 + .../jnpf-web/src/api/onlineDev/portal.js | 110 + .../jnpf-web/src/api/onlineDev/schedule.js | 47 + .../jnpf-web/src/api/onlineDev/visualDev.js | 239 + .../jnpf-web/src/api/onlineDev/webDesign.js | 67 + .../jnpf-web/src/api/permission/authorize.js | 110 + .../jnpf-web/src/api/permission/department.js | 68 + .../src/api/permission/gradeManage.js | 37 + .../jnpf-web/src/api/permission/group.js | 59 + .../jnpf-web/src/api/permission/onlineUser.js | 25 + .../jnpf-web/src/api/permission/organize.js | 121 + .../jnpf-web/src/api/permission/position.js | 86 + .../jnpf-web/src/api/permission/role.js | 85 + .../src/api/permission/socialsUser.js | 78 + .../jnpf-web/src/api/permission/user.js | 260 + .../src/api/permission/userRelation.js | 19 + .../src/api/permission/userSetting.js | 134 + .../jnpf-web/src/api/system/advancedQuery.js | 40 + .../jnpf-web/src/api/system/authorize.js | 35 + .../jnpf-web/src/api/system/billRule.js | 76 + .../src/api/system/buttonAuthorize.js | 62 + .../jnpf-web/src/api/system/cacheManage.js | 27 + .../src/api/system/columnAuthorize.js | 63 + .../jnpf-web/src/api/system/commonWords.js | 48 + .../jnpf-web/src/api/system/dataAuthorize.js | 94 + .../jnpf-web/src/api/system/formAuthorize.js | 61 + jnpf-java-boot/jnpf-web/src/api/system/log.js | 25 + .../jnpf-web/src/api/system/menu.js | 105 + .../jnpf-web/src/api/system/message.js | 108 + .../src/api/system/messageTemplate.js | 62 + .../jnpf-web/src/api/system/monitor.js | 9 + .../jnpf-web/src/api/system/portal.js | 60 + .../jnpf-web/src/api/system/printDev.js | 103 + .../jnpf-web/src/api/system/province.js | 71 + .../jnpf-web/src/api/system/smsTemplate.js | 78 + .../jnpf-web/src/api/system/sysConfig.js | 94 + .../jnpf-web/src/api/system/system.js | 47 + .../jnpf-web/src/api/system/timeTask.js | 69 + .../src/api/systemData/commonFields.js | 40 + .../jnpf-web/src/api/systemData/dataBackup.js | 26 + .../src/api/systemData/dataInterface.js | 187 + .../jnpf-web/src/api/systemData/dataModel.js | 78 + .../jnpf-web/src/api/systemData/dataSource.js | 84 + .../jnpf-web/src/api/systemData/dictionary.js | 135 + .../src/api/systemData/interfaceOauth.js | 87 + jnpf-java-boot/jnpf-web/src/api/user.js | 62 + .../jnpf-web/src/api/workFlow/FlowBefore.js | 216 + .../jnpf-web/src/api/workFlow/FlowDelegate.js | 66 + .../jnpf-web/src/api/workFlow/FlowEngine.js | 203 + .../src/api/workFlow/FlowEngineForm.js | 47 + .../jnpf-web/src/api/workFlow/FlowLaunch.js | 32 + .../jnpf-web/src/api/workFlow/FlowMonitor.js | 17 + .../jnpf-web/src/api/workFlow/FormDesign.js | 90 + .../jnpf-web/src/api/workFlow/workFlowForm.js | 18 + .../custom-theme/fonts/element-icons.ttf | Bin 0 -> 11028 bytes .../custom-theme/fonts/element-icons.woff | Bin 0 -> 6124 bytes .../src/assets/custom-theme/index.css | 1 + .../src/assets/fonts/ym-custom/iconfont.css | 7203 +++++++++++++++++ .../src/assets/fonts/ym-custom/iconfont.ttf | Bin 0 -> 311288 bytes .../src/assets/fonts/ym-custom/iconfont.woff | Bin 0 -> 157768 bytes .../src/assets/fonts/ym-custom/iconfont.woff2 | Bin 0 -> 121936 bytes .../jnpf-web/src/assets/fonts/ym/iconfont.css | 1999 +++++ .../jnpf-web/src/assets/fonts/ym/iconfont.ttf | Bin 0 -> 134392 bytes .../src/assets/fonts/ym/iconfont.woff | Bin 0 -> 81592 bytes .../src/assets/fonts/ym/iconfont.woff2 | Bin 0 -> 67144 bytes .../jnpf-web/src/assets/images/404.png | Bin 0 -> 47439 bytes .../src/assets/images/dashboard-nodata.png | Bin 0 -> 16503 bytes .../src/assets/images/emptyElement.png | Bin 0 -> 72490 bytes .../src/assets/images/emptyPortal.png | Bin 0 -> 30271 bytes .../src/assets/images/flowStatus/adopt.png | Bin 0 -> 13089 bytes .../src/assets/images/flowStatus/cancel.png | Bin 0 -> 12576 bytes .../src/assets/images/flowStatus/draft.png | Bin 0 -> 12972 bytes .../src/assets/images/flowStatus/reject.png | Bin 0 -> 12000 bytes .../src/assets/images/flowStatus/revoke.png | Bin 0 -> 13511 bytes .../src/assets/images/flowStatus/wait.png | Bin 0 -> 13028 bytes .../assets/images/generator/columnType1.png | Bin 0 -> 807 bytes .../assets/images/generator/columnType2.png | Bin 0 -> 1004 bytes .../assets/images/generator/columnType3.png | Bin 0 -> 2056 bytes .../assets/images/generator/columnType4.png | Bin 0 -> 1417 bytes .../assets/images/generator/columnType5.png | Bin 0 -> 2213 bytes .../jnpf-web/src/assets/images/gg.png | Bin 0 -> 6865 bytes .../jnpf-web/src/assets/images/home/Group.png | Bin 0 -> 1011 bytes .../src/assets/images/home/Group2.png | Bin 0 -> 1112 bytes .../src/assets/images/home/Group3.png | Bin 0 -> 944 bytes .../src/assets/images/home/anouance.png | Bin 0 -> 470 bytes .../jnpf-web/src/assets/images/home/ask.png | Bin 0 -> 356 bytes .../jnpf-web/src/assets/images/home/bg.png | Bin 0 -> 8041 bytes .../jnpf-web/src/assets/images/home/pay.png | Bin 0 -> 544 bytes .../src/assets/images/home/return.png | Bin 0 -> 1074 bytes .../jnpf-web/src/assets/images/home/sold.png | Bin 0 -> 1151 bytes .../jnpf-web/src/assets/images/import.png | Bin 0 -> 6833 bytes .../jnpf-web/src/assets/images/iphoneBg.png | Bin 0 -> 20167 bytes .../jnpf-web/src/assets/images/jnpf.png | Bin 0 -> 1917 bytes .../jnpf-web/src/assets/images/jnpf1.png | Bin 0 -> 11527 bytes .../jnpf-web/src/assets/images/jnpf2.png | Bin 0 -> 11546 bytes .../src/assets/images/loading-iframe.gif | Bin 0 -> 103756 bytes .../src/assets/images/login-banner.png | Bin 0 -> 107229 bytes .../src/assets/images/login-company-logo.png | Bin 0 -> 8689 bytes .../jnpf-web/src/assets/images/login_logo.png | Bin 0 -> 22518 bytes .../jnpf-web/src/assets/images/login_qr.png | Bin 0 -> 7981 bytes .../src/assets/images/login_version.png | Bin 0 -> 4266 bytes .../src/assets/images/other-login-dialog.png | Bin 0 -> 107140 bytes .../src/assets/images/portal-nodata.png | Bin 0 -> 9486 bytes .../src/assets/images/query-noData.png | Bin 0 -> 13138 bytes .../src/assets/images/rankList/badge1.png | Bin 0 -> 7751 bytes .../src/assets/images/rankList/badge2.png | Bin 0 -> 7418 bytes .../src/assets/images/rankList/badge3.png | Bin 0 -> 6530 bytes .../src/assets/images/rankList/cup1.png | Bin 0 -> 15889 bytes .../src/assets/images/rankList/cup2.png | Bin 0 -> 9718 bytes .../src/assets/images/rankList/cup3.png | Bin 0 -> 10253 bytes .../src/assets/images/rankList/medal1.png | Bin 0 -> 21643 bytes .../src/assets/images/rankList/medal2.png | Bin 0 -> 13770 bytes .../src/assets/images/rankList/medal3.png | Bin 0 -> 14929 bytes .../src/assets/images/rankList/rank1.png | Bin 0 -> 3699 bytes .../src/assets/images/rankList/rank2.png | Bin 0 -> 3421 bytes .../src/assets/images/rankList/rank3.png | Bin 0 -> 3682 bytes .../src/assets/images/settings/blend.png | Bin 0 -> 698 bytes .../src/assets/images/settings/classic.png | Bin 0 -> 644 bytes .../src/assets/images/settings/dark.png | Bin 0 -> 661 bytes .../src/assets/images/settings/functional.png | Bin 0 -> 658 bytes .../src/assets/images/settings/lightWhite.png | Bin 0 -> 612 bytes .../src/assets/images/settings/plain.png | Bin 0 -> 650 bytes .../jnpf-web/src/assets/images/sign.gif | Bin 0 -> 6344 bytes .../jnpf-web/src/assets/images/success.png | Bin 0 -> 4106 bytes .../jnpf-web/src/assets/images/tip.png | Bin 0 -> 7603 bytes .../jnpf-web/src/assets/images/tz.png | Bin 0 -> 7029 bytes .../jnpf-web/src/assets/images/upload.png | Bin 0 -> 6739 bytes .../jnpf-web/src/assets/images/xsl.png | Bin 0 -> 2999 bytes .../jnpf-web/src/assets/images/xsl1.png | Bin 0 -> 3085 bytes .../jnpf-web/src/assets/scss/common.scss | 2754 +++++++ .../jnpf-web/src/assets/scss/font.scss | 2 + .../jnpf-web/src/assets/scss/theme.scss | 588 ++ .../src/components/ChangeField/index.vue | 230 + .../src/components/Charts/Keyboard.vue | 155 + .../src/components/Charts/LineMarker.vue | 227 + .../src/components/Charts/MixChart.vue | 272 + .../jnpf-web/src/components/Charts/Normal.vue | 72 + .../src/components/Charts/mixins/resize.js | 56 + .../src/components/ColumnDesign/CustomBtn.vue | 393 + .../components/ColumnDesign/FlowCondition.vue | 139 + .../components/ColumnDesign/FormScript.vue | 84 + .../ColumnDesign/condition/index.vue | 562 ++ .../src/components/ColumnDesign/index.scss | 276 + .../src/components/ColumnDesign/index.vue | 117 + .../src/components/ColumnDesign/main.vue | 1268 +++ .../src/components/ColumnDesign/mainApp.vue | 778 ++ .../src/components/ColumnDesign/uploadBox.vue | 112 + .../src/components/ColumnSettings/index.vue | 157 + .../src/components/ExportBox/index.vue | 67 + .../Generator/components/Amount/index.vue | 47 + .../Generator/components/BillRule/index.vue | 219 + .../components/ComplexHeader/index.vue | 141 + .../Generator/components/DicSelect/index.vue | 97 + .../components/JnpfDateRangePicker/index.vue | 64 + .../Generator/components/JnpfNumber/index.vue | 95 + .../Generator/components/NumRange/index.vue | 69 + .../Generator/components/UserSelect/index.vue | 48 + .../Generator/generator/comConfig.js | 102 + .../components/Generator/generator/config.js | 1766 ++++ .../src/components/Generator/generator/css.js | 18 + .../Generator/generator/drawingDefalut.js | 35 + .../components/Generator/generator/html.js | 508 ++ .../src/components/Generator/generator/js.js | 256 + .../Generator/generator/ruleTrigger.js | 27 + .../Generator/index/DraggableItem.vue | 386 + .../Generator/index/DraggableItemApp.vue | 346 + .../Generator/index/FieldDialog.vue | 224 + .../components/Generator/index/FormScript.vue | 121 + .../src/components/Generator/index/Home.vue | 920 +++ .../components/Generator/index/JsonDrawer.vue | 89 + .../index/RightComponents/BatchEditing.vue | 129 + .../index/RightComponents/ComRight.vue | 230 + .../index/RightComponents/RAlert.vue | 79 + .../index/RightComponents/RAreaSelect.vue | 105 + .../index/RightComponents/RAutoComplete.vue | 134 + .../index/RightComponents/RCalculate.vue | 251 + .../RightComponents/RCascader/TreeEditing.vue | 173 + .../RCascader/TreeNodeDialog.vue | 68 + .../index/RightComponents/RCascader/index.vue | 334 + .../index/RightComponents/RCheckbox.vue | 249 + .../index/RightComponents/RCollapse.vue | 69 + .../index/RightComponents/RColorPicker.vue | 90 + .../index/RightComponents/RDatePicker.vue | 314 + .../index/RightComponents/RDateRange.vue | 133 + .../index/RightComponents/RDivider.vue | 25 + .../index/RightComponents/RGroupTitle.vue | 22 + .../index/RightComponents/RInput.vue | 180 + .../index/RightComponents/RInputNumber.vue | 97 + .../Generator/index/RightComponents/RLink.vue | 34 + .../index/RightComponents/RPopupAttr.vue | 69 + .../index/RightComponents/RPopupSelect.vue | 207 + .../index/RightComponents/RRadio.vue | 246 + .../Generator/index/RightComponents/RRate.vue | 63 + .../index/RightComponents/RRelationForm.vue | 149 + .../RightComponents/RRelationFormAttr.vue | 102 + .../index/RightComponents/RSelect.vue | 236 + .../index/RightComponents/RSlider.vue | 54 + .../index/RightComponents/RSwitch.vue | 51 + .../Generator/index/RightComponents/RTab.vue | 85 + .../RightComponents/RTable/AddTableForm.vue | 253 + .../index/RightComponents/RTable/index.vue | 105 + .../Generator/index/RightComponents/RText.vue | 55 + .../index/RightComponents/RTextarea.vue | 58 + .../index/RightComponents/RTimePicker.vue | 308 + .../index/RightComponents/RTimeRange.vue | 59 + .../RTreeSelect/TreeEditing.vue | 173 + .../RTreeSelect/TreeNodeDialog.vue | 68 + .../RightComponents/RTreeSelect/index.vue | 322 + .../index/RightComponents/RUploadFile.vue | 103 + .../index/RightComponents/RUploadImg.vue | 74 + .../index/RightComponents/dynamicMixin.js | 133 + .../index/RightComponents/handelFlidMixin.js | 42 + .../Generator/index/RightComponents/mixin.js | 68 + .../Generator/index/RightComponents/tpl.vue | 29 + .../components/Generator/index/RightPanel.vue | 1482 ++++ .../components/Generator/index/ScriptDemo.vue | 86 + .../Generator/index/StyleScript.vue | 65 + .../components/Generator/parser/Parser.vue | 1067 +++ .../Generator/parser/example/Index.vue | 324 + .../src/components/Generator/parser/index.js | 3 + .../components/Generator/preview/index.vue | 71 + .../src/components/Generator/render/render.js | 109 + .../src/components/Generator/styles/home.scss | 555 ++ .../components/Generator/styles/index.scss | 136 + .../src/components/Generator/utils/db.js | 54 + .../src/components/Generator/utils/index.js | 512 ++ .../src/components/Hamburger/index.vue | 30 + .../src/components/HeaderSearch/index.vue | 209 + .../src/components/JNPF-TreeTransfer/array.js | 91 + .../components/JNPF-TreeTransfer/index.vue | 811 ++ .../src/components/JNPF-enlarge/index.vue | 40 + .../src/components/JNPF-iconBox/index.vue | 165 + .../src/components/JNPF-table/Column.vue | 23 + .../components/JNPF-table/ColumnSettings.vue | 133 + .../src/components/JNPF-table/index.vue | 182 + .../components/JNPF-tableOperation/index.vue | 85 + .../components/JNPF-topOperation/index.vue | 74 + .../src/components/JNPF-transfer/index.vue | 186 + .../src/components/JNPF-uploadBtn/index.vue | 75 + .../src/components/JNPF-userBox/index.vue | 92 + .../components/JNPF-userTransfer/index.vue | 286 + .../components/JNPF-usersTransfer/index.vue | 339 + .../src/components/JNPFCustom/index.vue | 221 + .../src/components/JNPFEditor/monaco.vue | 93 + .../src/components/JNPFEditor/quill.vue | 124 + .../src/components/JNPFImport/index.vue | 334 + .../src/components/Jnpf/Alert/index.vue | 9 + .../src/components/Jnpf/AreaSelect/index.vue | 387 + .../components/Jnpf/AutoComplete/index.vue | 143 + .../src/components/Jnpf/Barcode/index.vue | 137 + .../src/components/Jnpf/Button/index.vue | 32 + .../src/components/Jnpf/Calculate/index.vue | 115 + .../src/components/Jnpf/Cascader/index.vue | 72 + .../src/components/Jnpf/Checkbox/index.vue | 112 + .../src/components/Jnpf/ColorPicker/index.vue | 33 + .../src/components/Jnpf/DatePicker/index.vue | 137 + .../src/components/Jnpf/DepSelect/index.vue | 387 + .../src/components/Jnpf/Divider/index.vue | 15 + .../src/components/Jnpf/GroupSelect/index.vue | 372 + .../src/components/Jnpf/GroupTitle/index.vue | 37 + .../src/components/Jnpf/Input/index.vue | 54 + .../src/components/Jnpf/InputNumber/index.vue | 229 + .../src/components/Jnpf/InputTable/index.vue | 1113 +++ .../src/components/Jnpf/Link/index.vue | 47 + .../src/components/Jnpf/OpenData/index.vue | 74 + .../components/Jnpf/OrganizeSelect/index.vue | 446 + .../src/components/Jnpf/PopupAttr/index.vue | 56 + .../src/components/Jnpf/PopupSelect/index.vue | 367 + .../Jnpf/PopupTableSelect/index.vue | 487 ++ .../src/components/Jnpf/PosSelect/index.vue | 381 + .../src/components/Jnpf/Qrcode/index.vue | 130 + .../src/components/Jnpf/Radio/index.vue | 111 + .../src/components/Jnpf/Rate/index.vue | 37 + .../components/Jnpf/RelationForm/index.vue | 349 + .../Jnpf/RelationFormAttr/index.vue | 56 + .../src/components/Jnpf/RoleSelect/index.vue | 429 + .../src/components/Jnpf/Select/index.vue | 97 + .../src/components/Jnpf/Slider/index.vue | 33 + .../src/components/Jnpf/Switch/index.vue | 36 + .../src/components/Jnpf/Text/index.vue | 34 + .../src/components/Jnpf/Textarea/index.vue | 45 + .../src/components/Jnpf/TimePicker/index.vue | 102 + .../src/components/Jnpf/TreeSelect/index.vue | 315 + .../src/components/Jnpf/Upload/Preview.vue | 108 + .../src/components/Jnpf/Upload/UploadFile.vue | 241 + .../src/components/Jnpf/Upload/UploadImg.vue | 204 + .../Upload/vue-simple-uploader/fileItem.vue | 374 + .../vue-simple-uploader/fileUploader.vue | 185 + .../Jnpf/Upload/vue-simple-uploader/mixin.js | 161 + .../src/components/Jnpf/UserSelect/index.vue | 623 ++ .../src/components/Jnpf/UsersSelect/index.vue | 677 ++ .../src/components/JsonEditor/codemirror.css | 537 ++ .../src/components/JsonEditor/index.vue | 113 + .../src/components/LangSelect/index.vue | 50 + .../src/components/Pagination/index.vue | 95 + .../src/components/PreviewDialog/index.vue | 156 + .../src/components/PrintBrowse/batch.vue | 96 + .../src/components/PrintBrowse/index.vue | 46 + .../src/components/PrintBrowse/printMinxin.js | 561 ++ .../src/components/PrintDialog/index.vue | 67 + .../components/Process/FlowCard/Preview.vue | 157 + .../src/components/Process/FlowCard/config.js | 210 + .../components/Process/FlowCard/index.scss | 605 ++ .../src/components/Process/FlowCard/index.vue | 326 + .../src/components/Process/FlowCard/util.js | 476 ++ .../components/Process/OrgSelect/index.vue | 200 + .../components/Process/OrgTransfer/index.vue | 127 + .../Process/OrgTransfer/orgTransfer.vue | 178 + .../Process/OrgTransfer/positionTransfer.vue | 174 + .../Process/OrgTransfer/roleTransfer.vue | 221 + .../Process/OrgUsersSelect/index.vue | 386 + .../src/components/Process/Preview.vue | 260 + .../Process/PropPanel/FlowDialog.vue | 202 + .../Process/PropPanel/FlowFormDialog.vue | 204 + .../Process/PropPanel/InterfaceDialog.vue | 262 + .../Process/PropPanel/TemplateDetail.vue | 326 + .../Process/PropPanel/formulaData.js | 57 + .../Process/PropPanel/formulaDialog.vue | 94 + .../components/Process/PropPanel/index.vue | 4411 ++++++++++ .../Process/PropPanel/msgDialog.vue | 188 + .../jnpf-web/src/components/Process/index.vue | 397 + .../jnpf-web/src/components/Process/main.vue | 230 + .../src/components/Schedule/index.vue | 152 + .../src/components/ScheduleView/index.vue | 152 + .../src/components/Screenfull/index.vue | 64 + .../src/components/SelectDialog/index.vue | 213 + .../src/components/SignImgDialog/index.vue | 142 + .../src/components/SizeSelect/index.vue | 58 + .../src/components/SuperQuery/index.vue | 336 + .../src/components/Upload/SingleImg.vue | 179 + .../components/Upload/UploadFileSingle.vue | 64 + .../VisualPortal/CardHeader/index.vue | 57 + .../VisualPortal/HBarChart/index.vue | 19 + .../components/VisualPortal/HCard/index.vue | 81 + .../VisualPortal/HCarousel/index.vue | 114 + .../VisualPortal/HCommonFunc/index.vue | 86 + .../VisualPortal/HDataBoard/index.vue | 131 + .../components/VisualPortal/HEmail/index.vue | 44 + .../components/VisualPortal/HIframe/index.vue | 28 + .../components/VisualPortal/HImage/index.vue | 84 + .../VisualPortal/HLineChart/index.vue | 19 + .../VisualPortal/HMapChart/index.vue | 581 ++ .../components/VisualPortal/HNotice/index.vue | 308 + .../VisualPortal/HPieChart/index.vue | 19 + .../VisualPortal/HRadarChart/index.vue | 19 + .../VisualPortal/HRankList/index.vue | 282 + .../VisualPortal/HSchedule/Form.vue | 548 ++ .../VisualPortal/HSchedule/calendar.js | 665 ++ .../VisualPortal/HSchedule/index.vue | 289 + .../components/VisualPortal/HTable/index.vue | 270 + .../components/VisualPortal/HText/index.vue | 64 + .../VisualPortal/HTimeAxis/index.vue | 287 + .../components/VisualPortal/HTodo/index.vue | 116 + .../VisualPortal/HTodoList/index.vue | 48 + .../components/VisualPortal/HVideo/index.vue | 67 + .../components/VisualPortal/Layout/index.vue | 96 + .../components/VisualPortal/Link/index.vue | 81 + .../RightComponents/chat/BarStyle.vue | 25 + .../RightComponents/chat/Chart.vue | 792 ++ .../RightComponents/chat/Color.vue | 55 + .../RightComponents/chat/Data.vue | 83 + .../RightComponents/chat/Label.vue | 65 + .../RightComponents/chat/Legend.vue | 44 + .../RightComponents/chat/MainTitle.vue | 38 + .../RightComponents/chat/Margin.vue | 50 + .../RightComponents/chat/SubTitle.vue | 29 + .../RightComponents/chat/Tooltip.vue | 34 + .../RightComponents/chat/XAxis.vue | 74 + .../RightComponents/chat/YAxis.vue | 58 + .../RightComponents/common/Card.vue | 74 + .../RightComponents/common/CarouselData.vue | 223 + .../RightComponents/common/Collapse.vue | 64 + .../RightComponents/common/ColumnData.vue | 198 + .../RightComponents/common/CommonFunData.vue | 209 + .../RightComponents/common/DataBoardData.vue | 245 + .../RightComponents/common/Link.vue | 169 + .../RightComponents/common/MapSet.vue | 183 + .../RightComponents/common/Notice.vue | 192 + .../common/NoticeColumnData.vue | 245 + .../RightComponents/common/Refresh.vue | 18 + .../RightComponents/common/Schedule.vue | 77 + .../RightComponents/common/Tab.vue | 100 + .../RightComponents/common/Table.vue | 222 + .../RightComponents/common/Text.vue | 53 + .../RightComponents/common/TodoData.vue | 136 + .../PortalDesign/components/AddBtn.vue | 63 + .../PortalDesign/components/JSONArea.vue | 48 + .../PortalDesign/components/Preview.vue | 56 + .../PortalDesign/components/RightPanel.vue | 308 + .../PortalDesign/components/config.js | 1909 +++++ .../PortalDesign/components/data.js | 479 ++ .../PortalDesign/components/index.vue | 629 ++ .../PortalDesign/components/parser.vue | 274 + .../PortalDesign/components/popupEditor.vue | 45 + .../VisualPortal/PortalDesign/index.vue | 183 + .../src/components/VisualPortal/index.js | 21 + .../components/VisualPortal/mixins/common.js | 159 + .../components/VisualPortal/mixins/index.js | 434 + .../components/VisualPortal/mixins/useRedo.js | 48 + .../jnpf-web/src/components/index.js | 125 + .../integrationProcess/FlowCard/Preview.vue | 157 + .../integrationProcess/FlowCard/config.js | 131 + .../integrationProcess/FlowCard/define.js | 91 + .../integrationProcess/FlowCard/index.scss | 605 ++ .../integrationProcess/FlowCard/index.vue | 233 + .../integrationProcess/FlowCard/util.js | 481 ++ .../PropPanel/AddDataNode.vue | 357 + .../PropPanel/DataInterfaceNode.vue | 137 + .../PropPanel/DeleteDataNode.vue | 608 ++ .../PropPanel/FormListModal.vue | 196 + .../PropPanel/GetDataNode.vue | 290 + .../PropPanel/InterfaceDialog.vue | 256 + .../PropPanel/MessageNode.vue | 164 + .../PropPanel/StartNode.vue | 448 + .../PropPanel/UpdateDataNode.vue | 687 ++ .../integrationProcess/PropPanel/index.vue | 742 ++ .../components/integrationProcess/index.vue | 145 + .../components/integrationProcess/main.vue | 230 + .../components/jnpf-form-tip-item/index.vue | 40 + .../src/directive/clipboard/clipboard.js | 49 + .../jnpf-web/src/directive/clipboard/index.js | 13 + .../src/directive/el-drag-dialog/drag.js | 79 + .../src/directive/el-drag-dialog/index.js | 13 + .../src/directive/permission/index.js | 13 + .../src/directive/permission/permission.js | 22 + jnpf-java-boot/jnpf-web/src/filters/index.js | 231 + jnpf-java-boot/jnpf-web/src/lang/en.js | 285 + jnpf-java-boot/jnpf-web/src/lang/index.js | 50 + jnpf-java-boot/jnpf-web/src/lang/zh.js | 286 + jnpf-java-boot/jnpf-web/src/lang/zhtw.js | 286 + .../jnpf-web/src/layout/blend/Navbar.vue | 55 + .../jnpf-web/src/layout/blend/index.js | 4 + .../jnpf-web/src/layout/blend/index.vue | 97 + .../src/layout/blend/menu/FixiOSBug.js | 25 + .../jnpf-web/src/layout/blend/menu/Item.vue | 29 + .../src/layout/blend/menu/SidebarItem.vue | 108 + .../jnpf-web/src/layout/blend/menu/index.vue | 134 + .../src/layout/blend/sidebar/FixiOSBug.js | 25 + .../src/layout/blend/sidebar/Item.vue | 29 + .../src/layout/blend/sidebar/Link.vue | 43 + .../src/layout/blend/sidebar/Logo.vue | 81 + .../src/layout/blend/sidebar/SidebarItem.vue | 104 + .../src/layout/blend/sidebar/index.vue | 61 + .../jnpf-web/src/layout/blend/topMenu.vue | 111 + .../jnpf-web/src/layout/classic/Navbar.vue | 46 + .../jnpf-web/src/layout/classic/index.js | 4 + .../jnpf-web/src/layout/classic/index.vue | 97 + .../src/layout/classic/sidebar/FixiOSBug.js | 25 + .../src/layout/classic/sidebar/Item.vue | 29 + .../src/layout/classic/sidebar/Link.vue | 43 + .../src/layout/classic/sidebar/Logo.vue | 71 + .../layout/classic/sidebar/SidebarItem.vue | 104 + .../src/layout/classic/sidebar/index.vue | 78 + .../src/layout/components/AppMain.vue | 122 + .../src/layout/components/MessageList.vue | 426 + .../src/layout/components/NavbarRight.vue | 470 ++ .../src/layout/components/ResetPassword.vue | 202 + .../src/layout/components/settings/index.vue | 378 + .../src/layout/components/settings/minix.js | 149 + .../layout/components/tagsView/ScrollPane.vue | 96 + .../src/layout/components/tagsView/index.vue | 339 + .../src/layout/components/userList/Im.vue | 749 ++ .../layout/components/userList/UserList.vue | 446 + .../jnpf-web/src/layout/functional/Logo.vue | 55 + .../jnpf-web/src/layout/functional/Navbar.vue | 37 + .../jnpf-web/src/layout/functional/index.js | 3 + .../jnpf-web/src/layout/functional/index.vue | 90 + .../src/layout/functional/menu/FixiOSBug.js | 25 + .../src/layout/functional/menu/Item.vue | 29 + .../src/layout/functional/menu/Link.vue | 43 + .../layout/functional/menu/SidebarItem.vue | 104 + .../src/layout/functional/menu/index.vue | 87 + jnpf-java-boot/jnpf-web/src/layout/index.vue | 45 + .../src/layout/mixin/ResizeHandler.js | 53 + .../jnpf-web/src/layout/plain/Navbar.vue | 30 + .../jnpf-web/src/layout/plain/index.js | 4 + .../jnpf-web/src/layout/plain/index.vue | 88 + .../src/layout/plain/sidebar/FixiOSBug.js | 25 + .../src/layout/plain/sidebar/Item.vue | 29 + .../src/layout/plain/sidebar/Link.vue | 43 + .../src/layout/plain/sidebar/Logo.vue | 46 + .../src/layout/plain/sidebar/SidebarItem.vue | 105 + .../src/layout/plain/sidebar/index.vue | 79 + jnpf-java-boot/jnpf-web/src/main.js | 61 + .../jnpf-web/src/mixins/generator/common.js | 207 + .../jnpf-web/src/mixins/generator/form.js | 267 + .../jnpf-web/src/mixins/generator/index.js | 130 + jnpf-java-boot/jnpf-web/src/permission.js | 87 + jnpf-java-boot/jnpf-web/src/router/index.js | 97 + .../jnpf-web/src/router/modules/base.js | 81 + jnpf-java-boot/jnpf-web/src/settings.js | 51 + jnpf-java-boot/jnpf-web/src/store/getters.js | 28 + jnpf-java-boot/jnpf-web/src/store/index.js | 25 + .../jnpf-web/src/store/modules/app.js | 65 + .../jnpf-web/src/store/modules/base.js | 267 + .../jnpf-web/src/store/modules/generator.js | 139 + .../jnpf-web/src/store/modules/permission.js | 55 + .../jnpf-web/src/store/modules/settings.js | 59 + .../jnpf-web/src/store/modules/tagsView.js | 196 + .../jnpf-web/src/store/modules/user.js | 299 + jnpf-java-boot/jnpf-web/src/styles/btn.scss | 99 + .../jnpf-web/src/styles/element-ui.scss | 95 + .../src/styles/element-variables.scss | 31 + .../jnpf-web/src/styles/fullCalendar.scss | 184 + jnpf-java-boot/jnpf-web/src/styles/index.scss | 247 + jnpf-java-boot/jnpf-web/src/styles/mixin.scss | 66 + .../jnpf-web/src/styles/sidebar.scss | 307 + .../jnpf-web/src/styles/transition.scss | 48 + .../jnpf-web/src/styles/variables.scss | 35 + jnpf-java-boot/jnpf-web/src/utils/apiUrl.js | 4 + jnpf-java-boot/jnpf-web/src/utils/auth.js | 24 + .../jnpf-web/src/utils/clipboard.js | 32 + jnpf-java-boot/jnpf-web/src/utils/define.js | 18 + .../jnpf-web/src/utils/error-log.js | 35 + .../jnpf-web/src/utils/formValidate.js | 79 + .../jnpf-web/src/utils/get-page-title.js | 14 + jnpf-java-boot/jnpf-web/src/utils/i18n.js | 12 + jnpf-java-boot/jnpf-web/src/utils/index.js | 352 + jnpf-java-boot/jnpf-web/src/utils/jnpf.js | 463 ++ jnpf-java-boot/jnpf-web/src/utils/message.js | 22 + jnpf-java-boot/jnpf-web/src/utils/notify.js | 356 + .../jnpf-web/src/utils/open-window.js | 23 + jnpf-java-boot/jnpf-web/src/utils/request.js | 93 + .../jnpf-web/src/utils/scroll-to.js | 58 + jnpf-java-boot/jnpf-web/src/utils/validate.js | 74 + .../views/basic/dynamicDataReport/index.vue | 34 + .../views/basic/dynamicDictionary/Form.vue | 130 + .../views/basic/dynamicDictionary/index.vue | 147 + .../views/basic/dynamicModel/form/index.vue | 204 + .../src/views/basic/dynamicModel/index.vue | 65 + .../views/basic/dynamicModel/list/Form.vue | 414 + .../basic/dynamicModel/list/ImportBox.vue | 92 + .../dynamicModel/list/RelevanceDetail.vue | 253 + .../views/basic/dynamicModel/list/Search.vue | 233 + .../dynamicModel/list/child-table-column.vue | 100 + .../basic/dynamicModel/list/detail/Item.vue | 599 ++ .../basic/dynamicModel/list/detail/Parser.vue | 34 + .../basic/dynamicModel/list/detail/index.vue | 223 + .../basic/dynamicModel/list/extraForm.vue | 177 + .../views/basic/dynamicModel/list/index.vue | 1910 +++++ .../views/basic/dynamicModel/view/index.vue | 743 ++ .../src/views/basic/dynamicPortal/index.vue | 54 + .../src/views/basic/externalLink/index.vue | 31 + .../src/views/basic/lockScreen/index.vue | 107 + .../src/views/basic/messageRecord/Form.vue | 76 + .../src/views/basic/messageRecord/index.vue | 230 + .../basic/profile/components/Authorize.vue | 75 + .../basic/profile/components/JustAuth.vue | 172 + .../basic/profile/components/Password.vue | 222 + .../views/basic/profile/components/SysLog.vue | 187 + .../basic/profile/components/UserInfo.vue | 389 + .../src/views/basic/profile/index.vue | 474 ++ .../jnpf-web/src/views/dashboard/Setting.vue | 109 + .../dashboard/admin/components/LineChart.vue | 132 + .../dashboard/admin/components/PanelGroup.vue | 125 + .../admin/components/mixins/resize.js | 54 + .../src/views/dashboard/admin/index.vue | 427 + .../jnpf-web/src/views/dashboard/index.vue | 89 + .../jnpf-web/src/views/dashboard/mixin.js | 147 + .../jnpf-web/src/views/error-page/404.vue | 99 + .../src/views/extend/barCode/index.vue | 109 + .../src/views/extend/bigData/index.vue | 111 + .../src/views/extend/document/FolderTree.vue | 69 + .../src/views/extend/document/Preview.vue | 62 + .../src/views/extend/document/UserBox.vue | 62 + .../views/extend/document/fileUploader.vue | 138 + .../src/views/extend/document/index.vue | 544 ++ .../views/extend/documentPreview/Detail.vue | 49 + .../views/extend/documentPreview/index.vue | 116 + .../src/views/extend/email/Config.vue | 128 + .../src/views/extend/email/Detail.vue | 44 + .../src/views/extend/email/DetailMain.vue | 91 + .../src/views/extend/email/DetailPage.vue | 49 + .../jnpf-web/src/views/extend/email/Form.vue | 162 + .../jnpf-web/src/views/extend/email/index.vue | 412 + .../extend/formDemo/fieldForm1/index.vue | 136 + .../extend/formDemo/fieldForm2/index.vue | 337 + .../extend/formDemo/fieldForm3/index.vue | 95 + .../extend/formDemo/fieldForm4/index.vue | 69 + .../extend/formDemo/fieldForm5/index.vue | 129 + .../extend/formDemo/fieldForm6/index.vue | 143 + .../extend/formDemo/verifyForm/index.vue | 277 + .../extend/formDemo/verifyForm1/index.vue | 278 + .../extend/graphDemo/echartsBar/index.vue | 146 + .../graphDemo/echartsBarAcross/index.vue | 77 + .../graphDemo/echartsCandlestick/index.vue | 347 + .../extend/graphDemo/echartsFunnel/index.vue | 125 + .../extend/graphDemo/echartsGauge/index.vue | 259 + .../graphDemo/echartsLineArea/index.vue | 129 + .../extend/graphDemo/echartsLineBar/index.vue | 106 + .../extend/graphDemo/echartsPie/index.vue | 130 + .../extend/graphDemo/echartsScatter/index.vue | 174 + .../extend/graphDemo/echartsTree/index.vue | 955 +++ .../extend/graphDemo/highchartsArea/index.vue | 55 + .../graphDemo/highchartsBellcurve/index.vue | 78 + .../graphDemo/highchartsBullet/index.vue | 180 + .../graphDemo/highchartsColumn/index.vue | 111 + .../graphDemo/highchartsFunnel/index.vue | 78 + .../graphDemo/highchartsGauge/index.vue | 127 + .../extend/graphDemo/highchartsLine/index.vue | 95 + .../extend/graphDemo/highchartsPie/index.vue | 308 + .../graphDemo/highchartsScatter/index.vue | 203 + .../graphDemo/highchartsWordcloud/index.vue | 66 + .../views/extend/graphDemo/mixins/resize.js | 60 + .../extend/importAndExport/ExportForm.vue | 142 + .../extend/importAndExport/ImportForm.vue | 257 + .../views/extend/importAndExport/index.vue | 174 + .../jnpf-web/src/views/extend/map/index.vue | 55 + .../src/views/extend/order/Detail.vue | 428 + .../src/views/extend/order/GoodsBox.vue | 95 + .../jnpf-web/src/views/extend/order/index.vue | 338 + .../src/views/extend/printData/Bill.vue | 168 + .../src/views/extend/printData/Offer.vue | 283 + .../src/views/extend/printData/Record.vue | 89 + .../src/views/extend/printData/Storage.vue | 84 + .../src/views/extend/printData/index.vue | 97 + .../src/views/extend/printData/printStyle.js | 367 + .../src/views/extend/projectGantt/Form.vue | 167 + .../src/views/extend/projectGantt/Task.vue | 535 ++ .../views/extend/projectGantt/TaskForm.vue | 192 + .../src/views/extend/projectGantt/index.vue | 167 + .../src/views/extend/saleOrder/Form.vue | 422 + .../src/views/extend/saleOrder/GoodsBox.vue | 155 + .../src/views/extend/saleOrder/index.vue | 273 + .../src/views/extend/signature/index.vue | 286 + .../src/views/extend/signet/index.vue | 302 + .../extend/tableDemo/commonForm/index.vue | 131 + .../extend/tableDemo/commonTable/index.vue | 231 + .../extend/tableDemo/complexHeader/Form.vue | 140 + .../extend/tableDemo/complexHeader/index.vue | 165 + .../extend/tableDemo/extension/index.vue | 103 + .../extend/tableDemo/groupingTable/index.vue | 178 + .../extend/tableDemo/lockTable/index.vue | 164 + .../extend/tableDemo/mergeTable/index.vue | 147 + .../extend/tableDemo/postilTable/Form.vue | 116 + .../extend/tableDemo/postilTable/index.vue | 154 + .../extend/tableDemo/printTable/index.vue | 168 + .../extend/tableDemo/redactTable/index.vue | 234 + .../extend/tableDemo/signTable/index.vue | 233 + .../tableDemo/statisticsTable/index.vue | 192 + .../extend/tableDemo/tableTree/index.vue | 47 + .../extend/tableDemo/treeTable/index.vue | 153 + .../src/views/formShortLink/form/index.vue | 340 + .../src/views/formShortLink/index.vue | 79 + .../src/views/formShortLink/list/Form.vue | 204 + .../views/formShortLink/list/ImportBox.vue | 92 + .../src/views/formShortLink/list/Search.vue | 238 + .../formShortLink/list/child-table-column.vue | 71 + .../views/formShortLink/list/detail/Item.vue | 598 ++ .../formShortLink/list/detail/Parser.vue | 34 + .../views/formShortLink/list/detail/index.vue | 140 + .../src/views/formShortLink/list/index.vue | 1001 +++ .../jnpf-web/src/views/generator/AddBox.vue | 34 + .../src/views/generator/DownloadForm.vue | 126 + .../jnpf-web/src/views/generator/Preview.vue | 127 + .../src/views/generator/TableForm.vue | 102 + .../src/views/generator/flowForm/Form.vue | 143 + .../src/views/generator/flowForm/index.vue | 112 + .../src/views/generator/webForm/Form.vue | 162 + .../src/views/generator/webForm/index.vue | 118 + .../src/views/login/auth-redirect.vue | 15 + .../jnpf-web/src/views/login/index.scss | 430 + .../jnpf-web/src/views/login/index.vue | 422 + .../jnpf-web/src/views/login/sso-redirect.vue | 40 + .../accountConfig/emailConfig/Form.vue | 173 + .../emailConfig/SendTestForm.vue | 89 + .../accountConfig/emailConfig/index.vue | 206 + .../accountConfig/smsConfig/Form.vue | 236 + .../accountConfig/smsConfig/index.vue | 212 + .../accountConfig/webhookConfig/Form.vue | 161 + .../accountConfig/webhookConfig/index.vue | 220 + .../accountConfig/wxWananchiConfig/Form.vue | 170 + .../accountConfig/wxWananchiConfig/index.vue | 204 + .../src/views/msgCenter/msgMonitor/Detail.vue | 72 + .../src/views/msgCenter/msgMonitor/index.vue | 245 + .../views/msgCenter/msgTemplate/Detail.vue | 324 + .../src/views/msgCenter/msgTemplate/Form.vue | 600 ++ .../src/views/msgCenter/msgTemplate/index.vue | 261 + .../src/views/msgCenter/sendConfig/Detail.vue | 170 + .../src/views/msgCenter/sendConfig/Form.vue | 241 + .../msgCenter/sendConfig/SendResults.vue | 61 + .../msgCenter/sendConfig/TemplateDialog.vue | 200 + .../msgCenter/sendConfig/TemplateForm.vue | 132 + .../views/msgCenter/sendConfig/TestSend.vue | 139 + .../src/views/msgCenter/sendConfig/index.vue | 271 + .../src/views/onlineDev/dataReport/Form.vue | 67 + .../views/onlineDev/dataReport/Preview.vue | 37 + .../src/views/onlineDev/dataReport/index.vue | 296 + .../src/views/onlineDev/integrate/Drawer.vue | 59 + .../src/views/onlineDev/integrate/Form.vue | 128 + .../onlineDev/integrate/design/index.vue | 85 + .../src/views/onlineDev/integrate/index.vue | 291 + .../src/views/onlineDev/visualPortal/Form.vue | 193 + .../onlineDev/visualPortal/IndexPreview.vue | 94 + .../views/onlineDev/visualPortal/index.vue | 293 + .../onlineDev/visualPortal/releaseDialog.vue | 326 + .../src/views/onlineDev/webDesign/Form.vue | 166 + .../onlineDev/webDesign/ShortLinkDialog.vue | 448 + .../views/onlineDev/webDesign/ViewForm.vue | 117 + .../src/views/onlineDev/webDesign/index.vue | 404 + .../views/permission/authorize/Authorize.vue | 382 + .../permission/authorize/AuthorizeForm.vue | 346 + .../src/views/permission/authorize/Form.vue | 103 + .../src/views/permission/authorize/index.vue | 208 + .../permission/authorize/permissionGroup.vue | 415 + .../src/views/permission/gradeManage/Form.vue | 319 + .../gradeManage/GradeUserSelect.vue | 388 + .../views/permission/gradeManage/index.vue | 139 + .../src/views/permission/group/Form.vue | 116 + .../src/views/permission/group/index.vue | 172 + .../src/views/permission/organize/Form.vue | 264 + .../views/permission/organize/checkUser.vue | 142 + .../src/views/permission/organize/depForm.vue | 123 + .../src/views/permission/organize/index.vue | 228 + .../src/views/permission/position/Form.vue | 133 + .../src/views/permission/position/index.vue | 263 + .../permission/position/userRelation.vue | 152 + .../src/views/permission/role/Form.vue | 121 + .../src/views/permission/role/index.vue | 287 + .../views/permission/role/userRelation.vue | 174 + .../src/views/permission/user/Diagram.vue | 105 + .../src/views/permission/user/ExportForm.vue | 106 + .../src/views/permission/user/Form.vue | 431 + .../src/views/permission/user/ImportForm.vue | 326 + .../views/permission/user/ResetPassword.vue | 116 + .../src/views/permission/user/SocialsBind.vue | 116 + .../permission/user/WorkHandoverForm.vue | 199 + .../src/views/permission/user/index.vue | 379 + .../src/views/permission/userOnline/index.vue | 144 + .../permission/userRelation/Selector.vue | 76 + .../jnpf-web/src/views/redirect/index.vue | 14 + .../jnpf-web/src/views/system/area/Form.vue | 191 + .../jnpf-web/src/views/system/area/index.vue | 147 + .../src/views/system/billRule/Form.vue | 189 + .../src/views/system/billRule/index.vue | 203 + .../jnpf-web/src/views/system/cache/Form.vue | 73 + .../jnpf-web/src/views/system/cache/index.vue | 132 + .../src/views/system/commonWords/Form.vue | 123 + .../src/views/system/commonWords/index.vue | 133 + .../jnpf-web/src/views/system/icons/index.vue | 167 + .../jnpf-web/src/views/system/menu/Form.vue | 160 + .../system/menu/components/NameSelect.vue | 214 + .../menu/components/buttonAuthorize/Form.vue | 142 + .../menu/components/buttonAuthorize/index.vue | 183 + .../components/columnAuthorize/BatchForm.vue | 127 + .../menu/components/columnAuthorize/Form.vue | 216 + .../menu/components/columnAuthorize/index.vue | 213 + .../menu/components/connectForm/DataTable.vue | 407 + .../menu/components/connectForm/index.vue | 96 + .../dataAuthorize/DataAuthorizeForm.vue | 546 ++ .../dataAuthorize/DataSchemeForm.vue | 480 ++ .../menu/components/dataAuthorize/index.vue | 331 + .../components/formAuthorize/BatchForm.vue | 120 + .../menu/components/formAuthorize/Form.vue | 213 + .../menu/components/formAuthorize/index.vue | 204 + .../jnpf-web/src/views/system/menu/index.vue | 187 + .../src/views/system/menu/menuForm.vue | 486 ++ .../src/views/system/menu/menuManage.vue | 534 ++ .../system/menu/portalManagement/Form.vue | 130 + .../system/menu/portalManagement/Transfer.vue | 71 + .../system/menu/portalManagement/index.vue | 321 + .../menu/portalManagement/permissionGroup.vue | 148 + .../menu/portalManagement/portalDialog.vue | 192 + .../src/views/system/monitor/index.vue | 306 + .../jnpf-web/src/views/system/notice/Form.vue | 296 + .../jnpf-web/src/views/system/notice/View.vue | 88 + .../src/views/system/notice/index.vue | 223 + .../src/views/system/printDev/Form.vue | 278 + .../src/views/system/printDev/Preview.vue | 64 + .../src/views/system/printDev/index.vue | 228 + .../src/views/system/printDev/log.vue | 185 + .../printDev/ts-print-templater/index.vue | 408 + .../ts-print-templater/pageSize/index.vue | 224 + .../ts-designer-tinymce/index.vue | 153 + .../ts-designer-tinymce/plugins.js | 1 + .../ts-designer-tinymce/toolbar.js | 1 + .../src/views/system/sysConfig/index.vue | 904 +++ .../jnpf-web/src/views/system/task/Form.vue | 316 + .../jnpf-web/src/views/system/task/Log.vue | 157 + .../jnpf-web/src/views/system/task/index.vue | 190 + .../src/views/systemData/dataBackup/index.vue | 133 + .../systemData/dataInterface/FieldForm.vue | 144 + .../views/systemData/dataInterface/Form.vue | 1166 +++ .../systemData/dataInterface/FormScript.vue | 61 + .../views/systemData/dataInterface/Log.vue | 108 + .../systemData/dataInterface/PageExplain.vue | 75 + .../systemData/dataInterface/Preview.vue | 92 + .../dataInterface/components/CommonTable.vue | 106 + .../dataInterface/components/RightTable.vue | 107 + .../components/variable/Form.vue | 92 + .../components/variable/index.vue | 210 + .../views/systemData/dataInterface/index.vue | 305 + .../src/views/systemData/dataModel/Form.vue | 345 + .../views/systemData/dataModel/Preview.vue | 135 + .../systemData/dataModel/fields/Form.vue | 120 + .../systemData/dataModel/fields/index.vue | 105 + .../src/views/systemData/dataModel/index.vue | 247 + .../src/views/systemData/dataSource/Form.vue | 261 + .../src/views/systemData/dataSource/index.vue | 144 + .../src/views/systemData/dataSync/index.vue | 328 + .../src/views/systemData/dictionary/Form.vue | 130 + .../systemData/dictionary/components/Form.vue | 125 + .../dictionary/components/index.vue | 119 + .../src/views/systemData/dictionary/index.vue | 256 + .../systemData/interfaceOauth/Empower.vue | 144 + .../views/systemData/interfaceOauth/Form.vue | 169 + .../views/systemData/interfaceOauth/Log.vue | 162 + .../systemData/interfaceOauth/Preview.vue | 245 + .../systemData/interfaceOauth/Transfer.vue | 76 + .../interfaceOauth/VerifySignatureInfo.vue | 781 ++ .../views/systemData/interfaceOauth/index.vue | 215 + .../workFlow/components/ActionDialog.vue | 181 + .../workFlow/components/ApproveDialog.vue | 232 + .../workFlow/components/CandidateForm.vue | 105 + .../components/CandidateUserSelect.vue | 398 + .../src/views/workFlow/components/Comment.vue | 410 + .../workFlow/components/CommonWordsDialog.vue | 270 + .../views/workFlow/components/ErrorForm.vue | 56 + .../views/workFlow/components/EventLog.vue | 112 + .../workFlow/components/FileUploader.vue | 183 + .../src/views/workFlow/components/FlowBox.vue | 1118 +++ .../views/workFlow/components/FlowSelect.vue | 437 + .../src/views/workFlow/components/FormBox.vue | 75 + .../workFlow/components/HasFreeApprover.vue | 222 + .../views/workFlow/components/RecordList.vue | 134 + .../workFlow/components/RecordSummary.vue | 185 + .../workFlow/components/SuspendDialog.vue | 93 + .../src/views/workFlow/entrust/Form.vue | 265 + .../src/views/workFlow/entrust/index.vue | 569 ++ .../src/views/workFlow/entrust/myEntrust.vue | 265 + .../views/workFlow/flowCirculate/index.vue | 314 + .../src/views/workFlow/flowDone/index.vue | 317 + .../workFlow/flowEngine/FlowManagement.vue | 322 + .../src/views/workFlow/flowEngine/Form.vue | 239 + .../src/views/workFlow/flowEngine/index.vue | 284 + .../src/views/workFlow/flowLaunch/Flow.vue | 261 + .../src/views/workFlow/flowLaunch/index.vue | 394 + .../src/views/workFlow/flowMonitor/index.vue | 383 + .../views/workFlow/flowQuickLaunch/index.vue | 55 + .../src/views/workFlow/flowTodo/BatchList.vue | 458 ++ .../src/views/workFlow/flowTodo/index.vue | 332 + .../views/workFlow/formDesign/FieldForm.vue | 168 + .../src/views/workFlow/formDesign/Form.vue | 312 + .../src/views/workFlow/formDesign/Preview.vue | 45 + .../src/views/workFlow/formDesign/index.vue | 313 + .../views/workFlow/workFlowDetail/index.vue | 82 + .../workFlow/workFlowForm/crmOrder/index.vue | 504 ++ .../workFlowForm/dynamicForm/index.vue | 155 + .../workFlowForm/leaveApply/index.vue | 189 + .../src/views/workFlow/workFlowForm/mixin.js | 189 + .../workFlowForm/salesOrder/index.vue | 245 + jnpf-java-boot/jnpf-web/static/emoji/100.gif | Bin 0 -> 1764 bytes jnpf-java-boot/jnpf-web/static/emoji/101.gif | Bin 0 -> 1534 bytes jnpf-java-boot/jnpf-web/static/emoji/102.gif | Bin 0 -> 1754 bytes jnpf-java-boot/jnpf-web/static/emoji/103.gif | Bin 0 -> 1764 bytes jnpf-java-boot/jnpf-web/static/emoji/104.gif | Bin 0 -> 1932 bytes jnpf-java-boot/jnpf-web/static/emoji/105.gif | Bin 0 -> 1820 bytes jnpf-java-boot/jnpf-web/static/emoji/106.gif | Bin 0 -> 3496 bytes jnpf-java-boot/jnpf-web/static/emoji/107.gif | Bin 0 -> 3851 bytes jnpf-java-boot/jnpf-web/static/emoji/108.gif | Bin 0 -> 4659 bytes jnpf-java-boot/jnpf-web/static/emoji/109.gif | Bin 0 -> 3145 bytes jnpf-java-boot/jnpf-web/static/emoji/110.gif | Bin 0 -> 3609 bytes jnpf-java-boot/jnpf-web/static/emoji/111.gif | Bin 0 -> 7859 bytes jnpf-java-boot/jnpf-web/static/emoji/112.gif | Bin 0 -> 2201 bytes jnpf-java-boot/jnpf-web/static/emoji/113.gif | Bin 0 -> 1636 bytes jnpf-java-boot/jnpf-web/static/emoji/114.gif | Bin 0 -> 3824 bytes jnpf-java-boot/jnpf-web/static/emoji/115.gif | Bin 0 -> 1516 bytes jnpf-java-boot/jnpf-web/static/emoji/116.gif | Bin 0 -> 1367 bytes jnpf-java-boot/jnpf-web/static/emoji/117.gif | Bin 0 -> 2974 bytes jnpf-java-boot/jnpf-web/static/emoji/118.gif | Bin 0 -> 7510 bytes jnpf-java-boot/jnpf-web/static/emoji/119.gif | Bin 0 -> 7520 bytes jnpf-java-boot/jnpf-web/static/emoji/120.gif | Bin 0 -> 1718 bytes jnpf-java-boot/jnpf-web/static/emoji/121.gif | Bin 0 -> 1823 bytes jnpf-java-boot/jnpf-web/static/emoji/122.gif | Bin 0 -> 2941 bytes jnpf-java-boot/jnpf-web/static/emoji/123.gif | Bin 0 -> 1904 bytes jnpf-java-boot/jnpf-web/static/emoji/124.gif | Bin 0 -> 2212 bytes jnpf-java-boot/jnpf-web/static/emoji/125.gif | Bin 0 -> 2391 bytes jnpf-java-boot/jnpf-web/static/emoji/126.gif | Bin 0 -> 3985 bytes jnpf-java-boot/jnpf-web/static/emoji/127.gif | Bin 0 -> 2510 bytes jnpf-java-boot/jnpf-web/static/emoji/128.gif | Bin 0 -> 3247 bytes jnpf-java-boot/jnpf-web/static/emoji/129.gif | Bin 0 -> 5121 bytes jnpf-java-boot/jnpf-web/static/emoji/130.gif | Bin 0 -> 1685 bytes jnpf-java-boot/jnpf-web/static/emoji/131.gif | Bin 0 -> 5513 bytes jnpf-java-boot/jnpf-web/static/emoji/132.gif | Bin 0 -> 6759 bytes jnpf-java-boot/jnpf-web/static/emoji/133.gif | Bin 0 -> 4195 bytes jnpf-java-boot/jnpf-web/static/emoji/134.gif | Bin 0 -> 2097 bytes jnpf-java-boot/jnpf-web/static/emoji/135.gif | Bin 0 -> 12006 bytes jnpf-java-boot/jnpf-web/static/emoji/136.gif | Bin 0 -> 1397 bytes jnpf-java-boot/jnpf-web/static/emoji/137.gif | Bin 0 -> 1186 bytes jnpf-java-boot/jnpf-web/static/emoji/138.gif | Bin 0 -> 1637 bytes jnpf-java-boot/jnpf-web/static/emoji/139.gif | Bin 0 -> 1714 bytes jnpf-java-boot/jnpf-web/static/emoji/140.gif | Bin 0 -> 9869 bytes jnpf-java-boot/jnpf-web/static/emoji/141.gif | Bin 0 -> 3308 bytes jnpf-java-boot/jnpf-web/static/emoji/142.gif | Bin 0 -> 12272 bytes jnpf-java-boot/jnpf-web/static/emoji/143.gif | Bin 0 -> 4096 bytes jnpf-java-boot/jnpf-web/static/emoji/144.gif | Bin 0 -> 1525 bytes jnpf-java-boot/jnpf-web/static/emoji/145.gif | Bin 0 -> 4315 bytes jnpf-java-boot/jnpf-web/static/emoji/146.gif | Bin 0 -> 4737 bytes jnpf-java-boot/jnpf-web/static/emoji/147.gif | Bin 0 -> 3675 bytes jnpf-java-boot/jnpf-web/static/emoji/148.gif | Bin 0 -> 1682 bytes jnpf-java-boot/jnpf-web/static/emoji/149.gif | Bin 0 -> 5989 bytes jnpf-java-boot/jnpf-web/static/emoji/150.gif | Bin 0 -> 3027 bytes jnpf-java-boot/jnpf-web/static/emoji/151.gif | Bin 0 -> 3685 bytes jnpf-java-boot/jnpf-web/static/emoji/152.gif | Bin 0 -> 1484 bytes jnpf-java-boot/jnpf-web/static/emoji/153.gif | Bin 0 -> 2014 bytes jnpf-java-boot/jnpf-web/static/emoji/154.gif | Bin 0 -> 2289 bytes jnpf-java-boot/jnpf-web/static/emoji/155.gif | Bin 0 -> 2406 bytes jnpf-java-boot/jnpf-web/static/emoji/156.gif | Bin 0 -> 1170 bytes jnpf-java-boot/jnpf-web/static/emoji/157.gif | Bin 0 -> 4850 bytes jnpf-java-boot/jnpf-web/static/emoji/158.gif | Bin 0 -> 2558 bytes jnpf-java-boot/jnpf-web/static/emoji/159.gif | Bin 0 -> 1533 bytes jnpf-java-boot/jnpf-web/static/emoji/160.gif | Bin 0 -> 2587 bytes jnpf-java-boot/jnpf-web/static/emoji/161.gif | Bin 0 -> 1131 bytes jnpf-java-boot/jnpf-web/static/emoji/162.gif | Bin 0 -> 1210 bytes jnpf-java-boot/jnpf-web/static/emoji/163.gif | Bin 0 -> 971 bytes jnpf-java-boot/jnpf-web/static/emoji/164.gif | Bin 0 -> 988 bytes jnpf-java-boot/jnpf-web/static/emoji/165.gif | Bin 0 -> 1363 bytes jnpf-java-boot/jnpf-web/static/emoji/166.gif | Bin 0 -> 1129 bytes jnpf-java-boot/jnpf-web/static/emoji/167.gif | Bin 0 -> 2532 bytes jnpf-java-boot/jnpf-web/static/emoji/168.gif | Bin 0 -> 4382 bytes jnpf-java-boot/jnpf-web/static/emoji/169.gif | Bin 0 -> 979 bytes jnpf-java-boot/jnpf-web/static/emoji/170.gif | Bin 0 -> 1122 bytes jnpf-java-boot/jnpf-web/static/emoji/171.gif | Bin 0 -> 991 bytes jnpf-java-boot/jnpf-web/static/emoji/172.gif | Bin 0 -> 3635 bytes jnpf-java-boot/jnpf-web/static/emoji/173.gif | Bin 0 -> 2195 bytes jnpf-java-boot/jnpf-web/static/emoji/174.gif | Bin 0 -> 2385 bytes jnpf-java-boot/jnpf-web/static/emoji/175.gif | Bin 0 -> 1205 bytes jnpf-java-boot/jnpf-web/static/emoji/176.gif | Bin 0 -> 1181 bytes jnpf-java-boot/jnpf-web/static/emoji/177.gif | Bin 0 -> 1151 bytes jnpf-java-boot/jnpf-web/static/emoji/178.gif | Bin 0 -> 1548 bytes jnpf-java-boot/jnpf-web/static/emoji/179.gif | Bin 0 -> 1510 bytes jnpf-java-boot/jnpf-web/static/emoji/180.gif | Bin 0 -> 1537 bytes jnpf-java-boot/jnpf-web/static/emoji/181.gif | Bin 0 -> 1591 bytes jnpf-java-boot/jnpf-web/static/emoji/182.gif | Bin 0 -> 1547 bytes jnpf-java-boot/jnpf-web/static/emoji/183.gif | Bin 0 -> 1591 bytes jnpf-java-boot/jnpf-web/static/emoji/184.gif | Bin 0 -> 3349 bytes jnpf-java-boot/jnpf-web/static/emoji/185.gif | Bin 0 -> 1573 bytes jnpf-java-boot/jnpf-web/static/emoji/186.gif | Bin 0 -> 1514 bytes jnpf-java-boot/jnpf-web/static/emoji/187.gif | Bin 0 -> 1541 bytes jnpf-java-boot/jnpf-web/static/emoji/188.gif | Bin 0 -> 2095 bytes jnpf-java-boot/jnpf-web/static/emoji/189.gif | Bin 0 -> 2393 bytes jnpf-java-boot/jnpf-web/static/emoji/190.gif | Bin 0 -> 2461 bytes jnpf-java-boot/jnpf-web/static/emoji/191.gif | Bin 0 -> 1045 bytes jnpf-java-boot/jnpf-web/static/emoji/192.gif | Bin 0 -> 1373 bytes jnpf-java-boot/jnpf-web/static/emoji/193.gif | Bin 0 -> 1110 bytes jnpf-java-boot/jnpf-web/static/emoji/194.gif | Bin 0 -> 3572 bytes jnpf-java-boot/jnpf-web/static/emoji/195.gif | Bin 0 -> 3011 bytes jnpf-java-boot/jnpf-web/static/emoji/196.gif | Bin 0 -> 1758 bytes jnpf-java-boot/jnpf-web/static/emoji/197.gif | Bin 0 -> 5210 bytes jnpf-java-boot/jnpf-web/static/emoji/198.gif | Bin 0 -> 1604 bytes jnpf-java-boot/jnpf-web/static/emoji/199.gif | Bin 0 -> 2162 bytes jnpf-java-boot/jnpf-web/static/emoji/200.png | Bin 0 -> 1463 bytes jnpf-java-boot/jnpf-web/static/emoji/201.png | Bin 0 -> 1410 bytes jnpf-java-boot/jnpf-web/static/emoji/202.png | Bin 0 -> 1479 bytes jnpf-java-boot/jnpf-web/static/emoji/203.png | Bin 0 -> 1414 bytes jnpf-java-boot/jnpf-web/static/emoji/204.png | Bin 0 -> 1556 bytes jnpf-java-boot/jnpf-web/static/emoji/205.png | Bin 0 -> 1454 bytes jnpf-java-boot/jnpf-web/static/emoji/206.png | Bin 0 -> 1550 bytes jnpf-java-boot/jnpf-web/static/emoji/207.png | Bin 0 -> 1375 bytes jnpf-java-boot/jnpf-web/static/emoji/208.png | Bin 0 -> 1413 bytes jnpf-java-boot/jnpf-web/static/emoji/209.png | Bin 0 -> 1425 bytes jnpf-java-boot/jnpf-web/static/emoji/210.png | Bin 0 -> 1393 bytes jnpf-java-boot/jnpf-web/static/emoji/211.png | Bin 0 -> 1560 bytes jnpf-java-boot/jnpf-web/static/emoji/212.png | Bin 0 -> 1261 bytes jnpf-java-boot/jnpf-web/static/emoji/213.png | Bin 0 -> 1490 bytes jnpf-java-boot/jnpf-web/static/emoji/214.png | Bin 0 -> 1527 bytes jnpf-java-boot/jnpf-web/static/emoji/215.png | Bin 0 -> 1145 bytes jnpf-java-boot/jnpf-web/static/emoji/216.png | Bin 0 -> 1375 bytes jnpf-java-boot/jnpf-web/static/emoji/217.png | Bin 0 -> 1464 bytes jnpf-java-boot/jnpf-web/static/emoji/218.png | Bin 0 -> 1552 bytes jnpf-java-boot/jnpf-web/static/emoji/219.png | Bin 0 -> 1540 bytes jnpf-java-boot/jnpf-web/vue.config.js | 152 + .../jnpf-workflow-engine-biz/pom.xml | 42 + .../engine/mapper/FlowCandidatesMapper.java | 15 + .../jnpf/engine/mapper/FlowCommentMapper.java | 15 + .../engine/mapper/FlowDelegateMapper.java | 16 + .../mapper/FlowEngineVisibleMapper.java | 16 + .../engine/mapper/FlowEventLogMapper.java | 15 + .../engine/mapper/FlowOperatorUserMapper.java | 15 + .../engine/mapper/FlowRejectDataMapper.java | 16 + .../mapper/FlowTaskCirculateMapper.java | 16 + .../jnpf/engine/mapper/FlowTaskMapper.java | 45 + .../engine/mapper/FlowTaskNodeMapper.java | 16 + .../engine/mapper/FlowTaskOperatorMapper.java | 15 + .../mapper/FlowTaskOperatorRecordMapper.java | 16 + .../engine/mapper/FlowTemplateJsonMapper.java | 16 + .../engine/mapper/FlowTemplateMapper.java | 16 + .../jnpf/engine/mapper/FlowUserMapper.java | 15 + .../engine/service/FlowCandidatesService.java | 94 + .../engine/service/FlowCommentService.java | 57 + .../engine/service/FlowDelegateService.java | 124 + .../engine/service/FlowDynamicService.java | 39 + .../service/FlowEngineVisibleService.java | 59 + .../engine/service/FlowEventLogService.java | 31 + .../service/FlowOperatorUserService.java | 93 + .../engine/service/FlowRejectDataService.java | 41 + .../service/FlowTaskCirculateService.java | 49 + .../engine/service/FlowTaskNewService.java | 237 + .../engine/service/FlowTaskNodeService.java | 91 + .../FlowTaskOperatorRecordService.java | 108 + .../service/FlowTaskOperatorService.java | 149 + .../service/FlowTemplateJsonService.java | 139 + .../engine/service/FlowTemplateService.java | 192 + .../jnpf/engine/service/FlowUserService.java | 61 + .../impl/FlowCandidatesServiceImpl.java | 105 + .../service/impl/FlowCommentServiceImpl.java | 72 + .../service/impl/FlowDelegateServiceImpl.java | 343 + .../service/impl/FlowDynamicServiceImpl.java | 108 + .../impl/FlowEngineVisibleServiceImpl.java | 108 + .../service/impl/FlowEventLogServiceImpl.java | 38 + .../impl/FlowOperatorUserServiceImpl.java | 101 + .../impl/FlowRejectDataDataServiceImpl.java | 48 + .../impl/FlowTaskCirculateServiceImpl.java | 50 + .../service/impl/FlowTaskNewServiceImpl.java | 2178 +++++ .../service/impl/FlowTaskNodeServiceImpl.java | 111 + .../FlowTaskOperatorRecordServiceImpl.java | 126 + .../impl/FlowTaskOperatorServiceImpl.java | 192 + .../service/impl/FlowTaskServiceImpl.java | 852 ++ .../impl/FlowTemplateJsonServiceImpl.java | 334 + .../service/impl/FlowTemplateServiceImpl.java | 712 ++ .../service/impl/FlowUserServiceImpl.java | 60 + .../java/jnpf/engine/util/FlowMsgUtil.java | 764 ++ .../java/jnpf/engine/util/FlowTaskUtil.java | 2648 ++++++ .../java/jnpf/engine/util/FlowTimerUtil.java | 92 + .../src/main/java/jnpf/job/JobConfig.java | 57 + .../main/java/jnpf/job/TimeoutSettingJob.java | 45 + .../src/main/java/jnpf/job/WorkJobNew.java | 106 + .../src/main/java/jnpf/job/WorkJobUtil.java | 133 + .../java/jnpf/job/WorkTimeoutJobUtil.java | 640 ++ .../main/java/jnpf/util/ServiceAllUtil.java | 351 + .../jnpf-workflow-engine-controller/pom.xml | 22 + .../controller/FlowBeforeController.java | 827 ++ .../controller/FlowCommentController.java | 153 + .../controller/FlowDelegateController.java | 281 + .../controller/FlowLaunchController.java | 136 + .../controller/FlowMonitorController.java | 123 + .../engine/controller/FlowTaskController.java | 85 + .../controller/FlowTemplateController.java | 624 ++ .../jnpf-workflow-engine-entity/pom.xml | 32 + .../engine/entity/FlowCandidatesEntity.java | 61 + .../jnpf/engine/entity/FlowCommentEntity.java | 47 + .../engine/entity/FlowDelegateEntity.java | 83 + .../entity/FlowEngineVisibleEntity.java | 51 + .../engine/entity/FlowEventLogEntity.java | 44 + .../engine/entity/FlowOperatorUserEntity.java | 87 + .../engine/entity/FlowRejectDataEntity.java | 38 + .../entity/FlowTaskCirculateEntity.java | 59 + .../jnpf/engine/entity/FlowTaskEntity.java | 192 + .../engine/entity/FlowTaskNodeEntity.java | 101 + .../engine/entity/FlowTaskOperatorEntity.java | 125 + .../entity/FlowTaskOperatorRecordEntity.java | 113 + .../engine/entity/FlowTemplateEntity.java | 66 + .../engine/entity/FlowTemplateJsonEntity.java | 64 + .../jnpf/engine/entity/FlowUserEntity.java | 61 + .../jnpf/engine/enums/FlowAgreeRuleEnum.java | 66 + .../jnpf/engine/enums/FlowErrorRuleEnum.java | 74 + .../jnpf/engine/enums/FlowExtraRuleEnum.java | 76 + .../engine/enums/FlowHandleEventEnum.java | 34 + .../jnpf/engine/enums/FlowMessageEnum.java | 43 + .../jnpf/engine/enums/FlowModuleEnum.java | 34 + .../java/jnpf/engine/enums/FlowNodeEnum.java | 44 + .../jnpf/engine/enums/FlowRecordEnum.java | 68 + .../jnpf/engine/enums/FlowRecordListEnum.java | 43 + .../jnpf/engine/enums/FlowStatusEnum.java | 47 + .../engine/enums/FlowTaskOperatorEnum.java | 100 + .../jnpf/engine/enums/FlowTaskStatusEnum.java | 79 + .../jnpf/engine/model/FlowHandleModel.java | 111 + .../model/flowbefore/FlowBatchModel.java | 21 + .../model/flowbefore/FlowBeforeInfoVO.java | 42 + .../model/flowbefore/FlowBeforeListVO.java | 59 + .../engine/model/flowbefore/FlowSummary.java | 38 + .../model/flowbefore/FlowTaskModel.java | 70 + .../model/flowbefore/FlowTaskNodeModel.java | 49 + .../flowbefore/FlowTaskOperatorModel.java | 41 + .../FlowTaskOperatorRecordModel.java | 54 + .../flowbefore/FlowTemplateAllModel.java | 24 + .../model/flowbefore/FlowTemplateModel.java | 29 + .../flowcandidate/FlowCandidateListModel.java | 23 + .../flowcandidate/FlowCandidateUserModel.java | 21 + .../model/flowcandidate/FlowCandidateVO.java | 23 + .../model/flowcandidate/FlowRejectVO.java | 19 + .../model/flowcomment/FlowCommentForm.java | 25 + .../model/flowcomment/FlowCommentInfoVO.java | 27 + .../model/flowcomment/FlowCommentListVO.java | 43 + .../flowcomment/FlowCommentPagination.java | 17 + .../FlowDdelegateSelectModel.java | 28 + .../model/flowdelegate/FlowDelegatListVO.java | 40 + .../flowdelegate/FlowDelegateCrForm.java | 45 + .../flowdelegate/FlowDelegateInfoVO.java | 39 + .../model/flowdelegate/FlowDelegateModel.java | 31 + .../flowdelegate/FlowDelegatePagination.java | 18 + .../FlowDelegateStartPagination.java | 20 + .../flowdelegate/FlowDelegateUpForm.java | 16 + .../model/flowengine/FlowAppPageModel.java | 25 + .../model/flowengine/FlowDataModel.java | 30 + .../engine/model/flowengine/FlowModel.java | 123 + .../engine/model/flowengine/FlowOperator.java | 38 + .../model/flowengine/FlowOperatordModel.java | 33 + .../model/flowengine/FlowPagination.java | 25 + .../flowengine/FlowTaskNodeRejectModel.java | 21 + .../FlowTaskOperatorRejectModel.java | 23 + .../model/flowengine/FlowTaskRejectModel.java | 21 + .../model/flowengine/FlowUpdateNode.java | 35 + .../flowengine/PaginationFlowEngine.java | 22 + .../shuntjson/childnode/ChildNode.java | 28 + .../shuntjson/childnode/FlowAssignModel.java | 29 + .../shuntjson/childnode/FuncConfig.java | 27 + .../shuntjson/childnode/GroupsModel.java | 26 + .../shuntjson/childnode/LimitModel.java | 34 + .../shuntjson/childnode/MsgConfig.java | 30 + .../shuntjson/childnode/ProperCond.java | 23 + .../shuntjson/childnode/Properties.java | 463 ++ .../shuntjson/childnode/RuleListModel.java | 25 + .../SendConfigTemplateJsonModel.java | 51 + .../childnode/TemplateJsonModel.java | 31 + .../shuntjson/childnode/TimeModel.java | 53 + .../shuntjson/childnode/TimeOutConfig.java | 26 + .../shuntjson/nodejson/ChildNodeList.java | 36 + .../shuntjson/nodejson/ConditionList.java | 45 + .../flowengine/shuntjson/nodejson/Custom.java | 41 + .../shuntjson/nodejson/DateProperties.java | 33 + .../model/flowlaunch/FlowLaunchListVO.java | 56 + .../model/flowmessage/FlowEventModel.java | 34 + .../model/flowmessage/FlowMessageModel.java | 37 + .../model/flowmessage/FlowMsgModel.java | 54 + .../model/flowmessage/FlowParameterModel.java | 19 + .../model/flowmonitor/FlowEventLogListVO.java | 21 + .../model/flowmonitor/FlowMonitorListVO.java | 53 + .../model/flowtask/FlowAgreeRuleModel.java | 36 + .../model/flowtask/FlowApproveModel.java | 32 + .../model/flowtask/FlowAssistModel.java | 21 + .../model/flowtask/FlowConditionModel.java | 34 + .../engine/model/flowtask/FlowContModel.java | 52 + .../model/flowtask/FlowCountersignModel.java | 23 + .../engine/model/flowtask/FlowErrorModel.java | 15 + .../model/flowtask/FlowNodeListModel.java | 27 + .../model/flowtask/FlowRevokeModel.java | 12 + .../model/flowtask/FlowTaskListModel.java | 47 + .../model/flowtask/PaginationFlowTask.java | 51 + .../engine/model/flowtask/TaskNodeModel.java | 19 + .../engine/model/flowtask/WorkJobModel.java | 37 + .../model/flowtask/WorkTimeoutJobModel.java | 40 + .../model/flowtask/method/TaskChild.java | 35 + .../flowtask/method/TaskHandleIdStatus.java | 41 + .../flowtask/method/TaskOperatoUser.java | 54 + .../model/flowtask/method/TaskOperator.java | 74 + .../model/flowtemplate/FlowExportModel.java | 27 + .../model/flowtemplate/FlowPageListVO.java | 33 + .../model/flowtemplate/FlowSelectVO.java | 13 + .../flowtemplate/FlowTemplatUprForm.java | 16 + .../flowtemplate/FlowTemplateCrForm.java | 39 + .../flowtemplate/FlowTemplateInfoVO.java | 40 + .../flowtemplate/FlowTemplateListVO.java | 46 + .../model/flowtemplate/FlowTemplateVO.java | 9 + .../model/flowtemplatejson/FlowJsonModel.java | 16 + .../FlowTemplateJsonListVO.java | 35 + .../FlowTemplateJsonPage.java | 20 + .../engine/model/flowtime/FlowTimeModel.java | 25 + .../java/jnpf/engine/util/FlowCondition.java | 20 + .../jnpf/engine/util/FlowContextHolder.java | 95 + .../java/jnpf/engine/util/FlowJsonUtil.java | 802 ++ .../java/jnpf/engine/util/FlowNature.java | 185 + .../jnpf-workflow-engine/pom.xml | 21 + .../jnpf-workflow-form-biz/pom.xml | 27 + .../jnpf/form/mapper/LeaveApplyMapper.java | 16 + .../form/mapper/SalesOrderEntryMapper.java | 16 + .../jnpf/form/mapper/SalesOrderMapper.java | 16 + .../jnpf/form/service/LeaveApplyService.java | 51 + .../form/service/SalesOrderEntryService.java | 16 + .../jnpf/form/service/SalesOrderService.java | 64 + .../service/impl/LeaveApplyServiceImpl.java | 73 + .../impl/SalesOrderEntryServiceImpl.java | 20 + .../service/impl/SalesOrderServiceImpl.java | 135 + .../jnpf-workflow-form-controller/pom.xml | 22 + .../form/controller/LeaveApplyController.java | 118 + .../form/controller/SalesOrderController.java | 110 + .../jnpf-workflow-form-entity/pom.xml | 22 + .../jnpf/form/entity/LeaveApplyEntity.java | 119 + .../jnpf/form/entity/SalesOrderEntity.java | 126 + .../form/entity/SalesOrderEntryEntity.java | 77 + .../form/model/leaveapply/LeaveApplyForm.java | 55 + .../model/leaveapply/LeaveApplyInfoVO.java | 49 + .../SalesOrderEntryEntityInfoModel.java | 38 + .../form/model/salesorder/SalesOrderForm.java | 61 + .../model/salesorder/SalesOrderInfoVO.java | 65 + .../jnpf-workflow/jnpf-workflow-form/pom.xml | 21 + jnpf-java-boot/jnpf-workflow/pom.xml | 19 + jnpf-java-boot/pom.xml | 49 + jnpf-java-boot/security/java.security | 1304 +++ 2923 files changed, 360009 insertions(+) create mode 100644 jnpf-java-boot/.gitignore create mode 100644 jnpf-java-boot/Dockerfile create mode 100644 jnpf-java-boot/README.md create mode 100644 jnpf-java-boot/jnpf-admin/pom.xml create mode 100644 jnpf-java-boot/jnpf-admin/src/main/java/jnpf/JnpfAdminApplication.java create mode 100644 jnpf-java-boot/jnpf-admin/src/main/java/jnpf/aop/DataSourceBindAspect.java create mode 100644 jnpf-java-boot/jnpf-admin/src/main/java/jnpf/aop/PermissionAdminAspect.java create mode 100644 jnpf-java-boot/jnpf-admin/src/main/java/jnpf/aop/PermissionAdminBase.java create mode 100644 jnpf-java-boot/jnpf-admin/src/main/java/jnpf/aop/PermissionOrgAspect.java create mode 100644 jnpf-java-boot/jnpf-admin/src/main/java/jnpf/aop/PermissionPositionAspect.java create mode 100644 jnpf-java-boot/jnpf-admin/src/main/java/jnpf/aop/PermissionRoleAspect.java create mode 100644 jnpf-java-boot/jnpf-admin/src/main/java/jnpf/aop/PermissionUserAspect.java create mode 100644 jnpf-java-boot/jnpf-admin/src/main/java/jnpf/aop/RequestLogAspect.java create mode 100644 jnpf-java-boot/jnpf-admin/src/main/java/jnpf/aop/VisiualOpaAspect.java create mode 100644 jnpf-java-boot/jnpf-admin/src/main/java/jnpf/constant/PermissionConstant.java create mode 100644 jnpf-java-boot/jnpf-admin/src/main/java/jnpf/filter/AuthFilter.java create mode 100644 jnpf-java-boot/jnpf-admin/src/main/java/jnpf/util/GatewayWhite.java create mode 100644 jnpf-java-boot/jnpf-admin/src/main/java/jnpf/util/PermissionAspectUtil.java create mode 100644 jnpf-java-boot/jnpf-admin/src/main/resources/AntiSamy_zh_CN.properties create mode 100644 jnpf-java-boot/jnpf-admin/src/main/resources/antisamy-ebay-imgonlybase64.xml create mode 100644 jnpf-java-boot/jnpf-admin/src/main/resources/antisamy-ebay.xml create mode 100644 jnpf-java-boot/jnpf-admin/src/main/resources/antisamy-empty.xml create mode 100644 jnpf-java-boot/jnpf-admin/src/main/resources/application-dev.yml create mode 100644 jnpf-java-boot/jnpf-admin/src/main/resources/application-preview.yml create mode 100644 jnpf-java-boot/jnpf-admin/src/main/resources/application-pro.yml create mode 100644 jnpf-java-boot/jnpf-admin/src/main/resources/application-test.yml create mode 100644 jnpf-java-boot/jnpf-admin/src/main/resources/application.yml create mode 100644 jnpf-java-boot/jnpf-admin/src/main/resources/logback-spring.xml create mode 100644 jnpf-java-boot/jnpf-admin/src/main/resources/mapper/extend/BigDataMapper.xml create mode 100644 jnpf-java-boot/jnpf-admin/src/main/resources/mapper/extend/DocumentMapper.xml create mode 100644 jnpf-java-boot/jnpf-admin/src/main/resources/mapper/form/FormMapper.xml create mode 100644 jnpf-java-boot/jnpf-admin/src/main/resources/mapper/system/AuthorizeMapper.xml create mode 100644 jnpf-java-boot/jnpf-admin/src/main/resources/mapper/system/ImContentMapper.xml create mode 100644 jnpf-java-boot/jnpf-admin/src/main/resources/mapper/system/ImReplyMapper.xml create mode 100644 jnpf-java-boot/jnpf-admin/src/main/resources/mapper/system/MessageMapper.xml create mode 100644 jnpf-java-boot/jnpf-admin/src/main/resources/mapper/system/PortalManageMapper.xml create mode 100644 jnpf-java-boot/jnpf-admin/src/main/resources/mapper/system/PositionMapper.xml create mode 100644 jnpf-java-boot/jnpf-admin/src/main/resources/mapper/system/RoleMapper.xml create mode 100644 jnpf-java-boot/jnpf-admin/src/main/resources/mapper/system/SysconfigMapper.xml create mode 100644 jnpf-java-boot/jnpf-admin/src/main/resources/mapper/system/UserMapper.xml create mode 100644 jnpf-java-boot/jnpf-admin/src/main/resources/mapper/workflow/engine/FlowTaskMapper.xml create mode 100644 jnpf-java-boot/jnpf-admin/src/main/resources/sharding-sphere.yml create mode 100644 jnpf-java-boot/jnpf-app/jnpf-app-biz/pom.xml create mode 100644 jnpf-java-boot/jnpf-app/jnpf-app-biz/src/main/java/jnpf/mapper/AppDataMapper.java create mode 100644 jnpf-java-boot/jnpf-app/jnpf-app-biz/src/main/java/jnpf/service/AppDataService.java create mode 100644 jnpf-java-boot/jnpf-app/jnpf-app-biz/src/main/java/jnpf/service/AppService.java create mode 100644 jnpf-java-boot/jnpf-app/jnpf-app-biz/src/main/java/jnpf/service/impl/AppDataServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-app/jnpf-app-biz/src/main/java/jnpf/service/impl/AppServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-app/jnpf-app-controller/pom.xml create mode 100644 jnpf-java-boot/jnpf-app/jnpf-app-controller/src/main/java/jnpf/controller/AppDataController.java create mode 100644 jnpf-java-boot/jnpf-app/jnpf-app-controller/src/main/java/jnpf/controller/AppMenuController.java create mode 100644 jnpf-java-boot/jnpf-app/jnpf-app-controller/src/main/java/jnpf/controller/AppUserController.java create mode 100644 jnpf-java-boot/jnpf-app/jnpf-app-controller/src/main/java/jnpf/controller/AppVersionController.java create mode 100644 jnpf-java-boot/jnpf-app/jnpf-app-entity/pom.xml create mode 100644 jnpf-java-boot/jnpf-app/jnpf-app-entity/src/main/java/jnpf/entity/AppDataEntity.java create mode 100644 jnpf-java-boot/jnpf-app/jnpf-app-entity/src/main/java/jnpf/model/AppDataCrForm.java create mode 100644 jnpf-java-boot/jnpf-app/jnpf-app-entity/src/main/java/jnpf/model/AppDataListAllVO.java create mode 100644 jnpf-java-boot/jnpf-app/jnpf-app-entity/src/main/java/jnpf/model/AppDataListVO.java create mode 100644 jnpf-java-boot/jnpf-app/jnpf-app-entity/src/main/java/jnpf/model/AppFlowListAllVO.java create mode 100644 jnpf-java-boot/jnpf-app/jnpf-app-entity/src/main/java/jnpf/model/AppMenuListVO.java create mode 100644 jnpf-java-boot/jnpf-app/jnpf-app-entity/src/main/java/jnpf/model/AppPositionVO.java create mode 100644 jnpf-java-boot/jnpf-app/jnpf-app-entity/src/main/java/jnpf/model/AppUserInfoVO.java create mode 100644 jnpf-java-boot/jnpf-app/jnpf-app-entity/src/main/java/jnpf/model/AppUsersVO.java create mode 100644 jnpf-java-boot/jnpf-app/pom.xml create mode 100644 jnpf-java-boot/jnpf-example/jnpf-example-biz/pom.xml create mode 100644 jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/mapper/ContractMapper.java create mode 100644 jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/ContractService.java create mode 100644 jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/impl/ContractServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-example/jnpf-example-controller/pom.xml create mode 100644 jnpf-java-boot/jnpf-example/jnpf-example-controller/src/main/java/jnpf/controller/ContractController.java create mode 100644 jnpf-java-boot/jnpf-example/jnpf-example-entity/pom.xml create mode 100644 jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/entity/ContractEntity.java create mode 100644 jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/ContractForm.java create mode 100644 jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/ContractInfoVO.java create mode 100644 jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/ContractListVO.java create mode 100644 jnpf-java-boot/jnpf-example/pom.xml create mode 100644 jnpf-java-boot/jnpf-exception/pom.xml create mode 100644 jnpf-java-boot/jnpf-exception/src/main/java/jnpf/controller/LogController.java create mode 100644 jnpf-java-boot/jnpf-exception/src/main/java/jnpf/entity/LogEntity.java create mode 100644 jnpf-java-boot/jnpf-exception/src/main/java/jnpf/enums/LogLevelEnum.java create mode 100644 jnpf-java-boot/jnpf-exception/src/main/java/jnpf/enums/LogSortEnum.java create mode 100644 jnpf-java-boot/jnpf-exception/src/main/java/jnpf/exception/ResultException.java create mode 100644 jnpf-java-boot/jnpf-exception/src/main/java/jnpf/mapper/LogMapper.java create mode 100644 jnpf-java-boot/jnpf-exception/src/main/java/jnpf/model/ErrorLogVO.java create mode 100644 jnpf-java-boot/jnpf-exception/src/main/java/jnpf/model/HandleLogVO.java create mode 100644 jnpf-java-boot/jnpf-exception/src/main/java/jnpf/model/LogDelForm.java create mode 100644 jnpf-java-boot/jnpf-exception/src/main/java/jnpf/model/LoginLogVO.java create mode 100644 jnpf-java-boot/jnpf-exception/src/main/java/jnpf/model/PaginationLogModel.java create mode 100644 jnpf-java-boot/jnpf-exception/src/main/java/jnpf/model/RequestLogVO.java create mode 100644 jnpf-java-boot/jnpf-exception/src/main/java/jnpf/service/LogService.java create mode 100644 jnpf-java-boot/jnpf-exception/src/main/java/jnpf/service/impl/LogServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-exception/src/main/java/jnpf/util/JsonUtilEx.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/pom.xml create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/BigDataMapper.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/CustomerMapper.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/DocumentMapper.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/DocumentShareMapper.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/EmailConfigMapper.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/EmailReceiveMapper.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/EmailSendMapper.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/EmployeeMapper.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/OrderEntryMapper.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/OrderMapper.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/OrderReceivableMapper.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/ProductEntryMapper.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/ProductGoodsMapper.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/ProductMapper.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/ProductclassifyMapper.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/ProjectGanttMapper.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/TableExampleMapper.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/WorkLogMapper.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/WorkLogShareMapper.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/BigDataService.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/CustomerService.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/DocumentService.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/DocumentShareService.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/EmailConfigService.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/EmailReceiveService.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/EmailSendService.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/EmployeeService.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/OrderEntryService.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/OrderReceivableService.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/OrderService.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/ProductEntryService.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/ProductGoodsService.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/ProductService.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/ProductclassifyService.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/ProjectGanttService.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/TableExampleService.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/WorkLogService.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/WorkLogShareService.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/BigDataServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/CustomerServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/DocumentServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/DocumentShareServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/EmailConfigServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/EmailReceiveServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/EmailSendServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/EmployeeServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/OrderEntryServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/OrderReceivableServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/OrderServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/ProductEntryServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/ProductGoodsServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/ProductServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/ProductclassifyServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/ProjectGanttServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/TableExampleServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/WorkLogServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/WorkLogShareServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-controller/pom.xml create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/BarCodeController.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/BigDataController.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/CustomerController.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/DocumentController.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/DocumentPreviewController.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/EmailController.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/EmployeeController.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/OrderController.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/ProductController.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/ProductGoodsController.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/ProductclassifyController.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/ProjectGanttController.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/ReportManageController.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/ReportTemplateController.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/TableExampleController.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/WorkLogController.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/pom.xml create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/BigDataEntity.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/CustomerEntity.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/DocumentEntity.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/DocumentShareEntity.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/EmailSendEntity.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/EmployeeEntity.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/OrderEntity.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/OrderEntryEntity.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/OrderReceivableEntity.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/ProductEntity.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/ProductEntryEntity.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/ProductGoodsEntity.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/ProductclassifyEntity.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/ProjectGanttEntity.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/TableExampleEntity.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/WorkLogEntity.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/WorkLogShareEntity.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/EmployeeModel.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/ReportManageModel.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/bidata/BigBigDataListVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/customer/CustomerCrForm.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/customer/CustomerInfoVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/customer/CustomerListVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/customer/CustomerUpForm.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentCrForm.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentFolderTreeModel.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentFolderTreeVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentInfoVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentListVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentShareForm.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentSoutListVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentStomeListVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentSuserListVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentTrashListVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentUpForm.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentUploader.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/PageDocument.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/documentpreview/FileInfoVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/EmailCheckForm.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/EmailCofigInfoVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/EmailCrForm.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/EmailDraftListVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/EmailInfoModel.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/EmailInfoVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/EmailReceiveListVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/EmailSendCrForm.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/EmailSentListVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/EmailStarredListVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/PaginationEmail.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/emailconfig/EmailConfigCheckForm.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/emailconfig/EmailConfigSavaForm.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/employee/EmployeeCrForm.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/employee/EmployeeExportVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/employee/EmployeeImportVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/employee/EmployeeInfoModel.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/employee/EmployeeInfoVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/employee/EmployeeListVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/employee/EmployeeUpForm.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/employee/PaginationEmployee.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderCustomerVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderEntryListVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderEntryModel.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderExportModel.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderForm.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderGoodsVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderInfoOrderEntryModel.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderInfoOrderReceivableModel.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderInfoVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderListVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderReceivableListVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderReceivableModel.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/PaginationOrder.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/product/ProductCrForm.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/product/ProductInfoVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/product/ProductListVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/product/ProductPagination.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/product/ProductUpForm.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productEntry/ProductEntryInfoVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productEntry/ProductEntryListVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productEntry/ProductEntryMdoel.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productclassify/ProductclassifyCrForm.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productclassify/ProductclassifyInfoVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productclassify/ProductclassifyListVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productclassify/ProductclassifyModel.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productclassify/ProductclassifyUpForm.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productgoods/ProductGoodsCrForm.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productgoods/ProductGoodsInfoVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productgoods/ProductGoodsListVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productgoods/ProductGoodsPagination.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productgoods/ProductGoodsUpForm.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttCrForm.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttInfoVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttListVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttManagerIModel.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttTaskInfoVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttTaskTreeModel.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttTaskTreeVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttTreeModel.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttTreeVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttTsakCrForm.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttTsakUpForm.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttUpForm.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/schedule/ScheduleCrForm.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/schedule/ScheduleInfoVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/schedule/ScheduleListVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/schedule/ScheduleTime.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/schedule/ScheduleTimes.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/schedule/ScheduleUpForm.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/PaginationTableExample.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleCityListVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleCrForm.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleIndustryListVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleInfoVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleListAllVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleListDTO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleListVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleRowUpForm.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleSignUpForm.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleTreeModel.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleUpForm.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/postil/PostilInfoVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/postil/PostilModel.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/postil/PostilSendForm.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/worklog/WorkLogCrForm.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/worklog/WorkLogInfoVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/worklog/WorkLogListVO.java create mode 100644 jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/worklog/WorkLogUpForm.java create mode 100644 jnpf-java-boot/jnpf-extend/pom.xml create mode 100644 jnpf-java-boot/jnpf-file/jnpf-file-biz/pom.xml create mode 100644 jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/mapper/FileMapper.java create mode 100644 jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/service/YozoService.java create mode 100644 jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/service/impl/YozoServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/utils/YozoUtils.java create mode 100644 jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/yozo/client/AppAuthenticator.java create mode 100644 jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/yozo/client/UaaAppAuthenticator.java create mode 100644 jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/yozo/client/UaaAppConfigClient.java create mode 100644 jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/yozo/constants/EnumResultCode.java create mode 100644 jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/yozo/constants/UaaConstant.java create mode 100644 jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/yozo/utils/DefaultResult.java create mode 100644 jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/yozo/utils/HttpRequestUtils.java create mode 100644 jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/yozo/utils/IResult.java create mode 100644 jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/yozo/utils/SecretSignatureUtils.java create mode 100644 jnpf-java-boot/jnpf-file/jnpf-file-controller/pom.xml create mode 100644 jnpf-java-boot/jnpf-file/jnpf-file-controller/src/main/java/jnpf/controller/UtilsController.java create mode 100644 jnpf-java-boot/jnpf-file/jnpf-file-controller/src/main/java/jnpf/controller/YozoFileController.java create mode 100644 jnpf-java-boot/jnpf-file/jnpf-file-entity/pom.xml create mode 100644 jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/entity/FileEntity.java create mode 100644 jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/enums/FilePreviewTypeEnum.java create mode 100644 jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/Chunk.java create mode 100644 jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/ChunkRes.java create mode 100644 jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/FileForm.java create mode 100644 jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/LanguageVO.java create mode 100644 jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/MergeChunkDto.java create mode 100644 jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/PathTypeModel.java create mode 100644 jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/PreviewParams.java create mode 100644 jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/SuffixParams.java create mode 100644 jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/UploaderVO.java create mode 100644 jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/YozoFileParams.java create mode 100644 jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/YozoParams.java create mode 100644 jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/utils/SplicingUrlUtil.java create mode 100644 jnpf-java-boot/jnpf-file/pom.xml create mode 100644 jnpf-java-boot/jnpf-form/jnpf-form-biz/pom.xml create mode 100644 jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/mapper/FlowFormDataMapper.java create mode 100644 jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/mapper/FlowFormMapper.java create mode 100644 jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/mapper/FlowFormRelationMapper.java create mode 100644 jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/service/FlowFormRelationService.java create mode 100644 jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/service/FlowFormService.java create mode 100644 jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/service/FormDataService.java create mode 100644 jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/service/impl/FlowDataServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/service/impl/FlowFormRelationServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/service/impl/FlowFormServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/util/ConcurrencyUtils.java create mode 100644 jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/util/DateTimeFormatConstant.java create mode 100644 jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/util/FlowFormCustomUtils.java create mode 100644 jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/util/FlowFormDataUtil.java create mode 100644 jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/util/FlowFormHttpReqUtils.java create mode 100644 jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/util/FormCheckUtils.java create mode 100644 jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/util/FormInfoUtils.java create mode 100644 jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/util/FormPublicUtils.java create mode 100644 jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/util/ServiceBaseUtil.java create mode 100644 jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/util/VisualDevTableCre.java create mode 100644 jnpf-java-boot/jnpf-form/jnpf-form-controller/pom.xml create mode 100644 jnpf-java-boot/jnpf-form/jnpf-form-controller/src/main/java/jnpf/controller/FlowFormController.java create mode 100644 jnpf-java-boot/jnpf-form/jnpf-form-entity/pom.xml create mode 100644 jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/entity/FlowFormEntity.java create mode 100644 jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/entity/FlowFormRelationEntity.java create mode 100644 jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/flow/DataModel.java create mode 100644 jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/flow/FlowFormDataModel.java create mode 100644 jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/flow/FlowTempInfoModel.java create mode 100644 jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/form/DraftJsonModel.java create mode 100644 jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/form/FlowFieldModel.java create mode 100644 jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/form/FlowFormModel.java create mode 100644 jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/form/FlowFormPage.java create mode 100644 jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/form/FlowFormVo.java create mode 100644 jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/form/FlowSelectVo.java create mode 100644 jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/form/FormCheckModel.java create mode 100644 jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/form/FormDraftJsonModel.java create mode 100644 jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/form/MultipleControlEnum.java create mode 100644 jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/form/VisualTableModel.java create mode 100644 jnpf-java-boot/jnpf-form/pom.xml create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-biz/pom.xml create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/config/WebsocketConfig.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/AccountConfigMapper.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/ImContentMapper.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/ImReplyMapper.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/MessageMapper.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/MessageMonitorMapper.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/MessageTemplateConfigMapper.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/MessagereceiveMapper.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/SendConfigTemplateMapper.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/SendMessageConfigMapper.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/ShortLInkMapper.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/SmsFieldMapper.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/SynThirdInfoMapper.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/TemplateParamMapper.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/UserDeviceMapper.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/WechatUserMapper.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/ImContentService.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/ImReplyService.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/UserDeviceService.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/AccountConfigServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/ImContentServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/ImReplyServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/MessageMonitorServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/MessageServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/MessageTemplateConfigServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/MessagereceiveServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/SendConfigTemplateServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/SendMessageConfigServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/ShortLinkServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/SmsFieldServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/SynThirdDingTalkServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/SynThirdInfoServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/SynThirdQyServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/TemplateParamServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/UserDeviceServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/WechatUserServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-controller/pom.xml create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-controller/src/main/java/jnpf/message/controller/AccountConfigController.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-controller/src/main/java/jnpf/message/controller/ImReplyController.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-controller/src/main/java/jnpf/message/controller/MessageController.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-controller/src/main/java/jnpf/message/controller/MessageMonitorController.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-controller/src/main/java/jnpf/message/controller/MessageTemplateConfigController.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-controller/src/main/java/jnpf/message/controller/SendMessageConfigController.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-controller/src/main/java/jnpf/message/controller/ShortLinkController.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-controller/src/main/java/jnpf/message/controller/WxGZHFunctionController.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-controller/src/main/java/jnpf/message/websocket/WebSocket.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/pom.xml create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/AccountConfigEntity.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/ImContentEntity.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/ImReplyEntity.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/MessageEntity.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/MessageMonitorEntity.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/MessageReceiveEntity.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/MessageTemplateConfigEntity.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/QyWebChatModel.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/SendConfigRecordEntity.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/SendConfigTemplateEntity.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/SendMessageConfigEntity.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/ShortLinkEntity.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/SmsFieldEntity.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/SynThirdInfoEntity.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/TemplateParamEntity.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/UserDeviceEntity.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/WechatUserEntity.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/enums/MessageTypeEnum.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/ImReplyListModel.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/ImReplyListVo.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/ImReplySavaModel.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/ImUnreadNumModel.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/NoticeModel.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/NoticePagination.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/UserOnlineModel.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/UserOnlineVO.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/WxgzhMessageModel.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/accountconfig/AccountConfigForm.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/accountconfig/AccountConfigInfoVO.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/accountconfig/AccountConfigListVO.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/accountconfig/AccountConfigPagination.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/DingTalkDeptModel.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/DingTalkModel.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/DingTalkUserModel.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/EmailModel.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/MessageInfoVO.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/MessageNoticeVO.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/MessageRecordForm.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/NoticeCrForm.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/NoticeInfoVO.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/NoticeUpForm.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/NoticeVO.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/OraganizeListVO.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/PaginationMessage.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/QyWebChatDeptModel.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/QyWebChatUserModel.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/SentMessageForm.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/SynThirdInfoCrForm.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/SynThirdInfoUpForm.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagedatatype/MessageDataTypeForm.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagedatatype/MessageDataTypeInfoVO.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagedatatype/MessageDataTypeListVO.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagedatatype/MessageDataTypePagination.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagemonitor/MessageMonitorForm.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagemonitor/MessageMonitorInfoVO.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagemonitor/MessageMonitorListVO.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagemonitor/MessageMonitorPagination.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagemonitor/MsgDelForm.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagetemplateconfig/MessageTemplateConfigForm.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagetemplateconfig/MessageTemplateConfigInfoVO.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagetemplateconfig/MessageTemplateConfigListVO.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagetemplateconfig/MessageTemplateConfigPagination.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagetemplateconfig/SmsFieldModel.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagetemplateconfig/TemplateParamModel.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendconfigrecord/SendConfigRecordForm.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendconfigrecord/SendConfigRecordInfoVO.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendconfigrecord/SendConfigRecordListVO.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendconfigrecord/SendConfigRecordPagination.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendmessageconfig/MsgTemplateJsonModel.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendmessageconfig/SendConfigListVO.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendmessageconfig/SendConfigTemplateModel.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendmessageconfig/SendConfigTestResultModel.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendmessageconfig/SendMessageConfigForm.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendmessageconfig/SendMessageConfigInfoVO.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendmessageconfig/SendMessageConfigListVO.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendmessageconfig/SendMessageConfigPagination.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/MessageListVo.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/PaginationMessageModel.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/PaginationMessageVo.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/SendMessageModel.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/model/MessageModel.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/onclose/OnCloseModel.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/onconnettion/OnConnectionModel.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/onconnettion/OnLineModel.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/receivemessage/ReceiveMessageModel.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/receivemessage/ReceiveMessageVO.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/savafile/ImageMessageModel.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/savafile/MessageTypeModel.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/savafile/VoiceMessageModel.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/savamessage/SavaMessageModel.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/Base64Util.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/ConnectionType.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/DingTalkUtil.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/EmailUtil.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/JnpfMessageUtil.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/MessageChannelType.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/MessageParameterEnum.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/MyBatisPrimaryBase.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/OnlineUserModel.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/OnlineUserProvider.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/QyWebChatUtil.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/SendMessageTypeEnum.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/SynThirdConsts.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/SynThirdTotal.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/WebHookUtil.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/unipush/UinPush.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/weixingzh/WXGZHWebChatUtil.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/weixingzh/WxTemplateMsg.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/weixingzh/aes/AesException.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/weixingzh/aes/ByteGroup.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/weixingzh/aes/PKCS7Encoder.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/weixingzh/aes/SHA1.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/weixingzh/aes/WXBizMsgCrypt.java create mode 100644 jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/weixingzh/aes/XMLParse.java create mode 100644 jnpf-java-boot/jnpf-message/pom.xml create mode 100644 jnpf-java-boot/jnpf-oauth/jnpf-oauth-api/pom.xml create mode 100644 jnpf-java-boot/jnpf-oauth/jnpf-oauth-api/src/main/java/jnpf/service/AuthService.java create mode 100644 jnpf-java-boot/jnpf-oauth/jnpf-oauth-api/src/main/java/jnpf/util/AuthUtil.java create mode 100644 jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/pom.xml create mode 100644 jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/src/main/java/jnpf/granter/PasswordTokenGranter.java create mode 100644 jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/src/main/java/jnpf/granter/SocialsTokenGranter.java create mode 100644 jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/src/main/java/jnpf/granter/TempUserTokenGranter.java create mode 100644 jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/src/main/java/jnpf/listener/JnpfListener.java create mode 100644 jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/src/main/java/jnpf/listener/LoginListener.java create mode 100644 jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/src/main/java/jnpf/service/impl/AuthServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/src/main/java/jnpf/service/impl/LoginServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/src/main/java/jnpf/service/impl/UserDetailsByUserAccountServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/src/main/java/jnpf/service/impl/UserDetailsByUserIdServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/src/main/java/jnpf/util/LoginHolder.java create mode 100644 jnpf-java-boot/jnpf-oauth/jnpf-oauth-controller/pom.xml create mode 100644 jnpf-java-boot/jnpf-oauth/jnpf-oauth-controller/src/main/java/jnpf/controller/LoginController.java create mode 100644 jnpf-java-boot/jnpf-oauth/jnpf-oauth-entity/pom.xml create mode 100644 jnpf-java-boot/jnpf-oauth/jnpf-oauth-entity/src/main/java/jnpf/entity/TenantEntity.java create mode 100644 jnpf-java-boot/jnpf-oauth/jnpf-oauth-entity/src/main/java/jnpf/entity/TenantlogEntity.java create mode 100644 jnpf-java-boot/jnpf-oauth/jnpf-oauth-entity/src/main/java/jnpf/model/BuildUserCommonInfoModel.java create mode 100644 jnpf-java-boot/jnpf-oauth/jnpf-oauth-entity/src/main/java/jnpf/model/LoginConfigModel.java create mode 100644 jnpf-java-boot/jnpf-oauth/jnpf-oauth-entity/src/main/java/jnpf/model/LoginModel.java create mode 100644 jnpf-java-boot/jnpf-oauth/jnpf-oauth-entity/src/main/java/jnpf/model/LoginVO.java create mode 100644 jnpf-java-boot/jnpf-oauth/jnpf-oauth-entity/src/main/java/jnpf/model/SocialUnbindModel.java create mode 100644 jnpf-java-boot/jnpf-oauth/jnpf-oauth-entity/src/main/java/jnpf/model/UserLogForm.java create mode 100644 jnpf-java-boot/jnpf-oauth/pom.xml create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/pom.xml create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/constant/AuthorizeConst.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/AuthorizeMapper.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/ColumnsPurviewMapper.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/GroupMapper.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/OrganizeAdminIsTratorMapper.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/OrganizeMapper.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/OrganizeRelationMapper.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/PermissionGroupMapper.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/PositionMapper.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/RoleMapper.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/SocialsUserMapper.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/UserMapper.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/UserOldPasswordMapper.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/UserRelationMapper.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/rest/PullUserUtil.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/ColumnsPurviewService.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/GroupService.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/OrganizeRelationService.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/PositionService.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/RoleService.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/SocialsUserService.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/UserOldPasswordService.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/AuthorizeServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/ColumnsPurviewServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/GroupServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/OrganizeAdministratorServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/OrganizeRelationServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/OrganizeServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/PermissionGroupServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/PositionServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/RoleServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/SocialsUserServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/UserInfoServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/UserOldPasswordServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/UserRelationServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/UserServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/util/PermissionUtil.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/util/socials/AuthCallbackNew.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/util/socials/AuthDefaultSourceNew.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/util/socials/AuthDingTalkNewRequest.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/util/socials/AuthSocialsUtil.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/util/socials/AuthWechatAppletsRequest.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/util/socials/SocialsAuthEnum.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/util/socials/SocialsConfig.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-controller/pom.xml create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/AuthorizeController.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/GroupController.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/OrganizeAdministratorController.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/OrganizeController.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/PermissionGroupController.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/PositionController.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/RoleController.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/SocialsUserController.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/UserController.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/UserRelationController.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/UserSettingController.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/pom.xml create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/AuthorizeEntity.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/ColumnsPurviewEntity.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/GroupEntity.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/OrganizeAdministratorEntity.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/OrganizeEntity.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/OrganizeRelationEntity.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/PermissionEntityBase.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/PermissionGroupEntity.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/PositionEntity.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/RoleEntity.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/SignEntity.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/SocialsUserEntity.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/UserEntity.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/UserOldPasswordEntity.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/UserRelationEntity.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeConditionEnum.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeConditionModel.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeDataModel.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeDataReturnModel.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeDataReturnVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeDataUpForm.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeDataVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeDataValuesVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeItemObjIdsVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeModel.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/ConditionModel.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/DataValuesQuery.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/OnlineDynamicSqlModel.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/ResourceVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/SaveAuthForm.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/SaveBatchForm.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/columnspurview/ColumnsPurviewUpForm.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/datainterface/DataInterfaceVarConst.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeByAuthModel.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeConditionModel.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeCrForm.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeCrModel.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeDepartCrForm.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeDepartInfoVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeDepartListVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeDepartSelectorByAuthListVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeDepartSelectorListVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeDepartUpForm.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeInfoVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeListVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeModel.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeSelectorByAuthVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeSelectorVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeTreeVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeUpForm.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organizeadministrator/ModuleSelectorModel.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organizeadministrator/ModuleSelectorVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organizeadministrator/OrganizeAdminIsTratorCrForm.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organizeadministrator/OrganizeAdministratorCrModel.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organizeadministrator/OrganizeAdministratorListVo.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organizeadministrator/OrganizeAdministratorModel.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organizeadministrator/OrganizeAdministratorSelectedVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organizeadministrator/OrganizeAdministratorSelectorModel.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organizeadministrator/OrganizeAdministratorSelectorVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organizeadministrator/SystemSelectorVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/permission/PermissionModel.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/permission/PermissionVoBase.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/permissiongroup/PermissionGroupListVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/permissiongroup/PermissionGroupModel.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/portalManage/AuthorizePortalManagePrimary.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PaginationPosition.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PosOrgConditionModel.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PosOrgModel.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PositionConditionSelectorVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PositionCrForm.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PositionInfoVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PositionListAllVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PositionListVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PositionSelectorVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PositionUpForm.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PositionVo.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/role/RoleCrForm.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/role/RoleInfoVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/role/RoleListVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/role/RoleModel.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/role/RolePagination.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/role/RoleSelectorVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/role/RoleUpForm.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/socails/SocialsUserInfo.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/socails/SocialsUserModel.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/socails/SocialsUserVo.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/UserIdListVo.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/UserLogForm.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/WorkHandoverModel.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserAppDataForm.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserCrForm.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserInfoForm.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserLanguageForm.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserModifyPasswordForm.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserPasswordForm.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserResetPasswordForm.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserSettingForm.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserThemeForm.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserUpAdminForm.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserUpForm.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/mod/UserAllModel.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/mod/UserAuthorizeModel.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/mod/UserByRoleModel.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/mod/UserConditionModel.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/mod/UserIdModel.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/mod/UserIdModelByPage.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/mod/UserImportModel.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/mod/UserSelectorModel.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/mod/UserUpModel.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/mod/UsersByPositionModel.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/page/PageUser.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/page/PaginationUser.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/ImUserListVo.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserAdminVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserAllVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserAuthorizeVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserBaseInfoVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserBaseVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserByRoleVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserExportExceptionVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserExportVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserImportVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserInfoVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserListVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserLogVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserSelectorVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserSubordinateVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/usergroup/GroupCrForm.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/usergroup/GroupInfoVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/usergroup/GroupPaginationVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/usergroup/GroupSelectorVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/usergroup/GroupTreeModel.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/usergroup/GroupUpForm.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/userrelation/UserRelationDel.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/userrelation/UserRelationForm.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/userrelation/UserRelationIdsVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/userrelation/UserRelationListVO.java create mode 100644 jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/userrelation/UserRelationTreeModel.java create mode 100644 jnpf-java-boot/jnpf-permission/pom.xml create mode 100644 jnpf-java-boot/jnpf-public/jnpf-common-all/pom.xml create mode 100644 jnpf-java-boot/jnpf-public/jnpf-common-all/src/main/java/jnpf/model/AppDataInfoModel.java create mode 100644 jnpf-java-boot/jnpf-public/jnpf-common-all/src/main/java/jnpf/model/AppObjectDataModel.java create mode 100644 jnpf-java-boot/jnpf-public/jnpf-common-all/src/main/java/jnpf/model/LoginForm.java create mode 100644 jnpf-java-boot/jnpf-public/jnpf-common-all/src/main/java/jnpf/model/app/AppMenuModel.java create mode 100644 jnpf-java-boot/jnpf-public/jnpf-common-all/src/main/java/jnpf/onlinedev/model/OnlineDevData.java create mode 100644 jnpf-java-boot/jnpf-public/jnpf-generater-base/pom.xml create mode 100644 jnpf-java-boot/jnpf-public/jnpf-generater-base/src/main/java/jnpf/model/FieLdsModelExcel.java create mode 100644 jnpf-java-boot/jnpf-public/jnpf-generater-base/src/main/java/jnpf/model/QueryModel.java create mode 100644 jnpf-java-boot/jnpf-public/jnpf-generater-base/src/main/java/jnpf/util/GenUtil.java create mode 100644 jnpf-java-boot/jnpf-public/jnpf-generater-base/src/main/java/jnpf/util/GeneraterSwapUtil.java create mode 100644 jnpf-java-boot/jnpf-public/jnpf-generater-base/src/main/java/jnpf/util/QueryUtil.java create mode 100644 jnpf-java-boot/jnpf-public/jnpf-provider/pom.xml create mode 100644 jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/base/service/DictionaryDataService.java create mode 100644 jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/base/service/ModuleButtonService.java create mode 100644 jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/base/service/ModuleColumnService.java create mode 100644 jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/base/service/ModuleDataAuthorizeSchemeService.java create mode 100644 jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/base/service/ModuleFormService.java create mode 100644 jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/base/service/ModuleService.java create mode 100644 jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/base/service/SystemService.java create mode 100644 jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/engine/service/FlowTaskService.java create mode 100644 jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/AccountConfigService.java create mode 100644 jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/MessageMonitorService.java create mode 100644 jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/MessageService.java create mode 100644 jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/MessageTemplateConfigService.java create mode 100644 jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/MessagereceiveService.java create mode 100644 jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/SendConfigTemplateService.java create mode 100644 jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/SendMessageConfigService.java create mode 100644 jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/ShortLinkService.java create mode 100644 jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/SmsFieldService.java create mode 100644 jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/SynThirdDingTalkService.java create mode 100644 jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/SynThirdInfoService.java create mode 100644 jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/SynThirdQyService.java create mode 100644 jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/TemplateParamService.java create mode 100644 jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/WechatUserService.java create mode 100644 jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/permission/service/AuthorizeService.java create mode 100644 jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/permission/service/OrganizeAdministratorService.java create mode 100644 jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/permission/service/OrganizeService.java create mode 100644 jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/permission/service/PermissionGroupService.java create mode 100644 jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/permission/service/UserRelationService.java create mode 100644 jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/permission/service/UserService.java create mode 100644 jnpf-java-boot/jnpf-scheduletask/jnpf-scheduletask-biz/pom.xml create mode 100644 jnpf-java-boot/jnpf-scheduletask/jnpf-scheduletask-biz/src/main/java/jnpf/scheduletask/task/ScheduleTaskHandler.java create mode 100644 jnpf-java-boot/jnpf-scheduletask/jnpf-scheduletask-controller/pom.xml create mode 100644 jnpf-java-boot/jnpf-scheduletask/jnpf-scheduletask-controller/src/main/java/jnpf/scheduletask/controller/TimeTaskController.java create mode 100644 jnpf-java-boot/jnpf-scheduletask/pom.xml create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/pom.xml create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/AdvancedQueryMapper.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/BaseComFieldsMapper.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/BillRuleMapper.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/CommonWordsMapper.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/DataInterfaceLogMapper.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/DataInterfaceMapper.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/DataInterfaceUserMapper.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/DataInterfaceVariateMapper.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/DataMapMapper.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/DbLinkMapper.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/DbTableMapper.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/DictionaryDataMapper.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/DictionaryTypeMapper.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/InterfaceOauthMapper.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/MessageTemplateMapper.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ModuleButtonMapper.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ModuleColumnMapper.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ModuleDataAuthorizeLinkDataMapper.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ModuleDataAuthorizeMapper.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ModuleDataAuthorizeSchemeMapper.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ModuleFormMapper.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ModuleMapper.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/PortalManageMapper.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/PrintDevMapper.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/PrintLogMapper.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ProvinceAtlasMapper.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ProvinceMapper.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ScheduleLogMapper.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ScheduleNewMapper.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ScheduleNewUserMapper.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/SignMapper.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/SmsTemplateMapper.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/SysconfigMapper.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/SystemMapper.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/AdvancedQueryService.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/BillRuleService.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/ComFieldsService.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/CommonWordsService.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/DataInterfaceLogService.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/DataInterfaceService.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/DataInterfaceUserService.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/DataInterfaceVariateService.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/DataMapService.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/DbLinkService.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/DbSyncService.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/DbTableService.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/DictionaryTypeService.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/IPrintDevService.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/InterfaceOauthService.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/MessageTemplateService.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/ModuleDataAuthorizeLinkDataService.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/ModuleDataAuthorizeService.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/PortalManageService.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/PrintLogService.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/ProvinceAtlasService.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/ProvinceService.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/ScheduleLogService.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/ScheduleNewService.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/ScheduleNewUserService.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/SignService.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/SmsTemplateService.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/SysconfigService.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/UserOnlineService.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/AdvancedQueryServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/BillRuleServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ComFieldsServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/CommonWordsServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/DataInterfaceLogServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/DataInterfaceServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/DataInterfaceUserServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/DataInterfaceVariateServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/DataMapServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/DbLinkServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/DbSyncServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/DbTableServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/DictionaryDataServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/DictionaryTypeServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/InterfaceOauthServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/MessageTemplateServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ModuleButtonServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ModuleColumnServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ModuleDataAuthorizeLinkDataServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ModuleDataAuthorizeSchemeServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ModuleDataAuthorizeServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ModuleFormServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ModuleServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/PortalManageServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/PrintDevServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/PrintLogServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ProvinceAtlasServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ProvinceServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ScheduleLogServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ScheduleNewServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ScheduleNewUserServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/SignServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/SmsTemplateServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/SysconfigServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/SystemServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/UserOnlineServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/AnnotationType.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/ClassUtil.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/DataInterfaceParamUtil.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/FileManageUtil.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/MonitorUtil.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/OptimizeUtil.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/Pop3Util.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/PrintDevUtil.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/RegexUtils.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/SentMessageUtil.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/SmsAliYunUtil.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/SmsTenCentCloudUtil.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/SmsUtil.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/SmtpUtil.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/SourceUtil.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/SynDingTalkUtil.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/SynQyWebChatUtil.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/TempJsonUtil.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/TestSendConfigUtil.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/dbutil/TableUtil.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/interfaceUtil/InterfaceUtil.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/job/Schedule.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/job/ScheduleConfig.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/job/ScheduleJobUtil.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/visualUtil/ChooseFiledTypeUtil.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/visualUtil/PubulishUtil.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-controller/pom.xml create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/AdvancedQueryController.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/AreaController.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/BillRuleController.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/CacheManageController.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/ComFieldsController.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/CommonWordsController.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/DataInterfaceController.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/DataInterfaceLogController.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/DataInterfaceVariateController.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/DbLinkController.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/DbSyncController.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/DbTableController.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/DictionaryDataController.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/DictionaryTypeController.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/InterfaceOauthController.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/MessageTemplateController.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/ModuleButtonController.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/ModuleColumnController.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/ModuleController.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/ModuleDataAuthorizeController.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/ModuleDataAuthorizeLinkController.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/ModuleDataAuthorizeSchemeController.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/ModuleFormController.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/MonitorController.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/PortalManageController.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/PrintDevController.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/PrintLogController.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/ProvinceAtlasController.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/ScheduleNewController.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/SmsTemplateController.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/SynThirdInfoController.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/SysConfigController.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/SystemController.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/UserOnlineController.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/pom.xml create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/AdvancedQueryEntity.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/BillRuleEntity.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ComFieldsEntity.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/CommonWordsEntity.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/DataInterfaceEntity.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/DataInterfaceLogEntity.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/DataInterfaceUserEntity.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/DataInterfaceVariateEntity.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/DbBackupEntity.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/DictionaryDataEntity.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/DictionaryTypeEntity.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/EmailConfigEntity.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/EmailReceiveEntity.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/InterfaceOauthEntity.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/MessageTemplateEntity.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ModuleButtonEntity.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ModuleColumnEntity.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ModuleDataAuthorizeEntity.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ModuleDataAuthorizeLinkEntity.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ModuleDataAuthorizeSchemeEntity.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ModuleEntity.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ModuleFormEntity.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/OperatorRecordEntity.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/PortalManageEntity.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/PrintDevEntity.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/PrintLogEntity.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ProvinceAtlasEntity.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ProvinceEntity.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ScheduleLogEntity.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ScheduleNewEntity.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ScheduleNewUserEntity.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/SmsTemplateEntity.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/SysConfigEntity.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/SystemEntity.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/VisualDataMapEntity.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/InterfaceOauth/IdentDataInterfaceLogVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/InterfaceOauth/IdentInterfaceListModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/InterfaceOauth/InterfaceIdentForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/InterfaceOauth/InterfaceIdentListVo.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/InterfaceOauth/InterfaceIdentVo.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/InterfaceOauth/InterfaceUserForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/InterfaceOauth/InterfaceUserVo.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/InterfaceOauth/PaginationIntrfaceLog.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/InterfaceOauth/PaginationOauth.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/MailAccount.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/MailFile.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/MailModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/PaginationPrint.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/PrintDevTreeModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/PrintTableTreeModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/RequestParameterModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/ResponseParametersModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/advancedquery/AdvancedQueryListVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/advancedquery/AdvancedQuerySchemeForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/base/SystemBaeModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/base/SystemCrModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/base/SystemListVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/base/SystemPageVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/base/SystemUpModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/base/SystemVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/billrule/BillRuleCrForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/billrule/BillRuleInfoVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/billrule/BillRuleListVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/billrule/BillRulePagination.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/billrule/BillRuleUpForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/button/ButtonListVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/button/ButtonModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/button/ButtonTreeListModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/button/ButtonTreeListSelectVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/button/ButtonTreeListVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/button/ButtonVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/button/ModuleButtonCrForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/button/ModuleButtonInfoVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/button/ModuleButtonUpForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/cachemanage/CacheManageInfoVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/cachemanage/CacheManageListVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/column/ColumnBatchForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/column/ColumnListVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/column/ColumnModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/column/ModuleColumnCrForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/column/ModuleColumnInfoVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/column/ModuleColumnUpForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/comfields/ComFieldsCrForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/comfields/ComFieldsInfoVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/comfields/ComFieldsListVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/comfields/ComFieldsUpForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/commonword/ComWordsPagination.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/commonword/ComWordsTreeModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/commonword/CommonWordsForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/commonword/CommonWordsVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/ApiDateModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataConfigJsonModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceActionModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceActionVo.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceCrForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceGetListVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceInvokeModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceListVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceLogVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceMarkModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfacePage.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfacePageModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceParamModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceTreeModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceTreeVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceUpForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceVo.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/ExtraModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/FieldModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/HeadModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/PageParamModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/PaginationDataInterface.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/PaginationDataInterfaceModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/ParamModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/SqlDateModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterfacevariate/DataInterfaceVariateListVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterfacevariate/DataInterfaceVariateModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterfacevariate/DataInterfaceVariateSelectorVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterfacevariate/DataInterfaceVariateVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbbackup/DbBackupListVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dblink/DbLinkBaseForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dblink/DbLinkCreUpForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dblink/DbLinkInfoVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dblink/DbLinkListVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dblink/DbLinkModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dblink/DbLinkSelectorListVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dblink/PaginationDbLink.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbsync/DbSyncForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbsync/DbSyncPrintForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbsync/DbSyncVo.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbtable/dto/DbTableFieldDTO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbtable/form/DbFieldForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbtable/form/DbTableForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbtable/vo/DbFieldVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbtable/vo/DbTableInfoVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbtable/vo/DbTableListVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbtable/vo/DbTableVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/DictionaryDataAllModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/DictionaryDataAllVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/DictionaryDataCrForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/DictionaryDataExportModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/DictionaryDataInfoVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/DictionaryDataListTreeVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/DictionaryDataListVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/DictionaryDataModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/DictionaryDataSelectVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/DictionaryDataUpForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/PageDictionaryData.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarytype/DictionaryExportModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarytype/DictionaryTypeCrForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarytype/DictionaryTypeInfoVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarytype/DictionaryTypeListVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarytype/DictionaryTypeModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarytype/DictionaryTypeSelectModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarytype/DictionaryTypeSelectVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarytype/DictionaryTypeUpForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dto/PrintDevFormDTO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dto/PrintDevPaginationDTO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/form/FormBatchForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/form/ModuleFormCrForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/form/ModuleFormInfoVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/form/ModuleFormListVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/form/ModuleFormModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/form/ModuleFormUpForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/messagetemplate/MessageTemplateCrForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/messagetemplate/MessageTemplateListVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/messagetemplate/MessageTemplateSelector.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/messagetemplate/MessageTemplateUpForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/messagetemplate/MessageTemplateVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/MenuListVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/MenuSelectAllVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/MenuSelectVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/ModuleCrForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/ModuleExportModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/ModuleInfoVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/ModuleModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/ModulePermissionModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/ModulePermissionVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/ModuleUpForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/ModuleVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/PaginationMenu.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/PropertyJsonModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/moduledataauthorize/DataAuthorizeCrForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/moduledataauthorize/DataAuthorizeInfoVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/moduledataauthorize/DataAuthorizeLinkForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/moduledataauthorize/DataAuthorizeListVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/moduledataauthorize/DataAuthorizeTableNameVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/moduledataauthorize/DataAuthorizeUpForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/moduledataauthorizescheme/DataAuthorizeSchemeCrForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/moduledataauthorizescheme/DataAuthorizeSchemeInfoVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/moduledataauthorizescheme/DataAuthorizeSchemeListVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/moduledataauthorizescheme/DataAuthorizeSchemeUpForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/monitor/CpuModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/monitor/DiskModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/monitor/MemoryModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/monitor/MonitorListVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/monitor/SwapModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/monitor/SystemModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/online/AuthFlieds.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/online/BatchOnlineModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/online/PerColModels.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/online/VisualMenuModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/portalManage/PortalManageCreForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/portalManage/PortalManagePage.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/portalManage/PortalManagePageDO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/portalManage/PortalManagePrimary.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/portalManage/PortalManageUpForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/portalManage/PortalManageVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/portalManage/PortalPagination.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/print/PrintOption.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/printlog/PrintLogInfo.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/printlog/PrintLogQuery.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/province/AreaModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/province/AtlasFeaturesModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/province/AtlasJsonModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/province/AtlasPropModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/province/ProvinceCrForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/province/ProvinceInfoVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/province/ProvinceListTreeVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/province/ProvinceListVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/province/ProvinceSelectListVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/province/ProvinceUpForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/query/PrintDevDataQuery.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/query/PrintDevFieldsQuery.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/resource/ResourceModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/schedule/ScheduleDetailModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/schedule/ScheduleJobModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/schedule/ScheduleNewAppListVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/schedule/ScheduleNewCrForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/schedule/ScheduleNewDetailInfoVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/schedule/ScheduleNewInfoVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/schedule/ScheduleNewListVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/schedule/ScheduleNewTime.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/schedule/ScheduleNewUpForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/sign/SignForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/sign/SignListVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/smstemplate/SmsTemplateCrForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/smstemplate/SmsTemplateListVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/smstemplate/SmsTemplateSelector.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/smstemplate/SmsTemplateUpForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/smstemplate/SmsTemplateVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/systemconfig/EmailTestForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/systemconfig/SaveSysConfigForm.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/systemconfig/SmsModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/systemconfig/SysConfigListVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/systemconfig/SysConfigModel.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/vo/PrintDevListVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/vo/PrintDevVO.java create mode 100644 jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/vo/PrintLogVO.java create mode 100644 jnpf-java-boot/jnpf-system/pom.xml create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/pom.xml create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/mapper/VisualCategoryMapper.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/mapper/VisualComponentMapper.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/mapper/VisualConfigMapper.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/mapper/VisualDbMapper.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/mapper/VisualMapMapper.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/mapper/VisualMapper.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/mapper/VisualRecordMapper.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/VisualCategoryService.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/VisualComponentService.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/VisualConfigService.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/VisualDbService.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/VisualMapService.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/VisualRecordService.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/VisualService.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/impl/VisualCategoryServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/impl/VisualComponentServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/impl/VisualConfigServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/impl/VisualDbServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/impl/VisualMapServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/impl/VisualRecordServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/impl/VisualServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-controller/pom.xml create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-controller/src/main/java/jnpf/visualdata/controller/VisualCategoryController.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-controller/src/main/java/jnpf/visualdata/controller/VisualComponentController.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-controller/src/main/java/jnpf/visualdata/controller/VisualController.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-controller/src/main/java/jnpf/visualdata/controller/VisualDbController.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-controller/src/main/java/jnpf/visualdata/controller/VisualMapController.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-controller/src/main/java/jnpf/visualdata/controller/VisualRecordController.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-controller/src/main/java/jnpf/visualdata/controller/aop/VisualBindAspect.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-controller/src/main/java/jnpf/visualdata/utils/VisualDataPermissionUtil.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/pom.xml create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/entity/VisualCategoryEntity.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/entity/VisualComponentEntity.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/entity/VisualConfigEntity.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/entity/VisualDbEntity.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/entity/VisualEntity.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/entity/VisualMapEntity.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/entity/VisualRecordEntity.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/enums/VisualImgEnum.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/VisualPageVO.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/VisualPagination.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualApiRequest.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualCrModel.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualCrform.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualInfoModel.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualInfoVO.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualListVO.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualModel.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualPaginationModel.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualProxyModel.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualSelectorVO.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualUpModel.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualUpform.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualcategory/VisualCategoryCrForm.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualcategory/VisualCategoryInfoVO.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualcategory/VisualCategoryListVO.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualcategory/VisualCategoryUpForm.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualcomponent/VisualComponentCrForm.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualcomponent/VisualComponentInfoVO.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualcomponent/VisualComponentListVO.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualcomponent/VisualComponentPaginationModel.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualcomponent/VisualComponentUpForm.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualconfig/VisualConfigCrForm.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualconfig/VisualConfigInfoModel.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualconfig/VisualConfigUpForm.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualdb/VisualDbCrForm.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualdb/VisualDbInfoVO.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualdb/VisualDbListVO.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualdb/VisualDbQueryForm.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualdb/VisualDbSelectVO.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualdb/VisualDbUpForm.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualfile/ImageVO.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualmap/VisualMapCrForm.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualmap/VisualMapInfoVO.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualmap/VisualMapListVO.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualmap/VisualMapUpForm.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualrecord/VisualRecordCrForm.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualrecord/VisualRecordInfoVO.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualrecord/VisualRecordListVO.java create mode 100644 jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualrecord/VisualRecordUpForm.java create mode 100644 jnpf-java-boot/jnpf-visualdata/pom.xml create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/pom.xml create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/mapper/FilterMapper.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/mapper/VisualdevMapper.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/mapper/VisualdevReleaseMapper.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/mapper/VisualdevShortLinkMapper.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/service/FilterService.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/service/VisualdevReleaseService.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/service/VisualdevService.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/service/VisualdevShortLinkService.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/service/impl/FilterServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/service/impl/VisualdevReleaseServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/service/impl/VisualdevServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/service/impl/VisualdevShortLinkServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/OnlineFilterUtil.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/ReadFile.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/SourceUtil.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/VisualFlowFormUtil.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/VisualUtil.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/VisualUtils.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/app/AppGenModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/app/AppGenUtil.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/common/DataControlUtils.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/common/FormCommonUtil.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/common/FunctionFormPublicUtil.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/common/SuperQueryUtil.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/custom/CustomGenerator.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/custom/CustomTemplateEngine.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/custom/VelocityEnum.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/form/FormGenModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/form/FormGenUtil.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/fuctionFormVue3/GenerateForm.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/fuctionFormVue3/GenerateFormFlow.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/fuctionFormVue3/GenerateFormList.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/fuctionFormVue3/GenerateFormListFlow.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/fuctionFormVue3/GenerateWorkFlow.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/fuctionFormVue3/common/GenerateCommon.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/fuctionFormVue3/common/GenerateConstant.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/fuctionFormVue3/common/GenerateInterface.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/fuctionFormVue3/common/GenerateParamModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/functionForm/CodeGenerateUtil.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/functionForm/FlowFormUtil.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/functionForm/FormListUtil.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/functionForm/FormUtil.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/functionForm/FunctionFlowUtil.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/workFlow/WorkGenModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/workFlow/WorkGenUtil.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-controller/pom.xml create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-controller/src/main/java/jnpf/base/controller/FilterController.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-controller/src/main/java/jnpf/base/controller/VisualdevController.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-controller/src/main/java/jnpf/base/controller/VisualdevShortLinkController.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/pom.xml create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/entity/FilterEntity.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/entity/VisualdevEntity.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/entity/VisualdevReleaseEntity.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/entity/VisualdevShortLinkEntity.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/ColumnDataModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/DownloadCodeForm.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/ExportSelectedModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/FormDataField.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/PaginationVisualdev.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template6/AuthorityModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template6/BtnData.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template6/ColumnListField.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template6/IndexGridField6Model.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template6/Template6Model.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template7/ChildrenModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template7/HtmlModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template7/KeyModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template7/MastModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template7/Template7DataModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template7/Template7Model.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualDevCrForm.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualDevInfoVO.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualDevJsonModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualDevListVO.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualDevPubModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualDevUpForm.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualFunctionModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualTreeModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualWebTypeEnum.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualdevTreeChildModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualdevTreeVO.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/filter/FilterInfo.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/filter/FilterQuery.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/filter/RuleInfo.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/read/ReadEnum.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/read/ReadListVO.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/read/ReadModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/shortLink/VisualdevShortLinkConfigVo.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/shortLink/VisualdevShortLinkForm.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/shortLink/VisualdevShortLinkModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/shortLink/VisualdevShortLinkPwd.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/shortLink/VisualdevShortLinkVo.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/pom.xml create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-biz/pom.xml create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-biz/src/main/java/jnpf/generater/factory/CodeGenerateFactory.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-biz/src/main/java/jnpf/generater/factory/CodeGenerateFactoryV3.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-biz/src/main/java/jnpf/generater/service/VisualdevGenService.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-biz/src/main/java/jnpf/generater/service/impl/VisualdevGenServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-controller/pom.xml create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-controller/src/main/java/jnpf/generater/controller/VisualdevGenController.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-entity/pom.xml create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-entity/src/main/java/jnpf/generater/model/FormDesign/ColumnChildListModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-entity/src/main/java/jnpf/generater/model/FormDesign/ColumnListDataModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-entity/src/main/java/jnpf/generater/model/FormDesign/ColumnListModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-entity/src/main/java/jnpf/generater/model/FormDesign/ListSearchGroupModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-entity/src/main/java/jnpf/generater/model/FormDesign/SearchTypeModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-entity/src/main/java/jnpf/generater/model/FormDesign/TemplateMethodEnum.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-entity/src/main/java/jnpf/generater/model/GenBaseInfo.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-entity/src/main/java/jnpf/generater/model/GenFileNameSuffix.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/pom.xml create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/pom.xml create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/config/IntegrateConfig.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/config/IntegrateListener.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/job/Integrate.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/job/IntegrateJobUtil.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/job/IntegrateQueryJobUtil.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/job/QuartzUtil.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/mapper/IntegrateMapper.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/mapper/IntegrateNodeMapper.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/mapper/IntegrateQueueMapper.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/mapper/IntegrateTaskMapper.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/service/IntegrateNodeService.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/service/IntegrateQueueService.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/service/IntegrateService.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/service/IntegrateTaskService.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/service/impl/IntegrateNodeServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/service/impl/IntegrateQueueServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/service/impl/IntegrateServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/service/impl/IntegrateTaskServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/util/IntegrateUtil.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-controller/pom.xml create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-controller/src/main/java/jnpf/integrate/controller/IntegrateController.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-controller/src/main/java/jnpf/integrate/controller/IntegrateTaskController.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/pom.xml create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/entity/IntegrateEntity.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/entity/IntegrateNodeEntity.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/entity/IntegrateQueueEntity.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/entity/IntegrateTaskEntity.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/childnode/IntegrateChildNode.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/childnode/IntegrateMsgModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/childnode/IntegrateParamModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/childnode/IntegrateProperties.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/childnode/IntegrateTemplateModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/childnode/TransferModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/integrate/IntegrateCrForm.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/integrate/IntegrateInfoVO.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/integrate/IntegrateListVO.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/integrate/IntegratePageModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/integrate/IntegratePagination.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/integrate/IntegrateUpForm.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/integratetask/IntegrateQueueListVO.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/integratetask/IntegrateTaskInfo.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/integratetask/IntegrateTaskListVO.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/integratetask/IntegrateTaskModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/nodeJson/IntegrateChildNodeList.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/nodeJson/IntegrateChildNodeModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/nodeJson/IntegrateModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/pom.xml create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/pom.xml create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/mapper/VisualdevModelDataMapper.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/service/VisualDevInfoService.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/service/VisualDevListService.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/service/VisualdevModelDataService.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/service/impl/VisualDevInfoServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/service/impl/VisualDevListServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/service/impl/VisualdevModelDataServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/util/AutoFeildsUtil.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/util/OnlineDevDbUtil.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/util/onlineDevUtil/OnlineDatabaseUtils.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/util/onlineDevUtil/OnlineDevInfoUtils.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/util/onlineDevUtil/OnlineDevListUtils.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/util/onlineDevUtil/OnlineProductSqlUtils.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/util/onlineDevUtil/OnlinePublicUtils.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/util/onlineDevUtil/OnlineQuerySqlUtils.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/util/onlineDevUtil/OnlineSwapDataUtils.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/util/onlineDevUtil/RelationFormUtils.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-controller/pom.xml create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-controller/src/main/java/jnpf/onlinedev/controller/VisualdevModelAppController.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-controller/src/main/java/jnpf/onlinedev/controller/VisualdevModelDataController.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/pom.xml create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/entity/VisualdevModelDataEntity.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/BaseDevModelVO.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/BatchRemoveIdsVo.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/ColumnDataInfoVO.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/DataInfoVO.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/ExcelImFieldModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/FormDataInfoVO.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevData.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevEnum/CacheKeyEnum.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevEnum/MultipleControlEnum.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevEnum/OnlineDataTypeEnum.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevListModel/OnlineColumnChildFieldModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevListModel/OnlineColumnFieldModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevListModel/OnlineConfigModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevListModel/OnlineDevListDataVO.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevListModel/OnlineFieldsModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevListModel/OnlineListSqlModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevListModel/PropsFatherModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevListModel/PropsModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevListModel/SlotModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevListModel/VisualColumnSearchVO.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineImport/ExcelImportModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineImport/ImportDataModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineImport/ImportExcelFieldModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineImport/ImportFormCheckUniqueModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineImport/OnlineExportExceptionVO.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineImport/VisualImportModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/PaginationModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/PaginationModelExport.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/PortalDefaultDTO.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/VisualdevModelDataCrForm.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/VisualdevModelDataInfoVO.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/VisualdevModelDataListVO.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/VisualdevModelDataUpForm.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/fields/autosize/AutosizeModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/fields/options/ColumnOptionModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/fields/options/OptionsModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/fields/picker/PickerOptionsModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/fields/style/StyleModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/fields/style/textStyleModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/visualdevmodelApp/AppDataInfoVO.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/pom.xml create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-biz/pom.xml create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-biz/src/main/java/jnpf/portal/mapper/PortalDataMapper.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-biz/src/main/java/jnpf/portal/mapper/PortalMapper.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-biz/src/main/java/jnpf/portal/service/PortalDataService.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-biz/src/main/java/jnpf/portal/service/PortalService.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-biz/src/main/java/jnpf/portal/service/impl/PortalDataServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-biz/src/main/java/jnpf/portal/service/impl/PortalServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-controller/pom.xml create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-controller/src/main/java/jnpf/portal/controller/DashboardController.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-controller/src/main/java/jnpf/portal/controller/PortalController.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-controller/src/main/java/jnpf/portal/controller/PortalDataController.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/pom.xml create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/constant/PortalConst.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/entity/PortalDataEntity.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/entity/PortalEntity.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/EmailVO.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/FlowTodo.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/FlowTodoCountVO.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/FlowTodoVO.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/MyFlowTodoVO.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalCrForm.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalCustomPrimary.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalDataForm.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalDefaultDTO.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalExportDataVo.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalInfoAuthVO.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalInfoVO.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalListModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalListVO.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalModPrimary.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalPagination.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalReleaseForm.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalReleasePrimary.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalReleaseVO.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalSelectModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalSelectVO.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalTreeModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalUpForm.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalViewPrimary.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/ReleaseModel.java create mode 100644 jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/pom.xml create mode 100644 jnpf-java-boot/jnpf-visualdev/pom.xml create mode 100644 jnpf-java-boot/jnpf-web/.editorconfig create mode 100644 jnpf-java-boot/jnpf-web/.env.development create mode 100644 jnpf-java-boot/jnpf-web/.env.production create mode 100644 jnpf-java-boot/jnpf-web/.eslintignore create mode 100644 jnpf-java-boot/jnpf-web/.eslintrc.js create mode 100644 jnpf-java-boot/jnpf-web/.gitignore create mode 100644 jnpf-java-boot/jnpf-web/Dockerfile create mode 100644 jnpf-java-boot/jnpf-web/README.md create mode 100644 jnpf-java-boot/jnpf-web/babel.config.js create mode 100644 jnpf-java-boot/jnpf-web/build/index.js create mode 100644 jnpf-java-boot/jnpf-web/conf/default.conf create mode 100644 jnpf-java-boot/jnpf-web/jest.config.js create mode 100644 jnpf-java-boot/jnpf-web/plopfile.js create mode 100644 jnpf-java-boot/jnpf-web/postcss.config.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/echarts/echarts.min.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/base/browser/ui/codicons/codicon/codicon.ttf create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/base/worker/workerMain.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/abap/abap.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/apex/apex.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/azcli/azcli.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/bat/bat.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/cameligo/cameligo.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/clojure/clojure.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/coffee/coffee.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/cpp/cpp.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/csharp/csharp.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/csp/csp.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/css/css.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/dart/dart.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/dockerfile/dockerfile.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/fsharp/fsharp.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/go/go.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/graphql/graphql.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/handlebars/handlebars.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/hcl/hcl.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/html/html.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/ini/ini.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/java/java.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/javascript/javascript.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/julia/julia.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/kotlin/kotlin.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/less/less.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/lexon/lexon.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/lua/lua.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/markdown/markdown.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/mips/mips.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/msdax/msdax.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/mysql/mysql.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/objective-c/objective-c.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/pascal/pascal.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/pascaligo/pascaligo.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/perl/perl.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/pgsql/pgsql.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/php/php.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/postiats/postiats.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/powerquery/powerquery.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/powershell/powershell.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/pug/pug.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/python/python.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/r/r.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/razor/razor.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/redis/redis.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/redshift/redshift.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/restructuredtext/restructuredtext.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/ruby/ruby.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/rust/rust.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/sb/sb.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/scala/scala.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/scheme/scheme.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/scss/scss.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/shell/shell.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/solidity/solidity.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/sophia/sophia.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/sql/sql.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/st/st.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/swift/swift.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/systemverilog/systemverilog.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/tcl/tcl.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/twig/twig.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/typescript/typescript.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/vb/vb.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/xml/xml.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/yaml/yaml.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/editor/editor.main.css create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/editor/editor.main.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/editor/editor.main.nls.de.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/editor/editor.main.nls.es.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/editor/editor.main.nls.fr.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/editor/editor.main.nls.it.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/editor/editor.main.nls.ja.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/editor/editor.main.nls.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/editor/editor.main.nls.ko.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/editor/editor.main.nls.ru.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/editor/editor.main.nls.zh-cn.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/editor/editor.main.nls.zh-tw.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/language/css/cssMode.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/language/css/cssWorker.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/language/html/htmlMode.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/language/html/htmlWorker.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/language/json/jsonMode.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/language/json/jsonWorker.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/language/typescript/tsMode.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/language/typescript/tsWorker.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/loader.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/socials/dingtalk.png create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/socials/feishu.png create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/socials/gitHub.png create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/socials/qq.png create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/socials/wechat_open.png create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/socials/wxWork.png create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/tinymce/langs/zh_CN.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/tinymce/plugins/advlist/plugin.min.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/tinymce/plugins/anchor/plugin.min.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/tinymce/plugins/autolink/plugin.min.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/tinymce/plugins/autosave/plugin.min.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/tinymce/plugins/charmap/plugin.min.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/tinymce/plugins/code/plugin.min.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/tinymce/plugins/codesample/plugin.min.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/tinymce/plugins/directionality/plugin.min.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/tinymce/plugins/emoticons/js/emojis.min.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/tinymce/plugins/emoticons/plugin.min.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/tinymce/plugins/fullscreen/plugin.min.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/tinymce/plugins/help/plugin.min.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/tinymce/plugins/hr/plugin.min.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/tinymce/plugins/image/plugin.min.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/tinymce/plugins/imagetools/plugin.min.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/tinymce/plugins/importcss/plugin.min.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/tinymce/plugins/insertdatetime/plugin.min.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/tinymce/plugins/lineheight/plugin.min.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/tinymce/plugins/link/plugin.min.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/tinymce/plugins/lists/plugin.min.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/tinymce/plugins/media/plugin.min.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/tinymce/plugins/nonbreaking/plugin.min.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/tinymce/plugins/noneditable/plugin.min.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/tinymce/plugins/pagebreak/plugin.min.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/tinymce/plugins/paste/plugin.min.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/tinymce/plugins/preview/plugin.min.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/tinymce/plugins/print/plugin.min.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/tinymce/plugins/quickbars/plugin.min.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/tinymce/plugins/rowspacing/plugin.min.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/tinymce/plugins/save/plugin.min.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/tinymce/plugins/searchreplace/plugin.min.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/tinymce/plugins/table/plugin.min.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/tinymce/plugins/textpattern/plugin.min.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/tinymce/plugins/toc/plugin.min.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/tinymce/plugins/visualblocks/plugin.min.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/tinymce/plugins/visualchars/plugin.min.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/tinymce/plugins/wordcount/plugin.min.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/tinymce/skins/content/default/content.min.css create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/tinymce/skins/ui/wukong/content.min.css create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/tinymce/skins/ui/wukong/skin.min.css create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/tinymce/themes/silver/theme.min.js create mode 100644 jnpf-java-boot/jnpf-web/public/cdn/tinymce/tinymce.min.js create mode 100644 jnpf-java-boot/jnpf-web/public/favicon.ico create mode 100644 jnpf-java-boot/jnpf-web/public/index.html create mode 100644 jnpf-java-boot/jnpf-web/src/App.vue create mode 100644 jnpf-java-boot/jnpf-web/src/api/common.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/extend/bigData.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/extend/document.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/extend/documentPreview.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/extend/email.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/extend/employee.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/extend/order.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/extend/projectGantt.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/extend/saleOrder.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/extend/tableExample.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/home.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/msgCenter/accountConfig.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/msgCenter/msgMonitor.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/msgCenter/msgTemplate.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/msgCenter/sendConfig.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/onlineDev/dataReport.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/onlineDev/dataV.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/onlineDev/integrate.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/onlineDev/portal.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/onlineDev/schedule.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/onlineDev/visualDev.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/onlineDev/webDesign.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/permission/authorize.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/permission/department.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/permission/gradeManage.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/permission/group.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/permission/onlineUser.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/permission/organize.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/permission/position.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/permission/role.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/permission/socialsUser.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/permission/user.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/permission/userRelation.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/permission/userSetting.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/system/advancedQuery.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/system/authorize.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/system/billRule.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/system/buttonAuthorize.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/system/cacheManage.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/system/columnAuthorize.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/system/commonWords.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/system/dataAuthorize.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/system/formAuthorize.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/system/log.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/system/menu.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/system/message.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/system/messageTemplate.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/system/monitor.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/system/portal.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/system/printDev.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/system/province.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/system/smsTemplate.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/system/sysConfig.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/system/system.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/system/timeTask.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/systemData/commonFields.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/systemData/dataBackup.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/systemData/dataInterface.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/systemData/dataModel.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/systemData/dataSource.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/systemData/dictionary.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/systemData/interfaceOauth.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/user.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/workFlow/FlowBefore.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/workFlow/FlowDelegate.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/workFlow/FlowEngine.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/workFlow/FlowEngineForm.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/workFlow/FlowLaunch.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/workFlow/FlowMonitor.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/workFlow/FormDesign.js create mode 100644 jnpf-java-boot/jnpf-web/src/api/workFlow/workFlowForm.js create mode 100644 jnpf-java-boot/jnpf-web/src/assets/custom-theme/fonts/element-icons.ttf create mode 100644 jnpf-java-boot/jnpf-web/src/assets/custom-theme/fonts/element-icons.woff create mode 100644 jnpf-java-boot/jnpf-web/src/assets/custom-theme/index.css create mode 100644 jnpf-java-boot/jnpf-web/src/assets/fonts/ym-custom/iconfont.css create mode 100644 jnpf-java-boot/jnpf-web/src/assets/fonts/ym-custom/iconfont.ttf create mode 100644 jnpf-java-boot/jnpf-web/src/assets/fonts/ym-custom/iconfont.woff create mode 100644 jnpf-java-boot/jnpf-web/src/assets/fonts/ym-custom/iconfont.woff2 create mode 100644 jnpf-java-boot/jnpf-web/src/assets/fonts/ym/iconfont.css create mode 100644 jnpf-java-boot/jnpf-web/src/assets/fonts/ym/iconfont.ttf create mode 100644 jnpf-java-boot/jnpf-web/src/assets/fonts/ym/iconfont.woff create mode 100644 jnpf-java-boot/jnpf-web/src/assets/fonts/ym/iconfont.woff2 create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/404.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/dashboard-nodata.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/emptyElement.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/emptyPortal.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/flowStatus/adopt.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/flowStatus/cancel.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/flowStatus/draft.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/flowStatus/reject.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/flowStatus/revoke.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/flowStatus/wait.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/generator/columnType1.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/generator/columnType2.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/generator/columnType3.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/generator/columnType4.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/generator/columnType5.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/gg.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/home/Group.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/home/Group2.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/home/Group3.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/home/anouance.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/home/ask.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/home/bg.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/home/pay.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/home/return.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/home/sold.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/import.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/iphoneBg.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/jnpf.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/jnpf1.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/jnpf2.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/loading-iframe.gif create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/login-banner.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/login-company-logo.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/login_logo.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/login_qr.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/login_version.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/other-login-dialog.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/portal-nodata.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/query-noData.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/rankList/badge1.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/rankList/badge2.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/rankList/badge3.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/rankList/cup1.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/rankList/cup2.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/rankList/cup3.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/rankList/medal1.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/rankList/medal2.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/rankList/medal3.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/rankList/rank1.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/rankList/rank2.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/rankList/rank3.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/settings/blend.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/settings/classic.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/settings/dark.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/settings/functional.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/settings/lightWhite.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/settings/plain.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/sign.gif create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/success.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/tip.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/tz.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/upload.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/xsl.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/images/xsl1.png create mode 100644 jnpf-java-boot/jnpf-web/src/assets/scss/common.scss create mode 100644 jnpf-java-boot/jnpf-web/src/assets/scss/font.scss create mode 100644 jnpf-java-boot/jnpf-web/src/assets/scss/theme.scss create mode 100644 jnpf-java-boot/jnpf-web/src/components/ChangeField/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Charts/Keyboard.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Charts/LineMarker.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Charts/MixChart.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Charts/Normal.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Charts/mixins/resize.js create mode 100644 jnpf-java-boot/jnpf-web/src/components/ColumnDesign/CustomBtn.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/ColumnDesign/FlowCondition.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/ColumnDesign/FormScript.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/ColumnDesign/condition/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/ColumnDesign/index.scss create mode 100644 jnpf-java-boot/jnpf-web/src/components/ColumnDesign/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/ColumnDesign/main.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/ColumnDesign/mainApp.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/ColumnDesign/uploadBox.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/ColumnSettings/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/ExportBox/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/components/Amount/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/components/BillRule/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/components/ComplexHeader/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/components/DicSelect/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/components/JnpfDateRangePicker/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/components/JnpfNumber/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/components/NumRange/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/components/UserSelect/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/generator/comConfig.js create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/generator/config.js create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/generator/css.js create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/generator/drawingDefalut.js create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/generator/html.js create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/generator/js.js create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/generator/ruleTrigger.js create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/DraggableItem.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/DraggableItemApp.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/FieldDialog.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/FormScript.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/Home.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/JsonDrawer.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/BatchEditing.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/ComRight.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/RAlert.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/RAreaSelect.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/RAutoComplete.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/RCalculate.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/RCascader/TreeEditing.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/RCascader/TreeNodeDialog.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/RCascader/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/RCheckbox.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/RCollapse.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/RColorPicker.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/RDatePicker.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/RDateRange.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/RDivider.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/RGroupTitle.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/RInput.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/RInputNumber.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/RLink.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/RPopupAttr.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/RPopupSelect.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/RRadio.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/RRate.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/RRelationForm.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/RRelationFormAttr.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/RSelect.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/RSlider.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/RSwitch.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/RTab.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/RTable/AddTableForm.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/RTable/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/RText.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/RTextarea.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/RTimePicker.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/RTimeRange.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/RTreeSelect/TreeEditing.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/RTreeSelect/TreeNodeDialog.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/RTreeSelect/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/RUploadFile.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/RUploadImg.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/dynamicMixin.js create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/handelFlidMixin.js create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/mixin.js create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightComponents/tpl.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/RightPanel.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/ScriptDemo.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/index/StyleScript.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/parser/Parser.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/parser/example/Index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/parser/index.js create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/preview/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/render/render.js create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/styles/home.scss create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/styles/index.scss create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/utils/db.js create mode 100644 jnpf-java-boot/jnpf-web/src/components/Generator/utils/index.js create mode 100644 jnpf-java-boot/jnpf-web/src/components/Hamburger/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/HeaderSearch/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/JNPF-TreeTransfer/array.js create mode 100644 jnpf-java-boot/jnpf-web/src/components/JNPF-TreeTransfer/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/JNPF-enlarge/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/JNPF-iconBox/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/JNPF-table/Column.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/JNPF-table/ColumnSettings.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/JNPF-table/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/JNPF-tableOperation/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/JNPF-topOperation/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/JNPF-transfer/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/JNPF-uploadBtn/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/JNPF-userBox/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/JNPF-userTransfer/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/JNPF-usersTransfer/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/JNPFCustom/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/JNPFEditor/monaco.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/JNPFEditor/quill.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/JNPFImport/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/Alert/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/AreaSelect/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/AutoComplete/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/Barcode/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/Button/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/Calculate/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/Cascader/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/Checkbox/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/ColorPicker/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/DatePicker/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/DepSelect/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/Divider/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/GroupSelect/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/GroupTitle/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/Input/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/InputNumber/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/InputTable/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/Link/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/OpenData/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/OrganizeSelect/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/PopupAttr/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/PopupSelect/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/PopupTableSelect/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/PosSelect/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/Qrcode/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/Radio/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/Rate/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/RelationForm/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/RelationFormAttr/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/RoleSelect/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/Select/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/Slider/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/Switch/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/Text/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/Textarea/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/TimePicker/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/TreeSelect/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/Upload/Preview.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/Upload/UploadFile.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/Upload/UploadImg.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/Upload/vue-simple-uploader/fileItem.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/Upload/vue-simple-uploader/fileUploader.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/Upload/vue-simple-uploader/mixin.js create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/UserSelect/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Jnpf/UsersSelect/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/JsonEditor/codemirror.css create mode 100644 jnpf-java-boot/jnpf-web/src/components/JsonEditor/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/LangSelect/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Pagination/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/PreviewDialog/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/PrintBrowse/batch.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/PrintBrowse/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/PrintBrowse/printMinxin.js create mode 100644 jnpf-java-boot/jnpf-web/src/components/PrintDialog/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Process/FlowCard/Preview.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Process/FlowCard/config.js create mode 100644 jnpf-java-boot/jnpf-web/src/components/Process/FlowCard/index.scss create mode 100644 jnpf-java-boot/jnpf-web/src/components/Process/FlowCard/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Process/FlowCard/util.js create mode 100644 jnpf-java-boot/jnpf-web/src/components/Process/OrgSelect/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Process/OrgTransfer/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Process/OrgTransfer/orgTransfer.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Process/OrgTransfer/positionTransfer.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Process/OrgTransfer/roleTransfer.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Process/OrgUsersSelect/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Process/Preview.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Process/PropPanel/FlowDialog.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Process/PropPanel/FlowFormDialog.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Process/PropPanel/InterfaceDialog.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Process/PropPanel/TemplateDetail.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Process/PropPanel/formulaData.js create mode 100644 jnpf-java-boot/jnpf-web/src/components/Process/PropPanel/formulaDialog.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Process/PropPanel/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Process/PropPanel/msgDialog.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Process/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Process/main.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Schedule/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/ScheduleView/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Screenfull/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/SelectDialog/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/SignImgDialog/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/SizeSelect/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/SuperQuery/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Upload/SingleImg.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/Upload/UploadFileSingle.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/CardHeader/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/HBarChart/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/HCard/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/HCarousel/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/HCommonFunc/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/HDataBoard/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/HEmail/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/HIframe/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/HImage/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/HLineChart/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/HMapChart/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/HNotice/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/HPieChart/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/HRadarChart/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/HRankList/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/HSchedule/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/HSchedule/calendar.js create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/HSchedule/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/HTable/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/HText/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/HTimeAxis/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/HTodo/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/HTodoList/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/HVideo/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/Layout/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/Link/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/PortalDesign/RightComponents/chat/BarStyle.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/PortalDesign/RightComponents/chat/Chart.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/PortalDesign/RightComponents/chat/Color.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/PortalDesign/RightComponents/chat/Data.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/PortalDesign/RightComponents/chat/Label.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/PortalDesign/RightComponents/chat/Legend.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/PortalDesign/RightComponents/chat/MainTitle.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/PortalDesign/RightComponents/chat/Margin.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/PortalDesign/RightComponents/chat/SubTitle.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/PortalDesign/RightComponents/chat/Tooltip.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/PortalDesign/RightComponents/chat/XAxis.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/PortalDesign/RightComponents/chat/YAxis.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/PortalDesign/RightComponents/common/Card.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/PortalDesign/RightComponents/common/CarouselData.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/PortalDesign/RightComponents/common/Collapse.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/PortalDesign/RightComponents/common/ColumnData.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/PortalDesign/RightComponents/common/CommonFunData.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/PortalDesign/RightComponents/common/DataBoardData.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/PortalDesign/RightComponents/common/Link.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/PortalDesign/RightComponents/common/MapSet.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/PortalDesign/RightComponents/common/Notice.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/PortalDesign/RightComponents/common/NoticeColumnData.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/PortalDesign/RightComponents/common/Refresh.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/PortalDesign/RightComponents/common/Schedule.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/PortalDesign/RightComponents/common/Tab.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/PortalDesign/RightComponents/common/Table.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/PortalDesign/RightComponents/common/Text.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/PortalDesign/RightComponents/common/TodoData.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/PortalDesign/components/AddBtn.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/PortalDesign/components/JSONArea.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/PortalDesign/components/Preview.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/PortalDesign/components/RightPanel.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/PortalDesign/components/config.js create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/PortalDesign/components/data.js create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/PortalDesign/components/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/PortalDesign/components/parser.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/PortalDesign/components/popupEditor.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/PortalDesign/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/index.js create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/mixins/common.js create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/mixins/index.js create mode 100644 jnpf-java-boot/jnpf-web/src/components/VisualPortal/mixins/useRedo.js create mode 100644 jnpf-java-boot/jnpf-web/src/components/index.js create mode 100644 jnpf-java-boot/jnpf-web/src/components/integrationProcess/FlowCard/Preview.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/integrationProcess/FlowCard/config.js create mode 100644 jnpf-java-boot/jnpf-web/src/components/integrationProcess/FlowCard/define.js create mode 100644 jnpf-java-boot/jnpf-web/src/components/integrationProcess/FlowCard/index.scss create mode 100644 jnpf-java-boot/jnpf-web/src/components/integrationProcess/FlowCard/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/integrationProcess/FlowCard/util.js create mode 100644 jnpf-java-boot/jnpf-web/src/components/integrationProcess/PropPanel/AddDataNode.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/integrationProcess/PropPanel/DataInterfaceNode.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/integrationProcess/PropPanel/DeleteDataNode.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/integrationProcess/PropPanel/FormListModal.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/integrationProcess/PropPanel/GetDataNode.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/integrationProcess/PropPanel/InterfaceDialog.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/integrationProcess/PropPanel/MessageNode.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/integrationProcess/PropPanel/StartNode.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/integrationProcess/PropPanel/UpdateDataNode.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/integrationProcess/PropPanel/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/integrationProcess/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/integrationProcess/main.vue create mode 100644 jnpf-java-boot/jnpf-web/src/components/jnpf-form-tip-item/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/directive/clipboard/clipboard.js create mode 100644 jnpf-java-boot/jnpf-web/src/directive/clipboard/index.js create mode 100644 jnpf-java-boot/jnpf-web/src/directive/el-drag-dialog/drag.js create mode 100644 jnpf-java-boot/jnpf-web/src/directive/el-drag-dialog/index.js create mode 100644 jnpf-java-boot/jnpf-web/src/directive/permission/index.js create mode 100644 jnpf-java-boot/jnpf-web/src/directive/permission/permission.js create mode 100644 jnpf-java-boot/jnpf-web/src/filters/index.js create mode 100644 jnpf-java-boot/jnpf-web/src/lang/en.js create mode 100644 jnpf-java-boot/jnpf-web/src/lang/index.js create mode 100644 jnpf-java-boot/jnpf-web/src/lang/zh.js create mode 100644 jnpf-java-boot/jnpf-web/src/lang/zhtw.js create mode 100644 jnpf-java-boot/jnpf-web/src/layout/blend/Navbar.vue create mode 100644 jnpf-java-boot/jnpf-web/src/layout/blend/index.js create mode 100644 jnpf-java-boot/jnpf-web/src/layout/blend/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/layout/blend/menu/FixiOSBug.js create mode 100644 jnpf-java-boot/jnpf-web/src/layout/blend/menu/Item.vue create mode 100644 jnpf-java-boot/jnpf-web/src/layout/blend/menu/SidebarItem.vue create mode 100644 jnpf-java-boot/jnpf-web/src/layout/blend/menu/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/layout/blend/sidebar/FixiOSBug.js create mode 100644 jnpf-java-boot/jnpf-web/src/layout/blend/sidebar/Item.vue create mode 100644 jnpf-java-boot/jnpf-web/src/layout/blend/sidebar/Link.vue create mode 100644 jnpf-java-boot/jnpf-web/src/layout/blend/sidebar/Logo.vue create mode 100644 jnpf-java-boot/jnpf-web/src/layout/blend/sidebar/SidebarItem.vue create mode 100644 jnpf-java-boot/jnpf-web/src/layout/blend/sidebar/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/layout/blend/topMenu.vue create mode 100644 jnpf-java-boot/jnpf-web/src/layout/classic/Navbar.vue create mode 100644 jnpf-java-boot/jnpf-web/src/layout/classic/index.js create mode 100644 jnpf-java-boot/jnpf-web/src/layout/classic/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/layout/classic/sidebar/FixiOSBug.js create mode 100644 jnpf-java-boot/jnpf-web/src/layout/classic/sidebar/Item.vue create mode 100644 jnpf-java-boot/jnpf-web/src/layout/classic/sidebar/Link.vue create mode 100644 jnpf-java-boot/jnpf-web/src/layout/classic/sidebar/Logo.vue create mode 100644 jnpf-java-boot/jnpf-web/src/layout/classic/sidebar/SidebarItem.vue create mode 100644 jnpf-java-boot/jnpf-web/src/layout/classic/sidebar/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/layout/components/AppMain.vue create mode 100644 jnpf-java-boot/jnpf-web/src/layout/components/MessageList.vue create mode 100644 jnpf-java-boot/jnpf-web/src/layout/components/NavbarRight.vue create mode 100644 jnpf-java-boot/jnpf-web/src/layout/components/ResetPassword.vue create mode 100644 jnpf-java-boot/jnpf-web/src/layout/components/settings/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/layout/components/settings/minix.js create mode 100644 jnpf-java-boot/jnpf-web/src/layout/components/tagsView/ScrollPane.vue create mode 100644 jnpf-java-boot/jnpf-web/src/layout/components/tagsView/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/layout/components/userList/Im.vue create mode 100644 jnpf-java-boot/jnpf-web/src/layout/components/userList/UserList.vue create mode 100644 jnpf-java-boot/jnpf-web/src/layout/functional/Logo.vue create mode 100644 jnpf-java-boot/jnpf-web/src/layout/functional/Navbar.vue create mode 100644 jnpf-java-boot/jnpf-web/src/layout/functional/index.js create mode 100644 jnpf-java-boot/jnpf-web/src/layout/functional/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/layout/functional/menu/FixiOSBug.js create mode 100644 jnpf-java-boot/jnpf-web/src/layout/functional/menu/Item.vue create mode 100644 jnpf-java-boot/jnpf-web/src/layout/functional/menu/Link.vue create mode 100644 jnpf-java-boot/jnpf-web/src/layout/functional/menu/SidebarItem.vue create mode 100644 jnpf-java-boot/jnpf-web/src/layout/functional/menu/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/layout/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/layout/mixin/ResizeHandler.js create mode 100644 jnpf-java-boot/jnpf-web/src/layout/plain/Navbar.vue create mode 100644 jnpf-java-boot/jnpf-web/src/layout/plain/index.js create mode 100644 jnpf-java-boot/jnpf-web/src/layout/plain/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/layout/plain/sidebar/FixiOSBug.js create mode 100644 jnpf-java-boot/jnpf-web/src/layout/plain/sidebar/Item.vue create mode 100644 jnpf-java-boot/jnpf-web/src/layout/plain/sidebar/Link.vue create mode 100644 jnpf-java-boot/jnpf-web/src/layout/plain/sidebar/Logo.vue create mode 100644 jnpf-java-boot/jnpf-web/src/layout/plain/sidebar/SidebarItem.vue create mode 100644 jnpf-java-boot/jnpf-web/src/layout/plain/sidebar/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/main.js create mode 100644 jnpf-java-boot/jnpf-web/src/mixins/generator/common.js create mode 100644 jnpf-java-boot/jnpf-web/src/mixins/generator/form.js create mode 100644 jnpf-java-boot/jnpf-web/src/mixins/generator/index.js create mode 100644 jnpf-java-boot/jnpf-web/src/permission.js create mode 100644 jnpf-java-boot/jnpf-web/src/router/index.js create mode 100644 jnpf-java-boot/jnpf-web/src/router/modules/base.js create mode 100644 jnpf-java-boot/jnpf-web/src/settings.js create mode 100644 jnpf-java-boot/jnpf-web/src/store/getters.js create mode 100644 jnpf-java-boot/jnpf-web/src/store/index.js create mode 100644 jnpf-java-boot/jnpf-web/src/store/modules/app.js create mode 100644 jnpf-java-boot/jnpf-web/src/store/modules/base.js create mode 100644 jnpf-java-boot/jnpf-web/src/store/modules/generator.js create mode 100644 jnpf-java-boot/jnpf-web/src/store/modules/permission.js create mode 100644 jnpf-java-boot/jnpf-web/src/store/modules/settings.js create mode 100644 jnpf-java-boot/jnpf-web/src/store/modules/tagsView.js create mode 100644 jnpf-java-boot/jnpf-web/src/store/modules/user.js create mode 100644 jnpf-java-boot/jnpf-web/src/styles/btn.scss create mode 100644 jnpf-java-boot/jnpf-web/src/styles/element-ui.scss create mode 100644 jnpf-java-boot/jnpf-web/src/styles/element-variables.scss create mode 100644 jnpf-java-boot/jnpf-web/src/styles/fullCalendar.scss create mode 100644 jnpf-java-boot/jnpf-web/src/styles/index.scss create mode 100644 jnpf-java-boot/jnpf-web/src/styles/mixin.scss create mode 100644 jnpf-java-boot/jnpf-web/src/styles/sidebar.scss create mode 100644 jnpf-java-boot/jnpf-web/src/styles/transition.scss create mode 100644 jnpf-java-boot/jnpf-web/src/styles/variables.scss create mode 100644 jnpf-java-boot/jnpf-web/src/utils/apiUrl.js create mode 100644 jnpf-java-boot/jnpf-web/src/utils/auth.js create mode 100644 jnpf-java-boot/jnpf-web/src/utils/clipboard.js create mode 100644 jnpf-java-boot/jnpf-web/src/utils/define.js create mode 100644 jnpf-java-boot/jnpf-web/src/utils/error-log.js create mode 100644 jnpf-java-boot/jnpf-web/src/utils/formValidate.js create mode 100644 jnpf-java-boot/jnpf-web/src/utils/get-page-title.js create mode 100644 jnpf-java-boot/jnpf-web/src/utils/i18n.js create mode 100644 jnpf-java-boot/jnpf-web/src/utils/index.js create mode 100644 jnpf-java-boot/jnpf-web/src/utils/jnpf.js create mode 100644 jnpf-java-boot/jnpf-web/src/utils/message.js create mode 100644 jnpf-java-boot/jnpf-web/src/utils/notify.js create mode 100644 jnpf-java-boot/jnpf-web/src/utils/open-window.js create mode 100644 jnpf-java-boot/jnpf-web/src/utils/request.js create mode 100644 jnpf-java-boot/jnpf-web/src/utils/scroll-to.js create mode 100644 jnpf-java-boot/jnpf-web/src/utils/validate.js create mode 100644 jnpf-java-boot/jnpf-web/src/views/basic/dynamicDataReport/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/basic/dynamicDictionary/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/basic/dynamicDictionary/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/basic/dynamicModel/form/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/basic/dynamicModel/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/basic/dynamicModel/list/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/basic/dynamicModel/list/ImportBox.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/basic/dynamicModel/list/RelevanceDetail.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/basic/dynamicModel/list/Search.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/basic/dynamicModel/list/child-table-column.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/basic/dynamicModel/list/detail/Item.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/basic/dynamicModel/list/detail/Parser.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/basic/dynamicModel/list/detail/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/basic/dynamicModel/list/extraForm.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/basic/dynamicModel/list/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/basic/dynamicModel/view/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/basic/dynamicPortal/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/basic/externalLink/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/basic/lockScreen/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/basic/messageRecord/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/basic/messageRecord/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/basic/profile/components/Authorize.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/basic/profile/components/JustAuth.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/basic/profile/components/Password.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/basic/profile/components/SysLog.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/basic/profile/components/UserInfo.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/basic/profile/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/dashboard/Setting.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/dashboard/admin/components/LineChart.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/dashboard/admin/components/PanelGroup.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/dashboard/admin/components/mixins/resize.js create mode 100644 jnpf-java-boot/jnpf-web/src/views/dashboard/admin/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/dashboard/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/dashboard/mixin.js create mode 100644 jnpf-java-boot/jnpf-web/src/views/error-page/404.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/barCode/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/bigData/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/document/FolderTree.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/document/Preview.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/document/UserBox.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/document/fileUploader.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/document/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/documentPreview/Detail.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/documentPreview/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/email/Config.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/email/Detail.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/email/DetailMain.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/email/DetailPage.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/email/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/email/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/formDemo/fieldForm1/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/formDemo/fieldForm2/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/formDemo/fieldForm3/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/formDemo/fieldForm4/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/formDemo/fieldForm5/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/formDemo/fieldForm6/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/formDemo/verifyForm/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/formDemo/verifyForm1/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/graphDemo/echartsBar/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/graphDemo/echartsBarAcross/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/graphDemo/echartsCandlestick/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/graphDemo/echartsFunnel/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/graphDemo/echartsGauge/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/graphDemo/echartsLineArea/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/graphDemo/echartsLineBar/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/graphDemo/echartsPie/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/graphDemo/echartsScatter/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/graphDemo/echartsTree/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/graphDemo/highchartsArea/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/graphDemo/highchartsBellcurve/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/graphDemo/highchartsBullet/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/graphDemo/highchartsColumn/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/graphDemo/highchartsFunnel/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/graphDemo/highchartsGauge/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/graphDemo/highchartsLine/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/graphDemo/highchartsPie/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/graphDemo/highchartsScatter/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/graphDemo/highchartsWordcloud/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/graphDemo/mixins/resize.js create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/importAndExport/ExportForm.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/importAndExport/ImportForm.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/importAndExport/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/map/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/order/Detail.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/order/GoodsBox.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/order/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/printData/Bill.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/printData/Offer.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/printData/Record.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/printData/Storage.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/printData/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/printData/printStyle.js create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/projectGantt/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/projectGantt/Task.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/projectGantt/TaskForm.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/projectGantt/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/saleOrder/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/saleOrder/GoodsBox.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/saleOrder/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/signature/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/signet/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/tableDemo/commonForm/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/tableDemo/commonTable/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/tableDemo/complexHeader/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/tableDemo/complexHeader/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/tableDemo/extension/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/tableDemo/groupingTable/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/tableDemo/lockTable/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/tableDemo/mergeTable/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/tableDemo/postilTable/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/tableDemo/postilTable/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/tableDemo/printTable/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/tableDemo/redactTable/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/tableDemo/signTable/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/tableDemo/statisticsTable/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/tableDemo/tableTree/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/extend/tableDemo/treeTable/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/formShortLink/form/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/formShortLink/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/formShortLink/list/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/formShortLink/list/ImportBox.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/formShortLink/list/Search.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/formShortLink/list/child-table-column.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/formShortLink/list/detail/Item.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/formShortLink/list/detail/Parser.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/formShortLink/list/detail/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/formShortLink/list/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/generator/AddBox.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/generator/DownloadForm.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/generator/Preview.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/generator/TableForm.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/generator/flowForm/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/generator/flowForm/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/generator/webForm/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/generator/webForm/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/login/auth-redirect.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/login/index.scss create mode 100644 jnpf-java-boot/jnpf-web/src/views/login/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/login/sso-redirect.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/msgCenter/accountConfig/emailConfig/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/msgCenter/accountConfig/emailConfig/SendTestForm.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/msgCenter/accountConfig/emailConfig/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/msgCenter/accountConfig/smsConfig/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/msgCenter/accountConfig/smsConfig/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/msgCenter/accountConfig/webhookConfig/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/msgCenter/accountConfig/webhookConfig/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/msgCenter/accountConfig/wxWananchiConfig/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/msgCenter/accountConfig/wxWananchiConfig/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/msgCenter/msgMonitor/Detail.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/msgCenter/msgMonitor/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/msgCenter/msgTemplate/Detail.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/msgCenter/msgTemplate/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/msgCenter/msgTemplate/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/msgCenter/sendConfig/Detail.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/msgCenter/sendConfig/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/msgCenter/sendConfig/SendResults.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/msgCenter/sendConfig/TemplateDialog.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/msgCenter/sendConfig/TemplateForm.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/msgCenter/sendConfig/TestSend.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/msgCenter/sendConfig/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/onlineDev/dataReport/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/onlineDev/dataReport/Preview.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/onlineDev/dataReport/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/onlineDev/integrate/Drawer.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/onlineDev/integrate/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/onlineDev/integrate/design/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/onlineDev/integrate/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/onlineDev/visualPortal/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/onlineDev/visualPortal/IndexPreview.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/onlineDev/visualPortal/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/onlineDev/visualPortal/releaseDialog.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/onlineDev/webDesign/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/onlineDev/webDesign/ShortLinkDialog.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/onlineDev/webDesign/ViewForm.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/onlineDev/webDesign/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/permission/authorize/Authorize.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/permission/authorize/AuthorizeForm.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/permission/authorize/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/permission/authorize/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/permission/authorize/permissionGroup.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/permission/gradeManage/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/permission/gradeManage/GradeUserSelect.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/permission/gradeManage/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/permission/group/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/permission/group/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/permission/organize/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/permission/organize/checkUser.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/permission/organize/depForm.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/permission/organize/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/permission/position/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/permission/position/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/permission/position/userRelation.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/permission/role/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/permission/role/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/permission/role/userRelation.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/permission/user/Diagram.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/permission/user/ExportForm.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/permission/user/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/permission/user/ImportForm.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/permission/user/ResetPassword.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/permission/user/SocialsBind.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/permission/user/WorkHandoverForm.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/permission/user/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/permission/userOnline/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/permission/userRelation/Selector.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/redirect/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/area/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/area/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/billRule/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/billRule/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/cache/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/cache/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/commonWords/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/commonWords/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/icons/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/menu/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/menu/components/NameSelect.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/menu/components/buttonAuthorize/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/menu/components/buttonAuthorize/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/menu/components/columnAuthorize/BatchForm.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/menu/components/columnAuthorize/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/menu/components/columnAuthorize/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/menu/components/connectForm/DataTable.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/menu/components/connectForm/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/menu/components/dataAuthorize/DataAuthorizeForm.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/menu/components/dataAuthorize/DataSchemeForm.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/menu/components/dataAuthorize/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/menu/components/formAuthorize/BatchForm.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/menu/components/formAuthorize/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/menu/components/formAuthorize/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/menu/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/menu/menuForm.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/menu/menuManage.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/menu/portalManagement/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/menu/portalManagement/Transfer.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/menu/portalManagement/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/menu/portalManagement/permissionGroup.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/menu/portalManagement/portalDialog.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/monitor/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/notice/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/notice/View.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/notice/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/printDev/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/printDev/Preview.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/printDev/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/printDev/log.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/printDev/ts-print-templater/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/printDev/ts-print-templater/pageSize/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/printDev/ts-print-templater/ts-designer-tinymce/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/printDev/ts-print-templater/ts-designer-tinymce/plugins.js create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/printDev/ts-print-templater/ts-designer-tinymce/toolbar.js create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/sysConfig/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/task/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/task/Log.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/system/task/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/systemData/dataBackup/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/systemData/dataInterface/FieldForm.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/systemData/dataInterface/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/systemData/dataInterface/FormScript.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/systemData/dataInterface/Log.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/systemData/dataInterface/PageExplain.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/systemData/dataInterface/Preview.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/systemData/dataInterface/components/CommonTable.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/systemData/dataInterface/components/RightTable.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/systemData/dataInterface/components/variable/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/systemData/dataInterface/components/variable/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/systemData/dataInterface/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/systemData/dataModel/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/systemData/dataModel/Preview.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/systemData/dataModel/fields/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/systemData/dataModel/fields/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/systemData/dataModel/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/systemData/dataSource/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/systemData/dataSource/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/systemData/dataSync/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/systemData/dictionary/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/systemData/dictionary/components/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/systemData/dictionary/components/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/systemData/dictionary/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/systemData/interfaceOauth/Empower.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/systemData/interfaceOauth/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/systemData/interfaceOauth/Log.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/systemData/interfaceOauth/Preview.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/systemData/interfaceOauth/Transfer.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/systemData/interfaceOauth/VerifySignatureInfo.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/systemData/interfaceOauth/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/workFlow/components/ActionDialog.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/workFlow/components/ApproveDialog.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/workFlow/components/CandidateForm.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/workFlow/components/CandidateUserSelect.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/workFlow/components/Comment.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/workFlow/components/CommonWordsDialog.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/workFlow/components/ErrorForm.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/workFlow/components/EventLog.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/workFlow/components/FileUploader.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/workFlow/components/FlowBox.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/workFlow/components/FlowSelect.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/workFlow/components/FormBox.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/workFlow/components/HasFreeApprover.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/workFlow/components/RecordList.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/workFlow/components/RecordSummary.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/workFlow/components/SuspendDialog.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/workFlow/entrust/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/workFlow/entrust/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/workFlow/entrust/myEntrust.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/workFlow/flowCirculate/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/workFlow/flowDone/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/workFlow/flowEngine/FlowManagement.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/workFlow/flowEngine/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/workFlow/flowEngine/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/workFlow/flowLaunch/Flow.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/workFlow/flowLaunch/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/workFlow/flowMonitor/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/workFlow/flowQuickLaunch/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/workFlow/flowTodo/BatchList.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/workFlow/flowTodo/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/workFlow/formDesign/FieldForm.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/workFlow/formDesign/Form.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/workFlow/formDesign/Preview.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/workFlow/formDesign/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/workFlow/workFlowDetail/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/workFlow/workFlowForm/crmOrder/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/workFlow/workFlowForm/dynamicForm/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/workFlow/workFlowForm/leaveApply/index.vue create mode 100644 jnpf-java-boot/jnpf-web/src/views/workFlow/workFlowForm/mixin.js create mode 100644 jnpf-java-boot/jnpf-web/src/views/workFlow/workFlowForm/salesOrder/index.vue create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/100.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/101.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/102.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/103.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/104.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/105.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/106.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/107.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/108.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/109.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/110.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/111.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/112.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/113.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/114.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/115.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/116.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/117.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/118.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/119.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/120.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/121.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/122.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/123.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/124.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/125.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/126.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/127.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/128.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/129.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/130.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/131.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/132.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/133.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/134.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/135.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/136.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/137.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/138.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/139.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/140.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/141.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/142.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/143.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/144.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/145.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/146.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/147.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/148.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/149.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/150.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/151.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/152.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/153.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/154.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/155.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/156.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/157.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/158.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/159.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/160.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/161.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/162.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/163.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/164.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/165.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/166.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/167.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/168.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/169.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/170.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/171.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/172.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/173.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/174.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/175.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/176.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/177.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/178.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/179.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/180.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/181.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/182.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/183.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/184.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/185.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/186.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/187.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/188.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/189.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/190.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/191.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/192.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/193.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/194.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/195.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/196.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/197.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/198.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/199.gif create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/200.png create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/201.png create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/202.png create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/203.png create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/204.png create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/205.png create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/206.png create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/207.png create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/208.png create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/209.png create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/210.png create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/211.png create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/212.png create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/213.png create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/214.png create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/215.png create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/216.png create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/217.png create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/218.png create mode 100644 jnpf-java-boot/jnpf-web/static/emoji/219.png create mode 100644 jnpf-java-boot/jnpf-web/vue.config.js create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/pom.xml create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/mapper/FlowCandidatesMapper.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/mapper/FlowCommentMapper.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/mapper/FlowDelegateMapper.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/mapper/FlowEngineVisibleMapper.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/mapper/FlowEventLogMapper.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/mapper/FlowOperatorUserMapper.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/mapper/FlowRejectDataMapper.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/mapper/FlowTaskCirculateMapper.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/mapper/FlowTaskMapper.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/mapper/FlowTaskNodeMapper.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/mapper/FlowTaskOperatorMapper.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/mapper/FlowTaskOperatorRecordMapper.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/mapper/FlowTemplateJsonMapper.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/mapper/FlowTemplateMapper.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/mapper/FlowUserMapper.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/service/FlowCandidatesService.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/service/FlowCommentService.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/service/FlowDelegateService.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/service/FlowDynamicService.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/service/FlowEngineVisibleService.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/service/FlowEventLogService.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/service/FlowOperatorUserService.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/service/FlowRejectDataService.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/service/FlowTaskCirculateService.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/service/FlowTaskNewService.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/service/FlowTaskNodeService.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/service/FlowTaskOperatorRecordService.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/service/FlowTaskOperatorService.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/service/FlowTemplateJsonService.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/service/FlowTemplateService.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/service/FlowUserService.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/service/impl/FlowCandidatesServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/service/impl/FlowCommentServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/service/impl/FlowDelegateServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/service/impl/FlowDynamicServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/service/impl/FlowEngineVisibleServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/service/impl/FlowEventLogServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/service/impl/FlowOperatorUserServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/service/impl/FlowRejectDataDataServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/service/impl/FlowTaskCirculateServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/service/impl/FlowTaskNewServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/service/impl/FlowTaskNodeServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/service/impl/FlowTaskOperatorRecordServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/service/impl/FlowTaskOperatorServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/service/impl/FlowTaskServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/service/impl/FlowTemplateJsonServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/service/impl/FlowTemplateServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/service/impl/FlowUserServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/util/FlowMsgUtil.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/util/FlowTaskUtil.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/engine/util/FlowTimerUtil.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/job/JobConfig.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/job/TimeoutSettingJob.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/job/WorkJobNew.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/job/WorkJobUtil.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/job/WorkTimeoutJobUtil.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-biz/src/main/java/jnpf/util/ServiceAllUtil.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-controller/pom.xml create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-controller/src/main/java/jnpf/engine/controller/FlowBeforeController.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-controller/src/main/java/jnpf/engine/controller/FlowCommentController.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-controller/src/main/java/jnpf/engine/controller/FlowDelegateController.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-controller/src/main/java/jnpf/engine/controller/FlowLaunchController.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-controller/src/main/java/jnpf/engine/controller/FlowMonitorController.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-controller/src/main/java/jnpf/engine/controller/FlowTaskController.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-controller/src/main/java/jnpf/engine/controller/FlowTemplateController.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/pom.xml create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/entity/FlowCandidatesEntity.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/entity/FlowCommentEntity.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/entity/FlowDelegateEntity.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/entity/FlowEngineVisibleEntity.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/entity/FlowEventLogEntity.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/entity/FlowOperatorUserEntity.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/entity/FlowRejectDataEntity.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/entity/FlowTaskCirculateEntity.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/entity/FlowTaskEntity.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/entity/FlowTaskNodeEntity.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/entity/FlowTaskOperatorEntity.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/entity/FlowTaskOperatorRecordEntity.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/entity/FlowTemplateEntity.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/entity/FlowTemplateJsonEntity.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/entity/FlowUserEntity.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/enums/FlowAgreeRuleEnum.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/enums/FlowErrorRuleEnum.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/enums/FlowExtraRuleEnum.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/enums/FlowHandleEventEnum.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/enums/FlowMessageEnum.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/enums/FlowModuleEnum.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/enums/FlowNodeEnum.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/enums/FlowRecordEnum.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/enums/FlowRecordListEnum.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/enums/FlowStatusEnum.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/enums/FlowTaskOperatorEnum.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/enums/FlowTaskStatusEnum.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/FlowHandleModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowbefore/FlowBatchModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowbefore/FlowBeforeInfoVO.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowbefore/FlowBeforeListVO.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowbefore/FlowSummary.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowbefore/FlowTaskModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowbefore/FlowTaskNodeModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowbefore/FlowTaskOperatorModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowbefore/FlowTaskOperatorRecordModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowbefore/FlowTemplateAllModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowbefore/FlowTemplateModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowcandidate/FlowCandidateListModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowcandidate/FlowCandidateUserModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowcandidate/FlowCandidateVO.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowcandidate/FlowRejectVO.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowcomment/FlowCommentForm.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowcomment/FlowCommentInfoVO.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowcomment/FlowCommentListVO.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowcomment/FlowCommentPagination.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowdelegate/FlowDdelegateSelectModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowdelegate/FlowDelegatListVO.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowdelegate/FlowDelegateCrForm.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowdelegate/FlowDelegateInfoVO.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowdelegate/FlowDelegateModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowdelegate/FlowDelegatePagination.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowdelegate/FlowDelegateStartPagination.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowdelegate/FlowDelegateUpForm.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowengine/FlowAppPageModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowengine/FlowDataModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowengine/FlowModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowengine/FlowOperator.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowengine/FlowOperatordModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowengine/FlowPagination.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowengine/FlowTaskNodeRejectModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowengine/FlowTaskOperatorRejectModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowengine/FlowTaskRejectModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowengine/FlowUpdateNode.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowengine/PaginationFlowEngine.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowengine/shuntjson/childnode/ChildNode.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowengine/shuntjson/childnode/FlowAssignModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowengine/shuntjson/childnode/FuncConfig.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowengine/shuntjson/childnode/GroupsModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowengine/shuntjson/childnode/LimitModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowengine/shuntjson/childnode/MsgConfig.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowengine/shuntjson/childnode/ProperCond.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowengine/shuntjson/childnode/Properties.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowengine/shuntjson/childnode/RuleListModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowengine/shuntjson/childnode/SendConfigTemplateJsonModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowengine/shuntjson/childnode/TemplateJsonModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowengine/shuntjson/childnode/TimeModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowengine/shuntjson/childnode/TimeOutConfig.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowengine/shuntjson/nodejson/ChildNodeList.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowengine/shuntjson/nodejson/ConditionList.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowengine/shuntjson/nodejson/Custom.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowengine/shuntjson/nodejson/DateProperties.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowlaunch/FlowLaunchListVO.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowmessage/FlowEventModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowmessage/FlowMessageModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowmessage/FlowMsgModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowmessage/FlowParameterModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowmonitor/FlowEventLogListVO.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowmonitor/FlowMonitorListVO.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowtask/FlowAgreeRuleModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowtask/FlowApproveModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowtask/FlowAssistModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowtask/FlowConditionModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowtask/FlowContModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowtask/FlowCountersignModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowtask/FlowErrorModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowtask/FlowNodeListModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowtask/FlowRevokeModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowtask/FlowTaskListModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowtask/PaginationFlowTask.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowtask/TaskNodeModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowtask/WorkJobModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowtask/WorkTimeoutJobModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowtask/method/TaskChild.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowtask/method/TaskHandleIdStatus.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowtask/method/TaskOperatoUser.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowtask/method/TaskOperator.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowtemplate/FlowExportModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowtemplate/FlowPageListVO.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowtemplate/FlowSelectVO.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowtemplate/FlowTemplatUprForm.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowtemplate/FlowTemplateCrForm.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowtemplate/FlowTemplateInfoVO.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowtemplate/FlowTemplateListVO.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowtemplate/FlowTemplateVO.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowtemplatejson/FlowJsonModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowtemplatejson/FlowTemplateJsonListVO.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowtemplatejson/FlowTemplateJsonPage.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/model/flowtime/FlowTimeModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/util/FlowCondition.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/util/FlowContextHolder.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/util/FlowJsonUtil.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/jnpf-workflow-engine-entity/src/main/java/jnpf/engine/util/FlowNature.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-engine/pom.xml create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-form/jnpf-workflow-form-biz/pom.xml create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-form/jnpf-workflow-form-biz/src/main/java/jnpf/form/mapper/LeaveApplyMapper.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-form/jnpf-workflow-form-biz/src/main/java/jnpf/form/mapper/SalesOrderEntryMapper.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-form/jnpf-workflow-form-biz/src/main/java/jnpf/form/mapper/SalesOrderMapper.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-form/jnpf-workflow-form-biz/src/main/java/jnpf/form/service/LeaveApplyService.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-form/jnpf-workflow-form-biz/src/main/java/jnpf/form/service/SalesOrderEntryService.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-form/jnpf-workflow-form-biz/src/main/java/jnpf/form/service/SalesOrderService.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-form/jnpf-workflow-form-biz/src/main/java/jnpf/form/service/impl/LeaveApplyServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-form/jnpf-workflow-form-biz/src/main/java/jnpf/form/service/impl/SalesOrderEntryServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-form/jnpf-workflow-form-biz/src/main/java/jnpf/form/service/impl/SalesOrderServiceImpl.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-form/jnpf-workflow-form-controller/pom.xml create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-form/jnpf-workflow-form-controller/src/main/java/jnpf/form/controller/LeaveApplyController.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-form/jnpf-workflow-form-controller/src/main/java/jnpf/form/controller/SalesOrderController.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-form/jnpf-workflow-form-entity/pom.xml create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-form/jnpf-workflow-form-entity/src/main/java/jnpf/form/entity/LeaveApplyEntity.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-form/jnpf-workflow-form-entity/src/main/java/jnpf/form/entity/SalesOrderEntity.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-form/jnpf-workflow-form-entity/src/main/java/jnpf/form/entity/SalesOrderEntryEntity.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-form/jnpf-workflow-form-entity/src/main/java/jnpf/form/model/leaveapply/LeaveApplyForm.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-form/jnpf-workflow-form-entity/src/main/java/jnpf/form/model/leaveapply/LeaveApplyInfoVO.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-form/jnpf-workflow-form-entity/src/main/java/jnpf/form/model/salesorder/SalesOrderEntryEntityInfoModel.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-form/jnpf-workflow-form-entity/src/main/java/jnpf/form/model/salesorder/SalesOrderForm.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-form/jnpf-workflow-form-entity/src/main/java/jnpf/form/model/salesorder/SalesOrderInfoVO.java create mode 100644 jnpf-java-boot/jnpf-workflow/jnpf-workflow-form/pom.xml create mode 100644 jnpf-java-boot/jnpf-workflow/pom.xml create mode 100644 jnpf-java-boot/pom.xml create mode 100644 jnpf-java-boot/security/java.security diff --git a/jnpf-java-boot/.gitignore b/jnpf-java-boot/.gitignore new file mode 100644 index 0000000..4b83fbd --- /dev/null +++ b/jnpf-java-boot/.gitignore @@ -0,0 +1,76 @@ +# For Java +*.lck +target/ +*.json +log/ +logback-test.xml + + +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# Image snapshot diff +__diff_output__/ +/jest-stare + +*.iml +.idea/ +.ipr +.iws +*~ +~* +*.diff +*.patch +*.bak +.DS_Store +Thumbs.db +.project +.*proj +.svn/ +*.swp +*.swo +*.log +*.log.* +*.json.gzip +node_modules/ +.buildpath +.settings +dist +npm-debug.log +nohup.out +_site +_data +report.html +/lib +/es +elasticsearch-* +config/base.yaml +/.vscode/ +/coverage +/.history +*.tmp +!**/nacos/target +**/nacos/data/* +**/nacos/logs/* +**/seata/bin/* diff --git a/jnpf-java-boot/Dockerfile b/jnpf-java-boot/Dockerfile new file mode 100644 index 0000000..35f7bea --- /dev/null +++ b/jnpf-java-boot/Dockerfile @@ -0,0 +1,22 @@ +# 基础镜像 +FROM eclipse-temurin:8u362-b09-jre +LABEL maintainer=jnpf-team + +# 设置时区 +RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ + && echo 'Asia/Shanghai' >/etc/timezone + +# 解决连接SQLServer安全错误 +COPY security/java.security /opt/java/openjdk/lib/security + +# 指定运行时的工作目录 +WORKDIR /jnpfsoft/jnpf-server/jnpf-java-boot + +# 将构建产物jar包拷贝到运行时目录中 +COPY jnpf-admin/target/*.jar ./jnpf-admin.jar + +# 指定容器内运行端口 +EXPOSE 30000 + +# 指定容器启动时要运行的命令 +ENTRYPOINT ["/bin/sh","-c","java -Dfile.encoding=utf8 -Djava.security.egd=file:/dev/./urandom -jar jnpf-admin.jar"] diff --git a/jnpf-java-boot/README.md b/jnpf-java-boot/README.md new file mode 100644 index 0000000..95a3a33 --- /dev/null +++ b/jnpf-java-boot/README.md @@ -0,0 +1,369 @@ +> 特别说明:源码、JDK、MySQL、Redis等安装或存放路径禁止包含中文、空格、特殊字符等 + +## 一 技术栈 + +- 主框架:`Spring Boot` + `Spring Framework` +- 持久层框架:`MyBatis-Plus` +- 数据库连接池:`Alibaba Druid` +- 多数据源:`Dynamic-Datasource` +- 数据库兼容: `MySQL`(默认)、`SQLServer`、`Oracle`、`PostgreSQL`、`达数据库`、`人大金仓数据库` +- 分库分表解决方案:`Apache ShardingSphere` +- 权限认证框架:`Sa-Token`+`JWT` +- 代码生成器:`MyBatis-Plus-Generator` +- 模板引擎:`Velocity` +- 任务调度:`XXL-JOB` +- 分布式锁:`Lock4j` +- JSON序列化: `Jackson`&`Fastjson` +- 缓存数据库:`Redis` +- 校验框架:`Validation` +- 分布式文件存储:兼容`MinIO`及多个云对象存储,如阿里云 OSS、华为云 OBS、七牛云 Kodo、腾讯云 COS等 +- 工具类框架:`Hutool`、`Lombok` +- 接口文档:`Knife4j` +- 项目构建:`Maven` + +## 二 环境要求 + +### 2.1 开发环境 + +| 类目 | 版本说明或建议 | +| --- |---------------------------------------------------------------------------------------------------------------------------------------------------------------| +| 电脑配置 | 建议开发电脑I3及以上CPU,内存16G及以上 | +| 操作系统 | Windows 10/11,MacOS | +| JDK | 建议使用`1.8.0_281`及以上版本,可使用`Eclipse Temurin JDK 8`、`Alibaba Dragonwell 8`、`BiSheng JDK 8`等 | +| Maven | `3.6.3`及以上版本 | +| 数据缓存 | Redis `3.2.100`(Windows)/`4.0.x`+ (Linux,Mac)  或  TongRDS `2.2.x` | +| 数据库 | 兼容`MySQL 5.7.x/8.0.x`(默认)、`SQLServer 2012+`、`Oracle 11g`、`PostgreSQL 12+`、`达梦数据库(DM8)`、`人大金仓数据库(KingbaseES_V8R6)` | +| 后端开发 | `IDEA2020`及以上版本、`Eclipse` 、 `Spring Tool Suite`等 | +| 前端开发 | `Node.js` v16.15.0(某些情况下可能需要安装 `Python3`)及以上版本;
`Yarn` v1.22.x 版本;
`pnpm` v8.10及以上版本;
浏览器推荐使用`Chrome` 90及以上版本;
`Visual Studio Code`(简称VSCode) | +| 移动端开发 | `Node.js` v12/v14/v16(某些情况下可能需要安装 Python3);
HBuilder X(最新版) | +| 文件存储 | 默认使用本地存储,兼容 `MinIO` 及多个云对象存储,如`阿里云 OSS`、`华为云 OBS`、`七牛云 Kodo`、`腾讯云 COS`等 | + +### 2.2 运行环境 + +> 适用于测试或生产环境 + +| 类目 | 版本说明或建议 | +| --- |-------------------------------------------------------------------------------------------------------------------| +| 服务器配置 | 最低配置要求:4c/16G/50G; | +| 操作系统 | 推荐使用`Ubuntu 18.0.4`及以上版本,兼容 `统信UOS`,`OpenEuler`,`麒麟服务器版`等国产信创环境; | +| JRE | 建议使用`1.8.0_281`及以上版本,如`Eclipse Temurin JRE 8/11/17`、`Alibaba Dragonwell 8/11/17`、`BiSheng JRE 8/11/17`; | +| 数据缓存 | Redis `4.0.x+` 或 TongRDS `2.2.x` | +| 数据库 | 兼容`MySQL 5.7.x/8.0.x`(默认)、`SQLServer 2012+`、`Oracle 11g`、`PostgreSQL 12+`、`达梦数据库(DM8)`、`人大金仓数据库(KingbaseES_V8R6)` | +| 中间件(可选) | 东方通 `Tong-web`、金蝶天燕-应用服务器`AAS` v10; | +| 文件存储 | 默认使用本地存储,兼容`MinIO`及多个云对象存储,如阿里云 OSS、华为云 OBS、七牛云 Kodo、腾讯云 COS等 | +| 前端服务器 | Nginx 建议使用`1.18.0`及以上版本  或 TongHttpServer `6.0` | + +## 三 IDEA插件 + +- `Lombok`(必须) +- `Alibaba Java Coding Guidelines` +- `MybatisX` + +## 四 Maven私服配置 + +> Apache Maven 3.6.3及以上版本
解决以下依赖无法从公共Maven仓库下载的问题 + +- com.dm:DmJdbcDriver18:1.8.0 +- com.kingbase8:kingbase8-jdbc:2.0 +- dingtalk-sdk-java:taobao-sdk-java-source:1.0 +- dingtalk-sdk-java:taobao-sdk-java:1.0 + +打开Maven安装目录中的 `conf/settings.xml` 文件,
+在 `` 中添加如下内容 + +```xml + + maven-releases + jnpf-user + HLrQ0MA%S1nE + +``` +在 `` 中添加 + +```xml + + maven-releases + * + maven-releases + https://repository.jnpfsoft.com/repository/maven-public/ + +``` + +## 五 配套项目 + +| 项目 | 分支 | 分支(Coding) | 说明 | +| --- | --- | --- | --- | +| **后端** | | | | +| jnpf-common | v3.5.x | v3.5.0-stable | java基础依赖项目源码 | +| jnpf-file-core-starter | v3.5.x | v3.4.3-stable | 文件基础依赖项目源码 | +| jnpf-scheduletask | v3.5.x | v3.5.0-stable | 任务调度客户端依赖及服务端项目源码 | +| jnpf-datareport | v3.5.x | v3.4.7-stable | 报表后端项目源码 | +| jnpf-file-preview | v3.4.3 | v3.0.0-stable | 本地文档预览项目源码 | +| **前端** | | | | +| jnpf-web | v3.5.x | v3.5.0-stable | 前端主项目(Vue2)源码 | +| jnpf-web-vue3 | v3.5.x | v3.5.0-stable | 前端主项目(Vue3)源码 | +| jnpf-web-datascreen | v3.5.x | v3.5.0-stable | 大屏前端项目(Vue2)源码 | +| jnpf-web-datascreen-vue3 | v3.5.x | v3.5.0-stable | 大屏前端项目(Vue3)源码 | +| jnpf-web-datareport | v3.4.7 | v3.4.7-stable | 报表前端项目源码 | +| **移动端** | | | | +| jnpf-app | v3.5.x | v3.5.0-stable | 移动端项目(Vue2)源码 | +| **静态资源** | | | | +| jnpf-resources | v3.5.x | v3.5.0-stable | 静态资源 | +| **数据库** | | | | +| jnpf-database | v3.5.x | v3.5.0-stable | 数据库脚本或文件 | + +## 六 开发环境 + +### 6.1 导入数据库脚本 + +> 以 MySQL数据库为例
字符集:utf8mb4
排序规则:utf8mb4_general_ci + +#### 6.1.1 创建平台数据库 + +在MySQL创建 `jnpf_init` 数据库,并将 `jnpf-database/MySQL/jnpf_init.sql` 以【新建查询】方式导入 + +#### 6.1.2 创建系统调度数据库 + +在MySQL创建 `jnpf_xxjob` 数据库,并将 `jnpf-database/MySQL/jnpf_xxjob_init.sql` 以【新建查询】方式导入 + +### 6.2 导入依赖 + +#### 6.2.1 基础依赖 + +详见 `jnpf-common` 项目中的 `README.md` 文档说明 + +#### 6.2.2 文件基础依赖 + +详见 `jnpf-file-starter` 项目中的 `README.md` 文档说明 + +#### 6.2.3 导入系统调度服务端 + +详见 `jnpf-scheduletask` 项目中的 `README.md` 文档说明 + +### 6.3 项目配置 + +打开编辑 `jnpf-admin/src/main/resources/application.yml` + +#### 6.3.1 指定环境配置 + +- `application-dev.yml`  开发环境(默认) +- `application-test.yml`  测试环境 +- `application-preview.yml` 预发布环境 +- `application-pro.yml` 生产环境 + +```yaml +# application.yml第5行,可选值:dev(默认)|test|pro|preview +active: dev +``` +#### 6.3.2 配置域名 +打开编辑 `jnpf-admin/src/main/resources/application.yml` ,修改以下配置 + +```yaml + PreviewType: kkfile #文件预览方式 (1.yozo 2.kkfile)默认使用kkfile + kkFileUrl: http://127.0.0.1:30090/FileServer/ #kkfile文件预览服务地址 + ApiDomain: http://127.0.0.1:30000 #后端域名(文档预览中使用) + FrontDomain: http://127.0.0.1:3000 #前端域名(文档预览中使用) + AppDomain: http://127.0.0.1:8080 #app/h5端域名配置(文档预览中使用) +``` + +#### 6.3.3 数据源配置 + +打开编辑 `jnpf-admin/src/main/resources/application-dev.yml`,修改以下配置 +> 具体配置说明参考:[https://jnpfsoft.coding.net/p/jnpf-docs/wiki/2165](https://jnpfsoft.coding.net/p/jnpf-docs/wiki/2165) + +```yaml + datasource: + db-type: MySQL #数据库类型(可选值 MySQL、SQLServer、Oracle、DM8、KingbaseES、PostgreSQL,请严格按可选值填写) + host: 192.168.0.213 + port: 3306 + username: root + password: a26d27e6a6cd4538 + db-name: java_boot_test + db-schema: #金仓达梦选填 + prepare-url: #自定义url +``` +#### 6.3.4 Redis配置 + +打开编辑 `jnpf-admin/src/main/resources/application-dev.yml`,修改以下配置 +> 支持单机模式和集群模式,配置默认为单机模式 + +**Redis单机模式** + +```yaml + redis: + database: 200 #缓存库编号 + host: 192.168.0.213 + port: 6379 + password: ucfbVgZgyB0dBQdh # 密码为空时,请将本行注释 + timeout: 3000 #超时时间(单位:秒) + lettuce: #Lettuce为Redis的Java驱动包 + pool: + max-active: 8 # 连接池最大连接数 + max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制) + min-idle: 0 # 连接池中的最小空闲连接 + max-idle: 8 # 连接池中的最大空闲连接 +``` + +**Redis集群模式** + +```yaml + redis: + cluster: + nodes: + - 192.168.0.225:6380 + - 192.168.0.225:6381 + - 192.168.0.225:6382 + - 192.168.0.225:6383 + - 192.168.0.225:6384 + - 192.168.0.225:6385 + password: 123456 # 密码为空时,请将本行注释 + timeout: 3000 # 超时时间(单位:秒) + lettuce: #Lettuce为Redis的Java驱动包 + pool: + max-active: 8 # 连接池最大连接数 + max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制) + min-idle: 0 # 连接池中的最小空闲连接 + max-idle: 8 # 连接池中的最大空闲连接 +``` +#### 6.3.5 静态资源配置 + +打开编辑 `jnpf-admin/src/main/resources/application-dev.yml` ,修改以下配置 +> 默认使用本地存储,兼容`MinIO`及多个云对象存储,如阿里云 OSS、华为云 OBS、七牛云 Kodo、腾讯云 COS等 + +```yaml + # ===================== 文件存储配置 ===================== + file-storage: #文件存储配置,不使用的情况下可以不写 + default-platform: local-plus-1 #默认使用的存储平台 + thumbnail-suffix: ".min.jpg" #缩略图后缀,例如【.min.jpg】【.png】 + local-plus: # 本地存储升级版 + - platform: local-plus-1 # 存储平台标识 + enable-storage: true #启用存储 + enable-access: true #启用访问(线上请使用 Nginx 配置,效率更高) + domain: "" # 访问域名,例如:“http://127.0.0.1:8030/”,注意后面要和 path-patterns 保持一致,“/”结尾,本地存储建议使用相对路径,方便后期更换域名 + base-path: D:/project/jnpf-resources/ # 基础路径 + path-patterns: /** # 访问路径 + storage-path: # 存储路径 + aliyun-oss: # 阿里云 OSS ,不使用的情况下可以不写 + - platform: aliyun-oss-1 # 存储平台标识 + enable-storage: false # 启用存储 + access-key: ?? + secret-key: ?? + end-point: ?? + bucket-name: ?? + domain: ?? # 访问域名,注意“/”结尾,例如:https://abc.oss-cn-shanghai.aliyuncs.com/ + base-path: hy/ # 基础路径 + qiniu-kodo: # 七牛云 kodo ,不使用的情况下可以不写 + - platform: qiniu-kodo-1 # 存储平台标识 + enable-storage: false # 启用存储 + access-key: ?? + secret-key: ?? + bucket-name: ?? + domain: ?? # 访问域名,注意“/”结尾,例如:http://abc.hn-bkt.clouddn.com/ + base-path: base/ # 基础路径 + tencent-cos: # 腾讯云 COS + - platform: tencent-cos-1 # 存储平台标识 + enable-storage: false # 启用存储 + secret-id: ?? + secret-key: ?? + region: ?? #存仓库所在地域 + bucket-name: ?? + domain: ?? # 访问域名,注意“/”结尾,例如:https://abc.cos.ap-nanjing.myqcloud.com/ + base-path: hy/ # 基础路径 + minio: # MinIO,由于 MinIO SDK 支持 AWS S3,其它兼容 AWS S3 协议的存储平台也都可配置在这里 + - platform: minio-1 # 存储平台标识 + enable-storage: true # 启用存储 + access-key: Q9jJs2b6Tv + secret-key: Thj2WkpLu9DhmJyJ + end-point: http://192.168.0.207:9000/ + bucket-name: jnpfsoftoss + domain: # 访问域名,注意“/”结尾,例如:http://minio.abc.com/abc/ + base-path: # 基础路径 +``` +#### 6.3.6 第三方登录配置 + +打开编辑 `jnpf-admin/src/main/resources/application-dev.yml` ,修改以下配置 +> 配置默认关闭 + +```yaml +socials: + # 第三方登录功能开关(false-关闭,true-开启) + socials-enabled: false + config: + - # 微信 + provider: wechat_open + client-id: your-client-id + client-secret: your-client-secret + - # qq + provider: qq + client-id: your-client-id + client-secret: your-client-secret + - # 企业微信 + provider: wechat_enterprise + client-id: your-client-id + client-secret: your-client-secret + agentId: your-agentId + - # 钉钉 + provider: dingtalk + client-id: your-client-id + client-secret: your-client-secret + agentId: your-agentId + - # 飞书 + provider: feishu + client-id: your-client-id + client-secret: your-client-secret + - # 小程序 + provider: wechat_applets + client-id: your-client-id + client-secret: your-client-secret +``` +#### 6.3.7 任务调度配置 + +打开编辑 `jnpf-admin/src/main/resources/application-dev.yml` ,修改以下配置,调整 xxl.job.admin.addresses 地址 + +```yaml +xxl: + job: + accessToken: '' + i18n: zh_CN + logretentiondays: 30 + triggerpool: + fast: + max: 200 + slow: + max: 100 + # xxl-job服务端地址 + admin: + addresses: http://127.0.0.1:30020/xxl-job-admin/ + executor: + address: '' + appname: xxl-job-executor-sample1 + ip: '' + logpath: /data/applogs/xxl-job/jobhandler + logretentiondays: 30 + port: 9999 + # rest调用xxl-job接口地址 + admin: + register: + handle-query-address: ${xxl.job.admin.addresses}api/handler/queryList + job-info-address: ${xxl.job.admin.addresses}api/jobinfo + log-query-address: ${xxl.job.admin.addresses}api/log + task-list-address: ${xxl.job.admin.addresses}api/ScheduleTask/List + task-info-address: ${xxl.job.admin.addresses}api/ScheduleTask/getInfo + task-save-address: ${xxl.job.admin.addresses}api/ScheduleTask + task-update-address: ${xxl.job.admin.addresses}api/ScheduleTask + task-remove-address: ${xxl.job.admin.addresses}api/ScheduleTask/remove + task-start-or-remove-address: ${xxl.job.admin.addresses}api/ScheduleTask/updateTask +``` +## 七 启动项目 + +找到`jnpf-admin/src/main/java/JnpfAdminApplication.java`,右击运行即可。 + +## 八 项目发布 + +- 在IDEA中,双击右侧Maven中 `jnpf-java-boot` > `Lifecycle` > `clean` 清理项目 +- 在IDEA中,双击右侧Maven中 `jnpf-java-boot` > `Lifecycle` > `package` 打包项目 +- 打开 `jnpf-java-boot\jnpf-admin\target`,将 `jnpf-admin-3.5.0-RELEASE.jar` 上传至服务器 + +## 九 接口文档 + +- `http://localhost:30000/doc.html` diff --git a/jnpf-java-boot/jnpf-admin/pom.xml b/jnpf-java-boot/jnpf-admin/pom.xml new file mode 100644 index 0000000..700fe0a --- /dev/null +++ b/jnpf-java-boot/jnpf-admin/pom.xml @@ -0,0 +1,170 @@ + + + + jnpf-java-boot + com.jnpf + 3.5.0-RELEASE + + + 4.0.0 + jnpf-admin + jar + + + + + + org.projectlombok + lombok + + + com.jnpf + jnpf-file-controller + ${project.version} + + + + com.jnpf + jnpf-extend-controller + ${project.version} + + + com.jnpf + jnpf-form-controller + ${project.version} + + + com.jnpf + jnpf-system-controller + ${project.version} + + + com.jnpf + jnpf-scheduletask-controller + ${project.version} + + + com.jnpf + jnpf-message-controller + ${project.version} + + + com.jnpf + jnpf-permission-controller + ${project.version} + + + com.jnpf + jnpf-visualdev-base-controller + ${project.version} + + + com.jnpf + jnpf-visualdev-onlinedev-controller + ${project.version} + + + com.jnpf + jnpf-visualdev-generater-controller + ${project.version} + + + com.jnpf + jnpf-visualdev-portal-controller + ${project.version} + + + com.jnpf + jnpf-visualdata-controller + ${project.version} + + + com.jnpf + jnpf-exception + ${project.version} + + + com.jnpf + jnpf-workflow-engine-controller + ${project.version} + + + com.jnpf + jnpf-workflow-form-controller + ${project.version} + + + com.jnpf + jnpf-oauth-controller + ${project.version} + + + com.jnpf + jnpf-example-controller + ${project.version} + + + com.jnpf + jnpf-app-controller + ${project.version} + + + com.jnpf + jnpf-visualdev-integrate-controller + ${project.version} + + + + + + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + jnpf.JnpfAdminApplication + ZIP + + + + + repackage + + + + + + + + + + diff --git a/jnpf-java-boot/jnpf-admin/src/main/java/jnpf/JnpfAdminApplication.java b/jnpf-java-boot/jnpf-admin/src/main/java/jnpf/JnpfAdminApplication.java new file mode 100644 index 0000000..6c84b8d --- /dev/null +++ b/jnpf-java-boot/jnpf-admin/src/main/java/jnpf/JnpfAdminApplication.java @@ -0,0 +1,29 @@ +package jnpf; + +import cn.xuyanwu.spring.file.storage.EnableFileStorage; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; + + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/15 17:12 + */ +@SpringBootApplication(scanBasePackages = {"jnpf"},exclude={DataSourceAutoConfiguration.class}) +@EnableFileStorage +public class JnpfAdminApplication extends SpringBootServletInitializer { + + public static void main(String[] args) { + SpringApplication springApplication = new SpringApplication(JnpfAdminApplication.class); + //添加监听器 +// springApplication.addListeners(new JnpfListener()); + springApplication.run(args); + System.out.println("JnpfAdmin启动完成"); + } + +} diff --git a/jnpf-java-boot/jnpf-admin/src/main/java/jnpf/aop/DataSourceBindAspect.java b/jnpf-java-boot/jnpf-admin/src/main/java/jnpf/aop/DataSourceBindAspect.java new file mode 100644 index 0000000..201517e --- /dev/null +++ b/jnpf-java-boot/jnpf-admin/src/main/java/jnpf/aop/DataSourceBindAspect.java @@ -0,0 +1,86 @@ +package jnpf.aop; + +import cn.dev33.satoken.context.SaHolder; +import jnpf.base.UserInfo; +import jnpf.config.ConfigValueUtil; +import jnpf.database.util.NotTenantPluginHolder; +import jnpf.util.data.DataSourceContextHolder; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import lombok.extern.slf4j.Slf4j; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/15 17:12 + */ +@Slf4j +@Aspect +@Component +@Order(1) +public class DataSourceBindAspect { + + @Autowired + private ConfigValueUtil configValueUtil; + + @Pointcut("((execution(* jnpf.*.controller.*.*(..)) || execution(* jnpf.controller.*.*(..))) " + + "&& !execution(* jnpf.controller.LoginController.login(..)))" + + "|| execution(* jnpf.message.websocket.WebSocket.*(..))") + public void bindDataSource() { + + } + + /** + * NoDataSourceBind 不需要绑定数据库的注解 + * + * @param pjp + * @return + * @throws Throwable + */ + @Around("bindDataSource() && !@annotation(jnpf.util.NoDataSourceBind)") + public Object doAroundService(ProceedingJoinPoint pjp) throws Throwable { + if (configValueUtil.isMultiTenancy()) { + if(StringUtil.isEmpty(DataSourceContextHolder.getDatasourceId()) || StringUtil.isEmpty(DataSourceContextHolder.getDatasourceName())){ + UserInfo userInfo = UserProvider.getUser(); + String url = null; + try{ + url = SaHolder.getRequest().getRequestPath(); + }catch (Exception ee){ } + log.error("租户" + userInfo.getTenantId() + "数据库不存在, URL: {}, TOKEN: {}", url, userInfo.getToken()); + return null; + } + return pjp.proceed(); + } + Object obj = pjp.proceed(); + return obj; + } + + + /** + * NoDataSourceBind 不需要绑定数据库的注解 加入不切租户库标记 + * + * @param pjp + * @return + * @throws Throwable + */ + @Around("bindDataSource() && @annotation(jnpf.util.NoDataSourceBind)") + public Object doAroundService2(ProceedingJoinPoint pjp) throws Throwable { + try{ + NotTenantPluginHolder.setNotSwitchAlwaysFlag(); + //Filter中提前设置租户信息, 不需要切库的方法进行清除切库 + DataSourceContextHolder.clearDatasourceType(); + return pjp.proceed(); + }finally { + NotTenantPluginHolder.clearNotSwitchAlwaysFlag(); + } + } +} diff --git a/jnpf-java-boot/jnpf-admin/src/main/java/jnpf/aop/PermissionAdminAspect.java b/jnpf-java-boot/jnpf-admin/src/main/java/jnpf/aop/PermissionAdminAspect.java new file mode 100644 index 0000000..adf22d1 --- /dev/null +++ b/jnpf-java-boot/jnpf-admin/src/main/java/jnpf/aop/PermissionAdminAspect.java @@ -0,0 +1,111 @@ +package jnpf.aop; + +import jnpf.annotation.OrganizeAdminIsTrator; +import jnpf.base.ActionResult; +import jnpf.base.UserInfo; +import jnpf.constant.MsgCode; +import jnpf.constant.PermissionConstant; +import jnpf.permission.entity.OrganizeRelationEntity; +import jnpf.permission.model.authorize.SaveBatchForm; +import jnpf.permission.service.OrganizeRelationService; +import jnpf.util.PermissionAspectUtil; +import jnpf.util.UserProvider; +import lombok.extern.slf4j.Slf4j; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/15 17:12 + */ +@Slf4j +@Aspect +@Component +public class PermissionAdminAspect implements PermissionAdminBase{ + + @Autowired + private UserProvider userProvider; + @Autowired + private OrganizeRelationService organizeRelationService; + + /** + * 分级管理切点 + */ + @Pointcut("@annotation(jnpf.annotation.OrganizeAdminIsTrator)") + public void pointcut() { + } + + /** + * 分级管理切点 + * + * @param pjp + * @return + * @throws Throwable + */ + @Around("pointcut()") + public Object around(ProceedingJoinPoint pjp) throws Throwable { + return PermissionAdminBase.permissionCommon(pjp, userProvider, this); + } + + @Override + public Boolean detailPermission(ProceedingJoinPoint pjp, String operatorUserId, String methodName){ + switch (methodName) { + case PermissionConstant.METHOD_SAVE: + if(userProvider.get().getIsAdministrator()){ + return true; + } + String roleId = (String) pjp.getArgs()[0]; + List orgIdList = organizeRelationService.getRelationListByRoleId(roleId).stream().map(OrganizeRelationEntity::getOrganizeId).collect(Collectors.toList()); + StringBuilder orgId = new StringBuilder(); + orgIdList.stream().forEach(t->{ + orgId.append(t + ","); + }); + return PermissionAspectUtil.getPermitByOrgId( + // 操作目标对象组织ID集合 + orgId.toString(), + operatorUserId, + PermissionConstant.METHOD_UPDATE); + case PermissionConstant.METHOD_SAVE_BATCH: + // 修改为只有超管才能操作 + if(userProvider.get().getIsAdministrator()){ + return true; + } + // 得到角色id + SaveBatchForm saveBatchForm = (SaveBatchForm) pjp.getArgs()[0]; + List list = Arrays.asList(saveBatchForm.getRoleIds()); + if (list.size() == 0) { + list = new ArrayList<>(); + list.add(""); + } + // 得到组织id + List orgIdLists = organizeRelationService.getRelationListByRoleIdList(list).stream().map(OrganizeRelationEntity::getOrganizeId).collect(Collectors.toList()); + StringBuilder orgIds = new StringBuilder(); + orgIdLists.stream().forEach(t->{ + orgIds.append(t + ","); + }); + return PermissionAspectUtil.getPermitByOrgId( + // 操作目标对象组织ID集合 + orgIds.toString(), + operatorUserId, + PermissionConstant.METHOD_UPDATE); + case PermissionConstant.METHOD_UPDATE: + //判断是否有当前组织的修改权限 + String organizeId = String.valueOf(pjp.getArgs()[0]); + return PermissionAspectUtil.containPermission(organizeId, operatorUserId, methodName); + default: + return false; + } + } + +} diff --git a/jnpf-java-boot/jnpf-admin/src/main/java/jnpf/aop/PermissionAdminBase.java b/jnpf-java-boot/jnpf-admin/src/main/java/jnpf/aop/PermissionAdminBase.java new file mode 100644 index 0000000..492ecc3 --- /dev/null +++ b/jnpf-java-boot/jnpf-admin/src/main/java/jnpf/aop/PermissionAdminBase.java @@ -0,0 +1,40 @@ +package jnpf.aop; + +import jnpf.base.ActionResult; +import jnpf.base.UserInfo; +import jnpf.constant.MsgCode; +import jnpf.util.UserProvider; +import org.aspectj.lang.ProceedingJoinPoint; + +public interface PermissionAdminBase{ + + /** + * 详细的权限判断 + * @param pjp AOP切点参数 + * @param operatorUserId 操作者对象 + */ + Boolean detailPermission(ProceedingJoinPoint pjp, String operatorUserId, String methodName); + + /** + * 管理者权限判断 + * + * @param userProvider 操作者对象 + */ + static Object permissionCommon(ProceedingJoinPoint pjp, UserProvider userProvider, PermissionAdminBase permissionAdminBase) throws Throwable { + // 获取用户信息 + UserInfo operatorUser = userProvider.get(); + // 是否是管理员 + if(operatorUser.getIsAdministrator()){ + return pjp.proceed(); + }else { + // 获取方法名 + String methodName = pjp.getSignature().getName(); + // 具体方法权限 + if(permissionAdminBase.detailPermission(pjp, operatorUser.getUserId(),methodName)){ + return pjp.proceed(); + } + } + return ActionResult.fail(MsgCode.FA021.get()); + } + +} diff --git a/jnpf-java-boot/jnpf-admin/src/main/java/jnpf/aop/PermissionOrgAspect.java b/jnpf-java-boot/jnpf-admin/src/main/java/jnpf/aop/PermissionOrgAspect.java new file mode 100644 index 0000000..c40a6bc --- /dev/null +++ b/jnpf-java-boot/jnpf-admin/src/main/java/jnpf/aop/PermissionOrgAspect.java @@ -0,0 +1,121 @@ +package jnpf.aop; + +import jnpf.constant.PermissionConstant; +import jnpf.permission.entity.OrganizeEntity; +import jnpf.permission.model.organize.OrganizeCrForm; +import jnpf.permission.model.organize.OrganizeDepartCrForm; +import jnpf.permission.model.organize.OrganizeDepartUpForm; +import jnpf.permission.model.organize.OrganizeUpForm; +import jnpf.permission.service.OrganizeService; +import jnpf.util.PermissionAspectUtil; +import jnpf.util.UserProvider; +import lombok.extern.slf4j.Slf4j; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.StringJoiner; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/15 17:12 + */ +@Slf4j +@Aspect +@Component +public class PermissionOrgAspect implements PermissionAdminBase { + + @Autowired + private UserProvider userProvider; + @Autowired + private OrganizeService organizeService; + + /** + * 分级管理切点 + */ + @Pointcut("@annotation(jnpf.annotation.OrganizePermission)") + public void pointcut() { + } + + /** + * 分级管理切点 + * + * @param pjp + * @return + * @throws Throwable + */ + @Around("pointcut()") + public Object around(ProceedingJoinPoint pjp) throws Throwable { + return PermissionAdminBase.permissionCommon(pjp, userProvider, this); + } + + @Override + public Boolean detailPermission(ProceedingJoinPoint pjp, String operatorUserId, String methodName) { + switch (methodName) { + case PermissionConstant.METHOD_CREATE: + return PermissionAspectUtil.getPermitByOrgIds( + // 操作目标对象表单对象 + ((OrganizeCrForm) pjp.getArgs()[0]).getParentId(), + operatorUserId, + PermissionConstant.METHOD_CREATE); + case PermissionConstant.METHOD_CREATE_DEPARTMENT: + return PermissionAspectUtil.getPermitByOrgIds( + // 操作目标对象表单对象 + ((OrganizeDepartCrForm) pjp.getArgs()[0]).getParentId(), + operatorUserId, + PermissionConstant.METHOD_CREATE); + case PermissionConstant.METHOD_UPDATE: + // 当前组织id + String orgId = (String) pjp.getArgs()[0]; + // 当前组织父级id + OrganizeEntity info = organizeService.getInfo(orgId); + // 修改后的id + OrganizeUpForm organizeUpForm = (OrganizeUpForm) pjp.getArgs()[1]; + StringJoiner stringJoiner = new StringJoiner(","); + stringJoiner.add(orgId); + if (!organizeUpForm.getParentId().equals(info.getParentId()) && !"-1".equals(info.getParentId())) { + stringJoiner.add(info.getParentId()); + } + if (!organizeUpForm.getParentId().equals(info.getParentId()) && !"-1".equals(organizeUpForm.getParentId())) { + stringJoiner.add(organizeUpForm.getParentId()); + } + return PermissionAspectUtil.getPermitByOrgIds( + // 操作目标对象ID + stringJoiner.toString(), + operatorUserId, + PermissionConstant.METHOD_UPDATE); + case PermissionConstant.METHOD_UPDATE_DEPARTMENT: + // 当前组织id + String orgIds = (String) pjp.getArgs()[0]; + // 当前组织父级id + OrganizeEntity infos = organizeService.getInfo(orgIds); + // 修改后的id + OrganizeDepartUpForm organizeDepartUpForm = (OrganizeDepartUpForm) pjp.getArgs()[1]; + StringJoiner stringJoiners = new StringJoiner(","); + stringJoiners.add(orgIds); + if (!organizeDepartUpForm.getParentId().equals(infos.getParentId())) { + stringJoiners.add(infos.getParentId()); + stringJoiners.add(organizeDepartUpForm.getParentId()); + } + return PermissionAspectUtil.getPermitByOrgIds( + // 操作目标对象ID + stringJoiners.toString(), + operatorUserId, + PermissionConstant.METHOD_UPDATE); + case PermissionConstant.METHOD_DELETE: + case PermissionConstant.METHOD_DELETE_DEPARTMENT: + return PermissionAspectUtil.getPermitByOrgIds( + // 操作目标对象ID + pjp.getArgs()[0].toString(), + operatorUserId, + PermissionConstant.METHOD_DELETE); + default: + return false; + } + } +} diff --git a/jnpf-java-boot/jnpf-admin/src/main/java/jnpf/aop/PermissionPositionAspect.java b/jnpf-java-boot/jnpf-admin/src/main/java/jnpf/aop/PermissionPositionAspect.java new file mode 100644 index 0000000..388d0dc --- /dev/null +++ b/jnpf-java-boot/jnpf-admin/src/main/java/jnpf/aop/PermissionPositionAspect.java @@ -0,0 +1,93 @@ +package jnpf.aop; + +import jnpf.constant.PermissionConstant; +import jnpf.permission.entity.PositionEntity; +import jnpf.permission.model.position.PositionCrForm; +import jnpf.permission.model.position.PositionUpForm; +import jnpf.permission.service.OrganizeService; +import jnpf.permission.service.PositionService; +import jnpf.util.PermissionAspectUtil; +import jnpf.util.UserProvider; +import lombok.extern.slf4j.Slf4j; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/15 17:12 + */ +@Slf4j +@Aspect +@Component +public class PermissionPositionAspect implements PermissionAdminBase{ + + @Autowired + private UserProvider userProvider; + @Autowired + private PositionService positionService; + @Autowired + private OrganizeService organizeService; + + /** + * 分级管理切点 + */ + @Pointcut("@annotation(jnpf.annotation.PositionPermission)") + public void pointcut() { + } + + /** + * 分级管理切点 + * + * @param pjp + * @return + * @throws Throwable + */ + @Around("pointcut()") + public Object around(ProceedingJoinPoint pjp) throws Throwable { + return PermissionAdminBase.permissionCommon(pjp, userProvider, this); + } + + @Override + public Boolean detailPermission(ProceedingJoinPoint pjp, String operatorUserId, String methodName) { + switch (methodName){ + case PermissionConstant.METHOD_CREATE: + return PermissionAspectUtil.getPermitByOrgId( + // 操作目标对象组织ID集合 + ((PositionCrForm) pjp.getArgs()[0]).getOrganizeId(), + operatorUserId, + methodName); + case PermissionConstant.METHOD_UPDATE: + // 得到岗位信息后,判断是否有修改前的权限 + PositionEntity info = positionService.getInfo(((String) pjp.getArgs()[0])); + if (PermissionAspectUtil.getPermitByOrgId( + // 操作目标对象组织ID集合 + info.getOrganizeId(), + operatorUserId, + methodName)) { + return PermissionAspectUtil.getPermitByOrgId( + // 操作目标对象组织ID集合 + ((PositionUpForm) pjp.getArgs()[1]).getOrganizeId(), + operatorUserId, + methodName); + } + return false; + case PermissionConstant.METHOD_DELETE: + // 获取岗位所关联的组织ID字符串 + String positionId = String.valueOf(pjp.getArgs()[0]); + String orgIds = organizeService.getInfo(positionService.getInfo(positionId).getOrganizeId()).getId(); + return PermissionAspectUtil.getPermitByOrgId( + // 操作目标对象组织ID集合 + orgIds, + operatorUserId, + PermissionConstant.METHOD_DELETE); + default: + return false; + } + } +} diff --git a/jnpf-java-boot/jnpf-admin/src/main/java/jnpf/aop/PermissionRoleAspect.java b/jnpf-java-boot/jnpf-admin/src/main/java/jnpf/aop/PermissionRoleAspect.java new file mode 100644 index 0000000..7db8191 --- /dev/null +++ b/jnpf-java-boot/jnpf-admin/src/main/java/jnpf/aop/PermissionRoleAspect.java @@ -0,0 +1,155 @@ +package jnpf.aop; + +import jnpf.constant.PermissionConstant; +import jnpf.permission.entity.OrganizeRelationEntity; +import jnpf.permission.entity.RoleEntity; +import jnpf.permission.model.role.RoleCrForm; +import jnpf.permission.model.role.RoleUpForm; +import jnpf.permission.service.OrganizeRelationService; +import jnpf.permission.service.PositionService; +import jnpf.permission.service.RoleService; +import jnpf.util.PermissionAspectUtil; +import jnpf.util.UserProvider; +import lombok.extern.slf4j.Slf4j; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.List; +import java.util.StringJoiner; +import java.util.stream.Collectors; + +/** + * 角色操作权限 + * + * @author JNPF开发平台组 YanYu + * @version V3.2.0 + * @copyright 引迈信息技术有限公司 + * @date 2022/2/10 + */ +@Slf4j +@Aspect +@Component +public class PermissionRoleAspect implements PermissionAdminBase { + + @Autowired + private UserProvider userProvider; + @Autowired + private RoleService roleService; + @Autowired + private OrganizeRelationService organizeRelationService; + + /** + * 分级管理切点 + */ + @Pointcut("@annotation(jnpf.annotation.RolePermission)") + public void pointcut() { + } + + /** + * 分级管理切点 + * + * @param pjp + * @return + * @throws Throwable + */ + @Around("pointcut()") + public Object around(ProceedingJoinPoint pjp) throws Throwable { + return PermissionAdminBase.permissionCommon(pjp, userProvider, this); + } + + @Override + public Boolean detailPermission(ProceedingJoinPoint pjp, String operatorUserId, String methodName) { + boolean flag = false; + switch (methodName) { + case PermissionConstant.METHOD_CREATE: + RoleCrForm roleCrForm = (RoleCrForm) pjp.getArgs()[0]; + if (!checkAdminGlobal(roleCrForm.getGlobalMark(), userProvider)) { + return PermissionAspectUtil.getPermitByOrgId( + // 操作目标对象组织ID集合 + getOrganize(roleCrForm.getOrganizeIdsTree()), + operatorUserId, + PermissionConstant.METHOD_CREATE); + } + return true; + case PermissionConstant.METHOD_UPDATE: + RoleUpForm roleUpForm = (RoleUpForm) pjp.getArgs()[0]; + // 非管理员情况下 + if (!checkAdminGlobal(roleUpForm.getGlobalMark(), userProvider)) { + // 得到以前的组织id + String roleId = (String) pjp.getArgs()[1]; + List relationListByRoleId = organizeRelationService.getRelationListByRoleId(roleId).stream().map(OrganizeRelationEntity::getOrganizeId).collect(Collectors.toList()); + StringJoiner stringJoiners = new StringJoiner(","); + relationListByRoleId.forEach(t -> { + stringJoiners.add(t); + }); + if (PermissionAspectUtil.getPermitByOrgId( + // 操作目标对象组织ID集合 + stringJoiners.toString(), + operatorUserId, + PermissionConstant.METHOD_UPDATE)) { + return PermissionAspectUtil.getPermitByOrgId( + // 操作目标对象组织ID集合 + getOrganize(roleUpForm.getOrganizeIdsTree()), + operatorUserId, + PermissionConstant.METHOD_UPDATE); + } + return false; + } + return true; + case PermissionConstant.METHOD_DELETE: + String roleId = pjp.getArgs()[0].toString(); + RoleEntity roleEntity = roleService.getInfo(roleId); + // 获取角色关联的组织信息 + List relationListByRoleId = organizeRelationService.getRelationListByRoleId(roleId); + StringBuilder orgId = new StringBuilder(); + relationListByRoleId.stream().forEach(t->{ + orgId.append(t.getOrganizeId() + ","); + }); + if (roleEntity != null && !checkAdminGlobal(roleEntity.getGlobalMark(), userProvider)) { + return PermissionAspectUtil.getPermitByOrgId( + // 操作目标对象组织ID集合 + orgId.toString(), + operatorUserId, + PermissionConstant.METHOD_DELETE); + } + return true; + default: + break; + } + return true; + } + + /** + * 转成组织id字符串 + * @param orgIdsTree + * @return + */ + private String getOrganize(List> orgIdsTree) { + StringBuilder orgIds = new StringBuilder(); + for (List list : orgIdsTree) { + if (list.size() > 0) { + String orgId = list.get(list.size() - 1); + orgIds.append(orgId + ","); + } + } + return orgIds.toString(); + } + + /** + * 全局角色只能超管来操作 + * + * @param globalMark 全局标识 1:全局 0: 非全局 + * @param userProvider 操作者 + */ + private Boolean checkAdminGlobal(Integer globalMark, UserProvider userProvider) { + if (globalMark != null && globalMark == 1) { + return userProvider.get().getIsAdministrator(); + } + return false; + } + +} diff --git a/jnpf-java-boot/jnpf-admin/src/main/java/jnpf/aop/PermissionUserAspect.java b/jnpf-java-boot/jnpf-admin/src/main/java/jnpf/aop/PermissionUserAspect.java new file mode 100644 index 0000000..6208ef2 --- /dev/null +++ b/jnpf-java-boot/jnpf-admin/src/main/java/jnpf/aop/PermissionUserAspect.java @@ -0,0 +1,151 @@ +package jnpf.aop; + +import jnpf.constant.PermissionConst; +import jnpf.constant.PermissionConstant; +import jnpf.permission.entity.OrganizeRelationEntity; +import jnpf.permission.entity.UserRelationEntity; +import jnpf.permission.model.user.form.UserCrForm; +import jnpf.permission.model.user.form.UserUpForm; +import jnpf.permission.model.userrelation.UserRelationForm; +import jnpf.permission.service.*; +import jnpf.util.PermissionAspectUtil; +import jnpf.util.UserProvider; +import lombok.extern.slf4j.Slf4j; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.stream.Collectors; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/15 17:12 + */ +@Slf4j +@Aspect +@Component +public class PermissionUserAspect implements PermissionAdminBase{ + + @Autowired + private UserProvider userProvider; + @Autowired + private OrganizeRelationService organizeRelationService; + @Autowired + private PositionService positionService; + @Autowired + private UserRelationService userRelationService; + + /** + * 分级管理切点 + */ + @Pointcut("@annotation(jnpf.annotation.UserPermission)") + public void pointcut() { + } + + /** + * 分级管理切点 + * + * @param pjp + * @return + * @throws Throwable + */ + @Around("pointcut()") + public Object around(ProceedingJoinPoint pjp) throws Throwable { + return PermissionAdminBase.permissionCommon(pjp, userProvider, this); + } + + @Override + public Boolean detailPermission(ProceedingJoinPoint pjp, String operatorUserId, String methodName) { + switch (methodName){ + case PermissionConstant.METHOD_CREATE: + UserCrForm userCrForm = (UserCrForm) pjp.getArgs()[0]; + return PermissionAspectUtil.getPermitByOrgId( + // 操作目标对象组织ID集合 + userCrForm.getOrganizeId(), + operatorUserId, + PermissionConstant.METHOD_CREATE); + case PermissionConstant.METHOD_UPDATE: + // 得到修改的用户以前的信息 + String userId = (String) pjp.getArgs()[0]; + List collect = userRelationService.getListByUserId(userId, PermissionConst.ORGANIZE).stream().map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + StringJoiner stringJoiner = new StringJoiner(","); + collect.forEach(t -> { + stringJoiner.add(t); + }); + if (PermissionAspectUtil.getPermitByOrgId( + // 操作目标对象组织ID集合 + stringJoiner.toString(), + operatorUserId, + PermissionConstant.METHOD_UPDATE)) { + return PermissionAspectUtil.getPermitByOrgId( + // 操作目标对象组织ID集合 + ((UserUpForm) pjp.getArgs()[1]).getOrganizeId(), + operatorUserId, + PermissionConstant.METHOD_UPDATE); + } + return false; + case PermissionConstant.METHOD_MODIFY_PW: + return PermissionAspectUtil.getPermitByUserId( + // 操作目标对象的ID + String.valueOf(pjp.getArgs()[0]), + operatorUserId, + PermissionConstant.METHOD_UPDATE); + case PermissionConstant.METHOD_DELETE: + return PermissionAspectUtil.getPermitByUserId( + // 操作目标对象的ID + pjp.getArgs()[0].toString(), + operatorUserId, + PermissionConstant.METHOD_DELETE); + case PermissionConstant.METHOD_SAVE: + String objId = pjp.getArgs()[0].toString(); + UserRelationForm userRelationForm = (UserRelationForm)pjp.getArgs()[1]; + + List orgIds = new ArrayList<>(); + if(userRelationForm.getObjectType().equals(PermissionConst.ROLE)){ + // 角色目前修改为只有超管才能够修改 + if(userProvider.get().getIsAdministrator()){ + return true; + } + orgIds.addAll(organizeRelationService.getRelationListByRoleId(objId).stream().map(OrganizeRelationEntity::getOrganizeId).collect(Collectors.toList())); + return PermissionAspectUtil.getPermitByOrgId( + // 操作目标对象组织ID集合 + String.join(",", orgIds), + operatorUserId, + PermissionConstant.METHOD_UPDATE); + }else { + if(userRelationForm.getObjectType().equals(PermissionConst.GROUP)) { + return true; + } + if(userRelationForm.getObjectType().equals(PermissionConst.POSITION)) { + orgIds.add(positionService.getInfo(objId).getOrganizeId()); + } + return PermissionAspectUtil.getPermitByOrgId( + String.join(",", orgIds), + operatorUserId, + PermissionConstant.METHOD_UPDATE); + } + case PermissionConstant.METHOD_DELETE_SOCIALS: + if(pjp.getArgs()[0].toString().equals(operatorUserId)){return true;} + return PermissionAspectUtil.getPermitByUserId( + // 操作目标对象的ID + pjp.getArgs()[0].toString(), + operatorUserId, + PermissionConstant.METHOD_UPDATE); + default: + return false; + } + } + + + + + +} diff --git a/jnpf-java-boot/jnpf-admin/src/main/java/jnpf/aop/RequestLogAspect.java b/jnpf-java-boot/jnpf-admin/src/main/java/jnpf/aop/RequestLogAspect.java new file mode 100644 index 0000000..c1a9be3 --- /dev/null +++ b/jnpf-java-boot/jnpf-admin/src/main/java/jnpf/aop/RequestLogAspect.java @@ -0,0 +1,202 @@ +package jnpf.aop; + +import jnpf.base.LogSortEnum; +import jnpf.base.UserInfo; +import jnpf.config.ConfigValueUtil; +import jnpf.entity.LogEntity; +import jnpf.service.LogService; +import jnpf.util.*; +import lombok.extern.slf4j.Slf4j; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; +import org.aspectj.lang.reflect.MethodSignature; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; +import jnpf.annotation.HandleLog; +import org.springframework.web.multipart.MultipartFile; + +import java.lang.reflect.Method; +import java.util.Date; +import java.util.concurrent.Executor; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/15 17:12 + */ +@Slf4j +@Aspect +@Component +@Order(2) +public class RequestLogAspect { + + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private LogService logService; + @Autowired + private Executor executor; + + @Pointcut("(execution(* jnpf.*.controller.*.*(..)) || execution(* jnpf.message.websocket.WebSocket.*(..)))&&!execution(* jnpf.controller.UtilsController.*(..)) ") + public void requestLog() { + + } + + @Around("requestLog()") + public Object doAroundService(ProceedingJoinPoint pjp) throws Throwable { + long startTime = System.currentTimeMillis(); + Object obj = pjp.proceed(); + long costTime = System.currentTimeMillis() - startTime; + UserInfo userInfo = UserProvider.getUser(); + if(userInfo.getUserId() != null) { + printLog(userInfo, costTime); + try { + // 判断是否需要操作日志 + MethodSignature methodSignature = (MethodSignature) pjp.getSignature(); + // 得到请求参数 + Object[] args = pjp.getArgs(); + // 得到请求方法 + Method method = methodSignature.getMethod(); + HandleLog methodAnnotation = method.getAnnotation(HandleLog.class); + if (methodAnnotation != null) { + String moduleName = methodAnnotation.moduleName(); + String requestMethod = methodAnnotation.requestMethod(); + handleLog(userInfo, costTime, obj, moduleName, requestMethod, args); + } + } catch (Exception e) { + log.error("记录操作日志发生错误:" + e.getMessage()); + } + } + return obj; + } + + /** + * 请求日志 + * + * @param userInfo + * @param costTime + */ + private void printLog(UserInfo userInfo, long costTime) { + LogEntity entity = new LogEntity(); + entity.setId(RandomUtil.uuId()); + entity.setType(LogSortEnum.Request.getCode()); + entity.setUserId(userInfo.getUserId()); + entity.setUserName(userInfo.getUserName() + "/" + userInfo.getUserAccount()); + //请求耗时 + entity.setRequestDuration((int) costTime); + entity.setRequestUrl(ServletUtil.getRequest().getServletPath()); + entity.setRequestMethod(ServletUtil.getRequest().getMethod()); + entity.setIpAddress(IpUtil.getIpAddr()); + entity.setCreatorTime(new Date()); + entity.setPlatForm(ServletUtil.getUserAgent()); + executor.execute(()->{ + logService.save(entity); + }); + } + + /** + * 添加操作日志 + * + * @param userInfo 用户信息 + * @param costTime 操作耗时 + * @param obj 请求结果 + * @param moduleName 模块名称 + * @param requestMethod 请求方法 + * @param arg 请求参数 + */ + private void handleLog(UserInfo userInfo, long costTime, Object obj, String moduleName, String requestMethod, Object[] arg) { + LogEntity entity = new LogEntity(); + entity.setId(RandomUtil.uuId()); + entity.setType(LogSortEnum.Operate.getCode()); + entity.setUserId(userInfo.getUserId()); + entity.setUserName(userInfo.getUserName() + "/" + userInfo.getUserAccount()); + //请求耗时 + entity.setRequestDuration((int) costTime); + entity.setRequestMethod(requestMethod); + entity.setIpAddress(IpUtil.getIpAddr()); + entity.setCreatorTime(new Date()); + // 请求设备 + entity.setPlatForm(ServletUtil.getUserAgent()); + // 操作模块 + entity.setModuleName(moduleName); + // 操作记录 + try { + // 定义字符串 + StringBuilder stringBuilder = new StringBuilder(); + for (Object o : arg) { + // 如果是MultipartFile则为导入 + if (o instanceof MultipartFile) { + stringBuilder.append("{\"originalFilename\":\"" + ((MultipartFile) o).getOriginalFilename() + "\","); + stringBuilder.append("\"contentType\":\"" + ((MultipartFile) o).getContentType() + "\","); + stringBuilder.append("\"name\":\"" + ((MultipartFile) o).getName() + "\","); + stringBuilder.append("\"resource\":\"" + ((MultipartFile) o).getResource() + "\","); + stringBuilder.append("\"size\":\"" + ((MultipartFile) o).getSize() + "\"}"); + } + } + if (stringBuilder.length() > 0) { + entity.setJsons(requestMethod + "应用【" + stringBuilder + "】【" + obj + "】" ); + } else { + entity.setJsons(requestMethod + "应用【" + JsonUtil.getObjectToString(arg) + "】【" + obj + "】" ); + } + } catch (Exception e) { + entity.setJsons(requestMethod + "应用【" + arg + "】【" + obj + "】" ); + } + executor.execute(()->{ + logService.save(entity); + }); + } + +/// 后面可能会用 +// /** +// * 判断是否为导入导出 +// * +// * @return +// */ +// private String getRequestMethod() { +// //得到请求方式 +// String methodType = ServletUtil.getRequest().getMethod(); +// // 得到当前请求的尾缀 +// String endWith = null; +// String servletPath = ServletUtil.getServletPath(); +// if (StringUtil.isNotEmpty(servletPath)) { +// String[] path = servletPath.split("/"); +// int length = path.length; +// if (length > 5) { +// endWith = path[length - 2] + "/" + path[length - 1]; +// } +// } +// // 如果是GET请求且请求后缀是'/Action/Export'则判定为导出 +// if (HandleMethodEnum.GET.getRequestType().equals(methodType)) { +// methodType = "Action/Export".equals(endWith) ? "EXPORT" : "GET"; +// } else if (HandleMethodEnum.POST.getRequestType().equals(methodType)) { +// methodType = "Action/Import".equals(endWith) ? "IMPORT" : "GET"; +// } +// return methodType; +// } +// /** +// * 判断是否为导入导出 +// * +// * @return +// */ +// private String getRequestModuleName() { +// //得到Url +// String requestURI = ServletUtil.getRequest().getRequestURI(); +// // 取模块名 +// if (StringUtil.isNotEmpty(requestURI)) { +// String[] split = requestURI.split("/"); +// if (split.length > 2) { +// String url = split[1]; +// // 得到所在模块 +// String moduleName = HandleModuleEnum.getModuleByURL(url); +// return moduleName; +// } +// } +// return ""; +// } +/// + +} diff --git a/jnpf-java-boot/jnpf-admin/src/main/java/jnpf/aop/VisiualOpaAspect.java b/jnpf-java-boot/jnpf-admin/src/main/java/jnpf/aop/VisiualOpaAspect.java new file mode 100644 index 0000000..5ab4503 --- /dev/null +++ b/jnpf-java-boot/jnpf-admin/src/main/java/jnpf/aop/VisiualOpaAspect.java @@ -0,0 +1,49 @@ +package jnpf.aop; + +import jnpf.util.RedisUtil; +import jnpf.util.ServletUtil; +import jnpf.util.UserProvider; +import lombok.extern.slf4j.Slf4j; +import org.aspectj.lang.annotation.After; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.HashSet; +import java.util.Set; + +/** + * 可视化开发缓存数据处理 + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/15 17:12 + */ +@Slf4j +@Aspect +@Component +public class VisiualOpaAspect { + + @Autowired + UserProvider userProvider; + @Autowired + private RedisUtil redisUtil; + @Pointcut("(execution(* jnpf.onlinedev.controller.VisualdevModelDataController.*(..))) || execution(* jnpf.onlinedev.controller.VisualdevModelAppController.*(..)))" + + "|| execution(* jnpf.generater.controller.VisualdevGenController.*(..)))") + public void visiualOpa() { + + } + + @After("visiualOpa()") + public void doAroundService(){ + String method=ServletUtil.getRequest().getMethod().toLowerCase(); + if("put".equals(method)||"delete".equals(method)||"post".equals(method)){ + Set allKey=new HashSet<>(16); + allKey.addAll(redisUtil.getAllVisiualKeys()); + for(String key:allKey){ + redisUtil.remove(key); + } + } + } + } diff --git a/jnpf-java-boot/jnpf-admin/src/main/java/jnpf/constant/PermissionConstant.java b/jnpf-java-boot/jnpf-admin/src/main/java/jnpf/constant/PermissionConstant.java new file mode 100644 index 0000000..6b25535 --- /dev/null +++ b/jnpf-java-boot/jnpf-admin/src/main/java/jnpf/constant/PermissionConstant.java @@ -0,0 +1,73 @@ +package jnpf.constant; + +/** + * 分级管理常量 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-11-01 + */ +public class PermissionConstant { + + /** + * 创建方法 + */ + public static final String METHOD_CREATE = "create"; + + /** + * 编辑方法 + */ + public static final String METHOD_UPDATE = "update"; + + /** + * 删除方法 + */ + public static final String METHOD_DELETE = "delete"; + + /** + * 更新状态 + */ + public static final String METHOD_DISABLE = "disable"; + + /** + * 创建方法 + */ + public static final String METHOD_CREATE_DEPARTMENT = "createDepartment"; + + /** + * 编辑方法 + */ + public static final String METHOD_UPDATE_DEPARTMENT = "updateDepartment"; + + /** + * 删除方法 + */ + public static final String METHOD_DELETE_DEPARTMENT = "deleteDepartment"; + + /** + * 保存方法 + */ + public static final String METHOD_SAVE = "save"; + public static final String METHOD_SAVE_BATCH = "saveBatch"; + /** + * 修改用户密码 + */ + public static final String METHOD_MODIFY_PW = "modifyPassword"; + + /** + * 拼接方法名 + */ + public static final String GET_METHOD_CREATE = "Add"; + public static final String GET_METHOD_UPDATE = "Edit"; + public static final String GET_METHOD_DELETE = "Delete"; + public static final String GET_METHOD_SELECT = "Select"; + public static final String GET_METHOD_THIS = "getThisLayer"; + public static final String GET_METHOD_SUB = "getSubLayer"; + + /** + * 解除绑定方法 + */ + public static final String METHOD_DELETE_SOCIALS = "deleteSocials"; + +} diff --git a/jnpf-java-boot/jnpf-admin/src/main/java/jnpf/filter/AuthFilter.java b/jnpf-java-boot/jnpf-admin/src/main/java/jnpf/filter/AuthFilter.java new file mode 100644 index 0000000..f509473 --- /dev/null +++ b/jnpf-java-boot/jnpf-admin/src/main/java/jnpf/filter/AuthFilter.java @@ -0,0 +1,115 @@ +package jnpf.filter; + +import cn.dev33.satoken.context.SaHolder; +import cn.dev33.satoken.exception.NotLoginException; +import cn.dev33.satoken.filter.SaServletFilter; +import cn.dev33.satoken.router.SaHttpMethod; +import cn.dev33.satoken.router.SaRouter; +import cn.dev33.satoken.stp.StpUtil; +import cn.dev33.satoken.util.SaResult; +import jnpf.base.ActionResultCode; +import jnpf.config.ConfigValueUtil; +import jnpf.util.GatewayWhite; +import jnpf.util.IpUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.HttpHeaders; + +import javax.servlet.http.HttpServletRequest; + + +/** + * 网关验证token + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-03-24 + */ +@Slf4j +@Configuration +public class AuthFilter { + + private static final String ALL = "*"; + private static final String MAX_AGE = "18000L"; + + @Autowired + private ConfigValueUtil configValueUtil; + + @Autowired + private GatewayWhite gatewayWhite; + + // 注册 Sa-Token全局过滤器 + @Bean + public SaServletFilter getSaReactorFilter(GatewayWhite gatewayWhite) { + return new SaServletFilter() + // 拦截地址 + .addInclude("/**") + .setExcludeList(gatewayWhite.excludeUrl) + // 鉴权方法:每次访问进入 + .setAuth(obj -> { + if(log.isInfoEnabled()){ + log.info("请求路径: {}", SaHolder.getRequest().getRequestPath()); + } + //拦截路径 + SaRouter.match(gatewayWhite.blockUrl).match(o -> { + //禁止访问URL 排除白名单 + String ip = getIpAddr(); + for (String o1 : gatewayWhite.whiteIp) { + if(ip.startsWith(o1)){ + return false; + } + } + log.info("非白名单IP访问限制接口:{}, {}", SaHolder.getRequest().getRequestPath(), ip); + return true; + }).back("接口无法访问"); + //测试不验证 鉴权服务重启测试模式不清除Token就够了 + //SaRouter.match((r)->"true".equals(configValueUtil.getTestVersion())).stop(); + //白名单不拦截 + SaRouter.match(gatewayWhite.whiteUrl).stop(); + // 登录校验 -- 校验多租户管理模块TOKEN + //SaRouter.match("/api/tenant/**", r -> { + // SaManager.getStpLogic(AuthConsts.ACCOUNT_TYPE_TENANT).checkLogin(); + //}).stop(); + // 登录校验 -- 拦截所有路由 + SaRouter.match("/**", r -> { + StpUtil.checkLogin(); + }).stop(); + }).setError(e -> { + SaHolder.getResponse().addHeader("Content-Type","application/json; charset=utf-8"); + if(e instanceof NotLoginException){ + return SaResult.error(ActionResultCode.SessionOverdue.getMessage()).setCode(ActionResultCode.SessionOverdue.getCode()); + } + log.error(e.getMessage(), e); + return SaResult.error("系统异常.").setCode(ActionResultCode.Exception.getCode()); + }) + // 前置函数:在每次认证函数之前执行 + .setBeforeAuth(obj -> { + HttpServletRequest request = (HttpServletRequest) SaHolder.getRequest().getSource(); + // ---------- 设置跨域响应头 ---------- + SaHolder.getResponse() + // 允许指定域访问跨域资源 + .setHeader(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN, request.getHeader(HttpHeaders.ORIGIN)) + // 允许的header参数 + .setHeader(HttpHeaders.ACCESS_CONTROL_ALLOW_HEADERS, ALL) + // 允许所有请求方式 + .setHeader(HttpHeaders.ACCESS_CONTROL_ALLOW_METHODS, ALL) + .setHeader(HttpHeaders.ACCESS_CONTROL_ALLOW_CREDENTIALS, "true") + .setHeader(HttpHeaders.ACCESS_CONTROL_EXPOSE_HEADERS, ALL) + // 有效时间 + .setHeader(HttpHeaders.ACCESS_CONTROL_MAX_AGE, MAX_AGE); + + // 如果是预检请求,则立即返回到前端 + SaRouter.match(SaHttpMethod.OPTIONS) + .back(); + }); + } + + public static String getIpAddr() { + return IpUtil.getIpAddr(); + } + + +} diff --git a/jnpf-java-boot/jnpf-admin/src/main/java/jnpf/util/GatewayWhite.java b/jnpf-java-boot/jnpf-admin/src/main/java/jnpf/util/GatewayWhite.java new file mode 100644 index 0000000..160e2a4 --- /dev/null +++ b/jnpf-java-boot/jnpf-admin/src/main/java/jnpf/util/GatewayWhite.java @@ -0,0 +1,181 @@ +package jnpf.util; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.List; + +/** + * 放行的url + * 由下方的URL列表加上配置里的URL组合 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-03-24 + */ +@Component +@ConfigurationProperties("gateway") +public class GatewayWhite { + + + /** + * 放行不记录 + */ + public List excludeUrl = new ArrayList<>(); + + /** + * 不验证Token, 记录访问 + */ + public List whiteUrl = new ArrayList<>(); + + /** + * 禁止访问 + */ + public List blockUrl = new ArrayList<>(); + + /** + * 禁止访问地址的白名单IP + * startsWith匹配, 访问IP.startsWith(whiteIP) + */ + public List whiteIp = new ArrayList<>(); + + public GatewayWhite(){ + interceptPath(); + whitePath(); + excludePath(); + whiteIp(); + } + + + public List getWhiteUrl() { + return new ArrayList<>(whiteUrl); + } + + public List getBlockUrl() { + return new ArrayList<>(blockUrl); + } + + public List getExcludeUrl() { + return new ArrayList<>(excludeUrl); + } + + public List getWhiteIp() { + return new ArrayList<>(whiteIp); + } + + public void setWhiteUrl(List whiteUrl) { + whitePath(); + this.whiteUrl.addAll(whiteUrl); + } + + public void setBlockUrl(List blockUrl) { + interceptPath(); + this.blockUrl.addAll(blockUrl); + } + + public void setExcludeUrl(List excludeUrl) { + excludePath(); + this.excludeUrl.addAll(excludeUrl); + } + + public void setWhiteIp(List whiteIp) { + whiteIp(); + this.whiteIp.addAll(whiteIp); + } + + private void interceptPath() { + blockUrl.clear(); + blockUrl.add("/actuator/**"); + blockUrl.add("/api/*/actuator/**"); + blockUrl.add("/doc.html"); + blockUrl.add("/swagger-resources/**"); + blockUrl.add("/swagger-ui/**"); + blockUrl.add("/api/*/v?/api-docs/*"); + blockUrl.add("/v?/api-docs/*"); + } + + private void whitePath() { + whiteUrl.clear(); + //oauth + whiteUrl.add("/api/oauth/Login/**"); + whiteUrl.add("/api/oauth/Logout/**"); + // APP + whiteUrl.add("/api/app/Version"); + + //websocket + whiteUrl.add("/api/message/websocket/*"); + //大屏图片 + whiteUrl.add("/api/file/VisusalImg/**"); + whiteUrl.add("/api/blade-visual/map/data"); + whiteUrl.add("/api/blade-visual/category/list"); + whiteUrl.add("/api/blade-visual/visual/put-file/**"); + //数据地图 + whiteUrl.add("/api/system/DataMap/**"); + //代码下载接口 + whiteUrl.add("/api/visualdev/Generater/DownloadVisCode"); + //多租户 + whiteUrl.add("/api/tenant/DbName/**"); + whiteUrl.add("/api/tenant/login"); + whiteUrl.add("/api/tenant/logout"); + //extend KK + whiteUrl.add("/api/extend/DocumentPreview/**"); + //file模块不拦截 + //文件下载接口 + whiteUrl.add("/api/file/filedownload/**"); + whiteUrl.add("/api/file/VisusalImg/**"); + whiteUrl.add("/api/file/AppStartInfo/*"); + whiteUrl.add("/api/file/IMVoice/*"); + whiteUrl.add("/api/file/{type}/{fileName}"); + whiteUrl.add("/api/file/IMImage/*"); + whiteUrl.add("/api/file/Image/**"); + whiteUrl.add("/api/file/DownloadModel"); + whiteUrl.add("/api/file/Download/**"); + whiteUrl.add("/api/file/ImageCode/**"); + + whiteUrl.add("/api/system/DictionaryData/*/Data/Selector"); + whiteUrl.add("/api/datareport/pdf/show"); + whiteUrl.add("/api/datareport/preview/loadPagePaper"); + whiteUrl.add("/api/datareport/pdf"); + whiteUrl.add("/api/datareport/word"); + whiteUrl.add("/api/datareport/excel/**"); + whiteUrl.add("/api/datareport/Data/*/Actions/Export"); + //报表模板导入 + whiteUrl.add("/api/datareport/import"); + whiteUrl.add("/api/system/DataInterface/*/Actions/Response"); + whiteUrl.add("/api/system/DataInterface/Actions/GetAuth"); + //swagger3 + whiteUrl.add("/doc.html"); + whiteUrl.add("/webjars/**"); + whiteUrl.add("/api/*/v?/api-docs/*"); + whiteUrl.add("/v?/api-docs/*"); + whiteUrl.add("/swagger-ui/**"); + whiteUrl.add("/swagger-resources/**"); + + whiteUrl.add("/csrf"); + whiteUrl.add("/api/oauth/ImageCode/**"); + whiteUrl.add("/api/oauth/getConfig/*"); + whiteUrl.add("/api/oauth/getLoginConfig"); + whiteUrl.add("/api/oauth/getTicketStatus/*"); + whiteUrl.add("/api/oauth/getTicket"); + + whiteUrl.add("/api/message/ShortLink/**"); + whiteUrl.add("/api/message/WechatOpen/token/**"); + + //在线表单外链触发接口 + whiteUrl.add("/api/visualdev/ShortLink/**"); + } + + private void excludePath(){ + excludeUrl.clear(); + excludeUrl.add("/favicon.ico"); + excludeUrl.add("/api/message/websocket/*"); + } + + private void whiteIp(){ + whiteIp.clear(); + whiteIp.add("127.0.0.1"); + } + +} diff --git a/jnpf-java-boot/jnpf-admin/src/main/java/jnpf/util/PermissionAspectUtil.java b/jnpf-java-boot/jnpf-admin/src/main/java/jnpf/util/PermissionAspectUtil.java new file mode 100644 index 0000000..169240a --- /dev/null +++ b/jnpf-java-boot/jnpf-admin/src/main/java/jnpf/util/PermissionAspectUtil.java @@ -0,0 +1,165 @@ +package jnpf.util; + +import jnpf.constant.PermissionConstant; +import jnpf.permission.entity.OrganizeAdministratorEntity; +import jnpf.permission.entity.OrganizeEntity; +import jnpf.permission.service.OrganizeAdministratorService; +import jnpf.permission.service.OrganizeService; +import jnpf.util.context.SpringContext; + +/** + * 分级管理工具类 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-11-01 + */ +public class PermissionAspectUtil { + + private static final OrganizeService organizeService; + private static final OrganizeAdministratorService organizeAdministratorService; + + static { + organizeService = SpringContext.getBean(OrganizeService.class); + organizeAdministratorService = SpringContext.getBean(OrganizeAdministratorService.class); + } + + /** + * 判断是否存在修改前所在的组织的操作 + * + * @param targetUserId 被操作目标对象ID + * @param operatorUsrId 操作者ID + * @param methodName 操作方法 + */ + public static Boolean getPermitByUserId(String targetUserId, String operatorUsrId, String methodName) { + for(OrganizeEntity organizeEntity : organizeService.getAllOrgByUserId(targetUserId)){ + if (PermissionAspectUtil.containPermission(organizeEntity.getId(), operatorUsrId, methodName)) { + return true; + } + } + return false; + } + + /** + * 判断 操作者是否含有该组织的操作权限 + * + * @param organizeId 被操作者所在组织ID + * @param operatorUserId 当前操作者用户对象ID + * @param methodName 操作类型:创建、编辑、删除 + */ + public static boolean containPermission(String organizeId, String operatorUserId, String methodName) { + OrganizeEntity organizeEntity = organizeService.getInfo(organizeId); + if (organizeEntity != null) { + // 当前用户的所有分级权限 + OrganizeAdministratorEntity adminEntity = organizeAdministratorService.getOne(operatorUserId, organizeId); + if(permissionFlag(adminEntity, methodName, true)){ + return true; + } + // 查看父级的组织权限是否含有子集权限 + return parentPermission(organizeEntity.getParentId(), methodName, operatorUserId); + } + return false; + } + + /** + * 判断是否存在修改前所在的组织的操作(拥有所有的组织权限才能操作) + * + * @param organizeIds 组织ID集合字符串 + * @param operatorUsrId 操作者ID + * @param methodName 操作方法 + */ + public static Boolean getPermitByOrgIds(String organizeIds, String operatorUsrId, String methodName) { + boolean flag = true; + for (String organizeId : organizeIds.split(",")) { + flag = true; + flag = PermissionAspectUtil.containPermission(organizeId, operatorUsrId, methodName); + if (!flag) { + break; + } + } + return flag; + } + + /** + * 判断是否可修改所在的组织的操作(只要有一个权限即可操作) + * + * @param organizeIds 组织ID集合字符串 + * @param operatorUsrId 操作者ID + * @param methodName 操作方法 + */ + public static Boolean getPermitByOrgId(String organizeIds, String operatorUsrId, String methodName) { + for (String organizeId : organizeIds.split(",")) { + if (PermissionAspectUtil.containPermission(organizeId,operatorUsrId, methodName)) { + return true; + } + } + return false; + } + + /** + * 判断组织新建权限(从父级给的子集新建操作权限) + * + * @param organizeParentId + * @param methodName + * @param userId + * @return + */ + private static boolean parentPermission(String organizeParentId, String methodName, String userId) { + // 得到父级组织 + OrganizeEntity parentOrganizeEntity = organizeService.getInfo(organizeParentId); + + if (parentOrganizeEntity != null) { + // 得到父级的权限 + if(permissionFlag(organizeAdministratorService.getOne(userId, parentOrganizeEntity.getId()), methodName, false)){ + return true; + } + // 当前正在判断的组织已经是顶级则无需递归 + if (!"-1".equals(parentOrganizeEntity.getParentId())) { + return parentPermission(parentOrganizeEntity.getParentId(), methodName, userId); + } + } + return false; + } + + /** + * 判断是否具有权限 + * @param adminEntity 分级管理对象 + * @param methodName 操作类型:创建、编辑、删除 + * @param thisFlag true:当前组织 false:子组织 + */ + private static boolean permissionFlag(OrganizeAdministratorEntity adminEntity, String methodName, Boolean thisFlag) { + if (adminEntity != null) { + String methodType = ""; + // 存在则验证是否有当前组织分级管理 + try { + switch (methodName) { + case PermissionConstant.METHOD_CREATE: + // 创建权限 + methodType = PermissionConstant.GET_METHOD_CREATE; + break; + case PermissionConstant.METHOD_UPDATE: + // 编辑权限 + methodType = PermissionConstant.GET_METHOD_UPDATE; + break; + case PermissionConstant.METHOD_DELETE: + // 删除权限 + methodType = PermissionConstant.GET_METHOD_DELETE; + break; + default: + break; + } + // 拼接方法名 + String method = (thisFlag ? PermissionConstant.GET_METHOD_THIS : PermissionConstant.GET_METHOD_SUB) + methodType; + String selectMethod = (thisFlag ? PermissionConstant.GET_METHOD_THIS : PermissionConstant.GET_METHOD_SUB) + PermissionConstant.GET_METHOD_SELECT; + if ((int)OrganizeAdministratorEntity.class.getMethod(method).invoke(adminEntity) == 1 && (int)OrganizeAdministratorEntity.class.getMethod(selectMethod).invoke(adminEntity) == 1) { + return true; + } + } catch (Exception e) { + e.printStackTrace(); + } + } + return false; + } + +} diff --git a/jnpf-java-boot/jnpf-admin/src/main/resources/AntiSamy_zh_CN.properties b/jnpf-java-boot/jnpf-admin/src/main/resources/AntiSamy_zh_CN.properties new file mode 100644 index 0000000..fb19076 --- /dev/null +++ b/jnpf-java-boot/jnpf-admin/src/main/resources/AntiSamy_zh_CN.properties @@ -0,0 +1,34 @@ +# General +error.size.toolarge=\u8F93\u5165\u592A\u5927\u3002\u5B9E\u9645\u7684\u8F93\u5165\u4E3A{0}\u5B57\u8282\u3002\u5141\u8BB8\u7684\u6700\u5927\u8F93\u5165\u4E3A{1}\u5B57\u8282\u3002 +error.comment.removed=\u51FA\u4E8E\u5B89\u5168\u7684\u539F\u56E0\uFF0C\u6CE8\u91CA\u57DF\u5DF2\u88AB\u8FC7\u6EE4\u3002\u6CE8\u91CA\u57DF\u7684\u503C\u4E3A{0} +# Tag related +error.tag.notfound=\u51FA\u4E8E\u5B89\u5168\u7684\u539F\u56E0\uFF0C\u6807\u8BB0{0}\u5DF2\u88AB\u8FC7\u6EE4\u3002\u6807\u8BB0\u7684\u5185\u5BB9\u4FDD\u5B58\u4E0D\u53D8\u3002 +error.tag.removed=\u51FA\u4E8E\u5B89\u5168\u7684\u539F\u56E0\uFF0C\u6807\u8BB0{0}\u4E0D\u88AB\u5141\u8BB8\u3002\u6B64\u6807\u8BB0\u4E0D\u5E94\u8BE5\u5F71\u54CD\u8F93\u5165\u7684\u663E\u793A\u3002 +error.tag.filtered=\u51FA\u4E8E\u5B89\u5168\u7684\u539F\u56E0\uFF0C\u6807\u8BB0{0}\u5DF2\u88AB\u8FC7\u6EE4\u3002\u6807\u8BB0\u7684\u5185\u5BB9\u4FDD\u5B58\u4E0D\u53D8\u3002 +error.tag.encoded=The {0} tag has been encoded for security reasons. The contents of the tag will remain in place. +error.tag.empty=\u5728{0}\u7684\u6807\u7B7E\u662F\u7A7A\u7684\uFF0C\u56E0\u6B64\u6211\u4EEC\u65E0\u6CD5\u5904\u7406\u5B83\u3002\u8BE5\u90AE\u4EF6\u7684\u5176\u4F59\u90E8\u5206\u662F\u5B8C\u6574\u7684\uFF0C\u5176\u642C\u8FC1\u5E94\u8BE5\u6CA1\u6709\u4EFB\u4F55\u526F\u4F5C\u7528\u3002 +error.cdata.found=\u4E00\u4E2ACDATA\u90E8\u5206\u88AB\u53D1\u73B0\uFF0C\u8FD9\u662F\u4E0D\u5141\u8BB8\u7684\u3002\u8BE5\u90AE\u4EF6\u7684\u5176\u4F59\u90E8\u5206\u662F\u5B8C\u6574\u7684\uFF0C\u5176\u642C\u8FC1\u4E0D\u5E94\u8BE5\u6709\u4EFB\u4F55\u526F\u4F5C\u7528\u3002\u5728CDATA\u7684\u5185\u5BB9\u662F \"{0}\"\u3002 +error.pi.found=XML\u5904\u7406\u6307\u4EE4\u88AB\u53D1\u73B0\uFF0C\u8FD9\u662F\u4E0D\u5141\u8BB8\u7684\u3002\u6D88\u606F\u7684\u5176\u4F59\u90E8\u5206\u662F\u5B8C\u6574\u7684\uFF0C\u5176\u642C\u8FC1\u5E94\u8BE5\u4E0D\u4F1A\u6709\u4EFB\u4F55\u526F\u4F5C\u7528\u3002\u8BE5\u6307\u4EE4\u7684\u5185\u5BB9\u4E3A \"{0}\"\u3002 +# Attribute related +error.attribute.notfound=\u6807\u8BB0{0}\u5305\u542B\u4E00\u4E2A\u6CA1\u6CD5\u5904\u7406\u7684\u5C5E\u6027\u3002\u5C5E\u6027{1}\u5DF2\u88AB\u8FC7\u6EE4\uFF0C\u4F46\u6807\u8BB0\u4FDD\u5B58\u4E0D\u53D8\u3002 +error.attribute.invalid=\u6807\u8BB0{0}\u5305\u542B\u4E00\u4E2A\u6CA1\u6CD5\u5904\u7406\u7684\u5C5E\u6027\u3002\u5C5E\u6027{1}\u5305\u542B\u4E00\u4E2A\u503C\"{2}\"\u3002\u51FA\u4E8E\u5B89\u5168\u7684\u539F\u56E0\uFF0C\u8FD9\u4E2A\u503C\u6CA1\u6CD5\u88AB\u63A5\u53D7\u3002\u4E3A\u4E86\u5904\u7406\u8FD9\u4E2A\u8F93\u5165\uFF0C\u8FD9\u4E2A\u5C5E\u6027\u5DF2\u88AB\u4ECE\u8FD9\u4E2A\u6807\u8BB0\u4E2D\u53BB\u6389\uFF0C\u6807\u8BB0\u5176\u4ED6\u90E8\u5206\u4FDD\u6301\u4E0D\u53D8\u3002 +error.attribute.invalid.filtered=\u6807\u8BB0{0}\u5305\u542B\u4E00\u4E2A\u6CA1\u6CD5\u5904\u7406\u7684\u5C5E\u3002\u5C5E\u6027{1}\u5305\u542B\u4E00\u4E2A\u503C\"{2}\"\u3002\u51FA\u4E8E\u5B89\u5168\u7684\u539F\u56E0\uFF0C\u8FD9\u4E2A\u503C\u6CA1\u6CD5\u88AB\u63A5\u53D7\u3002\u4E3A\u4E86\u8FDB\u4E00\u6B65\u5904\u7406\u8FD9\u4E2A\u8F93\u5165\uFF0C\u6807\u8BB0{0}\u5DF2\u88AB\u8FC7\u6EE4\u3002 +error.attribute.invalid.encoded=The {0} tag contained an attribute that we could not process. The {1} attribute had a value of \"{2}\". This value could not be accepted for security reasons. We have chosen to encode the {0} tag in order to continue processing the input. +error.attribute.invalid.removed=\u6807\u8BB0{0}\u5305\u542B\u4E00\u4E2A\u6CA1\u6CD5\u5904\u7406\u7684\u5C5E\u6027\u3002\u5C5E\u6027{1}\u5305\u542B\u4E00\u4E2A\u503C\"{2}\"\u3002\u51FA\u4E8E\u5B89\u5168\u7684\u539F\u56E0\uFF0C\u8FD9\u4E2A\u503C\u6CA1\u6CD5\u88AB\u63A5\u53D7\u3002\u4E3A\u4E86\u8FDB\u4E00\u6B65\u5904\u7406\u8FD9\u4E2A\u8F93\u5165\uFF0C\u6574\u4E2A\u6807\u8BB0{0}\u5DF2\u88AB\u53BB\u6389\u3002 +# CSS related +error.css.tag.malformed=The stylesheet code \"{0}\" could not be parsed. +error.css.import.disabled=\u6837\u5F0F\u8868\u7684\u5BFC\u5165\u8FD8\u6CA1\u6709\u88AB\u6FC0\u6D3B\u3002 +error.css.import.exceeded=\u4F4D\u4E8E{0}\u7684\u6837\u5F0F\u8868\u8D85\u8FC7\u5141\u8BB8\u5BFC\u5165\u7684\u6837\u5F0F\u8868\u7684\u603B\u6570\uFF0C\u56E0\u6B64\u8BE5\u6837\u5F0F\u8868\u6CA1\u6709\u88AB\u8BFB\u53D6\u3002\u5141\u8BB8\u5BFC\u5165\u7684\u6837\u5F0F\u8868\u7684\u6700\u5927\u6570\u76EE\u4E3A{1}\u3002 +error.css.import.failure=\u8F93\u5165\u4E2D\u542B\u6709\u7684\u8FDC\u7A0B\u6837\u5F0F\u8868\u4F4D\u4E8E{0}\uFF0C\u6B64\u6837\u5F0F\u8868\u6CA1\u6CD5\u88AB\u8BFB\u53D6\u3002\u7F51\u7AD9\u53EF\u80FD\u5173\u95ED\u6216\u8005\u4E3B\u673A\u6CA1\u6CD5\u88AB\u8BBF\u95EE\u3002\u8FD9\u4E0D\u5E94\u8BE5\u5F71\u54CD\u8F93\u5165\u7684\u683C\u5F0F\u3002 +error.css.import.toolarge=\u4F4D\u4E8E{0}\u7684\u6837\u5F0F\u8868\u4F7F\u5F97\u603B\u8F93\u5165\u592A\u5927\uFF0C\u56E0\u6B64\u6CA1\u6709\u88AB\u5BFC\u5165\u3002\u5141\u8BB8\u7684\u6700\u5927\u8F93\u5165\u4E3A{1}\u5B57\u8282\u3002 +error.css.import.url.invalid=\u51FA\u4E8E\u5B89\u5168\u7684\u539F\u56E0\uFF0C\u7528\u4E8E\u5BFC\u5165\u6837\u5F0F\u8868\u7684url\u6CA1\u6CD5\u88AB\u63A5\u53D7\u3002\u6B64url\u662F{1}\u3002 +error.css.stylesheet.relative=\u6837\u5F0F\u8868\u5F15\u7528\u4E86\u4E00\u4E2A\u6CA1\u6CD5\u8BFB\u53D6\u7684\u76F8\u5BF9\u6837\u5F0F\u8868\"{0}\"\u3002 +error.css.tag.relative=\u6807\u8BB0{0}\u4E2D\u7684\u4E00\u4E2A\u6837\u5F0F\u5C5E\u6027\u6307\u5B9A\u4E86\u4E00\u4E2A\u6CA1\u6CD5\u8BFB\u53D6\u7684\u76F8\u5BF9\u6837\u5F0F\u8868\u5E94\u7528\"{0}\"\u3002 +error.css.stylesheet.rule.notfound=\u6837\u5F0F\u8868\u4F7F\u7528\u4E86\u4E00\u4E2A\u4E0D\u88AB\u652F\u6301\u7684\u89C4\u5219\"{0}\"\u3002\u51FA\u4E8E\u5B89\u5168\u7684\u539F\u56E0\uFF0C\u6B64\u89C4\u5219\u5DF2\u88AB\u53BB\u6389\u3002 +error.css.tag.rule.notfound=\u6807\u8BB0{0}\u4E2D\u7684\u4E00\u4E2A\u6837\u5F0F\u5C5E\u6027\u4F7F\u7528\u4E86\u4E00\u4E2A\u4E0D\u88AB\u652F\u6301\u7684\u89C4\u5219\"{0}\"\u3002\u51FA\u4E8E\u5B89\u5168\u7684\u539F\u56E0\uFF0C\u6B64\u89C4\u5219\u5DF2\u88AB\u53BB\u6389\u3002 +error.css.stylesheet.selector.notfound=\u6837\u5F0F\u8868\u4F7F\u7528\u4E86\u4E00\u4E2A\u6CA1\u6CD5\u5904\u7406\u7684\u9009\u62E9\u5668\"{0}\"\u3002\u51FA\u4E8E\u5B89\u5168\u7684\u539F\u56E0\uFF0C\u6B64\u9009\u62E9\u5668\u5DF2\u88AB\u53BB\u6389\u3002 +error.css.tag.selector.notfound=\u6807\u8BB0{0}\u4E2D\u7684\u4E00\u4E2A\u6837\u5F0F\u5C5E\u6027\u4F7F\u7528\u4E86\u4E00\u4E2A\u6CA1\u6CD5\u5904\u7406\u7684\u9009\u62E9\u5668\"{0}\"\u3002\u51FA\u4E8E\u5B89\u5168\u7684\u539F\u56E0\uFF0C\u6B64\u89C4\u5219\u5DF2\u88AB\u53BB\u6389\u3002 +error.css.stylesheet.selector.disallowed=\u6837\u5F0F\u8868\u4F7F\u7528\u4E86\u4E00\u4E2A\u9009\u62E9\u5668\"{0}\"\u3002\u51FA\u4E8E\u5B89\u5168\u7684\u539F\u56E0\uFF0C\u6B64\u9009\u62E9\u5668\u4E0D\u88AB\u5141\u8BB8\u3002 +error.css.tag.selector.disallowed=\u6807\u8BB0{0}\u4E2D\u7684\u4E00\u4E2A\u6837\u5F0F\u5C5E\u6027\u4F7F\u7528\u4E86\u4E00\u4E2A\u9009\u62E9\u5668\"{1}\"\u3002\u51FA\u4E8E\u5B89\u5168\u7684\u539F\u56E0\uFF0C\u6B64\u9009\u62E9\u5668\u4E0D\u88AB\u5141\u8BB8\u3002 +error.css.stylesheet.property.invalid=\u6837\u5F0F\u8868\u542B\u6709\u4E00\u4E2A\u5C5E\uFF08property)\"{0}\"\u3002\u51FA\u4E8E\u5B89\u5168\u7684\u539F\u56E0\uFF0C\u6B64\u5C5E\u6027\u4E0D\u88AB\u5141\u8BB8\u3002 +error.css.tag.property.invalid=\u6807\u8BB0{0}\u4E2D\u542B\u6709\u4E00\u4E2A\u6837\u5F0F\u5C5E\u6027\"{1}\"\u3002\u51FA\u4E8E\u5B89\u5168\u7684\u539F\u56E0\uFF0C\u6B64\u5C5E\u6027\u4E0D\u88AB\u5141\u8BB8\u3002 diff --git a/jnpf-java-boot/jnpf-admin/src/main/resources/antisamy-ebay-imgonlybase64.xml b/jnpf-java-boot/jnpf-admin/src/main/resources/antisamy-ebay-imgonlybase64.xml new file mode 100644 index 0000000..a3794be --- /dev/null +++ b/jnpf-java-boot/jnpf-admin/src/main/resources/antisamy-ebay-imgonlybase64.xml @@ -0,0 +1,2453 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + g + grin + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jnpf-java-boot/jnpf-admin/src/main/resources/antisamy-ebay.xml b/jnpf-java-boot/jnpf-admin/src/main/resources/antisamy-ebay.xml new file mode 100644 index 0000000..46f7f89 --- /dev/null +++ b/jnpf-java-boot/jnpf-admin/src/main/resources/antisamy-ebay.xml @@ -0,0 +1,2455 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + g + grin + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jnpf-java-boot/jnpf-admin/src/main/resources/antisamy-empty.xml b/jnpf-java-boot/jnpf-admin/src/main/resources/antisamy-empty.xml new file mode 100644 index 0000000..24f851c --- /dev/null +++ b/jnpf-java-boot/jnpf-admin/src/main/resources/antisamy-empty.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jnpf-java-boot/jnpf-admin/src/main/resources/application-dev.yml b/jnpf-java-boot/jnpf-admin/src/main/resources/application-dev.yml new file mode 100644 index 0000000..5dd44cc --- /dev/null +++ b/jnpf-java-boot/jnpf-admin/src/main/resources/application-dev.yml @@ -0,0 +1,232 @@ +# 应用服务器 +server: + tomcat: + uri-encoding: UTF-8 #tomcat编码 + port: 30000 #tomcat端口 + +spring: + devtools: #spring开发者工具模块 + restart: + enabled: true #热部署开关 + freemarker: + cache: false #spring内置freemarker缓存 + thymeleaf: + cache: false #spring内置thymeleaf缓存 + + # ===================== 数据源配置 ===================== + exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure #排除自动配置,手动配置druid + datasource: + db-type: MySQL #数据库类型(可选值 MySQL、SQLServer、Oracle、DM8、KingbaseES、PostgreSQL,请严格按可选值填写) + host: 222.71.165.188 + port: 3309 + username: root + password: linus,.123 + db-name: jnpf_zhihui + db-schema: #金仓达梦选填 + prepare-url: #自定义url + + # ===================== 动态多数据源 ===================== + dynamic: + primary: master #设置默认的数据源或者数据源组,默认值即为master + strict: true #严格匹配数据源,默认false. true未匹配到指定数据源时抛异常,false使用默认数据源 + druid: + # 空闲时执行连接测试 + test-while-idle: true + # 连接测试最小间隔 + time-between-eviction-runs-millis: 60000 + # 获取连接等待3秒 根据网络情况设定 + max-wait: 3000 + # 初始化4个连接 + initial-size: 4 + # 最大20个连接 + max-active: 20 + # 最少保持4个空闲连接 + min-idle: 4 + # 空闲连接保活, 超过配置的空闲时间会进行连接检查完成保活操作(数据库自身会断开达到空闲时间的连接, 程序使用断开的连接会报错) + keep-alive: true + # 解除注释后Druid连接池打印SQL语句 忽略日志等级配置 + #filters: slf4j + slf4j: + statementLogEnabled: true + resultSetLogEnabled: false + connectionLogEnabled: false + dataSourceLogEnabled: false + statementCreateAfterLogEnabled: false + statementCloseAfterLogEnabled: false + statementExecuteAfterLogEnabled: false + #打印SQL替换参数 + statementExecutableSqlLogEnable: true + statementPrepareAfterLogEnabled: false + statementPrepareCallAfterLogEnabled: false + statementParameterSetLogEnabled: false + # datasource: + # master: + # url: jdbc:mysql://${spring.datasource.host}:${spring.datasource.port}/${spring.datasource.dbname}?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowMultiQueries=true&serverTimezone=UTC + # username: ${spring.datasource.username} + # password: ${spring.datasource.password} + # driver-class-name: com.mysql.cj.jdbc.Driver + + # ===================== Redis配置 ===================== + # redis单机模式 + redis: + database: 1 #缓存库编号 + host: 127.0.0.1 + port: 6379 +# password: 123456 # 密码为空时,请将本行注释 + timeout: 3000 #超时时间(单位:秒) + lettuce: #Lettuce为Redis的Java驱动包 + pool: + max-active: 8 # 连接池最大连接数 + max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制) + min-idle: 0 # 连接池中的最小空闲连接 + max-idle: 8 # 连接池中的最大空闲连接 + +# redis集群模式 +# redis: +# cluster: +# nodes: +# - 192.168.0.225:6380 +# - 192.168.0.225:6381 +# - 192.168.0.225:6382 +# - 192.168.0.225:6383 +# - 192.168.0.225:6384 +# - 192.168.0.225:6385 +# password: 123456 # 密码为空时,请将本行注释 +# timeout: 3000 # 超时时间(单位:秒) +# lettuce: #Lettuce为Redis的Java驱动包 +# pool: +# max-active: 8 # 连接池最大连接数 +# max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制) +# min-idle: 0 # 连接池中的最小空闲连接 +# max-idle: 8 # 连接池中的最大空闲连接 + +# SpringDoc接口文档 访问地址:http://127.0.0.1:30000/doc.html +springdoc: + default-flat-param-object: true + api-docs: + enabled: true +#SpringDoc增强 +#knife4j: +# basic: #接口文档访问鉴权 +# enable: true +# username: jnpf +# password: 123456 + +config: + # ===================== 是否开启测试环境 ===================== + TestVersion: false + # ===================== ApacheShardingSphere 配置开关 ===================== + sharding-sphere-enabled: false + # ===================== 文件存储配置 ===================== + file-storage: #文件存储配置,不使用的情况下可以不写 + default-platform: local-plus-1 #默认使用的存储平台 + thumbnail-suffix: ".min.jpg" #缩略图后缀,例如【.min.jpg】【.png】 + local-plus: # 本地存储升级版 + - platform: local-plus-1 # 存储平台标识 + enable-storage: true #启用存储 + enable-access: true #启用访问(线上请使用 Nginx 配置,效率更高) + domain: "" # 访问域名,例如:“http://127.0.0.1:8030/”,注意后面要和 path-patterns 保持一致,“/”结尾,本地存储建议使用相对路径,方便后期更换域名 + base-path: D:/project/jnpf-resources/ # 基础路径 + path-patterns: /** # 访问路径 + storage-path: # 存储路径 + aliyun-oss: # 阿里云 OSS ,不使用的情况下可以不写 + - platform: aliyun-oss-1 # 存储平台标识 + enable-storage: false # 启用存储 + access-key: ?? + secret-key: ?? + end-point: ?? + bucket-name: ?? + domain: ?? # 访问域名,注意“/”结尾,例如:https://abc.oss-cn-shanghai.aliyuncs.com/ + base-path: hy/ # 基础路径 + qiniu-kodo: # 七牛云 kodo ,不使用的情况下可以不写 + - platform: qiniu-kodo-1 # 存储平台标识 + enable-storage: false # 启用存储 + access-key: ?? + secret-key: ?? + bucket-name: ?? + domain: ?? # 访问域名,注意“/”结尾,例如:http://abc.hn-bkt.clouddn.com/ + base-path: base/ # 基础路径 + tencent-cos: # 腾讯云 COS + - platform: tencent-cos-1 # 存储平台标识 + enable-storage: false # 启用存储 + secret-id: ?? + secret-key: ?? + region: ?? #存仓库所在地域 + bucket-name: ?? + domain: ?? # 访问域名,注意“/”结尾,例如:https://abc.cos.ap-nanjing.myqcloud.com/ + base-path: hy/ # 基础路径 + minio: # MinIO,由于 MinIO SDK 支持 AWS S3,其它兼容 AWS S3 协议的存储平台也都可配置在这里 + - platform: minio-1 # 存储平台标识 + enable-storage: true # 启用存储 + access-key: Q9jJs2b6Tv + secret-key: Thj2WkpLu9DhmJyJ + end-point: http://192.168.0.207:9000/ + bucket-name: jnpfsoftoss + domain: # 访问域名,注意“/”结尾,例如:http://minio.abc.com/abc/ + base-path: # 基础路径 + +# ===================== 第三方登录配置 ===================== +socials: + # 第三方登录功能开关(false-关闭,true-开启) + socials-enabled: false + config: + - # 微信 + provider: wechat_open + client-id: your-client-id + client-secret: your-client-secret + - # qq + provider: qq + client-id: your-client-id + client-secret: your-client-secret + - # 企业微信 + provider: wechat_enterprise + client-id: your-client-id + client-secret: your-client-secret + agentId: your-agentId + - # 钉钉 + provider: dingtalk + client-id: your-client-id + client-secret: your-client-secret + agentId: your-agentId + - # 飞书 + provider: feishu + client-id: your-client-id + client-secret: your-client-secret + - # 小程序 + provider: wechat_applets + client-id: your-client-id + client-secret: your-client-secret + +# ===================== 任务调度配置 ===================== +xxl: + job: + accessToken: '' + i18n: zh_CN + logretentiondays: 30 + triggerpool: + fast: + max: 200 + slow: + max: 100 + # xxl-job服务端地址 + admin: + addresses: http://127.0.0.1:30020/xxl-job-admin/ + executor: + address: '' + appname: xxl-job-executor-sample1 + ip: '' + logpath: /data/applogs/xxl-job/jobhandler + logretentiondays: 30 + port: 9999 + # rest调用xxl-job接口地址 + admin: + register: + handle-query-address: ${xxl.job.admin.addresses}api/handler/queryList + job-info-address: ${xxl.job.admin.addresses}api/jobinfo + log-query-address: ${xxl.job.admin.addresses}api/log + task-list-address: ${xxl.job.admin.addresses}api/ScheduleTask/List + task-info-address: ${xxl.job.admin.addresses}api/ScheduleTask/getInfo + task-save-address: ${xxl.job.admin.addresses}api/ScheduleTask + task-update-address: ${xxl.job.admin.addresses}api/ScheduleTask + task-remove-address: ${xxl.job.admin.addresses}api/ScheduleTask/remove + task-start-or-remove-address: ${xxl.job.admin.addresses}api/ScheduleTask/updateTask diff --git a/jnpf-java-boot/jnpf-admin/src/main/resources/application-preview.yml b/jnpf-java-boot/jnpf-admin/src/main/resources/application-preview.yml new file mode 100644 index 0000000..6b1dd9a --- /dev/null +++ b/jnpf-java-boot/jnpf-admin/src/main/resources/application-preview.yml @@ -0,0 +1,194 @@ +# 应用服务器 +server: + tomcat: + uri-encoding: UTF-8 #tomcat编码 + port: 30000 #tomcat端口 + +spring: + devtools: #spring开发者工具模块 + restart: + enabled: true #热部署开关 + freemarker: + cache: false #spring内置freemarker缓存 + thymeleaf: + cache: false #spring内置thymeleaf缓存 + + # ===================== 数据源配置 ===================== + exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure #排除自动配置,手动配置druid + datasource: + db-type: MySQL #数据库类型(可选值 MySQL、SQLServer、Oracle、DM8、KingbaseES、PostgreSQL,请严格按可选值填写) + host: 192.168.0.210 + port: 3306 + username: java_boot_test + password: pBx5HaW6WMGSTdDf + db-name: java_boot_test + db-schema: #金仓达梦选填 + prepare-url: #自定义url + + # ===================== 动态多数据源 ===================== + dynamic: + primary: master #设置默认的数据源或者数据源组,默认值即为master + strict: true #严格匹配数据源,默认false. true未匹配到指定数据源时抛异常,false使用默认数据源 + druid: + #定时执行数据链接检测语句 防止数据库闲时超时断开链接 + test-while-idle: true #空闲时执行 + time-between-eviction-runs-millis: 60000 #执行间隔 + # datasource: + # master: + # url: jdbc:mysql://${spring.datasource.host}:${spring.datasource.port}/${spring.datasource.dbname}?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowMultiQueries=true&serverTimezone=UTC + # username: ${spring.datasource.username} + # password: ${spring.datasource.password} + # driver-class-name: com.mysql.cj.jdbc.Driver + + # ===================== Redis配置 ===================== + # redis单机模式 + redis: + database: 1 #缓存库编号 + host: 192.168.0.220 + port: 6379 + password: 123456 # 密码为空时,请将本行注释 + timeout: 3000 #超时时间(单位:秒) + lettuce: #Lettuce为Redis的Java驱动包 + pool: + max-active: 8 # 连接池最大连接数 + max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制) + min-idle: 0 # 连接池中的最小空闲连接 + max-idle: 8 # 连接池中的最大空闲连接 + +# redis集群模式 +# redis: +# cluster: +# nodes: +# - 192.168.0.225:6380 +# - 192.168.0.225:6381 +# - 192.168.0.225:6382 +# - 192.168.0.225:6383 +# - 192.168.0.225:6384 +# - 192.168.0.225:6385 +# password: 123456 # 密码为空时,请将本行注释 +# timeout: 3000 # 超时时间(单位:秒) +# lettuce: #Lettuce为Redis的Java驱动包 +# pool: +# max-active: 8 # 连接池最大连接数 +# max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制) +# min-idle: 0 # 连接池中的最小空闲连接 +# max-idle: 8 # 连接池中的最大空闲连接 + +config: + # ===================== 是否开启测试环境 ===================== + TestVersion: false + # ===================== ApacheShardingSphere 配置开关 ===================== + sharding-sphere-enabled: false + # ===================== 文件存储配置 ===================== + file-storage: #文件存储配置,不使用的情况下可以不写 + default-platform: local-plus-1 #默认使用的存储平台 + thumbnail-suffix: ".min.jpg" #缩略图后缀,例如【.min.jpg】【.png】 + local-plus: # 本地存储升级版 + - platform: local-plus-1 # 存储平台标识 + enable-storage: true #启用存储 + enable-access: true #启用访问(线上请使用 Nginx 配置,效率更高) + domain: "" # 访问域名,例如:“http://127.0.0.1:8030/”,注意后面要和 path-patterns 保持一致,“/”结尾,本地存储建议使用相对路径,方便后期更换域名 + base-path: F:/work/jnpf-resources/ # 基础路径 + path-patterns: /** # 访问路径 + storage-path: # 存储路径 + aliyun-oss: # 阿里云 OSS ,不使用的情况下可以不写 + - platform: aliyun-oss-1 # 存储平台标识 + enable-storage: false # 启用存储 + access-key: ?? + secret-key: ?? + end-point: ?? + bucket-name: ?? + domain: ?? # 访问域名,注意“/”结尾,例如:https://abc.oss-cn-shanghai.aliyuncs.com/ + base-path: hy/ # 基础路径 + qiniu-kodo: # 七牛云 kodo ,不使用的情况下可以不写 + - platform: qiniu-kodo-1 # 存储平台标识 + enable-storage: false # 启用存储 + access-key: ?? + secret-key: ?? + bucket-name: ?? + domain: ?? # 访问域名,注意“/”结尾,例如:http://abc.hn-bkt.clouddn.com/ + base-path: base/ # 基础路径 + tencent-cos: # 腾讯云 COS + - platform: tencent-cos-1 # 存储平台标识 + enable-storage: false # 启用存储 + secret-id: ?? + secret-key: ?? + region: ?? #存仓库所在地域 + bucket-name: ?? + domain: ?? # 访问域名,注意“/”结尾,例如:https://abc.cos.ap-nanjing.myqcloud.com/ + base-path: hy/ # 基础路径 + minio: # MinIO,由于 MinIO SDK 支持 AWS S3,其它兼容 AWS S3 协议的存储平台也都可配置在这里 + - platform: minio-1 # 存储平台标识 + enable-storage: true # 启用存储 + access-key: Q9jJs2b6Tv + secret-key: Thj2WkpLu9DhmJyJ + end-point: http://192.168.0.207:9000/ + bucket-name: jnpfsoftoss + domain: # 访问域名,注意“/”结尾,例如:http://minio.abc.com/abc/ + base-path: # 基础路径 + +# ===================== 第三方登录配置 ===================== +socials: + # 第三方登录功能开关(false-关闭,true-开启) + socials-enabled: false + config: + - # 微信 + provider: wechat_open + client-id: your-client-id + client-secret: your-client-secret + - # qq + provider: qq + client-id: your-client-id + client-secret: your-client-secret + - # 企业微信 + provider: wechat_enterprise + client-id: your-client-id + client-secret: your-client-secret + agentId: your-agentId + - # 钉钉 + provider: dingtalk + client-id: your-client-id + client-secret: your-client-secret + agentId: your-agentId + - # 飞书 + provider: feishu + client-id: your-client-id + client-secret: your-client-secret + - # 小程序 + provider: wechat_applets + client-id: your-client-id + client-secret: your-client-secret + +# ===================== 任务调度配置 ===================== +xxl: + job: + accessToken: '' + i18n: zh_CN + logretentiondays: 30 + triggerpool: + fast: + max: 200 + slow: + max: 100 + # xxl-job服务端地址 + admin: + addresses: http://127.0.0.1:30020/xxl-job-admin/ + executor: + address: '' + appname: xxl-job-executor-sample1 + ip: '' + logpath: /data/applogs/xxl-job/jobhandler + logretentiondays: 30 + port: 9999 + # rest调用xxl-job接口地址 + admin: + register: + handle-query-address: ${xxl.job.admin.addresses}api/handler/queryList + job-info-address: ${xxl.job.admin.addresses}api/jobinfo + log-query-address: ${xxl.job.admin.addresses}api/log + task-list-address: ${xxl.job.admin.addresses}api/ScheduleTask/List + task-info-address: ${xxl.job.admin.addresses}api/ScheduleTask/getInfo + task-save-address: ${xxl.job.admin.addresses}api/ScheduleTask + task-update-address: ${xxl.job.admin.addresses}api/ScheduleTask + task-remove-address: ${xxl.job.admin.addresses}api/ScheduleTask/remove + task-start-or-remove-address: ${xxl.job.admin.addresses}api/ScheduleTask/updateTask \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-admin/src/main/resources/application-pro.yml b/jnpf-java-boot/jnpf-admin/src/main/resources/application-pro.yml new file mode 100644 index 0000000..58dd00d --- /dev/null +++ b/jnpf-java-boot/jnpf-admin/src/main/resources/application-pro.yml @@ -0,0 +1,194 @@ +# 应用服务器 +server: + tomcat: + uri-encoding: UTF-8 #tomcat编码 + port: 30000 #tomcat端口 + +spring: + devtools: #spring开发者工具模块 + restart: + enabled: true #热部署开关 + freemarker: + cache: false #spring内置freemarker缓存 + thymeleaf: + cache: false #spring内置thymeleaf缓存 + + # ===================== 数据源配置 ===================== + exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure #排除自动配置,手动配置druid + datasource: + db-type: MySQL #数据库类型(可选值 MySQL、SQLServer、Oracle、DM8、KingbaseES、PostgreSQL,请严格按可选值填写) + host: 192.168.0.210 + port: 3306 + username: java_boot_test + password: pBx5HaW6WMGSTdDf + db-name: java_boot_test + db-schema: #金仓达梦选填 + prepare-url: #自定义url + + # ===================== 动态多数据源 ===================== + dynamic: + primary: master #设置默认的数据源或者数据源组,默认值即为master + strict: true #严格匹配数据源,默认false. true未匹配到指定数据源时抛异常,false使用默认数据源 + druid: + #定时执行数据链接检测语句 防止数据库闲时超时断开链接 + test-while-idle: true #空闲时执行 + time-between-eviction-runs-millis: 60000 #执行间隔 + # datasource: + # master: + # url: jdbc:mysql://${spring.datasource.host}:${spring.datasource.port}/${spring.datasource.dbname}?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowMultiQueries=true&serverTimezone=UTC + # username: ${spring.datasource.username} + # password: ${spring.datasource.password} + # driver-class-name: com.mysql.cj.jdbc.Driver + + # ===================== Redis配置 ===================== + # redis单机模式 + redis: + database: 1 #缓存库编号 + host: 192.168.0.220 + port: 6379 + password: 123456 # 密码为空时,请将本行注释 + timeout: 3000 #超时时间(单位:秒) + lettuce: #Lettuce为Redis的Java驱动包 + pool: + max-active: 8 # 连接池最大连接数 + max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制) + min-idle: 0 # 连接池中的最小空闲连接 + max-idle: 8 # 连接池中的最大空闲连接 + +# redis集群模式 +# redis: +# cluster: +# nodes: +# - 192.168.0.225:6380 +# - 192.168.0.225:6381 +# - 192.168.0.225:6382 +# - 192.168.0.225:6383 +# - 192.168.0.225:6384 +# - 192.168.0.225:6385 +# password: 123456 # 密码为空时,请将本行注释 +# timeout: 3000 # 超时时间(单位:秒) +# lettuce: #Lettuce为Redis的Java驱动包 +# pool: +# max-active: 8 # 连接池最大连接数 +# max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制) +# min-idle: 0 # 连接池中的最小空闲连接 +# max-idle: 8 # 连接池中的最大空闲连接 + +config: + # ===================== 是否开启测试环境 ===================== + TestVersion: false + # ===================== ApacheShardingSphere 配置开关 ===================== + sharding-sphere-enabled: false + # ===================== 文件存储配置 ===================== + file-storage: #文件存储配置,不使用的情况下可以不写 + default-platform: local-plus-1 #默认使用的存储平台 + thumbnail-suffix: ".min.jpg" #缩略图后缀,例如【.min.jpg】【.png】 + local-plus: # 本地存储升级版 + - platform: local-plus-1 # 存储平台标识 + enable-storage: true #启用存储 + enable-access: true #启用访问(线上请使用 Nginx 配置,效率更高) + domain: "" # 访问域名,例如:“http://127.0.0.1:8030/”,注意后面要和 path-patterns 保持一致,“/”结尾,本地存储建议使用相对路径,方便后期更换域名 + base-path: F:/work/jnpf-resources/ # 基础路径 + path-patterns: /** # 访问路径 + storage-path: # 存储路径 + aliyun-oss: # 阿里云 OSS ,不使用的情况下可以不写 + - platform: aliyun-oss-1 # 存储平台标识 + enable-storage: false # 启用存储 + access-key: ?? + secret-key: ?? + end-point: ?? + bucket-name: ?? + domain: ?? # 访问域名,注意“/”结尾,例如:https://abc.oss-cn-shanghai.aliyuncs.com/ + base-path: hy/ # 基础路径 + qiniu-kodo: # 七牛云 kodo ,不使用的情况下可以不写 + - platform: qiniu-kodo-1 # 存储平台标识 + enable-storage: false # 启用存储 + access-key: ?? + secret-key: ?? + bucket-name: ?? + domain: ?? # 访问域名,注意“/”结尾,例如:http://abc.hn-bkt.clouddn.com/ + base-path: base/ # 基础路径 + tencent-cos: # 腾讯云 COS + - platform: tencent-cos-1 # 存储平台标识 + enable-storage: false # 启用存储 + secret-id: ?? + secret-key: ?? + region: ?? #存仓库所在地域 + bucket-name: ?? + domain: ?? # 访问域名,注意“/”结尾,例如:https://abc.cos.ap-nanjing.myqcloud.com/ + base-path: hy/ # 基础路径 + minio: # MinIO,由于 MinIO SDK 支持 AWS S3,其它兼容 AWS S3 协议的存储平台也都可配置在这里 + - platform: minio-1 # 存储平台标识 + enable-storage: true # 启用存储 + access-key: Q9jJs2b6Tv + secret-key: Thj2WkpLu9DhmJyJ + end-point: http://192.168.0.207:9000/ + bucket-name: jnpfsoftoss + domain: # 访问域名,注意“/”结尾,例如:http://minio.abc.com/abc/ + base-path: # 基础路径 + +# ===================== 第三方登录配置 ===================== +socials: + # 第三方登录功能开关(false-关闭,true-开启) + socials-enabled: false + config: + - # 微信 + provider: wechat_open + client-id: your-client-id + client-secret: your-client-secret + - # qq + provider: qq + client-id: your-client-id + client-secret: your-client-secret + - # 企业微信 + provider: wechat_enterprise + client-id: your-client-id + client-secret: your-client-secret + agentId: your-agentId + - # 钉钉 + provider: dingtalk + client-id: your-client-id + client-secret: your-client-secret + agentId: your-agentId + - # 飞书 + provider: feishu + client-id: your-client-id + client-secret: your-client-secret + - # 小程序 + provider: wechat_applets + client-id: your-client-id + client-secret: your-client-secret + +# ===================== 任务调度配置 ===================== +xxl: + job: + accessToken: '' + i18n: zh_CN + logretentiondays: 30 + triggerpool: + fast: + max: 200 + slow: + max: 100 + # xxl-job服务端地址 + admin: + addresses: http://127.0.0.1:30020/xxl-job-admin/ + executor: + address: '' + appname: xxl-job-executor-sample1 + ip: '' + logpath: /data/applogs/xxl-job/jobhandler + logretentiondays: 30 + port: 9999 + # rest调用xxl-job接口地址 + admin: + register: + handle-query-address: ${xxl.job.admin.addresses}api/handler/queryList + job-info-address: ${xxl.job.admin.addresses}api/jobinfo + log-query-address: ${xxl.job.admin.addresses}api/log + task-list-address: ${xxl.job.admin.addresses}api/ScheduleTask/List + task-info-address: ${xxl.job.admin.addresses}api/ScheduleTask/getInfo + task-save-address: ${xxl.job.admin.addresses}api/ScheduleTask + task-update-address: ${xxl.job.admin.addresses}api/ScheduleTask + task-remove-address: ${xxl.job.admin.addresses}api/ScheduleTask/remove + task-start-or-remove-address: ${xxl.job.admin.addresses}api/ScheduleTask/updateTask diff --git a/jnpf-java-boot/jnpf-admin/src/main/resources/application-test.yml b/jnpf-java-boot/jnpf-admin/src/main/resources/application-test.yml new file mode 100644 index 0000000..58dd00d --- /dev/null +++ b/jnpf-java-boot/jnpf-admin/src/main/resources/application-test.yml @@ -0,0 +1,194 @@ +# 应用服务器 +server: + tomcat: + uri-encoding: UTF-8 #tomcat编码 + port: 30000 #tomcat端口 + +spring: + devtools: #spring开发者工具模块 + restart: + enabled: true #热部署开关 + freemarker: + cache: false #spring内置freemarker缓存 + thymeleaf: + cache: false #spring内置thymeleaf缓存 + + # ===================== 数据源配置 ===================== + exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure #排除自动配置,手动配置druid + datasource: + db-type: MySQL #数据库类型(可选值 MySQL、SQLServer、Oracle、DM8、KingbaseES、PostgreSQL,请严格按可选值填写) + host: 192.168.0.210 + port: 3306 + username: java_boot_test + password: pBx5HaW6WMGSTdDf + db-name: java_boot_test + db-schema: #金仓达梦选填 + prepare-url: #自定义url + + # ===================== 动态多数据源 ===================== + dynamic: + primary: master #设置默认的数据源或者数据源组,默认值即为master + strict: true #严格匹配数据源,默认false. true未匹配到指定数据源时抛异常,false使用默认数据源 + druid: + #定时执行数据链接检测语句 防止数据库闲时超时断开链接 + test-while-idle: true #空闲时执行 + time-between-eviction-runs-millis: 60000 #执行间隔 + # datasource: + # master: + # url: jdbc:mysql://${spring.datasource.host}:${spring.datasource.port}/${spring.datasource.dbname}?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowMultiQueries=true&serverTimezone=UTC + # username: ${spring.datasource.username} + # password: ${spring.datasource.password} + # driver-class-name: com.mysql.cj.jdbc.Driver + + # ===================== Redis配置 ===================== + # redis单机模式 + redis: + database: 1 #缓存库编号 + host: 192.168.0.220 + port: 6379 + password: 123456 # 密码为空时,请将本行注释 + timeout: 3000 #超时时间(单位:秒) + lettuce: #Lettuce为Redis的Java驱动包 + pool: + max-active: 8 # 连接池最大连接数 + max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制) + min-idle: 0 # 连接池中的最小空闲连接 + max-idle: 8 # 连接池中的最大空闲连接 + +# redis集群模式 +# redis: +# cluster: +# nodes: +# - 192.168.0.225:6380 +# - 192.168.0.225:6381 +# - 192.168.0.225:6382 +# - 192.168.0.225:6383 +# - 192.168.0.225:6384 +# - 192.168.0.225:6385 +# password: 123456 # 密码为空时,请将本行注释 +# timeout: 3000 # 超时时间(单位:秒) +# lettuce: #Lettuce为Redis的Java驱动包 +# pool: +# max-active: 8 # 连接池最大连接数 +# max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制) +# min-idle: 0 # 连接池中的最小空闲连接 +# max-idle: 8 # 连接池中的最大空闲连接 + +config: + # ===================== 是否开启测试环境 ===================== + TestVersion: false + # ===================== ApacheShardingSphere 配置开关 ===================== + sharding-sphere-enabled: false + # ===================== 文件存储配置 ===================== + file-storage: #文件存储配置,不使用的情况下可以不写 + default-platform: local-plus-1 #默认使用的存储平台 + thumbnail-suffix: ".min.jpg" #缩略图后缀,例如【.min.jpg】【.png】 + local-plus: # 本地存储升级版 + - platform: local-plus-1 # 存储平台标识 + enable-storage: true #启用存储 + enable-access: true #启用访问(线上请使用 Nginx 配置,效率更高) + domain: "" # 访问域名,例如:“http://127.0.0.1:8030/”,注意后面要和 path-patterns 保持一致,“/”结尾,本地存储建议使用相对路径,方便后期更换域名 + base-path: F:/work/jnpf-resources/ # 基础路径 + path-patterns: /** # 访问路径 + storage-path: # 存储路径 + aliyun-oss: # 阿里云 OSS ,不使用的情况下可以不写 + - platform: aliyun-oss-1 # 存储平台标识 + enable-storage: false # 启用存储 + access-key: ?? + secret-key: ?? + end-point: ?? + bucket-name: ?? + domain: ?? # 访问域名,注意“/”结尾,例如:https://abc.oss-cn-shanghai.aliyuncs.com/ + base-path: hy/ # 基础路径 + qiniu-kodo: # 七牛云 kodo ,不使用的情况下可以不写 + - platform: qiniu-kodo-1 # 存储平台标识 + enable-storage: false # 启用存储 + access-key: ?? + secret-key: ?? + bucket-name: ?? + domain: ?? # 访问域名,注意“/”结尾,例如:http://abc.hn-bkt.clouddn.com/ + base-path: base/ # 基础路径 + tencent-cos: # 腾讯云 COS + - platform: tencent-cos-1 # 存储平台标识 + enable-storage: false # 启用存储 + secret-id: ?? + secret-key: ?? + region: ?? #存仓库所在地域 + bucket-name: ?? + domain: ?? # 访问域名,注意“/”结尾,例如:https://abc.cos.ap-nanjing.myqcloud.com/ + base-path: hy/ # 基础路径 + minio: # MinIO,由于 MinIO SDK 支持 AWS S3,其它兼容 AWS S3 协议的存储平台也都可配置在这里 + - platform: minio-1 # 存储平台标识 + enable-storage: true # 启用存储 + access-key: Q9jJs2b6Tv + secret-key: Thj2WkpLu9DhmJyJ + end-point: http://192.168.0.207:9000/ + bucket-name: jnpfsoftoss + domain: # 访问域名,注意“/”结尾,例如:http://minio.abc.com/abc/ + base-path: # 基础路径 + +# ===================== 第三方登录配置 ===================== +socials: + # 第三方登录功能开关(false-关闭,true-开启) + socials-enabled: false + config: + - # 微信 + provider: wechat_open + client-id: your-client-id + client-secret: your-client-secret + - # qq + provider: qq + client-id: your-client-id + client-secret: your-client-secret + - # 企业微信 + provider: wechat_enterprise + client-id: your-client-id + client-secret: your-client-secret + agentId: your-agentId + - # 钉钉 + provider: dingtalk + client-id: your-client-id + client-secret: your-client-secret + agentId: your-agentId + - # 飞书 + provider: feishu + client-id: your-client-id + client-secret: your-client-secret + - # 小程序 + provider: wechat_applets + client-id: your-client-id + client-secret: your-client-secret + +# ===================== 任务调度配置 ===================== +xxl: + job: + accessToken: '' + i18n: zh_CN + logretentiondays: 30 + triggerpool: + fast: + max: 200 + slow: + max: 100 + # xxl-job服务端地址 + admin: + addresses: http://127.0.0.1:30020/xxl-job-admin/ + executor: + address: '' + appname: xxl-job-executor-sample1 + ip: '' + logpath: /data/applogs/xxl-job/jobhandler + logretentiondays: 30 + port: 9999 + # rest调用xxl-job接口地址 + admin: + register: + handle-query-address: ${xxl.job.admin.addresses}api/handler/queryList + job-info-address: ${xxl.job.admin.addresses}api/jobinfo + log-query-address: ${xxl.job.admin.addresses}api/log + task-list-address: ${xxl.job.admin.addresses}api/ScheduleTask/List + task-info-address: ${xxl.job.admin.addresses}api/ScheduleTask/getInfo + task-save-address: ${xxl.job.admin.addresses}api/ScheduleTask + task-update-address: ${xxl.job.admin.addresses}api/ScheduleTask + task-remove-address: ${xxl.job.admin.addresses}api/ScheduleTask/remove + task-start-or-remove-address: ${xxl.job.admin.addresses}api/ScheduleTask/updateTask diff --git a/jnpf-java-boot/jnpf-admin/src/main/resources/application.yml b/jnpf-java-boot/jnpf-admin/src/main/resources/application.yml new file mode 100644 index 0000000..3f61acc --- /dev/null +++ b/jnpf-java-boot/jnpf-admin/src/main/resources/application.yml @@ -0,0 +1,128 @@ +spring: + application: + name: jnpf-boot + profiles: + # 指定环境配置 dev(开发环境-默认)、test(测试环境)、preview(预生产)、pro(生产环境) + active: dev + servlet: + multipart: #文件传输配置 + max-file-size: 100MB #单个数据大小限制 + max-request-size: 100MB #请求总数据大小限制 + enabled: true #是否启用分段上传支持 + mvc: + hiddenmethod: #隐式方法过滤器 + filter: + enabled: true #默认开启。开启以支持:PUT,DELETE表单提交方法 + jackson: #序列化和反序列化json框架 + serialization: + write-dates-as-timestamps: true #是否写入日期时间时间戳格式 + time-zone: GMT+8 #指定日期格式化时区 + main: + allow-bean-definition-overriding: true #允许同名bean后者覆盖,默认:true + allow-circular-references: true #允许Bean相互引用,默认:false +config: + # ===============静态资源目录映射================== + WebAnnexFilePath: WebAnnexFile + DataBackupFilePath: DataBackupFile + TemporaryFilePath: TemporaryFile + SystemFilePath: SystemFile + TemplateFilePath: TemplateFile + EmailFilePath: EmailFile + DocumentFilePath: DocumentFile + DocumentPreviewPath: DocumentPreview + UserAvatarFilePath: UserAvatar + IMContentFilePath: IMContentFile + MPMaterialFilePath: MPMaterial + TemplateCodePath: TemplateCode + BiVisualPath: BiVisualPath + # ===============功能格式限制================== + MPUploadFileType: bmp,png,jpeg,jpg,gif,mp3,wma,wav,amr,mp4 + WeChatUploadFileType: jpg,png,doc,docx,ppt,pptx,xls,xlsx,pdf,txt,rar,zip,csv,amr,mp4 + + AllowUploadImageType: jpg,gif,png,bmp,jpeg,tiff,psd,swf,svg,pcx,dxf,wmf,emf,lic,eps,tga #允许上传图片类型 + AllowUploadFileType: jpg,gif,png,bmp,jpeg,doc,docx,ppt,pptx,xls,xlsx,pdf,txt,rar,zip,csv,mp3 #允许上传文件类型 + AllowPreviewFileType: doc,docx,xls,xlsx,ppt,pptx,pdf,jpg,gif,png,bmp,jpeg #允许预览文件类型 + PreviewType: kkfile #文件预览方式 (1.yozo 2.kkfile)默认使用kkfile + kkFileUrl: http://127.0.0.1:30090/FileServer/ #kkfile文件预览服务地址 + ApiDomain: http://127.0.0.1:30000 #后端域名(文档预览中使用) + FrontDomain: http://127.0.0.1:3000 #前端域名(文档预览中使用) + AppDomain: http://127.0.0.1:8080 #app/h5端域名配置(文档预览中使用) + + CodeAreasName: example #代码生成器模块命名 + + + #===================== unipush ===================== + AppPushUrl: https://8e84eea8-6922-4033-8e86-67ad7442e692.bspapp.com/unipush + + #===================== 多租户 ===================== + MultiTenancy: false #是否开启 + MultiTenancyUrl: http://127.0.0.1:30006/api/tenant/DbName/ #多租户项目地址 + #COLUMN、SCHEMA模式 + MultiTenantType: SCHEMA + + #===================== 系统及错误报告反馈相关 ===================== + SoftName: jnpf-java-boot #项目名 + SoftFullName: JNPF快速开发平台 #项目全名 + SoftVersion: v3.5.0 #版本号 + + RecordLog: true #系统日志启用 + ErrorReport: false #软件错误报告 + ErrorReportTo: surrpot@yinmaisoft.com #软件错误报告接收者 + IgexinEnabled: true #推送启动 + + #===================== APP ===================== + AppVersion: V3.5.0 #APP版本号 + IgexinAppid: HLFY9T2d1z7MySY8hwGwh4 #APPID:应用的唯一标识 + IgexinAppkey: 6Uiduugq648YDChhCjAt59 #APPKEY:公匙(相当于账号) + IgexinMastersecret: pEyQm156SJ9iS7PbyjLCZ6 #Mastersecret:私匙(相当于密码) + AppUpdateContent: ; #APP更新内容 + + #===================== 永中office在线预览配置 ===================== + YozoDomain: //dcsapi.com/ #永中api域名 + YozoDomainKey: 57462250284462899305150 #域名key + YozoCloudDomain: //dmc.yozocloud.cn #云预览 + YozoAppId: yozoAgR41jgC0062 #appid + YozoAppKey: fc3134a9ba8bc6f4c69d635f9adf #app秘钥 + YozoEditDomain: //eic.yozocloud.cn #云编辑 + + #===================== 系统功能配置 ===================== + EnablePreAuth: false #是否开启接口鉴权 + EnableLogicDelete: false #是否开启逻辑删除 + +# 接口放行地址 与GatewayWhite中的默认URL合并 +gateway: + # 禁止访问接口 + block-url: + ## 配置示例 + #- /api/message/Notice + #- /api/permission/Users/* + # 不验证Token, 放行接口(默认记录日志) + white-url: + # # 配置示例 + #- /api/message/Notice + #- /api/permission/Users/* + # 放行接口(不记录日志) + exclude-url: + # # 配置示例 + #- /api/message/Notice + #- /api/permission/Users/* + # 入站IP(禁止配置以外的IP访问block-url配置的接口) + white-ip: + #- 192.168.0.10 + #- 192.168.0.20 + +# 日志配置 +logging: + config: classpath:logback-spring.xml + level: + #自定义第三方包名日志等级 + # 解除注释后Druid连接池打印SQL语句 + druid.sql.Statement: debug +# druid.sql.DataSource: debug +# druid.sql.Connection: debug +# druid.sql.ResultSet: debug +log: + level: + # 等级 TRACE,DEBUG,INFO,WARN,ERROR(不区分大小写) + root: info + path: log/${spring.application.name} \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-admin/src/main/resources/logback-spring.xml b/jnpf-java-boot/jnpf-admin/src/main/resources/logback-spring.xml new file mode 100644 index 0000000..ecb97e3 --- /dev/null +++ b/jnpf-java-boot/jnpf-admin/src/main/resources/logback-spring.xml @@ -0,0 +1,339 @@ + + + + + + + + + + + + + + + + + + + + ${LOG_PATH}/log_error.log + + + + + + ${LOG_PATH}/error/%d{yyyy-MM-dd,aux}/log-error-%d{yyyy-MM-dd}.%i.log + + 7 + + + + 10MB + + + + + true + + + + ${FILE_LOG_PATTERN} + utf-8 + + + + + error + ACCEPT + DENY + + + + + + + + + ${LOG_PATH}/log_info.log + + + + + + ${LOG_PATH}/info/%d{yyyy-MM-dd,aux}/log-info-%d{yyyy-MM-dd}.%i.log + + 7 + + + + 10MB + + + + + true + + + + ${FILE_LOG_PATTERN} + utf-8 + + + + + info + ACCEPT + DENY + + + + + + + + + ${LOG_PATH}/log_warn.log + + + + + + ${LOG_PATH}/warn/%d{yyyy-MM-dd,aux}/log-warn-%d{yyyy-MM-dd}.%i.log + + 7 + + + + 10MB + + + + + true + + + + ${FILE_LOG_PATTERN} + utf-8 + + + + + warn + ACCEPT + DENY + + + + + + + + ${LOG_PATH}/log_debug.log + + + + + + ${LOG_PATH}/debug/%d{yyyy-MM-dd,aux}/log-debug-%d{yyyy-MM-dd}.%i.log + + 7 + + + + 10MB + + + + + true + + + + ${FILE_LOG_PATTERN} + utf-8 + + + + + debug + ACCEPT + DENY + + + + + + + + + ${LOG_PATH}/log_total.log + + + + + + ${LOG_PATH}/total/%d{yyyy-MM-dd,aux}/log-total-%d{yyyy-MM-dd}.%i.log + + 7 + + + + 10MB + + + + + true + + + + ${FILE_LOG_PATTERN} + utf-8 + + + + + + + + + ${LOG_PATH}/log_release.log + + + + + + ${LOG_PATH}/release/%d{yyyy-MM-dd,aux}/log-warn-%d{yyyy-MM-dd}.%i.log + + 7 + + + + 10MB + + + + + true + + + + ${FILE_LOG_PATTERN} + utf-8 + + + + + ${LOG_LEVEL} + ACCEPT + DENY + + + + + 0 + 256 + + + + + 0 + 256 + + + + + 0 + 256 + + + + + 0 + 256 + + + + + 0 + 256 + + + + + + + ${CONSOLE_LOG_PATTERN} + utf-8 + + + + + + + 0 + 256 + + + + + + + + + + + + + + + + + + + diff --git a/jnpf-java-boot/jnpf-admin/src/main/resources/mapper/extend/BigDataMapper.xml b/jnpf-java-boot/jnpf-admin/src/main/resources/mapper/extend/BigDataMapper.xml new file mode 100644 index 0000000..5ea34c1 --- /dev/null +++ b/jnpf-java-boot/jnpf-admin/src/main/resources/mapper/extend/BigDataMapper.xml @@ -0,0 +1,9 @@ + + + + + + + diff --git a/jnpf-java-boot/jnpf-admin/src/main/resources/mapper/extend/DocumentMapper.xml b/jnpf-java-boot/jnpf-admin/src/main/resources/mapper/extend/DocumentMapper.xml new file mode 100644 index 0000000..7e7f590 --- /dev/null +++ b/jnpf-java-boot/jnpf-admin/src/main/resources/mapper/extend/DocumentMapper.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + UPDATE ext_document SET F_DELETEMARK=1,F_DELETETIME=NULL,F_DELETEUSERID=NULL WHERE F_Id=#{id} + + + diff --git a/jnpf-java-boot/jnpf-admin/src/main/resources/mapper/form/FormMapper.xml b/jnpf-java-boot/jnpf-admin/src/main/resources/mapper/form/FormMapper.xml new file mode 100644 index 0000000..ee8676f --- /dev/null +++ b/jnpf-java-boot/jnpf-admin/src/main/resources/mapper/form/FormMapper.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + diff --git a/jnpf-java-boot/jnpf-admin/src/main/resources/mapper/system/AuthorizeMapper.xml b/jnpf-java-boot/jnpf-admin/src/main/resources/mapper/system/AuthorizeMapper.xml new file mode 100644 index 0000000..3b3421a --- /dev/null +++ b/jnpf-java-boot/jnpf-admin/src/main/resources/mapper/system/AuthorizeMapper.xml @@ -0,0 +1,157 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO base_authorize (f_id, f_item_type, f_item_id, f_object_type, f_object_id, f_sort_code, f_creator_time, f_creator_user_id ) VALUES ${values} + + + + INSERT ALL + + INTO base_authorize (f_id, f_item_type, f_item_id, f_object_type, f_object_id, f_sort_code, f_creator_time, + f_creator_user_id ) VALUES ( + #{item.id}, + #{item.itemType}, + #{item.itemId}, + #{item.objectType}, + #{item.objectId}, + #{item.sortCode,jdbcType=NUMERIC}, + #{item.creatorTime, jdbcType=TIMESTAMP}, + #{item.creatorUserId}) + + SELECT 1 FROM DUAL + + + diff --git a/jnpf-java-boot/jnpf-admin/src/main/resources/mapper/system/ImContentMapper.xml b/jnpf-java-boot/jnpf-admin/src/main/resources/mapper/system/ImContentMapper.xml new file mode 100644 index 0000000..d697fbe --- /dev/null +++ b/jnpf-java-boot/jnpf-admin/src/main/resources/mapper/system/ImContentMapper.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + UPDATE base_im_content SET f_enabled_mark = 1, f_receive_time = #{map.receiveTime} WHERE 1 = 1 AND f_enabled_mark = 0 AND f_send_user_id = #{map.sendUserId} AND f_receive_user_id = #{map.receiveUserId} + + + diff --git a/jnpf-java-boot/jnpf-admin/src/main/resources/mapper/system/ImReplyMapper.xml b/jnpf-java-boot/jnpf-admin/src/main/resources/mapper/system/ImReplyMapper.xml new file mode 100644 index 0000000..1cbe86d --- /dev/null +++ b/jnpf-java-boot/jnpf-admin/src/main/resources/mapper/system/ImReplyMapper.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + diff --git a/jnpf-java-boot/jnpf-admin/src/main/resources/mapper/system/MessageMapper.xml b/jnpf-java-boot/jnpf-admin/src/main/resources/mapper/system/MessageMapper.xml new file mode 100644 index 0000000..17a01e0 --- /dev/null +++ b/jnpf-java-boot/jnpf-admin/src/main/resources/mapper/system/MessageMapper.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jnpf-java-boot/jnpf-admin/src/main/resources/mapper/system/PortalManageMapper.xml b/jnpf-java-boot/jnpf-admin/src/main/resources/mapper/system/PortalManageMapper.xml new file mode 100644 index 0000000..a7f92a0 --- /dev/null +++ b/jnpf-java-boot/jnpf-admin/src/main/resources/mapper/system/PortalManageMapper.xml @@ -0,0 +1,88 @@ + + + + + + SELECT + -- 门户管理表 + bpm.F_Id id, + bpm.F_Enabled_Mark enabledMark, + bpm.F_Platform platform, + bpm.F_Description description, + bpm.F_Tenant_Id tenantId, + bpm.F_Sort_Code sortCode, + bpm.F_System_Id systemId, + bpm.F_PORTAL_ID portalId, + bpm.F_Creator_Time creatorTime, + bpm.F_Last_Modify_Time lastModifyTime, + -- 门户表 + bp.F_Category categoryId, + bp.F_Full_Name portalName, + bd.F_Full_Name categoryName, + -- 用户表 + us.F_Real_Name createUserName, + us.F_Account createUserAccount, + us2.F_Real_Name modifyUserName, + us2.F_Account modifyUserAccount + FROM + base_portal_manage bpm + LEFT JOIN + base_portal bp + ON + bpm.F_Portal_Id = bp.F_Id + LEFT JOIN + base_user us + ON + bpm.F_Creator_User_Id = us.F_Id + LEFT JOIN + base_user us2 + ON + bpm.F_Last_Modify_User_Id = us2.F_Id + LEFT JOIN + base_dictionary_data bd + ON bp.F_Category = bd.F_Id + WHERE 1 = 1 + + AND (bp.F_Full_Name LIKE #{pmPage.keyword} OR bpm.F_Description LIKE #{pmPage.keyword}) + + + AND + bp.F_Category = #{pmPage.category} + + + AND + bpm.F_Enabled_Mark = #{pmPage.enabledMark} + AND bp.F_Enabled_Mark = #{pmPage.enabledMark} + + + AND + bpm.F_Platform LIKE #{pmPage.platform} + + + AND + bpm.F_System_Id = #{pmPage.systemId} + + + AND + bp.F_state != #{pmPage.state} + + + + + + + diff --git a/jnpf-java-boot/jnpf-admin/src/main/resources/mapper/system/PositionMapper.xml b/jnpf-java-boot/jnpf-admin/src/main/resources/mapper/system/PositionMapper.xml new file mode 100644 index 0000000..b4d67d1 --- /dev/null +++ b/jnpf-java-boot/jnpf-admin/src/main/resources/mapper/system/PositionMapper.xml @@ -0,0 +1,45 @@ + + + + + + + + + + diff --git a/jnpf-java-boot/jnpf-admin/src/main/resources/mapper/system/RoleMapper.xml b/jnpf-java-boot/jnpf-admin/src/main/resources/mapper/system/RoleMapper.xml new file mode 100644 index 0000000..acc88e0 --- /dev/null +++ b/jnpf-java-boot/jnpf-admin/src/main/resources/mapper/system/RoleMapper.xml @@ -0,0 +1,64 @@ + + + + + + + + + diff --git a/jnpf-java-boot/jnpf-admin/src/main/resources/mapper/system/SysconfigMapper.xml b/jnpf-java-boot/jnpf-admin/src/main/resources/mapper/system/SysconfigMapper.xml new file mode 100644 index 0000000..eaa4582 --- /dev/null +++ b/jnpf-java-boot/jnpf-admin/src/main/resources/mapper/system/SysconfigMapper.xml @@ -0,0 +1,15 @@ + + + + + + delete from base_sys_config where F_Category ='SysConfig' + + + delete from base_sys_config where F_Category='MPConfig' + + + delete from base_sys_config where F_Category='QYHConfig' + + + diff --git a/jnpf-java-boot/jnpf-admin/src/main/resources/mapper/system/UserMapper.xml b/jnpf-java-boot/jnpf-admin/src/main/resources/mapper/system/UserMapper.xml new file mode 100644 index 0000000..1ff6a2c --- /dev/null +++ b/jnpf-java-boot/jnpf-admin/src/main/resources/mapper/system/UserMapper.xml @@ -0,0 +1,42 @@ + + + + + + + + + diff --git a/jnpf-java-boot/jnpf-admin/src/main/resources/mapper/workflow/engine/FlowTaskMapper.xml b/jnpf-java-boot/jnpf-admin/src/main/resources/mapper/workflow/engine/FlowTaskMapper.xml new file mode 100644 index 0000000..155de13 --- /dev/null +++ b/jnpf-java-boot/jnpf-admin/src/main/resources/mapper/workflow/engine/FlowTaskMapper.xml @@ -0,0 +1,317 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jnpf-java-boot/jnpf-admin/src/main/resources/sharding-sphere.yml b/jnpf-java-boot/jnpf-admin/src/main/resources/sharding-sphere.yml new file mode 100644 index 0000000..41c975c --- /dev/null +++ b/jnpf-java-boot/jnpf-admin/src/main/resources/sharding-sphere.yml @@ -0,0 +1,52 @@ +databaseName: myshardingsphere +dataSources: # 数据源配置 ============= + # <数据源_0>: # 自定义数据源名称 + # dataSourceClassName: com.zaxxer.hikari.HikariDataSource # 连接池提供方完整类名(Spring默认Hikari) + # driverClassName: com.mysql.jdbc.Driver # JDBC驱动 + # jdbcUrl: jdbc:mysql://{host}:{port}/{dbName}?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8 # 数据库连接URL + # username: {username} # 用户 + # password: {password} # 密码 + ds0: # 自定义数据源名称 + dataSourceClassName: com.alibaba.druid.pool.DruidDataSource # 连接池提供方完整类名(Spring默认Hikari) + driverClassName: com.mysql.jdbc.Driver # JDBC驱动 + url: jdbc:mysql://127.0.0.1:3306/sharding1?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8 # 数据库连接URL + username: root # 用户 + password: 123456 # 密码 + ds1: # 自定义数据源名称 + dataSourceClassName: com.alibaba.druid.pool.DruidDataSource # 连接池提供方完整类名(Spring默认Hikari) + driverClassName: com.mysql.jdbc.Driver # JDBC驱动 + url: jdbc:mysql://127.0.0.1:3306/sharding2?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8 # 数据库连接URL + username: root # 用户 + password: 123456 # 密码 +rules: # 规则 ============= + - !SHARDING # 注意类似“- !SHARDING”标识不能省略 + tables: + ext_bigdata: # 自定义逻辑表名 + actualDataNodes: ds${0..1}.ext_bigdata_$->{0..1} # 由数据源名 + 表名组成(参考 Inline 语法规则) + databaseStrategy: + standard: + shardingColumn: F_Id # 分表依据字段 + shardingAlgorithmName: myDataSourceAlgorithm + tableStrategy: # 表策略 ------- + standard: + shardingColumn: F_Id # 分表依据字段 + shardingAlgorithmName: myTableAlgorithm + + # defaultDatabaseStrategy: # 库策略 ------- + # standard: + # shardingColumn: F_Id + # shardingAlgorithmName: myDataSourceAlgorithm + shardingAlgorithms: # 分片算法 ------- + myDataSourceAlgorithm: # 自定义算法名 + type: INLINE + props: + algorithm-expression: ds${(long)(Long.parseLong(F_Id)/10) % 2} + myTableAlgorithm: # 自定义算法名 + type: INLINE + props: + algorithm-expression: ext_bigdata_${(long)(Long.parseLong(F_Id)/10 / 2) % 2} +# keyGenerators: +# dsKey: # 自定义主键策略名 +# type: SNOWFLAKE +props: + sql-show: true \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-app/jnpf-app-biz/pom.xml b/jnpf-java-boot/jnpf-app/jnpf-app-biz/pom.xml new file mode 100644 index 0000000..110c880 --- /dev/null +++ b/jnpf-java-boot/jnpf-app/jnpf-app-biz/pom.xml @@ -0,0 +1,41 @@ + + + + jnpf-app + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-app-biz + + + + com.jnpf + jnpf-app-entity + ${project.version} + compile + + + com.jnpf + jnpf-permission-biz + ${project.version} + compile + + + com.jnpf + jnpf-system-biz + ${project.version} + compile + + + com.jnpf + jnpf-workflow-engine-biz + ${project.version} + compile + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-app/jnpf-app-biz/src/main/java/jnpf/mapper/AppDataMapper.java b/jnpf-java-boot/jnpf-app/jnpf-app-biz/src/main/java/jnpf/mapper/AppDataMapper.java new file mode 100644 index 0000000..41a9c81 --- /dev/null +++ b/jnpf-java-boot/jnpf-app/jnpf-app-biz/src/main/java/jnpf/mapper/AppDataMapper.java @@ -0,0 +1,16 @@ +package jnpf.mapper; + +import jnpf.base.mapper.SuperMapper; +import jnpf.entity.AppDataEntity; + +/** + * app常用数据 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021-07-08 + */ +public interface AppDataMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-app/jnpf-app-biz/src/main/java/jnpf/service/AppDataService.java b/jnpf-java-boot/jnpf-app/jnpf-app-biz/src/main/java/jnpf/service/AppDataService.java new file mode 100644 index 0000000..9322385 --- /dev/null +++ b/jnpf-java-boot/jnpf-app/jnpf-app-biz/src/main/java/jnpf/service/AppDataService.java @@ -0,0 +1,88 @@ +package jnpf.service; + +import jnpf.base.service.SuperService; +import jnpf.engine.model.flowengine.FlowPagination; +import jnpf.entity.AppDataEntity; +import jnpf.model.AppDataListAllVO; +import jnpf.model.AppFlowListAllVO; + +import java.util.List; + +/** + * app常用数据 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021-08-08 + */ +public interface AppDataService extends SuperService { + + /** + * 列表 + * + * @param type 类型 + * @return + */ + List getList(String type); + + /** + * 列表 + * + * @return + */ + List getList(); + + /** + * 信息 + * + * @param objectId 对象主键 + * @return + */ + AppDataEntity getInfo(String objectId); + + /** + * 验证名称 + * + * @param objectId 对象主键 + * @return + */ + boolean isExistByObjectId(String objectId, String systemId); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(AppDataEntity entity); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(AppDataEntity entity); + + /** + * 删除 + * + * @param objectId 应用主键 + */ + void delete(String objectId); + + /** + * 流程所有应用 + * + * @param pagination + * @return + */ + List getFlowList(FlowPagination pagination); + + /** + * 流程所有应用 + * @param type 类型 + * @return + */ + List getDataList(String type); + +} diff --git a/jnpf-java-boot/jnpf-app/jnpf-app-biz/src/main/java/jnpf/service/AppService.java b/jnpf-java-boot/jnpf-app/jnpf-app-biz/src/main/java/jnpf/service/AppService.java new file mode 100644 index 0000000..a95d4db --- /dev/null +++ b/jnpf-java-boot/jnpf-app/jnpf-app-biz/src/main/java/jnpf/service/AppService.java @@ -0,0 +1,28 @@ +package jnpf.service; + +import jnpf.model.AppUserInfoVO; +import jnpf.model.AppUsersVO; + +/** + * app用户信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021-08-08 + */ +public interface AppService { + + /** + * app用户信息 + * @return + */ + AppUsersVO userInfo(); + + /** + * 通讯录 + * @return + */ + AppUserInfoVO getInfo(String id); + +} diff --git a/jnpf-java-boot/jnpf-app/jnpf-app-biz/src/main/java/jnpf/service/impl/AppDataServiceImpl.java b/jnpf-java-boot/jnpf-app/jnpf-app-biz/src/main/java/jnpf/service/impl/AppDataServiceImpl.java new file mode 100644 index 0000000..ebfcc58 --- /dev/null +++ b/jnpf-java-boot/jnpf-app/jnpf-app-biz/src/main/java/jnpf/service/impl/AppDataServiceImpl.java @@ -0,0 +1,171 @@ +package jnpf.service.impl; + + +import jnpf.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import jnpf.base.UserInfo; +import jnpf.base.entity.ModuleEntity; +import jnpf.base.model.module.ModuleModel; +import jnpf.base.service.ModuleService; +import jnpf.engine.entity.FlowTemplateEntity; +import jnpf.engine.model.flowengine.FlowPagination; +import jnpf.engine.service.FlowTemplateJsonService; +import jnpf.engine.service.FlowTemplateService; +import jnpf.entity.AppDataEntity; +import jnpf.mapper.AppDataMapper; +import jnpf.model.*; +import jnpf.permission.model.authorize.AuthorizeVO; +import jnpf.permission.service.AuthorizeService; +import jnpf.service.AppDataService; +import jnpf.util.JsonUtil; +import jnpf.util.RandomUtil; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import jnpf.util.treeutil.SumTree; +import jnpf.util.treeutil.newtreeutil.TreeDotUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * app常用数据 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021-08-08 + */ +@Service +public class AppDataServiceImpl extends SuperServiceImpl implements AppDataService { + + @Autowired + private UserProvider userProvider; + @Autowired + private ModuleService moduleService; + @Autowired + private AuthorizeService authorizeService; + @Autowired + private FlowTemplateService flowTemplateService; + @Autowired + private FlowTemplateJsonService flowTemplateJsonService; + + @Override + public List getList(String type) { + UserInfo userInfo = userProvider.get(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(AppDataEntity::getObjectType, type).eq(AppDataEntity::getCreatorUserId, userInfo.getUserId()); + List list = this.list(queryWrapper); + list = list.stream().filter(t -> StringUtil.isNotEmpty(t.getSystemId()) && t.getSystemId().equals(userInfo.getAppSystemId())).collect(Collectors.toList()); + List idAll = list.stream().map(AppDataEntity::getObjectId).collect(Collectors.toList()); + List templateList = flowTemplateService.getTemplateList(idAll); + for (int i = 0; i < list.size(); i++) { + AppDataEntity appDataEntity = list.get(i); + if ("2".equals(type)) { + ModuleEntity info = moduleService.getInfo(appDataEntity.getObjectId()); + if (info == null || info.getEnabledMark() == 0) { + list.remove(i); + i--; + } + } else { + FlowTemplateEntity templateEntity = templateList.stream().filter(t -> t.getId().equals(appDataEntity.getObjectId())).findFirst().orElse(null); + if (templateEntity == null) { + list.remove(i); + i--; + } + } + } + return list; + } + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + return this.list(queryWrapper); + } + + @Override + public AppDataEntity getInfo(String objectId) { + UserInfo userInfo = userProvider.get(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(AppDataEntity::getObjectId, objectId).eq(AppDataEntity::getCreatorUserId, userInfo.getUserId()); + return this.getOne(queryWrapper); + } + + @Override + public boolean isExistByObjectId(String objectId, String systemId) { + UserInfo userInfo = userProvider.get(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(AppDataEntity::getObjectId, objectId) + .eq(AppDataEntity::getCreatorUserId, userInfo.getUserId()) + .eq(AppDataEntity::getSystemId, systemId); + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public void create(AppDataEntity entity) { + UserInfo userInfo = userProvider.get(); + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(userInfo.getUserId()); + entity.setCreatorTime(new Date()); + entity.setEnabledMark(1); + entity.setSystemId(userInfo.getAppSystemId()); + this.save(entity); + } + + @Override + public void delete(AppDataEntity entity) { + this.removeById(entity.getId()); + } + + @Override + public void delete(String objectId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(AppDataEntity::getObjectId, objectId); + this.remove(queryWrapper); + } + + @Override + public List getFlowList(FlowPagination pagination) { + List objectId = getList("1").stream().map(AppDataEntity::getObjectId).collect(Collectors.toList());; + List pageList = flowTemplateService.getListAll(pagination,true); + List result = new ArrayList<>(); + for (FlowTemplateEntity entity : pageList) { + AppFlowListAllVO vo = JsonUtil.getJsonToBean(entity, AppFlowListAllVO.class); + vo.setIsData(objectId.contains(vo.getId())); + result.add(vo); + } + return pagination.setData(result, pagination.getTotal()); + } + + @Override + public List getDataList(String type) { + List dataList = getList(type); + String appSystemId = userProvider.get().getAppSystemId(); + AuthorizeVO authorizeModel = authorizeService.getAuthorize(true, false); + List buttonList = authorizeModel.getModuleList(); + List menuList = moduleService.getList().stream().filter(t -> "App".equals(t.getCategory()) && t.getEnabledMark() == 1 && t.getSystemId().equals(appSystemId)).collect(Collectors.toList()); + List list = new LinkedList<>(); + for (ModuleEntity module : menuList) { + boolean count = buttonList.stream().filter(t -> t.getId().equals(module.getId())).count() > 0; + UserMenuModel userMenuModel = JsonUtil.getJsonToBean(module, UserMenuModel.class); + if (count) { + boolean isData = dataList.stream().filter(t -> t.getObjectId().equals(module.getId())).count() > 0; + userMenuModel.setIsData(isData); + list.add(userMenuModel); + } + } + List> menuAll = TreeDotUtils.convertListToTreeDot(list); + List menuListAll = JsonUtil.getJsonToList(menuAll, AppDataListAllVO.class); + List data = new LinkedList<>(); + for (AppDataListAllVO appMenu : menuListAll) { + if ("-1".equals(appMenu.getParentId())) { + data.add(appMenu); + } + } + return data; + } + + +} diff --git a/jnpf-java-boot/jnpf-app/jnpf-app-biz/src/main/java/jnpf/service/impl/AppServiceImpl.java b/jnpf-java-boot/jnpf-app/jnpf-app-biz/src/main/java/jnpf/service/impl/AppServiceImpl.java new file mode 100644 index 0000000..d617ba7 --- /dev/null +++ b/jnpf-java-boot/jnpf-app/jnpf-app-biz/src/main/java/jnpf/service/impl/AppServiceImpl.java @@ -0,0 +1,157 @@ +package jnpf.service.impl; + +import cn.hutool.core.collection.ListUtil; +import jnpf.base.UserInfo; +import jnpf.model.AppPositionVO; +import jnpf.model.AppUserInfoVO; +import jnpf.model.AppUsersVO; +import jnpf.permission.entity.*; +import jnpf.permission.service.*; +import jnpf.service.AppService; +import jnpf.util.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * app用户信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021-08-08 + */ +@Service +public class AppServiceImpl implements AppService { + + @Autowired + private UserProvider userProvider; + @Autowired + private UserService userService; + @Autowired + private PositionService positionService; + @Autowired + private OrganizeService organizeService; + @Autowired + private RoleService roleService; + @Autowired + private RedisUtil redisUtil; + @Autowired + private UserRelationService userRelationService; + + @Override + public AppUsersVO userInfo() { + UserInfo userInfo = userProvider.get(); + UserEntity userEntity = userService.getInfo(userInfo.getUserId()); + AppUsersVO usersVO = new AppUsersVO(); + usersVO.setBirthday(userEntity.getBirthday() != null ? userEntity.getBirthday().getTime() : null); + usersVO.setEmail(userEntity.getEmail()); + usersVO.setGender(userEntity.getGender()); + usersVO.setMobilePhone(userEntity.getMobilePhone()); + this.data(usersVO, userEntity, userInfo); + this.userInfo(usersVO, userInfo); + //岗位 + PositionEntity position = positionService.getInfo(userEntity.getPositionId()); + AppPositionVO positionVO = new AppPositionVO(); + if(position != null){ + positionVO.setId(position.getId()); + positionVO.setName(position.getFullName()); + usersVO.setPositionIds(ListUtil.toList(positionVO)); + } + //直属主管 + if(StringUtil.isNotEmpty(userEntity.getManagerId())){ + UserEntity menager = userService.getInfo(userEntity.getManagerId()); + usersVO.setManager(menager != null ? menager.getRealName() + "/" + menager.getAccount() : ""); + } + //角色 + List roles = roleService.getAllRoleIdsByUserIdAndOrgId(userInfo.getUserId(), usersVO.getOrganizeId()); + List roleList = roleService.getListByIds(roles, null, false); + usersVO.setRoleName(String.join(",", roleList.stream().map(RoleEntity::getFullName).collect(Collectors.toList()))); + usersVO.setRoleId(String.join(".", roleList.stream().map(RoleEntity::getId).collect(Collectors.toList()))); + return usersVO; + } + + @Override + public AppUserInfoVO getInfo(String id) { + AppUserInfoVO userInfoVO = new AppUserInfoVO(); + UserEntity entity = userService.getInfo(id); + if (entity != null) { + userInfoVO = JsonUtil.getJsonToBean(entity, AppUserInfoVO.class); + List positionIds = StringUtil.isNotEmpty(entity.getPositionId()) ? Arrays.asList(entity.getPositionId().split(",")) : new ArrayList<>(); + List positionName = positionService.getPositionName(positionIds, false).stream().map(t -> t.getFullName()).collect(Collectors.toList()); + userInfoVO.setPositionName(String.join(",", positionName)); + OrganizeEntity info = organizeService.getInfo(entity.getOrganizeId()); + userInfoVO.setOrganizeName(info != null ? info.getFullName() : ""); + userInfoVO.setHeadIcon(UploaderUtil.uploaderImg(userInfoVO.getHeadIcon())); + } + return userInfoVO; + } + /** + * 赋值 + * + * @param userInfo + * @param userId + * @param isAdmin + */ + private void userInfo(UserInfo userInfo, String userId, boolean isAdmin, UserEntity userEntity) { + List userIdList = new ArrayList(){{add(userId);}}; + List data = userRelationService.getListByUserIdAll(userIdList); + //获取一个字段的值 + List positionList = data.stream().filter(m -> "Position".equals(m.getObjectType())).map(t -> t.getObjectId()).collect(Collectors.toList()); + Set id = new LinkedHashSet<>(); + String[] position = StringUtil.isNotEmpty(userEntity.getPositionId()) ? userEntity.getPositionId().split(",") : new String[]{}; + List positions = positionList.stream().filter(t->Arrays.asList(position).contains(t)).collect(Collectors.toList()); + id.addAll(positions); + id.addAll(positionList); + userInfo.setPositionIds(id.toArray(new String[id.size()])); + if (!isAdmin) { + data = data.stream().filter(m -> "Role".equals(m.getObjectType())).collect(Collectors.toList()); + } + List roleList = data.stream().map(t -> t.getObjectId()).collect(Collectors.toList()); + userInfo.setRoleIds(roleList); + } + + private void data(AppUsersVO usersVO, UserEntity userEntity, UserInfo userInfo) { + //组织 + usersVO.setOrganizeId(userEntity.getOrganizeId()); + List organizeIdList = new ArrayList<>(); + organizeService.getOrganizeId(userEntity.getOrganizeId(),organizeIdList); + Collections.reverse(organizeIdList); + usersVO.setOrganizeName(organizeIdList.stream().map(OrganizeEntity::getFullName).collect(Collectors.joining("/"))); + OrganizeEntity organizeEntity = organizeIdList.stream().filter(t->t.getId().equals(userEntity.getOrganizeId())).findFirst().orElse(null); + if (organizeEntity != null) { + String[] organizeId = StringUtil.isNotEmpty(organizeEntity.getOrganizeIdTree()) ? organizeEntity.getOrganizeIdTree().split(",") : new String[]{}; + if (organizeId.length > 0) { + userInfo.setOrganizeId(organizeId[0]); + userInfo.setDepartmentId(organizeId[organizeId.length - 1]); + } + } + userInfo.setManagerId(userInfo.getManagerId()); + boolean b = userInfo.getIsAdministrator(); + List subordinateIdsList = userService.getListByManagerId(userInfo.getUserId(),null).stream().map(UserEntity::getId).collect(Collectors.toList()); + userInfo.setSubordinateIds(subordinateIdsList); + this.userInfo(userInfo, userInfo.getUserId(), b,userEntity); + userInfo.setSubOrganizeIds(new String[]{}); + //redisUtil.insert(userInfo.getId(), userInfo, DateUtil.getTime(userInfo.getOverdueTime()) - DateUtil.getTime(new Date())); + UserProvider.setLoginUser(userInfo); + UserProvider.setLocalLoginUser(userInfo); + } + + /** + * 登录信息 + * + * @param appUsersVO 返回对象 + * @param userInfo 回话信息 + * @return + */ + private void userInfo(AppUsersVO appUsersVO, UserInfo userInfo) { + appUsersVO.setUserId(userInfo.getUserId()); + appUsersVO.setHeadIcon(UploaderUtil.uploaderImg(userInfo.getUserIcon())); + appUsersVO.setUserName(userInfo.getUserName()); + appUsersVO.setUserAccount(userInfo.getUserAccount()); + } + + +} diff --git a/jnpf-java-boot/jnpf-app/jnpf-app-controller/pom.xml b/jnpf-java-boot/jnpf-app/jnpf-app-controller/pom.xml new file mode 100644 index 0000000..423116c --- /dev/null +++ b/jnpf-java-boot/jnpf-app/jnpf-app-controller/pom.xml @@ -0,0 +1,23 @@ + + + + jnpf-app + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-app-controller + + + + com.jnpf + jnpf-app-biz + ${project.version} + compile + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-app/jnpf-app-controller/src/main/java/jnpf/controller/AppDataController.java b/jnpf-java-boot/jnpf-app/jnpf-app-controller/src/main/java/jnpf/controller/AppDataController.java new file mode 100644 index 0000000..113b1a6 --- /dev/null +++ b/jnpf-java-boot/jnpf-app/jnpf-app-controller/src/main/java/jnpf/controller/AppDataController.java @@ -0,0 +1,129 @@ +package jnpf.controller; + +import jnpf.base.controller.SuperController; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.vo.ListVO; +import jnpf.base.vo.PageListVO; +import jnpf.base.vo.PaginationVO; +import jnpf.constant.MsgCode; +import jnpf.engine.model.flowengine.FlowPagination; +import jnpf.entity.AppDataEntity; +import jnpf.model.AppDataCrForm; +import jnpf.model.AppDataListAllVO; +import jnpf.model.AppDataListVO; +import jnpf.model.AppFlowListAllVO; +import jnpf.service.AppDataService; +import jnpf.util.JsonUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; + +/** + * app常用数据 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-07-08 + */ +@Tag(name = "app常用数据", description = "data") +@RestController +@RequestMapping("/api/app/Data") +public class AppDataController extends SuperController { + + @Autowired + private AppDataService appDataService; + + /** + * 常用数据 + * + * @param type 类型 + * @return + */ + @Operation(summary = "常用数据") + @GetMapping + @Parameters({ + @Parameter(name = "type", description = "类型"), + }) + public ActionResult> list(@RequestParam("type") String type) { + List list = appDataService.getList(type); + List data = JsonUtil.getJsonToList(list, AppDataListVO.class); + ListVO listVO = new ListVO(); + listVO.setList(data); + return ActionResult.success(listVO); + } + + /** + * 新建 + * + * @param appDataCrForm 新建模型 + * @return + */ + @PostMapping + @Operation(summary = "新建") + @Parameters({ + @Parameter(name = "appDataCrForm", description = "常用模型",required = true), + }) + public ActionResult create(@RequestBody @Valid AppDataCrForm appDataCrForm) { + AppDataEntity entity = JsonUtil.getJsonToBean(appDataCrForm, AppDataEntity.class); + if (appDataService.isExistByObjectId(entity.getObjectId(),appDataCrForm.getSystemId())) { + return ActionResult.fail("常用数据已存在"); + } + appDataService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 删除 + * + * @param objectId 主键 + * @return + */ + @Operation(summary = "删除") + @DeleteMapping("/{objectId}") + @Parameters({ + @Parameter(name = "objectId", description = "主键", required = true), + }) + public ActionResult create(@PathVariable("objectId") String objectId) { + AppDataEntity entity = appDataService.getInfo(objectId); + if (entity != null) { + appDataService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + /** + * 所有流程 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "所有流程") + @GetMapping("/getFlowList") + public ActionResult> getFlowList(FlowPagination pagination) { + List list = appDataService.getFlowList(pagination); + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(list, paginationVO); + } + + /** + * 所有应用 + * + * @return + */ + @Operation(summary = "所有应用") + @GetMapping("/getDataList") + public ActionResult> getAllList() { + List result = appDataService.getDataList("2"); + ListVO listVO = new ListVO(); + listVO.setList(result); + return ActionResult.success(listVO); + } +} diff --git a/jnpf-java-boot/jnpf-app/jnpf-app-controller/src/main/java/jnpf/controller/AppMenuController.java b/jnpf-java-boot/jnpf-app/jnpf-app-controller/src/main/java/jnpf/controller/AppMenuController.java new file mode 100644 index 0000000..2c86fe0 --- /dev/null +++ b/jnpf-java-boot/jnpf-app/jnpf-app-controller/src/main/java/jnpf/controller/AppMenuController.java @@ -0,0 +1,93 @@ +package jnpf.controller; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.Page; +import jnpf.base.entity.ModuleEntity; +import jnpf.base.entity.SystemEntity; +import jnpf.base.model.module.ModuleModel; +import jnpf.base.service.ModuleService; +import jnpf.base.service.SystemService; +import jnpf.base.vo.ListVO; +import jnpf.constant.PermissionConst; +import jnpf.model.AppMenuListVO; +import jnpf.model.UserMenuModel; +import jnpf.permission.entity.OrganizeAdministratorEntity; +import jnpf.permission.model.authorize.AuthorizeVO; +import jnpf.permission.service.AuthorizeService; +import jnpf.permission.service.OrganizeAdministratorService; +import jnpf.util.JsonUtil; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import jnpf.util.treeutil.ListToTreeUtil; +import jnpf.util.treeutil.SumTree; +import jnpf.util.treeutil.newtreeutil.TreeDotUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; +import java.util.stream.Collectors; + +/** + * app应用 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-07-08 + */ +@Tag(name = "app应用", description = "Menu") +@RestController +@RequestMapping("/api/app/Menu") +public class AppMenuController { + + @Autowired + private ModuleService moduleApi; + @Autowired + private AuthorizeService authorizeService; + @Autowired + private UserProvider userProvider; + @Autowired + private OrganizeAdministratorService organizeAdminTratorApi; + @Autowired + private SystemService systemApi; + + /** + * 获取菜单列表 + * + * @param page 分页模型 + * @return + */ + @Operation(summary = "获取菜单列表") + @GetMapping + public ActionResult> list(Page page) { + // 从分级管理获取应用权限后获取菜单 + List listByUserId = organizeAdminTratorApi.getOrganizeAdministratorEntity(UserProvider.getLoginUserId(), PermissionConst.SYSTEM, false); + List systemEntities = systemApi.getListByIds(listByUserId.stream().map(OrganizeAdministratorEntity::getOrganizeId).collect(Collectors.toList())); + List moduleBySystemIds = moduleApi.getModuleBySystemIds(systemEntities.stream().map(SystemEntity::getId).collect(Collectors.toList())); + List jsonToList = JsonUtil.getJsonToList(moduleBySystemIds, ModuleModel.class); + List listByUserId1 = organizeAdminTratorApi.getOrganizeAdministratorEntity(UserProvider.getLoginUserId(), PermissionConst.MODULE, false); + List moduleEntities = moduleApi.getModuleByIds(listByUserId1.stream().map(OrganizeAdministratorEntity::getOrganizeId).collect(Collectors.toList())); + List jsonToList1 = JsonUtil.getJsonToList(moduleEntities, ModuleModel.class); + AuthorizeVO authorizeModel = authorizeService.getAuthorize(true, true); + List buttonListAll = authorizeModel.getModuleList().stream().filter(t -> "App".equals(t.getCategory())).collect(Collectors.toList()); + buttonListAll.addAll(jsonToList); + buttonListAll.addAll(jsonToList1); + // 通过系统id捞取相应的菜单 + buttonListAll = buttonListAll.stream().distinct().filter(t -> userProvider.get().getAppSystemId() != null && userProvider.get().getAppSystemId().equals(t.getSystemId()) && "App".equals(t.getCategory())).collect(Collectors.toList()); + List buttonList = buttonListAll; + if (StringUtil.isNotEmpty(page.getKeyword())) { + buttonList = buttonListAll.stream().filter(t -> t.getFullName().contains(page.getKeyword())).collect(Collectors.toList()); + } + List list = JsonUtil.getJsonToList(ListToTreeUtil.treeWhere(buttonList, buttonListAll), UserMenuModel.class); + List> menuAll = TreeDotUtils.convertListToTreeDot(list, "-1"); + List data = JsonUtil.getJsonToList(menuAll, AppMenuListVO.class); + ListVO listVO = new ListVO(); + listVO.setList(data); + return ActionResult.success(listVO); + } + +} diff --git a/jnpf-java-boot/jnpf-app/jnpf-app-controller/src/main/java/jnpf/controller/AppUserController.java b/jnpf-java-boot/jnpf-app/jnpf-app-controller/src/main/java/jnpf/controller/AppUserController.java new file mode 100644 index 0000000..9079b7b --- /dev/null +++ b/jnpf-java-boot/jnpf-app/jnpf-app-controller/src/main/java/jnpf/controller/AppUserController.java @@ -0,0 +1,62 @@ +package jnpf.controller; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.model.AppUserInfoVO; +import jnpf.model.AppUsersVO; +import jnpf.model.AppUserInfoVO; +import jnpf.service.AppService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 用户信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-07-08 + */ +@Tag(name = "app用户信息", description = "User") +@RestController +@RequestMapping("/api/app/User") +public class AppUserController { + + @Autowired + private AppService appService; + + /** + * 用户信息 + * + * @return + */ + @Operation(summary = "用户信息") + @GetMapping + public ActionResult getInfo() { + AppUsersVO userAllVO = appService.userInfo(); + return ActionResult.success(userAllVO); + } + + /** + * 通讯录详情 + * + * @param id 主键 + * @return + */ + @Operation(summary = "通讯录详情") + @GetMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult userInfo(@PathVariable("id") String id) { + AppUserInfoVO userInfoVO = appService.getInfo(id); + return ActionResult.success(userInfoVO); + } + +} diff --git a/jnpf-java-boot/jnpf-app/jnpf-app-controller/src/main/java/jnpf/controller/AppVersionController.java b/jnpf-java-boot/jnpf-app/jnpf-app-controller/src/main/java/jnpf/controller/AppVersionController.java new file mode 100644 index 0000000..66fd9d6 --- /dev/null +++ b/jnpf-java-boot/jnpf-app/jnpf-app-controller/src/main/java/jnpf/controller/AppVersionController.java @@ -0,0 +1,45 @@ +package jnpf.controller; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.util.NoDataSourceBind; +import jnpf.base.service.SysconfigService; +import org.apache.commons.collections4.map.HashedMap; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Map; + +/** + * 获取AppVersion + * + * @author :JNPF开发平台组 + * @version: V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date :2022/3/31 11:26 + */ +@Tag(name = "获取APP版本号", description = "AppVersion") +@RestController +@RequestMapping("/api/app") +public class AppVersionController { + @Autowired + private SysconfigService sysconfigService; + + /** + * 判断是否需要验证码 + * + * @return + */ + @NoDataSourceBind() + @Operation(summary = "判断是否需要验证码") + @GetMapping("/Version") + public ActionResult getAppVersion() { + String sysVersion = sysconfigService.getSysInfo().getSysVersion(); + Map map = new HashedMap<>(); + map.put("sysVersion", sysVersion); + return ActionResult.success(map); + } +} diff --git a/jnpf-java-boot/jnpf-app/jnpf-app-entity/pom.xml b/jnpf-java-boot/jnpf-app/jnpf-app-entity/pom.xml new file mode 100644 index 0000000..b6e234c --- /dev/null +++ b/jnpf-java-boot/jnpf-app/jnpf-app-entity/pom.xml @@ -0,0 +1,22 @@ + + + + jnpf-app + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-app-entity + + + + com.jnpf + jnpf-common-all + ${project.version} + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-app/jnpf-app-entity/src/main/java/jnpf/entity/AppDataEntity.java b/jnpf-java-boot/jnpf-app/jnpf-app-entity/src/main/java/jnpf/entity/AppDataEntity.java new file mode 100644 index 0000000..289d079 --- /dev/null +++ b/jnpf-java-boot/jnpf-app/jnpf-app-entity/src/main/java/jnpf/entity/AppDataEntity.java @@ -0,0 +1,46 @@ +package jnpf.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * app常用数据 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021-08-08 + */ +@Data +@TableName("base_app_data") +public class AppDataEntity extends SuperExtendEntity.SuperExtendDEEntity { + + /** + * 对象类型 + */ + @TableField("f_object_type") + private String objectType; + + /** + * 对象主键 + */ + @TableField("f_object_id") + private String objectId; + + /** + * 数据 + */ + @TableField("f_object_data") + private String objectData; + + /** + * 关联系统id + */ + @TableField("f_system_id") + private String systemId; + +} diff --git a/jnpf-java-boot/jnpf-app/jnpf-app-entity/src/main/java/jnpf/model/AppDataCrForm.java b/jnpf-java-boot/jnpf-app/jnpf-app-entity/src/main/java/jnpf/model/AppDataCrForm.java new file mode 100644 index 0000000..e4d3b81 --- /dev/null +++ b/jnpf-java-boot/jnpf-app/jnpf-app-entity/src/main/java/jnpf/model/AppDataCrForm.java @@ -0,0 +1,30 @@ +package jnpf.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * app常用数据 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021-07-08 + */ +@Data +@Schema(description = "常用模型") +public class AppDataCrForm { + @NotBlank(message = "必填") + @Schema(description = "应用类型") + private String objectType; + @NotBlank(message = "必填") + @Schema(description = "应用主键") + private String objectId; + @Schema(description = "数据") + private String objectData; + @Schema(description = "系统主键") + private String systemId; +} diff --git a/jnpf-java-boot/jnpf-app/jnpf-app-entity/src/main/java/jnpf/model/AppDataListAllVO.java b/jnpf-java-boot/jnpf-app/jnpf-app-entity/src/main/java/jnpf/model/AppDataListAllVO.java new file mode 100644 index 0000000..fbed765 --- /dev/null +++ b/jnpf-java-boot/jnpf-app/jnpf-app-entity/src/main/java/jnpf/model/AppDataListAllVO.java @@ -0,0 +1,40 @@ +package jnpf.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * app常用数据 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021-07-08 + */ +@Data +@Schema(description = "常用模型") +public class AppDataListAllVO { + @Schema(description = "主键") + private String id; + @Schema(description = "是否有下级菜单") + private Boolean hasChildren; + @Schema(description = "菜单名称") + private String fullName; + @Schema(description = " 图标") + private String icon; + @Schema(description = "链接地址") + private String urlAddress; + @Schema(description = "父级id") + private String parentId; + @Schema(description = "菜单类型",example = "1") + private Integer type; + @Schema(description = "扩展字段") + private String propertyJson; + @Schema(description = "是否常用") + private Boolean isData; + @Schema(description = "下级菜单列表") + private List children; +} diff --git a/jnpf-java-boot/jnpf-app/jnpf-app-entity/src/main/java/jnpf/model/AppDataListVO.java b/jnpf-java-boot/jnpf-app/jnpf-app-entity/src/main/java/jnpf/model/AppDataListVO.java new file mode 100644 index 0000000..2cf89e5 --- /dev/null +++ b/jnpf-java-boot/jnpf-app/jnpf-app-entity/src/main/java/jnpf/model/AppDataListVO.java @@ -0,0 +1,24 @@ +package jnpf.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * app常用数据 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021-07-08 + */ +@Data +@Schema(description = "常用模型") +public class AppDataListVO { + @Schema(description = "主键") + private String id; + @Schema(description = "应用主键") + private String objectId; + @Schema(description = "数据") + private String objectData; +} diff --git a/jnpf-java-boot/jnpf-app/jnpf-app-entity/src/main/java/jnpf/model/AppFlowListAllVO.java b/jnpf-java-boot/jnpf-app/jnpf-app-entity/src/main/java/jnpf/model/AppFlowListAllVO.java new file mode 100644 index 0000000..0e9c0ee --- /dev/null +++ b/jnpf-java-boot/jnpf-app/jnpf-app-entity/src/main/java/jnpf/model/AppFlowListAllVO.java @@ -0,0 +1,30 @@ +package jnpf.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * app常用数据 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021-07-08 + */ +@Data +@Schema(description = "常用模型") +public class AppFlowListAllVO { + @Schema(description = "主键") + private String id; + @Schema(description = "名称") + private String fullName; + @Schema(description = "图标") + private String icon; + @Schema(description = "图标背景色") + private String iconBackground; + @Schema(description = "编码") + private String enCode; + @Schema(description = "是否常用") + private Boolean isData; +} diff --git a/jnpf-java-boot/jnpf-app/jnpf-app-entity/src/main/java/jnpf/model/AppMenuListVO.java b/jnpf-java-boot/jnpf-app/jnpf-app-entity/src/main/java/jnpf/model/AppMenuListVO.java new file mode 100644 index 0000000..2b00d8b --- /dev/null +++ b/jnpf-java-boot/jnpf-app/jnpf-app-entity/src/main/java/jnpf/model/AppMenuListVO.java @@ -0,0 +1,40 @@ +package jnpf.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * app应用 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021-07-08 + */ +@Data +@Schema(description = "常用模型") +public class AppMenuListVO { + @Schema(description = "主键") + private String id; + @Schema(description = "是否有下级菜单") + private Boolean hasChildren; + @Schema(description = "父级id") + private String parentId; + @Schema(description = "菜单名称") + private String fullName; + @Schema(description = " 图标") + private String icon; + @Schema(description = "是否常用") + private Boolean isData; + @Schema(description = "链接地址") + private String urlAddress; + @Schema(description = "菜单类型",example = "1") + private Integer type; + @Schema(description = "扩展字段") + private String propertyJson; + @Schema(description = "下级菜单列表") + private List children; +} diff --git a/jnpf-java-boot/jnpf-app/jnpf-app-entity/src/main/java/jnpf/model/AppPositionVO.java b/jnpf-java-boot/jnpf-app/jnpf-app-entity/src/main/java/jnpf/model/AppPositionVO.java new file mode 100644 index 0000000..38469e4 --- /dev/null +++ b/jnpf-java-boot/jnpf-app/jnpf-app-entity/src/main/java/jnpf/model/AppPositionVO.java @@ -0,0 +1,22 @@ +package jnpf.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * app应用 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021-08-08 + */ +@Data +@Schema(description = "常用模型") +public class AppPositionVO { + @Schema(description = "岗位id") + private String id; + @Schema(description = "岗位名称") + private String name; +} diff --git a/jnpf-java-boot/jnpf-app/jnpf-app-entity/src/main/java/jnpf/model/AppUserInfoVO.java b/jnpf-java-boot/jnpf-app/jnpf-app-entity/src/main/java/jnpf/model/AppUserInfoVO.java new file mode 100644 index 0000000..d2dc9ec --- /dev/null +++ b/jnpf-java-boot/jnpf-app/jnpf-app-entity/src/main/java/jnpf/model/AppUserInfoVO.java @@ -0,0 +1,37 @@ +package jnpf.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +@Schema(description = "常用模型") +public class AppUserInfoVO { + @Schema(description = "主键") + private String id; + @Schema(description = "户名") + private String realName; + @Schema(description = "部门名称") + private String organizeName; + @Schema(description = "账号") + private String account; + @Schema(description = "岗位名称") + private String positionName; + @Schema(description = "办公电话") + private String telePhone; + @Schema(description = "办公座机") + private String landline; + @Schema(description = "手机号码") + private String mobilePhone; + @Schema(description = "用户头像") + private String headIcon; + @Schema(description = "邮箱") + private String email; +} diff --git a/jnpf-java-boot/jnpf-app/jnpf-app-entity/src/main/java/jnpf/model/AppUsersVO.java b/jnpf-java-boot/jnpf-app/jnpf-app-entity/src/main/java/jnpf/model/AppUsersVO.java new file mode 100644 index 0000000..b8bbc25 --- /dev/null +++ b/jnpf-java-boot/jnpf-app/jnpf-app-entity/src/main/java/jnpf/model/AppUsersVO.java @@ -0,0 +1,50 @@ +package jnpf.model; + + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * 用户 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021-07-08 + */ +@Data +@Schema(description = "常用模型") +public class AppUsersVO { + @Schema(description = "用户id") + private String userId; + @Schema(description = "用户账号") + private String userAccount; + @Schema(description = "用户姓名") + private String userName; + @Schema(description = "用户头像") + private String headIcon; + @Schema(description = "组织主键") + private String organizeId; + @Schema(description = "组织名称") + private String organizeName; + @Schema(description = "角色主键") + private String roleId; + @Schema(description = "角色名称") + private String roleName; + @Schema(description = "性别") + private Integer gender; + @Schema(description = "岗位") + private List positionIds; + @Schema(description = "生日") + private Long birthday; + @Schema(description = "手机") + private String mobilePhone; + @Schema(description = "邮箱") + private String email; + @Schema(description = "直属主管") + private String manager; + +} diff --git a/jnpf-java-boot/jnpf-app/pom.xml b/jnpf-java-boot/jnpf-app/pom.xml new file mode 100644 index 0000000..5c36a03 --- /dev/null +++ b/jnpf-java-boot/jnpf-app/pom.xml @@ -0,0 +1,20 @@ + + + + jnpf-java-boot + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-app + pom + + jnpf-app-entity + jnpf-app-biz + jnpf-app-controller + + + diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-biz/pom.xml b/jnpf-java-boot/jnpf-example/jnpf-example-biz/pom.xml new file mode 100644 index 0000000..be46fb3 --- /dev/null +++ b/jnpf-java-boot/jnpf-example/jnpf-example-biz/pom.xml @@ -0,0 +1,27 @@ + + + + jnpf-example + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-example-biz + + + + com.jnpf + jnpf-example-entity + ${project.version} + + + com.jnpf + jnpf-generater-base + ${project.version} + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/mapper/ContractMapper.java b/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/mapper/ContractMapper.java new file mode 100644 index 0000000..6b7f70e --- /dev/null +++ b/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/mapper/ContractMapper.java @@ -0,0 +1,16 @@ +package jnpf.mapper; + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.entity.ContractEntity; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/16 9:47 + */ +public interface ContractMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/ContractService.java b/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/ContractService.java new file mode 100644 index 0000000..a6c3546 --- /dev/null +++ b/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/ContractService.java @@ -0,0 +1,28 @@ +package jnpf.service; + +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import jnpf.base.Pagination; +import jnpf.entity.ContractEntity; + +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/16 9:47 + */ +public interface ContractService extends SuperService { + + List getlist(Pagination pagination); + + ContractEntity getInfo(String id); + + void create(ContractEntity entity); + + void update(String id, ContractEntity entity); + + void delete(ContractEntity entity); +} diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/impl/ContractServiceImpl.java b/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/impl/ContractServiceImpl.java new file mode 100644 index 0000000..eccedf4 --- /dev/null +++ b/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/impl/ContractServiceImpl.java @@ -0,0 +1,82 @@ +package jnpf.service.impl; + +import jnpf.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import jnpf.base.Pagination; +import jnpf.base.UserInfo; +import jnpf.mapper.ContractMapper; +import jnpf.service.ContractService; +import jnpf.entity.ContractEntity; +import jnpf.util.RandomUtil; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; + +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/16 9:47 + */ +@Service +public class ContractServiceImpl extends SuperServiceImpl implements ContractService { + + @Autowired + private UserProvider userProvider; + + @Override + public List getlist(Pagination pagination){ + //通过UserProvider获取用户信息 + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (!StringUtil.isEmpty(pagination.getKeyword())) { + queryWrapper.lambda().and( + t -> t.like(ContractEntity::getContractName, pagination.getKeyword()) + .or().like(ContractEntity::getMytelePhone, pagination.getKeyword()) + ); + } + //排序 + if (StringUtil.isEmpty(pagination.getSidx())) { + } else { + queryWrapper = "asc".equals(pagination.getSort().toLowerCase()) ? queryWrapper.orderByAsc(pagination.getSidx()) : queryWrapper.orderByDesc(pagination.getSidx()); + } + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage userPage = this.page(page, queryWrapper); + return pagination.setData(userPage.getRecords(), page.getTotal()); + } + + @Override + public ContractEntity getInfo(String id){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ContractEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + @DSTransactional + public void create(ContractEntity entity){ + entity.setId(RandomUtil.uuId()); + this.save(entity); + } + + @Override + @DSTransactional + public void update(String id, ContractEntity entity){ + entity.setId(id); + this.updateById(entity); + } + + @Override + public void delete(ContractEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } +} diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-controller/pom.xml b/jnpf-java-boot/jnpf-example/jnpf-example-controller/pom.xml new file mode 100644 index 0000000..d8bef13 --- /dev/null +++ b/jnpf-java-boot/jnpf-example/jnpf-example-controller/pom.xml @@ -0,0 +1,22 @@ + + + + jnpf-example + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-example-controller + + + + com.jnpf + jnpf-example-biz + ${project.version} + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-controller/src/main/java/jnpf/controller/ContractController.java b/jnpf-java-boot/jnpf-example/jnpf-example-controller/src/main/java/jnpf/controller/ContractController.java new file mode 100644 index 0000000..1dd672f --- /dev/null +++ b/jnpf-java-boot/jnpf-example/jnpf-example-controller/src/main/java/jnpf/controller/ContractController.java @@ -0,0 +1,123 @@ +package jnpf.controller; + + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.Pagination; +import jnpf.base.controller.SuperController; +import jnpf.base.vo.PageListVO; +import jnpf.base.vo.PaginationVO; +import jnpf.entity.ContractEntity; +import jnpf.model.ContractForm; +import jnpf.model.ContractInfoVO; +import jnpf.model.ContractListVO; +import jnpf.service.ContractService; +import jnpf.util.JsonUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; + +/** + * Contract + * 版本: V3.0.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2020-12-31 + */ +@RestController +@Tag(name = "示例接口", description = "Contract") +@RequestMapping("/Contract") +public class ContractController extends SuperController { + + @Autowired + private ContractService contractService; + + /** + * 获取列表 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "获取列表") + @GetMapping("/List") + public ActionResult> list(Pagination pagination) { + List entity = contractService.getlist(pagination); + List listVo = JsonUtil.getJsonToList(JsonUtil.getObjectToStringDateFormat(entity, "yyyy-MM-dd HH:mm:ss"), ContractListVO.class); + PaginationVO vo = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(listVo, vo); + } + + /** + * 获取详情 + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取详情") + @GetMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult info(@PathVariable("id") String id) { + ContractEntity entity = contractService.getInfo(id); + ContractInfoVO vo = JsonUtil.getJsonToBean(entity, ContractInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 新建 + * + * @param contractForm 新建模型 + * @return + */ + @Operation(summary = "新建") + @PostMapping + @Parameters({ + @Parameter(name = "contractForm", description = "示例模型",required = true), + }) + public ActionResult create(@RequestBody @Valid ContractForm contractForm) { + ContractEntity entity = JsonUtil.getJsonToBean(contractForm, ContractEntity.class); + contractService.create(entity); + return ActionResult.success("保存成功"); + } + + /** + * @param id 主键 + * @param contractForm 修改模型 + * @return + */ + @Operation(summary = "修改") + @PutMapping("/{id}") + @Parameters({ + @Parameter(name = "contractForm", description = "示例模型",required = true), + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid ContractForm contractForm) { + ContractEntity entity = JsonUtil.getJsonToBean(contractForm, ContractEntity.class); + contractService.update(id, entity); + return ActionResult.success("修改成功"); + } + + /** + * 删除 + * + * @param id 主键 + * @return + */ + @Operation(summary = "删除") + @DeleteMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult delete(@PathVariable("id") String id) { + ContractEntity entity = contractService.getInfo(id); + contractService.delete(entity); + return ActionResult.success("删除成功"); + } + +} diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-entity/pom.xml b/jnpf-java-boot/jnpf-example/jnpf-example-entity/pom.xml new file mode 100644 index 0000000..642b633 --- /dev/null +++ b/jnpf-java-boot/jnpf-example/jnpf-example-entity/pom.xml @@ -0,0 +1,22 @@ + + + + jnpf-example + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-example-entity + + + + com.jnpf + jnpf-common-all + ${project.version} + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/entity/ContractEntity.java b/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/entity/ContractEntity.java new file mode 100644 index 0000000..c930d0f --- /dev/null +++ b/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/entity/ContractEntity.java @@ -0,0 +1,33 @@ +package jnpf.entity; + +import jnpf.base.entity.SuperBaseEntity; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * + * Contract + * 版本: V3.0.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2020-12-31 + */ +@Data +@TableName("test_contract") +public class ContractEntity extends SuperBaseEntity.SuperTBaseEntity implements Serializable { + + @TableField("F_CONTRACTNAME") + private String contractName; + + @TableField("F_MYTELEPHONE") + private String mytelePhone; + + @TableField("F_FILEJSON") + private String fileJson; + +} diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/ContractForm.java b/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/ContractForm.java new file mode 100644 index 0000000..a2152f1 --- /dev/null +++ b/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/ContractForm.java @@ -0,0 +1,26 @@ +package jnpf.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * 版本: V3.0.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2020-12-31 + */ +@Data +public class ContractForm { + + @Schema(description = "姓名") + private String contractName; + + @Schema(description = "手机号") + private String mytelePhone; + + @Schema(description = "文件") + private String fileJson; + +} diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/ContractInfoVO.java b/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/ContractInfoVO.java new file mode 100644 index 0000000..3f6d46c --- /dev/null +++ b/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/ContractInfoVO.java @@ -0,0 +1,27 @@ +package jnpf.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * 版本: V3.0.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2020-12-31 + */ +@Data +public class ContractInfoVO { + @Schema(description = "主键") + private String id; + + @Schema(description = "姓名") + private String contractName; + + @Schema(description = "手机号") + private String mytelePhone; + + @Schema(description = "文件") + private String fileJson; +} diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/ContractListVO.java b/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/ContractListVO.java new file mode 100644 index 0000000..9b493c5 --- /dev/null +++ b/jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/ContractListVO.java @@ -0,0 +1,16 @@ +package jnpf.model; + +import lombok.Data; + +/** + * + * + * 版本: V3.0.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2020-12-31 + */ +@Data +public class ContractListVO extends ContractInfoVO { + +} diff --git a/jnpf-java-boot/jnpf-example/pom.xml b/jnpf-java-boot/jnpf-example/pom.xml new file mode 100644 index 0000000..61fb2c1 --- /dev/null +++ b/jnpf-java-boot/jnpf-example/pom.xml @@ -0,0 +1,20 @@ + + + + jnpf-java-boot + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-example + pom + + jnpf-example-entity + jnpf-example-biz + jnpf-example-controller + + + diff --git a/jnpf-java-boot/jnpf-exception/pom.xml b/jnpf-java-boot/jnpf-exception/pom.xml new file mode 100644 index 0000000..6bdb50a --- /dev/null +++ b/jnpf-java-boot/jnpf-exception/pom.xml @@ -0,0 +1,31 @@ + + + + jnpf-java-boot + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-exception + + + com.jnpf + jnpf-common-auth + + + com.jnpf + jnpf-common-all + ${project.version} + + + com.jnpf + jnpf-oauth-entity + ${project.version} + + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/controller/LogController.java b/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/controller/LogController.java new file mode 100644 index 0000000..0ac5804 --- /dev/null +++ b/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/controller/LogController.java @@ -0,0 +1,144 @@ +package jnpf.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import jnpf.base.controller.SuperController; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.PaginationTime; +import jnpf.base.vo.PaginationVO; +import jnpf.constant.MsgCode; +import jnpf.entity.LogEntity; +import jnpf.model.*; +import jnpf.service.LogService; +import jnpf.util.JsonUtil; +import jnpf.util.StringUtil; +import org.apache.commons.collections4.map.HashedMap; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +/** + * 系统日志 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Tag(name = "系统日志", description = "Log") +@RestController +@RequestMapping("/api/system/Log") +public class LogController extends SuperController { + + @Autowired + private LogService logService; + + + /** + * 获取系统日志信息 + * + * @param category 主键值分类 1:登录日志,2.访问日志,3.操作日志,4.异常日志,5.请求日志 + * @return + */ + @Operation(summary = "获取系统日志列表") + @Parameters({ + @Parameter(name = "category", description = "分类", required = true) + }) + @SaCheckPermission("system.log") + @GetMapping("/{category}") + public ActionResult getInfoList(@PathVariable("category") String category, PaginationLogModel paginationTime) { + if (StringUtil.isEmpty(category) || !StringUtil.isNumeric(category)) { + return ActionResult.fail("获取失败"); + } + List list = logService.getList(Integer.parseInt(category), paginationTime); + PaginationVO paginationVO = JsonUtil.getJsonToBean(paginationTime, PaginationVO.class); + int i = Integer.parseInt(category); + switch (i) { + case 1: + List loginLogVOList = JsonUtil.getJsonToList(list, LoginLogVO.class); + return ActionResult.page(loginLogVOList, paginationVO); + case 3: + List handleLogVOList = JsonUtil.getJsonToList(list, HandleLogVO.class); + for (int j = 0; j < handleLogVOList.size(); j++) { + handleLogVOList.get(j).setJson(list.get(j).getJsons()); + } + return ActionResult.page(handleLogVOList, paginationVO); + case 4: + List errorLogVOList = JsonUtil.getJsonToList(list, ErrorLogVO.class); + for (int j = 0; j < errorLogVOList.size(); j++) { + errorLogVOList.get(j).setJson(list.get(j).getJsons()); + } + return ActionResult.page(errorLogVOList, paginationVO); + case 5: + List requestLogVOList = JsonUtil.getJsonToList(list, RequestLogVO.class); + return ActionResult.page(requestLogVOList, paginationVO); + default: + return ActionResult.fail("获取失败"); + } + } + + /** + * 批量删除系统日志 + * + * @param logDelForm 批量删除日志模型 + * @return + */ + @Operation(summary = "批量删除系统日志") + @Parameters({ + @Parameter(name = "logDelForm", description = "批量删除日志模型", required = true) + }) + @SaCheckPermission("system.log") + @DeleteMapping + public ActionResult delete(@RequestBody LogDelForm logDelForm) { + boolean flag = logService.delete(logDelForm.getIds()); + if (flag == false) { + return ActionResult.fail(MsgCode.FA003.get()); + } + return ActionResult.success(MsgCode.SU003.get()); + } + + /** + * 一键清空操作日志 + * + * @param type 分类 + * @return + */ + @Operation(summary = "一键清空操作日志") + @Parameters({ + @Parameter(name = "type", description = "分类", required = true) + }) + @SaCheckPermission("system.log") + @DeleteMapping("/{type}") + public ActionResult deleteHandelLog(@PathVariable("type") String type) { + logService.deleteHandleLog(type); + return ActionResult.success(MsgCode.SU005.get()); + } + + /** + * 获取菜单名 + * + * @return + */ + @Operation(summary = "获取菜单名") + @SaCheckPermission("system.log") + @GetMapping("/ModuleName") + public ActionResult>> moduleName() { + List> list = new ArrayList<> (16); + Set set = logService.queryList(); + for (String moduleName : set) { + Map map = new HashedMap<>(1); + map.put("moduleName", moduleName); + list.add(map); + } + return ActionResult.success(list); + } + +} diff --git a/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/entity/LogEntity.java b/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/entity/LogEntity.java new file mode 100644 index 0000000..90ccb98 --- /dev/null +++ b/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/entity/LogEntity.java @@ -0,0 +1,107 @@ +package jnpf.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 系统日志 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Data +@TableName("base_sys_log") +public class LogEntity extends SuperExtendEntity.SuperExtendDescriptionEntity implements Serializable { + /** + * 用户主键 + */ + @TableField("F_USER_ID") + private String userId; + + /** + * 用户主键 + */ + @TableField("F_USER_NAME") + private String userName; + + /** + * 日志类型 + */ + @TableField("F_TYPE") + private Integer type; + + /** + * 日志级别 + */ + @TableField("F_LEVEL") + private Integer levels; + + /** + * IP地址 + */ + @TableField("F_IP_ADDRESS") + private String ipAddress; + + /** + * IP所在城市 + */ + @TableField("F_IP_ADDRESS_NAME") + private String ipAddressName; + + /** + * 请求地址 + */ + @TableField("F_REQUEST_URL") + private String requestUrl; + + /** + * 请求方法 + */ + @TableField("F_REQUEST_METHOD") + private String requestMethod; + + /** + * 请求耗时 + */ + @TableField("F_REQUEST_DURATION") + private Integer requestDuration; + + /** + * 日志内容 + */ + @TableField("F_JSON") + private String jsons; + + /** + * 平台设备 + */ + @TableField("F_PLAT_FORM") + private String platForm; + + /** + * 功能主键 + */ + @TableField("F_MODULE_ID") + private String moduleId; + + /** + * 功能名称 + */ + @TableField("F_MODULE_NAME") + private String moduleName; + + /** + * 对象Id + */ + @TableField("F_OBJECT_ID") + private String objectId; + +} diff --git a/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/enums/LogLevelEnum.java b/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/enums/LogLevelEnum.java new file mode 100644 index 0000000..d68b312 --- /dev/null +++ b/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/enums/LogLevelEnum.java @@ -0,0 +1,76 @@ +package jnpf.enums; + + +/** + * 日志等级 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +public enum LogLevelEnum { + + /** + * 错误 + */ + Error(0,"错误"), + /** + * 成功 + */ + Success(1,"成功"), + /** + * 警告 + */ + Warning(2,"警告"); + + private int code; + private String message; + + LogLevelEnum(int code, String message){ + this.code = code; + this.message = message; + } + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + /** + * 根据状态code获取枚举名称 + * @return + */ + public static String getMessageByCode(Integer code) { + for (LogLevelEnum status : LogLevelEnum.values()) { + if (status.getCode().equals(code)) { + return status.message; + } + } + return null; + } + + /** + * 根据状态code获取枚举值 + * @return + */ + public static LogLevelEnum getByCode(Integer code) { + for (LogLevelEnum status : LogLevelEnum.values()) { + if (status.getCode().equals(code)) { + return status; + } + } + return null; + } +} diff --git a/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/enums/LogSortEnum.java b/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/enums/LogSortEnum.java new file mode 100644 index 0000000..5f3261a --- /dev/null +++ b/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/enums/LogSortEnum.java @@ -0,0 +1,84 @@ +package jnpf.enums; + +/** + * 日志分类 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +public enum LogSortEnum { + /** + * 登录 + */ + Login(1, "登录"), + /** + * 访问 + */ + Visit(2, "访问"), + /** + * 操作 + */ + Operate(3, "操作"), + /** + * 异常 + */ + Exception(4, "异常"), + /** + * 请求 + */ + Request(5, "请求"); + + private int code; + private String message; + + LogSortEnum(int code, String message) { + this.code = code; + this.message = message; + } + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + /** + * 根据状态code获取枚举名称 + * + * @return + */ + public static String getMessageByCode(Integer code) { + for (LogSortEnum status : LogSortEnum.values()) { + if (status.getCode().equals(code)) { + return status.message; + } + } + return null; + } + + /** + * 根据状态code获取枚举值 + * + * @return + */ + public static LogSortEnum getByCode(Integer code) { + for (LogSortEnum status : LogSortEnum.values()) { + if (status.getCode().equals(code)) { + return status; + } + } + return null; + } +} diff --git a/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/exception/ResultException.java b/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/exception/ResultException.java new file mode 100644 index 0000000..19eaae1 --- /dev/null +++ b/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/exception/ResultException.java @@ -0,0 +1,281 @@ +package jnpf.exception; + +import cn.dev33.satoken.exception.SameTokenInvalidException; +import cn.dev33.satoken.exception.NotLoginException; +import cn.dev33.satoken.exception.NotPermissionException; +import cn.dev33.satoken.exception.NotRoleException; +import com.alibaba.fastjson.JSON; +import jnpf.base.ActionResult; +import jnpf.base.ActionResultCode; +import jnpf.base.LogSortEnum; +import jnpf.base.UserInfo; +import jnpf.config.ConfigValueUtil; +import jnpf.database.util.NotTenantPluginHolder; +import jnpf.entity.LogEntity; +import jnpf.service.LogService; +import jnpf.util.*; +import jnpf.util.data.DataSourceContextHolder; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.web.ErrorProperties; +import org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController; +import org.springframework.boot.web.servlet.error.DefaultErrorAttributes; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.validation.ObjectError; +import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/16 10:10 + */ +@Slf4j +@Controller +@ControllerAdvice +public class ResultException extends BasicErrorController { + + @Autowired + private UserProvider userProvider; + @Autowired + private LogService logService; + @Autowired + private ConfigValueUtil configValueUtil; + + public ResultException(){ + super(new DefaultErrorAttributes(), new ErrorProperties()); + } + + @ResponseBody + @ExceptionHandler(value = LoginException.class) + public ActionResult loginException(LoginException e) { + ActionResult result = ActionResult.fail(ActionResultCode.Fail.getCode(), e.getMessage()); + return result; + } + + @ResponseBody + @ExceptionHandler(value = ImportException.class) + public ActionResult loginException(ImportException e) { + ActionResult result = ActionResult.fail(ActionResultCode.Fail.getCode(), e.getMessage()); + return result; + } + +// @ResponseBody +// @ExceptionHandler(value = FileNotException.class) +// public ActionResult loginException(FileNotException e) { +// ActionResult result = ActionResult.fail(ActionResultCode.Fail.getCode(), "文件不存在"); +// return result; +// } + + /** + * 自定义异常内容返回 + * + * @param e + * @return + */ + @ResponseBody + @ExceptionHandler(value = DataException.class) + public ActionResult dataException(DataException e) { + ActionResult result = ActionResult.fail(ActionResultCode.Fail.getCode(), e.getMessage()); + return result; + } + +/// +// @ResponseBody +// @ExceptionHandler(value = SQLSyntaxErrorException.class) +// public ActionResult sqlException(SQLSyntaxErrorException e) { +// ActionResult result; +// log.error(e.getMessage()); +// e.printStackTrace(); +// if (e.getMessage().contains("Unknown database")) { +// printLog(e, "请求失败"); +// result = ActionResult.fail(ActionResultCode.Fail.getCode(), "请求失败"); +// } else { +// printLog(e, "数据库异常"); +// result = ActionResult.fail(ActionResultCode.Fail.getCode(), "数据库异常"); +// } +// return result; +// } +// +// @ResponseBody +// @ExceptionHandler(value = SQLServerException.class) +// public ActionResult sqlServerException(SQLServerException e) { +// ActionResult result; +// printLog(e, "系统异常"); +// if (e.getMessage().contains("将截断字符串")) { +// printLog(e, "某个字段字符长度超过限制,请检查。"); +// result = ActionResult.fail(ActionResultCode.Fail.getCode(), "某个字段字符长度超过限制,请检查。"); +// } else { +// log.error(e.getMessage()); +// printLog(e, "数据库异常,请检查。"); +// result = ActionResult.fail(ActionResultCode.Fail.getCode(), "数据库异常,请检查。"); +// } +// return result; +// } + + @ResponseBody + @ExceptionHandler(value = MethodArgumentNotValidException.class) + public ActionResult methodArgumentNotValidException(MethodArgumentNotValidException e) { + Map map = new HashMap<>(16); + List allErrors = e.getBindingResult().getAllErrors(); + for (int i = 0; i < allErrors.size(); i++) { + String s = allErrors.get(i).getCodes()[0]; + //用分割的方法得到字段名 + String[] parts = s.split("\\."); + String part1 = parts[parts.length - 1]; + map.put(part1, allErrors.get(i).getDefaultMessage()); + } + String json = JSON.toJSONString(map); + ActionResult result = ActionResult.fail(ActionResultCode.ValidateError.getCode(), json); + printLog(e, "字段验证异常"); + return result; + } + + @ResponseBody + @ExceptionHandler(value = WorkFlowException.class) + public ActionResult workFlowException(WorkFlowException e) { + if (e.getCode() == 200) { + List> list = JsonUtil.getJsonToListMap(e.getMessage()); + return ActionResult.success(list); + } else { + return ActionResult.fail(e.getMessage()); + } + } + + @ResponseBody + @ExceptionHandler(value = WxErrorException.class) + public ActionResult wxErrorException(WxErrorException e) { + return ActionResult.fail(e.getError().getErrorCode(), "操作过于频繁"); + } + + @ResponseBody + @ExceptionHandler(value = ServletException.class) + public void exception(ServletException e) throws Exception { + log.error("系统异常:" + e.getMessage(), e); + printLog(e, "系统异常"); + throw new Exception(); + } + + @ResponseBody + @ExceptionHandler(value = Exception.class) + public ActionResult exception(Exception e) { + log.error("系统异常:" + e.getMessage(), e); + printLog(e, "系统异常"); + return ActionResult.fail(ActionResultCode.Fail.getCode(), "系统异常"); + } + + /** + * 权限码异常 + */ + @ResponseBody + @ExceptionHandler(NotPermissionException.class) + public ActionResult handleNotPermissionException(NotPermissionException e) { + return ActionResult.fail(ActionResultCode.Fail.getCode(), "没有访问权限,请联系管理员授权"); + } + + /** + * 角色权限异常 + */ + @ResponseBody + @ExceptionHandler(NotRoleException.class) + public ActionResult handleNotRoleException(NotRoleException e) { + return ActionResult.fail(ActionResultCode.ValidateError.getCode(), "没有访问权限,请联系管理员授权"); + } + + /** + * 认证失败 + */ + @ResponseBody + @ExceptionHandler(NotLoginException.class) + public ActionResult handleNotLoginException(NotLoginException e) { + return ActionResult.fail(ActionResultCode.SessionOverdue.getCode(), "认证失败,无法访问系统资源"); + } + + /** + * 无效认证 + */ + @ResponseBody + @ExceptionHandler(SameTokenInvalidException.class) + public ActionResult handleIdTokenInvalidException(SameTokenInvalidException e) { + return ActionResult.fail(ActionResultCode.SessionOverdue.getCode(), "无效内部认证,无法访问系统资源"); + } + + private void printLog(Exception e, String module) { + try { + UserInfo userInfo = userProvider.get(); + if (userInfo.getId() == null) { + e.printStackTrace(); + return; + } + //接口错误将不会进入数据库切源拦截器需要手动设置 + if (configValueUtil.isMultiTenancy() && DataSourceContextHolder.getDatasourceId() == null) { + DataSourceContextHolder.setDatasource(userInfo.getTenantId(), userInfo.getTenantDbConnectionString(), userInfo.isAssignDataSource()); + } + LogEntity entity = new LogEntity(); + entity.setId(RandomUtil.uuId()); + entity.setType(LogSortEnum.Operate.getCode()); + entity.setUserId(userInfo.getUserId()); + entity.setUserName(userInfo.getUserName() + "/" + userInfo.getUserAccount()); + if (!ServletUtil.getIsMobileDevice()) { + String modelName = module; + entity.setModuleName(modelName); + } + StringBuilder sb = new StringBuilder(); + sb.append(e.toString() + "\n"); + StackTraceElement[] stackArray = e.getStackTrace(); + for (int i = 0; i < stackArray.length; i++) { + StackTraceElement element = stackArray[i]; + sb.append(element.toString() + "\n"); + } + entity.setJsons(sb.toString()); + entity.setRequestUrl(ServletUtil.getRequest().getServletPath()); + entity.setRequestMethod(ServletUtil.getRequest().getMethod()); + entity.setType(4); + entity.setUserId(userInfo.getUserId()); + entity.setIpAddress(IpUtil.getIpAddr()); + entity.setCreatorTime(new Date()); + entity.setPlatForm(ServletUtil.getUserAgent()); + if (configValueUtil.isMultiTenancy() && StringUtil.isEmpty(DataSourceContextHolder.getDatasourceId())) { + log.error("请求异常, 无登陆租户:" + ReflectionUtil.toString(entity), e); + } else { + logService.save(entity); + } + }catch (Exception g){ + log.error(g.getMessage()); + }finally { + UserProvider.clearLocalUser(); + TenantProvider.clearBaseSystemIfo(); + DataSourceContextHolder.clearDatasourceType(); + NotTenantPluginHolder.clearNotSwitchFlag(); + } + } + + + /** + * 覆盖默认的JSON响应 + */ + @Override + @RequestMapping + public ResponseEntity> error(HttpServletRequest request) { + HttpStatus status = getStatus(request); + + if (status == HttpStatus.NOT_FOUND) { + return new ResponseEntity<>(status); + } + return super.error(request); + } + +} diff --git a/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/mapper/LogMapper.java b/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/mapper/LogMapper.java new file mode 100644 index 0000000..7704ef6 --- /dev/null +++ b/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/mapper/LogMapper.java @@ -0,0 +1,18 @@ +package jnpf.mapper; + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.entity.LogEntity; + + +/** + * 系统日志 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +public interface LogMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/model/ErrorLogVO.java b/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/model/ErrorLogVO.java new file mode 100644 index 0000000..d5dedce --- /dev/null +++ b/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/model/ErrorLogVO.java @@ -0,0 +1,27 @@ +package jnpf.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/16 10:10 + */ +@Data +public class ErrorLogVO { + @Schema(description = "创建用户") + private String userName; + @Schema(description = "创建时间",example = "1") + private Long creatorTime; + @Schema(description = "IP") + private String ipaddress; + @Schema(description = "id") + private String id; + @Schema(description = "异常功能") + private String moduleName; + @Schema(description = "异常描述") + private String json; +} diff --git a/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/model/HandleLogVO.java b/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/model/HandleLogVO.java new file mode 100644 index 0000000..72deced --- /dev/null +++ b/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/model/HandleLogVO.java @@ -0,0 +1,63 @@ +package jnpf.model; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 操作日志模型 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/16 10:10 + */ +@Data +public class HandleLogVO implements Serializable { + + /** + * id + */ + public String id; + + /** + * 请求时间 + */ + public Long creatorTime; + + /** + * 请求用户名 + */ + public String userName; + + /** + * 请求IP + */ + public String ipaddress; + + /** + * 请求设备 + */ + public String platForm; + + /** + * 操作模块 + */ + public String moduleName; + + /** + * 操作类型 + */ + public String requestMethod; + + /** + * 请求耗时 + */ + public int requestDuration; + + /** + * 操作记录 + */ + public String json; + +} diff --git a/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/model/LogDelForm.java b/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/model/LogDelForm.java new file mode 100644 index 0000000..45f0561 --- /dev/null +++ b/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/model/LogDelForm.java @@ -0,0 +1,18 @@ +package jnpf.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/16 10:10 + */ +@Data +public class LogDelForm { + @Schema(description = "id集合") + private String[] ids; +} + diff --git a/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/model/LoginLogVO.java b/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/model/LoginLogVO.java new file mode 100644 index 0000000..a7caf4d --- /dev/null +++ b/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/model/LoginLogVO.java @@ -0,0 +1,27 @@ +package jnpf.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/16 10:10 + */ +@Data +public class LoginLogVO { + @Schema(description = "id") + private String id; + @Schema(description = "创建时间",example = "1") + private Long creatorTime; + @Schema(description = "登陆用户") + private String userName; + @Schema(description = "登陆IP") + private String ipaddress; + @Schema(description = "登陆平台") + private String platForm; + @Schema(description = "登陆日志摘要") + private String abstracts; +} diff --git a/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/model/PaginationLogModel.java b/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/model/PaginationLogModel.java new file mode 100644 index 0000000..41b01a9 --- /dev/null +++ b/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/model/PaginationLogModel.java @@ -0,0 +1,34 @@ +package jnpf.model; + +import jnpf.base.PaginationTime; +import lombok.Data; + +/** + * 日志分页参数 + * + * @author :JNPF开发平台组 + * @version: V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date :2022/3/18 9:50 + */ +@Data +public class PaginationLogModel extends PaginationTime { + + /** + * 操作用户 + */ + private String userName; + /** + * 操作ip + */ + private String ipaddress; + /** + * 操作模块 + */ + private String moduleName; + /** + * 操作类型 + */ + private String requestMethod; + +} diff --git a/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/model/RequestLogVO.java b/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/model/RequestLogVO.java new file mode 100644 index 0000000..07307fb --- /dev/null +++ b/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/model/RequestLogVO.java @@ -0,0 +1,31 @@ +package jnpf.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/16 10:10 + */ +@Data +public class RequestLogVO { + @Schema(description = "id") + private String id; + @Schema(description = "请求时间",example = "1") + private Long creatorTime; + @Schema(description = "请求用户名") + private String userName; + @Schema(description = "请求IP") + private String ipaddress; + @Schema(description = "请求设备") + private String platForm; + @Schema(description = "请求地址") + private String requestURL; + @Schema(description = "请求类型") + private String requestMethod; + @Schema(description = "请求耗时",example = "1") + private Long requestDuration; +} diff --git a/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/service/LogService.java b/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/service/LogService.java new file mode 100644 index 0000000..705dd4c --- /dev/null +++ b/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/service/LogService.java @@ -0,0 +1,83 @@ +package jnpf.service; + +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import jnpf.base.PaginationTime; +import jnpf.entity.LogEntity; +import jnpf.model.PaginationLogModel; +import jnpf.model.UserLogForm; + +import java.util.List; +import java.util.Set; + +/** + * 系统日志 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +public interface LogService extends SuperService { + + /** + * 列表 + * + * @param userLogForm + * @return + */ + List getList(UserLogForm userLogForm); + + /** + * 列表 + * + * @param category 日志分类 + * @param paginationTime 分页条件 + * @return + */ + List getList(int category, PaginationLogModel paginationTime); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + LogEntity getInfo(String id); + + + /** + * 删除 + * @param ids + * @return + */ + boolean delete(String[] ids); + + /** + * 写入日志 + * + * @param userId 用户Id + * @param userName 用户名称 + * @param abstracts 摘要 + */ + void writeLogAsync(String userId, String userName, String abstracts); + + /** + * 请求日志 + * + * @param logEntity 实体对象 + */ + void writeLogAsync(LogEntity logEntity); + + /** + * 请求日志 + */ + void deleteHandleLog(String type); + + /** + * 获取操作模块名 + * + * @return + */ + Set queryList(); +} diff --git a/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/service/impl/LogServiceImpl.java b/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/service/impl/LogServiceImpl.java new file mode 100644 index 0000000..2346b4b --- /dev/null +++ b/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/service/impl/LogServiceImpl.java @@ -0,0 +1,182 @@ +package jnpf.service.impl; + +import jnpf.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import jnpf.base.PaginationTime; +import jnpf.base.UserInfo; +import jnpf.entity.LogEntity; +import jnpf.enums.LogSortEnum; +import jnpf.mapper.LogMapper; +import jnpf.model.PaginationLogModel; +import jnpf.model.UserLogForm; +import jnpf.service.LogService; +import jnpf.util.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 系统日志 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Service +public class LogServiceImpl extends SuperServiceImpl implements LogService { + + @Autowired + private UserProvider userProvider; + + @Override + public List getList(int category, PaginationLogModel paginationTime) { + UserInfo userInfo = userProvider.get(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(LogEntity::getType, category); + //日期范围(近7天、近1月、近3月、自定义) + String startTime = paginationTime.getStartTime() != null ? paginationTime.getStartTime() : null; + String endTime = paginationTime.getEndTime() != null ? paginationTime.getEndTime() : null; + if (!StringUtil.isEmpty(startTime) && !StringUtil.isEmpty(endTime)) { + Date startTimes = DateUtil.stringToDate(DateUtil.daFormatYmd(Long.parseLong(startTime)) + " 00:00:00"); + Date endTimes = DateUtil.stringToDate(DateUtil.daFormatYmd(Long.parseLong(endTime)) + " 23:59:59"); + queryWrapper.lambda().ge(LogEntity::getCreatorTime, startTimes).le(LogEntity::getCreatorTime, endTimes); + } + //关键字(用户、IP地址、功能名称) + String keyWord = paginationTime.getKeyword() != null ? paginationTime.getKeyword() : null; + if (!StringUtil.isEmpty(keyWord)) { + queryWrapper.lambda().and( + t -> t.like(LogEntity::getUserName, keyWord) + .or().like(LogEntity::getIpAddress, keyWord) + .or().like(LogEntity::getModuleName, keyWord) + ); + } + //用户Id + String userId = userInfo.getUserId() != null ? userInfo.getUserId() : null; + String userAccount = userInfo.getUserAccount() != null ? userInfo.getUserAccount() : null; + if (!StringUtil.isEmpty(userId) && !StringUtil.isEmpty(userAccount)) { + if (!userInfo.getIsAdministrator()){ + queryWrapper.lambda().and( + t -> t.eq(LogEntity::getUserId, userId) + .or().eq(LogEntity::getUserId, userAccount) + ); + } + } + // 操作ip + if (StringUtil.isNotEmpty(paginationTime.getIpaddress())) { + queryWrapper.lambda().like(LogEntity::getIpAddress, paginationTime.getIpaddress()); + } + // 操作模块 + if (StringUtil.isNotEmpty(paginationTime.getModuleName())) { + queryWrapper.lambda().like(LogEntity::getModuleName, paginationTime.getModuleName()); + } + // 操作类型 + if (StringUtil.isNotEmpty(paginationTime.getRequestMethod())) { + queryWrapper.lambda().eq(LogEntity::getRequestMethod, paginationTime.getRequestMethod()); + } + //排序 + queryWrapper.lambda().orderByDesc(LogEntity::getCreatorTime); + Page page = new Page<>(paginationTime.getCurrentPage(), paginationTime.getPageSize()); + IPage userPage = this.page(page, queryWrapper); + return paginationTime.setData(userPage.getRecords(), page.getTotal()); + } + + @Override + public List getList(UserLogForm userLogForm) { + UserInfo userInfo = userProvider.get(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(LogEntity::getType, userLogForm.getCategory()); + //日期范围(近7天、近1月、近3月、自定义) + if (!StringUtil.isEmpty(userLogForm.getStartTime()) && !StringUtil.isEmpty(userLogForm.getEndTime())) { + Date startTimes = DateUtil.stringToDate(DateUtil.daFormatYmd(Long.parseLong(userLogForm.getStartTime())) + " 00:00:00"); + Date endTimes = DateUtil.stringToDate(DateUtil.daFormatYmd(Long.parseLong(userLogForm.getEndTime())) + " 23:59:59"); + queryWrapper.lambda().ge(LogEntity::getCreatorTime, startTimes).le(LogEntity::getCreatorTime, endTimes); + } + //关键字(用户、IP地址、功能名称) + String keyWord = userLogForm.getKeyword(); + if (!StringUtil.isEmpty(keyWord)) { + queryWrapper.lambda().and( + t -> t.like(LogEntity::getUserName, keyWord) + .or().like(LogEntity::getIpAddress, keyWord) + .or().like(LogEntity::getModuleName, keyWord) + ); + } + //用户Id + String userId = userInfo.getUserId() != null ? userInfo.getUserId() : null; + String userAccount = userInfo.getUserAccount() != null ? userInfo.getUserAccount() : null; + if (!StringUtil.isEmpty(userId) && !StringUtil.isEmpty(userAccount)) { + queryWrapper.lambda().and( + t -> t.eq(LogEntity::getUserId, userId) + .or().eq(LogEntity::getUserId, userAccount) + ); + } + //排序 + if (StringUtil.isEmpty(userLogForm.getSidx())) { + queryWrapper.lambda().orderByDesc(LogEntity::getCreatorTime); + } else { + queryWrapper = "asc".equals(userLogForm.getSort().toLowerCase()) ? queryWrapper.orderByAsc(userLogForm.getSidx()) : queryWrapper.orderByDesc(userLogForm.getSidx()); + } + Page page = new Page<>(userLogForm.getCurrentPage(), userLogForm.getPageSize()); + IPage userPage = this.page(page, queryWrapper); + return userLogForm.setData(userPage.getRecords(), page.getTotal()); + } + + @Override + public LogEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(LogEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + @DSTransactional + public boolean delete(String[] ids) { + if (ids.length > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(LogEntity::getId, ids); + return this.remove(queryWrapper); + } + return false; + } + + @Override + public void writeLogAsync(String userId, String userName, String abstracts) { + LogEntity entity = new LogEntity(); + entity.setId(RandomUtil.uuId()); + entity.setUserId(userId); + entity.setUserName(userName); + entity.setDescription(abstracts); + entity.setRequestUrl(ServletUtil.getServletPath()); + entity.setRequestMethod(ServletUtil.getRequest().getMethod()); + entity.setIpAddress(IpUtil.getIpAddr()); + entity.setPlatForm(ServletUtil.getUserAgent()); + entity.setType(LogSortEnum.Login.getCode()); + this.save(entity); + } + + @Override + public void writeLogAsync(LogEntity entity) { + entity.setId(RandomUtil.uuId()); + this.save(entity); + } + + @Override + public void deleteHandleLog(String type) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(LogEntity::getType, Integer.valueOf(type)); + this.remove(queryWrapper); + } + + @Override + public Set queryList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(LogEntity::getType, 3); + return this.list(queryWrapper).size() > 0 ? this.list(queryWrapper).stream().map(t -> t.getModuleName()).collect(Collectors.toSet()) : new HashSet<>(16); + } +} diff --git a/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/util/JsonUtilEx.java b/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/util/JsonUtilEx.java new file mode 100644 index 0000000..e94078c --- /dev/null +++ b/jnpf-java-boot/jnpf-exception/src/main/java/jnpf/util/JsonUtilEx.java @@ -0,0 +1,78 @@ +package jnpf.util; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.serializer.SerializerFeature; +import jnpf.constant.MsgCode; +import jnpf.exception.DataException; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/16 10:10 + */ +public class JsonUtilEx { + + + /** + * 功能描述:把java对象转换成JSON数据,时间格式化 + * @param object java对象 + * @return JSON数据 + */ + public static String getObjectToStringDateFormat(Object object,String dateFormat) { + return JSON.toJSONStringWithDateFormat(object, dateFormat,SerializerFeature.WriteMapNullValue); + } + +// /** +// * 功能描述:把JSON数据转换成指定的java对象列表 +// * @param jsonData JSON数据 +// * @param clazz 指定的java对象 +// * @return List +// */ +// public static List getJsonToListStringDateFormat(String jsonData, Class clazz,String dateFormat) { +// JSONArray jsonArray=JSONUtil.getJsonToJsonArray(jsonData); +// JSONArray newJsonArray=JSONUtil.getJsonToJsonArray(jsonData); +// for (int i = 0; i < jsonArray.size(); i++) { +// JSONObject jsonObject = jsonArray.getJSONObject(i); +// newJsonArray.add(JSON.toJSONStringWithDateFormat(jsonObject, dateFormat,SerializerFeature.WriteMapNullValue)); +// } +// jsonData=JSONUtil.getObjectToString(newJsonArray); +// return JSON.parseArray(jsonData, clazz); +// } +// +// public static void main(String[] args) { +// Date date=new Date(); +// String obk="[" + +// "{\"date\":\""+date+"\"},{\"date\":\"1603165505\"}" + +// "]"; +// List list1= getJsonToList(obk,String.class); +// List list11= getJsonToListStringDateFormat(obk,String.class,"yyyy-MM-dd"); +// System.out.println("aaa"); +// } + + + /** + * 功能描述:把java对象转换成JSON数据 + * @param object java对象 + * @return JSON数据 + */ + public static String getObjectToString(Object object) { + return JSON.toJSONString(object, SerializerFeature.WriteMapNullValue); + } + + /** + * 功能描述:把JSON数据转换成指定的java对象 + * @param dto dto对象 + * @param clazz 指定的java对象 + * @return 指定的java对象 + */ + public static T getJsonToBeanEx(Object dto, Class clazz) throws DataException { + if(dto==null){ + throw new DataException(MsgCode.FA001.get()); + } + return JSON.parseObject(getObjectToString(dto), clazz); + } + + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/pom.xml b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/pom.xml new file mode 100644 index 0000000..1b486b8 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/pom.xml @@ -0,0 +1,40 @@ + + + + jnpf-extend + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-extend-biz + + + + com.jnpf + jnpf-extend-entity + ${project.version} + + + org.springframework.boot + spring-boot-starter-mail + + + com.jnpf + jnpf-system-biz + ${project.version} + + + + com.itextpdf + itextpdf + + + com.itextpdf + itext-asian + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/BigDataMapper.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/BigDataMapper.java new file mode 100644 index 0000000..679b49f --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/BigDataMapper.java @@ -0,0 +1,19 @@ +package jnpf.mapper; + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.entity.BigDataEntity; + +/** + * 大数据测试 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +public interface BigDataMapper extends SuperMapper { + + Integer maxCode(); + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/CustomerMapper.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/CustomerMapper.java new file mode 100644 index 0000000..cffae3d --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/CustomerMapper.java @@ -0,0 +1,17 @@ +package jnpf.mapper; + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.entity.CustomerEntity; + +/** + * + * 客户信息 + * 版本: V3.1.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2021-07-10 14:09:05 + */ +public interface CustomerMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/DocumentMapper.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/DocumentMapper.java new file mode 100644 index 0000000..1346877 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/DocumentMapper.java @@ -0,0 +1,41 @@ +package jnpf.mapper; + + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.entity.DocumentEntity; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 知识文档 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +public interface DocumentMapper extends SuperMapper { + + /** + * 列表(共享给我) + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/15 10:26 + */ + List getShareTomeList(@Param("userId") String userId); + + /** + * 列表(全部下级数据) + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/15 10:26 + */ + List getChildList(@Param("folderId") String folderId); + + int trashRecovery(@Param("id") String id); +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/DocumentShareMapper.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/DocumentShareMapper.java new file mode 100644 index 0000000..050e126 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/DocumentShareMapper.java @@ -0,0 +1,18 @@ +package jnpf.mapper; + + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.entity.DocumentShareEntity; + +/** + * 知识文档 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +public interface DocumentShareMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/EmailConfigMapper.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/EmailConfigMapper.java new file mode 100644 index 0000000..a49bcc6 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/EmailConfigMapper.java @@ -0,0 +1,18 @@ +package jnpf.mapper; + + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.base.entity.EmailConfigEntity; + +/** + * 邮件配置 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +public interface EmailConfigMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/EmailReceiveMapper.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/EmailReceiveMapper.java new file mode 100644 index 0000000..9da7920 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/EmailReceiveMapper.java @@ -0,0 +1,17 @@ +package jnpf.mapper; + + +import jnpf.base.mapper.SuperMapper; +import jnpf.entity.EmailReceiveEntity; + +/** + * 邮件接收 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +public interface EmailReceiveMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/EmailSendMapper.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/EmailSendMapper.java new file mode 100644 index 0000000..1d843a1 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/EmailSendMapper.java @@ -0,0 +1,18 @@ +package jnpf.mapper; + + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.entity.EmailSendEntity; + +/** + * 邮件发送 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +public interface EmailSendMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/EmployeeMapper.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/EmployeeMapper.java new file mode 100644 index 0000000..91d43a8 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/EmployeeMapper.java @@ -0,0 +1,18 @@ +package jnpf.mapper; + + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.entity.EmployeeEntity; + +/** + * 职员信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +public interface EmployeeMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/OrderEntryMapper.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/OrderEntryMapper.java new file mode 100644 index 0000000..2ab2351 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/OrderEntryMapper.java @@ -0,0 +1,17 @@ +package jnpf.mapper; + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.entity.OrderEntryEntity; + +/** + * 订单明细 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +public interface OrderEntryMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/OrderMapper.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/OrderMapper.java new file mode 100644 index 0000000..43d35e9 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/OrderMapper.java @@ -0,0 +1,17 @@ +package jnpf.mapper; + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.entity.OrderEntity; + +/** + * 订单信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +public interface OrderMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/OrderReceivableMapper.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/OrderReceivableMapper.java new file mode 100644 index 0000000..5621caa --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/OrderReceivableMapper.java @@ -0,0 +1,17 @@ +package jnpf.mapper; + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.entity.OrderReceivableEntity; + +/** + * 订单收款 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +public interface OrderReceivableMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/ProductEntryMapper.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/ProductEntryMapper.java new file mode 100644 index 0000000..d2894d8 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/ProductEntryMapper.java @@ -0,0 +1,18 @@ +package jnpf.mapper; + + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.entity.ProductEntryEntity; + +/** + * + * base_productentry + * 版本: V3.1.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2021-07-10 10:40:59 + */ +public interface ProductEntryMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/ProductGoodsMapper.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/ProductGoodsMapper.java new file mode 100644 index 0000000..1a8e873 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/ProductGoodsMapper.java @@ -0,0 +1,17 @@ +package jnpf.mapper; + + +import jnpf.base.mapper.SuperMapper; +import jnpf.entity.ProductGoodsEntity; + +/** + * + * 产品商品 + * 版本: V3.1.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2021-07-10 15:57:50 + */ +public interface ProductGoodsMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/ProductMapper.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/ProductMapper.java new file mode 100644 index 0000000..3df3c32 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/ProductMapper.java @@ -0,0 +1,18 @@ +package jnpf.mapper; + + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.entity.ProductEntity; + +/** + * + * 销售订单 + * 版本: V3.1.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2021-07-10 10:40:59 + */ +public interface ProductMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/ProductclassifyMapper.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/ProductclassifyMapper.java new file mode 100644 index 0000000..e2f3152 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/ProductclassifyMapper.java @@ -0,0 +1,17 @@ +package jnpf.mapper; + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.entity.ProductclassifyEntity; + +/** + * + * 产品分类 + * 版本: V3.1.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2021-07-10 14:34:04 + */ +public interface ProductclassifyMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/ProjectGanttMapper.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/ProjectGanttMapper.java new file mode 100644 index 0000000..2acb0ab --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/ProjectGanttMapper.java @@ -0,0 +1,18 @@ +package jnpf.mapper; + + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.entity.ProjectGanttEntity; + +/** + * 订单收款 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +public interface ProjectGanttMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/TableExampleMapper.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/TableExampleMapper.java new file mode 100644 index 0000000..08cdea0 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/TableExampleMapper.java @@ -0,0 +1,18 @@ +package jnpf.mapper; + + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.entity.TableExampleEntity; + +/** + * 表格示例数据 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +public interface TableExampleMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/WorkLogMapper.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/WorkLogMapper.java new file mode 100644 index 0000000..3bf9963 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/WorkLogMapper.java @@ -0,0 +1,18 @@ +package jnpf.mapper; + + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.entity.WorkLogEntity; + +/** + * 工作日志 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +public interface WorkLogMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/WorkLogShareMapper.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/WorkLogShareMapper.java new file mode 100644 index 0000000..6d881fd --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/mapper/WorkLogShareMapper.java @@ -0,0 +1,18 @@ +package jnpf.mapper; + + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.entity.WorkLogShareEntity; + +/** + * 工作日志分享 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +public interface WorkLogShareMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/BigDataService.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/BigDataService.java new file mode 100644 index 0000000..4131974 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/BigDataService.java @@ -0,0 +1,34 @@ +package jnpf.service; + +import jnpf.base.Pagination; +import jnpf.base.service.SuperService; +import jnpf.entity.BigDataEntity; +import jnpf.exception.WorkFlowException; + +import java.util.List; + +/** + * 大数据测试 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月26日 上午9:18 + */ +public interface BigDataService extends SuperService { + + /** + * 列表 + * + * @param pagination 分页参数 + * @return + */ + List getList(Pagination pagination); + + /** + * 创建 + * @param insertCount 添加数量 + * @throws WorkFlowException + */ + void create(int insertCount) throws WorkFlowException; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/CustomerService.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/CustomerService.java new file mode 100644 index 0000000..2a3819a --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/CustomerService.java @@ -0,0 +1,29 @@ +package jnpf.service; + +import jnpf.base.Pagination; +import jnpf.base.service.SuperService; +import jnpf.entity.CustomerEntity; + +import java.util.List; + +/** + * + * 客户信息 + * 版本: V3.1.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2021-07-10 14:09:05 + */ +public interface CustomerService extends SuperService { + + List getList(Pagination pagination); + + CustomerEntity getInfo(String id); + + void delete(CustomerEntity entity); + + void create(CustomerEntity entity); + + boolean update( String id, CustomerEntity entity); + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/DocumentService.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/DocumentService.java new file mode 100644 index 0000000..da3efa2 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/DocumentService.java @@ -0,0 +1,141 @@ +package jnpf.service; + + +import jnpf.base.service.SuperService; +import jnpf.entity.DocumentEntity; +import jnpf.entity.DocumentShareEntity; + +import java.util.List; + +/** + * 知识文档 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月26日 上午9:18 + */ +public interface DocumentService extends SuperService { + + /** + * 列表(全部文档) + * + * @return + */ + List getFolderList(); + + /** + * 列表(全部文档) + * + * @param parentId 文档父级 + * @return + */ + List getAllList(String parentId); + + /** + * 列表(回收站) + * @return + */ + List getTrashList(); + + /** + * 列表(我的共享) + * @return + */ + List getShareOutList(); + + /** + * 列表(共享给我) + * @return + */ + List getShareTomeList(); + + /** + * 列表(共享人员) + * + * @param documentId 文档主键 + * @return + */ + List getShareUserList(String documentId); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + DocumentEntity getInfo(String id); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(DocumentEntity entity); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(DocumentEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return + */ + boolean update(String id, DocumentEntity entity); + + /** + * 共享文件(创建) + * + * @param documentId 文档主键 + * @param shareUserId 共享用户 + * @return + */ + boolean sharecreate(String documentId, String[] shareUserId); + + /** + * 共享文件(取消) + * + * @param documentId 文档主键 + * @return + */ + boolean shareCancel(String documentId); + + /** + * 回收站(删除) + * + * @param folderId 文件夹主键值 + * @return + */ + void trashdelete(String folderId); + + /** + * 回收站(还原) + * @param id 主键值 + * @return + */ + boolean trashRecovery(String id); + + /** + * 文件/夹移动到 + * + * @param id 主键值 + * @param toId 将要移动到Id + * @return + */ + boolean moveTo(String id, String toId); + + /** + * 验证文件名是否重复 + * + * @param id 主键值 + * @param fullName 文件夹名称 + * @return + */ + boolean isExistByFullName(String fullName, String id, String parentId); +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/DocumentShareService.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/DocumentShareService.java new file mode 100644 index 0000000..a118518 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/DocumentShareService.java @@ -0,0 +1,17 @@ +package jnpf.service; + +import jnpf.base.service.SuperService; +import jnpf.entity.DocumentShareEntity; + + +/** + * 大数据测试 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月26日 上午9:18 + */ +public interface DocumentShareService extends SuperService { + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/EmailConfigService.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/EmailConfigService.java new file mode 100644 index 0000000..84bf33a --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/EmailConfigService.java @@ -0,0 +1,17 @@ +package jnpf.service; + +import jnpf.base.entity.EmailConfigEntity; +import jnpf.base.service.SuperService; + + +/** + * 邮件配置 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月26日 上午9:18 + */ +public interface EmailConfigService extends SuperService { + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/EmailReceiveService.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/EmailReceiveService.java new file mode 100644 index 0000000..0f53cb8 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/EmailReceiveService.java @@ -0,0 +1,149 @@ +package jnpf.service; + +import jnpf.base.PaginationTime; +import jnpf.base.entity.EmailConfigEntity; +import jnpf.base.service.SuperService; +import jnpf.entity.EmailReceiveEntity; +import jnpf.entity.EmailSendEntity; +import jnpf.exception.DataException; + +import java.util.List; + +/** + * 邮件接收 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月26日 上午9:18 + */ +public interface EmailReceiveService extends SuperService { + + /** + * 列表(收件箱) + * + * @param paginationTime 分页条件 + * @return + */ + List getReceiveList(PaginationTime paginationTime); + + /** + * 列表(收件箱) + * + * @return + */ + List getReceiveList(); + + /** + * 列表(收件箱) + * 门户专用 + * + * @return + */ + List getDashboardReceiveList(); + + /** + * 列表(星标件) + * + * @param paginationTime 分页条件 + * @return + */ + List getStarredList(PaginationTime paginationTime); + + /** + * 列表(草稿箱) + * + * @param paginationTime 分页条件 + * @return + */ + List getDraftList(PaginationTime paginationTime); + + /** + * 列表(已发送) + * + * @param paginationTime 分页条件 + * @return + */ + List getSentList(PaginationTime paginationTime); + + /** + * 信息(配置) + * + * @return + */ + EmailConfigEntity getConfigInfo(); + + /** + * 信息(配置) + * @param userId + * @return + */ + EmailConfigEntity getConfigInfo(String userId); + + /** + * 信息(收件/发件) + * + * @param id 主键值 + * @return + */ + Object getInfo(String id); + + /** + * 删除邮件(发、收) + * + * @param id 主键值 + * @return + */ + boolean delete(String id); + + /** + * 存草稿 + * + * @param entity 实体对象 + */ + void saveDraft(EmailSendEntity entity); + + /** + * 收邮件设置 已读/未读 + * + * @param id + * @param isRead + * @return + */ + boolean receiveRead(String id, int isRead); + + /** + * 收邮件 星标邮件/取消星标 + * + * @param id + * @param isStarred + * @return + */ + boolean receiveStarred(String id, int isStarred); + + /** + * 保存邮箱配置 + * + * @param configEntity + * @throws DataException + * @return + */ + void saveConfig(EmailConfigEntity configEntity) throws DataException; + + /** + * 发邮件 + * + * @param entity 实体对象 + * @param mailConfig 邮件配置 + * @return + */ + int saveSent(EmailSendEntity entity, EmailConfigEntity mailConfig) ; + + /** + * 收邮件 + * + * @param mailConfig 邮件配置 + * @return + */ + int receive(EmailConfigEntity mailConfig); +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/EmailSendService.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/EmailSendService.java new file mode 100644 index 0000000..3691632 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/EmailSendService.java @@ -0,0 +1,17 @@ +package jnpf.service; + +import jnpf.base.service.SuperService; +import jnpf.entity.EmailSendEntity; + + +/** + * 邮件发送 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月26日 上午9:18 + */ +public interface EmailSendService extends SuperService { + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/EmployeeService.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/EmployeeService.java new file mode 100644 index 0000000..994bca8 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/EmployeeService.java @@ -0,0 +1,90 @@ +package jnpf.service; + +import jnpf.base.service.SuperService; +import jnpf.entity.EmployeeEntity; +import jnpf.model.EmployeeModel; +import jnpf.model.employee.EmployeeImportVO; +import jnpf.model.employee.PaginationEmployee; + +import java.util.List; +import java.util.Map; + +/** + * 职员信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + */ +public interface EmployeeService extends SuperService { + + /** + * 列表 + * + * @return + */ + List getList(); + + /** + * 列表 + * + * @param paginationEmployee + * @return + */ + List getList(PaginationEmployee paginationEmployee); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + EmployeeEntity getInfo(String id); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(EmployeeEntity entity); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(EmployeeEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + */ + void update(String id, EmployeeEntity entity); + + /** + * 导入预览 + * + * @param personList 实体对象 + * @return + */ + Map importPreview(List personList); + + /** + * 导入数据 + * + * @param dt 数据源 + * @return + */ + EmployeeImportVO importData(List dt); + + /** + * 导出pdf + * + * @param list 集合数据 + * @param outputUrl 保存路径 + * @return + */ + void exportPdf(List list, String outputUrl); +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/OrderEntryService.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/OrderEntryService.java new file mode 100644 index 0000000..5f8d953 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/OrderEntryService.java @@ -0,0 +1,16 @@ +package jnpf.service; + +import jnpf.base.service.SuperService; +import jnpf.entity.OrderEntryEntity; + +/** + * 订单明细 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月26日 上午9:18 + */ +public interface OrderEntryService extends SuperService { + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/OrderReceivableService.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/OrderReceivableService.java new file mode 100644 index 0000000..68fbfff --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/OrderReceivableService.java @@ -0,0 +1,16 @@ +package jnpf.service; + +import jnpf.base.service.SuperService; +import jnpf.entity.OrderReceivableEntity; + +/** + * 订单收款 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月26日 上午9:18 + */ +public interface OrderReceivableService extends SuperService { + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/OrderService.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/OrderService.java new file mode 100644 index 0000000..e416528 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/OrderService.java @@ -0,0 +1,112 @@ +package jnpf.service; + +import jnpf.base.service.SuperService; +import jnpf.entity.OrderEntity; +import jnpf.entity.OrderEntryEntity; +import jnpf.entity.OrderReceivableEntity; +import jnpf.exception.DataException; +import jnpf.exception.WorkFlowException; +import jnpf.model.order.OrderInfoVO; +import jnpf.model.order.PaginationOrder; + +import java.util.List; + +/** + * 订单信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +public interface OrderService extends SuperService { + + /** + * 列表 + * + * @param paginationOrder 分页 + * @return + */ + List getList(PaginationOrder paginationOrder); + + /** + * 子列表(订单明细) + * + * @param id 主表Id + * @return + */ + List getOrderEntryList(String id); + + /** + * 子列表(订单收款) + * + * @param id 主表Id + * @return + */ + List getOrderReceivableList(String id); + + /** + * 信息(前单、后单) + * + * @param id 主键值 + * @param method 方法:prev、next + * @return + */ + OrderEntity getPrevOrNextInfo(String id, String method); + + /** + * 信息(前单、后单) + * + * @param id 主键值 + * @param method 方法:prev、next + * @return + * @throws DataException 异常 + */ + OrderInfoVO getInfoVo(String id, String method) throws DataException; + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + OrderEntity getInfo(String id); + + /** + * 删除 + * + * @param entity 订单信息 + */ + void delete(OrderEntity entity); + + /** + * 新增 + * + * @param entity 订单信息 + * @param orderEntryList 订单明细 + * @param orderReceivableList 订单收款 + * @throws WorkFlowException 异常 + */ + void create(OrderEntity entity, List orderEntryList, List orderReceivableList); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 订单信息 + * @param orderEntryList 订单明细 + * @param orderReceivableList 订单收款 + * @return + * @throws WorkFlowException 异常 + */ + boolean update(String id, OrderEntity entity, List orderEntryList, List orderReceivableList); + + /** + * 更改数据 + * + * @param id 主键值 + * @param data 实体对象 + */ + void data(String id, String data); + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/ProductEntryService.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/ProductEntryService.java new file mode 100644 index 0000000..5658905 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/ProductEntryService.java @@ -0,0 +1,22 @@ +package jnpf.service; + +import jnpf.base.Pagination; +import jnpf.base.service.SuperService; +import jnpf.entity.ProductEntryEntity; + +import java.util.List; + +/** + * + * 销售订单明细 + * 版本: V3.1.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2021-07-10 10:40:59 + */ +public interface ProductEntryService extends SuperService { + + List getProductentryEntityList(String id); + + List getProductentryEntityList(Pagination pagination); +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/ProductGoodsService.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/ProductGoodsService.java new file mode 100644 index 0000000..bc9b8dc --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/ProductGoodsService.java @@ -0,0 +1,31 @@ +package jnpf.service; + +import jnpf.base.service.SuperService; +import jnpf.entity.ProductGoodsEntity; +import jnpf.model.productgoods.ProductGoodsPagination; + +import java.util.List; + +/** + * + * 产品商品 + * 版本: V3.1.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2021-07-10 15:57:50 + */ +public interface ProductGoodsService extends SuperService { + + List getGoodList(String type); + + List getList(ProductGoodsPagination productgoodsPagination); + + ProductGoodsEntity getInfo(String id); + + void delete(ProductGoodsEntity entity); + + void create(ProductGoodsEntity entity); + + boolean update( String id, ProductGoodsEntity entity); + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/ProductService.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/ProductService.java new file mode 100644 index 0000000..7aed00d --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/ProductService.java @@ -0,0 +1,30 @@ +package jnpf.service; + +import jnpf.base.service.SuperService; +import jnpf.entity.ProductEntity; +import jnpf.entity.ProductEntryEntity; +import jnpf.exception.DataException; +import jnpf.model.product.ProductPagination; + +import java.util.List; + +/** + * 销售订单 + * 版本: V3.1.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2021-07-10 10:40:59 + */ +public interface ProductService extends SuperService { + + List getList(ProductPagination productPagination); + + ProductEntity getInfo(String id); + + void delete(ProductEntity entity); + + void create(ProductEntity entity, List productEntryList ) throws DataException; + + boolean update(String id, ProductEntity entity, List productEntryList ); + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/ProductclassifyService.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/ProductclassifyService.java new file mode 100644 index 0000000..bc6995b --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/ProductclassifyService.java @@ -0,0 +1,28 @@ +package jnpf.service; + +import jnpf.base.service.SuperService; +import jnpf.entity.ProductclassifyEntity; + +import java.util.List; + +/** + * + * 产品分类 + * 版本: V3.1.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2021-07-10 14:34:04 + */ +public interface ProductclassifyService extends SuperService { + + List getList(); + + ProductclassifyEntity getInfo(String id); + + void delete(ProductclassifyEntity entity); + + void create(ProductclassifyEntity entity); + + boolean update( String id, ProductclassifyEntity entity); + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/ProjectGanttService.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/ProjectGanttService.java new file mode 100644 index 0000000..3025a46 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/ProjectGanttService.java @@ -0,0 +1,109 @@ +package jnpf.service; + +import jnpf.base.Page; +import jnpf.base.service.SuperService; +import jnpf.entity.ProjectGanttEntity; + +import java.util.List; + +/** + * 项目计划 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月26日 上午9:18 + */ +public interface ProjectGanttService extends SuperService { + + /** + * 项目列表 + * @param page + * @return + */ + List getList(Page page); + + /** + * 任务列表 + * + * @param projectId 项目Id + * @return + */ + List getTaskList(String projectId); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + ProjectGanttEntity getInfo(String id); + + /** + * 判断是否允许删除 + * + * @param id 主键值 + * @return + */ + boolean allowDelete(String id); + + /** + * 删除 + * + * @param entity 实体对象 + * @return + */ + void delete(ProjectGanttEntity entity); + + /** + * 创建 + * + * @param entity 实体对象 + * @return + */ + void create(ProjectGanttEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return + */ + boolean update(String id, ProjectGanttEntity entity); + + /** + * 验证名称 + * + * @param fullName 名称 + * @param id 主键值 + * @return + */ + boolean isExistByFullName(String fullName, String id); + + /** + * 验证编码 + * + * @param enCode 编码 + * @param id 主键值 + * @return + */ + boolean isExistByEnCode(String enCode, String id); + + + /** + * 上移 + * + * @param id 主键值 + * @return + */ + boolean first(String id); + + /** + * 下移 + * + * @param id 主键值 + * @return + */ + boolean next(String id); +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/TableExampleService.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/TableExampleService.java new file mode 100644 index 0000000..c51b414 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/TableExampleService.java @@ -0,0 +1,90 @@ +package jnpf.service; + +import jnpf.base.service.SuperService; +import jnpf.entity.TableExampleEntity; +import jnpf.model.tableexample.PaginationTableExample; + +import java.util.List; + +/** + * 表格示例数据 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月26日 上午9:18 + */ +public interface TableExampleService extends SuperService { + + /** + * 列表 + * + * @return + */ + List getList(); + + /** + * 列表(带关键字) + * + * @param keyword 关键字 + * @return + */ + List getList(String keyword); + + /** + * 列表 + * + * @param typeId 类别主键 + * @param paginationTableExample + * @return + */ + List getList(String typeId, PaginationTableExample paginationTableExample); + + /** + * 列表 + * + * @param paginationTableExample + * @return + */ + List getList(PaginationTableExample paginationTableExample); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + TableExampleEntity getInfo(String id); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(TableExampleEntity entity); + + /** + * 创建 + * + * @param entity 实体对象 + * @return + */ + void create(TableExampleEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return + */ + boolean update(String id, TableExampleEntity entity); + + /** + * 行编辑 + * + * @param entity 实体对象 + * @return + */ + boolean rowEditing(TableExampleEntity entity); +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/WorkLogService.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/WorkLogService.java new file mode 100644 index 0000000..430da4f --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/WorkLogService.java @@ -0,0 +1,64 @@ +package jnpf.service; + +import jnpf.base.Pagination; +import jnpf.base.service.SuperService; +import jnpf.entity.WorkLogEntity; + +import java.util.List; + +/** + * 工作日志 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月26日 上午9:18 + */ +public interface WorkLogService extends SuperService { + + /** + * 列表(我发出的) + * @param pageModel 请求参数 + * @return + */ + List getSendList(Pagination pageModel); + + /** + * 列表(我收出的) + * @param pageModel 请求参数 + * @return + */ + List getReceiveList(Pagination pageModel); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + WorkLogEntity getInfo(String id); + + /** + * 创建 + * + * @param entity 实体对象 + * @return + */ + void create(WorkLogEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return + */ + boolean update(String id, WorkLogEntity entity); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(WorkLogEntity entity); +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/WorkLogShareService.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/WorkLogShareService.java new file mode 100644 index 0000000..63640bc --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/WorkLogShareService.java @@ -0,0 +1,17 @@ +package jnpf.service; + +import jnpf.base.service.SuperService; +import jnpf.entity.WorkLogShareEntity; + + +/** + * 工作日志分享 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月26日 上午9:18 + */ +public interface WorkLogShareService extends SuperService { + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/BigDataServiceImpl.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/BigDataServiceImpl.java new file mode 100644 index 0000000..3f0cfe3 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/BigDataServiceImpl.java @@ -0,0 +1,135 @@ +package jnpf.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import jnpf.base.Pagination; +import jnpf.base.service.SuperServiceImpl; +import jnpf.config.ConfigValueUtil; +import jnpf.database.util.ConnUtil; +import jnpf.database.util.DataSourceUtil; +import jnpf.database.util.DbTypeUtil; +import jnpf.database.util.TenantDataSourceUtil; +import jnpf.entity.BigDataEntity; +import jnpf.exception.WorkFlowException; +import jnpf.mapper.BigDataMapper; +import jnpf.service.BigDataService; +import jnpf.util.RandomUtil; +import jnpf.util.StringUtil; +import lombok.Cleanup; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +/** + * 大数据测试 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +@Slf4j +@Service +public class BigDataServiceImpl extends SuperServiceImpl implements BigDataService { + + @Autowired + private DataSourceUtil dataSourceUtils; + @Autowired + private ConfigValueUtil configValueUtil; + + + @Override + public List getList(Pagination pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (pagination.getKeyword() != null) { + queryWrapper.lambda().and( + t -> t.like(BigDataEntity::getFullName, pagination.getKeyword()) + .or().like(BigDataEntity::getEnCode, pagination.getKeyword()) + ); + } + //排序 + if (StringUtils.isEmpty(pagination.getSidx())) { + queryWrapper.lambda().orderByDesc(BigDataEntity::getCreatorTime); + } else { + queryWrapper = "asc".equals(pagination.getSort().toLowerCase()) ? queryWrapper.orderByAsc(pagination.getSidx()) : queryWrapper.orderByDesc(pagination.getSidx()); + } + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage userPage = page(page, queryWrapper); + return pagination.setData(userPage.getRecords(), page.getTotal()); + } + + @Override + public void create(int insertCount) throws WorkFlowException { + Integer code = this.baseMapper.maxCode(); + if (code == null) { + code = 0; + } + int index = code == 0 ? 10000001 : code; + if (index > 11500001) { + throw new WorkFlowException("防止恶意创建过多数据"); + } + try { + @Cleanup Connection conn = ConnUtil.getConnOrDefault(dataSourceUtils); + @Cleanup PreparedStatement pstm = null; + String sql = ""; + String tenantColumn = TenantDataSourceUtil.getTenantColumn(); + if (DbTypeUtil.checkOracle(dataSourceUtils)||DbTypeUtil.checkDM(dataSourceUtils)) { + sql = "INSERT INTO ext_big_data(F_ID,F_EN_CODE,F_FULL_NAME,F_CREATOR_TIME{column}) VALUES (?,?,?,to_date(?,'yyyy-mm-dd hh24:mi:ss'){value})"; + } else { + sql = "INSERT INTO ext_big_data(F_ID,F_EN_CODE,F_FULL_NAME,F_CREATOR_TIME{column}) VALUES (?,?,?,?{value})"; + } + if (StringUtil.isNotEmpty(tenantColumn)) { + sql = sql.replaceAll("\\{column}", "," + configValueUtil.getMultiTenantColumn()); + sql = sql.replaceAll("\\{value}", ",?"); + } else { + sql = sql.replaceAll("\\{column}", ""); + sql = sql.replaceAll("\\{value}", ""); + } + pstm = conn.prepareStatement(sql); + conn.setAutoCommit(false); + if (DbTypeUtil.checkPostgre(dataSourceUtils)) { + for (int i = 0; i < insertCount; i++) { + pstm.setString(1, RandomUtil.uuId()); + pstm.setInt(2, index); + pstm.setString(3, "测试大数据" + index); + pstm.setDate(4, new java.sql.Date(System.currentTimeMillis())); + if (StringUtil.isNotEmpty(tenantColumn)) { + pstm.setString(5, tenantColumn); + } + pstm.addBatch(); + index++; + } + } else { + Date date=new Date(); + SimpleDateFormat sf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String time=sf.format(date); + for (int i = 0; i < insertCount; i++) { + pstm.setString(1, RandomUtil.uuId()); + pstm.setInt(2, index); + pstm.setString(3, "测试大数据" + index); +// pstm.setString(4, time); + pstm.setDate(4, new java.sql.Date(System.currentTimeMillis())); + if (StringUtil.isNotEmpty(tenantColumn)) { + pstm.setString(5, tenantColumn); + } + pstm.addBatch(); + index++; + } + } + pstm.executeBatch(); + conn.commit(); + pstm.close(); + conn.close(); + } catch (Exception e) { + log.error(e.getMessage()); + } + } +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/CustomerServiceImpl.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/CustomerServiceImpl.java new file mode 100644 index 0000000..a3aa607 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/CustomerServiceImpl.java @@ -0,0 +1,79 @@ +package jnpf.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import jnpf.base.Pagination; +import jnpf.base.service.SuperServiceImpl; +import jnpf.entity.CustomerEntity; +import jnpf.mapper.CustomerMapper; +import jnpf.service.CustomerService; +import jnpf.util.RandomUtil; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +/** + * 客户信息 + * 版本: V3.1.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2021-07-10 14:09:05 + */ +@Service + +public class CustomerServiceImpl extends SuperServiceImpl implements CustomerService { + + @Autowired + private UserProvider userProvider; + + @Override + public List getList(Pagination pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(pagination.getKeyword())) { + queryWrapper.lambda().and( + t->t.like(CustomerEntity::getAddress, pagination.getKeyword()) + .or().like(CustomerEntity::getName, pagination.getKeyword()) + .or().like(CustomerEntity::getCode, pagination.getKeyword()) + ); + } + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage userIPage = this.page(page, queryWrapper); + return pagination.setData(userIPage.getRecords(), userIPage.getTotal()); + } + + @Override + public CustomerEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(CustomerEntity::getId, id); + return this.getOne(queryWrapper); + + } + + @Override + public void create(CustomerEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(userProvider.get().getUserId()); + entity.setCreatorTime(new Date()); + this.save(entity); + } + + @Override + public boolean update(String id, CustomerEntity entity) { + entity.setId(id); + entity.setLastModifyUserId(userProvider.get().getUserId()); + entity.setLastModifyTime(new Date()); + return this.updateById(entity); + } + + @Override + public void delete(CustomerEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/DocumentServiceImpl.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/DocumentServiceImpl.java new file mode 100644 index 0000000..dcc41ff --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/DocumentServiceImpl.java @@ -0,0 +1,222 @@ +package jnpf.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import jnpf.base.service.SuperServiceImpl; +import jnpf.config.ConfigValueUtil; +import jnpf.constant.FileTypeConstant; +import jnpf.entity.DocumentEntity; +import jnpf.entity.DocumentShareEntity; +import jnpf.mapper.DocumentMapper; +import jnpf.service.DocumentService; +import jnpf.service.DocumentShareService; +import jnpf.util.FileUtil; +import jnpf.util.RandomUtil; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * 知识文档 + * + * @author JNPF开发平台组 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +@Service +public class DocumentServiceImpl extends SuperServiceImpl implements DocumentService { + + @Autowired + private UserProvider userProvider; + @Autowired + private DocumentShareService documentShareService; + @Autowired + private ConfigValueUtil configValueUtil; + + @Override + public List getFolderList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .eq(DocumentEntity::getCreatorUserId, userProvider.get().getUserId()) + .eq(DocumentEntity::getType, 0) + .eq(DocumentEntity::getEnabledMark, 1) + .orderByAsc(DocumentEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getAllList(String parentId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .eq(DocumentEntity::getCreatorUserId, userProvider.get().getUserId()) + .eq(DocumentEntity::getEnabledMark, 1) + .eq(DocumentEntity::getParentId, parentId) + .orderByDesc(DocumentEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getTrashList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .eq(DocumentEntity::getCreatorUserId, userProvider.get().getUserId()) + .eq(DocumentEntity::getEnabledMark, 0) + .orderByDesc(DocumentEntity::getDeleteTime); + return this.list(queryWrapper); + } + + @Override + public List getShareOutList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .eq(DocumentEntity::getCreatorUserId, userProvider.get().getUserId()) + .eq(DocumentEntity::getEnabledMark, 1) + .gt(DocumentEntity::getIsShare, 0) + .orderByAsc(DocumentEntity::getType) + .orderByDesc(DocumentEntity::getDeleteTime); + return this.list(queryWrapper); + } + + @Override + public List getShareTomeList() { + return this.baseMapper.getShareTomeList(userProvider.get().getUserId()); + } + + @Override + public List getShareUserList(String documentId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DocumentShareEntity::getDocumentId, documentId); + return documentShareService.list(queryWrapper); + } + + @Override + public DocumentEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DocumentEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void delete(DocumentEntity entity) { + entity.setDeleteTime(new Date()); + entity.setDeleteUserId(userProvider.get().getUserId()); + entity.setEnabledMark(0); + this.updateById(entity); + + } + + @Override + public void create(DocumentEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(userProvider.get().getUserId()); + entity.setEnabledMark(1); + this.save(entity); + } + + @Override + public boolean update(String id, DocumentEntity entity) { + entity.setId(id); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(userProvider.get().getUserId()); + return this.updateById(entity); + } + + @Override + @Transactional + public boolean sharecreate(String documentId, String[] shareUserId) { + List entitys = new ArrayList<>(); + for (String item : shareUserId) { + DocumentShareEntity entity = new DocumentShareEntity(); + entity.setId(RandomUtil.uuId()); + entity.setDocumentId(documentId); + entity.setShareUserId(item); + entity.setShareTime(new Date()); + entitys.add(entity); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + DocumentEntity entity = this.getOne(queryWrapper.lambda().eq(DocumentEntity::getId, documentId)); + if (entity != null) { + entity.setIsShare(entitys.size()); + entity.setShareTime(new Date()); + this.updateById(entity); + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().eq(DocumentShareEntity::getDocumentId, documentId); + documentShareService.remove(wrapper); + for (DocumentShareEntity shareEntity : entitys) { + documentShareService.save(shareEntity); + } + return true; + } + return false; + } + + @Override + @Transactional + public boolean shareCancel(String documentId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DocumentEntity::getId, documentId); + DocumentEntity entity = this.getOne(queryWrapper); + if (entity != null) { + entity.setIsShare(0); + entity.setShareTime(new Date()); + this.updateById(entity); + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().eq(DocumentShareEntity::getDocumentId, documentId); + documentShareService.remove(wrapper); + return true; + } + return false; + } + + @Override + @Transactional + public void trashdelete(String folderId) { + DocumentEntity entity = this.getInfo(folderId); + if(entity!=null){ + this.removeById(folderId); + FileUtil.deleteFile(configValueUtil.getDocumentFilePath() + entity.getFilePath()); + } +// List list = this.baseMapper.GetChildList(folderId); +// List deleteId = new ArrayList<>(); +// for (DocumentEntity entity : list) { +// if(!StringUtil.isEmpty(entity.getFilePath())){ +// FileUtil.deleteFile(configValueUtil.getDocumentFilePath() + entity.getFilePath()); +// } +// deleteId.add(entity.getId()); +// } +// this.removeByIds(deleteId); + } + + @Override + public boolean trashRecovery(String id) { + return retBool(this.baseMapper.trashRecovery(id)); + } + + @Override + public boolean moveTo(String id, String toId) { + DocumentEntity entity = this.getInfo(id); + if(entity!=null){ + entity.setParentId(toId); + this.updateById(entity); + return true; + } + return false; + } + + @Override + public boolean isExistByFullName(String fullName, String id, String parentId) { + String userId=userProvider.get().getUserId(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DocumentEntity::getFullName,fullName).eq(DocumentEntity::getEnabledMark, 1).eq(DocumentEntity::getCreatorUserId,userId); + queryWrapper.lambda().eq(DocumentEntity::getParentId, parentId); + if(!StringUtil.isEmpty(id)){ + queryWrapper.lambda().ne(DocumentEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/DocumentShareServiceImpl.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/DocumentShareServiceImpl.java new file mode 100644 index 0000000..5abdb51 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/DocumentShareServiceImpl.java @@ -0,0 +1,19 @@ +package jnpf.service.impl; + +import jnpf.base.service.SuperServiceImpl; +import jnpf.entity.DocumentShareEntity; +import jnpf.mapper.DocumentShareMapper; +import jnpf.service.DocumentShareService; +import org.springframework.stereotype.Service; + +/** + * 邮件配置 + * + * @copyright 引迈信息技术有限公司 + * @author JNPF开发平台组 + * @date 2019年9月26日 上午9:18 + */ +@Service +public class DocumentShareServiceImpl extends SuperServiceImpl implements DocumentShareService { + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/EmailConfigServiceImpl.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/EmailConfigServiceImpl.java new file mode 100644 index 0000000..9d36ecc --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/EmailConfigServiceImpl.java @@ -0,0 +1,20 @@ +package jnpf.service.impl; + +import jnpf.base.entity.EmailConfigEntity; +import jnpf.base.service.SuperServiceImpl; +import jnpf.mapper.EmailConfigMapper; +import jnpf.service.EmailConfigService; +import org.springframework.stereotype.Service; + + +/** + * 邮件配置 + * + * @copyright 引迈信息技术有限公司 + * @author JNPF开发平台组 + * @date 2019年9月26日 上午9:18 + */ +@Service +public class EmailConfigServiceImpl extends SuperServiceImpl implements EmailConfigService { + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/EmailReceiveServiceImpl.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/EmailReceiveServiceImpl.java new file mode 100644 index 0000000..691c08a --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/EmailReceiveServiceImpl.java @@ -0,0 +1,427 @@ +package jnpf.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import jnpf.base.PaginationTime; +import jnpf.base.entity.EmailConfigEntity; +import jnpf.base.model.MailAccount; +import jnpf.base.model.MailFile; +import jnpf.base.model.MailModel; +import jnpf.base.service.SuperServiceImpl; +import jnpf.base.util.Pop3Util; +import jnpf.base.util.SmtpUtil; +import jnpf.config.ConfigValueUtil; +import jnpf.constant.FileTypeConstant; +import jnpf.entity.EmailReceiveEntity; +import jnpf.entity.EmailSendEntity; +import jnpf.exception.DataException; +import jnpf.mapper.EmailReceiveMapper; +import jnpf.service.EmailConfigService; +import jnpf.service.EmailReceiveService; +import jnpf.service.EmailSendService; +import jnpf.util.*; +import jnpf.util.type.StringNumber; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 邮件接收 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月26日 上午9:18 + */ +@Slf4j +@Service +public class EmailReceiveServiceImpl extends SuperServiceImpl implements EmailReceiveService { + + @Autowired + private UserProvider userProvider; + @Autowired + private EmailSendService emailSendService; + @Autowired + private EmailConfigService emailConfigService; + @Autowired + private Pop3Util pop3Util; + @Autowired + private ConfigValueUtil configValueUtil; + + @Override + public List getReceiveList(PaginationTime paginationTime) { + String userId = userProvider.get().getUserId(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(EmailReceiveEntity::getCreatorUserId, userId); + //日期范围(近7天、近1月、近3月、自定义) + String startTime = paginationTime.getStartTime() != null ? paginationTime.getStartTime() : null; + String endTime = paginationTime.getEndTime() != null ? paginationTime.getEndTime() : null; + if (!StringUtils.isEmpty(startTime) && !StringUtils.isEmpty(endTime)) { + Date startTimes = DateUtil.stringToDate(DateUtil.daFormat(Long.parseLong(startTime)) + " 00:00:00"); + Date endTimes = DateUtil.stringToDate(DateUtil.daFormat(Long.parseLong(endTime)) + " 23:59:59"); + queryWrapper.lambda().ge(EmailReceiveEntity::getFdate, startTimes).le(EmailReceiveEntity::getFdate, endTimes); + } + //关键字(用户、IP地址、功能名称) + String keyWord = paginationTime.getKeyword() != null ? paginationTime.getKeyword() : null; + //关键字(发件人、主题) + if (!StringUtils.isEmpty(keyWord)) { + String word = keyWord; + queryWrapper.lambda().and( + t -> t.like(EmailReceiveEntity::getSender, word) + .or().like(EmailReceiveEntity::getSubject, word) + ); + } + //排序 + if (StringUtils.isEmpty(paginationTime.getSidx())) { + queryWrapper.lambda().orderByDesc(EmailReceiveEntity::getFdate); + } else { + queryWrapper = "asc".equals(paginationTime.getSort().toLowerCase()) ? queryWrapper.orderByAsc(paginationTime.getSidx()) : queryWrapper.orderByDesc(paginationTime.getSidx()); + } + Page page = new Page<>(paginationTime.getCurrentPage(), paginationTime.getPageSize()); + IPage userIPage = this.page(page, queryWrapper); + return paginationTime.setData(userIPage.getRecords(), page.getTotal()); + } + + @Override + public List getReceiveList() { + String userId = userProvider.get().getUserId(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(EmailReceiveEntity::getCreatorUserId, userId).eq(EmailReceiveEntity::getIsRead,0).orderByDesc(EmailReceiveEntity::getCreatorTime); + return this.baseMapper.selectList(queryWrapper); + } + + @Override + public List getDashboardReceiveList() { + String userId = userProvider.get().getUserId(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(EmailReceiveEntity::getCreatorUserId, userId).eq(EmailReceiveEntity::getIsRead,0).orderByDesc(EmailReceiveEntity::getCreatorTime); + Page page = new Page<>(1, 20); + IPage iPage = this.page(page, queryWrapper); + return iPage.getRecords(); + } + + @Override + public List getStarredList(PaginationTime paginationTime) { + String userId = userProvider.get().getUserId(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(EmailReceiveEntity::getCreatorUserId, userId).eq(EmailReceiveEntity::getStarred, 1); + //日期范围(近7天、近1月、近3月、自定义) + String startTime = paginationTime.getStartTime() != null ? paginationTime.getStartTime() : null; + String endTime = paginationTime.getEndTime() != null ? paginationTime.getEndTime() : null; + if (!StringUtils.isEmpty(startTime) && !StringUtils.isEmpty(endTime)) { + Date startTimes = DateUtil.stringToDate(DateUtil.daFormat(Long.parseLong(startTime)) + " 00:00:00"); + Date endTimes = DateUtil.stringToDate(DateUtil.daFormat(Long.parseLong(endTime)) + " 23:59:59"); + queryWrapper.lambda().ge(EmailReceiveEntity::getCreatorTime, startTimes).le(EmailReceiveEntity::getCreatorTime, endTimes); + } + //关键字(用户、IP地址、功能名称) + String keyWord = paginationTime.getKeyword() != null ? paginationTime.getKeyword() : null; + //关键字(发件人、主题) + if (!StringUtils.isEmpty(keyWord)) { + String word = keyWord; + queryWrapper.lambda().and( + t -> t.like(EmailReceiveEntity::getSender, word) + .or().like(EmailReceiveEntity::getSubject, word) + ); + } + //排序 + if (StringUtils.isEmpty(paginationTime.getSidx())) { + queryWrapper.lambda().orderByDesc(EmailReceiveEntity::getCreatorTime); + } else { + queryWrapper = "asc".equals(paginationTime.getSort().toLowerCase()) ? queryWrapper.orderByAsc(paginationTime.getSidx()) : queryWrapper.orderByDesc(paginationTime.getSidx()); + } + Page page = new Page<>(paginationTime.getCurrentPage(), paginationTime.getPageSize()); + IPage userIPage = this.page(page, queryWrapper); + return paginationTime.setData(userIPage.getRecords(), page.getTotal()); + } + + @Override + public List getDraftList(PaginationTime paginationTime) { + String userId = userProvider.get().getUserId(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(EmailSendEntity::getCreatorUserId, userId).eq(EmailSendEntity::getState, -1); + //日期范围(近7天、近1月、近3月、自定义) + String startTime = paginationTime.getStartTime() != null ? paginationTime.getEndTime() : null; + String endTime = paginationTime.getEndTime() != null ? paginationTime.getEndTime() : null; + if (!StringUtils.isEmpty(startTime) && !StringUtils.isEmpty(endTime)) { + Date startTimes = DateUtil.stringToDate(DateUtil.daFormat(Long.parseLong(startTime)) + " 00:00:00"); + Date endTimes = DateUtil.stringToDate(DateUtil.daFormat(Long.parseLong(endTime)) + " 23:59:59"); + queryWrapper.lambda().ge(EmailSendEntity::getCreatorTime, startTimes).le(EmailSendEntity::getCreatorTime, endTimes); + } + //关键字(用户、IP地址、功能名称) + String keyWord = paginationTime.getKeyword() != null ? paginationTime.getKeyword() : null; + //关键字(发件人、主题) + if (!StringUtils.isEmpty(keyWord)) { + String word = keyWord; + queryWrapper.lambda().and( + t -> t.like(EmailSendEntity::getSender, word) + .or().like(EmailSendEntity::getSubject, word) + ); + } + //排序 + if (StringUtils.isEmpty(paginationTime.getSidx())) { + queryWrapper.lambda().orderByDesc(EmailSendEntity::getCreatorTime); + } else { + queryWrapper = "asc".equals(paginationTime.getSort().toLowerCase()) ? queryWrapper.orderByAsc(paginationTime.getSidx()) : queryWrapper.orderByDesc(paginationTime.getSidx()); + } + Page page = new Page<>(paginationTime.getCurrentPage(), paginationTime.getPageSize()); + IPage userIPage = emailSendService.page(page, queryWrapper); + return paginationTime.setData(userIPage.getRecords(), page.getTotal()); + } + + @Override + public List getSentList(PaginationTime paginationTime) { + String userId = userProvider.get().getUserId(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(EmailSendEntity::getCreatorUserId, userId).ne(EmailSendEntity::getState, -1); + //日期范围(近7天、近1月、近3月、自定义) + String startTime = paginationTime.getStartTime() != null ? paginationTime.getStartTime() : null; + String endTime = paginationTime.getEndTime() != null ? paginationTime.getEndTime() : null; + if (!StringUtils.isEmpty(startTime) && !StringUtils.isEmpty(endTime)) { + Date startTimes = DateUtil.stringToDate(DateUtil.daFormat(Long.parseLong(startTime)) + " 00:00:00"); + Date endTimes = DateUtil.stringToDate(DateUtil.daFormat(Long.parseLong(endTime)) + " 23:59:59"); + queryWrapper.lambda().ge(EmailSendEntity::getCreatorTime, startTimes).le(EmailSendEntity::getCreatorTime, endTimes); + } + //关键字(用户、IP地址、功能名称) + String keyWord = paginationTime.getKeyword() != null ? String.valueOf(paginationTime.getKeyword()) : null; + //关键字(发件人、主题) + if (!StringUtils.isEmpty(keyWord)) { + String word = keyWord; + queryWrapper.lambda().and( + t -> t.like(EmailSendEntity::getSender, word) + .or().like(EmailSendEntity::getSubject, word) + ); + } + //排序 + String sort = paginationTime.getSort() != null ? paginationTime.getSort() : null; + if (!StringUtils.isEmpty(sort)) { + queryWrapper.lambda().orderByDesc(EmailSendEntity::getCreatorTime); + } + Page page = new Page<>(paginationTime.getCurrentPage(), paginationTime.getPageSize()); + IPage userIPage = emailSendService.page(page, queryWrapper); + return paginationTime.setData(userIPage.getRecords(), page.getTotal()); + } + + @Override + public EmailConfigEntity getConfigInfo() { + String userId = userProvider.get().getUserId(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(EmailConfigEntity::getCreatorUserId, userId); + return emailConfigService.getOne(queryWrapper); + } + + @Override + public EmailConfigEntity getConfigInfo(String userId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(EmailConfigEntity::getCreatorUserId, userId); + return emailConfigService.getOne(queryWrapper); + } + + @Override + public Object getInfo(String id) { + EmailReceiveEntity receiveInfo = this.getById(id); + Object object; + if (receiveInfo != null) { + //解析内容 + receiveInfo.setBodyText(receiveInfo.getBodyText()); + //更新已读 + receiveInfo.setIsRead(1); + receiveInfo.setLastModifyTime(new Date()); + receiveInfo.setLastModifyUserId(userProvider.get().getUserId()); + this.updateById(receiveInfo); + object = receiveInfo; + } else { + EmailSendEntity sendInfo = emailSendService.getById(id); + object = sendInfo; + } + return object; + } + + @Override + public boolean delete(String id) { + Object object = getInfo(id); + if (object != null && object instanceof EmailReceiveEntity) { + //删除邮件 + EmailConfigEntity mailConfig = getConfigInfo(); + EmailReceiveEntity mailReceiveEntity = (EmailReceiveEntity) object; + MailAccount mailAccount = new MailAccount(); + mailAccount.setAccount(mailConfig.getAccount()); + mailAccount.setPassword(mailConfig.getPassword()); + mailAccount.setPop3Port(mailConfig.getPop3Port()); + mailAccount.setPop3Host(mailConfig.getPop3Host()); + pop3Util.deleteMessage(mailAccount, mailReceiveEntity.getMID()); + this.removeById(mailReceiveEntity.getId()); + return true; + } else if (object != null) { + //删除数据 + EmailSendEntity entity = (EmailSendEntity) object; + emailSendService.removeById(entity.getId()); + return true; + } + return false; + } + + @Override + @Transactional + public void saveDraft(EmailSendEntity entity) { + entity.setState(-1); + if (StringUtil.isNotEmpty(entity.getId())) { + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(userProvider.get().getUserId()); + emailSendService.updateById(entity); + } else { + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(userProvider.get().getUserId()); + emailSendService.save(entity); + } + } + + @Override + public boolean receiveRead(String id, int isRead) { + EmailReceiveEntity entity = (EmailReceiveEntity) getInfo(id); + if (entity != null) { + entity.setIsRead(isRead); + return this.updateById(entity); + } + return false; + } + + @Override + public boolean receiveStarred(String id, int isStarred) { + EmailReceiveEntity entity = (EmailReceiveEntity) getInfo(id); + if (entity != null) { + entity.setStarred(isStarred); + return this.updateById(entity); + } + return false; + } + + @Override + public void saveConfig(EmailConfigEntity configEntity) throws DataException { + EmailConfigEntity emailConfigEntity=getConfigInfo(userProvider.get().getUserId()); + if (emailConfigEntity == null && userProvider.get().getUserId() != null) { + configEntity.setId(RandomUtil.uuId()); + configEntity.setCreatorTime(new Date()); + configEntity.setCreatorUserId(userProvider.get().getUserId()); + emailConfigService.save(configEntity); + } else if (userProvider.get().getUserId() != null) { + configEntity.setId(emailConfigEntity.getId()); + emailConfigService.updateById(configEntity); + } else { + throw new DataException("保存失败,请重新登陆"); + } + } + + @Override + @Transactional + public int saveSent(EmailSendEntity entity, EmailConfigEntity mailConfig) { + int flag = 1; + //拷贝文件,注意:从临时文件夹拷贝到邮件文件夹 + List attachmentList = JsonUtil.getJsonToList(entity.getAttachment(), MailFile.class); + //邮件路径 + String mailFilePath = configValueUtil.getEmailFilePath(); + try { + //写入数据 + //发送邮件 + //邮件发送信息 + MailModel mailModel = new MailModel(); + mailModel.setFrom(entity.getSender()); + mailModel.setRecipient(entity.getRecipient()); + mailModel.setCc(entity.getCc()); + mailModel.setBcc(entity.getBcc()); + mailModel.setSubject(entity.getSubject()); + mailModel.setBodyText(entity.getBodyText()); + mailModel.setAttachment(attachmentList); + mailModel.setFromName(mailConfig.getSenderName()); + //账号验证信息 + MailAccount mailAccount = new MailAccount(); + mailAccount.setAccount(mailConfig.getAccount()); + mailAccount.setPassword(mailConfig.getPassword()); + mailAccount.setPop3Host(mailConfig.getPop3Host()); + mailAccount.setPop3Port(mailConfig.getPop3Port()); + mailAccount.setSmtpHost(mailConfig.getSmtpHost()); + mailAccount.setSmtpPort(mailConfig.getSmtpPort()); + mailAccount.setSsl(mailConfig.getEmailSsl() == 1 ? true : false); + mailAccount.setAccountName(mailConfig.getSenderName()); + SmtpUtil smtpUtil = new SmtpUtil(mailAccount); + smtpUtil.sendMail(null, mailFilePath, mailModel); + flag = 0; + //插入数据库 + if (entity.getId() != null) { + entity.setState(1); + emailSendService.updateById(entity); + } else { + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(userProvider.get().getUserId()); + if (mailConfig.getAccount() != null) { + entity.setSender(mailConfig.getAccount()); + } + entity.setState(1); + emailSendService.save(entity); + } + } catch (Exception e) { + for (MailFile mailFile : attachmentList) { + FileUtil.deleteFile(mailFilePath + mailFile.getFileId()); + } + log.error(e.getMessage()); + } + return flag; + } + + @Override + @Transactional + public int receive(EmailConfigEntity mailConfig) { + //账号验证信息 + MailAccount mailAccount = new MailAccount(); + mailAccount.setAccount(mailConfig.getAccount()); + mailAccount.setPassword(mailConfig.getPassword()); + mailAccount.setPop3Host(mailConfig.getPop3Host()); + mailAccount.setPop3Port(mailConfig.getPop3Port()); + mailAccount.setSmtpHost(mailConfig.getSmtpHost()); + mailAccount.setSmtpPort(mailConfig.getSmtpPort()); + if (StringNumber.ONE.equals(mailConfig.getEmailSsl().toString())) { + mailAccount.setSsl(true); + } else { + mailAccount.setSsl(false); + } + Map map = pop3Util.popMail(mailAccount); + int receiveCount = 0; + if (map.get("receiveCount") != null) { + receiveCount = (int) map.get("receiveCount"); + } + List mailList = new ArrayList<>(); + if (map.get("mailList") != null) { + mailList = (List) map.get("mailList"); + } + if (mailList.size() > 0) { + List mids = mailList.stream().map(u -> u.getMID()).collect(Collectors.toList()); + //查询数据库状态 + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().in(EmailReceiveEntity::getMID, mids); + List emails = this.list(wrapper); + this.remove(wrapper); + //邮件赋值状态 + for (int i = 0; i < mailList.size(); i++) { + EmailReceiveEntity entity = mailList.get(i); + entity.setCreatorUserId(userProvider.get().getUserId()); + //通过数据库进行赋值,没有就默认0 + int stat = emails.stream().filter(m -> m.getMID().equals(entity.getMID())).findFirst().isPresent() ? emails.stream().filter(m -> m.getMID().equals(entity.getMID())).findFirst().get().getIsRead() : 0; + long count = emails.stream().filter(m -> m.getMID().equals(entity.getMID())).count(); + entity.setIsRead(stat); + if (count != 0) { + receiveCount--; + } + this.save(entity); + } + } + return receiveCount; + } +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/EmailSendServiceImpl.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/EmailSendServiceImpl.java new file mode 100644 index 0000000..45b8c5a --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/EmailSendServiceImpl.java @@ -0,0 +1,20 @@ +package jnpf.service.impl; + +import jnpf.base.service.SuperServiceImpl; +import jnpf.entity.EmailSendEntity; +import jnpf.mapper.EmailSendMapper; +import jnpf.service.EmailSendService; +import org.springframework.stereotype.Service; + + +/** + * 邮件发送 + * + * @copyright 引迈信息技术有限公司 + * @author JNPF开发平台组 + * @date 2019年9月26日 上午9:18 + */ +@Service +public class EmailSendServiceImpl extends SuperServiceImpl implements EmailSendService { + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/EmployeeServiceImpl.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/EmployeeServiceImpl.java new file mode 100644 index 0000000..c8c0cce --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/EmployeeServiceImpl.java @@ -0,0 +1,307 @@ +package jnpf.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.itextpdf.text.Document; +import com.itextpdf.text.Element; +import com.itextpdf.text.Font; +import com.itextpdf.text.Phrase; +import com.itextpdf.text.pdf.BaseFont; +import com.itextpdf.text.pdf.PdfPCell; +import com.itextpdf.text.pdf.PdfPTable; +import com.itextpdf.text.pdf.PdfWriter; +import jnpf.base.service.SuperServiceImpl; +import jnpf.entity.EmployeeEntity; +import jnpf.mapper.EmployeeMapper; +import jnpf.model.EmployeeModel; +import jnpf.model.employee.EmployeeImportVO; +import jnpf.model.employee.PaginationEmployee; +import jnpf.service.EmployeeService; +import jnpf.util.DateUtil; +import jnpf.util.JsonUtil; +import jnpf.util.RandomUtil; +import jnpf.util.UserProvider; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import java.io.FileOutputStream; +import java.util.*; + +/** + * 职员信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + */ +@Slf4j +@Service +public class EmployeeServiceImpl extends SuperServiceImpl implements EmployeeService { + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().orderByDesc(EmployeeEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getList(PaginationEmployee paginationEmployee) { +// Map queryParam = OptimizeUtil.queryParam(pagination); + QueryWrapper queryWrapper = new QueryWrapper<>(); + //查询条件 + String propertyName = paginationEmployee.getCondition() != null ? paginationEmployee.getCondition() : null; + + String propertyValue = paginationEmployee.getKeyword() != null ? paginationEmployee.getKeyword() : null; + if (!StringUtils.isEmpty(propertyName) && !StringUtils.isEmpty(propertyValue)) { + switch (propertyName) { + //工号 + case "EnCode": + queryWrapper.lambda().like(EmployeeEntity::getEnCode, propertyValue); + break; + //姓名 + case "FullName": + queryWrapper.lambda().like(EmployeeEntity::getFullName, propertyValue); + break; + //电话 + case "Telephone": + queryWrapper.lambda().like(EmployeeEntity::getTelephone, propertyValue); + break; + //部门 + case "DepartmentName": + queryWrapper.lambda().like(EmployeeEntity::getDepartmentName, propertyValue); + break; + //岗位 + case "PositionName": + queryWrapper.lambda().like(EmployeeEntity::getPositionName, propertyValue); + break; + default: + break; + } + } + //排序 + if (StringUtils.isEmpty(paginationEmployee.getSidx())) { + queryWrapper.lambda().orderByDesc(EmployeeEntity::getCreatorTime); + } else { + queryWrapper = "asc".equals(paginationEmployee.getSort().toLowerCase()) ? queryWrapper.orderByAsc(paginationEmployee.getSidx()) : queryWrapper.orderByDesc(paginationEmployee.getSidx()); + } + Page page = new Page(paginationEmployee.getCurrentPage(), paginationEmployee.getPageSize()); + IPage userIPage = this.page(page, queryWrapper); + return paginationEmployee.setData(userIPage.getRecords(), page.getTotal()); + } + + @Override + public EmployeeEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(EmployeeEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void delete(EmployeeEntity entity) { + this.removeById(entity.getId()); + } + + @Override + public void create(EmployeeEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setSortCode(RandomUtil.parses()); + entity.setCreatorUserId(UserProvider.getLoginUserId()); + this.save(entity); + } + + @Override + public void update(String id, EmployeeEntity entity) { + entity.setId(id); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(UserProvider.getLoginUserId()); + this.updateById(entity); + } + + @Override + public Map importPreview(List personList) { + List> dataRow = new ArrayList<>(); + List> columns = new ArrayList<>(); + for (int i = 0; i < personList.size(); i++) { + Map dataRowMap = new HashMap<>(); + EmployeeModel model = personList.get(i); + dataRowMap.put("enCode", model.getEnCode()); + dataRowMap.put("fullName", model.getFullName()); + dataRowMap.put("gender", model.getGender()); + dataRowMap.put("departmentName", model.getDepartmentName()); + dataRowMap.put("positionName", model.getPositionName()); + dataRowMap.put("workingNature", model.getWorkingNature()); + dataRowMap.put("idNumber", model.getIdNumber()); + dataRowMap.put("telephone", model.getTelephone()); + dataRowMap.put("attendWorkTime", model.getAttendWorkTime()); + dataRowMap.put("birthday", model.getBirthday()); + dataRowMap.put("education", model.getEducation()); + dataRowMap.put("major", model.getMajor()); + dataRowMap.put("graduationAcademy", model.getGraduationAcademy()); + dataRowMap.put("graduationTime", model.getGraduationTime()); + dataRow.add(dataRowMap); + } + for (int i = 1; i < 15; i++) { + Map columnsMap = new HashMap<>(); + columnsMap.put("AllowDBNull", true); + columnsMap.put("AutoIncrement", false); + columnsMap.put("AutoIncrementSeed", 0); + columnsMap.put("AutoIncrementStep", 1); + columnsMap.put("Caption", this.getColumns(i)); + columnsMap.put("ColumnMapping", 1); + columnsMap.put("ColumnName", this.getColumns(i)); + columnsMap.put("Container", null); + columnsMap.put("DataType", "System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"); + columnsMap.put("DateTimeMode", 3); + columnsMap.put("DefaultValue", null); + columnsMap.put("DesignMode", false); + columnsMap.put("Expression", ""); + columnsMap.put("ExtendedProperties", ""); + columnsMap.put("MaxLength", -1); + columnsMap.put("Namespace", ""); + columnsMap.put("Ordinal", 0); + columnsMap.put("Prefix", ""); + columnsMap.put("ReadOnly", false); + columnsMap.put("Site", null); + columnsMap.put("Table", personList); + columnsMap.put("Unique", false); + columns.add(columnsMap); + } + Map map = new HashMap<>(); + map.put("dataRow", dataRow); + map.put("columns", columns); + return map; + } + + @Override + public EmployeeImportVO importData(List dt) { + + for(EmployeeModel model :dt){ + model.setAttendWorkTime(DateUtil.cstFormat(model.getAttendWorkTime())); + model.setBirthday(DateUtil.cstFormat(model.getBirthday())); + model.setGraduationTime(DateUtil.cstFormat(model.getGraduationTime())); + } + List entitys = JsonUtil.getJsonToList(dt, EmployeeEntity.class); + //记录成功了几条 + int sum=0; + //记录第几条失败 + int num=0; + List errList = new ArrayList<>(); + for (EmployeeEntity entity : entitys) { + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(UserProvider.getLoginUserId()); + entity.setCreatorTime(new Date()); + try { + this.baseMapper.insert(entity); + sum++; + }catch (Exception e){ + errList.add(entity); + num++; + log.error("导入第"+(num+1)+"条数据失败"); + } + + } + EmployeeImportVO vo=new EmployeeImportVO(); + vo.setSnum(sum); + vo.setFnum(num); + if(vo.getFnum()>0){ + vo.setResultType(1); + vo.setFailResult(JsonUtil.getJsonToList(errList, EmployeeModel.class)); + return vo; + }else{ + vo.setResultType(0); + return vo; + } + } + + @Override + public void exportPdf(List list, String outputUrl) { + try { + Document document = new Document(); + BaseFont bfChinese = BaseFont.createFont("STSongStd-Light", "UniGB-UCS2-H", false); + Font font = new Font(bfChinese, 11, Font.NORMAL); + PdfWriter.getInstance(document, new FileOutputStream(outputUrl)); + document.open(); + PdfPTable row; + row = new PdfPTable(13); + //表占页面100%宽度 + row.setWidthPercentage(100f); + //标题 + String[] titles = {"姓名", "性别", "部门", "职位", "用工性质", "身份证号", "联系电话", "出生年月", "参加工作", "最高学历", "所学专业", "毕业院校", "毕业时间"}; + for (String title : titles) { + row.addCell(createCell(title, font)); + } + document.add(row); + //内容 + for (EmployeeEntity entity : list) { + row = new PdfPTable(13); + //表占页面100%宽度 + row.setWidthPercentage(100f); + row.addCell(createCell(entity.getFullName(), font)); + row.addCell(createCell(entity.getGender(), font)); + row.addCell(createCell(entity.getDepartmentName(), font)); + row.addCell(createCell(entity.getPositionName(), font)); + row.addCell(createCell(entity.getWorkingNature(), font)); + row.addCell(createCell(entity.getIdNumber(), font)); + row.addCell(createCell(entity.getTelephone(), font)); + row.addCell(createCell(entity.getAttendWorkTime() != null ? DateUtil.daFormat(entity.getAttendWorkTime()) : "", font)); + row.addCell(createCell(entity.getBirthday() != null ? DateUtil.daFormat(entity.getBirthday()) : "", font)); + row.addCell(createCell(entity.getEducation(), font)); + row.addCell(createCell(entity.getMajor(), font)); + row.addCell(createCell(entity.getGraduationAcademy(), font)); + row.addCell(createCell(entity.getGraduationTime() != null ? DateUtil.daFormat(entity.getGraduationTime()) : "", font)); + document.add(row); + } + document.close(); + } catch (Exception e) { + log.error(e.getMessage()); + } + } + + private PdfPCell createCell(String value, Font font) { + PdfPCell cell = new PdfPCell(); + cell.setVerticalAlignment(Element.ALIGN_CENTER); + cell.setPhrase(new Phrase(value, font)); + return cell; + } + + private String getKey(String key) { + Map map = new HashMap<>(); + map.put("工号", "F_EnCode"); + map.put("姓名", "F_FullName"); + map.put("性别", "F_Gender"); + map.put("部门", "F_DepartmentName"); + map.put("职务", "F_PositionName"); + map.put("用工性质", "F_WorkingNature"); + map.put("身份证号", "F_IDNumber"); + map.put("联系电话", "F_Telephone"); + map.put("出生年月", "F_Birthday"); + map.put("参加工作", "F_AttendWorkTime"); + map.put("最高学历", "F_Education"); + map.put("所学专业", "F_Major"); + map.put("毕业院校", "F_GraduationAcademy"); + map.put("毕业时间", "F_GraduationTime"); + return map.get(key); + } + + private String getColumns(Integer key) { + Map map = new HashMap<>(); + map.put(1, "工号"); + map.put(2, "姓名"); + map.put(3, "性别"); + map.put(4, "部门"); + map.put(5, "职务"); + map.put(6, "用工性质"); + map.put(7, "身份证号"); + map.put(8, "联系电话"); + map.put(9, "出生年月"); + map.put(10, "参加工作"); + map.put(11, "最高学历"); + map.put(12, "所学专业"); + map.put(13, "毕业院校"); + map.put(14, "毕业时间"); + return map.get(key); + } +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/OrderEntryServiceImpl.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/OrderEntryServiceImpl.java new file mode 100644 index 0000000..6412478 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/OrderEntryServiceImpl.java @@ -0,0 +1,20 @@ +package jnpf.service.impl; + +import jnpf.base.service.SuperServiceImpl; +import jnpf.entity.OrderEntryEntity; +import jnpf.mapper.OrderEntryMapper; +import jnpf.service.OrderEntryService; +import org.springframework.stereotype.Service; + +/** + * 订单明细 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月26日 上午9:18 + */ +@Service +public class OrderEntryServiceImpl extends SuperServiceImpl implements OrderEntryService { + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/OrderReceivableServiceImpl.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/OrderReceivableServiceImpl.java new file mode 100644 index 0000000..1bb21bc --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/OrderReceivableServiceImpl.java @@ -0,0 +1,19 @@ +package jnpf.service.impl; + +import jnpf.base.service.SuperServiceImpl; +import jnpf.entity.OrderReceivableEntity; +import jnpf.mapper.OrderReceivableMapper; +import jnpf.service.OrderReceivableService; +import org.springframework.stereotype.Service; + +/** + * 订单收款 + * + * @copyright 引迈信息技术有限公司 + * @author JNPF开发平台组 + * @date 2019年9月26日 上午9:18 + */ +@Service +public class OrderReceivableServiceImpl extends SuperServiceImpl implements OrderReceivableService { + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/OrderServiceImpl.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/OrderServiceImpl.java new file mode 100644 index 0000000..7c245d3 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/OrderServiceImpl.java @@ -0,0 +1,265 @@ +package jnpf.service.impl; + +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import jnpf.base.UserInfo; +import jnpf.base.service.BillRuleService; +import jnpf.base.service.SuperServiceImpl; +import jnpf.entity.OrderEntity; +import jnpf.entity.OrderEntryEntity; +import jnpf.entity.OrderReceivableEntity; +import jnpf.exception.DataException; +import jnpf.mapper.OrderMapper; +import jnpf.model.order.*; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.UserService; +import jnpf.service.OrderEntryService; +import jnpf.service.OrderReceivableService; +import jnpf.service.OrderService; +import jnpf.util.*; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * 订单信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/15 9:19 + */ +@Service +@DSTransactional +public class OrderServiceImpl extends SuperServiceImpl implements OrderService { + + @Autowired + private UserProvider userProvider; + @Autowired + private OrderReceivableService orderReceivableService; + @Autowired + private OrderEntryService orderEntryService; + @Autowired + private BillRuleService billRuleService; + @Autowired + private UserService userService; + + /** + * 前单 + **/ + private static String PREV = "prev"; + /** + * 后单 + **/ + private static String NEXT = "next"; + + @Override + public List getList(PaginationOrder paginationOrder) { + UserInfo userInfo = userProvider.get(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + //关键字(订单编码、客户名称、业务人员) + String keyWord = paginationOrder.getKeyword() != null ? paginationOrder.getKeyword() : null; + if (!StringUtils.isEmpty(keyWord)) { + String word = keyWord; + queryWrapper.lambda().and( + t -> t.like(OrderEntity::getOrderCode, word) + .or().like(OrderEntity::getCustomerName, word) + .or().like(OrderEntity::getSalesmanName, word) + ); + } + //起始日期-结束日期 + String startTime = paginationOrder.getStartTime() != null ? paginationOrder.getStartTime() : null; + String endTime = paginationOrder.getEndTime() != null ? paginationOrder.getEndTime() : null; + if (!StringUtils.isEmpty(startTime) && !StringUtils.isEmpty(endTime)) { + Date startTimes = DateUtil.stringToDate(DateUtil.daFormatYmd(Long.parseLong(startTime)) + " 00:00:00"); + Date endTimes = DateUtil.stringToDate(DateUtil.daFormatYmd(Long.parseLong(endTime)) + " 23:59:59"); + queryWrapper.lambda().ge(OrderEntity::getOrderDate, startTimes).le(OrderEntity::getOrderDate, endTimes); + } + //订单状态 + String mark = paginationOrder.getEnabledMark() != null ? paginationOrder.getEnabledMark() : null; + if (!StringUtils.isEmpty(mark)) { + queryWrapper.lambda().eq(OrderEntity::getEnabledMark, mark); + } + //排序 + if (StringUtils.isEmpty(paginationOrder.getSidx())) { + queryWrapper.lambda().orderByDesc(OrderEntity::getCreatorTime); + } else { + queryWrapper = "asc".equals(paginationOrder.getSort().toLowerCase()) ? queryWrapper.orderByAsc(paginationOrder.getSidx()) : queryWrapper.orderByDesc(paginationOrder.getSidx()); + } + Page page = new Page<>(paginationOrder.getCurrentPage(), paginationOrder.getPageSize()); + IPage orderEntityPage = this.page(page, queryWrapper); + List data = orderEntityPage.getRecords(); + return paginationOrder.setData(data, page.getTotal()); + } + + @Override + public List getOrderEntryList(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrderEntryEntity::getOrderId, id).orderByDesc(OrderEntryEntity::getSortCode); + return orderEntryService.list(queryWrapper); + } + + @Override + public List getOrderReceivableList(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrderReceivableEntity::getOrderId, id).orderByDesc(OrderReceivableEntity::getSortCode); + return orderReceivableService.list(queryWrapper); + } + + @Override + public OrderEntity getPrevOrNextInfo(String id, String method) { + QueryWrapper result = new QueryWrapper<>(); + OrderEntity orderEntity = getInfo(id); + String orderBy = "desc"; + if (PREV.equals(method)) { + result.lambda().gt(OrderEntity::getCreatorTime, orderEntity.getCreatorTime()); + orderBy = ""; + } else if (NEXT.equals(method)) { + result.lambda().lt(OrderEntity::getCreatorTime, orderEntity.getCreatorTime()); + } + result.lambda().notIn(OrderEntity::getId, orderEntity.getId()); + if (StringUtil.isNotEmpty(orderBy)) { + result.lambda().orderByDesc(OrderEntity::getCreatorTime); + } + List data = this.list(result); + if (data.size() > 0) { + return data.get(0); + } + return null; + } + + @Override + public OrderInfoVO getInfoVo(String id, String method) throws DataException { + OrderInfoVO infoModel = null; + OrderEntity orderEntity = this.getPrevOrNextInfo(id, method); + if (orderEntity != null) { + List orderEntryList = this.getOrderEntryList(orderEntity.getId()); + List orderReceivableList = this.getOrderReceivableList(orderEntity.getId()); + infoModel = JsonUtilEx.getJsonToBeanEx(orderEntity, OrderInfoVO.class); + UserEntity createUser = null; + if (StringUtil.isNotEmpty(infoModel.getCreatorUserId())) { + createUser = userService.getInfo(infoModel.getCreatorUserId()); + } + infoModel.setCreatorUserId(createUser != null ? createUser.getRealName() + "/" + createUser.getAccount() : ""); + UserEntity lastUser = null; + if (StringUtil.isNotEmpty(infoModel.getLastModifyUserId())) { + lastUser = userService.getInfo(infoModel.getLastModifyUserId()); + } + infoModel.setLastModifyUserId(lastUser != null ? lastUser.getRealName() + "/" + lastUser.getAccount() : ""); + List orderEntryModels = JsonUtil.getJsonToList(orderEntryList, OrderInfoOrderEntryModel.class); + infoModel.setGoodsList(orderEntryModels); + List orderReceivableModels = JsonUtil.getJsonToList(orderReceivableList, OrderInfoOrderReceivableModel.class); + infoModel.setCollectionPlanList(orderReceivableModels); + } + return infoModel; + } + + @Override + public OrderEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrderEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void delete(OrderEntity entity) { + QueryWrapper orderWrapper = new QueryWrapper<>(); + orderWrapper.lambda().eq(OrderEntity::getId, entity.getId()); + this.remove(orderWrapper); + QueryWrapper entryWrapper = new QueryWrapper<>(); + entryWrapper.lambda().eq(OrderEntryEntity::getOrderId, entity.getId()); + orderEntryService.remove(entryWrapper); + QueryWrapper receivableWrapper = new QueryWrapper<>(); + receivableWrapper.lambda().eq(OrderReceivableEntity::getOrderId, entity.getId()); + orderReceivableService.remove(receivableWrapper); + } + + @Override + @DSTransactional + public void create(OrderEntity entity, List orderEntryList, List orderReceivableList) { + entity.setCreatorUserId(userProvider.get().getUserId()); + entity.setEnabledMark(1); + for (int i = 0; i < orderEntryList.size(); i++) { + orderEntryList.get(i).setId(RandomUtil.uuId()); + orderEntryList.get(i).setOrderId(entity.getId()); + orderEntryList.get(i).setSortCode(Long.parseLong(i + "")); + orderEntryService.save(orderEntryList.get(i)); + } + for (int i = 0; i < orderReceivableList.size(); i++) { + orderReceivableList.get(i).setId(RandomUtil.uuId()); + orderReceivableList.get(i).setOrderId(entity.getId()); + orderReceivableList.get(i).setSortCode(Long.parseLong(i + "")); + orderReceivableService.save(orderReceivableList.get(i)); + } + billRuleService.useBillNumber("OrderNumber"); + this.save(entity); + } + + @Override + @DSTransactional + public boolean update(String id, OrderEntity entity, List orderEntryList, List orderReceivableList) { + entity.setId(id); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(userProvider.get().getUserId()); + QueryWrapper entryWrapper = new QueryWrapper<>(); + entryWrapper.lambda().eq(OrderEntryEntity::getOrderId, entity.getId()); + orderEntryService.remove(entryWrapper); + QueryWrapper receivableWrapper = new QueryWrapper<>(); + receivableWrapper.lambda().eq(OrderReceivableEntity::getOrderId, entity.getId()); + orderReceivableService.remove(receivableWrapper); + for (int i = 0; i < orderEntryList.size(); i++) { + orderEntryList.get(i).setId(RandomUtil.uuId()); + orderEntryList.get(i).setOrderId(entity.getId()); + orderEntryList.get(i).setSortCode(Long.parseLong(i + "")); + orderEntryService.save(orderEntryList.get(i)); + } + for (int i = 0; i < orderReceivableList.size(); i++) { + orderReceivableList.get(i).setId(RandomUtil.uuId()); + orderReceivableList.get(i).setOrderId(entity.getId()); + orderReceivableList.get(i).setSortCode(Long.parseLong(i + "")); + orderReceivableService.save(orderReceivableList.get(i)); + } + boolean flag = this.updateById(entity); + return flag; + } + + @Override + public void data(String id, String data) { + OrderForm orderForm = JsonUtil.getJsonToBean(data, OrderForm.class); + OrderEntity entity = JsonUtil.getJsonToBean(orderForm, OrderEntity.class); + List goodsList = orderForm.getGoodsList() != null ? orderForm.getGoodsList() : new ArrayList<>(); + List orderEntryList = JsonUtil.getJsonToList(goodsList, OrderEntryEntity.class); + List collectionPlanList = orderForm.getCollectionPlanList() != null ? orderForm.getCollectionPlanList() : new ArrayList<>(); + List orderReceivableList = JsonUtil.getJsonToList(collectionPlanList, OrderReceivableEntity.class); + entity.setId(id); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(userProvider.get().getUserId()); + QueryWrapper entryWrapper = new QueryWrapper<>(); + entryWrapper.lambda().eq(OrderEntryEntity::getOrderId, entity.getId()); + orderEntryService.remove(entryWrapper); + QueryWrapper receivableWrapper = new QueryWrapper<>(); + receivableWrapper.lambda().eq(OrderReceivableEntity::getOrderId, entity.getId()); + orderReceivableService.remove(receivableWrapper); + for (int i = 0; i < orderEntryList.size(); i++) { + orderEntryList.get(i).setId(RandomUtil.uuId()); + orderEntryList.get(i).setOrderId(entity.getId()); + orderEntryList.get(i).setSortCode(Long.parseLong(i + "")); + orderEntryService.save(orderEntryList.get(i)); + } + for (int i = 0; i < orderReceivableList.size(); i++) { + orderReceivableList.get(i).setId(RandomUtil.uuId()); + orderReceivableList.get(i).setOrderId(entity.getId()); + orderReceivableList.get(i).setSortCode(Long.parseLong(i + "")); + orderReceivableService.save(orderReceivableList.get(i)); + } + this.saveOrUpdate(entity); + } + + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/ProductEntryServiceImpl.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/ProductEntryServiceImpl.java new file mode 100644 index 0000000..a1974b2 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/ProductEntryServiceImpl.java @@ -0,0 +1,48 @@ +package jnpf.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import jnpf.base.Pagination; +import jnpf.base.service.SuperServiceImpl; +import jnpf.entity.ProductEntryEntity; +import jnpf.mapper.ProductEntryMapper; +import jnpf.service.ProductEntryService; +import jnpf.util.StringUtil; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 销售订单明细 + * 版本: V3.1.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2021-07-10 10:40:59 + */ +@Service +public class ProductEntryServiceImpl extends SuperServiceImpl implements ProductEntryService { + + @Override + public List getProductentryEntityList(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ProductEntryEntity::getProductId, id); + return this.list(queryWrapper); + } + + @Override + public List getProductentryEntityList(Pagination pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if(StringUtil.isNotEmpty(pagination.getKeyword())){ + queryWrapper.lambda().and( + t->t.like(ProductEntryEntity::getProductName, pagination.getKeyword()) + .or().like(ProductEntryEntity::getProductCode, pagination.getKeyword()) + .or().like(ProductEntryEntity::getProductSpecification, pagination.getKeyword()) + ); + } + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage userIPage = this.page(page, queryWrapper); + return pagination.setData(userIPage.getRecords(), userIPage.getTotal()); + } + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/ProductGoodsServiceImpl.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/ProductGoodsServiceImpl.java new file mode 100644 index 0000000..df2d2e4 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/ProductGoodsServiceImpl.java @@ -0,0 +1,102 @@ +package jnpf.service.impl; + +import jnpf.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import jnpf.entity.ProductGoodsEntity; +import jnpf.mapper.ProductGoodsMapper; +import jnpf.model.productgoods.ProductGoodsPagination; +import jnpf.service.ProductGoodsService; +import jnpf.util.RandomUtil; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +/** + * 产品商品 + * 版本: V3.1.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2021-07-10 15:57:50 + */ +@Service +public class ProductGoodsServiceImpl extends SuperServiceImpl implements ProductGoodsService { + + @Autowired + private UserProvider userProvider; + + @Override + public List getGoodList(String type) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(type)) { + queryWrapper.lambda().eq(ProductGoodsEntity::getType, type); + } + return this.list(queryWrapper); + } + + @Override + public List getList(ProductGoodsPagination goodsPagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(goodsPagination.getCode())) { + queryWrapper.lambda().like(ProductGoodsEntity::getEnCode, goodsPagination.getCode()); + } + if (StringUtil.isNotEmpty(goodsPagination.getFullName())) { + queryWrapper.lambda().like(ProductGoodsEntity::getFullName, goodsPagination.getFullName()); + } + if (StringUtil.isNotEmpty(goodsPagination.getClassifyId())) { + queryWrapper.lambda().like(ProductGoodsEntity::getClassifyId, goodsPagination.getClassifyId()); + } + if (StringUtil.isNotEmpty(goodsPagination.getKeyword())) { + queryWrapper.lambda().and( + t -> t.like(ProductGoodsEntity::getFullName, goodsPagination.getKeyword()) + .or().like(ProductGoodsEntity::getEnCode, goodsPagination.getKeyword()) + .or().like(ProductGoodsEntity::getProductSpecification, goodsPagination.getKeyword()) + ); + } + //排序 + if (StringUtil.isEmpty(goodsPagination.getSidx())) { + queryWrapper.lambda().orderByDesc(ProductGoodsEntity::getId); + } else { + queryWrapper = "asc".equals(goodsPagination.getSort().toLowerCase()) ? queryWrapper.orderByAsc(goodsPagination.getSidx()) : queryWrapper.orderByDesc(goodsPagination.getSidx()); + } + Page page = new Page<>(goodsPagination.getCurrentPage(), goodsPagination.getPageSize()); + IPage userIPage = this.page(page, queryWrapper); + return goodsPagination.setData(userIPage.getRecords(), userIPage.getTotal()); + } + + @Override + public ProductGoodsEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ProductGoodsEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(ProductGoodsEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(userProvider.get().getUserId()); + entity.setCreatorTime(new Date()); + this.save(entity); + } + + @Override + public boolean update(String id, ProductGoodsEntity entity) { + entity.setId(id); + entity.setLastModifyUserId(userProvider.get().getUserId()); + entity.setLastModifyTime(new Date()); + return this.updateById(entity); + } + + @Override + public void delete(ProductGoodsEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/ProductServiceImpl.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/ProductServiceImpl.java new file mode 100644 index 0000000..f7e4381 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/ProductServiceImpl.java @@ -0,0 +1,130 @@ +package jnpf.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import jnpf.base.UserInfo; +import jnpf.base.service.BillRuleService; +import jnpf.base.service.SuperServiceImpl; +import jnpf.entity.ProductEntity; +import jnpf.entity.ProductEntryEntity; +import jnpf.exception.DataException; +import jnpf.mapper.ProductMapper; +import jnpf.model.product.ProductPagination; +import jnpf.service.ProductEntryService; +import jnpf.service.ProductService; +import jnpf.util.RandomUtil; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Date; +import java.util.List; + +/** + * 销售订单 + * 版本: V3.1.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2021-07-10 10:40:59 + */ +@Service + +public class ProductServiceImpl extends SuperServiceImpl implements ProductService { + + @Autowired + private UserProvider userProvider; + @Autowired + private BillRuleService billRuleService; + @Autowired + private ProductEntryService productEntryService; + + @Override + public List getList(ProductPagination productPagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(productPagination.getCode())) { + queryWrapper.lambda().and(t -> t.like(ProductEntity::getEnCode, productPagination.getCode())); + } + if (StringUtil.isNotEmpty(productPagination.getCustomerName())) { + queryWrapper.lambda().and(t -> t.like(ProductEntity::getCustomerName, productPagination.getCustomerName())); + } + if (StringUtil.isNotEmpty(productPagination.getContactTel())) { + queryWrapper.lambda().and(t -> t.like(ProductEntity::getContactTel, productPagination.getContactTel())); + } + //排序 + queryWrapper.lambda().orderByDesc(ProductEntity::getCreatorTime); + Page page = new Page<>(productPagination.getCurrentPage(), productPagination.getPageSize()); + IPage userIPage = this.page(page, queryWrapper); + return productPagination.setData(userIPage.getRecords(), userIPage.getTotal()); + } + + @Override + public ProductEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ProductEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void create(ProductEntity entity, List productEntryList) throws DataException { + UserInfo userInfo = userProvider.get(); + String code = billRuleService.getBillNumber("OrderNumber",false); + entity.setEnCode(code); + //类型 + entity.setType("市场活动"); + //制单 + entity.setSalesmanId(userInfo.getUserId()); + entity.setSalesmanName(userInfo.getUserName()); + entity.setSalesmanDate(new Date()); + //状态 + entity.setAuditState(1); + entity.setGoodsState(1); + entity.setCloseState(1); + entity.setCreatorUserId(userInfo.getUserId()); + entity.setCreatorTime(new Date()); + entity.setId(RandomUtil.uuId()); + this.save(entity); + for (ProductEntryEntity product : productEntryList) { + product.setId(RandomUtil.uuId()); + product.setActivity("市场部全国香风健康奢护"); + product.setType("市场活动"); + product.setUtil("支"); + product.setCommandType("唯一码"); + product.setProductId(entity.getId()); + productEntryService.save(product); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean update(String id, ProductEntity entity, List productEntryList) { + entity.setId(id); + entity.setLastModifyUserId(userProvider.get().getUserId()); + entity.setLastModifyTime(new Date()); + QueryWrapper entryWrapper = new QueryWrapper<>(); + entryWrapper.lambda().eq(ProductEntryEntity::getProductId, entity.getId()); + productEntryService.remove(entryWrapper); + for (ProductEntryEntity product : productEntryList) { + product.setId(RandomUtil.uuId()); + product.setProductId(entity.getId()); + productEntryService.save(product); + } + return this.updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(ProductEntity entity) { + if (entity != null) { + QueryWrapper entryWrapper = new QueryWrapper<>(); + entryWrapper.lambda().eq(ProductEntryEntity::getProductId, entity.getId()); + productEntryService.remove(entryWrapper); + this.removeById(entity.getId()); + } + } + + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/ProductclassifyServiceImpl.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/ProductclassifyServiceImpl.java new file mode 100644 index 0000000..ddceaf2 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/ProductclassifyServiceImpl.java @@ -0,0 +1,65 @@ +package jnpf.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import jnpf.base.service.SuperServiceImpl; +import jnpf.entity.ProductclassifyEntity; +import jnpf.mapper.ProductclassifyMapper; +import jnpf.service.ProductclassifyService; +import jnpf.util.RandomUtil; +import jnpf.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +/** + * + * 产品分类 + * 版本: V3.1.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2021-07-10 14:34:04 + */ +@Service +public class ProductclassifyServiceImpl extends SuperServiceImpl implements ProductclassifyService { + + @Autowired + private UserProvider userProvider; + + @Override + public List getList(){ + QueryWrapper queryWrapper=new QueryWrapper<>(); + return list(queryWrapper); + } + + @Override + public ProductclassifyEntity getInfo(String id){ + QueryWrapper queryWrapper=new QueryWrapper<>(); + queryWrapper.lambda().eq(ProductclassifyEntity::getId,id); + return this.getOne(queryWrapper); + } + + @Override + public void create(ProductclassifyEntity entity){ + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(userProvider.get().getUserId()); + entity.setCreatorTime(new Date()); + this.save(entity); + } + + @Override + public boolean update(String id, ProductclassifyEntity entity){ + entity.setId(id); + entity.setLastModifyUserId(userProvider.get().getUserId()); + entity.setLastModifyTime(new Date()); + return this.updateById(entity); + } + @Override + public void delete(ProductclassifyEntity entity){ + if(entity!=null){ + this.removeById(entity.getId()); + } + } + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/ProjectGanttServiceImpl.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/ProjectGanttServiceImpl.java new file mode 100644 index 0000000..c544d33 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/ProjectGanttServiceImpl.java @@ -0,0 +1,167 @@ +package jnpf.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import jnpf.base.Page; +import jnpf.base.service.SuperServiceImpl; +import jnpf.entity.ProjectGanttEntity; +import jnpf.mapper.ProjectGanttMapper; +import jnpf.service.ProjectGanttService; +import jnpf.util.RandomUtil; +import jnpf.util.UserProvider; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Date; +import java.util.List; + +/** + * 订单明细 + * + * @author JNPF开发平台组 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +@Service +public class ProjectGanttServiceImpl extends SuperServiceImpl implements ProjectGanttService { + + @Autowired + private UserProvider userProvider; + + @Override + public List getList(Page page) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ProjectGanttEntity::getType, 1).orderByAsc(ProjectGanttEntity::getSortCode) + .orderByDesc(ProjectGanttEntity::getCreatorTime); + if (!StringUtils.isEmpty(page.getKeyword())) { + queryWrapper.lambda().and( + t -> t.like(ProjectGanttEntity::getEnCode, page.getKeyword()) + .or().like(ProjectGanttEntity::getFullName, page.getKeyword()) + ); + } + return this.list(queryWrapper); + } + + @Override + public List getTaskList(String projectId) { + ProjectGanttEntity entity = this.getInfo(projectId); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ProjectGanttEntity::getType, 2).eq(ProjectGanttEntity::getProjectId, projectId).orderByAsc(ProjectGanttEntity::getSortCode); + List list = this.list(queryWrapper); + list.add(entity); + return list; + } + + @Override + public ProjectGanttEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ProjectGanttEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public boolean allowDelete(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().and(t -> + t.eq(ProjectGanttEntity::getParentId, id).or().eq(ProjectGanttEntity::getProjectId, id) + ); + return this.list(queryWrapper).size() < 1; + } + + @Override + public void delete(ProjectGanttEntity entity) { + this.removeById(entity.getId()); + } + + @Override + public void create(ProjectGanttEntity entity) { + entity.setId(RandomUtil.uuId()); + if (entity.getEnabledMark() == null) { + entity.setEnabledMark(1); + } + entity.setSortCode(RandomUtil.parses()); + entity.setCreatorUserId(userProvider.get().getUserId()); + this.save(entity); + } + + @Override + public boolean update(String id, ProjectGanttEntity entity) { + entity.setId(id); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(userProvider.get().getUserId()); + return this.updateById(entity); + } + + @Override + public boolean isExistByFullName(String fullName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ProjectGanttEntity::getFullName, fullName); + if (!StringUtils.isEmpty(id)) { + queryWrapper.lambda().ne(ProjectGanttEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public boolean isExistByEnCode(String enCode, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ProjectGanttEntity::getEnCode, enCode); + if (!StringUtils.isEmpty(id)) { + queryWrapper.lambda().ne(ProjectGanttEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + @Transactional + public boolean first(String id) { + boolean isOk = false; + //获取要上移的那条数据的信息 + ProjectGanttEntity upEntity = this.getById(id); + Long upSortCode = upEntity.getSortCode() == null ? 0 : upEntity.getSortCode(); + //查询上几条记录 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .lt(ProjectGanttEntity::getSortCode, upSortCode) + .eq(ProjectGanttEntity::getParentId, upEntity.getParentId()) + .orderByDesc(ProjectGanttEntity::getSortCode); + List downEntity = this.list(queryWrapper); + if (downEntity.size() > 0) { + //交换两条记录的sort值 + Long temp = upEntity.getSortCode(); + upEntity.setSortCode(downEntity.get(0).getSortCode()); + downEntity.get(0).setSortCode(temp); + this.updateById(downEntity.get(0)); + this.updateById(upEntity); + isOk = true; + } + return isOk; + } + + @Override + @Transactional + public boolean next(String id) { + boolean isOk = false; + //获取要下移的那条数据的信息 + ProjectGanttEntity downEntity = this.getById(id); + Long upSortCode = downEntity.getSortCode() == null ? 0 : downEntity.getSortCode(); + //查询下几条记录 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .gt(ProjectGanttEntity::getSortCode, upSortCode) + .eq(ProjectGanttEntity::getParentId,downEntity.getParentId()) + .orderByAsc(ProjectGanttEntity::getSortCode); + List upEntity = this.list(queryWrapper); + if (upEntity.size() > 0) { + //交换两条记录的sort值 + Long temp = downEntity.getSortCode(); + downEntity.setSortCode(upEntity.get(0).getSortCode()); + upEntity.get(0).setSortCode(temp); + this.updateById(upEntity.get(0)); + this.updateById(downEntity); + isOk = true; + } + return isOk; + } +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/TableExampleServiceImpl.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/TableExampleServiceImpl.java new file mode 100644 index 0000000..d903890 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/TableExampleServiceImpl.java @@ -0,0 +1,161 @@ +package jnpf.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import jnpf.base.service.SuperServiceImpl; +import jnpf.entity.TableExampleEntity; +import jnpf.mapper.TableExampleMapper; +import jnpf.model.tableexample.PaginationTableExample; +import jnpf.service.TableExampleService; +import jnpf.util.RandomUtil; +import jnpf.util.UserProvider; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +/** + * 表格示例数据 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月26日 上午9:18 + */ +@Service +public class TableExampleServiceImpl extends SuperServiceImpl implements TableExampleService { + + @Autowired + private UserProvider userProvider; + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().orderByAsc(TableExampleEntity::getProjectType).orderByAsc(TableExampleEntity::getSortCode); + return this.list(queryWrapper); + } + + @Override + public List getList(String keyword) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + //关键字查询 + if (!StringUtils.isEmpty(keyword)){ + queryWrapper.lambda().and(t->t.like(TableExampleEntity::getCustomerName,keyword) + .or().like(TableExampleEntity::getProjectName,keyword)); + } + queryWrapper.lambda().orderByAsc(TableExampleEntity::getProjectType).orderByAsc(TableExampleEntity::getSortCode); + return this.list(queryWrapper); + } + + @Override + public List getList(String typeId, PaginationTableExample paginationTableExample) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(TableExampleEntity::getProjectType, typeId); + //关键字(项目编码、项目名称、客户名称) + String keyWord = paginationTableExample.getKeyword() != null ? paginationTableExample.getKeyword() : null; + if (!StringUtils.isEmpty(keyWord)) { + queryWrapper.lambda().and( + t -> t.like(TableExampleEntity::getProjectCode, keyWord) + .or().like(TableExampleEntity::getProjectName, keyWord) + .or().like(TableExampleEntity::getCustomerName, keyWord) + ); + } + //标签查询 + String sign = paginationTableExample.getF_Sign() != null ? paginationTableExample.getF_Sign() : null; + if (!StringUtils.isEmpty(sign)) { + String[] arraySign = sign.split(","); + for (int i = 0; i < arraySign.length; i++) { + String item = arraySign[i]; + if (i == 0) { + queryWrapper.lambda().like(TableExampleEntity::getProjectCode, item); + } else { + queryWrapper.lambda().or(t -> t.like(TableExampleEntity::getProjectCode, item)); + } + } + } + //排序 + if (StringUtils.isEmpty(paginationTableExample.getSidx())) { + queryWrapper.lambda().orderByDesc(TableExampleEntity::getRegisterDate); + } else { + queryWrapper = "asc".equals(paginationTableExample.getSort().toLowerCase()) ? queryWrapper.orderByAsc(paginationTableExample.getSidx()) : queryWrapper.orderByDesc(paginationTableExample.getSidx()); + } + return this.list(queryWrapper); + } + + @Override + public List getList(PaginationTableExample paginationTableExample) { + QueryWrapper queryWrapper = new QueryWrapper<>(); +// Map queryParam = OptimizeUtil.queryParam(pagination); + //关键字(项目编码、项目名称、客户名称) + String keyWord = paginationTableExample.getKeyword() != null ? paginationTableExample.getKeyword() : null; + if (!StringUtils.isEmpty(keyWord)) { + queryWrapper.lambda().and( + t -> t.like(TableExampleEntity::getProjectCode, keyWord) + .or().like(TableExampleEntity::getProjectName, keyWord) + .or().like(TableExampleEntity::getCustomerName, keyWord) + ); + } + //标签查询 + String sign = paginationTableExample.getF_Sign() != null ? paginationTableExample.getF_Sign() : null; + if (!StringUtils.isEmpty(sign)) { + String[] arraySign = sign.split(","); + for (int i = 0; i < arraySign.length; i++) { + String item = arraySign[i]; + if (i == 0) { + queryWrapper.lambda().like(TableExampleEntity::getProjectCode, item); + } else { + queryWrapper.lambda().or(t -> t.like(TableExampleEntity::getProjectCode, item)); + } + } + } + //排序 + if (StringUtils.isEmpty(paginationTableExample.getSidx())) { + queryWrapper.lambda().orderByDesc(TableExampleEntity::getRegisterDate); + } else { + queryWrapper = "asc".equalsIgnoreCase(paginationTableExample.getSort()) ? queryWrapper.orderByAsc(paginationTableExample.getSidx()) : queryWrapper.orderByDesc(paginationTableExample.getSidx()); + } + Page page=new Page(paginationTableExample.getCurrentPage(),paginationTableExample.getPageSize()); + IPage exampleEntityIPage=this.page(page,queryWrapper); + return paginationTableExample.setData(exampleEntityIPage.getRecords(),page.getTotal()); + } + + @Override + public TableExampleEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(TableExampleEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void delete(TableExampleEntity entity) { + this.removeById(entity.getId()); + } + + @Override + public void create(TableExampleEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setSortCode(RandomUtil.parses()); + entity.setRegisterDate(new Date()); + entity.setRegistrant(userProvider.get().getUserId()); + this.save(entity); + } + + @Override + public boolean update(String id, TableExampleEntity entity) { + entity.setId(id); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(userProvider.get().getUserId()); + return this.updateById(entity); + } + + @Override + public boolean rowEditing(TableExampleEntity entity) { + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(userProvider.get().getUserId()); + return this.updateById(entity); + } + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/WorkLogServiceImpl.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/WorkLogServiceImpl.java new file mode 100644 index 0000000..a6bafaf --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/WorkLogServiceImpl.java @@ -0,0 +1,138 @@ +package jnpf.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import jnpf.base.Pagination; +import jnpf.base.service.SuperServiceImpl; +import jnpf.entity.WorkLogEntity; +import jnpf.entity.WorkLogShareEntity; +import jnpf.mapper.WorkLogMapper; +import jnpf.service.WorkLogService; +import jnpf.service.WorkLogShareService; +import jnpf.util.RandomUtil; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Date; +import java.util.List; + +/** + * 工作日志 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月26日 上午9:18 + */ +@Service +public class WorkLogServiceImpl extends SuperServiceImpl implements WorkLogService { + + @Autowired + private UserProvider userProvider; + @Autowired + private WorkLogShareService workLogShareService; + + @Override + public List getSendList(Pagination pageModel) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(WorkLogEntity::getCreatorUserId, userProvider.get().getUserId()); + //app搜索 + if(StringUtil.isNotEmpty(pageModel.getKeyword())){ + queryWrapper.lambda().like(WorkLogEntity::getTitle,pageModel.getKeyword()); + } + //排序 + if (StringUtils.isEmpty(pageModel.getSidx())) { + queryWrapper.lambda().orderByDesc(WorkLogEntity::getCreatorTime); + } else { + queryWrapper = "asc".equals(pageModel.getSort().toLowerCase()) ? queryWrapper.orderByAsc(pageModel.getSidx()) : queryWrapper.orderByDesc(pageModel.getSidx()); + } + Page page = new Page(pageModel.getCurrentPage(), pageModel.getPageSize()); + IPage IPages = this.page(page, queryWrapper); + return pageModel.setData(IPages.getRecords(), page.getTotal()); + } + + @Override + public List getReceiveList(Pagination pageModel) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().like(WorkLogEntity::getToUserId, userProvider.get().getUserId()); + //app搜索 + if(StringUtil.isNotEmpty(pageModel.getKeyword())){ + queryWrapper.lambda().like(WorkLogEntity::getTitle,pageModel.getKeyword()); + } + //排序 + if (StringUtils.isEmpty(pageModel.getSidx())) { + queryWrapper.lambda().orderByDesc(WorkLogEntity::getCreatorTime); + } else { + queryWrapper = "asc".equals(pageModel.getSort().toLowerCase()) ? queryWrapper.orderByAsc(pageModel.getSidx()) : queryWrapper.orderByDesc(pageModel.getSidx()); + } + Page page = new Page(pageModel.getCurrentPage(), pageModel.getPageSize()); + IPage IPages = this.page(page, queryWrapper); + return pageModel.setData(IPages.getRecords(), page.getTotal()); + } + + @Override + public WorkLogEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(WorkLogEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + @Transactional + public void create(WorkLogEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setSortCode(RandomUtil.parses()); + entity.setCreatorTime(new Date()); + entity.setCreatorUserId(userProvider.get().getUserId()); + this.save(entity); + String[] toUserIds = entity.getToUserId().split(","); + for (String userIds : toUserIds) { + WorkLogShareEntity workLogShare = new WorkLogShareEntity(); + workLogShare.setId(RandomUtil.uuId()); + workLogShare.setShareTime(new Date()); + workLogShare.setWorkLogId(entity.getId()); + workLogShare.setShareUserId(userIds); + workLogShareService.save(workLogShare); + } + } + + @Override + @Transactional + public boolean update(String id, WorkLogEntity entity) { + boolean flag = false; + entity.setId(id); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(userProvider.get().getUserId()); + flag = this.updateById(entity); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(WorkLogShareEntity::getWorkLogId,entity.getId()); + workLogShareService.remove(queryWrapper); + String[] toUserIds = entity.getToUserId().split(","); + for (String userIds : toUserIds) { + WorkLogShareEntity workLogShare = new WorkLogShareEntity(); + workLogShare.setId(RandomUtil.uuId()); + workLogShare.setShareTime(new Date()); + workLogShare.setWorkLogId(entity.getId()); + workLogShare.setShareUserId(userIds); + workLogShareService.save(workLogShare); + } + return flag; + } + + @Override + @Transactional + public void delete(WorkLogEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(WorkLogShareEntity::getWorkLogId,entity.getId()); + workLogShareService.remove(queryWrapper); + } + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/WorkLogShareServiceImpl.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/WorkLogShareServiceImpl.java new file mode 100644 index 0000000..fc62fb6 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-biz/src/main/java/jnpf/service/impl/WorkLogShareServiceImpl.java @@ -0,0 +1,21 @@ +package jnpf.service.impl; + +import jnpf.base.service.SuperServiceImpl; +import jnpf.entity.WorkLogShareEntity; +import jnpf.mapper.WorkLogShareMapper; +import jnpf.service.WorkLogShareService; +import org.springframework.stereotype.Service; + + +/** + * 工作日志分享 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月26日 上午9:18 + */ +@Service +public class WorkLogShareServiceImpl extends SuperServiceImpl implements WorkLogShareService { + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/pom.xml b/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/pom.xml new file mode 100644 index 0000000..e6e0997 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/pom.xml @@ -0,0 +1,32 @@ + + + + jnpf-extend + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-extend-controller + + + + com.jnpf + jnpf-extend-biz + ${project.version} + + + com.jnpf + jnpf-file-entity + ${project.version} + + + com.jnpf + jnpf-workflow-engine-biz + ${project.version} + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/BarCodeController.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/BarCodeController.java new file mode 100644 index 0000000..52606df --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/BarCodeController.java @@ -0,0 +1,50 @@ +package jnpf.controller; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import jnpf.util.DownUtil; +import jnpf.util.ServletUtil; +import jnpf.util.ZxingCodeUtil; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.awt.image.BufferedImage; + +/** + * 生成条码 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月26日 上午9:18 + */ +@RestController +@Tag(name = "(待定)生成条码", description = "BarCode") +@RequestMapping("/api/extend/BarCode") +public class BarCodeController { + + /** + * 生成二维码 + * + * @return + */ + @Operation(summary = "生成二维码") + @GetMapping("/BuildQRCode") + public void buildQrCode() { + BufferedImage image = ZxingCodeUtil.createCode(ServletUtil.getHeader("F_QRCodeContent"), 400, 400); + DownUtil.write(image); + } + + /** + * 生成条形码 + * + * @return + */ + @Operation(summary = "生成条形码") + @GetMapping("/BuildBarCode") + public void buildBarCode() { + BufferedImage image = ZxingCodeUtil.getBarcode(ServletUtil.getHeader("F_BarCodeContent"), 265, 50); + DownUtil.write(image); + } +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/BigDataController.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/BigDataController.java new file mode 100644 index 0000000..0dcc1e4 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/BigDataController.java @@ -0,0 +1,68 @@ +package jnpf.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import jnpf.base.ActionResult; +import jnpf.base.Pagination; +import jnpf.base.controller.SuperController; +import jnpf.base.vo.PageListVO; +import jnpf.base.vo.PaginationVO; +import jnpf.entity.BigDataEntity; +import jnpf.exception.WorkFlowException; +import jnpf.model.bidata.BigBigDataListVO; +import jnpf.service.BigDataService; +import jnpf.util.JsonUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * 大数据测试 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月26日 上午9:18 + */ +@Tag(name = "大数据测试", description = "BigData") +@RestController +@RequestMapping("/api/extend/BigData") +public class BigDataController extends SuperController { + + @Autowired + private BigDataService bigDataService; + + /** + * 列表 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "列表") + @GetMapping + @SaCheckPermission("extend.bigData") + public ActionResult> list(Pagination pagination) { + List data = bigDataService.getList(pagination); + List list= JsonUtil.getJsonToList(data, BigBigDataListVO.class); + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination,PaginationVO.class); + return ActionResult.page(list,paginationVO); + } + + /** + * 新建 + * + * @return + */ + @Operation(summary = "添加大数据测试") + @PostMapping + @SaCheckPermission("extend.bigData") + public ActionResult create() throws WorkFlowException { + bigDataService.create(10000); + return ActionResult.success("新建成功10000条数据"); + } +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/CustomerController.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/CustomerController.java new file mode 100644 index 0000000..2d82eb7 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/CustomerController.java @@ -0,0 +1,140 @@ +package jnpf.controller; + +import jnpf.base.controller.SuperController; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.Pagination; +import jnpf.base.controller.SuperController; +import jnpf.base.vo.PageListVO; +import jnpf.constant.MsgCode; +import jnpf.entity.CustomerEntity; +import jnpf.model.customer.CustomerCrForm; +import jnpf.model.customer.CustomerInfoVO; +import jnpf.model.customer.CustomerListVO; +import jnpf.model.customer.CustomerUpForm; +import jnpf.service.CustomerService; +import jnpf.util.JsonUtil; +import jnpf.util.RandomUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.Assert; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; + +/** + * 客户信息 + * + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021-07-10 14:09:05 + */ +@Slf4j +@RestController +@Tag(name = "客户信息", description = "Customer") +@RequestMapping("/api/extend/saleOrder/Customer") +public class CustomerController extends SuperController { + + @Autowired + private CustomerService customerService; + + /** + * 列表 + * + * @param pagination 分页模型 + * @return + */ + @GetMapping + @Operation(summary = "列表") + public ActionResult> list(Pagination pagination) { + pagination.setPageSize(50); + pagination.setCurrentPage(1); + List list = customerService.getList(pagination); + List listVO = JsonUtil.getJsonToList(list, CustomerListVO.class); + PageListVO vo = new PageListVO(); + vo.setList(listVO); + return ActionResult.success(vo); + } + + /** + * 创建 + * + * @param customerCrForm 新建模型 + * @return + */ + @PostMapping + @Operation(summary = "创建") + @Parameters({ + @Parameter(name = "customerCrForm", description = "客户模型",required = true), + }) + public ActionResult create(@RequestBody @Valid CustomerCrForm customerCrForm) { + CustomerEntity entity = JsonUtil.getJsonToBean(customerCrForm, CustomerEntity.class); + customerService.create(entity); + return ActionResult.success("新建成功"); + } + + /** + * 信息 + * + * @param id 主键 + * @return + */ + @GetMapping("/{id}") + @Operation(summary = "信息") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult info(@PathVariable("id") String id) { + CustomerEntity entity = customerService.getInfo(id); + CustomerInfoVO vo = JsonUtil.getJsonToBean(entity, CustomerInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 更新 + * + * @param id 主键 + * @param customerUpForm 修改模型 + * @return + */ + @PutMapping("/{id}") + @Operation(summary = "更新") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "customerUpForm", description = "客户模型", required = true), + }) + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid CustomerUpForm customerUpForm) { + CustomerEntity entity = JsonUtil.getJsonToBean(customerUpForm, CustomerEntity.class); + boolean ok = customerService.update(id, entity); + if (ok) { + return ActionResult.success("更新成功"); + } + return ActionResult.fail("更新失败,数据不存在"); + } + + /** + * 删除 + * + * @param id 主键 + * @return + */ + @DeleteMapping("/{id}") + @Operation(summary = "删除") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult delete(@PathVariable("id") String id) { + CustomerEntity entity = customerService.getInfo(id); + if (entity != null) { + customerService.delete(entity); + } + return ActionResult.success(MsgCode.SU003.get()); + } + + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/DocumentController.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/DocumentController.java new file mode 100644 index 0000000..802f294 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/DocumentController.java @@ -0,0 +1,648 @@ +package jnpf.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.xuyanwu.spring.file.storage.FileInfo; +import com.alibaba.druid.util.StringUtils; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.util.OptimizeUtil; +import jnpf.util.NoDataSourceBind; +import jnpf.config.ConfigValueUtil; +import jnpf.constant.MsgCode; +import jnpf.model.MergeChunkDto; +import jnpf.permission.entity.UserEntity; +import jnpf.util.JsonUtilEx; +import jnpf.base.ActionResult; +import jnpf.base.Page; +import jnpf.base.UserInfo; +import jnpf.base.controller.SuperController; +import jnpf.base.vo.DownloadVO; +import jnpf.base.vo.ListVO; +import jnpf.constant.FileTypeConstant; +import jnpf.constant.MsgCode; +import jnpf.entity.DocumentEntity; +import jnpf.entity.DocumentShareEntity; +import jnpf.exception.DataException; +import jnpf.model.document.*; +import jnpf.base.vo.DownloadVO; +import jnpf.permission.service.UserService; +import jnpf.service.DocumentService; +import jnpf.base.util.*; +import jnpf.util.*; +import jnpf.util.JsonUtil; +import jnpf.util.treeutil.SumTree; +import jnpf.util.treeutil.newtreeutil.TreeDotUtils; +import lombok.Cleanup; +import org.apache.commons.io.FileUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 文档管理 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月26日 上午9:18 + */ +@Tag(name = "知识管理", description = "Document") +@RestController +@RequestMapping("/api/extend/Document") +public class DocumentController extends SuperController { + + @Autowired + private DocumentService documentService; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private UserService userService; + @Autowired + private UserProvider userProvider; + + + /** + * 列表 + * + * @param id 主键 + * @return + */ + @Operation(summary = "列表") + @GetMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("extend.document") + public ActionResult info(@PathVariable("id") String id) throws DataException { + DocumentEntity entity = documentService.getInfo(id); + DocumentInfoVO vo = JsonUtil.getJsonToBean(entity, DocumentInfoVO.class); + //截取后缀 + String[] fullName = vo.getFullName().split("\\."); + if (fullName.length > 1) { + String fullNames = ""; + for (int i = 0; i < fullName.length - 1; i++) { + if (i > 0) { + fullNames += "." + fullName[i]; + } else { + fullNames += fullName[i]; + } + } + vo.setFullName(fullNames); + } + return ActionResult.success(vo); + } + + /** + * 新建 + * + * @param documentCrForm 新建模型 + * @return + */ + @Operation(summary = "新建") + @PostMapping + @Parameters({ + @Parameter(name = "documentCrForm", description = "知识模型", required = true), + }) + @SaCheckPermission("extend.document") + public ActionResult create(@RequestBody @Valid DocumentCrForm documentCrForm) { + DocumentEntity entity = JsonUtil.getJsonToBean(documentCrForm, DocumentEntity.class); + if (documentService.isExistByFullName(documentCrForm.getFullName(), entity.getId(), documentCrForm.getParentId())) { + return ActionResult.fail("文件夹名称不能重复"); + } + entity.setEnabledMark(1); + documentService.create(entity); + return ActionResult.success("新建成功"); + } + + /** + * 修改 + * + * @param id 主键 + * @param documentUpForm 修改模型 + * @return + */ + @Operation(summary = "修改") + @PutMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "documentUpForm", description = "知识模型", required = true), + }) + @SaCheckPermission("extend.document") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid DocumentUpForm documentUpForm) { + DocumentEntity entity = JsonUtil.getJsonToBean(documentUpForm, DocumentEntity.class); + if (documentService.isExistByFullName(documentUpForm.getFullName(), id, documentUpForm.getParentId())) { + return ActionResult.fail("文件夹名称不能重复"); + } + DocumentEntity info = documentService.getInfo(id); + //获取后缀名 + String[] fullName = info.getFullName().split("\\."); + if (fullName.length > 1) { + entity.setFullName(entity.getFullName() + "." + fullName[fullName.length - 1]); + } + boolean flag = documentService.update(id, entity); + if (flag == false) { + return ActionResult.fail("更新失败,数据不存在"); + } + return ActionResult.success("更新成功"); + } + + /** + * 删除 + * + * @param id 主键 + * @return + */ + @Operation(summary = "删除") + @DeleteMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("extend.document") + public ActionResult delete(@PathVariable("id") String id) { + DocumentEntity entity = documentService.getInfo(id); + if (entity != null) { + List allList = documentService.getAllList(entity.getId()); + if (allList.size() > 0) { + return ActionResult.fail("删除失败,该文件夹存在数据"); + } + documentService.delete(entity); + return ActionResult.success("删除成功"); + } + return ActionResult.fail("删除失败,数据不存在"); + } + + /** + * 列表 + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取知识管理列表(文件夹树)") + @GetMapping("/FolderTree/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("extend.document") + public ActionResult> folderTree(@PathVariable("id") String id) { + List data = documentService.getFolderList(); + if (!"0".equals(id)) { + data.remove(documentService.getInfo(id)); + } + List treeList = new ArrayList<>(); + DocumentFolderTreeModel model = new DocumentFolderTreeModel(); + model.setId("-1"); + model.setFullName("全部文档"); + model.setParentId("0"); + model.setIcon("0"); + treeList.add(model); + for (DocumentEntity entity : data) { + DocumentFolderTreeModel treeModel = new DocumentFolderTreeModel(); + treeModel.setId(entity.getId()); + treeModel.setFullName(entity.getFullName()); + treeModel.setParentId(entity.getParentId()); + treeModel.setIcon("fa fa-folder"); + treeList.add(treeModel); + } + List> trees = TreeDotUtils.convertListToTreeDotFilter(treeList); + List listVO = JsonUtil.getJsonToList(trees, DocumentFolderTreeVO.class); + ListVO vo = new ListVO(); + vo.setList(listVO); + return ActionResult.success(vo); + } + + /** + * 列表(全部文档) + * + * @param page 分页模型 + * @return + */ + @Operation(summary = "获取知识管理列表(全部文档)") + @GetMapping + @SaCheckPermission("extend.document") + public ActionResult> allList(PageDocument page) { + List data = documentService.getAllList(page.getParentId()); + if (!StringUtils.isEmpty(page.getKeyword())) { + data = data.stream().filter(t -> t.getFullName().contains(page.getKeyword())).collect(Collectors.toList()); + } + List list = JsonUtil.getJsonToList(data, DocumentListVO.class); + //读取允许文件预览类型 + String allowPreviewType = configValueUtil.getAllowPreviewFileType(); + String[] fileType = allowPreviewType.split(","); + for (DocumentListVO documentListVO : list) { + //文件预览类型检验 + String s = Arrays.asList(fileType).stream().filter(type -> type.equals(documentListVO.getFileExtension())).findFirst().orElse(null); + documentListVO.setIsPreview(s); + } + + ListVO vo = new ListVO(); + vo.setList(list); + return ActionResult.success(vo); + } + + /** + * 列表(我的分享) + * + * @param page 分页模型 + * @return + */ + @Operation(summary = "知识管理(我的共享列表)") + @GetMapping("/Share") + @SaCheckPermission("extend.document") + public ActionResult shareOutList(Page page) { + List data = documentService.getShareOutList(); + if (!StringUtils.isEmpty(page.getKeyword())) { + data = data.stream().filter(t -> t.getFullName().contains(page.getKeyword())).collect(Collectors.toList()); + } + ListVO vo = new ListVO(); + vo.setList(data); + return ActionResult.success(vo); + } + + /** + * 列表(共享给我) + * + * @param page 分页模型 + * @return + */ + @Operation(summary = "获取知识管理列表(共享给我)") + @GetMapping("/ShareTome") + @SaCheckPermission("extend.document") + public ActionResult> shareTomeList(Page page) { + List list = documentService.getShareTomeList(); + if (!StringUtil.isEmpty(page.getKeyword())) { + list = list.stream().filter(t -> t.getFullName().contains(page.getKeyword())).collect(Collectors.toList()); + } + List userId = list.stream().map(t -> t.getCreatorUserId()).collect(Collectors.toList()); + List userName = userService.getUserName(userId); + for (DocumentEntity entity : list) { + UserEntity userEntity = userName.stream().filter(t -> t.getId().equals(entity.getCreatorUserId())).findFirst().orElse(null); + entity.setCreatorUserId(userEntity != null ? userEntity.getRealName() + "/" + userEntity.getAccount() : ""); + } + List vos = JsonUtil.getJsonToList(list, DocumentStomeListVO.class); + ListVO vo = new ListVO(); + vo.setList(vos); + return ActionResult.success(vo); + } + + /** + * 列表(回收站) + * + * @param page 分页模型 + * @return + */ + @Operation(summary = "获取知识管理列表(回收站)") + @GetMapping("/Trash") + @SaCheckPermission("extend.document") + public ActionResult> trashList(Page page) { + List data = documentService.getTrashList(); + if (!StringUtils.isEmpty(page.getKeyword())) { + data = data.stream().filter(t -> t.getFullName().contains(page.getKeyword())).collect(Collectors.toList()); + } + ListVO vo = new ListVO(); + vo.setList(data); + return ActionResult.success(vo); + } + + /** + * 列表(共享人员) + * + * @param documentId 文档主键 + * @return + */ + @Operation(summary = "获取知识管理列表(共享人员)") + @GetMapping("/ShareUser/{documentId}") + @Parameters({ + @Parameter(name = "documentId", description = "文档主键", required = true), + }) + @SaCheckPermission("extend.document") + public ActionResult> shareUserList(@PathVariable("documentId") String documentId) { + List data = documentService.getShareUserList(documentId); + List list = JsonUtil.getJsonToList(data, DocumentSuserListVO.class); + ListVO vo = new ListVO(); + vo.setList(list); + return ActionResult.success(vo); + } + + /** + * 上传文件 + * + * @param documentUploader 上传模型 + * @return + */ + @Operation(summary = "知识管理上传文件") + @PostMapping("/Uploader") + @SaCheckPermission("extend.document") + public ActionResult uploader(DocumentUploader documentUploader) throws DataException { + String fileName = documentUploader.getFile().getOriginalFilename(); + List data = documentService.getAllList(documentUploader.getParentId()); + String finalFileName = fileName; + data = data.stream().filter(t -> finalFileName.equals(t.getFullName())).collect(Collectors.toList()); + if (data.size() > 0) { + fileName = DateUtil.getNow("+8") + "-" + fileName; + } + String fileType = UpUtil.getFileType(documentUploader.getFile()); + String name = RandomUtil.uuId(); + String filePath = configValueUtil.getDocumentFilePath(); + //验证类型 + if (!OptimizeUtil.fileType(configValueUtil.getAllowUploadFileType(), fileType)) { + return ActionResult.fail(MsgCode.FA017.get()); + } + //上传 + FileInfo fileInfo = FileUploadUtils.uploadFile(documentUploader.getFile(), filePath, name + "." + fileType); + DocumentEntity entity = new DocumentEntity(); + entity.setType(1); + entity.setFullName(fileInfo.getFilename()); + entity.setParentId(documentUploader.getParentId()); + entity.setFileExtension(fileType); + entity.setFilePath(name + "." + fileType); + entity.setFileSize(String.valueOf(documentUploader.getFile().getSize())); + documentService.create(entity); + return ActionResult.success("上传成功"); + } + + /** + * 分片组装 + * + * @param mergeChunkDto 合并模型 + * @return + */ + @Operation(summary = "分片组装") + @PostMapping("/merge") + @SaCheckPermission("extend.document") + public ActionResult merge(MergeChunkDto mergeChunkDto) { + String identifier = mergeChunkDto.getIdentifier(); + String path = FileUploadUtils.getLocalBasePath() + configValueUtil.getTemporaryFilePath(); + String filePath = XSSEscape.escapePath(path + identifier); + String partFile = XSSEscape.escapePath(path + mergeChunkDto.getFileName()); + try { + List mergeFileList = FileUtil.getFile(new File(filePath)); + @Cleanup FileOutputStream destTempfos = new FileOutputStream(partFile, true); + for (int i = 0; i < mergeFileList.size(); i++) { + String chunkName = identifier.concat("-") + (i + 1); + File files = new File(filePath, chunkName); + if (files.exists()) { + FileUtils.copyFile(files, destTempfos); + } + } + File partFiles = new File(partFile); + if (partFiles.exists()) { + MultipartFile multipartFile = FileUtil.createFileItem(partFiles); + uploaderVO(multipartFile, mergeChunkDto.getParentId()); + FileUtil.deleteTmp(multipartFile); + } + } catch (Exception e) { + System.out.println("合并分片失败:" + e); + } finally { + FileUtils.deleteQuietly(new File(filePath)); + FileUtils.deleteQuietly(new File(partFile)); + } + return ActionResult.success(MsgCode.SU015.get()); + } + + /** + * 合并文件 + * + * @param guid + * @return + */ + /*@Operation(summary = "(未找到)知识管理合并文件") + @PostMapping("/Merge/{guid}") + public ActionResult Merge(@PathVariable("guid") String guid, String fileName, String folderId) { + //临时文件 + String temp = configValueUtil.getTemporaryFilePath() + guid; + File file = new File(temp); + //保存文件 + UserInfo userInfo = userProvider.get(); + String userId = userInfo.getUserId(); + String tenantId = userInfo.getTenantId(); + String time = DateTimeFormatter.ofPattern("yyyyMMdd").format(LocalDateTime.now()); + String path = configValueUtil.getDocumentFilePath() + "\\" + tenantId + "\\" + userId + "\\" + time; + String fileType = ""; + String name = RandomUtil.uuId(); + File partFile = null; + try { + if (file.isDirectory()) { + File[] files = file.listFiles(); + if (files != null && files.length > 0) { + fileType = fileName.substring(fileName.lastIndexOf(".") + 1, fileName.length()); + partFile = new File(path); + if (!partFile.exists()) { + partFile.mkdirs(); + } + partFile = new File(path + "\\" + name + "." + fileType); + for (int i = 0; i < files.length; i++) { + File s = new File(temp, i + ".part"); + FileOutputStream destTempfos = new FileOutputStream(partFile, true); + FileUtils.copyFile(s, destTempfos); + destTempfos.close(); + } + FileUtils.deleteDirectory(file); + } + } + DocumentEntity entity = new DocumentEntity(); + entity.setFType(1); + entity.setFParentId(folderId); + entity.setFFullName(fileName); + entity.setFFileExtension(fileType); + entity.setFFilePath(tenantId + "\\" + userId + "\\" + time + "\\" + name + "." + fileType); + entity.setFFileSize(String.valueOf(partFile.length())); + entity.setFDeleteMark(0); + documentService.create(entity); + return ActionResult.success("合并成功"); + } catch (Exception e) { + try { + FileUtils.deleteDirectory(file); + } catch (Exception e1) { + System.out.println(e1.getMessage()); + } + System.out.println(e.getMessage()); + return ActionResult.fail("上传失败"); + } + }*/ + + /** + * 获取下载文件链接 + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取下载文件链接") + @PostMapping("/Download/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("extend.document") + public ActionResult download(@PathVariable("id") String id) { + UserInfo userInfo = userProvider.get(); + DocumentEntity entity = documentService.getInfo(id); + if (entity != null) { + String name = entity.getFilePath(); + String fileName = name + "#" + "document#" + entity.getFullName() + "." + entity.getFileExtension(); + DownloadVO vo = DownloadVO.builder().name(entity.getFullName()).url(UploaderUtil.uploaderFile(fileName)).build(); + return ActionResult.success(vo); + } + return ActionResult.fail(MsgCode.FA018.get()); + } + + /** + * 回收站(彻底删除) + * + * @param id 主键 + * @return + */ + @Operation(summary = "回收站(彻底删除)") + @DeleteMapping("/Trash/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("extend.document") + public ActionResult trashdelete(@PathVariable("id") String id) { + documentService.trashdelete(id); + return ActionResult.success("删除成功"); + } + + /** + * 回收站(还原文件) + * + * @param id 主键 + * @return + */ + @Operation(summary = "回收站(还原文件)") + @PostMapping("/Trash/{id}/Actions/Recovery") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("extend.document") + public ActionResult trashRecovery(@PathVariable("id") String id) { + DocumentEntity entity = documentService.getInfo(id); + if (entity == null) { + return ActionResult.fail("操作失败,原文件不存在"); + } + if (!"0".equals(entity.getParentId())) { + DocumentEntity info = documentService.getInfo(entity.getParentId()); + if (info == null) { + return ActionResult.fail("操作失败,原文件不存在"); + } + if (info.getEnabledMark() != null && info.getEnabledMark() == 0) { + return ActionResult.fail("找不到父级"); + } + } + boolean flag = documentService.trashRecovery(id); + if (!flag) { + return ActionResult.fail(MsgCode.FA010.get()); + } + return ActionResult.success(MsgCode.SU010.get()); + } + + /** + * 共享文件(创建) + * + * @param id 主键 + * @param documentShareForm 分享模型 + * @return + */ + @Operation(summary = "分享文件/文件夹") + @PostMapping("/{id}/Actions/Share") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "documentShareForm", description = "分享模型", required = true), + }) + @SaCheckPermission("extend.document") + public ActionResult shareCreate(@PathVariable("id") String id, @RequestBody DocumentShareForm documentShareForm) { + String[] shareUserId = documentShareForm.getUserId().split(","); + boolean flag = documentService.sharecreate(id, shareUserId); + if (flag == false) { + return ActionResult.fail("操作失败,原文件不存在"); + } + return ActionResult.success("操作成功"); + } + + /** + * 共享文件(取消) + * + * @param id 主键值 + * @return + */ + @Operation(summary = "取消分享文件/文件夹") + @DeleteMapping("/{id}/Actions/Share") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("extend.document") + public ActionResult shareCancel(@PathVariable("id") String id) { + boolean flag = documentService.shareCancel(id); + if (flag == false) { + return ActionResult.fail("操作失败,原文件不存在"); + } + return ActionResult.success("操作成功"); + } + + /** + * 文件/夹移动到 + * + * @param id 主键值 + * @param toId 将要移动到Id + * @return + */ + @Operation(summary = "移动文件/文件夹") + @PutMapping("/{id}/Actions/MoveTo/{toId}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "toId", description = "将要移动到Id", required = true), + }) + @SaCheckPermission("extend.document") + public ActionResult moveTo(@PathVariable("id") String id, @PathVariable("toId") String toId) { + if (id.equals(toId)) { + return ActionResult.fail("不能移动到自己的文件夹"); + } + boolean flag = documentService.moveTo(id, toId); + if (flag == false) { + return ActionResult.fail("更新失败,数据不存在"); + } + return ActionResult.success("更新成功"); + } + + /** + * 封装上传附件 + * + * @param file + * @param parentId + * @return + */ + private void uploaderVO(MultipartFile file, String parentId) { + String fileType = UpUtil.getFileType(file); + String filePath = configValueUtil.getDocumentFilePath(); + String name = RandomUtil.uuId(); + String fileName = file.getOriginalFilename(); + List data = documentService.getAllList(parentId); + String finalFileName = fileName; + data = data.stream().filter(t -> finalFileName.equals(t.getFullName())).collect(Collectors.toList()); + if (data.size() > 0) { + fileName = DateUtil.getNow("+8") + "-" + fileName; + } + //上传 + FileInfo fileInfo = FileUploadUtils.uploadFile(file, filePath, fileName + "." + fileType); + DocumentEntity entity = new DocumentEntity(); + entity.setType(1); + entity.setFullName(fileName); + entity.setParentId(parentId); + entity.setFileExtension(fileType); + entity.setFilePath(fileInfo.getFilename()); + entity.setFileSize(String.valueOf(file.getSize())); + entity.setEnabledMark(1); + entity.setUploaderUrl(UploaderUtil.uploaderImg("/api/file/Image/document/", fileInfo.getFilename())); + documentService.create(entity); + } + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/DocumentPreviewController.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/DocumentPreviewController.java new file mode 100644 index 0000000..1b48d2e --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/DocumentPreviewController.java @@ -0,0 +1,127 @@ +package jnpf.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; + +import jnpf.base.ActionResult; +import jnpf.util.NoDataSourceBind; +import jnpf.base.Page; +import jnpf.config.ConfigValueUtil; + +import jnpf.enums.FilePreviewTypeEnum; +import jnpf.exception.DataException; + +import jnpf.model.YozoFileParams; +import jnpf.model.YozoParams; +import jnpf.model.FileListVO; +import jnpf.util.*; +import jnpf.utils.SplicingUrlUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.io.UnsupportedEncodingException; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 文档在线预览 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +@NoDataSourceBind() +@Tag(name = "文档在线预览", description = "DocumentPreview") +@RestController +@RequestMapping("/api/extend/DocumentPreview") +public class DocumentPreviewController { + + @Autowired + private ConfigValueUtil configValueUtil; + + /** + * 永中文件预览 + * + * @param fileId 文件主键 + * @param params 永中模型 + * @param previewType 类型 + * @return + */ + @Operation(summary = "文件预览") + @GetMapping("/{fileId}/Preview") + @Parameters({ + @Parameter(name = "fileId", description = "文件主键",required = true), + @Parameter(name = "previewType", description = "类型"), + }) + @SaCheckPermission("extend.documentPreview") + public ActionResult filePreview(@PathVariable("fileId") String fileId, YozoFileParams params, @RequestParam("previewType") String previewType) { + FileListVO fileListVO = FileUploadUtils.getFileDetail(configValueUtil.getDocumentPreviewPath(), fileId); + if (fileListVO == null) { + return ActionResult.fail("文件找不到!"); + } + if (fileListVO.getFileName() != null) { + String[] split = fileListVO.getFileName().split("/"); + if (split.length > 0) { + fileListVO.setFileName(split[split.length - 1]); + } + } + String url = YozoParams.JNPF_DOMAINS + "/api/extend/DocumentPreview/down/" + fileListVO.getFileName(); + String urlPath; + if (previewType.equals(FilePreviewTypeEnum.YOZO_ONLINE_PREVIEW.getType())){ + params.setUrl(url); + urlPath = SplicingUrlUtil.getPreviewUrl(params); + return ActionResult.success("success", XSSEscape.escape(urlPath)); + } + return ActionResult.success("success",url); + } + + /** + * 列表 + * + * @param page 分页模型 + * @return + */ + @Operation(summary = "获取文档列表") + @GetMapping + @SaCheckPermission("extend.documentPreview") + public ActionResult> list(Page page) { + List fileList = FileUploadUtils.getFileList(configValueUtil.getDocumentPreviewPath()); + fileList.stream().forEach(t -> { + if (t.getFileName() != null) { + String[] split = t.getFileName().split("/"); + if (split.length > 0) { + t.setFileName(split[split.length - 1]); + } + } + }); + if (StringUtil.isNotEmpty(page.getKeyword())) { + fileList = fileList.stream().filter(t -> t.getFileName().contains(page.getKeyword())).collect(Collectors.toList()); + } + return ActionResult.success(fileList); + } + + /** + * 文件下载url + * + * @param fileName 名称 + */ + @NoDataSourceBind() + @GetMapping("/down/{fileName}") + @Parameters({ + @Parameter(name = "fileName", description = "名称",required = true), + }) + @SaCheckPermission("extend.documentPreview") + public void pointDown(@PathVariable("fileName") String fileName) throws DataException { + boolean exists = FileUploadUtils.exists(configValueUtil.getDocumentPreviewPath(), fileName); + if (!exists) { + throw new DataException("下载失败"); + } + byte[] bytes = FileUploadUtils.downloadFileByte(configValueUtil.getDocumentPreviewPath(), fileName, false); + FileDownloadUtil.downloadFile(bytes, fileName, null); + } + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/EmailController.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/EmailController.java new file mode 100644 index 0000000..1db9f00 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/EmailController.java @@ -0,0 +1,351 @@ +package jnpf.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.model.MailAccount; +import jnpf.base.util.Pop3Util; +import jnpf.base.vo.PaginationVO; +import jnpf.base.service.SysconfigService; +import jnpf.base.entity.EmailConfigEntity; +import jnpf.entity.EmailReceiveEntity; +import jnpf.entity.EmailSendEntity; +import jnpf.exception.DataException; +import jnpf.model.email.*; +import jnpf.service.EmailReceiveService; +import jnpf.util.JsonUtil; +import jnpf.util.JsonUtilEx; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; + +/** + * 邮件配置 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月26日 上午9:18 + */ +@Tag(name = "邮件收发", description = "Email") +@RestController +@RequestMapping("/api/extend/Email") +public class EmailController { + + @Autowired + private EmailReceiveService emailReceiveService; + @Autowired + private Pop3Util pop3Util; + @Autowired + private SysconfigService sysconfigService; + + /** + * 获取邮件列表(收件箱、标星件、草稿箱、已发送) + * + * @param paginationEmail 分页模型 + * @return + */ + @Operation(summary = "获取邮件列表(收件箱、标星件、草稿箱、已发送)") + @GetMapping + @SaCheckPermission("extend.email") + public ActionResult receiveList(PaginationEmail paginationEmail) { + String type = paginationEmail.getType() != null ? paginationEmail.getType() : "inBox"; + switch (type) { + case "inBox": + List entity = emailReceiveService.getReceiveList(paginationEmail); + PaginationVO paginationVO = JsonUtil.getJsonToBean(paginationEmail, PaginationVO.class); + List listVO = JsonUtil.getJsonToList(entity, EmailReceiveListVO.class); + return ActionResult.page(listVO,paginationVO); + case "star": + List entity1 = emailReceiveService.getStarredList(paginationEmail); + PaginationVO paginationVo1 = JsonUtil.getJsonToBean(paginationEmail, PaginationVO.class); + List listVo1 = JsonUtil.getJsonToList(entity1, EmailStarredListVO.class); + return ActionResult.page(listVo1,paginationVo1); + case "draft": + List entity2 = emailReceiveService.getDraftList(paginationEmail); + PaginationVO paginationVo2 = JsonUtil.getJsonToBean(paginationEmail, PaginationVO.class); + List listVo2 = JsonUtil.getJsonToList(entity2, EmailDraftListVO.class); + return ActionResult.page(listVo2,paginationVo2); + case "sent": + List entity3 = emailReceiveService.getSentList(paginationEmail); + PaginationVO paginationVo3 = JsonUtil.getJsonToBean(paginationEmail, PaginationVO.class); + List listVo3 = JsonUtil.getJsonToList(entity3, EmailSentListVO.class); + return ActionResult.page(listVo3,paginationVo3); + default: + return ActionResult.fail("获取失败"); + } + } + + /** + * 获取邮箱配置 + * + * @return + */ + @Operation(summary = "获取邮箱配置") + @GetMapping("/Config") + @SaCheckPermission("extend.email") + public ActionResult configInfo() { + EmailConfigEntity entity = emailReceiveService.getConfigInfo(); + EmailCofigInfoVO vo = JsonUtil.getJsonToBean(entity, EmailCofigInfoVO.class); + if(vo==null){ + vo=new EmailCofigInfoVO(); + } + return ActionResult.success(vo); + } + + /** + * 获取邮件信息 + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取邮件信息") + @GetMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键",required = true), + }) + @SaCheckPermission("extend.email") + public ActionResult info(@PathVariable("id") String id) throws DataException { + Object entity = emailReceiveService.getInfo(id); + EmailInfoVO vo = JsonUtil.getJsonToBeanEx(entity, EmailInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 删除 + * + * @param id 主键 + * @return + */ + @Operation(summary = "删除邮件") + @DeleteMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键",required = true), + }) + @SaCheckPermission("extend.email") + public ActionResult delete(@PathVariable("id") String id) { + boolean flag= emailReceiveService.delete(id); + if(flag==false){ + return ActionResult.fail("删除失败,邮件不存在"); + } + return ActionResult.success("删除成功"); + } + + /** + * 设置已读邮件 + * + * @param id 主键 + * @return + */ + @Operation(summary = "设置已读邮件") + @PutMapping("/{id}/Actions/Read") + @Parameters({ + @Parameter(name = "id", description = "主键",required = true), + }) + @SaCheckPermission("extend.email") + public ActionResult receiveRead(@PathVariable("id") String id) { + boolean flag= emailReceiveService.receiveRead(id, 1); + if(flag==false){ + return ActionResult.fail("操作失败,邮件不存在"); + } + return ActionResult.success("操作成功"); + } + + /** + * 设置未读邮件 + * + * @param id 主键 + * @return + */ + @Operation(summary = "设置未读邮件") + @PutMapping("/{id}/Actions/Unread") + @Parameters({ + @Parameter(name = "id", description = "主键",required = true), + }) + @SaCheckPermission("extend.email") + public ActionResult receiveUnread(@PathVariable("id") String id) { + boolean flag= emailReceiveService.receiveRead(id, 0); + if(flag==false){ + return ActionResult.fail("操作失败,邮件不存在"); + } + return ActionResult.success("操作成功"); + } + + /** + * 设置星标邮件 + * + * @param id 主键 + * @return + */ + @Operation(summary = "设置星标邮件") + @PutMapping("/{id}/Actions/Star") + @Parameters({ + @Parameter(name = "id", description = "主键",required = true), + }) + @SaCheckPermission("extend.email") + public ActionResult receiveYesStarred(@PathVariable("id") String id) { + boolean flag= emailReceiveService.receiveStarred(id, 1); + if(flag==false){ + return ActionResult.fail("操作失败,邮件不存在"); + } + return ActionResult.success("操作成功"); + } + + /** + * 设置取消星标 + * + * @param id 主键 + * @return + */ + @Operation(summary = "设置取消星标") + @PutMapping("/{id}/Actions/Unstar") + @Parameters({ + @Parameter(name = "id", description = "主键",required = true), + }) + @SaCheckPermission("extend.email") + public ActionResult receiveNoStarred(@PathVariable("id") String id) { + boolean flag= emailReceiveService.receiveStarred(id, 0); + if(flag==false){ + return ActionResult.fail("操作失败,邮件不存在"); + } + return ActionResult.success("操作成功"); + } + + /** + * 收邮件 + * + * @return + */ + @Operation(summary = "收邮件") + @PostMapping("/Receive") + @SaCheckPermission("extend.email") + public ActionResult receive() { + EmailConfigEntity configEntity = emailReceiveService.getConfigInfo(); + if (configEntity != null) { + MailAccount mailAccount = new MailAccount(); + mailAccount.setAccount(configEntity.getAccount()); + mailAccount.setPassword(configEntity.getPassword()); + mailAccount.setPop3Host(configEntity.getPop3Host()); + mailAccount.setPop3Port(configEntity.getPop3Port()); + mailAccount.setSmtpHost(configEntity.getSmtpHost()); + mailAccount.setSmtpPort(configEntity.getSmtpPort()); + if ("1".equals(String.valueOf(configEntity.getEmailSsl()))) { + mailAccount.setSsl(true); + } else { + mailAccount.setSsl(false); + } + String checkResult=pop3Util.checkConnected(mailAccount); + if ("true".equals(checkResult)) { + int mailCount = emailReceiveService.receive(configEntity); + return ActionResult.success("操作成功", mailCount); + } else { + return ActionResult.fail("账户认证错误"); + } + } else { + return ActionResult.fail("你还没有设置邮件的帐户"); + } + } + + /** + * 存草稿 + * + * @param emailSendCrForm 邮件模型 + * @return + */ + @Operation(summary = "存草稿") + @PostMapping("/Actions/SaveDraft") + @Parameters({ + @Parameter(name = "emailSendCrForm", description = "邮件模型",required = true), + }) + @SaCheckPermission("extend.email") + public ActionResult saveDraft(@RequestBody @Valid EmailSendCrForm emailSendCrForm) { + EmailSendEntity entity = JsonUtil.getJsonToBean(emailSendCrForm, EmailSendEntity.class); + emailReceiveService.saveDraft(entity); + return ActionResult.success("保存成功"); + } + + /** + * 发邮件 + * + * @param emailCrForm 发送邮件模型 + * @return + */ + @Operation(summary = "发邮件") + @PostMapping + @Parameters({ + @Parameter(name = "emailCrForm", description = "发送邮件模型",required = true), + }) + @SaCheckPermission("extend.email") + public ActionResult saveSent(@RequestBody @Valid EmailCrForm emailCrForm) { + EmailSendEntity entity = JsonUtil.getJsonToBean(emailCrForm, EmailSendEntity.class); + EmailConfigEntity configEntity = emailReceiveService.getConfigInfo(); + if (configEntity != null) { + MailAccount mailAccount = new MailAccount(); + mailAccount.setAccount(configEntity.getAccount()); + mailAccount.setPassword(configEntity.getPassword()); + mailAccount.setPop3Host(configEntity.getPop3Host()); + mailAccount.setPop3Port(configEntity.getPop3Port()); + mailAccount.setSmtpHost(configEntity.getSmtpHost()); + mailAccount.setSmtpPort(configEntity.getSmtpPort()); + if ("1".equals(String.valueOf(configEntity.getEmailSsl()))) { + mailAccount.setSsl(true); + } else { + mailAccount.setSsl(false); + } + int flag = emailReceiveService.saveSent(entity, configEntity); + if (flag == 0) { + return ActionResult.success("发送成功"); + } else { + return ActionResult.fail("账户认证错误"); + } + } else { + return ActionResult.fail("你还没有设置邮件的帐户"); + } + } + + /** + * 更新邮件配置 + * + * @param emailCheckForm 邮件配置模型 + * @return + */ + @Operation(summary = "更新邮件配置") + @PutMapping("/Config") + @Parameters({ + @Parameter(name = "emailCheckForm", description = "邮件配置模型",required = true), + }) + @SaCheckPermission("extend.email") + public ActionResult saveConfig(@RequestBody @Valid EmailCheckForm emailCheckForm) throws DataException { + EmailConfigEntity entity = JsonUtil.getJsonToBean(emailCheckForm, EmailConfigEntity.class); + emailReceiveService.saveConfig(entity); + return ActionResult.success("保存成功"); + } + + /** + * 邮箱配置-测试连接 + * + * @param emailCheckForm 邮件配置模型 + * @return + */ + @Operation(summary = "邮箱配置-测试连接") + @PostMapping("/Config/Actions/CheckMail") + @Parameters({ + @Parameter(name = "emailCheckForm", description = "邮件配置模型",required = true), + }) + @SaCheckPermission("extend.email") + public ActionResult checkLogin(@RequestBody @Valid EmailCheckForm emailCheckForm) { + EmailConfigEntity entity = JsonUtil.getJsonToBean(emailCheckForm, EmailConfigEntity.class); + String result = sysconfigService.checkLogin(entity); + if ("true".equals(result)) { + return ActionResult.success("验证成功"); + } else { + return ActionResult.fail("账户认证错误"); + } + } + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/EmployeeController.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/EmployeeController.java new file mode 100644 index 0000000..f18c0ad --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/EmployeeController.java @@ -0,0 +1,493 @@ +package jnpf.controller; + +import cn.afterturn.easypoi.excel.ExcelExportUtil; +import cn.afterturn.easypoi.excel.entity.ExportParams; +import cn.afterturn.easypoi.excel.entity.TemplateExportParams; +import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; +import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; +import cn.xuyanwu.spring.file.storage.FileInfo; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.controller.SuperController; +import jnpf.base.vo.DownloadVO; +import jnpf.base.vo.PageListVO; +import jnpf.base.vo.PaginationVO; +import jnpf.config.ConfigValueUtil; +import jnpf.constant.MsgCode; +import jnpf.entity.EmployeeEntity; +import jnpf.exception.DataException; +import jnpf.exception.ImportException; +import jnpf.model.EmployeeModel; +import jnpf.model.employee.*; +import jnpf.service.EmployeeService; +import jnpf.util.*; +import lombok.Cleanup; +import lombok.extern.slf4j.Slf4j; +import jnpf.util.JsonUtil; +import jnpf.util.JsonUtilEx; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.ss.usermodel.Workbook; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import java.io.ByteArrayInputStream; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 职员信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + */ +@Slf4j +@Tag(name = "职员信息", description = "Employee") +@RestController +@RequestMapping("/api/extend/Employee") +public class EmployeeController extends SuperController { + + @Autowired + private EmployeeService employeeService; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private UserProvider userProvider; + + /** + * 列表(忽略验证Token) + * + * @param paginationEmployee 分页模型 + * @return + */ + @Operation(summary = "获取职员列表") + @GetMapping + public ActionResult> getList(PaginationEmployee paginationEmployee) { + List data = employeeService.getList(paginationEmployee); + List list = JsonUtil.getJsonToList(data, EmployeeListVO.class); + PaginationVO paginationVO = JsonUtil.getJsonToBean(paginationEmployee, PaginationVO.class); + return ActionResult.page(list, paginationVO); + } + + /** + * 信息 + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取职员信息") + @GetMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult info(@PathVariable("id") String id) throws DataException { + EmployeeEntity entity = employeeService.getInfo(id); + EmployeeInfoVO vo = JsonUtilEx.getJsonToBeanEx(entity, EmployeeInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 新建 + * + * @param employeeCrForm 职工模型 + * @return + */ + @Operation(summary = "app添加职员信息") + @PostMapping + @Parameters({ + @Parameter(name = "employeeCrForm", description = "职工模型", required = true), + }) + public ActionResult create(@RequestBody @Valid EmployeeCrForm employeeCrForm) { + EmployeeEntity entity = JsonUtil.getJsonToBean(employeeCrForm, EmployeeEntity.class); + employeeService.create(entity); + return ActionResult.success("新建成功"); + } + + /** + * 更新 + * + * @param id 主键 + * @param employeeUpForm 职工模型 + * @return + */ + @Operation(summary = "app修改职员信息") + @PutMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "employeeUpForm", description = "职工模型", required = true), + }) + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid EmployeeUpForm employeeUpForm) { + EmployeeEntity entity = JsonUtil.getJsonToBean(employeeUpForm, EmployeeEntity.class); + employeeService.update(id, entity); + return ActionResult.success("更新成功"); + } + + /** + * 删除 + * + * @param id 主键 + * @return + */ + @Operation(summary = "删除职员信息") + @DeleteMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult delete(@PathVariable("id") String id) { + EmployeeEntity entity = employeeService.getInfo(id); + if (entity != null) { + employeeService.delete(entity); + return ActionResult.success("删除成功"); + } + return ActionResult.fail("删除失败,数据不存在"); + } + + /** + * 模板下载 + * + * @return + */ + @Operation(summary = "模板下载") + @GetMapping("/TemplateDownload") + public ActionResult templateDownload() { + DownloadVO vo = DownloadVO.builder().build(); + try { + vo.setName("职员信息.xlsx"); + vo.setUrl(UploaderUtil.uploaderFile("/api/file/DownloadModel?encryption=", "职员信息" + + ".xlsx" + "#" + "Temporary")); + } catch (Exception e) { + log.error("信息导出Excel错误:{}", e.getMessage()); + } + return ActionResult.success(vo); + } + + /** + * 导出Excel + * + * @return + */ + @Operation(summary = "导出Excel") + @GetMapping("/ExportExcel") + public ActionResult exportExcel() { + List entityList = employeeService.getList(); + List list = JsonUtil.listToJsonField(JsonUtil.getJsonToList(JsonUtilEx.getObjectToStringDateFormat(entityList, "yyyy-MM-dd"), EmployeeExportVO.class)); + List entitys = new ArrayList<>(); + entitys.add(new ExcelExportEntity("工号", "enCode")); + entitys.add(new ExcelExportEntity("姓名", "fullName")); + entitys.add(new ExcelExportEntity("性别", "gender")); + entitys.add(new ExcelExportEntity("部门", "departmentName")); + entitys.add(new ExcelExportEntity("职务", "positionName", 25)); + entitys.add(new ExcelExportEntity("用工性质", "workingNature")); + entitys.add(new ExcelExportEntity("身份证号", "idNumber", 25)); + entitys.add(new ExcelExportEntity("联系电话", "telephone", 20)); + entitys.add(new ExcelExportEntity("出生年月", "birthday", 20)); + entitys.add(new ExcelExportEntity("参加工作", "attendWorkTime", 20)); + entitys.add(new ExcelExportEntity("最高学历", "education")); + entitys.add(new ExcelExportEntity("所学专业", "major")); + entitys.add(new ExcelExportEntity("毕业院校", "graduationAcademy")); + entitys.add(new ExcelExportEntity("毕业时间", "graduationTime", 20)); + ExportParams exportParams = new ExportParams(null, "职员信息"); + exportParams.setType(ExcelType.XSSF); + DownloadVO vo = DownloadVO.builder().build(); + try { + @Cleanup Workbook workbook = new HSSFWorkbook(); + if (entitys.size()>0){ + workbook = ExcelExportUtil.exportExcel(exportParams, entitys, list); + } + String name = "职员信息" + DateUtil.dateNow("yyyyMMdd") + "_" + RandomUtil.uuId() + ".xlsx"; + String fileName = configValueUtil.getTemporaryFilePath() + name; + @Cleanup FileOutputStream output = new FileOutputStream(XSSEscape.escapePath(fileName)); + workbook.write(output); + vo.setName(name); + vo.setUrl(UploaderUtil.uploaderFile(name + "#" + "Temporary")); + } catch (Exception e) { + log.error("信息导出Excel错误:{}", e.getMessage()); + } + return ActionResult.success(vo); + } + + /** + * 导出Word + * + * @return + */ + @Operation(summary = "导出Word") + @GetMapping("/ExportWord") + public ActionResult exportWord() { + List list = employeeService.getList(); + //模板文件地址 + String inputUrl = configValueUtil.getTemplateFilePath() + "employee_export_template.docx"; + //新生产的模板文件 + String name = "职员信息" + DateUtil.dateNow("yyyyMMdd") + "_" + RandomUtil.uuId() + ".docx"; + String outputUrl = configValueUtil.getTemporaryFilePath() + name; + List testList = new ArrayList<>(); + Map testMap = new HashMap<>(); + for (int i = 0; i < list.size(); i++) { + String[] employee = new String[13]; + EmployeeEntity entity = list.get(i); + employee[0] = entity.getFullName(); + employee[1] = entity.getGender(); + employee[2] = entity.getDepartmentName(); + employee[3] = entity.getPositionName(); + employee[4] = entity.getWorkingNature(); + employee[5] = entity.getIdNumber(); + employee[6] = entity.getTelephone(); + employee[7] = entity.getBirthday() != null ? DateUtil.daFormat(entity.getBirthday()) : ""; + employee[8] = entity.getAttendWorkTime() != null ? DateUtil.daFormat(entity.getAttendWorkTime()) : ""; + employee[9] = entity.getEducation(); + employee[10] = entity.getMajor(); + employee[11] = entity.getGraduationAcademy(); + employee[12] = entity.getGraduationTime() != null ? DateUtil.daFormat(entity.getGraduationTime()) : ""; + testList.add(employee); + } + WordUtil.changWord(inputUrl, outputUrl, testMap, testList); + if (FileUtil.fileIsFile(outputUrl)) { + DownloadVO vo = DownloadVO.builder().name(name).url(UploaderUtil.uploaderFile(name + "#" + "Temporary")).build(); + return ActionResult.success(vo); + } + return ActionResult.success("文件导出失败"); + } + + /** + * 导出pdf + * + * @return + */ + @Operation(summary = "导出pdf") + @GetMapping("/ExportPdf") + public ActionResult exportPdf() { + String name = "职员信息" + DateUtil.dateNow("yyyyMMdd") + "_" + RandomUtil.uuId() + ".pdf"; + String outputUrl = configValueUtil.getTemporaryFilePath() + name; + employeeService.exportPdf(employeeService.getList(), outputUrl); + if (FileUtil.fileIsFile(outputUrl)) { + DownloadVO vo = DownloadVO.builder().name(name).url(UploaderUtil.uploaderFile(name + "#" + "Temporary")).build(); + return ActionResult.success(vo); + } + return ActionResult.success("文件导出失败"); + } + + /** + * 导出Excel + * + * @return + */ + @Operation(summary = "导出Excel(备用)") + @GetMapping("/Excel") + public void excel() { + Map map = new HashMap<>(); + List list = employeeService.getList(); + TemplateExportParams param = new TemplateExportParams(configValueUtil.getTemplateFilePath() + "employee_import_template.xlsx", true); + map.put("Employee", JSON.parse(JSONObject.toJSONStringWithDateFormat(list, "yyyy-MM-dd"))); + Workbook workbook = ExcelExportUtil.exportExcel(param, map); + ExcelUtil.dowloadExcel(workbook, "职员信息.xlsx"); + } + + + /** + * 上传文件(excel) + * + * @return + */ + @Operation(summary = "上传文件") + @PostMapping("/Uploader") + public ActionResult uploader() { + List list = UpUtil.getFileAll(); + MultipartFile file = list.get(0); + if (file.getOriginalFilename().endsWith(".xlsx") || file.getOriginalFilename().endsWith(".xls")) { + String filePath = configValueUtil.getTemporaryFilePath(); + String fileName = RandomUtil.uuId() + "." + UpUtil.getFileType(file); + fileName = XSSEscape.escape(fileName); + //上传文件 + FileInfo fileInfo = FileUploadUtils.uploadFile(file, filePath, fileName); +// FileUtil.upFile(file, filePath, fileName); + DownloadVO vo = DownloadVO.builder().build(); + vo.setName(fileInfo.getFilename()); + return ActionResult.success(vo); + } else { + return ActionResult.fail("选择文件不符合导入"); + } + + } + + /** + * 导入预览 + * + * @param fileName 文件名称 + * @return + */ + @Operation(summary = "导入预览") + @GetMapping("/ImportPreview") + @Parameters({ + @Parameter(name = "fileName", description = "文件名称"), + }) + public ActionResult importPreview(@RequestParam("fileName") String fileName) throws ImportException { + Map map = new HashMap<>(); + try { + String filePath = configValueUtil.getTemporaryFilePath(); + @Cleanup InputStream inputStream = new ByteArrayInputStream(FileUploadUtils.downloadFileByte(filePath, fileName, false)); + // 得到数据 + List personList = ExcelUtil.importExcelByInputStream(inputStream, 0, 1, EmployeeModel.class); + //预览数据 + map = employeeService.importPreview(personList); + } catch (Exception e) { + log.error(e.getMessage()); + throw new ImportException(e.getMessage()); + } + return ActionResult.success(map); + } + + /** + * 导入数据 + * + * @param data 职工模型 + * @return + */ + @Operation(summary = "导入数据") + @PostMapping("/ImportData") + @Parameters({ + @Parameter(name = "data", description = "职工模型"), + }) + public ActionResult importData(@RequestBody EmployeeModel data) { + List dataList = JsonUtil.getJsonToList(data.getList(), EmployeeModel.class); + //导入数据 + EmployeeImportVO result = employeeService.importData(dataList); + return ActionResult.success(result); + } + + /** + * 导出Excel(可选字段) + * + * @param paginationEmployee 分页模型 + * @return + */ + @Operation(summary = "导出Excel(可选字段)") + @GetMapping("/ExportExcelData") + public ActionResult exportExcelData(PaginationEmployee paginationEmployee) { + String dataType = paginationEmployee.getDataType(); + String selectKey = paginationEmployee.getSelectKey(); + List entityList = new ArrayList<>(); + if ("0".equals(dataType)) { + entityList = employeeService.getList(paginationEmployee); + } else if ("1".equals(dataType)) { + entityList = employeeService.getList(); + } + List modeList = new ArrayList<>(); + for(EmployeeEntity employeeEntity:entityList){ + EmployeeModel mode=new EmployeeModel(); + mode.setEnCode(employeeEntity.getEnCode()); + mode.setFullName(employeeEntity.getFullName()); + mode.setGender(employeeEntity.getGender()); + mode.setDepartmentName(employeeEntity.getDepartmentName()); + mode.setPositionName(employeeEntity.getPositionName()); + mode.setWorkingNature(employeeEntity.getWorkingNature()); + mode.setIdNumber(employeeEntity.getIdNumber()); + mode.setTelephone(employeeEntity.getTelephone()); + SimpleDateFormat sf=new SimpleDateFormat("yyyy-MM-dd"); + if(employeeEntity.getBirthday()!=null){ + String birthday=sf.format(employeeEntity.getBirthday()); + mode.setBirthday(birthday); + } + if(employeeEntity.getAttendWorkTime()!=null){ + String attendWorkTime=sf.format(employeeEntity.getAttendWorkTime()); + mode.setAttendWorkTime(attendWorkTime); + } + mode.setEducation(employeeEntity.getEducation()); + mode.setMajor(employeeEntity.getMajor()); + mode.setGraduationAcademy(employeeEntity.getGraduationAcademy()); + if(employeeEntity.getGraduationTime()!=null){ + String graduationTime=sf.format(employeeEntity.getGraduationTime()); + mode.setGraduationTime(graduationTime); + } + SimpleDateFormat sf1=new SimpleDateFormat("yyyy-MM-dd HH:mm"); + if(employeeEntity.getCreatorTime()!=null){ + String creatorTime=sf1.format(employeeEntity.getCreatorTime()); + mode.setCreatorTime(creatorTime); + } + modeList.add(mode); + } + List list =JsonUtil.listToJsonField(JsonUtil.getJsonToList(modeList, EmployeeExportVO.class)); + List entitys = new ArrayList<>(); + String[] splitData = selectKey.split(","); + if (splitData != null && splitData.length > 0) { + for (int i = 0; i < splitData.length; i++) { + if ("enCode".equals(splitData[i])) { + entitys.add(new ExcelExportEntity("工号", "enCode")); + } + if ("fullName".equals(splitData[i])) { + entitys.add(new ExcelExportEntity("姓名", "fullName")); + } + if ("gender".equals(splitData[i])) { + entitys.add(new ExcelExportEntity("性别", "gender")); + } + if ("departmentName".equals(splitData[i])) { + entitys.add(new ExcelExportEntity("部门", "departmentName")); + } + if ("positionName".equals(splitData[i])) { + entitys.add(new ExcelExportEntity("职务", "positionName", 25)); + } + if ("workingNature".equals(splitData[i])) { + entitys.add(new ExcelExportEntity("用工性质", "workingNature")); + } + if ("idNumber".equals(splitData[i])) { + entitys.add(new ExcelExportEntity("身份证号", "idNumber", 25)); + } + if ("telephone".equals(splitData[i])) { + entitys.add(new ExcelExportEntity("联系电话", "telephone", 20)); + } + if ("birthday".equals(splitData[i])) { + entitys.add(new ExcelExportEntity("出生年月", "birthday", 20)); + } + if ("attendWorkTime".equals(splitData[i])) { + entitys.add(new ExcelExportEntity("参加工作", "attendWorkTime", 20)); + } + if ("education".equals(splitData[i])) { + entitys.add(new ExcelExportEntity("最高学历", "education")); + } + if ("major".equals(splitData[i])) { + entitys.add(new ExcelExportEntity("所学专业", "major")); + } + if ("graduationAcademy".equals(splitData[i])) { + entitys.add(new ExcelExportEntity("毕业院校", "graduationAcademy")); + } + if ("graduationTime".equals(splitData[i])) { + entitys.add(new ExcelExportEntity("毕业时间", "graduationTime", 20)); + } + if ("creatorTime".equals(splitData[i])) { + entitys.add(new ExcelExportEntity("创建时间", "creatorTime")); + } + } + } + ExportParams exportParams = new ExportParams(null, "职员信息"); + exportParams.setType(ExcelType.XSSF); + DownloadVO vo = DownloadVO.builder().build(); + try { + @Cleanup Workbook workbook = new HSSFWorkbook(); + if (entitys.size() > 0) { + workbook = ExcelExportUtil.exportExcel(exportParams, entitys, list); + } + String name = "职员信息" + DateUtil.dateNow("yyyyMMdd") + "_" + RandomUtil.uuId() + ".xlsx"; + //上传文件 + MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, name); + String temporaryFilePath = configValueUtil.getTemporaryFilePath(); + FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, name); + vo.setName(fileInfo.getFilename()); + vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + name); + } catch (Exception e) { + log.error("信息导出Excel错误:{}", e.getMessage()); + } + return ActionResult.success(vo); + } + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/OrderController.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/OrderController.java new file mode 100644 index 0000000..759705c --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/OrderController.java @@ -0,0 +1,409 @@ +package jnpf.controller; + +import cn.afterturn.easypoi.excel.ExcelExportUtil; +import cn.afterturn.easypoi.excel.entity.TemplateExportParams; +import cn.dev33.satoken.annotation.SaCheckPermission; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.Page; +import jnpf.base.controller.SuperController; +import jnpf.base.vo.DownloadVO; +import jnpf.base.vo.ListVO; +import jnpf.base.vo.PageListVO; +import jnpf.base.vo.PaginationVO; +import jnpf.config.ConfigValueUtil; +import jnpf.constant.FileTypeConstant; +import jnpf.constant.MsgCode; +import jnpf.engine.entity.FlowTaskEntity; +import jnpf.engine.enums.FlowStatusEnum; +import jnpf.engine.service.FlowTaskService; +import jnpf.entity.OrderEntity; +import jnpf.entity.OrderEntryEntity; +import jnpf.entity.OrderReceivableEntity; +import jnpf.exception.DataException; +import jnpf.exception.WorkFlowException; +import jnpf.model.order.*; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.UserService; +import jnpf.service.OrderService; +import jnpf.util.JsonUtil; +import jnpf.util.StringUtil; +import jnpf.util.UploaderUtil; +import jnpf.util.UserProvider; +import lombok.Cleanup; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.ss.usermodel.Workbook; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.io.FileOutputStream; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 订单信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ + +@Slf4j +@Tag(name = "订单信息", description = "Order") +@RestController +@RequestMapping("/api/extend/CrmOrder") +public class OrderController extends SuperController { + + @Autowired + private OrderService orderService; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private UserService userService; + @Autowired + private UserProvider userProvider; + @Autowired + private FlowTaskService flowTaskService; + + /** + * 获取订单信息列表(带分页) + * + * @param paginationOrder 分页模型 + * @return + */ + @Operation(summary = "获取订单信息列表") + @GetMapping + @SaCheckPermission("extend.order") + public ActionResult> list(PaginationOrder paginationOrder) { + List data = orderService.getList(paginationOrder); + List listVO = JsonUtil.getJsonToList(data, OrderListVO.class); + List id = data.stream().map(t -> t.getId()).collect(Collectors.toList()); + List orderStaList = flowTaskService.getOrderStaList(id); + List userId = listVO.stream().map(t -> t.getCreatorUserId()).collect(Collectors.toList()); + List userList = userService.getUserName(userId); + for (OrderListVO order : listVO) { + UserEntity user = userList.stream().filter(t -> t.getId().equals(order.getCreatorUserId())).findFirst().orElse(null); + order.setCreatorUser(user != null ? user.getRealName() + "/" + user.getAccount() : ""); + FlowTaskEntity task = orderStaList.stream().filter(t -> t.getId().equals(order.getId())).findFirst().orElse(null); + order.setCurrentState(task != null ? task.getStatus() : null); + order.setFlowId(task != null ? task.getFlowId() : order.getFlowId()); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(paginationOrder, PaginationVO.class); + return ActionResult.page(listVO, paginationVO); + } + + /** + * 获取订单信息子列表(订单明细) + * + * @param id 主表 + * @return + */ + @Operation(summary = "获取订单信息子列表(订单明细)") + @GetMapping("/OrderEntry/{id}/Items") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("extend.order") + public ActionResult> orderEntryList(@PathVariable("id") String id) { + List data = orderService.getOrderEntryList(id); + List result = JsonUtil.getJsonToList(data, OrderEntryListVO.class); + ListVO vo = new ListVO(); + vo.setList(result); + return ActionResult.success(vo); + } + + /** + * 获取订单信息子列表(订单收款) + * + * @param id 主表 + * @return + */ + @Operation(summary = "获取订单列表-收款计划") + @GetMapping("/{id}/CollectionPlan") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("extend.order") + public ActionResult> orderReceivableList(@PathVariable("id") String id) { + List data = orderService.getOrderReceivableList(id); + List result = JsonUtil.getJsonToList(data, OrderReceivableListVO.class); + ListVO vo = new ListVO(); + vo.setList(result); + return ActionResult.success(vo); + } + + /** + * 获取订单信息 + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取订单信息") + @GetMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("extend.order") + public ActionResult info(@PathVariable("id") String id) { + OrderEntity orderEntity = orderService.getInfo(id); + List orderEntryList = orderService.getOrderEntryList(id); + List orderReceivableList = orderService.getOrderReceivableList(id); + OrderInfoVO infoVo = JsonUtil.getJsonToBean(orderEntity, OrderInfoVO.class); + if (infoVo != null) { + List orderEntryModels = JsonUtil.getJsonToList(orderEntryList, OrderInfoOrderEntryModel.class); + infoVo.setGoodsList(orderEntryModels); + List orderReceivableModels = JsonUtil.getJsonToList(orderReceivableList, OrderInfoOrderReceivableModel.class); + infoVo.setCollectionPlanList(orderReceivableModels); + if (StringUtil.isNotEmpty(infoVo.getCreatorUserId())) { + UserEntity creator = userService.getInfo(infoVo.getCreatorUserId()); + infoVo.setCreatorUserId(creator != null ? creator.getRealName() + "/" + creator.getAccount() : ""); + } + if (StringUtil.isNotEmpty(infoVo.getLastModifyUserId())) { + UserEntity lastModify = userService.getInfo(infoVo.getLastModifyUserId()); + infoVo.setLastModifyUserId(lastModify != null ? lastModify.getRealName() + "/" + lastModify.getAccount() : ""); + } + } + return ActionResult.success(infoVo); + } + + /** + * 获取订单信息(前单) + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取订单信息(前单)") + @GetMapping("/{id}/Actions/Prev") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("extend.order") + public ActionResult prevInfo(@PathVariable("id") String id) throws DataException { + OrderInfoVO vo = orderService.getInfoVo(id, "prev"); + return ActionResult.success(vo); + } + + /** + * 获取订单信息(后单) + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取订单信息(后单)") + @GetMapping("/{id}/Actions/Next") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("extend.order") + public ActionResult nextInfo(@PathVariable("id") String id) throws DataException { + OrderInfoVO vo = orderService.getInfoVo(id, "next"); + return ActionResult.success(vo); + } + + /** + * 信息导出Excel + * + * @param id 主键 + * @return + */ + @Operation(summary = "信息导出Excel") + @GetMapping("/{id}/Export") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("extend.order") + public ActionResult exportExcel(@PathVariable("id") String id) { + OrderEntity orderEntity = orderService.getInfo(id); + if (orderEntity != null) { + if (StringUtil.isNotEmpty(orderEntity.getCreatorUserId())) { + UserEntity user = userService.getInfo(orderEntity.getCreatorUserId()); + orderEntity.setCreatorUserId(user != null ? user.getRealName() + "/" + user.getAccount() : ""); + } + if (StringUtil.isNotEmpty(orderEntity.getLastModifyUserId())) { + UserEntity user = userService.getInfo(orderEntity.getLastModifyUserId()); + orderEntity.setLastModifyUserId(user != null ? user.getRealName() + "/" + user.getAccount() : ""); + } + OrderExportModel exportModel = JsonUtil.getJsonToBean(orderEntity, OrderExportModel.class); + //保存数据 + Map map = new HashMap<>(16); + map.put("order", JSON.parse(JSONObject.toJSONStringWithDateFormat(exportModel, "yyyy-MM-dd HH:mm:ss"))); + List orderEntryList = orderService.getOrderEntryList(id); + String num = "0"; + BigDecimal qtyNum = new BigDecimal(num); + BigDecimal amountNum = new BigDecimal(num); + BigDecimal actualAmountNum = new BigDecimal(num); + for (OrderEntryEntity entity : orderEntryList) { + BigDecimal qty = null; + if (entity.getQty() == null) { + qty = new BigDecimal(num); + } else { + qty = entity.getQty(); + } + qtyNum = qtyNum.add(qty); + BigDecimal amount = null; + if (entity.getAmount() == null) { + amount = new BigDecimal(num); + } else { + amount = entity.getAmount(); + } + amountNum = amountNum.add(amount); + BigDecimal actualAmount; + if (entity.getActualAmount() == null) { + actualAmount = new BigDecimal(num); + } else { + actualAmount = entity.getActualAmount(); + } + actualAmountNum = actualAmountNum.add(actualAmount); + } + OrderEntryEntity entity = new OrderEntryEntity(); + //最后一行合计 + entity.setGoodsName("合计"); + entity.setQty(qtyNum); + entity.setAmount(amountNum); + entity.setActualAmount(actualAmountNum); + orderEntryList.add(entity); + map.put("orderEntry", orderEntryList); + DownloadVO vo = DownloadVO.builder().build(); + try { + //模板 + TemplateExportParams param = new TemplateExportParams(configValueUtil.getTemplateFilePath() + "orderInfo_export_template.xlsx", true); + @Cleanup Workbook workbook = ExcelExportUtil.exportExcel(param, map); + String name = "订单信息-" + orderEntity.getOrderCode() + ".xlsx"; + String fileName = configValueUtil.getTemporaryFilePath() + name; + @Cleanup FileOutputStream output = new FileOutputStream(fileName); + workbook.write(output); + vo.setName(name); + vo.setUrl(UploaderUtil.uploaderFile(name)); + } catch (Exception e) { + log.error("信息导出Excel错误:{}", e.getMessage()); + } + return ActionResult.success(vo); + } + return ActionResult.fail("未能找到此订单"); + } + + /** + * 新建订单信息 + * + * @param id 主键 + * @param orderForm 订单模型 + * @return + */ + @Operation(summary = "新建订单信息") + @PostMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "orderForm", description = "订单模型", required = true), + }) + @SaCheckPermission("extend.order") + public ActionResult create(@PathVariable("id") String id, @RequestBody @Valid OrderForm orderForm) throws WorkFlowException { + OrderEntity orderEntity = JsonUtil.getJsonToBean(orderForm, OrderEntity.class); + orderEntity.setId(id); + List orderEntryList = JsonUtil.getJsonToList(orderForm.getGoodsList(), OrderEntryEntity.class); + List orderReceivableList = JsonUtil.getJsonToList(orderForm.getCollectionPlanList(), OrderReceivableEntity.class); + orderService.create(orderEntity, orderEntryList, orderReceivableList); + return ActionResult.success(MsgCode.SU002.get()); + } + + /** + * 更新订单信息 + * + * @param id 主键 + * @param orderForm 订单模型 + * @return + */ + @Operation(summary = "更新订单信息") + @PutMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "orderForm", description = "订单模型", required = true), + }) + @SaCheckPermission("extend.order") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid OrderForm orderForm) throws WorkFlowException { + OrderEntity orderEntity = JsonUtil.getJsonToBean(orderForm, OrderEntity.class); + List orderEntryList = JsonUtil.getJsonToList(orderForm.getGoodsList(), OrderEntryEntity.class); + List orderReceivableList = JsonUtil.getJsonToList(orderForm.getCollectionPlanList(), OrderReceivableEntity.class); + OrderEntity entity = orderService.getInfo(id); + orderEntity.setId(id); + if (entity != null) { + orderService.update(id, orderEntity, orderEntryList, orderReceivableList); + return ActionResult.success(MsgCode.SU004.get()); + } + return ActionResult.success(MsgCode.FA002.get()); + } + + /** + * 删除订单信息 + * + * @param id 主键 + * @return + */ + @Operation(summary = "删除订单信息") + @DeleteMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("extend.order") + public ActionResult delete(@PathVariable("id") String id) { + OrderEntity entity = orderService.getInfo(id); + if (entity != null) { + orderService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + /** + * 获取客户列表 + * + * @param page 分页模型 + * @return + */ + @Operation(summary = "获取客户列表") + @GetMapping("/Customer") + @SaCheckPermission("extend.order") + public ActionResult> customerList(Page page) { + String json = "[{\"id\":\"8094826d-dfe0-4a05-9023-4d441c304c61\",\"text\":\"广东雪莱特光电科技股份有限公司\",\"code\":\"100000\",\"keyword\":\"GDXLTGDKJGFYXGS,ADXLTGDKJGFYXGS\"},{\"id\":\"b20e965b-9f18-4228-9532-e506caf751e3\",\"text\":\"广州旭之日电子科技有限公司\",\"code\":\"100001\",\"keyword\":\"GZXZRDZKJYXGS,AZXZRDZKJYXGS\"},{\"id\":\"563326c0-ad5f-4221-9ff7-dbf687c4b802\",\"text\":\"东莞市博力威汽车配件有限公司\",\"code\":\"100002\",\"keyword\":\"DWSBLWQJPJYXGS,DWSBLWQCPJYXGS,DGSBLWQJPJYXGS,DGSBLWQCPJYXGS\"},{\"id\":\"b28691a9-acdc-4fdd-9e5f-c2fd04e5a795\",\"text\":\"佛山市恒威汽车动力转向器公司\",\"code\":\"100003\",\"keyword\":\"BSSHWQJDLZXQGS,BSSHWQCDLZXQGS\"},{\"id\":\"37143c66-93a0-4ec2-8625-5dc3f0059e5c\",\"text\":\"广州三锦照明电器公司\",\"code\":\"100004\",\"keyword\":\"GZSJZMDQGS,AZSJZMDQGS\"},{\"id\":\"712a390f-deb7-4d6d-b1bf-cb93b2221306\",\"text\":\"广州鑫正源汽配有限公司\",\"code\":\"100005\",\"keyword\":\"GZXZYQPYXGS,AZXZYQPYXGS\"},{\"id\":\"a10fa05a-7954-4500-a3e9-2b42837a6ee9\",\"text\":\"广州市德霸照明电器有限公司\",\"code\":\"100006\",\"keyword\":\"GZSDBZMDQYXGS,AZSDBZMDQYXGS\"},{\"id\":\"cb715ab8-8940-480a-b1f2-cc61b73ae44b\",\"text\":\"深圳星际服饰有限公司\",\"code\":\"100007\",\"keyword\":\"SZXJFSYXGS\"},{\"id\":\"6c265977-5480-4e3e-82a3-0f71f750f109\",\"text\":\"深圳市博锐纵横科技有限公司\",\"code\":\"100008\",\"keyword\":\"SZSBRZHKJYXGS\"},{\"id\":\"2bbc5699-1968-42d0-b950-39df42b6718f\",\"text\":\"广州融星商贸有限公司\",\"code\":\"100009\",\"keyword\":\"GZRXSMYXGS,AZRXSMYXGS\"},{\"id\":\"64e597d4-0a8e-4bf7-b8d7-64ca8a2e6c20\",\"text\":\"广州顶诚科技电子有限公司\",\"code\":\"100010\",\"keyword\":\"GZDCKJDZYXGS,AZDCKJDZYXGS\"},{\"id\":\"15337f7e-3fff-4403-96b9-eaebbef85534\",\"text\":\"烟台孚瑞克森汽车部件有限公司\",\"code\":\"100011\",\"keyword\":\"YTFRKSQJBJYXGS,YTFRKSQCBJYXGS\"},{\"id\":\"46746ff8-c48b-43c7-a9e9-51a19d1d2499\",\"text\":\"茌平信发铝电集团有限公司\",\"code\":\"100012\",\"keyword\":\"CPXFLDJTYXGS\"},{\"id\":\"6f752d0c-b416-4552-8ef9-5f2136e77689\",\"text\":\"济南澳商贸易有限公司\",\"code\":\"100013\",\"keyword\":\"JNASMYYXGS\"},{\"id\":\"8ab80843-e007-4dd4-8d39-d28f05ba1643\",\"text\":\"济南澳润商贸有限公司\",\"code\":\"100014\",\"keyword\":\"JNARSMYXGS\"},{\"id\":\"2d10551d-6f72-4c00-abd4-8c9856a2aeba\",\"text\":\"山东凯诺汽车配件有限公司\",\"code\":\"100015\",\"keyword\":\"SDKNQJPJYXGS,SDKNQCPJYXGS\"},{\"id\":\"30d89988-00f5-4abc-88ea-592f058c8d89\",\"text\":\"烟台瑞福汽车部件有限公司\",\"code\":\"100016\",\"keyword\":\"YTRFQJBJYXGS,YTRFQCBJYXGS\"},{\"id\":\"812ccd19-f7d5-4c24-9e11-b31bfee50d41\",\"text\":\"茌平日兴达汽车部件有限公司\",\"code\":\"100017\",\"keyword\":\"CPRXDQJBJYXGS,CPRXDQCBJYXGS\"},{\"id\":\"89f05f5f-5ca2-4f59-a41a-abc3a444a77c\",\"text\":\"永正汽车配件有限责任公司\",\"code\":\"100018\",\"keyword\":\"YZQJPJYXZRGS,YZQCPJYXZRGS\"},{\"id\":\"5be62e54-c3cf-4927-a8fc-61e6d6534e24\",\"text\":\"青岛华安正信国际贸易有限公司\",\"code\":\"100019\",\"keyword\":\"QDHAZXGJMYYXGS\"},{\"id\":\"45e990c7-ffc2-4df8-8b83-2af4d4b07fbb\",\"text\":\"广饶中策橡胶有限公司\",\"code\":\"100020\",\"keyword\":\"GRZCXJYXGS,ARZCXJYXGS\"},{\"id\":\"c865c9fb-135e-40b8-bb38-9a909f5c3a8b\",\"text\":\"山东张驰橡胶有限公司\",\"code\":\"100021\",\"keyword\":\"SDZCXJYXGS\"},{\"id\":\"802c13c6-a89c-4351-98a6-956f48fd3c72\",\"text\":\"济南易久自动化有限公司\",\"code\":\"100022\",\"keyword\":\"JNYJZDHYXGS\"},{\"id\":\"49ddaa6c-ba14-48af-9782-4c780914cd30\",\"text\":\"山东汇丰汽车配件有限公司\",\"code\":\"100023\",\"keyword\":\"SDHFQJPJYXGS,SDHFQCPJYXGS\"},{\"id\":\"179ac5c2-6ea3-4b7e-994f-0e6d846394d6\",\"text\":\"烟台浩阳机械制造有限公司\",\"code\":\"100024\",\"keyword\":\"YTHYJXZZYXGS\"},{\"id\":\"2a8d22e0-97a5-49e4-8929-f850d4e207c4\",\"text\":\"山东跃恒轮胎化工有限公司\",\"code\":\"100025\",\"keyword\":\"SDYHLTHGYXGS\"},{\"id\":\"8ade7cd2-59f0-435d-a5ed-6e5c47566dab\",\"text\":\"东营博瑞制动系统有限公司\",\"code\":\"100026\",\"keyword\":\"DYBRZDXTYXGS,DYBRZDJTYXGS\"},{\"id\":\"37b52c55-85c1-4a8a-acb7-217231d21404\",\"text\":\"泰安玥欣工贸有限公司\",\"code\":\"100027\",\"keyword\":\"TAYXGMYXGS\"},{\"id\":\"145b9423-bcda-45c9-ab9c-ecda841a5f97\",\"text\":\"山东世途轮胎有限公司\",\"code\":\"100028\",\"keyword\":\"SDSTLTYXGS\"},{\"id\":\"53e40ffa-b566-4280-bac0-70839df36ae9\",\"text\":\"山东世通轮胎有限公司\",\"code\":\"100029\",\"keyword\":\"SDSTLTYXGS\"},{\"id\":\"aabc07b9-a067-4a6d-8979-8bacf09b6601\",\"text\":\"龙口海盟机械有限公司\",\"code\":\"100030\",\"keyword\":\"LKHMJXYXGS\"},{\"id\":\"b01061f5-fc4b-4a6c-8c9d-e74bbc6d65f0\",\"text\":\"枣庄市正邦新型建材有限公司\",\"code\":\"100031\",\"keyword\":\"ZZSZBXXJCYXGS\"},{\"id\":\"0f6dc939-632f-4318-9887-831aadf2f016\",\"text\":\"济南宏岺汽车配件公司\",\"code\":\"100032\",\"keyword\":\"JNHLQJPJGS,JNHLQCPJGS\"},{\"id\":\"44134ad0-84ca-47e5-bdb2-a90701d3b526\",\"text\":\"山东富华汽车配件公司\",\"code\":\"100033\",\"keyword\":\"SDFHQJPJGS,SDFHQCPJGS\"},{\"id\":\"123b6bac-7638-457b-a920-83cc0fa0c2dc\",\"text\":\"聊城贝尔汽车散热器有限公司\",\"code\":\"100034\",\"keyword\":\"LCBEQJSRQYXGS,LCBEQCSRQYXGS\"},{\"id\":\"7b3ee427-6785-4a55-a6e2-8b92c3c756ec\",\"text\":\"枣庄市正邦新型建材有限公司\",\"code\":\"100035\",\"keyword\":\"ZZSZBXXJCYXGS\"},{\"id\":\"abef7a36-c1aa-4324-893e-5ee0cf12ba06\",\"text\":\"山东军泰化工有限公司\",\"code\":\"100036\",\"keyword\":\"SDJTHGYXGS\"},{\"id\":\"579f7530-c82d-4eea-b98d-7ac27db0d92c\",\"text\":\"山东鑫月昶汽车配件有限公司\",\"code\":\"100037\",\"keyword\":\"SDXYCQJPJYXGS,SDXYCQCPJYXGS\"},{\"id\":\"12e0e23d-170d-4924-8088-915796555737\",\"text\":\"山东宏马工程机械有限公司\",\"code\":\"100038\",\"keyword\":\"SDHMGCJXYXGS\"},{\"id\":\"047a68cb-2a57-47f0-ab04-5781147a8888\",\"text\":\"青岛祥荣轮胎有限公司\",\"code\":\"100039\",\"keyword\":\"QDXRLTYXGS\"},{\"id\":\"61129e0d-1b4c-4947-b78b-6ac80de557ca\",\"text\":\"斯伯塔克轮胎集团有限公司\",\"code\":\"100040\",\"keyword\":\"SBTKLTJTYXGS,SBDKLTJTYXGS\"},{\"id\":\"87676528-a2c6-46fc-922f-3854ac7b1e3b\",\"text\":\"东营信义汇丰汽车配件有限公司\",\"code\":\"100041\",\"keyword\":\"DYXYHFQJPJYXGS,DYXYHFQCPJYXGS\"},{\"id\":\"63105380-d09b-4506-baa3-6212d8ac95f2\",\"text\":\"青岛征和工业有限公司\",\"code\":\"100042\",\"keyword\":\"QDZHGYYXGS\"},{\"id\":\"1aecaf71-6623-4992-9f7e-fee68efe61a0\",\"text\":\"上海卓美实业有限公司\",\"code\":\"100043\",\"keyword\":\"SHZMSYYXGS\"},{\"id\":\"61fd0246-fd9c-4fe2-a648-7fe745d2b013\",\"text\":\"上海塞蓝帝国际贸易有限公司\",\"code\":\"100044\",\"keyword\":\"SHSLDGJMYYXGS\"},{\"id\":\"8e26ceca-41d6-42d0-bcc9-500768437d4a\",\"text\":\"上海繁颐国际贸易有限公司\",\"code\":\"100045\",\"keyword\":\"SHPYGJMYYXGS,SHFYGJMYYXGS\"},{\"id\":\"9dd3ed1e-ff4b-4317-b1da-b64fd07e6157\",\"text\":\"六安龙啸工艺品有限公司\",\"code\":\"100046\",\"keyword\":\"LALXGYPYXGS\"},{\"id\":\"f1890c89-fb6c-4736-897d-7dc9c905d7f3\",\"text\":\"六安江澎电器商行\",\"code\":\"100047\",\"keyword\":\"LAJPDQSX,LAJPDQSH\"},{\"id\":\"ffbbe328-488b-4873-bfe3-fbe597716a9b\",\"text\":\"安徽法西欧汽车部件有限公司\",\"code\":\"100048\",\"keyword\":\"AHFXOQJBJYXGS,AHFXOQCBJYXGS\"},{\"id\":\"ff620a66-c80b-4b63-b4bd-ef54d488d67d\",\"text\":\"安徽奥丰汽车配件有限公司\",\"code\":\"100049\",\"keyword\":\"AHAFQJPJYXGS,AHAFQCPJYXGS\"},{\"id\":\"13855122-d6b9-40b1-8415-803ea06ff294\",\"text\":\"瑞安市给力汽车配件有限公司\",\"code\":\"100050\",\"keyword\":\"RASGLQJPJYXGS,RASGLQCPJYXGS,RASJLQJPJYXGS,RASJLQCPJYXGS\"},{\"id\":\"5e9f61c4-f95e-4b12-a462-13310a64fef4\",\"text\":\"温州名邦汽车用品有限公司\",\"code\":\"100051\",\"keyword\":\"WZMBQJYPYXGS,WZMBQCYPYXGS\"},{\"id\":\"34d4627c-5e0b-4e67-936a-da8740743430\",\"text\":\"温州拉凡宝汽车泵业有限公司\",\"code\":\"100052\",\"keyword\":\"WZLFBQJBYYXGS,WZLFBQCBYYXGS\"},{\"id\":\"5c496717-738f-45bc-a613-7a6d6086da9c\",\"text\":\"瑞安科普进出口贸易有限公司\",\"code\":\"100053\",\"keyword\":\"RAKPJCKMYYXGS\"},{\"id\":\"3552401c-90f7-4197-91b6-b8735732884e\",\"text\":\"瑞安中申电器有限公司\",\"code\":\"100054\",\"keyword\":\"RAZSDQYXGS\"},{\"id\":\"2656a62a-52b9-4749-8fa9-ffbf8dc5c940\",\"text\":\"温州金品汽车用品有限公司\",\"code\":\"100055\",\"keyword\":\"WZJPQJYPYXGS,WZJPQCYPYXGS\"},{\"id\":\"a7cd833f-e49e-4496-a29c-215c4ef623be\",\"text\":\"瑞安市力邦科众制动器有限公司\",\"code\":\"100056\",\"keyword\":\"RASLBKZZDQYXGS\"},{\"id\":\"133b902b-12c4-4a00-b238-73a71ae24540\",\"text\":\"宁波广良电器有限公司\",\"code\":\"100057\",\"keyword\":\"NBGLDQYXGS,NBALDQYXGS\"},{\"id\":\"13a19f6b-3d0f-4f17-92f6-8bd3df4ac3d5\",\"text\":\"温州杰峰进出口有限公司\",\"code\":\"100058\",\"keyword\":\"WZJFJCKYXGS\"},{\"id\":\"4a88166a-8b55-40d7-bb22-04dbb1883d34\",\"text\":\"温州科达汽车轴瓦有限公司\",\"code\":\"100059\",\"keyword\":\"WZKDQJZWYXGS,WZKDQCZWYXGS\"},{\"id\":\"22c92533-57af-427c-9b3b-7644dc0a86ef\",\"text\":\"宁波钧乔行汽车配件有限公司\",\"code\":\"100060\",\"keyword\":\"NBJQXQJPJYXGS,NBJQXQCPJYXGS,NBJQHQJPJYXGS,NBJQHQCPJYXGS\"},{\"id\":\"45715bdd-1740-4a30-82c8-d9ef3d05cc5a\",\"text\":\"浙江平柴泵业有限公司\",\"code\":\"100061\",\"keyword\":\"ZJPCBYYXGS\"},{\"id\":\"6a5d46f3-20e4-4a27-b097-3ba6beef7981\",\"text\":\"宁波鑫海爱多雨刷制造有限公司\",\"code\":\"100062\",\"keyword\":\"NBXHADYSZZYXGS\"},{\"id\":\"faadbe66-142b-4d52-8229-0b5239ff0d76\",\"text\":\"浙江亚之星汽车部件有限公司\",\"code\":\"100063\",\"keyword\":\"ZJYZXQJBJYXGS,ZJYZXQCBJYXGS\"},{\"id\":\"f8ed65af-ad33-435d-9f99-d63f04c4a6d0\",\"text\":\"浙江立群汽车配件制造有限公司\",\"code\":\"100064\",\"keyword\":\"ZJLQQJPJZZYXGS,ZJLQQCPJZZYXGS\"},{\"id\":\"46a50622-a4a5-46aa-b307-ca530e77b918\",\"text\":\"浙江林氏汽车零部件有限公司\",\"code\":\"100065\",\"keyword\":\"ZJLZQJLBJYXGS,ZJLZQCLBJYXGS,ZJLSQJLBJYXGS,ZJLSQCLBJYXGS\"},{\"id\":\"6dd6c16c-7a50-4a9b-8e3f-4d5e87091046\",\"text\":\"浙江瑞峰汽车零部件有限公司\",\"code\":\"100066\",\"keyword\":\"ZJRFQJLBJYXGS,ZJRFQCLBJYXGS\"},{\"id\":\"9bfbc91f-2e12-4fca-a6f5-55bf0b21f453\",\"text\":\"温州万豪汽配有限公司\",\"code\":\"100067\",\"keyword\":\"WZWHQPYXGS,WZMHQPYXGS\"},{\"id\":\"c86726b0-345d-479b-99d0-f26ab525b690\",\"text\":\"浙江兰德马克汽车配件有限公司\",\"code\":\"100068\",\"keyword\":\"ZJLDMKQJPJYXGS,ZJLDMKQCPJYXGS\"},{\"id\":\"a7af2dc9-4e11-4452-a897-33b696131de4\",\"text\":\"浙江乐鼎波纹管有限公司\",\"code\":\"100069\",\"keyword\":\"ZJYDBWGYXGS,ZJLDBWGYXGS\"},{\"id\":\"46f82e53-ef5b-4b59-bc0e-7a98d4951784\",\"text\":\"浙江奥凯利汽配有限公司\",\"code\":\"100070\",\"keyword\":\"ZJAKLQPYXGS\"},{\"id\":\"03b372b7-adc9-41c1-8db2-db6da049f0b4\",\"text\":\"宁波昂博电器科技有限公司\",\"code\":\"100071\",\"keyword\":\"NBABDQKJYXGS\"},{\"id\":\"069bb158-2719-40e8-9f3e-ea8d14774a98\",\"text\":\"浙江吉尚汽车部件有限公司\",\"code\":\"100072\",\"keyword\":\"ZJJSQJBJYXGS,ZJJSQCBJYXGS\"},{\"id\":\"4caaf81a-925f-471d-b4a6-a330b5e5835b\",\"text\":\"诸暨市国立机械有限公司\",\"code\":\"100073\",\"keyword\":\"ZJSGLJXYXGS\"},{\"id\":\"a24b6a50-1b17-413e-828b-4107410b2a2e\",\"text\":\"玉环冠丰汽车零部件有限公司\",\"code\":\"100074\",\"keyword\":\"YHGFQJLBJYXGS,YHGFQCLBJYXGS\"},{\"id\":\"cabfe7d7-c164-4444-bff0-b547d5a3b9db\",\"text\":\"武义万龙机械制造有限公司\",\"code\":\"100075\",\"keyword\":\"WYWLJXZZYXGS,WYMLJXZZYXGS\"},{\"id\":\"67142c93-f97c-401c-8079-7ebb8159e838\",\"text\":\"浙江安泰汽车部件有限公司\",\"code\":\"100076\",\"keyword\":\"ZJATQJBJYXGS,ZJATQCBJYXGS\"},{\"id\":\"05b20523-ca83-4072-8ea0-84ea3623e436\",\"text\":\"余姚斯威克电器有限公司\",\"code\":\"100077\",\"keyword\":\"YYSWKDQYXGS\"},{\"id\":\"7baa025e-56b7-48a1-bcd2-0f3c1128016e\",\"text\":\"温州鼎程电子科技有限公司\",\"code\":\"100078\",\"keyword\":\"WZDCDZKJYXGS\"},{\"id\":\"f57b707c-f7fe-4c29-b6e3-a4cc607e11f0\",\"text\":\"临海裕隆汽配有限公司\",\"code\":\"100079\",\"keyword\":\"LHYLQPYXGS\"},{\"id\":\"d07308e7-9139-43f2-8e07-bcd69e74a0e1\",\"text\":\"宁波路卡帝电器有限公司\",\"code\":\"100080\",\"keyword\":\"NBLQDDQYXGS,NBLKDDQYXGS\"},{\"id\":\"512eb341-29e5-49fb-8d61-ba4dcc63245e\",\"text\":\"宁波雷自达电器有限公司\",\"code\":\"100081\",\"keyword\":\"NBLZDDQYXGS\"},{\"id\":\"781c1504-487c-4a7c-bf14-cb47d14a646e\",\"text\":\"温州凯特汽车用品制造厂\",\"code\":\"100082\",\"keyword\":\"WZKTQJYPZZC,WZKTQJYPZZA,WZKTQCYPZZC,WZKTQCYPZZA\"},{\"id\":\"01d7eaa2-0d4e-4e16-985b-45afac5d0538\",\"text\":\"宁波博盛汽车电子有限公司\",\"code\":\"100083\",\"keyword\":\"NBBSQJDZYXGS,NBBSQCDZYXGS,NBBCQJDZYXGS,NBBCQCDZYXGS\"},{\"id\":\"41a31860-be6b-4014-a936-72a221779de6\",\"text\":\"温州欧泰汽车用品制造有限公司\",\"code\":\"100084\",\"keyword\":\"WZOTQJYPZZYXGS,WZOTQCYPZZYXGS\"},{\"id\":\"06ccc046-131b-4691-9341-359f7ae5063e\",\"text\":\"永康市蓝特工贸有限公司\",\"code\":\"100085\",\"keyword\":\"YKSLTGMYXGS\"},{\"id\":\"e46a07e6-0936-4e7a-81cc-9c4ddbd03184\",\"text\":\"宁波行泰商贸有限公司\",\"code\":\"100086\",\"keyword\":\"NBXTSMYXGS,NBHTSMYXGS\"},{\"id\":\"48a9c7ce-d6df-4a44-8d0e-3c88ad3cc54d\",\"text\":\"瑞安市路泰汽摩零部件有限公司\",\"code\":\"100087\",\"keyword\":\"RASLTQMLBJYXGS\"},{\"id\":\"19aaab61-5281-4ac7-b5f4-edc520c89653\",\"text\":\"瑞安宏盛汽配厂\",\"code\":\"100088\",\"keyword\":\"RAHSQPC,RAHSQPA,RAHCQPC,RAHCQPA\"},{\"id\":\"04d60fed-56ec-4418-abe4-1a25929fb7b0\",\"text\":\"诸暨市维琪弹簧有限公司\",\"code\":\"100089\",\"keyword\":\"ZJSWQTHYXGS,ZJSWQDHYXGS\"},{\"id\":\"d6f5eec0-aa1a-4017-ac41-05470d3924a4\",\"text\":\"杭州康功轴承有限公司\",\"code\":\"100090\",\"keyword\":\"HZKGZCYXGS\"},{\"id\":\"4c33ee68-a64a-4454-ae3a-e62a2fe74d25\",\"text\":\"余姚航亿电器有限公司\",\"code\":\"100091\",\"keyword\":\"YYHYDQYXGS\"},{\"id\":\"a039923a-bb38-43f7-9d07-f252b139d9ef\",\"text\":\"浙江天元机电有限公司\",\"code\":\"100092\",\"keyword\":\"ZJTYJDYXGS\"},{\"id\":\"0617174b-b904-496a-a179-027504ef3699\",\"text\":\"瑞安市剑达汽车配件有限公司\",\"code\":\"100093\",\"keyword\":\"RASJDQJPJYXGS,RASJDQCPJYXGS\"},{\"id\":\"82364f9a-f9d8-4451-896b-85a2bcbe6902\",\"text\":\"台州华帅汽配有限公司\",\"code\":\"100094\",\"keyword\":\"TZHSQPYXGS\"},{\"id\":\"568872cb-66b8-43fc-a64d-3554186f0c4b\",\"text\":\"浙江铭泰汽车零部件有限公司\",\"code\":\"100095\",\"keyword\":\"ZJMTQJLBJYXGS,ZJMTQCLBJYXGS\"},{\"id\":\"8111675d-7449-4445-b0a1-14602f14ab77\",\"text\":\"浙江戈尔德汽车部件有限公司\",\"code\":\"100096\",\"keyword\":\"ZJGEDQJBJYXGS,ZJGEDQCBJYXGS\"},{\"id\":\"3a6a3be8-4b72-42eb-a872-f3395c81ca1d\",\"text\":\"常州国华电器有限公司\",\"code\":\"100097\",\"keyword\":\"CZGHDQYXGS\"},{\"id\":\"73f61385-1674-4dda-ac8e-950a886c5410\",\"text\":\"瑞安兴润贸易有限公司\",\"code\":\"100098\",\"keyword\":\"RAXRMYYXGS\"},{\"id\":\"1ee6531c-725f-4f44-b37d-8ad787c4922c\",\"text\":\"绍兴明博汽车配件有限公司\",\"code\":\"100099\",\"keyword\":\"SXMBQJPJYXGS,SXMBQCPJYXGS\"},{\"id\":\"6ff18edc-b10e-4349-8f3f-ca68f1eceee8\",\"text\":\"温州良子贸易有限公司\",\"code\":\"100100\",\"keyword\":\"WZLZMYYXGS\"},{\"id\":\"f87234e3-7199-4262-be6a-1a8f77524efc\",\"text\":\"宁波力富特牵引机制造有限公司\",\"code\":\"100101\",\"keyword\":\"NBLFTQYJZZYXGS\"},{\"id\":\"799826d9-6f8b-42a0-a713-37b9739b68df\",\"text\":\"宁波市江北名正电机有限公司\",\"code\":\"100102\",\"keyword\":\"NBSJBMZDJYXGS\"},{\"id\":\"84a17072-2047-477a-9b24-67e98f5d2220\",\"text\":\"宁波茂佳国际贸易有限公司\",\"code\":\"100103\",\"keyword\":\"NBMJGJMYYXGS\"},{\"id\":\"224ba569-fdc5-4705-b4e8-d30bcd36b854\",\"text\":\"瑞安市墉下文峰汽摩配厂\",\"code\":\"100104\",\"keyword\":\"RASYXWFQMPC,RASYXWFQMPA\"},{\"id\":\"e8bd46cd-db81-4c5e-b083-d1c05a0034a6\",\"text\":\"诸暨宇诺汽车配件有限公司\",\"code\":\"100105\",\"keyword\":\"ZJYNQJPJYXGS,ZJYNQCPJYXGS\"},{\"id\":\"781dd8cf-711a-4afa-9e22-f5a0a333637e\",\"text\":\"宁波泰和轴承有限公司\",\"code\":\"100106\",\"keyword\":\"NBTHZCYXGS\"},{\"id\":\"9bbc9c86-290b-4687-8a98-449a1a415266\",\"text\":\"东海县兰天汽车车轮厂\",\"code\":\"100107\",\"keyword\":\"DHXLTQJJLC,DHXLTQJJLA,DHXLTQJCLC,DHXLTQJCLA,DHXLTQCJLC,DHXLTQCJLA,DHXLTQCCLC,DHXLTQCCLA\"},{\"id\":\"679c136c-21c9-4ac3-ad7a-db0a613ca24d\",\"text\":\"扬州阿波罗蓄电池有限公司\",\"code\":\"100108\",\"keyword\":\"YZABLXDCYXGS,YZEBLXDCYXGS\"},{\"id\":\"3dd2eb0f-0097-4b52-9165-78e2a8d474e1\",\"text\":\"常州中隆车辆配件有限公司\",\"code\":\"100109\",\"keyword\":\"CZZLJLPJYXGS,CZZLCLPJYXGS\"},{\"id\":\"760becc2-0253-4f81-879f-970f432620d9\",\"text\":\"无锡吉瑞特机械制造有限公司\",\"code\":\"100110\",\"keyword\":\"WXJRTJXZZYXGS,MXJRTJXZZYXGS\"},{\"id\":\"b8bd4d12-2f85-43e8-b891-94866a18e90f\",\"text\":\"金坛市平江电气设备有限公司\",\"code\":\"100111\",\"keyword\":\"JTSPJDQSBYXGS\"},{\"id\":\"df0c341e-03ca-4900-95ae-fbad4e11cf9b\",\"text\":\"江苏精诚动力工程有限公司\",\"code\":\"100112\",\"keyword\":\"JSJCDLGCYXGS\"},{\"id\":\"348a509b-5f69-457e-9e9c-d28a03b2f13e\",\"text\":\"南京卡安汽车配件有限公司\",\"code\":\"100113\",\"keyword\":\"NJQAQJPJYXGS,NJQAQCPJYXGS,NJKAQJPJYXGS,NJKAQCPJYXGS\"},{\"id\":\"e69574d5-b276-4828-b2c0-c1fa7ae5b4b0\",\"text\":\"丹阳市帅达车业有限公司\",\"code\":\"100114\",\"keyword\":\"DYSSDJYYXGS,DYSSDCYYXGS\"},{\"id\":\"0fbec45d-4064-4a89-9c1e-34476d0f9e1d\",\"text\":\"江苏丹阳市超强汽配有限公司\",\"code\":\"100115\",\"keyword\":\"JSDYSCQQPYXGS,JSDYSCJQPYXGS\"},{\"id\":\"f1e15fa6-d4df-45db-9143-89e5bfd89f72\",\"text\":\"常州云昊汽车用品有限公司\",\"code\":\"100116\",\"keyword\":\"CZYHQJYPYXGS,CZYHQCYPYXGS\"},{\"id\":\"85c9d273-68ef-4dc4-8760-a2c303ab7953\",\"text\":\"常州南舜汽车附件厂\",\"code\":\"100117\",\"keyword\":\"CZNSQJFJC,CZNSQJFJA,CZNSQCFJC,CZNSQCFJA\"},{\"id\":\"7f7a474b-8327-40be-9ef2-711ebd53defc\",\"text\":\"常州顺德车业有限公司\",\"code\":\"100118\",\"keyword\":\"CZSDJYYXGS,CZSDCYYXGS\"},{\"id\":\"90fbf581-6eb9-421a-8105-73a396ac1003\",\"text\":\"常州昊翔车辆饰件有限公司\",\"code\":\"100119\",\"keyword\":\"CZHXJLSJYXGS,CZHXCLSJYXGS\"},{\"id\":\"723358eb-6b04-4fb3-876e-65f374666aa3\",\"text\":\"常州乐丰汽车饰件厂\",\"code\":\"100120\",\"keyword\":\"CZYFQJSJC,CZYFQJSJA,CZYFQCSJC,CZYFQCSJA,CZLFQJSJC,CZLFQJSJA,CZLFQCSJC,CZLFQCSJA\"},{\"id\":\"26823b21-030a-44c1-9d6a-84da4d288057\",\"text\":\"丹阳文明塑业有限公司\",\"code\":\"100121\",\"keyword\":\"DYWMSYYXGS\"},{\"id\":\"8f3c1330-d743-43d7-8f13-6b8b78f03f68\",\"text\":\"南京润特科技有限公司\",\"code\":\"100122\",\"keyword\":\"NJRTKJYXGS\"},{\"id\":\"89693dd1-50d8-4bc6-98c6-773e8220df26\",\"text\":\"重庆子堃进出口贸易有限公司\",\"code\":\"100123\",\"keyword\":\"ZQZKJCKMYYXGS,CQZKJCKMYYXGS\"},{\"id\":\"ac55602f-4526-4c09-b36b-3b0b5e5af107\",\"text\":\"石家庄旺正国际贸易有限公司\",\"code\":\"100124\",\"keyword\":\"SJZWZGJMYYXGS,DJZWZGJMYYXGS\"},{\"id\":\"930e0f13-cdf9-4149-8e79-8a9f18282f65\",\"text\":\"河间津华金属缺口有限公司\",\"code\":\"100125\",\"keyword\":\"HJJHJZQKYXGS,HJJHJSQKYXGS\"},{\"id\":\"0b4d11ab-b31a-4883-af56-037a54566ce4\",\"text\":\"河北蓝博汽车部件制造有限公司\",\"code\":\"100126\",\"keyword\":\"HBLBQJBJZZYXGS,HBLBQCBJZZYXGS\"},{\"id\":\"abe09ea0-ea41-4063-91b3-ae231f0b6724\",\"text\":\"献县亚特汽车附件厂\",\"code\":\"100127\",\"keyword\":\"XXYTQJFJC,XXYTQJFJA,XXYTQCFJC,XXYTQCFJA\"},{\"id\":\"ae0a1cc0-6ddf-45b8-82d0-51d6b34ad630\",\"text\":\"河北兴浦汽车制动器有限公司\",\"code\":\"100128\",\"keyword\":\"HBXPQJZDQYXGS,HBXPQCZDQYXGS\"},{\"id\":\"aa9ddf53-e4b8-4e36-8063-6f215e9b9407\",\"text\":\"邢台市龙洋机械制造有限公司\",\"code\":\"100129\",\"keyword\":\"XTSLYJXZZYXGS\"},{\"id\":\"3de2ed7f-8155-40b5-9bb3-b30313712040\",\"text\":\"湖北楚欣汽车销售公司\",\"code\":\"100130\",\"keyword\":\"HBCXQJXSGS,HBCXQCXSGS\"},{\"id\":\"a9ae4dfa-330f-4d1c-b420-d3ba0ee0b6b6\",\"text\":\"湘潭迅东机电科技有限公司\",\"code\":\"100131\",\"keyword\":\"XTXDJDKJYXGS\"},{\"id\":\"e0c48427-33e0-443e-9b03-3c2042d9e249\",\"text\":\"福州瑞利贸易有限公司\",\"code\":\"100132\",\"keyword\":\"FZRLMYYXGS\"},{\"id\":\"25386c99-9abc-432d-b632-efa796796827\",\"text\":\"厦门市鑫美汽车配件有限公司\",\"code\":\"100133\",\"keyword\":\"XMSXMQJPJYXGS,XMSXMQCPJYXGS,SMSXMQJPJYXGS,SMSXMQCPJYXGS\"},{\"id\":\"f94add9c-2910-439a-af5f-0d0174f75ce8\",\"text\":\"北京纳天科技有限公司\",\"code\":\"100134\",\"keyword\":\"BJNTKJYXGS\"},{\"id\":\"8a89e1bf-9389-40ba-8da1-e09376e2a046\",\"text\":\"北京瑞博汽车零部件有限公司\",\"code\":\"100135\",\"keyword\":\"BJRBQJLBJYXGS,BJRBQCLBJYXGS\"},{\"id\":\"75837bc2-6959-46f3-b1bb-5a66022b21ca\",\"text\":\"天津鑫正拓达轴承贸易有限公司\",\"code\":\"100136\",\"keyword\":\"TJXZTDZCMYYXGS\"},{\"id\":\"8e442488-2c8b-4e03-88ce-13ed5845889f\",\"text\":\"中铝国际工程公司\",\"code\":\"100137\",\"keyword\":\"ZLGJGCGS\"},{\"id\":\"be2a1881-89f4-48be-9c26-25fe0359924d\",\"text\":\"中国瑞林工程技术有限公司\",\"code\":\"100138\",\"keyword\":\"ZGRLGCJZYXGS,ZGRLGCJSYXGS\"},{\"id\":\"36fa9f7e-3281-4725-b284-ddf0a2e65bde\",\"text\":\"山东省冶金设计院\",\"code\":\"100139\",\"keyword\":\"SDSYJSJY,SDXYJSJY\"},{\"id\":\"53fed6f4-b67c-451a-a1a0-b0ed986ce519\",\"text\":\"中国核电工程有限公司\",\"code\":\"100140\",\"keyword\":\"ZGHDGCYXGS\"},{\"id\":\"b40ba0e8-dfe9-431d-9da3-73629037f385\",\"text\":\"中国水电顾问集团华东勘测设计院\",\"code\":\"100141\",\"keyword\":\"ZGSDGWJTHDKCSJY\"},{\"id\":\"8fe4d0e0-9b2a-46c8-9a6b-1a1b01d48c4c\",\"text\":\"中国电力顾问集团西北电力设计院\",\"code\":\"100142\",\"keyword\":\"ZGDLGWJTXBDLSJY\"},{\"id\":\"7f8cc56b-47c0-4afe-98a2-2a7956a8ca4f\",\"text\":\"中国电力顾问集团东北电力设计院\",\"code\":\"100143\",\"keyword\":\"ZGDLGWJTDBDLSJY\"},{\"id\":\"a0cac21c-2f3e-4ae0-9895-b03bc196fe3a\",\"text\":\"中国电力顾问集团西南电力设计院\",\"code\":\"100144\",\"keyword\":\"ZGDLGWJTXNDLSJY\"},{\"id\":\"c4a5b6de-caf8-47b9-98fb-ca2f914d59fe\",\"text\":\"中国电力顾问集团华东电力设计院\",\"code\":\"100145\",\"keyword\":\"ZGDLGWJTHDDLSJY\"},{\"id\":\"b617604d-7dc6-48c6-b982-e0601bf0f720\",\"text\":\"现代设计集团上海建筑设计院\",\"code\":\"100146\",\"keyword\":\"XDSJJTSHJZSJY\"},{\"id\":\"d4ec8f1b-099b-46a9-8e55-961ab8c308db\",\"text\":\"现代设计集团上海都市设计院\",\"code\":\"100147\",\"keyword\":\"XDSJJTSHDSSJY\"},{\"id\":\"c3d8769e-ccaf-4675-8e1f-349199a3ac33\",\"text\":\"山东同圆设计集团\",\"code\":\"100148\",\"keyword\":\"SDTYSJJT\"},{\"id\":\"028e4fbf-5b08-4554-8fa0-9c555db9ed9e\",\"text\":\"广西华蓝设计集团\",\"code\":\"100149\",\"keyword\":\"GXHLSJJT,AXHLSJJT\"},{\"id\":\"b42b46a3-26fa-47b7-94e2-12909f6c7bf0\",\"text\":\"济南人防建筑设计院\",\"code\":\"100150\",\"keyword\":\"JNRFJZSJY\"},{\"id\":\"36815670-af42-4756-ae30-b1b1b29e2036\",\"text\":\"北京市园林古建设计院\",\"code\":\"100151\",\"keyword\":\"BJSYLGJSJY\"},{\"id\":\"c029e27a-9741-4a10-a630-459be9b3ed90\",\"text\":\"中铁城市规划设计院\",\"code\":\"100152\",\"keyword\":\"ZTCSGHSJY\"},{\"id\":\"e137e6a7-5a80-4a85-8505-f5dac87902d3\",\"text\":\"四川国恒建筑设计有限公司\",\"code\":\"100153\",\"keyword\":\"SCGHJZSJYXGS\"},{\"id\":\"e03bc67b-5caf-4b2d-9b76-7a2c092d3e5d\",\"text\":\"北京三磊建筑设计有限公司\",\"code\":\"100154\",\"keyword\":\"BJSLJZSJYXGS\"},{\"id\":\"78162e75-475f-4540-a87f-4af3e9ac62c0\",\"text\":\"大连市建筑设计研究院有限公司\",\"code\":\"100155\",\"keyword\":\"DLSJZSJYJYYXGS\"},{\"id\":\"d4b3e726-9f8a-42f2-a4e2-8a2ec73ea065\",\"text\":\"安徽省电力设计院\",\"code\":\"100156\",\"keyword\":\"AHSDLSJY,AHXDLSJY\"},{\"id\":\"3c6e4d26-d665-4466-b315-3f7aceda7cf1\",\"text\":\"贵州省交通规划勘察设计研究院股份有限公司\",\"code\":\"100157\",\"keyword\":\"GZSJTGHKCSJYJYGFYXGS,GZXJTGHKCSJYJYGFYXGS\"},{\"id\":\"39778e60-e443-4787-b6c1-e07763725def\",\"text\":\"中交路桥技术有限公司\",\"code\":\"100158\",\"keyword\":\"ZJLQJZYXGS,ZJLQJSYXGS\"},{\"id\":\"5b238085-2c0a-48dc-b82e-09fe1f808575\",\"text\":\"河海大学设计院\",\"code\":\"100159\",\"keyword\":\"HHDXSJY\"},{\"id\":\"6b2e3047-3127-4620-94f2-0c887fc37831\",\"text\":\"重庆市水利电力建筑勘测设计研究院\",\"code\":\"100160\",\"keyword\":\"ZQSSLDLJZKCSJYJY,CQSSLDLJZKCSJYJY\"},{\"id\":\"014065ac-2ebb-465c-ad6e-415ff534d47f\",\"text\":\"神华宁煤能源工程公司\",\"code\":\"100161\",\"keyword\":\"SHNMNYGCGS\"},{\"id\":\"027123ad-94d5-4788-9fbf-138e9472bb0b\",\"text\":\"江西省天驰高速科技发展有限公司\",\"code\":\"100162\",\"keyword\":\"JXSTCGSKJFZYXGS,JXXTCGSKJFZYXGS\"},{\"id\":\"2571e2b5-1c4e-44e4-a700-18828fdc3f50\",\"text\":\"陕西省公路勘察设计研究院\",\"code\":\"100163\",\"keyword\":\"SXSGLKCSJYJY,SXXGLKCSJYJY\"},{\"id\":\"0dcfdd5b-2c0a-4272-93e6-e5d2b4989da6\",\"text\":\"大连市市政设计研究院有限公司\",\"code\":\"100164\",\"keyword\":\"DLSSZSJYJYYXGS\"},{\"id\":\"cd112ba0-abe0-46b6-b8e3-b2bdde2b028d\",\"text\":\"济南市政设计院集团有限公司\",\"code\":\"100165\",\"keyword\":\"JNSZSJYJTYXGS\"},{\"id\":\"5b734763-2085-4fd0-ba4e-16c08c3db4f9\",\"text\":\"天津华淼工程设计有限公司\",\"code\":\"100166\",\"keyword\":\"TJHMGCSJYXGS\"},{\"id\":\"5f3dd251-3df4-4b15-8be6-7171d99589a9\",\"text\":\"福州城建设计院\",\"code\":\"100167\",\"keyword\":\"FZCJSJY\"},{\"id\":\"070d83fa-65fd-4bde-a58a-1abff0dc3fd1\",\"text\":\"上海浦东新区规划设计院\",\"code\":\"100168\",\"keyword\":\"SHPDXQGHSJY,SHPDXOGHSJY\"},{\"id\":\"ea0ce956-24b3-4286-83be-f3cf9d12927b\",\"text\":\"厦门市政设计院有限公司\",\"code\":\"100169\",\"keyword\":\"XMSZSJYYXGS,SMSZSJYYXGS\"},{\"id\":\"7811d748-fa8e-4624-aa42-089c479872ea\",\"text\":\"长春城乡规划设计研究院\",\"code\":\"100170\",\"keyword\":\"ZCCXGHSJYJY,CCCXGHSJYJY\"},{\"id\":\"3a33c63f-4cda-4a78-b2a0-f5f64c9c2e6b\",\"text\":\"太原理工大学建筑设计研究院\",\"code\":\"100171\",\"keyword\":\"TYLGDXJZSJYJY\"},{\"id\":\"b25a5046-f6eb-4d6c-9cf4-28f8b15efa50\",\"text\":\"云南省交通规划设计院\",\"code\":\"100172\",\"keyword\":\"YNSJTGHSJY,YNXJTGHSJY\"},{\"id\":\"3999746f-8a66-4878-ab60-56ebdc7b7e4d\",\"text\":\"新疆石油勘察设计研究院(有限公司)\",\"code\":\"100173\",\"keyword\":\"XJSYKCSJYJYYXGS,XJDYKCSJYJYYXGS\"},{\"id\":\"910efec6-d547-43e8-8ed3-432893dba5a9\",\"text\":\"天津电力设计院\",\"code\":\"100174\",\"keyword\":\"TJDLSJY\"},{\"id\":\"193b480f-2e20-4af4-96d4-42368f3ad500\",\"text\":\"中国联合工程公司\",\"code\":\"100175\",\"keyword\":\"ZGLHGCGS,ZGLGGCGS\"},{\"id\":\"01f2cf7c-8eeb-4373-9c1d-f4755262ea00\",\"text\":\"机械第一设计研究院\",\"code\":\"100176\",\"keyword\":\"JXDYSJYJY\"},{\"id\":\"dde2ceae-8f99-4a15-92af-15b83dff4d6c\",\"text\":\"中交公路规划设计院\",\"code\":\"100177\",\"keyword\":\"ZJGLGHSJY\"},{\"id\":\"6ce05827-8237-4ede-9d1f-b2bd997e5f4e\",\"text\":\"中交第一公路设计院\",\"code\":\"100178\",\"keyword\":\"ZJDYGLSJY\"},{\"id\":\"05dcec72-d731-4c32-87f8-077783c9e5c9\",\"text\":\"中交水运规划设计院\",\"code\":\"100179\",\"keyword\":\"ZJSYGHSJY\"},{\"id\":\"0eb8ed9f-33e3-499c-b1af-88770a394733\",\"text\":\"中交第一航务工程勘察设计院\",\"code\":\"100180\",\"keyword\":\"ZJDYHWGCKCSJY\"},{\"id\":\"de9eb0f8-4bf3-4e83-b34f-58d280f82a54\",\"text\":\"江苏省交通规划设计院\",\"code\":\"100181\",\"keyword\":\"JSSJTGHSJY,JSXJTGHSJY\"},{\"id\":\"42976dad-b069-415e-9b82-eb82687a0337\",\"text\":\"中铁第四勘察设计院\",\"code\":\"100182\",\"keyword\":\"ZTDSKCSJY\"},{\"id\":\"f69a0aa8-eacd-4c0e-80e9-2a86b810c2e7\",\"text\":\"中煤西安设计工程公司\",\"code\":\"100183\",\"keyword\":\"ZMXASJGCGS\"},{\"id\":\"c86e5f6e-e520-479b-aeab-9d8ccf6df582\",\"text\":\"煤炭工业济南设计院\",\"code\":\"100184\",\"keyword\":\"MTGYJNSJY\"},{\"id\":\"389f6b7c-d9e6-40cf-bcde-441a59d4e39f\",\"text\":\"长江勘测规划设计研究院\",\"code\":\"100185\",\"keyword\":\"ZJKCGHSJYJY,CJKCGHSJYJY\"},{\"id\":\"347c8975-6572-48af-9853-93f13b719e0c\",\"text\":\"浙江省水利电力勘测设计院\",\"code\":\"100186\",\"keyword\":\"ZJSSLDLKCSJY,ZJXSLDLKCSJY\"},{\"id\":\"e1e1d8f9-230c-4eaf-86fd-34f044182147\",\"text\":\"中石化胜利油田设计院\",\"code\":\"100187\",\"keyword\":\"ZSHSLYTSJY,ZDHSLYTSJY\"},{\"id\":\"565f7b52-5b3c-423d-ba27-2b8db5bb1bc0\",\"text\":\"浙江天正工程设计公司\",\"code\":\"100188\",\"keyword\":\"ZJTZGCSJGS\"},{\"id\":\"6328e535-035f-4b86-ad1e-975d2c7bd71d\",\"text\":\"中国市政西北设计院\",\"code\":\"100189\",\"keyword\":\"ZGSZXBSJY\"},{\"id\":\"c5ea1162-19df-496b-b5a5-f7b793e6236c\",\"text\":\"中国医药联合工程公司\",\"code\":\"100190\",\"keyword\":\"ZGYYLHGCGS,ZGYYLGGCGS\"},{\"id\":\"fdc00925-0259-4b52-9580-14d9f7a974a6\",\"text\":\"上海杰作设计有限公司(方案公司)\",\"code\":\"100191\",\"keyword\":\"SHJZSJYXGSFAGS\"},{\"id\":\"9e73316c-6d78-4fa6-a468-9718b102aee2\",\"text\":\"哈尔滨市城市规划设计院\",\"code\":\"100192\",\"keyword\":\"HEBSCSGHSJY\"},{\"id\":\"77085a8a-7ed6-4838-9669-9c2f925f8c1d\",\"text\":\"北京玉龙石化工程有限公司\",\"code\":\"100193\",\"keyword\":\"BJYLSHGCYXGS,BJYLDHGCYXGS\"},{\"id\":\"8c3c4f29-b6b3-4381-acf3-5dfe82e4d626\",\"text\":\"长岭炼化岳阳工程设计有限公司\",\"code\":\"100194\",\"keyword\":\"ZLLHYYGCSJYXGS,CLLHYYGCSJYXGS\"},{\"id\":\"f16b42f9-62c7-4c0c-bde6-70ae9f40ca34\",\"text\":\"沈阳测绘勘测设计研究院\",\"code\":\"100195\",\"keyword\":\"SYCHKCSJYJY,CYCHKCSJYJY\"},{\"id\":\"bb615453-1bc4-44e0-afa0-6e93b28f7c82\",\"text\":\"合肥勘察测绘设计院\",\"code\":\"100196\",\"keyword\":\"HFKCCHSJY,GFKCCHSJY\"},{\"id\":\"39ff5412-5966-4a6e-9e87-433ee28dd4bb\",\"text\":\"贵阳铝镁设计院\",\"code\":\"100197\",\"keyword\":\"GYLMSJY\"},{\"id\":\"0dd735fe-2839-4363-a17d-f3282f1895c4\",\"text\":\"中国船舶及海洋工程设计研究院\",\"code\":\"100198\",\"keyword\":\"ZGCBJHYGCSJYJY\"},{\"id\":\"14808a17-cb67-4443-be92-2ece27501797\",\"text\":\"青岛市人防建筑设计研究院\",\"code\":\"100199\",\"keyword\":\"QDSRFJZSJYJY\"},{\"id\":\"41dd4bee-cd7d-413b-bbe4-55cba9e88aa6\",\"text\":\"中国舰船研究设计中心701研究所\",\"code\":\"100200\",\"keyword\":\"ZGJCYJSJZXYJS\"},{\"id\":\"14935fff-d00f-4dfb-97c6-bda5e6a38a9d\",\"text\":\"中国有色金属长沙勘察设计研究院\",\"code\":\"100201\",\"keyword\":\"ZGYSJZZSKCSJYJY,ZGYSJZCSKCSJYJY,ZGYSJSZSKCSJYJY,ZGYSJSCSKCSJYJY\"},{\"id\":\"39d07d25-3d56-4029-b0e6-32ce913e51a7\",\"text\":\"昆明诚信勘察设计院\",\"code\":\"100202\",\"keyword\":\"KMCXKCSJY\"},{\"id\":\"96e6e579-fb95-4b36-9345-28e6e8ff9821\",\"text\":\"中冶建研设计院环保事业部\",\"code\":\"100203\",\"keyword\":\"ZYJYSJYHBSYB\"},{\"id\":\"e89d7d36-985f-4cba-9e19-d0976b15be95\",\"text\":\"福建省建筑设计研究院\",\"code\":\"100204\",\"keyword\":\"FJSJZSJYJY,FJXJZSJYJY\"},{\"id\":\"452efea8-13b8-43c2-8ef4-7a263184f766\",\"text\":\"四川海辰工程设计院有限公司\",\"code\":\"100205\",\"keyword\":\"SCHCGCSJYYXGS\"},{\"id\":\"0e27510e-e430-4f75-a058-cd0dfa15672c\",\"text\":\"中冶建筑设计研究总院\",\"code\":\"100206\",\"keyword\":\"ZYJZSJYJZY\"},{\"id\":\"1fb79091-4f4d-44ee-9cfa-3bf5d9945407\",\"text\":\"中南建筑设计院股份有限公司 \",\"code\":\"100207\",\"keyword\":\"ZNJZSJYGFYXGS\"},{\"id\":\"af2fb3c8-c51f-4cb2-b2d0-367d52308e11\",\"text\":\"云南怡成建筑设计公司\",\"code\":\"100208\",\"keyword\":\"YNYCJZSJGS\"},{\"id\":\"7962e095-0e8b-4c2d-9df2-6998d53d9337\",\"text\":\"浙江华坤建筑设计院有限公司\",\"code\":\"100209\",\"keyword\":\"ZJHKJZSJYYXGS\"},{\"id\":\"c61406ed-0fd5-4df5-bf3b-8d0fca20e726\",\"text\":\"唐山铭嘉建筑设计咨询有限公司\",\"code\":\"100210\",\"keyword\":\"TSMJJZSJZXYXGS\"},{\"id\":\"aa207db4-6530-4ede-9599-61464967888b\",\"text\":\"河南省电力勘测设计院\",\"code\":\"100211\",\"keyword\":\"HNSDLKCSJY,HNXDLKCSJY\"},{\"id\":\"1209412d-95bb-4c40-845d-28ba5634ffdd\",\"text\":\"河北省电力勘测设计院\",\"code\":\"100212\",\"keyword\":\"HBSDLKCSJY,HBXDLKCSJY\"}]"; + List> data = JsonUtil.getJsonToListMap(json); + if (!StringUtils.isEmpty(page.getKeyword())) { + data = data.stream().filter(t -> String.valueOf(t.get("code")).contains(page.getKeyword()) || String.valueOf(t.get("keyword")).contains(page.getKeyword()) || String.valueOf(t.get("text")).contains(page.getKeyword())).collect(Collectors.toList()); + } + data = data.stream().limit(10).collect(Collectors.toList()); + List list = JsonUtil.getJsonToList(data, OrderCustomerVO.class); + ListVO vo = new ListVO(); + vo.setList(list); + return ActionResult.success(vo); + } + + /** + * 获取商品列表 + * + * @param page 分页模型 + * @return + */ + @Operation(summary = "获取商品列表") + @GetMapping("/Goods") + @SaCheckPermission("extend.order") + public ActionResult> goodsList(Page page) { + String json = "[{\"id\":\"692110120107\",\"code\":\"106423\",\"text\":\"蜡笔小新棒棒冰\",\"specifications\":\"85g\",\"unit\":\"支\",\"price\":\"0.81\",\"keyword\":\"ZBXXBBB,LBXXBBB\"},{\"id\":\"692364427858\",\"code\":\"974498\",\"text\":\"蒙牛纯甄酸牛奶原味\",\"specifications\":\"200g\",\"unit\":\"盒\",\"price\":\"4.46\",\"keyword\":\"MNCZSNNYW\"},{\"id\":\"690799251257\",\"code\":\"416821\",\"text\":\"伊利安慕希希腊酸奶\",\"specifications\":\"205g\",\"unit\":\"包\",\"price\":\"4.46\",\"keyword\":\"YLAMXXXSN,YLAMXXLSN\"},{\"id\":\"690102819104\",\"code\":\"524868\",\"text\":\"白沙精品香烟\",\"specifications\":\"\",\"unit\":\"包\",\"price\":\"7.29\",\"keyword\":\"BSJPXY\"},{\"id\":\"690040452111\",\"code\":\"828691\",\"text\":\"天友新鲜杯大红枣酸奶\",\"specifications\":\"160g\",\"unit\":\"杯\",\"price\":\"2.43\",\"keyword\":\"TYXXBDHZSN,TYXXBDGZSN\"},{\"id\":\"692364422345\",\"code\":\"107961\",\"text\":\"蒙牛纯牛奶\",\"specifications\":\"250ml\",\"unit\":\"盒\",\"price\":\"2.27\",\"keyword\":\"MNCNN\"},{\"id\":\"690102819349\",\"code\":\"532214\",\"text\":\"芙蓉王翻盖香烟\",\"specifications\":\"\",\"unit\":\"包\",\"price\":\"19.44\",\"keyword\":\"FRWFGXY\"},{\"id\":\"690799210027\",\"code\":\"111311\",\"text\":\"伊利纯牛奶\",\"specifications\":\"250ml\",\"unit\":\"盒\",\"price\":\"2.35\",\"keyword\":\"YLCNN\"},{\"id\":\"692586153106\",\"code\":\"111594\",\"text\":\"旺旺碎冰冰草莓味\",\"specifications\":\"78g\",\"unit\":\"支\",\"price\":\"0.81\",\"keyword\":\"WWSBBCMW\"},{\"id\":\"690103561369\",\"code\":\"469391\",\"text\":\"青岛清醇啤酒8度\",\"specifications\":\"330ml\",\"unit\":\"厅\",\"price\":\"2.03\",\"keyword\":\"QDQCPJD\"},{\"id\":\"694935220140\",\"code\":\"898237\",\"text\":\"雪花清爽8度听装啤酒\",\"specifications\":\"330ml\",\"unit\":\"厅\",\"price\":\"2.35\",\"keyword\":\"XHQSDTZPJ\"},{\"id\":\"693262090005\",\"code\":\"869640\",\"text\":\"徐七二白凉粉\",\"specifications\":\"50g\",\"unit\":\"盒\",\"price\":\"1.62\",\"keyword\":\"XQEBLF\"},{\"id\":\"693139200639\",\"code\":\"449683\",\"text\":\"蓝舰果味啤酒饮料\",\"specifications\":\"320ml\",\"unit\":\"厅\",\"price\":\"1.62\",\"keyword\":\"LJGWPJYL\"},{\"id\":\"692416071401\",\"code\":\"448472\",\"text\":\"无穷农场盐焗鸡蛋\",\"specifications\":\"30g\",\"unit\":\"盒\",\"price\":\"1.62\",\"keyword\":\"WQNCYJJD,MQNCYJJD\"},{\"id\":\"692586153183\",\"code\":\"111593\",\"text\":\"旺旺碎冰冰乳酸原味\",\"specifications\":\"78g\",\"unit\":\"支\",\"price\":\"0.81\",\"keyword\":\"WWSBBRSYW\"},{\"id\":\"692586153114\",\"code\":\"111595\",\"text\":\"旺旺碎冰冰葡萄味\",\"specifications\":\"78g\",\"unit\":\"支\",\"price\":\"0.81\",\"keyword\":\"WWSBBPTW\"},{\"id\":\"693273131006\",\"code\":\"473563\",\"text\":\"北京蓝氏经典菠萝啤\",\"specifications\":\"320ml\",\"unit\":\"厅\",\"price\":\"1.62\",\"keyword\":\"BJLZJDBLP,BJLSJDBLP\"},{\"id\":\"690103520063\",\"code\":\"493758\",\"text\":\"青岛崂山啤酒8度\",\"specifications\":\"330ml\",\"unit\":\"厅\",\"price\":\"1.62\",\"keyword\":\"QDLSPJD\"},{\"id\":\"692116850925\",\"code\":\"111576\",\"text\":\"农夫山泉\",\"specifications\":\"550ml\",\"unit\":\"瓶\",\"price\":\"1.46\",\"keyword\":\"NFSQ\"},{\"id\":\"692586153117\",\"code\":\"111598\",\"text\":\"旺旺碎冰冰菠萝\",\"specifications\":\"78g\",\"unit\":\"支\",\"price\":\"0.81\",\"keyword\":\"WWSBBBL\"},{\"id\":\"692250782275\",\"code\":\"466655\",\"text\":\"陈克明鸡蛋精制挂面\",\"specifications\":\"750g\",\"unit\":\"包\",\"price\":\"5.27\",\"keyword\":\"CKMJDJZGM\"},{\"id\":\"690102819101\",\"code\":\"107319\",\"text\":\"白沙软包香烟\",\"specifications\":\"\",\"unit\":\"包\",\"price\":\"4.05\",\"keyword\":\"BSRBXY\"},{\"id\":\"693686921537\",\"code\":\"465668\",\"text\":\"味芝元卤鸭掌\",\"specifications\":\"32g\",\"unit\":\"包\",\"price\":\"1.62\",\"keyword\":\"WZYLYZ\"},{\"id\":\"692293923162\",\"code\":\"570758\",\"text\":\"旺旺碎碎冰可乐味\",\"specifications\":\"78g\",\"unit\":\"支\",\"price\":\"0.81\",\"keyword\":\"WWSSBKYW,WWSSBKLW\"},{\"id\":\"690799251205\",\"code\":\"896808\",\"text\":\"伊利果粒优酸乳草莓味\",\"specifications\":\"245ml\",\"unit\":\"盒\",\"price\":\"2.43\",\"keyword\":\"YLGLYSRCMW\"},{\"id\":\"692364426850\",\"code\":\"781761\",\"text\":\"蒙牛真果粒草莓味\",\"specifications\":\"250g\",\"unit\":\"盒\",\"price\":\"2.84\",\"keyword\":\"MNZGLCMW\"},{\"id\":\"690289023413\",\"code\":\"860522\",\"text\":\"双汇香辣热狗肠\",\"specifications\":\"35g\",\"unit\":\"支\",\"price\":\"0.81\",\"keyword\":\"SHXLRGC\"},{\"id\":\"690289023416\",\"code\":\"860521\",\"text\":\"双汇玉米热狗肠\",\"specifications\":\"40g\",\"unit\":\"支\",\"price\":\"0.81\",\"keyword\":\"SHYMRGC\"},{\"id\":\"692586153116\",\"code\":\"111597\",\"text\":\"旺旺碎冰冰柑桔味\",\"specifications\":\"78g\",\"unit\":\"支\",\"price\":\"0.81\",\"keyword\":\"WWSBBGJW\"},{\"id\":\"694896010156\",\"code\":\"866442\",\"text\":\"哈尔滨冰爽啤酒\",\"specifications\":\"330ml\",\"unit\":\"瓶\",\"price\":\"2.27\",\"keyword\":\"HEBBSPJ\"},{\"id\":\"692586153182\",\"code\":\"111592\",\"text\":\"旺旺碎冰冰桃子味\",\"specifications\":\"78g\",\"unit\":\"支\",\"price\":\"0.81\",\"keyword\":\"WWSBBTZW\"},{\"id\":\"695476743038\",\"code\":\"898085\",\"text\":\"可口可乐雪碧\",\"specifications\":\"330ml\",\"unit\":\"厅\",\"price\":\"2.03\",\"keyword\":\"KKKYXB,KKKLXB\"},{\"id\":\"690102822742\",\"code\":\"464956\",\"text\":\"龙凤呈祥(新朝天门)\",\"specifications\":\"\",\"unit\":\"包\",\"price\":\"8.10\",\"keyword\":\"LFCXXZTM,LFCXXCTM\"},{\"id\":\"695056110013\",\"code\":\"465775\",\"text\":\"迪怩司脆脆冰水蜜桃味\",\"specifications\":\"82ml\",\"unit\":\"支\",\"price\":\"0.81\",\"keyword\":\"DNSCCBSMTW\"},{\"id\":\"690799251355\",\"code\":\"468959\",\"text\":\"伊利安慕希希腊酸奶香草味\",\"specifications\":\"205g\",\"unit\":\"盒\",\"price\":\"4.46\",\"keyword\":\"YLAMXXXSNXCW,YLAMXXLSNXCW\"},{\"id\":\"690128599121\",\"code\":\"807160\",\"text\":\"怡宝饮用纯净水\",\"specifications\":\"555ml\",\"unit\":\"瓶\",\"price\":\"1.46\",\"keyword\":\"YBYYCJS\"},{\"id\":\"690442290629\",\"code\":\"490952\",\"text\":\"科迪原生牛奶\",\"specifications\":\"180ml\",\"unit\":\"包\",\"price\":\"2.43\",\"keyword\":\"KDYSNN\"},{\"id\":\"695476741038\",\"code\":\"898083\",\"text\":\"可口可乐\",\"specifications\":\"330ml\",\"unit\":\"厅\",\"price\":\"2.03\",\"keyword\":\"KKKY,KKKL\"},{\"id\":\"694443701605\",\"code\":\"418138\",\"text\":\"小样乳酸菌乳原味\",\"specifications\":\"4*100ml\",\"unit\":\"板\",\"price\":\"6.48\",\"keyword\":\"XYRSJRYW\"},{\"id\":\"692481080131\",\"code\":\"827499\",\"text\":\"卡士调味鲜酪乳原味\",\"specifications\":\"120g\",\"unit\":\"杯\",\"price\":\"2.84\",\"keyword\":\"QSTWXLRYW,QSDWXLRYW,KSTWXLRYW,KSDWXLRYW\"},{\"id\":\"690152428238\",\"code\":\"532431\",\"text\":\"津威强化锌酸奶\",\"specifications\":\"95ml\",\"unit\":\"板\",\"price\":\"3.65\",\"keyword\":\"JWQHXSN,JWJHXSN\"},{\"id\":\"690799251285\",\"code\":\"438652\",\"text\":\"伊利安慕希蓝莓味金属包\",\"specifications\":\"205g\",\"unit\":\"盒\",\"price\":\"4.70\",\"keyword\":\"YLAMXLMWJZB,YLAMXLMWJSB\"},{\"id\":\"692364428269\",\"code\":\"480106\",\"text\":\"蒙牛纯甄风味酸奶牛奶芝士味\",\"specifications\":\"200g\",\"unit\":\"盒\",\"price\":\"4.86\",\"keyword\":\"MNCZFWSNNNZSW\"},{\"id\":\"690208389864\",\"code\":\"469458\",\"text\":\"娃哈哈桂圆莲子八宝粥\",\"specifications\":\"280g\",\"unit\":\"瓶\",\"price\":\"3.24\",\"keyword\":\"WHHGYLZBBZ,WHHGYLZBBY\"},{\"id\":\"690102807576\",\"code\":\"524873\",\"text\":\"中华翻盖香烟\",\"specifications\":\"\",\"unit\":\"包\",\"price\":\"36.45\",\"keyword\":\"ZHFGXY\"},{\"id\":\"692364428357\",\"code\":\"485055\",\"text\":\"蒙牛真果粒蓝莓\",\"specifications\":\"\",\"unit\":\"盒\",\"price\":\"2.84\",\"keyword\":\"MNZGLLM\"},{\"id\":\"692777090182\",\"code\":\"868462\",\"text\":\"山花草莓杯酸\",\"specifications\":\"100g\",\"unit\":\"杯\",\"price\":\"1.62\",\"keyword\":\"SHCMBS\"},{\"id\":\"695606400042\",\"code\":\"458194\",\"text\":\"雪天绿色加碘精制深井矿盐\",\"specifications\":\"400g\",\"unit\":\"盒\",\"price\":\"1.62\",\"keyword\":\"XTLSJDJZSJKY\"},{\"id\":\"692777090069\",\"code\":\"532429\",\"text\":\"山花纯牛奶\",\"specifications\":\"220ml\",\"unit\":\"包\",\"price\":\"2.03\",\"keyword\":\"SHCNN\"},{\"id\":\"690208388108\",\"code\":\"106964\",\"text\":\"娃哈哈AD钙\",\"specifications\":\"220g\",\"unit\":\"排\",\"price\":\"5.67\",\"keyword\":\"WHHG\"},{\"id\":\"692777090181\",\"code\":\"868460\",\"text\":\"山花原味杯酸\",\"specifications\":\"100g\",\"unit\":\"杯\",\"price\":\"1.62\",\"keyword\":\"SHYWBS\"},{\"id\":\"695636733868\",\"code\":\"916213\",\"text\":\"王老吉凉茶\",\"specifications\":\"310ml\",\"unit\":\"灌\",\"price\":\"3.24\",\"keyword\":\"WLJLC\"},{\"id\":\"690152413833\",\"code\":\"871920\",\"text\":\"津威彩装乳酸菌饮品\",\"specifications\":\"100ml\",\"unit\":\"排\",\"price\":\"6.89\",\"keyword\":\"JWCZRSJYP\"},{\"id\":\"692356788010\",\"code\":\"917231\",\"text\":\"咪咪是味条\",\"specifications\":\"20g\",\"unit\":\"包\",\"price\":\"0.41\",\"keyword\":\"MMSWT\"},{\"id\":\"692586153122\",\"code\":\"845220\",\"text\":\"旺旺碎碎冰家庭号\",\"specifications\":\"85ml*8\",\"unit\":\"袋\",\"price\":\"6.48\",\"keyword\":\"WWSSBJTH\"},{\"id\":\"690799251139\",\"code\":\"862009\",\"text\":\"伊利红谷礼盒苗条装\",\"specifications\":\"250ml\",\"unit\":\"盒\",\"price\":\"2.43\",\"keyword\":\"YLHYLHMTZ,YLHGLHMTZ,YLGYLHMTZ,YLGGLHMTZ\"},{\"id\":\"697046974031\",\"code\":\"491631\",\"text\":\"盐小厨加碘食盐绿袋\",\"specifications\":\"400g\",\"unit\":\"包\",\"price\":\"1.62\",\"keyword\":\"YXCJDSYLD\"},{\"id\":\"694791590801\",\"code\":\"825860\",\"text\":\"小号购物袋\",\"specifications\":\"24*40\",\"unit\":\"个\",\"price\":\"0.16\",\"keyword\":\"XHGWD\"},{\"id\":\"693359561616\",\"code\":\"906227\",\"text\":\"恭兵合装豆干\",\"specifications\":\"25g\",\"unit\":\"包\",\"price\":\"0.81\",\"keyword\":\"GBHZDG,GBGZDG\"},{\"id\":\"692364426851\",\"code\":\"781762\",\"text\":\"蒙牛真果粒黄桃味\",\"specifications\":\"250g\",\"unit\":\"盒\",\"price\":\"2.84\",\"keyword\":\"MNZGLHTW\"},{\"id\":\"695606400043\",\"code\":\"460279\",\"text\":\"雪天海藻碘盐\",\"specifications\":\"320g\",\"unit\":\"包\",\"price\":\"2.03\",\"keyword\":\"XTHZDY\"},{\"id\":\"693686770007\",\"code\":\"446585\",\"text\":\"土豆粉\",\"specifications\":\"\",\"unit\":\"袋\",\"price\":\"2.03\",\"keyword\":\"TDF\"},{\"id\":\"693466508765\",\"code\":\"856955\",\"text\":\"蒙牛优益C活性乳酸菌原味\",\"specifications\":\"340ml\",\"unit\":\"瓶\",\"price\":\"5.27\",\"keyword\":\"MNYYHXRSJYW\"},{\"id\":\"690799210001\",\"code\":\"106924\",\"text\":\"伊利优酸乳草莓味\",\"specifications\":\"250ml\",\"unit\":\"盒\",\"price\":\"1.62\",\"keyword\":\"YLYSRCMW\"},{\"id\":\"692364424293\",\"code\":\"106906\",\"text\":\"蒙牛酸酸乳草莓味\",\"specifications\":\"250ml\",\"unit\":\"盒\",\"price\":\"1.46\",\"keyword\":\"MNSSRCMW\"},{\"id\":\"690102819102\",\"code\":\"107278\",\"text\":\"白沙翻盖白沙\",\"specifications\":\"\",\"unit\":\"包\",\"price\":\"4.46\",\"keyword\":\"BSFGBS\"},{\"id\":\"694791590802\",\"code\":\"825861\",\"text\":\"中号购物袋\",\"specifications\":\"30*50\",\"unit\":\"个\",\"price\":\"0.16\",\"keyword\":\"ZHGWD\"},{\"id\":\"690102803974\",\"code\":\"860194\",\"text\":\"贵烟(硬黄精品)\",\"specifications\":\"\",\"unit\":\"包\",\"price\":\"10.13\",\"keyword\":\"GYYHJP\"},{\"id\":\"693472810060\",\"code\":\"862349\",\"text\":\"福太子石锅剁椒鱼条\",\"specifications\":\"15g\",\"unit\":\"包\",\"price\":\"0.81\",\"keyword\":\"FTZSGDJYT,FTZDGDJYT\"},{\"id\":\"695010380149\",\"code\":\"947876\",\"text\":\"丝美乐青花系列3层软抽\",\"specifications\":\"402张\",\"unit\":\"包\",\"price\":\"3.24\",\"keyword\":\"SMYQHXLCRC,SMYQHJLCRC,SMLQHXLCRC,SMLQHJLCRC\"},{\"id\":\"690799251195\",\"code\":\"896814\",\"text\":\"伊利QQ星营养果汁酸奶草莓味\",\"specifications\":\"200ml\",\"unit\":\"瓶\",\"price\":\"2.43\",\"keyword\":\"YLXYYGZSNCMW\"},{\"id\":\"693472810059\",\"code\":\"862351\",\"text\":\"福太子老坛山椒鱼条\",\"specifications\":\"15g\",\"unit\":\"包\",\"price\":\"0.81\",\"keyword\":\"FTZLTSJYT\"},{\"id\":\"693472810066\",\"code\":\"862353\",\"text\":\"福太子爽辣鱼条\",\"specifications\":\"15g\",\"unit\":\"包\",\"price\":\"0.81\",\"keyword\":\"FTZSLYT\"},{\"id\":\"694021188960\",\"code\":\"927737\",\"text\":\"养乐多\",\"specifications\":\"5*100ml\",\"unit\":\"排\",\"price\":\"10.37\",\"keyword\":\"YYD,YLD\"},{\"id\":\"693466508645\",\"code\":\"864162\",\"text\":\"蒙牛红枣酸牛奶\",\"specifications\":\"8*100g\",\"unit\":\"条\",\"price\":\"13.61\",\"keyword\":\"MNHZSNN,MNGZSNN\"},{\"id\":\"690799250013\",\"code\":\"107205\",\"text\":\"伊利高钙低脂奶\",\"specifications\":\"250ml\",\"unit\":\"盒\",\"price\":\"2.51\",\"keyword\":\"YLGGDZN\"},{\"id\":\"692364424292\",\"code\":\"106798\",\"text\":\"蒙牛酸酸乳原味\",\"specifications\":\"250ml\",\"unit\":\"盒\",\"price\":\"1.46\",\"keyword\":\"MNSSRYW\"},{\"id\":\"690102819385\",\"code\":\"524879\",\"text\":\"芙蓉王极品香烟\",\"specifications\":\"\",\"unit\":\"包\",\"price\":\"27.54\",\"keyword\":\"FRWJPXY\"},{\"id\":\"693686921522\",\"code\":\"465670\",\"text\":\"味芝元香辣鱼尾\",\"specifications\":\"32g\",\"unit\":\"包\",\"price\":\"1.62\",\"keyword\":\"WZYXLYY,WZYXLYW\"},{\"id\":\"690799250001\",\"code\":\"106870\",\"text\":\"伊利原味优酸乳饮料\",\"specifications\":\"250ml\",\"unit\":\"盒\",\"price\":\"1.62\",\"keyword\":\"YLYWYSRYL\"},{\"id\":\"693468857834\",\"code\":\"488594\",\"text\":\"家佳食加碘盐\",\"specifications\":\"350g\",\"unit\":\"袋\",\"price\":\"0.81\",\"keyword\":\"JJSJDY\"},{\"id\":\"690799251258\",\"code\":\"970744\",\"text\":\"伊利味可滋香蕉牛奶\",\"specifications\":\"240ml\",\"unit\":\"盒\",\"price\":\"4.05\",\"keyword\":\"YLWKZXQNN,YLWKZXJNN\"},{\"id\":\"692364425048\",\"code\":\"105698\",\"text\":\"蒙牛草莓果粒酸牛奶\",\"specifications\":\"100g\",\"unit\":\"杯\",\"price\":\"1.81\",\"keyword\":\"MNCMGLSNN\"},{\"id\":\"690799251336\",\"code\":\"469128\",\"text\":\"伊利100%畅意乳酸菌饮品原味\",\"specifications\":\"100ml\",\"unit\":\"排\",\"price\":\"6.48\",\"keyword\":\"YLCYRSJYPYW\"},{\"id\":\"692364426411\",\"code\":\"106702\",\"text\":\"蒙牛早餐核桃味牛奶\",\"specifications\":\"250ml\",\"unit\":\"盒\",\"price\":\"2.27\",\"keyword\":\"MNZCHTWNN\"},{\"id\":\"693686921523\",\"code\":\"465669\",\"text\":\"味芝元香辣鱼排\",\"specifications\":\"32g\",\"unit\":\"包\",\"price\":\"1.62\",\"keyword\":\"WZYXLYP\"},{\"id\":\"690040452354\",\"code\":\"466499\",\"text\":\"天友纸杯经典原味酸牛奶\",\"specifications\":\"160ml\",\"unit\":\"杯\",\"price\":\"3.24\",\"keyword\":\"TYZBJDYWSNN\"},{\"id\":\"692364426595\",\"code\":\"5454\",\"text\":\"蒙牛利乐砖优智成长奶\",\"specifications\":\"125ml\",\"unit\":\"瓶\",\"price\":\"2.03\",\"keyword\":\"MNLYZYZCZN,MNLYZYZCCN,MNLLZYZCZN,MNLLZYZCCN\"},{\"id\":\"694593067884\",\"code\":\"916757\",\"text\":\"泰香米\",\"specifications\":\"10kg\",\"unit\":\"袋\",\"price\":\"40.42\",\"keyword\":\"TXM\"},{\"id\":\"692245680503\",\"code\":\"659499\",\"text\":\"康师傅矿物质水\",\"specifications\":\"550ml\",\"unit\":\"瓶\",\"price\":\"0.81\",\"keyword\":\"KSFKWZS\"},{\"id\":\"692481080221\",\"code\":\"988651\",\"text\":\"卡士原味鲜酪乳\",\"specifications\":\"100g\",\"unit\":\"杯\",\"price\":\"3.56\",\"keyword\":\"QSYWXLR,KSYWXLR\"},{\"id\":\"692648763781\",\"code\":\"411382\",\"text\":\"属我棒山楂卷\",\"specifications\":\"\",\"unit\":\"个\",\"price\":\"1.22\",\"keyword\":\"ZWBSZJ,ZWBSCJ,SWBSZJ,SWBSCJ\"},{\"id\":\"695476747057\",\"code\":\"898096\",\"text\":\"可口可乐冰露饮用水\",\"specifications\":\"550ml\",\"unit\":\"瓶\",\"price\":\"0.41\",\"keyword\":\"KKKYBLYYS,KKKLBLYYS\"},{\"id\":\"690799251217\",\"code\":\"896809\",\"text\":\"伊利优酸乳果粒酸奶芒果味\",\"specifications\":\"245g\",\"unit\":\"盒\",\"price\":\"2.43\",\"keyword\":\"YLYSRGLSNWGW,YLYSRGLSNMGW\"},{\"id\":\"692777090043\",\"code\":\"557926\",\"text\":\"山花利乐砖纯牛奶\",\"specifications\":\"243ml\",\"unit\":\"盒\",\"price\":\"2.35\",\"keyword\":\"SHLYZCNN,SHLLZCNN\"},{\"id\":\"690799210355\",\"code\":\"480157\",\"text\":\"伊利红枣16连杯\",\"specifications\":\"100g*16\",\"unit\":\"条\",\"price\":\"24.14\",\"keyword\":\"YLHZLB,YLGZLB\"},{\"id\":\"690799251045\",\"code\":\"821001\",\"text\":\"伊利儿童全聪型成长奶\",\"specifications\":\"190ml\",\"unit\":\"盒\",\"price\":\"2.92\",\"keyword\":\"YLETQCXCZN,YLETQCXCCN\"},{\"id\":\"690799251321\",\"code\":\"467896\",\"text\":\"伊利QQ儿童风味酸奶\",\"specifications\":\"205g\",\"unit\":\"盒\",\"price\":\"4.46\",\"keyword\":\"YLETFWSN\"},{\"id\":\"690102819692\",\"code\":\"740635\",\"text\":\"白沙和天下烟\",\"specifications\":\"\",\"unit\":\"包\",\"price\":\"81.00\",\"keyword\":\"BSHTXY\"},{\"id\":\"692180470079\",\"code\":\"761202\",\"text\":\"陶华碧老干妈风味辣子鸡\",\"specifications\":\"280g\",\"unit\":\"瓶\",\"price\":\"7.21\",\"keyword\":\"YHBLGMFWLZJ,THBLGMFWLZJ\"},{\"id\":\"692364426849\",\"code\":\"781760\",\"text\":\"蒙牛真果粒芦荟味\",\"specifications\":\"250g\",\"unit\":\"盒\",\"price\":\"2.84\",\"keyword\":\"MNZGLLHW\"},{\"id\":\"692777090184\",\"code\":\"868464\",\"text\":\"山花菠萝杯酸\",\"specifications\":\"100g\",\"unit\":\"杯\",\"price\":\"1.62\",\"keyword\":\"SHBLBS\"},{\"id\":\"693466509111\",\"code\":\"471536\",\"text\":\"蒙牛风味酸牛奶原味\",\"specifications\":\"1*8*100g\",\"unit\":\"条\",\"price\":\"10.45\",\"keyword\":\"MNFWSNNYW\"},{\"id\":\"692180470064\",\"code\":\"526219\",\"text\":\"陶华碧老干妈香辣菜\",\"specifications\":\"80g\",\"unit\":\"包\",\"price\":\"1.54\",\"keyword\":\"YHBLGMXLC,THBLGMXLC\"},{\"id\":\"690799251293\",\"code\":\"439194\",\"text\":\"伊利谷粒多颗粒燕麦牛奶\",\"specifications\":\"200ml\",\"unit\":\"瓶\",\"price\":\"3.24\",\"keyword\":\"YLYLDKLYMNN,YLGLDKLYMNN\"},{\"id\":\"489159933839\",\"code\":\"840384\",\"text\":\"加多宝凉茶\",\"specifications\":\"310ml\",\"unit\":\"厅\",\"price\":\"2.84\",\"keyword\":\"JDBLC\"},{\"id\":\"695084919153\",\"code\":\"496658\",\"text\":\"竹纯量贩家庭装10包装\",\"specifications\":\"10包装\",\"unit\":\"提\",\"price\":\"7.21\",\"keyword\":\"ZCLFJTZBZ\"},{\"id\":\"692020288888\",\"code\":\"107087\",\"text\":\"红牛\",\"specifications\":\"250ml\",\"unit\":\"厅\",\"price\":\"4.78\",\"keyword\":\"HN,GN\"},{\"id\":\"692364426848\",\"code\":\"781758\",\"text\":\"蒙牛真果粒椰果味\",\"specifications\":\"250g\",\"unit\":\"盒\",\"price\":\"2.84\",\"keyword\":\"MNZGLYGW\"},{\"id\":\"692226644473\",\"code\":\"871631\",\"text\":\"清风无芯长卷纸\",\"specifications\":\"160g\",\"unit\":\"提\",\"price\":\"16.93\",\"keyword\":\"QFWXZJZ,QFWXCJZ,QFMXZJZ,QFMXCJZ\"},{\"id\":\"690128599124\",\"code\":\"819864\",\"text\":\"怡宝纯净水\",\"specifications\":\"350ml\",\"unit\":\"瓶\",\"price\":\"1.22\",\"keyword\":\"YBCJS\"},{\"id\":\"692364424074\",\"code\":\"105679\",\"text\":\"蒙牛黄桃杯酸奶\",\"specifications\":\"100g\",\"unit\":\"杯\",\"price\":\"1.81\",\"keyword\":\"MNHTBSN\"},{\"id\":\"695476744148\",\"code\":\"898084\",\"text\":\"可口可乐芬达\",\"specifications\":\"330ml\",\"unit\":\"厅\",\"price\":\"2.03\",\"keyword\":\"KKKYFD,KKKLFD\"},{\"id\":\"692257770418\",\"code\":\"868833\",\"text\":\"君乐宝老酸奶\",\"specifications\":\"139g\",\"unit\":\"杯\",\"price\":\"3.97\",\"keyword\":\"JYBLSN,JLBLSN\"},{\"id\":\"693686921560\",\"code\":\"484363\",\"text\":\"味芝元香辣鸭腿\",\"specifications\":\"38g\",\"unit\":\"袋\",\"price\":\"1.62\",\"keyword\":\"WZYXLYT\"},{\"id\":\"692180470075\",\"code\":\"702596\",\"text\":\"陶华碧老干妈风味豆豉\",\"specifications\":\"280g\",\"unit\":\"瓶\",\"price\":\"6.40\",\"keyword\":\"YHBLGMFWDC,THBLGMFWDC\"},{\"id\":\"692250780650\",\"code\":\"836475\",\"text\":\"陈克明鸡蛋面\",\"specifications\":\"150g\",\"unit\":\"包\",\"price\":\"1.22\",\"keyword\":\"CKMJDM\"},{\"id\":\"694898891870\",\"code\":\"492632\",\"text\":\"喜步佳男式凉拖鞋\",\"specifications\":\"1870\",\"unit\":\"双\",\"price\":\"6.40\",\"keyword\":\"XBJNSLTX\"},{\"id\":\"690102804688\",\"code\":\"532395\",\"text\":\"云烟紫红云烟\",\"specifications\":\"\",\"unit\":\"包\",\"price\":\"8.10\",\"keyword\":\"YYZHYY,YYZGYY\"},{\"id\":\"693153490038\",\"code\":\"482836\",\"text\":\"深井盐\",\"specifications\":\"500g\",\"unit\":\"袋\",\"price\":\"1.22\",\"keyword\":\"SJY\"},{\"id\":\"694898891869\",\"code\":\"492631\",\"text\":\"喜步佳女式凉拖鞋\",\"specifications\":\"1869\",\"unit\":\"双\",\"price\":\"6.40\",\"keyword\":\"XBJNSLTX\"},{\"id\":\"690324437095\",\"code\":\"105155\",\"text\":\"七度空间少女装超薄日用\",\"specifications\":\"10片\",\"unit\":\"包\",\"price\":\"6.89\",\"keyword\":\"QDKJSNZCBRY\"},{\"id\":\"690847100470\",\"code\":\"930487\",\"text\":\"养元精研型六个核桃\",\"specifications\":\"240ml\",\"unit\":\"瓶\",\"price\":\"3.24\",\"keyword\":\"YYJYXLGHT\"},{\"id\":\"694791590803\",\"code\":\"825862\",\"text\":\"大号购物袋\",\"specifications\":\"38*60\",\"unit\":\"个\",\"price\":\"0.41\",\"keyword\":\"DHGWD\"},{\"id\":\"692777090183\",\"code\":\"868465\",\"text\":\"山花芦荟杯酸\",\"specifications\":\"100g\",\"unit\":\"杯\",\"price\":\"1.62\",\"keyword\":\"SHLHBS\"},{\"id\":\"695311906083\",\"code\":\"471893\",\"text\":\"雪花金威优选易拉罐\",\"specifications\":\"330ml\",\"unit\":\"罐\",\"price\":\"2.35\",\"keyword\":\"XHJWYXYLG\"},{\"id\":\"691198802529\",\"code\":\"494075\",\"text\":\"达利园豆本豆利乐包原味豆奶\",\"specifications\":\"250ml\",\"unit\":\"袋\",\"price\":\"2.84\",\"keyword\":\"DLYDBDLYBYWDN,DLYDBDLLBYWDN\"},{\"id\":\"695606400059\",\"code\":\"484289\",\"text\":\"雪天精制加碘深井矿盐\",\"specifications\":\"500g\",\"unit\":\"包\",\"price\":\"1.62\",\"keyword\":\"XTJZJDSJKY\"},{\"id\":\"690102807577\",\"code\":\"524934\",\"text\":\"中华软包香烟\",\"specifications\":\"\",\"unit\":\"包\",\"price\":\"52.65\",\"keyword\":\"ZHRBXY\"},{\"id\":\"692647520207\",\"code\":\"111617\",\"text\":\"喜之郎原味辣味美好时光海苔\",\"specifications\":\"4.5g\",\"unit\":\"袋\",\"price\":\"3.97\",\"keyword\":\"XZLYWLWMHSGHT\"},{\"id\":\"692231840011\",\"code\":\"806347\",\"text\":\"华辉白凉粉\",\"specifications\":\"50g\",\"unit\":\"盒\",\"price\":\"1.62\",\"keyword\":\"HHBLF\"},{\"id\":\"690040452163\",\"code\":\"860710\",\"text\":\"天友经典老酸奶\",\"specifications\":\"160g\",\"unit\":\"袋\",\"price\":\"4.05\",\"keyword\":\"TYJDLSN\"},{\"id\":\"690324498125\",\"code\":\"118302\",\"text\":\"心相印双层压花餐巾纸\",\"specifications\":\"50张\",\"unit\":\"包\",\"price\":\"1.62\",\"keyword\":\"XXYSCYHCJZ\"},{\"id\":\"695515040031\",\"code\":\"434146\",\"text\":\"圣牧全程有机酸奶\",\"specifications\":\"205g\",\"unit\":\"瓶\",\"price\":\"5.35\",\"keyword\":\"SMQCYJSN\"},{\"id\":\"690799250037\",\"code\":\"107986\",\"text\":\"伊利高钙奶\",\"specifications\":\"250ml\",\"unit\":\"盒\",\"price\":\"2.51\",\"keyword\":\"YLGGN\"},{\"id\":\"690799251196\",\"code\":\"896815\",\"text\":\"伊利QQ星营养果汁酸奶香蕉味\",\"specifications\":\"200ml\",\"unit\":\"瓶\",\"price\":\"2.43\",\"keyword\":\"YLXYYGZSNXQW,YLXYYGZSNXJW\"},{\"id\":\"692213010110\",\"code\":\"106608\",\"text\":\"太太乐鸡精\",\"specifications\":\"40g\",\"unit\":\"袋\",\"price\":\"1.78\",\"keyword\":\"TTYJJ,TTLJJ\"},{\"id\":\"693427299207\",\"code\":\"469726\",\"text\":\"维邦竹琨卷纸\",\"specifications\":\"1800g\",\"unit\":\"提\",\"price\":\"25.84\",\"keyword\":\"WBZKJZ\"},{\"id\":\"692364424031\",\"code\":\"1072\",\"text\":\"蒙牛高钙低脂奶\",\"specifications\":\"250ml\",\"unit\":\"盒\",\"price\":\"2.59\",\"keyword\":\"MNGGDZN\"},{\"id\":\"690799251043\",\"code\":\"821003\",\"text\":\"伊利儿童健固型成长奶\",\"specifications\":\"190ml\",\"unit\":\"盒\",\"price\":\"2.92\",\"keyword\":\"YLETJGXCZN,YLETJGXCCN\"},{\"id\":\"694673506009\",\"code\":\"448873\",\"text\":\"华雄荔枝爽\",\"specifications\":\"240g\",\"unit\":\"厅\",\"price\":\"1.62\",\"keyword\":\"HXLZS\"},{\"id\":\"690799210391\",\"code\":\"480147\",\"text\":\"伊利原味发酵乳8连杯特惠装\",\"specifications\":\"8*100g\",\"unit\":\"条\",\"price\":\"10.37\",\"keyword\":\"YLYWFJRLBTHZ\"},{\"id\":\"690289023418\",\"code\":\"862032\",\"text\":\"双汇台式烤肠\",\"specifications\":\"48g\",\"unit\":\"支\",\"price\":\"1.62\",\"keyword\":\"SHTSKC\"},{\"id\":\"692364427215\",\"code\":\"825088\",\"text\":\"蒙牛早餐奶红枣味\",\"specifications\":\"250ml\",\"unit\":\"盒\",\"price\":\"2.27\",\"keyword\":\"MNZCNHZW,MNZCNGZW\"},{\"id\":\"690040452283\",\"code\":\"934348\",\"text\":\"天友低乳糖酸牛奶\",\"specifications\":\"160g\",\"unit\":\"杯\",\"price\":\"3.24\",\"keyword\":\"TYDRTSNN\"},{\"id\":\"692530758886\",\"code\":\"495342\",\"text\":\"网袋白蒜\",\"specifications\":\"\",\"unit\":\"袋\",\"price\":\"2.43\",\"keyword\":\"WDBS\"},{\"id\":\"691001901115\",\"code\":\"873329\",\"text\":\"雕牌洗衣皂\",\"specifications\":\"2*202g\",\"unit\":\"组\",\"price\":\"5.27\",\"keyword\":\"DPXYZ\"},{\"id\":\"692224181017\",\"code\":\"489962\",\"text\":\"一起旺冰冰家庭号\",\"specifications\":\"78ml*8\",\"unit\":\"包\",\"price\":\"5.59\",\"keyword\":\"YQWBBJTH\"},{\"id\":\"691896200584\",\"code\":\"901215\",\"text\":\"裕湘绿豆面\",\"specifications\":\"900g\",\"unit\":\"包\",\"price\":\"5.59\",\"keyword\":\"YXLDM\"},{\"id\":\"690799251154\",\"code\":\"863552\",\"text\":\"伊利QQ星儿童成长奶营养均膳型\",\"specifications\":\"190ml\",\"unit\":\"盒\",\"price\":\"3.24\",\"keyword\":\"YLXETCZNYYYSX,YLXETCZNYYJSX,YLXETCCNYYYSX,YLXETCCNYYJSX\"},{\"id\":\"692777090198\",\"code\":\"890737\",\"text\":\"山花红枣杯酸奶\",\"specifications\":\"100g\",\"unit\":\"杯\",\"price\":\"1.62\",\"keyword\":\"SHHZBSN,SHGZBSN\"},{\"id\":\"506047840047\",\"code\":\"488292\",\"text\":\"牛轰轰阙宇豪小弟弟吸吸棒\",\"specifications\":\"\",\"unit\":\"包\",\"price\":\"1.22\",\"keyword\":\"NHHQYHXDDXXB\"},{\"id\":\"692840952176\",\"code\":\"440493\",\"text\":\"佳益新蓝风8连包\",\"specifications\":\"2880抽\",\"unit\":\"提\",\"price\":\"16.93\",\"keyword\":\"JYXLFLB\"},{\"id\":\"690799251318\",\"code\":\"458554\",\"text\":\"伊利畅意100乳酸菌\",\"specifications\":\"330ml\",\"unit\":\"瓶\",\"price\":\"4.05\",\"keyword\":\"YLCYRSJ\"},{\"id\":\"690107060057\",\"code\":\"826686\",\"text\":\"云南白药牙膏留兰香型\",\"specifications\":\"180g\",\"unit\":\"支\",\"price\":\"27.38\",\"keyword\":\"YNBYYGLLXX\"},{\"id\":\"692225545142\",\"code\":\"870998\",\"text\":\"百岁山矿泉水\",\"specifications\":\"570ml\",\"unit\":\"瓶\",\"price\":\"2.43\",\"keyword\":\"BSSKQS\"},{\"id\":\"692416071354\",\"code\":\"422905\",\"text\":\"无穷香辣烤小腿\",\"specifications\":\"13g\",\"unit\":\"包\",\"price\":\"2.03\",\"keyword\":\"WQXLKXT,MQXLKXT\"},{\"id\":\"692481080080\",\"code\":\"827494\",\"text\":\"卡士鲜酪乳原味\",\"specifications\":\"100g\",\"unit\":\"杯\",\"price\":\"4.05\",\"keyword\":\"QSXLRYW,KSXLRYW\"},{\"id\":\"692530377310\",\"code\":\"756872\",\"text\":\"统一来一桶老坛酸菜牛肉面\",\"specifications\":\"127g\",\"unit\":\"桶\",\"price\":\"3.24\",\"keyword\":\"TYLYTLTSCNRM\"},{\"id\":\"692737000340\",\"code\":\"482398\",\"text\":\"咪咪虾条Q包\",\"specifications\":\"240g\",\"unit\":\"袋\",\"price\":\"8.02\",\"keyword\":\"MMXTB,MMHTB\"},{\"id\":\"692364427188\",\"code\":\"824226\",\"text\":\"蒙牛妙妙乳饮料草莓味\",\"specifications\":\"125ml\",\"unit\":\"盒\",\"price\":\"1.22\",\"keyword\":\"MNMMRYLCMW\"},{\"id\":\"690799210004\",\"code\":\"520760\",\"text\":\"伊利AD钙奶\",\"specifications\":\"250ml\",\"unit\":\"盒\",\"price\":\"1.62\",\"keyword\":\"YLGN\"},{\"id\":\"690102803691\",\"code\":\"532259\",\"text\":\"黄果树佳品84全硬烤\",\"specifications\":\"\",\"unit\":\"包\",\"price\":\"5.27\",\"keyword\":\"HGSJPQYK\"},{\"id\":\"690799210358\",\"code\":\"480148\",\"text\":\"伊利U型杯红枣\",\"specifications\":\"160g\",\"unit\":\"杯\",\"price\":\"2.43\",\"keyword\":\"YLXBHZ,YLXBGZ\"},{\"id\":\"693686921566\",\"code\":\"484358\",\"text\":\"味芝元酱鸭脖\",\"specifications\":\"30g\",\"unit\":\"袋\",\"price\":\"1.62\",\"keyword\":\"WZYJYB\"},{\"id\":\"692689252205\",\"code\":\"5710\",\"text\":\"银鹭花生牛奶\",\"specifications\":\"250ml\",\"unit\":\"盒\",\"price\":\"1.62\",\"keyword\":\"YLHSNN\"},{\"id\":\"693816692032\",\"code\":\"807070\",\"text\":\"和丝露苹果醋(无糖)\",\"specifications\":\"488ml\",\"unit\":\"瓶\",\"price\":\"4.05\",\"keyword\":\"HSLPGCWT,HSLPGCMT\"},{\"id\":\"692347610944\",\"code\":\"104624\",\"text\":\"倍加洁超柔弹力护齿牙刷\",\"specifications\":\"\",\"unit\":\"支\",\"price\":\"4.21\",\"keyword\":\"BJJCRTLHCYS,BJJCRDLHCYS\"},{\"id\":\"690324437097\",\"code\":\"118364\",\"text\":\"七度空间纯棉夜用卫生巾\",\"specifications\":\"10片\",\"unit\":\"包\",\"price\":\"8.02\",\"keyword\":\"QDKJCMYYWSJ\"},{\"id\":\"692461580128\",\"code\":\"420954\",\"text\":\"湘盐绿色加碘精制盐\",\"specifications\":\"400g\",\"unit\":\"包\",\"price\":\"0.81\",\"keyword\":\"XYLSJDJZY\"},{\"id\":\"693483413044\",\"code\":\"855270\",\"text\":\"南山老酸奶\",\"specifications\":\"180g\",\"unit\":\"杯\",\"price\":\"4.46\",\"keyword\":\"NSLSN\"},{\"id\":\"694015941002\",\"code\":\"733810\",\"text\":\"百事可乐\",\"specifications\":\"600ml\",\"unit\":\"瓶\",\"price\":\"2.43\",\"keyword\":\"BSKY,BSKL\"},{\"id\":\"489102816445\",\"code\":\"968165\",\"text\":\"维他柠檬茶\",\"specifications\":\"250ml\",\"unit\":\"瓶\",\"price\":\"2.27\",\"keyword\":\"WTNMC\"},{\"id\":\"690799251316\",\"code\":\"438459\",\"text\":\"伊利铁罐金装核桃乳\",\"specifications\":\"240ml\",\"unit\":\"瓶\",\"price\":\"3.65\",\"keyword\":\"YLTGJZHTR\"},{\"id\":\"692364424135\",\"code\":\"106707\",\"text\":\"蒙牛早餐麦香味牛奶\",\"specifications\":\"250ml\",\"unit\":\"盒\",\"price\":\"2.27\",\"keyword\":\"MNZCMXWNN\"},{\"id\":\"691643220001\",\"code\":\"117213\",\"text\":\"长康白醋\",\"specifications\":\"500ml\",\"unit\":\"瓶\",\"price\":\"3.24\",\"keyword\":\"ZKBC,CKBC\"}]"; + List> data = JsonUtil.getJsonToListMap(json); + if (!StringUtils.isEmpty(page.getKeyword())) { + data = data.stream().filter(t -> String.valueOf(t.get("code")).contains(page.getKeyword()) || String.valueOf(t.get("keyword")).contains(page.getKeyword()) || String.valueOf(t.get("text")).contains(page.getKeyword())).collect(Collectors.toList()); + } + List list = JsonUtil.getJsonToList(data, OrderGoodsVO.class); + ListVO vo = new ListVO(); + vo.setList(list); + return ActionResult.success(vo); + } +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/ProductController.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/ProductController.java new file mode 100644 index 0000000..3d43f4b --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/ProductController.java @@ -0,0 +1,186 @@ +package jnpf.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import jnpf.base.ActionResult; +import jnpf.base.controller.SuperController; +import jnpf.base.vo.ListVO; +import jnpf.base.vo.PageListVO; +import jnpf.base.vo.PaginationVO; +import jnpf.entity.ProductEntity; +import jnpf.entity.ProductEntryEntity; +import jnpf.exception.DataException; +import jnpf.model.product.*; +import jnpf.model.productEntry.ProductEntryInfoVO; +import jnpf.model.productEntry.ProductEntryListVO; +import jnpf.model.productEntry.ProductEntryMdoel; +import jnpf.service.ProductEntryService; +import jnpf.service.ProductService; +import jnpf.util.JsonUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +/** + * 销售订单 + * + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021-07-10 10:40:59 + */ +@Slf4j +@RestController +@Tag(name = "销售订单", description = "Product") +@RequestMapping("/api/extend/saleOrder/Product") +public class ProductController extends SuperController { + + @Autowired + private ProductService productService; + @Autowired + private ProductEntryService productEntryService; + + /** + * 列表 + * + * @param productPagination 分页模型 + * @return + */ + @Operation(summary = "列表") + @GetMapping + @SaCheckPermission("saleOrder") + public ActionResult> list(ProductPagination productPagination) { + List list = productService.getList(productPagination); + List listVO = JsonUtil.getJsonToList(list, ProductListVO.class); + PageListVO vo = new PageListVO(); + vo.setList(listVO); + PaginationVO page = JsonUtil.getJsonToBean(productPagination, PaginationVO.class); + vo.setPagination(page); + return ActionResult.success(vo); + } + + /** + * 创建 + * + * @param productCrForm 销售模型 + * @return + */ + @Operation(summary = "创建") + @PostMapping + @Parameters({ + @Parameter(name = "productCrForm", description = "销售模型",required = true), + }) + @SaCheckPermission("saleOrder") + public ActionResult create(@RequestBody @Valid ProductCrForm productCrForm) throws DataException { + ProductEntity entity = JsonUtil.getJsonToBean(productCrForm, ProductEntity.class); + List productEntryList = JsonUtil.getJsonToList(productCrForm.getProductEntryList(), ProductEntryEntity.class); + productService.create(entity, productEntryList); + return ActionResult.success("新建成功"); + } + + /** + * 信息 + * + * @param id 主键 + * @return + */ + @Operation(summary = "信息") + @GetMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键",required = true), + }) + @SaCheckPermission("saleOrder") + public ActionResult info(@PathVariable("id") String id) { + ProductEntity entity = productService.getInfo(id); + ProductInfoVO vo = JsonUtil.getJsonToBean(entity, ProductInfoVO.class); + List productEntryList = productEntryService.getProductentryEntityList(id); + List productList = JsonUtil.getJsonToList(productEntryList, ProductEntryInfoVO.class); + vo.setProductEntryList(productList); + return ActionResult.success(vo); + } + + /** + * 更新 + * + * @param productUpForm 销售模型 + * @param id 主键 + * @return + */ + @Operation(summary = "更新") + @PutMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键",required = true), + @Parameter(name = "productUpForm", description = "销售模型",required = true), + }) + @SaCheckPermission("saleOrder") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid ProductUpForm productUpForm) { + ProductEntity entity = productService.getInfo(id); + if (entity != null) { + List productEntryList = JsonUtil.getJsonToList(productUpForm.getProductEntryList(), ProductEntryEntity.class); + productService.update(id, entity, productEntryList); + return ActionResult.success("更新成功"); + } else { + return ActionResult.fail("更新失败,数据不存在"); + } + } + + /** + * 删除 + * + * @param id 主键 + * @return + */ + @Operation(summary = "删除") + @DeleteMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键",required = true), + }) + @SaCheckPermission("saleOrder") + public ActionResult delete(@PathVariable("id") String id) { + ProductEntity entity = productService.getInfo(id); + if (entity != null) { + productService.delete(entity); + } + return ActionResult.success("删除成功"); + } + + /** + * 获取销售产品明细 + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取销售明细") + @GetMapping("/ProductEntry/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键",required = true), + }) + @SaCheckPermission("saleOrder") + public ActionResult> ProductEntryList(@PathVariable("id") String id) { + String data = "[{\"id\":\"37c995b4044541009fb7e285bcf9845d\",\"productSpecification\":\"120ml\",\"qty\":16,\"money\":510,\"price\":120,\"commandType\":\"唯一码\",\"util\":\"盒\"},{\"id\":\"2dbb11d3cde04c299985ac944d130ba0\",\"productSpecification\":\"150ml\",\"qty\":15,\"money\":520,\"price\":310,\"commandType\":\"唯一码\",\"util\":\"盒\"},{\"id\":\"f8ec261ccdf045e5a2e1f0e5485cda76\",\"productSpecification\":\"40ml\",\"qty\":13,\"money\":530,\"price\":140,\"commandType\":\"唯一码\",\"util\":\"盒\"},{\"id\":\"6c110b57ae56445faa8ce9be501c8997\",\"productSpecification\":\"103ml\",\"qty\":2,\"money\":504,\"price\":150,\"commandType\":\"唯一码\",\"util\":\"盒\"},{\"id\":\"f2ee981aaf934147a4d090a0eed2203f\",\"productSpecification\":\"120ml\",\"qty\":21,\"money\":550,\"price\":160,\"commandType\":\"唯一码\",\"util\":\"盒\"}]"; + List dataAll = JsonUtil.getJsonToList(data, ProductEntryMdoel.class); + List productEntryList = productEntryService.getProductentryEntityList(id); + List productList = JsonUtil.getJsonToList(productEntryList, ProductEntryListVO.class); + for (ProductEntryListVO entry : productList) { + List dataList = new ArrayList<>(); + Random random = new Random(); + int num = random.nextInt(dataAll.size()); + for (int i = 0; i < num; i++) { + dataList.add(dataAll.get(num)); + } + entry.setDataList(dataList); + } + ListVO vo = new ListVO(); + vo.setList(productList); + return ActionResult.success(vo); + } + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/ProductGoodsController.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/ProductGoodsController.java new file mode 100644 index 0000000..0196bef --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/ProductGoodsController.java @@ -0,0 +1,178 @@ +package jnpf.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import jnpf.base.ActionResult; +import jnpf.base.controller.SuperController; +import jnpf.base.vo.ListVO; +import jnpf.base.vo.PageListVO; +import jnpf.base.vo.PaginationVO; +import jnpf.entity.ProductGoodsEntity; +import jnpf.model.productgoods.*; +import jnpf.service.ProductGoodsService; +import jnpf.util.JsonUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; + +/** + * 产品商品 + * + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021-07-10 15:57:50 + */ +@Slf4j +@RestController +@Tag(name = "产品商品", description = "Goods") +@RequestMapping("/api/extend/saleOrder/Goods") +public class ProductGoodsController extends SuperController { + + @Autowired + private ProductGoodsService productgoodsService; + + /** + * 列表 + * + * @param type 类型 + * @return + */ + @GetMapping("/getGoodList") + @Operation(summary = "列表") + @Parameters({ + @Parameter(name = "type", description = "类型"), + }) + @SaCheckPermission("saleOrder") + public ActionResult> list(@RequestParam("type")String type) { + List list = productgoodsService.getGoodList(type); + List listVO = JsonUtil.getJsonToList(list, ProductGoodsListVO.class); + ListVO vo = new ListVO(); + vo.setList(listVO); + return ActionResult.success(vo); + } + + /** + * 列表 + * + * @param goodsPagination 分页模型 + * @return + */ + @GetMapping + @Operation(summary = "列表") + @SaCheckPermission("saleOrder") + public ActionResult> list(ProductGoodsPagination goodsPagination) { + List list = productgoodsService.getList(goodsPagination); + List listVO = JsonUtil.getJsonToList(list, ProductGoodsListVO.class); + PageListVO vo = new PageListVO(); + vo.setList(listVO); + PaginationVO page = JsonUtil.getJsonToBean(goodsPagination, PaginationVO.class); + vo.setPagination(page); + return ActionResult.success(vo); + } + + /** + * 创建 + * + * @param goodsCrForm 商品模型 + * @return + */ + @PostMapping + @Operation(summary = "创建") + @Parameters({ + @Parameter(name = "goodsCrForm", description = "商品模型",required = true), + }) + @SaCheckPermission("saleOrder") + public ActionResult create(@RequestBody @Valid ProductGoodsCrForm goodsCrForm) { + ProductGoodsEntity entity = JsonUtil.getJsonToBean(goodsCrForm, ProductGoodsEntity.class); + productgoodsService.create(entity); + return ActionResult.success("新建成功"); + } + + /** + * 信息 + * + * @param id 主键 + * @return + */ + @Operation(summary = "信息") + @GetMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("saleOrder") + public ActionResult info(@PathVariable("id") String id) { + ProductGoodsEntity entity = productgoodsService.getInfo(id); + ProductGoodsInfoVO vo = JsonUtil.getJsonToBean(entity, ProductGoodsInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 更新 + * + * @param id 主键 + * @param goodsCrFormUpForm 商品模型 + * @return + */ + @PutMapping("/{id}") + @Operation(summary = "更新") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "goodsCrFormUpForm", description = "商品模型",required = true), + }) + @SaCheckPermission("saleOrder") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid ProductGoodsUpForm goodsCrFormUpForm) { + ProductGoodsEntity entity = JsonUtil.getJsonToBean(goodsCrFormUpForm, ProductGoodsEntity.class); + boolean ok = productgoodsService.update(id, entity); + if (ok) { + return ActionResult.success("更新成功"); + } + return ActionResult.fail("更新失败,数据不存在"); + } + + /** + * 删除 + * + * @param id 主键 + * @return + */ + @DeleteMapping("/{id}") + @Operation(summary = "删除") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("saleOrder") + public ActionResult delete(@PathVariable("id") String id) { + ProductGoodsEntity entity = productgoodsService.getInfo(id); + if (entity != null) { + productgoodsService.delete(entity); + } + return ActionResult.success("删除成功"); + } + + /** + * 下拉 + * + * @param goodsPagination 下拉模型 + * @return + */ + @GetMapping("/Selector") + @Operation(summary = "下拉") + @SaCheckPermission("saleOrder") + public ActionResult> listSelect(ProductGoodsPagination goodsPagination) { + goodsPagination.setCurrentPage(1); + goodsPagination.setPageSize(50); + List list = productgoodsService.getList(goodsPagination); + List listVO = JsonUtil.getJsonToList(list, ProductGoodsListVO.class); + ListVO vo = new ListVO(); + vo.setList(listVO); + return ActionResult.success(vo); + } + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/ProductclassifyController.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/ProductclassifyController.java new file mode 100644 index 0000000..93dd690 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/ProductclassifyController.java @@ -0,0 +1,138 @@ +package jnpf.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import jnpf.base.ActionResult; +import jnpf.base.controller.SuperController; +import jnpf.base.vo.ListVO; +import jnpf.entity.ProductclassifyEntity; +import jnpf.model.productclassify.*; +import jnpf.service.ProductclassifyService; +import jnpf.util.JsonUtil; +import jnpf.util.treeutil.SumTree; +import jnpf.util.treeutil.TreeDotUtils; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; + +/** + * 产品分类 + * + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021-07-10 14:34:04 + */ +@Slf4j +@RestController +@Tag(name = "产品分类", description = "Classify") +@RequestMapping("/api/extend/saleOrder/Classify") +public class ProductclassifyController extends SuperController { + + @Autowired + private ProductclassifyService productclassifyService; + + /** + * 列表 + * + * @return + */ + @GetMapping + @Operation(summary = "列表") + @SaCheckPermission("saleOrder") + public ActionResult> list() { + List data = productclassifyService.getList(); + List modelList = JsonUtil.getJsonToList(data, ProductclassifyModel.class); + List> sumTrees = TreeDotUtils.convertListToTreeDot(modelList); + List list = JsonUtil.getJsonToList(sumTrees, ProductclassifyListVO.class); + ListVO vo = new ListVO(); + vo.setList(list); + return ActionResult.success(vo); + } + + /** + * 创建 + * + * @param classifyCrForm 分类模型 + * @return + */ + @PostMapping + @Operation(summary = "创建") + @Parameters({ + @Parameter(name = "classifyCrForm", description = "分类模型", required = true), + }) + @SaCheckPermission("saleOrder") + public ActionResult create(@RequestBody @Valid ProductclassifyCrForm classifyCrForm) { + ProductclassifyEntity entity = JsonUtil.getJsonToBean(classifyCrForm, ProductclassifyEntity.class); + productclassifyService.create(entity); + return ActionResult.success("新建成功"); + } + + /** + * 信息 + * + * @param id 主键 + * @return + */ + @GetMapping("/{id}") + @Operation(summary = "信息") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("saleOrder") + public ActionResult info(@PathVariable("id") String id) { + ProductclassifyEntity entity = productclassifyService.getInfo(id); + ProductclassifyInfoVO vo = JsonUtil.getJsonToBean(entity, ProductclassifyInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 更新 + * + * @param id 主键 + * @param classifyUpForm 分类模型 + * @return + */ + @PutMapping("/{id}") + @Operation(summary = "更新") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "classifyUpForm", description = "分类模型", required = true), + }) + @SaCheckPermission("saleOrder") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid ProductclassifyUpForm classifyUpForm) { + ProductclassifyEntity entity = JsonUtil.getJsonToBean(classifyUpForm, ProductclassifyEntity.class); + boolean ok = productclassifyService.update(id, entity); + if (ok) { + return ActionResult.success("更新成功"); + } + return ActionResult.fail("更新失败,数据不存在"); + } + + /** + * 删除 + * + * @param id 主键 + * @return + */ + @DeleteMapping("/{id}") + @Operation(summary = "删除") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("saleOrder") + public ActionResult delete(@PathVariable("id") String id) { + ProductclassifyEntity entity = productclassifyService.getInfo(id); + if (entity != null) { + productclassifyService.delete(entity); + } + return ActionResult.success("删除成功"); + } + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/ProjectGanttController.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/ProjectGanttController.java new file mode 100644 index 0000000..1ec20bf --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/ProjectGanttController.java @@ -0,0 +1,320 @@ +package jnpf.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import jnpf.base.ActionResult; +import jnpf.base.Page; +import jnpf.base.controller.SuperController; +import jnpf.base.vo.ListVO; +import jnpf.constant.MsgCode; +import jnpf.entity.ProjectGanttEntity; +import jnpf.exception.DataException; +import jnpf.model.projectgantt.*; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.UserService; +import jnpf.service.ProjectGanttService; +import jnpf.util.JsonUtil; +import jnpf.util.JsonUtilEx; +import jnpf.util.UploaderUtil; +import jnpf.util.treeutil.ListToTreeUtil; +import jnpf.util.treeutil.SumTree; +import jnpf.util.treeutil.TreeDotUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 项目计划 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月26日 上午9:18 + */ +@Tag(name = "项目计划", description = "ProjectGantt") +@RestController +@RequestMapping("/api/extend/ProjectGantt") +public class ProjectGanttController extends SuperController { + + @Autowired + private ProjectGanttService projectGanttService; + @Autowired + private UserService userService; + + + /** + * 项目列表 + * + * @param page 分页模型 + * @return + */ + @Operation(summary = "获取项目管理列表") + @GetMapping + @SaCheckPermission("extend.projectGantt") + public ActionResult> list(Page page) { + List data = projectGanttService.getList(page); + List list = JsonUtil.getJsonToList(data, ProjectGanttListVO.class); + //获取用户给项目参与人员列表赋值 + List userId = new ArrayList<>(); + list.forEach(t -> { + String[] ids = t.getManagerIds().split(","); + Collections.addAll(userId, ids); + }); + List userList = userService.getUserName(userId); + for (ProjectGanttListVO vo : list) { + List managerList = new ArrayList<>(); + Collections.addAll(managerList, vo.getManagerIds().split(",")); + List user = userList.stream().filter(t -> managerList.contains(t.getId())).collect(Collectors.toList()); + List list1 = new ArrayList<>(); + user.forEach(t -> { + ProjectGanttManagerIModel model1 = new ProjectGanttManagerIModel(); + model1.setAccount(t.getRealName() + "/" + t.getAccount()); + model1.setHeadIcon(UploaderUtil.uploaderImg(t.getHeadIcon())); + list1.add(model1); + }); + vo.setManagersInfo(list1); + } + ListVO listVO = new ListVO<>(); + listVO.setList(list); + return ActionResult.success(listVO); + } + + /** + * 任务列表 + * + * @param page 分页模型 + * @param projectId 主键 + * @return + */ + @Operation(summary = "获取项目任务列表") + @GetMapping("/{projectId}/Task") + @Parameters({ + @Parameter(name = "projectId", description = "主键",required = true), + }) + @SaCheckPermission("extend.projectGantt") + public ActionResult> taskList(Page page, @PathVariable("projectId") String projectId) { + List data = projectGanttService.getTaskList(projectId); + List dataAll = data; + if (!StringUtils.isEmpty(page.getKeyword())) { + data = data.stream().filter(t -> String.valueOf(t.getFullName()).contains(page.getKeyword()) || String.valueOf(t.getEnCode()).contains(page.getKeyword())).collect(Collectors.toList()); + } + List list = JsonUtil.getJsonToList(ListToTreeUtil.treeWhere(data, dataAll), ProjectGanttEntity.class); + List treeList = JsonUtil.getJsonToList(list, ProjectGanttTreeModel.class); + List> trees = TreeDotUtils.convertListToTreeDot(treeList); + List listVO = JsonUtil.getJsonToList(trees, ProjectGanttTaskTreeVO.class); + ListVO vo = new ListVO(); + vo.setList(listVO); + return ActionResult.success(vo); + } + + /** + * 任务树形 + * + * @param projectId 主键 + * @param id 主键 + * @return + */ + @Operation(summary = "获取项目计划任务树形(新建任务)") + @GetMapping("/{projectId}/Task/Selector/{id}") + @Parameters({ + @Parameter(name = "projectId", description = "主键",required = true), + @Parameter(name = "id", description = "主键",required = true), + }) + @SaCheckPermission("extend.projectGantt") + public ActionResult> taskTreeView(@PathVariable("projectId") String projectId, @PathVariable("id") String id) { + List treeList = new ArrayList<>(); + List data = projectGanttService.getTaskList(projectId); + if (!"0".equals(id)) { + //上级不能选择自己 + data.remove(projectGanttService.getInfo(id)); + } + for (ProjectGanttEntity entity : data) { + ProjectGanttTaskTreeModel treeModel = new ProjectGanttTaskTreeModel(); + treeModel.setId(entity.getId()); + treeModel.setFullName(entity.getFullName()); + treeModel.setParentId(entity.getParentId()); + treeList.add(treeModel); + } + List> trees = TreeDotUtils.convertListToTreeDotFilter(treeList); + List listVO = JsonUtil.getJsonToList(trees, ProjectGanttTaskTreeVO.class); + ListVO vo = new ListVO(); + vo.setList(listVO); + return ActionResult.success(vo); + } + + /** + * 信息 + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取项目计划信息") + @GetMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键",required = true), + }) + @SaCheckPermission("extend.projectGantt") + public ActionResult info(@PathVariable("id") String id) throws DataException { + ProjectGanttEntity entity = projectGanttService.getInfo(id); + ProjectGanttInfoVO vo = JsonUtil.getJsonToBeanEx(entity, ProjectGanttInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 信息 + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取项目计划信息") + @GetMapping("Task/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键",required = true), + }) + @SaCheckPermission("extend.projectGantt") + public ActionResult taskInfo(@PathVariable("id") String id) throws DataException { + ProjectGanttEntity entity = projectGanttService.getInfo(id); + ProjectGanttTaskInfoVO vo = JsonUtil.getJsonToBeanEx(entity, ProjectGanttTaskInfoVO.class); + return ActionResult.success(vo); + } + + + /** + * 删除 + * + * @param id 主键 + * @return + */ + @Operation(summary = "删除项目计划/任务") + @DeleteMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键",required = true), + }) + @SaCheckPermission("extend.projectGantt") + public ActionResult delete(@PathVariable("id") String id) { + if (projectGanttService.allowDelete(id)) { + ProjectGanttEntity entity = projectGanttService.getInfo(id); + if (entity != null) { + projectGanttService.delete(entity); + return ActionResult.success("删除成功"); + } + return ActionResult.fail("删除失败,此任务不存在"); + } else { + return ActionResult.fail("此记录被关联引用,不允许被删除"); + } + } + + /** + * 创建 + * + * @param projectGanttCrForm 项目模型 + * @return + */ + @Operation(summary = "添加项目计划") + @PostMapping + @Parameters({ + @Parameter(name = "projectGanttCrForm", description = "项目模型",required = true), + }) + @SaCheckPermission("extend.projectGantt") + public ActionResult create(@RequestBody @Valid ProjectGanttCrForm projectGanttCrForm) { + ProjectGanttEntity entity = JsonUtil.getJsonToBean(projectGanttCrForm, ProjectGanttEntity.class); + entity.setType(1); + entity.setParentId("0"); + if (projectGanttService.isExistByFullName(projectGanttCrForm.getFullName(), entity.getId())) { + return ActionResult.fail("项目名称不能重复"); + } + if (projectGanttService.isExistByEnCode(projectGanttCrForm.getEnCode(), entity.getId())) { + return ActionResult.fail("项目编码不能重复"); + } + projectGanttService.create(entity); + return ActionResult.success("新建成功"); + } + + /** + * 编辑 + * + * @param id 主键 + * @param projectGanttUpForm 项目模型 + * @return + */ + @Operation(summary = "修改项目计划") + @PutMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键",required = true), + @Parameter(name = "projectGanttUpForm", description = "项目模型",required = true), + }) + @SaCheckPermission("extend.projectGantt") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid ProjectGanttUpForm projectGanttUpForm) { + ProjectGanttEntity entity = JsonUtil.getJsonToBean(projectGanttUpForm, ProjectGanttEntity.class); + if (projectGanttService.isExistByFullName(projectGanttUpForm.getFullName(), id)) { + return ActionResult.fail("项目名称不能重复"); + } + if (projectGanttService.isExistByEnCode(projectGanttUpForm.getEnCode(), id)) { + return ActionResult.fail("项目编码不能重复"); + } + boolean flag = projectGanttService.update(id, entity); + if (flag == false) { + return ActionResult.fail("更新失败,数据不存在"); + } + return ActionResult.success("更新成功"); + } + + + /** + * 创建 + * + * @param projectGanttTsakCrForm 项目模型 + * @return + */ + @Operation(summary = "添加项目任务") + @PostMapping("/Task") + @Parameters({ + @Parameter(name = "projectGanttTsakCrForm", description = "项目模型",required = true), + }) + @SaCheckPermission("extend.projectGantt") + public ActionResult createTask(@RequestBody @Valid ProjectGanttTsakCrForm projectGanttTsakCrForm) { + ProjectGanttEntity entity = JsonUtil.getJsonToBean(projectGanttTsakCrForm, ProjectGanttEntity.class); + entity.setType(2); + if (projectGanttService.isExistByFullName(projectGanttTsakCrForm.getFullName(), entity.getId())) { + return ActionResult.fail("任务名称不能重复"); + } + projectGanttService.create(entity); + return ActionResult.success("新建成功"); + } + + /** + * 编辑 + * + * @param id 主键 + * @param projectGanttTsakCrForm 项目模型 + * @return + */ + @Operation(summary = "修改项目任务") + @PutMapping("/Task/{id}") + @Parameters({ + @Parameter(name = "projectGanttTsakCrForm", description = "项目模型",required = true), + @Parameter(name = "id", description = "主键",required = true), + }) + @SaCheckPermission("extend.projectGantt") + public ActionResult updateTask(@PathVariable("id") String id, @RequestBody @Valid ProjectGanttTsakUpForm projectGanttTsakCrForm) { + ProjectGanttEntity entity = JsonUtil.getJsonToBean(projectGanttTsakCrForm, ProjectGanttEntity.class); + if (projectGanttService.isExistByFullName(projectGanttTsakCrForm.getFullName(), id)) { + return ActionResult.fail("任务名称不能重复"); + } + boolean flag = projectGanttService.update(id, entity); + if (flag == false) { + return ActionResult.fail("更新失败,数据不存在"); + } + return ActionResult.success("更新成功"); + } + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/ReportManageController.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/ReportManageController.java new file mode 100644 index 0000000..592af0a --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/ReportManageController.java @@ -0,0 +1,77 @@ +package jnpf.controller; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import jnpf.base.ActionResult; +import jnpf.model.ReportManageModel; +import jnpf.util.JsonUtil; +import jnpf.util.PinYinUtil; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.ArrayList; +import java.util.List; + +/** + * 专业报表 + * + * @author JNPF开发平台组 + * @version 版 本:V3.0.0 + * @copyright 引迈信息技术有限公司 + * @date 日 期:2020.01.30 + */ +@Tag(name = "专业报表", description = "获取专业报表列表") +@RestController +@RequestMapping("/api/extend/ReportManage") +public class ReportManageController { + + /** + * 列表 + * + * @return + */ + @Operation(summary = "获取专业报表列表") + @GetMapping + public ActionResult list() { + List data = new ArrayList<>(); + int num = 1000000000; + for (int i = 0; i < fullNameList().length; i++) { + ReportManageModel model = new ReportManageModel(); + model.setId(String.valueOf(num+i+1)); + model.setFullName(fullNameList()[i]); + model.setUrlAddress(PinYinUtil.getFullSpell(fullNameList()[i])); + if (i < 8) { + model.setCategory(categoryList()[0]); + }else if(i>=8 && i<=12){ + model.setCategory(categoryList()[1]); + }else if(i>=13 && i<=14){ + model.setCategory(categoryList()[2]); + }else if(i>=15 && i<=17){ + model.setCategory(categoryList()[3]); + }else if(i>=18 && i<=20){ + model.setCategory(categoryList()[4]); + }else if(i>=21 && i<=23){ + model.setCategory(categoryList()[5]); + }else if(i>23){ + model.setCategory(categoryList()[6]); + } + data.add(model); + } + return ActionResult.success(JsonUtil.listToJsonField(data)); + } + + private String[] categoryList() { + String[] category = {"报表示例", "Excel表格类", "Word文档类", "分栏与分组", "报表套打", "图表类", "其他示例"}; + return category; + } + + private String[] fullNameList() { + String[] fullName = {"房地产驾驶舱", "数字化营销", "市场营销", "SMT车间看板", "学校综合业绩表", "热线机器人数据分析", "渠道零售", + "承包方调查表", "多维透视表", "复杂交叉表", "煤矿三量基础表", "土地资源", "小学课程表", "销售合同模板", "干部任免审批表", + "单级分组", "多级分组", "分栏报表", "国航机票", "客户订单套打", "快递单套打", "常规图表", "人员离职分析", "销售分析趋势", + "标签打印", "报表水印", "文档目录"}; + return fullName; + } + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/ReportTemplateController.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/ReportTemplateController.java new file mode 100644 index 0000000..d803976 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/ReportTemplateController.java @@ -0,0 +1,140 @@ +package jnpf.controller; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.util.JsonUtil; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +import java.util.List; +import java.util.Map; + +/** + * 订单收款 + * + * @author JNPF开发平台组 + * @version V1.2.191207 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +@Tag(name = "报表应用", description = "ReportTemplate") +@RestController +@RequestMapping("/api/extend/ReportTemplate") +public class ReportTemplateController { + + /** + * 商品采购报表 + * + * @return + */ + @Operation(summary = "获取商品采购报表") + @GetMapping("/Purchase") + public ActionResult purchaseList() { + String json = "[{\"f_date\":\"2015-11-30\",\"f_billNo\":\"CG20151130001\",\"f_buName\":\"长林电子材料厂\",\"f_invNo\":\"110013\",\"f_invName\":\"PVC包装纸\",\"f_unit\":\"箱\",\"f_location\":\"徐泾\",\"f_qty\":\"1000\",\"f_unitPrice\":\"12\",\"f_amount\":\"12000\",\"f_description\":null},{\"f_date\":\"2015-12-07\",\"f_billNo\":\"CG20151207001\",\"f_buName\":\"长林电子材料厂\",\"f_invNo\":\"110011\",\"f_invName\":\"泡棉\",\"f_unit\":\"箱\",\"f_location\":\"徐泾\",\"f_qty\":\"100\",\"f_unitPrice\":\"20\",\"f_amount\":\"2000\",\"f_description\":null},{\"f_date\":\"2015-12-08\",\"f_billNo\":\"CG20151208001\",\"f_buName\":\"长林电子材料厂\",\"f_invNo\":\"1001\",\"f_invName\":\"无纺布\",\"f_unit\":\"箱\",\"f_location\":\"徐泾\",\"f_qty\":\"900\",\"f_unitPrice\":\"30\",\"f_amount\":\"27000\",\"f_description\":null},{\"f_date\":\"2015-12-30\",\"f_billNo\":\"CG20151230001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"110013\",\"f_invName\":\"LED灯套\",\"f_unit\":\"箱\",\"f_location\":\"徐泾\",\"f_qty\":\"5\",\"f_unitPrice\":\"100\",\"f_amount\":\"500\",\"f_description\":null},{\"f_date\":\"2016-01-03\",\"f_billNo\":\"CG20160103001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"1002\",\"f_invName\":\"防尘罩\",\"f_unit\":\"箱\",\"f_location\":\"张江\",\"f_qty\":\"2\",\"f_unitPrice\":\"100\",\"f_amount\":\"200\",\"f_description\":null},{\"f_date\":\"2016-01-03\",\"f_billNo\":\"CG20160103001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"110011\",\"f_invName\":\"1号连接线\",\"f_unit\":\"箱\",\"f_location\":\"张江\",\"f_qty\":\"1\",\"f_unitPrice\":\"100\",\"f_amount\":\"100\",\"f_description\":null},{\"f_date\":\"2016-01-03\",\"f_billNo\":\"CG20160103001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"2001\",\"f_invName\":\"12#线路板\",\"f_unit\":\"吨\",\"f_location\":\"张江\",\"f_qty\":\"1\",\"f_unitPrice\":\"9000\",\"f_amount\":\"9000\",\"f_description\":null},{\"f_date\":\"2016-01-23\",\"f_billNo\":\"CG20160123001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"C00002\",\"f_invName\":\"防尘罩\",\"f_unit\":\"吨\",\"f_location\":\"张江\",\"f_qty\":\"3\",\"f_unitPrice\":\"9000\",\"f_amount\":\"27000\",\"f_description\":null},{\"f_date\":\"2016-02-10\",\"f_billNo\":\"CG20160210001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"1001\",\"f_invName\":\"1号连接线\",\"f_unit\":\"吨\",\"f_location\":\"张江\",\"f_qty\":\"4\",\"f_unitPrice\":\"8000\",\"f_amount\":\"32000\",\"f_description\":null},{\"f_date\":\"2016-02-22\",\"f_billNo\":\"CG20160222001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"A0001\",\"f_invName\":\"12#线路板\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"8\",\"f_unitPrice\":\"800\",\"f_amount\":\"6400\",\"f_description\":null},{\"f_date\":\"2016-03-02\",\"f_billNo\":\"CG20160302001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"1001\",\"f_invName\":\"12#线路板\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"1\",\"f_unitPrice\":\"800\",\"f_amount\":\"800\",\"f_description\":null},{\"f_date\":\"2016-03-24\",\"f_billNo\":\"CG20160324001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"A0001\",\"f_invName\":\"防尘罩\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"1\",\"f_unitPrice\":\"500\",\"f_amount\":\"500\",\"f_description\":null},{\"f_date\":\"2016-03-25\",\"f_billNo\":\"CG20160325001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"C00004\",\"f_invName\":\"LED灯套\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"1\",\"f_unitPrice\":\"900\",\"f_amount\":\"900\",\"f_description\":null},{\"f_date\":\"2016-03-25\",\"f_billNo\":\"CG20160325001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"1002\",\"f_invName\":\"12#线路板\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"2\",\"f_unitPrice\":\"400\",\"f_amount\":\"800\",\"f_description\":null},{\"f_date\":\"2016-03-25\",\"f_billNo\":\"CG20160325002\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"110011\",\"f_invName\":\"LED灯套\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"6\",\"f_unitPrice\":\"700\",\"f_amount\":\"42000\",\"f_description\":null},{\"f_date\":\"2016-03-25\",\"f_billNo\":\"CG20160325002\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"2001\",\"f_invName\":\"1号连接线\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"5\",\"f_unitPrice\":\"400\",\"f_amount\":\"2000\",\"f_description\":null},{\"f_date\":\"2016-04-13\",\"f_billNo\":\"CG20160413001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"110011\",\"f_invName\":\"LED灯套\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"6\",\"f_unitPrice\":\"500\",\"f_amount\":\"3000\",\"f_description\":null},{\"f_date\":\"2016-04-13\",\"f_billNo\":\"CG20160402001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"1001\",\"f_invName\":\"12#线路板\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"1\",\"f_unitPrice\":\"800\",\"f_amount\":\"800\",\"f_description\":null},{\"f_date\":\"2016-04-13\",\"f_billNo\":\"CG20160424001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"A0001\",\"f_invName\":\"防尘罩\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"1\",\"f_unitPrice\":\"500\",\"f_amount\":\"500\",\"f_description\":null},{\"f_date\":\"2016-04-13\",\"f_billNo\":\"CG20160425001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"C00004\",\"f_invName\":\"LED灯套\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"1\",\"f_unitPrice\":\"900\",\"f_amount\":\"900\",\"f_description\":null},{\"f_date\":\"2016-04-13\",\"f_billNo\":\"CG20160425001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"1002\",\"f_invName\":\"12#线路板\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"2\",\"f_unitPrice\":\"400\",\"f_amount\":\"800\",\"f_description\":null},{\"f_date\":\"2016-04-13\",\"f_billNo\":\"CG20160425002\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"110011\",\"f_invName\":\"LED灯套\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"6\",\"f_unitPrice\":\"700\",\"f_amount\":\"42000\",\"f_description\":null},{\"f_date\":\"2016-04-13\",\"f_billNo\":\"CG20160425002\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"2001\",\"f_invName\":\"1号连接线\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"5\",\"f_unitPrice\":\"400\",\"f_amount\":\"2000\",\"f_description\":null}]"; + List> data = JsonUtil.getJsonToListMap(json); + return ActionResult.success(data); + } + + /** + * 商品采购报表 - 导出Excel + * + * @return + */ + @Operation(summary = "(待定)商品采购报表 - 导出Excel") + @GetMapping("/PurchaseToExcel") + public void purchaseToExcel() { + String json = "[{\"f_date\":\"2015-11-30\",\"f_billNo\":\"CG20151130001\",\"f_buName\":\"长林电子材料厂\",\"f_invNo\":\"110013\",\"f_invName\":\"PVC包装纸\",\"f_unit\":\"箱\",\"f_location\":\"徐泾\",\"f_qty\":\"1000\",\"f_unitPrice\":\"12\",\"f_amount\":\"12000\",\"f_description\":null},{\"f_date\":\"2015-12-07\",\"f_billNo\":\"CG20151207001\",\"f_buName\":\"长林电子材料厂\",\"f_invNo\":\"110011\",\"f_invName\":\"泡棉\",\"f_unit\":\"箱\",\"f_location\":\"徐泾\",\"f_qty\":\"100\",\"f_unitPrice\":\"20\",\"f_amount\":\"2000\",\"f_description\":null},{\"f_date\":\"2015-12-08\",\"f_billNo\":\"CG20151208001\",\"f_buName\":\"长林电子材料厂\",\"f_invNo\":\"1001\",\"f_invName\":\"无纺布\",\"f_unit\":\"箱\",\"f_location\":\"徐泾\",\"f_qty\":\"900\",\"f_unitPrice\":\"30\",\"f_amount\":\"27000\",\"f_description\":null},{\"f_date\":\"2015-12-30\",\"f_billNo\":\"CG20151230001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"110013\",\"f_invName\":\"LED灯套\",\"f_unit\":\"箱\",\"f_location\":\"徐泾\",\"f_qty\":\"5\",\"f_unitPrice\":\"100\",\"f_amount\":\"500\",\"f_description\":null},{\"f_date\":\"2016-01-03\",\"f_billNo\":\"CG20160103001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"1002\",\"f_invName\":\"防尘罩\",\"f_unit\":\"箱\",\"f_location\":\"张江\",\"f_qty\":\"2\",\"f_unitPrice\":\"100\",\"f_amount\":\"200\",\"f_description\":null},{\"f_date\":\"2016-01-03\",\"f_billNo\":\"CG20160103001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"110011\",\"f_invName\":\"1号连接线\",\"f_unit\":\"箱\",\"f_location\":\"张江\",\"f_qty\":\"1\",\"f_unitPrice\":\"100\",\"f_amount\":\"100\",\"f_description\":null},{\"f_date\":\"2016-01-03\",\"f_billNo\":\"CG20160103001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"2001\",\"f_invName\":\"12#线路板\",\"f_unit\":\"吨\",\"f_location\":\"张江\",\"f_qty\":\"1\",\"f_unitPrice\":\"9000\",\"f_amount\":\"9000\",\"f_description\":null},{\"f_date\":\"2016-01-23\",\"f_billNo\":\"CG20160123001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"C00002\",\"f_invName\":\"防尘罩\",\"f_unit\":\"吨\",\"f_location\":\"张江\",\"f_qty\":\"3\",\"f_unitPrice\":\"9000\",\"f_amount\":\"27000\",\"f_description\":null},{\"f_date\":\"2016-02-10\",\"f_billNo\":\"CG20160210001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"1001\",\"f_invName\":\"1号连接线\",\"f_unit\":\"吨\",\"f_location\":\"张江\",\"f_qty\":\"4\",\"f_unitPrice\":\"8000\",\"f_amount\":\"32000\",\"f_description\":null},{\"f_date\":\"2016-02-22\",\"f_billNo\":\"CG20160222001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"A0001\",\"f_invName\":\"12#线路板\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"8\",\"f_unitPrice\":\"800\",\"f_amount\":\"6400\",\"f_description\":null},{\"f_date\":\"2016-03-02\",\"f_billNo\":\"CG20160302001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"1001\",\"f_invName\":\"12#线路板\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"1\",\"f_unitPrice\":\"800\",\"f_amount\":\"800\",\"f_description\":null},{\"f_date\":\"2016-03-24\",\"f_billNo\":\"CG20160324001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"A0001\",\"f_invName\":\"防尘罩\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"1\",\"f_unitPrice\":\"500\",\"f_amount\":\"500\",\"f_description\":null},{\"f_date\":\"2016-03-25\",\"f_billNo\":\"CG20160325001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"C00004\",\"f_invName\":\"LED灯套\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"1\",\"f_unitPrice\":\"900\",\"f_amount\":\"900\",\"f_description\":null},{\"f_date\":\"2016-03-25\",\"f_billNo\":\"CG20160325001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"1002\",\"f_invName\":\"12#线路板\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"2\",\"f_unitPrice\":\"400\",\"f_amount\":\"800\",\"f_description\":null},{\"f_date\":\"2016-03-25\",\"f_billNo\":\"CG20160325002\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"110011\",\"f_invName\":\"LED灯套\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"6\",\"f_unitPrice\":\"700\",\"f_amount\":\"42000\",\"f_description\":null},{\"f_date\":\"2016-03-25\",\"f_billNo\":\"CG20160325002\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"2001\",\"f_invName\":\"1号连接线\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"5\",\"f_unitPrice\":\"400\",\"f_amount\":\"2000\",\"f_description\":null},{\"f_date\":\"2016-04-13\",\"f_billNo\":\"CG20160413001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"110011\",\"f_invName\":\"LED灯套\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"6\",\"f_unitPrice\":\"500\",\"f_amount\":\"3000\",\"f_description\":null},{\"f_date\":\"2016-04-13\",\"f_billNo\":\"CG20160402001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"1001\",\"f_invName\":\"12#线路板\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"1\",\"f_unitPrice\":\"800\",\"f_amount\":\"800\",\"f_description\":null},{\"f_date\":\"2016-04-13\",\"f_billNo\":\"CG20160424001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"A0001\",\"f_invName\":\"防尘罩\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"1\",\"f_unitPrice\":\"500\",\"f_amount\":\"500\",\"f_description\":null},{\"f_date\":\"2016-04-13\",\"f_billNo\":\"CG20160425001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"C00004\",\"f_invName\":\"LED灯套\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"1\",\"f_unitPrice\":\"900\",\"f_amount\":\"900\",\"f_description\":null},{\"f_date\":\"2016-04-13\",\"f_billNo\":\"CG20160425001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"1002\",\"f_invName\":\"12#线路板\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"2\",\"f_unitPrice\":\"400\",\"f_amount\":\"800\",\"f_description\":null},{\"f_date\":\"2016-04-13\",\"f_billNo\":\"CG20160425002\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"110011\",\"f_invName\":\"LED灯套\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"6\",\"f_unitPrice\":\"700\",\"f_amount\":\"42000\",\"f_description\":null},{\"f_date\":\"2016-04-13\",\"f_billNo\":\"CG20160425002\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"2001\",\"f_invName\":\"1号连接线\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"5\",\"f_unitPrice\":\"400\",\"f_amount\":\"2000\",\"f_description\":null}]"; + List> data = JsonUtil.getJsonToListMap(json); + } + + /** + * 演示分组报表 + * + * @return + */ + @Operation(summary = "(待定)演示分组报表 - 导出Excel") + @GetMapping("/GroupList") + public ActionResult groupList() { + String json = "[{\"F_DepartmentName\":\"综合部\",\"F_UserId\":\"1\",\"F_UserName\":\"申志强\",\"F_Salary\":\"15,000.00\",\"F_Position\":\"人力资源\",\"F_EntryDate\":\"20141024\",\"F_Telephone\":\"13403555190\",\"F_Address\":\"辽宁\",\"F_ZipCode\":\"047300\"},{\"F_DepartmentName\":\"综合部\",\"F_UserId\":\"111\",\"F_UserName\":\"王建国\",\"F_Salary\":\"16,000.00\",\"F_Position\":\"人力资源\",\"F_EntryDate\":\"20141113\",\"F_Telephone\":\"15364758000\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"综合部\",\"F_UserId\":\"112\",\"F_UserName\":\"张义芳\",\"F_Salary\":\"20,000.00\",\"F_Position\":\"人力资源\",\"F_EntryDate\":\"20141117\",\"F_Telephone\":\"15935538888\",\"F_Address\":\"河南\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"综合部\",\"F_UserId\":\"113\",\"F_UserName\":\"原琼\",\"F_Salary\":\"20,000.50元\",\"F_Position\":\"人力资源\",\"F_EntryDate\":\"20141208\",\"F_Telephone\":\"13333550900\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"财务部\",\"F_UserId\":\"114\",\"F_UserName\":\"马惠军\",\"F_Salary\":\"12,000.00\",\"F_Position\":\"财务经理\",\"F_EntryDate\":\"20141015\",\"F_Telephone\":\"13383458811\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"财务部\",\"F_UserId\":\"115\",\"F_UserName\":\"武继宏\",\"F_Salary\":\"13,500.00\",\"F_Position\":\"财务经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13834776068\",\"F_Address\":\"山西\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"风险部\",\"F_UserId\":\"116\",\"F_UserName\":\"宋利敏\",\"F_Salary\":\"8,000.00\",\"F_Position\":\"风控经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"15234556806\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"风险部\",\"F_UserId\":\"117\",\"F_UserName\":\"王冀玲\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"风控经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13333554333\",\"F_Address\":\"山东\",\"F_ZipCode\":\"047300\"},{\"F_DepartmentName\":\"资金部\",\"F_UserId\":\"118\",\"F_UserName\":\"李燕红\",\"F_Salary\":\"50,000.00\",\"F_Position\":\"资金经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13333550900\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"资金部\",\"F_UserId\":\"119\",\"F_UserName\":\"郑 强\",\"F_Salary\":\"16,000.00\",\"F_Position\":\"资金经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13383458811\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"121\",\"F_UserName\":\"冯 莅\",\"F_Salary\":\"20,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13834776068\",\"F_Address\":\"天津\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"122\",\"F_UserName\":\"李静\",\"F_Salary\":\"20,000.50元\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"15234556806\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"总裁办\",\"F_UserId\":\"123\",\"F_UserName\":\"卫晓勤\",\"F_Salary\":\"12,000.00\",\"F_Position\":\"总助\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13333554333\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"风险部\",\"F_UserId\":\"124\",\"F_UserName\":\"张源\",\"F_Salary\":\"13,500.00\",\"F_Position\":\"风控经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13333550900\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"风险部\",\"F_UserId\":\"125\",\"F_UserName\":\"冯浩\",\"F_Salary\":\"8,000.00\",\"F_Position\":\"风控经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13383458811\",\"F_Address\":\"河北\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"资金部\",\"F_UserId\":\"126\",\"F_UserName\":\"张亚强\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"资金经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"15392555666\",\"F_Address\":\"石家庄\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"资金部\",\"F_UserId\":\"127\",\"F_UserName\":\"靳伟\",\"F_Salary\":\"50,000.00\",\"F_Position\":\"资金经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13994675055\",\"F_Address\":\"河北\",\"F_ZipCode\":\"047300\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"128\",\"F_UserName\":\"倪刚\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13720964398\",\"F_Address\":\"石家庄\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"129\",\"F_UserName\":\"王泓杰\",\"F_Salary\":\"16,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"18625504986\",\"F_Address\":\"石家庄\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"130\",\"F_UserName\":\"李晓波\",\"F_Salary\":\"20,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13935513232\",\"F_Address\":\"河北\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"131\",\"F_UserName\":\"张洋铭\",\"F_Salary\":\"20,000.50元\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20111219\",\"F_Telephone\":\"15234699068\",\"F_Address\":\"石家庄\",\"F_ZipCode\":\"046100\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"132\",\"F_UserName\":\"宋东\",\"F_Salary\":\"12,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20111219\",\"F_Telephone\":\"13453515589\",\"F_Address\":\"辽宁\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"133\",\"F_UserName\":\"李淑荣\",\"F_Salary\":\"13,500.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20111222\",\"F_Telephone\":\"13283557468\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"134\",\"F_UserName\":\"马垒布\",\"F_Salary\":\"8,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20111223\",\"F_Telephone\":\"18003456655\",\"F_Address\":\"河南\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"135\",\"F_UserName\":\"陈和平\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20111228\",\"F_Telephone\":\"18635531186\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"136\",\"F_UserName\":\"叶昌银\",\"F_Salary\":\"16,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20111229\",\"F_Telephone\":\"13203558555\",\"F_Address\":\"北京\",\"F_ZipCode\":\"047300\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"137\",\"F_UserName\":\"王增\",\"F_Salary\":\"20,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20120116\",\"F_Telephone\":\"15835557732\",\"F_Address\":\"山西\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"138\",\"F_UserName\":\"梁姝丽\",\"F_Salary\":\"20,000.50元\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20120118\",\"F_Telephone\":\"13453535388\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"139\",\"F_UserName\":\"申亚丽\",\"F_Salary\":\"12,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20120118\",\"F_Telephone\":\"18635559721\",\"F_Address\":\"山东\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"141\",\"F_UserName\":\"牛彩红\",\"F_Salary\":\"13,500.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20120119\",\"F_Telephone\":\"13835567286\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"142\",\"F_UserName\":\"陈玉芬\",\"F_Salary\":\"8,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20120208\",\"F_Telephone\":\"18636510130\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"143\",\"F_UserName\":\"秦虎明\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20120221\",\"F_Telephone\":\"15935502225\",\"F_Address\":\"天津\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"144\",\"F_UserName\":\"卢风莲\",\"F_Salary\":\"50,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20120301\",\"F_Telephone\":\"13509753890\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"风险部\",\"F_UserId\":\"145\",\"F_UserName\":\"李静\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"风控经理\",\"F_EntryDate\":\"20120302\",\"F_Telephone\":\"18636518169\",\"F_Address\":\"北京\",\"F_ZipCode\":\"047300\"},{\"F_DepartmentName\":\"风险部\",\"F_UserId\":\"146\",\"F_UserName\":\"申建文\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"风控经理\",\"F_EntryDate\":\"20120328\",\"F_Telephone\":\"13467048348\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"资金部\",\"F_UserId\":\"147\",\"F_UserName\":\"王慧芳\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"资金经理\",\"F_EntryDate\":\"20120328\",\"F_Telephone\":\"13233363689\",\"F_Address\":\"河北\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"资金部\",\"F_UserId\":\"148\",\"F_UserName\":\"马建刚\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"资金经理\",\"F_EntryDate\":\"20131017\",\"F_Telephone\":\"18235562999\",\"F_Address\":\"石家庄\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"综合部\",\"F_UserId\":\"149\",\"F_UserName\":\"孛森润\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"人力资源\",\"F_EntryDate\":\"20131018\",\"F_Telephone\":\"13096666703\",\"F_Address\":\"河北\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"综合部\",\"F_UserId\":\"151\",\"F_UserName\":\"宋拴琴\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"人力资源\",\"F_EntryDate\":\"20131028\",\"F_Telephone\":\"13994659670\",\"F_Address\":\"石家庄\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"综合部\",\"F_UserId\":\"152\",\"F_UserName\":\"姜旭军\",\"F_Salary\":\"10,001.50元\",\"F_Position\":\"综合部总监\",\"F_EntryDate\":\"20131030\",\"F_Telephone\":\"18636518186\",\"F_Address\":\"石家庄\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"财务部\",\"F_UserId\":\"153\",\"F_UserName\":\"丁路广\",\"F_Salary\":\"15,000.00\",\"F_Position\":\"财务部出纳\",\"F_EntryDate\":\"20130805\",\"F_Telephone\":\"15534555586\",\"F_Address\":\"辽宁\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"财务部\",\"F_UserId\":\"154\",\"F_UserName\":\"陈连胜\",\"F_Salary\":\"16,000.00\",\"F_Position\":\"财务部总监\",\"F_EntryDate\":\"20130805\",\"F_Telephone\":\"18903452550\",\"F_Address\":\"北京\",\"F_ZipCode\":\"047300\"},{\"F_DepartmentName\":\"风险部\",\"F_UserId\":\"155\",\"F_UserName\":\"苗艳芳\",\"F_Salary\":\"20,000.00\",\"F_Position\":\"风控经理\",\"F_EntryDate\":\"20130829\",\"F_Telephone\":\"13994633133\",\"F_Address\":\"河南\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"风险部\",\"F_UserId\":\"156\",\"F_UserName\":\"张俊莲\",\"F_Salary\":\"20,000.50元\",\"F_Position\":\"风控总监\",\"F_EntryDate\":\"20130829\",\"F_Telephone\":\"13994631297\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"资金部\",\"F_UserId\":\"157\",\"F_UserName\":\"陈永庆\",\"F_Salary\":\"12,000.00\",\"F_Position\":\"资金经理\",\"F_EntryDate\":\"20130917\",\"F_Telephone\":\"15534578988\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"资金部\",\"F_UserId\":\"158\",\"F_UserName\":\"李晓飞\",\"F_Salary\":\"13,500.00\",\"F_Position\":\"资金总监\",\"F_EntryDate\":\"20130917\",\"F_Telephone\":\"15935533271\",\"F_Address\":\"山西\",\"F_ZipCode\":\"046100\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"159\",\"F_UserName\":\"葛明伟\",\"F_Salary\":\"8,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20130927\",\"F_Telephone\":\"18635550586\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"160\",\"F_UserName\":\"王金才\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"业务总监\",\"F_EntryDate\":\"20131010\",\"F_Telephone\":\"15035554586\",\"F_Address\":\"山东\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"总裁办\",\"F_UserId\":\"161\",\"F_UserName\":\"王炜\",\"F_Salary\":\"50,000.00\",\"F_Position\":\"总裁CEO\",\"F_EntryDate\":\"20140409\",\"F_Telephone\":\"13333550900\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"总裁办\",\"F_UserId\":\"162\",\"F_UserName\":\"张亚楠\",\"F_Salary\":\"50,000.00\",\"F_Position\":\"总助\",\"F_EntryDate\":\"20140409\",\"F_Telephone\":\"13383458811\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"163\",\"F_UserName\":\"段卫军\",\"F_Salary\":\"8,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20140409\",\"F_Telephone\":\"13513553121\",\"F_Address\":\"天津\",\"F_ZipCode\":\"047300\"}]"; + List> data = JsonUtil.getJsonToListMap(json); + return ActionResult.success(data); + } + + /** + * 演示分组报表 - 导出Excel + * + * @return + */ + @Operation(summary = "(待定)演示分组报表 - 导出Excel") + @GetMapping("/GroupToExcel") + public void groupToExcel() { + String json = "[{\"F_DepartmentName\":\"综合部\",\"F_UserId\":\"1\",\"F_UserName\":\"申志强\",\"F_Salary\":\"15,000.00\",\"F_Position\":\"人力资源\",\"F_EntryDate\":\"20141024\",\"F_Telephone\":\"13403555190\",\"F_Address\":\"辽宁\",\"F_ZipCode\":\"047300\"},{\"F_DepartmentName\":\"综合部\",\"F_UserId\":\"111\",\"F_UserName\":\"王建国\",\"F_Salary\":\"16,000.00\",\"F_Position\":\"人力资源\",\"F_EntryDate\":\"20141113\",\"F_Telephone\":\"15364758000\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"综合部\",\"F_UserId\":\"112\",\"F_UserName\":\"张义芳\",\"F_Salary\":\"20,000.00\",\"F_Position\":\"人力资源\",\"F_EntryDate\":\"20141117\",\"F_Telephone\":\"15935538888\",\"F_Address\":\"河南\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"综合部\",\"F_UserId\":\"113\",\"F_UserName\":\"原琼\",\"F_Salary\":\"20,000.50元\",\"F_Position\":\"人力资源\",\"F_EntryDate\":\"20141208\",\"F_Telephone\":\"13333550900\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"财务部\",\"F_UserId\":\"114\",\"F_UserName\":\"马惠军\",\"F_Salary\":\"12,000.00\",\"F_Position\":\"财务经理\",\"F_EntryDate\":\"20141015\",\"F_Telephone\":\"13383458811\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"财务部\",\"F_UserId\":\"115\",\"F_UserName\":\"武继宏\",\"F_Salary\":\"13,500.00\",\"F_Position\":\"财务经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13834776068\",\"F_Address\":\"山西\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"风险部\",\"F_UserId\":\"116\",\"F_UserName\":\"宋利敏\",\"F_Salary\":\"8,000.00\",\"F_Position\":\"风控经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"15234556806\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"风险部\",\"F_UserId\":\"117\",\"F_UserName\":\"王冀玲\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"风控经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13333554333\",\"F_Address\":\"山东\",\"F_ZipCode\":\"047300\"},{\"F_DepartmentName\":\"资金部\",\"F_UserId\":\"118\",\"F_UserName\":\"李燕红\",\"F_Salary\":\"50,000.00\",\"F_Position\":\"资金经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13333550900\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"资金部\",\"F_UserId\":\"119\",\"F_UserName\":\"郑 强\",\"F_Salary\":\"16,000.00\",\"F_Position\":\"资金经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13383458811\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"121\",\"F_UserName\":\"冯 莅\",\"F_Salary\":\"20,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13834776068\",\"F_Address\":\"天津\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"122\",\"F_UserName\":\"李静\",\"F_Salary\":\"20,000.50元\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"15234556806\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"总裁办\",\"F_UserId\":\"123\",\"F_UserName\":\"卫晓勤\",\"F_Salary\":\"12,000.00\",\"F_Position\":\"总助\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13333554333\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"风险部\",\"F_UserId\":\"124\",\"F_UserName\":\"张源\",\"F_Salary\":\"13,500.00\",\"F_Position\":\"风控经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13333550900\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"风险部\",\"F_UserId\":\"125\",\"F_UserName\":\"冯浩\",\"F_Salary\":\"8,000.00\",\"F_Position\":\"风控经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13383458811\",\"F_Address\":\"河北\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"资金部\",\"F_UserId\":\"126\",\"F_UserName\":\"张亚强\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"资金经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"15392555666\",\"F_Address\":\"石家庄\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"资金部\",\"F_UserId\":\"127\",\"F_UserName\":\"靳伟\",\"F_Salary\":\"50,000.00\",\"F_Position\":\"资金经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13994675055\",\"F_Address\":\"河北\",\"F_ZipCode\":\"047300\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"128\",\"F_UserName\":\"倪刚\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13720964398\",\"F_Address\":\"石家庄\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"129\",\"F_UserName\":\"王泓杰\",\"F_Salary\":\"16,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"18625504986\",\"F_Address\":\"石家庄\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"130\",\"F_UserName\":\"李晓波\",\"F_Salary\":\"20,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13935513232\",\"F_Address\":\"河北\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"131\",\"F_UserName\":\"张洋铭\",\"F_Salary\":\"20,000.50元\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20111219\",\"F_Telephone\":\"15234699068\",\"F_Address\":\"石家庄\",\"F_ZipCode\":\"046100\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"132\",\"F_UserName\":\"宋东\",\"F_Salary\":\"12,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20111219\",\"F_Telephone\":\"13453515589\",\"F_Address\":\"辽宁\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"133\",\"F_UserName\":\"李淑荣\",\"F_Salary\":\"13,500.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20111222\",\"F_Telephone\":\"13283557468\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"134\",\"F_UserName\":\"马垒布\",\"F_Salary\":\"8,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20111223\",\"F_Telephone\":\"18003456655\",\"F_Address\":\"河南\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"135\",\"F_UserName\":\"陈和平\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20111228\",\"F_Telephone\":\"18635531186\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"136\",\"F_UserName\":\"叶昌银\",\"F_Salary\":\"16,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20111229\",\"F_Telephone\":\"13203558555\",\"F_Address\":\"北京\",\"F_ZipCode\":\"047300\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"137\",\"F_UserName\":\"王增\",\"F_Salary\":\"20,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20120116\",\"F_Telephone\":\"15835557732\",\"F_Address\":\"山西\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"138\",\"F_UserName\":\"梁姝丽\",\"F_Salary\":\"20,000.50元\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20120118\",\"F_Telephone\":\"13453535388\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"139\",\"F_UserName\":\"申亚丽\",\"F_Salary\":\"12,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20120118\",\"F_Telephone\":\"18635559721\",\"F_Address\":\"山东\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"141\",\"F_UserName\":\"牛彩红\",\"F_Salary\":\"13,500.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20120119\",\"F_Telephone\":\"13835567286\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"142\",\"F_UserName\":\"陈玉芬\",\"F_Salary\":\"8,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20120208\",\"F_Telephone\":\"18636510130\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"143\",\"F_UserName\":\"秦虎明\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20120221\",\"F_Telephone\":\"15935502225\",\"F_Address\":\"天津\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"144\",\"F_UserName\":\"卢风莲\",\"F_Salary\":\"50,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20120301\",\"F_Telephone\":\"13509753890\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"风险部\",\"F_UserId\":\"145\",\"F_UserName\":\"李静\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"风控经理\",\"F_EntryDate\":\"20120302\",\"F_Telephone\":\"18636518169\",\"F_Address\":\"北京\",\"F_ZipCode\":\"047300\"},{\"F_DepartmentName\":\"风险部\",\"F_UserId\":\"146\",\"F_UserName\":\"申建文\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"风控经理\",\"F_EntryDate\":\"20120328\",\"F_Telephone\":\"13467048348\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"资金部\",\"F_UserId\":\"147\",\"F_UserName\":\"王慧芳\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"资金经理\",\"F_EntryDate\":\"20120328\",\"F_Telephone\":\"13233363689\",\"F_Address\":\"河北\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"资金部\",\"F_UserId\":\"148\",\"F_UserName\":\"马建刚\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"资金经理\",\"F_EntryDate\":\"20131017\",\"F_Telephone\":\"18235562999\",\"F_Address\":\"石家庄\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"综合部\",\"F_UserId\":\"149\",\"F_UserName\":\"孛森润\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"人力资源\",\"F_EntryDate\":\"20131018\",\"F_Telephone\":\"13096666703\",\"F_Address\":\"河北\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"综合部\",\"F_UserId\":\"151\",\"F_UserName\":\"宋拴琴\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"人力资源\",\"F_EntryDate\":\"20131028\",\"F_Telephone\":\"13994659670\",\"F_Address\":\"石家庄\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"综合部\",\"F_UserId\":\"152\",\"F_UserName\":\"姜旭军\",\"F_Salary\":\"10,001.50元\",\"F_Position\":\"综合部总监\",\"F_EntryDate\":\"20131030\",\"F_Telephone\":\"18636518186\",\"F_Address\":\"石家庄\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"财务部\",\"F_UserId\":\"153\",\"F_UserName\":\"丁路广\",\"F_Salary\":\"15,000.00\",\"F_Position\":\"财务部出纳\",\"F_EntryDate\":\"20130805\",\"F_Telephone\":\"15534555586\",\"F_Address\":\"辽宁\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"财务部\",\"F_UserId\":\"154\",\"F_UserName\":\"陈连胜\",\"F_Salary\":\"16,000.00\",\"F_Position\":\"财务部总监\",\"F_EntryDate\":\"20130805\",\"F_Telephone\":\"18903452550\",\"F_Address\":\"北京\",\"F_ZipCode\":\"047300\"},{\"F_DepartmentName\":\"风险部\",\"F_UserId\":\"155\",\"F_UserName\":\"苗艳芳\",\"F_Salary\":\"20,000.00\",\"F_Position\":\"风控经理\",\"F_EntryDate\":\"20130829\",\"F_Telephone\":\"13994633133\",\"F_Address\":\"河南\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"风险部\",\"F_UserId\":\"156\",\"F_UserName\":\"张俊莲\",\"F_Salary\":\"20,000.50元\",\"F_Position\":\"风控总监\",\"F_EntryDate\":\"20130829\",\"F_Telephone\":\"13994631297\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"资金部\",\"F_UserId\":\"157\",\"F_UserName\":\"陈永庆\",\"F_Salary\":\"12,000.00\",\"F_Position\":\"资金经理\",\"F_EntryDate\":\"20130917\",\"F_Telephone\":\"15534578988\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"资金部\",\"F_UserId\":\"158\",\"F_UserName\":\"李晓飞\",\"F_Salary\":\"13,500.00\",\"F_Position\":\"资金总监\",\"F_EntryDate\":\"20130917\",\"F_Telephone\":\"15935533271\",\"F_Address\":\"山西\",\"F_ZipCode\":\"046100\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"159\",\"F_UserName\":\"葛明伟\",\"F_Salary\":\"8,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20130927\",\"F_Telephone\":\"18635550586\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"160\",\"F_UserName\":\"王金才\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"业务总监\",\"F_EntryDate\":\"20131010\",\"F_Telephone\":\"15035554586\",\"F_Address\":\"山东\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"总裁办\",\"F_UserId\":\"161\",\"F_UserName\":\"王炜\",\"F_Salary\":\"50,000.00\",\"F_Position\":\"总裁CEO\",\"F_EntryDate\":\"20140409\",\"F_Telephone\":\"13333550900\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"总裁办\",\"F_UserId\":\"162\",\"F_UserName\":\"张亚楠\",\"F_Salary\":\"50,000.00\",\"F_Position\":\"总助\",\"F_EntryDate\":\"20140409\",\"F_Telephone\":\"13383458811\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"163\",\"F_UserName\":\"段卫军\",\"F_Salary\":\"8,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20140409\",\"F_Telephone\":\"13513553121\",\"F_Address\":\"天津\",\"F_ZipCode\":\"047300\"}]"; + List> data = JsonUtil.getJsonToListMap(json); + } + + /** + * 组合多图表报表 + * + * @return + */ + @Operation(summary = "获取组合多图表报表") + @GetMapping("/Combination") + public ActionResult combinationList() { + String json = "[{\"F_UserName\":\"李贵宾\",\"F_Jan\":\"108\",\"F_Feb\":\"231\",\"F_Mar\":\"389\",\"F_Apr\":\"808\",\"F_May\":\"160\",\"F_Jun\":\"266\",\"F_Jul\":\"374\",\"F_Aug\":\"241\",\"F_Sep\":\"144\",\"F_Oct\":\"172\",\"F_Nov\":\"607\",\"F_Dec\":\"217\"},{\"F_UserName\":\"张琳蓉\",\"F_Jan\":\"205\",\"F_Feb\":\"249\",\"F_Mar\":\"552\",\"F_Apr\":\"71\",\"F_May\":\"511\",\"F_Jun\":\"236\",\"F_Jul\":\"795\",\"F_Aug\":\"10\",\"F_Sep\":\"31\",\"F_Oct\":\"38\",\"F_Nov\":\"107\",\"F_Dec\":\"344\"},{\"F_UserName\":\"邱杨佳\",\"F_Jan\":\"101\",\"F_Feb\":\"236\",\"F_Mar\":\"374\",\"F_Apr\":\"73\",\"F_May\":\"66\",\"F_Jun\":\"11\",\"F_Jul\":\"12\",\"F_Aug\":\"37\",\"F_Sep\":\"11\",\"F_Oct\":\"93\",\"F_Nov\":\"107\",\"F_Dec\":\"239\"},{\"F_UserName\":\"张红霞\",\"F_Jan\":\"738\",\"F_Feb\":\"451\",\"F_Mar\":\"37\",\"F_Apr\":\"404\",\"F_May\":\"336\",\"F_Jun\":\"373\",\"F_Jul\":\"715\",\"F_Aug\":\"678\",\"F_Sep\":\"437\",\"F_Oct\":\"551\",\"F_Nov\":\"101\",\"F_Dec\":\"127\"},{\"F_UserName\":\"朱鹏\",\"F_Jan\":\"256\",\"F_Feb\":\"221\",\"F_Mar\":\"104\",\"F_Apr\":\"115\",\"F_May\":\"289\",\"F_Jun\":\"654\",\"F_Jul\":\"488\",\"F_Aug\":\"225\",\"F_Sep\":\"267\",\"F_Oct\":\"127\",\"F_Nov\":\"0\",\"F_Dec\":\"314\"},{\"F_UserName\":\"张峰\",\"F_Jan\":\"488\",\"F_Feb\":\"535\",\"F_Mar\":\"115\",\"F_Apr\":\"667\",\"F_May\":\"370\",\"F_Jun\":\"379\",\"F_Jul\":\"90\",\"F_Aug\":\"437\",\"F_Sep\":\"115\",\"F_Oct\":\"267\",\"F_Nov\":\"372\",\"F_Dec\":\"438\"},{\"F_UserName\":\"王瑞\",\"F_Jan\":\"939\",\"F_Feb\":\"262\",\"F_Mar\":\"351\",\"F_Apr\":\"478\",\"F_May\":\"162\",\"F_Jun\":\"125\",\"F_Jul\":\"115\",\"F_Aug\":\"535\",\"F_Sep\":\"522\",\"F_Oct\":\"315\",\"F_Nov\":\"315\",\"F_Dec\":\"90\"},{\"F_UserName\":\"秦涛\",\"F_Jan\":\"146\",\"F_Feb\":\"488\",\"F_Mar\":\"535\",\"F_Apr\":\"127\",\"F_May\":\"906\",\"F_Jun\":\"66\",\"F_Jul\":\"607\",\"F_Aug\":\"116\",\"F_Sep\":\"93\",\"F_Oct\":\"618\",\"F_Nov\":\"66\",\"F_Dec\":\"643\"},{\"F_UserName\":\"郭强\",\"F_Jan\":\"108\",\"F_Feb\":\"268\",\"F_Mar\":\"653\",\"F_Apr\":\"314\",\"F_May\":\"481\",\"F_Jun\":\"535\",\"F_Jul\":\"132\",\"F_Aug\":\"12\",\"F_Sep\":\"336\",\"F_Oct\":\"768\",\"F_Nov\":\"244\",\"F_Dec\":\"122\"},{\"F_UserName\":\"赵丹\",\"F_Jan\":\"48\",\"F_Feb\":\"12\",\"F_Mar\":\"969\",\"F_Apr\":\"241\",\"F_May\":\"939\",\"F_Jun\":\"172\",\"F_Jul\":\"286\",\"F_Aug\":\"404\",\"F_Sep\":\"990\",\"F_Oct\":\"11\",\"F_Nov\":\"484\",\"F_Dec\":\"76\"}]"; + List> data = JsonUtil.getJsonToListMap(json); + return ActionResult.success(data); + } + + /** + * 月度工资对比表 + * + * @return + */ + @Operation(summary = "获取月度工资对比表") + @GetMapping("/Month") + public ActionResult monthList() { + String json = "[{\"F_Item\":\"财务部\",\"F_LastMonthNumber\":\"2\",\"F_LastMonthPay\":\"9008\",\"F_ThisMonthNumber\":\"2\",\"F_ThisMonthPay\":\"12800\",\"F_ChangeNumber\":\"0\",\"F_ChangePay\":\"3792\",\"F_ChangeDescription\":\"\"},{\"F_Item\":\"企划部\",\"F_LastMonthNumber\":\"3\",\"F_LastMonthPay\":\"29280\",\"F_ThisMonthNumber\":\"3\",\"F_ThisMonthPay\":\"26235\",\"F_ChangeNumber\":\"0\",\"F_ChangePay\":\"-3045\",\"F_ChangeDescription\":\"\"},{\"F_Item\":\"招商运营部\",\"F_LastMonthNumber\":\"3\",\"F_LastMonthPay\":\"9392\",\"F_ThisMonthNumber\":\"2\",\"F_ThisMonthPay\":\"4092.31\",\"F_ChangeNumber\":\"-1\",\"F_ChangePay\":\"-5299.69\",\"F_ChangeDescription\":\"离职\"},{\"F_Item\":\"物业管理部\",\"F_LastMonthNumber\":\"4\",\"F_LastMonthPay\":\"16450\",\"F_ThisMonthNumber\":\"5\",\"F_ThisMonthPay\":\"1744.86\",\"F_ChangeNumber\":\"1\",\"F_ChangePay\":\"998.46\",\"F_ChangeDescription\":\"新招\"},{\"F_Item\":\"总经办\",\"F_LastMonthNumber\":\"0\",\"F_LastMonthPay\":\"0\",\"F_ThisMonthNumber\":\"2\",\"F_ThisMonthPay\":\"6264.23\",\"F_ChangeNumber\":\"2\",\"F_ChangePay\":\"6264.23\",\"F_ChangeDescription\":\"扩大队伍\"},{\"F_Item\":\"技术部\",\"F_LastMonthNumber\":\"3\",\"F_LastMonthPay\":\"7257\",\"F_ThisMonthNumber\":\"6\",\"F_ThisMonthPay\":\"6264.23\",\"F_ChangeNumber\":\"3\",\"F_ChangePay\":\"6061.85\",\"F_ChangeDescription\":\"业务增加\"},{\"F_Item\":\"调出\",\"F_LastMonthNumber\":\"4\",\"F_LastMonthPay\":\"10560\",\"F_ThisMonthNumber\":\"2\",\"F_ThisMonthPay\":\"7185\",\"F_ChangeNumber\":\"-2\",\"F_ChangePay\":\"-3375\",\"F_ChangeDescription\":\"\"}]"; + List> data = JsonUtil.getJsonToListMap(json); + return ActionResult.success(data); + } + + /** + * 月度工资对比表 - 导出Excel + * + * @return + */ + @Operation(summary = "(待定)月度工资对比表 - 导出Excel") + @GetMapping("/MonthToExcel") + public void monthToExcel() { + String json = "[{\"F_Item\":\"财务部\",\"F_LastMonthNumber\":\"2\",\"F_LastMonthPay\":\"9008\",\"F_ThisMonthNumber\":\"2\",\"F_ThisMonthPay\":\"12800\",\"F_ChangeNumber\":\"0\",\"F_ChangePay\":\"3792\",\"F_ChangeDescription\":\"\"},{\"F_Item\":\"企划部\",\"F_LastMonthNumber\":\"3\",\"F_LastMonthPay\":\"29280\",\"F_ThisMonthNumber\":\"3\",\"F_ThisMonthPay\":\"26235\",\"F_ChangeNumber\":\"0\",\"F_ChangePay\":\"-3045\",\"F_ChangeDescription\":\"\"},{\"F_Item\":\"招商运营部\",\"F_LastMonthNumber\":\"3\",\"F_LastMonthPay\":\"9392\",\"F_ThisMonthNumber\":\"2\",\"F_ThisMonthPay\":\"4092.31\",\"F_ChangeNumber\":\"-1\",\"F_ChangePay\":\"-5299.69\",\"F_ChangeDescription\":\"离职\"},{\"F_Item\":\"物业管理部\",\"F_LastMonthNumber\":\"4\",\"F_LastMonthPay\":\"16450\",\"F_ThisMonthNumber\":\"5\",\"F_ThisMonthPay\":\"1744.86\",\"F_ChangeNumber\":\"1\",\"F_ChangePay\":\"998.46\",\"F_ChangeDescription\":\"新招\"},{\"F_Item\":\"总经办\",\"F_LastMonthNumber\":\"0\",\"F_LastMonthPay\":\"0\",\"F_ThisMonthNumber\":\"2\",\"F_ThisMonthPay\":\"6264.23\",\"F_ChangeNumber\":\"2\",\"F_ChangePay\":\"6264.23\",\"F_ChangeDescription\":\"扩大队伍\"},{\"F_Item\":\"技术部\",\"F_LastMonthNumber\":\"3\",\"F_LastMonthPay\":\"7257\",\"F_ThisMonthNumber\":\"6\",\"F_ThisMonthPay\":\"6264.23\",\"F_ChangeNumber\":\"3\",\"F_ChangePay\":\"6061.85\",\"F_ChangeDescription\":\"业务增加\"},{\"F_Item\":\"调出\",\"F_LastMonthNumber\":\"4\",\"F_LastMonthPay\":\"10560\",\"F_ThisMonthNumber\":\"2\",\"F_ThisMonthPay\":\"7185\",\"F_ChangeNumber\":\"-2\",\"F_ChangePay\":\"-3375\",\"F_ChangeDescription\":\"\"}]"; + List> data = JsonUtil.getJsonToListMap(json); + } + + /** + * 季度销售对比表 + * + * @return + */ + @Operation(summary = "获取季度销售对比表") + @GetMapping("/Quarter") + public ActionResult quarterList() { + String json = "[{\"F_Year\":\"2017\",\"F_Quarter\":\"一季度\",\"F_Number\":\"100000\",\"F_Money\":\"4000000\",\"F_LastQuarter\":\"6.81\",\"F_LastYear\":\"0.992\"},{\"F_Year\":\"2017\",\"F_Quarter\":\"二季度\",\"F_Number\":\"3000000\",\"F_Money\":\"23450000\",\"F_LastQuarter\":\"7.5\",\"F_LastYear\":\"0.888\"},{\"F_Year\":\"2017\",\"F_Quarter\":\"三季度\",\"F_Number\":\"230000\",\"F_Money\":\"500000\",\"F_LastQuarter\":\"6.93\",\"F_LastYear\":\"0.777\"},{\"F_Year\":\"2017\",\"F_Quarter\":\"四季度\",\"F_Number\":\"50000000\",\"F_Money\":\"20000000\",\"F_LastQuarter\":\"23.5\",\"F_LastYear\":\"1.45\"},{\"F_Year\":\"2017\",\"F_Quarter\":\"合计\",\"F_Number\":\"53330000\",\"F_Money\":\"47950000\",\"F_LastQuarter\":\"\",\"F_LastYear\":\"\"},{\"F_Year\":\"2018\",\"F_Quarter\":\"一季度\",\"F_Number\":\"200000\",\"F_Money\":\"6000000\",\"F_LastQuarter\":\"8.81\",\"F_LastYear\":\"0.782\"},{\"F_Year\":\"2018\",\"F_Quarter\":\"二季度\",\"F_Number\":\"1500000\",\"F_Money\":\"230000\",\"F_LastQuarter\":\"4.5\",\"F_LastYear\":\"0.488\"},{\"F_Year\":\"2018\",\"F_Quarter\":\"三季度\",\"F_Number\":\"3000000\",\"F_Money\":\"532000\",\"F_LastQuarter\":\"8.93\",\"F_LastYear\":\"0.797\"},{\"F_Year\":\"2018\",\"F_Quarter\":\"四季度\",\"F_Number\":\"47000000\",\"F_Money\":\"212000\",\"F_LastQuarter\":\"12.5\",\"F_LastYear\":\"1.47\"},{\"F_Year\":\"2018\",\"F_Quarter\":\"合计\",\"F_Number\":\"51700000\",\"F_Money\":\"6974000\",\"F_LastQuarter\":\"\",\"F_LastYear\":\"\"}]"; + List> data = JsonUtil.getJsonToListMap(json); + return ActionResult.success(data); + } + + /** + * 季度销售对比表 - 导出Excel + * + * @return + */ + @Operation(summary = "(待定)季度销售对比表 - 导出Excel") + @GetMapping("/QuarterToExcel") + public void quarterToExcel() { + String json = "[{\"F_Year\":\"2017\",\"F_Quarter\":\"一季度\",\"F_Number\":\"100000\",\"F_Money\":\"4000000\",\"F_LastQuarter\":\"6.81\",\"F_LastYear\":\"0.992\"},{\"F_Year\":\"2017\",\"F_Quarter\":\"二季度\",\"F_Number\":\"3000000\",\"F_Money\":\"23450000\",\"F_LastQuarter\":\"7.5\",\"F_LastYear\":\"0.888\"},{\"F_Year\":\"2017\",\"F_Quarter\":\"三季度\",\"F_Number\":\"230000\",\"F_Money\":\"500000\",\"F_LastQuarter\":\"6.93\",\"F_LastYear\":\"0.777\"},{\"F_Year\":\"2017\",\"F_Quarter\":\"四季度\",\"F_Number\":\"50000000\",\"F_Money\":\"20000000\",\"F_LastQuarter\":\"23.5\",\"F_LastYear\":\"1.45\"},{\"F_Year\":\"2017\",\"F_Quarter\":\"合计\",\"F_Number\":\"53330000\",\"F_Money\":\"47950000\",\"F_LastQuarter\":\"\",\"F_LastYear\":\"\"},{\"F_Year\":\"2018\",\"F_Quarter\":\"一季度\",\"F_Number\":\"200000\",\"F_Money\":\"6000000\",\"F_LastQuarter\":\"8.81\",\"F_LastYear\":\"0.782\"},{\"F_Year\":\"2018\",\"F_Quarter\":\"二季度\",\"F_Number\":\"1500000\",\"F_Money\":\"230000\",\"F_LastQuarter\":\"4.5\",\"F_LastYear\":\"0.488\"},{\"F_Year\":\"2018\",\"F_Quarter\":\"三季度\",\"F_Number\":\"3000000\",\"F_Money\":\"532000\",\"F_LastQuarter\":\"8.93\",\"F_LastYear\":\"0.797\"},{\"F_Year\":\"2018\",\"F_Quarter\":\"四季度\",\"F_Number\":\"47000000\",\"F_Money\":\"212000\",\"F_LastQuarter\":\"12.5\",\"F_LastYear\":\"1.47\"},{\"F_Year\":\"2018\",\"F_Quarter\":\"合计\",\"F_Number\":\"51700000\",\"F_Money\":\"6974000\",\"F_LastQuarter\":\"\",\"F_LastYear\":\"\"}]"; + List> data = JsonUtil.getJsonToListMap(json); + } +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/TableExampleController.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/TableExampleController.java new file mode 100644 index 0000000..0bd30ad --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/TableExampleController.java @@ -0,0 +1,450 @@ +package jnpf.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import jnpf.base.ActionResult; +import jnpf.base.Page; +import jnpf.base.UserInfo; +import jnpf.base.controller.SuperController; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.constant.MsgCode; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.UserService; +import jnpf.util.JsonUtilEx; +import jnpf.base.ActionResult; +import jnpf.base.vo.PageListVO; +import jnpf.base.vo.PaginationVO; +import jnpf.base.UserInfo; +import jnpf.base.service.DictionaryDataService; +import jnpf.base.service.ProvinceService; +import jnpf.base.vo.ListVO; +import jnpf.entity.TableExampleEntity; +import jnpf.base.entity.DictionaryDataEntity; +import jnpf.base.entity.ProvinceEntity; +import jnpf.exception.DataException; +import jnpf.model.tableexample.*; +import jnpf.model.tableexample.postil.PostilInfoVO; +import jnpf.model.tableexample.postil.PostilModel; +import jnpf.model.tableexample.postil.PostilSendForm; +import jnpf.service.TableExampleService; +import jnpf.util.DateUtil; +import jnpf.util.JsonUtil; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import jnpf.util.treeutil.SumTree; +import jnpf.util.treeutil.TreeDotUtils; +import jnpf.util.type.StringNumber; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 表格示例数据 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月26日 上午9:18 + */ +@Tag(name = "表格示例数据", description = "TableExample") +@RestController +@RequestMapping("/api/extend/TableExample") +public class TableExampleController extends SuperController { + + @Autowired + private TableExampleService tableExampleService; + @Autowired + private ProvinceService provinceService; + @Autowired + private DictionaryDataService dictionaryDataService; + @Autowired + private UserProvider userProvider; + @Autowired + private UserService userService; + + /** + * 列表 + * + * @param paginationTableExample 分页模型 + * @return + */ + @Operation(summary = "获取表格数据列表") + @GetMapping + @SaCheckPermission("extend.tableDemo.commonTable") + public ActionResult> list(PaginationTableExample paginationTableExample) { + List data = tableExampleService.getList(paginationTableExample); + List list = JsonUtil.getJsonToList(data, TableExampleListVO.class); + List userId = list.stream().map(t -> t.getRegistrant()).collect(Collectors.toList()); + List userList = userService.getUserName(userId); + for (TableExampleListVO tableExampleListVO : list) { + UserEntity user = userList.stream().filter(t -> t.getId().equals(tableExampleListVO.getRegistrant())).findFirst().orElse(null); + tableExampleListVO.setRegistrant(user != null ? user.getRealName() + "/" + user.getAccount() : ""); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(paginationTableExample, PaginationVO.class); + return ActionResult.page(list, paginationVO); + } + + /** + * 列表(树形表格) + * + * @param typeId 主键 + * @param paginationTableExample 查询模型 + * @return + */ + @Operation(summary = "(树形表格)") + @GetMapping("/ControlSample/{typeId}") + @Parameters({ + @Parameter(name = "typeId", description = "主键", required = true), + }) + @SaCheckPermission("extend.tableDemo.tableTree") + public ActionResult> list(@PathVariable("typeId") String typeId, PaginationTableExample paginationTableExample) { + List data = tableExampleService.getList(typeId, paginationTableExample); + List list = JsonUtil.getJsonToList(data, TableExampleListVO.class); + List userId = list.stream().map(t -> t.getRegistrant()).collect(Collectors.toList()); + List userList = userService.getUserName(userId); + for (TableExampleListVO tableExampleListVO : list) { + UserEntity user = userList.stream().filter(t -> t.getId().equals(tableExampleListVO.getRegistrant())).findFirst().orElse(null); + tableExampleListVO.setRegistrant(user != null ? user.getRealName() + "/" + user.getAccount() : ""); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(paginationTableExample, PaginationVO.class); + return ActionResult.page(list, paginationVO); + } + + /** + * 列表 + * + * @return + */ + @Operation(summary = "获取表格分组列表") + @GetMapping("/All") + @SaCheckPermission("extend.tableDemo.groupingTable") + public ActionResult> listAll() { + List data = tableExampleService.getList(); + List list = JsonUtil.getJsonToList(data, TableExampleListAllVO.class); + List userId = list.stream().map(t -> t.getRegistrant()).collect(Collectors.toList()); + List userList = userService.getUserName(userId); + for (TableExampleListAllVO tableExampleListVO : list) { + UserEntity user = userList.stream().filter(t -> t.getId().equals(tableExampleListVO.getRegistrant())).findFirst().orElse(null); + tableExampleListVO.setRegistrant(user != null ? user.getRealName() + "/" + user.getAccount() : ""); + } + ListVO vo = new ListVO<>(); + vo.setList(list); + return ActionResult.success(vo); + } + + /** + * 列表 + * + * @param page 查询模型 + * @return + */ + @Operation(summary = "获取延伸扩展列表(行政区划)") + @GetMapping("/IndustryList") + @SaCheckPermission("extend.tableDemo.extension") + public ActionResult> industryList(Page page) { + String keyword = page.getKeyword(); + List data = provinceService.getList("-1"); + if (!StringUtil.isEmpty(keyword)) { + data = data.stream().filter(t -> t.getFullName().contains(keyword)).collect(Collectors.toList()); + } + List listVos = JsonUtil.getJsonToList(data, TableExampleIndustryListVO.class); + ListVO vo = new ListVO<>(); + vo.setList(listVos); + return ActionResult.success(vo); + } + + /** + * 列表 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "获取城市信息列表(获取延伸扩展列表(行政区划))") + @GetMapping("/CityList/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("extend.tableDemo.extension") + public ActionResult> cityList(@PathVariable("id") String id) { + List data = provinceService.getList(id); + List listVos = JsonUtil.getJsonToList(data, TableExampleCityListVO.class); + ListVO vo = new ListVO<>(); + vo.setList(listVos); + return ActionResult.success(vo); + } + + /** + * 列表(表格树形) + * + * @param isTree 类型 + * @return + */ + @Operation(summary = "表格树形") + @GetMapping("/ControlSample/TreeList") + @Parameters({ + @Parameter(name = "isTree", description = "类型"), + }) + @SaCheckPermission("extend.tableDemo.tableTree") + public ActionResult> treeList(@RequestParam("isTree")String isTree) { + List data = dictionaryDataService.getList("d59a3cf65f9847dbb08be449e3feae16"); + List treeList = new ArrayList<>(); + for (DictionaryDataEntity entity : data) { + TableExampleTreeModel treeModel = new TableExampleTreeModel(); + treeModel.setId(entity.getId()); + treeModel.setText(entity.getFullName()); + treeModel.setParentId(entity.getParentId()); + treeModel.setLoaded(true); + treeModel.setExpanded(true); + treeModel.setHt(JsonUtil.entityToMap(entity)); + treeList.add(treeModel); + } + if (isTree != null && StringNumber.ONE.equals(isTree)) { + List> trees = TreeDotUtils.convertListToTreeDot(treeList); + List listVO = JsonUtil.getJsonToList(trees, TableExampleTreeModel.class); + ListVO vo = new ListVO(); + vo.setList(listVO); + return ActionResult.success(vo); + } + ListVO vo = new ListVO(); + vo.setList(treeList); + return ActionResult.success(vo); + } + + /** + * 信息 + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取普通表格示例信息") + @GetMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("extend.tableDemo.extension") + public ActionResult info(@PathVariable("id") String id) throws DataException { + TableExampleEntity entity = tableExampleService.getInfo(id); + TableExampleInfoVO vo = JsonUtil.getJsonToBeanEx(entity, TableExampleInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 删除 + * + * @param id 主键 + * @return + */ + @Operation(summary = "删除项目") + @DeleteMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("extend.tableDemo.extension") + public ActionResult delete(@PathVariable("id") String id) { + TableExampleEntity entity = tableExampleService.getInfo(id); + if (entity != null) { + tableExampleService.delete(entity); + return ActionResult.success("删除成功"); + } + return ActionResult.fail("删除失败,数据不存在"); + } + + /** + * 创建 + * + * @param tableExampleCrForm 项目模型 + * @return + */ + @Operation(summary = "新建项目") + @PostMapping + @Parameters({ + @Parameter(name = "tableExampleCrForm", description = "项目模型",required = true), + }) + @SaCheckPermission("extend.tableDemo.extension") + public ActionResult create(@RequestBody @Valid TableExampleCrForm tableExampleCrForm) { + TableExampleEntity entity = JsonUtil.getJsonToBean(tableExampleCrForm, TableExampleEntity.class); + entity.setCostAmount(entity.getCostAmount() == null ? new BigDecimal("0") : entity.getCostAmount()); + entity.setTunesAmount(entity.getTunesAmount() == null ? new BigDecimal("0") : entity.getTunesAmount()); + entity.setProjectedIncome(entity.getProjectedIncome() == null ? new BigDecimal("0") : entity.getProjectedIncome()); + entity.setSign("0000000"); + tableExampleService.create(entity); + return ActionResult.success("创建成功"); + } + + /** + * 更新 + * + * @param id 主键 + * @param tableExampleUpForm 项目模型 + * @return + */ + @Operation(summary = "更新项目") + @PutMapping("/{id}") + @Parameters({ + @Parameter(name = "tableExampleUpForm", description = "项目模型",required = true), + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("extend.tableDemo.postilTable") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid TableExampleUpForm tableExampleUpForm) { + TableExampleEntity entity = JsonUtil.getJsonToBean(tableExampleUpForm, TableExampleEntity.class); + entity.setCostAmount(entity.getCostAmount() == null ? new BigDecimal("0") : entity.getCostAmount()); + entity.setTunesAmount(entity.getTunesAmount() == null ? new BigDecimal("0") : entity.getTunesAmount()); + entity.setProjectedIncome(entity.getProjectedIncome() == null ? new BigDecimal("0") : entity.getProjectedIncome()); + boolean flag = tableExampleService.update(id, entity); + if (flag == false) { + return ActionResult.fail("更新失败,数据不存在"); + } + return ActionResult.success("更新成功"); + } + + /** + * 更新标签 + * + * @param id 主键 + * @param tableExampleSignUpForm 项目模型 + * @return + */ + @Operation(summary = "更新标记") + @PutMapping("/UpdateSign/{id}") + @Parameters({ + @Parameter(name = "tableExampleSignUpForm", description = "项目模型",required = true), + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("extend.tableDemo.postilTable") + public ActionResult updateSign(@PathVariable("id") String id, @RequestBody @Valid TableExampleSignUpForm tableExampleSignUpForm) { + TableExampleEntity entity = JsonUtil.getJsonToBean(tableExampleSignUpForm, TableExampleEntity.class); + TableExampleEntity tableExampleEntity = tableExampleService.getInfo(id); + if (tableExampleEntity == null) { + return ActionResult.success("更新失败,数据不存在"); + } + tableExampleEntity.setSign(entity.getSign()); + tableExampleService.update(id, entity); + return ActionResult.success("更新成功"); + } + + /** + * 行编辑 + * + * @param tableExampleRowUpForm 项目模型 + * @param id 主键 + * @return + */ + @Operation(summary = "行编辑") + @PutMapping("/{id}/Actions/RowsEdit") + @Parameters({ + @Parameter(name = "tableExampleRowUpForm", description = "项目模型",required = true), + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("extend.tableDemo.redactTable") + public ActionResult rowEditing(@PathVariable("id") String id, @RequestBody @Valid TableExampleRowUpForm tableExampleRowUpForm) { + TableExampleEntity entity = JsonUtil.getJsonToBean(tableExampleRowUpForm, TableExampleEntity.class); + entity.setCostAmount(entity.getCostAmount() == null ? new BigDecimal("0") : entity.getCostAmount()); + entity.setTunesAmount(entity.getTunesAmount() == null ? new BigDecimal("0") : entity.getTunesAmount()); + entity.setProjectedIncome(entity.getProjectedIncome() == null ? new BigDecimal("0") : entity.getProjectedIncome()); + entity.setId(id); + boolean falg = tableExampleService.rowEditing(entity); + if (falg == false) { + return ActionResult.fail("更新失败,数据不存在"); + } + return ActionResult.success("更新成功"); + } + + /** + * 发送 + * + * @param postilSendForm 项目模型 + * @param id 主键 + * @return + */ + @Operation(summary = "发送批注") + @PostMapping("/{id}/Postil") + @Parameters({ + @Parameter(name = "postilSendForm", description = "项目模型",required = true), + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("extend.tableDemo.postilTable") + public ActionResult sendPostil(@PathVariable("id") String id, @RequestBody PostilSendForm postilSendForm) { + TableExampleEntity tableExampleEntity = tableExampleService.getInfo(id); + if (tableExampleEntity == null) { + return ActionResult.success("发送失败,数据不存在"); + } + UserInfo userInfo = userProvider.get(); + PostilModel model = new PostilModel(); + model.setCreatorTime(DateUtil.getNow("+8")); + model.setText(postilSendForm.getText()); + model.setUserId(userInfo != null ? userInfo.getUserName() + "/" + userInfo.getUserAccount() : ""); + List list = new ArrayList<>(); + list.add(model); + if (!StringUtil.isEmpty(tableExampleEntity.getPostilJson())) { + list.addAll(JsonUtil.getJsonToList(tableExampleEntity.getPostilJson(), PostilModel.class)); + } + + String postilJson = JsonUtil.getObjectToString(list); + tableExampleEntity.setPostilJson(postilJson); + tableExampleEntity.setPostilCount(list.size()); + tableExampleService.update(id, tableExampleEntity); + return ActionResult.success("发送成功"); + } + + + /** + * 发送 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "获取批注") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @GetMapping("/{id}/Actions/Postil") + @SaCheckPermission("extend.tableDemo.postilTable") + public ActionResult getPostil(@PathVariable("id") String id) { + TableExampleEntity tableExampleEntity = tableExampleService.getInfo(id); + if (tableExampleEntity == null) { + return ActionResult.success("获取失败,数据不存在"); + } + PostilInfoVO vo = new PostilInfoVO(); + vo.setPostilJson(tableExampleEntity.getPostilJson()); + return ActionResult.success(vo); + } + + /** + * 删除批注 + * + * @param id 主键值 + * @param index 行数 + * @return + */ + @Operation(summary = "删除批注") + @DeleteMapping("/{id}/Postil/{index}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "index", description = "行数", required = true), + }) + @SaCheckPermission("extend.tableDemo.postilTable") + public ActionResult deletePostil(@PathVariable("id") String id, @PathVariable("index") int index) { + TableExampleEntity tableExampleEntity = tableExampleService.getInfo(id); + if (tableExampleEntity == null) { + return ActionResult.success("删除失败,数据不存在"); + } + List list = JsonUtil.getJsonToList(tableExampleEntity.getPostilJson(), PostilModel.class); + list.remove(index); + String postilJson = JsonUtil.getObjectToString(list); + tableExampleEntity.setPostilJson(postilJson); + tableExampleEntity.setPostilCount((list.size())); + tableExampleService.update(id, tableExampleEntity); + return ActionResult.success("删除成功"); + } +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/WorkLogController.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/WorkLogController.java new file mode 100644 index 0000000..1741d62 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-controller/src/main/java/jnpf/controller/WorkLogController.java @@ -0,0 +1,171 @@ +package jnpf.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import jnpf.base.ActionResult; +import jnpf.base.Pagination; +import jnpf.base.controller.SuperController; +import jnpf.base.vo.PageListVO; +import jnpf.base.vo.PaginationVO; +import jnpf.constant.MsgCode; +import jnpf.entity.WorkLogEntity; +import jnpf.exception.DataException; +import jnpf.model.worklog.WorkLogCrForm; +import jnpf.model.worklog.WorkLogInfoVO; +import jnpf.model.worklog.WorkLogListVO; +import jnpf.model.worklog.WorkLogUpForm; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.UserService; +import jnpf.service.WorkLogService; +import jnpf.util.JsonUtil; +import jnpf.util.JsonUtilEx; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.Arrays; +import java.util.List; +import java.util.StringJoiner; + +/** + * 工作日志 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月26日 上午9:18 + */ +@Tag(name = "app工作日志", description = "WorkLog") +@RestController +@RequestMapping("/api/extend/WorkLog") +public class WorkLogController extends SuperController { + + @Autowired + private WorkLogService workLogService; + @Autowired + private UserService userService; + + /** + * 列表(我发出的) + * + * @param pageModel 分页模型 + * @return + */ + @Operation(summary = "列表") + @GetMapping("/Send") + @SaCheckPermission("reportinglog") + public ActionResult> getSendList(Pagination pageModel) { + List data = workLogService.getSendList(pageModel); + List list = JsonUtil.getJsonToList(data, WorkLogListVO.class); + PaginationVO paginationVO = JsonUtil.getJsonToBean(pageModel, PaginationVO.class); + return ActionResult.page(list, paginationVO); + } + + /** + * 列表(我收到的) + * + * @param pageModel 分页模型 + * @return + */ + @GetMapping("/Receive") + @SaCheckPermission("reportinglog") + public ActionResult> getReceiveList(Pagination pageModel) { + List data = workLogService.getReceiveList(pageModel); + List list = JsonUtil.getJsonToList(data, WorkLogListVO.class); + PaginationVO paginationVO = JsonUtil.getJsonToBean(pageModel, PaginationVO.class); + return ActionResult.page(list, paginationVO); + } + + /** + * 信息 + * + * @param id 主键 + * @return + */ + @GetMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("reportinglog") + public ActionResult info(@PathVariable("id") String id) throws DataException { + WorkLogEntity entity = workLogService.getInfo(id); + StringJoiner userName = new StringJoiner(","); + StringJoiner userIds = new StringJoiner(","); + List userId = Arrays.asList(entity.getToUserId().split(",")); + List userList = userService.getUserName(userId); + for (UserEntity user : userList) { + userIds.add(user.getId()); + userName.add(user.getRealName() + "/" + user.getAccount()); + } + entity.setToUserId(userName.toString()); + WorkLogInfoVO vo = JsonUtilEx.getJsonToBeanEx(entity, WorkLogInfoVO.class); + vo.setUserIds(userIds.toString()); + return ActionResult.success(vo); + } + + /** + * 新建 + * + * @param workLogCrForm 日志模型 + * @return + */ + @Operation(summary = "新建") + @PostMapping + @Parameters({ + @Parameter(name = "workLogCrForm", description = "日志模型",required = true), + }) + @SaCheckPermission("reportinglog") + public ActionResult create(@RequestBody @Valid WorkLogCrForm workLogCrForm) { + WorkLogEntity entity = JsonUtil.getJsonToBean(workLogCrForm, WorkLogEntity.class); + workLogService.create(entity); + return ActionResult.success("新建成功"); + } + + /** + * 更新 + * + * @param id 主键 + * @param workLogUpForm 日志模型 + * @return + */ + @Operation(summary = "更新") + @PutMapping("/{id}") + @Parameters({ + @Parameter(name = "workLogUpForm", description = "日志模型",required = true), + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("reportinglog") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid WorkLogUpForm workLogUpForm) { + WorkLogEntity entity = JsonUtil.getJsonToBean(workLogUpForm, WorkLogEntity.class); + boolean flag = workLogService.update(id, entity); + if (flag == false) { + return ActionResult.fail("更新失败,数据不存在"); + } + return ActionResult.success("更新成功"); + } + + /** + * 删除 + * + * @param id 主键 + * @return + */ + @Operation(summary = "删除") + @DeleteMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("reportinglog") + public ActionResult delete(@PathVariable("id") String id) { + WorkLogEntity entity = workLogService.getInfo(id); + if (entity != null) { + workLogService.delete(entity); + return ActionResult.success("删除成功"); + } + return ActionResult.fail("删除失败,数据不存在"); + } +} + diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/pom.xml b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/pom.xml new file mode 100644 index 0000000..2eba8ef --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/pom.xml @@ -0,0 +1,22 @@ + + + + jnpf-extend + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-extend-entity + + + + com.jnpf + jnpf-common-all + ${project.version} + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/BigDataEntity.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/BigDataEntity.java new file mode 100644 index 0000000..496c024 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/BigDataEntity.java @@ -0,0 +1,33 @@ +package jnpf.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + + +/** + * 大数据测试 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月26日 上午9:18 + */ +@Data +@TableName("ext_big_data") +public class BigDataEntity extends SuperExtendEntity { + + /** + * 编码 + */ + @TableField("F_EN_CODE") + private String enCode; + + /** + * 名称 + */ + @TableField("F_FULL_NAME") + private String fullName; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/CustomerEntity.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/CustomerEntity.java new file mode 100644 index 0000000..fae8c5a --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/CustomerEntity.java @@ -0,0 +1,50 @@ +package jnpf.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import jnpf.base.entity.SuperEntity; +import lombok.Data; + +/** + * 客户信息 + * + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021-07-10 14:09:05 + */ +@Data +@TableName("ext_customer") +public class CustomerEntity extends SuperEntity { + + /** + * 编码 + */ + @TableField("F_EN_CODE") + private String code; + + /** + * 客户名称 + */ + @TableField("F_CUSTOMER_NAME") + private String customerName; + + /** + * 地址 + */ + @TableField("F_ADDRESS") + private String address; + + /** + * 姓名 + */ + @TableField("F_FULL_NAME") + private String name; + + /** + * 联系方式 + */ + @TableField("F_CONTACT_TEL") + private String contactTel; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/DocumentEntity.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/DocumentEntity.java new file mode 100644 index 0000000..eb68903 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/DocumentEntity.java @@ -0,0 +1,81 @@ +package jnpf.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * 知识文档 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月26日 上午9:18 + */ +@Data +@TableName("ext_document") +public class DocumentEntity extends SuperExtendEntity.SuperExtendDEEntity { + + /** + * 文档父级 + */ + @TableField("F_PARENT_ID") + private String parentId; + + /** + * 文档分类 + */ + @TableField("F_TYPE") + private Integer type; + + /** + * 文件名称 + */ + @TableField("F_FULL_NAME") + private String fullName; + + /** + * 文件路径 + */ + @TableField("F_FILE_PATH") + private String filePath; + + /** + * 文件大小 + */ + @TableField("F_FILE_SIZE") + private String fileSize; + + /** + * 文件后缀 + */ + @TableField("F_FILE_EXTENSION") + private String fileExtension; + + /** + * 阅读数量 + */ + @TableField("F_READ_COUNT") + private Integer readCount; + + /** + * 是否共享 + */ + @TableField("F_IS_SHARE") + private Integer isShare; + + /** + * 共享时间 + */ + @TableField("F_SHARE_TIME") + private Date shareTime; + + /** + * 文档下载地址 + */ + @TableField("F_UPLOAD_URL") + private String uploaderUrl; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/DocumentShareEntity.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/DocumentShareEntity.java new file mode 100644 index 0000000..d409367 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/DocumentShareEntity.java @@ -0,0 +1,40 @@ +package jnpf.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * 知识文档共享 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月26日 上午9:18 + */ +@Data +@TableName("ext_document_share") +public class DocumentShareEntity extends SuperExtendEntity { + + /** + * 文档主键 + */ + @TableField("F_DOCUMENT_ID") + private String documentId; + + /** + * 共享人员 + */ + @TableField("F_SHARE_USER_ID") + private String shareUserId; + + /** + * 共享时间 + */ + @TableField("F_SHARE_TIME") + private Date shareTime; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/EmailSendEntity.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/EmailSendEntity.java new file mode 100644 index 0000000..fe2aaeb --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/EmailSendEntity.java @@ -0,0 +1,80 @@ +package jnpf.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + +/** + * 邮件发送 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月26日 上午9:18 + */ +@Data +@TableName("ext_email_send") +public class EmailSendEntity extends SuperExtendEntity.SuperExtendDEEntity { + + /** + * 类型 1-外部、0-内部 + */ + @TableField("F_TYPE") + private Integer type; + + /** + * 发件人 + */ + @TableField("F_SENDER") + private String sender; + + /** + * 收件人 + */ + @TableField("F_TO") + private String recipient; + + /** + * 抄送人 + */ + @TableField("F_CC") + private String cc; + + /** + * 密送人 + */ + @TableField("F_BCC") + private String bcc; + + /** + * 颜色 + */ + @TableField("F_COLOUR") + private String colour; + + /** + * 主题 + */ + @TableField("F_SUBJECT") + private String subject; + + /** + * 正文 + */ + @TableField("F_BODY_TEXT") + private String bodyText; + + /** + * 附件 + */ + @TableField("F_ATTACHMENT") + private String attachment; + + /** + * 状态 -1-草稿、0-正在投递、1-投递成功 + */ + @TableField("F_STATE") + private Integer state; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/EmployeeEntity.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/EmployeeEntity.java new file mode 100644 index 0000000..bb96eaf --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/EmployeeEntity.java @@ -0,0 +1,106 @@ +package jnpf.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * 职员信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * + */ +@Data +@TableName("ext_employee") +public class EmployeeEntity extends SuperExtendEntity.SuperExtendDEEntity { + + /** + * 工号 + */ + @TableField("F_EN_CODE") + private String enCode; + + /** + * 姓名 + */ + @TableField("F_FULL_NAME") + private String fullName; + + /** + * 性别 + */ + @TableField("F_GENDER") + private String gender; + + /** + * 部门 + */ + @TableField("F_DEPARTMENT_NAME") + private String departmentName; + + /** + * 岗位 + */ + @TableField("F_POSITION_NAME") + private String positionName; + + /** + * 用工性质 + */ + @TableField("F_WORKING_NATURE") + private String workingNature; + + /** + * 身份证号 + */ + @TableField("F_ID_NUMBER") + private String idNumber; + + /** + * 联系电话 + */ + @TableField("F_TELEPHONE") + private String telephone; + + /** + * 参加工作 + */ + @TableField("F_ATTEND_WORK_TIME") + private Date attendWorkTime; + + /** + * 出生年月 + */ + @TableField("F_BIRTHDAY") + private Date birthday; + + /** + * 最高学历 + */ + @TableField("F_EDUCATION") + private String education; + + /** + * 所学专业 + */ + @TableField("F_MAJOR") + private String major; + + /** + * 毕业院校 + */ + @TableField("F_GRADUATION_ACADEMY") + private String graduationAcademy; + + /** + * 毕业时间 + */ + @TableField("F_GRADUATION_TIME") + private Date graduationTime; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/OrderEntity.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/OrderEntity.java new file mode 100644 index 0000000..f8a83f6 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/OrderEntity.java @@ -0,0 +1,119 @@ +package jnpf.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 订单信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月26日 上午9:18 + */ +@Data +@TableName("ext_order") +public class OrderEntity extends SuperExtendEntity.SuperExtendDEEntity { + + /** + * 客户Id + */ + @TableField("F_CUSTOMER_ID") + private String customerId; + + /** + * 客户名称 + */ + @TableField("F_CUSTOMER_NAME") + private String customerName; + + /** + * 业务员Id + */ + @TableField("F_SALESMAN_ID") + private String salesmanId; + + /** + * 业务员 + */ + @TableField("F_SALESMAN_NAME") + private String salesmanName; + + /** + * 订单日期 + */ + @TableField("F_ORDER_DATE") + private Date orderDate; + + /** + * 订单编码 + */ + @TableField("F_ORDER_CODE") + private String orderCode; + + /** + * 运输方式 + */ + @TableField("F_TRANSPORT_MODE") + private String transportMode; + + /** + * 发货日期 + */ + @TableField("F_DELIVERY_DATE") + private Date deliveryDate; + + /** + * 发货地址 + */ + @TableField("F_DELIVERY_ADDRESS") + private String deliveryAddress; + + /** + * 付款方式 + */ + @TableField("F_PAYMENT_MODE") + private String paymentMode; + + /** + * 应收金额 + */ + @TableField("F_RECEIVABLE_MONEY") + private BigDecimal receivableMoney; + + /** + * 定金比率 + */ + @TableField("F_EARNEST_RATE") + private BigDecimal earnestRate; + + /** + * 预付定金 + */ + @TableField("F_PREPAY_EARNEST") + private BigDecimal prepayEarnest; + + /** + * 当前状态 + */ + @TableField("F_CURRENT_STATE") + private Integer currentState; + + /** + * 流程引擎 + */ + @TableField("F_FLOW_ID") + private String flowId; + + /** + * 附件信息 + */ + @TableField("F_FILE_JSON") + private String fileJson; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/OrderEntryEntity.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/OrderEntryEntity.java new file mode 100644 index 0000000..1ff3529 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/OrderEntryEntity.java @@ -0,0 +1,100 @@ +package jnpf.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 订单明细 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月26日 上午9:18 + */ +@Data +@TableName("ext_order_entry") +public class OrderEntryEntity extends SuperExtendEntity.SuperExtendDescriptionEntity { + + /** + * 订单主键 + */ + @TableField("F_ORDER_ID") + private String orderId; + + /** + * 商品Id + */ + @TableField("F_GOODS_ID") + private String goodsId; + + /** + * 商品编码 + */ + @TableField("F_GOODS_CODE") + private String goodsCode; + + /** + * 商品名称 + */ + @TableField("F_GOODS_NAME") + private String goodsName; + + /** + * 规格型号 + */ + @TableField("F_SPECIFICATIONS") + private String specifications; + + /** + * 单位 + */ + @TableField("F_UNIT") + private String unit; + + /** + * 数量 + */ + @TableField("F_QTY") + private BigDecimal qty; + + /** + * 单价 + */ + @TableField("F_PRICE") + private BigDecimal price; + + /** + * 金额 + */ + @TableField("F_AMOUNT") + private BigDecimal amount; + + /** + * 折扣% + */ + @TableField("F_DISCOUNT") + private BigDecimal discount; + + /** + * 税率% + */ + @TableField("F_CESS") + private BigDecimal cess; + + /** + * 实际单价 + */ + @TableField("F_ACTUAL_PRICE") + private BigDecimal actualPrice; + + /** + * 实际金额 + */ + @TableField("F_ACTUAL_AMOUNT") + private BigDecimal actualAmount; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/OrderReceivableEntity.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/OrderReceivableEntity.java new file mode 100644 index 0000000..2747cc7 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/OrderReceivableEntity.java @@ -0,0 +1,66 @@ +package jnpf.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 订单收款 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月26日 上午9:18 + */ +@Data +@TableName("ext_order_receivable") +public class OrderReceivableEntity extends SuperExtendEntity.SuperExtendDescriptionEntity { + + /** + * 订单主键 + */ + @TableField("F_ORDER_ID") + private String orderId; + + /** + * 收款摘要 + * + */ + @TableField("F_ABSTRACT") + private String fabstract; + + /** + * 收款日期 + */ + @TableField("F_RECEIVABLE_DATE") + private Date receivableDate; + + /** + * 收款比率 + */ + @TableField("F_RECEIVABLE_RATE") + private BigDecimal receivableRate; + + /** + * 收款金额 + */ + @TableField("F_RECEIVABLE_MONEY") + private BigDecimal receivableMoney; + + /** + * 收款方式 + */ + @TableField("F_RECEIVABLE_MODE") + private String receivableMode; + + /** + * 收款状态 + */ + @TableField("F_RECEIVABLE_STATE") + private Integer receivableState; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/ProductEntity.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/ProductEntity.java new file mode 100644 index 0000000..b1f581d --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/ProductEntity.java @@ -0,0 +1,185 @@ +package jnpf.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 销售订单 + * + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021-07-10 10:40:59 + */ +@Data +@TableName("ext_product") +public class ProductEntity extends SuperExtendEntity.SuperExtendDescriptionEntity { + + /** + * 订单编号 + */ + @TableField("F_EN_CODE") + private String enCode; + + /** + * 客户类别 + */ + @TableField("F_TYPE") + private String type; + + /** + * 客户id + */ + @TableField("F_CUSTOMER_ID") + private String customerId; + + /** + * 客户名称 + */ + @TableField("F_CUSTOMER_NAME") + private String customerName; + + /** + * 制单人 + */ + @TableField("F_SALESMAN_ID") + private String salesmanId; + + /** + * 制单人 + */ + @TableField("F_SALESMAN_NAME") + private String salesmanName; + + /** + * 制单日期 + */ + @TableField("F_SALESMAN_DATE") + private Date salesmanDate; + + /** + * 审核人 + */ + @TableField("F_AUDIT_NAME") + private String auditName; + + /** + * 审核日期 + */ + @TableField("F_AUDIT_DATE") + private Date auditDate; + + /** + * 审核状态 + */ + @TableField("F_AUDIT_STATE") + private Integer auditState; + + /** + * 发货仓库 + */ + @TableField("F_GOODS_WAREHOUSE") + private String goodsWarehouse; + + /** + * 发货日期 + */ + @TableField("F_GOODS_DATE") + private Date goodsDate; + + /** + * 发货通知人 + */ + @TableField("F_CONSIGNOR") + private String consignor; + + /** + * 发货状态 + */ + @TableField("F_GOODS_STATE") + private Integer goodsState; + + /** + * 关闭状态 + */ + @TableField("F_CLOSE_STATE") + private Integer closeState; + + /** + * 关闭日期 + */ + @TableField("F_CLOSE_DATE") + private Date closeDate; + + /** + * 收款方式 + */ + @TableField("F_GATHERING_TYPE") + private String gatheringType; + + /** + * 业务员 + */ + @TableField("F_BUSINESS") + private String business; + + /** + * 送货地址 + */ + @TableField("F_ADDRESS") + private String address; + + /** + * 联系方式 + */ + @TableField("F_CONTACT_TEL") + private String contactTel; + + /** + * 联系人 + */ + @TableField("F_CONTACT_NAME") + private String contactName; + + /** + * 收货消息 + */ + @TableField("F_HARVEST_MSG") + private Integer harvestMsg; + + /** + * 收货仓库 + */ + @TableField("F_HARVEST_WAREHOUSE") + private String harvestWarehouse; + + /** + * 代发客户 + */ + @TableField("F_ISSUING_NAME") + private String issuingName; + + /** + * 让利金额 + */ + @TableField("F_PART_PRICE") + private BigDecimal partPrice; + + /** + * 优惠金额 + */ + @TableField("F_REDUCED_PRICE") + private BigDecimal reducedPrice; + + /** + * 折后金额 + */ + @TableField("F_DISCOUNT_PRICE") + private BigDecimal discountPrice; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/ProductEntryEntity.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/ProductEntryEntity.java new file mode 100644 index 0000000..d72cb1a --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/ProductEntryEntity.java @@ -0,0 +1,94 @@ +package jnpf.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 产品明细 + * + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021-07-10 10:40:59 + */ +@Data +@TableName("ext_product_entry") +public class ProductEntryEntity extends SuperExtendEntity.SuperExtendDescriptionEntity { + + /** + * 订单主键 + */ + @TableField("F_PRODUCT_ID") + private String productId; + + /** + * 产品编码 + */ + @TableField("F_PRODUCT_CODE") + private String productCode; + + /** + * 产品名称 + */ + @TableField("F_PRODUCT_NAME") + private String productName; + + /** + * 产品规格 + */ + @TableField("F_PRODUCT_SPECIFICATION") + private String productSpecification; + + /** + * 数量 + */ + @TableField("F_QTY") + private Integer qty; + + /** + * 订货类型 + */ + @TableField("F_TYPE") + private String type; + + /** + * 单价 + */ + @TableField("F_MONEY") + private BigDecimal money; + + /** + * 折后单价 + */ + @TableField("F_PRICE") + private BigDecimal price; + + /** + * 单位 + */ + @TableField("F_UTIL") + private String util; + + /** + * 控制方式 + */ + @TableField("F_COMMAND_TYPE") + private String commandType; + + /** + * 金额 + */ + @TableField("F_AMOUNT") + private BigDecimal amount; + + /** + * 活动 + */ + @TableField("F_ACTIVITY") + private String activity; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/ProductGoodsEntity.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/ProductGoodsEntity.java new file mode 100644 index 0000000..1780920 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/ProductGoodsEntity.java @@ -0,0 +1,62 @@ +package jnpf.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + +/** + * 产品商品 + * + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021-07-10 15:57:50 + */ +@Data +@TableName("ext_product_goods") +public class ProductGoodsEntity extends SuperExtendEntity { + + /** + * 分类主键 + */ + @TableField("F_CLASSIFY_ID") + private String classifyId; + + /** + * 产品编号 + */ + @TableField("F_EN_CODE") + private String enCode; + + /** + * 产品名称 + */ + @TableField("F_FULL_NAME") + private String fullName; + + /** + * 订货类型 + */ + @TableField("F_TYPE") + private String type; + + /** 产品规格 */ + @TableField("F_PRODUCT_SPECIFICATION") + private String productSpecification; + + /** 单价 */ + @TableField("F_MONEY") + private String money; + + /** + * 库存数 + */ + @TableField("F_QTY") + private Integer qty; + + /** 金额 */ + @TableField("F_AMOUNT") + private String amount; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/ProductclassifyEntity.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/ProductclassifyEntity.java new file mode 100644 index 0000000..993b565 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/ProductclassifyEntity.java @@ -0,0 +1,32 @@ +package jnpf.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import jnpf.base.entity.SuperEntity; +import lombok.Data; + +/** + * 产品分类 + * + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021-07-10 14:34:04 + */ +@Data +@TableName("ext_product_classify") +public class ProductclassifyEntity extends SuperEntity { + + /** + * 上级 + */ + @TableField("F_PARENT_ID") + private String parentId; + + /** + * 名称 + */ + @TableField("F_FULL_NAME") + private String fullName; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/ProjectGanttEntity.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/ProjectGanttEntity.java new file mode 100644 index 0000000..750d576 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/ProjectGanttEntity.java @@ -0,0 +1,95 @@ +package jnpf.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 项目计划 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月26日 上午9:18 + */ +@Data +@TableName("ext_project_gantt") +public class ProjectGanttEntity extends SuperExtendEntity.SuperExtendDEEntity { + + /** + * 项目上级 + */ + @TableField("F_PARENT_ID") + private String parentId; + + /** + * 项目主键 + */ + @TableField("F_PROJECT_ID") + private String projectId; + + /** + * 项目类型 + */ + @TableField("F_TYPE") + private Integer type; + + /** + * 项目编码 + */ + @TableField("F_EN_CODE") + private String enCode; + + /** + * 项目名称 + */ + @TableField("F_FULL_NAME") + private String fullName; + + /** + * 项目工期 + */ + @TableField("F_TIME_LIMIT") + private BigDecimal timeLimit; + + /** + * 项目标记 + */ + @TableField("F_SIGN") + private String sign; + + /** + * 标记颜色 + */ + @TableField("F_SIGN_COLOR") + private String signColor; + + /** + * 开始时间 + */ + @TableField("F_START_TIME") + private Date startTime; + + /** + * 结束时间 + */ + @TableField("F_END_TIME") + private Date endTime; + + /** + * 当前进度 + */ + @TableField("F_SCHEDULE") + private Integer schedule; + + /** + * 负责人 + */ + @TableField("F_MANAGER_IDS") + private String managerIds; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/TableExampleEntity.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/TableExampleEntity.java new file mode 100644 index 0000000..83edc9c --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/TableExampleEntity.java @@ -0,0 +1,119 @@ +package jnpf.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 表格示例数据 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月26日 上午9:18 + */ +@Data +@TableName("ext_table_example") +public class TableExampleEntity extends SuperExtendEntity { + + /** + * 交互日期 + */ + @TableField("F_INTERACTION_DATE") + private Date interactionDate; + + /** + * 项目编码 + */ + @TableField("F_PROJECT_CODE") + private String projectCode; + + /** + * 项目名称 + */ + @TableField("F_PROJECT_NAME") + private String projectName; + + /** + * 负责人 + */ + @TableField("F_PRINCIPAL") + private String principal; + + /** + * 立顶人 + */ + @TableField("F_JACK_STANDS") + private String jackStands; + + /** + * 项目类型 + */ + @TableField("F_PROJECT_TYPE") + private String projectType; + + /** + * 项目阶段 + */ + @TableField("F_PROJECT_PHASE") + private String projectPhase; + + /** + * 客户名称 + */ + @TableField("F_CUSTOMER_NAME") + private String customerName; + + /** + * 费用金额 + */ + @TableField("F_COST_AMOUNT") + private BigDecimal costAmount; + + /** + * 已用金额 + */ + @TableField("F_TUNES_AMOUNT") + private BigDecimal tunesAmount; + + /** + * 预计收入 + */ + @TableField("F_PROJECTED_INCOME") + private BigDecimal projectedIncome; + + /** + * 登记人 + */ + @TableField("F_REGISTRANT") + private String registrant; + + /** + * 登记时间 + */ + @TableField("F_REGISTER_DATE") + private Date registerDate; + + /** + * 标记 + */ + @TableField("F_SIGN") + private String sign; + + /** + * 批注列表Json + */ + @TableField("f_postil_json") + private String postilJson; + + /** + * 批注总数 + */ + @TableField("F_POSTIL_COUNT") + private Integer postilCount; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/WorkLogEntity.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/WorkLogEntity.java new file mode 100644 index 0000000..3846323 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/WorkLogEntity.java @@ -0,0 +1,51 @@ +package jnpf.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + + +/** + * + * 工作日志 + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月26日 上午9:18 + */ +@Data +@TableName("ext_work_log") +public class WorkLogEntity extends SuperExtendEntity.SuperExtendDEEntity { + + /** + * 日志标题 + */ + @TableField("F_TITLE") + private String title; + + /** + * 今天内容 + */ + @TableField("F_TODAY_CONTENT") + private String todayContent; + + /** + * 明天内容 + */ + @TableField("F_TOMORROW_CONTENT") + private String tomorrowContent; + + /** + * 遇到问题 + */ + @TableField("F_QUESTION") + private String question; + + /** + * 发送给谁 + */ + @TableField("F_TO_USER_ID") + private String toUserId; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/WorkLogShareEntity.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/WorkLogShareEntity.java new file mode 100644 index 0000000..1561f7b --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/entity/WorkLogShareEntity.java @@ -0,0 +1,40 @@ +package jnpf.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * + * 工作日志分享 + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月26日 上午9:18 + */ +@Data +@TableName("ext_work_log_share") +public class WorkLogShareEntity extends SuperExtendEntity { + + /** + * 日志主键 + */ + @TableField("F_WORK_LOG_ID") + private String workLogId; + + /** + * 共享人员 + */ + @TableField("F_SHARE_USER_ID") + private String shareUserId; + + /** + * 共享时间 + */ + @TableField("F_SHARE_TIME") + private Date shareTime; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/EmployeeModel.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/EmployeeModel.java new file mode 100644 index 0000000..ca7fd4f --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/EmployeeModel.java @@ -0,0 +1,64 @@ +package jnpf.model; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * + */ +@Data +public class EmployeeModel { + @Excel(name = "工号", isImportField = "true") + @Schema(description ="工号") + private String enCode; + @Excel(name = "姓名", isImportField = "true") + @Schema(description ="姓名") + private String fullName; + @Excel(name = "性别", isImportField = "true") + @Schema(description ="性别") + private String gender; + @Excel(name = "部门", isImportField = "true") + @Schema(description ="部门") + private String departmentName; + @Excel(name = "职务", isImportField = "true") + @Schema(description ="职务") + private String positionName; + @Excel(name = "用工性质", isImportField = "true") + @Schema(description ="用工性质") + private String workingNature; + @Excel(name = "身份证号", isImportField = "true") + @Schema(description ="身份证号") + private String idNumber; + @Excel(name = "联系电话", isImportField = "true") + @Schema(description ="联系电话") + private String telephone; + @Excel(name = "参加工作", isImportField = "true") + @Schema(description ="参加工作") + private String attendWorkTime; + @Excel(name = "出生年月", isImportField = "true") + @Schema(description ="出生年月") + private String birthday; + @Excel(name = "最高学历", isImportField = "true") + @Schema(description ="最高学历") + private String education; + @Excel(name = "所学专业", isImportField = "true") + @Schema(description ="所学专业") + private String major; + @Excel(name = "毕业院校", isImportField = "true") + @Schema(description ="毕业院校") + private String graduationAcademy; + @Excel(name = "毕业时间", isImportField = "true") + @Schema(description ="毕业时间") + private String graduationTime; + @Schema(description ="字表数据") + private List list; + @Schema(description ="创建时间") + private String creatorTime; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/ReportManageModel.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/ReportManageModel.java new file mode 100644 index 0000000..43cfc89 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/ReportManageModel.java @@ -0,0 +1,22 @@ +package jnpf.model; + + +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class ReportManageModel { + @Schema(description ="主键") + @JSONField(name = "F_Id") + private String id; + @Schema(description ="名称") + @JSONField(name = "F_FullName") + private String fullName; + @Schema(description ="分类") + @JSONField(name = "F_Category") + private String category; + @Schema(description ="地址") + @JSONField(name = "F_UrlAddress") + private String urlAddress; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/bidata/BigBigDataListVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/bidata/BigBigDataListVO.java new file mode 100644 index 0000000..d093db6 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/bidata/BigBigDataListVO.java @@ -0,0 +1,15 @@ +package jnpf.model.bidata; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class BigBigDataListVO { + @Schema(description ="编码") + private String enCode; + @Schema(description ="名称") + private String fullName; + @Schema(description ="主键id") + private String id; + @Schema(description ="创建时间") + private long creatorTime; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/customer/CustomerCrForm.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/customer/CustomerCrForm.java new file mode 100644 index 0000000..3d956a8 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/customer/CustomerCrForm.java @@ -0,0 +1,26 @@ +package jnpf.model.customer; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * 客户信息 + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021-07-10 14:09:05 + */ +@Data +public class CustomerCrForm { + @Schema(description ="编码") + private String code; + @Schema(description ="客户名称") + private String customerName; + @Schema(description ="地址") + private String address; + @Schema(description ="名称") + private String name; + @Schema(description ="联系方式") + private String contactTel; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/customer/CustomerInfoVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/customer/CustomerInfoVO.java new file mode 100644 index 0000000..21afaaf --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/customer/CustomerInfoVO.java @@ -0,0 +1,28 @@ +package jnpf.model.customer; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * 客户信息 + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021-07-10 14:09:05 + */ +@Data +public class CustomerInfoVO{ + @Schema(description ="主键") + private String id; + @Schema(description ="编码") + private String code; + @Schema(description ="客户名称") + private String customerName; + @Schema(description ="地址") + private String address; + @Schema(description ="名称") + private String name; + @Schema(description ="联系方式") + private String contactTel; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/customer/CustomerListVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/customer/CustomerListVO.java new file mode 100644 index 0000000..ac9c6c8 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/customer/CustomerListVO.java @@ -0,0 +1,30 @@ + + +package jnpf.model.customer; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * 客户信息 + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021-07-10 14:09:05 + */ +@Data +public class CustomerListVO{ + @Schema(description ="主键") + private String id; + @Schema(description ="编码") + private String code; + @Schema(description ="客户名称") + private String customerName; + @Schema(description ="地址") + private String address; + @Schema(description ="名称") + private String name; + @Schema(description ="联系方式") + private String contactTel; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/customer/CustomerUpForm.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/customer/CustomerUpForm.java new file mode 100644 index 0000000..4e668b7 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/customer/CustomerUpForm.java @@ -0,0 +1,16 @@ +package jnpf.model.customer; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * 客户信息 + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021-07-10 14:09:05 + */ +@Data +public class CustomerUpForm extends CustomerCrForm { + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentCrForm.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentCrForm.java new file mode 100644 index 0000000..e6a8606 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentCrForm.java @@ -0,0 +1,19 @@ +package jnpf.model.document; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.hibernate.validator.constraints.NotBlank; + +import javax.validation.constraints.NotNull; + +@Data +public class DocumentCrForm { + @NotBlank(message = "必填") + @Schema(description ="文件夹名称") + private String fullName; + @NotNull(message = "必填") + @Schema(description ="文档分类") + private Integer type; + @NotBlank(message = "必填") + @Schema(description ="文档父级") + private String parentId; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentFolderTreeModel.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentFolderTreeModel.java new file mode 100644 index 0000000..e82ccb9 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentFolderTreeModel.java @@ -0,0 +1,11 @@ +package jnpf.model.document; + +import jnpf.util.treeutil.SumTree; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class DocumentFolderTreeModel extends SumTree { + private String icon; + private String fullName; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentFolderTreeVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentFolderTreeVO.java new file mode 100644 index 0000000..7cc01ad --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentFolderTreeVO.java @@ -0,0 +1,22 @@ +package jnpf.model.document; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +@Data +public class DocumentFolderTreeVO { + @Schema(description ="名称") + private String fullName; + @Schema(description ="图标") + private String icon; + @Schema(description ="是否有下级菜单") + private Boolean hasChildren; + @Schema(description ="主键") + private String id; + @Schema(description ="父级主键") + private String parentId; + + @Schema(description ="子数据") + private List children; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentInfoVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentInfoVO.java new file mode 100644 index 0000000..9854aa0 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentInfoVO.java @@ -0,0 +1,21 @@ +package jnpf.model.document; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class DocumentInfoVO { + @Schema(description ="文件名称") + private String fullName; + @Schema(description ="主键id") + private String id; + @Schema(description ="文档分类") + private Integer type; + @Schema(description ="文档父级") + private String parentId; + + @Schema(description ="文档下载地址") + private String uploaderUrl; + @Schema(description ="文件路径") + private String filePath; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentListVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentListVO.java new file mode 100644 index 0000000..5f6ab16 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentListVO.java @@ -0,0 +1,30 @@ +package jnpf.model.document; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + + +@Data +public class DocumentListVO { + @Schema(description ="主键id") + private String id; + @Schema(description ="文件夹名称") + private String fullName; + @Schema(description ="文档分类(0-文件夹,1-文件)") + private Integer type; + @Schema(description ="创建日期") + private long creatorTime; + @Schema(description ="是否分享") + private Integer isShare; + @Schema(description ="大小") + private String fileSize; + @Schema(description ="父级Id") + private String parentId; + @Schema(description ="后缀名") + private String fileExtension; + @Schema(description ="文档下载地址") + private String uploaderUrl; + @Schema(description ="文件路径") + private String filePath; + @Schema(description ="是否支持预览") + private String isPreview; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentShareForm.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentShareForm.java new file mode 100644 index 0000000..049eea8 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentShareForm.java @@ -0,0 +1,10 @@ +package jnpf.model.document; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class DocumentShareForm { + + @Schema(description ="用户主键") + private String userId; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentSoutListVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentSoutListVO.java new file mode 100644 index 0000000..b5ab684 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentSoutListVO.java @@ -0,0 +1,18 @@ +package jnpf.model.document; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class DocumentSoutListVO { + @Schema(description ="主键id") + private String id; + @Schema(description ="文件夹名称") + private String fullName; + @Schema(description ="文档分类(0-文件夹,1-文件)") + private Integer type; + @Schema(description ="共享日期") + private String shareTime; + @Schema(description ="大小") + private String fileSize; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentStomeListVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentStomeListVO.java new file mode 100644 index 0000000..7a5afb6 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentStomeListVO.java @@ -0,0 +1,19 @@ +package jnpf.model.document; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class DocumentStomeListVO { + @Schema(description ="共享日期") + private long shareTime; + @Schema(description ="文件json") + private String fileExtension; + @Schema(description ="大小") + private String fileSize; + @Schema(description ="名称") + private String fullName; + @Schema(description ="主键") + private String id; + @Schema(description ="创建用户") + private String creatorUserId; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentSuserListVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentSuserListVO.java new file mode 100644 index 0000000..10cfa89 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentSuserListVO.java @@ -0,0 +1,17 @@ +package jnpf.model.document; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +@Data +public class DocumentSuserListVO { + @Schema(description ="主键") + private String id; + @Schema(description ="文档主键") + private String documentId; + @Schema(description ="用户") + private String shareUserId; + @Schema(description ="时间") + private Date shareTime; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentTrashListVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentTrashListVO.java new file mode 100644 index 0000000..0704be4 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentTrashListVO.java @@ -0,0 +1,15 @@ +package jnpf.model.document; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class DocumentTrashListVO { + @Schema(description ="主键id") + private String id; + @Schema(description ="文件夹名称") + private String fullName; + @Schema(description ="删除日期") + private String deleteTime; + @Schema(description ="大小") + private String fileSize; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentUpForm.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentUpForm.java new file mode 100644 index 0000000..f427a7a --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentUpForm.java @@ -0,0 +1,8 @@ +package jnpf.model.document; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + + +@Data +public class DocumentUpForm extends DocumentCrForm{ +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentUploader.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentUploader.java new file mode 100644 index 0000000..86549f7 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/DocumentUploader.java @@ -0,0 +1,14 @@ +package jnpf.model.document; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.springframework.web.multipart.MultipartFile; + +import java.io.Serializable; + +@Data +public class DocumentUploader implements Serializable { + @Schema(description ="父级id") + private String parentId; + @Schema(description ="文件") + private MultipartFile file; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/PageDocument.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/PageDocument.java new file mode 100644 index 0000000..9d81933 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/document/PageDocument.java @@ -0,0 +1,10 @@ +package jnpf.model.document; +import jnpf.base.Page; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class PageDocument extends Page { + @Schema(description ="父级主键") + private String parentId; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/documentpreview/FileInfoVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/documentpreview/FileInfoVO.java new file mode 100644 index 0000000..9a50d53 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/documentpreview/FileInfoVO.java @@ -0,0 +1,10 @@ +package jnpf.model.documentpreview; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class FileInfoVO { + + private String fileName; + private String filePath; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/EmailCheckForm.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/EmailCheckForm.java new file mode 100644 index 0000000..9212a1c --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/EmailCheckForm.java @@ -0,0 +1,32 @@ +package jnpf.model.email; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.hibernate.validator.constraints.NotBlank; + +@Data +public class EmailCheckForm { + @NotBlank(message = "必填") + @Schema(description ="POP3端口") + private String pop3Port; + @Schema(description ="ssl登录") + private String emailSsl; + @NotBlank(message = "必填") + @Schema(description ="邮箱地址") + private String account; + @NotBlank(message = "必填") + @Schema(description ="POP3服务") + private String pop3Host; + @NotBlank(message = "必填") + @Schema(description ="邮箱密码") + private String password; + @NotBlank(message = "必填") + @Schema(description ="SMTP服务") + private String smtpHost; + @NotBlank(message = "必填") + @Schema(description ="SMTP端口") + private String smtpPort; + @NotBlank(message = "必填") + @Schema(description ="显示名称") + private String senderName; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/EmailCofigInfoVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/EmailCofigInfoVO.java new file mode 100644 index 0000000..3a0ce8b --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/EmailCofigInfoVO.java @@ -0,0 +1,32 @@ +package jnpf.model.email; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class EmailCofigInfoVO { + + @Schema(description ="账户") + private String account; + + @Schema(description ="密码") + private String password; + + @Schema(description ="POP3服务") + private String pop3Host; + + @Schema(description ="POP3端口") + private Integer pop3Port; + + @Schema(description ="发件人名称") + private String senderName; + + @Schema(description ="SMTP服务") + private String smtpHost; + + @Schema(description ="SMTP端口") + private Integer smtpPort; + @Schema(description ="创建时间") + private long creatorTime; + @Schema(description ="是否开户SSL登录(1-是,0否)") + private Integer emailSsl; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/EmailCrForm.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/EmailCrForm.java new file mode 100644 index 0000000..f885477 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/EmailCrForm.java @@ -0,0 +1,36 @@ +package jnpf.model.email; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.hibernate.validator.constraints.NotBlank; + +/** + * 发邮件 + */ +@Data +public class EmailCrForm { + @JsonIgnore + @Schema(description ="id",hidden = true) + private String id; + @Schema(description ="抄送人") + private String cc; + + @Schema(description ="密送人") + private String bcc; + + @Schema(description ="正文") + private String bodyText; + + @Schema(description ="附件") + private String attachment; + + @NotBlank(message = "必填") + @Schema(description ="主题") + private String subject; + + @NotBlank(message = "必填") + @Schema(description ="收件人") + private String recipient; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/EmailDraftListVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/EmailDraftListVO.java new file mode 100644 index 0000000..c43a113 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/EmailDraftListVO.java @@ -0,0 +1,17 @@ +package jnpf.model.email; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class EmailDraftListVO { + @Schema(description ="附件") + private String attachment; + @Schema(description ="发件人") + private String id; + @Schema(description ="主题") + private String subject; + @Schema(description ="收件人") + private String recipient; + @Schema(description ="创建时间") + private long creatorTime; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/EmailInfoModel.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/EmailInfoModel.java new file mode 100644 index 0000000..228425a --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/EmailInfoModel.java @@ -0,0 +1,12 @@ +package jnpf.model.email; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class EmailInfoModel { + private String fileId; + private String fileName; + private String fileSize; + private String fileTime; + private String fileState; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/EmailInfoVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/EmailInfoVO.java new file mode 100644 index 0000000..d1a570d --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/EmailInfoVO.java @@ -0,0 +1,31 @@ +package jnpf.model.email; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class EmailInfoVO{ + @Schema(description ="主键") + private String id; + @Schema(description ="邮件主题") + private String subject; + @Schema(description ="抄送人") + private String cc; + @Schema(description ="密送人") + private String bcc; + @Schema(description ="发件人姓名") + private String senderName; + @Schema(description ="发件人邮箱") + private String sender; + @Schema(description ="时间") + private Long fdate; + @Schema(description ="创建时间") + private Long creatorTime; + @Schema(description ="收件箱收件人") + private String mAccount; + @Schema(description ="发送收件人") + private String recipient; + @Schema(description ="附件对象") + private String attachment; + @Schema(description ="邮件内容") + private String bodyText; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/EmailReceiveListVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/EmailReceiveListVO.java new file mode 100644 index 0000000..4a52d7d --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/EmailReceiveListVO.java @@ -0,0 +1,26 @@ +package jnpf.model.email; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class EmailReceiveListVO { + @Schema(description ="是否已读(1-已读,0-未)") + private Integer isRead; + @Schema(description ="附件") + private String attachment; + @Schema(description ="时间") + private Long fdate; + @Schema(description ="发件人") + private String id; + @Schema(description ="是否标星(1-是,0-否)") + private Integer starred; + @Schema(description ="发件人") + private String sender; + @Schema(description ="主题") + private String subject; + @Schema(description ="创建时间") + private Long creatorTime; + @Schema(description ="收件人") + private String recipient; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/EmailSendCrForm.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/EmailSendCrForm.java new file mode 100644 index 0000000..8c2f4ec --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/EmailSendCrForm.java @@ -0,0 +1,37 @@ +package jnpf.model.email; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.hibernate.validator.constraints.NotBlank; + +/** + * 存草稿 + */ +@Data +public class EmailSendCrForm { +// @JsonIgnore + @Schema(description ="id",hidden = true) + private String id; + + @Schema(description ="抄送人") + private String cc; + + @Schema(description ="密送人") + private String bcc; + + @Schema(description ="正文") + private String bodyText; + + @Schema(description ="附件") + private String attachment; + + @NotBlank(message = "必填") + @Schema(description ="主题") + private String subject; + + @NotBlank(message = "必填") + @Schema(description ="收件人") + private String recipient; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/EmailSentListVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/EmailSentListVO.java new file mode 100644 index 0000000..1407fda --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/EmailSentListVO.java @@ -0,0 +1,17 @@ +package jnpf.model.email; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class EmailSentListVO { + @Schema(description ="附件") + private String attachment; + @Schema(description ="发件人") + private String id; + @Schema(description ="主题") + private String subject; + @Schema(description ="收件人") + private String recipient; + @Schema(description ="创建时间") + private Long creatorTime; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/EmailStarredListVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/EmailStarredListVO.java new file mode 100644 index 0000000..9151c07 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/EmailStarredListVO.java @@ -0,0 +1,23 @@ +package jnpf.model.email; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class EmailStarredListVO { + @Schema(description ="是否已读(1-已读,0-未)") + private Integer isRead; + @Schema(description ="附件") + private String attachment; + @Schema(description ="时间") + private Long fdate; + @Schema(description ="发件人") + private String id; + @Schema(description ="是否标星(1-是,0-否)") + private Integer starred; + @Schema(description ="发件人") + private String sender; + @Schema(description ="主题") + private String subject; + @Schema(description ="创建时间") + private long creatorTime; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/PaginationEmail.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/PaginationEmail.java new file mode 100644 index 0000000..1c717ad --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/email/PaginationEmail.java @@ -0,0 +1,10 @@ +package jnpf.model.email; +import jnpf.base.PaginationTime; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class PaginationEmail extends PaginationTime { + @Schema(description ="类型") + private String type; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/emailconfig/EmailConfigCheckForm.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/emailconfig/EmailConfigCheckForm.java new file mode 100644 index 0000000..6e4710b --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/emailconfig/EmailConfigCheckForm.java @@ -0,0 +1,36 @@ +package jnpf.model.emailconfig; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 邮箱账户密码验证 + */ +@Data +public class EmailConfigCheckForm { + @Schema(description ="邮箱密码") + private String password; + + @Schema(description ="显示名称") + private String senderName; + + @Schema(description ="SMTP服务") + private String smtpHost; + + @Schema(description ="POP3端口") + private Integer pop3Port; + + @Schema(description ="主键id") + private String id; + + @Schema(description ="SMTP端口") + private Integer smtpPort; + + @Schema(description ="ssl登录") + private Integer emailSsl; + + @Schema(description ="邮箱地址") + private String account; + + @Schema(description ="POP3服务") + private String pop3Host; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/emailconfig/EmailConfigSavaForm.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/emailconfig/EmailConfigSavaForm.java new file mode 100644 index 0000000..d8afd43 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/emailconfig/EmailConfigSavaForm.java @@ -0,0 +1,34 @@ +package jnpf.model.emailconfig; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +/** + * 保存邮箱配置 + */ +@Data +public class EmailConfigSavaForm { + + private String creatorUserId; + + private String password; + + private String senderName; + + private String smtpHost; + + private Integer pop3Port; + + private String id; + + private Date creatorTime; + + private Integer smtpPort; + + private Integer emailSsl; + + private String account; + + private String pop3Host; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/employee/EmployeeCrForm.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/employee/EmployeeCrForm.java new file mode 100644 index 0000000..2fdc55a --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/employee/EmployeeCrForm.java @@ -0,0 +1,43 @@ +package jnpf.model.employee; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.hibernate.validator.constraints.NotBlank; + +@Data +public class EmployeeCrForm { + @NotBlank(message = "必填") + @Schema(description ="姓名") + private String fullName; + @NotBlank(message = "必填") + @Schema(description ="工号") + private String enCode; + @NotBlank(message = "必填") + @Schema(description ="性别") + private String gender; + @NotBlank(message = "必填") + @Schema(description ="部门") + private String departmentName; + @NotBlank(message = "必填") + @Schema(description ="岗位") + private String positionName; + @Schema(description ="用工性质") + private String workingNature; + @NotBlank(message = "必填") + @Schema(description ="身份证号") + private String idNumber; + @NotBlank(message = "必填") + @Schema(description ="联系电话") + private String telephone; + @Schema(description ="参加工作") + private long attendWorkTime; + @Schema(description ="出生年月") + private long birthday; + @Schema(description ="最高学历") + private String education; + @Schema(description ="所学专业") + private String major; + @Schema(description ="毕业院校") + private String graduationAcademy; + @Schema(description ="毕业时间") + private long graduationTime; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/employee/EmployeeExportVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/employee/EmployeeExportVO.java new file mode 100644 index 0000000..b2f3c42 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/employee/EmployeeExportVO.java @@ -0,0 +1,138 @@ +package jnpf.model.employee; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * + */ +@Data +public class EmployeeExportVO { + /** + * 职员主键 + */ + private String id; + + /** + * 工号 + */ + private String enCode; + + /** + * 姓名 + */ + private String fullName; + + /** + * 性别 + */ + private String gender; + + /** + * 部门 + */ + private String departmentName; + + /** + * 岗位 + */ + private String positionName; + + /** + * 用工性质 + */ + private String workingNature; + + /** + * 身份证号 + */ + private String idNumber; + + /** + * 联系电话 + */ + private String telephone; + + /** + * 参加工作 + */ + private String attendWorkTime; + + /** + * 出生年月 + */ + private String birthday; + + /** + * 最高学历 + */ + private String education; + + /** + * 所学专业 + */ + private String major; + + /** + * 毕业院校 + */ + private String graduationAcademy; + + /** + * 毕业时间 + */ + private String graduationTime; + + /** + * 描述 + */ + private String description; + + /** + * 排序码 + */ + private Long sortCode; + + /** + * 有效标志 + */ + private Integer enabledMark; + + /** + * 创建时间 + */ + private String creatorTime; + + /** + * 创建用户 + */ + private String creatorUserId; + + /** + * 修改时间 + */ + private String lastModifyTime; + + /** + * 修改用户 + */ + private String lastModifyUserId; + + /** + * 删除标志 + */ + private Integer deleteMark; + + /** + * 删除时间 + */ + private String deleteTime; + + /** + * 删除用户 + */ + private String deleteUserId; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/employee/EmployeeImportVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/employee/EmployeeImportVO.java new file mode 100644 index 0000000..fd18f1e --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/employee/EmployeeImportVO.java @@ -0,0 +1,35 @@ +package jnpf.model.employee; + +import jnpf.model.EmployeeModel; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * + */ +@Data +public class EmployeeImportVO { + /** + * 导入成功条数 + */ + private int snum; + /** + * 导入失败条数 + */ + private int fnum; + /** + * 导入结果状态(0,成功 1,失败) + */ + private int resultType; + /** + * 失败结果 + */ + private List failResult; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/employee/EmployeeInfoModel.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/employee/EmployeeInfoModel.java new file mode 100644 index 0000000..16d415c --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/employee/EmployeeInfoModel.java @@ -0,0 +1,66 @@ +package jnpf.model.employee; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * + */ +@Data +public class EmployeeInfoModel { + @Schema(description ="出生年月") + private Date birthday; + @Schema(description ="参加工作") + private String attendWorkTime; + @Schema(description ="创建时间") + private Date creatorTime; + @Schema(description ="创建用户") + private String creatorUserId; + @Schema(description ="删除标志") + private String deleteMark; + @Schema(description ="删除时间") + private Date deleteTime; + @Schema(description ="删除用户") + private String deleteUserId; + @Schema(description ="部门") + private String departmentName; + @Schema(description ="描述") + private String description; + @Schema(description ="最高学历") + private String education; + @Schema(description ="工号") + private String enCode; + @Schema(description ="有效标志") + private Integer enabledMark; + @Schema(description ="姓名") + private String fullName; + @Schema(description ="性别") + private String gender; + @Schema(description ="毕业院校") + private String graduationAcademy ; + @Schema(description ="毕业时间") + private Date graduationTime; + @Schema(description ="自然主键") + private String id; + @Schema(description ="身份证号") + private String idNumber; + @Schema(description ="修改时间") + private Date lastModifyTime; + @Schema(description ="修改用户") + private String lastModifyUserId; + @Schema(description ="所学专业") + private String major; + @Schema(description ="岗位") + private String positionName; + @Schema(description ="排序") + private String sortCode; + @Schema(description ="联系电话") + private String telephone; + @Schema(description ="用工性质") + private String workingNature; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/employee/EmployeeInfoVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/employee/EmployeeInfoVO.java new file mode 100644 index 0000000..b5de03f --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/employee/EmployeeInfoVO.java @@ -0,0 +1,36 @@ +package jnpf.model.employee; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + + +@Data +public class EmployeeInfoVO { + @Schema(description ="姓名") + private String fullName; + @Schema(description ="工号") + private String enCode; + @Schema(description ="性别") + private String gender; + @Schema(description ="部门") + private String departmentName; + @Schema(description ="岗位") + private String positionName; + @Schema(description ="用工性质") + private String workingNature; + @Schema(description ="身份证号") + private String idNumber; + @Schema(description ="联系电话") + private String telephone; + @Schema(description ="参加工作") + private long attendWorkTime; + @Schema(description ="出生年月") + private long birthday; + @Schema(description ="最高学历") + private String education; + @Schema(description ="所学专业") + private String major; + @Schema(description ="毕业院校") + private String graduationAcademy; + @Schema(description ="毕业时间") + private long graduationTime; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/employee/EmployeeListVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/employee/EmployeeListVO.java new file mode 100644 index 0000000..bf1c93e --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/employee/EmployeeListVO.java @@ -0,0 +1,40 @@ +package jnpf.model.employee; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class EmployeeListVO { + @Schema(description ="主鍵") + private String id; + @Schema(description ="工号") + private String enCode; + @Schema(description ="姓名") + private String fullName; + @Schema(description ="性别ID") + private String gender; + @Schema(description ="部门") + private String departmentName; + @Schema(description ="岗位") + private String positionName; + @Schema(description ="用工性质") + private String workingNature; + @Schema(description ="身份证") + private String idNumber; + @Schema(description ="联系电话") + private String telephone; + @Schema(description ="生日") + private long birthday; + @Schema(description ="参加工作时间") + private long attendWorkTime; + @Schema(description ="学历") + private String education; + @Schema(description ="所学专业") + private String major; + @Schema(description ="毕业院校") + private String graduationAcademy; + @Schema(description ="毕业时间") + private long graduationTime; + @Schema(description ="创建时间") + private long creatorTime; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/employee/EmployeeUpForm.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/employee/EmployeeUpForm.java new file mode 100644 index 0000000..a82d797 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/employee/EmployeeUpForm.java @@ -0,0 +1,7 @@ +package jnpf.model.employee; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class EmployeeUpForm extends EmployeeCrForm{ +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/employee/PaginationEmployee.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/employee/PaginationEmployee.java new file mode 100644 index 0000000..4f72242 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/employee/PaginationEmployee.java @@ -0,0 +1,14 @@ +package jnpf.model.employee; +import jnpf.base.PaginationTime; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class PaginationEmployee extends PaginationTime { + @Schema(description ="字段") + private String condition; + @Schema(description ="类型") + private String dataType; + @Schema(description ="字段") + private String selectKey; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderCustomerVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderCustomerVO.java new file mode 100644 index 0000000..3ad893c --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderCustomerVO.java @@ -0,0 +1,21 @@ +package jnpf.model.order; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 订单信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/15 8:46 + */ +@Data +public class OrderCustomerVO { + @Schema(description = "主键id") + private String id; + @Schema(description = "编码") + private String code; + @Schema(description = "内容") + private String text; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderEntryListVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderEntryListVO.java new file mode 100644 index 0000000..5fd0cfa --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderEntryListVO.java @@ -0,0 +1,39 @@ +package jnpf.model.order; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 订单信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/15 8:46 + */ +@Data +public class OrderEntryListVO { + @Schema(description ="自然主键") + private String id; + @Schema(description ="商品名称") + private String goodsName; + @Schema(description ="规格型号") + private String specifications; + @Schema(description ="单位") + private String unit; + @Schema(description ="数量") + private String qty; + @Schema(description ="单价") + private String price; + @Schema(description ="金额") + private String amount; + @Schema(description =" 折扣%") + private String discount; + @Schema(description =" 税率%") + private String cess; + @Schema(description ="实际单价") + private String actualPrice; + @Schema(description ="实际金额") + private String actualAmount; + @Schema(description ="描述") + private String description; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderEntryModel.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderEntryModel.java new file mode 100644 index 0000000..7838c6a --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderEntryModel.java @@ -0,0 +1,65 @@ +package jnpf.model.order; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +/** + * 订单信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/15 8:46 + */ +@Data +public class OrderEntryModel { + @NotNull(message = "必填") + @Schema(description ="订单日期") + private Long remove; + @NotBlank(message = "必填") + @Schema(description ="自然主键") + private String id; + @NotBlank(message = "必填") + @Schema(description ="商品Id") + private String goodsId; + @NotBlank(message = "必填") + @Schema(description ="商品编码") + private String goodsCode; + @NotBlank(message = "必填") + @Schema(description ="商品名称") + private String goodsName; + @NotBlank(message = "必填") + @Schema(description ="规格型号") + private String specifications; + @NotBlank(message = "必填") + @Schema(description ="单位") + private String unit; + @NotBlank(message = "必填") + @Schema(description ="数量") + private String qty; + @NotBlank(message = "必填") + @Schema(description ="单价") + private String price; + @NotBlank(message = "金额不能为空") + @Schema(description ="金额") + private String amount; + @NotBlank(message = "折扣%不能为空") + @Schema(description =" 折扣%") + private String discount; + @NotBlank(message = "税率%不能为空") + @Schema(description =" 税率%") + private String cess; + @NotBlank(message = "实际单价不能为空") + @Schema(description ="实际单价") + private String actualPrice; + @NotBlank(message = "实际金额不能为空") + @Schema(description ="实际金额") + private String actualAmount; + @Schema(description ="描述") + private String description; + @Schema(description ="角标") + private String index; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderExportModel.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderExportModel.java new file mode 100644 index 0000000..558d1f4 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderExportModel.java @@ -0,0 +1,43 @@ +package jnpf.model.order; + +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 订单信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/15 8:46 + */ +@Data +public class OrderExportModel { + private String customerId; + private String customerName; + private String salesmanId; + private String salesmanName; + @JSONField(format = "yyyy-MM-dd HH:mm:ss") + private Date orderDate; + private String orderCode; + private String transportMode; + @JSONField(format = "yyyy-MM-dd HH:mm:ss") + private Date deliveryDate; + private String deliveryAddress; + private String paymentMode; + private BigDecimal receivableMoney; + private BigDecimal earnestRate; + private BigDecimal prepayEarnest; + private String description; + @JSONField(format = "yyyy-MM-dd HH:mm:ss") + private Date creatorTime; + private String creatorUserId; + @JSONField(format = "yyyy-MM-dd HH:mm:ss") + private Date lastModifyTime; + private String lastModifyUserId; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderForm.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderForm.java new file mode 100644 index 0000000..15e636c --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderForm.java @@ -0,0 +1,61 @@ +package jnpf.model.order; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 订单信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/15 8:46 + */ +@Data +public class OrderForm { + @Schema(description ="订单日期") + private Long orderDate; + @Schema(description ="订单编号") + private String orderCode; + @Schema(description ="应收金额") + private String receivableMoney; + @Schema(description ="定金比率") + private String earnestRate; + @Schema(description ="预付定金") + private String prepayEarnest; + @Schema(description ="客户名称") + private String customerName; + @Schema(description ="客户Id") + private String customerId; + @Schema(description ="业务员Id") + private String salesmanId; + @Schema(description ="业务员") + private String salesmanName; + @Schema(description ="付款方式") + private String paymentMode; + @Schema(description ="描述") + private String description; + @Schema(description ="运输方式") + private String transportMode; + @Schema(description ="发货日期") + private Long deliveryDate; + @Schema(description ="发货地址") + private String deliveryAddress; + @Schema(description ="附件信息") + private String fileJson; + @Schema(description ="自然主键") + private String id; + @Schema(description ="商品明细") + private List goodsList = new ArrayList<>(); + @Schema(description ="收款计划") + private List collectionPlanList = new ArrayList<>(); + @Schema(description ="状态") + private String status; + @Schema(description ="流程") + private String flowId; +} + diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderGoodsVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderGoodsVO.java new file mode 100644 index 0000000..689ee0b --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderGoodsVO.java @@ -0,0 +1,27 @@ +package jnpf.model.order; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 订单信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/15 8:46 + */ +@Data +public class OrderGoodsVO { + @Schema(description = "主键id") + private String id; + @Schema(description = "编码") + private String code; + @Schema(description = "内容") + private String text; + @Schema(description = "价格") + private String specifications; + @Schema(description = "单位") + private String unit; + @Schema(description = "价格") + private String price; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderInfoOrderEntryModel.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderInfoOrderEntryModel.java new file mode 100644 index 0000000..e5dd7f4 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderInfoOrderEntryModel.java @@ -0,0 +1,48 @@ +package jnpf.model.order; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 订单信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/15 8:46 + */ +@Data +public class OrderInfoOrderEntryModel { + @Schema(description ="订单日期") + private String remove; + @Schema(description ="自然主键") + private String id; + @Schema(description ="商品Id") + private String goodsId; + @Schema(description ="商品编码") + private String goodsCode; + @Schema(description ="商品名称") + private String goodsName; + @Schema(description ="规格型号") + private String specifications; + @Schema(description ="单位") + private String unit; + @Schema(description ="数量") + private String qty; + @Schema(description ="单价") + private String price; + @Schema(description ="金额", example = "1") + private int amount; + @Schema(description =" 折扣%", example = "1") + private int discount; + @Schema(description =" 税率%") + private String cess; + @Schema(description ="实际单价") + private String actualPrice; + @Schema(description ="实际金额") + private String actualAmount; + @Schema(description ="描述") + private String description; + @Schema(description ="排序", example = "1") + private int sortCode; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderInfoOrderReceivableModel.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderInfoOrderReceivableModel.java new file mode 100644 index 0000000..f70d3d8 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderInfoOrderReceivableModel.java @@ -0,0 +1,39 @@ +package jnpf.model.order; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 订单信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/15 8:46 + */ +@Data +public class OrderInfoOrderReceivableModel { + @Schema(description ="自然主键") + private String id; + @Schema(description ="收款日期") + private Long receivableDate; + @Schema(description ="收款比率", example = "1") + private int receivableRate; + @Schema(description ="收款金额") + private String receivableMoney; + @Schema(description ="收款方式") + private String receivableMode; + @Schema(description ="收款摘要") + @JsonProperty("abstract") + private String fabstract; + @Schema(description ="排序", example = "1") + private int sortCode; + @Schema(description ="收款状态") + private String receivableState; + @Schema(description ="订单主键") + private String orderId; + @Schema(description ="描述") + private String description; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderInfoVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderInfoVO.java new file mode 100644 index 0000000..3472343 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderInfoVO.java @@ -0,0 +1,63 @@ +package jnpf.model.order; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * 订单信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/15 8:46 + */ +@Data +public class OrderInfoVO { + @Schema(description ="有效标志", example = "1") + private Integer enabledMark; + @Schema(description ="制单人员") + private String creatorUserId; + @Schema(description ="附件信息") + private String fileJson; + @Schema(description ="付款方式") + private String paymentMode; + @Schema(description ="制单时间") + private Long creatorTime; + @Schema(description ="业务员Id") + private String salesmanId; + @Schema(description ="预付定金") + private String prepayEarnest; + @Schema(description ="运输方式") + private String transportMode; + @Schema(description ="客户名称") + private String customerName; + @Schema(description ="发货日期") + private Long deliveryDate; + @Schema(description ="订单主键") + private String id; + @Schema(description ="业务员") + private String salesmanName; + @Schema(description ="客户Id") + private String customerId; + @Schema(description ="修改时间") + private Long lastModifyTime; + @Schema(description ="应收金额") + private String receivableMoney; + @Schema(description ="发货地址") + private String deliveryAddress; + @Schema(description ="定金比率") + private String earnestRate; + @Schema(description ="描述") + private String description; + @Schema(description ="修改用户") + private String lastModifyUserId; + @Schema(description ="订单日期") + private Long orderDate; + @Schema(description ="订单编号") + private String orderCode; + @Schema(description ="订单明细") + List goodsList; + @Schema(description ="收款计划") + List collectionPlanList; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderListVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderListVO.java new file mode 100644 index 0000000..51b34c7 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderListVO.java @@ -0,0 +1,37 @@ +package jnpf.model.order; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 订单信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/15 8:46 + */ +@Data +public class OrderListVO { + @Schema(description ="订单日期") + private Long orderDate; + @Schema(description ="订单编号") + private String orderCode; + @Schema(description ="客户名称") + private String customerName; + @Schema(description ="业务员") + private String salesmanName; + @Schema(description ="描述") + private String description; + @Schema(description ="付款金额") + private String receivableMoney; + @Schema(description ="制单人员") + private String creatorUser; + @Schema(description ="制单人员Id") + private String creatorUserId; + @Schema(description ="主键id") + private String id; + @Schema(description ="当前状态") + private Integer currentState; + @Schema(description ="流程主键") + private String flowId; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderReceivableListVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderReceivableListVO.java new file mode 100644 index 0000000..6e34727 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderReceivableListVO.java @@ -0,0 +1,30 @@ +package jnpf.model.order; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 订单信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/15 8:46 + */ +@Data +public class OrderReceivableListVO { + @Schema(description ="自然主键") + private String id; + @Schema(description ="收款日期") + private Long receivableDate; + @Schema(description ="收款比率") + private Integer receivableRate; + @Schema(description ="收款金额") + private String receivableMoney; + @Schema(description ="收款方式") + private String receivableMode; + @Schema(description ="收款摘要") + @JsonProperty("abstract") + private String fabstract; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderReceivableModel.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderReceivableModel.java new file mode 100644 index 0000000..579b31e --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/OrderReceivableModel.java @@ -0,0 +1,45 @@ +package jnpf.model.order; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +/** + * 订单信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/15 8:46 + */ +@Data +public class OrderReceivableModel { + @Schema(description ="") + private String remove; + @NotBlank(message = "必填") + @Schema(description ="自然主键") + private String id; + @NotNull(message = "必填") + @Schema(description ="收款日期") + private Long receivableDate; + @NotNull(message = "必填") + @Schema(description ="收款比率") + private int receivableRate; + @NotBlank(message = "必填") + @Schema(description ="收款金额") + private String receivableMoney; + @NotBlank(message = "必填") + @Schema(description ="收款方式") + private String receivableMode; + @Schema(description ="收款摘要") + @JsonProperty("abstract") + private String fabstract; + @Schema(description ="") + private String index; + @Schema(description ="描述") + private String description; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/PaginationOrder.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/PaginationOrder.java new file mode 100644 index 0000000..1f8012f --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/order/PaginationOrder.java @@ -0,0 +1,18 @@ +package jnpf.model.order; +import jnpf.base.PaginationTime; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 订单信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/15 8:46 + */ +@Data +public class PaginationOrder extends PaginationTime { + @Schema(description ="有效标志") + private String enabledMark; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/product/ProductCrForm.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/product/ProductCrForm.java new file mode 100644 index 0000000..531f75c --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/product/ProductCrForm.java @@ -0,0 +1,60 @@ +package jnpf.model.product; +import jnpf.model.productEntry.ProductEntryInfoVO; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +/** + * + * Product模型 + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021-07-10 10:40:59 + */ +@Data +public class ProductCrForm { + @Schema(description ="订单编号") + private String code; + @Schema(description ="客户Id") + private String customerId; + @Schema(description ="客户名称") + private String customerName; + @Schema(description ="审核人") + private String auditName; + @Schema(description ="审核日期") + private Long auditDate; + @Schema(description ="发货仓库") + private String goodsWarehouse; + @Schema(description ="发货通知时间") + private Long goodsDate; + @Schema(description ="发货通知人") + private String goodsName; + @Schema(description ="收款方式") + private String gatheringType; + @Schema(description ="业务员") + private String business; + @Schema(description ="送货地址") + private String address; + @Schema(description ="联系方式") + private String contactTel; + @Schema(description ="收货消息") + private Integer harvestMsg; + @Schema(description ="收货仓库") + private String harvestWarehouse; + @Schema(description ="代发客户") + private String issuingName; + @Schema(description ="让利金额") + private BigDecimal partPrice; + @Schema(description ="优惠金额") + private BigDecimal reducedPrice; + @Schema(description ="折后金额") + private BigDecimal discountPrice; + @Schema(description ="备注") + private String description; + @Schema(description ="子表数据") + private List productEntryList; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/product/ProductInfoVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/product/ProductInfoVO.java new file mode 100644 index 0000000..0918730 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/product/ProductInfoVO.java @@ -0,0 +1,61 @@ +package jnpf.model.product; +import jnpf.model.productEntry.ProductEntryInfoVO; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +/** + * + * Product模型 + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021-07-10 10:40:59 + */ +@Data +public class ProductInfoVO{ + @Schema(description ="主键") + private String id; + @Schema(description ="订单编号") + private String code; + @Schema(description ="客户id") + private String customerId; + @Schema(description ="客户名称") + private String customerName; + @Schema(description ="审核人") + private String auditName; + @Schema(description ="审核日期") + private Long auditDate; + @Schema(description ="发货仓库") + private String goodsWarehouse; + @Schema(description ="发货通知时间") + private Long goodsDate; + @Schema(description ="发货通知人") + private String goodsName; + @Schema(description ="收款方式") + private String gatheringType; + @Schema(description ="业务员") + private String business; + @Schema(description ="送货地址") + private String address; + @Schema(description ="联系方式") + private String contactTel; + @Schema(description ="收货消息") + private Integer harvestMsg; + @Schema(description ="收货仓库") + private String harvestWarehouse; + @Schema(description ="代发客户") + private String issuingName; + @Schema(description ="让利金额") + private BigDecimal partPrice; + @Schema(description ="优惠金额") + private BigDecimal reducedPrice; + @Schema(description ="折后金额") + private BigDecimal discountPrice; + @Schema(description ="备注") + private String description; + @Schema(description ="子表数据") + private List productEntryList; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/product/ProductListVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/product/ProductListVO.java new file mode 100644 index 0000000..458e03a --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/product/ProductListVO.java @@ -0,0 +1,41 @@ + + +package jnpf.model.product; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * Product模型 + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021-07-10 10:40:59 + */ +@Data +public class ProductListVO{ + @Schema(description ="主键") + private String id; + @Schema(description ="订单编号") + private String code; + @Schema(description ="客户名称") + private String customerName; + @Schema(description ="业务员") + private String business; + @Schema(description ="送货地址") + private String address; + @Schema(description ="联系方式") + private String contactTel; + @Schema(description ="制单人") + private String salesmanName; + @Schema(description ="审核状态") + private Integer auditState; + @Schema(description ="发货状态") + private Integer goodsState; + @Schema(description ="关闭状态") + private Integer closeState; + @Schema(description ="关闭日期") + private Long closeDate; + @Schema(description ="联系人") + private String contactName; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/product/ProductPagination.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/product/ProductPagination.java new file mode 100644 index 0000000..40a031f --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/product/ProductPagination.java @@ -0,0 +1,25 @@ +package jnpf.model.product; +import jnpf.base.Pagination; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * Product模型 + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021-07-10 10:40:59 + */ +@Data +public class ProductPagination extends Pagination { + @Schema(description ="订单编号") + private String code; + @Schema(description ="客户名称") + private String customerName; + @Schema(description ="联系方式") + private String contactTel; + + + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/product/ProductUpForm.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/product/ProductUpForm.java new file mode 100644 index 0000000..94b2742 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/product/ProductUpForm.java @@ -0,0 +1,17 @@ + +package jnpf.model.product; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * Product模型 + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021-07-10 10:40:59 + */ +@Data +public class ProductUpForm extends ProductCrForm { + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productEntry/ProductEntryInfoVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productEntry/ProductEntryInfoVO.java new file mode 100644 index 0000000..05b840b --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productEntry/ProductEntryInfoVO.java @@ -0,0 +1,33 @@ +package jnpf.model.productEntry; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * Product模型 + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021-07-10 10:40:59 + */ +@Data +public class ProductEntryInfoVO { + @Schema(description ="产品编号") + private String productCode; + @Schema(description ="产品名称") + private String productName; + @Schema(description ="产品规格") + private String productSpecification; + @Schema(description ="数量") + private Long qty; + @Schema(description ="订货类型") + private String type; + @Schema(description ="单价") + private String money; + @Schema(description ="折后单价") + private String price; + @Schema(description ="金额") + private String amount; + @Schema(description ="备注") + private String description; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productEntry/ProductEntryListVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productEntry/ProductEntryListVO.java new file mode 100644 index 0000000..48394aa --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productEntry/ProductEntryListVO.java @@ -0,0 +1,29 @@ +package jnpf.model.productEntry; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * Product模型 + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021-07-10 10:40:59 + */ +@Data +public class ProductEntryListVO { + @Schema(description ="产品编号") + private String productCode; + @Schema(description ="产品名称") + private String productName; + @Schema(description ="数量") + private Long qty; + @Schema(description ="订货类型") + private String type; + @Schema(description ="活动") + private String activity; + @Schema(description ="数据") + private List dataList; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productEntry/ProductEntryMdoel.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productEntry/ProductEntryMdoel.java new file mode 100644 index 0000000..98c23c4 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productEntry/ProductEntryMdoel.java @@ -0,0 +1,27 @@ +package jnpf.model.productEntry; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * Product模型 + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021-07-10 10:40:59 + */ +@Data +public class ProductEntryMdoel { + @Schema(description ="产品规格") + private String productSpecification; + @Schema(description ="数量") + private String qty; + @Schema(description ="单价") + private String money; + @Schema(description ="折后单价") + private String price; + @Schema(description ="单位") + private String util; + @Schema(description ="控制方式") + private String commandType; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productclassify/ProductclassifyCrForm.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productclassify/ProductclassifyCrForm.java new file mode 100644 index 0000000..f3e3e05 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productclassify/ProductclassifyCrForm.java @@ -0,0 +1,20 @@ +package jnpf.model.productclassify; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 产品分类 + * + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021-07-10 14:34:04 + */ +@Data +public class ProductclassifyCrForm { + @Schema(description ="名称") + private String fullName; + @Schema(description ="上级") + private String parentId; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productclassify/ProductclassifyInfoVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productclassify/ProductclassifyInfoVO.java new file mode 100644 index 0000000..6e81df4 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productclassify/ProductclassifyInfoVO.java @@ -0,0 +1,23 @@ +package jnpf.model.productclassify; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * 产品分类 + * + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021-07-10 14:34:04 + */ +@Data +public class ProductclassifyInfoVO{ + @Schema(description ="主键") + private String id; + @Schema(description ="名称") + private String fullName; + @Schema(description ="上级") + private String parentId; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productclassify/ProductclassifyListVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productclassify/ProductclassifyListVO.java new file mode 100644 index 0000000..1cc2dc0 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productclassify/ProductclassifyListVO.java @@ -0,0 +1,27 @@ +package jnpf.model.productclassify; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * 产品分类 + * + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021-07-10 14:34:04 + */ +@Data +public class ProductclassifyListVO{ + @Schema(description ="主键") + private String id; + @Schema(description ="名称") + private String fullName; + @Schema(description ="是否子节点") + private String hasChildren; + @Schema(description ="子节点") + private List children; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productclassify/ProductclassifyModel.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productclassify/ProductclassifyModel.java new file mode 100644 index 0000000..718c3dc --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productclassify/ProductclassifyModel.java @@ -0,0 +1,22 @@ +package jnpf.model.productclassify; + +import jnpf.util.treeutil.SumTree; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * 产品分类 + * + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021-07-10 14:34:04 + */ +@Data +public class ProductclassifyModel extends SumTree { + + /** 名称 */ + private String fullName; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productclassify/ProductclassifyUpForm.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productclassify/ProductclassifyUpForm.java new file mode 100644 index 0000000..5fcc270 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productclassify/ProductclassifyUpForm.java @@ -0,0 +1,17 @@ +package jnpf.model.productclassify; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * 产品分类 + * + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021-07-10 14:34:04 + */ +@Data +public class ProductclassifyUpForm extends ProductclassifyCrForm { + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productgoods/ProductGoodsCrForm.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productgoods/ProductGoodsCrForm.java new file mode 100644 index 0000000..9f4136d --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productgoods/ProductGoodsCrForm.java @@ -0,0 +1,29 @@ +package jnpf.model.productgoods; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * 产品商品 + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021-07-10 15:57:50 + */ +@Data +public class ProductGoodsCrForm { + @Schema(description ="分类主键") + private String classifyId; + @Schema(description ="产品编号") + private String code; + @Schema(description ="产品名称") + private String fullName; + @Schema(description ="产品规格") + private String productSpecification; + @Schema(description ="单价") + private String money; + @Schema(description ="金额") + private String amount; + @Schema(description ="库存数") + private String qty; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productgoods/ProductGoodsInfoVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productgoods/ProductGoodsInfoVO.java new file mode 100644 index 0000000..70ede01 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productgoods/ProductGoodsInfoVO.java @@ -0,0 +1,32 @@ +package jnpf.model.productgoods; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * 产品商品 + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021-07-10 15:57:50 + */ +@Data +public class ProductGoodsInfoVO{ + @Schema(description ="主键") + private String id; + @Schema(description ="分类主键") + private String classifyId; + @Schema(description ="产品编号") + private String code; + @Schema(description ="产品名称") + private String fullName; + @Schema(description ="产品规格") + private String productSpecification; + @Schema(description ="单价") + private String money; + @Schema(description ="金额") + private String amount; + @Schema(description ="库存数") + private String qty; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productgoods/ProductGoodsListVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productgoods/ProductGoodsListVO.java new file mode 100644 index 0000000..052fb1a --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productgoods/ProductGoodsListVO.java @@ -0,0 +1,33 @@ +package jnpf.model.productgoods; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * 产品商品 + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021-07-10 15:57:50 + */ +@Data +public class ProductGoodsListVO{ + @Schema(description ="主键") + private String id; + @Schema(description ="分类主键") + private String classifyId; + @Schema(description ="产品编号") + private String code; + @Schema(description ="产品名称") + private String fullName; + @Schema(description ="产品规格") + private String productSpecification; + @Schema(description ="单价") + private String money; + @Schema(description ="金额") + private String amount; + @Schema(description ="库存数") + private String qty; + @Schema(description ="订货分类") + private String type; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productgoods/ProductGoodsPagination.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productgoods/ProductGoodsPagination.java new file mode 100644 index 0000000..8e4c6c6 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productgoods/ProductGoodsPagination.java @@ -0,0 +1,23 @@ +package jnpf.model.productgoods; +import jnpf.base.Pagination; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * 产品商品 + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021-07-10 15:57:50 + */ +@Data +public class ProductGoodsPagination extends Pagination { + @Schema(description ="分类主键") + private String classifyId; + @Schema(description ="产品编号") + private String code; + @Schema(description ="产品名称") + private String fullName; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productgoods/ProductGoodsUpForm.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productgoods/ProductGoodsUpForm.java new file mode 100644 index 0000000..9fce3d0 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/productgoods/ProductGoodsUpForm.java @@ -0,0 +1,15 @@ +package jnpf.model.productgoods; +import lombok.Data; + +/** + * + * 产品商品 + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021-07-10 15:57:50 + */ +@Data +public class ProductGoodsUpForm extends ProductGoodsCrForm { + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttCrForm.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttCrForm.java new file mode 100644 index 0000000..141e073 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttCrForm.java @@ -0,0 +1,46 @@ +package jnpf.model.projectgantt; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.hibernate.validator.constraints.NotBlank; + +import javax.validation.constraints.NotNull; +import java.math.BigDecimal; + +@Data +public class ProjectGanttCrForm { + + @NotNull(message = "必填") + @Schema(description ="完成进度") + private Integer schedule; + + @NotBlank(message = "必填") + @Schema(description ="项目名称") + private String fullName; + + @NotBlank(message = "必填") + @Schema(description ="项目编码") + private String enCode; + + @NotBlank(message = "必填") + @Schema(description ="参与人员") + private String managerIds; + + @NotNull(message = "必填") + @Schema(description ="开始时间") + private long startTime; + + @NotNull(message = "必填") + @Schema(description ="结束时间") + private long endTime; + + @NotNull(message = "必填") + @Schema(description ="项目工期") + private BigDecimal timeLimit; + + @Schema(description ="项目描述") + private String description; + + @Schema(description ="项目状态") + private Integer state; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttInfoVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttInfoVO.java new file mode 100644 index 0000000..9b77243 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttInfoVO.java @@ -0,0 +1,29 @@ +package jnpf.model.projectgantt; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class ProjectGanttInfoVO { + @Schema(description ="父级id") + private String parentId; + @Schema(description ="项目编码") + private String enCode; + @Schema(description ="开始时间") + private long startTime; + @Schema(description ="完成进度") + private String schedule; + @Schema(description ="项目工期") + private String timeLimit; + @Schema(description ="项目名称") + private String fullName; + @Schema(description ="主键id") + private String id; + @Schema(description ="结束时间") + private long endTime; + @Schema(description ="参与人员") + private String managerIds; + @Schema(description ="项目描述") + private String description; + @Schema(description ="状态") + private Integer state; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttListVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttListVO.java new file mode 100644 index 0000000..44b07b1 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttListVO.java @@ -0,0 +1,29 @@ +package jnpf.model.projectgantt; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +@Data +public class ProjectGanttListVO { + @Schema(description ="主键id") + private String id; + @Schema(description ="项目编码") + private String enCode; + @Schema(description ="项目名称") + private String fullName; + @Schema(description ="项目工期") + private String timeLimit; + @Schema(description ="开始时间") + private long startTime; + @Schema(description ="结束时间") + private long endTime; + private Integer schedule; + @Schema(description ="参与人员") + private String managerIds; + @Schema(description ="状态") + private Integer state; + @Schema(description ="详情") + private List managersInfo; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttManagerIModel.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttManagerIModel.java new file mode 100644 index 0000000..3620014 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttManagerIModel.java @@ -0,0 +1,11 @@ +package jnpf.model.projectgantt; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class ProjectGanttManagerIModel { + @Schema(description ="账号+名字") + private String account; + @Schema(description ="用户头像") + private String headIcon; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttTaskInfoVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttTaskInfoVO.java new file mode 100644 index 0000000..9cd1fb9 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttTaskInfoVO.java @@ -0,0 +1,31 @@ +package jnpf.model.projectgantt; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class ProjectGanttTaskInfoVO { + @Schema(description ="开始时间") + private long startTime; + @Schema(description ="完成进度") + private String schedule; + @Schema(description ="项目工期") + private String timeLimit; + @Schema(description ="项目名称") + private String fullName; + @Schema(description ="父级id") + private String parentId; + @Schema(description ="主键id") + private String id; + @Schema(description ="结束时间") + private long endTime; + @Schema(description ="参与人员") + private String managerIds; + @Schema(description ="项目描述") + private String description; + @Schema(description ="项目主键") + private String projectId; + @Schema(description ="标记颜色") + private String signColor; + @Schema(description ="标记") + private String sign; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttTaskTreeModel.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttTaskTreeModel.java new file mode 100644 index 0000000..fa45f40 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttTaskTreeModel.java @@ -0,0 +1,10 @@ +package jnpf.model.projectgantt; + +import jnpf.util.treeutil.SumTree; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class ProjectGanttTaskTreeModel extends SumTree { + private String fullName; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttTaskTreeVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttTaskTreeVO.java new file mode 100644 index 0000000..d1e7f67 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttTaskTreeVO.java @@ -0,0 +1,31 @@ +package jnpf.model.projectgantt; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +@Data +public class ProjectGanttTaskTreeVO { + @Schema(description ="主键") + private String id; + @Schema(description ="父级主键") + private String parentId; + @Schema(description ="是否有子集") + private Boolean hasChildren; + @Schema(description ="名称") + private String fullName; + @Schema(description ="完成进度") + private Integer schedule; + @Schema(description ="项目主键") + private String projectId; + @Schema(description ="开始时间") + private long startTime; + @Schema(description ="结束时间") + private long endTime; + @Schema(description ="标记颜色") + private String signColor; + @Schema(description ="标记") + private String sign; + @Schema(description ="开始时间") + private List children; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttTreeModel.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttTreeModel.java new file mode 100644 index 0000000..90f7cda --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttTreeModel.java @@ -0,0 +1,20 @@ +package jnpf.model.projectgantt; + +import jnpf.util.treeutil.SumTree; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class ProjectGanttTreeModel extends SumTree { + + private Integer schedule; + + private String fullName; + + private long startTime; + + private long endTime; + + private String signColor; + private String sign; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttTreeVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttTreeVO.java new file mode 100644 index 0000000..fdf301b --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttTreeVO.java @@ -0,0 +1,29 @@ +package jnpf.model.projectgantt; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +@Data +public class ProjectGanttTreeVO { + @Schema(description ="主键") + private String id; + @Schema(description ="父级主键") + private String parentId; + @Schema(description ="名称") + private String fullName; + @Schema(description ="开始时间") + private String startTime; + @Schema(description ="结束时间") + private String endTime; + @Schema(description ="标记") + private String sign; + @Schema(description ="标记颜色") + private String signColor; + @Schema(description ="完成进度") + private String schedule; + @Schema(description ="是否有子集") + private Boolean hasChildren; + @Schema(description ="开始时间") + private List children; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttTsakCrForm.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttTsakCrForm.java new file mode 100644 index 0000000..6490fcc --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttTsakCrForm.java @@ -0,0 +1,46 @@ +package jnpf.model.projectgantt; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.hibernate.validator.constraints.NotBlank; + +import javax.validation.constraints.NotNull; +import java.math.BigDecimal; + +@Data +public class ProjectGanttTsakCrForm { + @NotBlank(message = "必填") + @Schema(description ="父级Id") + private String parentId; + private String projectId; + + @NotNull(message = "必填") + @Schema(description ="完成进度") + private Integer schedule; + + @NotBlank(message = "必填") + @Schema(description ="项目名称") + private String fullName; + + @NotBlank(message = "必填") + @Schema(description ="参与人员") + private String managerIds; + + @NotNull(message = "必填") + @Schema(description ="开始时间") + private long startTime; + + @NotNull(message = "必填") + @Schema(description ="结束时间") + private long endTime; + + @NotNull(message = "必填") + @Schema(description ="项目工期") + private BigDecimal timeLimit; + + @Schema(description ="项目描述") + private String description; + @Schema(description ="标记颜色") + private String signColor; + @Schema(description ="标记") + private String sign; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttTsakUpForm.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttTsakUpForm.java new file mode 100644 index 0000000..8d36d1f --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttTsakUpForm.java @@ -0,0 +1,8 @@ +package jnpf.model.projectgantt; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class ProjectGanttTsakUpForm extends ProjectGanttTsakCrForm{ + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttUpForm.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttUpForm.java new file mode 100644 index 0000000..340473a --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/projectgantt/ProjectGanttUpForm.java @@ -0,0 +1,9 @@ +package jnpf.model.projectgantt; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + + +@Data +public class ProjectGanttUpForm extends ProjectGanttCrForm { + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/schedule/ScheduleCrForm.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/schedule/ScheduleCrForm.java new file mode 100644 index 0000000..f8d270b --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/schedule/ScheduleCrForm.java @@ -0,0 +1,33 @@ +package jnpf.model.schedule; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.hibernate.validator.constraints.NotBlank; + +import javax.validation.constraints.NotNull; + +@Data +public class ScheduleCrForm { + @Schema(description ="开始时间") + private long startTime; + @NotNull(message = "必填") + @Schema(description ="结束时间") + private long endTime; + @NotBlank(message = "必填") + @Schema(description ="日程内容") + private String content; + @Schema(description ="提醒设置") + private Integer early; + @Schema(description ="APP提醒(1-提醒,0-不提醒)") + private Integer appAlert; + @Schema(description ="日程颜色") + private String colour; + @Schema(description ="颜色样式") + private String colourCss; + @Schema(description ="微信提醒(1-提醒,0-不提醒)") + private Integer weChatAlert; + @Schema(description ="邮件提醒(1-提醒,0-不提醒)") + private Integer mailAlert; + @Schema(description ="短信提醒(1-提醒,0-不提醒)") + private Integer mobileAlert; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/schedule/ScheduleInfoVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/schedule/ScheduleInfoVO.java new file mode 100644 index 0000000..f33758c --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/schedule/ScheduleInfoVO.java @@ -0,0 +1,29 @@ +package jnpf.model.schedule; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class ScheduleInfoVO { + @Schema(description ="日程主键") + private String id; + @Schema(description ="开始时间(时间戳)") + private long startTime; + @Schema(description ="结束时间(时间戳)") + private long endTime; + @Schema(description ="日程内容") + private String content; + @Schema(description ="提醒设置",example = "1") + private Integer early; + @Schema(description ="APP提醒(1-提醒,0-不提醒)",example = "1") + private Integer appAlert; + @Schema(description ="日程颜色") + private String colour; + @Schema(description ="颜色样式") + private String colourCss; + @Schema(description ="微信提醒(1-提醒,0-不提醒)",example = "1") + private Integer weChatAlert; + @Schema(description ="邮件提醒(1-提醒,0-不提醒)",example = "1") + private Integer mailAlert; + @Schema(description ="短信提醒(1-提醒,0-不提醒)",example = "1") + private Integer mobileAlert; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/schedule/ScheduleListVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/schedule/ScheduleListVO.java new file mode 100644 index 0000000..82f6c64 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/schedule/ScheduleListVO.java @@ -0,0 +1,17 @@ +package jnpf.model.schedule; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class ScheduleListVO{ + @Schema(description ="日程主键") + private String id; + @Schema(description ="开始时间") + private long startTime; + @Schema(description ="开始时间") + private long endTime; + @Schema(description ="颜色") + private String colour; + @Schema(description ="日程内容") + private String content; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/schedule/ScheduleTime.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/schedule/ScheduleTime.java new file mode 100644 index 0000000..ee1ab48 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/schedule/ScheduleTime.java @@ -0,0 +1,11 @@ +package jnpf.model.schedule; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class ScheduleTime { + @Schema(description ="开始时间") + private String startTime; + @Schema(description ="结束时间") + private String endTime; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/schedule/ScheduleTimes.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/schedule/ScheduleTimes.java new file mode 100644 index 0000000..d855cc7 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/schedule/ScheduleTimes.java @@ -0,0 +1,9 @@ +package jnpf.model.schedule; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class ScheduleTimes extends ScheduleTime { + @Schema(description ="日期") + private String dateTime; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/schedule/ScheduleUpForm.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/schedule/ScheduleUpForm.java new file mode 100644 index 0000000..8f46d6e --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/schedule/ScheduleUpForm.java @@ -0,0 +1,8 @@ +package jnpf.model.schedule; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + + +@Data +public class ScheduleUpForm extends ScheduleCrForm{ +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/PaginationTableExample.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/PaginationTableExample.java new file mode 100644 index 0000000..9d78928 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/PaginationTableExample.java @@ -0,0 +1,10 @@ +package jnpf.model.tableexample; +import jnpf.base.PaginationTime; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class PaginationTableExample extends PaginationTime { + @Schema(description ="标签") + private String F_Sign; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleCityListVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleCityListVO.java new file mode 100644 index 0000000..28f9602 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleCityListVO.java @@ -0,0 +1,15 @@ +package jnpf.model.tableexample; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class TableExampleCityListVO { + @Schema(description ="父级主键") + private String id; + @Schema(description ="名称") + private String fullName; + @Schema(description ="图标") + private String enCode; + @Schema(description ="父级主键") + private String parentId; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleCrForm.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleCrForm.java new file mode 100644 index 0000000..d427509 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleCrForm.java @@ -0,0 +1,48 @@ +package jnpf.model.tableexample; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.hibernate.validator.constraints.NotBlank; + +@Data +public class TableExampleCrForm { + @NotBlank(message = "必填") + @Schema(description ="负责人") + private String principal; + + @Schema(description ="交互日期") + private long interactionDate; + + @Schema(description ="立顶人") + private String jackStands; + + @NotBlank(message = "必填") + @Schema(description ="项目编码") + private String projectCode; + + @Schema(description ="项目阶段") + private String projectPhase; + + @Schema(description ="已用金额",example = "1") + private Long tunesAmount; + + @NotBlank(message = "必填") + @Schema(description ="项目类型") + private String projectType; + + @Schema(description ="费用金额",example = "1") + private Long costAmount; + + @Schema(description ="预计收入",example = "1") + private Long projectedIncome; + + @Schema(description ="备注") + private String description; + + @NotBlank(message = "必填") + @Schema(description ="项目名称") + private String projectName; + + @Schema(description ="客户名称") + private String customerName; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleIndustryListVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleIndustryListVO.java new file mode 100644 index 0000000..7a4f1be --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleIndustryListVO.java @@ -0,0 +1,17 @@ +package jnpf.model.tableexample; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class TableExampleIndustryListVO { + @Schema(description ="父级主键") + private String id; + @Schema(description ="名称") + private String fullName; + @Schema(description ="图标") + private String enCode; + @Schema(description ="是否有下级菜单") + private Boolean isLeaf; + @Schema(description ="父级主键") + private String parentId; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleInfoVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleInfoVO.java new file mode 100644 index 0000000..0616de8 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleInfoVO.java @@ -0,0 +1,9 @@ +package jnpf.model.tableexample; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class TableExampleInfoVO extends TableExampleCrForm { + @Schema(description ="主键") + private String id; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleListAllVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleListAllVO.java new file mode 100644 index 0000000..42728a5 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleListAllVO.java @@ -0,0 +1,51 @@ +package jnpf.model.tableexample; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class TableExampleListAllVO { + @Schema(description ="主键") + private String id; + + @Schema(description ="项目名称") + private String projectName; + + @Schema(description ="项目编码") + private String projectCode; + + @Schema(description ="项目类型") + private String projectType; + + @Schema(description ="项目阶段") + private String projectPhase; + + @Schema(description ="客户名称") + private String customerName; + + @Schema(description ="负责人") + private String principal; + + @Schema(description ="立顶人") + private String jackStands; + + @Schema(description ="交付日期") + private long interactionDate; + + @Schema(description ="费用金额", example = "1") + private Long costAmount; + + @Schema(description ="已用金额", example = "1") + private Long tunesAmount; + + @Schema(description ="预计收入", example = "1") + private Long projectedIncome; + + @Schema(description ="登记人") + private String registrant; + @Schema(description ="登记日期") + private long registerDate; + + @Schema(description ="备注") + private String description; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleListDTO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleListDTO.java new file mode 100644 index 0000000..28d2330 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleListDTO.java @@ -0,0 +1,81 @@ +package jnpf.model.tableexample; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +@Data +public class TableExampleListDTO { + + @Schema(description ="负责人") + private String principal; + + @Schema(description ="交互日期") + private Date interactionDate; + + @Schema(description ="立顶人") + private String jackStands; + + @Schema(description ="项目编码") + private String projectCode; + + @Schema(description ="项目阶段") + private String projectPhase; + + @Schema(description ="已用金额") + private Long tunesAmount; + + @Schema(description ="项目类型") + private String projectType; + + @Schema(description ="费用金额") + private Long costAmount; + + @Schema(description ="预计收入") + private Long projectedIncome; + + @Schema(description ="备注") + private String description; + + @Schema(description ="项目名称") + private String projectName; + + @Schema(description ="客户名称") + private String customerName; + + + + + @Schema(description ="批注总数") + private String postilCount; + + @Schema(description ="批注列表Json") + private String postilJson; + + @Schema(description ="编辑时间") + private Date lastModifyTime; + + @Schema(description ="编辑用户") + private String lastModifyUserId; + + + + @Schema(description ="标记") + private String sign; + + @Schema(description ="登记人") + private String registrant; + + @Schema(description ="登记时间") + private Date registerDate; + + @Schema(description ="自然主键") + private String id; + + @Schema(description ="排序码") + private String sortCode; + + @Schema(description ="有效标志") + private Integer enabledMark; + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleListVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleListVO.java new file mode 100644 index 0000000..3ba26db --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleListVO.java @@ -0,0 +1,57 @@ +package jnpf.model.tableexample; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + + +@Data +public class TableExampleListVO { + @Schema(description ="主键") + private String id; + + @Schema(description ="项目名称") + private String projectName; + + @Schema(description ="项目编码") + private String projectCode; + + @Schema(description ="项目类型") + private String projectType; + + @Schema(description ="项目阶段") + private String projectPhase; + + @Schema(description ="客户名称") + private String customerName; + + @Schema(description ="负责人") + private String principal; + + @Schema(description ="立顶人") + private String jackStands; + + @Schema(description ="交付日期") + private long interactionDate; + + @Schema(description ="费用金额",example = "1") + private Long costAmount; + + @Schema(description ="已用金额",example = "1") + private Long tunesAmount; + + @Schema(description ="预计收入",example = "1") + private Long projectedIncome; + + @Schema(description ="登记人") + private String registrant; + @Schema(description ="登记人") + private long registerDate; + + @Schema(description ="备注") + private String description; + + @Schema(description ="批注") + private String postilJson; + @Schema(description ="标记") + private String sign; + private String postilCount; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleRowUpForm.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleRowUpForm.java new file mode 100644 index 0000000..b3d1708 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleRowUpForm.java @@ -0,0 +1,54 @@ +package jnpf.model.tableexample; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.hibernate.validator.constraints.NotBlank; + +import java.math.BigDecimal; + +/** + * 行编辑 + */ +@Data +public class TableExampleRowUpForm { + @NotBlank(message = "必填") + @Schema(description ="项目名称") + private String projectName; + + @NotBlank(message = "必填") + @Schema(description ="项目编码") + private String projectCode; + + @NotBlank(message = "必填") + @Schema(description ="项目类型") + private String projectType; + + @Schema(description ="项目阶段") + private String projectPhase; + + @Schema(description ="交互日期") + private long interactionDate; + + @Schema(description ="客户名称") + private String customerName; + + @NotBlank(message = "必填") + @Schema(description ="负责人") + private String principal; + + @Schema(description ="立顶人") + private String jackStands; + + @Schema(description ="费用金额",example = "1") + private BigDecimal costAmount; + + @Schema(description ="已用金额",example = "1") + private BigDecimal tunesAmount; + + @Schema(description ="预计收入",example = "1") + private BigDecimal projectedIncome; + + @Schema(description ="备注") + private String description; + + private String oper; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleSignUpForm.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleSignUpForm.java new file mode 100644 index 0000000..8520e9a --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleSignUpForm.java @@ -0,0 +1,14 @@ +package jnpf.model.tableexample; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.hibernate.validator.constraints.NotBlank; + +/** + * 更新标签 + */ +@Data +public class TableExampleSignUpForm { + @NotBlank(message = "必填") + @Schema(description ="项目标记") + private String sign; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleTreeModel.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleTreeModel.java new file mode 100644 index 0000000..3d128b1 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleTreeModel.java @@ -0,0 +1,15 @@ +package jnpf.model.tableexample; + +import jnpf.util.treeutil.SumTree; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Map; + +@Data +public class TableExampleTreeModel extends SumTree { + private Boolean loaded; + private Boolean expanded; + private Map ht; + private String text; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleUpForm.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleUpForm.java new file mode 100644 index 0000000..166e6f3 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/TableExampleUpForm.java @@ -0,0 +1,8 @@ +package jnpf.model.tableexample; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class TableExampleUpForm extends TableExampleCrForm { + +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/postil/PostilInfoVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/postil/PostilInfoVO.java new file mode 100644 index 0000000..a1ddf12 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/postil/PostilInfoVO.java @@ -0,0 +1,10 @@ +package jnpf.model.tableexample.postil; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.checkerframework.checker.units.qual.A; + +@Data +public class PostilInfoVO { + @Schema(description ="批注列表Json") + private String postilJson; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/postil/PostilModel.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/postil/PostilModel.java new file mode 100644 index 0000000..4cdb3aa --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/postil/PostilModel.java @@ -0,0 +1,10 @@ +package jnpf.model.tableexample.postil; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class PostilModel { + private String userId; + private String text; + private String creatorTime; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/postil/PostilSendForm.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/postil/PostilSendForm.java new file mode 100644 index 0000000..7d0efb9 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/tableexample/postil/PostilSendForm.java @@ -0,0 +1,9 @@ +package jnpf.model.tableexample.postil; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class PostilSendForm { + @Schema(description ="内容") + private String text; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/worklog/WorkLogCrForm.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/worklog/WorkLogCrForm.java new file mode 100644 index 0000000..6368294 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/worklog/WorkLogCrForm.java @@ -0,0 +1,24 @@ +package jnpf.model.worklog; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.hibernate.validator.constraints.NotBlank; + + +@Data +public class WorkLogCrForm { + @NotBlank(message = "必填") + @Schema(description ="标题") + private String title; + @NotBlank(message = "必填") + @Schema(description ="内容") + private String question; + @NotBlank(message = "必填") + @Schema(description ="内容") + private String todayContent; + @NotBlank(message = "必填") + @Schema(description ="内容") + private String tomorrowContent; + @NotBlank(message = "必填") + @Schema(description ="用户id") + private String toUserId; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/worklog/WorkLogInfoVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/worklog/WorkLogInfoVO.java new file mode 100644 index 0000000..dfd8478 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/worklog/WorkLogInfoVO.java @@ -0,0 +1,23 @@ +package jnpf.model.worklog; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class WorkLogInfoVO { + @Schema(description ="主键") + private String id; + @Schema(description ="标题") + private String title; + @Schema(description ="内容") + private String question; + @Schema(description ="创建时间") + private long creatorTime; + @Schema(description ="内容") + private String todayContent; + @Schema(description ="内容") + private String tomorrowContent; + @Schema(description ="用户主键") + private String toUserId; + @Schema(description ="用户主键") + private String userIds; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/worklog/WorkLogListVO.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/worklog/WorkLogListVO.java new file mode 100644 index 0000000..e5493fb --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/worklog/WorkLogListVO.java @@ -0,0 +1,21 @@ +package jnpf.model.worklog; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class WorkLogListVO { + @Schema(description ="主键") + private String id; + @Schema(description ="标题") + private String title; + @Schema(description ="内容") + private String question; + @Schema(description ="创建时间") + private long creatorTime; + @Schema(description ="内容") + private String todayContent; + @Schema(description ="内容") + private String tomorrowContent; + @Schema(description ="用户主键") + private String toUserId; +} diff --git a/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/worklog/WorkLogUpForm.java b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/worklog/WorkLogUpForm.java new file mode 100644 index 0000000..cae87a4 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/jnpf-extend-entity/src/main/java/jnpf/model/worklog/WorkLogUpForm.java @@ -0,0 +1,8 @@ +package jnpf.model.worklog; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + + +@Data +public class WorkLogUpForm extends WorkLogCrForm { +} diff --git a/jnpf-java-boot/jnpf-extend/pom.xml b/jnpf-java-boot/jnpf-extend/pom.xml new file mode 100644 index 0000000..402df80 --- /dev/null +++ b/jnpf-java-boot/jnpf-extend/pom.xml @@ -0,0 +1,20 @@ + + + + jnpf-java-boot + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-extend + pom + + jnpf-extend-entity + jnpf-extend-biz + jnpf-extend-controller + + + diff --git a/jnpf-java-boot/jnpf-file/jnpf-file-biz/pom.xml b/jnpf-java-boot/jnpf-file/jnpf-file-biz/pom.xml new file mode 100644 index 0000000..3aeb165 --- /dev/null +++ b/jnpf-java-boot/jnpf-file/jnpf-file-biz/pom.xml @@ -0,0 +1,37 @@ + + + + jnpf-file + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-file-biz + + + + com.jnpf + jnpf-file-entity + ${project.version} + + + com.jnpf + jnpf-system-biz + ${project.version} + + + + org.aspectj + aspectjweaver + + + com.jnpf + jnpf-exception + ${project.version} + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/mapper/FileMapper.java b/jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/mapper/FileMapper.java new file mode 100644 index 0000000..6a16b59 --- /dev/null +++ b/jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/mapper/FileMapper.java @@ -0,0 +1,17 @@ +package jnpf.mapper; + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.entity.FileEntity; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/5/13 + */ +public interface FileMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/service/YozoService.java b/jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/service/YozoService.java new file mode 100644 index 0000000..9f7e615 --- /dev/null +++ b/jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/service/YozoService.java @@ -0,0 +1,85 @@ +package jnpf.service; + +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import jnpf.entity.FileEntity; +import jnpf.base.ActionResult; +import jnpf.base.vo.PaginationVO; + +import jnpf.model.YozoFileParams; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/5/13 + */ +@Service +public interface YozoService extends SuperService { + /** + * 生成文件预览url + * @param params + * @return + */ + String getPreviewUrl(YozoFileParams params); + + /** + * 新建文档保存versionId + * @param fileVersionId + * @param fileId + * @param fileName + * @return + */ + ActionResult saveFileId(String fileVersionId, String fileId, String fileName); + + /** + * 根据文件名查询 + * @param fileNa + * @return + */ + FileEntity selectByName(String fileNa); + + /** + * 上传文件到永中 + * @param fileVersionId + * @param fileId + * @param fileUrl + * @return + */ + ActionResult saveFileIdByHttp(String fileVersionId, String fileId, String fileUrl); + + /** + * 删除文件 + * @param versionId + * @return + */ + ActionResult deleteFileByVersionId(String versionId); + + /** + * 根据versionId查询文件 + * @param fileVersionId + * @return + */ + FileEntity selectByVersionId(String fileVersionId); + + /** + * 批量删除 + * @param versions + * @return + */ + ActionResult deleteBatch(String[] versions); + + /** + * 更新versionId + * @param oldFileId + * @param newFileId + */ + void editFileVersion(String oldFileId, String newFileId); + + List getAllList(PaginationVO pageModel); +} diff --git a/jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/service/impl/YozoServiceImpl.java b/jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/service/impl/YozoServiceImpl.java new file mode 100644 index 0000000..1986312 --- /dev/null +++ b/jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/service/impl/YozoServiceImpl.java @@ -0,0 +1,148 @@ +package jnpf.service.impl; + +import jnpf.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import jnpf.constant.MsgCode; +import jnpf.entity.FileEntity; +import jnpf.base.ActionResult; +import jnpf.base.vo.PaginationVO; +import jnpf.mapper.FileMapper; +import jnpf.model.YozoFileParams; +import jnpf.service.YozoService; +import jnpf.utils.SplicingUrlUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import java.util.List; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/5/13 + */ +@Service +public class YozoServiceImpl extends SuperServiceImpl implements YozoService { + + @Autowired + private FileMapper fileMapper; + + @Override + public String getPreviewUrl(YozoFileParams params) { + String previewUrl = SplicingUrlUtil.getPreviewUrl(params); + return previewUrl; + } + + @Override + public ActionResult saveFileId(String fileVersionId, String fileId, String fileName) { + FileEntity fileEntity =new FileEntity(); + fileEntity.setId(fileId); + fileEntity.setFileName(fileName); + fileEntity.setFileVersionId(fileVersionId); + fileEntity.setType("create"); + this.save(fileEntity); + + return ActionResult.success("新建文档成功"); + } + + @Override + public FileEntity selectByName(String fileNa) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().eq(FileEntity::getFileName,fileNa); + return this.getOne(wrapper); + } + + @Override + public ActionResult saveFileIdByHttp(String fileVersionId, String fileId, String fileUrl) { + String fileName = ""; + String url = ""; + String name = ""; + try { + url = URLDecoder.decode(fileUrl, "UTF-8"); + if (url.contains("/")) { + fileName = url.substring(url.lastIndexOf("/") + 1); + } else { + fileName = url.substring(url.lastIndexOf("\\") + 1); + } + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + //同一url文件数 + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("F_Url", url); + Long total = fileMapper.selectCount(wrapper); + if (total == 0) { + name = fileName; + } else { + String t = total.toString(); + name = fileName + "(" + t + ")"; + } + FileEntity fileEntity = new FileEntity(); + fileEntity.setType(url.contains("http") ? "http" : "local"); + fileEntity.setFileVersionId(fileVersionId); + fileEntity.setId(fileId); + fileEntity.setFileName(name); + fileEntity.setUrl(url); + fileMapper.insert(fileEntity); + return ActionResult.success("新建文档成功"); + } + + @Override + public ActionResult deleteFileByVersionId(String versionId) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("F_FileVersion", versionId); + int i = fileMapper.delete(wrapper); + if (i == 1) { + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail("删除失败"); + } + + @Override + public FileEntity selectByVersionId(String fileVersionId) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("F_FileVersion", fileVersionId); + FileEntity fileEntity = fileMapper.selectOne(wrapper); + return fileEntity; + } + + @Override + public ActionResult deleteBatch(String[] versions) { + for (String version : versions) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("F_FileVersion", version); + int i = fileMapper.delete(wrapper); + if (i == 0) { + return ActionResult.fail("删除文件:" + version + "失败"); + } + } + return ActionResult.success(MsgCode.SU003.get()); + + } + + @Override + public void editFileVersion(String oldFileId, String newFileId) { + UpdateWrapper wrapper = new UpdateWrapper<>(); + wrapper.eq("F_FileVersion", oldFileId); + FileEntity fileEntity = new FileEntity(); + fileEntity.setFileVersionId(newFileId); + fileEntity.setOldFileVersionId(oldFileId); + fileMapper.update(fileEntity, wrapper); + } + + @Override + public List getAllList(PaginationVO pageModel) { + Page page = new Page(pageModel.getCurrentPage(), pageModel.getPageSize()); + IPage iPage = fileMapper.selectPage(page, null); + return iPage.getRecords(); + } + +} diff --git a/jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/utils/YozoUtils.java b/jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/utils/YozoUtils.java new file mode 100644 index 0000000..edb2a13 --- /dev/null +++ b/jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/utils/YozoUtils.java @@ -0,0 +1,209 @@ +package jnpf.utils; + +import jnpf.yozo.client.AppAuthenticator; +import jnpf.yozo.client.UaaAppAuthenticator; +import jnpf.yozo.utils.DefaultResult; +import jnpf.yozo.utils.IResult; +import jnpf.model.YozoParams; +import jnpf.util.XSSEscape; +import jnpf.yozo.constants.EnumResultCode; +import jnpf.yozo.constants.UaaConstant; +import lombok.Cleanup; +import org.apache.http.HttpEntity; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.mime.HttpMultipartMode; +import org.apache.http.entity.mime.MultipartEntityBuilder; +import org.apache.http.entity.mime.content.FileBody; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.util.EntityUtils; +import org.springframework.stereotype.Component; +import org.springframework.util.StringUtils; + +import java.io.*; +import java.net.HttpURLConnection; +import java.net.URL; +import java.nio.charset.Charset; +import java.util.HashMap; +import java.util.Map; + +/** + * 文件预览编辑工具类 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/5/13 + */ +@Component +public class YozoUtils { + /** + * 生成签名 + * + * @param appId + * @param secret + * @param params + * @return + */ + public IResult generateSign(String appId, String secret, Map params) { + AppAuthenticator authenticator = new UaaAppAuthenticator(UaaConstant.SIGN, null, UaaConstant.APPID); + try { + String[] appIds = params.get(UaaConstant.APPID); + if (appIds == null || appIds.length != 1 || StringUtils.isEmpty(appIds[0])) { + params.put(UaaConstant.APPID, new String[]{appId}); + } + String sign = authenticator.generateSign(secret, params); + return DefaultResult.successResult(sign); + } catch (Exception e) { + return DefaultResult.failResult(EnumResultCode.E_GENERATE_SIGN_FAIL.getInfo()); + } + } + /** + * 获取文件名 + * @param fileName + * @param templateType + * @return + */ + public String getFileName(String fileName, String templateType) { + String suffix; + switch (templateType) { + case "1": + suffix = ".doc"; + break; + case "2": + suffix = ".docx"; + break; + case "3": + suffix = ".ppt"; + break; + case "4": + suffix = ".pptx"; + break; + case "5": + suffix = ".xls"; + break; + case "6": + suffix = ".xlsx"; + break; + default: + suffix = null; + } + if (suffix==null){ + return null; + } + String name = fileName + suffix; + return name; + } + + /** + * 使用httpclint 发送文件 + * @author: qingfeng + * @date: 2019-05-27 + * @param file + * 上传的文件 + */ + public String uploadFile(String url , File file, String appId, String sign) { + String result=""; + //构建HttpClient对象 + CloseableHttpResponse response = null; + //构建POST请求 + HttpPost httpPost = new HttpPost(url); + try { + @Cleanup CloseableHttpClient client = HttpClients.createDefault(); + //构建文件体 + String fileName = file.getName(); + FileBody fileBody = new FileBody(file, ContentType.MULTIPART_FORM_DATA, fileName); + HttpEntity httpEntity = MultipartEntityBuilder + .create() + .setMode(HttpMultipartMode.BROWSER_COMPATIBLE) + .addPart("file", fileBody) + .addTextBody("appId",appId) + .addTextBody("sign",sign) + .build(); + httpPost.setEntity(httpEntity); + // 执行http请求 + response = client.execute(httpPost); + result = EntityUtils.toString(response.getEntity(), "utf-8"); + } catch (IOException e) { + e.printStackTrace(); + } + return result; + } + + /** + * 下载文件到指定目录 + * @param fileUrl + * @param savePath + * @throws Exception + */ + public void downloadFile(String fileUrl,String savePath) throws Exception { + File file=new File(XSSEscape.escapePath(savePath)); + //判断文件是否存在,不存在则创建文件 + if(!file.exists()){ + file.createNewFile(); + } + URL url = new URL(fileUrl); + HttpURLConnection urlCon = (HttpURLConnection) url.openConnection(); + urlCon.setConnectTimeout(6000); + urlCon.setReadTimeout(6000); + int code = urlCon.getResponseCode(); + if (code != HttpURLConnection.HTTP_OK) { + throw new Exception("文件读取失败"); + } + @Cleanup DataInputStream in = new DataInputStream(urlCon.getInputStream()); + @Cleanup FileOutputStream fileOutputStream = new FileOutputStream(savePath); + @Cleanup DataOutputStream out = new DataOutputStream(fileOutputStream); + byte[] buffer = new byte[2048]; + int count = 0; + while ((count = in.read(buffer)) > 0) { + out.write(buffer, 0, count); + } + try { + out.close(); + in.close(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * 上传文件到永中 + * @param + * @return + */ + public String uploadFileInPreview(InputStream inputStream,String fileName) throws IOException { + //获取签名 + Map parameter = new HashMap(); + parameter.put("appId", new String[]{YozoParams.APP_ID}); + String sign = this.generateSign(YozoParams.APP_ID, YozoParams.APP_KEY, parameter).getData(); + String url= "http://dmc.yozocloud.cn/api/file/upload?appId="+YozoParams.APP_ID+"&sign="+sign; + + @Cleanup CloseableHttpClient httpClient = HttpClients.createDefault(); + String result =""; + HttpEntity httpEntity =null; + HttpEntity responseEntity = null; + + try { + HttpPost httpPost = new HttpPost(url); + MultipartEntityBuilder multipartEntityBuilder = MultipartEntityBuilder.create(); + multipartEntityBuilder.setCharset(Charset.forName("utf-8")); + multipartEntityBuilder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);//加上此行代码解决返回中文乱码问题 + multipartEntityBuilder.addBinaryBody("file", inputStream, ContentType.MULTIPART_FORM_DATA, fileName); + + httpEntity = multipartEntityBuilder.build(); + httpPost.setEntity(httpEntity); + CloseableHttpResponse response = httpClient.execute(httpPost); + responseEntity = response.getEntity(); + result = EntityUtils.toString(responseEntity,Charset.forName("UTF-8")); + } catch (Exception e) { + e.printStackTrace(); + }finally { + if (inputStream!=null){ + inputStream.close(); + } + } + return result; + } +} diff --git a/jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/yozo/client/AppAuthenticator.java b/jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/yozo/client/AppAuthenticator.java new file mode 100644 index 0000000..0d80da0 --- /dev/null +++ b/jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/yozo/client/AppAuthenticator.java @@ -0,0 +1,7 @@ +package jnpf.yozo.client; + +import java.util.Map; + +public interface AppAuthenticator { + String generateSign(String var1, Map var2) throws Exception; +} diff --git a/jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/yozo/client/UaaAppAuthenticator.java b/jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/yozo/client/UaaAppAuthenticator.java new file mode 100644 index 0000000..2c87381 --- /dev/null +++ b/jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/yozo/client/UaaAppAuthenticator.java @@ -0,0 +1,98 @@ +package jnpf.yozo.client; + +import jnpf.yozo.utils.SecretSignatureUtils; +import jnpf.util.StringUtil; + +import java.util.Arrays; +import java.util.Iterator; +import java.util.Map; + +public class UaaAppAuthenticator implements AppAuthenticator { + public static final String OPEN_PARAM_PREFIX = "y_"; + public static final String OPEN_PARAM_APPID = "y_appid"; + public static final String OPEN_PARAM_SIGN = "y_SIGN"; + private String signParamName; + private String paramNamePrefix; + private String appidParamName; + + public UaaAppAuthenticator() { + } + + public UaaAppAuthenticator(String signParamName, String paramNamePrefix, String appidParamName) { + this.signParamName = signParamName; + this.paramNamePrefix = paramNamePrefix; + this.appidParamName = appidParamName; + } + + public String getSignParamName() { + return this.signParamName; + } + + public void setSignParamName(String signParamName) { + this.signParamName = signParamName; + } + + public String getParamNamePrefix() { + return this.paramNamePrefix; + } + + public void setParamNamePrefix(String paramNamePrefix) { + this.paramNamePrefix = paramNamePrefix; + } + + public String getAppidParamName() { + return this.appidParamName; + } + + public void setAppidParamName(String appidParamName) { + this.appidParamName = appidParamName; + } + + public String generateSign(String secret, Map params) throws Exception { + String fullParamStr = this.uniqSortParams(params); + return SecretSignatureUtils.hmacSHA256(fullParamStr, secret); + } + + private String uniqSortParams(Map params) { + boolean prefix = StringUtil.isNotEmpty(this.paramNamePrefix); + params.remove(this.signParamName); + String[] paramKeys = new String[params.keySet().size()]; + int idx = 0; + Iterator var5 = params.keySet().iterator(); + + while(true) { + String param; + do { + if (!var5.hasNext()) { + Arrays.sort(paramKeys, 0, idx); + StringBuilder builder = new StringBuilder(); + String[] var16 = paramKeys; + int var7 = paramKeys.length; + + for(int var8 = 0; var8 < var7; ++var8) { + String key = var16[var8]; + String[] values = (String[])((String[])params.get(key)); + if (values != null && values.length > 0) { + Arrays.sort(values); + String[] var11 = values; + int var12 = values.length; + + for(int var13 = 0; var13 < var12; ++var13) { + String val = var11[var13]; + builder.append(key).append("=").append(val); + } + } else { + builder.append(key).append("="); + } + } + + return builder.toString(); + } + + param = (String)var5.next(); + } while(prefix && param.startsWith(this.paramNamePrefix)); + + paramKeys[idx++] = param; + } + } +} diff --git a/jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/yozo/client/UaaAppConfigClient.java b/jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/yozo/client/UaaAppConfigClient.java new file mode 100644 index 0000000..1cfc4a7 --- /dev/null +++ b/jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/yozo/client/UaaAppConfigClient.java @@ -0,0 +1,28 @@ +package jnpf.yozo.client; + +import jnpf.yozo.utils.DefaultResult; +import jnpf.yozo.utils.IResult; +import jnpf.yozo.constants.EnumResultCode; + +import java.util.Map; + +public class UaaAppConfigClient { + public UaaAppConfigClient() { + } + + public IResult generateSign(String appId, String secret, Map params) { + UaaAppAuthenticator authenticator = new UaaAppAuthenticator("sign", (String)null, "appId"); + + try { + String[] appIds = (String[])params.get("appId"); + if (appIds == null || appIds.length != 1 || appIds[0] == null || "".equals(appIds[0])) { + params.put("appId", new String[]{appId}); + } + + String sign = authenticator.generateSign(secret, params); + return DefaultResult.successResult(sign); + } catch (Exception var7) { + return DefaultResult.failResult(EnumResultCode.E_GENERATE_SIGN_FAIL.getInfo()); + } + } +} diff --git a/jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/yozo/constants/EnumResultCode.java b/jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/yozo/constants/EnumResultCode.java new file mode 100644 index 0000000..11c8699 --- /dev/null +++ b/jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/yozo/constants/EnumResultCode.java @@ -0,0 +1,36 @@ +package jnpf.yozo.constants; + +public enum EnumResultCode { + E_SUCCESS(0, "操作成功"), + E_GENERATE_SIGN_FAIL(1000, "获取签名失败"); + + private Integer value; + private String info; + + private EnumResultCode(Integer value, String info) { + this.value = value; + this.info = info; + } + + public Integer getValue() { + return this.value; + } + + public String getInfo() { + return this.info; + } + + public static EnumResultCode getEnum(Integer value) { + EnumResultCode[] var1 = values(); + int var2 = var1.length; + + for(int var3 = 0; var3 < var2; ++var3) { + EnumResultCode code = var1[var3]; + if (code.getValue().equals(value)) { + return code; + } + } + + return null; + } +} diff --git a/jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/yozo/constants/UaaConstant.java b/jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/yozo/constants/UaaConstant.java new file mode 100644 index 0000000..8334511 --- /dev/null +++ b/jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/yozo/constants/UaaConstant.java @@ -0,0 +1,9 @@ +package jnpf.yozo.constants; + +public class UaaConstant { + public static final String APPID = "appId"; + public static final String SIGN = "sign"; + + public UaaConstant() { + } +} diff --git a/jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/yozo/utils/DefaultResult.java b/jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/yozo/utils/DefaultResult.java new file mode 100644 index 0000000..f103d49 --- /dev/null +++ b/jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/yozo/utils/DefaultResult.java @@ -0,0 +1,86 @@ +package jnpf.yozo.utils; + +public class DefaultResult implements IResult { + private static final DefaultResult.SuccessResult SUCCESS = new DefaultResult.SuccessResult(); + private static final DefaultResult.FailResult FAIL = new DefaultResult.FailResult(); + private boolean success; + private String message; + private T data; + + public DefaultResult() { + } + + public DefaultResult(boolean success, String message) { + this(success, message, (T) null); + } + + public DefaultResult(boolean success, T data) { + this(success, (String)null, data); + } + + public DefaultResult(boolean success, String message, T data) { + this.success = success; + this.message = message; + this.data = data; + } + + public static DefaultResult successResult() { + return (DefaultResult) SUCCESS; + } + + public static DefaultResult successResult(T data) { + return new DefaultResult(true, (String)null, data); + } + + public static DefaultResult successResult(String message, T data) { + return new DefaultResult(true, message, data); + } + + public static DefaultResult failResult() { + return (DefaultResult) FAIL; + } + + public static DefaultResult failResult(String message) { + return new DefaultResult(false, message, (Object)null); + } + + public static DefaultResult failResult(String message, T data) { + return new DefaultResult(false, message, data); + } + + public static DefaultResult failResult(T data) { + return new DefaultResult(false, (String)null, data); + } + + public static DefaultResult result(boolean success, String message, T data) { + return new DefaultResult(success, message, data); + } + + public boolean isSuccess() { + return this.success; + } + + public String getMessage() { + return this.message; + } + + public T getData() { + return this.data; + } + + public void setData(T obj) { + this.data = obj; + } + + private static class FailResult extends DefaultResult { + public FailResult() { + super(false, (String)null, (Object)null); + } + } + + private static class SuccessResult extends DefaultResult { + public SuccessResult() { + super(true, (String)null, (Object)null); + } + } +} diff --git a/jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/yozo/utils/HttpRequestUtils.java b/jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/yozo/utils/HttpRequestUtils.java new file mode 100644 index 0000000..2b29853 --- /dev/null +++ b/jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/yozo/utils/HttpRequestUtils.java @@ -0,0 +1,25 @@ +package jnpf.yozo.utils; + +public class HttpRequestUtils { + public HttpRequestUtils() { + } + + public static class StringUtils { + public StringUtils() { + } + + public static boolean isNotEmpty(String data) { + return data != null && data.trim().length() > 0; + } + + public static boolean equals(String cs1, String cs2) { + if (cs1 == cs2) { + return true; + } else if (cs1 != null && cs2 != null) { + return cs1.length() != cs2.length() ? false : cs1.equals(cs2); + } else { + return false; + } + } + } +} diff --git a/jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/yozo/utils/IResult.java b/jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/yozo/utils/IResult.java new file mode 100644 index 0000000..a60b68e --- /dev/null +++ b/jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/yozo/utils/IResult.java @@ -0,0 +1,11 @@ +package jnpf.yozo.utils; + +public interface IResult { + boolean isSuccess(); + + String getMessage(); + + T getData(); + + void setData(T var1); +} diff --git a/jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/yozo/utils/SecretSignatureUtils.java b/jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/yozo/utils/SecretSignatureUtils.java new file mode 100644 index 0000000..66e5cdc --- /dev/null +++ b/jnpf-java-boot/jnpf-file/jnpf-file-biz/src/main/java/jnpf/yozo/utils/SecretSignatureUtils.java @@ -0,0 +1,28 @@ +package jnpf.yozo.utils; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; + +public class SecretSignatureUtils { + public static final String SHA256 = "HmacSHA256"; + + public SecretSignatureUtils() { + } + + public static String hmacSHA256(String data, String key) throws Exception { + Mac mac = Mac.getInstance("HmacSHA256"); + SecretKeySpec secret_key = new SecretKeySpec(key.getBytes("UTF-8"), "HmacSHA256"); + mac.init(secret_key); + byte[] array = mac.doFinal(data.getBytes("UTF-8")); + StringBuilder sb = new StringBuilder(); + byte[] var6 = array; + int var7 = array.length; + + for(int var8 = 0; var8 < var7; ++var8) { + byte item = var6[var8]; + sb.append(Integer.toHexString(item & 255 | 256).substring(1, 3)); + } + + return sb.toString().toUpperCase(); + } +} diff --git a/jnpf-java-boot/jnpf-file/jnpf-file-controller/pom.xml b/jnpf-java-boot/jnpf-file/jnpf-file-controller/pom.xml new file mode 100644 index 0000000..a2fde46 --- /dev/null +++ b/jnpf-java-boot/jnpf-file/jnpf-file-controller/pom.xml @@ -0,0 +1,22 @@ + + + + jnpf-file + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-file-controller + + + + com.jnpf + jnpf-file-biz + ${project.version} + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-file/jnpf-file-controller/src/main/java/jnpf/controller/UtilsController.java b/jnpf-java-boot/jnpf-file/jnpf-file-controller/src/main/java/jnpf/controller/UtilsController.java new file mode 100644 index 0000000..306968c --- /dev/null +++ b/jnpf-java-boot/jnpf-file/jnpf-file-controller/src/main/java/jnpf/controller/UtilsController.java @@ -0,0 +1,741 @@ +package jnpf.controller; + +import cn.xuyanwu.spring.file.storage.FileInfo; +import com.alibaba.fastjson.JSONObject; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.entity.FileDetail; +import jnpf.util.NoDataSourceBind; +import jnpf.base.UserInfo; +import jnpf.base.entity.DictionaryDataEntity; +import jnpf.base.service.DictionaryDataService; +import jnpf.base.util.OptimizeUtil; +import jnpf.base.vo.DownloadVO; +import jnpf.base.vo.ListVO; +import jnpf.config.ConfigValueUtil; +import jnpf.constant.FileTypeConstant; +import java.util.ArrayList; +import jnpf.constant.MsgCode; +import jnpf.consts.DeviceType; +import jnpf.exception.DataException; +import jnpf.model.*; +import jnpf.util.*; +import jnpf.utils.YozoUtils; +import lombok.Cleanup; +import org.apache.commons.codec.binary.Base64; +import org.apache.commons.io.FileUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.*; +import java.nio.channels.Channels; +import java.nio.channels.FileChannel; +import java.nio.channels.WritableByteChannel; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 通用控制器 + * + * @author JNPF开发平台组 + * @version V1.2.191207 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +@Tag(name = "公共", description = "file") +@RestController +@RequestMapping("/api/file") +public class UtilsController { + + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private RedisUtil redisUtil; + @Autowired + private UserProvider userProvider; + @Autowired + private DictionaryDataService dictionaryDataService; + @Autowired + private YozoUtils yozoUtils; + + /** + * 语言列表 + * + * @return + */ + @Operation(summary = "语言列表") + @GetMapping("/Language") + public ActionResult> getList() { + String dictionaryTypeId = "dc6b2542d94b407cac61ec1d59592901"; + List list = dictionaryDataService.getList(dictionaryTypeId); + List language = JsonUtil.getJsonToList(list, LanguageVO.class); + ListVO vo = new ListVO(); + vo.setList(language); + return ActionResult.success(vo); + } + + /** + * 图形验证码 + * + * @return + */ + @NoDataSourceBind() + @Operation(summary = "图形验证码") + @GetMapping("/ImageCode/{timestamp}") + @Parameters({ + @Parameter(name = "timestamp", description = "时间戳",required = true), + }) + public void imageCode(@PathVariable("timestamp") String timestamp) { + DownUtil.downCode(null); + redisUtil.insert(timestamp, ServletUtil.getSession().getAttribute(CodeUtil.RANDOMCODEKEY), 120); + } + + /** + * 获取全部下载文件链接(打包下载) + * + * @return + */ + @NoDataSourceBind + @Operation(summary = "获取全部下载文件链接(打包下载)") + @PostMapping("/PackDownload/{type}") + public ActionResult packDownloadUrl(@PathVariable("type") String type, @RequestBody List> fileInfoList) throws Exception { + type = XSSEscape.escape(type); + if(fileInfoList == null || fileInfoList.isEmpty()) { + return ActionResult.fail("未发现文件"); + } + List filePathList = new ArrayList(); + + String zipTempFilePath = null; + String zipFileId = RandomUtil.uuId() + ".zip"; + for(Map fileInfoMap : fileInfoList) { + String fileId = XSSEscape.escape((String)fileInfoMap.get("fileId")).trim(); + String fileName = XSSEscape.escape((String)fileInfoMap.get("fileName")).trim(); + if(StringUtil.isEmpty(fileId) || StringUtil.isEmpty(fileName)) { + continue; + } + if(FileUploadUtils.exists(type, fileId)) { + String typePath = FilePathUtil.getFilePath(type); + if(fileId.indexOf(",") >= 0) { + typePath += fileId.substring(0, fileId.lastIndexOf(",")+1).replaceAll(",", "/"); + fileId = fileId.substring(fileId.lastIndexOf(",")+1); + } + byte[] bytes = FileUploadUtils.downloadFileByte(typePath, fileId, false); + if(zipTempFilePath == null) { + zipTempFilePath = FileUploadUtils.getLocalBasePath() + FilePathUtil.getFilePath(FileTypeConstant.FILEZIPDOWNTEMPPATH); + if(!new File(zipTempFilePath).exists()) { + new File(zipTempFilePath).mkdirs(); + } + zipTempFilePath += zipFileId; + } + ZipUtil.fileAddToZip(zipTempFilePath, new ByteArrayInputStream(bytes), fileName); + } + } + if(zipTempFilePath == null) { + return ActionResult.fail("文件不存在"); + } + //将文件上传到默认文件服务器 + String newFileId = zipFileId; + if(!"local".equals(FileUploadUtils.getDefaultPlatform())) { //不是本地,说明是其他文件服务器,将zip文件上传到其他服务器里,方便下载 + FileInfo fileInfo = FileUploadUtils.uploadFile(new File(zipTempFilePath), FilePathUtil.getFilePath(FileTypeConstant.FILEZIPDOWNTEMPPATH), zipFileId); + new File(zipTempFilePath).delete(); + newFileId = fileInfo.getFilename(); + } + jnpf.base.vo.DownloadVO vo = DownloadVO.builder().name(zipFileId).url(UploaderUtil.uploaderFile(newFileId + "#" + FileTypeConstant.FILEZIPDOWNTEMPPATH)).build(); + Map map = new HashMap(); + map.put("downloadVo", vo); + map.put("downloadName", "文件" + zipFileId); + return ActionResult.success(map); + } + + /** + * 上传文件/图片 + * + * @return + */ + @NoDataSourceBind() + @Operation(summary = "上传文件/图片") + @PostMapping(value = "/Uploader/{type}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + @Parameters({ + @Parameter(name = "type", description = "类型",required = true) + }) + public ActionResult uploader(@PathVariable("type") String type, MultipartFile file, HttpServletRequest httpServletRequest) throws IOException { + String fileType = UpUtil.getFileType(file); + //验证类型 + if (!OptimizeUtil.fileType(configValueUtil.getAllowUploadFileType(), fileType)) { + return ActionResult.fail(MsgCode.FA017.get()); + } + PathTypeModel pathTypeModel = new PathTypeModel(); + pathTypeModel.setPathType(httpServletRequest.getParameter("pathType")); + pathTypeModel.setIsAccount(httpServletRequest.getParameter("isAccount")); + pathTypeModel.setFolder(httpServletRequest.getParameter("folder")); + UploaderVO vo = uploaderVO(file, type,pathTypeModel); + return ActionResult.success(vo); + } + + /** + * 获取下载文件链接 + * + * @return + */ + @NoDataSourceBind() + @Operation(summary = "获取下载文件链接") + @GetMapping("/Download/{type}/{fileName}") + @Parameters({ + @Parameter(name = "type", description = "类型",required = true), + @Parameter(name = "fileName", description = "文件名称",required = true), + }) + public ActionResult downloadUrl(@PathVariable("type") String type, @PathVariable("fileName") String fileName) { + type = XSSEscape.escape(type); + fileName = XSSEscape.escape(fileName); + boolean exists = FileUploadUtils.exists(type, fileName); + if (exists) { + DownloadVO vo = DownloadVO.builder().name(fileName).url(UploaderUtil.uploaderFile(fileName + "#" + type)).build(); + return ActionResult.success(vo); + } + return ActionResult.fail(MsgCode.FA018.get()); + } + + /** + * 下载文件链接 + * + * @return + */ + @NoDataSourceBind() + @Operation(summary = "下载文件链接") + @GetMapping("/Download") + public void downloadFile() throws DataException { + HttpServletRequest request = ServletUtil.getRequest(); + String reqJson = request.getParameter("encryption"); + String name = request.getParameter("name"); + String fileNameAll = DesUtil.aesDecode(reqJson); + if (!StringUtil.isEmpty(fileNameAll)) { + fileNameAll = fileNameAll.replaceAll("\n", ""); + String[] data = fileNameAll.split("#"); + String cacheKEY = data.length > 0 ? data[0] : ""; + String fileName = data.length > 1 ? data[1] : ""; + String type = data.length > 2 ? data[2] : ""; + Object ticketObj = TicketUtil.parseTicket(cacheKEY); + //验证缓存 + if (ticketObj != null) { + //某些手机浏览器下载后会有提示窗口, 会访问两次下载地址 + if(UserProvider.getDeviceForAgent().equals(DeviceType.APP) && "".equals(ticketObj)){ + TicketUtil.updateTicket(cacheKEY, "1", 30L); + }else{ + TicketUtil.deleteTicket(cacheKEY); + } + //下载文件 + String typePath =FilePathUtil.getFilePath(type.toLowerCase()); + if(fileName.indexOf(",") >= 0) { + typePath += fileName.substring(0, fileName.lastIndexOf(",")+1).replaceAll(",", "/"); + fileName = fileName.substring(fileName.lastIndexOf(",")+1); + } +// String filePath = FilePathUtil.getFilePath(type.toLowerCase()); + byte[] bytes = FileUploadUtils.downloadFileByte(typePath, fileName, false); + FileDownloadUtil.downloadFile(bytes, fileName, name); + if(FileTypeConstant.FILEZIPDOWNTEMPPATH.equals(type)) { //删除打包的临时文件,释放存储 + FileUploadUtils.deleteFileByPathAndFileName(typePath, fileName); + } + } else { + if(FileTypeConstant.FILEZIPDOWNTEMPPATH.equals(type)) { //删除打包的临时文件,释放存储 + String typePath = FilePathUtil.getFilePath(type); + FileUploadUtils.deleteFileByPathAndFileName(typePath, fileName); + } + throw new DataException("链接已失效"); + } + } else { + throw new DataException("链接已失效"); + } + } + + /** + * 下载文件链接 + * + * @return + */ + @NoDataSourceBind() + @Operation(summary = "下载模板文件链接") + @GetMapping("/DownloadModel") + public void downloadModel() throws DataException { + HttpServletRequest request = ServletUtil.getRequest(); + String reqJson = request.getParameter("encryption"); + String fileNameAll = DesUtil.aesDecode(reqJson); + if (!StringUtil.isEmpty(fileNameAll)) { + String token = fileNameAll.split("#")[0]; + if (TicketUtil.parseTicket(token) != null) { + TicketUtil.deleteTicket(token); + String fileName = fileNameAll.split("#")[1]; + String filePath = configValueUtil.getTemplateFilePath(); + // 下载文件 + byte[] bytes = FileUploadUtils.downloadFileByte(filePath, fileName, true); + FileDownloadUtil.downloadFile(bytes, fileName, null); + } else { + throw new DataException("链接已失效"); + } + } else { + throw new DataException("链接已失效"); + } + } + + + /** + * 获取图片 + * + * @param fileName + * @param type + * @return + */ + @NoDataSourceBind() + @Operation(summary = "获取图片") + @GetMapping("/Image/{type}/{fileName}") + @Parameters({ + @Parameter(name = "type", description = "类型",required = true), + @Parameter(name = "fileName", description = "名称",required = true), + }) + public void downLoadImg(@PathVariable("type") String type, @PathVariable("fileName") String fileName) { + String filePath = FilePathUtil.getFilePath(type.toLowerCase()); + if(fileName.indexOf(",") >= 0) { + filePath += fileName.substring(0, fileName.lastIndexOf(",")+1).replaceAll(",", "/"); + fileName = fileName.substring(fileName.lastIndexOf(",")+1); + } +// if ("im".equalsIgnoreCase(type)) { +// type = "imfile"; +// } +// else if (FileTypeEnum.ANNEXPIC.equalsIgnoreCase(type)) { +// type = FileTypeEnum.ANNEX; +// } + // 下载文件 + byte[] bytes = FileUploadUtils.downloadFileByte(filePath, fileName, false); + FileDownloadUtil.flushImage(bytes, fileName); + } + + /** + * 获取IM聊天图片 + * 注意 后缀名前端故意把 .替换@ + * + * @param fileName + * @return + */ + @NoDataSourceBind() + @Operation(summary = "获取IM聊天图片") + @GetMapping("/IMImage/{fileName}") + @Parameters({ + @Parameter(name = "fileName", description = "名称",required = true), + }) + public void imImage(@PathVariable("fileName") String fileName) { + byte[] bytes = FileUploadUtils.downloadFileByte(configValueUtil.getImContentFilePath(), fileName, false); + FileDownloadUtil.flushImage(bytes, fileName); + } + + /** + * 查看图片 + * + * @param type 哪个文件夹 + * @param fileName 文件名称 + * @return + */ + @NoDataSourceBind() + @Operation(summary = "查看图片") + @GetMapping("/{type}/{fileName}") + @Parameters({ + @Parameter(name = "fileName", description = "名称",required = true), + @Parameter(name = "type", description = "类型",required = true), + }) + public void img(@PathVariable("type") String type, @PathVariable("fileName") String fileName) { +// String filePath = configValueUtil.getBiVisualPath() + type + File.separator; +// if (StorageType.MINIO.equals(configValueUtil.getFileType())) { +// fileName = "/" + type + "/" + fileName; +// filePath = configValueUtil.getBiVisualPath().substring(0, configValueUtil.getBiVisualPath().length() - 1); +// } + String filePath = FilePathUtil.getFilePath(type.toLowerCase()); + if(fileName.indexOf(",") >= 0) { + filePath += fileName.substring(0, fileName.lastIndexOf(",")+1).replaceAll(",", "/"); + fileName = fileName.substring(fileName.lastIndexOf(",")+1); + } + //下载文件 + byte[] bytes = FileUploadUtils.downloadFileByte(filePath, fileName, false); + FileDownloadUtil.flushImage(bytes, fileName); + } + + /** + * 获取IM聊天语音 + * 注意 后缀名前端故意把 .替换@ + * + * @param fileName + * @return + */ + @NoDataSourceBind() + @Operation(summary = "获取IM聊天语音") + @GetMapping("/IMVoice/{fileName}") + @Parameters({ + @Parameter(name = "fileName", description = "名称",required = true), + }) + public void imVoice(@PathVariable("fileName") String fileName) { + fileName = fileName.replaceAll("@", "."); + byte[] bytes = FileUploadUtils.downloadFileByte(configValueUtil.getImContentFilePath(), fileName, false); + FileDownloadUtil.flushImage(bytes, fileName); + } + + /** + * app启动获取信息 + * + * @param appName + * @return + */ + @NoDataSourceBind() + @Operation(summary = "app启动获取信息") + @GetMapping("/AppStartInfo/{appName}") + @Parameters({ + @Parameter(name = "appName", description = "名称",required = true), + }) + public ActionResult getAppStartInfo(@PathVariable("appName") String appName) { + appName = XSSEscape.escape(appName); + JSONObject object = new JSONObject(); + object.put("AppVersion", configValueUtil.getAppVersion()); + object.put("AppUpdateContent", configValueUtil.getAppUpdateContent()); + return ActionResult.success(object); + } + + //----------大屏图片下载--------- + @NoDataSourceBind() + @Operation(summary = "获取图片") + @GetMapping("/VisusalImg/{bivisualpath}/{type}/{fileName}") + @Parameters({ + @Parameter(name = "type", description = "类型",required = true), + @Parameter(name = "bivisualpath", description = "路径",required = true), + @Parameter(name = "fileName", description = "名称",required = true), + }) + public void downVisusalImg(@PathVariable("type") String type,@PathVariable("bivisualpath") String bivisualpath, @PathVariable("fileName") String fileName) { + fileName = XSSEscape.escape(fileName); + String filePath = configValueUtil.getBiVisualPath(); + byte[] bytes = FileUploadUtils.downloadFileByte(filePath + type + "/", fileName, false); + FileDownloadUtil.flushImage(bytes, fileName); + } + + //---------------------- + + @NoDataSourceBind() + @Operation(summary = "预览文件") + @GetMapping("/Uploader/Preview") + public ActionResult Preview(PreviewParams previewParams) { + //读取允许文件预览类型 + String allowPreviewType = configValueUtil.getAllowPreviewFileType(); + String[] fileType = allowPreviewType.split(","); + + String fileName = XSSEscape.escape(previewParams.getFileName()); + + //文件预览类型检验 + String docType = fileName.substring(fileName.lastIndexOf(".") + 1); + String s = Arrays.asList(fileType).stream().filter(type -> type.equals(docType)).findFirst().orElse(null); + + if (StringUtil.isEmpty(s)) { + return ActionResult.fail("预览失败,请检查文件类型是否规范"); + } + + //解析文件url 获取类型 + String type = configValueUtil.getWebAnnexFilePath(); + + String fileNameAll = previewParams.getFileDownloadUrl(); + if (!StringUtil.isEmpty(fileNameAll)) { + String[] data = fileNameAll.split("/"); + type = data.length > 4 ? data[4] : ""; + } + + String url; + //文件预览策略 + if ("yozo".equals(configValueUtil.getPreviewType())) { + if (StringUtil.isEmpty(previewParams.getFileVersionId())) { + return ActionResult.fail("预览失败,请重新上传文件"); + } + + String fileVersionId = XSSEscape.escape(previewParams.getFileVersionId()); + + //获取签名 + Map parameter = new HashMap(); + parameter.put("appId", new String[]{YozoParams.APP_ID}); + parameter.put("fileVersionId", new String[]{fileVersionId}); + String sign = yozoUtils.generateSign(YozoParams.APP_ID, YozoParams.APP_KEY, parameter).getData(); + url = "http://eic.yozocloud.cn/api/view/file?fileVersionId=" + + fileVersionId + + "&appId=" + + YozoParams.APP_ID + + "&sign=" + + sign; + } else { + if (FileUploadUtils.getDefaultPlatform().startsWith("local-plus")) { + url = YozoParams.JNPF_DOMAINS + "/api/file/filedownload/" + type + "/" + previewParams.getFileName(); + } else { + //图像格式 + if ("pdf,jpg,gif,png,bmp,jpeg".contains(docType)){ + url = YozoParams.JNPF_DOMAINS + "/api/file/filedownload/" + type; + } else { + String[] split = fileNameAll.split("/"); + if (split.length > 5) { + type = FilePathUtil.getFilePath(type) + split[5].replaceAll(",", "/"); + } + FileDetail fileDetail = FileUploadUtils.getFileDetail(type, fileName, false); + url = FileUploadUtils.getDomain() + FileUploadUtils.getBucketName() + fileDetail.getPath(); + } + } + //encode编码 + String fileUrl = Base64.encodeBase64String(url.getBytes()); + url = configValueUtil.getKkFileUrl() + "onlinePreview?url=" + fileUrl; + } + return ActionResult.success(MsgCode.SU000.get(), url); + } + + @NoDataSourceBind() + @Operation(summary = "kk本地文件预览") + @GetMapping("/filedownload/{type}/{fileName}") + public void filedownload(@PathVariable("type") String type, @PathVariable("fileName") String fileName, HttpServletResponse response) { + String typePath =FilePathUtil.getFilePath(type); + if(fileName.indexOf(",") >= 0) { + typePath += fileName.substring(0, fileName.lastIndexOf(",")+1).replaceAll(",", "/"); + fileName = fileName.substring(fileName.lastIndexOf(",")+1); + } + String tmpPath = typePath + fileName; + boolean b = FileUtil.fileIsFile(tmpPath); + if (!b){ + FileUploadUtils.downLocal(FilePathUtil.getFilePath(type), FileUploadUtils.getLocalBasePath() + typePath,fileName); + } + String filePath = FileUploadUtils.getLocalBasePath() + typePath + fileName; + OutputStream os = null; + //本地取对应文件 + File file = new File(filePath); + try { + os = response.getOutputStream(); + String contentType = Files.probeContentType(Paths.get(file.getAbsolutePath())); + response.setHeader("Content-Type", contentType); + response.setHeader("Content-Dispostion", "attachment;filename=" + new String(file.getName().getBytes("utf-8"), "ISO8859-1")); + @Cleanup FileInputStream fileInputStream = new FileInputStream(file); + + @Cleanup WritableByteChannel writableByteChannel = Channels.newChannel(os); + + @Cleanup FileChannel channel = fileInputStream.getChannel(); + channel.transferTo(0, channel.size(), writableByteChannel); + channel.close(); + os.flush(); + writableByteChannel.close(); + } catch (IOException e) { + e.printStackTrace(); + } finally { + try { + if (os != null) { + os.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + @Operation(summary = "分片上传获取") + @GetMapping("/chunk") + public ActionResult checkChunk(Chunk chunk) { + String type = chunk.getExtension(); + if (!OptimizeUtil.fileType(configValueUtil.getAllowUploadFileType(), type)) { + return ActionResult.fail("上传失败,文件格式不允许上传"); + } + String identifier = chunk.getIdentifier(); + String path = configValueUtil.getTemporaryFilePath(); + String filePath = XSSEscape.escapePath(path + identifier); + List chunkFiles = FileUtil.getFile(new File(FileUploadUtils.getLocalBasePath() + filePath)); + List existsChunk = chunkFiles.stream().filter(f->{ + if(f.getName().endsWith(".tmp")){ + FileUtils.deleteQuietly(f); + return false; + }else{ + return true; + } + }).map(f->Integer.parseInt(f.getName().replace(chunk.getIdentifier().concat("-"), ""))).collect(Collectors.toList()); + ChunkRes chunkRes = ChunkRes.builder().merge(chunk.getTotalChunks().equals(existsChunk.size())).chunkNumbers(existsChunk).build(); + return ActionResult.success(chunkRes); + } + + + @Operation(summary = "分片上传附件") + @PostMapping("/chunk") + public ActionResult upload(Chunk chunk, @RequestParam("file") MultipartFile file) { + String type = chunk.getExtension(); + if (!OptimizeUtil.fileType(configValueUtil.getAllowUploadFileType(), type)) { + return ActionResult.fail("上传失败,文件格式不允许上传"); + } + ChunkRes chunkRes = ChunkRes.builder().build(); + chunkRes.setMerge(false); + File chunkFile = null; + File chunkTmpFile = null; + try { + String filePath = FileUploadUtils.getLocalBasePath() + configValueUtil.getTemporaryFilePath(); + Integer chunkNumber = chunk.getChunkNumber(); + String identifier = chunk.getIdentifier(); + String chunkTempPath = filePath + identifier; + File path = new File(chunkTempPath); + if (!path.exists()) { + path.mkdirs(); + } + String chunkName = identifier.concat("-") + chunkNumber; + String chunkTmpName = chunkName.concat(".tmp"); + chunkFile = new File(chunkTempPath, chunkName); + chunkTmpFile = new File(chunkTempPath, chunkTmpName); + if (chunkFile.exists() && chunkFile.length() == chunk.getCurrentChunkSize()) { + System.out.println("该分块已经上传:" + chunkFile.getName()); + } else { + @Cleanup InputStream inputStream = file.getInputStream(); + FileUtils.copyInputStreamToFile(inputStream, chunkTmpFile); + chunkTmpFile.renameTo(chunkFile); + } + chunkRes.setMerge(chunk.getChunkNumber().equals(chunk.getTotalChunks())); + } catch (Exception e) { + try{ + FileUtils.deleteQuietly(chunkTmpFile); + FileUtils.deleteQuietly(chunkFile); + }catch (Exception ee){ + e.printStackTrace(); + } + System.out.println("上传异常:" + e); + return ActionResult.fail("上传异常"); + } + return ActionResult.success(chunkRes); + } + + @Operation(summary = "分片组装") + @PostMapping("/merge") + public ActionResult merge(MergeChunkDto mergeChunkDto) { + String identifier = mergeChunkDto.getIdentifier(); + String path = FileUploadUtils.getLocalBasePath() + configValueUtil.getTemporaryFilePath(); + String filePath = XSSEscape.escapePath(path + identifier); + String uuid = RandomUtil.uuId(); + String partFile = XSSEscape.escapePath(path + uuid + "." + mergeChunkDto.getExtension()); + UploaderVO vo = UploaderVO.builder().build(); + try { + List mergeFileList = FileUtil.getFile(new File(filePath)); + @Cleanup FileOutputStream destTempfos = new FileOutputStream(partFile, true); + for (int i = 0; i < mergeFileList.size(); i++) { + String chunkName = identifier.concat("-") + (i + 1); + File files = new File(filePath, chunkName); + if (files.exists()) { + FileUtils.copyFile(files, destTempfos); + } + } + File partFiles = new File(partFile); + if (partFiles.exists()) { + MultipartFile multipartFile = FileUtil.createFileItem(partFiles); + String type = mergeChunkDto.getType(); + PathTypeModel pathTypeModel = new PathTypeModel(); + pathTypeModel.setPathType(mergeChunkDto.getPathType()); + pathTypeModel.setIsAccount(mergeChunkDto.getIsAccount()); + pathTypeModel.setFolder(mergeChunkDto.getFolder()); + vo = uploaderVO(multipartFile, type,pathTypeModel); + FileUtil.deleteTmp(multipartFile); + } + } catch (Exception e) { + System.out.println("合并分片失败:" + e); + }finally { + FileUtils.deleteQuietly(new File(filePath)); + FileUtils.deleteQuietly(new File(partFile)); + } + return ActionResult.success(vo); + } + + /** + * 封装上传附件 + * + * @param file + * @param type + * @return + * @throws IOException + */ + private UploaderVO uploaderVO(MultipartFile file, String type, PathTypeModel pathTypeModel) throws IOException { + String orgFileName = file.getOriginalFilename(); + String fileType = UpUtil.getFileType(file); +// if (OptimizeUtil.fileSize(file.getSize(), 1024000)) { +// return ActionResult.fail("上传失败,文件大小超过1M"); +// } +// if ("mail".equals(type)) { +// type = "temporary"; +// } + //实际文件名 + String fileName = DateUtil.dateNow("yyyyMMdd") + "_" + RandomUtil.uuId() + "." + fileType; + //文件上传路径 + String filePath = FilePathUtil.getFilePath(type.toLowerCase()); + + //文件自定义路径相对路径 + String relativeFilePath = ""; + if("selfPath".equals(pathTypeModel.getPathType())){ + if ("1".equals(pathTypeModel.getIsAccount())) { + UserInfo userInfo = UserProvider.getUser(); + relativeFilePath += userInfo.getUserAccount() +"/"; + } + if(StringUtil.isNotEmpty(pathTypeModel.getFolder())) { + String folder = pathTypeModel.getFolder(); + folder = folder.replaceAll("\\\\", "/"); + relativeFilePath += folder; + if(!folder.endsWith("/")){ + relativeFilePath += "/"; + } + } + if(StringUtil.isNotEmpty(relativeFilePath)){ + relativeFilePath = StringUtil.replaceMoreStrToOneStr(relativeFilePath,"/"); + if(relativeFilePath.startsWith("/")){ + relativeFilePath = relativeFilePath.substring(1); + } + filePath += relativeFilePath; + fileName = relativeFilePath.replaceAll("/",",") + fileName; + } + } + + UploaderVO vo = UploaderVO.builder().fileSize(file.getSize()).fileExtension(fileType).build(); +// //上传文件 +// if ("im".equalsIgnoreCase(type)){ +// type = "imfile"; +// } + FileInfo fileInfo = FileUploadUtils.uploadFile(file, filePath, fileName); + fileName = fileInfo.getFilename(); + //自定义文件实际文件名 + if (StringUtil.isNotEmpty(relativeFilePath)) { + fileName = relativeFilePath.replaceAll("/", ",") + fileName; + } + vo.setName(fileName); +// UploadUtil.uploadFile(configValueUtil.getFileType(), type, fileName, file, filePath); + if ("useravatar".equalsIgnoreCase(type)) { + vo.setUrl(UploaderUtil.uploaderImg(fileName)); + } else if ("annex".equalsIgnoreCase(type)) { +// UserInfo userInfo = userProvider.get(); +// vo.setUrl(UploaderUtil.uploaderFile(userInfo.getId() + "#" + fileName + "#" + type)); + vo.setUrl(UploaderUtil.uploaderImg("/api/file/Image/annex/", fileName)); + } else if ("annexpic".equalsIgnoreCase(type)) { + vo.setUrl(UploaderUtil.uploaderImg("/api/file/Image/annexpic/", fileName)); + }else { + vo.setUrl(UploaderUtil.uploaderImg("/api/file/Image/"+type.toLowerCase()+"/", fileName)); + } + + //上传到永中 + if ("yozo".equals(configValueUtil.getPreviewType())) { + try { + @Cleanup InputStream inputStream = file.getInputStream(); + String s = yozoUtils.uploadFileInPreview(inputStream, orgFileName); + Map map = JsonUtil.stringToMap(s); + if ("操作成功".equals(map.get("message"))) { + Map dataMap = JsonUtil.stringToMap(String.valueOf(map.get("data"))); + String verId = String.valueOf(dataMap.get("fileVersionId")); + vo.setFileVersionId(verId); + } + } catch (Exception e) { + System.out.println("上传到永中失败"); + e.printStackTrace(); + } + } + return vo; + } +} diff --git a/jnpf-java-boot/jnpf-file/jnpf-file-controller/src/main/java/jnpf/controller/YozoFileController.java b/jnpf-java-boot/jnpf-file/jnpf-file-controller/src/main/java/jnpf/controller/YozoFileController.java new file mode 100644 index 0000000..5731dfd --- /dev/null +++ b/jnpf-java-boot/jnpf-file/jnpf-file-controller/src/main/java/jnpf/controller/YozoFileController.java @@ -0,0 +1,305 @@ +package jnpf.controller; + + +import com.alibaba.fastjson.JSONObject; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.entity.FileEntity; +import jnpf.base.ActionResult; +import jnpf.base.vo.PaginationVO; +import jnpf.config.ConfigValueUtil; +import jnpf.model.FileForm; +import jnpf.model.UploaderVO; +import jnpf.model.YozoFileParams; +import jnpf.model.YozoParams; +import jnpf.service.YozoService; +import jnpf.util.FileUtil; +import jnpf.util.JsonUtil; +import jnpf.util.XSSEscape; +import jnpf.util.wxutil.HttpUtil; +import jnpf.utils.YozoUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.io.File; +import java.io.IOException; +import java.util.*; + +/** + * @author JNPF开发平台组 + */ +@RestController +@RequestMapping +@Tag(name = "在线文档预览", description = "文件在线预览") +public class YozoFileController { + + @Autowired + private YozoService yozoService; + + @Autowired + private YozoUtils yozoUtil; + + @Autowired + private ConfigValueUtil configValueUtil; + + @PostMapping("/api/file/getViewUrlWebPath") + @Operation(summary = "文档预览") + public ActionResult getUrl(YozoFileParams params) { + String previewUrl = XSSEscape.escape(yozoService.getPreviewUrl(params)); + return ActionResult.success("success", previewUrl); + } + + @PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + @Operation(summary = "上传本地文件") + public ActionResult upload(@RequestPart("multipartFile") MultipartFile file) throws IOException { + String result = yozoUtil.uploadFileInPreview(file.getInputStream(),file.getOriginalFilename()); + String fileName = file.getOriginalFilename(); + UploaderVO vo = UploaderVO.builder().name(fileName).build(); + Map map = JsonUtil.stringToMap(result); + if ("操作成功".equals(map.get("message"))){ + Map dataMap = JsonUtil.stringToMap(String.valueOf(map.get("data"))); + String verId = String.valueOf(dataMap.get("fileVersionId")); + vo.setFileVersionId(verId); + return ActionResult.success("Success",vo); + } + + return ActionResult.fail("上传失败!"); + } + + /** + * + * @param fileName 新建文件名 + * @param templateType (模板类型;1新建doc文档,2新建docx文档,3新建ppt文档,4新建pptx文档,5新建xls文档,6新建xlsx文档) + * @return + */ + @GetMapping("/newCreate") + @Operation(summary = "新建文件") + @Parameters({ + @Parameter(name = "fileName", description = "名称"), + @Parameter(name = "templateType", description = "类型"), + }) + public ActionResult newCreate(@RequestParam("fileName") String fileName, @RequestParam("templateType") String templateType) { + String fileNa = yozoUtil.getFileName(fileName, templateType); + if (fileNa == null) { + return ActionResult.fail("请输入正确的文件格式"); + } + //判断文件是否创建过 + FileEntity fileEntity = yozoService.selectByName(fileNa); + if (fileEntity != null) { + return ActionResult.fail("存在同名文件!"); + } + Map params = new HashMap(); + params.put("templateType", new String[]{templateType}); + params.put("fileName", new String[]{fileName}); + String sign = yozoUtil.generateSign(YozoParams.APP_ID, YozoParams.APP_KEY, params).getData(); + String url = YozoParams.CLOUD_DOMAIN + "/api/file/template?templateType=" + templateType + + "&fileName=" + fileName + + "&appId=" + YozoParams.APP_ID + + "&sign=" + sign; + String s = HttpUtil.sendHttpPost(url); + Map maps = JSONObject.parseObject(s, Map.class); + Map fileMap = (Map) maps.get("data"); + String fileVersionId = fileMap.get("fileVersionId"); + String fileId = fileMap.get("fileId"); + ActionResult back = yozoService.saveFileId(fileVersionId, fileId, fileNa); + //在本地新建文件 + FileUtil.createFile(configValueUtil.getDocumentPreviewPath(), fileNa); + return back; + } + + @GetMapping("/uploadByHttp") + @Operation(summary = "http上传文件") + @Parameters({ + @Parameter(name = "fileUrl", description = "路径"), + }) + public ActionResult uploadByHttp(@RequestParam("fileUrl") String fileUrl) { + //获取签名 + Map params = new HashMap(); + params.put("fileUrl", new String[]{fileUrl}); + String sign = yozoUtil.generateSign(YozoParams.APP_ID, YozoParams.APP_KEY, params).getData(); + String url = YozoParams.CLOUD_DOMAIN + "/api/file/http?fileUrl=" + fileUrl + + "&appId=" + YozoParams.APP_ID + + "&sign=" + sign; + String s = HttpUtil.sendHttpPost(url); + Map maps = JSONObject.parseObject(s, Map.class); + Map fileMap = (Map) maps.get("data"); + String fileVersionId = fileMap.get("fileVersionId"); + String fileId = fileMap.get("fileId"); + ActionResult back = yozoService.saveFileIdByHttp(fileVersionId, fileId, fileUrl); + return back; + } + + @GetMapping("/downloadFile") + @Operation(summary = "永中下载文件") + @Parameters({ + @Parameter(name = "fileVersionId", description = "主键"), + }) + public String downloadFile(@RequestParam("fileVersionId") String fileVersionId) { + String newFileVersionId = XSSEscape.escape(fileVersionId); + FileEntity fileEntity = yozoService.selectByVersionId(newFileVersionId); + if (fileEntity == null) { + return "不存在该文件"; + } + //获取签名 + Map params = new HashMap(); + params.put("fileVersionId", new String[]{newFileVersionId}); + String sign = yozoUtil.generateSign(YozoParams.APP_ID, YozoParams.APP_KEY, params).getData(); + String url = YozoParams.CLOUD_DOMAIN + "/api/file/download?fileVersionId=" + newFileVersionId + + "&appId=" + YozoParams.APP_ID + + "&sign=" + sign; + return url; + } + + + @GetMapping("/deleteVersionFile") + @Operation(summary = "删除文件版本") + @Parameters({ + @Parameter(name = "fileVersionId", description = "主键"), + }) + public ActionResult deleteVersion(@RequestParam("fileVersionId") String fileVersionId) { + //获取签名 + Map params = new HashMap(); + params.put("fileVersionId", new String[]{fileVersionId}); + String sign = yozoUtil.generateSign(YozoParams.APP_ID, YozoParams.APP_KEY, params).getData(); + String url = YozoParams.CLOUD_DOMAIN + "/api/file/delete/version?fileVersionId=" + fileVersionId + + "&appId=" + YozoParams.APP_ID + + "&sign=" + sign; + String s = HttpUtil.sendHttpGet(url); + Map maps = JSONObject.parseObject(s, Map.class); + String fileName = yozoService.selectByVersionId(fileVersionId).getFileName(); + String path = configValueUtil.getDocumentPreviewPath() + fileName; + if (FileUtil.fileIsFile(path)) { + File file = new File(XSSEscape.escapePath(path)); + file.delete(); + } + String versionId = (String) maps.get("data"); + ActionResult back = yozoService.deleteFileByVersionId(versionId); + return back; + } + + @GetMapping("/batchDelete") + @Operation(summary = "批量删除文件版本") + @Parameters({ + @Parameter(name = "fileVersionIds", description = "主键"), + }) + public ActionResult batchDelete(@RequestParam("fileVersionIds") String[] fileVersionIds) { + List asList = new ArrayList<>(16); + //获取签名 + for (String fileVersionId : fileVersionIds) { + String escape = XSSEscape.escape(fileVersionId); + asList.add(escape); + } + String[] newFileVersionIds = asList.toArray(fileVersionIds); + Map params = new HashMap<>(); + params.put("fileVersionIds", newFileVersionIds); + String sign = yozoUtil.generateSign(YozoParams.APP_ID, YozoParams.APP_KEY, params).getData(); + + StringBuilder fileVersionIdList = new StringBuilder(); + for (String s : newFileVersionIds) { + String fileName = yozoService.selectByVersionId(s).getFileName(); + String path = configValueUtil.getDocumentPreviewPath() + fileName; + File file = new File(XSSEscape.escapePath(path)); + file.delete(); + fileVersionIdList.append("fileVersionIds=" + s + "&"); + } + String list = fileVersionIdList.toString(); + String url = YozoParams.CLOUD_DOMAIN + "/api/file/delete/versions?" + list + + "appId=" + YozoParams.APP_ID + + "&sign=" + sign; + String s = HttpUtil.sendHttpGet(url); + ActionResult back = yozoService.deleteBatch(newFileVersionIds); + return back; + } + + @GetMapping("/editFile") + @Operation(summary = "在线编辑") + @Parameters({ + @Parameter(name = "fileVersionId", description = "主键"), + }) + public ActionResult editFile(@RequestParam("fileVersionId") String fileVersionId) { + String newFileVersionId = XSSEscape.escape(fileVersionId); + //获取签名 + Map params = new HashMap<>(); + params.put("fileVersionId", new String[]{newFileVersionId}); + String sign = yozoUtil.generateSign(YozoParams.APP_ID, YozoParams.APP_KEY, params).getData(); + String url = YozoParams.EDIT_DOMAIN + "/api/edit/file?fileVersionId=" + newFileVersionId + + "&appId=" + YozoParams.APP_ID + + "&sign=" + sign; + return ActionResult.success("success", url); + } + + /** + * 永中回调 + * + * @param oldFileId + * @param newFileId + * @param message + * @param errorCode + * @return + */ + @PostMapping("/3rd/edit/callBack") + @Parameters({ + @Parameter(name = "oldFileId", description = "主键"), + @Parameter(name = "newFileId", description = "主键"), + @Parameter(name = "message", description = "消息"), + @Parameter(name = "errorCode", description = "编码"), + }) + public Map editCallBack(@RequestParam("oldFileId") String oldFileId, @RequestParam("newFileId") String newFileId, @RequestParam("message") String message, @RequestParam("errorCode") Integer errorCode) { + + String escapeOldFileId = XSSEscape.escape(oldFileId); + String escapeNewFileId = XSSEscape.escape(newFileId); + String escapeMessage = XSSEscape.escape(message); + yozoService.editFileVersion(escapeOldFileId, escapeNewFileId); + + Map result = new HashMap<>(); + result.put("oldFileId", escapeOldFileId); + result.put("newFileId", escapeNewFileId); + result.put("message", escapeMessage); + result.put("errorCode", errorCode); + return result; + } + + @PostMapping("/documentList") + @Operation(summary = "文档列表") + @Parameters({ + @Parameter(name = "pageModel", description = "分页模型", required = true), + }) + public ActionResult documentList(@RequestBody PaginationVO pageModel) { + PaginationVO pv = new PaginationVO(); + pv.setCurrentPage(pageModel.getCurrentPage()); + pv.setPageSize(pageModel.getPageSize()); + pv.setTotal(pageModel.getTotal()); + List list = yozoService.getAllList(pv); + List listVo = JsonUtil.getJsonToList(list, FileForm.class); + return ActionResult.page(listVo, pv); + } + + /** + * 传入新的fileVersionId同步 + * + * @param fileVersionId + * @return + * @throws Exception + */ + @GetMapping("/updateFile") + @Operation(summary = "/同步文件版本到本地") + @Parameters({ + @Parameter(name = "fileVersionId", description = "主键"), + }) + public ActionResult updateFile(@RequestParam("fileVersionId") String fileVersionId) throws Exception { + FileEntity fileEntity = yozoService.selectByVersionId(fileVersionId); + String fileName = fileEntity.getFileName(); + String path = configValueUtil.getDocumentPreviewPath() + fileName; + if (FileUtil.fileIsFile(path)) { + File file = new File(XSSEscape.escapePath(path)); + file.delete(); + } + String fileUrl = this.downloadFile(fileVersionId); + yozoUtil.downloadFile(fileUrl, path); + return ActionResult.success("更新完毕"); + } +} diff --git a/jnpf-java-boot/jnpf-file/jnpf-file-entity/pom.xml b/jnpf-java-boot/jnpf-file/jnpf-file-entity/pom.xml new file mode 100644 index 0000000..955172d --- /dev/null +++ b/jnpf-java-boot/jnpf-file/jnpf-file-entity/pom.xml @@ -0,0 +1,23 @@ + + + + jnpf-file + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-file-entity + + + + com.jnpf + jnpf-common-all + ${project.version} + compile + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/entity/FileEntity.java b/jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/entity/FileEntity.java new file mode 100644 index 0000000..1bad79d --- /dev/null +++ b/jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/entity/FileEntity.java @@ -0,0 +1,44 @@ +package jnpf.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + +/** + * @author JNPF + */ +@Data +@TableName("base_file") +public class FileEntity extends SuperExtendEntity { + + /** + * 文件编辑版本 + */ + @TableField("f_file_version") + private String fileVersionId; + + /** + * 文件名 + */ + @TableField("f_file_name") + private String fileName; + + /** + * 文件上传方式 + */ + @TableField("f_type") + private String type; + + /** + * 上传的url + */ + @TableField("f_url") + private String url; + + /** + * 上次文件版本 + */ + @TableField("f_old_file_version_id") + private String oldFileVersionId; +} diff --git a/jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/enums/FilePreviewTypeEnum.java b/jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/enums/FilePreviewTypeEnum.java new file mode 100644 index 0000000..51ac446 --- /dev/null +++ b/jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/enums/FilePreviewTypeEnum.java @@ -0,0 +1,24 @@ +package jnpf.enums; +/** + * 文件预览方式 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/5/6 + */ +public enum FilePreviewTypeEnum { + /** + * yozo:永中预览; doc:kk文档预览; + */ + YOZO_ONLINE_PREVIEW("yozoOnlinePreview"), + LOCAL_PREVIEW("localPreview"); + FilePreviewTypeEnum(String type) { + this.type = type; + } + private String type; + + public String getType() { + return type; + } +} diff --git a/jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/Chunk.java b/jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/Chunk.java new file mode 100644 index 0000000..a080cde --- /dev/null +++ b/jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/Chunk.java @@ -0,0 +1,59 @@ +package jnpf.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class Chunk implements Serializable { + /** + * 当前文件块,从1开始 + */ + @Schema(description = "当前文件块") + private Integer chunkNumber; + /** + * 分块大小 + */ + @Schema(description = "分块大小") + private Long chunkSize; + /** + * 当前分块大小 + */ + @Schema(description = "当前分块大小") + private Long currentChunkSize; + /** + * 总大小 + */ + @Schema(description = "总大小") + private Long totalSize; + /** + * 文件标识 + */ + @Schema(description = "文件标识") + private String identifier; + /** + * 文件名 + */ + @Schema(description = "文件名") + private String fileName; + /** + * 相对路径 + */ + @Schema(description = "相对路径") + private String relativePath; + /** + * 总块数 + */ + @Schema(description = "总块数") + private Integer totalChunks; + /** + * 文件类型 + */ + @Schema(description = "文件类型") + private String type; + + private String extension; + + private String fileType; +} diff --git a/jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/ChunkRes.java b/jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/ChunkRes.java new file mode 100644 index 0000000..08194a5 --- /dev/null +++ b/jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/ChunkRes.java @@ -0,0 +1,24 @@ +package jnpf.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Builder; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Description: 分片上传响应 + * @date 2020/6/10 20:59 + */ +@Data +@Builder +public class ChunkRes implements Serializable { + + @Schema(description = "块数") + private List chunkNumbers = new ArrayList<>(); + + @Schema(description = "是否合并") + private Boolean merge; +} diff --git a/jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/FileForm.java b/jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/FileForm.java new file mode 100644 index 0000000..3693d68 --- /dev/null +++ b/jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/FileForm.java @@ -0,0 +1,18 @@ +package jnpf.model; + +import lombok.Data; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/5/14 + */ +@Data +public class FileForm { + private String fileId; + private String fileVersionId; + private String fileName; +} diff --git a/jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/LanguageVO.java b/jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/LanguageVO.java new file mode 100644 index 0000000..9e4846e --- /dev/null +++ b/jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/LanguageVO.java @@ -0,0 +1,13 @@ +package jnpf.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class LanguageVO { + @Schema(description ="语言编码") + private String encode; + @Schema(description ="语言名称") + private String fullName; +} diff --git a/jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/MergeChunkDto.java b/jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/MergeChunkDto.java new file mode 100644 index 0000000..91a8500 --- /dev/null +++ b/jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/MergeChunkDto.java @@ -0,0 +1,53 @@ +package jnpf.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description: + * @date 2020/6/10 20:39 + */ +@Data +public class MergeChunkDto implements Serializable { + + @Schema(description = "名称") + private String fileName; + + @Schema(description = "分片") + private String identifier; + + @Schema(description = "文件大小") + private Long filesize; + + @Schema(description = "扩展") + private String extension; + + @Schema(description = "文件类型") + private String fileType; + + @Schema(description = "类型") + private String type; + + @Schema(description = "父级id") + private String parentId; + + /** + * 文件上传路径类型 + */ + @Schema(description = "文件上传路径类型") + private String pathType; + + /** + * 是否分用户存储 1:是 0:否 + */ + @Schema(description = "是否分用户存储") + private String isAccount; + + /** + * 文件路径,子级文件用“/”隔开,如:文件1/文件1-1 + */ + @Schema(description = "文件路径") + private String folder; +} diff --git a/jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/PathTypeModel.java b/jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/PathTypeModel.java new file mode 100644 index 0000000..c4e1761 --- /dev/null +++ b/jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/PathTypeModel.java @@ -0,0 +1,24 @@ +package jnpf.model; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 文件上传路径配置模型 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-07-26 + */ +@Data +public class PathTypeModel implements Serializable{ + + private String pathType; + + private String isAccount; + + private String folder; + +} diff --git a/jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/PreviewParams.java b/jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/PreviewParams.java new file mode 100644 index 0000000..3084779 --- /dev/null +++ b/jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/PreviewParams.java @@ -0,0 +1,22 @@ +package jnpf.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.3 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2022/3/30 + */ +@Data +public class PreviewParams { + @Schema(description = "文件名") + private String fileName; + @Schema(description = "预览文件id") + private String fileVersionId; + @Schema(description = "文件下载路径") + private String fileDownloadUrl; +} diff --git a/jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/SuffixParams.java b/jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/SuffixParams.java new file mode 100644 index 0000000..5f40446 --- /dev/null +++ b/jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/SuffixParams.java @@ -0,0 +1,49 @@ +package jnpf.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 预览文件相关参数 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/5/6 + */ +@Data +public class SuffixParams { + /** + * 是否强制重新转换(忽略缓存),true为强制重新转换,false为不强制重新转换。 + */ + @Schema(description = "是否强制重新转换") + private Boolean noCache; + + /** + * 针对单文档设置水印内容。 + */ + @Schema(description = "设置水印内容") + private String watermark; + + /** + * 0否1是,默认为0。针对单文档设置是否防复制 + */ + @Schema(description = "是否防复制") + private Integer isCopy; + + /** + * 试读功能(转换页数的起始页和转换页数的终止页,拥有对应权限的域名才能调用) + */ + @Schema(description = "开始") + private Integer pageStart; + + @Schema(description = "结束") + private Integer pageEnd; + + /** + * 用于无文件后缀链接,指定预览文件后缀名 + */ + @Schema(description = "文件后缀链接") + private String type; + +} diff --git a/jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/UploaderVO.java b/jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/UploaderVO.java new file mode 100644 index 0000000..3265780 --- /dev/null +++ b/jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/UploaderVO.java @@ -0,0 +1,21 @@ +package jnpf.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Builder; +import lombok.Data; + +@Data +@Builder +public class UploaderVO { + @Schema(description ="名称") + private String name; + @Schema(description ="请求接口") + private String url; + @Schema(description ="预览文件id") + private String fileVersionId; + @Schema(description ="文件大小") + private Long fileSize; + @Schema(description ="文件后缀") + private String fileExtension; +} diff --git a/jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/YozoFileParams.java b/jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/YozoFileParams.java new file mode 100644 index 0000000..142c101 --- /dev/null +++ b/jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/YozoFileParams.java @@ -0,0 +1,48 @@ +package jnpf.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * @author JNPF + */ +@Data +public class YozoFileParams { + @Schema(description = "路径") + private String url; + + /** + * 是否强制重新转换(忽略缓存),true为强制重新转换,false为不强制重新转换。 + */ + @Schema(description = "是否强制重新转换") + private Boolean noCache; + + /** + * 针对单文档设置水印内容。 + */ + @Schema(description = "设置水印内容") + private String watermark; + + /** + * 0否1是,默认为0。针对单文档设置是否防复制 + */ + @Schema(description = "是否防复制") + private Integer isCopy; + + /** + * 试读功能(转换页数的起始页和转换页数的终止页,拥有对应权限的域名才能调用) + */ + @Schema(description = "开始") + private Integer pageStart; + + @Schema(description = "结束") + private Integer pageEnd; + + /** + * 用于无文件后缀链接,指定预览文件后缀名 + */ + @Schema(description = "文件后缀链接") + private String type; + + +} diff --git a/jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/YozoParams.java b/jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/YozoParams.java new file mode 100644 index 0000000..0615858 --- /dev/null +++ b/jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/model/YozoParams.java @@ -0,0 +1,56 @@ +package jnpf.model; + +import lombok.Data; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +/** + * @author JNPF + */ +@Data +@Component +public class YozoParams implements InitializingBean { + + + @Value("${config.YozoDomainKey}") + private String domainKey; + + @Value("${config.YozoDomain}") + private String domain; + + @Value("${config.YozoCloudDomain}") + private String cloudDomain; + + @Value("${config.YozoAppId}") + private String appId; + + @Value("${config.YozoAppKey}") + private String appKey; + + @Value("${config.YozoEditDomain}") + private String editDomain; + + @Value("${config.ApiDomain}") + private String jnpfDomain; + + + public static String DOMAIN_KEY; + public static String DOMAIN; + public static String CLOUD_DOMAIN; + public static String APP_ID; + public static String APP_KEY; + public static String EDIT_DOMAIN; + public static String JNPF_DOMAINS; + + @Override + public void afterPropertiesSet() throws Exception { + DOMAIN=domain; + DOMAIN_KEY=domainKey; + CLOUD_DOMAIN=cloudDomain; + APP_ID=appId; + APP_KEY=appKey; + EDIT_DOMAIN=editDomain; + JNPF_DOMAINS=jnpfDomain; + } +} diff --git a/jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/utils/SplicingUrlUtil.java b/jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/utils/SplicingUrlUtil.java new file mode 100644 index 0000000..3993e45 --- /dev/null +++ b/jnpf-java-boot/jnpf-file/jnpf-file-entity/src/main/java/jnpf/utils/SplicingUrlUtil.java @@ -0,0 +1,44 @@ +package jnpf.utils; + +import jnpf.model.YozoFileParams; +import jnpf.model.YozoParams; +import jnpf.util.XSSEscape; +import org.springframework.util.StringUtils; + +/** + * @author JNPF开发平台组 + */ +public class SplicingUrlUtil { + /** + * 永中预览url拼接 + * @param params + * @return + */ + public static String getPreviewUrl(YozoFileParams params) { + StringBuilder paramsUrl = new StringBuilder(); + if (!StringUtils.isEmpty(params.getNoCache())) { + paramsUrl.append("&noCache=" + params.getNoCache()); + } + if (!StringUtils.isEmpty(params.getWatermark())) { + String watermark = XSSEscape.escape(params.getWatermark()); + paramsUrl.append("&watermark=" + watermark); + } + if (!StringUtils.isEmpty(params.getIsCopy())) { + paramsUrl.append("&isCopy=" + params.getIsCopy()); + } + if (!StringUtils.isEmpty(params.getPageStart())) { + paramsUrl.append("&pageStart=" + params.getPageStart()); + } + if (!StringUtils.isEmpty(params.getPageEnd())) { + paramsUrl.append("&pageEnd=" + params.getPageEnd()); + } + if (!StringUtils.isEmpty(params.getType())) { + String type = XSSEscape.escape(params.getType()); + paramsUrl.append("&type=" + type); + } + String s = paramsUrl.toString(); + String previewUrl= YozoParams.DOMAIN+"?k=" + YozoParams.DOMAIN_KEY + "&url=" + params.getUrl() + s; + return previewUrl; + } + +} diff --git a/jnpf-java-boot/jnpf-file/pom.xml b/jnpf-java-boot/jnpf-file/pom.xml new file mode 100644 index 0000000..8c8d8df --- /dev/null +++ b/jnpf-java-boot/jnpf-file/pom.xml @@ -0,0 +1,20 @@ + + + + jnpf-java-boot + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-file + pom + + jnpf-file-entity + jnpf-file-biz + jnpf-file-controller + + + diff --git a/jnpf-java-boot/jnpf-form/jnpf-form-biz/pom.xml b/jnpf-java-boot/jnpf-form/jnpf-form-biz/pom.xml new file mode 100644 index 0000000..9615729 --- /dev/null +++ b/jnpf-java-boot/jnpf-form/jnpf-form-biz/pom.xml @@ -0,0 +1,32 @@ + + + + jnpf-form + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-form-biz + + + + com.jnpf + jnpf-form-entity + ${project.version} + + + com.jnpf + jnpf-permission-biz + ${project.version} + + + com.jnpf + jnpf-system-biz + ${project.version} + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/mapper/FlowFormDataMapper.java b/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/mapper/FlowFormDataMapper.java new file mode 100644 index 0000000..f2903a3 --- /dev/null +++ b/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/mapper/FlowFormDataMapper.java @@ -0,0 +1,15 @@ +package jnpf.mapper; + +import org.mybatis.dynamic.sql.util.mybatis3.*; + +/** + * mybatis3 表单mapper对象 + * + * @author JNPF开发平台组 + * @version V3.4.5 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2022/9/27 + */ +public interface FlowFormDataMapper extends CommonCountMapper, CommonDeleteMapper, CommonInsertMapper, CommonSelectMapper, + CommonUpdateMapper { +} diff --git a/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/mapper/FlowFormMapper.java b/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/mapper/FlowFormMapper.java new file mode 100644 index 0000000..3c1be98 --- /dev/null +++ b/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/mapper/FlowFormMapper.java @@ -0,0 +1,21 @@ +package jnpf.mapper; + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.entity.FlowFormEntity; +import jnpf.model.flow.FlowTempInfoModel; +import org.apache.ibatis.annotations.Param; + +/** + * 流程设计 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/6/30 18:00 + */ +public interface FlowFormMapper extends SuperMapper { + + FlowTempInfoModel findFLowInfo(@Param("tempId") String tempId); + +} diff --git a/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/mapper/FlowFormRelationMapper.java b/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/mapper/FlowFormRelationMapper.java new file mode 100644 index 0000000..09267a3 --- /dev/null +++ b/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/mapper/FlowFormRelationMapper.java @@ -0,0 +1,17 @@ +package jnpf.mapper; + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.entity.FlowFormEntity; +import jnpf.entity.FlowFormRelationEntity; + +/** + * 流程表单关联 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/6/30 18:00 + */ +public interface FlowFormRelationMapper extends SuperMapper { +} diff --git a/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/service/FlowFormRelationService.java b/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/service/FlowFormRelationService.java new file mode 100644 index 0000000..3b9d39a --- /dev/null +++ b/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/service/FlowFormRelationService.java @@ -0,0 +1,36 @@ +package jnpf.service; + +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import jnpf.entity.FlowFormRelationEntity; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; + +import java.util.List; + +/** + * 流程表单关联 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/6/30 18:01 + */ +public interface FlowFormRelationService extends SuperService { + /** + * 根据流程id保存关联表单 + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2022/10/26 + */ + void saveFlowIdByFormIds(String flowId, List formIds); + /** + * 根据表单id查询是否存在引用 + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2022/10/26 + */ + List getListByFormId(String formId); +} diff --git a/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/service/FlowFormService.java b/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/service/FlowFormService.java new file mode 100644 index 0000000..2da50f3 --- /dev/null +++ b/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/service/FlowFormService.java @@ -0,0 +1,120 @@ +package jnpf.service; + +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import jnpf.base.ActionResult; +import jnpf.entity.FlowFormEntity; +import jnpf.exception.WorkFlowException; +import jnpf.model.flow.FlowTempInfoModel; +import jnpf.model.form.FlowFormPage; +import org.springframework.web.bind.annotation.RequestParam; + +import java.util.List; + +/** + * 流程设计 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/6/30 18:01 + */ +public interface FlowFormService extends SuperService { + + /** + * 判断名称是否重复 + * + * @param fullName 名称 + * @param id 主键 + * @return ignore + */ + boolean isExistByFullName(String fullName, String id); + + /** + * 判断code是否重复 + * + * @param enCOde 名称 + * @param id 主键 + * @return ignore + */ + boolean isExistByEnCode(String enCOde, String id); + /** + * 创建 + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2022/9/29 + */ + Boolean create(FlowFormEntity entity) throws WorkFlowException; + + /** + * 修改 + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2022/9/29 + */ + Boolean update(FlowFormEntity entity) throws Exception; + /** + * 查询列表 + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2022/7/1 + */ + List getList(FlowFormPage flowFormPage); + /** + * 查询列表 + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2022/7/1 + */ + List getListForSelect(FlowFormPage flowFormPage); + /** + * 发布/回滚 + * @param isRelease 是否发布:1-发布 0-回滚 + * @return + * @copyright 引迈信息技术有限公司 + * @date 2022/7/1 + */ + ActionResult release(String id, Integer isRelease) throws WorkFlowException ; + /** + * 复制表单 + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2022/7/1 + */ + boolean copyForm(String id); + /** + * 导入表单 + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2022/7/1 + */ + ActionResult ImportData(FlowFormEntity entity) throws WorkFlowException; + + /** + * 获取表单流程引擎 + * @param flowId + * @return + */ + List getFlowIdList(String flowId); + + /** + * 获取流程信息 + * @param id + * @return + */ + FlowTempInfoModel getFormById(String id) throws WorkFlowException; + + /** + * 修改流程的引擎id + * @param entity + */ + void updateForm(FlowFormEntity entity); + + void saveLogicFlowAndForm(String id); +} diff --git a/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/service/FormDataService.java b/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/service/FormDataService.java new file mode 100644 index 0000000..f552e23 --- /dev/null +++ b/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/service/FormDataService.java @@ -0,0 +1,64 @@ +package jnpf.service; + +import jnpf.base.ActionResult; +import jnpf.entity.FlowFormEntity; +import jnpf.exception.DataException; +import jnpf.exception.WorkFlowException; +import jnpf.model.form.FlowFormPage; +import jnpf.permission.entity.UserEntity; + +import java.sql.SQLException; +import java.util.List; +import java.util.Map; + +/** + * 表单数据操作 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/6/30 18:01 + */ +public interface FormDataService{ + + /** + * 新增 + * + * @param formId 表单id + * @param id 主键id + * @param map 数据 + * @return ignore + */ + void create(String formId, String id, Map map) throws Exception; + + /** + * 修改 + * + * @param formId 表单id + * @param id 主键id + * @param map 数据 + * @return ignore + */ + void update(String formId, String id, Map map) throws WorkFlowException, SQLException, DataException; + + + void saveOrUpdate(String formId, String id, Map map, UserEntity delegateUser) throws WorkFlowException; + + /** + * 删除 + * + * @param formId 表单id + * @param id 主键id + * @return ignore + */ + boolean delete(String formId, String id) throws Exception; + + /** + * 信息 + * + * @param formId 表单id + * @param id 主键id + * @return ignore + */ + ActionResult info(String formId, String id); +} diff --git a/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/service/impl/FlowDataServiceImpl.java b/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/service/impl/FlowDataServiceImpl.java new file mode 100644 index 0000000..a37fefa --- /dev/null +++ b/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/service/impl/FlowDataServiceImpl.java @@ -0,0 +1,123 @@ +package jnpf.service.impl; + +import jnpf.base.ActionResult; +import jnpf.base.service.DbLinkService; +import jnpf.database.model.entity.DbLinkEntity; +import jnpf.entity.FlowFormEntity; +import jnpf.exception.DataException; +import jnpf.exception.WorkFlowException; +import jnpf.model.visualJson.FormDataModel; +import jnpf.model.visualJson.TableModel; +import jnpf.permission.entity.UserEntity; +import jnpf.base.UserInfo; +import jnpf.permission.model.organize.OrganizeConditionModel; +import jnpf.permission.model.user.mod.UserConditionModel; +import jnpf.permission.service.OrganizeService; +import jnpf.permission.service.UserService; +import jnpf.service.FlowFormService; +import jnpf.service.FormDataService; +import jnpf.util.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.Assert; + +import java.sql.SQLException; +import java.util.*; + + +@Service +public class FlowDataServiceImpl implements FormDataService { + @Autowired + private FlowFormCustomUtils flowFormCustomUtils; + @Autowired + private FlowFormHttpReqUtils flowFormHttpReqUtils; + + @Autowired + private FlowFormService flowFormService; + @Autowired + private DbLinkService dblinkService; + @Autowired + private FlowFormDataUtil flowDataUtil; + @Autowired + private UserService userService; + @Autowired + private OrganizeService organizeService; + @Autowired + private UserProvider userProvider; + + @Override + public void create(String formId, String id, Map map) throws WorkFlowException { + FlowFormEntity flowFormEntity = flowFormService.getById(formId); + //判断是否为系统表单 + boolean b = flowFormEntity.getFormType() == 1; + if (b) { + flowFormHttpReqUtils.create(flowFormEntity, id, UserProvider.getToken(), map); + } else { + flowFormCustomUtils.create(flowFormEntity, id, map, null); + } + } + + @Override + public void update(String formId, String id, Map map) throws WorkFlowException, SQLException, DataException { + FlowFormEntity flowFormEntity = flowFormService.getById(formId); + //判断是否为系统表单 + boolean b = flowFormEntity.getFormType() == 1; + if (b) { + flowFormHttpReqUtils.update(flowFormEntity, id, UserProvider.getToken(), map); + } else { + flowFormCustomUtils.update(flowFormEntity, id, map); + } + } + + @Override + public void saveOrUpdate(String formId, String id, Map map, UserEntity delegateUser) throws WorkFlowException { + FlowFormEntity flowFormEntity = flowFormService.getById(formId); + Integer formType = flowFormEntity.getFormType(); + if(map.get(TableFeildsEnum.VERSION.getField().toUpperCase())!=null){//针对Oracle数据库大小写敏感,出现大写字段补充修复 + map.put(TableFeildsEnum.VERSION.getField(),map.get(TableFeildsEnum.VERSION.getField().toUpperCase())); + } + //系统表单 + if (formType == 1) { + flowFormHttpReqUtils.saveOrUpdate(flowFormEntity, id, UserProvider.getToken(), map); + } else { + try { + flowFormCustomUtils.saveOrUpdate(flowFormEntity, id, map, delegateUser); + } catch (SQLException sqlException) { + sqlException.printStackTrace(); + } catch (DataException e) { + e.printStackTrace(); + } + } + } + + @Override + public boolean delete(String formId, String id) throws Exception { + FlowFormEntity flowFormEntity = flowFormService.getById(formId); + List tableModels = JsonUtil.getJsonToList(flowFormEntity.getTableJson(), TableModel.class); + FormDataModel formData = JsonUtil.getJsonToBean(flowFormEntity.getPropertyJson(), FormDataModel.class); + Integer primaryKeyPolicy = formData.getPrimaryKeyPolicy(); + DbLinkEntity linkEntity = StringUtil.isNotEmpty(flowFormEntity.getDbLinkId()) ? dblinkService.getInfo(flowFormEntity.getDbLinkId()) : null; + flowDataUtil.deleteTable(id, primaryKeyPolicy, tableModels, linkEntity); + return true; + } + + @Override + public ActionResult info(String formId, String id){ + ActionResult result = new ActionResult(); + Map allDataMap = new HashMap(); + FlowFormEntity flowFormEntity = flowFormService.getById(formId); + result.setCode(flowFormEntity==null?400:200); + result.setMsg(flowFormEntity==null?"表单信息不存在":""); + if(flowFormEntity!=null){ + //判断是否为系统表单 + boolean b = flowFormEntity.getFormType() == 1; + if (b) { + allDataMap.putAll(flowFormHttpReqUtils.info(flowFormEntity, id, UserProvider.getToken())); + } else { + allDataMap.putAll(flowFormCustomUtils.info(flowFormEntity, id)); + } + } + result.setData(allDataMap); + return result; + } +} diff --git a/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/service/impl/FlowFormRelationServiceImpl.java b/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/service/impl/FlowFormRelationServiceImpl.java new file mode 100644 index 0000000..5c9f42b --- /dev/null +++ b/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/service/impl/FlowFormRelationServiceImpl.java @@ -0,0 +1,49 @@ +package jnpf.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import jnpf.base.service.SuperServiceImpl; +import jnpf.entity.FlowFormRelationEntity; +import jnpf.mapper.FlowFormRelationMapper; +import jnpf.service.FlowFormRelationService; +import jnpf.util.RandomUtil; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 流程表单关联 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/6/30 18:01 + */ +@Service +public class FlowFormRelationServiceImpl extends SuperServiceImpl implements FlowFormRelationService { + + @Override + public void saveFlowIdByFormIds(String flowId, List formIds) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowFormRelationEntity::getFlowId, flowId); + List list = this.list(queryWrapper); + this.removeBatchByIds(list); + if(CollectionUtils.isNotEmpty(formIds)){ + for(String formId:formIds){ + FlowFormRelationEntity entity=new FlowFormRelationEntity(); + entity.setFlowId(flowId); + entity.setId(RandomUtil.uuId()); + entity.setFormId(formId); + this.save(entity); + } + } + } + + @Override + public List getListByFormId(String formId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowFormRelationEntity::getFormId, formId); + List list = this.list(queryWrapper); + return list; + } +} diff --git a/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/service/impl/FlowFormServiceImpl.java b/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/service/impl/FlowFormServiceImpl.java new file mode 100644 index 0000000..1ac53d0 --- /dev/null +++ b/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/service/impl/FlowFormServiceImpl.java @@ -0,0 +1,353 @@ +package jnpf.service.impl; + +import com.alibaba.fastjson.JSONArray; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import jnpf.base.ActionResult; +import jnpf.base.service.SuperServiceImpl; +import jnpf.constant.MsgCode; +import jnpf.entity.FlowFormEntity; +import jnpf.exception.WorkFlowException; +import jnpf.mapper.FlowFormMapper; +import jnpf.model.flow.FlowTempInfoModel; +import jnpf.model.form.FlowFormPage; +import jnpf.model.form.FormDraftJsonModel; +import jnpf.model.form.VisualTableModel; +import jnpf.model.visualJson.FieLdsModel; +import jnpf.model.visualJson.FormCloumnUtil; +import jnpf.model.visualJson.FormDataModel; +import jnpf.model.visualJson.TableModel; +import jnpf.model.visualJson.analysis.FormAllModel; +import jnpf.model.visualJson.analysis.RecursionForm; +import jnpf.service.FlowFormService; +import jnpf.util.*; +import lombok.SneakyThrows; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; + +/** + * 流程设计 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/6/30 18:01 + */ +@Service +public class FlowFormServiceImpl extends SuperServiceImpl implements FlowFormService { + + @Autowired + private UserProvider userProvider; + + @Autowired + private VisualDevTableCre formTableCre; + + @Autowired + private ConcurrencyUtils concurrencyUtils; + + @Override + public boolean isExistByFullName(String fullName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowFormEntity::getFullName, fullName); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(FlowFormEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public boolean isExistByEnCode(String enCOde, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowFormEntity::getEnCode, enCOde); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(FlowFormEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + @SneakyThrows + public Boolean create(FlowFormEntity entity) { + if (StringUtil.isEmpty(entity.getId())) { + entity.setId(RandomUtil.uuId()); + } + + FormDataModel formDataModel = new FormDataModel(); + //判断是否要创表 + List tableModels = new ArrayList<>(); + Map formMap = null; + if (entity.getFormType() == 2 && entity.getDraftJson() != null) { + formDataModel = JsonUtil.getJsonToBean(entity.getDraftJson(), FormDataModel.class); + tableModels = JsonUtil.getJsonToList(entity.getTableJson(), TableModel.class); + formMap = JsonUtil.stringToMap(entity.getDraftJson()); + } + //是否开启安全锁 + Boolean concurrencyLock = formDataModel.getConcurrencyLock(); + Boolean logicalDelete = formDataModel.getLogicalDelete(); + int primaryKeyPolicy = formDataModel.getPrimaryKeyPolicy(); + + //有表 + if (entity.getTableJson() != null) { + List visualTables = JsonUtil.getJsonToList(entity.getTableJson(), TableModel.class); + TableModel mainTable = visualTables.stream().filter(f -> f.getTypeId().equals("1" )).findFirst().orElse(null); + //判断自增是否匹配 + concurrencyUtils.checkAutoIncrement(primaryKeyPolicy,entity.getDbLinkId(),visualTables); + //在主表创建锁字段是否开启安全锁 + try { + if (logicalDelete && mainTable != null) { + concurrencyUtils.creDeleteMark(mainTable.getTable(), entity.getDbLinkId()); + } + if (concurrencyLock) { + concurrencyUtils.createVersion(mainTable.getTable(), entity.getDbLinkId()); + } + if (mainTable != null && formDataModel.getPrimaryKeyPolicy() == 2) { + concurrencyUtils.createFlowTaskId(mainTable.getTable(), entity.getDbLinkId()); + } + concurrencyUtils.createFlowEngine(mainTable.getTable(), entity.getDbLinkId()); + } catch (Exception e) { + log.error("创建字段失败!"); + } + } + entity.setDraftJson(JsonUtil.getObjectToString(new FormDraftJsonModel().setDraftJson(entity.getDraftJson()).setTableJson(entity.getTableJson()))); + return this.save(entity); + } + + @Override + public Boolean update(FlowFormEntity entity) throws Exception { + List visualTables = JsonUtil.getJsonToList(entity.getTableJson(), TableModel.class); + if (entity.getFormType() == 2 && visualTables.size() > 0 && StringUtil.isNotEmpty(entity.getDraftJson())) { + FormDataModel formDataModel = JsonUtil.getJsonToBean(entity.getDraftJson(), FormDataModel.class); + TableModel mainTable = visualTables.stream().filter(f -> f.getTypeId().equals("1")).findFirst().orElse(null); + //是否开启安全锁 + Boolean concurrencyLock = formDataModel.getConcurrencyLock(); + int primaryKeyPolicy = formDataModel.getPrimaryKeyPolicy(); + Boolean logicalDelete = formDataModel.getLogicalDelete(); + if (logicalDelete && mainTable != null) { + //在主表创建逻辑删除字段 + concurrencyUtils.creDeleteMark(mainTable.getTable(), entity.getDbLinkId()); + } + if (concurrencyLock) { + //在主表创建锁字段 + concurrencyUtils.createVersion(mainTable.getTable(), entity.getDbLinkId()); + } + if (mainTable != null && formDataModel.getPrimaryKeyPolicy() == 2) { + concurrencyUtils.createFlowTaskId(mainTable.getTable(), entity.getDbLinkId()); + } + concurrencyUtils.createFlowEngine(mainTable.getTable(), entity.getDbLinkId()); + //判断自增是否匹配 + concurrencyUtils.checkAutoIncrement(primaryKeyPolicy,entity.getDbLinkId(),visualTables); + } + entity.setDraftJson(JsonUtil.getObjectToString(new FormDraftJsonModel().setDraftJson(entity.getDraftJson()).setTableJson(entity.getTableJson()))); + return this.updateById(entity); + } + + + @Override + public List getList(FlowFormPage flowFormPage) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(flowFormPage.getKeyword())) { + queryWrapper.lambda().like(FlowFormEntity::getFullName, flowFormPage.getKeyword()); + } + if (flowFormPage.getFlowType() != null) { + queryWrapper.lambda().eq(FlowFormEntity::getFlowType, flowFormPage.getFlowType()); + } + if (flowFormPage.getFormType() != null) { + queryWrapper.lambda().eq(FlowFormEntity::getFormType, flowFormPage.getFormType()); + } + if (flowFormPage.getEnabledMark() != null) { + queryWrapper.lambda().eq(FlowFormEntity::getEnabledMark, flowFormPage.getEnabledMark()); + } + if (flowFormPage.getFlowType() == null || !flowFormPage.getFlowType().equals(1)) { + queryWrapper.lambda().and(t -> t.ne(FlowFormEntity::getFlowType, 1).or().ne(FlowFormEntity::getFormType, 2)); + } + queryWrapper.lambda().orderByAsc(FlowFormEntity::getSortCode); + queryWrapper.lambda().orderByDesc(FlowFormEntity::getCreatorTime); + Page page = new Page<>(flowFormPage.getCurrentPage(), flowFormPage.getPageSize()); + IPage list = this.page(page, queryWrapper); + return flowFormPage.setData(list.getRecords(), list.getTotal()); + } + + @Override + public List getListForSelect(FlowFormPage flowFormPage) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(flowFormPage.getKeyword())) { + queryWrapper.lambda().like(FlowFormEntity::getFullName, flowFormPage.getKeyword()); + } + if (flowFormPage.getFlowType() != null) { + queryWrapper.lambda().eq(FlowFormEntity::getFlowType, flowFormPage.getFlowType()); + } + if (flowFormPage.getFormType() != null) { + queryWrapper.lambda().eq(FlowFormEntity::getFormType, flowFormPage.getFormType()); + } + queryWrapper.lambda().eq(FlowFormEntity::getEnabledMark, 1); + queryWrapper.lambda().orderByAsc(FlowFormEntity::getSortCode); + queryWrapper.lambda().orderByDesc(FlowFormEntity::getCreatorTime); + Page page = new Page<>(flowFormPage.getCurrentPage(), flowFormPage.getPageSize()); + IPage list = this.page(page, queryWrapper); + return flowFormPage.setData(list.getRecords(), list.getTotal()); + } + + @Override + public ActionResult release(String id, Integer isRelease) throws WorkFlowException { + FlowFormEntity byId = this.getById(id); + if (isRelease != null && isRelease == 0) {//回滚 + if (byId.getEnabledMark() != null && byId.getEnabledMark() == 1) { + FlowFormEntity entity = new FlowFormEntity(); + entity.setId(id); + entity.setState(1); + entity.setDraftJson(JsonUtil.getObjectToString(new FormDraftJsonModel().setDraftJson(byId.getPropertyJson()).setTableJson(byId.getTableJson()))); +// entity.setDraftJson(byId.getPropertyJson()); + this.updateById(entity); + return ActionResult.success("回滚成功"); + } else { + return ActionResult.fail("该表单未发布,无法回滚表单内容"); + } + } + if (isRelease != null && isRelease == 1) {//发布 + FormDraftJsonModel formDraft = JsonUtil.getJsonToBean(byId.getDraftJson(), FormDraftJsonModel.class); + if (StringUtil.isEmpty(formDraft.getDraftJson())) { + return ActionResult.fail("该模板内表单内容为空,无法发布!"); + } + FlowFormEntity entity = new FlowFormEntity(); + BeanUtils.copyProperties(byId, entity); + entity.setId(id); + entity.setEnabledMark(1); + entity.setState(1); + entity.setPropertyJson(formDraft.getDraftJson()); + entity.setTableJson(formDraft.getTableJson()); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(userProvider.get().getUserId()); + //判断是否要创表 + FormDataModel formDataModel = new FormDataModel(); + List tableModels = null; + Map formMap = null; + if (entity.getFormType() == 2 && formDraft.getDraftJson() != null) { + formDataModel = JsonUtil.getJsonToBean(formDraft.getDraftJson(), FormDataModel.class); + tableModels = JsonUtil.getJsonToList(formDraft.getTableJson(), TableModel.class); + formMap = JsonUtil.stringToMap(formDraft.getDraftJson()); + } + //是否开启安全锁 + Boolean concurrencyLock = formDataModel.getConcurrencyLock(); + int primaryKeyPolicy = formDataModel.getPrimaryKeyPolicy(); + Boolean logicalDelete = formDataModel.getLogicalDelete(); + //无表需要创表 + if (tableModels != null && tableModels.size() == 0) { + List list = JsonUtil.getJsonToList(formMap.get("fields"), FieLdsModel.class); + JSONArray formJsonArray = JsonUtil.getJsonToJsonArray(String.valueOf(formMap.get("fields"))); + List formAllModel = new ArrayList<>(); + RecursionForm recursionForm = new RecursionForm(); + recursionForm.setTableModelList(JsonUtil.getJsonToList(entity.getTableJson(), TableModel.class)); + recursionForm.setList(list); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + String tableName = "mt" + RandomUtil.uuId(); + String dbLinkId = entity.getDbLinkId(); + VisualTableModel model = new VisualTableModel(formJsonArray, formAllModel, tableName, dbLinkId, entity.getFullName(), concurrencyLock, primaryKeyPolicy, logicalDelete); + List tableModelList = formTableCre.tableList(model); + formMap.put("fields", formJsonArray); + //更新 + entity.setDraftJson(JsonUtil.getObjectToString(formMap)); + entity.setPropertyJson(JsonUtil.getObjectToString(formMap)); + entity.setTableJson(JsonUtil.getObjectToString(tableModelList)); + entity.setDraftJson(JsonUtil.getObjectToString(new FormDraftJsonModel().setDraftJson(entity.getDraftJson()).setTableJson(entity.getTableJson()))); + } + this.updateById(entity); + return ActionResult.success(MsgCode.SU011.get()); + } + return ActionResult.fail(MsgCode.FA011.get()); + } + + @Override + public boolean copyForm(String id) { + FlowFormEntity byId = this.getById(id); + FlowFormEntity entity = new FlowFormEntity(); + BeanUtils.copyProperties(byId, entity); + entity.setId(null); + entity.setPropertyJson(null); + if (byId.getEnabledMark() != null && byId.getEnabledMark() == 1) { + entity.setDraftJson(JsonUtil.getObjectToString(new FormDraftJsonModel().setDraftJson(byId.getPropertyJson()).setTableJson(entity.getTableJson()))); + } + String copyNum = UUID.randomUUID().toString().substring(0, 5); + entity.setFullName(byId.getFullName() + ".副本" + copyNum); + entity.setEnCode(byId.getEnCode() + copyNum); + entity.setEnabledMark(0); + entity.setState(0); + entity.setCreatorUserId(userProvider.get().getUserId()); + entity.setCreatorTime(new Date()); + return this.save(entity); + } + + + @Override + @DSTransactional + public ActionResult ImportData(FlowFormEntity entity) throws WorkFlowException { + if (entity != null) { + if (isExistByFullName(entity.getFullName(), null)) { + return ActionResult.fail("流程表单名称不能重复"); + } + if (isExistByEnCode(entity.getEnCode(), null)) { + return ActionResult.fail("流程表单编码不能重复"); + } + try { + entity.setCreatorTime(new Date()); + entity.setCreatorUserId(UserProvider.getLoginUserId()); + entity.setLastModifyTime(null); + entity.setLastModifyUserId(null); + this.saveOrUpdate(entity); + } catch (Exception e) { + throw new WorkFlowException(MsgCode.IMP003.get()); + } + return ActionResult.success(MsgCode.IMP001.get()); + } + return ActionResult.fail("导入数据格式不正确"); + } + + @Override + public List getFlowIdList(String flowId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowFormEntity::getFlowId, flowId); + return this.list(queryWrapper); + } + + @Override + public FlowTempInfoModel getFormById(String id) throws WorkFlowException { + FlowTempInfoModel model = new FlowTempInfoModel(); + FlowFormEntity form = this.getById(id); + if (form == null) { + throw new WorkFlowException("该功能未导入流程表单!"); + } + if (form != null && StringUtil.isNotEmpty(form.getFlowId())) { + model = this.baseMapper.findFLowInfo(form.getFlowId()); + } + if (model == null || StringUtil.isEmpty(model.getId())) { + throw new WorkFlowException("流程未设计,请先设计流程!"); + } + if (form.getFlowType() == 1 && form.getFormType() == 1 && model.getEnabledMark() != 1) { + //代码生成的功能流程需要判断流程是否启用。 + throw new WorkFlowException("该功能流程处于停用状态!"); + } + return model; + } + + @Override + public void updateForm(FlowFormEntity entity) { + UpdateWrapper wrapper = new UpdateWrapper<>(); + wrapper.lambda().eq(FlowFormEntity::getId, entity.getId()); + wrapper.lambda().set(FlowFormEntity::getFlowId, entity.getFlowId()); + this.update(wrapper); + } + + @Override + public void saveLogicFlowAndForm(String id) { + FlowFormEntity formEnt = this.getById(id); + if(formEnt!=null){ + formEnt.setDeleteMark(null); + this.updateById(formEnt); + } + } +} diff --git a/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/util/ConcurrencyUtils.java b/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/util/ConcurrencyUtils.java new file mode 100644 index 0000000..2c648d1 --- /dev/null +++ b/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/util/ConcurrencyUtils.java @@ -0,0 +1,141 @@ +package jnpf.util; + +import cn.hutool.core.bean.BeanUtil; +import jnpf.database.model.dbfield.DbFieldModel; +import jnpf.database.model.dbfield.base.DbFieldModelBase; +import jnpf.database.model.dbtable.DbTableFieldModel; +import jnpf.exception.WorkFlowException; +import jnpf.model.visualJson.TableModel; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.List; + +@Component +public class ConcurrencyUtils { + + @Autowired + private ServiceBaseUtil serviceUtil; + + /** + * 根据枚举获取字段对象 + * + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2023/1/14 + */ + public static DbFieldModel getDbFieldModel(TableFeildsEnum tableFeildsEnum) { + DbFieldModel dbFieldModel = new DbFieldModel(); + BeanUtil.copyProperties(tableFeildsEnum, dbFieldModel); + dbFieldModel.setIsPrimaryKey(tableFeildsEnum.getPrimaryKey()); + return dbFieldModel; + } + + /** + * 创建锁字段 + * + * @param table + * @param linkId + * @throws Exception + */ + public void createVersion(String table, String linkId) throws Exception { + addFeild(table, linkId,TableFeildsEnum.VERSION); + } + + /** + * 创建flowTaskId + * + * @param table + * @param linkId + * @throws Exception + */ + public void createFlowTaskId(String table, String linkId) throws Exception { + addFeild(table, linkId,TableFeildsEnum.FLOWTASKID); + } + + /** + * 创建租户id + * + * @param table + * @param linkId + * @throws Exception + */ + public void createTenantId(String table, String linkId) throws Exception { + addFeild(table, linkId,TableFeildsEnum.TENANTID); + } + + /** + * 创建删除字段 + * + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2023/1/14 + */ + public void creDeleteMark(String table, String linkId) throws Exception { + addFeild(table, linkId,TableFeildsEnum.DELETEMARK); + } + + /** + * 创建流程引擎id字段 + * + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2023/1/7 + */ + public void createFlowEngine(String table, String linkId) throws Exception { + addFeild(table, linkId,TableFeildsEnum.FLOWID); + } + + /** + * 新增字段通用方法 + * @param table + * @param linkId + * @param tableFeildsEnum + * @throws Exception + */ + private void addFeild(String table, String linkId,TableFeildsEnum tableFeildsEnum) throws Exception { + List fieldList = serviceUtil.getDbTableModel(linkId, table); + DbFieldModelBase dbFieldModel = fieldList.stream().filter(f -> f.getField().equalsIgnoreCase(tableFeildsEnum.getField())).findFirst().orElse(null); + boolean hasVersion = dbFieldModel!=null; + if (!hasVersion){ + DbTableFieldModel dbTableFieldModel = new DbTableFieldModel(); + DbFieldModel dbTableModel1 = this.getDbFieldModel(tableFeildsEnum); + List fieldOneList = new ArrayList<>(); + fieldOneList.add(dbTableModel1); + dbTableFieldModel.setDbFieldModelList(fieldOneList); + dbTableFieldModel.setUpdateNewTable(table); + dbTableFieldModel.setUpdateOldTable(table); + dbTableFieldModel.setDbLinkId(linkId); + serviceUtil.addField(dbTableFieldModel); + } + } + + + /** + * 判断表是否是自增id + * @param primaryKeyPolicy + * @param dbLinkId + * @param tableList + * @return + * @throws Exception + */ + public boolean checkAutoIncrement(int primaryKeyPolicy,String dbLinkId,List tableList) throws Exception { + boolean isIncre = primaryKeyPolicy == 2; + String strategy = primaryKeyPolicy == 1 ? "[雪花ID]" : "[自增长id]"; + for (TableModel tableModel : tableList) { + List data = serviceUtil.getFieldList(dbLinkId, tableModel.getTable()); + DbFieldModel dbFieldModel = data.stream().filter(DbFieldModel::getIsPrimaryKey).findFirst().orElse(null); + if (dbFieldModel == null) { + throw new WorkFlowException("表[" + tableModel.getTable() + " ]无主键!"); + } + if (!isIncre == (dbFieldModel.getIsAutoIncrement() != null && dbFieldModel.getIsAutoIncrement())) { + throw new WorkFlowException("主键策略:" + strategy + ",与表[" + tableModel.getTable() + "]主键策略不一致!"); + } + } + return true; + } +} diff --git a/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/util/DateTimeFormatConstant.java b/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/util/DateTimeFormatConstant.java new file mode 100644 index 0000000..229adf7 --- /dev/null +++ b/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/util/DateTimeFormatConstant.java @@ -0,0 +1,74 @@ +package jnpf.util; + +import cn.hutool.core.date.LocalDateTimeUtil; +import cn.hutool.core.util.ObjectUtil; + +import java.sql.Timestamp; +import java.time.LocalDateTime; +import java.util.Date; + +/** + * 时间格式 常量 + */ +public class DateTimeFormatConstant { + public static String YEAR="yyyy"; + public static String YEAR_MOnTH="yyyy-MM"; + public static String YEAR_MOnTH_DATE="yyyy-MM-dd"; + public static String YEAR_MOnTH_DHM="yyyy-MM-dd HH:mm"; + public static String YEAR_MOnTH_DHMS="yyyy-MM-dd HH:mm:ss"; + public static String HOUR_MINUTE="HH:mm"; + public static String HOUR_MINUTE_SECOND="HH:mm:ss"; + + /** + * 时间格式忽略大小写 + * @param otherFormat + * @return 返回固定格式 + */ + public static String getFormat(String otherFormat){ + if(YEAR.equalsIgnoreCase(otherFormat)){ + return YEAR; + } + if(YEAR_MOnTH.equalsIgnoreCase(otherFormat)){ + return YEAR_MOnTH; + } + if(YEAR_MOnTH_DATE.equalsIgnoreCase(otherFormat)){ + return YEAR_MOnTH_DATE; + } + if(YEAR_MOnTH_DHM.equalsIgnoreCase(otherFormat)){ + return YEAR_MOnTH_DHM; + } + if(YEAR_MOnTH_DHMS.equalsIgnoreCase(otherFormat)){ + return YEAR_MOnTH_DHMS; + } + if(HOUR_MINUTE.equalsIgnoreCase(otherFormat)){ + return HOUR_MINUTE; + } + if(HOUR_MINUTE_SECOND.equalsIgnoreCase(otherFormat)){ + return HOUR_MINUTE_SECOND; + } + return otherFormat; + } + + /** + * 数据库查询时间字段-转换成long + * 不同数据库查询结果的对象不同 + * @param dateObj + * @return long + */ + public static Long getDateObjToLong(Object dateObj){ + LocalDateTime dateTime = null; + if(ObjectUtil.isNotEmpty(dateObj)){ + if (dateObj instanceof LocalDateTime) { + dateTime = (LocalDateTime) dateObj; + } else if (dateObj instanceof Timestamp) { + dateTime = ((Timestamp) dateObj).toLocalDateTime(); + } else if (dateObj instanceof Long) { + dateTime = LocalDateTimeUtil.of(new Date(Long.parseLong(dateObj.toString()))); + } else { + dateTime = LocalDateTimeUtil.of(cn.hutool.core.date.DateUtil.parse(dateObj.toString())); + } + } + return dateTime != null ? DateUtil.localDateTime2Millis(dateTime) : null; + } + +} diff --git a/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/util/FlowFormCustomUtils.java b/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/util/FlowFormCustomUtils.java new file mode 100644 index 0000000..fa17ee9 --- /dev/null +++ b/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/util/FlowFormCustomUtils.java @@ -0,0 +1,337 @@ +package jnpf.util; + +import cn.hutool.core.util.ObjectUtil; +import jnpf.base.UserInfo; +import jnpf.database.model.entity.DbLinkEntity; +import jnpf.database.util.ConnUtil; +import jnpf.database.util.DynamicDataSourceUtil; +import jnpf.entity.FlowFormEntity; +import jnpf.exception.DataException; +import jnpf.exception.WorkFlowException; +import jnpf.mapper.FlowFormDataMapper; +import jnpf.model.flow.DataModel; +import jnpf.model.visualJson.FieLdsModel; +import jnpf.model.visualJson.FormCloumnUtil; +import jnpf.model.visualJson.FormDataModel; +import jnpf.model.visualJson.TableModel; +import jnpf.model.visualJson.analysis.FormAllModel; +import jnpf.model.visualJson.analysis.FormEnum; +import jnpf.model.visualJson.analysis.FormMastTableModel; +import jnpf.model.visualJson.analysis.RecursionForm; +import jnpf.permission.entity.UserEntity; +import jnpf.util.visiual.JnpfKeyConsts; +import lombok.Cleanup; +import org.mybatis.dynamic.sql.BasicColumn; +import org.mybatis.dynamic.sql.SqlBuilder; +import org.mybatis.dynamic.sql.SqlTable; +import org.mybatis.dynamic.sql.render.RenderingStrategies; +import org.mybatis.dynamic.sql.select.render.SelectStatementProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.sql.Connection; +import java.sql.SQLException; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 自定义流程表单处理 + * + * @author JNPF开发平台组 + * @version V3.4.5 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2022/10/21 + */ +@Component +public class FlowFormCustomUtils { + @Autowired + private UserProvider userProvider; + @Autowired + private FlowFormDataUtil flowDataUtil; + @Autowired + private FlowFormDataMapper flowFormDataMapper; + @Autowired + private FormInfoUtils formInfoUtils; + @Autowired + private FormCheckUtils formCheckUtils; + @Autowired + private ServiceBaseUtil serviceUtil; + + public void create(FlowFormEntity flowFormEntity, String id, Map map, UserEntity delegateUser) throws WorkFlowException { + FormDataModel formData = JsonUtil.getJsonToBean(flowFormEntity.getPropertyJson(), FormDataModel.class); + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + List tableModels = JsonUtil.getJsonToList(flowFormEntity.getTableJson(), TableModel.class); + DbLinkEntity linkEntity = serviceUtil.getDbLink(flowFormEntity.getDbLinkId()); + //是否开启并发锁 + Boolean concurrency = false; + Integer primaryKeyPolicy = formData.getPrimaryKeyPolicy(); + if (formData.getConcurrencyLock()) { + //初始化version值 + map.put(TableFeildsEnum.VERSION.getField(), 0); + concurrency = true; + } + //单行唯一校验 + String b = formCheckUtils.checkForm(list, map, linkEntity, tableModels, primaryKeyPolicy, formData.getLogicalDelete(), null); + if (StringUtil.isNotEmpty(b)) { + throw new WorkFlowException(b + "不能重复"); + } + String mainId = id; + UserEntity userEntity; + UserInfo userInfo = userProvider.get(); + if (delegateUser != null) { + delegateUser.setId(userInfo.getUserId()); + userEntity = delegateUser; + } else { + userEntity = serviceUtil.getUserInfo(userInfo.getUserId()); + } + DataModel dataModel = DataModel.builder().dataNewMap(map).fieLdsModelList(list).tableModelList(tableModels).mainId(mainId).link(linkEntity) + .userEntity(userEntity).concurrencyLock(concurrency).primaryKeyPolicy(primaryKeyPolicy).flowEnable(true).build(); + flowDataUtil.create(dataModel); + } + + public void update(FlowFormEntity flowFormEntity, String id, Map map) throws WorkFlowException, SQLException, DataException { + FormDataModel formData = JsonUtil.getJsonToBean(flowFormEntity.getPropertyJson(), FormDataModel.class); + List tableModels = JsonUtil.getJsonToList(flowFormEntity.getTableJson(), TableModel.class); + TableModel mainT = tableModels.stream().filter(t -> t.getTypeId().equals("1")).findFirst().orElse(null); + DbLinkEntity linkEntity = serviceUtil.getDbLink(flowFormEntity.getDbLinkId()); + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + //是否开启并发锁 + Boolean isConcurrencyLock = false; + Integer primaryKeyPolicy = formData.getPrimaryKeyPolicy(); + if (formData.getConcurrencyLock()) { + if (map.get(TableFeildsEnum.VERSION.getField()) == null) { + map.put(TableFeildsEnum.VERSION.getField(), 0); + } else { + boolean version = flowDataUtil.getVersion(mainT.getTable(), linkEntity, map, id, primaryKeyPolicy); + if (!version) { + throw new WorkFlowException("当前表单原数据已被调整,请重新进入该页面编辑并提交数据"); + } else { + Integer vs = Integer.valueOf(String.valueOf(map.get(TableFeildsEnum.VERSION.getField()))); + map.put(TableFeildsEnum.VERSION.getField(), vs + 1); + } + } + isConcurrencyLock = true; + } + + String b = formCheckUtils.checkForm(list, map, linkEntity, tableModels, primaryKeyPolicy, formData.getLogicalDelete(), id); + if (StringUtil.isNotEmpty(b)) { + throw new WorkFlowException(b + "不能重复"); + } + UserInfo userInfo = userProvider.get(); + UserEntity userEntity = serviceUtil.getUserInfo(userInfo.getUserId()); + DataModel dataModel = DataModel.builder().dataNewMap(map).fieLdsModelList(list).tableModelList(tableModels).mainId(id).link(linkEntity) + .userEntity(userEntity).concurrencyLock(isConcurrencyLock).primaryKeyPolicy(primaryKeyPolicy).flowEnable(true).build(); + flowDataUtil.update(dataModel); + } + + public void saveOrUpdate(FlowFormEntity flowFormEntity, String id, Map map, UserEntity delegateUser) throws WorkFlowException, SQLException, DataException { + FormDataModel formData = JsonUtil.getJsonToBean(flowFormEntity.getPropertyJson(), FormDataModel.class); + List tableModels = JsonUtil.getJsonToList(flowFormEntity.getTableJson(), TableModel.class); + TableModel mainT = tableModels.stream().filter(t -> t.getTypeId().equals("1")).findFirst().orElse(null); + DbLinkEntity linkEntity = serviceUtil.getDbLink(flowFormEntity.getDbLinkId()); + Integer primaryKeyPolicy = formData.getPrimaryKeyPolicy(); + SqlTable sqlTable = SqlTable.of(mainT.getTable()); + long count = formCheckUtils.getCount(id, sqlTable, mainT, linkEntity, primaryKeyPolicy); + if (count > 0) { + this.update(flowFormEntity, id, map); + } else { + this.create(flowFormEntity, id, map, delegateUser); + } + } + + public Map info(FlowFormEntity flowFormEntity, String id) { + Map allDataMap = new HashMap<>(); + + FormDataModel formData = JsonUtil.getJsonToBean(flowFormEntity.getPropertyJson(), FormDataModel.class); + //是否开启并发锁 + String version = ""; + if (formData.getConcurrencyLock()) { + //查询 + version = TableFeildsEnum.VERSION.getField(); + } + + Integer primaryKeyPolicy = formData.getPrimaryKeyPolicy(); + + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + List tableModelList = JsonUtil.getJsonToList(flowFormEntity.getTableJson(), TableModel.class); + RecursionForm recursionForm = new RecursionForm(); + recursionForm.setList(list); + recursionForm.setTableModelList(tableModelList); + List formAllModel = new ArrayList<>(); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + //form的属性 + List mast = formAllModel.stream().filter(t -> FormEnum.mast.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + List table = formAllModel.stream().filter(t -> FormEnum.table.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + List mastTable = formAllModel.stream().filter(t -> FormEnum.mastTable.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + + TableModel mainTable = tableModelList.stream().filter(t -> t.getTypeId().equals("1")).findFirst().orElse(null); + + DbLinkEntity linkEntity = serviceUtil.getDbLink(flowFormEntity.getDbLinkId()); + try { + DynamicDataSourceUtil.switchToDataSource(linkEntity); + @Cleanup Connection conn = ConnUtil.getConnOrDefault(linkEntity); + String databaseProductName = conn.getMetaData().getDatabaseProductName(); + boolean oracle = databaseProductName.equalsIgnoreCase("oracle"); + boolean IS_DM = databaseProductName.equalsIgnoreCase("DM DBMS"); + //获取主键 + String pKeyName = flowDataUtil.getKey(conn, mainTable.getTable(), primaryKeyPolicy); + SqlTable mainSqlTable = SqlTable.of(mainTable.getTable()); + SelectStatementProvider render = SqlBuilder.select(mainSqlTable.allColumns()).from(mainSqlTable).where(mainSqlTable.column(pKeyName), + SqlBuilder.isEqualTo(id)).build().render(RenderingStrategies.MYBATIS3); + Map mainAllMap = Optional.ofNullable(flowFormDataMapper.selectOneMappedRow(render)).orElse(new HashMap<>()); + if (mainAllMap.size() == 0) { + return new HashMap<>(); + } + //主表 + List mainTableFields = mast.stream().filter(m -> StringUtil.isNotEmpty(m.getFormColumnModel().getFieLdsModel().getVModel())) + .map(s -> + { + String jnpfKey = s.getFormColumnModel().getFieLdsModel().getConfig().getJnpfKey(); + String modelFiled = s.getFormColumnModel().getFieLdsModel().getVModel(); + if (oracle || IS_DM) { + List keyList = new ArrayList(){{ + add(JnpfKeyConsts.UPLOADFZ); + add(JnpfKeyConsts.UPLOADIMG); + add(JnpfKeyConsts.EDITOR); + add(JnpfKeyConsts.TEXTAREA); + }}; + if (keyList.contains(jnpfKey)) { + modelFiled = "dbms_lob.substr( " + modelFiled + ")"; + } + } + return modelFiled; + } + ).collect(Collectors.toList()); + if (StringUtil.isNotEmpty(version)) { + mainTableFields.add(version); + } + mainTableFields.add(pKeyName); + List mainTableBasicColumn = mainTableFields.stream().map(m -> { + if (m.contains("(")) { + String replace = m.replace("dbms_lob.substr(", ""); + String alisaName = replace.replace(")", ""); + return SqlTable.of(mainTable.getTable()).column(m).as(alisaName); + } else { + return SqlTable.of(mainTable.getTable()).column(m); + } + }).collect(Collectors.toList()); + SelectStatementProvider mainRender = SqlBuilder.select(mainTableBasicColumn).from(mainSqlTable).where(mainSqlTable.column(pKeyName), + SqlBuilder.isEqualTo(id)).build().render(RenderingStrategies.MYBATIS3); + Map mainMap = flowFormDataMapper.selectOneMappedRow(mainRender); + if (ObjectUtil.isNotEmpty(mainMap)) { + //转换主表里的数据 + List mainFieldList = mast.stream().filter(m -> StringUtil.isNotEmpty(m.getFormColumnModel().getFieLdsModel().getVModel())) + .map(t -> t.getFormColumnModel().getFieLdsModel()).collect(Collectors.toList()); + mainMap = formInfoUtils.swapDataInfoType(mainFieldList, mainMap); + allDataMap.putAll(mainMap); + } + + //列表子表 + Map> groupByTableNames = mastTable.stream().map(mt -> mt.getFormMastTableModel()).collect(Collectors.groupingBy(ma -> ma.getTable())); + Iterator>> entryIterator = groupByTableNames.entrySet().iterator(); + while (entryIterator.hasNext()) { + Map.Entry> next = entryIterator.next(); + String childTableName = next.getKey(); + List childMastTableList = next.getValue(); + TableModel childTableModel = tableModelList.stream().filter(t -> t.getTable().equals(childTableName)).findFirst().orElse(null); + SqlTable mastSqlTable = SqlTable.of(childTableName); + List mastTableBasicColumn = childMastTableList.stream().filter(m -> StringUtil.isNotEmpty(m.getField())) + .map(m -> { + String jnpfKey = m.getMastTable().getFieLdsModel().getConfig().getJnpfKey(); + String modelFiled = m.getField(); + String aliasName = ""; + if (oracle || IS_DM) { + List keyList = new ArrayList(){{ + add(JnpfKeyConsts.UPLOADFZ); + add(JnpfKeyConsts.UPLOADIMG); + add(JnpfKeyConsts.EDITOR); + add(JnpfKeyConsts.TEXTAREA); + }}; + if (keyList.contains(jnpfKey)) { + aliasName = m.getField(); + modelFiled = "dbms_lob.substr( " + modelFiled + ")"; + } + } + return StringUtil.isEmpty(aliasName) ? mastSqlTable.column(modelFiled) : mastSqlTable.column(modelFiled).as(aliasName); + }).collect(Collectors.toList()); + SelectStatementProvider mastRender = SqlBuilder.select(mastTableBasicColumn).from(mastSqlTable).where(mastSqlTable.column(childTableModel.getTableField()), + SqlBuilder.isEqualTo(id)).build().render(RenderingStrategies.MYBATIS3); + Map soloDataMap = flowFormDataMapper.selectOneMappedRow(mastRender); + if (ObjectUtil.isNotEmpty(soloDataMap)) { + Map renameKeyMap = new HashMap<>(); + for (Map.Entry entry : soloDataMap.entrySet()) { + FormMastTableModel model = childMastTableList.stream().filter(child -> child.getField().equalsIgnoreCase(String.valueOf(entry.getKey()))).findFirst().orElse(null); + renameKeyMap.put(model.getVModel(), entry.getValue()); + } + List columnChildFields = childMastTableList.stream().map(cl -> cl.getMastTable().getFieLdsModel()).collect(Collectors.toList()); + renameKeyMap = formInfoUtils.swapDataInfoType(columnChildFields, renameKeyMap); + allDataMap.putAll(renameKeyMap); + } + } + + //设计子表 + table.stream().map(t -> t.getChildList()).forEach( + t1 -> { + try { + String childTableName = t1.getTableName(); + TableModel tableModel = tableModelList.stream().filter(tm -> tm.getTable().equals(childTableName)).findFirst().orElse(null); + SqlTable childSqlTable = SqlTable.of(childTableName); + List childFields = t1.getChildList().stream().filter(t2 -> StringUtil.isNotEmpty(t2.getFieLdsModel().getVModel())) + .map( + t2 -> { + String jnpfKey = t2.getFieLdsModel().getConfig().getJnpfKey(); + String modelFiled = t2.getFieLdsModel().getVModel(); + String aliasName = ""; + if (oracle || IS_DM) { + List keyList = new ArrayList(){{ + add(JnpfKeyConsts.UPLOADFZ); + add(JnpfKeyConsts.UPLOADIMG); + add(JnpfKeyConsts.EDITOR); + add(JnpfKeyConsts.TEXTAREA); + }}; + if (keyList.contains(jnpfKey)) { + aliasName = t2.getFieLdsModel().getVModel(); + modelFiled = "dbms_lob.substr( " + modelFiled + ")"; + } + } + return StringUtil.isEmpty(aliasName) ? childSqlTable.column(modelFiled) : childSqlTable.column(modelFiled).as(aliasName); + }).collect(Collectors.toList()); + childFields.add(childSqlTable.column(tableModel.getTableField())); + String childKeyName = flowDataUtil.getKey(conn, childTableName, 1); + childFields.add(childSqlTable.column(childKeyName)); + SelectStatementProvider childRender = SqlBuilder.select(childFields).from(childSqlTable).where(childSqlTable.column(tableModel.getTableField()), + SqlBuilder.isEqualTo(id)).build().render(RenderingStrategies.MYBATIS3); + List> childMapList = flowFormDataMapper.selectManyMappedRows(childRender); + if (ObjectUtil.isNotEmpty(childMapList)) { + List childFieldModels = t1.getChildList().stream().map(t2 -> t2.getFieLdsModel()).collect(Collectors.toList()); + childMapList = childMapList.stream().map(c1 -> { + try { + return formInfoUtils.swapDataInfoType(childFieldModels, c1); + } catch (Exception e) { + e.printStackTrace(); + } + return c1; + }).collect(Collectors.toList()); + Map childMap = new HashMap<>(1); + childMap.put(t1.getTableModel(), childMapList); + allDataMap.putAll(childMap); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + ); + for (String key : allDataMap.keySet()) { + if (pKeyName.equalsIgnoreCase(key)) { + allDataMap.put("id" , allDataMap.get(key)); + break; + } + } + } catch (Exception e) { + e.printStackTrace(); + } finally { + DynamicDataSourceUtil.clearSwitchDataSource(); + } + return allDataMap; + } +} diff --git a/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/util/FlowFormDataUtil.java b/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/util/FlowFormDataUtil.java new file mode 100644 index 0000000..b1bdb77 --- /dev/null +++ b/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/util/FlowFormDataUtil.java @@ -0,0 +1,1472 @@ +package jnpf.util; + +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import jnpf.base.UserInfo; +import jnpf.config.ConfigValueUtil; +import jnpf.constant.MsgCode; +import jnpf.database.model.entity.DbLinkEntity; +import jnpf.database.util.ConnUtil; +import jnpf.database.util.DataSourceUtil; +import jnpf.database.util.DynamicDataSourceUtil; +import jnpf.exception.DataException; +import jnpf.exception.WorkFlowException; +import jnpf.mapper.FlowFormDataMapper; +import jnpf.model.flow.DataModel; +import jnpf.model.visualJson.FieLdsModel; +import jnpf.model.visualJson.FormCloumnUtil; +import jnpf.model.visualJson.TableModel; +import jnpf.model.visualJson.analysis.*; +import jnpf.permission.entity.OrganizeEntity; +import jnpf.permission.entity.PositionEntity; +import jnpf.permission.entity.UserEntity; +import jnpf.util.visiual.JnpfKeyConsts; +import lombok.Cleanup; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.map.CaseInsensitiveMap; +import org.mybatis.dynamic.sql.SqlBuilder; +import org.mybatis.dynamic.sql.SqlTable; +import org.mybatis.dynamic.sql.delete.render.DeleteStatementProvider; +import org.mybatis.dynamic.sql.insert.GeneralInsertDSL; +import org.mybatis.dynamic.sql.insert.render.GeneralInsertStatementProvider; +import org.mybatis.dynamic.sql.render.RenderingStrategies; +import org.mybatis.dynamic.sql.select.render.SelectStatementProvider; +import org.mybatis.dynamic.sql.update.UpdateDSL; +import org.mybatis.dynamic.sql.update.UpdateModel; +import org.mybatis.dynamic.sql.update.render.UpdateStatementProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.math.BigDecimal; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.stream.Collectors; + +@Component +@Slf4j +public class FlowFormDataUtil { + + @Autowired + private UserProvider userProvider; + @Autowired + private DataSourceUtil dataSourceUtil; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private ServiceBaseUtil serviceUtil; + @Autowired + private FlowFormDataMapper flowFormDataMapper; + + + /** + * 返回主键名称 + * + * @param conn + * @param mainTable + * @return + */ + public String getKey(Connection conn, String mainTable, Integer primaryKeyPolicy) throws SQLException { + String pKeyName = TableFeildsEnum.FID.getField(); + if (primaryKeyPolicy == 2) { + pKeyName = TableFeildsEnum.FLOWTASKID.getField(); + } else { + //catalog 数据库名 + String catalog = conn.getCatalog(); + @Cleanup ResultSet primaryKeyResultSet = conn.getMetaData().getPrimaryKeys(catalog, null, mainTable); + while (primaryKeyResultSet.next()) { + pKeyName = primaryKeyResultSet.getString("COLUMN_NAME" ); + } + primaryKeyResultSet.close(); + } + String databaseProductName = conn.getMetaData().getDatabaseProductName().trim(); + if (databaseProductName.contains("Oracle" ) || databaseProductName.contains("DM DBMS" )) { + pKeyName = pKeyName.toUpperCase(); + } + return pKeyName; + } + + /** + * 除流程外主键全用f_id + * + * @param isflow 是否开启流程 + * @param mainTable + * @return + */ + public String getKey(Connection conn, String mainTable, Integer primaryKeyPolicy, boolean isflow) throws SQLException { + //获取主键 + if (primaryKeyPolicy == 2 && !isflow) { + primaryKeyPolicy = 1; + } + return this.getKey(conn, mainTable, primaryKeyPolicy); + } + //---------------------------------------------信息--------------------------------------------- + + /** + * 信息 + * + * @param dataModel + * @return + * @throws WorkFlowException + */ + public Map info(DataModel dataModel) throws WorkFlowException { + Map result = new HashMap<>(); + try { + List fieLdsModelList = dataModel.getFieLdsModelList(); + List tableModelList = dataModel.getTableModelList(); + RecursionForm recursionForm = new RecursionForm(fieLdsModelList, tableModelList); + List formAllModel = new ArrayList<>(); + //递归遍历模板 + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + result = this.infoDataList(dataModel, formAllModel); + } catch (WorkFlowException e) { + log.error("查询异常:" + e.getMessage()); + throw new WorkFlowException(e.getMessage()); + } + return result; + } + + /** + * 获取所有数据 + * + * @param dataModel + * @param formAllModel + * @return + * @throws WorkFlowException + */ + private Map infoDataList(DataModel dataModel, List formAllModel) throws WorkFlowException { + //处理好的数据 + Map result = new HashMap<>(16); + List tableModelList = dataModel.getTableModelList(); + if (tableModelList.size() > 0) { + result = this.tableData(dataModel, formAllModel); + } else { + result = this.data(dataModel, formAllModel); + } + return result; + } + + /** + * 有表数据 + * + * @return + * @throws WorkFlowException + */ + private Map tableData(DataModel dataModel, List formAllModel) throws WorkFlowException { + Map data = new HashMap<>(); + String mainId = dataModel.getMainId(); + try { + DbLinkEntity link = dataModel.getLink(); + DynamicDataSourceUtil.switchToDataSource(link); + @Cleanup Connection conn = ConnUtil.getConnOrDefault(link); + List tableList = dataModel.getTableModelList(); + boolean isPolicy = !dataModel.getFlowEnable() && dataModel.getPrimaryKeyPolicy() == 2; + Integer primaryKeyPolicy = isPolicy ? 1 : dataModel.getPrimaryKeyPolicy(); + if (isPolicy) { + dataModel.setPrimaryKeyPolicy(primaryKeyPolicy); + } + Optional first = tableList.stream().filter(t -> "1".equals(t.getTypeId())).findFirst(); + if (!first.isPresent()) { + throw new WorkFlowException(MsgCode.COD001.get()); + } + String mastTableName = first.get().getTable(); + List mastForm = formAllModel.stream().filter(t -> FormEnum.mast.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + List mastFile = mastForm.stream().filter(t -> StringUtil.isNotEmpty(t.getFormColumnModel().getFieLdsModel().getVModel())).map(t -> t.getFormColumnModel().getFieLdsModel().getVModel()).collect(Collectors.toList()); + String pKeyName = this.getKey(conn, mastTableName, primaryKeyPolicy); + mastFile.add(pKeyName); + if (dataModel.getConcurrencyLock()) { + mastFile.add(TableFeildsEnum.VERSION.getField()); + } + String tenantDb = ""; + if ("PostgreSQL".equals(dataSourceUtil.getDbType()) && configValueUtil.isMultiTenancy()) { + tenantDb = userProvider.get().getTenantDbConnectionString() + "."; + } + //主表数据 + SqlTable mastSqlTable = SqlTable.of(mastTableName); + SelectStatementProvider mastRender = SqlBuilder.select(mastFile.stream().map(m -> mastSqlTable.column(m)).collect(Collectors.toList())).from(mastSqlTable).where(mastSqlTable.column(pKeyName), SqlBuilder.isEqualTo(mainId)).build().render(RenderingStrategies.MYBATIS3); + Map mastData = flowFormDataMapper.selectOneMappedRow(mastRender); + Map mastDataAll = new HashMap<>(); + for (String key : mastData.keySet()) { + Object value = mastData.get(key); + FormAllModel formAll = mastForm.stream().filter(t -> key.equals(t.getFormColumnModel().getFieLdsModel().getVModel().toLowerCase())).findFirst().orElse(null); + String dataKey = key; + if (formAll != null) { + FieLdsModel fieLdsModel = formAll.getFormColumnModel().getFieLdsModel(); + dataKey = fieLdsModel.getVModel(); + value = this.info(fieLdsModel, value, true); + } + mastDataAll.put(dataKey, value); + } + data.putAll(mastDataAll); + //子表数据 + List tableForm = formAllModel.stream().filter(t -> FormEnum.table.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + Map childData = new HashMap<>(); + for (FormAllModel model : tableForm) { + FormColumnTableModel childList = model.getChildList(); + String tableName = childList.getTableName(); + String tableModel = childList.getTableModel(); + String childKey = this.getKey(conn, tableName, 1); + List childFile = childList.getChildList().stream().filter(t -> StringUtil.isNotEmpty(t.getFieLdsModel().getVModel())).map(t -> t.getFieLdsModel().getVModel()).collect(Collectors.toList()); + Optional first1 = tableList.stream().filter(t -> t.getTable().equals(tableName)).findFirst(); + if (!first1.isPresent()) { + throw new WorkFlowException(MsgCode.COD001.get()); + } + TableModel table = first1.get(); + SqlTable childSqlTable = SqlTable.of(tableName); + SelectStatementProvider childRender = SqlBuilder.select(childFile.stream().map(m -> childSqlTable.column(m)).collect(Collectors.toList())) + .from(childSqlTable).where(childSqlTable.column(table.getTableField()), SqlBuilder.isEqualTo(mainId)) + .orderBy(childSqlTable.column(childKey)) + .build().render(RenderingStrategies.MYBATIS3); + List> tableDataList = flowFormDataMapper.selectManyMappedRows(childRender); + List> tableDataAll = new LinkedList<>(); + //子表赋值 + for (Map tableData : tableDataList) { + Map childDataOne = new HashMap<>(); + for (String key : tableData.keySet()) { + Object value = tableData.get(key); + FieLdsModel fieLdsModel = childList.getChildList().stream().filter(t -> key.equals(t.getFieLdsModel().getVModel().toLowerCase())).map(t -> t.getFieLdsModel()).findFirst().orElse(null); + value = this.info(fieLdsModel, value, true); + String dataKey = fieLdsModel.getVModel(); + childDataOne.put(dataKey, value); + } + tableDataAll.add(childDataOne); + } + childData.put(tableModel, tableDataAll); + } + data.putAll(childData); + //副表 + Map> mastTableAll = formAllModel.stream().filter(t -> FormEnum.mastTable.getMessage().equals(t.getJnpfKey())).collect(Collectors.groupingBy(e -> e.getFormMastTableModel().getTable())); + for (String key : mastTableAll.keySet()) { + Optional first1 = tableList.stream().filter(t -> t.getTable().equals(key)).findFirst(); + if (!first1.isPresent()) { + throw new WorkFlowException(MsgCode.COD001.get()); + } + TableModel tableModel = first1.get(); + String table = tableModel.getTable(); + List mastTableList = mastTableAll.get(key); + List field = mastTableList.stream().filter(t -> StringUtil.isNotEmpty(t.getFormMastTableModel().getField())).map(t -> t.getFormMastTableModel().getField()).collect(Collectors.toList()); + SqlTable matable = SqlTable.of(table); + SelectStatementProvider childRender = SqlBuilder.select(field.stream().map(m -> matable.column(m)).collect(Collectors.toList())) + .from(matable).where(matable.column(tableModel.getTableField()), SqlBuilder.isEqualTo(mainId)) + .build().render(RenderingStrategies.MYBATIS3); + Map dataAll = flowFormDataMapper.selectOneMappedRow(childRender); + Map mastTable = new HashMap<>(); + for (String mastKey : dataAll.keySet()) { + Object value = dataAll.get(mastKey); + FieLdsModel fieLdsModel = mastTableList.stream().filter(t -> mastKey.equals(t.getFormMastTableModel().getField().toLowerCase())).map(t -> t.getFormMastTableModel().getMastTable().getFieLdsModel()).findFirst().orElse(null); + value = this.info(fieLdsModel, value, true); + String dataKey = fieLdsModel.getVModel(); + mastTable.put(dataKey, value); + } + data.putAll(mastTable); + } + } catch (SQLException | DataException e) { + log.error("查询异常:{}" , e.getMessage()); + throw new WorkFlowException(e.getMessage()); + } finally { + DynamicDataSourceUtil.clearSwitchDataSource(); + } + return data; + } + + /** + * 无表数据 + * + * @return + */ + private Map data(DataModel dataModel, List formAllModel) { + Map dataMap = dataModel.getDataNewMap(); + Map result = new HashMap<>(); + List mastForm = formAllModel.stream().filter(t -> FormEnum.mast.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + List tableForm = formAllModel.stream().filter(t -> FormEnum.table.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + for (String key : dataMap.keySet()) { + FormAllModel model = mastForm.stream().filter(t -> key.equals(t.getFormColumnModel().getFieLdsModel().getVModel())).findFirst().orElse(null); + if (model != null) { + FieLdsModel fieLdsModel = model.getFormColumnModel().getFieLdsModel(); + Object data = dataMap.get(key); + data = this.info(fieLdsModel, data, false); + result.put(key, data); + } else { + FormAllModel childModel = tableForm.stream().filter(t -> key.equals(t.getChildList().getTableModel())).findFirst().orElse(null); + if (childModel != null) { + String childKeyName = childModel.getChildList().getTableModel(); + List> childDataMap = (List>) dataMap.get(key); + List> childdataAll = new ArrayList<>(); + for (Map child : childDataMap) { + Map tablValue = new HashMap<>(16); + for (String childKey : child.keySet()) { + FormColumnModel columnModel = childModel.getChildList().getChildList().stream().filter(t -> childKey.equals(t.getFieLdsModel().getVModel())).findFirst().orElse(null); + if (columnModel != null) { + FieLdsModel fieLdsModel = columnModel.getFieLdsModel(); + Object childValue = child.get(childKey); + childValue = this.info(fieLdsModel, childValue, false); + tablValue.put(childKey, childValue); + } + } + childdataAll.add(tablValue); + } + result.put(childKeyName, childdataAll); + } + } + } + return result; + } + + /** + * 系统转换赋值 + **/ + private Object info(FieLdsModel fieLdsModel, Object dataValue, boolean isTable) { + Object value = dataValue; + String jnpfKey = fieLdsModel.getConfig().getJnpfKey(); + String format = fieLdsModel.getFormat(); + boolean multiple = fieLdsModel.getMultiple(); + String showLevel = fieLdsModel.getShowLevel(); + switch (jnpfKey) { + case JnpfKeyConsts.CURRORGANIZE: + case JnpfKeyConsts.CURRDEPT: + value = this.getCurrentOrganizeName(String.valueOf(value),fieLdsModel.getShowLevel()); + break; + case JnpfKeyConsts.CREATEUSER: + case JnpfKeyConsts.MODIFYUSER: + if (ObjectUtil.isNotEmpty(value)) { + UserEntity userEntity = serviceUtil.getUserInfo(String.valueOf(value)); + if (userEntity != null) { + value = userEntity.getRealName() + "/" + userEntity.getAccount(); + } + } else { + value = JnpfKeyConsts.CREATEUSER.equals(jnpfKey) ? " " : null; + } + break; + case JnpfKeyConsts.CURRPOSITION: + if (ObjectUtil.isNotEmpty(value)) { + PositionEntity positionEntity = serviceUtil.getPositionInfo(String.valueOf(value)); + if (positionEntity != null) { + value = positionEntity.getFullName(); + } + } else { + value = " "; + } + break; + case JnpfKeyConsts.UPLOADFZ: + case JnpfKeyConsts.UPLOADIMG: + if (value == null) { + value = new ArrayList<>(); + } else { + if (isTable) { + value = JsonUtil.getJsonToListMap(String.valueOf(value)); + } + } + break; + case JnpfKeyConsts.CHECKBOX: + case JnpfKeyConsts.DATERANGE: + case JnpfKeyConsts.TIMERANGE: + if (value == null) { + value = new ArrayList<>(); + } else { + if (isTable) { + value = JsonUtil.getJsonToList(String.valueOf(value), String.class); + } + } + break; + case JnpfKeyConsts.COMSELECT: + case JnpfKeyConsts.ADDRESS: + if (isTable) { + if (multiple) { + value = JsonUtil.getJsonToBean(String.valueOf(value), String[][].class); + } else { + value = JsonUtil.getJsonToList(String.valueOf(value), String.class); + } + } + break; + case JnpfKeyConsts.SELECT: + case JnpfKeyConsts.USERSELECT: + case JnpfKeyConsts.CUSTOMUSERSELECT: + case JnpfKeyConsts.DEPSELECT: + case JnpfKeyConsts.POSSELECT: + case JnpfKeyConsts.TREESELECT: + case JnpfKeyConsts.ROLESELECT: + case JnpfKeyConsts.GROUPSELECT: + if (isTable) { + if (multiple) { + value = JsonUtil.getJsonToList(String.valueOf(value), String.class); + } + } + break; + case JnpfKeyConsts.POPUPTABLESELECT: + if (isTable) { + try { + value = JsonUtil.getJsonToList(String.valueOf(value), String.class); + } catch (Exception e) { + } + } + break; + case JnpfKeyConsts.DATE: + if (isTable) { + try { + SimpleDateFormat sdf = new SimpleDateFormat(format); + value = sdf.parse(String.valueOf(value)).getTime(); + } catch (Exception e) { + } + } + break; + case JnpfKeyConsts.SLIDER: + case JnpfKeyConsts.SWITCH: + if (isTable) { + try { + value = Integer.valueOf(String.valueOf(value)); + } catch (Exception e) { + } + } + break; + case JnpfKeyConsts.CASCADER: + if (value == null) { + value = new ArrayList<>(); + } else { + if (isTable) { + if (fieLdsModel.getMultiple()) { + value = JsonUtil.getJsonToBean(String.valueOf(value), String[][].class); + } else { + value = JsonUtil.getJsonToList(String.valueOf(value), String.class); + } + } + } + break; + default: + break; + } + return value; + } + + //---------------------------------------------新增--------------------------------------------- + + /** + * 新增数据处理 + **/ + @DSTransactional + public Map create(DataModel dataModel) throws WorkFlowException { + try { + List fieLdsModelList = dataModel.getFieLdsModelList(); + List tableModelList = dataModel.getTableModelList(); + RecursionForm recursionForm = new RecursionForm(fieLdsModelList, tableModelList); + List formAllModel = new ArrayList<>(); + //递归遍历模板 + FormCloumnUtil.recursionForm(recursionForm, formAllModel); +// addField(tableModelList, dataModel.getLink()); + //处理好的数据 + Map result = this.createDataList(dataModel, formAllModel); + return result; + } catch (Exception e) { + //close + e.printStackTrace(); + log.error("新增异常:{}" , e.getMessage()); + throw new WorkFlowException(MsgCode.FA028.get()); + } + } + + /** + * 新增数据 + **/ + public Map createDataList(DataModel dataModel, List formAllModel) throws SQLException, DataException { + //处理好的数据 + Map result = new HashMap<>(16); + List tableModelList = dataModel.getTableModelList(); + //有表数据处理 + if (tableModelList.size() > 0) { + DbLinkEntity link = dataModel.getLink(); + DynamicDataSourceUtil.switchToDataSource(link); + try { + @Cleanup Connection conn = ConnUtil.getConnOrDefault(link); + String databaseProductName = conn.getMetaData().getDatabaseProductName().trim(); + boolean oracle = databaseProductName.contains("Oracle" ) || databaseProductName.contains("PostgreSQL" ); + dataModel.setIsOracle(oracle); + //主表 + this.createMast(formAllModel, dataModel, conn, result); + //子表 + this.createTable(formAllModel, dataModel, conn, result); + //副表 + this.createMastTable(formAllModel, dataModel, conn, result); + } finally { + DynamicDataSourceUtil.clearSwitchDataSource(); + } + } else { + //无表数据处理 + result = this.createAll(dataModel, formAllModel); + } + return result; + } + + /** + * 子表数据 + **/ + private void createTable(List formAllModel, DataModel dataModel, Connection conn, Map result) throws SQLException { + List tableModelList = dataModel.getTableModelList(); + Map dataNewMap = dataModel.getDataNewMap(); + Boolean isOracle = dataModel.getIsOracle(); + Integer primaryKeyPolicy = dataModel.getPrimaryKeyPolicy(); + String mainId = dataModel.getMainId(); + UserEntity userEntity = dataModel.getUserEntity(); + //子表 + List tableForm = formAllModel.stream().filter(t -> FormEnum.table.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + Map> childMap = new HashMap<>(); + Map chidTable = new HashMap<>(); + tableForm.stream().forEach(t -> { + FormColumnTableModel childListAll = t.getChildList(); + String tableModel = childListAll.getTableModel(); + List childList = childListAll.getChildList().stream().filter(g -> StringUtil.isNotEmpty(g.getFieLdsModel().getVModel())).collect(Collectors.toList()); + childMap.put(tableModel, childList); + String tableName = childListAll.getTableName(); + Optional first = tableModelList.stream().filter(k -> k.getTable().equals(tableName)).findFirst(); + if (first.isPresent()) { + TableModel childTable = first.get(); + chidTable.put(tableModel, childTable); + } + }); + for (String key : childMap.keySet()) { + //子表数据 + List> chidList = dataNewMap.get(key) != null ? (List>) dataNewMap.get(key) : new ArrayList<>(); + List formColumnModels = childMap.get(key); + Map columMap = new HashMap<>(); + List filedModel = new ArrayList<>(); + //子表主键 + TableModel tableModel = chidTable.get(key); + String table = tableModel.getTable(); + String childKeyName = this.getKey(conn, table, 1); + //获取子表对象的类型 + for (FormColumnModel column : formColumnModels) { + FieLdsModel fieLdsModel = column.getFieLdsModel(); + String vmodel = fieLdsModel.getVModel(); + columMap.put(vmodel, fieLdsModel); + } + //关联字段 + Optional first = tableModelList.stream().filter(t -> t.getTable().equals(table)).findFirst(); + String mastKeyName = ""; + if (first.isPresent()) { + mastKeyName = first.get().getTableField(); + } + SqlTable sqlTable = SqlTable.of(table); + for (Map objectMap : chidList) { + GeneralInsertDSL generalInsertDSL = SqlBuilder.insertInto(sqlTable).set(sqlTable.column(mastKeyName)).toValue(mainId); + for (String childKey : columMap.keySet()) { + FieLdsModel fieLdsModel = columMap.get(childKey); + String jnpfkey = fieLdsModel.getConfig().getJnpfKey(); + Object data = objectMap.get(childKey); + //处理系统自动生成 + data = this.create(fieLdsModel, data, true, userEntity, dataModel.isLinkOpen()); + getDSL(isOracle, sqlTable, null,generalInsertDSL, fieLdsModel.getFormat(), jnpfkey, childKey, data); + } + if (primaryKeyPolicy == 1) { + generalInsertDSL = generalInsertDSL.set(sqlTable.column(childKeyName)).toValue(RandomUtil.uuId()); + } + GeneralInsertStatementProvider insertRender = generalInsertDSL.build().render(RenderingStrategies.MYBATIS3); + flowFormDataMapper.generalInsert(insertRender); + } + String tenantDb = ""; + if ("PostgreSQL".equals(dataSourceUtil.getDbType()) && configValueUtil.isMultiTenancy()) { + tenantDb = userProvider.get().getTenantDbConnectionString() + "."; + } + } + } + + /** + * 副表数据 + **/ + private void createMastTable(List formAllModel, DataModel dataModel, Connection conn, Map result) throws SQLException { + List tableModelList = dataModel.getTableModelList(); + Map dataNewMap = dataModel.getDataNewMap(); + Boolean isOracle = dataModel.getIsOracle(); + Integer primaryKeyPolicy = dataModel.getPrimaryKeyPolicy(); + String mainId = dataModel.getMainId(); + UserEntity userEntity = dataModel.getUserEntity(); + //副表 + Map> mastTableAll = formAllModel.stream().filter(t -> FormEnum.mastTable.getMessage().equals(t.getJnpfKey())).collect(Collectors.groupingBy(e -> e.getFormMastTableModel().getTable())); + for (String key : mastTableAll.keySet()) { + Optional first = tableModelList.stream().filter(t -> t.getTable().equals(key)).findFirst(); + if (!first.isPresent()) { + throw new SQLException(MsgCode.COD001.get()); + } + TableModel tableModel = first.get(); + String tableModelTable = tableModel.getTable(); + String childKeyName = this.getKey(conn, tableModelTable, 1); + //关联字段 + String mastKeyName = tableModel.getTableField(); + List masTableList = mastTableAll.get(key); + SqlTable sqlTable = SqlTable.of(tableModelTable); + GeneralInsertDSL generalInsertDSL = SqlBuilder.insertInto(sqlTable).set(sqlTable.column(mastKeyName)).toValue(mainId); + + for (FormAllModel model : masTableList) { + FormMastTableModel formMastTableModel = model.getFormMastTableModel(); + FormColumnModel mastTable = formMastTableModel.getMastTable(); + FieLdsModel fieLdsModel = mastTable.getFieLdsModel(); + String mostTableKey = fieLdsModel.getVModel(); + if (StringUtil.isEmpty(mostTableKey)) { + continue; + } + String jnpfkey = fieLdsModel.getConfig().getJnpfKey(); + Object data = dataNewMap.get(mostTableKey); + //处理系统自动生成 + data = this.create(fieLdsModel, data, true, userEntity, dataModel.isLinkOpen()); + //返回值 + result.put(mostTableKey, data); + //添加字段 + String field = formMastTableModel.getField(); + getDSL(isOracle, sqlTable, null,generalInsertDSL, fieLdsModel.getFormat(), jnpfkey, field, data); + } + //sql主键 + if (primaryKeyPolicy == 1) { + generalInsertDSL = generalInsertDSL.set(sqlTable.column(childKeyName)).toValue(RandomUtil.uuId()); + } + String tenantDb = ""; + if ("PostgreSQL".equals(dataSourceUtil.getDbType()) && configValueUtil.isMultiTenancy()) { + tenantDb = userProvider.get().getTenantDbConnectionString() + "."; + } + GeneralInsertStatementProvider insertRender = generalInsertDSL.build().render(RenderingStrategies.MYBATIS3); + flowFormDataMapper.generalInsert(insertRender); + } + } + + /** + * 主表数据 + **/ + private void createMast(List formAllModel, DataModel dataModel, Connection conn, Map result) throws SQLException { + List tableModelList = dataModel.getTableModelList(); + Map dataNewMap = dataModel.getDataNewMap(); + Boolean isOracle = dataModel.getIsOracle(); + String mainId = dataModel.getMainId(); + UserEntity userEntity = dataModel.getUserEntity(); + Integer primaryKeyPolicy = dataModel.getPrimaryKeyPolicy(); + Optional first = tableModelList.stream().filter(t -> "1".equals(t.getTypeId())).findFirst(); + if (!first.isPresent()) { + throw new SQLException(MsgCode.COD001.get()); + } + TableModel tableModel = first.get(); + String mastTableName = tableModel.getTable(); + List mastForm = formAllModel.stream().filter(t -> FormEnum.mast.getMessage().equals(t.getJnpfKey())).filter(t -> StringUtil.isNotEmpty(t.getFormColumnModel().getFieLdsModel().getVModel())).collect(Collectors.toList()); + //新增字段 + List filedModel = new ArrayList<>(); + List mastData = new LinkedList<>(); + String keyName = this.getKey(conn, mastTableName, primaryKeyPolicy); + + SqlTable sqlTable = SqlTable.of(mastTableName); + GeneralInsertDSL generalInsertDSL = SqlBuilder.insertInto(sqlTable).set(sqlTable.column(keyName)).toValue(mainId); + + for (FormAllModel model : mastForm) { + FieLdsModel fieLdsModel = model.getFormColumnModel().getFieLdsModel(); + String jnpfkey = fieLdsModel.getConfig().getJnpfKey(); + String field = fieLdsModel.getVModel(); + Object data = dataNewMap.get(field); + data = data instanceof List ? JsonUtil.getObjectToString(data) : data; + //处理系统自动生成 + data = this.create(fieLdsModel, data, true, userEntity, dataModel.isLinkOpen()); + getDSL(isOracle, sqlTable, null,generalInsertDSL, fieLdsModel.getFormat(), jnpfkey, field, data); + } + //判断是否开启锁 + if (dataModel.getConcurrencyLock()) { + generalInsertDSL = generalInsertDSL.set(sqlTable.column(TableFeildsEnum.VERSION.getField())).toValue(dataNewMap.get(TableFeildsEnum.VERSION.getField())); + } + //添加流程引擎信息 + if (dataNewMap.get(FlowFormConstant.FLOWID) != null && StringUtil.isNotEmpty(dataNewMap.get(FlowFormConstant.FLOWID).toString())) { + generalInsertDSL = generalInsertDSL.set(sqlTable.column(TableFeildsEnum.FLOWID.getField())).toValue(dataNewMap.get(FlowFormConstant.FLOWID)); + } + + //新增sql语句 + String tenantDb = ""; + if ("PostgreSQL".equals(dataSourceUtil.getDbType()) && configValueUtil.isMultiTenancy()) { + tenantDb = userProvider.get().getTenantDbConnectionString() + "."; + } + + GeneralInsertStatementProvider insertRender = generalInsertDSL.build().render(RenderingStrategies.MYBATIS3); + flowFormDataMapper.generalInsert(insertRender); + Boolean flowEnable = dataModel.getFlowEnable(); + if (!flowEnable && primaryKeyPolicy == 2) { + List mastFile = new ArrayList<>(); + mastFile.add(keyName); + String idName = this.getKey(conn, mastTableName, 1); + mastFile.add(idName); + SqlTable mastSqlTable = SqlTable.of(mastTableName); + SelectStatementProvider mastRender = SqlBuilder.select(mastFile.stream().map(m -> mastSqlTable.column(m)).collect(Collectors.toList())).from(mastSqlTable). + where(mastSqlTable.column(keyName), SqlBuilder.isEqualTo(mainId)).build().render(RenderingStrategies.MYBATIS3); + Map map = flowFormDataMapper.selectOneMappedRow(mastRender); + dataModel.setMainId(map.get(idName) != null ? String.valueOf(map.get(idName)) : dataModel.getMainId()); + } + } + + /** + * 新增系统赋值 + **/ + private Object create(FieLdsModel fieLdsModel, Object dataValue, boolean isTable, UserEntity userEntity, boolean isLink) { + String jnpfKey = fieLdsModel.getConfig().getJnpfKey(); + String rule = fieLdsModel.getConfig().getRule(); + String format = DateTimeFormatConstant.getFormat(fieLdsModel.getFormat()); + Object value = dataValue; + //外链跳过系统参数生成 + if (isLink) { + value = linkDefaultValue(dataValue, isTable, jnpfKey, value); + return value; + } + switch (jnpfKey) { + case JnpfKeyConsts.CREATEUSER: + value = userEntity.getId(); + break; + case JnpfKeyConsts.CREATETIME: + value = new Date(); + break; + case JnpfKeyConsts.CURRORGANIZE: + case JnpfKeyConsts.CURRDEPT: + value = this.getCurrentOrgIds(userEntity.getOrganizeId(),fieLdsModel.getShowLevel()); + break; + case JnpfKeyConsts.MODIFYTIME: + value = null; + break; + case JnpfKeyConsts.MODIFYUSER: + value = null; + break; + case JnpfKeyConsts.CURRPOSITION: + value = userEntity.getPositionId(); + break; + case JnpfKeyConsts.BILLRULE: + try { + value = serviceUtil.getBillNumber(rule); + } catch (Exception e) { + value = null; + } + break; + case JnpfKeyConsts.DATE: + if (isTable) { + try { + if (dataValue == null || "".equals(dataValue)) { + return null; + } + if (dataValue instanceof String) { + try { + SimpleDateFormat formatter = new SimpleDateFormat(format); + value = formatter.parse(dataValue.toString()); + } catch (ParseException var3) { + return null; + } + } else { + value = new Date(Long.valueOf(String.valueOf(dataValue))); + } + } catch (Exception e) { + } + } + break; + case JnpfKeyConsts.NUM_INPUT: + case JnpfKeyConsts.CALCULATE: + if (isTable) { + try { + value = new BigDecimal(String.valueOf(dataValue)); + } catch (Exception e) { + + } + } + break; + default: + if (isTable) { + value = this.valueToNull(value); + } + break; + } + return value; + } + + /** + * 外链控件字段数据转换 + * + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2023/3/8 + */ + private Object linkDefaultValue(Object dataValue, boolean isTable, String jnpfKey, Object value) { + switch (jnpfKey) { + case JnpfKeyConsts.DATE: + if (isTable) { + try { + if (dataValue == null || "".equals(dataValue)) { + return null; + } + value = DateUtil.dateToString(new Date(Long.valueOf(String.valueOf(dataValue))), "yyyy-MM-dd HH:mm:ss" ); + } catch (Exception e) { + + } + } + break; + case JnpfKeyConsts.NUM_INPUT: + case JnpfKeyConsts.CALCULATE: + if (isTable) { + try { + value = new BigDecimal(String.valueOf(dataValue)); + } catch (Exception e) { + + } + } + break; + default: + if (isTable) { + value = this.valueToNull(value); + } + break; + } + return value; + } + + /** + * 无表插入数据 + **/ + private Map createAll(DataModel dataModel, List formAllModel) { + Map dataNewMap = dataModel.getDataNewMap(); + UserEntity userEntity = dataModel.getUserEntity(); + //处理好的数据 + Map result = new HashMap<>(16); + List mastForm = formAllModel.stream().filter(t -> FormEnum.mast.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + List tableForm = formAllModel.stream().filter(t -> FormEnum.table.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + for (String key : dataNewMap.keySet()) { + FormAllModel model = mastForm.stream().filter(t -> key.equals(t.getFormColumnModel().getFieLdsModel().getVModel())).findFirst().orElse(null); + if (model != null) { + FieLdsModel fieLdsModel = model.getFormColumnModel().getFieLdsModel(); + Object data = dataNewMap.get(key); + //处理系统自动生成 + data = this.create(fieLdsModel, data, false, userEntity, dataModel.isLinkOpen()); + result.put(key, data); + } else { + FormAllModel childModel = tableForm.stream().filter(t -> key.equals(t.getChildList().getTableModel())).findFirst().orElse(null); + if (childModel != null) { + //子表主键 + List childList = childModel.getChildList().getChildList(); + List> childDataMap = (List>) dataNewMap.get(key); + //子表处理的数据 + List> childResult = new ArrayList<>(); + for (Map objectMap : childDataMap) { + //子表单体处理的数据 + Map childOneResult = new HashMap<>(16); + for (String childKey : objectMap.keySet()) { + FormColumnModel columnModel = childList.stream().filter(t -> childKey.equals(t.getFieLdsModel().getVModel())).findFirst().orElse(null); + if (columnModel != null) { + FieLdsModel fieLdsModel = columnModel.getFieLdsModel(); + Object data = objectMap.get(childKey); + //处理系统自动生成 + data = this.create(fieLdsModel, data, false, userEntity, dataModel.isLinkOpen()); + childOneResult.put(childKey, data); + } + } + childResult.add(childOneResult); + } + result.put(key, childResult); + } + } + } + return result; + } + + //--------------------------------------------修改 ---------------------------------------------------- + + /** + * 修改数据处理 + **/ + @DSTransactional + public Map update(DataModel dataModel) throws WorkFlowException { + try { + List fieLdsModelList = dataModel.getFieLdsModelList(); + List tableModelList = dataModel.getTableModelList(); + RecursionForm recursionForm = new RecursionForm(fieLdsModelList, tableModelList); + List formAllModel = new ArrayList<>(); + //递归遍历模板 + FormCloumnUtil.recursionForm(recursionForm, formAllModel); +// addField(tableModelList, dataModel.getLink()); + //处理好的数据 + Map result = this.updateDataList(dataModel, formAllModel); + return result; + } catch (Exception e) { + //close + e.printStackTrace(); + log.error("修改异常:{}" , e.getMessage()); + throw new WorkFlowException(MsgCode.FA029.get()); + } + } + + /** + * 修改数据 + **/ + public Map updateDataList(DataModel dataModel, List formAllModel) throws SQLException, DataException { + //处理好的数据 + Map result = new HashMap<>(16); + List tableModelList = dataModel.getTableModelList(); + //有表数据处理 + if (tableModelList.size() > 0) { + DbLinkEntity link = dataModel.getLink(); + DynamicDataSourceUtil.switchToDataSource(link); + try { + //系统数据 + @Cleanup Connection conn = ConnUtil.getConnOrDefault(link); + String databaseProductName = conn.getMetaData().getDatabaseProductName().trim(); + boolean oracle = databaseProductName.contains("Oracle" ) || databaseProductName.contains("PostgreSQL" ); + dataModel.setIsOracle(oracle); + conn.setAutoCommit(false); + //主表 + this.updateMast(formAllModel, dataModel, conn, result); + //子表 + this.updateTable(formAllModel, dataModel, conn, result); + //副表 + this.updateMastTable(formAllModel, dataModel, conn, result); + } finally { + DynamicDataSourceUtil.clearSwitchDataSource(); + } + } else { + //无表数据处理 + result = this.updateAll(dataModel, formAllModel); + } + return result; + } + + /** + * 子表数据 + **/ + private void updateTable(List formAllModel, DataModel dataModel, Connection conn, Map result) throws SQLException { + List tableModelList = dataModel.getTableModelList(); + Map dataNewMap = dataModel.getDataNewMap(); + Boolean isOracle = dataModel.getIsOracle(); + String mainId = dataModel.getMainId(); + Integer primaryKeyPolicy = dataModel.getPrimaryKeyPolicy(); + //子表 + List tableForm = formAllModel.stream().filter(t -> FormEnum.table.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + Map> childMap = new HashMap<>(); + Map chidTable = new HashMap<>(); + tableForm.stream().forEach(t -> { + FormColumnTableModel childListAll = t.getChildList(); + String tableModel = childListAll.getTableModel(); + List childList = childListAll.getChildList().stream().filter(g -> StringUtil.isNotEmpty(g.getFieLdsModel().getVModel())).collect(Collectors.toList()); + childMap.put(tableModel, childList); + String tableName = childListAll.getTableName(); + Optional first = tableModelList.stream().filter(k -> k.getTable().equals(tableName)).findFirst(); + if (first.isPresent()) { + TableModel childTable = first.get(); + chidTable.put(tableModel, childTable); + } + }); + + for (String key : childMap.keySet()) { + //子表数据 + List> chidList = dataNewMap.get(key) != null ? (List>) dataNewMap.get(key) : new ArrayList<>(); + List formColumnModels = childMap.get(key); + Map columMap = new HashMap<>(); + List filedModel = new ArrayList<>(); + //子表主键 + TableModel tableModel = chidTable.get(key); + String table = tableModel.getTable(); + String childKeyName = this.getKey(conn, table, 1); + //获取子表对象的类型 + for (FormColumnModel column : formColumnModels) { + FieLdsModel fieLdsModel = column.getFieLdsModel(); + String vmodel = fieLdsModel.getVModel(); + columMap.put(vmodel, fieLdsModel); + } + for (String childKey : columMap.keySet()) { + //添加字段 + filedModel.add(childKey); + } + //主键 + if (primaryKeyPolicy == 1) { + filedModel.add(childKeyName); + } + //关联字段 + Optional first = tableModelList.stream().filter(t -> t.getTable().equals(table)).findFirst(); + if (!first.isPresent()) { + throw new SQLException(MsgCode.COD001.get()); + } + String mastKeyName = first.get().getTableField(); + + SqlTable sqlTable = SqlTable.of(table); + String childPrimary=this.getKey(conn,table,1); + SelectStatementProvider render = SqlBuilder.select(sqlTable.column(childPrimary)).from(sqlTable).where(sqlTable.column(mastKeyName), SqlBuilder.isEqualTo(mainId)) + .build().render(RenderingStrategies.MYBATIS3); + List childIdList = flowFormDataMapper.selectManyMappedRows(render).stream().map(t -> new CaseInsensitiveMap(t).get(childPrimary)).collect(Collectors.toList()); + List formDataIdList = chidList.stream().filter(t->new CaseInsensitiveMap(t).containsKey(childPrimary)).map(t -> new CaseInsensitiveMap(t).get(childPrimary).toString()).collect(Collectors.toList()); + List deleteList= childIdList.stream().filter(t -> !formDataIdList.contains(t)).collect(Collectors.toList()); + if(CollectionUtils.isNotEmpty(deleteList)){//删除子表id数据 + DeleteStatementProvider deleteRender = SqlBuilder.deleteFrom(sqlTable).where(sqlTable.column(childPrimary), SqlBuilder.isIn(deleteList)) + .build().render(RenderingStrategies.MYBATIS3); + flowFormDataMapper.delete(deleteRender); + } + + for (Map objectMap : chidList) { + objectMap=new CaseInsensitiveMap(objectMap); + GeneralInsertDSL generalInsertDSL = SqlBuilder.insertInto(sqlTable).set(sqlTable.column(mastKeyName)).toValue(mainId); + UpdateDSL updateModelUpdateDSL = SqlBuilder.update(sqlTable).set(sqlTable.column(mastKeyName)).equalTo(mainId); + for (String childKey : columMap.keySet()) { + FieLdsModel fieLdsModel = columMap.get(childKey); + String jnpfkey = fieLdsModel.getConfig().getJnpfKey(); + Object data = objectMap.get(childKey); + if (JnpfKeyConsts.CURRORGANIZE.equals(jnpfkey) || JnpfKeyConsts.CURRPOSITION.equals(jnpfkey) || JnpfKeyConsts.CREATETIME.equals(jnpfkey) || JnpfKeyConsts.CREATEUSER.equals(jnpfkey)) { + if(data!=null && StringUtil.isNotEmpty(data.toString())){ + continue; + } + } + //处理系统自动生成 + data = this.update(fieLdsModel, data, true); + getDSL(isOracle, sqlTable, null,generalInsertDSL, fieLdsModel.getFormat(), jnpfkey, childKey, data); + getDSL(isOracle, sqlTable, updateModelUpdateDSL,null, fieLdsModel.getFormat(), jnpfkey, childKey, data); + } + + if(objectMap.get(childPrimary)!=null && childIdList.contains(objectMap.get(childPrimary).toString())){//修改 + if (primaryKeyPolicy == 2) { + //自增转换ID类型 + objectMap.put(childPrimary, Long.parseLong(objectMap.get(childPrimary).toString())); + } + updateModelUpdateDSL.where(sqlTable.column(childPrimary),SqlBuilder.isEqualTo(objectMap.get(childPrimary))); + UpdateStatementProvider render1 = updateModelUpdateDSL.build().render(RenderingStrategies.MYBATIS3); + flowFormDataMapper.update(render1); + }else {//新增 + //添加主键值和外键值 + if (primaryKeyPolicy == 1) { + generalInsertDSL = generalInsertDSL.set(sqlTable.column(childKeyName)).toValue(RandomUtil.uuId()); + } + GeneralInsertStatementProvider insertRender = generalInsertDSL.build().render(RenderingStrategies.MYBATIS3); + flowFormDataMapper.generalInsert(insertRender); + } + } + } + } + + /** + * 副表数据 + **/ + private void updateMastTable(List formAllModel, DataModel dataModel, Connection conn, Map result) throws SQLException { + List tableModelList = dataModel.getTableModelList(); + Map dataNewMap = dataModel.getDataNewMap(); + Boolean isOracle = dataModel.getIsOracle(); + String mainId = dataModel.getMainId(); + Integer primaryKeyPolicy = dataModel.getPrimaryKeyPolicy(); + //副表 + Map> mastTableAll = formAllModel.stream().filter(t -> FormEnum.mastTable.getMessage().equals(t.getJnpfKey())).collect(Collectors.groupingBy(e -> e.getFormMastTableModel().getTable())); + for (String key : mastTableAll.keySet()) { + //副表 + Optional first = tableModelList.stream().filter(t -> t.getTable().equals(key)).findFirst(); + if (!first.isPresent()) { + throw new SQLException(MsgCode.COD001.get()); + } + TableModel tableModel = first.get(); + String tableModelTable = tableModel.getTable(); + String childKeyName = this.getKey(conn, tableModelTable, 1); + //关联字段 + String mastKeyName = tableModel.getTableField(); + List masTableList = mastTableAll.get(key); + + SqlTable sqlTable = SqlTable.of(tableModelTable); + UpdateDSL updateModelUpdateDSL = SqlBuilder.update(sqlTable).set(sqlTable.column(mastKeyName)).equalTo(mainId); + + for (FormAllModel model : masTableList) { + FormMastTableModel formMastTableModel = model.getFormMastTableModel(); + FormColumnModel mastTable = formMastTableModel.getMastTable(); + FieLdsModel fieLdsModel = mastTable.getFieLdsModel(); + String mostTableKey = fieLdsModel.getVModel(); + String jnpfkey = fieLdsModel.getConfig().getJnpfKey(); + Object data = dataNewMap.get(mostTableKey); + String field = formMastTableModel.getField(); + if (JnpfKeyConsts.CURRORGANIZE.equals(jnpfkey) || JnpfKeyConsts.CURRPOSITION.equals(jnpfkey) || JnpfKeyConsts.CREATETIME.equals(jnpfkey) || JnpfKeyConsts.CREATEUSER.equals(jnpfkey)) { + if(data!=null && StringUtil.isNotEmpty(data.toString())){ + continue; + } + } + //处理系统自动生成 + data = this.update(fieLdsModel, data, true); + getDSL(isOracle, sqlTable, updateModelUpdateDSL,null, fieLdsModel.getFormat(), jnpfkey, field, data); + } + //sql主键 + if (primaryKeyPolicy == 1) { + updateModelUpdateDSL = updateModelUpdateDSL.set(sqlTable.column(childKeyName)).equalTo(RandomUtil.uuId()); + } + UpdateStatementProvider updateStatementProvider = updateModelUpdateDSL.where(sqlTable.column(mastKeyName), SqlBuilder.isEqualTo(mainId)).build().render(RenderingStrategies.MYBATIS3); + flowFormDataMapper.update(updateStatementProvider); + } + } + + /** + * 主表数据 + **/ + private void updateMast(List formAllModel, DataModel dataModel, Connection conn, Map result) throws SQLException { + List tableModelList = dataModel.getTableModelList(); + Map dataNewMap = dataModel.getDataNewMap(); + Boolean isOracle = dataModel.getIsOracle(); + Integer primaryKeyPolicy = dataModel.getPrimaryKeyPolicy(); + Object mainId = dataModel.getMainId(); + if(Objects.equals(primaryKeyPolicy,2)){ + mainId=Long.parseLong(dataModel.getMainId()); + } + Optional first = tableModelList.stream().filter(t -> "1".equals(t.getTypeId())).findFirst(); + if (!first.isPresent()) { + throw new SQLException(MsgCode.COD001.get()); + } + TableModel tableModel = first.get(); + String mastTableName = tableModel.getTable(); + List mastForm = formAllModel.stream().filter(t -> FormEnum.mast.getMessage().equals(t.getJnpfKey())).filter(t -> StringUtil.isNotEmpty(t.getFormColumnModel().getFieLdsModel().getVModel())).collect(Collectors.toList()); + //修改字段 + List filed = new ArrayList<>(); + List mastData = new LinkedList<>(); + Boolean flowEnable = dataModel.getFlowEnable(); + if (!flowEnable && primaryKeyPolicy == 2) { + primaryKeyPolicy = 1; + } + String keyName = this.getKey(conn, mastTableName, primaryKeyPolicy); + SqlTable sqlTable = SqlTable.of(mastTableName); + UpdateDSL updateModelUpdateDSL = SqlBuilder.update(sqlTable); + int num = 0; + for (FormAllModel model : mastForm) { + FieLdsModel fieLdsModel = model.getFormColumnModel().getFieLdsModel(); + String jnpfkey = fieLdsModel.getConfig().getJnpfKey(); + String field = fieLdsModel.getVModel(); + Object data = dataNewMap.get(field); + if (JnpfKeyConsts.CURRORGANIZE.equals(jnpfkey) || JnpfKeyConsts.CURRPOSITION.equals(jnpfkey) || JnpfKeyConsts.CREATETIME.equals(jnpfkey) || JnpfKeyConsts.CREATEUSER.equals(jnpfkey)) { + if(data!=null && StringUtil.isNotEmpty(data.toString())){ + continue; + } + } + //处理系统自动生成 + data = this.update(fieLdsModel, data, true); + getDSL(isOracle, sqlTable, updateModelUpdateDSL, null, fieLdsModel.getFormat(), jnpfkey, field, data); + num++; + } + //判断是否开启锁 + if (dataModel.getConcurrencyLock()) { + updateModelUpdateDSL = updateModelUpdateDSL.set(sqlTable.column(TableFeildsEnum.VERSION.getField())).equalTo(dataNewMap.get(TableFeildsEnum.VERSION.getField())); + } + + //添加流程引擎信息 + if (dataNewMap.get(FlowFormConstant.FLOWID) != null && StringUtil.isNotEmpty(dataNewMap.get(FlowFormConstant.FLOWID).toString())) { + updateModelUpdateDSL = updateModelUpdateDSL.set(sqlTable.column(TableFeildsEnum.FLOWID.getField())).equalTo(dataNewMap.get(FlowFormConstant.FLOWID)); + } + + UpdateStatementProvider updateStatementProvider = updateModelUpdateDSL.where(sqlTable.column(keyName), SqlBuilder.isEqualTo(mainId)).build().render(RenderingStrategies.MYBATIS3); + if (num > 0) { + flowFormDataMapper.update(updateStatementProvider); + } + } + + /** + * 修改无表数据 + **/ + private Map updateAll(DataModel dataModel, List formAllModel) { + Map dataNewMap = dataModel.getDataNewMap(); + //处理好的数据 + Map result = new HashMap<>(16); + //系统数据 + List mastForm = formAllModel.stream().filter(t -> FormEnum.mast.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + List tableForm = formAllModel.stream().filter(t -> FormEnum.table.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + for (String key : dataNewMap.keySet()) { + FormAllModel model = mastForm.stream().filter(t -> key.equals(t.getFormColumnModel().getFieLdsModel().getVModel())).findFirst().orElse(null); + if (model != null) { + FieLdsModel fieLdsModel = model.getFormColumnModel().getFieLdsModel(); + Object data = dataNewMap.get(key); + //处理系统自动生成 + data = this.update(fieLdsModel, data, false); + result.put(key, data); + } else { + FormAllModel childModel = tableForm.stream().filter(t -> key.equals(t.getChildList().getTableModel())).findFirst().orElse(null); + if (childModel != null) { + List> childDataMap = (List>) dataNewMap.get(key); + //子表处理的数据 + List> childResult = new ArrayList<>(); + for (Map objectMap : childDataMap) { + //子表单体处理的数据 + Map childOneResult = new HashMap<>(16); + for (String childKey : objectMap.keySet()) { + FormColumnModel columnModel = childModel.getChildList().getChildList().stream().filter(t -> childKey.equals(t.getFieLdsModel().getVModel())).findFirst().orElse(null); + if (columnModel != null) { + FieLdsModel fieLdsModel = columnModel.getFieLdsModel(); + Object data = objectMap.get(childKey); + data = this.update(fieLdsModel, data, false); + childOneResult.put(childKey, data); + } + } + childResult.add(childOneResult); + } + result.put(key, childResult); + } + } + } + return result; + } + + /** + * 修改系统赋值 + **/ + private Object update(FieLdsModel fieLdsModel, Object dataValue, boolean isTable) { + String jnpfKey = fieLdsModel.getConfig().getJnpfKey(); + String rule = fieLdsModel.getConfig().getRule(); + String format = DateTimeFormatConstant.getFormat(fieLdsModel.getFormat()); + UserInfo userInfo = userProvider.get(); + Object value = dataValue; + switch (jnpfKey) { + case JnpfKeyConsts.CREATEUSER: + if (!ObjectUtil.isEmpty(value)) { + String name = String.valueOf(value).split("/" )[0]; + UserEntity userEntity = serviceUtil.getByRealName(name); + value = userEntity != null ? userEntity.getId() : userInfo.getUserId(); + } else { + value = userInfo.getUserId(); + } + break; + case JnpfKeyConsts.CREATETIME: + if (ObjectUtil.isEmpty(value)) { + value = DateUtil.getNow("+8" ); + } + break; + case JnpfKeyConsts.CURRORGANIZE: + case JnpfKeyConsts.CURRDEPT: + value = this.getCurrentOrgIds(userInfo.getOrganizeId(),fieLdsModel.getShowLevel()); + break; + case JnpfKeyConsts.MODIFYTIME: + value = new Date(); + break; + case JnpfKeyConsts.MODIFYUSER: + value = userInfo.getUserId(); + break; + case JnpfKeyConsts.CURRPOSITION: + if (!ObjectUtil.isEmpty(value)) { + PositionEntity positionEntity = serviceUtil.getPositionFullName(String.valueOf(value)); + value = positionEntity != null ? positionEntity.getId() : ""; + } else { + value = userInfo.getPositionIds().length > 0 ? userInfo.getPositionIds()[0] : ""; + } + break; + case JnpfKeyConsts.BILLRULE: + if (ObjectUtil.isEmpty(value)) { + try { + value = serviceUtil.getBillNumber(rule); + } catch (Exception e) { + value = null; + } + } + break; + case JnpfKeyConsts.DATE: + if (isTable) { + try { + if (dataValue == null || "".equals(dataValue)) { + return null; + } + if (dataValue instanceof String) { + try { + SimpleDateFormat formatter = new SimpleDateFormat(format); + value = formatter.parse(dataValue.toString()); + } catch (ParseException var3) { + return null; + } + } else { + value = new Date(Long.valueOf(String.valueOf(dataValue))); + } + } catch (Exception e) { + } + } + break; + case JnpfKeyConsts.NUM_INPUT: + case JnpfKeyConsts.CALCULATE: + if (isTable) { + try { + value = new BigDecimal(String.valueOf(dataValue)); + } catch (Exception e) { + + } + } + break; + default: + if (isTable) { + value = this.valueToNull(value); + } + break; + } + return value; + } + + + /** + * @param id + * @param primaryKeyPolicy + * @param tableModels + * @param linkEntity + * @return + * @throws Exception + */ + @DSTransactional + public boolean deleteTable(String id, Integer primaryKeyPolicy, List tableModels, DbLinkEntity linkEntity) throws Exception { + boolean isSnowFlake = primaryKeyPolicy == 1; + + //主表 + TableModel mainTableModel = tableModels.stream().filter(t -> "1".equals(t.getTypeId())).findFirst().orElse(null); + String mainTable = mainTableModel.getTable(); + DynamicDataSourceUtil.switchToDataSource(linkEntity); + @Cleanup Connection conn = ConnUtil.getConnOrDefault(linkEntity); + //获取主键 + String pKeyName = this.getKey(conn, mainTable, primaryKeyPolicy); + + SelectStatementProvider queryMain = SqlBuilder.select(SqlTable.of(mainTable).allColumns()).from(SqlTable.of(mainTable)) + .where(SqlTable.of(mainTable).column(pKeyName), SqlBuilder.isEqualTo(id)).build().render(RenderingStrategies.MYBATIS3); + List> mainMapList = flowFormDataMapper.selectManyMappedRows(queryMain); + mainMapList = FormPublicUtils.toLowerKeyList(mainMapList); + + DeleteStatementProvider mainDelete = SqlBuilder.deleteFrom(SqlTable.of(mainTable)) + .where(SqlTable.of(mainTable).column(pKeyName), SqlBuilder.isEqualTo(id)).build().render(RenderingStrategies.MYBATIS3); + flowFormDataMapper.delete(mainDelete); + if (mainMapList.size() > 0) { + if (tableModels.size() > 1) { + //去除主表 + tableModels.remove(mainTableModel); + for (TableModel table : tableModels) { + //主表字段 + String relationField = isSnowFlake ? table.getRelationField() : TableFeildsEnum.FLOWTASKID.getField(); + String relationFieldValue = mainMapList.get(0).get(relationField.toLowerCase()).toString(); + //子表字段 + String tableField = table.getTableField(); + DeleteStatementProvider childDeleteProvider = SqlBuilder.deleteFrom(SqlTable.of(table.getTable())) + .where(SqlTable.of(table.getTable()).column(tableField), SqlBuilder.isEqualTo(relationFieldValue)).build().render(RenderingStrategies.MYBATIS3); + flowFormDataMapper.delete(childDeleteProvider); + } + } + } + DynamicDataSourceUtil.clearSwitchDataSource(); + return true; + } + + + /** + * 执行sql语句 + **/ + private void sql(String sql, List> dataAll, String[] del, Connection conn, boolean isCommit) throws SQLException { + try { + if (del.length > 0) { + @Cleanup PreparedStatement delete = conn.prepareStatement(del[0]); + delete.setObject(1, del[1]); + delete.addBatch(); + delete.executeBatch(); + } + @Cleanup PreparedStatement save = conn.prepareStatement(sql); + for (List childData : dataAll) { + for (int i = 0; i < childData.size(); i++) { + Object data = childData.get(i); + save.setObject(i + 1, data); + } + save.addBatch(); + save.executeBatch(); + } + if (isCommit) { + conn.commit(); + } + } catch (SQLException e) { + conn.rollback(); + System.out.println("sql语句异常:" + e.getMessage()); + throw new SQLException(e.getMessage()); + } + } + + public Boolean getVersion(String table, DbLinkEntity linkEntity, Map dataMap, String id, Integer primaryKey) { + boolean canUpdate = true; + try { + DynamicDataSourceUtil.switchToDataSource(linkEntity); + @Cleanup Connection conn = ConnUtil.getConnOrDefault(linkEntity); + String pKeyName = this.getKey(conn, table, primaryKey); + SqlTable sqlTable = SqlTable.of(table); + SelectStatementProvider render = SqlBuilder.select(sqlTable.column(TableFeildsEnum.VERSION.getField())).from(sqlTable).where(sqlTable.column(pKeyName), SqlBuilder.isEqualTo(id)) + .and(sqlTable.column(TableFeildsEnum.VERSION.getField()), SqlBuilder.isEqualTo(dataMap.get(TableFeildsEnum.VERSION.getField()))).build().render(RenderingStrategies.MYBATIS3); + int count = flowFormDataMapper.selectManyMappedRows(render).size(); + canUpdate = count > 0; + } catch (DataException | SQLException e) { + log.error("切换数据源异常" ); + } finally { + DynamicDataSourceUtil.clearSwitchDataSource(); + } + return canUpdate; + } + + /** + * 添加sql语句 + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2023/3/29 + */ + private void getDSL(Boolean isOracle, SqlTable sqlTable, UpdateDSL updateModelUpdateDSL, GeneralInsertDSL generalInsertDSL, + String format, String jnpfkey, String field, Object data) { + boolean dataTimestamp = StringUtil.isNotEmpty(format) ? format.length() > 10 : true; + String dateFunc = dataTimestamp ? "to_timestamp" : "to_date" ; + if (data == null || StringUtil.isEmpty(data.toString())) { + if(generalInsertDSL!=null){ + generalInsertDSL = generalInsertDSL.set(sqlTable.column(field)).toNull(); + }else{ + updateModelUpdateDSL = updateModelUpdateDSL.set(sqlTable.column(field)).equalToNull(); + } + } else { +// if (isOracle && (JnpfKeyConsts.DATE.equals(jnpfkey) || JnpfKeyConsts.MODIFYTIME.equals(jnpfkey) || JnpfKeyConsts.CREATETIME.equals(jnpfkey))) { +// String constanct = dateFunc + "('" + data.toString() + "','yyyy-mm-dd HH24:mi:ss')"; +// if(generalInsertDSL!=null){ +// generalInsertDSL = generalInsertDSL.set(sqlTable.column(field)).toConstant(constanct); +// }else{ +// updateModelUpdateDSL = updateModelUpdateDSL.set(sqlTable.column(field)).equalToConstant(constanct); +// } +// +// } else { + if(generalInsertDSL!=null){ + generalInsertDSL = generalInsertDSL.set(sqlTable.column(field)).toValue(data); + }else { + updateModelUpdateDSL = updateModelUpdateDSL.set(sqlTable.column(field)).equalTo(data); + } + } +// } + } + + /** + * 判断数据为空或空数组转换成null + * @param value + * @return + */ + private Object valueToNull(Object value){ + if (value instanceof List || value instanceof String[][]) { + List l=(List) value; + if(l.size()>0){ + value = JsonUtil.getObjectToString(value); + }else{ + value = null; + } + } else if (value instanceof CharSequence) { + if (StrUtil.isEmpty((CharSequence) value) || "[]".equals(value)) { + value = null; + } + } + return value; + } + + /** + * 获取当前组织完整路径 + * + * @param orgId + * @return + */ + public String getCurrentOrgIds(String orgId,String showLevel) { + String orgIds = null; + OrganizeEntity organizeEntity = serviceUtil.getOrganizeInfo(orgId); + if (organizeEntity != null) { + if (StringUtil.isNotEmpty(organizeEntity.getOrganizeIdTree())) { + String[] split = organizeEntity.getOrganizeIdTree().split(","); + orgIds = split.length > 0 ? JsonUtil.getObjectToString(Arrays.asList(split)) : null; + } + } + if (!"all".equals(showLevel) && organizeEntity!=null && "company".equals(organizeEntity.getCategory())){ + orgIds = null; + } + return orgIds; + } + + /** + * 获取当前组织名称(all-显示组织名,else 显示部门名) + * + * @param value + * @param showLevel + * @return + */ + public String getCurrentOrganizeName(Object value, String showLevel) { + return serviceUtil.getCurrentOrganizeName(value,showLevel); + } +} diff --git a/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/util/FlowFormHttpReqUtils.java b/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/util/FlowFormHttpReqUtils.java new file mode 100644 index 0000000..9b81e0f --- /dev/null +++ b/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/util/FlowFormHttpReqUtils.java @@ -0,0 +1,99 @@ +package jnpf.util; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import jnpf.base.ActionResult; +import jnpf.base.ActionResultCode; +import jnpf.config.JnpfOauthConfig; +import jnpf.entity.FlowFormEntity; +import jnpf.exception.WorkFlowException; +import jnpf.util.wxutil.HttpUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import javax.servlet.http.HttpServletRequest; +import java.util.HashMap; +import java.util.Map; + +/** + * 流程表单 http请求处理表单 + * + * @author JNPF开发平台组 + * @version V3.4.5 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2022/10/21 + */ +@Component +public class FlowFormHttpReqUtils { + + private static JnpfOauthConfig jnpfOauthConfig; + + @Autowired + public void setJnpfOauthConfig(JnpfOauthConfig jnpfOauthConfig) { + FlowFormHttpReqUtils.jnpfOauthConfig = jnpfOauthConfig; + } + + public Map info(FlowFormEntity flowFormEntity, String id, String token) { + String requestURL = this.getReqURL(flowFormEntity, id); + JSONObject jsonObject = HttpUtil.httpRequest(requestURL, "GET" , null, token); + ActionResult actionResult = JSON.toJavaObject(jsonObject, ActionResult.class); + if (actionResult == null) { + return new HashMap<>(); + } + Object data = actionResult.getData(); + return data != null ? JsonUtil.entityToMap(data) : new HashMap<>(); + } + + public boolean isUpdate(FlowFormEntity flowFormEntity, String id, String token) { + String requestURL = this.getReqURL(flowFormEntity, id); + JSONObject jsonObject = HttpUtil.httpRequest(requestURL, "GET" , null, token); + ActionResult actionResult = JSON.toJavaObject(jsonObject, ActionResult.class); + return actionResult != null && actionResult.getData() != null; + } + + public void create(FlowFormEntity flowFormEntity, String id, String token, Map map) throws WorkFlowException { + String requestURL = this.getReqURL(flowFormEntity, id); + JSONObject jsonObject = HttpUtil.httpRequest(requestURL, "POST" , JsonUtil.getObjectToString(map), token); + ActionResult actionResult = JSON.toJavaObject(jsonObject, ActionResult.class); + boolean b = actionResult!=null && ActionResultCode.Success.getCode().equals(actionResult.getCode()); + if (!b) { + String msg = actionResult!=null?actionResult.getMsg():"未找到接口"; + throw new WorkFlowException(msg); + } + } + + public void update(FlowFormEntity flowFormEntity, String id, String token, Map map) throws WorkFlowException { + String requestURL = this.getReqURL(flowFormEntity, id); + JSONObject jsonObject = HttpUtil.httpRequest(requestURL, "PUT" , JsonUtil.getObjectToString(map), token); + ActionResult actionResult = JSON.toJavaObject(jsonObject, ActionResult.class); + boolean b = actionResult!=null && ActionResultCode.Success.getCode().equals(actionResult.getCode()); + if (!b) { + String msg = actionResult!=null?actionResult.getMsg():"未找到接口"; + throw new WorkFlowException(msg); + } + } + + public void saveOrUpdate(FlowFormEntity flowFormEntity, String id, String token, Map map) throws WorkFlowException { + boolean update = this.isUpdate(flowFormEntity, id, token); + if (update) { + this.update(flowFormEntity, id, token, map); + } else { + this.create(flowFormEntity, id, token, map); + } + } + + + private String getReqURL(FlowFormEntity flowFormEntity, String id) { + HttpServletRequest request = ServletUtil.getRequest(); + //请求来源 + String requestURL = flowFormEntity.getInterfaceUrl(); + boolean isHttp = requestURL.toLowerCase().startsWith("http" ); + if (!isHttp) { + //补全(内部) + requestURL = jnpfOauthConfig.getJnpfDomain() + requestURL; + } + return requestURL + "/" + id; + } + + +} diff --git a/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/util/FormCheckUtils.java b/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/util/FormCheckUtils.java new file mode 100644 index 0000000..287bcd6 --- /dev/null +++ b/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/util/FormCheckUtils.java @@ -0,0 +1,187 @@ +package jnpf.util; + +import cn.hutool.core.util.ObjectUtil; +import jnpf.database.model.entity.DbLinkEntity; +import jnpf.database.util.ConnUtil; +import jnpf.database.util.DynamicDataSourceUtil; +import jnpf.exception.DataException; +import jnpf.mapper.FlowFormDataMapper; +import jnpf.model.form.FormCheckModel; +import jnpf.model.visualJson.FieLdsModel; +import jnpf.model.visualJson.TableModel; +import jnpf.util.visiual.JnpfKeyConsts; +import lombok.Cleanup; +import org.apache.commons.lang3.StringUtils; +import org.mybatis.dynamic.sql.SqlBuilder; +import org.mybatis.dynamic.sql.SqlTable; +import org.mybatis.dynamic.sql.render.RenderingStrategies; +import org.mybatis.dynamic.sql.select.QueryExpressionDSL; +import org.mybatis.dynamic.sql.select.SelectModel; +import org.mybatis.dynamic.sql.select.render.SelectStatementProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.sql.Connection; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + + +/** + * 验证表单数据 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2022/5/25 + */ +@Component +public class FormCheckUtils { + @Autowired + private FlowFormDataUtil flowDataUtil; + @Autowired + private FlowFormDataMapper flowFormDataMapper; + + public String checkForm(List formFieldList, Map dataMap, DbLinkEntity linkEntity, List tableModelList, Integer policy, Boolean logicalDelete, String id) { + List fields = new ArrayList<>(); + FormPublicUtils.recursionFieldsExceptChild(fields, formFieldList); + String checkErrorMessage =""; + //查询返回对应条数 + int i = 0; + //符合条件的控件 + List mainFields = checkInputUnique(fields); + try { + //切换数据源 + DynamicDataSourceUtil.switchToDataSource(linkEntity); + @Cleanup Connection conn = ConnUtil.getConnOrDefault(linkEntity); + List formCheckModels = new ArrayList<>(); + for (FieLdsModel fieLdsModel : mainFields) { + Object o = dataMap.get(fieLdsModel.getVModel()); + if (ObjectUtil.isNotNull(o) && StringUtil.isNotEmpty(o.toString())) { + o=String.valueOf(o).trim(); + dataMap.put(fieLdsModel.getVModel(),o); + String tableName = fieLdsModel.getConfig().getTableName(); + SqlTable sqlTable = SqlTable.of(tableName); + String fieldName=fieLdsModel.getVModel(); + if(fieldName.toLowerCase().contains("_jnpf_")){//附表字段名称 + fieldName= fieldName.split("_jnpf_")[1]; + } + QueryExpressionDSL.QueryExpressionWhereBuilder where = SqlBuilder.select(sqlTable.column(fieldName)).from(sqlTable).where(sqlTable.column(fieldName), SqlBuilder.isEqualTo(o.toString())); + if (StringUtils.isNotEmpty(id)){ + String relationField; + //判断是否主表 + TableModel tab = tableModelList.stream().filter(tableModel -> tableModel.getTable().equalsIgnoreCase(tableName)).findFirst().orElse(null); + if ("1".equals(tab.getTypeId())){ + relationField = flowDataUtil.getKey(conn,tableName,policy); + }else { + relationField = tab.getTableField(); + } + where.and(sqlTable.column(relationField), SqlBuilder.isNotEqualTo(id)); + } + if(logicalDelete){ + where.and(sqlTable.column(TableFeildsEnum.DELETEMARK.getField()),SqlBuilder.isNull()); + } + SelectStatementProvider render = where.build().render(RenderingStrategies.MYBATIS3); + FormCheckModel formCheckModel = new FormCheckModel(); + formCheckModel.setLabel(fieLdsModel.getConfig().getLabel()); + formCheckModel.setStatementProvider(render); + formCheckModels.add(formCheckModel); + } + } + + //主副表数据库判重 + for (FormCheckModel formCheckModel : formCheckModels) { + int count = flowFormDataMapper.selectManyMappedRows(formCheckModel.getStatementProvider()).size(); + if (count > 0 ) { + checkErrorMessage = formCheckModel.getLabel(); + i++; + } + } + + //子表当前表单数据判重 + List childFieldList = fields.stream().filter(f -> JnpfKeyConsts.CHILD_TABLE.equals(f.getConfig().getJnpfKey())).collect(Collectors.toList()); + for (FieLdsModel fieLdsModel : childFieldList) { + List fieLdsModels = checkInputUnique(fieLdsModel.getConfig().getChildren()); + List> childMapList = JsonUtil.getJsonToListMap(String.valueOf(dataMap.get(fieLdsModel.getVModel()))); + if (childMapList!=null){ + for (FieLdsModel childField : fieLdsModels) { + childMapList.stream().forEach(t->{ + if(t.get(childField.getVModel())!=null){ + t.put(childField.getVModel(),String.valueOf(t.get(childField.getVModel())).trim()); + } + }); + List childValues = childMapList.stream().filter(ChildTbMap -> ChildTbMap.get(childField.getVModel())!=null) + .map(ChildTbMap -> String.valueOf(ChildTbMap.get(childField.getVModel()))).collect(Collectors.toList()); + + if (childValues.size() > 0) { + HashSet child = new HashSet<>(childValues); + if (child.size() != childValues.size()){ + checkErrorMessage = childField.getConfig().getLabel(); + } +// String tableName = childField.getConfig().getRelationTable(); +// SqlTable sqlTable = SqlTable.of(tableName); +// QueryExpressionDSL.QueryExpressionWhereBuilder where = SqlBuilder.select(sqlTable.column(childField.getVModel())).from(sqlTable).where(sqlTable.column(childField.getVModel()), SqlBuilder.isIn(childValues)); +// if (StringUtils.isNotEmpty(id)){ +// String relationField; +// //判断是否主表 +// TableModel tab = tableModelList.stream().filter(tableModel -> tableModel.getTable().equalsIgnoreCase(tableName)).findFirst().orElse(null); +// relationField = tab.getTableField(); +// where.and(sqlTable.column(relationField),SqlBuilder.isNotEqualTo(id)); +// } +// SelectStatementProvider render = where.build().render(RenderingStrategies.MYBATIS3); +// FormCheckModel formCheckModel = new FormCheckModel(); +// formCheckModel.setLabel(childField.getConfig().getLabel()); +// formCheckModel.setStatementProvider(render); +// formCheckModels.add(formCheckModel); + } + } + } + } + + if (conn != null) { + conn.close(); + } + } catch (Exception e) { + e.printStackTrace(); + } finally { + DynamicDataSourceUtil.clearSwitchDataSource(); + } + return checkErrorMessage; + } + + /** + * 输入框唯一 + * + * @param fields + * @return + */ + private static List checkInputUnique(List fields) { + List inputUnique = fields.stream().filter(field -> JnpfKeyConsts.COM_INPUT.equals(field.getConfig().getJnpfKey()) + && field.getConfig().getUnique()).collect(Collectors.toList()); + return inputUnique; + } + + + public long getCount(String id, SqlTable sqlTable, TableModel tableModel, DbLinkEntity linkEntity, Integer primaryKeyPolicy){ + int count = 0; + try { + DynamicDataSourceUtil.switchToDataSource(linkEntity); + @Cleanup Connection conn = ConnUtil.getConnOrDefault(linkEntity); + String key = flowDataUtil.getKey(conn, tableModel.getTable(), primaryKeyPolicy); + SelectStatementProvider countRender = SqlBuilder.select(sqlTable.column(key)).from(sqlTable).where(sqlTable.column(key), SqlBuilder.isEqualTo(id)).build().render(RenderingStrategies.MYBATIS3); + count = flowFormDataMapper.selectManyMappedRows(countRender).size(); + } catch (DataException e) { + e.printStackTrace(); + } catch (SQLException sqlException) { + sqlException.printStackTrace(); + } finally { + DynamicDataSourceUtil.clearSwitchDataSource(); + } + return count; + } + + +} diff --git a/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/util/FormInfoUtils.java b/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/util/FormInfoUtils.java new file mode 100644 index 0000000..7531dfd --- /dev/null +++ b/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/util/FormInfoUtils.java @@ -0,0 +1,117 @@ +package jnpf.util; + +import cn.hutool.core.util.ObjectUtil; +import jnpf.database.util.DynamicDataSourceUtil; +import jnpf.model.visualJson.FieLdsModel; +import jnpf.permission.entity.OrganizeEntity; +import jnpf.permission.entity.PositionEntity; +import jnpf.permission.entity.UserEntity; +import jnpf.util.visiual.JnpfKeyConsts; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.math.BigDecimal; +import java.util.*; + +/** + * 在线详情编辑工具类 + * + * @author JNPF开发平台组 + * @version V3.2 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/10/27 + */ +@Slf4j +@Component +public class FormInfoUtils { + @Autowired + private ServiceBaseUtil serviceUtil; + + + /** + * 转换数据格式(编辑页) + * + * @param modelList 控件 + * @param dataMap 数据 + * @return + */ + public Map swapDataInfoType(List modelList, Map dataMap) { + dataMap = Optional.ofNullable(dataMap).orElse(new HashMap<>()); + try { + DynamicDataSourceUtil.switchToDataSource(null); + List systemConditions = new ArrayList() {{ + add(JnpfKeyConsts.CURRORGANIZE); + add(JnpfKeyConsts.CURRDEPT); + add(JnpfKeyConsts.CURRPOSITION); + }}; + List nullIsList = new ArrayList() {{ + add(JnpfKeyConsts.UPLOADFZ); + add(JnpfKeyConsts.UPLOADIMG); + }}; + for (FieLdsModel swapDataVo : modelList) { + String jnpfKey = swapDataVo.getConfig().getJnpfKey(); + String vModel = swapDataVo.getVModel(); + Object value = dataMap.get(vModel); + if (value == null || ObjectUtil.isEmpty(value)) { + if (systemConditions.contains(jnpfKey)) { + dataMap.put(vModel, " " ); + } + if (nullIsList.contains(jnpfKey)) { + dataMap.put(vModel, Collections.emptyList()); + } + continue; + } + switch (jnpfKey) { + case JnpfKeyConsts.UPLOADFZ: + case JnpfKeyConsts.UPLOADIMG: + List> fileList = JsonUtil.getJsonToListMap(String.valueOf(value)); + dataMap.put(vModel, fileList.size() == 0 ? new ArrayList<>() : fileList); + break; + case JnpfKeyConsts.DATE: + Long dateTime = DateTimeFormatConstant.getDateObjToLong(dataMap.get(vModel)); + dataMap.put(vModel, dateTime != null ? dateTime : dataMap.get(vModel)); + break; + case JnpfKeyConsts.CREATETIME: + case JnpfKeyConsts.MODIFYTIME: + String pattern = DateTimeFormatConstant.YEAR_MOnTH_DHMS; + Long time = DateTimeFormatConstant.getDateObjToLong(dataMap.get(vModel)); + dataMap.put(vModel, time!=null?DateUtil.dateToString(new Date(time),pattern):""); + break; + case JnpfKeyConsts.SWITCH: + case JnpfKeyConsts.SLIDER: + case JnpfKeyConsts.RATE: + case JnpfKeyConsts.CALCULATE: + case JnpfKeyConsts.NUM_INPUT: + dataMap.put(vModel, value != null ? new BigDecimal(String.valueOf(value)) : null); + break; + case JnpfKeyConsts.CURRPOSITION: + PositionEntity positionEntity = serviceUtil.getPositionInfo(String.valueOf(value)); + dataMap.put(vModel, Objects.nonNull(positionEntity) ? positionEntity.getFullName() : value); + break; + + case JnpfKeyConsts.CREATEUSER: + case JnpfKeyConsts.MODIFYUSER: + UserEntity userEntity = serviceUtil.getUserInfo(String.valueOf(value)); + String userValue = Objects.nonNull(userEntity) ? userEntity.getAccount().equalsIgnoreCase("admin") + ? "管理员/admin" : userEntity.getRealName() + "/" + userEntity.getAccount() : String.valueOf(value); + dataMap.put(vModel, userValue); + break; + case JnpfKeyConsts.CURRORGANIZE: + String currentOrganizeName = serviceUtil.getCurrentOrganizeName(value, swapDataVo.getShowLevel()); + dataMap.put(vModel, currentOrganizeName); + break; + default: + dataMap.put(vModel, FormPublicUtils.getDataConversion(value)); + break; + } + } + } catch (Exception e) { + throw new RuntimeException(e); + } finally { + DynamicDataSourceUtil.clearSwitchDataSource(); + } + return dataMap; + } + +} diff --git a/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/util/FormPublicUtils.java b/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/util/FormPublicUtils.java new file mode 100644 index 0000000..9741d81 --- /dev/null +++ b/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/util/FormPublicUtils.java @@ -0,0 +1,617 @@ +package jnpf.util; + +import jnpf.model.form.MultipleControlEnum; +import jnpf.model.visualJson.FieLdsModel; +import jnpf.model.visualJson.FormCloumnUtil; +import jnpf.model.visualJson.TableModel; +import jnpf.model.visualJson.analysis.FormAllModel; +import jnpf.model.visualJson.analysis.FormEnum; +import jnpf.model.visualJson.analysis.FormModel; +import jnpf.model.visualJson.analysis.RecursionForm; +import jnpf.model.visualJson.config.ConfigModel; +import jnpf.model.visualJson.props.PropsModel; +import jnpf.util.visiual.JnpfKeyConsts; + +import java.time.Instant; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 在线开发公用 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/7/28 + */ +public class FormPublicUtils { + + /** + * map key转小写 + * + * @param requestMap + * @return + */ + public static Map mapKeyToLower(Map requestMap) { + // 非空校验 + if (requestMap.isEmpty()) { + return null; + } + // 初始化放转换后数据的Map + Map responseMap = new HashMap<>(16); + // 使用迭代器进行循环遍历 + Set requestSet = requestMap.keySet(); + Iterator iterator = requestSet.iterator(); + iterator.forEachRemaining(obj -> { + // 判断Key对应的Value是否为Map + if ((requestMap.get(obj) instanceof Map)) { + // 递归调用,将value中的Map的key转小写 + responseMap.put(obj.toLowerCase(), mapKeyToLower((Map) requestMap.get(obj))); + } else { + // 直接将key小写放入responseMap + responseMap.put(obj.toLowerCase(), requestMap.get(obj)); + } + }); + + return responseMap; + } + + + /** + * 获取map中第一个数据值 + * + * @param map 数据源 + * @return + */ + public static Object getFirstOrNull(Map map) { + Object obj = null; + for (Map.Entry entry : map.entrySet()) { + obj = entry.getValue(); + if (obj != null) { + break; + } + } + return obj; + } + + /** + * 去除列表里无用的控件 + * + * @param fieldsModelList + * @return + */ + public static void removeUseless(List fieldsModelList) { + for (int i = 0; i < fieldsModelList.size(); i++) { + if (fieldsModelList.get(i).getConfig().getJnpfKey() == null) { + continue; + } + if (fieldsModelList.get(i).getConfig().getJnpfKey().equals(JnpfKeyConsts.CHILD_TABLE)) { + continue; + } + } + } + + + /** + * 递归控件 + * + * @param + * @return + */ + public static List recursionFields(List tableModels, List fieLdsModelList) { + List allFields = new ArrayList<>(); + List formAllModel = new ArrayList<>(); + RecursionForm recursionForm = new RecursionForm(); + recursionForm.setTableModelList(tableModels); + recursionForm.setList(fieLdsModelList); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + //主表数据 + List mast = formAllModel.stream().filter(t -> FormEnum.mast.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + + mast.stream().forEach(formModel -> allFields.add(formModel.getFormColumnModel().getFieLdsModel())); + + //列表子表数据 + List mastTable = formAllModel.stream().filter(t -> FormEnum.mastTable.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + + mastTable.stream().forEach(formModel -> allFields.add(formModel.getFormMastTableModel().getMastTable().getFieLdsModel())); + + //子表 + List childTable = formAllModel.stream().filter(t -> FormEnum.table.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + childTable.stream().forEach(formModel -> { + String jnpfKey = formModel.getJnpfKey(); + String vModel = formModel.getChildList().getTableModel(); + List childs = formModel.getChildList().getChildList().stream().map(c -> c.getFieLdsModel()).collect(Collectors.toList()); + FieLdsModel fieLdsModel = new FieLdsModel(); + ConfigModel configModel = new ConfigModel(); + configModel.setJnpfKey(jnpfKey); + configModel.setChildren(childs); + configModel.setTableName(formModel.getChildList().getTableName()); + fieLdsModel.setConfig(configModel); + fieLdsModel.setVModel(vModel); + allFields.add(fieLdsModel); + }); + return allFields; + } + + /** + * 判断字符串是否以某个字符开头 + * + * @param var1 完整字符串 + * @param var2 统计字符 + * @return + */ + public static Boolean getMultiple(String var1, String var2) { + if (var1.startsWith(var2)) { + return true; + } + return false; + } + + /** + * 数据字典处理(从缓存中取出) + * + * @param dataList + * @param swapModel + * @return + */ + public static Map getDataMap(List> dataList, FieLdsModel swapModel) { + PropsModel propsModel = swapModel.getProps(); + Map dataInterfaceMap = new HashMap<>(); + dataList.stream().forEach(data -> { + dataInterfaceMap.put(String.valueOf(data.get(propsModel.getValue())), String.valueOf(data.get(propsModel.getLabel()))); + }); + return dataInterfaceMap; + } + + /** + * 获取时间(+8) + * + * @param date + * @param format + * @return + */ + public static String getDateByFormat(Long date, String format) { + DateTimeFormatter ftf = DateTimeFormatter.ofPattern(format); + String dateString = ftf.format(LocalDateTime.ofInstant(Instant.ofEpochMilli(date), ZoneId.of("+8" ))); + return dateString; + } + + /** + * 递归表单控件 + * + * @param modelList 所有控件 + * @param mainFields 主表 + * @param childFields 子表 + * @param models 二维码 条形码 + */ + public static void recurseFiled(List modelList, List mainFields, List childFields, List models) { + for (FieLdsModel fieLdsModel : modelList) { + ConfigModel config = fieLdsModel.getConfig(); + String jnpfkey = config.getJnpfKey(); + List childrenList = config.getChildren(); + boolean isJnpfKey = StringUtil.isEmpty(jnpfkey); + if (FormEnum.row.getMessage().equals(jnpfkey) || FormEnum.card.getMessage().equals(jnpfkey) + || FormEnum.tab.getMessage().equals(jnpfkey) || FormEnum.collapse.getMessage().equals(jnpfkey) + || isJnpfKey) { + if (childrenList.size() > 0) { + recurseFiled(childrenList, mainFields, childFields, models); + } else { + mainFields.add(fieLdsModel); + } + } else if (FormEnum.table.getMessage().equals(jnpfkey)) { + childFields.add(fieLdsModel); + } else if (FormEnum.groupTitle.getMessage().equals(jnpfkey) || FormEnum.divider.getMessage().equals(jnpfkey) || FormEnum.JNPFText.getMessage().equals(jnpfkey)) { + + } else if (FormEnum.QR_CODE.getMessage().equals(jnpfkey) || FormEnum.BARCODE.getMessage().equals(jnpfkey)) { + FormModel formModel = JsonUtil.getJsonToBean(fieLdsModel, FormModel.class); + models.add(formModel); + } else { + mainFields.add(fieLdsModel); + } + } + } + + public static void recurseOnlineFiled(List modelList, List mainFields, List childFields) { + for (FieLdsModel fieLdsModel : modelList) { + ConfigModel config = fieLdsModel.getConfig(); + String jnpfkey = config.getJnpfKey(); + List childrenList = config.getChildren(); + boolean isJnpfKey = StringUtil.isEmpty(jnpfkey); + if (FormEnum.row.getMessage().equals(jnpfkey) || FormEnum.card.getMessage().equals(jnpfkey) + || FormEnum.tab.getMessage().equals(jnpfkey) || FormEnum.collapse.getMessage().equals(jnpfkey) + || isJnpfKey) { + if (childrenList.size() > 0) { + recurseOnlineFiled(childrenList, mainFields, childFields); + } else { + mainFields.add(fieLdsModel); + } + } else if (FormEnum.table.getMessage().equals(jnpfkey)) { + childFields.add(fieLdsModel); + } else if (FormEnum.groupTitle.getMessage().equals(jnpfkey) || FormEnum.divider.getMessage().equals(jnpfkey) || FormEnum.JNPFText.getMessage().equals(jnpfkey)) { + + } else { + mainFields.add(fieLdsModel); + } + } + } + + /** + * @param redisMap 缓存集合 + * @param modelData 数据 + * @param isMultiple 是否多选 + * @return + */ + public static String getDataInMethod(Map redisMap, Object modelData, Boolean isMultiple) { + if (redisMap == null || redisMap.isEmpty()) { + return modelData.toString(); + } + String Separator = isMultiple ? ";" : "/"; + String s2; + if (FormPublicUtils.getMultiple(String.valueOf(modelData), MultipleControlEnum.MULTIPLE_JSON_TWO.getMultipleChar())) { + String[][] data = JsonUtil.getJsonToBean(String.valueOf(modelData), String[][].class); + List addList = new ArrayList<>(); + for (String[] AddressData : data) { + List adList = new ArrayList<>(); + for (String s : AddressData) { + adList.add(String.valueOf(redisMap.get(s))); + } + addList.add(String.join("/" , adList)); + } + s2 = String.join(";" , addList); + } else if (FormPublicUtils.getMultiple(String.valueOf(modelData), MultipleControlEnum.MULTIPLE_JSON_ONE.getMultipleChar())) { + List modelDataList = JsonUtil.getJsonToList(String.valueOf(modelData), String.class); + modelDataList = modelDataList.stream().map(s -> String.valueOf(redisMap.get(s))).collect(Collectors.toList()); + s2 = String.join(Separator, modelDataList); + } else { + String[] modelDatas = String.valueOf(modelData).split(","); + StringBuilder dynamicData = new StringBuilder(); + for (int i = 0; i < modelDatas.length; i++) { + modelDatas[i] = String.valueOf(redisMap.get(modelDatas[i])); + dynamicData.append(modelDatas[i] + Separator); + } + s2 = dynamicData.deleteCharAt(dynamicData.length() - 1).toString(); + } + return StringUtil.isEmpty(s2) ? modelData.toString() : s2; + } + + /** + * @param mapList + * @return List> + * @Date 21:51 2020/11/11 + * @Description 将map中的所有key转化为小写 + */ + public static List> toLowerKeyList(List> mapList) { + List> newMapList = new ArrayList<>(); + for (Map map : mapList) { + Map resultMap = new HashMap(16); + Set sets = map.keySet(); + for (String key : sets) { + resultMap.put(key.toLowerCase(), map.get(key)); + } + newMapList.add(resultMap); + } + return newMapList; + } + + /** + * 递归控件,除子表外控件全部提到同级 + * 取子集,子表不外提 + * + * @return + */ + public static void recursionFieldsExceptChild(List allFields, List fieLdsModelList) { + for (FieLdsModel fieLdsModel : fieLdsModelList) { + ConfigModel config = fieLdsModel.getConfig(); + String jnpfKey = config.getJnpfKey(); + if (JnpfKeyConsts.CHILD_TABLE.equals(jnpfKey)) { + allFields.add(fieLdsModel); + continue; + } else { + if (config.getChildren() != null) { + recursionFieldsExceptChild(allFields, config.getChildren()); + } else { + if (jnpfKey == null) { + continue; + } + allFields.add(fieLdsModel); + } + } + } + } + + /** + * 转换时间格式 + * + * @param time + * @return + */ + public static String getTimeFormat(String time) { + String result; + switch (time.length()) { + case 16: + result = time + ":00"; + break; + case 19: + result = time; + break; + case 21: + result = time.substring(0, time.length() - 2); + break; + case 10: + result = time + " 00:00:00"; + break; + case 8: + result = "2000-01-01 " + time; + break; + case 7: + result = time + "-01 00:00:00"; + break; + case 4: + result = time + "-01-01 00:00:00"; + break; + default: + result = ""; + break; + } + return result; + } + + public static String getLastTimeFormat(String time) { + String result; + switch (time.length()) { + case 16: + result = time + ":00"; + break; + case 19: + result = time; + break; + case 10: + result = time + " 23:59:59"; + break; + case 8: + result = "2000-01-01 " + time; + break; + case 7: + //获取月份最后一天 + String[] split = time.split("-"); + Calendar cale = Calendar.getInstance(); + cale.set(Calendar.YEAR, Integer.valueOf(split[0]));//赋值年份 + cale.set(Calendar.MONTH, Integer.valueOf(split[1]) - 1);//赋值月份 + int lastDay = cale.getActualMaximum(Calendar.DAY_OF_MONTH);//获取月最大天数 + cale.set(Calendar.DAY_OF_MONTH, lastDay);//设置日历中月份的最大天数 + cale.set(Calendar.HOUR_OF_DAY, 23); + cale.set(Calendar.SECOND, 59); + cale.set(Calendar.MINUTE, 59); + result = DateUtil.daFormatHHMMSS(cale.getTime().getTime()); + break; + case 4: + result = time + "-12-31 23:59:59"; + break; + default: + result = ""; + break; + } + return result; + } + + /** + * 判断时间是否在设置范围内 + * + * @param swapDataVo + * @param format + * @param value + * @param data + * @param jnpfKey + * @return + */ + public static boolean dateTimeCondition(FieLdsModel swapDataVo, String format, Object value, Map data, String jnpfKey) { + long valueTimeLong; + //输入值转long + if (value instanceof String) { + valueTimeLong = cn.hutool.core.date.DateUtil.parse(String.valueOf(value), format).getTime(); + } else { + //输入值按格式补全 + String timeFormat = getTimeFormat(String.valueOf(value)); + valueTimeLong = DateUtil.stringToDate(timeFormat).getTime(); + } + boolean timeHasRangeError = false; + //开始时间判断 + if ((swapDataVo.getConfig().getStartTimeRule() && StringUtil.isNotEmpty(swapDataVo.getConfig().getStartTimeValue())) + || (swapDataVo.getConfig().getStartTimeRule()) && StringUtil.isNotEmpty(swapDataVo.getConfig().getStartRelationField())) { + String startTimeValue = swapDataVo.getConfig().getStartTimeValue(); + String startTimeType = swapDataVo.getConfig().getStartTimeType(); + String startTimeTarget = swapDataVo.getConfig().getStartTimeTarget(); + String startTimeRelationField = swapDataVo.getConfig().getStartRelationField(); + //根据类型获取开始时间戳 + long startTimeLong = getDateTimeLong(data, jnpfKey, startTimeValue, startTimeType, startTimeTarget, startTimeRelationField); + if (startTimeLong != 0 && valueTimeLong < startTimeLong) { + timeHasRangeError = true; + } + } + //结束时间判断 + if ((swapDataVo.getConfig().getEndTimeRule() && StringUtil.isNotEmpty(swapDataVo.getConfig().getEndTimeValue())) + || (swapDataVo.getConfig().getEndTimeRule()) && StringUtil.isNotEmpty(swapDataVo.getConfig().getEndRelationField())) { + String endTimeValue = swapDataVo.getConfig().getEndTimeValue(); + String endTimeType = swapDataVo.getConfig().getEndTimeType(); + String endTimeTarget = swapDataVo.getConfig().getEndTimeTarget(); + String endTimeRelationField = swapDataVo.getConfig().getEndRelationField(); + //根据类型获取开始时间戳 + long endTimeLong = getDateTimeLong(data, jnpfKey, endTimeValue, endTimeType, endTimeTarget, endTimeRelationField); + if (endTimeLong != 0 && valueTimeLong > endTimeLong) { + timeHasRangeError = true; + } + } + return timeHasRangeError; + } + + /** + * 根据类型获取时间戳 + * + * @param data + * @param jnpfKey + * @param timeValue + * @param timeType + * @param timeTarget + * @return + */ + private static long getDateTimeLong(Map data, String jnpfKey, String timeValue, String timeType, String timeTarget, + String stringimeRelationField) { + long startTimeLong = 0; + switch (timeType) { + case "1"://特定时间 + startTimeLong = Long.parseLong(timeValue); + break; + case "2"://表单字段 + if (stringimeRelationField != null) { + String fieldValue = ""; + if (stringimeRelationField.toLowerCase().contains(JnpfKeyConsts.CHILD_TABLE_PREFIX)) {//子 + String[] split = stringimeRelationField.split("-"); + fieldValue = data.get(split[1]) != null ? data.get(split[1]).toString() : ""; + } else {//主副 + Map mainAndMast = data.get("mainAndMast") != null ? JsonUtil.entityToMap(data.get("mainAndMast")) : data; + fieldValue = mainAndMast.get(stringimeRelationField) != null ? mainAndMast.get(stringimeRelationField).toString() : ""; + } + if (StringUtil.isNotEmpty(fieldValue)) { + String timeFormat = getTimeFormat(fieldValue); + startTimeLong = cn.hutool.core.date.DateUtil.parse(timeFormat, "yyyy-MM-dd HH:mm:ss").getTime(); + } + } + break; + case "3"://填写当前时间 + startTimeLong = new Date().getTime(); + break; + case "4"://当前时间前 + Calendar caledel = Calendar.getInstance(); + if (JnpfKeyConsts.DATE.equals(jnpfKey)) { + switch (timeTarget) { + case "1"://年 + caledel.set(Calendar.YEAR, caledel.get(Calendar.YEAR) - Integer.valueOf(timeValue));//赋值年份 + break; + case "2"://月 + caledel.set(Calendar.MONTH, caledel.get(Calendar.MONTH) - Integer.valueOf(timeValue)); + break; + case "3"://日 + caledel.set(Calendar.DAY_OF_MONTH, caledel.get(Calendar.DAY_OF_MONTH) - Integer.valueOf(timeValue)); + break; + } + } else { + switch (timeTarget) { + case "1"://时 + caledel.set(Calendar.HOUR_OF_DAY, caledel.get(Calendar.HOUR_OF_DAY) - Integer.valueOf(timeValue)); + break; + case "2"://分 + caledel.set(Calendar.MINUTE, caledel.get(Calendar.MINUTE) - Integer.valueOf(timeValue)); + break; + case "3"://秒 + caledel.set(Calendar.SECOND, caledel.get(Calendar.SECOND) - Integer.valueOf(timeValue)); + break; + } + } + startTimeLong = caledel.getTime().getTime(); + break; + case "5"://当前时间后 + Calendar cale = Calendar.getInstance(); + if (JnpfKeyConsts.DATE.equals(jnpfKey)) { + switch (timeTarget) { + case "1"://年 + cale.set(Calendar.YEAR, cale.get(Calendar.YEAR) + Integer.valueOf(timeValue));//赋值年份 + break; + case "2"://月 + cale.set(Calendar.MONTH, cale.get(Calendar.MONTH) + Integer.valueOf(timeValue)); + break; + case "3"://日 + cale.set(Calendar.DAY_OF_MONTH, cale.get(Calendar.DAY_OF_MONTH) + Integer.valueOf(timeValue)); + break; + } + } else { + switch (timeTarget) { + case "1"://时 + cale.set(Calendar.HOUR_OF_DAY, cale.get(Calendar.HOUR_OF_DAY) + Integer.valueOf(timeValue)); + break; + case "2"://分 + cale.set(Calendar.MINUTE, cale.get(Calendar.MINUTE) + Integer.valueOf(timeValue)); + break; + case "3"://秒 + cale.set(Calendar.SECOND, cale.get(Calendar.SECOND) + Integer.valueOf(timeValue)); + break; + } + } + startTimeLong = cale.getTime().getTime(); + break; + default: + break; + } + return startTimeLong; + } + + /** + * 字符串转数组 + * + * @param value 值 + * @return + */ + public static Object getDataConversion(Object value) { + Object dataValue = getDataConversion(null, value,false,"/"); + return dataValue; + } + + /** + * 字符串转数组 + * + * @param redis 转换对象 + * @param value 值 + * @return + */ + public static Object getDataConversion(Map redis, Object value,boolean isMultiple,String separator) { + Object dataValue = value; + boolean iszhuanhuan = redis != null; + try { + List list = JsonUtil.getJsonToList(String.valueOf(value), List.class); + dataValue = list; + if (iszhuanhuan) { + //一级分隔符 + StringJoiner joiner = new StringJoiner(","); + for (List listChild : list) { + StringJoiner aa = new StringJoiner(separator); + for (Object object : listChild) { + String value1 = redis.get(String.valueOf(object)) != null ? String.valueOf(redis.get(String.valueOf(object))) : ""; + if (StringUtil.isNotEmpty(value1)) { + aa.add(value1); + } + } + joiner.add(aa.toString()); + } + dataValue = joiner.toString(); + } + } catch (Exception e) { + try { + List list = JsonUtil.getJsonToList(String.valueOf(value), String.class); + dataValue = list; + if (iszhuanhuan) { + if(isMultiple){//一级分隔符 + separator=","; + } + StringJoiner joiner = new StringJoiner(separator); + for (Object listChild : list) { + String value1 = redis.get(String.valueOf(listChild)) != null ? String.valueOf(redis.get(String.valueOf(listChild))) : ""; + if (StringUtil.isNotEmpty(value1)) { + joiner.add(value1); + } + } + dataValue = joiner.toString(); + } + } catch (Exception e1) { + dataValue = String.valueOf(value); + if (iszhuanhuan) { + dataValue = redis.get(String.valueOf(value)) != null ? String.valueOf(redis.get(String.valueOf(value))) : ""; + } + } + } + return dataValue; + } + +} + diff --git a/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/util/ServiceBaseUtil.java b/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/util/ServiceBaseUtil.java new file mode 100644 index 0000000..3b066fd --- /dev/null +++ b/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/util/ServiceBaseUtil.java @@ -0,0 +1,266 @@ +package jnpf.util; + +import com.baomidou.dynamic.datasource.annotation.DS; +import jnpf.base.Page; +import jnpf.base.Pagination; +import jnpf.base.entity.DictionaryDataEntity; +import jnpf.base.service.*; +import jnpf.database.model.dbfield.DbFieldModel; +import jnpf.database.model.dbfield.base.DbFieldModelBase; +import jnpf.database.model.dbtable.DbTableFieldModel; +import jnpf.database.model.entity.DbLinkEntity; +import jnpf.permission.entity.*; +import jnpf.permission.model.user.vo.UserByRoleVO; +import jnpf.permission.service.*; +import jnpf.util.enums.DictionaryDataEnum; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author :JNPF开发平台组 + * @version: V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date :2022/4/9 13:28 + */ +@Component +@DS("") +public class ServiceBaseUtil { + + @Autowired + private DbLinkService dblinkService; + @Autowired + private DbTableService dbTableService; + @Autowired + private DictionaryDataService dictionaryDataService; + @Autowired + private DictionaryTypeService dictionaryTypeService; + @Autowired + private UserRelationService userRelationService; + @Autowired + private UserService userService; + @Autowired + private RoleService roleService; + @Autowired + private OrganizeService organizeService; + @Autowired + private PositionService positionService; + @Autowired + private BillRuleService billRuleService; + @Autowired + private DataInterfaceService dataInterfaceService; + + //--------------------------------数据连接------------------------------ + public DbLinkEntity getDbLink(String dbLink) { + DbLinkEntity link = StringUtil.isNotEmpty(dbLink) ? dblinkService.getInfo(dbLink) : null; + return link; + } + + public void createTable(List dbTable) throws Exception { + for (DbTableFieldModel dbTableFieldModel : dbTable) { + dbTableService.createTable(dbTableFieldModel); + } + } + + public void addField(DbTableFieldModel dbTable) throws Exception { + dbTableService.addField(dbTable); + } + + public List getDbTableModel(String linkId, String table) throws Exception { + List dbFieldModelList = dbTableService.getDbTableModel(linkId, table).getDbFieldModelList(); + List list = JsonUtil.getJsonToList(dbFieldModelList,DbFieldModelBase.class); + return list; + } + + /** + * 获取所有字段 + * @param linkId 链接名 + * @param table 表名 + * @return + * @throws Exception + */ + public List getFieldList(String linkId, String table) throws Exception { + return dbTableService.getFieldList(linkId, table); + } + + + //--------------------------------数据字典------------------------------ + public List getDiList() { + List dictionList = dictionaryDataService.getList(dictionaryTypeService.getInfoByEnCode(DictionaryDataEnum.FLOWWOEK_ENGINE.getDictionaryTypeId()).getId()); + return dictionList; + } + + public List getDictionName(List id) { + List dictionList = dictionaryDataService.getDictionName(id); + return dictionList; + } + + //--------------------------------用户关系表------------------------------ + public List getListByUserIdAll(List id) { + List list = userRelationService.getListByUserIdAll(id); + return list; + } + + public List getListByObjectIdAll(List id) { + List list = userRelationService.getListByObjectIdAll(id); + return list; + } + + public String getAdmin() { + UserEntity admin = userService.getUserByAccount("admin"); + return admin.getId(); + } + + //--------------------------------用户------------------------------ + public List getUserName(List id) { + List list = getUserName(id, false); + return list; + } + + public List getListByManagerId(String managerId) { + List list = StringUtil.isNotEmpty(managerId) ? userService.getListByManagerId(managerId, null) : new ArrayList<>(); + return list; + } + + public List getUserName(List id, boolean enableMark) { + List list = userService.getUserName(id); + if (enableMark) { + list = list.stream().filter(t -> t.getEnabledMark() != 0).collect(Collectors.toList()); + } + return list; + } + + public List getUserName(List id, Pagination pagination) { + List list = userService.getUserName(id, pagination); + return list; + } + + public UserEntity getUserInfo(String id) { + UserEntity entity = null; + if (StringUtil.isNotEmpty(id)) { + entity = id.equalsIgnoreCase("admin") ? userService.getUserByAccount(id) : userService.getInfo(id); + } + return entity; + } + + public UserEntity getByRealName(String realName) { + UserEntity entity = StringUtil.isNotEmpty(realName) ? userService.getByRealName(realName) : null; + return entity; + } + + public List getListByAuthorize(String organizeId) { + List list = userService.getListByAuthorize(organizeId, new Page()); + return list; + } + + //--------------------------------单据规则------------------------------ + public String getBillNumber(String enCode) { + String billNo = ""; + try { + billNo = billRuleService.getBillNumber(enCode, false); + } catch (Exception e) { + + } + return billNo; + } + + public void useBillNumber(String enCode) { + billRuleService.useBillNumber(enCode); + } + + //--------------------------------角色------------------------------ + public List getListByIds(List id) { + List list = roleService.getListByIds(id, null, false); + return list; + } + + //--------------------------------组织------------------------------ + public List getOrganizeName(List id) { + List list = organizeService.getOrganizeName(id); + return list; + } + + public OrganizeEntity getOrganizeInfo(String id) { + OrganizeEntity entity = StringUtil.isNotEmpty(id) ? organizeService.getInfo(id) : null; + return entity; + } + + public OrganizeEntity getOrganizeFullName(String fullName) { + OrganizeEntity entity = organizeService.getByFullName(fullName); + return entity; + } + + public List getOrganizeId(String organizeId) { + List organizeList = new ArrayList<>(); + organizeService.getOrganizeId(organizeId, organizeList); + Collections.reverse(organizeList); + return organizeList; + } + + public List getDepartmentAll(String organizeId) { + List departmentAll = organizeService.getDepartmentAll(organizeId); + return departmentAll; + } + + /** + * 获取当前组织名称(all-显示组织名,else 显示部门名) + * + * @param obj + * @param showLevel + * @return + */ + public String getCurrentOrganizeName(Object obj, String showLevel) { + if(obj==null){ + return null; + } + String value=String.valueOf(obj); + String orgName = ""; + if (value != null) { + String orgId = ""; + try { + List jsonToList = JsonUtil.getJsonToList(value, String.class); + orgId = jsonToList.get(jsonToList.size() - 1); + } catch (Exception e) { + orgId = value; + } + OrganizeEntity organizeEntity = this.getOrganizeInfo(orgId); + if ("all".equals(showLevel)) { + if (organizeEntity != null) { + List organizeList = this.getOrganizeId(organizeEntity.getId()); + orgName = organizeList.stream().map(OrganizeEntity::getFullName).collect(Collectors.joining("/")); + } + } else { + if (organizeEntity != null) { + orgName = organizeEntity.getFullName(); + } else { + orgName = " "; + } + } + } + return orgName; + } + + //--------------------------------岗位------------------------------ + public List getPositionName(List id) { + List list = positionService.getPositionName(id, false); + return list; + } + + public PositionEntity getPositionFullName(String fullName) { + PositionEntity entity = positionService.getByFullName(fullName); + return entity; + } + + public PositionEntity getPositionInfo(String id) { + PositionEntity entity = StringUtil.isNotEmpty(id) ? positionService.getInfo(id) : null; + return entity; + } + + //--------------------------------远端------------------------------ + public void infoToId(String interId, Map parameterMap) { + dataInterfaceService.infoToId(interId, null, parameterMap); + } + +} diff --git a/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/util/VisualDevTableCre.java b/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/util/VisualDevTableCre.java new file mode 100644 index 0000000..a4212fe --- /dev/null +++ b/jnpf-java-boot/jnpf-form/jnpf-form-biz/src/main/java/jnpf/util/VisualDevTableCre.java @@ -0,0 +1,327 @@ +package jnpf.util; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import jnpf.database.constant.DbFieldConst; +import jnpf.database.model.dbfield.DbFieldModel; +import jnpf.database.model.dbtable.DbTableFieldModel; +import jnpf.database.model.entity.DbLinkEntity; +import jnpf.database.source.DbBase; +import jnpf.database.util.DataSourceUtil; +import jnpf.exception.WorkFlowException; +import jnpf.model.form.VisualTableModel; +import jnpf.model.visualJson.FieLdsModel; +import jnpf.model.visualJson.TableFields; +import jnpf.model.visualJson.TableModel; +import jnpf.model.visualJson.analysis.FormAllModel; +import jnpf.model.visualJson.analysis.FormColumnTableModel; +import jnpf.model.visualJson.analysis.FormEnum; +import jnpf.util.visiual.JnpfKeyConsts; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author :JNPF开发平台组 + * @version: V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date :2022/3/25 9:30 + */ +@Slf4j +@Component +public class VisualDevTableCre { + private static String relationField = TableFeildsEnum.FID.getField(); + private static String tableField = TableFeildsEnum.FOREIGN.getField(); + @Autowired + private ServiceBaseUtil serviceUtil; + @Autowired + private DataSourceUtil dataSourceUtil; + + /** + * 表单赋值tableName + * + * @param jsonArray + * @param tableModels + */ + private void fieldsTableName(JSONArray jsonArray, List tableModels) { + for (int i = 0; i < jsonArray.size(); i++) { + JSONObject jsonObject = (JSONObject) jsonArray.get(i); + String jnpfkey = jsonObject.getJSONObject("__config__").getString("jnpfKey"); + List childrenListAll = new ArrayList(){{ + add(FormEnum.card.getMessage()); + add(FormEnum.row.getMessage()); + add(FormEnum.tab.getMessage()); + add(FormEnum.collapse.getMessage()); + add(FormEnum.collapseItem.getMessage()); + add(FormEnum.tabItem.getMessage()); + add(FormEnum.tableGrid.getMessage()); + add(FormEnum.tableGridTr.getMessage()); + add(FormEnum.tableGridTd.getMessage()); + }}; + if (childrenListAll.contains(jnpfkey) || StringUtil.isEmpty(jnpfkey)) { + JSONArray childArray = jsonObject.getJSONObject("__config__").getJSONArray("children"); + this.fieldsTableName(childArray, tableModels); + jsonObject.getJSONObject("__config__" ).put("children" , childArray); + } else if (FormEnum.table.getMessage().equals(jnpfkey)) { + JSONArray childrenList = new JSONArray(); + JSONArray children = jsonObject.getJSONObject("__config__" ).getJSONArray("children" ); + String tableModel = ""; + for (int k = 0; k < children.size(); k++) { + JSONObject childrenObject = (JSONObject) children.get(k); + this.fieldsModel(childrenObject, tableModels); + if (StringUtil.isEmpty(tableModel)) { + tableModel = childrenObject.getJSONObject("__config__" ).getString("relationTable" ); + } + childrenList.add(childrenObject); + } + jsonObject.getJSONObject("__config__" ).put("tableName" , tableModel); + jsonObject.getJSONObject("__config__" ).put("children" , childrenList); + } else { + this.fieldsModel(jsonObject, tableModels); + } + } + } + + /** + * 赋值table + * + * @param jsonObject + * @param tableModels + */ + private TableModel fieldsModel(JSONObject jsonObject, List tableModels) { + String vModel = jsonObject.getString("__vModel__" ); + String relationField = StringUtil.isNotEmpty(jsonObject.getString("relationField" )) ? jsonObject.getString("relationField" ) : ""; + String jnpfkey = jsonObject.getJSONObject("__config__" ).getString("jnpfKey" ); + TableModel tableName = tableModels.stream().filter(t -> "1".equals(t.getTypeId())).findFirst().orElse(null); + if (tableName != null) { + jsonObject.getJSONObject("__config__" ).put("tableName" , tableName.getTable()); + } + List childTableAll = tableModels.stream().filter(t -> "0".equals(t.getTypeId())).collect(Collectors.toList()); + TableModel childTableaa = childTableAll.stream().filter(t -> t.getFields().stream().filter(k -> k.getField().equals(vModel)).count() > 0).findFirst().orElse(null); + if (childTableaa != null) { + jsonObject.getJSONObject("__config__" ).put("relationTable" , childTableaa.getTable()); + } + if (FormEnum.relationFormAttr.getMessage().equals(jnpfkey) || FormEnum.popupAttr.getMessage().equals(jnpfkey)) { + if (StringUtil.isNotEmpty(relationField)) { + Boolean isSubTable = jsonObject.getJSONObject("__config__" ).getBooleanValue("isSubTable" ); + String model = relationField.split("_jnpfTable_" )[0]; + jsonObject.put("relationField" , model + "_jnpfTable_" + tableName.getTable() + (isSubTable ? "0" : "1" )); + } + } + return childTableaa; + } + + /** + * 创建表 + * + * @return + */ + public List tableList(VisualTableModel visualTableModel) throws WorkFlowException { + JSONArray jsonArray = visualTableModel.getJsonArray(); + List formAllModel = visualTableModel.getFormAllModel(); + String table = visualTableModel.getTable(); + String linkId = visualTableModel.getLinkId(); + String fullName = visualTableModel.getFullName(); + int primaryKey = visualTableModel.getPrimaryKey(); + List tableModelList = new LinkedList<>(); + Map tableNameList = new HashMap<>(); + DbLinkEntity dbLink = serviceUtil.getDbLink(linkId); + String type = dbLink != null ? dbLink.getDbType() : dataSourceUtil.getDbType(); + boolean isUpperCase = (DbBase.DM.equals(type) || DbBase.ORACLE.equals(type)); + boolean isLowerCase = (DbBase.POSTGRE_SQL.equals(type) || DbBase.KINGBASE_ES.equals(type)); + table = tableName(table, isUpperCase, isLowerCase); + relationField = tableName(relationField, isUpperCase, isLowerCase); + tableField = tableName(tableField, isUpperCase, isLowerCase); + try { + List fieldList = new ArrayList<>(); + Map> tableListAll = new HashMap<>(); + for (FormAllModel model : formAllModel) { + if (FormEnum.mast.getMessage().equals(model.getJnpfKey())) { + FieLdsModel fieLdsModel = model.getFormColumnModel().getFieLdsModel(); + this.fieldList(fieLdsModel, table, fieldList); + } else if (FormEnum.table.getMessage().equals(model.getJnpfKey())) { + String tableName = "ct" + RandomUtil.uuId(); + FormColumnTableModel fieLdsModel = model.getChildList(); + List tableList = new ArrayList<>(); + String tableModel = fieLdsModel.getTableModel(); + List fieldsList = fieLdsModel.getChildList().stream().map(t -> t.getFieLdsModel()).collect(Collectors.toList()); + for (FieLdsModel tableFieLdsModel : fieldsList) { + this.fieldList(tableFieLdsModel, tableName, tableList); + } + this.dbTableField(tableList, true, primaryKey); + tableNameList.put(tableModel, tableName); + tableListAll.put(tableModel, tableList); + } + } + + fieldList.add(ConcurrencyUtils.getDbFieldModel(TableFeildsEnum.FLOWID)); + fieldList.add(ConcurrencyUtils.getDbFieldModel(TableFeildsEnum.VERSION)); + fieldList.add(ConcurrencyUtils.getDbFieldModel(TableFeildsEnum.FLOWTASKID)); + fieldList.add(ConcurrencyUtils.getDbFieldModel(TableFeildsEnum.TENANTID)); + if(visualTableModel.getLogicalDelete()) {//删除标志字段 + fieldList.add(ConcurrencyUtils.getDbFieldModel(TableFeildsEnum.DELETEMARK)); + } + this.dbTableField(fieldList, false, primaryKey); + List dbTableList = new ArrayList<>(); + //创建子表 + for (String key : tableListAll.keySet()) { + String tableName = tableName(tableNameList.get(key), isUpperCase, isLowerCase); + List datableList = tableListAll.get(key); + this.tableModel(tableModelList, datableList, tableName, table, true); + datableList.add(ConcurrencyUtils.getDbFieldModel(TableFeildsEnum.TENANTID)); + DbTableFieldModel dbTable = this.dbTable(linkId, tableName, datableList, true, fullName); + dbTableList.add(dbTable); + } + this.tableModel(tableModelList, fieldList, table, table, false); + DbTableFieldModel dbTable = this.dbTable(linkId, table, fieldList, false, fullName); + dbTableList.add(dbTable); + serviceUtil.createTable(dbTableList); + this.fieldsTableName(jsonArray, tableModelList); + } catch (Exception e) { + e.printStackTrace(); + log.error("表新增错误:{}" , e.getMessage()); + throw new WorkFlowException("表新增错误:" + e.getMessage()); + } + return tableModelList; + } + + /** + * 表名 + * + * @param tableName + * @param isUpperCase + * @param isLowerCase + * @return + */ + private String tableName(String tableName, boolean isUpperCase, boolean isLowerCase) { + String resultName = isUpperCase ? tableName.toUpperCase() : isLowerCase ? tableName.toLowerCase() : tableName; + return resultName; + } + + /** + * 获取表单字段 + * + * @param fieLdsModel + * @param tableList + */ + private void fieldList(FieLdsModel fieLdsModel, String table, List tableList) { + String vmodel = fieLdsModel.getVModel(); + String lable = fieLdsModel.getConfig().getLabel(); + String jnpfkey = fieLdsModel.getConfig().getJnpfKey(); + fieLdsModel.getConfig().setTableName(table); + if (StringUtil.isNotEmpty(vmodel)) { + DbFieldModel fieldForm = new DbFieldModel(); + fieldForm.setNullSign(DbFieldConst.NULL); + fieldForm.setDataType("varchar" ); + fieldForm.setLength("255" ); + fieldForm.setIsPrimaryKey(false); + if (StringUtil.isNotEmpty(fieLdsModel.getVModel())) { + List text = new ArrayList() {{ + add(JnpfKeyConsts.UPLOADIMG); + add(JnpfKeyConsts.UPLOADFZ); + }}; + if (text.contains(jnpfkey)) { + fieldForm.setDataType("text" ); + } + if (jnpfkey.equals(JnpfKeyConsts.EDITOR)) { + fieldForm.setDataType("text" ); + } + List date = new ArrayList() {{ + add(JnpfKeyConsts.MODIFYTIME); + add(JnpfKeyConsts.CREATETIME); + add(JnpfKeyConsts.DATE); + }}; + if (date.contains(jnpfkey)) { + fieldForm.setDataType("datetime" ); + } + if (JnpfKeyConsts.NUM_INPUT.equals(jnpfkey) || JnpfKeyConsts.CALCULATE.equals(jnpfkey)) { + fieldForm.setDataType("decimal"); + String precision = "15"; + if (fieLdsModel.getPrecision() != null) { + precision=String.valueOf(fieLdsModel.getPrecision()); + } + fieldForm.setLength("38," + precision); + //mysql 最大长度65,Oracle和postgresql最大长度38,精度0-最大长度内取值,当前系统默认给15最大 + } + fieldForm.setField(vmodel); + fieldForm.setComment(lable); + tableList.add(fieldForm); + } + } + } + + /** + * 创建主外键字段 + * + * @param tableList + * @param isforeign + */ + private void dbTableField(List tableList, boolean isforeign, int primaryKey) { + boolean uuid = primaryKey == 1; + DbFieldModel tableKey = new DbFieldModel(); + tableKey.setNullSign(DbFieldConst.NOT_NULL); + tableKey.setDataType(!uuid ? "int" : "varchar" ); + tableKey.setLength(TableFeildsEnum.FID.getLength() ); + tableKey.setIsPrimaryKey(true); + tableKey.setField(relationField); + tableKey.setIsAutoIncrement(!uuid); + tableKey.setComment(TableFeildsEnum.FID.getComment() ); + tableList.add(tableKey); + if (isforeign) { + DbFieldModel tableForeignKey = new DbFieldModel(); + tableForeignKey.setNullSign(DbFieldConst.NULL); + tableForeignKey.setDataType(TableFeildsEnum.FOREIGN.getDataType() ); + tableForeignKey.setLength(TableFeildsEnum.FOREIGN.getLength() ); + tableForeignKey.setIsPrimaryKey(false); + tableForeignKey.setField(tableField); + tableForeignKey.setComment(TableFeildsEnum.FOREIGN.getComment() ); + tableList.add(tableForeignKey); + } + } + + /** + * 组装字段list + * + * @param tableModelList + * @param dbtable + * @param table + * @param mastTable + * @param isforeign + */ + private void tableModel(List tableModelList, List dbtable, String table, String mastTable, boolean isforeign) { + TableModel tableModel = new TableModel(); + tableModel.setRelationField(isforeign ? relationField : "" ); + tableModel.setRelationTable(isforeign ? mastTable : "" ); + tableModel.setTable(table); + tableModel.setComment(isforeign ? "子表" : "主表" ); + tableModel.setTableField(isforeign ? tableField : "" ); + tableModel.setTypeId(isforeign ? "0" : "1" ); + tableModel.setFields(JsonUtil.getJsonToList(dbtable, TableFields.class)); + tableModelList.add(tableModel); + } + + /** + * 组装创表字段 + * + * @param linkId + * @param tableName + * @param tableFieldList + * @param isforeign + * @return + */ + private DbTableFieldModel dbTable(String linkId, String tableName, List tableFieldList, boolean isforeign, String fullName) { + DbTableFieldModel dbTable = new DbTableFieldModel(); + dbTable.setDbLinkId(linkId); + dbTable.setTable(tableName); + dbTable.setDbFieldModelList(tableFieldList); + String s = isforeign ? "子表" : "主表"; + if (fullName.contains("&" )) {//自动生成表备注的时候带&符号创建不成功问题 + fullName = fullName.replace("&" , " " ); + } + dbTable.setComment(String.format("%s-%s" , fullName, s)); + return dbTable; + } +} diff --git a/jnpf-java-boot/jnpf-form/jnpf-form-controller/pom.xml b/jnpf-java-boot/jnpf-form/jnpf-form-controller/pom.xml new file mode 100644 index 0000000..b0f5e93 --- /dev/null +++ b/jnpf-java-boot/jnpf-form/jnpf-form-controller/pom.xml @@ -0,0 +1,22 @@ + + + + jnpf-form + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-form-controller + + + + com.jnpf + jnpf-form-biz + ${project.version} + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-form/jnpf-form-controller/src/main/java/jnpf/controller/FlowFormController.java b/jnpf-java-boot/jnpf-form/jnpf-form-controller/src/main/java/jnpf/controller/FlowFormController.java new file mode 100644 index 0000000..d21fd49 --- /dev/null +++ b/jnpf-java-boot/jnpf-form/jnpf-form-controller/src/main/java/jnpf/controller/FlowFormController.java @@ -0,0 +1,315 @@ +package jnpf.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.annotation.SaMode; +import cn.hutool.core.util.ObjectUtil; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import jnpf.base.controller.SuperController; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.vo.DownloadVO; +import jnpf.base.vo.PaginationVO; +import jnpf.config.ConfigValueUtil; +import jnpf.constant.MsgCode; +import jnpf.entity.FlowFormEntity; +import jnpf.entity.FlowFormRelationEntity; +import jnpf.exception.WorkFlowException; +import jnpf.model.flow.FlowTempInfoModel; +import jnpf.model.form.*; +import jnpf.model.visualJson.FormCloumnUtil; +import jnpf.model.visualJson.FormDataModel; +import jnpf.model.visualJson.analysis.RecursionForm; +import jnpf.model.visualJson.TableModel; +import jnpf.model.visualJson.FieLdsModel; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.UserService; +import jnpf.service.FlowFormRelationService; +import jnpf.service.FlowFormService; +import jnpf.util.*; +import jnpf.emnus.ModuleTypeEnum; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.util.*; + +/** + * 流程设计 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/6/30 18:03 + */ +@Tag(name = "流程表单控制器", description = "FlowForm") +@RestController +@RequestMapping("/api/flowForm/Form") +public class FlowFormController extends SuperController { + @Autowired + private FlowFormService flowFormService; + + @Autowired + private UserProvider userProvider; + + @Autowired + private UserService userService; + + @Autowired + private DataFileExport fileExport; + + @Autowired + private ConfigValueUtil configValueUtil; + + @Autowired + private FlowFormRelationService flowFormRelationService; + + @Operation(summary = "表单列表" ) + @GetMapping + @SaCheckPermission("formDesign" ) + public ActionResult getList(FlowFormPage flowFormPage) { + List list = flowFormService.getList(flowFormPage); + List listVo = JsonUtil.getJsonToList(list, FlowFormVo.class); + listVo.stream().forEach(item -> { + if (StringUtil.isNotEmpty(item.getCreatorUserId())) { + UserEntity info = userService.getInfo(item.getCreatorUserId()); + if (info != null) item.setCreatorUser(info.getRealName() + "/" + info.getAccount()); + } + if (StringUtil.isNotEmpty(item.getLastModifyUserId())) { + UserEntity info = userService.getInfo(item.getLastModifyUserId()); + if (info != null) item.setLastModifyUser(info.getRealName() + "/" + info.getAccount()); + } + item.setIsRelease(item.getState()); + }); + PaginationVO paginationVO = JsonUtil.getJsonToBean(flowFormPage, PaginationVO.class); + return ActionResult.page(listVo, paginationVO); + } + + @Operation(summary = "表单下拉列表" ) + @GetMapping("/select" ) + @SaCheckPermission("formDesign" ) + public ActionResult getListForSelect(FlowFormPage flowFormPage) { + List list = flowFormService.getListForSelect(flowFormPage); + List listVo = JsonUtil.getJsonToList(list, FlowSelectVo.class); + PaginationVO paginationVO = JsonUtil.getJsonToBean(flowFormPage, PaginationVO.class); + return ActionResult.page(listVo, paginationVO); + } + + @Operation(summary = "查看" ) + @Parameters({ + @Parameter(name = "id" , description = "主键" , required = true) + }) + @GetMapping("/{id}" ) + @SaCheckPermission(value = {"formDesign" , "onlineDev.webDesign","generator.webForm","generator.flowForm"}, mode = SaMode.OR) + public ActionResult getInfo(@PathVariable("id" ) String id) { + FlowFormEntity entity = flowFormService.getById(id); + FlowFormVo vo = JsonUtil.getJsonToBean(entity, FlowFormVo.class); + if (ObjectUtil.isNotEmpty(entity.getDraftJson())) { + FormDraftJsonModel formDraft = JsonUtil.getJsonToBean(entity.getDraftJson(), FormDraftJsonModel.class); + vo.setDraftJson(Optional.ofNullable(formDraft.getDraftJson()).orElse(null)); + vo.setTableJson(formDraft.getTableJson()); + } + return ActionResult.success(vo); + } + + @Operation(summary = "保存表单" ) + @PostMapping + @SaCheckPermission("formDesign" ) + public ActionResult save(@RequestBody FlowFormModel formModel) throws WorkFlowException { + FlowFormEntity entity = JsonUtil.getJsonToBean(formModel, FlowFormEntity.class); + //判断子表是否复用 + if (formModel.getFormType() == 2 && entity.getDraftJson() != null) { + RecursionForm recursionForm = new RecursionForm(); + FormDataModel formData = JsonUtil.getJsonToBean(entity.getDraftJson(), FormDataModel.class); + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + recursionForm.setList(list); + List tableModelList = JsonUtil.getJsonToList(entity.getTableJson(), TableModel.class); + recursionForm.setTableModelList(tableModelList); + if (FormCloumnUtil.repetition(recursionForm, new ArrayList<>())) { + return ActionResult.fail("子表重复" ); + } + } + //判断名称是否重复 + if (flowFormService.isExistByFullName(entity.getFullName(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + //判断编码是否重复 + if (flowFormService.isExistByEnCode(entity.getEnCode(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + entity.setCreatorUserId(userProvider.get().getUserId()); + entity.setCreatorTime(new Date()); + entity.setState(0); + entity.setEnabledMark(0);//首次创建为未发布 + flowFormService.create(entity); + return ActionResult.success(MsgCode.SU002.get()); + } + + @Operation(summary = "修改表单" ) + @PutMapping + @SaCheckPermission("formDesign" ) + public ActionResult update(@RequestBody FlowFormModel formModel) throws Exception { + FlowFormEntity entity = JsonUtil.getJsonToBean(formModel, FlowFormEntity.class); + if (flowFormService.isExistByFullName(entity.getFullName(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (flowFormService.isExistByEnCode(entity.getEnCode(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + entity.setLastModifyUserId(userProvider.get().getUserId()); + entity.setLastModifyTime(new Date()); + //判断子表是否复用 + List tableModelList = JsonUtil.getJsonToList(entity.getTableJson(), TableModel.class); + //在已发布的状态下 删表动作禁用 + if (formModel.getFormType() == 2 && entity.getEnabledMark() == 1 && tableModelList.size() == 0) { + return ActionResult.fail(MsgCode.VS408.get()); + } + if (formModel.getFormType() == 2 && tableModelList.size() > 0) { + RecursionForm recursionForm = new RecursionForm(); + if(StringUtil.isNotEmpty(entity.getDraftJson())) { + FormDataModel formData = JsonUtil.getJsonToBean(entity.getDraftJson(), FormDataModel.class); + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + recursionForm.setList(list); + recursionForm.setTableModelList(tableModelList); + if (FormCloumnUtil.repetition(recursionForm, new ArrayList<>())) { + return ActionResult.fail("子表重复"); + } + } + } + FlowFormEntity info = flowFormService.getById(formModel.getId()); +// boolean json = !Objects.equals(info.getPropertyJson(),formModel.getDraftJson()) || !Objects.equals(info.getTableJson(),formModel.getTableJson()); + if(info!=null && Objects.equals(info.getState(),1)){ + entity.setState(2); + } + boolean b = flowFormService.update(entity); + if (b) { + return ActionResult.success(MsgCode.SU004.get()); + } + return ActionResult.fail(MsgCode.FA002.get()); + } + + @Operation(summary = "发布/回滚" ) + @Parameters({ + @Parameter(name = "id" , description = "主键" , required = true), + @Parameter(name = "isRelease" , description = "是否发布:是否发布:1-发布 0-回滚" ) + }) + @PostMapping("/Release/{id}" ) + @SaCheckPermission("formDesign" ) + public ActionResult release(@PathVariable("id" ) String id, @RequestParam("isRelease" ) Integer isRelease) throws WorkFlowException { + return flowFormService.release(id, isRelease); + } + + @Operation(summary = "复制表单" ) + @Parameters({ + @Parameter(name = "id" , description = "主键" , required = true) + }) + @GetMapping("/{id}/Actions/Copy" ) + @SaCheckPermission("formDesign" ) + public ActionResult copyForm(@PathVariable("id" ) String id) { + try { + boolean b = flowFormService.copyForm(id); + if (b) { + return ActionResult.success(MsgCode.SU007.get()); + } + } catch (Exception e) { + return ActionResult.fail("已到达该模板复制上限,请复制源模板!" ); + } + + return ActionResult.fail("复制失败" ); + } + + @Operation(summary = "删除表单" ) + @Parameters({ + @Parameter(name = "id" , description = "主键" , required = true) + }) + @DeleteMapping("/{id}" ) + @SaCheckPermission("formDesign" ) + public ActionResult delete(@PathVariable("id" ) String id) { + //todo 该表单已被流程引用,无法删除 -完成 + List listByFormId = flowFormRelationService.getListByFormId(id); + if (CollectionUtils.isNotEmpty(listByFormId)) { + return ActionResult.fail("该表单已被流程引用,无法删除!" ); + } + boolean b = flowFormService.removeById(id); + if (b) { + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + + @Operation(summary = "工作流表单导出" ) + @Parameters({ + @Parameter(name = "id" , description = "主键" , required = true) + }) + @GetMapping("/{id}/Actions/ExportData" ) + @SaCheckPermission("formDesign" ) + public ActionResult exportData(@PathVariable("id" ) String id) throws WorkFlowException { + FlowFormEntity entity = flowFormService.getById(id); + DownloadVO downloadVO = fileExport.exportFile(entity, configValueUtil.getTemporaryFilePath(), entity.getFullName(), ModuleTypeEnum.FLOW_FLOWDFORM.getTableName()); + return ActionResult.success(downloadVO); + } + + + @Operation(summary = "工作流表单导入" ) + @PostMapping(value = "/Actions/ImportData" , consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + @SaCheckPermission("formDesign" ) + public ActionResult ImportData(@RequestPart("file" ) MultipartFile multipartFile) throws WorkFlowException { + //判断是否为.json结尾 + if (FileUtil.existsSuffix(multipartFile, ModuleTypeEnum.FLOW_FLOWDFORM.getTableName())) { + return ActionResult.fail(MsgCode.IMP002.get()); + } + //获取文件内容 + String fileContent = FileUtil.getFileContent(multipartFile); + FlowFormEntity vo = JsonUtil.getJsonToBean(fileContent, FlowFormEntity.class); + return flowFormService.ImportData(vo); + } + + @Operation(summary = "获取表单字段列表" ) + @Parameters({ + @Parameter(name = "id" , description = "主键" , required = true) + }) + @GetMapping(value = "/{id}/getField" ) + @SaCheckPermission("formDesign" ) + public ActionResult getField(@PathVariable("id" ) String id) { + FlowFormEntity entity = flowFormService.getById(id); + if (entity == null || entity.getEnabledMark() != 1) return ActionResult.fail("表单不存在或者未发布!" ); + FlowFormVo vo = JsonUtil.getJsonToBean(entity, FlowFormVo.class); + List list = new ArrayList<>(); + if (vo.getFormType() == 0) {//0系统表单 + list = JsonUtil.getJsonToList(vo.getPropertyJson(), FlowFieldModel.class); + } else { + JSONObject objects = JSONObject.parseObject(vo.getPropertyJson()); + JSONArray arr = objects.getJSONArray("fields" ); + for (Object obj : arr) { + JSONObject object = (JSONObject) obj; + FlowFieldModel flowFieldModel = new FlowFieldModel(); + JSONObject config = object.getJSONObject("__config__" ); + flowFieldModel.setFiledId(object.get("__vModel__" ).toString()) + .setFiledName(config.get("label" ).toString()) + .setJnpfKey(config.get("jnpfKey" ).toString()) + .setRequired(config.get("required" ).toString()); + list.add(flowFieldModel); + } + } + return ActionResult.success(list); + } + + + @Operation(summary = "获取引擎id" ) + @Parameters({ + @Parameter(name = "id" , description = "主键" , required = true) + }) + @GetMapping("/getFormById/{id}" ) +// @SaCheckPermission("formDesign") + public ActionResult getFormById(@PathVariable("id" ) String id) throws WorkFlowException { + FlowTempInfoModel model = flowFormService.getFormById(id); + return ActionResult.success("获取成功" , model); + } + +} diff --git a/jnpf-java-boot/jnpf-form/jnpf-form-entity/pom.xml b/jnpf-java-boot/jnpf-form/jnpf-form-entity/pom.xml new file mode 100644 index 0000000..eb0b26d --- /dev/null +++ b/jnpf-java-boot/jnpf-form/jnpf-form-entity/pom.xml @@ -0,0 +1,27 @@ + + + + jnpf-form + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-form-entity + + + + com.jnpf + jnpf-common-all + ${project.version} + + + com.jnpf + jnpf-permission-entity + ${project.version} + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/entity/FlowFormEntity.java b/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/entity/FlowFormEntity.java new file mode 100644 index 0000000..3b881ff --- /dev/null +++ b/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/entity/FlowFormEntity.java @@ -0,0 +1,97 @@ +package jnpf.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + +/** + * 流程设计 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/6/30 17:44 + */ +@Data +@TableName("flow_form") +public class FlowFormEntity extends SuperExtendEntity.SuperExtendDEEntity { + + /** + * 表单编码 + */ + @TableField("F_EN_CODE") + private String enCode; + + /** + * 表单状态 + */ + @TableField("F_STATE") + private Integer state; + + /**flow_task + * 表单名称 + */ + @TableField("F_FULL_NAME") + private String fullName; + + /** + * 流程类型:0-发起流程,1-功能流程 + */ + @TableField("F_FLOW_TYPE") + private Integer flowType; + /** + * 表单类型:1-系统表单,2-自定义表单 + */ + @TableField("F_FORM_TYPE") + private Integer formType; + /** + * 表单分类 + */ + @TableField("F_CATEGORY") + private String category; + /** + * Web地址 + */ + @TableField("F_URL_ADDRESS") + private String urlAddress; + /** + * APP地址 + */ + @TableField("F_APP_URL_ADDRESS") + private String appUrlAddress; + /** + * 接口路径 + */ + @TableField("F_INTERFACE_URL") + private String interfaceUrl; + /** + * 属性字段 + */ + @TableField("F_PROPERTY_JSON") + private String propertyJson; + + /** + * 草稿版本json + */ + @TableField("F_DRAFT_JSON") + private String draftJson; + /** + * 关联数据连接id + */ + @TableField("F_DB_LINK_ID") + private String dbLinkId; + /** + * 关联的表 + */ + @TableField("F_TABLE_JSON") + private String tableJson; + + /** + * 关联流程id + */ + @TableField(value = "F_FLOW_ID") + private String flowId; + +} + diff --git a/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/entity/FlowFormRelationEntity.java b/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/entity/FlowFormRelationEntity.java new file mode 100644 index 0000000..2666e5c --- /dev/null +++ b/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/entity/FlowFormRelationEntity.java @@ -0,0 +1,31 @@ +package jnpf.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + +/** + * 流程表单关联表 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/10/26 15:58:02 + */ +@Data +@TableName("flow_form_relation") +public class FlowFormRelationEntity extends SuperExtendEntity { + + /** + * 流程版本id + */ + @TableField("F_FLOW_ID") + private String flowId; + /** + * 表单id + */ + @TableField("F_FORM_ID") + private String formId; + +} diff --git a/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/flow/DataModel.java b/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/flow/DataModel.java new file mode 100644 index 0000000..8e53de0 --- /dev/null +++ b/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/flow/DataModel.java @@ -0,0 +1,51 @@ +package jnpf.model.flow; + + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.base.UserInfo; +import jnpf.database.model.entity.DbLinkEntity; +import jnpf.model.visualJson.FieLdsModel; +import jnpf.model.visualJson.TableModel; +import jnpf.permission.entity.UserEntity; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; +import java.util.Map; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@Schema(description="数据模型") +public class DataModel { + @Schema(description = "名称") + private Map dataNewMap; + @Schema(description = "字段列表") + private List fieLdsModelList; + @Schema(description = "表列表") + private List tableModelList; + @Schema(description = "主表id") + private String mainId; + @Schema(description = "数据库链接") + private DbLinkEntity link; + @Schema(description = "转换") + private Boolean convert; + @Schema(description = "是否oracle") + private Boolean isOracle; + @Schema(description = "用户信息") + private UserEntity userEntity; + //是否开启安全锁 + @Schema(description = "安全锁策略") + private Boolean concurrencyLock = false; + @Schema(description = "主键策略") + private Integer primaryKeyPolicy = 1; + @Schema(description = "用户信息") + private UserInfo userInfo; + @Schema(description = "流程启用") + private Boolean flowEnable = true; + @Schema(description = "是否外链") + private boolean linkOpen = false; +} diff --git a/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/flow/FlowFormDataModel.java b/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/flow/FlowFormDataModel.java new file mode 100644 index 0000000..bfbdad0 --- /dev/null +++ b/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/flow/FlowFormDataModel.java @@ -0,0 +1,27 @@ +package jnpf.model.flow; + + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.permission.entity.UserEntity; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Map; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@Schema(description="流程表单数据模型") +public class FlowFormDataModel { + @Schema(description = "表单id") + private String formId; + @Schema(description = "主键id") + private String id; + @Schema(description = "数据map对象") + private Map map; + @Schema(description = "委托人信息") + private UserEntity delegateUser; +} diff --git a/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/flow/FlowTempInfoModel.java b/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/flow/FlowTempInfoModel.java new file mode 100644 index 0000000..b816e16 --- /dev/null +++ b/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/flow/FlowTempInfoModel.java @@ -0,0 +1,24 @@ +package jnpf.model.flow; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/15 9:17 + */ +@Data +@Schema(description="流程引擎信息模型") +public class FlowTempInfoModel { + @Schema(description = "编码") + private String enCode; + @Schema(description = "流程引擎id") + private String id; + @Schema(description = "是否启用") + private Integer enabledMark; +} diff --git a/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/form/DraftJsonModel.java b/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/form/DraftJsonModel.java new file mode 100644 index 0000000..d933c41 --- /dev/null +++ b/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/form/DraftJsonModel.java @@ -0,0 +1,20 @@ +package jnpf.model.form; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +@Schema(description="流程表单草稿模型") +public class DraftJsonModel { + @Schema(description = "是否必填") + private Boolean required; + @Schema(description = "字段id") + private String filedId; + @Schema(description = "字段名称") + private String filedName; + @Schema(description = "jnpfkey") + private String jnpfKey; + @Schema(description = "是否多选") + private boolean multiple; +} diff --git a/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/form/FlowFieldModel.java b/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/form/FlowFieldModel.java new file mode 100644 index 0000000..58db3c9 --- /dev/null +++ b/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/form/FlowFieldModel.java @@ -0,0 +1,40 @@ +package jnpf.model.form; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 流程设计 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/9/23 15:10:27 + */ +@Data +@Accessors(chain = true) +@Schema(description="字段模型") +public class FlowFieldModel { + /** + *__vModel__ + */ + @Schema(description = "字段id") + String filedId; + /** + *__config__.label + */ + @Schema(description = "字段名称") + String filedName; + /** + *__config__.jnpfKey + */ + @Schema(description = "字段jnpfkey") + String jnpfKey; + /** + *__config__.required + */ + @Schema(description = "字段是否必填") + String required; +} diff --git a/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/form/FlowFormModel.java b/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/form/FlowFormModel.java new file mode 100644 index 0000000..c1ca379 --- /dev/null +++ b/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/form/FlowFormModel.java @@ -0,0 +1,86 @@ +package jnpf.model.form; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 流程表单参数 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/6/30 18:29 + */ +@Data +@Schema(description="流程表单参数") +public class FlowFormModel { + @Schema(description = "主键") + private String id; + + @Schema(description = "表单编码") + private String enCode; + + @Schema(description = "表单名称") + private String fullName; + + @Schema(description = "流程类型:0-发起流程,1-功能流程") + private Integer flowType; + + @Schema(description = "表单类型:1-系统表单,2-自定义表单") + private Integer formType; + + @Schema(description = "表单分类") + private String category; + + @Schema(description = "Web地址") + private String urlAddress; + + @Schema(description = "APP地址") + private String appUrlAddress; + + @Schema(description = "接口路径") + private String interfaceUrl; + + @Schema(description = "属性字段") + private String propertyJson; + + @Schema(description = "描述") + private String description; + + @Schema(description = "排序码") + private Long sortCode; + + @Schema(description = "有效标志") + private Integer enabledMark; + + @Schema(description = "创建时间") + private Long creatorTime; + + @Schema(description = "创建用户") + private String creatorUserId; + + @Schema(description = "修改时间") + private Long lastModifyTime; + + @Schema(description = "修改用户") + private String lastModifyUserId; + + @Schema(description = "删除标志") + private Integer deleteMark; + + @Schema(description = "删除时间") + private Long deleteTime; + + @Schema(description = "删除用户") + private String deleteUserId; + + @Schema(description = "草稿版本json") + private String draftJson; + + @Schema(description = "关联数据连接id") + private String dbLinkId; + + @Schema(description = "关联的表") + private String tableJson; +} diff --git a/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/form/FlowFormPage.java b/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/form/FlowFormPage.java new file mode 100644 index 0000000..d9f0bd4 --- /dev/null +++ b/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/form/FlowFormPage.java @@ -0,0 +1,26 @@ +package jnpf.model.form; + + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.base.Pagination; +import lombok.Data; + +/** + * 流程设计 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/7/1 9:48 + */ +@Schema(description="表单列表查询参数") +@Data +public class FlowFormPage extends Pagination { + private String keyword; + @Schema(description = "流程类型:0-发起流程,1-功能流程") + private Integer flowType; + @Schema(description = "表单类型:1-系统表单,2-自定义表单") + private Integer formType; + @Schema(description = "该参数下拉列表无效") + private Integer enabledMark; +} diff --git a/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/form/FlowFormVo.java b/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/form/FlowFormVo.java new file mode 100644 index 0000000..1d943c6 --- /dev/null +++ b/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/form/FlowFormVo.java @@ -0,0 +1,99 @@ +package jnpf.model.form; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 流程表单对象 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/6/30 18:06 + */ +@Data +@Schema(description="流程表单对象") +public class FlowFormVo { + @Schema(description = "主键") + private String id; + + @Schema(description = "表单编码") + private String enCode; + + @Schema(description = "表单状态") + private Integer state; + + @Schema(description = "是否发布" ) + private Integer isRelease; + + @Schema(description = "表单名称") + private String fullName; + + @Schema(description = "流程类型") + private Integer flowType; + + @Schema(description = "表单类型") + private Integer formType; + + @Schema(description = "表单分类") + private String category; + + @Schema(description = "Web地址") + private String urlAddress; + + @Schema(description = "APP地址") + private String appUrlAddress; + + @Schema(description = "接口路径") + private String interfaceUrl; + + @Schema(description = "属性字段") + private String propertyJson; + + @Schema(description = "描述") + private String description; + + @Schema(description = "排序码") + private Long sortCode; + + @Schema(description = "有效标志") + private Integer enabledMark; + + @Schema(description = "创建时间") + private Long creatorTime; + + @Schema(description = "创建用户") + private String creatorUserId; + @Schema(description = "创建用户名") + private String creatorUser; + + @Schema(description = "修改时间") + private Long lastModifyTime; + + @Schema(description = "修改用户") + private String lastModifyUserId; + @Schema(description = "修改用户名") + private String lastModifyUser; + + @Schema(description = "删除标志") + private Integer deleteMark; + + @Schema(description = "删除时间") + private Long deleteTime; + + @Schema(description = "删除用户") + private String deleteUserId; + @Schema(description = "删除用户名") + private String deleteUser; + + @Schema(description = "草稿版本json") + private String draftJson; + + @Schema(description = "关联数据连接id") + private String dbLinkId; + + @Schema(description = "关联的表") + private String tableJson; + +} diff --git a/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/form/FlowSelectVo.java b/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/form/FlowSelectVo.java new file mode 100644 index 0000000..261a2cf --- /dev/null +++ b/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/form/FlowSelectVo.java @@ -0,0 +1,42 @@ +package jnpf.model.form; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 流程表单对象 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/6/30 18:06 + */ +@Data +@Schema(description="流程下拉对象") +public class FlowSelectVo { + @Schema(description = "主键") + private String id; + + @Schema(description = "表单编码") + private String enCode; + + @Schema(description = "表单名称") + private String fullName; + + @Schema(description = "流程类型") + private Integer flowType; + + @Schema(description = "表单类型") + private Integer formType; + + @Schema(description = "表单分类") + private String category; + + @Schema(description = "描述") + private String description; + + @Schema(description = "排序码") + private Long sortCode; + +} diff --git a/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/form/FormCheckModel.java b/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/form/FormCheckModel.java new file mode 100644 index 0000000..0ec0365 --- /dev/null +++ b/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/form/FormCheckModel.java @@ -0,0 +1,23 @@ +package jnpf.model.form; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.mybatis.dynamic.sql.select.render.SelectStatementProvider; + +/** + * + * 表单验证 + * @author JNPF开发平台组 + * @version V3.4.5 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2022/11/15 + */ +@Data +@Schema(description="表单验证模型") +public class FormCheckModel { + @Schema(description = "名称") + private String label; + @Schema(description = "选择值") + private SelectStatementProvider statementProvider; +} diff --git a/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/form/FormDraftJsonModel.java b/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/form/FormDraftJsonModel.java new file mode 100644 index 0000000..0aa692e --- /dev/null +++ b/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/form/FormDraftJsonModel.java @@ -0,0 +1,24 @@ +package jnpf.model.form; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 流程设计 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/10/19 14:22:18 + */ +@Data +@Accessors(chain = true) +@Schema(description="表单草稿存储对象模型") +public class FormDraftJsonModel { + @Schema(description = "草稿json") + private String draftJson; + @Schema(description = "表json") + private String tableJson; +} diff --git a/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/form/MultipleControlEnum.java b/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/form/MultipleControlEnum.java new file mode 100644 index 0000000..2fbb2dc --- /dev/null +++ b/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/form/MultipleControlEnum.java @@ -0,0 +1,43 @@ +package jnpf.model.form; + +/** + * 控件多选字符 + * + * @author JNPF开发平台组 + * @version V3.3 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2022/2/14 + */ + +public enum MultipleControlEnum { + /** + * 数组 + */ + MULTIPLE_JSON_ONE("[",1), + /** + * 二维数组 + */ + MULTIPLE_JSON_TWO("[[",2), + /** + * 普通字符 + */ + MULTIPLE_JSON_THREE("",3); + + + MultipleControlEnum(String multipleChar, int dataType) { + MultipleChar = multipleChar; + DataType = dataType; + } + + public String getMultipleChar() { + return MultipleChar; + } + + public int getDataType() { + return DataType; + } + + private String MultipleChar; + private int DataType; + +} diff --git a/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/form/VisualTableModel.java b/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/form/VisualTableModel.java new file mode 100644 index 0000000..018708b --- /dev/null +++ b/jnpf-java-boot/jnpf-form/jnpf-form-entity/src/main/java/jnpf/model/form/VisualTableModel.java @@ -0,0 +1,34 @@ +package jnpf.model.form; + +import com.alibaba.fastjson.JSONArray; +import jnpf.model.visualJson.analysis.FormAllModel; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.ArrayList; +import java.util.List; + + +/** + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class VisualTableModel { + private JSONArray jsonArray; + private List formAllModel=new ArrayList<>(); + private String table; + private String linkId; + private String fullName; + private boolean concurrency = false; + private Integer primaryKey = 1; + //逻辑删除 + private Boolean logicalDelete = false; +} diff --git a/jnpf-java-boot/jnpf-form/pom.xml b/jnpf-java-boot/jnpf-form/pom.xml new file mode 100644 index 0000000..34c5dd6 --- /dev/null +++ b/jnpf-java-boot/jnpf-form/pom.xml @@ -0,0 +1,20 @@ + + + + jnpf-java-boot + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-form + pom + + jnpf-form-entity + jnpf-form-biz + jnpf-form-controller + + + diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-biz/pom.xml b/jnpf-java-boot/jnpf-message/jnpf-message-biz/pom.xml new file mode 100644 index 0000000..0f5d0ad --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-biz/pom.xml @@ -0,0 +1,36 @@ + + + + jnpf-message + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-message-biz + + + + com.jnpf + jnpf-provider + ${project.version} + + + org.springframework.boot + spring-boot-starter-websocket + + + com.jnpf + jnpf-permission-biz + ${project.version} + + + com.jnpf + jnpf-system-biz + ${project.version} + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/config/WebsocketConfig.java b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/config/WebsocketConfig.java new file mode 100644 index 0000000..24242e1 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/config/WebsocketConfig.java @@ -0,0 +1,24 @@ +package jnpf.message.config; + +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.socket.server.standard.ServerEndpointExporter; + +@Configuration +@ComponentScan +@EnableAutoConfiguration +public class WebsocketConfig { + + /** + * 支持websocket + * 如果不使用内置tomcat,则无需配置 + * + * @return + */ + @Bean + public ServerEndpointExporter serverEndpointExporter() { + return new ServerEndpointExporter(); + } +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/AccountConfigMapper.java b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/AccountConfigMapper.java new file mode 100644 index 0000000..62739b4 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/AccountConfigMapper.java @@ -0,0 +1,19 @@ +package jnpf.message.mapper; + + + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.message.entity.AccountConfigEntity; + +/** + * + * 账号配置功能 + * 版本: V3.2.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2022-08-18 + */ +public interface AccountConfigMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/ImContentMapper.java b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/ImContentMapper.java new file mode 100644 index 0000000..0a8051f --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/ImContentMapper.java @@ -0,0 +1,29 @@ +package jnpf.message.mapper; + + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.message.entity.ImContentEntity; +import jnpf.message.model.ImUnreadNumModel; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 聊天内容 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +public interface ImContentMapper extends SuperMapper { + + List getUnreadList(@Param("receiveUserId") String receiveUserId); + + List getUnreadLists(@Param("receiveUserId") String receiveUserId); + + int readMessage(@Param("map") Map map); +} + diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/ImReplyMapper.java b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/ImReplyMapper.java new file mode 100644 index 0000000..baa390a --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/ImReplyMapper.java @@ -0,0 +1,26 @@ +package jnpf.message.mapper; + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.message.entity.ImReplyEntity; +import jnpf.message.model.ImReplyListModel; + +import java.util.List; + +/** + * 聊天会话 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-05-28 + */ +public interface ImReplyMapper extends SuperMapper { + + /** + * 聊天会话列表 + * @return + */ + List getImReplyList(); + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/MessageMapper.java b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/MessageMapper.java new file mode 100644 index 0000000..a62a388 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/MessageMapper.java @@ -0,0 +1,27 @@ +package jnpf.message.mapper; + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.message.entity.MessageEntity; +import jnpf.message.entity.MessageReceiveEntity; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 消息实例 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月27日 上午9:18 + */ +public interface MessageMapper extends SuperMapper { + + List getMessageList(@Param("map") Map map); + + int getUnreadCount(@Param("userId") String userId,@Param("type") Integer type); + + List getInfoDefault(@Param("type") int type); +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/MessageMonitorMapper.java b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/MessageMonitorMapper.java new file mode 100644 index 0000000..51ed3ce --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/MessageMonitorMapper.java @@ -0,0 +1,19 @@ +package jnpf.message.mapper; + + + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.message.entity.MessageMonitorEntity; + +/** + * + * 消息监控 + * 版本: V3.2.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2022-08-22 + */ +public interface MessageMonitorMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/MessageTemplateConfigMapper.java b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/MessageTemplateConfigMapper.java new file mode 100644 index 0000000..1a629cf --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/MessageTemplateConfigMapper.java @@ -0,0 +1,18 @@ +package jnpf.message.mapper; + + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.message.entity.MessageTemplateConfigEntity; + +/** + * + * 消息模板(新) + * 版本: V3.2.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2022-08-18 + */ +public interface MessageTemplateConfigMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/MessagereceiveMapper.java b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/MessagereceiveMapper.java new file mode 100644 index 0000000..7c96156 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/MessagereceiveMapper.java @@ -0,0 +1,18 @@ +package jnpf.message.mapper; + + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.message.entity.MessageReceiveEntity; + +/** + * 消息接收 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +public interface MessagereceiveMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/SendConfigTemplateMapper.java b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/SendConfigTemplateMapper.java new file mode 100644 index 0000000..23183aa --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/SendConfigTemplateMapper.java @@ -0,0 +1,19 @@ +package jnpf.message.mapper; + + + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.message.entity.SendConfigTemplateEntity; + +/** + * + * 消息发送配置 + * 版本: V3.2.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2022-08-19 + */ +public interface SendConfigTemplateMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/SendMessageConfigMapper.java b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/SendMessageConfigMapper.java new file mode 100644 index 0000000..c91d773 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/SendMessageConfigMapper.java @@ -0,0 +1,19 @@ +package jnpf.message.mapper; + + + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.message.entity.SendMessageConfigEntity; + +/** + * + * 消息发送配置 + * 版本: V3.2.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2022-08-19 + */ +public interface SendMessageConfigMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/ShortLInkMapper.java b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/ShortLInkMapper.java new file mode 100644 index 0000000..c3bb959 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/ShortLInkMapper.java @@ -0,0 +1,19 @@ +package jnpf.message.mapper; + + + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.message.entity.ShortLinkEntity; + +/** + * + * 消息模板(新) + * 版本: V3.2.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2022-08-18 + */ +public interface ShortLInkMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/SmsFieldMapper.java b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/SmsFieldMapper.java new file mode 100644 index 0000000..cf7d35d --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/SmsFieldMapper.java @@ -0,0 +1,19 @@ +package jnpf.message.mapper; + + + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.message.entity.SmsFieldEntity; + +/** + * + * 消息模板(新) + * 版本: V3.2.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2022-08-18 + */ +public interface SmsFieldMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/SynThirdInfoMapper.java b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/SynThirdInfoMapper.java new file mode 100644 index 0000000..e1b65d3 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/SynThirdInfoMapper.java @@ -0,0 +1,17 @@ +package jnpf.message.mapper; + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.message.entity.SynThirdInfoEntity; + +/** + * 第三方工具对象同步表 + * + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021/4/23 17:25 + */ +public interface SynThirdInfoMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/TemplateParamMapper.java b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/TemplateParamMapper.java new file mode 100644 index 0000000..6b7cbe9 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/TemplateParamMapper.java @@ -0,0 +1,19 @@ +package jnpf.message.mapper; + + + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.message.entity.TemplateParamEntity; + +/** + * + * 消息模板(新) + * 版本: V3.2.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2022-08-18 + */ +public interface TemplateParamMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/UserDeviceMapper.java b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/UserDeviceMapper.java new file mode 100644 index 0000000..889f0a2 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/UserDeviceMapper.java @@ -0,0 +1,19 @@ +package jnpf.message.mapper; + + + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.message.entity.UserDeviceEntity; + +/** + * + * 消息模板(新) + * 版本: V3.2.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2022-08-18 + */ +public interface UserDeviceMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/WechatUserMapper.java b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/WechatUserMapper.java new file mode 100644 index 0000000..768a70e --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/mapper/WechatUserMapper.java @@ -0,0 +1,19 @@ +package jnpf.message.mapper; + + + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.message.entity.WechatUserEntity; + +/** + * + * 消息模板(新) + * 版本: V3.2.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2022-08-18 + */ +public interface WechatUserMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/ImContentService.java b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/ImContentService.java new file mode 100644 index 0000000..8ef148c --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/ImContentService.java @@ -0,0 +1,74 @@ +package jnpf.message.service; + + +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import jnpf.base.PageModel; +import jnpf.message.entity.ImContentEntity; +import jnpf.message.model.ImUnreadNumModel; + +import java.util.List; + +/** + * 聊天内容 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +public interface ImContentService extends SuperService { + + /** + * 获取消息列表 + * + * @param sendUserId 发送者 + * @param receiveUserId 接收者 + * @param pageModel + * @return + */ + List getMessageList(String sendUserId, String receiveUserId, PageModel pageModel); + + /** + * 获取未读消息 + * + * @param receiveUserId 接收者 + * @return + */ + List getUnreadList(String receiveUserId); + + /** + * 获取未读消息 + * + * @param receiveUserId 接收者 + * @return + */ + int getUnreadCount(String sendUserId, String receiveUserId); + + /** + * 发送消息 + * + * @param sendUserId 发送者 + * @param receiveUserId 接收者 + * @param message 消息内容 + * @param messageType 消息类型 + * @return + */ + void sendMessage(String sendUserId, String receiveUserId, String message, String messageType); + + /** + * 已读消息 + * + * @param sendUserId 发送者 + * @param receiveUserId 接收者 + * @return + */ + void readMessage(String sendUserId, String receiveUserId); + /** + * 删除聊天记录 + * + * @return + */ + boolean deleteChatRecord(String sendUserId, String receiveUserId); + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/ImReplyService.java b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/ImReplyService.java new file mode 100644 index 0000000..f971e4c --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/ImReplyService.java @@ -0,0 +1,49 @@ +package jnpf.message.service; + +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import jnpf.message.entity.ImReplyEntity; +import jnpf.message.model.ImReplyListModel; + +import java.util.List; + +/** + * 聊天会话 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-05-29 + */ +public interface ImReplyService extends SuperService { + + /** + * 获取消息会话列表 + * + * @return + */ + List getList(); + + /** + * 保存聊天会话 + * + * @param entity + * @return + */ + boolean savaImReply(ImReplyEntity entity); + + /** + * 获取聊天会话列表 + * + * @return + */ + List getImReplyList(); + + /** + * 移除聊天会话列表 + * + * @return + */ + boolean relocation(String sendUserId,String receiveUserId); + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/UserDeviceService.java b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/UserDeviceService.java new file mode 100644 index 0000000..6467ccb --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/UserDeviceService.java @@ -0,0 +1,33 @@ + +package jnpf.message.service; + +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; + +import jnpf.message.entity.UserDeviceEntity; + +import java.util.List; + +/** + * + * 消息模板(新) + * 版本: V3.2.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2022-08-18 + */ +public interface UserDeviceService extends SuperService { + + UserDeviceEntity getInfoByUserId(String userId); + + List getCidList(String userId); + + UserDeviceEntity getInfoByClientId(String clientId); + + void create(UserDeviceEntity entity); + + boolean update(String id, UserDeviceEntity entity); + + void delete(UserDeviceEntity entity); + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/AccountConfigServiceImpl.java b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/AccountConfigServiceImpl.java new file mode 100644 index 0000000..5987c59 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/AccountConfigServiceImpl.java @@ -0,0 +1,419 @@ +package jnpf.message.service.impl; + +import jnpf.base.service.SuperServiceImpl; +import jnpf.base.ActionResult; +import jnpf.constant.MsgCode; +import jnpf.database.model.superQuery.ConditionJsonModel; +import jnpf.database.model.superQuery.SuperQueryConditionModel; +import jnpf.entity.*; + +import jnpf.exception.DataException; +import jnpf.message.entity.AccountConfigEntity; +import jnpf.message.mapper.AccountConfigMapper; +import jnpf.message.model.accountconfig.*; +import jnpf.message.service.AccountConfigService; +import cn.hutool.core.util.ObjectUtil; +import jnpf.permission.service.AuthorizeService; +import java.lang.reflect.Field; +import com.baomidou.mybatisplus.annotation.TableField; +import jnpf.util.visiual.JnpfKeyConsts; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springframework.beans.factory.annotation.Autowired; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; + +import jnpf.util.*; + +import java.util.*; + +/** + * 账号配置功能 + * 版本: V3.2.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2022-08-18 + */ +@Service +public class AccountConfigServiceImpl extends SuperServiceImpl implements AccountConfigService { + + + @Autowired + private UserProvider userProvider; + + @Autowired + private AuthorizeService authorizeService; + + + @Override + public List getList(AccountConfigPagination accountConfigPagination) { + return getTypeList(accountConfigPagination, accountConfigPagination.getDataType()); + } + + @Override + public List getTypeList(AccountConfigPagination accountConfigPagination, String dataType) { + String userId = userProvider.get().getUserId(); + int total = 0; + int accountConfigNum = 0; + QueryWrapper accountConfigQueryWrapper = new QueryWrapper<>(); + + //关键字 + if (StringUtil.isNotBlank(accountConfigPagination.getKeyword()) && !"null".equals(accountConfigPagination.getKeyword())) { + accountConfigNum++; + accountConfigQueryWrapper.lambda().and(t -> t.like(AccountConfigEntity::getEnCode, accountConfigPagination.getKeyword()) + .or().like(AccountConfigEntity::getFullName, accountConfigPagination.getKeyword()).or().like(AccountConfigEntity::getAddressorName,accountConfigPagination.getKeyword()) + .or().like(AccountConfigEntity::getSmtpUser,accountConfigPagination.getKeyword()).or().like(AccountConfigEntity::getSmsSignature,accountConfigPagination.getKeyword())); + } + //webhook类型 + if (ObjectUtil.isNotEmpty(accountConfigPagination.getWebhookType())) { + accountConfigNum++; + accountConfigQueryWrapper.lambda().eq(AccountConfigEntity::getWebhookType, accountConfigPagination.getWebhookType()); + } + //渠道 + if (ObjectUtil.isNotEmpty(accountConfigPagination.getChannel())) { + accountConfigNum++; + accountConfigQueryWrapper.lambda().eq(AccountConfigEntity::getChannel, accountConfigPagination.getChannel()); + } + //状态 + if(ObjectUtil.isNotEmpty(accountConfigPagination.getEnabledMark())){ + accountConfigNum++; + int enabledMark = Integer.parseInt(accountConfigPagination.getEnabledMark()); + accountConfigQueryWrapper.lambda().eq(AccountConfigEntity::getEnabledMark, enabledMark); + } + //配置类型 + if (ObjectUtil.isNotEmpty(accountConfigPagination.getType())) { + accountConfigNum++; + accountConfigQueryWrapper.lambda().eq(AccountConfigEntity::getType, accountConfigPagination.getType()); + } + + //排序 + if (StringUtil.isEmpty(accountConfigPagination.getSidx())) { + accountConfigQueryWrapper.lambda().orderByAsc(AccountConfigEntity::getSortCode).orderByDesc(AccountConfigEntity::getCreatorTime).orderByDesc(AccountConfigEntity::getLastModifyTime); + } else { + try { + String sidx = accountConfigPagination.getSidx(); + AccountConfigEntity accountConfigEntity = new AccountConfigEntity(); + Field declaredField = accountConfigEntity.getClass().getDeclaredField(sidx); + declaredField.setAccessible(true); + String value = declaredField.getAnnotation(TableField.class).value(); + accountConfigQueryWrapper = "asc".equals(accountConfigPagination.getSort().toLowerCase()) ? accountConfigQueryWrapper.orderByAsc(value) : accountConfigQueryWrapper.orderByDesc(value); + } catch (NoSuchFieldException e) { + e.printStackTrace(); + } + } + if (!"1".equals(dataType)) { + if (total > 0 || total == 0) { + Page page = new Page<>(accountConfigPagination.getCurrentPage(), accountConfigPagination.getPageSize()); + IPage userIPage = this.page(page, accountConfigQueryWrapper); + return accountConfigPagination.setData(userIPage.getRecords(), userIPage.getTotal()); + } else { + List list = new ArrayList(); + return accountConfigPagination.setData(list, list.size()); + } + } else { + return this.list(accountConfigQueryWrapper); + } + } + + + @Override + public AccountConfigEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(AccountConfigEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(AccountConfigEntity entity) { + this.save(entity); + } + + @Override + public boolean update(String id, AccountConfigEntity entity) { + entity.setId(id); + return this.updateById(entity); + } + + @Override + public void delete(AccountConfigEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } + //子表方法 + + //列表子表数据方法 + + + //验证表单唯一字段 + @Override + public boolean checkForm(AccountConfigForm form, int i,String type,String id) { + int total = 0; + if (ObjectUtil.isNotEmpty(form.getEnCode())) { + QueryWrapper codeWrapper = new QueryWrapper<>(); + codeWrapper.lambda().eq(AccountConfigEntity::getEnCode, form.getEnCode()); + codeWrapper.lambda().eq(AccountConfigEntity::getType,type); + if(StringUtil.isNotBlank(id) && !"null".equals(id)) { + codeWrapper.lambda().ne(AccountConfigEntity::getId, id); + } + total += (int) this.count(codeWrapper); + } + int c = 0; + if (total > i + c) { + return true; + } + return false; + } + + @Override + public boolean checkGzhId(String gzhId, int i,String type,String id) { + int total = 0; + if (StringUtil.isNotEmpty(gzhId) && !"null".equals(gzhId)) { + QueryWrapper codeWrapper = new QueryWrapper<>(); + codeWrapper.lambda().eq(AccountConfigEntity::getAppKey, gzhId); + codeWrapper.lambda().eq(AccountConfigEntity::getType,type); + if(StringUtil.isNotBlank(id) && !"null".equals(id)) { + codeWrapper.lambda().ne(AccountConfigEntity::getId, id); + } + total += (int) this.count(codeWrapper); + } + int c = 0; + if (total > i + c) { + return true; + } + return false; + } + + @Override + public AccountConfigEntity getInfoByType(String appKey, String type) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(AccountConfigEntity::getType, type); + queryWrapper.lambda().eq(AccountConfigEntity::getAppKey,appKey); + return this.getOne(queryWrapper); + } + + @Override + public AccountConfigEntity getInfoByEnCode(String enCode, String type){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(AccountConfigEntity::getType, type); + queryWrapper.lambda().eq(AccountConfigEntity::getEnCode,enCode); + return this.getOne(queryWrapper); + } + + @Override + public List getListByType(String type){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(AccountConfigEntity::getType,type); + queryWrapper.lambda().eq(AccountConfigEntity::getEnabledMark,1); + return this.list(queryWrapper); + } + + @Override + public boolean isExistByFullName(String fullName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(AccountConfigEntity::getFullName, fullName); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(AccountConfigEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public boolean isExistByEnCode(String enCode, String id,String type) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(AccountConfigEntity::getEnCode, enCode); + queryWrapper.lambda().eq(AccountConfigEntity::getType,type); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(AccountConfigEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public ActionResult ImportData(AccountConfigEntity entity) throws DataException { + if (entity != null) { +// if (isExistByFullName(entity.getFullName(), entity.getId())) { +// return ActionResult.fail(MsgCode.EXIST001.get()); +// } + if (isExistByEnCode(entity.getEnCode(), entity.getId(),entity.getType())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + try { + this.save(entity); + } catch (Exception e) { + throw new DataException(MsgCode.IMP003.get()); + } + return ActionResult.success(MsgCode.IMP001.get()); + } + return ActionResult.fail("导入数据格式不正确"); + } + + /** + * 高级查询 + * + * @param conditionModel + * @param entity + * @param num + * @return + */ + public Integer getCondition(SuperQueryConditionModel conditionModel, Object entity, int num) { + QueryWrapper queryWrapper = conditionModel.getObj(); + List queryConditionModels = conditionModel.getConditionList(); + String op = conditionModel.getMatchLogic(); + String tableName = conditionModel.getTableName(); + List useCondition = new ArrayList<>(); + for (ConditionJsonModel queryConditionModel : queryConditionModels) { + if (queryConditionModel.getTableName().equalsIgnoreCase(tableName)) { + if (queryConditionModel.getField().contains("jnpf")) { + String child = queryConditionModel.getField(); + String s1 = child.substring(child.lastIndexOf("jnpf_")).replace("jnpf_", ""); + queryConditionModel.setField(s1); + } + if (queryConditionModel.getField().toLowerCase().startsWith(JnpfKeyConsts.CHILD_TABLE_PREFIX)) { + String child = queryConditionModel.getField(); + String s1 = child.substring(child.indexOf("-") + 1); + queryConditionModel.setField(s1); + } + useCondition.add(queryConditionModel); + } + } + + if (queryConditionModels.size() < 1 || useCondition.size() < 1) { + return num; + } + if (useCondition.size() > 0) { + num += 1; + } + //处理控件 转换为有效值 + for (ConditionJsonModel queryConditionModel : useCondition) { + String jnpfKey = queryConditionModel.getJnpfKey(); + String fieldValue = queryConditionModel.getFieldValue(); + if (jnpfKey.equals(JnpfKeyConsts.DATE)) { + Long o1 = Long.valueOf(fieldValue); + String startTime = DateUtil.daFormat(o1); + queryConditionModel.setFieldValue(startTime); + } else if (jnpfKey.equals(JnpfKeyConsts.CREATETIME) || jnpfKey.equals(JnpfKeyConsts.MODIFYTIME)) { + Long o1 = Long.valueOf(fieldValue); + String startTime = DateUtil.daFormatHHMMSS(o1); + queryConditionModel.setFieldValue(startTime); + } else if (jnpfKey.equals(JnpfKeyConsts.CURRORGANIZE)) { + List orgList = JsonUtil.getJsonToList(fieldValue, String.class); + queryConditionModel.setFieldValue(orgList.get(orgList.size() - 1)); + } + } + //反射获取数据库实际字段 + Class aClass = entity.getClass(); + + queryWrapper.and(tw -> { + for (ConditionJsonModel conditionJsonModel : useCondition) { + String conditionField = conditionJsonModel.getField(); + Field declaredField = null; + try { + declaredField = aClass.getDeclaredField(conditionField); + } catch (NoSuchFieldException e) { + e.printStackTrace(); + } + declaredField.setAccessible(true); + String field = declaredField.getAnnotation(TableField.class).value(); + String fieldValue = conditionJsonModel.getFieldValue(); + String symbol = conditionJsonModel.getSymbol(); + if ("AND".equalsIgnoreCase(op)) { + if (symbol.equals("==")) { + tw.eq(field, fieldValue); + } else if (symbol.equals(">=")) { + tw.ge(field, fieldValue); + } else if (symbol.equals("<=")) { + tw.le(field, fieldValue); + tw.and( + qw -> qw.ne(field, "") + ); + } else if (symbol.equals(">")) { + tw.gt(field, fieldValue); + } else if (symbol.equals("<")) { + tw.lt(field, fieldValue); + tw.and( + qw -> qw.ne(field, "") + ); + } else if (symbol.equals("<>")) { + tw.ne(field, fieldValue); + if (StringUtil.isNotEmpty(fieldValue)) { + tw.or( + qw -> qw.isNull(field) + ); + } + } else if (symbol.equals("like")) { + if (StringUtil.isNotEmpty(fieldValue)) { + tw.like(field, fieldValue); + } else { + tw.isNull(field); + } + } else if (symbol.equals("notLike")) { + if (StringUtil.isNotEmpty(fieldValue)) { + tw.notLike(field, fieldValue); + tw.or( + qw -> qw.isNull(field) + ); + } else { + tw.isNotNull(field); + } + } + } else { + if (symbol.equals("==")) { + tw.or( + qw -> qw.eq(field, fieldValue) + ); + } else if (symbol.equals(">=")) { + tw.or( + qw -> qw.ge(field, fieldValue) + ); + } else if (symbol.equals("<=")) { + tw.or( + qw -> qw.le(field, fieldValue) + ); + } else if (symbol.equals(">")) { + tw.or( + qw -> qw.gt(field, fieldValue) + ); + } else if (symbol.equals("<")) { + tw.or( + qw -> qw.lt(field, fieldValue) + ); + } else if (symbol.equals("<>")) { + tw.or( + qw -> qw.ne(field, fieldValue) + ); + if (StringUtil.isNotEmpty(fieldValue)) { + tw.or( + qw -> qw.isNull(field) + ); + } + } else if (symbol.equals("like")) { + if (StringUtil.isNotEmpty(fieldValue)) { + tw.or( + qw -> qw.like(field, fieldValue) + ); + } else { + tw.or( + qw -> qw.isNull(field) + ); + } + } else if (symbol.equals("notLike")) { + if (StringUtil.isNotEmpty(fieldValue)) { + tw.or( + qw -> qw.notLike(field, fieldValue) + ); + tw.or( + qw -> qw.isNull(field) + ); + } else { + tw.or( + qw -> qw.isNotNull(field) + ); + } + } + } + } + }); + return num; + } +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/ImContentServiceImpl.java b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/ImContentServiceImpl.java new file mode 100644 index 0000000..afeb67c --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/ImContentServiceImpl.java @@ -0,0 +1,169 @@ +package jnpf.message.service.impl; + +import jnpf.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import jnpf.base.PageModel; +import jnpf.message.entity.ImContentEntity; +import jnpf.message.entity.ImReplyEntity; +import jnpf.message.mapper.ImContentMapper; +import jnpf.message.model.ImReplySavaModel; +import jnpf.message.service.ImContentService; +import jnpf.message.model.ImUnreadNumModel; +import jnpf.message.service.ImReplyService; +import jnpf.permission.service.UserService; +import jnpf.util.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Optional; + +/** + * 聊天内容 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Service +public class ImContentServiceImpl extends SuperServiceImpl implements ImContentService { + + @Autowired + private ImReplyService imReplyService; + @Autowired + private UserProvider userProvider; + @Override + public List getMessageList(String sendUserId, String receiveUserId, PageModel pageModel) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + //发件人、收件人 + if (!StringUtil.isEmpty(sendUserId) && !StringUtil.isEmpty(receiveUserId)) { + + queryWrapper.lambda().and(wrapper -> { + wrapper.eq(ImContentEntity::getSendUserId, sendUserId); + wrapper.eq(ImContentEntity::getReceiveUserId, receiveUserId); + wrapper.or().eq(ImContentEntity::getSendUserId, receiveUserId); + wrapper.eq(ImContentEntity::getReceiveUserId, sendUserId); + }); + queryWrapper.lambda().and(wrapper -> { + wrapper.isNull(ImContentEntity::getDeleteUserId); + wrapper.or(). ne(ImContentEntity::getDeleteUserId,receiveUserId); +// wrapper.ne(ImContentEntity::getDeleteMark, 1); + }); + + } + //关键字查询 + if (pageModel != null && pageModel.getKeyword() != null) { + queryWrapper.lambda().like(ImContentEntity::getContent, pageModel.getKeyword()); + //排序 + pageModel.setSidx("F_SendTime"); + } + + if (StringUtil.isEmpty(pageModel.getSidx())) { + queryWrapper.lambda().orderByDesc(ImContentEntity::getSendTime); + } else { + queryWrapper = "asc".equals(pageModel.getSord().toLowerCase()) ? queryWrapper.orderByAsc(pageModel.getSidx()) : queryWrapper.orderByDesc(pageModel.getSidx()); + } + Page page = new Page<>(pageModel.getPage(), pageModel.getRows()); + IPage iPage = this.page(page, queryWrapper); + return pageModel.setData(iPage.getRecords(), page.getTotal()); + } + + @Override + public List getUnreadList(String receiveUserId) { + List list = this.baseMapper.getUnreadList(receiveUserId); + List list1 = this.baseMapper.getUnreadLists(receiveUserId); + for (ImUnreadNumModel item : list) { + Optional first = list1.stream().filter(q -> q.getSendUserId().equals(item.getSendUserId())).findFirst(); + if(first.isPresent()){ + ImUnreadNumModel defaultItem = first.get(); + item.setDefaultMessage(defaultItem.getDefaultMessage()); + item.setDefaultMessageType(defaultItem.getDefaultMessageType()); + item.setDefaultMessageTime(defaultItem.getDefaultMessageTime()); + } + } + return list; + } + + @Override + public int getUnreadCount(String sendUserId, String receiveUserId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ImContentEntity::getSendUserId, sendUserId).eq(ImContentEntity::getReceiveUserId, receiveUserId).eq(ImContentEntity::getEnabledMark, 0); + return (int) this.count(queryWrapper); + } + + @Override + @DSTransactional + public void sendMessage(String sendUserId, String receiveUserId, String message, String messageType) { + ImContentEntity entity = new ImContentEntity(); + entity.setId(RandomUtil.uuId()); + entity.setSendUserId(sendUserId); + entity.setSendTime(new Date()); + entity.setReceiveUserId(receiveUserId); + entity.setEnabledMark(0); + entity.setContent(message); + entity.setContentType(messageType); + this.save(entity); + + //写入到会话表中 + ImReplySavaModel imReplySavaModel = new ImReplySavaModel(sendUserId, receiveUserId, entity.getSendTime()); + ImReplyEntity imReplyEntity = JsonUtil.getJsonToBean(imReplySavaModel, ImReplyEntity.class); + imReplyService.savaImReply(imReplyEntity); + } + + @Override + public void readMessage(String sendUserId, String receiveUserId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ImContentEntity::getSendUserId, sendUserId); + queryWrapper.lambda().eq(ImContentEntity::getReceiveUserId, receiveUserId); + queryWrapper.lambda().eq(ImContentEntity::getEnabledMark, 0); + List list = this.list(queryWrapper); + for (ImContentEntity entity : list) { + entity.setEnabledMark(1); + entity.setReceiveTime(new Date()); + this.updateById(entity); + } + } + +// @Override +// public ImContentEntity getList(String userId, String receiveUserId) { +// QueryWrapper queryWrapper = new QueryWrapper<>(); +// queryWrapper.lambda().eq(ImContentEntity::getSendUserId, userId) +// .and(t -> t.eq(ImContentEntity::getReceiveUserId, receiveUserId)).orderByDesc(ImContentEntity::getReceiveTime); +// List list = this.list(queryWrapper); +// return list.size() > 0 ? list.get(0) : null; +// } + + + @Override + public boolean deleteChatRecord(String sendUserId, String receiveUserId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().and(t-> { + t.eq(ImContentEntity::getSendUserId, receiveUserId) + .eq(ImContentEntity::getReceiveUserId, sendUserId).or(); + t.eq(ImContentEntity::getReceiveUserId, receiveUserId) + .eq(ImContentEntity::getSendUserId, sendUserId); + }); + List list = this.list(queryWrapper); + for (ImContentEntity entity : list) { + if(entity.getDeleteUserId()!=null){ + if(!entity.getDeleteUserId().equals(sendUserId)) { + entity.setDeleteMark(1); + this.updateById(entity); + } + } + entity.setDeleteUserId(sendUserId); + this.updateById(entity); + } + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().eq(ImContentEntity::getDeleteMark,1); + this.remove(wrapper); + return false; + } +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/ImReplyServiceImpl.java b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/ImReplyServiceImpl.java new file mode 100644 index 0000000..55fed05 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/ImReplyServiceImpl.java @@ -0,0 +1,154 @@ +package jnpf.message.service.impl; + +import jnpf.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import jnpf.message.entity.ImContentEntity; +import jnpf.message.entity.ImReplyEntity; +import jnpf.message.mapper.ImReplyMapper; +import jnpf.message.model.ImReplyListModel; +import jnpf.message.service.ImReplyService; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.UserService; +import jnpf.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-05-29 + */ +@Service +public class ImReplyServiceImpl extends SuperServiceImpl implements ImReplyService { + + @Autowired + private UserProvider userProvider; + @Autowired + private UserService userService; + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ImReplyEntity::getUserId, userProvider.get().getUserId()).or() + .eq(ImReplyEntity::getReceiveUserId, userProvider.get().getUserId()) + .orderByDesc(ImReplyEntity::getUserId); + return this.list(); + } + + @Override + public boolean savaImReply(ImReplyEntity entity) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ImReplyEntity::getUserId, entity.getUserId()).eq(ImReplyEntity::getReceiveUserId, entity.getReceiveUserId()); + //判断数据是否存在 + ImReplyEntity imReplyEntity = this.getOne(queryWrapper); + if (imReplyEntity != null) { + entity.setId(imReplyEntity.getId()); + this.updateById(entity); + return true; + } + this.save(entity); + return true; + + } + + @Override + public List getImReplyList() { + List imReplyList = this.baseMapper.getImReplyList(); + List imReplyLists = new ArrayList<>(imReplyList); + // 过滤掉用户id和接收id相同的 + imReplyLists = imReplyList.stream().filter(t ->{ + if(t.getImreplySendDeleteMark() == null){ + return true; + } + return false; + }).collect(Collectors.toList()); +// // 过滤掉用户id和接收id相同的 +// List imReplyListModels = new ArrayList<>(imReplyList); +// for (int i = 0; i < imReplyList.size(); i++) { +// ImReplyListModel imReplyListModel = imReplyList.get(i); +// // 不和自己比 +// imReplyListModels.remove(imReplyList.get(i)); +// List irs = new ArrayList<>(imReplyListModels); +// ImReplyListModel model = irs.stream().filter(t -> t.getUserId().equals(imReplyListModel.getUserId()) && t.getId().equals(imReplyListModel.getId())).findFirst().orElse(null); +// if (model != null) { +// imReplyLists.remove(model); +// } +// } + //我发给别人 + List collect = imReplyLists.stream().filter(t -> t.getUserId().equals(userProvider.get().getUserId())).collect(Collectors.toList()); + //头像替换成对方的 + for (ImReplyListModel imReplyListModel : collect) { + UserEntity entity = userService.getInfo(imReplyListModel.getId()); + imReplyListModel.setHeadIcon(entity != null ? entity.getHeadIcon() : ""); +// imReplyListModel.setSendDeleteMark(imReplyListModel.getSendDeleteMark()); +// imReplyListModel.setImreplySendDeleteMark(imReplyListModel.getImreplySendDeleteMark()); +// imReplyListModel.setDeleteMark(imReplyListModel.getDeleteMark()); + } + //别人发给我 + List list = imReplyLists.stream().filter(t -> t.getId().equals(userProvider.get().getUserId())).collect(Collectors.toList()); + for (ImReplyListModel model : list) { + //移除掉互发的 + List collect1 = collect.stream().filter(t -> t.getId().equals(model.getUserId())).collect(Collectors.toList()); + if (collect1.size() > 0) { + //判断我发给别人的时间和接收的时间大小 + //接收的大于发送的 + if (model.getLatestDate().getTime() > collect1.get(0).getLatestDate().getTime()) { + collect.remove(collect1.get(0)); + } else { //发送的大于接收的则跳过 + continue; + } + } + ImReplyListModel imReplyListModel = new ImReplyListModel(); + UserEntity entity = userService.getInfo(model.getUserId()); + if(entity != null) { + imReplyListModel.setHeadIcon(entity.getHeadIcon()); + imReplyListModel.setUserId(userProvider.get().getUserId()); + imReplyListModel.setId(entity.getId()); + imReplyListModel.setLatestDate(model.getLatestDate()); + imReplyListModel.setLatestMessage(model.getLatestMessage()); + imReplyListModel.setMessageType(model.getMessageType()); + if (model.getImreplySendDeleteMark() != null && !model.getImreplySendDeleteMark().equals(userProvider.get().getUserId())) { + imReplyListModel.setSendDeleteMark(model.getSendDeleteMark()); + imReplyListModel.setImreplySendDeleteMark(model.getImreplySendDeleteMark()); + imReplyListModel.setDeleteMark(model.getDeleteMark()); + } + + collect.add(imReplyListModel); + } + } + return collect; + } + + @Override + public boolean relocation(String sendUserId, String receiveUserId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().and(t-> { + t.eq(ImReplyEntity::getUserId, receiveUserId) + .eq(ImReplyEntity::getReceiveUserId, sendUserId).or(); + t.eq(ImReplyEntity::getReceiveUserId, receiveUserId) + .eq(ImReplyEntity::getUserId, sendUserId); + }); + List list = this.list(queryWrapper); + for (ImReplyEntity entity : list) { + if(entity.getDeleteUserId()!=null){ + if(!entity.getDeleteUserId().equals(sendUserId)) { + entity.setDeleteMark(1); + this.updateById(entity); + } + } + entity.setDeleteUserId(sendUserId); + this.updateById(entity); + } + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().eq(ImReplyEntity::getDeleteMark,1); + this.remove(wrapper); + return false; + } + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/MessageMonitorServiceImpl.java b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/MessageMonitorServiceImpl.java new file mode 100644 index 0000000..5b6c74b --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/MessageMonitorServiceImpl.java @@ -0,0 +1,205 @@ +package jnpf.message.service.impl; + +import jnpf.base.service.SuperServiceImpl; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import jnpf.message.entity.MessageMonitorEntity; +import jnpf.message.mapper.MessageMonitorMapper; +import jnpf.message.model.messagemonitor.*; +import jnpf.message.service.MessageMonitorService; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.UserService; +import cn.hutool.core.util.ObjectUtil; +import jnpf.permission.service.AuthorizeService; +import java.lang.reflect.Field; +import com.baomidou.mybatisplus.annotation.TableField; +import jnpf.util.DateUtil; +import jnpf.util.JsonUtil; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springframework.beans.factory.annotation.Autowired; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; + +import java.util.*; + +/** + * 消息监控 + * 版本: V3.2.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2022-08-22 + */ +@Service +public class MessageMonitorServiceImpl extends SuperServiceImpl implements MessageMonitorService { + + + @Autowired + private UserProvider userProvider; + + @Autowired + private UserService userService; + + @Autowired + private AuthorizeService authorizeService; + + + @Override + public List getList(MessageMonitorPagination messageMonitorPagination) { + return getTypeList(messageMonitorPagination, messageMonitorPagination.getDataType()); + } + + @Override + public List getTypeList(MessageMonitorPagination messageMonitorPagination, String dataType) { + String userId = userProvider.get().getUserId(); + int total = 0; + int messageMonitorNum = 0; + QueryWrapper messageMonitorQueryWrapper = new QueryWrapper<>(); + //关键字 + if (ObjectUtil.isNotEmpty(messageMonitorPagination.getKeyword())) { + messageMonitorNum++; + messageMonitorQueryWrapper.lambda().and(t -> t.like(MessageMonitorEntity::getTitle, messageMonitorPagination.getKeyword())); + } + //消息类型 + if (ObjectUtil.isNotEmpty(messageMonitorPagination.getMessageType())) { + messageMonitorNum++; + messageMonitorQueryWrapper.lambda().eq(MessageMonitorEntity::getMessageType, messageMonitorPagination.getMessageType()); + } + //发送时间 + if (ObjectUtil.isNotEmpty(messageMonitorPagination.getStartTime()) && ObjectUtil.isNotEmpty(messageMonitorPagination.getEndTime())) { + messageMonitorNum++; + Long fir = Long.valueOf(String.valueOf(messageMonitorPagination.getStartTime())); + Long sec = Long.valueOf(String.valueOf(messageMonitorPagination.getEndTime())); + + messageMonitorQueryWrapper.lambda().ge(MessageMonitorEntity::getSendTime, new Date(fir)) + .le(MessageMonitorEntity::getSendTime, DateUtil.stringToDate(DateUtil.daFormatYmd(sec) + " 23:59:59")); + + } + //消息来源 + if (ObjectUtil.isNotEmpty(messageMonitorPagination.getMessageSource())) { + messageMonitorNum++; + messageMonitorQueryWrapper.lambda().eq(MessageMonitorEntity::getMessageSource, messageMonitorPagination.getMessageSource()); + } + //排序 + if (StringUtil.isEmpty(messageMonitorPagination.getSidx())) { + messageMonitorQueryWrapper.lambda().orderByDesc(MessageMonitorEntity::getSendTime); + } else { + try { + String sidx = messageMonitorPagination.getSidx(); + MessageMonitorEntity messageMonitorEntity = new MessageMonitorEntity(); + Field declaredField = messageMonitorEntity.getClass().getDeclaredField(sidx); + declaredField.setAccessible(true); + String value = declaredField.getAnnotation(TableField.class).value(); + messageMonitorQueryWrapper = "asc".equals(messageMonitorPagination.getSort().toLowerCase()) ? messageMonitorQueryWrapper.orderByAsc(value) : messageMonitorQueryWrapper.orderByDesc(value); + } catch (NoSuchFieldException e) { + e.printStackTrace(); + } + } + if (!"1".equals(dataType)) { + if (total > 0 || total == 0) { + Page page = new Page<>(messageMonitorPagination.getCurrentPage(), messageMonitorPagination.getPageSize()); + IPage userIPage = this.page(page, messageMonitorQueryWrapper); + return messageMonitorPagination.setData(userIPage.getRecords(), userIPage.getTotal()); + } else { + List list = new ArrayList(); + return messageMonitorPagination.setData(list, list.size()); + } + } else { + return this.list(messageMonitorQueryWrapper); + } + } + + + @Override + public MessageMonitorEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(MessageMonitorEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(MessageMonitorEntity entity) { + this.save(entity); + } + + @Override + public boolean update(String id, MessageMonitorEntity entity) { + entity.setId(id); + return this.updateById(entity); + } + + @Override + public void delete(MessageMonitorEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } + //子表方法 + + //列表子表数据方法 + + + //验证表单唯一字段 + @Override + public boolean checkForm(MessageMonitorForm form, int i) { + int total = 0; + if (total > 0) { + return true; + } + return false; + } + @Override + public void emptyMonitor(){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + this.remove(queryWrapper); + } + + + @Override + @DSTransactional + public boolean delete(String[] ids) { + if (ids.length > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(MessageMonitorEntity::getId, ids); + return this.remove(queryWrapper); + } + return false; + } + /** + * 用户id转名称(多选) + * + * @param ids + * @return + */ + @Override + public String userSelectValues(String ids) { + if (StringUtil.isEmpty(ids)) { + return ids; + } + if (ids.contains("[")){ + List nameList = new ArrayList<>(); + List jsonToList = JsonUtil.getJsonToList(ids, String.class); + for (String userId : jsonToList){ + UserEntity info = userService.getInfo(userId); + nameList.add(Objects.nonNull(info) ? info.getRealName()+ "/" + info.getAccount() : userId); + } + return String.join(";", nameList); + }else { + List userInfoList = new ArrayList<>(); + String[] idList = ids.split(","); + if (idList.length > 0) { + for (String id : idList) { + UserEntity userEntity = userService.getInfo(id); + if (ObjectUtil.isNotEmpty(userEntity)) { + String info = userEntity.getRealName() + "/" + userEntity.getAccount(); + userInfoList.add(info); + } + } + } + return String.join("-", userInfoList); + } + } + + +} \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/MessageServiceImpl.java b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/MessageServiceImpl.java new file mode 100644 index 0000000..3bd3a4b --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/MessageServiceImpl.java @@ -0,0 +1,861 @@ +package jnpf.message.service.impl; + +import jnpf.base.entity.DictionaryDataEntity; +import jnpf.base.entity.DictionaryTypeEntity; +import jnpf.base.service.DictionaryDataService; +import jnpf.base.service.DictionaryTypeService; +import jnpf.base.service.SuperServiceImpl; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import jnpf.base.Pagination; +import jnpf.base.UserInfo; +import jnpf.base.entity.MessageTemplateEntity; +import jnpf.base.util.SentMessageUtil; +import jnpf.config.ConfigValueUtil; +import jnpf.database.util.DataSourceUtil; +import jnpf.message.entity.*; +import jnpf.message.mapper.MessageMapper; +import jnpf.message.model.NoticePagination; +import jnpf.message.model.message.NoticeVO; +import jnpf.message.model.message.SentMessageForm; +import jnpf.message.service.*; +import jnpf.message.util.OnlineUserModel; +import jnpf.message.util.OnlineUserProvider; +import jnpf.message.util.unipush.UinPush; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.UserService; +import jnpf.util.*; +import jnpf.util.context.SpringContext; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.text.StringSubstitutor; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; +import org.springframework.stereotype.Service; +import org.springframework.util.ObjectUtils; +import org.springframework.web.bind.annotation.RequestBody; + +import javax.sql.DataSource; +import java.util.*; +import java.util.concurrent.Callable; +import java.util.concurrent.Future; +import java.util.stream.Collectors; + +/** + * 消息实例 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Service +@Slf4j +public class MessageServiceImpl extends SuperServiceImpl implements MessageService { + + @Autowired + private UserProvider userProvider; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private DataSourceUtil dataSourceUtils; + @Autowired + private MessagereceiveService messagereceiveService; + @Autowired + private MessageMonitorService messageMonitorService; + @Autowired + private UinPush uinPush; + @Autowired + private UserDeviceService userDeviceService; + + @Autowired + private RedisUtil redisUtil; + @Autowired + private DataSource dataSource; + @Autowired + private SentMessageUtil sentMessageUtil; + @Autowired + private SendMessageConfigService sendMessageConfigService; + @Autowired + private SendConfigTemplateService sendConfigTemplateService; + @Autowired + private MessageTemplateConfigService messageTemplateConfigService; + @Autowired + private UserService userService; + @Autowired + private DictionaryTypeService dictionaryTypeService; + @Autowired + private DictionaryDataService dictionaryDataService; + + @Override + public List getNoticeList(NoticePagination pagination) { + // 定义变量判断是否需要使用修改时间倒序 + QueryWrapper queryWrapper = new QueryWrapper<>(); + //关键词(消息标题) + if (!StringUtils.isEmpty(pagination.getKeyword())) { + queryWrapper.lambda().like(MessageEntity::getTitle, pagination.getKeyword()); + } + // 类型 + if (pagination.getType() != null && pagination.getType().size() > 0) { + queryWrapper.lambda().in(MessageEntity::getCategory, pagination.getType()); + } + // 状态 + if (pagination.getEnabledMark() != null && pagination.getEnabledMark().size() > 0) { + queryWrapper.lambda().in(MessageEntity::getEnabledMark, pagination.getEnabledMark()); + } else { + queryWrapper.lambda().and(t->t.ne(MessageEntity::getEnabledMark, 3).or().isNull(MessageEntity::getEnabledMark)); + } + //默认排序 + queryWrapper.lambda().orderByAsc(MessageEntity::getEnabledMark).orderByDesc(MessageEntity::getLastModifyTime).orderByDesc(MessageEntity::getCreatorTime); + queryWrapper.lambda().select(MessageEntity::getId, MessageEntity::getCreatorUserId, MessageEntity::getEnabledMark, + MessageEntity::getLastModifyTime, MessageEntity::getTitle, MessageEntity::getCreatorTime, + MessageEntity::getLastModifyUserId, MessageEntity::getExpirationTime, MessageEntity::getCategory); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage userIPage = this.page(page, queryWrapper); + return pagination.setData(userIPage.getRecords(), page.getTotal()); + } + + @Override + public List getNoticeList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(MessageEntity::getEnabledMark, 1); + queryWrapper.lambda().orderByAsc(MessageEntity::getSortCode); + return this.baseMapper.selectList(queryWrapper); + } + + @Override + public List getDashboardNoticeList(List typeList) { + List list = new ArrayList<>(16); + // 判断哪些消息是自己接收的 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(MessageReceiveEntity::getUserId, userProvider.get().getUserId()); + queryWrapper.lambda().eq(MessageReceiveEntity::getType, 1); + List receiveEntities = messagereceiveService.list(queryWrapper); + for (int i = 0; i < receiveEntities.size(); i++) { + // 得到message + MessageReceiveEntity messageReceiveEntity = receiveEntities.get(i); + MessageEntity entity = JsonUtil.getJsonToBean(messageReceiveEntity.getBodyText(), MessageEntity.class); + if (entity != null) { + if (StringUtil.isNotEmpty(entity.getId())) { + MessageEntity messageEntity = this.getInfo(entity.getId()); + if (messageEntity != null) { + if ((typeList != null && typeList.size() > 0 && typeList.contains(messageEntity.getCategory()) || typeList == null || typeList.size() == 0)) { + if (Objects.equals(messageEntity.getEnabledMark(), 1) + && (entity.getExpirationTime() == null || entity.getExpirationTime().getTime() > System.currentTimeMillis())) { + messageEntity.setId(messageReceiveEntity.getId()); + list.add(messageEntity); + } + } + } + } + } + if (list.size() > 49) { + break; + } + } + list = list.stream().sorted(Comparator.comparing(MessageEntity::getLastModifyTime).reversed()).collect(Collectors.toList()); + return list; + } + + @Override + public List getMessageList1(Pagination pagination, Integer type,Integer isRead) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(MessageReceiveEntity::getUserId, UserProvider.getLoginUserId()); + if (type != null) { + queryWrapper.lambda().eq(MessageReceiveEntity::getType, type); + } + if (isRead != null) { + queryWrapper.lambda().eq(MessageReceiveEntity::getIsRead, isRead); + } + if (StringUtil.isNotEmpty(pagination.getKeyword())) { + queryWrapper.lambda().and(t -> { + t.like(MessageReceiveEntity::getTitle, pagination.getKeyword()); + }); + } + queryWrapper.lambda().orderByDesc(MessageReceiveEntity::getCreatorTime); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage userIPage = messagereceiveService.page(page, queryWrapper); + return pagination.setData(userIPage.getRecords(), page.getTotal()); + } + + @Override + public List getMessageList3(Pagination pagination, Integer type, String user,Integer isRead) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(MessageReceiveEntity::getUserId, UserProvider.getLoginUserId()); + if (type != null) { + queryWrapper.lambda().eq(MessageReceiveEntity::getType, type); + } + if (isRead != null) { + queryWrapper.lambda().eq(MessageReceiveEntity::getIsRead, isRead); + } + if (StringUtil.isNotEmpty(pagination.getKeyword())) { + queryWrapper.lambda().and(t -> { + t.like(MessageReceiveEntity::getTitle, pagination.getKeyword()); + }); + } + queryWrapper.lambda().orderByDesc(MessageReceiveEntity::getCreatorTime); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage userIPage = messagereceiveService.page(page, queryWrapper); + return pagination.setData(userIPage.getRecords(), page.getTotal()); + } + + @Override + public List getMessageList(Pagination pagination, Integer type, String user) { + String userId = StringUtil.isEmpty(user) ? userProvider.get().getUserId() : user; + Map map = new HashMap<>(16); + map.put("userId", userId); + //关键词(消息标题) + String keyword = pagination.getKeyword(); + if (!StringUtil.isEmpty(keyword)) { + map.put("keyword", "%" + keyword + "%"); + } + //消息类别 + if (!ObjectUtils.isEmpty(type)) { + map.put("type", type); + } + List lists = this.baseMapper.getMessageList(map); + return pagination.setData(PageUtil.getListPage((int) pagination.getCurrentPage(), (int) pagination.getPageSize(), lists), lists.size()); + } + + @Override + public List getMessageList(Pagination pagination) { + return this.getMessageList(pagination, null,null); + } + + @Override + public MessageEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(MessageEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public MessageEntity getInfoDefault(int type) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(MessageEntity::getEnabledMark, 1); + if (type == 1) { + queryWrapper.lambda().orderByDesc(MessageEntity::getCreatorTime); + } else { + queryWrapper.lambda().orderByDesc(MessageEntity::getLastModifyTime); + } + // 只查询id + queryWrapper.lambda().select(MessageEntity::getId, MessageEntity::getTitle, MessageEntity::getCreatorTime); + List list = this.page(new Page<>(1, 1, false), queryWrapper).getRecords(); + MessageEntity entity = new MessageEntity(); + if (list.size() > 0) { + entity = list.get(0); + } + return entity; + } + + @Override + @DSTransactional + public void delete(MessageEntity entity) { + this.removeById(entity.getId()); + } + + @Override + public void create(MessageEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setBodyText(XSSEscape.escapeImgOnlyBase64(entity.getBodyText())); + entity.setEnabledMark(0); + entity.setCreatorUserId(userProvider.get().getUserId()); + this.save(entity); + } + + @Override + public boolean update(String id, MessageEntity entity) { + entity.setId(id); + entity.setBodyText(XSSEscape.escapeImgOnlyBase64(entity.getBodyText())); + entity.setCreatorUserId(userProvider.get().getUserId()); + entity.setLastModifyUserId(null); + entity.setLastModifyTime(null); + return this.updateById(entity); + } + + @Override + public MessageReceiveEntity messageRead(String messageId) { + String userId = userProvider.get().getUserId(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(MessageReceiveEntity::getUserId, userId).eq(MessageReceiveEntity::getId, messageId); + MessageReceiveEntity entity = messagereceiveService.getOne(queryWrapper); + if (entity != null) { + entity.setIsRead(1); + messagereceiveService.updateById(entity); + } + return entity; + } + + @Override + @DSTransactional + public void messageRead(List idList) { + String userId = userProvider.get().getUserId(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(MessageReceiveEntity::getUserId, userId).eq(MessageReceiveEntity::getIsRead, 0); +// queryWrapper.lambda().in(MessageReceiveEntity::getMessageId,idList); + List entitys = messagereceiveService.list(queryWrapper); + if (entitys.size() > 0) { + for (MessageReceiveEntity entity : entitys) { + entity.setIsRead(1); + messagereceiveService.updateById(entity); + } + } + } + + @Override + @DSTransactional + public void deleteRecord(List messageIds) { + // 删除已读表 + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (messageIds.size() > 0) { + queryWrapper.lambda().in(MessageReceiveEntity::getId, messageIds); + } + // 通过id删除无需判断接收人 + queryWrapper.lambda().eq(MessageReceiveEntity::getUserId, UserProvider.getLoginUserId()); + messagereceiveService.remove(queryWrapper); + } + + @Override + public int getUnreadCount(String userId, Integer type) { + int result = this.baseMapper.getUnreadCount(userId,type); + return result; + } + + @Override + public boolean sentNotice(List toUserIds, MessageEntity entity) { + // 存到redis中的key对象 + UserInfo userInfo = userProvider.get(); + List idList = new ArrayList<>(); + // 修改发送状态 + entity.setEnabledMark(1); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(userInfo.getUserId()); + this.updateById(entity); + // 存到redis,生成Redis的key + Callable executeInsert = () -> { + executeInsert(toUserIds, idList); + return true; + }; + ThreadPoolTaskExecutor threadPoolExecutor = SpringContext.getBean(ThreadPoolTaskExecutor.class); + Future submit = threadPoolExecutor.submit(executeInsert); + try { + if (submit.get()) { + // 执行发送公告操作 + Runnable runnable = () -> executeBatch(idList, entity, userInfo); + threadPoolExecutor.submit(runnable); + } + return true; + } catch (Exception e) { + // 还原公告状态 + entity.setEnabledMark(0); + entity.setLastModifyTime(null); + entity.setLastModifyUserId(null); + this.updateById(entity); + } + return false; + } + + /** + * 数据存到redis中 + * + * @param toUserIds 接受者id + */ + private void executeInsert(List toUserIds, List idList) throws Exception { + List key = new ArrayList<>(); + try { + int frequency = 10000; + int count = toUserIds.size() / frequency + 1; + if (toUserIds.size() < 1) return; + for (int i = 0; i < count; i++) { + // 生成redis的key + String cacheKey = RandomUtil.uuId() + toUserIds.get(i); + // 存到redis + int endSize = Math.min(((i + 1) * frequency), toUserIds.size()); + redisUtil.insert(cacheKey, toUserIds.subList(i * frequency, endSize)); + key.add(cacheKey); + } + } catch (Exception e) { + key.forEach(k->redisUtil.remove(k)); + key.clear(); + throw new Exception(); + } + idList.addAll(key); + } + + /** + * 执行发送操作 + * + * @param idList 存到redis中的key + * @param entity + * @param userInfo + */ + private void executeBatch(List idList, MessageEntity entity, UserInfo userInfo) { + if (idList.size() == 0 || "3".equals(String.valueOf(entity.getRemindCategory()))) { + return; + } + SentMessageForm sentMessageForm = new SentMessageForm(); + List toUserId = new ArrayList<>(); + for (String cacheKey : idList) { + List cacheValue = (List)redisUtil.get(cacheKey, 0, -1); + toUserId.addAll(cacheValue); + } + sentMessageForm.setToUserIds(toUserId); + sentMessageForm.setTitle(entity.getTitle()); + sentMessageForm.setContent(entity.getBodyText()); + sentMessageForm.setContentMsg(Collections.EMPTY_MAP); + sentMessageForm.setUserInfo(userInfo); + sentMessageForm.setType(1); + sentMessageForm.setId(entity.getId()); + + // 站内信 + if ("1".equals(String.valueOf(entity.getRemindCategory()))) { + message(sentMessageForm); + } else if ("2".equals(String.valueOf(entity.getRemindCategory()))) { + SendMessageConfigEntity sendMessageConfigEntity = sendMessageConfigService.getInfo(entity.getSendConfigId()); + if (sendMessageConfigEntity != null) { + List configTemplateEntityList = sendConfigTemplateService.getDetailListByParentId(sendMessageConfigEntity.getId()); + for (SendConfigTemplateEntity sendConfigTemplateEntity : configTemplateEntityList) { + Map map = new HashMap<>(); + map.put("Title", entity.getTitle()); + map.put("Content", entity.getBodyText()); + map.put("Remark", entity.getExcerpt()); + Map paramMap = new HashMap<>(); + paramMap.put("@title", entity.getTitle()); + paramMap.put("@Content", entity.getBodyText()); + paramMap.put("@Remark", entity.getExcerpt()); + switch (sendConfigTemplateEntity.getMessageType()) { + case "1" : + MessageTemplateConfigEntity configEntity = messageTemplateConfigService.getInfo(sendConfigTemplateEntity.getTemplateId()); + if (configEntity != null) { + sentMessageForm.setTitle(configEntity.getTitle()); + } + message(sentMessageForm); + break; + case "2": + // 邮件 + sentMessageUtil.SendMail(toUserId, userInfo, "2", sendConfigTemplateEntity, new HashMap<>(), map); + break; + case "3": + // 发送短信 + sentMessageUtil.sendSms(toUserId, userInfo, sendConfigTemplateEntity, paramMap, new HashMap<>()); + break; + case "4": + // 钉钉 + JSONObject jsonObject1 = sentMessageUtil.SendDingTalk(toUserId, userInfo, "4", sendConfigTemplateEntity, new HashMap<>(), map); + if (!(Boolean) jsonObject1.get("code")) { + log.error("发送企业微信消息失败,错误:" + jsonObject1.get("error")); + } + break; + case "5": + // 企业微信 + JSONObject jsonObject = sentMessageUtil.SendQyWebChat(toUserId, userInfo, "5", sendConfigTemplateEntity, new HashMap<>(), map); + if (!(Boolean) jsonObject.get("code")) { + log.error("发送企业微信消息失败,错误:" + jsonObject.get("error")); + } + break; + case "6": + // webhook + sentMessageUtil.SendWebHook(null, userInfo, sendConfigTemplateEntity, new HashMap<>(), map); + break; + case "7": + // 微信公众号 + sentMessageUtil.SendWXGzhChat(toUserId, userInfo, "7", sendConfigTemplateEntity, new HashMap<>(), paramMap); + break; + default: + break; + } + } + + } + } + } + + + @Override + public void sentMessage(List toUserIds, String title) { + this.sentMessage(toUserIds, title, null); + } + + @Override + @DSTransactional + public void sentMessage(List toUserIds, String title, String bodyText) { + UserInfo userInfo = userProvider.get(); + + MessageReceiveEntity messageReceiveEntity = new MessageReceiveEntity(); + messageReceiveEntity.setTitle(title); + messageReceiveEntity.setType(2); + messageReceiveEntity.setFlowType(1); + messageReceiveEntity.setIsRead(0); + List receiveEntityList = new ArrayList<>(); + for (String item : toUserIds) { + MessageReceiveEntity messageReceiveEntitys = new MessageReceiveEntity(); + BeanUtils.copyProperties(messageReceiveEntity, messageReceiveEntitys); + messageReceiveEntitys.setId(RandomUtil.uuId()); + messageReceiveEntitys.setUserId(item); + messageReceiveEntitys.setBodyText(bodyText); + receiveEntityList.add(messageReceiveEntitys); + } + for (MessageReceiveEntity messageReceiveEntitys : receiveEntityList) { + messagereceiveService.save(messageReceiveEntitys); + } + //消息推送 - PC端 + for (int i = 0; i < toUserIds.size(); i++) { + for (OnlineUserModel item : OnlineUserProvider.getOnlineUserList()) { + if (toUserIds.get(i).equals(item.getUserId()) && userInfo.getTenantId().equals(item.getTenantId())) { + JSONObject map = new JSONObject(); + map.put("method", "messagePush"); + map.put("unreadNoticeCount", 1); + map.put("messageType", 2); + map.put("userId", userInfo.getTenantId()); + map.put("toUserId", toUserIds); + map.put("title", messageReceiveEntity.getTitle()); + map.put("messageDefaultTime", messageReceiveEntity.getLastModifyTime() != null ? messageReceiveEntity.getLastModifyTime().getTime() : null); + OnlineUserProvider.sendMessage(item, map); + } + } + } + } + + @Override + @DSTransactional + public void sentMessage(List toUserIds, String title, String bodyText, Map contentMsg, UserInfo userInfo) { + MessageReceiveEntity messageReceiveEntity = new MessageReceiveEntity(); + messageReceiveEntity.setTitle(title); + messageReceiveEntity.setType(2); + messageReceiveEntity.setFlowType(1); + messageReceiveEntity.setIsRead(0); + List receiveEntityList = new ArrayList<>(); + for (String item : toUserIds) { + MessageReceiveEntity messageReceiveEntitys = new MessageReceiveEntity(); + BeanUtils.copyProperties(messageReceiveEntity, messageReceiveEntitys); + messageReceiveEntitys.setId(RandomUtil.uuId()); + messageReceiveEntitys.setUserId(item); + String msg = contentMsg.get(item) != null ? contentMsg.get(item) : "{}"; + messageReceiveEntitys.setBodyText(msg); + receiveEntityList.add(messageReceiveEntitys); + } + for (MessageReceiveEntity messageReceiveEntitys : receiveEntityList) { + messagereceiveService.save(messageReceiveEntitys); + /*List cidList = userDeviceService.getCidList(messageReceiveEntity.getUserId()); + //个推 + if (cidList != null && cidList.size() > 0) { + JSONObject jsonObject = new JSONObject(); + jsonObject.put("type", "2"); + jsonObject.put("id", entity.getId()); + jsonObject.put("title",title); + String text = JSONObject.toJSONString(jsonObject); + byte[] bytes = text.getBytes(StandardCharsets.UTF_8); + text = Base64.getEncoder().encodeToString(bytes); + uinPush.sendUniPush(cidList, title, "你有一条流程消息", "2", text); + }*/ + } + + //消息推送 - PC端 + for (int i = 0; i < toUserIds.size(); i++) { + for (OnlineUserModel item : OnlineUserProvider.getOnlineUserList()) { + if (toUserIds.get(i).equals(item.getUserId()) && userInfo.getTenantId().equals(item.getTenantId())) { + JSONObject map = new JSONObject(); + map.put("method", "messagePush"); + map.put("unreadNoticeCount", 1); + map.put("messageType", 2); + map.put("userId", userInfo.getTenantId()); + map.put("toUserId", toUserIds); + map.put("title", messageReceiveEntity.getTitle()); + map.put("id",messageReceiveEntity.getId()); + map.put("messageDefaultTime", messageReceiveEntity.getLastModifyTime() != null ? messageReceiveEntity.getLastModifyTime().getTime() : null); + OnlineUserProvider.sendMessage(item, map); + } + } + } + } + + @Override + @DSTransactional + public void sentMessage(List toUserIds, String title, String bodyText, UserInfo userInfo, Integer source, Integer type) { + sentMessage(toUserIds, title, bodyText, userInfo, source, type, false); + } + + @Override + @DSTransactional + public void sentMessage(List toUserIds, String title, String bodyText, UserInfo userInfo, Integer source, Integer type, boolean testMessage) { + MessageReceiveEntity messageReceiveEntity = new MessageReceiveEntity(); + messageReceiveEntity.setTitle(title); + messageReceiveEntity.setType(source); + messageReceiveEntity.setFlowType(1); + messageReceiveEntity.setIsRead(0); + List receiveEntityList = new ArrayList<>(); + for (String item : toUserIds) { + MessageReceiveEntity messageReceiveEntitys = new MessageReceiveEntity(); + BeanUtils.copyProperties(messageReceiveEntity, messageReceiveEntitys); + messageReceiveEntitys.setId(RandomUtil.uuId()); + messageReceiveEntitys.setUserId(item); + receiveEntityList.add(messageReceiveEntitys); + } +// if (testMessage && source == 1) { +// entity.setEnabledMark(3); +// } + for (MessageReceiveEntity messageReceiveEntitys : receiveEntityList) { + messagereceiveService.save(messageReceiveEntitys); + } + //消息监控写入 + MessageMonitorEntity monitorEntity = new MessageMonitorEntity(); + monitorEntity.setId(RandomUtil.uuId()); + monitorEntity.setTitle(title); + monitorEntity.setMessageType(String.valueOf(type)); + monitorEntity.setMessageSource(String.valueOf(source)); + monitorEntity.setReceiveUser(JsonUtil.getObjectToString(toUserIds)); + monitorEntity.setSendTime(DateUtil.getNowDate()); + monitorEntity.setCreatorTime(DateUtil.getNowDate()); + monitorEntity.setCreatorUserId(userInfo.getUserId()); + messageMonitorService.create(monitorEntity); + for (int i = 0; i < toUserIds.size(); i++) { + for (OnlineUserModel item : OnlineUserProvider.getOnlineUserList()) { + if (toUserIds.get(i).equals(item.getUserId()) && userInfo.getTenantId().equals(item.getTenantId())) { + JSONObject map = new JSONObject(); + map.put("method", "messagePush"); + map.put("unreadNoticeCount", 1); + map.put("messageType", messageReceiveEntity.getType()); + map.put("userId", userInfo.getTenantId()); + map.put("toUserId", toUserIds); + map.put("title", messageReceiveEntity.getTitle()); + map.put("id",messageReceiveEntity.getId()); + map.put("messageDefaultTime", messageReceiveEntity.getLastModifyTime() != null ? messageReceiveEntity.getLastModifyTime().getTime() : null); + OnlineUserProvider.sendMessage(item, map); + } + } + } + } + + @Override + public void sentFlowMessage(List toUserIds, MessageTemplateEntity entity, String content) { + if (entity != null) { + // 消息标题 + String title = entity.getTitle(); + this.sentMessage(toUserIds, title, content); + } + } + + @Override + public void logoutWebsocketByToken(String token, String userId){ + if(StringUtil.isNotEmpty(token)) { + OnlineUserProvider.removeWebSocketByToken(token.split(",")); + }else{ + OnlineUserProvider.removeWebSocketByUser(userId); + } + } + + @Override + public void sentScheduleMessage(SentMessageForm sentMessageForm, String type) { + UserInfo userInfo = sentMessageForm.getUserInfo(); + String templateId = sentMessageForm.getTemplateId(); + String title = sentMessageForm.getTitle(); + List toUserIds = sentMessageForm.getToUserIds(); + //获取发送配置详情 + SendMessageConfigEntity configEntity = sendMessageConfigService.getInfoByEnCode(templateId); + if (configEntity != null) { + templateId = configEntity.getId(); + } else { + configEntity = sendMessageConfigService.getInfo(templateId); + } + List list = sendConfigTemplateService.getDetailListByParentId(templateId); + if (configEntity != null) { + for (SendConfigTemplateEntity sendConfigTemplateEntity : list) { + Map objectMap = new HashMap<>(sentMessageForm.getParameterMap()); + Map parameterMap = new HashMap<>(); + for(String key:objectMap.keySet()){ + if(key.contains(sendConfigTemplateEntity.getId())){ + parameterMap.put(key.substring(sendConfigTemplateEntity.getId().length()),objectMap.get(key)); + } + } + parameterMap.putAll(objectMap); + Map contentMsg = new HashMap<>(); + for(String key : parameterMap.keySet()){ + contentMsg.put(key,String.valueOf(parameterMap.get(key))); + } + String sendType = sendConfigTemplateEntity.getMessageType(); + switch (sendType) { + case "1": + MessageTemplateConfigEntity templateConfigEntity = messageTemplateConfigService.getInfo(sendConfigTemplateEntity.getTemplateId()); + String messageTitle = StringUtil.isNotEmpty(templateConfigEntity.getTitle()) ? templateConfigEntity.getTitle() : ""; + String content = StringUtil.isNotEmpty(templateConfigEntity.getContent()) ? templateConfigEntity.getContent() : ""; + StringSubstitutor strSubstitutor = new StringSubstitutor(parameterMap, "{", "}"); + messageTitle = strSubstitutor.replace(messageTitle); + content = strSubstitutor.replace(content); + sentMessageForm.setTitle(messageTitle); + sentMessageForm.setContent(content); + // 站内消息 + message(sentMessageForm); + break; + case "2": + // 邮件 + sentMessageUtil.SendMail(toUserIds, userInfo, sendType, sendConfigTemplateEntity, new HashMap<>(), contentMsg); + break; + case "3": + // 发送短信 + sentMessageUtil.sendSms(toUserIds, userInfo, sendConfigTemplateEntity, parameterMap, new HashMap<>()); + break; + case "4": + // 钉钉 + JSONObject jsonObject1 = sentMessageUtil.SendDingTalk(toUserIds, userInfo, sendType, sendConfigTemplateEntity, new HashMap<>(), contentMsg); + if (!(Boolean) jsonObject1.get("code")) { + log.error("发送企业微信消息失败,错误:" + jsonObject1.get("error")); + } + break; + case "5": + // 企业微信 + JSONObject jsonObject = sentMessageUtil.SendQyWebChat(toUserIds, userInfo, sendType, sendConfigTemplateEntity, new HashMap<>(), contentMsg); + if (!(Boolean) jsonObject.get("code")) { + log.error("发送企业微信消息失败,错误:" + jsonObject.get("error")); + } + break; + case "6": + // webhook + sentMessageUtil.SendWebHook(sendType, userInfo, sendConfigTemplateEntity, new HashMap<>(),contentMsg); + break; + case "7": + // 微信公众号 + sentMessageUtil.SendWXGzhChat(toUserIds, userInfo, sendType, sendConfigTemplateEntity, new HashMap<>(),parameterMap); + break; + default: + break; + } + } + } + } + + @Override + public Boolean updateEnabledMark() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().and(t->t.eq(MessageEntity::getEnabledMark, 1).lt(MessageEntity::getExpirationTime, new Date())); + List list = this.list(queryWrapper); + list.forEach(t -> { + t.setEnabledMark(2); + this.updateById(t); + }); + return true; + } + + /** + * 工作流消息发送 + * + * @param toUserIds + * @param entity + * @param userInfo + */ + private static void pushMessage(List toUserIds, MessageReceiveEntity entity, UserInfo userInfo,int messageType){ + for (int i = 0; i < toUserIds.size(); i++) { + for (OnlineUserModel item : OnlineUserProvider.getOnlineUserList()) { + if (toUserIds.get(i).equals(item.getUserId()) && userInfo.getTenantId().equals(item.getTenantId())) { + JSONObject map = new JSONObject(); + map.put("method", "messagePush"); + map.put("unreadNoticeCount", 1); + map.put("messageType", messageType); + map.put("userId", userInfo.getTenantId()); + map.put("toUserId", toUserIds); + map.put("title", entity.getTitle()); + map.put("id",entity.getId()); + map.put("messageDefaultTime", entity.getLastModifyTime() != null ? entity.getLastModifyTime().getTime() : null); + OnlineUserProvider.sendMessage(item, map); + } + } + } + } + + private void message(SentMessageForm sentMessageForm) { + List toUserIds = sentMessageForm.getToUserIds(); + Integer type = sentMessageForm.getType(); + String title = sentMessageForm.getTitle(); + String content = sentMessageForm.getContent(); + String bodyText = Objects.equals(type,3) ? content: JsonUtil.getObjectToString(sentMessageForm.getContentMsg()); + UserInfo userInfo = sentMessageForm.getUserInfo(); + MessageReceiveEntity messageReceiveEntity = new MessageReceiveEntity(); + messageReceiveEntity.setIsRead(0); + messageReceiveEntity.setId(RandomUtil.uuId()); + messageReceiveEntity.setType(sentMessageForm.getType()); + if (type != null) { + messageReceiveEntity.setId(sentMessageForm.getId()); + messageReceiveEntity.setType(type); + } + //消息监控写入 + MessageMonitorEntity monitorEntity = new MessageMonitorEntity(); + MessageEntity messageEntity = this.getInfo(sentMessageForm.getId()); + if (!"1".equals(String.valueOf(messageReceiveEntity.getType()))) { + monitorEntity.setMessageSource(sentMessageForm.getType()+""); + messageReceiveEntity.setFlowType(sentMessageForm.getFlowType()); + monitorEntity.setTitle(title); + } else { + monitorEntity.setMessageSource("1"); + title = title.replaceAll("\\{@Title}", messageEntity.getTitle()) + .replaceAll("\\{@CreatorUserName}", userInfo.getUserName()) + .replaceAll("\\{@Content}", messageEntity.getBodyText()) + .replaceAll("\\{@Remark}", StringUtil.isNotEmpty(messageEntity.getExcerpt()) ? messageEntity.getExcerpt() : ""); + monitorEntity.setTitle(title); + bodyText = JsonUtil.getObjectToString(messageEntity); + } + List receiveEntityList = new ArrayList<>(); + for (String item : toUserIds) { + MessageReceiveEntity messageReceiveEntitys = new MessageReceiveEntity(); + BeanUtils.copyProperties(messageReceiveEntity, messageReceiveEntitys); + messageReceiveEntitys.setId(RandomUtil.uuId()); + messageReceiveEntitys.setUserId(item); + messageReceiveEntitys.setTitle(title); +// if(ObjectUtil.isNotEmpty(messageEntity)) { +// messageReceiveEntitys.setTitle(title.replaceAll("\\{@Title}", messageEntity.getTitle()) +// .replaceAll("\\{@CreatorUserName}", userInfo.getUserName()) +// .replaceAll("\\{@Content}", messageEntity.getBodyText()) +// .replaceAll("\\{@Remark}", StringUtil.isNotEmpty(messageEntity.getExcerpt()) ? messageEntity.getExcerpt() : "")); +// } + messageReceiveEntitys.setBodyText(bodyText); + receiveEntityList.add(messageReceiveEntitys); + } + for (MessageReceiveEntity messageReceiveEntitys : receiveEntityList) { + messageReceiveEntitys.setTitle(title); + messageReceiveEntitys.setCreatorUserId(userInfo.getUserId()); + messageReceiveEntitys.setCreatorTime(new Date()); + messagereceiveService.save(messageReceiveEntitys); + } + monitorEntity.setId(RandomUtil.uuId()); + monitorEntity.setMessageType("1"); + monitorEntity.setReceiveUser(JsonUtil.getObjectToString(toUserIds)); + monitorEntity.setSendTime(DateUtil.getNowDate()); + monitorEntity.setCreatorTime(DateUtil.getNowDate()); + monitorEntity.setCreatorUserId(userInfo.getUserId()); + monitorEntity.setContent(content); + messageMonitorService.create(monitorEntity); + //消息推送 - PC端 + pushMessage(toUserIds, messageReceiveEntity, userInfo, 4); + } + + + + public List getNoticeList(List list){ + List dashboardNoticeList = this.getDashboardNoticeList(list); + List userList = userService.getUserName(dashboardNoticeList.stream().map(MessageEntity::getCreatorUserId).collect(Collectors.toList())); + DictionaryTypeEntity dictionaryTypeEntity = dictionaryTypeService.getInfoByEnCode("NoticeType"); + List noticeType = dictionaryDataService.getDicList(dictionaryTypeEntity.getId()); + dashboardNoticeList.forEach(t -> { + // 转换创建人、发布人 + UserEntity user = userList.stream().filter(ul -> ul.getId().equals(t.getCreatorUserId())).findFirst().orElse(null); + t.setCreatorUserId(user != null ? user.getRealName() + "/" + user.getAccount() : ""); + if (t.getEnabledMark() != null && t.getEnabledMark() != 0) { + UserEntity entity = userService.getInfo(t.getLastModifyUserId()); + t.setLastModifyUserId(entity != null ? entity.getRealName() + "/" + entity.getAccount() : ""); + } + DictionaryDataEntity dictionaryDataEntity = noticeType.stream().filter(notice -> notice.getEnCode().equals(t.getCategory())).findFirst().orElse(new DictionaryDataEntity()); + t.setCategory(dictionaryDataEntity.getFullName()); + }); + List jsonToList = new ArrayList<>(); + dashboardNoticeList.forEach(t->{ + NoticeVO vo = JsonUtil.getJsonToBean(t, NoticeVO.class); + vo.setReleaseTime(t.getLastModifyTime() != null ? t.getLastModifyTime().getTime() : null); + vo.setReleaseUser(t.getLastModifyUserId()); + vo.setCreatorUser(t.getCreatorUserId()); + jsonToList.add(vo); + }); + return jsonToList; + } +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/MessageTemplateConfigServiceImpl.java b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/MessageTemplateConfigServiceImpl.java new file mode 100644 index 0000000..033ac9d --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/MessageTemplateConfigServiceImpl.java @@ -0,0 +1,505 @@ +package jnpf.message.service.impl; + +import jnpf.base.service.SuperServiceImpl; +import jnpf.base.ActionResult; +import jnpf.constant.MsgCode; +import jnpf.database.model.superQuery.ConditionJsonModel; +import jnpf.database.model.superQuery.SuperQueryConditionModel; +import jnpf.exception.DataException; +import jnpf.message.entity.MessageTemplateConfigEntity; +import jnpf.message.entity.SmsFieldEntity; +import jnpf.message.entity.TemplateParamEntity; +import jnpf.message.mapper.MessageTemplateConfigMapper; +import jnpf.message.model.messagetemplateconfig.MessageTemplateConfigForm; +import jnpf.message.model.messagetemplateconfig.MessageTemplateConfigPagination; +import jnpf.message.model.messagetemplateconfig.TemplateParamModel; +import jnpf.message.service.MessageTemplateConfigService; +import jnpf.message.service.SmsFieldService; +import jnpf.message.service.TemplateParamService; +import cn.hutool.core.util.ObjectUtil; +import jnpf.permission.service.AuthorizeService; +import java.lang.reflect.Field; +import com.baomidou.mybatisplus.annotation.TableField; +import jnpf.util.DateUtil; +import jnpf.util.JsonUtil; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import jnpf.util.visiual.JnpfKeyConsts; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springframework.beans.factory.annotation.Autowired; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; + +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +/** + * 消息模板(新) + * 版本: V3.2.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2022-08-18 + */ +@Service +public class MessageTemplateConfigServiceImpl extends SuperServiceImpl implements MessageTemplateConfigService { + + + + @Autowired + private UserProvider userProvider; + + @Autowired + private AuthorizeService authorizeService; + + + @Autowired + private TemplateParamService templateParamService; + + @Autowired + private SmsFieldService smsFieldService; + + + @Override + public List getList(MessageTemplateConfigPagination MessageTemplateConfigPagination) { + return getTypeList(MessageTemplateConfigPagination, MessageTemplateConfigPagination.getDataType()); + } + + @Override + public List getTypeList(MessageTemplateConfigPagination MessageTemplateConfigPagination, String dataType) { + String userId = userProvider.get().getUserId(); + int total = 0; + int messageTemplateNewNum = 0; + QueryWrapper messageTemplateNewQueryWrapper = new QueryWrapper<>(); + int templateParamNum = 0; + QueryWrapper templateParamQueryWrapper = new QueryWrapper<>(); + int smsFieldNum = 0; + QueryWrapper smsFieldQueryWrapper = new QueryWrapper<>(); + //关键字 + if (ObjectUtil.isNotEmpty(MessageTemplateConfigPagination.getKeyword())) { + messageTemplateNewNum++; + messageTemplateNewQueryWrapper.lambda().and(t -> t.like(MessageTemplateConfigEntity::getEnCode, MessageTemplateConfigPagination.getKeyword()). + or().like(MessageTemplateConfigEntity::getFullName, MessageTemplateConfigPagination.getKeyword())); + } + //模板类型 + if (ObjectUtil.isNotEmpty(MessageTemplateConfigPagination.getTemplateType())) { + messageTemplateNewNum++; + messageTemplateNewQueryWrapper.lambda().eq(MessageTemplateConfigEntity::getTemplateType, MessageTemplateConfigPagination.getTemplateType()); + } + //消息类型 + if (ObjectUtil.isNotEmpty(MessageTemplateConfigPagination.getMessageType())) { + messageTemplateNewNum++; + messageTemplateNewQueryWrapper.lambda().eq(MessageTemplateConfigEntity::getMessageType, MessageTemplateConfigPagination.getMessageType()); + } + //消息来源 + if (ObjectUtil.isNotEmpty(MessageTemplateConfigPagination.getMessageSource())) { + messageTemplateNewNum++; + messageTemplateNewQueryWrapper.lambda().eq(MessageTemplateConfigEntity::getMessageSource, MessageTemplateConfigPagination.getMessageSource()); + } + //状态 + if (ObjectUtil.isNotEmpty(MessageTemplateConfigPagination.getEnabledMark())) { + messageTemplateNewNum++; + int enabledMark = Integer.parseInt(MessageTemplateConfigPagination.getEnabledMark()); + messageTemplateNewQueryWrapper.lambda().eq(MessageTemplateConfigEntity::getEnabledMark, enabledMark); + } + + //排序 + if (StringUtil.isEmpty(MessageTemplateConfigPagination.getSidx())) { + messageTemplateNewQueryWrapper.lambda().orderByAsc(MessageTemplateConfigEntity::getSortCode).orderByDesc(MessageTemplateConfigEntity::getCreatorTime).orderByDesc(MessageTemplateConfigEntity::getLastModifyTime); + } else { + try { + String sidx = MessageTemplateConfigPagination.getSidx(); + MessageTemplateConfigEntity MessageTemplateConfigEntity = new MessageTemplateConfigEntity(); + Field declaredField = MessageTemplateConfigEntity.getClass().getDeclaredField(sidx); + declaredField.setAccessible(true); + String value = declaredField.getAnnotation(TableField.class).value(); + messageTemplateNewQueryWrapper = "asc".equals(MessageTemplateConfigPagination.getSort().toLowerCase()) ? messageTemplateNewQueryWrapper.orderByAsc(value) : messageTemplateNewQueryWrapper.orderByDesc(value); + } catch (NoSuchFieldException e) { + e.printStackTrace(); + } + } + if (!"1".equals(dataType)) { + if (total > 0|| total == 0) { + Page page = new Page<>(MessageTemplateConfigPagination.getCurrentPage(), MessageTemplateConfigPagination.getPageSize()); + IPage userIPage = this.page(page, messageTemplateNewQueryWrapper); + return MessageTemplateConfigPagination.setData(userIPage.getRecords(), userIPage.getTotal()); + } else { + List list = new ArrayList(); + return MessageTemplateConfigPagination.setData(list, list.size()); + } + } else { + return this.list(messageTemplateNewQueryWrapper); + } + } + + + @Override + public MessageTemplateConfigEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(MessageTemplateConfigEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public MessageTemplateConfigEntity getInfoByEnCode(String enCode,String messageType) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(MessageTemplateConfigEntity::getEnCode, enCode); + queryWrapper.lambda().eq(MessageTemplateConfigEntity::getMessageType, messageType); + return this.getOne(queryWrapper); + } + + @Override + public void create(MessageTemplateConfigEntity entity) { + this.save(entity); + } + + @Override + public boolean update(String id, MessageTemplateConfigEntity entity) { + entity.setId(id); + return this.updateById(entity); + } + + @Override + public void delete(MessageTemplateConfigEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } + + //子表方法 + @Override + public List getTemplateParamList(String id, MessageTemplateConfigPagination MessageTemplateConfigPagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(TemplateParamEntity::getTemplateId, id); + return templateParamService.list(templateParamService.getChild(MessageTemplateConfigPagination, queryWrapper)); + } + + @Override + public List getTemplateParamList(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(TemplateParamEntity::getTemplateId, id); + return templateParamService.list(queryWrapper); + } + + @Override + public List getSmsFieldList(String id, MessageTemplateConfigPagination MessageTemplateConfigPagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SmsFieldEntity::getTemplateId, id); + return smsFieldService.list(smsFieldService.getChild(MessageTemplateConfigPagination, queryWrapper)); + } + + @Override + public List getSmsFieldList(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SmsFieldEntity::getTemplateId, id); + return smsFieldService.list(queryWrapper); + } + + + //验证表单唯一字段 + @Override + public boolean checkForm(MessageTemplateConfigForm form, int i,String id) { + int total = 0; + if (ObjectUtil.isNotEmpty(form.getEnCode())) { + QueryWrapper codeWrapper = new QueryWrapper<>(); + codeWrapper.lambda().eq(MessageTemplateConfigEntity::getEnCode, form.getEnCode()); + if(StringUtil.isNotBlank(id) && !"null".equals(id)) { + codeWrapper.lambda().ne(MessageTemplateConfigEntity::getId, id); + } + if ((int) this.count(codeWrapper) > i) { + total++; + } + } + if (form.getTemplateParamList() != null) { + } + if (form.getSmsFieldList() != null) { + } + if (total > 0) { + return true; + } + return false; + } + + @Override + public boolean isExistByFullName(String fullName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(MessageTemplateConfigEntity::getFullName, fullName); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(MessageTemplateConfigEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public boolean isExistByEnCode(String enCode, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(MessageTemplateConfigEntity::getEnCode, enCode); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(MessageTemplateConfigEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public ActionResult ImportData(MessageTemplateConfigEntity entity) throws DataException { + if (entity != null) { +// if (isExistByFullName(entity.getFullName(), null)) { +// return ActionResult.fail(MsgCode.EXIST001.get()); +// } + if (isExistByEnCode(entity.getEnCode(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + try { + this.save(entity); + } catch (Exception e) { + throw new DataException(MsgCode.IMP003.get()); + } + return ActionResult.success(MsgCode.IMP001.get()); + } + return ActionResult.fail("导入数据格式不正确"); + } + + + @Override + public List getParamJson(String id) { + MessageTemplateConfigEntity entity = getInfo(id); + List paramModelList = new ArrayList<>(); + List smsField = new ArrayList<>(); + List paramList = new ArrayList<>(); + if (entity != null) { + if ("3".equals(entity.getMessageType()) || "7".equals(entity.getMessageType())) { + List smsFieldList = smsFieldService.getDetailListByParentId(id); + for (SmsFieldEntity entity1 : smsFieldList) { + if(!"@flowLink".equals(entity1.getField())) { + smsField.add(entity1.getField()); + } + } + List paramFieldList = templateParamService.getDetailListByParentId(id); + for (TemplateParamEntity entity1 : paramFieldList) { + if (smsField.contains(entity1.getField())) { + TemplateParamModel paramModel = new TemplateParamModel(); + paramModel.setTemplateId(entity.getId()); + paramModel.setTemplateCode(entity.getEnCode()); + paramModel.setTemplateType(entity.getTemplateType()); + paramModel.setField(entity1.getField()); + paramModel.setFieldName(entity1.getFieldName()); + paramModel.setId(entity1.getId()); + paramModel.setTemplateName(entity.getFullName()); + paramModelList.add(paramModel); + } + } + } else { + String content = StringUtil.isNotEmpty(entity.getContent()) ? entity.getContent() : ""; + String title = StringUtil.isNotEmpty(entity.getTitle()) ? entity.getTitle() : ""; + Set list = new HashSet<>(); + list.addAll(regexContent(content)); + list.addAll(regexContent(title)); + List paramFieldList = templateParamService.getDetailListByParentId(id); + for (TemplateParamEntity entity1 : paramFieldList) { + TemplateParamModel paramModel = new TemplateParamModel(); + paramModel.setTemplateId(entity.getId()); + paramModel.setTemplateCode(entity.getEnCode()); + paramModel.setTemplateType(entity.getTemplateType()); + paramModel.setField(entity1.getField()); + paramModel.setFieldName(entity1.getFieldName()); + paramModel.setId(entity1.getId()); + paramModel.setTemplateName(entity.getFullName()); + if(list.contains(entity1.getField())){ + if (!"@FlowLink".equals(entity1.getField())) { + paramModelList.add(paramModel); + } + } + } + } + } + //将参数模板转为json格式数据 +// String data = JsonUtil.getObjectToString(paramModelList); + return paramModelList; + } + + //获取消息内容参数 + public List regexContent(String content) { + List list = new ArrayList<>(); + String pattern = "[{]([^}]+)[}]"; + Pattern patternList = Pattern.compile(pattern); + Matcher m = patternList.matcher(content); + while (m.find()) { + String group = m.group().replaceAll("\\{", "").replaceAll("}", ""); + list.add(group); + } + return list; + } + + /** + * 高级查询 + * + * @param conditionModel + * @param entity + * @param num + * @return + */ + public Integer getCondition(SuperQueryConditionModel conditionModel, Object entity, int num) { + QueryWrapper queryWrapper = conditionModel.getObj(); + List queryConditionModels = conditionModel.getConditionList(); + String op = conditionModel.getMatchLogic(); + String tableName = conditionModel.getTableName(); + List useCondition = new ArrayList<>(); + for (ConditionJsonModel queryConditionModel : queryConditionModels) { + if (queryConditionModel.getTableName().equalsIgnoreCase(tableName)) { + if (queryConditionModel.getField().contains("jnpf")) { + String child = queryConditionModel.getField(); + String s1 = child.substring(child.lastIndexOf("jnpf_")).replace("jnpf_", ""); + queryConditionModel.setField(s1); + } + if (queryConditionModel.getField().toLowerCase().startsWith(JnpfKeyConsts.CHILD_TABLE_PREFIX)) { + String child = queryConditionModel.getField(); + String s1 = child.substring(child.indexOf("-") + 1); + queryConditionModel.setField(s1); + } + useCondition.add(queryConditionModel); + } + } + + if (queryConditionModels.size() < 1 || useCondition.size() < 1) { + return num; + } + if (useCondition.size() > 0) { + num += 1; + } + //处理控件 转换为有效值 + for (ConditionJsonModel queryConditionModel : useCondition) { + String jnpfKey = queryConditionModel.getJnpfKey(); + String fieldValue = queryConditionModel.getFieldValue(); + if (jnpfKey.equals(JnpfKeyConsts.DATE)) { + Long o1 = Long.valueOf(fieldValue); + String startTime = DateUtil.daFormat(o1); + queryConditionModel.setFieldValue(startTime); + } else if (jnpfKey.equals(JnpfKeyConsts.CREATETIME) || jnpfKey.equals(JnpfKeyConsts.MODIFYTIME)) { + Long o1 = Long.valueOf(fieldValue); + String startTime = DateUtil.daFormatHHMMSS(o1); + queryConditionModel.setFieldValue(startTime); + } else if (jnpfKey.equals(JnpfKeyConsts.CURRORGANIZE)) { + List orgList = JsonUtil.getJsonToList(fieldValue, String.class); + queryConditionModel.setFieldValue(orgList.get(orgList.size() - 1)); + } + } + //反射获取数据库实际字段 + Class aClass = entity.getClass(); + + queryWrapper.and(tw -> { + for (ConditionJsonModel conditionJsonModel : useCondition) { + String conditionField = conditionJsonModel.getField(); + Field declaredField = null; + try { + declaredField = aClass.getDeclaredField(conditionField); + } catch (NoSuchFieldException e) { + e.printStackTrace(); + } + declaredField.setAccessible(true); + String field = declaredField.getAnnotation(TableField.class).value(); + String fieldValue = conditionJsonModel.getFieldValue(); + String symbol = conditionJsonModel.getSymbol(); + if ("AND".equalsIgnoreCase(op)) { + if (symbol.equals("==")) { + tw.eq(field, fieldValue); + } else if (symbol.equals(">=")) { + tw.ge(field, fieldValue); + } else if (symbol.equals("<=")) { + tw.le(field, fieldValue); + tw.and( + qw -> qw.ne(field, "") + ); + } else if (symbol.equals(">")) { + tw.gt(field, fieldValue); + } else if (symbol.equals("<")) { + tw.lt(field, fieldValue); + tw.and( + qw -> qw.ne(field, "") + ); + } else if (symbol.equals("<>")) { + tw.ne(field, fieldValue); + if (StringUtil.isNotEmpty(fieldValue)) { + tw.or( + qw -> qw.isNull(field) + ); + } + } else if (symbol.equals("like")) { + if (StringUtil.isNotEmpty(fieldValue)) { + tw.like(field, fieldValue); + } else { + tw.isNull(field); + } + } else if (symbol.equals("notLike")) { + if (StringUtil.isNotEmpty(fieldValue)) { + tw.notLike(field, fieldValue); + tw.or( + qw -> qw.isNull(field) + ); + } else { + tw.isNotNull(field); + } + } + } else { + if (symbol.equals("==")) { + tw.or( + qw -> qw.eq(field, fieldValue) + ); + } else if (symbol.equals(">=")) { + tw.or( + qw -> qw.ge(field, fieldValue) + ); + } else if (symbol.equals("<=")) { + tw.or( + qw -> qw.le(field, fieldValue) + ); + } else if (symbol.equals(">")) { + tw.or( + qw -> qw.gt(field, fieldValue) + ); + } else if (symbol.equals("<")) { + tw.or( + qw -> qw.lt(field, fieldValue) + ); + } else if (symbol.equals("<>")) { + tw.or( + qw -> qw.ne(field, fieldValue) + ); + if (StringUtil.isNotEmpty(fieldValue)) { + tw.or( + qw -> qw.isNull(field) + ); + } + } else if (symbol.equals("like")) { + if (StringUtil.isNotEmpty(fieldValue)) { + tw.or( + qw -> qw.like(field, fieldValue) + ); + } else { + tw.or( + qw -> qw.isNull(field) + ); + } + } else if (symbol.equals("notLike")) { + if (StringUtil.isNotEmpty(fieldValue)) { + tw.or( + qw -> qw.notLike(field, fieldValue) + ); + tw.or( + qw -> qw.isNull(field) + ); + } else { + tw.or( + qw -> qw.isNotNull(field) + ); + } + } + } + } + }); + return num; + } + + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/MessagereceiveServiceImpl.java b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/MessagereceiveServiceImpl.java new file mode 100644 index 0000000..a0259e0 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/MessagereceiveServiceImpl.java @@ -0,0 +1,22 @@ +package jnpf.message.service.impl; + + +import jnpf.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import jnpf.message.entity.MessageReceiveEntity; +import jnpf.message.mapper.MessagereceiveMapper; +import jnpf.message.service.MessagereceiveService; +import org.springframework.stereotype.Service; + +/** + * 消息接收 服务实现类 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Service +public class MessagereceiveServiceImpl extends SuperServiceImpl implements MessagereceiveService { + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/SendConfigTemplateServiceImpl.java b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/SendConfigTemplateServiceImpl.java new file mode 100644 index 0000000..633aebd --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/SendConfigTemplateServiceImpl.java @@ -0,0 +1,88 @@ +package jnpf.message.service.impl; + +import jnpf.base.service.SuperServiceImpl; +import jnpf.message.entity.SendConfigTemplateEntity; +import jnpf.message.mapper.SendConfigTemplateMapper; +import jnpf.message.model.sendmessageconfig.SendMessageConfigPagination; +import jnpf.message.service.SendConfigTemplateService; +import jnpf.permission.service.AuthorizeService; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; + +import jnpf.util.*; + +import java.util.List; + +/** + * 消息发送配置 + * 版本: V3.2.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2022-08-19 + */ +@Service +public class SendConfigTemplateServiceImpl extends SuperServiceImpl implements SendConfigTemplateService { + + + @Autowired + private UserProvider userProvider; + + @Autowired + private AuthorizeService authorizeService; + + @Override + public QueryWrapper getChild(SendMessageConfigPagination pagination, QueryWrapper sendConfigTemplateQueryWrapper) { +// boolean pcPermission = false; +// boolean appPermission = false; +// boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc"); +// if (isPc) { +// } + + return sendConfigTemplateQueryWrapper; + } + + @Override + public SendConfigTemplateEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SendConfigTemplateEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public List getDetailListByParentId(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SendConfigTemplateEntity::getSendConfigId, id); + return this.list(queryWrapper); + } + + @Override + public List getConfigTemplateListByConfigId(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SendConfigTemplateEntity::getSendConfigId, id); + queryWrapper.lambda().eq(SendConfigTemplateEntity::getEnabledMark, 1); + return this.list(queryWrapper); + } + + @Override + public boolean isUsedAccount(String accountId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SendConfigTemplateEntity::getAccountConfigId, accountId); + if (this.list(queryWrapper) != null && this.list(queryWrapper).size() > 0) { + return true; + } else { + return false; + } + } + + @Override + public boolean isUsedTemplate(String templateId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SendConfigTemplateEntity::getTemplateId, templateId); + if (this.list(queryWrapper) != null && this.list(queryWrapper).size() > 0) { + return true; + } else { + return false; + } + } +} \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/SendMessageConfigServiceImpl.java b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/SendMessageConfigServiceImpl.java new file mode 100644 index 0000000..bdba03b --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/SendMessageConfigServiceImpl.java @@ -0,0 +1,336 @@ +package jnpf.message.service.impl; + +import jnpf.base.service.SuperServiceImpl; +import jnpf.base.ActionResult; +import jnpf.base.UserInfo; +import jnpf.constant.MsgCode; + +import jnpf.exception.DataException; +import jnpf.message.entity.SendConfigTemplateEntity; +import jnpf.message.entity.SendMessageConfigEntity; +import jnpf.message.mapper.SendMessageConfigMapper; +import jnpf.message.model.sendmessageconfig.*; +import jnpf.message.service.SendConfigTemplateService; +import jnpf.message.service.SendMessageConfigService; +import jnpf.util.RandomUtil; + +import cn.hutool.core.util.ObjectUtil; + +import java.lang.reflect.Field; + +import com.baomidou.mybatisplus.annotation.TableField; + +import java.util.stream.Collectors; + + +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springframework.beans.factory.annotation.Autowired; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; + +import jnpf.util.*; + +import java.util.*; + +/** + * 消息发送配置 + * 版本: V3.2.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2022-08-19 + */ +@Service +public class SendMessageConfigServiceImpl extends SuperServiceImpl implements SendMessageConfigService { + + + + @Autowired + private UserProvider userProvider; + + + @Autowired + private SendConfigTemplateService sendConfigTemplateService; + + @Override + public List getList(SendMessageConfigPagination sendMessageConfigPagination, String dataType) { + String userId = userProvider.get().getUserId(); + int total = 0; + int sendMessageConfigNum = 0; + QueryWrapper sendMessageConfigQueryWrapper = new QueryWrapper<>(); + int sendConfigTemplateNum = 0; + QueryWrapper sendConfigTemplateQueryWrapper = new QueryWrapper<>(); + //关键字 + if (ObjectUtil.isNotEmpty(sendMessageConfigPagination.getKeyword())) { + sendMessageConfigNum++; + sendMessageConfigQueryWrapper.lambda().and(t -> t.like(SendMessageConfigEntity::getEnCode, sendMessageConfigPagination.getKeyword()). + or().like(SendMessageConfigEntity::getFullName, sendMessageConfigPagination.getKeyword())); + } + //模板类型 + if (ObjectUtil.isNotEmpty(sendMessageConfigPagination.getTemplateType())) { + sendMessageConfigNum++; + sendMessageConfigQueryWrapper.lambda().eq(SendMessageConfigEntity::getTemplateType, sendMessageConfigPagination.getTemplateType()); + } + //状态 + if (ObjectUtil.isNotEmpty(sendMessageConfigPagination.getEnabledMark())) { + sendMessageConfigNum++; + int enabledMark = Integer.parseInt(sendMessageConfigPagination.getEnabledMark()); + sendMessageConfigQueryWrapper.lambda().eq(SendMessageConfigEntity::getEnabledMark, enabledMark); + } + //消息来源 + if (ObjectUtil.isNotEmpty(sendMessageConfigPagination.getMessageSource())) { + sendMessageConfigNum++; + sendMessageConfigQueryWrapper.lambda().eq(SendMessageConfigEntity::getMessageSource, sendMessageConfigPagination.getMessageSource()); + } + + //排序 + if (StringUtil.isEmpty(sendMessageConfigPagination.getSidx())) { + sendMessageConfigQueryWrapper.lambda().orderByAsc(SendMessageConfigEntity::getSortCode).orderByDesc(SendMessageConfigEntity::getCreatorTime).orderByDesc(SendMessageConfigEntity::getLastModifyTime);; + } else { + try { + String sidx = sendMessageConfigPagination.getSidx(); + SendMessageConfigEntity sendMessageConfigEntity = new SendMessageConfigEntity(); + Field declaredField = sendMessageConfigEntity.getClass().getDeclaredField(sidx); + declaredField.setAccessible(true); + String value = declaredField.getAnnotation(TableField.class).value(); + sendMessageConfigQueryWrapper = "asc".equals(sendMessageConfigPagination.getSort().toLowerCase()) ? sendMessageConfigQueryWrapper.orderByAsc(value) : sendMessageConfigQueryWrapper.orderByDesc(value); + } catch (NoSuchFieldException e) { + e.printStackTrace(); + } + } + if (!"1".equals(dataType)) { + if (total > 0 || total == 0) { + Page page = new Page<>(sendMessageConfigPagination.getCurrentPage(), sendMessageConfigPagination.getPageSize()); + IPage userIPage = this.page(page, sendMessageConfigQueryWrapper); + return sendMessageConfigPagination.setData(userIPage.getRecords(), userIPage.getTotal()); + } else { + List list = new ArrayList(); + return sendMessageConfigPagination.setData(list, list.size()); + } + } else { + return this.list(sendMessageConfigQueryWrapper); + } + } + + @Override + public List getSelectorList(SendMessageConfigPagination sendMessageConfigPagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SendMessageConfigEntity::getMessageSource, 5).eq(SendMessageConfigEntity::getEnabledMark, 1); + queryWrapper.lambda().eq(SendMessageConfigEntity::getTemplateType, 0); + Page page = new Page<>(sendMessageConfigPagination.getCurrentPage(), sendMessageConfigPagination.getPageSize()); + IPage userIPage = this.page(page, queryWrapper); + return sendMessageConfigPagination.setData(userIPage.getRecords(), userIPage.getTotal()); + } + + + @Override + public SendMessageConfigEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SendMessageConfigEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public SendMessageConfigEntity getInfoByEnCode(String enCode){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SendMessageConfigEntity::getEnCode, enCode); + return this.getOne(queryWrapper); + } + + @Override + public SendMessageConfigEntity getSysConfig(String enCode,String type){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SendMessageConfigEntity::getTemplateType, type); + queryWrapper.lambda().eq(SendMessageConfigEntity::getEnCode,enCode); + return this.getOne(queryWrapper); + } + + @Override + public void create(SendMessageConfigEntity entity) { + this.save(entity); + } + + @Override + public boolean update(String id, SendMessageConfigEntity entity) { + entity.setId(id); + return this.updateById(entity); + } + + @Override + public void delete(SendMessageConfigEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } + + //子表方法 + @Override + public List getSendConfigTemplateList(String id, SendMessageConfigPagination sendMessageConfigPagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SendConfigTemplateEntity::getSendConfigId, id); + return sendConfigTemplateService.list(sendConfigTemplateService.getChild(sendMessageConfigPagination, queryWrapper)); + } + + @Override + public List getSendConfigTemplateList(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SendConfigTemplateEntity::getSendConfigId, id); + queryWrapper.lambda().orderByDesc(SendConfigTemplateEntity::getSortCode); + return sendConfigTemplateService.list(queryWrapper); + } + + //列表子表数据方法 + + + //验证表单唯一字段 + @Override + public boolean checkForm(SendMessageConfigForm form, int i,String id) { + int total = 0; + if (ObjectUtil.isNotEmpty(form.getEnCode())) { + QueryWrapper enCodeWrapper = new QueryWrapper<>(); + enCodeWrapper.lambda().eq(SendMessageConfigEntity::getEnCode, form.getEnCode()); + if(StringUtil.isNotBlank(id) && !"null".equals(id)) { + enCodeWrapper.lambda().ne(SendMessageConfigEntity::getId, id); + } + if ((int) this.count(enCodeWrapper) > i) { + total++; + } + } + if (form.getSendConfigTemplateList() != null) { + } + if (total > 0) { + return true; + } + return false; + } + + @Override + public boolean isExistByFullName(String fullName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SendMessageConfigEntity::getFullName, fullName); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(SendMessageConfigEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public boolean isExistByEnCode(String enCode, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SendMessageConfigEntity::getEnCode, enCode); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(SendMessageConfigEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public ActionResult ImportData(SendMessageConfigEntity entity) throws DataException { + if (entity != null) { +// if (isExistByFullName(entity.getFullName(), null)) { +// return ActionResult.fail(MsgCode.EXIST001.get()); +// } + if (isExistByEnCode(entity.getEnCode(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + try { + this.save(entity); + } catch (Exception e) { + throw new DataException(MsgCode.IMP003.get()); + } + return ActionResult.success(MsgCode.IMP001.get()); + } + return ActionResult.fail("导入数据格式不正确"); + } + @Override + public List getList(List idList){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(SendMessageConfigEntity::getId,idList); + return this.list(queryWrapper); + } + + + public List getIdList(String usedId){ + List idList = new ArrayList<>(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + if(this.list(queryWrapper) != null && this.list(queryWrapper).size()>0){ + idList = this.list(queryWrapper).stream().distinct().map(t->t.getId()).collect(Collectors.toList()); + } + return idList; + } + + @Override + public void updateUsed(String id,List sendConfigIdList){ + UserInfo userInfo = userProvider.get(); + List oldSendConfigList = this.getIdList(id); + if(oldSendConfigList != null && oldSendConfigList.size()>0){ + List subSendConfigIdList = this.subList(oldSendConfigList,sendConfigIdList); + this.removeUsed(id,subSendConfigIdList); + } + if(sendConfigIdList != null && sendConfigIdList.size()>0) { + List sendConfigList = this.getList(sendConfigIdList); + if (sendConfigIdList != null && sendConfigIdList.size() > 0) { +// for (SendMessageConfigEntity entity : sendConfigList) { +// SendConfigRecordEntity recordEntity = new SendConfigRecordEntity(); +// recordEntity = sendConfigRecordService.getRecord(entity.getId(),id); +// if(recordEntity != null){ +// recordEntity.setLastModifyTime(DateUtil.getNowDate()); +// recordEntity.setLastModifyUserId(userInfo.getUserId()); +// sendConfigRecordService.update(recordEntity.getId(),recordEntity); +// }else { +// recordEntity = new SendConfigRecordEntity(); +// recordEntity.setId(RandomUtil.uuId()); +// recordEntity.setSendConfigId(entity.getId()); +// recordEntity.setMessageSource(entity.getMessageSource()); +// recordEntity.setUsedId(id); +// recordEntity.setCreatorTime(DateUtil.getNowDate()); +// recordEntity.setCreatorUserId(userInfo.getUserId()); +// sendConfigRecordService.create(recordEntity); +// } +// } + this.updateBatchById(sendConfigList); + } + } + } + + @Override + public void removeUsed(String id,List sendConfigIdList){ + if(sendConfigIdList != null && sendConfigIdList.size()>0){ + List subConfigList = this.getList(sendConfigIdList); +// if(subConfigList != null && subConfigList.size()>0){ +// for(SendMessageConfigEntity subEntity : subConfigList) { +// SendConfigRecordEntity recordEntity = sendConfigRecordService.getRecord(subEntity.getId(),id); +// if(recordEntity != null){ +// sendConfigRecordService.delete(recordEntity); +// } +// } +// } + this.updateBatchById(subConfigList); + } + } + + @Override + public List subList(List list1, List list2) { + //空间换时间 降低时间复杂度 + Map tempMap = new HashMap<>(); + for(String str:list2){ + tempMap.put(str,str); + } + //LinkedList 频繁添加删除 也可以ArrayList容量初始化为List1.size(),防止数据量过大时频繁扩容以及数组复制 + List resList = new LinkedList<>(); + for(String str:list1){ + if(!tempMap.containsKey(str)){ + resList.add(str); + } + } + return resList; + } + @Override + public boolean idUsed(String id){ + boolean flag = false; + SendMessageConfigEntity entity = this.getInfo(id); + // TODO 删除逻辑重新设置 + return flag; + } + +} \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/ShortLinkServiceImpl.java b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/ShortLinkServiceImpl.java new file mode 100644 index 0000000..7fd8a74 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/ShortLinkServiceImpl.java @@ -0,0 +1,135 @@ +package jnpf.message.service.impl; + +import jnpf.base.service.SuperServiceImpl; +import jnpf.message.entity.ShortLinkEntity; +import jnpf.message.mapper.ShortLInkMapper; +import jnpf.message.service.ShortLinkService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + + +import jnpf.permission.service.AuthorizeService; + + +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; + +import jnpf.util.*; + +import java.security.MessageDigest; +import java.util.*; + +/** + * 消息模板(新) + * 版本: V3.2.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2022-08-18 + */ +@Service +public class ShortLinkServiceImpl extends SuperServiceImpl implements ShortLinkService { + + + + @Autowired + private UserProvider userProvider; + + @Autowired + private AuthorizeService authorizeService; + + @Override + public ShortLinkEntity getInfoByLink(String link){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ShortLinkEntity::getShortLink,link); + return this.getOne(queryWrapper); + } + + + @Override + public String shortLink (String link){ + String shortUrl = null; + if(StringUtil.isNotBlank(link)) { + String[] aResult = shortUrl(link);//将产生4组6位字符串 + // 打印出结果 + Random random = new Random(); + int j = random.nextInt(4);//产成4以内随机数 + shortUrl = aResult[j]; + if(StringUtil.isNotBlank(shortUrl)) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(shortUrl)) { + queryWrapper.lambda().eq(ShortLinkEntity::getShortLink, shortUrl); + } + if (this.list(queryWrapper) != null && this.list(queryWrapper).size() > 0) { + shortUrl = shortUrl + j; + } + } + } + return shortUrl; + } + + + public static String[] shortUrl(String url) { + // 可以自定义生成 MD5 加密字符传前的混合 KEY + String key = "test"; + // 要使用生成 URL 的字符 + String[] chars = new String[] { "a", "b", "c", "d", "e", "f", "g", "h", + "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", + "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", + "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", + "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", + "U", "V", "W", "X", "Y", "Z" + + }; + // 对传入网址进行 MD5 加密 + String hex = md5ByHex(key + url); + + String[] resUrl = new String[4]; + for (int i = 0; i < 4; i++) { + + // 把加密字符按照 8 位一组 16 进制与 0x3FFFFFFF 进行位与运算 + String sTempSubString = hex.substring(i * 8, i * 8 + 8); + + // 这里需要使用 long 型来转换,因为 Inteper .parseInt() 只能处理 31 位 , 首位为符号位 , 如果不用long ,则会越界 + long lHexLong = 0x3FFFFFFF & Long.parseLong(sTempSubString, 16); + String outChars = ""; + for (int j = 0; j < 6; j++) { + // 把得到的值与 0x0000003D 进行位与运算,取得字符数组 chars 索引 + long index = 0x0000003D & lHexLong; + // 把取得的字符相加 + outChars += chars[(int) index]; + // 每次循环按位右移 5 位 + lHexLong = lHexLong >> 5; + } + // 把字符串存入对应索引的输出数组 + resUrl[i] = outChars; + } + return resUrl; + } + /** + * MD5加密(32位大写) + * @param src + * @return + */ + public static String md5ByHex(String src) { + try { + MessageDigest md = MessageDigest.getInstance("MD5"); + byte[] b = src.getBytes(); + md.reset(); + md.update(b); + byte[] hash = md.digest(); + String hs = ""; + String stmp = ""; + for (int i = 0; i < hash.length; i++) { + stmp = Integer.toHexString(hash[i] & 0xFF); + if (stmp.length() == 1) + hs = hs + "0" + stmp; + else { + hs = hs + stmp; + } + } + return hs.toUpperCase(); + } catch (Exception e) { + return ""; + } + } +} \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/SmsFieldServiceImpl.java b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/SmsFieldServiceImpl.java new file mode 100644 index 0000000..52ddfe7 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/SmsFieldServiceImpl.java @@ -0,0 +1,95 @@ +package jnpf.message.service.impl; + +import jnpf.base.service.SuperServiceImpl; +import jnpf.message.entity.SmsFieldEntity; +import jnpf.message.mapper.SmsFieldMapper; +import jnpf.message.model.messagetemplateconfig.MessageTemplateConfigPagination; +import jnpf.message.service.SmsFieldService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + + +import jnpf.permission.service.AuthorizeService; + + +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; + +import jnpf.util.*; + +import java.util.*; + +/** + * 消息模板(新) + * 版本: V3.2.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2022-08-18 + */ +@Service +public class SmsFieldServiceImpl extends SuperServiceImpl implements SmsFieldService { + + + + @Autowired + private UserProvider userProvider; + + @Autowired + private AuthorizeService authorizeService; + + @Override + public QueryWrapper getChild(MessageTemplateConfigPagination pagination, QueryWrapper smsFieldQueryWrapper) { +// boolean pcPermission = false; +// boolean appPermission = false; +// boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc"); +// if (isPc) { +// } + + return smsFieldQueryWrapper; + } + @Override + public SmsFieldEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SmsFieldEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public List getDetailListByParentId(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SmsFieldEntity::getTemplateId, id); + return this.list(queryWrapper); + } + + @Override + public List getParamList(String id,List params) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SmsFieldEntity::getTemplateId, id); + queryWrapper.lambda().in(SmsFieldEntity::getField,params); + return this.list(queryWrapper); + } + + @Override + public Map getParamMap(String templateId,Map map) { + Map paramMap = new HashMap<>(); + List list = this.getDetailListByParentId(templateId); + if (list != null && list.size() > 0) { + for (SmsFieldEntity entity : list) { + if (map.containsKey(entity.getField())) { + for (String key : map.keySet()) { + if (key.equals(entity.getField())) { + paramMap.put(entity.getSmsField(), map.get(key)); + if(StringUtil.isNotEmpty(String.valueOf(entity.getIsTitle())) &&!"null".equals(String.valueOf(entity.getIsTitle())) && entity.getIsTitle()==1){ + paramMap.put("title",map.get(key)); + } + } + } + if(entity.getField().equals("@FlowLink")){ + paramMap.put(entity.getSmsField(),"@FlowLink"); + } + } + } + } + return paramMap; + } +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/SynThirdDingTalkServiceImpl.java b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/SynThirdDingTalkServiceImpl.java new file mode 100644 index 0000000..3dda3d5 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/SynThirdDingTalkServiceImpl.java @@ -0,0 +1,3347 @@ +package jnpf.message.service.impl; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.dingtalk.api.response.OapiV2UserListResponse; +import jnpf.base.UserInfo; +import jnpf.base.entity.SysConfigEntity; +import jnpf.base.service.SysconfigService; +import jnpf.base.util.RegexUtils; +import jnpf.message.entity.SynThirdInfoEntity; +import jnpf.message.model.message.DingTalkDeptModel; +import jnpf.message.model.message.DingTalkUserModel; +import jnpf.message.service.SynThirdDingTalkService; +import jnpf.message.service.SynThirdInfoService; +import jnpf.base.util.SynDingTalkUtil; +import jnpf.message.util.SynThirdConsts; +import jnpf.model.BaseSystemInfo; +import jnpf.permission.entity.OrganizeEntity; +import jnpf.permission.entity.PositionEntity; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.entity.UserRelationEntity; +import jnpf.permission.service.OrganizeService; +import jnpf.permission.service.PositionService; +import jnpf.permission.service.UserRelationService; +import jnpf.permission.service.UserService; +import jnpf.util.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.util.Assert; + +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 本系统的公司-部门-用户同步到钉钉的功能代码 + * + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021/5/7 8:42 + */ +@Component +public class SynThirdDingTalkServiceImpl implements SynThirdDingTalkService { + @Autowired + private UserProvider userProvider; + @Autowired + private PositionService positionService; + @Autowired + private SysconfigService sysconfigService; + @Autowired + private SynThirdInfoService synThirdInfoService; + @Autowired + private OrganizeService organizeService; + @Autowired + private UserService userService; + + @Autowired + private UserRelationService userRelationService; + + /** + * 获取钉钉的配置信息 + * @return + */ + @Override + public BaseSystemInfo getDingTalkConfig() { + Map objModel = new HashMap<>(); + List configList = sysconfigService.getList("SysConfig"); + for (SysConfigEntity entity : configList) { + objModel.put(entity.getFkey(), entity.getValue()); + } + BaseSystemInfo baseSystemInfo = JsonUtil.getJsonToBean(objModel, BaseSystemInfo.class); + return baseSystemInfo; + } + + //------------------------------------本系统同步公司、部门到钉钉------------------------------------- + + /** + * 根据部门的同步表信息判断同步情况 + * 带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param synThirdInfoEntity + * @param dingDeptList + * @return + */ +// public JSONObject checkDepartmentSysToDing(SynThirdInfoEntity synThirdInfoEntity, List dingDeptList) { +// JSONObject retMsg = new JSONObject(); +// retMsg.put("code",true); +// retMsg.put("flag",""); +// retMsg.put("error",""); +// +// if(synThirdInfoEntity!=null){ +// if(StringUtil.isNotEmpty(synThirdInfoEntity.getThirdObjId())) { +// // 同步表存在钉钉ID,仍需要判断钉钉上有没此部门 +// if(dingDeptList.stream().filter(t -> t.getDeptId().toString().equals(synThirdInfoEntity.getThirdObjId())).count() == 0 ? true : false){ +// retMsg.put("code",false); +// retMsg.put("flag","1"); +// retMsg.put("error","钉钉不存在同步表对应的部门ID!"); +// } +// }else{ +// // 同步表的钉钉ID为空 +// retMsg.put("code",false); +// retMsg.put("flag","2"); +// retMsg.put("error","同步表中部门对应的钉钉ID为空!"); +// } +// }else{ +// // 上级部门未同步 +// retMsg.put("code",false); +// retMsg.put("flag","3"); +// retMsg.put("error","部门未同步到钉钉!"); +// } +// +// return retMsg; +// } + + + /** + * 根据部门的同步表信息判断同步情况 + * 不带错第三方误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param synThirdInfoEntity + * @return + */ + public JSONObject checkDepartmentSysToDing(SynThirdInfoEntity synThirdInfoEntity) { + JSONObject retMsg = new JSONObject(); + retMsg.put("code",true); + retMsg.put("flag",""); + retMsg.put("error",""); + + if(synThirdInfoEntity!=null){ + if("".equals(String.valueOf(synThirdInfoEntity.getThirdObjId())) || "null".equals(String.valueOf(synThirdInfoEntity.getThirdObjId()))) { + // 同步表的钉钉ID为空 + retMsg.put("code",false); + retMsg.put("flag","2"); + retMsg.put("error","同步表中部门对应的钉钉ID为空!"); + } + }else{ + // 上级部门未同步 + retMsg.put("code",false); + retMsg.put("flag","3"); + retMsg.put("error","部门未同步到钉钉!"); + } + + return retMsg; + } + + public JSONObject checkDepartmentSysToDing2(List objectIdList) { + JSONObject retMsg = new JSONObject(); + List thirdIdList = new ArrayList<>(); + retMsg.put("code",true); + retMsg.put("error",""); + + for(String objectId: objectIdList){ + SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_ORG,objectId); + if(synThirdInfoEntity!=null){ + if("".equals(String.valueOf(synThirdInfoEntity.getThirdObjId())) || "null".equals(String.valueOf(synThirdInfoEntity.getThirdObjId()))) { + // 同步表的钉钉ID为空 + retMsg.put("code",false); + retMsg.put("flag","2"); + retMsg.put("error","同步表中部门对应的钉钉ID为空!"); + return retMsg; + } + }else{ + // 上级部门未同步 + retMsg.put("code",false); + retMsg.put("flag","3"); + retMsg.put("error","部门未同步到钉钉!"); + return retMsg; + } + thirdIdList.add(synThirdInfoEntity.getThirdObjId()); + } + retMsg.put("flag",thirdIdList.stream().collect(Collectors.joining(","))); + return retMsg; + } + + + /** + * 检查部门名称不能含有特殊字符 + * @param deptName + * @param opType + * @param synThirdInfoEntity + * @param thirdType + * @param dataType + * @param sysObjId + * @param thirdObjId + * @param deptFlag + * @return + */ + public JSONObject checkDeptName(String deptName, String opType, SynThirdInfoEntity synThirdInfoEntity, Integer thirdType, + Integer dataType, String sysObjId, String thirdObjId, String deptFlag){ + JSONObject retMsg = new JSONObject(); + retMsg.put("code",true); + retMsg.put("error",""); + if(deptName.indexOf("-")>-1 || deptName.indexOf(",")>-1 || deptName.indexOf(",")>-1){ + // 同步失败 + Integer synState = SynThirdConsts.SYN_STATE_FAIL; + String description = deptFlag + "部门名称不能含有,、,、-三种特殊字符"; + + // 更新同步表 + saveSynThirdInfoEntity(opType,synThirdInfoEntity,thirdType,dataType,sysObjId,thirdObjId,synState,description); + + retMsg.put("code", false); + retMsg.put("error", description); + } + return retMsg; + } + + + /** + * 将组织、用户的信息写入同步表 + * @param opType "add":创建 “upd”:修改 + * @param synThirdInfoEntity 本地同步表信息 + * @param thirdType 第三方类型 + * @param dataType 数据类型 + * @param sysObjId 本地对象ID + * @param thirdObjId 第三方对象ID + * @param synState 同步状态(0:未同步;1:同步成功;2:同步失败) + * @param description + */ + public void saveSynThirdInfoEntity(String opType, SynThirdInfoEntity synThirdInfoEntity, Integer thirdType, + Integer dataType, String sysObjId, String thirdObjId, Integer synState, + String description) { + UserInfo userInfo = userProvider.get(); + SynThirdInfoEntity entity = new SynThirdInfoEntity(); + String compValue = SynThirdConsts.OBJECT_OP_ADD; + if(compValue.equals(opType)) { + entity.setId(RandomUtil.uuId()); + entity.setThirdType(thirdType); + entity.setDataType(dataType); + entity.setSysObjId(sysObjId); + entity.setThirdObjId(thirdObjId); + entity.setEnabledMark(synState); + // 备注当作同步失败信息来用 + entity.setDescription(description); + entity.setCreatorUserId(userInfo.getUserId()); + entity.setCreatorTime(DateUtil.getNowDate()); + entity.setLastModifyUserId(userInfo.getUserId()); + // 修改时间当作最后同步时间来用 + entity.setLastModifyTime(DateUtil.getNowDate()); + synThirdInfoService.create(entity); + }else{ + entity = synThirdInfoEntity; + entity.setThirdType(thirdType); + entity.setDataType(dataType); + entity.setThirdObjId(thirdObjId); + entity.setEnabledMark(synState); + // 备注当作同步失败信息来用 + entity.setDescription(description); + entity.setLastModifyUserId(userInfo.getUserId()); + // 修改时间当作最后同步时间来用 + entity.setLastModifyTime(DateUtil.getNowDate()); + synThirdInfoService.update(entity.getId(), entity); + } + } + + + /** + * 往钉钉创建组织-部门 + * 带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @param dingDeptListPara 单条执行时为null + * @return + */ +// @Override +// public JSONObject createDepartmentSysToDing(boolean isBatch, OrganizeEntity deptEntity, List dingDeptListPara) { +// BaseSystemInfo config = getDingTalkConfig(); +// String corpId = config.getDingSynAppKey(); +// String corpSecret = config.getDingSynAppSecret(); +// String compValue = SynThirdConsts.OBJECT_TYPE_COMPANY; +// // 单条记录执行时,受开关限制 +// int dingIsSyn = isBatch ? 1 : config.getDingSynIsSynOrg(); +// JSONObject tokenObject = new JSONObject(); +// String access_token = ""; +// JSONObject retMsg = new JSONObject(); +// DingTalkDeptModel deptModel = new DingTalkDeptModel(); +// List dingDeptList = new ArrayList<>(); +// String thirdObjId = ""; +// Integer synState = 0; +// String description = ""; +// boolean isDeptDiff = true; +// String deptFlag = "创建:"; +// +// // 返回值初始化 +// retMsg.put("code", true); +// retMsg.put("error", "创建:系统未设置单条同步"); +// +// // 支持同步 +// if(dingIsSyn==1){ +// // 获取 access_token 值 +// tokenObject = SynDingTalkUtil.getAccessToken(corpId, corpSecret); +// access_token = tokenObject.getString("access_token"); +// +// if (access_token != null && !"".equals(access_token)) { +// // 获取钉钉上的所有部门列表信息 +// if(isBatch){ +// dingDeptList = dingDeptListPara; +// }else { +// JSONObject deptObject = SynDingTalkUtil.getDepartmentList(SynThirdConsts.DING_ROOT_DEPT_ID, access_token); +// if (deptObject.getBoolean("code")) { +// dingDeptList = JsonUtil.getJsonToList(deptObject.getObject("department", List.class), DingTalkDeptModel.class); +// } else { +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = deptFlag + "获取钉钉的部门列表信息失败"; +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// +// // 更新同步表 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_ADD, null, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG), deptEntity.getId(), thirdObjId, synState, description); +// +// return retMsg; +// } +// } +// +// deptModel.setDeptId(null); +// deptModel.setName(deptEntity.getFullName()); +// // 从本地数据库的同步表获取对应的钉钉ID,为空报异常,不为空再验证所获取接口部门列表是否当前ID 未处理 +// if(compValue.equals(deptEntity.getCategory()) && "-1".equals(deptEntity.getParentId())){ +// //顶级节点时,钉钉的父节点设置为1 +// deptModel.setParentId(SynThirdConsts.DING_ROOT_DEPT_ID); +// }else{ +// SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_ORG,deptEntity.getParentId()); +// +// retMsg = checkDepartmentSysToDing(synThirdInfoEntity,dingDeptList); +// isDeptDiff = retMsg.getBoolean("code"); +// if(isDeptDiff) { +// deptModel.setParentId(Long.parseLong(synThirdInfoEntity.getThirdObjId())); +// } +// } +// deptModel.setOrder(deptEntity.getSortCode()); +// deptModel.setCreateDeptGroup(false); +// +// // 创建时:部门名称不能带有特殊字符 +// retMsg = checkDeptName(deptEntity.getFullName(),SynThirdConsts.OBJECT_OP_ADD,null, +// Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING),Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// if(isDeptDiff) { +// if(dingIsSyn==1) { +// // 往钉钉写入公司或部门 +// retMsg = SynDingTalkUtil.createDepartment(deptModel, access_token); +// +// // 往同步写入本系统与第三方的对应信息 +// if (retMsg.getBoolean("code")) { +// // 同步成功 +// thirdObjId = retMsg.getString("retDeptId"); +// retMsg.put("retDeptId", thirdObjId); +// synState = SynThirdConsts.SYN_STATE_OK; +// } else { +// // 同步失败 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = deptFlag + retMsg.getString("error"); +// } +// }else{ +// // 未设置单条同步,归并到未同步状态 +// // 未同步 +// synState = SynThirdConsts.SYN_STATE_NO; +// description = deptFlag + "系统未设置单条同步"; +// +// retMsg.put("code", true); +// retMsg.put("error", description); +// retMsg.put("retDeptId", "0"); +// } +// }else{ +// // 同步失败,上级部门无对应的钉钉ID +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = deptFlag + "部门所属的上级部门未同步到钉钉"; +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// retMsg.put("retDeptId", "0"); +// } +// +// }else{ +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = deptFlag + "access_token值为空,不能同步信息"; +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// retMsg.put("retDeptId", "0"); +// } +// +// } +// +// // 更新同步表 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_ADD,null,Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,synState,description); +// +// return retMsg; +// } + + + /** + * 往钉钉更新组织-部门 + * 带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @param dingDeptListPara 单条执行时为null + * @return + */ +// @Override +// public JSONObject updateDepartmentSysToDing(boolean isBatch, OrganizeEntity deptEntity, List dingDeptListPara) { +// BaseSystemInfo config = getDingTalkConfig(); +// String corpId = config.getDingSynAppKey(); +// String corpSecret = config.getDingSynAppSecret(); +// String compValue = SynThirdConsts.OBJECT_TYPE_COMPANY; +// // 单条记录执行时,受开关限制 +// int dingIsSyn = isBatch ? 1 : config.getDingSynIsSynOrg(); +// JSONObject tokenObject = new JSONObject(); +// String access_token = ""; +// JSONObject retMsg = new JSONObject(); +// DingTalkDeptModel deptModel = new DingTalkDeptModel(); +// List dingDeptList = new ArrayList<>(); +// SynThirdInfoEntity synThirdInfoEntity = new SynThirdInfoEntity(); +// String opType = ""; +// Integer synState = 0; +// String description = ""; +// String thirdObjId = ""; +// SynThirdInfoEntity synThirdInfoPara = new SynThirdInfoEntity(); +// boolean isDeptDiff = true; +// String deptFlag = "更新:"; +// +// // 返回值初始化 +// retMsg.put("code", true); +// retMsg.put("error", "系统未设置单条同步"); +// +// // 支持同步,设置需要同步到钉钉的对象属性值 +// if(dingIsSyn==1) { +// // 获取 access_token +// tokenObject = SynDingTalkUtil.getAccessToken(corpId, corpSecret); +// access_token = tokenObject.getString("access_token"); +// +// // 获取同步表信息 +// synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_ORG,deptEntity.getId()); +// +// if (access_token != null && !"".equals(access_token)) { +// // 获取钉钉上的所有部门列表信息 +// if(isBatch){ +// dingDeptList = dingDeptListPara; +// }else { +// JSONObject deptObject = SynDingTalkUtil.getDepartmentList(SynThirdConsts.DING_ROOT_DEPT_ID, access_token); +// if (deptObject.getBoolean("code")) { +// dingDeptList = JsonUtil.getJsonToList(deptObject.getObject("department", List.class), DingTalkDeptModel.class); +// } else { +// if (synThirdInfoEntity != null) { +// // 修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// } else { +// // 写入同步表 +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// } +// +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = deptFlag + "获取钉钉的部门列表信息失败"; +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// +// // 更新同步表 +// saveSynThirdInfoEntity(opType, synThirdInfoPara, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG), deptEntity.getId(), thirdObjId, synState, description); +// +// return retMsg; +// } +// } +// +// deptModel.setDeptId(null); +// deptModel.setName(deptEntity.getFullName()); +// // 从本地数据库的同步表获取对应的钉钉ID,为空报异常,不为空再验证所获取接口部门列表是否当前ID 未处理 +// if(compValue.equals(deptEntity.getCategory()) && "-1".equals(deptEntity.getParentId())){ +// //顶级节点时,钉钉的父节点设置为1 +// deptModel.setParentId(SynThirdConsts.DING_ROOT_DEPT_ID); +// } else { +// // 判断上级部门的合法性 +// synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_ORG,deptEntity.getParentId()); +// retMsg = checkDepartmentSysToDing(synThirdInfoEntity, dingDeptList); +// isDeptDiff = retMsg.getBoolean("code"); +// if (isDeptDiff) { +// deptModel.setParentId(Long.parseLong(synThirdInfoEntity.getThirdObjId())); +// } +// } +// deptModel.setOrder(deptEntity.getSortCode()); +// +// // 上级部门检查是否异常 +// if(isDeptDiff){ +// // 获取同步表信息 +// synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_ORG,deptEntity.getId()); +// +// // 判断当前部门对应的第三方的合法性 +// retMsg = checkDepartmentSysToDing(synThirdInfoEntity, dingDeptList); +// if (!retMsg.getBoolean("code")) { +// if ("3".equals(retMsg.getString("flag")) || "1".equals(retMsg.getString("flag"))) { +// // flag:3 未同步,需要创建同步到钉钉、写入同步表 +// // flag:1 已同步但第三方上没对应的ID,需要删除原来的同步信息,再创建同步到钉钉、写入同步表 +// if("1".equals(retMsg.getString("flag"))) { +// synThirdInfoService.delete(synThirdInfoEntity); +// } +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// +// // 创建时:部门名称不能带有特殊字符 +// retMsg = checkDeptName(deptEntity.getFullName(), +// opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 往钉钉写入公司或部门 +// retMsg = SynDingTalkUtil.createDepartment(deptModel, access_token); +// +// // 往同步写入本系统与第三方的对应信息 +// if(retMsg.getBoolean("code")) { +// // 同步成功 +// thirdObjId = retMsg.getString("retDeptId"); +// retMsg.put("retDeptId", thirdObjId); +// synState = SynThirdConsts.SYN_STATE_OK; +// description = ""; +// }else{ +// // 同步失败 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = deptFlag + retMsg.getString("error"); +// } +// } +// +// if ("2".equals(retMsg.getString("flag"))) { +// // flag:2 已同步但第三方ID为空,需要创建同步到钉钉、修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = ""; +// +// // 创建时:部门名称不能带有特殊字符 +// retMsg = checkDeptName(deptEntity.getFullName(), +// opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 往钉钉写入公司或部门 +// retMsg = SynDingTalkUtil.createDepartment(deptModel, access_token); +// +// // 往同步表更新本系统与第三方的对应信息 +// if (retMsg.getBoolean("code")) { +// // 同步成功 +// thirdObjId = retMsg.getString("retDeptId"); +// retMsg.put("retDeptId", thirdObjId); +// synState = SynThirdConsts.SYN_STATE_OK; +// description = ""; +// } else { +// // 同步失败 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = deptFlag + retMsg.getString("error"); +// } +// } +// +// } else { +// // 更新同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// +// // 部门名称不能带有特殊字符 +// retMsg = checkDeptName(deptEntity.getFullName(), +// opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 往钉钉写入公司或部门 +// deptModel.setDeptId(Long.parseLong(synThirdInfoEntity.getThirdObjId())); +// +// // 设置部门主管:只有在更新时才可以执行 +// // 初始化时:组织同步=>用户同步=>组织同步(用来更新部门主管的) +// if(StringUtil.isNotEmpty(deptEntity.getManager())){ +// SynThirdInfoEntity userThirdInfo = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_USER,deptEntity.getManager()); +// if(userThirdInfo!=null){ +// if(StringUtil.isNotEmpty(userThirdInfo.getThirdObjId())) { +// deptModel.setDeptManagerUseridList(userThirdInfo.getThirdObjId()); +// } +// } +// } +// +// retMsg = SynDingTalkUtil.updateDepartment(deptModel, access_token); +// +// // 往同步表更新本系统与第三方的对应信息 +// if (retMsg.getBoolean("code")) { +// // 同步成功 +// synState = SynThirdConsts.SYN_STATE_OK; +// description = ""; +// } else { +// // 同步失败 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = deptFlag + retMsg.getString("error"); +// } +// } +// }else{ +// // 同步失败,上级部门检查有异常 +// if(synThirdInfoEntity!=null){ +// // 修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// }else{ +// // 写入同步表 +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// } +// +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = deptFlag + "上级部门无对应的钉钉ID"; +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// } +// +// }else{ +// // 同步失败 +// if(synThirdInfoEntity!=null){ +// // 修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// }else{ +// // 写入同步表 +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// } +// +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = deptFlag + "access_token值为空,不能同步信息"; +// +// retMsg.put("code", true); +// retMsg.put("error", description); +// } +// +// }else{ +// // 未设置单条同步,归并到未同步状态 +// // 获取同步表信息 +// synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_ORG,deptEntity.getId()); +// if(synThirdInfoEntity!=null){ +// // 修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// }else{ +// // 写入同步表 +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// } +// +// synState = SynThirdConsts.SYN_STATE_NO; +// description = deptFlag + "系统未设置单条同步"; +// +// retMsg.put("code", true); +// retMsg.put("error", description); +// } +// +// // 更新同步表 +// saveSynThirdInfoEntity(opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,synState,description); +// +// return retMsg; +// } + + + /** + * 往钉钉删除组织-部门 + * 带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param id 本系统的公司或部门ID + * @param dingDeptListPara 单条执行时为null + * @return + */ +// @Override +// public JSONObject deleteDepartmentSysToDing(boolean isBatch, String id, List dingDeptListPara) { +// BaseSystemInfo config = getDingTalkConfig(); +// String corpId = config.getDingSynAppKey(); +// String corpSecret = config.getDingSynAppSecret(); +// // 单条记录执行时,受开关限制 +// int dingIsSyn = isBatch ? 1 : config.getDingSynIsSynOrg(); +// JSONObject tokenObject = new JSONObject(); +// String access_token = ""; +// JSONObject retMsg = new JSONObject(); +// List dingDeptList = new ArrayList<>(); +// SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_ORG,id); +// String deptFlag = "删除:"; +// +// // 返回值初始化 +// retMsg.put("code", true); +// retMsg.put("error", "系统未设置单条同步"); +// +// // 支持同步 +// if(synThirdInfoEntity!=null) { +// if(dingIsSyn==1){ +// // 获取 access_token +// tokenObject = SynDingTalkUtil.getAccessToken(corpId, corpSecret); +// access_token = tokenObject.getString("access_token"); +// +// if (access_token != null && !"".equals(access_token)) { +// // 获取钉钉上的所有部门列表信息 +// if(isBatch){ +// dingDeptList = dingDeptListPara; +// }else{ +// JSONObject deptObject = SynDingTalkUtil.getDepartmentList(SynThirdConsts.DING_ROOT_DEPT_ID,access_token); +// if(deptObject.getBoolean("code")) { +// dingDeptList = JsonUtil.getJsonToList(deptObject.getObject("department", List.class), DingTalkDeptModel.class); +// }else{ +// // 同步失败,获取部门列表失败 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_FAIL, deptFlag + "获取企业微信的部门列表信息失败"); +// +// retMsg.put("code", false); +// retMsg.put("error", deptFlag + "获取钉钉的部门列表信息失败"); +// return retMsg; +// } +// } +// +// // 删除钉钉对应的部门 +// if (dingDeptList.stream().filter(t -> t.getDeptId().toString().equals(synThirdInfoEntity.getThirdObjId())).count() > 0 ? true : false) { +// retMsg = SynDingTalkUtil.deleteDepartment(Long.parseLong(synThirdInfoEntity.getThirdObjId()), access_token); +// if (retMsg.getBoolean("code")) { +// // 同步成功,直接删除同步表记录 +// synThirdInfoService.delete(synThirdInfoEntity); +// } else { +// // 同步失败 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_FAIL, deptFlag + retMsg.getString("error")); +// } +// }else{ +// // 根据钉钉ID找不到相应的信息,直接删除同步表记录 +// synThirdInfoService.delete(synThirdInfoEntity); +// } +// }else{ +// // 同步失败 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_FAIL, deptFlag + "access_token值为空,不能同步信息"); +// +// retMsg.put("code", false); +// retMsg.put("error", deptFlag + "access_token值为空,不能同步信息!"); +// } +// +// }else{ +// // 未设置单条同步,归并到未同步状态 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_NO, deptFlag + "系统未设置单条同步"); +// +// retMsg.put("code", true); +// retMsg.put("error", deptFlag + "系统未设置单条同步"); +// } +// } +// +// return retMsg; +// } + + + /** + * 往钉钉创建组织-部门 + * 不带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @param accessToken (单条调用时为空) + * @return + */ + @Override + public JSONObject createDepartmentSysToDing(boolean isBatch, OrganizeEntity deptEntity,String accessToken) { + BaseSystemInfo config = getDingTalkConfig(); + String corpId = config.getDingSynAppKey(); + String corpSecret = config.getDingSynAppSecret(); + String compValue = SynThirdConsts.OBJECT_TYPE_COMPANY; + // 单条记录执行时,受开关限制 + int dingIsSyn = isBatch ? 1 : config.getDingSynIsSynOrg(); + JSONObject tokenObject = new JSONObject(); + String access_token = ""; + JSONObject retMsg = new JSONObject(); + DingTalkDeptModel deptModel = new DingTalkDeptModel(); + String thirdObjId = ""; + Integer synState = 0; + String description = ""; + boolean isDeptDiff = true; + String deptFlag = "创建:"; + + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", "创建:系统未设置单条同步"); + + // 支持同步 + if(isBatch || dingIsSyn==1){ + // 获取 access_token 值 + if(isBatch) { + access_token = accessToken; + }else{ + List synThirdInfoList = synThirdInfoService.syncThirdInfoByType(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_ORG, SynThirdConsts.THIRD_TYPE_DING_To_Sys); + tokenObject = SynDingTalkUtil.getAccessToken(corpId, corpSecret); + access_token = tokenObject.getString("access_token"); + } + + if (access_token != null && !"".equals(access_token)) { + deptModel.setDeptId(null); + deptModel.setName(deptEntity.getFullName()); + // 从本地数据库的同步表获取对应的钉钉ID,为空报异常,不为空再验证所获取接口部门列表是否当前ID 未处理 + if(compValue.equals(deptEntity.getCategory()) && "-1".equals(deptEntity.getParentId())){ + //顶级节点时,钉钉的父节点设置为1 + deptModel.setParentId(SynThirdConsts.DING_ROOT_DEPT_ID); + }else{ + SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_ORG,deptEntity.getParentId()); + + retMsg = checkDepartmentSysToDing(synThirdInfoEntity); + isDeptDiff = retMsg.getBoolean("code"); + if(isDeptDiff) { + deptModel.setParentId(Long.parseLong(synThirdInfoEntity.getThirdObjId())); + } + } + deptModel.setOrder(deptEntity.getSortCode()); + deptModel.setCreateDeptGroup(false); + if("company".equals(deptEntity.getCategory())){ + deptModel.setSourceIdentifier("company"); + }else{ + deptModel.setSourceIdentifier("department"); + } + + + // 创建时:部门名称不能带有特殊字符 + retMsg = checkDeptName(deptEntity.getFullName(),SynThirdConsts.OBJECT_OP_ADD,null, + Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING),Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); + if (!retMsg.getBoolean("code")) { + return retMsg; + } + + if(isDeptDiff) { + if(isBatch || dingIsSyn==1) { + // 往钉钉写入公司或部门 + if(!"-1".equals(deptEntity.getParentId())){ + retMsg = SynDingTalkUtil.createDepartment(deptModel, access_token); + }else{ + retMsg.put("code", true); + retMsg.put("error", "顶级不同步,默认值id1"); + retMsg.put("retDeptId", "1"); + } + + // 往同步写入本系统与第三方的对应信息 + if (retMsg.getBoolean("code")) { + // 同步成功 + thirdObjId = retMsg.getString("retDeptId"); + retMsg.put("retDeptId", thirdObjId); + synState = SynThirdConsts.SYN_STATE_OK; + } else { + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + retMsg.getString("error"); + } + }else{ + // 未设置单条同步,归并到未同步状态 + // 未同步 + synState = SynThirdConsts.SYN_STATE_NO; + description = deptFlag + "系统未设置单条同步"; + + retMsg.put("code", true); + retMsg.put("error", description); + retMsg.put("retDeptId", "0"); + } + }else{ + // 同步失败,上级部门无对应的钉钉ID + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + "部门所属的上级部门未同步到钉钉"; + + retMsg.put("code", false); + retMsg.put("error", description); + retMsg.put("retDeptId", "0"); + } + + }else{ + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + "access_token值为空,不能同步信息"; + + retMsg.put("code", false); + retMsg.put("error", description); + retMsg.put("retDeptId", "0"); + } + + } + + // 更新同步表 + saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_ADD,null,Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), + Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,synState,description); + + return retMsg; + } + + + /** + * 往钉钉更新组织-部门 + * 不带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @param accessToken (单条调用时为空) + * @return + */ + @Override + public JSONObject updateDepartmentSysToDing(boolean isBatch, OrganizeEntity deptEntity,String accessToken) { + BaseSystemInfo config = getDingTalkConfig(); + String corpId = config.getDingSynAppKey(); + String corpSecret = config.getDingSynAppSecret(); + String compValue = SynThirdConsts.OBJECT_TYPE_COMPANY; + // 单条记录执行时,受开关限制 + int dingIsSyn = isBatch ? 1 : config.getDingSynIsSynOrg(); + JSONObject tokenObject = new JSONObject(); + String access_token = ""; + JSONObject retMsg = new JSONObject(); + DingTalkDeptModel deptModel = new DingTalkDeptModel(); + SynThirdInfoEntity synThirdInfoEntity = new SynThirdInfoEntity(); + String opType = ""; + Integer synState = 0; + String description = ""; + String thirdObjId = ""; + SynThirdInfoEntity synThirdInfoPara = new SynThirdInfoEntity(); + boolean isDeptDiff = true; + String deptFlag = "更新:"; + + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", "系统未设置单条同步"); + + // 支持同步,设置需要同步到钉钉的对象属性值 + if(isBatch || dingIsSyn==1) { + // 获取 access_token + if(isBatch) { + access_token = accessToken; + }else{ + List synThirdInfoList = synThirdInfoService.syncThirdInfoByType(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_ORG, SynThirdConsts.THIRD_TYPE_DING_To_Sys); + tokenObject = SynDingTalkUtil.getAccessToken(corpId, corpSecret); + access_token = tokenObject.getString("access_token"); + } + + // 获取同步表信息 + synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_ORG,deptEntity.getId()); + + if (access_token != null && !"".equals(access_token)) { + deptModel.setDeptId(null); + deptModel.setName(deptEntity.getFullName()); + // 从本地数据库的同步表获取对应的钉钉ID,为空报异常,不为空再验证所获取接口部门列表是否当前ID 未处理 + if(compValue.equals(deptEntity.getCategory()) && "-1".equals(deptEntity.getParentId())){ + //顶级节点时,钉钉的父节点设置为1 + deptModel.setParentId(SynThirdConsts.DING_ROOT_DEPT_ID); + } else { + // 判断上级部门的合法性 + synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_ORG,deptEntity.getParentId()); + + retMsg = checkDepartmentSysToDing(synThirdInfoEntity); + isDeptDiff = retMsg.getBoolean("code"); + if (isDeptDiff) { + deptModel.setParentId(Long.parseLong(synThirdInfoEntity.getThirdObjId())); + } + } + deptModel.setOrder(deptEntity.getSortCode()); + + // 上级部门检查是否异常 + if(isDeptDiff){ + // 获取同步表信息 + synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_ORG,deptEntity.getId()); + + // 判断当前部门对应的第三方的合法性 + retMsg = checkDepartmentSysToDing(synThirdInfoEntity); + if (!retMsg.getBoolean("code")) { + if ("3".equals(retMsg.getString("flag")) || "1".equals(retMsg.getString("flag"))) { + // flag:3 未同步,需要创建同步到钉钉、写入同步表 + // flag:1 已同步但第三方上没对应的ID,需要删除原来的同步信息,再创建同步到钉钉、写入同步表 + if("1".equals(retMsg.getString("flag"))) { + synThirdInfoService.delete(synThirdInfoEntity); + } + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + thirdObjId = ""; + + // 创建时:部门名称不能带有特殊字符 + retMsg = checkDeptName(deptEntity.getFullName(), + opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), + Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); + if (!retMsg.getBoolean("code")) { + return retMsg; + } + + if("company".equals(deptEntity.getCategory())){ + deptModel.setSourceIdentifier("company"); + }else{ + deptModel.setSourceIdentifier("department"); + } + // 往钉钉写入公司或部门 + if(!"-1".equals(deptEntity.getParentId())){ + retMsg = SynDingTalkUtil.createDepartment(deptModel, access_token); + }else{ + retMsg.put("code", true); + retMsg.put("error", "顶级不同步,默认值id1"); + retMsg.put("retDeptId", "1"); + } + + // 往同步写入本系统与第三方的对应信息 + if(retMsg.getBoolean("code")) { + // 同步成功 + thirdObjId = retMsg.getString("retDeptId"); + retMsg.put("retDeptId", thirdObjId); + synState = SynThirdConsts.SYN_STATE_OK; + description = ""; + }else{ + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + retMsg.getString("error"); + } + } + + if ("2".equals(retMsg.getString("flag"))) { + // flag:2 已同步但第三方ID为空,需要创建同步到钉钉、修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = ""; + + // 创建时:部门名称不能带有特殊字符 + retMsg = checkDeptName(deptEntity.getFullName(), + opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), + Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); + if (!retMsg.getBoolean("code")) { + return retMsg; + } + + if("company".equals(deptEntity.getCategory())){ + deptModel.setSourceIdentifier("company"); + }else{ + deptModel.setSourceIdentifier("department"); + } + // 往钉钉写入公司或部门 + if(!"-1".equals(deptEntity.getParentId())){ + retMsg = SynDingTalkUtil.createDepartment(deptModel, access_token); + }else{ + retMsg.put("code", true); + retMsg.put("error", "顶级不同步,默认值id1"); + retMsg.put("retDeptId", "1"); + } + + // 往同步表更新本系统与第三方的对应信息 + if (retMsg.getBoolean("code")) { + // 同步成功 + thirdObjId = retMsg.getString("retDeptId"); + retMsg.put("retDeptId", thirdObjId); + synState = SynThirdConsts.SYN_STATE_OK; + description = ""; + } else { + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + retMsg.getString("error"); + } + } + + } else { + // 更新同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + + // 部门名称不能带有特殊字符 + retMsg = checkDeptName(deptEntity.getFullName(), + opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), + Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); + if (!retMsg.getBoolean("code")) { + return retMsg; + } + + // 往钉钉写入公司或部门 + deptModel.setDeptId(Long.parseLong(synThirdInfoEntity.getThirdObjId())); + + // 设置部门主管:只有在更新时才可以执行 + // 初始化时:组织同步=>用户同步=>组织同步(用来更新部门主管的) + if(StringUtil.isNotEmpty(deptEntity.getManagerId())){ + SynThirdInfoEntity userThirdInfo = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_USER,deptEntity.getManagerId()); + if(userThirdInfo!=null){ + if(StringUtil.isNotEmpty(userThirdInfo.getThirdObjId())) { + deptModel.setDeptManagerUseridList(userThirdInfo.getThirdObjId()); + } + } + } + + retMsg = SynDingTalkUtil.updateDepartment(deptModel, access_token); + + // 往同步表更新本系统与第三方的对应信息 + if (retMsg.getBoolean("code")) { + // 同步成功 + synState = SynThirdConsts.SYN_STATE_OK; + description = ""; + } else { + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + retMsg.getString("error"); + } + } + }else{ + // 同步失败,上级部门检查有异常 + if(synThirdInfoEntity!=null){ + // 修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + }else{ + // 写入同步表 + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + thirdObjId = ""; + } + + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + "上级部门无对应的钉钉ID"; + + retMsg.put("code", false); + retMsg.put("error", description); + } + + }else{ + // 同步失败 + if(synThirdInfoEntity!=null){ + // 修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + }else{ + // 写入同步表 + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + thirdObjId = ""; + } + + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + "access_token值为空,不能同步信息"; + + retMsg.put("code", true); + retMsg.put("error", description); + } + + }else{ + // 未设置单条同步,归并到未同步状态 + // 获取同步表信息 + synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_ORG,deptEntity.getId()); + if(synThirdInfoEntity!=null){ + // 修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + }else{ + // 写入同步表 + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + thirdObjId = ""; + } + + synState = SynThirdConsts.SYN_STATE_NO; + description = deptFlag + "系统未设置单条同步"; + + retMsg.put("code", true); + retMsg.put("error", description); + } + + // 更新同步表 + saveSynThirdInfoEntity(opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), + Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,synState,description); + + return retMsg; + } + + + /** + * 往钉钉删除组织-部门 + * 不带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param id 本系统的公司或部门ID + * @param accessToken (单条调用时为空) + * @return + */ + @Override + public JSONObject deleteDepartmentSysToDing(boolean isBatch, String id,String accessToken) { + BaseSystemInfo config = getDingTalkConfig(); + String corpId = config.getDingSynAppKey(); + String corpSecret = config.getDingSynAppSecret(); + // 单条记录执行时,受开关限制 + int dingIsSyn = isBatch ? 1 : config.getDingSynIsSynOrg(); + JSONObject tokenObject = new JSONObject(); + String access_token = ""; + JSONObject retMsg = new JSONObject(); + SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_ORG,id); + String deptFlag = "删除:"; + + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", "系统未设置单条同步"); + + // 支持同步 + if(synThirdInfoEntity!=null) { + if(isBatch || dingIsSyn==1){ + // 获取 access_token + if(isBatch) { + access_token = accessToken; + }else{ + List synThirdInfoList = synThirdInfoService.syncThirdInfoByType(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_ORG, SynThirdConsts.THIRD_TYPE_DING_To_Sys); + tokenObject = SynDingTalkUtil.getAccessToken(corpId, corpSecret); + access_token = tokenObject.getString("access_token"); + } + + if (access_token != null && !"".equals(access_token)) { + // 删除钉钉对应的部门 + if (!"".equals(String.valueOf(synThirdInfoEntity.getThirdObjId())) && !"null".equals(String.valueOf(synThirdInfoEntity.getThirdObjId()))) { + retMsg = SynDingTalkUtil.deleteDepartment(Long.parseLong(synThirdInfoEntity.getThirdObjId()), access_token); + if (retMsg.getBoolean("code")) { + // 同步成功,直接删除同步表记录 + synThirdInfoService.delete(synThirdInfoEntity); + } else { + // 同步失败 + saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), + Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_FAIL, deptFlag + retMsg.getString("error")); + } + }else{ + // 根据钉钉ID找不到相应的信息,直接删除同步表记录 + synThirdInfoService.delete(synThirdInfoEntity); + } + }else{ + // 同步失败 + saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), + Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_FAIL, deptFlag + "access_token值为空,不能同步信息"); + + retMsg.put("code", false); + retMsg.put("error", deptFlag + "access_token值为空,不能同步信息!"); + } + + }else{ + // 未设置单条同步,归并到未同步状态 + saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), + Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_NO, deptFlag + "系统未设置单条同步"); + + retMsg.put("code", true); + retMsg.put("error", deptFlag + "系统未设置单条同步"); + } + } + + return retMsg; + } + + + + + + //------------------------------------钉钉同步公司、部门到本系统20220330------------------------------------- + + + /** + * 根据部门的同步表信息判断同步情况 + * 不带错第三方误定位判断的功能代码,只获取调用接口的返回信息 20220331 + * @param synThirdInfoEntity + * @return + */ + public JSONObject checkDepartmentDingToSys(SynThirdInfoEntity synThirdInfoEntity) { + JSONObject retMsg = new JSONObject(); + retMsg.put("code",true); + retMsg.put("flag",""); + retMsg.put("error",""); + + if(synThirdInfoEntity!=null){ + if("".equals(String.valueOf(synThirdInfoEntity.getSysObjId())) || "null".equals(String.valueOf(synThirdInfoEntity.getSysObjId()))) { + // 同步表的钉钉ID为空 + retMsg.put("code",false); + retMsg.put("flag","2"); + retMsg.put("error","同步表中部门对应的本地ID为空!"); + } + }else{ + // 上级部门未同步 + retMsg.put("code",false); + retMsg.put("flag","3"); + retMsg.put("error","部门未同步到本地!"); + } + + return retMsg; + } + + + /** + * 往本地创建组织-部门 + * 钉钉同步单个公司或部门到本地(供调用) + * 不带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @param accessToken (单条调用时为空) + * @return + */ + @Override + public JSONObject createDepartmentDingToSys(boolean isBatch, DingTalkDeptModel deptEntity,String accessToken) { + BaseSystemInfo config = getDingTalkConfig(); + // 单条记录执行时,受开关限制 + int dingIsSyn = isBatch ? 1 : config.getDingSynIsSynOrg(); + + Long dingDeptId = deptEntity.getDeptId(); + String dingDeptName = deptEntity.getName(); + Long dingParentId = deptEntity.getParentId(); + + Integer synState = 0; + String deptFlag = "创建:"; + String description = ""; + + JSONObject retMsg = new JSONObject(); + boolean isDeptDiff = true; + String sysParentId = ""; + String sysObjId = ""; + + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", "创建:系统未设置单条同步"); + + // 支持同步 + if(isBatch || dingIsSyn==1){ + boolean tag = false; + if(dingDeptId==1L){ + tag=true; + } + SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoByThirdObjId(SynThirdConsts.THIRD_TYPE_DING_To_Sys,SynThirdConsts.DATA_TYPE_ORG,dingParentId+""); + + + retMsg = checkDepartmentDingToSys(synThirdInfoEntity); + isDeptDiff = retMsg.getBoolean("code"); + if(isDeptDiff || tag) { + sysParentId = tag==true?" -1" : synThirdInfoEntity.getSysObjId(); + + if(isBatch || dingIsSyn==1) { + // 新增保存组织 + OrganizeEntity newOrg = new OrganizeEntity(); + sysObjId = RandomUtil.uuId(); + newOrg.setId(sysObjId); + if(!"1".equals(dingDeptId+"") ){ +// newOrg.setCategory(SynThirdConsts.OBJECT_TYPE_COMPANY); +// newOrg.setParentId("-1"); +// newOrg.setOrganizeIdTree(sysObjId); + + Assert.notNull(sysParentId,"父级组织未同步"); + newOrg.setCategory(SynThirdConsts.OBJECT_TYPE_DEPARTMENT); + newOrg.setParentId(sysParentId); + // 通过组织id获取父级组织 + String organizeIdTree = organizeService.getOrganizeIdTree(newOrg); + newOrg.setOrganizeIdTree(organizeIdTree+","+sysObjId); + + newOrg.setEnCode(dingDeptId+""); + newOrg.setFullName(dingDeptName); + newOrg.setSortCode(deptEntity.getOrder()!=null?deptEntity.getOrder():1L); + newOrg.setCategory("company".equals(deptEntity.getSourceIdentifier())?"company":"department"); + organizeService.save(newOrg); + }else{ + sysObjId = organizeService.getOrganizeByParentId().get(0).getId(); + } + + // 中间表 + retMsg.put("retDeptId", sysObjId); + synState = SynThirdConsts.SYN_STATE_OK; + }else{ + // 未设置单条同步,归并到未同步状态 + // 未同步 + synState = SynThirdConsts.SYN_STATE_NO; + description = deptFlag + "系统未设置单条同步"; + + retMsg.put("code", true); + retMsg.put("error", description); + retMsg.put("retDeptId", "0"); + } + }else{ + // 同步失败,上级部门无对应的钉钉ID + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + "部门所属的上级部门未同步到本地"; + + retMsg.put("code", false); + retMsg.put("error", description); + retMsg.put("retDeptId", "0"); + } + } + + // 更新同步表 + saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_ADD,null,Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING_To_Sys), + Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),sysObjId,dingDeptId+"",synState,description); + + return retMsg; + } + + + /** + * 往钉钉更新组织-部门 + * 不带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @param accessToken (单条调用时为空) + * @return + */ + @Override + public JSONObject updateDepartmentDingToSys(boolean isBatch, DingTalkDeptModel deptEntity,String accessToken) { + BaseSystemInfo config = getDingTalkConfig(); +// String corpId = config.getDingSynAppKey(); +// String corpSecret = config.getDingSynAppSecret(); +// String compValue = SynThirdConsts.OBJECT_TYPE_COMPANY; + // 单条记录执行时,受开关限制 + int dingIsSyn = isBatch ? 1 : config.getDingSynIsSynOrg(); + +// JSONObject tokenObject = new JSONObject(); +// String access_token = ""; + JSONObject retMsg = new JSONObject(); + DingTalkDeptModel deptModel = new DingTalkDeptModel(); + SynThirdInfoEntity synThirdInfoEntity = new SynThirdInfoEntity(); + String opType = ""; + Integer synState = 0; + String description = ""; +// String thirdObjId = ""; + String sysObjId = ""; + String sysParentId = ""; + SynThirdInfoEntity synThirdInfoPara = new SynThirdInfoEntity(); + boolean isDeptDiff = true; + String deptFlag = "更新:"; + + Long dingDeptId = deptEntity.getDeptId(); + String dingDeptName = deptEntity.getName(); + Long dingParentId = deptEntity.getParentId(); + OrganizeEntity orgInfo = new OrganizeEntity(); + + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", "系统未设置单条同步"); + + if(isBatch || dingIsSyn==1) { + // 获取同步表信息 + synThirdInfoEntity = synThirdInfoService.getInfoByThirdObjId(SynThirdConsts.THIRD_TYPE_DING_To_Sys,SynThirdConsts.DATA_TYPE_ORG,dingParentId+""); + retMsg = checkDepartmentDingToSys(synThirdInfoEntity); + isDeptDiff = retMsg.getBoolean("code"); + if(isDeptDiff) { + sysParentId = synThirdInfoEntity.getSysObjId(); + // 获取同步表信息 + synThirdInfoEntity = synThirdInfoService.getInfoByThirdObjId(SynThirdConsts.THIRD_TYPE_DING_To_Sys,SynThirdConsts.DATA_TYPE_ORG,dingDeptId+""); + // 判断当前部门对应的第三方的合法性 + retMsg = checkDepartmentDingToSys(synThirdInfoEntity); + if (!retMsg.getBoolean("code")) { + if ("3".equals(retMsg.getString("flag")) || "1".equals(retMsg.getString("flag"))) { + // flag:3 未同步,需要创建同步到钉钉、写入同步表 + // flag:1 已同步但第三方上没对应的ID,需要删除原来的同步信息,再创建同步到钉钉、写入同步表 + if("1".equals(retMsg.getString("flag"))) { + synThirdInfoService.delete(synThirdInfoEntity); + } + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; +// thirdObjId = dingDeptId+""; + + // 新增保存组织 + orgInfo = new OrganizeEntity(); + sysObjId = RandomUtil.uuId(); + orgInfo.setId(sysObjId); + if(!"1".equals(dingDeptId+"") ){ +// newOrg.setCategory(SynThirdConsts.OBJECT_TYPE_COMPANY); +// newOrg.setParentId("-1"); +// newOrg.setOrganizeIdTree(sysObjId); + + orgInfo.setCategory(SynThirdConsts.OBJECT_TYPE_DEPARTMENT); + orgInfo.setParentId(sysParentId); + // 通过组织id获取父级组织 + String organizeIdTree = organizeService.getOrganizeIdTree(orgInfo); + orgInfo.setOrganizeIdTree(organizeIdTree+","+sysObjId); + + orgInfo.setEnCode(dingDeptId+""); + orgInfo.setFullName(dingDeptName); + orgInfo.setSortCode(deptEntity.getOrder()!=null?deptEntity.getOrder():1L); +// orgInfo.setCategory("company".equals(deptEntity.getSourceIdentifier())?"company":"department"); + organizeService.save(orgInfo); + }else{ + sysObjId = organizeService.getOrganizeByParentId().get(0).getId(); + } + + + // 同步成功 +// thirdObjId = retMsg.getString("retDeptId"); + retMsg.put("retDeptId", sysObjId); + synState = SynThirdConsts.SYN_STATE_OK; + description = ""; + + } + + if ("2".equals(retMsg.getString("flag"))) { + // flag:2 已同步但第三方ID为空,需要创建同步到钉钉、修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = dingDeptId+""; + + // 新增保存组织 + orgInfo = new OrganizeEntity(); + sysObjId = RandomUtil.uuId(); + orgInfo.setId(sysObjId); + if(!"1".equals(dingDeptId+"") ){ +// newOrg.setCategory(SynThirdConsts.OBJECT_TYPE_COMPANY); +// newOrg.setParentId("-1"); +// newOrg.setOrganizeIdTree(sysObjId); + + orgInfo.setCategory(SynThirdConsts.OBJECT_TYPE_DEPARTMENT); + orgInfo.setParentId(sysParentId); + // 通过组织id获取父级组织 + String organizeIdTree = organizeService.getOrganizeIdTree(orgInfo); + orgInfo.setOrganizeIdTree(organizeIdTree+","+sysObjId); + + orgInfo.setEnCode(dingDeptId+""); + orgInfo.setFullName(dingDeptName); + orgInfo.setSortCode(deptEntity.getOrder()!=null?deptEntity.getOrder():1L); +// orgInfo.setCategory("company".equals(deptEntity.getSourceIdentifier())?"company":"department"); + organizeService.save(orgInfo); + }else{ + sysObjId = organizeService.getOrganizeByParentId().get(0).getId(); + } + + + // 同步成功 + retMsg.put("retDeptId", sysObjId); + synState = SynThirdConsts.SYN_STATE_OK; + description = ""; + } + }else { + // 更新同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); + sysObjId = synThirdInfoEntity.getSysObjId(); + + orgInfo = organizeService.getInfo(sysObjId); + if(orgInfo!=null){ + orgInfo.setParentId(dingParentId+""); + orgInfo.setFullName(dingDeptName); + if(!"1".equals(dingDeptId+"")){ +// orgInfo.setCategory(SynThirdConsts.OBJECT_TYPE_COMPANY); +// orgInfo.setParentId("-1"); + +// orgInfo.setCategory(SynThirdConsts.OBJECT_TYPE_DEPARTMENT); + orgInfo.setParentId(sysParentId); + orgInfo.setOrganizeIdTree(orgInfo.getOrganizeIdTree().replace(","+orgInfo.getId(),"")); + organizeService.update(orgInfo.getId(),orgInfo); + } + + + // 同步成功 + synState = SynThirdConsts.SYN_STATE_OK; + description = ""; + }else{ + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + "未找到对应的部门"; + } + } + }else{ + synThirdInfoEntity = synThirdInfoService.getInfoByThirdObjId(SynThirdConsts.THIRD_TYPE_DING_To_Sys,SynThirdConsts.DATA_TYPE_ORG,dingDeptId+""); + // 同步失败,上级部门检查有异常 + if(synThirdInfoEntity!=null){ + // 修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + sysObjId = synThirdInfoEntity.getSysObjId(); + }else{ + // 写入同步表 + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + sysObjId = ""; + } + + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + "上级部门无对应的本地ID"; + + retMsg.put("code", false); + retMsg.put("error", description); + } + }else{ + // 未设置单条同步,归并到未同步状态 + // 获取同步表信息 + synThirdInfoEntity = synThirdInfoService.getInfoByThirdObjId(SynThirdConsts.THIRD_TYPE_DING_To_Sys,SynThirdConsts.DATA_TYPE_ORG,dingDeptId+""); + if(synThirdInfoEntity!=null){ + // 修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + sysObjId = synThirdInfoEntity.getSysObjId(); + }else{ + // 写入同步表 + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + sysObjId = ""; + } + + synState = SynThirdConsts.SYN_STATE_NO; + description = deptFlag + "系统未设置单条同步"; + + retMsg.put("code", true); + retMsg.put("error", description); + } + + // 更新同步表 + saveSynThirdInfoEntity(opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING_To_Sys), + Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),sysObjId,dingDeptId+"",synState,description); + + return retMsg; + } + + + /** + * 往钉钉删除组织-部门 + * 不带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param thirdObjId 钉钉的公司或部门ID + * @return + */ + @Override + public JSONObject deleteDepartmentDingToSys(boolean isBatch, String thirdObjId) { + BaseSystemInfo config = getDingTalkConfig(); + // 单条记录执行时,受开关限制 + int dingIsSyn = isBatch ? 1 : config.getDingSynIsSynOrg(); + String deptFlag = "删除:"; + JSONObject retMsg = new JSONObject(); + + // 获取当前第三方同步表对应记录 + SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoByThirdObjId(SynThirdConsts.THIRD_TYPE_DING_To_Sys,SynThirdConsts.DATA_TYPE_ORG,thirdObjId); + + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", "系统未设置单条同步"); + + if(synThirdInfoEntity!=null) { + if(isBatch || dingIsSyn==1){ + String sysObjId = synThirdInfoEntity.getSysObjId(); + if (!"".equals(String.valueOf(sysObjId)) && !"null".equals(String.valueOf(sysObjId))){ + OrganizeEntity sysOrgEntity = organizeService.getInfo(sysObjId); + if(sysOrgEntity!=null){ + // 删除本的的组织 + organizeService.delete(sysOrgEntity.getId()); + // 同步成功,直接删除同步表记录 + synThirdInfoService.delete(synThirdInfoEntity); + }else{ + // 根据本系统ID找不到相应的信息,直接删除同步表记录 + synThirdInfoService.delete(synThirdInfoEntity); + } + }else{ + // 根据本系统ID找不到相应的信息,直接删除同步表记录 + synThirdInfoService.delete(synThirdInfoEntity); + } + }else{ + // 未设置单条同步,归并到未同步状态 + saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING_To_Sys), + Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG), synThirdInfoEntity.getSysObjId(), thirdObjId, SynThirdConsts.SYN_STATE_NO, deptFlag + "系统未设置单条同步"); + + retMsg.put("code", true); + retMsg.put("error", deptFlag + "系统未设置单条同步"); + } + } + return retMsg; + } + + + + + + + //------------------------------------本系统同步用户到钉钉------------------------------------- + + /** + * 设置需要提交给钉钉接口的单个成员信息 + * 带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param userEntity 本地用户信息 + * @param dingDeptList 钉钉的部门信息 + * @return + */ +// public JSONObject setDingUserObject(UserEntity userEntity, List dingDeptList) throws ParseException { +// DingTalkUserModel userModel = new DingTalkUserModel(); +// JSONObject retMsg = new JSONObject(); +// retMsg.put("code", true); +// retMsg.put("error", ""); +// +// // 验证邮箱格式的格式合法性、唯一性 +// if(StringUtil.isNotEmpty(userEntity.getEmail())){ +// if(!RegexUtils.checkEmail(userEntity.getEmail())){ +// retMsg.put("code", false); +// retMsg.put("error", "邮箱格式不合法!"); +// retMsg.put("dingUserObject", null); +// return retMsg; +// } +// } +// +// // 判断手机号的合法性 +// if(StringUtil.isNotEmpty(userEntity.getMobilePhone())){ +// if(!RegexUtils.checkMobile(userEntity.getMobilePhone())){ +// retMsg.put("code", false); +// retMsg.put("error", "手机号不合法!"); +// retMsg.put("dingUserObject", null); +// return retMsg; +// } +// } +// +// userModel.setUserid(userEntity.getId()); +// userModel.setName(userEntity.getRealName()); +// userModel.setMobile(userEntity.getMobilePhone()); +// userModel.setTelephone(userEntity.getLandline()); +// userModel.setJobNumber(userEntity.getAccount()); +// +// PositionEntity positionEntity = positionService.getInfo(userEntity.getPositionId()); +// String jobName = ""; +// if(positionEntity!=null){ +// jobName = positionEntity.getFullName(); +// userModel.setTitle(jobName); +// } +// +// userModel.setWorkPlace(userEntity.getPostalAddress()); +// +// if(userEntity.getEntryDate()!= null){ +// String entryDate = DateUtil.daFormat(userEntity.getEntryDate()); +// DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); +// df.setTimeZone(TimeZone.getTimeZone("GMT")); +// if(df.parse(entryDate).getTime()>0) { +// userModel.setHiredDate(df.parse(entryDate).getTime()); +// } +// } +// +// SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_ORG,userEntity.getOrganizeId()); +// retMsg = checkDepartmentSysToDing(synThirdInfoEntity,dingDeptList); +// if(retMsg.getBoolean("code")){ +// userModel.setDeptIdList(synThirdInfoEntity.getThirdObjId()); +// }else{ +// retMsg.put("code", false); +// retMsg.put("error", "部门找不到对应的钉钉ID!"); +// retMsg.put("dingUserObject", null); +// return retMsg; +// } +// userModel.setEmail(userEntity.getEmail()); +// +// retMsg.put("dingUserObject", userModel); +// return retMsg; +// } + + + /** + * 设置需要提交给钉钉接口的单个成员信息 + * 不带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param userEntity 本地用户信息 + * @return + */ + public JSONObject setDingUserObject(UserEntity userEntity) throws ParseException { + DingTalkUserModel userModel = new DingTalkUserModel(); + JSONObject retMsg = new JSONObject(); + retMsg.put("code", true); + retMsg.put("error", ""); + + // 验证邮箱格式的格式合法性、唯一性 + if(StringUtil.isNotEmpty(userEntity.getEmail())){ + if(!RegexUtils.checkEmail(userEntity.getEmail())){ + retMsg.put("code", false); + retMsg.put("error", "邮箱格式不合法!"); + retMsg.put("dingUserObject", null); + return retMsg; + } + } + + // 判断手机号的合法性 + if(StringUtil.isNotEmpty(userEntity.getMobilePhone())){ + if(!RegexUtils.checkMobile(userEntity.getMobilePhone())){ + retMsg.put("code", false); + retMsg.put("error", "手机号不合法!"); + retMsg.put("dingUserObject", null); + return retMsg; + } + } + + userModel.setUserid(userEntity.getId()); + userModel.setName(userEntity.getRealName()); + userModel.setMobile(userEntity.getMobilePhone()); + userModel.setTelephone(userEntity.getLandline()); + userModel.setJobNumber(userEntity.getAccount()); + + PositionEntity positionEntity = positionService.getInfo(userEntity.getPositionId()); + String jobName = ""; + if(positionEntity!=null){ + jobName = positionEntity.getFullName(); + userModel.setTitle(jobName); + } + + userModel.setWorkPlace(userEntity.getPostalAddress()); + + if(userEntity.getEntryDate()!= null){ + String entryDate = DateUtil.daFormat(userEntity.getEntryDate()); + DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); + df.setTimeZone(TimeZone.getTimeZone("GMT")); + if(df.parse(entryDate).getTime()>0) { + userModel.setHiredDate(df.parse(entryDate).getTime()); + } + } + + SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_ORG,userEntity.getOrganizeId()); + // retMsg = checkDepartmentSysToDing(synThirdInfoEntity,dingDeptList); + List userRelationList = userRelationService.getListByObjectType(userEntity.getId(),"Organize"); + List objectIdList = userRelationList.stream().map(t->t.getObjectId()).collect(Collectors.toList()); +// String objectId = userRelationList.stream().map(t->t.getObjectId()).collect(Collectors.joining(",")); + retMsg = checkDepartmentSysToDing2(objectIdList); + if(retMsg.getBoolean("code")){ +// userModel.setDeptIdList(synThirdInfoEntity.getThirdObjId()); + userModel.setDeptIdList(retMsg.getString("flag")); + }else{ + retMsg.put("code", false); + retMsg.put("error", "部门找不到对应的钉钉ID!"); + retMsg.put("dingUserObject", null); + return retMsg; + } + userModel.setEmail(userEntity.getEmail()); + + retMsg.put("dingUserObject", userModel); + return retMsg; + } + + + /** + * 判断用户的手机号、邮箱是否唯一,钉钉不允许重复 + * @param mobile + * @param email + * @param userId + * @param dingUserList + * @param opType + * @param synThirdInfoEntity + * @param thirdType + * @param dataType + * @param sysObjId + * @param thirdObjId + * @param deptFlag + * @return + */ + public JSONObject checkUserMobileEmailRepeat(String mobile, String email, String userId, List dingUserList, + String opType, SynThirdInfoEntity synThirdInfoEntity, Integer thirdType, + Integer dataType, String sysObjId, String thirdObjId, String deptFlag){ + boolean isDiff = true; + String description = ""; + JSONObject retMsg = new JSONObject(); + + // 钉钉限制:手机号唯一性 + if(StringUtil.isNotEmpty(mobile)){ + if(StringUtil.isNotEmpty(userId)){ + if(dingUserList.stream().filter(t -> String.valueOf(t.getMobile()).equals(mobile) && !(t.getUserid().equals(userId))).count() > 0 ? true : false){ + isDiff = false; + description = deptFlag + "钉钉内已有绑定手机号:" + mobile; + } + }else{ + if(dingUserList.stream().filter(t -> String.valueOf(t.getMobile()).equals(mobile)).count() > 0 ? true : false){ + isDiff = false; + description = deptFlag + "钉钉内已有绑定手机号:" + mobile; + } + } + } + + // 钉钉限制:邮箱地址唯一性 + if(StringUtil.isNotEmpty(email)){ + if(StringUtil.isNotEmpty(userId)){ + if(dingUserList.stream().filter(t -> String.valueOf(t.getEmail()).equals(email) && !(t.getUserid().equals(userId))).count() > 0 ? true : false){ + isDiff = false; + description = deptFlag + "钉钉内已有绑定此邮箱:" + email; + } + }else{ + if(dingUserList.stream().filter(t -> String.valueOf(t.getEmail()).equals(email)).count() > 0 ? true : false){ + isDiff = false; + description = deptFlag + "钉钉内已有绑定此邮箱:" + email; + } + } + } + + retMsg.put("code",isDiff); + retMsg.put("error",description); + + if(!isDiff){ + // 同步失败 + Integer synState = SynThirdConsts.SYN_STATE_FAIL; + + // 更新同步表 + saveSynThirdInfoEntity(opType,synThirdInfoEntity,thirdType,dataType,sysObjId,thirdObjId,synState,description); + } + + return retMsg; + } + + + /** + * 根据用户的同步表信息判断同步情况 + * 带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param synThirdInfoEntity + * @param dingUserList + * @return + */ +// public JSONObject checkUserSysToDing(SynThirdInfoEntity synThirdInfoEntity, List dingUserList) { +// JSONObject retMsg = new JSONObject(); +// retMsg.put("code",true); +// retMsg.put("flag",""); +// retMsg.put("error",""); +// +// if(synThirdInfoEntity!=null){ +// if(StringUtil.isNotEmpty(synThirdInfoEntity.getThirdObjId())) { +// // 同步表存在钉钉ID,仍需要判断钉钉上有没此用户 +// if(dingUserList.stream().filter(t -> t.getUserid().equals(synThirdInfoEntity.getThirdObjId())).count() == 0 ? true : false){ +// retMsg.put("code",false); +// retMsg.put("flag","1"); +// retMsg.put("error","钉钉不存在同步表对应的用户ID!"); +// } +// }else{ +// // 同步表的企业微信ID为空 +// retMsg.put("code",false); +// retMsg.put("flag","2"); +// retMsg.put("error","同步表中用户对应的钉钉ID为空!"); +// } +// }else{ +// // 上级用户未同步 +// retMsg.put("code",false); +// retMsg.put("flag","3"); +// retMsg.put("error","用户未同步!"); +// } +// +// return retMsg; +// } + + /** + * 根据用户的同步表信息判断同步情况 + * 不带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param synThirdInfoEntity + * @return + */ + public JSONObject checkUserSysToDing(SynThirdInfoEntity synThirdInfoEntity) { + JSONObject retMsg = new JSONObject(); + retMsg.put("code",true); + retMsg.put("flag",""); + retMsg.put("error",""); + + if(synThirdInfoEntity!=null){ + if("".equals(String.valueOf(synThirdInfoEntity.getThirdObjId())) || "null".equals(String.valueOf(synThirdInfoEntity.getThirdObjId()))) { + // 同步表的企业微信ID为空 + retMsg.put("code",false); + retMsg.put("flag","2"); + retMsg.put("error","同步表中用户对应的钉钉ID为空!"); + } + }else{ + // 上级用户未同步 + retMsg.put("code",false); + retMsg.put("flag","3"); + retMsg.put("error","用户未同步!"); + } + + return retMsg; + } + + + /** + * 往钉钉创建用户 + * 带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param userEntity + * @param dingDeptListPara 单条执行时为null + * @param dingUserListPara 单条执行时为null + * @return + */ +// @Override +// public JSONObject createUserSysToDing(boolean isBatch, UserEntity userEntity, List dingDeptListPara, +// List dingUserListPara) throws ParseException { +// BaseSystemInfo config = getDingTalkConfig(); +// String corpId = config.getDingSynAppKey(); +// String corpSecret = config.getDingSynAppSecret(); +// // 单条记录执行时,受开关限制 +// int dingIsSyn = isBatch ? 1 : config.getDingSynIsSynUser(); +// JSONObject tokenObject = SynDingTalkUtil.getAccessToken(corpId, corpSecret); +// String access_token = tokenObject.getString("access_token"); +// JSONObject retMsg = new JSONObject(); +// DingTalkUserModel userObjectModel = new DingTalkUserModel(); +// List dingDeptList = new ArrayList<>(); +// List dingUserList = new ArrayList<>(); +// String thirdObjId = ""; +// Integer synState = 0; +// String description = ""; +// String userFlag = "创建:"; +// +// // 返回值初始化 +// retMsg.put("code", true); +// retMsg.put("error", userFlag + "系统未设置单条同步"); +// +// if (dingIsSyn==1){ +// if (access_token != null && !"".equals(access_token)) { +// // 获取企业微信上的所有部门列表信息 +// if(isBatch){ +// dingDeptList = dingDeptListPara; +// }else{ +// JSONObject deptObject = SynDingTalkUtil.getDepartmentList(SynThirdConsts.DING_ROOT_DEPT_ID,access_token); +// if(deptObject.getBoolean("code")) { +// dingDeptList = JsonUtil.getJsonToList(deptObject.getObject("department",List.class), DingTalkDeptModel.class); +// }else{ +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + "获取钉钉的部门列表信息失败"; +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// +// // 更新同步表 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_ADD, null, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), userEntity.getId(), thirdObjId, synState, description); +// +// return retMsg; +// } +// } +// +// // 获取钉钉上的所有用户列表信息 +// if(isBatch){ +// dingUserList = dingUserListPara; +// }else { +// JSONObject userObject = SynDingTalkUtil.getUserList(dingDeptList, access_token); +// if (userObject.getBoolean("code")) { +// dingUserList = JsonUtil.getJsonToList(userObject.getObject("userlist", List.class), DingTalkUserModel.class); +// } else { +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + "获取钉钉的用户列表信息失败"; +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// +// // 更新同步表 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_ADD, null, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), userEntity.getId(), thirdObjId, synState, description); +// +// return retMsg; +// } +// } +// +// // 判断用户的手机号、邮箱是否唯一,不能重复 +// retMsg = checkUserMobileEmailRepeat(userEntity.getMobilePhone(),userEntity.getEmail(),thirdObjId,dingUserList, +// SynThirdConsts.OBJECT_OP_ADD,null,Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),userEntity.getId(),thirdObjId,userFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 要同步到钉钉的对象赋值 +// retMsg = setDingUserObject(userEntity, dingDeptList); +// if (retMsg.getBoolean("code")) { +// userObjectModel = retMsg.getObject("dingUserObject",DingTalkUserModel.class); +// +// // 往企业微信写入成员 +// retMsg = SynDingTalkUtil.createUser(userObjectModel, access_token); +// +// // 往同步写入本系统与第三方的对应信息 +// if (retMsg.getBoolean("code")) { +// // 同步成功 +// thirdObjId = userEntity.getId(); +// synState = SynThirdConsts.SYN_STATE_OK; +// } else { +// // 同步失败 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + retMsg.getString("error"); +// } +// }else{ +// // 同步失败,原因:部门找不到对应的第三方ID、邮箱格式不合法 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + retMsg.getString("error"); +// } +// +// }else{ +// // 同步失败 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + "access_token值为空,不能同步信息"; +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// } +// +// }else{ +// // 无须同步,未同步状态 +// synState = SynThirdConsts.SYN_STATE_NO; +// description = userFlag + "系统未设置单条同步"; +// +// retMsg.put("code", true); +// retMsg.put("error", description); +// } +// +// // 更新同步表 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_ADD, null, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), userEntity.getId(), thirdObjId, synState, description); +// +// return retMsg; +// } + + + /** + * 往钉钉更新用户 + * 带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param userEntity + * @param dingDeptListPara 单条执行时为null + * @param dingUserListPara 单条执行时为null + * @return + */ +// @Override +// public JSONObject updateUserSysToDing(boolean isBatch, UserEntity userEntity, List dingDeptListPara, +// List dingUserListPara) throws ParseException { +// BaseSystemInfo config = getDingTalkConfig(); +// String corpId = config.getDingSynAppKey(); +// String corpSecret = config.getDingSynAppSecret(); +// // 单条记录执行时,受开关限制 +// int dingIsSyn = isBatch ? 1 : config.getDingSynIsSynUser(); +// JSONObject tokenObject = new JSONObject(); +// String access_token = ""; +// JSONObject retMsg = new JSONObject(); +// DingTalkUserModel userObjectModel = new DingTalkUserModel(); +// List dingDeptList = new ArrayList<>(); +// List dingUserList = new ArrayList<>(); +// SynThirdInfoEntity synThirdInfoEntity = new SynThirdInfoEntity(); +// SynThirdInfoEntity entity = new SynThirdInfoEntity(); +// String opType = ""; +// SynThirdInfoEntity synThirdInfoPara = new SynThirdInfoEntity(); +// String thirdObjId = ""; +// Integer synState = 0; +// String description = ""; +// String userFlag = "更新:"; +// +// // 返回值初始化 +// retMsg.put("code", true); +// retMsg.put("error", userFlag + "系统未设置单条同步"); +// +// // 支持同步 +// if (dingIsSyn==1){ +// // 获取 access_token +// tokenObject = SynDingTalkUtil.getAccessToken(corpId, corpSecret); +// access_token = tokenObject.getString("access_token"); +// +// // 获取同步表信息 +// synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_USER,userEntity.getId()); +// if (access_token != null && !"".equals(access_token)) { +// // 获取企业微信上的所有部门列表信息 +// if(isBatch){ +// dingDeptList = dingDeptListPara; +// }else{ +// JSONObject deptObject = SynDingTalkUtil.getDepartmentList(SynThirdConsts.DING_ROOT_DEPT_ID,access_token); +// if(deptObject.getBoolean("code")) { +// dingDeptList = JsonUtil.getJsonToList(deptObject.getObject("department",List.class), DingTalkDeptModel.class); +// }else{ +// if(synThirdInfoEntity!=null){ +// // 修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// }else{ +// // 写入同步表 +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// } +// +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + "获取企业微信的部门列表信息失败"; +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// +// // 更新同步表 +// saveSynThirdInfoEntity(opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),userEntity.getId(),thirdObjId,synState,description); +// +// return retMsg; +// } +// } +// +// +// // 获取钉钉上的所有用户列表信息 +// if(isBatch){ +// dingUserList = dingUserListPara; +// }else { +// JSONObject userObject = SynDingTalkUtil.getUserList(dingDeptList, access_token); +// if (userObject.getBoolean("code")) { +// dingUserList = JsonUtil.getJsonToList(userObject.getObject("userlist", List.class), DingTalkUserModel.class); +// } else { +// if (synThirdInfoEntity != null) { +// // 修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// } else { +// // 写入同步表 +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// } +// +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + "获取钉钉的用户列表信息失败"; +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// +// // 更新同步表 +// saveSynThirdInfoEntity(opType, synThirdInfoPara, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), userEntity.getId(), thirdObjId, synState, description); +// +// return retMsg; +// } +// } +// +// // 要同步到企业微信的对象赋值 +// retMsg = setDingUserObject(userEntity,dingDeptList); +// if (retMsg.getBoolean("code")) { +// // 判断当前用户对应的第三方的合法性 +// userObjectModel = retMsg.getObject("dingUserObject",DingTalkUserModel.class); +// retMsg = checkUserSysToDing(synThirdInfoEntity, dingUserList); +// if (!retMsg.getBoolean("code")) { +// if("3".equals(retMsg.getString("flag")) || "1".equals(retMsg.getString("flag"))){ +// // flag:3 未同步,需要创建同步到企业微信、写入同步表 +// // flag:1 已同步但第三方上没对应的ID,需要删除原来的同步信息,再创建同步到企业微信、写入同步表 +// if("1".equals(retMsg.getString("flag"))) { +// synThirdInfoService.delete(synThirdInfoEntity); +// } +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// +// // 判断用户的手机号、邮箱是否唯一,不能重复 +// retMsg = checkUserMobileEmailRepeat(userEntity.getMobilePhone(),userEntity.getEmail(),thirdObjId,dingUserList, +// opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),userEntity.getId(),thirdObjId,userFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 往企业微信写入成员 +// retMsg = SynDingTalkUtil.createUser(userObjectModel, access_token); +// if(retMsg.getBoolean("code")) { +// // 同步成功 +// thirdObjId = userEntity.getId(); +// synState = SynThirdConsts.SYN_STATE_OK; +// description = ""; +// }else{ +// // 同步失败 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + retMsg.getString("error"); +// } +// } +// +// if("2".equals(retMsg.getString("flag"))){ +// // 已同步但第三方ID为空,需要创建同步到企业微信、修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = ""; +// +// // 判断用户的手机号、邮箱是否唯一,不能重复 +// retMsg = checkUserMobileEmailRepeat(userEntity.getMobilePhone(),userEntity.getEmail(),thirdObjId,dingUserList, +// opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),userEntity.getId(),thirdObjId,userFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 往企业微信写入成员 +// retMsg = SynDingTalkUtil.createUser(userObjectModel, access_token); +// if(retMsg.getBoolean("code")) { +// // 同步成功 +// thirdObjId = userEntity.getId(); +// synState = SynThirdConsts.SYN_STATE_OK; +// description = ""; +// }else{ +// // 同步失败 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + retMsg.getString("error"); +// } +// } +// +// }else{ +// // 更新同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// +// // 判断用户的手机号、邮箱是否唯一,不能重复 +// retMsg = checkUserMobileEmailRepeat(userEntity.getMobilePhone(),userEntity.getEmail(),thirdObjId,dingUserList, +// opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),userEntity.getId(),thirdObjId,userFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 往企业微信更新成员信息 +// retMsg = SynDingTalkUtil.updateUser(userObjectModel, access_token); +// if(retMsg.getBoolean("code")) { +// // 同步成功 +// synState = SynThirdConsts.SYN_STATE_OK; +// description = ""; +// }else{ +// // 同步失败 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + retMsg.getString("error"); +// } +// +// } +// +// }else{ +// // 同步失败,原因:用户所属部门找不到相应的企业微信ID、邮箱格式不合法 +// if(synThirdInfoEntity!=null){ +// // 修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// }else{ +// // 写入同步表 +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// } +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + retMsg.getString("error"); +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// } +// +// +// }else{ +// // 同步失败 +// if(synThirdInfoEntity!=null){ +// // 修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// }else{ +// // 写入同步表 +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// } +// +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + "access_token值为空,不能同步信息"; +// +// retMsg.put("code", true); +// retMsg.put("error", description); +// } +// +// }else{ +// // 未设置单条同步,归并到未同步状态 +// // 获取同步表信息 +// synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_USER,userEntity.getId()); +// if(synThirdInfoEntity!=null){ +// // 修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// }else{ +// // 写入同步表 +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// } +// +// synState = SynThirdConsts.SYN_STATE_NO; +// description = userFlag + "系统未设置单条同步"; +// +// retMsg.put("code", true); +// retMsg.put("error", description); +// } +// +// // 更新同步表 +// saveSynThirdInfoEntity(opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),userEntity.getId(),thirdObjId,synState,description); +// +// return retMsg; +// } + + + /** + * 往钉钉删除用户 + * 带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param id 本系统的公司或部门ID + * @param dingDeptListPara 单条执行时为null + * @param dingUserListPara 单条执行时为null + * @return + */ +// @Override +// public JSONObject deleteUserSysToDing(boolean isBatch, String id, List dingDeptListPara, +// List dingUserListPara) { +// BaseSystemInfo config = getDingTalkConfig(); +// String corpId = config.getDingSynAppKey(); +// String corpSecret = config.getDingSynAppSecret(); +// // 单条记录执行时,受开关限制 +// int dingIsSyn = isBatch ? 1 : config.getDingSynIsSynUser(); +// JSONObject tokenObject = new JSONObject(); +// String access_token = ""; +// JSONObject retMsg = new JSONObject(); +// List dingDeptList = new ArrayList<>(); +// List dingUserList = new ArrayList<>(); +// SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_USER,id); +// +// // 返回值初始化 +// retMsg.put("code", true); +// retMsg.put("error", "系统未设置单条同步"); +// +// // 支持同步 +// if(synThirdInfoEntity!=null) { +// if(dingIsSyn==1) { +// // 获取 access_token +// tokenObject = SynDingTalkUtil.getAccessToken(corpId, corpSecret); +// access_token = tokenObject.getString("access_token"); +// +// if (access_token != null && !"".equals(access_token)) { +// // 获取企业微信上的所有部门列表信息 +// if(isBatch){ +// dingDeptList = dingDeptListPara; +// }else { +// JSONObject deptObject = SynDingTalkUtil.getDepartmentList(SynThirdConsts.DING_ROOT_DEPT_ID, access_token); +// if (deptObject.getBoolean("code")) { +// dingDeptList = JsonUtil.getJsonToList(deptObject.getObject("department", List.class), DingTalkDeptModel.class); +// } else { +// // 更新同步表 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_FAIL, "获取钉钉的部门列表信息失败"); +// +// retMsg.put("code", true); +// retMsg.put("error", "获取钉钉的部门列表信息失败"); +// return retMsg; +// } +// } +// +// // 获取企业微信上的所有成员信息列表 +// if(isBatch){ +// dingUserList = dingUserListPara; +// }else{ +// JSONObject userObject = SynDingTalkUtil.getUserList(dingDeptList,access_token); +// if(userObject.getBoolean("code")) { +// dingUserList = JsonUtil.getJsonToList(userObject.getObject("userlist",List.class), DingTalkUserModel.class); +// }else{ +// // 同步失败,获取企业微信的成员列表信息失败 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_FAIL, "获取企业微信的成员列表信息失败"); +// +// retMsg.put("code", false); +// retMsg.put("error", "获取企业微信的成员列表信息失败"); +// return retMsg; +// } +// } +// +// // 删除企业对应的用户 +// if(dingUserList.stream().filter(t -> t.getUserid().equals(synThirdInfoEntity.getThirdObjId())).count() > 0 ? true : false){ +// retMsg = SynDingTalkUtil.deleteUser(synThirdInfoEntity.getThirdObjId(), access_token); +// if (retMsg.getBoolean("code")) { +// // 同步成功,直接删除同步表记录 +// synThirdInfoService.delete(synThirdInfoEntity); +// }else{ +// // 同步失败 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_FAIL, retMsg.getString("error")); +// } +// }else{ +// // 根据企业微信ID找不到相应的信息,直接删除同步表记录 +// synThirdInfoService.delete(synThirdInfoEntity); +// } +// }else{ +// // 同步失败 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_FAIL, "access_token值为空,不能同步信息"); +// +// retMsg.put("code", false); +// retMsg.put("error", "access_token值为空,不能同步信息!"); +// } +// +// }else{ +// // 未设置单条同步,归并到未同步状态 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_NO, "系统未设置同步"); +// +// retMsg.put("code", true); +// retMsg.put("error", "系统未设置单条同步"); +// } +// } +// +// return retMsg; +// } + + + + /** + * 往钉钉创建用户 + * 不带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param userEntity + * @param accessToken (单条调用时为空) + * @return + */ + @Override + public JSONObject createUserSysToDing(boolean isBatch, UserEntity userEntity,String accessToken) throws ParseException { + BaseSystemInfo config = getDingTalkConfig(); + String corpId = config.getDingSynAppKey(); + String corpSecret = config.getDingSynAppSecret(); + // 单条记录执行时,受开关限制 + int dingIsSyn = isBatch ? 1 : config.getDingSynIsSynUser(); + JSONObject tokenObject = new JSONObject(); + String access_token = ""; + JSONObject retMsg = new JSONObject(); + DingTalkUserModel userObjectModel = new DingTalkUserModel(); + String thirdObjId = ""; + Integer synState = 0; + String description = ""; + String userFlag = "创建:"; + + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", userFlag + "系统未设置单条同步"); + + if (isBatch || dingIsSyn==1){ + if(isBatch){ + access_token = accessToken; + }else{ + synThirdInfoService.syncThirdInfoByType(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_ORG, SynThirdConsts.THIRD_TYPE_DING_To_Sys); + synThirdInfoService.syncThirdInfoByType(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_USER, SynThirdConsts.THIRD_TYPE_DING_To_Sys); + tokenObject = SynDingTalkUtil.getAccessToken(corpId, corpSecret); + access_token = tokenObject.getString("access_token"); + } + + if (access_token != null && !"".equals(access_token)) { + // 要同步到钉钉的对象赋值 + retMsg = setDingUserObject(userEntity); + if (retMsg.getBoolean("code")) { + userObjectModel = retMsg.getObject("dingUserObject",DingTalkUserModel.class); + + // 往钉钉写入成员 + retMsg = SynDingTalkUtil.createUser(userObjectModel, access_token); + + // 往同步写入本系统与第三方的对应信息 + if (retMsg.getBoolean("code")) { + // 同步成功 + thirdObjId = userEntity.getId(); + synState = SynThirdConsts.SYN_STATE_OK; + } else { + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + retMsg.getString("error"); + } + }else{ + // 同步失败,原因:部门找不到对应的第三方ID、邮箱格式不合法 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + retMsg.getString("error"); + } + + }else{ + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + "access_token值为空,不能同步信息"; + + retMsg.put("code", false); + retMsg.put("error", description); + } + + }else{ + // 无须同步,未同步状态 + synState = SynThirdConsts.SYN_STATE_NO; + description = userFlag + "系统未设置单条同步"; + + retMsg.put("code", true); + retMsg.put("error", description); + } + + // 更新同步表 + saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_ADD, null, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), + Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), userEntity.getId(), thirdObjId, synState, description); + + return retMsg; + } + + + /** + * 往钉钉更新用户 + * 不带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param userEntity + * @param accessToken (单条调用时为空) + * @return + */ + @Override + public JSONObject updateUserSysToDing(boolean isBatch, UserEntity userEntity,String accessToken) throws ParseException { + BaseSystemInfo config = getDingTalkConfig(); + String corpId = config.getDingSynAppKey(); + String corpSecret = config.getDingSynAppSecret(); + // 单条记录执行时,受开关限制 + int dingIsSyn = isBatch ? 1 : config.getDingSynIsSynUser(); + JSONObject tokenObject = new JSONObject(); + String access_token = ""; + JSONObject retMsg = new JSONObject(); + DingTalkUserModel userObjectModel = new DingTalkUserModel(); + SynThirdInfoEntity synThirdInfoEntity = new SynThirdInfoEntity(); + SynThirdInfoEntity entity = new SynThirdInfoEntity(); + String opType = ""; + SynThirdInfoEntity synThirdInfoPara = new SynThirdInfoEntity(); + String thirdObjId = ""; + Integer synState = 0; + String description = ""; + String userFlag = "更新:"; + + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", userFlag + "系统未设置单条同步"); + + // 支持同步 + if (isBatch || dingIsSyn==1){ + // 获取 access_token + if(isBatch){ + access_token = accessToken; + }else{ + synThirdInfoService.syncThirdInfoByType(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_USER, SynThirdConsts.THIRD_TYPE_DING_To_Sys); + synThirdInfoService.syncThirdInfoByType(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_ORG, SynThirdConsts.THIRD_TYPE_DING_To_Sys); + tokenObject = SynDingTalkUtil.getAccessToken(corpId, corpSecret); + access_token = tokenObject.getString("access_token"); + } + + // 获取同步表信息 + synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_USER,userEntity.getId()); + if (access_token != null && !"".equals(access_token)) { + // 要同步到企业微信的对象赋值 + retMsg = setDingUserObject(userEntity); + if (retMsg.getBoolean("code")) { + // 判断当前用户对应的第三方的合法性 + userObjectModel = retMsg.getObject("dingUserObject",DingTalkUserModel.class); + retMsg = checkUserSysToDing(synThirdInfoEntity); + if (!retMsg.getBoolean("code")) { + if("3".equals(retMsg.getString("flag")) || "1".equals(retMsg.getString("flag"))){ + // flag:3 未同步,需要创建同步到企业微信、写入同步表 + // flag:1 已同步但第三方上没对应的ID,需要删除原来的同步信息,再创建同步到企业微信、写入同步表 + if("1".equals(retMsg.getString("flag"))) { + synThirdInfoService.delete(synThirdInfoEntity); + } + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + thirdObjId = ""; + + // 往企业微信写入成员 + retMsg = SynDingTalkUtil.createUser(userObjectModel, access_token); + if(retMsg.getBoolean("code")) { + // 同步成功 + thirdObjId = userEntity.getId(); + synState = SynThirdConsts.SYN_STATE_OK; + description = ""; + }else{ + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + retMsg.getString("error"); + } + } + + if("2".equals(retMsg.getString("flag"))){ + // 已同步但第三方ID为空,需要创建同步到企业微信、修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = ""; + + // 往企业微信写入成员 + retMsg = SynDingTalkUtil.createUser(userObjectModel, access_token); + if(retMsg.getBoolean("code")) { + // 同步成功 + thirdObjId = userEntity.getId(); + synState = SynThirdConsts.SYN_STATE_OK; + description = ""; + }else{ + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + retMsg.getString("error"); + } + } + + }else{ + // 更新同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + + // 往企业微信更新成员信息 + userObjectModel.setUserid(synThirdInfoEntity.getThirdObjId()); + retMsg = SynDingTalkUtil.updateUser(userObjectModel, access_token); + if(retMsg.getBoolean("code")) { + // 同步成功 + synState = SynThirdConsts.SYN_STATE_OK; + description = ""; + }else{ + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + retMsg.getString("error"); + } + + } + + }else{ + // 同步失败,原因:用户所属部门找不到相应的企业微信ID、邮箱格式不合法 + if(synThirdInfoEntity!=null){ + // 修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + }else{ + // 写入同步表 + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + thirdObjId = ""; + } + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + retMsg.getString("error"); + + retMsg.put("code", false); + retMsg.put("error", description); + } + + + }else{ + // 同步失败 + if(synThirdInfoEntity!=null){ + // 修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + }else{ + // 写入同步表 + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + thirdObjId = ""; + } + + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + "access_token值为空,不能同步信息"; + + retMsg.put("code", true); + retMsg.put("error", description); + } + + }else{ + // 未设置单条同步,归并到未同步状态 + // 获取同步表信息 + synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_USER,userEntity.getId()); + if(synThirdInfoEntity!=null){ + // 修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + }else{ + // 写入同步表 + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + thirdObjId = ""; + } + + synState = SynThirdConsts.SYN_STATE_NO; + description = userFlag + "系统未设置单条同步"; + + retMsg.put("code", true); + retMsg.put("error", description); + } + + // 更新同步表 + saveSynThirdInfoEntity(opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), + Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),userEntity.getId(),thirdObjId,synState,description); + + return retMsg; + } + + + /** + * 往钉钉删除用户 + * 不带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param id 本系统的公司或部门ID + * @param accessToken (单条调用时为空) + * @return + */ + @Override + public JSONObject deleteUserSysToDing(boolean isBatch, String id,String accessToken) { + BaseSystemInfo config = getDingTalkConfig(); + String corpId = config.getDingSynAppKey(); + String corpSecret = config.getDingSynAppSecret(); + // 单条记录执行时,受开关限制 + int dingIsSyn = isBatch ? 1 : config.getDingSynIsSynUser(); + JSONObject tokenObject = new JSONObject(); + String access_token = ""; + JSONObject retMsg = new JSONObject(); + SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_USER,id); + + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", "系统未设置单条同步"); + + // 支持同步 + if(synThirdInfoEntity!=null) { + if(isBatch || dingIsSyn==1) { + // 获取 access_token + if(isBatch){ + access_token = accessToken; + }else{ + List synThirdInfoList = synThirdInfoService.syncThirdInfoByType(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_USER, SynThirdConsts.THIRD_TYPE_DING_To_Sys); + tokenObject = SynDingTalkUtil.getAccessToken(corpId, corpSecret); + access_token = tokenObject.getString("access_token"); + } + + if (access_token != null && !"".equals(access_token)) { + // 删除企业对应的用户 + if (!"".equals(String.valueOf(synThirdInfoEntity.getThirdObjId())) && !"null".equals(String.valueOf(synThirdInfoEntity.getThirdObjId()))) { + retMsg = SynDingTalkUtil.deleteUser(synThirdInfoEntity.getThirdObjId(), access_token); + if (retMsg.getBoolean("code")) { + // 同步成功,直接删除同步表记录 + synThirdInfoService.delete(synThirdInfoEntity); + }else{ + // 同步失败 + saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), + Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_FAIL, retMsg.getString("error")); + } + }else{ + // 根据企业微信ID找不到相应的信息,直接删除同步表记录 + synThirdInfoService.delete(synThirdInfoEntity); + } + }else{ + // 同步失败 + saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), + Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_FAIL, "access_token值为空,不能同步信息"); + + retMsg.put("code", false); + retMsg.put("error", "access_token值为空,不能同步信息!"); + } + + }else{ + // 未设置单条同步,归并到未同步状态 + saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), + Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_NO, "系统未设置同步"); + + retMsg.put("code", true); + retMsg.put("error", "系统未设置单条同步"); + } + } + + return retMsg; + } + + + + + //------------------------------------钉钉同步用户到本系统20220331------------------------------------- + + /** + * 钉钉往本地创建用户 + * 不带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20220331 + * @param isBatch 是否批量(批量不受开关限制) + * @param dingUserModel + * @param accessToken (单条调用时为空) + * @return + */ + @Override + public JSONObject createUserDingToSys(boolean isBatch, OapiV2UserListResponse.ListUserResponse dingUserModel, String accessToken) throws Exception { + + String dingUserId = dingUserModel.getUserid(); + String dingUserName = dingUserModel.getName(); + String dingMobile = dingUserModel.getMobile(); + String dingTelephone = dingUserModel.getTelephone(); + // 工号不唯一的情况,不能用于做本系统的账号 + String dingJobNumber = dingUserModel.getJobNumber(); + // 职位:是字符串,手入的 + String title = dingUserModel.getTitle(); + String sysObjId= ""; + BaseSystemInfo config = getDingTalkConfig(); + // 单条记录执行时,受开关限制 + int dingIsSyn = config.getDingSynIsSynUser(); + JSONObject retMsg = new JSONObject(); + String thirdObjId = dingUserId; + Integer synState = 0; + String description = ""; + String userFlag = "创建:"; + UserEntity userEntity = new UserEntity(); + String tag= SynThirdConsts.OBJECT_OP_ADD; + if(isBatch || dingIsSyn==1){ + // 检测账户唯一 + UserEntity userAccount = userService.getUserByMobile(dingMobile); + if (userAccount!=null) { + // 查询用户id在不在同步表 + sysObjId= userAccount.getId(); + boolean hasExist = synThirdInfoService.getBySysObjId(sysObjId); + if (hasExist) { + // 说明创建过了,直接跳过 + tag=SynThirdConsts.OBJECT_OP_UPD; + synState=1; + description="创建过,更新对象"; + return retMsg; + }else{ + retMsg.put("code", true); + description = "账户名重复:线上手机账号"+dingMobile+"自动合并为本地账号"; + synState = SynThirdConsts.SYN_STATE_OK; + retMsg.put("msg", description); + } + }else{ + // 判断中间表用户组织是否存在 + List deptIdList = dingUserModel.getDeptIdList(); + List deptIdStrList = deptIdList.stream().map(t->t+"").collect(Collectors.toList()); + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().in(SynThirdInfoEntity::getThirdObjId,deptIdStrList); + wrapper.lambda().eq(SynThirdInfoEntity::getThirdType,SynThirdConsts.THIRD_TYPE_DING_To_Sys); + List synThirdInfoEntities = synThirdInfoService.getBaseMapper().selectList(wrapper); + if(synThirdInfoEntities!=null && synThirdInfoEntities.size()!=0){ + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", userFlag + "系统未设置单条同步"); + userEntity.setId(RandomUtil.uuId()); + userEntity.setHeadIcon("001.png"); + userEntity.setAccount(dingMobile); + // 工号 + userEntity.setDingJobNumber(dingUserModel.getJobNumber()); + userEntity.setEmail(dingUserModel.getEmail()); + + userEntity.setCertificatesNumber(dingUserModel.getJobNumber()); + userEntity.setMobilePhone(dingMobile); + userEntity.setGender(2); + userEntity.setRealName(dingUserName); + userEntity.setEnabledMark(1); + if(StringUtil.isBlank(userEntity.getOrganizeId())){ + String orgId = synThirdInfoService.getSysByThird(String.valueOf(deptIdList.get(0))); + userEntity.setOrganizeId(orgId); + } + userEntity.setPassword("4a7d1ed414474e4033ac29ccb8653d9b"); + sysObjId = userEntity.getId(); + List orgIdList = new ArrayList<>(); + for (String deptIdStr:deptIdStrList){ + String orgId = synThirdInfoService.getSysByThird(deptIdStr); + orgIdList.add(orgId); + } + userEntity.setOrganizeId(orgIdList.stream().collect(Collectors.joining(","))); + userService.create(userEntity); + + + +// userRelationService.syncDingUserRelation(sysObjId,deptIdList); + // 往同步写入本系统与第三方的对应信息 + if (retMsg.getBoolean("code")) { + // 同步成功 + synState = SynThirdConsts.SYN_STATE_OK; + } else { + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + retMsg.getString("error"); + } + + }else{ + // 无须同步,未同步状态 + synState = SynThirdConsts.SYN_STATE_NO; + description = userFlag + "用户未同步组织信息"; + retMsg.put("code", false); + retMsg.put("error", description); + } + } + }else{ + // 无须同步,未同步状态 + synState = SynThirdConsts.SYN_STATE_NO; + description = userFlag + "系统未设置单条同步"; + retMsg.put("code", true); + retMsg.put("error", description); + } + // 更新同步表 + saveSynThirdInfoEntity(tag, null, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING_To_Sys), + Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),sysObjId, thirdObjId, synState, description); + return retMsg; + } + + + /** + * 往钉钉更新用户 + * 不带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20220331 + * @param isBatch 是否批量(批量不受开关限制) + * @param userEntity + * @param accessToken (单条调用时为空) + * @return + */ + @Override + public JSONObject updateUserDingToSys(boolean isBatch, UserEntity userEntity,String accessToken) throws ParseException { + BaseSystemInfo config = getDingTalkConfig(); + String corpId = config.getDingSynAppKey(); + String corpSecret = config.getDingSynAppSecret(); + // 单条记录执行时,受开关限制 + int dingIsSyn = isBatch ? 1 : config.getDingSynIsSynUser(); + JSONObject tokenObject = new JSONObject(); + String access_token = ""; + JSONObject retMsg = new JSONObject(); + DingTalkUserModel userObjectModel = new DingTalkUserModel(); + SynThirdInfoEntity synThirdInfoEntity = new SynThirdInfoEntity(); + SynThirdInfoEntity entity = new SynThirdInfoEntity(); + String opType = ""; + SynThirdInfoEntity synThirdInfoPara = new SynThirdInfoEntity(); + String thirdObjId = ""; + Integer synState = 0; + String description = ""; + String userFlag = "更新:"; + + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", userFlag + "系统未设置单条同步"); + + // 支持同步 + if (isBatch || dingIsSyn==1){ + // 获取 access_token + if(isBatch){ + access_token = accessToken; + }else{ + tokenObject = SynDingTalkUtil.getAccessToken(corpId, corpSecret); + access_token = tokenObject.getString("access_token"); + } + + // 获取同步表信息 + synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_USER,userEntity.getId()); + if (access_token != null && !"".equals(access_token)) { + // 要同步到企业微信的对象赋值 + retMsg = setDingUserObject(userEntity); + if (retMsg.getBoolean("code")) { + // 判断当前用户对应的第三方的合法性 + userObjectModel = retMsg.getObject("dingUserObject",DingTalkUserModel.class); + retMsg = checkUserSysToDing(synThirdInfoEntity); + if (!retMsg.getBoolean("code")) { + if("3".equals(retMsg.getString("flag")) || "1".equals(retMsg.getString("flag"))){ + // flag:3 未同步,需要创建同步到企业微信、写入同步表 + // flag:1 已同步但第三方上没对应的ID,需要删除原来的同步信息,再创建同步到企业微信、写入同步表 + if("1".equals(retMsg.getString("flag"))) { + synThirdInfoService.delete(synThirdInfoEntity); + } + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + thirdObjId = ""; + + // 往企业微信写入成员 + retMsg = SynDingTalkUtil.createUser(userObjectModel, access_token); + if(retMsg.getBoolean("code")) { + // 同步成功 + thirdObjId = userEntity.getId(); + synState = SynThirdConsts.SYN_STATE_OK; + description = ""; + }else{ + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + retMsg.getString("error"); + } + } + + if("2".equals(retMsg.getString("flag"))){ + // 已同步但第三方ID为空,需要创建同步到企业微信、修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = ""; + + // 往企业微信写入成员 + retMsg = SynDingTalkUtil.createUser(userObjectModel, access_token); + if(retMsg.getBoolean("code")) { + // 同步成功 + thirdObjId = userEntity.getId(); + synState = SynThirdConsts.SYN_STATE_OK; + description = ""; + }else{ + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + retMsg.getString("error"); + } + } + + }else{ + // 更新同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + + // 往企业微信更新成员信息 + retMsg = SynDingTalkUtil.updateUser(userObjectModel, access_token); + if(retMsg.getBoolean("code")) { + // 同步成功 + synState = SynThirdConsts.SYN_STATE_OK; + description = ""; + }else{ + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + retMsg.getString("error"); + } + + } + + }else{ + // 同步失败,原因:用户所属部门找不到相应的企业微信ID、邮箱格式不合法 + if(synThirdInfoEntity!=null){ + // 修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + }else{ + // 写入同步表 + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + thirdObjId = ""; + } + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + retMsg.getString("error"); + + retMsg.put("code", false); + retMsg.put("error", description); + } + + + }else{ + // 同步失败 + if(synThirdInfoEntity!=null){ + // 修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + }else{ + // 写入同步表 + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + thirdObjId = ""; + } + + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + "access_token值为空,不能同步信息"; + + retMsg.put("code", true); + retMsg.put("error", description); + } + + }else{ + // 未设置单条同步,归并到未同步状态 + // 获取同步表信息 +// synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_USER,userEntity.getId()); +// if(synThirdInfoEntity!=null){ +// // 修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// }else{ +// // 写入同步表 +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// } + synState = SynThirdConsts.SYN_STATE_NO; + description = userFlag + "系统未设置单条同步"; + + retMsg.put("code", true); + retMsg.put("error", description); + } + + // 更新同步表 + saveSynThirdInfoEntity(opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), + Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),userEntity.getId(),thirdObjId,synState,description); + + return retMsg; + } + @Override + public JSONObject updateUserDingToSystem(boolean isBatch, OapiV2UserListResponse.ListUserResponse dingUserModel) throws Exception { + BaseSystemInfo config = getDingTalkConfig(); + + JSONObject retMsg = new JSONObject(); + SynThirdInfoEntity synThirdInfoEntity = new SynThirdInfoEntity(); + String opType = ""; + String thirdObjId = ""; + Integer synState = 0; + String description = ""; + String userFlag = "更新:"; + + // 赋值第三方id + thirdObjId = dingUserModel.getUserid(); + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", userFlag + "系统未设置单条同步"); + + // 单条记录执行时,受开关限制 + int dingIsSyn = config.getDingSynIsSynUser(); + // 支持同步 + if (isBatch || dingIsSyn==1){ + // 获取同步表信息 + /** + * 获取指定第三方工具、指定数据类型、本地对象ID的同步信息 + * // 获取方式如果第三方用户id和第三方组织id会一致则须修改 + * thirdType 22 钉钉 + * dataType 2 用户 + * thirdId 第三方id + */ + synThirdInfoEntity = synThirdInfoService.getInfoByThirdObjId(SynThirdConsts.THIRD_TYPE_DING_To_Sys,SynThirdConsts.DATA_TYPE_USER,thirdObjId); + + if(synThirdInfoEntity!=null && StringUtil.isNoneBlank(synThirdInfoEntity.getSysObjId())){ + opType = SynThirdConsts.OBJECT_OP_UPD; + String sysObjId = synThirdInfoEntity.getSysObjId(); + + UserEntity info = userService.getInfo(sysObjId); + if(info==null){ + synState = SynThirdConsts.SYN_STATE_NO; + description = "本地更新记录未找到"; + retMsg.put("code", false); + retMsg.put("error", description); + synThirdInfoService.removeById(synThirdInfoEntity.getId()); + + + }else{ + String dingUserName = dingUserModel.getName(); + String dingMobile = dingUserModel.getMobile(); + + // 更新系统用户表 + List deptIdList = dingUserModel.getDeptIdList(); + List deptIdStrList = deptIdList.stream().map(t->t+"").collect(Collectors.toList()); + info.setMobilePhone(dingMobile); + info.setAccount(dingMobile); + info.setRealName(dingUserName); + List orgIdList = new ArrayList<>(); + for (String deptIdStr:deptIdStrList){ + String orgId = synThirdInfoService.getSysByThird(deptIdStr); + orgIdList.add(orgId); + } + info.setOrganizeId(orgIdList.stream().collect(Collectors.joining(","))); + userService.update(info.getId(), info); + + // 检测是否未同步用户组织关联 + // userRelationService.syncDingUserRelation(info.getId(),deptIdList); + + synState=1; + // 更新同步表记录 + description="账号同步更新完成"; + saveSynThirdInfoEntity(opType, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING_To_Sys), + Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),synThirdInfoEntity.getSysObjId(), thirdObjId, synState, description); + + } + + }else{ + if((synThirdInfoEntity!=null && StringUtil.isBlank(synThirdInfoEntity.getSysObjId() ))){ + // 删除记录 + synThirdInfoService.removeById(synThirdInfoEntity.getId()); + } + opType = SynThirdConsts.OBJECT_OP_ADD; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + try { + this.createUserDingToSys(true,dingUserModel,null); + } catch (ParseException e) { + e.printStackTrace(); + } + } + }else{ + // 未设置单条同步,归并到未同步状态 + synState = SynThirdConsts.SYN_STATE_NO; + description = userFlag + "系统未设置单条同步"; + + retMsg.put("code", true); + retMsg.put("error", description); + opType= SynThirdConsts.OBJECT_OP_ADD; + + saveSynThirdInfoEntity(opType, null, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING_To_Sys), + Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),null, thirdObjId, synState, description); + } + + // 更新同步表 + /** + * 将组织、用户的信息写入同步表 + * @param opType "add":创建 “upd”:修改 + * @param synThirdInfoEntity 本地同步表信息 + * @param thirdType 第三方类型 + * @param dataType 数据类型 + * @param sysObjId 本地对象ID + * @param thirdObjId 第三方对象ID + * @param synState 同步状态(0:未同步;1:同步成功;2:同步失败) + * @param description + */ + + return retMsg; + } + + @Override + public void deleteSyncByBothWay(String thirdTypeDing, String id) { + HashMap typeMap = new HashMap<>(); + typeMap.put(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.THIRD_TYPE_DING_To_Sys); + typeMap.put(SynThirdConsts.THIRD_TYPE_DING_To_Sys,SynThirdConsts.THIRD_TYPE_DING); + SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(typeMap.get(thirdTypeDing),SynThirdConsts.DATA_TYPE_USER,id); + if(synThirdInfoEntity!=null){ + synThirdInfoService.delete(synThirdInfoEntity); + } + } + + /** + * 本地删除用户、中间表 + * 不带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20220331 + * @param isBatch 是否批量(批量不受开关限制) + * @param thirdObjId 钉钉的用户ID + * @return + */ + @Override + public JSONObject deleteUserDingToSys(boolean isBatch, String thirdObjId) throws Exception { + BaseSystemInfo config = getDingTalkConfig(); +// String corpId = config.getDingSynAppKey(); +// String corpSecret = config.getDingSynAppSecret(); + // 单条记录执行时,受开关限制 + int dingIsSyn = isBatch ? 1 : config.getDingSynIsSynUser(); +// JSONObject tokenObject = new JSONObject(); +// String access_token = ""; + JSONObject retMsg = new JSONObject(); + SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoByThirdObjId(SynThirdConsts.THIRD_TYPE_DING_To_Sys,SynThirdConsts.DATA_TYPE_USER,thirdObjId); + String sysObjId = ""; + + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", "系统未设置单条同步"); + + // 支持同步 + if(synThirdInfoEntity!=null) { + sysObjId = synThirdInfoEntity.getSysObjId(); + if(isBatch || dingIsSyn==1) { + // 删除企业对应的用户 + if (!"".equals(String.valueOf(sysObjId)) && !"null".equals(String.valueOf(sysObjId))) { + // 获取用户信息 + UserEntity userEntity = userService.getInfo(sysObjId); + if(userEntity!=null){ + // 删除用户,更新为标记为不可登录 + // 禁用登录 + userEntity.setEnabledMark(0); + userEntity.setDescription("由于钉钉系统删除了该用户"); + + userService.update(userEntity.getId(), userEntity); + + // 同步成功,直接删除同步表记录 + synThirdInfoService.delete(synThirdInfoEntity); + }else{ + // 同步失败 + saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING_To_Sys), + Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), sysObjId, thirdObjId, SynThirdConsts.SYN_STATE_FAIL, retMsg.getString("error")); + } + }else{ + // 根据企业微信ID找不到相应的信息,直接删除同步表记录 + synThirdInfoService.delete(synThirdInfoEntity); + } + + }else{ + // 未设置单条同步,归并到未同步状态 + saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING_To_Sys), + Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), sysObjId, thirdObjId, SynThirdConsts.SYN_STATE_NO, "系统未设置同步"); + + retMsg.put("code", true); + retMsg.put("error", "系统未设置单条同步"); + } + } + + return retMsg; + } + + + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/SynThirdInfoServiceImpl.java b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/SynThirdInfoServiceImpl.java new file mode 100644 index 0000000..2bd7e80 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/SynThirdInfoServiceImpl.java @@ -0,0 +1,302 @@ +package jnpf.message.service.impl; + +import jnpf.base.service.SuperServiceImpl; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.dingtalk.api.response.OapiV2DepartmentGetResponse; +import jnpf.message.entity.SynThirdInfoEntity; +import jnpf.message.mapper.SynThirdInfoMapper; +import jnpf.message.model.message.DingTalkDeptModel; +import jnpf.message.service.SynThirdDingTalkService; +import jnpf.message.service.SynThirdInfoService; +import jnpf.base.util.SynDingTalkUtil; +import jnpf.message.util.SynThirdConsts; +import jnpf.message.util.SynThirdTotal; +import jnpf.permission.service.OrganizeService; +import jnpf.permission.service.UserService; +import jnpf.util.JsonUtil; +import jnpf.util.RandomUtil; +import jnpf.util.StringUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 第三方工具的公司-部门-用户同步表模型 + * + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021/4/23 17:33 + */ +@Service +public class SynThirdInfoServiceImpl extends SuperServiceImpl implements SynThirdInfoService { + @Autowired + private OrganizeService organizeApi; + @Autowired + private UserService userApi; + @Autowired + SynThirdDingTalkService synThirdDingTalkService; + + @Override + public List getList(String thirdType, String dataType) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().and(t->t.eq(SynThirdInfoEntity::getThirdType, Integer.valueOf(thirdType))); + queryWrapper.lambda().and(t->t.eq(SynThirdInfoEntity::getDataType, Integer.valueOf(dataType))); + queryWrapper.lambda().orderByAsc(SynThirdInfoEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public SynThirdInfoEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SynThirdInfoEntity::getId,id); + return this.getOne(queryWrapper); + } + + @Override + public void create(SynThirdInfoEntity entity) { + this.save(entity); + } + + @Override + public boolean update(String id, SynThirdInfoEntity entity) { + entity.setId(id); + return this.updateById(entity); + } + + @Override + public void delete(SynThirdInfoEntity entity) { + if(entity!=null){ + this.removeById(entity.getId()); + } + } + + @Override + public SynThirdInfoEntity getInfoBySysObjId(String thirdType,String dataType,String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().and(t->t.eq(SynThirdInfoEntity::getThirdType,thirdType)); + queryWrapper.lambda().and(t->t.eq(SynThirdInfoEntity::getDataType,dataType)); + queryWrapper.lambda().and(t->t.eq(SynThirdInfoEntity::getSysObjId,id)); + return this.getOne(queryWrapper); + } + + @Override + public SynThirdTotal getSynTotal(String thirdType, String dataType) { + String synType = dataType.equals(SynThirdConsts.DATA_TYPE_ORG) ? "组织" : "用户"; + Integer recordTotal = 0; + Long synSuccessCount = 0L; + Long synFailCount = 0L; + Long unSynCount = 0L; + Date synDate = null; + + // 获取列表数据 + List synList = getList(thirdType, dataType).stream().filter(t->t.getLastModifyTime() != null).collect(Collectors.toList()); + if(synList!=null && synList.size()>0){ + synSuccessCount = synList.stream().filter(t -> t.getEnabledMark().equals(SynThirdConsts.SYN_STATE_OK)).count(); + synFailCount = synList.stream().filter(t -> t.getEnabledMark().equals(SynThirdConsts.SYN_STATE_FAIL)).count(); + unSynCount = synList.stream().filter(t -> t.getEnabledMark().equals(SynThirdConsts.SYN_STATE_NO)).count(); + synDate = synList.stream().max(Comparator.comparing(u -> u.getLastModifyTime())).isPresent() ? synList.stream().max(Comparator.comparing(u -> u.getLastModifyTime())).get().getLastModifyTime() : null; + } + + // 获取本系统的组织、用户表的记录数 + if(dataType.equals(SynThirdConsts.DATA_TYPE_ORG)){ + // 获取组织(公司和部门)的记录数 + recordTotal = organizeApi.getList(false).size(); + }else{ + // 获取用户的记录数 + recordTotal = userApi.getList(false).size(); + } + + // 写入同步统计模型对象 + SynThirdTotal synThirdTotal = new SynThirdTotal(); + synThirdTotal.setSynType(synType); + synThirdTotal.setRecordTotal(recordTotal); + synThirdTotal.setSynSuccessCount(synSuccessCount); + synThirdTotal.setSynFailCount(synFailCount); + synThirdTotal.setUnSynCount(unSynCount); + synThirdTotal.setSynDate(synDate); + + return synThirdTotal; + } + + @Override + public List syncThirdInfoByType(String thirdToSysType, String dataTypeOrg, String SysToThirdType) { + + HashMap typeMap = new HashMap<>(); + typeMap.put(SysToThirdType,thirdToSysType); + typeMap.put(thirdToSysType,SysToThirdType); + + List synThirdInfoList = this.getList(thirdToSysType, dataTypeOrg); + List synThirdInfoDingList = this.getList( typeMap.get(thirdToSysType), dataTypeOrg); + + + List collectSource = synThirdInfoList.stream().filter(t -> StringUtil.isBlank(t.getThirdObjId()) || StringUtil.isBlank(t.getSysObjId())).map(t->t.getId()).collect(Collectors.toList()); + List collectTarget = synThirdInfoDingList.stream().filter(t -> StringUtil.isBlank(t.getThirdObjId()) || StringUtil.isBlank(t.getSysObjId())).map(t->t.getId()).collect(Collectors.toList()); + List deleteList = new ArrayList<>(); + deleteList.addAll(collectSource); + deleteList.addAll(collectTarget); +// List fails = this.selectAllFail(); +// deleteList.addAll(fails); + if(!deleteList.isEmpty()){ + + this.getBaseMapper().deleteBatchIds(deleteList); + } + + + synThirdInfoList = this.getList(thirdToSysType, dataTypeOrg); + synThirdInfoDingList = this.getList( typeMap.get(thirdToSysType), dataTypeOrg); + // 记录已经存在的组合 + HashMap existingMap = new HashMap<>(); + synThirdInfoList.forEach(k->{ + String tag = k.getThirdType() + "-" + k.getDataType() + "-" +k.getSysObjId() +"-"+k.getThirdObjId(); + existingMap.put(tag,true); + }); + synThirdInfoDingList.forEach(k->{ + String tag = k.getThirdType() + "-" + k.getDataType() + "-" +k.getSysObjId() +"-"+k.getThirdObjId(); + existingMap.put(tag,true); + }); + + + HashMap mapSource = new HashMap<>(); + HashMap mapTarget = new HashMap<>(); + String tag = ""; + for(SynThirdInfoEntity entity :synThirdInfoList){ +// if(collectSource.size()>0 && !collectSource.contains(entity.getId())){ + tag =entity.getSysObjId() +"-" + entity.getThirdObjId(); + mapSource.put(tag,entity); +// } + } + for(SynThirdInfoEntity entity :synThirdInfoDingList){ +// if(collectTarget.size()>0 && !collectTarget.contains(entity.getId())){ + tag =entity.getSysObjId() +"-" + entity.getThirdObjId(); + mapTarget.put(tag,entity); +// } + } + + // 同步记录 + List synThirdInfoAddList = new ArrayList<>(); + SynThirdInfoEntity addEntity = null; + if(mapSource.size()==0 && mapTarget.size()==0){ + return new ArrayList<>(); + }else if (mapSource.size()>0 && mapTarget.size()==0){ + for(String key : mapSource.keySet()){ + SynThirdInfoEntity synThirdInfoEntity = mapSource.get(key); + addEntity = JsonUtil.getJsonToBean(synThirdInfoEntity,SynThirdInfoEntity.class); + addEntity.setId(RandomUtil.uuId()); + addEntity.setThirdType(Integer.valueOf(typeMap.get(thirdToSysType))); + synThirdInfoAddList.add(addEntity); + } + + }else if (mapSource.size()==0 && mapTarget.size()>0){ + for(String key : mapTarget.keySet()){ + SynThirdInfoEntity synThirdInfoEntity = mapTarget.get(key); + addEntity = JsonUtil.getJsonToBean(synThirdInfoEntity,SynThirdInfoEntity.class); + addEntity.setId(RandomUtil.uuId()); + addEntity.setThirdType(Integer.valueOf(thirdToSysType)); + synThirdInfoAddList.add(addEntity); + } + }else{ + for(String key : mapSource.keySet()){ + if(!mapTarget.containsKey(key)){ + SynThirdInfoEntity synThirdInfoEntity = mapSource.get(key); + addEntity = JsonUtil.getJsonToBean(synThirdInfoEntity,SynThirdInfoEntity.class); + addEntity.setId(RandomUtil.uuId()); + addEntity.setThirdType(Integer.valueOf(typeMap.get(thirdToSysType))); + synThirdInfoAddList.add(addEntity); + } + } + for(String key : mapTarget.keySet()){ + if(!mapSource.containsKey(key)){ + SynThirdInfoEntity synThirdInfoEntity = mapTarget.get(key); + addEntity = JsonUtil.getJsonToBean(synThirdInfoEntity,SynThirdInfoEntity.class); + addEntity.setId(RandomUtil.uuId()); + addEntity.setThirdType(Integer.valueOf(thirdToSysType)); + synThirdInfoAddList.add(addEntity); + } + } + + } + + ArrayList addList = new ArrayList<>(); + if(synThirdInfoAddList.size() > 0 ){ + // 过滤 + synThirdInfoAddList.forEach(k->{ + String addTag = k.getThirdType() + "-" + k.getDataType() + "-" +k.getSysObjId() +"-"+k.getThirdObjId(); + if (existingMap.get(addTag)==null) { + addList.add(k); + } + }); + this.saveBatch(addList); + } + // 查找对应的数据 + synThirdInfoList = this.getList(thirdToSysType, dataTypeOrg); + return synThirdInfoList; + } + + private List selectAllFail() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().and(t->t.eq(SynThirdInfoEntity::getEnabledMark,"2")); + List lists = this.getBaseMapper().selectList(queryWrapper); + return lists.stream().map(t->t.getId()).collect(Collectors.toList()); + } + + @Override + public void initBaseDept(Long dingRootDeptId, String access_token, String thirdType) { + final String sysByThird = this.getSysByThird("1"); + // 判断是否在中间表存在 + JSONObject retMsg = new JSONObject(); + + if(StringUtil.isBlank(sysByThird)){ + if("22".equals(thirdType)){ + retMsg = SynDingTalkUtil.getDepartmentInfo(SynThirdConsts.DING_ROOT_DEPT_ID, access_token); + OapiV2DepartmentGetResponse.DeptGetResponse departmentInfo = (OapiV2DepartmentGetResponse.DeptGetResponse) retMsg.get("departmentInfo"); + DingTalkDeptModel model = JsonUtil.getJsonToBean(departmentInfo, DingTalkDeptModel.class); + retMsg = synThirdDingTalkService.createDepartmentDingToSys(true, model, access_token); + } +// if("11".equals(thirdType)){ +// retMsg = SynDingTalkUtil.getDepartmentInfo(SynThirdConsts.QY_ROOT_DEPT_ID, access_token); +// OapiV2DepartmentGetResponse.DeptGetResponse departmentInfo = (OapiV2DepartmentGetResponse.DeptGetResponse) retMsg.get("departmentInfo"); +// DingTalkDeptModel model = JsonUtil.getJsonToBean(departmentInfo, DingTalkDeptModel.class); +// retMsg = synThirdDingTalkService.createDepartmentDingToSys(true, model, access_token); +// } + } + } + + @Override + public boolean getBySysObjId(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SynThirdInfoEntity::getEnabledMark,"1"); + queryWrapper.lambda().eq(SynThirdInfoEntity::getSysObjId,id); + List list = this.getBaseMapper().selectList(queryWrapper); + if(list!=null && list.size() > 0){ + return true; + }else{ + return false; + } + } + + @Override + public String getSysByThird(String valueOf) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().isNotNull(SynThirdInfoEntity::getSysObjId); + queryWrapper.lambda().eq(SynThirdInfoEntity::getThirdObjId,valueOf); + List list = this.getBaseMapper().selectList(queryWrapper); + if(list!=null && !list.isEmpty()){ + return list.get(0).getSysObjId(); + } + return null; + } + + @Override + public SynThirdInfoEntity getInfoByThirdObjId(String thirdType,String dataType,String thirdObjId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().and(t->t.eq(SynThirdInfoEntity::getThirdType,thirdType)); + queryWrapper.lambda().and(t->t.eq(SynThirdInfoEntity::getDataType,dataType)); + queryWrapper.lambda().and(t->t.eq(SynThirdInfoEntity::getThirdObjId,thirdObjId)); + return this.getOne(queryWrapper); + } + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/SynThirdQyServiceImpl.java b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/SynThirdQyServiceImpl.java new file mode 100644 index 0000000..35dcfe2 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/SynThirdQyServiceImpl.java @@ -0,0 +1,3078 @@ +package jnpf.message.service.impl; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import jnpf.base.UserInfo; +import jnpf.base.entity.SysConfigEntity; +import jnpf.base.service.SysconfigService; +import jnpf.base.util.RegexUtils; +import jnpf.exception.WxErrorException; +import jnpf.message.entity.SynThirdInfoEntity; +import jnpf.message.model.message.DingTalkDeptModel; +import jnpf.message.model.message.QyWebChatDeptModel; +import jnpf.message.model.message.QyWebChatUserModel; +import jnpf.message.service.SynThirdInfoService; +import jnpf.message.service.SynThirdQyService; +import jnpf.base.util.SynQyWebChatUtil; +import jnpf.message.util.SynThirdConsts; +import jnpf.model.BaseSystemInfo; +import jnpf.permission.entity.OrganizeEntity; +import jnpf.permission.entity.PositionEntity; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.OrganizeService; +import jnpf.permission.service.PositionService; +import jnpf.permission.service.UserRelationService; +import jnpf.permission.service.UserService; +import jnpf.util.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.util.Assert; + +import java.text.ParseException; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 本系统的公司、部门、用户与企业微信的同步 + * + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021/4/27 11:12 + */ +@Component +public class SynThirdQyServiceImpl implements SynThirdQyService { + @Autowired + private UserProvider userProvider; + @Autowired + private SysconfigService sysconfigService; + @Autowired + private SynThirdInfoService synThirdInfoService; + @Autowired + private UserService userService; + @Autowired + private PositionService positionService; + @Autowired + private OrganizeService organizeService; + @Autowired + private UserRelationService userRelationService; + /** + * 获取企业微信的配置信息 + * @return + */ + @Override + public BaseSystemInfo getQyhConfig() { + Map objModel = new HashMap<>(); + List configList = sysconfigService.getList("SysConfig"); + for (SysConfigEntity entity : configList) { + objModel.put(entity.getFkey(), entity.getValue()); + } + BaseSystemInfo baseSystemInfo = JsonUtil.getJsonToBean(objModel, BaseSystemInfo.class); + return baseSystemInfo; + } + + //------------------------------------本系统同步公司、部门到企业微信------------------------------------- + + /** + * 根据部门的同步表信息判断同步情况 + * 有带第三方错误定位判断的功能代码 20210604 + * @param synThirdInfoEntity + * @param qyDeptList + * @return + */ +// public JSONObject checkDepartmentSysToQy(SynThirdInfoEntity synThirdInfoEntity, List qyDeptList) { +// JSONObject retMsg = new JSONObject(); +// retMsg.put("code",true); +// retMsg.put("flag",""); +// retMsg.put("error",""); +// +// if(synThirdInfoEntity!=null){ +// if(StringUtil.isNotEmpty(synThirdInfoEntity.getThirdObjId())) { +// // 同步表存在企业微信ID,仍需要判断企业微信上有没此部门 +// if(qyDeptList.stream().filter(t -> t.getId().toString().equals(synThirdInfoEntity.getThirdObjId())).count() == 0 ? true : false){ +// retMsg.put("code",false); +// retMsg.put("flag","1"); +// retMsg.put("error","企业微信不存在同步表对应的部门ID!"); +// } +// }else{ +// // 同步表的企业微信ID为空 +// retMsg.put("code",false); +// retMsg.put("flag","2"); +// retMsg.put("error","同步表中部门对应的企业微信ID为空!"); +// } +// }else{ +// // 上级部门未同步 +// retMsg.put("code",false); +// retMsg.put("flag","3"); +// retMsg.put("error","部门未同步到企业微信!"); +// } +// +// return retMsg; +// } + + /** + * 根据部门的同步表信息判断同步情况 + * 不带第三方错误定位判断的功能代码 20210604 + * @param synThirdInfoEntity + * @return + */ + public JSONObject checkDepartmentSysToQy(SynThirdInfoEntity synThirdInfoEntity) { + JSONObject retMsg = new JSONObject(); + retMsg.put("code",true); + retMsg.put("flag",""); + retMsg.put("error",""); + + if(synThirdInfoEntity!=null){ + // 同步表的企业微信ID为空 + if("".equals(String.valueOf(synThirdInfoEntity.getThirdObjId())) || "null".equals(String.valueOf(synThirdInfoEntity.getThirdObjId()))) { + retMsg.put("code",false); + retMsg.put("flag","2"); + retMsg.put("error","同步表中部门对应的企业微信ID为空!"); + } + + }else{ + // 上级部门未同步 + retMsg.put("code",false); + retMsg.put("flag","3"); + retMsg.put("error","部门未同步到企业微信!"); + } + + return retMsg; + } + + + + /** + * 同步到企业微信的部门名称、部门英文名称是否重复 + * 有带第三方错误定位判断的功能代码 20210604 + * @param isEnglish + * @param name + * @param parentId + * @param id + * @param qyDeptList + * @return + */ +// public JSONObject checkDeptObjectNameSysToQy(boolean isEnglish, String name, String parentId, String id, List qyDeptList, +// String opType, SynThirdInfoEntity synThirdInfoEntity, Integer thirdType, +// Integer dataType, String sysObjId, String thirdObjId, String deptFlag){ +// boolean isDiff = false; +// JSONObject retMsg = new JSONObject(); +// retMsg.put("code",true); +// retMsg.put("error",""); +// +// // 创建时:判断同一个层级的部门名称、部门英文名称不能重复 +// if(StringUtil.isEmpty(id)){ +// isDiff = qyDeptList.stream().filter(t -> t.getName().equals(name) && t.getParentid().toString().equals(parentId)).count() > 0 ? true : false; +// }else{ +// isDiff = qyDeptList.stream().filter(t -> t.getName().equals(name) && t.getParentid().toString().equals(parentId) && !(t.getId().toString().equals(id)) ).count() > 0 ? true : false; +// } +// if(isDiff){ +// // 同步失败 +// Integer synState = SynThirdConsts.SYN_STATE_FAIL; +// String description = deptFlag + (isEnglish ? "同一层次的部门英文名称重复" : "同一层次的部门名称重复"); +// +// // 更新同步表 +// saveSynThirdInfoEntity(opType,synThirdInfoEntity,thirdType,dataType,sysObjId,thirdObjId,synState,description); +// +// retMsg.put("code", false); +// retMsg.put("error",description); +// } +// return retMsg; +// } + + /** + * 检查部门中文名称与英文名称是否相同 + * @param cnName + * @param EnName + * @param opType + * @param synThirdInfoEntity + * @param thirdType + * @param dataType + * @param sysObjId + * @param thirdObjId + * @param deptFlag + * @return + */ + public JSONObject checkCnEnName(String cnName, String EnName, + String opType, SynThirdInfoEntity synThirdInfoEntity, Integer thirdType, + Integer dataType, String sysObjId, String thirdObjId, String deptFlag){ + JSONObject retMsg = new JSONObject(); + retMsg.put("code",true); + retMsg.put("error",""); + if(cnName.equals(EnName)){ + // 同步失败 + Integer synState = SynThirdConsts.SYN_STATE_FAIL; + String description = deptFlag + "部门中文名称与英文名称不能相同"; + + // 更新同步表 + saveSynThirdInfoEntity(opType,synThirdInfoEntity,thirdType,dataType,sysObjId,thirdObjId,synState,description); + + retMsg.put("code", false); + retMsg.put("error", description); + } + return retMsg; + } + + + + /** + * 将组织、用户的信息写入同步表 + * @param opType "add":创建 “upd”:修改 + * @param synThirdInfoEntity 本地同步表信息 + * @param thirdType 第三方类型 + * @param dataType 数据类型 + * @param sysObjId 本地对象ID + * @param thirdObjId 第三方对象ID + * @param synState 同步状态(0:未同步;1:同步成功;2:同步失败) + * @param description + */ + public void saveSynThirdInfoEntity(String opType, SynThirdInfoEntity synThirdInfoEntity, Integer thirdType, + Integer dataType, String sysObjId, String thirdObjId, Integer synState, + String description) { + UserInfo userInfo = userProvider.get(); + SynThirdInfoEntity entity = new SynThirdInfoEntity(); + String compValue = SynThirdConsts.OBJECT_OP_ADD; + if(compValue.equals(opType)) { + entity.setId(RandomUtil.uuId()); + entity.setThirdType(thirdType); + entity.setDataType(dataType); + entity.setSysObjId(sysObjId); + entity.setThirdObjId(thirdObjId); + entity.setEnabledMark(synState); + // 备注当作同步失败信息来用 + entity.setDescription(description); + entity.setCreatorUserId(userInfo.getUserId()); + entity.setCreatorTime(DateUtil.getNowDate()); + entity.setLastModifyUserId(userInfo.getUserId()); + // 修改时间当作最后同步时间来用 + entity.setLastModifyTime(DateUtil.getNowDate()); + synThirdInfoService.create(entity); + }else{ + entity = synThirdInfoEntity; + entity.setThirdType(thirdType); + entity.setDataType(dataType); + entity.setThirdObjId(thirdObjId); + entity.setEnabledMark(synState); + // 备注当作同步失败信息来用 + entity.setDescription(description); + entity.setLastModifyUserId(userInfo.getUserId()); + // 修改时间当作最后同步时间来用 + entity.setLastModifyTime(DateUtil.getNowDate()); + synThirdInfoService.update(entity.getId(), entity); + } + } + + /** + * 往企业微信创建部门 + * 有带错误定位判断的功能代码 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @return + * @throws WxErrorException + */ +// @Override +// public JSONObject createDepartmentSysToQy(boolean isBatch, OrganizeEntity deptEntity) throws WxErrorException { +// BaseSystemInfo config = getQyhConfig(); +// String corpId = config.getQyhCorpId(); +// String corpSecret = config.getQyhCorpSecret(); +// String compValue = SynThirdConsts.OBJECT_TYPE_COMPANY; +// // 单条记录执行时,受开关限制 +// int qyhIsSyn = isBatch ? 1 : config.getQyhIsSynOrg(); +// JSONObject tokenObject = new JSONObject(); +// String access_token = ""; +// JSONObject retMsg = new JSONObject(); +// JSONObject object = new JSONObject(); +// List qyDeptList = new ArrayList<>(); +// String thirdObjId = ""; +// Integer synState = 0; +// String description = ""; +// boolean isDeptDiff = true; +// String deptFlag = "创建:"; +// +// // 返回值初始化 +// retMsg.put("code", true); +// retMsg.put("error", "创建:系统未设置单条同步"); +// +// // 支持同步 +// if(qyhIsSyn==1){ +// // 获取 access_token 值 +// tokenObject = SynQyWebChatUtil.getAccessToken(corpId, corpSecret); +// access_token = tokenObject.getString("access_token"); +// +// if (access_token != null && !"".equals(access_token)) { +// // 获取企业微信上的所有部门列表信息 +// JSONObject deptObject = SynQyWebChatUtil.getDepartmentList(SynThirdConsts.QY_ROOT_DEPT_ID,access_token); +// if(deptObject.getBoolean("code")) { +// qyDeptList = JsonUtil.getJsonToList(deptObject.getString("department"), QyWebChatDeptModel.class); +// }else{ +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = deptFlag + "获取企业微信的部门列表信息失败"; +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// retMsg.put("retDeptId", "0"); +// +// // 更新同步表 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_ADD,null,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,synState,description); +// +// return retMsg; +// } +// +// object.put("id", null); +// // name:必填项,同一个层级的部门名称不能重复 +// // name_en:必填项,同一个层级的部门名称不能重复 +// // name与name_en的值不能相同,否则会报错, 20210429 +// object.put("name", deptEntity.getFullName()); +// object.put("name_en", deptEntity.getEnCode()); +// // 从本地数据库的同步表获取对应的企业微信ID,为空报异常,不为空再验证所获取接口部门列表是否当前ID 未处理 +// if(compValue.equals(deptEntity.getCategory()) && "-1".equals(deptEntity.getParentId())){ +// //顶级节点时,企业微信的父节点设置为1 +// object.put("parentid", 1); +// }else{ +// SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_ORG,deptEntity.getParentId()); +// +// retMsg = checkDepartmentSysToQy(synThirdInfoEntity,qyDeptList); +// isDeptDiff = retMsg.getBoolean("code"); +// if(isDeptDiff) { +// object.put("parentid", synThirdInfoEntity.getThirdObjId()); +// } +// } +// object.put("order", deptEntity.getSortCode()); +// +// // 创建时:部门中文名称与英文名称不能相同 +// retMsg = checkCnEnName(object.getString("name"),object.getString("name_en"),SynThirdConsts.OBJECT_OP_ADD,null, +// Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY),Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 创建时:判断同一个层级的部门中文名称不能重复 +// retMsg = checkDeptObjectNameSysToQy(false,object.getString("name"),object.getString("parentid"),thirdObjId,qyDeptList, +// SynThirdConsts.OBJECT_OP_ADD,null,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 创建时:判断同一个层级的部门英文名称不能重复 +// retMsg = checkDeptObjectNameSysToQy(true,object.getString("name_en"),object.getString("parentid"),thirdObjId,qyDeptList, +// SynThirdConsts.OBJECT_OP_ADD,null,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// if(isDeptDiff) { +// if(qyhIsSyn==1) { +// // 往企业微信写入公司或部门 +// retMsg = SynQyWebChatUtil.createDepartment(object.toJSONString(), access_token); +// +// // 往同步写入本系统与第三方的对应信息 +// if (retMsg.getBoolean("code")) { +// // 同步成功 +// thirdObjId = retMsg.getString("retDeptId"); +// synState = SynThirdConsts.SYN_STATE_OK; +// } else { +// // 同步失败 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = deptFlag + retMsg.getString("error"); +// } +// }else{ +// // 未设置单条同步,归并到未同步状态 +// // 未同步 +// synState = SynThirdConsts.SYN_STATE_NO; +// description = deptFlag + "系统未设置单条同步"; +// +// retMsg.put("code", true); +// retMsg.put("error", description); +// retMsg.put("retDeptId", "0"); +// } +// }else{ +// // 同步失败,上级部门无对应的企业微信ID +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = deptFlag + "部门所属的上级部门未同步到企业微信"; +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// retMsg.put("retDeptId", "0"); +// } +// }else{ +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = deptFlag + "access_token值为空,不能同步信息"; +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// retMsg.put("retDeptId", "0"); +// } +// } +// +// // 更新同步表 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_ADD,null,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,synState,description); +// +// return retMsg; +// } + + + /** + * 往企业微信更新部门 + * 有带错误定位判断的功能代码 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @return + * @throws WxErrorException + */ +// @Override +// public JSONObject updateDepartmentSysToQy(boolean isBatch, OrganizeEntity deptEntity) throws WxErrorException { +// BaseSystemInfo config = getQyhConfig(); +// String corpId = config.getQyhCorpId(); +// String corpSecret = config.getQyhCorpSecret(); +// String compValue = SynThirdConsts.OBJECT_TYPE_COMPANY; +// // 单条记录执行时,受开关限制 +// int qyhIsSyn = isBatch ? 1 : config.getQyhIsSynOrg(); +// JSONObject tokenObject = new JSONObject(); +// String access_token = ""; +// JSONObject retMsg = new JSONObject(); +// JSONObject object = new JSONObject(); +// List qyDeptList = new ArrayList<>(); +// SynThirdInfoEntity synThirdInfoEntity = new SynThirdInfoEntity(); +// String opType = ""; +// Integer synState = 0; +// String description = ""; +// String thirdObjId = ""; +// SynThirdInfoEntity synThirdInfoPara = new SynThirdInfoEntity(); +// boolean isDeptDiff = true; +// String deptFlag = "更新:"; +// +// // 返回值初始化 +// retMsg.put("code", true); +// retMsg.put("error", "系统未设置单条同步"); +// +// // 支持同步,设置需要同步到企业微信的对象属性值 +// if(qyhIsSyn==1) { +// // 获取 access_token +// tokenObject = SynQyWebChatUtil.getAccessToken(corpId, corpSecret); +// access_token = tokenObject.getString("access_token"); +// +// // 获取同步表信息 +// synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_ORG,deptEntity.getId()); +// +// if (access_token != null && !"".equals(access_token)) { +// // 获取企业微信上的所有部门列表信息 +// JSONObject deptObject = SynQyWebChatUtil.getDepartmentList(SynThirdConsts.QY_ROOT_DEPT_ID,access_token); +// if(deptObject.getBoolean("code")) { +// qyDeptList = JsonUtil.getJsonToList(deptObject.getString("department"), QyWebChatDeptModel.class); +// }else{ +// if(synThirdInfoEntity!=null){ +// // 修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// }else{ +// // 写入同步表 +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// } +// +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = deptFlag + "获取企业微信的部门列表信息失败"; +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// +// // 更新同步表 +// saveSynThirdInfoEntity(opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,synState,description); +// +// return retMsg; +// } +// +// object.put("id", null); +// object.put("name", deptEntity.getFullName()); +// object.put("name_en", deptEntity.getEnCode()); +// // 从本地数据库的同步表获取对应的企业微信ID,为空报异常,不为空再验证所获取接口部门列表是否当前ID 未处理 +// if(compValue.equals(deptEntity.getCategory()) && "-1".equals(deptEntity.getParentId())){ +// //顶级节点时,企业微信的父节点设置为1 +// object.put("parentid", 1); +// } else { +// // 判断上级部门的合法性 +// synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_ORG,deptEntity.getParentId()); +// retMsg = checkDepartmentSysToQy(synThirdInfoEntity, qyDeptList); +// isDeptDiff = retMsg.getBoolean("code"); +// if (isDeptDiff) { +// object.put("parentid", synThirdInfoEntity.getThirdObjId()); +// } +// } +// object.put("order", deptEntity.getSortCode()); +// +// // 上级部门检查是否异常 +// if(isDeptDiff){ +// // 获取同步表信息 +// synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_ORG,deptEntity.getId()); +// +// // 判断当前部门对应的第三方的合法性 +// retMsg = checkDepartmentSysToQy(synThirdInfoEntity, qyDeptList); +// if (!retMsg.getBoolean("code")) { +// if ("3".equals(retMsg.getString("flag")) || "1".equals(retMsg.getString("flag"))) { +// // flag:3 未同步,需要创建同步到企业微信、写入同步表 +// // flag:1 已同步但第三方上没对应的ID,需要删除原来的同步信息,再创建同步到企业微信、写入同步表 +// if("1".equals(retMsg.getString("flag"))) { +// synThirdInfoService.delete(synThirdInfoEntity); +// } +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// +// // 部门中文名称与英文名称不能相同 +// retMsg = checkCnEnName(object.getString("name"),object.getString("name_en"), +// opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 判断同一个层级的部门中文名称不能重复 +// retMsg = checkDeptObjectNameSysToQy(false,object.getString("name"),object.getString("parentid"),thirdObjId,qyDeptList, +// opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 判断同一个层级的部门英文名称不能重复 +// retMsg = checkDeptObjectNameSysToQy(true,object.getString("name_en"),object.getString("parentid"),thirdObjId,qyDeptList, +// opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 往企业微信写入公司或部门 +// retMsg = SynQyWebChatUtil.createDepartment(object.toJSONString(), access_token); +// +// // 往同步写入本系统与第三方的对应信息 +// if(retMsg.getBoolean("code")) { +// // 同步成功 +// thirdObjId = retMsg.getString("retDeptId"); +// synState = SynThirdConsts.SYN_STATE_OK; +// description = ""; +// }else{ +// // 同步失败 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = deptFlag + retMsg.getString("error"); +// } +// } +// +// if ("2".equals(retMsg.getString("flag"))) { +// // flag:2 已同步但第三方ID为空,需要创建同步到企业微信、修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = ""; +// +// // 部门中文名称与英文名称不能相同 +// retMsg = checkCnEnName(object.getString("name"),object.getString("name_en"), +// opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 判断同一个层级的部门中文名称不能重复 +// retMsg = checkDeptObjectNameSysToQy(false,object.getString("name"),object.getString("parentid"),thirdObjId,qyDeptList, +// opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 判断同一个层级的部门英文名称不能重复 +// retMsg = checkDeptObjectNameSysToQy(true,object.getString("name_en"),object.getString("parentid"),thirdObjId,qyDeptList, +// opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 往企业微信写入公司或部门 +// retMsg = SynQyWebChatUtil.createDepartment(object.toJSONString(), access_token); +// +// // 往同步表更新本系统与第三方的对应信息 +// if (retMsg.getBoolean("code")) { +// // 同步成功 +// thirdObjId = retMsg.getString("retDeptId"); +// synState = SynThirdConsts.SYN_STATE_OK; +// description = ""; +// } else { +// // 同步失败 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = deptFlag + retMsg.getString("error"); +// } +// } +// +// } else { +// // 更新同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// +// // 部门中文名称与英文名称不能相同 +// retMsg = checkCnEnName(object.getString("name"),object.getString("name_en"), +// opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 判断同一个层级的部门中文名称不能重复 +// retMsg = checkDeptObjectNameSysToQy(false,object.getString("name"),object.getString("parentid"),thirdObjId,qyDeptList, +// opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 判断同一个层级的部门英文名称不能重复 +// retMsg = checkDeptObjectNameSysToQy(true,object.getString("name_en"),object.getString("parentid"),thirdObjId,qyDeptList, +// opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 往企业微信写入公司或部门 +// object.put("id", synThirdInfoEntity.getThirdObjId()); +// retMsg = SynQyWebChatUtil.updateDepartment(object.toJSONString(), access_token); +// +// // 往同步表更新本系统与第三方的对应信息 +// if (retMsg.getBoolean("code")) { +// // 同步成功 +// synState = SynThirdConsts.SYN_STATE_OK; +// description = ""; +// } else { +// // 同步失败 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = deptFlag + retMsg.getString("error"); +// } +// } +// }else{ +// // 同步失败,上级部门检查有异常 +// if(synThirdInfoEntity!=null){ +// // 修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// }else{ +// // 写入同步表 +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// } +// +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = deptFlag + "上级部门无对应的企业微信ID"; +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// } +// +// }else{ +// // 同步失败 +// if(synThirdInfoEntity!=null){ +// // 修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// }else{ +// // 写入同步表 +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// } +// +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = deptFlag + "access_token值为空,不能同步信息"; +// +// retMsg.put("code", true); +// retMsg.put("error", description); +// } +// +// }else{ +// // 未设置单条同步,归并到未同步状态 +// // 获取同步表信息 +// synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_ORG,deptEntity.getId()); +// if(synThirdInfoEntity!=null){ +// // 修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// }else{ +// // 写入同步表 +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// } +// +// synState = SynThirdConsts.SYN_STATE_NO; +// description = deptFlag + "系统未设置单条同步"; +// +// retMsg.put("code", true); +// retMsg.put("error", description); +// } +// +// // 更新同步表 +// saveSynThirdInfoEntity(opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,synState,description); +// +// return retMsg; +// } + + /** + * 往企业微信删除部门 + * 有带错误定位判断的功能代码 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param id 本系统的公司或部门ID + * @return + * @throws WxErrorException + */ +// @Override +// public JSONObject deleteDepartmentSysToQy(boolean isBatch, String id) throws WxErrorException { +// BaseSystemInfo config = getQyhConfig(); +// String corpId = config.getQyhCorpId(); +// String corpSecret = config.getQyhCorpSecret(); +// // 单条记录执行时,受开关限制 +// int qyhIsSyn = isBatch ? 1 : config.getQyhIsSynOrg(); +// JSONObject tokenObject = new JSONObject(); +// String access_token = ""; +// JSONObject retMsg = new JSONObject(); +// List qyDeptList = new ArrayList<>(); +// SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_ORG,id); +// String deptFlag = "删除:"; +// +// // 返回值初始化 +// retMsg.put("code", true); +// retMsg.put("error", "系统未设置单条同步"); +// +// // 支持同步 +// if(synThirdInfoEntity!=null) { +// if(qyhIsSyn==1){ +// // 获取 access_token +// tokenObject = SynQyWebChatUtil.getAccessToken(corpId, corpSecret); +// access_token = tokenObject.getString("access_token"); +// +// if (access_token != null && !"".equals(access_token)) { +// // 获取企业微信上的所有部门列表信息 +// JSONObject deptObject = SynQyWebChatUtil.getDepartmentList(SynThirdConsts.QY_ROOT_DEPT_ID,access_token); +// if(deptObject.getBoolean("code")) { +// qyDeptList = JsonUtil.getJsonToList(deptObject.getString("department"), QyWebChatDeptModel.class); +// +// // 删除企业对应的部门 +// if (qyDeptList.stream().filter(t -> t.getId().toString().equals(synThirdInfoEntity.getThirdObjId())).count() > 0 ? true : false) { +// retMsg = SynQyWebChatUtil.deleteDepartment(synThirdInfoEntity.getThirdObjId(), access_token); +// if (retMsg.getBoolean("code")) { +// // 同步成功,直接删除同步表记录 +// synThirdInfoService.delete(synThirdInfoEntity); +// } else { +// // 同步失败 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_FAIL, deptFlag + retMsg.getString("error")); +// } +// }else{ +// // 根据企业微信ID找不到相应的信息,直接删除同步表记录 +// synThirdInfoService.delete(synThirdInfoEntity); +// } +// }else{ +// // 同步失败,获取部门列表失败 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_FAIL, deptFlag + "获取企业微信的部门列表信息失败"); +// +// retMsg.put("code", false); +// retMsg.put("error", deptFlag + "获取企业微信的部门列表信息失败"); +// } +// +// }else{ +// // 同步失败 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_FAIL, deptFlag + "access_token值为空,不能同步信息"); +// +// retMsg.put("code", false); +// retMsg.put("error", deptFlag + "access_token值为空,不能同步信息!"); +// } +// +// }else{ +// // 未设置单条同步,归并到未同步状态 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_NO, deptFlag + "系统未设置单条同步"); +// +// retMsg.put("code", true); +// retMsg.put("error", deptFlag + "系统未设置单条同步"); +// } +// } +// +// return retMsg; +// } + + + /** + * 往企业微信创建部门 + * 不带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @param accessToken (单条调用时为空) + * @return + * @throws WxErrorException + */ + @Override + public JSONObject createDepartmentSysToQy(boolean isBatch, OrganizeEntity deptEntity,String accessToken) throws WxErrorException { + BaseSystemInfo config = getQyhConfig(); + String corpId = config.getQyhCorpId(); + // 向企业微信插入数据需要另外token(凭证密钥) + String corpSecret = config.getQyhAgentSecret(); + String compValue = SynThirdConsts.OBJECT_TYPE_COMPANY; + // 单条记录执行时,受开关限制 + int qyhIsSyn = isBatch ? 1 : config.getQyhIsSynOrg(); + JSONObject tokenObject = new JSONObject(); + String access_token = ""; + JSONObject retMsg = new JSONObject(); + JSONObject object = new JSONObject(); + String thirdObjId = ""; + Integer synState = 0; + String description = ""; + boolean isDeptDiff = true; + String deptFlag = "创建:"; + + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", "创建:系统未设置单条同步"); + + // 支持同步 + if(isBatch || qyhIsSyn==1){ + if(isBatch){ + access_token = accessToken; + }else{ + // 获取 access_token 值 + tokenObject = SynQyWebChatUtil.getAccessToken(corpId, corpSecret); + access_token = tokenObject.getString("access_token"); + } + + if (access_token != null && !"".equals(access_token)) { + object.put("id", null); + // name:必填项,同一个层级的部门名称不能重复 + // name_en:必填项,同一个层级的部门名称不能重复 + // name与name_en的值不能相同,否则会报错, 20210429 + object.put("name", deptEntity.getFullName()); + object.put("name_en", deptEntity.getEnCode()); + // 从本地数据库的同步表获取对应的企业微信ID,为空报异常,不为空再验证所获取接口部门列表是否当前ID 未处理 + if(compValue.equals(deptEntity.getCategory()) && "-1".equals(deptEntity.getParentId())){ + //顶级节点时,企业微信的父节点设置为1 + object.put("parentid", 1); + }else{ + SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_ORG,deptEntity.getParentId()); + + retMsg = checkDepartmentSysToQy(synThirdInfoEntity); + isDeptDiff = retMsg.getBoolean("code"); + if(isDeptDiff) { + object.put("parentid", synThirdInfoEntity.getThirdObjId()); + } + } + object.put("order", deptEntity.getSortCode()); + + // 创建时:部门中文名称与英文名称不能相同 +// retMsg = checkCnEnName(object.getString("name"),object.getString("name_en"),SynThirdConsts.OBJECT_OP_ADD,null, +// Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY),Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } + + if(isDeptDiff) { + if(qyhIsSyn==1) { + // 往企业微信写入公司或部门 + if(!"-1".equals(deptEntity.getParentId())){ + retMsg = SynQyWebChatUtil.createDepartment(object.toJSONString(), access_token); + }else{ + retMsg.put("code", true); + retMsg.put("error", "顶级不同步,默认值id1"); + retMsg.put("retDeptId", "1"); + } + + // 往同步写入本系统与第三方的对应信息 + if (retMsg.getBoolean("code")) { + // 同步成功 + thirdObjId = retMsg.getString("retDeptId"); + synState = SynThirdConsts.SYN_STATE_OK; + } else { + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + retMsg.getString("error"); + } + }else{ + // 未设置单条同步,归并到未同步状态 + // 未同步 + synState = SynThirdConsts.SYN_STATE_NO; + description = deptFlag + "系统未设置单条同步"; + + retMsg.put("code", true); + retMsg.put("error", description); + retMsg.put("retDeptId", "0"); + } + }else{ + // 同步失败,上级部门无对应的企业微信ID + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + "部门所属的上级部门未同步到企业微信"; + + retMsg.put("code", false); + retMsg.put("error", description); + retMsg.put("retDeptId", "0"); + } + }else{ + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + "access_token值为空,不能同步信息"; + + retMsg.put("code", false); + retMsg.put("error", description); + retMsg.put("retDeptId", "0"); + } + } + + // 更新同步表 + saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_ADD,null,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), + Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,synState,description); + + return retMsg; + } + + + /** + * 往企业微信更新部门 + * 不带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @param accessToken (单条调用时为空) + * @return + * @throws WxErrorException + */ + @Override + public JSONObject updateDepartmentSysToQy(boolean isBatch, OrganizeEntity deptEntity,String accessToken) throws WxErrorException { + BaseSystemInfo config = getQyhConfig(); + String corpId = config.getQyhCorpId(); + // 向企业微信插入数据需要另外token(凭证密钥) + String corpSecret = config.getQyhAgentSecret(); + String compValue = SynThirdConsts.OBJECT_TYPE_COMPANY; + // 单条记录执行时,受开关限制 + int qyhIsSyn = isBatch ? 1 : config.getQyhIsSynOrg(); + JSONObject tokenObject = new JSONObject(); + String access_token = ""; + JSONObject retMsg = new JSONObject(); + JSONObject object = new JSONObject(); + SynThirdInfoEntity synThirdInfoEntity = new SynThirdInfoEntity(); + String opType = ""; + Integer synState = 0; + String description = ""; + String thirdObjId = ""; + SynThirdInfoEntity synThirdInfoPara = new SynThirdInfoEntity(); + boolean isDeptDiff = true; + String deptFlag = "更新:"; + + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", "系统未设置单条同步"); + + // 支持同步,设置需要同步到企业微信的对象属性值 + if(isBatch || qyhIsSyn==1) { + if(isBatch){ + access_token = accessToken; + }else{ + // 获取 access_token + tokenObject = SynQyWebChatUtil.getAccessToken(corpId, corpSecret); + access_token = tokenObject.getString("access_token"); + } + + // 获取同步表信息 + synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_ORG,deptEntity.getId()); + + if (access_token != null && !"".equals(access_token)) { + object.put("id", null); + object.put("name", deptEntity.getFullName()); + object.put("name_en", deptEntity.getEnCode()); + // 从本地数据库的同步表获取对应的企业微信ID,为空报异常,不为空再验证所获取接口部门列表是否当前ID 未处理 + if(compValue.equals(deptEntity.getCategory()) && "-1".equals(deptEntity.getParentId())){ + //顶级节点时,企业微信的父节点设置为1 + object.put("parentid", 1); + } else { + // 判断上级部门的合法性 + synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_ORG,deptEntity.getParentId()); + retMsg = checkDepartmentSysToQy(synThirdInfoEntity); + isDeptDiff = retMsg.getBoolean("code"); + if (isDeptDiff) { + object.put("parentid", synThirdInfoEntity.getThirdObjId()); + } + } + object.put("order", deptEntity.getSortCode()); + + // 上级部门检查是否异常 + if(isDeptDiff){ + // 获取同步表信息 + synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_ORG,deptEntity.getId()); + + // 判断当前部门对应的第三方的合法性 + retMsg = checkDepartmentSysToQy(synThirdInfoEntity); + if (!retMsg.getBoolean("code")) { + if ("3".equals(retMsg.getString("flag")) || "1".equals(retMsg.getString("flag"))) { + // flag:3 未同步,需要创建同步到企业微信、写入同步表 + // flag:1 已同步但第三方上没对应的ID,需要删除原来的同步信息,再创建同步到企业微信、写入同步表 + if("1".equals(retMsg.getString("flag"))) { + synThirdInfoService.delete(synThirdInfoEntity); + } + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + thirdObjId = ""; + + // 部门中文名称与英文名称不能相同 + retMsg = checkCnEnName(object.getString("name"),object.getString("name_en"), + opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), + Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); + if (!retMsg.getBoolean("code")) { + return retMsg; + } + + // 往企业微信写入公司或部门 + if(!"-1".equals(deptEntity.getParentId())){ + retMsg = SynQyWebChatUtil.createDepartment(object.toJSONString(), access_token); + } + + // 往同步写入本系统与第三方的对应信息 + if(retMsg.getBoolean("code")) { + // 同步成功 + thirdObjId = retMsg.getString("retDeptId"); + synState = SynThirdConsts.SYN_STATE_OK; + description = ""; + }else{ + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + retMsg.getString("error"); + } + } + + if ("2".equals(retMsg.getString("flag"))) { + // flag:2 已同步但第三方ID为空,需要创建同步到企业微信、修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = ""; + + // 部门中文名称与英文名称不能相同 + retMsg = checkCnEnName(object.getString("name"),object.getString("name_en"), + opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), + Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); + if (!retMsg.getBoolean("code")) { + return retMsg; + } + + // 往企业微信写入公司或部门 + if(!"-1".equals(deptEntity.getParentId())){ + retMsg = SynQyWebChatUtil.createDepartment(object.toJSONString(), access_token); + } + + // 往同步表更新本系统与第三方的对应信息 + if (retMsg.getBoolean("code")) { + // 同步成功 + thirdObjId = retMsg.getString("retDeptId"); + synState = SynThirdConsts.SYN_STATE_OK; + description = ""; + } else { + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + retMsg.getString("error"); + } + } + + } else { + // 更新同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + + // 部门中文名称与英文名称不能相同 + retMsg = checkCnEnName(object.getString("name"),object.getString("name_en"), + opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), + Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); + if (!retMsg.getBoolean("code")) { + return retMsg; + } + + // 往企业微信写入公司或部门 + object.put("id", synThirdInfoEntity.getThirdObjId()); + if(!"-1".equals(deptEntity.getParentId())){ + retMsg = SynQyWebChatUtil.updateDepartment(object.toJSONString(), access_token); + } + + // 往同步表更新本系统与第三方的对应信息 + if (retMsg.getBoolean("code")) { + // 同步成功 + synState = SynThirdConsts.SYN_STATE_OK; + description = ""; + } else { + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + retMsg.getString("error"); + } + } + }else{ + // 同步失败,上级部门检查有异常 + if(synThirdInfoEntity!=null){ + // 修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + }else{ + // 写入同步表 + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + thirdObjId = ""; + } + + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + "上级部门无对应的企业微信ID"; + + retMsg.put("code", false); + retMsg.put("error", description); + } + + }else{ + // 同步失败 + if(synThirdInfoEntity!=null){ + // 修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + }else{ + // 写入同步表 + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + thirdObjId = ""; + } + + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + "access_token值为空,不能同步信息"; + + retMsg.put("code", true); + retMsg.put("error", description); + } + + }else{ + // 未设置单条同步,归并到未同步状态 + // 获取同步表信息 + synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_ORG,deptEntity.getId()); + if(synThirdInfoEntity!=null){ + // 修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + }else{ + // 写入同步表 + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + thirdObjId = ""; + } + + synState = SynThirdConsts.SYN_STATE_NO; + description = deptFlag + "系统未设置单条同步"; + + retMsg.put("code", true); + retMsg.put("error", description); + } + + // 更新同步表 + saveSynThirdInfoEntity(opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), + Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,synState,description); + + return retMsg; + } + + /** + * 往企业微信删除部门 + * 不带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param id 本系统的公司或部门ID + * @param accessToken (单条调用时为空) + * @return + * @throws WxErrorException + */ + @Override + public JSONObject deleteDepartmentSysToQy(boolean isBatch, String id,String accessToken) throws WxErrorException { + BaseSystemInfo config = getQyhConfig(); + String corpId = config.getQyhCorpId(); + String corpSecret = config.getQyhCorpSecret(); + // 单条记录执行时,受开关限制 + int qyhIsSyn = isBatch ? 1 : config.getQyhIsSynOrg(); + JSONObject tokenObject = new JSONObject(); + String access_token = ""; + JSONObject retMsg = new JSONObject(); + SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_ORG,id); + String deptFlag = "删除:"; + + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", "系统未设置单条同步"); + + // 支持同步 + if(synThirdInfoEntity!=null) { + if(qyhIsSyn==1){ + if(isBatch){ + access_token = accessToken; + }else{ + // 获取 access_token + tokenObject = SynQyWebChatUtil.getAccessToken(corpId, corpSecret); + access_token = tokenObject.getString("access_token"); + } + + if (access_token != null && !"".equals(access_token)) { + if (!"".equals(String.valueOf(synThirdInfoEntity.getThirdObjId())) && !"null".equals(String.valueOf(synThirdInfoEntity.getThirdObjId()))) { + retMsg = SynQyWebChatUtil.deleteDepartment(synThirdInfoEntity.getThirdObjId(), access_token); + if (retMsg.getBoolean("code")) { + // 同步成功,直接删除同步表记录 + synThirdInfoService.delete(synThirdInfoEntity); + } else { + // 同步失败 + saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), + Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_FAIL, deptFlag + retMsg.getString("error")); + } + }else{ + // 根据企业微信ID找不到相应的信息,直接删除同步表记录 + synThirdInfoService.delete(synThirdInfoEntity); + } + }else{ + // 同步失败 + saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), + Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_FAIL, deptFlag + "access_token值为空,不能同步信息"); + + retMsg.put("code", false); + retMsg.put("error", deptFlag + "access_token值为空,不能同步信息!"); + } + + }else{ + // 未设置单条同步,归并到未同步状态 + saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), + Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_NO, deptFlag + "系统未设置单条同步"); + + retMsg.put("code", true); + retMsg.put("error", deptFlag + "系统未设置单条同步"); + } + } + + return retMsg; + } + + + //------------------------------------本系统同步用户到企业微信------------------------------------- + + /** + * 获取企业微信的单个成员列表,用于更新成员信息使用 + * @param id + * @param accessToken + * @return + * @throws WxErrorException + */ + public QyWebChatUserModel getQyUserById(String id, String accessToken) throws WxErrorException { + QyWebChatUserModel userModel = new QyWebChatUserModel(); + JSONObject userObject = SynQyWebChatUtil.getUserById(id,accessToken); + if(userObject.getBoolean("code")) { + userModel = JsonUtil.getJsonToBean(userObject.getString("userinfo"), QyWebChatUserModel.class); + } + return userModel; + } + + /** + * 设置需要提交给企业微信接口的单个成品JSON信息 + * 有带第三方错误定位判断的功能代码 20210604 + * @param userEntity 本地用户信息 + * @param qyDeptList 企业微信的部门信息 + * @param qyWebChatUserModel + * @return + */ +// public JSONObject setQyUserObject(UserEntity userEntity, List qyDeptList, QyWebChatUserModel qyWebChatUserModel) { +// List userList = userService.getList(); +// JSONObject object = new JSONObject(); +// JSONObject retMsg = new JSONObject(); +// retMsg.put("code", true); +// retMsg.put("error", ""); +// +// // 验证邮箱格式的合法性 +// if(StringUtil.isNotEmpty(userEntity.getEmail())){ +// if(!RegexUtils.checkEmail(userEntity.getEmail())){ +// retMsg.put("code", false); +// retMsg.put("error", "邮箱格式不合法!"); +// retMsg.put("qyUserObject", ""); +// return retMsg; +// } +// } +// +// object.put("userid", userEntity.getId()); +// object.put("name", userEntity.getRealName()); +// object.put("mobile",userEntity.getMobilePhone()); +// +// SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_ORG,userEntity.getOrganizeId()); +// retMsg = checkDepartmentSysToQy(synThirdInfoEntity,qyDeptList); +// if(retMsg.getBoolean("code")){ +// String formatString = "[%s]"; +// object.put("department",String.format(formatString,synThirdInfoEntity.getThirdObjId())); +// object.put("main_department",synThirdInfoEntity.getThirdObjId()); +// QyWebChatDeptModel qyWebChatDeptModel = qyDeptList.stream().filter(t -> t.getId().toString().equals(synThirdInfoEntity.getThirdObjId())).findFirst().orElse(null); +// object.put("order",String.format(formatString,qyWebChatDeptModel.getOrder())); +// String isLeader = userList.stream().filter(t -> t.getOrganizeId().equals(userEntity.getOrganizeId()) && t.getManagerId().equals(userEntity.getId()) ).count()==0 ? "0" : "1"; +// object.put("is_leader_in_dept",String.format(formatString,isLeader)); +// }else{ +// retMsg.put("code", false); +// retMsg.put("error", "部门找不到对应的企业微信ID!"); +// retMsg.put("qyUserObject", ""); +// return retMsg; +// } +// object.put("email",userEntity.getEmail()); +// PositionEntity positionEntity = positionService.getInfo(userEntity.getPositionId()); +// if(positionEntity!=null){ +// object.put("position",positionEntity.getFullName()); +// }else{ +// object.put("position",""); +// } +// object.put("gender",userEntity.getGender().toString()); +// object.put("telephone",userEntity.getTelePhone()); +// object.put("enable",userEntity.getEnabledMark()); +// JSONObject extattr = new JSONObject(); +// extattr.put("attrs","[]"); +// object.put("extattr",extattr.toJSONString()); +//// // 创建企业微信成员时才会赋值的 +//// object.put("to_invite", true); +// object.put("address",userEntity.getPostalAddress()); +// object.put("alias",""); +// object.put("avatar_mediaid",""); +// JSONObject external_profile = new JSONObject(); +// external_profile.put("external_corp_name",""); +// external_profile.put("external_attr","[]"); +// object.put("external_profile",external_profile.toJSONString()); +// object.put("external_position",""); +// +// // 修改时:未更新字段信息来源企业微信 +// if(qyWebChatUserModel!=null) { +// object.put("alias", qyWebChatUserModel.getAlias()); +// object.put("avatar_mediaid", qyWebChatUserModel.getAvatar_mediaid()); +// object.put("external_profile", qyWebChatUserModel.getExternal_profile()); +// object.put("external_position", qyWebChatUserModel.getExternal_position()); +// } +// +// String jsonString = object.toJSONString(); +// // 格式与用户的格式不一致就需要做处理,否则提交JSON格式验证无法通过 +// jsonString = jsonString.replaceAll("\\\\",""); +// jsonString = jsonString.replaceAll("\"\\{","{"); +// jsonString = jsonString.replaceAll("}\"","}"); +// jsonString = jsonString.replaceAll("\"\\[","["); +// jsonString = jsonString.replaceAll("\\]\"","]"); +// +// retMsg.put("qyUserObject", jsonString); +// return retMsg; +// } + + + /** + * 设置需要提交给企业微信接口的单个成品JSON信息 + * 不带第三方错误定位判断的功能代码 20210604 + * @param userEntity 本地用户信息 + * @param qyWebChatUserModel + * @return + */ + public JSONObject setQyUserObject(UserEntity userEntity,QyWebChatUserModel qyWebChatUserModel) { + List userList = userService.getList(false); + JSONObject object = new JSONObject(); + JSONObject retMsg = new JSONObject(); + retMsg.put("code", true); + retMsg.put("error", ""); + + // 验证邮箱格式的合法性 + if(StringUtil.isNotEmpty(userEntity.getEmail())){ + if(!RegexUtils.checkEmail(userEntity.getEmail())){ + retMsg.put("code", false); + retMsg.put("error", "邮箱格式不合法!"); + retMsg.put("qyUserObject", ""); + return retMsg; + } + } + + object.put("userid", userEntity.getId()); + object.put("name", userEntity.getRealName()); + object.put("mobile",userEntity.getMobilePhone()); + + SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_ORG,userEntity.getOrganizeId()); + retMsg = checkDepartmentSysToQy(synThirdInfoEntity); + if(retMsg.getBoolean("code")){ + String formatString = "[%s]"; + object.put("department",String.format(formatString,synThirdInfoEntity.getThirdObjId())); + object.put("main_department",synThirdInfoEntity.getThirdObjId()); +// QyWebChatDeptModel qyWebChatDeptModel = qyDeptList.stream().filter(t -> t.getId().toString().equals(synThirdInfoEntity.getThirdObjId())).findFirst().orElse(null); +// object.put("order",String.format(formatString,qyWebChatDeptModel.getOrder())); + String isLeader = userList.stream().filter(t -> userEntity.getOrganizeId().equals(t.getOrganizeId()) && userEntity.getId().equals(t.getManagerId()) ).count()==0 ? "0" : "1"; + object.put("is_leader_in_dept",String.format(formatString,isLeader)); + }else{ + retMsg.put("code", false); + retMsg.put("error", "部门找不到对应的企业微信ID!"); + retMsg.put("qyUserObject", ""); + return retMsg; + } + object.put("email",userEntity.getEmail()); + PositionEntity positionEntity = positionService.getInfo(userEntity.getPositionId()); + if(positionEntity!=null){ + object.put("position",positionEntity.getFullName()); + }else{ + object.put("position",""); + } + object.put("gender",userEntity.getGender().toString()); + object.put("telephone",userEntity.getTelePhone()); + object.put("enable",userEntity.getEnabledMark()); + JSONObject extattr = new JSONObject(); + extattr.put("attrs","[]"); + object.put("extattr",extattr.toJSONString()); +// // 创建企业微信成员时才会赋值的 +// object.put("to_invite", true); + object.put("address",userEntity.getPostalAddress()); + object.put("alias",""); + object.put("avatar_mediaid",""); + JSONObject external_profile = new JSONObject(); + external_profile.put("external_corp_name",""); + external_profile.put("external_attr","[]"); + object.put("external_profile",external_profile.toJSONString()); + object.put("external_position",""); + + // 修改时:未更新字段信息来源企业微信 + if(qyWebChatUserModel!=null) { + object.put("alias", qyWebChatUserModel.getAlias()); + object.put("avatar_mediaid", qyWebChatUserModel.getAvatar_mediaid()); + object.put("external_profile", qyWebChatUserModel.getExternal_profile()); + object.put("external_position", qyWebChatUserModel.getExternal_position()); + } + + String jsonString = object.toJSONString(); + // 格式与用户的格式不一致就需要做处理,否则提交JSON格式验证无法通过 + jsonString = jsonString.replaceAll("\\\\",""); + jsonString = jsonString.replaceAll("\"\\{","{"); + jsonString = jsonString.replaceAll("}\"","}"); + jsonString = jsonString.replaceAll("\"\\[","["); + jsonString = jsonString.replaceAll("\\]\"","]"); + + retMsg.put("qyUserObject", jsonString); + return retMsg; + } + + + /** + * 判断用户的手机号、邮箱是否唯一,企业微信不允许重复 + * @param mobile + * @param email + * @param userId + * @param qyUserList + * @param opType + * @param synThirdInfoEntity + * @param thirdType + * @param dataType + * @param sysObjId + * @param thirdObjId + * @param deptFlag + * @return + */ + public JSONObject checkUserMobileEmailRepeat(String mobile, String email, String userId, List qyUserList, + String opType, SynThirdInfoEntity synThirdInfoEntity, Integer thirdType, + Integer dataType, String sysObjId, String thirdObjId, String deptFlag){ + boolean isDiff = true; + String description = ""; + JSONObject retMsg = new JSONObject(); + + // 企业微信限制:手机号唯一性 + if(StringUtil.isNotEmpty(mobile)){ + if(StringUtil.isNotEmpty(userId)){ + if(qyUserList.stream().filter(t -> String.valueOf(t.getMobile()).equals(mobile) && !(t.getUserid().equals(userId))).count() > 0 ? true : false){ + isDiff = false; + description = deptFlag + "企业内已有绑定手机号:" + mobile; + } + }else{ + if(qyUserList.stream().filter(t -> String.valueOf(t.getMobile()).equals(mobile)).count() > 0 ? true : false){ + isDiff = false; + description = deptFlag + "企业内已有绑定手机号:" + mobile; + } + } + } + + // 企业微信限制:邮箱地址唯一性 + if(StringUtil.isNotEmpty(email)){ + if(StringUtil.isNotEmpty(userId)){ + if(qyUserList.stream().filter(t -> String.valueOf(t.getEmail()).equals(email) && !(t.getUserid().equals(userId))).count() > 0 ? true : false){ + isDiff = false; + description = deptFlag + "企业内已有绑定此邮箱:" + email; + } + }else{ + if(qyUserList.stream().filter(t -> String.valueOf(t.getEmail()).equals(email)).count() > 0 ? true : false){ + isDiff = false; + description = deptFlag + "企业内已有绑定此邮箱:" + email; + } + } + } + + retMsg.put("code",isDiff); + retMsg.put("error",description); + + if(!isDiff){ + // 同步失败 + Integer synState = SynThirdConsts.SYN_STATE_FAIL; + + // 更新同步表 + saveSynThirdInfoEntity(opType,synThirdInfoEntity,thirdType,dataType,sysObjId,thirdObjId,synState,description); + } + + return retMsg; + } + + /** + * 根据用户的同步表信息判断同步情况 + * 带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param synThirdInfoEntity + * @param qyUserList + * @return + */ +// public JSONObject checkUserSysToQy(SynThirdInfoEntity synThirdInfoEntity, List qyUserList) { +// JSONObject retMsg = new JSONObject(); +// retMsg.put("code",true); +// retMsg.put("flag",""); +// retMsg.put("error",""); +// +// if(synThirdInfoEntity!=null){ +// if(StringUtil.isNotEmpty(synThirdInfoEntity.getThirdObjId())) { +// // 同步表存在企业微信ID,仍需要判断企业微信上有没此用户 +// if(qyUserList.stream().filter(t -> t.getUserid().equals(synThirdInfoEntity.getThirdObjId())).count() == 0 ? true : false){ +// retMsg.put("code",false); +// retMsg.put("flag","1"); +// retMsg.put("error","企业微信不存在同步表对应的用户ID!"); +// } +// }else{ +// // 同步表的企业微信ID为空 +// retMsg.put("code",false); +// retMsg.put("flag","2"); +// retMsg.put("error","同步表中用户对应的第三方ID为空!"); +// } +// }else{ +// // 上级用户未同步 +// retMsg.put("code",false); +// retMsg.put("flag","3"); +// retMsg.put("error","用户未同步!"); +// } +// +// return retMsg; +// } + + /** + * 根据用户的同步表信息判断同步情况 + * 不带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param synThirdInfoEntity + * @return + */ + public JSONObject checkUserSysToQy(SynThirdInfoEntity synThirdInfoEntity) { + JSONObject retMsg = new JSONObject(); + retMsg.put("code",true); + retMsg.put("flag",""); + retMsg.put("error",""); + + if(synThirdInfoEntity!=null){ + if("".equals(String.valueOf(synThirdInfoEntity.getThirdObjId())) || "null".equals(String.valueOf(synThirdInfoEntity.getThirdObjId()))) { + // 同步表的企业微信ID为空 + retMsg.put("code",false); + retMsg.put("flag","2"); + retMsg.put("error","同步表中用户对应的第三方ID为空!"); + } + }else{ + // 上级用户未同步 + retMsg.put("code",false); + retMsg.put("flag","3"); + retMsg.put("error","用户未同步!"); + } + + return retMsg; + } + + + /** + * 往企业微信创建成员信息 + * 带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param userEntity + * @return + * @throws WxErrorException + */ +// @Override +// public JSONObject createUserSysToQy(boolean isBatch, UserEntity userEntity) throws WxErrorException { +// BaseSystemInfo config = getQyhConfig(); +// String corpId = config.getQyhCorpId(); +// String corpSecret = config.getQyhCorpSecret(); +// // 单条记录执行时,受开关限制 +// int qyhIsSyn = isBatch ? 1 : config.getQyhIsSynUser(); +// JSONObject tokenObject = SynQyWebChatUtil.getAccessToken(corpId, corpSecret); +// String access_token = tokenObject.getString("access_token"); +// JSONObject retMsg = new JSONObject(); +// String userObjectModel = ""; +// List qyDeptList = new ArrayList<>(); +// List qyUserList = new ArrayList<>(); +// String thirdObjId = ""; +// Integer synState = 0; +// String description = ""; +// String userFlag = "创建:"; +// +// // 返回值初始化 +// retMsg.put("code", true); +// retMsg.put("error", userFlag + "系统未设置单条同步"); +// +// // 企业微信限制:不能手机号、邮箱同时为空 +// if(StringUtil.isEmpty(userEntity.getMobilePhone()) && StringUtil.isEmpty(userEntity.getEmail()) && "1".equals(qyhIsSyn)){ +// retMsg.put("code", false); +// retMsg.put("error", userFlag + "企业微信不允许手机号、邮箱不能同时为空!"); +// } +// +// if (qyhIsSyn==1){ +// if(retMsg.getBoolean("code")){ +// if (access_token != null && !"".equals(access_token)) { +// // 获取企业微信上的所有部门列表信息 +// JSONObject deptObject = SynQyWebChatUtil.getDepartmentList(SynThirdConsts.QY_ROOT_DEPT_ID,access_token); +// if(deptObject.getBoolean("code")) { +// qyDeptList = JsonUtil.getJsonToList(deptObject.getString("department"), QyWebChatDeptModel.class); +// }else{ +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + "获取企业微信的部门列表信息失败"; +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// +// // 更新同步表 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_ADD, null, Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), userEntity.getId(), thirdObjId, synState, description); +// +// return retMsg; +// } +// +// // 获取企业微信上的所有成员列表信息 +// JSONObject userObject = SynQyWebChatUtil.getUserDetailList(SynThirdConsts.QY_ROOT_DEPT_ID,"1",access_token); +// if(userObject.getBoolean("code")) { +// qyUserList = JsonUtil.getJsonToList(userObject.getString("userlist"), QyWebChatUserModel.class); +// }else{ +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + "获取企业微信的成员列表信息失败"; +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// +// // 更新同步表 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_ADD, null, Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), userEntity.getId(), thirdObjId, synState, description); +// +// return retMsg; +// } +// +// // 判断用户的手机号、邮箱是否唯一,不能重复 +// retMsg = checkUserMobileEmailRepeat(userEntity.getMobilePhone(),userEntity.getEmail(),thirdObjId,qyUserList, +// SynThirdConsts.OBJECT_OP_ADD,null,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),userEntity.getId(),thirdObjId,userFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 要同步到企业微信的对象赋值 +// retMsg = setQyUserObject(userEntity, qyDeptList, null); +// if (retMsg.getBoolean("code")) { +// userObjectModel = retMsg.getString("qyUserObject"); +// // 往企业微信写入成员 +// retMsg = SynQyWebChatUtil.createUser(userObjectModel, access_token); +// +// // 往同步写入本系统与第三方的对应信息 +// if (retMsg.getBoolean("code")) { +// // 同步成功 +// thirdObjId = userEntity.getId(); +// synState = SynThirdConsts.SYN_STATE_OK; +// } else { +// // 同步失败 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + retMsg.getString("error"); +// } +// }else{ +// // 同步失败,原因:部门找不到对应的第三方ID、邮箱格式不合法 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + retMsg.getString("error"); +// } +// +// }else{ +// // 同步失败 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + "access_token值为空,不能同步信息"; +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// } +// +// }else { +// // 同步失败,原因:企业微信不允许手机号、邮箱不能同时为空 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + retMsg.getString("error"); +// } +// }else{ +// // 无须同步,未同步状态 +// synState = SynThirdConsts.SYN_STATE_NO; +// description = userFlag + "系统未设置单条同步"; +// +// retMsg.put("code", true); +// retMsg.put("error", description); +// } +// +// // 更新同步表 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_ADD, null, Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), userEntity.getId(), thirdObjId, synState, description); +// +// return retMsg; +// } + + + /** + * 往企业微信更新成员信息 + * 带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param userEntity + * @return + * @throws WxErrorException + */ +// @Override +// public JSONObject updateUserSysToQy(boolean isBatch, UserEntity userEntity) throws WxErrorException { +// BaseSystemInfo config = getQyhConfig(); +// String corpId = config.getQyhCorpId(); +// String corpSecret = config.getQyhCorpSecret(); +// // 单条记录执行时,受开关限制 +// int qyhIsSyn = isBatch ? 1 : config.getQyhIsSynUser(); +// JSONObject tokenObject = new JSONObject(); +// String access_token = ""; +// JSONObject retMsg = new JSONObject(); +// String userObjectModel = ""; +// List qyDeptList = new ArrayList<>(); +// List qyUserList = new ArrayList<>(); +// SynThirdInfoEntity synThirdInfoEntity = new SynThirdInfoEntity(); +// SynThirdInfoEntity entity = new SynThirdInfoEntity(); +// String opType = ""; +// SynThirdInfoEntity synThirdInfoPara = new SynThirdInfoEntity(); +// String thirdObjId = ""; +// Integer synState = 0; +// String description = ""; +// String userFlag = "更新:"; +// +// // 返回值初始化 +// retMsg.put("code", true); +// retMsg.put("error", userFlag + "系统未设置单条同步"); +// +// // 企业微信限制:不能手机号、邮箱同时为空 +// if(StringUtil.isEmpty(userEntity.getMobilePhone()) && StringUtil.isEmpty(userEntity.getEmail()) && "1".equals(qyhIsSyn)){ +// retMsg.put("code", false); +// retMsg.put("error", userFlag + "企业微信不允许手机号、邮箱不能同时为空!"); +// } +// +// // 支持同步 +// if (qyhIsSyn==1){ +// if(retMsg.getBoolean("code")){ +// // 获取 access_token +// tokenObject = SynQyWebChatUtil.getAccessToken(corpId, corpSecret); +// access_token = tokenObject.getString("access_token"); +// +// // 获取同步表信息 +// synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_USER,userEntity.getId()); +// if (access_token != null && !"".equals(access_token)) { +// // 获取企业微信上的所有部门列表信息 +// JSONObject deptObject = SynQyWebChatUtil.getDepartmentList(SynThirdConsts.QY_ROOT_DEPT_ID,access_token); +// if(deptObject.getBoolean("code")) { +// qyDeptList = JsonUtil.getJsonToList(deptObject.getString("department"), QyWebChatDeptModel.class); +// }else{ +// if(synThirdInfoEntity!=null){ +// // 修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// }else{ +// // 写入同步表 +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// } +// +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + "获取企业微信的部门列表信息失败"; +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// +// // 更新同步表 +// saveSynThirdInfoEntity(opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),userEntity.getId(),thirdObjId,synState,description); +// +// return retMsg; +// } +// +// // 获取企业微信上的所有成员列表信息 +// JSONObject userObject = SynQyWebChatUtil.getUserDetailList(SynThirdConsts.QY_ROOT_DEPT_ID,"1",access_token); +// if(userObject.getBoolean("code")) { +// qyUserList = JsonUtil.getJsonToList(userObject.getString("userlist"), QyWebChatUserModel.class); +// }else{ +// if(synThirdInfoEntity!=null){ +// // 修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// }else{ +// // 写入同步表 +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// } +// +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + "获取企业微信的成员列表信息失败"; +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// +// // 更新同步表 +// saveSynThirdInfoEntity(opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),userEntity.getId(),thirdObjId,synState,description); +// +// return retMsg; +// } +// +// // 要同步到企业微信的对象赋值 +// retMsg = setQyUserObject(userEntity,qyDeptList,null); +// if (retMsg.getBoolean("code")) { +// // 判断当前用户对应的第三方的合法性 +// userObjectModel = retMsg.getString("qyUserObject"); +// retMsg = checkUserSysToQy(synThirdInfoEntity, qyUserList); +// if (!retMsg.getBoolean("code")) { +// if("3".equals(retMsg.getString("flag")) || "1".equals(retMsg.getString("flag"))){ +// // flag:3 未同步,需要创建同步到企业微信、写入同步表 +// // flag:1 已同步但第三方上没对应的ID,需要删除原来的同步信息,再创建同步到企业微信、写入同步表 +// if("1".equals(retMsg.getString("flag"))) { +// synThirdInfoService.delete(synThirdInfoEntity); +// } +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// +// // 判断用户的手机号、邮箱是否唯一,不能重复 +// retMsg = checkUserMobileEmailRepeat(userEntity.getMobilePhone(),userEntity.getEmail(),thirdObjId,qyUserList, +// opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),userEntity.getId(),thirdObjId,userFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 往企业微信写入成员 +// retMsg = SynQyWebChatUtil.createUser(userObjectModel, access_token); +// if(retMsg.getBoolean("code")) { +// // 同步成功 +// thirdObjId = userEntity.getId(); +// synState = SynThirdConsts.SYN_STATE_OK; +// description = ""; +// }else{ +// // 同步失败 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + retMsg.getString("error"); +// } +// } +// +// if("2".equals(retMsg.getString("flag"))){ +// // 已同步但第三方ID为空,需要创建同步到企业微信、修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = ""; +// +// // 判断用户的手机号、邮箱是否唯一,不能重复 +// retMsg = checkUserMobileEmailRepeat(userEntity.getMobilePhone(),userEntity.getEmail(),thirdObjId,qyUserList, +// opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),userEntity.getId(),thirdObjId,userFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 往企业微信写入成员 +// retMsg = SynQyWebChatUtil.createUser(userObjectModel, access_token); +// if(retMsg.getBoolean("code")) { +// // 同步成功 +// thirdObjId = userEntity.getId(); +// synState = SynThirdConsts.SYN_STATE_OK; +// description = ""; +// }else{ +// // 同步失败 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + retMsg.getString("error"); +// } +// } +// }else{ +// // 更新同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// +// // 判断用户的手机号、邮箱是否唯一,不能重复 +// retMsg = checkUserMobileEmailRepeat(userEntity.getMobilePhone(),userEntity.getEmail(),thirdObjId,qyUserList, +// opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),userEntity.getId(),thirdObjId,userFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 获取当前成员信息 +// QyWebChatUserModel qyWebChatUserModel = getQyUserById(synThirdInfoEntity.getThirdObjId(),access_token); +// if("0".equals(qyWebChatUserModel.getErrcode())){ +// // 要同步到企业微信的对象重新赋值 +// retMsg = setQyUserObject(userEntity,qyDeptList,qyWebChatUserModel); +// userObjectModel = retMsg.getString("qyUserObject"); +// +// // 往企业微信更新成员信息 +// retMsg = SynQyWebChatUtil.updateUser(userObjectModel, access_token); +// if(retMsg.getBoolean("code")) { +// // 同步成功 +// synState = SynThirdConsts.SYN_STATE_OK; +// description = ""; +// }else{ +// // 同步失败 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + retMsg.getString("error"); +// } +// }else{ +// // 同步失败,获取企业微信当前用户信息失败 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + "获取企业微信当前用户信息失败"; +// } +// } +// }else{ +// // 同步失败,原因:用户所属部门找不到相应的企业微信ID、邮箱格式不合法 +// if(synThirdInfoEntity!=null){ +// // 修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// }else{ +// // 写入同步表 +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// } +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + retMsg.getString("error"); +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// } +// }else{ +// // 同步失败 +// if(synThirdInfoEntity!=null){ +// // 修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// }else{ +// // 写入同步表 +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// } +// +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + "access_token值为空,不能同步信息"; +// +// retMsg.put("code", true); +// retMsg.put("error", description); +// } +// }else { +// // 同步失败,原因:企业微信不允许手机号、邮箱不能同时为空; +// // 获取同步表信息 +// synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_USER,userEntity.getId()); +// if(synThirdInfoEntity!=null){ +// // 修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// }else{ +// // 写入同步表 +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// } +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + retMsg.getString("error"); +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// } +// }else{ +// // 未设置单条同步,归并到未同步状态 +// // 获取同步表信息 +// synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_USER,userEntity.getId()); +// if(synThirdInfoEntity!=null){ +// // 修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// }else{ +// // 写入同步表 +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// } +// +// synState = SynThirdConsts.SYN_STATE_NO; +// description = userFlag + "系统未设置单条同步"; +// +// retMsg.put("code", true); +// retMsg.put("error", description); +// } +// +// // 更新同步表 +// saveSynThirdInfoEntity(opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),userEntity.getId(),thirdObjId,synState,description); +// +// return retMsg; +// } + + + /** + * 往企业微信删除成员信息 + * 带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param id 本系统的公司或部门ID + * @return + * @throws WxErrorException + */ +// @Override +// public JSONObject deleteUserSysToQy(boolean isBatch, String id) throws WxErrorException { +// BaseSystemInfo config = getQyhConfig(); +// String corpId = config.getQyhCorpId(); +// String corpSecret = config.getQyhCorpSecret(); +// // 单条记录执行时,受开关限制 +// int qyhIsSyn = isBatch ? 1 : config.getQyhIsSynUser(); +// JSONObject tokenObject = new JSONObject(); +// String access_token = ""; +// JSONObject retMsg = new JSONObject(); +// List qyUserList = new ArrayList<>(); +// SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_USER,id); +// +// // 返回值初始化 +// retMsg.put("code", true); +// retMsg.put("error", "系统未设置单条同步"); +// +// // 支持同步 +// if(synThirdInfoEntity!=null) { +// if(qyhIsSyn==1) { +// // 获取 access_token +// tokenObject = SynQyWebChatUtil.getAccessToken(corpId, corpSecret); +// access_token = tokenObject.getString("access_token"); +// if (access_token != null && !"".equals(access_token)) { +// // 获取企业微信上的所有成员信息列表 +// JSONObject userObject = SynQyWebChatUtil.getUserList(SynThirdConsts.QY_ROOT_DEPT_ID,"1",access_token); +// if(userObject.getBoolean("code")) { +// qyUserList = JsonUtil.getJsonToList(userObject.getString("userlist"), QyWebChatUserModel.class); +// +// // 删除企业对应的用户 +// if(qyUserList.stream().filter(t -> t.getUserid().equals(synThirdInfoEntity.getThirdObjId())).count() > 0 ? true : false){ +// retMsg = SynQyWebChatUtil.deleteUser(synThirdInfoEntity.getThirdObjId(), access_token); +// if (retMsg.getBoolean("code")) { +// // 同步成功,直接删除同步表记录 +// synThirdInfoService.delete(synThirdInfoEntity); +// }else{ +// // 同步失败 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_FAIL, retMsg.getString("error")); +// } +// }else{ +// // 根据企业微信ID找不到相应的信息,直接删除同步表记录 +// synThirdInfoService.delete(synThirdInfoEntity); +// } +// }else{ +// // 同步失败,获取企业微信的成员列表信息失败 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_FAIL, "获取企业微信的成员列表信息失败"); +// +// retMsg.put("code", false); +// retMsg.put("error", "获取企业微信的成员列表信息失败"); +// } +// }else{ +// // 同步失败 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_FAIL, "access_token值为空,不能同步信息"); +// +// retMsg.put("code", false); +// retMsg.put("error", "access_token值为空,不能同步信息!"); +// } +// }else{ +// // 未设置单条同步,归并到未同步状态 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_NO, "系统未设置同步"); +// +// retMsg.put("code", true); +// retMsg.put("error", "系统未设置单条同步"); +// } +// } +// +// return retMsg; +// } + + + /** + * 往企业微信创建成员信息 + * 不带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param userEntity + * @param accessToken (单条调用时为空) + * @return + * @throws WxErrorException + */ + @Override + public JSONObject createUserSysToQy(boolean isBatch, UserEntity userEntity,String accessToken) throws WxErrorException { + BaseSystemInfo config = getQyhConfig(); + String corpId = config.getQyhCorpId(); + // 向企业微信插入数据需要另外token(凭证密钥) + String corpSecret = config.getQyhAgentSecret(); + // 单条记录执行时,受开关限制 + int qyhIsSyn = isBatch ? 1 : config.getQyhIsSynUser(); + JSONObject tokenObject = new JSONObject(); + String access_token = ""; + JSONObject retMsg = new JSONObject(); + String userObjectModel = ""; + String thirdObjId = ""; + Integer synState = 0; + String description = ""; + String userFlag = "创建:"; + + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", userFlag + "系统未设置单条同步"); + + // 企业微信限制:不能手机号、邮箱同时为空 + if(StringUtil.isEmpty(userEntity.getMobilePhone()) && StringUtil.isEmpty(userEntity.getEmail()) && qyhIsSyn == 1){ + retMsg.put("code", false); + retMsg.put("error", userFlag + "企业微信不允许手机号、邮箱不能同时为空!"); + } + + if (isBatch || qyhIsSyn==1){ + if(retMsg.getBoolean("code")){ + if(isBatch){ + access_token = accessToken; + }else{ + // 获取 access_token + tokenObject = SynQyWebChatUtil.getAccessToken(corpId, corpSecret); + access_token = tokenObject.getString("access_token"); + } + + if (access_token != null && !"".equals(access_token)) { + // 要同步到企业微信的对象赋值 + retMsg = setQyUserObject(userEntity, null); + if (retMsg.getBoolean("code")) { + userObjectModel = retMsg.getString("qyUserObject"); + // 往企业微信写入成员 + retMsg = SynQyWebChatUtil.createUser(userObjectModel, access_token); + + // 往同步写入本系统与第三方的对应信息 + if (retMsg.getBoolean("code")) { + // 同步成功 + thirdObjId = userEntity.getId(); + synState = SynThirdConsts.SYN_STATE_OK; + } else { + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + retMsg.getString("error"); + } + }else{ + // 同步失败,原因:部门找不到对应的第三方ID、邮箱格式不合法 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + retMsg.getString("error"); + } + + }else{ + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + "access_token值为空,不能同步信息"; + + retMsg.put("code", false); + retMsg.put("error", description); + } + + }else { + // 同步失败,原因:企业微信不允许手机号、邮箱不能同时为空 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + retMsg.getString("error"); + } + }else{ + // 无须同步,未同步状态 + synState = SynThirdConsts.SYN_STATE_NO; + description = userFlag + "系统未设置单条同步"; + + retMsg.put("code", true); + retMsg.put("error", description); + } + + // 更新同步表 + saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_ADD, null, Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), + Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), userEntity.getId(), thirdObjId, synState, description); + + return retMsg; + } + + + /** + * 往企业微信更新成员信息 + * 不带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param userEntity + * @param accessToken (单条调用时为空) + * @return + * @throws WxErrorException + */ + @Override + public JSONObject updateUserSysToQy(boolean isBatch, UserEntity userEntity,String accessToken) throws WxErrorException { + BaseSystemInfo config = getQyhConfig(); + String corpId = config.getQyhCorpId(); + // 向企业微信插入数据需要另外token(凭证密钥) + String corpSecret = config.getQyhAgentSecret(); + // 单条记录执行时,受开关限制 + int qyhIsSyn = isBatch ? 1 : config.getQyhIsSynUser(); + JSONObject tokenObject = new JSONObject(); + String access_token = ""; + JSONObject retMsg = new JSONObject(); + String userObjectModel = ""; + SynThirdInfoEntity synThirdInfoEntity = new SynThirdInfoEntity(); + SynThirdInfoEntity entity = new SynThirdInfoEntity(); + String opType = ""; + SynThirdInfoEntity synThirdInfoPara = new SynThirdInfoEntity(); + String thirdObjId = ""; + Integer synState = 0; + String description = ""; + String userFlag = "更新:"; + + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", userFlag + "系统未设置单条同步"); + + // 企业微信限制:不能手机号、邮箱同时为空 + if(StringUtil.isEmpty(userEntity.getMobilePhone()) && StringUtil.isEmpty(userEntity.getEmail()) && qyhIsSyn == 1){ + retMsg.put("code", false); + retMsg.put("error", userFlag + "企业微信不允许手机号、邮箱不能同时为空!"); + } + + // 支持同步 + if (isBatch || qyhIsSyn==1){ + if(retMsg.getBoolean("code")){ + // 获取 access_token + if(isBatch){ + access_token = accessToken; + }else{ + tokenObject = SynQyWebChatUtil.getAccessToken(corpId, corpSecret); + access_token = tokenObject.getString("access_token"); + } + + // 获取同步表信息 + synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_USER,userEntity.getId()); + if (access_token != null && !"".equals(access_token)) { + // 要同步到企业微信的对象赋值 + retMsg = setQyUserObject(userEntity,null); + if (retMsg.getBoolean("code")) { + // 判断当前用户对应的第三方的合法性 + userObjectModel = retMsg.getString("qyUserObject"); + retMsg = checkUserSysToQy(synThirdInfoEntity); + if (!retMsg.getBoolean("code")) { + if("3".equals(retMsg.getString("flag")) || "1".equals(retMsg.getString("flag"))){ + // flag:3 未同步,需要创建同步到企业微信、写入同步表 + // flag:1 已同步但第三方上没对应的ID,需要删除原来的同步信息,再创建同步到企业微信、写入同步表 + if("1".equals(retMsg.getString("flag"))) { + synThirdInfoService.delete(synThirdInfoEntity); + } + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + thirdObjId = ""; + + // 往企业微信写入成员 + retMsg = SynQyWebChatUtil.createUser(userObjectModel, access_token); + if(retMsg.getBoolean("code")) { + // 同步成功 + thirdObjId = userEntity.getId(); + synState = SynThirdConsts.SYN_STATE_OK; + description = ""; + }else{ + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + retMsg.getString("error"); + } + } + + if("2".equals(retMsg.getString("flag"))){ + // 已同步但第三方ID为空,需要创建同步到企业微信、修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = ""; + + // 往企业微信写入成员 + retMsg = SynQyWebChatUtil.createUser(userObjectModel, access_token); + if(retMsg.getBoolean("code")) { + // 同步成功 + thirdObjId = userEntity.getId(); + synState = SynThirdConsts.SYN_STATE_OK; + description = ""; + }else{ + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + retMsg.getString("error"); + } + } + }else{ + // 更新同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + + // 获取当前成员信息 + QyWebChatUserModel qyWebChatUserModel = getQyUserById(synThirdInfoEntity.getThirdObjId(),access_token); + if("0".equals(qyWebChatUserModel.getErrcode())){ + // 要同步到企业微信的对象重新赋值 + retMsg = setQyUserObject(userEntity,qyWebChatUserModel); + userObjectModel = retMsg.getString("qyUserObject"); + + // 往企业微信更新成员信息 + retMsg = SynQyWebChatUtil.updateUser(userObjectModel, access_token); + if(retMsg.getBoolean("code")) { + // 同步成功 + synState = SynThirdConsts.SYN_STATE_OK; + description = ""; + }else{ + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + retMsg.getString("error"); + } + }else{ + // 同步失败,获取企业微信当前用户信息失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + "获取企业微信当前用户信息失败"; + } + } + }else{ + // 同步失败,原因:用户所属部门找不到相应的企业微信ID、邮箱格式不合法 + if(synThirdInfoEntity!=null){ + // 修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + }else{ + // 写入同步表 + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + thirdObjId = ""; + } + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + retMsg.getString("error"); + + retMsg.put("code", false); + retMsg.put("error", description); + } + }else{ + // 同步失败 + if(synThirdInfoEntity!=null){ + // 修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + }else{ + // 写入同步表 + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + thirdObjId = ""; + } + + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + "access_token值为空,不能同步信息"; + + retMsg.put("code", true); + retMsg.put("error", description); + } + }else { + // 同步失败,原因:企业微信不允许手机号、邮箱不能同时为空; + // 获取同步表信息 + synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_USER,userEntity.getId()); + if(synThirdInfoEntity!=null){ + // 修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + }else{ + // 写入同步表 + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + thirdObjId = ""; + } + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + retMsg.getString("error"); + + retMsg.put("code", false); + retMsg.put("error", description); + } + }else{ + // 未设置单条同步,归并到未同步状态 + // 获取同步表信息 + synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_USER,userEntity.getId()); + if(synThirdInfoEntity!=null){ + // 修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + }else{ + // 写入同步表 + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + thirdObjId = ""; + } + + synState = SynThirdConsts.SYN_STATE_NO; + description = userFlag + "系统未设置单条同步"; + + retMsg.put("code", true); + retMsg.put("error", description); + } + + // 更新同步表 + saveSynThirdInfoEntity(opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), + Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),userEntity.getId(),thirdObjId,synState,description); + + return retMsg; + } + + + /** + * 往企业微信删除成员信息 + * 不带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param id 本系统的公司或部门ID + * @param accessToken (单条调用时为空) + * @return + * @throws WxErrorException + */ + @Override + public JSONObject deleteUserSysToQy(boolean isBatch, String id,String accessToken) throws WxErrorException { + BaseSystemInfo config = getQyhConfig(); + String corpId = config.getQyhCorpId(); + String corpSecret = config.getQyhCorpSecret(); + // 单条记录执行时,受开关限制 + int qyhIsSyn = isBatch ? 1 : config.getQyhIsSynUser(); + JSONObject tokenObject = new JSONObject(); + String access_token = ""; + JSONObject retMsg = new JSONObject(); + SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_USER,id); + + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", "系统未设置单条同步"); + + // 支持同步 + if(synThirdInfoEntity!=null) { + if(qyhIsSyn==1) { + // 获取 access_token + if(isBatch){ + access_token = accessToken; + }else{ + tokenObject = SynQyWebChatUtil.getAccessToken(corpId, corpSecret); + access_token = tokenObject.getString("access_token"); + } + + + if (access_token != null && !"".equals(access_token)) { + if (!"".equals(String.valueOf(synThirdInfoEntity.getThirdObjId())) && !"null".equals(String.valueOf(synThirdInfoEntity.getThirdObjId()))) { + retMsg = SynQyWebChatUtil.deleteUser(synThirdInfoEntity.getThirdObjId(), access_token); + if (retMsg.getBoolean("code")) { + // 同步成功,直接删除同步表记录 + synThirdInfoService.delete(synThirdInfoEntity); + }else{ + // 同步失败 + saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), + Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_FAIL, retMsg.getString("error")); + } + }else{ + // 根据企业微信ID找不到相应的信息,直接删除同步表记录 + synThirdInfoService.delete(synThirdInfoEntity); + } + + }else{ + // 同步失败 + saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), + Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_FAIL, "access_token值为空,不能同步信息"); + + retMsg.put("code", false); + retMsg.put("error", "access_token值为空,不能同步信息!"); + } + }else{ + // 未设置单条同步,归并到未同步状态 + saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), + Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_NO, "系统未设置同步"); + + retMsg.put("code", true); + retMsg.put("error", "系统未设置单条同步"); + } + } + + return retMsg; + } + + /** + * 企业微信同步组织部门到本地 + * 企业微信同步单个公司或部门到本地(供调用) + * 不带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @param accessToken (单条调用时为空) + * @return + */ + @Override + public JSONObject createDepartmentQyToSys(boolean isBatch, QyWebChatDeptModel deptEntity, String accessToken) { + BaseSystemInfo config = getQyhConfig(); + // 单条记录执行时,受开关限制 + int dingIsSyn = isBatch ? 1 : config.getQyhIsSynOrg(); + + Integer dingDeptId = deptEntity.getId(); + String dingDeptName = deptEntity.getName(); + Integer dingParentId = deptEntity.getParentid(); + + Integer synState = 0; + String deptFlag = "创建:"; + String description = ""; + + JSONObject retMsg = new JSONObject(); + boolean isDeptDiff = true; + String sysParentId = ""; + String sysObjId = ""; + + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", "创建:系统未设置单条同步"); + + // 支持同步 + if(isBatch || dingIsSyn==1){ + boolean tag = false; + if(dingDeptId==1){ + tag=true; + } + SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoByThirdObjId(SynThirdConsts.THIRD_TYPE_QY_To_Sys,SynThirdConsts.DATA_TYPE_ORG,dingParentId+""); + + +// retMsg = checkDepartmentDingToSys(synThirdInfoEntity); + isDeptDiff = retMsg.getBoolean("code"); + if(isDeptDiff || tag) { + sysParentId = tag==true?" -1" : synThirdInfoEntity.getSysObjId(); + + if(isBatch || dingIsSyn==1) { + // 新增保存组织 + OrganizeEntity newOrg = new OrganizeEntity(); + sysObjId = RandomUtil.uuId(); + newOrg.setId(sysObjId); + if(!"1".equals(dingDeptId+"") ){ +// newOrg.setCategory(SynThirdConsts.OBJECT_TYPE_COMPANY); +// newOrg.setParentId("-1"); +// newOrg.setOrganizeIdTree(sysObjId); + + Assert.notNull(sysParentId,"父级组织未同步"); + newOrg.setCategory(SynThirdConsts.OBJECT_TYPE_DEPARTMENT); + newOrg.setParentId(sysParentId); + // 通过组织id获取父级组织 + String organizeIdTree = organizeService.getOrganizeIdTree(newOrg); + newOrg.setOrganizeIdTree(organizeIdTree+","+sysObjId); + + newOrg.setEnCode(dingDeptId+""); + newOrg.setFullName(dingDeptName); + newOrg.setSortCode(deptEntity.getOrder()!=null?deptEntity.getOrder():1L); + organizeService.save(newOrg); + }else{ + sysObjId = organizeService.getOrganizeByParentId().get(0).getId(); + } + + + // 中间表 + retMsg.put("retDeptId", sysObjId); + synState = SynThirdConsts.SYN_STATE_OK; + + + }else{ + // 未设置单条同步,归并到未同步状态 + // 未同步 + synState = SynThirdConsts.SYN_STATE_NO; + description = deptFlag + "系统未设置单条同步"; + + retMsg.put("code", true); + retMsg.put("error", description); + retMsg.put("retDeptId", "0"); + } + }else{ + // 同步失败,上级部门无对应的企业微信ID + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + "部门所属的上级部门未同步到本地"; + + retMsg.put("code", false); + retMsg.put("error", description); + retMsg.put("retDeptId", "0"); + } + } + + // 更新同步表 + saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_ADD,null,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY_To_Sys), + Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),sysObjId,dingDeptId+"",synState,description); + + return retMsg; + } + + /** + * 企业微信更新组织-部门到本地 + * 不带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @param accessToken (单条调用时为空) + * @return + */ + @Override + public JSONObject updateDepartmentQyToSys(boolean isBatch, QyWebChatDeptModel deptEntity,String accessToken) { + BaseSystemInfo config = getQyhConfig(); +// String corpId = config.getDingSynAppKey(); +// String corpSecret = config.getDingSynAppSecret(); +// String compValue = SynThirdConsts.OBJECT_TYPE_COMPANY; + // 单条记录执行时,受开关限制 + int dingIsSyn = isBatch ? 1 : config.getQyhIsSynOrg(); + +// JSONObject tokenObject = new JSONObject(); +// String access_token = ""; + JSONObject retMsg = new JSONObject(); + DingTalkDeptModel deptModel = new DingTalkDeptModel(); + SynThirdInfoEntity synThirdInfoEntity = new SynThirdInfoEntity(); + SynThirdInfoEntity synThirdInfoParentEntity = new SynThirdInfoEntity(); + String opType = ""; + Integer synState = 0; + String description = ""; +// String thirdObjId = ""; + String sysObjId = ""; + String sysParentId = ""; + SynThirdInfoEntity synThirdInfoPara = new SynThirdInfoEntity(); + boolean isDeptDiff = true; + String deptFlag = "更新:"; + + Integer dingDeptId = deptEntity.getId(); + String dingDeptName = deptEntity.getName(); + Integer dingParentId = deptEntity.getParentid(); + OrganizeEntity orgInfo = new OrganizeEntity(); + + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", "系统未设置单条同步"); + + if(isBatch || dingIsSyn==1) { + // 获取同步表信息 + synThirdInfoEntity = synThirdInfoService.getInfoByThirdObjId(SynThirdConsts.THIRD_TYPE_QY_To_Sys,SynThirdConsts.DATA_TYPE_ORG,dingDeptId+""); + synThirdInfoParentEntity = synThirdInfoService.getInfoByThirdObjId(SynThirdConsts.THIRD_TYPE_QY_To_Sys,SynThirdConsts.DATA_TYPE_ORG,dingParentId+""); + if(synThirdInfoParentEntity ==null){ + retMsg.put("code", false); + retMsg.put("error", "上级部门未同步"); + return retMsg; + } +// retMsg = checkDepartmentDingToSys(synThirdInfoEntity); + isDeptDiff = retMsg.getBoolean("code"); + if(isDeptDiff) { +// sysParentId = synThirdInfoEntity.getSysObjId(); + sysParentId = synThirdInfoParentEntity.getSysObjId(); + // 获取同步表信息 +// synThirdInfoEntity = synThirdInfoService.getInfoByThirdObjId(SynThirdConsts.THIRD_TYPE_QY_To_Sys,SynThirdConsts.DATA_TYPE_ORG,dingDeptId+""); + // 判断当前部门对应的第三方的合法性 +// retMsg = checkDepartmentDingToSys(synThirdInfoEntity); + if (!retMsg.getBoolean("code")) { + if ("3".equals(retMsg.getString("flag")) || "1".equals(retMsg.getString("flag"))) { + // flag:3 未同步,需要创建同步到企业微信、写入同步表 + // flag:1 已同步但第三方上没对应的ID,需要删除原来的同步信息,再创建同步到企业微信、写入同步表 + if("1".equals(retMsg.getString("flag"))) { + synThirdInfoService.delete(synThirdInfoEntity); + } + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; +// thirdObjId = dingDeptId+""; + + // 新增保存组织 + orgInfo = new OrganizeEntity(); + sysObjId = RandomUtil.uuId(); + orgInfo.setId(sysObjId); + if(!"1".equals(dingDeptId+"") ){ +// newOrg.setCategory(SynThirdConsts.OBJECT_TYPE_COMPANY); +// newOrg.setParentId("-1"); +// newOrg.setOrganizeIdTree(sysObjId); + + orgInfo.setCategory(SynThirdConsts.OBJECT_TYPE_DEPARTMENT); + orgInfo.setParentId(sysParentId); + // 通过组织id获取父级组织 + String organizeIdTree = organizeService.getOrganizeIdTree(orgInfo); + orgInfo.setOrganizeIdTree(organizeIdTree+","+sysObjId); + + orgInfo.setEnCode(dingDeptId+""); + orgInfo.setFullName(dingDeptName); + orgInfo.setSortCode(deptEntity.getOrder()!=null?deptEntity.getOrder():1L); + organizeService.save(orgInfo); + }else{ + sysObjId = organizeService.getOrganizeByParentId().get(0).getId(); + } + + // 同步成功 +// thirdObjId = retMsg.getString("retDeptId"); + retMsg.put("retDeptId", sysObjId); + synState = SynThirdConsts.SYN_STATE_OK; + description = ""; + + } + + if ("2".equals(retMsg.getString("flag"))) { + // flag:2 已同步但第三方ID为空,需要创建同步到企业微信、修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = dingDeptId+""; + + // 新增保存组织 + orgInfo = new OrganizeEntity(); + sysObjId = RandomUtil.uuId(); + orgInfo.setId(sysObjId); + if(!"1".equals(dingDeptId+"") ){ +// newOrg.setCategory(SynThirdConsts.OBJECT_TYPE_COMPANY); +// newOrg.setParentId("-1"); +// newOrg.setOrganizeIdTree(sysObjId); + + orgInfo.setCategory(SynThirdConsts.OBJECT_TYPE_DEPARTMENT); + orgInfo.setParentId(sysParentId); + // 通过组织id获取父级组织 + String organizeIdTree = organizeService.getOrganizeIdTree(orgInfo); + orgInfo.setOrganizeIdTree(organizeIdTree+","+sysObjId); + + orgInfo.setEnCode(dingDeptId+""); + orgInfo.setFullName(dingDeptName); + orgInfo.setSortCode(deptEntity.getOrder()!=null?deptEntity.getOrder():1L); + organizeService.save(orgInfo); + }else{ + sysObjId = organizeService.getOrganizeByParentId().get(0).getId(); + } + + // 同步成功 + retMsg.put("retDeptId", sysObjId); + synState = SynThirdConsts.SYN_STATE_OK; + description = ""; + } + }else { + // 更新同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); + sysObjId = synThirdInfoEntity.getSysObjId(); + + orgInfo = organizeService.getInfo(sysObjId); + if(orgInfo!=null){ +// orgInfo.setParentId(dingParentId+""); + orgInfo.setFullName(dingDeptName); + if(!"1".equals(dingDeptId+"")){ +// orgInfo.setCategory(SynThirdConsts.OBJECT_TYPE_COMPANY); +// orgInfo.setParentId("-1"); + +// orgInfo.setCategory(SynThirdConsts.OBJECT_TYPE_DEPARTMENT); + orgInfo.setParentId(sysParentId); + orgInfo.setOrganizeIdTree(orgInfo.getOrganizeIdTree().replace(","+orgInfo.getId(),"")); + organizeService.update(orgInfo.getId(),orgInfo); + } + + // 同步成功 + synState = SynThirdConsts.SYN_STATE_OK; + description = ""; + }else{ + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + "未找到对应的部门"; + } + } + }else{ + synThirdInfoEntity = synThirdInfoService.getInfoByThirdObjId(SynThirdConsts.THIRD_TYPE_QY_To_Sys,SynThirdConsts.DATA_TYPE_ORG,dingDeptId+""); + // 同步失败,上级部门检查有异常 + if(synThirdInfoEntity!=null){ + // 修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + sysObjId = synThirdInfoEntity.getSysObjId(); + }else{ + // 写入同步表 + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + sysObjId = ""; + } + + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + "上级部门无对应的本地ID"; + + retMsg.put("code", false); + retMsg.put("error", description); + } + }else{ + // 未设置单条同步,归并到未同步状态 + // 获取同步表信息 + synThirdInfoEntity = synThirdInfoService.getInfoByThirdObjId(SynThirdConsts.THIRD_TYPE_QY_To_Sys,SynThirdConsts.DATA_TYPE_ORG,dingDeptId+""); + if(synThirdInfoEntity!=null){ + // 修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + sysObjId = synThirdInfoEntity.getSysObjId(); + }else{ + // 写入同步表 + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + sysObjId = ""; + } + + synState = SynThirdConsts.SYN_STATE_NO; + description = deptFlag + "系统未设置单条同步"; + + retMsg.put("code", true); + retMsg.put("error", description); + } + + // 更新同步表 + saveSynThirdInfoEntity(opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY_To_Sys), + Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),sysObjId,dingDeptId+"",synState,description); + + return retMsg; + } + + + /** + * 企业微信同步用户到本地 + * @param isBatch 是否批量(批量不受开关限制) + * @param qyWebChatUserModel + * @return + */ + @Override + public JSONObject createUserQyToSys(boolean isBatch, QyWebChatUserModel qyWebChatUserModel,String access_token) throws Exception { + + + String dingUserId = qyWebChatUserModel.getUserid(); + BaseSystemInfo config = this.getQyhConfig(); + String corpId = config.getQyhCorpId(); + JSONObject retMsg2 = SynQyWebChatUtil.getLinkedcorpUserById(corpId+"/"+dingUserId,access_token); + String dingUserName = qyWebChatUserModel.getName(); + String dingMobile = retMsg2.getJSONObject("userinfo").getString("mobile"); + String dingTelephone = qyWebChatUserModel.getTelephone(); + Integer status = qyWebChatUserModel.getStatus(); + // 工号不唯一的情况,不能用于做本系统的账号 +// String dingJobNumber = qyWebChatUserModel.getJobNumber(); + // 职位:是字符串,手入的 +// String title = qyWebChatUserModel.getTitle(); + String sysObjId= ""; + // 单条记录执行时,受开关限制 + int dingIsSyn = config.getQyhIsSynUser(); + JSONObject retMsg = new JSONObject(); + String thirdObjId = dingUserId; + Integer synState = 0; + String description = ""; + String userFlag = "创建:"; + UserEntity userEntity = new UserEntity(); + String tag= SynThirdConsts.OBJECT_OP_ADD; + if (status != 1) { + return retMsg; + } + if(isBatch || dingIsSyn==1){ + // 检测账户唯一 + UserEntity userAccount = userService.getUserByMobile(dingMobile); + if (userAccount!=null) { + // 查询用户id在不在同步表 + sysObjId= userAccount.getId(); + boolean hasExist = synThirdInfoService.getBySysObjId(sysObjId); + if (hasExist) { + // 说明创建过了,直接跳过 + tag=SynThirdConsts.OBJECT_OP_UPD; + synState=1; + description="创建过,更新对象"; + return retMsg; + }else{ + + retMsg.put("code", true); + description = "账户名重复:线上手机账号"+dingMobile+"自动合并为本地账号"; + synState = SynThirdConsts.SYN_STATE_OK; + retMsg.put("msg", description); + } + }else{ + // 判断中间表用户组织是否存在 + List deptIdList = qyWebChatUserModel.getDepartment(); + List deptIdStrList = deptIdList.stream().map(t->t+"").collect(Collectors.toList()); + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().in(SynThirdInfoEntity::getThirdObjId,deptIdStrList); + wrapper.lambda().eq(SynThirdInfoEntity::getThirdType,SynThirdConsts.THIRD_TYPE_QY_To_Sys); + List synThirdInfoEntities = synThirdInfoService.getBaseMapper().selectList(wrapper); + if(synThirdInfoEntities!=null && synThirdInfoEntities.size()!=0){ + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", userFlag + "系统未设置单条同步"); + userEntity.setId(RandomUtil.uuId()); + userEntity.setHeadIcon("001.png"); + userEntity.setAccount(dingMobile); + // 工号 +// userEntity.setDingJobNumber(qyWebChatUserModel.getJobNumber()); + userEntity.setEmail(qyWebChatUserModel.getEmail()); + +// userEntity.setCertificatesNumber(qyWebChatUserModel.getJobNumber()); + userEntity.setMobilePhone(dingMobile); + userEntity.setGender(2); + userEntity.setRealName(dingUserName); + userEntity.setEnabledMark(1); + if(StringUtil.isBlank(userEntity.getOrganizeId())){ + String orgId = synThirdInfoService.getSysByThird(String.valueOf(deptIdList.get(0))); + userEntity.setOrganizeId(orgId); + } + + userEntity.setPassword("4a7d1ed414474e4033ac29ccb8653d9b"); + sysObjId = userEntity.getId(); + List orgIdList = new ArrayList<>(); + for (String deptIdStr:deptIdStrList){ + String orgId = synThirdInfoService.getSysByThird(deptIdStr); + orgIdList.add(orgId); + } + userEntity.setOrganizeId(orgIdList.stream().collect(Collectors.joining(","))); + userService.create(userEntity); + +// userRelationService.syncDingUserRelation(sysObjId,deptIdList); + // 往同步写入本系统与第三方的对应信息 + if (retMsg.getBoolean("code")) { + // 同步成功 + synState = SynThirdConsts.SYN_STATE_OK; + } else { + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + retMsg.getString("error"); + } + + }else{ + // 无须同步,未同步状态 + synState = SynThirdConsts.SYN_STATE_NO; + description = userFlag + "用户未同步组织信息"; + retMsg.put("code", false); + retMsg.put("error", description); + } + } + }else{ + // 无须同步,未同步状态 + synState = SynThirdConsts.SYN_STATE_NO; + description = userFlag + "系统未设置单条同步"; + retMsg.put("code", true); + retMsg.put("error", description); + } + // 更新同步表 + saveSynThirdInfoEntity(tag, null, Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY_To_Sys), + Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),sysObjId, thirdObjId, synState, description); + return retMsg; + } + + // 更新同步表 + /** + * 企业微信更新用户信息到本地 + * 将组织、用户的信息写入同步表 + */ + @Override + public JSONObject updateUserQyToSystem(boolean isBatch, QyWebChatUserModel qyWebChatUserModel,String access_token) throws Exception { + BaseSystemInfo config = getQyhConfig(); + + JSONObject retMsg = new JSONObject(); + SynThirdInfoEntity synThirdInfoEntity = new SynThirdInfoEntity(); + String opType = ""; + String thirdObjId = ""; + Integer synState = 0; + String description = ""; + String userFlag = "更新:"; + + // 赋值第三方id + thirdObjId = qyWebChatUserModel.getUserid(); + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", userFlag + "系统未设置单条同步"); + + // 单条记录执行时,受开关限制 + int dingIsSyn = config.getQyhIsSynUser(); + // 支持同步 + if (isBatch || dingIsSyn==1){ + // 获取同步表信息 + /** + * 获取指定第三方工具、指定数据类型、本地对象ID的同步信息 + * // 获取方式如果第三方用户id和第三方组织id会一致则须修改 + * thirdType 22 企业微信 + * dataType 2 用户 + * thirdId 第三方id + */ + synThirdInfoEntity = synThirdInfoService.getInfoByThirdObjId(SynThirdConsts.THIRD_TYPE_QY_To_Sys,SynThirdConsts.DATA_TYPE_USER,thirdObjId); + + if(synThirdInfoEntity!=null && StringUtil.isNoneBlank(synThirdInfoEntity.getSysObjId())){ + opType = SynThirdConsts.OBJECT_OP_UPD; + String sysObjId = synThirdInfoEntity.getSysObjId(); + + UserEntity info = userService.getInfo(sysObjId); + if(info==null){ + synState = SynThirdConsts.SYN_STATE_NO; + description = "本地更新记录未找到"; + retMsg.put("code", false); + retMsg.put("error", description); + synThirdInfoService.removeById(synThirdInfoEntity.getId()); + + + }else{ + String dingUserName = qyWebChatUserModel.getName(); + String dingMobile = qyWebChatUserModel.getMobile(); + + // 更新系统用户表 + List deptIdList = qyWebChatUserModel.getDepartment(); + List deptIdStrList = deptIdList.stream().map(t->t+"").collect(Collectors.toList()); + info.setMobilePhone(dingMobile); + info.setAccount(dingMobile); + info.setRealName(dingUserName); + List orgIdList = new ArrayList<>(); + for (String deptIdStr:deptIdStrList){ + String orgId = synThirdInfoService.getSysByThird(deptIdStr); + orgIdList.add(orgId); + } + info.setOrganizeId(orgIdList.stream().collect(Collectors.joining(","))); + userService.update(info.getId(), info); + + // 检测是否未同步用户组织关联 + // userRelationService.syncDingUserRelation(info.getId(),deptIdList); + + synState=1; + // 更新同步表记录 + description="账号同步更新完成"; + saveSynThirdInfoEntity(opType, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY_To_Sys), + Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),synThirdInfoEntity.getSysObjId(), thirdObjId, synState, description); + + } + + }else{ + if((synThirdInfoEntity!=null && StringUtil.isBlank(synThirdInfoEntity.getSysObjId() ))){ + // 删除记录 + synThirdInfoService.removeById(synThirdInfoEntity.getId()); + } + opType = SynThirdConsts.OBJECT_OP_ADD; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + try { + this.createUserQyToSys(true,qyWebChatUserModel,access_token); + } catch (ParseException e) { + e.printStackTrace(); + } + } + }else{ + // 未设置单条同步,归并到未同步状态 + synState = SynThirdConsts.SYN_STATE_NO; + description = userFlag + "系统未设置单条同步"; + + retMsg.put("code", true); + retMsg.put("error", description); + opType= SynThirdConsts.OBJECT_OP_ADD; + + saveSynThirdInfoEntity(opType, null, Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY_To_Sys), + Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),null, thirdObjId, synState, description); + } + + return retMsg; + } + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/TemplateParamServiceImpl.java b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/TemplateParamServiceImpl.java new file mode 100644 index 0000000..95cf66e --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/TemplateParamServiceImpl.java @@ -0,0 +1,72 @@ +package jnpf.message.service.impl; + +import jnpf.base.service.SuperServiceImpl; +import jnpf.message.entity.TemplateParamEntity; +import jnpf.message.mapper.TemplateParamMapper; +import jnpf.message.model.messagetemplateconfig.MessageTemplateConfigPagination; +import jnpf.message.service.TemplateParamService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + + +import jnpf.permission.service.AuthorizeService; + + +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; + +import jnpf.util.*; + +import java.util.*; + +/** + * 消息模板(新) + * 版本: V3.2.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2022-08-18 + */ +@Service +public class TemplateParamServiceImpl extends SuperServiceImpl implements TemplateParamService { + + + @Autowired + private UserProvider userProvider; + + @Autowired + private AuthorizeService authorizeService; + + @Override + public QueryWrapper getChild(MessageTemplateConfigPagination pagination, QueryWrapper templateParamQueryWrapper) { +// boolean pcPermission = false; +// boolean appPermission = false; +// boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc"); +// if (isPc) { +// } + + return templateParamQueryWrapper; + } + + @Override + public TemplateParamEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(TemplateParamEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public List getDetailListByParentId(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(TemplateParamEntity::getTemplateId, id); + return this.list(queryWrapper); + } + + @Override + public List getParamList(String id,List params) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(TemplateParamEntity::getTemplateId, id); + queryWrapper.lambda().in(TemplateParamEntity::getField,params); + return this.list(queryWrapper); + } + +} \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/UserDeviceServiceImpl.java b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/UserDeviceServiceImpl.java new file mode 100644 index 0000000..59bbd6a --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/UserDeviceServiceImpl.java @@ -0,0 +1,80 @@ +package jnpf.message.service.impl; + + +import jnpf.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import jnpf.message.entity.UserDeviceEntity; +import jnpf.message.mapper.UserDeviceMapper; + +import jnpf.message.service.UserDeviceService; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; + +import jnpf.util.*; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + + +/** + * 消息模板(新) + * 版本: V3.2.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2022-08-18 + */ +@Service +public class UserDeviceServiceImpl extends SuperServiceImpl implements UserDeviceService { + + + + @Autowired + private UserProvider userProvider; + + + @Override + public UserDeviceEntity getInfoByUserId(String userId){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserDeviceEntity::getUserId,userId); + return this.getOne(queryWrapper); + } + + @Override + public List getCidList(String userId){ + List cidList = new ArrayList<>(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserDeviceEntity::getUserId,userId); + if(this.list(queryWrapper) != null && this.list(queryWrapper).size()>0) { + cidList = this.list(queryWrapper).stream().map(t -> t.getClientId()).distinct().collect(Collectors.toList()); + } + return cidList; + } + + @Override + public UserDeviceEntity getInfoByClientId(String clientId){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserDeviceEntity::getClientId,clientId); + return this.getOne(queryWrapper); + } + + @Override + public void create(UserDeviceEntity entity) { + this.save(entity); + } + + @Override + public boolean update(String id, UserDeviceEntity entity) { + entity.setId(id); + return this.updateById(entity); + } + + @Override + public void delete(UserDeviceEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } + +} \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/WechatUserServiceImpl.java b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/WechatUserServiceImpl.java new file mode 100644 index 0000000..d2a96d4 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-biz/src/main/java/jnpf/message/service/impl/WechatUserServiceImpl.java @@ -0,0 +1,68 @@ +package jnpf.message.service.impl; + + +import jnpf.base.service.SuperServiceImpl; +import jnpf.message.entity.WechatUserEntity; +import jnpf.message.mapper.WechatUserMapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + + +import jnpf.message.service.WechatUserService; +import jnpf.permission.service.AuthorizeService; + + +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; + +import jnpf.util.*; + +import java.security.MessageDigest; +import java.util.*; + +/** + * 消息模板(新) + * 版本: V3.2.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2022-08-18 + */ +@Service +public class WechatUserServiceImpl extends SuperServiceImpl implements WechatUserService { + + + + @Autowired + private UserProvider userProvider; + + @Autowired + private AuthorizeService authorizeService; + + @Override + public WechatUserEntity getInfoByGzhId(String userId,String gzhId){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(WechatUserEntity::getUserId,userId); + queryWrapper.lambda().eq(WechatUserEntity::getGzhId,gzhId); + queryWrapper.lambda().eq(WechatUserEntity::getCloseMark,1); + return this.getOne(queryWrapper); + } + + @Override + public void create(WechatUserEntity entity) { + this.save(entity); + } + + @Override + public boolean update(String id, WechatUserEntity entity) { + entity.setId(id); + return this.updateById(entity); + } + + @Override + public void delete(WechatUserEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } + +} \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-controller/pom.xml b/jnpf-java-boot/jnpf-message/jnpf-message-controller/pom.xml new file mode 100644 index 0000000..63691e9 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-controller/pom.xml @@ -0,0 +1,22 @@ + + + + jnpf-message + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-message-controller + + + + com.jnpf + jnpf-message-biz + ${project.version} + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-controller/src/main/java/jnpf/message/controller/AccountConfigController.java b/jnpf-java-boot/jnpf-message/jnpf-message-controller/src/main/java/jnpf/message/controller/AccountConfigController.java new file mode 100644 index 0000000..ca9167c --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-controller/src/main/java/jnpf/message/controller/AccountConfigController.java @@ -0,0 +1,537 @@ + + + +package jnpf.message.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import jnpf.base.controller.SuperController; +import com.alibaba.fastjson.JSONObject; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.entity.DictionaryDataEntity; +import jnpf.base.service.BillRuleService; +import jnpf.base.service.DictionaryDataService; +import jnpf.base.service.DictionaryTypeService; +import jnpf.base.vo.PageListVO; +import jnpf.base.vo.PaginationVO; +import jnpf.base.UserInfo; +import jnpf.base.vo.DownloadVO; +import jnpf.config.ConfigValueUtil; +import jnpf.constant.MsgCode; +import jnpf.exception.DataException; +import jnpf.message.entity.AccountConfigEntity; +import jnpf.message.model.accountconfig.*; +import jnpf.message.model.message.EmailModel; +import jnpf.message.service.AccountConfigService; +import jnpf.message.service.SendConfigTemplateService; +import jnpf.message.util.DingTalkUtil; +import jnpf.message.util.EmailUtil; +import jnpf.message.util.QyWebChatUtil; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.UserService; +import jnpf.emnus.ModuleTypeEnum; +import jnpf.util.FileExport; +import jnpf.util.wxutil.HttpUtil; +import org.springframework.http.MediaType; +import org.springframework.transaction.annotation.Transactional; +import jnpf.util.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import java.io.IOException; +import java.util.*; + + +/** + * 账号配置功能 + * + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2022-08-18 + */ +@Slf4j +@RestController +@Tag(name = "账号配置功能", description = "message") +@RequestMapping("/api/message/AccountConfig") +public class AccountConfigController extends SuperController { + + @Autowired + private FileExport fileExport; + + @Autowired + private BillRuleService billRuleService; + + @Autowired + private ConfigValueUtil configValueUtil; + + @Autowired + private UserProvider userProvider; + + @Autowired + private UserService userApi; + + @Autowired + private AccountConfigService accountConfigService; + @Autowired + private DictionaryDataService dictionaryDataApi; + @Autowired + private SendConfigTemplateService sendConfigTemplateService; + + /** + * 列表 + * + * @param accountConfigPagination 账号配置分页模型 + * @return + */ + @Operation(summary = "列表") + @SaCheckPermission("msgCenter.accountConfig") + @GetMapping + public ActionResult> list(AccountConfigPagination accountConfigPagination) throws IOException { + List list = accountConfigService.getList(accountConfigPagination); + List smsSendTypeList = dictionaryDataApi.getListByTypeDataCode("smsSendType"); + List webHookList = dictionaryDataApi.getListByTypeDataCode("msgWebHookSendType"); + //处理id字段转名称,若无需转或者为空可删除 + UserEntity userEntity; + List listVO = JsonUtil.getJsonToList(list, AccountConfigListVO.class); + for (AccountConfigListVO accountConfigVO : listVO) { + //渠道 + if (StringUtil.isNotEmpty(accountConfigVO.getChannel())) { + smsSendTypeList.stream().filter(t -> accountConfigVO.getChannel().equals(t.getEnCode())).findFirst() + .ifPresent(dataTypeEntity -> accountConfigVO.setChannel(dataTypeEntity.getFullName())); + } + //webhook类型 + if (StringUtil.isNotEmpty(accountConfigVO.getWebhookType())) { + webHookList.stream().filter(t -> accountConfigVO.getWebhookType().equals(t.getEnCode())).findFirst() + .ifPresent(dataTypeEntity -> accountConfigVO.setWebhookType(dataTypeEntity.getFullName())); + } + + if (StringUtil.isNotEmpty(accountConfigVO.getCreatorUserId())) { + userEntity = userApi.getInfo(accountConfigVO.getCreatorUserId()); + if (userEntity != null) { + accountConfigVO.setCreatorUser(userEntity.getRealName() + "/" + userEntity.getAccount()); + } + } + } + + PageListVO vo = new PageListVO(); + vo.setList(listVO); + PaginationVO page = JsonUtil.getJsonToBean(accountConfigPagination, PaginationVO.class); + vo.setPagination(page); + return ActionResult.success(vo); + } + + /** + * 创建 + * + * @param accountConfigForm 新建账号配置模型 + * @return ignore + */ + @Operation(summary = "新建") + @Parameters({ + @Parameter(name = "accountConfigForm", description = "新建账号配置模型") + }) + @SaCheckPermission("msgCenter.accountConfig") + @PostMapping + @Transactional + public ActionResult create(@RequestBody @Valid AccountConfigForm accountConfigForm) throws DataException { + boolean b = accountConfigService.checkForm(accountConfigForm, 0,accountConfigForm.getType(),""); + if (b) { + return ActionResult.fail("编码不能重复"); + } + boolean c = accountConfigService.checkGzhId(accountConfigForm.getAppKey(),0, "7", ""); + if("7".equals(accountConfigForm.getType())) { + if (c) { + return ActionResult.fail("微信公众号原始id不能重复"); + } + } + String mainId = RandomUtil.uuId(); + UserInfo userInfo = userProvider.get(); + AccountConfigEntity entity = JsonUtil.getJsonToBean(accountConfigForm, AccountConfigEntity.class); + entity.setCreatorTime(DateUtil.getNowDate()); + entity.setCreatorUserId(userInfo.getUserId()); + entity.setId(mainId); + accountConfigService.save(entity); + return ActionResult.success("创建成功"); + } + + + /** + * 信息 + * + * @param id 主键 + * @return ignore + */ + @Operation(summary = "信息") + @GetMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("msgCenter.accountConfig") + public ActionResult info(@PathVariable("id") String id) { + AccountConfigEntity entity = accountConfigService.getInfo(id); + AccountConfigInfoVO vo = JsonUtil.getJsonToBean(entity, AccountConfigInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 表单信息(详情页) + * + * @param id 主键 + * @return ignore + */ + @Operation(summary = "表单信息(详情页)") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("msgCenter.accountConfig") + @GetMapping("/detail/{id}") + public ActionResult detailInfo(@PathVariable("id") String id) { + return info(id); + } + + + /** + * 更新 + * + * @param id 主键 + * @param accountConfigForm 修改账号配置模型 + * @return ignore + */ + @Operation(summary = "更新") + @PutMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "accountConfigForm", description = "修改账号配置模型", required = true) + }) + @SaCheckPermission("msgCenter.accountConfig") + @Transactional + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid AccountConfigForm accountConfigForm) throws DataException { + + boolean b = accountConfigService.checkForm(accountConfigForm, 0,accountConfigForm.getType(),accountConfigForm.getId()); + if (b) { + return ActionResult.fail("编码不能重复"); + } + boolean c = accountConfigService.checkGzhId(accountConfigForm.getAppKey(),0, "7", id); + if("7".equals(accountConfigForm.getType())) { + if (c) { + return ActionResult.fail("微信公众号原始id不能重复"); + } + } + //判断配置是否被引用 + if(Objects.equals(0, accountConfigForm.getEnabledMark())){ + if(sendConfigTemplateService.isUsedAccount(accountConfigForm.getId())) { + return ActionResult.fail("此记录与“消息发送配置”关联引用,不允许被禁用"); + } + } + UserInfo userInfo = userProvider.get(); + AccountConfigEntity entity = accountConfigService.getInfo(id); + if (entity != null) { + AccountConfigEntity subentity = JsonUtil.getJsonToBean(accountConfigForm, AccountConfigEntity.class); + subentity.setCreatorTime(entity.getCreatorTime()); + subentity.setCreatorUserId(entity.getCreatorUserId()); + subentity.setLastModifyTime(DateUtil.getNowDate()); + subentity.setLastModifyUserId(userInfo.getUserId()); + boolean b1 = accountConfigService.updateById(subentity); + if (!b1) { + return ActionResult.fail("当前表单原数据已被调整,请重新进入该页面编辑并提交数据"); + } + return ActionResult.success("更新成功"); + } else { + return ActionResult.fail("更新失败,数据不存在"); + } + } + + /** + * 删除 + * + * @param id 主键 + * @return ignore + */ + @Operation(summary = "删除") + @DeleteMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("msgCenter.accountConfig") + @Transactional + public ActionResult delete(@PathVariable("id") String id) { + AccountConfigEntity entity = accountConfigService.getInfo(id); + if (entity != null) { + //判断是否与消息发送配置关联 + //判断配置是否被引用 + if(sendConfigTemplateService.isUsedAccount(entity.getId())) { + return ActionResult.fail("此记录与“消息发送配置”关联引用,不允许被删除"); + } + + accountConfigService.delete(entity); + + } + return ActionResult.success("删除成功"); + } + + + /** + * 开启或禁用 + * + * @param id 主键 + * @return ignore + */ + @Operation(summary = "开启或禁用") + @PostMapping("/unable/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("msgCenter.accountConfig") + @Transactional + public ActionResult unable(@PathVariable("id") String id) { + AccountConfigEntity entity = accountConfigService.getInfo(id); + if (entity != null) { + if("1".equals(String.valueOf(entity.getEnabledMark()))){ + entity.setEnabledMark(0); + return ActionResult.success("禁用成功"); + }else { + //判断是否被引用 + + entity.setEnabledMark(1); + return ActionResult.success("启用成功"); + } + }else { + return ActionResult.fail("操作失败,数据不存在"); + } + } + + /** + * 复制 + * + * @param id 主键 + * @return + */ + @Operation(summary = "复制") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("msgCenter.accountConfig") + @PostMapping("/copy/{id}") + @Transactional + public ActionResult copy(@PathVariable("id") String id) { + UserInfo userInfo = userProvider.get(); + AccountConfigEntity entity = accountConfigService.getInfo(id); + if (entity != null) { + entity.setEnabledMark(0); + String copyNum = UUID.randomUUID().toString().substring(0, 5); + entity.setFullName(entity.getFullName()+".副本"+copyNum); + entity.setEnCode(entity.getEnCode()+copyNum); + entity.setCreatorTime(DateUtil.getNowDate()); + entity.setCreatorUserId(userInfo.getUserId()); + if("7".equals(entity.getType())){ + entity.setAppKey(entity.getAppKey()+"副本"+copyNum); + } + entity.setLastModifyTime(null); + entity.setLastModifyUserId(null); + entity.setId(RandomUtil.uuId()); + AccountConfigEntity copyEntity = JsonUtil.getJsonToBean(entity, AccountConfigEntity.class); + if(copyEntity.getEnCode().length()>50 || copyEntity.getFullName().length()>50){ + return ActionResult.fail("已到达该模板复制上限,请复制源模板"); + } + accountConfigService.create(copyEntity); + return ActionResult.success("复制数据成功"); + }else { + return ActionResult.fail("复制失败,数据不存在"); + } + } + + + /** + * 导出账号配置 + * + * @param id 账号配置id + * @return ignore + */ + @Operation(summary = "导出") + @GetMapping("/{id}/Action/Export") + public ActionResult export(@PathVariable String id) { + AccountConfigEntity entity = accountConfigService.getInfo(id); + //导出文件 + DownloadVO downloadVO = fileExport.exportFile(entity, configValueUtil.getTemporaryFilePath(), entity.getFullName(), ModuleTypeEnum.ACCOUNT_CONFIG.getTableName()); + return ActionResult.success(downloadVO); + } + + /** + * 导入账号配置 + * + * @param multipartFile 备份json文件 + * @return 执行结果标识 + */ + @Operation(summary = "导入") + @PostMapping(value = "/Action/Import", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public ActionResult importData(@RequestPart("file") MultipartFile multipartFile) throws DataException { + UserInfo userInfo = userProvider.get(); + //判断是否为.json结尾 + if (FileUtil.existsSuffix(multipartFile, ModuleTypeEnum.ACCOUNT_CONFIG.getTableName())) { + return ActionResult.fail(MsgCode.IMP002.get()); + } + //获取文件内容 + String fileContent = FileUtil.getFileContent(multipartFile); + AccountConfigEntity entity = JsonUtil.getJsonToBean(fileContent, AccountConfigEntity.class); + entity.setCreatorUserId(userInfo.getUserId()); + entity.setCreatorTime(DateUtil.getNowDate()); + return accountConfigService.ImportData(entity); + } + + /** + * 测试发送邮件 + * + * @param accountConfigForm 账号测试模型 + * @return + */ + @Operation(summary = "测试发送邮箱") + @Parameters({ + @Parameter(name = "accountConfigForm", description = "账号测试模型", required = true) + }) + @SaCheckPermission("msgCenter.accountConfig") + @PostMapping("/testSendMail") + @Transactional + public ActionResult testSendMail(@RequestBody @Valid AccountConfigForm accountConfigForm) { + List toMails = accountConfigForm.getTestSendEmail(); + // 获取邮箱配置 + Map objModel = new HashMap<>(); + objModel.put("emailSmtpHost",accountConfigForm.getSmtpServer()); + objModel.put("emailSmtpPort",accountConfigForm.getSmtpPort().toString()); + objModel.put("emailSenderName",accountConfigForm.getAddressorName()); + objModel.put("emailAccount",accountConfigForm.getSmtpUser()); + objModel.put("emailPassword",accountConfigForm.getSmtpPassword()); + objModel.put("emailSsl",accountConfigForm.getSslLink()== 1 ? "true" : "false"); + + + EmailModel emailModel = JsonUtil.getJsonToBean(objModel, EmailModel.class); + StringBuilder toUserMail = new StringBuilder(); + String userEmailAll = ""; + String userEmail = ""; + String userName = ""; + + // 相关参数验证 + if (StringUtil.isEmpty(emailModel.getEmailSmtpHost())) { + return ActionResult.fail("发送失败,失败原因:SMTP服务为空"); + } else if (StringUtil.isEmpty(emailModel.getEmailSmtpPort())) { + return ActionResult.fail("发送失败,失败原因:SMTP端口为空"); + } else if (StringUtil.isEmpty(emailModel.getEmailAccount())) { + return ActionResult.fail("发送失败,失败原因:发件人邮箱为空"); + } else if (StringUtil.isEmpty(emailModel.getEmailPassword())) { + return ActionResult.fail("发送失败,失败原因:发件人密码为空"); + } else if (toMails == null || toMails.size() < 1) { + return ActionResult.fail("发送失败,失败原因:接收人为空"); + } else { + // 设置邮件标题 + emailModel.setEmailTitle(accountConfigForm.getTestEmailTitle()); + // 设置邮件内容 + String content = accountConfigForm.getTestEmailContent(); + emailModel.setEmailContent(content); + + // 获取收件人的邮箱地址、创建消息用户实体 + for (String userId : toMails) { + UserEntity userEntity = userApi.getInfo(userId); + if (userEntity != null) { + userEmail = StringUtil.isEmpty(userEntity.getEmail()) ? "" : userEntity.getEmail(); + userName = userEntity.getRealName(); + } + if (StringUtil.isNotBlank(userEmail) && !"null".equals(userEmail)) { + //校验用户邮箱格式 + if(!isEmail(userEmail)){ + return ActionResult.fail("发送失败。失败原因:"+userName +"的邮箱账号格式有误!"); + } + toUserMail = toUserMail.append(",").append(userName).append("<").append(userEmail).append(">"); + } else { + return ActionResult.fail("发送失败。失败原因:"+userName +"的邮箱账号为空!"); + } + } + // 处理接收人员的邮箱信息串并验证 + userEmailAll = toUserMail.toString(); + if (StringUtil.isNotEmpty(userEmailAll)) { + userEmailAll = userEmailAll.substring(1); + } + if (StringUtil.isEmpty(userEmailAll)) { + return ActionResult.fail("发送失败。失败原因:接收人对应的邮箱全部为空"); + } else { + // 设置接收人员 + emailModel.setEmailToUsers(userEmailAll); + // 发送邮件 + JSONObject retJson = EmailUtil.sendMail(emailModel); + if (!retJson.getBoolean("code")) { + return ActionResult.fail("发送失败。失败原因:"+retJson.get("error")); + } + } + } + return ActionResult.success("已发送"); + } + + /** + * 测试企业微信配置的连接功能 + * + * @param accountConfigForm 账号测试模型 + * @return ignore + */ + @Operation(summary = "测试企业微信配置的连接") + @Parameters({ + @Parameter(name = "accountConfigForm", description = "账号测试模型", required = true) + }) + @SaCheckPermission("msgCenter.accountConfig") + @PostMapping("/testQyWebChatConnect") + public ActionResult testQyWebChatConnect(@RequestBody @Valid AccountConfigForm accountConfigForm) { + JSONObject retMsg; + // 测试发送消息、组织同步的连接 + //企业微信企业id + String corpId = accountConfigForm.getEnterpriseId(); + //企业微信应用secret + String agentSecret = accountConfigForm.getAppSecret(); +// String corpSecret = testAccountConfigForm.getQyhCorpSecret(); + // 测试发送消息的连接 + retMsg = QyWebChatUtil.getAccessToken(corpId, agentSecret); + if (HttpUtil.isWxError(retMsg)) { + return ActionResult.fail("连接失败。失败原因:" + retMsg.getString("errmsg")); + } + return ActionResult.success("连接成功"); + } + + /** + * 测试钉钉配置的连接功能 + * + * @param accountConfigForm 账号测试模型 + * @return ignore + */ + @Operation(summary = "测试钉钉配置的连接") + @Parameters({ + @Parameter(name = "accountConfigForm", description = "账号测试模型", required = true) + }) + @SaCheckPermission("msgCenter.accountConfig") + @PostMapping("/testDingTalkConnect") + public ActionResult testDingTalkConnect(@RequestBody @Valid AccountConfigForm accountConfigForm) { + JSONObject retMsg; + // 测试钉钉配置的连接 + String appKey = accountConfigForm.getAppId(); + String appSecret = accountConfigForm.getAppSecret(); + /// +// String agentId = dingTalkModel.getDingAgentId(); + // 测试钉钉的连接 + retMsg = DingTalkUtil.getAccessToken(appKey, appSecret); + if (!retMsg.getBoolean("code")) { + return ActionResult.fail("连接失败。失败原因:" + retMsg.getString("error")); + } + + return ActionResult.success("连接成功"); + } + + public boolean isEmail(String email){ + String EMAIL_REGEX = "^[\\w-_\\.+]*[\\w-_\\.]\\@([\\w]+\\.)+[\\w]+[\\w]$"; + Boolean b = email.matches(EMAIL_REGEX); + return b; + } +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-controller/src/main/java/jnpf/message/controller/ImReplyController.java b/jnpf-java-boot/jnpf-message/jnpf-message-controller/src/main/java/jnpf/message/controller/ImReplyController.java new file mode 100644 index 0000000..db380a3 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-controller/src/main/java/jnpf/message/controller/ImReplyController.java @@ -0,0 +1,126 @@ +package jnpf.message.controller; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import jnpf.base.controller.SuperController; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.vo.ListVO; +import jnpf.exception.DataException; +import jnpf.message.entity.ImReplyEntity; +import jnpf.message.model.ImReplyListModel; +import jnpf.message.model.ImReplyListVo; +import jnpf.message.service.ImContentService; +import jnpf.message.service.ImReplyService; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.UserService; +import jnpf.util.JsonUtil; +import jnpf.util.UploaderUtil; +import jnpf.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 消息会话接口 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-05-29 + */ +@Tag(name = "消息会话接口", description = "imreply") +@RestController +@RequestMapping("/api/message/imreply") +public class ImReplyController extends SuperController { + @Autowired + private ImReplyService imReplyService; + @Autowired + private ImContentService imContentService; + @Autowired + private UserService userService; + @Autowired + private UserProvider userProvider; + + /** + * 获取消息会话列表 + * + * @return + */ + @Operation(summary = "获取消息会话列表") + @GetMapping + public ActionResult> getList() { + List imReplyList = imReplyService.getImReplyList(); + //过滤 发送者删除标记 + imReplyList = imReplyList.stream().filter(t ->{ + if(t.getImreplySendDeleteMark() != null){ + return !t.getImreplySendDeleteMark().equals(userProvider.get().getUserId()); + } + return true; + }).collect(Collectors.toList()); + List imReplyLists = new ArrayList<>(imReplyList); + for (ImReplyListModel vo : imReplyList) { + UserEntity entity = userService.getInfo(vo.getId()); + if (entity == null || entity.getEnabledMark() == 0) { + imReplyLists.remove(vo); + continue; + } + //拼接账号和名称 + vo.setRealName(entity.getRealName()); + vo.setAccount(entity.getAccount()); + //头像路径拼接 + vo.setHeadIcon(UploaderUtil.uploaderImg(vo.getHeadIcon())); + //获取未读消息 + vo.setUnreadMessage(imContentService.getUnreadCount(vo.getId(), userProvider.get().getUserId())); + if(vo.getSendDeleteMark()!=null && vo.getSendDeleteMark().equals(userProvider.get().getUserId()) || vo.getDeleteMark()==1){ + vo.setLatestMessage(""); + vo.setMessageType(""); + } + } + //排序 + imReplyLists = imReplyLists.stream().sorted(Comparator.comparing(ImReplyListModel::getLatestDate).reversed()).collect(Collectors.toList()); + List imReplyListVoList = JsonUtil.getJsonToList(imReplyLists, ImReplyListVo.class); + ListVO listVO = new ListVO(); + listVO.setList(imReplyListVoList); + return ActionResult.success(listVO); + } + + /** + * 删除聊天记录 + * + * @param id 主键 + * @return ignore + */ + @Operation(summary = "删除聊天记录") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @DeleteMapping("/deleteChatRecord/{id}") + public ActionResult deleteChatRecord(@PathVariable("id") String id){ + imContentService.deleteChatRecord(userProvider.get().getUserId(),id); + return ActionResult.success(""); + } + + /** + * 移除会话列表 + * + * @param id 主键 + * @return ignore + */ + @Operation(summary = "移除会话列表") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @DeleteMapping("/relocation/{id}") + public ActionResult relocation(@PathVariable("id") String id){ + imReplyService.relocation(userProvider.get().getUserId(),id); + return ActionResult.success(""); + } + + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-controller/src/main/java/jnpf/message/controller/MessageController.java b/jnpf-java-boot/jnpf-message/jnpf-message-controller/src/main/java/jnpf/message/controller/MessageController.java new file mode 100644 index 0000000..e99ab59 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-controller/src/main/java/jnpf/message/controller/MessageController.java @@ -0,0 +1,388 @@ +package jnpf.message.controller; + + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import jnpf.base.controller.SuperController; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.UserInfo; +import jnpf.base.entity.DictionaryDataEntity; +import jnpf.base.entity.SuperBaseEntity; +import jnpf.base.service.DictionaryDataService; +import jnpf.base.service.DictionaryTypeService; +import jnpf.base.vo.PageListVO; +import jnpf.base.vo.PaginationVO; +import jnpf.constant.MsgCode; +import jnpf.message.entity.MessageEntity; +import jnpf.exception.DataException; +import jnpf.message.entity.MessageReceiveEntity; +import jnpf.message.model.NoticePagination; +import jnpf.message.service.MessageService; +import jnpf.message.model.message.*; +import jnpf.message.service.UserDeviceService; +import jnpf.message.util.unipush.UinPush; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.UserService; +import jnpf.util.JsonUtil; +import jnpf.util.JsonUtilEx; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 系统公告 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Tag(name = "系统公告", description = "Message") +@RestController +@RequestMapping("/api/message") +public class MessageController extends SuperController { + + @Autowired + private MessageService messageService; + @Autowired + private UserService userApi; + @Autowired + private UinPush uinPush; + @Autowired + private UserDeviceService userDeviceService; + @Autowired + private DictionaryDataService dictionaryDataApi; + @Autowired + private DictionaryTypeService dictionaryTypeService; + + /** + * 列表(通知公告) + * + * @param pagination + * @return + */ + @Operation(summary = "获取系统公告列表(带分页)") + @SaCheckPermission("system.notice") + @PostMapping("/Notice/List") + public ActionResult> NoticeList(@RequestBody NoticePagination pagination) { + messageService.updateEnabledMark(); + List list = messageService.getNoticeList(pagination); + List userList = userApi.getUserName(list.stream().map(MessageEntity::getCreatorUserId).collect(Collectors.toList())); + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + List noticeType = dictionaryDataApi.getListByTypeDataCode("NoticeType"); + List voList = new ArrayList<>(); + // 判断是否过期 + list.forEach(t -> { + MessageNoticeVO vo = JsonUtil.getJsonToBean(t, MessageNoticeVO.class); + // 处理是否过期 + if (t.getExpirationTime() != null) { + // 已发布的情况下 + if (t.getEnabledMark() == 1) { + if (t.getExpirationTime().getTime() < System.currentTimeMillis()) { + vo.setEnabledMark(2); + } + } + } + DictionaryDataEntity dictionaryDataEntity = noticeType.stream().filter(notice -> notice.getEnCode().equals(t.getCategory())).findFirst().orElse(new DictionaryDataEntity()); + vo.setCategory(dictionaryDataEntity.getFullName()); + // 转换创建人、发布人 + UserEntity user = userList.stream().filter(ul -> ul.getId().equals(t.getCreatorUserId())).findFirst().orElse(null); + vo.setCreatorUser(user != null ? user.getRealName() + "/" + user.getAccount() : ""); + if (t.getEnabledMark() != null && t.getEnabledMark() != 0) { + UserEntity entity = userApi.getInfo(t.getLastModifyUserId()); + vo.setLastModifyUserId(entity != null ? entity.getRealName() + "/" + entity.getAccount() : ""); + vo.setReleaseTime(t.getLastModifyTime() != null ? t.getLastModifyTime().getTime() : null); + vo.setReleaseUser(vo.getLastModifyUserId()); + } + voList.add(vo); + }); + return ActionResult.page(voList, paginationVO); + } + + /** + * 添加系统公告 + * + * @param noticeCrForm 实体对象 + * @return + */ + @Operation(summary = "添加系统公告") + @Parameters({ + @Parameter(name = "noticeCrForm", description = "新建系统公告模型", required = true) + }) + @SaCheckPermission("system.notice") + @PostMapping("/Notice") + public ActionResult create(@RequestBody @Valid NoticeCrForm noticeCrForm) { + MessageEntity entity = JsonUtil.getJsonToBean(noticeCrForm, MessageEntity.class); + if(entity != null && StringUtil.isNotEmpty(entity.getBodyText()) && (entity.getBodyText().contains("<") || entity.getBodyText().contains("&lt;"))){ + return ActionResult.fail("内容不能包含<符号"); + } + messageService.create(entity); + return ActionResult.success("新建成功"); + } + + /** + * 修改系统公告 + * + * @param id 主键值 + * @param messageUpForm 实体对象 + * @return + */ + @Operation(summary = "修改系统公告") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "messageUpForm", description = "修改系统公告模型", required = true) + }) + @SaCheckPermission("system.notice") + @PutMapping("/Notice/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid NoticeUpForm messageUpForm) { + MessageEntity entity = JsonUtil.getJsonToBean(messageUpForm, MessageEntity.class); + if(entity != null && StringUtil.isNotEmpty(entity.getBodyText()) && (entity.getBodyText().contains("<") || entity.getBodyText().contains("&lt;"))){ + return ActionResult.fail("内容不能包含<符号"); + } + boolean flag = messageService.update(id, entity); + if (flag == false) { + return ActionResult.fail("更新失败,数据不存在"); + } + return ActionResult.success("更新成功"); + } + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "获取/查看系统公告信息") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("system.notice") + @GetMapping("/Notice/{id}") + public ActionResult Info(@PathVariable("id") String id) throws DataException { + MessageEntity entity = messageService.getInfo(id); + NoticeInfoVO vo = null; + if (entity != null) { + UserEntity info = userApi.getInfo(entity.getCreatorUserId()); + entity.setCreatorUserId(info != null ? info.getRealName() + "/" + info.getAccount() : ""); + vo = JsonUtilEx.getJsonToBeanEx(entity, NoticeInfoVO.class); + vo.setReleaseUser(entity.getCreatorUserId()); + vo.setReleaseTime(entity.getLastModifyTime() != null ? entity.getLastModifyTime().getTime() : null); + UserEntity userEntity = userApi.getInfo(entity.getLastModifyUserId()); + if (userEntity != null && StringUtil.isNotEmpty(userEntity.getId())) { + String realName = userEntity.getRealName(); + String account = userEntity.getAccount(); + if (StringUtil.isNotEmpty(realName)) { + vo.setReleaseUser(realName + "/" + account); + } + } + } + return ActionResult.success(vo); + } + + /** + * 删除 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "删除系统公告") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("system.notice") + @DeleteMapping("/Notice/{id}") + public ActionResult delete(@PathVariable("id") String id) { + MessageEntity entity = messageService.getInfo(id); + if (entity != null) { + messageService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + + /** + * 发布公告 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "发布系统公告") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("system.notice") + @PutMapping("/Notice/{id}/Actions/Release") + public ActionResult release(@PathVariable("id") String id) { + MessageEntity entity = messageService.getInfo(id); + if (entity != null) { + List userIds = null; + if (StringUtil.isNotEmpty(entity.getToUserIds())) { + userIds = Arrays.asList(entity.getToUserIds().split(",")); + } else { + userIds = userApi.getListId(); + } + List userIdList = userApi.getUserIdList(userIds, null); + if (messageService.sentNotice(userIdList, entity)) { + /*if(userIdList != null && userIdList.size()>0) { + for (String userId : userIdList) { + List cidList = userDeviceService.getCidList(userId); + if(cidList != null && cidList.size()>0){ + JSONObject jsonObject = new JSONObject(); + jsonObject.put("type","1"); + jsonObject.put("id",entity.getId()); + jsonObject.put("title",entity.getTitle()); + String text = JSONObject.toJSONString(jsonObject); + byte[] bytes = text.getBytes(StandardCharsets.UTF_8); + text = Base64.getEncoder().encodeToString(bytes); + uinPush.sendUniPush(cidList, entity.getTitle(), "你有一条公告消息", "1", text); + } + } + }*/ + return ActionResult.success("发布成功"); + } + } + return ActionResult.fail("发布失败"); + } +//=======================================站内消息、消息中心================================================= + + + /** + * 获取消息中心列表 + * + * @param pagination + * @return + */ + @Operation(summary = "列表(通知公告/系统消息/私信消息)") + @GetMapping + public ActionResult> messageList(PaginationMessage pagination) { + List listVO = new ArrayList<>(); + List list = messageService.getMessageList1(pagination, pagination.getType(), pagination.getIsRead()); + List userList = userApi.getUserName(list.stream().map(SuperBaseEntity.SuperCBaseEntity::getCreatorUserId).collect(Collectors.toList())); + list.forEach(t -> { + MessageInfoVO vo = JsonUtil.getJsonToBean(t, MessageInfoVO.class); + UserEntity user = userList.stream().filter(ul -> ul.getId().equals(t.getCreatorUserId())).findFirst().orElse(null); + if (user != null) { + vo.setReleaseTime(t.getCreatorTime() != null ? t.getCreatorTime().getTime() : null); + UserEntity entity = userApi.getInfo(t.getCreatorUserId()); + vo.setReleaseUser(entity != null ? entity.getRealName() + "/" + entity.getAccount() : ""); + vo.setCreatorUser(entity != null ? entity.getRealName() + "/" + entity.getAccount() : ""); + } + listVO.add(vo); + }); + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(listVO, paginationVO); + } + + + /** + * 读取消息 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "读取消息") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @GetMapping("/ReadInfo/{id}") + public ActionResult readInfo(@PathVariable("id") String id) throws DataException { + MessageReceiveEntity receive = messageService.messageRead(id); + if (receive != null) { + UserEntity user = userApi.getInfo(receive.getUserId()); + receive.setCreatorUserId(user != null ? user.getRealName() + "/" + user.getAccount() : ""); + receive.setBodyText(receive.getBodyText()); +// if (entity.getType() == 2) { +// entity.setBodyText(receive.getBodyText()); +// } + } + NoticeInfoVO vo = JsonUtil.getJsonToBean(receive, NoticeInfoVO.class); + if (Objects.equals(receive.getType() , 1)) { + MessageEntity jsonToBean = JsonUtil.getJsonToBean(receive.getBodyText(), MessageEntity.class); + if (jsonToBean != null) { + vo.setCategory(jsonToBean.getCategory()); + vo.setCoverImage(jsonToBean.getCoverImage()); + vo.setExcerpt(jsonToBean.getExcerpt()); + vo.setExpirationTime(jsonToBean.getExpirationTime() != null ? jsonToBean.getExpirationTime().getTime() : null); + vo.setFiles(jsonToBean.getFiles()); + vo.setBodyText(jsonToBean.getBodyText()); + } + } + vo.setReleaseTime(receive.getCreatorTime() != null ? receive.getCreatorTime().getTime() : null); +// UserEntity info = usersApi.getInfoById(receive.getCreatorUserId()); + vo.setReleaseUser(receive.getCreatorUserId()); + return ActionResult.success(vo); + } + + + /** + * 全部已读 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "全部已读") + @Parameters({ + @Parameter(name = "pagination", description = "分页模型", required = true) + }) + @PostMapping("/Actions/ReadAll") + public ActionResult allRead(@RequestBody PaginationMessage pagination) { + List list = messageService.getMessageList3(pagination, pagination.getType(),null,pagination.getIsRead()); + if(list != null && list.size()>0) { + List idList = list.stream().map(SuperBaseEntity.SuperIBaseEntity::getId).collect(Collectors.toList()); + messageService.messageRead(idList); + return ActionResult.success("操作成功"); + }else { + return ActionResult.fail("暂无未读消息"); + } + } + + /** + * app端获取未读数据 + * + * @return + */ + @Operation(summary = "app端获取未读数据") + @GetMapping("/getUnReadMsgNum") + public ActionResult getUnReadMsgNum() { + Map map = new HashMap<>(); + UserInfo userInfo = UserProvider.getUser(); + Integer unReadMsg = messageService.getUnreadCount(userInfo.getUserId(), 2); + Integer unReadSchedule = messageService.getUnreadCount(userInfo.getUserId(),4); + Integer unReadNotice = messageService.getUnreadCount(userInfo.getUserId(), 1); + Integer unReadSystemMsg = messageService.getUnreadCount(userInfo.getUserId(), 3); + Integer unReadNum = unReadMsg+unReadNotice+unReadSchedule+unReadSystemMsg; + map.put("unReadMsg",unReadMsg.toString()); + map.put("unReadNotice",unReadNotice.toString()); + map.put("unReadSchedule",unReadSchedule.toString()); + map.put("unReadSystemMsg",unReadSystemMsg.toString()); + map.put("unReadNum",unReadNum.toString()); + return ActionResult.success(map); + } + + /** + * 删除记录 + * + * @param recordForm 已读模型 + * @return + */ + @Operation(summary = "删除消息") + @Parameters({ + @Parameter(name = "recordForm", description = "已读模型", required = true) + }) + @DeleteMapping("/Record") + public ActionResult deleteRecord(@RequestBody MessageRecordForm recordForm) { + String[] id = recordForm.getIds().split(","); + List list = Arrays.asList(id); + messageService.deleteRecord(list); + return ActionResult.success(MsgCode.SU003.get()); + } +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-controller/src/main/java/jnpf/message/controller/MessageMonitorController.java b/jnpf-java-boot/jnpf-message/jnpf-message-controller/src/main/java/jnpf/message/controller/MessageMonitorController.java new file mode 100644 index 0000000..ecf0af8 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-controller/src/main/java/jnpf/message/controller/MessageMonitorController.java @@ -0,0 +1,233 @@ + + + +package jnpf.message.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import jnpf.base.controller.SuperController; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.entity.DictionaryDataEntity; +import jnpf.base.service.DictionaryDataService; +import jnpf.base.vo.PageListVO; +import jnpf.base.vo.PaginationVO; +import jnpf.base.UserInfo; +import jnpf.constant.MsgCode; +import jnpf.exception.DataException; +import jnpf.message.entity.MessageMonitorEntity; +import jnpf.message.model.messagemonitor.*; +import jnpf.message.service.MessageMonitorService; +import org.springframework.transaction.annotation.Transactional; +import jnpf.util.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; +import org.springframework.beans.factory.annotation.Autowired; + +import javax.validation.Valid; +import java.io.IOException; +import java.util.*; + +/** + * 消息监控 + * + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2022-08-22 + */ +@Slf4j +@RestController +@Tag(name = "消息监控", description = "message") +@RequestMapping("/api/message/MessageMonitor") +public class MessageMonitorController extends SuperController { + + + @Autowired + private UserProvider userProvider; + + + @Autowired + private MessageMonitorService messageMonitorService; + @Autowired + private DictionaryDataService dictionaryDataApi; + + + /** + * 列表 + * + * @param messageMonitorPagination 消息监控分页模型 + * @return ignore + */ + @Operation(summary = "列表") + @SaCheckPermission("msgCenter.msgMonitor") + @GetMapping + public ActionResult> list(MessageMonitorPagination messageMonitorPagination) throws IOException { + List list = messageMonitorService.getList(messageMonitorPagination); + + List msgSendTypeList = dictionaryDataApi.getListByTypeDataCode("msgSendType"); + List msgSourceTypeList = dictionaryDataApi.getListByTypeDataCode("msgSourceType"); + + //处理id字段转名称,若无需转或者为空可删除 + List listVO = JsonUtil.getJsonToList(list, MessageMonitorListVO.class); + for (MessageMonitorListVO messageMonitorVO : listVO) { + //消息类型 + if (StringUtil.isNotEmpty(messageMonitorVO.getMessageType())) { + msgSendTypeList.stream().filter(t -> messageMonitorVO.getMessageType().equals(t.getEnCode())).findFirst() + .ifPresent(dataTypeEntity -> messageMonitorVO.setMessageType(dataTypeEntity.getFullName())); + } + //消息来源 + if (StringUtil.isNotEmpty(messageMonitorVO.getMessageSource())) { + msgSourceTypeList.stream().filter(t -> messageMonitorVO.getMessageSource().equals(t.getEnCode())).findFirst() + .ifPresent(dataTypeEntity -> messageMonitorVO.setMessageSource(dataTypeEntity.getFullName())); + } + //子表数据转换 + } + + PageListVO vo = new PageListVO(); + vo.setList(listVO); + PaginationVO page = JsonUtil.getJsonToBean(messageMonitorPagination, PaginationVO.class); + vo.setPagination(page); + return ActionResult.success(vo); + } + + /** + * 创建 + * + * @param messageMonitorForm 消息监控模型 + * @return ignore + */ + @Operation(summary = ("创建")) + @PostMapping + @Parameters({ + @Parameter(name = "messageMonitorForm", description = "消息监控模型", required = true) + }) + @SaCheckPermission("msgCenter.msgMonitor") + @Transactional + public ActionResult create(@RequestBody @Valid MessageMonitorForm messageMonitorForm) throws DataException { + String mainId = RandomUtil.uuId(); + UserInfo userInfo = userProvider.get(); + MessageMonitorEntity entity = JsonUtil.getJsonToBean(messageMonitorForm, MessageMonitorEntity.class); + entity.setCreatorTime(DateUtil.getNowDate()); + entity.setCreatorUserId(userInfo.getUserId()); + entity.setId(mainId); + messageMonitorService.save(entity); + + return ActionResult.success("创建成功"); + } + + + /** + * 批量删除 + * + * @param msgDelForm 消息删除模型 + * @return ignore + */ + @Operation(summary = ("批量删除")) + @DeleteMapping("/batchRemove") + @Parameters({ + @Parameter(name = "msgDelForm", description = "消息删除模型", required = true) + }) + @SaCheckPermission("msgCenter.msgMonitor") + @Transactional + public ActionResult batchRemove(@RequestBody MsgDelForm msgDelForm) { + boolean flag = messageMonitorService.delete(msgDelForm.getIds()); + if (flag == false) { + return ActionResult.fail("删除失败"); + } + return ActionResult.success("删除成功"); + } + + + /** + * 一键清空消息监控记录 + * + * @return + */ + @Operation(summary = "一键清空消息监控记录") + @SaCheckPermission("msgCenter.msgMonitor") + @DeleteMapping("/empty") + public ActionResult deleteHandelLog() { + messageMonitorService.emptyMonitor(); + return ActionResult.success(MsgCode.SU005.get()); + } + + /** + * 信息 + * + * @param id 主键 + * @return ignore + */ + @Operation(summary = "信息") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("msgCenter.msgMonitor") + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) { + MessageMonitorEntity entity = messageMonitorService.getInfo(id); + MessageMonitorInfoVO vo = JsonUtil.getJsonToBean(entity, MessageMonitorInfoVO.class); + + return ActionResult.success(vo); + } + + /** + * 表单信息(详情页) + * + * @param id 主键 + * @return ignore + */ + @Operation(summary = "表单信息(详情页)") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("msgCenter.msgMonitor") + @GetMapping("/detail/{id}") + public ActionResult detailInfo(@PathVariable("id") String id) { + MessageMonitorEntity entity = messageMonitorService.getInfo(id); + + List msgSendTypeList = dictionaryDataApi.getListByTypeDataCode("msgSendType"); + List msgSourceTypeList = dictionaryDataApi.getListByTypeDataCode("msgSourceType"); + + MessageMonitorInfoVO vo = JsonUtil.getJsonToBean(entity, MessageMonitorInfoVO.class); + if (StringUtil.isNotEmpty(vo.getMessageType())) { + msgSendTypeList.stream().filter(t -> vo.getMessageType().equals(t.getEnCode())).findFirst() + .ifPresent(dataTypeEntity -> vo.setMessageType(dataTypeEntity.getFullName())); + } + if (StringUtil.isNotEmpty(vo.getMessageSource())) { + msgSourceTypeList.stream().filter(t -> vo.getMessageSource().equals(t.getEnCode())).findFirst() + .ifPresent(dataTypeEntity -> vo.setMessageSource(dataTypeEntity.getFullName())); + } + if (!"webhook".equals(vo.getMessageType())) { + vo.setReceiveUser(messageMonitorService.userSelectValues(vo.getReceiveUser())); + } + return ActionResult.success(vo); + } + + /** + * 删除 + * + * @param id 主键 + * @return ignore + */ + @DeleteMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("msgCenter.msgMonitor") + @Transactional + public ActionResult delete(@PathVariable("id") String id) { + MessageMonitorEntity entity = messageMonitorService.getInfo(id); + if (entity != null) { + messageMonitorService.delete(entity); + + } + return ActionResult.success("删除成功"); + } + + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-controller/src/main/java/jnpf/message/controller/MessageTemplateConfigController.java b/jnpf-java-boot/jnpf-message/jnpf-message-controller/src/main/java/jnpf/message/controller/MessageTemplateConfigController.java new file mode 100644 index 0000000..f9a57d8 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-controller/src/main/java/jnpf/message/controller/MessageTemplateConfigController.java @@ -0,0 +1,612 @@ + + + +package jnpf.message.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.annotation.SaMode; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import jnpf.base.controller.SuperController; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.entity.DictionaryDataEntity; +import jnpf.base.service.BillRuleService; +import jnpf.base.service.DictionaryDataService; +import jnpf.base.vo.PageListVO; +import jnpf.base.vo.PaginationVO; +import jnpf.base.UserInfo; +import jnpf.base.vo.DownloadVO; +import jnpf.config.ConfigValueUtil; +import jnpf.constant.MsgCode; +import jnpf.exception.DataException; +import jnpf.message.entity.MessageTemplateConfigEntity; +import jnpf.message.entity.SmsFieldEntity; +import jnpf.message.entity.TemplateParamEntity; +import jnpf.message.model.messagetemplateconfig.MessageTemplateConfigForm; +import jnpf.message.model.messagetemplateconfig.MessageTemplateConfigInfoVO; +import jnpf.message.model.messagetemplateconfig.MessageTemplateConfigListVO; +import jnpf.message.model.messagetemplateconfig.MessageTemplateConfigPagination; +import jnpf.message.service.MessageTemplateConfigService; +import jnpf.message.service.SendConfigTemplateService; +import jnpf.message.service.SmsFieldService; +import jnpf.message.service.TemplateParamService; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.UserService; +import jnpf.emnus.ModuleTypeEnum; +import jnpf.util.FileExport; +import org.springframework.http.MediaType; +import org.springframework.transaction.annotation.Transactional; + +import jnpf.util.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import java.io.IOException; +import java.util.stream.Collectors; +import java.util.*; + +/** + * 消息模板(新) + * + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2022-08-18 + */ +@Slf4j +@RestController +@Tag(name = "消息模板(新)", description = "message") +@RequestMapping("/api/message/MessageTemplateConfig") +public class MessageTemplateConfigController extends SuperController { + + @Autowired + private FileExport fileExport; + + @Autowired + private BillRuleService billRuleService; + + @Autowired + private ConfigValueUtil configValueUtil; + + @Autowired + private UserProvider userProvider; + + @Autowired + private UserService userApi; + + @Autowired + private MessageTemplateConfigService messageTemplateConfigService; + + @Autowired + private TemplateParamService templateParamService; + @Autowired + private SmsFieldService smsFieldService; + @Autowired + private DictionaryDataService dictionaryDataApi; + @Autowired + private SendConfigTemplateService sendConfigTemplateService; + + + /** + * 列表 + * + * @param messageTemplateConfigPagination 消息模板分页模型 + * @return + */ + @Operation(summary = "列表") + @SaCheckPermission(value = {"msgCenter.msgTemplate", "msgCenter.accountConfig"}, mode = SaMode.OR) + @GetMapping + public ActionResult> list(MessageTemplateConfigPagination messageTemplateConfigPagination) throws IOException { + List list = messageTemplateConfigService.getList(messageTemplateConfigPagination); + List msgSendTypeList = dictionaryDataApi.getListByTypeDataCode("msgSendType"); + List msgSourceTypeList = dictionaryDataApi.getListByTypeDataCode("msgSourceType"); + //处理id字段转名称,若无需转或者为空可删除 + UserEntity userEntity = new UserEntity(); + List listVO = JsonUtil.getJsonToList(list, MessageTemplateConfigListVO.class); + for (MessageTemplateConfigListVO messageTemplateNewVO : listVO) { + //消息类型 + if(StringUtil.isNotEmpty(messageTemplateNewVO.getMessageType())){ + msgSendTypeList.stream().filter(t -> messageTemplateNewVO.getMessageType().equals(t.getEnCode())).findFirst() + .ifPresent(dataTypeEntity -> messageTemplateNewVO.setMessageType(dataTypeEntity.getFullName())); + } + //创建人员 + if(StringUtil.isNotBlank(messageTemplateNewVO.getCreatorUserId()) && !"null".equals(messageTemplateNewVO.getCreatorUserId())){ + userEntity = userApi.getInfo(messageTemplateNewVO.getCreatorUserId()); + if(userEntity != null){ + messageTemplateNewVO.setCreatorUser(userEntity.getRealName() +"/"+ userEntity.getAccount()); + } + } + //消息来源 + if(StringUtil.isNotEmpty(messageTemplateNewVO.getMessageSource())) { + msgSourceTypeList.stream().filter(t -> messageTemplateNewVO.getMessageSource().equals(t.getEnCode())).findFirst() + .ifPresent(dataTypeEntity -> messageTemplateNewVO.setMessageSource(dataTypeEntity.getFullName())); + } + } + + PageListVO vo = new PageListVO(); + vo.setList(listVO); + PaginationVO page = JsonUtil.getJsonToBean(messageTemplateConfigPagination, PaginationVO.class); + vo.setPagination(page); + return ActionResult.success(vo); + } + + + /** + * 创建 + * + * @param messageTemplateConfigForm 消息模板页模型 + * @return ignore + */ + @Operation(summary = "创建") + @Parameters({ + @Parameter(name = "messageTemplateConfigForm", description = "消息模板页模型", required = true) + }) + @SaCheckPermission("msgCenter.msgTemplate") + @PostMapping + @Transactional + public ActionResult create(@RequestBody @Valid MessageTemplateConfigForm messageTemplateConfigForm) throws DataException { + boolean b = messageTemplateConfigService.checkForm(messageTemplateConfigForm, 0,""); + if (b) { + return ActionResult.fail("编码不能重复"); + } + if(!"1".equals(messageTemplateConfigForm.getTemplateType())){ + if(messageTemplateConfigForm.getEnCode().contains("MBXT")){ + return ActionResult.fail("自定义模板编码不能使用系统模板编码规则"); + } + } + if (messageTemplateConfigForm.getSmsFieldList() != null && "7".equals(messageTemplateConfigForm.getMessageType())) { + List SmsFieldList = JsonUtil.getJsonToList(messageTemplateConfigForm.getSmsFieldList(), SmsFieldEntity.class); + List list = SmsFieldList.stream().filter(t->StringUtil.isNotEmpty(String.valueOf(t.getIsTitle())) &&!"null".equals(String.valueOf(t.getIsTitle())) && t.getIsTitle()==1).collect(Collectors.toList()); + if (list != null) { + if(list.size() > 1) { + return ActionResult.fail("创建失败,存在多个标题参数"); + } + }else { + return ActionResult.fail("创建失败,不存在标题参数"); + } + } + String mainId = RandomUtil.uuId(); + UserInfo userInfo = userProvider.get(); + MessageTemplateConfigEntity entity = JsonUtil.getJsonToBean(messageTemplateConfigForm, MessageTemplateConfigEntity.class); + entity.setCreatorTime(DateUtil.getNowDate()); + entity.setCreatorUserId(userInfo.getUserId()); + entity.setId(mainId); + if("1".equals(entity.getMessageType()) && "2".equals(entity.getMessageSource())){ + entity.setContent(null); + } + messageTemplateConfigService.save(entity); + if (messageTemplateConfigForm.getTemplateParamList() != null) { + List TemplateParamList = JsonUtil.getJsonToList(messageTemplateConfigForm.getTemplateParamList(), TemplateParamEntity.class); + for (TemplateParamEntity entitys : TemplateParamList) { + entitys.setId(RandomUtil.uuId()); + entitys.setTemplateId(entity.getId()); + templateParamService.save(entitys); + } + } + if (messageTemplateConfigForm.getSmsFieldList() != null) { + List SmsFieldList = JsonUtil.getJsonToList(messageTemplateConfigForm.getSmsFieldList(), SmsFieldEntity.class); + for (SmsFieldEntity entitys : SmsFieldList) { + entitys.setId(RandomUtil.uuId()); + entitys.setTemplateId(entity.getId()); + smsFieldService.save(entitys); + } + } + + return ActionResult.success("创建成功"); + } + + + /** + * 信息 + * + * @param id 主键 + * @return ignore + */ + @Operation(summary = "信息") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission(value = {"msgCenter.msgTemplate", "msgCenter.accountConfig"}, mode = SaMode.OR) + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) { + MessageTemplateConfigEntity entity = messageTemplateConfigService.getInfo(id); + MessageTemplateConfigInfoVO vo = JsonUtil.getJsonToBean(entity, MessageTemplateConfigInfoVO.class); + //子表 + List BaseTemplateParamList = messageTemplateConfigService.getTemplateParamList(id); +// for (TemplateParamEntity basetemplateparamEntity : BaseTemplateParamList) { +// } + vo.setTemplateParamList(BaseTemplateParamList); + List BaseSmsFieldList = messageTemplateConfigService.getSmsFieldList(id); +// for (SmsFieldEntity basesmsfieldEntity : BaseSmsFieldList) { +// } + vo.setSmsFieldList(BaseSmsFieldList); + //副表 + return ActionResult.success(vo); + } + + /** + * 表单信息(详情页) + * + * @param id 主键 + * @return ignore + */ + @Operation(summary = "表单信息(详情页)") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("msgCenter.msgTemplate") + @GetMapping("/detail/{id}") + public ActionResult detailInfo(@PathVariable("id") String id) { + MessageTemplateConfigEntity entity = messageTemplateConfigService.getInfo(id); + UserEntity userEntity = new UserEntity(); + MessageTemplateConfigInfoVO vo = JsonUtil.getJsonToBean(entity, MessageTemplateConfigInfoVO.class); + + //子表数据转换 + List BaseTemplateParamList = messageTemplateConfigService.getTemplateParamList(id); +// for (TemplateParamEntity basetemplateparamEntity : BaseTemplateParamList) { +// } + vo.setTemplateParamList(BaseTemplateParamList); + List BaseSmsFieldList = messageTemplateConfigService.getSmsFieldList(id); +// for (SmsFieldEntity basesmsfieldEntity : BaseSmsFieldList) { +// } + vo.setSmsFieldList(BaseSmsFieldList); + + return ActionResult.success(vo); + } + + + /** + * 更新 + * + * @param id 主键 + * @param messageTemplateConfigForm 消息模板页模型 + * @return + */ + @Operation(summary = "更新") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "messageTemplateConfigForm", description = "消息模板页模型", required = true) + }) + @SaCheckPermission("msgCenter.msgTemplate") + @PutMapping("/{id}") + @Transactional + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid MessageTemplateConfigForm messageTemplateConfigForm) throws DataException { + + boolean b = messageTemplateConfigService.checkForm(messageTemplateConfigForm, 0, messageTemplateConfigForm.getId()); + if (b) { + return ActionResult.fail("编码不能重复"); + } + if(!"1".equals(messageTemplateConfigForm.getTemplateType())){ + if(messageTemplateConfigForm.getEnCode().contains("MBXT")){ + return ActionResult.fail("自定义模板编码不能使用系统模板编码规则"); + } + } + //判断配置是否被引用 + if("0".equals(String.valueOf(messageTemplateConfigForm.getEnabledMark()))){ + if(sendConfigTemplateService.isUsedTemplate(messageTemplateConfigForm.getId())) { + return ActionResult.fail("此记录与“消息发送配置”关联引用,不允许被禁用"); + } + } + if (messageTemplateConfigForm.getSmsFieldList() != null && "7".equals(messageTemplateConfigForm.getMessageType())) { + List SmsFieldList = JsonUtil.getJsonToList(messageTemplateConfigForm.getSmsFieldList(), SmsFieldEntity.class); + List list = SmsFieldList.stream().filter(t->StringUtil.isNotEmpty(String.valueOf(t.getIsTitle())) &&!"null".equals(String.valueOf(t.getIsTitle())) && t.getIsTitle()==1).collect(Collectors.toList()); + if (list != null) { + if(list.size() > 1) { + return ActionResult.fail("更新失败,存在多个标题参数"); + } + }else { + return ActionResult.fail("更新失败,不存在标题参数"); + } + } + UserInfo userInfo = userProvider.get(); + MessageTemplateConfigEntity entity = messageTemplateConfigService.getInfo(id); + if (entity != null) { + MessageTemplateConfigEntity subentity = JsonUtil.getJsonToBean(messageTemplateConfigForm, MessageTemplateConfigEntity.class); + subentity.setCreatorTime(entity.getCreatorTime()); + subentity.setCreatorUserId(entity.getCreatorUserId()); + subentity.setLastModifyTime(DateUtil.getNowDate()); + subentity.setLastModifyUserId(userInfo.getUserId()); + if("1".equals(subentity.getMessageType()) && "2".equals(subentity.getMessageSource())){ + subentity.setContent(null); + } + boolean b1 = messageTemplateConfigService.updateById(subentity); + if (!b1) { + return ActionResult.fail("当前表单原数据已被调整,请重新进入该页面编辑并提交数据"); + } + + //明细表数据更新 + List addParamList = new ArrayList<>(); + List updParamList = new ArrayList<>(); + List delParamList = new ArrayList<>(); + if (messageTemplateConfigForm.getTemplateParamList() != null) { + List templateParamList = JsonUtil.getJsonToList(messageTemplateConfigForm.getTemplateParamList(), TemplateParamEntity.class); + for (TemplateParamEntity entitys : templateParamList) { + if (StringUtil.isNotBlank(entitys.getId()) && !"null".equals(entitys.getId())) { + TemplateParamEntity paramEntity = templateParamService.getInfo(entitys.getId()); + if (paramEntity != null) { + paramEntity.setId(entitys.getId()); + paramEntity.setTemplateId(entitys.getTemplateId()); + paramEntity.setField(entitys.getField()); + paramEntity.setFieldName(entitys.getFieldName()); + paramEntity.setCreatorUserId(entity.getCreatorUserId()); + paramEntity.setCreatorTime(entitys.getCreatorTime()); + paramEntity.setLastModifyUserId(userInfo.getUserId()); + paramEntity.setLastModifyTime(DateUtil.getNowDate()); + updParamList.add(paramEntity); + } + } else { + entitys.setId(RandomUtil.uuId()); + entitys.setTemplateId(entity.getId()); + entitys.setCreatorUserId(userInfo.getUserId()); + entitys.setCreatorTime(DateUtil.getNowDate()); + addParamList.add(entitys); + } + } + + //删除参数记录 + List paramEntityList = templateParamService.getDetailListByParentId(entity.getId()); + if (paramEntityList != null) { + for (TemplateParamEntity paramEntity : paramEntityList) { + TemplateParamEntity paramEntity1 = templateParamList.stream().filter(t -> t.getId().equals(paramEntity.getId())).findFirst().orElse(null); + if (paramEntity1 == null) { + delParamList.add(paramEntity); + } + } + } + if (addParamList != null && addParamList.size() > 0) { + templateParamService.saveBatch(addParamList); + } + if (updParamList != null && updParamList.size() > 0) { + templateParamService.updateBatchById(updParamList); + } + if (delParamList != null && delParamList.size() > 0) { + templateParamService.removeByIds(delParamList.stream().map(TemplateParamEntity::getId).collect(Collectors.toList())); + } + } + + //短信参数明细表数据更新 + List addSmsList = new ArrayList<>(); + List updSmsList = new ArrayList<>(); + List delSmsList = new ArrayList<>(); + if (messageTemplateConfigForm.getSmsFieldList() != null) { + List smsFieldList = JsonUtil.getJsonToList(messageTemplateConfigForm.getSmsFieldList(), SmsFieldEntity.class); + for (SmsFieldEntity entitys : smsFieldList) { + if (StringUtil.isNotBlank(entitys.getId()) && !"null".equals(entitys.getId())) { + SmsFieldEntity smsFieldEntity = smsFieldService.getInfo(entitys.getId()); + if (smsFieldEntity != null) { + smsFieldEntity.setId(entitys.getId()); + smsFieldEntity.setTemplateId(entity.getId()); + smsFieldEntity.setFieldId(entitys.getFieldId()); + smsFieldEntity.setField(entitys.getField()); + smsFieldEntity.setSmsField(entitys.getSmsField()); + smsFieldEntity.setCreatorTime(entitys.getCreatorTime()); + smsFieldEntity.setCreatorUserId(entitys.getCreatorUserId()); + smsFieldEntity.setLastModifyTime(DateUtil.getNowDate()); + smsFieldEntity.setLastModifyUserId(userInfo.getUserId()); + smsFieldEntity.setIsTitle(entitys.getIsTitle()); + updSmsList.add(smsFieldEntity); + } + } else { + entitys.setId(RandomUtil.uuId()); + entitys.setTemplateId(entity.getId()); + entitys.setCreatorTime(DateUtil.getNowDate()); + entitys.setCreatorUserId(userInfo.getUserId()); + addSmsList.add(entitys); + } + } + //删除短信参数明细表 + List smsFieldEntityList = smsFieldService.getDetailListByParentId(entity.getId()); + if (smsFieldEntityList != null && smsFieldEntityList.size() > 0) { + for (SmsFieldEntity smsFieldEntity : smsFieldEntityList) { + SmsFieldEntity smsFieldEntity1 = smsFieldList.stream().filter(t -> t.getId().equals(smsFieldEntity.getId())).findFirst().orElse(null); + if (smsFieldEntity1 == null) { + delSmsList.add(smsFieldEntity); + } + } + } + if (addSmsList != null && addSmsList.size() > 0) { + smsFieldService.saveBatch(addSmsList); + } + if (updSmsList != null && updSmsList.size() > 0) { + smsFieldService.updateBatchById(updSmsList); + } + if (delSmsList != null && delSmsList.size() > 0) { + smsFieldService.removeByIds(delSmsList.stream().map(SmsFieldEntity::getId).collect(Collectors.toList())); + } + } + return ActionResult.success("更新成功"); + } else { + return ActionResult.fail("更新失败,数据不存在"); + } + } + + + /** + * 删除 + * + * @param id 主键 + * @return ignore + */ + @Operation(summary = "删除") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("msgCenter.msgTemplate") + @DeleteMapping("/{id}") + @Transactional + public ActionResult delete(@PathVariable("id") String id) { + MessageTemplateConfigEntity entity = messageTemplateConfigService.getInfo(id); + if (entity != null) { + if(sendConfigTemplateService.isUsedTemplate(entity.getId())) { + return ActionResult.fail("此记录与“消息发送配置”关联引用,不允许被删除"); + } + messageTemplateConfigService.delete(entity); + QueryWrapper queryWrapperTemplateParam = new QueryWrapper<>(); + queryWrapperTemplateParam.lambda().eq(TemplateParamEntity::getTemplateId, entity.getId()); + templateParamService.remove(queryWrapperTemplateParam); + QueryWrapper queryWrapperSmsField = new QueryWrapper<>(); + queryWrapperSmsField.lambda().eq(SmsFieldEntity::getTemplateId, entity.getId()); + smsFieldService.remove(queryWrapperSmsField); + + } + return ActionResult.success("删除成功"); + } + + /** + * 开启或禁用 + * + * @param id + * @return + */ + @Operation(summary = "开启或禁用") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("msgCenter.msgTemplate") + @PostMapping("/unable/{id}") + @Transactional + public ActionResult unable(@PathVariable("id") String id) { + MessageTemplateConfigEntity entity = messageTemplateConfigService.getInfo(id); + if (entity != null) { + if("1".equals(String.valueOf(entity.getEnabledMark()))){ + entity.setEnabledMark(0); + return ActionResult.success("禁用成功"); + }else { + //判断是否被引用 + + entity.setEnabledMark(1); + return ActionResult.success("启用成功"); + } + }else { + return ActionResult.fail("操作失败,数据不存在"); + } + } + + /** + * 复制 + * + * @param id + * @return + */ + @Operation(summary = "复制") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("msgCenter.msgTemplate") + @PostMapping("/copy/{id}") + @Transactional + public ActionResult copy(@PathVariable("id") String id) { + UserInfo userInfo = userProvider.get(); + MessageTemplateConfigEntity entity = messageTemplateConfigService.getInfo(id); + if (entity != null) { + entity.setEnabledMark(0); + String copyNum = UUID.randomUUID().toString().substring(0, 5); + entity.setFullName(entity.getFullName()+".副本"+copyNum); + entity.setEnCode(entity.getEnCode()+copyNum); + entity.setCreatorTime(DateUtil.getNowDate()); + entity.setCreatorUserId(userInfo.getUserId()); + entity.setLastModifyTime(null); + entity.setLastModifyUserId(null); + entity.setTemplateType("0"); + entity.setId(RandomUtil.uuId()); + MessageTemplateConfigEntity copyEntity = JsonUtil.getJsonToBean(entity, MessageTemplateConfigEntity.class); + if(copyEntity.getEnCode().length()>50 || copyEntity.getFullName().length()>50){ + return ActionResult.fail("已到达该模板复制上限,请复制源模板"); + } + messageTemplateConfigService.create(copyEntity); + List copyParamList = new ArrayList<>(); + List baseParamList = templateParamService.getDetailListByParentId(id); + if(baseParamList != null && baseParamList.size()>0){ + for(TemplateParamEntity entitys : baseParamList){ + entitys.setId(RandomUtil.uuId()); + entitys.setTemplateId(copyEntity.getId()); + entitys.setCreatorTime(DateUtil.getNowDate()); + entitys.setCreatorUserId(userInfo.getUserId()); + copyParamList.add(entitys); + } + } + if(copyParamList != null && copyParamList.size()>0) { + templateParamService.saveBatch(copyParamList); + } + List copySmsList = new ArrayList<>(); + List baseSmsFieldList = smsFieldService.getDetailListByParentId(id); + if(baseSmsFieldList != null && baseSmsFieldList.size()>0){ + for(SmsFieldEntity entitys : baseSmsFieldList){ + entitys.setId(RandomUtil.uuId()); + entitys.setTemplateId(copyEntity.getId()); + entitys.setCreatorTime(DateUtil.getNowDate()); + entitys.setCreatorUserId(userInfo.getUserId()); + copySmsList.add(entitys); + } + } + if(copySmsList != null && copySmsList.size()>0){ + smsFieldService.saveBatch(copySmsList); + } + return ActionResult.success("复制数据成功"); + }else { + return ActionResult.fail("复制失败,数据不存在"); + } + } + + /** + * 导出消息模板 + * + * @param id 消息模板id + * @return ignore + */ + @Operation(summary = "导出") + @GetMapping("/{id}/Action/Export") + public ActionResult export(@PathVariable String id) { + MessageTemplateConfigEntity entity = messageTemplateConfigService.getInfo(id); + MessageTemplateConfigInfoVO vo = JsonUtil.getJsonToBean(entity, MessageTemplateConfigInfoVO.class); + //子表 + List BaseTemplateParamList = messageTemplateConfigService.getTemplateParamList(id); + vo.setTemplateParamList(BaseTemplateParamList); + List BaseSmsFieldList = messageTemplateConfigService.getSmsFieldList(id); + vo.setSmsFieldList(BaseSmsFieldList); + //导出文件 + DownloadVO downloadVO = fileExport.exportFile(vo, configValueUtil.getTemporaryFilePath(), entity.getFullName(), ModuleTypeEnum.MESSAGE_TEMPLATE.getTableName()); + return ActionResult.success(downloadVO); + } + + /** + * 导入消息模板 + * + * @param multipartFile 备份json文件 + * @return 执行结果标识 + */ + @Operation(summary = "导入") + @PostMapping(value = "/Action/Import", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public ActionResult importData(@RequestPart("file") MultipartFile multipartFile) throws DataException { + UserInfo userInfo = userProvider.get(); + //判断是否为.json结尾 + if (FileUtil.existsSuffix(multipartFile, ModuleTypeEnum.MESSAGE_TEMPLATE.getTableName())) { + return ActionResult.fail(MsgCode.IMP002.get()); + } + //获取文件内容 + String fileContent = FileUtil.getFileContent(multipartFile); + MessageTemplateConfigInfoVO infoVO = JsonUtil.getJsonToBean(fileContent, MessageTemplateConfigInfoVO.class); + MessageTemplateConfigEntity entity = JsonUtil.getJsonToBean(infoVO, MessageTemplateConfigEntity.class); + entity.setCreatorUserId(userInfo.getUserId()); + entity.setCreatorTime(DateUtil.getNowDate()); + //子表数据导入 + if (infoVO.getTemplateParamList() != null && infoVO.getTemplateParamList().size()>0) { + List templateParamList = JsonUtil.getJsonToList(infoVO.getTemplateParamList(), TemplateParamEntity.class); + templateParamService.saveBatch(templateParamList); + } + if(infoVO.getSmsFieldList() != null && infoVO.getSmsFieldList().size()>0){ + List smsFieldList = JsonUtil.getJsonToList(infoVO.getSmsFieldList(), SmsFieldEntity.class); + smsFieldService.saveBatch(smsFieldList); + } + return messageTemplateConfigService.ImportData(entity); + } + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-controller/src/main/java/jnpf/message/controller/SendMessageConfigController.java b/jnpf-java-boot/jnpf-message/jnpf-message-controller/src/main/java/jnpf/message/controller/SendMessageConfigController.java new file mode 100644 index 0000000..08a9215 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-controller/src/main/java/jnpf/message/controller/SendMessageConfigController.java @@ -0,0 +1,782 @@ + + + +package jnpf.message.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import jnpf.base.controller.SuperController; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.entity.DictionaryDataEntity; +import jnpf.base.entity.SysConfigEntity; +import jnpf.base.service.BillRuleService; +import jnpf.base.service.DictionaryDataService; +import jnpf.base.service.SysconfigService; +import jnpf.base.vo.PageListVO; +import jnpf.base.vo.PaginationVO; +import jnpf.base.UserInfo; +import jnpf.base.vo.DownloadVO; +import jnpf.config.ConfigValueUtil; +import jnpf.constant.MsgCode; +import jnpf.exception.DataException; +import jnpf.message.entity.*; +import jnpf.message.model.message.DingTalkModel; +import jnpf.message.model.messagetemplateconfig.TemplateParamModel; +import jnpf.message.model.sendmessageconfig.*; +import jnpf.message.service.*; +import jnpf.base.util.TestSendConfigUtil; +import jnpf.model.BaseSystemInfo; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.UserService; +import jnpf.emnus.ModuleTypeEnum; +import jnpf.util.FileExport; +import org.springframework.http.MediaType; +import org.springframework.transaction.annotation.Transactional; +import jnpf.util.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import java.io.IOException; + + +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; +import java.util.stream.Collectors; +import java.util.*; + +/** + * 消息发送配置 + * + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2022-08-19 + */ +@Slf4j +@RestController +@Tag(name = "消息发送配置", description = "message") +@RequestMapping("/api/message/SendMessageConfig") +public class SendMessageConfigController extends SuperController { + @Autowired + private FileExport fileExport; + + @Autowired + private BillRuleService billRuleService; + + @Autowired + private ConfigValueUtil configValueUtil; + + @Autowired + private UserProvider userProvider; + @Autowired + private UserService userApi; + + + + @Autowired + private SysconfigService sysconfigService; + @Autowired + private SendMessageConfigService sendMessageConfigService; + + @Autowired + private SendConfigTemplateService sendConfigTemplateService; + + @Autowired + private AccountConfigService accountConfigService; + + @Autowired + private MessageTemplateConfigService messageTemplateConfigService; + @Autowired + private DictionaryDataService dictionaryDataApi; + + @Autowired + private TestSendConfigUtil testSendConfigUtil; + + /** + * 列表 + * + * @param sendMessageConfigPagination 分页模型 + * @return + */ + @Operation(summary = "消息发送配置列表") + @SaCheckPermission("msgCenter.sendConfig") + @GetMapping + public ActionResult> list(SendMessageConfigPagination sendMessageConfigPagination) throws IOException { + List list = sendMessageConfigService.getList(sendMessageConfigPagination, null); + List msgSendTypeList = dictionaryDataApi.getListByTypeDataCode("msgSendType"); + List msgSourceTypeList = dictionaryDataApi.getListByTypeDataCode("msgSourceType"); + //处理id字段转名称,若无需转或者为空可删除 + UserEntity userEntity = new UserEntity(); + List listVO = JsonUtil.getJsonToList(list, SendMessageConfigListVO.class); + for (SendMessageConfigListVO sendMessageConfigVO : listVO) { + List> mapList = new ArrayList<>(); + //子表数据转换 + List sendConfigTemplateList = sendConfigTemplateService.getDetailListByParentId(sendMessageConfigVO.getId()); + if (sendConfigTemplateList != null && sendConfigTemplateList.size()>0) { + sendConfigTemplateList = sendConfigTemplateList.stream().sorted((a,b)->a.getMessageType().compareTo(b.getMessageType())).collect(Collectors.toList()); + List typeList = sendConfigTemplateList.stream().map(t -> t.getMessageType()).distinct().collect(Collectors.toList()); + if (typeList != null && typeList.size()>0) { + for(String type : typeList) { + String messageType = ""; + Map map = new HashMap<>(); + DictionaryDataEntity dataTypeEntity = msgSendTypeList.stream().filter(t -> t.getEnCode().equals(type)).findFirst().orElse(null); + if (dataTypeEntity != null) { + messageType = dataTypeEntity.getFullName(); + map.put("fullName",messageType); + map.put("type",type); + mapList.add(map); + } + } + sendMessageConfigVO.setMessageType(mapList); + } + } + if(StringUtil.isNotEmpty(sendMessageConfigVO.getCreatorUserId())){ + userEntity = userApi.getInfo(sendMessageConfigVO.getCreatorUserId()); + if(userEntity != null){ + sendMessageConfigVO.setCreatorUser(userEntity.getRealName() +"/"+ userEntity.getAccount()); + } + } + //消息来源 + if(StringUtil.isNotBlank(sendMessageConfigVO.getMessageSource())) { + msgSourceTypeList.stream().filter(t -> sendMessageConfigVO.getMessageSource().equals(t.getEnCode())).findFirst() + .ifPresent(dataTypeEntity -> sendMessageConfigVO.setMessageSource(dataTypeEntity.getFullName())); + } + } + + PageListVO vo = new PageListVO(); + vo.setList(listVO); + PaginationVO page = JsonUtil.getJsonToBean(sendMessageConfigPagination, PaginationVO.class); + vo.setPagination(page); + return ActionResult.success(vo); + } + + /** + * 获取发送配置下拉框 + * + * @return + */ + @Operation(summary = "获取发送配置下拉框") + @GetMapping("/Selector") + public ActionResult> selector(SendMessageConfigPagination sendMessageConfigPagination) { + List list = sendMessageConfigService.getSelectorList(sendMessageConfigPagination); + List listVO = JsonUtil.getJsonToList(list, SendMessageConfigListVO.class); + PageListVO vo = new PageListVO(); + vo.setList(listVO); + PaginationVO page = JsonUtil.getJsonToBean(sendMessageConfigPagination, PaginationVO.class); + vo.setPagination(page); + return ActionResult.success(vo); + } + + /** + * 消息发送配置弹窗列表 + * + * @param sendMessageConfigPagination 分页模型 + * @return + */ + @Operation(summary = "消息发送配置弹窗列表") + @GetMapping("/getSendConfigList") + public ActionResult> getSendConfigList(SendMessageConfigPagination sendMessageConfigPagination) throws IOException { + if(StringUtil.isBlank(sendMessageConfigPagination.getEnabledMark())) { + sendMessageConfigPagination.setEnabledMark("1"); + } + if(StringUtil.isBlank(sendMessageConfigPagination.getTemplateType())){ + sendMessageConfigPagination.setTemplateType("0"); + } + List list = sendMessageConfigService.getList(sendMessageConfigPagination, null); + //处理id字段转名称,若无需转或者为空可删除 + List msgSendTypeList = dictionaryDataApi.getListByTypeDataCode("msgSendType"); + List listVO = JsonUtil.getJsonToList(list, SendConfigListVO.class); + for (SendConfigListVO sendConfigVO : listVO) { + //子表数据转换 + List sendConfigTemplateList = sendConfigTemplateService.getDetailListByParentId(sendConfigVO.getId()); + sendConfigTemplateList = sendConfigTemplateList.stream().filter(t->"1".equals(String.valueOf(t.getEnabledMark()))).collect(Collectors.toList()); + List modelList = JsonUtil.getJsonToList(sendConfigTemplateList, SendConfigTemplateModel.class); + for(SendConfigTemplateModel model:modelList) { + if (modelList != null && modelList.size() > 0) { + List list1 = messageTemplateConfigService.getParamJson(model.getTemplateId()); +// if (list != null && list.size() > 0) { +// model.setParamJson(JsonUtil.getObjectToString(list1)); +// } + List jsonModels = new ArrayList<>(); + for(TemplateParamModel paramModel : list1){ + MsgTemplateJsonModel jsonModel = new MsgTemplateJsonModel(); + jsonModel.setField(paramModel.getField()); + jsonModel.setFieldName(paramModel.getFieldName()); + jsonModel.setMsgTemplateId(model.getId()); + jsonModels.add(jsonModel); + } + model.setParamJson(jsonModels); + MessageTemplateConfigEntity msgTemEntity = messageTemplateConfigService.getInfo(model.getTemplateId()); + if (msgTemEntity != null) { + model.setMsgTemplateName(msgTemEntity.getFullName()); + } + if (StringUtil.isNotEmpty(model.getMessageType())) { + msgSendTypeList.stream().filter(t -> model.getMessageType().equals(t.getEnCode())).findFirst() + .ifPresent(dataTypeEntity -> model.setMessageType(dataTypeEntity.getFullName())); + } + } + sendConfigVO.setTemplateJson(modelList); + } + } + + PageListVO vo = new PageListVO(); + vo.setList(listVO); + PaginationVO page = JsonUtil.getJsonToBean(sendMessageConfigPagination, PaginationVO.class); + vo.setPagination(page); + return ActionResult.success(vo); + } + + /** + * 创建 + * + * @param sendMessageConfigForm 发送消息配置模型 + * @return + */ + @Operation(summary = "创建") + @Parameters({ + @Parameter(name = "sendMessageConfigForm", description = "发送消息配置模型", required = true) + }) + @SaCheckPermission("msgCenter.sendConfig") + @PostMapping + @Transactional + public ActionResult create(@RequestBody @Valid SendMessageConfigForm sendMessageConfigForm) throws DataException { + boolean b = sendMessageConfigService.checkForm(sendMessageConfigForm, 0,""); + if (b) { + return ActionResult.fail("编码不能重复"); + } + if(!"1".equals(sendMessageConfigForm.getTemplateType())){ + if(sendMessageConfigForm.getEnCode().contains("PZXT")){ + return ActionResult.fail("自定义模板编码不能使用系统模板编码规则"); + } + } + String mainId = RandomUtil.uuId(); + UserInfo userInfo = userProvider.get(); + SendMessageConfigEntity entity = JsonUtil.getJsonToBean(sendMessageConfigForm, SendMessageConfigEntity.class); + entity.setCreatorUserId(userInfo.getUserId()); + entity.setCreatorTime(DateUtil.getNowDate()); + entity.setId(mainId); + + if (sendMessageConfigForm.getSendConfigTemplateList() != null) { + List SendConfigTemplateList = JsonUtil.getJsonToList(sendMessageConfigForm.getSendConfigTemplateList(), SendConfigTemplateEntity.class); + long dd = SendConfigTemplateList.stream().filter(t->t.getMessageType().equals("4")).count(); + long qy = SendConfigTemplateList.stream().filter(t->t.getMessageType().equals("5")).count(); + boolean isQy = true; + boolean isDd = true; + Map objModel = getSysConfig(); + if(qy > 0){ + BaseSystemInfo baseSystemInfo = JsonUtil.getJsonToBean(objModel, BaseSystemInfo.class); + // 企业号id + String corpId = baseSystemInfo.getQyhCorpId(); + // 应用凭证 + String agentId = baseSystemInfo.getQyhAgentId(); + // 凭证密钥 + String agentSecret = baseSystemInfo.getQyhAgentSecret(); + // 同步密钥 + String corpSecret = baseSystemInfo.getQyhCorpSecret(); + if(StringUtil.isNotEmpty(corpId) && StringUtil.isNotEmpty(agentId) && StringUtil.isNotEmpty(corpSecret) && StringUtil.isNotEmpty(agentSecret)){ + isQy = true; + }else { + isQy = false; + } + } + if(dd > 0){ + DingTalkModel dingTalkModel = JsonUtil.getJsonToBean(objModel, DingTalkModel.class); + // 钉钉企业号Id + String dingAgentId = dingTalkModel.getDingAgentId(); + // 应用凭证 + String dingSynAppKey = dingTalkModel.getDingSynAppKey(); + // 凭证密钥 + String dingSynAppSecret = dingTalkModel.getDingSynAppSecret(); + if(StringUtil.isNotEmpty(dingSynAppKey) && StringUtil.isNotEmpty(dingSynAppSecret) && StringUtil.isNotEmpty(dingAgentId)){ + isDd = true; + }else { + isDd = false; + } + } + if(!isQy){ + return ActionResult.fail("请先前往系统同步设置,配置企业微信账号"); + } + if(!isDd){ + return ActionResult.fail("请先前往系统同步设置,配置钉钉账号"); + } + for (SendConfigTemplateEntity entitys : SendConfigTemplateList) { + entitys.setId(RandomUtil.uuId()); + entitys.setSendConfigId(entity.getId()); + sendConfigTemplateService.save(entitys); + } + } + sendMessageConfigService.save(entity); + return ActionResult.success("创建成功"); + } + + + /** + * 信息 + * + * @param id 主键 + * @return + */ + @Operation(summary = "信息") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) { + SendMessageConfigEntity entity = sendMessageConfigService.getInfo(id); + SendMessageConfigInfoVO vo = JsonUtil.getJsonToBean(entity, SendMessageConfigInfoVO.class); + List msgSourceTypeList = dictionaryDataApi.getListByTypeDataCode("msgSourceType"); + if (StringUtil.isNotEmpty(vo.getMessageSource())) { + msgSourceTypeList.stream().filter(t -> vo.getMessageSource().equals(t.getEnCode())).findFirst() + .ifPresent(dataTypeEntity -> vo.setMessageSourceName(dataTypeEntity.getFullName())); + } + //子表 + List sendConfigTemplateList = sendMessageConfigService.getSendConfigTemplateList(id); + for (SendConfigTemplateEntity sendconfigtemplateEntity : sendConfigTemplateList) { + AccountConfigEntity accountConfigEntity = accountConfigService.getInfo(sendconfigtemplateEntity.getAccountConfigId()); + if(accountConfigEntity != null){ + sendconfigtemplateEntity.setAccountCode(accountConfigEntity.getEnCode()); + sendconfigtemplateEntity.setAccountName(accountConfigEntity.getFullName()); + } + MessageTemplateConfigEntity messageTemplateConfigEntity = messageTemplateConfigService.getInfo(sendconfigtemplateEntity.getTemplateId()); + if(messageTemplateConfigEntity != null){ + sendconfigtemplateEntity.setTemplateCode(messageTemplateConfigEntity.getEnCode()); + sendconfigtemplateEntity.setTemplateName(messageTemplateConfigEntity.getFullName()); + } + } + vo.setSendConfigTemplateList(sendConfigTemplateList); + //副表 + return ActionResult.success(vo); + } + + /** + * 根据编码获取信息 + * + * @param enCode 编码 + * @return + */ + @Operation(summary = "根据编码获取信息") + @Parameters({ + @Parameter(name = "enCode", description = "编码", required = true) + }) + @SaCheckPermission("msgCenter.sendConfig") + @GetMapping("/getInfoByEnCode/{enCode}") + public ActionResult getInfo(@PathVariable("enCode") String enCode) { + SendMessageConfigEntity entity = sendMessageConfigService.getInfoByEnCode(enCode); + SendMessageConfigInfoVO vo = JsonUtil.getJsonToBean(entity, SendMessageConfigInfoVO.class); + //子表 + List sendConfigTemplateList = sendMessageConfigService.getSendConfigTemplateList(entity.getId()); + for (SendConfigTemplateEntity sendconfigtemplateEntity : sendConfigTemplateList) { + AccountConfigEntity accountConfigEntity = accountConfigService.getInfo(sendconfigtemplateEntity.getAccountConfigId()); + if(accountConfigEntity != null){ + sendconfigtemplateEntity.setAccountCode(accountConfigEntity.getEnCode()); + sendconfigtemplateEntity.setAccountName(accountConfigEntity.getFullName()); + } + MessageTemplateConfigEntity messageTemplateConfigEntity = messageTemplateConfigService.getInfo(sendconfigtemplateEntity.getTemplateId()); + if(messageTemplateConfigEntity != null){ + sendconfigtemplateEntity.setTemplateCode(messageTemplateConfigEntity.getEnCode()); + sendconfigtemplateEntity.setTemplateName(messageTemplateConfigEntity.getFullName()); + } + } + vo.setSendConfigTemplateList(sendConfigTemplateList); + //副表 + return ActionResult.success(vo); + } + + /** + * 表单信息(详情页) + * + * @param id 主键 + * @return + */ + @Operation(summary = "表单信息(详情页)") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("msgCenter.sendConfig") + @GetMapping("/detail/{id}") + public ActionResult detailInfo(@PathVariable("id") String id) { + SendMessageConfigEntity entity = sendMessageConfigService.getInfo(id); + SendMessageConfigInfoVO vo = JsonUtil.getJsonToBean(entity, SendMessageConfigInfoVO.class); + + //子表数据转换 + List sendConfigTemplateList = sendMessageConfigService.getSendConfigTemplateList(id); + for(SendConfigTemplateEntity sendconfigtemplateEntity : sendConfigTemplateList){ + AccountConfigEntity accountConfigEntity = accountConfigService.getInfo(sendconfigtemplateEntity.getAccountConfigId()); + if(accountConfigEntity != null){ + sendconfigtemplateEntity.setAccountCode(accountConfigEntity.getEnCode()); + sendconfigtemplateEntity.setAccountName(accountConfigEntity.getFullName()); + } + MessageTemplateConfigEntity messageTemplateConfigEntity = messageTemplateConfigService.getInfo(sendconfigtemplateEntity.getTemplateId()); + if(messageTemplateConfigEntity != null){ + sendconfigtemplateEntity.setTemplateCode(messageTemplateConfigEntity.getEnCode()); + sendconfigtemplateEntity.setTemplateName(messageTemplateConfigEntity.getFullName()); + } + } + vo.setSendConfigTemplateList(sendConfigTemplateList); + return ActionResult.success(vo); + } + + + /** + * 更新 + * + * @param id 主键 + * @param sendMessageConfigForm 发送信息配置模型 + * @return + */ + @Operation(summary = "更新") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "sendMessageConfigForm", description = "发送信息配置模型", required = true) + }) + @SaCheckPermission("msgCenter.sendConfig") + @PutMapping("/{id}") + @Transactional + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid SendMessageConfigForm sendMessageConfigForm) throws DataException { + + boolean b = sendMessageConfigService.checkForm(sendMessageConfigForm, 0,sendMessageConfigForm.getId()); + if (b) { + return ActionResult.fail("编码不能重复"); + } + if("0".equals(sendMessageConfigForm.getEnabledMark())){ + if(sendMessageConfigService.idUsed(id)){ + return ActionResult.fail("此记录与“流程通知”关联引用,不允许被禁用"); + } + } + if(!"1".equals(sendMessageConfigForm.getTemplateType())){ + if(sendMessageConfigForm.getEnCode().contains("PZXT")){ + return ActionResult.fail("自定义模板编码不能使用系统模板编码规则"); + } + } + UserInfo userInfo = userProvider.get(); + SendMessageConfigEntity entity = sendMessageConfigService.getInfo(id); + if (entity != null) { + SendMessageConfigEntity subentity = JsonUtil.getJsonToBean(sendMessageConfigForm, SendMessageConfigEntity.class); + subentity.setCreatorUserId(entity.getCreatorUserId()); + subentity.setCreatorTime(entity.getCreatorTime()); + subentity.setLastModifyUserId(userInfo.getUserId()); + subentity.setLastModifyTime(DateUtil.getNowDate()); + + //明细表数据更新 + List addTemplateList = new ArrayList<>(); + List updTemplateList = new ArrayList<>(); + List delTemplateList = new ArrayList<>(); + if (sendMessageConfigForm.getSendConfigTemplateList() != null) { + List sendConfigTemplateEntityList = JsonUtil.getJsonToList(sendMessageConfigForm.getSendConfigTemplateList(), SendConfigTemplateEntity.class); + long dd = sendConfigTemplateEntityList.stream().filter(t->t.getMessageType().equals("4")).count(); + long qy = sendConfigTemplateEntityList.stream().filter(t->t.getMessageType().equals("5")).count(); + boolean isQy = true; + boolean isDd = true; + Map objModel = getSysConfig(); + if(qy > 0){ + BaseSystemInfo baseSystemInfo = JsonUtil.getJsonToBean(objModel, BaseSystemInfo.class); + // 企业号id + String corpId = baseSystemInfo.getQyhCorpId(); + // 应用凭证 + String agentId = baseSystemInfo.getQyhAgentId(); + // 凭证密钥 + String agentSecret = baseSystemInfo.getQyhAgentSecret(); + // 同步密钥 + String corpSecret = baseSystemInfo.getQyhCorpSecret(); + if(StringUtil.isNotEmpty(corpId) && StringUtil.isNotEmpty(agentId) && StringUtil.isNotEmpty(corpSecret) && StringUtil.isNotEmpty(agentSecret)){ + isQy = true; + }else { + isQy = false; + } + } + if(dd > 0){ + DingTalkModel dingTalkModel = JsonUtil.getJsonToBean(objModel, DingTalkModel.class); + // 钉钉企业号Id + String dingAgentId = dingTalkModel.getDingAgentId(); + // 应用凭证 + String dingSynAppKey = dingTalkModel.getDingSynAppKey(); + // 凭证密钥 + String dingSynAppSecret = dingTalkModel.getDingSynAppSecret(); + if(StringUtil.isNotEmpty(dingSynAppKey) && StringUtil.isNotEmpty(dingSynAppSecret) && StringUtil.isNotEmpty(dingAgentId)){ + isDd = true; + }else { + isDd = false; + } + } + if(!isQy){ + return ActionResult.fail("请先前往系统同步设置,配置企业微信账号"); + } + if(!isDd){ + return ActionResult.fail("请先前往系统同步设置,配置钉钉账号"); + } + for (SendConfigTemplateEntity entitys : sendConfigTemplateEntityList) { + SendConfigTemplateEntity templateEntity = sendConfigTemplateService.getInfo(entitys.getId()); + if(templateEntity != null){ + templateEntity.setSendConfigId(entity.getId()); + templateEntity.setId(entitys.getId()); + templateEntity.setEnabledMark(entitys.getEnabledMark()); + templateEntity.setCreatorTime(entitys.getCreatorTime()); + templateEntity.setCreatorUserId(entitys.getCreatorUserId()); + templateEntity.setDescription(entitys.getDescription()); + templateEntity.setAccountConfigId(entitys.getAccountConfigId()); + templateEntity.setSortCode(entitys.getSortCode()); + templateEntity.setLastModifyTime(DateUtil.getNowDate()); + templateEntity.setLastModifyUserId(userInfo.getUserId()); + templateEntity.setTemplateId(entitys.getTemplateId()); + updTemplateList.add(templateEntity); + }else { + entitys.setId(RandomUtil.uuId()); + entitys.setSendConfigId(entity.getId()); + entitys.setCreatorUserId(userInfo.getUserId()); + entitys.setCreatorTime(DateUtil.getNowDate()); + addTemplateList.add(entitys); + } + } + //删除参数记录 + List paramEntityList = sendConfigTemplateService.getDetailListByParentId(entity.getId()); + if (paramEntityList != null) { + for (SendConfigTemplateEntity templateEntity : paramEntityList) { + SendConfigTemplateEntity templateEntity1 = sendConfigTemplateEntityList.stream().filter(t -> t.getId().equals(templateEntity.getId())).findFirst().orElse(null); + if (templateEntity1 == null) { + delTemplateList.add(templateEntity); + } + } + } + if (addTemplateList != null && addTemplateList.size() > 0) { + sendConfigTemplateService.saveBatch(addTemplateList); + } + if (updTemplateList != null && updTemplateList.size() > 0) { + sendConfigTemplateService.updateBatchById(updTemplateList); + } + if (delTemplateList != null && delTemplateList.size() > 0) { + sendConfigTemplateService.removeByIds(delTemplateList.stream().map(SendConfigTemplateEntity::getId).collect(Collectors.toList())); + } + } + boolean b1 = sendMessageConfigService.updateById(subentity); + if (!b1) { + return ActionResult.fail("当前表单原数据已被调整,请重新进入该页面编辑并提交数据"); + } + return ActionResult.success("更新成功"); + } else { + return ActionResult.fail("更新失败,数据不存在"); + } + } + + + /** + * 删除 + * + * @param id 主键 + * @return + */ + @Operation(summary = "删除") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("msgCenter.sendConfig") + @DeleteMapping("/{id}") + @Transactional + public ActionResult delete(@PathVariable("id") String id) { + SendMessageConfigEntity entity = sendMessageConfigService.getInfo(id); + if (entity != null) { + if(sendMessageConfigService.idUsed(id)){ + return ActionResult.fail("删除失败,此记录与“流程通知”关联引用,不允许被删除"); + } + sendMessageConfigService.delete(entity); + QueryWrapper queryWrapperSendConfigTemplate = new QueryWrapper<>(); + queryWrapperSendConfigTemplate.lambda().eq(SendConfigTemplateEntity::getSendConfigId, entity.getId()); + sendConfigTemplateService.remove(queryWrapperSendConfigTemplate); + + } + return ActionResult.success("删除成功"); + } + + /** + * 获取消息发送配置 + * + * @param id 发送配置id + * @return + */ + @Operation(summary = "获取消息发送配置") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("msgCenter.sendConfig") + @PostMapping("/getTestConfig/{id}") + @Transactional + public ActionResult getTestConfig(@PathVariable("id") String id){ + List configTemplateList = sendConfigTemplateService.getConfigTemplateListByConfigId(id); + List msgSendTypeList = dictionaryDataApi.getListByTypeDataCode("msgSendType"); + if(configTemplateList != null && configTemplateList.size()>0){ + List modelList = JsonUtil.getJsonToList(configTemplateList, SendConfigTemplateModel.class); + for(SendConfigTemplateModel model:modelList){ + List list = messageTemplateConfigService.getParamJson(model.getTemplateId()); + if(list!=null && list.size()>0){ + model.setParamJson(list); + } + MessageTemplateConfigEntity msgTemEntity = messageTemplateConfigService.getInfo(model.getTemplateId()); + if(msgTemEntity != null){ + model.setMsgTemplateName(msgTemEntity.getFullName()); + } + if(StringUtil.isNotEmpty(model.getMessageType())){ + msgSendTypeList.stream().filter(t -> model.getMessageType().equals(t.getEnCode())).findFirst() + .ifPresent(dataTypeEntity -> model.setMessageType(dataTypeEntity.getFullName())); + } + } + return ActionResult.success(modelList); + }else { + return ActionResult.fail("配置模板无数据,无法测试"); + } + } + + /** + * 测试消息发送配置 + * + * @param modelList 发送配置 + * @return + */ + @Operation(summary = "测试消息发送配置") + @Parameters({ + @Parameter(name = "modelList", description = "发送配置", required = true) + }) + @SaCheckPermission("msgCenter.sendConfig") + @PostMapping("/testSendConfig") + @Transactional + public ActionResult testSendConfig(@RequestBody @Valid List modelList) throws NoSuchAlgorithmException, InvalidKeyException { + UserInfo userInfo = userProvider.get(); + List resultList = new ArrayList<>(); + List msgSendTypeList = dictionaryDataApi.getListByTypeDataCode("msgSendType"); + if(modelList != null && modelList.size()>0){ + for(SendConfigTemplateModel model: modelList){ + SendConfigTestResultModel resultModel = new SendConfigTestResultModel(); + String result = testSendConfigUtil.sendMessage(model,userInfo); + MessageTemplateConfigEntity msgTemEntity = messageTemplateConfigService.getInfo(model.getTemplateId()); + if(msgTemEntity != null) { + msgSendTypeList.stream().filter(t -> msgTemEntity.getMessageType().equals(t.getEnCode())).findFirst() + .ifPresent(dataTypeEntity -> resultModel.setMessageType("消息类型:" + dataTypeEntity.getFullName())); + resultModel.setResult(result); + if (result != null) { + resultModel.setIsSuccess("0"); + } else { + resultModel.setIsSuccess("1"); + } + } + resultList.add(resultModel); + } + } + return ActionResult.success(resultList); + } + + /** + * 复制 + * + * @param id 主键 + * @return + */ + @Operation(summary = "复制") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("msgCenter.sendConfig") + @PostMapping("/copy/{id}") + @Transactional + public ActionResult copy(@PathVariable("id") String id) { + UserInfo userInfo = userProvider.get(); + SendMessageConfigEntity entity = sendMessageConfigService.getInfo(id); + if (entity != null) { + entity.setEnabledMark(0); + String copyNum = UUID.randomUUID().toString().substring(0, 5); + entity.setFullName(entity.getFullName()+".副本"+copyNum); + entity.setEnCode(entity.getEnCode()+copyNum); + entity.setCreatorTime(DateUtil.getNowDate()); + entity.setCreatorUserId(userInfo.getUserId()); + entity.setLastModifyTime(null); + entity.setLastModifyUserId(null); + entity.setTemplateType("0"); + entity.setId(RandomUtil.uuId()); + SendMessageConfigEntity copyEntity = JsonUtil.getJsonToBean(entity, SendMessageConfigEntity.class); + if(copyEntity.getEnCode().length()>50 || copyEntity.getFullName().length()>50){ + return ActionResult.fail("已到达该模板复制上限,请复制源模板"); + } + sendMessageConfigService.create(copyEntity); + List copyConfigTemplateList = new ArrayList<>(); + List configTemplateList = sendConfigTemplateService.getDetailListByParentId(id); + if(configTemplateList != null && configTemplateList.size()>0){ + for(SendConfigTemplateEntity entitys : configTemplateList){ + entitys.setId(RandomUtil.uuId()); + entitys.setSendConfigId(copyEntity.getId()); + entitys.setCreatorTime(DateUtil.getNowDate()); + entitys.setCreatorUserId(userInfo.getUserId()); + copyConfigTemplateList.add(entitys); + } + } + if(copyConfigTemplateList != null && copyConfigTemplateList.size()>0) { + sendConfigTemplateService.saveBatch(copyConfigTemplateList); + } + return ActionResult.success("复制数据成功"); + }else { + return ActionResult.fail("复制失败,数据不存在"); + } + } + + /** + * 导出消息发送配置 + * + * @param id 账号配置id + * @return ignore + */ + @Operation(summary = "导出") + @GetMapping("/{id}/Action/Export") + public ActionResult export(@PathVariable String id) { + SendMessageConfigEntity entity = sendMessageConfigService.getInfo(id); + SendMessageConfigInfoVO vo = JsonUtil.getJsonToBean(entity, SendMessageConfigInfoVO.class); + + //子表数据 + List sendConfigTemplateList = sendMessageConfigService.getSendConfigTemplateList(id); + vo.setSendConfigTemplateList(sendConfigTemplateList); + //导出文件 + DownloadVO downloadVO = fileExport.exportFile(vo, configValueUtil.getTemporaryFilePath(), entity.getFullName(), ModuleTypeEnum.MESSAGE_SEND_CONFIG.getTableName()); + return ActionResult.success(downloadVO); + } + + /** + * 导入账号配置 + * + * @param multipartFile 备份json文件 + * @return 执行结果标识 + */ + @Operation(summary = "导入") + @PostMapping(value = "/Action/Import", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public ActionResult importData(@RequestPart("file") MultipartFile multipartFile) throws DataException { + UserInfo userInfo = userProvider.get(); + //判断是否为.json结尾 + if (FileUtil.existsSuffix(multipartFile, ModuleTypeEnum.MESSAGE_SEND_CONFIG.getTableName())) { + return ActionResult.fail(MsgCode.IMP002.get()); + } + //获取文件内容 + String fileContent = FileUtil.getFileContent(multipartFile); + SendMessageConfigInfoVO infoVO = JsonUtil.getJsonToBean(fileContent, SendMessageConfigInfoVO.class); + SendMessageConfigEntity entity = JsonUtil.getJsonToBean(infoVO, SendMessageConfigEntity.class); + entity.setCreatorUserId(userInfo.getUserId()); + entity.setCreatorTime(DateUtil.getNowDate()); + if (infoVO.getSendConfigTemplateList() != null) { + List sendConfigTemplateList = JsonUtil.getJsonToList(infoVO.getSendConfigTemplateList(), SendConfigTemplateEntity.class); + sendConfigTemplateService.saveBatch(sendConfigTemplateList); + } + return sendMessageConfigService.ImportData(entity); + } + + + public Map getSysConfig() { + Map objModel = new HashMap<>(); + List configList = sysconfigService.getList("SysConfig"); + for (SysConfigEntity entity : configList) { + objModel.put(entity.getFkey(), entity.getValue()); + } + return objModel; + } +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-controller/src/main/java/jnpf/message/controller/ShortLinkController.java b/jnpf-java-boot/jnpf-message/jnpf-message-controller/src/main/java/jnpf/message/controller/ShortLinkController.java new file mode 100644 index 0000000..3dce291 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-controller/src/main/java/jnpf/message/controller/ShortLinkController.java @@ -0,0 +1,126 @@ +package jnpf.message.controller; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import jnpf.base.controller.SuperController; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.util.NoDataSourceBind; +import jnpf.config.ConfigValueUtil; +import jnpf.config.JnpfOauthConfig; +import jnpf.consts.DeviceType; +import jnpf.database.util.TenantDataSourceUtil; +import jnpf.exception.LoginException; +import jnpf.message.entity.ShortLinkEntity; +import jnpf.message.service.ShortLinkService; +import jnpf.permission.service.UserService; +import jnpf.util.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +@Slf4j +@RestController +@Tag(name = "短链接跳转", description = "message") +@RequestMapping("/api/message/ShortLink") +public class ShortLinkController extends SuperController { + @Autowired + private UserProvider userProvider; + @Autowired + private UserService userService; + @Autowired + private ShortLinkService shortLinkService; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private JnpfOauthConfig jnpfOauthConfig; + @Autowired + protected AuthUtil authUtil; + + + + /** + * 消息发送配置弹窗列表 + * + * + * @return + */ + @NoDataSourceBind + @Operation(summary = "根据短链接获取实际链接地址") + @Parameters({ + @Parameter(name = "shortLink", description = "短链接", required = true), + @Parameter(name = "tenant", description = "租户") + }) + @GetMapping(value = {"/{shortLink}/{tenant}","/{shortLink}"}) + public ActionResult getShortUrl(@PathVariable("shortLink") String shortLink,@PathVariable(value = "tenant" , required = false) String tenant,HttpServletResponse response) throws LoginException, IOException { + if (configValueUtil.isMultiTenancy()) { + if (StringUtil.isNotEmpty(tenant)) { + //切换成租户库 + TenantDataSourceUtil.switchTenant(tenant); + } else { + return ActionResult.fail("缺少租户信息"); + } + } + String link = new String(); + ShortLinkEntity entity = shortLinkService.getInfoByLink(shortLink); + DeviceType type = UserProvider.getDeviceForAgent(); + if (entity != null) { +// String encode = ""; + String token = authUtil.loginTempUser(entity.getUserId(), tenant); + if (StringUtil.isEmpty(token)) { + return ActionResult.fail("获取token失败"); + } +// if(StringUtil.isNotEmpty(entity.getShortLink())) { +// String bodyText = entity.getBodyText(); +// Map map = new HashMap<>(); +// map = JsonUtil.stringToMap(bodyText); +// map.put("token", token); +// bodyText = map.toString(); +// byte[] bytes = bodyText.getBytes(StandardCharsets.UTF_8); +// encode = Base64.getEncoder().encodeToString(bytes); +// } + if (entity.getIsUsed() == 1) { + if (entity.getClickNum() < entity.getUnableNum() && entity.getUnableTime().after(DateUtil.getNowDate())) { + if (DeviceType.PC.equals(type)) { + link = entity.getRealPcLink() + "&token=" + token; + entity.setClickNum(entity.getClickNum()+1); + shortLinkService.updateById(entity); + } else { + link = entity.getRealAppLink() + "&token=" + token; + entity.setClickNum(entity.getClickNum()+1); + shortLinkService.updateById(entity); + } + } else { + return ActionResult.fail("链接已失效"); + } + } else { + if (entity.getUnableTime().after(DateUtil.getNowDate())) { + if (DeviceType.PC.equals(type)) { + link = entity.getRealPcLink() + "&token=" + token; + entity.setClickNum(entity.getClickNum()+1); + shortLinkService.updateById(entity); + } else { + link = entity.getRealAppLink() + "&token=" + token; + entity.setClickNum(entity.getClickNum()+1); + shortLinkService.updateById(entity); + } + } else { + return ActionResult.fail("链接已失效"); + } + } + + } else { + return ActionResult.fail("无效链接"); + } + response.sendRedirect(link); + return ActionResult.success(""); + } + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-controller/src/main/java/jnpf/message/controller/WxGZHFunctionController.java b/jnpf-java-boot/jnpf-message/jnpf-message-controller/src/main/java/jnpf/message/controller/WxGZHFunctionController.java new file mode 100644 index 0000000..9417348 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-controller/src/main/java/jnpf/message/controller/WxGZHFunctionController.java @@ -0,0 +1,269 @@ +package jnpf.message.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONObject; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jdk.nashorn.internal.parser.Token; +import jnpf.base.entity.SysConfigEntity; +import jnpf.base.service.SysconfigService; +import jnpf.message.entity.AccountConfigEntity; +import jnpf.message.entity.WechatUserEntity; +import jnpf.message.service.AccountConfigService; +import jnpf.message.service.WechatUserService; +import jnpf.message.util.weixingzh.WXGZHWebChatUtil; +import jnpf.message.util.weixingzh.aes.WXBizMsgCrypt; +import jnpf.model.BaseSystemInfo; +import jnpf.permission.entity.SocialsUserEntity; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.SocialsUserService; +import jnpf.permission.service.UserService; +import jnpf.util.DateUtil; +import jnpf.util.JsonUtil; +import jnpf.util.RandomUtil; +import jnpf.util.StringUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 发送消息模型 + */ +@Tag(name = "微信公众号事件接收", description = "WechatOpen") +@Controller +@RequestMapping("/api/message/WechatOpen") +@Slf4j +public class WxGZHFunctionController { + + @Autowired + private UserService userService; + @Autowired + private SysconfigService sysconfigService; + @Autowired + private AccountConfigService accountConfigService; + @Autowired + private SocialsUserService socialsUserService; + @Autowired + private WechatUserService wechatUserService; + + /** + * 服务器基本配置链接微信公众号验证 + * + * @param request 请求对象 + * @param response 响应对象 + * @return + */ + @Operation(summary = "服务器基本配置链接微信公众号验证") + @ResponseBody + @SaCheckPermission("msgCenter.sendConfig") + @Parameters({ + @Parameter(name = "enCode", description = "微信公众号账号配置编码", required = true) + }) + @GetMapping("/token/{enCode}") + public String token(@PathVariable("enCode") String enCode, HttpServletRequest request, HttpServletResponse response) throws Exception { + //获取微信公众号账号配置 + AccountConfigEntity accountConfigEntity = accountConfigService.getInfoByEnCode(enCode,"7"); + if(ObjectUtil.isEmpty(accountConfigEntity)){ + log.info("未找到与编码相对应的微信公众号配置"); + return ""; + } + //微信公众号服务器配置token + String wxToken = accountConfigEntity.getAgentId(); + String signature = request.getParameter("signature"); + String echostr = request.getParameter("echostr"); + String timestamp = request.getParameter("timestamp"); + String nonce = request.getParameter("nonce"); + + String sortStr = WXGZHWebChatUtil.sort(wxToken,timestamp,nonce); + String MySinStr = WXGZHWebChatUtil.shal(sortStr); + if(StringUtil.isNotBlank(signature) && MySinStr.equals(signature)){ + return echostr; + }else { + log.info("微信公众号链接失败"); + return echostr; + } + } + + + /** + * 微信公众号事件请求 + * + * @param request 请求对象 + * @param response 响应对象 + * @return + * @throws Exception + */ + @Operation(summary = "微信公众号事件请求") + @SaCheckPermission("msgCenter.sendConfig") + @ResponseBody + @PostMapping("/token/{enCode}") + /** + * 微信公众号事件请求 + */ + public String tokenPost(@PathVariable("enCode") String enCode,HttpServletRequest request, HttpServletResponse response) throws Exception { + log.info("微信公众号请求事件"); + //获取微信公众号账号配置 + AccountConfigEntity accountConfigEntity = accountConfigService.getInfoByEnCode(enCode,"7"); + if(ObjectUtil.isEmpty(accountConfigEntity)){ + log.info("未找到与编码相对应的微信公众号配置"); + return ""; + } + //微信公众号服务器配置token + String wxToken = accountConfigEntity.getAgentId(); + //微信公众号服务器配置EncodingAesKey + String encodingAesKey = accountConfigEntity.getBearer(); + //微信公众号AppId + String wxAppId = accountConfigEntity.getAppId(); + + // 获取系统配置 + String msgSignature = request.getParameter("msg_signature"); + String encrypt_type = request.getParameter("encrypt_type"); + String signature = request.getParameter("signature"); + String echostr = request.getParameter("echostr"); + String timestamp = request.getParameter("timestamp"); + String nonce = request.getParameter("nonce"); + + String sortStr = WXGZHWebChatUtil.sort(wxToken,timestamp,nonce); + String MySinStr = WXGZHWebChatUtil.shal(sortStr); + //验签 + if(StringUtil.isNotBlank(signature) && MySinStr.equals(signature)){ + //事件信息 + Map map = WXGZHWebChatUtil.parseXml(request); + //事件信息 + String Event = map.get("Event"); + String openid = map.get("FromUserName"); + //公众号原始id + String gzhId = map.get("ToUserName"); + if("aes".equals(encrypt_type)) { + WXBizMsgCrypt pc = new WXBizMsgCrypt(wxToken, encodingAesKey, wxAppId); + String encrypt = map.get("Encrypt"); + String format = ""; + String fromXML = String.format(format, encrypt); + // 获取解密后消息明文 + String result = pc.decryptMsg(msgSignature, timestamp, nonce, fromXML); + + Map resultMap = new HashMap<>(); + resultMap = WXGZHWebChatUtil.xmlToMap(result); + // 获取解密后事件信息 + Event = resultMap.get("Event"); + openid = resultMap.get("FromUserName"); + gzhId = resultMap.get("ToUserName"); + } + + String appId = accountConfigEntity.getAppId(); + String appsecret = accountConfigEntity.getAppSecret(); + String token = WXGZHWebChatUtil.getAccessToken(appId,appsecret); + if("subscribe".equals(Event)){ + //用户关注事件 + if(StringUtil.isNotBlank(token)){ + JSONObject rstObj = WXGZHWebChatUtil.getUsetInfo(token,openid); + if(rstObj.containsKey("unionid")){ + String unionid = rstObj.getString("unionid"); + SocialsUserEntity socialsUserEntity = socialsUserService.getInfoBySocialId(unionid,"wechat_open"); + if(socialsUserEntity==null){ + log.info("微信公众号未绑定系统账号,请登录小程序绑定"); + return ""; + }else{ + WechatUserEntity wechatUserEntity = wechatUserService.getInfoByGzhId(socialsUserEntity.getUserId(),gzhId); + if(wechatUserEntity==null){ + WechatUserEntity entity = new WechatUserEntity(); + entity.setId(RandomUtil.uuId()); + entity.setUserId(socialsUserEntity.getUserId()); + entity.setGzhId(gzhId); + entity.setCloseMark(1); + entity.setCreatorTime(DateUtil.getNowDate()); + entity.setOpenId(openid); + wechatUserService.create(entity); + return ""; + }else { + if(wechatUserEntity.getCloseMark()==0){ + wechatUserEntity.setCloseMark(1); + } + wechatUserEntity.setOpenId(openid); + wechatUserEntity.setLastModifyTime(DateUtil.getNowDate()); + wechatUserService.update(wechatUserEntity.getId(),wechatUserEntity); + } + return ""; + } + }else{ + log.info("微信公众号未绑定系统账号,请登录小程序绑定"); + return ""; + } + }else{ + log.error("微信公众号token错误,请查看配置"); + return ""; + } + }else if("unsubscribe".equals(Event)){ + //用户取消关注事件 + if(StringUtil.isNotBlank(token)){ + JSONObject rstObj = WXGZHWebChatUtil.getUsetInfo(token,openid); + if(rstObj.containsKey("unionid")){ + String unionid = rstObj.getString("unionid"); + SocialsUserEntity socialsUserEntity = socialsUserService.getInfoBySocialId(unionid,"wechat_open"); + if(socialsUserEntity==null){ + log.info("微信公众号未绑定系统账号,请登录小程序绑定"); + }else{ + WechatUserEntity wechatUserEntity = wechatUserService.getInfoByGzhId(socialsUserEntity.getUserId(),gzhId); + if(wechatUserEntity==null){ + WechatUserEntity entity = new WechatUserEntity(); + entity.setId(RandomUtil.uuId()); + entity.setUserId(socialsUserEntity.getUserId()); + entity.setGzhId(gzhId); + entity.setCloseMark(0); + entity.setCreatorTime(DateUtil.getNowDate()); + entity.setOpenId(openid); + wechatUserService.create(entity); + return ""; + }else { + if(wechatUserEntity.getCloseMark()==1){ + wechatUserEntity.setCloseMark(0); + } + wechatUserEntity.setOpenId(openid); + wechatUserEntity.setLastModifyTime(DateUtil.getNowDate()); + wechatUserService.update(wechatUserEntity.getId(),wechatUserEntity); + return ""; + } + } + }else{ + log.info("微信公众号未绑定系统账号,请登录小程序绑定"); + return ""; + } + }else{ + log.error("微信公众号token错误,请查看配置"); + return ""; + } + return ""; + }else { + return ""; + } + }else { + log.info("微信公众号事件请求失败"); + return echostr; + } + } + + /** + * 获取系统配置 + */ + private Map getSystemConfig() { + // 获取系统配置 + List configList = sysconfigService.getList("SysConfig"); + Map objModel = new HashMap<>(16); + for (SysConfigEntity entity : configList) { + objModel.put(entity.getFkey(), entity.getValue()); + } + return objModel; + } + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-controller/src/main/java/jnpf/message/websocket/WebSocket.java b/jnpf-java-boot/jnpf-message/jnpf-message-controller/src/main/java/jnpf/message/websocket/WebSocket.java new file mode 100644 index 0000000..9191247 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-controller/src/main/java/jnpf/message/websocket/WebSocket.java @@ -0,0 +1,476 @@ +package jnpf.message.websocket; + +import com.alibaba.fastjson.JSONObject; +import com.google.common.collect.ImmutableMap; +import jnpf.base.PageModel; +import jnpf.base.UserInfo; +import jnpf.base.service.SysconfigService; +import jnpf.config.ConfigValueUtil; +import jnpf.message.entity.MessageReceiveEntity; +import jnpf.message.service.UserDeviceService; +import jnpf.message.util.*; +import jnpf.message.util.unipush.UinPush; +import jnpf.util.data.DataSourceContextHolder; +import jnpf.message.entity.ImContentEntity; +import jnpf.message.entity.MessageEntity; +import jnpf.message.model.message.PaginationMessage; +import jnpf.message.model.websocket.onconnettion.OnConnectionModel; +import jnpf.message.model.websocket.onconnettion.OnLineModel; +import jnpf.message.model.websocket.receivemessage.ReceiveMessageModel; +import jnpf.message.model.websocket.savafile.ImageMessageModel; +import jnpf.message.model.websocket.savafile.VoiceMessageModel; +import jnpf.message.model.websocket.savamessage.SavaMessageModel; +import jnpf.message.service.ImContentService; +import jnpf.message.service.MessageService; +import jnpf.message.model.ImUnreadNumModel; +import jnpf.model.BaseSystemInfo; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.UserService; +import jnpf.util.*; +import jnpf.util.JsonUtil; +import jnpf.util.context.SpringContext; +import lombok.extern.slf4j.Slf4j; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Component; + +import javax.websocket.*; +import javax.websocket.server.PathParam; +import javax.websocket.server.ServerEndpoint; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 消息聊天 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +@Slf4j +@Component +@ServerEndpoint(value = "/api/message/websocket/{token}") +@Scope("prototype") +public class WebSocket { + + private UserProvider userProvider; + private ImContentService imContentService; + private MessageService messageService; + private ConfigValueUtil configValueUtil; + private UserInfo userInfo; + private UserService userApi; + private SysconfigService sysConfigApi; + private UinPush uinPush; + private UserDeviceService userDeviceService; + + + /** + * 连接建立成功调用的方法 + */ + @OnOpen + public void onOpen(Session session, @PathParam("token") String token) { + this.init(); + this.userInfo = userProvider.get(token); + if (this.userInfo.getUserId() == null) { + try{ + OnlineUserProvider.closeFrontWs(null, session); + session.close(); + }catch (Exception e){} + log.info("WS建立链接, TOKEN无效:{}, {}", session.getId(), token); + }else { + log.info("WS建立链接:{}, {}", session.getId(), token); + } + } + + /** + * 连接关闭调用的方法 + */ + @OnClose + public void onClose(Session session) { + OnlineUserModel user = OnlineUserProvider.getOnlineUserList().stream().filter(t -> t.getConnectionId().equals(session.getId())).findFirst().orElse(null); + if (user != null) { + OnlineUserProvider.removeWebSocketByToken(user.getToken()); + log.info("WS连接断开: {}, {}, {}, {}", user.getTenantId(), user.getUserId(), session.getId(), user.getToken()); + }else{ + log.debug("WS连接断开, 无用户信息: {}", session.getId()); + } + } + + /** + * 收到客户端消息后调用的方法 + * + * @param message 客户端发送过来的消息 + */ + @OnMessage + public void onMessage(String message, Session session) { + try{ + processMessage(message, session); + }finally { + //多租户切换后清除缓存 + DataSourceContextHolder.clearDatasourceType(); + } + } + + private void processMessage(String message, Session session){ + log.debug("WS消息内容: {}, {}", session.getId(), message); + JSONObject receivedMessage = JSONObject.parseObject(message); + String receivedMethod = receivedMessage.getString(MessageParameterEnum.PARAMETER_METHOD.getValue()); + String receivedToken = receivedMessage.getString(MessageParameterEnum.PARAMETER_TOKEN.getValue()); + //验证TOKEN + this.userInfo = userProvider.get(receivedMessage.getString(MessageParameterEnum.PARAMETER_TOKEN.getValue())); + if (this.userInfo.getUserId() == null) { + log.info("WSToken无效: {}, {}", session.getId(), message); + OnlineUserProvider.closeFrontWs(null, session); + return; + } + //判断是否为多租户 + if(!isMultiTenancy()){ + log.info("WS切库失败: {}, {}, {}, {}", userInfo.getTenantId(), userInfo.getUserId(), session.getId(), receivedToken); + //切库失败 + OnlineUserProvider.closeFrontWs(null, session); + } + switch (receivedMethod) { + case ConnectionType.CONNECTION_ONCONNECTION: + //建立连接 + log.info("WS开启连接: {}, {}, {}, {}", userInfo.getTenantId(), userInfo.getUserId(), session.getId(), receivedToken); + if(OnlineUserProvider.getOnlineUserList().stream().anyMatch(t -> t.getWebSocket().getId().equals(session.getId()))){ + //WS已存在 + log.info("WS已存在: {}, {}, {}, {}", userInfo.getTenantId(), userInfo.getUserId(), session.getId(), receivedToken); + return; + } + //Token已存在, 关闭之前的WebSocket, 继续执行后续代码添加新的WebSocket + List tokenList = OnlineUserProvider.getOnlineUserList().stream().filter(t-> { + if(receivedToken.equals(t.getToken())){ + OnlineUserProvider.closeFrontWs(t, t.getWebSocket()); + return true; + } + return false; + }).collect(Collectors.toList()); + OnlineUserProvider.getOnlineUserList().removeAll(tokenList); + + //app-true, PC-false + Boolean isMobileDevice = receivedMessage.getBoolean(MessageParameterEnum.PARAMETER_MOBILEDEVICE.getValue()); + if (userInfo != null && userInfo.getUserId() != null) { + OnlineUserModel model = new OnlineUserModel(); + model.setConnectionId(session.getId()); + model.setUserId(userInfo.getUserId()); + model.setTenantId(userInfo.getTenantId()); + model.setIsMobileDevice(isMobileDevice); + model.setWebSocket(session); + model.setToken(receivedToken); + + BaseSystemInfo sysInfo = sysConfigApi.getSysInfo(); + //判断是否在线 + isOnLine(sysInfo, model); + + List onlineUserList = OnlineUserProvider.getOnlineUserList().stream().filter(q -> !q.getUserId().equals(userInfo.getUserId()) && q.getTenantId().equals(userInfo.getTenantId())).collect(Collectors.toList()); + //反馈信息给登录者 + List onlineUsers = onlineUserList.stream().map(t -> t.getUserId()).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList()); + List unreadNums = imContentService.getUnreadList(userInfo.getUserId()); + int unreadNoticeCount = messageService.getUnreadCount(userInfo.getUserId(), 1); + int unreadMessageCount = messageService.getUnreadCount(userInfo.getUserId(), 2); + int unreadScheduleCount = messageService.getUnreadCount(userInfo.getUserId(),4); + int unreadSystemMessageCount = messageService.getUnreadCount(userInfo.getUserId(), 3); + MessageEntity noticeDefaultText = messageService.getInfoDefault(1); + PaginationMessage pagination = new PaginationMessage(); + pagination.setCurrentPage(1); + pagination.setPageSize(1); + List list = messageService.getMessageList(pagination, pagination.getType(),userInfo.getUserId()); + MessageReceiveEntity messageDefaultText = new MessageReceiveEntity(); + if(list.size()>0){ + messageDefaultText = list.get(0); + } + String noticeText = noticeDefaultText.getTitle() != null ? noticeDefaultText.getTitle() : ""; + String messageText = messageDefaultText.getTitle() != null ? messageDefaultText.getTitle() : ""; + Long noticeTime = noticeDefaultText.getCreatorTime() != null ? noticeDefaultText.getCreatorTime().getTime() : 0; + Long messageTime = messageDefaultText.getCreatorTime() != null ? messageDefaultText.getCreatorTime().getTime() : 0; + //转model后上传到mq服务器上 + OnConnectionModel onConnectionModel = new OnConnectionModel(); + onConnectionModel.setMethod(MessageChannelType.CHANNEL_INITMESSAGE); + onConnectionModel.setOnlineUsers(onlineUsers); + onConnectionModel.setUnreadNums(JsonUtil.listToJsonField(unreadNums)); + onConnectionModel.setUnreadNoticeCount(unreadNoticeCount); +// onConnectionModel.setNoticeDefaultText(noticeText); + onConnectionModel.setUnreadMessageCount(unreadMessageCount); + onConnectionModel.setUnreadSystemMessageCount(unreadSystemMessageCount); + onConnectionModel.setUnreadScheduleCount(unreadScheduleCount); + onConnectionModel.setMessageDefaultText(messageText); + onConnectionModel.setMessageDefaultTime(messageTime); + onConnectionModel.setUserId(userInfo.getUserId()); + int total = unreadNoticeCount+unreadMessageCount+unreadSystemMessageCount+unreadScheduleCount; + onConnectionModel.setUnreadTotalCount(total); + OnlineUserProvider.sendMessage(session, onConnectionModel); + //通知所有在线用户,有用户在线 + for (OnlineUserModel item : onlineUserList) { + if (!item.getUserId().equals(userInfo.getUserId())) { + //创建模型 + OnLineModel remindUserModel = new OnLineModel(MessageChannelType.CHANNEL_ONLINE, userInfo.getUserId()); + OnlineUserProvider.sendMessage(item, remindUserModel); + } + } + + } + break; + case ConnectionType.CONNECTION_SENDMESSAGE: + //发送消息 + String toUserId = receivedMessage.getString(MessageParameterEnum.PARAMETER_TOUSERID.getValue()); + //text/voice/image + String messageType = receivedMessage.getString(MessageParameterEnum.PARAMETER_MESSAGETYPE.getValue()); + String messageContent = receivedMessage.getString(MessageParameterEnum.PARAMETER_MESSAGECONTENT.getValue()); + String tenantId = userProvider.get(receivedMessage.getString(MessageParameterEnum.PARAMETER_TOKEN.getValue())).getTenantId(); + + String fileName = ""; + if (!SendMessageTypeEnum.MESSAGE_TEXT.getMessage().equals(messageType)) { + JSONObject object = JSONObject.parseObject(messageContent); + fileName = object.getString("name"); + } + List user = OnlineUserProvider.getOnlineUserList().stream().filter(q -> String.valueOf(q.getUserId()).equals(String.valueOf(userInfo.getUserId())) && String.valueOf(q.getTenantId()).equals(tenantId)).collect(Collectors.toList()); + OnlineUserModel onlineUser = user.size() > 0 ? user.get(0) : null; + List toUser = OnlineUserProvider.getOnlineUserList().stream().filter(q -> String.valueOf(q.getTenantId()).equals(String.valueOf(onlineUser.getTenantId())) && String.valueOf(q.getUserId()).equals(String.valueOf(toUserId))).collect(Collectors.toList()); + if (user.size() != 0) { + //saveMessage + if (SendMessageTypeEnum.MESSAGE_TEXT.getMessage().equals(messageType)) { + messageContent = XSSEscape.escape(messageContent); + imContentService.sendMessage(onlineUser.getUserId(), toUserId, messageContent, messageType); + } else if (SendMessageTypeEnum.MESSAGE_IMAGE.getMessage().equals(messageType)) { + JSONObject image = new JSONObject(); + image.put("path", UploaderUtil.uploaderImg("/api/file/Image/IM/", fileName)); + image.put("width", JSONObject.parseObject(messageContent).getString("width")); + image.put("height", JSONObject.parseObject(messageContent).getString("height")); + imContentService.sendMessage(onlineUser.getUserId(), toUserId, image.toJSONString(), messageType); + } else if (SendMessageTypeEnum.MESSAGE_VOICE.getMessage().equals(messageType)) { + JSONObject voice = new JSONObject(); + voice.put("path", UploaderUtil.uploaderImg("/api/file/Image/IM/", fileName)); + voice.put("length", JSONObject.parseObject(messageContent).getString("length")); + imContentService.sendMessage(onlineUser.getUserId(), toUserId, voice.toJSONString(), messageType); + } + for (int i = 0; i < user.size(); i++) { + OnlineUserModel model = user.get(i); + //组装model + SavaMessageModel savaMessageModel = new SavaMessageModel(); + savaMessageModel.setMethod(MessageChannelType.CHANNEL_SENDMESSAGE); + savaMessageModel.setUserId(model.getUserId()); + savaMessageModel.setToUserId(toUserId); + savaMessageModel.setDateTime(DateUtil.getNowDate().getTime()); + //头像 + savaMessageModel.setHeadIcon(UploaderUtil.uploaderImg(userInfo.getUserIcon())); + //最新消息 + savaMessageModel.setLatestDate(DateUtil.getNowDate().getTime()); + //用户姓名 + savaMessageModel.setRealName(userInfo.getUserName()); + savaMessageModel.setAccount(userInfo.getUserAccount()); + //对方的名称账号头像 + Map headers = ImmutableMap.of(Constants.AUTHORIZATION.toLowerCase(), receivedToken); + UserEntity entity = userApi.getInfo(toUserId); + savaMessageModel.setToAccount(entity.getAccount()); + savaMessageModel.setToRealName(entity.getRealName()); + savaMessageModel.setToHeadIcon(UploaderUtil.uploaderImg(entity.getHeadIcon())); + + if (SendMessageTypeEnum.MESSAGE_TEXT.getMessage().equals(messageType)) { + savaMessageModel.setMessageType(messageType); + savaMessageModel.setToMessage(messageContent); + } else if (SendMessageTypeEnum.MESSAGE_IMAGE.getMessage().equals(messageType)) { + //构建图片模型 + ImageMessageModel messageModel = getImageModel(messageContent, UploaderUtil.uploaderImg("/api/file/Image/IM/", fileName)); + savaMessageModel.setToMessage(messageModel); + savaMessageModel.setMessageType(messageType); + } else if (SendMessageTypeEnum.MESSAGE_VOICE.getMessage().equals(messageType)) { + //构建语音模型 + VoiceMessageModel messageModel = getVoiceMessageModel(messageContent, UploaderUtil.uploaderImg("/api/file/Image/IM/", fileName)); + savaMessageModel.setMessageType(messageType); + savaMessageModel.setToMessage(messageModel); + } + /*List cidList = userDeviceService.getCidList(toUserId); + if(cidList != null && cidList.size()>0){ + JSONObject jsonObject = new JSONObject(); + jsonObject.put("type","3"); + jsonObject.put("name",userInfo.getUserName() + "/"+userInfo.getUserAccount()); + jsonObject.put("formUserId",userInfo.getUserId()); + jsonObject.put("headIcon",UploaderUtil.uploaderImg(userInfo.getUserIcon())); +// jsonObject.put("title",userInfo.getUserName() + "/"+userInfo.getUserAccount()); + String text = JSONObject.toJSONString(jsonObject); + byte[] bytes = text.getBytes(StandardCharsets.UTF_8); + text = Base64.getEncoder().encodeToString(bytes); + uinPush.sendUniPush(cidList, userInfo.getUserName(), "你有一条看聊天消息", "3", text); + }*/ + OnlineUserProvider.sendMessage(model, savaMessageModel); + } + } + + //接受消息 + ReceiveMessageModel receiveMessageModel = new ReceiveMessageModel(); + receiveMessageModel.setMethod(MessageChannelType.CHANNEL_RECEIVEMESSAGE); + receiveMessageModel.setFormUserId(onlineUser.getUserId()); + receiveMessageModel.setDateTime(DateUtil.getNowDate().getTime()); + //头像 + receiveMessageModel.setHeadIcon(UploaderUtil.uploaderImg(userInfo.getUserIcon())); + //最新消息 + receiveMessageModel.setLatestDate(DateUtil.getNowDate().getTime()); + //用户姓名 + receiveMessageModel.setRealName(userInfo.getUserName()); + receiveMessageModel.setAccount(userInfo.getUserAccount()); + receiveMessageModel.setUserId(toUserId); + if (toUser.size() != 0) { + for (int i = 0; i < toUser.size(); i++) { + OnlineUserModel onlineToUser = toUser.get(i); + if (SendMessageTypeEnum.MESSAGE_TEXT.getMessage().equals(messageType)) { + receiveMessageModel.setMessageType(messageType); + receiveMessageModel.setFormMessage(messageContent); + } else if (SendMessageTypeEnum.MESSAGE_IMAGE.getMessage().equals(messageType)) { + //构建图片模型 + ImageMessageModel messageModel = getImageModel(messageContent, UploaderUtil.uploaderImg("/api/file/Image/IM/", fileName)); + receiveMessageModel.setMessageType(messageType); + receiveMessageModel.setFormMessage(messageModel); + } else if (SendMessageTypeEnum.MESSAGE_VOICE.getMessage().equals(messageType)) { + //构建语音模型 + VoiceMessageModel messageModel = getVoiceMessageModel(messageContent, UploaderUtil.uploaderImg("/api/file/Image/IM/", fileName)); + receiveMessageModel.setMessageType(messageType); + receiveMessageModel.setFormMessage(messageModel); + } + OnlineUserProvider.sendMessage(onlineToUser, receiveMessageModel); + } + } + break; + case "UpdateReadMessage": + //更新已读 + String formUserId = receivedMessage.getString("formUserId"); + onlineUser = OnlineUserProvider.getOnlineUserList().stream().filter(q -> String.valueOf(q.getConnectionId()).equals(String.valueOf(session.getId()))).findFirst().orElse(new OnlineUserModel()); + if (onlineUser != null) { + imContentService.readMessage(formUserId, onlineUser.getUserId()); + } + break; + case "MessageList": + //获取消息列表 + String sendUserId = receivedMessage.getString("toUserId"); + String receiveUserId = receivedMessage.getString("formUserId"); + PageModel pageModel = new PageModel(); + pageModel.setPage(receivedMessage.getInteger("currentPage")); + pageModel.setRows(receivedMessage.getInteger("pageSize")); + pageModel.setSord(receivedMessage.getString("sord")); + pageModel.setKeyword(receivedMessage.getString("keyword")); + List data = imContentService.getMessageList(sendUserId, receiveUserId, pageModel).stream().sorted(Comparator.comparing(ImContentEntity::getSendTime)).collect(Collectors.toList()); + JSONObject object = new JSONObject(); + object.put("method", "messageList"); + object.put("list", JsonUtil.getListToJsonArray(data)); + JSONObject pagination = new JSONObject(); + pagination.put("total", pageModel.getRecords()); + pagination.put("currentPage", pageModel.getPage()); + pagination.put("pageSize", receivedMessage.getInteger("pageSize")); + object.put("pagination", pagination); + OnlineUserProvider.sendMessage(session, object); + break; + default: + break; + } + } + + /** + * 判断是否在线 + * + * @param model + */ + private void isOnLine(BaseSystemInfo systemInfo, OnlineUserModel model) { + // 不允许多人登录 + if ("1".equals(String.valueOf(systemInfo.getSingleLogin()))) { + Long userAll = OnlineUserProvider.getOnlineUserList().stream().filter(t -> t.getUserId().equals(userInfo.getUserId()) && t.getTenantId().equals(userInfo.getTenantId())).count(); + Long userAllMobile = OnlineUserProvider.getOnlineUserList().stream().filter(t -> t.getUserId().equals(userInfo.getUserId()) && t.getTenantId().equals(userInfo.getTenantId()) && t.getIsMobileDevice().equals(true)).count(); + Long userAllWeb = OnlineUserProvider.getOnlineUserList().stream().filter(t -> t.getUserId().equals(userInfo.getUserId()) && t.getTenantId().equals(userInfo.getTenantId()) && t.getIsMobileDevice().equals(false)).count(); + //都不在线 + if (userAll == 0) { + OnlineUserProvider.addModel(model); + } + //手机在线 + else if (userAllMobile != 0 && userAllWeb == 0) { + if (!model.getIsMobileDevice()) { + OnlineUserProvider.addModel(model); + } + } + //电脑在线 + else { + if (model.getIsMobileDevice()) { + OnlineUserProvider.addModel(model); + } + } + } else { + //同时登录不限制 + OnlineUserProvider.addModel(model); + } + } + + /** + * 判断是否为多租户 + * + */ + private boolean isMultiTenancy() { + if (configValueUtil.isMultiTenancy()) { + //多租户需要切库 + if (StringUtil.isNotEmpty(userInfo.getTenantDbConnectionString())) { + DataSourceContextHolder.setDatasource(userInfo.getTenantId(), userInfo.getTenantDbConnectionString(), userInfo.isAssignDataSource()); + }else{ + return false; + } + } + return true; + } + + /** + * 构建图片消息模型 + * + * @param messageContent + * @param fileName + * @return + */ + private ImageMessageModel getImageModel(String messageContent, String fileName) { + String width = JSONObject.parseObject(messageContent).getString("width"); + String height = JSONObject.parseObject(messageContent).getString("height"); + return new ImageMessageModel(width, height, fileName); + } + + /** + * 构建语音模型 + * + * @param messageContent + * @param fileName + * @return + */ + private VoiceMessageModel getVoiceMessageModel(String messageContent, String fileName) { + String length = JSONObject.parseObject(messageContent).getString("length"); + return new VoiceMessageModel(length, fileName); + } + + @OnError + public void onError(Session session, Throwable error) { +// OnlineUserModel user = OnlineUserProvider.getOnlineUserList().stream().filter(t -> t.getConnectionId().equals(session.getId())).findFirst().isPresent() ? OnlineUserProvider.getOnlineUserList().stream().filter(t -> t.getConnectionId().equals(session.getId())).findFirst().get() : null; +// if (user != null) { +// log.error("调用onError,租户:" + user.getTenantId() + ",用户:" + user.getUserId()); +// } + try { + onClose(session); + } catch (Exception e) { +// log.error("发生error,调用onclose失败,session为:" + session); + } + if (error.getMessage() != null) { + OnlineUserModel user = OnlineUserProvider.getOnlineUserList().stream().filter(t -> t.getConnectionId().equals(session.getId())).findFirst().isPresent() ? OnlineUserProvider.getOnlineUserList().stream().filter(t -> t.getConnectionId().equals(session.getId())).findFirst().get() : null; + if(user != null){ + log.error("WS发生错误: {}, {}, {}, {}, {}", user.getTenantId(), user.getUserId(), session.getId(), error.getMessage(), user.getToken()); + }else{ + log.error("WS发生错误", error); + } + } + } + + /** + * 初始化 + */ + private void init() { + messageService = SpringContext.getBean(MessageService.class); + imContentService = SpringContext.getBean(ImContentService.class); + configValueUtil = SpringContext.getBean(ConfigValueUtil.class); + userProvider = SpringContext.getBean(UserProvider.class); + userApi = SpringContext.getBean(UserService.class); + sysConfigApi = SpringContext.getBean(SysconfigService.class); + uinPush = SpringContext.getBean(UinPush.class); + userDeviceService = SpringContext.getBean(UserDeviceService.class); + } + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/pom.xml b/jnpf-java-boot/jnpf-message/jnpf-message-entity/pom.xml new file mode 100644 index 0000000..e398dab --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/pom.xml @@ -0,0 +1,47 @@ + + + + jnpf-message + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-message-entity + + + + com.jnpf + jnpf-system-entity + ${project.version} + + + + dingtalk-sdk-java + taobao-sdk-java + + + dingtalk-sdk-java + taobao-sdk-java-source + + + com.tencentcloudapi + tencentcloud-sdk-java + + + com.aliyun + dysmsapi20170525 + + + com.sun.mail + javax.mail + + + org.dom4j + dom4j + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/AccountConfigEntity.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/AccountConfigEntity.java new file mode 100644 index 0000000..382ec01 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/AccountConfigEntity.java @@ -0,0 +1,107 @@ +package jnpf.message.entity; + +import jnpf.base.entity.SuperExtendEntity; +import com.alibaba.fastjson.annotation.JSONField; +import com.baomidou.mybatisplus.annotation.*; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 账号配置表 + * + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2022-08-18 + */ +@Data +@TableName("base_msg_account") +public class AccountConfigEntity extends SuperExtendEntity.SuperExtendDEEntity { + + @TableField("f_category") + private String type; + + @TableField("f_full_name") + private String fullName; + + @TableField("f_en_code") + private String enCode; + + @TableField("f_addressor_name") + private String addressorName; + +// @TableField("F_SEND_EMAIL") +// +// private String sendEmail; + + @TableField("f_smtp_server") + private String smtpServer; + + @TableField("f_smtp_port") + private Integer smtpPort; + + @TableField("f_ssl_link") + private String sslLink; + + @TableField("f_smtp_user") + private String smtpUser; + + @TableField("f_smtp_password") + private String smtpPassword; + + @TableField("f_channel") + private String channel; + + @TableField("f_sms_signature") + private String smsSignature; + + @TableField("f_app_id") + private String appId; + + @TableField("f_app_secret") + private String appSecret; + + @TableField("f_end_point") + private String endPoint; + + @TableField("f_sdk_app_id") + private String sdkAppId; + + @TableField("f_app_key") + private String appKey; + + @TableField("f_zone_name") + private String zoneName; + + @TableField("f_zone_param") + private String zoneParam; + + @TableField("f_enterprise_id") + private String enterpriseId; + + @TableField("f_agent_id") + private String agentId; + + @TableField("f_webhook_type") + private String webhookType; + + @TableField("f_webhook_address") + private String webhookAddress; + + @TableField("f_approve_type") + private String approveType; + + @TableField("f_bearer") + private String bearer; + + @TableField("f_user_name") + private String userName; + + @TableField("f_password") + private String password; + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/ImContentEntity.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/ImContentEntity.java new file mode 100644 index 0000000..66736a7 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/ImContentEntity.java @@ -0,0 +1,58 @@ +package jnpf.message.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * 聊天内容 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Data +@TableName("base_im_content") +public class ImContentEntity extends SuperExtendEntity.SuperExtendEnabledEntity { + + /** + * 发送者 + */ + @TableField("f_send_user_id") + private String sendUserId; + + /** + * 发送时间 + */ + @TableField("f_send_time") + private Date sendTime; + + /** + * 接收者 + */ + @TableField("f_receive_user_id") + private String receiveUserId; + + /** + * 接收时间 + */ + @TableField("f_receive_time") + private Date receiveTime; + + /** + * 内容 + */ + @TableField("f_content") + private String content; + + /** + * 内容 + */ + @TableField("f_content_type") + private String contentType; + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/ImReplyEntity.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/ImReplyEntity.java new file mode 100644 index 0000000..cfed16c --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/ImReplyEntity.java @@ -0,0 +1,40 @@ +package jnpf.message.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * 聊天会话表 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-05-28 + */ +@Data +@TableName("base_im_reply") +public class ImReplyEntity extends SuperExtendEntity { + + /** + * 发送者 + */ + @TableField("f_user_id") + private String userId; + + /** + * 接收者 + */ + @TableField("f_receive_user_id") + private String receiveUserId; + + /** + * 发送时间 + */ + @TableField("f_receive_time") + private Date receiveTime; + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/MessageEntity.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/MessageEntity.java new file mode 100644 index 0000000..5eafe1d --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/MessageEntity.java @@ -0,0 +1,124 @@ +package jnpf.message.entity; + +import com.baomidou.mybatisplus.annotation.*; +import jnpf.base.entity.SuperBaseEntity; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * 消息实例 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月27日 上午9:18 + */ +@Data +@TableName("base_notice") +public class MessageEntity extends SuperBaseEntity.SuperCBaseEntity { + + /** + * 标题 + */ + @TableField("f_title") + private String title; + + /** + * 正文 + */ + @TableField("f_body_text") + private String bodyText; + + /** + * 收件用户 + */ + @TableField("f_to_user_ids") + private String toUserIds; + + /** + * 附件 + */ + @TableField("f_files") + private String files; + + /** + * 封面图片 + */ + @TableField("f_cover_image") + private String coverImage; + + /** + * 过期时间 + */ + @TableField("f_expiration_time") + private Date expirationTime; + + /** + * 分类 1-公告 2-通知 + */ + @TableField("f_category") + private String category; + + /** + * 提醒方式 1-站内信 2-自定义 3-不通知 + */ + @TableField("f_type") + private Integer remindCategory; + + /** + * 发送配置 + */ + @TableField("f_send_config_id") + private String sendConfigId; + + /** + * 描述 + */ + @TableField("f_description") + private String excerpt; + + /** + * 有效标志 (0-默认,禁用,1-启用) + */ + @TableField(value ="f_enabled_mark",fill = FieldFill.INSERT) + private Integer enabledMark; + + /** + * 排序码 + */ + @TableField("f_sort_code") + private Long sortCode; + + /** + * 删除标志 + */ + @TableField(value = "f_delete_mark" , updateStrategy = FieldStrategy.IGNORED) + private Integer deleteMark; + + /** + * 删除时间 + */ + @TableField(value = "f_delete_time" , fill = FieldFill.UPDATE) + private Date deleteTime; + + /** + * 删除用户 + */ + @TableField(value = "f_delete_user_id" , fill = FieldFill.UPDATE) + private String deleteUserId; + + /** + * 修改时间 + */ + @TableField(value = "f_last_modify_time" , updateStrategy = FieldStrategy.IGNORED) + private Date lastModifyTime; + + /** + * 修改用户 + */ + @TableField(value = "f_last_modify_user_id" , updateStrategy = FieldStrategy.IGNORED) + private String lastModifyUserId; + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/MessageMonitorEntity.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/MessageMonitorEntity.java new file mode 100644 index 0000000..322c5bf --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/MessageMonitorEntity.java @@ -0,0 +1,54 @@ +package jnpf.message.entity; + +import jnpf.base.entity.SuperEntity; +import com.alibaba.fastjson.annotation.JSONField; +import com.baomidou.mybatisplus.annotation.*; +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonProperty; +/** + * + * 消息监控表 + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2022-08-22 + */ +@Data +@TableName("base_msg_monitor") +public class MessageMonitorEntity extends SuperExtendEntity { + + @TableField("f_account_id") + private String accountId; + + @TableField("f_account_name") + private String accountName; + + @TableField("f_account_code") + private String accountCode; + + @TableField("f_message_type") + private String messageType; + + @TableField("f_message_source") + private String messageSource; + + @TableField("f_send_time") + private Date sendTime; + + @TableField("f_message_template_id") + private String messageTemplateId; + + @TableField("f_title") + private String title; + + @TableField("f_receive_user") + private String receiveUser; + + @TableField("f_content") + private String content; + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/MessageReceiveEntity.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/MessageReceiveEntity.java new file mode 100644 index 0000000..01aae80 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/MessageReceiveEntity.java @@ -0,0 +1,58 @@ +package jnpf.message.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * 消息接收 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月27日 上午9:18 + */ +@Data +@TableName("base_message") +public class MessageReceiveEntity extends SuperExtendEntity { + + /** + * 用户主键 + */ + @TableField("f_user_id") + private String userId; + + /** + * 是否阅读 + */ + @TableField("f_is_read") + private Integer isRead; + + /** + * 站内信息 + */ + @TableField("f_body_text") + private String bodyText; + + /** + * 标题 + */ + @TableField("f_title") + private String title; + + /** + * 类型(1-公告 2-流程 3-系统 4-日程) + */ + @TableField("f_type") + private Integer type; + + /** + * 流程类型(1:审批 2:委托) + */ + @TableField("f_flow_type") + private Integer flowType; + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/MessageTemplateConfigEntity.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/MessageTemplateConfigEntity.java new file mode 100644 index 0000000..7347f71 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/MessageTemplateConfigEntity.java @@ -0,0 +1,53 @@ +package jnpf.message.entity; + +import jnpf.base.entity.SuperExtendEntity; +import com.alibaba.fastjson.annotation.JSONField; +import com.baomidou.mybatisplus.annotation.*; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonProperty; +/** + * + * 消息模板表 + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2022-08-18 + */ +@Data +@TableName("base_msg_template") +public class MessageTemplateConfigEntity extends SuperExtendEntity.SuperExtendDEEntity { + + @TableField("f_full_name") + private String fullName; + + @TableField("f_en_code") + private String enCode; + + @TableField("f_template_type") + private String templateType; + + @TableField("f_message_source") + private String messageSource; + + @TableField("f_message_type") + private String messageType; + + @TableField("f_title") + private String title; + + @TableField("f_content") + private String content; + + @TableField("f_template_code") + private String templateCode; + + @TableField("f_wx_skip") + private String wxSkip; + + @TableField("f_xcx_app_id") + private String xcxAppId; + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/QyWebChatModel.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/QyWebChatModel.java new file mode 100644 index 0000000..bb16acb --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/QyWebChatModel.java @@ -0,0 +1,27 @@ +package jnpf.message.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * 企业微信的模型 + * + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021/5/25 14:18 + */ +@Data +public class QyWebChatModel { + @Schema(description = "CorpId") + private String qyhCorpId; + @Schema(description = "AgentId") + private String qyhAgentId; + @Schema(description = "AgentSecret") + private String qyhAgentSecret; + @Schema(description = "CorpSecret") + private String qyhCorpSecret; +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/SendConfigRecordEntity.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/SendConfigRecordEntity.java new file mode 100644 index 0000000..dc2a679 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/SendConfigRecordEntity.java @@ -0,0 +1,37 @@ +package jnpf.message.entity; + +import jnpf.base.entity.SuperEntity; +import com.alibaba.fastjson.annotation.JSONField; +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonProperty; +/** + * + * 账号配置使用记录表 + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2022-09-21 + */ +@Data +@TableName("base_message_send_record") +public class SendConfigRecordEntity extends SuperEntity { + + @TableField("F_SENDCONFIGID") + private String sendConfigId; + + @TableField("F_MESSAGESOURCE") + private String messageSource; + + @TableField("F_USEDID") + private String usedId; + + /** + * 状态 + */ + @TableField("F_ENABLEDMARK") + private Integer enabledMark; + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/SendConfigTemplateEntity.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/SendConfigTemplateEntity.java new file mode 100644 index 0000000..c1608e6 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/SendConfigTemplateEntity.java @@ -0,0 +1,54 @@ +package jnpf.message.entity; + +import jnpf.base.entity.SuperExtendEntity; +import com.alibaba.fastjson.annotation.JSONField; +import com.baomidou.mybatisplus.annotation.*; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 发送配置模板表 + * + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2022-08-19 + */ +@Data +@TableName("base_msg_send_template") +public class SendConfigTemplateEntity extends SuperExtendEntity.SuperExtendDEEntity { + + /** 发送配置id **/ + @TableField("f_send_config_id") + private String sendConfigId; + /** 消息类型 **/ + @TableField("f_message_type") + private String messageType; + /** 消息模板id **/ + @TableField("f_template_id") + private String templateId; + /** 账号配置id **/ + @TableField("f_account_config_id") + private String accountConfigId; + + /** 消息模板编号 **/ + @TableField(exist = false) + private String templateCode; + + /** 消息模板名称 **/ + @TableField(exist = false) + private String templateName; + + /** 账号编码 **/ + @TableField(exist = false) + private String accountCode; + + /** 账号名称 **/ + @TableField(exist = false) + private String accountName; + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/SendMessageConfigEntity.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/SendMessageConfigEntity.java new file mode 100644 index 0000000..f8b1675 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/SendMessageConfigEntity.java @@ -0,0 +1,41 @@ +package jnpf.message.entity; + +import jnpf.base.entity.SuperExtendEntity; +import com.alibaba.fastjson.annotation.JSONField; +import com.baomidou.mybatisplus.annotation.*; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 消息发送配置表 + * + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2022-08-19 + */ +@Data +@TableName("base_msg_send") +public class SendMessageConfigEntity extends SuperExtendEntity.SuperExtendDEEntity { + + @TableField("f_full_name") + private String fullName; + + @TableField("f_en_code") + private String enCode; + +// @TableField("F_MESSAGETYPE") +// +// private String messageType; + + @TableField("f_template_type") + private String templateType; + + @TableField("f_message_source") + private String messageSource; + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/ShortLinkEntity.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/ShortLinkEntity.java new file mode 100644 index 0000000..d336642 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/ShortLinkEntity.java @@ -0,0 +1,57 @@ +package jnpf.message.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * + * 短信变量表 + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2022-08-18 + */ +@Data +@TableName("base_msg_short_link") +public class ShortLinkEntity extends SuperExtendEntity.SuperExtendEnabledEntity { + + /** 短链接 **/ + @TableField("f_short_link") + private String shortLink; + + /** PC端链接 **/ + @TableField("f_real_pc_link") + private String realPcLink; + + /** App端链接 **/ + @TableField("f_real_app_link") + private String realAppLink; + + /** 流程内容 **/ + @TableField("f_body_text") + private String bodyText; + + /** 是否点击后失效 **/ + @TableField("f_is_used") + private Integer isUsed; + + /** 点击次数 **/ + @TableField("f_click_num") + private Integer clickNum; + + /** 失效次数 **/ + @TableField("f_unable_num") + private Integer unableNum; + + /** 失效时间 **/ + @TableField("f_unable_time") + private Date unableTime; + + /** 用户id **/ + @TableField("f_user_id") + private String userId; +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/SmsFieldEntity.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/SmsFieldEntity.java new file mode 100644 index 0000000..b22eeba --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/SmsFieldEntity.java @@ -0,0 +1,39 @@ +package jnpf.message.entity; + +import com.baomidou.mybatisplus.annotation.*; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + +/** + * + * 短信变量表 + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2022-08-18 + */ +@Data +@TableName("base_msg_sms_field") +public class SmsFieldEntity extends SuperExtendEntity.SuperExtendEnabledEntity { + + /** 模板 **/ + @TableField("F_TEMPLATE_ID") + private String templateId; + + /** 参数id **/ + @TableField("F_FIELD_ID") + private String fieldId; + + /** 短信变量 **/ + @TableField("F_SMS_FIELD") + private String smsField; + + /** 参数 **/ + @TableField("F_FIELD") + private String field; + + /** 是否标题 **/ + @TableField("F_IS_TITLE") + private Integer isTitle; + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/SynThirdInfoEntity.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/SynThirdInfoEntity.java new file mode 100644 index 0000000..52ede40 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/SynThirdInfoEntity.java @@ -0,0 +1,49 @@ +package jnpf.message.entity; + +import com.alibaba.fastjson.annotation.JSONField; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 第三方工具的公司-部门-用户同步表模型 + * + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021/4/23 17:06 + */ +@Data +@TableName("base_syn_third_info") +public class SynThirdInfoEntity extends SuperExtendEntity.SuperExtendDEEntity implements Serializable { + + /** + * 第三方类型(1:企业微信;2:钉钉) + */ + @TableField("F_THIRD_TYPE") + private Integer thirdType; + + /** + * 数据类型(1:组织(公司与部门);2:用户) + */ + @TableField("F_DATA_TYPE") + private Integer dataType; + + /** + * 系统对象ID(公司ID、部门ID、用户ID) + */ + @TableField("F_SYS_OBJ_ID") + private String sysObjId; + + /** + * 第三对象ID(公司ID、部门ID、用户ID) + */ + @TableField("F_THIRD_OBJ_ID") + private String thirdObjId; + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/TemplateParamEntity.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/TemplateParamEntity.java new file mode 100644 index 0000000..94419dc --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/TemplateParamEntity.java @@ -0,0 +1,30 @@ +package jnpf.message.entity; + +import com.baomidou.mybatisplus.annotation.*; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; +/** + * + * 消息模板参数表 + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2022-08-18 + */ +@Data +@TableName("base_msg_template_param") +public class TemplateParamEntity extends SuperExtendEntity.SuperExtendEnabledEntity { + + /** 消息模板id **/ + @TableField("f_template_id") + private String templateId; + + /** 参数 **/ + @TableField("f_field") + private String field; + + /** 参数说明 **/ + @TableField("f_field_name") + private String fieldName; + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/UserDeviceEntity.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/UserDeviceEntity.java new file mode 100644 index 0000000..832ab80 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/UserDeviceEntity.java @@ -0,0 +1,28 @@ +package jnpf.message.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + + +/** + * + * 短信变量表 + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2022-08-18 + */ +@Data +@TableName("base_user_device") +public class UserDeviceEntity extends SuperExtendEntity.SuperExtendEnabledEntity { + + /** 用户id **/ + @TableField("F_USERID") + private String userId; + + /** 设备id **/ + @TableField("F_CLIENTID") + private String clientId; +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/WechatUserEntity.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/WechatUserEntity.java new file mode 100644 index 0000000..592ff9d --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/entity/WechatUserEntity.java @@ -0,0 +1,36 @@ +package jnpf.message.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + +/** + * + * 短信变量表 + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2022-08-18 + */ +@Data +@TableName("base_msg_wechat_user") +public class WechatUserEntity extends SuperExtendEntity.SuperExtendEnabledEntity { + + /** 公众号元素id **/ + @TableField("f_gzh_id") + private String gzhId; + + /** 用户id **/ + @TableField("f_user_id") + private String userId; + + /** 公众号用户id **/ + @TableField("f_open_id") + private String openId; + + /** 是否关注公众号 **/ + @TableField("f_close_mark") + private Integer closeMark; + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/enums/MessageTypeEnum.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/enums/MessageTypeEnum.java new file mode 100644 index 0000000..4d036f4 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/enums/MessageTypeEnum.java @@ -0,0 +1,83 @@ +package jnpf.message.enums; + +/** + * 消息类型枚举 + * + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021/4/23 17:45 + */ +public enum MessageTypeEnum { + /** + * 站内消息 + */ + SysMessage("1", "站内消息"), + /** + * 发送邮件 + */ + MailMessage("2", "发送邮件"), + /** + * 发送短信 + */ + SmsMessage("3", "发送短信"), + /** + * 钉钉消息 + */ + DingMessage("4", "发送钉钉消息"), + /** + * 企业微信 + */ + QyMessage("5", "发送企业微信消息"), + /** + * webhook + */ + WebHookMessage("6", "发送webhook消息"), + /** + * 微信公众号 + */ + WechatMessage("7", "发送微信公众号消息"); + + /** + * 为防止与系统后续更新的功能的消息类型code冲突,客户自定义添加的消息类型code请以ZDY开头。例如:ZDY1 + */ + + + private String code; + private String message; + + MessageTypeEnum(String code, String message) { + this.code = code; + this.message = message; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + /** + * 根据状态code获取枚举值 + * + * @return + */ + public static MessageTypeEnum getByCode(String code) { + for (MessageTypeEnum status : MessageTypeEnum.values()) { + if (status.getCode().equals(code)) { + return status; + } + } + return null; + } +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/ImReplyListModel.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/ImReplyListModel.java new file mode 100644 index 0000000..c93095d --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/ImReplyListModel.java @@ -0,0 +1,78 @@ +package jnpf.message.model; + +import lombok.Data; + +import java.util.Date; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-05-31 + */ +@Data +public class ImReplyListModel { + /** + * id + */ + private String id; + + /** + * 名称 + */ + private String realName; + + /** + * 头像 + */ + private String headIcon; + + /** + * 最新消息 + */ + private String latestMessage; + + /** + * 最新时间 + */ + private Date latestDate; + + /** + * 未读消息 + */ + private Integer unreadMessage; + + /** + * 消息类型 + */ + private String messageType; + + /** + * 账号 + */ + private String account; + + /** + * UserId + */ + private String userId; + + /** + * sendDeleteMark + */ + private String sendDeleteMark; + + /** + * imreplySendDeleteMark + */ + private String imreplySendDeleteMark; + + /** + * deleteMark + */ + private int deleteMark; + + private String deleteUserId; + + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/ImReplyListVo.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/ImReplyListVo.java new file mode 100644 index 0000000..f16a459 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/ImReplyListVo.java @@ -0,0 +1,66 @@ +package jnpf.message.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +/** + * 消息会话列表 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-05-29 + */ +@Data +public class ImReplyListVo { + /** + * id + */ + @Schema(description = "id") + private String id; + + /** + * 名称 + */ + @Schema(description = "名称") + private String realName; + + /** + * 头像 + */ + @Schema(description = "头像") + private String headIcon; + + /** + * 最新消息 + */ + @Schema(description = "最新消息") + private String latestMessage; + + /** + * 最新时间 + */ + @Schema(description = "最新时间") + private Long latestDate; + + /** + * 未读消息 + */ + @Schema(description = "未读消息") + private Integer unreadMessage; + + /** + * 消息类型 + */ + @Schema(description = "消息类型") + private String messageType; + + /** + * Account + */ + @Schema(description = "Account") + private String account; + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/ImReplySavaModel.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/ImReplySavaModel.java new file mode 100644 index 0000000..31db66d --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/ImReplySavaModel.java @@ -0,0 +1,27 @@ +package jnpf.message.model; + +import lombok.Data; + +import java.util.Date; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-05-29 + */ +@Data +public class ImReplySavaModel { + + private String userId; + + private String receiveUserId; + + private Date receiveTime; + + public ImReplySavaModel(String userId, String receiveUserId, Date receiveTime) { + this.userId = userId; + this.receiveUserId = receiveUserId; + this.receiveTime = receiveTime; + } +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/ImUnreadNumModel.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/ImUnreadNumModel.java new file mode 100644 index 0000000..3d07b02 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/ImUnreadNumModel.java @@ -0,0 +1,44 @@ +package jnpf.message.model; + +import lombok.Data; + +/** + * 未读消息模型 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +@Data +public class ImUnreadNumModel { + /** + * 发送者Id + */ + private String sendUserId; + + /** + * 租户id + */ + private String tenantId; + + /** + * 未读数量 + */ + private int unreadNum; + + /** + * 默认消息 + */ + private String defaultMessage; + + /** + * 默认消息类型 + */ + private String defaultMessageType; + + /** + * 默认消息时间 + */ + private String defaultMessageTime; +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/NoticeModel.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/NoticeModel.java new file mode 100644 index 0000000..c233ee2 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/NoticeModel.java @@ -0,0 +1,11 @@ +package jnpf.message.model; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class NoticeModel implements Serializable { + private List typeList; +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/NoticePagination.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/NoticePagination.java new file mode 100644 index 0000000..5d8d512 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/NoticePagination.java @@ -0,0 +1,16 @@ +package jnpf.message.model; + +import jnpf.base.Pagination; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * 分页模型 + */ +@Data +public class NoticePagination extends Pagination { + private List type; + private List enabledMark; +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/UserOnlineModel.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/UserOnlineModel.java new file mode 100644 index 0000000..9577d0d --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/UserOnlineModel.java @@ -0,0 +1,33 @@ +package jnpf.message.model; + +import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class UserOnlineModel { + @JSONField(name="UserId") + private String userId; + @JSONField(name = "UserAccount") + private String userAccount; + @JSONField(name = "UserName") + private String userName; + @JSONField(name = "LoginTime") + private String loginTime; + @JSONField(name = "LoginIPAddress") + private String loginIPAddress; + @JSONField(name = "LoginPlatForm") + private String loginPlatForm; + @JSONField(name = "TenantId") + private String tenantId; + @JSONField(name = "Token") + private String token; + @JSONField(name = "Device") + private String device; +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/UserOnlineVO.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/UserOnlineVO.java new file mode 100644 index 0000000..2fa590a --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/UserOnlineVO.java @@ -0,0 +1,27 @@ +package jnpf.message.model; + +import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class UserOnlineVO { + @JSONField(name="UserId") + private String userId; + @JSONField(name = "UserAccount") + private String userAccount; + @JSONField(name = "UserName") + private String userName; + @JSONField(name = "LoginTime") + private String loginTime; + @JSONField(name = "LoginIPAddress") + private String loginIPAddress; + @JSONField(name = "LoginPlatForm") + private String loginPlatForm; +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/WxgzhMessageModel.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/WxgzhMessageModel.java new file mode 100644 index 0000000..b5c6372 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/WxgzhMessageModel.java @@ -0,0 +1,27 @@ +package jnpf.message.model; + +import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; + +import java.io.Serializable; + +/** + */ +@Data +public class WxgzhMessageModel implements Serializable { + //模板ID + @JSONField(name = "template_id") + private String templateId; + //模板标题 + private String title; + //模板所属行业的一级行业 + @JSONField(name = "primary_industry") + private String primaryIndustry; + //模板所属行业的二级行业 + @JSONField(name = "deputy_industry") + private String deputyIndustry; + //模板内容 + private String content; + //模板示例 + private String example; +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/accountconfig/AccountConfigForm.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/accountconfig/AccountConfigForm.java new file mode 100644 index 0000000..89a0ada --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/accountconfig/AccountConfigForm.java @@ -0,0 +1,209 @@ + + +package jnpf.message.model.accountconfig; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import java.util.List; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; + +/** + * + * + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2022-08-18 + */ +@Data +public class AccountConfigForm { + /** 主键 */ + @Schema(description = "主键") + private String id; + /** 名称 **/ + @Schema(description = "名称") + @JsonProperty("fullName") + private String fullName; + + /** 配置类型 **/ + @Schema(description = "配置类型") + @JsonProperty("type") + private String type; + + /** 编码 **/ + @Schema(description = "编码") + @JsonProperty("enCode") + private String enCode; + + /** 发件人昵称 **/ + @Schema(description = "发件人昵称") + @JsonProperty("addressorName") + private String addressorName; + +// /** 发件人邮箱 **/ +// @JsonProperty("sendEmail") +// private String sendEmail; + + /** SMTP服务器 **/ + @Schema(description = "SMTP服务器") + @JsonProperty("smtpServer") + private String smtpServer; + + /** SMTP端口 **/ + @Schema(description = "SMTP端口") + @JsonProperty("smtpPort") + private Integer smtpPort; + + /** SSL安全链接 **/ + @Schema(description = "SSL安全链接") + @JsonProperty("sslLink") + private Integer sslLink; + + /** SMTP用户名 **/ + @Schema(description = "SMTP用户名") + @JsonProperty("smtpUser") + private String smtpUser; + + /** SMTP密码 **/ + @Schema(description = "SMTP密码") + @JsonProperty("smtpPassword") + private String smtpPassword; + + /** 渠道 **/ + @Schema(description = "渠道") + @JsonProperty("channel") + private Integer channel; + + /** 短信签名 **/ + @Schema(description = "短信签名") + @JsonProperty("smsSignature") + private String smsSignature; + + /** 应用ID **/ + @Schema(description = "应用ID") + @JsonProperty("appId") + private String appId; + + /** 应用Secret **/ + @Schema(description = "应用Secret") + @JsonProperty("appSecret") + private String appSecret; + + /** EndPoint(阿里云) **/ + @Schema(description = "EndPoint(阿里云)") + @JsonProperty("endPoint") + private String endPoint; + + /** SDK AppID(腾讯云) **/ + @Schema(description = "SDK AppID(腾讯云)") + @JsonProperty("sdkAppId") + private String sdkAppId; + + /** AppKey(腾讯云) **/ + @Schema(description = "AppKey(腾讯云)") + @JsonProperty("appKey") + private String appKey; + + /** 地域域名(腾讯云) **/ + @Schema(description = "地域域名(腾讯云)") + @JsonProperty("zoneName") + private String zoneName; + + /** 地域参数(腾讯云) **/ + @Schema(description = "地域参数(腾讯云)") + @JsonProperty("zoneParam") + private String zoneParam; + + /** 企业id **/ + @Schema(description = "企业id") + @JsonProperty("enterpriseId") + private String enterpriseId; + + /** AgentID **/ + @Schema(description = "AgentID") + @JsonProperty("agentId") + private String agentId; + + /** WebHook类型 **/ + @Schema(description = "WebHook类型") + @JsonProperty("webhookType") + private String webhookType; + + /** WebHook地址 **/ + @Schema(description = "WebHook地址") + @JsonProperty("webhookAddress") + private String webhookAddress; + + /** 认证类型 **/ + @Schema(description = "认证类型") + @JsonProperty("approveType") + private String approveType; + + /** bearer令牌 **/ + @Schema(description = "bearer令牌") + @JsonProperty("bearer") + private String bearer; + + /** 用户名(基本认证) **/ + @Schema(description = "用户名(基本认证)") + @JsonProperty("userName") + private String userName; + + /** 密码(基本认证) **/ + @Schema(description = "密码(基本认证)") + @JsonProperty("password") + private String password; + + /** 排序 **/ + @Schema(description = "排序") + @JsonProperty("sortCode") + private Integer sortCode; + + /** 状态 **/ + @Schema(description = "状态") + @JsonProperty("enabledMark") + private Integer enabledMark; + + /** 说明 **/ + @Schema(description = "说明") + @JsonProperty("description") + private String description; + +// /** 创建时间 **/ +// @JsonProperty("creatorTime") +// private String creatorTime; +// +// /** 创建用户 **/ +// @JsonProperty("creatorUserId") +// private String creatorUserId; +// +// /** 修改时间 **/ +// @JsonProperty("lastModifyTime") +// private String lastModifyTime; +// +// /** 修改用户 **/ +// @JsonProperty("lastModifyUserId") +// private String lastModifyUserId; + + /** + * 邮件内容 + */ + @Schema(description = "邮件内容") + private String testEmailContent; + + /** + * 收件人 + */ + @Schema(description = "收件人") + private List testSendEmail; + + /** + * 邮箱标题 + */ + @Schema(description = "邮箱标题") + private String testEmailTitle; + + +} \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/accountconfig/AccountConfigInfoVO.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/accountconfig/AccountConfigInfoVO.java new file mode 100644 index 0000000..e2a6973 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/accountconfig/AccountConfigInfoVO.java @@ -0,0 +1,195 @@ + + + +package jnpf.message.model.accountconfig; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.math.BigDecimal; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +/** + * + * + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2022-08-18 + */ +@Data +public class AccountConfigInfoVO{ + /** 主键 **/ + @Schema(description = "主键") + @JsonProperty("id") + private String id; + + /** 名称 **/ + @Schema(description = "名称") + @JsonProperty("fullName") + private String fullName; + + /** 配置类型 **/ + @Schema(description = "配置类型") + @JsonProperty("type") + private String type; + + /** 编码 **/ + @Schema(description = "编码") + @JsonProperty("enCode") + private String enCode; + + /** 发件人昵称 **/ + @Schema(description = "发件人昵称") + @JsonProperty("addressorName") + private String addressorName; + +// /** 发件人邮箱 **/ +// @JsonProperty("sendEmail") +// private String sendEmail; + + /** SMTP服务器 **/ + @Schema(description = "SMTP服务器") + @JsonProperty("smtpServer") + private String smtpServer; + + /** SMTP端口 **/ + @Schema(description = "SMTP端口") + @JsonProperty("smtpPort") + private Integer smtpPort; + + /** SSL安全链接 **/ + @Schema(description = "SSL安全链接") + @JsonProperty("sslLink") + private Integer sslLink; + + /** SMTP用户名 **/ + @Schema(description = "SMTP用户名") + @JsonProperty("smtpUser") + private String smtpUser; + + /** SMTP密码 **/ + @Schema(description = "SMTP密码") + @JsonProperty("smtpPassword") + private String smtpPassword; + + /** 渠道 **/ + @Schema(description = "渠道") + @JsonProperty("channel") + private Integer channel; + + /** 短信签名 **/ + @Schema(description = "短信签名") + @JsonProperty("smsSignature") + private String smsSignature; + + /** 应用ID **/ + @Schema(description = "应用ID") + @JsonProperty("appId") + private String appId; + + /** 应用Secret **/ + @Schema(description = "应用Secret") + @JsonProperty("appSecret") + private String appSecret; + + /** EndPoint(阿里云) **/ + @Schema(description = "EndPoint(阿里云)") + @JsonProperty("endPoint") + private String endpoint; + + /** SDK AppID(腾讯云) **/ + @Schema(description = "SDK AppID(腾讯云)") + @JsonProperty("sdkAppId") + private String sdkAppId; + + /** AppKey(腾讯云) **/ + @Schema(description = "AppKey(腾讯云)") + @JsonProperty("appKey") + private String appKey; + + /** 地域域名(腾讯云) **/ + @Schema(description = "地域域名(腾讯云)") + @JsonProperty("zoneName") + private String zoneName; + + /** 地域参数(腾讯云) **/ + @Schema(description = "地域参数(腾讯云)") + @JsonProperty("zoneParam") + private String zoneParam; + + /** 企业id **/ + @Schema(description = "企业id") + @JsonProperty("enterpriseId") + private String enterpriseId; + + /** AgentID **/ + @Schema(description = "AgentID") + @JsonProperty("agentId") + private String agentId; + + /** WebHook类型 **/ + @Schema(description = "WebHook类型") + @JsonProperty("webhookType") + private String webhookType; + + /** WebHook地址 **/ + @Schema(description = "WebHook地址") + @JsonProperty("webhookAddress") + private String webhookAddress; + + /** 认证类型 **/ + @Schema(description = "认证类型") + @JsonProperty("approveType") + private String approveType; + + /** bearer令牌 **/ + @Schema(description = "bearer令牌") + @JsonProperty("bearer") + private String bearer; + + /** 用户名(基本认证) **/ + @Schema(description = "用户名(基本认证)") + @JsonProperty("userName") + private String userName; + + /** 密码(基本认证) **/ + @Schema(description = "密码(基本认证)") + @JsonProperty("password") + private String password; + + /** 排序 **/ + @Schema(description = "排序") + @JsonProperty("sortCode") + private Integer sortCode; + + /** 状态 **/ + @Schema(description = "状态") + @JsonProperty("enabledMark") + private Integer enabledMark; + + /** 说明 **/ + @Schema(description = "说明") + @JsonProperty("description") + private String description; + +// /** 创建时间 **/ +//// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") +// @JsonProperty("creatorTime") +// private Long creatorTime; +// +// /** 创建用户 **/ +// @JsonProperty("creatorUserId") +// private String creatorUserId; +// +// /** 修改时间 **/ +//// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") +// @JsonProperty("lastModifyTime") +// private Long lastModifyTime; +// +// /** 修改用户 **/ +// @JsonProperty("lastModifyUserId") +// private String lastModifyUserId; + +} \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/accountconfig/AccountConfigListVO.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/accountconfig/AccountConfigListVO.java new file mode 100644 index 0000000..a337b97 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/accountconfig/AccountConfigListVO.java @@ -0,0 +1,108 @@ + + +package jnpf.message.model.accountconfig; + + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import java.sql.Time; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; +import java.math.BigDecimal; +import java.util.List; +/** + * + * + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2022-08-18 + */ +@Data +public class AccountConfigListVO{ + + @Schema(description = "id") + private String id; + + /** 名称 **/ + @Schema(description = "名称") + @JSONField(name = "fullName") + private String fullName; + + /** 配置类型 **/ + @Schema(description = "配置类型") + @JSONField(name = "type") + private String type; + + /** 编码 **/ + @Schema(description = "编码") + @JSONField(name = "enCode") + private String enCode; + + /** 发件人昵称 **/ + @Schema(description = "发件人昵称") + @JSONField(name = "addressorName") + private String addressorName; + +// /** 发件人邮箱 **/ +// @JSONField(name = "sendEmail") +// private String sendEmail; + + + /** SMTP用户名 **/ + @Schema(description = "SMTP用户名") + @JSONField(name = "smtpUser") + private String smtpUser; +// +// /** SMTP密码 **/ +// @JSONField(name = "smtpPassword") +// private String smtpPassword; + + /** 渠道 **/ + @Schema(description = "渠道") + @JSONField(name = "channel") + private String channel; + + /** 短信签名 **/ + @Schema(description = "短信签名") + @JSONField(name = "smsSignature") + private String smsSignature; + + + /** WebHook类型 **/ + @Schema(description = "WebHook类型") + @JSONField(name = "webhookType") + private String webhookType; + + /** 排序 **/ + @Schema(description = "排序") + @JSONField(name = "sortCode") + private Integer sortCode; + /** 状态 **/ + @Schema(description = "状态") + @JSONField(name = "enabledMark") + private String enabledMark; + + + /** 创建时间 **/ + @Schema(description = "创建时间") + @JSONField(name = "creatorTime") + private Date creatorTime; + + /** 创建用户 **/ + @Schema(description = "创建用户") + @JSONField(name = "creatorUserId") + private String creatorUserId; + + /** 修改时间 **/ + @Schema(description = "修改时间") + @JSONField(name = "lastModifyTime") + private Date lastModifyTime; + + @Schema(description = "创建人") + private String creatorUser; + +} \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/accountconfig/AccountConfigPagination.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/accountconfig/AccountConfigPagination.java new file mode 100644 index 0000000..6b53a01 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/accountconfig/AccountConfigPagination.java @@ -0,0 +1,75 @@ +package jnpf.message.model.accountconfig; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import jnpf.base.Pagination; + +import java.util.List; + +/** + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2022-08-18 + */ +@Data +public class AccountConfigPagination extends Pagination { + + /** + * selectKey + */ + @Schema(description = "selectKey") + private String selectKey; + + @Schema(description = "json") + private String json; + + /** + * 类型 + */ + @Schema(description = "类型") + private String dataType; + + /** + * 特别查询Json + */ + @Schema(description = "特别查询Json") + private String superQueryJson; + + /** + * WebHook类型 + */ + @Schema(description = "WebHook类型") + private String webhookType; + + /** + * 渠道 + */ + @Schema(description = "渠道") + private String channel; + + /** + * 配置类型(2:邮箱,3:短信,4:钉钉,5:企业,6:飞书,7:webhook) + */ + @Schema(description = "配置类型(2:邮箱,3:短信,4:钉钉,5:企业,6:飞书,7:webhook)") + private String type; + + /** + * 状态 + */ + @Schema(description = "状态") + private String enabledMark; + + /** + * 关键字 + **/ + @Schema(description = "关键字") + private String keyword; + + /** + * 菜单id + */ + @Schema(description = "菜单id") + private String menuId; +} \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/DingTalkDeptModel.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/DingTalkDeptModel.java new file mode 100644 index 0000000..08347d2 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/DingTalkDeptModel.java @@ -0,0 +1,143 @@ +package jnpf.message.model.message; + +import com.baomidou.mybatisplus.annotation.TableField; +import lombok.Data; + +/** + * 钉钉的部门模型 + * + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021/5/6 9:28 + */ +@Data +public class DingTalkDeptModel { + /** + * 部门ID + */ + @TableField("dept_id") + private Long deptId; + + /** + * 上级部门(必填项) + */ + @TableField("parent_id") + private Long parentId; + + /** + * 部门名称(必填项) + */ + @TableField("name") + private String name; + + /** + * 是否隐藏本部门 false(默认值) + */ + @TableField("hide_dept") + private Boolean hideDept; + + /** + * 指定可以查看本部门的其他部门列表,总数不能超过200 + * 当hide_dept为true时,则此值生效 + */ + @TableField("dept_permits") + private String deptPermits; + + /** + * 指定可以查看本部门的人员userid列表,总数不能超过200 + * 当hide_dept为true时,则此值生效 + */ + @TableField("user_permits") + private String userPermits; + + /** + * 是否限制本部门成员查看通讯录 false(默认值) + */ + @TableField("outer_dept") + private Boolean outerDept; + + /** + * 本部门成员是否只能看到所在部门及下级部门通讯录: + * true:只能看到所在部门及下级部门通讯录 + * false:不能查看所有通讯录,在通讯录中仅能看到自己 + * 当outer_dept为true时,此参数生效 + */ + @TableField("outer_dept_only_self") + private Boolean outerDeptOnlySelf; + + /** + * 指定本部门成员可查看的通讯录用户userid列表,总数不能超过200。 + * 当outer_dept为true时,此参数生效 + */ + @TableField("outer_permit_users") + private String outerPermitUsers; + + /** + * 指定本部门成员可查看的通讯录部门ID列表,总数不能超过200 + * 当outer_dept为true时,此参数生效 + */ + @TableField("outer_permit_depts") + private String outerPermitDepts; + + /** + * 是否创建一个关联此部门的企业群,默认为false即不创建 + */ + @TableField("create_dept_group") + private Boolean createDeptGroup; + + /** + * 在父部门中的排序值,order值小的排序靠前 + */ + @TableField("order") + private Long order; + + /** + * 部门标识字段,开发者可用该字段来唯一标识一个部门,并与钉钉外部通讯录里的部门做映射 + */ + @TableField("source_identifier") + private String sourceIdentifier; + + /** + * 扩展属性,Json格式 + */ + @TableField("extension") + private String extension; + + /** + * 当部门群已经创建后,有新人加入部门时是否会自动加入该群 + */ + @TableField("auto_add_user") + private Boolean autoAddUser; + + /** + * 部门的主管userid列表 + */ + @TableField("dept_manager_userid_list") + private String deptManagerUseridList; + + /** + * 部门群是否包含子部门(没什么用) + */ + @TableField("group_contain_sub_dept") + private Boolean groupContainSubDept; + + /** + * 部门群是否包含外包部门(没什么用) + */ + @TableField("group_contain_outer_dept") + private Boolean groupContainOuterDept; + + /** + * 部门群是否包含隐藏部门(没什么用) + */ + @TableField("group_contain_hidden_dept") + private Boolean groupContainHiddenDept; + + /** + * 企业群群主的userid(没什么用) + */ + @TableField("org_dept_owner") + private String orgDeptOwner; + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/DingTalkModel.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/DingTalkModel.java new file mode 100644 index 0000000..4a9ce18 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/DingTalkModel.java @@ -0,0 +1,22 @@ +package jnpf.message.model.message; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * 钉钉发送信息配置模型 + * + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021/4/22 14:12 + */ +@Data +public class DingTalkModel { + @NotBlank(message = "应用凭证必填") + private String dingSynAppKey; + @NotBlank(message = "凭证密钥必填") + private String dingSynAppSecret; + private String dingAgentId; +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/DingTalkUserModel.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/DingTalkUserModel.java new file mode 100644 index 0000000..6baa648 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/DingTalkUserModel.java @@ -0,0 +1,162 @@ +package jnpf.message.model.message; + +import com.baomidou.mybatisplus.annotation.TableField; +import lombok.Data; + + +/** + * 钉钉的用户模型 + * + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021/5/6 9:29 + */ +@Data +public class DingTalkUserModel { + /** + * 员工唯一标识ID(不可修改),企业内必须唯一 + * 长度为1~64个字符,如果不传,将自动生成一个userid + */ + @TableField("userid") + private String userid; + + /** + *员工名称,长度最大80个字符 (必填项) + */ + @TableField("name") + private String name; + + /** + * 手机号码,企业内必须唯一,不可重复 + * 如果是国际号码,请使用+xx-xxxxxx的格式 + */ + @TableField("mobile") + private String mobile; + + /** + * 是否号码隐藏 通常不隐藏:false + */ + @TableField("hide_mobile") + private Boolean hideMobile; + + + /** + * 分机号,长度最大50个字符 + * 企业内必须唯一,不可重复 + */ + @TableField("telephone") + private String telephone; + + /** + * 员工工号,长度最大为50个字符 + */ + @TableField("job_number") + private String jobNumber; + + /** + * 职位,长度最大为200个字符 + */ + @TableField("title") + private String title; + + /** + * 员工邮箱,长度最大50个字符。企业内必须唯一,不可重复 + */ + @TableField("email") + private String email; + + /** + * 员工的企业邮箱,长度最大100个字符 + * 员工的企业邮箱已开通,才能增加此字段,通常不用 + */ + @TableField("org_email") + private String orgEmail; + + /** + * 办公地点,长度最大100个字符 + */ + @TableField("work_place") + private String workPlace; + + /** + * 备注,长度最大2000个字符 + */ + @TableField("remark") + private String remark; + + /** + * 所属部门id列表,如:"2,3,4" + */ + @TableField("dept_id_list") + private String deptIdList; + + /** + * 员工在对应的部门中的排序 DeptOrder[] + */ + @TableField("dept_order_list") + private String deptOrderList; + + /** + * 员工在对应的部门中的职位 DeptTitle[] + */ + @TableField("dept_title_list") + private String deptTitleList; + + + /** + * 扩展属性,可以设置多种属性,最大长度2000个字符 + * 格式:{"爱好":"旅游","年龄":"24"} + */ + @TableField("extension") + private String extension; + + /** + * 是否开启高管模式 + * true:开启 + * 开启后,手机号码对所有员工隐藏。普通员工无法对其发DING、发起钉钉免费商务电话。高管之间不受影响。 + * false:不开启 + */ + @TableField("senior_mode") + private Boolean seniorMode; + + /** + * 入职时间,Unix时间戳,单位毫秒 + */ + @TableField("hired_date") + private Long hiredDate; + + /** + * 登录邮箱 + */ + @TableField("login_email") + private String loginEmail; + + /** + * 是否专属帐号 + * 为true时,不能指定loginEmail或mobile + */ + @TableField("exclusive_account") + private Boolean exclusiveAccount; + + /** + * 专属帐号类型: + * sso:企业自建专属帐号 + * dingtalk:钉钉自建专属帐号 + */ + @TableField("exclusive_account_type") + private String exclusiveAccountType; + + /** + * 钉钉专属帐号登录名 + */ + @TableField("login_id") + private String loginId; + + /** + * 钉钉专属帐号初始密码 + */ + @TableField("init_password") + private String initPassword; + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/EmailModel.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/EmailModel.java new file mode 100644 index 0000000..6fa42f3 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/EmailModel.java @@ -0,0 +1,27 @@ +package jnpf.message.model.message; + +import lombok.Data; + +/** + * 发送邮件配置模型 + * + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021/4/20 14:27 + */ +@Data +public class EmailModel { + private String emailPop3Host; + private String emailPop3Port; + private String emailSmtpHost; + private String emailSmtpPort; + private String emailSenderName; + private String emailAccount; + private String emailPassword; + private String emailSsl; + + private String emailToUsers; + private String emailContent; + private String emailTitle; +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/MessageInfoVO.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/MessageInfoVO.java new file mode 100644 index 0000000..fcda21f --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/MessageInfoVO.java @@ -0,0 +1,48 @@ +package jnpf.message.model.message; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class MessageInfoVO { + + @Schema(description = "主键") + private String id; + @Schema(description = "标题") + private String title; + @Schema(description = "类型") + private Integer type; + @Schema(description = "修改时间") + private long lastModifyTime; + @Schema(description = "创建用户") + private String creatorUser; + @Schema(description = "是否已读") + private Integer isRead; + + @Schema(description = "有效标志") + private Integer enabledMark; + + /** + * 发布人员 + */ + @Schema(description = "发布人员") + private String releaseUser; + + /** + * 发布时间 + */ + @Schema(description = "发布时间") + private Long releaseTime; + + @Schema(description = "修改用户") + private String lastModifyUserId; + @Schema(description = "流程类型") + private Integer flowType; +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/MessageNoticeVO.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/MessageNoticeVO.java new file mode 100644 index 0000000..97833ab --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/MessageNoticeVO.java @@ -0,0 +1,58 @@ +package jnpf.message.model.message; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class MessageNoticeVO { + @Schema(description = "id") + private String id; + @Schema(description = "标题") + private String title; + + @Schema(description = "创建人员") + private String creatorUser; + + @Schema(description = "发布时间",example = "1") + private Long lastModifyTime; + + @Schema(description = "状态(0-存草稿,1-已发布,2-已过期)",example = "1") + private Integer enabledMark; + + @Schema(description = "创建时间") + private Long creatorTime; + + /** + * 发布人员 + */ + @Schema(description = "发布人员") + private String releaseUser; + + /** + * 发布时间 + */ + @Schema(description = "发布时间") + private Long releaseTime; + + @Schema(description = "修改用户") + private String lastModifyUserId; + + @Schema(description = "类型") + private Long expirationTime; + + @Schema(description = "摘要") + private String excerpt; + + /** + * 分类 1-公告 2-通知 + */ + @Schema(description = "分类") + private String category; +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/MessageRecordForm.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/MessageRecordForm.java new file mode 100644 index 0000000..616621f --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/MessageRecordForm.java @@ -0,0 +1,17 @@ +package jnpf.message.model.message; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class MessageRecordForm { + @Schema(description = "id集合") + private String ids; +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/NoticeCrForm.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/NoticeCrForm.java new file mode 100644 index 0000000..13e0298 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/NoticeCrForm.java @@ -0,0 +1,39 @@ +package jnpf.message.model.message; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import javax.validation.constraints.NotBlank; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class NoticeCrForm { + @Schema(description = "内容") + private String bodyText; + @NotBlank(message = "必填") + @Schema(description = "标题") + private String title; + @Schema(description = "接收人") + private String toUserIds; + @Schema(description = "附件") + private String files; + + @Schema(description = "封面图片") + private String coverImage; + @Schema(description = "过期时间") + private Long expirationTime; + @Schema(description = "分类") + private String category; + @Schema(description = "提醒方式") + private Integer remindCategory; + @Schema(description = "发送配置") + private String sendConfigId; + + @Schema(description = "摘要") + private String excerpt; +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/NoticeInfoVO.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/NoticeInfoVO.java new file mode 100644 index 0000000..dc69c1a --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/NoticeInfoVO.java @@ -0,0 +1,56 @@ +package jnpf.message.model.message; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class NoticeInfoVO { + @Schema(description = "主键") + private String id; + @Schema(description = "标题") + private String title; + @Schema(description = "内容") + private String bodyText; + @Schema(description = "创建用户") + private String creatorUser; + @Schema(description = "修改时间") + private Long lastModifyTime; + @Schema(description = "接收人id集合") + private String toUserIds; + + @Schema(description = "文件") + private String files; + + /** + * 发布人员 + */ + @Schema(description = "发布人员") + private String releaseUser; + + /** + * 发布时间 + */ + @Schema(description = "发布时间") + private Long releaseTime; + + @Schema(description = "封面图片") + private String coverImage; + @Schema(description = "过期时间") + private Long expirationTime; + @Schema(description = "分类") + private String category; + @Schema(description = "提醒方式") + private Integer remindCategory; + @Schema(description = "发送配置") + private String sendConfigId; + + @Schema(description = "摘要") + private String excerpt; +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/NoticeUpForm.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/NoticeUpForm.java new file mode 100644 index 0000000..9b54f53 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/NoticeUpForm.java @@ -0,0 +1,14 @@ +package jnpf.message.model.message; + +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class NoticeUpForm extends NoticeCrForm { +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/NoticeVO.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/NoticeVO.java new file mode 100644 index 0000000..3101045 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/NoticeVO.java @@ -0,0 +1,49 @@ +package jnpf.message.model.message; + +import com.alibaba.fastjson.annotation.JSONField; +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class NoticeVO { + private String id; + @JSONField(name="title") + private String fullName; + private Long creatorTime; + @Schema(description = "创建用户") + private String creatorUser; + + /** + * 发布人员 + */ + @Schema(description = "发布人员") + private String releaseUser; + + /** + * 发布时间 + */ + @Schema(description = "发布时间") + private Long releaseTime; + + /** + * 消息类型 + */ + @Schema(description ="分类") + private String category; + + @Schema(description = "封面图片") + private String coverImage; + + @Schema(description = "摘要") + private String excerpt; + + @JsonIgnore + @Schema(description = "修改时间") + private Long lastModifyTime; + + @JsonIgnore + @Schema(description = "修改用户") + private String lastModifyUserId; + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/OraganizeListVO.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/OraganizeListVO.java new file mode 100644 index 0000000..7b36704 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/OraganizeListVO.java @@ -0,0 +1,30 @@ +package jnpf.message.model.message; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class OraganizeListVO { + @Schema(description = "主键") + private String id; + @Schema(description = "父主键") + private String parentId; + @Schema(description = "名称") + private String fullName; + @Schema(description = "编码") + private String enCode; + @Schema(description = "备注") + private String description; + @Schema(description = "状态") + private int enabledMark; + private Long creatorTime; + @Schema(description = "是否有下级菜单") + private boolean hasChildren = true; + @Schema(description = "下级菜单列表") + private List children = new ArrayList<>(); + @Schema(description = "排序") + private Long sortCode; +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/PaginationMessage.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/PaginationMessage.java new file mode 100644 index 0000000..98b5c3f --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/PaginationMessage.java @@ -0,0 +1,28 @@ +package jnpf.message.model.message; + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.base.Pagination; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class PaginationMessage extends Pagination { + /** + * 类型 + */ + @Schema(description = "类型") + private Integer type; + + /** + * 是否已读 + */ + @Schema(description = "是否已读") + private Integer isRead; + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/QyWebChatDeptModel.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/QyWebChatDeptModel.java new file mode 100644 index 0000000..c480775 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/QyWebChatDeptModel.java @@ -0,0 +1,35 @@ +package jnpf.message.model.message; + +import lombok.Data; + +/** + * 企业微信获取部门的对象模型 + * + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021/4/25 11:10 + */ +@Data +public class QyWebChatDeptModel { + /** + * 部门ID + */ + private Integer id; + /** + * 部门中文名称 + */ + private String name; + /** + * 部门英文名称 + */ + private String name_en; + /** + * 部门的上级部门 + */ + private Integer parentid; + /** + * 部门排序 + */ + private Integer order; +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/QyWebChatUserModel.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/QyWebChatUserModel.java new file mode 100644 index 0000000..70acd88 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/QyWebChatUserModel.java @@ -0,0 +1,115 @@ +package jnpf.message.model.message; + +import lombok.Data; + +import java.util.LinkedList; +import java.util.List; + +/** + * 企业微信获取成员的对象模型 + * + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021/4/25 16:29 + */ +@Data +public class QyWebChatUserModel { + /** + * 执行返回执行代码 + */ + private String errcode; + /** + * 执行返回执行消息 + */ + private String errmsg; + /** + * 用户ID + */ + private String userid; + /** + * 用户名称 + */ + private String name; + /** + * 成员别名 + */ + private String alias; + /** + * 手机号码。企业内必须唯一,mobile/email二者不能同时为空 + */ + private String mobile; + /** + * 成员所属部门id列表,不超过100个 + */ + private List department; + /** + * 部门内的排序值,默认为0,成员次序以创建时间从小到大排列 + * 个数必须和参数department的个数一致,数值越大排序越前面 + */ + private String order; + /** + * 职务信息 + */ + private String position; + /** + * 性别。1表示男性,2表示女性 + */ + private String gender; + /** + * 邮箱。长度6~64个字节,且为有效的email格式。 + * 企业内必须唯一,mobile/email二者不能同时为空 + */ + private String email; + /** + * 座机。32字节以内,由纯数字或’-‘号组成。 + */ + private String telephone; + /** + * 个数必须和参数department的个数一致,表示在所在的部门内是否为上级。1表示为上级,0表示非上级。 + * 在审批等应用里可以用来标识上级审批人 + */ + private String is_leader_in_dept; + /** + * 成员头像的mediaid,通过素材管理接口上传图片获得的mediaid + */ + private String avatar_mediaid; + /** + * 启用/禁用成员。1表示启用成员,0表示禁用成员 + */ + private String enable; + /** + * 激活状态: 1=已激活,2=已禁用,4=未激活,5=退出企业。 + */ + private Integer status; + /** + * 自定义字段 + */ + private String extattr; + /** + * 是否邀请该成员使用企业微信(将通过微信服务通知或短信或邮件下发邀请,每天自动下发一次,最多持续3个工作日),默认值为true。 + */ + private boolean to_invite; + /** + * 成员对外属性 + */ + private String external_profile; + /** + * 对外职务,如果设置了该值,则以此作为对外展示的职务,否则以position来展示。 + * 长度12个汉字内 + */ + private String external_position; + /** + * 地址 + */ + private String address; + /** + * 主部门 + */ + private String main_department; + + /** + * 部门列表 + */ + private LinkedList deptIdList; +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/SentMessageForm.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/SentMessageForm.java new file mode 100644 index 0000000..acd81e6 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/SentMessageForm.java @@ -0,0 +1,83 @@ +package jnpf.message.model.message; + +import jnpf.base.UserInfo; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import java.util.List; +import java.util.Map; + +/** + * 消息模型 + * + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021/4/20 11:44 + */ +@Data +public class SentMessageForm { + /** + * 接收人员用户ID组 + */ + private List toUserIds; + + /** + * 消息模板Id + */ + private String templateId; + + /** + * 内容 + */ + private String content; + + /** + * 参数 + */ + private Map parameterMap; + + /** + * 是否发送站内信 + */ + private boolean sysMessage; + + /** + * 站内信 + */ + private String title; + + /** + * 流程信息 + */ + private String flowName; + + /** + * 发起人 + */ + private String userName; + + /** + * 站内信 + */ + private Map contentMsg; + + /** + * 用户信息 + */ + private UserInfo userInfo; + + /** + * 消息类别 + */ + private Integer type; + + /** + * 流程类型(1:审批 2:委托) + */ + private Integer flowType = 1; + + /** + * 消息类别 + */ + private String id; +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/SynThirdInfoCrForm.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/SynThirdInfoCrForm.java new file mode 100644 index 0000000..d2ae60b --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/SynThirdInfoCrForm.java @@ -0,0 +1,78 @@ +package jnpf.message.model.message; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 第三方工具的对象同步表 + * + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021/4/25 9:35 + */ +@Data +public class SynThirdInfoCrForm { + + /** + * 第三方类型(1:企业微信;2:钉钉) + */ + @Schema(description = "第三方类型(1:企业微信;2:钉钉)") + private Integer thirdtype; + + /** + * 数据类型(1:公司;2:部门;3:用户) + */ + @Schema(description = "数据类型(1:公司;2:部门;3:用户)") + private Integer datatype; + + /** + * 本地对象ID(公司ID、部门ID、用户ID) + */ + @Schema(description = "本地对象ID(公司ID、部门ID、用户ID)") + private String sysObjId; + + /** + * 第三方对象ID(公司ID、部门ID、用户ID) + */ + @Schema(description = "第三方对象ID(公司ID、部门ID、用户ID)") + private String thirdObjId; + + /** + * 同步状态(0:未同步;1:同步成功;2:同步失败) + */ + @Schema(description = "同步状态(0:未同步;1:同步成功;2:同步失败)") + private Integer synstate; + + /** + * 描述 + */ + @Schema(description = "描述") + private String description; + +// /** +// * 创建时间 +// */ +// @TableField(value = "F_CREATORTIME",fill = FieldFill.INSERT) +// private Date creatorTime; +// +// /** +// * 创建用户 +// */ +// @TableField(value = "F_CREATORUSERID",fill = FieldFill.INSERT) +// private String creatorUserId; +// +// /** +// * 修改用户 +// */ +// @TableField(value = "F_LASTMODIFYUSERID",fill = FieldFill.UPDATE) +// private String lastModifyUserId; +// +// /** +// * 修改时间 +// */ +// @TableField(value = "F_LASTMODIFYTIME",fill = FieldFill.UPDATE) +// @JSONField(name = "F_LastModifyTime") +// private Date lastModifyTime; + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/SynThirdInfoUpForm.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/SynThirdInfoUpForm.java new file mode 100644 index 0000000..945d01d --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/message/SynThirdInfoUpForm.java @@ -0,0 +1,16 @@ +package jnpf.message.model.message; + +import lombok.Data; + +/** + * 第三方工具的对象同步表 + * + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021/4/25 9:35 + */ +@Data +public class SynThirdInfoUpForm extends SynThirdInfoCrForm{ + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagedatatype/MessageDataTypeForm.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagedatatype/MessageDataTypeForm.java new file mode 100644 index 0000000..2b62275 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagedatatype/MessageDataTypeForm.java @@ -0,0 +1,61 @@ + + +package jnpf.message.model.messagedatatype; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import java.util.List; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; + +/** + * + * + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2022-08-18 + */ +@Data +public class MessageDataTypeForm { + /** 主键 */ + @Schema(description = "主键") + private String id; + /** 数据类型 **/ + @Schema(description = "数据类型") + @JsonProperty("type") + private String type; + + /** 数据名称 **/ + @Schema(description = "数据名称") + @JsonProperty("fullName") + private String fullName; + + /** 数据编码(为防止与系统后续更新的功能的数据编码冲突,客户自定义添加的功能编码请以ZDY开头。例如:ZDY1) **/ + @Schema(description = "数据编码") + @JsonProperty("enCode") + private String enCode; + + /** 创建时间 **/ + @Schema(description = "创建时间") + @JsonProperty("creatorTime") + private String creatorTime; + + /** 创建人员 **/ + @Schema(description = "创建人员") + @JsonProperty("creatorUserId") + private String creatorUserId; + + /** 修改时间 **/ + @Schema(description = "修改时间") + @JsonProperty("lastModifyTime") + private String lastModifyTime; + + /** 修改人员 **/ + @Schema(description = "修改人员") + @JsonProperty("lastModifyUserId") + private String lastModifyUserId; + + +} \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagedatatype/MessageDataTypeInfoVO.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagedatatype/MessageDataTypeInfoVO.java new file mode 100644 index 0000000..031406c --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagedatatype/MessageDataTypeInfoVO.java @@ -0,0 +1,56 @@ + + + +package jnpf.message.model.messagedatatype; + +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.math.BigDecimal; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +/** + * + * + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2022-08-18 + */ +@Data +public class MessageDataTypeInfoVO{ + /** 主键 **/ + @JsonProperty("id") + private String id; + + /** 数据类型 **/ + @JsonProperty("type") + private String type; + + /** 数据名称 **/ + @JsonProperty("fullName") + private String fullName; + + /** 数据编码 **/ + @JsonProperty("enCode") + private String enCode; + + /** 创建时间 **/ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + @JsonProperty("creatortime") + private Date creatortime; + + /** 创建人员 **/ + @JsonProperty("creatorUserId") + private String creatoruserid; + + /** 修改时间 **/ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + @JsonProperty("lastModifyTime") + private Date lastmodifytime; + + /** 修改人员 **/ + @JsonProperty("lastModifyUserId") + private String lastmodifyuserid; + +} \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagedatatype/MessageDataTypeListVO.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagedatatype/MessageDataTypeListVO.java new file mode 100644 index 0000000..b51ce86 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagedatatype/MessageDataTypeListVO.java @@ -0,0 +1,82 @@ + + +package jnpf.message.model.messagedatatype; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.sql.Time; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; + +import java.math.BigDecimal; +import java.util.List; + +/** + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2022-08-18 + */ +@Data +public class MessageDataTypeListVO { + + @Schema(description = "id") + private String id; + + /** + * 数据类型 + **/ + @Schema(description = "数据类型") + @JsonProperty("type") + private String type; + + /** + * 数据名称 + **/ + @Schema(description = "数据名称") + @JsonProperty("fullName") + private String fullName; + + /** + * 数据编码(为防止与系统后续更新的功能的数据编码冲突,客户自定义添加的功能编码请以ZDY开头。例如:ZDY1) + **/ + @Schema(description = "数据编码") + @JsonProperty("enCode") + private String enCode; + + /** + * 创建时间 + **/ + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @JsonProperty("creatortime") + private Date creatortime; + + /** + * 创建人员 + **/ + @Schema(description = "创建人员") + @JsonProperty("creatorUserId") + private String creatoruserid; + + /** + * 修改时间 + **/ + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @JsonProperty("lastModifyTime") + private Date lastmodifytime; + + /** + * 修改人员 + **/ + @Schema(description = "修改人员") + @JsonProperty("lastModifyUserId") + private String lastmodifyuserid; + +} \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagedatatype/MessageDataTypePagination.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagedatatype/MessageDataTypePagination.java new file mode 100644 index 0000000..7893522 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagedatatype/MessageDataTypePagination.java @@ -0,0 +1,48 @@ +package jnpf.message.model.messagedatatype; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import jnpf.base.Pagination; + +import java.util.List; + +/** + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2022-08-18 + */ +@Data +public class MessageDataTypePagination extends Pagination { + + @Schema(description = "selectKey") + private String selectKey; + + @Schema(description = "json") + private String json; + + @Schema(description = "数据类型") + private String dataType; + + @Schema(description = "特殊查询json") + private String superQueryJson; + + + /** + * 数据名称 + */ + @Schema(description = "数据名称") + private String name; + + /** + * 数据编码 + */ + @Schema(description = "数据编码") + private String code; + /** + * 菜单id + */ + @Schema(description = "菜单id") + private String menuId; +} \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagemonitor/MessageMonitorForm.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagemonitor/MessageMonitorForm.java new file mode 100644 index 0000000..791af62 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagemonitor/MessageMonitorForm.java @@ -0,0 +1,85 @@ + + +package jnpf.message.model.messagemonitor; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; +import java.math.BigDecimal; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; + +/** + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2022-08-22 + */ +@Data +public class MessageMonitorForm { + /** + * 主键 + */ + @Schema(description = "主键") + private String id; + /** + * 账号id + **/ + @Schema(description = "账号id") + @JsonProperty("accountId") + private String accountId; + + /** + * 账号名称 + **/ + @Schema(description = "账号名称") + @JsonProperty("accountName") + private String accountName; + + /** + * 账号编码 + **/ + @Schema(description = "账号编码") + @JsonProperty("accountCode") + private String accountCode; + + /** + * 消息类型 + **/ + @Schema(description = "消息类型") + @JsonProperty("messageType") + private String messageType; + + /** + * 发送时间 + **/ + @Schema(description = "发送时间") + @JsonProperty("sendTime") + private String sendTime; + + /** + * 消息模板id + **/ + @Schema(description = "消息模板id") + @JsonProperty("messageTemplateId") + private String messageTemplateId; + + /** + * 标题 + **/ + @Schema(description = "标题") + @JsonProperty("title") + private String title; + + /** + * 内容 + **/ + @Schema(description = "内容") + @JsonProperty("content") + private String content; + + + +} \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagemonitor/MessageMonitorInfoVO.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagemonitor/MessageMonitorInfoVO.java new file mode 100644 index 0000000..8745082 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagemonitor/MessageMonitorInfoVO.java @@ -0,0 +1,102 @@ + + + +package jnpf.message.model.messagemonitor; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; +import java.math.BigDecimal; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; + +/** + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2022-08-22 + */ +@Data +public class MessageMonitorInfoVO { + /** + * 主键 + **/ + @Schema(description = "主键") + @JsonProperty("id") + private String id; + + /** + * 账号id + **/ + @Schema(description = "账号id") + @JsonProperty("accountId") + private String accountId; + + /** + * 账号名称 + **/ + @Schema(description = "账号名称") + @JsonProperty("accountName") + private String accountName; + + /** + * 账号编码 + **/ + @Schema(description = "账号编码") + @JsonProperty("accountCode") + private String accountCode; + + /** + * 消息类型 + **/ + @Schema(description = "消息类型") + @JsonProperty("messageType") + private String messageType; + + /** + * 消息来源 + **/ + @Schema(description = "消息来源") + @JsonProperty("messageSource") + private String messageSource; + + /** + * 发送时间 + **/ + @Schema(description = "发送时间") + @JsonProperty("sendTime") + private Long sendTime; + + /** + * 消息模板id + **/ + @Schema(description = "消息模板id") + @JsonProperty("messageTemplateId") + private String messageTemplateId; + + /** + * 接收人 + **/ + @Schema(description = "接收人") + @JsonProperty("receiveUser") + private String receiveUser; + + /** + * 标题 + **/ + @Schema(description = "标题") + @JsonProperty("title") + private String title; + + /** + * 内容 + **/ + @Schema(description = "内容") + @JsonProperty("content") + private String content; + + +} \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagemonitor/MessageMonitorListVO.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagemonitor/MessageMonitorListVO.java new file mode 100644 index 0000000..8fe56b4 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagemonitor/MessageMonitorListVO.java @@ -0,0 +1,59 @@ + + +package jnpf.message.model.messagemonitor; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.sql.Time; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; + +import java.math.BigDecimal; +import java.util.List; + +/** + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2022-08-22 + */ +@Data +public class MessageMonitorListVO { + @Schema(description = "主键") + private String id; + + /** + * 消息类型 + **/ + @Schema(description = "消息类型") + @JSONField(name = "messageType") + private String messageType; + + /** + * 消息来源 + **/ + @Schema(description = "消息来源") + @JsonProperty("messageSource") + private String messageSource; + + /** + * 发送时间 + **/ + @Schema(description = "发送时间") + @JSONField(name = "sendTime") + private Long sendTime; + + /** + * 标题 + **/ + @Schema(description = "标题") + @JSONField(name = "title") + private String title; + + +} \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagemonitor/MessageMonitorPagination.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagemonitor/MessageMonitorPagination.java new file mode 100644 index 0000000..75bd16f --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagemonitor/MessageMonitorPagination.java @@ -0,0 +1,66 @@ +package jnpf.message.model.messagemonitor; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import jnpf.base.Pagination; + +import java.util.List; + +/** + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2022-08-22 + */ +@Data +public class MessageMonitorPagination extends Pagination { + + @Schema(description = "selectKey") + private String selectKey; + + @Schema(description = "json") + private String json; + + @Schema(description = "数据类型") + private String dataType; + + @Schema(description = "特殊查询json") + private String superQueryJson; + + + /** + * 消息来源 + */ + @Schema(description = "消息来源") + private String messageSource; + + /** + * 消息类型 + */ + @Schema(description = "消息类型") + private String messageType; + + /** + * 关键词 + */ + @Schema(description = "关键词") + private String keyword; + + /** + * 发送时间(开始时间) + */ + @Schema(description = "发送时间") + private String startTime; + + /** + * 接收时间 + */ + @Schema(description = "接收时间") + private String endTime; + /** + * 菜单id + */ + @Schema(description = "菜单id") + private String menuId; +} \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagemonitor/MsgDelForm.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagemonitor/MsgDelForm.java new file mode 100644 index 0000000..3aa6bdb --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagemonitor/MsgDelForm.java @@ -0,0 +1,18 @@ +package jnpf.message.model.messagemonitor; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/16 10:10 + */ +@Data +public class MsgDelForm { + @Schema(description = "id集合") + private String[] ids; +} + diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagetemplateconfig/MessageTemplateConfigForm.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagetemplateconfig/MessageTemplateConfigForm.java new file mode 100644 index 0000000..fcc529e --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagetemplateconfig/MessageTemplateConfigForm.java @@ -0,0 +1,118 @@ + + +package jnpf.message.model.messagetemplateconfig; + +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.message.entity.SmsFieldEntity; +import jnpf.message.entity.TemplateParamEntity; +import lombok.Data; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * + * + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2022-08-18 + */ +@Data +public class MessageTemplateConfigForm { + /** 主键 */ + @Schema(description = "主键") + private String id; + /** 名称 **/ + @Schema(description = "名称") + @JsonProperty("fullName") + private String fullName; + + /** 编码 **/ + @Schema(description = "编码") + @JsonProperty("enCode") + private String enCode; + + /** 模板类型 **/ + @Schema(description = "模板类型") + @JsonProperty("templateType") + private String templateType; + + /** 消息来源 **/ + @Schema(description = "消息来源") + @JsonProperty("messageSource") + private String messageSource; + + /** 消息类型 **/ + @Schema(description = "消息类型") + @JsonProperty("messageType") + private String messageType; + + /** 排序 **/ + @Schema(description = "排序") + @JsonProperty("sortCode") + private Integer sortCode; + + /** 状态 **/ + @Schema(description = "状态") + @JsonProperty("enabledMark") + private Integer enabledMark; + + /** 说明 **/ + @Schema(description = "说明") + @JsonProperty("description") + private String description; + + /** 消息标题 **/ + @Schema(description = "消息标题") + @JsonProperty("title") + private String title; + + /** 消息内容 **/ + @Schema(description = "消息内容") + @JsonProperty("content") + private String content; + + /** 模板编号 **/ + @Schema(description = "模板编号") + @JsonProperty("templateCode") + private String templateCode; + + /** 跳转方式 (1:小程序,2:页面)**/ + @Schema(description = "跳转方式") + @JsonProperty("wxSkip") + private String wxSkip; + + /** 关联小程序id **/ + @Schema(description = "关联小程序id") + @JsonProperty("xcxAppId") + private String xcxAppId; + +// /** 创建时间 **/ +// @JsonProperty("creatorTime") +// private String creatorTime; +// +// /** 创建人员 **/ +// @JsonProperty("creatorUserId") +// private String creatorUserId; +// +// /** 修改时间 **/ +// @JsonProperty("lastModifyTime") +// private String lastModifyTime; +// +// /** 修改人员 **/ +// @JsonProperty("lastModifyUserId") +// private String lastModifyUserId; + + /** 子表数据 **/ + @Schema(description = "子表数据") + @JsonProperty("templateParamList") + private List templateParamList; + /** 子表数据 **/ + @Schema(description = "子表数据") + @JsonProperty("smsFieldList") + private List smsFieldList; + + +} \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagetemplateconfig/MessageTemplateConfigInfoVO.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagetemplateconfig/MessageTemplateConfigInfoVO.java new file mode 100644 index 0000000..321b34e --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagetemplateconfig/MessageTemplateConfigInfoVO.java @@ -0,0 +1,160 @@ + + + +package jnpf.message.model.messagetemplateconfig; + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.message.entity.SmsFieldEntity; +import jnpf.message.entity.TemplateParamEntity; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; + +/** + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2022-08-18 + */ +@Data +public class MessageTemplateConfigInfoVO { + /** + * 主键 + **/ + @Schema(description = "主键") + @JsonProperty("id") + private String id; + + /** + * 名称 + **/ + @Schema(description = "名称") + @JsonProperty("fullName") + private String fullName; + + /** + * 编码 + **/ + @Schema(description = "编码") + @JsonProperty("enCode") + private String enCode; + + /** + * 模板类型 + **/ + @Schema(description = "模板类型") + @JsonProperty("templateType") + private String templateType; + + /** + * 消息来源 + **/ + @Schema(description = "消息来源") + @JsonProperty("messageSource") + private String messageSource; + + /** + * 消息类型 + **/ + @Schema(description = "消息类型") + @JsonProperty("messageType") + private String messageType; + + /** + * 排序 + **/ + @Schema(description = "排序") + @JsonProperty("sortCode") + private Integer sortCode; + + /** + * 状态 + **/ + @Schema(description = "状态") + @JsonProperty("enabledMark") + private Integer enabledMark; + + /** + * 说明 + **/ + @Schema(description = "说明") + @JsonProperty("description") + private String description; + + /** + * 消息标题 + **/ + @Schema(description = "消息标题") + @JsonProperty("title") + private String title; + + /** + * 消息内容 + **/ + @Schema(description = "消息内容") + @JsonProperty("content") + private String content; + + /** + * 模板编号 + **/ + @Schema(description = "模板编号") + @JsonProperty("templateCode") + private String templateCode; + + /** + * 跳转方式 (1:小程序,2:页面) + **/ + @Schema(description = "跳转方式 (1:小程序,2:页面)") + @JsonProperty("wxSkip") + private String wxSkip; + + /** + * 关联小程序id + **/ + @Schema(description = "关联小程序id") + @JsonProperty("xcxAppId") + private String xcxAppId; + + /** + * 创建时间 + **/ + @Schema(description = "创建时间") + @JsonProperty("creatorTime") + private Long creatorTime; + + /** + * 创建人员 + **/ + @Schema(description = "创建人员") + @JsonProperty("creatorUserId") + private String creatorUserId; + + /** + * 修改时间 + **/ + @Schema(description = "修改时间") + @JsonProperty("lastModifyTime") + private Long lastModifyTime; + + /** + * 修改人员 + **/ + @Schema(description = "修改人员") + @JsonProperty("lastModifyUserId") + private String lastModifyUserId; + + /** + * 子表数据 + **/ + @Schema(description = "子表数据") + @JsonProperty("templateParamList") + private List templateParamList; + /** + * 子表数据 + **/ + @Schema(description = "子表数据") + @JsonProperty("smsFieldList") + private List smsFieldList; +} \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagetemplateconfig/MessageTemplateConfigListVO.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagetemplateconfig/MessageTemplateConfigListVO.java new file mode 100644 index 0000000..8e9edbe --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagetemplateconfig/MessageTemplateConfigListVO.java @@ -0,0 +1,146 @@ + + +package jnpf.message.model.messagetemplateconfig; + + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.message.entity.SmsFieldEntity; +import jnpf.message.entity.TemplateParamEntity; +import lombok.Data; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; + +import java.util.List; + +/** + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2022-08-18 + */ +@Data +public class MessageTemplateConfigListVO { + private String id; + + + /** + * 子表数据 + **/ + @Schema(description = "子表数据") + @JsonProperty("tableField112") + @JSONField(name = "tableField112") + private List templateParamList; + + /** + * 子表数据 + **/ + @Schema(description = "子表数据") + @JsonProperty("tableField116") + @JSONField(name = "tableField116") + private List smsFieldList; + + /** + * 名称 + **/ + @Schema(description = "名称") + @JSONField(name = "fullName") + private String fullName; + + /** + * 编码 + **/ + @Schema(description = "编码") + @JSONField(name = "enCode") + private String enCode; + + /** + * 模板类型 + **/ + @Schema(description = "模板类型") + @JSONField(name = "templateType") + private String templateType; + + /** + * 消息来源 + **/ + @Schema(description = "消息来源") + @JSONField(name = "messageSource") + private String messageSource; + + /** + * 消息类型 + **/ + @Schema(description = "消息类型") + @JSONField(name = "messageType") + private String messageType; + + /** + * 排序 + **/ + @Schema(description = "排序") + @JSONField(name = "sortCode") + private Integer sortCode; + /** + * 状态 + **/ + @Schema(description = "状态") + @JSONField(name = "enabledMark") + private Integer enabledMark; + +// /** +// * 说明 +// **/ +// @JSONField(name = "remark") +// private String remark; + +// /** +// * 消息标题 +// **/ +// @JSONField(name = "title") +// private String title; +// +// /** +// * 消息内容 +// **/ +// @JSONField(name = "content") +// private String content; +// +// /** +// * 模板编号 +// **/ +// @JSONField(name = "templateCode") +// private String templateCode; + + /** + * 创建时间 + **/ + @Schema(description = "创建时间") + @JSONField(name = "creatorTime") + private Long creatorTime; + + /** + * 创建人员 + **/ + @Schema(description = "创建人员") + @JSONField(name = "creatorUserId") + private String creatorUserId; + + /** + * 修改时间 + **/ + @Schema(description = "修改时间") + @JSONField(name = "lastModifyTime") + private Long lastModifyTime; + +// /** +// * 修改人员 +// **/ +// @JSONField(name = "lastModifyUserId") +// private String lastModifyUserId; + + @Schema(description = "创建人") + private String creatorUser; + + +} \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagetemplateconfig/MessageTemplateConfigPagination.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagetemplateconfig/MessageTemplateConfigPagination.java new file mode 100644 index 0000000..d4093d9 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagetemplateconfig/MessageTemplateConfigPagination.java @@ -0,0 +1,66 @@ +package jnpf.message.model.messagetemplateconfig; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import jnpf.base.Pagination; + +/** + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2022-08-18 + */ +@Data +public class MessageTemplateConfigPagination extends Pagination { + + @Schema(description = "selectKey") + private String selectKey; + + @Schema(description = "json") + private String json; + + @Schema(description = "数据类型") + private String dataType; + + @Schema(description = "特殊查询json") + private String superQueryJson; + + + + /** + * 模板类型 + */ + @Schema(description = "模板类型") + private String templateType; + + /** + * 消息类型 + */ + @Schema(description = "消息类型") + private String messageType; + + /** + * 关键词 + */ + @Schema(description = "关键词") + private String keyword; + + /** + * 状态 + */ + @Schema(description = "状态") + private String enabledMark; + + /** + * 消息来源 + */ + @Schema(description = "消息来源") + private String messageSource; + + /** + * 菜单id + */ + @Schema(description = "菜单id") + private String menuId; +} \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagetemplateconfig/SmsFieldModel.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagetemplateconfig/SmsFieldModel.java new file mode 100644 index 0000000..9bd3541 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagetemplateconfig/SmsFieldModel.java @@ -0,0 +1,24 @@ +package jnpf.message.model.messagetemplateconfig; + +import lombok.Data; + +/** + * + * + * 版本: V3.2.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2022-08-18 + */ +@Data +public class SmsFieldModel { + + + private String smsField; + + private String field; + + private String fieldId; + + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagetemplateconfig/TemplateParamModel.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagetemplateconfig/TemplateParamModel.java new file mode 100644 index 0000000..4bb3b65 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/messagetemplateconfig/TemplateParamModel.java @@ -0,0 +1,40 @@ +package jnpf.message.model.messagetemplateconfig; + +import lombok.Data; + +/** + * + * + * 版本: V3.2.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2022-08-18 + */ +@Data +public class TemplateParamModel { + + /** 模板参数 **/ + private String field; + + /** 参数说明 **/ + private String fieldName; + + /** 参数变量**/ + private String value; + + /** 参数主键 **/ + private String id; + + /** 消息模板类型 **/ + private String templateType; + + /** 消息模板编码 **/ + private String templateCode; + + /** 消息模板id **/ + private String templateId; + + /** 消息模板名称 **/ + private String templateName; + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendconfigrecord/SendConfigRecordForm.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendconfigrecord/SendConfigRecordForm.java new file mode 100644 index 0000000..9184046 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendconfigrecord/SendConfigRecordForm.java @@ -0,0 +1,61 @@ + + +package jnpf.message.model.sendconfigrecord; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import java.util.List; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; + +/** + * + * + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2022-09-21 + */ +@Data +public class SendConfigRecordForm { + /** 主键 */ + @Schema(description = "主键") + private String id; + /** 发送配置id **/ + @Schema(description = "发送配置id") + @JsonProperty("sendConfigId") + private String sendConfigId; + + /** 消息来源 **/ + @Schema(description = "消息来源") + @JsonProperty("messageSource") + private String messageSource; + + /** 被引用id **/ + @Schema(description = "被引用id") + @JsonProperty("usedId") + private String usedId; + + /** 创建时间 **/ + @Schema(description = "创建时间") + @JsonProperty("creatorTime") + private String creatorTime; + + /** 创建人员 **/ + @Schema(description = "创建人员") + @JsonProperty("creatorUserId") + private String creatorUserId; + + /** 修改时间 **/ + @Schema(description = "修改时间") + @JsonProperty("lastModifyTime") + private String lastModifyTime; + + /** 修改人员 **/ + @Schema(description = "修改人员") + @JsonProperty("lastModifyUserId") + private String lastModifyUserId; + + +} \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendconfigrecord/SendConfigRecordInfoVO.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendconfigrecord/SendConfigRecordInfoVO.java new file mode 100644 index 0000000..f04d198 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendconfigrecord/SendConfigRecordInfoVO.java @@ -0,0 +1,79 @@ + + + +package jnpf.message.model.sendconfigrecord; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; +import java.math.BigDecimal; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; + +/** + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2022-09-21 + */ +@Data +public class SendConfigRecordInfoVO { + /** + * 主键 + **/ + @Schema(description = "主键") + @JsonProperty("id") + private String id; + + /** + * 发送配置id + **/ + @Schema(description = "发送配置id") + @JsonProperty("sendConfigId") + private String sendConfigId; + + /** + * 消息来源 + **/ + @Schema(description = "消息来源") + @JsonProperty("messageSource") + private String messageSource; + + /** + * 被引用id + **/ + @Schema(description = "被引用id") + @JsonProperty("usedId") + private String usedId; + + /** + * 创建时间 + **/ + @Schema(description = "创建时间") + @JsonProperty("creatorTime") + private Long creatorTime; + + /** + * 创建人员 + **/ + @Schema(description = "创建人员") + @JsonProperty("creatorUserId") + private String creatorUserId; + + /** + * 修改时间 + **/ + @Schema(description = "修改时间") + @JsonProperty("lastModifyTime") + private Long lastModifyTime; + + /** + * 修改人员 + **/ + @Schema(description = "修改人员") + @JsonProperty("lastModifyUserId") + private String lastModifyUserId; +} \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendconfigrecord/SendConfigRecordListVO.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendconfigrecord/SendConfigRecordListVO.java new file mode 100644 index 0000000..2bfcd4c --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendconfigrecord/SendConfigRecordListVO.java @@ -0,0 +1,72 @@ + + +package jnpf.message.model.sendconfigrecord; + + +import lombok.Data; + +import java.sql.Time; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; + +import java.math.BigDecimal; +import java.util.List; + +/** + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2022-09-21 + */ +@Data +public class SendConfigRecordListVO { + private String id; + + + /** + * 发送配置id + **/ + @JSONField(name = "sendConfigId") + private String sendConfigId; + + /** + * 消息来源 + **/ + @JSONField(name = "messageSource") + private String messageSource; + + /** + * 被引用id + **/ + @JSONField(name = "usedId") + private String usedId; + + /** + * 创建时间 + **/ + @JSONField(name = "creatorTime") + private Long creatorTime; + + /** + * 创建人员 + **/ + @JSONField(name = "creatorUserId") + private String creatorUserId; + + /** + * 修改时间 + **/ + @JSONField(name = "lastModifyTime") + private Long lastModifyTime; + + /** + * 修改人员 + **/ + @JSONField(name = "lastModifyUserId") + private String lastModifyUserId; + + +} \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendconfigrecord/SendConfigRecordPagination.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendconfigrecord/SendConfigRecordPagination.java new file mode 100644 index 0000000..a56daa5 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendconfigrecord/SendConfigRecordPagination.java @@ -0,0 +1,42 @@ +package jnpf.message.model.sendconfigrecord; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import jnpf.base.Pagination; +import java.util.List; + +/** + * + * + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2022-09-21 + */ +@Data +public class SendConfigRecordPagination extends Pagination { + + @Schema(description = "selectKey") + private String selectKey; + + @Schema(description = "json") + private String json; + + @Schema(description = "数据类型") + private String dataType; + + @Schema(description = "特殊查询json") + private String superQueryJson; + + + /** 消息来源 */ + @Schema(description = "消息来源") + private String messageSource; + + /** + * 菜单id + */ + @Schema(description = "菜单id") + private String menuId; +} \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendmessageconfig/MsgTemplateJsonModel.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendmessageconfig/MsgTemplateJsonModel.java new file mode 100644 index 0000000..4dae55e --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendmessageconfig/MsgTemplateJsonModel.java @@ -0,0 +1,22 @@ +package jnpf.message.model.sendmessageconfig; + +import lombok.Data; + +/** + * 解析引擎 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + */ +@Data +public class MsgTemplateJsonModel { + + public String field; + public String fieldName; + public String relationField; + private String id; + private Boolean isSubTable = false; + private String msgTemplateId; + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendmessageconfig/SendConfigListVO.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendmessageconfig/SendConfigListVO.java new file mode 100644 index 0000000..279c1ff --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendmessageconfig/SendConfigListVO.java @@ -0,0 +1,47 @@ + + +package jnpf.message.model.sendmessageconfig; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.sql.Time; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; + +import java.math.BigDecimal; +import java.util.List; + +/** + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2022-08-19 + */ +@Data +public class SendConfigListVO { + @Schema(description = "主键") + private String id; + + /** + * 名称 + **/ + @Schema(description = "名称") + @JSONField(name = "fullName") + private String fullName; + + /** + * 编码 + **/ + @Schema(description = "编码") + @JSONField(name = "enCode") + private String enCode; + + @Schema(description = "模板json") + private Object templateJson; + +} \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendmessageconfig/SendConfigTemplateModel.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendmessageconfig/SendConfigTemplateModel.java new file mode 100644 index 0000000..152dfb9 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendmessageconfig/SendConfigTemplateModel.java @@ -0,0 +1,50 @@ +package jnpf.message.model.sendmessageconfig; + +import lombok.Data; +import java.util.List; +import java.util.Date; +import java.math.BigDecimal; +import java.math.BigInteger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; + +/** + * + * + * 版本: V3.2.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2022-08-19 + */ +@Data +public class SendConfigTemplateModel { + + private String id; + + /** 消息发送配置id **/ + @JsonProperty("sendConfigId") + private String sendConfigId; + + /** 消息类型 **/ + @JsonProperty("messageType") + private String messageType; + + /** 消息模板id **/ + @JsonProperty("templateId") + private String templateId; + + /** 账号配置id **/ + @JsonProperty("accountConfigId") + private String accountConfigId; + + /** 接收人 **/ + private List toUser; + + /** 模板参数 **/ + private Object paramJson; + + /** 消息模板名称 **/ + private String msgTemplateName; + + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendmessageconfig/SendConfigTestResultModel.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendmessageconfig/SendConfigTestResultModel.java new file mode 100644 index 0000000..5a3f228 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendmessageconfig/SendConfigTestResultModel.java @@ -0,0 +1,33 @@ +package jnpf.message.model.sendmessageconfig; + +import lombok.Data; +import java.util.List; +import java.util.Date; +import java.math.BigDecimal; +import java.math.BigInteger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; + +/** + * + * + * 版本: V3.2.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2022-08-19 + */ +@Data +public class SendConfigTestResultModel { + + + /** 消息类型 **/ + private String messageType; + + /** 是否成功 **/ + private String isSuccess; + + /** 失败原因 **/ + private String result; + + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendmessageconfig/SendMessageConfigForm.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendmessageconfig/SendMessageConfigForm.java new file mode 100644 index 0000000..6fa819b --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendmessageconfig/SendMessageConfigForm.java @@ -0,0 +1,66 @@ + + +package jnpf.message.model.sendmessageconfig; + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.message.entity.SendConfigTemplateEntity; +import lombok.Data; +import java.util.List; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; + +/** + * + * + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2022-08-19 + */ +@Data +public class SendMessageConfigForm { + /** 主键 */ + @Schema(description = "主键") + private String id; + /** 名称 **/ + @Schema(description = "名称") + @JsonProperty("fullName") + private String fullName; + + /** 编码 **/ + @Schema(description = "编码") + @JsonProperty("enCode") + private String enCode; + + /** 模板类型 **/ + @Schema(description = "模板类型") + @JsonProperty("templateType") + private String templateType; + + /** 消息来源 **/ + @Schema(description = "消息来源") + @JsonProperty("messageSource") + private String messageSource; + + /** 排序 **/ + @Schema(description = "排序") + @JsonProperty("sortCode") + private Integer sortCode; + + /** 状态 **/ + @Schema(description = "状态") + @JsonProperty("enabledMark") + private String enabledMark; + + /** 说明 **/ + @Schema(description = "说明") + @JsonProperty("description") + private String description; + + /** 子表数据 **/ + @Schema(description = "子表数据") + @JsonProperty("sendConfigTemplateList") + private List sendConfigTemplateList; + +} \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendmessageconfig/SendMessageConfigInfoVO.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendmessageconfig/SendMessageConfigInfoVO.java new file mode 100644 index 0000000..a5ff8df --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendmessageconfig/SendMessageConfigInfoVO.java @@ -0,0 +1,106 @@ + + + +package jnpf.message.model.sendmessageconfig; + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.message.entity.SendConfigTemplateEntity; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.math.BigDecimal; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +/** + * + * + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2022-08-19 + */ +@Data +public class SendMessageConfigInfoVO{ + /** + * 主键 + **/ + @Schema(description = "主键") + @JsonProperty("id") + private String id; + + /** + * 名称 + **/ + @Schema(description = "名称") + @JsonProperty("fullName") + private String fullName; + + /** + * 编码 + **/ + @Schema(description = "编码") + @JsonProperty("enCode") + private String enCode; + + + /** + * 模板类型 + **/ + @Schema(description = "模板类型") + @JsonProperty("templateType") + private String templateType; + + /** + * 消息来源 + **/ + @Schema(description = "消息来源") + @JsonProperty("messageSource") + private String messageSource; + + @Schema(description = "消息源名称") + private String messageSourceName; + + /** + * 排序 + **/ + @Schema(description = "排序") + @JsonProperty("sortCode") + private Integer sortCode; + + /** + * 状态 + **/ + @Schema(description = "状态") + @JsonProperty("enabledMark") + private String enabledMark; + + /** + * 说明 + **/ + @Schema(description = "说明") + @JsonProperty("description") + private String description; + +// /** 创建人员 **/ +// @JsonProperty("creatorUserId") +// private String creatorUserId; +// +// /** 创建时间 **/ +// @JsonProperty("creatorTime") +// private Long creatorTime; +// +// /** 修改人员 **/ +// @JsonProperty("lastModifyUserId") +// private String lastModifyUserId; +// +// /** 修改时间 **/ +// @JsonProperty("lastModifyTime") +// private Date lastModifyTime; + + /** + * 子表数据 + **/ + @Schema(description = "子表数据") + @JsonProperty("sendConfigTemplateList") + private List sendConfigTemplateList; +} \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendmessageconfig/SendMessageConfigListVO.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendmessageconfig/SendMessageConfigListVO.java new file mode 100644 index 0000000..b825896 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendmessageconfig/SendMessageConfigListVO.java @@ -0,0 +1,118 @@ + + +package jnpf.message.model.sendmessageconfig; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.sql.Time; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; + +import java.math.BigDecimal; +import java.util.List; +import java.util.Map; + +/** + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2022-08-19 + */ +@Data +public class SendMessageConfigListVO { + @Schema(description = "主键") + private String id; + + + /** + * 子表数据 + **/ + @Schema(description = "子表数据") + @JsonProperty("tableField110") + @JSONField(name = "tableField110") + private List sendConfigTemplateList; + + /** + * 名称 + **/ + @Schema(description = "名称") + @JSONField(name = "fullName") + private String fullName; + + /** + * 编码 + **/ + @Schema(description = "编码") + @JSONField(name = "enCode") + private String enCode; + + /** + * 消息类型 + **/ + @Schema(description = "消息类型") + private List> messageType; + + /** + * 模板类型 + **/ + @Schema(description = "模板类型") + @JSONField(name = "templateType") + private String templateType; + + /** + * 消息来源 + **/ + @Schema(description = "消息来源") + @JSONField(name = "messageSource") + private String messageSource; + + /** + * 排序 + **/ + @Schema(description = "排序") + @JSONField(name = "sortCode") + private Integer sortCode; + /** + * 状态 + **/ + @Schema(description = "状态") + @JSONField(name = "enabledMark") + private String enabledMark; + + /** + * 创建人员 + **/ + @Schema(description = "创建人员") + @JSONField(name = "creatorUserId") + private String creatorUserId; + + /** + * 创建时间 + **/ + @Schema(description = "创建时间") + @JSONField(name = "creatorTime") + private Long creatorTime; + + /** + * 修改人员 + **/ + @Schema(description = "修改人员") + @JSONField(name = "lastModifyUserId") + private String lastModifyUserId; + + /** + * 修改时间 + **/ + @Schema(description = "修改时间") + @JSONField(name = "lastModifyTime") + private Long lastModifyTime; + + @Schema(description = "创建人") + private String creatorUser; + +} \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendmessageconfig/SendMessageConfigPagination.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendmessageconfig/SendMessageConfigPagination.java new file mode 100644 index 0000000..5d50e46 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/sendmessageconfig/SendMessageConfigPagination.java @@ -0,0 +1,59 @@ +package jnpf.message.model.sendmessageconfig; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import jnpf.base.Pagination; + +import java.util.List; + +/** + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2022-08-19 + */ +@Data +public class SendMessageConfigPagination extends Pagination { + + @Schema(description = "selectKey") + private String selectKey; + + @Schema(description = "json") + private String json; + + @Schema(description = "数据类型") + private String dataType; + + @Schema(description = "特殊查询json") + private String superQueryJson; + + + /** + * 状态 + */ + @Schema(description = "状态") + private String enabledMark; + /** + * 模板类型 + */ + @Schema(description = "模板类型") + private String templateType; + + /** + * 消息来源 + */ + @Schema(description = "消息来源") + private String messageSource; + + /** + * 关键词 + */ + @Schema(description = "关键词") + private String keyword; + /** + * 菜单id + */ + @Schema(description = "菜单id") + private String menuId; +} \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/MessageListVo.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/MessageListVo.java new file mode 100644 index 0000000..6a872d3 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/MessageListVo.java @@ -0,0 +1,34 @@ +package jnpf.message.model.websocket; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 消息列表单个模型 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-07-05 + */ +@Data +public class MessageListVo implements Serializable { + + private String content; + + private String contentType; + + private String id; + + private Long receiveTime; + + private String receiveUserId; + + private Long sendTime; + + private String sendUserId; + + private Integer state; + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/PaginationMessageModel.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/PaginationMessageModel.java new file mode 100644 index 0000000..92f2eb4 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/PaginationMessageModel.java @@ -0,0 +1,31 @@ +package jnpf.message.model.websocket; + +import lombok.Builder; +import lombok.Data; + +import java.io.Serializable; + +/** + * 消息分页参数模型 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-07-05 + */ +@Data +@Builder +public class PaginationMessageModel implements Serializable { + + /** + * 当前页 + */ + private Integer currentPage; + + + private Integer pageSize; + + + private Long total; + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/PaginationMessageVo.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/PaginationMessageVo.java new file mode 100644 index 0000000..d72aa78 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/PaginationMessageVo.java @@ -0,0 +1,36 @@ +package jnpf.message.model.websocket; + +import jnpf.message.entity.ImContentEntity; +import lombok.Builder; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 消息分页返回模型 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-07-05 + */ +@Data +@Builder +public class PaginationMessageVo implements Serializable { + + /** + * 消息列表 + */ + private List list; + + /** + * 分页参数 + */ + private PaginationMessageModel pagination; + + /** + * 方法名 + */ + private String method; +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/SendMessageModel.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/SendMessageModel.java new file mode 100644 index 0000000..d3ce449 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/SendMessageModel.java @@ -0,0 +1,33 @@ +package jnpf.message.model.websocket; + +import jnpf.base.UserInfo; +import jnpf.message.entity.MessageEntity; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; + +/** + * 发送消息到mq模型 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-07-06 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class SendMessageModel implements Serializable { + + private List toUserIds; + + private MessageEntity entity; + + private UserInfo userInfo; + + private Integer messageType; + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/model/MessageModel.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/model/MessageModel.java new file mode 100644 index 0000000..d960b92 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/model/MessageModel.java @@ -0,0 +1,20 @@ +package jnpf.message.model.websocket.model; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 消息模型 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-07-07 + */ +@Data +public class MessageModel implements Serializable { + + protected String method; + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/onclose/OnCloseModel.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/onclose/OnCloseModel.java new file mode 100644 index 0000000..f5d11a7 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/onclose/OnCloseModel.java @@ -0,0 +1,25 @@ +package jnpf.message.model.websocket.onclose; + +import jnpf.message.model.websocket.model.MessageModel; +import lombok.Data; + +import java.io.Serializable; + +/** + * 关闭连接model + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-07-12 + */ +@Data +public class OnCloseModel extends MessageModel implements Serializable { + + private String userId; + + public OnCloseModel(String userId, String method) { + this.userId = userId; + super.method = method; + } +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/onconnettion/OnConnectionModel.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/onconnettion/OnConnectionModel.java new file mode 100644 index 0000000..f0b29e9 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/onconnettion/OnConnectionModel.java @@ -0,0 +1,42 @@ +package jnpf.message.model.websocket.onconnettion; + +import jnpf.message.model.websocket.model.MessageModel; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 刚连接websocket时推送的模型 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-07-07 + */ +@Data +public class OnConnectionModel extends MessageModel implements Serializable { + + private List onlineUsers; + + private List unreadNums; + + private Integer unreadNoticeCount; + + private String noticeDefaultText; + + private Integer unreadMessageCount; + + private Integer unreadScheduleCount; + + private Integer unreadSystemMessageCount; + + private String messageDefaultText; + + private Long messageDefaultTime; + + private Integer unreadTotalCount; + + private String userId; + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/onconnettion/OnLineModel.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/onconnettion/OnLineModel.java new file mode 100644 index 0000000..0b06c58 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/onconnettion/OnLineModel.java @@ -0,0 +1,28 @@ +package jnpf.message.model.websocket.onconnettion; + +import jnpf.message.model.websocket.model.MessageModel; +import lombok.Data; + +import java.io.Serializable; + +/** + * 用户在线推送模型 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-07-10 + */ +@Data +public class OnLineModel extends MessageModel implements Serializable { + + /** + * 在线用户 + */ + private String userId; + + public OnLineModel(String method, String userId) { + super.method = method; + this.userId = userId; + } +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/receivemessage/ReceiveMessageModel.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/receivemessage/ReceiveMessageModel.java new file mode 100644 index 0000000..632596c --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/receivemessage/ReceiveMessageModel.java @@ -0,0 +1,39 @@ +package jnpf.message.model.websocket.receivemessage; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import jnpf.message.model.websocket.model.MessageModel; +import lombok.Data; + +import java.io.Serializable; + +/** + * 接受消息模型 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-07-12 + */ +@Data +public class ReceiveMessageModel extends MessageModel implements Serializable { + + private String formUserId; + + private Long dateTime; + + private String headIcon; + + private Long latestDate; + + private String realName; + + private String account; + + private String messageType; + + private Object formMessage; + + @JsonIgnore + private String userId; + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/receivemessage/ReceiveMessageVO.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/receivemessage/ReceiveMessageVO.java new file mode 100644 index 0000000..afa9fef --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/receivemessage/ReceiveMessageVO.java @@ -0,0 +1,35 @@ +package jnpf.message.model.websocket.receivemessage; + +import jnpf.message.model.websocket.model.MessageModel; +import lombok.Data; + +import java.io.Serializable; + +/** + * 返回接受消息模型 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-07-13 + */ +@Data +public class ReceiveMessageVO extends MessageModel implements Serializable { + + private String formUserId; + + private Long dateTime; + + private String headIcon; + + private Long latestDate; + + private String realName; + + private String account; + + private String messageType; + + private Object formMessage; + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/savafile/ImageMessageModel.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/savafile/ImageMessageModel.java new file mode 100644 index 0000000..b4fd549 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/savafile/ImageMessageModel.java @@ -0,0 +1,28 @@ +package jnpf.message.model.websocket.savafile; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 图片消息模型 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-07-12 + */ +@Data +public class ImageMessageModel extends MessageTypeModel implements Serializable { + + private String width; + + private String height; + + public ImageMessageModel(String width, String height, String path) { + this.width = width; + this.height = height; + super.path = path; + } + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/savafile/MessageTypeModel.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/savafile/MessageTypeModel.java new file mode 100644 index 0000000..b867324 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/savafile/MessageTypeModel.java @@ -0,0 +1,20 @@ +package jnpf.message.model.websocket.savafile; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 图片和语音共有属性 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-07-12 + */ +@Data +public class MessageTypeModel implements Serializable { + + protected String path; + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/savafile/VoiceMessageModel.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/savafile/VoiceMessageModel.java new file mode 100644 index 0000000..0ac2b2d --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/savafile/VoiceMessageModel.java @@ -0,0 +1,25 @@ +package jnpf.message.model.websocket.savafile; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 语音消息模型 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-07-12 + */ +@Data +public class VoiceMessageModel extends MessageTypeModel implements Serializable { + + private String length; + + public VoiceMessageModel(String length, String path) { + this.length = length; + super.path = path; + } + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/savamessage/SavaMessageModel.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/savamessage/SavaMessageModel.java new file mode 100644 index 0000000..199a17f --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/model/websocket/savamessage/SavaMessageModel.java @@ -0,0 +1,45 @@ +package jnpf.message.model.websocket.savamessage; + +import com.alibaba.fastjson.annotation.JSONField; +import jnpf.message.model.websocket.model.MessageModel; +import lombok.Data; + +import java.io.Serializable; + +/** + * 保存消息模型 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-07-12 + */ +@Data +public class SavaMessageModel extends MessageModel implements Serializable { + + @JSONField(name = "UserId") + private String userId; + + private String toUserId; + + private Long dateTime; + + private String headIcon; + + private Long latestDate; + + private String realName; + + private String account; + + private String toAccount; + + private String toRealName; + + private String toHeadIcon; + + private String messageType; + + private Object toMessage; + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/Base64Util.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/Base64Util.java new file mode 100644 index 0000000..6774f41 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/Base64Util.java @@ -0,0 +1,41 @@ +package jnpf.message.util; + +import jnpf.config.ConfigValueUtil; +import jnpf.util.StringUtil; +import jnpf.util.context.SpringContext; +import org.apache.commons.codec.binary.Base64; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/16 8:47 + */ +public class Base64Util { + + private static ConfigValueUtil configValueUtil = SpringContext.getBean(ConfigValueUtil.class); + + + /** + * 把文件转化为base64. + * + * @param filePath 源文件路径 + */ + public static String fileToBase64(String filePath) { + if (!StringUtil.isEmpty(filePath)) { + try { + byte[] bytes = Files.readAllBytes(Paths.get(filePath)); + return Base64.encodeBase64String(bytes); + } catch (IOException e) { + e.printStackTrace(); + } + } + return null; + } + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/ConnectionType.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/ConnectionType.java new file mode 100644 index 0000000..2c3ffb1 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/ConnectionType.java @@ -0,0 +1,23 @@ +package jnpf.message.util; + +/** + * Websocket连接类型 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-07-12 + */ +public class ConnectionType { + + /** + * 建立连接 + */ + public static final String CONNECTION_ONCONNECTION = "OnConnection"; + + /** + * 发型消息 + */ + public static final String CONNECTION_SENDMESSAGE = "SendMessage"; + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/DingTalkUtil.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/DingTalkUtil.java new file mode 100644 index 0000000..29202a0 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/DingTalkUtil.java @@ -0,0 +1,141 @@ +package jnpf.message.util; + +import com.alibaba.fastjson.JSONObject; +import com.dingtalk.api.DefaultDingTalkClient; +import com.dingtalk.api.DingTalkClient; +import com.taobao.api.ApiException; + +import com.dingtalk.api.request.OapiGettokenRequest; +import com.dingtalk.api.request.OapiMessageCorpconversationAsyncsendV2Request; +import com.dingtalk.api.response.OapiGettokenResponse; +import com.dingtalk.api.response.OapiMessageCorpconversationAsyncsendV2Response; +import jnpf.util.RandomUtil; + + +/** + * 通过钉钉用户ID串进行发送消息,传入就是接收人的钉钉用户ID串 + * + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021/4/21 16:10 + */ +public class DingTalkUtil { + + /** + * 钉钉发送消息的接口路径 + */ + public static final String SEND_MESSAGE = "https://oapi.dingtalk.com/topapi/message/corpconversation/asyncsend_v2"; + /** + * 钉钉获取TOKEN的接口路径 + */ + public static final String TOKEN = "https://oapi.dingtalk.com/gettoken"; + + /** + * 获取token + * @param appkey + * @param appsecret + * @return + */ +// public static String getToken (String appkey,String appsecret){ +// DefaultDingTalkClient client = new +// DefaultDingTalkClient(TOKEN); +// OapiGettokenRequest request = new OapiGettokenRequest(); +// request.setAppkey(appkey); +// request.setAppsecret(appsecret); +// request.setHttpMethod("GET"); +// try { +// OapiGettokenResponse response = client.execute(request); +//// LocalCacheClient.set("access_token", response.getAccessToken(),7200*1000); +// return response.getAccessToken(); +// } catch (ApiException e) { +// e.printStackTrace(); +// } +// return null; +// } + + + /** + * 获取token + * @param appkey + * @param appsecret + * @return + */ + public static JSONObject getAccessToken(String appkey, String appsecret){ + JSONObject retMsg = new JSONObject(); + retMsg.put("code",true); + retMsg.put("error",""); + try{ + DingTalkClient client = new DefaultDingTalkClient(TOKEN); + OapiGettokenRequest req = new OapiGettokenRequest(); + req.setAppkey(appkey); + req.setAppsecret(appsecret); + req.setHttpMethod("GET"); + OapiGettokenResponse rsp = client.execute(req); + retMsg.put("access_token", rsp.getAccessToken()); + if (!rsp.isSuccess()) { + retMsg.put("code", false); + retMsg.put("error",rsp.getErrmsg()); + retMsg.put("access_token", ""); + } + } catch (ApiException e) { + retMsg.put("code", false); + retMsg.put("error",e.toString()); + retMsg.put("access_token", ""); + } + + return retMsg; + } + + /** + * 给用户推送消息(文字消息) + * @param appkey + * @param appsecret + * @param agentid + * @param userIds + * @param content + * @return + * 收到消息格式如下: + * 发送的内容 + */ + public static JSONObject sendDingMessage(String appkey, String appsecret, String agentid, String userIds, String content){ + JSONObject retMsg = new JSONObject(); + DingTalkClient client = new DefaultDingTalkClient(SEND_MESSAGE); + + OapiMessageCorpconversationAsyncsendV2Request request = new OapiMessageCorpconversationAsyncsendV2Request(); + request.setUseridList(userIds); + request.setAgentId(Long.parseLong(agentid)); + request.setToAllUser(false); + + OapiMessageCorpconversationAsyncsendV2Request.Msg msg = new OapiMessageCorpconversationAsyncsendV2Request.Msg(); + msg.setMsgtype("text"); + msg.setText(new OapiMessageCorpconversationAsyncsendV2Request.Text()); + String randomCode = "随机验证码:"+ RandomUtil.uuId(); + msg.getText().setContent(content+randomCode); + request.setMsg(msg); + + try { + retMsg = getAccessToken(appkey,appsecret); + if(retMsg.getBoolean("code")){ + // OapiMessageCorpconversationAsyncsendV2Response response = client.execute(request,getToken(appkey,appsecret)); + OapiMessageCorpconversationAsyncsendV2Response response = client.execute(request,retMsg.getString("access_token")); + if(response.getErrcode()>0){ + retMsg.put("code",false); + retMsg.put("error",response.getErrmsg()); + }else{ + retMsg.put("code",true); + retMsg.put("error",""); + } + }else{ + retMsg.put("code",false); + retMsg.put("error","获取token失败:"+retMsg.getString("error")); + } + return retMsg; + } catch (ApiException e) { + retMsg.put("code",false); + retMsg.put("error",e.toString()); + return retMsg; + } + } + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/EmailUtil.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/EmailUtil.java new file mode 100644 index 0000000..5167827 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/EmailUtil.java @@ -0,0 +1,94 @@ +package jnpf.message.util; + +import com.alibaba.fastjson.JSONObject; +import jnpf.message.model.message.EmailModel; + +import javax.mail.MessagingException; +import javax.mail.Session; +import javax.mail.Transport; +import javax.mail.internet.InternetAddress; +import javax.mail.internet.MimeMessage; +import java.io.UnsupportedEncodingException; +import java.util.Properties; + +/** + * 邮件类 + * + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021/4/20 14:52 + */ +public class EmailUtil { + public static boolean isEmail(String email){ + String EMAIL_REGEX = "^[\\w-_\\.+]*[\\w-_\\.]\\@([\\w]+\\.)+[\\w]+[\\w]$"; + Boolean b = email.matches(EMAIL_REGEX); + return b; + } + + public static JSONObject sendMail(EmailModel emailModel) { + JSONObject retMsg = new JSONObject(); + // 邮件发送人 + String from = emailModel.getEmailAccount(); + // 邮件接收人的邮件地址 + String to = emailModel.getEmailToUsers(); + + //定义Properties对象,设置环境信息 + Properties props = System.getProperties(); + + // 设置邮件服务器的地址 + // 指定的smtp服务器 + props.setProperty("mail.smtp.host", emailModel.getEmailSmtpHost()); + props.setProperty("mail.smtp.auth", "true"); + //ssl安全链接 + props.setProperty("mail.smtp.ssl.enable", emailModel.getEmailSsl()); + //设置发送邮件使用的协议 + props.setProperty("mail.transport.protocol", "smtp"); + if("587".equals(emailModel.getEmailSmtpPort())){ + props .put("mail.smtp.starttls.enable", "true"); + } + //创建Session对象,session对象表示整个邮件的环境信息 + Session session = Session.getInstance(props); + //设置输出调试信息 + session.setDebug(true); + try { + // Message的实例对象表示一封电子邮件 + MimeMessage message = new MimeMessage(session); + // 设置发件人的地址 + message.setFrom(new InternetAddress(from,emailModel.getEmailSenderName(),"UTF-8")); + // 设置收件人信息 + InternetAddress[] sendTo = InternetAddress.parse(to); + message.setRecipients(MimeMessage.RecipientType.TO, sendTo); + + // 设置主题 + message.setSubject(emailModel.getEmailTitle()); + // 设置邮件的文本内容 + message.setContent((emailModel.getEmailContent()),"text/html;charset=utf-8"); + + // 设置附件 + //message.setDataHandler(dh); + + // 获取发送邮件的对象 + Transport transport=session.getTransport(); + // 连接邮件服务器 + transport.connect(emailModel.getEmailSmtpHost(),Integer.parseInt(emailModel.getEmailSmtpPort()), emailModel.getEmailAccount(), emailModel.getEmailPassword()); + // 发送消息 + transport.sendMessage(message,sendTo); + + transport.close(); + + retMsg.put("code",true); + retMsg.put("error",""); + return retMsg; + +// return true; + } catch (MessagingException | UnsupportedEncodingException e) { + retMsg.put("code",false); + retMsg.put("error",e.toString()); + return retMsg; +// e.printStackTrace(); +// return false; + } + } +} + diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/JnpfMessageUtil.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/JnpfMessageUtil.java new file mode 100644 index 0000000..eea32bf --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/JnpfMessageUtil.java @@ -0,0 +1,41 @@ +package jnpf.message.util; + +import jnpf.message.entity.MessageEntity; +import jnpf.message.entity.MessageReceiveEntity; +import jnpf.util.RandomUtil; + +import java.util.Date; + +/** + * 消息实体类 + * + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021/4/22 9:06 + */ +public class JnpfMessageUtil { + public static MessageEntity setMessageEntity(String userId,String title,String bodyText,Integer recType) { + MessageEntity entity = new MessageEntity(); + entity.setTitle(title); + entity.setBodyText(bodyText); + entity.setId(RandomUtil.uuId()); +// entity.setType(recType); + entity.setCreatorUserId(userId); + entity.setCreatorTime(new Date()); + entity.setLastModifyTime(entity.getCreatorTime()); + entity.setLastModifyUserId(entity.getCreatorUserId()); + return entity; + } + + public static MessageReceiveEntity setMessageReceiveEntity(String toUserId, String title, Integer sendType){ + MessageReceiveEntity entity = new MessageReceiveEntity(); + entity.setId(RandomUtil.uuId()); + entity.setUserId(toUserId); + entity.setIsRead(0); + entity.setType(sendType); + entity.setFlowType(1); + entity.setTitle(title); + return entity; + } +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/MessageChannelType.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/MessageChannelType.java new file mode 100644 index 0000000..6a86287 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/MessageChannelType.java @@ -0,0 +1,43 @@ +package jnpf.message.util; + +/** + * 接收消息通道类型 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-07-10 + */ +public class MessageChannelType { + + /** + * 工作流 + */ + public static final String CHANNEL_WORKFLOW = "workFlow"; + + /** + * 连接上时推送未读消息 + */ + public static final String CHANNEL_INITMESSAGE = "initMessage"; + + /** + * 发送消息 + */ + public static final String CHANNEL_SENDMESSAGE = "sendMessage"; + + /** + * 在线推送提醒 + */ + public static final String CHANNEL_ONLINE = "Online"; + + /** + * 接受消息 + */ + public static final String CHANNEL_RECEIVEMESSAGE = "receiveMessage"; + + /** + * 关闭连接 + */ + public static final String CHANNEL_OFFLINE = "Offline"; + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/MessageParameterEnum.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/MessageParameterEnum.java new file mode 100644 index 0000000..442d312 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/MessageParameterEnum.java @@ -0,0 +1,37 @@ +package jnpf.message.util; + +/** + * 获取消息参数 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-07-10 + */ +public enum MessageParameterEnum { + + /** + * 接收者ID + */ + PARAMETER_TOUSERID("toUserId"), + PARAMETER_MESSAGETYPE("messageType"), + PARAMETER_MESSAGECONTENT("messageContent"), + PARAMETER_TOKEN("token"), + PARAMETER_METHOD("method"), + PARAMETER_MOBILEDEVICE("mobileDevice"), + ; + + private String value; + + MessageParameterEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/MyBatisPrimaryBase.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/MyBatisPrimaryBase.java new file mode 100644 index 0000000..1f11aa8 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/MyBatisPrimaryBase.java @@ -0,0 +1,88 @@ +package jnpf.model; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.exception.DataException; + +import java.lang.reflect.Field; +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; + +/** + * 联合主键 + * + * 门户管理单条数据,可以由平台、门户ID、系统ID 三种数据定位 + * 它们组合成门户管理的联合主键,此类将其看成一个主键来配合QueryWrapper使用 + * + * @author JNPF开发平台组 YanYu + * @version v3.4.8 + * @copyrignt 引迈信息技术有限公司 + * @date 2023-04-20 + */ +public abstract class MyBatisPrimaryBase { + + { + ParameterizedType parameterizedType = (ParameterizedType) this.getClass().getGenericSuperclass(); + Type[] actualTypeArguments = parameterizedType.getActualTypeArguments(); + Class clz = (Class)actualTypeArguments[0]; + try { + entity = clz.getDeclaredConstructor().newInstance(); + } catch (Exception ignore) {} + } + + @Schema(description = "查询器") + protected QueryWrapper queryWrapper = new QueryWrapper<>(); + + private T entity; + + @Schema(description = "获取处理后的查询器") + public QueryWrapper getQuery(){ + try{ + for (Field field : this.getClass().getDeclaredFields()) { + try{ + TableField annotation = entity.getClass().getDeclaredField(field.getName()).getAnnotation(TableField.class); + String columnName; + if(annotation != null) { + columnName = annotation.value(); + }else if(field.getName().equalsIgnoreCase("id")) { + columnName = "F_Id"; + }else if(field.getName().equalsIgnoreCase("creatorId")){ + columnName = "F_Creator_Id"; + }else { + columnName = field.getName(); + } + field.setAccessible(true); + Object value = field.get(this); + if(value != null) queryWrapper.eq(columnName, value); + }catch (Exception ignore){} + } + }catch (Exception ignore){} + return queryWrapper; + } + + @Schema(description = "获取实例") + public T getEntity() throws Exception { + checkEntity(); + for (Field field : this.getClass().getDeclaredFields()) { + for (Field entityField : entity.getClass().getDeclaredFields()) { + if(entityField.getName().equals(field.getName())){ + entityField.setAccessible(true); + field.setAccessible(true); + entityField.set(entity, field.get(this)); + } + } + } + return entity; + } + + private void checkEntity() throws Exception{ + for (Field field : this.getClass().getFields()) { + Object o = field.get(this); + if(o == null){ + throw new DataException("联合主键类缺少“" + field.getName() + "”字段值"); + } + } + } + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/OnlineUserModel.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/OnlineUserModel.java new file mode 100644 index 0000000..2565d3a --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/OnlineUserModel.java @@ -0,0 +1,45 @@ +package jnpf.message.util; + +import lombok.Data; + +import javax.websocket.Session; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/16 10:51 + */ +@Data +public class OnlineUserModel { + /** + * 连接Id + */ + private String connectionId; + /** + * 用户Id + */ + private String userId; + /** + * 租户Id + */ + private String tenantId; + + public String getTenantId() { + return tenantId = tenantId == null ? "" : tenantId; + } + + /** + * 移动端 + */ + private Boolean isMobileDevice; + /** + * token + */ + private String token; + /** + * session + */ + private Session webSocket; +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/OnlineUserProvider.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/OnlineUserProvider.java new file mode 100644 index 0000000..49a16a2 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/OnlineUserProvider.java @@ -0,0 +1,152 @@ +package jnpf.message.util; + +import cn.dev33.satoken.stp.StpUtil; +import com.alibaba.fastjson.JSONObject; +import jnpf.consts.AuthConsts; +import jnpf.util.UserProvider; +import lombok.extern.slf4j.Slf4j; +import org.springframework.util.ObjectUtils; + +import javax.websocket.Session; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +import static jnpf.consts.AuthConsts.TOKEN_PREFIX; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/16 10:51 + */ +@Slf4j +public class OnlineUserProvider { + + /** + * 在线用户 + */ + private static List onlineUserList = new ArrayList<>(); + + public static List getOnlineUserList() { + return OnlineUserProvider.onlineUserList; + } + + + public static void addModel(OnlineUserModel model){ + OnlineUserProvider.onlineUserList.add(model); + } + + public static void removeModel(OnlineUserModel onlineUserModel){ + onlineUserList.remove(onlineUserModel); + } + + + + // =================== Websocket相关操作 =================== + + /** + * 根据Token精准推送Websocket 登出消息 + * @param token + */ + public static void removeWebSocketByToken(String... token) { + List tokens = Arrays.stream(token).map(t -> t.contains(AuthConsts.TOKEN_PREFIX) ? t : TOKEN_PREFIX + " " + t).collect(Collectors.toList()); + //清除websocket登录状态 + List users = OnlineUserProvider.getOnlineUserList().stream().filter(t -> tokens.contains(t.getToken())).collect(Collectors.toList()); + if (!ObjectUtils.isEmpty(users)) { + for (OnlineUserModel user : users) { + OnlineUserProvider.logoutWS(user, null); + //先移除对象, 并推送下线信息, 避免网络原因导致就用户未断开 新用户连不上WebSocket + OnlineUserProvider.removeModel(user); + //通知所有在线,有用户离线 + for (OnlineUserModel item : OnlineUserProvider.getOnlineUserList().stream().filter(t -> !Objects.equals(user.getUserId(), t.getUserId()) && !Objects.equals(user.getTenantId(),t.getTenantId())).collect(Collectors.toList())) { + if (!item.getUserId().equals(user.getUserId())) { + JSONObject obj = new JSONObject(); + obj.put("method", "Offline"); + //推送给前端 + OnlineUserProvider.sendMessage(item, obj); + + } + } + } + } + } + + /** + * 根据用户ID 推送全部Websocket 登出消息 + * @param userId + */ + public static void removeWebSocketByUser(String userId) { + List tokens = StpUtil.getTokenValueListByLoginId(UserProvider.splicingLoginId(userId)); + removeWebSocketByToken(tokens.toArray(new String[tokens.size()])); + } + + /** + * 发送用户退出消息 + * @param session + */ + public static void logoutWS(OnlineUserModel onlineUserModel, Session session) { + JSONObject obj = new JSONObject(); + obj.put("method", "logout"); + obj.put("token", onlineUserModel.getToken()); + if(onlineUserModel != null) { + sendMessage(onlineUserModel, obj); + }else{ + sendMessage(session, obj); + } + } + + + /** + * 发送关闭WebSocket消息, 前端不在重连 + * @param session + */ + public static void closeFrontWs(OnlineUserModel onlineUserModel, Session session) { + JSONObject obj = new JSONObject(); + obj.put("method", "closeSocket"); + if(onlineUserModel != null) { + sendMessage(onlineUserModel, obj); + }else{ + sendMessage(session, obj); + } + } + + + public static void sendMessage(OnlineUserModel onlineUserModel, Object message){ + Session session = onlineUserModel.getWebSocket(); + synchronized (session) { + + try { + if (session.isOpen()) { + session.getAsyncRemote().sendText(JSONObject.toJSONString(message)); + }else{ + log.debug("WS未打开: {}, {}, {}, {}, {}", onlineUserModel.getTenantId(), session.getId(), onlineUserModel.getUserId(), onlineUserModel.getToken(), message); + try{ + session.close(); + }catch (Exception ee){ + } + finally { + OnlineUserProvider.removeModel(onlineUserModel); + } + } + }catch (Exception e){ + log.debug(String.format("WS消息发送失败: %s, %s, %s, %s, %s", onlineUserModel.getTenantId(), session.getId(), onlineUserModel.getUserId(), onlineUserModel.getToken(), message), e); + } + } + } + + public static void sendMessage(Session session, Object message){ + OnlineUserModel onlineUserModel = OnlineUserProvider.getOnlineUserList().stream().filter(t -> t.getConnectionId().equals(session.getId())).findFirst().orElse(null); + if(onlineUserModel == null){ + onlineUserModel = new OnlineUserModel(); + onlineUserModel.setWebSocket(session); + } + synchronized (session) { + sendMessage(onlineUserModel, message); + } + } + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/QyWebChatUtil.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/QyWebChatUtil.java new file mode 100644 index 0000000..e3557fa --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/QyWebChatUtil.java @@ -0,0 +1,91 @@ +package jnpf.message.util; + +import com.alibaba.fastjson.JSONObject; +import jnpf.util.wxutil.HttpUtil; + +/** + * 企业微信的接口类 + * + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021/4/21 8:20 + */ +public class QyWebChatUtil { + + /** + * 获取企业微信TOKEN的接口路径 + */ + public static final String TOKEN = "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=%s&corpsecret=%s"; + + /** + * 往企业微信发送消息的接口路径 + */ + public static final String SEND_MESSAGE = "https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=%s"; + + + /** + * 获取接口访问凭证 + */ + public static JSONObject getAccessToken(String corpId, String corpSecret) { + JSONObject retMsg = new JSONObject(); + JSONObject rstObj = HttpUtil.httpRequest(String.format(TOKEN,corpId, corpSecret), "GET", null); +// JSONObject rstObj = HttpUtil.httpRequest(QyApi.getTokenUrl(corpId, corpSecret), "GET", null); + return rstObj; + } + + + /** + * 发送消息 20210416 Add By GongXishan + * 不抛出异常,返回Json + */ + public static JSONObject sendMessage(String message, String accessToken){ + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + JSONObject rstObj = HttpUtil.httpRequest(String.format(SEND_MESSAGE, accessToken), "POST", message); +// JSONObject rstObj = HttpUtil.httpRequest(QyApi.sendMessage(accessToken), "POST", message); + if (HttpUtil.isWxError(rstObj)) { + codeFlag = false; + errorMsg = rstObj.toString(); + } + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + return retMsg; + } + + + /** + * 向企业微信发送信息 + * @param corpId + * @param corpSecret + * @param agentId + * @param toUserId + * @param contents + * @return + */ + public static JSONObject sendWxMessage(String corpId, String corpSecret, String agentId, String toUserId, String contents) { + JSONObject retMsg = null; + JSONObject message = null; + JSONObject tokenObject = null; + JSONObject content = null; + + message = new JSONObject(); + message.put("touser", toUserId); + message.put("agentid", agentId); + content = new JSONObject(); + content.put("content", contents); + message.put("text", content); + message.put("msgtype", "text"); + tokenObject = getAccessToken(corpId, corpSecret); + if(tokenObject.getString("access_token")!=null && !"".equals(tokenObject.getString("access_token"))){ + retMsg = sendMessage(message.toJSONString(), tokenObject.getString("access_token")); + }else + { + retMsg.put("code",false); + retMsg.put("error","access_token值为空,不能发送信息!"); + } + return retMsg; + } + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/SendMessageTypeEnum.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/SendMessageTypeEnum.java new file mode 100644 index 0000000..1febee3 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/SendMessageTypeEnum.java @@ -0,0 +1,43 @@ +package jnpf.message.util; + +/** + * 消息类型 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-07-10 + */ +public enum SendMessageTypeEnum { + + /** + * 文本消息 + */ + MESSAGE_TEXT("text"), + /** + * 语音消息 + */ + MESSAGE_VOICE("voice"), + /** + * 图片消息 + */ + MESSAGE_IMAGE("image"); + + SendMessageTypeEnum() { + } + + private String message; + + SendMessageTypeEnum(String message) { + this.message = message; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/SynThirdConsts.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/SynThirdConsts.java new file mode 100644 index 0000000..34db46b --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/SynThirdConsts.java @@ -0,0 +1,72 @@ +package jnpf.message.util; + +/** + * 第三方工具实体类 + * + * @author JNPF + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021/4/27 8:44 + */ +public class SynThirdConsts { + /** + * 第三方工具类型(1:企业微信;2:钉钉) + * 改为 + * 第三方工具类型(1:本地到企业微信;11:企业微信到本地;2:本地到钉钉;22:钉钉到本地) + */ + public static final String THIRD_TYPE_QY = "1"; + + public static final String THIRD_TYPE_QY_To_Sys = "11"; + /** + * 本地到钉钉 + */ + public static final String THIRD_TYPE_DING = "2"; + /** + *钉钉到本地 + */ + public static final String THIRD_TYPE_DING_To_Sys = "22"; + + /** + * 数据类型(1:组织(公司与部门);2:用户) + */ + public static final String DATA_TYPE_ORG = "1"; + public static final String DATA_TYPE_USER = "2"; + + /** + * 对象操作类型(add:创建;upd:修改) + */ + public static final String OBJECT_OP_ADD = "add"; + public static final String OBJECT_OP_UPD = "upd"; + + /** + * 本系统组织对象类型(company:公司;department:部门) + */ + public static final String OBJECT_TYPE_COMPANY = "company"; + public static final String OBJECT_TYPE_DEPARTMENT = "department"; + + /** + * 同步方向类型(1:本系统同步到第三方;2:第三方同步到本系统) + */ + public static final Integer SYN_SYSTEM_TO_THIRD = 1; + public static final Integer SYN_THIRD_TO_SYSTEM = 2; + + /** + * 同步状态值(0:未同步;1:同步成功;2:同步失败) + */ + public static final Integer SYN_STATE_NO = 0; + public static final Integer SYN_STATE_OK = 1; + public static final Integer SYN_STATE_FAIL = 2; + + /** + * 企业微信的部门根节点ID + */ + public static String QY_ROOT_DEPT_ID = "1"; + + + /** + * 钉钉的部门根节点ID + */ + public static Long DING_ROOT_DEPT_ID =1L; + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/SynThirdTotal.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/SynThirdTotal.java new file mode 100644 index 0000000..94f6901 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/SynThirdTotal.java @@ -0,0 +1,49 @@ +package jnpf.message.util; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +/** + * 同步统计信息模型 + * + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021/5/10 11:21 + */ +@Data +public class SynThirdTotal { + /** + * 同步类型 + */ + @Schema(description = "同步类型") + private String synType; + /** + * 记录总数 + */ + @Schema(description = "记录总数") + private Integer recordTotal; + /** + * 同步成功记录数 + */ + @Schema(description = "同步成功记录数") + private Long synSuccessCount; + /** + * 同步失败记录数 + */ + @Schema(description = "同步失败记录数") + private Long synFailCount; + /** + * 未同步记录数 + */ + @Schema(description = "未同步记录数") + private Long unSynCount; + /** + * 最后同步时间 + */ + @Schema(description = "最后同步时间") + private Date synDate; + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/WebHookUtil.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/WebHookUtil.java new file mode 100644 index 0000000..f299754 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/WebHookUtil.java @@ -0,0 +1,411 @@ +package jnpf.message.util; + +import cn.hutool.http.HttpUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import jnpf.util.DateUtil; +import jnpf.util.StringUtil; +import okhttp3.*; +import org.apache.http.HttpResponse; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.util.EntityUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.net.URL; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; +import java.util.*; + +public class WebHookUtil { + /** + * post请求以及参数是json + * + * @param url + * @param jsonParams + * @return + */ + public static JSONObject doPostForJson(String url, String jsonParams) { + CloseableHttpClient httpClient = HttpClients.createDefault(); + JSONObject jsonObject = null; + HttpPost httpPost = new HttpPost(url); + RequestConfig requestConfig = RequestConfig.custom(). + setConnectTimeout(180 * 1000).setConnectionRequestTimeout(180 * 1000) + .setSocketTimeout(180 * 1000).setRedirectsEnabled(true).build(); + httpPost.setConfig(requestConfig); + httpPost.setHeader("Content-Type", "application/json"); + try { + httpPost.setEntity(new StringEntity(jsonParams, ContentType.create("application/json", "utf-8"))); + System.out.println("request parameters" + EntityUtils.toString(httpPost.getEntity())); + System.out.println("httpPost:" + httpPost); + HttpResponse response = httpClient.execute(httpPost); + if (response != null && response.getStatusLine().getStatusCode() == 200) { + String result = EntityUtils.toString(response.getEntity()); + System.out.println("result:" + result); + jsonObject = JSONObject.parseObject(result); + return jsonObject; + } + } catch (Exception e) { + e.printStackTrace(); + } finally { + if (null != httpClient) { + try { + httpClient.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + return jsonObject; + } + } + + /** + * 基础验证 + * @param url webhook地址 + * @param msgList 消息内容 + */ + public static void sendMsgBasic(String url,List msgList, String userName,String password) { + //飞书机器人url 通过webhook将自定义服务的消息推送至飞书 + String content = userName + ":" + password; + String token = "Basic " + Base64.getEncoder().encodeToString(content.getBytes(StandardCharsets.UTF_8)); + Map params = new LinkedHashMap<>(); + params.put("msg_type", "text"); + Map contentMap = new HashMap<>(); + params.put("content", contentMap); + + StringBuilder stringBuilder = new StringBuilder(); + msgList.forEach(e -> { + stringBuilder.append(e + "\n"); + }); + + contentMap.put("text", stringBuilder.toString()); + + doPostForJsonObject(url, JSON.toJSONString(params),token); + } + + + /** + * post请求以及参数是json + * + * @param url + * @param jsonParams + * @return + */ + public static JSONObject doPostForJsonObject(String url, String jsonParams,String token) { + CloseableHttpClient httpClient = HttpClients.createDefault(); + JSONObject jsonObject = null; + HttpPost httpPost = new HttpPost(url); + RequestConfig requestConfig = RequestConfig.custom(). + setConnectTimeout(180 * 1000).setConnectionRequestTimeout(180 * 1000) + .setSocketTimeout(180 * 1000).setRedirectsEnabled(true).build(); + httpPost.setConfig(requestConfig); + httpPost.setHeader("Content-Type", "application/json"); + httpPost.setHeader("Authorization", token); + try { + httpPost.setEntity(new StringEntity(jsonParams, ContentType.create("application/json", "utf-8"))); + System.out.println("request parameters" + EntityUtils.toString(httpPost.getEntity())); + System.out.println("httpPost:" + httpPost); + HttpResponse response = httpClient.execute(httpPost); + if (response != null && response.getStatusLine().getStatusCode() == 200) { + String result = EntityUtils.toString(response.getEntity()); + System.out.println("result:" + result); + jsonObject = JSONObject.parseObject(result); + return jsonObject; + } + } catch (Exception e) { + e.printStackTrace(); + } finally { + if (null != httpClient) { + try { + httpClient.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + return jsonObject; + } + } + + /** + * 把timestamp+"\n"+密钥当做签名字符串并计算签名 + * @param secret bearer令牌 + * @param timestamp 当前时间的时间戳格式 + * @return + * @throws NoSuchAlgorithmException + * @throws InvalidKeyException + */ + private static String GenSign(String secret, Long timestamp) throws NoSuchAlgorithmException, InvalidKeyException { + //把timestamp+"\n"+密钥当做签名字符串 + String stringToSign = timestamp + "\n" + secret; + + //使用HmacSHA256算法计算签名 + Mac mac = Mac.getInstance("HmacSHA256"); + mac.init(new SecretKeySpec(secret.getBytes(StandardCharsets.UTF_8), "HmacSHA256")); + byte[] signData = mac.doFinal(stringToSign.getBytes(StandardCharsets.UTF_8)); + return new String(Base64.getEncoder().encode(signData)); + } + + /** + * 对接飞书机器人发送消息(webhook),bearer令牌类型 + * @param url 飞书机器人webhook的值 + * @param msgList 消息内容 + * @param Secret bearer令牌 + * @throws NoSuchAlgorithmException + * @throws InvalidKeyException + */ + public static void sendMsg(String url, List msgList, String Secret) throws NoSuchAlgorithmException, InvalidKeyException { + //飞书机器人url 通过webhook和密钥将自定义服务的消息推送至飞书 + Map params = new LinkedHashMap<>(); + Long timestamp = DateUtil.getTime(DateUtil.getNowDate()); + String sign = GenSign(Secret,timestamp); + params.put("msg_type", "text"); + params.put("timestamp",timestamp); + params.put("sign",sign); + Map contentMap = new HashMap<>(); + params.put("content", contentMap); + + StringBuilder stringBuilder = new StringBuilder(); + msgList.forEach(e -> { + stringBuilder.append(e + "\n"); + }); + + contentMap.put("text", stringBuilder.toString()); + + + doPostForJson(url, JSON.toJSONString(params)); + } + + /** + * 对接飞书机器人发送消息(webhook),无bearer令牌 + * @param url 飞书机器人webhook的值 + * @param msgList 消息内容 + */ + public static void sendMsgNoSecret(String url,List msgList) { + //飞书机器人url 通过webhook将自定义服务的消息推送至飞书 + Map params = new LinkedHashMap<>(); + params.put("msg_type", "text"); + Map contentMap = new HashMap<>(); + params.put("content", contentMap); + + StringBuilder stringBuilder = new StringBuilder(); + msgList.forEach(e -> { + stringBuilder.append(e + "\n"); + }); + + contentMap.put("text", stringBuilder.toString()); + + doPostForJson(url, JSON.toJSONString(params)); + } + + + private static Logger logger = LoggerFactory.getLogger(WebHookUtil.class); + + /** + * 发送POST请求,参数是Map, contentType=x-www-form-urlencoded + * + * @param url + * @param mapParam + * @return + */ + public static String sendPostByMap(String url, Map mapParam) { + Map headParam = new HashMap(); + headParam.put("Content-type", "application/json;charset=UTF-8"); + return sendPost(url, mapParam, headParam); + } + + /** + * 向指定 URL 发送POST方法的请求 + * + * @param url 发送请求的 URL + * @param param 请求参数, + * @return 所代表远程资源的响应结果 + */ + public static String sendPost(String url, Map param, Map headParam) { + PrintWriter out = null; + BufferedReader in = null; + String result = ""; + try { + URL realUrl = new URL(url); + // 打开和URL之间的连接 + URLConnection conn = realUrl.openConnection(); + // 设置通用的请求属性 请求头 + conn.setRequestProperty("accept", "*/*"); + conn.setRequestProperty("connection", "Keep-Alive"); + conn.setRequestProperty("user-agent", + "Fiddler"); + + if (headParam != null) { + for (Map.Entry entry : headParam.entrySet()) { + conn.setRequestProperty(entry.getKey(), entry.getValue()); + } + } + // 发送POST请求必须设置如下两行 + conn.setDoOutput(true); + conn.setDoInput(true); + // 获取URLConnection对象对应的输出流 + out = new PrintWriter(conn.getOutputStream()); + // 发送请求参数 + out.print(JSON.toJSONString(param)); + // flush输出流的缓冲 + out.flush(); + // 定义BufferedReader输入流来读取URL的响应 + in = new BufferedReader( + new InputStreamReader(conn.getInputStream())); + String line; + while ((line = in.readLine()) != null) { + result += line; + } + } catch (Exception e) { + logger.info("发送 POST 请求出现异常!" + e); + e.printStackTrace(); + } + //使用finally块来关闭输出流、输入流 + finally { + try { + if (out != null) { + out.close(); + } + if (in != null) { + in.close(); + } + } catch (IOException ex) { + ex.printStackTrace(); + } + } + return result; + } + + + + + /** + * 发送文字消息 + * + * @param msg 需要发送的消息 + * @return + * @throws Exception + */ + public static String sendTextMsg(String msg){ + JSONObject text = new JSONObject(); + text.put("content", msg); + JSONObject reqBody = new JSONObject(); + reqBody.put("msgtype", "text"); + reqBody.put("text", text); + reqBody.put("safe", 0); + + return reqBody.toString(); + } + + + /** + * 对接企业微信机器人发送消息(webhook) + * @content:要发送的消息 + * WECHAT_GROUP:机器人的webhook + */ + public static JSONObject callWeChatBot(String url,String content){ + OkHttpClient client = new OkHttpClient() + .newBuilder() + .build(); + MediaType mediaType = MediaType.parse("application/json"); + content = sendTextMsg(content); + RequestBody body = RequestBody.create(content,mediaType); + Request request = new Request.Builder() + .url(url) + .method("POST", body) + .addHeader("Content-Type", "application/json") + .build(); + Response response = null; + String result = ""; + try { + response = client.newCall(request).execute(); + BufferedReader in = new BufferedReader( + new InputStreamReader(response.body().byteStream())); + String line; + while ((line = in.readLine()) != null) { + result += line; + } + } catch (IOException e) { + e.printStackTrace(); + } + + return JSONObject.parseObject(result); + } + + + /** + * 对接钉钉机器人发送消息(webhook) + * @param url 钉钉上获取到的webhook的值 + * @param msg 发送的消息内容 + */ + public static JSONObject sendDDMessage(String url,String msg) { + //钉钉的webhook + //请求的JSON数据,这里用map在工具类里转成json格式 + Map json = new HashMap(); + Map text = new HashMap(); + json.put("msgtype", "text"); + text.put("content", msg); + json.put("text", text); + //发送post请求 + String response = WebHookUtil.sendPostByMap(url, json); + return JSONObject.parseObject(response); + } + + /** + * 通过加签方式调用钉钉机器人发送消息给所有人 + */ + public static JSONObject sendDingDing(String url,String Secret,String content) { + + try { + //钉钉机器人地址(配置机器人的webhook) + Long timestamp = System.currentTimeMillis(); + String sign = GenSign(Secret,timestamp); + String stringToSign = timestamp + "\n" + Secret; + String dingUrl = url + "×tamp=" + timestamp + "&sign=" + URLEncoder.encode(sign, "UTF-8"); + + //是否通知所有人 + boolean isAtAll = true; + //通知具体人的手机号码列表 +// List mobileList = Lists.newArrayList(); + //mobileList.add("+86-159*******"); + + + //消息内容 + Map contentMap = Maps.newHashMap(); + contentMap.put("content", content); + //通知人 + Map atMap = Maps.newHashMap(); + //1.是否通知所有人 + atMap.put("isAtAll", isAtAll); + //2.通知具体人的手机号码列表 +// atMap.put("atMobiles", mobileList); + + Map reqMap = Maps.newHashMap(); + reqMap.put("msgtype", "text"); + reqMap.put("text", contentMap); + reqMap.put("at", atMap); + //推送消息(http请求) + String result = sendPostByMap(dingUrl, reqMap); + return JSONObject.parseObject(result); + }catch (Exception e){ + e.printStackTrace(); + } + return null; + } + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/unipush/UinPush.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/unipush/UinPush.java new file mode 100644 index 0000000..71d76f4 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/unipush/UinPush.java @@ -0,0 +1,26 @@ +package jnpf.message.util.unipush; + +import jnpf.config.ConfigValueUtil; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.List; + + +@Component +@Slf4j +public class UinPush { + @Autowired + private ConfigValueUtil configValueUtil; + + public void sendUniPush(List cidList, String title, String content, String type, String text){ + if(cidList !=null && cidList.size()>0 ) { + String cid = StringUtils.join(cidList,","); + String url = configValueUtil.getAppPushUrl() + "?clientId=" + cid + "&title=" + title + "&content=" + content + "&text=" + text + "&create=true"; + cn.hutool.http.HttpUtil.get(url); + } + } + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/weixingzh/WXGZHWebChatUtil.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/weixingzh/WXGZHWebChatUtil.java new file mode 100644 index 0000000..edce7b1 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/weixingzh/WXGZHWebChatUtil.java @@ -0,0 +1,371 @@ +package jnpf.message.util.weixingzh; + +import com.alibaba.fastjson.JSONObject; +import jnpf.util.JsonUtil; +import jnpf.util.wxutil.HttpUtil; +import lombok.extern.slf4j.Slf4j; +import org.dom4j.Document; +import org.dom4j.DocumentException; +import org.dom4j.DocumentHelper; +import org.dom4j.Element; +import org.dom4j.io.SAXReader; + +import javax.servlet.http.HttpServletRequest; +import java.io.InputStream; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.*; + +/** + * 微信的接口类 + */ +@Slf4j +public class WXGZHWebChatUtil { + + /** + * api + */ + public static final String API_DEFAULT_HOST_URL = "https://api.weixin.qq.com"; + + /** + * mq + */ + public static final String MP_DEFAULT_HOST_URL = "https://mp.weixin.qq.com"; + + /** + * open + */ + public static final String OPEN_DEFAULT_HOST_URL = "https://open.weixin.qq.com"; + + + + /** + * 获取接口访问凭证 + * + * @param appID + * @param appsecret + * @return 数据格式 + *{ + * "access_token": "token", + * "expires_in": 7200 + * } + */ + public static String getAccessToken(String appID, String appsecret) { + String requestUrl = API_DEFAULT_HOST_URL+"/cgi-bin/token?grant_type=client_credential&appid="+appID+"&secret="+appsecret; + JSONObject rstObj = HttpUtil.httpRequest(requestUrl, "GET", null); + JSONObject rst = new JSONObject(); + String token = null; + if(rstObj.containsKey("access_token")){ + token = rstObj.getString("access_token"); + } + return token; + } + + /** + * 获取用户列表 + * + * @param accessToken token + * @param nextOpenId 第一个拉取的OPENID,不填默认从头开始拉取,一次只能拉取100个用户,最后一个用户openId需要放进来拉取接下来的数据 + * @return 数据格式 + * { + * "total": 2, + * "count": 2, + * "data": { + * "openid": [ + * "oD09N5rLh6juzOPA55C3YTo-hYJk", + * "oD09N5jXQ47rNed4oyAlqQz9X348" + * ] + * }, + * "next_openid": "oD09N5jXQ47rNed4oyAlqQz9X348" + * } + */ + public static JSONObject getUsetList(String accessToken, String nextOpenId) { + String requestUrl = API_DEFAULT_HOST_URL+"/cgi-bin/user/get?access_token="+accessToken+"&next_openid="+nextOpenId; + JSONObject rstObj = HttpUtil.httpRequest(requestUrl, "GET", null); + return rstObj; + } + + /** + * 获取用户信息 + * + * @param accessToken token + * @param openid openid + * @return 数据格式 + * { + * "subscribe": 1, + * "openid": "o6FJX1tay8i-431nidzispv2xrhs", + * "nickname": "", + * "sex": 0, + * "language": "zh_CN", + * "city": "", + * "province": "", + * "country": "", + * "headimgurl": "", + * "subscribe_time": 1648562407, + * "unionid": "oear46TQmAj0UZmM3jMYVYU1rS8o", + * "remark": "", + * "groupid": 0, + * "tagid_list": [ ], + * "subscribe_scene": "ADD_SCENE_QR_CODE", + * "qr_scene": 0, + * "qr_scene_str": "" + * } + */ + public static JSONObject getUsetInfo(String accessToken, String openid) { + String requestUrl = API_DEFAULT_HOST_URL+"/cgi-bin/user/info?access_token="+accessToken+"&openid="+openid; + JSONObject rstObj = HttpUtil.httpRequest(requestUrl, "GET", null); + return rstObj; + } + + /** + * 返回消息模板列表 + * @param accessToken + * @return + */ + public static JSONObject getMessageList(String accessToken) { + String requestUrl = API_DEFAULT_HOST_URL+"/cgi-bin/template/get_all_private_template?access_token="+accessToken; + JSONObject rstObj = HttpUtil.httpRequest(requestUrl, "GET", null); + return rstObj; + } + + /** + * 发送消息 + * + * @param accessToken + * @return + */ + public static JSONObject sendMessage(String accessToken,String message){ + + String messageUrl = API_DEFAULT_HOST_URL+"/cgi-bin/message/template/send?access_token="+accessToken; + + JSONObject rst = new JSONObject(); + log.info("传递微信公众号参数"+message.toString()); + + JSONObject rstMessageObj = HttpUtil.httpRequest(messageUrl, "POST", message.toString()); + log.info("接收微信公众号参数"+rstMessageObj.toString()); + + boolean codeFlag = true; + if (Integer.parseInt(rstMessageObj.get("errcode").toString())!=0) { + codeFlag = false; + } + rst.put("code",codeFlag); + rst.put("error",rstMessageObj.get("errmsg").toString()); + return rst; + } + + /** + * 发送消息--关注发送消息模板 + * + * @param accessToken + * @return + */ + public static JSONObject sendMessageByGZ(String accessToken, String touser){ + + String messageUrl = API_DEFAULT_HOST_URL+"/cgi-bin/message/template/send?access_token="+accessToken; + + JSONObject message = new JSONObject(); + JSONObject content = new JSONObject(); + JSONObject first = new JSONObject(); + JSONObject title = new JSONObject(); + JSONObject user = new JSONObject(); + JSONObject date = new JSONObject(); + JSONObject remark = new JSONObject(); + JSONObject rst = new JSONObject(); + + message.put("touser", touser); + message.put("template_id", "qfrvB432USum5H2E1fipzpR8nhGgcS8Ullw-ImTScUQ"); + Random r = new Random(); + message.put("client_msg_id", "MSG_"+r.nextInt(99999999)); + + first.put("value","https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx184aaa643b114a92&redirect_uri=http%3A%2F%2Facg53k.natappfree.cc&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"); + first.put("color","#173177"); + + content.put("first",first); + + message.put("data", content); + System.out.println(message.toString()); + + JSONObject rstMessageObj = HttpUtil.httpRequest(messageUrl, "POST", message.toString()); + System.out.println(rstMessageObj); + + boolean codeFlag = true; + String errorMsg = ""; + if (Integer.parseInt(rstMessageObj.get("errcode").toString())!=0) { + codeFlag = false; + } + rst.put("code",codeFlag); + rst.put("error",rstMessageObj.get("errmsg").toString()); + System.out.println("a"); + return rst; + } + + /** + * 获取接口访问凭证 + * + * @return 数据格式 + *{ + * "access_token": "token", + * "expires_in": 7200 + * } + */ + public static String getQRCodeTiket(String accessToken,String userId) { + String requestUrl = API_DEFAULT_HOST_URL+"/cgi-bin/qrcode/create?access_token="+accessToken; + String a = "{\"action_name\": \"QR_LIMIT_SCENE\", \"action_info\": {\"scene\": {\"scene_id\": "+userId+"}}}"; + JSONObject rstObj = HttpUtil.httpRequest(requestUrl, "GET", null); + JSONObject rst = new JSONObject(); + String token = null; + if(rstObj.containsKey("access_token")){ + token = rstObj.getString("access_token"); + } + return token; + } + + /** + * 参数排序 + * @param token + * @param timestamp + * @param nonce + * @return + */ + public static String sort(String token, String timestamp, String nonce) { + String[ ] strArray = {token,timestamp,nonce}; + Arrays.sort( strArray ) ; + StringBuilder sb = new StringBuilder( );for (String str : strArray) { + sb.append(str); + } + return sb.toString(); + } + + /** + * 字符串进行shal加密 + * @param str + * @return + */ + public static String shal(String str) { + try { + MessageDigest digest = MessageDigest.getInstance("SHA-1"); + digest.update(str.getBytes()); + byte messageDigest[] = digest.digest(); + + StringBuffer hexString = new StringBuffer();//字节数组转换为十六进制数 + for (int i = 0; i < messageDigest.length; i++) { + String shaHex = Integer.toHexString(messageDigest[i] & 0xFF); + if (shaHex.length() < 2) { + hexString.append(0); + } + hexString.append(shaHex); + } + return hexString.toString(); + } catch (NoSuchAlgorithmException e) { + e.printStackTrace(); + } + return ""; + } + + /** + * @description 将xml字符串转换成map + * @param xml + * @return Map + */ + public static Map xmlToMap(String xml) { + Map map = new HashMap(); + Document doc = null; + try { + doc = DocumentHelper.parseText(xml); // 将字符串转为XML + Element rootElt = doc.getRootElement(); // 获取根节点 + @SuppressWarnings("unchecked") + List list = rootElt.elements();// 获取根节点下所有节点 + for (Element element : list) { // 遍历节点 + map.put(element.getName(), element.getText()); // 节点的name为map的key,text为map的value + } + } catch (DocumentException e) { + e.printStackTrace(); + } catch (Exception e) { + e.printStackTrace(); + } + return map; + } + + /** + * dom4j解析 xmL转换为map + * @param request + * @return + * @throws Exception + */ + public static Map parseXml(HttpServletRequest request) throws Exception { + //将解析结果存储在HashMap中 + Map map = new HashMap(); + //从request中取得输入流 + InputStream inputstream = request.getInputStream(); + //读取输入流 + SAXReader reader = new SAXReader(); + org.dom4j.Document document = reader.read(inputstream); + //得到kmL根元素 + org.dom4j.Element root = document.getRootElement(); + //得到根元素的所有子节点 + List elementList = root.elements(); + //遍历所有子节点 + for(org.dom4j.Element e : elementList){ + map. put(e.getName(),e.getText()); + } + //释放资源 + inputstream.close();inputstream = null;return map; + } + + /** + * 生成xml消息 + * @param encrypt 加密后的消息密文 + * @param signature 安全签名 + * @param timestamp 时间戳 + * @param nonce 随机字符串 + * @return 生成的xml字符串 + */ + public static String generate(String encrypt, String signature, String timestamp, String nonce) { + + String format = "\n" + "\n" + + "\n" + + "%3$s\n" + "\n" + ""; + return String.format(format, encrypt, signature, timestamp, nonce); + + } + + /** + * 消息json组装 + */ + public static String messageJson(String templateId,String openId,String xcxAppId,String pagepath,Map parameterMap,String title,String type,String link){ + + String color = "#173177"; + TreeMap> params = new TreeMap<>(); + WxTemplateMsg wxTemplateMsg = new WxTemplateMsg(); + for (String key:parameterMap.keySet()){ + String field = key; + String fieldValue = String.valueOf(parameterMap.get(key)); + field = field.replace("{{",""); + field = field.replace(".DATA}}",""); + //根据具体模板参数组装 + if("first".equals(field)){ + params.put(field, WxTemplateMsg.item(fieldValue, color)); + }else{ + params.put(field, WxTemplateMsg.item(fieldValue, color)); + } + } + + // 模版ID + wxTemplateMsg.setTemplate_id(templateId); + // openId + wxTemplateMsg.setTouser(openId); + // 关键字赋值 + wxTemplateMsg.setData(params); + if(!"1".equals(type)) { + wxTemplateMsg.setUrl(link); + }else { + // 跳转小程序 + wxTemplateMsg.setMiniprogram(WxTemplateMsg.miniprogramData(xcxAppId, pagepath)); + wxTemplateMsg.setUrl(""); + } + String data = JsonUtil.getObjectToString(wxTemplateMsg); + log.info("微信公众号消息参数封装"+data); + return data; + } + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/weixingzh/WxTemplateMsg.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/weixingzh/WxTemplateMsg.java new file mode 100644 index 0000000..c2c93eb --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/weixingzh/WxTemplateMsg.java @@ -0,0 +1,64 @@ +package jnpf.message.util.weixingzh; + +import com.alibaba.fastjson.JSONObject; +import lombok.Data; + +import java.util.TreeMap; + +@Data +public class WxTemplateMsg { + + /** + * 接收者openId + */ + private String touser; + /** + * 模板ID + */ + private String template_id; + + /** + * 防重入id。对于同一个openid + client_msg_id, 只发送一条消息,10分钟有效,超过10分钟不保证效果。若无防重入需求,可不填 + */ +// private String client_msg_id; + /** + * 模板跳转链接 + */ + private String url; + + /** + * 跳转app + */ + private JSONObject miniprogram; + + // "miniprogram":{ 未加入 + // "appid":"xiaochengxuappid12345", + // "pagepath":"index?foo=bar" + // }, + + /** + * data数据 + */ + private TreeMap> data; + + /** + * 参数 + * + * @param value 值 + * @param color 颜色 可不填 + * @return params + */ + public static TreeMap item(String value, String color) { + TreeMap params = new TreeMap(); + params.put("value", value); + params.put("color", color); + return params; + } + + public static JSONObject miniprogramData(String appid,String pagepath){ + JSONObject jsonObject = new JSONObject(); + jsonObject.put("appid",appid); + jsonObject.put("pagepath",pagepath); + return jsonObject; + } +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/weixingzh/aes/AesException.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/weixingzh/aes/AesException.java new file mode 100644 index 0000000..6e591b6 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/weixingzh/aes/AesException.java @@ -0,0 +1,59 @@ +package jnpf.message.util.weixingzh.aes; + +@SuppressWarnings("serial") +public class AesException extends Exception { + + public final static int OK = 0; + public final static int ValidateSignatureError = -40001; + public final static int ParseXmlError = -40002; + public final static int ComputeSignatureError = -40003; + public final static int IllegalAesKey = -40004; + public final static int ValidateAppidError = -40005; + public final static int EncryptAESError = -40006; + public final static int DecryptAESError = -40007; + public final static int IllegalBuffer = -40008; + //public final static int EncodeBase64Error = -40009; + //public final static int DecodeBase64Error = -40010; + //public final static int GenReturnXmlError = -40011; + + private int code; + + private static String getMessage(int code) { + switch (code) { + case ValidateSignatureError: + return "签名验证错误"; + case ParseXmlError: + return "xml解析失败"; + case ComputeSignatureError: + return "sha加密生成签名失败"; + case IllegalAesKey: + return "SymmetricKey非法"; + case ValidateAppidError: + return "appid校验失败"; + case EncryptAESError: + return "aes加密失败"; + case DecryptAESError: + return "aes解密失败"; + case IllegalBuffer: + return "解密后得到的buffer非法"; +// case EncodeBase64Error: +// return "base64加密错误"; +// case DecodeBase64Error: +// return "base64解密错误"; +// case GenReturnXmlError: +// return "xml生成失败"; + default: + return null; // cannot be + } + } + + public int getCode() { + return code; + } + + AesException(int code) { + super(getMessage(code)); + this.code = code; + } + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/weixingzh/aes/ByteGroup.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/weixingzh/aes/ByteGroup.java new file mode 100644 index 0000000..b9bb17f --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/weixingzh/aes/ByteGroup.java @@ -0,0 +1,26 @@ +package jnpf.message.util.weixingzh.aes; + +import java.util.ArrayList; + +class ByteGroup { + ArrayList byteContainer = new ArrayList(); + + public byte[] toBytes() { + byte[] bytes = new byte[byteContainer.size()]; + for (int i = 0; i < byteContainer.size(); i++) { + bytes[i] = byteContainer.get(i); + } + return bytes; + } + + public ByteGroup addBytes(byte[] bytes) { + for (byte b : bytes) { + byteContainer.add(b); + } + return this; + } + + public int size() { + return byteContainer.size(); + } +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/weixingzh/aes/PKCS7Encoder.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/weixingzh/aes/PKCS7Encoder.java new file mode 100644 index 0000000..ee276d7 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/weixingzh/aes/PKCS7Encoder.java @@ -0,0 +1,67 @@ +/** + * 对公众平台发送给公众账号的消息加解密示例代码. + * + * @copyright Copyright (c) 1998-2014 Tencent Inc. + */ + +// ------------------------------------------------------------------------ + +package jnpf.message.util.weixingzh.aes; + +import java.nio.charset.Charset; +import java.util.Arrays; + +/** + * 提供基于PKCS7算法的加解密接口. + */ +class PKCS7Encoder { + static Charset CHARSET = Charset.forName("utf-8"); + static int BLOCK_SIZE = 32; + + /** + * 获得对明文进行补位填充的字节. + * + * @param count 需要进行填充补位操作的明文字节个数 + * @return 补齐用的字节数组 + */ + static byte[] encode(int count) { + // 计算需要填充的位数 + int amountToPad = BLOCK_SIZE - (count % BLOCK_SIZE); + if (amountToPad == 0) { + amountToPad = BLOCK_SIZE; + } + // 获得补位所用的字符 + char padChr = chr(amountToPad); + String tmp = new String(); + for (int index = 0; index < amountToPad; index++) { + tmp += padChr; + } + return tmp.getBytes(CHARSET); + } + + /** + * 删除解密后明文的补位字符 + * + * @param decrypted 解密后的明文 + * @return 删除补位字符后的明文 + */ + static byte[] decode(byte[] decrypted) { + int pad = (int) decrypted[decrypted.length - 1]; + if (pad < 1 || pad > 32) { + pad = 0; + } + return Arrays.copyOfRange(decrypted, 0, decrypted.length - pad); + } + + /** + * 将数字转化成ASCII码对应的字符,用于对明文进行补码 + * + * @param a 需要转化的数字 + * @return 转化得到的字符 + */ + static char chr(int a) { + byte target = (byte) (a & 0xFF); + return (char) target; + } + +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/weixingzh/aes/SHA1.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/weixingzh/aes/SHA1.java new file mode 100644 index 0000000..2a5206d --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/weixingzh/aes/SHA1.java @@ -0,0 +1,60 @@ +/** + * 对公众平台发送给公众账号的消息加解密示例代码. + * + * @copyright Copyright (c) 1998-2014 Tencent Inc. + */ + +// ------------------------------------------------------------------------ + +package jnpf.message.util.weixingzh.aes; + +import java.security.MessageDigest; +import java.util.Arrays; + +/** + * SHA1 class + * + * 计算公众平台的消息签名接口. + */ +class SHA1 { + + /** + * 用SHA1算法生成安全签名 + * @param token 票据 + * @param timestamp 时间戳 + * @param nonce 随机字符串 + * @param encrypt 密文 + * @return 安全签名 + * @throws AesException + */ + public static String getSHA1(String token, String timestamp, String nonce, String encrypt) throws AesException { + try { + String[] array = new String[] { token, timestamp, nonce, encrypt }; + StringBuffer sb = new StringBuffer(); + // 字符串排序 + Arrays.sort(array); + for (int i = 0; i < 4; i++) { + sb.append(array[i]); + } + String str = sb.toString(); + // SHA1签名生成 + MessageDigest md = MessageDigest.getInstance("SHA-1"); + md.update(str.getBytes()); + byte[] digest = md.digest(); + + StringBuffer hexstr = new StringBuffer(); + String shaHex = ""; + for (int i = 0; i < digest.length; i++) { + shaHex = Integer.toHexString(digest[i] & 0xFF); + if (shaHex.length() < 2) { + hexstr.append(0); + } + hexstr.append(shaHex); + } + return hexstr.toString(); + } catch (Exception e) { + e.printStackTrace(); + throw new AesException(AesException.ComputeSignatureError); + } + } +} diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/weixingzh/aes/WXBizMsgCrypt.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/weixingzh/aes/WXBizMsgCrypt.java new file mode 100644 index 0000000..919f760 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/weixingzh/aes/WXBizMsgCrypt.java @@ -0,0 +1,287 @@ +/** + * 对公众平台发送给公众账号的消息加解密示例代码. + * + * @copyright Copyright (c) 1998-2014 Tencent Inc. + */ + +// ------------------------------------------------------------------------ + +/** + * 针对org.apache.commons.codec.binary.Base64, + * 需要导入架包commons-codec-1.9(或commons-codec-1.8等其他版本) + * 官方下载地址:http://commons.apache.org/proper/commons-codec/download_codec.cgi + */ +package jnpf.message.util.weixingzh.aes; + +import java.nio.charset.Charset; +import java.util.Arrays; +import java.util.Random; + +import javax.crypto.Cipher; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; + +import org.apache.commons.codec.binary.Base64; + +/** + * 提供接收和推送给公众平台消息的加解密接口(UTF8编码的字符串). + *
    + *
  1. 第三方回复加密消息给公众平台
  2. + *
  3. 第三方收到公众平台发送的消息,验证消息的安全性,并对消息进行解密。
  4. + *
+ * 说明:异常java.security.InvalidKeyException:illegal Key Size的解决方案 + *
    + *
  1. 在官方网站下载JCE无限制权限策略文件(JDK7的下载地址: + * http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html
  2. + *
  3. 下载后解压,可以看到local_policy.jar和US_export_policy.jar以及readme.txt
  4. + *
  5. 如果安装了JRE,将两个jar文件放到%JRE_HOME%\lib\security目录下覆盖原来的文件
  6. + *
  7. 如果安装了JDK,将两个jar文件放到%JDK_HOME%\jre\lib\security目录下覆盖原来文件
  8. + *
+ */ +public class WXBizMsgCrypt { + static Charset CHARSET = Charset.forName("utf-8"); + Base64 base64 = new Base64(); + byte[] aesKey; + String token; + String appId; + + /** + * 构造函数 + * @param token 公众平台上,开发者设置的token + * @param encodingAesKey 公众平台上,开发者设置的EncodingAESKey + * @param appId 公众平台appid + * + * @throws AesException 执行失败,请查看该异常的错误码和具体的错误信息 + */ + public WXBizMsgCrypt(String token, String encodingAesKey, String appId) throws AesException { + if (encodingAesKey.length() != 43) { + throw new AesException(AesException.IllegalAesKey); + } + + this.token = token; + this.appId = appId; + aesKey = Base64.decodeBase64(encodingAesKey + "="); + } + + // 生成4个字节的网络字节序 + byte[] getNetworkBytesOrder(int sourceNumber) { + byte[] orderBytes = new byte[4]; + orderBytes[3] = (byte) (sourceNumber & 0xFF); + orderBytes[2] = (byte) (sourceNumber >> 8 & 0xFF); + orderBytes[1] = (byte) (sourceNumber >> 16 & 0xFF); + orderBytes[0] = (byte) (sourceNumber >> 24 & 0xFF); + return orderBytes; + } + + // 还原4个字节的网络字节序 + int recoverNetworkBytesOrder(byte[] orderBytes) { + int sourceNumber = 0; + for (int i = 0; i < 4; i++) { + sourceNumber <<= 8; + sourceNumber |= orderBytes[i] & 0xff; + } + return sourceNumber; + } + + // 随机生成16位字符串 + String getRandomStr() { + String base = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; + Random random = new Random(); + StringBuffer sb = new StringBuffer(); + for (int i = 0; i < 16; i++) { + int number = random.nextInt(base.length()); + sb.append(base.charAt(number)); + } + return sb.toString(); + } + + /** + * 对明文进行加密. + * + * @param text 需要加密的明文 + * @return 加密后base64编码的字符串 + * @throws AesException aes加密失败 + */ + String encrypt(String randomStr, String text) throws AesException { + ByteGroup byteCollector = new ByteGroup(); + byte[] randomStrBytes = randomStr.getBytes(CHARSET); + byte[] textBytes = text.getBytes(CHARSET); + byte[] networkBytesOrder = getNetworkBytesOrder(textBytes.length); + byte[] appidBytes = appId.getBytes(CHARSET); + + // randomStr + networkBytesOrder + text + appid + byteCollector.addBytes(randomStrBytes); + byteCollector.addBytes(networkBytesOrder); + byteCollector.addBytes(textBytes); + byteCollector.addBytes(appidBytes); + + // ... + pad: 使用自定义的填充方式对明文进行补位填充 + byte[] padBytes = PKCS7Encoder.encode(byteCollector.size()); + byteCollector.addBytes(padBytes); + + // 获得最终的字节流, 未加密 + byte[] unencrypted = byteCollector.toBytes(); + + try { + // 设置加密模式为AES的CBC模式 + Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding"); + SecretKeySpec keySpec = new SecretKeySpec(aesKey, "AES"); + IvParameterSpec iv = new IvParameterSpec(aesKey, 0, 16); + cipher.init(Cipher.ENCRYPT_MODE, keySpec, iv); + + // 加密 + byte[] encrypted = cipher.doFinal(unencrypted); + + // 使用BASE64对加密后的字符串进行编码 + String base64Encrypted = base64.encodeToString(encrypted); + + return base64Encrypted; + } catch (Exception e) { + e.printStackTrace(); + throw new AesException(AesException.EncryptAESError); + } + } + + /** + * 对密文进行解密. + * + * @param text 需要解密的密文 + * @return 解密得到的明文 + * @throws AesException aes解密失败 + */ + String decrypt(String text) throws AesException { + byte[] original; + try { + // 设置解密模式为AES的CBC模式 + Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding"); + SecretKeySpec key_spec = new SecretKeySpec(aesKey, "AES"); + IvParameterSpec iv = new IvParameterSpec(Arrays.copyOfRange(aesKey, 0, 16)); + cipher.init(Cipher.DECRYPT_MODE, key_spec, iv); + + // 使用BASE64对密文进行解码 + byte[] encrypted = Base64.decodeBase64(text); + + // 解密 + original = cipher.doFinal(encrypted); + } catch (Exception e) { + e.printStackTrace(); + throw new AesException(AesException.DecryptAESError); + } + + String xmlContent, from_appid; + try { + // 去除补位字符 + byte[] bytes = PKCS7Encoder.decode(original); + + // 分离16位随机字符串,网络字节序和AppId + byte[] networkOrder = Arrays.copyOfRange(bytes, 16, 20); + + int xmlLength = recoverNetworkBytesOrder(networkOrder); + + xmlContent = new String(Arrays.copyOfRange(bytes, 20, 20 + xmlLength), CHARSET); + from_appid = new String(Arrays.copyOfRange(bytes, 20 + xmlLength, bytes.length), + CHARSET); + } catch (Exception e) { + e.printStackTrace(); + throw new AesException(AesException.IllegalBuffer); + } + + // appid不相同的情况 + if (!from_appid.equals(appId)) { + throw new AesException(AesException.ValidateAppidError); + } + return xmlContent; + + } + + /** + * 将公众平台回复用户的消息加密打包. + *
    + *
  1. 对要发送的消息进行AES-CBC加密
  2. + *
  3. 生成安全签名
  4. + *
  5. 将消息密文和安全签名打包成xml格式
  6. + *
+ * + * @param replyMsg 公众平台待回复用户的消息,xml格式的字符串 + * @param timeStamp 时间戳,可以自己生成,也可以用URL参数的timestamp + * @param nonce 随机串,可以自己生成,也可以用URL参数的nonce + * + * @return 加密后的可以直接回复用户的密文,包括msg_signature, timestamp, nonce, encrypt的xml格式的字符串 + * @throws AesException 执行失败,请查看该异常的错误码和具体的错误信息 + */ + public String encryptMsg(String replyMsg, String timeStamp, String nonce) throws AesException { + // 加密 + String encrypt = encrypt(getRandomStr(), replyMsg); + + // 生成安全签名 + if (timeStamp == "") { + timeStamp = Long.toString(System.currentTimeMillis()); + } + + String signature = SHA1.getSHA1(token, timeStamp, nonce, encrypt); + + // System.out.println("发送给平台的签名是: " + signature[1].toString()); + // 生成发送的xml + String result = XMLParse.generate(encrypt, signature, timeStamp, nonce); + return result; + } + + /** + * 检验消息的真实性,并且获取解密后的明文. + *
    + *
  1. 利用收到的密文生成安全签名,进行签名验证
  2. + *
  3. 若验证通过,则提取xml中的加密消息
  4. + *
  5. 对消息进行解密
  6. + *
+ * + * @param msgSignature 签名串,对应URL参数的msg_signature + * @param timeStamp 时间戳,对应URL参数的timestamp + * @param nonce 随机串,对应URL参数的nonce + * @param postData 密文,对应POST请求的数据 + * + * @return 解密后的原文 + * @throws AesException 执行失败,请查看该异常的错误码和具体的错误信息 + */ + public String decryptMsg(String msgSignature, String timeStamp, String nonce, String postData) + throws AesException { + + // 密钥,公众账号的app secret + // 提取密文 + Object[] encrypt = XMLParse.extract(postData); + + // 验证安全签名 + String signature = SHA1.getSHA1(token, timeStamp, nonce, encrypt[1].toString()); + + // 和URL中的签名比较是否相等 + if (!signature.equals(msgSignature)) { + throw new AesException(AesException.ValidateSignatureError); + } + + // 解密 + String result = decrypt(encrypt[1].toString()); + return result; + } + + /** + * 验证URL + * @param msgSignature 签名串,对应URL参数的msg_signature + * @param timeStamp 时间戳,对应URL参数的timestamp + * @param nonce 随机串,对应URL参数的nonce + * @param echoStr 随机串,对应URL参数的echostr + * + * @return 解密之后的echostr + * @throws AesException 执行失败,请查看该异常的错误码和具体的错误信息 + */ + public String verifyUrl(String msgSignature, String timeStamp, String nonce, String echoStr) + throws AesException { + String signature = SHA1.getSHA1(token, timeStamp, nonce, echoStr); + + if (!signature.equals(msgSignature)) { + throw new AesException(AesException.ValidateSignatureError); + } + + String result = decrypt(echoStr); + return result; + } + +} \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/weixingzh/aes/XMLParse.java b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/weixingzh/aes/XMLParse.java new file mode 100644 index 0000000..0d9f1f0 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/jnpf-message-entity/src/main/java/jnpf/message/util/weixingzh/aes/XMLParse.java @@ -0,0 +1,72 @@ +/** + * 对公众平台发送给公众账号的消息加解密示例代码. + * + * @copyright Copyright (c) 1998-2014 Tencent Inc. + */ + +// ------------------------------------------------------------------------ + +package jnpf.message.util.weixingzh.aes; + +import java.io.StringReader; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; +import org.xml.sax.InputSource; + +/** + * XMLParse class + * + * 提供提取消息格式中的密文及生成回复消息格式的接口. + */ +class XMLParse { + + /** + * 提取出xml数据包中的加密消息 + * @param xmltext 待提取的xml字符串 + * @return 提取出的加密消息字符串 + * @throws AesException + */ + public static Object[] extract(String xmltext) throws AesException { + Object[] result = new Object[3]; + try { + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + StringReader sr = new StringReader(xmltext); + InputSource is = new InputSource(sr); + Document document = db.parse(is); + + Element root = document.getDocumentElement(); + NodeList nodelist1 = root.getElementsByTagName("Encrypt"); + NodeList nodelist2 = root.getElementsByTagName("ToUserName"); + result[0] = 0; + result[1] = nodelist1.item(0).getTextContent(); + result[2] = nodelist2.item(0).getTextContent(); + return result; + } catch (Exception e) { + e.printStackTrace(); + throw new AesException(AesException.ParseXmlError); + } + } + + /** + * 生成xml消息 + * @param encrypt 加密后的消息密文 + * @param signature 安全签名 + * @param timestamp 时间戳 + * @param nonce 随机字符串 + * @return 生成的xml字符串 + */ + public static String generate(String encrypt, String signature, String timestamp, String nonce) { + + String format = "\n" + "\n" + + "\n" + + "%3$s\n" + "\n" + ""; + return String.format(format, encrypt, signature, timestamp, nonce); + + } +} diff --git a/jnpf-java-boot/jnpf-message/pom.xml b/jnpf-java-boot/jnpf-message/pom.xml new file mode 100644 index 0000000..e33eb70 --- /dev/null +++ b/jnpf-java-boot/jnpf-message/pom.xml @@ -0,0 +1,21 @@ + + + + jnpf-java-boot + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-message + pom + + jnpf-message-entity + jnpf-message-biz + jnpf-message-controller + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-oauth/jnpf-oauth-api/pom.xml b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-api/pom.xml new file mode 100644 index 0000000..10c04d4 --- /dev/null +++ b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-api/pom.xml @@ -0,0 +1,22 @@ + + + + jnpf-oauth + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-oauth-api + + + + com.jnpf + jnpf-oauth-entity + ${project.version} + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-oauth/jnpf-oauth-api/src/main/java/jnpf/service/AuthService.java b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-api/src/main/java/jnpf/service/AuthService.java new file mode 100644 index 0000000..29520e2 --- /dev/null +++ b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-api/src/main/java/jnpf/service/AuthService.java @@ -0,0 +1,15 @@ +package jnpf.service; + +import jnpf.base.ActionResult; +import jnpf.exception.LoginException; +import jnpf.model.LoginVO; + +import java.util.Map; + +public interface AuthService { + ActionResult login(Map parameters) throws LoginException; + + ActionResult kickoutByToken(String... tokens); + + ActionResult kickoutByUserId(String userId, String tenantId); +} diff --git a/jnpf-java-boot/jnpf-oauth/jnpf-oauth-api/src/main/java/jnpf/util/AuthUtil.java b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-api/src/main/java/jnpf/util/AuthUtil.java new file mode 100644 index 0000000..fadbbda --- /dev/null +++ b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-api/src/main/java/jnpf/util/AuthUtil.java @@ -0,0 +1,100 @@ +package jnpf.util; + +import com.google.common.collect.ImmutableMap; +import jnpf.base.ActionResult; +import jnpf.base.UserInfo; +import jnpf.util.data.DataSourceContextHolder; +import jnpf.exception.LoginException; +import jnpf.model.LoginVO; +import jnpf.service.AuthService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.Map; +import java.util.Optional; + +/** + * 内部登录、退出用户工具 + */ +@Slf4j +@Component +public class AuthUtil { + + public static AuthService authApi; + + @Autowired + public void setAuthApi(AuthService authApi) { + AuthUtil.authApi = authApi; + } + + /** + * 登录临时用户 + * 此用户已经登录将返回现有用户Token + * 未登录将直接使用用户ID进行免密登录返回Token + * + * @param userId 用户ID + * @param tenantId 租户ID + * @return + */ + public static String loginTempUser(String userId, String tenantId){ + return loginTempUser(userId, tenantId, false); + } + + /** + * 登录临时用户 + * 此用户已经登录将返回现有用户Token + * 未登录将直接使用用户ID进行免密登录返回Token + * + * @param userId 用户ID + * @param tenantId 租户ID + * @param limited 是否是限制型临时用户(无法登录主系统前端) + * @return + */ + public static String loginTempUser(String userId, String tenantId, boolean limited){ + Map loginInfo = ImmutableMap.of( + "grant_type", "tempuser", + "token", UserProvider.getInnerAuthToken(), + "userId", userId, + "tenantId", Optional.ofNullable(tenantId).orElse(StringUtil.NULLSTR), + "limited", String.valueOf(limited)); + String errMsg; + try { + ActionResult result = authApi.login(loginInfo); + if(Constants.SUCCESS.equals(result.getCode())){ + return result.getData().getToken(); + } + errMsg = result.getMsg(); + } catch (LoginException e) { + errMsg = e.getMessage(); + } + log.error("登录临时用户失败:", errMsg); + return null; + } + + /** + * 踢出用户, 用户将收到Websocket下线通知 + * 执行流程:认证服务退出用户->用户踢出监听->消息服务发送Websocket推送退出消息 + * @param tokens + */ + public static void kickoutByToken(String... tokens){ + authApi.kickoutByToken(tokens); + } + + /** + * 踢出用户, 用户将收到Websocket下线通知 + * 执行流程:认证服务退出用户->用户踢出监听->消息服务发送Websocket推送退出消息 + * @param userId + */ + public static void kickoutByUserId(String userId){ + String tenantId = DataSourceContextHolder.getDatasourceId(); + if(tenantId == null) { + UserInfo userInfo = UserProvider.getUser(); + if (userInfo.getUserId() == null) { + throw new RuntimeException("请设置UserInfo"); + } + tenantId = userInfo.getTenantId(); + } + authApi.kickoutByUserId(userId, tenantId); + } +} diff --git a/jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/pom.xml b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/pom.xml new file mode 100644 index 0000000..e9726ab --- /dev/null +++ b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/pom.xml @@ -0,0 +1,77 @@ + + + + jnpf-oauth + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-oauth-biz + + + + + org.projectlombok + lombok + + + com.jnpf + jnpf-oauth-entity + ${project.version} + compile + + + com.jnpf + jnpf-system-biz + ${project.version} + compile + + + com.jnpf + jnpf-common-all + ${project.version} + compile + + + com.jnpf + jnpf-exception + ${project.version} + compile + + + com.nimbusds + nimbus-jose-jwt + + + org.apache.commons + commons-pool2 + + + com.jnpf + jnpf-message-biz + ${project.version} + + + com.jnpf + jnpf-permission-controller + ${project.version} + + + com.jnpf + jnpf-visualdev-portal-biz + ${project.version} + + + + org.springframework.boot + spring-boot-starter-data-redis + + + com.jnpf + jnpf-common-security + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/src/main/java/jnpf/granter/PasswordTokenGranter.java b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/src/main/java/jnpf/granter/PasswordTokenGranter.java new file mode 100644 index 0000000..14ab69b --- /dev/null +++ b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/src/main/java/jnpf/granter/PasswordTokenGranter.java @@ -0,0 +1,245 @@ +package jnpf.granter; + +import cn.dev33.satoken.context.SaHolder; +import jnpf.base.ActionResult; +import jnpf.base.UserInfo; +import jnpf.constant.MsgCode; +import jnpf.consts.AuthConsts; +import jnpf.consts.DeviceType; +import jnpf.exception.LoginException; +import jnpf.message.entity.UserDeviceEntity; +import jnpf.message.service.UserDeviceService; +import jnpf.model.*; +import jnpf.permission.controller.SocialsUserController; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.UserService; +import jnpf.service.impl.UserDetailsByUserAccountServiceImpl; +import jnpf.util.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.Date; +import java.util.Map; +import java.util.Objects; + +import static jnpf.granter.PasswordTokenGranter.GRANT_TYPE; + + +/** + * 账号密码认证 + * + * @author JNPF开发平台组 + * @user N + * @copyright 引迈信息技术有限公司 + * @date 2022/9/17 22:13 + */ +@Slf4j +@Component(GRANT_TYPE) +public class PasswordTokenGranter extends AbstractTokenGranter { + + public static final String GRANT_TYPE = "password"; + public static final Integer ORDER = 1; + private static final String URL_LOGIN = ""; + + + public PasswordTokenGranter() { + super(URL_LOGIN); + } + + @Autowired + private UserService userApi; + + @Autowired + private UserDetailsServiceBuilder userDetailsServiceBuilder; + + @Autowired + private SocialsUserController socialsUserApi; + + @Autowired + private UserDeviceService userDeviceService; + + + @Override + public ActionResult granter(Map loginParameters) throws LoginException { + LoginForm loginForm = JsonUtil.getJsonToBean(loginParameters, LoginForm.class); + UserInfo userInfo = new UserInfo(); + userInfo.setUserAccount(loginForm.getAccount()); + //切换租户 + switchTenant(userInfo); + //获取系统配置 + BaseSystemInfo baseSystemInfo = getSysconfig(userInfo); + //预检信息 + preAuthenticate(loginForm, userInfo, baseSystemInfo); + //登录账号 + super.loginAccount(userInfo, baseSystemInfo); + //返回登录信息 + LoginVO loginResult = getLoginVo(userInfo); + return ActionResult.success(loginResult); + } + + @Override + public int getOrder() { + return ORDER; + } + + /** + * 可重写实现邮箱、短信、TOTP验证 + * + * @param loginForm + * @param sysConfigInfo + * @throws LoginException + */ + protected void preAuthenticate(LoginForm loginForm, UserInfo userInfo, BaseSystemInfo sysConfigInfo) throws LoginException { + // 判断是否开启验证码 + if (Objects.nonNull(sysConfigInfo) && "1".equals(String.valueOf(sysConfigInfo.getEnableVerificationCode())) + && !Objects.equals("code", loginForm.getOrigin())) { + // 验证验证码 + String timestamp = String.valueOf(redisUtil.getString(loginForm.getTimestamp())); + if (StringUtil.isEmpty(timestamp) || !loginForm.getCode().equalsIgnoreCase(timestamp)) { + throw new LoginException(MsgCode.LOG104.get()); + } + } + //验证密码 + UserEntity userEntity = userDetailsServiceBuilder.getUserDetailService(AuthConsts.USERDETAIL_ACCOUNT).loadUserEntity(userInfo); + try { + authenticate(loginForm, userEntity, sysConfigInfo); + } catch (Exception e) { + authenticateFailure(userEntity, sysConfigInfo); + throw e; + } + LoginHolder.setUserEntity(userEntity); + } + + protected void authenticate(LoginForm loginForm, UserEntity userEntity, BaseSystemInfo systemInfo) throws LoginException { + // 判断当前账号是否被锁定 + Integer lockMark = userEntity.getEnabledMark(); + if (Objects.nonNull(lockMark) && lockMark == 2) { + // 获取解锁时间 + Date unlockTime = userEntity.getUnlockTime(); + // 账号锁定 + if (systemInfo.getLockType() == 1 || Objects.isNull(unlockTime)) { + throw new LoginException(MsgCode.LOG012.get()); + } + // 延迟登陆锁定 + long millis = System.currentTimeMillis(); + if (unlockTime.getTime() > millis) { + // 转成分钟 + int time = (int) ((unlockTime.getTime() - millis) / (1000 * 60)); + throw new LoginException(MsgCode.LOG013.get().replace("{time}", Integer.toString(time + 1))); + } else if (unlockTime.getTime() < millis && userEntity.getLogErrorCount() >= systemInfo.getPasswordErrorsNumber()){ + // 已经接触错误时间锁定的话就重置错误次数 + userEntity.setLogErrorCount(0); + userEntity.setEnabledMark(1); + userApi.updateById(userEntity); + } + } + String inputPwd = loginForm.getPassword(); + if (!userEntity.getPassword().equals(Md5Util.getStringMd5(inputPwd + userEntity.getSecretkey().toLowerCase()))) { + throw new LoginException(MsgCode.LOG101.get()); + } + } + + protected void authenticateFailure(UserEntity entity, BaseSystemInfo sysConfigInfo) { + if (entity != null) { + // 超级管理员特权,不会锁定 + if (!"admin".equals(entity.getAccount())) { + // 判断是否需要锁定账号,哪种锁定方式 + // 大于2则判断有效 + Integer errorsNumber = sysConfigInfo.getPasswordErrorsNumber(); + // 判断是否开启 + if (errorsNumber != null && errorsNumber > 2) { + // 加入错误次数 + Integer errorCount = entity.getLogErrorCount() != null ? entity.getLogErrorCount() + 1 : 1; + entity.setLogErrorCount(errorCount); + Integer lockType = sysConfigInfo.getLockType(); + if (errorCount >= errorsNumber) { + entity.setEnabledMark(2); + // 如果是延时锁定 + if (Objects.nonNull(lockType) && lockType == 2) { + Integer lockTime = sysConfigInfo.getLockTime(); + Date date = new Date((System.currentTimeMillis() + (lockTime * 60 * 1000))); + entity.setUnlockTime(date); + } + } + if (lockType == 1) { + entity.setUnlockTime(null); + } + userApi.updateById(entity); + } + } + } + } + + @Override + protected void preLogin(UserInfo userInfo, BaseSystemInfo baseSystemInfo) throws LoginException { + + } + + @Override + protected void loginSuccess(UserInfo userInfo, BaseSystemInfo baseSystemInfo) { + super.loginSuccess(userInfo, baseSystemInfo); + //登录成功绑定第三方 + if (SaHolder.getRequest().hasParam(AuthConsts.PARAMS_JNPF_TICKET)) { + String ticket = SaHolder.getRequest().getParam(AuthConsts.PARAMS_JNPF_TICKET); + LoginTicketModel ticketModel = TicketUtil.parseTicket(ticket); + if (ticketModel != null) { + SocialUnbindModel jsonToBean = JsonUtil.getJsonToBean(ticketModel.getValue(), SocialUnbindModel.class); + if (jsonToBean != null) { + socialsUserApi.loginAutoBinding(jsonToBean.getSocialType(), jsonToBean.getSocialUnionid(), jsonToBean.getSocialName(), + userInfo.getUserId(), userInfo.getTenantId()); + } + } + } + if (SaHolder.getRequest().hasParam(AuthConsts.Client_Id)) { + String Client_Id = SaHolder.getRequest().getParam(AuthConsts.Client_Id); + if(StringUtil.isNotBlank(Client_Id) && !"null".equals(Client_Id)) { + UserDeviceEntity userDeviceEntity = userDeviceService.getInfoByClientId(Client_Id); + if (userDeviceEntity != null) { + userDeviceEntity.setUserId(userInfo.getUserId()); + userDeviceEntity.setLastModifyTime(DateUtil.getNowDate()); + userDeviceEntity.setLastModifyUserId(userInfo.getUserId()); + userDeviceService.update(userDeviceEntity.getId(), userDeviceEntity); + } else { + userDeviceEntity = new UserDeviceEntity(); + userDeviceEntity.setId(RandomUtil.uuId()); + userDeviceEntity.setUserId(userInfo.getUserId()); + userDeviceEntity.setClientId(Client_Id); + userDeviceEntity.setCreatorTime(DateUtil.getNowDate()); + userDeviceEntity.setCreatorUserId(userInfo.getUserId()); + userDeviceService.create(userDeviceEntity); + } + } + } + } + + protected LoginVO getLoginVo(UserInfo userInfo) { + LoginVO loginVO = new LoginVO(); + loginVO.setTheme(userInfo.getTheme()); + loginVO.setToken(userInfo.getToken()); + return loginVO; + } + + @Override + public ActionResult logout() { + UserInfo userInfo = UserProvider.getUser(); + if (userInfo.getUserId() != null) { + if ("1".equals(String.valueOf(loginService.getBaseSystemConfig(userInfo.getTenantId(), userInfo.getTenantDbConnectionString(), userInfo.isAssignDataSource()).getSingleLogin()))) { + UserProvider.logoutByUserId(userInfo.getUserId(), DeviceType.valueOf(userInfo.getLoginDevice())); + } else { + UserProvider.logoutByToken(userInfo.getToken()); + } + } + return ActionResult.success("注销成功"); + } + + @Override + protected String getGrantType() { + return GRANT_TYPE; + } + + @Override + protected String getUserDetailKey() { + return AuthConsts.USERDETAIL_ACCOUNT; + } +} diff --git a/jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/src/main/java/jnpf/granter/SocialsTokenGranter.java b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/src/main/java/jnpf/granter/SocialsTokenGranter.java new file mode 100644 index 0000000..0c49dff --- /dev/null +++ b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/src/main/java/jnpf/granter/SocialsTokenGranter.java @@ -0,0 +1,289 @@ +package jnpf.granter; + +import cn.dev33.satoken.context.SaHolder; +import cn.dev33.satoken.context.model.SaRequest; +import cn.dev33.satoken.stp.StpUtil; +import cn.dev33.satoken.util.SaFoxUtil; +import cn.hutool.core.collection.CollectionUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import jnpf.base.ActionResult; +import jnpf.base.UserInfo; +import jnpf.consts.AuthConsts; +import jnpf.consts.LoginTicketStatus; +import jnpf.exception.LoginException; +import jnpf.model.BaseSystemInfo; +import jnpf.model.LoginTicketModel; +import jnpf.model.SocialUnbindModel; +import jnpf.model.LoginVO; +import jnpf.permission.controller.SocialsUserController; +import jnpf.permission.model.socails.SocialsUserInfo; +import jnpf.service.impl.UserDetailsByUserIdServiceImpl; +import jnpf.util.ServletUtil; +import jnpf.util.StringUtil; +import jnpf.util.TicketUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import javax.servlet.http.HttpServletResponse; +import java.io.PrintWriter; +import java.util.Map; + +import static jnpf.granter.SocialsTokenGranter.GRANT_TYPE; + + +@Slf4j +@Component(GRANT_TYPE) +public class SocialsTokenGranter extends AbstractTokenGranter { + + + public static final String GRANT_TYPE = "socials"; + public static final Integer ORDER = 5; + private static final String URL_LOGIN = "/Login/socials/**"; + + @Autowired + private SocialsUserController socialsUserApi; + + public SocialsTokenGranter() { + super(URL_LOGIN); + } + + protected String getGrantType() { + return GRANT_TYPE; + } + + public ActionResult granter(Map map) throws LoginException { + SaRequest req = SaHolder.getRequest(); + String code = req.getParam("code"); + String state = req.getParam("state"); + String source = req.getParam("source"); + String uuid = req.getParam("uuid"); + if (StringUtil.isEmpty(code)) { + code = req.getParam("authCode") != null ? req.getParam("authCode") : req.getParam("auth_code"); + } + //是否是微信qq唤醒或者小程序登录 + if (StringUtil.isNotEmpty(uuid)) { + try { + return loginByCode(source, code, null, uuid, null); + } catch (Exception e) { + //更新登录结果 + outError(e.getMessage()); + } + } + + + if (StringUtil.isEmpty(req.getParam(AuthConsts.PARAMS_JNPF_TICKET))) { + //租户列表登陆标识 + boolean tenantLogin = StringUtil.isEmpty(req.getParam("tenantLogin")) ? false : req.getParam("tenantLogin").equals("true") ? true : false; + //租户列表点击登录调用 + if (!tenantLogin) { + //绑定 + socialsBinding(req, code, state, source); + return null; + } else {//租户列表点击登录 + LoginVO loginVO = tenantLogin(req); + return ActionResult.success("登录成功!", loginVO); + } + } else { + //票据登陆 + if (!isValidJnpfTicket()) { + outError("登录票据已失效"); + return null; + } + //接受CODE 进行登录 + if (SaFoxUtil.isNotEmpty(code)) { + try { + String socialName = req.getParam("socialName"); + ActionResult actionResult = loginByCode(source, code, state, null, socialName); + if(400==actionResult.getCode()||"wechat_applets".equals(req.getParam("source"))){ + return actionResult; + } + return null; + } catch (Exception e) { + //更新登录结果 + outError(e.getMessage()); + } + return null; + } + return null; + } + + } + + /** + * 租户列表登录 + * + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2022/9/21 + */ + private LoginVO tenantLogin(SaRequest req) throws LoginException { + String userId = req.getParam("userId"); + String account = req.getParam("account"); + String tenantId = req.getParam("tenantId"); + UserInfo userInfo = new UserInfo(); + userInfo.setUserId(userId); + userInfo.setTenantId(tenantId); + userInfo.setUserAccount(tenantId + "@" + account); + //切换租户 + switchTenant(userInfo); + //获取系统配置 + BaseSystemInfo baseSystemInfo = getSysconfig(userInfo); + //登录账号 + super.loginAccount(userInfo, baseSystemInfo); + //返回登录信息 + LoginVO loginVo = getLoginVo(userInfo); + return loginVo; + } + + /** + * 第三方绑定 + */ + private void socialsBinding(SaRequest req, String code, String state, String source) { + String userId = req.getParam("userId"); + String tenantId = req.getParam("tenantId"); + PrintWriter out = null; + try { + HttpServletResponse response = ServletUtil.getResponse(); + response.setCharacterEncoding("utf-8"); + response.setHeader("content-type", "text/html;charset=utf-8"); + out = response.getWriter(); + JSONObject binding = socialsUserApi.binding(source, userId, tenantId, code, state); + out.print( + ""); + out.close(); + } catch (Exception e) { + + } + } + + public ActionResult logout() { + return super.logout(); + } + + public int getOrder() { + return ORDER; + } + + @Override + protected void loginSuccess(UserInfo userInfo, BaseSystemInfo baseSystemInfo) { + } + + @Override + protected void loginFailure(UserInfo userInfo, BaseSystemInfo baseSystemInfo, Exception e) { + super.loginFailure(userInfo, baseSystemInfo, e); + } + + + protected void outError(String message) { + updateTicketError(message); + } + + @Override + protected String getUserDetailKey() { + return AuthConsts.USERDETAIL_USER_ID; + } + + protected LoginTicketModel updateTicketUnbind(String socialType, String socialUnionid, String socialName) { + LoginTicketModel loginTicketModel = null; + SocialUnbindModel obj = new SocialUnbindModel(socialType, socialUnionid, socialName); + String ticket = this.getJnpfTicket(); + if (!ticket.isEmpty()) { + loginTicketModel = (new LoginTicketModel()).setStatus(LoginTicketStatus.UnBind.getStatus()).setValue(JSONObject.toJSONString(obj)); + TicketUtil.updateTicket(ticket, loginTicketModel, (Long) 300L); + } + return loginTicketModel; + } + + protected LoginTicketModel updateTicketMultitenancy(JSONArray jsonArray) { + LoginTicketModel loginTicketModel = null; + String ticket = this.getJnpfTicket(); + if (!ticket.isEmpty()) { + loginTicketModel = (new LoginTicketModel()).setStatus(LoginTicketStatus.Multitenancy.getStatus()).setValue(jsonArray.toJSONString()); + TicketUtil.updateTicket(ticket, loginTicketModel, (Long) null); + } + return loginTicketModel; + } + + + protected LoginTicketModel updateTicketSuccessReturn(UserInfo userInfo) { + LoginTicketModel loginTicketModel = null; + String ticket = getJnpfTicket(); + if (!ticket.isEmpty()) { + loginTicketModel = new LoginTicketModel() + .setStatus(LoginTicketStatus.Success.getStatus()) + .setValue(StpUtil.getTokenValueNotCut()) + .setTheme(userInfo.getTheme()); + TicketUtil.updateTicket(ticket, loginTicketModel, null); + } + return loginTicketModel; + } + + protected LoginVO getLoginVo(UserInfo userInfo) { + LoginVO loginVO = new LoginVO(); + loginVO.setTheme(userInfo.getTheme()); + loginVO.setToken(userInfo.getToken()); + return loginVO; + } + + /** + * 小程序登录微信授权 + * app微信,qq唤醒 + * + * @param code + * @throws LoginException + */ + protected ActionResult loginByCode(String source, String code, String state, String uuid, String socialName) throws LoginException { + log.debug("Auth2 Code: {}", code); + SocialsUserInfo socialsUserInfo = null; + if (StringUtil.isNotEmpty(code)) { + socialsUserInfo = socialsUserApi.getSocialsUserInfo(source, code, state); + } else if (StringUtil.isNotEmpty(uuid)) {//微信和qq唤醒 + socialsUserInfo = socialsUserApi.getUserInfo(source, uuid, state); + if (StringUtil.isEmpty(socialsUserInfo.getSocialName()) && StringUtil.isNotEmpty(socialName)) { + socialsUserInfo.setSocialName(socialName);//小程序名称前端传递 + } + } + if (configValueUtil.isMultiTenancy()) { + if (socialsUserInfo == null || CollectionUtil.isEmpty(socialsUserInfo.getTenantUserInfo())) { + updateTicketUnbind(source, socialsUserInfo.getSocialUnionid(), socialsUserInfo.getSocialName());//第三方未绑定账号! + return ActionResult.fail("第三方未绑定账号!"); + } + if (socialsUserInfo.getTenantUserInfo().size() == 1) { + UserInfo userInfo = socialsUserInfo.getUserInfo(); + //切换租户 + switchTenant(userInfo); + //获取系统配置 + BaseSystemInfo baseSystemInfo = getSysconfig(userInfo); + //登录账号 + super.loginAccount(userInfo, baseSystemInfo); + //返回登录信息 + LoginTicketModel loginTicketModel = updateTicketSuccessReturn(userInfo); + return ActionResult.success(loginTicketModel); + } else { + JSONArray tenantUserInfo = socialsUserInfo.getTenantUserInfo(); + LoginTicketModel loginTicketModel = updateTicketMultitenancy(tenantUserInfo); + return ActionResult.success(loginTicketModel); + } + } else { + if (socialsUserInfo == null || socialsUserInfo.getUserInfo() == null) { + updateTicketUnbind(source, socialsUserInfo.getSocialUnionid(), socialsUserInfo.getSocialName());//第三方未绑定账号! + return ActionResult.fail("第三方未绑定账号!"); + } + UserInfo userInfo = socialsUserInfo.getUserInfo(); + //切换租户 + switchTenant(userInfo); + //获取系统配置 + BaseSystemInfo baseSystemInfo = getSysconfig(userInfo); + //登录账号 + super.loginAccount(userInfo, baseSystemInfo); + LoginTicketModel loginTicketModel = updateTicketSuccessReturn(userInfo); + return ActionResult.success(loginTicketModel); + } + } +} diff --git a/jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/src/main/java/jnpf/granter/TempUserTokenGranter.java b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/src/main/java/jnpf/granter/TempUserTokenGranter.java new file mode 100644 index 0000000..156cd04 --- /dev/null +++ b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/src/main/java/jnpf/granter/TempUserTokenGranter.java @@ -0,0 +1,134 @@ +package jnpf.granter; + +import jnpf.base.ActionResult; +import jnpf.base.UserInfo; +import jnpf.consts.AuthConsts; +import jnpf.consts.DeviceType; +import jnpf.exception.LoginException; +import jnpf.model.BaseSystemInfo; +import jnpf.model.LoginVO; +import jnpf.util.UserProvider; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +import java.util.Arrays; +import java.util.Map; + +import static jnpf.granter.TempUserTokenGranter.GRANT_TYPE; + + +/** + * 临时用户认证 + * @user N + * @author JNPF开发平台组 + * @copyright 引迈信息技术有限公司 + * @date 2022/9/16 21:25 + */ +@Slf4j +@Component(GRANT_TYPE) +public class TempUserTokenGranter extends AbstractTokenGranter{ + + public static final String GRANT_TYPE = "tempuser"; + public static final Integer ORDER = 4; + private static final String URL_LOGIN = ""; + + + public TempUserTokenGranter(){ + super(URL_LOGIN); + } + + + /** + * + * @param loginParameters {userId, tenantId} + * @return + * @throws LoginException + */ + @Override + public ActionResult granter(Map loginParameters) throws LoginException { + String token = loginParameters.get("token"); + //验证是否由内部发起 + if(!UserProvider.isValidInnerToken(token)){ + throw new LoginException("不允许访问此登录接口"); + } + String userId = loginParameters.get("userId"); + String tenantId = loginParameters.get("tenantId"); + boolean limited = Boolean.valueOf(loginParameters.get("limited")); + String device = limited?DeviceType.TEMPUSERLIMITED.getDevice():DeviceType.TEMPUSER.getDevice(); + //尝试获取已经登录的用户信息 + UserInfo userInfo; + if(limited){ + //只获取限制类型的TOKEN + userInfo = UserProvider.getUser(userId, tenantId, Arrays.asList(DeviceType.TEMPUSERLIMITED.getDevice()), null); + }else{ + //排除限制类型的TOKEN + userInfo = UserProvider.getUser(userId, tenantId, null, Arrays.asList(DeviceType.TEMPUSERLIMITED.getDevice())); + } + if(userInfo.getUserId() != null){ + return ActionResult.success(getLoginVo(userInfo)); + } + userInfo = new UserInfo(); + userInfo.setUserAccount(tenantId); + userInfo.setUserId(userId); + //切换租户 + switchTenant(userInfo); + //获取系统配置 + BaseSystemInfo baseSystemInfo = getSysconfig(userInfo); + //先设置用户类型 + userInfo.setLoginDevice(device); + //登录账号 + super.loginAccount(userInfo, baseSystemInfo); + //返回登录信息 + LoginVO loginResult = getLoginVo(userInfo); + return ActionResult.success(loginResult); + } + + @Override + public int getOrder() { + return ORDER; + } + + + @Override + protected void preLogin(UserInfo userInfo, BaseSystemInfo baseSystemInfo) throws LoginException { + + } + + @Override + protected void loginSuccess(UserInfo userInfo, BaseSystemInfo baseSystemInfo) { + super.loginSuccess(userInfo, baseSystemInfo); + + } + + @Override + protected DeviceType getDeviceType() { + return DeviceType.TEMPUSER; + } + + protected LoginVO getLoginVo(UserInfo userInfo){ + LoginVO loginVO = new LoginVO(); + loginVO.setTheme(userInfo.getTheme()); + loginVO.setToken(userInfo.getToken()); + return loginVO; + } + + @Override + public ActionResult logout() { + //非临时用户不注销 + UserInfo userInfo = UserProvider.getUser(); + if(UserProvider.isTempUser(userInfo)){ + UserProvider.logoutByToken(userInfo.getToken()); + } + return ActionResult.success("注销成功"); + } + + @Override + protected String getGrantType() { + return GRANT_TYPE; + } + + @Override + protected String getUserDetailKey() { + return AuthConsts.USERDETAIL_USER_ID; + } +} diff --git a/jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/src/main/java/jnpf/listener/JnpfListener.java b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/src/main/java/jnpf/listener/JnpfListener.java new file mode 100644 index 0000000..9da1f26 --- /dev/null +++ b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/src/main/java/jnpf/listener/JnpfListener.java @@ -0,0 +1,29 @@ +package jnpf.listener; + +import jnpf.config.ConfigValueUtil; +import jnpf.util.RedisUtil; +import jnpf.util.context.SpringContext; +import org.springframework.context.ApplicationListener; +import org.springframework.context.event.ContextRefreshedEvent; +import org.springframework.stereotype.Component; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/16 8:49 + */ +@Component +public class JnpfListener implements ApplicationListener { + + private ConfigValueUtil configValueUtil; + @Override + public void onApplicationEvent(ContextRefreshedEvent event) { + configValueUtil=SpringContext.getBean(ConfigValueUtil.class); + if("false".equals(configValueUtil.getTestVersion())){ + RedisUtil redisUtil = SpringContext.getBean(RedisUtil.class); + redisUtil.removeAll(); + } + } +} \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/src/main/java/jnpf/listener/LoginListener.java b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/src/main/java/jnpf/listener/LoginListener.java new file mode 100644 index 0000000..4d233e7 --- /dev/null +++ b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/src/main/java/jnpf/listener/LoginListener.java @@ -0,0 +1,91 @@ +package jnpf.listener; + +import cn.dev33.satoken.listener.SaTokenListenerForSimple; +import cn.dev33.satoken.stp.SaLoginModel; +import cn.dev33.satoken.stp.StpUtil; +import jnpf.base.UserInfo; +import jnpf.consts.DeviceType; +import jnpf.message.service.MessageService; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.UserService; +import jnpf.service.LogService; +import jnpf.util.DateUtil; +import jnpf.util.IpUtil; +import jnpf.util.LoginHolder; +import jnpf.util.UserProvider; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + + +/** + * + * @author JNPF开发平台组 + * @copyright 引迈信息技术有限公司 + */ +@Slf4j +@Component +public class LoginListener extends SaTokenListenerForSimple { + + @Autowired + private UserProvider userProvider; + @Autowired + private MessageService messageApi; + @Autowired + private LogService logApi; + @Autowired + private UserService userApi; + + @Override + public void doLogin(String loginType, Object loginId, String tokenValue, SaLoginModel loginModel) { + println("用户登录:{}, 设备:{}, TOKEN:{}", loginId, loginType, tokenValue); + UserInfo userInfo = userProvider.get(); + //临时用户登录不记录 + if(!UserProvider.isTempUser(userInfo)) { + //写入日志 + logApi.writeLogAsync(userInfo.getUserId(),userInfo.getUserName()+"/"+userInfo.getUserAccount(),"登录成功"); + + UserEntity entity = LoginHolder.getUserEntity(); + entity.setLogErrorCount(0); + entity.setUnlockTime(null); + entity.setEnabledMark(1); + entity.setPrevLogIp(IpUtil.getIpAddr()); + entity.setPrevLogTime(DateUtil.getNowDate()); + entity.setLastLogIp(IpUtil.getIpAddr()); + entity.setLastLogTime(DateUtil.getNowDate()); + entity.setLogSuccessCount(entity.getLogSuccessCount() != null ? entity.getLogSuccessCount() + 1 : 1); + + userApi.updateById(entity); + } + } + + @Override + public void doLogout(String loginType, Object loginId, String tokenValue) { + println("用户退出:{}, 设备:{}, TOKEN:{}", loginId, loginType, tokenValue); + } + + @Override + public void doKickout(String loginType, Object loginId, String tokenValue) { + println("用户踢出:{}, 设备:{}, TOKEN:{}", loginId, loginType, tokenValue); + messageApi.logoutWebsocketByToken(tokenValue, null); + //删除用户信息缓存, 保留Token状态记录等待自动过期, 如果用户不在线下次打开浏览器会提示被踢下线 + StpUtil.getTokenSessionByToken(tokenValue).logout(); + } + + @Override + public void doReplaced(String loginType, Object loginId, String tokenValue) { + println("用户顶替:{}, 设备:{}, TOKEN:{}", loginId, loginType, tokenValue); + messageApi.logoutWebsocketByToken(tokenValue, null); + StpUtil.getTokenSessionByToken(tokenValue).logout(); + } + + /** + * 打印指定字符串 + * @param str 字符串 + */ + public void println(String str, Object... params) { + if(log.isDebugEnabled()) { + log.debug(str, params); + } + } +} diff --git a/jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/src/main/java/jnpf/service/impl/AuthServiceImpl.java b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/src/main/java/jnpf/service/impl/AuthServiceImpl.java new file mode 100644 index 0000000..baac0bd --- /dev/null +++ b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/src/main/java/jnpf/service/impl/AuthServiceImpl.java @@ -0,0 +1,77 @@ +package jnpf.service.impl; + +import jnpf.base.ActionResult; +import jnpf.exception.LoginException; +import jnpf.granter.TokenGranter; +import jnpf.granter.TokenGranterBuilder; +import jnpf.model.LoginVO; +import jnpf.service.AuthService; +import jnpf.util.TenantProvider; +import jnpf.util.UserProvider; +import jnpf.util.LoginHolder; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Map; + +/** + * 登录与退出服务 其他服务调用 + */ +@Service +public class AuthServiceImpl implements AuthService { + + @Autowired + private TokenGranterBuilder tokenGranterBuilder; + + /** + * 登录 + * @param parameters {grant_type} + * @return + * @throws LoginException + */ + @Override + public ActionResult login(Map parameters) throws LoginException{ + TokenGranter tokenGranter = tokenGranterBuilder.getGranter(parameters.getOrDefault("grant_type", "")); + ActionResult result; + try { + result = tokenGranter.granter(parameters); + }catch (Exception e){ + if(!(e instanceof LoginException)){ + String msg = e.getMessage(); + if(msg == null){ + msg = "登录异常"; + } + throw new LoginException(msg); + } + throw e; + }finally{ + LoginHolder.clearUserEntity(); + TenantProvider.clearBaseSystemIfo(); + } + return result; + } + + + /** + * 踢出用户, 用户将收到Websocket下线通知 + * 执行流程:认证服务退出用户->用户踢出监听->消息服务发送Websocket推送退出消息 + * @param tokens + */ + @Override + public ActionResult kickoutByToken(String... tokens){ + UserProvider.kickoutByToken(tokens); + return ActionResult.success(); + } + + /** + * 踢出用户, 用户将收到Websocket下线通知 + * 执行流程:认证服务退出用户->用户踢出监听->消息服务发送Websocket推送退出消息 + * @param userId + * @param tenantId + */ + @Override + public ActionResult kickoutByUserId(String userId, String tenantId){ + UserProvider.kickoutByUserId(userId, tenantId); + return ActionResult.success(); + } +} diff --git a/jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/src/main/java/jnpf/service/impl/LoginServiceImpl.java b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/src/main/java/jnpf/service/impl/LoginServiceImpl.java new file mode 100644 index 0000000..6472007 --- /dev/null +++ b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/src/main/java/jnpf/service/impl/LoginServiceImpl.java @@ -0,0 +1,867 @@ +package jnpf.service.impl; + +import cn.hutool.core.util.BooleanUtil; +import com.alibaba.fastjson.JSONObject; +import jnpf.base.UserInfo; +import jnpf.base.entity.*; +import jnpf.base.model.base.SystemBaeModel; +import jnpf.base.model.button.ButtonModel; +import jnpf.base.model.column.ColumnModel; +import jnpf.base.model.form.ModuleFormModel; +import jnpf.base.model.module.ModuleModel; +import jnpf.base.model.resource.ResourceModel; +import jnpf.base.service.*; +import jnpf.config.ConfigValueUtil; +import jnpf.constant.JnpfConst; +import jnpf.constant.MsgCode; +import jnpf.constant.PermissionConst; +import jnpf.database.util.TenantDataSourceUtil; +import jnpf.message.entity.MessageTemplateConfigEntity; +import jnpf.message.service.MessageService; +import jnpf.message.service.MessageTemplateConfigService; +import jnpf.model.BaseSystemInfo; +import jnpf.model.BuildUserCommonInfoModel; +import jnpf.permission.entity.SignEntity; +import jnpf.portal.constant.PortalConst; +import jnpf.portal.service.PortalDataService; +import jnpf.util.data.DataSourceContextHolder; +import jnpf.database.model.TenantVO; +import jnpf.exception.LoginException; +import jnpf.granter.UserDetailsServiceBuilder; +import jnpf.model.login.*; +import jnpf.permission.entity.*; +import jnpf.permission.model.authorize.AuthorizeVO; +import jnpf.permission.service.*; +import jnpf.permissions.PermissionInterfaceImpl; +import jnpf.portal.service.PortalService; +import jnpf.service.LoginService; +import jnpf.util.*; +import jnpf.util.treeutil.ListToTreeUtil; +import jnpf.util.treeutil.SumTree; +import jnpf.util.treeutil.newtreeutil.TreeDotUtils; +import jnpf.util.LoginHolder; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/3/16 + */ +@Slf4j +@Service +public class LoginServiceImpl implements LoginService { + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private UserProvider userProvider; + @Autowired + private UserService userApi; + @Autowired + private UserRelationService userRelationApi; + @Autowired + private OrganizeService organizeApi; + @Autowired + private PositionService positionApi; + @Autowired + private RoleService roleApi; + @Autowired + private GroupService groupApi; + @Autowired + private AuthorizeService authorizeApi; + @Autowired + private SysconfigService sysconfigApi; + @Autowired + private PortalService portalApi; + @Autowired + private PortalDataService portalDataService; + @Autowired + private RedisUtil redisUtil; + @Autowired + private CacheKeyUtil cacheKeyUtil; + @Autowired + private OrganizeRelationService organizeRelationApi; + @Autowired + private SystemService systemApi; + @Autowired + private UserDetailsServiceBuilder userDetailsServiceBuilder; + @Autowired + private SignService signService; + @Autowired + private MessageTemplateConfigService messageTemplateApi; + @Autowired + private MessageService sentMessageApi; + @Autowired + private OrganizeAdministratorService organizeAdminTratorApi; + @Autowired + private ModuleService moduleApi; + @Autowired + private PermissionGroupService permissionGroupApi; + @Autowired + private ModuleButtonService buttonApi; + @Autowired + private ModuleColumnService columnApi; + @Autowired + private ModuleFormService formApi; + @Autowired + private ModuleDataAuthorizeSchemeService dataAuthorizeSchemeApi; + + + + @Override + public UserInfo getTenantAccount(UserInfo userInfo) throws LoginException { + String tenantId = ""; + if (configValueUtil.isMultiTenancy()) { + String[] tenantAccount = userInfo.getUserAccount().split("\\@"); + tenantId = tenantAccount.length == 1 ? userInfo.getUserAccount() : tenantAccount[0]; + userInfo.setUserAccount(tenantAccount.length == 1 ? "admin" : tenantAccount[1]); + if (tenantAccount.length > 2 || StringUtil.isEmpty(tenantId) || StringUtil.isEmpty(userInfo.getUserAccount())) { + throw new LoginException(MsgCode.LOG102.get()); + } + TenantVO tenantVO = TenantDataSourceUtil.getRemoteTenantInfo(tenantId); + TenantDataSourceUtil.switchTenant(tenantId, tenantVO); + //切换成租户库 + userInfo.setTenantId(tenantId); + userInfo.setTenantDbConnectionString(DataSourceContextHolder.getDatasourceName()); + userInfo.setAssignDataSource(DataSourceContextHolder.isAssignDataSource()); + //查库测试 + BaseSystemInfo baseSystemInfo = null; + try { + baseSystemInfo = getBaseSystemConfig(userInfo.getTenantId(), userInfo.getTenantDbConnectionString(), userInfo.isAssignDataSource()); + }catch (Exception e) { + log.error("登录获取系统配置失败: {}", e.getMessage()); + } + if(baseSystemInfo == null || baseSystemInfo.getSingleLogin() == null) { + if (configValueUtil.getMultiTenancyUrl().contains("https")) { + throw new LoginException("租户登录失败,请用手机验证码登录"); + } else { + throw new LoginException("数据库异常,请联系管理员处理"); + } + } + } + return userInfo; + } + + @Override + public UserInfo userInfo(UserInfo userInfo, BaseSystemInfo sysConfigInfo) throws LoginException { + //获取账号信息 + UserEntity userEntity = LoginHolder.getUserEntity(); + if(userEntity == null){ + userEntity = userDetailsServiceBuilder.getUserDetailService(userInfo.getUserDetailKey()).loadUserEntity(userInfo); + LoginHolder.setUserEntity(userEntity); + } + + checkUser(userEntity, userInfo, sysConfigInfo); + + userInfo.setIsAdministrator(BooleanUtil.toBoolean(String.valueOf(userEntity.getIsAdministrator()))); + userInfo.setUserId(userEntity.getId()); + userInfo.setUserAccount(userEntity.getAccount()); + userInfo.setUserName(userEntity.getRealName()); + userInfo.setUserIcon(userEntity.getHeadIcon()); + userInfo.setTheme(userEntity.getTheme()); + userInfo.setOrganizeId(userEntity.getOrganizeId()); + userInfo.setPortalId(userEntity.getPortalId()); + userInfo.setIsAdministrator(BooleanUtil.toBoolean(String.valueOf((userEntity.getIsAdministrator())))); + + // 添加过期时间 + String time = sysConfigInfo.getTokenTimeout(); + if (StringUtil.isNotEmpty(time)) { + Integer minu = Integer.valueOf(time); + userInfo.setOverdueTime(DateUtil.dateAddMinutes(null, minu)); + userInfo.setTokenTimeout(minu); + } + + userInfo.setLoginIpAddress(IpUtil.getIpAddr()); + userInfo.setLoginTime(DateUtil.getmmNow()); + userInfo.setLoginPlatForm(ServletUtil.getUserAgent()); + userInfo.setPrevLoginTime(userEntity.getPrevLogTime()); + userInfo.setPrevLoginIpAddress(userEntity.getPrevLogIp()); + userInfo.setPrevLoginIpAddressName(IpUtil.getIpCity(userEntity.getPrevLogIp())); + // 生成id + String token = RandomUtil.uuId(); + userInfo.setId(cacheKeyUtil.getLoginToken(userInfo.getTenantId()) + token); + + createUserOnline(userInfo); + return userInfo; + } + + @Override + public void updatePasswordMessage(){ + UserInfo userInfo = userProvider.get(); + UserEntity userEntity = userApi.getInfo(userInfo.getUserId()); + BaseSystemInfo baseSystemInfo = sysconfigApi.getSysInfo(); + if(baseSystemInfo.getPasswordIsUpdatedRegularly()==1){ + Date changePasswordDate = userEntity.getCreatorTime(); + if(userEntity.getChangePasswordDate()!=null){ + changePasswordDate = userEntity.getChangePasswordDate(); + } + //当前时间 + Date nowDate = DateUtil.getNowDate(); + //更新周期 + Integer updateCycle = baseSystemInfo.getUpdateCycle(); + //提前N天提醒 + Integer updateInAdvance = baseSystemInfo.getUpdateInAdvance(); + Integer day = DateUtil.getDiffDays(changePasswordDate,nowDate); + if(day>=(updateCycle-updateInAdvance)){ + MessageTemplateConfigEntity entity = messageTemplateApi.getInfoByEnCode("XTXXTX001","1"); + if(entity != null) { + List toUserIds = new ArrayList<>(); + toUserIds.add(userInfo.getUserId()); + sentMessageApi.sentMessage(toUserIds, entity.getTitle(), entity.getContent(), userInfo, Integer.parseInt(entity.getMessageSource()), Integer.parseInt(entity.getMessageType())); + } + } + } + } + + /** + * 创建用户在线信息 + * @param userInfo + */ + private void createUserOnline(UserInfo userInfo){ + String userId = userInfo.getUserId(); +// long time= DateUtil.getTime(userInfo.getOverdueTime()) - DateUtil.getTime(new Date()); + + String authorize = String.valueOf(redisUtil.getString(cacheKeyUtil.getUserAuthorize() + userId)); +// String loginOnlineKey=cacheKeyUtil.getLoginOnline() + userId; + redisUtil.remove(authorize); + //记录Token +// redisUtil.insert(userInfo.getId(), userInfo,time); + //记录在线 + if (ServletUtil.getIsMobileDevice()) { +// redisUtil.insert(cacheKeyUtil.getMobileLoginOnline() + userId, userInfo.getId(), time); + //记录移动设备CID,用于消息推送 + if (ServletUtil.getHeader("clientId") != null) { + String clientId = ServletUtil.getHeader("clientId"); + Map map = new HashMap<>(16); + map.put(userInfo.getUserId(), clientId); + redisUtil.insert(cacheKeyUtil.getMobileDeviceList(), map); + } + } else { +// redisUtil.insert(loginOnlineKey, userInfo.getId(), time); + } + } + + private UserCommonInfoVO data(BuildUserCommonInfoModel buildUserCommonInfoModel) { + UserInfo userInfo = buildUserCommonInfoModel.getUserInfo(); + //公司Id + List list = organizeApi.getList(false); + UserEntity userEntity = buildUserCommonInfoModel.getUserEntity(); + userInfo.setManagerId(userInfo.getManagerId()); + boolean b = userInfo.getIsAdministrator(); + if (StringUtil.isEmpty(userEntity.getSystemId())) { + SystemEntity systemEntity = buildUserCommonInfoModel.getMainSystemEntity(); + userInfo.setSystemId(systemEntity.getId()); + userEntity.setSystemId(systemEntity.getId()); + } + if (StringUtil.isEmpty(userEntity.getAppSystemId())) { + SystemEntity systemEntity = buildUserCommonInfoModel.getWorkSystemEntity(); + userInfo.setAppSystemId(systemEntity.getId()); + userEntity.setAppSystemId(systemEntity.getId()); + } + this.userInfo(userInfo, userInfo.getUserId(), b, userEntity); + userInfo.setSubOrganizeIds(this.getSubOrganizeIds(list, userInfo.getOrganizeId(), b)); + List subordinateIdsList = userApi.getListByManagerId(userInfo.getUserId(), null).stream().map(UserEntity::getId).collect(Collectors.toList()); + userInfo.setSubordinateIds(subordinateIdsList); + userInfo.setLoginTime(DateUtil.getmmNow()); + userInfo.setLoginPlatForm(ServletUtil.getUserAgent()); +// if (StringUtil.isNotEmpty(userInfo.getId())) { +// redisUtil.insert(userInfo.getId(), userInfo, DateUtil.getTime(userInfo.getOverdueTime()) - DateUtil.getTime(new Date())); +// } + BaseSystemInfo baseSystemInfo = buildUserCommonInfoModel.getBaseSystemInfo(); + UserCommonInfoVO infoVO = JsonUtil.getJsonToBean(genUserInfo(userInfo, baseSystemInfo), UserCommonInfoVO.class); + infoVO.setGroupIds(userInfo.getGroupIds()); + infoVO.setGroupNames(userInfo.getGroupNames()); + // 角色数组 + infoVO.setRoleIds(userInfo.getRoleIds()); + //最后一次修改密码时间 + infoVO.setChangePasswordDate(userEntity.getChangePasswordDate()); + // 角色名称 + StringBuilder roleName = new StringBuilder(); + for (RoleEntity entity : roleApi.getListByIds(userInfo.getRoleIds(), null, false)) { + roleName.append("," + entity.getFullName()); + } + if (roleName.length() > 0) { + infoVO.setRoleName(roleName.toString().replaceFirst(",", "")); + } + // 主管 + UserEntity info = userApi.getInfo(userEntity.getManagerId()); + if (info != null) { + infoVO.setManager(info.getRealName() + "/" + info.getAccount()); + } + // 手机 + infoVO.setMobilePhone(userEntity.getMobilePhone()); + // 邮箱 + infoVO.setEmail(userEntity.getEmail()); + // 生日 + infoVO.setBirthday(userEntity.getBirthday() != null ? userEntity.getBirthday().getTime() : null); + // 姓名 + infoVO.setUserName(userEntity.getRealName()); + //组织 + OrganizeEntity organizeEntity = organizeApi.getInfo(userInfo.getOrganizeId()); + String organizeName = null; + String departmentId = null; + String departmentName = null; + List departmentIdList = null; + String organizeId = null; + if (organizeEntity != null) { + if (PermissionConst.DEPARTMENT.equals(organizeEntity.getCategory())) { + organizeName = organizeEntity.getFullName(); + organizeId = organizeEntity.getId(); + } + if (StringUtil.isNotEmpty(organizeEntity.getOrganizeIdTree())) { + String[] split = organizeEntity.getOrganizeIdTree().split(","); + departmentId = split.length > 0 ? split[split.length - 1] : ""; + departmentIdList = split.length > 0 ? Arrays.asList(split) : new ArrayList(); + departmentName = organizeApi.getFullNameByOrgIdTree(organizeEntity.getOrganizeIdTree(), "/"); + } + } + infoVO.setOrganizeName(departmentName); + infoVO.setOrganizeId(departmentId); + infoVO.setOrganizeIdList(departmentIdList == null?new ArrayList():departmentIdList); + // 部门id + infoVO.setDepartmentId(organizeId); + // 部门名称 + infoVO.setDepartmentName(organizeName); + infoVO.setIsAdministrator(BooleanUtil.toBoolean(String.valueOf(userEntity.getIsAdministrator()))); + + return infoVO; + } + + public UserEntity checkUser(UserEntity userEntity, UserInfo userInfo, BaseSystemInfo sysConfigInfo) throws LoginException { + if (userEntity == null) { + throw new LoginException(MsgCode.LOG003.get()); + } + //判断是否组织、岗位、角色、部门主管是否为空,为空则抛出异常 + //判断是否为管理员,是否为Admin(Admin为最高账号,不受限制) + if (!"admin".equals(userEntity.getAccount()) || userEntity.getIsAdministrator() != 1) { + //组织id为空则直接抛出异常 + if (StringUtil.isEmpty(userEntity.getOrganizeId())) { + throw new LoginException(MsgCode.LOG004.get()); + } + } + if (userEntity.getIsAdministrator() == 0) { + if (userEntity.getEnabledMark() == null) { + throw new LoginException(MsgCode.LOG005.get()); + } + if (userEntity.getEnabledMark() == 0) { + throw new LoginException(MsgCode.LOG006.get()); + } + } + if (userEntity.getDeleteMark() != null && userEntity.getDeleteMark() == 1) { + throw new LoginException(MsgCode.LOG007.get()); + } + //安全验证 + String ipAddr = IpUtil.getIpAddr(); + userInfo.setLoginIpAddress(IpUtil.getIpAddr()); + // 判断白名单 + if (!"admin".equals(userEntity.getAccount()) && "1".equals(sysConfigInfo.getWhitelistSwitch())) { + List ipList = Arrays.asList(sysConfigInfo.getWhitelistIp().split(",")); + if (!ipList.contains(ipAddr)) { + throw new LoginException(MsgCode.LOG010.get()); + } + } + //判断用户所属的角色是否被禁用 + //判断用户所属的角色是否被禁用 + if (userEntity.getIsAdministrator() == 0 && organizeAdminTratorApi.getOrganizeAdministratorEntity(userEntity.getId(), PermissionConst.SYSTEM, false).size() == 0 + && organizeAdminTratorApi.getOrganizeAdministratorEntity(userEntity.getId(), PermissionConst.MODULE, false).size() == 0 + ) { + List permissionGroupByUserIdAndTenantId = permissionGroupApi.getPermissionGroupByUserId(userEntity.getId(), null, false); + if (permissionGroupByUserIdAndTenantId.size() == 0) { + throw new LoginException("该用户未分配权限!"); + } + // 如果只有组织权限的话就切换到有权限的组织 + String organizeIdByUserIdAndTenantId = permissionGroupApi.getPermissionGroupByUserId(userEntity.getId()); + if (StringUtil.isNotEmpty(organizeIdByUserIdAndTenantId)) { + userEntity.setOrganizeId(organizeIdByUserIdAndTenantId); + } + } + // 判断当前账号是否被锁定 + Integer lockMark = userEntity.getEnabledMark(); + if (Objects.nonNull(lockMark) && lockMark == 2) { + // 获取解锁时间 + Date unlockTime = userEntity.getUnlockTime(); + // 账号锁定 + if (sysConfigInfo.getLockType() == 1 || Objects.isNull(unlockTime)) { + throw new LoginException(MsgCode.LOG012.get()); + } + // 延迟登陆锁定 + long millis = System.currentTimeMillis(); + // 系统设置的错误次数 + int passwordErrorsNumber = sysConfigInfo.getPasswordErrorsNumber() != null ? sysConfigInfo.getPasswordErrorsNumber() : 0; + // 用户登录错误次数 + int logErrorCount = userEntity.getLogErrorCount() != null ? userEntity.getLogErrorCount() : 0; + if (unlockTime.getTime() > millis) { + // 转成分钟 + int time = (int) ((unlockTime.getTime() - millis) / (1000 * 60)); + throw new LoginException(MsgCode.LOG013.get().replace("{time}", Integer.toString(time + 1))); + } else if (unlockTime.getTime() < millis && logErrorCount >= passwordErrorsNumber){ + // 已经接触错误时间锁定的话就重置错误次数 + userEntity.setLogErrorCount(0); + userEntity.setEnabledMark(1); + userApi.updateById(userEntity); + } + } + return userEntity; + } + + /** + * 获取用户登陆信息 + * + * @return + */ + @Override + public PcUserVO getCurrentUser(String type) { + UserInfo userInfo = userProvider.get(); + + SystemEntity mainSystemEntity = systemApi.getInfoByEnCode(JnpfConst.MAIN_SYSTEM_CODE); + SystemEntity workSystemEntity = systemApi.getInfoByEnCode(JnpfConst.WORK_SYSTEM_CODE); + UserEntity userEntity = userApi.getInfo(userInfo.getUserId()); + BaseSystemInfo baseSystemInfo = sysconfigApi.getSysInfo(); + + BuildUserCommonInfoModel buildUserCommonInfoModel = new BuildUserCommonInfoModel(userInfo, mainSystemEntity, workSystemEntity, userEntity, baseSystemInfo); + UserCommonInfoVO infoVO = this.data(buildUserCommonInfoModel); + AuthorizeVO authorizeModel = authorizeApi.getAuthorize(false, true); + // 从分级管理中取系统 + List listByUserId = organizeAdminTratorApi.getOrganizeAdministratorEntity(userInfo.getUserId(), PermissionConst.SYSTEM, false); + List systemEntities = systemApi.getListByIds(listByUserId.stream().map(OrganizeAdministratorEntity::getOrganizeId).collect(Collectors.toList())); + List systemJsonToList = JsonUtil.getJsonToList(systemEntities, SystemBaeModel.class); + List systemList = authorizeModel.getSystemList(); + systemList.addAll(systemJsonToList); + systemList = systemList.stream().distinct().collect(Collectors.toList()); + + // 从分管中获取菜单 + List listByUserId1 = organizeAdminTratorApi.getOrganizeAdministratorEntity(userInfo.getUserId(), PermissionConst.MODULE, false); + List moduleEntities = moduleApi.getModuleByIds(listByUserId1.stream().map(OrganizeAdministratorEntity::getOrganizeId).collect(Collectors.toList())); + if ("App".equals(type)) { + moduleEntities = moduleEntities.stream().filter(t -> !mainSystemEntity.getId().equals(t.getSystemId())).collect(Collectors.toList()); + systemList = systemList.stream().filter(t -> !mainSystemEntity.getId().equals(t.getId())).collect(Collectors.toList()); + } else { + if (moduleEntities.size() > 0) { + SystemBaeModel systemBaeModel = JsonUtil.getJsonToBean(mainSystemEntity, SystemBaeModel.class); + systemList.add(systemBaeModel); + systemList = systemList.stream().distinct().collect(Collectors.toList()); + } + } + + // 分级管理的系统直接拥有菜单权限 + List systemIds = systemJsonToList.stream().map(SystemBaeModel::getId).collect(Collectors.toList()); + systemIds.remove(mainSystemEntity.getId()); + List moduleBySystemIds = moduleApi.getModuleBySystemIds(systemJsonToList.stream().map(SystemBaeModel::getId).collect(Collectors.toList())); + moduleEntities.addAll(moduleBySystemIds); + + + List moduleJsonToList = JsonUtil.getJsonToList(moduleEntities, ModuleModel.class); + + // 获取菜单权限 + List moduleList = authorizeModel.getModuleList(); + moduleList.addAll(moduleJsonToList); + moduleList = moduleList.stream().distinct().collect(Collectors.toList()); + + authorizeModel.setModuleList(moduleList); + List moduleList1 = new ArrayList<>(); + List menuList = moduleList.stream().filter(t -> type.equals(t.getCategory())).sorted(Comparator.comparing(ModuleModel::getSortCode)).collect(Collectors.toList()); + + if ("App".equals(type)) { + if (menuList.stream().noneMatch(t -> userEntity.getAppSystemId().equals(t.getSystemId()))) { + if (menuList.size() > 0) { + userEntity.setAppSystemId(menuList.get(0).getSystemId()); + userInfo.setAppSystemId(menuList.get(0).getSystemId()); + userApi.updateById(userEntity); + } + } + } else { + if (systemList.stream().noneMatch(t -> userEntity.getSystemId().equals(t.getId()))) { + if (systemList.size() > 0) { + userEntity.setSystemId(systemList.get(0).getId()); + userInfo.setSystemId(systemList.get(0).getId()); + userApi.updateById(userEntity); + } + } + } + +// if (!mainSystemEntity.getId().equals(userInfo.getSystemId())) { + List moduleByIds = moduleApi.getListByEnCode(JnpfConst.MODULE_CODE); + if ("App".equals(type)) { + moduleByIds.forEach(moduleEntity -> { + moduleEntity.setSystemId(userEntity.getAppSystemId()); + moduleEntity.setSortCode(-1L); + }); + } else { + moduleByIds.forEach(moduleEntity -> { + moduleEntity.setSystemId(userEntity.getSystemId()); + moduleEntity.setSortCode(-1L); + }); + } + List jsonToList = JsonUtil.getJsonToList(moduleByIds, ModuleModel.class); + moduleList1.addAll(jsonToList); +// } + moduleList1.addAll(moduleList); + // 设置系统模型 + List jsonToList1 = new ArrayList<>(); + systemList.forEach(t -> { + UserSystemVO systemVO = new UserSystemVO(); + systemVO.setId(t.getId()); + systemVO.setName(t.getFullName()); + systemVO.setIcon(t.getIcon()); + if ("App".equals(type) && userInfo.getAppSystemId().equals(t.getId())) { + systemVO.setCurrentSystem(true); + } else if ("Web".equals(type) && userInfo.getSystemId().equals(t.getId())) { + systemVO.setCurrentSystem(true); + } + jsonToList1.add(systemVO); + }); + infoVO.setSystemIds(jsonToList1); + userInfo.setSystemIds(systemList.stream().map(SystemBaeModel::getId).collect(Collectors.toList())); + if (StringUtil.isNotEmpty(userInfo.getId())) { + UserProvider.setLoginUser(userInfo); + UserProvider.setLocalLoginUser(userInfo); + } + + //岗位 + List posiList = Arrays.asList(userInfo.getPositionIds()); + List positionList = positionApi.getPositionName(posiList, false); + List positionVO = new ArrayList<>(); + for (PositionEntity positionEntity : positionList) { + UserPositionVO userPositionVO = new UserPositionVO(); + userPositionVO.setName(positionEntity.getFullName()); + userPositionVO.setId(positionEntity.getId()); + positionVO.add(userPositionVO); + } + List models = new ArrayList<>(); + + // 按钮等权限增加分级管理的 + // 按钮 + List buttonList = authorizeModel.getButtonList(); + List buttonByModuleId = buttonApi.getList(moduleJsonToList.stream().map(ModuleModel::getId).collect(Collectors.toList())); + List buttonJsonToList = JsonUtil.getJsonToList(buttonByModuleId, ButtonModel.class); + buttonList.addAll(buttonJsonToList); + buttonList = buttonList.stream().distinct().collect(Collectors.toList()); + // 列表 + List columnList = authorizeModel.getColumnList(); + List columnByModuleId = columnApi.getListByModuleId(moduleJsonToList.stream().map(ModuleModel::getId).collect(Collectors.toList())); + List columnJsonToList = JsonUtil.getJsonToList(columnByModuleId, ColumnModel.class); + columnList.addAll(columnJsonToList); + columnList = columnList.stream().distinct().collect(Collectors.toList()); + // 表单 + List formsList = authorizeModel.getFormsList(); + List formByModuleId = formApi.getListByModuleId(moduleJsonToList.stream().map(ModuleModel::getId).collect(Collectors.toList())); + List formJsonToList = JsonUtil.getJsonToList(formByModuleId, ModuleFormModel.class); + formsList.addAll(formJsonToList); + formsList = formsList.stream().distinct().collect(Collectors.toList()); + // 数据 + List resourceList = authorizeModel.getResourceList(); + List resourceByModuleId = dataAuthorizeSchemeApi.getListByModuleId(moduleJsonToList.stream().map(ModuleModel::getId).collect(Collectors.toList())); + List resourceJsonToList = JsonUtil.getJsonToList(resourceByModuleId, ResourceModel.class); + resourceList.addAll(resourceJsonToList); + resourceList = resourceList.stream().distinct().collect(Collectors.toList()); + authorizeModel.setButtonList(buttonList); + authorizeModel.setColumnList(columnList); + authorizeModel.setFormsList(formsList); + authorizeModel.setResourceList(resourceList); + for (ModuleModel moduleModel : menuList) { + PermissionModel model = new PermissionModel(); + model.setModelId(moduleModel.getId()); + model.setModuleName(moduleModel.getFullName()); + + List buttonModels = authorizeModel.getButtonList().stream().filter(t -> moduleModel.getId().equals(t.getModuleId())).collect(Collectors.toList()); + List columnModels = authorizeModel.getColumnList().stream().filter(t -> moduleModel.getId().equals(t.getModuleId())).collect(Collectors.toList()); + List resourceModels = authorizeModel.getResourceList().stream().filter(t -> moduleModel.getId().equals(t.getModuleId())).collect(Collectors.toList()); + List moduleFormModels = authorizeModel.getFormsList().stream().filter(t -> moduleModel.getId().equals(t.getModuleId())).collect(Collectors.toList()); + model.setButton(JsonUtil.getJsonToList(buttonModels, PermissionVO.class)); + model.setColumn(JsonUtil.getJsonToList(columnModels, PermissionVO.class)); + model.setResource(JsonUtil.getJsonToList(resourceModels, PermissionVO.class)); + model.setForm(JsonUtil.getJsonToList(moduleFormModels, PermissionVO.class)); + if (moduleModel.getType() != 1) { + models.add(model); + } + } + //初始化接口权限 + if(configValueUtil.isEnablePreAuth()) { + initSecurityAuthorities(authorizeModel, userInfo, baseSystemInfo); + } + + if (userEntity != null) { + // 门户Web + try{ + String defaultPortalId = portalDataService.getCurrentDefault(PortalConst.WEB); + infoVO.setPortalId(defaultPortalId); + }catch (Exception e){ + infoVO.setPortalId(""); + e.printStackTrace(); + } + // 门户App + try{ + String defaultAppPortalId = portalDataService.getCurrentDefault(PortalConst.APP); + infoVO.setAppPortalId(defaultAppPortalId); + }catch (Exception e){ + infoVO.setAppPortalId(""); + e.printStackTrace(); + } + // 岗位 + List relationList = userRelationApi.getListByUserId(userEntity.getId(), PermissionConst.POSITION); + List positionIds = relationList.stream().map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + List positionName = positionApi.getPositionName(positionIds, false).stream().filter(t -> t.getEnabledMark() != null && t.getEnabledMark() == 1).collect(Collectors.toList()); + List positionIdVO = new ArrayList<>(); + positionName.forEach(t -> { + if (!t.getOrganizeId().equals(userEntity.getOrganizeId())) { + return; + } + UserPositionVO userPositionVO = new UserPositionVO(); + userPositionVO.setId(t.getId()); + userPositionVO.setName(t.getFullName()); + positionIdVO.add(userPositionVO); + }); + infoVO.setPositionIds(positionIdVO); + PositionEntity positionEntity = positionName.stream().filter(t -> t.getId().equals(userEntity.getPositionId())).findFirst().orElse(null); + infoVO.setPositionId(positionEntity != null ? positionEntity.getId() : ""); + infoVO.setPositionName(positionEntity != null ? positionEntity.getFullName() : ""); + // 获取签名信息 + SignEntity signEntity = signService.getDefaultByUserId(userEntity.getId()); + infoVO.setSignImg(signEntity != null ? signEntity.getSignImg() : ""); + } + infoVO.setSystemId(userInfo.getSystemId()); + infoVO.setAppSystemId(userInfo.getAppSystemId()); + + SystemInfo jsonToBean = JsonUtil.getJsonToBean(baseSystemInfo, SystemInfo.class); + + // 构建菜单树 + List menuSelectVOS = buildModule(systemList, moduleList1, type); + + List children = new ArrayList<>(); + UserSystemVO currentSystem = jsonToList1.stream().filter(UserSystemVO::isCurrentSystem).findFirst().orElse(null); + if (currentSystem != null) { + AllMenuSelectVO allMenuSelectVO = menuSelectVOS.stream().filter(t -> currentSystem.getId().equals(t.getId())).findFirst().orElse(null); + if (allMenuSelectVO != null && allMenuSelectVO.getChildren() != null) { + children = allMenuSelectVO.getChildren(); + children.forEach(t -> t.setParentId("-1")); + } + } + SystemEntity systemEntity = systemEntities.stream().filter(t -> userInfo.getSystemId().equals(t.getId())).findFirst().orElse(null); + if (systemEntity != null +// && systemEntity.getIsMain() != null && systemEntity.getIsMain() != 1 + ) { + jsonToBean.setNavigationIcon(systemEntity.getNavigationIcon()); + jsonToBean.setWorkLogoIcon(systemEntity.getWorkLogoIcon()); + } + PcUserVO userVO = new PcUserVO(children, models, infoVO, jsonToBean, menuSelectVOS); +// userVO.setMenuList(menuList); +// userVO.setPermissionList(models); + userVO.getUserInfo().setHeadIcon(UploaderUtil.uploaderImg(userInfo.getUserIcon())); + return userVO; + } + + @Override + public BaseSystemInfo getBaseSystemConfig(String tenantId, String tenantDb, boolean isAssignDataSource) { + if(tenantId != null && tenantDb != null){ + DataSourceContextHolder.setDatasource(tenantId, tenantDb, isAssignDataSource); + } + return sysconfigApi.getSysInfo(); + } + + private List buildModule(List systemList, List moduleList, String type) { + // 获取所有菜单树(区分Web、APP) + moduleList = moduleList.stream().filter(t -> type.equals(t.getCategory())).sorted(Comparator.comparing(ModuleModel::getSortCode)).collect(Collectors.toList()); + List list = JsonUtil.getJsonToList(moduleList, AllUserMenuModel.class); + list.forEach(t -> { + if ("-1".equals(t.getParentId())) { + t.setParentId(t.getSystemId()); + } + }); + List jsonToList = JsonUtil.getJsonToList(systemList, AllUserMenuModel.class); + jsonToList.forEach(t -> { + t.setType(0); + t.setParentId("-1"); + }); + list.addAll(jsonToList); + List> menuList = TreeDotUtils.convertListToTreeDotFilter(list); + List menuvo = JsonUtil.getJsonToList(menuList, AllMenuSelectVO.class); + return menuvo; + } + + /** + * 初始化接口鉴权用的账号权限 + * 本接口插入权限缓存, SaInterfaceImpl中框架鉴权时动态调用获取权限列表 + * @param authorizeModel + * @param userInfo + */ + private void initSecurityAuthorities(AuthorizeVO authorizeModel, UserInfo userInfo, BaseSystemInfo systemInfo){ + //接口权限 + Set authorityList = new HashSet<>(); + Map moduleModelMap = authorizeModel.getModuleList().stream().filter(m->{ + //添加菜单权限 + authorityList.add(m.getEnCode()); + return true; + }).collect(Collectors.toMap(m->m.getId(), m->m)); + for (ModuleModel moduleModel : authorizeModel.getModuleList()) { + String permissionKey = moduleModel.getEnCode(); + authorityList.add(permissionKey); + //功能菜单 + if(moduleModel.getType() == 3){ + JSONObject propertyJSON = JSONObject.parseObject(Optional.of(moduleModel.getPropertyJson()).orElse("{}")); + //{"iconBackgroundColor":"","isTree":0,"moduleId":"395851986114733317"} + String moduleId = propertyJSON.getString("moduleId"); + if(!StringUtil.isEmpty(moduleId)){ + authorityList.add(moduleId); + } + } + } + + authorizeModel.getButtonList().stream().forEach(t -> { + ModuleModel m = moduleModelMap.get(t.getModuleId()); + if(m != null){ + authorityList.add(m.getEnCode() + "::" + t.getEnCode()); + } + }); + authorizeModel.getColumnList().stream().forEach(t -> { + ModuleModel m = moduleModelMap.get(t.getModuleId()); + if(m != null){ + authorityList.add(m.getEnCode() + "::" + t.getEnCode()); + } + }); + authorizeModel.getFormsList().stream().forEach(t -> { + ModuleModel m = moduleModelMap.get(t.getModuleId()); + if(m != null){ + authorityList.add(m.getEnCode() + "::" + t.getEnCode()); + } + }); + + //管理员都是用同一个缓存, 普通账号使用账号名, + //权限列表:authorize_:租户_authorize_authorize_(admin|账号) + //角色列表:authorize_:租户_authorize_role_(admin|账号) + String authorityKey = CacheKeyUtil.USERAUTHORIZE + ":" + cacheKeyUtil.getUserAuthorize() + "authority_" + (userInfo.getIsAdministrator()?"admin":userInfo.getUserAccount()); + String account = userInfo.getUserId(); + PermissionInterfaceImpl.setAuthorityList(account, authorityList, systemInfo); + if (userInfo.getRoleIds() != null && !userInfo.getRoleIds().isEmpty() || userInfo.getIsAdministrator()) { + String rolesKey = CacheKeyUtil.USERAUTHORIZE + ":" + cacheKeyUtil.getUserAuthorize() + "role_" + (userInfo.getIsAdministrator()?"admin":userInfo.getUserAccount()); + List roles; + if(userInfo.getIsAdministrator()){ + roles = roleApi.getList(false); + }else{ + roles = roleApi.getListByIds(userInfo.getRoleIds(), null, false); + } + Set roleAuthorityList = roles.stream().filter(r->r.getEnabledMark().equals(1)).map(r -> "ROLE_" + r.getEnCode()).collect(Collectors.toSet()); + PermissionInterfaceImpl.setRoleList(account, roleAuthorityList, systemInfo); + } + } + + /** + * 获取下属机构 + * + * @param data + * @param organizeId + * @param isAdmin + * @return + */ + private String[] getSubOrganizeIds(List data, String organizeId, boolean isAdmin) { + if (!isAdmin) { + data = JsonUtil.getJsonToList(ListToTreeUtil.treeWhere(organizeId, data), OrganizeEntity.class); + } + List list = data.stream().map(SuperBaseEntity.SuperIBaseEntity::getId).collect(Collectors.toList()); + return list.toArray(new String[list.size()]); + } + + /** + * 赋值 + * + * @param userInfo + * @param userId + * @param isAdmin + */ + private void userInfo(UserInfo userInfo, String userId, boolean isAdmin, UserEntity userEntity) { + // 得到用户和组织的关系 + List data = userRelationApi.getListByUserIdAndObjType(userId, PermissionConst.ORGANIZE); + // 组织id + String organizeId = ""; + String departmentId = ""; + List roleId = new ArrayList<>(); + // 判断当前组织是否有权限 + if(organizeRelationApi.checkBasePermission(userEntity.getId(), userEntity.getOrganizeId()).size() == 0) { + if (data.size() > 0) { + // 得到组织id + organizeId = organizeRelationApi.autoGetMajorOrganizeId(userId, data.stream().map(UserRelationEntity::getObjectId).collect(Collectors.toList()), userEntity.getOrganizeId()); + } + } else { + // 如果有权限 + organizeId = userEntity.getOrganizeId(); +// if (isAdmin) { +// roleId = data.stream().map(t -> t.getObjectId()).collect(Collectors.toList()); +// } + } + // 获取用户的角色 + List listByObjectId = userRelationApi.getListByUserId(userInfo.getUserId(), PermissionConst.ROLE); + // 判断哪个角色是当前组织下的 + List collect = listByObjectId.stream().map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + // 如果有全局的角色则先赋值给权限集合 + for (String roleIds : collect) { + // 得到角色 + RoleEntity info = roleApi.getInfo(roleIds); + if (info != null && "1".equals(String.valueOf(info.getGlobalMark()))) { + roleId.add(info.getId()); + continue; + } + // 判断哪些角色是当前组织的 + Boolean exist = organizeRelationApi.existByRoleIdAndOrgId(roleIds, organizeId); + if (exist) { + roleId.add(roleIds); + } + } + // 获取分组 + List groupRelationByUserId = userRelationApi.getListByUserId(userInfo.getUserId(), PermissionConst.GROUP); + List groupIds = groupRelationByUserId.stream().map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + List groupName = groupApi.getListByIds(groupIds, true); + userInfo.setGroupIds(groupName.stream().map(GroupEntity::getId).collect(Collectors.toList())); + userInfo.setGroupNames(groupName.stream().map(GroupEntity::getFullName).collect(Collectors.toList())); +// // 赋值岗位 +// List positionList = data.stream().filter(m -> "Position".equals(m.getObjectType())).map(t -> t.getObjectId()).collect(Collectors.toList()); +// Set id = new LinkedHashSet<>(); +// String[] position = StringUtil.isNotEmpty(userEntity.getPositionId()) ? userEntity.getPositionId().split(",") : new String[]{}; +// List positions = positionList.stream().filter(t -> Arrays.asList(position).contains(t)).collect(Collectors.toList()); +// id.addAll(positions); +// id.addAll(positionList); +// String[] positionId = id.toArray(new String[id.size()]); + userInfo.setOrganizeId(organizeId); + userInfo.setDepartmentId(departmentId); + userInfo.setRoleIds(roleId); + userInfo.setPositionIds(new String[]{userEntity.getPositionId()}); + // 处理userInfo + userInfo.setSystemId(userEntity.getSystemId()); + userInfo.setAppSystemId(userEntity.getAppSystemId()); + // 修改用户信息 + userEntity.setOrganizeId(organizeId); + userEntity.setPositionId(organizeRelationApi.autoGetMajorPositionId(userId, organizeId, userEntity.getPositionId())); + userApi.updateById(userEntity); + } + + + /** + * 登录信息 + * + * @param userInfo 回话信息 + * @param systemInfo 系统信息 + * @return + */ + private Map genUserInfo(UserInfo userInfo, BaseSystemInfo systemInfo) { + Map dictionary = new HashMap<>(16); + dictionary.put("userId", userInfo.getUserId()); + dictionary.put("userAccount", userInfo.getUserAccount()); + dictionary.put("userName", userInfo.getUserName()); + dictionary.put("icon", userInfo.getUserIcon()); + dictionary.put("portalId", userInfo.getPortalId()); + dictionary.put("gender", userInfo.getUserGender()); + dictionary.put("organizeId", userInfo.getOrganizeId()); + dictionary.put("prevLogin", systemInfo.getLastLoginTimeSwitch() == 1 ? 1 : 0); + dictionary.put("prevLoginTime", userInfo.getPrevLoginTime()); + dictionary.put("prevLoginIPAddress", userInfo.getPrevLoginIpAddress()); + dictionary.put("prevLoginIPAddressName", userInfo.getPrevLoginIpAddressName()); + dictionary.put("serviceDirectory", configValueUtil.getServiceDirectoryPath()); + dictionary.put("webDirectory", configValueUtil.getCodeAreasName()); + dictionary.put("isAdministrator", userInfo.getIsAdministrator()); + return dictionary; + } + +} diff --git a/jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/src/main/java/jnpf/service/impl/UserDetailsByUserAccountServiceImpl.java b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/src/main/java/jnpf/service/impl/UserDetailsByUserAccountServiceImpl.java new file mode 100644 index 0000000..b943e65 --- /dev/null +++ b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/src/main/java/jnpf/service/impl/UserDetailsByUserAccountServiceImpl.java @@ -0,0 +1,37 @@ +package jnpf.service.impl; + +import jnpf.base.UserInfo; +import jnpf.constant.MsgCode; +import jnpf.consts.AuthConsts; +import jnpf.exception.LoginException; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.UserService; +import jnpf.service.UserDetailService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * 默认使用用户名获取用户信息 + */ +@Service(AuthConsts.USERDETAIL_ACCOUNT) +public class UserDetailsByUserAccountServiceImpl implements UserDetailService { + + @Autowired + private UserService userApi; + + @Override + public UserEntity loadUserEntity(UserInfo userInfo) throws LoginException { + UserEntity userEntity = userApi.getUserByAccount(userInfo.getUserAccount()); + if (userEntity == null) { + throw new LoginException(MsgCode.LOG003.get()); + } + return userEntity; + } + + + @Override + public int getOrder() { + return Integer.MAX_VALUE; + } + +} diff --git a/jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/src/main/java/jnpf/service/impl/UserDetailsByUserIdServiceImpl.java b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/src/main/java/jnpf/service/impl/UserDetailsByUserIdServiceImpl.java new file mode 100644 index 0000000..d09c461 --- /dev/null +++ b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/src/main/java/jnpf/service/impl/UserDetailsByUserIdServiceImpl.java @@ -0,0 +1,39 @@ +package jnpf.service.impl; + +import jnpf.base.UserInfo; +import jnpf.constant.MsgCode; +import jnpf.consts.AuthConsts; +import jnpf.exception.LoginException; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.UserService; +import jnpf.service.UserDetailService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + + +/** + * 使用用户ID获取用户信息 + */ +@Service(AuthConsts.USERDETAIL_USER_ID) +public class UserDetailsByUserIdServiceImpl implements UserDetailService { + + private static final Integer ORDER = 1; + + @Autowired + private UserService userApi; + + @Override + public UserEntity loadUserEntity(UserInfo userInfo) throws LoginException { + UserEntity userEntity = userApi.getInfo(userInfo.getUserId()); + if (userEntity == null) { + throw new LoginException(MsgCode.LOG003.get()); + } + return userEntity; + } + + @Override + public int getOrder() { + return ORDER; + } + +} diff --git a/jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/src/main/java/jnpf/util/LoginHolder.java b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/src/main/java/jnpf/util/LoginHolder.java new file mode 100644 index 0000000..967e11a --- /dev/null +++ b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-biz/src/main/java/jnpf/util/LoginHolder.java @@ -0,0 +1,27 @@ +package jnpf.util; + +import jnpf.permission.entity.UserEntity; + + +/** + * + * @author JNPF开发平台组 + * @copyright 引迈信息技术有限公司 + */ +public class LoginHolder { + + + private static final ThreadLocal USER_CACHE = new ThreadLocal<>(); + + public static UserEntity getUserEntity(){ + return USER_CACHE.get(); + } + + public static void setUserEntity(UserEntity userEntity){ + USER_CACHE.set(userEntity); + } + + public static void clearUserEntity(){ + USER_CACHE.remove(); + } +} diff --git a/jnpf-java-boot/jnpf-oauth/jnpf-oauth-controller/pom.xml b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-controller/pom.xml new file mode 100644 index 0000000..3e2090b --- /dev/null +++ b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-controller/pom.xml @@ -0,0 +1,22 @@ + + + + jnpf-oauth + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-oauth-controller + + + + com.jnpf + jnpf-oauth-biz + ${project.version} + compile + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-oauth/jnpf-oauth-controller/src/main/java/jnpf/controller/LoginController.java b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-controller/src/main/java/jnpf/controller/LoginController.java new file mode 100644 index 0000000..39c758c --- /dev/null +++ b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-controller/src/main/java/jnpf/controller/LoginController.java @@ -0,0 +1,345 @@ +package jnpf.controller; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.net.url.UrlBuilder; +import cn.hutool.core.text.StrPool; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.service.SysconfigService; +import jnpf.config.JnpfOauthConfig; +import jnpf.consts.DeviceType; +import jnpf.consts.LoginTicketStatus; +import jnpf.granter.TokenGranter; +import jnpf.granter.TokenGranterBuilder; +import jnpf.model.LoginConfigModel; +import jnpf.model.LoginModel; +import jnpf.permission.controller.SocialsUserController; +import jnpf.permission.model.socails.SocialsUserVo; +import jnpf.permission.service.UserService; +import jnpf.service.AuthService; +import jnpf.base.ActionResult; +import jnpf.util.NoDataSourceBind; +import jnpf.base.UserInfo; +import jnpf.config.ConfigValueUtil; +import jnpf.model.LoginTicketModel; +import jnpf.model.BaseSystemInfo; +import jnpf.model.login.PcUserVO; +import jnpf.permission.entity.UserEntity; +import jnpf.exception.LoginException; +import jnpf.model.LoginForm; +import jnpf.model.LoginVO; +import jnpf.service.LoginService; +import jnpf.util.*; +import jnpf.util.data.DataSourceContextHolder; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; +import java.util.Objects; + +import static jnpf.consts.AuthConsts.PARAMS_JNPF_TICKET; + +/** + * 登录控制器 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +@Tag(name = "登陆数据", description = "oauth") +@Slf4j +@RestController +@RequestMapping("/api/oauth") +public class LoginController { + + @Autowired + private UserService userApi; + @Autowired + private LoginService loginService; + @Autowired + private AuthService authService; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private JnpfOauthConfig oauthConfig; + @Autowired + private SysconfigService sysConfigApi; + @Autowired + private RedisUtil redisUtil; + @Autowired + private TokenGranterBuilder tokenGranterBuilder; + @Autowired + private SocialsUserController socialsUserApi; + + /** + * 登陆 + * + * @param parameters 登录参数 + * @return + * @throws LoginException 登录异常 + */ + @Operation(summary = "登陆") + @Parameters({ + @Parameter(name = "parameters", description = "登录参数", required = true) + }) + @RequestMapping(value = "/Login/**", method = {RequestMethod.GET, RequestMethod.POST}) + public ActionResult login(@RequestParam Map parameters) throws LoginException { + return authService.login(parameters); + } + + + /** + * 验证密码 + * + * @param loginForm 登录模型 + * @return + * @throws LoginException 登录异常 + */ + @Operation(summary = "锁屏解锁登录") + @Parameters({ + @Parameter(name = "loginForm", description = "登录模型", required = true) + }) + @PostMapping("/LockScreen") + public ActionResult lockScreen(@RequestBody LoginForm loginForm) throws LoginException { + UserEntity userEntity = userApi.getUserByAccount(loginForm.getAccount()); + if (userEntity == null) { + UserInfo userInfo = UserProvider.getUser(); + if(userInfo.getUserId() != null){ + UserProvider.logoutByUserId(userInfo.getUserId()); + } + throw new LoginException("账号不存在"); + } + if (!Md5Util.getStringMd5(loginForm.getPassword().toLowerCase() + userEntity.getSecretkey().toLowerCase()).equals(userEntity.getPassword())) { + throw new LoginException("账户或密码错误,请重新输入。"); + } + return ActionResult.success("验证成功"); + } + + /** + * 登录注销 + * + * @param grandtype 登录类型 + * @return + */ + @NoDataSourceBind + @Operation(summary = "退出") + @Parameters({ + @Parameter(name = "grandtype", description = "登录类型", required = true) + }) + @RequestMapping(value = {"/Logout","/Logout/{grandtype}" }, method = {RequestMethod.GET, RequestMethod.POST}) + public ActionResult logout(@PathVariable(value = "grandtype", required = false) String grandtype) { + TokenGranter tokenGranter = tokenGranterBuilder.getGranterByLogin(grandtype); + if(tokenGranter != null){ + return tokenGranter.logout(); + } + return ActionResult.success(); + } + + /** + * 踢出指定用户, 推送Websocket用户被强制下线 + * + * @param tokens token集合 + * @param userId 租户id + * @param tenantId 租户id + */ + @NoDataSourceBind + @Operation(summary = "踢出指定用户") + @Parameters({ + @Parameter(name = "tokens", description = "token集合"), + @Parameter(name = "userId", description = "租户id"), + @Parameter(name = "tenantId", description = "租户id"), + }) + @PostMapping(value = {"/KickoutToken" }) + public void kickoutByToken(@RequestParam(value = "tokens", required = false) String[] tokens, @RequestParam(name = "userId", required = false) String userId, @RequestParam(name = "tenantId", required = false) String tenantId) { + if(StringUtil.isNotEmpty(tokens)) { + authService.kickoutByToken(tokens); + }else{ + authService.kickoutByUserId(userId, tenantId); + } + } + + /** + * 获取用户登录信息 + * + * @param type Web/App + * @return + * @throws LoginException 登录异常 + */ + @Operation(summary = "获取用户登录信息") + @Parameters({ + @Parameter(name = "type", description = "Web/App") + }) + @GetMapping("/CurrentUser") + public ActionResult currentUser(String type) throws LoginException { + if (StringUtil.isEmpty(type)) { + type = "Web"; + } else { + type = "App"; + } + UserInfo userInfo = UserProvider.getUser(); + if(DeviceType.TEMPUSERLIMITED.getDevice().equals(userInfo.getLoginDevice())){ + throw new LoginException("限制会话, 不允许访问系统"); + } + PcUserVO pcUserVO = loginService.getCurrentUser(type); + if (pcUserVO == null) { + throw new LoginException("账户异常"); + } + return ActionResult.success(pcUserVO); + } + + /** + * 修改密码信息发送 + * + */ + @Operation(summary = "修改密码信息发送") + @PostMapping("/updatePasswordMessage") + public ActionResult updatePasswordMessage() { + loginService.updatePasswordMessage(); + return ActionResult.success(); + } + + /** + * 图形验证码 + * + * @param codeLength 验证码长度 + * @param timestamp 验证码标识 + */ + @NoDataSourceBind() + @Operation(summary = "图形验证码") + @Parameters({ + @Parameter(name = "codeLength", description = "验证码长度", required = true), + @Parameter(name = "timestamp", description = "验证码标识", required = true) + }) + @GetMapping("/ImageCode/{codeLength}/{timestamp}") + public void imageCode(@PathVariable("codeLength") Integer codeLength, @PathVariable("timestamp") String timestamp) { + DownUtil.downCode(codeLength); + redisUtil.insert(timestamp, ServletUtil.getSession().getAttribute(CodeUtil.RANDOMCODEKEY), 300); + } + + /** + * 注销用户 + * + * @return + */ + @Operation(summary = "注销用户") + @PostMapping("/logoutCurrentUser") + public ActionResult logoutCurrentUser() { + UserInfo userInfo = UserProvider.getUser(); + if (userInfo.getIsAdministrator() != null && UserProvider.getUser().getIsAdministrator()) { + return ActionResult.fail("管理员不能注销"); + } + if (userInfo.getIsAdministrator() != null) { + if (!userInfo.getIsAdministrator()) { + userApi.delete(userApi.getInfo(userInfo.getUserId())); + UserProvider.kickoutByUserId(userInfo.getUserId(), DataSourceContextHolder.getDatasourceId()); + } + } + return ActionResult.success("注销成功"); + } + + /** + * 判断是否需要验证码 + * + * @param account 账号 + */ + @NoDataSourceBind() + @Operation(summary = "判断是否需要验证码") + @Parameters({ + @Parameter(name = "account", description = "账号", required = true) + }) + @GetMapping("/getConfig/{account}") + public ActionResult check(@PathVariable("account") String account) throws LoginException { + LoginModel loginModel = new LoginModel(); + String tenantId = "0"; + String tenantDbConnectionString = "0"; + if (configValueUtil.isMultiTenancy()) { + LoginForm loginForm = new LoginForm(); + loginForm.setAccount(account); + UserInfo userInfo = new UserInfo(); + userInfo.setUserAccount(loginForm.getAccount()); + userInfo = loginService.getTenantAccount(userInfo); + tenantId = userInfo.getTenantId(); + tenantDbConnectionString = userInfo.getTenantDbConnectionString(); + } + // 获取配置 + BaseSystemInfo sysConfigInfo = sysConfigApi.getSysInfo(); + // 是否开启验证码 + if (Objects.nonNull(sysConfigInfo) && "1".equals(String.valueOf(sysConfigInfo.getEnableVerificationCode()))) { + loginModel.setEnableVerificationCode(1); + Integer verificationCodeNumber = sysConfigInfo.getVerificationCodeNumber(); + loginModel.setVerificationCodeNumber(verificationCodeNumber == null ? 4 : verificationCodeNumber); + return ActionResult.success(loginModel); + } + loginModel.setEnableVerificationCode(0); + return ActionResult.success(loginModel); + } + + /** + * 获取登录配置, 是否需要跳转、第三方登录信息 + * + * @return {re} + * @throws LoginException 登录异常 + */ + @NoDataSourceBind() + @Operation(summary = "获取登录配置") + @GetMapping("/getLoginConfig") + public ActionResult getLoginConfig() { + LoginConfigModel loginConfigModel = new LoginConfigModel(); + if(oauthConfig.getSsoEnabled()){ + String url = oauthConfig.getLoginPath() + StrPool.SLASH + oauthConfig.getDefaultSSO(); + loginConfigModel.setRedirect(true); + loginConfigModel.setUrl(url); + loginConfigModel.setTicketParams(PARAMS_JNPF_TICKET); + } else { + //追加第三方登录配置 + List loginList = socialsUserApi.getLoginList(PARAMS_JNPF_TICKET.toUpperCase()); + if (CollectionUtil.isNotEmpty(loginList)) { + loginConfigModel.setSocialsList(loginList); + loginConfigModel.setRedirect(false); + loginConfigModel.setTicketParams(PARAMS_JNPF_TICKET); + } + } + return ActionResult.success(loginConfigModel); + } + + + /** + * 获取登录票据 + * @return {msg:有效期, data:票据} + */ + @NoDataSourceBind() + @Operation(summary = "获取登录票据") + @GetMapping("/getTicket") + public ActionResult getTicket() { + LoginTicketModel ticketModel = new LoginTicketModel(); + ticketModel.setTicketTimeout(System.currentTimeMillis() + oauthConfig.getTicketTimeout()*1000); + String ticket = TicketUtil.createTicket(ticketModel, oauthConfig.getTicketTimeout()); + return ActionResult.success(ticketModel.getTicketTimeout().toString(), ticket); + } + + /** + * 检测票据登录状态 + * @return {re} + * @throws LoginException + */ + @NoDataSourceBind() + @Operation(summary = "获取登录状态") + @GetMapping("/getTicketStatus/{ticket}") + public ActionResult getTicketStatus(@PathVariable("ticket") String ticket) { + LoginTicketModel ticketModel = TicketUtil.parseTicket(ticket); + if(ticketModel == null){ + ticketModel = new LoginTicketModel().setStatus(LoginTicketStatus.Invalid.getStatus()).setValue("票据失效!"); + }else { + if (ticketModel.getStatus() != LoginTicketStatus.UnLogin.getStatus()&&ticketModel.getStatus() != LoginTicketStatus.UnBind.getStatus()) { + TicketUtil.deleteTicket(ticket); + } + } + return ActionResult.success(ticketModel); + } + +} diff --git a/jnpf-java-boot/jnpf-oauth/jnpf-oauth-entity/pom.xml b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-entity/pom.xml new file mode 100644 index 0000000..5542aa0 --- /dev/null +++ b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-entity/pom.xml @@ -0,0 +1,32 @@ + + + + jnpf-oauth + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-oauth-entity + + + + com.jnpf + jnpf-common-all + ${project.version} + compile + + + com.jnpf + jnpf-system-entity + ${project.version} + + + com.jnpf + jnpf-permission-entity + ${project.version} + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-oauth/jnpf-oauth-entity/src/main/java/jnpf/entity/TenantEntity.java b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-entity/src/main/java/jnpf/entity/TenantEntity.java new file mode 100644 index 0000000..a6e4178 --- /dev/null +++ b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-entity/src/main/java/jnpf/entity/TenantEntity.java @@ -0,0 +1,51 @@ +package jnpf; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * + * baseTenant + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2020-12-17 16:09:07 + */ +@Data +@TableName("base_tenant") +public class TenantEntity extends SuperExtendEntity.SuperExtendDEEntity { + + @TableField("f_en_code") + private String enCode; + + @TableField("f_full_name") + private String fullName; + + @TableField("f_company_name") + private String comPanyName; + + @TableField("f_expires_time") + private Date expiresTime; + + @TableField("f_db_name") + private String dbName; + + @TableField("f_ip_address") + private String ipAddress; + + @TableField("f_ip_address_name") + private String ipAddressName; + + @TableField("f_source_website") + private String sourceWebsite; + + /** + * 数据模式 + */ + @TableField("f_data_schema") + private Integer dataSchema; +} diff --git a/jnpf-java-boot/jnpf-oauth/jnpf-oauth-entity/src/main/java/jnpf/entity/TenantlogEntity.java b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-entity/src/main/java/jnpf/entity/TenantlogEntity.java new file mode 100644 index 0000000..91a85b7 --- /dev/null +++ b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-entity/src/main/java/jnpf/entity/TenantlogEntity.java @@ -0,0 +1,82 @@ +package jnpf.entity; + +import com.alibaba.fastjson.annotation.JSONField; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +/** + * 租户日志 + * + * @author JNPF开发平台组 + * @version V1.2.191207 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Data +@TableName("base_tenantlog") +public class TenantlogEntity { + + /** + * 自然主键 + */ + @TableId("F_ID") + @JSONField(name = "F_Id") + private String fId; + + /** + * 租户主键 + */ + @TableField("F_TENANTID") + @JSONField(name = "F_TenantId") + private String fTenantid; + + /** + * 登录账户 + */ + @TableField("F_LOGINACCOUNT") + @JSONField(name = "F_LoginAccount") + private String fLoginaccount; + + /** + * IP地址 + */ + @TableField("F_LOGINIPADDRESS") + @JSONField(name = "F_LoginIPAddress") + private String fLoginipaddress; + + /** + * IP所在城市 + */ + @TableField("F_LOGINIPADDRESSNAME") + @JSONField(name = "F_LoginIPAddressName") + private String fLoginipaddressname; + + /** + * 来源网站 + */ + @TableField("F_LOGINSOURCEWEBSITE") + @JSONField(name = "F_LoginSourceWebsite") + private String fLoginsourcewebsite; + /** + * 登录时间 + */ + @TableField("F_LOGINTIME") + @JSONField(name = "F_LoginTime") + private String fLogintime; + + /** + * 描述 + */ + @TableField("F_DESCRIPTION") + @JSONField(name = "F_Description") + private String fDescription; + + /** + * 租户id + */ + @TableField("F_TENANTID") + private String tenantId; + +} diff --git a/jnpf-java-boot/jnpf-oauth/jnpf-oauth-entity/src/main/java/jnpf/model/BuildUserCommonInfoModel.java b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-entity/src/main/java/jnpf/model/BuildUserCommonInfoModel.java new file mode 100644 index 0000000..8db7698 --- /dev/null +++ b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-entity/src/main/java/jnpf/model/BuildUserCommonInfoModel.java @@ -0,0 +1,23 @@ +package jnpf.model; + +import jnpf.base.UserInfo; +import jnpf.base.entity.SystemEntity; +import jnpf.permission.entity.UserEntity; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class BuildUserCommonInfoModel implements Serializable { + + private UserInfo userInfo; + private SystemEntity mainSystemEntity; + private SystemEntity workSystemEntity; + private UserEntity userEntity; + private BaseSystemInfo baseSystemInfo; + +} diff --git a/jnpf-java-boot/jnpf-oauth/jnpf-oauth-entity/src/main/java/jnpf/model/LoginConfigModel.java b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-entity/src/main/java/jnpf/model/LoginConfigModel.java new file mode 100644 index 0000000..324d4c5 --- /dev/null +++ b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-entity/src/main/java/jnpf/model/LoginConfigModel.java @@ -0,0 +1,45 @@ +package jnpf.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + + +/** + * + * 通用登录配置 + * 是否跳转 + * 第三方登录配置 + * @author JNPF开发平台组 + * @copyright 引迈信息技术有限公司 + */ +@Data +public class LoginConfigModel { + + /** + * 是否跳转 + */ + @Schema(description = "是否跳转") + private boolean redirect = false; + + /** + * 跳转URL地址 + */ + @Schema(description = "跳转URL地址") + private String url; + + /** + * 跳转登录轮询票据参数名称 + */ + @Schema(description = "跳转登录轮询票据") + private String ticketParams; + + + /** + * 第三方登录列表 + */ + @Schema(description = "第三方登录列表") + List socialsList; + +} diff --git a/jnpf-java-boot/jnpf-oauth/jnpf-oauth-entity/src/main/java/jnpf/model/LoginModel.java b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-entity/src/main/java/jnpf/model/LoginModel.java new file mode 100644 index 0000000..9330c44 --- /dev/null +++ b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-entity/src/main/java/jnpf/model/LoginModel.java @@ -0,0 +1,43 @@ +package jnpf.model; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 登陆判断是否需要验证码 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-12-31 + */ +@Data +public class LoginModel implements Serializable { + + /** + * 是否开启验证码 + */ + private Integer enableVerificationCode; + + /** + * 验证码位数 + */ + private Integer verificationCodeNumber; + + public Integer getEnableVerificationCode() { + return enableVerificationCode; + } + + public void setEnableVerificationCode(Integer enableVerificationCode) { + this.enableVerificationCode = enableVerificationCode; + } + + public Integer getVerificationCodeNumber() { + return verificationCodeNumber; + } + + public void setVerificationCodeNumber(Integer verificationCodeNumber) { + this.verificationCodeNumber = verificationCodeNumber; + } +} diff --git a/jnpf-java-boot/jnpf-oauth/jnpf-oauth-entity/src/main/java/jnpf/model/LoginVO.java b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-entity/src/main/java/jnpf/model/LoginVO.java new file mode 100644 index 0000000..17c9363 --- /dev/null +++ b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-entity/src/main/java/jnpf/model/LoginVO.java @@ -0,0 +1,13 @@ +package jnpf.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +//@Builder +public class LoginVO { + @Schema(description = "token") + private String token; + @Schema(description = "主题") + private String theme; +} diff --git a/jnpf-java-boot/jnpf-oauth/jnpf-oauth-entity/src/main/java/jnpf/model/SocialUnbindModel.java b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-entity/src/main/java/jnpf/model/SocialUnbindModel.java new file mode 100644 index 0000000..16fa44a --- /dev/null +++ b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-entity/src/main/java/jnpf/model/SocialUnbindModel.java @@ -0,0 +1,20 @@ +package jnpf.model; + +import lombok.AllArgsConstructor; +import lombok.Data; + +/** + * 第三方未绑定模型 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/9/19 15:06:31 + */ +@Data +@AllArgsConstructor +public class SocialUnbindModel { + String socialType; + String socialUnionid; + String socialName; +} diff --git a/jnpf-java-boot/jnpf-oauth/jnpf-oauth-entity/src/main/java/jnpf/model/UserLogForm.java b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-entity/src/main/java/jnpf/model/UserLogForm.java new file mode 100644 index 0000000..59c9bb6 --- /dev/null +++ b/jnpf-java-boot/jnpf-oauth/jnpf-oauth-entity/src/main/java/jnpf/model/UserLogForm.java @@ -0,0 +1,17 @@ +package jnpf.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.base.Pagination; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class UserLogForm extends Pagination implements Serializable { + @Schema(description = "开始时间") + private String startTime; + @Schema(description = "结束时间") + private String endTime; + @Schema(description = "分类") + private int category; +} diff --git a/jnpf-java-boot/jnpf-oauth/pom.xml b/jnpf-java-boot/jnpf-oauth/pom.xml new file mode 100644 index 0000000..47fcf3a --- /dev/null +++ b/jnpf-java-boot/jnpf-oauth/pom.xml @@ -0,0 +1,22 @@ + + + + jnpf-java-boot + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-oauth + pom + + jnpf-oauth-api + jnpf-oauth-biz + jnpf-oauth-controller + jnpf-oauth-entity + + + + diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/pom.xml b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/pom.xml new file mode 100644 index 0000000..fcc5262 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/pom.xml @@ -0,0 +1,46 @@ + + + + jnpf-permission + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-permission-biz + + + + com.jnpf + jnpf-provider + ${project.version} + + + + me.zhyd.oauth + JustAuth + + + com.jnpf + jnpf-common-connector + + + cn.afterturn + easypoi-base + + + com.jnpf + jnpf-oauth-api + ${project.version} + + + com.jnpf + jnpf-system-biz + 3.5.0-RELEASE + compile + + + + diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/constant/AuthorizeConst.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/constant/AuthorizeConst.java new file mode 100644 index 0000000..c42ff24 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/constant/AuthorizeConst.java @@ -0,0 +1,52 @@ +package jnpf.permission.constant; + +/** + * 类功能 + * + * @author JNPF开发平台组 YanYu + * @version V3.2.0 + * @copyright 引迈信息技术有限公司 + * @date 2022/2/14 + */ +public class AuthorizeConst { + + public final static String USER = "User"; + /** + * 岗位 权限标识 + */ + public final static String POSITION = "Position"; + /** + * 角色 权限标识 + */ + public final static String ROLE = "Role"; + /** + * 按钮 权限标识 + */ + public final static String BUTTON = "button"; + /** + * 菜单 权限标识 + */ + public final static String MODULE = "module"; + /** + * 列表 权限标识 + */ + public final static String COLUMN = "column"; + /** + * 数据 权限标识 + */ + public final static String RESOURCE = "resource"; + /** + * 表单 权限标识 + */ + public final static String FROM = "form"; + /** + * 系统、子系统 + */ + public final static String SYSTEM = "system"; + + /** + * 权限标识集合 + */ + public final static String[] TYPES = {USER, POSITION, ROLE, BUTTON, MODULE, COLUMN, RESOURCE, FROM}; + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/AuthorizeMapper.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/AuthorizeMapper.java new file mode 100644 index 0000000..e063688 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/AuthorizeMapper.java @@ -0,0 +1,51 @@ +package jnpf.permission.mapper; + + +import jnpf.base.mapper.SuperMapper; +import jnpf.base.model.base.SystemBaeModel; +import jnpf.base.model.form.ModuleFormModel; +import jnpf.permission.entity.AuthorizeEntity; +import jnpf.base.model.button.ButtonModel; +import jnpf.base.model.column.ColumnModel; +import jnpf.base.model.module.ModuleModel; +import jnpf.base.model.resource.ResourceModel; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:27 + */ +public interface AuthorizeMapper extends SuperMapper { + + + List findModule(@Param("objectId") String objectId, @Param("id") String id); + + List findButton(@Param("objectId") String objectId); + + List findColumn(@Param("objectId") String objectId); + + List findResource(@Param("objectId") String objectId); + + List findForms(@Param("objectId") String objectId); + + List findSystem(@Param("objectId") String objectId, @Param("enCode") String enCode); + + List findModuleAdmin(@Param("mark") Integer mark, @Param("id") String id); + + List findButtonAdmin(@Param("mark") Integer mark); + + List findColumnAdmin(@Param("mark") Integer mark); + + List findResourceAdmin(@Param("mark") Integer mark); + + List findFormsAdmin(@Param("mark") Integer mark); + + void saveBatch(@Param("values") String values); + + void savaAuth(AuthorizeEntity authorizeEntity); +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/ColumnsPurviewMapper.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/ColumnsPurviewMapper.java new file mode 100644 index 0000000..d23b7a3 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/ColumnsPurviewMapper.java @@ -0,0 +1,15 @@ +package jnpf.permission.mapper; + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.permission.entity.ColumnsPurviewEntity; + +/** + * @author :JNPF开发平台组 + * @version: V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date :2022/3/15 9:41 + */ +public interface ColumnsPurviewMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/GroupMapper.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/GroupMapper.java new file mode 100644 index 0000000..3f3025e --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/GroupMapper.java @@ -0,0 +1,17 @@ +package jnpf.permission.mapper; + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.permission.entity.GroupEntity; + +/** + * 分组管理Mapper + * + * @author :JNPF开发平台组 + * @version: V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date :2022/3/10 17:56 + */ +public interface GroupMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/OrganizeAdminIsTratorMapper.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/OrganizeAdminIsTratorMapper.java new file mode 100644 index 0000000..12fd3c7 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/OrganizeAdminIsTratorMapper.java @@ -0,0 +1,17 @@ +package jnpf.permission.mapper; + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.permission.entity.OrganizeAdministratorEntity; + +/** + * + * 机构分级管理员 + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +public interface OrganizeAdminIsTratorMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/OrganizeMapper.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/OrganizeMapper.java new file mode 100644 index 0000000..d4e9df7 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/OrganizeMapper.java @@ -0,0 +1,18 @@ +package jnpf.permission.mapper; + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.permission.entity.OrganizeEntity; + + +/** + * 组织机构 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +public interface OrganizeMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/OrganizeRelationMapper.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/OrganizeRelationMapper.java new file mode 100644 index 0000000..4ee1109 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/OrganizeRelationMapper.java @@ -0,0 +1,17 @@ +package jnpf.permission.mapper; + +import jnpf.base.mapper.SuperMapper; +import jnpf.permission.entity.OrganizeRelationEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 组织关系 Mapper 接口 + *

+ * + * @author YanYu + * @since 2022-01-19 + */ +public interface OrganizeRelationMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/PermissionGroupMapper.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/PermissionGroupMapper.java new file mode 100644 index 0000000..0983bce --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/PermissionGroupMapper.java @@ -0,0 +1,7 @@ +package jnpf.permission.mapper; + +import jnpf.base.mapper.SuperMapper; +import jnpf.permission.entity.PermissionGroupEntity; + +public interface PermissionGroupMapper extends SuperMapper { +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/PositionMapper.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/PositionMapper.java new file mode 100644 index 0000000..29ccca0 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/PositionMapper.java @@ -0,0 +1,27 @@ +package jnpf.permission.mapper; + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.permission.entity.PositionEntity; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 岗位信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +public interface PositionMapper extends SuperMapper { + + /** + * 通过组织id获取用户信息 + * + * @param orgIdList + * @return + */ + List query(@Param("orgIdList") List orgIdList, @Param("keyword") String keyword); +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/RoleMapper.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/RoleMapper.java new file mode 100644 index 0000000..793851a --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/RoleMapper.java @@ -0,0 +1,28 @@ +package jnpf.permission.mapper; + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.permission.entity.RoleEntity; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 系统角色 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +public interface RoleMapper extends SuperMapper { + + /** + * 通过组织id获取用户信息 + * + * @param orgIdList + * @return + */ + List query(@Param("orgIdList") List orgIdList, @Param("keyword") String keyword, @Param("globalMark") Integer globalMark); + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/SocialsUserMapper.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/SocialsUserMapper.java new file mode 100644 index 0000000..0db487c --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/SocialsUserMapper.java @@ -0,0 +1,16 @@ +package jnpf.permission.mapper; + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.permission.entity.SocialsUserEntity; + +/** + * 流程设计 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/7/14 9:49:19 + */ +public interface SocialsUserMapper extends SuperMapper { +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/UserMapper.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/UserMapper.java new file mode 100644 index 0000000..fd19937 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/UserMapper.java @@ -0,0 +1,33 @@ +package jnpf.permission.mapper; + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.permission.entity.UserEntity; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + + +/** + * 用户信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +public interface UserMapper extends SuperMapper { + /** + * 获取用户id + * @return + */ + List getListId(); + + /** + * 通过组织id获取用户信息 + * + * @param orgIdList + * @return + */ + List query(@Param("orgIdList") List orgIdList, @Param("account") String account, @Param("dbSchema") String dbSchema); +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/UserOldPasswordMapper.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/UserOldPasswordMapper.java new file mode 100644 index 0000000..3808565 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/UserOldPasswordMapper.java @@ -0,0 +1,17 @@ +package jnpf.permission.mapper; + +import jnpf.base.mapper.SuperMapper; +import jnpf.permission.entity.UserOldPasswordEntity; + + +/** + * 组织机构 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月26日 上午9:18 + */ +public interface UserOldPasswordMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/UserRelationMapper.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/UserRelationMapper.java new file mode 100644 index 0000000..814351d --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/mapper/UserRelationMapper.java @@ -0,0 +1,18 @@ +package jnpf.permission.mapper; + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.permission.entity.UserRelationEntity; + + +/** + * 用户关系 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +public interface UserRelationMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/rest/PullUserUtil.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/rest/PullUserUtil.java new file mode 100644 index 0000000..0326203 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/rest/PullUserUtil.java @@ -0,0 +1,45 @@ +package jnpf.permission.rest; + +import jnpf.permission.connector.HttpRequestUserInfoService; +import jnpf.permission.entity.UserEntity; +import jnpf.util.JsonUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.Map; + +/** + * 推送工具类 + * + * @author :JNPF开发平台组 + * @version: V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date :2022/7/28 20:56 + */ +@Slf4j +@Component +public class PullUserUtil { + + + private static HttpRequestUserInfoService httpRequestUserInfoService; + + public PullUserUtil(@Autowired(required = false) HttpRequestUserInfoService httpRequestUserInfoService){ + PullUserUtil.httpRequestUserInfoService = httpRequestUserInfoService; + } + + /** + * 推送到 + * + * @param userEntity + * @param method + * @param tenantId + */ + public static void syncUser(UserEntity userEntity, String method, String tenantId) { + if (httpRequestUserInfoService != null) { + Map map = JsonUtil.entityToMap(userEntity); + httpRequestUserInfoService.syncUserInfo(map, method, tenantId); + } + } + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/ColumnsPurviewService.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/ColumnsPurviewService.java new file mode 100644 index 0000000..1e9276c --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/ColumnsPurviewService.java @@ -0,0 +1,33 @@ +package jnpf.permission.service; + +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import jnpf.permission.entity.ColumnsPurviewEntity; + +/** + * 模块列表权限业务类 + * + * @author :JNPF开发平台组 + * @version: V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date :2022/3/15 9:39 + */ +public interface ColumnsPurviewService extends SuperService { + + /** + * 通过moduleId获取列表权限 + * + * @param moduleId + * @return + */ + ColumnsPurviewEntity getInfo(String moduleId); + + /** + * 判断是保存还是编辑 + * + * @param moduleId + * @param entity + * @return + */ + boolean update(String moduleId, ColumnsPurviewEntity entity); +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/GroupService.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/GroupService.java new file mode 100644 index 0000000..42cace5 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/GroupService.java @@ -0,0 +1,108 @@ +package jnpf.permission.service; + +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import jnpf.base.Pagination; +import jnpf.permission.entity.GroupEntity; + +import java.util.List; +import java.util.Map; + +/** + * 用户管理业务层 + * + * @author :JNPF开发平台组 + * @version: V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date :2022/3/10 17:59 + */ +public interface GroupService extends SuperService { + + /** + * 获取用户列表 + * + * @param pagination 关键字 + * @return + */ + List getList(Pagination pagination); + + /** + * 获取所有格分组信息 + * + * @return + */ + List list(); + + Map getGroupMap(); + + /** + * fullName/encode,id + * @return + */ + Map getGroupEncodeMap(); + + /** + * 获取用户详情 + * + * @param id + * @return + */ + GroupEntity getInfo(String id); + + /** + * 获取分组详情 + * + * @param fullName + * @param encode + * @return + */ + GroupEntity getInfo(String fullName, String encode); + + /** + * 添加 + * + * @param entity + */ + void crete(GroupEntity entity); + + /** + * 修改 + * + * @param id + * @param entity + */ + Boolean update(String id, GroupEntity entity); + + /** + * 删除 + * + * @param entity + */ + void delete(GroupEntity entity); + + /** + * 判断名称是否重复 + * + * @param fullName + * @param id + * @return + */ + Boolean isExistByFullName(String fullName, String id); + + /** + * 判断编码是否重复 + * + * @param enCode + * @param id + * @return + */ + Boolean isExistByEnCode(String enCode, String id); + + /** + * 通过分组id获取分组集合 + * + * @param list + * @return + */ + List getListByIds(List list, Boolean filter); +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/OrganizeRelationService.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/OrganizeRelationService.java new file mode 100644 index 0000000..3aac333 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/OrganizeRelationService.java @@ -0,0 +1,147 @@ +package jnpf.permission.service; + +import jnpf.base.service.SuperService; +import jnpf.permission.entity.OrganizeRelationEntity; +import com.baomidou.mybatisplus.extension.service.IService; +import jnpf.permission.entity.PermissionGroupEntity; +import jnpf.permission.entity.RoleEntity; +import jnpf.permission.model.organize.OrganizeConditionModel; +import jnpf.permission.model.organize.OrganizeModel; + +import java.util.List; + +/** + *

+ * 组织关系 服务类 + *

+ * + * @author YanYu + * @since 2022-01-19 + */ +public interface OrganizeRelationService extends SuperService { + + /** + * 获取组织关联对象 + * + * @param organizeIds 组织id集合 + */ + List getRelationListByOrganizeId(List organizeIds); + + /** + * 获取组织关联对象 + * + * @param organizeIds 组织id集合 + */ + List getRelationListByOrganizeId(List organizeIds, String objectType); + + /** + * 获取组织关联对象 + * + * @param organizeIds 组织id集合 + */ + List getPositionListByOrganizeId(List organizeIds); + + /** + * 获取组织角色关联对象 + * + * @param roleId 角色ID + * @return 关联对象集合 + */ + List getRelationListByRoleId(String roleId); + + /** + * 获取组织角色关联对象 + * + * @param roleId 角色ID + * @return 关联对象集合 + */ + List getRelationListByRoleIdList(List roleId); + + /** + * 通过对象id获取组织关系 + * + * @param objectType 关系 + * @param objectId 对象id + * @return 关联对象集合 + */ + List getRelationListByObjectIdAndType(String objectType, String objectId); + + /** + * 是否存在组织角色关联关系 + * @param roleId + * @param organizeId + * @return + */ + Boolean existByRoleIdAndOrgId(String roleId, String organizeId); + + Boolean existByObjTypeAndOrgId(String objectType, String organizeId); + + Boolean existByObjAndOrgId(String objectType, String objId , String organizeId); + + /** + * 获取关联对象根据类型 + * + * @return 关联对象集合 + */ + List getRelationListByType(String objectType); + + List getListByTypeAndOrgId(String objectType,String orgId); + + Boolean deleteAllByRoleId(String roleId); + + /*================ 切换组织后 -> 自动切换岗位 ===============*/ + + /** + * 自动获取当前组织下的默认岗位 + * @param userId 用户ID + * @param changeToMajorOrgId 切换组织ID + * @param currentMajorPosId 原本的岗位ID + * @return 岗位ID + */ + String autoGetMajorPositionId(String userId, String changeToMajorOrgId, String currentMajorPosId); + + /** + * 自动获取有权限的组织ID + * @param userId 用户ID + * @param orgIds 组织ID集合 + * @param currentMajorOrgId 当前默认组织ID + * @return 组织ID + */ + String autoGetMajorOrganizeId(String userId, List orgIds, String currentMajorOrgId); + + /** + * 自动切换有权限的 + * @param userIds 用户ID集合 + */ + void autoSetOrganize(List userIds); + + /** + * 自动切换岗位 + * @param userIds 用户ID集合 + */ + void autoSetPosition(List userIds); + + /** + * 检查组织是否有权限 + * @param userId 用户ID + * @param orgId 组织ID + * @return true:存在 + */ + List checkBasePermission(String userId, String orgId); + + /** + * 通过组织id获取组织关系 + * + * @param departIds + * @param type + * @return + */ + List getOrgIds(List departIds, String type); + + /** + * 通过组织id获取组织关系 + * @return + */ + List getOrgIdsList(OrganizeConditionModel organizeConditionModel); + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/PositionService.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/PositionService.java new file mode 100644 index 0000000..e360a37 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/PositionService.java @@ -0,0 +1,193 @@ +package jnpf.permission.service; + + +import jnpf.base.service.SuperService; +import jnpf.permission.entity.PositionEntity; +import jnpf.permission.model.position.PaginationPosition; + +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * 岗位信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +public interface PositionService extends SuperService { + + /** + * 列表 + * + * @return + * @param filterEnabledMark + */ + List getList(boolean filterEnabledMark); + + /** + * 岗位名列表(在线开发) + * + * @param idList + * @return + */ + List getPosList(List idList); + + + /** + * 岗位名列表(在线开发) + * + * @param idList + * @return + */ + List getPosList(Set idList); + + Map getPosMap(); + + Map getPosEncodeAndName(); + + /** + * 获取redis存储的岗位信息 + * + * @return + */ + List getPosRedisList(); + + /** + * 列表 + * + * @param paginationPosition 条件 + * @return + */ + List getList(PaginationPosition paginationPosition); + + /** + * 列表 + * + * @param userId 用户主键 + * @return + */ + List getListByUserId(String userId); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + PositionEntity getInfo(String id); + + /** + * 通过名称查询id + * + * @param fullName 名称 + * @return + */ + PositionEntity getByFullName(String fullName); + + /** + * 通过名称查询id + * + * @param fullName 名称 + * @return + */ + PositionEntity getByFullName(String fullName,String encode); + + /** + * 验证名称 + * + * @param entity + * @param isFilter 是否过滤 + * @return + */ + boolean isExistByFullName(PositionEntity entity, boolean isFilter); + + /** + * 验证编码 + * + * @param entity + * @param isFilter 是否过滤 + * @return + */ + boolean isExistByEnCode(PositionEntity entity, boolean isFilter); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(PositionEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + */ + boolean update(String id, PositionEntity entity); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(PositionEntity entity); + + /** + * 上移 + * + * @param id 主键值 + */ + boolean first(String id); + + /** + * 下移 + * + * @param id 主键值 + */ + boolean next(String id); + + /** + * 获取名称 + * + * @return + */ + List getPositionName(List id, boolean filterEnabledMark); + + /** + * 获取名称 + * + * @return + */ + List getPositionName(List id, String keyword); + + /** + * 获取岗位列表 + * + * @param organizeIds 组织id + * @return + */ + List getListByOrganizeId(List organizeIds); + + /** + * 获取用户组织底下所有的岗位 + * @param organizeId + * @param userId + * @return + */ + List getListByOrgIdAndUserId(String organizeId, String userId); + + /** + * 通过名称获取岗位列表 + * + * @param fullName 岗位名称 + * @param enCode 编码 + * @return + */ + List getListByFullName(String fullName, String enCode); + + List getCurPositionsByOrgId(String orgId); + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/RoleService.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/RoleService.java new file mode 100644 index 0000000..1a5e333 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/RoleService.java @@ -0,0 +1,211 @@ +package jnpf.permission.service; + +import jnpf.base.service.SuperService; +import jnpf.permission.entity.RoleEntity; +import jnpf.permission.model.role.RolePagination; + +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * 系统角色 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +public interface RoleService extends SuperService { + + /*============================= get接口 ================================*/ + + /** + * 列表 + * + * @return 角色对象集合 + * @param filterEnabledMark + */ + List getList(boolean filterEnabledMark); + + /** + * 获取全局角色集合 + * + * @return 角色对象集合 + */ + List getGlobalList(); + + /** + * 获取全局角色集合 + * + * @return 角色对象集合 + */ + List getGlobalList(List ids); + + /** + * 列表 + * + * @param userId 用户ID + * @return 角色对象集合 + */ + List getListByUserId(String userId); + + /** + * 组织底下所有角色 + * @param userId + * @return + */ + List getListByUserIdAndOrgId(String userId, String orgId); + + /** + * 当前用户拥有的所有角色集合 + */ + List getRoleIdsByCurrentUser(); + + /** + * 当前用户拥有的所有角色集合 + */ + List getRoleIdsByCurrentUser(String orgId); + + /** + * 获取用户组织底下,及全局的 + * @param userId + * @param orgId + * @return + */ + List getAllRoleIdsByUserIdAndOrgId(String userId, String orgId); + + /** + * 信息 + * + * @param roleId 角色ID + * @return 角色对象 + */ + RoleEntity getInfo(String roleId); + + /** + * 根据id集合返回角色对象集合 + * + * @param roleIds 角色ID集合 + * @param keyword + * @param filterEnabledMark + * @return 角色对象集合 + */ + List getListByIds(List roleIds, String keyword, boolean filterEnabledMark); + + /** + * 根据id集合返回角色对象集合 + * + * @param roleIds 角色ID集合 + * @return 角色对象集合 + */ + List getSwaptListByIds(Set roleIds); + + Map getRoleMap(); + + + /** + * 角色编码/name.id + * @return + */ + Map getRoleNameAndIdMap(); + + /** + * 获取角色实体 + * + * @param fullName 角色名称 + * @return 角色对象 + */ + RoleEntity getInfoByFullName(String fullName); + + /** + * 获取角色实体 + * + * @param fullName 角色名称 + * @return 角色对象 + */ + RoleEntity getInfoByFullName(String fullName,String enCode); + + /** + * 获取当前用户的默认组织下的所有角色集合 + * + * @param orgId 组织ID + * @return 角色对象集合 + */ + List getCurRolesByOrgId(String orgId); + + /** + * 获取组织下的所有角色 + * + * @param orgId 组织ID + * @return 角色对象集合 + */ + List getRolesByOrgId(String orgId); + + String getBindInfo(String roleId, List reduceOrgIds); + + /** + * 列表 + * + * @param page 条件 + */ + List getList(RolePagination page, Integer globalMark); + + /*============================ exist存在判断接口 =================================*/ + + /** + * 验证名称 + * + * @param fullName 名称 + * @param id 主键值 + */ + Boolean isExistByFullName(String fullName, String id, Integer globalMark); + + /** + * 验证编码 + * + * @param enCode 编码 + * @param id 主键值 + */ + Boolean isExistByEnCode(String enCode, String id); + + /** + * 判断当前组织下是否存在角色 + * + * @param orgId 组织ID + */ + Boolean existCurRoleByOrgId(String orgId); + + /*============================ 存在判断接口 =================================*/ + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(RoleEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + */ + Boolean update(String id, RoleEntity entity); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(RoleEntity entity); + + + + + + + + + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/SocialsUserService.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/SocialsUserService.java new file mode 100644 index 0000000..732fc16 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/SocialsUserService.java @@ -0,0 +1,51 @@ +package jnpf.permission.service; + +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import jnpf.permission.entity.SocialsUserEntity; + +import java.util.List; + +/** + * 流程设计 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/7/14 9:33:16 + */ +public interface SocialsUserService extends SuperService { + /** + * 查询用户授权列表 + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2022/7/14 + */ + List getListByUserId(String userId); + + /** + * 查询用户授权列表 + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2022/7/14 + */ + List getUserIfnoBySocialIdAndType(String socialId,String socialType); + + /** + * 查询用户授权列表 + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2022/7/14 + */ + List getListByUserIdAndSource(String userId,String socialType); + + /** + * 根据第三方账号账号类型和id获取用户第三方绑定信息 + * @param socialId 第三方账号id + * @return + */ + SocialsUserEntity getInfoBySocialId(String socialId,String socialType); +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/UserOldPasswordService.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/UserOldPasswordService.java new file mode 100644 index 0000000..831b5d7 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/UserOldPasswordService.java @@ -0,0 +1,32 @@ +package jnpf.permission.service; + +import jnpf.base.service.SuperService; +import jnpf.permission.entity.UserOldPasswordEntity; + +import java.util.List; + +/** + * 用户信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +public interface UserOldPasswordService extends SuperService { + + /** + * 列表 + * + * @return + */ + List getList(String userId); + + /** + * 创建 + * + * @param entity 实体对象 + */ + Boolean create(UserOldPasswordEntity entity); + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/AuthorizeServiceImpl.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/AuthorizeServiceImpl.java new file mode 100644 index 0000000..5c0e5e4 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/AuthorizeServiceImpl.java @@ -0,0 +1,809 @@ +package jnpf.permission.service.impl; + + +import cn.hutool.core.text.StrPool; +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import jnpf.base.entity.*; +import jnpf.base.service.*; +import jnpf.constant.JnpfConst; +import jnpf.constant.PermissionConst; +import jnpf.database.model.superQuery.SuperJsonModel; +import jnpf.database.model.superQuery.SuperQueryJsonModel; +import jnpf.emnus.SearchMethodEnum; +import jnpf.base.UserInfo; +import jnpf.base.model.base.SystemBaeModel; +import jnpf.base.model.button.ButtonModel; +import jnpf.base.model.column.ColumnModel; +import jnpf.base.model.form.ModuleFormModel; +import jnpf.base.model.module.ModuleModel; +import jnpf.base.model.resource.ResourceModel; +import jnpf.config.ConfigValueUtil; +import jnpf.database.model.dto.PrepSqlDTO; +import jnpf.database.sql.util.SqlFrameFastUtil; +import jnpf.database.util.DataSourceUtil; +import jnpf.database.util.DbTypeUtil; +import jnpf.database.util.JdbcUtil; +import jnpf.database.util.TenantDataSourceUtil; +import jnpf.model.visualJson.FieLdsModel; +import jnpf.model.visualJson.config.ConfigModel; +import jnpf.permission.constant.AuthorizeConst; +import jnpf.permission.entity.AuthorizeEntity; +import jnpf.permission.entity.OrganizeAdministratorEntity; +import jnpf.permission.entity.OrganizeEntity; +import jnpf.permission.entity.UserRelationEntity; +import jnpf.permission.mapper.AuthorizeMapper; +import jnpf.permission.model.authorize.*; +import jnpf.permission.model.portalManage.AuthorizePortalManagePrimary; +import jnpf.permission.service.*; +import jnpf.util.*; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.sql.DataSource; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 操作权限 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +@Slf4j +@Service +@DSTransactional +public class AuthorizeServiceImpl extends SuperServiceImpl implements AuthorizeService { + + @Autowired + private UserRelationService userRelationService; + @Autowired + private DataSourceUtil dataSourceUtils; + @Autowired + private UserProvider userProvider; + @Autowired + private CacheKeyUtil cacheKeyUtil; + @Autowired + private RedisUtil redisUtil; + @Autowired + private UserService userService; + @Autowired + private RoleService roleService; + @Autowired + private OrganizeService organizeService; + @Autowired + private OrganizeAdministratorService organizeAdminIsTratorService; + @Autowired + private SystemService systemApi; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private DataSource dataSource; + @Autowired + private PermissionGroupService permissionGroupService; + @Autowired + private ModuleService moduleApi; + @Autowired + private ModuleButtonService buttonApi; + @Autowired + private ModuleColumnService columnApi; + @Autowired + private ModuleFormService formApi; + @Autowired + private ModuleDataAuthorizeSchemeService dataAuthorizeSchemeApi; + + @Override + public AuthorizeVO getAuthorize(boolean isCache, boolean singletonOrg) { + // 是否从缓冲里面获取权限 + if (isCache) { + return getCacheAuthor(userProvider.get()); + } else { + return getAuthorize(userProvider.get(), singletonOrg); + } + } + + private AuthorizeVO getCacheAuthor(UserInfo userInfo) { + // 是否从缓冲里面获取权限 + String cacheKey = cacheKeyUtil.getUserAuthorize() + userInfo.getUserId(); + if (!redisUtil.exists(cacheKey)) { + AuthorizeVO authorizeModel = getAuthorize(userInfo, false); + if (authorizeModel.getModuleList().size() != 0) { + redisUtil.insert(cacheKey, authorizeModel, 60); + } + return authorizeModel; + } else { + return JsonUtil.getJsonToBean(redisUtil.getString(cacheKey).toString(), AuthorizeVO.class); + } + } + + @Override + public AuthorizeVO getAuthorize(UserInfo userInfo, boolean singletonOrg) { + List moduleList = new ArrayList<>(); + List buttonList = new ArrayList<>(); + List columnList = new ArrayList<>(); + List resourceList = new ArrayList<>(); + List formsList = new ArrayList<>(); + List systemList = new ArrayList<>(); + Boolean isAdmin = userInfo.getIsAdministrator(); + + SystemEntity entity = systemApi.getInfoByEnCode(JnpfConst.MAIN_SYSTEM_CODE); + if (!isAdmin) { + List roleIds = new ArrayList<>(); +// roleService.getRoleIdsByCurrentUser(userInfo.getOrganizeId()).forEach(role -> { +// RoleEntity info = roleService.getInfo(role); +// //判断角色状态是否为有效,显示当前组织内角色的并集 +// if (info != null && info.getEnabledMark() == 1) { +// roleIds.add("'" + role + "'"); +// } +// }); + permissionGroupService.getPermissionGroupByUserId(userInfo.getUserId(), null, true).forEach(t -> { + roleIds.add("'" + t.getId() + "'"); + }); + if (roleIds.size() != 0) { + String roleIdsStr = String.join(",", roleIds); + moduleList = this.baseMapper.findModule(roleIdsStr, entity.getId()); + buttonList = this.baseMapper.findButton(roleIdsStr); + columnList = this.baseMapper.findColumn(roleIdsStr); + resourceList = this.baseMapper.findResource(roleIdsStr); + formsList = this.baseMapper.findForms(roleIdsStr); +// if (singletonOrg) { +// permissionGroupService.getPermissionGroupByUserId(userInfo.getUserId(), null, true).forEach(t -> { +// roleIds.add("'" + t.getId() + "'"); +// }); +// roleIdsStr = String.join(",", roleIds); +// } + systemList = this.baseMapper.findSystem(roleIdsStr, JnpfConst.MAIN_SYSTEM_CODE); + } + + } else { + moduleList = this.baseMapper.findModuleAdmin(1, entity.getId()); + buttonList = this.baseMapper.findButtonAdmin(1); + columnList = this.baseMapper.findColumnAdmin(1); + resourceList = this.baseMapper.findResourceAdmin(1); + formsList = this.baseMapper.findFormsAdmin(1); + systemList = JsonUtil.getJsonToList(systemApi.getList(null, true, false, true, false), SystemBaeModel.class); + } + return new AuthorizeVO(moduleList, buttonList, columnList, resourceList, formsList, systemList); + } + + @Override + public void savePortalManage(String portalManageId, SaveAuthForm saveAuthForm) { + final String AUTHORIZE_PORTAL_MANAGE = "portalManage"; + final String AUTHORIZE_ROLE = "role"; + String userId = UserProvider.getLoginUserId(); + // 原始授权角色 + List list = new ArrayList<>(); + for (int i = 0; i < saveAuthForm.getObjectId().length; i++) { + AuthorizeEntity authorizeEntity = new AuthorizeEntity(); + authorizeEntity.setId(RandomUtil.uuId()); + authorizeEntity.setItemType(AUTHORIZE_PORTAL_MANAGE); + authorizeEntity.setItemId(portalManageId); + authorizeEntity.setObjectType(AUTHORIZE_ROLE); + authorizeEntity.setObjectId(saveAuthForm.getObjectId()[i]); + authorizeEntity.setSortCode((long) i); + authorizeEntity.setCreatorTime(new Date()); + authorizeEntity.setCreatorUserId(userId); + list.add(authorizeEntity); + } + remove(new AuthorizePortalManagePrimary(null, portalManageId).getQuery()); + saveBatch(list); + } + + @Override + public List getAuthorizeByItem(String itemType, String itemId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(AuthorizeEntity::getItemType, itemType); + queryWrapper.lambda().eq(AuthorizeEntity::getItemId, itemId); + return this.list(queryWrapper); + } + + @Override + public AuthorizeVO getAuthorizeByUser() { + // 查看分级应用权限 + List listByUserId = organizeAdminIsTratorService.getOrganizeAdministratorEntity(UserProvider.getLoginUserId(), PermissionConst.SYSTEM, false); + List systemEntities = systemApi.getListByIds(listByUserId.stream().map(OrganizeAdministratorEntity::getOrganizeId).collect(Collectors.toList())); + List moduleBySystemIds = moduleApi.getModuleBySystemIds(systemEntities.stream().map(SystemEntity::getId).collect(Collectors.toList())); + List listByUserId1 = organizeAdminIsTratorService.getOrganizeAdministratorEntity(UserProvider.getLoginUserId(), PermissionConst.MODULE, false); + List moduleEntities = moduleApi.getModuleByIds(listByUserId1.stream().map(OrganizeAdministratorEntity::getOrganizeId).collect(Collectors.toList())); + List jsonToList = JsonUtil.getJsonToList(moduleBySystemIds, ModuleModel.class); + List jsonToList1 = JsonUtil.getJsonToList(moduleEntities, ModuleModel.class); + AuthorizeVO authorizeModel = this.getAuthorize(false, false); + List moduleList = authorizeModel.getModuleList(); + moduleList.addAll(jsonToList); + moduleList.addAll(jsonToList1); + moduleList = moduleList.stream().distinct().sorted(Comparator.comparing(ModuleModel::getSortCode)).collect(Collectors.toList()); + authorizeModel.setModuleList(moduleList); + List modelList = authorizeModel.getModuleList(); + UserInfo userInfo = userProvider.get(); + if (StringUtil.isEmpty(userInfo.getSystemId())) { + SystemEntity systemEntity = systemApi.getInfoByEnCode(JnpfConst.MAIN_SYSTEM_CODE); + userInfo.setSystemId(systemEntity.getId()); + } + modelList = modelList.stream().filter(t -> t != null && StringUtil.isNotEmpty(t.getSystemId()) && t.getSystemId().equals(userInfo.getSystemId())).collect(Collectors.toList()); + modelList.forEach(t -> { + if(t.getParentId().equals(t.getSystemId())) { + t.setParentId("-1"); + } + }); + // 按钮 + List buttonList = authorizeModel.getButtonList(); + List buttonByModuleId = buttonApi.getList(jsonToList1.stream().map(ModuleModel::getId).collect(Collectors.toList())); + List buttonJsonToList = JsonUtil.getJsonToList(buttonByModuleId, ButtonModel.class); + buttonList.addAll(buttonJsonToList); + buttonList = buttonList.stream().distinct().collect(Collectors.toList()); + // 列表 + List columnList = authorizeModel.getColumnList(); + List columnByModuleId = columnApi.getListByModuleId(jsonToList1.stream().map(ModuleModel::getId).collect(Collectors.toList())); + List columnJsonToList = JsonUtil.getJsonToList(columnByModuleId, ColumnModel.class); + columnList.addAll(columnJsonToList); + columnList = columnList.stream().distinct().collect(Collectors.toList()); + // 表单 + List formsList = authorizeModel.getFormsList(); + List formByModuleId = formApi.getListByModuleId(jsonToList1.stream().map(ModuleModel::getId).collect(Collectors.toList())); + List formJsonToList = JsonUtil.getJsonToList(formByModuleId, ModuleFormModel.class); + formsList.addAll(formJsonToList); + formsList = formsList.stream().distinct().collect(Collectors.toList()); + // 数据 + List resourceList = authorizeModel.getResourceList(); + List resourceByModuleId = dataAuthorizeSchemeApi.getListByModuleId(jsonToList1.stream().map(ModuleModel::getId).collect(Collectors.toList())); + List resourceJsonToList = JsonUtil.getJsonToList(resourceByModuleId, ResourceModel.class); + resourceList.addAll(resourceJsonToList); + resourceList = resourceList.stream().distinct().collect(Collectors.toList()); + return new AuthorizeVO(modelList, buttonList, columnList, resourceList, formsList, authorizeModel.getSystemList()); + } + + @Override + public void save(String objectId, AuthorizeDataUpForm authorizeList) { + SaveBatchForm form = JsonUtil.getJsonToBean(authorizeList, SaveBatchForm.class); + form.setRoleIds(new String[]{objectId}); + this.saveBatch(form, false); + } + + @Override + public void saveBatch(SaveBatchForm saveBatchForm, boolean isBatch) { + try { + UserInfo userInfo = userProvider.get(); + + List objectList = new ArrayList<>(); + List authorizeList = new ArrayList<>(); + // 设置权限归属对象 + setEntity(saveBatchForm.getUserIds(), AuthorizeConst.USER, objectList, true); + setEntity(saveBatchForm.getPositionIds(), AuthorizeConst.POSITION, objectList, true); + setEntity(saveBatchForm.getRoleIds(), AuthorizeConst.ROLE, objectList, true); +// setEntity(saveBatchForm.getSystemIds(), AuthorizeConst.SYSTEM, objectList, true); + // 设置权限模块 + setEntity(saveBatchForm.getButton(), AuthorizeConst.BUTTON, authorizeList, false); + setEntity(saveBatchForm.getModule(), AuthorizeConst.MODULE, authorizeList, false); + setEntity(saveBatchForm.getColumn(), AuthorizeConst.COLUMN, authorizeList, false); + setEntity(saveBatchForm.getResource(), AuthorizeConst.RESOURCE, authorizeList, false); + setEntity(saveBatchForm.getForm(), AuthorizeConst.FROM, authorizeList, false); + setEntity(saveBatchForm.getSystemIds(), AuthorizeConst.SYSTEM, authorizeList, false); + + // 删除角色相关信息 + List objectIdAll = objectList.stream().map(AuthorizeEntity::getObjectId).collect(Collectors.toList()); + userService.delCurRoleUser(objectIdAll); + if (!isBatch) { + String ids = String.join(",", objectIdAll); + JdbcUtil.creUpDe(new PrepSqlDTO(XSSEscape.escapeEmpty(SqlFrameFastUtil.AUTHOR_DEL.replace("{authorizeIds}", ids))).withConn(dataSourceUtils, null)); + } + + // 插入数据 + String sql = DbTypeUtil.checkOracle(dataSourceUtils) || DbTypeUtil.checkPostgre(dataSourceUtils) ? + SqlFrameFastUtil.INSERT_AUTHORIZE2 : SqlFrameFastUtil.INSERT_AUTHORIZE; + + String column_key = StringUtil.EMPTY, column_plceholder = StringUtil.EMPTY, column_value = TenantDataSourceUtil.getTenantColumn(); + if (StringUtil.isNotEmpty(column_value)) { + column_key = StrPool.COMMA + configValueUtil.getMultiTenantColumn(); + column_plceholder = ",?"; + } + sql = sql.replace("%COLUMN_KEY%", column_key).replace("%COLUMN_PLACEHOLDER%", column_plceholder); + PrepSqlDTO dto = new PrepSqlDTO(sql).withConn(dataSourceUtils, null); + for (int i = 0; i < objectList.size(); i++) { + for (AuthorizeEntity entityItem : authorizeList) { + List data = new LinkedList<>(); + data.add(RandomUtil.uuId()); + data.add(entityItem.getItemType()); + data.add(entityItem.getItemId()); + data.add(objectList.get(i).getObjectType()); + data.add(objectList.get(i).getObjectId()); + data.add(i); + data.add(DateUtil.getNow()); + data.add(userInfo.getUserId()); + if (StringUtil.isNotEmpty(column_value)) { + data.add(column_value); + } + dto.addMultiData(data); + } + } + JdbcUtil.creUpDeBatchOneSql(dto); + } catch (Exception e) { + e.printStackTrace(); + log.error("权限报错:" + e.getMessage()); + } + } + + /** + * 权限 + */ + private void setEntity(String[] ids, String type, List entityList, Boolean objectFlag) { + if (ids != null) { + for (String id : ids) { + AuthorizeEntity entity = new AuthorizeEntity(); + if (objectFlag) { + entity.setObjectType(type); + entity.setObjectId(id); + } else { + entity.setItemType(type); + entity.setItemId(id); + } + entityList.add(entity); + } + } + } + + @Override + public List getListByUserId(boolean isAdmin, String userId) { + if (!isAdmin) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(UserRelationEntity::getUserId, userId); + List list = userRelationService.list(queryWrapper); + List userRelationList = list.stream().map(u -> u.getObjectId()).collect(Collectors.toList()); + userRelationList.add(userId); + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().in(AuthorizeEntity::getObjectId, userRelationList); + return this.list(wrapper); + } else { + return new ArrayList<>(); + } + } + + @Override + public List getListByObjectId(List objectId) { + if (objectId.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(AuthorizeEntity::getObjectId, objectId); + return this.list(queryWrapper); + } + + @Override + public Boolean existAuthorize(String roleId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(AuthorizeEntity::getObjectId, roleId); + return this.count(queryWrapper) > 0; + } + + @Override + public List systemListByRoleIds(List roleIds) { + if (!userProvider.get().getIsAdministrator()) { + StringJoiner joiner = new StringJoiner(","); + if (roleIds.size() < 1) { + roleIds.add(""); + } + roleIds.forEach(t -> joiner.add("'" + t + "'")); + List systemBaeModelList = this.baseMapper.findSystem(joiner.toString(), JnpfConst.MAIN_SYSTEM_CODE); + return systemBaeModelList == null ? new ArrayList<>(16) : systemBaeModelList; + } + return JsonUtil.getJsonToList(systemApi.getList(null, true, false, true, false), SystemBaeModel.class); + } + + @Override + public List getListByObjectId(String objectId, String itemType) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(AuthorizeEntity::getObjectId, objectId); + queryWrapper.lambda().eq(AuthorizeEntity::getItemType, itemType); + return this.list(queryWrapper); + } + + @Override + public List getListByObjectAndItem(String itemId, String objectType) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(AuthorizeEntity::getObjectType, objectType).eq(AuthorizeEntity::getItemId, itemId); + return this.list(queryWrapper); + } + + @Override + public List getListByObjectAndItemIdAndType(String itemId, String itemType) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(AuthorizeEntity::getItemType, itemType).eq(AuthorizeEntity::getItemId, itemId); + return this.list(queryWrapper); + } + + /** + * 获取条件过滤 + * + * @param conditionModel 数据权限条件模型 + * @return + */ + @Override + @DS("" ) + public QueryWrapper getCondition(AuthorizeConditionModel conditionModel) { + QueryWrapper queryWhere = conditionModel.getObj(); + String moduleId = conditionModel.getModuleId(); + String tableName = conditionModel.getTableName(); + UserInfo userInfo = userProvider.get(); + AuthorizeVO model = this.getAuthorize(true, false); + List resourceList = model.getResourceList().stream().filter(m -> m.getModuleId().equals(moduleId)).collect(Collectors.toList()); + if (resourceList.size() == 0) { + return null; + } + List resourceList1 = new ArrayList<>(); + //拼接计数 + int t = 1; + for (ResourceModel item : resourceList) { + if (item.getAllData() != null && item.getAllData() == 1) { + t = 0; + break; + } + List conditionModelList = JsonUtil.getJsonToList(item.getConditionJson(), ConditionModel.class); + for (int i = 0; i < conditionModelList.size(); i++) { + ConditionModel conditionItem = conditionModelList.get(i); + for (int k = 0; k < conditionItem.getGroups().size(); k++) { + ConditionModel.ConditionItemModel fieldItem = conditionItem.getGroups().get(k); + String itemTable = fieldItem.getBindTable(); + if (StringUtil.isNotEmpty(itemTable) && itemTable.equalsIgnoreCase(tableName)) { + resourceList1.add(item); + } + } + } + } + if (t == 1) { + if (resourceList1.size() > 0) { + queryWhere.and(tw -> { + for (ResourceModel item : resourceList1) { + List conditionModelList = JsonUtil.getJsonToList(item.getConditionJson(), ConditionModel.class); + for (int i = 0; i < conditionModelList.size(); i++) { + ConditionModel conditionItem = conditionModelList.get(i); + for (int k = 0; k < conditionItem.getGroups().size(); k++) { + ConditionModel.ConditionItemModel fieldItem = conditionItem.getGroups().get(k); + String itemField = fieldItem.getField(); + String itemValue = fieldItem.getValue(); + String itemMethod = fieldItem.getOp(); + Object value; + if (AuthorizeConditionEnum.USER.getCondition().equals(itemValue)) { //当前用户 + value = userInfo.getUserId(); + //任意文本 当前用户 当前组织 包含为模糊查询 + if (itemMethod.equals(SearchMethodEnum.Included.getMessage())) { + itemMethod = SearchMethodEnum.Like.getMessage(); + } + if (itemMethod.equals(SearchMethodEnum.NotIncluded.getMessage())) { + itemMethod = SearchMethodEnum.NotLike.getMessage(); + } + } else if (AuthorizeConditionEnum.ORGANIZE.getCondition().equals(itemValue)) { //当前组织 + String orgId = userInfo.getOrganizeId(); + if (StringUtil.isNotEmpty(userInfo.getDepartmentId())) { + orgId = userInfo.getDepartmentId(); + } + if (itemMethod.equals(SearchMethodEnum.Included.getMessage())) { + itemMethod = SearchMethodEnum.Like.getMessage(); + } + if (itemMethod.equals(SearchMethodEnum.NotIncluded.getMessage())) { + itemMethod = SearchMethodEnum.NotLike.getMessage(); + } + value = orgId; + } else if (AuthorizeConditionEnum.ORGANIZEANDUNDER.getCondition().equals(itemValue)) { //组织及子组织 + String orgId = userInfo.getOrganizeId(); + if (StringUtil.isNotEmpty(userInfo.getDepartmentId())) { + orgId = userInfo.getDepartmentId(); + } + List underOrganizations = organizeService.getUnderOrganizations(orgId, false); + underOrganizations.add(orgId); + value = underOrganizations; + } else if (AuthorizeConditionEnum.USERANDUNDER.getCondition().equals(itemValue)) { //用户及用户下属 + List idsList = new ArrayList<>(); + if (userInfo.getSubordinateIds().size() > 0) { + idsList = userInfo.getSubordinateIds(); + } + idsList.add(userInfo.getUserId()); + value = idsList; + } else if (AuthorizeConditionEnum.BRANCHMANAGEORG.getCondition().equals(itemValue)) { //分管组织 + List organizeAdministratorEntity = organizeAdminIsTratorService.getOrganizeAdministratorEntity(userInfo.getUserId()); + //子 + List organizeAdministratorEntity1 = new ArrayList<>(organizeAdministratorEntity); + //父 + List organizeAdministratorEntity2 = new ArrayList<>(organizeAdministratorEntity); + List allIdList = new ArrayList<>(); + //子 + List childList = organizeAdministratorEntity1.stream().filter(orgAdmin -> orgAdmin.getSubLayerSelect() == 1).map(orgAdmin -> orgAdmin.getOrganizeId()).collect(Collectors.toList()); + //父 + List fathetList = organizeAdministratorEntity2.stream().filter(orgAdmin -> orgAdmin.getThisLayerSelect() == 1).map(orgAdmin -> orgAdmin.getOrganizeId()).collect(Collectors.toList()); + for (String org : childList) { + List underOrganizations = organizeService.getUnderOrganizations(org, false); + if (underOrganizations.size() > 0) { + allIdList.addAll(underOrganizations); + } + } + if (fathetList.size() > 0) { + allIdList.addAll(fathetList); + } + //空集合处理 + if (allIdList.size() == 0) { + allIdList.add("jnpfNullList" ); + } + value = allIdList; + } else if (AuthorizeConditionEnum.BRANCHMANAGEORGANIZEUNDER.getCondition().equals(itemValue)) { //分管组织及子组织 + List organizeAdministratorEntity = organizeAdminIsTratorService.getOrganizeAdministratorEntity(userInfo.getUserId()); + + List organizeAdministratorEntity1 = new ArrayList<>(organizeAdministratorEntity); + + List organizeAdministratorEntity2 = new ArrayList<>(organizeAdministratorEntity); + + List allIdList = new ArrayList<>(); + //需要子集 + List childList = new ArrayList<>(); + + List thisList = organizeAdministratorEntity1.stream().filter(orgAdmin -> orgAdmin.getThisLayerSelect() == 1) + .map(orgAdmin -> orgAdmin.getOrganizeId()).collect(Collectors.toList()); + + List subList = organizeAdministratorEntity2.stream().filter(orgAdmin -> orgAdmin.getSubLayerSelect() == 1) + .map(orgAdmin -> orgAdmin.getOrganizeId()).collect(Collectors.toList()); + + if (thisList.size() > 0) { + allIdList.addAll(thisList); + childList.addAll(thisList); + } + if (subList.size() > 0) { + childList.addAll(subList); + } + + for (String orgID : childList) { + List underOrganizations = organizeService.getUnderOrganizations(orgID, false); + if (underOrganizations.size() > 0) { + allIdList.addAll(underOrganizations); + } + } + if (allIdList.size() == 0) { + allIdList.add("jnpfNullList" ); + } + value = allIdList; + } else {//任意文本 + value = itemValue; + if (itemMethod.equals(SearchMethodEnum.Included.getMessage())) { + itemMethod = SearchMethodEnum.Like.getMessage(); + } + if (itemMethod.equals(SearchMethodEnum.NotIncluded.getMessage())) { + itemMethod = SearchMethodEnum.NotLike.getMessage(); + } + } + if ("and".equalsIgnoreCase(conditionItem.getLogic())) { + if (itemMethod.equals(SearchMethodEnum.Equal.getMessage())) { + tw.eq(itemField, value); + } else if (itemMethod.equals(SearchMethodEnum.NotEqual.getMessage())) { + tw.ne(itemField, value); + } else if (itemMethod.equals(SearchMethodEnum.LessThan.getMessage())) { + tw.lt(itemField, value); + } else if (itemMethod.equals(SearchMethodEnum.LessThanOrEqual.getMessage())) { + tw.le(itemField, value); + } else if (itemMethod.equals(SearchMethodEnum.GreaterThan.getMessage())) { + tw.gt(itemField, value); + } else if (itemMethod.equals(SearchMethodEnum.GreaterThanOrEqual.getMessage())) { + tw.ge(itemField, value); + } else if (itemMethod.equals(SearchMethodEnum.Included.getMessage())) { + tw.in(itemField, (List) value); + } else if (itemMethod.equals(SearchMethodEnum.NotIncluded.getMessage())) { + tw.notIn(itemField, (List) value); + } else if (itemMethod.equals(SearchMethodEnum.Like.getMessage())) { + tw.like(itemField, value); + } else if (itemMethod.equals(SearchMethodEnum.NotLike.getMessage())) { + tw.notLike(itemField, value); + } + } else { + if (itemMethod.equals(SearchMethodEnum.Equal.getMessage())) { + tw.or( + qw -> qw.eq(itemField, value) + ); + } else if (itemMethod.equals(SearchMethodEnum.NotEqual.getMessage())) { + tw.or( + qw -> qw.ne(itemField, value) + ); + } else if (itemMethod.equals(SearchMethodEnum.LessThan.getMessage())) { + tw.or( + qw -> qw.lt(itemField, value) + ); + } else if (itemMethod.equals(SearchMethodEnum.LessThanOrEqual.getMessage())) { + tw.or( + qw -> qw.le(itemField, value) + ); + } else if (itemMethod.equals(SearchMethodEnum.GreaterThan.getMessage())) { + tw.or( + qw -> qw.gt(itemField, value) + ); + } else if (itemMethod.equals(SearchMethodEnum.GreaterThanOrEqual.getMessage())) { + tw.or( + qw -> qw.ge(itemField, value) + ); + } else if (itemMethod.equals(SearchMethodEnum.Included.getMessage())) { + tw.or( + qw -> qw.in(itemField, (List) value) + ); + } else if (itemMethod.equals(SearchMethodEnum.NotIncluded.getMessage())) { + tw.or( + qw -> qw.notIn(itemField, (List) value) + ); + } else if (itemMethod.equals(SearchMethodEnum.Like.getMessage())) { + tw.or( + qw -> qw.like(itemField, value) + ); + } else if (itemMethod.equals(SearchMethodEnum.NotLike.getMessage())) { + tw.or( + qw -> qw.notLike(itemField, value) + ); + } + } + } + } + } + }); + } + } + return queryWhere; + } + + @Override + public List findSystem(String objectId) { + return this.baseMapper.findSystem(objectId, JnpfConst.MAIN_SYSTEM_CODE); + } + + @Override + public List findSystem(List roleIds) { + if (!userProvider.get().getIsAdministrator()) { + StringJoiner joiner = new StringJoiner("," ); + if (roleIds.size() < 1) { + roleIds.add("" ); + } + roleIds.forEach(t -> joiner.add("'" + t + "'" )); + List systemBaeModelList = this.baseMapper.findSystem(joiner.toString(), JnpfConst.MAIN_SYSTEM_CODE); + return systemBaeModelList == null ? new ArrayList<>(16) : systemBaeModelList; + } + return JsonUtil.getJsonToList(systemApi.getList(null, true, false, true, false), SystemBaeModel.class); + } + + + @Override + @DS("") + public List getConditionSql(String moduleId) { + List list = new ArrayList<>(); + UserInfo userInfo = userProvider.get(); + AuthorizeVO model = this.getAuthorizeByUser(); + List resourceListAll = model.getResourceList().stream().filter(m -> m.getModuleId().equals(moduleId)).collect(Collectors.toList()); + //先遍历一次 查找其中有没有全部方案 + boolean isAll = resourceListAll.stream().filter(item -> "jnpf_alldata".equals(item.getEnCode())).count() > 0; + //未分配权限方案 + if (isAll || userInfo.getIsAdministrator()) { + SuperJsonModel superJsonModel = new SuperJsonModel(); + list.add(superJsonModel); + return list; + } + Map> authorizeMap = resourceListAll.stream().collect(Collectors.groupingBy(ma -> ma.getObjectId())); + int num = 0; + //方案 + for (String key : authorizeMap.keySet()) { + List resourceList = authorizeMap.get(key); + boolean authorizeLogic = num == 0; + for (ResourceModel item : resourceList) { + String matchLogic = StringUtil.isNotEmpty(item.getMatchLogic()) ? item.getMatchLogic() : SearchMethodEnum.And.getSymbol(); + List conditionList = new ArrayList<>(); + List conditionModelList = JsonUtil.getJsonToList(item.getConditionJson(), ConditionModel.class); + //分组 + for (ConditionModel conditionModel : conditionModelList) { + String logic = conditionModel.getLogic(); + List groupList = new ArrayList<>(); + //条件 + for (ConditionModel.ConditionItemModel fieldItem : conditionModel.getGroups()) { + //当前用户 + String itemValue = fieldItem.getValue(); + SearchMethodEnum itemMethod = SearchMethodEnum.getSearchMethod(fieldItem.getOp()); + String itemField = fieldItem.getField(); + String table = fieldItem.getBindTable(); + if (itemField.contains(".") && itemField.split("\\.").length == 2) { + table = itemField.split("\\.")[0]; + itemField = itemField.split("\\.")[1]; + } + String bindTable = table; + String vModel = itemField; + if (AuthorizeConditionEnum.USER.getCondition().equals(itemValue)) { + itemValue = userInfo.getUserId(); + } + //当前组织 + if (AuthorizeConditionEnum.ORGANIZE.getCondition().equals(itemValue)) { + List> orgAllPathList = getOrgAllPathList(new ArrayList() {{ + add(userInfo.getOrganizeId()); + }}); + if(CollectionUtils.isNotEmpty(orgAllPathList)){ + itemValue = JsonUtil.getObjectToString(orgAllPathList.get(0)); + }else{ + itemValue = ""; + } + } + //当前组织及子组织 + if (AuthorizeConditionEnum.ORGANIZEANDUNDER.getCondition().equals(itemValue)) { + String orgId = userInfo.getOrganizeId(); + if (StringUtil.isNotEmpty(userInfo.getDepartmentId())) { + orgId = userInfo.getDepartmentId(); + } + List underOrganizations = organizeService.getUnderOrganizations(orgId, false); + underOrganizations.add(orgId); + itemValue = getOrgAllPath(underOrganizations); + } + //当前用户及下属 + if (AuthorizeConditionEnum.USERANDUNDER.getCondition().equals(itemValue)) { + List subOrganizeIds = new ArrayList<>(); + if (userInfo.getSubordinateIds().size() > 0) { + subOrganizeIds = userInfo.getSubordinateIds(); + } + subOrganizeIds.add(userInfo.getUserId()); + itemValue = JsonUtil.getObjectToString(subOrganizeIds); + } + //分管组织 + if (AuthorizeConditionEnum.BRANCHMANAGEORG.getCondition().equals(itemValue)) { + List allIdList = organizeAdminIsTratorService.getOrganizeUserList(JnpfConst.CURRENT_ORG_SUB); + itemValue = getOrgAllPath(allIdList); + } + FieLdsModel fieLdsModel = new FieLdsModel(); + ConfigModel config = new ConfigModel(); + config.setJnpfKey(fieldItem.getConditionText()); + config.setTableName(bindTable); + fieLdsModel.setConfig(config); + fieLdsModel.setSymbol(itemMethod.getSymbol()); + fieLdsModel.setVModel(vModel); + fieLdsModel.setId(vModel); + fieLdsModel.setFieldValue(itemValue); + groupList.add(fieLdsModel); + } + //搜索条件 + SuperQueryJsonModel queryJsonModel = new SuperQueryJsonModel(); + queryJsonModel.setGroups(groupList); + queryJsonModel.setLogic(logic); + conditionList.add(queryJsonModel); + } + if (conditionList.size() > 0) { + SuperJsonModel superJsonModel = new SuperJsonModel(); + superJsonModel.setMatchLogic(matchLogic); + superJsonModel.setConditionList(conditionList); + superJsonModel.setAuthorizeLogic(authorizeLogic); + list.add(superJsonModel); + } + } + num += list.size() > 0 ? 1 : 0; + } + return list; + } + + /** + * 获取组织全路径 + * @param allIdList 组织id列表。 + * @return + */ + private String getOrgAllPath(List allIdList) { + List> orgAllPathList = getOrgAllPathList(allIdList); + return JsonUtil.getObjectToString(orgAllPathList); + } + + /** + * 获取组织全路径 + * @param allIdList 组织id列表。 + * @return + */ + private List> getOrgAllPathList(List allIdList) { + List> resOrg=new ArrayList<>(); + for(String itemOrg: allIdList){ + OrganizeEntity organizeEntity =organizeService.getInfo(itemOrg); + if (organizeEntity != null) { + if (StringUtil.isNotEmpty(organizeEntity.getOrganizeIdTree())) { + String[] split = organizeEntity.getOrganizeIdTree().split(","); + if(split.length > 0){ + resOrg.add(Arrays.asList(split)); + } + } + } + } + return resOrg; + } + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/ColumnsPurviewServiceImpl.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/ColumnsPurviewServiceImpl.java new file mode 100644 index 0000000..4d2034f --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/ColumnsPurviewServiceImpl.java @@ -0,0 +1,52 @@ +package jnpf.permission.service.impl; + +import jnpf.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import jnpf.permission.entity.ColumnsPurviewEntity; +import jnpf.permission.mapper.ColumnsPurviewMapper; +import jnpf.permission.service.ColumnsPurviewService; +import jnpf.util.DateUtil; +import jnpf.util.RandomUtil; +import jnpf.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * 模块列表权限业务实现类 + * + * @author :JNPF开发平台组 + * @version: V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date :2022/3/15 9:40 + */ +@Service +public class ColumnsPurviewServiceImpl extends SuperServiceImpl implements ColumnsPurviewService { + @Autowired + private UserProvider userProvider; + + @Override + public ColumnsPurviewEntity getInfo(String moduleId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ColumnsPurviewEntity::getModuleId, moduleId); + return this.getOne(queryWrapper); + } + + @Override + public boolean update(String moduleId, ColumnsPurviewEntity entity) { + ColumnsPurviewEntity entitys = getInfo(moduleId); + // id不存在则是保存 + if (entitys == null) { + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(userProvider.get().getUserId()); + return this.save(entity); + } else { + // 修改 + entity.setId(entitys.getId()); + entity.setLastModifyUserId(userProvider.get().getUserId()); + entity.setLastModifyTime(DateUtil.getNowDate()); + } + return this.saveOrUpdate(entity); + } + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/GroupServiceImpl.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/GroupServiceImpl.java new file mode 100644 index 0000000..6503edc --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/GroupServiceImpl.java @@ -0,0 +1,153 @@ +package jnpf.permission.service.impl; + +import jnpf.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import jnpf.base.Pagination; +import jnpf.permission.entity.GroupEntity; +import jnpf.permission.mapper.GroupMapper; +import jnpf.permission.service.GroupService; +import jnpf.util.DateUtil; +import jnpf.util.RandomUtil; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 分组管理业务类实现类 + * + * @author :JNPF开发平台组 + * @version: V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date :2022/3/10 18:00 + */ +@Service +public class GroupServiceImpl extends SuperServiceImpl implements GroupService { + + @Autowired + private UserProvider userProvider; + + @Override + public List getList(Pagination pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + // 定义变量判断是否需要使用修改时间倒序 + boolean flag = false; + // 判断关键字 + String keyword = pagination.getKeyword(); + if (StringUtil.isNotEmpty(keyword)) { + flag = true; + queryWrapper.lambda().and( + t -> t.like(GroupEntity::getFullName, keyword).or().like(GroupEntity::getEnCode, keyword) + ); + } + // 获取列表 + queryWrapper.lambda().orderByAsc(GroupEntity::getSortCode).orderByDesc(GroupEntity::getCreatorTime); + if (flag) { + queryWrapper.lambda().orderByDesc(GroupEntity::getLastModifyTime); + } + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage iPage = this.page(page, queryWrapper); + return pagination.setData(iPage.getRecords(), iPage.getTotal()); + } + + @Override + public List list() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(GroupEntity::getEnabledMark, 1); + queryWrapper.lambda().orderByAsc(GroupEntity::getSortCode).orderByDesc(GroupEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public Map getGroupMap() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select(GroupEntity::getId,GroupEntity::getFullName); + return this.list(queryWrapper).stream().collect(Collectors.toMap(GroupEntity::getId,GroupEntity::getFullName)); + } + + @Override + public Map getGroupEncodeMap() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select(GroupEntity::getId,GroupEntity::getFullName,GroupEntity::getEnCode); + return this.list(queryWrapper).stream().collect(Collectors.toMap(group->group.getFullName() + "/" + group.getEnCode(),GroupEntity::getId)); + } + + @Override + public GroupEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(GroupEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public GroupEntity getInfo(String fullName,String enCode) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(GroupEntity::getFullName, fullName); + queryWrapper.lambda().eq(GroupEntity::getEnCode, enCode); + return this.getOne(queryWrapper); + } + + @Override + public void crete(GroupEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(userProvider.get().getUserId()); + entity.setCreatorTime(DateUtil.getNowDate()); + entity.setLastModifyTime(DateUtil.getNowDate()); + this.save(entity); + } + + @Override + public Boolean update(String id, GroupEntity entity) { + entity.setId(id); + entity.setLastModifyUserId(userProvider.get().getUserId()); + entity.setLastModifyTime(DateUtil.getNowDate()); + return this.updateById(entity); + } + + @Override + public void delete(GroupEntity entity) { + this.removeById(entity.getId()); + } + + @Override + public Boolean isExistByFullName(String fullName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(GroupEntity::getFullName, fullName); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(GroupEntity::getId, id); + } + return this.count(queryWrapper) > 0; + } + + @Override + public Boolean isExistByEnCode(String enCode, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(GroupEntity::getEnCode, enCode); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(GroupEntity::getId, id); + } + return this.count(queryWrapper) > 0; + } + + @Override + public List getListByIds(List list, Boolean filterEnabledMark) { + if (list.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(GroupEntity::getId, list); + if (filterEnabledMark) { + queryWrapper.lambda().eq(GroupEntity::getEnabledMark, 1); + } + return this.list(queryWrapper); + } + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/OrganizeAdministratorServiceImpl.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/OrganizeAdministratorServiceImpl.java new file mode 100644 index 0000000..cff23b2 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/OrganizeAdministratorServiceImpl.java @@ -0,0 +1,414 @@ +package jnpf.permission.service.impl; + +import jnpf.base.entity.ModuleEntity; +import jnpf.base.entity.SystemEntity; +import jnpf.base.service.ModuleService; +import jnpf.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import jnpf.base.Pagination; +import jnpf.base.service.SystemService; +import jnpf.constant.JnpfConst; +import jnpf.database.source.DbBase; +import jnpf.database.util.DataSourceUtil; +import jnpf.constant.PermissionConst; +import jnpf.permission.entity.OrganizeAdministratorEntity; +import jnpf.permission.entity.OrganizeEntity; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.entity.UserRelationEntity; +import jnpf.permission.mapper.OrganizeAdminIsTratorMapper; +import jnpf.permission.model.organizeadministrator.OrganizeAdministratorListVo; +import jnpf.permission.model.organizeadministrator.OrganizeAdministratorModel; +import jnpf.permission.service.OrganizeAdministratorService; +import jnpf.permission.service.OrganizeService; +import jnpf.permission.service.UserRelationService; +import jnpf.permission.service.UserService; +import jnpf.util.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 机构分级管理员 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +@Service +public class OrganizeAdministratorServiceImpl extends SuperServiceImpl implements OrganizeAdministratorService { + + @Autowired + private UserProvider userProvider; + @Autowired + private OrganizeService organizeService; + @Autowired + private UserService userService; + @Autowired + private UserRelationService userRelationService; + @Autowired + private DataSourceUtil dataSourceUtil; + @Autowired + private SystemService systemApi; + @Autowired + private ModuleService moduleApi; + + + @Override + public OrganizeAdministratorEntity getOne(String userId, String organizeId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if ("Oracle".equals(dataSourceUtil.getDbType()) || "DM".equals(dataSourceUtil.getDbType())) { + queryWrapper.eq("dbms_lob.substr(F_USER_ID)", userId); + } else if (DbBase.SQL_SERVER.equals(dataSourceUtil.getDbType())) { + queryWrapper.lambda().like(OrganizeAdministratorEntity::getUserId, userId); + } else { + queryWrapper.lambda().eq(OrganizeAdministratorEntity::getUserId, userId); + } + queryWrapper.lambda().eq(OrganizeAdministratorEntity::getOrganizeId, organizeId); + // 排序 + queryWrapper.lambda().orderByAsc(OrganizeAdministratorEntity::getSortCode) + .orderByDesc(OrganizeAdministratorEntity::getCreatorTime); + return this.getOne(queryWrapper); + } + + @Override + public List getOrganizeAdministratorEntity(String userId) { + return getOrganizeAdministratorEntity(userId, PermissionConst.ORGANIZE, false); + } + + @Override + public List getOrganizeAdministratorEntity(String userId, String type, boolean filterMain) { + List list = new ArrayList<>(); + UserEntity entity1 = userService.getInfo(userId); + if ((entity1 != null && entity1.getIsAdministrator() == 1) && !PermissionConst.ORGANIZE.equals(type)) { + List collect = new ArrayList<>(); + if (PermissionConst.SYSTEM.equals(type)) { + collect = systemApi.getList(null, false, false, filterMain, false).stream().map(SystemEntity::getId).collect(Collectors.toList()); + } else if (PermissionConst.MODULE.equals(type)) { + collect = moduleApi.getList().stream().map(ModuleEntity::getId).collect(Collectors.toList()); + } + for (String t : collect) { + OrganizeAdministratorEntity entity = new OrganizeAdministratorEntity(); + entity.setOrganizeId(t); + entity.setId(RandomUtil.uuId()); + entity.setOrganizeType(type); + entity.setUserId(userId); + list.add(entity); + } + return list; + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (PermissionConst.ORGANIZE.equals(type)) { + queryWrapper.lambda().isNull(OrganizeAdministratorEntity::getOrganizeType); + } else if (StringUtil.isNotEmpty(type)) { + queryWrapper.lambda().eq(OrganizeAdministratorEntity::getOrganizeType, type); + } + if ("Oracle".equals(dataSourceUtil.getDbType()) || "DM".equals(dataSourceUtil.getDbType())) { + queryWrapper.eq("dbms_lob.substr(F_USER_ID)", userId); + } else if (DbBase.SQL_SERVER.equals(dataSourceUtil.getDbType())) { + queryWrapper.lambda().like(OrganizeAdministratorEntity::getUserId, userId); + } else { + queryWrapper.lambda().eq(OrganizeAdministratorEntity::getUserId, userId); + } + // 排序 + queryWrapper.lambda().orderByAsc(OrganizeAdministratorEntity::getSortCode) + .orderByDesc(OrganizeAdministratorEntity::getCreatorTime); + list = this.list(queryWrapper); + return list; + } + + @Override + @Transactional + public void create(OrganizeAdministratorEntity entity) { + // 判断是新建还是删除 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrganizeAdministratorEntity::getOrganizeId, entity.getOrganizeId()); + if ("Oracle".equals(dataSourceUtil.getDbType()) || "DM".equals(dataSourceUtil.getDbType())) { + queryWrapper.eq("dbms_lob.substr(F_USER_ID)", entity.getUserId()); + } else if (DbBase.SQL_SERVER.equals(dataSourceUtil.getDbType())) { + queryWrapper.lambda().like(OrganizeAdministratorEntity::getUserId, entity.getUserId()); + } else { + queryWrapper.lambda().eq(OrganizeAdministratorEntity::getUserId, entity.getUserId()); + } + // 查出数据是否重复 + OrganizeAdministratorEntity administratorEntity = this.getOne(queryWrapper); + if (administratorEntity == null) { + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(UserProvider.getLoginUserId()); + entity.setCreatorTime(new Date()); + } else { + entity.setId(administratorEntity.getId()); + entity.setCreatorUserId(UserProvider.getLoginUserId()); + entity.setLastModifyTime(new Date()); + } + this.saveOrUpdate(entity); + } + + @Override + @Transactional + public void createList(List list, String userId) { + Date creatorTime = new Date(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + if ("Oracle".equals(dataSourceUtil.getDbType()) || "DM".equals(dataSourceUtil.getDbType())) { + queryWrapper.eq("dbms_lob.substr(F_USER_ID)", userId); + } else if (DbBase.SQL_SERVER.equals(dataSourceUtil.getDbType())) { + queryWrapper.lambda().like(OrganizeAdministratorEntity::getUserId, userId); + } else { + queryWrapper.lambda().eq(OrganizeAdministratorEntity::getUserId, userId); + } + queryWrapper.lambda().select(OrganizeAdministratorEntity::getCreatorTime); + List list1 = this.list(queryWrapper); + if (list1.size() > 0) { + Date creatorTime1 = list1.get(0).getCreatorTime(); + if (creatorTime1 != null) { + creatorTime = creatorTime1; + } + } + // 手动设置userId + Date finalCreatorTime = creatorTime; + list.forEach(t -> { + t.setUserId(userId); + t.setCreatorTime(finalCreatorTime); + }); + this.remove(queryWrapper); + for (OrganizeAdministratorEntity entity : list) { +// // 查出数据是否重复 +// OrganizeAdministratorEntity administratorEntity = this.getOne(queryWrapper); +// if (administratorEntity == null) { + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(UserProvider.getLoginUserId()); + entity.setCreatorTime(finalCreatorTime); +// } else { +// entity.setId(administratorEntity.getId()); +// entity.setCreatorUserId(UserProvider.getLoginUserId()); +// entity.setLastModifyTime(new Date()); +// } + this.saveOrUpdate(entity); + } + userService.delCurUser(userId); + } + + @Override + public boolean update(String organizeId, OrganizeAdministratorEntity entity) { + entity.setId(entity.getId()); + entity.setLastModifyTime(DateUtil.getNowDate()); + entity.setLastModifyUserId(UserProvider.getLoginUserId()); + return this.updateById(entity); + } + + @Override + public boolean deleteByUserId(String userId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if ("Oracle".equals(dataSourceUtil.getDbType()) || "DM".equals(dataSourceUtil.getDbType())) { + queryWrapper.eq("dbms_lob.substr(F_USER_ID)", userId); + } else if (DbBase.SQL_SERVER.equals(dataSourceUtil.getDbType())) { + queryWrapper.lambda().like(OrganizeAdministratorEntity::getUserId, userId); + } else { + queryWrapper.lambda().eq(OrganizeAdministratorEntity::getUserId, userId); + } + boolean remove = this.remove(queryWrapper); + userService.delCurUser(userId); + return remove; + } + + @Override + public OrganizeAdministratorEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrganizeAdministratorEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void delete(OrganizeAdministratorEntity entity) { + this.removeById(entity.getId()); + } + + @Override + public OrganizeAdministratorEntity getInfoByOrganizeId(String organizeId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrganizeAdministratorEntity::getOrganizeId, organizeId); + return this.getOne(queryWrapper); + } + + @Override + public List getListByOrganizeId(List organizeIdList) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(OrganizeAdministratorEntity::getOrganizeId, organizeIdList); + return this.list(queryWrapper); + } + + @Override + public List getList(Pagination pagination) { + List list = getOrganizeAdministratorEntity(UserProvider.getLoginUserId(), PermissionConst.ORGANIZE, false); + List organizeIdList = new ArrayList<>(16); + // 存放所有的有资格管理的组织id + if (userProvider.get().getIsAdministrator()) { + organizeIdList = organizeService.getListById(true).stream().map(OrganizeEntity::getId).collect(Collectors.toList()); + } else { + Set orgId = new HashSet<>(16); + // 判断自己是哪些组织的管理员 + list.stream().forEach(t-> { + if (t != null) { + // t.getThisLayerAdd() == 1 || t.getThisLayerEdit() == 1 || t.getThisLayerDelete() == 1 || (StringUtil.isNotEmpty(String.valueOf(t.getSubLayerSelect())) && t.getThisLayerSelect() == 1) + if (t.getSubLayerSelect() != null && t.getThisLayerSelect() == 1) { + orgId.add(t.getOrganizeId()); + } + // t.getSubLayerAdd() == 1 || t.getSubLayerEdit() == 1 || t.getSubLayerDelete() == 1 || (StringUtil.isNotEmpty(String.valueOf(t.getSubLayerSelect())) && t.getSubLayerSelect() == 1) + if (t.getSubLayerSelect() != null && t.getSubLayerSelect() == 1) { + List underOrganizations = organizeService.getUnderOrganizations(t.getOrganizeId(), true); + orgId.addAll(underOrganizations); + } + } + }); + organizeIdList = new ArrayList<>(orgId); + } + if (organizeIdList.size() < 1) { + organizeIdList.add(""); + } + List list1 = getListByOrganizeId(organizeIdList); + List userIdList = list1.stream().map(OrganizeAdministratorEntity::getUserId).distinct().collect(Collectors.toList()); + List finalOrganizeIdList = organizeIdList; + List userLists = new ArrayList<>(); + List finalUserLists = userLists; + userIdList.forEach(t -> { + List collect = userRelationService.getListByUserId(t).stream().filter(ur -> PermissionConst.ORGANIZE.equals(ur.getObjectType())).map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + List collect1 = finalOrganizeIdList.stream().filter(collect::contains).collect(Collectors.toList()); + if (collect1.size() > 0) { + finalUserLists.add(t); + } + }); + userLists = userLists.stream().distinct().collect(Collectors.toList()); + // 验证这些人是否有权限 + if (list.stream().anyMatch(t -> PermissionConst.SYSTEM.equals(t.getOrganizeType())) + || list.stream().anyMatch(t -> PermissionConst.SYSTEM.equals(t.getOrganizeType()))) { + + } + List userList = userService.getUserNames(userLists, pagination, true, false); + userList.forEach(t -> { + // 创建时间 + Date date = getOrganizeAdministratorEntity(t.getId()).stream().sorted(Comparator.comparing(OrganizeAdministratorEntity::getCreatorTime)).map(OrganizeAdministratorEntity::getCreatorTime).findFirst().orElse(null); + t.setCreatorTime(date); + // 所属组织 + List orgRelationByUserId = userRelationService.getAllOrgRelationByUserId(t.getId()); + StringBuilder orgName = new StringBuilder(); + orgRelationByUserId.stream().forEach(or -> { + OrganizeEntity organizeEntity = organizeService.getInfo(or.getObjectId()); + if (organizeEntity != null && StringUtil.isNotEmpty(organizeEntity.getOrganizeIdTree())) { + String fullNameByOrgIdTree = organizeService.getFullNameByOrgIdTree(organizeEntity.getOrganizeIdTree(), "/"); + orgName.append("," + fullNameByOrgIdTree); + } + }); + // 组织名称 + String org = orgName.length() > 0 ? orgName.toString().replaceFirst(",", "") : ""; + t.setOrganizeId(org); + }); + // 处理所属组织和创建时间 + List jsonToList = JsonUtil.getJsonToList(userList, OrganizeAdministratorListVo.class); + jsonToList = jsonToList.stream().filter(t -> t != null && t.getCreatorTime() != null).sorted(Comparator.comparing(OrganizeAdministratorListVo::getCreatorTime).reversed()).collect(Collectors.toList()); + return jsonToList; + } + + @Override + public List getOrganizeUserList(String type) { + if (UserProvider.getUser().getIsAdministrator()) { + return organizeService.getList(true).stream().map(OrganizeEntity::getId).collect(Collectors.toList()); + } + List list = getOrganizeAdministratorEntity(UserProvider.getLoginUserId()); + Set orgId = new HashSet<>(16); + // 判断自己是哪些组织的管理员 + list.stream().forEach(t -> { + if (t != null) { + if (t.getSubLayerSelect() != null && t.getThisLayerSelect() == 1) { + orgId.add(t.getOrganizeId()); + } + if (t.getSubLayerSelect() != null && t.getSubLayerSelect() == 1) { + List underOrganizations = organizeService.getUnderOrganizations(t.getOrganizeId(), true); + orgId.addAll(underOrganizations); + } + } + }); + List orgIds = new ArrayList<>(orgId); + if (JnpfConst.CURRENT_ORG_SUB.equals(type)) { + return orgIds; + } + List userList = userRelationService.getListByObjectIdAll(orgIds).stream().map(UserRelationEntity::getUserId).collect(Collectors.toList()); + return userList; + } + + @Override + public List getListByAuthorize() { + // 通过权限转树 + List listss = getOrganizeAdministratorEntity(UserProvider.getLoginUserId()); + Set orgIds = new HashSet<>(16); + // 判断自己是哪些组织的管理员 + listss.stream().forEach(t-> { + if (t != null) { + if (t.getThisLayerSelect() != null && t.getThisLayerSelect() == 1) { + orgIds.add(t.getOrganizeId()); + } + if (t.getSubLayerSelect() != null && t.getSubLayerSelect() == 1) { + List underOrganizations = organizeService.getUnderOrganizations(t.getOrganizeId(), true); + orgIds.addAll(underOrganizations); + } + } + }); + List list1 = new ArrayList<>(orgIds); + // 得到所有有权限的组织 + List organizeName = organizeService.getOrganizeName(list1); + return organizeName; + } + + @Override + public OrganizeAdministratorModel getOrganizeAdministratorList() { + // 通过权限转树 + List list = getOrganizeAdministratorEntity(userProvider.get().getUserId()); + List addList = new ArrayList<>(); + List editList = new ArrayList<>(); + List deleteList = new ArrayList<>(); + List selectList = new ArrayList<>(); + // 判断自己是哪些组织的管理员 + list.forEach(t -> { + if (t != null) { + //查询 + if (t.getThisLayerSelect() != null && t.getThisLayerSelect() == 1) { + selectList.add(t.getOrganizeId()); + //修改 + if (t.getThisLayerEdit() != null && t.getThisLayerEdit() == 1) { + editList.add(t.getOrganizeId()); + } + //删除 + if (t.getThisLayerDelete() != null && t.getThisLayerDelete() == 1) { + deleteList.add(t.getOrganizeId()); + } + //新增 + if (t.getThisLayerAdd() != null && t.getThisLayerAdd() == 1) { + addList.add(t.getOrganizeId()); + } + } + //查询 + if (t.getSubLayerSelect() != null && t.getSubLayerSelect() == 1) { + List underOrganizations = organizeService.getUnderOrganizations(t.getOrganizeId(), false); + selectList.addAll(underOrganizations); + //修改 + if (t.getSubLayerEdit() != null && t.getSubLayerEdit() == 1) { + editList.addAll(underOrganizations); + } + //删除 + if (t.getSubLayerDelete() != null && t.getSubLayerDelete() == 1) { + deleteList.addAll(underOrganizations); + } + //新增 + if (t.getSubLayerAdd() != null && t.getSubLayerAdd() == 1) { + addList.addAll(underOrganizations); + } + } + } + }); + OrganizeAdministratorModel model = new OrganizeAdministratorModel(addList,editList,deleteList,selectList); + return model; + } + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/OrganizeRelationServiceImpl.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/OrganizeRelationServiceImpl.java new file mode 100644 index 0000000..52f4e47 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/OrganizeRelationServiceImpl.java @@ -0,0 +1,351 @@ +package jnpf.permission.service.impl; + +import jnpf.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import jnpf.constant.JnpfConst; +import jnpf.constant.PermissionConst; +import jnpf.permission.entity.*; +import jnpf.permission.mapper.OrganizeRelationMapper; +import jnpf.permission.model.organize.OrganizeConditionModel; +import jnpf.permission.model.organize.OrganizeModel; +import jnpf.permission.service.*; +import jnpf.util.JsonUtil; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; + +/** + *

+ * 组织关系 服务实现类 + *

+ * + * @author YanYu + * @since 2022-01-19 + */ +@Service +public class OrganizeRelationServiceImpl extends SuperServiceImpl implements OrganizeRelationService { + + @Autowired + RoleService roleService; + @Autowired + PositionService positionService; + @Autowired + UserRelationService userRelationService; + @Autowired + UserService userService; + @Autowired + AuthorizeService authorizeService; + @Autowired + OrganizeService organizeService; + @Autowired + OrganizeAdministratorService organizeAdministratorService; + @Autowired + PermissionGroupService permissionGroupService; + + @Override + public List getRelationListByOrganizeId(List organizeIds) { + if (organizeIds.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper query = new QueryWrapper<>(); + query.lambda().in(OrganizeRelationEntity::getOrganizeId, organizeIds); + query.lambda().orderByDesc(OrganizeRelationEntity::getCreatorTime); + return this.list(query); + } + + @Override + public List getRelationListByOrganizeId(List organizeIds, String objectType) { + QueryWrapper query = new QueryWrapper<>(); + // 查询组织关系表集合 + if(StringUtil.isNotEmpty(objectType)) { + query.lambda().eq(OrganizeRelationEntity::getObjectType, objectType); + } + if(organizeIds.size() > 0){ + query.lambda().in(OrganizeRelationEntity::getOrganizeId, organizeIds); + } else { + organizeIds.add(""); + query.lambda().in(OrganizeRelationEntity::getOrganizeId, organizeIds); + } + query.lambda().orderByDesc(OrganizeRelationEntity::getCreatorTime); + return this.list(query); + } + + @Override + public List getPositionListByOrganizeId(List organizeIds) { + if(organizeIds.size() > 0){ + QueryWrapper query = new QueryWrapper<>(); + // 查询组织关系表集合 + query.lambda().eq(OrganizeRelationEntity::getObjectType, PermissionConst.POSITION); + query.lambda().in(OrganizeRelationEntity::getOrganizeId, organizeIds); + query.lambda().orderByDesc(OrganizeRelationEntity::getCreatorTime); + return this.list(query).stream().map(OrganizeRelationEntity::getObjectId).collect(Collectors.toList()); + } + return new ArrayList<>(); + } + + @Override + public List getRelationListByRoleId(String roleId) { + QueryWrapper query = new QueryWrapper<>(); + // 查询组织关系表集合 + query.lambda().eq(OrganizeRelationEntity::getObjectType, PermissionConst.ROLE); + query.lambda().in(OrganizeRelationEntity::getObjectId, roleId); + query.lambda().orderByDesc(OrganizeRelationEntity::getCreatorTime); + return this.list(query); + } + + @Override + public List getRelationListByRoleIdList(List roleId) { + QueryWrapper query = new QueryWrapper<>(); + // 查询组织关系表集合 + query.lambda().eq(OrganizeRelationEntity::getObjectType, PermissionConst.ROLE); + query.lambda().in(OrganizeRelationEntity::getObjectId, roleId); + query.lambda().orderByDesc(OrganizeRelationEntity::getCreatorTime); + return this.list(query); + } + + @Override + public List getRelationListByObjectIdAndType(String objectType, String objectId) { + QueryWrapper query = new QueryWrapper<>(); + query.lambda().eq(OrganizeRelationEntity::getObjectId, objectId); + query.lambda().eq(OrganizeRelationEntity::getObjectType, objectType); + return this.list(query); + } + + @Override + public Boolean existByRoleIdAndOrgId(String roleId, String organizeId) { + QueryWrapper query = new QueryWrapper<>(); + query.lambda().eq(OrganizeRelationEntity::getObjectType, PermissionConst.ROLE); + query.lambda().in(OrganizeRelationEntity::getObjectId, roleId); + query.lambda().in(OrganizeRelationEntity::getOrganizeId, organizeId); + return count(query) > 0; + } + + @Override + public Boolean existByObjTypeAndOrgId(String objectType, String organizeId) { + return existByObjAndOrgId(objectType, null, organizeId); + } + + @Override + public Boolean existByObjAndOrgId(String objectType, String objId, String organizeId) { + QueryWrapper query = new QueryWrapper<>(); + query.lambda().eq(OrganizeRelationEntity::getObjectType, objectType); + if(StringUtil.isNotEmpty(objId)){ + query.lambda().eq(OrganizeRelationEntity::getObjectId, objId); + } + query.lambda().in(OrganizeRelationEntity::getOrganizeId, organizeId); + return count(query) > 0; + } + + + @Override + public List getRelationListByType(String objectType) { + QueryWrapper query = new QueryWrapper<>(); + // 查询组织关系表集合 + query.lambda().eq(OrganizeRelationEntity::getObjectType, objectType); + query.lambda().orderByDesc(OrganizeRelationEntity::getCreatorTime); + return this.list(query); + } + + @Override + public List getListByTypeAndOrgId(String objectType, String orgId) { + QueryWrapper query = new QueryWrapper<>(); + // 查询组织关系表集合 + query.lambda().eq(OrganizeRelationEntity::getObjectType, objectType) + .eq(OrganizeRelationEntity::getOrganizeId, orgId); + return this.list(query); + } + + @Override + public Boolean deleteAllByRoleId(String roleId) { + QueryWrapper query = new QueryWrapper<>(); + query.lambda().eq(OrganizeRelationEntity::getObjectType, PermissionConst.ROLE); + query.lambda().eq(OrganizeRelationEntity::getObjectId, roleId); + return this.remove(query); + } + + + /*========================== 自动切换岗位,组织相关 ==============================*/ + + + @Override + public String autoGetMajorPositionId(String userId, String currentMajorOrgId, String currentMajorPosId){ + // 属于该该组织底下的岗位 + List positionList = positionService.getListByOrgIdAndUserId(currentMajorOrgId, userId); + if(positionList.size() > 0){ + // 默认岗位是否在此组织内,若存在不做切换 + if(positionList.stream().anyMatch(p -> p.getId().equals(currentMajorPosId))){ + return currentMajorPosId; + }else{ + // 默认第一个岗位 + return positionList.get(0).getId(); + } + } + return ""; + } + + @Override + public String autoGetMajorOrganizeId(String userId, List userAllOrgIds, String currentMajorOrgId){ + if(userAllOrgIds.size() > 0){ + if (userAllOrgIds.contains(currentMajorOrgId) && checkBasePermission(userId, currentMajorOrgId).size() > 0) { + // 保持原默认组织不切换 + return currentMajorOrgId; + }else{ + // 去除原本默认组织ID + List selectOrgIds = userAllOrgIds.stream().filter(usi-> !usi.equals(currentMajorOrgId)).collect(Collectors.toList()); + // 若不存在,强制切换有基本登录权限的角色 + for (String orgId : selectOrgIds) { + if (this.checkBasePermission(userId, orgId).size() > 0) { + // 这个组织ID底下角色存在基础登录权限 + return orgId; + } + } + } + // 随机赋值一个 + return userAllOrgIds.get(0); + }else { + return ""; + } + } + + + + + /*== 自动key.equals ==*/ + + @Override + public void autoSetOrganize(List allUpdateUserIds){ + if(allUpdateUserIds.size() > 0){ + for (UserEntity userEntity : userService.listByIds(allUpdateUserIds)) { + String useId = userEntity.getId(); + String majorOrgId = userEntity.getOrganizeId(); + List orgList = userRelationService.getListByObjectType(useId, PermissionConst.ORGANIZE) + .stream().map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + String changeOrgId = this.autoGetMajorOrganizeId(useId, orgList, majorOrgId); + if(!changeOrgId.equals(majorOrgId)){ + // 切换默认组织 + UserEntity updateUserEntity = new UserEntity(); + updateUserEntity.setId(useId); + updateUserEntity.setOrganizeId(changeOrgId); + userService.updateById(updateUserEntity); + } + } + } + } + + @Override + public void autoSetPosition(List allUpdateUserIds){ + if(allUpdateUserIds.size() > 0){ + for (UserEntity user : userService.listByIds(allUpdateUserIds)) { + String majorPosId = user.getPositionId(); + String changePositionId = this.autoGetMajorPositionId(user.getId(), user.getOrganizeId(), majorPosId); + if(!changePositionId.equals(majorPosId)){ + UserEntity updateUser = new UserEntity(); + updateUser.setId(user.getId()); + updateUser.setPositionId(changePositionId); + userService.updateById(updateUser); + } + } + } + } + + + /*===================== 权限判断 =======================*/ + + @Override + public List checkBasePermission(String userId, String orgId){ + List permissionGroupByUserId = permissionGroupService.getPermissionGroupByUserId(userId, orgId, false); + return permissionGroupByUserId; + } + + @Override + public List getOrgIds(List departIds, String type) { + List idList = new ArrayList<>(16); + // 获取所有组织 + if (departIds.size() > 0) { + List collect = departIds.stream().filter(JnpfConst.SYSTEM_PARAM.keySet()::contains).collect(Collectors.toList()); + String organizeId = UserProvider.getUser().getOrganizeId(); + collect.forEach(t -> { + if (JnpfConst.CURRENT_ORG.equals(t) || JnpfConst.CURRENT_ORG_TYPE.equals(t)) { + idList.add(organizeId + "--" + jnpf.constant.PermissionConst.COMPANY); + idList.add(organizeId); + } else if (JnpfConst.CURRENT_ORG_SUB.equals(t) || JnpfConst.CURRENT_ORG_SUB_TYPE.equals(t)) { + List underOrganizations = organizeService.getUnderOrganizations(organizeId, true); + underOrganizations.add(organizeId); + underOrganizations.forEach(orgId -> { + idList.add(orgId + "--" + jnpf.constant.PermissionConst.COMPANY); + idList.add(orgId); + }); + } else if (JnpfConst.CURRENT_GRADE.equals(t) || JnpfConst.CURRENT_GRADE_TYPE.equals(t)) { + List organizeUserList = organizeAdministratorService.getOrganizeUserList(JnpfConst.CURRENT_ORG_SUB); + organizeUserList.forEach(orgId -> { + idList.add(orgId + "--" + jnpf.constant.PermissionConst.COMPANY); + idList.add(orgId); + }); + } + }); + departIds.removeAll(collect); + idList.addAll(departIds); + for (String departId : departIds) { + String[] split = departId.split("--"); + if (split.length == 1 || split.length == 0) { + continue; + } + if (split.length > 1) { + if (jnpf.constant.PermissionConst.ORGANIZE.equals(split[1])) { + departId= split[0]; + } + if (jnpf.constant.PermissionConst.DEPARTMENT.equals(split[1])) { + departId = split[0]; + } + } + if (!jnpf.constant.PermissionConst.ROLE.equals(type)) { + List underOrganizations = organizeService.getUnderOrganizations(departId, true); + if (underOrganizations.size() > 0) { + idList.addAll(underOrganizations); + idList.add(organizeId); + } + } + } + } + return idList.stream().distinct().collect(Collectors.toList()); + } + + @Override + public List getOrgIdsList(OrganizeConditionModel organizeConditionModel) { + List ids = new ArrayList<>(); + List orgIds = getOrgIds(organizeConditionModel.getDepartIds(), null); + orgIds.forEach(t -> ids.add(t.split("--")[0])); + List listAll = organizeService.getListAll(ids, organizeConditionModel.getKeyword()); + List organizeList = JsonUtil.getJsonToList(listAll, OrganizeModel.class); + organizeList.forEach(t->{ + t.setIcon("department".equals(t.getType()) ? "icon-ym icon-ym-tree-department1" : "icon-ym icon-ym-tree-organization3"); + t.setLastFullName(t.getFullName()); + if (StringUtil.isNotEmpty(t.getOrganizeIdTree())) { + t.setOrganizeIds(Arrays.asList(t.getOrganizeIdTree().split(","))); + t.setOrganize(organizeService.getFullNameByOrgIdTree(t.getOrganizeIdTree(), "/")); + String[] split = t.getOrganizeIdTree().split(","); + List list = Arrays.asList(split); + Collections.reverse(list); + for (int i = 1; i < list.size(); i++) { + String orgId = list.get(i); + List collect1 = organizeList.stream().filter(tt -> orgId.equals(tt.getId())).collect(Collectors.toList()); + if (collect1.size() > 0) { + String[] split1 = StringUtil.isNotEmpty(t.getOrganizeIdTree()) ? t.getOrganizeIdTree().split(orgId) : new String[0]; + if (split1.length > 0) { + t.setFullName(organizeService.getFullNameByOrgIdTree(split1[1], "/")); + } + t.setOrganize(organizeService.getFullNameByOrgIdTree(t.getOrganizeIdTree(), "/")); + t.setParentId(orgId); + break; + } + } + } + }); + return organizeList; + } + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/OrganizeServiceImpl.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/OrganizeServiceImpl.java new file mode 100644 index 0000000..55bbb08 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/OrganizeServiceImpl.java @@ -0,0 +1,948 @@ +package jnpf.permission.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; +import com.google.common.collect.ImmutableMap; +import jnpf.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import jnpf.base.ActionResult; +import jnpf.constant.MsgCode; +import jnpf.constant.PermissionConst; +import jnpf.message.service.SynThirdDingTalkService; +import jnpf.message.service.SynThirdQyService; +import jnpf.permission.entity.OrganizeAdministratorEntity; +import jnpf.permission.entity.OrganizeEntity; +import jnpf.permission.entity.PositionEntity; +import jnpf.permission.mapper.OrganizeMapper; +import jnpf.permission.service.*; +import jnpf.util.*; +import jnpf.permission.model.organize.OrganizeConditionModel; +import jnpf.permission.model.organize.OrganizeModel; +import jnpf.base.UserInfo; +import jnpf.util.treeutil.SumTree; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; + +import java.util.*; +import java.util.concurrent.Executor; +import java.util.stream.Collectors; + +/** + * 组织机构 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +@Service +public class OrganizeServiceImpl extends SuperServiceImpl implements OrganizeService { + + @Autowired + private PositionService positionService; + @Autowired + private CacheKeyUtil cacheKeyUtil; + @Autowired + private UserService userService; + @Autowired + private RedisUtil redisUtil; + @Autowired + private UserProvider userProvider; + @Autowired + private UserRelationService userRelationService; + @Autowired + private OrganizeRelationService organizeRelationService; + @Autowired + private SynThirdQyService synThirdQyService; + @Autowired + private SynThirdDingTalkService synThirdDingTalkService; + @Autowired + private Executor threadPoolExecutor; + @Autowired + private OrganizeAdministratorService organizeAdministratorService; + + + @Override + public List getListAll(List idAll, String keyWord) { + // 定义变量判断是否需要使用修改时间倒序 + boolean flag = false; + List list = new ArrayList<>(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(keyWord)) { + flag = true; + queryWrapper.lambda().and( + t -> t.like(OrganizeEntity::getFullName, keyWord) + .or().like(OrganizeEntity::getEnCode, keyWord) + ); + } + // 排序 + queryWrapper.lambda().orderByAsc(OrganizeEntity::getSortCode) + .orderByDesc(OrganizeEntity::getCreatorTime); + if (flag) { + queryWrapper.lambda().orderByDesc(OrganizeEntity::getLastModifyTime); + } + if (idAll.size() > 0) { + queryWrapper.lambda().in(OrganizeEntity::getId, idAll); + list = this.list(queryWrapper); + } + return list; + } + + @Override + public List getParentIdList(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrganizeEntity::getParentId, id); + queryWrapper.lambda().eq(OrganizeEntity::getCategory, PermissionConst.DEPARTMENT); + queryWrapper.lambda().orderByAsc(OrganizeEntity::getSortCode) + .orderByDesc(OrganizeEntity::getCreatorTime); + List list = this.list(queryWrapper); + return list; + } + + @Override + public List getList(boolean filterEnabledMark) { + return getList(null, filterEnabledMark); + } + + @Override + public List getListByEnabledMark(Boolean enable) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (enable) { + queryWrapper.lambda().eq(OrganizeEntity::getEnabledMark, 1); + } + Map orgMaps = getBaseOrgMaps(queryWrapper, ImmutableMap.of( + OrganizeEntity::getSortCode, true, + OrganizeEntity::getCreatorTime, false) + , null); + +// Map entityList = new LinkedHashMap<>(); +// if (StringUtil.isNotEmpty(keyword)) { +// getParentOrganize(orgMaps, orgMaps, entityList); +// orgMaps.clear(); +// orgMaps = entityList; +// } + return new LinkedList<>(orgMaps.values()); + } + + @Override + public OrganizeEntity getIdListByFullName(String fullName) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrganizeEntity::getFullName, fullName); + queryWrapper.lambda().select(OrganizeEntity::getId); + return this.getOne(queryWrapper); + } + + @Override + public List getList(String keyword, boolean filterEnabledMark) { + return new LinkedList<>(getOrgMaps(keyword, filterEnabledMark).values()); + } + + + /** + * 获取组织信息 + * @return OrgId, OrgEntity + */ + @Override + public Map getOrgMapsAll(SFunction... columns) { + return getOrgMaps(null, false, columns); + } + + /** + * 获取组织信息 + * @param keyword + * @param filterEnabledMark + * @return OrgId, OrgEntity + */ + @Override + public Map getOrgMaps(String keyword, boolean filterEnabledMark, SFunction... columns) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(keyword)) { + queryWrapper.lambda().and( + t -> t.like(OrganizeEntity::getFullName, keyword) + .or().like(OrganizeEntity::getFullName, keyword.toLowerCase()) + ); + } + if (filterEnabledMark) { + queryWrapper.lambda().eq(OrganizeEntity::getEnabledMark, 1); + } + Map orgMaps = getBaseOrgMaps(queryWrapper, ImmutableMap.of( + OrganizeEntity::getSortCode, true, + OrganizeEntity::getCreatorTime, false) + , null); + + Map entityList = new LinkedHashMap<>(); + if (StringUtil.isNotEmpty(keyword)) { + getParentOrganize(orgMaps, orgMaps, entityList); + orgMaps.clear(); + orgMaps = entityList; + } + return orgMaps; + } + + + /** + * 组织基础过滤 + * @param queryWrapper + * @param orderBy Map + * @param groupBy Column + * @param columns query + * @return + */ + public Map getBaseOrgMaps(QueryWrapper queryWrapper, Map, Boolean> orderBy, List> groupBy, SFunction... columns) { + if(queryWrapper == null){ + queryWrapper = new QueryWrapper<>(); + } + LambdaQueryWrapper lambdaQueryWrapper = queryWrapper.lambda(); + + List> columnList; + List> bigColumnList = null; + //没有指定查询字段就返回全部字段 + if(columns == null || columns.length == 0){ + columnList = Arrays.asList(OrganizeEntity::getId + ,OrganizeEntity::getParentId + ,OrganizeEntity::getCategory + ,OrganizeEntity::getEnCode + ,OrganizeEntity::getFullName + ,OrganizeEntity::getManagerId + ,OrganizeEntity::getSortCode + ,OrganizeEntity::getEnabledMark + ,OrganizeEntity::getCreatorTime + ,OrganizeEntity::getCreatorUserId + ,OrganizeEntity::getLastModifyTime + ,OrganizeEntity::getLastModifyUserId + ,OrganizeEntity::getDeleteMark + ,OrganizeEntity::getDeleteTime + ,OrganizeEntity::getDeleteUserId + ,OrganizeEntity::getTenantId); + //把长文本字段分开查询, 默认带有排序, 数据量大的情况长文本字段参与排序速度非常慢 + bigColumnList = Arrays.asList(OrganizeEntity::getDescription + ,OrganizeEntity::getPropertyJson + ,OrganizeEntity::getOrganizeIdTree); + }else{ + columnList = new ArrayList<>(Arrays.asList(columns)); + //指定字段中没有ID, 强制添加ID字段 + if(!columnList.contains((SFunction)OrganizeEntity::getId)){ + columnList.add(OrganizeEntity::getId); + } + } + lambdaQueryWrapper.select(columnList); + QueryWrapper bigColumnQuery = null; + if(bigColumnList != null){ + //获取大字段不参与排序 + bigColumnQuery = queryWrapper.clone(); + } + //排序 + if(orderBy != null && !orderBy.isEmpty()){ + orderBy.forEach((k,v)->{ + lambdaQueryWrapper.orderBy(true, v, k); + }); + } + //分组 + if(groupBy != null && !groupBy.isEmpty()){ + lambdaQueryWrapper.groupBy(groupBy); + } + List list = this.list(queryWrapper); + + Map orgMaps = new LinkedHashMap<>(list.size(), 1); + list.forEach(t->orgMaps.put(t.getId(), t)); + + if(bigColumnList != null) { + //获取大字段数据 + bigColumnQuery.lambda().select(OrganizeEntity::getId, OrganizeEntity::getOrganizeIdTree); + List listBigFields = this.list(bigColumnQuery); + listBigFields.forEach(t -> { + OrganizeEntity organizeEntity = orgMaps.get(t.getId()); + if (organizeEntity != null) { + organizeEntity.setOrganizeIdTree(t.getOrganizeIdTree()); + } + }); + } + return orgMaps; + } + + /** + * 获取父级集合 + * + * @param list 需要遍历的集合 + * @param entityList 结果集 + */ + private void getParentOrganize(Map list, Map searchList, Map entityList) { + Map list1 = new LinkedHashMap<>(); + searchList.forEach((id, entity) -> { + entityList.put(id, entity); + OrganizeEntity info = list.get(id); + if(info == null){ + info = getInfo(id); + } + if (Objects.nonNull(info)) { + list1.put(id, info); + if (StringUtil.isNotEmpty(info.getParentId()) && !"-1".equals(info.getParentId())) { + getParentOrganize(list, list1, entityList); + } else if (StringUtil.isNotEmpty(info.getParentId()) && "-1".equals(info.getParentId())) { + entityList.put(id, info); + } + } + }); + } + + @Override + public List getOrgEntityList(List idList, Boolean enable) { + if (idList.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (enable) { + queryWrapper.lambda().eq(OrganizeEntity::getEnabledMark, 1); + } + queryWrapper.lambda().in(OrganizeEntity::getId, idList); +// queryWrapper.lambda().select(OrganizeEntity::getId, OrganizeEntity::getFullName); + return this.list(queryWrapper); + } + return new ArrayList<>(); + } + + @Override + public List getOrgEntityList(Set idList) { + if (idList.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select(OrganizeEntity::getId, OrganizeEntity::getFullName).in(OrganizeEntity::getId, idList); + List list = this.list(queryWrapper); + return list; + } + return new ArrayList<>(); + } + + @Override + public Map getOrgMap() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select(OrganizeEntity::getId, OrganizeEntity::getFullName); + List list = this.list(queryWrapper); + return list.stream().collect(Collectors.toMap(OrganizeEntity::getId, OrganizeEntity::getFullName)); + } + + @Override + public Map getOrgEncodeAndName(String type) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select(OrganizeEntity::getId, OrganizeEntity::getFullName ,OrganizeEntity::getEnCode); + queryWrapper.lambda().eq(OrganizeEntity::getCategory, type); + List list = this.list(queryWrapper); + return list.stream().collect(Collectors.toMap(o->o.getFullName()+ "/"+o.getEnCode(), OrganizeEntity::getId, (v1,v2)->v2)); + } + @Override + public Map getOrgNameAndId(String type) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select(OrganizeEntity::getId, OrganizeEntity::getFullName); + if (StringUtil.isNotEmpty(type)){ + queryWrapper.lambda().eq(OrganizeEntity::getCategory, type); + } + List list = this.list(queryWrapper); + Map allOrgMap = new HashMap<>(); + for (OrganizeEntity entity : list){ + allOrgMap.put(entity.getFullName(),entity.getId()); + } + return allOrgMap; + } + + + @Override + public List getOrgRedisList() { + if (redisUtil.exists(cacheKeyUtil.getOrganizeList())) { + return JsonUtil.getJsonToList(redisUtil.getString(cacheKeyUtil.getOrganizeList()).toString(), OrganizeEntity.class); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrganizeEntity::getEnabledMark, 1); + + List list = this.list(queryWrapper); + if (list.size() > 0) { + redisUtil.insert(cacheKeyUtil.getOrganizeList(), JsonUtil.getObjectToString(list), 300); + } + return list; + } + + @Override + public OrganizeEntity getInfo(String id) { + return this.getById(id); + } + + @Override + public OrganizeEntity getByFullName(String fullName) { + OrganizeEntity organizeEntity = new OrganizeEntity(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrganizeEntity::getFullName, fullName); + queryWrapper.lambda().select(OrganizeEntity::getId); + List list = this.list(queryWrapper); + if (list.size() > 0) { + organizeEntity = list.get(0); + } + return organizeEntity; + } + + @Override + public OrganizeEntity getByFullName(String fullName, String category, String enCode) { + OrganizeEntity organizeEntity = new OrganizeEntity(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrganizeEntity::getFullName, fullName); + queryWrapper.lambda().eq(OrganizeEntity::getCategory, category); + queryWrapper.lambda().eq(OrganizeEntity::getEnCode, enCode); + queryWrapper.lambda().select(OrganizeEntity::getId); + List list = this.list(queryWrapper); + if (list.size() > 0) { + organizeEntity = list.get(0); + } + return organizeEntity; + } + + @Override + public boolean isExistByFullName(OrganizeEntity entity, boolean isCheck, boolean isFilter) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrganizeEntity::getFullName, entity.getFullName()); + if (!isCheck) { + if (isFilter) { + queryWrapper.lambda().ne(OrganizeEntity::getId, entity.getId()); + } + List entityList = this.list(queryWrapper); + if (entityList.size() > 0) { + for (OrganizeEntity organizeEntity : entityList) { + if (organizeEntity != null && organizeEntity.getParentId().equals(entity.getParentId()) && organizeEntity.getCategory().equals(entity.getCategory())) { + return true; + } + } + } + return false; + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public void getOrganizeIdTree(String organizeId, List organizeParentIdList) { + OrganizeEntity entity = getInfo(organizeId); + if (entity != null) { + organizeParentIdList.add(entity.getId()); + if (StringUtil.isNotEmpty(entity.getParentId())) { + getOrganizeIdTree(entity.getParentId(), organizeParentIdList); + } + } + } + + @Override + public void getOrganizeId(String organizeId, List organizeList) { + OrganizeEntity entity = getInfo(organizeId); + if (entity != null) { + organizeList.add(entity); + if (StringUtil.isNotEmpty(entity.getParentId())) { + getOrganizeId(entity.getParentId(), organizeList); + } + } + } + + @Override + public boolean isExistByEnCode(String enCode, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrganizeEntity::getEnCode, enCode); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(OrganizeEntity::getId, id); + } + return this.count(queryWrapper) > 0; + } + + @Override + public void create(OrganizeEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(userProvider.get().getUserId()); + // 拼上当前组织id + String organizeIdTree = StringUtil.isNotEmpty(entity.getOrganizeIdTree()) ? entity.getOrganizeIdTree() + "," : ""; + entity.setOrganizeIdTree(organizeIdTree + entity.getId()); + if (!userProvider.get().getIsAdministrator()) { + // 当前用户创建的组织要赋予权限 + OrganizeAdministratorEntity organizeAdministratorEntity = new OrganizeAdministratorEntity(); + organizeAdministratorEntity.setUserId(userProvider.get().getUserId()); + organizeAdministratorEntity.setOrganizeId(entity.getId()); + organizeAdministratorEntity.setThisLayerAdd(1); + organizeAdministratorEntity.setThisLayerEdit(1); + organizeAdministratorEntity.setThisLayerDelete(1); + organizeAdministratorEntity.setThisLayerSelect(1); + organizeAdministratorEntity.setSubLayerAdd(0); + organizeAdministratorEntity.setSubLayerEdit(0); + organizeAdministratorEntity.setSubLayerDelete(0); + organizeAdministratorEntity.setSubLayerSelect(0); + organizeAdministratorService.create(organizeAdministratorEntity); + } + this.save(entity); + redisUtil.remove(cacheKeyUtil.getOrganizeInfoList()); + } + + @Override + public boolean update(String id, OrganizeEntity entity) { + entity.setId(id); + entity.setLastModifyTime(DateUtil.getNowDate()); + entity.setLastModifyUserId(userProvider.get().getUserId()); + // 拼上当前组织id + String organizeIdTree = StringUtil.isNotEmpty(entity.getOrganizeIdTree()) ? entity.getOrganizeIdTree() + "," : ""; + entity.setOrganizeIdTree(organizeIdTree + entity.getId()); + // 判断父级是否变化 + OrganizeEntity info = getInfo(id); + boolean updateById = this.updateById(entity); + if (info != null && !entity.getParentId().equals(info.getParentId())) { + // 子集和父级都需要修改父级树 + update(entity, info.getCategory()); + } + redisUtil.remove(cacheKeyUtil.getOrganizeInfoList()); + return updateById; + } + + @Override + public void update(OrganizeEntity entity, String category) { + // 查询子级 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrganizeEntity::getParentId, entity.getId()); + if (PermissionConst.COMPANY.equals(category)) { + queryWrapper.lambda().eq(OrganizeEntity::getCategory, PermissionConst.COMPANY); + } else { + queryWrapper.lambda().eq(OrganizeEntity::getCategory, PermissionConst.DEPARTMENT); + } + List list = this.list(queryWrapper); + // 递归修改子组织的父级id字段 + for (OrganizeEntity organizeEntity : list) { + List list1 = new ArrayList<>(); + getOrganizeIdTree(organizeEntity.getId(), list1); + // 倒叙排放 + Collections.reverse(list1); + StringBuilder organizeIdTree = new StringBuilder(); + for (String organizeParentId : list1) { + organizeIdTree.append("," + organizeParentId); + } + String organizeParentIdTree = organizeIdTree.toString(); + if (StringUtil.isNotEmpty(organizeParentIdTree)) { + organizeParentIdTree = organizeParentIdTree.replaceFirst(",", ""); + } + organizeEntity.setOrganizeIdTree(organizeParentIdTree); + this.updateById(organizeEntity); + redisUtil.remove(cacheKeyUtil.getOrganizeInfoList()); + } + } + + @Override + public ActionResult delete(String orgId) { + String flag = this.allowDelete(orgId); + if (flag == null) { + OrganizeEntity organizeEntity = this.getInfo(orgId); + if (organizeEntity != null) { + this.removeById(orgId); + redisUtil.remove(cacheKeyUtil.getOrganizeInfoList()); + threadPoolExecutor.execute(() -> { + try { + //删除部门后判断是否需要同步到企业微信 + synThirdQyService.deleteDepartmentSysToQy(false, orgId, ""); + //删除部门后判断是否需要同步到钉钉 + synThirdDingTalkService.deleteDepartmentSysToDing(false, orgId, ""); + } catch (Exception e) { + log.error("删除部门后同步失败到企业微信或钉钉失败,异常:" + e.getMessage()); + } + }); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } else { + return ActionResult.fail("此记录与\"" + flag + "\"关联引用,不允许被删除"); + } + } + + @Override + @DSTransactional + public boolean first(String id) { + boolean isOk = false; + //获取要上移的那条数据的信息 + OrganizeEntity upEntity = this.getById(id); + Long upSortCode = upEntity.getSortCode() == null ? 0 : upEntity.getSortCode(); + //查询上几条记录 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .lt(OrganizeEntity::getSortCode, upSortCode) + .eq(OrganizeEntity::getParentId, upEntity.getParentId()) + .orderByDesc(OrganizeEntity::getSortCode); + List downEntity = this.list(queryWrapper); + if (downEntity.size() > 0) { + //交换两条记录的sort值 + Long temp = upEntity.getSortCode(); + upEntity.setSortCode(downEntity.get(0).getSortCode()); + downEntity.get(0).setSortCode(temp); + this.updateById(downEntity.get(0)); + this.updateById(upEntity); + isOk = true; + } + return isOk; + } + + @Override + @DSTransactional + public boolean next(String id) { + boolean isOk = false; + //获取要下移的那条数据的信息 + OrganizeEntity downEntity = this.getById(id); + Long upSortCode = downEntity.getSortCode() == null ? 0 : downEntity.getSortCode(); + //查询下几条记录 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .gt(OrganizeEntity::getSortCode, upSortCode) + .eq(OrganizeEntity::getParentId, downEntity.getParentId()) + .orderByAsc(OrganizeEntity::getSortCode); + List upEntity = this.list(queryWrapper); + if (upEntity.size() > 0) { + //交换两条记录的sort值 + Long temp = downEntity.getSortCode(); + downEntity.setSortCode(upEntity.get(0).getSortCode()); + upEntity.get(0).setSortCode(temp); + this.updateById(upEntity.get(0)); + this.updateById(downEntity); + isOk = true; + } + return isOk; + } + + @Override + public String allowDelete(String orgId) { + // 组织底下是否有组织 + List list = getListByParentId(orgId); + if (Objects.nonNull(list) && list.size() > 0) { + return "组织"; + } + // 组织底下是否有岗位 + List list1 = positionService.getListByOrganizeId(Collections.singletonList(orgId)); + if (Objects.nonNull(list1) && list1.size() > 0) { + return "岗位"; + } + // 组织底下是否有用户 + if (userRelationService.existByObj(PermissionConst.ORGANIZE, orgId)) { + return "用户"; + } + // 组织底下是否有角色 + if (organizeRelationService.existByObjTypeAndOrgId(PermissionConst.ROLE, orgId)) { + return "角色"; + } + return null; + } + + @Override + public List getOrganizeName(List id) { + List list = new ArrayList<>(); + if (id.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(OrganizeEntity::getId, id); + queryWrapper.lambda().orderByAsc(OrganizeEntity::getSortCode).orderByDesc(OrganizeEntity::getCreatorTime); + list = this.list(queryWrapper); + } + return list; + } + + @Override + public Map getOrganizeName(List id, String keyword, boolean filterEnabledMark) { + Map list = Collections.EMPTY_MAP; + if (id.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(OrganizeEntity::getId, id); + if (StringUtil.isNotEmpty(keyword)) { + queryWrapper.lambda().and( + t -> t.like(OrganizeEntity::getFullName, keyword) + .or().like(OrganizeEntity::getEnCode, keyword) + ); + } + if (filterEnabledMark) { + queryWrapper.lambda().eq(OrganizeEntity::getEnabledMark, 1); + } + list = getBaseOrgMaps(queryWrapper, ImmutableMap.of( + OrganizeEntity::getSortCode, true, + OrganizeEntity::getCreatorTime, false + ), null); +// Map orgList = new LinkedHashMap<>(id.size(), 1); +// orgMaps.values().forEach(t -> { +// if (StringUtil.isNotEmpty(t.getOrganizeIdTree())) { +// String[] split = t.getOrganizeIdTree().split(","); +// for (String orgId : split) { +// if (id.contains(orgId) && !orgList.containsKey(orgId)) { +// OrganizeEntity entity = orgMaps.get(orgId); +// if(entity == null){ +// entity = getInfo(orgId); +// } +// if (entity != null) { +// orgList.put(orgId, entity); +// } +// } +// } +// } +// }); +// list = orgList; + } + return list; + } + + @Override + public List getOrganizeNameSort(List id) { + List list = new ArrayList<>(); + for (String orgId : id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrganizeEntity::getId, orgId); + queryWrapper.lambda().select(OrganizeEntity::getFullName); + OrganizeEntity entity = this.getOne(queryWrapper); + if (entity != null) { + list.add(entity); + } + } + return list; + } + + @Override + public List getOrganize(String organizeParentId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrganizeEntity::getParentId, organizeParentId); + queryWrapper.lambda().select(OrganizeEntity::getId); + List list = this.list(queryWrapper).stream().map(t -> t.getId()).collect(Collectors.toList()); + return list; + } + + @Override + public List getOrganizeByOraParentId(String organizeParentId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrganizeEntity::getParentId, organizeParentId); +// queryWrapper.lambda().select(OrganizeEntity::getId); + List list = this.list(queryWrapper); + return list.stream().map(t -> t.getId()).collect(Collectors.toList()); + } + + @Override + public List getUnderOrganizations(String organizeId, boolean filterEnabledMark) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (filterEnabledMark) { + queryWrapper.lambda().eq(OrganizeEntity::getEnabledMark, 1); + } + queryWrapper.lambda().ne(OrganizeEntity::getId, organizeId); + queryWrapper.lambda().like(OrganizeEntity::getOrganizeIdTree, organizeId); + queryWrapper.lambda().select(OrganizeEntity::getId); + return this.list(queryWrapper).stream().map(OrganizeEntity::getId).collect(Collectors.toList()); + } + + @Override + public List getUnderOrganizationss(String organizeId) { + List totalIds = new ArrayList<>(); + if (!userProvider.get().getIsAdministrator()) { + // 得到有权限的组织 + List collect = organizeAdministratorService.getListByAuthorize().stream().map(OrganizeEntity::getId).collect(Collectors.toList()); + totalIds = totalIds.stream().filter(t -> collect.contains(t)).collect(Collectors.toList()); + }else{ + totalIds = getUnderOrganizations(organizeId, false); + } + return totalIds; + } + + @Override + public List getListByFullName(String fullName) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrganizeEntity::getFullName, fullName); + return this.list(queryWrapper); + } + + @Override + public List getListByParentId(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrganizeEntity::getParentId, id); + return this.list(queryWrapper); + } + + @Override + public List getAllOrgByUserId(String userId) { + List ids = new ArrayList<>(); + userRelationService.getAllOrgRelationByUserId(userId).forEach(r -> { + ids.add(r.getObjectId()); + }); + return this.listByIds(ids); + } + + @Override + public String getFullNameByOrgIdTree(String orgIdTree, String regex) { + Map infoMap = this.getInfoList(); + return getFullNameByOrgIdTree(infoMap, orgIdTree, regex); + } + + + @Override + public String getFullNameByOrgIdTree(Map idNameMaps, String orgIdTree, String regex) { + String fullName = ""; + if (StringUtil.isNotEmpty(orgIdTree)) { + String[] split = orgIdTree.split(","); + StringBuilder orgName = new StringBuilder(); + String tmpName; + for (String orgId : split) { + if (StringUtil.isEmpty(orgIdTree)) { + continue; + } + if((tmpName = idNameMaps.get(orgId)) != null){ + orgName.append(regex).append(tmpName); + } + } + if (orgName.length() > 0) { + fullName = orgName.toString().replaceFirst(regex, ""); + } + } + return fullName; + } + + @Override + public String getOrganizeIdTree(OrganizeEntity entity) { + List list = new ArrayList<>(); + this.getOrganizeIdTree(entity.getParentId(), list); + // 倒叙排放 + Collections.reverse(list); + StringBuilder organizeIdTree = new StringBuilder(); + for (String organizeParentId : list) { + organizeIdTree.append("," + organizeParentId); + } + String organizeParentIdTree = organizeIdTree.toString(); + if (StringUtil.isNotEmpty(organizeParentIdTree)) { + organizeParentIdTree = organizeParentIdTree.replaceFirst(",", ""); + } + return organizeParentIdTree; + } + + @Override + public List getOrganizeByParentId() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrganizeEntity::getParentId, "-1"); + return this.list(queryWrapper); + } + + @Override + public List getDepartmentAll(String organizeId) { + OrganizeEntity organizeCompany = getOrganizeCompany(organizeId); + List organizeList = new ArrayList<>(); + if (organizeCompany != null) { + getOrganizeDepartmentAll(organizeCompany.getId(), organizeList); + organizeList.add(organizeCompany); + } + return organizeList; + } + + @Override + public OrganizeEntity getOrganizeCompany(String organizeId) { + OrganizeEntity entity = getInfo(organizeId); + return (entity != null && !PermissionConst.COMPANY.equals(entity.getCategory())) ? getOrganizeCompany(entity.getParentId()) : entity; + } + + @Override + public void getOrganizeDepartmentAll(String organizeId, List organizeList) { + List organizeEntityList = getListByParentId(organizeId); + for (OrganizeEntity entity : organizeEntityList) { + if (!PermissionConst.COMPANY.equals(entity.getCategory())) { + organizeList.add(entity); + getOrganizeDepartmentAll(entity.getId(), organizeList); + } + } + } + + @Override + public List getOrgIdTree(OrganizeEntity entity) { + List orgIds= new ArrayList<>(); + if (entity != null) { + String organizeIdTree = entity.getOrganizeIdTree(); + if (StringUtil.isNotEmpty(organizeIdTree)) { + String[] split = organizeIdTree.split(","); + for (String orgId : split) { + orgIds.add(orgId); + } + } + } + return orgIds; + } + + @Override + public List upWardRecursion(List orgIDs, String orgID) { + this.getOrgIDs(orgIDs,orgID); + return orgIDs; + } + + @Override + public Map getInfoList() { + if (redisUtil.exists(cacheKeyUtil.getOrganizeInfoList())) { + return new HashMap<>(redisUtil.getMap(cacheKeyUtil.getOrganizeInfoList())); + } else { + Map orgs = getOrgMaps(null, false, OrganizeEntity::getFullName); + Map infoMap = new LinkedHashMap<>(orgs.size(), 1); + orgs.forEach((k,v) -> infoMap.put(k, v.getFullName())); + redisUtil.insert(cacheKeyUtil.getOrganizeInfoList(), infoMap); + return infoMap; + } + } + + @Override + public List getListById(Boolean enable) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (enable) { + queryWrapper.lambda().eq(OrganizeEntity::getEnabledMark, 1); + } + return this.list(queryWrapper); + } + + + private void getOrgIDs(List orgIDs, String orgID) { + OrganizeEntity info = this.getInfo(orgID); + if (info != null){ + this.getOrgIDs(orgIDs,info.getParentId()); + orgIDs.add(info.getId()); + } + } + + /** + * 查询给定的条件是否有默认当前登录者的默认部门值 + * @param organizeConditionModel + * @return + */ + @Override + public String getDefaultCurrentValueDepartmentId(OrganizeConditionModel organizeConditionModel) { + UserInfo userInfo = UserProvider.getUser(); + int currentFinded = 0; + if(organizeConditionModel.getDepartIds() != null && !organizeConditionModel.getDepartIds().isEmpty() && organizeConditionModel.getDepartIds().contains(userInfo.getOrganizeId())) { + currentFinded = 1; + } + if(currentFinded == 0 && organizeConditionModel.getDepartIds() != null && !organizeConditionModel.getDepartIds().isEmpty()) { + List idList = new ArrayList<>(16); + // 获取所有组织 + if (organizeConditionModel.getDepartIds().size() > 0) { + idList.addAll(organizeConditionModel.getDepartIds()); + organizeConditionModel.getDepartIds().forEach(t -> { + List underOrganizations = getUnderOrganizations(t, false); + if (underOrganizations.size() > 0) { + idList.addAll(underOrganizations); + } + }); + } + List listAll = getListAll(idList, organizeConditionModel.getKeyword()); + List organizeList = JsonUtil.getJsonToList(listAll, OrganizeModel.class); + List collect = organizeList.stream().map(SumTree::getParentId).collect(Collectors.toList()); + List noParentId = organizeList.stream().filter(t->!collect.contains(t.getId()) && !"-1".equals(t.getParentId())).collect(Collectors.toList()); + noParentId.forEach(t->{ + if (StringUtil.isNotEmpty(t.getOrganizeIdTree())) { + String[] split = t.getOrganizeIdTree().split(","); + List list = Arrays.asList(split); + Collections.reverse(list); + for (int i = 1; i < list.size(); i++) { + String orgId = list.get(i); + List collect1 = organizeList.stream().filter(tt -> orgId.equals(tt.getId())).collect(Collectors.toList()); + if (collect1.size() > 0) { + String[] split1 = StringUtil.isNotEmpty(t.getOrganizeIdTree()) ? t.getOrganizeIdTree().split(orgId) : new String[0]; + if (split1.length > 0) { + t.setFullName(getFullNameByOrgIdTree(split1[1], "/")); + } + t.setParentId(orgId); + break; + } + } + } + }); + + List orgLIdList = organizeList.stream().map(OrganizeModel::getId).collect(Collectors.toList()); + if(orgLIdList != null && !orgLIdList.isEmpty() && orgLIdList.contains(userInfo.getOrganizeId())) { + currentFinded = 1; + } + } + return (currentFinded == 1)?userInfo.getOrganizeId():""; + } + + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/PermissionGroupServiceImpl.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/PermissionGroupServiceImpl.java new file mode 100644 index 0000000..0cebf04 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/PermissionGroupServiceImpl.java @@ -0,0 +1,525 @@ +package jnpf.permission.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import jnpf.base.Pagination; +import jnpf.base.service.SuperServiceImpl; +import jnpf.constant.PermissionConst; +import jnpf.permission.entity.*; +import jnpf.permission.mapper.PermissionGroupMapper; +import jnpf.permission.service.*; +import jnpf.util.RandomUtil; +import jnpf.util.StringUtil; +import jnpf.util.type.AuthorizeType; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +@Service +public class PermissionGroupServiceImpl extends SuperServiceImpl implements PermissionGroupService { + + @Autowired + private UserService userService; + @Autowired + private UserRelationService userRelationService; + @Autowired + private OrganizeRelationService organizeRelationService; + @Autowired + private RoleService roleService; + @Autowired + private PositionService positionService; + @Autowired + private GroupService groupService; + @Autowired + private AuthorizeService authorizeService; + @Autowired + private OrganizeService organizeService; + + @Override + public List list(Pagination pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(pagination.getKeyword())) { + queryWrapper.lambda().and(t->{ + t.like(PermissionGroupEntity::getFullName, pagination.getKeyword()).or() + .like(PermissionGroupEntity::getEnCode, pagination.getKeyword()); + }); + } + queryWrapper.lambda().orderByAsc(PermissionGroupEntity::getSortCode).orderByDesc(PermissionGroupEntity::getCreatorTime); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage iPage = this.page(page, queryWrapper); + return pagination.setData(iPage.getRecords(), iPage.getTotal()); + } + + @Override + public List list(boolean filterEnabledMark, List ids) { + if (ids != null && ids.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (filterEnabledMark) { + queryWrapper.lambda().eq(PermissionGroupEntity::getEnabledMark, 1); + } + if (ids != null && ids.size() > 0) { + queryWrapper.lambda().in(PermissionGroupEntity::getId, ids); + } + return this.list(queryWrapper); + } + + @Override + public PermissionGroupEntity info(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(PermissionGroupEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public boolean create(PermissionGroupEntity entity) { + entity.setId(RandomUtil.uuId()); + return this.save(entity); + } + + @Override + public boolean update(String id, PermissionGroupEntity entity) { + entity.setId(id); + return this.updateById(entity); + } + + @Override + public boolean delete(PermissionGroupEntity entity) { + return this.removeById(entity); + } + + @Override + public boolean isExistByFullName(String id, PermissionGroupEntity entity) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(PermissionGroupEntity::getFullName, entity.getFullName()); + if (StringUtil.isNotEmpty(id)) { + queryWrapper.lambda().ne(PermissionGroupEntity::getId, id); + } + return this.count(queryWrapper) > 0; + } + + @Override + public boolean isExistByEnCode(String id, PermissionGroupEntity entity) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(PermissionGroupEntity::getEnCode, entity.getEnCode()); + if (StringUtil.isNotEmpty(id)) { + queryWrapper.lambda().ne(PermissionGroupEntity::getId, id); + } + return this.count(queryWrapper) > 0; + } + + @Override + public PermissionGroupEntity permissionMember(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(PermissionGroupEntity::getId, id); + queryWrapper.lambda().select(PermissionGroupEntity::getId, PermissionGroupEntity::getPermissionMember); + return this.getOne(queryWrapper); + } + + @Override + public List getPermissionGroupByUserId(String userId, String organizeId, boolean singletonOrg) { + List list = new ArrayList<>(); + // 用户本身有没有权限 + UserEntity userEntity = userService.getInfo(userId); + if (userEntity == null) { + return list; + } + List permissionGroupEntities = this.list(true, null).stream().filter(t -> StringUtil.isNotEmpty(t.getPermissionMember())).collect(Collectors.toList()); + String finalUserId = userId + "--" + PermissionConst.USER; + List collect = permissionGroupEntities.stream().filter(entity -> entity.getPermissionMember().contains(finalUserId)).collect(Collectors.toList()); + collect.forEach(permissionGroupEntity -> { + if (authorizeService.existAuthorize(permissionGroupEntity.getId())) { + list.add(permissionGroupEntity); + } + }); + // 用户关系表 + List listByUserId = userRelationService.getListByUserId(userEntity.getId()); + // 分组有没有权限 + List groupIds = new ArrayList<>(); + List groupId = listByUserId.stream().filter(t -> PermissionConst.GROUP.equals(t.getObjectType())) + .map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + List groupName = groupService.getListByIds(groupId, true) + .stream().map(GroupEntity::getId).collect(Collectors.toList()); + groupName.forEach(t -> groupIds.add(t + "--group")); + for (String id : groupIds) { + List collect1 = permissionGroupEntities.stream().filter(entity -> entity.getPermissionMember().contains(id)).collect(Collectors.toList()); + collect1.forEach(permissionGroupEntity -> { + if (authorizeService.existAuthorize(permissionGroupEntity.getId())) { + list.add(permissionGroupEntity); + } + }); + } + // 全局角色如果有权限 + List roleAllList = listByUserId.stream().filter(t -> PermissionConst.ROLE.equals(t.getObjectType())) + .map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + List globalList = roleService.getGlobalList(roleAllList) + .stream().map(RoleEntity::getId).collect(Collectors.toList()); + for (String id : globalList) { + List collect1 = permissionGroupEntities.stream() + .filter(entity -> entity.getPermissionMember().contains(id + "--role")).collect(Collectors.toList()); + collect1.forEach(permissionGroupEntity -> { + if (authorizeService.existAuthorize(permissionGroupEntity.getId())) { + list.add(permissionGroupEntity); + } + }); + } + + // 组织有权限 + List organizeIds = new ArrayList<>(); + List orgIds = new ArrayList<>(); + if(list.size() > 0) { + // 当前组织及组织下岗位、角色权限组 + organizeIds.add(userEntity.getOrganizeId()); + } else { + // 此情况下不找 + if (StringUtil.isNotEmpty(organizeId)) { + organizeIds.add(organizeId); + } else { + // 找到一个有权限的组织、岗位、角色 + List listByObjectType = userRelationService.getListByObjectType(userId, PermissionConst.ORGANIZE); + List collect2 = listByObjectType.stream().map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + organizeIds.addAll(collect2); + organizeIds.add(userEntity.getOrganizeId()); + } + } + // 拼上后缀 + if (organizeIds.size() > 0) { + List collect1 = new ArrayList<>(); + collect1.addAll(organizeService.getOrgEntityList(organizeIds, true) + .stream().map(OrganizeEntity::getId).collect(Collectors.toList())); + orgIds.addAll(collect1); + collect1.forEach(t -> { + orgIds.add(t + "--" + PermissionConst.COMPANY); + orgIds.add(t + "--" + PermissionConst.DEPARTMENT); + }); + } + List relationListByOrganizeId = organizeRelationService.getRelationListByOrganizeId(organizeIds); + List orgList = new ArrayList<>(); + List listByOrganizeId = positionService.getListByOrganizeId(orgIds); + for (String oId : orgIds) { + List collect1 = permissionGroupEntities.stream().filter(entity -> entity.getPermissionMember().contains(oId)).collect(Collectors.toList()); + collect1.forEach(permissionGroupEntity -> { + if (authorizeService.existAuthorize(permissionGroupEntity.getId())) { + orgList.add(permissionGroupEntity); + } + }); + + // 判断该组织下的岗位是否有权限 + List positionListByTypeAndOrgId = listByOrganizeId.stream().filter(t -> t.getOrganizeId().equals(oId)) + .map(PositionEntity::getId).collect(Collectors.toList()); + List positionId = listByUserId.stream().filter(t -> PermissionConst.POSITION.equals(t.getObjectType())) + .map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + List containsPosition = positionListByTypeAndOrgId.stream().filter(positionId::contains).collect(Collectors.toList()); + List positionName = positionService.getPositionName(containsPosition, true) + .stream().map(PositionEntity::getId).collect(Collectors.toList()); + for (String id : positionName) { + List collect2 = permissionGroupEntities.stream().filter(entity -> entity.getPermissionMember().contains(id + "--position")).collect(Collectors.toList()); + collect2.forEach(permissionGroupEntity -> { + if (authorizeService.existAuthorize(permissionGroupEntity.getId())) { + orgList.add(permissionGroupEntity); + } + }); + } + // 判断该组织下的角色是否有权限 + List roleListByTypeAndOrgId = relationListByOrganizeId.stream().filter(t -> PermissionConst.ROLE.equals(t.getObjectType())) + .map(OrganizeRelationEntity::getObjectId).collect(Collectors.toList()); + List roleId = listByUserId.stream().filter(t -> PermissionConst.ROLE.equals(t.getObjectType())) + .map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + List roleName = roleService.getListByIds(roleId, null, true) + .stream().filter(t -> t.getGlobalMark() != 1).collect(Collectors.toList()); + List containsRole = roleName.stream().filter(t -> roleListByTypeAndOrgId.contains(t.getId())).collect(Collectors.toList()) + .stream().map(RoleEntity::getId).collect(Collectors.toList());; + for (String id : containsRole) { + List collect2 = permissionGroupEntities.stream().filter(entity -> entity.getPermissionMember().contains(id + "--role")).collect(Collectors.toList()); + collect2.forEach(permissionGroupEntity -> { + if (authorizeService.existAuthorize(permissionGroupEntity.getId())) { + orgList.add(permissionGroupEntity); + } + }); + } + if (orgList.size() > 0) { + if (!singletonOrg) { + break; + } + } + } + list.addAll(orgList); + return list; + } + + @Override + public String getPermissionGroupByUserId(String userId) { + // 用户本身有没有权限 + UserEntity userEntity = userService.getInfo(userId); + if (userEntity == null) { + return ""; + } + List permissionGroupEntities = this.list(true, null).stream().filter(t -> StringUtil.isNotEmpty(t.getPermissionMember())).collect(Collectors.toList()); + String finalUserId = userId + "--" + PermissionConst.USER; + List collect = permissionGroupEntities.stream().filter(entity -> entity.getPermissionMember().contains(finalUserId)).collect(Collectors.toList()); + for (PermissionGroupEntity permissionGroupEntity : collect) { + if (authorizeService.existAuthorize(permissionGroupEntity.getId())) { + return ""; + } + } + // 用户关系表 + List listByUserId = userRelationService.getListByUserId(userEntity.getId()); + // 分组有没有权限 + List groupIds = new ArrayList<>(); + List groupId = listByUserId.stream().filter(t -> PermissionConst.GROUP.equals(t.getObjectType())) + .map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + List groupName = groupService.getListByIds(groupId, true) + .stream().map(GroupEntity::getId).collect(Collectors.toList()); + groupName.forEach(t -> groupIds.add(t + "--group")); + for (String id : groupIds) { + List collect1 = permissionGroupEntities.stream().filter(entity -> entity.getPermissionMember().contains(id)).collect(Collectors.toList()); + for (PermissionGroupEntity permissionGroupEntity : collect1) { + if (authorizeService.existAuthorize(permissionGroupEntity.getId())) { + return ""; + } + } + } + // 全局角色如果有权限 + List roleAllList = listByUserId.stream().filter(t -> PermissionConst.ROLE.equals(t.getObjectType())) + .map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + List globalList = roleService.getGlobalList(roleAllList) + .stream().map(RoleEntity::getId).collect(Collectors.toList()); + for (String id : globalList) { + List collect1 = permissionGroupEntities.stream() + .filter(entity -> entity.getPermissionMember().contains(id + "--role")).collect(Collectors.toList()); + for (PermissionGroupEntity permissionGroupEntity : collect1) { + if (authorizeService.existAuthorize(permissionGroupEntity.getId())) { + return ""; + } + } + } + + // 组织有权限 + List orgIds = new ArrayList<>(); + List listByObjectType = userRelationService.getListByObjectType(userId, PermissionConst.ORGANIZE); + List collect2 = new ArrayList<>(); + collect2.add(userEntity.getOrganizeId()); + collect2.addAll(listByObjectType.stream().map(UserRelationEntity::getObjectId).collect(Collectors.toList())); + orgIds.addAll(collect2); + collect2.forEach(t -> { + orgIds.add(t + "--" + PermissionConst.COMPANY); + orgIds.add(t + "--" + PermissionConst.DEPARTMENT); + }); + List relationListByOrganizeId = organizeRelationService.getRelationListByOrganizeId(collect2); + List listByOrganizeId = positionService.getListByOrganizeId(orgIds); + for (String orgId : orgIds) { + List collect1 = permissionGroupEntities.stream().filter(entity -> entity.getPermissionMember().contains(orgId)).collect(Collectors.toList()); + for (PermissionGroupEntity permissionGroupEntity : collect1) { + if (authorizeService.existAuthorize(permissionGroupEntity.getId())) { + return orgId.split("--")[0]; + } + } + // 判断该组织下的岗位是否有权限 + List positionListByTypeAndOrgId = listByOrganizeId.stream().filter(t -> t.getOrganizeId().equals(orgId)) + .map(PositionEntity::getId).collect(Collectors.toList()); + List positionId = listByUserId.stream().filter(t -> PermissionConst.POSITION.equals(t.getObjectType())) + .map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + List containsPosition = positionListByTypeAndOrgId.stream().filter(positionId::contains).collect(Collectors.toList()); + List positionName = positionService.getPositionName(containsPosition, true) + .stream().map(PositionEntity::getId).collect(Collectors.toList()); + for (String id : positionName) { + List collect3 = permissionGroupEntities.stream().filter(entity -> entity.getPermissionMember().contains(id + "--position")).collect(Collectors.toList()); + for (PermissionGroupEntity permissionGroupEntity : collect3) { + if (authorizeService.existAuthorize(permissionGroupEntity.getId())) { + return orgId.split("--")[0]; + } + } + } + // 判断该组织下的角色是否有权限 + List roleListByTypeAndOrgId = relationListByOrganizeId.stream().filter(t -> PermissionConst.ROLE.equals(t.getObjectType())) + .map(OrganizeRelationEntity::getObjectId).collect(Collectors.toList()); + List roleId = listByUserId.stream().filter(t -> PermissionConst.ROLE.equals(t.getObjectType())) + .map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + List roleName = roleService.getListByIds(roleId, null, true) + .stream().filter(t -> t.getGlobalMark() != 1).collect(Collectors.toList()); + List containsRole = roleName.stream().filter(t -> roleListByTypeAndOrgId.contains(t.getId())).collect(Collectors.toList()) + .stream().map(RoleEntity::getId).collect(Collectors.toList());; + for (String id : containsRole) { + List collect3 = permissionGroupEntities.stream().filter(entity -> entity.getPermissionMember().contains(id + "--role")).collect(Collectors.toList()); + for (PermissionGroupEntity permissionGroupEntity : collect3) { + if (authorizeService.existAuthorize(permissionGroupEntity.getId())) { + return orgId.split("--")[0]; + } + } + } + } + return ""; + } + + @Override + public String getOrgIdByUserIdAndSystemId(String userId, String systemId) { + // 用户本身有没有权限 + UserEntity userEntity = userService.getInfo(userId); + if (userEntity == null) { + return ""; + } + // 判断有这个应用的权限组有哪些 + List collect = authorizeService.getListByObjectAndItemIdAndType(systemId, PermissionConst.SYSTEM).stream().map(AuthorizeEntity::getObjectId).collect(Collectors.toList()); + List list = this.list(true, collect).stream().filter(t -> StringUtil.isNotEmpty(t.getPermissionMember())).collect(Collectors.toList()); + + List objectIds = new ArrayList<>(); + objectIds.add(userId + "--" + PermissionConst.USER); + // 用户关系 + List listByUserId = userRelationService.getListByUserId(userEntity.getId()) + .stream().filter(t -> userId.equals(t.getUserId())).collect(Collectors.toList()); + // 分组 + List groupId = listByUserId.stream().filter(t -> PermissionConst.GROUP.equals(t.getObjectType())).map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + List groupName = groupService.getListByIds(groupId, true) + .stream().map(GroupEntity::getId).collect(Collectors.toList()); + groupName.forEach(t -> { + objectIds.add(t + "--group"); + }); + // 角色 + List roleAllList = listByUserId.stream().filter(t -> PermissionConst.ROLE.equals(t.getObjectType())).map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + List globalList = roleService.getGlobalList(roleAllList) + .stream().map(RoleEntity::getId).collect(Collectors.toList()); + globalList.forEach(t -> { + objectIds.add(t + "--role"); + }); + for (String objectId : objectIds) { + List collect1 = list.stream().filter(t -> t.getPermissionMember().contains(objectId)).collect(Collectors.toList()); + if (collect1.size() > 0) { + return ""; + } + } + // 组织 + List orgIds = listByUserId.stream().filter(t -> PermissionConst.ORGANIZE.equals(t.getObjectType())).map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + List orgEntityList = organizeService.getOrgEntityList(orgIds, true); + List listByOrganizeId = positionService.getListByOrganizeId(orgIds); + List relationListByOrganizeId = organizeRelationService.getRelationListByOrganizeId(orgEntityList.stream().map(OrganizeEntity::getId).collect(Collectors.toList())); + for (OrganizeEntity organizeEntity : orgEntityList) { + List collect1 = list.stream().filter(entity -> entity.getPermissionMember().contains(organizeEntity.getId())).collect(Collectors.toList()); + if (collect1.size() > 0) { + return organizeEntity.getId(); + } + // 角色 + List roleListByTypeAndOrgId = relationListByOrganizeId.stream().filter(t -> PermissionConst.ROLE.equals(t.getObjectType())) + .map(OrganizeRelationEntity::getObjectId).collect(Collectors.toList()); + List roleId = listByUserId.stream().filter(t -> PermissionConst.ROLE.equals(t.getObjectType())) + .map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + List roleName = roleService.getListByIds(roleId, null, true) + .stream().filter(t -> t.getGlobalMark() != 1).collect(Collectors.toList()); + List containsRole = roleName.stream().filter(t -> roleListByTypeAndOrgId.contains(t.getId())).collect(Collectors.toList()) + .stream().map(RoleEntity::getId).collect(Collectors.toList()); + for (String containsId : containsRole) { + if (list.stream().anyMatch(entity -> entity.getPermissionMember().contains(containsId))) { + return organizeEntity.getId(); + } + } + // 岗位 + List positionListByTypeAndOrgId = listByOrganizeId.stream().filter(t -> t.getOrganizeId().equals(organizeEntity.getId())) + .map(PositionEntity::getId).collect(Collectors.toList()); + List positionId = listByUserId.stream().filter(t -> PermissionConst.POSITION.equals(t.getObjectType())) + .map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + List containsPosition = positionListByTypeAndOrgId.stream().filter(positionId::contains).collect(Collectors.toList()); + List positionName = positionService.getPositionName(containsPosition, true) + .stream().map(PositionEntity::getId).collect(Collectors.toList()); + for (String containsId : positionName) { + if (list.stream().anyMatch(entity -> entity.getPermissionMember().contains(containsId))) { + return organizeEntity.getId(); + } + } + } + return ""; + } + + @Override + public List getPermissionGroupAllByUserId(String userId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().like(PermissionGroupEntity::getPermissionMember, userId); + queryWrapper.lambda().eq(PermissionGroupEntity::getEnabledMark, 1); + return this.list(queryWrapper); +// UserEntity userEntity = userService.getInfo(userId); +// // 通过用户id获取相关的组织、部门、岗位、角色、分组 +// if (userEntity == null) { +// return new ArrayList<>(); +// } +// if (userEntity.getIsAdministrator() == 1) { +// return this.list(true, null); +// } +// Set objIds = new HashSet<>(); +// +// // 用户与组织关系 +// List orgIds = new ArrayList<>(); +// List orgId = userRelationService.getListByObjectType(userEntity.getId(), PermissionConst.ORGANIZE).stream().map(UserRelationEntity::getObjectId).collect(Collectors.toList()); +// orgId.forEach(t -> orgIds.add(t + "--" + PermissionConst.ORGANIZE)); +// // 用户与岗位关系 +// List positionIds = new ArrayList<>(); +// List positionId = userRelationService.getListByObjectType(userEntity.getId(), PermissionConst.POSITION).stream().map(UserRelationEntity::getObjectId).collect(Collectors.toList()); +// positionId.forEach(t -> positionIds.add(t + "--" + PermissionConst.POSITION)); +// // 用户与角色关系 +// List roleIds = new ArrayList<>(); +// List roleId = userRelationService.getListByObjectType(userEntity.getId(), PermissionConst.ROLE).stream().map(UserRelationEntity::getObjectId).collect(Collectors.toList()); +// roleId.forEach(t -> roleIds.add(t + "--" + PermissionConst.ROLE)); +// // 用户与跟分组关系 +// List groupIds = new ArrayList<>(); +// List groupId = userRelationService.getListByObjectType(userEntity.getId(), PermissionConst.GROUP).stream().map(UserRelationEntity::getObjectId).collect(Collectors.toList()); +// groupId.forEach(t -> groupIds.add(t + "--" + PermissionConst.GROUP)); +// +// objIds.addAll(orgIds); +// objIds.addAll(positionIds); +// objIds.addAll(roleIds); +// objIds.addAll(groupIds); +// +// Set permissionGroupIds = new HashSet<>(); +// +// List permissionGroupEntities = this.list(true, null); +// objIds.forEach(objId -> { +// List collect = permissionGroupEntities.stream().filter(entity -> entity.getPermissionMember().contains(objId)).collect(Collectors.toList()); +// if (collect.size() > 0) { +// permissionGroupIds.addAll(collect.stream().map(PermissionGroupEntity::getId).collect(Collectors.toList())); +// } +// }); +// return this.list(true, new ArrayList<>(permissionGroupIds)); + } + + @Override + @Transactional + public boolean updateByUser(String fromId, String toId, List permissionList) { + if (StringUtil.isEmpty(fromId)) { + return false; + } + String fromIds = fromId + "--" + PermissionConst.USER; + List permissionGroupAllByUserId = this.getPermissionGroupAllByUserId(fromId); + permissionGroupAllByUserId.forEach(t -> { + if (permissionList.contains(t.getId())) { + t.setPermissionMember(StringUtil.isNotEmpty(t.getPermissionMember()) ? t.getPermissionMember().replaceAll(fromIds, toId + "--" + PermissionConst.USER) : ""); + this.updateById(t); + } + }); + return true; + } + + @Override + public List getPermissionGroupByModuleId(String moduleId) { + // 获取到菜单和权限组的关系 + List authorizeEntityList = authorizeService.getListByObjectAndItem(moduleId, AuthorizeType.MODULE); + // 获取权限组信息 + List list = this.list(true, + authorizeEntityList.stream().map(AuthorizeEntity::getObjectId).collect(Collectors.toList())); + return list; + } + + @Override + public List list(List ids) { + if (ids.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(PermissionGroupEntity::getId, ids); + return this.list(queryWrapper); + } + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/PositionServiceImpl.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/PositionServiceImpl.java new file mode 100644 index 0000000..10a3c94 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/PositionServiceImpl.java @@ -0,0 +1,430 @@ +package jnpf.permission.service.impl; + +import com.github.pagehelper.page.PageMethod; +import jnpf.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import jnpf.constant.PermissionConst; +import jnpf.permission.entity.*; +import jnpf.permission.model.position.PaginationPosition; +import jnpf.permission.mapper.PositionMapper; +import jnpf.permission.service.*; +import jnpf.util.*; +import jnpf.util.JsonUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 岗位信息 + * + * @copyright 引迈信息技术有限公司 + * @author JNPF开发平台组 + * @version V3.1.0 + * @date 2019年9月26日 上午9:18 + */ +@Service +public class PositionServiceImpl extends SuperServiceImpl implements PositionService { + + @Autowired + private AuthorizeService authorizeService; + @Autowired + private UserRelationService userRelationService; + @Autowired + private UserProvider userProvider; + @Autowired + private RedisUtil redisUtil; + @Autowired + private CacheKeyUtil cacheKeyUtil; + @Autowired + private OrganizeRelationService organizeRelationService; + @Autowired + private OrganizeService organizeService; + @Autowired + private OrganizeAdministratorService organizeAdministratorService; + + @Override + public List getList(boolean filterEnabledMark) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (filterEnabledMark) { + queryWrapper.lambda().eq(PositionEntity::getEnabledMark, 1); + } + queryWrapper.lambda().orderByAsc(PositionEntity::getSortCode).orderByDesc(PositionEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getPosList(List idList) { + if (idList.size()>0){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(PositionEntity::getId,idList).select(PositionEntity::getId,PositionEntity::getFullName, PositionEntity::getEnabledMark); + return this.list(queryWrapper); + } + return new ArrayList<>(); + } + + @Override + public List getPosList(Set idList) { + if (idList.size()>0){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().orderByAsc(PositionEntity::getSortCode).orderByDesc(PositionEntity::getCreatorTime); + queryWrapper.lambda().select(PositionEntity::getId,PositionEntity::getFullName).in(PositionEntity::getId,idList); + return this.list(queryWrapper); + } + return new ArrayList<>(); + } + + @Override + public Map getPosMap() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select(PositionEntity::getId,PositionEntity::getFullName); + return this.list(queryWrapper).stream().collect(Collectors.toMap(PositionEntity::getId,PositionEntity::getFullName)); + } + + @Override + public Map getPosEncodeAndName() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select(PositionEntity::getId,PositionEntity::getFullName,PositionEntity::getEnCode); + return this.list(queryWrapper).stream().collect(Collectors.toMap(p->p.getFullName() + "/" + p.getEnCode(),PositionEntity::getId)); + } + + + @Override + public List getPosRedisList() { + if(redisUtil.exists(cacheKeyUtil.getPositionList())){ + return JsonUtil.getJsonToList(redisUtil.getString(cacheKeyUtil.getPositionList()).toString(),PositionEntity.class); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(PositionEntity::getEnabledMark,1); + + List list=this.list(queryWrapper); + if(list.size()>0){ + redisUtil.insert(cacheKeyUtil.getPositionList(), JsonUtil.getObjectToString(list),300); + } + return list; + } + + @Override + public List getList(PaginationPosition paginationPosition) { + // 需要查询哪些组织 + List orgIds = new ArrayList<>(); + // 所有有权限的组织 + Set orgId = new HashSet<>(16); + if (!userProvider.get().getIsAdministrator()) { + // 通过权限转树 + List listss = organizeAdministratorService.getOrganizeAdministratorEntity(userProvider.get().getUserId()); + // 判断自己是哪些组织的管理员 + listss.forEach(t -> { + if (t != null) { + if (t.getThisLayerSelect() != null && t.getThisLayerSelect() == 1) { + orgId.add(t.getOrganizeId()); + } + if (t.getSubLayerSelect() != null && t.getSubLayerSelect() == 1) { + List underOrganizations = organizeService.getUnderOrganizations(t.getOrganizeId(), false); + orgId.addAll(underOrganizations); + } + } + }); + } else { + orgId.addAll(organizeService.getOrgMapsAll(OrganizeEntity::getId).keySet()); + } + + if (!StringUtil.isEmpty(paginationPosition.getOrganizeId())) { + List underOrganizations = organizeService.getUnderOrganizations(paginationPosition.getOrganizeId(), false); + // 判断哪些组织时有权限的 + List collect = underOrganizations.stream().filter(orgId::contains).collect(Collectors.toList()); + orgIds.add(paginationPosition.getOrganizeId()); + orgIds.addAll(collect); + } else { + if (orgId.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(paginationPosition.getKeyword())) { + queryWrapper.lambda().and( + t -> t.like(PositionEntity::getFullName, paginationPosition.getKeyword()) + .or().like(PositionEntity::getEnCode, paginationPosition.getKeyword()) + ); + } + queryWrapper.lambda().in(PositionEntity::getOrganizeId, orgId); + queryWrapper.lambda().select(PositionEntity::getId, PositionEntity::getEnCode, PositionEntity::getCreatorTime, + PositionEntity::getOrganizeId, PositionEntity::getEnabledMark, PositionEntity::getFullName, + PositionEntity::getSortCode, PositionEntity::getType); + queryWrapper.lambda().orderByAsc(PositionEntity::getSortCode).orderByDesc(PositionEntity::getCreatorTime); + Page page = new Page<>(paginationPosition.getCurrentPage(), paginationPosition.getPageSize()); + page.setOptimizeCountSql(false); + IPage iPage = this.page(page, queryWrapper); + return paginationPosition.setData(iPage.getRecords(), page.getTotal()); + } + + String keyword = ""; + if (!StringUtil.isEmpty(paginationPosition.getKeyword())) { + keyword = "%" + paginationPosition.getKeyword() + "%"; + } + PageHelper.startPage((int) paginationPosition.getCurrentPage(), (int) paginationPosition.getPageSize()); + PageMethod.getLocalPage().keepOrderBy(true); + List query = this.baseMapper.query(orgIds, keyword); + PageInfo pageInfo = new PageInfo(query); + // 赋值分页参数 + paginationPosition.setTotal(pageInfo.getTotal()); + paginationPosition.setCurrentPage(pageInfo.getPageNum()); + paginationPosition.setPageSize(pageInfo.getPageSize()); + if (pageInfo.getList() != null && pageInfo.getList().size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(PositionEntity::getId, pageInfo.getList()); + queryWrapper.lambda().orderByAsc(PositionEntity::getSortCode).orderByDesc(PositionEntity::getCreatorTime); + return this.list(queryWrapper); + } + return new ArrayList<>(); + } + + @Override + public List getListByUserId(String userId) { + QueryWrapper query = new QueryWrapper<>(); + List ids = new ArrayList<>(); + userRelationService.getListByObjectType(userId, PermissionConst.POSITION).forEach(r->{ + ids.add(r.getObjectId()); + }); + if(ids.size() > 0){ + query.lambda().in(PositionEntity::getId, ids); + return this.list(query); + }else { + return new ArrayList<>(); + } + } + + @Override + public PositionEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(PositionEntity::getId,id); + return this.getOne(queryWrapper); + } + + @Override + public PositionEntity getByFullName(String fullName) { + PositionEntity positionEntity = new PositionEntity(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(PositionEntity::getFullName, fullName); + queryWrapper.lambda().select(PositionEntity::getId); + List list = this.list(queryWrapper); + if (list.size() > 0) { + positionEntity = list.get(0); + } + return positionEntity; + } + + @Override + public PositionEntity getByFullName(String fullName,String encode) { + PositionEntity positionEntity = new PositionEntity(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(PositionEntity::getFullName, fullName); + queryWrapper.lambda().eq(PositionEntity::getEnCode, encode); + queryWrapper.lambda().select(PositionEntity::getId); + List list = this.list(queryWrapper); + if (list.size() > 0) { + positionEntity = list.get(0); + } + return positionEntity; + } + + @Override + public boolean isExistByFullName(PositionEntity entity, boolean isFilter) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if(entity != null) { + queryWrapper.lambda().eq(PositionEntity::getFullName, entity.getFullName()); + } + //是否需要过滤 + if (isFilter) { + queryWrapper.lambda().ne(PositionEntity::getId, entity.getId()); + } + List entityList = this.list(queryWrapper); + for (PositionEntity positionEntity : entityList) { + //如果组织id相同则代表已存在 + if (entity != null && entity.getOrganizeId().equals(positionEntity.getOrganizeId())){ + return true; + } + } + return false; + } + + @Override + public boolean isExistByEnCode(PositionEntity entity, boolean isFilter) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if(entity != null){ + queryWrapper.lambda().eq(PositionEntity::getEnCode, entity.getEnCode()); + if (isFilter) { + queryWrapper.lambda().ne(PositionEntity::getId, entity.getId()); + } + } + List entityList = this.list(queryWrapper); +// for (PositionEntity positionEntity : entityList) { +// //如果组织id相同则代表已存在 +// if (entity != null && entity.getOrganizeId().equals(positionEntity.getOrganizeId())){ +// return true; +// } +// } + return entityList.size() > 0; + } + + @Override + public void create(PositionEntity entity) { + if (StringUtil.isEmpty(entity.getId())) { + entity.setId(RandomUtil.uuId()); + } + entity.setCreatorUserId(userProvider.get().getUserId()); + this.save(entity); + } + + @Override + public boolean update(String id, PositionEntity entity) { + entity.setId(id); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(userProvider.get().getUserId()); + return this.updateById(entity); + } + + @Override + @DSTransactional + public void delete(PositionEntity entity) { + this.removeById(entity.getId()); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserRelationEntity::getObjectId,entity.getId()); + userRelationService.remove(queryWrapper); + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().eq(AuthorizeEntity::getObjectId,entity.getId()); + authorizeService.remove(wrapper); + } + + @Override + @DSTransactional + public boolean first(String id) { + boolean isOk = false; + //获取要上移的那条数据的信息 + PositionEntity upEntity = this.getById(id); + Long upSortCode = upEntity.getSortCode() == null ? 0 : upEntity.getSortCode(); + //查询上几条记录 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .lt(PositionEntity::getSortCode, upSortCode) + .eq(PositionEntity::getOrganizeId,upEntity.getOrganizeId()) + .orderByDesc(PositionEntity::getSortCode); + List downEntity = this.list(queryWrapper); + if(downEntity.size()>0){ + //交换两条记录的sort值 + Long temp = upEntity.getSortCode(); + upEntity.setSortCode(downEntity.get(0).getSortCode()); + downEntity.get(0).setSortCode(temp); + this.updateById(downEntity.get(0)); + this.updateById(upEntity); + isOk = true; + } + return isOk; + } + + @Override + @DSTransactional + public boolean next(String id) { + boolean isOk = false; + //获取要下移的那条数据的信息 + PositionEntity downEntity = this.getById(id); + Long upSortCode = downEntity.getSortCode() == null ? 0 : downEntity.getSortCode(); + //查询下几条记录 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .gt(PositionEntity::getSortCode, upSortCode) + .eq(PositionEntity::getOrganizeId,downEntity.getOrganizeId()) + .orderByAsc(PositionEntity::getSortCode); + List upEntity = this.list(queryWrapper); + if(upEntity.size()>0){ + //交换两条记录的sort值 + Long temp = downEntity.getSortCode(); + downEntity.setSortCode(upEntity.get(0).getSortCode()); + upEntity.get(0).setSortCode(temp); + this.updateById(upEntity.get(0)); + this.updateById(downEntity); + isOk = true; + } + return isOk; + } + + @Override + public List getPositionName(List id, boolean filterEnabledMark) { + List roleList = new ArrayList<>(); + if (id.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(PositionEntity::getId, id); + roleList = this.list(queryWrapper); + } + return roleList; + } + + @Override + public List getPositionName(List id, String keyword) { + List roleList = new ArrayList<>(); + if (id.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(PositionEntity::getId, id); + //关键字(名称、编码) + if (!StringUtil.isEmpty(keyword)) { + queryWrapper.lambda().and( + t->t.like(PositionEntity::getFullName,keyword) + .or().like(PositionEntity::getEnCode,keyword) + ); + } + roleList = this.list(queryWrapper); + } + return roleList; + } + + @Override + public List getListByOrganizeId(List organizeIds) { + if (organizeIds.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(PositionEntity::getOrganizeId, organizeIds); + queryWrapper.lambda().orderByAsc(PositionEntity::getSortCode).orderByDesc(PositionEntity::getCreatorTime); +// queryWrapper.lambda().select(PositionEntity::getId, PositionEntity::getFullName); + return this.list(queryWrapper); + } + + @Override + public List getListByOrgIdAndUserId(String organizeId, String userId) { + // 用户绑定的所有岗位 + List positionIds = userRelationService.getListByUserIdAndObjType(userId, PermissionConst.POSITION).stream() + .map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + if(positionIds.size() > 0){ + List positionEntities = this.listByIds(positionIds); + return positionEntities.stream().filter(p-> p.getOrganizeId().equals(organizeId)).collect(Collectors.toList()); + }else { + return new ArrayList<>(); + } + } + + @Override + public List getListByFullName(String fullName, String enCode) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(PositionEntity::getFullName, fullName).eq(PositionEntity::getEnCode, enCode); + return this.list(queryWrapper); + } + + @Override + public List getCurPositionsByOrgId(String orgId) { + String userId = userProvider.get().getUserId(); + List userRelations = userRelationService.getListByObjectType(userId, PermissionConst.POSITION); + List positions = new ArrayList<>(); + userRelations.forEach(ur->{ + PositionEntity entity = this.getInfo(ur.getObjectId()); + if(entity.getOrganizeId().equals(orgId)){ + positions.add(entity); + } + }); + return positions; + } +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/RoleServiceImpl.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/RoleServiceImpl.java new file mode 100644 index 0000000..e984f1e --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/RoleServiceImpl.java @@ -0,0 +1,410 @@ +package jnpf.permission.service.impl; + +import jnpf.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import jnpf.constant.PermissionConst; +import jnpf.permission.entity.*; +import jnpf.permission.mapper.RoleMapper; +import jnpf.permission.model.role.RolePagination; +import jnpf.permission.service.*; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 系统角色 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +@Service +@DSTransactional +public class RoleServiceImpl extends SuperServiceImpl implements RoleService { + + @Autowired + private UserProvider userProvider; + @Autowired + private UserService userService; + @Autowired + private RoleService roleService; + @Autowired + private UserRelationService userRelationService; + @Autowired + private AuthorizeService authorizeService; + @Autowired + private OrganizeRelationService organizeRelationService; + @Autowired + private OrganizeService organizeService; + @Autowired + private OrganizeAdministratorService organizeAdministratorService; + + @Override + public List getList(boolean filterEnabledMark) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (filterEnabledMark) { + queryWrapper.lambda().eq(RoleEntity::getEnabledMark, 1); + } + queryWrapper.lambda().orderByAsc(RoleEntity::getSortCode).orderByDesc(RoleEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getList(RolePagination pagination, Integer globalMark) { + // 需要查询哪些组织 + List orgIds = new ArrayList<>(); + // 所有有权限的组织 + Set orgId = new HashSet<>(16); + if (!userProvider.get().getIsAdministrator()) { + // 通过权限转树 + List listss = organizeAdministratorService.getOrganizeAdministratorEntity(userProvider.get().getUserId()); + // 判断自己是哪些组织的管理员 + listss.forEach(t -> { + if (t != null) { + if (t.getThisLayerSelect() != null && t.getThisLayerSelect() == 1) { + orgId.add(t.getOrganizeId()); + } + if (t.getSubLayerSelect() != null && t.getSubLayerSelect() == 1) { + List underOrganizations = organizeService.getUnderOrganizations(t.getOrganizeId(), false); + orgId.addAll(underOrganizations); + } + } + }); + } else { + orgId.addAll(organizeService.getOrgMapsAll(OrganizeEntity::getId).keySet()); + } + + if (!StringUtil.isEmpty(pagination.getOrganizeId())) { + List underOrganizations = organizeService.getUnderOrganizations(pagination.getOrganizeId(), false); + // 判断哪些组织时有权限的 + List collect = underOrganizations.stream().filter(orgId::contains).collect(Collectors.toList()); + orgIds.add(pagination.getOrganizeId()); + orgIds.addAll(collect); + } else { + if (orgId.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(pagination.getKeyword())) { + queryWrapper.lambda().and( + t -> t.like(RoleEntity::getFullName, pagination.getKeyword()) + .or().like(RoleEntity::getEnCode, pagination.getKeyword()) + ); + } + if (!userProvider.get().getIsAdministrator()) { + queryWrapper.lambda().ne(RoleEntity::getGlobalMark, 1); + List collect = organizeRelationService.getRelationListByOrganizeId(new ArrayList<>(orgId), PermissionConst.ROLE).stream().map(OrganizeRelationEntity::getObjectId).collect(Collectors.toList()); + if (collect.size() == 0) { + collect.add(""); + } + queryWrapper.lambda().in(RoleEntity::getId, collect); + } + queryWrapper.lambda().orderByAsc(RoleEntity::getSortCode).orderByDesc(RoleEntity::getCreatorTime); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage iPage = this.page(page, queryWrapper); + return pagination.setData(iPage.getRecords(), page.getTotal()); + } + + String keyword = ""; + if (!StringUtil.isEmpty(pagination.getKeyword())) { + keyword = "%" + pagination.getKeyword() + "%"; + } + PageHelper.startPage((int) pagination.getCurrentPage(), (int) pagination.getPageSize()); + List query = this.baseMapper.query(orgIds, keyword, globalMark); + PageInfo pageInfo = new PageInfo(query); + // 赋值分页参数 + pagination.setTotal(pageInfo.getTotal()); + pagination.setCurrentPage(pageInfo.getPageNum()); + pagination.setPageSize(pageInfo.getPageSize()); + if (pageInfo.getList() != null && pageInfo.getList().size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(RoleEntity::getId, pageInfo.getList()); + queryWrapper.lambda().orderByAsc(RoleEntity::getSortCode).orderByDesc(RoleEntity::getCreatorTime); + return this.list(queryWrapper); + } + return new ArrayList<>(); + } + + @Override + public List getListByUserId(String userId) { + QueryWrapper query = new QueryWrapper<>(); + List roleRelations = userRelationService.getListByObjectType(userId, PermissionConst.ROLE).stream() + .map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + if(roleRelations.size() > 0){ + query.lambda().in(RoleEntity::getId, roleRelations); + return this.list(query); + }else { + return new ArrayList<>(); + } + } + + @Override + public List getListByUserIdAndOrgId(String userId, String orgId) { + return getListByUserId(userId).stream() + .filter(role-> organizeRelationService.existByRoleIdAndOrgId(role.getId(), orgId)) + .collect(Collectors.toList()); + } + + @Override + public List getRoleIdsByCurrentUser() { + UserEntity userEntity = userService.getInfo(userProvider.get().getUserId()); + return getAllRoleIdsByUserIdAndOrgId(userEntity.getId(), userEntity.getOrganizeId()); + } + + @Override + public List getRoleIdsByCurrentUser(String orgId) { + UserEntity userEntity = userService.getInfo(userProvider.get().getUserId()); + return getAllRoleIdsByUserIdAndOrgId(userEntity.getId(), orgId); + } + + @Override + public List getAllRoleIdsByUserIdAndOrgId(String userId, String orgId) { + // 用户当前组织下的角色 + List roleIds = getListByUserIdAndOrgId(userId, orgId).stream() + .map(RoleEntity::getId).collect(Collectors.toList()); + // 用户绑定的全局角色 + List globalRoleIds = userRelationService.getListByUserIdAndObjType(userId, PermissionConst.ROLE).stream() + .map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + globalRoleIds = roleService.getListByIds(globalRoleIds, null, false).stream().filter(r -> r.getGlobalMark() != null && r.getGlobalMark() == 1) + .map(RoleEntity::getId).collect(Collectors.toList()); + roleIds.addAll(globalRoleIds); + return roleIds.stream().distinct().collect(Collectors.toList()); + } + + @Override + public RoleEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(RoleEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public Boolean isExistByFullName(String fullName, String id, Integer globalMark) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(RoleEntity::getFullName, fullName); + queryWrapper.lambda().eq(RoleEntity::getGlobalMark, globalMark); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(RoleEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public Boolean isExistByEnCode(String enCode, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(RoleEntity::getEnCode, enCode); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(RoleEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public Boolean update(String id, RoleEntity entity) { + entity.setId(id); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(userProvider.get().getUserId()); + return this.updateById(entity); + } + + @Override + public void create(RoleEntity entity) { + entity.setCreatorUserId(userProvider.get().getUserId()); + this.save(entity); + } + + @Override + @Transactional + public void delete(RoleEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(AuthorizeEntity::getObjectId, entity.getId()); + authorizeService.remove(queryWrapper); + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().eq(UserRelationEntity::getObjectId, entity.getId()); + userRelationService.remove(wrapper); + } + } + @Override + public List getListByIds(List id, String keyword, boolean filterEnabledMark) { + List roleList = new ArrayList<>(); + if (id.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(RoleEntity::getId, id); + if (filterEnabledMark) { + queryWrapper.lambda().eq(RoleEntity::getEnabledMark, 1); + } + if (StringUtil.isNotEmpty(keyword)) { + queryWrapper.lambda().and( + t -> t.like(RoleEntity::getFullName, keyword) + .or().like(RoleEntity::getEnCode, keyword) + ); + } + roleList = this.list(queryWrapper); + } + return roleList; + } + + @Override + public List getSwaptListByIds(Set roleIds) { + if (roleIds.size()>0){ + QueryWrapper roleWrapper = new QueryWrapper<>(); + roleWrapper.lambda().select(RoleEntity::getFullName,RoleEntity::getId).in(RoleEntity::getId,roleIds); + List list = roleService.list(roleWrapper); + return list; + } + return new ArrayList<>(); + } + + @Override + public Map getRoleMap() { + QueryWrapper roleWrapper = new QueryWrapper<>(); + roleWrapper.lambda().select(RoleEntity::getFullName,RoleEntity::getId); + List list = roleService.list(roleWrapper); + return list.stream().collect(Collectors.toMap(RoleEntity::getId,RoleEntity::getFullName)); + } + + @Override + public Map getRoleNameAndIdMap() { + QueryWrapper roleWrapper = new QueryWrapper<>(); + List list = roleService.list(roleWrapper); + Map roleNameMap = new HashMap<>(); + list.stream().forEach(role->roleNameMap.put(role.getFullName() + "/" + role.getEnCode(),role.getId())); + return roleNameMap; + } + + @Override + public RoleEntity getInfoByFullName(String fullName) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(RoleEntity::getFullName, fullName); + return this.getOne(queryWrapper); + } + + @Override + public RoleEntity getInfoByFullName(String fullName,String enCode) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(RoleEntity::getFullName, fullName); + queryWrapper.lambda().eq(RoleEntity::getEnCode, enCode); + return this.getOne(queryWrapper); + } + + @Override + public List getGlobalList() { + QueryWrapper query = new QueryWrapper<>(); + query.lambda().eq(RoleEntity::getGlobalMark, 1).eq(RoleEntity::getEnabledMark, 1); + return this.list(query); + } + + @Override + public List getGlobalList(List ids) { + if (ids.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper query = new QueryWrapper<>(); + query.lambda().in(RoleEntity::getId, ids); + query.lambda().eq(RoleEntity::getGlobalMark, 1).eq(RoleEntity::getEnabledMark, 1); + return this.list(query); + } + + @Override + public Boolean existCurRoleByOrgId(String orgId) { + List roleRelationList = userRelationService + .getListByObjectType(userProvider.get().getUserId(), PermissionConst.ROLE); + for(UserRelationEntity userRelationEntity : roleRelationList){ + if(organizeRelationService.existByRoleIdAndOrgId(userRelationEntity.getObjectId(), orgId)){ + return true; + } + } + return false; + } + + @Override + public List getCurRolesByOrgId(String orgId) { + String userId = userProvider.get().getUserId(); + List userRelations = userRelationService.getListByObjectType(userId, PermissionConst.ROLE); + List roles = new ArrayList<>(); + userRelations.forEach(ur->{ + // 获取全局角色 + RoleEntity roleEntity = this.getInfo(ur.getObjectId()); + if(roleEntity != null && roleEntity.getGlobalMark() != null && roleEntity.getGlobalMark() == 1 && roleEntity.getEnabledMark() == 1) { + roles.add(roleEntity); + }else { + organizeRelationService.getRelationListByRoleId(ur.getObjectId()).forEach(or -> { + if (roleEntity.getEnabledMark() == 1 && or.getOrganizeId().equals(orgId)) { + roles.add(roleEntity); + } + }); + } + }); + return roles; + } + + @Override + public List getRolesByOrgId(String orgId) { + List ids = new ArrayList<>(); + organizeRelationService.getListByTypeAndOrgId(PermissionConst.ROLE, orgId).forEach(o->{ + ids.add(o.getObjectId()); + }); + QueryWrapper query = new QueryWrapper<>(); + if(ids.size() > 0){ + query.lambda().in(RoleEntity::getId, ids); + return this.list(query); + }else { + return new ArrayList<>(); + } + } + + @Override + public String getBindInfo(String roleId, List reduceOrgIds){ + if(reduceOrgIds.size() > 0){ + StringBuilder info = new StringBuilder(); + RoleEntity roleEntity = this.getInfo(roleId); + List bingUserByRoleList = userRelationService.getListByObjectId(roleId, PermissionConst.ROLE); + if(bingUserByRoleList.size() < 1){ + return null; + } + info.append("已绑定用户:"); + boolean bindFlag = false; + for (UserRelationEntity bingUser : bingUserByRoleList) { + String userId = bingUser.getUserId(); + if(roleEntity.getGlobalMark() == 1){ + UserEntity user = userService.getInfo(userId); + info.append("[ ").append(user.getRealName()).append("/").append(user.getAccount()).append(" ] "); + bindFlag = true; + }else { + // 这个用户所绑定的组织 + List bingUserByOrg = userRelationService.getListByObjectType(userId, PermissionConst.ORGANIZE); + for (UserRelationEntity bingOrg : bingUserByOrg) { + String orgId = bingOrg.getObjectId(); + if(reduceOrgIds.contains(orgId)){ + OrganizeEntity org = organizeService.getInfo(orgId); + UserEntity user = userService.getInfo(bingOrg.getUserId()); + info.append("[").append(org.getFullName()).append(":用户(").append(user.getRealName()).append(")]; "); + bindFlag = true; + } + } + } + } + + if(bindFlag){ + return info.toString(); + }else { + return null; + } + }else { + return null; + } + } +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/SocialsUserServiceImpl.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/SocialsUserServiceImpl.java new file mode 100644 index 0000000..95b230d --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/SocialsUserServiceImpl.java @@ -0,0 +1,54 @@ +package jnpf.permission.service.impl; + +import jnpf.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import jnpf.permission.entity.SocialsUserEntity; +import jnpf.permission.mapper.SocialsUserMapper; +import jnpf.permission.service.SocialsUserService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 流程设计 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/7/14 9:33:16 + */ +@Service +public class SocialsUserServiceImpl extends SuperServiceImpl implements SocialsUserService { + @Override + public List getListByUserId(String userId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SocialsUserEntity::getUserId,userId); + return this.list(queryWrapper); + } + + @Override + public List getUserIfnoBySocialIdAndType(String socialId, String socialType) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SocialsUserEntity::getSocialId,socialId); + queryWrapper.lambda().eq(SocialsUserEntity::getSocialType,socialType); + return this.list(queryWrapper); + } + + @Override + public List getListByUserIdAndSource(String userId, String socialType) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SocialsUserEntity::getUserId,userId); + queryWrapper.lambda().eq(SocialsUserEntity::getSocialType,socialType); + return this.list(queryWrapper); + } + + @Override + public SocialsUserEntity getInfoBySocialId(String socialId,String socialType){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SocialsUserEntity::getSocialId,socialId); + queryWrapper.lambda().eq(SocialsUserEntity::getSocialType,socialType); + return this.getOne(queryWrapper); + } + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/UserInfoServiceImpl.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/UserInfoServiceImpl.java new file mode 100644 index 0000000..0fafc0a --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/UserInfoServiceImpl.java @@ -0,0 +1,73 @@ +package jnpf.permission.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import jnpf.permission.connector.UserInfoService; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.UserService; +import jnpf.util.JsonUtil; +import jnpf.util.Md5Util; +import jnpf.util.RandomUtil; +import jnpf.util.StringUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Map; + +/** + * 用户信息保存 + * + * @author :JNPF开发平台组 + * @version: V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date :2022/7/28 14:38 + */ +@Service +public class UserInfoServiceImpl implements UserInfoService { + + @Autowired + private UserService userService; + + @Override + public Boolean create(Map map) { + UserEntity entity = JsonUtil.getJsonToBean(map, UserEntity.class); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserEntity::getAccount, entity.getAccount()); + UserEntity entity1 = userService.getOne(queryWrapper); + if (entity1 != null) { + entity.setId(entity1.getId()); + return userService.updateById(entity); + } else { + if (StringUtil.isEmpty(entity.getId())) { + String userId = RandomUtil.uuId(); + entity.setId(userId); + } + entity.setSecretkey(RandomUtil.uuId()); + entity.setPassword(Md5Util.getStringMd5(entity.getPassword().toLowerCase() + entity.getSecretkey().toLowerCase())); + entity.setIsAdministrator(0); + return userService.save(entity); + } + } + + @Override + public Boolean update(Map map) { + return create(map); + } + + @Override + public Boolean delete(Map map) { + UserEntity entity = JsonUtil.getJsonToBean(map, UserEntity.class); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserEntity::getAccount, entity.getAccount()); + UserEntity entity1 = userService.getOne(queryWrapper); + if (entity1 != null) { + entity.setId(entity1.getId()); + } + return userService.removeById(entity.getId()); + } + + @Override + public Map getInfo(String id) { + UserEntity entity = userService.getInfo(id); + return JsonUtil.entityToMap(entity); + } +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/UserOldPasswordServiceImpl.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/UserOldPasswordServiceImpl.java new file mode 100644 index 0000000..6fd7d4a --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/UserOldPasswordServiceImpl.java @@ -0,0 +1,51 @@ +package jnpf.permission.service.impl; + +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import jnpf.base.service.SuperServiceImpl; +import jnpf.permission.entity.UserOldPasswordEntity; +import jnpf.permission.mapper.UserOldPasswordMapper; +import jnpf.permission.service.UserOldPasswordService; +import jnpf.permission.service.UserRelationService; +import jnpf.util.DateUtil; +import jnpf.util.RandomUtil; +import jnpf.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 用户信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +@Service +@DSTransactional +public class UserOldPasswordServiceImpl extends SuperServiceImpl implements UserOldPasswordService { + + @Autowired + private UserProvider userProvider; + @Autowired + private UserRelationService userRelationService; + + @Override + public List getList(String userId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserOldPasswordEntity::getUserId,userId); + queryWrapper.lambda().orderByDesc(UserOldPasswordEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public Boolean create(UserOldPasswordEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setCreatorTime(DateUtil.getNowDate()); + this.save(entity); + return true; + } + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/UserRelationServiceImpl.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/UserRelationServiceImpl.java new file mode 100644 index 0000000..4c91432 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/UserRelationServiceImpl.java @@ -0,0 +1,387 @@ +package jnpf.permission.service.impl; + +import jnpf.base.service.SuperServiceImpl; +import cn.hutool.core.util.ArrayUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import jnpf.base.UserInfo; +import jnpf.constant.PermissionConst; +import jnpf.message.entity.SynThirdInfoEntity; +import jnpf.message.service.SynThirdInfoService; +import jnpf.message.util.SynThirdConsts; +import jnpf.permission.entity.*; +import jnpf.permission.mapper.UserRelationMapper; +import jnpf.permission.model.permission.PermissionModel; +import jnpf.permission.model.userrelation.UserRelationForm; +import jnpf.permission.service.*; +import jnpf.permission.util.PermissionUtil; +import jnpf.util.RandomUtil; +import jnpf.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 用户关系 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +@Service +@DSTransactional +public class UserRelationServiceImpl extends SuperServiceImpl implements UserRelationService { + + @Autowired + private UserProvider userProvider; + @Autowired + private UserService userService; + @Autowired + private RoleService roleService; + @Autowired + private PositionService positionService; + @Autowired + private OrganizeService organizeService; + @Autowired + private OrganizeRelationService organizeRelationService; + @Autowired + private UserRelationService userRelationService; + @Autowired + private SynThirdInfoService synThirdInfoService; + + @Override + public List getListByUserId(String userId) { + return getListByUserIdAll(Collections.singletonList(userId)); + } + + @Override + public List getListByUserIdAndObjType(String userId, String objectType) { + QueryWrapper query = new QueryWrapper<>(); + query.lambda().in(UserRelationEntity::getUserId, userId); + query.lambda().in(UserRelationEntity::getObjectType, objectType); + query.lambda().orderByAsc(UserRelationEntity::getSortCode).orderByDesc(UserRelationEntity::getCreatorTime); + return this.list(query); + } + + @Override + public List getListByUserIdAll(List userId) { + if (userId.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(UserRelationEntity::getUserId, userId); + return this.list(queryWrapper); + } + return new ArrayList<>(); + } + + @Override + public List getListByObjectId(String objectId) { + return getListByObjectId(objectId, null); + } + + @Override + public List getListByObjectType(String objectType) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserRelationEntity::getObjectType, objectType); + return this.list(queryWrapper); + } + + @Override + public List getListByObjectId(String objectId, String objectType) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserRelationEntity::getObjectId, objectId); + if(objectType != null){ + queryWrapper.lambda().eq(UserRelationEntity::getObjectType, objectType); + } + queryWrapper.lambda().orderByAsc(UserRelationEntity::getSortCode).orderByDesc(UserRelationEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getListByObjectIdAll(List objectId) { + List list = new ArrayList<>(); + if (objectId.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(UserRelationEntity::getObjectId, objectId); + list = this.list(queryWrapper); + } + return list; + } + + @Override + public void deleteAllByObjId(String objId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserRelationEntity::getObjectId, objId); + this.remove(queryWrapper); + } + + @Override + public void deleteAllByUserId(String userId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserRelationEntity::getUserId, userId); + userRelationService.remove(queryWrapper); + } + + @Override + public void createByList(List userRelationEntityList) { + userRelationEntityList.forEach(t -> { + this.save(t); + }); + } + + @Override + public UserRelationEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserRelationEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + @DSTransactional + public void save(String objectId, List entitys) { + List existList = this.getListByObjectId(objectId); + List relationList = new ArrayList<>(); + for (int i = 0; i < entitys.size(); i++) { + UserRelationEntity entity = entitys.get(i); + entity.setId(RandomUtil.uuId()); + entity.setSortCode(Long.parseLong(i + "")); + entity.setCreatorUserId(userProvider.get().getUserId()); + if (existList.stream().filter(t -> t.getUserId().equals(entity.getUserId())).count() == 0) { + relationList.add(entity); + } + } + for (UserRelationEntity entity : relationList) { + this.save(entity); + } + } + + @Override + public void save(List list) { + for (UserRelationEntity entity : list) { + this.save(entity); + } + } + + @Override + @DSTransactional + public void delete(String[] ids) { + for (String item : ids) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserRelationEntity::getId, item); + this.remove(queryWrapper); + } + } + + + @Override + @DSTransactional + public void saveObjectId(String objectId, UserRelationForm userRelationForm) { + // 修改前的岗位绑定人员ID + List beforeUserIds = userRelationService.getListByObjectId(objectId) + .stream().map(UserRelationEntity::getUserId).collect(Collectors.toList()); + //清除原有成员数据 + deleteAllByObjId(objectId); + UserInfo userInfo = userProvider.get(); + List list = new ArrayList<>(); + int i = 0; + for (String userId : userRelationForm.getUserIds()) { + UserRelationEntity entity = new UserRelationEntity(); + entity.setId(RandomUtil.uuId()); + entity.setSortCode(Long.parseLong(i + "")); + entity.setObjectId(objectId); + entity.setObjectType(userRelationForm.getObjectType()); + entity.setCreatorUserId(userInfo.getUserId()); + entity.setUserId(userId); + list.add(entity); + i++; + } + save(objectId, list); + + // 并集:所有未修改的人员 + List unUpdateUserId = beforeUserIds.stream().filter(b-> userRelationForm.getUserIds() + .contains(b)).collect(Collectors.toList()); + // 差集:所有修改过的人员(包括:删除此岗位、添加此岗位的人员) + beforeUserIds.addAll(userRelationForm.getUserIds()); + List allUpdateIds = beforeUserIds.stream().filter(u-> !unUpdateUserId.contains(u)) + .collect(Collectors.toList()); + + if (PermissionConst.POSITION.equals(userRelationForm.getObjectType())) { + // 自动切换岗位 + organizeRelationService.autoSetPosition(allUpdateIds); + } + } + + @Override + public void roleSaveByUserIds(String roleId, List userIds) { + //清除原有成员数据 + deleteAllByObjId(roleId); + String currentUserId = userProvider.get().getUserId(); + List userRelationList = new ArrayList<>(); + for (String userId : userIds) { + UserRelationEntity entity = new UserRelationEntity(); + entity.setId(RandomUtil.uuId()); + entity.setObjectId(roleId); + entity.setObjectType(PermissionConst.ROLE); + entity.setCreatorUserId(currentUserId); + entity.setUserId(userId); + userRelationList.add(entity); + } + this.saveBatch(userRelationList); + } + + @Override + public List getRelationByUserIds(List userIds) { + if (userIds.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper query = new QueryWrapper<>(); + query.lambda().in(UserRelationEntity::getUserId, userIds); + query.lambda().eq(UserRelationEntity::getObjectType, PermissionConst.ORGANIZE); + return this.list(query); + } + + @Override + public List getListByObjectType(String userId, String objectType) { + QueryWrapper query = new QueryWrapper<>(); + query.lambda().eq(UserRelationEntity::getUserId, userId).eq(UserRelationEntity::getObjectType, objectType); + query.lambda().orderByAsc(UserRelationEntity::getSortCode).orderByDesc(UserRelationEntity::getCreatorTime); + return this.list(query); + } + + @Override + public List getAllOrgRelationByUserId(String userId){ + return this.getListByObjectType(userId,PermissionConst.ORGANIZE); + } + + @Override + public List getObjectVoList(String objectType) { + String userId = userProvider.get().getUserId(); + UserEntity userEntity = userService.getInfo(userId); + String majorOrgId = userProvider.get().getOrganizeId(); + + // 组装对应组织/岗位/角色对象 + switch (objectType) { + case PermissionConst.ORGANIZE: + // 使用in查询减少数据库查询次数 + List ids = new ArrayList<>(); + this.getListByObjectType(userId, objectType).forEach(r -> ids.add(r.getObjectId())); + List permissionModels = setModel(organizeService.getOrgEntityList(ids, false), majorOrgId); + permissionModels.forEach(p->p.setFullName(PermissionUtil.getLinkInfoByOrgId(p.getId(), organizeService, false))); + return permissionModels; + case PermissionConst.POSITION: + // 岗位遵循一对多关系 + List positionList = positionService.getListByUserId(userId); + if (positionList.size() > 0) { + return setModel(positionList.stream().filter(p -> p.getOrganizeId().equals(majorOrgId)) + .collect(Collectors.toList()), userEntity.getPositionId()); + } + default: + return new ArrayList<>(); + } + } + + /** + * 设置返回模型 + * + * @param permissionList + * @param majorId + */ + private List setModel (List permissionList, String majorId){ + List voList = new ArrayList<>(); + permissionList.forEach(p -> { + PermissionModel model = new PermissionModel(); + if (p.getId().equals(majorId)) { + model.setIsDefault(true); + } else { + model.setIsDefault(false); + } + model.setFullName(p.getFullName()); + model.setId(p.getId()); + model.setFullName(p.getFullName()); + voList.add(model); + }); + return voList; + } + + @Override + public Boolean existByObj(String objectType, String objectId) { + QueryWrapper query = new QueryWrapper<>(); + query.lambda() + .eq(UserRelationEntity::getObjectType, objectType) + .eq(UserRelationEntity::getObjectId, objectId); + return this.count(query) > 0; + } + + @Override + public List getListByRoleId(String roleId) { + List list = new ArrayList<>(); + organizeRelationService.getRelationListByRoleId(roleId).forEach(o->{ + QueryWrapper query = new QueryWrapper<>(); + query.lambda() + .eq(UserRelationEntity::getObjectType, PermissionConst.ORGANIZE) + .eq(UserRelationEntity::getObjectId, o.getOrganizeId()); + list.addAll(this.list(query)); + }); + return list; + } + + @Override + public List getListByUserId(String userId, String objectType) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserRelationEntity::getUserId, userId); + queryWrapper.lambda().eq(UserRelationEntity::getObjectType, objectType); + return this.list(queryWrapper); + } + + @Override + public List getListByOrgId(List orgIdList) { + if (orgIdList.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserRelationEntity::getObjectType, PermissionConst.ORGANIZE).in(UserRelationEntity::getObjectId, orgIdList); + return this.list(queryWrapper); + } + return new ArrayList<>(); + } + + @Override + public void syncDingUserRelation(String sysObjId, List deptIdList) { + List list = new ArrayList<>(); + UserRelationEntity entity = null; + // 查询对应的中间表,获取到对应的本地组织id + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().in(SynThirdInfoEntity::getThirdObjId,deptIdList); + wrapper.lambda().eq(SynThirdInfoEntity::getThirdType, SynThirdConsts.THIRD_TYPE_DING_To_Sys); + List synThirdInfoLists = synThirdInfoService.getBaseMapper().selectList(wrapper); + HashMap map = new HashMap<>(); + for (SynThirdInfoEntity obj : synThirdInfoLists) { + map.put(obj.getThirdObjId(),obj.getSysObjId()); + } + // 已经存在的数据 + List collect = deptIdList.stream().map(t -> String.valueOf(t)).collect(Collectors.toList()); + QueryWrapper relationWrapper = new QueryWrapper<>(); + relationWrapper.lambda().in(UserRelationEntity::getObjectId,collect); + relationWrapper.lambda().eq(UserRelationEntity::getObjectType,"Organize"); + relationWrapper.lambda().eq(UserRelationEntity::getUserId,sysObjId); + List userRelationEntities = this.getBaseMapper().selectList(relationWrapper); + List deleteIdS = userRelationEntities.stream().map(t -> t.getId()).collect(Collectors.toList()); + this.removeByIds(deleteIdS); + + + for (Long id : deptIdList) { + String objectId = String.valueOf(id); + entity= new UserRelationEntity(); + entity.setId(RandomUtil.uuId()); + entity.setObjectId(map.get(objectId)); + entity.setCreatorUserId(userService.getUserByAccount("admin") != null ? userService.getUserByAccount("admin").getId() : null); + entity.setSortCode(0L); + entity.setUserId(sysObjId); + entity.setObjectType("Organize"); + list.add(entity); + } + this.saveBatch(list); + } + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/UserServiceImpl.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/UserServiceImpl.java new file mode 100644 index 0000000..5114e72 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/service/impl/UserServiceImpl.java @@ -0,0 +1,2165 @@ +package jnpf.permission.service.impl; + +import cn.hutool.core.collection.CollectionUtil; +import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.page.PageMethod; +import jnpf.base.service.SuperServiceImpl; +import cn.afterturn.easypoi.excel.ExcelExportUtil; +import cn.afterturn.easypoi.excel.entity.ExportParams; +import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; +import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; +import cn.xuyanwu.spring.file.storage.FileInfo; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import jnpf.base.Pagination; +import jnpf.base.entity.DictionaryDataEntity; +import jnpf.base.service.DictionaryDataService; +import jnpf.base.vo.DownloadVO; +import jnpf.config.ConfigValueUtil; +import jnpf.constant.JnpfConst; +import jnpf.constant.PermissionConst; +import jnpf.consts.AuthConsts; +import jnpf.exception.DataException; +import jnpf.message.util.OnlineUserModel; +import jnpf.message.util.OnlineUserProvider; +import jnpf.permission.model.user.UserIdListVo; +import jnpf.permission.model.user.vo.*; +import jnpf.database.source.DbBase; +import jnpf.database.util.DataSourceUtil; +import jnpf.permission.entity.*; +import jnpf.permission.mapper.UserMapper; +import jnpf.permission.model.user.mod.UserImportModel; +import jnpf.permission.model.user.page.PaginationUser; +import jnpf.util.ExcelUtil; +import jnpf.permission.service.*; +import jnpf.util.*; +import lombok.Cleanup; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.ss.usermodel.Workbook; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import org.springframework.util.ObjectUtils; +import org.springframework.web.multipart.MultipartFile; + +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.stream.Collectors; +import jnpf.base.UserInfo; +import jnpf.permission.model.user.mod.UserConditionModel; + +import static jnpf.consts.AuthConsts.TOKEN_PREFIX; + +/** + * 用户信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +@Service +@DSTransactional +public class UserServiceImpl extends SuperServiceImpl implements UserService { + + @Autowired + private UserProvider userProvider; + @Autowired + private UserRelationService userRelationService; + @Autowired + private RedisUtil redisUtil; + @Autowired + private OrganizeService organizeService; + @Autowired + private PositionService positionService; + @Autowired + private RoleService roleService; + @Autowired + private CacheKeyUtil cacheKeyUtil; + @Autowired + private DataSourceUtil dataSourceUtil; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private DictionaryDataService dictionaryDataService; + @Autowired + private OrganizeRelationService organizeRelationService; + @Autowired + private AuthorizeService authorizeService; + @Autowired + private UserMapper userMapper; + @Autowired + private OrganizeAdministratorService organizeAdministratorService; + @Autowired + private UserOldPasswordService userOldPasswordService; + @Autowired + private GroupService groupService; + @Autowired + private PermissionGroupService permissionGroupService; + + @Override + public List getList(boolean filterEnabledMark) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (filterEnabledMark) { + queryWrapper.lambda().eq(UserEntity::getEnabledMark, 1); + } + queryWrapper.lambda().orderByAsc(UserEntity::getSortCode).orderByDesc(UserEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getUserNameList(List idList) { + if (idList.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select(UserEntity::getId, UserEntity::getRealName).in(UserEntity::getId, idList); + return this.list(queryWrapper); + } + return new ArrayList<>(); + } + + @Override + public List getUserNameList(Set idList) { + if (idList.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select(UserEntity::getId, UserEntity::getRealName,UserEntity::getAccount).in(UserEntity::getId, idList); + return this.list(queryWrapper); + } + return new ArrayList<>(); + } + + @Override + public Map getUserMap() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select(UserEntity::getId, UserEntity::getRealName,UserEntity::getAccount); + Map userMap = new HashMap<>(); + this.list(queryWrapper).stream().forEach(user->userMap.put(user.getId(),user.getRealName()+"/"+user.getAccount())); + return userMap; + } + + @Override + public Map getUserNameAndIdMap() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select(UserEntity::getId, UserEntity::getRealName,UserEntity::getAccount); + Map userMap = new HashMap<>(); + this.list(queryWrapper).stream().forEach(user->userMap.put(user.getRealName()+"/"+user.getAccount(), user.getId())); + return userMap; + } + + @Override + public UserEntity getByRealName(String realName) { + UserEntity userEntity = new UserEntity(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserEntity::getRealName, realName); + queryWrapper.lambda().select(UserEntity::getId); + List list = this.list(queryWrapper); + if (list.size() > 0) { + userEntity = list.get(0); + } + return userEntity; + } + + @Override + public UserEntity getByRealName(String realName,String account) { + UserEntity userEntity = new UserEntity(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserEntity::getRealName, realName); + queryWrapper.lambda().eq(UserEntity::getAccount, account); + queryWrapper.lambda().select(UserEntity::getId); + List list = this.list(queryWrapper); + if (list.size() > 0) { + userEntity = list.get(0); + } + return userEntity; + } + + @Override + public List getAdminList() { + QueryWrapper query = new QueryWrapper<>(); + query.lambda().eq(UserEntity::getIsAdministrator, 1); + query.lambda().orderByAsc(UserEntity::getSortCode).orderByDesc(UserEntity::getCreatorTime); + return list(query); + } + + @Override + public List getList(Pagination pagination, String organizeId, Boolean flag, Boolean filter) { + // 定义变量判断是否需要使用修改时间倒序 + boolean filterLastTime = false; + String userId = userProvider.get().getUserId(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select(UserEntity::getId); + if (flag) { + queryWrapper.lambda().ne(UserEntity::getId, userId); + } + if (filter) { + queryWrapper.lambda().ne(UserEntity::getAccount, "admin"); + } + //组织机构 + if (!StringUtil.isEmpty(organizeId)) { + List orgIdList = organizeService.getUnderOrganizationss(organizeId); + orgIdList.add(organizeId); + PageHelper.startPage((int) pagination.getCurrentPage(), (int) pagination.getPageSize()); + //组织数量很多时解析SQL很慢, COUNT不解析SQL不去除ORDERBY + PageMethod.getLocalPage().keepOrderBy(true); + // 用户id + List query = new ArrayList<>(16); + String dbSchema = null; + // 判断是否为多租户 + if (configValueUtil.isMultiTenancy() && DbBase.DM.equalsIgnoreCase(dataSourceUtil.getDbType())) { + dbSchema = dataSourceUtil.getDbSchema(); + } + String keyword = null; + if (StringUtil.isNotEmpty(pagination.getKeyword())) { + keyword = "%" + pagination.getKeyword() + "%"; + } + query = userMapper.query(orgIdList, keyword, dbSchema); + PageInfo pageInfo = new PageInfo(query); + // 赋值分页参数 + pagination.setTotal(pageInfo.getTotal()); + pagination.setCurrentPage(pageInfo.getPageNum()); + pagination.setPageSize(pageInfo.getPageSize()); + if (pageInfo.getList().size() > 0) { + // 存放返回结果 + QueryWrapper queryWrapper1 = new QueryWrapper<>(); + queryWrapper1.lambda().in(UserEntity::getId, query); + List entityList = getBaseMapper().selectList(queryWrapper1); +// List entityList = new ArrayList<>(16); +// for (Object userIds : pageInfo.getList()) { +// QueryWrapper queryWrapper1 = new QueryWrapper<>(); +// queryWrapper1.lambda().eq(UserEntity::getId, userIds); +// entityList.add(this.getOne(queryWrapper1)); +// } + return entityList; + } else { + return new ArrayList<>(); + } + } + if (!userProvider.get().getIsAdministrator()) { + // 通过权限转树 + List listss = organizeAdministratorService.getOrganizeAdministratorEntity(userProvider.get().getUserId()); + Set orgIds = new HashSet<>(16); + // 判断自己是哪些组织的管理员 + listss.stream().forEach(t-> { + if (t != null) { + if (t.getThisLayerSelect() != null && t.getThisLayerSelect() == 1) { + orgIds.add(t.getOrganizeId()); + } + if (t.getSubLayerSelect() != null && t.getSubLayerSelect() == 1) { + List underOrganizations = organizeService.getUnderOrganizations(t.getOrganizeId(), false); + orgIds.addAll(underOrganizations); + } + } + }); + List list1 = new ArrayList<>(orgIds); + // 得到所有有权限的组织 + List organizeName = new ArrayList<>(organizeService.getOrganizeName(list1, null, false).values()); + // 用户关系表得到所有的人 + List collect = organizeName.stream().map(OrganizeEntity::getId).collect(Collectors.toList()); + List listByObjectIdAll = userRelationService.getListByOrgId(collect); + List collect1 = listByObjectIdAll.stream().map(UserRelationEntity::getUserId).distinct().collect(Collectors.toList()); + return getUserNames(collect1, pagination, false, false); + } + //关键字(账户、姓名、手机) + if (!StringUtil.isEmpty(pagination.getKeyword())) { + filterLastTime = true; + queryWrapper.lambda().and( + t -> t.like(UserEntity::getAccount, pagination.getKeyword()) + .or().like(UserEntity::getRealName, pagination.getKeyword()) + .or().like(UserEntity::getMobilePhone, pagination.getKeyword()) + ); + } + //排序 + queryWrapper.lambda().orderByAsc(UserEntity::getSortCode).orderByDesc(UserEntity::getCreatorTime); + if (filterLastTime) { + queryWrapper.lambda().orderByDesc(UserEntity::getLastModifyTime); + } + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage iPage = this.page(page, queryWrapper); + if(!iPage.getRecords().isEmpty()){ + List ids = iPage.getRecords().stream().map(m->m.getId()).collect(Collectors.toList()); + queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(UserEntity::getId, ids); + queryWrapper.lambda().orderByAsc(UserEntity::getSortCode).orderByDesc(UserEntity::getCreatorTime); + if (filterLastTime) { + queryWrapper.lambda().orderByDesc(UserEntity::getLastModifyTime); + } + iPage.setRecords(this.list(queryWrapper)); + } + return pagination.setData(iPage.getRecords(), iPage.getTotal()); + } + + @Override + public List getList(Pagination pagination, Boolean filterCurrentUser) { + // 定义变量判断是否需要使用修改时间倒序 + boolean filterLastTime = false; + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (filterCurrentUser) { + String userId = userProvider.get().getUserId(); + queryWrapper.lambda().ne(UserEntity::getId, userId); + } + queryWrapper.lambda().ne(UserEntity::getEnabledMark, 0); + //关键字(账户、姓名、手机) + if (!StringUtil.isEmpty(pagination.getKeyword())) { + filterLastTime = true; + queryWrapper.lambda().and( + t -> t.like(UserEntity::getAccount, pagination.getKeyword()) + .or().like(UserEntity::getRealName, pagination.getKeyword()) + .or().like(UserEntity::getMobilePhone, pagination.getKeyword()) + ); + } + //排序 + queryWrapper.lambda().orderByAsc(UserEntity::getSortCode).orderByDesc(UserEntity::getCreatorTime); + if (filterLastTime) { + queryWrapper.lambda().orderByDesc(UserEntity::getLastModifyTime); + } + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage iPage = this.page(page, queryWrapper); + return pagination.setData(iPage.getRecords(), iPage.getTotal()); + } + + @Override + public List getUserPage(Pagination pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().ne(UserEntity::getEnabledMark, 0); + if (StringUtil.isNotEmpty(pagination.getKeyword())) { + //通过关键字查询 + queryWrapper.lambda().and( + t -> t.like(UserEntity::getAccount, pagination) + .or().like(UserEntity::getRealName, pagination) + .or().like(UserEntity::getMobilePhone, pagination) + ); + } + queryWrapper.lambda().ne(UserEntity::getEnabledMark, 0); + queryWrapper.lambda().select(UserEntity::getId, UserEntity::getAccount, UserEntity::getRealName, UserEntity::getGender, UserEntity::getEnabledMark); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage iPage = this.page(page, queryWrapper); + return iPage.getRecords(); + } + + @Override + public List getListByOrganizeId(String organizeId, String keyword) { + List userIds = userRelationService.getListByObjectId(organizeId, PermissionConst.ORGANIZE).stream() + .map(UserRelationEntity::getUserId).collect(Collectors.toList()); + if (userIds.size() > 0) { + QueryWrapper query = new QueryWrapper<>(); + if (userIds.size() > 0) { + query.lambda().in(UserEntity::getId, userIds); + } + // 通过关键字查询 + if (StringUtil.isNotEmpty(keyword)) { + query.lambda().and( + t -> t.like(UserEntity::getAccount, keyword) + .or().like(UserEntity::getRealName, keyword) + ); + } + // 只查询正常的用户 + query.lambda().ne(UserEntity::getEnabledMark, 0); + query.lambda().orderByAsc(UserEntity::getSortCode).orderByDesc(UserEntity::getCreatorTime); + return this.list(query); + } + return new ArrayList<>(0); + } + + @Override + public List getListByManagerId(String managerId, String keyword) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserEntity::getManagerId, managerId); + // 通过关键字查询 + if (StringUtil.isNotEmpty(keyword)) { + queryWrapper.lambda().and( + t -> t.like(UserEntity::getAccount, keyword) + .or().like(UserEntity::getRealName, keyword) + ); + } + // 只查询正常的用户 + queryWrapper.lambda().eq(UserEntity::getEnabledMark, 1); + queryWrapper.lambda().orderByAsc(UserEntity::getSortCode).orderByDesc(UserEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public UserEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserEntity::getId, String.valueOf(id)); + return this.getOne(queryWrapper); + } + + @Override + public UserEntity getUserByAccount(String account) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserEntity::getAccount, account); + return this.getOne(queryWrapper); + } + + @Override + public UserEntity getUserByMobile(String mobile) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserEntity::getMobilePhone, mobile); + return this.getOne(queryWrapper); + } + + @Override + public Boolean setAdminListByIds(List adminIds) { + // 将所有的管理员取消 + QueryWrapper query = new QueryWrapper<>(); + query.lambda().eq(UserEntity::getIsAdministrator, 1); + // admin不允许移除管理员 + query.lambda().ne(UserEntity::getAccount, "admin"); + List list1 = this.list(query); + for (UserEntity entity : list1) { + entity.setIsAdministrator(0); + this.updateById(entity); + } + // 重新赋值管理员 + List list = new ArrayList<>(); + adminIds.stream().forEach(adminId -> { + UserEntity userEntity = new UserEntity(); + userEntity.setId(adminId); + userEntity.setIsAdministrator(1); + // admin无需添加 + if (!"admin".equals(userEntity.getAccount())) { + list.add(userEntity); + } + }); + return this.updateBatchById(list); + } + + @Override + public boolean isExistByAccount(String account) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserEntity::getAccount, account); + UserEntity entity = this.getOne(queryWrapper); + if (entity != null) { + return true; + } + return false; + } + + @Override + @DSTransactional + public Boolean create(UserEntity entity) throws Exception { + //添加用户 初始化 + String userId = RandomUtil.uuId(); + entity.setPassword("4a7d1ed414474e4033ac29ccb8653d9b"); + entity.setId(userId); + if (StringUtil.isEmpty(entity.getAccount())) { + throw new DataException("账号不能为空"); + } + if (StringUtil.isEmpty(entity.getRealName())) { + throw new DataException("姓名不能为空"); + } + //获取头像 + String oldHeadIcon = entity.getHeadIcon(); + if (StringUtil.isEmpty(oldHeadIcon)) { + entity.setHeadIcon("001.png"); + } else { + //获取头像 + String[] headIcon = oldHeadIcon.split("/"); + if (headIcon.length > 0) { + entity.setHeadIcon(headIcon[headIcon.length - 1]); + } + } + entity.setSecretkey(RandomUtil.uuId()); + entity.setPassword(Md5Util.getStringMd5(entity.getPassword().toLowerCase() + entity.getSecretkey().toLowerCase())); + entity.setIsAdministrator(0); + entity.setCreatorUserId(userProvider.get().getUserId()); + saveOrUpdateCommon(userId, entity); + this.save(entity); + return true; + } + + @Override + @DSTransactional + public Boolean update(String userId, UserEntity entity) throws Exception { + //更新用户 + entity.setId(userId); + if (StringUtil.isEmpty(entity.getAccount())) { + throw new DataException("账号不能为空"); + } + if (StringUtil.isEmpty(entity.getRealName())) { + throw new DataException("姓名不能为空"); + } + //获取头像 + String oldHeadIcon = entity.getHeadIcon(); + if (StringUtil.isEmpty(oldHeadIcon)) { + entity.setHeadIcon("001.png"); + } + entity.setLastModifyTime(DateUtil.getNowDate()); + entity.setLastModifyUserId(userProvider.get().getUserId()); + //获取头像 + String[] headIcon = entity.getHeadIcon().split("/"); + if (headIcon.length > 0) { + entity.setHeadIcon(headIcon[headIcon.length - 1]); + } + saveOrUpdateCommon(userId, entity); + this.updateById(entity); + return true; + } + + private Boolean saveOrUpdateCommon(String userId, UserEntity entity) { + List userAllOrgIds = Arrays.asList(entity.getOrganizeId().split(",")); + List userAllPosIds = StringUtil.isNotEmpty(entity.getPositionId()) ? Arrays.asList(entity.getPositionId().split(",")) : new ArrayList<>(); + List userAllRoleIds = StringUtil.isNotEmpty(entity.getRoleId()) ? Arrays.asList(entity.getRoleId().split(",")) : new ArrayList<>(); + + // 更新用户关系(组织/岗位/角色) + List relationList = new ArrayList<>(); + setUserRelation(relationList, PermissionConst.ORGANIZE, userAllOrgIds, entity); + setUserRelation(relationList, PermissionConst.POSITION, userAllPosIds, entity); + setUserRelation(relationList, PermissionConst.ROLE, userAllRoleIds, entity); + // 获取分组信息保存 + List listByObjectType = userRelationService.getListByObjectType(userId, PermissionConst.GROUP); + setUserRelation(listByObjectType, PermissionConst.GROUP, userAllRoleIds, entity); + relationList.addAll(listByObjectType); + if (userId != null) { + // 删除用户关联 + userRelationService.deleteAllByUserId(userId); + } + if (relationList.size() > 0) { + userRelationService.createByList(relationList); + } + + /*========== 自动设置带有权限的默认组织、自动设置默认岗位 ==========*/ + String majorOrgId = ""; + String majorPosId = "0"; + UserEntity userEntity = this.getInfo(userId); + if (userEntity != null) { + // 原本的主岗、主组织 + majorOrgId = userEntity.getOrganizeId(); + majorPosId = userEntity.getOrganizeId(); + } + majorOrgId = organizeRelationService.autoGetMajorOrganizeId(userId, userAllOrgIds, majorOrgId); + entity.setOrganizeId(majorOrgId); + if (userAllPosIds.size() > 0) { + entity.setPositionId(organizeRelationService.autoGetMajorPositionId(userId, majorOrgId, majorPosId)); + } else { + entity.setPositionId(""); + } + entity.setQuickQuery(PinYinUtil.getFirstSpell(entity.getRealName())); + //清理获取所有用户的redis缓存 + redisUtil.remove(cacheKeyUtil.getAllUser()); + return true; + } + + /** + * 设置用户关联对象 + */ + private void setUserRelation(List relationList, String objectType, List ids, UserEntity userEntity) { + for (String id : ids) { + UserRelationEntity relationEntity = new UserRelationEntity(); + relationEntity.setId(RandomUtil.uuId()); + relationEntity.setObjectType(objectType); + relationEntity.setObjectId(id); + relationEntity.setUserId(userEntity.getId()); + relationEntity.setCreatorTime(userEntity.getCreatorTime()); + relationEntity.setCreatorUserId(userEntity.getCreatorUserId()); + relationList.add(relationEntity); + } + } + + + @Override + @DSTransactional + public void delete(UserEntity entity) { + this.removeById(entity.getId()); + //删除用户关联 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserRelationEntity::getUserId, entity.getId()); + userRelationService.remove(queryWrapper); + } + + + @Override + public void updatePassword(UserEntity entity) { + entity.setSecretkey(RandomUtil.uuId()); + entity.setPassword(Md5Util.getStringMd5(entity.getPassword().toLowerCase() + entity.getSecretkey().toLowerCase())); + entity.setChangePasswordDate(DateUtil.getNowDate()); + this.updateById(entity); + + //加入到旧密码记录表 + UserOldPasswordEntity userOldPasswordEntity = new UserOldPasswordEntity(); + userOldPasswordEntity.setOldPassword(entity.getPassword()); + userOldPasswordEntity.setSecretkey(entity.getSecretkey()); + userOldPasswordEntity.setUserId(entity.getId()); + userOldPasswordEntity.setAccount(entity.getAccount()); + userOldPasswordService.create(userOldPasswordEntity); + } + + @Override + public List getUserName(List id) { + return getUserName(id, false); + } + + + /** + * 查询用户名称 + * + * @param id 主键值 + * @return + */ + @Override + public List getUserName(List id, boolean filterEnabledMark) { + List list = new ArrayList<>(); + // 达梦数据库无法null值入参 + id.removeAll(Collections.singleton(null)); + if (id.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(UserEntity::getId, id); + if (filterEnabledMark) { + queryWrapper.lambda().ne(UserEntity::getEnabledMark, 0); + } + list = this.list(queryWrapper); + } + return list; + } + + @Override + public List getListByUserIds(List id) { + List list = new ArrayList<>(); + // 达梦数据库无法null值入参 + id.removeAll(Collections.singleton(null)); + if (id.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(UserEntity::getId, id); + queryWrapper.lambda().ne(UserEntity::getEnabledMark, 0); + list = this.list(queryWrapper); + } + return list; + } + + @Override + public List getUserList(List id) { + List list = new ArrayList<>(); + // 达梦数据库无法null值入参 + id.removeAll(Collections.singleton(null)); + if (id.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(UserEntity::getId, id); + queryWrapper.lambda().eq(UserEntity::getEnabledMark, 0); + queryWrapper.lambda().select(UserEntity::getId); + list = this.list(queryWrapper); + } + return list; + } + +// /** +// * 有判断redis来获取所有用户信息 +// * +// * @return +// */ +// @Override +// public List getAll() { +// String catchKey = cacheKeyUtil.getAllUser(); +// if (redisUtil.exists(catchKey)) { +// return JsonUtil.getJsonToList(redisUtil.getString(catchKey).toString(), UserAllModel.class); +// } +// List list = this.getEnableMarkList("1"); +// //获取全部部门信息 +// List departmentList = organizeService.getList(); +// //获取全部岗位信息 +// List positionList = positionService.getList(); +// //获取全部角色信息 +// List roleList = roleService.getList(); +// List models = JsonUtil.getJsonToList(list, UserAllModel.class); +// for (UserAllModel model : models) { +// //部门名称 +// OrganizeEntity deptEntity = departmentList.stream().filter(t -> t.getId().equals(model.getOrganizeId())).findFirst().orElse(new OrganizeEntity()); +// if (StringUtil.isNotEmpty(deptEntity.getFullName())) { +// model.setDepartment(deptEntity.getFullName()); +// model.setDepartmentId(deptEntity.getId()); +// } +// //组织名称 +// OrganizeEntity organizeEntity = departmentList.stream().filter(t -> t.getId().equals(String.valueOf(deptEntity.getParentId()))).findFirst().orElse(new OrganizeEntity()); +// if (organizeEntity != null) { +// model.setOrganizeId(organizeEntity.getId()); +// model.setOrganize(organizeEntity.getFullName()); +// } +// //岗位名称(多个) +// if (model.getPositionId() != null) { +// List positionName = new ArrayList<>(); +// for (String id : model.getPositionId().split(",")) { +// String name = positionList.stream().filter(t -> t.getId().equals(id)).findFirst().orElse(new PositionEntity()).getFullName(); +// if (!StringUtil.isEmpty(name)) { +// positionName.add(name); +// } +// } +// model.setPositionName(String.join(",", positionName)); +// } +// //角色名称(多个) +// if (model.getRoleId() != null) { +// List roleName = new ArrayList<>(); +// for (String id : model.getRoleId().split(",")) { +// String name = roleList.stream().filter(t -> t.getId().equals(id)).findFirst().orElse(new RoleEntity()).getFullName(); +// if (!StringUtil.isEmpty(name)) { +// roleName.add(name); +// } +// } +// model.setRoleName(String.join(",", roleName)); +// } +// //主管名称 +// String managerName = list.stream().filter(t -> t.getId().equals(model.getManagerId())).findFirst().orElse(new UserEntity()).getRealName(); +// if (StringUtil.isNotEmpty(managerName)) { +// model.setManagerName(managerName); +// } +// model.setHeadIcon(UploaderUtil.uploaderImg(model.getHeadIcon())); +// } +// String allUser = JsonUtil.getObjectToString(models); +// redisUtil.insert(cacheKeyUtil.getAllUser(), allUser, 300); +// return models; +// } + +// /** +// * 直接从数据库获取所有用户信息(不过滤冻结账号) +// * +// * @return +// */ +// @Override +// public List getAll() { +// String catchKey = cacheKeyUtil.getAllUser(); +// if (redisUtil.exists(catchKey)) { +// return JsonUtil.getJsonToList(redisUtil.getString(catchKey).toString(), UserAllModel.class); +// } +// List list = this.getEnableMarkList("1"); +// //获取全部部门信息 +// List departmentList = organizeService.getList(); +// //获取全部岗位信息 +// List positionList = positionService.getList(); +// //获取全部角色信息 +// List roleList = roleService.getList(); +// List models = JsonUtil.getJsonToList(list, UserAllModel.class); +// for (UserAllModel model : models) { +// //部门名称 +// OrganizeEntity deptEntity = departmentList.stream().filter(t -> t.getId().equals(model.getOrganizeId())).findFirst().orElse(new OrganizeEntity()); +// if (StringUtil.isNotEmpty(deptEntity.getFullName())) { +// model.setDepartment(deptEntity.getFullName()); +// model.setDepartmentId(deptEntity.getId()); +// } +// //组织名称 +// OrganizeEntity organizeEntity = departmentList.stream().filter(t -> t.getId().equals(String.valueOf(deptEntity.getParentId()))).findFirst().orElse(new OrganizeEntity()); +// if (organizeEntity != null) { +// model.setOrganizeId(organizeEntity.getId()); +// model.setOrganize(organizeEntity.getFullName()); +// } +// //岗位名称(多个) +// if (model.getPositionId() != null) { +// List positionName = new ArrayList<>(); +// for (String id : model.getPositionId().split(",")) { +// String name = positionList.stream().filter(t -> t.getId().equals(id)).findFirst().orElse(new PositionEntity()).getFullName(); +// if (!StringUtil.isEmpty(name)) { +// positionName.add(name); +// } +// } +// model.setPositionName(String.join(",", positionName)); +// } +// //角色名称(多个) +// if (model.getRoleId() != null) { +// List roleName = new ArrayList<>(); +// for (String id : model.getRoleId().split(",")) { +// String name = roleList.stream().filter(t -> t.getId().equals(id)).findFirst().orElse(new RoleEntity()).getFullName(); +// if (!StringUtil.isEmpty(name)) { +// roleName.add(name); +// } +// } +// model.setRoleName(String.join(",", roleName)); +// } +// //主管名称 +// String managerName = list.stream().filter(t -> t.getId().equals(model.getManagerId())).findFirst().orElse(new UserEntity()).getRealName(); +// if (StringUtil.isNotEmpty(managerName)) { +// model.setManagerName(managerName); +// } +// model.setHeadIcon(UploaderUtil.uploaderImg(model.getHeadIcon())); +// } +// String allUser = JsonUtil.getObjectToString(models); +// redisUtil.insert(cacheKeyUtil.getAllUser(), allUser, 300); +// return models; +// } + +// /** +// * 直接从数据库获取所有用户信息(不过滤冻结账号) +// * +// * @return +// */ +// @Override +// public List getDbUserAll() { +// List list = this.getList(); +// //获取全部部门信息 +// List departmentList = organizeService.getList(); +// //获取全部岗位信息 +// List positionList = positionService.getList(); +// //获取全部角色信息 +// List roleList = roleService.getList(); +// List models = JsonUtil.getJsonToList(list, UserAllModel.class); +// for (UserAllModel model : models) { +// //部门名称 +// OrganizeEntity organize = departmentList.stream().filter(t -> t.getId().equals(model.getOrganizeId())).findFirst().orElse(new OrganizeEntity()); +// if (StringUtil.isNotEmpty(organize.getFullName())) { +// model.setDepartment(organize.getFullName()); +// } +// //组织名称 +// String organizeName = departmentList.stream().filter(t -> t.getId().equals(String.valueOf(organize.getParentId()))).findFirst().orElse(new OrganizeEntity()).getFullName(); +// if (StringUtil.isNotEmpty(organizeName)) { +// model.setOrganize(organizeName); +// } +// //岗位名称(多个) +// if (model.getPositionId() != null) { +// List positionName = new ArrayList<>(); +// for (String id : model.getPositionId().split(",")) { +// String name = positionList.stream().filter(t -> t.getId().equals(id)).findFirst().orElse(new PositionEntity()).getFullName(); +// positionName.add(name); +// } +// model.setPositionName(String.join(",", positionName)); +// } +// //角色名称(多个) +// if (model.getRoleId() != null) { +// List roleName = new ArrayList<>(); +// for (String id : model.getRoleId().split(",")) { +// String name = roleList.stream().filter(t -> t.getId().equals(id)).findFirst().orElse(new RoleEntity()).getFullName(); +// roleName.add(name); +// } +// model.setRoleName(String.join(",", roleName)); +// } +// //主管名称 +// String managerName = list.stream().filter(t -> t.getId().equals(model.getManagerId())).findFirst().orElse(new UserEntity()).getRealName(); +// if (StringUtil.isNotEmpty(managerName)) { +// model.setManagerName(managerName); +// } +// model.setHeadIcon(UploaderUtil.uploaderImg(model.getHeadIcon())); +// } +// return models; +// } + + @Override + public UserEntity getUserEntity(String account) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserEntity::getAccount, account); + return this.baseMapper.selectOne(queryWrapper); + } + + @Override + public List getListId() { + return this.baseMapper.getListId(); + } + + @Override + public void update(UserEntity entity, String type) { + UpdateWrapper wrapper = new UpdateWrapper<>(); + if ("Position".equals(type)) { + wrapper.lambda().set(UserEntity::getPositionId, entity.getPositionId()); + } else { + wrapper.lambda().set(UserEntity::getRoleId, entity.getRoleId()); + } + wrapper.lambda().eq(UserEntity::getId, entity.getId()); + this.update(wrapper); + } + + @Override + public void updateLastTime(UserEntity entity, String type) { + UpdateWrapper wrapper = new UpdateWrapper<>(); + if ("Position".equals(type)) { + wrapper.lambda().set(UserEntity::getPositionId, entity.getPositionId()); + } else { + wrapper.lambda().set(UserEntity::getRoleId, entity.getRoleId()); + } + wrapper.lambda().set(UserEntity::getLastModifyTime, new Date()); + wrapper.lambda().set(UserEntity::getLastModifyUserId, entity.getLastModifyUserId()); + wrapper.lambda().eq(UserEntity::getId, entity.getId()); + this.update(wrapper); + } + + @Override + public boolean isSubordinate(String id, String managerId) { + int num = 0; + return recursionSubordinates(id, managerId, num); + } + + @Override + public DownloadVO exportExcel(String dataType, String selectKey, PaginationUser pagination) { + List entityList = new ArrayList<>(); + if ("0".equals(dataType)) { + entityList = getList(pagination, pagination.getOrganizeId(), false, true); + } else if ("1".equals(dataType)) { + entityList = getList(false); + } + List modeList = new ArrayList<>(); + List organizeList = null; + // 长度超过300代表是全部数据 + if (entityList.size() > 300) { + // 大约100则直接初始化给100 + organizeList = new ArrayList<>(100); + List organizeId = entityList.stream().map(t -> t.getOrganizeId()).collect(Collectors.toList()); + organizeList = organizeService.getOrganizeName(organizeId); + } + for (UserEntity entity : entityList) { + UserExportVO model = new UserExportVO(); + model.setAccount(entity.getAccount()); + model.setRealName(entity.getRealName()); + // 组织 + // 定义多组织集合 + StringJoiner stringJoiner = new StringJoiner(";"); + // 获取该用户的所有组织关系 + List allOrgRelationByUserId = userRelationService.getAllOrgRelationByUserId(entity.getId()); + Map orgIdNameMaps = organizeService.getInfoList(); + for (UserRelationEntity userRelationEntity : allOrgRelationByUserId) { + String id = userRelationEntity.getObjectId(); + OrganizeEntity organize = null; + // 得到该组织信息 + if (organizeList != null) { + organize = organizeList.stream().filter(t -> id.equals(t.getId())).findFirst().orElse(null); + } else { + organize = organizeService.getInfo(id); + } + // 得到父级id树 + if (organize != null && StringUtil.isNotEmpty(organize.getOrganizeIdTree())) { + stringJoiner.add(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, organize.getOrganizeIdTree(), "/")); + } + } + model.setOrganizeId(stringJoiner.toString()); + // 主管 + UserEntity info = getInfo(entity.getManagerId()); + if (Objects.nonNull(info) && StringUtil.isNotEmpty(info.getRealName()) && StringUtil.isNotEmpty(info.getAccount())) { + model.setManagerId(info.getRealName() + "/" + info.getAccount()); + } + // 岗位 + List listByObjectType = userRelationService.getListByObjectType(entity.getId(), PermissionConst.POSITION); + StringBuffer positionName = new StringBuffer(); + for (UserRelationEntity userRelationEntity : listByObjectType) { + if (StringUtil.isNotEmpty(userRelationEntity.getObjectId())) { + PositionEntity positionEntity = positionService.getInfo(userRelationEntity.getObjectId()); + if (Objects.nonNull(positionEntity)) { + positionName.append("," + positionEntity.getFullName() + "/" + positionEntity.getEnCode()); + } + } + } + // 判断岗位是否需要导出 + if (positionName.length() > 0) { + model.setPositionId(positionName.toString().replaceFirst(",", "")); + } + + // 角色 + List listByObjectType1 = userRelationService.getListByObjectType(entity.getId(), PermissionConst.ROLE); + StringBuffer roleName = new StringBuffer(); + for (UserRelationEntity userRelationEntity : listByObjectType1) { + if (StringUtil.isNotEmpty(userRelationEntity.getObjectId())) { + RoleEntity roleEntity = roleService.getInfo(userRelationEntity.getObjectId()); + if (Objects.nonNull(roleEntity)) { + roleName.append("," + roleEntity.getFullName()); + } + } + } + if (roleName.length() > 0) { + model.setRoleId(roleName.toString().replaceFirst(",", "")); + } + + model.setDescription(entity.getDescription()); + // 性别 + if (entity.getGender() != null) { + if (entity.getGender() == 1) { + model.setGender("男"); + } else if (entity.getGender() == 2) { + model.setGender("女"); + } else if (entity.getGender() == 3) { + model.setGender("保密"); + } + } + // 性别 + DictionaryDataEntity dictionaryDataEntity = dictionaryDataService.getInfo(entity.getNation()); + if (Objects.nonNull(dictionaryDataEntity)) { + model.setNation(dictionaryDataEntity.getFullName()); + } + model.setNativePlace(entity.getNativePlace()); + // 证件类型 + DictionaryDataEntity dictionaryDataEntity1 = dictionaryDataService.getInfo(entity.getCertificatesType()); + if (Objects.nonNull(dictionaryDataEntity1)) { + model.setCertificatesType(dictionaryDataEntity1.getFullName()); + } + model.setCertificatesNumber(entity.getCertificatesNumber()); + // 文化程度 + DictionaryDataEntity dictionaryDataEntity2 = dictionaryDataService.getInfo(entity.getEducation()); + if (Objects.nonNull(dictionaryDataEntity2)) { + model.setEducation(dictionaryDataEntity2.getFullName()); + } + // 生日 + SimpleDateFormat sf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + if (entity.getBirthday() != null) { + String birthday = sf1.format(entity.getBirthday()); + model.setBirthday(birthday); + } + model.setTelePhone(entity.getTelePhone()); + model.setLandline(entity.getLandline()); + model.setMobilePhone(entity.getMobilePhone()); + model.setEmail(entity.getEmail()); + model.setUrgentContacts(entity.getUrgentContacts()); + model.setUrgentTelePhone(entity.getUrgentTelePhone()); + model.setPostalAddress(entity.getPostalAddress()); + model.setSortCode(entity.getSortCode() == null ? 0 : entity.getSortCode()); + // 设置状态 + if (entity.getEnabledMark() == null) { + model.setEnabledMark("锁定"); + } else { + if (entity.getEnabledMark() == 0) { + model.setEnabledMark("禁用"); + } else if (entity.getEnabledMark() == 1) { + model.setEnabledMark("正常"); + } else { + model.setEnabledMark("锁定"); + } + } + // 入职时间 + if (entity.getEntryDate() != null) { + String entryDate = sf1.format(entity.getEntryDate()); + model.setEntryDate(entryDate); + } + modeList.add(model); + } + return exportUtil(selectKey, "用户信息", modeList); + } + + private DownloadVO exportUtil(String selectKey, String explain, List modeList) { + List list = JsonUtil.listToJsonField(JsonUtil.getJsonToList(modeList, UserExportVO.class)); + List entitys = new ArrayList<>(); + String[] splitData = selectKey.split(","); + if (splitData.length > 0) { + for (int i = 0; i < splitData.length; i++) { + if (splitData[i].equals("account")) { + entitys.add(new ExcelExportEntity("账号", "account")); + } + if (splitData[i].equals("realName")) { + entitys.add(new ExcelExportEntity("姓名", "realName")); + } + if (splitData[i].equals("gender")) { + entitys.add(new ExcelExportEntity("性别", "gender")); + } + if (splitData[i].equals("email")) { + entitys.add(new ExcelExportEntity("电子邮箱", "email")); + } + if (splitData[i].equals("organizeId")) { + entitys.add(new ExcelExportEntity("所属组织", "organizeId")); + } + if (splitData[i].equals("managerId")) { + entitys.add(new ExcelExportEntity("直属主管", "managerId")); + } + if (splitData[i].equals("positionId")) { + entitys.add(new ExcelExportEntity("岗位", "positionId")); + } + if (splitData[i].equals("roleId")) { + entitys.add(new ExcelExportEntity("角色", "roleId")); + } + if (splitData[i].equals("sortCode")) { + entitys.add(new ExcelExportEntity("排序", "sortCode")); + } + if (splitData[i].equals("enabledMark")) { + entitys.add(new ExcelExportEntity("状态", "enabledMark")); + } + if (splitData[i].equals("description")) { + entitys.add(new ExcelExportEntity("说明", "description", 25)); + } + if (splitData[i].equals("nation")) { + entitys.add(new ExcelExportEntity("民族", "nation")); + } + if (splitData[i].equals("nativePlace")) { + entitys.add(new ExcelExportEntity("籍贯", "nativePlace")); + } + if (splitData[i].equals("entryDate")) { + entitys.add(new ExcelExportEntity("入职时间", "entryDate")); + } + if (splitData[i].equals("certificatesType")) { + entitys.add(new ExcelExportEntity("证件类型", "certificatesType")); + } + if (splitData[i].equals("certificatesNumber")) { + entitys.add(new ExcelExportEntity("证件号码", "certificatesNumber")); + } + if (splitData[i].equals("education")) { + entitys.add(new ExcelExportEntity("文化程度", "education")); + } + if (splitData[i].equals("birthday")) { + entitys.add(new ExcelExportEntity("出生年月", "birthday")); + } + if (splitData[i].equals("telePhone")) { + entitys.add(new ExcelExportEntity("办公电话", "telePhone")); + } + if (splitData[i].equals("landline")) { + entitys.add(new ExcelExportEntity("办公座机", "landline")); + } + if (splitData[i].equals("mobilePhone")) { + entitys.add(new ExcelExportEntity("手机号码", "mobilePhone")); + } + if (splitData[i].equals("urgentContacts")) { + entitys.add(new ExcelExportEntity("紧急联系", "urgentContacts")); + } + if (splitData[i].equals("urgentTelePhone")) { + entitys.add(new ExcelExportEntity("紧急电话", "urgentTelePhone")); + } + if (splitData[i].equals("postalAddress")) { + entitys.add(new ExcelExportEntity("通讯地址", "postalAddress", 25)); + } + } + } + ExportParams exportParams = new ExportParams(null, "用户信息"); + exportParams.setType(ExcelType.XSSF); + + DownloadVO vo = DownloadVO.builder().build(); + try { + @Cleanup Workbook workbook = new HSSFWorkbook(); + if (entitys.size() > 0) { + workbook = ExcelExportUtil.exportExcel(exportParams, entitys, list); + } + String name = explain + DateUtil.dateNow("yyyyMMdd") + "_" + RandomUtil.uuId() + ".xlsx"; + MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, name); + String temporaryFilePath = configValueUtil.getTemporaryFilePath(); + FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, name); + vo.setName(fileInfo.getFilename()); + vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + name); + } catch (Exception e) { + log.error("用户信息导出Excel错误:" + e.getMessage()); + } + return vo; + } + + @Override + public Map importPreview(List personList) { + List> dataRow = new ArrayList<>(); + List> columns = new ArrayList<>(); + for (int i = 0; i < personList.size(); i++) { + Map dataRowMap = new HashMap<>(); + UserExportVO model = personList.get(i); + dataRowMap.put("account", model.getAccount()); + dataRowMap.put("realName", model.getRealName()); + dataRowMap.put("organizeId", model.getOrganizeId()); + dataRowMap.put("managerId", model.getManagerId()); + dataRowMap.put("positionId", model.getPositionId()); + dataRowMap.put("roleId", model.getRoleId()); + dataRowMap.put("description", model.getDescription()); + dataRowMap.put("gender", model.getGender()); + dataRowMap.put("nation", model.getNation()); + dataRowMap.put("nativePlace", model.getNativePlace()); + dataRowMap.put("certificatesType", model.getCertificatesType()); + dataRowMap.put("certificatesNumber", model.getCertificatesNumber()); + dataRowMap.put("education", model.getEducation()); + dataRowMap.put("birthday", model.getBirthday()); + dataRowMap.put("telePhone", model.getTelePhone()); + dataRowMap.put("landline", model.getLandline()); + dataRowMap.put("mobilePhone", model.getMobilePhone()); + dataRowMap.put("email", model.getEmail()); + dataRowMap.put("urgentContacts", model.getUrgentContacts()); + dataRowMap.put("urgentTelePhone", model.getUrgentTelePhone()); + dataRowMap.put("postalAddress", model.getPostalAddress()); + dataRowMap.put("sortCode", model.getSortCode()); + dataRowMap.put("enabledMark", model.getEnabledMark()); + dataRowMap.put("entryDate", model.getEntryDate()); + dataRow.add(dataRowMap); + } + for (int i = 1; i <= personList.size(); i++) { + Map columnsMap = new HashMap<>(); + columnsMap.put("AllowDBNull", true); + columnsMap.put("AutoIncrement", false); + columnsMap.put("AutoIncrementSeed", 0); + columnsMap.put("AutoIncrementStep", 1); + columnsMap.put("Caption", this.getColumns(i)); + columnsMap.put("ColumnMapping", 1); + columnsMap.put("ColumnName", this.getColumns(i)); + columnsMap.put("Container", null); + columnsMap.put("DataType", "System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"); + columnsMap.put("DateTimeMode", 3); + columnsMap.put("DefaultValue", null); + columnsMap.put("DesignMode", false); + columnsMap.put("Expression", ""); + columnsMap.put("ExtendedProperties", ""); + columnsMap.put("MaxLength", -1); + columnsMap.put("Namespace", ""); + columnsMap.put("Ordinal", 0); + columnsMap.put("Prefix", ""); + columnsMap.put("ReadOnly", false); + columnsMap.put("Site", null); + columnsMap.put("Table", personList); + columnsMap.put("Unique", false); + columns.add(columnsMap); + } + Map map = new HashMap<>(); + map.put("dataRow", dataRow); + map.put("columns", columns); + return map; + } + + @Override + public UserImportVO importData(List dataList) { + List importModels = new ArrayList<>(16); + List exceptionList = new ArrayList<>(16); + // 得到民族集合 + List dataServiceList = dictionaryDataService.getList("b6cd65a763fa45eb9fe98e5057693e40"); + // 得到证件类型 + List dataServiceList1 = dictionaryDataService.getList("7866376d5f694d4d851c7164bd00ebfc"); + // 得到文化程度 + List dataServiceList2 = dictionaryDataService.getList("6a6d6fb541b742fbae7e8888528baa16"); + // 去除重复的account + Map collect = dataList.stream().filter(t -> StringUtil.isNotBlank(t.getAccount())).collect(Collectors.groupingBy(t -> t.getAccount(), Collectors.counting())); + List collect1 = collect.entrySet().stream().filter(entry -> entry.getValue() > 1).map(entry -> entry.getKey()).collect(Collectors.toList()); + for (String account : collect1) { + List collect2 = dataList.stream().filter(t -> account.equals(t.getAccount())).collect(Collectors.toList()); + dataList.removeAll(collect2); + exceptionList.addAll(collect2); + } + + for (UserExportVO exportVO : dataList) { + UserImportModel model = new UserImportModel(); + // 处理账号 + if (StringUtil.isNotEmpty(exportVO.getAccount())) { + UserEntity userByAccount = getUserByAccount(exportVO.getAccount()); + if (Objects.nonNull(userByAccount)) { + // 账号重复 + exceptionList.add(exportVO); + continue; + } + String regex = "^[a-z0-9A-Z\u4e00-\u9fa5]+$"; + if (!exportVO.getAccount().matches(regex)) { + // 账号重复 + exceptionList.add(exportVO); + continue; + } + model.setAccount(exportVO.getAccount()); + } else { + // 账号为空 + exceptionList.add(exportVO); + continue; + } + // 处理姓名 + if (StringUtil.isEmpty(exportVO.getRealName())) { + // 姓名为空 + exceptionList.add(exportVO); + continue; + } + model.setRealName(exportVO.getRealName()); + // 处理组织id + String organizeId = exportVO.getOrganizeId(); + if (StringUtil.isEmpty(organizeId)) { + // 判断如果所属组织为空,则为错误数据 + exceptionList.add(exportVO); + continue; + } + // 处理多级组织 + String[] organizeIds = organizeId.split(";"); + // 储存字段 + StringBuffer stringBuffer = new StringBuffer(); + // 处理单个组织 + for (String id : organizeIds) { + String[] split = id.split("/"); + // 定义一个标志,当前部门如果不存在则存到错误集合中 + boolean isOk = false; + if (split.length > 0) { + // 从父级一级一级取 + OrganizeEntity organizeEntity = null; + List infoByFullName = organizeService.getListByFullName(split[0]); + for (OrganizeEntity entity : infoByFullName) { + if ("-1".equals(entity.getParentId())) { + organizeEntity = entity; + break; + } + } + // 从第2个开始遍历 + if (split.length > 1) { + for (int i = 1; i < split.length; i++) { + List infoByFullName1 = organizeService.getListByFullName(split[i]); + // 如果部门不存在则无法导入成功 + if (infoByFullName1.size() < 1) { + isOk = true; + break; + } + for (OrganizeEntity entity : infoByFullName1) { + if (organizeEntity != null && organizeEntity.getId().equals(entity.getParentId())) { + organizeEntity = entity; + break; + } + } + } + } + if (!isOk && Objects.nonNull(organizeEntity)) { + if (model != null) { + stringBuffer.append("," + organizeEntity.getId()); + } + } + } else { + // 判断如果所属组织不存在,则为错误数据 + exceptionList.add(exportVO); + continue; + } + } + if (stringBuffer.length() < 1) { + exceptionList.add(exportVO); + continue; + } + model.setOrganizeId(stringBuffer.toString().replaceFirst(",", "")); + // 处理主管id + String managerId = exportVO.getManagerId(); + if (StringUtil.isNotEmpty(managerId)) { + String[] split1 = managerId.split("/"); + if (split1.length > 0) { + String account = split1[split1.length - 1]; + UserEntity entity = getUserByAccount(account); + if (Objects.nonNull(entity) && StringUtil.isNotEmpty(entity.getAccount())) { + model.setManagerId(entity.getId()); + } + } + } + // 处理岗位id + String positionId = exportVO.getPositionId(); + if (StringUtil.isNotEmpty(positionId)) { + StringBuilder positionIdBuffer = new StringBuilder(); + String[] positionIds = positionId.split(","); + for (String id : positionIds) { + // 岗位名称+编码 + String[] positionName = id.split("/"); + // 无编码无名称代表是无用数据,不予保存 + if (positionName != null && positionName.length > 1) { + // 通过名称和编码获取岗位信息 + List positionEntityList = positionService.getListByFullName(positionName[0], positionName[1]); + if (positionEntityList != null && positionEntityList.size() > 0) { + PositionEntity positionEntity = positionEntityList.get(0); + String[] split = model.getOrganizeId().split(","); + boolean flag = false; + for (String orgId : split) { + List list = positionService.getListByOrganizeId(Collections.singletonList(orgId)); + if (list.stream().anyMatch(t -> t.getId().equals(positionEntity.getId()))) { + flag = true; + break; + } + } + if (flag) { + positionIdBuffer.append("," + positionEntity.getId()); + } + } + } else { + continue; + } + } + model.setPositionId(positionIdBuffer.toString().replaceFirst(",", "")); + } + // 处理角色id + if (StringUtil.isNotEmpty(exportVO.getRoleId())) { + String[] roleNames = exportVO.getRoleId().split(","); + StringBuilder roleId = new StringBuilder(); + for (String roleName : roleNames) { + RoleEntity roleEntity = roleService.getInfoByFullName(roleName); + // 角色不是全局的情况下 需要验证是否跟组织挂钩 + String[] split = model.getOrganizeId().split(","); + boolean flag = false; + for (String orgId : split) { + if (organizeRelationService.existByRoleIdAndOrgId(roleEntity.getId(), orgId)) { + flag = true; + break; + } + } + if (Objects.nonNull(roleEntity) && (roleEntity.getGlobalMark() == 1 || flag)) { + roleId.append("," + roleEntity.getId()); + } + } + model.setRoleId(roleId.toString().replaceFirst(",", "")); + } + model.setDescription(exportVO.getDescription()); + // 处理性别 + if (StringUtil.isEmpty(exportVO.getGender())) { + // 性别为必填项,不给默认为错误,不给默认值 + exceptionList.add(exportVO); + continue; + } + if ("男".equals(exportVO.getGender())) { + model.setGender(1); + } else if ("女".equals(exportVO.getGender())) { + model.setGender(2); + } else { + model.setGender(3); + } + // 处理民族 + if (StringUtil.isNotEmpty(exportVO.getNation())) { + // 拿到民族的数据 + DictionaryDataEntity dataEntity = dataServiceList.stream().filter(t -> exportVO.getNation().equals(t.getFullName())).findFirst().orElse(null); + model.setNation(dataEntity != null ? dataEntity.getFullName() : null); + } + model.setNativePlace(exportVO.getNativePlace()); + // 处理证件类型 + if (StringUtil.isNotEmpty(exportVO.getCertificatesType())) { + DictionaryDataEntity dataEntity = dataServiceList1.stream().filter(t -> exportVO.getCertificatesType().equals(t.getFullName())).findFirst().orElse(null); + model.setNation(dataEntity != null ? dataEntity.getFullName() : null); + } + model.setCertificatesNumber(exportVO.getCertificatesNumber()); + // 处理文化程度 + if (StringUtil.isNotEmpty(exportVO.getEducation())) { + DictionaryDataEntity dataEntity = dataServiceList2.stream().filter(t -> exportVO.getEducation().equals(t.getFullName())).findFirst().orElse(null); + model.setNation(dataEntity != null ? dataEntity.getFullName() : null); + } + // 处理生日 + if (StringUtil.isNotEmpty(exportVO.getBirthday())) { + Date date = DateUtil.stringToDate(exportVO.getBirthday()); + model.setBirthday(date); + } + model.setTelePhone(exportVO.getTelePhone()); + model.setLandline(exportVO.getLandline()); + model.setEmail(exportVO.getEmail()); + model.setUrgentContacts(exportVO.getUrgentContacts()); + model.setUrgentTelePhone(exportVO.getUrgentTelePhone()); + model.setPostalAddress(exportVO.getPostalAddress()); + model.setSortCode(exportVO.getSortCode() == null ? 0 : exportVO.getSortCode()); + // 入职时间 + if (StringUtil.isNotEmpty(exportVO.getEntryDate())) { + Date date = DateUtil.stringToDate(exportVO.getEntryDate()); + model.setEntryDate(date); + } + // 设置状态 + if ("禁用".equals(exportVO.getEnabledMark())) { + model.setEnabledMark(0); + } else if ("正常".equals(exportVO.getEnabledMark())) { + model.setEnabledMark(1); + } else { + model.setEnabledMark(2); + } + importModels.add(model); + } + + List entitys = JsonUtil.getJsonToList(importModels, UserEntity.class); + //记录成功了几条 + int sum = 0; + //记录第几条失败 + int num = 0; + for (UserEntity entity : entitys) { + entity.setHeadIcon("001.png"); + entity.setPassword("4a7d1ed414474e4033ac29ccb8653d9b"); + try { + create(entity); + sum++; + } catch (Exception e) { + UserExportVO exportVO = dataList.stream().filter(t -> entity.getAccount().equals(t.getAccount())).findFirst().orElse(null); + exceptionList.add(exportVO); + log.error("导入第" + (num + 1) + "条数据失败"); + } + } + UserImportVO vo = new UserImportVO(); + vo.setSnum(sum); + if (exceptionList.size() > 0) { + vo.setResultType(1); + vo.setFailResult(JsonUtil.getJsonToList(exceptionList, UserExportExceptionVO.class)); + vo.setFnum(exceptionList.size()); + return vo; + } else { + vo.setResultType(0); + return vo; + } + } + + @Override + public void getOrganizeIdTree(String organizeId, StringBuffer organizeParentIdList) { + OrganizeEntity entity = organizeService.getInfo(organizeId); + if (Objects.nonNull(entity) && StringUtil.isNotEmpty(entity.getParentId())) { + // 记录id + organizeParentIdList.append(organizeId + ","); + getOrganizeIdTree(entity.getParentId(), organizeParentIdList); + } + } + + @Override + public DownloadVO exportExceptionData(List dataList) { + DownloadVO vo = exportUtil("account,realName,gender,email,organizeId,managerId,positionId,roleId,sortCode,enabledMark,description,nation,nativePlace,entryDate,certificatesType,certificatesNumber,education,birthday,telePhone,landline,mobilePhone,urgentContacts,urgentTelePhone,postalAddress" + , "错误报告", dataList); + return vo; + } + + @Override + public List getUserName(List id, Pagination pagination) { + List list = new ArrayList<>(); + id.removeAll(Collections.singleton(null)); + if (id.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (!StringUtil.isEmpty(pagination.getKeyword())) { + queryWrapper.lambda().and( + t -> t.like(UserEntity::getRealName, pagination.getKeyword()) + .or().like(UserEntity::getAccount, pagination.getKeyword()) + ); + } + queryWrapper.lambda().in(UserEntity::getId, id); + queryWrapper.lambda().ne(UserEntity::getEnabledMark, 0); + queryWrapper.lambda().select(UserEntity::getId, UserEntity::getRealName, UserEntity::getAccount, + UserEntity::getGender, UserEntity::getHeadIcon, UserEntity::getMobilePhone); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage iPage = this.page(page, queryWrapper); + return pagination.setData(iPage.getRecords(), iPage.getTotal()); + } + return pagination.setData(list, list.size()); + } + + @Override + public List getUserNames(List id, Pagination pagination, Boolean flag, Boolean enabledMark) { + List list = new ArrayList<>(); + id.removeAll(Collections.singleton(null)); + if (id.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (!StringUtil.isEmpty(pagination.getKeyword())) { + queryWrapper.lambda().and( + t -> t.like(UserEntity::getRealName, pagination.getKeyword()) + .or().like(UserEntity::getAccount, pagination.getKeyword()) + ); + } + queryWrapper.lambda().in(UserEntity::getId, id); + if (flag) { + queryWrapper.lambda().ne(UserEntity::getId, userProvider.get().getUserId()); + } + if (enabledMark) { + queryWrapper.lambda().ne(UserEntity::getEnabledMark, 0); + } + queryWrapper.lambda().orderByAsc(UserEntity::getSortCode).orderByDesc(UserEntity::getCreatorTime); +// queryWrapper.lambda().select(UserEntity::getId, UserEntity::getRealName, UserEntity::getAccount, +// UserEntity::getGender, UserEntity::getMobilePhone); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage iPage = this.page(page, queryWrapper); + return pagination.setData(iPage.getRecords(), iPage.getTotal()); + } + return pagination.setData(list, list.size()); + } + + @Override + public List getListByRoleId(String roleId) { + List list = new ArrayList<>(); + // 根据roleId获取,用户与组织的关联对象集合 + userRelationService.getListByRoleId(roleId).forEach(u -> { + list.add(this.getInfo(u.getUserId())); + }); + return list; + } + + @Override + public List getListByRoleIds(List roleIds) { + QueryWrapper query = new QueryWrapper<>(); + query.lambda().eq(UserRelationEntity::getObjectType, "role").in(UserRelationEntity::getObjectId, roleIds); + List list = userRelationService.list(query); + if(CollectionUtil.isNotEmpty(list)){ + List userIds = list.stream().map(UserRelationEntity::getUserId).collect(Collectors.toList()); + return listByIds(userIds); + } + return new ArrayList<>(); + } + + @Override + public List getFullNameByIds(List ids) { + List list = new ArrayList<>(); + if (ids != null) { + ids.forEach(selectedId -> { + if (StringUtil.isNotEmpty(selectedId)) { + String[] split = selectedId.split("--"); + // 截取type后获取详情 + if (split.length > 1) { + String type = split[1]; + if (jnpf.constant.PermissionConst.COMPANY.equalsIgnoreCase(type) || jnpf.constant.PermissionConst.DEPARTMENT.equalsIgnoreCase(type)) { + OrganizeEntity organizeEntity = organizeService.getInfo(split[0]); + if (organizeEntity != null) { + list.add(organizeEntity.getFullName()); + } + } else if (jnpf.constant.PermissionConst.ROLE.equalsIgnoreCase(type)) { + RoleEntity roleEntity = roleService.getInfo(split[0]); + if (roleEntity != null) { + list.add(roleEntity.getFullName()); + } + } else if (jnpf.constant.PermissionConst.POSITION.equalsIgnoreCase(type)) { + PositionEntity positionEntity = positionService.getInfo(split[0]); + if (positionEntity != null) { + list.add(positionEntity.getFullName()); + } + } else if (jnpf.constant.PermissionConst.GROUP.equalsIgnoreCase(type)) { + GroupEntity groupEntity = groupService.getInfo(split[0]); + if (groupEntity != null) { + list.add(groupEntity.getFullName()); + } + } else if ("user".equalsIgnoreCase(type)) { + UserEntity userEntity = this.getInfo(split[0]); + if (userEntity != null) { + list.add(userEntity.getRealName()); + } + } + } else { + UserEntity userEntity = this.getInfo(split[0]); + if (userEntity != null) { + list.add(userEntity.getRealName()); + } + } + } + }); + } + return list; + } + + @Override + public List selectedByIds(List ids) { + List list = new ArrayList<>(); + if (ids != null) { + ids.forEach(selectedId -> { + if (StringUtil.isNotEmpty(selectedId)) { + // 判断是否为系统参数 + if (JnpfConst.SYSTEM_PARAM.containsKey(selectedId)) { + UserIdListVo vo = new UserIdListVo(); + vo.setId(selectedId); + vo.setFullName(JnpfConst.SYSTEM_PARAM.get(selectedId)); + } + String[] split = selectedId.split("--"); + // 截取type后获取详情 + if (split.length > 1) { + String type = split[1]; + if (jnpf.constant.PermissionConst.COMPANY.equalsIgnoreCase(type) || jnpf.constant.PermissionConst.DEPARTMENT.equalsIgnoreCase(type)) { + OrganizeEntity organizeEntity = organizeService.getInfo(split[0]); + if (organizeEntity != null) { + UserIdListVo vo = JsonUtil.getJsonToBean(organizeEntity, UserIdListVo.class); + if ("department".equals(organizeEntity.getCategory())) { + vo.setIcon("icon-ym icon-ym-tree-department1"); + } else if ("company".equals(organizeEntity.getCategory())) { + vo.setIcon("icon-ym icon-ym-tree-organization3"); + } + vo.setOrganize(organizeService.getFullNameByOrgIdTree(organizeEntity.getOrganizeIdTree(), "/")); + vo.setOrganizeIds(organizeService.getOrgIdTree(organizeEntity)); + vo.setType(organizeEntity.getCategory()); + list.add(vo); + } + } else if (jnpf.constant.PermissionConst.ROLE.equalsIgnoreCase(type)) { + RoleEntity roleEntity = roleService.getInfo(split[0]); + if (roleEntity != null) { + UserIdListVo vo = JsonUtil.getJsonToBean(roleEntity, UserIdListVo.class); + // 获取角色的所属组织 + List relationListByRoleId = organizeRelationService.getRelationListByRoleId(vo.getId()); + StringJoiner orgName = new StringJoiner(","); + relationListByRoleId.forEach(organizeRelationEntity -> { + String organizeId = organizeRelationEntity.getOrganizeId(); + OrganizeEntity entity = organizeService.getInfo(organizeId); + if (entity != null) { + String fullNameByOrgIdTree = organizeService.getFullNameByOrgIdTree(entity.getOrganizeIdTree(), "/"); + orgName.add(fullNameByOrgIdTree); + } + }); + vo.setOrganize(orgName.toString()); + vo.setType("role"); + vo.setIcon("icon-ym icon-ym-generator-role"); + list.add(vo); + } + } else if (jnpf.constant.PermissionConst.POSITION.equalsIgnoreCase(type)) { + PositionEntity positionEntity = positionService.getInfo(split[0]); + if (positionEntity != null) { + UserIdListVo vo = JsonUtil.getJsonToBean(positionEntity, UserIdListVo.class); + OrganizeEntity info = organizeService.getInfo(positionEntity.getOrganizeId()); + if (info != null) { + vo.setOrganize(organizeService.getFullNameByOrgIdTree(info.getOrganizeIdTree(), "/")); + } + vo.setType("position"); + vo.setIcon("icon-ym icon-ym-tree-position1"); + list.add(vo); + } + } else if (jnpf.constant.PermissionConst.GROUP.equalsIgnoreCase(type)) { + GroupEntity groupEntity = groupService.getInfo(split[0]); + if (groupEntity != null) { + UserIdListVo vo = JsonUtil.getJsonToBean(groupEntity, UserIdListVo.class); + vo.setIcon("icon-ym icon-ym-generator-group1"); + vo.setType("group"); + list.add(vo); + } + } else if ("user".equalsIgnoreCase(type)) { + UserEntity userEntity = this.getInfo(split[0]); + if (userEntity != null) { + UserIdListVo vo = JsonUtil.getJsonToBean(userEntity, UserIdListVo.class); + List listByObjectType = userRelationService.getListByObjectType(userEntity.getId(), jnpf.constant.PermissionConst.ORGANIZE); + StringJoiner orgName = new StringJoiner(","); + listByObjectType.forEach(userRelationEntity -> { + OrganizeEntity info = organizeService.getInfo(userRelationEntity.getObjectId()); + if (info != null) { + String fullNameByOrgIdTree = organizeService.getFullNameByOrgIdTree(info.getOrganizeIdTree(), "/"); + orgName.add(fullNameByOrgIdTree); + } + }); + vo.setOrganize(orgName.toString()); + vo.setType("user"); + vo.setHeadIcon(UploaderUtil.uploaderImg(vo.getHeadIcon())); + vo.setFullName(vo.getRealName() + "/" + vo.getAccount()); + list.add(vo); + } + } else { + UserIdListVo vo = new UserIdListVo(); + vo.setId(split[0]); + vo.setFullName(JnpfConst.SYSTEM_PARAM.get(selectedId)); + vo.setType(split[1]); + list.add(vo); + } + } else { + UserEntity userEntity = this.getInfo(split[0]); + if (userEntity != null) { + UserIdListVo vo = JsonUtil.getJsonToBean(userEntity, UserIdListVo.class); + List listByObjectType = userRelationService.getListByObjectType(userEntity.getId(), jnpf.constant.PermissionConst.ORGANIZE); + StringJoiner orgName = new StringJoiner(","); + listByObjectType.forEach(userRelationEntity -> { + OrganizeEntity info = organizeService.getInfo(userRelationEntity.getObjectId()); + if (info != null) { + String fullNameByOrgIdTree = organizeService.getFullNameByOrgIdTree(info.getOrganizeIdTree(), "/"); + orgName.add(fullNameByOrgIdTree); + } + }); + vo.setOrganize(orgName.toString()); + vo.setType("user"); + vo.setHeadIcon(UploaderUtil.uploaderImg(vo.getHeadIcon())); + vo.setFullName(vo.getRealName() + "/" + vo.getAccount()); + list.add(vo); + } + } + } + }); + } + return list; + } + + @Override + public Boolean delCurRoleUser(List objectIdAll) { + // 判断角色下面的人 + List member = permissionGroupService.list(objectIdAll) + .stream().filter(t -> StringUtil.isNotEmpty(t.getPermissionMember())).map(PermissionGroupEntity::getPermissionMember).collect(Collectors.toList()); + List userIdList = this.getUserIdList(member, null); + delCurUser(userIdList.stream().toArray(String[]::new)); + return true; + } + + @Override + public Boolean delCurUser(String... userIds) { + List list = Arrays.asList(userIds); + // 发送消息 + String[] token = OnlineUserProvider.getOnlineUserList().stream() + .filter(t -> list.contains(t.getUserId())) + .map(OnlineUserModel::getToken).toArray(String[]::new); + List tokens = Arrays.stream(token).map(t -> t.contains(AuthConsts.TOKEN_PREFIX) ? t : TOKEN_PREFIX + " " + t).collect(Collectors.toList()); + //清除websocket登录状态 + List users = OnlineUserProvider.getOnlineUserList().stream().filter(t -> tokens.contains(t.getToken())).collect(Collectors.toList()); + if (!ObjectUtils.isEmpty(users)) { + for (OnlineUserModel user : users) { + JSONObject obj = new JSONObject(); + obj.put("method", "logout"); + obj.put("msg", "权限已变更,请重新登录!"); + if(user != null) { + OnlineUserProvider.sendMessage(user, obj); + } + //先移除对象, 并推送下线信息, 避免网络原因导致就用户未断开 新用户连不上WebSocket + OnlineUserProvider.removeModel(user); + //通知所有在线,有用户离线 + for (OnlineUserModel item : OnlineUserProvider.getOnlineUserList().stream().filter(t -> !Objects.equals(user.getUserId(), t.getUserId()) && !Objects.equals(user.getTenantId(),t.getTenantId())).collect(Collectors.toList())) { + if (!item.getUserId().equals(user.getUserId())) { + JSONObject objs = new JSONObject(); + objs.put("method", "logout"); + //推送给前端 + OnlineUserProvider.sendMessage(item, objs); + } + } + } + } + list.forEach(UserProvider::logoutByUserId); + return true; + } + + @Override + public List getList(List orgIdList, String keyword) { + // 得到用户关系表 + List listByObjectId = userRelationService.getListByOrgId(orgIdList); + if (listByObjectId.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(UserEntity::getId, listByObjectId.stream().map(UserRelationEntity::getUserId).collect(Collectors.toList())).and( + t -> t.like(UserEntity::getRealName, keyword) + .or().like(UserEntity::getAccount, keyword) + ); + return this.list(queryWrapper); + } + + @Override + public List getUserIdList(List userIds, String type) { + Set allUserId = new HashSet<>(userIds); + String organizeId = UserProvider.getUser().getOrganizeId(); + List newUserIds = new ArrayList<>(userIds); + newUserIds.forEach(t -> { + String[] split = t.split(","); + for (String id : split) { + allUserId.add(id); + } + }); + userIds.forEach(userId -> { + // 处理系统参数 + if (JnpfConst.SYSTEM_PARAM.containsKey(userId)) { + if (JnpfConst.CURRENT_GRADE.equals(userId) || JnpfConst.CURRENT_GRADE_TYPE.equals(userId)) { + List organizeUserList = organizeAdministratorService.getOrganizeUserList(JnpfConst.CURRENT_ORG_SUB); + organizeUserList.forEach(t -> allUserId.add(t + "--" + jnpf.constant.PermissionConst.COMPANY)); + } else { + if (StringUtil.isNotEmpty(organizeId)) { + allUserId.add(organizeId + "--" + jnpf.constant.PermissionConst.COMPANY); + } + if (JnpfConst.CURRENT_ORG_SUB.equals(userId) || JnpfConst.CURRENT_ORG_SUB_TYPE.equals(userId)) { + List underOrganizations = organizeService.getUnderOrganizations(organizeId, true); + underOrganizations.add(organizeId); + underOrganizations.forEach(t -> allUserId.add(t + "--" + jnpf.constant.PermissionConst.COMPANY)); + } + } + } + }); + Set userRelationEntities = new LinkedHashSet<>(); + if (allUserId != null) { + allUserId.forEach(userId -> { +// if (StringUtil.isEmpty(type) || PermissionConst.USER.equals(type)) { + String[] split = userId.split("--"); + if (split.length > 1) { + String orgType = split[1]; + List listByObjectId = new ArrayList<>(16); + if (jnpf.constant.PermissionConst.COMPANY.equalsIgnoreCase(orgType) || jnpf.constant.PermissionConst.DEPARTMENT.equalsIgnoreCase(orgType)) { +// // 得到子组织Id +// List orgIds = organizeService.getUnderOrganizations(split[0], true); +// orgIds.add(split[0]); + List orgIds = new ArrayList<>(); + orgIds.add(split[0]); + listByObjectId = userRelationService.getListByOrgId(orgIds).stream().map(UserRelationEntity::getUserId).collect(Collectors.toList()); + } else if ("user".equalsIgnoreCase(orgType)) { + userRelationEntities.add(split[0]); + } else { + if (jnpf.constant.PermissionConst.ROLE.equalsIgnoreCase(orgType)) { + orgType = jnpf.constant.PermissionConst.ROLE; + } else if (jnpf.constant.PermissionConst.ORGANIZE.equalsIgnoreCase(orgType)) { + orgType = jnpf.constant.PermissionConst.ORGANIZE; + } else if (jnpf.constant.PermissionConst.POSITION.equalsIgnoreCase(orgType)) { + orgType = jnpf.constant.PermissionConst.POSITION; + } else if (jnpf.constant.PermissionConst.GROUP.equalsIgnoreCase(orgType)) { + orgType = jnpf.constant.PermissionConst.GROUP; + } + listByObjectId = userRelationService.getListByObjectId(split[0], orgType).stream().map(UserRelationEntity::getUserId).collect(Collectors.toList()); + } + userRelationEntities.addAll(listByObjectId); + } else if (split.length > 0) { + userRelationEntities.add(split[0]); + } +// } else { +// String[] split = userId.split("--"); +// if (split.length > 1) { +// String orgType = split[1]; +// if (PermissionConst.ROLE.equals(type)) { +// if (PermissionConst.COMPANY.equalsIgnoreCase(orgType) || PermissionConst.DEPARTMENT.equalsIgnoreCase(orgType)) { +// // 得到子组织Id +// List orgIds = organizeService.getUnderOrganizations(split[0], true); +// orgIds.add(split[0]); +// List roleIdsByOrgIds = organizeRelationService.getRelationListByOrganizeId(orgIds, type).stream().map(OrganizeRelationEntity::getObjectId).collect(Collectors.toList()); +// List roleIds = roleService.getListByIds(roleIdsByOrgIds, null, true).stream().map(RoleEntity::getId).collect(Collectors.toList()); +// userRelationEntities.addAll(roleIds); +// } +// } else if (PermissionConst.GROUP.equals(type)) { +// if (PermissionConst.COMPANY.equalsIgnoreCase(orgType) || PermissionConst.DEPARTMENT.equalsIgnoreCase(orgType)) { +// // 得到子组织Id +// List orgIds = organizeService.getUnderOrganizations(split[0], true); +// orgIds.add(split[0]); +// List roleIdsByOrgIds = organizeRelationService.getRelationListByOrganizeId(orgIds, type).stream().map(OrganizeRelationEntity::getObjectId).collect(Collectors.toList()); +// List roleIds = groupService.getListByIds(roleIdsByOrgIds, true).stream().map(GroupEntity::getId).collect(Collectors.toList()); +// userRelationEntities.addAll(roleIds); +// } +// } +// } +// } + }); + } + return new ArrayList<>(userRelationEntities); + } + + @Override + public List getObjList(List userIds, Pagination pagination, String type) { + List jsonToList = new ArrayList<>(); + List userRelationEntities = getUserIdList(userIds, type); + if (StringUtil.isEmpty(type) || jnpf.constant.PermissionConst.USER.equals(type)) { + // 得到所有的用户id关系 + List userEntityList = getUserNames(userRelationEntities, pagination, false, true); + jsonToList = JsonUtil.getJsonToList(userEntityList, UserIdListVo.class); + jsonToList.forEach(userIdListVo -> { + List listByObjectType = userRelationService.getListByObjectType(userIdListVo.getId(), jnpf.constant.PermissionConst.ORGANIZE); + StringJoiner orgName = new StringJoiner(","); + listByObjectType.forEach(userRelationEntity -> { + OrganizeEntity info = organizeService.getInfo(userRelationEntity.getObjectId()); + if (info != null) { + String fullNameByOrgIdTree = organizeService.getFullNameByOrgIdTree(info.getOrganizeIdTree(), "/"); + orgName.add(fullNameByOrgIdTree); + } + }); + userIdListVo.setOrganize(orgName.toString()); + userIdListVo.setType("user"); + + userIdListVo.setFullName(userIdListVo.getRealName() + "/" + userIdListVo.getAccount()); + userIdListVo.setHeadIcon(UploaderUtil.uploaderImg(userIdListVo.getHeadIcon())); + }); + } + else if (jnpf.constant.PermissionConst.ROLE.equals(type)) { + List roleEntityList = roleService.getListByIds(userRelationEntities, null, true); + jsonToList = JsonUtil.getJsonToList(roleEntityList, UserIdListVo.class); + jsonToList.forEach(userIdListVo -> { + userIdListVo.setType("role"); + userIdListVo.setIcon("icon-ym icon-ym-generator-group1"); + }); + } else if (jnpf.constant.PermissionConst.GROUP.equals(type)) { + List groupEntityList = groupService.getListByIds(userRelationEntities, true); + jsonToList = JsonUtil.getJsonToList(groupEntityList, UserIdListVo.class); + jsonToList.forEach(userIdListVo -> { + userIdListVo.setType("group"); + userIdListVo.setIcon("icon-ym icon-ym-generator-group1"); + }); + } + return jsonToList; + } + + @Override + public List getListByAuthorize(String organizeId, jnpf.base.Page page) { + List jsonToList = new ArrayList<>(16); + List collect0 = organizeAdministratorService.getListByAuthorize().stream().map(OrganizeEntity::getId).collect(Collectors.toList()); + // 有权限的组织 + Map orgMaps = organizeService.getOrganizeName(collect0, null, true); + Map orgIdNameMaps = organizeService.getInfoList(); + //判断是否搜索关键字 + if (StringUtil.isNotEmpty(page.getKeyword())) { + //通过关键字查询 + List list = getList(new ArrayList<>(orgMaps.keySet()), page.getKeyword()); + //遍历用户给要返回的值插入值 + for (UserEntity entity : list) { + UserByRoleVO vo = new UserByRoleVO(); + vo.setHeadIcon(UploaderUtil.uploaderImg(entity.getHeadIcon())); + vo.setId(entity.getId()); + vo.setFullName(entity.getRealName() + "/" + entity.getAccount()); + vo.setEnabledMark(entity.getEnabledMark()); + vo.setIsLeaf(true); + vo.setHasChildren(false); + vo.setIcon("icon-ym icon-ym-tree-user2"); + vo.setType("user"); + vo.setGender(entity.getGender()); + List listByUserId = userRelationService.getListByUserId(entity.getId()).stream().filter(t -> t != null && PermissionConst.ORGANIZE.equals(t.getObjectType())).collect(Collectors.toList()); + StringBuilder stringBuilder = new StringBuilder(); + listByUserId.forEach(t -> { + OrganizeEntity organizeEntity = orgMaps.get(t.getObjectId()); + if (organizeEntity != null) { + String fullNameByOrgIdTree = organizeService.getFullNameByOrgIdTree(orgIdNameMaps, organizeEntity.getOrganizeIdTree(), "/"); + if (StringUtil.isNotEmpty(fullNameByOrgIdTree)) { + stringBuilder.append("," + fullNameByOrgIdTree); + } + } + }); + if (stringBuilder.length() > 0) { + vo.setOrganize(stringBuilder.toString().replaceFirst(",", "")); + } + jsonToList.add(vo); + } + return jsonToList; + } + //获取所有组织 + List collect = new ArrayList<>(orgMaps.values()); + //判断时候传入组织id + //如果传入组织id,则取出对应的子集 + if (!"0".equals(organizeId)) { + //通过组织查询部门及人员 + OrganizeEntity organizeEntity = orgMaps.get(organizeId); + if (organizeEntity != null) { + // 取出子组织 + List collect1 = collect.stream().filter(t -> !t.getId().equals(organizeEntity.getId()) && t.getOrganizeIdTree().contains(organizeEntity.getId())).collect(Collectors.toList()); + // 判断组织关系中是否有子部门id + List organizeEntities = new ArrayList<>(); + for (OrganizeEntity entity : collect1) { + OrganizeEntity organizeEntity1 = orgMaps.get(entity.getId()); + if (organizeEntity1 != null) { + organizeEntities.add(organizeEntity1); + } + } + // 得到子集的子集 + List collect2 = collect.stream().filter(t -> t.getOrganizeIdTree().contains(organizeId)).collect(Collectors.toList()); + // 移除掉上级不是同一个的 + List collect3 = new ArrayList<>(); + collect2.forEach(t -> { + organizeEntities.forEach(oe -> { + if (!oe.getId().equals(t.getId()) && t.getOrganizeIdTree().contains(oe.getId())) { + collect3.add(t); + } + }); + }); + organizeEntities.removeAll(collect3); + + //取出组织下的人员 + List entityList = getListByOrganizeId(organizeId, null); + for (UserEntity entity : entityList) { + UserByRoleVO vo = new UserByRoleVO(); + vo.setId(entity.getId()); + vo.setHeadIcon(UploaderUtil.uploaderImg(entity.getHeadIcon())); + vo.setFullName(entity.getRealName() + "/" + entity.getAccount()); + vo.setEnabledMark(entity.getEnabledMark()); + vo.setIsLeaf(true); + vo.setHasChildren(false); + vo.setIcon("icon-ym icon-ym-tree-user2"); + vo.setType("user"); + vo.setGender(entity.getGender()); + List listByUserId = userRelationService.getListByUserId(entity.getId()).stream().filter(t -> t != null && PermissionConst.ORGANIZE.equals(t.getObjectType())).collect(Collectors.toList()); + StringJoiner stringJoiner = new StringJoiner(","); + listByUserId.forEach(t -> { + OrganizeEntity organizeEntity1 = orgMaps.get(t.getObjectId()); + if (organizeEntity1 != null) { + String fullNameByOrgIdTree = organizeService.getFullNameByOrgIdTree(orgIdNameMaps, organizeEntity1.getOrganizeIdTree(), "/"); + if (StringUtil.isNotEmpty(fullNameByOrgIdTree)) { + stringJoiner.add(fullNameByOrgIdTree); + } + } + }); + vo.setOrganize(stringJoiner.toString()); + jsonToList.add(vo); + } + for (OrganizeEntity entitys : organizeEntities) { + UserByRoleVO vo = new UserByRoleVO(); + vo.setId(entitys.getId()); + vo.setType(entitys.getCategory()); + vo.setFullName(entitys.getFullName()); + if ("department".equals(entitys.getCategory())) { + vo.setIcon("icon-ym icon-ym-tree-department1"); + } else { + vo.setIcon("icon-ym icon-ym-tree-organization3"); + } + vo.setHasChildren(true); + vo.setIsLeaf(false); + vo.setEnabledMark(entitys.getEnabledMark()); + if (StringUtil.isNotEmpty(entitys.getOrganizeIdTree())) { + String[] split = entitys.getOrganizeIdTree().split(organizeEntity.getId()); + if (split.length > 1) { + vo.setFullName(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, split[1], "/")); + } + } + jsonToList.add(vo); + } + } + return jsonToList; + } + List list = new ArrayList<>(16); + for (OrganizeEntity organizeEntity : collect) { + if (organizeEntity != null && organizeEntity.getEnabledMark() == 1) { + UserByRoleVO userByRoleVO = new UserByRoleVO(); + userByRoleVO.setId(organizeEntity.getId()); + userByRoleVO.setType(organizeEntity.getCategory()); + if ("department".equals(organizeEntity.getCategory())) { + userByRoleVO.setIcon("icon-ym icon-ym-tree-department1"); + } else { + userByRoleVO.setIcon("icon-ym icon-ym-tree-organization3"); + } + userByRoleVO.setHasChildren(true); + userByRoleVO.setIsLeaf(false); + userByRoleVO.setEnabledMark(organizeEntity.getEnabledMark()); + // 处理断层 + if (StringUtil.isNotEmpty(organizeEntity.getOrganizeIdTree())) { + List list1 = new ArrayList<>(); + String[] split = organizeEntity.getOrganizeIdTree().split(","); + list1 = Arrays.asList(split); + Collections.reverse(list1); + for (String orgId : list1) { + OrganizeEntity organizeEntity1 = orgMaps.get(orgId); + if (organizeEntity1 != null && !organizeEntity1.getId().equals(organizeEntity.getId())) { + // 记录id + list.add(organizeEntity.getId()); + break; + } + } + } + if (!list.contains(organizeEntity.getId())) { + jsonToList.add(userByRoleVO); + } + } + } + jsonToList.forEach(t -> { + OrganizeEntity entity = orgMaps.get(t.getId()); + if (entity != null) { + t.setFullName(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, entity.getOrganizeIdTree(), "/")); + } + t.setParentId(entity.getParentId()); + }); + return jsonToList; + } + + private String getColumns(Integer key) { + Map map = new HashMap<>(); + map.put(1, "账号"); + map.put(2, "姓名"); + map.put(3, "性别"); + map.put(4, "手机"); + map.put(5, "说明"); + map.put(6, "状态"); + map.put(7, "排序"); + map.put(8, "是否管理员"); + map.put(9, "锁定标志"); + map.put(10, "添加时间"); + map.put(11, "部门"); + return map.get(key); + } + + /** + * 判断上级是否直属主管的值是否为我的下属 + * + * @param id + * @param managerId + * @param num + */ + private boolean recursionSubordinates(String id, String managerId, int num) { + UserEntity entity = getInfo(managerId); + num++; + if (entity != null && entity.getId().equals(id)) { + return true; + } + if (num < 10) { + if (entity != null) { + return recursionSubordinates(id, entity.getManagerId(), num); + } + return false; + } else { + return false; + } + } + + /** + * 查询给定的条件是否有默认当前登录者的默认用户值 + * @param userConditionModel + * @return + */ + @Override + public String getDefaultCurrentValueUserId(UserConditionModel userConditionModel) { + UserInfo userInfo = UserProvider.getUser(); + int currentFinded = 0; + if(userConditionModel.getUserIds() != null && !userConditionModel.getUserIds().isEmpty() && userConditionModel.getUserIds().contains(userInfo.getUserId())) { + currentFinded = 1; + } + if (currentFinded == 0 && userConditionModel.getDepartIds() != null && !userConditionModel.getDepartIds().isEmpty()) { + List orgList = organizeService.getOrgEntityList(userConditionModel.getDepartIds(), true); + List orgLIdList = orgList.stream().map(OrganizeEntity::getId).collect(Collectors.toList()); + if(orgLIdList != null && !orgLIdList.isEmpty()) { + List userIds = userRelationService.getListByObjectIdAll(orgLIdList).stream().map(UserRelationEntity::getUserId).collect(Collectors.toList()); + if(userIds != null && !userIds.isEmpty() && userIds.contains(userInfo.getUserId())) { + currentFinded = 1; + } + } + } + if (currentFinded == 0 && userConditionModel.getRoleIds() != null && !userConditionModel.getRoleIds().isEmpty()) { + List roleList = roleService.getListByIds(userConditionModel.getRoleIds(), null, false); + List roleIdList = roleList.stream().filter(t -> t.getEnabledMark() == 1).map(RoleEntity::getId).collect(Collectors.toList()); + if(roleIdList != null && !roleIdList.isEmpty()) { + List userIds = userRelationService.getListByObjectIdAll(roleIdList).stream().map(UserRelationEntity::getUserId).collect(Collectors.toList()); + if(userIds != null && !userIds.isEmpty() && userIds.contains(userInfo.getUserId())) { + currentFinded = 1; + } + } + } + if (currentFinded == 0 && userConditionModel.getPositionIds() != null && !userConditionModel.getPositionIds().isEmpty()) { + List positionList = positionService.getPosList(userConditionModel.getPositionIds()); + List positionIdList = positionList.stream().filter(t -> t.getEnabledMark() == 1).map(PositionEntity::getId).collect(Collectors.toList()); + if(positionIdList != null && !positionIdList.isEmpty()) { + List userIds = userRelationService.getListByObjectIdAll(positionIdList).stream().map(UserRelationEntity::getUserId).collect(Collectors.toList()); + if(userIds != null && !userIds.isEmpty() && userIds.contains(userInfo.getUserId())) { + currentFinded = 1; + } + } + } + if (currentFinded == 0 && userConditionModel.getGroupIds() != null && !userConditionModel.getGroupIds().isEmpty()) { + List groupList = groupService.getListByIds(userConditionModel.getGroupIds(), true); + List groupIdList = groupList.stream().map(GroupEntity::getId).collect(Collectors.toList()); + if(groupIdList != null && !groupIdList.isEmpty()) { + List userIds = userRelationService.getListByObjectIdAll(groupIdList).stream().map(UserRelationEntity::getUserId).collect(Collectors.toList()); + if(userIds != null && !userIds.isEmpty() && userIds.contains(userInfo.getUserId())) { + currentFinded = 1; + } + } + } + return (currentFinded == 1)?userInfo.getUserId():""; + } + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/util/PermissionUtil.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/util/PermissionUtil.java new file mode 100644 index 0000000..77c557a --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/util/PermissionUtil.java @@ -0,0 +1,124 @@ +package jnpf.permission.util; + +import cn.hutool.core.util.ArrayUtil; +import jnpf.constant.MsgCode; +import jnpf.exception.DataException; +import jnpf.permission.entity.OrganizeEntity; +import jnpf.permission.entity.PositionEntity; +import jnpf.permission.entity.RoleEntity; +import jnpf.permission.entity.UserRelationEntity; +import jnpf.permission.service.*; +import jnpf.util.StringUtil; +import jnpf.util.context.SpringContext; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 类功能 + * + * @author JNPF开发平台组 YanYu + * @version V3.2.0 + * @copyright 引迈信息技术有限公司 + * @date 2022/1/27 + */ +public class PermissionUtil { + + /** + * 递归取组织结构id + * @param organizeInfo 组织信息集合 + * @param organizeId 组织id + * @param infoType 信息类型 1:id 2:fullName + */ + private static LinkedList getOrganizeInfos(LinkedList organizeInfo, String organizeId, Integer infoType, OrganizeService organizeService){ + OrganizeEntity infoEntity = organizeService.getInfo(organizeId); + if(infoEntity != null){ + organizeInfo.add(infoType.equals(1) ? organizeId : infoEntity.getFullName()); + // -1 为顶级节点 + if(!"-1".equals(infoEntity.getParentId())){ + getOrganizeInfos(organizeInfo, infoEntity.getParentId(), infoType, organizeService); + }else { + // 结束时,进行倒序排列 + Collections.reverse(organizeInfo); + } + } + return organizeInfo; + } + + public static List> getOrgIdsTree(List organizeIds, Integer infoType, OrganizeService organizeService){ + List> organizeIdsTree = new ArrayList<>(); + organizeIds.forEach(id->{ + organizeIdsTree.add(getOrganizeInfos(new LinkedList<>(), id , infoType, organizeService)); + }); + return organizeIdsTree; + } + + /** + * 获取组名连接信息 + * @param organizeIds 组织id集合 + * @return 组织链式信息 + */ + public static String getLinkInfoByOrgId(List organizeIds, OrganizeService organizeService){ + StringBuilder organizeInfoVo = new StringBuilder(); + for(String id : organizeIds) { + if(id != null){ + StringBuilder organizeInfo = new StringBuilder(); + for (String name : getOrganizeInfos(new LinkedList<>(), id, 2, organizeService)) { + organizeInfo.append(name).append("/"); + } + // 去除最后一个斜杠 + if(organizeInfo.length() > 0){ + organizeInfo = new StringBuilder(organizeInfo.substring(0, organizeInfo.length()-1)); + } + organizeInfo.append(","); + organizeInfoVo.append(organizeInfo); + } + } + return organizeInfoVo.toString(); + } + + /** + * 获取组名连接信息 + * @param organizeId 组织id + * @return 组织链式信息 + */ + public static String getLinkInfoByOrgId(String organizeId, OrganizeService organizeService){ + return getLinkInfoByOrgId(Collections.singletonList(organizeId), organizeService); + } + + /** + * 去掉尾部的封号 + */ + public static String getLinkInfoByOrgId(String organizeId, OrganizeService organizeService, Boolean separateFlag){ + String linkInfo = getLinkInfoByOrgId(organizeId, organizeService); + if (StringUtil.isEmpty(linkInfo)){ + return linkInfo; + } + if(!separateFlag){ + linkInfo = linkInfo.substring(0, linkInfo.length() - 1); + } + return linkInfo; + } + + public static List getOrgIdsByFormTree(OrganizeService organizeService, List> organizeIdsTree) throws DataException { + List orgIds = new ArrayList<>(); + for (List organizeIds : organizeIdsTree) { + // 组织id数组树最后一个数组最后一个id,是需要储存的id + String organizeId = organizeIds.get(organizeIds.size() - 1); + orgIds.add(organizeId); + } + // 判断每个OrgId的有效性 + int count = organizeService.listByIds(orgIds).size(); + if(count != orgIds.size()){ + throw new DataException(MsgCode.FA026.get()); + } + return orgIds; + } + + + + + + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/util/socials/AuthCallbackNew.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/util/socials/AuthCallbackNew.java new file mode 100644 index 0000000..1c78b87 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/util/socials/AuthCallbackNew.java @@ -0,0 +1,17 @@ +package jnpf.permission.util.socials; + +import lombok.Data; +import me.zhyd.oauth.model.AuthCallback; + +/** + * 流程设计 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/7/21 17:17:44 + */ +@Data +public class AuthCallbackNew extends AuthCallback { + private String authCode; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/util/socials/AuthDefaultSourceNew.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/util/socials/AuthDefaultSourceNew.java new file mode 100644 index 0000000..3a870f5 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/util/socials/AuthDefaultSourceNew.java @@ -0,0 +1,57 @@ +package jnpf.permission.util.socials; + +import me.zhyd.oauth.config.AuthSource; +import me.zhyd.oauth.request.AuthDefaultRequest; +import me.zhyd.oauth.request.AuthDingTalkRequest; + +/** + * 流程设计 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/7/15 17:20:40 + */ +public enum AuthDefaultSourceNew implements AuthSource { + DINGTALK_NEW { + public String authorize() { + return "https://login.dingtalk.com/oauth2/auth"; +// return "https://oapi.dingtalk.com/connect/sns_authorize"; + } + + public String accessToken() { + return "https://api.dingtalk.com/v1.0/oauth2/userAccessToken"; +// return "https://oapi.dingtalk.com/gettoken"; + + } + + public String userInfo() { + return "https://api.dingtalk.com/v1.0/contact/users/me"; +// return "https://oapi.dingtalk.com/user/getuserinfo"; + } + + public Class getTargetClass() { + return AuthDingTalkRequest.class; + } + }, + WECHAT_APPLETS { + @Override + public String authorize() { + return null; + } + + @Override + public String accessToken() { + return null; + } + + public String userInfo() { + return "https://api.weixin.qq.com/sns/jscode2session"; + } + public Class getTargetClass() { + return AuthWechatAppletsRequest.class; + } + },; + private AuthDefaultSourceNew() { + } +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/util/socials/AuthDingTalkNewRequest.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/util/socials/AuthDingTalkNewRequest.java new file mode 100644 index 0000000..131c210 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/util/socials/AuthDingTalkNewRequest.java @@ -0,0 +1,123 @@ +package jnpf.permission.util.socials; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.xkcoding.http.support.HttpHeader; +import me.zhyd.oauth.cache.AuthStateCache; +import me.zhyd.oauth.config.AuthConfig; +import me.zhyd.oauth.enums.AuthResponseStatus; +import me.zhyd.oauth.enums.AuthUserGender; +import me.zhyd.oauth.exception.AuthException; +import me.zhyd.oauth.log.Log; +import me.zhyd.oauth.model.AuthCallback; +import me.zhyd.oauth.model.AuthResponse; +import me.zhyd.oauth.model.AuthToken; +import me.zhyd.oauth.model.AuthUser; +import me.zhyd.oauth.request.AuthDefaultRequest; +import me.zhyd.oauth.utils.HttpUtils; +import me.zhyd.oauth.utils.StringUtils; +import me.zhyd.oauth.utils.UrlBuilder; + +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; + +/** + * 流程设计 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/7/15 17:19:14 + */ +public class AuthDingTalkNewRequest extends AuthDefaultRequest { + + public AuthDingTalkNewRequest(AuthConfig config) { + super(config, AuthDefaultSourceNew.DINGTALK_NEW); + } + + public AuthDingTalkNewRequest(AuthConfig config, AuthStateCache authStateCache) { + super(config, AuthDefaultSourceNew.DINGTALK_NEW, authStateCache); + } + + public String authorize(String state) { + String encode = null; + try { + encode = URLEncoder.encode(this.config.getRedirectUri(), "UTF-8"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + ; + return UrlBuilder.fromBaseUrl(this.source.authorize()).queryParam("response_type", "code").queryParam("client_id", this.config.getClientId()).queryParam("scope", "openid").queryParam("redirect_uri", encode).queryParam("prompt", "consent").build(); + } + + protected AuthToken getAccessToken(AuthCallback authCallback) { + return this.getToken(this.accessTokenUrl(authCallback.getCode()), authCallback); + } + + protected String accessTokenUrl(String code) { + return UrlBuilder.fromBaseUrl(this.source.accessToken()).build(); + } + + public AuthResponse login(AuthCallback authCallback) { + try { + this.checkCode(authCallback); + AuthToken authToken = this.getAccessToken(authCallback); + AuthUser user = this.getUserInfo(authToken); + return AuthResponse.builder().code(AuthResponseStatus.SUCCESS.getCode()).data(user).build(); + } catch (Exception var4) { + Log.error("Failed to login with oauth authorization.", var4); + return this.responseError(var4); + } + } + + AuthResponse responseError(Exception e) { + int errorCode = AuthResponseStatus.FAILURE.getCode(); + String errorMsg = e.getMessage(); + if (e instanceof AuthException) { + AuthException authException = (AuthException) e; + errorCode = authException.getErrorCode(); + if (StringUtils.isNotEmpty(authException.getErrorMsg())) { + errorMsg = authException.getErrorMsg(); + } + } + + return AuthResponse.builder().code(errorCode).msg(errorMsg).build(); + } + + private AuthToken getToken(String accessTokenUrl, AuthCallback authCallback) { + JSONObject map = new JSONObject(); + map.put("clientId", this.config.getClientId()); + map.put("clientSecret", this.config.getClientSecret()); + map.put("code", authCallback.getCode()); + map.put("refreshToken", authCallback.getCode()); + map.put("grantType", "authorization_code"); + String response = (new HttpUtils(this.config.getHttpConfig())).post(accessTokenUrl, map.toJSONString(), new HttpHeader().add("Content-Type", "application/json")).getBody(); + JSONObject accessTokenObject = JSONObject.parseObject(response); + this.checkResponse(accessTokenObject); + return AuthToken.builder().accessToken(accessTokenObject.getString("accessToken")).refreshToken(accessTokenObject.getString("refreshToken")).expireIn(accessTokenObject.getIntValue("expireIn")).openId(accessTokenObject.getString("openid")).build(); + } + + private void checkResponse(JSONObject object) { + if (object.containsKey("errcode")) { + throw new AuthException(object.getIntValue("errcode"), object.getString("errmsg")); + } + } + + protected AuthUser getUserInfo(AuthToken authToken) { + HttpHeader httpHeader = new HttpHeader() + .add("x-acs-dingtalk-access-token", authToken.getAccessToken()) + .add("Content-Type", "application/json"); + String response = (new HttpUtils(this.config.getHttpConfig())).get(this.userInfoUrl(authToken), null, httpHeader, false).getHttpResponse().getBody(); + JSONObject object = JSON.parseObject(response); + if (object.get("unionId") != null) { + AuthToken token = AuthToken.builder().openId(object.getString("openId")).unionId(object.getString("unionId")).build(); + return AuthUser.builder().rawUserInfo(object).uuid(object.getString("unionId")).nickname(object.getString("nick")).username(object.getString("nick")).gender(AuthUserGender.UNKNOWN).source(this.source.toString()).token(token).build(); + } else { + throw new AuthException("登录失败!"); + } + } + + protected String userInfoUrl(AuthToken authToken) { + return UrlBuilder.fromBaseUrl(this.source.userInfo()).build(); + } +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/util/socials/AuthSocialsUtil.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/util/socials/AuthSocialsUtil.java new file mode 100644 index 0000000..200e7e1 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/util/socials/AuthSocialsUtil.java @@ -0,0 +1,439 @@ +package jnpf.permission.util.socials; + +import com.xkcoding.http.config.HttpConfig; +import jnpf.config.JnpfOauthConfig; +import jnpf.util.StringUtil; +import me.zhyd.oauth.config.AuthConfig; +import me.zhyd.oauth.enums.scope.*; +import me.zhyd.oauth.exception.AuthException; +import me.zhyd.oauth.request.*; +import me.zhyd.oauth.utils.AuthScopeUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.net.InetSocketAddress; +import java.net.Proxy; +import java.net.URLEncoder; +import java.util.Arrays; + +/** + * 流程设计 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/7/21 12:00:56 + */ +@Component +public class AuthSocialsUtil { + @Autowired + private SocialsConfig socialsConfig; + @Autowired + private JnpfOauthConfig oauthConfig; + + /** + * 根据配置信息获取请求对象 + * + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2022/7/21 + */ + public AuthRequest getAuthRequest(String source, String userId, boolean isLogin, String ticket, String tenantId) { + AuthRequest authRequest = null; + String addUrlStr = ""; + String urlStr = oauthConfig.getJnpfDomain() + "/api/oauth/Login/socials?source=" + source; + if (!isLogin) { + urlStr = oauthConfig.getJnpfDomain() + "/api/oauth/Login/socials?source=" + source; + } + if (StringUtil.isNotEmpty(userId)) { + addUrlStr = "&userId=" + userId; + } + if (StringUtil.isNotEmpty(ticket)) { + addUrlStr = "&jnpf_ticket=" + ticket; + } + if (StringUtil.isNotEmpty(tenantId)) { + addUrlStr += "&tenantId=" + tenantId; + } + String url = urlStr + addUrlStr; + SocialsConfig.Config socialConfig; + switch (source.toLowerCase()) { + //todo 官方登录api调整目前数据问题 + case "dingtalk": + socialConfig = socialsConfig.getSocialMap().get("dingtalk"); + authRequest = new AuthDingTalkNewRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .build()); + break; + //todo 未申请企业 + case "qq": + socialConfig = socialsConfig.getSocialMap().get("qq"); + authRequest = new AuthQqRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .build()); + break; + case "wechat_open": + socialConfig = socialsConfig.getSocialMap().get("wechat_open"); + authRequest = new AuthWeChatOpenRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(URLEncoder.encode(url)) + .build()); + break; + case "github": + socialConfig = socialsConfig.getSocialMap().get("github"); + authRequest = new AuthGithubRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(URLEncoder.encode(url)) + .scopes(AuthScopeUtils.getScopes(AuthGithubScope.values())) + // 针对国外平台配置代理 +// .httpConfig(HttpConfig.builder() +// .timeout(15000) +// .proxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 10080))) +// .build()) + .build()); + break; + case "wechat_enterprise": + socialConfig = socialsConfig.getSocialMap().get("wechat_enterprise"); + authRequest = new AuthWeChatEnterpriseQrcodeRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(URLEncoder.encode(url)) + .agentId(socialConfig.getAgentId()) + .build()); + break; + case "feishu": + socialConfig = socialsConfig.getSocialMap().get("feishu"); + authRequest = new AuthFeishuRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .build()); + break; + case "baidu": + socialConfig = socialsConfig.getSocialMap().get("baidu"); + authRequest = new AuthBaiduRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .scopes(Arrays.asList( + AuthBaiduScope.BASIC.getScope(), + AuthBaiduScope.SUPER_MSG.getScope(), + AuthBaiduScope.NETDISK.getScope() + )) +// .clientId("") +// .clientSecret("") +// .redirectUri("http://localhost:9001/oauth/baidu/callback") + .build()); + break; + case "gitee": + socialConfig = socialsConfig.getSocialMap().get("gitee"); + authRequest = new AuthGiteeRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .scopes(AuthScopeUtils.getScopes(AuthGiteeScope.values())) + .build()); + break; + case "weibo": + socialConfig = socialsConfig.getSocialMap().get("weibo"); + authRequest = new AuthWeiboRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .scopes(Arrays.asList( + AuthWeiboScope.EMAIL.getScope(), + AuthWeiboScope.FRIENDSHIPS_GROUPS_READ.getScope(), + AuthWeiboScope.STATUSES_TO_ME_READ.getScope() + )) + .build()); + break; + case "coding": + socialConfig = socialsConfig.getSocialMap().get("coding"); + authRequest = new AuthCodingRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .domainPrefix("") + .scopes(Arrays.asList( + AuthCodingScope.USER.getScope(), + AuthCodingScope.USER_EMAIL.getScope(), + AuthCodingScope.USER_PHONE.getScope() + )) + .build()); + break; + case "oschina": + socialConfig = socialsConfig.getSocialMap().get("oschina"); + authRequest = new AuthOschinaRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .build()); + break; + case "alipay": + socialConfig = socialsConfig.getSocialMap().get("alipay"); + // 支付宝在创建回调地址时,不允许使用localhost或者127.0.0.1,所以这儿的回调地址使用的局域网内的ip + authRequest = new AuthAlipayRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .alipayPublicKey("") + .build()); + break; + case "csdn": + socialConfig = socialsConfig.getSocialMap().get("csdn"); + authRequest = new AuthCsdnRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .build()); + break; + case "taobao": + socialConfig = socialsConfig.getSocialMap().get("taobao"); + authRequest = new AuthTaobaoRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .build()); + break; + case "google": + socialConfig = socialsConfig.getSocialMap().get("google"); + authRequest = new AuthGoogleRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .scopes(AuthScopeUtils.getScopes(AuthGoogleScope.USER_EMAIL, AuthGoogleScope.USER_PROFILE, AuthGoogleScope.USER_OPENID)) + // 针对国外平台配置代理 + .httpConfig(HttpConfig.builder() + .timeout(15000) + .proxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 10080))) + .build()) + .build()); + break; + case "facebook": + socialConfig = socialsConfig.getSocialMap().get("facebook"); + authRequest = new AuthFacebookRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .scopes(AuthScopeUtils.getScopes(AuthFacebookScope.values())) + // 针对国外平台配置代理 + .httpConfig(HttpConfig.builder() + .timeout(15000) + .proxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 10080))) + .build()) + .build()); + break; + case "douyin": + socialConfig = socialsConfig.getSocialMap().get("douyin"); + authRequest = new AuthDouyinRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .build()); + break; + case "linkedin": + socialConfig = socialsConfig.getSocialMap().get("linkedin"); + authRequest = new AuthLinkedinRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .scopes(null) + .build()); + break; + case "microsoft": + socialConfig = socialsConfig.getSocialMap().get("microsoft"); + authRequest = new AuthMicrosoftRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .scopes(Arrays.asList( + AuthMicrosoftScope.USER_READ.getScope(), + AuthMicrosoftScope.USER_READWRITE.getScope(), + AuthMicrosoftScope.USER_READBASIC_ALL.getScope(), + AuthMicrosoftScope.USER_READ_ALL.getScope(), + AuthMicrosoftScope.USER_READWRITE_ALL.getScope(), + AuthMicrosoftScope.USER_INVITE_ALL.getScope(), + AuthMicrosoftScope.USER_EXPORT_ALL.getScope(), + AuthMicrosoftScope.USER_MANAGEIDENTITIES_ALL.getScope(), + AuthMicrosoftScope.FILES_READ.getScope() + )) + .build()); + break; + case "mi": + socialConfig = socialsConfig.getSocialMap().get("mi"); + authRequest = new AuthMiRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .build()); + break; + case "toutiao": + socialConfig = socialsConfig.getSocialMap().get("toutiao"); + authRequest = new AuthToutiaoRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .build()); + break; + case "teambition": + socialConfig = socialsConfig.getSocialMap().get("teambition"); + authRequest = new AuthTeambitionRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .build()); + break; + case "pinterest": + socialConfig = socialsConfig.getSocialMap().get("pinterest"); + authRequest = new AuthPinterestRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + // 针对国外平台配置代理 + .httpConfig(HttpConfig.builder() + .timeout(15000) + .proxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 10080))) + .build()) + .build()); + break; + case "renren": + socialConfig = socialsConfig.getSocialMap().get("renren"); + authRequest = new AuthRenrenRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .build()); + break; + case "stack_overflow": + socialConfig = socialsConfig.getSocialMap().get("stack_overflow"); + authRequest = new AuthStackOverflowRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .stackOverflowKey("") + .build()); + break; + case "huawei": + socialConfig = socialsConfig.getSocialMap().get("huawei"); + authRequest = new AuthHuaweiRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .scopes(Arrays.asList( + AuthHuaweiScope.BASE_PROFILE.getScope(), + AuthHuaweiScope.MOBILE_NUMBER.getScope(), + AuthHuaweiScope.ACCOUNTLIST.getScope(), + AuthHuaweiScope.SCOPE_DRIVE_FILE.getScope(), + AuthHuaweiScope.SCOPE_DRIVE_APPDATA.getScope() + )) + .build()); + break; + case "kujiale": + socialConfig = socialsConfig.getSocialMap().get("kujiale"); + authRequest = new AuthKujialeRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .build()); + break; + case "gitlab": + socialConfig = socialsConfig.getSocialMap().get("gitlab"); + authRequest = new AuthGitlabRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .scopes(AuthScopeUtils.getScopes(AuthGitlabScope.values())) + .build()); + break; + case "meituan": + socialConfig = socialsConfig.getSocialMap().get("meituan"); + authRequest = new AuthMeituanRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .build()); + break; + case "eleme": + socialConfig = socialsConfig.getSocialMap().get("eleme"); + authRequest = new AuthElemeRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .build()); + break; +// case "mygitlab": +// authRequest = new AuthMyGitlabRequest(AuthConfig.builder() +// .clientId("") +// .clientSecret("") +// .redirectUri("http://127.0.0.1:8443/oauth/callback/mygitlab") +// .build()); +// break; + case "twitter": + socialConfig = socialsConfig.getSocialMap().get("twitter"); + authRequest = new AuthTwitterRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + // 针对国外平台配置代理 + .httpConfig(HttpConfig.builder() + .timeout(15000) + .proxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 10080))) + .build()) + .build()); + break; + case "wechat_mp": + socialConfig = socialsConfig.getSocialMap().get("wechat_mp"); + authRequest = new AuthWeChatMpRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .build()); + break; + case "aliyun": + socialConfig = socialsConfig.getSocialMap().get("aliyun"); + authRequest = new AuthAliyunRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .build()); + break; + case "xmly": + socialConfig = socialsConfig.getSocialMap().get("xmly"); + authRequest = new AuthXmlyRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .build()); + break; + case "wechat_enterprise_web": + socialConfig = socialsConfig.getSocialMap().get("wechat_enterprise_web"); + authRequest = new AuthWeChatEnterpriseWebRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .agentId(socialConfig.getAgentId()) + .build()); + break; + case "wechat_applets": + socialConfig = socialsConfig.getSocialMap().get("wechat_applets"); + authRequest = new AuthWechatAppletsRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .build()); + break; + default: + break; + } + if (null == authRequest) { + throw new AuthException("未获取到有效的Auth配置"); + } + return authRequest; + } +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/util/socials/AuthWechatAppletsRequest.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/util/socials/AuthWechatAppletsRequest.java new file mode 100644 index 0000000..d171628 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/util/socials/AuthWechatAppletsRequest.java @@ -0,0 +1,88 @@ +package jnpf.permission.util.socials; + +import com.alibaba.fastjson.JSONObject; +import me.zhyd.oauth.cache.AuthStateCache; +import me.zhyd.oauth.config.AuthConfig; +import me.zhyd.oauth.enums.AuthResponseStatus; +import me.zhyd.oauth.exception.AuthException; +import me.zhyd.oauth.log.Log; +import me.zhyd.oauth.model.AuthCallback; +import me.zhyd.oauth.model.AuthResponse; +import me.zhyd.oauth.model.AuthToken; +import me.zhyd.oauth.model.AuthUser; +import me.zhyd.oauth.request.AuthDefaultRequest; +import me.zhyd.oauth.utils.HttpUtils; +import me.zhyd.oauth.utils.StringUtils; +import me.zhyd.oauth.utils.UrlBuilder; + +/** + * 流程设计 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/9/16 12:11:36 + */ +public class AuthWechatAppletsRequest extends AuthDefaultRequest { + public AuthWechatAppletsRequest(AuthConfig config) { + super(config, AuthDefaultSourceNew.WECHAT_APPLETS); + } + + public AuthWechatAppletsRequest(AuthConfig config, AuthStateCache authStateCache) { + super(config, AuthDefaultSourceNew.WECHAT_APPLETS, authStateCache); + } + + @Override + protected AuthToken getAccessToken(AuthCallback authCallback) { + return null; + } + + @Override + protected AuthUser getUserInfo(AuthToken authToken) { + return null; + } + + protected String getuserInfoUrl(AuthCallback authCallback) { + return UrlBuilder.fromBaseUrl(this.source.userInfo()) + .queryParam("appid", this.config.getClientId()) + .queryParam("secret", this.config.getClientSecret()) + .queryParam("js_code",authCallback.getCode()) + .queryParam("grant_type", "authorization_code").build(); + + } + + AuthResponse responseError(Exception e) { + int errorCode = AuthResponseStatus.FAILURE.getCode(); + String errorMsg = e.getMessage(); + if (e instanceof AuthException) { + AuthException authException = (AuthException) e; + errorCode = authException.getErrorCode(); + if (StringUtils.isNotEmpty(authException.getErrorMsg())) { + errorMsg = authException.getErrorMsg(); + } + } + + return AuthResponse.builder().code(errorCode).msg(errorMsg).build(); + } + public AuthResponse login(AuthCallback authCallback) { + try { + AuthUser user = this.getUserUnionid(authCallback); + return AuthResponse.builder().code(AuthResponseStatus.SUCCESS.getCode()).data(user).build(); + } catch (Exception var4) { + Log.error("Failed to login with oauth authorization.", var4); + return this.responseError(var4); + } + } + + protected AuthUser getUserUnionid(AuthCallback authCallback) { + String response = (new HttpUtils(this.config.getHttpConfig())).get(this.getuserInfoUrl(authCallback)).getBody(); + JSONObject object = JSONObject.parseObject(response); + AuthToken authToken=new AuthToken(); + if (object.containsKey("unionid")) { + authToken.setUnionId(object.getString("unionid")); + } + return AuthUser.builder().rawUserInfo(object).token(authToken).source(this.source.toString()).build(); + } + + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/util/socials/SocialsAuthEnum.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/util/socials/SocialsAuthEnum.java new file mode 100644 index 0000000..8a803b1 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/util/socials/SocialsAuthEnum.java @@ -0,0 +1,102 @@ +package jnpf.permission.util.socials; + +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +/** + * 单点登录枚举 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/7/14 10:10:30 + */ +public enum SocialsAuthEnum { + WECHAT_OPEN("微信", "/cdn/socials/wechat_open.png","绑定微信后,用户可通过微信扫码登录JNPF系统。", + "", "v1.1.0", true,"icon-ym icon-ym-logo-wechat"), + QQ("QQ", "/cdn/socials/qq.png", "绑定QQ后,用户可通过QQ扫码登录JNPF系统。", + "", "v1.1.0", true,"icon-ym icon-ym-logo-qq"), + WECHAT_ENTERPRISE("企业微信", "/cdn/socials/wxWork.png","绑定企业微信后,您可在网页端扫码登录, 在企业微信应用内和小程序免登录, 并能实时接收小程序通知,沟通和协作将更加便捷。", + "", "v1.10.0", true,"icon-ym icon-ym-logo-wxWork"), + DINGTALK("钉钉", "/cdn/socials/dingtalk.png", "绑定阿里钉钉后,您可在网页端扫码登录并能接收相关通知。", + "", "v1.0.1", true,"icon-ym icon-ym-logo-dingding"), + FEISHU("飞书", "/cdn/socials/feishu.png", "绑定飞书后,用户可扫码登录 JNPF。", + "", "1.15.9", true,"icon-ym icon-ym-logo-feishu"), + GITHUB("Github", "/cdn/socials/gitHub.png", "绑定GitHub后,用户可扫码登录 JNPF。", + "", "v1.0.1", true,"icon-ym icon-ym-logo-github"), + GITEE("Gitee", "", "绑定Gitee后,用户可登录 JNPF。", + "", "v1.0.1", false,"icon-ym icon-ym-logo-github"), + ; + // 平台名 + private final String name; + // 帮助文档 + private final String logo; + //描述 + private final String describetion; + // 官网api文档 + private final String apiDoc; + // 集成该平台的 版本 + private final String since; + //首页展示 + private final boolean latest; + // 官网api文档 + private final String icon; + + SocialsAuthEnum(String name, String logo, String describetion, String apiDoc, String since, boolean latest, String icon) { + this.name = name; + this.logo = logo; + this.describetion=describetion; + this.apiDoc = apiDoc; + this.since = since; + this.latest = latest; + this.icon=icon; + } + + public static List> getPlatformInfos() { + List> list = new LinkedList<>(); + Map map = null; + SocialsAuthEnum[] justAuthPlatformInfos = SocialsAuthEnum.values(); + for (SocialsAuthEnum justAuthPlatformInfo : justAuthPlatformInfos) { + map = new HashMap<>(); + map.put("name", justAuthPlatformInfo.getName()); + map.put("logo", justAuthPlatformInfo.getLogo()); + map.put("describetion", justAuthPlatformInfo.getDescribetion()); + map.put("apiDoc", justAuthPlatformInfo.getApiDoc()); + map.put("since", justAuthPlatformInfo.getSince()); + map.put("enname", justAuthPlatformInfo.name().toLowerCase()); + map.put("isLatest", justAuthPlatformInfo.isLatest()); + map.put("icon", justAuthPlatformInfo.getIcon()); + list.add(map); + } + return list; + } + + public String getIcon() { + return icon; + } + public String getName() { + return name; + } + + public String getLogo() { + return logo; + } + + public String getDescribetion() { + return describetion; + } + + public String getApiDoc() { + return apiDoc; + } + + public String getSince() { + return since; + } + + public boolean isLatest() { + return latest; + } +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/util/socials/SocialsConfig.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/util/socials/SocialsConfig.java new file mode 100644 index 0000000..2083689 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-biz/src/main/java/jnpf/permission/util/socials/SocialsConfig.java @@ -0,0 +1,135 @@ +package jnpf.permission.util.socials; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + + +/** + * 流程设计 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/9/6 14:58:23 + */ +@Component +@ConfigurationProperties(prefix = SocialsConfig.PREFIX) +public class SocialsConfig { + public static final String PREFIX = "socials"; + + private boolean socialsEnabled = false; + + private List config; + + private Map socialMap; + + public SocialsConfig() { + } + + public SocialsConfig(List config, Map socialMap) { + this.config = config; + this.socialMap = socialMap; + } + + public boolean isSocialsEnabled() { + return socialsEnabled; + } + + public void setSocialsEnabled(boolean socialsEnabled) { + this.socialsEnabled = socialsEnabled; + } + + public void setConfig(List config) { + this.config = config; + this.socialMap = new HashMap<>(); + config.stream().forEach(item -> { + this.socialMap.put(item.getProvider(), item); + }); + } + + public List getConfig() { + return config; + } + + public Map getSocialMap() { + return socialMap; + } + + public static class Config { + private String provider; + private String clientId; + private String clientSecret; + private String agentId; + + public Config() { + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Config config = (Config) o; + return Objects.equals(provider, config.provider) && Objects.equals(clientId, config.clientId) && Objects.equals(clientSecret, config.clientSecret) && Objects.equals(agentId, config.agentId); + } + + @Override + public int hashCode() { + return Objects.hash(provider, clientId, clientSecret, agentId); + } + + @Override + public String toString() { + return "Config{" + + "provider='" + provider + '\'' + + ", clientId='" + clientId + '\'' + + ", clientSecret='" + clientSecret + '\'' + + ", agentId='" + agentId + '\'' + + '}'; + } + + public String getProvider() { + return provider; + } + + public void setProvider(String provider) { + this.provider = provider; + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getClientSecret() { + return clientSecret; + } + + public void setClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + } + + public String getAgentId() { + return agentId; + } + + public void setAgentId(String agentId) { + this.agentId = agentId; + } + + public Config(String provider, String clientId, String clientSecret, String agentId) { + this.provider = provider; + this.clientId = clientId; + this.clientSecret = clientSecret; + this.agentId = agentId; + } + } + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-controller/pom.xml b/jnpf-java-boot/jnpf-permission/jnpf-permission-controller/pom.xml new file mode 100644 index 0000000..b48caf3 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-controller/pom.xml @@ -0,0 +1,32 @@ + + + + jnpf-permission + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-permission-controller + + + + com.jnpf + jnpf-permission-biz + ${project.version} + + + com.jnpf + jnpf-system-biz + ${project.version} + + + com.jnpf + jnpf-exception + ${project.version} + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/AuthorizeController.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/AuthorizeController.java new file mode 100644 index 0000000..134c186 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/AuthorizeController.java @@ -0,0 +1,645 @@ +package jnpf.permission.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.annotation.SaMode; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import jnpf.base.UserInfo; +import jnpf.base.controller.SuperController; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.annotation.OrganizeAdminIsTrator; +import jnpf.base.ActionResult; +import jnpf.base.entity.*; +import jnpf.base.model.base.SystemBaeModel; +import jnpf.base.model.button.ButtonModel; +import jnpf.base.model.column.ColumnModel; +import jnpf.base.model.form.ModuleFormModel; +import jnpf.base.model.module.ModuleModel; +import jnpf.base.model.resource.ResourceModel; +import jnpf.base.service.*; +import jnpf.constant.MsgCode; +import jnpf.permission.constant.AuthorizeConst; +import jnpf.permission.entity.*; +import jnpf.permission.mapper.AuthorizeMapper; +import jnpf.permission.model.authorize.*; +import jnpf.permission.model.columnspurview.ColumnsPurviewUpForm; +import jnpf.permission.service.*; +import jnpf.util.*; +import jnpf.util.treeutil.ListToTreeUtil; +import jnpf.util.treeutil.SumTree; +import jnpf.util.treeutil.newtreeutil.TreeDotUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 操作权限 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +@Tag(name = "操作权限", description = "Authorize") +@RestController +@RequestMapping("/api/permission/Authority") +public class AuthorizeController extends SuperController { + + @Autowired + private ModuleService moduleApi; + @Autowired + private ModuleButtonService buttonApi; + @Autowired + private ModuleColumnService columnApi; + @Autowired + private ModuleFormService formApi; + @Autowired + private ModuleDataAuthorizeSchemeService schemeApi; + @Autowired + private AuthorizeService authorizeService; + @Autowired + private ColumnsPurviewService columnsPurviewService; + @Autowired + private PermissionGroupService permissionGroupService; + @Autowired + private AuthorizeMapper authorizeMapper; + + + /** + * 权限数据 + * + * @param objectId 对象主键 + * @param dataValuesQuery 权限值 + * @return + */ + @Operation(summary = "获取岗位/角色/用户权限树形结构") + @Parameters({ + @Parameter(name = "objectId", description = "对象主键", required = true), + @Parameter(name = "dataValuesQuery", description = "权限值", required = true) + }) + @SaCheckPermission(value = {"permission.authorize", "permission.role"}, mode = SaMode.OR) + @PostMapping("/Data/{objectId}/Values") + public ActionResult getValuesData(@PathVariable("objectId") String objectId, @RequestBody DataValuesQuery dataValuesQuery) { + AuthorizeVO authorizeModel = authorizeService.getAuthorize(true, false); + List list = authorizeService.list(new QueryWrapper().lambda().eq(AuthorizeEntity::getObjectId, objectId)); + if (!StringUtil.isEmpty(dataValuesQuery.getType())) { + switch (dataValuesQuery.getType()) { + case "system": + AuthorizeDataReturnVO authorizeDataReturnVO = this.system(list, authorizeModel); + return ActionResult.success(authorizeDataReturnVO); + case "module": + List systemId = new ArrayList<>(); + if (!StringUtil.isEmpty(dataValuesQuery.getModuleIds())) { + systemId = Arrays.asList(dataValuesQuery.getModuleIds().split(",")); + } + List moduleList = moduleApi.getList().stream().filter( + m -> "1".equals(String.valueOf(m.getEnabledMark())) + ).collect(Collectors.toList()); + AuthorizeDataReturnVO dataReturnVO = this.module1(moduleList, list, authorizeModel, systemId); + return ActionResult.success(dataReturnVO); + case "button": + List moduleList1 = moduleApi.getList().stream().filter( + m -> "1".equals(String.valueOf(m.getEnabledMark())) + ).collect(Collectors.toList()); + //挑选出的list + List selectList1 = new ArrayList<>(); + if (!StringUtil.isEmpty(dataValuesQuery.getModuleIds())) { + List moduleId1 = Arrays.asList(dataValuesQuery.getModuleIds().split(",")); + selectList1 = moduleList1.stream().filter(t -> moduleId1.contains(t.getId())).collect(Collectors.toList()); + } + List moduleButtonList = buttonApi.getList().stream().filter( + m -> "1".equals(String.valueOf(m.getEnabledMark())) + ).collect(Collectors.toList()); + AuthorizeDataReturnVO dataReturnVo1 = this.moduleButton(selectList1, moduleButtonList, list, authorizeModel); + return ActionResult.success(dataReturnVo1); + + case "column": + List moduleList2 = moduleApi.getList().stream().filter( + m -> "1".equals(String.valueOf(m.getEnabledMark())) + ).collect(Collectors.toList()); + //挑选出的list + List selectList2 = new ArrayList<>(); + if (!StringUtil.isEmpty(dataValuesQuery.getModuleIds())) { + List moduleId2 = Arrays.asList(dataValuesQuery.getModuleIds().split(",")); + selectList2 = moduleList2.stream().filter(t -> moduleId2.contains(t.getId())).collect(Collectors.toList()); + } + List moduleColumnList = columnApi.getList().stream().filter( + m -> "1".equals(String.valueOf(m.getEnabledMark())) + ).collect(Collectors.toList()); + AuthorizeDataReturnVO dataReturnVo2 = this.moduleColumn(selectList2, moduleColumnList, list, authorizeModel); + return ActionResult.success(dataReturnVo2); + + case "resource": + List moduleList3 = moduleApi.getList().stream().filter( + m -> "1".equals(String.valueOf(m.getEnabledMark())) + ).collect(Collectors.toList()); + //挑选出的list + List selectList3 = new ArrayList<>(); + if (!StringUtil.isEmpty(dataValuesQuery.getModuleIds())) { + List moduleId3 = Arrays.asList(dataValuesQuery.getModuleIds().split(",")); + selectList3 = moduleList3.stream().filter(t -> moduleId3.contains(t.getId())).collect(Collectors.toList()); + } + List moduleDataSchemeList = schemeApi.getList().stream().filter( + m -> "1".equals(String.valueOf(m.getEnabledMark())) + ).collect(Collectors.toList()); + AuthorizeDataReturnVO dataReturnVo3 = this.resourceData(selectList3, moduleDataSchemeList, list, authorizeModel); + return ActionResult.success(dataReturnVo3); + + case "form": + List moduleList4 = moduleApi.getList().stream().filter( + m -> "1".equals(String.valueOf(m.getEnabledMark())) + ).collect(Collectors.toList()); + //挑选出的list + List selectList4 = new ArrayList<>(); + if (!StringUtil.isEmpty(dataValuesQuery.getModuleIds())) { + List moduleId4 = Arrays.asList(dataValuesQuery.getModuleIds().split(",")); + selectList4 = moduleList4.stream().filter(t -> moduleId4.contains(t.getId())).collect(Collectors.toList()); + } + List moduleFormList = formApi.getList().stream().filter( + m -> "1".equals(String.valueOf(m.getEnabledMark())) + ).collect(Collectors.toList()); + AuthorizeDataReturnVO dataReturnVo4 = this.moduleForm(selectList4, moduleFormList, list, authorizeModel); + return ActionResult.success(dataReturnVo4); + + default: + } + } + return ActionResult.fail("类型不能为空"); + } + + + /** + * 对象数据 + * + * @return + */ + @Operation(summary = "获取功能权限数据") + @Parameters({ + @Parameter(name = "itemId", description = "对象主键", required = true), + @Parameter(name = "objectType", description = "对象类型", required = true) + }) + @SaCheckPermission(value = {"permission.authorize", "permission.role", "onlineDev.visualPortal"}, mode = SaMode.OR) + @GetMapping("/Model/{itemId}/{objectType}") + public ActionResult getObjectAuth(@PathVariable("itemId") String itemId, @PathVariable("objectType") String objectType) { + List authorizeList = authorizeService.getListByObjectAndItem(itemId, objectType); + List ids = authorizeList.stream().map(u -> u.getObjectId()).collect(Collectors.toList()); + AuthorizeItemObjIdsVO vo = new AuthorizeItemObjIdsVO(); + vo.setIds(ids); + return ActionResult.success(vo); + } + + @Operation(summary = "门户管理授权") + @Parameters({ + @Parameter(name = "itemId", description = "对象主键", required = true), + @Parameter(name = "saveAuthForm", description = "保存权限模型", required = true)}) + @PutMapping("/Model/{portalManageId}") + @SaCheckPermission(value = {"permission.authorize", "permission.role"}, mode = SaMode.OR) + public ActionResult savePortalManage(@PathVariable("portalManageId") String portalManageId, @RequestBody SaveAuthForm saveAuthForm) { + authorizeService.savePortalManage(portalManageId, saveAuthForm); + return ActionResult.success(MsgCode.SU005.get()); + } + + /** + * 保存 + * + * @param objectId 对象主键 + * @param authorizeDataUpForm 修改权限模型 + * @return + */ + @OrganizeAdminIsTrator + @Operation(summary = "保存权限") + @Parameters({ + @Parameter(name = "objectId", description = "对象主键", required = true), + @Parameter(name = "authorizeDataUpForm", description = "修改权限模型", required = true) + }) + @SaCheckPermission(value = {"permission.authorize", "permission.role"}, mode = SaMode.OR) + @PutMapping("/Data/{objectId}") + public ActionResult save(@PathVariable("objectId") String objectId, @RequestBody AuthorizeDataUpForm authorizeDataUpForm) { + authorizeService.save(objectId, authorizeDataUpForm); + return ActionResult.success(MsgCode.SU005.get()); + } + + /** + * 保存批量 + * + * @param saveBatchForm 批量保存模型 + * @return + */ + @OrganizeAdminIsTrator + @Operation(summary = "批量保存权限") + @Parameters({ + @Parameter(name = "saveBatchForm", description = "批量保存模型", required = true) + }) + @SaCheckPermission(value = {"permission.authorize"}, mode = SaMode.OR) + @PostMapping("/Data/Batch") + public ActionResult saveBatch(@RequestBody SaveBatchForm saveBatchForm) { + authorizeService.saveBatch(saveBatchForm, true); + return ActionResult.success(MsgCode.SU005.get()); + } + + /** + * 获取模块列表展示字段 + * + * @param moduleId 菜单Id + * @return + */ + @Operation(summary = "获取模块列表展示字段") + @Parameters({ + @Parameter(name = "moduleId", description = "菜单id", required = true) + }) + @GetMapping("/GetColumnsByModuleId/{moduleId}") + public ActionResult getColumnsByModuleId(@PathVariable("moduleId") String moduleId) { + ColumnsPurviewEntity entity = columnsPurviewService.getInfo(moduleId); + List> jsonToListMap = null; + if (entity != null) { + jsonToListMap = JsonUtil.getJsonToListMap(entity.getFieldList()); + } + return ActionResult.success(jsonToListMap != null ? jsonToListMap : new ArrayList<>(16)); + } + + /** + * 配置模块列表展示字段 + * + * @param columnsPurviewUpForm 修改模型 + * @return + */ + @Operation(summary = "配置模块列表展示字段") + @Parameters({ + @Parameter(name = "columnsPurviewUpForm", description = "修改模型", required = true) + }) + @PutMapping("/SetColumnsByModuleId") + public ActionResult setColumnsByModuleId(@RequestBody ColumnsPurviewUpForm columnsPurviewUpForm) { + ColumnsPurviewEntity entity = JsonUtil.getJsonToBean(columnsPurviewUpForm, ColumnsPurviewEntity.class); + columnsPurviewService.update(columnsPurviewUpForm.getModuleId(), entity); + return ActionResult.success(MsgCode.SU005.get()); + } + + /** + * 功能权限 + * + * @param authorizeList 已有权限 + * @return + */ + private AuthorizeDataReturnVO system(List authorizeList, AuthorizeVO authorizeModel) { + AuthorizeDataReturnVO vo = new AuthorizeDataReturnVO(); + List systemList = authorizeModel.getSystemList(); + // 哪些是系统的 + List collect = authorizeList.stream().filter(t -> AuthorizeConst.SYSTEM.equals(t.getItemType())).collect(Collectors.toList()); + vo.setAll(systemList.stream().map(SystemBaeModel::getId).collect(Collectors.toList())); + vo.setIds(collect.stream().map(AuthorizeEntity::getItemId).collect(Collectors.toList())); + List jsonToList = JsonUtil.getJsonToList(systemList, AuthorizeDataReturnModel.class); + vo.setList(jsonToList); + return vo; + } + + + /** + * 功能权限 + * + * @param moduleListAll 所有功能 + * @param authorizeList 已有权限 + * @param authorizeModel 权限集合 + * @param systemId 系统id + * @return + */ + private AuthorizeDataReturnVO module1(List moduleListAll, List authorizeList, AuthorizeVO authorizeModel, List systemId) { + UserInfo userInfo = UserProvider.getUser(); + AuthorizeDataReturnVO vo = new AuthorizeDataReturnVO(); + List moduleList = new ArrayList<>(); + if (!userInfo.getIsAdministrator()) { + List roleIds = new ArrayList<>(); + permissionGroupService.getPermissionGroupByUserId(userInfo.getUserId(), null, false).forEach(t -> { + roleIds.add("'" + t.getId() + "'"); + }); + if (roleIds.size() != 0) { + String roleIdsStr = String.join(",", roleIds); + moduleList = authorizeMapper.findModule(roleIdsStr, null); + } + } else { + moduleList = authorizeMapper.findModuleAdmin(1, null); + } + // 给顶级菜单设置父级节点 + moduleList.forEach(t -> { + if ("-1".equals(t.getParentId())) { + t.setParentId(t.getSystemId()); + } + }); + + // 得到系统信息放到菜单列表树种 + List systemList = authorizeModel.getSystemList(); + List collect = systemList.stream().filter(t -> systemId.contains(t.getId())).collect(Collectors.toList()); + List jsonToList = JsonUtil.getJsonToList(collect, ModuleModel.class); + jsonToList.forEach(t -> t.setParentId("-1")); + // 得到所有的东西 + List collect3 = collect.stream().map(SystemBaeModel::getId).collect(Collectors.toList()); + moduleList = moduleList.stream().filter(t -> collect3.contains(t.getSystemId())).collect(Collectors.toList()); + moduleList.addAll(jsonToList); + // 得到不同系统的appId数组 + int i = 1; + List appIds = new ArrayList<>(16); + for (SystemBaeModel systemBaeModel : collect) { + int finalI = i; + moduleList.forEach(t -> { + if ("App".equals(t.getCategory()) && systemBaeModel.getId().equals(t.getSystemId()) && "1".equals(String.valueOf(t.getType()))) { + t.setParentId("" + finalI); + } + }); + ModuleModel appData = new ModuleModel(); + appIds.add("" + i); + appData.setId("" + i); + appData.setFullName("App菜单"); + appData.setIcon("ym-custom ym-custom-cellphone"); + appData.setParentId(systemBaeModel.getId()); + moduleList.add(appData); + i++; + } + List moduleModeId = moduleList.stream().map(t -> t.getId()).collect(Collectors.toList()); + // 所有有权限的菜单 + List collect1 = authorizeList.stream().filter(t -> "module".equals(t.getItemType())).collect(Collectors.toList()); + List collect2 = collect1.stream().map(AuthorizeEntity::getItemId).collect(Collectors.toList()); + + // 再次验证菜单id是否为当前系统下的 + List list = new ArrayList<>(); + collect2.forEach(t -> { + ModuleEntity info = moduleApi.getInfo(t); + if (info != null) { + if (collect3.contains(info.getSystemId())) { + list.add(t); + } + } + }); + + // 系统id也返回 + list.addAll(collect3); + moduleModeId.addAll(list); + List treeList = JsonUtil.getJsonToList(moduleList, AuthorizeDataModel.class); + List> trees = TreeDotUtils.convertListToTreeDot(treeList, "-1"); + List data = JsonUtil.getJsonToList(trees, AuthorizeDataReturnModel.class); + vo.setAll(moduleModeId.stream().distinct().collect(Collectors.toList())); + list.addAll(appIds); + vo.setIds(list.stream().filter(t -> list.contains(t)).distinct().collect(Collectors.toList())); + vo.setList(data); + return vo; + } + + /** + * 按钮权限 + * + * @param moduleList 功能 + * @param moduleButton 按钮 + * @param authorizeList 已有权限 + * @param authorizeModel 权限集合 + * @return + */ + AuthorizeDataReturnVO moduleButton(List moduleList, List moduleButton, List authorizeList, AuthorizeVO authorizeModel) { + List treeList = new ArrayList<>(); + //appid + List appId = moduleList.stream().filter(t -> "App".equals(t.getCategory())).map(t -> t.getId()).collect(Collectors.toList()); + List buttonList = authorizeModel.getButtonList(); + List moduleModeId = moduleList.stream().map(t -> t.getId()).collect(Collectors.toList()); + List buttonModeId = buttonList.stream().map(t -> t.getModuleId()).collect(Collectors.toList()); + moduleModeId.addAll(buttonModeId); + List ids = authorizeList.stream().filter(t -> "button".equals(t.getItemType())).map(t -> t.getItemId()).collect(Collectors.toList()); + //获取按钮的菜单id + for (ModuleEntity moduleEntity : moduleList) { + for (ButtonModel buttonModel : buttonList) { + if (buttonModel.getModuleId().equals(moduleEntity.getId())) { + AuthorizeModel treeModel = new AuthorizeModel(); + treeModel.setId(buttonModel.getId()); + treeModel.setFullName(buttonModel.getFullName()); + treeModel.setIcon(buttonModel.getIcon()); + if ("-1".equals(buttonModel.getParentId())) { + treeModel.setParentId(moduleEntity.getId()); + } else { + boolean contains = buttonList.contains(buttonModel.getParentId()); + if (!contains) { + continue; + } + treeModel.setParentId(buttonModel.getParentId()); + } + treeList.add(treeModel); + } + } + } + List list = moduleList.stream().filter(t -> buttonModeId.contains(t.getId())).collect(Collectors.toList()); + List moduleListAll = JsonUtil.getJsonToList(ListToTreeUtil.treeWhere(list, moduleList), AuthorizeModel.class); + treeList.addAll(moduleListAll); + treeList = treeList.stream().sorted(Comparator.comparing(AuthorizeModel::getSortCode)).collect(Collectors.toList()); + List> trees = TreeDotUtils.convertListToTreeDot(treeList); + List data = JsonUtil.getJsonToList(trees, AuthorizeDataReturnModel.class); + List dataList = new LinkedList<>(); + List appChildList = new LinkedList<>(); + for (AuthorizeDataReturnModel model : data) { + if (appId.contains(model.getId())) { + appChildList.add(model); + } else { + dataList.add(model); + } + } + if (appChildList.size() > 0) { + AuthorizeDataReturnModel appData = new AuthorizeDataReturnModel(); + appData.setId("1"); + appData.setFullName("App菜单"); + appData.setIcon("ym-custom ym-custom-cellphone"); + appData.setChildren(appChildList); + dataList.add(appData); + } + AuthorizeDataReturnVO vo = new AuthorizeDataReturnVO(); + moduleModeId.addAll(treeList.stream().map(AuthorizeModel::getId).collect(Collectors.toList())); + vo.setAll(moduleModeId.stream().distinct().collect(Collectors.toList())); + vo.setIds(ids.stream().filter(t -> moduleModeId.contains(t)).distinct().collect(Collectors.toList())); + vo.setList(dataList); + return vo; + } + + /** + * 列表权限 + * + * @param moduleList 功能 + * @param moduleColumnList 列表 + * @param authorizeList 已有权限 + * @param authorizeModel 权限集合 + * @return + */ + AuthorizeDataReturnVO moduleColumn(List moduleList, List moduleColumnList, List authorizeList, AuthorizeVO authorizeModel) { + List treeList = new ArrayList<>(); + //appid + List appId = moduleList.stream().filter(t -> "App".equals(t.getCategory())).map(t -> t.getId()).collect(Collectors.toList()); + List columnList = authorizeModel.getColumnList(); + List moduleModeId = moduleList.stream().map(t -> t.getId()).collect(Collectors.toList()); + List columnModeId = columnList.stream().map(t -> t.getModuleId()).collect(Collectors.toList()); + moduleModeId.addAll(columnModeId); + List ids = authorizeList.stream().filter(t -> "column".equals(t.getItemType())).map(t -> t.getItemId()).collect(Collectors.toList()); + //获取按钮的菜单id + for (ModuleEntity moduleEntity : moduleList) { + for (ColumnModel columnModel : columnList) { + if (columnModel.getModuleId().equals(moduleEntity.getId())) { + AuthorizeModel treeModel = new AuthorizeModel(); + treeModel.setId(columnModel.getId()); + treeModel.setFullName(columnModel.getFullName()); + treeModel.setIcon("fa fa-tags column"); + treeModel.setParentId(columnModel.getModuleId()); + treeList.add(treeModel); + } + } + } + List list = moduleList.stream().filter(t -> columnModeId.contains(t.getId())).collect(Collectors.toList()); + List moduleListAll = JsonUtil.getJsonToList(ListToTreeUtil.treeWhere(list, moduleList), AuthorizeModel.class); + treeList.addAll(moduleListAll); + treeList = treeList.stream().sorted(Comparator.comparing(AuthorizeModel::getSortCode)).collect(Collectors.toList()); + List> trees = TreeDotUtils.convertListToTreeDot(treeList); + List data = JsonUtil.getJsonToList(trees, AuthorizeDataReturnModel.class); + List dataList = new LinkedList<>(); + List appChildList = new LinkedList<>(); + for (AuthorizeDataReturnModel model : data) { + if (appId.contains(model.getId())) { + appChildList.add(model); + } else { + dataList.add(model); + } + } + if (appChildList.size() > 0) { + AuthorizeDataReturnModel appData = new AuthorizeDataReturnModel(); + appData.setId("1"); + appData.setFullName("App菜单"); + appData.setIcon("ym-custom ym-custom-cellphone"); + appData.setChildren(appChildList); + dataList.add(appData); + } + AuthorizeDataReturnVO vo = new AuthorizeDataReturnVO(); + moduleModeId.addAll(treeList.stream().map(AuthorizeModel::getId).collect(Collectors.toList())); + vo.setAll(moduleModeId.stream().distinct().collect(Collectors.toList())); + vo.setIds(ids.stream().filter(t -> moduleModeId.contains(t)).distinct().collect(Collectors.toList())); + vo.setList(dataList); + return vo; + } + + /** + * 表单权限 + * + * @param moduleList 功能 + * @param moduleFormList 表单列表 + * @param authorizeList 已有权限 + * @param authorizeModel 权限集合 + * @return + */ + AuthorizeDataReturnVO moduleForm(List moduleList, List moduleFormList, List authorizeList, AuthorizeVO authorizeModel) { + List treeList = new ArrayList<>(); + //appid + List appId = moduleList.stream().filter(t -> "App".equals(t.getCategory())).map(t -> t.getId()).collect(Collectors.toList()); + List formList = authorizeModel.getFormsList(); + List moduleModeId = moduleList.stream().map(t -> t.getId()).collect(Collectors.toList()); + List formModeId = formList.stream().map(t -> t.getModuleId()).collect(Collectors.toList()); + moduleModeId.addAll(formModeId); + List ids = authorizeList.stream().filter(t -> "form".equals(t.getItemType())).map(t -> t.getItemId()).collect(Collectors.toList()); + //获取按钮的菜单id + for (ModuleEntity moduleEntity : moduleList) { + for (ModuleFormModel columnModel : formList) { + if (columnModel.getModuleId().equals(moduleEntity.getId())) { + AuthorizeModel treeModel = new AuthorizeModel(); + treeModel.setId(columnModel.getId()); + treeModel.setFullName(columnModel.getFullName()); + treeModel.setIcon("fa fa-binoculars resource"); + treeModel.setParentId(columnModel.getModuleId()); + treeList.add(treeModel); + } + } + } + List list = moduleList.stream().filter(t -> formModeId.contains(t.getId())).collect(Collectors.toList()); + List moduleListAll = JsonUtil.getJsonToList(ListToTreeUtil.treeWhere(list, moduleList), AuthorizeModel.class); + treeList.addAll(moduleListAll); + treeList = treeList.stream().sorted(Comparator.comparing(AuthorizeModel::getSortCode)).collect(Collectors.toList()); + List> trees = TreeDotUtils.convertListToTreeDot(treeList); + List data = JsonUtil.getJsonToList(trees, AuthorizeDataReturnModel.class); + List dataList = new LinkedList<>(); + List appChildList = new LinkedList<>(); + for (AuthorizeDataReturnModel model : data) { + if (appId.contains(model.getId())) { + appChildList.add(model); + } else { + dataList.add(model); + } + } + if (appChildList.size() > 0) { + AuthorizeDataReturnModel appData = new AuthorizeDataReturnModel(); + appData.setId("1"); + appData.setFullName("App菜单"); + appData.setIcon("ym-custom ym-custom-cellphone"); + appData.setChildren(appChildList); + dataList.add(appData); + } + AuthorizeDataReturnVO vo = new AuthorizeDataReturnVO(); + moduleModeId.addAll(treeList.stream().map(AuthorizeModel::getId).collect(Collectors.toList())); + vo.setAll(moduleModeId.stream().distinct().collect(Collectors.toList())); + vo.setIds(ids.stream().filter(t -> moduleModeId.contains(t)).distinct().collect(Collectors.toList())); + vo.setList(dataList); + return vo; + } + + /** + * 数据权限 + * + * @param moduleList 功能 + * @param moduleDataSchemeList 数据方案 + * @param authorizeList 已有权限 + * @param authorizeModel 权限集合 + * @return + */ + AuthorizeDataReturnVO resourceData(List moduleList, List moduleDataSchemeList, List authorizeList, AuthorizeVO authorizeModel) { + List treeList = new ArrayList<>(); + //appid + List appId = moduleList.stream().filter(t -> "App".equals(t.getCategory())).map(t -> t.getId()).collect(Collectors.toList()); + List resourceList = authorizeModel.getResourceList(); + List moduleModeId = moduleList.stream().map(t -> t.getId()).collect(Collectors.toList()); + List resourceModeId = resourceList.stream().map(t -> t.getModuleId()).collect(Collectors.toList()); + moduleModeId.addAll(resourceModeId); + List ids = authorizeList.stream().filter(t -> "resource".equals(t.getItemType())).map(t -> t.getItemId()).collect(Collectors.toList()); + //获取按钮的菜单id + for (ModuleEntity moduleEntity : moduleList) { + for (ResourceModel resourceModel : resourceList) { + if (resourceModel.getModuleId().equals(moduleEntity.getId())) { + AuthorizeModel treeModel = new AuthorizeModel(); + treeModel.setId(resourceModel.getId()); + treeModel.setFullName(resourceModel.getFullName()); + treeModel.setIcon("fa fa-binoculars resource"); + treeModel.setParentId(resourceModel.getModuleId()); + treeList.add(treeModel); + } + } + } + List list = moduleList.stream().filter(t -> resourceModeId.contains(t.getId())).collect(Collectors.toList()); + List moduleListAll = JsonUtil.getJsonToList(ListToTreeUtil.treeWhere(list, moduleList), AuthorizeModel.class); + treeList.addAll(moduleListAll); + treeList = treeList.stream().sorted(Comparator.comparing(AuthorizeModel::getSortCode)).collect(Collectors.toList()); + List> trees = TreeDotUtils.convertListToTreeDot(treeList); + List data = JsonUtil.getJsonToList(trees, AuthorizeDataReturnModel.class); + List dataList = new LinkedList<>(); + List appChildList = new LinkedList<>(); + for (AuthorizeDataReturnModel model : data) { + if (appId.contains(model.getId())) { + appChildList.add(model); + } else { + dataList.add(model); + } + } + if (appChildList.size() > 0) { + AuthorizeDataReturnModel appData = new AuthorizeDataReturnModel(); + appData.setId("1"); + appData.setFullName("App菜单"); + appData.setIcon("ym-custom ym-custom-cellphone"); + appData.setChildren(appChildList); + dataList.add(appData); + } + AuthorizeDataReturnVO vo = new AuthorizeDataReturnVO(); + moduleModeId.addAll(treeList.stream().map(AuthorizeModel::getId).collect(Collectors.toList())); + vo.setAll(moduleModeId.stream().distinct().collect(Collectors.toList())); + vo.setIds(ids.stream().filter(t -> moduleModeId.contains(t)).distinct().collect(Collectors.toList())); + vo.setList(dataList); + return vo; + } + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/GroupController.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/GroupController.java new file mode 100644 index 0000000..b5122d3 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/GroupController.java @@ -0,0 +1,254 @@ +package jnpf.permission.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import jnpf.base.controller.SuperController; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.Pagination; +import jnpf.base.entity.DictionaryDataEntity; +import jnpf.base.service.DictionaryDataService; +import jnpf.base.service.DictionaryTypeService; +import jnpf.base.vo.ListVO; +import jnpf.base.vo.PageListVO; +import jnpf.base.vo.PaginationVO; +import jnpf.constant.MsgCode; +import jnpf.permission.entity.GroupEntity; +import jnpf.permission.model.user.mod.UserIdModel; +import jnpf.permission.model.usergroup.*; +import jnpf.permission.service.GroupService; +import jnpf.util.JsonUtil; +import jnpf.util.enums.DictionaryDataEnum; +import jnpf.util.treeutil.SumTree; +import jnpf.util.treeutil.newtreeutil.TreeDotUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.ArrayList; +import java.util.List; + +/** + * 分组管理控制器 + * + * @author :JNPF开发平台组 + * @version: V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date :2022/3/10 17:57 + */ +@RestController +@Tag(name = "分组管理", description = "UserGroupController") +@RequestMapping("/api/permission/Group") +public class GroupController extends SuperController { + + @Autowired + private GroupService userGroupService; + @Autowired + private DictionaryDataService dictionaryDataApi; + @Autowired + private DictionaryTypeService dictionaryTypeApi; + + /** + * 获取分组管理列表 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "获取分组管理列表") + @SaCheckPermission(value = {"permission.group"}) + @GetMapping + public ActionResult> list(Pagination pagination) { + List list = userGroupService.getList(pagination); + List jsonToList = JsonUtil.getJsonToList(list, GroupPaginationVO.class); + // 通过数据字典获取类型 + List dictionaryDataEntities = dictionaryDataApi.getList(dictionaryTypeApi.getInfoByEnCode(DictionaryDataEnum.PERMISSION_GROUP.getDictionaryTypeId()).getId()); + for (GroupPaginationVO userGroupPaginationVO : jsonToList) { + DictionaryDataEntity dictionaryDataEntity = dictionaryDataEntities.stream().filter(t -> t.getId().equals(userGroupPaginationVO.getType())).findFirst().orElse(null); + userGroupPaginationVO.setType(dictionaryDataEntity != null ? dictionaryDataEntity.getFullName() : userGroupPaginationVO.getId()); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(jsonToList, paginationVO); + } + + /** + * 获取分组管理下拉框 + * @return + */ + @Operation(summary = "获取分组管理下拉框") + @GetMapping("/Selector") + public ActionResult> selector() { + List tree = new ArrayList<>(); + List data = userGroupService.list(); + List dataEntityList = dictionaryDataApi.getList(dictionaryTypeApi.getInfoByEnCode(DictionaryDataEnum.PERMISSION_GROUP.getDictionaryTypeId()).getId()); + // 获取分组管理外层菜单 + for (DictionaryDataEntity dictionaryDataEntity : dataEntityList) { + GroupTreeModel firstModel = JsonUtil.getJsonToBean(dictionaryDataEntity, GroupTreeModel.class); + firstModel.setId(dictionaryDataEntity.getId()); + firstModel.setType("0"); + long num = data.stream().filter(t -> t.getType().equals(dictionaryDataEntity.getId())).count(); + firstModel.setNum(num); + if (num > 0) { + tree.add(firstModel); + } + } + for (GroupEntity entity : data) { + GroupTreeModel treeModel = JsonUtil.getJsonToBean(entity, GroupTreeModel.class); + treeModel.setType("group"); + treeModel.setParentId(entity.getType()); + treeModel.setIcon("icon-ym icon-ym-generator-group1"); + treeModel.setId(entity.getId()); + DictionaryDataEntity dataEntity = dictionaryDataApi.getInfo(entity.getType()); + if (dataEntity != null) { + tree.add(treeModel); + } + } + List> sumTrees = TreeDotUtils.convertListToTreeDot(tree); + List list = JsonUtil.getJsonToList(sumTrees, GroupSelectorVO.class); + ListVO vo = new ListVO<>(); + vo.setList(list); + return ActionResult.success(list); + } + + /** + * 自定义范围获取分组下拉框 + * + * @param idModel 岗位选择模型 + * @return + */ + @Operation(summary = "自定义范围获取分组下拉框") + @Parameters({ + @Parameter(name = "positionConditionModel", description = "岗位选择模型", required = true) + }) + @PostMapping("/GroupCondition") + public ActionResult> positionCondition(@RequestBody UserIdModel idModel) { + List data = userGroupService.getListByIds(idModel.getIds(), true); + List tree = new ArrayList<>(); + List dataEntityList = dictionaryDataApi.getListByTypeDataCode(DictionaryDataEnum.PERMISSION_GROUP.getDictionaryTypeId()); + // 获取分组管理外层菜单 + for (DictionaryDataEntity dictionaryDataEntity : dataEntityList) { + GroupTreeModel firstModel = JsonUtil.getJsonToBean(dictionaryDataEntity, GroupTreeModel.class); + firstModel.setId(dictionaryDataEntity.getId()); + firstModel.setType("0"); + long num = data.stream().filter(t -> t.getType().equals(dictionaryDataEntity.getId())).count(); + firstModel.setNum(num); + if (num > 0) { + tree.add(firstModel); + } + } + for (GroupEntity entity : data) { + GroupTreeModel treeModel = JsonUtil.getJsonToBean(entity, GroupTreeModel.class); + treeModel.setType("group"); + treeModel.setParentId(entity.getType()); + treeModel.setIcon("icon-ym icon-ym-generator-group1"); + treeModel.setId(entity.getId()); + DictionaryDataEntity dataEntity = dictionaryDataApi.getInfo(entity.getType()); + if (dataEntity != null) { + tree.add(treeModel); + } + } + List> sumTrees = TreeDotUtils.convertListToTreeDot(tree); + List list = JsonUtil.getJsonToList(sumTrees, GroupSelectorVO.class); + ListVO vo = new ListVO<>(); + vo.setList(list); + return ActionResult.success(vo); + } + + /** + * 信息 + * + * @param id 主键 + * @return + */ + @Operation(summary = "信息") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission(value = {"permission.group"}) + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) { + GroupEntity entity = userGroupService.getInfo(id); + GroupInfoVO vo = JsonUtil.getJsonToBean(entity, GroupInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 创建 + * + * @param userGroupCrForm 新建模型 + * @return + */ + @Operation(summary = "创建") + @Parameters({ + @Parameter(name = "userGroupCrForm", description = "新建模型", required = true) + }) + @SaCheckPermission(value = {"permission.group"}) + @PostMapping + public ActionResult create(@RequestBody @Valid GroupCrForm userGroupCrForm) { + GroupEntity entity = JsonUtil.getJsonToBean(userGroupCrForm, GroupEntity.class); + // 判断名称是否重复 + if (userGroupService.isExistByFullName(entity.getFullName(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + // 判断编码是否重复 + if (userGroupService.isExistByEnCode(entity.getEnCode(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + userGroupService.crete(entity); + return ActionResult.success("创建成功"); + } + + /** + * 更新 + * + * @param id 主键 + * @param userGroupUpForm 修改模型 + * @return + */ + @Operation(summary = "更新") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "userGroupUpForm", description = "修改模型", required = true) + }) + @SaCheckPermission(value = {"permission.group"}) + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid GroupUpForm userGroupUpForm) { + GroupEntity entity = JsonUtil.getJsonToBean(userGroupUpForm, GroupEntity.class); + // 判断名称是否重复 + if (userGroupService.isExistByFullName(entity.getFullName(), id)) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + // 判断编码是否重复 + if (userGroupService.isExistByEnCode(entity.getEnCode(), id)) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + Boolean flag = userGroupService.update(id, entity); + if (!flag) { + return ActionResult.fail(MsgCode.FA013.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除 + * + * @param id 主键 + * @return + */ + @Operation(summary = "删除") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission(value = {"permission.group"}) + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + GroupEntity entity = userGroupService.getInfo(id); + if (entity != null) { + userGroupService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/OrganizeAdministratorController.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/OrganizeAdministratorController.java new file mode 100644 index 0000000..3e859b1 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/OrganizeAdministratorController.java @@ -0,0 +1,950 @@ +package jnpf.permission.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import jnpf.base.controller.SuperController; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.Pagination; +import jnpf.base.entity.ModuleEntity; +import jnpf.base.entity.SystemEntity; +import jnpf.base.service.ModuleService; +import jnpf.base.service.SystemService; +import jnpf.base.vo.PageListVO; +import jnpf.base.vo.PaginationVO; +import jnpf.constant.JnpfConst; +import jnpf.constant.MsgCode; +import jnpf.constant.PermissionConst; +import jnpf.permission.entity.OrganizeAdministratorEntity; +import jnpf.permission.entity.OrganizeEntity; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.model.organizeadministrator.*; +import jnpf.permission.service.OrganizeAdministratorService; +import jnpf.permission.service.OrganizeService; +import jnpf.permission.service.UserService; +import jnpf.util.*; +import jnpf.util.treeutil.SumTree; +import jnpf.util.treeutil.newtreeutil.TreeDotUtils; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.*; +import java.util.stream.Collectors; + + +/** + * 机构分级管理员 + * + * @author JNPF + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021-08-30 10:30:04 + */ +@Tag(name = "机构分级管理员", description = "organizeAdminIsTrator") +@Slf4j +@RestController +@RequestMapping("/api/permission/organizeAdminIsTrator") +public class OrganizeAdministratorController extends SuperController { + + @Autowired + private OrganizeAdministratorService organizeAdminIsTratorService; + @Autowired + private OrganizeService organizeService; + @Autowired + private UserProvider userProvider; + @Autowired + private SystemService systemApi; + @Autowired + private ModuleService moduleApi; + @Autowired + private UserService userService; + + /** + * 获取分级管理员列表 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "获取分级管理员列表") + @SaCheckPermission(value = {"permission.grade"}) + @GetMapping + public ActionResult> list(Pagination pagination) { + List list = organizeAdminIsTratorService.getList(pagination); + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(list, paginationVO); + } + + /** + * 保存分级管理员 + * + * @param organizeAdminIsTratorCrForm 新建模型 + * @return + */ + @Operation(summary = "保存分级管理员") + @Parameters({ + @Parameter(name = "organizeAdminIsTratorCrForm", description = "新建模型", required = true) + }) + @SaCheckPermission(value = {"permission.grade"}) + @PostMapping + public ActionResult save(@RequestBody @Valid OrganizeAdminIsTratorCrForm organizeAdminIsTratorCrForm) { + String userId = organizeAdminIsTratorCrForm.getUserId(); + if (UserProvider.getLoginUserId().equals(userId)) { + return ActionResult.fail("无法设置当前用户操作权限"); + } + List list = new ArrayList<>(16); + // 递归得到所有的数组 + getOrganizeAdminIsTratorModel(list, organizeAdminIsTratorCrForm.getOrgAdminModel()); + List jsonToList = JsonUtil.getJsonToList(list, OrganizeAdministratorEntity.class); + // 处理应用 + List systemIds = organizeAdminIsTratorCrForm.getSystemIds(); + systemIds.forEach(t -> { + OrganizeAdministratorEntity entity = new OrganizeAdministratorEntity(); + entity.setOrganizeType(jnpf.constant.PermissionConst.SYSTEM); + entity.setOrganizeId(t); + entity.setThisLayerSelect(1); + jsonToList.add(entity); + }); + // 处理菜单 + List moduleIds = organizeAdminIsTratorCrForm.getModuleIds(); + moduleIds.forEach(t -> { + OrganizeAdministratorEntity entity = new OrganizeAdministratorEntity(); + entity.setOrganizeType(jnpf.constant.PermissionConst.MODULE); + entity.setOrganizeId(t); + entity.setThisLayerSelect(1); + jsonToList.add(entity); + }); + organizeAdminIsTratorService.createList(jsonToList, userId); + return ActionResult.success("保存成功"); + } + + /** + * 获取 + * + * @param list + * @param jsonToList + */ + private void getOrganizeAdminIsTratorModel(List list, List jsonToList) { + if (jsonToList != null) { + jsonToList.forEach(t -> { + OrganizeAdministratorCrModel vo = JsonUtil.getJsonToBean(t, OrganizeAdministratorCrModel.class); + vo.setChildren(null); + if (vo.getThisLayerSelect() != null && (vo.getThisLayerSelect() == 2 || vo.getThisLayerSelect() == 1)) { + vo.setThisLayerSelect(1); + if (vo.getThisLayerAdd() != null && (vo.getThisLayerAdd() == 2 || vo.getThisLayerAdd() == 1)) { + vo.setThisLayerAdd(1); + } + if (vo.getThisLayerEdit() != null && (vo.getThisLayerEdit() == 2 || vo.getThisLayerEdit() == 1)) { + vo.setThisLayerEdit(1); + } + if (vo.getThisLayerDelete() != null && (vo.getThisLayerDelete() == 2 || vo.getThisLayerDelete() == 1)) { + vo.setThisLayerDelete(1); + } + } else if (vo.getThisLayerSelect() == null || vo.getThisLayerSelect() == 0 || vo.getThisLayerSelect() == 3) { + vo.setThisLayerSelect(0); + vo.setThisLayerAdd(0); + vo.setThisLayerEdit(0); + vo.setThisLayerDelete(0); + } + if (vo.getSubLayerSelect() != null && (vo.getSubLayerSelect() == 2 || vo.getSubLayerSelect() == 1)) { + vo.setSubLayerSelect(1); + if (vo.getSubLayerAdd() != null && (vo.getSubLayerAdd() == 2 || vo.getSubLayerAdd() == 1)) { + vo.setSubLayerAdd(1); + } + if (vo.getSubLayerEdit() != null && (vo.getSubLayerEdit() == 2 || vo.getSubLayerEdit() == 1)) { + vo.setSubLayerEdit(1); + } + if (vo.getSubLayerDelete() != null && (vo.getSubLayerDelete() == 2 || vo.getSubLayerDelete() == 1)) { + vo.setSubLayerDelete(1); + } + } else if (vo.getSubLayerSelect() == null || vo.getSubLayerSelect() == 0 || vo.getSubLayerSelect() == 3) { + vo.setSubLayerSelect(0); + vo.setSubLayerAdd(0); + vo.setSubLayerEdit(0); + vo.setSubLayerDelete(0); + } + list.add(vo); + getOrganizeAdminIsTratorModel(list, t.getChildren()); + }); + } + } + + /** + * 删除二级管理员 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "删除二级管理员") + @Parameters({ + @Parameter(name = "id", description = "用户id", required = true) + }) + @SaCheckPermission(value = {"permission.grade"}) + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + organizeAdminIsTratorService.deleteByUserId(id); + return ActionResult.success(MsgCode.SU003.get()); + } + + /** + * 获取组织下拉框列表 + * + * @param userId 用户id + * @return + */ + @Operation(summary = "获取组织下拉框列表") + @SaCheckPermission(value = {"permission.grade"}) + @GetMapping("/Selector") + public ActionResult getSelector(String userId) { + if (StringUtil.isNotEmpty(userId)) { + if (userId.equals(UserProvider.getLoginUserId())) { + return ActionResult.fail("无法设置当前用户为分级管理员"); + } + UserEntity userEntity = userService.getInfo(userId); + if (userEntity != null && Objects.equals(userEntity.getIsAdministrator(), 1)) { + return ActionResult.fail("无法设置超管为分级管理员"); + } + } + OrganizeAdministratorSelectedVO vo = new OrganizeAdministratorSelectedVO(); + List systemPermissionList = new ArrayList<>(); + List moduleVOPermissionList = new ArrayList<>(); + List modulePermissionList = new ArrayList<>(); + List moduleSelectedList = new ArrayList<>(); + List systemSelectedList = new ArrayList<>(); + // 存储组织集合 + List organizeList = organizeService.getList(false); + // 获取所有组织 + List selectorModels = JsonUtil.getJsonToList(organizeList, OrganizeAdministratorSelectorModel.class); + // 获取应用列表 + List list = systemApi.getList(null, false, true, true, false); + List systemSelectorVOList = JsonUtil.getJsonToList(list, SystemSelectorVO.class); + systemSelectorVOList.forEach(t -> t.setIsPermission(0)); + // 菜单 + SystemEntity mainSystem = systemApi.getInfoByEnCode(JnpfConst.MAIN_SYSTEM_CODE); + List mainModule = moduleApi.getMainModule(); + List allModule = new ArrayList<>(mainModule); + List moduleSelectorVOList = JsonUtil.getJsonToList(mainModule, ModuleSelectorModel.class); + List allModuleSelectorVOList = JsonUtil.getJsonToList(allModule, ModuleSelectorModel.class); + + boolean isAdministrator = userProvider.get().getIsAdministrator(); + if (isAdministrator) { + selectorModels.forEach(t -> { + // 设置组织id + t.setOrganizeId(t.getId()); + t.setThisLayerAdd(0); + t.setThisLayerEdit(0); + t.setThisLayerDelete(0); + t.setThisLayerSelect(0); + t.setSubLayerAdd(0); + t.setSubLayerEdit(0); + t.setSubLayerDelete(0); + t.setSubLayerSelect(0); + }); + moduleSelectorVOList.forEach(t -> t.setIsPermission(0)); + } else { + List organizeAdministratorEntity = organizeAdminIsTratorService.getOrganizeAdministratorEntity(UserProvider.getLoginUserId(), jnpf.constant.PermissionConst.ORGANIZE, false); + List organizeAdministratorEntitys = new ArrayList<>(organizeAdministratorEntity); + // 处理子组织权限 + organizeAdministratorEntitys.forEach(t -> { + if (t.getSubLayerSelect() != null && t.getSubLayerSelect() == 1) { + // 得到组织id + List underOrganizations = organizeService.getUnderOrganizations(t.getOrganizeId(), false); + underOrganizations.forEach(uo -> { + OrganizeAdministratorEntity organizeAdministratorEntity1 = organizeAdministratorEntity.stream().filter(oae -> uo.equals(oae.getOrganizeId())).findFirst().orElse(null); + if (organizeAdministratorEntity1 != null) { + organizeAdministratorEntity1.setThisLayerSelect(1); + organizeAdministratorEntity1.setSubLayerSelect(1); + } + }); + if (t.getSubLayerAdd() != null && t.getSubLayerAdd() == 1) { + underOrganizations.forEach(uo -> { + OrganizeAdministratorEntity organizeAdministratorEntity1 = organizeAdministratorEntity.stream().filter(oae -> uo.equals(oae.getOrganizeId())).findFirst().orElse(null); + if (organizeAdministratorEntity1 != null) { + organizeAdministratorEntity1.setThisLayerAdd(1); + organizeAdministratorEntity1.setSubLayerAdd(1); + } + }); + } + if (t.getSubLayerEdit() != null && t.getSubLayerEdit() == 1) { + underOrganizations.forEach(uo -> { + OrganizeAdministratorEntity organizeAdministratorEntity1 = organizeAdministratorEntity.stream().filter(oae -> uo.equals(oae.getOrganizeId())).findFirst().orElse(null); + if (organizeAdministratorEntity1 != null) { + organizeAdministratorEntity1.setThisLayerEdit(1); + organizeAdministratorEntity1.setSubLayerEdit(1); + } + }); + } + if (t.getSubLayerDelete() != null && t.getSubLayerDelete() == 1) { + underOrganizations.forEach(uo -> { + OrganizeAdministratorEntity organizeAdministratorEntity1 = organizeAdministratorEntity.stream().filter(oae -> uo.equals(oae.getOrganizeId())).findFirst().orElse(null); + if (organizeAdministratorEntity1 != null) { + organizeAdministratorEntity1.setThisLayerDelete(1); + organizeAdministratorEntity1.setSubLayerDelete(1); + } + }); + } + } + }); + + List selectorModelss = new ArrayList<>(16); + selectorModels.forEach(t -> { + // 设置组织id + t.setOrganizeId(t.getId()); + OrganizeAdministratorEntity administratorEntity = organizeAdministratorEntity.stream().filter(tt -> t.getOrganizeId().equals(tt.getOrganizeId())).findFirst().orElse(null); + if (administratorEntity != null) { + boolean flag = false; + if (administratorEntity.getThisLayerSelect() != null && administratorEntity.getThisLayerSelect() == 1) { + t.setThisLayerSelect(0); + flag = true; + if (administratorEntity.getThisLayerAdd() == 1) { + t.setThisLayerAdd(0); + } + if (administratorEntity.getThisLayerEdit() == 1) { + t.setThisLayerEdit(0); + } + if (administratorEntity.getThisLayerDelete() == 1) { + t.setThisLayerDelete(0); + } + } + if (administratorEntity.getSubLayerSelect()!= null && administratorEntity.getSubLayerSelect() == 1) { + t.setSubLayerSelect(0); + flag = true; + if (administratorEntity.getSubLayerAdd()!= null && administratorEntity.getSubLayerAdd() == 1) { + t.setSubLayerAdd(0); + } + if (administratorEntity.getSubLayerEdit()!= null && administratorEntity.getSubLayerEdit() == 1) { + t.setSubLayerEdit(0); + } + if (administratorEntity.getSubLayerDelete()!= null && administratorEntity.getSubLayerDelete() == 1) { + t.setSubLayerDelete(0); + } + } + if (flag) { + selectorModelss.add(t); + } + } + }); + selectorModels = selectorModelss; + + List moduleOrganizeAdministratorEntity = organizeAdminIsTratorService.getOrganizeAdministratorEntity(UserProvider.getLoginUserId(), jnpf.constant.PermissionConst.MODULE, false); + List moduleIds = moduleOrganizeAdministratorEntity.stream().map(OrganizeAdministratorEntity::getOrganizeId).collect(Collectors.toList()); + List moduleByIds = moduleApi.getModuleByIds(moduleIds); + List moduleSelectorVOLists = JsonUtil.getJsonToList(moduleByIds, ModuleSelectorModel.class); + moduleSelectorVOList = moduleSelectorVOLists; + +// List systemOrganizeAdministratorEntity = organizeAdminIsTratorService.getOrganizeAdministratorEntity(UserProvider.getLoginUserId(), true, PermissionConst.SYSTEM); + + } + // 判断是否为空 + if (StringUtil.isNotEmpty(userId)) { + List organizeAdministratorEntity = organizeAdminIsTratorService.getOrganizeAdministratorEntity(userId, jnpf.constant.PermissionConst.ORGANIZE, false); + // 处理子组织字段 + List finalSelectorModels3 = selectorModels; + organizeAdministratorEntity.forEach(t -> { + if (!isAdministrator) { + if (t.getSubLayerSelect() != null && t.getSubLayerSelect() == 1) { + // 得到组织id + List underOrganizations = organizeService.getUnderOrganizations(t.getOrganizeId(), false); + // 将同样的组织id的数据先处理好 + List collect1 = finalSelectorModels3.stream().filter(fsm -> underOrganizations.contains(fsm.getOrganizeId())).collect(Collectors.toList()); + collect1.forEach(cl -> { + OrganizeAdministratorSelectorModel organizeAdministratorSelectorModel = finalSelectorModels3.stream().filter(fms -> fms.getOrganizeId().equals(cl.getOrganizeId())).findFirst().orElse(null); + if (organizeAdministratorSelectorModel != null) { + if (organizeAdministratorSelectorModel.getThisLayerSelect() != null && organizeAdministratorSelectorModel.getThisLayerSelect() == 0) { + organizeAdministratorSelectorModel.setThisLayerSelect(0); + } else { + organizeAdministratorSelectorModel.setThisLayerSelect(3); + } + if (organizeAdministratorSelectorModel.getSubLayerSelect() != null && organizeAdministratorSelectorModel.getSubLayerSelect() == 0) { + organizeAdministratorSelectorModel.setSubLayerSelect(0); + } else { + organizeAdministratorSelectorModel.setSubLayerSelect(3); + } + } + }); + // 当前模型包含组织id + List collect = underOrganizations.stream().filter(uo -> !finalSelectorModels3.stream().map(OrganizeAdministratorSelectorModel::getOrganizeId).collect(Collectors.toList()).contains(uo)).collect(Collectors.toList()); + collect.forEach(cl -> { + OrganizeAdministratorEntity organizeAdministratorEntity1 = organizeAdministratorEntity.stream().filter(oa -> oa.getOrganizeId().equals(cl)).findFirst().orElse(null); + if (organizeAdministratorEntity1 != null) { + OrganizeEntity info = organizeService.getInfo(organizeAdministratorEntity1.getOrganizeId()); + OrganizeAdministratorSelectorModel organizeAdministratorSelectorModel = JsonUtil.getJsonToBean(info, OrganizeAdministratorSelectorModel.class); + organizeAdministratorSelectorModel.setOrganizeId(organizeAdministratorEntity1.getOrganizeId()); + organizeAdministratorSelectorModel.setThisLayerSelect(3); + organizeAdministratorSelectorModel.setSubLayerSelect(3); + finalSelectorModels3.add(organizeAdministratorSelectorModel); + } + }); + } + } + }); + List finalSelectorModels = new ArrayList<>(selectorModels); + List finalSelectorModels1 = new ArrayList<>(selectorModels); + organizeAdministratorEntity.forEach(t -> { + // 我没有他有时,需要判断此组织是否跟我所管理的组织相同,不同则需要放进去 + OrganizeAdministratorSelectorModel organizeAdministratorSelectorModel = finalSelectorModels.stream().filter(selectorModel -> selectorModel.getOrganizeId().equals(t.getOrganizeId())).findFirst().orElse(null); + if (organizeAdministratorSelectorModel == null) { + boolean flag = false; + if (t.getThisLayerSelect() != null) { + if (t.getThisLayerSelect() == 1) { + t.setThisLayerSelect(2); + flag = true; + if (flag && t.getThisLayerAdd() != null && t.getThisLayerAdd() == 1) { + t.setThisLayerAdd(2); + } else if (t.getThisLayerAdd() != null) { + t.setThisLayerAdd(null); + } + if (flag && t.getThisLayerEdit() != null && t.getThisLayerEdit() == 1) { + t.setThisLayerEdit(2); + } else if (t.getThisLayerEdit() != null) { + t.setThisLayerEdit(null); + } + if (flag && t.getThisLayerDelete() != null && t.getThisLayerDelete() == 1) { + t.setThisLayerDelete(2); + } else if (t.getThisLayerDelete() != null) { + t.setThisLayerDelete(null); + } + } else { + t.setThisLayerSelect(null); + t.setThisLayerAdd(null); + t.setThisLayerEdit(null); + t.setThisLayerDelete(null); + } + } + boolean flag1 = false; + if (t.getSubLayerSelect() != null) { + if (t.getSubLayerSelect() == 1) { + t.setSubLayerSelect(2); + flag1 = true; + if (flag1 && t.getSubLayerAdd() != null && t.getSubLayerAdd() == 1) { + t.setSubLayerAdd(2); + } else if (t.getSubLayerAdd() != null) { + t.setSubLayerAdd(null); + } + if (flag1 && t.getSubLayerEdit() != null && t.getSubLayerEdit() == 1) { + t.setSubLayerEdit(2); + } else if (t.getSubLayerEdit() != null) { + t.setSubLayerEdit(null); + } + if (flag1 && t.getSubLayerDelete() != null && t.getSubLayerDelete() == 1) { + t.setSubLayerDelete(2); + } else if (t.getSubLayerDelete() != null) { + t.setSubLayerDelete(null); + } + } else { + t.setSubLayerSelect(null); + t.setSubLayerAdd(null); + t.setSubLayerEdit(null); + t.setSubLayerDelete(null); + } + } + if (flag || flag1) { + OrganizeAdministratorSelectorModel jsonToBean = JsonUtil.getJsonToBean(t, OrganizeAdministratorSelectorModel.class); + OrganizeEntity info = organizeService.getInfo(t.getOrganizeId()); + if (info != null) { + jsonToBean.setParentId(info.getParentId()); + jsonToBean.setId(info.getId()); + jsonToBean.setCategory(info.getCategory()); + jsonToBean.setIcon(jnpf.constant.PermissionConst.COMPANY.equals(info.getCategory()) ? "icon-ym icon-ym-tree-organization3" : "icon-ym icon-ym-tree-department1"); + jsonToBean.setOrganizeId(t.getOrganizeId()); + jsonToBean.setOrganizeIdTree(info.getOrganizeIdTree()); + jsonToBean.setFullName(info.getFullName()); + finalSelectorModels1.add(jsonToBean); + } + } + } + }); + organizeAdministratorEntity.forEach(t -> { + finalSelectorModels1.forEach(fs -> { + if (t.getOrganizeId().equals(fs.getOrganizeId())) { + // 本层添加 + if (fs.getThisLayerAdd() != null) { + if (fs.getThisLayerAdd() == 0) { + if (t.getThisLayerAdd() != null) { + if (t.getThisLayerAdd() == 1) { + fs.setThisLayerAdd(1); + } else { + fs.setThisLayerAdd(0); + } + } + } else if (fs.getThisLayerAdd() == 3) { + if (t.getThisLayerAdd() != null) { + if (t.getThisLayerAdd() == 1) { + fs.setThisLayerAdd(1); + } else { + fs.setThisLayerAdd(3); + } + } + } else { + if (t.getThisLayerAdd() != null) { + if (t.getThisLayerAdd() == 1) { + if (isAdministrator) { + fs.setThisLayerAdd(1); + } else { + fs.setThisLayerAdd(2); + } + } + } + } + } else { + if (t.getThisLayerAdd() != null) { + if (t.getThisLayerAdd() == 1) { + if (isAdministrator) { + fs.setThisLayerAdd(1); + } else { + fs.setThisLayerAdd(2); + } + } + } + } + // 本层编辑 + if (fs.getThisLayerEdit() != null) { + if (fs.getThisLayerEdit() == 0) { + if (t.getThisLayerEdit() != null) { + if (t.getThisLayerEdit() == 1) { + fs.setThisLayerEdit(1); + } else { + fs.setThisLayerEdit(0); + } + } + } else if (fs.getThisLayerEdit() == 3) { + if (t.getThisLayerEdit() != null) { + if (t.getThisLayerEdit() == 1) { + fs.setThisLayerEdit(1); + } else { + fs.setThisLayerEdit(3); + } + } + } else { + if (t.getThisLayerEdit() != null) { + if (t.getThisLayerEdit() == 1) { + if (isAdministrator) { + fs.setThisLayerEdit(1); + } else { + fs.setThisLayerEdit(2); + } + } + } + } + } else { + if (t.getThisLayerEdit() != null) { + if (t.getThisLayerEdit() == 1) { + if (isAdministrator) { + fs.setThisLayerEdit(1); + } else { + fs.setThisLayerEdit(2); + } + } + } + } + // 本层删除 + if (fs.getThisLayerDelete() != null) { + if (fs.getThisLayerDelete() == 0) { + if (t.getThisLayerDelete() != null) { + if (t.getThisLayerDelete() == 1) { + fs.setThisLayerDelete(1); + } else { + fs.setThisLayerDelete(0); + } + } + } else if (fs.getThisLayerDelete() == 3) { + if (t.getThisLayerDelete() != null) { + if (t.getThisLayerDelete() == 1) { + fs.setThisLayerDelete(1); + } else { + fs.setThisLayerDelete(3); + } + } + } else { + if (t.getThisLayerDelete() != null) { + if (t.getThisLayerDelete() == 1) { + if (isAdministrator) { + fs.setThisLayerDelete(1); + } else { + fs.setThisLayerDelete(2); + } + } + } + } + } else { + if (t.getThisLayerDelete() != null) { + if (t.getThisLayerDelete() == 1) { + if (isAdministrator) { + fs.setThisLayerDelete(1); + } else { + fs.setThisLayerDelete(2); + } + } + } + } + // 本层查看 + if (fs.getThisLayerSelect() != null) { + if (fs.getThisLayerSelect() == 0) { + if (t.getThisLayerSelect() != null) { + if (t.getThisLayerSelect() == 1) { + fs.setThisLayerSelect(1); + } else { + fs.setThisLayerSelect(0); + } + } + } else if (fs.getThisLayerSelect() == 3) { + if (t.getThisLayerSelect() != null) { + if (t.getThisLayerSelect() == 1) { + fs.setThisLayerSelect(1); + } else { + fs.setThisLayerSelect(3); + } + } + } else { + if (t.getThisLayerSelect() != null) { + if (t.getThisLayerSelect() == 1) { + if (isAdministrator) { + fs.setThisLayerSelect(1); + } else { + fs.setThisLayerSelect(2); + } + } + } + } + } else { + if (t.getThisLayerSelect() != null) { + if (t.getThisLayerSelect() == 1) { + if (isAdministrator) { + fs.setThisLayerSelect(1); + } else { + fs.setThisLayerSelect(2); + } + } + } + } + // 子层添加 + if (fs.getSubLayerAdd() != null) { + if (fs.getSubLayerAdd() == 0) { + if (t.getSubLayerAdd() != null) { + if (t.getSubLayerAdd() == 1) { + fs.setSubLayerAdd(1); + } else { + fs.setSubLayerAdd(0); + } + } + } else if (fs.getSubLayerAdd() == 3) { + if (t.getSubLayerAdd() != null) { + if (t.getSubLayerAdd() == 1) { + fs.setSubLayerAdd(1); + } else { + fs.setSubLayerAdd(3); + } + } + } else { + if (t.getSubLayerAdd() != null) { + if (t.getSubLayerAdd() == 1) { + if (isAdministrator) { + fs.setSubLayerAdd(1); + } else { + fs.setSubLayerAdd(2); + } + } + } + } + } else { + if (t.getSubLayerAdd() != null) { + if (t.getSubLayerAdd() == 1) { + if (isAdministrator) { + fs.setSubLayerAdd(1); + } else { + fs.setSubLayerAdd(2); + } + } + } + } + + if (fs.getSubLayerEdit() != null) { + if (fs.getSubLayerEdit() == 0) { + if (t.getSubLayerEdit() != null) { + if (t.getSubLayerEdit() == 1) { + fs.setSubLayerEdit(1); + } else { + fs.setSubLayerEdit(0); + } + } + } else if (fs.getSubLayerEdit() == 3) { + if (t.getSubLayerEdit() != null) { + if (t.getSubLayerEdit() == 1) { + fs.setSubLayerEdit(1); + } else { + fs.setSubLayerEdit(3); + } + } + } else { + if (t.getSubLayerEdit() != null) { + if (t.getSubLayerEdit() == 1) { + if (isAdministrator) { + fs.setSubLayerEdit(1); + } else { + fs.setSubLayerEdit(2); + } + } + } + } + } else { + if (t.getSubLayerEdit() != null) { + if (t.getSubLayerEdit() == 1) { + if (isAdministrator) { + fs.setSubLayerEdit(1); + } else { + fs.setSubLayerEdit(2); + } + } + } + } + + if (fs.getSubLayerDelete() != null) { + if (fs.getSubLayerDelete() == 0) { + if (t.getSubLayerDelete() != null) { + if (t.getSubLayerDelete() == 1) { + fs.setSubLayerDelete(1); + } else { + fs.setSubLayerDelete(0); + } + } + } else if (fs.getSubLayerDelete() == 3) { + if (t.getSubLayerDelete() != null) { + if (t.getSubLayerDelete() == 1) { + fs.setSubLayerDelete(1); + } else { + fs.setSubLayerDelete(3); + } + } + } else { + if (t.getSubLayerDelete() != null) { + if (t.getSubLayerDelete() == 1) { + if (isAdministrator) { + fs.setSubLayerDelete(1); + } else { + fs.setSubLayerDelete(2); + } + } + } + } + } else { + if (t.getSubLayerDelete() != null) { + if (t.getSubLayerDelete() == 1) { + if (isAdministrator) { + fs.setSubLayerDelete(1); + } else { + fs.setSubLayerDelete(2); + } + } + } + } + + if (fs.getSubLayerSelect() != null) { + if (fs.getSubLayerSelect() == 0) { + if (t.getSubLayerSelect() != null) { + if (t.getSubLayerSelect() == 1) { + fs.setSubLayerSelect(1); + } else { + fs.setSubLayerSelect(0); + } + } + } else if (fs.getSubLayerSelect() == 3) { + if (t.getSubLayerSelect() != null) { + if (t.getSubLayerSelect() == 1) { + fs.setSubLayerSelect(1); + } else { + fs.setSubLayerSelect(3); + } + } + } else { + if (t.getSubLayerSelect() != null) { + if (t.getSubLayerSelect() == 1) { + if (isAdministrator) { + fs.setSubLayerSelect(1); + } else { + fs.setSubLayerSelect(2); + } + } + } + } + } else { + if (t.getSubLayerSelect() != null) { + if (t.getSubLayerSelect() == 1) { + if (isAdministrator) { + fs.setSubLayerSelect(1); + } else { + fs.setSubLayerSelect(2); + } + } + } + } + + + } + }); + }); + selectorModels = finalSelectorModels1; + + // 系统 + List systemOrganizeAdministratorEntity = organizeAdminIsTratorService.getOrganizeAdministratorEntity(userId, jnpf.constant.PermissionConst.SYSTEM, true); + List systemPermissionIds = systemOrganizeAdministratorEntity.stream().map(OrganizeAdministratorEntity::getOrganizeId).collect(Collectors.toList()); + List collect = systemSelectorVOList.stream().map(SystemSelectorVO::getId).collect(Collectors.toList()); + List systemList = new ArrayList<>(); + systemList.addAll(systemPermissionIds); + systemList.addAll(collect); + // 交集 1 + List collect1 = systemPermissionIds.stream().filter(collect::contains).collect(Collectors.toList()); + systemList = systemList.stream().distinct().collect(Collectors.toList()); + // 去掉交集后 + systemList.removeAll(collect1); + // 我有他没有 0 + List collect2 = collect.stream().filter(systemList::contains).collect(Collectors.toList()); + // 他有我没有 2 + List collect3 = systemPermissionIds.stream().filter(systemList::contains).collect(Collectors.toList()); + List listByIds1 = systemApi.getListByIds(collect1); + List systemSelectorVOList1 = JsonUtil.getJsonToList(listByIds1, SystemSelectorVO.class); + systemSelectorVOList1.forEach(t -> t.setIsPermission(1)); + List listByIds2 = systemApi.getListByIds(collect2); + List systemSelectorVOList2 = JsonUtil.getJsonToList(listByIds2, SystemSelectorVO.class); + systemSelectorVOList2.forEach(t -> t.setIsPermission(0)); + List listByIds3 = systemApi.getListByIds(collect3); + List systemSelectorVOList3 = JsonUtil.getJsonToList(listByIds3, SystemSelectorVO.class); + systemSelectorVOList3.forEach(t -> { + t.setIsPermission(2); + t.setDisabled(true); + }); + systemSelectedList.addAll(systemSelectorVOList1.stream().map(SystemSelectorVO::getId).collect(Collectors.toList())); + systemSelectedList.addAll(systemSelectorVOList3.stream().map(SystemSelectorVO::getId).collect(Collectors.toList())); + + systemPermissionList.addAll(systemSelectorVOList1); + systemPermissionList.addAll(systemSelectorVOList2); + systemPermissionList.addAll(systemSelectorVOList3); + systemPermissionList = systemPermissionList.stream().sorted(Comparator.comparing(SystemSelectorVO::getSortCode).thenComparing(Comparator.comparing(SystemSelectorVO::getCreatorTime).reversed())).collect(Collectors.toList()); + + + // 菜单 + List moduleOrganizeAdministratorEntity = organizeAdminIsTratorService.getOrganizeAdministratorEntity(userId, PermissionConst.MODULE, false); + List modulePermissionIds = moduleOrganizeAdministratorEntity.stream().map(OrganizeAdministratorEntity::getOrganizeId).collect(Collectors.toList()); + List moduleCollect = moduleSelectorVOList.stream().map(ModuleSelectorModel::getId).collect(Collectors.toList()); + List moduleList = new ArrayList<>(); + moduleList.addAll(modulePermissionIds); + moduleList.addAll(moduleCollect); + // 交集 1 + List moduleCollect1 = modulePermissionIds.stream().filter(moduleCollect::contains).collect(Collectors.toList()); + moduleList = moduleList.stream().distinct().collect(Collectors.toList()); + // 去掉交集后 + moduleList.removeAll(moduleCollect1); + // 我有他没有 0 + List moduleCollect2 = moduleCollect.stream().filter(moduleList::contains).collect(Collectors.toList()); + // 他有我没有 2 + List moduleCollect3 = modulePermissionIds.stream().filter(moduleList::contains).collect(Collectors.toList()); + List moduleListByIds1 = moduleApi.getModuleByIds(moduleCollect1); + List moduleSelectorVOList1 = JsonUtil.getJsonToList(moduleListByIds1, ModuleSelectorModel.class); + moduleSelectorVOList1.forEach(t -> t.setIsPermission(1)); + List moduleListByIds2 = moduleApi.getModuleByIds(moduleCollect2); + List moduleSelectorVOList2 = JsonUtil.getJsonToList(moduleListByIds2, ModuleSelectorModel.class); + moduleSelectorVOList2.forEach(t -> t.setIsPermission(0)); + List moduleListByIds3 = moduleApi.getModuleByIds(moduleCollect3); + List moduleSelectorVOList3 = JsonUtil.getJsonToList(moduleListByIds3, ModuleSelectorModel.class); + moduleSelectorVOList3.forEach(t -> { + t.setIsPermission(2); + t.setDisabled(true); + }); + modulePermissionList.addAll(moduleSelectorVOList1); + modulePermissionList.addAll(moduleSelectorVOList2); + modulePermissionList.addAll(moduleSelectorVOList3); + Set tempModule = new HashSet<>(modulePermissionList); + // 处理上级 + List finalModulePermissionList = modulePermissionList; + modulePermissionList.forEach(t -> { + // 判断上级是否存在,不存在的话取出放入总权限列表 + parentIdInList(finalModulePermissionList, tempModule, allModuleSelectorVOList, t, t); + }); + modulePermissionList = new ArrayList<>(tempModule); + modulePermissionList.forEach(t -> { + if ("-1".equals(t.getParentId())) { + t.setParentId(t.getSystemId()); + } + }); + // 加入主系统 + ModuleSelectorModel jsonToBean = JsonUtil.getJsonToBean(mainSystem, ModuleSelectorModel.class); + if (moduleSelectorVOList1.stream().anyMatch(t -> t.getId().equals(jsonToBean.getId()))) { + jsonToBean.setIsPermission(1); + } else if (moduleSelectorVOList2.stream().anyMatch(t -> t.getId().equals(jsonToBean.getId()))) { + jsonToBean.setIsPermission(0); + } else if (moduleSelectorVOList3.stream().anyMatch(t -> t.getId().equals(jsonToBean.getId()))) { + jsonToBean.setIsPermission(2); + jsonToBean.setDisabled(true); + } + moduleSelectedList.addAll(moduleSelectorVOList1.stream().map(ModuleSelectorModel::getId).collect(Collectors.toList())); + moduleSelectedList.addAll(moduleSelectorVOList3.stream().map(ModuleSelectorModel::getId).collect(Collectors.toList())); + + jsonToBean.setType(0); + jsonToBean.setParentId("-1"); + modulePermissionList.add(jsonToBean); + modulePermissionList = modulePermissionList.stream().sorted(Comparator.comparing(ModuleSelectorModel::getSortCode).thenComparing(Comparator.comparing(ModuleSelectorModel::getCreatorTime).reversed())).collect(Collectors.toList()); + List> menuList = TreeDotUtils.convertListToTreeDotFilter(modulePermissionList); + moduleVOPermissionList = JsonUtil.getJsonToList(menuList, ModuleSelectorVO.class); + } else { + selectorModels = new ArrayList<>(); + } + + // 判断断层有没有上下级关系 + List finalSelectorModels2 = new ArrayList<>(selectorModels); + + + selectorModels.forEach(t -> { + if (StringUtil.isNotEmpty(t.getOrganizeIdTree())) { + List list1 = new ArrayList<>(); + String[] split = t.getOrganizeIdTree().split(","); + list1 = Arrays.asList(split); + Collections.reverse(list1); + for (String orgId : list1) { + OrganizeAdministratorSelectorModel organizeEntity1 = finalSelectorModels2.stream().filter(organizeEntity -> organizeEntity.getId().equals(orgId)).findFirst().orElse(null); + if (organizeEntity1 != null && !organizeEntity1.getId().equals(t.getId())) { + t.setParentId(organizeEntity1.getId()); + String[] split1 = t.getOrganizeIdTree().split(organizeEntity1.getId()); + if (split1.length > 1) { + t.setFullName(organizeService.getFullNameByOrgIdTree(split1[1], "/")); + } + break; + } + } + } + }); + selectorModels.forEach(t -> t.setIcon(StringUtil.isNotEmpty(t.getCategory()) ? "company".equals(t.getCategory()) ? "icon-ym icon-ym-tree-organization3" : "icon-ym icon-ym-tree-department1" : "")); + List> trees = TreeDotUtils.convertListToTreeDot(selectorModels); + List listVO = JsonUtil.getJsonToList(trees, OrganizeAdministratorSelectorVO.class); + listVO.forEach(t -> { + t.setFullName(organizeService.getFullNameByOrgIdTree(t.getOrganizeIdTree(), "/")); + }); + vo.setOrgAdminList(listVO); + vo.setSystemPermissionList(systemPermissionList); + vo.setModulePermissionList(moduleVOPermissionList); + vo.setSystemIds(systemSelectedList); + vo.setModuleIds(moduleSelectedList); + return ActionResult.success(vo); + } + + private void parentIdInList(List modulePermissionList, Set tempModule, + List allModuleSelectorVOList, ModuleSelectorModel moduleSelectorModel, + ModuleSelectorModel moduleSelectorModels) { + ModuleSelectorModel finalModuleSelectorModel = moduleSelectorModel; + moduleSelectorModel = modulePermissionList.stream().filter(t -> finalModuleSelectorModel.getParentId().equals(t.getId())).findFirst().orElse(null); + // !null return ==1 return + System.out.println(moduleSelectorModel); + if (moduleSelectorModel != null && moduleSelectorModel.getType() == 1) { + tempModule.add(moduleSelectorModel); + moduleSelectorModels.setParentId(moduleSelectorModel.getId()); + return; + } + moduleSelectorModel = allModuleSelectorVOList.stream().filter(t -> finalModuleSelectorModel.getParentId().equals(t.getId())).findFirst().orElse(null); + if (moduleSelectorModel == null) { + return; + } + parentIdInList(modulePermissionList, tempModule, allModuleSelectorVOList, moduleSelectorModel, moduleSelectorModels); + } +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/OrganizeController.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/OrganizeController.java new file mode 100644 index 0000000..d0632aa --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/OrganizeController.java @@ -0,0 +1,992 @@ +package jnpf.permission.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.annotation.SaMode; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.TypeReference; +import com.alibaba.fastjson.parser.Feature; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import jnpf.base.controller.SuperController; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.annotation.OrganizePermission; +import jnpf.base.ActionResult; +import jnpf.base.Pagination; +import jnpf.base.vo.ListVO; +import jnpf.constant.MsgCode; +import jnpf.constant.PermissionConst; +import jnpf.message.service.SynThirdDingTalkService; +import jnpf.message.service.SynThirdQyService; +import jnpf.permission.entity.OrganizeAdministratorEntity; +import jnpf.permission.entity.OrganizeEntity; +import jnpf.exception.DataException; +import jnpf.permission.model.organize.*; +import jnpf.permission.service.OrganizeAdministratorService; +import jnpf.permission.service.OrganizeRelationService; +import jnpf.permission.service.OrganizeService; +import jnpf.permission.service.UserService; +import jnpf.util.JsonUtil; +import jnpf.util.JsonUtilEx; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import jnpf.util.treeutil.ListToTreeUtil; +import jnpf.util.treeutil.SumTree; +import jnpf.util.treeutil.newtreeutil.TreeDotUtils; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.*; +import java.util.concurrent.Executor; +import java.util.stream.Collectors; + +/** + * 组织机构 + * 组织架构:公司》部门》岗位》用户 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +@Tag(name = "组织管理", description = "Organize") +@RestController +@RequestMapping("/api/permission/Organize") +@Slf4j +public class OrganizeController extends SuperController { + + @Autowired + private OrganizeService organizeService; + @Autowired + private UserService userService; + @Autowired + private SynThirdQyService synThirdQyService; + @Autowired + private SynThirdDingTalkService synThirdDingTalkService; + /** + * 取出线程池 + */ + @Autowired + private Executor threadPoolExecutor; + @Autowired + private OrganizeAdministratorService organizeAdministratorService; + @Autowired + private UserProvider userProvider; + @Autowired + private OrganizeRelationService organizeRelationService; + + //---------------------------组织管理-------------------------------------------- + + /** + * 获取组织列表 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "获取组织列表") + @SaCheckPermission(value = {"permission.organize", "permission.position", "permission.user", "permission.role"}, mode = SaMode.OR) + @GetMapping + public ActionResult> getList(Pagination pagination) { + // 获取所有组织 + Map orgMaps; + if (!userProvider.get().getIsAdministrator()) { + // 通过权限转树 + List listss = organizeAdministratorService.getOrganizeAdministratorEntity(userProvider.get().getUserId()); + Set orgIds = new HashSet<>(16); + // 判断自己是哪些组织的管理员 + listss.stream().forEach(t-> { + if (t != null) { + if (t.getThisLayerSelect() != null && t.getThisLayerSelect() == 1) { + orgIds.add(t.getOrganizeId()); + } + if (t.getSubLayerSelect() != null && t.getSubLayerSelect() == 1) { + List underOrganizations = organizeService.getUnderOrganizations(t.getOrganizeId(), false); + orgIds.addAll(underOrganizations); + } + } + }); + List list1 = new ArrayList<>(orgIds); + // 得到所有有权限的组织 + orgMaps = organizeService.getOrganizeName(list1, pagination.getKeyword(), false); + }else{ + orgMaps = organizeService.getOrgMaps(pagination.getKeyword(), false); + } + Map orgMapsModel = JSONObject.parseObject(JSONObject.toJSONString(orgMaps), new TypeReference>() {}, new Feature[0]);; + + Map orgIdNameMaps = organizeService.getInfoList(); + orgMapsModel.values().forEach(t -> { + if (PermissionConst.COMPANY.equals(t.getType())) { + t.setIcon("icon-ym icon-ym-tree-organization3"); + } else { + t.setIcon("icon-ym icon-ym-tree-department1"); + } + // 处理断层 + if (StringUtil.isNotEmpty(t.getOrganizeIdTree())) { + String[] split = t.getOrganizeIdTree().split(","); + List list1 = Arrays.asList(split); + Collections.reverse(list1); + for (String orgId : list1) { + if(!orgId.equals(t.getId())) { + OrganizeModel organizeEntity1 = orgMapsModel.get(orgId); + if (organizeEntity1 != null) { + t.setParentId(organizeEntity1.getId()); + String[] split1 = t.getOrganizeIdTree().split(organizeEntity1.getId()); + if (split1.length > 1) { + t.setFullName(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, split1[1], "/")); + } + break; + } + } + } + } + }); + List> trees = TreeDotUtils.convertMapsToTreeDot(orgMapsModel); + List listVO = JsonUtil.getJsonToList(trees, OrganizeListVO.class); + listVO.forEach(t -> { + t.setFullName(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, t.getOrganizeIdTree(), "/")); + }); + ListVO vo = new ListVO<>(); + vo.setList(listVO); + return ActionResult.success(vo); + } + + + /** + * 获取组织下拉框列表 + * + * @param pagination 分页模型 + * @param id 主键 + * @return + */ + @Operation(summary = "获取组织下拉框列表") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @GetMapping("/Selector/{id}") + public ActionResult> getSelector(Pagination pagination, @PathVariable("id") String id) { + List allList = new LinkedList<>(organizeService.getOrgMaps(pagination.getKeyword(), true).values()); + if (!"0".equals(id)) { + allList.remove(organizeService.getInfo(id)); + } + List dataAll = allList; + List list = JsonUtil.getJsonToList(ListToTreeUtil.treeWhere(allList, dataAll), OrganizeEntity.class); + list = list.stream().filter(t -> "company".equals(t.getCategory())).collect(Collectors.toList()); + List models = JsonUtil.getJsonToList(list, OrganizeModel.class); + for (OrganizeModel model : models) { + model.setIcon("icon-ym icon-ym-tree-organization3"); + } + Map orgIdNameMaps = organizeService.getInfoList(); + models.forEach(t -> { + t.setOrganize(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, t.getOrganizeIdTree(), "/")); + if (StringUtil.isNotEmpty(t.getOrganizeIdTree())) { + String[] split = t.getOrganizeIdTree().split(","); + if (split.length > 0) { + t.setOrganizeIds(Arrays.asList(split)); + } else { + t.setOrganizeIds(new ArrayList<>()); + } + } + }); + + List modelAll = new ArrayList<>(); + modelAll.addAll(models); + List> trees = TreeDotUtils.convertListToTreeDotFilter(modelAll); + List listVO = JsonUtil.getJsonToList(trees, OrganizeSelectorVO.class); + ListVO vo = new ListVO(); + vo.setList(listVO); + return ActionResult.success(vo); + } + + + /** + * 获取组织下拉框列表 + * + * @param pagination 分页模型 + * @param id 主键 + * @return + */ + @Operation(summary = "获取组织下拉框列表") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @GetMapping("/SelectorByAuth/{id}") + public ActionResult> getSelectorByAuth(Pagination pagination, @PathVariable("id") String id) { + List allList = new LinkedList<>(organizeService.getOrgMaps(pagination.getKeyword(), true).values()); + allList = allList.stream().filter(t -> "company".equals(t.getCategory())).collect(Collectors.toList()); + OrganizeEntity entity = organizeService.getInfo(id); + List dataAll = allList; + + List list = JsonUtil.getJsonToList(ListToTreeUtil.treeWhere(allList, dataAll), OrganizeEntity.class); + + List models = JsonUtil.getJsonToList(list, OrganizeByAuthModel.class); + + Map orgIdNameMaps = organizeService.getInfoList(); + if (!userProvider.get().getIsAdministrator()) { + // 通过权限转树 + List listss = organizeAdministratorService.getOrganizeAdministratorEntity(userProvider.get().getUserId()); + Set orgIds = new HashSet<>(16); + // 判断自己是哪些组织的管理员 + listss.stream().forEach(t-> { + if (t != null) { + if (t.getThisLayerSelect() != null && t.getThisLayerSelect() == 1) { + orgIds.add(t.getOrganizeId()); + } + if (t.getSubLayerSelect() != null && t.getSubLayerSelect() == 1) { + List underOrganizations = organizeService.getUnderOrganizations(t.getOrganizeId(), false); + orgIds.addAll(underOrganizations); + } + } + }); + List list1 = new ArrayList<>(orgIds); + // 得到所有有权限的组织 + List organizeName = organizeService.getOrganizeName(list1); + organizeName = organizeName.stream().filter(t->PermissionConst.COMPANY.equals(t.getCategory())).collect(Collectors.toList()); + models = JsonUtil.getJsonToList(organizeName, OrganizeByAuthModel.class); + } + + // 判断当前编辑的权限时候是否有上级 + if (entity != null) { + if (models.stream().filter(t -> t.getId().equals(entity.getParentId())).findFirst().orElse(null) == null) { + OrganizeEntity info = organizeService.getInfo(entity.getParentId()); + if (info != null) { + OrganizeByAuthModel jsonToBean = JsonUtil.getJsonToBean(info, OrganizeByAuthModel.class); + jsonToBean.setDisabled(true); + models.add(jsonToBean); + } + } + } + List finalModels = models; + models.forEach(t -> { + if (PermissionConst.COMPANY.equals(t.getType())) { + t.setIcon("icon-ym icon-ym-tree-organization3"); + } else { + t.setIcon("icon-ym icon-ym-tree-department1"); + } + // 处理断层 + if (StringUtil.isNotEmpty(t.getOrganizeIdTree())) { + String[] split = t.getOrganizeIdTree().split(","); + List list1 = Arrays.asList(split); + t.setOrganizeIds(list1); + t.setOrganize(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, t.getOrganizeIdTree(), "/")); + List list2 = new ArrayList<>(list1); + Collections.reverse(list2); + for (String orgId : list2) { + OrganizeModel organizeEntity1 = finalModels.stream().filter(organizeEntity -> organizeEntity.getId().equals(orgId)).findFirst().orElse(null); + if (organizeEntity1 != null && !organizeEntity1.getId().equals(t.getId())) { + t.setParentId(organizeEntity1.getId()); + String[] split1 = t.getOrganizeIdTree().split(organizeEntity1.getId()); + if (split1.length > 1) { + t.setFullName(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, split1[1], "/")); + } + break; + } + } + } + }); + List> trees = TreeDotUtils.convertListToTreeDot(models); + List listVO = JsonUtil.getJsonToList(trees, OrganizeSelectorByAuthVO.class); + listVO.forEach(t -> { + t.setFullName(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, t.getOrganizeIdTree(), "/")); + }); + ListVO vo = new ListVO<>(); + vo.setList(listVO); + return ActionResult.success(vo); + } + + /** + * 通过部门id获取部门下拉框下拉框 + * + * @return + */ + @Operation(summary = "通过部门id获取部门下拉框") + @Parameters({ + @Parameter(name = "organizeConditionModel", description = "组织id模型", required = true) + }) + @PostMapping("/OrganizeCondition") + public ActionResult> organizeCondition(@RequestBody OrganizeConditionModel organizeConditionModel) { + List organizeList = organizeRelationService.getOrgIdsList(organizeConditionModel); + List> trees = TreeDotUtils.convertListToTreeDot(organizeList); + List listVO = JsonUtil.getJsonToList(trees, OrganizeListVO.class); + listVO.forEach(t -> { + t.setFullName(organizeService.getFullNameByOrgIdTree(t.getOrganizeIdTree(), "/")); + }); + ListVO vo = new ListVO<>(); + vo.setList(listVO); + return ActionResult.success(vo); + } + + /** + * 组织树形 + * + * @return + */ + @Operation(summary = "获取组织/公司树形") + @GetMapping("/Tree") + public ActionResult> tree() { + List list = new LinkedList<>(organizeService.getOrgMaps(null, true).values()); + list = list.stream().filter(t -> "company".equals(t.getCategory())).collect(Collectors.toList()); + List models = JsonUtil.getJsonToList(list, OrganizeModel.class); + for (OrganizeModel model : models) { + model.setIcon("icon-ym icon-ym-tree-organization3"); + } + List> trees = TreeDotUtils.convertListToTreeDot(models); + List listVO = JsonUtil.getJsonToList(trees, OrganizeTreeVO.class); + //将子节点全部删除 + Iterator iterator = listVO.iterator(); + while (iterator.hasNext()) { + OrganizeTreeVO orananizeTreeVO = iterator.next(); + if (!"-1".equals(orananizeTreeVO.getParentId())) { + iterator.remove(); + } + } + ListVO vo = new ListVO(); + vo.setList(listVO); + return ActionResult.success(vo); + } + + /** + * 获取组织信息 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "获取组织信息") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission(value = {"permission.organize"}) + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) throws DataException { + OrganizeEntity entity = organizeService.getInfo(id); + OrganizeInfoVO vo = JsonUtilEx.getJsonToBeanEx(entity, OrganizeInfoVO.class); + if (StringUtil.isNotEmpty(entity.getOrganizeIdTree())) { + String replace = entity.getOrganizeIdTree().replace(entity.getId(), ""); + if (StringUtil.isNotEmpty(replace) && !",".equals(replace)) { + vo.setOrganizeIdTree(Arrays.asList(replace.split(","))); + } else { + vo.setOrganizeIdTree(Arrays.asList(new String[]{"-1"})); + } + } + return ActionResult.success(vo); + } + + + /** + * 新建组织 + * + * @param organizeCrForm 新建模型 + * @return + */ + @OrganizePermission + @Operation(summary = "新建组织") + @Parameters({ + @Parameter(name = "organizeCrForm", description = "新建模型", required = true) + }) + @SaCheckPermission(value = {"permission.organize"}) + @PostMapping + public ActionResult create(@RequestBody @Valid OrganizeCrForm organizeCrForm) { + OrganizeEntity entity = JsonUtil.getJsonToBean(organizeCrForm, OrganizeEntity.class); + entity.setCategory("company"); + if (organizeService.isExistByFullName(entity, false, false)) { + return ActionResult.fail("公司名称不能重复"); + } + if (organizeService.isExistByEnCode(entity.getEnCode(), entity.getId())) { + return ActionResult.fail("公司编码不能重复"); + } + + // 通过组织id获取父级组织 + String organizeIdTree = getOrganizeIdTree(entity); + entity.setOrganizeIdTree(organizeIdTree); + + organizeService.create(entity); + threadPoolExecutor.execute(() -> { + try{ + //创建组织后判断是否需要同步到企业微信 + synThirdQyService.createDepartmentSysToQy(false, entity, ""); + //创建组织后判断是否需要同步到钉钉 + synThirdDingTalkService.createDepartmentSysToDing(false, entity, ""); + } catch (Exception e) { + log.error("创建组织后同步失败到企业微信或钉钉失败,异常:" + e.getMessage()); + } + }); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 更新组织 + * + * @param id 主键值 + * @param organizeUpForm 实体对象 + * @return + */ + @OrganizePermission + @Operation(summary = "更新组织") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true), + @Parameter(name = "organizeUpForm", description = "实体对象", required = true) + }) + @SaCheckPermission(value = {"permission.organize"}) + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid OrganizeUpForm organizeUpForm) { + List synList = new ArrayList<>(); + OrganizeEntity entity = JsonUtil.getJsonToBean(organizeUpForm, OrganizeEntity.class); + OrganizeEntity info = organizeService.getInfo(organizeUpForm.getParentId()); + if (id.equals(entity.getParentId()) || (info != null && info.getOrganizeIdTree() != null && info.getOrganizeIdTree().contains(id))) { + return ActionResult.fail("当前机构Id不能与父机构Id相同"); + } + entity.setId(id); + entity.setCategory("company"); + if (organizeService.isExistByFullName(entity, false, true)) { + return ActionResult.fail("公司名称不能重复"); + } + if (organizeService.isExistByEnCode(entity.getEnCode(), entity.getId())) { + return ActionResult.fail("公司编码不能重复"); + } + // 通过组织id获取父级组织 + String organizeIdTree = getOrganizeIdTree(entity); + entity.setOrganizeIdTree(organizeIdTree); + boolean flag = organizeService.update(id, entity); + synList.add(entity); + + // 得到所有子组织或部门id + if (info != null && info.getParentId() != null && !entity.getParentId().equals(info.getParentId())) { + List underOrganizations = organizeService.getUnderOrganizations(id, false); + underOrganizations.forEach(t -> { + OrganizeEntity info1 = organizeService.getInfo(t); + if (StringUtil.isNotEmpty(info1.getOrganizeIdTree())) { + String organizeIdTrees = getOrganizeIdTree(info1); + info1.setOrganizeIdTree(organizeIdTrees); + organizeService.update(info1.getId(), info1); + synList.add(info1); + } + }); + } + threadPoolExecutor.execute(() -> { + synList.forEach(t-> { + try{ + //修改组织后判断是否需要同步到企业微信 + synThirdQyService.updateDepartmentSysToQy(false, t, ""); + //修改组织后判断是否需要同步到钉钉 + synThirdDingTalkService.updateDepartmentSysToDing(false, t, ""); + } catch (Exception e) { + log.error("修改组织后同步失败到企业微信或钉钉失败,异常:" + e.getMessage()); + } + }); + }); + if (!flag) { + return ActionResult.fail(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除组织 + * + * @param orgId 组织主键 + * @return + */ + @OrganizePermission + @Operation(summary = "删除组织") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission(value = {"permission.organize"}) + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String orgId) { + return organizeService.delete(orgId); + } + + /** + * 删除部门 + * + * @param orgId 部门主键 + * @return + */ + @OrganizePermission + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission(value = {"permission.organize"}) + @Operation(summary = "删除部门") + @DeleteMapping("/Department/{id}") + public ActionResult deleteDepartment(@PathVariable("id") String orgId) { + return organizeService.delete(orgId); + } + + /** + * 更新组织状态 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "更新组织状态") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission(value = {"permission.organize"}) + @PutMapping("/{id}/Actions/State") + public ActionResult update(@PathVariable("id") String id) { + OrganizeEntity organizeEntity = organizeService.getInfo(id); + if (organizeEntity != null) { + if ("1".equals(String.valueOf(organizeEntity.getEnabledMark()))) { + organizeEntity.setEnabledMark(0); + } else { + organizeEntity.setEnabledMark(1); + } + organizeService.update(organizeEntity.getId(), organizeEntity); + return ActionResult.success(MsgCode.SU004.get()); + } + return ActionResult.success(MsgCode.FA002.get()); + } + + + //---------------------------部门管理-------------------------------------------- + +// /** +// * 获取部门列表 +// * +// * @param companyId 组织id +// * @param pagination 分页模型 +// * @return +// @Operation(summary = "获取部门列表") +// @Parameters({ +// @Parameter(name = "companyId", description = "组织id", required = true) +// }) +// @SaCheckPermission(value = {"permission.organize"}) +// @GetMapping("/{companyId}/Department") +// public ActionResult> getListDepartment(@PathVariable("companyId") String companyId, Pagination pagination) { +// List dataAll = organizeService.getParentIdList(companyId); +// List childId = dataAll.stream().map(t -> t.getId()).collect(Collectors.toList()); +// List data = organizeService.getListAll(childId, pagination.getKeyword()); +// //正序显示 +// data = data.stream().sorted(Comparator.comparing(OrganizeEntity::getSortCode)).collect(Collectors.toList()); +// List models = JsonUtil.getJsonToList(data, OrganizeModel.class); +// if (!userProvider.get().getIsAdministrator()) { +// // 通过权限转树 +// List listss = organizeAdministratorService.getOrganizeAdministratorEntity(userProvider.get().getUserId()); +// Set orgIds = new HashSet<>(16); +// // 判断自己是哪些组织的管理员 +// listss.stream().forEach(t-> { +// if (t != null) { +// if (t.getThisLayerSelect() != null && t.getThisLayerSelect() == 1) { +// orgIds.add(t.getOrganizeId()); +// } +// if (t.getSubLayerSelect() != null && t.getSubLayerSelect() == 1) { +// List underOrganizations = organizeService.getUnderOrganizations(t.getOrganizeId()); +// orgIds.addAll(underOrganizations); +// } +// } +// }); +// List list1 = new ArrayList<>(orgIds); +// List organizeModels = new ArrayList<>(16); +// +// models.forEach(t -> { +// list1.forEach(tt -> { +// if (t.getId() != null && t.getId().equals(tt)) { +// organizeModels.add(t); +// } +// }); +// }); +// models = organizeModels; +// } +// // 给部门经理赋值 +// for (OrganizeModel model : models) { +// if (!StringUtil.isEmpty(model.getManager())) { +// UserEntity entity = userService.getById(model.getManager()); +// model.setManager(entity != null ? entity.getRealName() + "/" + entity.getAccount() : null); +// } +// } +// List listvo = JsonUtil.getJsonToList(models, OrganizeDepartListVO.class); +// ListVO vo = new ListVO(); +// vo.setList(listvo); +// return ActionResult.success(vo); +// } + + + + /** + * 获取部门下拉框列表 + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取部门下拉框列表") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @GetMapping("/Department/Selector/{id}") + public ActionResult> getListDepartment(@PathVariable("id") String id) { + List data = new LinkedList<>(organizeService.getOrgMaps(null, true).values()); + if (!"0".equals(id)) { + data.remove(organizeService.getInfo(id)); + } + List models = JsonUtil.getJsonToList(data, OrganizeModel.class); + for (OrganizeModel model : models) { + if ("department".equals(model.getType())) { + model.setIcon("icon-ym icon-ym-tree-department1"); + } else if ("company".equals(model.getType())) { + model.setIcon("icon-ym icon-ym-tree-organization3"); + } + } + + Map orgIdNameMaps = organizeService.getInfoList(); + models.forEach(t -> { + t.setOrganize(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, t.getOrganizeIdTree(), "/")); + if (StringUtil.isNotEmpty(t.getOrganizeIdTree())) { + String[] split = t.getOrganizeIdTree().split(","); + if (split.length > 0) { + t.setOrganizeIds(Arrays.asList(split)); + } else { + t.setOrganizeIds(new ArrayList<>()); + } + } + }); + + List> trees = TreeDotUtils.convertListToTreeDotFilter(models); + List listVO = JsonUtil.getJsonToList(trees, OrganizeDepartSelectorListVO.class); + ListVO vo = new ListVO(); + vo.setList(listVO); + return ActionResult.success(vo); + } + + /** + * 获取部门下拉框列表 + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取部门下拉框列表") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @GetMapping("/Department/SelectorByAuth/{id}") + public ActionResult> getDepartmentSelectorByAuth(@PathVariable("id") String id) { + Map orgMaps; + OrganizeEntity entity = organizeService.getInfo(id); + + if (!userProvider.get().getIsAdministrator()) { + // 通过权限转树 + List listss = organizeAdministratorService.getOrganizeAdministratorEntity(userProvider.get().getUserId()); + Set orgIds = new HashSet<>(16); + // 判断自己是哪些组织的管理员 + listss.stream().forEach(t-> { + if (t != null) { + if (t.getThisLayerSelect() != null && t.getThisLayerSelect() == 1) { + orgIds.add(t.getOrganizeId()); + } + if (t.getSubLayerSelect() != null && t.getSubLayerSelect() == 1) { + List underOrganizations = organizeService.getUnderOrganizations(t.getOrganizeId(), false); + orgIds.addAll(underOrganizations); + } + } + }); + List list1 = new ArrayList<>(orgIds); + orgMaps = organizeService.getOrganizeName(list1, null, true); + } else { + orgMaps = organizeService.getOrgMaps(null, true); + } + Map orgMapsModel = JSONObject.parseObject(JSONObject.toJSONString(orgMaps), new TypeReference>() {}, new Feature[0]);; + if (!"0".equals(id)) { + orgMapsModel.remove(id); + } + Map orgIdNameMaps = organizeService.getInfoList(); + // 判断当前编辑的权限时候是否有上级 + if (entity != null) { + if (orgMapsModel.values().stream().filter(t -> t.getId().equals(entity.getParentId())).findFirst().orElse(null) == null) { + OrganizeEntity info = organizeService.getInfo(entity.getParentId()); + if (info != null) { + OrganizeByAuthModel jsonToBean = JsonUtil.getJsonToBean(info, OrganizeByAuthModel.class); + jsonToBean.setDisabled(true); + orgMapsModel.put(info.getId(), jsonToBean); + } + } + } + orgMapsModel.values().forEach(t -> { + if (PermissionConst.COMPANY.equals(t.getType())) { + t.setIcon("icon-ym icon-ym-tree-organization3"); + } else { + t.setIcon("icon-ym icon-ym-tree-department1"); + } + // 处理断层 + if (StringUtil.isNotEmpty(t.getOrganizeIdTree())) { + List list1 = new ArrayList<>(); + String[] split = t.getOrganizeIdTree().split(","); + list1 = Arrays.asList(split); + List list = new ArrayList<>(16); + list1.forEach(orgId -> { + if (StringUtil.isNotEmpty(orgId)) { + list.add(orgId); + } + }); + t.setOrganizeIds(list); + t.setOrganize(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, t.getOrganizeIdTree(), "/")); + Collections.reverse(list1); + for (String orgId : list1) { + OrganizeModel organizeEntity1 = orgMapsModel.get(orgId); + if (organizeEntity1 != null && !organizeEntity1.getId().equals(t.getId())) { + t.setParentId(organizeEntity1.getId()); + String[] split1 = t.getOrganizeIdTree().split(organizeEntity1.getId()); + if (split1.length > 1) { + t.setFullName(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, split1[1], "/")); + } + break; + } + } + } + }); + List> trees = TreeDotUtils.convertMapsToTreeDot(orgMapsModel); + List listVO = JsonUtil.getJsonToList(trees, OrganizeSelectorByAuthVO.class); + listVO.forEach(t -> { + t.setFullName(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, t.getOrganizeIdTree(), "/")); + }); + ListVO vo = new ListVO(); + vo.setList(listVO); + return ActionResult.success(vo); + } + + + /** + * 新建部门 + * + * @param organizeDepartCrForm 新建模型 + * @return + */ + @OrganizePermission + @Operation(summary = "新建部门") + @Parameters({ + @Parameter(name = "organizeDepartCrForm", description = "新建模型", required = true) + }) + @SaCheckPermission(value = {"permission.organize"}) + @PostMapping("/Department") + public ActionResult createDepartment(@RequestBody @Valid OrganizeDepartCrForm organizeDepartCrForm) { + OrganizeEntity entity = JsonUtil.getJsonToBean(organizeDepartCrForm, OrganizeEntity.class); + entity.setCategory("department"); + //判断同一个父级下是否含有同一个名称 + if (organizeService.isExistByFullName(entity, false, false)) { + return ActionResult.fail("部门名称不能重复"); + } + //判断同一个父级下是否含有同一个编码 + if (organizeService.isExistByEnCode(entity.getEnCode(), entity.getId())) { + return ActionResult.fail("部门编码不能重复"); + } + + // 通过组织id获取父级组织 + String organizeIdTree = getOrganizeIdTree(entity); + entity.setOrganizeIdTree(organizeIdTree); + + organizeService.create(entity); + threadPoolExecutor.execute(() -> { + try{ + //创建部门后判断是否需要同步到企业微信 + synThirdQyService.createDepartmentSysToQy(false, entity, ""); + //创建部门后判断是否需要同步到钉钉 + synThirdDingTalkService.createDepartmentSysToDing(false, entity, ""); + } catch (Exception e) { + log.error("创建部门后同步失败到企业微信或钉钉失败,异常:" + e.getMessage()); + } + }); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 更新部门 + * + * @param id 主键值 + * @param oraganizeDepartUpForm 修改模型 + * @return + */ + @OrganizePermission + @Operation(summary = "更新部门") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true), + @Parameter(name = "oraganizeDepartUpForm", description = "修改模型", required = true) + }) + @SaCheckPermission(value = {"permission.organize"}) + @PutMapping("/Department/{id}") + public ActionResult updateDepartment(@PathVariable("id") String id, @RequestBody @Valid OrganizeDepartUpForm oraganizeDepartUpForm) { + List synList = new ArrayList<>(); + OrganizeEntity entity = JsonUtil.getJsonToBean(oraganizeDepartUpForm, OrganizeEntity.class); + OrganizeEntity info = organizeService.getInfo(oraganizeDepartUpForm.getParentId()); + if (id.equals(entity.getParentId()) || (info != null && info.getOrganizeIdTree() != null && info.getOrganizeIdTree().contains(id))) { + return ActionResult.fail("当前机构Id不能与父机构Id相同"); + } + entity.setId(id); + entity.setCategory("department"); + //判断同一个父级下是否含有同一个名称 + if (organizeService.isExistByFullName(entity, false, true)) { + return ActionResult.fail("部门名称不能重复"); + } + //判断同一个父级下是否含有同一个编码 + if (organizeService.isExistByEnCode(entity.getEnCode(), entity.getId())) { + return ActionResult.fail("部门编码不能重复"); + } + // 通过组织id获取父级组织 + String organizeIdTree = getOrganizeIdTree(entity); + entity.setOrganizeIdTree(organizeIdTree); + boolean flag = organizeService.update(id, entity); + synList.add(entity); + + // 得到所有子组织或部门id + if (info.getParentId() != null && !entity.getParentId().equals(info.getParentId())) { + List underOrganizations = organizeService.getUnderOrganizations(id, false); + underOrganizations.forEach(t -> { + OrganizeEntity info1 = organizeService.getInfo(t); + if (StringUtil.isNotEmpty(info1.getOrganizeIdTree())) { + String organizeIdTrees = getOrganizeIdTree(info1); + info1.setOrganizeIdTree(organizeIdTrees); + organizeService.update(info1.getId(), info1); + synList.add(info1); + } + }); + } + + threadPoolExecutor.execute(() -> { + synList.forEach(t-> { + try{ + //修改部门后判断是否需要同步到企业微信 + synThirdQyService.updateDepartmentSysToQy(false, organizeService.getInfo(id), ""); + //修改部门后判断是否需要同步到钉钉 + synThirdDingTalkService.updateDepartmentSysToDing(false, organizeService.getInfo(id), ""); + } catch (Exception e) { + log.error("修改部门后同步失败到企业微信或钉钉失败,异常:" + e.getMessage()); + } + }); + }); + if (flag == false) { + return ActionResult.fail(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + + + /** + * 更新部门状态 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "更新部门状态") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission(value = {"permission.organize"}) + @PutMapping("/Department/{id}/Actions/State") + public ActionResult updateDepartment(@PathVariable("id") String id) { + OrganizeEntity organizeEntity = organizeService.getInfo(id); + if (organizeEntity != null) { + if ("1".equals(String.valueOf(organizeEntity.getEnabledMark()))) { + organizeEntity.setEnabledMark(0); + } else { + organizeEntity.setEnabledMark(1); + } + organizeService.update(organizeEntity.getId(), organizeEntity); + return ActionResult.success(MsgCode.SU004.get()); + } + return ActionResult.fail(MsgCode.FA002.get()); + } + + /** + * 获取部门信息 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "获取部门信息") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission(value = {"permission.organize"}) + @GetMapping("/Department/{id}") + public ActionResult infoDepartment(@PathVariable("id") String id) throws DataException { + OrganizeEntity entity = organizeService.getInfo(id); + OrganizeDepartInfoVO vo = JsonUtilEx.getJsonToBeanEx(entity, OrganizeDepartInfoVO.class); + List list = new ArrayList<>(); + if (StringUtil.isNotEmpty(entity.getOrganizeIdTree())) { + String[] split = entity.getOrganizeIdTree().split(","); + if (split.length > 1) { + for (int i = 0; i < split.length - 1; i++) { + list.add(split[i]); + } + } + } + vo.setOrganizeIdTree(list); + return ActionResult.success(vo); + } + + /** + * 获取父级组织id + * + * @param entity + * @return + */ + private String getOrganizeIdTree(OrganizeEntity entity) { + List list = new ArrayList<>(); + organizeService.getOrganizeIdTree(entity.getParentId(), list); + // 倒叙排放 + Collections.reverse(list); + StringBuilder organizeIdTree = new StringBuilder(); + for (String organizeParentId : list) { + organizeIdTree.append("," + organizeParentId); + } + String organizeParentIdTree = organizeIdTree.toString(); + if (StringUtil.isNotEmpty(organizeParentIdTree)) { + organizeParentIdTree = organizeParentIdTree.replaceFirst(",", ""); + } + return organizeParentIdTree; + } + +// /** +// * 获取父级组织id +// * +// * @param entity +// * @return +// */ +// private String getOrganizeIdTrees(OrganizeEntity entity) { +// List list = new ArrayList<>(); +// organizeService.getOrganizeIdTree(entity.getId(), list); +// // 倒叙排放 +// Collections.reverse(list); +// StringBuffer organizeIdTree = new StringBuffer(); +// for (String organizeParentId : list) { +// organizeIdTree.append("," + organizeParentId); +// } +// String organizeParentIdTree = organizeIdTree.toString(); +// if (StringUtil.isNotEmpty(organizeParentIdTree)) { +// organizeParentIdTree = organizeParentIdTree.replaceFirst(",", ""); +// } +// return organizeParentIdTree; +// } +// +// @GetMapping("/aaa") +// public void aaa() { +// List list = organizeService.getList(); +// list.forEach(t->{ +// String organizeIdTree = getOrganizeIdTrees(t); +// t.setOrganizeIdTree(organizeIdTree); +// organizeService.updateById(t); +// }); +// } + + /** + * 获取默认当前值部门ID + * + * @param organizeConditionModel 参数 + * @return 执行结构 + * @throws DataException ignore + */ + @Operation(summary = "获取默认当前值部门ID") + @Parameters({ + @Parameter(name = "organizeConditionModel", description = "参数", required = true) + }) + @PostMapping("/getDefaultCurrentValueDepartmentId") + public ActionResult getDefaultCurrentValueDepartmentId(@RequestBody OrganizeConditionModel organizeConditionModel) throws DataException { + String departmentId = organizeService.getDefaultCurrentValueDepartmentId(organizeConditionModel); + Map dataMap = new HashMap(); + dataMap.put("departmentId", departmentId); + return ActionResult.success("查询成功", dataMap); + } + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/PermissionGroupController.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/PermissionGroupController.java new file mode 100644 index 0000000..51b0a29 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/PermissionGroupController.java @@ -0,0 +1,285 @@ +package jnpf.permission.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import jnpf.base.ActionResult; +import jnpf.base.Pagination; +import jnpf.base.controller.SuperController; +import jnpf.base.vo.ListVO; +import jnpf.base.vo.PageListVO; +import jnpf.base.vo.PaginationVO; +import jnpf.config.ConfigValueUtil; +import jnpf.constant.MsgCode; +import jnpf.database.util.TableUtil; +import jnpf.model.FlowWorkModel; +import jnpf.permission.entity.AuthorizeEntity; +import jnpf.permission.entity.PermissionGroupEntity; +import jnpf.permission.model.permissiongroup.PermissionGroupListVO; +import jnpf.permission.model.permissiongroup.PermissionGroupModel; +import jnpf.permission.model.user.UserIdListVo; +import jnpf.permission.model.user.mod.UserIdModel; +import jnpf.permission.service.AuthorizeService; +import jnpf.permission.service.PermissionGroupService; +import jnpf.permission.service.UserService; +import jnpf.util.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.*; + +import java.util.*; +import java.util.stream.Collectors; + +@RestController +@Tag(name = "权限组控制器", description = "PermissionGroup") +@RequestMapping("/api/permission/PermissionGroup") +public class PermissionGroupController extends SuperController { + + @Autowired + private PermissionGroupService permissionGroupService; + @Autowired + private UserService userService; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private AuthorizeService authorizeService; + + /** + * 列表 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "列表") + @SaCheckPermission("permission.authorize") + @GetMapping + public ActionResult> list(Pagination pagination) { + List data = permissionGroupService.list(pagination); + List list = JsonUtil.getJsonToList(data, PermissionGroupListVO.class); + list.forEach(t -> { + String permissionMember = t.getPermissionMember(); + if (StringUtil.isEmpty(permissionMember)) { + t.setPermissionMember(""); + return; + } + List fullNameByIds = userService.getFullNameByIds(Arrays.asList(permissionMember.split(","))); + StringJoiner stringJoiner = new StringJoiner(","); + fullNameByIds.forEach(stringJoiner::add); + t.setPermissionMember(stringJoiner.toString()); + }); + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(list, paginationVO); + } + + /** + * 下拉选择 + * + * @return + */ + @Operation(summary = "下拉框") + @SaCheckPermission("permission.authorize") + @GetMapping("/Selector") + public ActionResult> list() { + List data = permissionGroupService.list(true, null); + List list = JsonUtil.getJsonToList(data, FlowWorkModel.class); + list.forEach(t -> t.setIcon("icon-ym icon-ym-authGroup")); + ListVO listVO = new ListVO<>(); + listVO.setList(list); + return ActionResult.success(listVO); + } + + /** + * 查看权限成员 + * + * @param id 主键 + * @return + */ + @Operation(summary = "权限成员") + @SaCheckPermission("permission.authorize") + @Parameter(name = "id", description = "主键", required = true) + @GetMapping("/PermissionMember/{id}") + public ActionResult> permissionMember(@PathVariable("id") String id) { + PermissionGroupEntity entity = permissionGroupService.permissionMember(id); + if (entity == null) { + return ActionResult.fail(MsgCode.FA003.get()); + } + ListVO listVO = new ListVO<>(); + List list = new ArrayList<>(); + if (StringUtil.isEmpty(entity.getPermissionMember())) { + listVO.setList(list); + return ActionResult.success(listVO); + } + List ids = Arrays.asList(entity.getPermissionMember().split(",")); + list = userService.selectedByIds(ids); + listVO.setList(list); + return ActionResult.success(listVO); + } + + /** + * 保存权限成员 + * + * @param id 主键 + * @param userIdModel 用户id模型 + * @return + */ + @Operation(summary = "保存权限成员") + @SaCheckPermission("permission.authorize") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "userIdModel", description = "用户id模型", required = true) + }) + @PostMapping("/PermissionMember/{id}") + public ActionResult> savePermissionMember(@PathVariable("id") String id, @RequestBody UserIdModel userIdModel) { + PermissionGroupEntity entity = permissionGroupService.info(id); + if (entity == null) { + return ActionResult.fail(MsgCode.FA003.get()); + } + StringJoiner stringJoiner = new StringJoiner(","); + List userId = userIdModel.getIds(); + userId.forEach(t -> { + stringJoiner.add(t); + }); + entity.setPermissionMember(stringJoiner.toString()); + // 修改前的用户 + List member = permissionGroupService.list(Collections.singletonList(id)) + .stream().filter(t -> StringUtil.isNotEmpty(t.getPermissionMember())).map(PermissionGroupEntity::getPermissionMember).collect(Collectors.toList()); + // 新的用户 + member.addAll(userId); + member = member.stream().distinct().collect(Collectors.toList()); + List userIdList = userService.getUserIdList(member, null); + permissionGroupService.update(id, entity); + userService.delCurUser(userIdList.stream().toArray(String[]::new)); + return ActionResult.success(MsgCode.SU002.get()); + } + + /** + * 详情 + * + * @param id 主键 + * @return + */ + @Operation(summary = "详情") + @SaCheckPermission("permission.authorize") + @Parameter(name = "id", description = "主键", required = true) + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) { + PermissionGroupEntity entity = permissionGroupService.info(id); + if (entity == null) { + return ActionResult.fail(MsgCode.FA003.get()); + } + PermissionGroupModel model = JsonUtil.getJsonToBean(entity, PermissionGroupModel.class); + return ActionResult.success(model); + } + + /** + * 新建 + * + * @param model 模型 + * @return + */ + @Operation(summary = "新建") + @SaCheckPermission("permission.authorize") + @Parameter(name = "id", description = "模型", required = true) + @PostMapping + public ActionResult crete(@RequestBody PermissionGroupModel model) { + PermissionGroupEntity entity = JsonUtil.getJsonToBean(model, PermissionGroupEntity.class); + if (permissionGroupService.isExistByFullName(entity.getId(), entity)) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (permissionGroupService.isExistByEnCode(entity.getId(), entity)) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + permissionGroupService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 修改 + * + * @param id 主键 + * @param model 模型 + * @return + */ + @Operation(summary = "修改") + @SaCheckPermission("permission.authorize") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "model", description = "模型", required = true) + }) + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody PermissionGroupModel model) { + PermissionGroupEntity permissionGroupEntity = permissionGroupService.info(id); + PermissionGroupEntity entity = JsonUtil.getJsonToBean(model, PermissionGroupEntity.class); + if (permissionGroupService.isExistByFullName(id, entity)) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (permissionGroupService.isExistByEnCode(id, entity)) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + if (permissionGroupEntity.getEnabledMark() == 1 && entity.getEnabledMark() == 0) { + userService.delCurRoleUser(Collections.singletonList(id)); + } + permissionGroupService.update(id, entity); + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除 + * + * @param id 主键 + * @return + */ + @Operation(summary = "删除") + @SaCheckPermission("permission.authorize") + @Parameter(name = "id", description = "主键", required = true) + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + PermissionGroupEntity entity = permissionGroupService.info(id); + if (entity == null) { + return ActionResult.fail(MsgCode.FA003.get()); + } + userService.delCurRoleUser(Collections.singletonList(id)); + permissionGroupService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + + /** + * 复制 + * + * @param id 主键 + * @return + */ + @Operation(summary = "复制") + @SaCheckPermission("permission.authorize") + @Parameter(name = "id", description = "主键", required = true) + @PostMapping("/{id}/Actions/Copy") + @Transactional + public ActionResult copy(@PathVariable("id") String id) { + PermissionGroupEntity entity = permissionGroupService.info(id); + if (entity == null) { + return ActionResult.fail("复制失败,数据不存在"); + } + String randomCode = TableUtil.getStringRandom(5); + entity.setFullName(entity.getFullName() + ".副本" + randomCode); + if (entity.getFullName().length() > 50) return ActionResult.fail(MsgCode.COPY001.get()); + entity.setEnCode(entity.getEnCode() + "." + randomCode); + entity.setId(RandomUtil.uuId()); + entity.setEnabledMark(0); + entity.setCreatorTime(new Date()); + entity.setCreatorUserId(UserProvider.getLoginUserId()); + entity.setLastModifyTime(null); + entity.setLastModifyUserId(null); + permissionGroupService.save(entity); + // 赋值权限表 + List listByObjectId = authorizeService.getListByObjectId(Collections.singletonList(id)); + listByObjectId.forEach(t -> { + t.setId(RandomUtil.uuId()); + t.setObjectId(entity.getId()); + }); + authorizeService.saveBatch(listByObjectId); + return ActionResult.success(MsgCode.SU007.get()); + } + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/PositionController.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/PositionController.java new file mode 100644 index 0000000..ef748d1 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/PositionController.java @@ -0,0 +1,502 @@ +package jnpf.permission.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import jnpf.base.controller.SuperController; +import com.alibaba.fastjson.JSONArray; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.annotation.PositionPermission; +import jnpf.base.ActionResult; +import jnpf.base.vo.PageListVO; +import jnpf.base.vo.PaginationVO; +import jnpf.base.service.DictionaryDataService; +import jnpf.base.vo.ListVO; +import jnpf.base.entity.DictionaryDataEntity; +import jnpf.constant.MsgCode; +import jnpf.constant.PermissionConst; +import jnpf.permission.entity.*; +import jnpf.exception.DataException; +import jnpf.permission.model.permission.PermissionModel; +import jnpf.permission.model.position.*; +import jnpf.permission.model.user.mod.UserIdModel; +import jnpf.permission.service.*; +import jnpf.util.*; +import jnpf.util.treeutil.ListToTreeUtil; +import jnpf.util.treeutil.SumTree; +import jnpf.util.treeutil.newtreeutil.TreeDotUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 岗位信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +@Tag(name = "岗位管理", description = "Position") +@RestController +@RequestMapping("/api/permission/Position") +public class PositionController extends SuperController { + @Autowired + private UserRelationService userRelationService; + @Autowired + private UserService userService; + @Autowired + private UserProvider userProvider; + @Autowired + private PositionService positionService; + @Autowired + private OrganizeService organizeService; + @Autowired + private DictionaryDataService dictionaryDataService; + @Autowired + private OrganizeRelationService organizeRelationService; + + /** + * 获取岗位管理信息列表 + * + * @param paginationPosition 分页模型 + * @return + */ + @Operation(summary = "获取岗位列表(分页)") + @SaCheckPermission("permission.position") + @GetMapping + public ActionResult> list(PaginationPosition paginationPosition) { + List data = positionService.getList(paginationPosition); + //添加部门信息,部门映射到organizeId + List voList = JsonUtil.getJsonToList(data, PositionListVO.class); + List collect = data.stream().map(PositionEntity::getOrganizeId).collect(Collectors.toList()); + List list = organizeService.getOrgEntityList(collect, true); + //添加部门信息 + Map orgIdNameMaps = organizeService.getInfoList(); + for (PositionListVO entity1 : voList) { + OrganizeEntity entity = list.stream().filter(t -> t.getId().equals(entity1.getOrganizeId())).findFirst().orElse(new OrganizeEntity()); + if (entity1.getOrganizeId().equals(entity.getId())) { + entity1.setDepartment(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, entity.getOrganizeIdTree(), "/")); + } + } + //将type成中文名 + List dictionaryDataEntities= dictionaryDataService.getList("dae93f2fd7cd4df999d32f8750fa6a1e", false); + for (PositionListVO entity1 : voList) { + DictionaryDataEntity entity = dictionaryDataEntities.stream().filter(t -> t.getEnCode().equals(entity1.getType())).findFirst().orElse(null); + if (entity != null) { + entity1.setType(entity.getFullName()); + } + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(paginationPosition, PaginationVO.class); + return ActionResult.page(voList, paginationVO); + } + + /** + * 列表 + * + * @return + */ + @Operation(summary = "列表") + @GetMapping("/All") + public ActionResult> listAll() { + List list = positionService.getList(true); + List vos = JsonUtil.getJsonToList(list, PositionListAllVO.class); + ListVO vo = new ListVO<>(); + vo.setList(vos); + return ActionResult.success(vo); + } + + /** + * 树形(机构+岗位) + * + * @return + */ + @Operation(summary = "获取岗位下拉列表(公司+部门+岗位)") + @GetMapping("/Selector") + public ActionResult> selector() { + List list1 = positionService.getList(false); + Map orgMaps = organizeService.getOrgMaps(null, false); + Map orgIdNameMaps = organizeService.getInfoList(); + List list2 = new ArrayList<>(orgMaps.values());; + List posList = new ArrayList<>(); + for (PositionEntity entity : list1) { + PosOrgModel posOrgModel = JsonUtil.getJsonToBean(entity, PosOrgModel.class); + String organizeId = entity.getOrganizeId(); + posOrgModel.setParentId(organizeId); + posOrgModel.setType("position"); + posOrgModel.setIcon("icon-ym icon-ym-tree-position1"); + OrganizeEntity organizeEntity = orgMaps.get(organizeId); + if (organizeEntity != null) { + posOrgModel.setOrganize(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, organizeEntity.getOrganizeIdTree(), "/")); + posOrgModel.setOrganizeIds(organizeService.getOrgIdTree(organizeEntity)); + } else { + posOrgModel.setOrganizeIds(new ArrayList<>()); + } + posList.add(posOrgModel); + } + List orgList = JsonUtil.getJsonToList(list2, PosOrgModel.class); + for (PosOrgModel entity1 : orgList) { + if ("department".equals(entity1.getType())) { + entity1.setIcon("icon-ym icon-ym-tree-department1"); + } else if ("company".equals(entity1.getType())) { + entity1.setIcon("icon-ym icon-ym-tree-organization3"); + } + OrganizeEntity organizeEntity = orgMaps.get(entity1.getId()); + if (organizeEntity != null) { + entity1.setOrganize(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, organizeEntity.getOrganizeIdTree(), "/")); + entity1.setOrganizeIds(organizeService.getOrgIdTree(organizeEntity)); + } else { + entity1.setOrganizeIds(new ArrayList<>()); + } + entity1.setOrganizeIds(new ArrayList<>()); + } + JSONArray objects = ListToTreeUtil.treeWhere(posList, orgList); + List jsonToList = JsonUtil.getJsonToList(objects, PosOrgModel.class); + + List list = new ArrayList<>(16); + // 得到角色的值 + List collect = jsonToList.stream().filter(t -> "position".equals(t.getType())).sorted(Comparator.comparing(PosOrgModel::getSortCode)).collect(Collectors.toList()); + list.addAll(collect); + jsonToList.removeAll(collect); + List collect1 = jsonToList.stream().sorted(Comparator.comparing(PosOrgModel::getSortCode).thenComparing(PosOrgModel::getCreatorTime, Comparator.reverseOrder())).collect(Collectors.toList()); + list.addAll(collect1); + + List> trees = TreeDotUtils.convertListToTreeDot(list); + List jsonToList1 = JsonUtil.getJsonToList(trees, PositionSelectorVO.class); + ListVO vo = new ListVO(); + vo.setList(jsonToList1); + return ActionResult.success(vo); + } + + /** + * 通过部门、岗位获取岗位下拉框 + * + * @param idModel 岗位选择模型 + * @return + */ + @Operation(summary = "通过部门、岗位获取岗位下拉框") + @Parameters({ + @Parameter(name = "positionConditionModel", description = "岗位选择模型", required = true) + }) + @PostMapping("/PositionCondition") + public ActionResult> positionCondition(@RequestBody UserIdModel idModel) { + // 定义返回对象 + List modelList = new ArrayList<>(); + + List list = organizeRelationService.getOrgIds(idModel.getIds(), null); + List lists = new ArrayList<>(); + list.forEach(t -> lists.add(t.split("--")[0])); + list = lists; + List collect = positionService.getListByOrganizeId(list).stream().map(PositionEntity::getId).collect(Collectors.toList()); + collect.addAll(list); + List positionName = positionService.getPositionName(collect, null); + positionName = positionName.stream().filter(t -> "1".equals(String.valueOf(t.getEnabledMark()))).collect(Collectors.toList()); + + Map orgMaps = organizeService.getOrganizeName(positionName.stream().map(PositionEntity::getOrganizeId).collect(Collectors.toList()), null, false); + Map orgIdNameMaps = organizeService.getInfoList(); + + List posOrgModels = new ArrayList<>(16); + positionName.forEach(t -> { + PosOrgConditionModel posOrgModel = JsonUtil.getJsonToBean(t, PosOrgConditionModel.class); + OrganizeEntity entity = orgMaps.get(t.getOrganizeId()); + if (entity != null) { + posOrgModel.setOrganizeId(entity.getId()); + posOrgModel.setParentId(entity.getId()); + if (StringUtil.isNotEmpty(entity.getOrganizeIdTree())) { + posOrgModel.setOrganize(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, entity.getOrganizeIdTree(), "/")); + } + } + posOrgModel.setType("position"); + posOrgModel.setIcon("icon-ym icon-ym-tree-position1"); + posOrgModels.add(posOrgModel); + }); + + // 处理组织 + orgMaps.values().forEach(org -> { + PosOrgConditionModel orgVo = JsonUtil.getJsonToBean(org, PosOrgConditionModel.class); + if ("department".equals(orgVo.getType())) { + orgVo.setIcon("icon-ym icon-ym-tree-department1"); + } else if ("company".equals(orgVo.getType())) { + orgVo.setIcon("icon-ym icon-ym-tree-organization3"); + } + // 处理断层 + if (StringUtil.isNotEmpty(org.getOrganizeIdTree())) { + List list1 = new ArrayList<>(); + String[] split = org.getOrganizeIdTree().split(","); + list1 = Arrays.asList(split); + Collections.reverse(list1); + for (String orgId : list1) { + OrganizeEntity organizeEntity1 = orgMaps.get(orgId); + if (organizeEntity1 != null && !organizeEntity1.getId().equals(orgVo.getId())) { + orgVo.setParentId(organizeEntity1.getId()); + String[] split1 = org.getOrganizeIdTree().split(organizeEntity1.getId()); + if (split1.length > 1) { + orgVo.setFullName(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, split1[1], "/")); + } + break; + } + } + } + posOrgModels.add(orgVo); + }); + + List> trees = TreeDotUtils.convertListToTreeDot(posOrgModels); + List positionSelectorVO = JsonUtil.getJsonToList(trees, PositionSelectorVO.class); + // 处理数据 + positionSelectorVO.forEach(t -> { + if (!"position".equals(t.getType())) { + t.setFullName(organizeService.getFullNameByOrgIdTree(t.getOrganizeIdTree(), "/")); + } + }); + modelList.addAll(positionSelectorVO); + ListVO vo = new ListVO(); + vo.setList(modelList); + return ActionResult.success(vo); + } + + /** + * 通过组织id获取岗位列表 + * + * @param organizeId 主键值 + * @return + */ + @Operation(summary = "通过组织id获取岗位列表") + @Parameters({ + @Parameter(name = "organizeId", description = "主键值", required = true) + }) + @SaCheckPermission("permission.position") + @GetMapping("/getList/{organizeId}") + public ActionResult> getListByOrganizeId(@PathVariable("organizeId") String organizeId) { + List list = positionService.getListByOrganizeId(Collections.singletonList(organizeId)); + List jsonToList = JsonUtil.getJsonToList(list, PositionVo.class); + return ActionResult.success(jsonToList); + } + + /** + * 获取岗位管理信息 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "获取岗位管理信息") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("permission.position") + @GetMapping("/{id}") + public ActionResult getInfo(@PathVariable("id") String id) throws DataException { + PositionEntity entity = positionService.getInfo(id); + PositionInfoVO vo = JsonUtilEx.getJsonToBeanEx(entity, PositionInfoVO.class); + String organizeId = entity.getOrganizeId(); + OrganizeEntity organizeEntity = organizeService.getInfo(organizeId); + vo.setOrganizeIdTree(StringUtil.isNotEmpty(organizeEntity.getOrganizeIdTree()) ? Arrays.asList(organizeEntity.getOrganizeIdTree().split(",")) : new ArrayList<>()); + return ActionResult.success(vo); + } + + + /** + * 新建岗位管理 + * + * @param positionCrForm 实体对象 + * @return + */ + @PositionPermission + @Operation(summary = "新建岗位管理") + @Parameters({ + @Parameter(name = "positionCrForm", description = "实体对象", required = true) + }) + @SaCheckPermission("permission.position") + @PostMapping + public ActionResult create(@RequestBody @Valid PositionCrForm positionCrForm) { + PositionEntity entity = JsonUtil.getJsonToBean(positionCrForm, PositionEntity.class); + if (positionService.isExistByFullName(entity, false)) { + return ActionResult.fail("岗位名称不能重复"); + } + if (positionService.isExistByEnCode(entity, false)) { + return ActionResult.fail("岗位编码不能重复"); + } + // 设置岗位id + entity.setId(RandomUtil.uuId()); +// createOrganizeRoleRelation(entity.getOrganizeId(), entity.getId()); + positionService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 更新岗位管理 + * + * @param id 主键值 + * @param positionUpForm 实体对象 + * @return + */ + @PositionPermission + @Operation(summary = "更新岗位管理") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true), + @Parameter(name = "positionUpForm", description = "实体对象", required = true) + }) + @SaCheckPermission("permission.position") + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid PositionUpForm positionUpForm) { + // 当岗位绑定用户不让其更改 + if(userRelationService.existByObj(PermissionConst.POSITION, id)){ + if(!positionService.getInfo(id).getOrganizeId().equals(positionUpForm.getOrganizeId())){ + return ActionResult.fail(MsgCode.FA023.get()); + } + } + PositionEntity entity = JsonUtil.getJsonToBean(positionUpForm, PositionEntity.class); + entity.setId(id); + if (positionService.isExistByFullName(entity, true)) { + return ActionResult.fail("岗位名称不能重复"); + } + if (positionService.isExistByEnCode(entity, true)) { + return ActionResult.fail("岗位编码不能重复"); + } +// createOrganizeRoleRelation(entity.getOrganizeId(), id); + boolean flag = positionService.update(id, entity); + if (flag == false) { + return ActionResult.fail(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除岗位管理 + * + * @param id 主键值 + * @return + */ + @PositionPermission + @Operation(summary = "删除岗位管理") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("permission.position") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + // 当岗位绑定用户不让其更改 + if(userRelationService.existByObj(PermissionConst.POSITION, id)){ + return ActionResult.fail(MsgCode.FA024.get()); + } + PositionEntity entity = positionService.getInfo(id); + if (entity != null) { + List userRelList = userRelationService.getListByObjectId(id); + if(userRelList.size()>0){ + return ActionResult. + fail("该岗位下有用户"); + } + for (UserRelationEntity entity1 : userRelList) { + UserEntity entity2 = userService.getById(entity1.getUserId()); + if (entity2 != null) { + String newPositionId = entity2.getPositionId().replace(id, ""); + if (entity2.getPositionId().contains(id)) { + if (newPositionId.length() != 0 && newPositionId.substring(0, 1).equals(",")) { + entity2.setPositionId(newPositionId.substring(1)); + } else if (newPositionId.length() != 0) { + entity2.setPositionId(newPositionId.replace(",,", ",")); + } + } + } + } + userRelationService.deleteAllByObjId(id); + + // 删除岗位与组织之间的关联数据 + QueryWrapper query = new QueryWrapper<>(); + query.lambda().eq(OrganizeRelationEntity::getObjectType, PermissionConst.POSITION); + query.lambda().eq(OrganizeRelationEntity::getObjectId, id); + organizeRelationService.remove(query); + + positionService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + /** + * 更新菜单状态 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "更新菜单状态") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("permission.position") + @PutMapping("/{id}/Actions/State") + public ActionResult upState(@PathVariable("id") String id) { + PositionEntity entity = positionService.getInfo(id); + if (entity != null) { + if (entity.getEnabledMark() == null ||"1".equals(String.valueOf(entity.getEnabledMark()))) { + entity.setEnabledMark(0); + } else { + entity.setEnabledMark(1); + } + positionService.update(id, entity); + return ActionResult.success(MsgCode.SU004.get()); + } + return ActionResult.fail("MsgCode.UPDATE_FAIL_NOT_EXISTS"); + } + + /** + * 通过组织id获取岗位列表 + * + * @param organizeIds 组织id数组 + * @return 岗位列表 + */ + @Operation(summary = "获取岗位列表通过组织id数组") + @Parameters({ + @Parameter(name = "organizeIds", description = "组织id数组", required = true) + }) + @SaCheckPermission("permission.user") + @PostMapping("/getListByOrgIds") + public ActionResult> getListByOrganizeIds(@RequestBody @Valid Map> organizeIds) { + List PositionModelAll = new LinkedList<>(); + for(String organizeId : organizeIds.get("organizeIds")){ + OrganizeEntity info = organizeService.getInfo(organizeId); + if(info != null){ + PermissionModel parentModel = new PermissionModel(); + List list = positionService.getListByOrganizeId(Collections.singletonList(organizeId)); + List positionModels = JsonUtil.getJsonToList(list, PermissionModel.class); + parentModel.setHasChildren(true); + parentModel.setFullName(info.getFullName()); + parentModel.setId(info.getId()); + parentModel.setChildren(positionModels); + PositionModelAll.add(parentModel); + } + } + ListVO vo = new ListVO(); + vo.setList(PositionModelAll); + return ActionResult.success(vo); + + + } + + /** + * 添加组织角色关联关系 + * + * @param organizeId 组织id + * @param positionId 岗位id + */ + private void createOrganizeRoleRelation(String organizeId, String positionId) { + // 清除之前的关联关系 + QueryWrapper query = new QueryWrapper<>(); + query.lambda().eq(OrganizeRelationEntity::getObjectType, PermissionConst.POSITION); + query.lambda().eq(OrganizeRelationEntity::getObjectId, positionId); + organizeRelationService.remove(query); + // 添加与组织的关联关系 + OrganizeRelationEntity organizeRelationEntity = new OrganizeRelationEntity(); + organizeRelationEntity.setId(RandomUtil.uuId()); + organizeRelationEntity.setOrganizeId(organizeId); + organizeRelationEntity.setObjectType(PermissionConst.POSITION); + organizeRelationEntity.setObjectId(positionId); + organizeRelationService.save(organizeRelationEntity); + } + + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/RoleController.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/RoleController.java new file mode 100644 index 0000000..9c4e9c8 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/RoleController.java @@ -0,0 +1,727 @@ +package jnpf.permission.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import com.alibaba.fastjson.JSONArray; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import jnpf.base.controller.SuperController; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.annotation.RolePermission; +import jnpf.base.ActionResult; +import jnpf.base.vo.ListVO; +import jnpf.base.vo.PaginationVO; +import jnpf.constant.JnpfConst; +import jnpf.constant.MsgCode; +import jnpf.constant.PermissionConst; +import jnpf.exception.DataException; +import jnpf.permission.entity.*; +import jnpf.permission.model.position.PosOrgConditionModel; +import jnpf.permission.model.position.PositionSelectorVO; +import jnpf.permission.model.role.*; +import jnpf.permission.model.user.mod.UserIdModel; +import jnpf.permission.service.*; +import jnpf.permission.util.PermissionUtil; +import jnpf.util.*; +import jnpf.util.treeutil.ListToTreeUtil; +import jnpf.util.treeutil.SumTree; +import jnpf.util.treeutil.newtreeutil.TreeDotUtils; +import jnpf.util.treeutil.newtreeutil.TreeDotUtils2; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 角色管理 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +@Tag(name = "角色管理", description = "Role") +@RestController +@RequestMapping("/api/permission/Role") +public class RoleController extends SuperController { + + @Autowired + private RoleService roleService; + @Autowired + private UserService userService; + @Autowired + private UserProvider userProvider; + @Autowired + private UserRelationService userRelationService; + @Autowired + private OrganizeRelationService organizeRelationService; + @Autowired + private OrganizeService organizeService; + @Autowired + private OrganizeAdministratorService organizeAdministratorService; + + /** + * 获取角色列表 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "获取角色列表") + @SaCheckPermission("permission.role") + @GetMapping + public ActionResult list(RolePagination pagination) { + // null:全部显示 0:全局 + + int globalMark; + if("0".equals(pagination.getOrganizeId())){ + // 显示全局 + globalMark = 1; + }else if("".equals(pagination.getOrganizeId())){ + // 全部显示 + globalMark = -1; + }else { + // 显示组织内 + globalMark = 0; + } + List list = roleService.getList(pagination , globalMark); + List listVO = new ArrayList<>(); + for (RoleEntity entity : list) { + // 角色类型展示 + RoleListVO vo = JsonUtil.getJsonToBean(entity, RoleListVO.class); + if(entity.getGlobalMark() != null && entity.getGlobalMark().equals(1)){ + vo.setType("全局"); + }else { + vo.setType("组织"); + QueryWrapper query = new QueryWrapper<>(); + query.lambda().eq(OrganizeRelationEntity::getObjectType, PermissionConst.ROLE); + query.lambda().eq(OrganizeRelationEntity::getObjectId, entity.getId()); + List ids = new ArrayList<>(); + for(OrganizeRelationEntity relation : organizeRelationService.list(query)) { + ids.add(relation.getOrganizeId()); + } + String orgInfos = PermissionUtil.getLinkInfoByOrgId(ids, organizeService); + if(orgInfos.length() > 0){ + vo.setOrganizeInfo(orgInfos.substring(0, orgInfos.length() -1)); + }else { + vo.setOrganizeInfo(""); + } + + } + listVO.add(vo); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(listVO,paginationVO); + } + + /** + * 角色下拉框列表 + * + * @return + */ + @Operation(summary = "角色下拉框列表") + @GetMapping("/Selector") + public ActionResult> listAll() { + List list1 = roleService.getList(true); + Map orgMaps = organizeService.getOrgMaps(null, false); + + List roleModels = new ArrayList<>(); + List modelList = new ArrayList<>(); + + // 全局展示 + RoleSelectorVO globalParent = new RoleSelectorVO(); + String globalParentId = "1"; + globalParent.setFullName("全局"); + globalParent.setId("1"); + globalParent.setId(globalParentId); + globalParent.setOnlyId("organizeList_0"); + globalParent.setIcon("icon-ym icon-ym-global-role"); + List globalModelList = JsonUtil.getJsonToList(roleService.getGlobalList(), RoleSelectorVO.class); + globalModelList.forEach(g-> { + g.setType("role"); + g.setOnlyId(UUID.randomUUID().toString()); + g.setParentId(globalParentId); + g.setIcon("icon-ym icon-ym-generator-role"); + }); + globalParent.setHasChildren(globalModelList.size() > 0); + globalParent.setChildren(globalModelList); + globalParent.setIsLeaf(false); + globalParent.setIcon("icon-ym icon-ym-global-role"); + + Map orgIdNameMaps = organizeService.getInfoList(); + List relationListByObjectIdAndType = organizeRelationService.getRelationListByType(PermissionConst.ROLE); + for (RoleEntity roleEntity : list1) { + if (roleEntity.getEnabledMark() == 0) { + continue; + } + List relationListByObjectIdAndTypes = relationListByObjectIdAndType.stream().filter(t -> roleEntity.getId().equals(t.getObjectId())).collect(Collectors.toList()); + for (OrganizeRelationEntity entity : relationListByObjectIdAndTypes) { + RoleModel roleVo = JsonUtil.getJsonToBean(roleEntity, RoleModel.class); + // 必须加这个标识,不然前端会报错 + roleVo.setType("role"); + roleVo.setOnlyId(UUID.randomUUID().toString()); + String organizeId = entity.getOrganizeId(); + roleVo.setParentId(organizeId); + roleVo.setIcon("icon-ym icon-ym-generator-role"); + OrganizeEntity organizeEntity = orgMaps.get(organizeId); + if (organizeEntity != null) { + roleVo.setOrganize(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, organizeEntity.getOrganizeIdTree(), "/")); + roleVo.setOrganizeIds(organizeService.getOrgIdTree(organizeEntity)); + } else { + roleVo.setOrganizeIds(new ArrayList<>()); + } + roleModels.add(roleVo); + } + } + List orgList = new ArrayList<>(16); + orgMaps.values().stream().forEach(org -> { + RoleModel orgVo = JsonUtil.getJsonToBean(org, RoleModel.class); + orgVo.setType(org.getCategory()); + orgVo.setIcon(StringUtil.isNotEmpty(org.getCategory()) ? "company".equals(org.getCategory()) ? "icon-ym icon-ym-tree-organization3" : "icon-ym icon-ym-tree-department1" : ""); + orgVo.setOnlyId(UUID.randomUUID().toString()); + OrganizeEntity organizeEntity = orgMaps.get(orgVo.getId()); + if (organizeEntity != null) { + orgVo.setOrganize(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, organizeEntity.getOrganizeIdTree(), "/")); + orgVo.setOrganizeIds(organizeService.getOrgIdTree(organizeEntity)); + } else { + orgVo.setOrganizeIds(new ArrayList<>()); + } + orgList.add(orgVo); + }); + + JSONArray objects = ListToTreeUtil.treeWhere(roleModels, orgList); + List jsonToList = JsonUtil.getJsonToList(objects, RoleModel.class); + + List list = new ArrayList<>(16); + // 得到角色的值 + List collect = jsonToList.stream().filter(t -> "role".equals(t.getType())).sorted(Comparator.comparing(RoleModel::getSortCode)).collect(Collectors.toList()); + list.addAll(collect); + jsonToList.removeAll(collect); + List collect1 = jsonToList.stream().sorted(Comparator.comparing(RoleModel::getSortCode).thenComparing(RoleModel::getCreatorTime, Comparator.reverseOrder())).collect(Collectors.toList()); + list.addAll(collect1); + + List> trees = TreeDotUtils2.convertListToTreeDot(list); + modelList.addAll(JsonUtil.getJsonToList(trees, RoleSelectorVO.class)); + modelList.add(globalParent); + ListVO vo = new ListVO(); + vo.setList(modelList); + return ActionResult.success(vo); + } + + /** + * 分级管理下角色下拉框列表 + * + * @return + */ + @Operation(summary = "分级管理下角色下拉框列表") + @GetMapping("/SelectorByPermission") + public ActionResult> roleListAll() { + boolean isAdministrator = userProvider.get().getIsAdministrator(); + List list1 = new ArrayList<>(16); + List list2 = organizeService.getList(false); + + List orgIdList = list2.stream().map(OrganizeEntity::getId).collect(Collectors.toList()); + + List roleModels = new ArrayList<>(); + List modelList = new ArrayList<>(); + + if (!isAdministrator) { + Set set = new HashSet<>(16); + // 获取用户分级管理的权限 + List organizeAdministratorEntity = organizeAdministratorService.getOrganizeAdministratorEntity(UserProvider.getLoginUserId()); + organizeAdministratorEntity.stream().forEach(t->{ + // 如果有本层编辑权限 + if ("1".equals(String.valueOf(t.getThisLayerEdit()))) { + set.add(t.getOrganizeId()); + } + if ("1".equals(String.valueOf(t.getSubLayerEdit()))) { + // 如果有子层编辑权限 + List underOrganizations = organizeService.getUnderOrganizations(t.getOrganizeId(), false); + set.addAll(underOrganizations); + } + }); + List finalOrganizeEntities = new ArrayList<>(16); + set.forEach(t->{ + OrganizeEntity entity = organizeService.getInfo(t); + if (entity != null) { + finalOrganizeEntities.add(entity); + } + }); + orgIdList = new ArrayList<>(set); + List relationListByOrganizeId = organizeRelationService.getRelationListByOrganizeId(finalOrganizeEntities.stream().map(OrganizeEntity::getId).collect(Collectors.toList())); + list1 = roleService.getListByIds(relationListByOrganizeId.stream().filter(t-> PermissionConst.ROLE.equals(t.getObjectType())).map(OrganizeRelationEntity::getObjectId).collect(Collectors.toList()), null, false); + } else { + list1 = roleService.getList(false); + } + list1 = list1.stream().filter(t -> t != null && t.getEnabledMark() != null && t.getEnabledMark() == 1).collect(Collectors.toList()); + for (RoleEntity roleEntity : list1) { + List relationListByObjectIdAndType = organizeRelationService.getRelationListByObjectIdAndType(PermissionConst.ROLE, roleEntity.getId()); + for (OrganizeRelationEntity entity : relationListByObjectIdAndType) { + if (!orgIdList.contains(entity.getOrganizeId())) { + continue; + } + RoleModel roleVo = JsonUtil.getJsonToBean(roleEntity, RoleModel.class); + // 必须加这个标识,不然前端会报错 + roleVo.setType("role"); + roleVo.setOnlyId(UUID.randomUUID().toString()); + roleVo.setParentId(entity.getOrganizeId()); + roleModels.add(roleVo); + } + } + List orgList = new ArrayList<>(16); + list2.stream().forEach(org -> { + RoleModel orgVo = JsonUtil.getJsonToBean(org, RoleModel.class); + orgVo.setType(org.getCategory()); + orgVo.setIcon(StringUtil.isNotEmpty(org.getCategory()) ? "company".equals(org.getCategory()) ? "icon-ym icon-ym-tree-organization3" : "icon-ym icon-ym-tree-department1" : ""); + orgVo.setOnlyId(UUID.randomUUID().toString()); + orgList.add(orgVo); + }); + JSONArray objects = ListToTreeUtil.treeWhere(roleModels, orgList); + List jsonToList = JsonUtil.getJsonToList(objects, RoleModel.class); + + List list = new ArrayList<>(16); + // 得到角色的值 + List collect = jsonToList.stream().filter(t -> "role".equals(t.getType())).sorted(Comparator.comparing(RoleModel::getSortCode)).collect(Collectors.toList()); + list.addAll(collect); + jsonToList.removeAll(collect); + List collect1 = jsonToList.stream().sorted(Comparator.comparing(RoleModel::getSortCode).thenComparing(RoleModel::getCreatorTime, Comparator.reverseOrder())).collect(Collectors.toList()); + list.addAll(collect1); + + List> trees = TreeDotUtils2.convertListToTreeDot(list); +// trees.removeAll(trees.stream().filter(t->!"-1".equals(t.getParentId())).collect(Collectors.toList())); + modelList.addAll(JsonUtil.getJsonToList(trees, RoleSelectorVO.class)); + + // 如果是管理员需要展示全局角色 + if (isAdministrator) { + // 全局展示 + RoleSelectorVO globalParent = new RoleSelectorVO(); + String globalParentId = "1"; + globalParent.setFullName("全局"); + globalParent.setId("1"); + globalParent.setId(globalParentId); + globalParent.setOnlyId("organizeList_0"); + List globalModelList = JsonUtil.getJsonToList(roleService.getGlobalList(), RoleSelectorVO.class); + globalModelList.forEach(g-> { + g.setType("role"); + g.setOnlyId(UUID.randomUUID().toString()); + g.setParentId(globalParentId); + }); + globalParent.setHasChildren(globalModelList.size() > 0); + globalParent.setChildren(globalModelList); + globalParent.setIsLeaf(false); + globalParent.setIcon("icon-ym icon-ym-global-role"); + modelList.add(globalParent); + } + ListVO vo = new ListVO(); + vo.setList(modelList); + return ActionResult.success(vo); + } + + /** + * 获取角色信息 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "获取角色信息") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("permission.role") + @GetMapping("/{id}") + public ActionResult getInfo(@PathVariable("id") String id) throws DataException { + RoleEntity entity = roleService.getInfo(id); + RoleInfoVO vo = JsonUtilEx.getJsonToBeanEx(entity, RoleInfoVO.class); + // 通过组织角色关联表获取组织 + QueryWrapper query = new QueryWrapper<>(); + query.lambda().eq(OrganizeRelationEntity::getObjectType, PermissionConst.ROLE); + query.lambda().eq(OrganizeRelationEntity::getObjectId, id); + + List ids = new ArrayList<>(); + organizeRelationService.list(query).forEach(relation->{ + ids.add(relation.getOrganizeId()); + }); + vo.setOrganizeIdsTree(PermissionUtil.getOrgIdsTree(ids, 1, organizeService)); + return ActionResult.success(vo); + } + + + + /** + * 新建角色 + * + * @param roleCrForm 角色模型 + * @return + */ + @RolePermission + @Operation(summary = "新建角色") + @Parameters({ + @Parameter(name = "roleCrForm", description = "角色模型", required = true) + }) + @SaCheckPermission("permission.role") + @PostMapping + @Transactional + public ActionResult create(@RequestBody @Valid RoleCrForm roleCrForm) { + RoleEntity entity = JsonUtil.getJsonToBean(roleCrForm, RoleEntity.class); + if (roleService.isExistByFullName(roleCrForm.getFullName(), entity.getId(), roleCrForm.getGlobalMark())) { + return ActionResult.fail("角色名称不能重复"); + } + if (roleService.isExistByEnCode(roleCrForm.getEnCode(), entity.getId())) { + return ActionResult.fail("角色编码不能重复"); + } + + // 角色的类型是啥,放organizeId,全局角色设置 + String roleId = RandomUtil.uuId(); + entity.setId(roleId); + createOrganizeRoleRelation(roleCrForm.getOrganizeIdsTree(), roleId, roleCrForm.getGlobalMark()); + roleService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 更新角色 + * + * @param id 主键值 + * @param roleUpForm roleUpForm + * @return + */ + @RolePermission + @Operation(summary = "更新角色") + @Parameters({ + @Parameter(name = "roleUpForm", description = "角色模型", required = true), + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("permission.role") + @PutMapping("/{id}") + @Transactional + public ActionResult update(@RequestBody @Valid RoleUpForm roleUpForm, @PathVariable("id") String id) throws DataException { + // 如果角色下面有用户则不允许修改角色类型和所属组织 + RoleEntity entity0 = roleService.getInfo(id); + // 组织关系 + List relationListByRoleId = organizeRelationService.getRelationListByRoleId(id); + // 得到组织id + if (entity0 != null) { + List bingUserByRoleList = userRelationService.getListByObjectId(id, PermissionConst.ROLE); + if (bingUserByRoleList.size() > 0) { + // 修改角色类型 + if (!entity0.getGlobalMark().equals(roleUpForm.getGlobalMark())) { + return ActionResult.fail(MsgCode.FA023.get()); + } + // 如果是修改状态的话 + if (!entity0.getEnabledMark().equals(roleUpForm.getEnabledMark())) { + return ActionResult.fail("更新失败!已绑定用户,无法修改状态"); + } + + } + } + + if (roleUpForm.getGlobalMark() != 1) { + List beforeOrgIds = relationListByRoleId.stream().map(OrganizeRelationEntity::getOrganizeId).collect(Collectors.toList()); + List updateOrgIds = PermissionUtil.getOrgIdsByFormTree(organizeService, roleUpForm.getOrganizeIdsTree()); + // 并集:所有未修改的ID + List unUpdateOrgIds = beforeOrgIds.stream().filter(updateOrgIds::contains).collect(Collectors.toList()); + // 差集:减少的ID + beforeOrgIds.removeAll(unUpdateOrgIds); + + // 当角色绑定用户不让其更改角色所属组织 + String info = roleService.getBindInfo(id, beforeOrgIds); + if (info != null) { + return ActionResult.fail(MsgCode.FA023.get()); + } + } + + RoleEntity entity = JsonUtil.getJsonToBean(roleUpForm, RoleEntity.class); + if (roleService.isExistByFullName(roleUpForm.getFullName(), id, roleUpForm.getGlobalMark())) { + return ActionResult.fail("角色名称不能重复"); + } + if (roleService.isExistByEnCode(roleUpForm.getEnCode(), id)) { + return ActionResult.fail("角色编码不能重复"); + } + boolean flag = roleService.update(id, entity); + if (!flag) { + return ActionResult.fail(MsgCode.FA002.get()); + } + createOrganizeRoleRelation(roleUpForm.getOrganizeIdsTree(), id, roleUpForm.getGlobalMark()); + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 添加组织角色关联关系 + */ + private Boolean createOrganizeRoleRelation(List> organizeIdsTree, String roleId, Integer globalMark) { + // 清除之前的关联关系 + QueryWrapper query = new QueryWrapper<>(); + query.lambda().eq(OrganizeRelationEntity::getObjectType, PermissionConst.ROLE); + query.lambda().eq(OrganizeRelationEntity::getObjectId, roleId); + organizeRelationService.remove(query); + // globalMark等于0时,为组织角色 + if(globalMark.equals(0)) { + List relationList = new ArrayList<>(); + for (List organizeIds : organizeIdsTree) { + // 组织id数组树最后一个数组最后一个id,是需要储存的id + String organizeId = organizeIds.get(organizeIds.size() - 1); + // 添加与组织的关联关系 + OrganizeRelationEntity organizeRelationEntity = new OrganizeRelationEntity(); + organizeRelationEntity.setId(RandomUtil.uuId()); + organizeRelationEntity.setOrganizeId(organizeId); + organizeRelationEntity.setObjectType(PermissionConst.ROLE); + organizeRelationEntity.setObjectId(roleId); + relationList.add(organizeRelationEntity); + } + organizeRelationService.saveBatch(relationList); + } + return true; + } + + /** + * 删除角色 + * + * @param id 主键值 + * @return + */ + @RolePermission + @Operation(summary = "删除角色") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("permission.role") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + // 当角色绑定用户不让其删除 + if(userRelationService.existByObj(PermissionConst.ROLE, id)){ + return ActionResult.fail(MsgCode.FA024.get()); + } + RoleEntity entity = roleService.getInfo(id); + if (entity != null) { + List userRelList = userRelationService.getListByObjectId(id); + if (userRelList.size() > 0) { + return ActionResult.fail("该角色下有数据权限"); + } + for (UserRelationEntity entity1 : userRelList) { + UserEntity entity2 = userService.getById(entity1.getUserId()); + if (entity2 != null) { + String newRoleId = entity2.getRoleId().replace(id, ""); + if (entity2.getRoleId().contains(id)) { + if (newRoleId.length() != 0 && newRoleId.substring(0, 1).equals(",")) { + entity2.setRoleId(newRoleId.substring(1)); + } else if (newRoleId.length() != 0) { + entity2.setRoleId(newRoleId.replace(",,", ",")); + } + } + } + } + // 删除所有用户角色关联 + userRelationService.deleteAllByObjId(id); + // 删除所有组织角色关联 + organizeRelationService.deleteAllByRoleId(id); + roleService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + /** + * 更新角色状态 + * + * @param id 主键值 + * @return + */ + @RolePermission + @Operation(summary = "更新角色状态") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("permission.role") + @PutMapping("/{id}/Actions/State") + public ActionResult disable(@PathVariable("id") String id) { + RoleEntity entity = roleService.getInfo(id); + if (entity != null) { + if ("1".equals(String.valueOf(entity.getEnabledMark()))) { + entity.setEnabledMark(0); + } else { + entity.setEnabledMark(1); + } + roleService.update(id, entity); + return ActionResult.success(MsgCode.SU005.get()); + } + return ActionResult.fail(MsgCode.FA007.get()); + } + + /** + * 通过组织id获取岗位列表 + * + * @param organizeIds 组织id数组 + * @return 角色列表 + */ + @Operation(summary = "获取角色列表通过组织id数组") + @Parameters({ + @Parameter(name = "organizeIds", description = "组织id数组", required = true) + }) + @SaCheckPermission("permission.user") + @PostMapping("/getListByOrgIds") + public ActionResult> getListByOrganizeIds(@RequestBody @Valid Map> organizeIds) { + List modelAll = new ArrayList<>(); + + for(String organizeId : organizeIds.get("organizeIds")){ + OrganizeEntity organizeEntity = organizeService.getInfo(organizeId); + if(organizeEntity != null){ + RoleModel organizeModel = JsonUtil.getJsonToBean(organizeEntity, RoleModel.class); + List roleRelations = organizeRelationService.getListByTypeAndOrgId(PermissionConst.ROLE, organizeId); + List> roleList = new ArrayList<>(); + for(OrganizeRelationEntity roleRelation : roleRelations){ + RoleEntity roleEntity = roleService.getInfo(roleRelation.getObjectId()); + // 非全局 + if(roleEntity.getGlobalMark() == 0 && roleEntity.getEnabledMark() == 1){ + RoleModel roleModel = JsonUtil.getJsonToBean(roleEntity, RoleModel.class); + roleModel.setHasChildren(false); + roleList.add(roleModel); + } + } + organizeModel.setHasChildren(true); + organizeModel.setChildren(roleList); + modelAll.add(organizeModel); + } + } + + // 获取全局角色 + List> models = new ArrayList<>(); + roleService.getGlobalList().forEach(r->{ + models.add(JsonUtil.getJsonToBean(r, RoleModel.class)); + }); + RoleModel modelGlobal = new RoleModel(); + modelGlobal.setFullName("全局"); + modelGlobal.setHasChildren(true); + modelGlobal.setId("0"); + modelGlobal.setChildren(models); + modelAll.add(modelGlobal); + + ListVO vo = new ListVO<>(); + vo.setList(modelAll); + return ActionResult.success(vo); + } + + /** + * 获取角色下拉框 + * + * @param idModel 岗位选择模型 + * @return + */ + @Operation(summary = "获取角色下拉框") + @Parameters({ + @Parameter(name = "idModel", description = "ids", required = true) + }) + @PostMapping("/RoleCondition") + public ActionResult> roleCondition(@RequestBody UserIdModel idModel) { + // 所有组织跟角色关联关系 + List relationListByType = organizeRelationService.getRelationListByType(PermissionConst.ROLE); + + // 定义返回对象 + List modelList = new ArrayList<>(); + List roleIds = idModel.getIds(); + List lists = organizeRelationService.getOrgIds(roleIds, PermissionConst.ROLE); + List list = new ArrayList<>(lists); + List roleIdList = new ArrayList<>(); + lists.forEach(t -> { + List collect = relationListByType.stream().filter(relationEntity -> relationEntity.getOrganizeId().equals(t)).collect(Collectors.toList()); + collect.forEach(relationEntity -> roleIdList.add(relationEntity.getObjectId())); + List collect1 = relationListByType.stream().filter(relationEntity -> relationEntity.getObjectId().equals(t)).collect(Collectors.toList()); + list.addAll(collect1.stream().map(OrganizeRelationEntity::getOrganizeId).collect(Collectors.toList())); + }); + roleIds.addAll(roleIdList); + + // 全局 + if (UserProvider.getUser().getIsAdministrator() && (idModel.getIds().contains(JnpfConst.CURRENT_GRADE) || idModel.getIds().contains(JnpfConst.CURRENT_GRADE_TYPE))) { + roleIds.addAll(roleService.getGlobalList().stream().map(RoleEntity::getId).collect(Collectors.toList())); + } + + roleIds = roleIds.stream().distinct().collect(Collectors.toList()); + List roleEntityList = roleService.getListByIds(roleIds, null, true); + List posOrgModels = new ArrayList<>(16); + roleEntityList.forEach(t -> { + if (t.getGlobalMark() != null && t.getGlobalMark() == 1) { + PosOrgConditionModel posOrgModel = JsonUtil.getJsonToBean(t, PosOrgConditionModel.class); + posOrgModel.setType("role"); + posOrgModel.setIcon("icon-ym icon-ym-generator-role"); + posOrgModel.setParentId("1"); + posOrgModel.setOnlyId(RandomUtil.uuId()); + posOrgModels.add(posOrgModel); + } else { + // 得到所有的组织id + List orgIds = relationListByType.stream().filter(relationEntity -> relationEntity.getObjectId().equals(t.getId())) + .map(OrganizeRelationEntity::getOrganizeId).collect(Collectors.toList()); + orgIds.forEach(orgId -> { + if (orgIds.size() > 1) { + if (!list.contains(orgId)) { + return; + } + } + PosOrgConditionModel posOrgModel = JsonUtil.getJsonToBean(t, PosOrgConditionModel.class); + posOrgModel.setType("role"); + posOrgModel.setIcon("icon-ym icon-ym-generator-role"); + posOrgModel.setParentId(orgId); + posOrgModel.setOrganizeId(orgId); + posOrgModel.setOnlyId(RandomUtil.uuId()); + posOrgModels.add(posOrgModel); + }); + } + }); + // 取出所有所属组织 + List orgIds = posOrgModels.stream().filter(t -> StringUtil.isNotEmpty(t.getOrganizeId())).map(PosOrgConditionModel::getOrganizeId).collect(Collectors.toList()); + List orgEntityList = organizeService.getOrgEntityList(orgIds, true); + orgEntityList.forEach(orgEntity -> { + PosOrgConditionModel posOrgModel = JsonUtil.getJsonToBean(orgEntity, PosOrgConditionModel.class); + if ("department".equals(orgEntity.getCategory())) { + posOrgModel.setIcon("icon-ym icon-ym-tree-department1"); + } else if ("company".equals(orgEntity.getCategory())) { + posOrgModel.setIcon("icon-ym icon-ym-tree-organization3"); + } + // 处理断层 + if (StringUtil.isNotEmpty(orgEntity.getOrganizeIdTree())) { + List list1 = new ArrayList<>(); + String[] split = orgEntity.getOrganizeIdTree().split(","); + list1 = Arrays.asList(split); + Collections.reverse(list1); + for (String orgId : list1) { + OrganizeEntity organizeEntity1 = orgEntityList.stream().filter(organizeEntity -> organizeEntity.getId().equals(orgId)).findFirst().orElse(null); + if (organizeEntity1 != null && !organizeEntity1.getId().equals(posOrgModel.getId())) { + posOrgModel.setParentId(organizeEntity1.getId()); + String[] split1 = orgEntity.getOrganizeIdTree().split(organizeEntity1.getId()); + if (split1.length > 1) { + posOrgModel.setFullName(organizeService.getFullNameByOrgIdTree(split1[1], "/")); + } + break; + } + } + } + posOrgModel.setOnlyId(RandomUtil.uuId()); + posOrgModels.add(posOrgModel); + }); + + if (posOrgModels.stream().anyMatch(posOrgConditionModel -> "1".equals(posOrgConditionModel.getParentId()))) { + PosOrgConditionModel globalModel = new PosOrgConditionModel(); + globalModel.setId("1"); + globalModel.setParentId("-1"); + globalModel.setFullName("全局"); + globalModel.setIcon("icon-ym icon-ym-global-role"); + globalModel.setOnlyId("organizeList_0"); + posOrgModels.add(globalModel); + } + List> trees = TreeDotUtils2.convertListToTreeDot(posOrgModels); + List positionSelectorVO = JsonUtil.getJsonToList(trees, PositionSelectorVO.class); + // 处理数据 + positionSelectorVO.forEach(t -> { + if (!"0".equals(t.getId()) && !"1".equals(t.getId()) && !"role".equals(t.getType())) { + t.setFullName(organizeService.getFullNameByOrgIdTree(t.getOrganizeIdTree(), "/")); + } + }); + modelList.addAll(positionSelectorVO); + + ListVO vo = new ListVO(); + vo.setList(modelList); + return ActionResult.success(vo); + } + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/SocialsUserController.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/SocialsUserController.java new file mode 100644 index 0000000..445ccac --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/SocialsUserController.java @@ -0,0 +1,438 @@ +package jnpf.permission.controller; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import jnpf.base.controller.SuperController; +import cn.hutool.core.collection.CollectionUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.annotation.UserPermission; +import jnpf.base.ActionResult; +import jnpf.util.NoDataSourceBind; +import jnpf.base.UserInfo; +import jnpf.config.ConfigValueUtil; +import jnpf.database.model.TenantLinkModel; +import jnpf.database.model.TenantVO; +import jnpf.database.util.TenantDataSourceUtil; +import jnpf.exception.LoginException; +import jnpf.permission.entity.SocialsUserEntity; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.model.socails.SocialsUserInfo; +import jnpf.permission.model.socails.SocialsUserModel; +import jnpf.permission.model.socails.SocialsUserVo; +import jnpf.permission.service.SocialsUserService; +import jnpf.permission.service.UserService; +import jnpf.permission.util.socials.AuthCallbackNew; +import jnpf.permission.util.socials.AuthSocialsUtil; +import jnpf.permission.util.socials.SocialsAuthEnum; +import jnpf.permission.util.socials.SocialsConfig; +import jnpf.util.JsonUtil; +import jnpf.util.RedisUtil; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import jnpf.util.data.DataSourceContextHolder; +import jnpf.util.wxutil.HttpUtil; +import lombok.extern.slf4j.Slf4j; +import me.zhyd.oauth.enums.AuthResponseStatus; +import me.zhyd.oauth.model.AuthResponse; +import me.zhyd.oauth.model.AuthUser; +import me.zhyd.oauth.request.AuthRequest; +import me.zhyd.oauth.utils.AuthStateUtils; +import org.jetbrains.annotations.Nullable; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * 单点登录 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/7/14 10:48:00 + */ +@Tag(name = "第三方登录和绑定", description = "Socials") +@RestController +@RequestMapping("/api/permission/socials") +@Slf4j +public class SocialsUserController extends SuperController { + @Autowired + private SocialsUserService socialsUserService; + @Autowired + private UserProvider userProvider; + @Autowired + private AuthSocialsUtil authSocialsUtil; + @Autowired + private UserService userService; + @Autowired + private SocialsConfig socialsConfig; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private RedisUtil redisUtil; + + /** + * 获取用户列表 + * + * @param + * @return ignore + */ + @Operation(summary = "获取用户授权列表") + @Parameters({ + @Parameter(name = "userId", description = "用户id") + }) + @GetMapping + public ActionResult> getList(@RequestParam(value = "userId", required = false) String userId) { + if (StringUtil.isEmpty(userId)) { + userId = userProvider.get().getUserId(); + } + List> platformInfos = SocialsAuthEnum.getPlatformInfos(); + String s = JSONArray.toJSONString(platformInfos); + List socialsUserVos = JsonUtil.getJsonToList(s, SocialsUserVo.class); + List config = socialsConfig.getConfig(); + List res = new ArrayList<>(); + if (config == null) { + return ActionResult.fail("第三方登录未配置!"); + } + config.stream().forEach(item -> { + socialsUserVos.stream().forEach(item2 -> { + if (item2.getEnname().toLowerCase().equals(item.getProvider())) { + res.add(item2); + } + }); + }); + //查询绑定信息 + List listByUserId = socialsUserService.getListByUserId(userId); + List listModel = JsonUtil.getJsonToList(listByUserId, SocialsUserModel.class); + res.stream().forEach(item -> { + listModel.stream().forEach(item2 -> { + if (item.getEnname().equals(item2.getSocialType())) item.setEntity(item2); + }); + }); + return ActionResult.success(res); + } + + /** + * 绑定:重定向第三方登录页面 + * + * @return ignore + */ + @Operation(summary = "重定向第三方登录页面") + @Parameters({ + @Parameter(name = "source", description = "地址", required = true) + }) + @GetMapping("/render/{source}") + @ResponseBody + public ActionResult render(@PathVariable String source) { + AuthRequest authRequest = authSocialsUtil.getAuthRequest(source, userProvider.get().getUserId(), false, null, userProvider.get().getTenantId()); + String authorizeUrl = authRequest.authorize(AuthStateUtils.createState()); + return ActionResult.success(authorizeUrl); + } + + + /** + * 设置租户库 + * + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2022/9/8 + */ + private boolean setTenantData(String tenantId, UserInfo userInfo) { + try{ + TenantDataSourceUtil.switchTenant(tenantId); + }catch (Exception e){ + return false; + } + return true; + } + + /** + * 解绑 + * + * @param userId 用户id + * @param id 主键 + * @return ignore + */ + @UserPermission + @Operation(summary = "解绑") + @Parameters({ + @Parameter(name = "userId", description = "用户id"), + @Parameter(name = "id", description = "主键", required = true) + }) + @DeleteMapping("/{id}") + public ActionResult deleteSocials(@RequestParam(value = "userId",required = false)String userId,@PathVariable("id") String id) { + SocialsUserEntity byId = socialsUserService.getById(id); + UserInfo userInfo = userProvider.get(); + boolean b = socialsUserService.removeById(id); + if (b) { + //多租户开启-解除绑定 + if (configValueUtil.isMultiTenancy()) { + String param = "?userId=" + byId.getUserId() + "&tenantId=" + userInfo.getTenantId() + "&socialsType=" + byId.getSocialType(); + JSONObject object = HttpUtil.httpRequest(configValueUtil.getMultiTenancyUrl() + "socials" + param, "DELETE", null); + if (object == null || "500".equals(object.get("code").toString()) || "400".equals(object.getString("code"))) { + return ActionResult.fail("多租户解绑失败"); + } + } + return ActionResult.success("解绑成功"); + } + return ActionResult.fail("解绑失败"); + } + + + @GetMapping("/list") + @NoDataSourceBind + public List getLoginList(@RequestParam("ticket") String ticket) { + if (!socialsConfig.isSocialsEnabled()) return null; + List> platformInfos = SocialsAuthEnum.getPlatformInfos(); + String s = JSONArray.toJSONString(platformInfos); + List socialsUserVos = JsonUtil.getJsonToList(s, SocialsUserVo.class); + List config = socialsConfig.getConfig(); + List res = new ArrayList<>(); + config.stream().forEach(item -> { + socialsUserVos.stream().forEach(item2 -> { + if (item2.getEnname().toLowerCase().equals(item.getProvider())) { + AuthRequest authRequest = authSocialsUtil.getAuthRequest(item2.getEnname(), null, true, ticket, null); + String authorizeUrl = authRequest.authorize(AuthStateUtils.createState()); + item2.setRenderUrl(authorizeUrl); + res.add(item2); + } + }); + }); + return res; + } + + @GetMapping("/getSocialsUserInfo") + @NoDataSourceBind + public SocialsUserInfo getSocialsUserInfo(@RequestParam("source") String source, @RequestParam("code") String code, + @RequestParam(value = "state", required = false) String state) throws LoginException { + //获取第三方请求 + AuthCallbackNew callback = setAuthCallback(code, state); + AuthRequest authRequest = authSocialsUtil.getAuthRequest(source, null, false, null, null); + AuthResponse res = authRequest.login(callback); + if(AuthResponseStatus.FAILURE.getCode()==res.getCode()){ + throw new LoginException("连接失败!"); + }else if(AuthResponseStatus.SUCCESS.getCode()!=res.getCode()){ + throw new LoginException("授权失败:"+res.getMsg()); + } + //登录用户第三方id + String uuid = getSocialUuid(res); + String socialName=StringUtil.isNotEmpty(res.getData().getUsername())?res.getData().getUsername():res.getData().getNickname(); + SocialsUserInfo socialsUserInfo = getUserInfo(source, uuid, socialName); + return socialsUserInfo; + } + + /** + * 获取用户绑定信息列表 + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2022/9/20 + */ + @NoDataSourceBind + public SocialsUserInfo getUserInfo(String source, String uuid, String socialName) throws LoginException { + SocialsUserInfo socialsUserInfo=new SocialsUserInfo(); + UserInfo userInfo=new UserInfo(); + //查询租户绑定 + if ("wechat_applets".equals(source)) { + source = "wechat_open"; + } + if (configValueUtil.isMultiTenancy()) { + JSONObject object = HttpUtil.httpRequest(configValueUtil.getMultiTenancyUrl() + "socials/list?socialsId=" + uuid, "GET", null); + if (object == null || "500".equals(object.get("code").toString()) || "400".equals(object.getString("code"))) { + throw new LoginException("租户绑定信息查询错误!"); + } + if ("200".equals(object.get("code").toString())) { + JSONArray data = JSONArray.parseArray(object.get("data").toString()); + int size = data.size(); + System.out.println(size); + if (data == null || data.size() == 0) { + socialsUserInfo.setSocialUnionid(uuid); + socialsUserInfo.setSocialName(socialName); + return socialsUserInfo; + } else if (data.size() == 1) { + //租户开启时-切换租户库 + JSONObject oneUser = (JSONObject) data.get(0); + setTenantData(oneUser.get("tenantId").toString(), userInfo); + List list = socialsUserService.getUserIfnoBySocialIdAndType(uuid, source); + if (CollectionUtil.isEmpty(list)) { + throw new LoginException("第三方未绑定账号!"); + } + UserEntity infoById = userService.getInfo(list.get(0).getUserId()); + userInfo = JsonUtil.getJsonToBean(infoById, UserInfo.class); + userInfo.setUserId(infoById.getId()); + userInfo.setUserAccount(oneUser.get("tenantId").toString() + "@" + infoById.getAccount()); + socialsUserInfo.setTenantUserInfo(data); + socialsUserInfo.setUserInfo(userInfo); + } else { + socialsUserInfo.setTenantUserInfo(data); + } + } + } else {//非多租户 + //查询绑定 + List list = socialsUserService.getUserIfnoBySocialIdAndType(uuid, source); + if (CollectionUtil.isNotEmpty(list)) { + UserEntity infoById = userService.getInfo(list.get(0).getUserId()); + userInfo = JsonUtil.getJsonToBean(infoById, UserInfo.class); + userInfo.setUserId(infoById.getId()); + userInfo.setUserAccount(infoById.getAccount()); + socialsUserInfo.setUserInfo(userInfo); + } else { + socialsUserInfo.setSocialUnionid(uuid); + socialsUserInfo.setSocialName(socialName); + } + } + return socialsUserInfo; + } + + /** + * 绑定 + * + * @return ignore + */ + @GetMapping("/callback") + @ResponseBody + @NoDataSourceBind + public JSONObject binding(@RequestParam("source") String source, + @RequestParam(value = "userId", required = false) String userId, + @RequestParam(value = "tenantId", required = false) String tenantId, + @RequestParam(value = "code", required = false) String code, + @RequestParam(value = "state", required = false) String state) { + log.info("进入callback:" + source + " callback params:"); + //获取第三方请求 + AuthCallbackNew callback = setAuthCallback(code, state); + //租户开启时-切换租户库 + if (configValueUtil.isMultiTenancy()) { + boolean b = setTenantData(tenantId, new UserInfo()); + if (!b) { + return resultJson(201, "查询租户信息错误!"); + } + + } + //获取第三方请求 + AuthRequest authRequest = authSocialsUtil.getAuthRequest(source, userId, false, null, null); + AuthResponse res = authRequest.login(callback); + log.info(JSONObject.toJSONString(res)); + if (res.ok()) { + String uuid = getSocialUuid(res); + List userIfnoBySocialIdAndType = socialsUserService.getUserIfnoBySocialIdAndType(uuid, source); + if (CollectionUtil.isNotEmpty(userIfnoBySocialIdAndType)) { + UserEntity info = userService.getInfo(userIfnoBySocialIdAndType.get(0).getUserId()); + return resultJson(201, "当前账户已被" + info.getRealName() + "/" + info.getAccount() + "绑定,不能重复绑定"); + } + SocialsUserEntity socialsUserEntity = new SocialsUserEntity(); + socialsUserEntity.setUserId(userId); + socialsUserEntity.setSocialType(source); + socialsUserEntity.setSocialName(res.getData().getUsername()); + socialsUserEntity.setSocialId(uuid); + socialsUserEntity.setCreatorTime(new Date()); + boolean save = socialsUserService.save(socialsUserEntity); + + //租户开启时-添加租户库绑定数据 + if (configValueUtil.isMultiTenancy() && save) { + JSONObject params = (JSONObject) JSONObject.toJSON(socialsUserEntity); + UserEntity info = userService.getInfo(userId); + params.put("tenantId", tenantId); + params.put("account", info.getAccount()); + params.put("accountName", info.getRealName() + "/" + info.getAccount()); + JSONObject object = HttpUtil.httpRequest(configValueUtil.getMultiTenancyUrl() + "socials", "POST", params.toJSONString()); + if (object == null || "500".equals(object.get("code").toString()) || "400".equals(object.getString("code"))) { + return resultJson(201, "用户租户绑定错误!"); + } + } + return resultJson(200, "绑定成功!"); + + } + return resultJson(201, "第三方回调失败!"); + } + + /** + * 设置第三方code state参数 + * + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2022/9/8 + */ + private AuthCallbackNew setAuthCallback(String code, String state) { + AuthCallbackNew callback = new AuthCallbackNew(); + callback.setAuthCode(code); + callback.setAuth_code(code); + callback.setAuthorization_code(code); + callback.setCode(code); + callback.setState(state); + return callback; + } + + /** + * 返回json + * + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2022/9/8 + */ + private JSONObject resultJson(int code, String message) { + JSONObject jsonObject = new JSONObject(); + jsonObject.put("code", code); + jsonObject.put("message", message); + return jsonObject; + } + private String getSocialUuid(AuthResponse res) { + String uuid = res.getData().getUuid(); + if (res.getData().getToken() != null && StringUtil.isNotEmpty(res.getData().getToken().getUnionId())) { + uuid = res.getData().getToken().getUnionId(); + } + return uuid; + } + + /** + * 绑定 + * + * @return ignore + */ + @GetMapping("/loginbind") + @ResponseBody + @NoDataSourceBind + public void loginAutoBinding(@RequestParam("socialType") String socialType, + @RequestParam("socialUnionid") String socialUnionid, + @RequestParam("socialName") String socialName, + @RequestParam("userId") String userId, + @RequestParam(value = "tenantId", required = false) String tenantId) { + //查询租户绑定 + if ("wechat_applets".equals(socialType)) { + socialType = "wechat_open"; + } + //租户开启时-切换租户库 + if (configValueUtil.isMultiTenancy()) { + setTenantData(tenantId, new UserInfo()); + } + List list = socialsUserService.getListByUserIdAndSource(userId, socialType); + if(CollectionUtil.isNotEmpty(list)){//账号已绑定该第三方其他账号,则不绑定 + return; + } + SocialsUserEntity socialsUserEntity = new SocialsUserEntity(); + socialsUserEntity.setUserId(userId); + socialsUserEntity.setSocialType(socialType); + socialsUserEntity.setSocialName(socialName); + socialsUserEntity.setSocialId(socialUnionid); + socialsUserEntity.setCreatorTime(new Date()); + boolean save = socialsUserService.save(socialsUserEntity); + //租户开启时-添加租户库绑定数据 + if (configValueUtil.isMultiTenancy() && save) { + JSONObject params = (JSONObject) JSONObject.toJSON(socialsUserEntity); + UserEntity info = userService.getInfo(userId); + params.put("tenantId", tenantId); + params.put("account", info.getAccount()); + params.put("accountName", info.getRealName() + "/" + info.getAccount()); + JSONObject object = HttpUtil.httpRequest(configValueUtil.getMultiTenancyUrl() + "socials", "POST", params.toJSONString()); + + } + } +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/UserController.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/UserController.java new file mode 100644 index 0000000..36789c3 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/UserController.java @@ -0,0 +1,1471 @@ +package jnpf.permission.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import jnpf.base.controller.SuperController; +import cn.xuyanwu.spring.file.storage.FileInfo; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.annotation.UserPermission; +import jnpf.base.Page; +import jnpf.base.UserInfo; +import jnpf.base.vo.DownloadVO; +import jnpf.config.ConfigValueUtil; +import jnpf.constant.MsgCode; +import jnpf.constant.PermissionConst; +import jnpf.engine.service.FlowTaskService; +import jnpf.exception.ImportException; +import jnpf.message.service.SynThirdDingTalkService; +import jnpf.message.service.SynThirdQyService; +import jnpf.model.FlowWorkListVO; +import jnpf.model.FlowWorkModel; +import jnpf.permission.entity.*; +import jnpf.permission.model.user.UserIdListVo; +import jnpf.permission.model.user.WorkHandoverModel; +import jnpf.permission.model.user.form.UserCrForm; +import jnpf.permission.model.user.form.UserResetPasswordForm; +import jnpf.permission.model.user.form.UserUpForm; +import jnpf.permission.model.user.mod.*; +import jnpf.permission.model.user.page.PageUser; +import jnpf.permission.model.user.page.PaginationUser; +import jnpf.permission.model.user.vo.*; +import jnpf.permission.rest.PullUserUtil; +import jnpf.permission.util.PermissionUtil; +import jnpf.util.*; +import jnpf.base.ActionResult; +import jnpf.base.vo.PageListVO; +import jnpf.base.Pagination; +import jnpf.base.vo.PaginationVO; +import jnpf.base.vo.ListVO; +import jnpf.exception.DataException; +import jnpf.permission.service.*; +import jnpf.util.treeutil.SumTree; +import jnpf.util.treeutil.newtreeutil.TreeDotUtils; +import lombok.Cleanup; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.util.*; +import java.util.concurrent.Executor; +import java.util.stream.Collectors; + +/** + * 用户管理 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +@Tag(name = "用户管理", description = "Users") +@Slf4j +@RestController +@RequestMapping("/api/permission/Users") +public class UserController extends SuperController { + + @Autowired + private CacheKeyUtil cacheKeyUtil; + @Autowired + private SynThirdQyService synThirdQyService; + @Autowired + private SynThirdDingTalkService synThirdDingTalkService; + @Autowired + private ConfigValueUtil configValueUtil; + + /*=== the same ===*/ + + @Autowired + private UserService userService; + @Autowired + private UserProvider userProvider; + @Autowired + private OrganizeService organizeService; + @Autowired + private RedisUtil redisUtil; + @Autowired + private UserRelationService userRelationService; + @Autowired + private RoleService roleService; + @Autowired + private OrganizeRelationService organizeRelationService; + @Autowired + private PermissionGroupService permissionGroupService; + @Autowired + private PositionService positionService; + @Autowired + private GroupService groupService; + @Autowired + private FlowTaskService flowTaskApi; + + /** + * 取出线程池 + */ + @Autowired + private Executor threadPoolExecutor; + + /** + * 获取用户列表 + * + * @param pagination 分页参数 + * @return ignore + */ + @Operation(summary = "获取用户列表") + @GetMapping + public ActionResult> getList(PaginationUser pagination) { + List userList = userService.getList(pagination, pagination.getOrganizeId(), false, true); + List list = new ArrayList<>(); + Map orgIdNameMaps = organizeService.getInfoList(); + for (UserEntity userEntity : userList) { + UserListVO userVO = JsonUtil.getJsonToBean(userEntity, UserListVO.class); + userVO.setHandoverMark(userEntity.getHandoverMark() == null ? 0 : userEntity.getHandoverMark()); + userVO.setHeadIcon(UploaderUtil.uploaderImg(userVO.getHeadIcon())); + // 时间小于当前时间则判断已解锁 + if (userVO.getEnabledMark() != null && userVO.getEnabledMark() != 0) { + if (Objects.nonNull(userEntity.getUnlockTime()) && userEntity.getUnlockTime().getTime() > System.currentTimeMillis()) { + userVO.setEnabledMark(2); + } else if (Objects.nonNull(userEntity.getUnlockTime()) && userEntity.getUnlockTime().getTime() < System.currentTimeMillis()) { + userVO.setEnabledMark(1); + } + } + List orgRelationByUserId = userRelationService.getAllOrgRelationByUserId(userEntity.getId()); + // 储存组织id信息 + StringJoiner stringJoiner = new StringJoiner(","); + for (UserRelationEntity userRelationEntity : orgRelationByUserId) { + // 获取组织id详情 + OrganizeEntity entity = organizeService.getInfo(userRelationEntity.getObjectId()); + if (entity != null) { + // 获取到组织树 + String organizeIdTree = entity.getOrganizeIdTree(); + if (StringUtil.isNotEmpty(organizeIdTree)) { + stringJoiner.add(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, organizeIdTree, "/")); + } + } + } + userVO.setOrganize(stringJoiner.toString()); + list.add(userVO); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(list, paginationVO); + } + + /** + * 获取用户列表 + * + * @return ignore + */ + @Operation(summary = "获取所有用户列表") + @GetMapping("/All") + public ActionResult> getAllUsers(Pagination pagination) { + List list = userService.getList(pagination, null, false, false); + List user = JsonUtil.getJsonToList(list, UserAllVO.class); + ListVO vo = new ListVO<>(); + vo.setList(user); + return ActionResult.success(vo); + } + + /** + * IM通讯获取用户接口 + * + * @param pagination 分页参数 + * @return ignore + */ + @Operation(summary = "IM通讯获取用户") + @GetMapping("/ImUser") + public ActionResult> getAllImUserUsers(Pagination pagination) { + List data = userService.getList(pagination, true); + List list = new ArrayList<>(); + Map orgMaps = organizeService.getOrganizeName(data.stream().map(t -> t.getOrganizeId()).collect(Collectors.toList()), null, false); + for (UserEntity entity : data) { + ImUserListVo user = JsonUtil.getJsonToBean(entity, ImUserListVo.class); + OrganizeEntity organize = orgMaps.get(entity.getOrganizeId()); + user.setDepartment(organize != null ? organize.getFullName() : ""); + user.setHeadIcon(UploaderUtil.uploaderImg(entity.getHeadIcon())); + list.add(user); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(list, paginationVO); + } + + /** + * 获取用户下拉框列表 + * + * @return ignore + */ + @Operation(summary = "获取用户下拉框列表") + @GetMapping("/Selector") + public ActionResult> selector() { + Map orgMaps = organizeService.getOrgMaps(null, true); + List organizeData = new ArrayList<>(orgMaps.values()); + List userData = userService.getList(true); + List treeList = JsonUtil.getJsonToList(organizeData, UserSelectorModel.class); + for (UserSelectorModel entity1 : treeList) { + if ("department".equals(entity1.getType())) { + entity1.setIcon("icon-ym icon-ym-tree-department1"); + } else if ("company".equals(entity1.getType())) { + entity1.setIcon("icon-ym icon-ym-tree-organization3"); + } + } + for (UserEntity entity : userData) { + UserSelectorModel treeModel = new UserSelectorModel(); + treeModel.setId(entity.getId()); + treeModel.setParentId(entity.getOrganizeId()); + treeModel.setFullName(entity.getRealName() + "/" + entity.getAccount()); + treeModel.setType("user"); + treeModel.setIcon("icon-ym icon-ym-tree-user2"); + treeList.add(treeModel); + } + List> trees = TreeDotUtils.convertListToTreeDot(treeList); + List listvo = JsonUtil.getJsonToList(trees, UserSelectorVO.class); + List entities = organizeData.stream().filter( + t -> "-1".equals(t.getParentId()) + ).collect(Collectors.toList()); + Iterator iterator = listvo.iterator(); + while (iterator.hasNext()) { + UserSelectorVO userSelectorVO = iterator.next(); + for (OrganizeEntity entity : entities) { + if (entity.getId().equals(userSelectorVO.getParentId())) { + iterator.remove();//使用迭代器的删除方法删除 + } + } + } + ListVO vo = new ListVO<>(); + vo.setList(listvo); + return ActionResult.success(vo); + } + + /** + * 通过部门、岗位、用户、角色、分组id获取用户列表 + * + * @param userConditionModel 用户选择模型 + * @return + */ + @Operation(summary = "通过部门、岗位、用户、角色、分组id获取用户列表") + @Parameters({ + @Parameter(name = "userConditionModel", description = "用户选择模型", required = true) + }) + @PostMapping("/UserCondition") + public ActionResult userCondition(@RequestBody UserConditionModel userConditionModel) { + List list = new ArrayList<>(16); + if (userConditionModel.getDepartIds() != null) { + list.addAll(userConditionModel.getDepartIds()); + } + if (userConditionModel.getRoleIds() != null) { + list.addAll(userConditionModel.getRoleIds()); + } + if (userConditionModel.getPositionIds() != null) { + list.addAll(userConditionModel.getPositionIds()); + } + if (userConditionModel.getGroupIds() != null) { + list.addAll(userConditionModel.getGroupIds()); + } + if (list.size() == 0) { + list = userRelationService.getListByObjectType(userConditionModel.getType()).stream().map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + if (PermissionConst.GROUP.equals(userConditionModel.getType())) { + List groupList = groupService.getListByIds(list, true); + list = groupList.stream().map(GroupEntity::getId).collect(Collectors.toList()); + } + if (PermissionConst.ORGANIZE.equals(userConditionModel.getType())) { + List orgList = organizeService.getOrgEntityList(list, true); + list = orgList.stream().map(OrganizeEntity::getId).collect(Collectors.toList()); + } + if (PermissionConst.ROLE.equals(userConditionModel.getType())) { + List roleList = roleService.getListByIds(list, null, false); + list = roleList.stream().filter(t -> t.getEnabledMark() == 1).map(RoleEntity::getId).collect(Collectors.toList()); + } + if (PermissionConst.POSITION.equals(userConditionModel.getType())) { + List positionList = positionService.getPosList(list); + list = positionList.stream().filter(t -> t.getEnabledMark() == 1).map(PositionEntity::getId).collect(Collectors.toList()); + } + } + List collect = userRelationService.getListByObjectIdAll(list).stream().map(UserRelationEntity::getUserId).collect(Collectors.toList()); + if (userConditionModel.getUserIds() != null) { + collect.addAll(userConditionModel.getUserIds()); + } + collect = collect.stream().distinct().collect(Collectors.toList()); + List userName = userService.getUserName(collect, userConditionModel.getPagination()); + List jsonToList = JsonUtil.getJsonToList(userName, UserIdListVo.class); + Map orgIdNameMaps = organizeService.getInfoList(); + jsonToList.forEach(t -> { + t.setHeadIcon(UploaderUtil.uploaderImg(t.getHeadIcon())); + t.setFullName(t.getRealName() + "/" + t.getAccount()); + List listByUserId = userRelationService.getListByUserId(t.getId(), PermissionConst.ORGANIZE); + List orgId = listByUserId.stream().map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + List organizeName = new ArrayList<>(organizeService.getOrganizeName(orgId, null, false).values()); + StringBuilder stringBuilder = new StringBuilder(); + organizeName.forEach(org -> { + if (StringUtil.isNotEmpty(org.getOrganizeIdTree())) { + String fullNameByOrgIdTree = organizeService.getFullNameByOrgIdTree(orgIdNameMaps, org.getOrganizeIdTree(), "/"); + stringBuilder.append(","); + stringBuilder.append(fullNameByOrgIdTree); + } + }); + if (stringBuilder.length() > 0) { + t.setOrganize(stringBuilder.toString().replaceFirst(",", "")); + } + }); + PaginationVO paginationVO = JsonUtil.getJsonToBean(userConditionModel.getPagination(), PaginationVO.class); + return ActionResult.page(jsonToList, paginationVO); + } + + /** + * 获取用户下拉框列表 + * + * @param organizeIdForm 组织id + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "获取用户下拉框列表") + @Parameters({ + @Parameter(name = "organizeId", description = "组织id", required = true), + @Parameter(name = "pagination", description = "分页模型", required = true) + }) + @PostMapping("/ImUser/Selector/{organizeId}") + public ActionResult imUserSelector(@PathVariable("organizeId") String organizeIdForm, @RequestBody Pagination pagination) { + String organizeId = XSSEscape.escape(organizeIdForm); + List jsonToList = new ArrayList<>(); + Map orgIdNameMaps = organizeService.getInfoList(); + Map orgMaps = organizeService.getOrgMaps(null, true); + //判断是否搜索关键字 + if (StringUtil.isNotEmpty(pagination.getKeyword())) { + //通过关键字查询 + List list = userService.getList(pagination, false); + //遍历用户给要返回的值插入值 + for (UserEntity entity : list) { + UserSelectorVO vo = JsonUtil.getJsonToBean(entity, UserSelectorVO.class); + vo.setParentId(entity.getOrganizeId()); + vo.setFullName(entity.getRealName() + "/" + entity.getAccount()); + vo.setType("user"); + vo.setIcon("icon-ym icon-ym-tree-user2"); + vo.setHeadIcon(UploaderUtil.uploaderImg(vo.getHeadIcon())); + List listByUserId = userRelationService.getListByUserId(entity.getId()).stream().filter(t -> t != null && PermissionConst.ORGANIZE.equals(t.getObjectType())).collect(Collectors.toList()); + StringJoiner stringJoiner = new StringJoiner(","); + listByUserId.forEach(t -> { + OrganizeEntity organizeEntity = orgMaps.get(t.getObjectId()); + if (organizeEntity != null) { + String fullNameByOrgIdTree = organizeService.getFullNameByOrgIdTree(orgIdNameMaps, organizeEntity.getOrganizeIdTree(), "/"); + if (StringUtil.isNotEmpty(fullNameByOrgIdTree)) { + stringJoiner.add(fullNameByOrgIdTree); + } + } + }); + vo.setOrganize(stringJoiner.toString()); + vo.setHasChildren(false); + vo.setIsLeaf(true); + jsonToList.add(vo); + } + PaginationVO jsonToBean = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(jsonToList, jsonToBean); + } + //获取所有组织 + List collect = new ArrayList<>(orgMaps.values()); + //判断时候传入组织id + //如果传入组织id,则取出对应的子集 + if (!"0".equals(organizeId)) { + //通过组织查询部门及人员 + //单个组织 + OrganizeEntity organizeEntity = orgMaps.get(organizeId); + if (organizeEntity != null) { + //取出组织下的部门 + List collect1 = collect.stream().filter(t -> t.getParentId().equals(organizeEntity.getId())).collect(Collectors.toList()); + for (OrganizeEntity entitys : collect1) { + UserSelectorVO vo = JsonUtil.getJsonToBean(entitys, UserSelectorVO.class); + if ("department".equals(entitys.getCategory())) { + vo.setIcon("icon-ym icon-ym-tree-department1"); + } else if ("company".equals(entitys.getCategory())) { + vo.setIcon("icon-ym icon-ym-tree-organization3"); + } + vo.setOrganize(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, entitys.getOrganizeIdTree(), "/")); + // 判断组织下是否有人 + jsonToList.add(vo); + vo.setHasChildren(true); + vo.setIsLeaf(false); + } + //取出组织下的人员 + List entityList = userService.getListByOrganizeId(organizeId, null); + for (UserEntity entity : entityList) { + if ("0".equals(String.valueOf(entity.getEnabledMark()))) { + continue; + } + UserSelectorVO vo = JsonUtil.getJsonToBean(entity, UserSelectorVO.class); + vo.setParentId(organizeId); + vo.setFullName(entity.getRealName() + "/" + entity.getAccount()); + vo.setType("user"); + vo.setIcon("icon-ym icon-ym-tree-user2"); + List listByUserId = userRelationService.getListByUserId(entity.getId()).stream().filter(t -> t != null && PermissionConst.ORGANIZE.equals(t.getObjectType())).collect(Collectors.toList()); + StringBuilder stringBuilder = new StringBuilder(); + listByUserId.forEach(t -> { + OrganizeEntity organizeEntity1 = orgMaps.get(t.getObjectId()); + if (organizeEntity1 != null) { + String fullNameByOrgIdTree = organizeService.getFullNameByOrgIdTree(orgIdNameMaps, organizeEntity1.getOrganizeIdTree(), "/"); + if (StringUtil.isNotEmpty(fullNameByOrgIdTree)) { + stringBuilder.append("," + fullNameByOrgIdTree); + } + } + }); + if (stringBuilder.length() > 0) { + vo.setOrganize(stringBuilder.toString().replaceFirst(",", "")); + } + vo.setHeadIcon(UploaderUtil.uploaderImg(vo.getHeadIcon())); + vo.setHasChildren(false); + vo.setIsLeaf(true); + jsonToList.add(vo); + } + } + ListVO vo = new ListVO<>(); + vo.setList(jsonToList); + return ActionResult.success(vo); + } + + //如果没有组织id,则取出所有组织 + jsonToList = JsonUtil.getJsonToList(collect.stream().filter(t -> "-1".equals(t.getParentId())).collect(Collectors.toList()), UserSelectorVO.class); + //添加图标 + for (UserSelectorVO userSelectorVO : jsonToList) { + userSelectorVO.setIcon("icon-ym icon-ym-tree-organization3"); + userSelectorVO.setHasChildren(true); + userSelectorVO.setIsLeaf(false); + userSelectorVO.setOrganize(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, orgMaps.get(userSelectorVO.getId()).getOrganizeIdTree(), "/")); + } + ListVO vo = new ListVO<>(); + vo.setList(jsonToList); + return ActionResult.success(vo); + } + + /** + * 获取用户下拉框列表 + * + * @param organizeId 组织id + * @param page 关键字 + * @return + */ + @Operation(summary = "获取用户下拉框列表") + @Parameters({ + @Parameter(name = "organizeId", description = "组织id", required = true), + @Parameter(name = "page", description = "关键字", required = true) + }) + @SaCheckPermission("permission.grade") + @PostMapping("/GetListByAuthorize/{organizeId}") + public ActionResult> getListByAuthorize(@PathVariable("organizeId") String organizeId, @RequestBody Page page) { + List jsonToList = userService.getListByAuthorize(organizeId, page); + ListVO listVO = new ListVO(); + listVO.setList(jsonToList); + return ActionResult.success(listVO); + } + + /** + * 获取用户信息 + * + * @param id 用户id + * @return ignore + */ + @Operation(summary = "获取用户信息") + @Parameters({ + @Parameter(name = "id", description = "用户id", required = true) + }) + @SaCheckPermission("permission.user") + @GetMapping("/{id}") + public ActionResult getInfo(@PathVariable("id") String id) throws DataException { + UserEntity entity = userService.getInfo(id); + if (entity == null) { + return ActionResult.fail("用户不存在"); + } + + QueryWrapper roleQuery = new QueryWrapper<>(); + roleQuery.lambda().eq(UserRelationEntity::getUserId, id); + roleQuery.lambda().eq(UserRelationEntity::getObjectType, PermissionConst.ROLE); + List roleIdList = new ArrayList<>(); + for (UserRelationEntity ure : userRelationService.list(roleQuery)) { + roleIdList.add(ure.getObjectId()); + } + + entity.setHeadIcon(UploaderUtil.uploaderImg(entity.getHeadIcon())); + // 得到组织树 + UserInfoVO vo = JsonUtilEx.getJsonToBeanEx(entity, UserInfoVO.class); + vo.setRoleId(String.join(",", roleIdList)); + + + // 获取组织id数组 + QueryWrapper query = new QueryWrapper<>(); + query.lambda().eq(UserRelationEntity::getUserId, id); + query.lambda().eq(UserRelationEntity::getObjectType, PermissionConst.ORGANIZE); + List organizeIds = new ArrayList<>(); + userRelationService.list(query).forEach(u -> { + organizeIds.add(u.getObjectId()); + }); + + // 岗位装配 + QueryWrapper positionQuery = new QueryWrapper<>(); + positionQuery.lambda().eq(UserRelationEntity::getUserId, id); + positionQuery.lambda().eq(UserRelationEntity::getObjectType, PermissionConst.POSITION); + String positionIds = ""; + for (UserRelationEntity ure : userRelationService.list(positionQuery)) { + PositionEntity info = positionService.getInfo(ure.getObjectId()); + if (info != null) { + positionIds = positionIds + "," + ure.getObjectId(); + } + } + if (positionIds.length() > 0) { + vo.setPositionId(positionIds.substring(1)); + } else { + vo.setPositionId(null); + } + // 设置分组id + List listByObjectType = userRelationService.getListByObjectType(entity.getId(), PermissionConst.GROUP); + StringBuilder groupId = new StringBuilder(); + listByObjectType.stream().forEach(t -> groupId.append("," + t.getObjectId())); + if (groupId.length() > 0) { + vo.setGroupId(groupId.toString().replaceFirst(",", "")); + } + vo.setOrganizeIdTree(PermissionUtil.getOrgIdsTree(organizeIds, 1, organizeService)); + return ActionResult.success(vo); + } + + /** + * 新建用户 + * + * @param userCrForm 表单参数 + */ + @UserPermission + @Operation(summary = "新建用户") + @Parameters({ + @Parameter(name = "userCrForm", description = "表单参数", required = true) + }) + @SaCheckPermission("permission.user") + @PostMapping + public ActionResult create(@RequestBody @Valid UserCrForm userCrForm) throws Exception { + UserEntity entity = JsonUtil.getJsonToBean(userCrForm, UserEntity.class); + entity.setPassword("4a7d1ed414474e4033ac29ccb8653d9b"); + if (userService.isExistByAccount(userCrForm.getAccount())) { + return ActionResult.fail("账户名称不能重复"); + } + userService.create(entity); + threadPoolExecutor.execute(() -> { + try { + //添加用户之后判断是否需要同步到企业微信 + synThirdQyService.createUserSysToQy(false, entity, ""); + //添加用户之后判断是否需要同步到钉钉 + synThirdDingTalkService.createUserSysToDing(false, entity, ""); + } catch (Exception e) { + log.error("添加用户之后同步失败到企业微信或钉钉失败,异常:" + e.getMessage()); + } + }); + String catchKey = cacheKeyUtil.getAllUser(); + if (redisUtil.exists(catchKey)) { + redisUtil.remove(catchKey); + } + PullUserUtil.syncUser(entity, "create", userProvider.get().getTenantId()); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 修改用户 + * + * @param userUpForm 表单参数 + * @param id 主键值 + */ + @UserPermission + @Operation(summary = "修改用户") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true), + @Parameter(name = "userUpForm", description = "表单参数", required = true) + }) + @SaCheckPermission("permission.user") + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid UserUpForm userUpForm) throws Exception { + UserEntity entity = JsonUtil.getJsonToBean(userUpForm, UserEntity.class); + //将禁用的id加进数据 + UserEntity originUser = userService.getInfo(id); + // 如果是管理员的话 + if ("1".equals(String.valueOf(originUser.getIsAdministrator()))) { + UserInfo operatorUser = userProvider.get(); + // 管理员可以修改自己,但是无法修改其他管理员 + if (operatorUser.getIsAdministrator()) { + if (originUser.getEnabledMark() != 0 && entity.getEnabledMark() == 0) { + return ActionResult.fail("无法禁用管理员用户"); + } + if (!"admin".equals(userService.getInfo(operatorUser.getUserId()).getAccount())) { + if (!operatorUser.getUserId().equals(id)) { + return ActionResult.fail("管理员只能修改自己,不能修改其他管理员"); + } + } + } else { + return ActionResult.fail("无法修改管理员账户"); + } + } + //直属主管不能是自己 + if (id.equals(userUpForm.getManagerId())) { + return ActionResult.fail("直属主管不能是自己"); + } + if (!originUser.getAccount().equals(entity.getAccount())) { + if (userService.isExistByAccount(entity.getAccount())) { + return ActionResult.fail("账户名称不能重复"); + } + } + // 验证是否有十级,验证是否是自己的下属 + boolean subordinate = userService.isSubordinate(id, userUpForm.getManagerId()); + if (subordinate) { + return ActionResult.fail("直属主管不能是我的下属用户"); + } + // 如果账号被锁定 + if ("2".equals(String.valueOf(entity.getEnabledMark()))) { + entity.setUnlockTime(null); + entity.setLogErrorCount(0); + } + // 如果原来是锁定,现在不锁定,则置空错误次数 + if (originUser.getEnabledMark() == 2 && entity.getEnabledMark() == 1) { + entity.setUnlockTime(null); + entity.setLogErrorCount(0); + } + boolean flag = userService.update(id, entity); + threadPoolExecutor.execute(() -> { + try { + //修改用户之后判断是否需要同步到企业微信 + synThirdQyService.updateUserSysToQy(false, entity, ""); + //修改用户之后判断是否需要同步到钉钉 + synThirdDingTalkService.updateUserSysToDing(false, entity, ""); + } catch (Exception e) { + log.error("修改用户之后同步失败到企业微信或钉钉失败,异常:" + e.getMessage()); + } + }); + if (!flag) { + return ActionResult.fail(MsgCode.FA002.get()); + } + // 删除在线的用户 + userService.delCurUser(id); + PullUserUtil.syncUser(entity, "update", userProvider.get().getTenantId()); + return ActionResult.success(MsgCode.SU004.get()); + } + + + /** + * 删除用户 + * + * @param id 主键值 + * @return ignore + */ + @UserPermission + @Operation(summary = "删除用户") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("permission.user") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + UserEntity entity = userService.getInfo(id); + if (entity != null) { + if ("1".equals(String.valueOf(entity.getIsAdministrator()))) { + return ActionResult.fail("无法删除管理员账户"); + } + //判断是否是部门主管 + if (organizeService.getList(false).stream().filter(t -> id.equals(t.getManagerId())).collect(Collectors.toList()).size() > 0) { + return ActionResult.fail("此用户为某部门主管,无法删除"); + } + // 有下属不允许删除 + if (userService.getListByManagerId(id, null).size() > 0) { + return ActionResult.fail("此用户有下属,无法删除"); + } + String tenantId = StringUtil.isEmpty(userProvider.get().getTenantId()) ? "" : userProvider.get().getTenantId(); + String catchKey = tenantId + "allUser"; + if (redisUtil.exists(catchKey)) { + redisUtil.remove(catchKey); + } + userService.delete(entity); + threadPoolExecutor.execute(() -> { + try { + //删除用户之后判断是否需要同步到企业微信 + synThirdQyService.deleteUserSysToQy(false, id, ""); + //删除用户之后判断是否需要同步到钉钉 + synThirdDingTalkService.deleteUserSysToDing(false, id, ""); + } catch (Exception e) { + log.error("删除用户之后同步失败到企业微信或钉钉失败,异常:" + e.getMessage()); + } + }); + userService.delCurUser(entity.getId()); + PullUserUtil.syncUser(entity, "delete", userProvider.get().getTenantId()); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + + /** + * 修改用户密码 + * + * @param id 主键 + * @param userResetPasswordForm 修改密码模型 + * @return ignore + */ + @UserPermission + @Operation(summary = "修改用户密码") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true), + @Parameter(name = "userResetPasswordForm", description = "修改密码模型", required = true) + }) + @SaCheckPermission("permission.user") + @PostMapping("/{id}/Actions/ResetPassword") + public ActionResult modifyPassword(@PathVariable("id") String id, @RequestBody @Valid UserResetPasswordForm userResetPasswordForm) { + UserEntity entity = userService.getInfo(id); + if (entity != null) { + entity.setPassword(userResetPasswordForm.getUserPassword()); + userService.updatePassword(entity); + userService.delCurUser(entity.getId()); + PullUserUtil.syncUser(entity, "modifyPassword", userProvider.get().getTenantId()); + return ActionResult.success(MsgCode.SU005.get()); + } + return ActionResult.success("操作失败,用户不存在"); + } + + /** + * 更新用户状态 + * + * @param id 主键值 + * @return ignore + */ + @Operation(summary = "更新用户状态") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("permission.user") + @PutMapping("/{id}/Actions/State") + public ActionResult disable(@PathVariable("id") String id) throws Exception { + UserEntity entity = userService.getInfo(id); + if (entity != null) { + if ("1".equals(String.valueOf(entity.getIsAdministrator()))) { + return ActionResult.fail("无法修改管理员账户状态"); + } + if (entity.getEnabledMark() != null) { + if ("1".equals(String.valueOf(entity.getEnabledMark()))) { + entity.setEnabledMark(0); + userService.delCurUser(entity.getId()); + userService.update(id, entity); + } else { + entity.setEnabledMark(1); + userService.update(id, entity); + } + } else { + entity.setEnabledMark(1); + userService.update(id, entity); + } + return ActionResult.success(MsgCode.SU005.get()); + } + return ActionResult.success("操作失败,用户不存在"); + } + + /** + * 解除锁定 + * + * @param id 主键值 + * @return ignore + */ + @Operation(summary = "解除锁定") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("permission.user") + @PutMapping("/{id}/Actions/unlock") + public ActionResult unlock(@PathVariable("id") String id) throws Exception { + UserEntity entity = userService.getInfo(id); + if (entity != null) { + // 状态变成正常 + entity.setEnabledMark(1); + entity.setUnlockTime(null); + entity.setLogErrorCount(0); + entity.setId(id); + userService.updateById(entity); + return ActionResult.success(MsgCode.SU005.get()); + } + return ActionResult.success("操作失败,用户不存在"); + } + + /** + * 获取用户基本信息 + * + * @param userIdModel 用户id + * @return ignore + */ + @Operation(summary = "获取用户基本信息") + @Parameters({ + @Parameter(name = "userIdModel", description = "用户id", required = true) + }) + @PostMapping("/getUserList") + public ActionResult> getUserList(@RequestBody UserIdModel userIdModel) { + List userName = userService.getUserName(userIdModel.getIds(), true); + List list = JsonUtil.getJsonToList(userName, UserIdListVo.class); + List listByUserIds = userRelationService.getRelationByUserIds(list.stream().map(UserIdListVo::getId).collect(Collectors.toList())); + for (UserIdListVo entity : list) { + if (entity == null) { + break; + } + entity.setFullName(entity.getRealName() + "/" + entity.getAccount()); + List listByUserId = listByUserIds.stream().filter(t -> t.getUserId().equals(entity.getId())).collect(Collectors.toList()); + StringBuilder stringBuilder = new StringBuilder(); + List orgEntityList = organizeService.getOrgEntityList(listByUserId.stream().map(UserRelationEntity::getObjectId).collect(Collectors.toList()), false); + listByUserId.forEach(t -> { + OrganizeEntity organizeEntity = orgEntityList.stream().filter(org -> org.getId().equals(t.getObjectId())).findFirst().orElse(null); + if (organizeEntity != null) { + String fullNameByOrgIdTree = organizeService.getFullNameByOrgIdTree(organizeEntity.getOrganizeIdTree(), "/"); + if (StringUtil.isNotEmpty(fullNameByOrgIdTree)) { + stringBuilder.append("," + fullNameByOrgIdTree); + } + } + }); + if (stringBuilder.length() > 0) { + entity.setOrganize(stringBuilder.toString().replaceFirst(",", "")); + } + entity.setHeadIcon(UploaderUtil.uploaderImg(entity.getHeadIcon())); + } + ListVO listVO = new ListVO<>(); + listVO.setList(list); + return ActionResult.success(listVO); + } + + /** + * 获取选中组织、岗位、角色、用户基本信息 + * + * @param userIdModel 用户id + * @return ignore + */ + @Operation(summary = "获取选中组织、岗位、角色、用户基本信息") + @Parameters({ + @Parameter(name = "userIdModel", description = "用户id", required = true) + }) + @PostMapping("/getSelectedList") + public ActionResult> getSelectedList(@RequestBody UserIdModel userIdModel) { + List ids = userIdModel.getIds(); + List list = userService.selectedByIds(ids); + ListVO listVO = new ListVO<>(); + listVO.setList(list); + return ActionResult.success(listVO); + } + + + + /** + * 获取用户基本信息 + * + * @param userIdModel 用户id + * @return ignore + */ + @Operation(summary = "获取选中用户基本信息") + @Parameters({ + @Parameter(name = "userIdModel", description = "用户id", required = true) + }) + @PostMapping("/getSelectedUserList") + public ActionResult> getSelectedUserList(@RequestBody UserIdModelByPage userIdModel) { + List jsonToList = userService.getObjList(userIdModel.getIds(), userIdModel.getPagination(), null); + PaginationVO paginationVO = JsonUtil.getJsonToBean(userIdModel.getPagination(), PaginationVO.class); + return ActionResult.page(jsonToList, paginationVO); + } + + /** + * 获取组织下的人员 + * + * @param page 页面信息 + * @return ignore + */ + @Operation(summary = "获取组织下的人员") + @GetMapping("/getOrganization") + public ActionResult> getOrganization(PageUser page) { + String departmentId = page.getOrganizeId(); + // 判断是否获取当前组织下的人员 + if ("0".equals(departmentId)) { + departmentId = userProvider.get().getDepartmentId(); + // 为空则取组织id + if (StringUtil.isEmpty(departmentId)) { + departmentId = userProvider.get().getOrganizeId(); + } + } + Map orgMaps = organizeService.getOrgMaps(null, true); + List list = userService.getListByOrganizeId(departmentId, page.getKeyword()); + List jsonToList = JsonUtil.getJsonToList(list, UserIdListVo.class); + Map orgIdNameMaps = organizeService.getInfoList(); + List listByObjectType = userRelationService.getListByObjectType(PermissionConst.ORGANIZE); + jsonToList.forEach(t -> { + t.setRealName(t.getRealName() + "/" + t.getAccount()); + t.setFullName(t.getRealName()); + List collect = listByObjectType.stream().filter(userRelationEntity -> userRelationEntity.getUserId().equals(t.getId())).map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + StringJoiner stringJoiner = new StringJoiner(","); + collect.forEach(objectId -> { + OrganizeEntity organizeEntity = orgMaps.get(objectId); + if (organizeEntity != null) { + String fullNameByOrgIdTree = organizeService.getFullNameByOrgIdTree(orgIdNameMaps, organizeEntity.getOrganizeIdTree(), "/"); + if (StringUtil.isNotEmpty(fullNameByOrgIdTree)) { + stringJoiner.add(fullNameByOrgIdTree); + } + } + }); + t.setOrganize(stringJoiner.toString()); + t.setHeadIcon(UploaderUtil.uploaderImg(t.getHeadIcon())); + }); + return ActionResult.success(jsonToList); + } + + /** + * 获取岗位人员 + * + * @param page 页面信息 + * @return ignore + */ + @Operation(summary = "获取岗位人员") + @GetMapping("/GetUsersByPositionId") + public ActionResult> getUsersByPositionId(UsersByPositionModel page) { + List list = new ArrayList<>(1); + String keyword = page.getKeyword(); + // 岗位id + String positionId = page.getPositionId(); + // 得到关联的组织id + PositionEntity positionEntity = positionService.getInfo(positionId); +// List relationListByObjectIdAndType = organizeRelationService.getRelationListByObjectIdAndType(PermissionConst.POSITION, positionId); + if (positionEntity != null) { + UserByRoleVO vo = new UserByRoleVO(); + String organizeId = positionEntity.getOrganizeId(); + // 得到组织信息 + OrganizeEntity organizeEntity = organizeService.getInfo(organizeId); + if (Objects.nonNull(organizeEntity)) { + vo.setId(organizeEntity.getId()); + vo.setType(organizeEntity.getCategory()); + if ("department".equals(organizeEntity.getCategory())) { + vo.setIcon("icon-ym icon-ym-tree-department1"); + } else { + vo.setIcon("icon-ym icon-ym-tree-organization3"); + } + vo.setEnabledMark(organizeEntity.getEnabledMark()); + // 组装组织名称 + String orgName = organizeService.getFullNameByOrgIdTree(organizeEntity.getOrganizeIdTree(), "/"); + vo.setFullName(orgName); + // 赋予子集 + List userByRoleVOS = new ArrayList<>(16); + List lists = userService.getListByOrganizeId(organizeEntity.getId(), keyword); + if (lists.size() > 0) { + vo.setHasChildren(true); + vo.setIsLeaf(false); + lists.stream().forEach(t->{ + UserByRoleVO userByRoleVO = new UserByRoleVO(); + userByRoleVO.setParentId(organizeEntity.getId()); + userByRoleVO.setId(t.getId()); + userByRoleVO.setFullName(t.getRealName() + "/" + t.getAccount()); + userByRoleVO.setEnabledMark(t.getEnabledMark()); + userByRoleVO.setHeadIcon(UploaderUtil.uploaderImg(t.getHeadIcon())); + userByRoleVO.setOrganize(organizeService.getFullNameByOrgIdTree(organizeEntity.getOrganizeIdTree(), "/")); + userByRoleVO.setIsLeaf(true); + userByRoleVO.setHasChildren(false); + userByRoleVO.setIcon("icon-ym icon-ym-tree-user2"); + userByRoleVO.setType("user"); + userByRoleVOS.add(userByRoleVO); + }); + vo.setChildren(userByRoleVOS); + } else { + vo.setHasChildren(false); + vo.setIsLeaf(true); + vo.setChildren(new ArrayList<>()); + } + list.add(vo); + } + } + return ActionResult.success(list); + } + + /** + * 角色成员弹窗 + * + * @param model 页面信息 + * @return ignore + */ + @Operation(summary = "角色成员弹窗") + @SaCheckPermission("permission.role") + @GetMapping("/GetUsersByRoleOrgId") + public ActionResult> getUsersByRoleOrgId(UserByRoleModel model) { + List jsonToList = new ArrayList<>(16); + // 得到组织关系 + List relationListByRoleId = organizeRelationService.getRelationListByRoleId(model.getRoleId()); + // 得到组织信息 + List orgEntityList = organizeService.getOrgEntityList(relationListByRoleId.stream().map(OrganizeRelationEntity::getOrganizeId).collect(Collectors.toList()), true); + //判断是否搜索关键字 + if (StringUtil.isNotEmpty(model.getKeyword())) { + //通过关键字查询 + List list = userService.getList(orgEntityList.stream().map(OrganizeEntity::getId).collect(Collectors.toList()), model.getKeyword()); + List listByUserIds = userRelationService.getRelationByUserIds(list.stream().map(UserEntity::getId).collect(Collectors.toList())); + //遍历用户给要返回的值插入值 + for (UserEntity entity : list) { + UserByRoleVO vo = new UserByRoleVO(); + vo.setId(entity.getId()); + vo.setFullName(entity.getRealName() + "/" + entity.getAccount()); + vo.setEnabledMark(entity.getEnabledMark()); + vo.setIsLeaf(true); + vo.setHeadIcon(UploaderUtil.uploaderImg(entity.getHeadIcon())); + List listByUserId = listByUserIds.stream().filter(t -> t.getUserId().equals(entity.getId())).collect(Collectors.toList()); + StringBuilder stringBuilder = new StringBuilder(); + List orgEntityLists = organizeService.getOrgEntityList(listByUserId.stream().map(UserRelationEntity::getObjectId).collect(Collectors.toList()), false); + listByUserId.forEach(t -> { + OrganizeEntity orgEntity = orgEntityLists.stream().filter(org -> org.getId().equals(t.getObjectId())).findFirst().orElse(null); + if (orgEntity != null) { + String fullNameByOrgIdTree = organizeService.getFullNameByOrgIdTree(orgEntity.getOrganizeIdTree(), "/"); + if (StringUtil.isNotEmpty(fullNameByOrgIdTree)) { + stringBuilder.append("," + fullNameByOrgIdTree); + } + } + }); + if (stringBuilder.length() > 0) { + vo.setOrganize(stringBuilder.toString().replaceFirst(",", "")); + } + vo.setHasChildren(false); + vo.setIcon("icon-ym icon-ym-tree-user2"); + vo.setType("user"); + jsonToList.add(vo); + } + return ActionResult.success(jsonToList); + } + //获取所有组织 + List collect = organizeService.getList(false).stream().filter(t -> t.getEnabledMark() == 1).collect(Collectors.toList()); + //判断时候传入组织id + //如果传入组织id,则取出对应的子集 + if (!"0".equals(model.getOrganizeId())) { + //通过组织查询部门及人员 + //单个组织 + List list = collect.stream().filter(t -> model.getOrganizeId().equals(t.getId())).collect(Collectors.toList()); + if (list.size() > 0) { + //获取组织信息 + OrganizeEntity organizeEntity = list.get(0); + //取出组织下的部门 + List collect1 = collect.stream().filter(t -> t.getParentId().equals(organizeEntity.getId())).collect(Collectors.toList()); + // 判断组织关系中是否有子部门id + List organizeEntities = new ArrayList<>(); + for (OrganizeEntity entity : collect1) { + List collect2 = relationListByRoleId.stream().filter(t -> entity.getId().equals(t.getOrganizeId())).collect(Collectors.toList()); + collect2.stream().forEach(t->{ + if (StringUtil.isNotEmpty(t.getOrganizeId())) { + organizeEntities.add(organizeService.getInfo(t.getOrganizeId())); + } + }); + } + // 其他不是子集的直接显示 + List collect2 = relationListByRoleId.stream() + .filter(item -> !organizeEntities.stream().map(e -> e.getId()) + .collect(Collectors.toList()).contains(item.getOrganizeId())) + .collect(Collectors.toList()); + // 移除掉上级不是同一个的 + List collect3 = collect2.stream().filter(t -> !organizeService.getInfo(t.getOrganizeId()).getOrganizeIdTree().contains(model.getOrganizeId())).collect(Collectors.toList()); + collect2.removeAll(collect3); + List collect4 = collect2.stream().filter(t -> !t.getOrganizeId().equals(model.getOrganizeId())).collect(Collectors.toList()); + List collect5 = collect.stream().filter(x -> collect4.stream().map(OrganizeRelationEntity::getOrganizeId).collect(Collectors.toList()).contains(x.getId())).collect(Collectors.toList()); + List organizeEntities1 = new ArrayList<>(collect5); + // 不是子集的对比子集的 + for (OrganizeEntity entity : collect5) { + for (OrganizeEntity organizeEntity1 : organizeEntities) { + if (entity.getOrganizeIdTree().contains(organizeEntity1.getId())) { + organizeEntities1.remove(entity); + } + } + } + + //取出组织下的人员 + List entityList = userService.getListByOrganizeId(model.getOrganizeId(), null); + List listByUserIds = userRelationService.getRelationByUserIds(entityList.stream().map(UserEntity::getId).collect(Collectors.toList())); + for (UserEntity entity : entityList) { + UserByRoleVO vo = new UserByRoleVO(); + vo.setId(entity.getId()); + vo.setFullName(entity.getRealName() + "/" + entity.getAccount()); + vo.setEnabledMark(entity.getEnabledMark()); + vo.setIsLeaf(true); + vo.setHasChildren(false); + vo.setIcon("icon-ym icon-ym-tree-user2"); + vo.setType("user"); + vo.setHeadIcon(UploaderUtil.uploaderImg(entity.getHeadIcon())); + List listByUserId = listByUserIds.stream().filter(t -> t.getUserId().equals(entity.getId())).collect(Collectors.toList()); + StringBuilder stringBuilder = new StringBuilder(); + List orgEntityLists = organizeService.getOrgEntityList(listByUserId.stream().map(UserRelationEntity::getObjectId).collect(Collectors.toList()), false); + listByUserId.forEach(t -> { + OrganizeEntity orgEntity = orgEntityLists.stream().filter(org -> org.getId().equals(t.getObjectId())).findFirst().orElse(null); + if (orgEntity != null) { + String fullNameByOrgIdTree = organizeService.getFullNameByOrgIdTree(orgEntity.getOrganizeIdTree(), "/"); + if (StringUtil.isNotEmpty(fullNameByOrgIdTree)) { + stringBuilder.append("," + fullNameByOrgIdTree); + } + } + }); + if (stringBuilder.length() > 0) { + vo.setOrganize(stringBuilder.toString().replaceFirst(",", "")); + } + jsonToList.add(vo); + } + // 处理子集断层 + List organizeEntities2 = new ArrayList<>(collect5); + for (OrganizeEntity entity : organizeEntities2) { + List collect6 = organizeEntities2.stream().filter(t -> !entity.getId().equals(t.getId()) && t.getOrganizeIdTree().contains(entity.getOrganizeIdTree())).collect(Collectors.toList()); + organizeEntities1.removeAll(collect6); + } + for (OrganizeEntity entity : organizeEntities1) { + StringBuffer stringBuffer = new StringBuffer(); + String[] split = entity.getOrganizeIdTree().split(","); + List list1 = Arrays.asList(split); + List list2 = new ArrayList<>(list1); + int indexOf = list2.indexOf(model.getOrganizeId()); + while (indexOf >= 0) { + list2.remove(indexOf); + indexOf--; + } + StringBuffer organizeIdTree = new StringBuffer(); + for (String parentId : list2) { + OrganizeEntity organizes = organizeService.getInfo(parentId); + if (Objects.nonNull(organizes) && StringUtil.isNotEmpty(organizes.getFullName())) { + organizeIdTree.append("/" + organizes.getFullName()); + } + } + String toString = organizeIdTree.toString(); + if (StringUtil.isNotEmpty(toString)) { + String organizeId = toString.replaceFirst("/", ""); + stringBuffer.append("," + organizeId); + } + UserByRoleVO userByRoleVO = new UserByRoleVO(); + userByRoleVO.setId(entity.getId()); + userByRoleVO.setType(entity.getCategory()); + userByRoleVO.setFullName(stringBuffer.toString().replace(",", "")); + if ("department".equals(entity.getCategory())) { + userByRoleVO.setIcon("icon-ym icon-ym-tree-department1"); + } else { + userByRoleVO.setIcon("icon-ym icon-ym-tree-organization3"); + } + userByRoleVO.setHasChildren(true); + userByRoleVO.setIsLeaf(false); + userByRoleVO.setEnabledMark(entity.getEnabledMark()); + jsonToList.add(userByRoleVO); + } + for (OrganizeEntity entitys : organizeEntities) { + UserByRoleVO vo = new UserByRoleVO(); + vo.setId(entitys.getId()); + vo.setType(entitys.getCategory()); + vo.setFullName(entitys.getFullName()); + if ("department".equals(entitys.getCategory())) { + vo.setIcon("icon-ym icon-ym-tree-department1"); + } else { + vo.setIcon("icon-ym icon-ym-tree-organization3"); + } + vo.setHasChildren(true); + vo.setIsLeaf(false); + vo.setEnabledMark(entitys.getEnabledMark()); + jsonToList.add(vo); + } + } + return ActionResult.success(jsonToList); + } + + // 判断是否有父级 + Set set = new HashSet<>(16); + for (OrganizeEntity entity : orgEntityList) { + List collect1 = orgEntityList.stream().filter(t -> !entity.getId().equals(t.getId()) && entity.getOrganizeIdTree().contains(t.getOrganizeIdTree())).collect(Collectors.toList()); + set.addAll(collect1); + } + List list = new ArrayList<>(set); + // 从list中一处已经有的 + List list1 = new ArrayList<>(list); + for (OrganizeEntity organizeEntity : list) { + List collect1 = list.stream().filter(t -> !organizeEntity.getId().equals(t.getId()) && t.getOrganizeIdTree().contains(organizeEntity.getId())).collect(Collectors.toList()); + list1.removeAll(collect1); + } + list = list1; + // 纯断层的 + List list2 = new ArrayList<>(orgEntityList); + for (OrganizeEntity organizeEntity: orgEntityList){ + if (list.stream().filter(t -> organizeEntity.getOrganizeIdTree().contains(t.getId())).count() > 0) { + list2.remove(organizeEntity); + } + } + list.addAll(list2); + for (OrganizeEntity organizeEntity : list) { + if (organizeEntity != null && organizeEntity.getEnabledMark() == 1) { + UserByRoleVO userByRoleVO = new UserByRoleVO(); + userByRoleVO.setId(organizeEntity.getId()); + userByRoleVO.setType(organizeEntity.getCategory()); + String orgName = organizeService.getFullNameByOrgIdTree(organizeEntity.getOrganizeIdTree(), "/"); + userByRoleVO.setFullName(orgName); + if ("department".equals(organizeEntity.getCategory())) { + userByRoleVO.setIcon("icon-ym icon-ym-tree-department1"); + } else { + userByRoleVO.setIcon("icon-ym icon-ym-tree-organization3"); + } + userByRoleVO.setHasChildren(true); + userByRoleVO.setIsLeaf(false); + userByRoleVO.setEnabledMark(organizeEntity.getEnabledMark()); + jsonToList.add(userByRoleVO); + } + } + return ActionResult.success(jsonToList); + } + + /** + * 获取我的下属(不取子集) + * + * @param page 页面信息 + * @return ignore + */ + @Operation(summary = "获取我的下属(不取子集)") + @Parameters({ + @Parameter(name = "page", description = "关键字", required = true) + }) + @PostMapping("/getSubordinates") + public ActionResult> getSubordinates(@RequestBody Page page) { + Map orgMaps = organizeService.getOrgMaps(null, false); + List list = userService.getListByManagerId(userProvider.get().getUserId(), page.getKeyword()); + List jsonToList = JsonUtil.getJsonToList(list, UserIdListVo.class); + Map orgIdNameMaps = organizeService.getInfoList(); + jsonToList.forEach(t -> { + t.setRealName(t.getRealName() + "/" + t.getAccount()); + t.setFullName(t.getRealName()); + List listByUserId = userRelationService.getListByUserId(t.getId()).stream().filter(ur -> PermissionConst.ORGANIZE.equals(ur.getObjectType())).collect(Collectors.toList()); + StringJoiner stringJoiner = new StringJoiner(","); + listByUserId.forEach(tt -> { + OrganizeEntity organizeEntity = orgMaps.get(tt.getObjectId()); + if (organizeEntity != null) { + String fullNameByOrgIdTree = organizeService.getFullNameByOrgIdTree(orgIdNameMaps, organizeEntity.getOrganizeIdTree(), "/"); + if (StringUtil.isNotEmpty(fullNameByOrgIdTree)) { + stringJoiner.add(fullNameByOrgIdTree); + } + } + }); + t.setOrganize(stringJoiner.toString()); + t.setHeadIcon(UploaderUtil.uploaderImg(t.getHeadIcon())); + }); + return ActionResult.success(jsonToList); + } + + /** + * 导出excel + * + * @param dataType 导出方式 + * @param selectKey 选择列 + * @param pagination 分页 + * @return ignore + */ + @Operation(summary = "导出excel") + @SaCheckPermission("permission.user") + @GetMapping("/ExportExcel") + public ActionResult Export(String dataType, String selectKey, PaginationUser pagination) { + // 导出 + DownloadVO vo = userService.exportExcel(dataType, selectKey, pagination); + return ActionResult.success(vo); + } + + /** + * 模板下载 + * + * @return ignore + */ + @Operation(summary = "模板下载") + @SaCheckPermission("permission.user") + @GetMapping("/TemplateDownload") + public ActionResult TemplateDownload() { + UserInfo userInfo = userProvider.get(); + DownloadVO vo = DownloadVO.builder().build(); + try { + vo.setName("用户信息.xlsx"); + vo.setUrl(UploaderUtil.uploaderFile("/api/file/DownloadModel?encryption=", "用户信息" + + ".xlsx" + "#" + "Temporary")); + } catch (Exception e) { + log.error("信息导出Excel错误:" + e.getMessage()); + } + return ActionResult.success(vo); + } + + + /** + * 导入数据 + * + * @param data 导入模型 + * @return ignore + */ + @Operation(summary = "导入数据") + @Parameters({ + @Parameter(name = "data", description = "导入模型", required = true) + }) + @SaCheckPermission("permission.user") + @PostMapping("/ImportData") + public ActionResult ImportData(@RequestBody UserExportVO data) { + List dataList = JsonUtil.getJsonToList(data.getList(), UserExportVO.class); + //导入数据 + UserImportVO result = userService.importData(dataList); + return ActionResult.success(result); + } + + /** + * 导出错误报告 + * + * @param data 导出模型 + * @return ignore + */ + @Operation(summary = "导出错误报告") + @Parameters({ + @Parameter(name = "data", description = "导出模型", required = true) + }) + @SaCheckPermission("permission.user") + @PostMapping("/ExportExceptionData") + public ActionResult exportExceptionData(@RequestBody UserExportVO data) { + List dataList = JsonUtil.getJsonToList(data.getList(), UserExportVO.class); + //生成Excel + DownloadVO vo = userService.exportExceptionData(dataList); + return ActionResult.success(vo); + } + + /*= different =*/ + + /** + * 上传文件(excel) + * + * @return ignore + */ + @Operation(summary = "上传文件") + @SaCheckPermission("permission.user") + @PostMapping("/Uploader") + public ActionResult Uploader() { + List list = UpUtil.getFileAll(); + MultipartFile file = list.get(0); + if (file.getOriginalFilename().endsWith(".xlsx") || file.getOriginalFilename().endsWith(".xls")) { + String filePath = XSSEscape.escape(configValueUtil.getTemporaryFilePath()); + String fileName = XSSEscape.escape(RandomUtil.uuId() + "." + UpUtil.getFileType(file)); + // 上传文件 + FileInfo fileInfo = FileUploadUtils.uploadFile(file, filePath, fileName); + DownloadVO vo = DownloadVO.builder().build(); + vo.setName(fileInfo.getFilename()); + return ActionResult.success(vo); + } else { + return ActionResult.fail("选择文件不符合导入"); + } + } + + /** + * 导入预览 + * + * @param fileName 文件名 + * @return + */ + @Operation(summary = "导入预览") + @SaCheckPermission("permission.user") + @GetMapping("/ImportPreview") + public ActionResult> ImportPreview(String fileName) throws ImportException { + Map map = new HashMap<>(); + try { + String filePath = configValueUtil.getTemporaryFilePath(); + @Cleanup InputStream inputStream = new ByteArrayInputStream(FileUploadUtils.downloadFileByte(filePath, fileName, false)); + // 得到数据 + List personList = ExcelUtil.importExcelByInputStream(inputStream, 0, 1, UserExportVO.class); + // 预览数据 + map = userService.importPreview(personList); + } catch (Exception e) { + log.error(e.getMessage()); + throw new ImportException(e.getMessage()); + } + return ActionResult.success(map); + } + + /** + * 根据角色ID获取所属组织的所有成员 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "根据角色ID获取所有成员") + @SaCheckPermission("permission.role") + @GetMapping("/getUsersByRoleId") + public ActionResult getUsersByRoleId(PaginationUser pagination) { + List userList = new ArrayList<>(); + if (roleService.getInfo(pagination.getRoleId()).getGlobalMark() == 1) { + userList.addAll(userService.getList(pagination, null, false, false)); + } else { + // 根据roleId获取所有组织 + userService.getListByRoleId(pagination.getRoleId()).forEach(u -> { + userList.add(userService.getInfo(u.getId())); + }); + } + // 去重 + List afterUserList = userList.stream().distinct().collect(Collectors.toList()); + if (StringUtil.isNotEmpty(pagination.getKeyword())) { + afterUserList = afterUserList.stream().filter(t -> t.getRealName().contains(pagination.getKeyword()) || t.getAccount().contains(pagination.getKeyword())).collect(Collectors.toList()); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(afterUserList, paginationVO); + } + + /** + * 获取默认当前值用户ID + * + * @param userConditionModel 参数 + * @return 执行结构 + * @throws DataException ignore + */ + @Operation(summary = "获取默认当前值用户ID") + @Parameters({ + @Parameter(name = "userConditionModel", description = "参数", required = true) + }) + @PostMapping("/getDefaultCurrentValueUserId") + public ActionResult getDefaultCurrentValueUserId(@RequestBody UserConditionModel userConditionModel) throws DataException { + String userId = userService.getDefaultCurrentValueUserId(userConditionModel); + Map dataMap = new HashMap(); + dataMap.put("userId", userId); + return ActionResult.success("查询成功", dataMap); + } + + /** + * 工作交接 + * + * @param workHandoverModel 模型 + * @return 执行结构 + */ + @Operation(summary = "工作交接") + @SaCheckPermission("permission.user") + @Parameters({ + @Parameter(name = "workHandoverModel", description = "模型", required = true) + }) + @PostMapping("/workHandover") + public ActionResult workHandover(@RequestBody @Valid WorkHandoverModel workHandoverModel) { + // 开始交接就禁用用户 + UserEntity entity = userService.getInfo(workHandoverModel.getFromId()); + UserEntity entitys = userService.getInfo(workHandoverModel.getToId()); + if (entity == null || entitys == null) { + return ActionResult.fail(MsgCode.FA001.get()); + } +// if (entity.getIsAdministrator() == 1 || entitys.getIsAdministrator() == 1) { +// return ActionResult.fail("工作交接无法转移给管理员"); +// } + try { + boolean flag = flowTaskApi.flowWork(workHandoverModel); + if (!flag) { + return ActionResult.fail("工作交接失败!"); + } + permissionGroupService.updateByUser(workHandoverModel.getFromId(), workHandoverModel.getToId(), workHandoverModel.getPermissionList()); + entity.setHandoverMark(1); + return ActionResult.success("工作交接成功!"); + } finally { + userService.updateById(entity); + } + } + + /** + * 获取用户工作详情 + * + * @return 执行结构 + */ + @Operation(summary = "获取用户工作详情") + @SaCheckPermission("permission.user") + @Parameters({ + @Parameter(name = "userId", description = "主键", required = true) + }) + @GetMapping("/getWorkByUser") + public ActionResult getWorkByUser(@RequestParam("fromId") String fromId) { + FlowWorkListVO flowWorkListVO = flowTaskApi.flowWork(fromId); + if (flowWorkListVO == null) { + log.error("用户:" + UserProvider.getLoginUserId() + ",待办事宜及负责流程获取失败"); + flowWorkListVO = new FlowWorkListVO(); + } + List permissionGroupByUserId = permissionGroupService.getPermissionGroupAllByUserId(fromId); + List jsonToList = JsonUtil.getJsonToList(permissionGroupByUserId, FlowWorkModel.class); + jsonToList.forEach(t -> t.setIcon("icon-ym icon-ym-authGroup")); + flowWorkListVO.setPermission(jsonToList); + return ActionResult.success(flowWorkListVO); + } + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/UserRelationController.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/UserRelationController.java new file mode 100644 index 0000000..d153d4a --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/UserRelationController.java @@ -0,0 +1,115 @@ +package jnpf.permission.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.annotation.SaMode; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import jnpf.base.controller.SuperController; +import cn.hutool.core.util.ArrayUtil; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.annotation.UserPermission; +import jnpf.base.ActionResult; +import jnpf.annotation.PositionPermission; +import jnpf.base.Page; +import jnpf.constant.MsgCode; +import jnpf.constant.PermissionConst; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.entity.UserRelationEntity; +import jnpf.permission.model.userrelation.UserRelationForm; +import jnpf.permission.model.userrelation.UserRelationIdsVO; +import jnpf.permission.model.userrelation.UserRelationListVO; +import jnpf.permission.service.UserRelationService; +import jnpf.permission.service.UserService; +import jnpf.permission.util.PermissionUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 用户关系 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +@Tag(name = "用户关系", description = "UserRelation") +@RestController +@RequestMapping("/api/permission/UserRelation") +public class UserRelationController extends SuperController { + + @Autowired + private UserRelationService userRelationService; + @Autowired + private UserService userService; + + /** + * 列表 + * + * @param objectId 对象主键 + * @return + */ + @Operation(summary = "获取岗位/角色/门户成员列表ids") + @Parameters({ + @Parameter(name = "objectId", description = "对象主键", required = true) + }) + @SaCheckPermission(value = {"permission.authorize", "permission.position", "permission.role"}, mode = SaMode.OR) + @GetMapping("/{objectId}") + public ActionResult listTree(@PathVariable("objectId") String objectId) { + List data = userRelationService.getListByObjectId(objectId); + List ids = new ArrayList<>(); + for (UserRelationEntity entity : data) { + ids.add(entity.getUserId()); + } + UserRelationIdsVO vo = new UserRelationIdsVO(); + vo.setIds(ids); + return ActionResult.success(vo); + } + + /** + * 保存 + * + * @param objectId 对象主键 + * @param userRelationForm 页面数据 + * @return + */ + @UserPermission + @Operation(summary = "添加岗位或角色成员") + @Parameters({ + @Parameter(name = "objectId", description = "对象主键", required = true), + @Parameter(name = "userRelationForm", description = "页面数据", required = true) + }) + @SaCheckPermission(value = {"permission.authorize", "permission.position", "permission.role"}, mode = SaMode.OR) + @PostMapping("/{objectId}") + public ActionResult save(@PathVariable("objectId") String objectId, @RequestBody UserRelationForm userRelationForm) { + List userIds = new ArrayList<>(); + if(userRelationForm.getObjectType().equals(PermissionConst.ROLE)){ + // 得到禁用的id + List listByObjectId = userRelationService.getListByObjectId(objectId, PermissionConst.ROLE); + List collect = listByObjectId.stream().map(UserRelationEntity::getUserId).collect(Collectors.toList()); + List collect1 = collect.stream().filter(t -> !userRelationForm.getUserIds().contains(t)).collect(Collectors.toList()); + userIds.addAll(collect1); + Set set = new HashSet<>(userRelationForm.getUserIds()); + set.addAll(userService.getUserList(collect).stream().map(UserEntity::getId).collect(Collectors.toList())); + List list = new ArrayList<>(set); + userRelationService.roleSaveByUserIds(objectId, list); + } else { + // 得到禁用的id + List listByObjectId = userRelationService.getListByObjectId(objectId, PermissionConst.POSITION); + List collect = listByObjectId.stream().map(UserRelationEntity::getUserId).collect(Collectors.toList()); + List collect1 = collect.stream().filter(t -> !userRelationForm.getUserIds().contains(t)).collect(Collectors.toList()); + userIds.addAll(collect1); + Set set = new HashSet<>(userRelationForm.getUserIds()); + set.addAll(userService.getUserList(collect).stream().map(UserEntity::getId).collect(Collectors.toList())); + List list = new ArrayList<>(set); + userRelationForm.setUserIds(list); + userRelationService.saveObjectId(objectId,userRelationForm); + } + userService.delCurUser(ArrayUtil.toArray(userIds, String.class)); + return ActionResult.success(MsgCode.SU002.get()); + } + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/UserSettingController.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/UserSettingController.java new file mode 100644 index 0000000..6f1e8cb --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-controller/src/main/java/jnpf/permission/controller/UserSettingController.java @@ -0,0 +1,869 @@ +package jnpf.permission.controller; + + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.ActionResultCode; +import jnpf.base.entity.ModuleEntity; +import jnpf.base.entity.SystemEntity; +import jnpf.base.model.form.ModuleFormModel; +import jnpf.base.model.sign.SignForm; +import jnpf.base.model.sign.SignListVO; +import jnpf.base.service.ModuleService; +import jnpf.base.service.SignService; +import jnpf.base.service.SysconfigService; +import jnpf.base.service.SystemService; +import jnpf.base.vo.PageListVO; +import jnpf.base.vo.PaginationVO; +import jnpf.base.UserInfo; +import jnpf.constant.MsgCode; +import jnpf.constant.PermissionConst; +import jnpf.entity.LogEntity; +import jnpf.permission.constant.AuthorizeConst; +import jnpf.permission.entity.*; +import jnpf.base.model.button.ButtonModel; +import jnpf.base.model.column.ColumnModel; +import jnpf.base.model.module.ModuleModel; +import jnpf.base.model.resource.ResourceModel; +import jnpf.model.UserLogForm; +import jnpf.permission.model.authorize.AuthorizeModel; +import jnpf.permission.model.authorize.AuthorizeVO; +import jnpf.permission.model.permission.PermissionModel; +import jnpf.permission.model.user.form.*; +import jnpf.permission.model.user.mod.UserAuthorizeModel; +import jnpf.permission.model.user.vo.UserAuthorizeVO; +import jnpf.permission.model.user.vo.UserBaseInfoVO; +import jnpf.permission.model.user.vo.UserLogVO; +import jnpf.permission.model.user.vo.UserSubordinateVO; +import jnpf.permission.service.*; +import jnpf.permission.util.PermissionUtil; +import jnpf.service.LogService; +import jnpf.util.*; +import jnpf.util.JsonUtil; +import jnpf.util.treeutil.ListToTreeUtil; +import jnpf.util.treeutil.SumTree; +import jnpf.util.treeutil.newtreeutil.TreeDotUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 个人资料 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +@Tag(name = "个人资料", description = "CurrentUsersInfo") +@RestController +@RequestMapping("/api/permission/Users/Current") +public class UserSettingController { + + @Autowired + private UserProvider userProvider; + @Autowired + private UserService userService; + @Autowired + private AuthorizeService authorizeService; + @Autowired + private LogService logService; + @Autowired + private RedisUtil redisUtil; + @Autowired + private RoleService roleService; + @Autowired + private PositionService positionService; + @Autowired + private OrganizeService organizeService; + @Autowired + private CacheKeyUtil cacheKeyUtil; + @Autowired + private UserRelationService userRelationService; + @Autowired + private OrganizeRelationService organizeRelationService; + @Autowired + private SystemService systemService; + @Autowired + private ModuleService moduleService; + @Autowired + private SignService signService; + @Autowired + private SysconfigService sysConfigApi; + @Autowired + private UserOldPasswordService userOldPasswordService; + @Autowired + private OrganizeAdministratorService organizeAdministratorService; + @Autowired + private PermissionGroupService permissionGroupService; + + /** + * 我的信息 + * + * @return + */ + @Operation(summary = "个人资料") + @GetMapping("/BaseInfo") + public ActionResult get() { + UserInfo userInfo = userProvider.get(); + UserEntity userEntity = userService.getInfo(userInfo.getUserId()); + + String catchKey = cacheKeyUtil.getAllUser(); + if (redisUtil.exists(catchKey)) { + redisUtil.remove(catchKey); + } + + UserBaseInfoVO vo = JsonUtil.getJsonToBean(userEntity, UserBaseInfoVO.class); + + + if (StringUtil.isNotEmpty(userEntity.getManagerId())) { + UserEntity menager = userService.getInfo(userEntity.getManagerId()); + vo.setManager(menager != null ? menager.getRealName() + "/" + menager.getAccount() : ""); + } + + //设置语言和主题 + vo.setLanguage(userEntity.getLanguage() != null ? userEntity.getLanguage() : "zh-CN"); + vo.setTheme(userEntity.getTheme() != null ? userEntity.getTheme() : "W-001"); + + // 获取组织 + vo.setOrganize(PermissionUtil.getLinkInfoByOrgId(userInfo.getOrganizeId(), organizeService, false)); + + // 获取角色 + if(StringUtil.isNotEmpty(userInfo.getOrganizeId())){ + vo.setRoleId(roleService.getCurRolesByOrgId(userInfo.getOrganizeId()).stream() + .map(PermissionEntityBase::getFullName).collect(Collectors.joining(","))); + } + + // 获取主要岗位 + List positionEntityList= positionService.getListByOrgIdAndUserId(userInfo.getOrganizeId(), userEntity.getId()); + if(positionEntityList.size() > 0){ + List fullNames = positionEntityList.stream().map(PositionEntity::getFullName).collect(Collectors.toList()); + vo.setPosition(String.join(",", fullNames)); + } + + // 获取用户 + if (StringUtil.isNotEmpty(userInfo.getTenantId())) { + vo.setAccount(userInfo.getTenantId() + "@" + vo.getAccount()); + } + + // 获取用户头像 + if (!StringUtil.isEmpty(userInfo.getUserIcon())) { + vo.setAvatar(UploaderUtil.uploaderImg(userInfo.getUserIcon())); + } + vo.setBirthday(userEntity.getBirthday() != null ? userEntity.getBirthday().getTime() : null); + return ActionResult.success(vo); + } + + @Operation(summary = "获取用户信息(报表使用)") + @GetMapping("/ReportUserInfo") + public Map reportUserInfo() { + UserInfo userInfo = userProvider.get(); + Map map = new HashMap<>(); + map.put("userId", userInfo.getUserId()); + map.put("departmentId", userInfo.getDepartmentId()); + map.put("organizeId", userInfo.getOrganizeId()); + map.put("positionId", userInfo.getPositionIds().length>0?userInfo.getPositionIds()[0]:""); + map.put("roleId", userInfo.getRoleIds().size()>0?userInfo.getRoleIds().get(0):""); + map.put("managerId", userInfo.getManagerId()); + return map; + } + + /** + * 递归找他的上级 + */ + public void getOrganizeName(List OrganizeList, String OrganizeId, StringBuilder organizeName) { + List OrganizeList2 = OrganizeList.stream().filter(t -> t.getId().equals(OrganizeId)).collect(Collectors.toList()); + if (OrganizeList2.size() > 0) { + for (OrganizeEntity organizeEntity : OrganizeList2) { + if ("-1".equals(organizeEntity.getParentId())) { + //父级为-1时候退出 + organizeName.append(organizeEntity.getFullName()); + } else { + organizeName.append(organizeEntity.getFullName() + "/"); + } + } + for (OrganizeEntity orgSub : OrganizeList2) { + getOrganizeName(OrganizeList, orgSub.getParentId(), organizeName); + } + } + } + + + /** + * 我的权限 + * + * @return + */ + @Operation(summary = "系统权限") + @GetMapping("/Authorize") + public ActionResult getList() { + List authorizeList = new ArrayList<>(); + //系统权限 + AuthorizeVO authorizeModel = authorizeService.getAuthorizeByUser(); + //赋值图标 + Map moduleMap = this.moduleList(authorizeModel.getModuleList()); + + List modelList = authorizeModel.getModuleList(); + List buttonList = authorizeModel.getButtonList(); + List columnList = authorizeModel.getColumnList(); + List formsList = authorizeModel.getFormsList(); + List resourceList = authorizeModel.getResourceList(); + + UserAuthorizeVO vo = UserAuthorizeVO.builder() + .button(this.moduleButton(modelList, buttonList, authorizeList, moduleMap)) + .column(this.moduleColumn(modelList, columnList, authorizeList, moduleMap)) + .form(this.moduleForm(modelList, formsList, authorizeList, moduleMap)) + .resource(this.resourceData(modelList, resourceList, authorizeList, moduleMap)) + .module(this.module(modelList, authorizeList)).build(); + return ActionResult.success(vo); + } + + /** + * 系统日志 + * + * @param userLogForm 页面参数 + * @return + */ + @Operation(summary = "系统日志") + @GetMapping("/SystemLog") + public ActionResult> getLogList(UserLogForm userLogForm) { + List data = logService.getList(userLogForm); + List list = JsonUtil.getJsonToList(data, UserLogVO.class); + for (int i = 0; i < list.size(); i++) { + list.get(i).setIpaddress(data.get(i).getIpAddress()); + list.get(i).setRequestURL(data.get(i).getRequestUrl()); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(userLogForm, PaginationVO.class); + return ActionResult.page(list, paginationVO); + } + + /** + * 修改用户资料 + * + * @param userInfoForm 页面参数 + * @return + */ + @Operation(summary = "修改用户资料") + @Parameters({ + @Parameter(name = "userInfoForm", description = "页面参数", required = true) + }) + @PutMapping("/BaseInfo") + public ActionResult updateInfo(@RequestBody UserInfoForm userInfoForm) throws Exception { + UserEntity userEntity = userService.getInfo(userProvider.get().getUserId()); + userEntity.setBirthday(userInfoForm.getBirthday() == null ? null : new Date(userInfoForm.getBirthday())); + userEntity.setCertificatesNumber(userInfoForm.getCertificatesNumber()); + userEntity.setCertificatesType(userInfoForm.getCertificatesType()); + userEntity.setEducation(userInfoForm.getEducation()); + userEntity.setEmail(userInfoForm.getEmail()); + userEntity.setGender(userInfoForm.getGender()); + userEntity.setLandline(userInfoForm.getLandline()); + userEntity.setMobilePhone(userInfoForm.getMobilePhone()); + userEntity.setNation(userInfoForm.getNation()); + userEntity.setNativePlace(userInfoForm.getNativePlace()); + userEntity.setPostalAddress(userInfoForm.getPostalAddress()); + userEntity.setRealName(userInfoForm.getRealName()); + userEntity.setSignature(userInfoForm.getSignature()); + userEntity.setTelePhone(userInfoForm.getTelePhone()); + userEntity.setUrgentContacts(userInfoForm.getUrgentContacts()); + userEntity.setUrgentTelePhone(userInfoForm.getUrgentTelePhone()); + userService.updateById(userEntity); + return ActionResult.success(MsgCode.SU002.get()); + } + + /** + * 修改用户密码 + * + * @param userModifyPasswordForm 用户修改密码表单 + * @return + */ + @Operation(summary = "修改用户密码") + @Parameters({ + @Parameter(name = "userModifyPasswordForm", description = "用户修改密码表单", required = true) + }) + @PostMapping("/Actions/ModifyPassword") + public ActionResult modifyPassword(@RequestBody @Valid UserModifyPasswordForm userModifyPasswordForm) { + UserEntity userEntity = userService.getInfo(userProvider.get().getUserId()); + if (userEntity != null) { +// if ("1".equals(String.valueOf(userEntity.getIsAdministrator()))) { +// return ActionResult.fail("无法修改管理员账户"); +// } + String timestamp = String.valueOf(redisUtil.getString(userModifyPasswordForm.getTimestamp())); + if (!userModifyPasswordForm.getCode().equalsIgnoreCase(timestamp)) { + return ActionResult.fail(MsgCode.LOG104.get()); + } + if (!Md5Util.getStringMd5((userModifyPasswordForm.getOldPassword().toLowerCase() + userEntity.getSecretkey().toLowerCase())).equals(userEntity.getPassword())) { + return ActionResult.fail(MsgCode.LOG201.get()); + } + //禁用旧密码 + String disableOldPassword = sysConfigApi.getValueByKey("disableOldPassword"); + if(disableOldPassword.equals("1")){ + String disableTheNumberOfOldPasswords = sysConfigApi.getValueByKey("disableTheNumberOfOldPasswords"); + List userOldPasswordList = userOldPasswordService.getList(UserProvider.getLoginUserId()); + userOldPasswordList = userOldPasswordList.stream().limit(Long.valueOf(disableTheNumberOfOldPasswords)).collect(Collectors.toList()); + for (UserOldPasswordEntity userOldPassword : userOldPasswordList) { + String newPassword = Md5Util.getStringMd5(userModifyPasswordForm.getPassword().toLowerCase() + userOldPassword.getSecretkey().toLowerCase()); + if(userOldPassword.getOldPassword().equals(newPassword)){ + return ActionResult.fail(MsgCode.LOG204.get()); + } + } + } + userEntity.setPassword(userModifyPasswordForm.getPassword()); + userService.updatePassword(userEntity); + userService.delCurUser(userEntity.getId()); + return ActionResult.success(MsgCode.LOG202.get()); + } + return ActionResult.fail(MsgCode.LOG203.get()); + + } + + /** + * 我的下属 + * + * @param id 主键 + * @return + */ + @Operation(summary = "我的下属") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @GetMapping("/Subordinate/{id}") + public ActionResult> getSubordinate(@PathVariable("id") String id) { + List userName = new ArrayList<>(16); + List list = new ArrayList<>(); + if ("0".equals(id)) { + if (Objects.isNull(userProvider.get()) || StringUtil.isEmpty(userProvider.get().getUserId())) { + return ActionResult.success(list); + } + userName.add(userService.getInfo(userProvider.get().getUserId())); + } else { + userName = new ArrayList<>(userService.getListByManagerId(id, null)); + } + List department = userName.stream().map(t -> t.getOrganizeId()).collect(Collectors.toList()); + List departmentList = organizeService.getOrganizeName(department); + for (UserEntity user : userName) { + String departName = departmentList.stream().filter( + t -> String.valueOf(user.getOrganizeId()).equals(String.valueOf(t.getId())) + ).findFirst().orElse(new OrganizeEntity()).getFullName(); + PositionEntity entity = null; + if (StringUtil.isNotEmpty(user.getPositionId())) { + String[] split = user.getPositionId().split(","); + for (String positionId : split) { + entity = positionService.getInfo(positionId); + if (Objects.nonNull(entity)) { + break; + } + } + } + UserSubordinateVO subordinateVO = UserSubordinateVO.builder() + .id(user.getId()) + .avatar(UploaderUtil.uploaderImg(user.getHeadIcon())) + .department(departName) + .userName(user.getRealName() + "/" + user.getAccount()) + .position(entity != null ? entity.getFullName() : null) + .isLeaf(false).build(); + list.add(subordinateVO); + } + return ActionResult.success(list); + } + + /** + * 修改系统主题 + * + * @param userThemeForm 主题模板 + * @return + */ + @Operation(summary = "修改系统主题") + @Parameters({ + @Parameter(name = "userThemeForm", description = "主题模板", required = true) + }) + @PutMapping("/SystemTheme") + public ActionResult updateTheme(@RequestBody @Valid UserThemeForm userThemeForm) { + UserEntity entity = JsonUtil.getJsonToBean(userThemeForm, UserEntity.class); + entity.setId(userProvider.get().getUserId()); + userService.updateById(entity); + return ActionResult.success(MsgCode.SU016.get()); + } + + /** + * 修改头像 + * + * @param name 名称 + * @return + */ + @Operation(summary = "修改头像") + @Parameters({ + @Parameter(name = "name", description = "名称", required = true) + }) + @PutMapping("/Avatar/{name}") + public ActionResult updateAvatar(@PathVariable("name") String name) throws Exception { + UserInfo userInfo = userProvider.get(); + UserEntity userEntity = userService.getInfo(userInfo.getUserId()); + userEntity.setHeadIcon(name); + userService.update(userEntity.getId(), userEntity); + if (!StringUtil.isEmpty(userInfo.getId())) { + userInfo.setUserIcon(name); + //redisUtil.insert(userInfo.getId(), userInfo, DateUtil.getTime(userInfo.getOverdueTime()) - DateUtil.getTime(new Date())); + UserProvider.setLoginUser(userInfo); + UserProvider.setLocalLoginUser(userInfo); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 修改系统语言 + * + * @param userLanguageForm 修改语言模型 + * @return + */ + @Operation(summary = "修改系统语言") + @Parameters({ + @Parameter(name = "userLanguageForm", description = "修改语言模型", required = true) + }) + @PutMapping("/SystemLanguage") + public ActionResult updateLanguage(@RequestBody @Valid UserLanguageForm userLanguageForm) { + UserEntity userEntity = userService.getInfo(userProvider.get().getUserId()); + userEntity.setLanguage(userLanguageForm.getLanguage()); + userService.updateById(userEntity); + return ActionResult.success(MsgCode.SU016.get()); + } + + + /** + * 赋值图标 + * + * @param moduleList + * @return + */ + private Map moduleList(List moduleList) { + Map auth = new HashMap<>(16); + for (ModuleModel module : moduleList) { + auth.put(module.getId(), module); + module.setIcon(module.getIcon()); + } + return auth; + } + + /** + * 功能权限 + * + * @param moduleList 功能 + * @param authorizeLiat 权限集合 + * @return + */ + private List module(List moduleList, List authorizeLiat) { + List appId = moduleList.stream().filter(t -> "App".equals(t.getCategory())).map(t -> t.getId()).collect(Collectors.toList()); + List treeList = JsonUtil.getJsonToList(moduleList, AuthorizeModel.class); + List> trees = TreeDotUtils.convertListToTreeDot(treeList, "-1"); + List vo = JsonUtil.getJsonToList(trees, UserAuthorizeModel.class); + List dataList = new LinkedList<>(); + List appChildList = new LinkedList<>(); + for (UserAuthorizeModel model : vo) { + if (appId.contains(model.getId())) { + appChildList.add(model); + } else { + dataList.add(model); + } + } + if (appChildList.size() > 0) { + UserAuthorizeModel appData = new UserAuthorizeModel(); + appData.setId("1"); + appData.setFullName("App菜单"); + appData.setIcon("ym-custom ym-custom-cellphone"); + appData.setChildren(appChildList); + dataList.add(appData); + } + return dataList; + } + + /** + * 按钮权限 + * + * @param moduleList 功能 + * @param moduleButtonList 按钮 + * @param authorizeLiat 权限集合 + * @return + */ + private List moduleButton(List moduleList, List moduleButtonList, List authorizeLiat, Map moduleMap) { + List treeList = new ArrayList<>(); + Set moduleModeId = new HashSet<>(); + //获取按钮的菜单id + for (ButtonModel buttonModel : moduleButtonList) { + moduleModeId.add(buttonModel.getModuleId()); + AuthorizeModel treeModel = new AuthorizeModel(); + treeModel.setId(buttonModel.getId()); + treeModel.setFullName(buttonModel.getFullName()); + treeModel.setParentId(buttonModel.getModuleId()); + treeModel.setIcon(buttonModel.getIcon()); + treeList.add(treeModel); + } + List buttonList = moduleList.stream().filter(t -> moduleModeId.contains(t.getId())).collect(Collectors.toList()); + List moduleListAll = JsonUtil.getJsonToList(ListToTreeUtil.treeWhere(buttonList, moduleList), AuthorizeModel.class); + treeList.addAll(moduleListAll); + treeList = treeList.stream().sorted(Comparator.comparing(AuthorizeModel::getSortCode)).collect(Collectors.toList()); + List> trees = TreeDotUtils.convertListToTreeDot(treeList, "-1"); + //组装菜单树 + List appId = moduleList.stream().filter(t -> "App".equals(t.getCategory())).map(t -> t.getId()).collect(Collectors.toList()); + List data = JsonUtil.getJsonToList(trees, UserAuthorizeModel.class); + List dataList = new LinkedList<>(); + List appChildList = new LinkedList<>(); + for (UserAuthorizeModel model : data) { + if (appId.contains(model.getId())) { + appChildList.add(model); + } else { + dataList.add(model); + } + } + if (appChildList.size() > 0) { + UserAuthorizeModel appData = new UserAuthorizeModel(); + appData.setId("1"); + appData.setFullName("App菜单"); + appData.setIcon("ym-custom ym-custom-cellphone"); + appData.setChildren(appChildList); + dataList.add(appData); + } + return dataList; + } + + /** + * 列表权限 + * + * @param moduleList 功能 + * @param moduleColumnList 列表 + * @param authorizeLiat 权限集合 + * @return + */ + private List moduleColumn(List moduleList, List moduleColumnList, List authorizeLiat, Map moduleMap) { + List treeList = new ArrayList<>(); + List moduleModeId = new ArrayList<>(); + //获取按钮的菜单id + for (ColumnModel columnModel : moduleColumnList) { + moduleModeId.add(columnModel.getModuleId()); + AuthorizeModel treeModel = new AuthorizeModel(); + treeModel.setId(columnModel.getId()); + treeModel.setFullName(columnModel.getFullName()); + treeModel.setParentId(columnModel.getModuleId()); + treeModel.setIcon("fa fa-tags column"); + treeList.add(treeModel); + } + List buttonList = moduleList.stream().filter(t -> moduleModeId.contains(t.getId())).collect(Collectors.toList()); + List moduleListAll = JsonUtil.getJsonToList(ListToTreeUtil.treeWhere(buttonList, moduleList), AuthorizeModel.class); + treeList.addAll(moduleListAll); + treeList = treeList.stream().sorted(Comparator.comparing(AuthorizeModel::getSortCode)).collect(Collectors.toList()); + List> trees = TreeDotUtils.convertListToTreeDot(treeList, "-1"); + //组装菜单树 + List appId = moduleList.stream().filter(t -> "App".equals(t.getCategory())).map(t -> t.getId()).collect(Collectors.toList()); + List data = JsonUtil.getJsonToList(trees, UserAuthorizeModel.class); + List dataList = new LinkedList<>(); + List appChildList = new LinkedList<>(); + for (UserAuthorizeModel model : data) { + if (appId.contains(model.getId())) { + appChildList.add(model); + } else { + dataList.add(model); + } + } + if (appChildList.size() > 0) { + UserAuthorizeModel appData = new UserAuthorizeModel(); + appData.setId("1"); + appData.setFullName("App菜单"); + appData.setIcon("ym-custom ym-custom-cellphone"); + appData.setChildren(appChildList); + dataList.add(appData); + } + return dataList; + } + + /** + * 表单权限 + * + * @param moduleList 功能 + * @param moduleFormList 表单 + * @param authorizeLiat 权限集合 + * @return ignore + */ + private List moduleForm(List moduleList, List moduleFormList, List authorizeLiat, Map moduleMap) { + List treeList = new ArrayList<>(); + List moduleModeId = new ArrayList<>(); + //获取按钮的菜单id + for (ModuleFormModel formModel : moduleFormList) { + moduleModeId.add(formModel.getModuleId()); + AuthorizeModel treeModel = new AuthorizeModel(); + treeModel.setId(formModel.getId()); + treeModel.setFullName(formModel.getFullName()); + treeModel.setParentId(formModel.getModuleId()); + treeModel.setIcon("fa fa-binoculars resource"); + treeList.add(treeModel); + } + List buttonList = moduleList.stream().filter(t -> moduleModeId.contains(t.getId())).collect(Collectors.toList()); + List moduleListAll = JsonUtil.getJsonToList(ListToTreeUtil.treeWhere(buttonList, moduleList), AuthorizeModel.class); + treeList.addAll(moduleListAll); + treeList = treeList.stream().sorted(Comparator.comparing(AuthorizeModel::getSortCode)).collect(Collectors.toList()); + List> trees = TreeDotUtils.convertListToTreeDot(treeList, "-1"); + //组装菜单树 + List appId = moduleList.stream().filter(t -> "App".equals(t.getCategory())).map(t -> t.getId()).collect(Collectors.toList()); + List data = JsonUtil.getJsonToList(trees, UserAuthorizeModel.class); + List dataList = new LinkedList<>(); + List appChildList = new LinkedList<>(); + for (UserAuthorizeModel model : data) { + if (appId.contains(model.getId())) { + appChildList.add(model); + } else { + dataList.add(model); + } + } + if (appChildList.size() > 0) { + UserAuthorizeModel appData = new UserAuthorizeModel(); + appData.setId("1"); + appData.setFullName("App菜单"); + appData.setIcon("ym-custom ym-custom-cellphone"); + appData.setChildren(appChildList); + dataList.add(appData); + } + return dataList; + } + + /** + * 数据权限 + * + * @param moduleList 功能 + * @param moduleResourceList 资源 + * @param authorizeLiat 权限集合 + * @return ignore + */ + private List resourceData(List moduleList, List moduleResourceList, List authorizeLiat, Map moduleMap) { + List treeList = new ArrayList<>(); + List moduleModeId = new ArrayList<>(); + //获取按钮的菜单id + for (ResourceModel resourceModel : moduleResourceList) { + moduleModeId.add(resourceModel.getModuleId()); + AuthorizeModel treeModel = new AuthorizeModel(); + treeModel.setId(resourceModel.getId()); + treeModel.setFullName(resourceModel.getFullName()); + treeModel.setParentId(resourceModel.getModuleId()); + treeModel.setIcon("fa fa-binoculars resource"); + treeList.add(treeModel); + } + List buttonList = moduleList.stream().filter(t -> moduleModeId.contains(t.getId())).collect(Collectors.toList()); + List moduleListAll = JsonUtil.getJsonToList(ListToTreeUtil.treeWhere(buttonList, moduleList), AuthorizeModel.class); + treeList.addAll(moduleListAll); + treeList = treeList.stream().sorted(Comparator.comparing(AuthorizeModel::getSortCode)).collect(Collectors.toList()); + List> trees = TreeDotUtils.convertListToTreeDot(treeList, "-1"); + //组装菜单树 + List appId = moduleList.stream().filter(t -> "App".equals(t.getCategory())).map(t -> t.getId()).collect(Collectors.toList()); + List data = JsonUtil.getJsonToList(trees, UserAuthorizeModel.class); + List dataList = new LinkedList<>(); + List appChildList = new LinkedList<>(); + for (UserAuthorizeModel model : data) { + if (appId.contains(model.getId())) { + appChildList.add(model); + } else { + dataList.add(model); + } + } + if (appChildList.size() > 0) { + UserAuthorizeModel appData = new UserAuthorizeModel(); + appData.setId("1"); + appData.setFullName("App菜单"); + appData.setIcon("ym-custom ym-custom-cellphone"); + appData.setChildren(appChildList); + dataList.add(appData); + } + return dataList; + } + + /** + * 设置主要组织、主要岗位(角色当前不做) + * + * @param userSettingForm 页面参数 + * @return + */ + @Operation(summary = "设置主要组织、主要岗位(角色当前不做)") + @Parameters({ + @Parameter(name = "userSettingForm", description = "页面参数", required = true) + }) + @PutMapping("/major") + public ActionResult defaultOrganize(@RequestBody UserSettingForm userSettingForm){ + UserEntity userEntity = userService.getInfo(userProvider.get().getUserId()); + if (userEntity == null) { + return ActionResult.fail(ActionResultCode.SessionOverdue.getCode(), ActionResultCode.SessionOverdue.getMessage()); + } + UserEntity updateUser = new UserEntity(); + switch (userSettingForm.getMajorType()){ + case PermissionConst.ORGANIZE: + String orgId = userSettingForm.getMajorId(); + // 对角色权限进行验证 + List permissionGroupEntities = organizeRelationService.checkBasePermission(userEntity.getId(), orgId); + if(organizeRelationService.checkBasePermission(userEntity.getId(), orgId).size() == 0){ + return ActionResult.fail(MsgCode.FA025.get()); + } + updateUser.setOrganizeId(orgId); + // 只取菜单和系统 + List listByObjectId = authorizeService.getListByObjectId(permissionGroupEntities.stream().map(PermissionGroupEntity::getId).collect(Collectors.toList())); + listByObjectId = listByObjectId.stream().filter(t -> AuthorizeConst.SYSTEM.equals(t.getItemType()) || AuthorizeConst.MODULE.equals(t.getItemType())).collect(Collectors.toList()); + List listByIds = systemService.getListByIds(listByObjectId.stream().map(AuthorizeEntity::getItemId).collect(Collectors.toList())); + // 组织的权限没有当前系统 + if (listByIds.size() > 0) { + if (userSettingForm.getMenuType() != null && userSettingForm.getMenuType() == 1) { + if (!listByIds.contains(userEntity.getAppSystemId())) { + updateUser.setAppSystemId(listByIds.get(0).getId()); + } + } else { + if (!listByIds.contains(userEntity.getSystemId())) + updateUser.setSystemId(listByIds.get(0).getId()); + } + } + // 岗位自动切换 + updateUser.setPositionId(organizeRelationService.autoGetMajorPositionId(userEntity.getId(), orgId, userEntity.getPortalId())); + break; + case PermissionConst.POSITION: + updateUser.setPositionId(userSettingForm.getMajorId()); + break; + case PermissionConst.SYSTEM: + SystemEntity systemEntity = systemService.getInfo(userSettingForm.getMajorId()); + if (systemEntity != null && systemEntity.getEnabledMark() == 0) { + return ActionResult.fail("切换失败,当前系统已被管理员禁用"); + } + List moduleBySystemIds = new ArrayList<>(); + // 获取的时候判断 + if (userSettingForm.getMenuType() != null && userSettingForm.getMenuType() == 1) { + updateUser.setAppSystemId(userSettingForm.getMajorId()); + if (organizeAdministratorService.getOrganizeAdministratorEntity(userEntity.getId(), PermissionConst.SYSTEM, false) + .stream().map(OrganizeAdministratorEntity::getOrganizeId).collect(Collectors.toList()).contains(userSettingForm.getMajorId())) { + moduleBySystemIds = moduleService.getModuleBySystemIds(Collections.singletonList(userSettingForm.getMajorId())); + } + List list = authorizeService.getAuthorize(true, false).getModuleList().stream().filter(t -> StringUtil.isNotEmpty(t.getSystemId()) && t.getSystemId().equals(userSettingForm.getMajorId())) + .filter(t -> "App".equals(t.getCategory())) + .collect(Collectors.toList()); + if (list.size() == 0 && moduleBySystemIds.size() == 0) { + return ActionResult.fail(MsgCode.FA027.get()); + } + } else { + updateUser.setSystemId(userSettingForm.getMajorId()); + } + updateUser.setId(userEntity.getId()); + // 切换组织 + String orgIdByUserIdAndSystemId = permissionGroupService.getOrgIdByUserIdAndSystemId(userEntity.getId(), userSettingForm.getMajorId()); + if (StringUtil.isNotEmpty(orgIdByUserIdAndSystemId)) { + updateUser.setOrganizeId(orgIdByUserIdAndSystemId); + } + userService.updateById(updateUser); + return ActionResult.success("切换成功"); + default: + break; + } + updateUser.setId(userEntity.getId()); + userService.updateById(updateUser); + return ActionResult.success(MsgCode.SU016.get()); + } + + @Operation(summary = "获取当前用户所有组织") + @GetMapping("/getUserOrganizes") + public ActionResult> getUserOrganizes(){ + return ActionResult.success(userRelationService.getObjectVoList(PermissionConst.ORGANIZE)); + } + + @Operation(summary = "获取当前用户当前组织底下所有岗位") + @GetMapping("/getUserPositions") + public ActionResult> getUserPositions(){ + return ActionResult.success(userRelationService.getObjectVoList(PermissionConst.POSITION)); + } + + + @Operation(summary = "获取当前用户所有角色") + @GetMapping("/getUserRoles") + public ActionResult> getUserRoles(){ + return ActionResult.success(userRelationService.getObjectVoList(PermissionConst.ROLE)); + } + + /*= different =*/ + + /** + * 修改app常用 + * + * @param userAppDataForm 页面参数 + * @return + */ + @Operation(summary = "修改app常用数据") + @Parameter(name = "userAppDataForm", description = "页面参数", required = true) + @PutMapping("/SystemAppData") + public ActionResult updateAppData(@RequestBody @Valid UserAppDataForm userAppDataForm) { + UserInfo userInfo = userProvider.get(); + UserEntity entity = userService.getInfo(userInfo.getUserId()); + entity.setPropertyJson(userAppDataForm.getData()); + userService.updateById(entity); + return ActionResult.success(MsgCode.SU016.get()); + } + + + /** + * 列表 + * + * @return ignore + */ + @Operation(summary = "获取个性签名列表") + @GetMapping("/SignImg") + public ActionResult getListSignImg() { + List list = signService.getList(); + List data = JsonUtil.getJsonToList(list, SignListVO.class); + return ActionResult.success(data); + } + + + /** + * 新建 + * + * @param signForm 实体对象 + * @return ignore + */ + @Operation(summary = "添加个性签名") + @Parameter(name = "signForm", description = "实体对象", required = true) + @PostMapping("/SignImg") + public ActionResult create(@RequestBody @Valid SignForm signForm) { + SignEntity entity = JsonUtil.getJsonToBean(signForm, SignEntity.class); + boolean b = signService.create(entity); + if(b){ + return ActionResult.success(MsgCode.SU001.get()); + } + return ActionResult.fail(MsgCode.SU001.get()); + } + + /** + * 删除 + * + * @param id 主键值 + * @return ignore + */ + @Operation(summary = "删除个性签名") + @Parameter(name = "id", description = "主键值", required = true) + @DeleteMapping("/{id}/SignImg") + public ActionResult delete(@PathVariable("id") String id) { + boolean delete = signService.delete(id); + if(delete){ + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.SU003.get()); + } + + /** + * 设置默认 + * + * @param id 主键值 + * @return ignore + */ + @Operation(summary = "设置默认") + @Parameter(name = "id", description = "主键值", required = true) + @PutMapping("/{id}/SignImg") + public ActionResult uptateDefault(@PathVariable("id") String id) { + boolean b = signService.updateDefault(id); + if(b){ + return ActionResult.success(MsgCode.SU004.get()); + } + return ActionResult.fail(MsgCode.SU004.get()); + } +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/pom.xml b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/pom.xml new file mode 100644 index 0000000..da17753 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/pom.xml @@ -0,0 +1,31 @@ + + + + jnpf-permission + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-permission-entity + + + + com.jnpf + jnpf-common-all + ${project.version} + + + com.jnpf + jnpf-system-entity + ${project.version} + + + org.mybatis.dynamic-sql + mybatis-dynamic-sql + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/AuthorizeEntity.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/AuthorizeEntity.java new file mode 100644 index 0000000..41b90e4 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/AuthorizeEntity.java @@ -0,0 +1,46 @@ +package jnpf.permission.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * 操作权限 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技AuthorizeController术有限公司 + * @date 2019年9月26日 上午9:18 + */ +@Data +@TableName("base_authorize") +public class AuthorizeEntity extends SuperExtendEntity { + + /** + * 项目类型 + */ + @TableField("f_item_type") + private String itemType; + + /** + * 项目主键 + */ + @TableField("f_item_id") + private String itemId; + + /** + * 对象类型 + */ + @TableField("f_object_type") + private String objectType; + + /** + * 对象主键 + */ + @TableField("f_object_id") + private String objectId; + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/ColumnsPurviewEntity.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/ColumnsPurviewEntity.java new file mode 100644 index 0000000..85e09da --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/ColumnsPurviewEntity.java @@ -0,0 +1,33 @@ +package jnpf.permission.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * 模块列表权限 + * + * @author :JNPF开发平台组 + * @version: V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date :2022/3/15 9:20 + */ +@Data +@TableName("base_columns_purview") +public class ColumnsPurviewEntity extends SuperExtendEntity.SuperExtendEnabledEntity { + + /** + * 列表字段数组 + */ + @TableField("f_field_list") + private String fieldList; + /** + * 模块ID + */ + @TableField("f_module_id") + private String moduleId; + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/GroupEntity.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/GroupEntity.java new file mode 100644 index 0000000..7a1bc30 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/GroupEntity.java @@ -0,0 +1,43 @@ +package jnpf.permission.entity; + +import jnpf.base.entity.SuperExtendEntity; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +/** + * 分组管理 + * + * @author :JNPF开发平台组 + * @version: V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date :2022/3/10 17:53 + */ +@Data +@TableName("base_group") +public class GroupEntity extends SuperExtendEntity.SuperExtendDEEntity { + + /** + * 名称 + */ + @TableField("f_full_name") + private String fullName; + + /** + * 编码 + */ + @TableField("f_en_code") + private String enCode; + + /** + * 类型 + */ + @TableField("f_category") + private String type; + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/OrganizeAdministratorEntity.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/OrganizeAdministratorEntity.java new file mode 100644 index 0000000..a2e7dc8 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/OrganizeAdministratorEntity.java @@ -0,0 +1,90 @@ +package jnpf.permission.entity; + +import jnpf.base.entity.SuperExtendEntity; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +/** + * + * 机构分级管理员 + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +@Data +@TableName("base_organize_administrator") +public class OrganizeAdministratorEntity extends SuperExtendEntity.SuperExtendDEEntity { + /** + * 用户主键 + */ + @TableField("F_USER_ID") + private String userId; + + /** + * 机构主键 + */ + @TableField("F_ORGANIZE_ID") + private String organizeId; + + /** + * 机构类型 + */ + @TableField("F_ORGANIZE_TYPE") + private String organizeType; + + /** + * 本层添加 + */ + @TableField("F_THIS_LAYER_ADD") + private Integer thisLayerAdd; + + /** + * 本层编辑 + */ + @TableField("F_THIS_LAYER_EDIT") + private Integer thisLayerEdit; + + /** + * 本层删除 + */ + @TableField("F_THIS_LAYER_DELETE") + private Integer thisLayerDelete; + + /** + * 子层添加 + */ + @TableField("F_SUB_LAYER_ADD") + private Integer subLayerAdd; + + /** + * 子层编辑 + */ + @TableField("F_SUB_LAYER_EDIT") + private Integer subLayerEdit; + + /** + * 子层删除 + */ + @TableField("F_SUB_LAYER_DELETE") + private Integer subLayerDelete; + + /** + * 本层查看 + */ + @TableField("F_THIS_LAYER_SELECT") + private Integer thisLayerSelect; + + /** + * 子层查看 + */ + @TableField("F_SUB_LAYER_SELECT") + private Integer subLayerSelect; + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/OrganizeEntity.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/OrganizeEntity.java new file mode 100644 index 0000000..b94a012 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/OrganizeEntity.java @@ -0,0 +1,60 @@ +package jnpf.permission.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 组织机构 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +@Data +@TableName("base_organize") +public class OrganizeEntity extends PermissionEntityBase{ + /** + * 机构上级 + */ + @TableField("F_PARENT_ID") + private String parentId; + + /** + * 机构分类 + */ + @TableField("F_CATEGORY") + private String category; + + /** + * 机构编号 + */ + @TableField("F_EN_CODE") + private String enCode; + + /** + * 机构名称 + */ + @TableField("F_FULL_NAME") + private String fullName; + + /** + * 机构主管 + */ + @TableField("F_MANAGER_ID") + private String managerId; + + /** + * 扩展属性 + */ + @TableField("F_PROPERTY_JSON") + private String propertyJson; + + /** + * 父级组织 + */ + @TableField("F_ORGANIZE_ID_TREE") + private String organizeIdTree; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/OrganizeRelationEntity.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/OrganizeRelationEntity.java new file mode 100644 index 0000000..4d2d559 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/OrganizeRelationEntity.java @@ -0,0 +1,46 @@ +package jnpf.permission.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import java.util.Date; + + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + +/** + *

+ * 组织关系 + *

+ * + * @author YanYu + * @since 2022-01-19 + */ +@Data +@TableName("base_organize_relation") +@Schema(description = "OrganizeRelation对象", name = "组织关系") +public class OrganizeRelationEntity extends SuperExtendEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 组织主键 + */ + @TableField("F_ORGANIZE_ID") + private String organizeId; + + /** + * 对象类型(角色:role) + */ + @TableField("F_OBJECT_TYPE") + private String objectType; + + /** + * 对象主键 + */ + @TableField("F_OBJECT_ID") + private String objectId; + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/PermissionEntityBase.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/PermissionEntityBase.java new file mode 100644 index 0000000..6e29633 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/PermissionEntityBase.java @@ -0,0 +1,41 @@ +package jnpf.permission.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * 类功能 + * + * @author JNPF开发平台组 YanYu + * @version V3.2.0 + * @copyright 引迈信息技术有限公司 + * @date 2022/1/27 + */ +@Data +public class PermissionEntityBase extends SuperExtendEntity.SuperExtendDEEntity { + + /** + * 名称 + */ + @TableField("f_full_name") + private String fullName; + + /** + * 编码 + */ + @TableField("f_en_code") + private String enCode; + + /** + * 扩展属性 + */ + @TableField("f_property_json") + private String propertyJson; + +} + diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/PermissionGroupEntity.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/PermissionGroupEntity.java new file mode 100644 index 0000000..d2641c1 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/PermissionGroupEntity.java @@ -0,0 +1,30 @@ +package jnpf.permission.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + +@Data +@TableName("base_permission_group") +public class PermissionGroupEntity extends SuperExtendEntity.SuperExtendDEEntity { + + /** + * 名称 + */ + @TableField("f_full_name") + private String fullName; + + /** + * 编码 + */ + @TableField("F_en_code") + private String enCode; + + /** + * 权限成员 + */ + @TableField("F_permission_member") + private String permissionMember; + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/PositionEntity.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/PositionEntity.java new file mode 100644 index 0000000..4e79d03 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/PositionEntity.java @@ -0,0 +1,35 @@ +package jnpf.permission.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +/** + * 岗位信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +@Data +@TableName("base_position") +public class PositionEntity extends PermissionEntityBase{ + + /** + * 岗位类型 + */ + @TableField("F_TYPE") + private String type; + + /** + * 机构主键 + */ + @TableField("F_ORGANIZE_ID") + private String organizeId; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/RoleEntity.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/RoleEntity.java new file mode 100644 index 0000000..713ffee --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/RoleEntity.java @@ -0,0 +1,39 @@ +package jnpf.permission.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +/** + * 系统角色 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +@Data +@TableName("base_role") +public class RoleEntity extends PermissionEntityBase{ + + /** + * 角色类型 + */ + @TableField("F_TYPE") + private String type; + + + + /** + * 全局标识 + */ + @TableField("F_GLOBAL_MARK") + private Integer globalMark; + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/SignEntity.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/SignEntity.java new file mode 100644 index 0000000..74d3ddd --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/SignEntity.java @@ -0,0 +1,34 @@ +package jnpf.permission.entity; + +import jnpf.base.entity.SuperEntity; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +/** + * 个人签名 + * + * @author JNPF开发平台组 + * @copyright 引迈信息技术有限公司 + * @date 2022年9月2日 上午9:18 + */ +@Data +@TableName("base_sign_img") +public class SignEntity extends SuperEntity { + + /** + * 签名图片 + */ + @TableField("F_SIGN_IMG") + private String signImg; + + /** + * 是否默认 + */ + @TableField("F_IS_DEFAULT") + private Integer isDefault; +} + diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/SocialsUserEntity.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/SocialsUserEntity.java new file mode 100644 index 0000000..33b967b --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/SocialsUserEntity.java @@ -0,0 +1,46 @@ +package jnpf.permission.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * 流程设计 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/7/14 9:28:32 + */ +@Data +@TableName("base_socials_users") +public class SocialsUserEntity extends SuperExtendEntity { + + /** + * 用户id + */ + @TableField("F_USER_ID") + private String userId; + + /** + * 第三方类型 + */ + @TableField("F_SOCIAL_TYPE") + private String socialType; + + /** + * 第三方账号id + */ + @TableField("F_SOCIAL_ID") + private String socialId; + + /** + * 第三方账号 + */ + @TableField("F_SOCIAL_NAME") + private String socialName; + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/UserEntity.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/UserEntity.java new file mode 100644 index 0000000..ccfb2c3 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/UserEntity.java @@ -0,0 +1,315 @@ +package jnpf.permission.entity; + +import jnpf.base.entity.SuperExtendEntity; +import com.baomidou.mybatisplus.annotation.*; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +/** + * 用户信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +@Data +@TableName("base_user") +public class UserEntity extends SuperExtendEntity.SuperExtendDEEntity { + /** + * 账户 + */ + @TableField("F_ACCOUNT") + private String account; + + /** + * 姓名 + */ + @TableField("F_REAL_NAME") + private String realName; + + /** + * 快速查询 + */ + @TableField("F_QUICK_QUERY") + private String quickQuery; + + /** + * 呢称 + */ + @TableField("F_NICK_NAME") + private String nickName; + + /** + * 头像 + */ + @TableField("F_HEAD_ICON") + private String headIcon; + + /** + * 性别 + */ + @TableField("F_GENDER") + private Integer gender; + + /** + * 生日 + */ + @TableField("F_BIRTHDAY") + private Date birthday; + + /** + * 手机 + */ + @TableField("F_MOBILE_PHONE") + private String mobilePhone; + + /** + * 电话 + */ + @TableField("F_TELE_PHONE") + private String telePhone; + + /** + * F_Landline + */ + @TableField("F_LANDLINE") + private String landline; + + /** + * 邮箱 + */ + @TableField("F_EMAIL") + private String email; + + /** + * 民族 + */ + @TableField("F_NATION") + private String nation; + + /** + * 籍贯 + */ + @TableField("F_NATIVE_PLACE") + private String nativePlace; + + /** + * 入职日期 + */ + @TableField(value = "F_ENTRY_DATE",fill= FieldFill.UPDATE) + private Date entryDate; + + /** + * 证件类型 + */ + @TableField("F_CERTIFICATES_TYPE") + private String certificatesType; + + /** + * 证件号码 + */ + @TableField("F_CERTIFICATES_NUMBER") + private String certificatesNumber; + + /** + * 文化程度 + */ + @TableField("F_EDUCATION") + private String education; + + /** + * F_UrgentContacts + */ + @TableField("F_URGENT_CONTACTS") + private String urgentContacts; + + /** + * 紧急电话 + */ + @TableField("F_URGENT_TELE_PHONE") + private String urgentTelePhone; + + /** + * 通讯地址 + */ + @TableField("F_POSTAL_ADDRESS") + private String postalAddress; + + /** + * 自我介绍 + */ + @TableField("F_SIGNATURE") + private String signature; + + /** + * 密码 + */ + @TableField("F_PASSWORD") + private String password; + + /** + * 秘钥 + */ + @TableField("F_SECRETKEY") + private String secretkey; + + /** + * 首次登录时间 + */ + @TableField("F_FIRST_LOG_TIME") + private Date firstLogTime; + + /** + * 首次登录IP + */ + @TableField("F_FIRST_LOG_IP") + private String firstLogIp; + + /** + * 前次登录时间 + */ + @TableField("F_PREV_LOG_TIME") + private Date prevLogTime; + + /** + * 前次登录IP + */ + @TableField("F_PREV_LOG_IP") + private String prevLogIp; + + /** + * 最后登录时间 + */ + @TableField("F_LAST_LOG_TIME") + private Date lastLogTime; + + /** + * 最后登录IP + */ + @TableField("F_LAST_LOG_IP") + private String lastLogIp; + + /** + * 登录成功次数 + */ + @TableField("F_LOG_SUCCESS_COUNT") + private Integer logSuccessCount; + + /** + * 登录错误次数 + */ + @TableField("F_LOG_ERROR_COUNT") + private Integer logErrorCount; + + /** + * 最后修改密码时间 + */ + @TableField("F_CHANGE_PASSWORD_DATE") + private Date changePasswordDate; + + /** + * 系统语言 + */ + @TableField("F_LANGUAGE") + private String language; + + /** + * 系统样式 + */ + @TableField("F_THEME") + private String theme; + + /** + * 常用菜单 + */ + @TableField("F_COMMON_MENU") + private String commonMenu; + + /** + * 是否管理员 + */ + @TableField("F_IS_ADMINISTRATOR") + private Integer isAdministrator; + + /** + * 扩展属性 + */ + @TableField("F_PROPERTY_JSON") + private String propertyJson; + + /** + * 主管主键 + */ + @TableField("F_MANAGER_ID") + private String managerId; + + /** + * 组织主键 + */ + @TableField("F_ORGANIZE_ID") + private String organizeId; + + /** + * 岗位主键 + */ + @TableField("F_POSITION_ID") + private String positionId; + + /** + * 角色主键 + */ + @TableField("F_ROLE_ID") + private String roleId; + + /** + * 门户主键 + */ + @TableField("F_PORTAL_ID") + private String portalId; + + /** + * 是否锁定 + */ + @TableField("F_LOCK_MARK") + private Integer lockMark; + + /** + * 解锁时间 + */ + @TableField(value = "F_UNLOCK_TIME",updateStrategy = FieldStrategy.IGNORED) + private Date unlockTime; + + /** + * 分组id + */ + @TableField("F_GROUP_ID") + private String groupId; + + /** + * 系统id + */ + @TableField("F_SYSTEM_ID") + private String systemId; + + /** + * App系统id + */ + @TableField("F_APP_SYSTEM_ID") + private String appSystemId; + + /** + * 钉钉工号 + */ + @TableField("F_DING_JOB_NUMBER") + private String dingJobNumber; + + /** + * 交接状态 + */ + @TableField("f_handover_mark") + private Integer handoverMark; + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/UserOldPasswordEntity.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/UserOldPasswordEntity.java new file mode 100644 index 0000000..346d55c --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/UserOldPasswordEntity.java @@ -0,0 +1,47 @@ +package jnpf.permission.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * 用户信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +@Data +@TableName(value = "base_user_old_password") +public class UserOldPasswordEntity extends SuperExtendEntity { + + /** + * userid + */ + @TableField("F_USER_ID") + private String userId; + + /** + * 账户 + */ + @TableField("F_ACCOUNT") + private String account; + + /** + * 旧密码 + */ + @TableField("F_OLD_PASSWORD") + private String oldPassword; + + /** + * 秘钥 + */ + @TableField("F_SECRETKEY") + private String secretkey; + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/UserRelationEntity.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/UserRelationEntity.java new file mode 100644 index 0000000..1f659c7 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/entity/UserRelationEntity.java @@ -0,0 +1,40 @@ +package jnpf.permission.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * 用户关系 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +@Data +@TableName("base_user_relation") +public class UserRelationEntity extends SuperExtendEntity { + + /** + * 用户主键 + */ + @TableField("F_USER_ID") + private String userId; + + /** + * 对象类型 + */ + @TableField("F_OBJECT_TYPE") + private String objectType; + + /** + * 对象主键 + */ + @TableField("F_OBJECT_ID") + private String objectId; + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeConditionEnum.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeConditionEnum.java new file mode 100644 index 0000000..40fe00e --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeConditionEnum.java @@ -0,0 +1,89 @@ +package jnpf.permission.model.authorize; + +import jnpf.util.visiual.JnpfKeyConsts; + +/** + * 数据权限过滤条件字段 + * @author JNPF开发平台组 + * @version V3.2 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/10/9 + */ +public enum AuthorizeConditionEnum { + /** + * 任意文本 + */ + TEXT("input","任意文本"), + /** + * 当前组织 + */ + ORGANIZE("@organizeId","当前组织"), + /** + * 当前组织及子组织 + */ + ORGANIZEANDUNDER("@organizationAndSuborganization","当前组织及子组织"), + /** + * 当前用户 + */ + USER("@userId","当前用户"), + /** + * 当前用户及下属 + */ + USERANDUNDER("@userAraSubordinates","当前用户及下属"), + /** + * 当前分管组织 + */ + BRANCHMANAGEORG("@branchManageOrganize","当前分管组织"), + + /** + * 当前分管组织及子组织 + */ + BRANCHMANAGEORGANIZEUNDER("@branchManageOrganizeAndSub","当分管组织及子组织"), + + + + DATATIME(JnpfKeyConsts.DATE,"日期选择"), + INPUTNUMBER(JnpfKeyConsts.NUM_INPUT,"数字输入"), + COMSELECT(JnpfKeyConsts.COMSELECT,"组织选择"), + DEPSELECT(JnpfKeyConsts.DEPSELECT,"部门选择"), + POSSELECT(JnpfKeyConsts.POSSELECT,"岗位选择"), + ROLESELECT(JnpfKeyConsts.ROLESELECT,"角色选择"), + GROUPSELECT(JnpfKeyConsts.GROUPSELECT,"分组选择"), + USERSELECT(JnpfKeyConsts.USERSELECT,"用户选择"), + + + ; + private String condition; + private String message; + + AuthorizeConditionEnum(String condition,String message) { + this.condition = condition; + this.message = message; + } + + public String getCondition() { + return condition; + } + + public void setCondition(String condition) { + this.condition = condition; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public static AuthorizeConditionEnum getByMessage(String condition) { + for (AuthorizeConditionEnum status : AuthorizeConditionEnum.values()) { + if (status.getCondition().equals(condition)) { + return status; + } + } + return null; + } + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeConditionModel.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeConditionModel.java new file mode 100644 index 0000000..87c4f95 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeConditionModel.java @@ -0,0 +1,17 @@ +package jnpf.permission.model.authorize; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class AuthorizeConditionModel{ + private QueryWrapper obj; + private String moduleId; + private String tableName; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeDataModel.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeDataModel.java new file mode 100644 index 0000000..13f3567 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeDataModel.java @@ -0,0 +1,28 @@ +package jnpf.permission.model.authorize; + +import jnpf.util.treeutil.SumTree; +import lombok.Data; + +import java.util.Date; + +/** + * 数据权限 + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:04 + */ +@Data +public class AuthorizeDataModel extends SumTree { + private String id; + private String fullName; + private String icon; + private Boolean showcheck; + private Integer checkstate; + private String title; + private String moduleId; + private String type; + private Date creatorTime; + private String category; + private Long sortCode=9999L; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeDataReturnModel.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeDataReturnModel.java new file mode 100644 index 0000000..bb4a975 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeDataReturnModel.java @@ -0,0 +1,25 @@ +package jnpf.permission.model.authorize; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.Data; + +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:26 + */ +@Data +@JsonInclude(JsonInclude.Include.NON_NULL) +public class AuthorizeDataReturnModel { + private String id; + private String fullName; + private String icon; + private String type; + private Long sortCode; + private String category; + private List children; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeDataReturnVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeDataReturnVO.java new file mode 100644 index 0000000..1c7c54e --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeDataReturnVO.java @@ -0,0 +1,24 @@ +package jnpf.permission.model.authorize; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:27 + */ +@Data +public class AuthorizeDataReturnVO { + @Schema(description = "权限模型集合") + List list; + @Schema(description = "id集合") + List ids; + //all字段里面不包括菜单id + @Schema(description = "所有的id") + List all; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeDataUpForm.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeDataUpForm.java new file mode 100644 index 0000000..ca83158 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeDataUpForm.java @@ -0,0 +1,33 @@ +package jnpf.permission.model.authorize; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:27 + */ +@Data +public class AuthorizeDataUpForm { + @Schema(description = "对象类型") + private String objectType; + + @Schema(description = "按钮id") + private String[] button; + @Schema(description = "列表id") + private String[] column; + @Schema(description = "菜单id") + private String[] module; + @Schema(description = "数据权限方案id") + private String[] resource; + @Schema(description = "表单id") + private String[] form; + + + @Schema(description = "系统id") + private String[] systemIds; + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeDataVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeDataVO.java new file mode 100644 index 0000000..e5ef630 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeDataVO.java @@ -0,0 +1,21 @@ +package jnpf.permission.model.authorize; + +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:27 + */ +@Data +public class AuthorizeDataVO { + private AuthorizeDataReturnVO module; + private AuthorizeDataReturnVO button; + private AuthorizeDataReturnVO column; + private AuthorizeDataReturnVO resource; + private AuthorizeDataReturnVO form; + private AuthorizeDataReturnVO system; + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeDataValuesVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeDataValuesVO.java new file mode 100644 index 0000000..af9ce0e --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeDataValuesVO.java @@ -0,0 +1,19 @@ +package jnpf.permission.model.authorize; + +import lombok.Data; + +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:27 + */ +@Data +public class AuthorizeDataValuesVO { + List list; + List ids; + List all; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeItemObjIdsVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeItemObjIdsVO.java new file mode 100644 index 0000000..9c2bbab --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeItemObjIdsVO.java @@ -0,0 +1,19 @@ +package jnpf.permission.model.authorize; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:27 + */ +@Data +public class AuthorizeItemObjIdsVO { + @Schema(description = "id集合") + private List ids; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeModel.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeModel.java new file mode 100644 index 0000000..2a1c1da --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeModel.java @@ -0,0 +1,20 @@ +package jnpf.permission.model.authorize; + +import jnpf.util.treeutil.SumTree; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:27 + */ +@Data +public class AuthorizeModel extends SumTree { + private String id; + private String fullName; + private String icon; + + private long sortCode; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeVO.java new file mode 100644 index 0000000..fe161ad --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/AuthorizeVO.java @@ -0,0 +1,64 @@ +package jnpf.permission.model.authorize; + +import jnpf.base.model.base.SystemBaeModel; +import jnpf.base.model.button.ButtonModel; +import jnpf.base.model.column.ColumnModel; +import jnpf.base.model.form.ModuleFormModel; +import jnpf.base.model.module.ModuleModel; +import jnpf.base.model.resource.ResourceModel; +import lombok.Data; + +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:29 + */ +@Data +public class AuthorizeVO { + // 菜单 +// private List menuList; + + /** + * 功能 + */ + private List moduleList; + + /** + * 按钮 + */ + private List buttonList; + + /** + * 视图 + */ + private List columnList; + + /** + * 资源 + */ + private List resourceList; + + /** + * 表单 + */ + private List formsList; + + /** + * 系统 + */ + private List systemList; + + public AuthorizeVO(List moduleList, List buttonList, List columnList, List resourceList, List formsList, List systemList) { +// this.menuList = menuList; + this.moduleList = moduleList; + this.buttonList = buttonList; + this.columnList = columnList; + this.resourceList = resourceList; + this.formsList = formsList; + this.systemList = systemList; + } +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/ConditionModel.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/ConditionModel.java new file mode 100644 index 0000000..d408c3e --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/ConditionModel.java @@ -0,0 +1,34 @@ +package jnpf.permission.model.authorize; + +import lombok.Data; + +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class ConditionModel { + private String logic; + private List groups; + + /** + * 数据权限条件字段 + */ + @Data + public class ConditionItemModel{ + private String id; + private String field; + private String type; + private String op; + private String value; + private String fieldRule; + private String bindTable; + private String conditionText; + private String childTableKey; + } +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/DataValuesQuery.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/DataValuesQuery.java new file mode 100644 index 0000000..d295973 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/DataValuesQuery.java @@ -0,0 +1,21 @@ +package jnpf.permission.model.authorize; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class DataValuesQuery { + + @Schema(description = "类型") + private String type; + @Schema(description = "菜单id集合") + private String moduleIds; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/OnlineDynamicSqlModel.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/OnlineDynamicSqlModel.java new file mode 100644 index 0000000..8d458ae --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/OnlineDynamicSqlModel.java @@ -0,0 +1,45 @@ +package jnpf.permission.model.authorize; + +import lombok.Data; +import org.mybatis.dynamic.sql.BasicColumn; +import org.mybatis.dynamic.sql.SqlColumn; +import org.mybatis.dynamic.sql.SqlTable; + +import java.util.List; +import java.util.Map; + +/** + * + * dynamicSql模型 + * @author JNPF开发平台组 + * @version V3.4.4 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2022/9/27 + */ +@Data +public class OnlineDynamicSqlModel { + private List columns; + private SqlTable sqlTable; + private String tableName; + private boolean isMain; + private String foreign; + private String relationKey; + + public OnlineDynamicSqlModel(){ + + } + + public OnlineDynamicSqlModel(SqlTable sqlTable, List sqlColumns) { + this.sqlTable = sqlTable; + this.columns = sqlColumns; + this.isMain = true; + } + + public OnlineDynamicSqlModel(SqlTable sqlTable, List sqlColumns,String foreign,String relationKey, boolean b) { + this.sqlTable = sqlTable; + this.columns = sqlColumns; + this.foreign = foreign; + this.relationKey = relationKey; + this.isMain = b; + } +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/ResourceVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/ResourceVO.java new file mode 100644 index 0000000..ec06631 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/ResourceVO.java @@ -0,0 +1,27 @@ +package jnpf.permission.model.authorize; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class ResourceVO { + @Schema(description = "资源主键") + private String id; + @Schema(description = "资源名称") + private String fullName; + @Schema(description = "资源编码") + private String enCode; + @Schema(description = "条件规则") + private String conditionJson; + @Schema(description = "规则描述") + private String conditionText; + @Schema(description = "功能主键") + private String moduleId; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/SaveAuthForm.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/SaveAuthForm.java new file mode 100644 index 0000000..b5c1143 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/SaveAuthForm.java @@ -0,0 +1,21 @@ +package jnpf.permission.model.authorize; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class SaveAuthForm { + @Schema(description = "权限类型") + private String itemType; + @Schema(description = "对象类型") + private String objectType; + @Schema(description = "对象主键") + private String[] objectId; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/SaveBatchForm.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/SaveBatchForm.java new file mode 100644 index 0000000..5930bcf --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/authorize/SaveBatchForm.java @@ -0,0 +1,34 @@ +package jnpf.permission.model.authorize; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class SaveBatchForm { + @Schema(description = "角色id集合") + private String[] roleIds; + @Schema(description = "岗位id集合") + private String[] positionIds; + @Schema(description = "用户id集合") + private String[] userIds; + @Schema(description = "菜单id集合") + private String[] module; + @Schema(description = "按钮id集合") + private String[] button; + @Schema(description = "列表id集合") + private String[] column; + @Schema(description = "数据权限方案id集合") + private String[] resource; + @Schema(description = "表单id集合") + private String[] form; + + @Schema(description = "系统id集合") + private String[] systemIds; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/columnspurview/ColumnsPurviewUpForm.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/columnspurview/ColumnsPurviewUpForm.java new file mode 100644 index 0000000..34c109f --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/columnspurview/ColumnsPurviewUpForm.java @@ -0,0 +1,24 @@ +package jnpf.permission.model.columnspurview; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 列表权限修改模型 + * + * @author :JNPF开发平台组 + * @version: V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date :2022/3/15 9:59 + */ +@Data +public class ColumnsPurviewUpForm implements Serializable { + @Schema(description = "列表字段数组") + private String fieldList; + @Schema(description = "模块ID") + @NotBlank(message = "操作模块不能为空") + private String moduleId; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/datainterface/DataInterfaceVarConst.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/datainterface/DataInterfaceVarConst.java new file mode 100644 index 0000000..db00efb --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/datainterface/DataInterfaceVarConst.java @@ -0,0 +1,60 @@ +package jnpf.permission.model.datainterface; + +/** + * 接口数据配置系统变量 + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2022/6、29 + */ +public class DataInterfaceVarConst { + + /** + * 当前用户 + */ + public static final String USER = "@currentUser"; + /** + * 当前组织及子组织 + */ + public static final String ORGANDSUB = "@currentOrganizationAndSuborganization"; + /** + * 当前用户及下属 + */ + public static final String USERANDSUB = "@currentUsersAndSubordinates"; + /** + * 当前分管组织 + */ + public static final String CHARORG = "@chargeorganization"; + /** + * 当前组织 + */ + public static final String ORG = "@organization"; + /** + * 页行数 + */ + public static final String PAGESIZE = "@pageSize"; + /** + * 关键字 + */ + public static final String KEYWORD = "@keyword"; + /** + * 当前页 + */ + public static final String CURRENTPAGE = "@currentPage"; + /** + * 条数 + */ + public static final String OFFSETSIZE = "@offsetSize"; + /** + * 当前分管组织及子组织 + */ + public static final String SHOWKEY = "@showKey"; + /** + * 当前分管组织及子组织 + */ + public static final String SHOWVALUE = "@showValue"; + /** + * 生成雪花id + */ + public static final String ID = "@snowFlakeID"; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeByAuthModel.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeByAuthModel.java new file mode 100644 index 0000000..a5a5532 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeByAuthModel.java @@ -0,0 +1,13 @@ +package jnpf.permission.model.organize; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + + +@Data +public class OrganizeByAuthModel extends OrganizeModel { + + @Schema(description = "是否可选") + private Boolean disabled = false; + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeConditionModel.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeConditionModel.java new file mode 100644 index 0000000..f861d03 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeConditionModel.java @@ -0,0 +1,22 @@ +package jnpf.permission.model.organize; + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.base.Page; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author :JNPF开发平台组 + * @version: V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date :2022/6/8 14:05 + */ +@Data +public class OrganizeConditionModel extends Page implements Serializable { + + @Schema(description = "部门id集合") + private List departIds; + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeCrForm.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeCrForm.java new file mode 100644 index 0000000..b39aa2f --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeCrForm.java @@ -0,0 +1,32 @@ +package jnpf.permission.model.organize; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class OrganizeCrForm { + + @NotBlank(message = "公司上级不能为空") + private String parentId; + @NotBlank(message = "公司名称不能为空") + private String fullName; + @NotBlank(message = "公司编码不能为空") + private String enCode; + private String description; + @NotNull(message = "公司状态不能为空") + private Integer enabledMark; + private OrganizeCrModel propertyJson; + @Schema(description = "排序") + private Long sortCode; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeCrModel.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeCrModel.java new file mode 100644 index 0000000..9114585 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeCrModel.java @@ -0,0 +1,38 @@ +package jnpf.permission.model.organize; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import javax.validation.constraints.NotBlank; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class OrganizeCrModel { + @NotBlank(message = "必填") + @Schema(description = "公司简称") + private String shortName; + private String webSite; + @NotBlank(message = "必填") + @Schema(description = "所属行业") + private String industry; + private Long foundedTime; + private String address; + private String managerName; + private String managerTelePhone; + private String managerMobilePhone; + private String manageEmail; + private String bankName; + private String bankAccount; + private String businessscope; + @NotBlank(message = "必填") + @Schema(description = "公司性质") + private String enterpriseNature; + private String fax; + private String telePhone; + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeDepartCrForm.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeDepartCrForm.java new file mode 100644 index 0000000..22b50f9 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeDepartCrForm.java @@ -0,0 +1,34 @@ +package jnpf.permission.model.organize; + +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import javax.validation.constraints.NotBlank; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class OrganizeDepartCrForm { + + @JSONField(name="manager") + private String managerId; + @NotBlank(message = "必填") + @Schema(description = "上级ID") + private String parentId; + @NotBlank(message = "必填") + @Schema(description = "部门名称") + private String fullName; + @NotBlank(message = "必填") + @Schema(description = "部门编码") + private String enCode; + @Schema(description = "状态") + private int enabledMark; + private String description; + @Schema(description = "排序") + private Long sortCode; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeDepartInfoVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeDepartInfoVO.java new file mode 100644 index 0000000..27aa0cd --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeDepartInfoVO.java @@ -0,0 +1,38 @@ +package jnpf.permission.model.organize; + +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class OrganizeDepartInfoVO { + @Schema(description = "主键") + private String id; + @Schema(description = "父主键") + private String parentId; + @Schema(description = "名称") + private String fullName; + @Schema(description = "编码") + private String enCode; + @Schema(description = "状态") + private Integer enabledMark; + @Schema(description = "备注") + private String description; + @Schema(description = "主管id") + @JSONField(name = "manager") + private String managerId; + @Schema(description = "排序码") + private Long sortCode; + + @Schema(description = "组织id树") + private List organizeIdTree; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeDepartListVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeDepartListVO.java new file mode 100644 index 0000000..08e9cdf --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeDepartListVO.java @@ -0,0 +1,39 @@ +package jnpf.permission.model.organize; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class OrganizeDepartListVO { + @Schema(description = "主键") + private String id; + @Schema(description = "父主键") + private String parentId; + @Schema(description = "名称") + private String fullName; + @Schema(description = "编码") + private String enCode; + @Schema(description = "备注") + private String description; + @Schema(description = "创建时间") + private Long creatorTime; + @Schema(description = "部门经理") + private String manager; + @Schema(description = "状态") + private Integer enabledMark; + @Schema(description = "是否有下级菜单") + private Boolean hasChildren; + @Schema(description = "下级菜单列表") + private List children; + @Schema(description = "排序") + private Long sortCode; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeDepartSelectorByAuthListVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeDepartSelectorByAuthListVO.java new file mode 100644 index 0000000..306de50 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeDepartSelectorByAuthListVO.java @@ -0,0 +1,20 @@ +package jnpf.permission.model.organize; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author :JNPF开发平台组 + * @version: V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date :2022/6/28 9:35 + */ +@Data +public class OrganizeDepartSelectorByAuthListVO extends OrganizeDepartSelectorListVO implements Serializable { + + @Schema(description = "是否可选") + private Boolean disabled = false; + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeDepartSelectorListVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeDepartSelectorListVO.java new file mode 100644 index 0000000..39c9bda --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeDepartSelectorListVO.java @@ -0,0 +1,38 @@ +package jnpf.permission.model.organize; + +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:17 + */ +@Data +public class OrganizeDepartSelectorListVO { + @Schema(description = "主键") + private String id; + @Schema(description = "父主键") + private String parentId; + @Schema(description = "名称") + private String fullName; + @Schema(description = "图标") + private String icon; + @Schema(description = "是否有下级菜单") + private Boolean hasChildren = true; + @Schema(description = "状态") + private Integer enabledMark; + @Schema(description = "下级菜单列表") + private List children; + @JSONField(name="category") + private String type; + private String organize; + + @Schema(description = "组织id树") + private List organizeIds; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeDepartUpForm.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeDepartUpForm.java new file mode 100644 index 0000000..8e01339 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeDepartUpForm.java @@ -0,0 +1,14 @@ +package jnpf.permission.model.organize; + +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class OrganizeDepartUpForm extends OrganizeDepartCrForm { +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeInfoVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeInfoVO.java new file mode 100644 index 0000000..46b17dc --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeInfoVO.java @@ -0,0 +1,37 @@ +package jnpf.permission.model.organize; + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.permission.model.permission.PermissionVoBase; +import lombok.Data; + +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class OrganizeInfoVO extends PermissionVoBase { + @Schema(description = "主键") + private String id; + @Schema(description = "父主键") + private String parentId; + @Schema(description = "名称") + private String fullName; + @Schema(description = "编码") + private String enCode; + @Schema(description = "状态") + private Integer enabledMark; + @Schema(description = "备注") + private String description; + @Schema(description = "扩展属性") + private String propertyJson; + @Schema(description = "排序") + private Long sortCode; + + @Schema(description = "组织id树") + private List organizeIdTree; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeListVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeListVO.java new file mode 100644 index 0000000..cfe11f1 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeListVO.java @@ -0,0 +1,53 @@ +package jnpf.permission.model.organize; + +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:15 + */ +@Data +public class OrganizeListVO { + @Schema(description = "主键") + private String id; + @Schema(description = "父主键") + private String parentId; + @Schema(description = "名称") + private String fullName; + @Schema(description = "编码") + private String enCode; + @Schema(description = "备注") + private String description; + @Schema(description = "状态") + private Integer enabledMark; + private Long creatorTime; + @Schema(description = "是否有下级菜单") + private Boolean hasChildren; + @Schema(description = "下级菜单列表") + private List children; + @Schema(description = "排序") + private Long sortCode; + private String organizeIdTree; + @Schema(description = "") + private Boolean isLeaf; + @JSONField(name="category") + private String type; + + @Schema(description = "图标") + private String icon; + + @Schema(description = "修改用户") + private String lastFullName; + + private String organize; + + @Schema(description ="组织id树") + private List organizeIds; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeModel.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeModel.java new file mode 100644 index 0000000..f654031 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeModel.java @@ -0,0 +1,30 @@ +package jnpf.permission.model.organize; + +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.util.treeutil.SumTree; +import lombok.Data; + +import java.util.List; + + +@Data +public class OrganizeModel extends SumTree { + private String fullName; + private String enCode; + private Long creatorTime; + private String manager; + private String description; + private int enabledMark; + private String icon; + @JSONField(name="category") + private String type; + private long sortCode; + private String organizeIdTree; + private String organize; + + @Schema(description = "组织id树") + private List organizeIds; + + private String lastFullName; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeSelectorByAuthVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeSelectorByAuthVO.java new file mode 100644 index 0000000..e14719a --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeSelectorByAuthVO.java @@ -0,0 +1,43 @@ +package jnpf.permission.model.organize; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 组织树模型 + * + * @author :JNPF开发平台组 + * @version: V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date :2022/6/28 9:10 + */ +@Data +public class OrganizeSelectorByAuthVO implements Serializable { + + @Schema(description = "是否可选") + private Boolean disabled = false; + @Schema(description = "主键") + private String id; + @Schema(description = "父主键") + private String parentId; + @Schema(description = "名称") + private String fullName; + @Schema(description = "图标") + private String icon; + @Schema(description = "是否可用") + private Integer enabledMark; + @Schema(description = "是否有下级菜单") + private Boolean hasChildren; + @Schema(description = "下级菜单列表") + private List children; + private String organizeIdTree; + + private String organize; + + @Schema(description = "组织id树") + private List organizeIds; + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeSelectorVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeSelectorVO.java new file mode 100644 index 0000000..d4ee66d --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeSelectorVO.java @@ -0,0 +1,41 @@ +package jnpf.permission.model.organize; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class OrganizeSelectorVO { + @Schema(description = "主键") + private String id; + @Schema(description = "父主键") + private String parentId; + @Schema(description = "名称") + private String fullName; + @Schema(description = "图标") + private String icon; + @Schema(description = "是否可用") + private Integer enabledMark; + @Schema(description = "是否有下级菜单") + private Boolean hasChildren; + @Schema(description = "下级菜单列表") + private List children; + + @Schema(description = "组织id树名称") + private String organizeIdTree; + + @Schema(description = "组织id") + private String organize; + + @Schema(description = "组织id树") + private List organizeIds; + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeTreeVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeTreeVO.java new file mode 100644 index 0000000..27c5b6b --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeTreeVO.java @@ -0,0 +1,29 @@ +package jnpf.permission.model.organize; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class OrganizeTreeVO { + @Schema(description = "主键") + private String id; + @Schema(description = "父主键") + private String parentId; + @Schema(description = "名称") + private String fullName; + @Schema(description = "图标") + private String icon; + @Schema(description = "是否有下级菜单") + private Boolean hasChildren; + @Schema(description = "下级菜单列表") + private List children; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeUpForm.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeUpForm.java new file mode 100644 index 0000000..5d560df --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organize/OrganizeUpForm.java @@ -0,0 +1,14 @@ +package jnpf.permission.model.organize; + +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class OrganizeUpForm extends OrganizeCrForm { +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organizeadministrator/ModuleSelectorModel.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organizeadministrator/ModuleSelectorModel.java new file mode 100644 index 0000000..4742eec --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organizeadministrator/ModuleSelectorModel.java @@ -0,0 +1,40 @@ +package jnpf.permission.model.organizeadministrator; + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.util.treeutil.SumTree; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class ModuleSelectorModel extends SumTree implements Serializable { + private String id; + private String fullName; + private String enCode; + private String parentId; + private String icon; + private Integer type; + private Long sortCode; + private String category; + private String propertyJson; + + private String systemId; + private Boolean hasModule; + + @Schema(description = "是否有权限") + private Integer isPermission; + + private boolean disabled; + + private long creatorTime; + +// private String description; +// private Boolean isData; +// private Integer enabledMark; +// private String urlAddress; +// private String linkTarget; +// private Integer isButtonAuthorize; +// private Integer isColumnAuthorize; +// private Integer isDataAuthorize; +// private Integer isFormAuthorize; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organizeadministrator/ModuleSelectorVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organizeadministrator/ModuleSelectorVO.java new file mode 100644 index 0000000..20a17d3 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organizeadministrator/ModuleSelectorVO.java @@ -0,0 +1,34 @@ +package jnpf.permission.model.organizeadministrator; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class ModuleSelectorVO implements Serializable { + + private String id; + private String fullName; + private String enCode; + private String parentId; + private String icon; + private Integer type; + private Long sortCode; + private String category; + private String propertyJson; + + private String systemId; + private Boolean hasModule; + + @Schema(description ="是否有下级菜单") + private Boolean hasChildren; + @Schema(description ="下级菜单列表") + private List children; + + @Schema(description = "是否有权限") + private Integer isPermission; + + private boolean disabled; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organizeadministrator/OrganizeAdminIsTratorCrForm.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organizeadministrator/OrganizeAdminIsTratorCrForm.java new file mode 100644 index 0000000..60eacf8 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organizeadministrator/OrganizeAdminIsTratorCrForm.java @@ -0,0 +1,40 @@ +package jnpf.permission.model.organizeadministrator; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * 机构分级管理员 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +@Data +public class OrganizeAdminIsTratorCrForm implements Serializable { + + /** + * 用户主键 + **/ + @Schema(description = "用户主键") + @NotBlank(message = "管理员不能为空") + private String userId; + + /** + * 分级管理员模型集合 + */ + @Schema(description = "分级管理员模型集合") + private List orgAdminModel; + + + @Schema(description = "菜单集合") + private List moduleIds; + @Schema(description = "应用集合") + private List systemIds; + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organizeadministrator/OrganizeAdministratorCrModel.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organizeadministrator/OrganizeAdministratorCrModel.java new file mode 100644 index 0000000..24bba82 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organizeadministrator/OrganizeAdministratorCrModel.java @@ -0,0 +1,43 @@ +package jnpf.permission.model.organizeadministrator; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author :JNPF开发平台组 + * @version: V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date :2022/6/6 14:50 + */ +@Data +public class OrganizeAdministratorCrModel implements Serializable { + @Schema(description = "主键") + private String organizeId; + @Schema(description = "名称") + private String fullName; + @Schema(description = "图标") + private String icon; + @Schema(description = "") + private Boolean isLeaf; + @Schema(description = "是否有下级菜单") + private Boolean hasChildren; + private String parentId; + + private Integer thisLayerAdd = 0; + private Integer thisLayerEdit = 0; + private Integer thisLayerDelete = 0; + private Integer thisLayerSelect = 0; + private Integer subLayerAdd = 0; + private Integer subLayerEdit = 0; + private Integer subLayerDelete = 0; + private Integer subLayerSelect = 0; + private String organizeIdTree; + @JsonIgnore + private String category; + + private List children; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organizeadministrator/OrganizeAdministratorListVo.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organizeadministrator/OrganizeAdministratorListVo.java new file mode 100644 index 0000000..adf0d82 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organizeadministrator/OrganizeAdministratorListVo.java @@ -0,0 +1,33 @@ +package jnpf.permission.model.organizeadministrator; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * 组织关系表模型 + * + * @author :JNPF开发平台组 + * @version: V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date :2022/5/30 9:23 + */ +@Data +public class OrganizeAdministratorListVo implements Serializable { + @Schema(description = "主键") + private String id; + @Schema(description = "账号") + private String account; + @Schema(description = "真实姓名") + private String realName; + @Schema(description = "性别") + private String gender; + @Schema(description = "手机号") + private String mobilePhone; + @Schema(description = "组织id") + private String organizeId; + @Schema(description = "创建时间") + private Long creatorTime; + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organizeadministrator/OrganizeAdministratorModel.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organizeadministrator/OrganizeAdministratorModel.java new file mode 100644 index 0000000..35bddcb --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organizeadministrator/OrganizeAdministratorModel.java @@ -0,0 +1,27 @@ +package jnpf.permission.model.organizeadministrator; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.ArrayList; +import java.util.List; + +/** + * 组织管理模型 + * + * @author :JNPF开发平台组 + * @version: V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date :2022/5/30 17:42 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class OrganizeAdministratorModel { + + private List addList = new ArrayList<>(); + private List editList = new ArrayList<>(); + private List deleteList = new ArrayList<>(); + private List selectList = new ArrayList<>(); +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organizeadministrator/OrganizeAdministratorSelectedVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organizeadministrator/OrganizeAdministratorSelectedVO.java new file mode 100644 index 0000000..0cf5aa3 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organizeadministrator/OrganizeAdministratorSelectedVO.java @@ -0,0 +1,27 @@ +package jnpf.permission.model.organizeadministrator; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class OrganizeAdministratorSelectedVO implements Serializable { + + @Schema(description = "组织权限集合") + private List orgAdminList; + + @Schema(description = "应用权限集合") + private List systemPermissionList; + + @Schema(description = "菜单权限集合") + private List modulePermissionList; + + @Schema(description = "有菜单权限集合") + private List moduleIds; + + @Schema(description = "有应用权限集合") + private List systemIds; + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organizeadministrator/OrganizeAdministratorSelectorModel.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organizeadministrator/OrganizeAdministratorSelectorModel.java new file mode 100644 index 0000000..dd4383c --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organizeadministrator/OrganizeAdministratorSelectorModel.java @@ -0,0 +1,38 @@ +package jnpf.permission.model.organizeadministrator; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.util.treeutil.SumTree; +import lombok.Data; + +/** + * @author :JNPF开发平台组 + * @version: V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date :2022/6/6 10:16 + */ +@Data +@JsonInclude(JsonInclude.Include.NON_NULL) +public class OrganizeAdministratorSelectorModel extends SumTree { + @Schema(description = "组织主键") + private String organizeId; + @Schema(description = "名称") + private String fullName; + @Schema(description = "图标") + private String icon; + + private Integer thisLayerAdd; + private Integer thisLayerEdit; + private Integer thisLayerDelete; + private Integer thisLayerSelect; + private Integer subLayerAdd; + private Integer subLayerEdit; + private Integer subLayerDelete; + private Integer subLayerSelect; + private String organizeIdTree; + @Schema(description = "") + private Boolean isLeaf; + @JsonIgnore + private String category; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organizeadministrator/OrganizeAdministratorSelectorVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organizeadministrator/OrganizeAdministratorSelectorVO.java new file mode 100644 index 0000000..55bbbb0 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organizeadministrator/OrganizeAdministratorSelectorVO.java @@ -0,0 +1,46 @@ +package jnpf.permission.model.organizeadministrator; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +@JsonInclude(JsonInclude.Include.NON_NULL) +public class OrganizeAdministratorSelectorVO implements Serializable { + @Schema(description = "主键") + private String organizeId; + @Schema(description = "名称") + private String fullName; + @Schema(description = "图标") + private String icon; + @Schema(description = "") + private Boolean isLeaf; + @Schema(description = "是否有下级菜单") + private Boolean hasChildren; + private String parentId; + + private Integer thisLayerAdd; + private Integer thisLayerEdit; + private Integer thisLayerDelete; + private Integer thisLayerSelect; + private Integer subLayerAdd; + private Integer subLayerEdit; + private Integer subLayerDelete; + private Integer subLayerSelect; + private String organizeIdTree; + @JsonIgnore + private String category; + + private List children; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organizeadministrator/SystemSelectorVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organizeadministrator/SystemSelectorVO.java new file mode 100644 index 0000000..2b2b434 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/organizeadministrator/SystemSelectorVO.java @@ -0,0 +1,33 @@ +package jnpf.permission.model.organizeadministrator; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class SystemSelectorVO implements Serializable { + + @Schema(description = "主键") + private String id; + + @Schema(description = "名称") + private String fullName; + + @Schema(description = "编码") + private String enCode; + + @Schema(description = "图标") + private String icon; + + @Schema(description = "是否有权限") + private Integer isPermission; + + + private boolean disabled; + + private long sortCode; + + private long creatorTime; + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/permission/PermissionModel.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/permission/PermissionModel.java new file mode 100644 index 0000000..2c07deb --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/permission/PermissionModel.java @@ -0,0 +1,26 @@ +package jnpf.permission.model.permission; + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.util.treeutil.SumTree; +import lombok.Data; + + +/** + * 个人信息设置 我的组织/我的岗位/(我的角色:暂无) + * + * @author JNPF开发平台组 YanYu + * @version V3.2.0 + * @copyright 引迈信息技术有限公司 + * @date 2022/1/25 + */ +@Data +public class PermissionModel extends SumTree { + + @Schema(description = "名称") + private String fullName; + @Schema(description = "id") + private String id; + @Schema(description = "是否为默认") + private Boolean isDefault; + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/permission/PermissionVoBase.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/permission/PermissionVoBase.java new file mode 100644 index 0000000..d0e8404 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/permission/PermissionVoBase.java @@ -0,0 +1,21 @@ +package jnpf.permission.model.permission; + +import lombok.Data; + +/** + * 可设置主要归属 + * + * @author JNPF开发平台组 + * @version V3.3.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class PermissionVoBase { + + public Boolean majorMark; + + + + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/permissiongroup/PermissionGroupListVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/permissiongroup/PermissionGroupListVO.java new file mode 100644 index 0000000..53aabe4 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/permissiongroup/PermissionGroupListVO.java @@ -0,0 +1,24 @@ +package jnpf.permission.model.permissiongroup; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class PermissionGroupListVO implements Serializable { + @Schema(description = "主键") + private String id; + @Schema(description = "名称") + private String fullName; + @Schema(description = "编码") + private String enCode; + @Schema(description = "排序") + private Long sortCode; + @Schema(description = "状态") + private Integer enabledMark; + @Schema(description = "权限成员") + private String permissionMember; + @Schema(description = "创建时间") + private Long creatorTime; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/permissiongroup/PermissionGroupModel.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/permissiongroup/PermissionGroupModel.java new file mode 100644 index 0000000..84966f4 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/permissiongroup/PermissionGroupModel.java @@ -0,0 +1,23 @@ +package jnpf.permission.model.permissiongroup; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +@Data +@Schema(description = "模型") +public class PermissionGroupModel implements Serializable { + @Schema(description = "名称") + private String fullName; + @Schema(description = "编码") + private String enCode; + @Schema(description = "排序") + private Long sortCode; + @Schema(description = "状态") + private Integer enabledMark; + @Schema(description = "说明") + private String description; + @Schema(description = "主键") + private String id; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/portalManage/AuthorizePortalManagePrimary.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/portalManage/AuthorizePortalManagePrimary.java new file mode 100644 index 0000000..feebedc --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/portalManage/AuthorizePortalManagePrimary.java @@ -0,0 +1,45 @@ +package jnpf.permission.model.portalManage; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.base.MyBatisPrimaryBase; +import jnpf.permission.entity.AuthorizeEntity; +import lombok.Data; + +/** + * 类功能 + * + * @author JNPF开发平台组 YanYu + * @version v3.4.8 + * @copyrignt 引迈信息技术有限公司 + * @date 2023-04-20 + */ +@Data +public class AuthorizePortalManagePrimary extends MyBatisPrimaryBase { + + @Schema(description = "权限类型") + private final String objectType = "role"; + + @Schema(description = "条目类型") + private final String itemType = "portalManage"; + + @Schema(description = "角色Id") + private String roleId; + + @Schema(description = "门户管理Id") + private String portalManageId; + + public AuthorizePortalManagePrimary(String roleId, String portalManageId){ + this.roleId = roleId; + this.portalManageId = portalManageId; + } + + public QueryWrapper getQuery(){ + queryWrapper.lambda().eq(AuthorizeEntity::getObjectType, objectType); + queryWrapper.lambda().eq(AuthorizeEntity::getItemType, itemType); + if(this.roleId != null) queryWrapper.lambda().eq(AuthorizeEntity::getObjectId, roleId); + if(this.portalManageId != null) queryWrapper.lambda().eq(AuthorizeEntity::getItemId, portalManageId); + return queryWrapper; + } + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PaginationPosition.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PaginationPosition.java new file mode 100644 index 0000000..eea62b4 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PaginationPosition.java @@ -0,0 +1,18 @@ +package jnpf.permission.model.position; + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.base.Pagination; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class PaginationPosition extends Pagination { + @Schema(description = "组织id") + private String organizeId; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PosOrgConditionModel.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PosOrgConditionModel.java new file mode 100644 index 0000000..247a517 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PosOrgConditionModel.java @@ -0,0 +1,21 @@ +package jnpf.permission.model.position; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class PosOrgConditionModel extends PosOrgModel { + + private String organizeIdTree; + + private String organizeId; + + @Schema(description ="前端解析唯一标识") + private String onlyId; + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PosOrgModel.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PosOrgModel.java new file mode 100644 index 0000000..91ab055 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PosOrgModel.java @@ -0,0 +1,37 @@ +package jnpf.permission.model.position; + +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.util.treeutil.SumTree; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class PosOrgModel extends SumTree { + + @Schema(description = "名称") + private String fullName; + @Schema(description = "状态") + private Integer enabledMark; + @JSONField(name = "category") + private String type; + @Schema(description = "图标") + private String icon; + @Schema(description = "排序") + private String sortCode; + @Schema(description = "创建时间") + private Date creatorTime; + + + private String organize; + @Schema(description = "组织id树") + private List organizeIds; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PositionConditionSelectorVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PositionConditionSelectorVO.java new file mode 100644 index 0000000..25ce7b0 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PositionConditionSelectorVO.java @@ -0,0 +1,25 @@ +package jnpf.permission.model.position; + +import com.alibaba.fastjson.annotation.JSONField; +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class PositionConditionSelectorVO extends PositionSelectorVO implements Serializable { + + @Schema(description = "组织id树") + @JsonIgnore + private String organizeIdTree; + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PositionCrForm.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PositionCrForm.java new file mode 100644 index 0000000..fea90a3 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PositionCrForm.java @@ -0,0 +1,37 @@ +package jnpf.permission.model.position; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import javax.validation.constraints.NotBlank; + +import javax.validation.constraints.NotNull; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class PositionCrForm { + @NotBlank(message = "必填") + @Schema(description = "岗位编码") + private String enCode; + @NotBlank(message = "必填") + @Schema(description = "所属部门(id)") + private String organizeId; + @NotNull(message = "必填") + @Schema(description = "岗位状态") + private Integer enabledMark; + @NotBlank(message = "必填") + @Schema(description = "岗位名称") + private String fullName; + + private String description; + @NotNull(message = "必填") + @Schema(description = "岗位类型(id)") + private Integer type; + @Schema(description = "排序") + private Long sortCode; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PositionInfoVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PositionInfoVO.java new file mode 100644 index 0000000..9796afc --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PositionInfoVO.java @@ -0,0 +1,39 @@ +package jnpf.permission.model.position; + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.permission.model.permission.PermissionVoBase; +import lombok.Data; + +import java.util.LinkedList; +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class PositionInfoVO extends PermissionVoBase { + @Schema(description = "id") + private String id; + @Schema(description = "上级id") + private String organizeId; + @Schema(description = "岗位名称") + private String fullName; + @Schema(description = "岗位编码") + private String enCode; + @Schema(description = "岗位类型") + private String type; + @Schema(description = "岗位状态") + private Integer enabledMark; + @Schema(description = "岗位说明") + private String description; + @Schema(description = "排序") + private Long sortCode; + + @Schema(description = "组织id树") + private List organizeIdTree; + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PositionListAllVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PositionListAllVO.java new file mode 100644 index 0000000..1203ff0 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PositionListAllVO.java @@ -0,0 +1,20 @@ +package jnpf.permission.model.position; + +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class PositionListAllVO { + private String id; + private String enCode; + private String fullName; + private String organizeId; + private String type; + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PositionListVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PositionListVO.java new file mode 100644 index 0000000..a3c5f25 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PositionListVO.java @@ -0,0 +1,36 @@ +package jnpf.permission.model.position; + +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class PositionListVO { + @Schema(description = "主键") + private String id; + @Schema(description = "名称") + private String fullName; + @Schema(description = "编码") + private String enCode; + @Schema(description = "分类") + private String type; + @Schema(description = "创建时间") + private Long creatorTime; + @Schema(description = "说明") + private String description; + @Schema(description = "部门") + private String department; + @Schema(description = "有效标志") + private Integer enabledMark; + @Schema(description = "排序") + private Long sortCode; + @Schema(description = "组织id") + private String organizeId; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PositionSelectorVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PositionSelectorVO.java new file mode 100644 index 0000000..c89bfe7 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PositionSelectorVO.java @@ -0,0 +1,40 @@ +package jnpf.permission.model.position; + +import com.alibaba.fastjson.annotation.JSONField; +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class PositionSelectorVO { + private String id; + @Schema(description ="父级ID") + private String parentId; + @Schema(description ="名称") + private String fullName; + @Schema(description ="是否有下级菜单") + private boolean hasChildren = true; + @Schema(description ="状态") + private Integer enabledMark; + @Schema(description ="下级菜单列表") + private List children = new ArrayList<>(); + @JSONField(name="category") + private String type; + @Schema(description ="图标") + private String icon; + + + private String organize; + @Schema(description ="组织id树") + private List organizeIds; + + @Schema(description = "组织id树") + @JsonIgnore + private String organizeIdTree; + + @Schema(description ="前端解析唯一标识") + private String onlyId; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PositionUpForm.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PositionUpForm.java new file mode 100644 index 0000000..e63634f --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PositionUpForm.java @@ -0,0 +1,14 @@ +package jnpf.permission.model.position; + +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class PositionUpForm extends PositionCrForm{ +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PositionVo.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PositionVo.java new file mode 100644 index 0000000..782c6fa --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/position/PositionVo.java @@ -0,0 +1,22 @@ +package jnpf.permission.model.position; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * 通过组织id获取岗位列表 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-12-21 + */ +@Data +public class PositionVo implements Serializable { + private String id; + + @Schema(description = "名称") + private String fullName; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/role/RoleCrForm.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/role/RoleCrForm.java new file mode 100644 index 0000000..d605196 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/role/RoleCrForm.java @@ -0,0 +1,37 @@ +package jnpf.permission.model.role; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import javax.validation.constraints.NotBlank; + +import javax.validation.constraints.NotNull; +import java.util.List; +import java.util.Map; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class RoleCrForm { + @NotBlank(message = "必填") + @Schema(description = "角色名称") + private String fullName; + @NotBlank(message = "必填") + @Schema(description = "角色编号") + private String enCode; + @NotNull(message = "必填") + @Schema(description = "组织id集合") + private List> organizeIdsTree; + @Schema(description = "是否全局(1:是,0:否)") + private Integer globalMark; + @NotNull(message = "必填") + @Schema(description = "状态") + private int enabledMark; + private String description; + @Schema(description = "排序") + private long sortCode; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/role/RoleInfoVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/role/RoleInfoVO.java new file mode 100644 index 0000000..df83873 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/role/RoleInfoVO.java @@ -0,0 +1,40 @@ +package jnpf.permission.model.role; + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.permission.model.permission.PermissionVoBase; +import lombok.Data; + +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class RoleInfoVO extends PermissionVoBase { + @Schema(description = "主键") + private String id; + @Schema(description = "名称") + private String fullName; + @Schema(description = "编码") + private String enCode; + @Schema(description = "组织id数组树") + private List> organizeIdsTree; + @Schema(description = "全局标识") + private Integer globalMark; + @Schema(description = "类型") + private String type; + @Schema(description = "状态") + private Integer enabledMark; + @Schema(description = "备注") + private String description; + @Schema(description = "排序") + private Long sortCode; + + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/role/RoleListVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/role/RoleListVO.java new file mode 100644 index 0000000..e0aa0ba --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/role/RoleListVO.java @@ -0,0 +1,34 @@ +package jnpf.permission.model.role; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class RoleListVO { + @Schema(description = "主键") + private String id; + @Schema(description = "名称") + private String fullName; + @Schema(description = "编码") + private String enCode; + @Schema(description = "角色类型") + private String type; + @Schema(description = "所属组织") + private String organizeInfo; + @Schema(description = "备注") + private String description; + @Schema(description = "状态") + private Integer enabledMark; + private Long creatorTime; + @Schema(description = "排序") + private Long sortCode; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/role/RoleModel.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/role/RoleModel.java new file mode 100644 index 0000000..e7432d3 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/role/RoleModel.java @@ -0,0 +1,45 @@ +package jnpf.permission.model.role; + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.util.treeutil.SumTree; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class RoleModel extends SumTree { + + @Schema(description = "名称") + private String fullName; + @Schema(description = "编码") + private String enCode; + @Schema(description = "角色类型") + private String type; + @Schema(description = "备注") + private String description; + @Schema(description = "状态") + private Integer enabledMark; + @Schema(description = "创建时间") + private Date creatorTime; + @Schema(description = "排序") + private Long sortCode; + @Schema(description = "数量") + private Long num; + @Schema(description = "前端解析唯一标识") + private String onlyId; + @Schema(description = "图标") + private String icon; + + + private String organize; + @Schema(description = "组织id树") + private List organizeIds; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/role/RolePagination.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/role/RolePagination.java new file mode 100644 index 0000000..3689eb5 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/role/RolePagination.java @@ -0,0 +1,9 @@ +package jnpf.permission.model.role; + +import jnpf.base.Pagination; +import lombok.Data; + +@Data +public class RolePagination extends Pagination { + private String organizeId; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/role/RoleSelectorVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/role/RoleSelectorVO.java new file mode 100644 index 0000000..e7b5b89 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/role/RoleSelectorVO.java @@ -0,0 +1,43 @@ +package jnpf.permission.model.role; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class RoleSelectorVO { + + @Schema(description = "ID") + private String id; + @Schema(description = "名称") + private String fullName; + @Schema(description = "类型") + private String type; + @Schema(description = "数量") + private Long num; + @Schema(description = "前端解析唯一标识") + private String onlyId; + @Schema(description = "父节点ID") + private String parentId; + @Schema(description = "子类对象集合") + private List children; + @Schema(description = "是否含有子类对象集合") + private Boolean hasChildren; + @Schema(description = "") + private Boolean isLeaf; + @Schema(description = "图标") + private String icon; + + + private String organize; + @Schema(description = "组织id树") + private List organizeIds; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/role/RoleUpForm.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/role/RoleUpForm.java new file mode 100644 index 0000000..a079dd2 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/role/RoleUpForm.java @@ -0,0 +1,15 @@ +package jnpf.permission.model.role; + +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class RoleUpForm extends RoleCrForm { + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/socails/SocialsUserInfo.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/socails/SocialsUserInfo.java new file mode 100644 index 0000000..1ca25fa --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/socails/SocialsUserInfo.java @@ -0,0 +1,21 @@ +package jnpf.permission.model.socails; + +import com.alibaba.fastjson.JSONArray; +import jnpf.base.UserInfo; +import lombok.Data; + +/** + * 流程设计 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/9/8 11:33:59 + */ +@Data +public class SocialsUserInfo { + UserInfo userInfo; + JSONArray tenantUserInfo; + String socialUnionid; + String socialName; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/socails/SocialsUserModel.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/socails/SocialsUserModel.java new file mode 100644 index 0000000..ec8050b --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/socails/SocialsUserModel.java @@ -0,0 +1,48 @@ +package jnpf.permission.model.socails; + +import lombok.Data; + +import java.util.Date; + +/** + * 流程设计 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/7/14 11:02:42 + */ +@Data +public class SocialsUserModel { + /** + * 主键 + */ + private String id; + /** + * 系统用户id + */ + private String userId; + /** + * 第三方类型 + */ + private String socialType; + + /** + * 第三方uuid + */ + private String socialId; + /** + * 第三方账号 + */ + private String socialName; + + /** + * 创建时间 + */ + private Date creatorTime; + + /** + * 描述 + */ + private String description; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/socails/SocialsUserVo.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/socails/SocialsUserVo.java new file mode 100644 index 0000000..66033d8 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/socails/SocialsUserVo.java @@ -0,0 +1,42 @@ +package jnpf.permission.model.socails; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 第三方信息 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/7/14 11:00:30 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@Schema(description = "第三方信息") +public class SocialsUserVo { + @Schema(description = "类型") + private String enname; + @Schema(description = "名称") + private String name; + @Schema(description = "描述") + private String describetion; + @Schema(description = "版本") + private String since; + @Schema(description = "logo") + private String logo; + @Schema(description = "官网api文档") + private String apiDoc; + @Schema(description = "是否首页展示") + private boolean isLatest; + @Schema(description = "图标") + private String icon; + @Schema(description = "绑定对象") + private SocialsUserModel entity; + @Schema(description = "获取登录地址") + private String renderUrl; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/UserIdListVo.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/UserIdListVo.java new file mode 100644 index 0000000..66c5776 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/UserIdListVo.java @@ -0,0 +1,51 @@ +package jnpf.permission.model.user; +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.permission.model.user.vo.UserBaseVO; +import lombok.Data; + +import java.util.List; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-05-29 + */ +@Data +public class UserIdListVo extends UserBaseVO { + + /** + * 前端协议字段,以后将改回realName + */ + @Schema(description = "名称") + private String fullName; + + @Schema(description = "头像") + private String headIcon; + + @Schema(description = "性别") + private Integer gender; + + @Schema(description = "手机号") + private String mobilePhone; + + @Schema(description = "组织") + private String organize; + + @Schema(description = "图标") + private String icon; + + @Schema(description = "类型") + private String type; + + + @Schema(description ="组织id树") + private List organizeIds; + + @JsonIgnore + @Schema(description = "类型") + private Integer enabledMark; + + private Integer isAdministrator; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/UserLogForm.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/UserLogForm.java new file mode 100644 index 0000000..4725e7b --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/UserLogForm.java @@ -0,0 +1,17 @@ +package jnpf.permission.model.user; + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.base.Pagination; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class UserLogForm extends Pagination implements Serializable { + @Schema(description = "开始时间") + private String startTime; + @Schema(description = "结束时间") + private String endTime; + @Schema(description = "分类") + private int category; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/WorkHandoverModel.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/WorkHandoverModel.java new file mode 100644 index 0000000..74e296b --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/WorkHandoverModel.java @@ -0,0 +1,21 @@ +package jnpf.permission.model.user; + +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +@Data +public class WorkHandoverModel implements Serializable { + @NotNull(message = "工作移交人不能为空") + private String fromId; + @NotNull(message = "工作交接人不能为空") + private String toId; + private List waitList = new ArrayList<>(); + private List chargeList = new ArrayList<>(); + private List flowList = new ArrayList<>(); + private List circulateList = new ArrayList<>(); + private List permissionList = new ArrayList<>(); +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserAppDataForm.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserAppDataForm.java new file mode 100644 index 0000000..9f619b2 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserAppDataForm.java @@ -0,0 +1,15 @@ +package jnpf.permission.model.user.form; + +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/5/14 8:47 + */ +@Data +public class UserAppDataForm { + private String data; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserCrForm.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserCrForm.java new file mode 100644 index 0000000..71d0599 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserCrForm.java @@ -0,0 +1,99 @@ +package jnpf.permission.model.user.form; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +import javax.validation.constraints.NotNull; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class UserCrForm { + + @NotBlank(message = "必填") + @Schema(description = "账户") + private String account; + + @NotBlank(message = "必填") + @Schema(description = "户名") + private String realName; + + @NotBlank(message = "必填") + @Schema(description = "部门") + private String organizeId; + + @Schema(description = "主管") + private String managerId; + + @Schema(description = "岗位") + private String positionId; + + @Schema(description = "角色") + private String roleId; + + private String description; + + @NotNull(message = "性别不能为空") + @Schema(description = "性别") + private int gender; + + @Schema(description = "民族") + private String nation; + + @Schema(description = "籍贯") + private String nativePlace; + + @Schema(description = "证件类型") + private String certificatesType; + + @Schema(description = "证件号码") + private String certificatesNumber; + + @Schema(description = "文化程度") + private String education; + + @Schema(description = "生日") + private String birthday; + + @Schema(description = "电话") + private String telePhone; + + @Schema(description = "Landline") + private String landline; + + @Schema(description = "手机") + private String mobilePhone; + + @Schema(description = "邮箱") + private String email; + + @Schema(description = "UrgentContacts") + private String urgentContacts; + + @Schema(description = "紧急电话") + private String urgentTelePhone; + + @Schema(description = "通讯地址") + private String postalAddress; + + @Schema(description = "头像") + private String headIcon; + + @Schema(description = "排序") + private Long sortCode; + + @Schema(description = "入职日期") + private long entryDate; + + @Schema(description = "状态") + private Integer enabledMark; + + @Schema(description = "分组id") + private String groupId; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserInfoForm.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserInfoForm.java new file mode 100644 index 0000000..7819f0c --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserInfoForm.java @@ -0,0 +1,31 @@ +package jnpf.permission.model.user.form; + +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class UserInfoForm { + private String signature; + private int gender; + private String nation; + private String nativePlace; + private String entryDate; + private String certificatesType; + private String certificatesNumber; + private String education; + private Long birthday; + private String telePhone; + private String landline; + private String mobilePhone; + private String email; + private String urgentContacts; + private String urgentTelePhone; + private String postalAddress; + private String realName; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserLanguageForm.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserLanguageForm.java new file mode 100644 index 0000000..b2f967a --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserLanguageForm.java @@ -0,0 +1,19 @@ +package jnpf.permission.model.user.form; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import javax.validation.constraints.NotBlank; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class UserLanguageForm { + @NotBlank(message = "必填") + @Schema(description = "语言代码") + private String language; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserModifyPasswordForm.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserModifyPasswordForm.java new file mode 100644 index 0000000..a333e39 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserModifyPasswordForm.java @@ -0,0 +1,28 @@ +package jnpf.permission.model.user.form; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import javax.validation.constraints.NotBlank; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class UserModifyPasswordForm { + @NotBlank(message = "必填") + @Schema(description = "旧密码,需要 MD5 加密后传输") + private String oldPassword; + @NotBlank(message = "必填") + @Schema(description = "新密码") + private String password; + @NotBlank(message = "必填") + @Schema(description = "验证码") + private String code; + @NotBlank(message = "必填") + @Schema(description = "验证码标识") + private String timestamp; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserPasswordForm.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserPasswordForm.java new file mode 100644 index 0000000..39fda99 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserPasswordForm.java @@ -0,0 +1,17 @@ +package jnpf.permission.model.user.form; + +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class UserPasswordForm { + private String oldPassword; + private String password; + private String code; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserResetPasswordForm.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserResetPasswordForm.java new file mode 100644 index 0000000..d6d5dcc --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserResetPasswordForm.java @@ -0,0 +1,25 @@ +package jnpf.permission.model.user.form; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import javax.validation.constraints.NotBlank; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class UserResetPasswordForm { + @NotBlank(message = "必填") + @Schema(description = "用户id") + private String id; + @NotBlank(message = "必填") + @Schema(description = "新密码,需要 MD5 加密后传输") + private String userPassword; + @NotBlank(message = "必填") + @Schema(description = "重复新密码") + private String validatePassword; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserSettingForm.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserSettingForm.java new file mode 100644 index 0000000..6abcd70 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserSettingForm.java @@ -0,0 +1,26 @@ +package jnpf.permission.model.user.form; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.apache.ibatis.annotations.Param; + +/** + * 类功能 + * + * @author JNPF开发平台组 YanYu + * @version V3.2.0 + * @copyright 引迈信息技术有限公司 + * @date 2022/1/28 + */ +@Data +public class UserSettingForm { + + @Schema(description = "主要类型") + private String majorType; + @Schema(description = "主要Id") + private String majorId; + + @Schema(description = "菜单类型") + private Integer menuType; + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserThemeForm.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserThemeForm.java new file mode 100644 index 0000000..166a2d4 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserThemeForm.java @@ -0,0 +1,19 @@ +package jnpf.permission.model.user.form; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import javax.validation.constraints.NotBlank; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class UserThemeForm { + @NotBlank(message = "必填") + @Schema(description = "系统主题") + private String theme; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserUpAdminForm.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserUpAdminForm.java new file mode 100644 index 0000000..e0ede56 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserUpAdminForm.java @@ -0,0 +1,22 @@ +package jnpf.permission.model.user.form; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * 超级管理员设置表单参数 + * + * @author JNPF开发平台组 YanYu + * @version V3.3.0 + * @copyright 引迈信息技术有限公司 + * @date 2022/2/23 + */ +@Data +public class UserUpAdminForm { + + @Schema(description = "超级管理id集合") + List adminIds; + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserUpForm.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserUpForm.java new file mode 100644 index 0000000..0125f08 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/form/UserUpForm.java @@ -0,0 +1,15 @@ +package jnpf.permission.model.user.form; + +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class UserUpForm extends UserCrForm { + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/mod/UserAllModel.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/mod/UserAllModel.java new file mode 100644 index 0000000..836c420 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/mod/UserAllModel.java @@ -0,0 +1,33 @@ +package jnpf.permission.model.user.mod; + +import jnpf.util.treeutil.SumTree; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class UserAllModel extends SumTree { + private String id; + private String account; + private String gender; + private String realName; + private String headIcon; + private String department; + private String departmentId; + private String organizeId; + private String organize; + private String roleId; + private String roleName; + private String positionId; + private String positionName; + private String managerId; + private String managerName; + private String quickQuery; + private String portalId; + private Integer isAdministrator; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/mod/UserAuthorizeModel.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/mod/UserAuthorizeModel.java new file mode 100644 index 0000000..68381a0 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/mod/UserAuthorizeModel.java @@ -0,0 +1,25 @@ +package jnpf.permission.model.user.mod; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class UserAuthorizeModel { + @Schema(description = "主键") + private String id; + @Schema(description = "名称") + private String fullName; + @Schema(description = "图标") + private String icon; + @Schema(description = "下级菜单列表") + private List children; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/mod/UserByRoleModel.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/mod/UserByRoleModel.java new file mode 100644 index 0000000..88da641 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/mod/UserByRoleModel.java @@ -0,0 +1,34 @@ +package jnpf.permission.model.user.mod; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author :JNPF开发平台组 + * @version: V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date :2022/4/14 15:45 + */ +@Data +public class UserByRoleModel implements Serializable { + /** + * 关键字 + */ + @Schema(description = "关键字") + private String keyword; + + /** + * 组织id + */ + @Schema(description = "组织id") + private String organizeId; + + /** + * 角色id + */ + @Schema(description = "角色id") + private String roleId; + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/mod/UserConditionModel.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/mod/UserConditionModel.java new file mode 100644 index 0000000..077dd9a --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/mod/UserConditionModel.java @@ -0,0 +1,58 @@ +package jnpf.permission.model.user.mod; + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.base.Pagination; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author :JNPF开发平台组 + * @version: V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date :2022/6/6 17:33 + */ +@Data +public class UserConditionModel implements Serializable { + + /** + * 部门id + */ + @Schema(description = "部门id") + private List departIds; + + /** + * 岗位id + */ + @Schema(description = "岗位id") + private List positionIds; + + /** + * 用户id + */ + @Schema(description = "用户id") + private List userIds; + + /** + * 角色Id + */ + @Schema(description = "角色Id") + private List roleIds; + + /** + * 分组Id + */ + @Schema(description = "分组Id") + private List groupIds; + + /** + * 类型 + */ + @Schema(description = "类型") + private String type; + + @Schema(description = "分页参数") + private Pagination pagination; + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/mod/UserIdModel.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/mod/UserIdModel.java new file mode 100644 index 0000000..cc6dbfc --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/mod/UserIdModel.java @@ -0,0 +1,40 @@ +package jnpf.permission.model.user.mod; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-05-29 + */ +@Data +public class UserIdModel { + /** + * 用户id集合 + */ + @Schema(description = "用户id集合") + private Object ids; + + public List getIds() { + List ids = new ArrayList<>(16); + if (this.ids != null) { + if (this.ids instanceof List) { + List list = (List) this.ids; + Object object = list.size() > 0 ? list.get(0) : null; + if (Objects.nonNull(object) && object instanceof String) { + ids.addAll(list); + } + } else { + String userIds = (String) this.ids; + ids.add(userIds); + } + } + return ids; + } +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/mod/UserIdModelByPage.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/mod/UserIdModelByPage.java new file mode 100644 index 0000000..eda7c0b --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/mod/UserIdModelByPage.java @@ -0,0 +1,16 @@ +package jnpf.permission.model.user.mod; +import jnpf.base.Pagination; +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.permission.model.user.mod.UserIdModel; +import lombok.Data; + +@Data +public class UserIdModelByPage extends UserIdModel { + + @Schema(description = "分页参数") + private Pagination pagination; + + @Schema(description = "类型") + private String type; + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/mod/UserImportModel.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/mod/UserImportModel.java new file mode 100644 index 0000000..9a8265b --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/mod/UserImportModel.java @@ -0,0 +1,65 @@ +package jnpf.permission.model.user.mod; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 导入模型 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-12-20 + */ +@Data +public class UserImportModel implements Serializable { + private String account; + + private String realName; + + private String organizeId; + + private String managerId; + + private String positionId; + + private String roleId; + + private String description; + + private Integer gender; + + private String nation; + + private String nativePlace; + + private String certificatesType; + + private String certificatesNumber; + + private String education; + + private Date birthday; + + private String telePhone; + + private String landline; + + private String mobilePhone; + + private String email; + + private String urgentContacts; + + private String urgentTelePhone; + + private String postalAddress; + + private Long sortCode; + + private Date entryDate; + + private Integer enabledMark; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/mod/UserSelectorModel.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/mod/UserSelectorModel.java new file mode 100644 index 0000000..fb17891 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/mod/UserSelectorModel.java @@ -0,0 +1,24 @@ +package jnpf.permission.model.user.mod; + +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.util.treeutil.SumTree; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class UserSelectorModel extends SumTree { + @JSONField(name="category") + private String type; + private String fullName; + @Schema(description = "状态") + private Integer enabledMark; + @Schema(description = "图标") + private String icon; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/mod/UserUpModel.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/mod/UserUpModel.java new file mode 100644 index 0000000..fe0992b --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/mod/UserUpModel.java @@ -0,0 +1,26 @@ +package jnpf.permission.model.user.mod; + +import jnpf.permission.entity.UserEntity; +import lombok.Data; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-11-23 + */ +@Data +public class UserUpModel { + + private Integer num; + + private UserEntity entity; + + public UserUpModel() { + } + + public UserUpModel(Integer num, UserEntity entity) { + this.num = num; + this.entity = entity; + } +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/mod/UsersByPositionModel.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/mod/UsersByPositionModel.java new file mode 100644 index 0000000..f3f81aa --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/mod/UsersByPositionModel.java @@ -0,0 +1,19 @@ +package jnpf.permission.model.user.mod; + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.base.Page; +import lombok.Data; + +/** + * 获取岗位成员 + * + * @author :JNPF开发平台组 + * @version: V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date :2022/4/28 14:44 + */ +@Data +public class UsersByPositionModel extends Page { + @Schema(description = "岗位id") + private String positionId; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/page/PageUser.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/page/PageUser.java new file mode 100644 index 0000000..ce49a83 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/page/PageUser.java @@ -0,0 +1,21 @@ +package jnpf.permission.model.user.page; + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.base.Page; +import lombok.Data; + +import java.io.Serializable; + +/** + * 通过组织id或关键字查询 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2022-01-13 + */ +@Data +public class PageUser extends Page implements Serializable { + @Schema(description = "组织id") + private String organizeId; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/page/PaginationUser.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/page/PaginationUser.java new file mode 100644 index 0000000..9247866 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/page/PaginationUser.java @@ -0,0 +1,23 @@ +package jnpf.permission.model.user.page; + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.base.Pagination; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class PaginationUser extends Pagination { + + @Schema(description = "组织id") + private String organizeId; + + @Schema(description = "角色id") + private String roleId; + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/ImUserListVo.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/ImUserListVo.java new file mode 100644 index 0000000..3eb4568 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/ImUserListVo.java @@ -0,0 +1,22 @@ +package jnpf.permission.model.user.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * IM获取用户接口 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-05-29 + */ +@Data +public class ImUserListVo extends UserBaseVO{ + + @Schema(description = "用户头像") + private String headIcon; + @Schema(description = "部门") + private String department; + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserAdminVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserAdminVO.java new file mode 100644 index 0000000..1d96a24 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserAdminVO.java @@ -0,0 +1,16 @@ +package jnpf.permission.model.user.vo; + +import lombok.Data; + +/** + * 超级管理员显示对象 + * + * @author JNPF开发平台组 YanYu + * @version V3.3.0 + * @copyright 引迈信息技术有限公司 + * @date 2022/2/23 + */ +@Data +public class UserAdminVO extends UserBaseVO{ + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserAllVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserAllVO.java new file mode 100644 index 0000000..b6bc766 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserAllVO.java @@ -0,0 +1,23 @@ +package jnpf.permission.model.user.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class UserAllVO extends UserBaseVO{ + + @Schema(description = "用户头像") + private String headIcon; + @Schema(description = "性别(1,男。2女)") + private String gender; + @Schema(description = "快速搜索") + private String quickQuery; + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserAuthorizeVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserAuthorizeVO.java new file mode 100644 index 0000000..d5d89e5 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserAuthorizeVO.java @@ -0,0 +1,24 @@ +package jnpf.permission.model.user.vo; + +import jnpf.permission.model.user.mod.UserAuthorizeModel; +import lombok.Builder; +import lombok.Data; + +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +@Builder +public class UserAuthorizeVO { + private List button; + private List column; + private List module; + private List resource; + private List form; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserBaseInfoVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserBaseInfoVO.java new file mode 100644 index 0000000..0a0ea11 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserBaseInfoVO.java @@ -0,0 +1,73 @@ +package jnpf.permission.model.user.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class UserBaseInfoVO { + @Schema(description = "主键") + private String id; + @Schema(description = "账户") + private String account; + @Schema(description = "户名") + private String realName; + @Schema(description = "部门") + private String organize; + @Schema(description = "公司名称") + private String company; + @Schema(description = "岗位") + private String position; + @Schema(description = "主管") + private String manager; + @Schema(description = "角色") + private String roleId; + @Schema(description = "注册时间") + private Long creatorTime; + @Schema(description = "上次登录时间") + private Long prevLogTime; + @Schema(description = "自我介绍") + private String signature; + @Schema(description = "性别") + private String gender; + @Schema(description = "民族") + private String nation; + @Schema(description = "籍贯") + private String nativePlace; + @Schema(description = "入职时间") + private Long entryDate; + @Schema(description = "证件类型") + private String certificatesType; + @Schema(description = "证件号码") + private String certificatesNumber; + @Schema(description = "学历") + private String education; + @Schema(description = "出生年月") + private Long birthday; + @Schema(description = "办公电话") + private String telePhone; + @Schema(description = "办公座机") + private String landline; + @Schema(description = "手机号码") + private String mobilePhone; + @Schema(description = "电子邮箱") + private String email; + @Schema(description = "紧急联系人") + private String urgentContacts; + @Schema(description = "紧急联系人电话") + private String urgentTelePhone; + @Schema(description = "通信地址") + private String postalAddress; + @Schema(description = "用户头像") + private String avatar; + @Schema(description = "主题") + private String theme; + @Schema(description = "语言") + private String language; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserBaseVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserBaseVO.java new file mode 100644 index 0000000..34bda84 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserBaseVO.java @@ -0,0 +1,24 @@ +package jnpf.permission.model.user.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 用户视图对象基类 + * + * @author JNPF开发平台组 YanYu + * @version V3.3.0 + * @copyright 引迈信息技术有限公司 + * @date 2022/2/23 + */ +@Data +public class UserBaseVO { + + @Schema(description = "主键") + private String id; + @Schema(description = "账号") + private String account; + @Schema(description = "名称") + private String realName; + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserByRoleVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserByRoleVO.java new file mode 100644 index 0000000..c07126b --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserByRoleVO.java @@ -0,0 +1,45 @@ +package jnpf.permission.model.user.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author :JNPF开发平台组 + * @version: V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date :2022/4/14 15:49 + */ +@Data +public class UserByRoleVO implements Serializable { + @Schema(description = "主键") + private String id; + @Schema(description = "有效标志") + private Integer enabledMark; + @Schema(description = "名称") + private String fullName; + @Schema(description = "类型") + private String type; + @Schema(description = "头像") + private String headIcon; + + @Schema(description = "是否含有子类对象集合") + private Boolean hasChildren; + @Schema(description = "是否含有子类对象集合反值") + private Boolean isLeaf; + @Schema(description = "图标") + private String icon; + @Schema(description = "父节点ID") + private String parentId; + @Schema(description = "数量") + private Long num; + @Schema(description = "组织") + private String organize; + @Schema(description = "性别") + private Integer gender; + + @Schema(description = "子类对象集合") + private List children; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserExportExceptionVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserExportExceptionVO.java new file mode 100644 index 0000000..ba87fb7 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserExportExceptionVO.java @@ -0,0 +1,61 @@ +package jnpf.permission.model.user.vo; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.io.Serializable; + +/** + * 错误报告时使用的 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-12-23 + */ +@Data +public class UserExportExceptionVO implements Serializable { + + private String account; + private String realName; + /** + * 组织 + */ + private String organizeId; + /** + * 主管 + */ + private String managerId; + /** + * 岗位 + */ + private String positionId; + /** + * 角色 + */ + private String roleId; + private String description; + /** + * 性别 + */ + private String gender; + private String nation; + private String nativePlace; + private String certificatesType; + private String certificatesNumber; + private String education; + private String birthday; + private String telePhone; + private String landline; + private String mobilePhone; + private String email; + private String urgentContacts; + private String urgentTelePhone; + private String postalAddress; + private Long sortCode; + private String enabledMark; + /** + * 入职时间 + */ + private String entryDate; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserExportVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserExportVO.java new file mode 100644 index 0000000..8aae33f --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserExportVO.java @@ -0,0 +1,85 @@ +package jnpf.permission.model.user.vo; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-12-18 + */ +@Data +public class UserExportVO implements Serializable { + @Excel(name = "账号", isImportField = "true") + private String account; + @Excel(name = "姓名", isImportField = "true") + private String realName; + /** + * 性别 + */ + @Excel(name = "性别", isImportField = "true") + private String gender; + @Excel(name = "电子邮箱", isImportField = "true") + private String email; + /** + * 组织 + */ + @Excel(name = "所属组织", isImportField = "true") + private String organizeId; + /** + * 主管 + */ + @Excel(name = "直属主管", isImportField = "true") + private String managerId; + /** + * 岗位 + */ + @Excel(name = "岗位", isImportField = "true") + private String positionId; + /** + * 角色 + */ + @Excel(name = "角色", isImportField = "true") + private String roleId; + @Excel(name = "排序", isImportField = "true") + private Long sortCode; + @Excel(name = "状态", isImportField = "true") + private String enabledMark; + @Excel(name = "说明", isImportField = "true") + private String description; + @Excel(name = "民族", isImportField = "true") + private String nation; + @Excel(name = "籍贯", isImportField = "true") + private String nativePlace; + /** + * 入职时间 + */ + @Excel(name = "入职时间", isImportField = "true") + private String entryDate; + @Excel(name = "证件类型", isImportField = "true") + private String certificatesType; + @Excel(name = "证件号码", isImportField = "true") + private String certificatesNumber; + @Excel(name = "文化程度", isImportField = "true") + private String education; + @Excel(name = "出生年月", isImportField = "true") + private String birthday; + @Excel(name = "办公电话", isImportField = "true") + private String telePhone; + @Excel(name = "办公座机", isImportField = "true") + private String landline; + @Excel(name = "手机号码", isImportField = "true") + private String mobilePhone; + @Excel(name = "紧急联系", isImportField = "true") + private String urgentContacts; + @Excel(name = "紧急电话", isImportField = "true") + private String urgentTelePhone; + @Excel(name = "通讯地址", isImportField = "true") + private String postalAddress; + + private List list; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserImportVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserImportVO.java new file mode 100644 index 0000000..c6797e9 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserImportVO.java @@ -0,0 +1,38 @@ +package jnpf.permission.model.user.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-12-18 + */ +@Data +public class UserImportVO implements Serializable { + /** + * 导入成功条数 + */ + @Schema(description = "导入成功条数") + private int snum; + /** + * 导入失败条数 + */ + @Schema(description = "导入失败条数") + private int fnum; + /** + * 导入结果状态(0,成功 1,失败) + */ + @Schema(description = "导入结果状态(0,成功 1,失败)") + private int resultType; + /** + * 失败结果 + */ + @Schema(description = "失败结果") + private List failResult; + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserInfoVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserInfoVO.java new file mode 100644 index 0000000..122e5dd --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserInfoVO.java @@ -0,0 +1,76 @@ +package jnpf.permission.model.user.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.LinkedList; +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class UserInfoVO { + + @Schema(description = "id") + private String id; + @Schema(description = "账户") + private String account; + @Schema(description = "户名") + private String realName; + @Schema(description = "部门id") + private String organizeId; + @Schema(description = "组织id树") + private List> organizeIdTree; + @Schema(description = "主管id") + private String managerId; + @Schema(description = "岗位id") + private String positionId; + @Schema(description = "角色id") + private String roleId; + @Schema(description = "备注") + private String description; + @Schema(description = "性别") + private String gender; + @Schema(description = "民族") + private String nation; + @Schema(description = "籍贯") + private String nativePlace; + @Schema(description = "入职时间") + private Long entryDate; + @Schema(description = "证件类型") + private String certificatesType; + @Schema(description = "证件号码") + private String certificatesNumber; + @Schema(description = "学历") + private String education; + @Schema(description = "出生年月") + private Long birthday; + @Schema(description = "办公电话") + private String telePhone; + @Schema(description = "办公座机") + private String landline; + @Schema(description = "手机号码") + private String mobilePhone; + @Schema(description = "电子邮箱") + private String email; + @Schema(description = "紧急联系人") + private String urgentContacts; + @Schema(description = "紧急联系人电话") + private String urgentTelePhone; + @Schema(description = "通信地址") + private String postalAddress; + @Schema(description = "用户头像") + private String headIcon; + @Schema(description = "状态") + private Integer enabledMark; + @Schema(description = "排序") + private Long sortCode; + @Schema(description = "分组id") + private String groupId; + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserListVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserListVO.java new file mode 100644 index 0000000..e25ff25 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserListVO.java @@ -0,0 +1,41 @@ +package jnpf.permission.model.user.vo; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class UserListVO { + @Schema(description ="主键") + private String id; + @Schema(description ="账号") + private String account; + @Schema(description ="姓名") + private String realName; + @Schema(description ="性别") + private String gender; + @Schema(description ="手机") + private String mobilePhone; + @Schema(description ="部门") + private String organize; + @Schema(description ="说明") + private String description; + @Schema(description ="状态") + private Integer enabledMark; + @Schema(description ="添加时间",example = "1") + private Long creatorTime; + @Schema(description ="排序") + private Long sortCode; + @Schema(description ="锁定标志") + private Integer lockMark; + @Schema(description ="交接状态") + private Integer handoverMark; + private Integer isAdministrator; + @Schema(description = "头像") + private String headIcon; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserLogVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserLogVO.java new file mode 100644 index 0000000..27c8c8c --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserLogVO.java @@ -0,0 +1,26 @@ +package jnpf.permission.model.user.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class UserLogVO { + @Schema(description = "登录时间") + private Long creatorTime; + @Schema(description = "登录用户") + private String userName; + @Schema(description = "登录IP") + private String ipaddress; + @Schema(description = "摘要") + private String platForm; + private String requestURL; + private String requestMethod; + private String requestDuration; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserSelectorVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserSelectorVO.java new file mode 100644 index 0000000..c95d749 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserSelectorVO.java @@ -0,0 +1,39 @@ +package jnpf.permission.model.user.vo; + +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class UserSelectorVO { + @Schema(description = "主键") + private String id; + @Schema(description = "父主键") + private String parentId; + @Schema(description = "名称") + private String fullName; + @Schema(description = "是否有子节点") + private Boolean hasChildren; + @Schema(description = "状态") + private Integer enabledMark; + @Schema(description = "子节点") + private List children; + @JSONField(name="category") + private String type; + @Schema(description = "图标") + private String icon; + private Boolean isLeaf; + private String headIcon; + private String organize; + private Integer gender; + private Integer isAdministrator; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserSubordinateVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserSubordinateVO.java new file mode 100644 index 0000000..1d40493 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/user/vo/UserSubordinateVO.java @@ -0,0 +1,29 @@ +package jnpf.permission.model.user.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Builder; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +@Builder +public class UserSubordinateVO { + private String id; + @Schema(description = "头像") + private String avatar; + @Schema(description = "用户名") + private String userName; + @Schema(description = "部门") + private String department; + @Schema(description = "岗位") + private String position; + + @Schema(description = "是否显示下级按钮") + private Boolean isLeaf; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/usergroup/GroupCrForm.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/usergroup/GroupCrForm.java new file mode 100644 index 0000000..f714823 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/usergroup/GroupCrForm.java @@ -0,0 +1,54 @@ +package jnpf.permission.model.usergroup; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * @author :JNPF开发平台组 + * @version: V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date :2022/3/11 9:28 + */ +@Data +public class GroupCrForm { + /** + * 名称 + **/ + @Schema(description = "名称") + @NotBlank(message = "名称不能为空") + private String fullName; + + /** + * 编码 + **/ + @Schema(description = "编码") + @NotBlank(message = "编码不能为空") + private String enCode; + + /** + * 说明 + **/ + @Schema(description = "说明") + private String description; + + /** + * 类型 + **/ + @Schema(description = "类型") + @NotBlank(message = "类型不能为空") + private String type; + + /** + * 排序 + **/ + @Schema(description = "排序") + private String sortCode; + + /** + * 状态 + **/ + @Schema(description = "状态") + private Integer enabledMark; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/usergroup/GroupInfoVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/usergroup/GroupInfoVO.java new file mode 100644 index 0000000..75b7d0c --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/usergroup/GroupInfoVO.java @@ -0,0 +1,54 @@ +package jnpf.permission.model.usergroup; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author :JNPF开发平台组 + * @version: V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date :2022/3/11 9:21 + */ +@Data +public class GroupInfoVO implements Serializable { + /** + * 主键 + **/ + @Schema(description = "主键") + private String id; + + /** + * 名称 + **/ + @Schema(description = "名称") + private String fullName; + + /** + * 编码 + **/ + @Schema(description = "编码") + private String enCode; + + /** + * 说明 + **/ + @Schema(description = "说明") + private String description; + + /** + * 类型 + **/ + @Schema(description = "类型") + private String type; + + /** + * 排序 + **/ + @Schema(description = "排序") + private String sortCode; + + @Schema(description = "状态") + private Integer enabledMark; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/usergroup/GroupPaginationVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/usergroup/GroupPaginationVO.java new file mode 100644 index 0000000..b3ebc76 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/usergroup/GroupPaginationVO.java @@ -0,0 +1,35 @@ +package jnpf.permission.model.usergroup; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 用户分组管理列表返回 + * + * @author :JNPF开发平台组 + * @version: V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date :2022/3/11 8:58 + */ +@Data +public class GroupPaginationVO implements Serializable { + @Schema(description = "主键") + private String id; + @Schema(description = "名称") + private String fullName; + @Schema(description = "编码") + private String enCode; + @Schema(description = "类型") + private String type; + @Schema(description = "说明") + private String description; + @Schema(description = "排序码") + private Long sortCode; + @Schema(description = "创建时间") + private Long creatorTime; + @Schema(description = "创建时间") + private Integer enabledMark; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/usergroup/GroupSelectorVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/usergroup/GroupSelectorVO.java new file mode 100644 index 0000000..69ad9ef --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/usergroup/GroupSelectorVO.java @@ -0,0 +1,42 @@ +package jnpf.permission.model.usergroup; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author :JNPF开发平台组 + * @version: V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date :2022/3/11 10:39 + */ +@Data +public class GroupSelectorVO implements Serializable { + + @Schema(description = "主键") + private String id; + @Schema(description = "名称") + private String fullName; + /** + * 子集个数 + */ + @Schema(description = "子集个数") + private Long num; + /** + * 子集 + */ + @Schema(description = "子集") + private List children; + @Schema(description = "父级id") + private String parentId; + @Schema(description = "类型") + private String type; + + @Schema(description = "有线标志") + private Integer enabledMark; + + @Schema(description = "按钮") + private String icon; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/usergroup/GroupTreeModel.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/usergroup/GroupTreeModel.java new file mode 100644 index 0000000..1c43fde --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/usergroup/GroupTreeModel.java @@ -0,0 +1,22 @@ +package jnpf.permission.model.usergroup; + +import jnpf.util.treeutil.SumTree; +import lombok.Data; + +/** + * 转树模型 + * + * @author :JNPF开发平台组 + * @version: V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date :2022/3/11 11:18 + */ +@Data +public class GroupTreeModel extends SumTree { + private String fullName; + private String type; + private Long num; + + private Integer enabledMark; + private String icon; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/usergroup/GroupUpForm.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/usergroup/GroupUpForm.java new file mode 100644 index 0000000..a287899 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/usergroup/GroupUpForm.java @@ -0,0 +1,57 @@ +package jnpf.permission.model.usergroup; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @author :JNPF开发平台组 + * @version: V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date :2022/3/11 9:34 + */ +@Data +public class GroupUpForm implements Serializable { + + /** + * 名称 + **/ + @Schema(description = "名称") + @NotBlank(message = "名称不能为空") + private String fullName; + + /** + * 编码 + **/ + @Schema(description = "编码") + @NotBlank(message = "编码不能为空") + private String enCode; + + /** + * 说明 + **/ + @Schema(description = "说明") + private String description; + + /** + * 类型 + **/ + @Schema(description = "类型") + @NotBlank(message = "类型不能为空") + private String type; + + /** + * 排序 + **/ + @Schema(description = "排序") + private String sortCode; + + /** + * 状态 + **/ + @Schema(description = "状态") + private Integer enabledMark; + +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/userrelation/UserRelationDel.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/userrelation/UserRelationDel.java new file mode 100644 index 0000000..f4d9b95 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/userrelation/UserRelationDel.java @@ -0,0 +1,15 @@ +package jnpf.permission.model.userrelation; + +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class UserRelationDel { + private String[] ids; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/userrelation/UserRelationForm.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/userrelation/UserRelationForm.java new file mode 100644 index 0000000..a700432 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/userrelation/UserRelationForm.java @@ -0,0 +1,21 @@ +package jnpf.permission.model.userrelation; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class UserRelationForm { + @Schema(description = "对象类型") + private String objectType; + @Schema(description = "用户id") + private List userIds; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/userrelation/UserRelationIdsVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/userrelation/UserRelationIdsVO.java new file mode 100644 index 0000000..08b3737 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/userrelation/UserRelationIdsVO.java @@ -0,0 +1,17 @@ +package jnpf.permission.model.userrelation; + +import lombok.Data; + +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class UserRelationIdsVO { + List ids; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/userrelation/UserRelationListVO.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/userrelation/UserRelationListVO.java new file mode 100644 index 0000000..cc4be95 --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/userrelation/UserRelationListVO.java @@ -0,0 +1,31 @@ +package jnpf.permission.model.userrelation; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class UserRelationListVO { + @Schema(description = "id") + private String id; + @Schema(description = "成员id") + private String userId; + @Schema(description = "用户id") + private String account; + @Schema(description = "用户真实姓名") + private String realName; + @Schema(description = "性别") + private String gender; + @Schema(description = "所属公司") + private String organize; + @Schema(description = "所属部门") + private String department; + @Schema(description = "添加时间(时间戳)") + private Long creatorTime; +} diff --git a/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/userrelation/UserRelationTreeModel.java b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/userrelation/UserRelationTreeModel.java new file mode 100644 index 0000000..b8294eb --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/jnpf-permission-entity/src/main/java/jnpf/permission/model/userrelation/UserRelationTreeModel.java @@ -0,0 +1,26 @@ +package jnpf.permission.model.userrelation; + +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.util.treeutil.SumTree; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class UserRelationTreeModel extends SumTree{ + + @Schema(description = "主键") + private String id; + @Schema(description = "名称") + private String fullName; + @Schema(description = "是否有子节点") + private Boolean hasChildren; + @JSONField(name="category") + private String type; +} diff --git a/jnpf-java-boot/jnpf-permission/pom.xml b/jnpf-java-boot/jnpf-permission/pom.xml new file mode 100644 index 0000000..34ed2cb --- /dev/null +++ b/jnpf-java-boot/jnpf-permission/pom.xml @@ -0,0 +1,21 @@ + + + + jnpf-java-boot + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-permission + pom + + jnpf-permission-entity + jnpf-permission-biz + jnpf-permission-controller + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-public/jnpf-common-all/pom.xml b/jnpf-java-boot/jnpf-public/jnpf-common-all/pom.xml new file mode 100644 index 0000000..3092a18 --- /dev/null +++ b/jnpf-java-boot/jnpf-public/jnpf-common-all/pom.xml @@ -0,0 +1,36 @@ + + + + jnpf-java-boot + com.jnpf + 3.5.0-RELEASE + ../../pom.xml + + 4.0.0 + + jnpf-common-all + + + + com.jnpf + jnpf-common-database + + + + com.jnpf + jnpf-common-swagger + + + + com.jnpf + jnpf-common-file + + + com.jnpf + jnpf-file-core-starter + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-public/jnpf-common-all/src/main/java/jnpf/model/AppDataInfoModel.java b/jnpf-java-boot/jnpf-public/jnpf-common-all/src/main/java/jnpf/model/AppDataInfoModel.java new file mode 100644 index 0000000..eebde10 --- /dev/null +++ b/jnpf-java-boot/jnpf-public/jnpf-common-all/src/main/java/jnpf/model/AppDataInfoModel.java @@ -0,0 +1,68 @@ +package jnpf.model; + +import lombok.Data; + +import java.util.Date; + +@Data +public class AppDataInfoModel { + /** + * 单据主键 + */ + private String id; + + /** + * 对象类型 + */ + private String objectType; + + /** + * 对象主键 + */ + private String objectId; + + /** + * 数据 + */ + private String objectData; + + /** + * 描述 + */ + private String description; + + /** + * 有效标志 + */ + private Integer enabledMark; + + /** + * 创建时间 + */ + private Date creatorTime; + + /** + * 创建用户 + */ + private String creatorUserId; + + /** + * 删除时间 + */ + private Date deleteTime; + + /** + * 删除用户 + */ + private String deleteUserId; + + /** + * 删除标志 + */ + private Integer deleteMark; + + /** + * 关联系统id + */ + private String systemId; +} diff --git a/jnpf-java-boot/jnpf-public/jnpf-common-all/src/main/java/jnpf/model/AppObjectDataModel.java b/jnpf-java-boot/jnpf-public/jnpf-common-all/src/main/java/jnpf/model/AppObjectDataModel.java new file mode 100644 index 0000000..954e32d --- /dev/null +++ b/jnpf-java-boot/jnpf-public/jnpf-common-all/src/main/java/jnpf/model/AppObjectDataModel.java @@ -0,0 +1,21 @@ +package jnpf.model; + +import lombok.Data; + +@Data +public class AppObjectDataModel { + + private String id; + private boolean hasChildren; + private String fullName; + private String icon; + private String urlAddress; + private String parentId; + private Integer type; + private String propertyJson; + private boolean isData; + private String children; + private String iconBackground; + private String moduleId; + +} diff --git a/jnpf-java-boot/jnpf-public/jnpf-common-all/src/main/java/jnpf/model/LoginForm.java b/jnpf-java-boot/jnpf-public/jnpf-common-all/src/main/java/jnpf/model/LoginForm.java new file mode 100644 index 0000000..b226f66 --- /dev/null +++ b/jnpf-java-boot/jnpf-public/jnpf-common-all/src/main/java/jnpf/model/LoginForm.java @@ -0,0 +1,47 @@ +package jnpf.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/16 8:49 + */ +@Data +public class LoginForm { + @Schema(description = "账号") + private String account; + @Schema(description = "密码") + private String password; + + /** + * 登录类型 + */ + @Schema(description = "登录类型") + private String grantType; + /** + * 验证码标识 + */ + @Schema(description = "验证码标识") + private String timestamp; + /** + * 来源类型 + */ + private String origin; + /** + * 验证码 + */ + @Schema(description = "验证码") + private String code; + + public LoginForm() { + } + + public LoginForm(String account, String password) { + this.account = account; + this.password = password; + } +} diff --git a/jnpf-java-boot/jnpf-public/jnpf-common-all/src/main/java/jnpf/model/app/AppMenuModel.java b/jnpf-java-boot/jnpf-public/jnpf-common-all/src/main/java/jnpf/model/app/AppMenuModel.java new file mode 100644 index 0000000..3ba2a50 --- /dev/null +++ b/jnpf-java-boot/jnpf-public/jnpf-common-all/src/main/java/jnpf/model/app/AppMenuModel.java @@ -0,0 +1,21 @@ +package jnpf.model.app; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class AppMenuModel { + @Schema(description = "扩展字段") + private String propertyJson; + @Schema(description = "菜单编码") + private String enCode; + @Schema(description = "菜单名称") + private String fullName; + @Schema(description = "图标") + private String icon; + @Schema(description = "主键id") + private String id; + @Schema(description = "链接地址") + private String urlAddress; + +} diff --git a/jnpf-java-boot/jnpf-public/jnpf-common-all/src/main/java/jnpf/onlinedev/model/OnlineDevData.java b/jnpf-java-boot/jnpf-public/jnpf-common-all/src/main/java/jnpf/onlinedev/model/OnlineDevData.java new file mode 100644 index 0000000..e3265eb --- /dev/null +++ b/jnpf-java-boot/jnpf-public/jnpf-common-all/src/main/java/jnpf/onlinedev/model/OnlineDevData.java @@ -0,0 +1,65 @@ +package jnpf.onlinedev.model; + +import lombok.Data; + +/** + * 在线开发常用常量 + */ +@Data +public class OnlineDevData { + + /** + * 用于判断是否是有表数据 + */ + public static final String TABLE_CONST = "[]"; + + /** + * 详情id副本 + */ + public static final String INFO_ID = "_id"; + + + /** + * 列表分组类型3 + */ + public static final Integer TYPE_THREE_COLUMNDATA = 3; + + /** + * 树形列表类型5 + */ + public static final Integer TYPE_FIVE_COLUMNDATA = 5; + + + /** + * 禁用 + */ + public static final Integer STATE_DISABLE = 0; + /** + * 启用 + */ + public static final Integer STATE_ENABLE = 1; + /** + * 系统表单 + */ + public static final Integer FORM_TYPE_SYS = 1; + /** + * 自定义表单 + */ + public static final Integer FORM_TYPE_DEV = 2; + /** + * 发起流程类型 + */ + public static final Integer FLOW_TYPE_FLOW = 0; + /** + * 功能流程类型 + */ + public static final Integer FLOW_TYPE_DEV = 1; + /** + * 默认分类编码encode + */ + public static final String DEFAULT_CATEGATY_ENCODE = "default"; + + + + +} diff --git a/jnpf-java-boot/jnpf-public/jnpf-generater-base/pom.xml b/jnpf-java-boot/jnpf-public/jnpf-generater-base/pom.xml new file mode 100644 index 0000000..d20ceb3 --- /dev/null +++ b/jnpf-java-boot/jnpf-public/jnpf-generater-base/pom.xml @@ -0,0 +1,33 @@ + + + 4.0.0 + + com.jnpf + jnpf-java-boot + 3.5.0-RELEASE + ../../pom.xml + + + jnpf-generater-base + + + + com.jnpf + jnpf-provider + ${project.version} + + + com.jnpf + jnpf-workflow-engine-biz + ${project.version} + + + com.jnpf + jnpf-visualdev-onlinedev-biz + ${project.version} + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-public/jnpf-generater-base/src/main/java/jnpf/model/FieLdsModelExcel.java b/jnpf-java-boot/jnpf-public/jnpf-generater-base/src/main/java/jnpf/model/FieLdsModelExcel.java new file mode 100644 index 0000000..c9932ad --- /dev/null +++ b/jnpf-java-boot/jnpf-public/jnpf-generater-base/src/main/java/jnpf/model/FieLdsModelExcel.java @@ -0,0 +1,14 @@ +package jnpf.model; + +import java.lang.annotation.*; + +@Documented +@Target({ElementType.FIELD}) +@Retention(RetentionPolicy.RUNTIME) +public @interface FieLdsModelExcel { + + String fieLdsModel() default "{}"; + + String type() default "mast"; + +} diff --git a/jnpf-java-boot/jnpf-public/jnpf-generater-base/src/main/java/jnpf/model/QueryModel.java b/jnpf-java-boot/jnpf-public/jnpf-generater-base/src/main/java/jnpf/model/QueryModel.java new file mode 100644 index 0000000..b4297d1 --- /dev/null +++ b/jnpf-java-boot/jnpf-public/jnpf-generater-base/src/main/java/jnpf/model/QueryModel.java @@ -0,0 +1,29 @@ +package jnpf.model; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class QueryModel { + private QueryWrapper obj; + private Class entity; + private String queryJson; + private String moduleId; + private String dbLink; + private String dbType; + + public QueryModel(QueryWrapper obj, Class entity, String queryJsonOrModuleId, String dbLink) { + this.obj = obj; + this.entity = entity; + this.queryJson = queryJsonOrModuleId; + this.moduleId = queryJsonOrModuleId; + this.dbLink = dbLink; + } + +} diff --git a/jnpf-java-boot/jnpf-public/jnpf-generater-base/src/main/java/jnpf/util/GenUtil.java b/jnpf-java-boot/jnpf-public/jnpf-generater-base/src/main/java/jnpf/util/GenUtil.java new file mode 100644 index 0000000..d717cd2 --- /dev/null +++ b/jnpf-java-boot/jnpf-public/jnpf-generater-base/src/main/java/jnpf/util/GenUtil.java @@ -0,0 +1,501 @@ +package jnpf.util; + +import cn.hutool.json.JSONUtil; +import com.alibaba.fastjson.JSONArray; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import jnpf.util.visiual.JnpfKeyConsts; +import lombok.Data; +import org.apache.commons.lang3.StringUtils; + +import java.math.BigDecimal; +import java.text.DecimalFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Data +public class GenUtil { + /** + * 字段说明 + */ + private String fieldName; + /** + * 运算符 + */ + private String operator; + /** + * 逻辑拼接符号 + */ + private String logic; + /** + * 组件标识 + */ + private String jnpfKey; + /** + * 字段key + */ + private String field; + /** + * 自定义的值 + */ + private String fieldValue; + /** + * 自定义的值2 + */ + private String fieldValue2; + + private List selectIgnore; + + /** + * 数据库类型 + */ + private String dbType; + /** + * 日期格式 + */ + private String format; + /** + * 数字精度 + */ + private String precision; + + + /** + * @param wrapper wrapper对象 + * @param fieldDb 数据库字段名实际包括前缀 + * @return + */ + public QueryWrapper solveValue(QueryWrapper wrapper, String fieldDb) { + MyType myType = myControl(jnpfKey); + if ("||".equals(logic)) { + wrapper.or(); + } + if (fieldValue == null) { + fieldValue = ""; + } + try { + ArrayList splitKey = new ArrayList() {{ + add(JnpfKeyConsts.DATE); + add(JnpfKeyConsts.TIME); + add(JnpfKeyConsts.NUM_INPUT); + add(JnpfKeyConsts.CREATETIME); + add(JnpfKeyConsts.MODIFYTIME); + }}; + if (splitKey.contains(jnpfKey) && "between".equals(operator)) { + List data = JsonUtil.getJsonToList(fieldValue, String.class); + fieldValue = data.get(0); + fieldValue2 = data.get(1); + } + + + selectIgnore = new ArrayList() {{ + add(JnpfKeyConsts.COMSELECT); + add(JnpfKeyConsts.ADDRESS); + add(JnpfKeyConsts.CASCADER); + add(JnpfKeyConsts.CHECKBOX); + add(JnpfKeyConsts.DEPSELECT); + }}; + + myType.judge(wrapper, fieldDb); + return wrapper; + } catch (Exception e) { + return wrapper; + } + + } + + /** + * 判断控件的所属类型 + * + * @param jnpfKey 控件标识 + * @return 控件类型 + */ + public MyType myControl(String jnpfKey) { + MyType myType = null; + switch (jnpfKey) { + /** 基础 */ + case JnpfKeyConsts.COM_INPUT: + case JnpfKeyConsts.TEXTAREA: + case JnpfKeyConsts.BILLRULE: + case JnpfKeyConsts.POPUPTABLESELECT: + case JnpfKeyConsts.RELATIONFORM: + case JnpfKeyConsts.RELATIONFORM_ATTR: + case JnpfKeyConsts.POPUPSELECT: + case JnpfKeyConsts.POPUPSELECT_ATTR: + myType = new BasicControl(); + break; + // 数字类型 + case JnpfKeyConsts.CALCULATE: + case JnpfKeyConsts.NUM_INPUT: + myType = new NumControl(); + break; + // 日期类型 + case JnpfKeyConsts.DATE: + case JnpfKeyConsts.CREATETIME: + case JnpfKeyConsts.MODIFYTIME: + myType = new DateControl(); + break; + // 时间类型 + case JnpfKeyConsts.TIME: + myType = new TimeControl(); + break; + // 下拉类型 + default: + myType = new SelectControl(); + } + return myType; + } + + public void getNullWrapper(QueryWrapper wrapper, String fieldDb) { + if ("||".equals(logic)) { + wrapper.or(t -> { + t.isNull(fieldDb); + t.or().eq(fieldDb, ""); + t.or().eq(fieldDb, "[]"); + }); + } else { + wrapper.and(t -> { + t.isNull(fieldDb); + t.or().eq(fieldDb, ""); + t.or().eq(fieldDb, "[]"); + }); + } + } + + private void getNotNullWrapper(QueryWrapper wrapper, String fieldDb) { + if ("||".equals(logic)) { + wrapper.or(t -> { + t.isNotNull(fieldDb); + t.ne(fieldDb, ""); + t.ne(fieldDb, "[]"); + }); + } else { + wrapper.and(t -> { + t.isNotNull(fieldDb); + t.ne(fieldDb, ""); + t.ne(fieldDb, "[]"); + }); + } + } + + /** + * 基础类型 + */ + class BasicControl extends MyType { + + @Override + void judge(QueryWrapper wrapper, String fieldDb) { + switch (operator) { + case "null": + getNullWrapper(wrapper, fieldDb); + break; + case "notNull": + getNotNullWrapper(wrapper, fieldDb); + break; + case "==": + wrapper.eq(fieldDb, fieldValue); + break; + case "<>": + wrapper.ne(fieldDb, fieldValue); + break; + case "like": + wrapper.like(fieldDb, fieldValue); + break; + case "notLike": + wrapper.notLike(fieldDb, fieldValue); + break; + + } + } + } + + class NumControl extends MyType { + + + @Override + void judge(QueryWrapper wrapper, String fieldDb) { + BigDecimal num1 = new BigDecimal(fieldValue); + BigDecimal num2 = null; + if (fieldValue2 != null) { + num2 = new BigDecimal(fieldValue2); + } + // 精度处理 + String fieldPrecisionValue; + String fieldPrecisionValue2; + if (StringUtils.isNotBlank(precision)) { + String zeroNum = "0." + StringUtils.repeat("0", Integer.parseInt(precision)); + DecimalFormat numFormat = new DecimalFormat(zeroNum); + fieldPrecisionValue = numFormat.format(new BigDecimal(fieldValue)); + num1 = new BigDecimal(fieldPrecisionValue); + if (fieldValue2 != null) { + fieldPrecisionValue2 = numFormat.format(new BigDecimal(fieldValue2)); + num2 = new BigDecimal(fieldPrecisionValue2); + } + } + + switch (operator) { + case "null": + getNullWrapper(wrapper, fieldDb); + break; + case "notNull": + getNotNullWrapper(wrapper, fieldDb); + break; + case "==": + wrapper.eq(fieldDb, num1); + break; + case "<>": + wrapper.ne(fieldDb, num1); + break; + case ">": + wrapper.gt(fieldDb, num1); + + break; + case "<": + wrapper.lt(fieldDb, num1); + break; + case ">=": + wrapper.ge(fieldDb, num1); + break; + case "<=": + wrapper.le(fieldDb, num1); + break; + case "between": + wrapper.between(fieldDb, num1, num2); + break; + } + } + } + + class DateControl extends MyType { + @Override + void judge(QueryWrapper wrapper, String fieldDb) { + + Long time = null; + Long time2 = null; + Date date = new Date(); + Date date2 = new Date(); + if (StringUtils.isNoneBlank(fieldValue)) { + time = Long.valueOf(fieldValue); + date = new Date(time); + } + if (StringUtils.isNoneBlank(fieldValue2)) { + time2 = Long.valueOf(fieldValue2); + // 日期类型的要加上当天的23:59:59 + if (JnpfKeyConsts.DATE.equals(jnpfKey)) { + date2 = new Date(time2 + 60 * 60 * 24 * 1000 - 1000); + } else { + date2 = new Date(time2); + } + + } + + switch (operator) { + case "null": + getNullWrapper(wrapper, fieldDb); + break; + case "notNull": + getNotNullWrapper(wrapper, fieldDb); + break; + case "==": + if (JnpfKeyConsts.DATE.equals(jnpfKey)) { + wrapper.between(fieldDb, date, new Date(time + 60 * 60 * 24 * 1000)); + } else { + wrapper.eq(fieldDb, date); + } + + break; + case "<>": + wrapper.ne(fieldDb, date); + break; + case ">": + wrapper.gt(fieldDb, date); + break; + case "<": + wrapper.lt(fieldDb, date); + break; + case ">=": + wrapper.ge(fieldDb, date); + break; + case "<=": + wrapper.le(fieldDb, date); + break; + case "between": + wrapper.between(fieldDb, date, date2); + break; + } + } + + + } + + class TimeControl extends MyType { + @Override + void judge(QueryWrapper wrapper, String fieldDb) { + switch (operator) { + case "null": + getNullWrapper(wrapper, fieldDb); + + break; + case "notNull": + getNotNullWrapper(wrapper, fieldDb); + break; + case "==": + wrapper.eq(fieldDb, fieldValue); + break; + case "<>": + wrapper.ne(fieldDb, fieldValue); + break; + case ">": + wrapper.gt(fieldDb, fieldValue); + break; + case "<": + wrapper.lt(fieldDb, fieldValue); + break; + case ">=": + wrapper.ge(fieldDb, fieldValue); + break; + case "<=": + wrapper.le(fieldDb, fieldValue); + break; + case "between": + wrapper.between(fieldDb, fieldValue, fieldValue2); + break; + } + } + } + private ArrayList solveListValue(String fieldValue) { + ArrayList result = new ArrayList<>(); + try { + List list = JsonUtil.getJsonToList(fieldValue, List.class); + for (List listSub : list) { + result.add(JSONArray.toJSONString(listSub)); + // 组织选择需要取最后每个数组最后一个 + String value = (String)listSub.get(listSub.size() - 1); + result.add(value); + } + + }catch (Exception e){ + List list = JsonUtil.getJsonToList(fieldValue, String.class); + result.add(JSONArray.toJSONString(list)); + String value = list.get(list.size() - 1); + result.add(value); + } + return result; + } + /** + * 下拉控件类型 + */ + class SelectControl extends MyType { + + @Override + void judge(QueryWrapper wrapper, String fieldDb) { + List list = solveListValue(fieldValue); + if (StringUtils.isNoneBlank(fieldValue) && fieldValue.charAt(0) == '[' && !selectIgnore.contains(jnpfKey)) { + list = JSONUtil.toList(fieldValue, String.class); + } + if (selectIgnore.contains(jnpfKey) && StringUtils.isBlank(fieldValue)) { + fieldValue = "[]"; + } + + switch (operator) { + case "null": + getNullWrapper(wrapper, fieldDb); + + break; + case "notNull": + getNotNullWrapper(wrapper, fieldDb); + break; + case "==": + wrapper.eq(fieldDb, fieldValue); + break; + case "<>": + wrapper.ne(fieldDb, fieldValue); + break; + case "like": + wrapper.like(fieldDb, fieldValue); + break; + case "notLike": + wrapper.notLike(fieldDb, fieldValue); + break; + case "in": + if (list.size() > 0) { + List finalList = list; + if ("||".equals(logic)) { + wrapper.or(t -> { + if (finalList.size() > 0) { + for (int i = 0; i < finalList.size(); i++) { + String value = finalList.get(i); + if (i == 0) { + t.like(fieldDb, value); + } else { + t.or().like(fieldDb, value); + } + } + } + }); + } else { + wrapper.and(t -> { + if (finalList.size() > 0) { + for (int i = 0; i < finalList.size(); i++) { + String value = finalList.get(i); + if (i == 0) { + t.like(fieldDb, value); + } else { + t.or().like(fieldDb, value); + } + } + } + }); + } + if(JnpfKeyConsts.CASCADER.equals(jnpfKey) || JnpfKeyConsts.COMSELECT.equals(jnpfKey) || JnpfKeyConsts.ADDRESS.equals(jnpfKey)){ + getNotNullWrapper(wrapper,fieldDb); + } + + } + break; + case "notIn": + if (list.size() > 0) { + List finalList1 = list; + if ("||".equals(logic)) { + wrapper.or(t -> { + if (finalList1.size() > 0) { + for (int i = 0; i < finalList1.size(); i++) { + String value = finalList1.get(i); + if (i == 0) { + t.notLike(fieldDb, value); + } else { + t.notLike(fieldDb, value); + } + + } + } + }); + } else { + wrapper.and(t -> { + if (finalList1.size() > 0) { + for (int i = 0; i < finalList1.size(); i++) { + String value = finalList1.get(i); + if (i == 0) { + t.notLike(fieldDb, value); + } else { + t.notLike(fieldDb, value); + } + + } + } + }); + } + if(JnpfKeyConsts.CASCADER.equals(jnpfKey) || JnpfKeyConsts.COMSELECT.equals(jnpfKey) || JnpfKeyConsts.ADDRESS.equals(jnpfKey)){ + getNotNullWrapper(wrapper,fieldDb); + } + + } + break; + } + } + } + + abstract class MyType { + abstract void judge(QueryWrapper wrapper, String fieldDb); + } +} diff --git a/jnpf-java-boot/jnpf-public/jnpf-generater-base/src/main/java/jnpf/util/GeneraterSwapUtil.java b/jnpf-java-boot/jnpf-public/jnpf-generater-base/src/main/java/jnpf/util/GeneraterSwapUtil.java new file mode 100644 index 0000000..bae2df7 --- /dev/null +++ b/jnpf-java-boot/jnpf-public/jnpf-generater-base/src/main/java/jnpf/util/GeneraterSwapUtil.java @@ -0,0 +1,2545 @@ +package jnpf.util; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; +import jnpf.annotation.JnpfField; +import jnpf.base.ActionResult; +import jnpf.base.entity.DictionaryDataEntity; +import jnpf.base.entity.ProvinceEntity; +import jnpf.base.entity.VisualdevEntity; +import jnpf.base.model.ColumnDataModel; +import jnpf.base.model.datainterface.DataInterfaceActionVo; +import jnpf.base.model.datainterface.DataInterfaceModel; +import jnpf.base.model.datainterface.DataInterfacePage; +import jnpf.base.model.filter.RuleInfo; +import jnpf.base.service.*; +import jnpf.base.util.VisualUtils; +import jnpf.constant.JnpfConst; +import jnpf.constant.PermissionConst; +import jnpf.database.model.entity.DbLinkEntity; +import jnpf.database.model.superQuery.ConditionJsonModel; +import jnpf.database.model.superQuery.SuperJsonModel; +import jnpf.database.model.superQuery.SuperQueryConditionModel; +import jnpf.database.model.superQuery.SuperQueryJsonModel; +import jnpf.database.util.ConnUtil; +import jnpf.database.util.DynamicDataSourceUtil; +import jnpf.engine.entity.FlowTaskEntity; +import jnpf.engine.entity.FlowTemplateJsonEntity; +import jnpf.engine.model.flowtemplate.FlowTemplateInfoVO; +import jnpf.engine.model.flowtemplatejson.FlowJsonModel; +import jnpf.engine.service.FlowTaskService; +import jnpf.engine.service.FlowTemplateJsonService; +import jnpf.engine.service.FlowTemplateService; +import jnpf.entity.FlowFormEntity; +import jnpf.exception.DataException; +import jnpf.exception.WorkFlowException; +import jnpf.mapper.FlowFormDataMapper; +import jnpf.model.QueryModel; +import jnpf.model.visualJson.*; +import jnpf.model.visualJson.config.ConfigModel; +import jnpf.onlinedev.model.OnlineDevData; +import jnpf.onlinedev.model.OnlineDevEnum.CacheKeyEnum; +import jnpf.onlinedev.model.OnlineDevEnum.OnlineDataTypeEnum; +import jnpf.onlinedev.model.OnlineImport.ExcelImportModel; +import jnpf.onlinedev.model.OnlineImport.ImportDataModel; +import jnpf.onlinedev.model.OnlineImport.ImportFormCheckUniqueModel; +import jnpf.onlinedev.model.VisualdevModelDataInfoVO; +import jnpf.onlinedev.service.VisualDevInfoService; +import jnpf.onlinedev.service.VisualdevModelDataService; +import jnpf.onlinedev.util.onlineDevUtil.OnlineDevListUtils; +import jnpf.onlinedev.util.onlineDevUtil.OnlineProductSqlUtils; +import jnpf.onlinedev.util.onlineDevUtil.OnlinePublicUtils; +import jnpf.onlinedev.util.onlineDevUtil.OnlineSwapDataUtils; +import jnpf.permission.entity.*; +import jnpf.permission.model.authorize.OnlineDynamicSqlModel; +import jnpf.permission.service.*; +import jnpf.service.FlowFormService; +import jnpf.util.context.RequestContext; +import jnpf.util.data.DataSourceContextHolder; +import jnpf.util.visiual.JnpfKeyConsts; +import lombok.Cleanup; +import org.mybatis.dynamic.sql.BasicColumn; +import org.mybatis.dynamic.sql.SqlBuilder; +import org.mybatis.dynamic.sql.SqlTable; +import org.mybatis.dynamic.sql.render.RenderingStrategies; +import org.mybatis.dynamic.sql.select.QueryExpressionDSL; +import org.mybatis.dynamic.sql.select.SelectModel; +import org.mybatis.dynamic.sql.select.join.EqualTo; +import org.mybatis.dynamic.sql.select.render.SelectStatementProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.io.IOException; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; +import java.math.BigDecimal; +import java.sql.Connection; +import java.time.Instant; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 数据转换(代码生成器用) + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/3/16 + */ +@Component +public class GeneraterSwapUtil { + + @Autowired + private OrganizeService organizeService; + + @Autowired + private OrganizeRelationService organizeRelationApi; + + @Autowired + private FilterService filterService; + + @Autowired + private PositionService positionService; + + @Autowired + private UserService userService; + + @Autowired + private VisualdevService visualdevService; + + @Autowired + private VisualDevInfoService visualDevInfoService; + + @Autowired + private DataInterfaceService dataInterfaceService; + + @Autowired + private VisualdevModelDataService visualdevModelDataService; + + @Autowired + private ProvinceService provinceService; + + @Autowired + private DictionaryDataService dictionaryDataService; + + @Autowired + private BillRuleService billRuleService; + + @Autowired + private FlowTaskService flowTaskService; + + @Autowired + private GroupService groupService; + + @Autowired + private RoleService roleService; + + @Autowired + private UserProvider userProvider; + + @Autowired + private DbLinkService dbLinkService; + + @Autowired + private FlowTemplateJsonService flowTemplateJsonService; + + @Autowired + private UserRelationService userRelationService; + + @Autowired + private FlowFormDataMapper flowFormDataMapper; + + @Autowired + private FlowFormDataUtil flowFormDataUtil; + + @Autowired + private DbLinkService dblinkService; + + @Autowired + private FlowTemplateService flowTemplateService; + + @Autowired + private FlowFormService flowFormService; + + @Autowired + private OnlineSwapDataUtils swapDataUtils; + + @Autowired + private RedisUtil redisUtil; + + @Autowired + private AuthorizeService authorizeService; + + public final String regEx = "[\\[\\]\"]"; + + + private static long DEFAULT_CACHE_TIME = 60 * 5; + + /** + * 日期时间戳字符串转换 + * + * @param date + * @param format + * @return + */ + public String dateSwap(String date, String format) { + if (StringUtil.isNotEmpty(date)) { + DateTimeFormatter ftf = DateTimeFormatter.ofPattern(format); + if (date.contains(",")) { + String[] dates = date.split(","); + long time1 = Long.parseLong(dates[0]); + long time2 = Long.parseLong(dates[1]); + String value1 = ftf.format(LocalDateTime.ofInstant(Instant.ofEpochMilli(time1), ZoneId.systemDefault())); + String value2 = ftf.format(LocalDateTime.ofInstant(Instant.ofEpochMilli(time2), ZoneId.systemDefault())); + return value1 + "至" + value2; + } + long time = Long.parseLong(date); + String value = ftf.format(LocalDateTime.ofInstant(Instant.ofEpochMilli(time), ZoneId.systemDefault())); + return value; + } + return date; + } + + /** + * 行政区划转换 + * + * @param data + * @return + */ + public String provinceData(String data, Map localCache) { + Map proMap = new HashMap<>(); + if (localCache != null && localCache.containsKey("__pro_map")) { + proMap = (Map) localCache.get("__pro_map"); + } + if (StringUtil.isNotEmpty(data)) { + try { + if (data.contains("[[")) { + List addList = new ArrayList<>(); + String[][] provinceDataS = JsonUtil.getJsonToBean(data, String[][].class); + for (String[] AddressData : provinceDataS) { + List provList = new ArrayList(Arrays.asList(AddressData)); + List nameList = new ArrayList<>(); + if (localCache != null) { + for (String info : provList) { + nameList.add(proMap.get(info)); + } + } else { + List proList = provinceService.getProList(provList); + for (ProvinceEntity info : proList) { + nameList.add(info.getFullName()); + } + } + addList.add(String.join("/", nameList)); + } + return String.join(";", addList); + } else if (data.contains("[")) { + List provList = JsonUtil.getJsonToList(data, String.class); + List nameList = new ArrayList<>(); + if (localCache != null) { + for (String info : provList) { + nameList.add(proMap.get(info)); + } + } else { + List proList = provinceService.getProList(provList); + for (ProvinceEntity info : proList) { + nameList.add(info.getFullName()); + } + } + return String.join("/", nameList); + } else { + String[] strs = data.split(","); + List provList = new ArrayList(Arrays.asList(strs)); + List proNameList = new ArrayList<>(); + if (localCache != null) { + for (String info : provList) { + proNameList.add(proMap.get(info)); + } + } else { + List proList = provinceService.getProList(provList); + for (ProvinceEntity info : proList) { + proNameList.add(info.getFullName()); + } + } + return String.join("/", proNameList); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + return ""; + } + + public Map localCache() { + //公共数据 + String dsName = Optional.ofNullable(DataSourceContextHolder.getDatasourceId()).orElse(""); + Map localCache = new HashMap<>(); + if (!localCache.containsKey("__pro_map")) { + //省市区 + Map proMap = redisUtil.getMap(String.format("%s-%s-%d", dsName, "province", 1)); + List> proMapList = new ArrayList<>(); + if (proMap.size() == 0) { + //分级存储 + for (int i = 1; i <= 4; i++) { + String redisKey = String.format("%s-%s-%d", dsName, "province", i); + if (!redisUtil.exists(redisKey)) { + List provinceEntityList = provinceService.getProListBytype(String.valueOf(i)); + Map provinceMap = new HashMap<>(16); + if (provinceEntityList != null) { + provinceEntityList.stream().forEach(p -> provinceMap.put(p.getId(), p.getFullName())); + } + proMapList.add(provinceMap); + //区划基本不修改 不做是否缓存判断 + redisUtil.insert(redisKey, provinceMap, RedisUtil.CAHCEWEEK); + } + } + } else { + for (int i = 1; i <= 4; i++) { + proMapList.add(redisUtil.getMap(String.format("%s-%s-%d", dsName, "province", i))); + } + } + + Map proMapr = new HashMap<>(); + proMapList.forEach(item -> proMapr.putAll(item)); + localCache.put("__pro_map", proMapr); + } + return localCache; + } + + /** + * 公司部门id转名称 + * + * @param value + * @return + */ + public String comSelectValue(String value, String showLevel) { + if (StringUtil.isNotEmpty(String.valueOf(value))) { + OrganizeEntity organizeEntity = organizeService.getInfo(String.valueOf(value)); + if ("all".equals(showLevel)) { + List organizeListAll = organizeService.getList(false); + String[] organizeTreeId = StringUtil.isNotEmpty(organizeEntity.getOrganizeIdTree()) ? organizeEntity.getOrganizeIdTree().split(",") : new String[]{}; + List organizeTreeList = Arrays.asList(organizeTreeId).stream().filter(t -> !t.isEmpty()).collect(Collectors.toList()); + StringJoiner joiner = new StringJoiner("/"); + for (int i = 0; i < organizeTreeList.size(); i++) { + String id = organizeTreeList.get(i); + OrganizeEntity entity = organizeListAll.stream().filter(t -> t.getId().equals(id)).findFirst().orElse(null); + if (entity != null) { + joiner.add(entity.getFullName()); + } + } + value = joiner.toString(); + } else { + if (organizeEntity != null) { + if (organizeEntity.getCategory().equals("company")) { + return " "; + } + value = organizeEntity.getFullName(); + } + } + } else { + value = " "; + } + return value; + } + + /** + * 公司部门id转名称(多选) + * + * @param ids + * @return + */ + public String comSelectValues(String ids, Boolean mul) { + List comValueList = new ArrayList<>(); + if (StringUtil.isEmpty(ids)) { + return null; + } + String Separator = mul ? "," : "/"; + if (ids.contains("[[")) { + String[][] idArrays = JsonUtil.getJsonToBean(ids, String[][].class); + for (String[] array : idArrays) { + List idList = new ArrayList<>(); + for (String s : array) { + OrganizeEntity info = organizeService.getInfo(s); + idList.add(Objects.nonNull(info) ? info.getFullName() : s); + } + String orgCom = idList.stream().collect(Collectors.joining("/")); + comValueList.add(orgCom); + } + return comValueList.stream().collect(Collectors.joining(";")); + } else if (ids.contains("[")) { + List idList = JsonUtil.getJsonToList(ids, String.class); + List nameList = new ArrayList<>(); + for (String orgId : idList) { + OrganizeEntity info = organizeService.getInfo(orgId); + nameList.add(Objects.nonNull(info) ? info.getFullName() : orgId); + } + return nameList.stream().collect(Collectors.joining(Separator)); + } else { + ids = ids.replaceAll("\"", ""); + String[] idList = ids.split(","); + if (idList.length > 0) { + List comSelectList = new ArrayList<>(); + for (String id : idList) { + OrganizeEntity organizeEntity = organizeService.getInfo(id); + if (organizeEntity != null) { + comSelectList.add(organizeEntity.getFullName()); + } + } + return String.join(",", comSelectList); + } + } + return null; + } + + + /** + * 岗位id转名称 + * + * @param id + * @return + */ + public String posSelectValue(String id) { + if (StringUtil.isNotEmpty(id)) { + PositionEntity positionApiInfo = positionService.getInfo(id); + if (ObjectUtil.isNotEmpty(positionApiInfo)) { + return positionApiInfo.getFullName(); + } + return id; + } + return " "; + } + + /** + * 岗位id转名称(多选) + * + * @param ids + * @return + */ + public String posSelectValues(String ids) { + if (StringUtil.isEmpty(ids)) { + return ""; + } + List posList = new ArrayList<>(); + if (ids.contains("[")) { + List idList = JsonUtil.getJsonToList(ids, String.class); + List nameList = new ArrayList<>(); + for (String orgId : idList) { + PositionEntity info = positionService.getInfo(orgId); + nameList.add(Objects.nonNull(info) ? info.getFullName() : orgId); + } + posList = nameList; + } else { + String[] idList = ids.split(","); + if (idList.length > 0) { + for (String id : idList) { + PositionEntity positionEntity = positionService.getInfo(id); + if (ObjectUtil.isNotEmpty(positionEntity)) { + posList.add(positionEntity.getFullName()); + } + } + } + } + return String.join(",", posList); + } + + /** + * 用户id转名称 + * + * @param id + * @return + */ + public String userSelectValue(String id) { + if (StringUtil.isNotEmpty(id)) { + UserEntity userEntity = userService.getInfo(id); + if (ObjectUtil.isNotEmpty(userEntity)) { + return userEntity.getRealName() + "/" + userEntity.getAccount(); + } + return id; + } + return ""; + } + + /** + * 用户id转名称(多选) + * + * @param ids + * @return + */ + public String userSelectValues(String ids) { + //公共数据 + String dsName = Optional.ofNullable(DataSourceContextHolder.getDatasourceId()).orElse(""); + //人员 + String redisKey = dsName + CacheKeyEnum.USER.getName(); + Map userMap; + if (redisUtil.exists(redisKey)) { + userMap = redisUtil.getMap(redisKey); + userMap = Optional.ofNullable(userMap).orElse(new HashMap<>(20)); + } else { + userMap = userService.getUserMap(); + redisUtil.insert(redisKey, userMap, DEFAULT_CACHE_TIME); + } + + if (StringUtil.isEmpty(ids)) { + return ids; + } + if (ids.contains("[")) { + List nameList = new ArrayList<>(); + List jsonToList = JsonUtil.getJsonToList(ids, String.class); + for (String userId : jsonToList) { + nameList.add(Objects.nonNull(userMap.get(userId)) ? userMap.get(userId).toString() : userId); + } + return String.join(";", nameList); + } else { + List userInfoList = new ArrayList<>(); + String[] idList = ids.split(","); + if (idList.length > 0) { + for (String userId : idList) { + userInfoList.add(Objects.nonNull(userMap.get(userId)) ? userMap.get(userId).toString() : userId); + } + } + return String.join("-", userInfoList); + } + } + + /** + * 用户组件id转名称(多选) + * + * @param ids + * @return + */ + public String usersSelectValues(String ids) { + if (StringUtil.isEmpty(ids)) { + return ids; + } + List dataNoSwapInMethod = OnlinePublicUtils.getDataNoSwapInMethod(ids); + StringJoiner valueJoin = new StringJoiner(","); + for (String data : dataNoSwapInMethod) { + String id = data.contains("--") ? data.substring(0, data.lastIndexOf("--")) : data; + String type = data.contains("--") ? data.substring(data.lastIndexOf("--") + 2) : ""; + switch (type) { + case "role": + RoleEntity roleEntity = roleService.getInfo(id); + if (roleEntity != null) { + valueJoin.add(roleEntity.getFullName()); + } else { + valueJoin.add(data); + } + break; + case "position": + PositionEntity positionEntity = positionService.getInfo(id); + if (positionEntity != null) { + valueJoin.add(positionEntity.getFullName()); + } else { + valueJoin.add(data); + } + break; + case "company": + case "department": + OrganizeEntity organizeEntity = organizeService.getInfo(id); + if (organizeEntity != null) { + valueJoin.add(organizeEntity.getFullName()); + } else { + valueJoin.add(data); + } + break; + case "group": + GroupEntity groupEntity = groupService.getInfo(id); + if (groupEntity != null) { + valueJoin.add(groupEntity.getFullName()); + } else { + valueJoin.add(data); + } + break; + case "user": + default: + UserEntity userEntity = userService.getInfo(id); + if (userEntity != null) { + valueJoin.add(userEntity.getRealName() + "/" + userEntity.getAccount()); + } else { + valueJoin.add(data); + } + break; + } + } + return valueJoin.toString(); + } + + + /** + * 开关 + * + * @param data + * @return + */ + public String switchSelectValue(String data, String activeTxt, String inactiveTxt) { + if (StringUtil.isNotEmpty(data)) { + if (data.equals("0") || data.equals("false")) { + return inactiveTxt; + } else if (data.equals("1") || data.equals("true")) { + return activeTxt; + } else { + return data; + } + } + return null; + } + + public VisualdevEntity visualdevEntity(String id) { + return visualdevService.getInfo(id); + } + + /** + * 关联表单数据转换 + * + * @param vmodel + * @param value + * @param modelId + * @return + */ + public String swapRelationFormValue(String vmodel, String value, String modelId, Map formDataMaps) { + if (StringUtil.isEmpty(value)) { + return ""; + } + try { + VisualdevModelDataInfoVO infoVO = null; + VisualdevEntity entity = visualdevService.getInfo(modelId); + if (!StringUtil.isEmpty(entity.getVisualTables()) && !OnlineDevData.TABLE_CONST.equals(entity.getVisualTables())) { + infoVO = visualDevInfoService.getDetailsDataInfo(value, entity); + } else { + infoVO = visualdevModelDataService.infoDataChange(value, entity); + } + if (infoVO != null) { + Map formDataMap = infoVO.getData() != null ? JsonUtil.stringToMap(infoVO.getData()) : new HashMap<>(); + if (formDataMap.size() > 0) { + formDataMaps.putAll(formDataMap); + formDataMap = OnlinePublicUtils.mapKeyToLower(formDataMap); + value = String.valueOf(formDataMap.get(vmodel.toLowerCase())); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + return value; + } + + + /** + * 弹窗 + * + * @param interfaceId + * @param propsValue + * @param relationField + * @param dataValue + * @return + */ + public String getPopupSelectValue(String interfaceId, String propsValue, String relationField, String dataValue, Map dataMaps, String json, int num, Map dataAll) { + if (StringUtil.isEmpty(interfaceId)) { + return null; + } + List list = JsonUtil.getJsonToList(json, TemplateJsonModel.class); + Map infoMap = new HashMap<>(); + List listParam = new ArrayList<>(); + for (TemplateJsonModel templateJsonModel : list) { + DataInterfaceModel dataInterfaceModel = JsonUtil.getJsonToBean(templateJsonModel, DataInterfaceModel.class); + String defaultV = ""; + if (StringUtil.isNotEmpty(templateJsonModel.getRelationField())) { + String[] mastTable = templateJsonModel.getRelationField().split("_jnpf_"); + String[] child = templateJsonModel.getRelationField().split("-"); + if (mastTable.length > 1) { + if (dataAll.get(mastTable[0]) instanceof Map) { + Map mastTableData = (Map) dataAll.get(mastTable[0]); + infoMap.put(templateJsonModel.getField(), String.valueOf(mastTableData.get(mastTable[1]))); + defaultV = String.valueOf(mastTableData.get(mastTable[1])); + } + } else if (child.length > 1) { + if (dataAll.get(child[0]) instanceof List) { + List> chidList = (List>) dataAll.get(child[0]); + for (int i = 0; i < chidList.size(); i++) { + Map objectMap = chidList.get(i); + if (i == num) { + infoMap.put(templateJsonModel.getField(), String.valueOf(objectMap.get(child[1]))); + defaultV = String.valueOf(objectMap.get(child[1])); + } + } + } + } else { + infoMap.put(templateJsonModel.getField(), String.valueOf(dataAll.get(templateJsonModel.getRelationField()))); + defaultV = String.valueOf(String.valueOf(dataAll.get(templateJsonModel.getRelationField()))); + } + } + dataInterfaceModel.setDefaultValue(defaultV); + listParam.add(dataInterfaceModel); + } + if (StringUtil.isNotEmpty(dataValue)) { +// Object data = dataInterfaceService.infoToId(interfaceId, null, infoMap).getData(); +// List> dataInterfaceDataList; +// if (data instanceof ActionResult) { +// ActionResult actionVo = (ActionResult) data; +// dataInterfaceDataList = (List>) actionVo.getData(); +// } else { +// dataInterfaceDataList = (List>) data; +// } + DataInterfacePage dataInterfacePage = new DataInterfacePage(); + dataInterfacePage.setParamList(listParam); + dataInterfacePage.setInterfaceId(interfaceId); + List ids = new ArrayList<>(); + if (dataValue.startsWith("[")) { + ids = JsonUtil.getJsonToList(dataValue, String.class); + } else { + ids.add(dataValue); + } + dataInterfacePage.setIds(ids); + dataInterfacePage.setPropsValue(propsValue); + dataInterfacePage.setRelationField(relationField); + List> dataInterfaceDataList = dataInterfaceService.infoToInfo(interfaceId, dataInterfacePage); + if (dataValue.contains("[")) { + List valueList = JsonUtil.getJsonToList(dataValue, String.class); + List swapValue = new ArrayList<>(); + for (String va : valueList) { + dataInterfaceDataList.stream().filter(map -> + map.get(propsValue).equals(va) + ).forEach( + modelMap -> swapValue.add(String.valueOf(modelMap.get(relationField))) + ); + } + return swapValue.stream().collect(Collectors.joining(",")); + } + if (dataInterfaceDataList != null) { + Map dataMap = dataInterfaceDataList.stream().filter(d -> d.get(propsValue).equals(dataValue)).findFirst().orElse(null); + if (dataMap != null) { + dataMaps.putAll(dataMap); + return String.valueOf(dataMap.get(relationField)); + } + } + return null; + } else { + return null; + } + } + + /** + * 弹窗 + * + * @param interfaceId + * @param propsValue + * @param relationField + * @param dataValue + * @return + */ + public String getPopupSelectValue(String interfaceId, String propsValue, String relationField, String dataValue, Map dataMaps) { + if (StringUtil.isEmpty(interfaceId)) { + return null; + } + if (StringUtil.isNotEmpty(dataValue)) { + Object data = dataInterfaceService.infoToId(interfaceId, null, null).getData(); + List> dataInterfaceDataList; + if (data instanceof ActionResult) { + ActionResult actionVo = (ActionResult) data; + dataInterfaceDataList = (List>) actionVo.getData(); + } else { + dataInterfaceDataList = (List>) data; + } + if (dataValue.contains("[")) { + List valueList = JsonUtil.getJsonToList(dataValue, String.class); + List swapValue = new ArrayList<>(); + for (String va : valueList) { + dataInterfaceDataList.stream().filter(map -> + map.get(propsValue).equals(va) + ).forEach( + modelMap -> swapValue.add(String.valueOf(modelMap.get(relationField))) + ); + } + return swapValue.stream().collect(Collectors.joining(",")); + } + Map dataMap = dataInterfaceDataList.stream().filter(d -> d.get(propsValue).equals(dataValue)).findFirst().orElse(null); + if (dataMap != null) { + dataMaps.putAll(dataMap); + return String.valueOf(dataMap.get(relationField)); + } + return null; + } else { + return null; + } + } + + + public String getFileNameInJson(String fileJson) { + if (StringUtil.isNotEmpty(fileJson) && !"null".equals(fileJson)) { + return fileJson; + } + return ""; + } + + + /** + * 获取数据字典数据 + * + * @param feild + * @return + */ + public String getDicName(String feild, String dictionaryTypeId) { + if (StringUtil.isNotEmpty(feild)) { + //去除中括号以及双引号 + feild = feild.replaceAll(regEx, ""); + //判断多选框 + String[] feilds = feild.split(","); + if (feilds.length > 1) { + StringBuilder feildsValue = new StringBuilder(); + DictionaryDataEntity dictionaryDataEntity; + for (String feil : feilds) { + dictionaryDataEntity = dictionaryDataService.getSwapInfo(feil, dictionaryTypeId); + if (dictionaryDataEntity != null) { + feildsValue.append(dictionaryDataEntity.getFullName() + ","); + } else { + feildsValue.append(feil + ","); + } + } + String finalValue; + if (StringUtil.isEmpty(feildsValue) || feildsValue.equals("")) { + finalValue = feildsValue.toString(); + } else { + finalValue = feildsValue.substring(0, feildsValue.length() - 1); + } + return finalValue; + } + DictionaryDataEntity dictionaryDataentity = dictionaryDataService.getSwapInfo(feild, dictionaryTypeId); + if (dictionaryDataentity != null) { + return dictionaryDataentity.getFullName(); + } + return feild; + } + if (StringUtil.isNotEmpty(feild)) { + List dicList = dictionaryDataService.getDicList(dictionaryTypeId); + } + return feild; + } + + /** + * 获取数据字典数据- + * + * @param feild + * @param keyName id或encode + * @return + */ + public String getDicName(String feild, String dictionaryTypeId, String keyName, boolean isMultiple, String separator) { + Object dataConversion = ""; + String redisKey = dictionaryTypeId + "-" + feild + "-" + keyName; + if (StringUtil.isNotEmpty(feild)) { + List dicList; + if (redisUtil.exists(redisKey)) { + List tmpList = redisUtil.get(redisKey, 0, -1); + dicList = JsonUtil.getJsonToList(tmpList, DictionaryDataEntity.class); + } else { + dicList = dictionaryDataService.getDicList(dictionaryTypeId); + redisUtil.insert(redisKey, dicList, DEFAULT_CACHE_TIME); + } + Map idMap = new HashMap<>(dicList.size()); + Map enCodeMap = new HashMap<>(dicList.size()); + for (DictionaryDataEntity dd : dicList) { + idMap.put(dd.getId(), dd.getFullName()); + enCodeMap.put(dd.getEnCode(), dd.getFullName()); + } + if (StringUtil.isNotEmpty(separator)) { + separator = "/"; + } + if ("enCode".equals(keyName)) { + dataConversion = FormPublicUtils.getDataConversion(enCodeMap, feild, isMultiple, separator); + } else { + dataConversion = FormPublicUtils.getDataConversion(idMap, feild, isMultiple, separator); + } + } + return dataConversion.toString(); + } + + /** + * 获取远端数据 + * + * @param urlId + * @param label + * @param value + * @param feildValue + * @return + * @throws IOException + */ + public String getDynName(String urlId, String label, String value, String feildValue, String json, int num, Map dataAll) { + List list = JsonUtil.getJsonToList(json, TemplateJsonModel.class); + Map infoMap = list.size() > 0 ? new HashMap<>() : null; + for (TemplateJsonModel templateJsonModel : list) { + if (StringUtil.isNotEmpty(templateJsonModel.getRelationField())) { + String[] mastTable = templateJsonModel.getRelationField().split("_jnpf_"); + String[] child = templateJsonModel.getRelationField().split("-"); + if (mastTable.length > 1) { + if (dataAll.get(mastTable[0]) instanceof Map) { + Map mastTableData = (Map) dataAll.get(mastTable[0]); + infoMap.put(templateJsonModel.getField(), String.valueOf(mastTableData.get(mastTable[1]))); + } + } else if (child.length > 1) { + if (dataAll.get(child[0]) instanceof List) { + List> chidList = (List>) dataAll.get(child[0]); + for (int i = 0; i < chidList.size(); i++) { + Map objectMap = chidList.get(i); + if (i == num) { + infoMap.put(templateJsonModel.getField(), String.valueOf(objectMap.get(child[1]))); + } + } + } + } else { + infoMap.put(templateJsonModel.getField(), String.valueOf(dataAll.get(templateJsonModel.getRelationField()))); + } + } + } + if (StringUtil.isNotEmpty(feildValue)) { + //去除中括号以及双引号 + feildValue = feildValue.replaceAll(regEx, ""); + //获取远端数据 + Map a = new HashMap<>(); + ActionResult object = dataInterfaceService.infoToId(urlId, null, infoMap); + if (object.getData() != null && object.getData() instanceof DataInterfaceActionVo) { + DataInterfaceActionVo vo = (DataInterfaceActionVo) object.getData(); + List> dataList = (List>) vo.getData(); + //判断是否多选 + String[] feildValues = feildValue.split(","); + if (feildValues.length > 0) { + //转换的真实值 + StringBuilder feildVa = new StringBuilder(); + for (String feild : feildValues) { + for (Map data : dataList) { + if (String.valueOf(data.get(value)).equals(feild)) { + feildVa.append(data.get(label) + ","); + } + } + } + String finalValue; + if (StringUtil.isEmpty(feildVa) || feildVa.equals("")) { + finalValue = feildVa.toString(); + } else { + finalValue = feildVa.substring(0, feildVa.length() - 1); + } + return finalValue; + } + for (Map data : dataList) { + if (feildValue.equals(String.valueOf(data.get(value)))) { + return data.get(label).toString(); + } + return feildValue; + } + } + return feildValue; + } + return feildValue; + } + + /** + * 获取远端数据 + * + * @param urlId + * @param name + * @param id + * @param children + * @param feildValue + * @return + */ + public String getDynName(String urlId, String name, String id, String children, String feildValue, boolean mul) { + List result = new ArrayList<>(); + String sep = ","; + if (mul) { + sep = "/"; + } + if (StringUtil.isNotEmpty(feildValue)) { + Map a = new HashMap<>(); + ActionResult object = dataInterfaceService.infoToId(urlId, null, null); + List> dataList = (List>) object.getData(); +// if (actionVo.getData() instanceof List) { +// dataList = (List>) actionVo.getData(); +// } + JSONArray dataAll = JsonUtil.getListToJsonArray(dataList); + List> list = new ArrayList<>(); + treeToList(id, name, children, dataAll, list); + String value = feildValue.replaceAll("\\[", "").replaceAll("\\]", ""); + Map resultMap = new HashMap<>(); + list.stream().forEach(t -> { + resultMap.put(String.valueOf(t.get(id)), String.valueOf(t.get(name))); + }); + + if (feildValue.startsWith("[[")) { + String[][] fv = JsonUtil.getJsonToBean(feildValue, String[][].class); + StringJoiner f1 = new StringJoiner(","); + for (String[] f : fv) { + StringJoiner v1 = new StringJoiner("/"); + for (String v : f) { + v1.add(resultMap.get(v)); + } + f1.add(v1.toString()); + } + return f1.toString(); + } else if (feildValue.startsWith("[")) { + List fvs = JsonUtil.getJsonToList(feildValue, String.class); + return fvs.stream().map(m -> resultMap.get(m)).collect(Collectors.joining(sep)); + } else { + return resultMap.get(feildValue); + } + } + return feildValue; + } + + + /** + * 获取远端数据 + * + * @param urlId + * @param name + * @param id + * @param children + * @param feildValue + * @param mul 是否多选 + * @param isFullPath 全路径 + * @return + */ + public String getDynName(String urlId, String name, String id, String children, String feildValue, boolean mul, boolean isFullPath, String json, int num, Map dataAll1) { + List list = JsonUtil.getJsonToList(json, TemplateJsonModel.class); + Map infoMap = list.size() > 0 ? new HashMap<>() : null; + for (TemplateJsonModel templateJsonModel : list) { + if (StringUtil.isNotEmpty(templateJsonModel.getRelationField())) { + String[] mastTable = templateJsonModel.getRelationField().split("_jnpf_"); + String[] child = templateJsonModel.getRelationField().split("-"); + if (mastTable.length > 1) { + if (dataAll1.get(mastTable[0]) instanceof Map) { + Map mastTableData = (Map) dataAll1.get(mastTable[0]); + infoMap.put(templateJsonModel.getField(), String.valueOf(mastTableData.get(mastTable[1]))); + } + } else if (child.length > 1) { + if (dataAll1.get(child[0]) instanceof List) { + List> chidList = (List>) dataAll1.get(child[0]); + for (int i = 0; i < chidList.size(); i++) { + Map objectMap = chidList.get(i); + if (i == num) { + infoMap.put(templateJsonModel.getField(), String.valueOf(objectMap.get(child[1]))); + } + } + } + } else { + infoMap.put(templateJsonModel.getField(), String.valueOf(dataAll1.get(templateJsonModel.getRelationField()))); + } + } + } + + if (StringUtil.isNotEmpty(feildValue)) { + Map a = new HashMap<>(); + ActionResult data = dataInterfaceService.infoToId(urlId, null, infoMap); + List> dataList = (List>) data.getData(); + JSONArray dataAll = JsonUtil.getListToJsonArray(dataList); + List> datalist = new ArrayList<>(); + treeToList(id, name, children, dataAll, datalist); + String value = feildValue.replaceAll("\\[", "").replaceAll("\\]", ""); + Map resultMap = new HashMap<>(); + datalist.stream().forEach(t -> { + resultMap.put(String.valueOf(t.get(id)), String.valueOf(t.get(name))); + }); + Object dataConversion = FormPublicUtils.getDataConversion(resultMap, feildValue, mul, "/"); + feildValue = String.valueOf(dataConversion); + } + return feildValue; + } + + /** + * 树转成list + **/ + private void treeToList(String id, String fullName, String children, JSONArray data, List> result) { + if (data != null) { + for (int i = 0; i < data.size(); i++) { + JSONObject ob = data.getJSONObject(i); + Map tree = new HashMap<>(16); + tree.put(id, String.valueOf(ob.get(id))); + tree.put(fullName, String.valueOf(ob.get(fullName))); + result.add(tree); + if (ob.get(children) != null) { + JSONArray childArray = ob.getJSONArray(children); + treeToList(id, fullName, children, childArray, result); + } + } + } + } + + /** + * 生成单据规则 + * + * @param encode + * @param isCache + * @return + * @throws DataException + */ + public String getBillNumber(String encode, Boolean isCache) throws DataException { + return billRuleService.getBillNumber(encode, isCache); + } + + /** + * 功能流程 获取可视化实体 + * + * @param visualId + * @return + */ + public VisualdevEntity getVisualEntity(String visualId) { + VisualdevEntity info = visualdevService.getInfo(visualId); + if (info != null) { + return info; + } + return new VisualdevEntity(); + } + + public UserEntity getUser(String userId) { + return userService.getInfo(userId); + } + + /** + * 获取流程任务 + * + * @param id + * @param columns + * @return + */ + public FlowTaskEntity getInfoSubmit(String id, SFunction... columns) { + return flowTaskService.getInfoSubmit(id, columns); + } + + public void deleteFlowTask(FlowTaskEntity flowTaskEntity) throws WorkFlowException { + flowTaskService.delete(flowTaskEntity); + } + + public void hasFlowTemplate(String flowId) throws WorkFlowException { + boolean hasFlow = StringUtil.isEmpty(flowId); + if (hasFlow) { + throw new WorkFlowException("该功能未配置流程不可用"); + } + FlowTemplateJsonEntity info = flowTemplateJsonService.getInfo(flowId); + } + + public String getGroupSelect(String groupIds) { + if (StringUtil.isEmpty(groupIds)) { + return groupIds; + } + List swapList = new ArrayList<>(); + if (groupIds.contains("[")) { + List groups = JsonUtil.getJsonToList(groupIds, String.class); + for (String g : groups) { + GroupEntity info = groupService.getInfo(g); + String s = info != null ? info.getFullName() : ""; + swapList.add(s); + } + } else { + GroupEntity info = groupService.getInfo(groupIds); + swapList.add(info != null ? info.getFullName() : ""); + } + return swapList.stream().collect(Collectors.joining(",")); + } + + public String getRoleSelect(String roleIds) { + if (StringUtil.isEmpty(roleIds)) { + return roleIds; + } + List swapList = new ArrayList<>(); + if (roleIds.contains("[")) { + List groups = JsonUtil.getJsonToList(roleIds, String.class); + for (String g : groups) { + RoleEntity info = roleService.getInfo(g); + String s = info != null ? info.getFullName() : ""; + swapList.add(s); + } + } else { + RoleEntity info = roleService.getInfo(roleIds); + swapList.add(info != null ? info.getFullName() : ""); + } + return swapList.stream().collect(Collectors.joining(",")); + } + + + /** + * 高级查询 + * + * @param conditionModel + * @param entity + * @param num + * @return + */ + public Integer getCondition(SuperQueryConditionModel conditionModel, Object entity, int num) { + QueryWrapper queryWrapper = conditionModel.getObj(); + List queryConditionModels = conditionModel.getConditionList(); + String op = conditionModel.getMatchLogic(); + String tableName = conditionModel.getTableName(); + List useCondition = new ArrayList<>(); + for (ConditionJsonModel queryConditionModel : queryConditionModels) { + if (queryConditionModel.getTableName().equalsIgnoreCase(tableName)) { + if (queryConditionModel.getField().contains("jnpf")) { + String child = queryConditionModel.getField(); + String s1 = child.substring(child.lastIndexOf("jnpf_")).replace("jnpf_", ""); + queryConditionModel.setField(s1); + } + if (queryConditionModel.getField().startsWith("tableField")) { + String child = queryConditionModel.getField(); + String s1 = child.substring(child.indexOf("-") + 1); + queryConditionModel.setField(s1); + } + useCondition.add(queryConditionModel); + } + } + + if (queryConditionModels.size() < 1 || useCondition.size() < 1) { + return num; + } + if (useCondition.size() > 0) { + num += 1; + } + //处理控件 转换为有效值 + for (ConditionJsonModel queryConditionModel : useCondition) { + String jnpfKey = queryConditionModel.getJnpfKey(); + String fieldValue = queryConditionModel.getFieldValue(); + if (StringUtil.isEmpty(fieldValue)) { + if (jnpfKey.equals(JnpfKeyConsts.CASCADER) || jnpfKey.equals(JnpfKeyConsts.CHECKBOX) || jnpfKey.equals(JnpfKeyConsts.COMSELECT) || jnpfKey.equals(JnpfKeyConsts.ADDRESS)) { + queryConditionModel.setFieldValue("[]"); + } else { + queryConditionModel.setFieldValue(""); + } + if (queryConditionModel.getSymbol().equals("like")) { + queryConditionModel.setSymbol("=="); + } else if (queryConditionModel.getSymbol().equals("notLike")) { + queryConditionModel.setSymbol("<>"); + } + } + if (jnpfKey.equals(JnpfKeyConsts.DATE)) { + String startTime = ""; + if (StringUtil.isNotEmpty(fieldValue)) { + Long o1 = Long.valueOf(fieldValue); + startTime = DateUtil.daFormatHHMMSS(o1); + } + queryConditionModel.setFieldValue(startTime); + } else if (jnpfKey.equals(JnpfKeyConsts.CREATETIME) || jnpfKey.equals(JnpfKeyConsts.MODIFYTIME)) { + String startTime = ""; + if (StringUtil.isNotEmpty(fieldValue)) { + Long o1 = Long.valueOf(fieldValue); + startTime = DateUtil.daFormatHHMMSS(o1); + } + queryConditionModel.setFieldValue(startTime); + } + } + //反射获取数据库实际字段 + Class aClass = entity.getClass(); + + queryWrapper.and(tw -> { + for (ConditionJsonModel conditionJsonModel : useCondition) { + String conditionField = conditionJsonModel.getField(); + String jnpfKey = conditionJsonModel.getJnpfKey(); + Field declaredField = null; + try { + declaredField = aClass.getDeclaredField(conditionField); + } catch (NoSuchFieldException e) { + e.printStackTrace(); + } + declaredField.setAccessible(true); + String field = declaredField.getAnnotation(TableField.class).value(); + String fieldValue = conditionJsonModel.getFieldValue(); + String symbol = conditionJsonModel.getSymbol(); + if ("AND".equalsIgnoreCase(op)) { + if (symbol.equals("==")) { + tw.and(qw -> { + List multJnpf = new ArrayList() {{ + add(JnpfKeyConsts.CASCADER); + add(JnpfKeyConsts.COMSELECT); + add(JnpfKeyConsts.ADDRESS); + add(JnpfKeyConsts.SELECT); + add(JnpfKeyConsts.TREESELECT); + }}; + if (JnpfKeyConsts.CHECKBOX.equals(jnpfKey) || (multJnpf.contains(jnpfKey) && conditionJsonModel.isFormMultiple())) { + //todo 多选,高级查询只选一个,需要拼成数组查询,其他控件目前没发现,后续添加至此 + String eavalue = ""; + if (fieldValue.contains("[")) { + eavalue = "[" + fieldValue + "]"; + } else { + JSONArray jarr = new JSONArray(); + jarr.add(fieldValue); + eavalue = jarr.toJSONString(); + } + qw.eq(field, eavalue); + } else if (!jnpfKey.equals(JnpfKeyConsts.NUM_INPUT) && !jnpfKey.equals(JnpfKeyConsts.CALCULATE)) { + qw.eq(field, fieldValue); + } else { + if (StringUtil.isNotEmpty(fieldValue)) { + qw.eq(field, fieldValue); + } + } + if (StringUtil.isEmpty(fieldValue)) { + qw.or( + ew -> ew.isNull(field) + ); + } + } + ); + } else if (symbol.equals(">=")) { + tw.ge(field, fieldValue); + } else if (symbol.equals("<=")) { + tw.and(ew -> { + ew.le(field, fieldValue); + ew.and( + qw -> qw.ne(field, "") + ); + }); + } else if (symbol.equals(">")) { + tw.gt(field, fieldValue); + } else if (symbol.equals("<")) { + tw.and(ew -> { + ew.lt(field, fieldValue); + ew.and( + qw -> qw.ne(field, "") + ); + }); + } else if (symbol.equals("<>")) { + tw.and(ew -> { + ew.ne(field, fieldValue); + if (StringUtil.isNotEmpty(fieldValue)) { + ew.or( + qw -> qw.isNull(field) + ); + } else { + ew.and( + qw -> qw.isNotNull(field) + ); + } + }); + } else if (symbol.equals("like")) { + tw.and(ew -> { + if (StringUtil.isNotEmpty(fieldValue)) { + ew.like(field, fieldValue); + } else { + ew.isNull(field); + } + }); + } else if (symbol.equals("notLike")) { + tw.and(ew -> { + if (StringUtil.isNotEmpty(fieldValue)) { + ew.notLike(field, fieldValue); + ew.or( + qw -> qw.isNull(field) + ); + } else { + ew.isNotNull(field); + } + }); + } + } else { + if (symbol.equals("==")) { + tw.or( + qw -> qw.eq(field, fieldValue) + ); + } else if (symbol.equals(">=")) { + tw.or( + qw -> qw.ge(field, fieldValue) + ); + } else if (symbol.equals("<=")) { + tw.or( + qw -> qw.le(field, fieldValue) + ); + } else if (symbol.equals(">")) { + tw.or( + qw -> qw.gt(field, fieldValue) + ); + } else if (symbol.equals("<")) { + tw.or( + qw -> qw.lt(field, fieldValue) + ); + } else if (symbol.equals("<>")) { + tw.or( + qw -> qw.ne(field, fieldValue) + ); + if (StringUtil.isNotEmpty(fieldValue)) { + tw.or( + qw -> qw.isNull(field) + ); + } + } else if (symbol.equals("like")) { + if (StringUtil.isNotEmpty(fieldValue)) { + tw.or( + qw -> qw.like(field, fieldValue) + ); + } else { + tw.or( + qw -> qw.isNull(field) + ); + } + } else if (symbol.equals("notLike")) { + if (StringUtil.isNotEmpty(fieldValue)) { + tw.or( + qw -> qw.notLike(field, fieldValue) + ); + tw.or( + qw -> qw.isNull(field) + ); + } else { + tw.or( + qw -> qw.isNotNull(field) + ); + } + } + } + } + }); + return num; + } + + public List getIntersection(List> lists) { + if (lists == null || lists.size() == 0) { + return new ArrayList<>(); + } + ArrayList> arrayList = new ArrayList<>(lists); + for (int i = 0; i < arrayList.size(); i++) { + List list = arrayList.get(i); + if (list == null || list.size() == 0) { + return new ArrayList<>(); + } + } + List intersection = arrayList.get(0); + for (int i = 0; i < arrayList.size(); i++) { + List list = arrayList.get(i); + intersection.retainAll(arrayList.get(i)); + } + return intersection; + } + + public Map putCache(Map localCache) { + //读取系统控件 所需编码 id + Map depMap = organizeService.getOrgEncodeAndName("department"); + localCache.put("_dep_map", depMap); + Map comMap = organizeService.getOrgNameAndId(""); + localCache.put("_com_map", comMap); + Map posMap = positionService.getPosEncodeAndName(); + localCache.put("_pos_map", posMap); + Map userMap = userService.getUserNameAndIdMap(); + localCache.put("_user_map", userMap); + Map roleMap = roleService.getRoleNameAndIdMap(); + localCache.put("_role_map", roleMap); + Map groupMap = groupService.getGroupEncodeMap(); + localCache.put("_group_map", groupMap); + return localCache; + } + + + /** + * 时间是否在范围内 + * + * @param jnpfField + * @param parse + * @return + */ + private boolean timeInRange(JnpfField jnpfField, Date parse) { + boolean flag = true; + if (StringUtil.isNotEmpty(jnpfField.startTime())) { + Long startTime = Long.parseLong(jnpfField.startTime()); + flag = parse.after(new Date(startTime)); + } + if (flag && StringUtil.isNotEmpty(jnpfField.endTime())) { + Long endTime = Long.parseLong(jnpfField.endTime()); + flag = parse.before(new Date(endTime)); + } + return flag; + } + + public String excelCheckForm(JnpfField jnpfField, String value, Map insMap, Map localCache, StringJoiner errorInfo) throws Exception { + String jnpfKey = jnpfField.jnpfKey(); + String label = jnpfField.label(); + String vModel = jnpfField.vModel(); + if (value == null || "null".equals(value) || StringUtil.isEmpty(value)) { + return null; + } + + boolean multiple = jnpfField.multiple(); + if (JnpfKeyConsts.CHECKBOX.equals(jnpfKey)) { + multiple = true; + } + + boolean isCascaer = JnpfKeyConsts.CASCADER.equals(jnpfKey); + /** + * 数据接口 + */ + if (StringUtil.isNotEmpty(jnpfField.dataType())) { + List> options = new ArrayList<>(); + String dataLabel = jnpfField.dataLabel(); + String dataValue = jnpfField.dataValue(); + String children = jnpfField.dataChildren(); + String localCacheKey; + Map dataInterfaceMap = new HashMap<>(); + List dicSplict = Arrays.asList(value.split(",")); + if (!multiple) { + if (dicSplict.size() > 1) { + errorInfo.add(label + "非多选"); + } + } + //静态数据 + if (jnpfField.dataType().equals(OnlineDataTypeEnum.STATIC.getType())) { + localCacheKey = String.format("%s-%s", jnpfField.vModel(), OnlineDataTypeEnum.STATIC.getType()); + if (!localCache.containsKey(localCacheKey)) { + if (StringUtil.isNotEmpty(jnpfField.options())) { + options = JsonUtil.getJsonToListMap(jnpfField.options()); + String Children = jnpfField.dataChildren(); + JSONArray staticData = JsonUtil.getListToJsonArray(options); + getOptions(dataLabel, dataValue, Children, staticData, options); + } else { + options = JsonUtil.getJsonToListMap(jnpfField.options()); + } + Map finalDataInterfaceMap = new HashMap<>(16); + String finalDataLabel = dataLabel; + String finalDataValue = dataValue; + options.stream().forEach(o -> { + finalDataInterfaceMap.put(String.valueOf(o.get(finalDataLabel)), o.get(finalDataValue)); + }); + localCache.put(localCacheKey, finalDataInterfaceMap); + dataInterfaceMap = finalDataInterfaceMap; + } else { + dataInterfaceMap = (Map) localCache.get(localCacheKey); + } + swapDataUtils.checkFormDataInteface(multiple, insMap, vModel, label, dataInterfaceMap, dicSplict, errorInfo, isCascaer); + //远端数据 + } else if (jnpfField.dataType().equals(OnlineDataTypeEnum.DYNAMIC.getType())) { + localCacheKey = String.format("%s-%s-%s-%s", OnlineDataTypeEnum.DYNAMIC.getType(), jnpfField.propsUrl(), dataValue, dataLabel); + if (!localCache.containsKey(localCacheKey)) { + ActionResult actionResult = dataInterfaceService.infoToId(jnpfField.propsUrl(), null, null); + if (actionResult != null && actionResult.getData() != null) { + List> dycDataList = new ArrayList<>(); + if (actionResult.getData() instanceof List) { + dycDataList = (List>) actionResult.getData(); + } + JSONArray dataAll = JsonUtil.getListToJsonArray(dycDataList); + String finalDataLabel2 = dataLabel; + String finalDataValue1 = dataValue; + treeToList(finalDataLabel2, finalDataValue1, children, dataAll, options); + Map finalDataInterfaceMap1 = new HashMap<>(16); + + options.stream().forEach(o -> { + finalDataInterfaceMap1.put(String.valueOf(o.get(finalDataLabel2)), o.get(finalDataValue1)); + }); + dataInterfaceMap = finalDataInterfaceMap1; + localCache.put(localCacheKey, dataInterfaceMap); + } + } else { + dataInterfaceMap = (Map) localCache.get(localCacheKey); + } + swapDataUtils.checkFormDataInteface(multiple, insMap, vModel, label, dataInterfaceMap, dicSplict, errorInfo, isCascaer); + //数据字典 + } else if (jnpfField.dataType().equals(OnlineDataTypeEnum.DICTIONARY.getType())) { + localCacheKey = String.format("%s-%s", OnlineDataTypeEnum.DICTIONARY.getType(), jnpfField.dictionaryType()); + dataLabel = jnpfField.dataLabel(); + dataValue = jnpfField.dataValue(); + if (!localCache.containsKey(localCacheKey)) { + List list = dictionaryDataService.getDicList(jnpfField.dictionaryType()); + options = list.stream().map(dic -> { + Map dictionaryMap = new HashMap<>(16); + dictionaryMap.put("id", dic.getId()); + dictionaryMap.put("enCode", dic.getEnCode()); + dictionaryMap.put("fullName", dic.getFullName()); + return dictionaryMap; + }).collect(Collectors.toList()); + localCache.put(localCacheKey, options); + } else { + options = (List>) localCache.get(localCacheKey); + } + Map finalDataInterfaceMap1 = new HashMap<>(16); + String finalDataLabel3 = dataLabel; + String finalDataValue3 = dataValue; + options.stream().forEach(o -> finalDataInterfaceMap1.put(String.valueOf(o.get(finalDataLabel3)), o.get(finalDataValue3))); + swapDataUtils.checkFormDataInteface(multiple, insMap, vModel, label, finalDataInterfaceMap1, dicSplict, errorInfo, isCascaer); + } + } + return errorInfo != null ? errorInfo.toString() : null; + } + + private List checkOptionsControl(boolean multiple, Map insMap, String vModel, String label, Map cacheMap, List valueList, StringJoiner errInfo) { + boolean error = false; + if (!multiple) { + //非多选填入多选值 + if (valueList.size() > 1) { + error = true; + errInfo.add(label + "非多选"); + } + } + List dataList = new ArrayList<>(); + if (!error) { + boolean errorHapen = false; + for (String va : valueList) { + Object vo = cacheMap.get(va); + if (vo == null) { + errorHapen = true; + } else { + dataList.add(vo.toString()); + } + + } + if (errorHapen) { + errInfo.add(label + "值不正确"); + } else { + insMap.put(vModel, !multiple ? dataList.get(0) : JsonUtil.getObjectToString(dataList)); + } + } + return dataList; + } + + /** + * 递归查询 + * + * @param label + * @param value + * @param Children + * @param data + * @param options + */ + public static void getOptions(String label, String value, String Children, JSONArray data, List> options) { + for (int i = 0; i < data.size(); i++) { + JSONObject ob = data.getJSONObject(i); + Map tree = new HashMap<>(16); + tree.put(value, String.valueOf(ob.get(value))); + tree.put(label, String.valueOf(ob.get(label))); + options.add(tree); + if (ob.get(Children) != null) { + JSONArray childrenArray = ob.getJSONArray(Children); + getOptions(label, value, Children, childrenArray, options); + } + } + } + + /** + * 获取用户主件查询条件 + * + * @param value + * @return + */ + public List usersSelectQuery(String value) { + List userSList = new ArrayList<>(); + String userValue = value.substring(0, value.indexOf("--")); + UserEntity userEntity = userService.getInfo(userValue); + if (userEntity != null) { + //在用户关系表中取出 + List groupRel = Optional.ofNullable(userRelationService.getListByObjectType(userValue, PermissionConst.GROUP)).orElse(new ArrayList<>()); + List orgRel = Optional.ofNullable(userRelationService.getListByObjectType(userValue, PermissionConst.ORGANIZE)).orElse(new ArrayList<>()); + List posRel = Optional.ofNullable(userRelationService.getListByObjectType(userValue, PermissionConst.POSITION)).orElse(new ArrayList<>()); + List roleRel = Optional.ofNullable(userRelationService.getListByObjectType(userValue, PermissionConst.ROLE)).orElse(new ArrayList<>()); + + if (groupRel.size() > 0) { + for (UserRelationEntity split : groupRel) { + userSList.add(split.getObjectId()); + } + } + if (StringUtil.isNotEmpty(userEntity.getOrganizeId())) { + //向上递归 查出所有上级组织 + List allUpOrgIDs = new ArrayList<>(); + organizeService.upWardRecursion(allUpOrgIDs, userEntity.getOrganizeId()); + for (String orgID : allUpOrgIDs) { + userSList.add(orgID); + } + } + if (posRel.size() > 0) { + for (UserRelationEntity split : posRel) { + userSList.add(split.getObjectId()); + } + } + if (roleRel.size() > 0) { + for (UserRelationEntity split : roleRel) { + userSList.add(split.getObjectId()); + } + } + return userSList; + } else { + return null; + } + } + + /** + * 获取用户主件查询条件(多选) + * + * @param values + * @return + */ + public List usersSelectQuery(List values) { + List userSList = new ArrayList<>(); + for (String value : values) { + String userValue = value.substring(0, value.indexOf("--")); + UserEntity userEntity = userService.getInfo(userValue); + if (userEntity != null) { + //在用户关系表中取出 + List groupRel = Optional.ofNullable(userRelationService.getListByObjectType(userValue, PermissionConst.GROUP)).orElse(new ArrayList<>()); + List orgRel = Optional.ofNullable(userRelationService.getListByObjectType(userValue, PermissionConst.ORGANIZE)).orElse(new ArrayList<>()); + List posRel = Optional.ofNullable(userRelationService.getListByObjectType(userValue, PermissionConst.POSITION)).orElse(new ArrayList<>()); + List roleRel = Optional.ofNullable(userRelationService.getListByObjectType(userValue, PermissionConst.ROLE)).orElse(new ArrayList<>()); + + if (groupRel.size() > 0) { + for (UserRelationEntity split : groupRel) { + userSList.add(split.getObjectId()); + } + } + if (StringUtil.isNotEmpty(userEntity.getOrganizeId())) { + //向上递归 查出所有上级组织 + List allUpOrgIDs = new ArrayList<>(); + organizeService.upWardRecursion(allUpOrgIDs, userEntity.getOrganizeId()); + for (String orgID : allUpOrgIDs) { + userSList.add(orgID); + } + } + if (posRel.size() > 0) { + for (UserRelationEntity split : posRel) { + userSList.add(split.getObjectId()); + } + } + if (roleRel.size() > 0) { + for (UserRelationEntity split : roleRel) { + userSList.add(split.getObjectId()); + } + } + } + } + return userSList; + } + + @DS("") + public List getFilterCondition(String id) { + return filterService.getCondition(id); + } + + public static List convertToList(Object obj) { + return OnlineSwapDataUtils.convertToList(obj); + } + + public static String convertValueToString(String obj, boolean mult, boolean isOrg) { + return OnlineSwapDataUtils.convertValueToString(obj, mult, isOrg); + } + + /** + * 获取数据连接 + * + * @param dbLink + * @return + */ + public DbLinkEntity getDataSource(String dbLink) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DbLinkEntity::getFullName, dbLink); + return dblinkService.getOne(queryWrapper); + } + + + /** + * 静态数据转换 + * + * @param param 需要转换的值 + * @param options 静态数据模型 + * @param key label key-value编码对应 + * @param multiple 是否多选 + * @return 转换后的值 + */ + public static String selectStaitcSwap(String param, String options, String key, String label, boolean multiple) { + List textList = new ArrayList<>(); + List optionsList = JsonUtil.getJsonToList(options, Map.class); + if (multiple) { + List jsonToList = JsonUtil.getJsonToList(param, String.class); + for (String list1 : jsonToList) { + if (list1.contains("[")) { + List textList2 = new ArrayList<>(); + List jsonToList2 = JsonUtil.getJsonToList(list1, String.class); + for (String str : jsonToList2) { + textList2.add(loop(optionsList, str, key, label)); + } + textList.add(String.join("/", textList2)); + } else { + textList.add(loop(optionsList, list1, key, label)); + } + } + } else { + if (param.contains("[")) { + List textList2 = new ArrayList<>(); + List jsonToList = JsonUtil.getJsonToList(param, String.class); + for (String str : jsonToList) { + textList2.add(loop(optionsList, str, key, label)); + } + textList.add(String.join("/", textList2)); + } else { + textList.add(loop(optionsList, param, key, label)); + } + } + return String.join(",", textList); + } + + public static String loop(List options, String oneData, String key, String label) { + for (int i = 0; i < options.size(); i++) { + if (options.get(i).get(key).equals(oneData)) { + return options.get(i).get(label).toString(); + } else if (options.get(i).get("children") != null) { + List children = JsonUtil.getJsonToList(options.get(i).get("children"), Map.class); + String loop = loop(children, oneData, key, label); + if (loop != null) { + return loop; + } + } + } + return null; + } + + /** + * 功能表单获取流程信息-导入绑定多流程的第一个 + * + * @param formId + * @return + * @throws WorkFlowException + */ + public String getFlowTempJsonId(String formId) throws WorkFlowException { + String flowTemjsonId = ""; + FlowFormEntity form = flowFormService.getById(formId); + if (form == null || StringUtil.isEmpty(form.getFlowId())) { + throw new WorkFlowException("该功能未配置流程不可用"); + } + FlowTemplateInfoVO vo = flowTemplateService.info(form.getFlowId()); + if (vo == null || StringUtil.isEmpty(vo.getFlowTemplateJson()) || "[]".equals(vo.getFlowTemplateJson())) { + throw new WorkFlowException("流程未设计!"); + } + List collect = JsonUtil.getJsonToList(vo.getFlowTemplateJson(), FlowJsonModel.class); + flowTemjsonId = collect.get(0).getId(); + return flowTemjsonId; + } + + + /** + * 输入时表单时间字段根据格式转换去尾巴 + * + * @param form + */ + public static void swapDatetime(Object form) { + Field[] declaredFields = form.getClass().getDeclaredFields(); + for (Field f : declaredFields) { + try { + //副表处理 + if (f.getType().getName().startsWith("jnpf.model")) { + if (!f.isAccessible()) { + f.setAccessible(true); + } + Object o = f.get(form); + if (o == null) { + continue; + } + swapDatetime(o); + f.set(form, o); + continue; + } + //子表处理 + if (List.class.isAssignableFrom(f.getType())) { + Type type = f.getGenericType(); + if (type instanceof ParameterizedType) { + if (!f.isAccessible()) { + f.setAccessible(true); + } + List list = getList(f, f.get(form)); + for (Object o : list) { + swapDatetime(o); + } + if (list.size() > 0) { + f.set(form, list); + } + } + continue; + } + //主表处理 + if (f.getAnnotation(JnpfField.class) == null) continue; + JnpfField annotation = f.getAnnotation(JnpfField.class); + if (!"date".equals(annotation.jnpfKey()) || StringUtil.isEmpty(annotation.format())) continue; + String format = annotation.format(); + f.setAccessible(true); + if (f.get(form) != null && Long.parseLong(String.valueOf(f.get(form))) > 0) { + Date date = new Date(Long.parseLong(String.valueOf(f.get(form)))); + String completionStr = ""; + switch (format) { + case "yyyy": + completionStr = "-01-01 00:00:00"; + break; + case "yyyy-MM": + completionStr = "-01 00:00:00"; + break; + case "yyyy-MM-dd": + completionStr = " 00:00:00"; + break; + case "yyyy-MM-dd HH": + completionStr = ":00:00"; + break; + case "yyyy-MM-dd HH:mm": + completionStr = ":00"; + break; + default: + break; + } + String datestr = DateUtil.dateToString(date, format); + long time = DateUtil.stringToDate(datestr + completionStr).getTime(); + f.set(form, String.valueOf(time)); + } + + } catch (Exception e) { + e.printStackTrace(); + } + } + + } + + public static List getList(Field field, Object object) { + List resultList = new ArrayList<>(); + if (object != null) { + try { + Class clzz = object.getClass(); + //反射调用获取到list的size方法来获取到集合的大小 + Method sizeMethod = clzz.getDeclaredMethod("size"); + if (!sizeMethod.isAccessible()) { + sizeMethod.setAccessible(true); + } + //集合长度 + int size = (int) sizeMethod.invoke(object); + //循环遍历获取到数据 + for (int i = 0; i < size; i++) { + //反射获取到list的get方法 + Method getMethod = clzz.getDeclaredMethod("get", int.class); + //调用get方法获取数据 + if (!getMethod.isAccessible()) { + getMethod.setAccessible(true); + } + Object invoke = getMethod.invoke(object, i); + resultList.add(invoke); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + return resultList; + + } + + /** + * 小数转换带上0 + * + * @param decimalValue + */ + public static String getDecimalStr(Object decimalValue) { + if (decimalValue instanceof BigDecimal) { + BigDecimal bd = (BigDecimal) decimalValue; + return bd.toPlainString(); + } + return String.valueOf(decimalValue); + } + + /** + * 获取当前组织完整路径 + * + * @param orgId + * @return + */ + public String getCurrentOrgIds(String orgId, String showLevel) { + return flowFormDataUtil.getCurrentOrgIds(orgId, showLevel); + } + + /** + * 获取当前组织名称(all-显示组织名,else 显示部门名) + * + * @param value + * @param showLevel + * @return + */ + public String getCurrentOrganizeName(Object value, String showLevel) { + return flowFormDataUtil.getCurrentOrganizeName(value, showLevel); + } + + /* ****************以下vue3转换信息****************** */ + + /** + * 通过副表名取副表数据map + * + * @param data + * @param tableName + */ + public static Map getMastTabelData(Object data, String tableName) { + Map map = JsonUtil.entityToMap(data); + Map mapRes = new HashMap<>(); + for (String key : map.keySet()) { + String[] jnpf_s = key.split("_jnpf_"); + if (jnpf_s.length == 2 && jnpf_s[0].contains(tableName)) { + mapRes.put(jnpf_s[1], map.get(key)); + } + } + return mapRes; + } + + + /** + * List数据转换 + * + * @param realList + * @param formDataStr + * @return + */ + public List> swapDataList(List> realList, String formDataStr, String columnDataStr, String moduleId, boolean inlineEdit) { + FormDataModel formDataModel = JsonUtil.getJsonToBean(formDataStr, FormDataModel.class); + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnDataStr, ColumnDataModel.class); + List fieLdsModels = JsonUtil.getJsonToList(formDataModel.getFields(), FieLdsModel.class); + List fields = new ArrayList<>(); + OnlinePublicUtils.recursionFields(fields, fieLdsModels); + //树形-添加父级字段+_id + if (OnlineDevData.TYPE_FIVE_COLUMNDATA.equals(columnDataModel.getType())) { + realList.forEach(item -> { + item.put(columnDataModel.getParentField() + "_id", item.get(columnDataModel.getParentField())); + }); + } + //数据转换 + realList = swapDataUtils.getSwapList(realList, fields, moduleId, inlineEdit, new ArrayList<>()); + return realList; + } + + /** + * List数据转树形和分组 + * + * @param realList + * @param columnDataStr + * @return + */ + public List> swapDataList(List> realList, String columnDataStr, String subField) { + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnDataStr, ColumnDataModel.class); + //判断数据是否分组 + if (OnlineDevData.TYPE_THREE_COLUMNDATA.equals(columnDataModel.getType())) { + realList = OnlineDevListUtils.groupData(realList, columnDataModel); + } + //树形列表 + if (OnlineDevData.TYPE_FIVE_COLUMNDATA.equals(columnDataModel.getType())) { + columnDataModel.setSubField(subField); + realList = OnlineDevListUtils.treeListData(realList, columnDataModel); + } + return realList; + } + + /** + * 编辑form数据转换 + * + * @param dataMap + * @param formDataStr + * @return + */ + public Map swapDataForm(Map dataMap, String formDataStr, Map tableField, Map tableRename) { + FormDataModel formDataModel = JsonUtil.getJsonToBean(formDataStr, FormDataModel.class); + List fieLdsModels = JsonUtil.getJsonToList(formDataModel.getFields(), FieLdsModel.class); + List fields = new ArrayList<>(); + OnlinePublicUtils.recursionFields(fields, fieLdsModels); + //数据转换 + return this.swapDataForm(dataMap, fields, null, tableField, tableRename); + } + + private Map swapDataForm(Map dataMap, List fields, Map mainMap + , Map tableField, Map tableRename) { + if (dataMap == null || dataMap.isEmpty()) return new HashMap<>(); + for (FieLdsModel item : fields) { + String jnpfKey = item.getConfig().getJnpfKey(); + String vModel = item.getVModel(); + String dataType = item.getConfig().getDataType(); + Boolean isMultiple = Objects.nonNull(item.getMultiple()) ? item.getMultiple() : false; + List systemConditions = new ArrayList() {{ + add(JnpfKeyConsts.CURRORGANIZE); + add(JnpfKeyConsts.CURRDEPT); + add(JnpfKeyConsts.CURRPOSITION); + }}; + //多选二维数组 + List multTow = new ArrayList() {{ + add(JnpfKeyConsts.CASCADER); + add(JnpfKeyConsts.CHECKBOX); + add(JnpfKeyConsts.ADDRESS); + add(JnpfKeyConsts.COMSELECT); + }}; + //一维维数组 + List multOne = new ArrayList() {{ + add(JnpfKeyConsts.CHECKBOX); + }}; + if (Objects.nonNull(dataMap.get(vModel))) { + if (multTow.contains(jnpfKey) && isMultiple) { + //二维数据转换 + dataMap.replace(vModel, JSONObject.parseArray(dataMap.get(vModel).toString(), List.class)); + } else if (multTow.contains(jnpfKey) || isMultiple || multOne.contains(jnpfKey)) { + //一维数据转换 + dataMap.replace(vModel, JSONObject.parseArray(dataMap.get(vModel).toString(), String.class)); + } + } else if (!JnpfKeyConsts.CHILD_TABLE.equals(jnpfKey)) { + if(systemConditions.contains(jnpfKey)){ + dataMap.put(vModel, " "); + } + continue; + } + switch (jnpfKey) { + case JnpfKeyConsts.RATE: + BigDecimal value = new BigDecimal(0); + if (dataMap.get(vModel) != null) { + value = new BigDecimal(dataMap.get(vModel).toString()); + } + dataMap.put(vModel, value); + break; + case JnpfKeyConsts.SWITCH: + case JnpfKeyConsts.SLIDER: + dataMap.put(vModel, dataMap.get(vModel) != null ? Integer.parseInt(String.valueOf(dataMap.get(vModel))) : null); + break; + case JnpfKeyConsts.DATE: + Long dateTime = DateTimeFormatConstant.getDateObjToLong(dataMap.get(vModel)); + dataMap.put(vModel, dateTime != null ? dateTime : dataMap.get(vModel)); + break; + //编辑是的系统控件转换 + case JnpfKeyConsts.CURRORGANIZE: + case JnpfKeyConsts.CURRDEPT: + dataMap.put(vModel,this.getCurrentOrganizeName(dataMap.get(vModel),item.getShowLevel())); + break; + case JnpfKeyConsts.CREATEUSER: + case JnpfKeyConsts.MODIFYUSER: + UserEntity userEntity = userService.getInfo(String.valueOf(dataMap.get(vModel))); + String userValue = Objects.nonNull(userEntity) ? userEntity.getAccount().equalsIgnoreCase("admin") + ? "管理员/admin" : userEntity.getRealName() + "/" + userEntity.getAccount() : String.valueOf(dataMap.get(vModel)); + dataMap.put(vModel, userValue); + break; + case JnpfKeyConsts.CURRPOSITION: + PositionEntity positionEntity = positionService.getInfo(String.valueOf(dataMap.get(vModel))); + dataMap.put(vModel, Objects.nonNull(positionEntity) ? positionEntity.getFullName() : " "); + break; + case JnpfKeyConsts.CREATETIME: + case JnpfKeyConsts.MODIFYTIME: + if (ObjectUtil.isNotEmpty(dataMap.get(vModel))) { + Long dateLong = Long.parseLong(String.valueOf(dataMap.get(vModel))); + String dateStr = DateUtil.dateFormat(new Date(dateLong)); + dataMap.put(vModel, dateStr); + } + break; + case JnpfKeyConsts.UPLOADFZ: + case JnpfKeyConsts.UPLOADIMG: + if (ObjectUtil.isNotEmpty(dataMap.get(vModel))) { + dataMap.put(vModel, JsonUtil.getJsonToListMap(dataMap.get(vModel).toString())); + } + break; + case JnpfKeyConsts.CHILD_TABLE: + List childrens = item.getConfig().getChildren(); + String childTableRename = ""; + try { + childTableRename = tableRename.get(tableField.get(vModel)); + } catch (Exception e) { + } + if (StringUtil.isNotEmpty(childTableRename)) { + vModel = childTableRename + "List"; + } + List> childList = (List>) dataMap.get(vModel); + if (CollectionUtils.isEmpty(childList)) break; + for (int i = 0; i < childList.size(); i++) { + Map childMap = childList.get(i); + childList.set(i, this.swapDataForm(childMap, childrens, dataMap, tableField, tableRename)); + } + dataMap.put(vModel, childList); + break; + default: + dataMap.put(vModel, dataMap.get(vModel)); + break; + } + } + return dataMap; + } + + + /** + * 详情Detail数据转换 + * + * @param map + * @param formDataStr + * @return + */ + public Map swapDataDetail(Map map, String formDataStr, String moduleId, boolean inlineEdit) { + FormDataModel formDataModel = JsonUtil.getJsonToBean(formDataStr, FormDataModel.class); + List fieLdsModels = JsonUtil.getJsonToList(formDataModel.getFields(), FieLdsModel.class); + List fields = new ArrayList<>(); + OnlinePublicUtils.recursionFields(fields, fieLdsModels); + //数据转换 + if (map != null) { + Map finalMap = map; + List> realList = new ArrayList() {{ + add(finalMap); + }}; + realList = swapDataUtils.getSwapList(realList, fields, moduleId, inlineEdit, new ArrayList<>()); + map = realList.get(0); + } + return map; + } + + /** + * 导入数据 + */ + public ExcelImportModel importData(String formData, List> dataList, ImportFormCheckUniqueModel uniqueModel, Map table, String tableListStr) throws WorkFlowException { + ExcelImportModel importModel = new ExcelImportModel(); + //读取系统控件 所需编码 id + Map localCache = putCache(); + List> failResult = new ArrayList<>(); + FormDataModel formDataModel = JsonUtil.getJsonToBean(formData, FormDataModel.class); + List fieLdsModelList = JsonUtil.getJsonToList(formDataModel.getFields(), FieLdsModel.class); + List allFieLds = new ArrayList<>(); + VisualUtils.recursionFields(fieLdsModelList, allFieLds); + uniqueModel.setMain(true); + uniqueModel.setPrimaryKeyPolicy(formDataModel.getPrimaryKeyPolicy()); + uniqueModel.setLogicalDelete(formDataModel.getLogicalDelete()); + uniqueModel.setMain(true); + uniqueModel.setTableModelList(JsonUtil.getJsonToList(tableListStr, TableModel.class)); + try { + for (Map data : dataList) { + Map resultMap = new HashMap<>(data); + StringJoiner errInfo = new StringJoiner(","); + Map errorMap = new HashMap<>(data); + boolean hasError = swapDataUtils.checkExcelData(allFieLds, data, localCache, resultMap, errInfo, errorMap, uniqueModel); + if (hasError) { + failResult.add(errorMap); + } else { + List importDataModel = uniqueModel.getImportDataModel(); + ImportDataModel model = new ImportDataModel(); + model.setId(uniqueModel.getId()); + Map> map = new HashMap<>(16); + Map tableMap = new HashMap<>(16); + for (Object key : resultMap.keySet().toArray()) { + if (table.get(key) != null) { + tableMap.put(table.get(key) + "List", resultMap.remove(key)); + } + } + resultMap.putAll(map); + resultMap.putAll(tableMap); + resultMap.put(FlowFormConstant.FLOWID, uniqueModel.getFlowId()); + model.setResultData(resultMap); + importDataModel.add(model); + } + } + } catch (Exception e) { + e.printStackTrace(); + throw new WorkFlowException("导入异常!"); + } + importModel.setFnum(failResult.size()); + importModel.setSnum(dataList.size() - failResult.size()); + importModel.setResultType(failResult.size() > 0 ? 1 : 0); + importModel.setFailResult(failResult); + return importModel; + } + + private Map putCache() { + Map localCache = putCache(new HashMap<>()); + + List idAll = new ArrayList<>(); + List org = new ArrayList() {{ + add(JnpfConst.CURRENT_ORG); + }}; + List orgList = organizeRelationApi.getOrgIds(org, null); + localCache.put("_org", orgList); + + List orgSub = new ArrayList() {{ + add(JnpfConst.CURRENT_ORG_SUB); + }}; + List orgSubList = organizeRelationApi.getOrgIds(orgSub, null); + localCache.put("_orgSub", orgSubList); + + List grade = new ArrayList() {{ + add(JnpfConst.CURRENT_GRADE); + }}; + List gradeList = organizeRelationApi.getOrgIds(grade, null); + localCache.put("_grade", gradeList); + + idAll.addAll(orgList); + idAll.addAll(orgSubList); + idAll.addAll(gradeList); + List relationList = organizeRelationApi.getRelationListByOrganizeId(idAll, ""); + localCache.put("_relation_List", relationList); + return localCache; + } + + public boolean checkExcelData(String formData, Map data, Map localCache, Map insMap, StringJoiner errInfo, + Map errorMap, String importType, String unionId, String dbLinkId, String tableListStr) throws Exception { + boolean hasError = false; + try { + FormDataModel formDataModel = JsonUtil.getJsonToBean(formData, FormDataModel.class); + List fieLdsModels = JsonUtil.getJsonToList(formDataModel.getFields(), FieLdsModel.class); + List allFieLds = new ArrayList<>(); + VisualUtils.recursionFields(fieLdsModels, allFieLds); + ImportFormCheckUniqueModel uniqueModel = new ImportFormCheckUniqueModel(); + uniqueModel.setMain(true); + uniqueModel.setUpdate(Objects.equals(importType, "2"));//1、仅新增数据-2、更新和新增数据 + uniqueModel.setPrimaryKeyPolicy(formDataModel.getPrimaryKeyPolicy()); + uniqueModel.setLogicalDelete(formDataModel.getLogicalDelete()); + DbLinkEntity linkEntity = dbLinkService.getInfo(dbLinkId); + DynamicDataSourceUtil.switchToDataSource(linkEntity); + @Cleanup Connection connection = DynamicDataSourceUtil.getCurrentConnection(); + uniqueModel.setConnection(connection); + hasError = swapDataUtils.checkExcelData(allFieLds, data, localCache, insMap, errInfo, errorMap, uniqueModel); + if (StringUtil.isNotEmpty(uniqueModel.getId())) { + unionId = uniqueModel.getId(); + } + } catch (Exception e) { + e.printStackTrace(); + } finally { + DynamicDataSourceUtil.clearSwitchDataSource(); + } + return hasError; + } + + /** + * vue3获取数据过滤方案列表 + * + * @param columnStr + * @param appColumnStr + * @return + */ + public List getFilterRules(String columnStr, String appColumnStr) { + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnStr, ColumnDataModel.class); + ColumnDataModel appColumnDataModel = JsonUtil.getJsonToBean(appColumnStr, ColumnDataModel.class); + List ruleList = JsonUtil.getJsonToList(columnDataModel.getRuleList().getConditionList(), Map.class); + List appRuleList = JsonUtil.getJsonToList(appColumnDataModel.getRuleList().getConditionList(), Map.class); + boolean isPc = RequestContext.isOrignPc(); + List res = JsonUtil.getJsonToList(ruleList, RuleInfo.class); + if (!isPc) { + res = JsonUtil.getJsonToList(appRuleList, RuleInfo.class); + } + return res; + } + + public QueryWrapper wrapperHandle(String columnStr, String appColumnStr, QueryWrapper wrapper, Class aClass, String type, String tableName) { + try { + // 避免空and + wrapper.apply(" 1=1 "); + List ruleInfos = getFilterRules(columnStr, appColumnStr); + for (RuleInfo info : ruleInfos) { + String field = info.getField(); + if ("main".equals(type) && field.contains("-")) { + continue; + } + if ("main".equals(type) && field.contains("_jnpf_")) { + continue; + } + if ("sub".equals(type) && !field.contains("-")) { + continue; + } + if ("sub-jnpf".equals(type) && !field.contains("_jnpf_")) { + continue; + } + String fieldName = field; + String table = ""; + if (field.contains("-")) { + fieldName = field.split("-")[1]; + if (!tableName.equals(field.split("-")[0])) { + continue; + } + } + if (field.contains("_jnpf_")) { + fieldName = field.split("_jnpf_")[1]; + table = field.split("_jnpf_")[0]; + table = table.replace("jnpf_", ""); + } + if ("sub-jnpf".equals(type) && !tableName.equals(table)) { + continue; + } + Field declaredField = aClass.getDeclaredField(fieldName); + declaredField.setAccessible(true); + String fieldDb = declaredField.getAnnotation(TableField.class).value(); + GenUtil genUtil = JsonUtil.getJsonToBean(info, GenUtil.class); + genUtil.setOperator(info.getOperator()); + genUtil.solveValue(wrapper, fieldDb); + } + return wrapper; + } catch (Exception e) { + return wrapper; + } + } + + /** + * 是否只有主表过滤 + * + * @param columnStr + * @param appColumnStr + * @return + */ + public boolean onlyMainFilter(String columnStr, String appColumnStr) { + List ruleInfos = getFilterRules(columnStr, appColumnStr); + for (RuleInfo info : ruleInfos) { + if (info.getField().contains("_jnpf_") || info.getField().contains("-")) { + return false; + } + } + return true; + } + + /** + * 输入时表单时间字段根据格式转换去尾巴 + * + * @param formDataStr 表单属性json + * @param obj 数据 + */ + public static String swapDatetime(String formDataStr, Object obj) { + FormDataModel formDataModel = JsonUtil.getJsonToBean(formDataStr, FormDataModel.class); + List fieLdsModels = JsonUtil.getJsonToList(formDataModel.getFields(), FieLdsModel.class); + Map map = JsonUtil.entityToMap(obj); + OnlineSwapDataUtils.swapDatetime(fieLdsModels, map); + return JsonUtil.getObjectToString(map); + } + + + /** + * 数据权限 + * + * @param queryJson + * @param + * @return + */ + @DS("") + public QueryWrapper getAuthorizeCondition(QueryModel queryJson) { + String moduleId = queryJson.getModuleId(); + List authorizeListAll = authorizeService.getConditionSql(moduleId); + queryJson.setQueryJson(JsonUtil.getObjectToString(authorizeListAll)); + return getConditionSql(queryJson); + } + + /** + * 高级查询 + * + * @param queryJson + * @param + * @return + */ + public QueryWrapper getCondition(QueryModel queryJson) { + String query = queryJson.getQueryJson(); + QueryWrapper queryWrapper = queryJson.getObj(); + if (StringUtil.isEmpty(query)) { + return queryWrapper; + } + List superList = new ArrayList<>(); + superList.add(JsonUtil.getJsonToBean(query, SuperJsonModel.class)); + queryJson.setQueryJson(JsonUtil.getObjectToString(superList)); + return getConditionSql(queryJson); + } + + @DS("") + public QueryWrapper getConditionSql(QueryModel queryJson) { + String query = queryJson.getQueryJson(); + QueryWrapper queryWrapper = queryJson.getObj(); + if (StringUtil.isEmpty(query)) { + return queryWrapper; + } + Class entity = queryJson.getEntity(); + String tableName = ""; + try { + TableName annotation = (TableName) entity.getAnnotation(TableName.class); + tableName = annotation.value(); + } catch (Exception e) { + } + List superJsonModelList = new ArrayList<>(); + List queryList = JsonUtil.getJsonToList(query, SuperJsonModel.class); + for (SuperJsonModel superJsonModel : queryList) { + List ruleJsonModelList = superJsonModel.getConditionList(); + OnlineProductSqlUtils.superList(ruleJsonModelList, true); + List conditionList = new ArrayList<>(); + for (SuperQueryJsonModel queryJsonModel : ruleJsonModelList) { + List superFieLdsList = new ArrayList<>(); + SuperQueryJsonModel superQueryModel = new SuperQueryJsonModel(); + superQueryModel.setGroups(superFieLdsList); + superQueryModel.setLogic(queryJsonModel.getLogic()); + List fieLdsModelList = queryJsonModel.getGroups(); + for (FieLdsModel fieLdsModel : fieLdsModelList) { + ConfigModel config = fieLdsModel.getConfig(); + String table = ObjectUtil.isNotEmpty(config.getRelationTable()) ? config.getRelationTable() : config.getTableName(); + if (table.equalsIgnoreCase(tableName)) { + superFieLdsList.add(fieLdsModel); + } + } + if (superFieLdsList.size() > 0) { + conditionList.add(superQueryModel); + } + } + SuperJsonModel jsonModel = new SuperJsonModel(); + jsonModel.setAuthorizeLogic(superJsonModel.getAuthorizeLogic()); + jsonModel.setMatchLogic(superJsonModel.getMatchLogic()); + jsonModel.setConditionList(conditionList); + superJsonModelList.add(jsonModel); + } + queryJson.setQueryJson(JsonUtil.getObjectToString(superJsonModelList)); + String dbType = ""; + try { + DbLinkEntity linkEntity = getDataSource(queryJson.getDbLink()); + DynamicDataSourceUtil.switchToDataSource(linkEntity); + @Cleanup Connection connection = ConnUtil.getConnOrDefault(linkEntity); + dbType = connection.getMetaData().getDatabaseProductName().trim(); + } catch (Exception e) { + } finally { + DynamicDataSourceUtil.clearSwitchDataSource(); + } + queryJson.setDbType(dbType); + QueryUtil queryUtil = new QueryUtil(); + return queryUtil.queryList(queryJson); + } + + public List selectIdsByChildCondition(String tableList, String childTable, String queryJsonStr, String moduleId) { + List tableModelList = JsonUtil.getJsonToList(tableList, TableModel.class); + TableModel mainTable = null; + TableModel childSqlTableModel = null; + List sqlModelList = new ArrayList<>(); + //根据表字段创建sqltable + for (TableModel model : tableModelList) { + OnlineDynamicSqlModel sqlModel = new OnlineDynamicSqlModel(); + sqlModel.setSqlTable(SqlTable.of(model.getTable())); + sqlModel.setTableName(model.getTable()); + if (model.getTypeId().equals("1")) { + sqlModel.setMain(true); + mainTable = model; + } else { + sqlModel.setForeign(model.getTableField()); + sqlModel.setRelationKey(model.getRelationField()); + sqlModel.setMain(false); + if (model.getTable().equals(childTable)) { + childSqlTableModel = model; + } + } + sqlModelList.add(sqlModel); + } + SqlTable mainSqlTable = SqlTable.of(mainTable.getTable()); + SqlTable childSqlTable = SqlTable.of(childSqlTableModel.getTable()); + List fields = childSqlTableModel.getFields(); + TableModel finalChildSqlTableModel1 = childSqlTableModel; + TableFields mainKey = mainTable.getFields().stream().filter(t -> t.getField().equals(finalChildSqlTableModel1.getRelationField())).findFirst().orElse(null); + TableFields orderid = fields.stream().filter(t -> t.getField().equals(finalChildSqlTableModel1.getTableField())).findFirst().orElse(null); + List childSqlColumns = new ArrayList<>(); + childSqlColumns.add(mainSqlTable.column(mainKey.getColumnName())); + QueryExpressionDSL from = SqlBuilder.select(childSqlColumns).from(mainSqlTable); + from.leftJoin(childSqlTable) + .on(childSqlTable.column(orderid.getColumnName()), new EqualTo(mainSqlTable.column(mainKey.getColumnName()))); + QueryExpressionDSL.QueryExpressionWhereBuilder childWhere = from.where(); + if (StringUtil.isNotEmpty(moduleId)) { + List authorizeListAll = authorizeService.getConditionSql(moduleId); + OnlineProductSqlUtils.getSuperSql(childWhere, authorizeListAll, sqlModelList, "", null); + } else { + SuperJsonModel queryJson = JsonUtil.getJsonToBean(queryJsonStr, SuperJsonModel.class); + //处理字段 + List conditionList = queryJson.getConditionList(); + for (SuperQueryJsonModel superQueryJsonModel : conditionList) { + List newGroup = new ArrayList<>(); + for (FieLdsModel fieLdsModel : superQueryJsonModel.getGroups()) { + String tabelName = StringUtil.isNotEmpty(fieLdsModel.getConfig().getRelationTable()) ? + fieLdsModel.getConfig().getRelationTable() : fieLdsModel.getConfig().getTableName(); + if (childTable.equals(tabelName)) { + FieLdsModel newField = BeanUtil.copyProperties(fieLdsModel, FieLdsModel.class); + for (TableFields field : childSqlTableModel.getFields()) { + if (fieLdsModel.getVModel().equals(field.getField())) { + newField.setVModel(field.getColumnName()); + } + } + newGroup.add(newField); + } + } + superQueryJsonModel.setGroups(newGroup); + } + OnlineProductSqlUtils.getSuperSql(childWhere, queryJson, sqlModelList, "", childTable, false); + } + SelectStatementProvider childRender = childWhere.build().render(RenderingStrategies.MYBATIS3); + List> mapList = flowFormDataMapper.selectManyMappedRows(childRender); + return mapList.stream().map(t -> t.get(mainKey.getColumnName()).toString()).collect(Collectors.toList()); + } +} diff --git a/jnpf-java-boot/jnpf-public/jnpf-generater-base/src/main/java/jnpf/util/QueryUtil.java b/jnpf-java-boot/jnpf-public/jnpf-generater-base/src/main/java/jnpf/util/QueryUtil.java new file mode 100644 index 0000000..7fe4f5c --- /dev/null +++ b/jnpf-java-boot/jnpf-public/jnpf-generater-base/src/main/java/jnpf/util/QueryUtil.java @@ -0,0 +1,239 @@ +package jnpf.util; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; +import jnpf.database.model.superQuery.SuperJsonModel; +import jnpf.database.model.superQuery.SuperQueryJsonModel; +import jnpf.emnus.SearchMethodEnum; +import jnpf.model.QueryModel; +import jnpf.model.visualJson.FieLdsModel; +import jnpf.model.visualJson.config.ConfigModel; +import jnpf.util.visiual.JnpfKeyConsts; +import lombok.Data; + +import java.lang.reflect.Field; +import java.util.*; + +@Data +public class QueryUtil { + + /** + * 运算符 + */ + private SearchMethodEnum symbol; + /** + * 逻辑拼接符号 + */ + private boolean and; + /** + * 组件标识 + */ + private String jnpfKey; + /** + * 字段key + */ + private String vModel; + /** + * 自定义的值 + */ + private Object fieldValue; + /** + * 自定义的值2 + */ + private Object fieldValueTwo; + + /** + * 数据库类型 + */ + private String dbType; + + private List dataList = new ArrayList<>(); + + //搜索逻辑 + public QueryWrapper queryList(QueryModel queryModel) { + QueryWrapper queryWrapper = queryModel.getObj(); + Class entity = queryModel.getEntity(); + dbType = queryModel.getDbType(); + String queryJson = queryModel.getQueryJson(); + List superJsonModelList = JsonUtil.getJsonToList(queryJson, SuperJsonModel.class); + for (SuperJsonModel superJsonModel : superJsonModelList) { + String matchLogic = superJsonModel.getMatchLogic(); + Boolean authorizeLogic = superJsonModel.getAuthorizeLogic(); + boolean isAddMatchLogic = SearchMethodEnum.And.getSymbol().equalsIgnoreCase(matchLogic); + List conditionList = superJsonModel.getConditionList(); + if (conditionList.size() == 0) continue; + queryWrapper.and(gw -> { + if (authorizeLogic) { + gw.and(tw -> { + queryWrapperList(entity, tw, conditionList, isAddMatchLogic); + }); + } else { + gw.or(tw -> { + queryWrapperList(entity, tw, conditionList, isAddMatchLogic); + }); + } + }); + } + return queryWrapper; + } + + private void queryWrapperList(Class entity, QueryWrapper tw, List conditionList, boolean isAddMatchLogic) { + for (SuperQueryJsonModel superQueryJsonModel : conditionList) { + String logic = superQueryJsonModel.getLogic(); + and = SearchMethodEnum.And.getSymbol().equalsIgnoreCase(logic); + List queryList = superQueryJsonModel.getGroups(); + queryWrapper(entity, tw, queryList, isAddMatchLogic); + } + } + + private void queryWrapper(Class entity, QueryWrapper tw, List queryListAll, boolean isAnd) { + if (isAnd) { + tw.and(qw -> { + query(entity, qw, queryListAll); + }); + } else { + tw.or(qw -> { + query(entity, qw, queryListAll); + }); + } + } + + private void query(Class entity, QueryWrapper qw, List queryListAll) { + for (FieLdsModel fieLdsModel : queryListAll) { + List queryList = new ArrayList() {{ + add(fieLdsModel); + }}; + if (and) { + qw.and(ew -> { + fieldsModel(ew, queryList, entity); + }); + } else { + qw.or(ew -> { + fieldsModel(ew, queryList, entity); + }); + } + } + } + + private void fieldsModel(QueryWrapper wrapper, List queryList, Class entity) { + for (FieLdsModel fieLdsModel : queryList) { + ConfigModel config = fieLdsModel.getConfig(); + jnpfKey = config.getJnpfKey(); + symbol = SearchMethodEnum.getSearchMethod(fieLdsModel.getSymbol()); + vModel = fieLdsModel.getVModel(); + if (!and) { + wrapper.or(); + } + try { + Field declaredField = entity.getDeclaredField(vModel); + declaredField.setAccessible(true); + vModel = declaredField.getAnnotation(TableField.class).value(); + } catch (Exception e) { + + } + fieldValue = fieLdsModel.getFieldValueOne(); + fieldValueTwo = fieLdsModel.getFieldValueTwo(); + dataList = fieLdsModel.getDataList(); + if(JnpfKeyConsts.DateSelect.contains(fieLdsModel.getConfig().getJnpfKey())){ + if(ObjectUtils.isNotEmpty(fieLdsModel.getFieldValueOne())){ + fieldValue = new Date(Long.valueOf(fieLdsModel.getFieldValueOne().toString())); + } + if(ObjectUtils.isNotEmpty(fieLdsModel.getFieldValueTwo())){ + fieldValueTwo = new Date(Long.valueOf(fieLdsModel.getFieldValueTwo().toString())); + } + } + getSymbolWrapper(wrapper); + } + } + + private void getNullWrapper(QueryWrapper wrapper) { + if (!and) { + wrapper.or(t -> t.isNull(vModel)); + } else { + wrapper.and(t -> t.isNull(vModel)); + } + } + + private void getNotNullWrapper(QueryWrapper wrapper) { + if (!and) { + wrapper.or(t -> t.isNotNull(vModel)); + } else { + wrapper.and(t -> t.isNotNull(vModel)); + } + } + + private void getInWrapper(QueryWrapper wrapper) { + if (!and) { + wrapper.or(qw -> { + for (String id : dataList) { + switch (symbol) { + case Included: + qw.or().like(vModel, id); + break; + default: + qw.notLike(vModel, id); + break; + } + } + }); + } else { + wrapper.and(qw -> { + for (String id : dataList) { + switch (symbol) { + case Included: + qw.or().like(vModel, id); + break; + default: + qw.notLike(vModel, id); + break; + } + } + }); + } + } + + private void getSymbolWrapper(QueryWrapper wrapper) { + switch (symbol) { + case IsNull: + getNullWrapper(wrapper); + break; + case IsNotNull: + getNotNullWrapper(wrapper); + break; + case Equal: + wrapper.eq(vModel, fieldValue); + break; + case NotEqual: + wrapper.ne(vModel, fieldValue); + break; + case GreaterThan: + wrapper.gt(vModel, fieldValue); + break; + case LessThan: + wrapper.lt(vModel, fieldValue); + break; + case GreaterThanOrEqual: + wrapper.ge(vModel, fieldValue); + break; + case LessThanOrEqual: + wrapper.le(vModel, fieldValue); + break; + case Like: + wrapper.like(vModel, fieldValue); + break; + case NotLike: + wrapper.notLike(vModel, fieldValue); + break; + case Included: + case NotIncluded: + getInWrapper(wrapper); + break; + case Between: + wrapper.between(vModel, fieldValue, fieldValueTwo); + break; + default: + break; + } + } +} diff --git a/jnpf-java-boot/jnpf-public/jnpf-provider/pom.xml b/jnpf-java-boot/jnpf-public/jnpf-provider/pom.xml new file mode 100644 index 0000000..475836e --- /dev/null +++ b/jnpf-java-boot/jnpf-public/jnpf-provider/pom.xml @@ -0,0 +1,65 @@ + + + + jnpf-java-boot + com.jnpf + 3.5.0-RELEASE + ../../pom.xml + + 4.0.0 + + jnpf-provider + + + + com.jnpf + jnpf-common-all + ${project.version} + + + com.jnpf + jnpf-common-office + + + + com.jnpf + jnpf-permission-entity + ${project.version} + + + com.jnpf + jnpf-system-entity + ${project.version} + + + com.jnpf + jnpf-message-entity + ${project.version} + + + + dingtalk-sdk-java + taobao-sdk-java + + + dingtalk-sdk-java + taobao-sdk-java-source + + + com.tencentcloudapi + tencentcloud-sdk-java + + + com.aliyun + dysmsapi20170525 + + + com.jnpf + jnpf-workflow-engine-entity + ${project.version} + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/base/service/DictionaryDataService.java b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/base/service/DictionaryDataService.java new file mode 100644 index 0000000..be3942c --- /dev/null +++ b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/base/service/DictionaryDataService.java @@ -0,0 +1,160 @@ +package jnpf.base.service; + +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import jnpf.base.entity.DictionaryDataEntity; +import jnpf.base.model.dictionarytype.DictionaryExportModel; +import jnpf.base.vo.DownloadVO; +import jnpf.exception.DataException; + +import java.util.List; + +/** + * 字典数据 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +public interface DictionaryDataService extends SuperService { + + /** + * 列表 + * + * @param dictionaryTypeId 字段分类id + * @param enable 是否只看有效 + * @return ignore + */ + List getList(String dictionaryTypeId, Boolean enable); + + /** + * 列表 + * + * @param dictionaryTypeId 类别主键 + * @return ignore + */ + List getList(String dictionaryTypeId); + /** + * 列表 + * + * @param dictionaryTypeId 类别主键(在线开发数据转换) + * @return ignore + */ + List getDicList(String dictionaryTypeId); + /** + * 列表 + * + * @param dictionaryTypeId 类别主键(在线开发数据转换) + * @return ignore + */ + List geDicList(String dictionaryTypeId); + /** + * 列表 + * + * @param parentId 父级id + * @return ignore + */ + Boolean isExistSubset(String parentId); + + /** + * 信息 + * + * @param id 主键值 + * @return ignore + */ + DictionaryDataEntity getInfo(String id); + + /** + * 代码生成器数据字典转换 + * @param value encode 或者 id + * @param dictionaryTypeId 类别 + * @return + */ + DictionaryDataEntity getSwapInfo(String value,String dictionaryTypeId); + /** + * 验证名称 + * + * @param dictionaryTypeId 类别主键 + * @param fullName 名称 + * @param id 主键值 + * @return ignore + */ + boolean isExistByFullName(String dictionaryTypeId, String fullName, String id); + + /** + * 验证编码 + * + * @param dictionaryTypeId 类别主键 + * @param enCode 编码 + * @param id 主键值 + * @return ignore + */ + boolean isExistByEnCode(String dictionaryTypeId, String enCode, String id); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(DictionaryDataEntity entity); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(DictionaryDataEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return ignore + */ + boolean update(String id, DictionaryDataEntity entity); + + /** + * 上移 + * + * @param id 主键值 + * @return ignore + */ + boolean first(String id); + + /** + * 下移 + * + * @param id 主键值 + * @return ignore + */ + boolean next(String id); + + /** + * 获取名称 + * + * @param id 主键id集合 + * @return ignore + */ + List getDictionName(List id); + + /** + * 导出数据 + * + * @param id 主键 + * @return DownloadVO + */ + DownloadVO exportData(String id); + + /** + * 导入数据 + * + * @param exportModel ignore + * @return ignore + * @throws DataException ignore + */ + boolean importData(DictionaryExportModel exportModel) throws DataException; + + List getListByTypeDataCode(String typeCode); +} diff --git a/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/base/service/ModuleButtonService.java b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/base/service/ModuleButtonService.java new file mode 100644 index 0000000..f1aa45c --- /dev/null +++ b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/base/service/ModuleButtonService.java @@ -0,0 +1,118 @@ +package jnpf.base.service; + +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import jnpf.base.Pagination; +import jnpf.base.entity.ModuleButtonEntity; + +import java.util.List; + +/** + * 按钮权限 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +public interface ModuleButtonService extends SuperService { + + /** + * 列表 + * + * @return ignore + */ + List getList(); + + /** + * 列表 + * + * @return ignore + */ + List getEnabledMarkList(String enabledMark); + + /** + * 列表 + * + * @param moduleId 功能主键 + * @return ignore + */ + List getList(String moduleId); + + /** + * 列表(带关键字的) + * + * @param moduleId 功能主键 + * @param pagination 分页参数 + * @return ignore + */ + List getList(String moduleId, Pagination pagination); + + /** + * 信息 + * + * @param id 主键值 + * @return ignore + */ + ModuleButtonEntity getInfo(String id); + + /** + * 信息 + * + * @param id 主键值 + * @param moduleId + * @return ignore + */ + ModuleButtonEntity getInfo(String id, String moduleId); + + /** + * 验证名称 + * + * @param moduleId 功能主键 + * @param fullName 名称 + * @param id 主键值 + * @return ignore + */ + boolean isExistByFullName(String moduleId, String fullName, String id); + + /** + * 验证编码 + * + * @param moduleId 功能主键 + * @param enCode 编码 + * @param id 主键值 + * @return ignore + */ + boolean isExistByEnCode(String moduleId, String enCode, String id); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(ModuleButtonEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return ignore + */ + boolean update(String id, ModuleButtonEntity entity); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(ModuleButtonEntity entity); + + /** + * 通过moduleIds获取按钮权限 + * + * @param ids + * @return + */ + List getList(List ids); +} diff --git a/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/base/service/ModuleColumnService.java b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/base/service/ModuleColumnService.java new file mode 100644 index 0000000..25a8873 --- /dev/null +++ b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/base/service/ModuleColumnService.java @@ -0,0 +1,148 @@ +package jnpf.base.service; + +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import jnpf.base.Pagination; +import jnpf.base.entity.ModuleButtonEntity; +import jnpf.base.entity.ModuleColumnEntity; + +import java.util.List; + +/** + * 列表权限 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ + +public interface ModuleColumnService extends SuperService { + + /** + * 列表 + * + * @return ignore + */ + List getList(); + + /** + * 列表 + * + * @return ignore + */ + List getEnabledMarkList(String enabledMark); + + /** + * 列表 + * + * @param moduleId 功能主键 + * @param pagination 分页参数 + * @return ignore + */ + List getList(String moduleId, Pagination pagination); + + /** + * 列表 + * + * @param moduleId 功能主键 + * @return ignore + */ + List getList(String moduleId); + + /** + * 列表 + * + * @param bindTable 绑定表格Id + * @return ignore + */ + List getListByBindTable(String bindTable); + + /** + * 信息 + * + * @param id 主键值 + * @return ignore + */ + ModuleColumnEntity getInfo(String id); + + /** + * 通过id和菜单id获取详情 + * + * @param id 主键值 + * @param moduleId + * @return + */ + ModuleColumnEntity getInfo(String id, String moduleId); + + /** + * 验证名称 + * + * @param moduleId 功能主键 + * @param fullName 名称 + * @param id 主键值 + * @return ignore + */ + boolean isExistByFullName(String moduleId, String fullName, String id); + + /** + * 验证编码 + * + * @param moduleId 功能主键 + * @param enCode 编码 + * @param id 主键值 + * @return ignore + */ + boolean isExistByEnCode(String moduleId, String enCode, String id); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(ModuleColumnEntity entity); + + /** + * 创建 + * + * @param entitys 实体对象 + */ + void create(List entitys); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + */ + boolean update(String id, ModuleColumnEntity entity); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(ModuleColumnEntity entity); + + /** + * 上移 + * + * @param id 主键值 + */ + boolean first(String id); + + /** + * 下移 + * + * @param id 主键值 + */ + boolean next(String id); + + /** + * 通过moduleIds获取权限 + * + * @param ids + * @return + */ + List getListByModuleId(List ids); +} diff --git a/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/base/service/ModuleDataAuthorizeSchemeService.java b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/base/service/ModuleDataAuthorizeSchemeService.java new file mode 100644 index 0000000..847ca6d --- /dev/null +++ b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/base/service/ModuleDataAuthorizeSchemeService.java @@ -0,0 +1,102 @@ +package jnpf.base.service; + +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import jnpf.base.entity.ModuleDataAuthorizeSchemeEntity; + +import java.util.List; + +/** + * 数据权限方案 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +public interface ModuleDataAuthorizeSchemeService extends SuperService { + + /** + * 列表 + * + * @return ignore + */ + List getList(); + + /** + * 列表 + * + * @return ignore + */ + List getEnabledMarkList(String enabledMark); + + /** + * 列表 + * + * @param moduleId 功能主键 + * @return ignore + */ + List getList(String moduleId); + + /** + * 信息 + * + * @param id 主键值 + * @return ignore + */ + ModuleDataAuthorizeSchemeEntity getInfo(String id); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(ModuleDataAuthorizeSchemeEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return ignore + */ + boolean update(String id, ModuleDataAuthorizeSchemeEntity entity); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(ModuleDataAuthorizeSchemeEntity entity); + + /** + * 判断名称是否重复 + * @param id + * @param fullName + * @return + */ + Boolean isExistByFullName(String id, String fullName, String moduleId); + + /** + * 判断名称是否重复 + * @param id + * @param enCode + * @return + */ + Boolean isExistByEnCode(String id, String enCode, String moduleId); + + /** + * 是否存在全部数据 + * @param moduleId + * @return + */ + Boolean isExistAllData(String moduleId); + + /** + * 通过moduleIds获取权限 + * + * @param ids + * @return + */ + List getListByModuleId(List ids); +} diff --git a/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/base/service/ModuleFormService.java b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/base/service/ModuleFormService.java new file mode 100644 index 0000000..972809d --- /dev/null +++ b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/base/service/ModuleFormService.java @@ -0,0 +1,125 @@ +package jnpf.base.service; + +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import jnpf.base.Pagination; +import jnpf.base.entity.ModuleFormEntity; + +import java.util.List; + +/** + * 表单权限 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021-09-14 + */ +public interface ModuleFormService extends SuperService { + + /** + * 列表 + * + * @return ignore + */ + List getList(); + + /** + * 列表 + * + * @return ignore + */ + List getEnabledMarkList(String enabledMark); + + /** + * 列表 + * + * @param moduleId 功能主键 + * @param pagination 分页参数 + * @return ignore + */ + List getList(String moduleId, Pagination pagination); + + /** + * 列表 + * + * @param moduleId 功能主键 + * @return ignore + */ + List getList(String moduleId); + + /** + * 信息 + * + * @param id 主键值 + * @return ignore + */ + ModuleFormEntity getInfo(String id); + + /** + * 信息 + * + * @param id 主键值 + * @param moduleId + * @return ignore + */ + ModuleFormEntity getInfo(String id, String moduleId); + + /** + * 验证名称 + * + * @param moduleId 功能主键 + * @param fullName 名称 + * @param id 主键值 + * @return ignore + */ + boolean isExistByFullName(String moduleId, String fullName, String id); + + /** + * 验证编码 + * + * @param moduleId 功能主键 + * @param enCode 编码 + * @param id 主键值 + * @return ignore + */ + boolean isExistByEnCode(String moduleId, String enCode, String id); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(ModuleFormEntity entity); + + /** + * 创建 + * + * @param entitys 实体对象 + */ + void create(List entitys); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return ignore + */ + boolean update(String id, ModuleFormEntity entity); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(ModuleFormEntity entity); + + /** + * 通过moduleIds获取权限 + * + * @param ids + * @return + */ + List getListByModuleId(List ids); +} diff --git a/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/base/service/ModuleService.java b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/base/service/ModuleService.java new file mode 100644 index 0000000..2761426 --- /dev/null +++ b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/base/service/ModuleService.java @@ -0,0 +1,198 @@ +package jnpf.base.service; + +import jnpf.base.entity.ModuleEntity; +import jnpf.base.model.module.ModuleExportModel; +import jnpf.base.vo.DownloadVO; +import jnpf.exception.DataException; + +import java.util.List; + +/** + * 系统功能 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +public interface ModuleService extends SuperService { + + /** + * 列表 + * + * @return ignore + */ + List getList(); + + /** + * 列表 + * + * @return ignore + */ + List getList(List list); + + /** + * 列表 + * + * @param systemId 系统id + * @param category + * @param keyword + * @param parentId + * @param release + * @return ignore + */ + List getList(String systemId, String category, String keyword, String type, String enabledMark, String parentId, boolean release); + + /** + * 通过id获取子菜单 + * + * @param id 主键 + * @return ignore + */ + List getList(String id); + + /** + * 信息 + * + * @param id 主键值 + * @return ignore + */ + ModuleEntity getInfo(String id); + + /** + * 信息 + * + * @param id 主键值 + * @return ignore + */ + ModuleEntity getInfo(String id, String systemId); + + /** + * 信息 + * + * @param fullName 主键值 + * @return ignore + */ + List getInfoByFullName(String fullName, String systemId); + + /** + * 信息 + * + * @param id 主键值 + * @return ignore + */ + ModuleEntity getInfo(String id, String systemId, String parentId); + + /** + * 验证名称 + * + * @param entity ignore + * @param category 分类 + * @param systemId 分类 + * @return ignore + */ + boolean isExistByFullName(ModuleEntity entity, String category, String systemId); + + /** + * 验证编码 + * + * @param entity 实体 + * @param category 分类 + * @param systemId 分类 + * @return ignore + */ + boolean isExistByEnCode(ModuleEntity entity, String category, String systemId); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(ModuleEntity entity); + + /** + * 删除 + * + * @param systemId 实体对象 + */ + void deleteBySystemId(String systemId); + + + /** + * 删除权限(同步菜单 不处理数据权限) + * + * @param entity 实体对象 + */ + void deleteModule(ModuleEntity entity); + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(ModuleEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return ignore + */ + boolean update(String id, ModuleEntity entity); + + /** + * 导出数据 + * + * @param id 主键 + * @return DownloadVO ignore + */ + DownloadVO exportData(String id); + + /** + * 导入数据 + * + * @param exportModel 导出模型 + * @return ignore + * @throws DataException ignore + */ + boolean importData(ModuleExportModel exportModel) throws DataException; + + /** + * 功能设计发布功能自动创建app pc菜单 + * @return + */ + List getModuleList(String visualId); + + /** + * 通过系统id获取菜单 + * + * @param ids + * @return + */ + List getModuleBySystemIds(List ids); + + /** + * 获取门户发布的菜单 + * + * @param portalIds + * @return + */ + List getModuleByPortal(List portalIds); + + /** + * 获取开发平台下的菜单 + * + * @return + */ + List getMainModule(); + + List getModuleByIds(List moduleIds); + + /** + * 通过ids获取系统菜单 + * + * @param enCodeList + * @return + */ + List getListByEnCode(List enCodeList); +} diff --git a/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/base/service/SystemService.java b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/base/service/SystemService.java new file mode 100644 index 0000000..02879f6 --- /dev/null +++ b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/base/service/SystemService.java @@ -0,0 +1,126 @@ +package jnpf.base.service; + +import jnpf.base.UserInfo; +import jnpf.base.entity.SystemEntity; + +import java.util.List; + +/** + * 系统 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +public interface SystemService extends SuperService { + + /** + * 获取系统列表 + * + * @param keyword + * @param filterMain + * @return + */ + List getList(String keyword, Boolean filterEnableMark, Boolean filterMain); + + /** + * 获取系统列表 + * + * @param keyword + * @param filterMain + * @param isList + * @return + */ + List getList(String keyword, Boolean filterEnableMark, boolean verifyAuth, Boolean filterMain, boolean isList); + + /** + * 获取当前用户所有系统权限 + * + * @param userInfo + * @return + */ + List getCurrentUserSystem(UserInfo userInfo); + + /** + * 获取详情 + * + * @param id + * @return + */ + SystemEntity getInfo(String id); + + /** + * 判断系统名称是否重复 + * + * @param id + * @param fullName + * @return + */ + Boolean isExistFullName(String id, String fullName); + + /** + * 判断系统编码是否重复 + * + * @param id + * @param enCode + * @return + */ + Boolean isExistEnCode(String id, String enCode); + + /** + * 新建 + * + * @param entity + * @return + */ + Boolean create(SystemEntity entity); + + /** + * 新建 + * + * @param entity + * @return + */ + Boolean update(String id, SystemEntity entity); + + /** + * 删除 + * + * @param id + * @return + */ + Boolean delete(String id); + + /** + * + * 通过id获取系统列表 + * + * @param list + * @return + */ + List getListByIds(List list); + + /** + * 获取主系统 + * + * @return + */ + SystemEntity getMainSystem(); + + /** + * 获取主系统 + * + * @param systemIds + * @return + */ + List getMainSys(List systemIds); + + /** + * 通过编码获取系统信息 + * + * @param enCode + * @return + */ + SystemEntity getInfoByEnCode(String enCode); +} diff --git a/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/engine/service/FlowTaskService.java b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/engine/service/FlowTaskService.java new file mode 100644 index 0000000..f969025 --- /dev/null +++ b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/engine/service/FlowTaskService.java @@ -0,0 +1,212 @@ +package jnpf.engine.service; + +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; +import jnpf.base.service.SuperService; +import jnpf.engine.entity.FlowTaskEntity; +import jnpf.engine.model.flowbefore.FlowBatchModel; +import jnpf.engine.model.flowtask.FlowTaskListModel; +import jnpf.engine.model.flowtask.PaginationFlowTask; +import jnpf.exception.WorkFlowException; +import jnpf.model.FlowWorkListVO; +import jnpf.permission.model.user.WorkHandoverModel; + +import java.util.List; + +/** + * 流程任务 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +public interface FlowTaskService extends SuperService { + + /** + * 列表(流程监控) + * + * @param paginationFlowTask + * @return + */ + List getMonitorList(PaginationFlowTask paginationFlowTask); + + /** + * 列表(我发起的) + * + * @param paginationFlowTask + * @return + */ + List getLaunchList(PaginationFlowTask paginationFlowTask); + + + /** + * 列表(待我审批) + * @param pagination + * @return + */ + List getWaitList(PaginationFlowTask pagination); + + /** + * 列表(抄送我的) + * + * @param pagination + * @return + */ + List getCirculateList(PaginationFlowTask pagination); + + /** + * 列表(我已审批) + * + * @param pagination + * @return + */ + List getTrialList(PaginationFlowTask pagination); + + /** + * 信息 + * + * @param id 主键值 + * @return + * @throws WorkFlowException 异常 + */ + FlowTaskEntity getInfo(String id) throws WorkFlowException; + + /** + * 更新 + * + * @param entity 主键值 + * @return + */ + void update(FlowTaskEntity entity); + + /** + * 创建 + * + * @param entity 主键值 + * @return + */ + void create(FlowTaskEntity entity); + + /** + * 创建或者修改 + * + * @param entity 主键值 + * @return + */ + void createOrUpdate(FlowTaskEntity entity); + + /** + * 信息 + * + * @param id 主键值 + * @param columns 指定获取的列数据 , 任务中存了三个JSON数据 , 排除后可以提高查询速度 + * @return + */ + FlowTaskEntity getInfoSubmit(String id, SFunction... columns); + + /** + * 信息 + * + * @param ids 主键值 + * @param columns 指定获取的列数据 , 任务中存了三个JSON数据 , 排除后可以提高查询速度 + * @return + */ + List getInfosSubmit(String[] ids, SFunction... columns); + + /** + * 删除 + * + * @param entity 实体对象 + * @throws WorkFlowException 异常 + */ + void delete(FlowTaskEntity entity) throws WorkFlowException; + + /** + * 递归删除所有字节点 + * + * @param id + */ + void deleteChildAll(List id); + + /** + * 批量删除流程 + * + * @param ids + */ + void delete(String[] ids) throws WorkFlowException; + + /** + * 查询订单状态 + * + * @param id + * @return + */ + List getOrderStaList(List id); + + /** + * 查询子流程 + * + * @param id + * @return + */ + List getChildList(String id, SFunction... columns); + + /** + * 查询流程列表 + * + * @param tempId + * @return + */ + List getTemplateIdList(String tempId); + + /** + * 查询流程列表 + * + * @param flowId + * @return + */ + List getFlowList(String flowId); + + /** + * 批量审批引擎 + * + * @return + */ + List batchFlowSelector(); + + /** + * 获取子节点下所有数据 + * + * @param idList + * @param idAll + */ + void deleTaskAll(List idList, List idAll); + + /** + * 获取所有子流程 + * + * @param id + * @return + */ + List getChildAllList(String id); + + /** + * 获取子流程 + * + * @param id + * @return + */ + void getChildList(String id, boolean suspend, List list); + + /** + * 流程交接 + * @return + */ + FlowWorkListVO flowWork(String fromId); + + /** + * 流程交接 + * @return + */ + boolean flowWork(WorkHandoverModel workHandoverModel); +} diff --git a/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/AccountConfigService.java b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/AccountConfigService.java new file mode 100644 index 0000000..a9e6b56 --- /dev/null +++ b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/AccountConfigService.java @@ -0,0 +1,93 @@ + +package jnpf.message.service; + +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; + + +import java.util.*; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import jnpf.base.ActionResult; +import jnpf.exception.DataException; +import jnpf.message.entity.AccountConfigEntity; +import jnpf.message.model.accountconfig.*; + +/** + * 账号配置功能 + * 版本: V3.2.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2022-08-18 + */ +public interface AccountConfigService extends SuperService { + + + List getList(AccountConfigPagination accountConfigPagination); + + List getTypeList(AccountConfigPagination accountConfigPagination, String dataType); + + + AccountConfigEntity getInfo(String id); + + void delete(AccountConfigEntity entity); + + void create(AccountConfigEntity entity); + + boolean update(String id, AccountConfigEntity entity); + + /** + * + * @param type 配置类型 1:站内信,2:邮件,3:短信,4:钉钉,5:企业微信,6:webhook + * @return + */ + List getListByType(String type); + + /** + * 验证名称 + * + * @param fullName 名称 + * @param id 主键值 + * @return ignore + */ + boolean isExistByFullName(String fullName, String id); + + /** + * 验证编码 + * + * @param enCode 编码 + * @param id 主键值 + * @return ignore + */ + boolean isExistByEnCode(String enCode, String id,String type); + + /** + * 账号配置导入 + * + * @param entity 实体对象 + * @return ignore + * @throws DataException ignore + */ + ActionResult ImportData(AccountConfigEntity entity) throws DataException; + +// 子表方法 + + //列表子表数据方法 + + //验证表单 + boolean checkForm(AccountConfigForm form, int i,String type,String id); + + /** + * 验证微信公众号原始id唯一性 + * @param gzhId 微信公众号原始id + * @param i + * @param type + * @param id + * @return + */ + boolean checkGzhId(String gzhId, int i,String type,String id); + + AccountConfigEntity getInfoByType(String appKey, String type); + + AccountConfigEntity getInfoByEnCode(String enCode,String type); +} diff --git a/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/MessageMonitorService.java b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/MessageMonitorService.java new file mode 100644 index 0000000..59bc590 --- /dev/null +++ b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/MessageMonitorService.java @@ -0,0 +1,55 @@ + +package jnpf.message.service; + + +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.*; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import jnpf.message.entity.MessageMonitorEntity; +import jnpf.message.model.messagemonitor.*; + +/** + * 消息监控 + * 版本: V3.2.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2022-08-22 + */ +public interface MessageMonitorService extends SuperService { + + + List getList(MessageMonitorPagination messageMonitorPagination); + + List getTypeList(MessageMonitorPagination messageMonitorPagination, String dataType); + + + MessageMonitorEntity getInfo(String id); + + void delete(MessageMonitorEntity entity); + + void create(MessageMonitorEntity entity); + + boolean update(String id, MessageMonitorEntity entity); + +// 子表方法 + + //列表子表数据方法 + + //验证表单 + boolean checkForm(MessageMonitorForm form, int i); + + + String userSelectValues(String ids); + + /** + * 删除 + * @param ids + * @return + */ + boolean delete(String[] ids); + + void emptyMonitor(); +} diff --git a/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/MessageService.java b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/MessageService.java new file mode 100644 index 0000000..0f38e6d --- /dev/null +++ b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/MessageService.java @@ -0,0 +1,234 @@ +package jnpf.message.service; + + +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import jnpf.base.Pagination; +import jnpf.base.UserInfo; +import jnpf.base.entity.MessageTemplateEntity; +import jnpf.message.entity.MessageEntity; +import jnpf.message.entity.MessageReceiveEntity; +import jnpf.message.model.NoticePagination; +import jnpf.message.model.message.NoticeVO; +import jnpf.message.model.message.SentMessageForm; + +import java.util.List; +import java.util.Map; + +/** + * 消息实例 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +public interface MessageService extends SuperService { + + /** + * 列表(通知公告) + * + * @param pagination + * @return + */ + List getNoticeList(NoticePagination pagination); + + /** + * 列表(通知公告) + * + * @return + */ + List getNoticeList(); + + /** + * 列表(通知公告) + * 门户专用 + * + * @return + */ + List getDashboardNoticeList(List typeList); + + /** + * 列表(通知公告/系统消息/私信消息) + * + * @param pagination + * @param type 类别 + * @return + */ + List getMessageList1(Pagination pagination, Integer type,Integer isRead); + + /** + * 获取全部数据 + * + * @param pagination + * @param type 类别 + * @return + */ + List getMessageList3(Pagination pagination, Integer type, String user,Integer isRead); + + /** + * 列表(通知公告/系统消息/私信消息) + * + * @param pagination + * @param type 类别 + * @return + */ + List getMessageList(Pagination pagination, Integer type,String userId); + + /** + * 列表(通知公告/系统消息/私信消息) + * + * @param pagination + * @return + */ + List getMessageList(Pagination pagination); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + MessageEntity getInfo(String id); + + /** + * 默认消息 + * + * @param type 类别:1-通知公告/2-系统消息 + * @return + */ + MessageEntity getInfoDefault(int type); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(MessageEntity entity); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(MessageEntity entity); + + /** + * 更新 + * + * @param entity 实体对象 + */ + boolean update(String id, MessageEntity entity); + + /** + * 消息已读(单条) + * + * @param messageId 消息主键 + */ + MessageReceiveEntity messageRead(String messageId); + + /** + * 消息已读(全部) + */ + void messageRead(List idList); + + /** + * 删除记录 + * + * @param messageIds 消息Id + */ + void deleteRecord(List messageIds); + + /** + * 获取消息未读数量 + * + * @param userId 用户主键 + * @return + */ + int getUnreadCount(String userId,Integer type); + + /** + * 发送公告 + * + * @param toUserIds 发送用户 + * @param entity 消息信息 + */ + boolean sentNotice(List toUserIds, MessageEntity entity); + + /** + * 发送消息 + * + * @param toUserIds 发送用户 + * @param title 标题 + */ + void sentMessage(List toUserIds, String title); + + /** + * 发送消息 + * + * @param toUserIds 发送用户 + * @param title 标题 + * @param bodyText 内容 + */ + void sentMessage(List toUserIds, String title, String bodyText); + + /** + * 发送消息 + * + * @param toUserIds 发送用户 + * @param title 标题 + * @param bodyText 内容 + * @param contentMsg 站内信息 + */ + void sentMessage(List toUserIds, String title, String bodyText, Map contentMsg, UserInfo userInfo); + + /** + * 发送消息 + * + * @param toUserIds 发送用户 + * @param title 标题 + * @param bodyText 内容 + */ + void sentMessage(List toUserIds, String title, String bodyText, UserInfo userInfo, Integer source,Integer type); + + /** + * 发送消息 + * + * @param toUserIds 发送用户 + * @param title 标题 + * @param bodyText 内容 + * @param testMessage 是否为测试消息 + */ + void sentMessage(List toUserIds, String title, String bodyText, UserInfo userInfo, Integer source,Integer type, boolean testMessage); + + /** + * 发送消息 + * + * @param toUserIds 发送用户 + * @param entity 消息实体 + * @param content 内容 + */ + void sentFlowMessage(List toUserIds, MessageTemplateEntity entity, String content); + + /** + * 退出在线的WebSocket 可选参数 + * @param token Token 精准退出用户 + * @param userId 退出用户的全部会话 + */ + void logoutWebsocketByToken(String token, String userId); + + /** + * 日程发送消息 + */ + void sentScheduleMessage(SentMessageForm sentMessageForm, String type); + + + /** + * 通过过期时间刷新状态 + * + * @return + */ + Boolean updateEnabledMark(); + + List getNoticeList(List list); +} diff --git a/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/MessageTemplateConfigService.java b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/MessageTemplateConfigService.java new file mode 100644 index 0000000..aac10d8 --- /dev/null +++ b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/MessageTemplateConfigService.java @@ -0,0 +1,96 @@ + +package jnpf.message.service; + + +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.*; + +import jnpf.base.ActionResult; +import jnpf.exception.DataException; +import jnpf.message.entity.MessageTemplateConfigEntity; +import jnpf.message.entity.SmsFieldEntity; +import jnpf.message.entity.TemplateParamEntity; +import jnpf.message.model.messagetemplateconfig.*; + +/** + * 消息模板(新) + * 版本: V3.2.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2022-08-18 + */ +public interface MessageTemplateConfigService extends SuperService { + + + List getList(MessageTemplateConfigPagination MessageTemplateConfigPagination); + + List getTypeList(MessageTemplateConfigPagination MessageTemplateConfigPagination, String dataType); + + + MessageTemplateConfigEntity getInfo(String id); + + MessageTemplateConfigEntity getInfoByEnCode(String enCode,String messageType); + + void delete(MessageTemplateConfigEntity entity); + + void create(MessageTemplateConfigEntity entity); + + boolean update(String id, MessageTemplateConfigEntity entity); + + // 子表方法 + List getTemplateParamList(String id, MessageTemplateConfigPagination MessageTemplateConfigPagination); + + List getTemplateParamList(String id); + + List getSmsFieldList(String id, MessageTemplateConfigPagination MessageTemplateConfigPagination); + + List getSmsFieldList(String id); + + //列表子表数据方法 + + //验证表单 + boolean checkForm(MessageTemplateConfigForm form, int i,String id); + + /** + * 验证名称 + * + * @param fullName 名称 + * @param id 主键值 + * @return ignore + */ + boolean isExistByFullName(String fullName, String id); + + /** + * 验证编码 + * + * @param enCode 编码 + * @param id 主键值 + * @return ignore + */ + boolean isExistByEnCode(String enCode, String id); + + /** + * 消息模板导入 + * + * @param entity 实体对象 + * @return ignore + * @throws DataException ignore + */ + ActionResult ImportData(MessageTemplateConfigEntity entity) throws DataException; + +// /** +// * 获取模板被引用的参数(用json格式存储参数数据) +// * @param id 模板id +// * @return +// */ +// List getParamJson(String id); + + /** + * 获取模板被引用的参数(消息模板参数数据用子表保存) + * @param id 模板id + * @return + */ + List getParamJson(String id); +} diff --git a/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/MessagereceiveService.java b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/MessagereceiveService.java new file mode 100644 index 0000000..39ca5ee --- /dev/null +++ b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/MessagereceiveService.java @@ -0,0 +1,18 @@ +package jnpf.message.service; + + +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import jnpf.message.entity.MessageReceiveEntity; + +/** + * 消息接收 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +public interface MessagereceiveService extends SuperService { + +} diff --git a/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/SendConfigTemplateService.java b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/SendConfigTemplateService.java new file mode 100644 index 0000000..83d9f55 --- /dev/null +++ b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/SendConfigTemplateService.java @@ -0,0 +1,41 @@ + +package jnpf.message.service; + + +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; + + +import java.util.*; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import jnpf.message.entity.SendConfigTemplateEntity; +import jnpf.message.entity.TemplateParamEntity; +import jnpf.message.model.sendmessageconfig.SendMessageConfigPagination; + +/** + * 消息发送配置 + * 版本: V3.2.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2022-08-19 + */ +public interface SendConfigTemplateService extends SuperService { + + QueryWrapper getChild(SendMessageConfigPagination pagination, QueryWrapper sendConfigTemplateQueryWrapper); + + SendConfigTemplateEntity getInfo(String id); + + List getDetailListByParentId(String id); + + /** + * 根据消息发送配置id获取启用的配置模板 + * @param id + * @return + */ + List getConfigTemplateListByConfigId(String id); + + boolean isUsedAccount(String accountId); + + boolean isUsedTemplate(String templateId); +} diff --git a/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/SendMessageConfigService.java b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/SendMessageConfigService.java new file mode 100644 index 0000000..1197fe3 --- /dev/null +++ b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/SendMessageConfigService.java @@ -0,0 +1,110 @@ + +package jnpf.message.service; + +import jnpf.base.service.SuperService; + +import java.util.*; + +import jnpf.base.ActionResult; +import jnpf.exception.DataException; +import jnpf.message.entity.SendConfigTemplateEntity; +import jnpf.message.entity.SendMessageConfigEntity; +import jnpf.message.model.sendmessageconfig.*; + +/** + * 消息发送配置 + * 版本: V3.2.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2022-08-19 + */ +public interface SendMessageConfigService extends SuperService { + + + List getList(SendMessageConfigPagination sendMessageConfigPagination, String dataType); + + /** + * 获取列表 + * + * @return + */ + List getSelectorList(SendMessageConfigPagination sendMessageConfigPagination); + + + SendMessageConfigEntity getInfo(String id); + + SendMessageConfigEntity getInfoByEnCode(String enCode); + + SendMessageConfigEntity getSysConfig(String enCode,String type); + + void delete(SendMessageConfigEntity entity); + + void create(SendMessageConfigEntity entity); + + boolean update(String id, SendMessageConfigEntity entity); + + // 子表方法 + List getSendConfigTemplateList(String id, SendMessageConfigPagination sendMessageConfigPagination); + + List getSendConfigTemplateList(String id); + + //列表子表数据方法 + + //验证表单 + boolean checkForm(SendMessageConfigForm form, int i,String id); + + /** + * 验证名称 + * + * @param fullName 名称 + * @param id 主键值 + * @return ignore + */ + boolean isExistByFullName(String fullName, String id); + + /** + * 验证编码 + * + * @param enCode 编码 + * @param id 主键值 + * @return ignore + */ + boolean isExistByEnCode(String enCode, String id); + + /** + * 消息发送配置导入 + * + * @param entity 实体对象 + * @return ignore + * @throws DataException ignore + */ + ActionResult ImportData(SendMessageConfigEntity entity) throws DataException; + + List getList(List idList); + + /** + * 更新配置被调用id(usedId) + * @param id + * @param idList + */ + void updateUsed(String id,List idList); + + /** + * 删除配置被调用id(usedId) + * @param id + * @param sendConfigIdList + */ + void removeUsed(String id,List sendConfigIdList); + + /** + * 差集(基于常规解法)优化解法1 适用于中等数据量 + * 求List1中有的但是List2中没有的元素 + * 空间换时间降低时间复杂度 + * 时间复杂度O(Max(list1.size(),list2.size())) + */ + List subList(List list1, List list2); + + boolean idUsed(String id); + + +} diff --git a/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/ShortLinkService.java b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/ShortLinkService.java new file mode 100644 index 0000000..3d6037f --- /dev/null +++ b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/ShortLinkService.java @@ -0,0 +1,26 @@ + +package jnpf.message.service; + +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.*; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import jnpf.message.entity.ShortLinkEntity; +import jnpf.message.entity.SmsFieldEntity; +import jnpf.message.model.messagetemplateconfig.*; + +/** + * + * 消息模板(新) + * 版本: V3.2.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2022-08-18 + */ +public interface ShortLinkService extends SuperService { + + String shortLink (String link); + + ShortLinkEntity getInfoByLink(String link); +} diff --git a/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/SmsFieldService.java b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/SmsFieldService.java new file mode 100644 index 0000000..5880c93 --- /dev/null +++ b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/SmsFieldService.java @@ -0,0 +1,31 @@ + +package jnpf.message.service; + +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.*; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import jnpf.message.entity.SmsFieldEntity; +import jnpf.message.model.messagetemplateconfig.*; + +/** + * + * 消息模板(新) + * 版本: V3.2.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2022-08-18 + */ +public interface SmsFieldService extends SuperService { + + QueryWrapper getChild(MessageTemplateConfigPagination pagination, QueryWrapper smsFieldQueryWrapper); + + SmsFieldEntity getInfo(String id); + + List getDetailListByParentId(String id); + + List getParamList(String id,List params); + + Map getParamMap(String templateId,Map map); +} diff --git a/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/SynThirdDingTalkService.java b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/SynThirdDingTalkService.java new file mode 100644 index 0000000..63f5b4e --- /dev/null +++ b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/SynThirdDingTalkService.java @@ -0,0 +1,244 @@ +package jnpf.message.service; + +import com.alibaba.fastjson.JSONObject; +import com.dingtalk.api.response.OapiV2UserListResponse; +import jnpf.message.model.message.DingTalkDeptModel; +import jnpf.message.model.message.DingTalkUserModel; +import jnpf.model.BaseSystemInfo; +import jnpf.permission.entity.OrganizeEntity; +import jnpf.permission.entity.UserEntity; + +import java.text.ParseException; +import java.util.List; + +/** + * 钉钉组织-部门-用户的同步业务 + * + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021/5/7 8:42 + */ +public interface SynThirdDingTalkService { + + /** + * 获取钉钉的配置信息 + * @return + */ + BaseSystemInfo getDingTalkConfig(); + + + //------------------------------------本系统同步公司、部门到钉钉------------------------------------- + + /** + * 本地同步单个公司或部门到钉钉(供调用) + * 带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @param dingDeptListPara 单条执行时为null + * @return + */ +// JSONObject createDepartmentSysToDing(boolean isBatch, OrganizeEntity deptEntity, List dingDeptListPara); + + + /** + * 本地更新单个公司或部门到钉钉(供调用) + * 带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @param dingDeptListPara 单条执行时为null + * @return + */ +// JSONObject updateDepartmentSysToDing(boolean isBatch, OrganizeEntity deptEntity, List dingDeptListPara); + + + /** + * 本地删除单个公司或部门,同步到钉钉(供调用) + * 带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param id 本系统的公司或部门ID + * @param dingDeptListPara 单条执行时为null + * @return + */ +// JSONObject deleteDepartmentSysToDing(boolean isBatch, String id, List dingDeptListPara); + + + + /** + * 本地同步单个公司或部门到钉钉(供调用) + * 不带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @param accessToken (单条调用时为空) + * @return + */ + JSONObject createDepartmentSysToDing(boolean isBatch, OrganizeEntity deptEntity,String accessToken); + + + /** + * 本地更新单个公司或部门到钉钉(供调用) + * 不带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @param accessToken (单条调用时为空) + * @return + */ + JSONObject updateDepartmentSysToDing(boolean isBatch, OrganizeEntity deptEntity,String accessToken); + + + /** + * 本地删除单个公司或部门,同步到钉钉(供调用) + * 不带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param id 本系统的公司或部门ID + * @param accessToken (单条调用时为空) + * @return + */ + JSONObject deleteDepartmentSysToDing(boolean isBatch, String id,String accessToken); + + + + //------------------------------------本系统同步用户到钉钉------------------------------------- + + /** + * 本地用户创建同步到钉钉的用户(单个) + * 带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param userEntity + * @param dingDeptListPara 单条执行时为null + * @param dingUserListPara 单条执行时为null + * @return + */ +// JSONObject createUserSysToDing(boolean isBatch, UserEntity userEntity, List dingDeptListPara, +// List dingUserListPara) throws ParseException; + + + /** + * 本地更新用户信息或部门到钉钉的成员用户(单个) + * 带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param userEntity + * @param dingDeptListPara 单条执行时为null + * @param dingUserListPara 单条执行时为null + * @return + */ +// JSONObject updateUserSysToDing(boolean isBatch, UserEntity userEntity, List dingDeptListPara, +// List dingUserListPara) throws ParseException; + + + /** + * 本地删除单个用户,同步到钉钉用户 + * 带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param id 本系统的公司或部门ID + * @param dingDeptListPara 单条执行时为null + * @param dingUserListPara 单条执行时为null + * @return + */ +// JSONObject deleteUserSysToDing(boolean isBatch, String id, List dingDeptListPara, +// List dingUserListPara); + + + + /** + * 本地用户创建同步到钉钉的用户(单个) + * 不带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param userEntity + * @param accessToken (单条调用时为空) + * @return + */ + JSONObject createUserSysToDing(boolean isBatch, UserEntity userEntity,String accessToken) throws ParseException; + + + /** + * 本地更新用户信息或部门到钉钉的成员用户(单个) + * 不带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param userEntity + * @param accessToken (单条调用时为空) + * @return + */ + JSONObject updateUserSysToDing(boolean isBatch, UserEntity userEntity,String accessToken) throws ParseException; + + + /** + * 本地删除单个用户,同步到钉钉用户 + * 不带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param id 本系统的公司或部门ID + * @param accessToken (单条调用时为空) + * @return + */ + JSONObject deleteUserSysToDing(boolean isBatch, String id,String accessToken); + + //------------------------------------钉钉同步公司、部门到本系统20220330------------------------------------- + + /** + * 钉钉同步单个公司或部门到本地(供调用) + * 不带错误定位判断的功能代码,只获取调用接口的返回信息 20220331 + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @param accessToken (单条调用时为空) + * @return + */ + JSONObject createDepartmentDingToSys(boolean isBatch, DingTalkDeptModel deptEntity,String accessToken); + + /** + * 本地更新单个公司或部门到钉钉(供调用) + * 不带错误定位判断的功能代码,只获取调用接口的返回信息 20220331 + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @param accessToken (单条调用时为空) + * @return + */ + JSONObject updateDepartmentDingToSys(boolean isBatch, DingTalkDeptModel deptEntity,String accessToken); + + /** + * 本地删除单个公司或部门,同步到钉钉(供调用) + * 不带错误定位判断的功能代码,只获取调用接口的返回信息 20220331 + * @param isBatch 是否批量(批量不受开关限制) + * @param id 第三方的公司或部门ID + * @return + */ + JSONObject deleteDepartmentDingToSys(boolean isBatch, String id); + + //------------------------------------钉钉同步用户到本系统20220331------------------------------------- + + + /** + * 本地用户创建同步到钉钉的用户(单个) + * 不带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20220331 + * @param isBatch 是否批量(批量不受开关限制) + * @param dingUserModel + * @param accessToken (单条调用时为空) + * @return + */ + JSONObject createUserDingToSys(boolean isBatch, OapiV2UserListResponse.ListUserResponse dingUserModel, String accessToken) throws Exception; + + + /** + * 本地更新用户信息或部门到钉钉的成员用户(单个) + * 不带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20220331 + * @param isBatch 是否批量(批量不受开关限制) + * @param userEntity + * @param accessToken (单条调用时为空) + * @return + */ + JSONObject updateUserDingToSys(boolean isBatch, UserEntity userEntity,String accessToken) throws ParseException; + + + /** + * 本地删除用户、中间表 + * 不带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20220331 + * @param isBatch 是否批量(批量不受开关限制) + * @param id 钉钉的用户ID + * @return + */ + JSONObject deleteUserDingToSys(boolean isBatch, String id) throws Exception; + + JSONObject updateUserDingToSystem(boolean isBatch, OapiV2UserListResponse.ListUserResponse dingUserModel) throws Exception; + + void deleteSyncByBothWay(String thirdTypeDing, String id); + +} diff --git a/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/SynThirdInfoService.java b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/SynThirdInfoService.java new file mode 100644 index 0000000..8818066 --- /dev/null +++ b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/SynThirdInfoService.java @@ -0,0 +1,82 @@ +package jnpf.message.service; + +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import jnpf.message.entity.SynThirdInfoEntity; +import jnpf.message.util.SynThirdTotal; + +import java.util.List; + +/** + * 第三方工具的公司-部门-用户同步表模型 + * + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021/4/23 17:29 + */ +public interface SynThirdInfoService extends SuperService { + + /** + * 获取指定第三方工具、指定数据类型的数据列表 + * @param thirdType + * @param dataType + * @return + */ + List getList(String thirdType,String dataType); + + /** + * 获取同步的详细信息 + * @param id + * @return + */ + SynThirdInfoEntity getInfo(String id); + + void create(SynThirdInfoEntity entity); + + boolean update(String id,SynThirdInfoEntity entity); + + void delete(SynThirdInfoEntity entity); + + /** + * 获取指定第三方工具、指定数据类型、对象ID的同步信息 + * @param thirdType + * @param dataType + * @param id + * @return + */ + SynThirdInfoEntity getInfoBySysObjId(String thirdType,String dataType,String id); + + /** + * 获取指定第三方工具、指定数据类型的同步统计信息 + * @param thirdType + * @param dataType + * @return + */ + SynThirdTotal getSynTotal(String thirdType,String dataType); + + /** + * + * @param thirdToSysType + * @param dataTypeOrg + * @param SysToThirdType + * @return + */ + List syncThirdInfoByType(String thirdToSysType, String dataTypeOrg, String SysToThirdType); + + boolean getBySysObjId(String id); + + String getSysByThird(String valueOf); + + void initBaseDept(Long dingRootDeptId, String access_token, String thirdType); + + /** + * 获取指定第三方工具、指定数据类型、第三方对象ID的同步信息 20220331 + * @param thirdType + * @param dataType + * @param thirdObjId + * @return + */ + SynThirdInfoEntity getInfoByThirdObjId(String thirdType,String dataType,String thirdObjId); + +} diff --git a/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/SynThirdQyService.java b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/SynThirdQyService.java new file mode 100644 index 0000000..cf13faa --- /dev/null +++ b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/SynThirdQyService.java @@ -0,0 +1,124 @@ +package jnpf.message.service; + +import com.alibaba.fastjson.JSONObject; +import com.dingtalk.api.response.OapiV2UserListResponse; +import jnpf.exception.WxErrorException; +import jnpf.message.model.message.DingTalkDeptModel; +import jnpf.message.model.message.QyWebChatDeptModel; +import jnpf.message.model.message.QyWebChatUserModel; +import jnpf.model.BaseSystemInfo; +import jnpf.permission.entity.OrganizeEntity; +import jnpf.permission.entity.UserEntity; + +/** + * 本系统的公司、部门、用户与企业微信的同步 + * + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021/4/27 11:12 + */ +public interface SynThirdQyService { + + /** + * 获取企业微信的配置信息 + * @return + */ + BaseSystemInfo getQyhConfig(); + + //------------------------------------本系统同步公司、部门到企业微信------------------------------------- + + /** + * 本地同步单个公司或部门到企业微信(供调用) + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @param accessToken (单条调用时为空) + * @return + * @throws WxErrorException + */ + JSONObject createDepartmentSysToQy(boolean isBatch, OrganizeEntity deptEntity,String accessToken) throws WxErrorException; + + /** + * 本地更新单个公司或部门到企业微信(供调用) + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @param accessToken (单条调用时为空) + * @return + * @throws WxErrorException + */ + JSONObject updateDepartmentSysToQy(boolean isBatch, OrganizeEntity deptEntity,String accessToken) throws WxErrorException; + + /** + * 本地删除单个公司或部门,同步到企业微信(供调用) + * @param isBatch 是否批量(批量不受开关限制) + * @param id 本系统的公司或部门ID + * @param accessToken (单条调用时为空) + * @return + * @throws WxErrorException + */ + JSONObject deleteDepartmentSysToQy(boolean isBatch, String id,String accessToken) throws WxErrorException; + + + //------------------------------------本系统同步用户到企业微信------------------------------------- + + /** + * 本地用户创建同步到企业微信的成员(单个) + * @param isBatch 是否批量(批量不受开关限制) + * @param userEntity + * @param accessToken (单条调用时为空) + * @return + * @throws WxErrorException + */ + JSONObject createUserSysToQy(boolean isBatch, UserEntity userEntity,String accessToken) throws WxErrorException; + + /** + * 本地更新用户信息或部门到企业微信的成员信息(单个) + * @param isBatch 是否批量(批量不受开关限制) + * @param userEntity + * @param accessToken (单条调用时为空) + * @return + * @throws WxErrorException + */ + JSONObject updateUserSysToQy(boolean isBatch, UserEntity userEntity,String accessToken) throws WxErrorException; + + /** + * 本地删除单个用户,同步到企业微信成员 + * @param isBatch 是否批量(批量不受开关限制) + * @param id 本系统的公司或部门ID + * @param accessToken (单条调用时为空) + * @return + * @throws WxErrorException + */ + JSONObject deleteUserSysToQy(boolean isBatch, String id,String accessToken) throws WxErrorException; + + //------------------------------------企业微信同步公司、部门到本系统20220613------------------------------------- + + /** + * 企业微信同步公司或部门到本地(供调用) + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @param accessToken (单条调用时为空) + * @return + */ + JSONObject createDepartmentQyToSys(boolean isBatch, QyWebChatDeptModel deptEntity, String accessToken); + + /** + * 企业微信同步更新公司或部门到本地(供调用) + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @param accessToken (单条调用时为空) + * @return + */ + JSONObject updateDepartmentQyToSys(boolean isBatch, QyWebChatDeptModel deptEntity,String accessToken); + + /** + * 企业微信往本地同步用户 + * @param isBatch 是否批量(批量不受开关限制) + * @param qyWebChatUserModel + * @return + */ + JSONObject createUserQyToSys(boolean isBatch, QyWebChatUserModel qyWebChatUserModel,String access_token)throws Exception; + + JSONObject updateUserQyToSystem(boolean isBatch, QyWebChatUserModel qyWebChatUserModel,String access_token) throws Exception; + +} diff --git a/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/TemplateParamService.java b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/TemplateParamService.java new file mode 100644 index 0000000..183b1cd --- /dev/null +++ b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/TemplateParamService.java @@ -0,0 +1,28 @@ + +package jnpf.message.service; + +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; + +import jnpf.message.entity.TemplateParamEntity; +import jnpf.message.model.messagetemplateconfig.*; +import java.util.*; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +/** + * + * 消息模板(新) + * 版本: V3.2.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2022-08-18 + */ +public interface TemplateParamService extends SuperService { + + QueryWrapper getChild(MessageTemplateConfigPagination pagination, QueryWrapper templateParamQueryWrapper); + + TemplateParamEntity getInfo(String id); + + List getDetailListByParentId(String id); + + List getParamList(String id,List params); +} diff --git a/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/WechatUserService.java b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/WechatUserService.java new file mode 100644 index 0000000..6878929 --- /dev/null +++ b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/message/service/WechatUserService.java @@ -0,0 +1,29 @@ + +package jnpf.message.service; + +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.*; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import jnpf.message.entity.WechatUserEntity; + +/** + * + * 消息模板(新) + * 版本: V3.2.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2022-08-18 + */ +public interface WechatUserService extends SuperService { + + WechatUserEntity getInfoByGzhId(String userId,String gzhId); + + void create(WechatUserEntity entity); + + boolean update(String id, WechatUserEntity entity); + + void delete(WechatUserEntity entity); + +} diff --git a/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/permission/service/AuthorizeService.java b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/permission/service/AuthorizeService.java new file mode 100644 index 0000000..4dd46f7 --- /dev/null +++ b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/permission/service/AuthorizeService.java @@ -0,0 +1,136 @@ +package jnpf.permission.service; + +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import jnpf.base.UserInfo; +import jnpf.base.model.base.SystemBaeModel; +import jnpf.database.model.superQuery.SuperJsonModel; +import jnpf.permission.entity.AuthorizeEntity; +import jnpf.permission.model.authorize.*; +import org.springframework.web.bind.annotation.RequestBody; + +import java.util.List; + +/** + * 操作权限 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +public interface AuthorizeService extends SuperService { + + /** + * 获取权限(菜单、按钮、列表) + * + * @param userInfo 对象 + * @param singletonOrg + * @return + */ + AuthorizeVO getAuthorize(UserInfo userInfo, boolean singletonOrg) throws Exception; + + /** + * 获取权限(菜单、按钮、列表) + * + * @param isCache 是否存在redis + * @param singletonOrg + * @return + */ + AuthorizeVO getAuthorize(boolean isCache, boolean singletonOrg); + + /** + * 创建 + * + * @param objectId 对象主键 + * @param authorizeList 实体对象 + */ + void save(String objectId, AuthorizeDataUpForm authorizeList); + + /** + * 创建 + * + * @param saveBatchForm 对象主键 + */ + void saveBatch(SaveBatchForm saveBatchForm, boolean isBatch); + + /** + * 根据用户id获取列表 + * + * @param isAdmin 是否管理员 + * @param userId 用户主键 + * @return + */ + List getListByUserId(boolean isAdmin, String userId); + + /** + * 根据对象Id获取列表 + * + * @param objectId 对象主键 + * @return + */ + List getListByObjectId(List objectId); + + /** + * 判断当前角色是否有权限 + * + * @param roleId + * @return + */ + Boolean existAuthorize(String roleId); + + /** + * 通过角色id集合获取系统 + * + * @param roleIds + * @return + */ + List systemListByRoleIds(List roleIds); + + /** + * 根据对象Id获取列表 + * + * @param objectId 对象主键 + * @param itemType 对象主键 + * @return + */ + List getListByObjectId(String objectId, String itemType); + + /** + * 根据对象Id获取列表 + * + * @param objectType 对象主键 + * @return + */ + List getListByObjectAndItem(String itemId, String objectType);; + + /** + * 根据对象Id获取列表 + * + * @param itemId 对象主键 + * @param itemType 对象类型 + * @return + */ + List getListByObjectAndItemIdAndType(String itemId, String itemType); + + QueryWrapper getCondition(AuthorizeConditionModel conditionModel); + + List findSystem(String objectId); + + List findSystem(@RequestBody List roleIds); + + void savePortalManage(String portalManageId, SaveAuthForm saveAuthForm); + + List getConditionSql(String moduleId); + + /** + * 通过Item获取权限列表 + * + * @param itemType + * @param itemId + * @return + */ + List getAuthorizeByItem(String itemType, String itemId); + + AuthorizeVO getAuthorizeByUser(); +} diff --git a/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/permission/service/OrganizeAdministratorService.java b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/permission/service/OrganizeAdministratorService.java new file mode 100644 index 0000000..de19d4b --- /dev/null +++ b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/permission/service/OrganizeAdministratorService.java @@ -0,0 +1,115 @@ +package jnpf.permission.service; + + +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import jnpf.base.Pagination; +import jnpf.permission.entity.OrganizeAdministratorEntity; +import jnpf.permission.entity.OrganizeEntity; +import jnpf.permission.model.organizeadministrator.OrganizeAdministratorListVo; +import jnpf.permission.model.organizeadministrator.OrganizeAdministratorModel; + +import java.util.List; + +/** + * + * 机构分级管理员 + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +public interface OrganizeAdministratorService extends SuperService { + + + + /** + * 获取 机构分级管理员信息 + * @param userId + * @param organizeId + * @return + */ + OrganizeAdministratorEntity getOne(String userId, String organizeId); + + /** + * 根据userId获取列表 + * @param userId + * @return + */ + List getOrganizeAdministratorEntity(String userId); + + /** + * 根据userId获取列表 + * @param userId + * @param type + * @param filterMain + * @return + */ + List getOrganizeAdministratorEntity(String userId, String type, boolean filterMain); + + /** + * 新建 + * @param entity 实体对象 + */ + void create(OrganizeAdministratorEntity entity); + + /** + * 新建 + * @param list + */ + void createList(List list, String userId); + + /** + * 更新 + * @param id 主键值 + * @param entity 实体对象 + */ + boolean update(String id, OrganizeAdministratorEntity entity); + + /** + * 删除 + * @param userId 用户id + */ + boolean deleteByUserId(String userId); + + /** + * 删除 + * @param entity 实体对象 + */ + void delete(OrganizeAdministratorEntity entity); + + /** + * 获取 OrganizeAdminIsTratorEntity 信息 + * @param id 主键值 + * @return + */ + OrganizeAdministratorEntity getInfo(String id); + + /** + * 获取 OrganizeAdminIsTratorEntity 信息 + * @param organizeId 机构主键值 + * @return + */ + OrganizeAdministratorEntity getInfoByOrganizeId(String organizeId); + + /** + * 获取 OrganizeAdminIsTratorEntity 列表 + * @param organizeIdList 机构主键值 + * @return + */ + List getListByOrganizeId(List organizeIdList); + + /** + * 获取二级管理员列表 + * + * @param pagination 分页参数 + * @return + */ + List getList(Pagination pagination); + + List getOrganizeUserList(String type); + + List getListByAuthorize(); + + OrganizeAdministratorModel getOrganizeAdministratorList(); +} diff --git a/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/permission/service/OrganizeService.java b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/permission/service/OrganizeService.java new file mode 100644 index 0000000..522b40c --- /dev/null +++ b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/permission/service/OrganizeService.java @@ -0,0 +1,400 @@ +package jnpf.permission.service; + +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; +import jnpf.base.service.SuperService; +import jnpf.permission.model.organize.OrganizeConditionModel; +import jnpf.base.ActionResult; +import jnpf.permission.entity.OrganizeEntity; + +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * 组织机构 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +public interface OrganizeService extends SuperService { + + /** + * 列表 + * + * @return + */ + List getListAll(List idAll, String keyWord); + + /** + * 列表 + * + * @return + */ + List getParentIdList(String id); + + /** + * 列表 + * + * @return + * @param filterEnabledMark + */ + List getList(boolean filterEnabledMark); + + /** + * 列表 + * + * @return + */ + List getList(String keyword, boolean filterEnabledMark); + + /** + * 获取组织信息 + * @param keyword + * @param filterEnabledMark + * @return OrgId, OrgEntity + */ + Map getOrgMaps(String keyword, boolean filterEnabledMark, SFunction... columns); + + /** + * 获取组织信息 + * @return OrgId, OrgEntity + */ + Map getOrgMapsAll(SFunction... columns); + + /** + * 列表(有效的组织) + * + * @return + */ + List getListByEnabledMark(Boolean enable); + + /** + * 列表 + * + * @param fullName 组织名称 + * @return + */ + OrganizeEntity getIdListByFullName(String fullName); + + /** + * 获取部门名列表 + * + * @return + */ + List getOrgEntityList(List idList, Boolean enable); + + /** + * 获取部门名列表(在线开发转换数据使用) + * + * @return + */ + List getOrgEntityList(Set idList); + + /** + * 全部组织(id : name) + * @return + */ + Map getOrgMap(); + + /** + * 全部组织(Encode/name : id) + * @return + * @param type + */ + Map getOrgEncodeAndName(String type); + + /** + * 全部组织(name : id) + * @return + * @param type + */ + Map getOrgNameAndId(String type); + + /** + * 获取redis存储的部门信息 + * + * @return + */ + List getOrgRedisList(); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + OrganizeEntity getInfo(String id); + + /** + * 通过名称查询id + * + * @param fullName 名称 + * @return + */ + OrganizeEntity getByFullName(String fullName); + + /** + * 通过名称 组织类型 查询id + * + * @param fullName 名称 + * @param category 类别 + * @param enCode 编码 + * @return + */ + OrganizeEntity getByFullName(String fullName,String category,String enCode); + + /** + * 验证名称 + * + * @param entity + * @param isCheck 组织名称是否不分级判断 + * @param isFilter 是否需要过滤id + * @return + */ + boolean isExistByFullName(OrganizeEntity entity, boolean isCheck, boolean isFilter); + + /** + * 获取父级id + * + * @param organizeId 组织id + * @param organizeParentIdList 父级id集合 + */ + void getOrganizeIdTree(String organizeId, List organizeParentIdList); + + /** + * 获取父级id + * + * @param organizeId 组织id + * @param organizeParentIdList 父级id集合 + */ + void getOrganizeId(String organizeId, List organizeParentIdList); + + /** + * 验证编码 + * + * @param enCode + * @param id + * @return + */ + boolean isExistByEnCode(String enCode, String id); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(OrganizeEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + */ + boolean update(String id, OrganizeEntity entity); + + /** + * 通过父级id修改父级组织树 + * + * @param entity + * @param category + */ + void update(OrganizeEntity entity, String category); + + /** + * 删除 + * + * @param orgId 实体对象 + */ + ActionResult delete(String orgId); + + /** + * 上移 + * + * @param id 主键值 + */ + boolean first(String id); + + /** + * 下移 + * + * @param id 主键值 + */ + boolean next(String id); + + /** + * 判断是否允许删除 + * + * @param orgId 主键值 + * @return + */ + String allowDelete(String orgId); + + /** + * 获取名称 + * + * @return + */ + List getOrganizeName(List id); + + /** + * 获取名称 + * + * @return + */ + Map getOrganizeName(List id, String keyword, boolean filterEnabledMark); + + /** + * 获取名称 + * + * @return + */ + List getOrganizeNameSort(List id); + + /** + * @param organizeParentId 父id + * @return List 接收子结构 + */ + List getOrganize(String organizeParentId); + + /** + * @param organizeParentId 父id + * @return List 接收子结构 + */ + List getOrganizeByOraParentId(String organizeParentId); + + /** + * 获取所有当前用户的组织及子组织 + * + * @param organizeId + * @param filterEnabledMark + * @return + */ + List getUnderOrganizations(String organizeId, boolean filterEnabledMark); + + /** + * 获取所有当前用户的组织及子组织 (有分级权限验证) + * + * @param organizeId + * @return + */ + List getUnderOrganizationss(String organizeId); + + /** + * 通过名称获取组织列表 + * + * @param fullName + * @return + */ + List getListByFullName(String fullName); + + /** + * 通过id判断是否有子集 + * + * @param id 主键 + * @return + */ + List getListByParentId(String id); + + /** + * 获取用户所有所在组织 + * + * @return 组织对象集合 + */ + List getAllOrgByUserId(String userId); + + /** + * 通过组织id树获取名称 + * + * @param orgIdTree 组织id树 + * @param regex 分隔符 + * @return 组织对象集合 + */ + String getFullNameByOrgIdTree(String orgIdTree, String regex); + + /** + * 通过组织id树获取名称 + * + * @param idNameMaps 预先获取的组织ID名称映射 + * @param orgIdTree 组织id树 + * @param regex 分隔符 + * @return 组织对象集合 + */ + String getFullNameByOrgIdTree(Map idNameMaps, String orgIdTree, String regex); + + /** + * 获取父级组织id + * + * @param entity + * @return + */ + String getOrganizeIdTree(OrganizeEntity entity); + + /** + * 获取顶级组织 + * + * @return + */ + List getOrganizeByParentId(); + + /** + * 查询用户的所属公司下的部门 + * + * @return + */ + List getDepartmentAll(String organizeId); + + /** + * 获取所在公司 + * + * @param organizeId + * @return + */ + OrganizeEntity getOrganizeCompany(String organizeId); + + /** + * 获取所在公司下部门 + * + * @return + */ + void getOrganizeDepartmentAll(String organize, List list); + + /** + * 获取组织id树 + * + * @param entity + * @return + */ + List getOrgIdTree(OrganizeEntity entity); + + /** + * 向上递归取组织id + * @param orgID + * @return + */ + List upWardRecursion(List orgIDs, String orgID); + + /** + * 查询给定的条件是否有默认当前登录者的默认部门值 + * @param organizeConditionModel + * @return + */ + String getDefaultCurrentValueDepartmentId(OrganizeConditionModel organizeConditionModel); + + /** + * 获取名称及id组成map + * + * @return + */ + Map getInfoList(); + + /** + * 列表(有效的组织) + * + * @return + */ + List getListById(Boolean enable); +} diff --git a/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/permission/service/PermissionGroupService.java b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/permission/service/PermissionGroupService.java new file mode 100644 index 0000000..fd87b31 --- /dev/null +++ b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/permission/service/PermissionGroupService.java @@ -0,0 +1,137 @@ +package jnpf.permission.service; + +import jnpf.base.Pagination; +import jnpf.base.service.SuperService; +import jnpf.permission.entity.PermissionGroupEntity; + +import java.util.List; + +public interface PermissionGroupService extends SuperService { + + /** + * 列表 + * @param pagination + * @return + */ + List list(Pagination pagination); + + /** + * 列表 + * @param filterEnabledMark + * @param ids + * @return + */ + List list(boolean filterEnabledMark, List ids); + + /** + * 详情 + * @param id + * @return + */ + PermissionGroupEntity info(String id); + + /** + * 新建 + * @param entity + * @return + */ + boolean create(PermissionGroupEntity entity); + + /** + * 修改 + * @param id 主键 + * @param entity 实体 + * @return + */ + boolean update(String id, PermissionGroupEntity entity); + + /** + * 删除 + * @param entity 实体 + * @return + */ + boolean delete(PermissionGroupEntity entity); + + /** + * 验证名称是否重复 + * @param id + * @param entity + */ + boolean isExistByFullName(String id, PermissionGroupEntity entity); + + /** + * 验证编码是否重复 + * @param id + * @param entity + */ + boolean isExistByEnCode(String id, PermissionGroupEntity entity); + + /** + * 获取权限成员 + * + * @param id 主键 + * @return + */ + PermissionGroupEntity permissionMember(String id); + + /** + * 获取权限成员 + * + * @param userId 用户主键 + * @param orgId + * @param singletonOrg + * @return + */ + List getPermissionGroupByUserId(String userId, String orgId, boolean singletonOrg); + + /** + * 获取权限成员 + * + * @param userId 用户主键 + * @return + */ + String getPermissionGroupByUserId(String userId); + + /** + * 获取权限成员 + * + * @param userId 用户主键 + * @param systemId 应用主键 + * @return + */ + String getOrgIdByUserIdAndSystemId(String userId, String systemId); + + /** + * 通过用户id获取当前权限组(只查用户) + * + * @param userId 用户主键 + * @return + */ + List getPermissionGroupAllByUserId(String userId); + + /** + * 替换权限 + * + * @param fromId + * @param toId + * @param permissionList + * @return + */ + boolean updateByUser(String fromId, String toId, List permissionList); + + /** + * 通过菜单获取权限组 + * + * @param moduleId 菜单id + * @return + */ + List getPermissionGroupByModuleId(String moduleId); + + /** + * 通过ids获取权限组列表 + * + * @param ids + * @return + */ + List list(List ids); +} diff --git a/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/permission/service/UserRelationService.java b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/permission/service/UserRelationService.java new file mode 100644 index 0000000..a3ce98c --- /dev/null +++ b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/permission/service/UserRelationService.java @@ -0,0 +1,189 @@ +package jnpf.permission.service; + +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import jnpf.permission.entity.UserRelationEntity; +import jnpf.permission.model.permission.PermissionModel; +import jnpf.permission.model.permission.PermissionVoBase; +import jnpf.permission.model.userrelation.UserRelationForm; + +import java.util.List; + +/** + * 用户关系 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +public interface UserRelationService extends SuperService { + + /** + * 根据用户主键获取列表 + * + * @param userId 用户主键 + * @return + */ + List getListByUserId(String userId); + + List getListByUserIdAndObjType(String userId, String objectType); + /** + * 根据用户主键获取列表 + * + * @param userId 用户主键 + * @return + */ + List getListByUserIdAll(List userId); + + /** + * 根据对象主键获取列表 + * + * @param objectId 对象主键 + * @return + */ + List getListByObjectId(String objectId); + + /** + * 根据对象主键获取列表 + * + * @param objectType + * @return + */ + List getListByObjectType(String objectType); + + List getListByObjectId(String objectId, String objectType); + + /** + * 根据对象主键获取列表 + * + * @param objectId 对象主键 + * @return + */ + List getListByObjectIdAll(List objectId); + + /** + * 根据对象主键删除数据 + * + * @param objId 对象主键 + * @return + */ + void deleteAllByObjId(String objId); + + /** + * 删除用户所有的关联关系 + * @param userId 用户ID + */ + void deleteAllByUserId(String userId); + + /** + * 保存用户关系 + * @param userRelationEntityList 用户关系集合 + */ + void createByList(List userRelationEntityList); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + UserRelationEntity getInfo(String id); + + /** + * 创建 + * + * @param objectId 对象主键 + * @param entitys 实体对象 + */ + void save(String objectId, List entitys); + + /** + * 创建 + * + * @param list 实体对象 + */ + void save(List list); + + /** + * 删除 + * + * @param ids 主键值 + */ + void delete(String[] ids); + + /** + * 添加岗位或角色成员 + */ + void saveObjectId(String objectId, UserRelationForm userRelationForm); + + void roleSaveByUserIds(String roleId, List userIds); + + /** + * 通过用户id查询用户组织关系 + * + * @param userIds + */ + List getRelationByUserIds(List userIds); + + /** + * 获取用户组织/岗位/角色集合 + * @param userId + * @return + */ + List getListByObjectType(String userId, String objectType); + + /** + * 获取用户所有组织关系 + * + * @param userId 用户id + * @return 组织关系集合 + */ + List getAllOrgRelationByUserId(String userId); + + /** + * 获取个人信息页面用户组织/岗位/角色集合 + * + * @param objectType 归属类型 + */ + List getObjectVoList(String objectType); + + /** + * 判断岗位/角色与用户是否存在关联关系 + * + * @param objectType 类型 + * @param objectId 岗位/角色ID + * @return 存在判断 + */ + Boolean existByObj(String objectType, String objectId); + + /** + * 获取用户组织关联关系,通过组织ID + */ + List getListByRoleId(String roleId); + + + /** + * 根据用户id获取关系 + * + * @param userId 用户主键 + * @param objectType 类型 + * @return + */ + List getListByUserId(String userId, String objectType); + + /** + * 判断组织下有哪些人 + * + * @param orgIdList 组织id + * @return + */ + List getListByOrgId(List orgIdList); + + /** + * 把钉钉用户的组织关联生成 + * @param sysObjId + * @param deptIdList + */ + void syncDingUserRelation(String sysObjId, List deptIdList); +} diff --git a/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/permission/service/UserService.java b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/permission/service/UserService.java new file mode 100644 index 0000000..3cdc7fd --- /dev/null +++ b/jnpf-java-boot/jnpf-public/jnpf-provider/src/main/java/jnpf/permission/service/UserService.java @@ -0,0 +1,399 @@ +package jnpf.permission.service; + +import jnpf.base.service.SuperService; +import jnpf.base.Page; +import jnpf.base.Pagination; +import jnpf.base.vo.DownloadVO; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.model.user.UserIdListVo; +import jnpf.permission.model.user.mod.UserConditionModel; +import jnpf.permission.model.user.page.PaginationUser; +import jnpf.permission.model.user.vo.UserByRoleVO; +import jnpf.permission.model.user.vo.UserExportVO; +import jnpf.permission.model.user.vo.UserImportVO; + +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * 用户信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +public interface UserService extends SuperService { + + /*======================get接口========================*/ + + List getAdminList(); + + /** + * 列表 + * + * @param pagination 条件 + * @return + */ + List getList(Pagination pagination, String organizeId, Boolean flag, Boolean filter); + + /** + * 列表 + * + * @param pagination 条件 + * @param filterCurrentUser + * @return + */ + List getList(Pagination pagination, Boolean filterCurrentUser); + + /** + * 通过关键字查询 + * + * @param pagination + * @return + */ + List getUserPage(Pagination pagination); + + /** + * 通过组织id获取用户列表 + * + * @param organizeId 组织id + * @param keyword 关键字 + * @return + */ + List getListByOrganizeId(String organizeId, String keyword); + + /** + * 列表 + * + * @return + * @param enabledMark + */ + List getList(boolean enabledMark); + + /** + * 用户名列表(在线开发) + * + * @param idList + * @return + */ + List getUserNameList(List idList); + + /** + * 用户名列表(在线开发) + * + * @param idList + * @return + */ + List getUserNameList(Set idList); + + + /** + * (id : name/account) + * @return + */ + Map getUserMap(); + + + /** + * ( name/account: id) + * @return + */ + Map getUserNameAndIdMap(); + + /** + * 通过名称查询id + * + * @return + */ + UserEntity getByRealName(String realName); + + + /** + * 通过名称查询id + * + * @return + */ + UserEntity getByRealName(String realName,String account); + + /** + * 列表 + * + * @param managerId 主管Id + * @param keyword 关键字 + * @return + */ + List getListByManagerId(String managerId, String keyword); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + UserEntity getInfo(String id); + + /** + * 信息 + * + * @param account 账户 + * @return + */ + UserEntity getUserByAccount(String account); + /** + * 信息 + * + * @param mobile 手机号码 + * @return + */ + UserEntity getUserByMobile(String mobile); + + /*==============================================*/ + + Boolean setAdminListByIds(List adminIds); + + /** + * 验证账户 + * + * @param account 账户 + * @return + */ + boolean isExistByAccount(String account); + + /** + * 创建 + * + * @param entity 实体对象 + */ + Boolean create(UserEntity entity) throws Exception; + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + */ + Boolean update(String id, UserEntity entity) throws Exception; + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(UserEntity entity); + + /** + * 修改密码 + * + * @param entity 实体对象 + */ + void updatePassword(UserEntity entity); + + /** + * 查询用户名称 + * + * @param id 主键值 + * @return + */ + List getUserName(List id); + + /** + * 查询用户名称 + * + * @param id 主键值 + * @return + */ + List getUserName(List id, boolean filterEnabledMark); + + /** + * 查询用户名称 + * + * @param id 主键值 + * @return + */ + List getListByUserIds(List id); + + /** + * 查询出分页被禁用的账号 + * + * @param id 主键值 + * @return + */ + List getUserList(List id); + + /** + * 通过account返回user实体 + * + * @param account 账户 + * @return + */ + UserEntity getUserEntity(String account); + + /** + * 获取用户id + * + * @return + */ + List getListId(); + + /** + * 添加岗位或角色成员 + * + * @param entity + */ + void update(UserEntity entity, String type); + + /** + * 添加岗位或角色成员 + * + * @param entity + */ + void updateLastTime(UserEntity entity, String type); + + /** + * 判断是否为自己的下属 + * + * @param id + * @param managerId + * @return + */ + boolean isSubordinate(String id, String managerId); + + /** + * 导出Excel + * + * @param dataType + * @param selectKey + * @param pagination + * @return + */ + DownloadVO exportExcel(String dataType, String selectKey, PaginationUser pagination); + + /** + * 导入预览 + * + * @param personList + * @return + */ + Map importPreview(List personList); + + /** + * 导入数据 + * + * @param dataList 数据源 + */ + UserImportVO importData(List dataList); + + /** + * 通过组织id获取上级id集合 + * + * @param organizeId + * @param organizeParentIdList + */ + void getOrganizeIdTree(String organizeId, StringBuffer organizeParentIdList); + + /** + * 导出错误报告 + * + * @param dataList + * @return + */ + DownloadVO exportExceptionData(List dataList); + + /** + * 候选人分页查询 + * + * @param id + * @param pagination + * @return + */ + List getUserName(List id, Pagination pagination); + + /** + * 候选人分页查询 + * + * @param id + * @param pagination + * @param flag 是否过滤自己 + * @return + */ + List getUserNames(List id, Pagination pagination, Boolean flag, Boolean enabledMark); + + /** + * 根据角色ID获取所在组织下的所有成员 + * @param roleId 角色ID + * @return + */ + List getListByRoleId(String roleId); + + + /** + * 删除在线的角色用户 + */ + Boolean delCurRoleUser(List objectIdAll); + + /** + * 删除在线用户 + * @param userIds 用户IDs + * @return 执行结果 + */ + Boolean delCurUser(String... userIds); + + /** + * 获取用户信息 + * + * + * @param orgIdList + * @param keyword + * @return + */ + List getList(List orgIdList, String keyword); + + /** + * 得到用户关系 + * + * @param userIds + * @param type + * @return + */ + List getUserIdList(List userIds, String type); + + /** + * 得到用户关系 + * + * @param userIds + * @return + */ + List getObjList(List userIds, Pagination pagination, String type); + + /** + * 获取用户下拉框列表 + */ + List getListByAuthorize(String organizeId, Page page); + + /** + * 查询给定的条件是否有默认当前登录者的默认用户值 + * @param userConditionModel + * @return + */ + String getDefaultCurrentValueUserId(UserConditionModel userConditionModel); + + List getListByRoleIds(List roleIds); + + /** + * 通过ids转换数据 + * + * @param ids + * @return + */ + List getFullNameByIds(List ids); + + /** + * 通过ids返回相应的数据 + * + * @param ids + * @return + */ + List selectedByIds(List ids); +} diff --git a/jnpf-java-boot/jnpf-scheduletask/jnpf-scheduletask-biz/pom.xml b/jnpf-java-boot/jnpf-scheduletask/jnpf-scheduletask-biz/pom.xml new file mode 100644 index 0000000..5b16ed7 --- /dev/null +++ b/jnpf-java-boot/jnpf-scheduletask/jnpf-scheduletask-biz/pom.xml @@ -0,0 +1,32 @@ + + + + jnpf-scheduletask + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-scheduletask-biz + + + + com.jnpf + jnpf-common-all + ${project.version} + + + com.jnpf + jnpf-common-scheduletask + ${project.version} + + + com.jnpf + jnpf-system-biz + ${project.version} + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-scheduletask/jnpf-scheduletask-biz/src/main/java/jnpf/scheduletask/task/ScheduleTaskHandler.java b/jnpf-java-boot/jnpf-scheduletask/jnpf-scheduletask-biz/src/main/java/jnpf/scheduletask/task/ScheduleTaskHandler.java new file mode 100644 index 0000000..d17668a --- /dev/null +++ b/jnpf-java-boot/jnpf-scheduletask/jnpf-scheduletask-biz/src/main/java/jnpf/scheduletask/task/ScheduleTaskHandler.java @@ -0,0 +1,138 @@ +package jnpf.scheduletask.task; + +import com.xxl.job.core.context.XxlJobHelper; +import com.xxl.job.core.handler.annotation.XxlJob; +import jnpf.base.UserInfo; +import jnpf.base.entity.DataInterfaceEntity; +import jnpf.base.service.DataInterfaceService; +import jnpf.base.service.DbLinkService; +import jnpf.scheduletask.entity.TimeTaskEntity; +import jnpf.scheduletask.model.ContentNewModel; +import jnpf.scheduletask.model.TaskParameterModel; +import jnpf.util.JsonUtil; +import jnpf.util.StringUtil; +import jnpf.util.data.DataSourceContextHolder; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.HashMap; +import java.util.Map; + +/** + * Api和数据接口使用 + * + * @author :JNPF开发平台组 + * @version: V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date :2022/3/23 9:25 + */ +@Component +public class ScheduleTaskHandler { + + @Autowired + private DataInterfaceService dataInterfaceService; + @Autowired + private DbLinkService dbLinkService; + + @XxlJob("defaultHandler") + public void defaultHandler() { + // 获取参数 + String param = XxlJobHelper.getJobParam(); + // 转换成模型 + TimeTaskEntity entity = JsonUtil.getJsonToBean(param, TimeTaskEntity.class); + ContentNewModel model = JsonUtil.getJsonToBean(param, ContentNewModel.class); + // 如果是http + if ("1".equals(entity.getExecuteType())) { + Boolean callHttp = callHttp(model); +// if (callHttp) { +// XxlJobHelper.handleResult(ReturnT.SUCCESS_CODE, "调用成功"); +// } else { +// XxlJobHelper.handleResult(ReturnT.FAIL_CODE, "调用失败"); +// } + } else if ("2".equals(entity.getExecuteType())) { + boolean callSql = callSql(model); +// if ( callSql) { +// XxlJobHelper.handleResult(ReturnT.SUCCESS_CODE, "调用成功"); +// } else { +// XxlJobHelper.handleResult(ReturnT.FAIL_CODE, "调用失败"); +// } + } + } + + // ---------------START callSQL + + /** + * 调用SQL + * + * @param model 系统调度参数 + */ + private boolean callSql(ContentNewModel model) { + try { + UserInfo userInfo = model.getUserInfo(); + // 切换数据源 + if (userInfo != null && StringUtil.isNotEmpty(userInfo.getTenantId())) { + DataSourceContextHolder.setDatasource(userInfo.getTenantId(), userInfo.getTenantDbConnectionString(), userInfo.isAssignDataSource()); + } + // 得到数据接口信息 + String tenantId = StringUtil.isNotEmpty(model.getUserInfo().getTenantId()) ? model.getUserInfo().getTenantId() : "0"; + DataInterfaceEntity entity = dataInterfaceService.getInfo(model.getInterfaceId()); + if (entity != null) { + Map map = null; + if (model.getParameter() != null && model.getParameter().size() > 0) { + map = new HashMap<>(16); + for (TaskParameterModel parameterModel : model.getParameter()) { + if (StringUtil.isNotEmpty(parameterModel.getValue())) { + map.put(parameterModel.getField(), parameterModel.getValue()); + } else { + map.put(parameterModel.getField(), parameterModel.getDefaultValue()); + } + } + } + dataInterfaceService.infoToId(entity.getId(), tenantId, map, userInfo.getToken(), null, null, null, null); + } + } catch (Exception e) { + e.printStackTrace(); + } + return false; + } + + // ---------------START callHttp + + /** + * HTTP调用 + * + * @param model 系统调度参数 + * @return + */ + private Boolean callHttp(ContentNewModel model) { + try { + UserInfo userInfo = model.getUserInfo(); + // 切换数据源 + if (userInfo != null && StringUtil.isNotEmpty(userInfo.getTenantId())) { + DataSourceContextHolder.setDatasource(userInfo.getTenantId(), userInfo.getTenantDbConnectionString(), userInfo.isAssignDataSource()); + } + // 得到数据接口信息 + String tenantId = StringUtil.isNotEmpty(model.getUserInfo().getTenantId()) ? model.getUserInfo().getTenantId() : "0"; + DataInterfaceEntity entity = dataInterfaceService.getInfo(model.getInterfaceId()); + if (entity != null) { + Map map = null; + if (model.getParameter() != null && model.getParameter().size() > 0) { + map = new HashMap<>(16); + for (TaskParameterModel parameterModel : model.getParameter()) { + if (StringUtil.isNotEmpty(parameterModel.getValue())) { + map.put(parameterModel.getField(), parameterModel.getValue()); + } else { + map.put(parameterModel.getField(), parameterModel.getDefaultValue()); + } + } + } + dataInterfaceService.infoToId(entity.getId(), tenantId, map, userInfo.getToken(), null, null, null, null); + } + } catch (Exception e) { + e.printStackTrace(); + } + return false; + } + + +} diff --git a/jnpf-java-boot/jnpf-scheduletask/jnpf-scheduletask-controller/pom.xml b/jnpf-java-boot/jnpf-scheduletask/jnpf-scheduletask-controller/pom.xml new file mode 100644 index 0000000..88a7075 --- /dev/null +++ b/jnpf-java-boot/jnpf-scheduletask/jnpf-scheduletask-controller/pom.xml @@ -0,0 +1,22 @@ + + + + jnpf-scheduletask + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-scheduletask-controller + + + + com.jnpf + jnpf-scheduletask-biz + ${project.version} + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-scheduletask/jnpf-scheduletask-controller/src/main/java/jnpf/scheduletask/controller/TimeTaskController.java b/jnpf-java-boot/jnpf-scheduletask/jnpf-scheduletask-controller/src/main/java/jnpf/scheduletask/controller/TimeTaskController.java new file mode 100644 index 0000000..d506623 --- /dev/null +++ b/jnpf-java-boot/jnpf-scheduletask/jnpf-scheduletask-controller/src/main/java/jnpf/scheduletask/controller/TimeTaskController.java @@ -0,0 +1,186 @@ +package jnpf.scheduletask.controller; + +import com.alibaba.fastjson.JSONObject; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.UserInfo; +import jnpf.base.Pagination; +import jnpf.constant.MsgCode; +import jnpf.scheduletask.entity.HandlerNameEntity; +import jnpf.scheduletask.entity.TimeTaskEntity; +import jnpf.exception.DataException; +import jnpf.scheduletask.model.*; +import jnpf.scheduletask.rest.RestScheduleTaskUtil; +import jnpf.util.JsonUtil; +import jnpf.util.JsonUtilEx; +import jnpf.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.ArrayList; +import java.util.List; + +/** + * 任务调度 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Tag(name = "任务调度", description = "TimeTask") +@RestController +@RequestMapping("/api/scheduletask") +public class TimeTaskController { + + @Autowired + private UserProvider userProvider; + + /** + * 获取任务调度列表 + * + * @param pagination + * @return + */ + @Operation(summary = "获取任务调度列表") + @GetMapping + public JSONObject list(Pagination pagination) { + UserInfo userInfo = userProvider.get(); + return RestScheduleTaskUtil.getList(pagination, userInfo); + } + + /** + * 获取本地任务列表 + * + * @return + */ + @Operation(summary = "获取任务调度列表") + @GetMapping("/TaskMethods") + public ActionResult> taskMethods() { + List list = new ArrayList<>(16); + // 获取所有handlerName + List handlerNameEntities = RestScheduleTaskUtil.getHandlerList(); + for (HandlerNameEntity entity : handlerNameEntities) { + TaskMethodsVO taskMethodsVO = new TaskMethodsVO(); + taskMethodsVO.setId(entity.getId()); + taskMethodsVO.setFullName(entity.getHandlerName()); + list.add(taskMethodsVO); + } + return ActionResult.success(list); + } + + /** + * 获取任务调度日志列表 + * + * @param pagination + * @param taskId 任务Id + * @return + */ + @Operation(summary = "获取任务调度日志列表") + @GetMapping("/{id}/TaskLog") + public JSONObject list(@PathVariable("id") String taskId, TaskPage pagination) { + return RestScheduleTaskUtil.getLogList(taskId, userProvider.get(), pagination); + } + + /** + * 获取任务调度信息 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "获取任务调度信息") + @GetMapping("/Info/{id}") + public ActionResult info(@PathVariable("id") String id) throws DataException { + TimeTaskEntity entity = RestScheduleTaskUtil.getInfo(id, userProvider.get()); + TaskInfoVO vo = JsonUtilEx.getJsonToBeanEx(entity, TaskInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 新建任务调度 + * + * @param taskCrForm + * @return + */ + @Operation(summary = "新建任务调度") + @PostMapping + public ActionResult create(@RequestBody @Valid TaskCrForm taskCrForm) { + taskCrForm.setUserInfo(userProvider.get()); + JSONObject jsonObject = RestScheduleTaskUtil.create(taskCrForm); + return JsonUtil.getJsonToBean(jsonObject, ActionResult.class); + } + + /** + * 修改任务调度 + * + * @param id 主键值 + * @param taskUpForm + * @return + */ + @Operation(summary = "修改任务调度") + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid TaskUpForm taskUpForm) { + taskUpForm.setUserInfo(userProvider.get()); + JSONObject jsonObject = RestScheduleTaskUtil.update(id, taskUpForm); + return JsonUtil.getJsonToBean(jsonObject, ActionResult.class); + } + + /** + * 删除任务 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "删除任务") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + JSONObject jsonObject = RestScheduleTaskUtil.delete(id, userProvider.get()); + return JsonUtil.getJsonToBean(jsonObject, ActionResult.class); + } + + /** + * 停止任务调度 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "停止任务调度") + @PutMapping("/{id}/Actions/Stop") + public ActionResult stop(@PathVariable("id") String id) { + UpdateTaskModel updateTaskModel = new UpdateTaskModel(); + TimeTaskEntity entity = RestScheduleTaskUtil.getInfo(id, userProvider.get()); + if (entity != null) { + entity.setEnabledMark(0); + entity.setRunCount(entity.getRunCount()); + updateTaskModel.setEntity(entity); + updateTaskModel.setUserInfo(userProvider.get()); + RestScheduleTaskUtil.updateTask(updateTaskModel); + return ActionResult.success(MsgCode.SU005.get()); + } + return ActionResult.fail("操作失败,任务不存在"); + } + + /** + * 启动任务调度 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "启动任务调度") + @PutMapping("/{id}/Actions/Enable") + public ActionResult enable(@PathVariable("id") String id) { + UpdateTaskModel updateTaskModel = new UpdateTaskModel(); + TimeTaskEntity entity = RestScheduleTaskUtil.getInfo(id, userProvider.get()); + if (entity != null) { + entity.setEnabledMark(1); + updateTaskModel.setEntity(entity); + updateTaskModel.setUserInfo(userProvider.get()); + RestScheduleTaskUtil.updateTask(updateTaskModel); + return ActionResult.success(MsgCode.SU005.get()); + } + return ActionResult.fail("操作失败,任务不存在"); + } + +} diff --git a/jnpf-java-boot/jnpf-scheduletask/pom.xml b/jnpf-java-boot/jnpf-scheduletask/pom.xml new file mode 100644 index 0000000..8249821 --- /dev/null +++ b/jnpf-java-boot/jnpf-scheduletask/pom.xml @@ -0,0 +1,20 @@ + + + + jnpf-java-boot + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-scheduletask + pom + + jnpf-scheduletask-controller + jnpf-scheduletask-biz + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/pom.xml b/jnpf-java-boot/jnpf-system/jnpf-system-biz/pom.xml new file mode 100644 index 0000000..43fa25f --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/pom.xml @@ -0,0 +1,50 @@ + + + + jnpf-system + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-system-biz + + + + com.jnpf + jnpf-provider + ${project.version} + + + com.jnpf + jnpf-oauth-api + ${project.version} + + + com.jnpf + jnpf-message-entity + ${project.version} + + + com.github.oshi + oshi-core + + + org.springframework.boot + spring-boot-starter-mail + + + com.baomidou + mybatis-plus-generator + + + com.baomidou + mybatis-plus-core + + + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/AdvancedQueryMapper.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/AdvancedQueryMapper.java new file mode 100644 index 0000000..0f5c5a5 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/AdvancedQueryMapper.java @@ -0,0 +1,8 @@ +package jnpf.base.mapper; + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.base.entity.AdvancedQueryEntity; + +public interface AdvancedQueryMapper extends SuperMapper { +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/BaseComFieldsMapper.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/BaseComFieldsMapper.java new file mode 100644 index 0000000..f9aadf2 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/BaseComFieldsMapper.java @@ -0,0 +1,16 @@ +package jnpf.base.mapper; + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.base.entity.ComFieldsEntity; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:28 + */ +public interface BaseComFieldsMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/BillRuleMapper.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/BillRuleMapper.java new file mode 100644 index 0000000..a79f01a --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/BillRuleMapper.java @@ -0,0 +1,18 @@ +package jnpf.base.mapper; + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.base.entity.BillRuleEntity; + + +/** + * 单据规则 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +public interface BillRuleMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/CommonWordsMapper.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/CommonWordsMapper.java new file mode 100644 index 0000000..e27b2b6 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/CommonWordsMapper.java @@ -0,0 +1,16 @@ +package jnpf.base.mapper; + + +import jnpf.base.entity.CommonWordsEntity; + +/** + * 审批常用语 + * + * @author JNPF开发平台组 YanYu + * @version v3.4.6 + * @copyrignt 引迈信息技术有限公司 + * @date 2023-01-06 + */ +public interface CommonWordsMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/DataInterfaceLogMapper.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/DataInterfaceLogMapper.java new file mode 100644 index 0000000..25aea53 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/DataInterfaceLogMapper.java @@ -0,0 +1,17 @@ +package jnpf.base.mapper; + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.base.entity.DataInterfaceLogEntity; + +/** + * 数据接口调用日志 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-06-03 + */ +public interface DataInterfaceLogMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/DataInterfaceMapper.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/DataInterfaceMapper.java new file mode 100644 index 0000000..2798758 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/DataInterfaceMapper.java @@ -0,0 +1,19 @@ +package jnpf.base.mapper; + + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.base.entity.DataInterfaceEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:30 + */ +@Mapper +public interface DataInterfaceMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/DataInterfaceUserMapper.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/DataInterfaceUserMapper.java new file mode 100644 index 0000000..175f4fc --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/DataInterfaceUserMapper.java @@ -0,0 +1,17 @@ +package jnpf.base.mapper; + + +import jnpf.base.entity.DataInterfaceEntity; +import jnpf.base.entity.DataInterfaceUserEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * @author JNPF开发平台组 + * @version V3.4.7 + * @copyright 引迈信息技术有限公司 + * @date 2021/9/20 9:22 + */ +@Mapper +public interface DataInterfaceUserMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/DataInterfaceVariateMapper.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/DataInterfaceVariateMapper.java new file mode 100644 index 0000000..f83c688 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/DataInterfaceVariateMapper.java @@ -0,0 +1,17 @@ +package jnpf.base.mapper; + +import jnpf.base.entity.DataInterfaceVariateEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 数据接口 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-03-23 + */ +@Mapper +public interface DataInterfaceVariateMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/DataMapMapper.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/DataMapMapper.java new file mode 100644 index 0000000..6747018 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/DataMapMapper.java @@ -0,0 +1,19 @@ +package jnpf.base.mapper; + + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.base.entity.VisualDataMapEntity; + +/** + * + * 大屏地图 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +public interface DataMapMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/DbLinkMapper.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/DbLinkMapper.java new file mode 100644 index 0000000..c67286a --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/DbLinkMapper.java @@ -0,0 +1,18 @@ +package jnpf.base.mapper; + + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.database.model.entity.DbLinkEntity; + +/** + * 数据连接 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +public interface DbLinkMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/DbTableMapper.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/DbTableMapper.java new file mode 100644 index 0000000..50f2ba0 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/DbTableMapper.java @@ -0,0 +1,13 @@ +package jnpf.base.mapper; + +/** + * 数据管理 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +public interface DbTableMapper { + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/DictionaryDataMapper.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/DictionaryDataMapper.java new file mode 100644 index 0000000..68fca3b --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/DictionaryDataMapper.java @@ -0,0 +1,18 @@ +package jnpf.base.mapper; + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.base.entity.DictionaryDataEntity; + + +/** + * 字典数据 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +public interface DictionaryDataMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/DictionaryTypeMapper.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/DictionaryTypeMapper.java new file mode 100644 index 0000000..b019054 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/DictionaryTypeMapper.java @@ -0,0 +1,18 @@ +package jnpf.base.mapper; + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.base.entity.DictionaryTypeEntity; + + +/** + * 字典分类 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +public interface DictionaryTypeMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/InterfaceOauthMapper.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/InterfaceOauthMapper.java new file mode 100644 index 0000000..16756ec --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/InterfaceOauthMapper.java @@ -0,0 +1,18 @@ +package jnpf.base.mapper; + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.base.entity.InterfaceOauthEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 接口认证 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/6/8 9:51 + */ +@Mapper +public interface InterfaceOauthMapper extends SuperMapper { +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/MessageTemplateMapper.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/MessageTemplateMapper.java new file mode 100644 index 0000000..7885ac9 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/MessageTemplateMapper.java @@ -0,0 +1,21 @@ +package jnpf.base.mapper; + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.base.entity.MessageTemplateEntity; + +/** + * 消息模板 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年12月8日17:40:37 + */ +public interface MessageTemplateMapper extends SuperMapper { + +} + + + + diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ModuleButtonMapper.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ModuleButtonMapper.java new file mode 100644 index 0000000..fa44cc5 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ModuleButtonMapper.java @@ -0,0 +1,18 @@ +package jnpf.base.mapper; + + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.base.entity.ModuleButtonEntity; + +/** + * 按钮权限 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +public interface ModuleButtonMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ModuleColumnMapper.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ModuleColumnMapper.java new file mode 100644 index 0000000..8132d46 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ModuleColumnMapper.java @@ -0,0 +1,18 @@ +package jnpf.base.mapper; + + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.base.entity.ModuleColumnEntity; + +/** + * 列表权限 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +public interface ModuleColumnMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ModuleDataAuthorizeLinkDataMapper.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ModuleDataAuthorizeLinkDataMapper.java new file mode 100644 index 0000000..8f7edc3 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ModuleDataAuthorizeLinkDataMapper.java @@ -0,0 +1,19 @@ +package jnpf.base.mapper; + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.base.entity.ModuleDataAuthorizeLinkEntity; +import jnpf.base.entity.ModuleDataAuthorizeSchemeEntity; + + +/** + * 数据权限方案 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +public interface ModuleDataAuthorizeLinkDataMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ModuleDataAuthorizeMapper.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ModuleDataAuthorizeMapper.java new file mode 100644 index 0000000..6871d1d --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ModuleDataAuthorizeMapper.java @@ -0,0 +1,18 @@ +package jnpf.base.mapper; + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.base.entity.ModuleDataAuthorizeEntity; + + +/** + * 数据权限配置 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +public interface ModuleDataAuthorizeMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ModuleDataAuthorizeSchemeMapper.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ModuleDataAuthorizeSchemeMapper.java new file mode 100644 index 0000000..cb0f61b --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ModuleDataAuthorizeSchemeMapper.java @@ -0,0 +1,18 @@ +package jnpf.base.mapper; + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.base.entity.ModuleDataAuthorizeSchemeEntity; + + +/** + * 数据权限方案 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +public interface ModuleDataAuthorizeSchemeMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ModuleFormMapper.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ModuleFormMapper.java new file mode 100644 index 0000000..a43a552 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ModuleFormMapper.java @@ -0,0 +1,18 @@ +package jnpf.base.mapper; + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.base.entity.ModuleFormEntity; + + +/** + * 表单权限 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +public interface ModuleFormMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ModuleMapper.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ModuleMapper.java new file mode 100644 index 0000000..b0dd508 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ModuleMapper.java @@ -0,0 +1,18 @@ +package jnpf.base.mapper; + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.base.entity.ModuleEntity; + + +/** + * 系统功能 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +public interface ModuleMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/PortalManageMapper.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/PortalManageMapper.java new file mode 100644 index 0000000..cef884a --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/PortalManageMapper.java @@ -0,0 +1,32 @@ +package jnpf.base.mapper; + +import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO; +import jnpf.base.entity.PortalManageEntity; +import jnpf.base.model.portalManage.PortalManagePage; +import jnpf.base.model.portalManage.PortalManagePageDO; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + +/** + * 虎门管理 + * + * @author JNPF开发平台组 YanYu + * @version V3.4.6 + * @copyright 引迈信息技术有限公司 + * @date 2023.02.17 + */ +public interface PortalManageMapper extends SuperMapper { + + @Select("SELECT f_full_name FROM base_portal WHERE F_Id = #{portalId}") + String getPortalFullName(String portalId); + + @Select("SELECT f_category FROM base_portal WHERE F_Id = #{portalId}") + String getPortalCategoryId(String portalId); + + PageDTO selectPortalManageDoPage(PageDTO page, @Param("pmPage") PortalManagePage pmPage); + + List selectPortalManageDoList(@Param("pmPage") PortalManagePage pmPage); + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/PrintDevMapper.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/PrintDevMapper.java new file mode 100644 index 0000000..de1db62 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/PrintDevMapper.java @@ -0,0 +1,16 @@ +package jnpf.base.mapper; + +import jnpf.base.mapper.SuperMapper; +import jnpf.base.entity.PrintDevEntity; + +/** + * 打印模板-mapper + * + * @author JNPF开发平台组 YY + * @version V3.2.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月30日 + */ +public interface PrintDevMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/PrintLogMapper.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/PrintLogMapper.java new file mode 100644 index 0000000..607592b --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/PrintLogMapper.java @@ -0,0 +1,11 @@ +package jnpf.base.mapper; + +import jnpf.base.mapper.SuperMapper; +import jnpf.base.entity.PrintLogEntity; +import org.apache.ibatis.annotations.Mapper; +import org.springframework.stereotype.Repository; + +@Mapper +@Repository +public interface PrintLogMapper extends SuperMapper { +} \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ProvinceAtlasMapper.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ProvinceAtlasMapper.java new file mode 100644 index 0000000..f1a4233 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ProvinceAtlasMapper.java @@ -0,0 +1,16 @@ +package jnpf.base.mapper; + +import jnpf.base.entity.ProvinceAtlasEntity; + + +/** + * 行政区划-地图 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月27日 上午9:18 + */ +public interface ProvinceAtlasMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ProvinceMapper.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ProvinceMapper.java new file mode 100644 index 0000000..1b996d1 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ProvinceMapper.java @@ -0,0 +1,18 @@ +package jnpf.base.mapper; + + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.base.entity.ProvinceEntity; + +/** + * 行政区划 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +public interface ProvinceMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ScheduleLogMapper.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ScheduleLogMapper.java new file mode 100644 index 0000000..208b5b0 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ScheduleLogMapper.java @@ -0,0 +1,16 @@ +package jnpf.base.mapper; + + +import jnpf.base.entity.ScheduleLogEntity; + +/** + * 单据规则 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月27日 上午9:18 + */ +public interface ScheduleLogMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ScheduleNewMapper.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ScheduleNewMapper.java new file mode 100644 index 0000000..8e10475 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ScheduleNewMapper.java @@ -0,0 +1,16 @@ +package jnpf.base.mapper; + + +import jnpf.base.entity.ScheduleNewEntity; + +/** + * 单据规则 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月27日 上午9:18 + */ +public interface ScheduleNewMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ScheduleNewUserMapper.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ScheduleNewUserMapper.java new file mode 100644 index 0000000..42d247e --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/ScheduleNewUserMapper.java @@ -0,0 +1,16 @@ +package jnpf.base.mapper; + + +import jnpf.base.entity.ScheduleNewUserEntity; + +/** + * 单据规则 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月27日 上午9:18 + */ +public interface ScheduleNewUserMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/SignMapper.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/SignMapper.java new file mode 100644 index 0000000..2b142f9 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/SignMapper.java @@ -0,0 +1,15 @@ +package jnpf.base.mapper; + +import jnpf.permission.entity.SignEntity; + + +/** + * 个人签名 + * + * @author JNPF开发平台组 + * @copyright 引迈信息技术有限公司 + * @date 2022年9月2日 上午9:18 + */ +public interface SignMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/SmsTemplateMapper.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/SmsTemplateMapper.java new file mode 100644 index 0000000..0a14b6c --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/SmsTemplateMapper.java @@ -0,0 +1,19 @@ +package jnpf.base.mapper; + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.base.entity.SmsTemplateEntity; + +/** +* @author Administrator +* @description 针对表【base_sms_template】的数据库操作Mapper +* @createDate 2021-12-09 10:12:52 +* @Entity generator.domain.SmsTemplate +*/ +public interface SmsTemplateMapper extends SuperMapper { + +} + + + + diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/SysconfigMapper.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/SysconfigMapper.java new file mode 100644 index 0000000..cca7f26 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/SysconfigMapper.java @@ -0,0 +1,23 @@ +package jnpf.base.mapper; + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.base.entity.SysConfigEntity; + + +/** + * 系统配置 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +public interface SysconfigMapper extends SuperMapper { + + int deleteFig(); + + int deleteMpFig(); + + int deleteQyhFig(); +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/SystemMapper.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/SystemMapper.java new file mode 100644 index 0000000..6de5ee4 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/mapper/SystemMapper.java @@ -0,0 +1,18 @@ +package jnpf.base.mapper; + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.base.entity.SystemEntity; + + +/** + * 系统 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +public interface SystemMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/AdvancedQueryService.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/AdvancedQueryService.java new file mode 100644 index 0000000..be6fbfe --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/AdvancedQueryService.java @@ -0,0 +1,26 @@ +package jnpf.base.service; + +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import jnpf.base.UserInfo; +import jnpf.base.entity.AdvancedQueryEntity; + +import java.util.List; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2022/5/30 + */ + +public interface AdvancedQueryService extends SuperService { + + void create(AdvancedQueryEntity advancedQueryEntity); + + AdvancedQueryEntity getInfo(String id,String userId); + + List getList(String moduleId, UserInfo userInfo); +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/BillRuleService.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/BillRuleService.java new file mode 100644 index 0000000..e8bbad5 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/BillRuleService.java @@ -0,0 +1,145 @@ +package jnpf.base.service; + +import jnpf.base.model.billrule.BillRulePagination; +import jnpf.base.ActionResult; +import jnpf.base.Pagination; +import jnpf.base.entity.BillRuleEntity; +import jnpf.exception.DataException; + +import java.util.List; + +/** + * 单据规则 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +public interface BillRuleService extends SuperService { + + /** + * 列表 + * + * @param pagination 条件 + * @return 单据规则列表 + */ + List getList(BillRulePagination pagination); + + /** + * 列表 + * + * @return 单据规则集合 + */ + List getList(); + + /** + * 信息 + * + * @param id 主键值 + * @return 单据规则 + */ + BillRuleEntity getInfo(String id); + + /** + * 验证名称 + * + * @param fullName 名称 + * @param id 主键值 + * @return ignore + */ + boolean isExistByFullName(String fullName, String id); + + /** + * 验证编码 + * + * @param enCode 编码 + * @param id 主键值 + * @return ignore + */ + boolean isExistByEnCode(String enCode, String id); + + /** + * 获取流水号 + * + * @param enCode 流水编码 + * @return ignore + * @throws DataException ignore + */ + String getNumber(String enCode) throws DataException; + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(BillRuleEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return ignore + */ + boolean update(String id, BillRuleEntity entity); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(BillRuleEntity entity); + + /** + * 上移 + * + * @param id 主键值 + * @return ignore + */ + boolean first(String id); + + /** + * 下移 + * + * @param id 主键值 + * @return ignore + */ + boolean next(String id); + + /** + * 获取单据流水号 + * + * @param enCode 流水编码 + * @param isCache 是否缓存:每个用户会自动占用一个流水号,这个刷新页面也不会跳号 + * @return ignore + * @throws DataException ignore + */ + String getBillNumber(String enCode, boolean isCache) throws DataException; + + /** + * 使用单据流水号(注意:必须是缓存的单据才可以调用这个方法,否则无效) + * + * @param enCode 流水编码 + */ + void useBillNumber(String enCode); + + /** + * 单据规则导入 + * + * @param entity 实体对象 + * @return ignore + * @throws DataException ignore + */ + ActionResult ImportData(BillRuleEntity entity) throws DataException; + + + /** + * + * + * @param pagination 根据业务条件 + * @return 单据规则列表 + */ + List getListByCategory(String id,Pagination pagination); + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/ComFieldsService.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/ComFieldsService.java new file mode 100644 index 0000000..7eb8175 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/ComFieldsService.java @@ -0,0 +1,65 @@ +package jnpf.base.service; + +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import jnpf.base.entity.ComFieldsEntity; + +import java.util.List; + +/** + * 常用字段 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +public interface ComFieldsService extends SuperService { + + /** + * 获取常用字段列表 + * + * @return ignore + */ + List getList(); + + /** + * 获取常用字段 + * + * @param id 主键 + * @return ignore + */ + ComFieldsEntity getInfo(String id); + + /** + * 创建常用字段 + * + * @param entity 实体 + */ + void create(ComFieldsEntity entity); + + /** + * 修改常用字段 + * + * @param id 主键 + * @param entity 实体 + * @return ignore + */ + boolean update(String id, ComFieldsEntity entity); + + /** + * 验证名称 + * + * @param fullName 名称 + * @param id 主键值 + * @return ignore + */ + boolean isExistByFullName(String fullName, String id); + + /** + * 删除常用字段 + * + * @param entity 实体 + */ + void delete(ComFieldsEntity entity); +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/CommonWordsService.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/CommonWordsService.java new file mode 100644 index 0000000..7ae6a06 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/CommonWordsService.java @@ -0,0 +1,41 @@ +package jnpf.base.service; + +import jnpf.base.entity.CommonWordsEntity; +import jnpf.base.model.commonword.ComWordsPagination; + +import java.util.List; + +/** + * 审批常用语 Service + * + * @author JNPF开发平台组 YanYu + * @version v3.4.6 + * @copyrignt 引迈信息技术有限公司 + * @date 2023-01-06 + */ +public interface CommonWordsService extends SuperService { + + /** + * 系统常用语列表 + * + * @param comWordsPagination 页面对象 + * @return 打印实体类 + */ + List getSysList(ComWordsPagination comWordsPagination, Boolean currentSysFlag); + + /** + * 个人常用语列表 + * + * @param type 类型 + * @return 集合 + */ + List getListModel(String type); + + /** + * 系统是否被使用 + * @param systemId 系统ID + * @return 返回判断 + */ + Boolean existSystem(String systemId); + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/DataInterfaceLogService.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/DataInterfaceLogService.java new file mode 100644 index 0000000..cc316b8 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/DataInterfaceLogService.java @@ -0,0 +1,54 @@ +package jnpf.base.service; + + +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import jnpf.base.Pagination; +import jnpf.base.entity.DataInterfaceLogEntity; +import jnpf.base.model.InterfaceOauth.PaginationIntrfaceLog; + +import java.util.List; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +public interface DataInterfaceLogService extends SuperService { + + /** + * 添加日志 + * + * @param dateInterfaceId 接口Id + * @param invokWasteTime 执行时间 + */ + void create(String dateInterfaceId, Integer invokWasteTime); + /** + * 通过权限判断添加日志 + * + * @param dateInterfaceId 接口Id + * @param invokWasteTime 执行时间 + */ + void create(String dateInterfaceId, Integer invokWasteTime,String appId,String invokType); + + /** + * 获取调用日志列表 + * + * @param invokId 接口id + * @param pagination 分页参数 + * @return ignore + */ + List getList(String invokId, Pagination pagination); + + + /** + * 获取调用日志列表(多id) + * + * @param invokIds 接口ids + * @param pagination 分页参数 + * @return ignore + */ + List getListByIds(String appId,List invokIds, PaginationIntrfaceLog pagination); + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/DataInterfaceService.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/DataInterfaceService.java new file mode 100644 index 0000000..815c264 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/DataInterfaceService.java @@ -0,0 +1,145 @@ +package jnpf.base.service; + +import jnpf.base.ActionResult; +import jnpf.base.Pagination; +import jnpf.base.entity.DataInterfaceEntity; +import jnpf.base.model.datainterface.DataInterfaceActionModel; +import jnpf.base.model.datainterface.DataInterfacePage; +import jnpf.base.model.datainterface.PaginationDataInterface; +import jnpf.exception.DataException; + +import java.util.List; +import java.util.Map; + +/** + * 数据接口业务层 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-03-23 + */ +public interface DataInterfaceService extends SuperService { + /** + * 获取接口列表(分页) + * + * @param pagination 分页参数 + * @return ignore + */ + List getList(PaginationDataInterface pagination, String dataType, Integer isSelector); + + /** + * 通过ids获取列表 + * + * @param ids + * @return + */ + List getList(List ids); + + /** + * 获取接口列表下拉框 + * + * @return ignore + * @param filterPage + */ + List getList(boolean filterPage); + + /** + * 获取接口数据 + * + * @param id 主键 + * @return ignore + */ + DataInterfaceEntity getInfo(String id); + + /** + * 添加数据接口 + * + * @param entity 实体 + */ + void create(DataInterfaceEntity entity); + + /** + * 修改接口 + * + * @param entity 实体 + * @param id 主键 + * @return 实体 + * @throws DataException ignore + */ + boolean update(DataInterfaceEntity entity, String id) throws DataException; + + /** + * 删除接口 + * + * @param entity 实体 + */ + void delete(DataInterfaceEntity entity); + + /** + * 判断接口名称是否重复 + * + * @param fullName 名称 + * @param id 主键 + * @return ignore + */ + boolean isExistByFullNameOrEnCode(String id, String fullName, String enCode); + + /** + * 获取接口分页数据 + * + * @param id 主键 + * @param page 分页参数 + * @return ignore + */ + ActionResult infoToIdPageList(String id, DataInterfacePage page); + + /** + * 获取接口详情数据 + * + * @param id 主键 + * @param page 分页参数 + * @return ignore + */ + List> infoToInfo(String id, DataInterfacePage page); + + /** + * 访问接口路径的应用认证 + * + * @param id 主键 + * @param tenantId 租户encode + * @param model 需要替换的参数 + * @return ignore + */ + ActionResult infoToIdNew(String id, String tenantId, DataInterfaceActionModel model); + + /** + * 检查参数 + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2022/6/14 + */ + DataInterfaceActionModel checkParams(Map map); + + /** + * 访问接口路径 + * + * @param id 主键 + * @param tenantId 租户encode + * @param map 需要替换的参数 + * @return ignore + */ + ActionResult infoToId(String id, String tenantId, Map map); + + /** + * 任务调度使用 + * @param id 主键 + * @param tenantId 租户encode + * @param map 需要替换的参数 + * @param token token + * @return + */ + ActionResult infoToId(String id, String tenantId, Map map, String token, String appId, String invokType, Pagination pagination, Map showMap); + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/DataInterfaceUserService.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/DataInterfaceUserService.java new file mode 100644 index 0000000..83f5640 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/DataInterfaceUserService.java @@ -0,0 +1,40 @@ +package jnpf.base.service; + +import jnpf.base.entity.DataInterfaceUserEntity; +import jnpf.base.model.InterfaceOauth.InterfaceUserForm; + +import java.util.List; + +/** + * @author JNPF开发平台组 + * @version V3.4.7 + * @copyright 引迈信息技术有限公司 + * @date 2021/9/20 9:22 + */ +public interface DataInterfaceUserService extends SuperService { + + /** + * 授权用户 + * + * @param interfaceUserForm + */ + void saveUserList(InterfaceUserForm interfaceUserForm); + + /** + * 根据认证接口id查询授权用户列表 + * + * @param oauthId + * @return + */ + List select(String oauthId); + + /** + * 通过用户密钥获取用户token + * + * @param oauthId + * @param userKey + * @return + */ + String getInterfaceUserToken(String tenantId, String oauthId, String userKey); + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/DataInterfaceVariateService.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/DataInterfaceVariateService.java new file mode 100644 index 0000000..4e03539 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/DataInterfaceVariateService.java @@ -0,0 +1,83 @@ +package jnpf.base.service; + +import jnpf.base.Page; +import jnpf.base.entity.DataInterfaceVariateEntity; + +import java.util.List; +import java.util.Map; + +/** + * 数据接口业务层 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-03-23 + */ +public interface DataInterfaceVariateService extends SuperService { + + /** + * 列表 + * @param id + * @param page + * @return + */ + List getList(String id, Page page); + + /** + * 详情 + * + * @param id + * @return + */ + DataInterfaceVariateEntity getInfo(String id); + + /** + * 判断名称是否重复 + * + * @param entity + * @return + */ + boolean isExistByFullName(DataInterfaceVariateEntity entity); + + /** + * 添加 + * + * @param entity + * @return + */ + boolean create(DataInterfaceVariateEntity entity); + + /** + * 修改 + * + * @param entity + * @return + */ + boolean update(DataInterfaceVariateEntity entity); + + /** + * 删除 + * + * @param entity + * @return + */ + boolean delete(DataInterfaceVariateEntity entity); + + /** + * 通过id获取列表 + * + * @param ids + * @return + */ + List getListByIds(List ids); + + boolean update(Map map, List variateEntities); + + /** + * 通过名称获取变量 + * + * @param fullName + */ + DataInterfaceVariateEntity getInfoByFullName(String fullName); +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/DataMapService.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/DataMapService.java new file mode 100644 index 0000000..9d28a41 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/DataMapService.java @@ -0,0 +1,84 @@ +package jnpf.base.service; + + +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import jnpf.base.Pagination; +import jnpf.base.entity.VisualDataMapEntity; + +import java.util.List; + +/** + * 大屏地图 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +public interface DataMapService extends SuperService { + + /** + * 获取大屏列表(分页) + * + * @param pagination 分页参数 + * @return ignore + */ + List getList(Pagination pagination); + + /** + * 获取大屏列表 + * + * @return ignore + */ + List getList(); + + /** + * 获取大屏基本信息 + * + * @param id 主键 + * @return ignore + */ + VisualDataMapEntity getInfo(String id); + + /** + * 新增 + * + * @param entity 实体 + */ + void create(VisualDataMapEntity entity); + + /** + * 修改 + * + * @param id 主键 + * @param entity 实体 + * @return ignore + */ + boolean update(String id, VisualDataMapEntity entity); + + /** + * 删除 + * + * @param entity 实体 + */ + void delete(VisualDataMapEntity entity); + + /** + * 验证名称 + * + * @param fullName 名称 + * @param id 主键值 + * @return ignore + */ + boolean isExistByFullName(String fullName, String id); + + /** + * 验证编码 + * + * @param enCode 编码 + * @param id 主键值 + * @return ignore + */ + boolean isExistByEnCode(String enCode, String id); +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/DbLinkService.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/DbLinkService.java new file mode 100644 index 0000000..c426448 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/DbLinkService.java @@ -0,0 +1,112 @@ +package jnpf.base.service; + + +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import jnpf.base.model.dblink.PaginationDbLink; +import jnpf.database.model.dto.DbConnDTO; +import jnpf.database.model.entity.DbLinkEntity; +import jnpf.exception.DataException; + +import java.util.List; + +/** + * 数据连接 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +public interface DbLinkService extends SuperService { + + /** + * 列表 + * + * @return ignore + */ + List getList(); + + /** + * 列表关键字查询 + * + * @param pagination 数据连接分页 + * @return ignore + */ + List getList(PaginationDbLink pagination); + + /** + * 信息 + * + * @param id 主键 + * @return ignore + */ + DbLinkEntity getInfo(String id); + + /** + * 验证名称 + * + * @param fullName 名称 + * @param id 主键值 + * @return ignore + */ + boolean isExistByFullName(String fullName, String id); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(DbLinkEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return ignore + */ + boolean update(String id, DbLinkEntity entity); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(DbLinkEntity entity); + + /** + * 上移 + * + * @param id 主键值 + * @return ignore + */ + boolean first(String id); + + /** + * 下移 + * + * @param id 主键值 + * @return ignore + */ + boolean next(String id); + + /** + * 测试连接 + * + * @param entity 实体对象 + * @return ignore + * @throws DataException ignore + */ + boolean testDbConnection(DbLinkEntity entity) throws Exception; + + /** + * 获取动态数据源 + * + * @param dbLinkId 数据连接ID + * @return 动态数据库源 + * @throws DataException ignore + */ + DbLinkEntity getResource(String dbLinkId) throws Exception; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/DbSyncService.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/DbSyncService.java new file mode 100644 index 0000000..69b5581 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/DbSyncService.java @@ -0,0 +1,59 @@ +package jnpf.base.service; + +import java.util.List; +import java.util.Map; + +/** + * 数据同步 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +public interface DbSyncService { + + /** + * 数据表同步验证 + * + * @param dbLinkIdFrom 数据库连接From + * @param dbLinkIdTo 数据库连接To + * @param table 表名 + * @return 1:初始库表中没有数据 + * 2:目标库中该表不存在,是否在目标库中创建该表,并同步数据? + * 3:目标表存在数据,是否自动清除并同步数据? + * 0:同步成功 + * -1:请检查,同一数据库下无法同步数据 + * @throws Exception ignore + */ + Integer executeCheck(String dbLinkIdFrom, String dbLinkIdTo, Map convertRuleMap, String table) throws Exception; + + + /** + * 同步表执行 + * + * @param dbLinkIdFrom 数据库连接From + * @param dbLinkIdTo 数据库连接To + * @param table 表名 + * @throws Exception ignore + */ + void execute(String dbLinkIdFrom, String dbLinkIdTo, Map convertRuleMap, String table) throws Exception; + + /** + * 批量执行 + * + * @param dbLinkIdFrom 数据库连接From + * @param dbLinkIdTo 数据库连接To + * @param tableList 表名 + * @throws Exception ignore + */ + Map executeBatch(String dbLinkIdFrom, String dbLinkIdTo, Map convertRuleMap, List tableList) ; + + /** + * 打印初始脚本 + * + * @param printType dbInit:初始脚本、dbStruct:表结构、dbData:数据、tenant:多租户 + */ + Map printDbInit(String dbLinkIdFrom, String dbTypeTo, List tableList, Map convertRuleMap, String printType) throws Exception; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/DbTableService.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/DbTableService.java new file mode 100644 index 0000000..aa9f6a0 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/DbTableService.java @@ -0,0 +1,168 @@ +package jnpf.base.service; + +import jnpf.base.Page; +import jnpf.base.Pagination; +import jnpf.database.model.dbfield.DbFieldModel; +import jnpf.database.model.dbtable.DbTableFieldModel; +import jnpf.database.model.page.DbTableDataForm; +import jnpf.exception.DataException; + +import java.util.List; +import java.util.Map; + +/** + * 数据管理 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +public interface DbTableService { + + /** + * 1:表列表 + * + * @param dbLinkId 连接Id + * @param methodName + * @return 表集合信息 + * @throws DataException ignore + */ + List getList(String dbLinkId, String methodName) throws Exception; + + /** + * 1:表列表 + * + * @param dbLinkId 连接Id + * @param page 关键字 + * @return 表集合信息 + * @throws DataException ignore + */ + List getListPage(String dbLinkId, Page page) throws Exception; + + /** + * 1:表列表 + * + * @param dbLinkId 连接Id + * @return 表集合信息 + * @throws DataException ignore + */ + List getListPage(String dbLinkId, Pagination pagination) throws Exception; + + + /** + * 2:单表信息 + * + * @param dbLinkId 连接Id + * @return 表集合信息 + * @throws DataException ignore + */ + DbTableFieldModel getTable(String dbLinkId, String table) throws Exception; + + /** + * 3:表字段 + * + * @param dbLinkId 连接Id + * @param table 表名 + * @return 字段集合信息 + * @throws DataException ignore + */ + List getFieldList(String dbLinkId, String table) throws Exception; + + /** + * 4:表数据 + * + * @param dbTableDataForm 分页 + * @param dbLinkId 连接Id + * @param table 表名 + * @return 表数据集合 + * @throws Exception ignore + */ + List> getData(DbTableDataForm dbTableDataForm, String dbLinkId, String table) throws Exception; + + /** + * 5:校验:表名重名 + * + * @param dbLinkId 连接Id + * @return 重名标识 + * @throws Exception ignore + */ + boolean isExistTable(String dbLinkId, String table) throws Exception; + + /** + * 6:删除存在表 + * + * @param dbLinkId 连接ID + * @param table 删除表 + */ + boolean dropExistsTable(String dbLinkId, String table) throws Exception; + + /** + * 7:删除表 + * + * @param dbLinkId 连接Id + * @param table 表名 + * @throws DataException ignore + */ + void delete(String dbLinkId, String table) throws Exception; + + /** + * 删除全部表(慎用) + * @param dbLinkId 连接Id + */ + void deleteAllTable(String dbLinkId, String dbType) throws Exception; + + /** + * 8:创建表 + * + * @param dbTableFieldModel 前端创表表单信息 + * @return 执行状态(1:成功;0:重名) + * @throws DataException ignore + */ + int createTable(DbTableFieldModel dbTableFieldModel) throws Exception; + + /** + * 9:获取表模型 + * @param dbLinkId 数据连接ID + * @param tableName 表名 + * @return 表模板 + * @throws Exception ignore + */ + DbTableFieldModel getDbTableModel(String dbLinkId, String tableName) throws Exception; + + /** + * 10:修改表 + * + * @param dbTableFieldModel 修改表参数对象 + * @throws DataException ignore + */ + void update(DbTableFieldModel dbTableFieldModel) throws Exception; + + /** + * 11:添加字段 + * @param dbTableFieldModel 数据表字段模型 + * @throws DataException ignore + */ + void addField(DbTableFieldModel dbTableFieldModel) throws Exception; + + /** + * 12:获取表数据行数 + * + * @param dbLinkId 数据连接Id + * @param table 表名 + * @return 数据行数 + * @throws DataException ignore + */ + int getSum(String dbLinkId, String table) throws Exception; + + /** + * 13:获取动态数据源 + * + * @param dbLinkId 数据连接ID + * @return 动态数据库源 + * @throws DataException ignore + */ +// DbConnDTO getResource(String dbLinkId) throws DataException; + +} + diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/DictionaryTypeService.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/DictionaryTypeService.java new file mode 100644 index 0000000..e1e09b4 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/DictionaryTypeService.java @@ -0,0 +1,99 @@ +package jnpf.base.service; + +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import jnpf.base.entity.DictionaryTypeEntity; + +import java.util.List; + +/** + * 字典分类 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +public interface DictionaryTypeService extends SuperService { + + /** + * 列表 + * + * @return ignore + */ + List getList(); + + /** + * 信息 + * + * @param enCode 代码 + * @return ignore + */ + DictionaryTypeEntity getInfoByEnCode(String enCode); + + /** + * 信息 + * + * @param id 主键值 + * @return ignore + */ + DictionaryTypeEntity getInfo(String id); + + /** + * 验证名称 + * + * @param fullName 名称 + * @param id 主键值 + * @return ignore + */ + boolean isExistByFullName(String fullName, String id); + + /** + * 验证编码 + * + * @param enCode 编码 + * @param id 主键值 + * @return ignore + */ + boolean isExistByEnCode(String enCode, String id); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(DictionaryTypeEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return ignore + */ + boolean update(String id, DictionaryTypeEntity entity); + + /** + * 删除 + * + * @param entity 实体对象 + * @return ignore + */ + boolean delete(DictionaryTypeEntity entity); + + /** + * 上移 + * + * @param id 主键值 + * @return ignore + */ + boolean first(String id); + + /** + * 下移 + * + * @param id 主键值 + * @return ignore + */ + boolean next(String id); +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/IPrintDevService.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/IPrintDevService.java new file mode 100644 index 0000000..7f575bc --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/IPrintDevService.java @@ -0,0 +1,93 @@ +package jnpf.base.service; + +import jnpf.base.service.SuperService; +import jnpf.base.entity.OperatorRecordEntity; +import jnpf.base.entity.PrintDevEntity; +import jnpf.base.model.PaginationPrint; +import jnpf.base.model.PrintTableTreeModel; +import jnpf.base.model.print.PrintOption; +import jnpf.base.model.vo.PrintDevVO; +import jnpf.util.treeutil.SumTree; + +import java.util.List; +import java.util.Map; + +/** + * 打印模板-服务类 + * + * @author JNPF开发平台组 YY + * @version V3.2.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月30日 + */ +public interface IPrintDevService extends SuperService { + + /** + * 列表 + * + * @return 打印实体类 + */ + List getList(PaginationPrint paginationPrint); + + /** + * 获取打印模板对象树形模型 + * + * @return 打印模型树 + * @throws Exception 字典分类不存在BUG + */ + List getTreeModel() throws Exception; + + /** + * 获取打印模板对象树形模型(selector) + * + * @param type 打印模板类型 + * @return 打印模型树 + * @throws Exception 字典分类不存在BUG + */ + List getTreeModel(Integer type) throws Exception; + + /** + * 重名验证 + * @param fullName 全名 + * @param id 模板id + * @return true:存在 、false:不存在 + */ + Boolean checkNameExist(String fullName,String id); + + /** + * 获取流程经办记录集合 + * @param taskId 任务ID + * @return 经办记录集合 + */ + List getFlowTaskOperatorRecordList(String taskId); + + /** + * sql获取打印内容 + * @param dbLinkId 数据连接ID + * @param sqlTempLate SQL语句数组 + * @return 打印内容 + * @throws Exception ignore + */ + Map getDataBySql(String dbLinkId, String sqlTempLate) throws Exception; + + /** + * 获取打印表字段结构 + * @param dbLinkId 数据连接ID + * @param sqlTempLate SQL语句数组 + * @return 打印树形模型 + * @throws Exception ignore + */ + List> getPintTabFieldStruct(String dbLinkId, String sqlTempLate) throws Exception; + + /** + * 新增更新校验 + * @param printDevEntity 打印模板对象 + * @param fullNameCheck 重名校验开关 + * @param encodeCheck 重码校验开关 + */ + void creUpdateCheck(PrintDevEntity printDevEntity, Boolean fullNameCheck, Boolean encodeCheck) throws Exception; + + List getPrintTemplateOptions(List ids); + + Map getDataMap(PrintDevEntity entity, String id); +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/InterfaceOauthService.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/InterfaceOauthService.java new file mode 100644 index 0000000..2f8bbf9 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/InterfaceOauthService.java @@ -0,0 +1,86 @@ +package jnpf.base.service; + +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import jnpf.base.entity.InterfaceOauthEntity; +import jnpf.base.model.InterfaceOauth.PaginationOauth; +import jnpf.exception.DataException; + +import java.util.List; + +/** + * 接口认证服务 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/6/8 9:26 + */ +public interface InterfaceOauthService extends SuperService { + + /** + * 判断接口认证名称是否重复 + * + * @param appName 名称 + * @param id 主键 + * @return ignore + */ + boolean isExistByAppName(String appName, String id); + + /** + * 判断appId是否重复 + * + * @param appId 名称 + * @param id 主键 + * @return ignore + */ + boolean isExistByAppId(String appId, String id); + + + /** + * 获取接口列表(分页) + * + * @param pagination 分页参数 + * @return ignore + */ + List getList(PaginationOauth pagination); + + /** + * 获取接口认证数据 + * + * @param id 主键 + * @return ignore + */ + InterfaceOauthEntity getInfo(String id); + + /** + * 添加接口认证数据 + * + * @param entity 实体 + */ + void create(InterfaceOauthEntity entity); + /** + * 修改接口 + * + * @param entity 实体 + * @param id 主键 + * @return 实体 + * @throws DataException ignore + */ + boolean update(InterfaceOauthEntity entity, String id) throws DataException; + + /** + * 删除接口 + * + * @param entity 实体 + */ + void delete(InterfaceOauthEntity entity); + + /** + * 获取接口认证数据 + * + * @param appId 主键 + * @return ignore + */ + InterfaceOauthEntity getInfoByAppId(String appId); +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/MessageTemplateService.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/MessageTemplateService.java new file mode 100644 index 0000000..d7f1415 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/MessageTemplateService.java @@ -0,0 +1,83 @@ +package jnpf.base.service; + +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import jnpf.base.Pagination; +import jnpf.base.entity.MessageTemplateEntity; + +import java.util.List; + +/** + * 消息模板表 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年12月8日17:40:37 + */ +public interface MessageTemplateService extends SuperService { + + /** + * 列表(无分页) + * + * @return + */ + List getList(); + + /** + * 列表 + * + * @param pagination 条件 + * @return 单据规则列表 + */ + List getList(Pagination pagination, Boolean filter); + + /** + * 信息 + * + * @param id 主键值 + * @return 单据规则 + */ + MessageTemplateEntity getInfo(String id); + + /** + * 创建 + * + * @param entity 实体 + */ + void create(MessageTemplateEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return ignore + */ + boolean update(String id, MessageTemplateEntity entity); + + /** + * 删除 + * + * @param entity 实体 + */ + void delete(MessageTemplateEntity entity); + + /** + * 验证名称 + * + * @param fullName 名称 + * @param id 主键值 + * @return ignore + */ + boolean isExistByFullName(String fullName, String id); + + /** + * 验证编码 + * + * @param enCode 编码 + * @param id 主键值 + * @return ignore + */ + boolean isExistByEnCode(String enCode, String id); +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/ModuleDataAuthorizeLinkDataService.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/ModuleDataAuthorizeLinkDataService.java new file mode 100644 index 0000000..e478618 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/ModuleDataAuthorizeLinkDataService.java @@ -0,0 +1,24 @@ +package jnpf.base.service; + +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import jnpf.base.entity.ModuleDataAuthorizeLinkEntity; + + +/** + * 数据权限配置 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +public interface ModuleDataAuthorizeLinkDataService extends SuperService { + /** + * 根据菜单id获取数据连接 + * @param menuId + * @return + */ + ModuleDataAuthorizeLinkEntity getLinkDataEntityByMenuId(String menuId,String type); + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/ModuleDataAuthorizeService.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/ModuleDataAuthorizeService.java new file mode 100644 index 0000000..33c3520 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/ModuleDataAuthorizeService.java @@ -0,0 +1,66 @@ +package jnpf.base.service; + +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import jnpf.base.entity.ModuleDataAuthorizeEntity; + +import java.util.List; + +/** + * 数据权限配置 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +public interface ModuleDataAuthorizeService extends SuperService { + + /** + * 列表 + * + * @return ignore + */ + List getList(); + + /** + * 列表 + * + * @param moduleId 功能主键 + * @return ignore + */ + List getList(String moduleId); + + /** + * 信息 + * + * @param id 主键值 + * @return ignore + */ + ModuleDataAuthorizeEntity getInfo(String id); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(ModuleDataAuthorizeEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return ignore + */ + boolean update(String id, ModuleDataAuthorizeEntity entity); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(ModuleDataAuthorizeEntity entity); + + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/PortalManageService.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/PortalManageService.java new file mode 100644 index 0000000..a9fef21 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/PortalManageService.java @@ -0,0 +1,37 @@ +package jnpf.base.service; + + +import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO; +import jnpf.base.entity.PortalManageEntity; +import jnpf.base.model.portalManage.PortalManagePage; +import jnpf.base.model.portalManage.PortalManagePageDO; +import jnpf.base.model.portalManage.PortalManagePrimary; +import jnpf.base.model.portalManage.PortalManageVO; + +import java.util.List; + +/** + *

+ * 门户管理 服务类 + *

+ * + * @author YanYu + * @since 2023-02-16 + */ +public interface PortalManageService extends SuperService { + + void checkCreUp(PortalManageEntity portalManageEntity) throws Exception; + + PortalManageVO convertVO(PortalManageEntity entity); + + List getList(PortalManagePrimary primary); + + List getListByEnable(PortalManagePrimary primary); + + PageDTO getPage(PortalManagePage portalPagination); + + List getSelectList(PortalManagePage pmPage); + + void createBatch(List primaryLit) throws Exception; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/PrintLogService.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/PrintLogService.java new file mode 100644 index 0000000..9dc16b3 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/PrintLogService.java @@ -0,0 +1,8 @@ +package jnpf.base.service; + +import jnpf.base.service.SuperService; +import jnpf.base.entity.PrintLogEntity; + + +public interface PrintLogService extends SuperService { +} \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/ProvinceAtlasService.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/ProvinceAtlasService.java new file mode 100644 index 0000000..c980ebf --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/ProvinceAtlasService.java @@ -0,0 +1,20 @@ +package jnpf.base.service; + +import jnpf.base.entity.ProvinceAtlasEntity; + +import java.util.List; + +/** + * 行政区划 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月27日 上午9:18 + */ +public interface ProvinceAtlasService extends SuperService { + + List getList(); + + List getListByPid(String pid); +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/ProvinceService.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/ProvinceService.java new file mode 100644 index 0000000..52b713c --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/ProvinceService.java @@ -0,0 +1,142 @@ +package jnpf.base.service; + +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import jnpf.base.Page; +import jnpf.base.entity.ProvinceEntity; + +import java.util.List; + +/** + * 行政区划 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +public interface ProvinceService extends SuperService { + + + /** + * 验证名称 + * + * @param fullName 名称 + * @param id 主键值 + * @return ignore + */ + boolean isExistByFullName(String fullName, String id); + + /** + * 验证编码 + * + * @param enCode 编码 + * @param id 主键值 + * @return ignore + */ + boolean isExistByEnCode(String enCode, String id); + + /** + * 普通列表 + * + * @param parentId 节点Id + * @return ignore + */ + List getList(String parentId); + + /** + * 普通列表 + * + * @param parentId 节点Id + * @param page + * @return ignore + */ + List getList(String parentId, Page page); + + /** + * 普通列表 + * + * @return ignore + */ + List getAllList(); + + + /** + * 省市区单条数据集合(代码生成器) + * @param ProIdList 省市区id集合 + * @return + */ + List getProList(List ProIdList); + + /** + * 地域名列表(在线开发) + * + * @return ignore + */ + List getProListBytype(String type); + + /** + * 信息 + * + * @param id 主键值 + * @return ignore + */ + ProvinceEntity getInfo(String id); + + /** + * 信息 + * + * @param fullName + * @param parentId + * @return ignore + */ + ProvinceEntity getInfo(String fullName,List parentId); + + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(ProvinceEntity entity); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(ProvinceEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return ignore + */ + boolean update(String id, ProvinceEntity entity); + + /** + * 上移 + * + * @param id 主键值 + * @return ignore + */ + boolean first(String id); + + /** + * 下移 + * + * @param id 主键值 + * @return ignore + */ + boolean next(String id); + + /** + * 获取行政规划列表 + * + * @param list 数组 + * @return ignore + */ + List infoList(List list); +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/ScheduleLogService.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/ScheduleLogService.java new file mode 100644 index 0000000..59a4f2b --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/ScheduleLogService.java @@ -0,0 +1,51 @@ +package jnpf.base.service; + +import jnpf.base.entity.ScheduleLogEntity; + +import java.util.List; + +/** + * 日程 + * + * @author JNPF开发平台组 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + */ +public interface ScheduleLogService extends SuperService { + + /** + * 列表 + * + * @return + */ + List getListAll(List scheduleIdList); + + /** + * 信息 + * + * @param id 主键值 + * @return 单据规则 + */ + ScheduleLogEntity getInfo(String id); + + /** + * 创建 + * + * @param entity 实体 + */ + void create(ScheduleLogEntity entity); + + /** + * 删除 + * @param scheduleIdList + */ + void delete(List scheduleIdList,String operationType); + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return ignore + */ + boolean update(String id, ScheduleLogEntity entity); + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/ScheduleNewService.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/ScheduleNewService.java new file mode 100644 index 0000000..2e15fd3 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/ScheduleNewService.java @@ -0,0 +1,108 @@ +package jnpf.base.service; + +import jnpf.base.entity.ScheduleNewEntity; +import jnpf.base.model.schedule.ScheduleDetailModel; +import jnpf.base.model.schedule.ScheduleJobModel; +import jnpf.base.model.schedule.ScheduleNewTime; + +import java.util.Date; +import java.util.List; + +/** + * 日程 + * + * @author JNPF开发平台组 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + */ +public interface ScheduleNewService extends SuperService { + + /** + * 列表 + * + * @return + */ + List getList(ScheduleNewTime scheduleNewTime); + + /** + * 列表 + * + * @return + */ + List getList(String groupId, Date date); + + /** + * 列表 + * + * @return + */ + List getStartDayList(String groupId, Date date); + + /** + * 列表 + * + * @return + */ + List getListAll(Date date); + + /** + * 信息 + * + * @param id 主键值 + * @return 单据规则 + */ + ScheduleNewEntity getInfo(String id); + + /** + * 信息 + * + * @return 单据规则 + */ + List getGroupList(ScheduleDetailModel detailModel); + + /** + * 创建 + * + * @param entity 实体 + * @param operationType 1.新增 2.修改 + */ + void create(ScheduleNewEntity entity, List toUserIds, String groupId, String operationType,List idList); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @param type 1.此日程 2.此日程及后续 3.所有日程 + * @return ignore + */ + boolean update(String id, ScheduleNewEntity entity, List toUserIds, String type); + + /** + * 删除 + * + * @param idList + */ + void deleteScheduleList(List idList); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + */ + boolean update(String id, ScheduleNewEntity entity); + + /** + * 删除 + * + * @param entity 实体 + * @param type 1.此日程 2.此日程及后续 3.所有日程 + */ + void delete(ScheduleNewEntity entity, String type); + + /** + * 发送重复提醒 + * @param scheduleJobModel + */ + void scheduleMessage(ScheduleJobModel scheduleJobModel); +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/ScheduleNewUserService.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/ScheduleNewUserService.java new file mode 100644 index 0000000..032960e --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/ScheduleNewUserService.java @@ -0,0 +1,47 @@ +package jnpf.base.service; + +import jnpf.base.entity.ScheduleNewUserEntity; + +import java.util.List; + +/** + * 日程 + * + * @author JNPF开发平台组 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + */ +public interface ScheduleNewUserService extends SuperService { + + /** + * 列表 + * + * @return + */ + List getList(String scheduleId,String type); + + /** + * 列表 + * + * @return + */ + List getList(); + + /** + * 创建 + * + * @param entity 实体 + */ + void create(ScheduleNewUserEntity entity); + + /** + * 删除 + * + */ + void deleteByScheduleId(List scheduleIdList); + + /** + * 删除 + * + */ + void deleteByUserId(List scheduleIdList); +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/SignService.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/SignService.java new file mode 100644 index 0000000..64cdd2c --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/SignService.java @@ -0,0 +1,50 @@ +package jnpf.base.service; + +import jnpf.permission.entity.SignEntity; + + +import java.util.List; + +/** + * 个人签名 + * + * @author JNPF开发平台组 + * @copyright 引迈信息技术有限公司 + * @date 2022年9月2日 上午9:18 + */ +public interface SignService extends SuperService { + + + /** + * 列表 + * + * @return 个人签名集合 + */ + List getList(); + + + + + + /** + * 创建 + * + * @param entity 实体对象 + */ + boolean create(SignEntity entity); + + + + /** + * 删除 + * + */ + boolean delete(String id); + + + boolean updateDefault(String id); + + + //获取默认 + SignEntity getDefaultByUserId(String id); +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/SmsTemplateService.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/SmsTemplateService.java new file mode 100644 index 0000000..a39cf76 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/SmsTemplateService.java @@ -0,0 +1,88 @@ +package jnpf.base.service; + +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import jnpf.base.Page; +import jnpf.base.Pagination; +import jnpf.base.entity.SmsTemplateEntity; +import jnpf.base.model.systemconfig.SmsModel; + +import java.util.List; + +/** + * @author Administrator + * @description 针对表【base_sms_template】的数据库操作Service + * @createDate 2021-12-09 10:12:52 + */ +public interface SmsTemplateService extends SuperService { + + /** + * 列表(不分页) + * + * @return + */ + List getList(String keyword); + + /** + * 列表 + * + * @param pagination 条件 + * @return 单据规则列表 + */ + List getList(Pagination pagination); + + /** + * 信息 + * + * @param id 主键值 + * @return 单据规则 + */ + SmsTemplateEntity getInfo(String id); + + /** + * 创建 + * + * @param entity 实体 + */ + void create(SmsTemplateEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return ignore + */ + boolean update(String id, SmsTemplateEntity entity); + + /** + * 删除 + * + * @param entity 实体 + */ + void delete(SmsTemplateEntity entity); + + /** + * 判断模板编号是否重复 + * + * @param templateName + * @param id + * @return + */ + boolean isExistByTemplateName(String templateName, String id); + + /** + * 判断模板编号是否重复 + * + * @param enCode + * @param id + * @return + */ + boolean isExistByEnCode(String enCode, String id); + + /** + * 获取短信配置 + * @return + */ + SmsModel getSmsConfig(); +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/SysconfigService.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/SysconfigService.java new file mode 100644 index 0000000..5c4cd8e --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/SysconfigService.java @@ -0,0 +1,79 @@ +package jnpf.base.service; + +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import jnpf.base.entity.EmailConfigEntity; +import jnpf.base.entity.SysConfigEntity; +import jnpf.model.BaseSystemInfo; + +import java.util.List; + +/** + * 系统配置 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +public interface SysconfigService extends SuperService { + + /** + * 列表 + * + * @param type 类型 + * @return ignore + */ + List getList(String type); + + /** + * 信息 + * + * @return ignore + */ + BaseSystemInfo getWeChatInfo(); + + /** + * 获取系统配置信息 + * + * @return ignore + */ + BaseSystemInfo getSysInfo(); + + /** + * 保存系统配置 + * + * @param entitys 实体对象 + */ + void save(List entitys); + + /** + * 保存公众号配置 + * + * @param entitys 实体对象 + * @return ignore + */ + boolean saveMp(List entitys); + + /** + * 保存企业号配置 + * + * @param entitys 实体对象 + */ + void saveQyh(List entitys); + + /** + * 邮箱验证 + * + * @param configEntity ignore + * @return ignore + */ + String checkLogin(EmailConfigEntity configEntity); + + /** + * 根据key获取value + * @param keyStr + * @return + */ + String getValueByKey(String keyStr); +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/UserOnlineService.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/UserOnlineService.java new file mode 100644 index 0000000..2b2bcfe --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/UserOnlineService.java @@ -0,0 +1,32 @@ +package jnpf.base.service; + +import jnpf.base.Page; +import jnpf.message.model.UserOnlineModel; + +import java.util.List; + +/** + * 在线用户 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +public interface UserOnlineService { + + /** + * 列表 + * + * @param page 分页参数 + * @return ignore + */ + List getList(Page page); + + /** + * 删除 + * + * @param tokens 主键值 + */ + void delete(String... tokens); +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/AdvancedQueryServiceImpl.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/AdvancedQueryServiceImpl.java new file mode 100644 index 0000000..d16270b --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/AdvancedQueryServiceImpl.java @@ -0,0 +1,49 @@ +package jnpf.base.service.impl; + +import jnpf.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import jnpf.base.UserInfo; +import jnpf.base.entity.AdvancedQueryEntity; +import jnpf.base.entity.ModuleDataAuthorizeSchemeEntity; +import jnpf.base.mapper.AdvancedQueryMapper; +import jnpf.base.service.AdvancedQueryService; +import jnpf.util.RandomUtil; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Optional; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2022/5/30 + */ +@Service +public class AdvancedQueryServiceImpl extends SuperServiceImpl implements AdvancedQueryService { + @Override + public void create(AdvancedQueryEntity advancedQueryEntity) { + String mainId = Optional.ofNullable(advancedQueryEntity.getId()).orElse(RandomUtil.uuId()); + advancedQueryEntity.setId(mainId); + this.save(advancedQueryEntity); + } + + @Override + public AdvancedQueryEntity getInfo(String id,String userId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(AdvancedQueryEntity::getId, id).eq(AdvancedQueryEntity::getCreatorUserId, userId); + return this.getOne(queryWrapper); + } + + @Override + public List getList(String moduleId, UserInfo userInfo) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(AdvancedQueryEntity::getModuleId, moduleId).eq(AdvancedQueryEntity::getCreatorUserId, userInfo.getUserId()); + List list = this.list(queryWrapper); + return list; + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/BillRuleServiceImpl.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/BillRuleServiceImpl.java new file mode 100644 index 0000000..178f8ad --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/BillRuleServiceImpl.java @@ -0,0 +1,285 @@ +package jnpf.base.service.impl; + + +import jnpf.base.model.billrule.BillRulePagination; +import jnpf.base.service.SuperServiceImpl; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import jnpf.base.ActionResult; +import jnpf.base.Pagination; +import jnpf.base.entity.BillRuleEntity; +import jnpf.base.mapper.BillRuleMapper; +import jnpf.base.service.BillRuleService; +import jnpf.constant.MsgCode; +import jnpf.exception.DataException; +import jnpf.util.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +/** + * 单据规则 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Service +public class BillRuleServiceImpl extends SuperServiceImpl implements BillRuleService { + + @Autowired + private UserProvider userProvider; + @Autowired + private RedisUtil redisUtil; + + @Override + public List getList(BillRulePagination pagination) { + // 定义变量判断是否需要使用修改时间倒序 + boolean flag = false; + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (!StringUtil.isEmpty(pagination.getKeyword())) { + flag = true; + queryWrapper.lambda().and( + t -> t.like(BillRuleEntity::getFullName, pagination.getKeyword()) + .or().like(BillRuleEntity::getEnCode, pagination.getKeyword()) + ); + } + if (!StringUtil.isEmpty(pagination.getCategoryId())) { + flag = true; + queryWrapper.lambda().and( + t -> t.like(BillRuleEntity::getCategory, pagination.getCategoryId()) + ); + } + // 排序 + queryWrapper.lambda().orderByAsc(BillRuleEntity::getSortCode).orderByDesc(BillRuleEntity::getCreatorTime); + if (flag) { + queryWrapper.lambda().orderByDesc(BillRuleEntity::getLastModifyTime); + } + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage userPage = this.page(page, queryWrapper); + return pagination.setData(userPage.getRecords(), page.getTotal()); + } + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(BillRuleEntity::getEnabledMark, 1); + // 排序 + queryWrapper.lambda().orderByAsc(BillRuleEntity::getSortCode).orderByDesc(BillRuleEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public BillRuleEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(BillRuleEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public boolean isExistByFullName(String fullName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(BillRuleEntity::getFullName, fullName); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(BillRuleEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public boolean isExistByEnCode(String enCode, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(BillRuleEntity::getEnCode, enCode); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(BillRuleEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + @DSTransactional + public String getNumber(String enCode) throws DataException { + StringBuilder strNumber = new StringBuilder(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(BillRuleEntity::getEnCode, enCode); + BillRuleEntity entity = this.getOne(queryWrapper); + if (entity != null) { + Integer startNumber = Integer.parseInt(entity.getStartNumber()); + String dateFor = entity.getDateFormat(); + //处理隔天流水号归0 + if (entity.getOutputNumber() != null) { + String serialDate; + entity.setThisNumber(entity.getThisNumber() + 1); + if (!"no".equals(dateFor)) { + String thisDate = DateUtil.dateNow(entity.getDateFormat()); + serialDate = entity.getOutputNumber().substring((entity.getOutputNumber().length() - dateFor.length() - entity.getDigit()), (entity.getOutputNumber().length() - entity.getDigit())); + if (!serialDate.equals(thisDate)) { + entity.setThisNumber(0); + } + } + } else { + entity.setThisNumber(0); + } + //拼接单据编码 + strNumber.append(entity.getPrefix()); + if (!"no".equals(dateFor)) { + strNumber.append(DateUtil.dateNow(entity.getDateFormat())); + } + strNumber.append(PadUtil.padRight(String.valueOf((startNumber) + entity.getThisNumber()), entity.getDigit(), '0')); + //更新流水号 + entity.setOutputNumber(strNumber.toString()); + this.updateById(entity); + } else { + throw new DataException("单据规则不存在"); + } + return strNumber.toString(); + } + + @Override + public void create(BillRuleEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(userProvider.get().getUserId()); + this.save(entity); + } + + @Override + public boolean update(String id, BillRuleEntity entity) { + entity.setId(id); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(userProvider.get().getUserId()); + return this.updateById(entity); + } + + @Override + public void delete(BillRuleEntity entity) { + this.removeById(entity.getId()); + } + + @Override + @DSTransactional + public boolean first(String id) { + boolean isOk = false; + //获取要上移的那条数据的信息 + BillRuleEntity upEntity = this.getById(id); + Long upSortCode = upEntity.getSortCode() == null ? 0 : upEntity.getSortCode(); + //查询上几条记录 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .lt(BillRuleEntity::getSortCode, upSortCode) + .orderByDesc(BillRuleEntity::getSortCode); + List downEntity = this.list(queryWrapper); + if (downEntity.size() > 0) { + //交换两条记录的sort值 + Long temp = upEntity.getSortCode(); + upEntity.setSortCode(downEntity.get(0).getSortCode()); + downEntity.get(0).setSortCode(temp); + this.updateById(downEntity.get(0)); + this.updateById(upEntity); + isOk = true; + } + return isOk; + } + + @Override + @DSTransactional + public boolean next(String id) { + boolean isOk = false; + //获取要下移的那条数据的信息 + BillRuleEntity downEntity = this.getById(id); + Long upSortCode = downEntity.getSortCode() == null ? 0 : downEntity.getSortCode(); + //查询下几条记录 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .gt(BillRuleEntity::getSortCode, upSortCode) + .orderByAsc(BillRuleEntity::getSortCode); + List upEntity = this.list(queryWrapper); + if (upEntity.size() > 0) { + //交换两条记录的sort值 + Long temp = downEntity.getSortCode(); + downEntity.setSortCode(upEntity.get(0).getSortCode()); + upEntity.get(0).setSortCode(temp); + this.updateById(upEntity.get(0)); + this.updateById(downEntity); + isOk = true; + } + return isOk; + } + + @Override + public String getBillNumber(String enCode, boolean isCache) throws DataException { + String strNumber; + String tenantId = !StringUtil.isEmpty(userProvider.get().getTenantId()) ? userProvider.get().getTenantId() : ""; + if (isCache) { + String cacheKey = tenantId + userProvider.get().getUserId() + enCode; + if (!redisUtil.exists(cacheKey)) { + strNumber = this.getNumber(enCode); + redisUtil.insert(cacheKey, strNumber); + } else { + strNumber = String.valueOf(redisUtil.getString(cacheKey)); + } + } else { + strNumber = this.getNumber(enCode); + } + return strNumber; + } + + @Override + public void useBillNumber(String enCode) { + String cacheKey = userProvider.get().getTenantId() + userProvider.get().getUserId() + enCode; + redisUtil.remove(cacheKey); + } + + @Override + public ActionResult ImportData(BillRuleEntity entity) throws DataException { + if (entity != null) { + if (isExistByFullName(entity.getFullName(), null)) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (isExistByEnCode(entity.getEnCode(), null)) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + try { + entity.setCreatorTime(new Date()); + entity.setCreatorUserId(UserProvider.getLoginUserId()); + entity.setLastModifyTime(null); + entity.setLastModifyUserId(null); + this.saveOrUpdate(entity); + } catch (Exception e) { + throw new DataException(MsgCode.IMP003.get()); + } + return ActionResult.success(MsgCode.IMP001.get()); + } + return ActionResult.fail("导入数据格式不正确"); + } + @Override + public List getListByCategory(String id,Pagination pagination) { + // 定义变量判断是否需要使用修改时间倒序 + boolean flag = false; + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (!StringUtil.isEmpty(pagination.getKeyword())) { + flag = true; + queryWrapper.lambda().and( + t -> t.like(BillRuleEntity::getFullName, pagination.getKeyword()) + .or().like(BillRuleEntity::getEnCode, pagination.getKeyword()) + ); + } + if (!StringUtil.isEmpty(id)) { + flag = true; + queryWrapper.lambda().eq(BillRuleEntity::getCategory, id); + } + queryWrapper.lambda().eq(BillRuleEntity::getEnabledMark, 1); + // 排序 + queryWrapper.lambda().orderByAsc(BillRuleEntity::getSortCode).orderByDesc(BillRuleEntity::getCreatorTime); + if (flag) { + queryWrapper.lambda().orderByDesc(BillRuleEntity::getLastModifyTime); + } + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage userPage = this.page(page, queryWrapper); + return pagination.setData(userPage.getRecords(), page.getTotal()); + } +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ComFieldsServiceImpl.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ComFieldsServiceImpl.java new file mode 100644 index 0000000..be7de20 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ComFieldsServiceImpl.java @@ -0,0 +1,82 @@ +package jnpf.base.service.impl; + +import jnpf.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import jnpf.base.entity.ComFieldsEntity; +import jnpf.base.mapper.BaseComFieldsMapper; +import jnpf.base.service.ComFieldsService; +import jnpf.util.RandomUtil; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Service +public class ComFieldsServiceImpl extends SuperServiceImpl implements ComFieldsService { + + @Autowired + private UserProvider userProvider; + + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().orderByAsc(ComFieldsEntity::getSortCode).orderByDesc(ComFieldsEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public ComFieldsEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ComFieldsEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public boolean isExistByFullName(String fullName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ComFieldsEntity::getFieldName, fullName); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(ComFieldsEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + + + @Override + public void create(ComFieldsEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setCreatorTime(new Date()); + entity.setCreatorUserId(userProvider.get().getUserId()); + entity.setEnabledMark(1); + this.save(entity); + } + + @Override + public boolean update(String id, ComFieldsEntity entity) { + entity.setId(id); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(userProvider.get().getUserId()); + return this.updateById(entity); + } + + @Override + public void delete(ComFieldsEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/CommonWordsServiceImpl.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/CommonWordsServiceImpl.java new file mode 100644 index 0000000..fd1fb03 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/CommonWordsServiceImpl.java @@ -0,0 +1,80 @@ +package jnpf.base.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import jnpf.base.entity.CommonWordsEntity; +import jnpf.base.entity.SystemEntity; +import jnpf.base.mapper.CommonWordsMapper; +import jnpf.base.model.commonword.ComWordsPagination; +import jnpf.base.service.CommonWordsService; +import jnpf.base.service.SuperServiceImpl; +import jnpf.base.service.SystemService; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.stream.Collectors; + + +/** + * 审批常用语 ServiceImpl + * + * @author JNPF开发平台组 YanYu + * @version v3.4.6 + * @copyrignt 引迈信息技术有限公司 + * @date 2023-01-06 + */ +@Service +public class CommonWordsServiceImpl extends SuperServiceImpl implements CommonWordsService { + + @Autowired + private UserProvider userProvider; + + @Autowired + private SystemService systemService; + + + @Override + public List getSysList(ComWordsPagination comWordsPagination, Boolean currentSysFlag) { + QueryWrapper sysQuery = new QueryWrapper<>(); + // 匹配 + QueryWrapper query = new QueryWrapper<>(); + query.lambda().eq(CommonWordsEntity::getCommonWordsType, 0); +// if(currentSysFlag) query.lambda().like(CommonWordsEntity::getSystemIds, userProvider.get().getSystemId()); + if (StringUtil.isNotEmpty(comWordsPagination.getKeyword())) { + sysQuery.lambda().like(SystemEntity::getFullName, comWordsPagination.getKeyword()); + List ids =systemService.list(sysQuery).stream().map(SystemEntity::getId).collect(Collectors.toList()); + query.lambda().and(t ->{ + // 应用名称 + for (String id : ids) { + t.like(CommonWordsEntity::getSystemIds, id).or(); + } + t.like(CommonWordsEntity::getCommonWordsText, comWordsPagination.getKeyword()); // 常用语 + }); + } + // 排序 + query.lambda().orderByAsc(CommonWordsEntity::getSortCode).orderByDesc(CommonWordsEntity::getCreatorTime); + return this.page(comWordsPagination.getPage(), query).getRecords(); + } + + @Override + public List getListModel(String type) { + QueryWrapper query = new QueryWrapper<>(); + query.lambda().eq(CommonWordsEntity::getEnabledMark, 1) + .and(t -> + t.and(t2 -> t2.eq(CommonWordsEntity::getCreatorUserId, userProvider.get().getUserId()).or().eq(CommonWordsEntity::getCommonWordsType, 0)) + ); + // 排序 + query.lambda().orderByDesc(CommonWordsEntity::getCommonWordsType).orderByAsc(CommonWordsEntity::getSortCode).orderByDesc(CommonWordsEntity::getCreatorTime); + return this.list(query); + } + + @Override + public Boolean existSystem(String systemId) { + QueryWrapper query = new QueryWrapper<>(); + query.lambda().like(CommonWordsEntity::getSystemIds, systemId); + return count(query) > 0; + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/DataInterfaceLogServiceImpl.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/DataInterfaceLogServiceImpl.java new file mode 100644 index 0000000..ee5241d --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/DataInterfaceLogServiceImpl.java @@ -0,0 +1,106 @@ +package jnpf.base.service.impl; + +import jnpf.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import jnpf.base.Pagination; +import jnpf.base.entity.DataInterfaceLogEntity; +import jnpf.base.mapper.DataInterfaceLogMapper; +import jnpf.base.model.InterfaceOauth.PaginationIntrfaceLog; +import jnpf.base.service.DataInterfaceLogService; +import jnpf.util.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-06-03 + */ +@Service +public class DataInterfaceLogServiceImpl extends SuperServiceImpl implements DataInterfaceLogService { + @Autowired + private UserProvider userProvider; + + @Override + public void create(String dateInterfaceId, Integer invokWasteTime) { + DataInterfaceLogEntity entity = new DataInterfaceLogEntity(); + entity.setId(RandomUtil.uuId()); + entity.setInvokTime(DateUtil.getNowDate()); + entity.setUserId(userProvider.get().getUserId()); + entity.setInvokId(dateInterfaceId); + entity.setInvokIp(IpUtil.getIpAddr()); + entity.setInvokType("GET"); + entity.setInvokDevice(ServletUtil.getUserAgent()); + entity.setInvokWasteTime(invokWasteTime); + this.save(entity); + } + @Override + public void create(String dateInterfaceId, Integer invokWasteTime,String appId,String invokType) { + DataInterfaceLogEntity entity = new DataInterfaceLogEntity(); + entity.setId(RandomUtil.uuId()); + entity.setInvokTime(DateUtil.getNowDate()); + entity.setUserId(userProvider.get().getUserId()); + entity.setInvokId(dateInterfaceId); + entity.setInvokIp(IpUtil.getIpAddr()); + entity.setInvokType(invokType); + entity.setInvokDevice(ServletUtil.getUserAgent()); + entity.setInvokWasteTime(invokWasteTime); + entity.setOauthAppId(appId); + this.save(entity); + } + + @Override + public List getList(String invokId, Pagination pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DataInterfaceLogEntity::getInvokId, invokId).orderByDesc(DataInterfaceLogEntity::getInvokTime); + if (StringUtil.isNotEmpty(pagination.getKeyword())){ + queryWrapper.lambda().and( + t->t.like(DataInterfaceLogEntity::getUserId, pagination.getKeyword()) + .or().like(DataInterfaceLogEntity::getInvokIp, pagination.getKeyword()) + .or().like(DataInterfaceLogEntity::getInvokDevice, pagination.getKeyword()) + .or().like(DataInterfaceLogEntity::getInvokType, pagination.getKeyword()) + ); + } + // 排序 + queryWrapper.lambda().orderByDesc(DataInterfaceLogEntity::getInvokTime); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage iPage = this.page(page, queryWrapper); + return pagination.setData(iPage.getRecords(), page.getTotal()); + } + + @Override + public List getListByIds(String appId,List invokIds, PaginationIntrfaceLog pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DataInterfaceLogEntity::getOauthAppId,appId); + queryWrapper.lambda().in(DataInterfaceLogEntity::getInvokId, invokIds).orderByDesc(DataInterfaceLogEntity::getInvokTime); + if (StringUtil.isNotEmpty(pagination.getKeyword())){ + queryWrapper.lambda().and( + t->t.like(DataInterfaceLogEntity::getUserId, pagination.getKeyword()) + .or().like(DataInterfaceLogEntity::getInvokIp, pagination.getKeyword()) + .or().like(DataInterfaceLogEntity::getInvokDevice, pagination.getKeyword()) + .or().like(DataInterfaceLogEntity::getInvokType, pagination.getKeyword()) + ); + } + //日期范围(近7天、近1月、近3月、自定义) + String startTime = pagination.getStartTime() != null ? pagination.getStartTime() : null; + String endTime = pagination.getEndTime() != null ? pagination.getEndTime() : null; + if (!StringUtil.isEmpty(startTime) && !StringUtil.isEmpty(endTime)) { + Date startTimes = DateUtil.stringToDate(DateUtil.daFormatYmd(Long.parseLong(startTime)) + " 00:00:00"); + Date endTimes = DateUtil.stringToDate(DateUtil.daFormatYmd(Long.parseLong(endTime)) + " 23:59:59"); + queryWrapper.lambda().ge(DataInterfaceLogEntity::getInvokTime, startTimes).le(DataInterfaceLogEntity::getInvokTime, endTimes); + } + // 排序 + queryWrapper.lambda().orderByDesc(DataInterfaceLogEntity::getInvokTime); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage iPage = this.page(page, queryWrapper); + return pagination.setData(iPage.getRecords(), page.getTotal()); + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/DataInterfaceServiceImpl.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/DataInterfaceServiceImpl.java new file mode 100644 index 0000000..4b816eb --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/DataInterfaceServiceImpl.java @@ -0,0 +1,1330 @@ +package jnpf.base.service.impl; + +import cn.hutool.core.util.BooleanUtil; +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSON; +import jnpf.base.Pagination; +import jnpf.base.entity.DataInterfaceVariateEntity; +import jnpf.base.service.*; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import jnpf.base.ActionResult; +import jnpf.base.ActionResultCode; +import jnpf.base.UserInfo; +import jnpf.base.entity.DataInterfaceEntity; +import jnpf.base.entity.InterfaceOauthEntity; +import jnpf.base.mapper.DataInterfaceMapper; +import jnpf.base.model.datainterface.*; +import jnpf.base.util.DataInterfaceParamUtil; +import jnpf.config.JnpfOauthConfig; +import jnpf.constant.JnpfConst; +import jnpf.permission.model.datainterface.DataInterfaceVarConst; +import jnpf.permission.service.OrganizeAdministratorService; +import jnpf.permission.service.OrganizeService; +import jnpf.util.JScriptUtil; +import jnpf.base.util.interfaceUtil.InterfaceUtil; +import jnpf.base.vo.PaginationVO; +import jnpf.constant.MsgCode; +import jnpf.database.model.dto.PrepSqlDTO; +import jnpf.database.util.DataSourceUtil; +import jnpf.database.util.JdbcUtil; +import jnpf.exception.DataException; +import jnpf.util.*; +import jnpf.util.wxutil.HttpUtil; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.ObjectUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.script.ScriptException; +import javax.sql.DataSource; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.text.SimpleDateFormat; +import java.time.LocalDateTime; +import java.time.ZoneOffset; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Service +@Slf4j +public class DataInterfaceServiceImpl extends SuperServiceImpl implements DataInterfaceService { + @Autowired + private UserProvider userProvider; + @Autowired + private DbLinkService dblinkService; + @Autowired + private DataSourceUtil dataSourceUtils; + @Autowired + private DataInterfaceLogService dataInterfaceLogService; + @Autowired + private DataInterfaceVariateService dataInterfaceVariateService; + @Autowired + private JnpfOauthConfig jnpfOauthConfig; + @Autowired + private InterfaceOauthService interfaceOauthService; + @Autowired + private OrganizeService organizeApi; + + @Autowired + private OrganizeAdministratorService organizeAdminTratorApi; + @Autowired + private DataInterfaceUserService dataInterfaceUserService; + + + @Override + public List getList(PaginationDataInterface pagination, String type, Integer isSelector) { + // 定义变量判断是否需要使用修改时间倒序 + boolean flag = false; + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (ObjectUtil.isNotEmpty(pagination.getEnabledMark())) { + queryWrapper.lambda().eq(DataInterfaceEntity::getEnabledMark, pagination.getEnabledMark()); + } + //关键字 + if (!StringUtil.isEmpty(pagination.getKeyword())) { + flag = true; + queryWrapper.lambda().and( + t -> t.like(DataInterfaceEntity::getFullName, pagination.getKeyword()) + .or().like(DataInterfaceEntity::getEnCode, pagination.getKeyword()) + ); + } + // 是否分页 + if (pagination.getHasPage() != null && pagination.getHasPage() == 0) { + queryWrapper.lambda().eq(DataInterfaceEntity::getHasPage, pagination.getHasPage()); + } + if (StringUtil.isNotEmpty(pagination.getDataType())) { + String[] split = pagination.getDataType().split(","); + queryWrapper.lambda().in(DataInterfaceEntity::getType, Arrays.asList(split)); + } + if (isSelector == 1) { + queryWrapper.lambda().eq(DataInterfaceEntity::getIsPostPosition, 0); + } + //分类 + queryWrapper.lambda().eq(DataInterfaceEntity::getCategory, pagination.getCategory()); + // 类型 + if (StringUtil.isNotEmpty(type)) { + if(type.contains(",")){ + String[] split = type.split("," ); + queryWrapper.lambda().in(DataInterfaceEntity::getType, Arrays.asList(split)); + }else{ + queryWrapper.lambda().eq(DataInterfaceEntity::getType, Integer.valueOf(type)); + } + } + //排序 + queryWrapper.lambda().orderByAsc(DataInterfaceEntity::getSortCode) + .orderByDesc(DataInterfaceEntity::getCreatorTime); + if (flag) { + queryWrapper.lambda().orderByDesc(DataInterfaceEntity::getLastModifyTime); + } +// queryWrapper.lambda().select(DataInterfaceEntity::getId, DataInterfaceEntity::getType, +// DataInterfaceEntity::getCreatorTime, DataInterfaceEntity::getAction, +// DataInterfaceEntity::getEnCode, DataInterfaceEntity::getEnabledMark, +// DataInterfaceEntity::getFullName, DataInterfaceEntity::getSortCode, DataInterfaceEntity::getIsPostPosition); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage iPage = this.page(page, queryWrapper); + return pagination.setData(iPage.getRecords(), iPage.getTotal()); + } + + @Override + public List getList(boolean filterPage) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (filterPage) { + queryWrapper.lambda().ne(DataInterfaceEntity::getHasPage, 1); + } + queryWrapper.lambda().eq(DataInterfaceEntity::getEnabledMark, 1) + .orderByAsc(DataInterfaceEntity::getSortCode) + .orderByDesc(DataInterfaceEntity::getCreatorTime); + return baseMapper.selectList(queryWrapper); + } + + @Override + public DataInterfaceEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DataInterfaceEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(DataInterfaceEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(userProvider.get().getUserId()); + entity.setCreatorTime(DateUtil.getNowDate()); + entity.setLastModifyTime(null); + entity.setLastModifyUserId(null); + this.saveOrUpdate(entity); + } + + @Override + public boolean update(DataInterfaceEntity entity, String id) throws DataException { + entity.setId(id); + entity.setLastModifyUserId(userProvider.get().getUserId()); + entity.setLastModifyTime(DateUtil.getNowDate()); + return this.updateById(entity); + } + + @Override + public void delete(DataInterfaceEntity entity) { + this.removeById(entity.getId()); + } + + @Override + public boolean isExistByFullNameOrEnCode(String id, String fullName, String enCode) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(fullName)) { + queryWrapper.lambda().eq(DataInterfaceEntity::getFullName, fullName); + } + if (StringUtil.isNotEmpty(enCode)) { + queryWrapper.lambda().ne(DataInterfaceEntity::getId, id); + } + queryWrapper.lambda().eq(DataInterfaceEntity::getFullName, fullName); + if (StringUtil.isNotEmpty(id)) { + queryWrapper.lambda().ne(DataInterfaceEntity::getId, id); + } + return this.count(queryWrapper) > 0; + } + + @Override + public ActionResult infoToIdPageList(String id, DataInterfacePage page) { + DataInterfaceEntity entity = this.getInfo(id); + if (entity == null) { + return ActionResult.page(new ArrayList<>(), JsonUtil.getJsonToBean(new Pagination(), PaginationVO.class)); + } + if (entity.getHasPage() == 1) { + Map map = null; + if (page.getParamList() != null) { + map = new HashMap<>(); + List jsonToList = JsonUtil.getJsonToList(page.getParamList(), DataInterfaceModel.class); + for (DataInterfaceModel dataInterfaceModel : jsonToList) { + String defaultValue = dataInterfaceModel.getDefaultValue(); + if ("".equals(defaultValue) && "int".equals(dataInterfaceModel.getDataType())) { + map.put(dataInterfaceModel.getField(), "0"); + } else { + if ("varchar".equals(dataInterfaceModel.getDataType()) && defaultValue == null) { + defaultValue = ""; + } + map.put(dataInterfaceModel.getField(), defaultValue); + } + } + } + Pagination pagination = new Pagination(); + pagination.setPageSize(page.getPageSize()); + pagination.setCurrentPage(page.getCurrentPage()); + pagination.setKeyword(page.getKeyword()); + return infoToId(id, null, map, null, null, null, pagination, null); + } else { + String dataProcessing = null; + if (StringUtil.isNotEmpty(entity.getDataJsJson())) { + dataProcessing = entity.getDataJsJson(); + } + List> dataList = new ArrayList<>(); + int total = 0; + Map map = null; + if (page.getParamList() != null) { + map = new HashMap<>(); + List jsonToList = JsonUtil.getJsonToList(page.getParamList(), DataInterfaceModel.class); + for (DataInterfaceModel dataInterfaceModel : jsonToList) { + String defaultValue = dataInterfaceModel.getDefaultValue(); + if ("".equals(defaultValue) && "int".equals(dataInterfaceModel.getDataType())) { + map.put(dataInterfaceModel.getField(), "0"); + } else { + if ("varchar".equals(dataInterfaceModel.getDataType()) && defaultValue == null) { + defaultValue = ""; + } + map.put(dataInterfaceModel.getField(), defaultValue); + } + } + } + ActionResult result = infoToId(id, null, map); + if (result.getData() != null) { + if (result.getData() instanceof List) { + dataList = (List>) result.getData(); + } + } + if (StringUtil.isNotEmpty(page.getKeyword()) && StringUtil.isNotEmpty(page.getRelationField())) { + dataList = dataList.stream().filter(t -> String.valueOf(t.get(page.getRelationField())).contains(page.getKeyword())).collect(Collectors.toList()); + } + PaginationVO pagination = new PaginationVO(); + page.setTotal(dataList.size()); + if (StringUtil.isNotEmpty(page.getKeyword()) && StringUtil.isNotEmpty(page.getColumnOptions())) { + String[] colOptions = page.getColumnOptions().split(","); + dataList = dataList.stream().filter(t -> { + boolean isFit = false; + for (String c : colOptions) { + if (String.valueOf(t.get(c)).contains(page.getKeyword())) { + isFit = true; + break; + } + } + return isFit; + }).collect(Collectors.toList()); + } + dataList = PageUtil.getListPage((int) page.getCurrentPage(), (int) page.getPageSize(), dataList); + pagination = JsonUtil.getJsonToBean(page, PaginationVO.class); + return ActionResult.page(dataList, pagination, dataProcessing); + } + } + + @Override + public List> infoToInfo(String id, DataInterfacePage page) { + List> list = new ArrayList<>(); + Map map = null; + DataInterfaceEntity entity = this.getInfo(id); + if (entity == null) { + return new ArrayList<>(); + } + try { + if (entity.getHasPage() == 1) { + if (page.getParamList() != null) { + map = new HashMap<>(); + List jsonToList = JsonUtil.getJsonToList(page.getParamList(), DataInterfaceModel.class); + for (DataInterfaceModel dataInterfaceModel : jsonToList) { + String defaultValue = dataInterfaceModel.getDefaultValue(); + if ("".equals(defaultValue) && "int".equals(dataInterfaceModel.getDataType())) { + map.put(dataInterfaceModel.getField(), "0"); + } else { + if ("varchar".equals(dataInterfaceModel.getDataType()) && defaultValue == null) { + defaultValue = ""; + } + map.put(dataInterfaceModel.getField(), defaultValue); + } + } + } + Map showMap = new HashMap<>(); + if (page.getIds() instanceof List) { + List ids = (List) page.getIds(); + Map finalMap = map; + ids.forEach(t -> { + showMap.put(page.getPropsValue(), t); + ActionResult result = infoToId(id, null, finalMap, null, null, null, null, showMap); + if (result.getData() instanceof Map) { + Map objectMap = (Map) result.getData(); + if (objectMap.size() > 0) { + List mapList = JsonUtil.getJsonToList(objectMap.get("list"), Map.class); + if (mapList != null && mapList.size() > 0) { + list.add(mapList.get(0)); + } else { + list.add(objectMap); + } + } + } else if (result.getData() instanceof List) { + List list1 = (List) result.getData(); + if (list1.size() > 0) { + list.add(list1.get(0)); + } + } else { + + } + }); + } + } else { + if (page.getIds() != null) { + Map dataMap = new HashMap<>(); + if (page.getParamList() != null) { + map = new HashMap<>(); + List jsonToList = JsonUtil.getJsonToList(page.getParamList(), DataInterfaceModel.class); + for (DataInterfaceModel dataInterfaceModel : jsonToList) { + if ("".equals(dataInterfaceModel.getDefaultValue()) && "int".equals(dataInterfaceModel.getDataType())) { + map.put(dataInterfaceModel.getField(), "0"); + } else { + map.put(dataInterfaceModel.getField(), dataInterfaceModel.getDefaultValue()); + } + } + } + ActionResult result = infoToId(id, null, map); + List> dataList = new ArrayList<>(); + if (result.getData() instanceof List) { + dataList = (List>) result.getData(); + List ids = (List) page.getIds(); + List> finalDataList = dataList; + ids.forEach(t -> { + list.add(finalDataList.stream().filter(data -> t.equals(String.valueOf(data.get(page.getPropsValue())))).findFirst().orElse(new HashMap<>())); + }); + } + } + } + } catch (Exception e) { + e.printStackTrace(); + return list; + } + return list; + } + + @Override + public ActionResult infoToId(String id, String tenantId, Map map) { + return infoToId(id, tenantId, map, null, null, null, null, null); + } + + @Override + public ActionResult infoToId(String id, String tenantId, Map map, String token, String appId, String invokType, Pagination pagination, Map showMap) { + DataInterfaceEntity entity = this.getInfo(id); + if (entity == null) { + return ActionResult.success(new ArrayList<>()); + } + // 开始调用的时间 + LocalDateTime dateTime = LocalDateTime.now(); + //调用时间 + int invokWasteTime = 0; + // 验证参数必填或类型 + String checkRequestParams = checkRequestParams(entity.getParameterJson(), map, null); + if (StringUtil.isNotEmpty(checkRequestParams)) { + return ActionResult.fail(checkRequestParams); + } + Object callJs = null; + try { + // 有设置默认值的直接赋值 + replaceDefaultVale(entity.getParameterJson(), map); + + if (pagination == null) { + pagination = new Pagination(); + } + + // 数据配置 + String dataConfigJson = entity.getDataConfigJson(); + DataConfigJsonModel configJsonModel = JsonUtil.getJsonToBean(dataConfigJson, DataConfigJsonModel.class); + // 如果是静态数据 + if (entity.getType() == 2) { + String staticData = configJsonModel.getStaticData(); + Object object = callStaticData(staticData); + handlePostVariate(entity, object); + return ActionResult.success(object); + } else if (entity.getType() == 3) { + // HTTP调用或HTTPS调用 + JSONObject jsonObject = new JSONObject(); + if (showMap == null) { + if (entity.getHasPage() == 0) { + pagination = null; + } + //HTTP调用或HTTPS调用 + jsonObject = callHTTP(map, token, pagination, null, configJsonModel.getApiData()); + } else { + String echoJson = entity.getDataEchoJson(); + DataConfigJsonModel echoJsonModel = JsonUtil.getJsonToBean(echoJson, DataConfigJsonModel.class); + jsonObject = callHTTP(map, token, null, showMap, echoJsonModel.getApiData()); + } + if (Objects.nonNull(jsonObject) && "1".equals(jsonObject.get("errorCode"))) { + return ActionResult.fail("接口暂只支持HTTP和HTTPS方式"); + } + // 判断返回参数长度和key是否跟内置的一致 + if (jsonObject == null) { + return ActionResult.fail("接口请求失败"); + } + handlePostVariate(entity, jsonObject); + Object js = JScriptUtil.callJs(entity.getDataExceptionJson(), jsonObject.get("data") == null ? new ArrayList<>() : jsonObject.get("data")); + if ((js instanceof Boolean && !BooleanUtil.toBoolean(String.valueOf(js)))) { + // 继续执行接口 + if (showMap == null) { + // 处理变量 + handlerVariate(configJsonModel.getApiData()); + jsonObject = callHTTP(map, token, pagination, null, configJsonModel.getApiData()); + } else { + String echoJson = entity.getDataEchoJson(); + DataConfigJsonModel echoJsonModel = JsonUtil.getJsonToBean(echoJson, DataConfigJsonModel.class); + // 处理变量 + handlerVariate(echoJsonModel.getApiData()); + jsonObject = callHTTP(map, token, null, showMap, echoJsonModel.getApiData()); + } + } + if (isInternal(jsonObject)) { + callJs = JScriptUtil.callJs(entity.getDataJsJson(), jsonObject.get("data") == null ? new ArrayList<>() : jsonObject.get("data")); + } else { + callJs = JScriptUtil.callJs(entity.getDataJsJson(), jsonObject); + } + } else if (entity.getType() == 1) { + UserInfo oldUser = null; + if(token != null){ + oldUser = UserProvider.getUser(); + UserInfo userInfo = UserProvider.getUser(token); + UserProvider.setLocalLoginUser(userInfo); + } + try { + if (showMap == null) { + List> sqlMapList = executeSql(entity, 0, map, pagination, null, configJsonModel.getSqlData()); + handlePostVariate(entity, sqlMapList); + callJs = JScriptUtil.callJs(entity.getDataJsJson(), sqlMapList == null ? new ArrayList<>() : sqlMapList); + if (entity.getHasPage() == 1) { + DataConfigJsonModel pageJsonModel = JsonUtil.getJsonToBean(entity.getDataConfigJson(), DataConfigJsonModel.class); + List> maps = executeSql(entity, 1, map, pagination, null, pageJsonModel.getSqlData()); + if (maps.get(0) != null) { + pagination.setTotal(Long.parseLong(String.valueOf(maps.get(0).values().iterator().next()))); + } + return ActionResult.page(sqlMapList, JsonUtil.getJsonToBean(pagination, PaginationVO.class)); + } + } else { + DataConfigJsonModel echoJsonModel = JsonUtil.getJsonToBean(entity.getDataEchoJson(), DataConfigJsonModel.class); + List> sqlMapList = executeSql(entity, 2, map, pagination, showMap, echoJsonModel.getSqlData()); + callJs = JScriptUtil.callJs(entity.getDataJsJson(), sqlMapList == null || sqlMapList.size() == 0 ? new ArrayList<>() : sqlMapList.get(0)); + } + }finally { + if(oldUser != null){ + UserProvider.setLocalLoginUser(oldUser); + } + } + } + if (callJs instanceof Exception) { + return ActionResult.success("接口请求失败", "JS调用失败,错误:" + ((Exception) callJs).getMessage()); + } + return ActionResult.success(callJs); + } catch (Exception e) { + log.error("错误提示:" + e.getMessage()); + // 本地调试时打印出问题 + e.printStackTrace(); + return ActionResult.fail("接口请求失败"); + } finally { + // 调用时间 + invokWasteTime = invokTime(dateTime); + // 添加调用日志 + dataInterfaceLogService.create(id, invokWasteTime, appId, invokType); + } + } + + /** + * 预览时赋值变量 + * + * @param entity + * @param object + */ + private void handlePostVariate(DataInterfaceEntity entity, Object object) { + // 如果是鉴权的话,需要赋值value + if (entity.getIsPostPosition() == 1) { + List list = dataInterfaceVariateService.getList(entity.getId(), null); + list.forEach(t -> { + try { + Object o = JScriptUtil.callJs(t.getExpression(), object); + if (o != null) { + t.setValue(o.toString()); + dataInterfaceVariateService.update(t); + } + } catch (ScriptException e) { + + } + }); + } + } + + @Override + public List getList(List ids) { + if (ids.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(DataInterfaceEntity::getId, ids); + return this.list(queryWrapper); + } + + /** + * 处理静态数据 + * + * @param staticData + * @return + */ + private Object callStaticData(String staticData) { + Object obj; + try { + obj = JsonUtil.stringToMap(staticData); + } catch (Exception e) { + try { + obj = JsonUtil.getJsonToListMap(staticData); + } catch (Exception exception) { + obj = staticData; + } + } + if (ObjectUtils.isEmpty(obj)) { + return new ArrayList<>(); + } + return obj; + } + + /** + * 有设置默认值的直接赋值 + * + * @param parameterJson + * @param map + */ + private void replaceDefaultVale(String parameterJson, Map map) { + List dataInterfaceModelList = JsonUtil.getJsonToList(parameterJson, DataInterfaceModel.class); + if (ObjectUtils.isNotEmpty(dataInterfaceModelList)) { + if (map == null) { + map = new HashMap<>(16); + } + for (DataInterfaceModel dataInterfaceModel : dataInterfaceModelList) { + String field = dataInterfaceModel.getField(); + String defaultValue = dataInterfaceModel.getDefaultValue(); + if (!map.containsKey(field) && StringUtil.isNotEmpty(defaultValue)) { + map.put(field, defaultValue); + } + } + } + } + + /** + * 判断是不是内部接口 + * + * @param jsonObject + * @return + */ + private boolean isInternal(JSONObject jsonObject) { + if (jsonObject != null) { + if (jsonObject.size() == 3 && jsonObject.get("code") != null && jsonObject.get("msg") != null && jsonObject.get("data") != null) { + return true; + } + } + return false; + } + + /** + * 检查参数是够必填或类型是否正确 + * + * @param parameterJson + * @param map + * @param sql 预留参数 + */ + private String checkRequestParams(String parameterJson, Map map, String sql) { + if (map == null || StringUtil.isEmpty(parameterJson)) { + return ""; + } + StringBuilder message = new StringBuilder(); + List dataInterfaceModelList = JsonUtil.getJsonToList(parameterJson, DataInterfaceModel.class); + dataInterfaceModelList.stream().anyMatch(model -> { + // 验证是否必填 + if (model.getRequired() == 1) { + String value = map.get(model.getField()); + if (StringUtil.isEmpty(value)) { + message.append(model.getField()).append("不能为空"); + } + } + if (message.length() == 0) { + // 验证类型 + if (model.getDataType() != null) { + String value = map.get(model.getField()); + // 判断是整形 + if ("int".equals(model.getDataType())) { + try { + Integer.parseInt(value); + } catch (Exception e) { + message.append(model.getField()).append("类型必须为整型"); + } + } else if ("datetime".equals(model.getDataType())) { + try { + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + map.put(model.getField(), DateUtil.dateFormat(formatter.parse(value))); + } catch (Exception e) { + try { + map.put(model.getField(), DateUtil.dateFormat(new Date(Long.valueOf(value)))); + } catch (Exception ex) { + message.append(model.getField() + "类型必须为日期时间型"); + } + } + } else if ("decimal".equals(model.getDataType())) { + try { + Double.valueOf(value); + } catch (Exception e) { + message.append(model.getField()).append("类型必须为浮点型"); + } + } + } + } + return message.length() > 0; + }); + return message.toString(); + } + + + @Override + public ActionResult infoToIdNew(String id, String tenantId, DataInterfaceActionModel model) { + //鉴权验证 + // 获取token + String authorSignature = ServletUtil.getRequest().getHeader(Constants.AUTHORIZATION); + String[] authorSignatureArr = authorSignature.split(":"); + if (authorSignatureArr.length != 3) { + return ActionResult.fail(ActionResultCode.ValidateError.getMessage()); + } + String appId = authorSignatureArr[0]; + String author = authorSignatureArr[2]; + Map map = model.getMap(); + String interfaceUserToken = null; + InterfaceOauthEntity infoByAppId = interfaceOauthService.getInfoByAppId(appId); + //未提供app相关,接口认证失效,接口不在授权列表时无权访问 + if (infoByAppId == null || infoByAppId.getEnabledMark() == 0 || !infoByAppId.getDataInterfaceIds().contains(id)) { + return ActionResult.fail(MsgCode.WF122.get()); + } + if (infoByAppId.getVerifySignature() == 1) {//验证开启 + try { + //验证请求有效期1分钟内 + String ymdateStr = ServletUtil.getRequest().getHeader(InterfaceUtil.YMDATE); + Date ymdate = new Date(Long.parseLong(ymdateStr)); + Date time = DateUtil.dateAddMinutes(ymdate, 1); + if (DateUtil.getNowDate().after(time)) { + return ActionResult.fail("验证请求超时"); + } + //验证签名有效性 + boolean flag = InterfaceUtil.verifySignature(infoByAppId.getAppSecret(), author); + if (!flag) { + return ActionResult.fail(ActionResultCode.ValidateError.getMessage()); + } + } catch (Exception e) { + e.printStackTrace(); + return ActionResult.fail(ActionResultCode.ValidateError.getMessage()); + } + } else {//验证未开启,直接使用秘钥进行验证 + if (!infoByAppId.getAppSecret().equals(author)) { + return ActionResult.fail("appSecret错误"); + } + } + //验证使用期限 + Date usefulLife = infoByAppId.getUsefulLife(); + if (infoByAppId.getUsefulLife() != null && usefulLife.before(DateUtil.getNowDate())) {//空值无限期 + return ActionResult.fail("appId使用期限已到期"); + } + try{ + //用户秘钥获取token + interfaceUserToken = dataInterfaceUserService.getInterfaceUserToken(tenantId,infoByAppId.getId(), ServletUtil.getRequest().getHeader(InterfaceUtil.USERKEY)); + }catch (Exception e){ + return ActionResult.fail(e.getMessage()); + } + //黑白名单验证 + String ipwhiteList = StringUtil.isNotEmpty(infoByAppId.getWhiteList()) ? infoByAppId.getWhiteList() : "";//ip白名单 + String ipwhiteBlackList = StringUtil.isNotEmpty(infoByAppId.getBlackList()) ? infoByAppId.getBlackList() : "";//ip黑名单 + String ipAddr = IpUtil.getIpAddr(); + if (StringUtil.isNotEmpty(ipwhiteList) && !ipwhiteList.contains(ipAddr)) {//不属于白名单 + return ActionResult.fail(MsgCode.LOG010.get()); + } +// if (StringUtil.isNotEmpty(ipwhiteBlackList) && ipwhiteBlackList.contains(ipAddr)) {//属于黑名单 +// return ActionResult.fail(ActionResultCode.ValidateError.getMessage()); +// } + //以下调用接口 + return infoToId(id, null, map, interfaceUserToken, infoByAppId.getAppId(), model.getInvokType(), null, null); + } + + + @Override + public DataInterfaceActionModel checkParams(Map map) { + String ymDate = ServletUtil.getRequest().getHeader(InterfaceUtil.YMDATE); + String authorSignature = ServletUtil.getRequest().getHeader(Constants.AUTHORIZATION); + if (StringUtils.isEmpty(ymDate)) { + throw new RuntimeException("header参数:YmDate未传值"); + } + if (StringUtils.isEmpty(authorSignature)) { + throw new RuntimeException("header参数:" + Constants.AUTHORIZATION + "未传值"); + } + DataInterfaceActionModel entity = new DataInterfaceActionModel(); + //判断是否多租户,取参数tenantId + if (InterfaceUtil.checkParam(map, "tenantId")) { + entity.setTenantId(map.get("tenantId")); + } + entity.setMap(map); + return entity; + } + + /** + * 执行SQL + * + * @param entity + * @param sqlType + * @param map + * @return + * @throws DataException + */ + private List> executeSql(DataInterfaceEntity entity, int sqlType, Map map, + Pagination pagination, Map showMap, + SqlDateModel sqlDateModel) throws Exception { + DataSourceUtil linkEntity = dblinkService.getInfo(sqlDateModel.getDbLinkId()); + String sql = sqlDateModel.getSql(); + if (entity.getHasPage() == 1) { + if (sqlType == 1) { + DataConfigJsonModel dataConfigJsonModel = JsonUtil.getJsonToBean(entity.getDataCountJson(), DataConfigJsonModel.class); + if (dataConfigJsonModel != null) { + SqlDateModel countSqlDateModel = JsonUtil.getJsonToBean(dataConfigJsonModel.getSqlData(), SqlDateModel.class); + sql = countSqlDateModel.getSql(); + } + } else if (sqlType == 2) { + DataConfigJsonModel dataConfigJsonModel = JsonUtil.getJsonToBean(entity.getDataEchoJson(), DataConfigJsonModel.class); + if (dataConfigJsonModel != null) { + SqlDateModel countSqlDateModel = JsonUtil.getJsonToBean(dataConfigJsonModel.getSqlData(), SqlDateModel.class); + sql = countSqlDateModel.getSql(); + } + } + } + UserInfo userInfo = userProvider.get(); + if (linkEntity == null) { + linkEntity = dataSourceUtils; + } + // 系统内置参数替换 + Map systemParameter = systemParameter(sql, userInfo, pagination, showMap); + // 自定义参数替换 + sql = customizationParameter(entity.getParameterJson(), sql, map, systemParameter); + + // 处理SQL + List values = new ArrayList<>(systemParameter.size()); + // 参数替换为占位符 + sql = getHandleArraysSql(sql, values, systemParameter); + if (showMap != null) { + sql = sql.replace(DataInterfaceVarConst.SHOWKEY, showMap.keySet().iterator().next()); + } + + //封装sql---视图查询 -重新封装sql + if (StringUtil.isNotEmpty(sql) && Objects.nonNull(map) + && StringUtil.isNotEmpty(map.get("searchSqlStr")) && Objects.equals(entity.getAction(), 3)) { + if (sql.trim().endsWith(";")) { + sql = sql.trim(); + sql = sql.substring(0, sql.length() - 1); + } + sql = "select * from (" + sql + ") as t where " + map.get("searchSqlStr") + ";"; + } + //封装sql结束--- + + log.info("当前执行SQL:" + sql); + if (entity.getHasPage() == 1 && (sql.contains(";") && sql.trim().indexOf(";") != sql.trim().length() - 1)) { + return null; + } + if (entity.getAction() != null && entity.getAction() != 3) { + JdbcUtil.creUpDe(new PrepSqlDTO(sql, values).withConn(linkEntity, null)); + return null; + } + String objectToString = JsonUtil.getObjectToStringAsDate(JdbcUtil.queryList(new PrepSqlDTO(sql, values).withConn(linkEntity, null)).setIsAlias(true).get()); + return JsonUtil.getJsonToListMap(objectToString); + } + + /** + * 自定义参数替换 + * + * @param parameterJson 参数配置 + * @param sql sql + * @param map 参数 + * @param systemParameter 参数集合 + */ + private String customizationParameter(String parameterJson, String sql, Map map, + Map systemParameter) { + if (StringUtil.isNotEmpty(sql) && Objects.nonNull(map)) { + Map placeholderMap = new HashMap<>(); + for (String key : map.keySet()) { + // 验证参数key对比 + List jsonToList = JsonUtil.getJsonToList(parameterJson, DataInterfaceModel.class); + DataInterfaceModel dataInterfaceModel = jsonToList.stream().filter(t -> key.equals(t.getField()) && "int".equals(t.getDataType())).findFirst().orElse(null); + String tmpValue = map.get(key); + if (tmpValue != null) { + //参数前方 上个参数后方的语句中是否有 in + String sqlarr1 = sql.split("\\{" + key + "\\}")[0]; + String[] sqlarr2 = sqlarr1.split("\\}"); + String sql1 = sqlarr2.length > 1 ? sqlarr2[sqlarr2.length - 1] : sqlarr2[0]; + boolean isInSql = sql1.toLowerCase().contains(" in "); + List valueList; + if (isInSql) { + valueList = Arrays.asList(tmpValue.split(",")); + } else { + valueList = Arrays.asList(new String[]{tmpValue}); + } + String placeholder = "?"; + for (int i = 1; i < valueList.size(); i++) { + placeholder += ",?"; + } + String finalSql = sql; + if (dataInterfaceModel != null) { + valueList.forEach(t -> { + DataInterfaceParamUtil.getParamModel(systemParameter, finalSql, "{" + key + "}", StringUtil.isNotEmpty(tmpValue) ? Integer.valueOf(t) : 0); + }); + } else { + valueList.forEach(t -> { + DataInterfaceParamUtil.getParamModel(systemParameter, finalSql, "{" + key + "}", t); + }); + } + placeholderMap.put(key, placeholder); + } else { + DataInterfaceParamUtil.getParamModel(systemParameter, sql, "{" + key + "}", null); + placeholderMap.put(key, "?"); + } + } + for (String key : placeholderMap.keySet()) { + sql = sql.replaceAll("\\{" + key + "}", placeholderMap.get(key)); + } + } + return sql; + } + + /** + * 参数替换为占位符 + * + * @param sql + * @param values + * @param systemParameter + * @return + */ + private String getHandleArraysSql(String sql, List values, Map systemParameter) { + if (StringUtil.isNotEmpty(sql)) { + for (Double aDouble : systemParameter.keySet()) { + Object value = systemParameter.get(aDouble).getValue(); + values.add(value); + } + for (Double aDouble : systemParameter.keySet()) { + DataInterfaceMarkModel dataInterfaceMarkModel = systemParameter.get(aDouble); + if (DataInterfaceVarConst.ORGANDSUB.equals(dataInterfaceMarkModel.getMarkName())) { + if (dataInterfaceMarkModel.getValue() instanceof List) { + List list = (List) dataInterfaceMarkModel.getValue(); + String placeholder = "?"; + int index = 0; + boolean addOrSet = false; + for (Object obj: list) { + placeholder += ",?"; + if (!addOrSet) { + // 得到下标 + int i = values.indexOf(dataInterfaceMarkModel.getValue()); + values.set(i, obj); + addOrSet = true; + index = i++; + } else { + values.add(index, obj); + } + } + sql = sql.replaceAll(DataInterfaceVarConst.ORGANDSUB, placeholder); + } + } + if (DataInterfaceVarConst.USERANDSUB.equals(dataInterfaceMarkModel.getMarkName())) { + if (dataInterfaceMarkModel.getValue() instanceof List) { + List list = (List) dataInterfaceMarkModel.getValue(); + String placeholder = "?"; + int index = 0; + boolean addOrSet = false; + for (Object obj: list) { + placeholder += ",?"; + if (!addOrSet) { + // 得到下标 + int i = values.indexOf(dataInterfaceMarkModel.getValue()); + values.set(i, obj); + addOrSet = true; + index = i++; + } else { + values.add(index, obj); + } + } + sql = sql.replaceAll(DataInterfaceVarConst.USERANDSUB, placeholder); + } + } + if (DataInterfaceVarConst.CHARORG.equals(dataInterfaceMarkModel.getMarkName())) { + if (dataInterfaceMarkModel.getValue() instanceof List) { + List list = (List) dataInterfaceMarkModel.getValue(); + String placeholder = "?"; + int index = 0; + boolean addOrSet = false; + for (Object obj: list) { + placeholder += ",?"; + if (!addOrSet) { + // 得到下标 + int i = values.indexOf(dataInterfaceMarkModel.getValue()); + values.set(i, obj); + addOrSet = true; + index = i++; + } else { + values.add(index, obj); + } + } + sql = sql.replaceAll(DataInterfaceVarConst.CHARORG, placeholder); + } + } + } + sql = sql.replaceAll(DataInterfaceVarConst.USER, "?"); + sql = sql.replaceAll(DataInterfaceVarConst.ORG, "?"); + sql = sql.replaceAll(DataInterfaceVarConst.KEYWORD, "?"); + sql = sql.replaceAll(DataInterfaceVarConst.OFFSETSIZE, "?"); + sql = sql.replaceAll(DataInterfaceVarConst.PAGESIZE, "?"); +// sql = sql.replaceAll(DataInterfaceVarEnum.SHOWKEY, "?"); + sql = sql.replaceAll(DataInterfaceVarConst.SHOWVALUE, "?"); + sql = sql.replaceAll(DataInterfaceVarConst.ID, "?"); + } + return sql; + } + + /** + * HTTP调用 + * + * @return get + */ + private JSONObject callHTTP(Map map, + String token, Pagination pagination, Map showMap, + ApiDateModel apiDateModel) throws UnsupportedEncodingException { + JSONObject get = new JSONObject(); + String path = apiDateModel.getUrl(); + // 请求方法 + String requestMethod = apiDateModel.getMethod() == 1 ? "GET" : "POST"; + // 获取请求头参数 + List header = apiDateModel.getHeader(); + // 自定义参数 + List query = apiDateModel.getQuery(); + String body = apiDateModel.getBody(); + int bodyType = apiDateModel.getBodyType() == 1 ? 0 : apiDateModel.getBodyType() == null ? 0 : apiDateModel.getBodyType(); + // Post请求拼接参数 + JSONObject jsonObject = null; + List jsonObjects1 = null; + //判断是否为http或https + if (StringUtil.isNotEmpty(path) && path.startsWith("/")) { + path = jnpfOauthConfig.getJnpfDomain() + path; + } + if (path.startsWith("http")) { + String showKey = null; + Object showValue = null; + if (showMap != null) { + if (showMap.size() > 0) { + showKey = showMap.keySet().iterator().next(); + showValue = showMap.values().iterator().next(); + } + } + // 替换url上的回显参数 + path = path.replace("{" + DataInterfaceVarConst.SHOWKEY.replaceAll("@", "") + "}", showKey != null ? showKey : ""); + path = path.replace("{" + DataInterfaceVarConst.SHOWVALUE.replaceAll("@", "") + "}", showValue != null ? URLEncoder.encode(String.valueOf(showValue), "UTF-8") : ""); + //请求参数解析 + if (query != null) { + // 判断是否为get,get从url上拼接 + path += !path.contains("?") ? "?" : "&"; + for (HeadModel headModel : query) { + if ("1".equals(headModel.getSource())) { + if (map != null && map.containsKey(headModel.getDefaultValue())) { + String value = map.get(headModel.getDefaultValue()); + path += headModel.getField() + "=" + URLEncoder.encode(value +// .replaceAll("'", "") + , "UTF-8") + "&"; + } else { + path += headModel.getField() + "=" + URLEncoder.encode(map.get(headModel.getDefaultValue()) +// .replaceAll("'", "") + , "UTF-8") + "&"; + } + } + if ("2".equals(headModel.getSource())) { + DataInterfaceVariateEntity variateEntity = dataInterfaceVariateService.getInfo(headModel.getDefaultValue()); + path += headModel.getField() + "=" + variateEntity.getValue() + "&"; + } + if ("3".equals(headModel.getSource())) { + path += headModel.getField() + "=" + URLEncoder.encode(headModel.getDefaultValue() +// .replaceAll("'", "") + , "UTF-8") + "&"; + } + // 分页参数 + if ("4".equals(headModel.getSource())) { + Map map1 = JsonUtil.entityToMap(pagination); + + Object urlValue = map1.get(headModel.getDefaultValue()); + if (urlValue instanceof String && ObjectUtil.isNotNull(urlValue)) { + path += headModel.getField() + "=" + URLEncoder.encode(String.valueOf(urlValue), "UTF-8") + "&"; + } else { + path += headModel.getField() + "=" + urlValue + "&"; + } + } + // 回显参数 + if ("5".equals(headModel.getSource())) { + if (DataInterfaceVarConst.SHOWKEY.equals(headModel.getDefaultValue())) { + if (showKey != null) { + path += headModel.getField() + "=" + URLEncoder.encode(showKey, "UTF-8") + "&"; + } + } else { + if (showValue != null) { + path += headModel.getField() + "=" + URLEncoder.encode(String.valueOf(showValue), "UTF-8") + "&"; + } else { + path += headModel.getField() + "&"; + } + } + } + } + } + + String jsonObjects = null; + if (bodyType == 1 || bodyType == 2) { + List bodyJson = JsonUtil.getJsonToList(body, HeadModel.class); + for (HeadModel headModel : bodyJson) { + if ("1".equals(headModel.getSource())) { + if (map != null && map.containsKey(headModel.getDefaultValue())) { + String value = map.get(headModel.getDefaultValue()); + jsonObjects += "&" + headModel.getField() + "=" + URLEncoder.encode(value +// .replaceAll("'", "") + , "UTF-8"); + } else { + jsonObjects += "&" + headModel.getField() + "=" + URLEncoder.encode(map.get(headModel.getDefaultValue()) +// .replaceAll("'", "") + , "UTF-8"); + } + } + if ("2".equals(headModel.getSource())) { + DataInterfaceVariateEntity variateEntity = dataInterfaceVariateService.getInfo(headModel.getDefaultValue()); + jsonObjects += "&" + headModel.getField() + "=" + variateEntity.getValue(); + } + if ("3".equals(headModel.getSource())) { + jsonObjects += "&" + headModel.getField() + "=" + headModel.getDefaultValue(); + } + } + } else if (bodyType == 3 || bodyType == 4){ + // 优先替换变量 + Pattern compile = Pattern.compile("\\{@\\w+}"); + Matcher matcher = compile.matcher(body); + while (matcher.find()) { + // 得到参数 + String group = matcher.group(); + String variate = group.replace("{", "").replace("}", "").replace("@", ""); + DataInterfaceVariateEntity dataInterfaceVariateEntity = dataInterfaceVariateService.getInfoByFullName(variate); + if (dataInterfaceVariateEntity != null) { + body = body.replace(group, dataInterfaceVariateEntity.getValue()); + } + } + Object parse = JSON.parse(body); + if (parse != null) { + if (parse instanceof JSONObject) { + jsonObject = JsonUtil.getJsonToBean(body, JSONObject.class); + if (jsonObject == null) { + jsonObject = new JSONObject(); + } + if (map != null) { + for (String jsonKey : jsonObject.keySet()) { + for (String key : map.keySet()) { + String keys = "{" + key + "}"; + if (jsonKey.equals(keys)) { + jsonObject.put(key, jsonObject.get(key)); + } + } + } + for (String jsonKey : jsonObject.keySet()) { + for (String key : map.keySet()) { + String keys = "{" + key + "}"; + if (keys.equals(jsonObject.get(jsonKey))) { + jsonObject.put(jsonKey, map.get(key)); + } + } + } + } + } else { + jsonObject = null; + jsonObjects1 = JsonUtil.getJsonToList(body, JSONObject.class); + if (map != null && jsonObjects1 != null) { + for (JSONObject object : jsonObjects1) { + for (String jsonKey : object.keySet()) { + for (String key : map.keySet()) { + String keys = "{" + key + "}"; + if (jsonKey.equals(keys)) { + object.put(key, object.get(key)); + } + } + } + for (String jsonKey : object.keySet()) { + for (String key : map.keySet()) { + String keys = "{" + key + "}"; + if (keys.equals(object.get(jsonKey))) { + object.put(jsonKey, map.get(key)); + } + } + } + } + } + } + } + + } + //获取token + if (StringUtil.isEmpty(token)) { + HeadModel headModel = header.stream().filter(t -> Constants.AUTHORIZATION.equals(t.getField())).findFirst().orElse(null); + if (headModel != null) { + token = headModel.getDefaultValue(); + } else { + token = UserProvider.getToken(); + } + } + if (jsonObject == null && jsonObjects1 != null) { + jsonObjects = jsonObjects1.toString(); + } else { + jsonObjects = StringUtil.isEmpty(jsonObjects) ? jsonObject != null && jsonObject.size() > 0 ? jsonObject.toJSONString() : null : jsonObjects; + } + if (apiDateModel.getMethod() == 1) { + jsonObjects = ""; + } + JSONObject headerJson = new JSONObject(); + // 请求头 + for (HeadModel headModel : header) { + if ("1".equals(headModel.getSource())) { + if (map != null && map.containsKey(headModel.getDefaultValue())) { + String value = map.get(headModel.getDefaultValue()); + headerJson.put(headModel.getField(), value +// .replaceAll("'", "") + ); + } else { + headerJson.put(headModel.getField(), map.get(headModel.getDefaultValue())); + } + } + if ("2".equals(headModel.getSource())) { + DataInterfaceVariateEntity variateEntity = dataInterfaceVariateService.getInfo(headModel.getDefaultValue()); + headerJson.put(headModel.getField(), variateEntity.getValue()); + } + if ("3".equals(headModel.getSource())) { + headerJson.put(headModel.getField(), headModel.getDefaultValue()); + } + // 分页参数 + if ("4".equals(headModel.getSource())) { + Map map1 = JsonUtil.entityToMap(pagination); + + Object urlValue = map1.get(headModel.getDefaultValue()); + headerJson.put(headModel.getField(), urlValue); + } + // 回显参数 + if ("5".equals(headModel.getSource())) { + if (DataInterfaceVarConst.SHOWKEY.equals(headModel.getDefaultValue())) { + headerJson.put(headModel.getField(), showKey); + } else { + headerJson.put(headModel.getField(), showValue); + } + } + } + get = HttpUtil.httpRequest(path, requestMethod, jsonObjects, token, headerJson.size() > 0 ? JsonUtil.getObjectToString(headerJson) : null, String.valueOf(bodyType)); + return get; + } else { + get.put("errorCode", "1"); + return get; + } + } + + /** + * 处理变量 + * + * @param apiDateModel + */ + public void handlerVariate(ApiDateModel apiDateModel) { + Set variate = new HashSet<>(); + // 获取请求头参数 + List header = apiDateModel.getHeader(); + header.forEach(headModel -> { + if ("2".equals(headModel.getSource())) { + variate.add(headModel.getDefaultValue()); + } + }); + // 自定义参数 + List query = apiDateModel.getQuery(); + query.forEach(headModel -> { + if ("2".equals(headModel.getSource())) { + variate.add(headModel.getDefaultValue()); + } + }); + List bodyJson = JsonUtil.getJsonToList(apiDateModel.getBody(), HeadModel.class); + if (bodyJson != null) { + bodyJson.forEach(headModel -> { + if ("2".equals(headModel.getSource())) { + variate.add(headModel.getDefaultValue()); + } + }); + } + List variateEntities = dataInterfaceVariateService.getListByIds(new ArrayList<>(variate)); + List collect = variateEntities.stream().map(DataInterfaceVariateEntity::getInterfaceId).collect(Collectors.toList()); + List list = this.getList(collect); + Map map = new HashMap<>(); + list.forEach(t -> { + try { + DataConfigJsonModel dataConfigJsonModel = JsonUtil.getJsonToBean(t.getDataConfigJson(), DataConfigJsonModel.class); + JSONObject jsonObject = callHTTP(null, UserProvider.getToken(), new Pagination(), null, JsonUtil.getJsonToBean(dataConfigJsonModel.getApiData(), ApiDateModel.class)); + if (Objects.nonNull(jsonObject) && "1".equals(jsonObject.get("errorCode"))) { + log.error("接口暂只支持HTTP和HTTPS方式"); + return; + } + // 判断返回参数长度和key是否跟内置的一致 + if (jsonObject == null) { + log.error("接口请求失败"); + return; + } + Object js = JScriptUtil.callJs(t.getDataExceptionJson(), jsonObject.get("data") == null ? new ArrayList<>() : jsonObject.get("data")); + if (isInternal(jsonObject)) { + map.put(t.getId(), String.valueOf(JScriptUtil.callJs(t.getDataJsJson(), jsonObject.get("data") == null ? new ArrayList<>() : jsonObject.get("data")))); + } else { + map.put(t.getId(), String.valueOf(JScriptUtil.callJs(t.getDataJsJson(), jsonObject))); + } + } catch (Exception e) { + e.printStackTrace(); + } + }); + dataInterfaceVariateService.update(map, variateEntities); + } + + /** + * 处理系统参数 + * + * @param sql + * @return + */ + private Map systemParameter(String sql, UserInfo userInfo, Pagination pagination, Map showMap) { + Map paramValue = new TreeMap<>(); + //当前组织及子组织 + if (sql.contains(DataInterfaceVarConst.ORGANDSUB)) { + String orgId = userInfo.getOrganizeId(); + if (StringUtil.isNotEmpty(userInfo.getDepartmentId())) { + orgId = userInfo.getDepartmentId(); + } + List underOrganizations = organizeApi.getUnderOrganizations(orgId, false); + underOrganizations.add(orgId); + DataInterfaceParamUtil.getParamModel(paramValue, sql, DataInterfaceVarConst.ORGANDSUB, underOrganizations); + } + //当前用户及下属 + if (sql.contains(DataInterfaceVarConst.USERANDSUB)) { + List subOrganizeIds = new ArrayList<>(); + if (userInfo.getSubordinateIds().size() > 0) { + subOrganizeIds = userInfo.getSubordinateIds(); + } + subOrganizeIds.add(userInfo.getUserId()); + DataInterfaceParamUtil.getParamModel(paramValue, sql, DataInterfaceVarConst.USERANDSUB, subOrganizeIds); + } + //当前分管组织 + if (sql.contains(DataInterfaceVarConst.CHARORG) && StringUtil.isNotEmpty(userInfo.getUserId())) { + List orgIds = organizeAdminTratorApi.getOrganizeUserList(JnpfConst.CURRENT_ORG_SUB); + DataInterfaceParamUtil.getParamModel(paramValue, sql, DataInterfaceVarConst.CHARORG, orgIds); + } + //当前组织 + if (sql.contains(DataInterfaceVarConst.ORG)) { + String orgId = userInfo.getOrganizeId(); + if (StringUtil.isNotEmpty(userInfo.getDepartmentId())) { + orgId = userInfo.getDepartmentId(); + } + DataInterfaceParamUtil.getParamModel(paramValue, sql, DataInterfaceVarConst.ORG, orgId); + } + //关键字 + if (sql.contains(DataInterfaceVarConst.KEYWORD)) { + DataInterfaceParamUtil.getParamModel(paramValue, sql, DataInterfaceVarConst.KEYWORD, pagination.getKeyword()); + } + // 当前页数 + if (sql.contains(DataInterfaceVarConst.OFFSETSIZE)) { + DataInterfaceParamUtil.getParamModel(paramValue, sql, DataInterfaceVarConst.OFFSETSIZE, pagination.getPageSize() * (pagination.getCurrentPage() - 1)); + } + // 每页行数 + if (sql.contains(DataInterfaceVarConst.PAGESIZE)) { + DataInterfaceParamUtil.getParamModel(paramValue, sql, DataInterfaceVarConst.PAGESIZE, pagination.getPageSize()); + } + //当前用户 + if (sql.contains(DataInterfaceVarConst.USER)) { + String userId = userInfo.getUserId(); + DataInterfaceParamUtil.getParamModel(paramValue, sql, DataInterfaceVarConst.USER, userId); + } +// // 每页行数 +// if (sql.contains(DataInterfaceVarEnum.SHOWKEY)) { +// DataInterfaceParamUtil.getParamModel(paramValue, sql, DataInterfaceVarEnum.SHOWKEY, showMap.keySet().iterator().next()); +// } + // 每页行数 + if (sql.contains(DataInterfaceVarConst.SHOWVALUE)) { + DataInterfaceParamUtil.getParamModel(paramValue, sql, DataInterfaceVarConst.SHOWVALUE, showMap.values().iterator().next()); + } + // 生成雪花id + if (sql.contains(DataInterfaceVarConst.ID)) { + DataInterfaceParamUtil.getParamModel(paramValue, sql, DataInterfaceVarConst.ID, RandomUtil.uuId()); + } + return paramValue; + } + + /** + * 计算执行时间 + * + * @param dateTime + * @return + */ + public int invokTime(LocalDateTime dateTime) { + //调用时间 + int invokWasteTime = Integer.valueOf((int) (System.currentTimeMillis() - dateTime.toInstant(ZoneOffset.of("+8")).toEpochMilli())); + return invokWasteTime; + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/DataInterfaceUserServiceImpl.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/DataInterfaceUserServiceImpl.java new file mode 100644 index 0000000..ff85fa6 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/DataInterfaceUserServiceImpl.java @@ -0,0 +1,88 @@ +package jnpf.base.service.impl; + +import cn.hutool.core.collection.CollectionUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import jnpf.base.entity.DataInterfaceUserEntity; +import jnpf.base.mapper.DataInterfaceUserMapper; +import jnpf.base.model.InterfaceOauth.InterfaceUserForm; +import jnpf.base.service.DataInterfaceUserService; +import jnpf.base.service.SuperServiceImpl; +import jnpf.permission.service.UserService; +import jnpf.util.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.stream.Collectors; + +/** + * @author JNPF开发平台组 + * @version V3.4.7 + * @copyright 引迈信息技术有限公司 + * @date 2021/9/20 9:22 + */ +@Service +@Slf4j +public class DataInterfaceUserServiceImpl extends SuperServiceImpl implements DataInterfaceUserService { + + @Autowired + private UserProvider userProvider; + @Autowired + protected AuthUtil authUtil; + + @Override + public void saveUserList(InterfaceUserForm interfaceUserForm) { + if (interfaceUserForm.getUserIds() != null) { + List userList = interfaceUserForm.getUserIds(); + List select = this.select(interfaceUserForm.getInterfaceIdentId()); + List dbList = select.stream().map(DataInterfaceUserEntity::getUserId).collect(Collectors.toList()); + + List saveList = userList.stream().filter(t -> !dbList.contains(t)).collect(Collectors.toList()); + List updateList = select.stream().filter(t -> userList.contains(t.getUserId())).collect(Collectors.toList()); + List deleteList = select.stream().filter(t -> !userList.contains(t.getUserId())).collect(Collectors.toList()); + + for (String userId : saveList) { + DataInterfaceUserEntity entity = new DataInterfaceUserEntity(); + entity.setId(RandomUtil.uuId()); + entity.setUserKey(RandomUtil.uuId().substring(2)); + entity.setOauthId(interfaceUserForm.getInterfaceIdentId()); + entity.setUserId(userId); + entity.setCreatorUserId(userProvider.get().getUserId()); + entity.setCreatorTime(DateUtil.getNowDate()); + this.save(entity); + } + for (DataInterfaceUserEntity updateE : updateList) { + this.updateById(updateE); + } + for (DataInterfaceUserEntity deleteE : deleteList) { + this.removeById(deleteE.getId()); + } + } + } + + @Override + public List select(String oauthId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DataInterfaceUserEntity::getOauthId, oauthId); + return this.list(queryWrapper); + } + + @Override + public String getInterfaceUserToken(String tenantId, String oauthId, String userKey) { + List select = this.select(oauthId); + if (CollectionUtil.isEmpty(select)) { + return null; + } + if (StringUtil.isEmpty(userKey)) { + throw new RuntimeException("未填写UserKey,请确认"); + } + DataInterfaceUserEntity entity = select.stream().filter(item -> item.getUserKey().equals(userKey)).findFirst().orElse(null); + if (entity == null) { + throw new RuntimeException("UserKey不匹配,请填写正确的UserKey"); + } + + String token = authUtil.loginTempUser(entity.getUserId(), tenantId, true); + return token; + } +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/DataInterfaceVariateServiceImpl.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/DataInterfaceVariateServiceImpl.java new file mode 100644 index 0000000..9cb21db --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/DataInterfaceVariateServiceImpl.java @@ -0,0 +1,96 @@ +package jnpf.base.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import jnpf.base.Page; +import jnpf.base.entity.DataInterfaceVariateEntity; +import jnpf.base.mapper.DataInterfaceVariateMapper; +import jnpf.base.service.DataInterfaceVariateService; +import jnpf.base.service.SuperServiceImpl; +import jnpf.util.*; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +@Service +public class DataInterfaceVariateServiceImpl extends SuperServiceImpl implements DataInterfaceVariateService { + + @Override + public List getList(String id, Page page) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().orderByDesc(DataInterfaceVariateEntity::getCreatorTime); + if (StringUtil.isNotEmpty(id)) { + queryWrapper.lambda().eq(DataInterfaceVariateEntity::getInterfaceId, id); + } + if (page != null && StringUtil.isNotEmpty(page.getKeyword())) { + queryWrapper.lambda().like(DataInterfaceVariateEntity::getFullName, page.getKeyword()); +// queryWrapper.lambda().orderByDesc(DataInterfaceVariateEntity::getLastModifyTime); + } + return this.list(queryWrapper); + } + + @Override + public DataInterfaceVariateEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DataInterfaceVariateEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public boolean isExistByFullName(DataInterfaceVariateEntity entity) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(entity.getId())) { + queryWrapper.lambda().ne(DataInterfaceVariateEntity::getId, entity.getId()); + } + queryWrapper.lambda().eq(DataInterfaceVariateEntity::getFullName, entity.getFullName()); + return this.count(queryWrapper) > 0; + } + + @Override + public boolean create(DataInterfaceVariateEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(UserProvider.getLoginUserId()); + entity.setCreatorTime(DateUtil.getNowDate()); + return this.save(entity); + } + + @Override + public boolean update(DataInterfaceVariateEntity entity) { + return this.updateById(entity); + } + + @Override + public boolean delete(DataInterfaceVariateEntity entity) { + return this.removeById(entity); + } + + @Override + public List getListByIds(List ids) { + if (ids.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(DataInterfaceVariateEntity::getId, ids); + return this.list(queryWrapper); + } + + @Override + public boolean update(Map map, List variateEntities) { + if (map == null || map.size() == 0) { + return true; + } + variateEntities.forEach(t -> { + t.setValue(map.get(t.getInterfaceId())); + }); + return this.updateBatchById(variateEntities); + } + + @Override + public DataInterfaceVariateEntity getInfoByFullName(String fullName) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DataInterfaceVariateEntity::getFullName, fullName); + return this.getOne(queryWrapper); + } +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/DataMapServiceImpl.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/DataMapServiceImpl.java new file mode 100644 index 0000000..8e80388 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/DataMapServiceImpl.java @@ -0,0 +1,118 @@ +package jnpf.base.service.impl; + + +import jnpf.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import jnpf.base.Pagination; +import jnpf.base.entity.VisualDataMapEntity; +import jnpf.base.mapper.DataMapMapper; +import jnpf.base.service.DataMapService; +import jnpf.util.DateUtil; +import jnpf.util.RandomUtil; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 大屏地图 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +@Service +public class DataMapServiceImpl extends SuperServiceImpl implements DataMapService { + + @Autowired + private UserProvider userProvider; + + @Override + public List getList(Pagination pagination) { + // 定义变量判断是否需要使用修改时间倒序 + boolean flag = false; + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(pagination.getKeyword())) { + flag = true; + queryWrapper.lambda().and( + t -> t.like(VisualDataMapEntity::getFullName, pagination.getKeyword()) + .or().like(VisualDataMapEntity::getEnCode, pagination.getKeyword()) + ); + } + //排序 + queryWrapper.lambda().orderByAsc(VisualDataMapEntity::getSortCode) + .orderByDesc(VisualDataMapEntity::getCreatorTime); + if (flag) { + queryWrapper.lambda().orderByDesc(VisualDataMapEntity::getLastModifyTime); + } + Page page = new Page(pagination.getCurrentPage(), pagination.getPageSize()); + IPage iPages = this.page(page, queryWrapper); + return pagination.setData(iPages.getRecords(), page.getTotal()); + } + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().orderByDesc(VisualDataMapEntity::getSortCode) + .orderByDesc(VisualDataMapEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public VisualDataMapEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(VisualDataMapEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(VisualDataMapEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setCreatorTime(DateUtil.getNowDate()); + entity.setCreatorUser(userProvider.get().getUserId()); + entity.setEnabledMark(1); + this.save(entity); + } + + @Override + public boolean update(String id, VisualDataMapEntity entity) { + entity.setId(id); + entity.setLastModifyTime(DateUtil.getNowDate()); + entity.setLastModifyUser(userProvider.get().getUserId()); + return this.updateById(entity); + } + + @Override + public void delete(VisualDataMapEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } + + @Override + public boolean isExistByFullName(String fullName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(VisualDataMapEntity::getFullName, fullName); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(VisualDataMapEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public boolean isExistByEnCode(String enCode, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(VisualDataMapEntity::getEnCode, enCode); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(VisualDataMapEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/DbLinkServiceImpl.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/DbLinkServiceImpl.java new file mode 100644 index 0000000..52ed813 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/DbLinkServiceImpl.java @@ -0,0 +1,237 @@ +package jnpf.base.service.impl; + + +import jnpf.base.service.SuperServiceImpl; +import com.baomidou.dynamic.datasource.DynamicRoutingDataSource; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import jnpf.base.model.dblink.PaginationDbLink; +import jnpf.base.service.DbTableService; +import jnpf.config.ConfigValueUtil; +import jnpf.constant.MsgCode; +import jnpf.database.model.dto.PrepSqlDTO; +import jnpf.database.model.entity.DbLinkEntity; +import jnpf.base.mapper.DbLinkMapper; +import jnpf.base.service.DbLinkService; +import jnpf.database.source.DbBase; +import jnpf.database.util.*; +import jnpf.exception.DataException; +import jnpf.util.RandomUtil; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import jnpf.util.data.DataSourceContextHolder; +import lombok.Cleanup; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; + +import javax.sql.DataSource; +import java.sql.Connection; +import java.util.Date; +import java.util.List; + +/** + * 数据连接 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Service +public class DbLinkServiceImpl extends SuperServiceImpl implements DbLinkService, InitializingBean { + + @Autowired + private DbLinkService dblinkService; + @Autowired + private DataSourceUtil dataSourceUtils; + @Autowired + private UserProvider userProvider; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private DbTableService dbTableService; + @Autowired + private DataSource dataSource; + @Autowired + private DynamicRoutingDataSource dynamicRoutingDataSource; + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().orderByAsc(DbLinkEntity::getSortCode) + .orderByDesc(DbLinkEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getList(PaginationDbLink pagination) { + // 定义变量判断是否需要使用修改时间倒序 + boolean flag = false; + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(pagination.getKeyword())) { + flag = true; + queryWrapper.lambda().and( + t -> t.like(DbLinkEntity::getFullName, pagination.getKeyword()) + ); + } + if (StringUtil.isNotEmpty(pagination.getDbType())) { + flag = true; + queryWrapper.lambda().eq(DbLinkEntity::getDbType, pagination.getDbType()); + } + queryWrapper.lambda().orderByAsc(DbLinkEntity::getSortCode) + .orderByDesc(DbLinkEntity::getCreatorTime); + if (flag) { + queryWrapper.lambda().orderByDesc(DbLinkEntity::getLastModifyTime); + } + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage iPage = this.page(page, queryWrapper); + return pagination.setData(iPage.getRecords(), page.getTotal()); + } + + @Override + public DbLinkEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DbLinkEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public boolean isExistByFullName(String fullName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DbLinkEntity::getFullName, fullName); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(DbLinkEntity::getId, id); + } + return this.count(queryWrapper) > 0; + } + + @Override + public void create(DbLinkEntity entity) { + entity.setId(RandomUtil.uuId()); + this.save(entity); + } + + @Override + public boolean update(String id, DbLinkEntity entity) { + entity.setId(id); + return this.updateById(entity); + } + + @Override + public void delete(DbLinkEntity entity) { + this.removeById(entity.getId()); + } + + @Override + @DSTransactional + public boolean first(String id) { + boolean isOk = false; + //获取要上移的那条数据的信息 + DbLinkEntity upEntity = this.getById(id); + Long upSortCode = upEntity.getSortCode() == null ? 0 : upEntity.getSortCode(); + //查询上几条记录 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .lt(DbLinkEntity::getSortCode, upSortCode) + .orderByDesc(DbLinkEntity::getSortCode); + List downEntity = this.list(queryWrapper); + if (downEntity.size() > 0) { + //交换两条记录的sort值 + Long temp = upEntity.getSortCode(); + upEntity.setSortCode(downEntity.get(0).getSortCode()); + downEntity.get(0).setSortCode(temp); + this.updateById(downEntity.get(0)); + this.updateById(upEntity); + isOk = true; + } + return isOk; + } + + @Override + @DSTransactional + public boolean next(String id) { + boolean isOk = false; + //获取要下移的那条数据的信息 + DbLinkEntity downEntity = this.getById(id); + Long upSortCode = downEntity.getSortCode() == null ? 0 : downEntity.getSortCode(); + //查询下几条记录 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .gt(DbLinkEntity::getSortCode, upSortCode) + .orderByAsc(DbLinkEntity::getSortCode); + List upEntity = this.list(queryWrapper); + if (upEntity.size() > 0) { + //交换两条记录的sort值 + Long temp = downEntity.getSortCode(); + downEntity.setSortCode(upEntity.get(0).getSortCode()); + downEntity.setLastModifyTime(new Date()); + upEntity.get(0).setSortCode(temp); + this.updateById(upEntity.get(0)); + this.updateById(downEntity); + isOk = true; + } + return isOk; + } + + @Override + public boolean testDbConnection(DbLinkEntity entity) throws Exception{ + //判断字典数据类型编码是否错误,大小写不敏感 + DbBase db = DbTypeUtil.getDb(entity); + if(db == null){ + throw new DataException(MsgCode.DB001.get()); + } + @Cleanup Connection conn = ConnUtil.getConn(entity.getUserName(), entity.getPassword(), ConnUtil.getUrl(entity)); + return conn != null; + } + + /** + * 设置数据源 + * @param dbLinkId 数据连接id + * @throws DataException ignore + */ + @Override + public DbLinkEntity getResource(String dbLinkId) throws Exception { + DbLinkEntity dbLinkEntity = new DbLinkEntity(); + //多租户是否开启 + if("0".equals(dbLinkId)){ + if(TenantDataSourceUtil.isTenantAssignDataSource()){ + // 默认数据库, 租户管理指定租户数据源 + dbLinkEntity = TenantDataSourceUtil.getTenantAssignDataSource(DataSourceContextHolder.getDatasourceId()).toDbLinkEntity(); + dbLinkEntity.setId("0"); + }else { + // 默认数据库查询,从配置获取数据源信息 + BeanUtils.copyProperties(dataSourceUtils, dbLinkEntity); + dbLinkEntity.setId("0"); + // 是系统默认的多租户 + TenantDataSourceUtil.initDataSourceTenantDbName(dbLinkEntity); + } + }else { + try { + DynamicDataSourceUtil.switchToDataSource(null); + dbLinkEntity = dblinkService.getInfo(dbLinkId); + }finally { + DynamicDataSourceUtil.clearSwitchDataSource(); + } + } + // 添加并且切换数据源 + return dbLinkEntity; + } + + @Override + public void afterPropertiesSet(){ + PrepSqlDTO.DB_LINK_FUN = (dbLinkId)-> { + try { + return (DbLinkEntity) getResource(dbLinkId); + } catch (Exception e) { + e.printStackTrace(); + } + return null; + }; + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/DbSyncServiceImpl.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/DbSyncServiceImpl.java new file mode 100644 index 0000000..6171a60 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/DbSyncServiceImpl.java @@ -0,0 +1,334 @@ +package jnpf.base.service.impl; + + +import cn.hutool.core.collection.CollectionUtil; +import com.alibaba.druid.proxy.jdbc.NClobProxyImpl; +import jnpf.base.service.DbLinkService; +import jnpf.base.service.DbSyncService; +import jnpf.base.service.DbTableService; +import jnpf.database.datatype.model.DtModelDTO; +import jnpf.database.datatype.sync.util.DtSyncUtil; +import jnpf.database.model.dbfield.DbFieldModel; +import jnpf.database.model.dbfield.JdbcColumnModel; +import jnpf.database.model.dbtable.DbTableFieldModel; +import jnpf.database.model.dbtable.JdbcTableModel; +import jnpf.database.model.dto.PrepSqlDTO; +import jnpf.database.model.entity.DbLinkEntity; +import jnpf.database.source.DbBase; +import jnpf.database.sql.enums.base.SqlComEnum; +import jnpf.database.sql.model.SqlPrintHandler; +import jnpf.database.sql.param.FormatSqlDM; +import jnpf.database.sql.param.FormatSqlKingbaseES; +import jnpf.database.sql.param.FormatSqlMySQL; +import jnpf.database.sql.param.FormatSqlOracle; +import jnpf.database.sql.util.SqlFastUtil; +import jnpf.database.util.DataSourceUtil; +import jnpf.database.util.DbTypeUtil; +import jnpf.database.util.JdbcUtil; +import jnpf.exception.DataException; +import jnpf.exception.DataTypeException; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * 数据同步 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Slf4j +@Service +public class DbSyncServiceImpl implements DbSyncService { + + @Autowired + private DbLinkService dblinkService; + @Autowired + private DbTableService dbTableService; + @Autowired + private SqlPrintHandler sqlPrintHandler; + @Autowired + private DataSourceUtil dataSourceUtil; + + + private static Properties props; + + static { + Properties props = new Properties(); + props.setProperty("remarks", "true"); //设置可以获取remarks信息 + props.setProperty("useInformationSchema", "true");//设置可以获取tables remarks信息 + DbSyncServiceImpl.props = props; + } + + @Override + public Integer executeCheck(String fromId, String toId, Map convertRuleMap, String table) throws Exception { + DbLinkEntity dbLinkFrom; + DbLinkEntity dbLinkTo; + if("0".equals(fromId)){ + dbLinkFrom = dataSourceUtil.init(); + }else { + dbLinkFrom = DbLinkEntity.newInstance(fromId); + } + if("0".equals(toId)){ + dbLinkTo = dataSourceUtil.init(); + }else { + dbLinkTo = DbLinkEntity.newInstance(toId); + } + //验证一(同库无法同步数据) + if (fromId.equals(toId) || + (Objects.equals(dbLinkFrom.getHost(), dbLinkTo.getHost()) && + (Objects.equals(dbLinkFrom.getPort(), dbLinkTo.getPort()) && + (Objects.equals(dbLinkFrom.getDbName(), dbLinkTo.getDbName()) + )))){ + if(DbBase.ORACLE.equals(dbLinkFrom.getDbType()) || DbBase.DM.equals(dbLinkFrom.getDbType())){ + if(dbLinkFrom.getUserName().equals(dbLinkTo.getUserName())){ + return -1; + } + }else { + return -1; + } + } + //验证二(表存在) + if (dbTableService.isExistTable(toId, table)) { + //验证三(验证表数据) + if (SqlFastUtil.tableDataExist(toId, table)) { + //被同步表存在数据 + return 3; + } + } + // 表不存在 + if (!dbTableService.isExistTable(toId, table)) { + return 2; + } + return 0; + } + + @Override + public void execute(String dbLinkIdFrom, String dbLinkIdTo, Map convertRuleMap, String table) throws Exception { + executeTableCommon(dbLinkIdFrom, dbLinkIdTo, convertRuleMap, table); + } + + @Override + public Map executeBatch(String dbLinkIdFrom, String dbLinkIdTo, Map convertRuleMap, List tableList) { + Map messageMap = new HashMap<>(16); + for (int i = 0; i < tableList.size(); i++) { + String table = tableList.get(i); + int total = tableList.size(); + try{ + executeTableCommon(dbLinkIdFrom, dbLinkIdTo, convertRuleMap, table); + messageMap.put(table, 1); + log.info("表:(" + table + ")同步成功!" + "(" + (i + 1) + "/" + total + ")"); + }catch (Exception e){ + e.printStackTrace(); + messageMap.put(table, 0); + log.info("表:(" + table + ")同步失败!" + "(" + (i + 1) + "/" + total + ")"); + } + } + return messageMap; + } + + /** + * 【主要】同步建表操作 + */ + public void executeTableCommon(String fromLinkId, String toLinkId, Map convertRuleMap, String table) throws Exception { + sqlPrintHandler.tableInfo(table); + DbLinkEntity dbLinkFrom = dblinkService.getResource(fromLinkId); + DbLinkEntity dbLinkTo = dblinkService.getResource(toLinkId); + // 1、删除To表 + try{ + // 2、创建To表 + DbTableFieldModel tableMod = convertFileDataType(dbTableService.getDbTableModel(fromLinkId, table), convertRuleMap, dbLinkFrom.getDbType(), dbLinkTo.getDbType()); + if(!sqlPrintHandler.getPrintFlag()) SqlFastUtil.dropTable(dbLinkTo, table); + SqlFastUtil.creTable(dbLinkTo, tableMod); + // 3、同步数据 From -> To + SqlFastUtil.batchInsert(table, dbLinkTo, getInsertMapList(dbLinkFrom, dbLinkTo.getDbType(), table)); + }catch (Exception ignore){ + ignore.printStackTrace(); + } + } + + /** + * 打印初始脚本 + * + * @param dbLinkIdFrom 数据连接ID + * @param printType dbInit:初始脚本、dbStruct:表结构、dbData:数据、tenant:多租户 + */ + public Map printDbInit(String dbLinkIdFrom, String dbTypeTo, List tableList, Map convertRuleMap, String printType) throws Exception { + DbLinkEntity dbLinkEntity = DbLinkEntity.newInstance(dbLinkIdFrom); + if(CollectionUtil.isEmpty(tableList)){ + tableList = SqlFastUtil.getTableList(dbLinkEntity).stream().map(DbTableFieldModel::getTable).collect(Collectors.toList()); + } + List tableNameList = new ArrayList<>(); + Map messageMap = new HashMap<>(16); + for (int i = 0; i < tableList.size(); i++) { + String table = tableList.get(i); + sqlPrintHandler.tableInfo(table); + tableNameList.add(table); + DbTableFieldModel dbTableFieldModel; + if(true){ + // 方式一:通过JDBC查询表字段信息 + dbTableFieldModel = convertFileDataType(new JdbcTableModel(dbLinkEntity, table).convertDbTableFieldModel(), convertRuleMap, dbLinkEntity.getDbType(), dbTypeTo); + }else { + // 方式二:通过SQL语句获取的表字段信息 + dbTableFieldModel = convertFileDataType(dbTableService.getDbTableModel(dbLinkIdFrom, table), convertRuleMap, dbLinkEntity.getDbType(), dbTypeTo); + } + List> tableData = getInsertMapList(dbLinkEntity, dbTypeTo, table); + DbLinkEntity dbLink = new DbLinkEntity(dbTypeTo); + try{ + switch (printType){ + case "dbInit": +// SqlFastUtil.dropTable(dbLink, table); + SqlFastUtil.creTable(dbLink, dbTableFieldModel); + SqlFastUtil.batchInsert(table, dbLink, tableData); + break; + case "tenantCre": + if(DbBase.POSTGRE_SQL.equals(dbTypeTo) || DbBase.ORACLE.equals(dbTypeTo)){ + dbTableFieldModel.setTable("${dbName}." + dbTableFieldModel.getTable()); + } + case "dbStruct": +// SqlFastUtil.dropTable(dbLink, table); + SqlFastUtil.creTable(dbLink, dbTableFieldModel); + break; + case "dbData": + SqlFastUtil.batchInsert(table, dbLink, tableData); + break; + } + messageMap.put(table, 1); + log.info("表:(" + table + ")同步成功!" + "(" + (i + 1) + "/" + tableList.size() + ")"); + }catch (Exception e){ + e.printStackTrace(); + messageMap.put(table, 0); + log.info("表:(" + table + ")同步失败!" + "(" + (i + 1) + "/" + tableList.size() + ")"); + } + } + if(printType.equals("tenantCreNoTab") || printType.equals("tenantCre")){ + sqlPrintHandler.append("\n\n").append(creTenant(tableNameList, dbTypeTo)); + } + return messageMap; + } + + /** + * 多租户创库 + */ + public static String creTenant(List tableNameList, String dbEncode){ + StringBuilder insertTenant = new StringBuilder(); + for (String table : tableNameList) { + String intoTable = table; + String fromTable = "${dbName}." + table; + switch (dbEncode){ + case DbBase.SQL_SERVER: + fromTable = "${dbName}.dbo." + table; + break; + case DbBase.POSTGRE_SQL: + intoTable = "${dbName}." + table; + fromTable = "\"public\"." + table; + break; + case DbBase.ORACLE: + intoTable = "{schema}." + table; + fromTable = "{initSchema}." + table; + break; + case DbBase.DM: + case DbBase.KINGBASE_ES: + case DbBase.MYSQL: + } + insertTenant.append("INSERT INTO ").append(intoTable).append(" SELECT * FROM ").append(fromTable).append(";").append("\n"); + } + return insertTenant.toString(); + } + + /** + * 获取插入数据map + */ + public List> getInsertMapList(DbLinkEntity dbLinkFrom, String toDbType, String table) throws Exception { + List> modelList = JdbcUtil.queryJdbcColumns(new PrepSqlDTO(SqlComEnum.SELECT_TABLE.getOutSql(table)).withConn(dbLinkFrom)).get(); + List> insertMapList = new ArrayList<>(); + for (List jdbcColumnModels : modelList) { + Map map = new HashMap<>(); + for (JdbcColumnModel jdbcColumnModel : jdbcColumnModels) { + map.put(jdbcColumnModel.getField(), checkValue(jdbcColumnModel, dbLinkFrom.getDbType())); + FormatSqlOracle.nullValue(toDbType, jdbcColumnModel, map); // Oracle空串处理 + FormatSqlKingbaseES.nullValue(toDbType, jdbcColumnModel, map); // KingbaseES空串处理 + } + insertMapList.add(map); + } + return insertMapList; + } + + // 不同数据库之间,特殊数据类型与值校验 + private Object checkValue(JdbcColumnModel model, String dbType) throws Exception { + Function checkVal = (dataType) -> + model.getDataType().equalsIgnoreCase(dataType) && model.getValue() != null; + switch (dbType){ + case DbBase.MYSQL: + /* MySQL设置tinyint类型且长度为1时,JDBC读取时会变成BIT类型,java类型为Boolean类型。 + 1:true , 0:false */ + if(checkVal.apply("BIT")) return String.valueOf(model.getValue()); + case DbBase.ORACLE: + if(checkVal.apply("NCLOB")) return String.valueOf(model.getValue()); + return FormatSqlOracle.timestamp(model.getValue()); + case DbBase.SQL_SERVER: + case DbBase.KINGBASE_ES: + case DbBase.DM: + if(checkVal.apply("CLOB")){ + if(model.getValue() instanceof NClobProxyImpl) FormatSqlDM.getClob((NClobProxyImpl)(model.getValue())); + } + case DbBase.POSTGRE_SQL: + // TODO 等待补充 + default: + return model.getValue(); + } + } + + /** + * 【处理字段类型】 + */ + private DbTableFieldModel convertFileDataType(DbTableFieldModel dbTableFieldModel, Map convertRuleMap, + String fromDbEncode, String toDbEncode) throws Exception { + String table = dbTableFieldModel.getTable(); + List fields = dbTableFieldModel.getDbFieldModelList(); + // 规则Map里的(默认)去除 + if(convertRuleMap != null){ + convertRuleMap.forEach((key, val) ->{ + convertRuleMap.put(key, val.replace(" (默认)", "")); + }); + } + for (DbFieldModel field : fields) { + try { + // 设置转换数据类型 + field.getDtModelDTO().setConvertTargetDtEnum(DtSyncUtil.getToCovert(fromDbEncode, toDbEncode, field.getDataType(), convertRuleMap)); + if(toDbEncode.equals(DbBase.MYSQL)){ + FormatSqlMySQL.checkMysqlFieldPrimary(field, table); + } + }catch (DataException d){ + System.out.println("表_" + table + ":" + d.getMessage()); + DataException dataException = new DataException("目前还未支持数据类型" + toDbEncode + "." + table + "(" + field.getDataType() + ")"); + dataException.printStackTrace(); + // 类型寻找失败转换成字符串 + field.setDataType(DtModelDTO.getStringFixedDt(toDbEncode)); + throw dataException; + }catch (Exception e) { + e.printStackTrace(); + if(e instanceof DataTypeException){ + throw e; + } + log.info(e.getMessage()); + } + } + return dbTableFieldModel; + } + + + + + + + + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/DbTableServiceImpl.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/DbTableServiceImpl.java new file mode 100644 index 0000000..e1a439d --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/DbTableServiceImpl.java @@ -0,0 +1,340 @@ +package jnpf.base.service.impl; + +import com.google.common.collect.ImmutableMap; +import jnpf.base.Page; +import jnpf.base.Pagination; +import jnpf.base.service.DbLinkService; +import jnpf.base.service.DbTableService; +import jnpf.base.util.dbutil.TableUtil; +import jnpf.constant.MsgCode; +import jnpf.database.datatype.db.DtDMEnum; +import jnpf.database.datatype.db.interfaces.DtInterface; +import jnpf.database.datatype.viewshow.ViewDataTypeEnum; +import jnpf.database.datatype.viewshow.constant.DtViewConst; +import jnpf.database.enums.DbAliasEnum; +import jnpf.database.model.dbfield.DbFieldModel; +import jnpf.database.model.dbtable.DbTableFieldModel; +import jnpf.database.model.dto.PrepSqlDTO; +import jnpf.database.model.entity.DbLinkEntity; +import jnpf.database.model.page.DbTableDataForm; +import jnpf.database.model.page.JdbcPageMod; +import jnpf.database.source.DbBase; +import jnpf.database.source.impl.DbPostgre; +import jnpf.database.sql.enums.base.SqlComEnum; +import jnpf.database.sql.util.SqlFastUtil; +import jnpf.database.sql.util.SqlFrameUtil; +import jnpf.database.util.DbTypeUtil; +import jnpf.database.util.JdbcUtil; +import jnpf.database.util.NotTenantPluginHolder; +import jnpf.exception.DataException; +import jnpf.util.StringUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.stream.Collectors; + +/** + * 数据管理 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Slf4j +@Service +public class DbTableServiceImpl implements DbTableService { + + @Autowired + private DbLinkService dblinkService; + @Autowired + private DbTableService dbTableService; + + @Override + public List getList(String dbLinkId, String methodName) throws Exception { + DbLinkEntity dbLinkEntity = dblinkService.getResource(dbLinkId); + return SqlFastUtil.getTableList(dbLinkEntity, methodName); + } + + @Override + public List getListPage(String dbLinkId, Page page) throws Exception { + List list = getList(dbLinkId, DbAliasEnum.TABLE_TYPE.getAlias()); + if(StringUtil.isNotEmpty(page.getKeyword())){ + // 过滤不符条件的元素 + String keyWord = SqlFrameUtil.keyWordTrim(page.getKeyword()).toLowerCase(); + list = list.stream().filter(t-> + (StringUtil.isNotEmpty(t.getComment()) && t.getComment().toLowerCase().contains(keyWord)) + || t.getTable().toLowerCase().contains(keyWord) + ).collect(Collectors.toList()); + } + return list; + } + + @Override + public List getListPage(String dbLinkId, Pagination pagination) throws Exception { + List list = getList(dbLinkId, null); + if(StringUtil.isNotEmpty(pagination.getKeyword())){ + // 过滤不符条件的元素 + String keyWord = SqlFrameUtil.keyWordTrim(pagination.getKeyword()).toLowerCase(); + list = list.stream().filter(t-> + (StringUtil.isNotEmpty(t.getComment()) && t.getComment().toLowerCase().contains(keyWord)) + || t.getTable().toLowerCase().contains(keyWord) + ).collect(Collectors.toList()); + } + long beginIndex = (pagination.getCurrentPage() -1) * pagination.getPageSize(); + long endIndex = beginIndex + pagination.getPageSize(); + List listVO = new ArrayList<>(); + for (int i = 0; i < list.size(); i++) { + if(beginIndex <= i && i < endIndex){ + listVO.add(list.get(i)); + } + } + pagination.setTotal(list.size()); + return listVO; + } + + @Override + public DbTableFieldModel getTable(String dbLinkId, String table) throws Exception { + DbLinkEntity dbLinkEntity = dblinkService.getResource(dbLinkId); + DbTableFieldModel dbTableFieldModel = SqlFastUtil.getTable(dbLinkEntity, table); + dbTableFieldModel.setHasTableData(getSum(dbLinkId, table) > 0); + return dbTableFieldModel; + } + + @Override + public List getFieldList(String dbLinkId, String table) throws Exception { + DbLinkEntity dbLinkEntity = dblinkService.getResource(dbLinkId); + return SqlFastUtil.getFieldList(dbLinkEntity, table); + } + + @Override + public boolean isExistTable(String dbLinkId, String table) throws Exception { + DbLinkEntity dbLinkEntity = dblinkService.getResource(dbLinkId); + return SqlFastUtil.isExistTable(dbLinkEntity, table); + } + + @Override + public boolean dropExistsTable(String dbLinkId, String table) throws Exception { + DbLinkEntity dbLinkEntity = dblinkService.getResource(dbLinkId); + if(isExistTable(dbLinkId, table)){ + return SqlFastUtil.dropTable(dbLinkEntity, table); + } + return true; + } + + @Override + public List> getData(DbTableDataForm dbTableDataForm, String dbLinkId, String table) throws Exception { + DbLinkEntity dbLinkEntity = dblinkService.getResource(dbLinkId); + JdbcPageMod result = new JdbcPageMod(); + String orderKey = dbTableDataForm.getField(); + // 防止SQL注入 + String finalOrderKey = orderKey; + if(getFieldList(dbLinkId, table).stream().noneMatch(field -> field.getField().equals(finalOrderKey))){ + throw new DataException("排序字段不存在"); + } + if (dbLinkEntity != null) { + List dataList = new ArrayList<>(); + if(DbTypeUtil.checkPostgre(dbLinkEntity)){ + table = DbPostgre.getTable(table); + orderKey = DbPostgre.getTable(orderKey); + String schema = dbLinkEntity.getDbSchema(); + if(StringUtil.isNotEmpty(schema)){ + table = schema + "." + table; + } + } + StringBuilder sql = new StringBuilder(SqlComEnum.SELECT_TABLE.getOutSql(table)); + //模糊查询 + if (!StringUtil.isEmpty(dbTableDataForm.getKeyword()) && !StringUtil.isEmpty(orderKey)) { + sql.append(" where " + orderKey + " like ?"); + dataList.add("%" + SqlFrameUtil.keyWordTrim(dbTableDataForm.getKeyword()) + "%"); + } + result = JdbcUtil.queryPage( + new PrepSqlDTO(sql.toString(), dataList).withConn(dbLinkEntity), + checkOrderKey(orderKey, dbLinkId, table, dbLinkEntity.getDbType()), + (int) dbTableDataForm.getCurrentPage(), + (int) dbTableDataForm.getPageSize()) + .setIsLowerCase(true).setIsAlias(true).get(); + } + dbTableDataForm.setTotal(result.getTotalRecord()); + return (List>)result.getDataList(); + } + + private String checkOrderKey(String orderKey, String dbLinkId, String table, String dbEncode){ + try { + if(DbBase.DM.equals(dbEncode)){ + List fieldList = getFieldList(dbLinkId, table); + Optional first = fieldList.stream().filter(field -> field.getField().equals(orderKey)).findFirst(); + if(first.isPresent()){ + String dataType = first.get().getDataType(); + if(dataType.equals(DtDMEnum.CLOB.getDataType()) || dataType.equals(DtDMEnum.TEXT.getDataType())){ +// throw new Exception("无法使用CLOB、TEXT作为字段排序条件"); + Optional first1 = fieldList.stream().filter(field -> field.getField().toLowerCase().contains("id")).findFirst(); + if(first1.isPresent()){ + return first1.get().getField(); + } + + } + } + } + } catch (Exception e) { + e.printStackTrace(); + } + return orderKey; + } + + @Override + public int getSum(String dbLinkId,String table)throws Exception { + DbLinkEntity dbLinkEntity = dblinkService.getResource(dbLinkId); + return SqlFastUtil.getSum(dbLinkEntity, table); + } + + /**=====================增删改========================**/ + + @Override + public void delete(String dbLinkId, String table) throws Exception { + // 校验 + checkTab(table, dbLinkId, 1); + SqlFastUtil.dropTable(dblinkService.getResource(dbLinkId), table); + } + + @Override + public void deleteAllTable(String dbLinkId, String dbType) throws Exception { + DbLinkEntity dbLinkEntity = dblinkService.getResource(dbLinkId); + if(!dbLinkEntity.getDbType().equals(dbType)) throw new Exception("数据库类型不符"); + for (DbTableFieldModel dbTableFieldModel : SqlFastUtil.getTableList(dbLinkEntity)) { + SqlFastUtil.dropTable(dbLinkEntity, dbTableFieldModel.getTable()); + } + } + + @Override + public int createTable(DbTableFieldModel dbTableFieldModel) throws Exception { + DbLinkEntity dbLinkEntity = dblinkService.getResource(dbTableFieldModel.getDbLinkId()); + // 数据库编码查询校验 (打印模板校验) + String opeDb = dbLinkEntity.getDbType(); + String creDb = dbTableFieldModel.getDbEncode(); + if(StringUtil.isNotEmpty(creDb) && !creDb.equals(opeDb)){ + throw new DataException(MsgCode.DB008.get() + ":" + creDb + " -> " + opeDb); + } + // 表重名判断 + if (isExistTable(dbTableFieldModel.getDbLinkId(), dbTableFieldModel.getTable())) { + return 0; + } + // 表主键检验 + checkPrimary(dbTableFieldModel.getDbFieldModelList(), dbLinkEntity.getDbType()); + // 创建表 + SqlFastUtil.creTable(dbLinkEntity, dbTableFieldModel); + return 1; + } + + @Override + public void update(DbTableFieldModel dbTableFieldModel) throws Exception { + // 校验 + checkTab(dbTableFieldModel.getUpdateOldTable(), dbTableFieldModel.getDbLinkId(), 2); + DbLinkEntity dbLinkEntity = dblinkService.getResource(dbTableFieldModel.getDbLinkId()); + //临时表名 + String oldTable = dbTableFieldModel.getUpdateOldTable(); + String newTable = dbTableFieldModel.getUpdateNewTable(); + String tempTabName = "Temp_" + TableUtil.getStringRandom(5); + // 第一步:创建新表 (成功则删除旧表,失败则回滚) + checkPrimary(dbTableFieldModel.getDbFieldModelList(), dbLinkEntity.getDbType()); + SqlFastUtil.creTable(dbLinkEntity, + new DbTableFieldModel( + tempTabName, + dbTableFieldModel.getComment(), + dbTableFieldModel.getDbFieldModelList() + )); + // 第二步:删除旧表 + SqlFastUtil.dropTable(dbLinkEntity, oldTable); + // 第三步:新表改名 + SqlFastUtil.reTableName(dbLinkEntity, tempTabName, newTable); + } + + @Override + public void addField(DbTableFieldModel dbTableFieldModel) throws Exception { + DbLinkEntity dbLinkEntity = dblinkService.getResource(dbTableFieldModel.getDbLinkId()); + SqlFastUtil.addField(dbLinkEntity, dbTableFieldModel.getUpdateNewTable(), dbTableFieldModel.getDbFieldModelList()); + } + + @Override + public DbTableFieldModel getDbTableModel(String dbLinkId, String tableName)throws Exception { + NotTenantPluginHolder.setNotSwitchFlag(); + DbTableFieldModel dbTableModel = getList(dbLinkId, null).stream().filter(m -> m.getTable().equals(tableName)).findFirst().orElse(null); + if(dbTableModel != null){ + dbTableModel.setDbFieldModelList(getFieldList(dbLinkId, tableName)); + return dbTableModel; + }else { + throw new DataException("未找到此表:" + tableName); + } + } + + /* ================复用代码================== */ + + /** + * 校验表可操作 + * + * @param table 表 + * @param dbLinkId 数据连接ID + * @param type 1:删除 2:编辑 + * @throws Exception 错误信息 + */ + private void checkTab(String table, String dbLinkId, Integer type) throws Exception { + if (TableUtil.checkByoTable(table)) throw new DataException(type == 1 ? MsgCode.DB101.get() : MsgCode.DB102.get()); + if (getSum(dbLinkId, table) > 0) throw new DataException(type == 1 ? MsgCode.DB201.get() : MsgCode.DB202.get()); + } + + /** + * 检查主键 + * @param tableFieldList 表字段集合 + * @throws DataException ignore + */ + private void checkPrimary(List tableFieldList, String dbEncode) throws Exception { + // 默认主键为字符串类型 + // 主键会自动添加"非空"限制,所以不用做判断。(为空不加语句,且数据库默认字段可为空) + int autoIncrementNum = 0; + for(DbFieldModel field : tableFieldList) { + if(field.getIsAutoIncrement() != null && field.getIsAutoIncrement()){ + field.setNullSign("NOT NULL"); + // 一张表最多只有一个自增主键,且此字段必须为primary key或者unique key。 + autoIncrementNum += 1; + if(autoIncrementNum > 1){ + throw new DataException("一张表最多只运行有一个自增主键"); + } + if(!(field.getDataType().equals(DtViewConst.INT) || field.getDataType().equals(DtViewConst.BIGINT))){ + throw new DataException("自增字段类型必须为数字类型"); + } + if(!field.getIsPrimaryKey()){ + throw new DataException("自增字段类型必须为主键"); + } + }else { + if (field.getIsPrimaryKey()) { + field.setNullSign("NOT NULL"); + Method method = ViewDataTypeEnum.class.getMethod("getDt" + dbEncode + "Enum"); + Map allowDtMap = ImmutableMap.of( + ViewDataTypeEnum.VARCHAR, DtViewConst.VARCHAR, + ViewDataTypeEnum.INT, DtViewConst.INT, + ViewDataTypeEnum.BIGINT, DtViewConst.BIGINT + ); + boolean primaryFlag = false; + for (Map.Entry mapEntity : allowDtMap.entrySet()) { + DtInterface primaryVarcharEnum = (DtInterface)(method.invoke(mapEntity.getKey())); + boolean enumFlag = field.getDataType().equalsIgnoreCase(primaryVarcharEnum.getDataType()); + boolean viewFlag = field.getDataType().equalsIgnoreCase(mapEntity.getValue()); + if(enumFlag || viewFlag){ + primaryFlag = true; + } + } + if(!primaryFlag){ + throw new DataException("主键必须为字符串或整型、长整型。"); + } + } + } + } + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/DictionaryDataServiceImpl.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/DictionaryDataServiceImpl.java new file mode 100644 index 0000000..1afa017 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/DictionaryDataServiceImpl.java @@ -0,0 +1,328 @@ +package jnpf.base.service.impl; + +import jnpf.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import jnpf.base.entity.DictionaryDataEntity; +import jnpf.base.entity.DictionaryTypeEntity; +import jnpf.base.mapper.DictionaryDataMapper; +import jnpf.base.model.dictionarydata.DictionaryDataExportModel; +import jnpf.base.model.dictionarytype.DictionaryExportModel; +import jnpf.base.service.DictionaryDataService; +import jnpf.base.service.DictionaryTypeService; +import jnpf.base.vo.DownloadVO; +import jnpf.config.ConfigValueUtil; +import jnpf.exception.DataException; +import jnpf.util.*; +import jnpf.emnus.ModuleTypeEnum; +import jnpf.util.FileExport; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import org.springframework.transaction.interceptor.TransactionAspectSupport; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +/** + * 字典数据 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Service +public class DictionaryDataServiceImpl extends SuperServiceImpl implements DictionaryDataService { + + @Autowired + private UserProvider userProvider; + @Autowired + private DictionaryTypeService dictionaryTypeService; + @Autowired + private FileExport fileExport; + @Autowired + private ConfigValueUtil configValueUtil; + + @Override + public List getList(String dictionaryTypeId, Boolean enable) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DictionaryDataEntity::getDictionaryTypeId, dictionaryTypeId); + if (enable) { + queryWrapper.lambda().eq(DictionaryDataEntity::getEnabledMark, 1); + } + queryWrapper.lambda().orderByAsc(DictionaryDataEntity::getSortCode).orderByDesc(DictionaryDataEntity::getCreatorTime).orderByDesc(DictionaryDataEntity::getLastModifyTime); + return this.list(queryWrapper); + } + + @Override + public List getList(String dictionaryTypeId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DictionaryDataEntity::getDictionaryTypeId, dictionaryTypeId); + queryWrapper.lambda().orderByAsc(DictionaryDataEntity::getSortCode) + .orderByDesc(DictionaryDataEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getDicList(String dictionaryTypeId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().and( + t -> t.eq(DictionaryDataEntity::getDictionaryTypeId, dictionaryTypeId) + .or().eq(DictionaryDataEntity::getEnCode, dictionaryTypeId) + ); + queryWrapper.lambda().select(DictionaryDataEntity::getId, DictionaryDataEntity::getFullName, DictionaryDataEntity::getEnCode); + return this.list(queryWrapper); + } + + @Override + public List geDicList(String dictionaryTypeId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().and( + t -> t.eq(DictionaryDataEntity::getDictionaryTypeId, dictionaryTypeId) + .or().eq(DictionaryDataEntity::getEnCode, dictionaryTypeId) + ); + queryWrapper.lambda().select(DictionaryDataEntity::getId, DictionaryDataEntity::getFullName); + return this.list(queryWrapper); + } + + @Override + public Boolean isExistSubset(String parentId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DictionaryDataEntity::getParentId, parentId); + return this.list(queryWrapper).size() > 0; + } + + @Override + public DictionaryDataEntity getInfo(String id) { + if (id == null) { + return null; + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DictionaryDataEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public DictionaryDataEntity getSwapInfo(String value, String dictionaryTypeId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DictionaryDataEntity::getDictionaryTypeId, dictionaryTypeId).and( + t -> t.eq(DictionaryDataEntity::getId, value) + .or().eq(DictionaryDataEntity::getEnCode, value) + ); + return this.getOne(queryWrapper); + } + + @Override + public boolean isExistByFullName(String dictionaryTypeId, String fullName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DictionaryDataEntity::getFullName, fullName).eq(DictionaryDataEntity::getDictionaryTypeId, dictionaryTypeId); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(DictionaryDataEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public boolean isExistByEnCode(String dictionaryTypeId, String enCode, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DictionaryDataEntity::getEnCode, enCode).eq(DictionaryDataEntity::getDictionaryTypeId, dictionaryTypeId); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(DictionaryDataEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public void delete(DictionaryDataEntity entity) { + this.removeById(entity.getId()); + } + + @Override + public void create(DictionaryDataEntity entity) { + //判断id是否为空,为空则为新建 + if (StringUtil.isEmpty(entity.getId())) { + entity.setId(RandomUtil.uuId()); + entity.setSimpleSpelling(PinYinUtil.getFirstSpell(entity.getFullName()).toUpperCase()); + entity.setCreatorUserId(userProvider.get().getUserId()); + } + this.save(entity); + } + + @Override + public boolean update(String id, DictionaryDataEntity entity) { + entity.setId(id); + entity.setLastModifyTime(DateUtil.getNowDate()); + entity.setLastModifyUserId(userProvider.get().getUserId()); + return this.updateById(entity); + } + + @Override + public boolean first(String id) { + boolean isOk = false; + //获取要上移的那条数据的信息 + DictionaryDataEntity upEntity = this.getById(id); + Long upSortCode = upEntity.getSortCode() == null ? 0 : upEntity.getSortCode(); + //查询上几条记录 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .eq(DictionaryDataEntity::getDictionaryTypeId, upEntity.getDictionaryTypeId()) + .eq(DictionaryDataEntity::getParentId, upEntity.getParentId()) + .lt(DictionaryDataEntity::getSortCode, upSortCode) + .orderByDesc(DictionaryDataEntity::getSortCode); + List downEntity = this.list(queryWrapper); + if (downEntity.size() > 0) { + //交换两条记录的sort值 + Long temp = upEntity.getSortCode(); + upEntity.setSortCode(downEntity.get(0).getSortCode()); + downEntity.get(0).setSortCode(temp); + updateById(downEntity.get(0)); + updateById(upEntity); + isOk = true; + } + return isOk; + } + + @Override + public boolean next(String id) { + boolean isOk = false; + //获取要下移的那条数据的信息 + DictionaryDataEntity downEntity = this.getById(id); + Long upSortCode = downEntity.getSortCode() == null ? 0 : downEntity.getSortCode(); + //查询下几条记录 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .eq(DictionaryDataEntity::getDictionaryTypeId, downEntity.getDictionaryTypeId()) + .eq(DictionaryDataEntity::getParentId, downEntity.getParentId()) + .gt(DictionaryDataEntity::getSortCode, upSortCode) + .orderByAsc(DictionaryDataEntity::getSortCode); + List upEntity = this.list(queryWrapper); + if (upEntity.size() > 0) { + //交换两条记录的sort值 + Long temp = downEntity.getSortCode(); + downEntity.setSortCode(upEntity.get(0).getSortCode()); + upEntity.get(0).setSortCode(temp); + updateById(upEntity.get(0)); + updateById(downEntity); + isOk = true; + } + return isOk; + } + + @Override + public List getDictionName(List id) { + List dictionList = new ArrayList<>(); + if (id != null && id.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().and( + t -> t.in(DictionaryDataEntity::getEnCode, id) + .or().in(DictionaryDataEntity::getId, id) + ); + queryWrapper.lambda().orderByAsc(DictionaryDataEntity::getParentId); + dictionList = this.list(queryWrapper); + } + return dictionList; + } + + @Override + public DownloadVO exportData(String id) { + //获取数据分类字段详情 + DictionaryTypeEntity typeEntity = dictionaryTypeService.getInfo(id); + DictionaryExportModel exportModel = new DictionaryExportModel(); + //递归子分类 + Set set = new HashSet<>(); + List typeEntityList = dictionaryTypeService.getList(); + getDictionaryTypeEntitySet(typeEntity, set, typeEntityList); + List collect = new ArrayList<>(set); + //判断是否有子分类 + if (collect.size() > 0) { + exportModel.setList(collect); + } + //判断是否需要new + if (exportModel.getList() == null) { + List list = new ArrayList<>(); + list.add(typeEntity); + exportModel.setList(list); + } else { + exportModel.getList().add(typeEntity); + } + //获取该类型下的数据 + List modelList = new ArrayList<>(); + for (DictionaryTypeEntity dictionaryTypeEntity : exportModel.getList()) { + List entityList = getList(dictionaryTypeEntity.getId()); + for (DictionaryDataEntity dictionaryDataEntity : entityList) { + DictionaryDataExportModel dataExportModel = JsonUtil.getJsonToBean(dictionaryDataEntity, DictionaryDataExportModel.class); + modelList.add(dataExportModel); + } + } + exportModel.setModelList(modelList); + //导出文件 + DownloadVO downloadVO = fileExport.exportFile(exportModel, configValueUtil.getTemporaryFilePath(), typeEntity.getFullName(), ModuleTypeEnum.SYSTEM_DICTIONARYDATA.getTableName()); + return downloadVO; + } + + /** + * 递归字典分类 + * + * @param dictionaryTypeEntity 数据字典类型实体 + */ + private void getDictionaryTypeEntitySet(DictionaryTypeEntity dictionaryTypeEntity, Set set, List typeEntityList) { + //是否含有子分类 + List collect = typeEntityList.stream().filter(t -> dictionaryTypeEntity.getId().equals(t.getParentId())).collect(Collectors.toList()); + if (collect.size() > 0) { + for (DictionaryTypeEntity typeEntity : collect) { + set.add(typeEntity); + getDictionaryTypeEntitySet(typeEntity, set, typeEntityList); + } + } + } + + @Override + @DSTransactional + public boolean importData(DictionaryExportModel exportModel) throws DataException { + try { + boolean isExists = true; + List list = JsonUtil.getJsonToList(exportModel.getList(), DictionaryTypeEntity.class); + List entityList = JsonUtil.getJsonToList(exportModel.getModelList(), DictionaryDataEntity.class); + //遍历插入分类 + for (DictionaryTypeEntity entity : list) { + if (dictionaryTypeService.getInfo(entity.getId()) == null + && !dictionaryTypeService.isExistByEnCode(entity.getEnCode(), entity.getId()) + && !dictionaryTypeService.isExistByFullName(entity.getFullName(), entity.getId()) + ) { + isExists = false; + dictionaryTypeService.create(entity); + } + } + for (DictionaryDataEntity entity1 : entityList) { + DictionaryDataEntity dataEntity = getInfo(entity1.getId()); + if (dataEntity == null && dictionaryTypeService.getInfo(entity1.getDictionaryTypeId()) != null + && !isExistByFullName(entity1.getDictionaryTypeId(), entity1.getFullName(), entity1.getId()) + && !isExistByEnCode(entity1.getDictionaryTypeId(), entity1.getEnCode(), entity1.getId()) + ) { + isExists = false; + create(entity1); + } + } + return isExists; + } catch (Exception e) { + //手动回滚事务 + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + throw new DataException(e.getMessage()); + } + } + + @Override + public List getListByTypeDataCode(String typeCode) { + DictionaryTypeEntity dictionaryTypeEntity = dictionaryTypeService.getInfoByEnCode(typeCode); + List list = new ArrayList<>(); + if (dictionaryTypeEntity != null) { + list = this.getList(dictionaryTypeEntity.getId()); + } + return list; + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/DictionaryTypeServiceImpl.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/DictionaryTypeServiceImpl.java new file mode 100644 index 0000000..3982109 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/DictionaryTypeServiceImpl.java @@ -0,0 +1,162 @@ +package jnpf.base.service.impl; + + +import jnpf.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import jnpf.base.entity.DictionaryTypeEntity; +import jnpf.base.mapper.DictionaryTypeMapper; +import jnpf.base.service.DictionaryDataService; +import jnpf.base.service.DictionaryTypeService; +import jnpf.util.RandomUtil; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; + +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 字典分类 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Service +public class DictionaryTypeServiceImpl extends SuperServiceImpl implements DictionaryTypeService { + + @Autowired + private UserProvider userProvider; + @Autowired + private DictionaryDataService dictionaryDataService; + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().orderByAsc(DictionaryTypeEntity::getSortCode) + .orderByDesc(DictionaryTypeEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public DictionaryTypeEntity getInfoByEnCode(String enCode) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DictionaryTypeEntity::getEnCode, enCode); + return this.getOne(queryWrapper); + } + + @Override + public DictionaryTypeEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DictionaryTypeEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public boolean isExistByFullName(String fullName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DictionaryTypeEntity::getFullName, fullName); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(DictionaryTypeEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public boolean isExistByEnCode(String enCode, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DictionaryTypeEntity::getEnCode, enCode); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(DictionaryTypeEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public void create(DictionaryTypeEntity entity) { + //判断id是否为空,为空则为新建 + if (StringUtil.isEmpty(entity.getId())){ + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(userProvider.get().getUserId()); + } + this.save(entity); + } + + @Override + public boolean update(String id, DictionaryTypeEntity entity) { + entity.setId(id); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(userProvider.get().getUserId()); + return this.updateById(entity); + } + + @Override + public boolean delete(DictionaryTypeEntity entity) { + List dictionaryTypeEntityList = list().stream().filter(t -> entity.getId().equals(t.getParentId())).collect(Collectors.toList()); + //没有子分类的时候才能删 + if (dictionaryTypeEntityList.size() == 0) { + if (dictionaryDataService.getList(entity.getId()).size() == 0){ + this.removeById(entity.getId()); + return true; + } + } + return false; + } + + @Override + @DSTransactional + public boolean first(String id) { + boolean isOk = false; + //获取要上移的那条数据的信息 + DictionaryTypeEntity upEntity = this.getById(id); + Long upSortCode = upEntity.getSortCode() == null ? 0 : upEntity.getSortCode(); + //查询上几条记录 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .lt(DictionaryTypeEntity::getSortCode, upSortCode) + .eq(DictionaryTypeEntity::getParentId, upEntity.getParentId()) + .orderByDesc(DictionaryTypeEntity::getSortCode); + List downEntity = this.list(queryWrapper); + if (downEntity.size() > 0) { + //交换两条记录的sort值 + Long temp = upEntity.getSortCode(); + upEntity.setSortCode(downEntity.get(0).getSortCode()); + downEntity.get(0).setSortCode(temp); + this.updateById(downEntity.get(0)); + this.updateById(upEntity); + isOk = true; + } + return isOk; + } + + @Override + @DSTransactional + public boolean next(String id) { + boolean isOk = false; + //获取要下移的那条数据的信息 + DictionaryTypeEntity downEntity = this.getById(id); + Long upSortCode = downEntity.getSortCode() == null ? 0 : downEntity.getSortCode(); + //查询下几条记录 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .gt(DictionaryTypeEntity::getSortCode, upSortCode) + .eq(DictionaryTypeEntity::getParentId, downEntity.getParentId()) + .orderByAsc(DictionaryTypeEntity::getSortCode); + List upEntity = this.list(queryWrapper); + if (upEntity.size() > 0) { + //交换两条记录的sort值 + Long temp = downEntity.getSortCode(); + downEntity.setSortCode(upEntity.get(0).getSortCode()); + upEntity.get(0).setSortCode(temp); + updateById(upEntity.get(0)); + updateById(downEntity); + isOk = true; + } + return isOk; + } +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/InterfaceOauthServiceImpl.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/InterfaceOauthServiceImpl.java new file mode 100644 index 0000000..429150c --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/InterfaceOauthServiceImpl.java @@ -0,0 +1,112 @@ +package jnpf.base.service.impl; + +import jnpf.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import jnpf.base.entity.InterfaceOauthEntity; +import jnpf.base.mapper.InterfaceOauthMapper; +import jnpf.base.model.InterfaceOauth.PaginationOauth; +import jnpf.base.service.InterfaceOauthService; +import jnpf.exception.DataException; +import jnpf.util.DateUtil; +import jnpf.util.RandomUtil; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 接口认证服务 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/6/8 9:50 + */ +@Service +public class InterfaceOauthServiceImpl extends SuperServiceImpl implements InterfaceOauthService { + + @Autowired + private UserProvider userProvider; + + + @Override + public boolean isExistByAppName(String appName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(InterfaceOauthEntity::getAppName, appName); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(InterfaceOauthEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public boolean isExistByAppId(String appId, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(InterfaceOauthEntity::getAppId, appId); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(InterfaceOauthEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public List getList(PaginationOauth pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + + //查询关键字 + if (StringUtil.isNotEmpty(pagination.getKeyword())) { + queryWrapper.lambda().and( + t -> t.like(InterfaceOauthEntity::getAppId, pagination.getKeyword()) + .or().like(InterfaceOauthEntity::getAppName, pagination.getKeyword()) + ); + } + //排序 + queryWrapper.lambda().orderByAsc(InterfaceOauthEntity::getSortCode) + .orderByDesc(InterfaceOauthEntity::getCreatorTime); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage iPage = this.page(page, queryWrapper); + return pagination.setData(iPage.getRecords(), iPage.getTotal()); + } + + @Override + public InterfaceOauthEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(InterfaceOauthEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(InterfaceOauthEntity entity) { + if (entity.getId() == null) { + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(userProvider.get().getUserId()); + entity.setCreatorTime(DateUtil.getNowDate()); + } + this.save(entity); + } + + @Override + public boolean update(InterfaceOauthEntity entity, String id) throws DataException { + entity.setId(id); + entity.setLastModifyUserId(userProvider.get().getUserId()); + entity.setLastModifyTime(DateUtil.getNowDate()); + return this.updateById(entity); + } + + @Override + public void delete(InterfaceOauthEntity entity) { + this.removeById(entity.getId()); + } + + @Override + public InterfaceOauthEntity getInfoByAppId(String appId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(InterfaceOauthEntity::getAppId, appId); + return this.getOne(queryWrapper); + } +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/MessageTemplateServiceImpl.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/MessageTemplateServiceImpl.java new file mode 100644 index 0000000..695a9f3 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/MessageTemplateServiceImpl.java @@ -0,0 +1,116 @@ +package jnpf.base.service.impl; + +import jnpf.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import jnpf.base.Pagination; +import jnpf.base.entity.MessageTemplateEntity; +import jnpf.base.mapper.MessageTemplateMapper; +import jnpf.base.service.MessageTemplateService; +import jnpf.util.RandomUtil; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; + +import java.util.Date; +import java.util.List; + +/** + * 消息模板 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年12月8日17:40:37 + */ +@Service +public class MessageTemplateServiceImpl extends SuperServiceImpl implements MessageTemplateService { + + @Autowired + private UserProvider userProvider; + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(MessageTemplateEntity::getEnabledMark, 1); + queryWrapper.lambda().orderByDesc(MessageTemplateEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getList(Pagination pagination, Boolean filter) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (!StringUtil.isEmpty(pagination.getKeyword())) { + queryWrapper.lambda().and( + t -> t.like(MessageTemplateEntity::getFullName, pagination.getKeyword()) + .or().like(MessageTemplateEntity::getTitle, pagination.getKeyword()) + .or().like(MessageTemplateEntity::getEnCode, pagination.getKeyword()) + ); + } + if (filter) { + queryWrapper.lambda().eq(MessageTemplateEntity::getEnabledMark, 1); + } + queryWrapper.lambda().orderByDesc(MessageTemplateEntity::getCreatorTime); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage userPage = this.page(page, queryWrapper); + return pagination.setData(userPage.getRecords(), page.getTotal()); + } + + @Override + public MessageTemplateEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(MessageTemplateEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + @DSTransactional + public void create(MessageTemplateEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(userProvider.get().getUserId()); + this.save(entity); + } + + @Override + @DSTransactional + public boolean update(String id, MessageTemplateEntity entity) { + entity.setId(id); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(userProvider.get().getUserId()); + return this.updateById(entity); + } + + @Override + public void delete(MessageTemplateEntity entity) { + this.removeById(entity.getId()); + } + + @Override + public boolean isExistByFullName(String fullName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(MessageTemplateEntity::getFullName, fullName); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(MessageTemplateEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public boolean isExistByEnCode(String enCode, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(MessageTemplateEntity::getEnCode, enCode); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(MessageTemplateEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + +} + + + + diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ModuleButtonServiceImpl.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ModuleButtonServiceImpl.java new file mode 100644 index 0000000..694e1e9 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ModuleButtonServiceImpl.java @@ -0,0 +1,150 @@ +package jnpf.base.service.impl; + + +import jnpf.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import jnpf.base.Pagination; +import jnpf.base.entity.ModuleButtonEntity; +import jnpf.base.mapper.ModuleButtonMapper; +import jnpf.base.service.ModuleButtonService; +import jnpf.util.DateUtil; +import jnpf.util.RandomUtil; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * 按钮权限 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Service +public class ModuleButtonServiceImpl extends SuperServiceImpl implements ModuleButtonService { + + @Autowired + private UserProvider userProvider; + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + // 排序 + queryWrapper.lambda().orderByAsc(ModuleButtonEntity::getSortCode) + .orderByDesc(ModuleButtonEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getEnabledMarkList(String enabledMark) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleButtonEntity::getEnabledMark,enabledMark); + // 排序 + queryWrapper.lambda().orderByAsc(ModuleButtonEntity::getSortCode) + .orderByDesc(ModuleButtonEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getList(String moduleId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleButtonEntity::getModuleId, moduleId); + // 排序 + queryWrapper.lambda().orderByAsc(ModuleButtonEntity::getSortCode) + .orderByDesc(ModuleButtonEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getList(String moduleId, Pagination pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleButtonEntity::getModuleId, moduleId); + //关键字查询 + if(!StringUtil.isEmpty(pagination.getKeyword())){ + queryWrapper.lambda().and( + t->t.like(ModuleButtonEntity::getFullName,pagination.getKeyword()) + .or().like(ModuleButtonEntity::getEnCode,pagination.getKeyword()) + ); + } + // 排序 + queryWrapper.lambda().orderByAsc(ModuleButtonEntity::getSortCode) + .orderByDesc(ModuleButtonEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public ModuleButtonEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleButtonEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public ModuleButtonEntity getInfo(String id, String moduleId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleButtonEntity::getId, id); + queryWrapper.lambda().eq(ModuleButtonEntity::getModuleId, moduleId); + return this.getOne(queryWrapper); + } + + @Override + public boolean isExistByFullName(String moduleId, String fullName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleButtonEntity::getFullName, fullName).eq(ModuleButtonEntity::getModuleId, moduleId); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(ModuleButtonEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public boolean isExistByEnCode(String moduleId, String enCode, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleButtonEntity::getEnCode, enCode); + if(moduleId!=null){ + queryWrapper.lambda().eq(ModuleButtonEntity::getModuleId, moduleId); + } + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(ModuleButtonEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public void create(ModuleButtonEntity entity) { + entity.setId(RandomUtil.uuId()); + this.save(entity); + } + + @Override + public boolean update(String id, ModuleButtonEntity entity) { + entity.setId(id); + entity.setLastModifyTime(DateUtil.getNowDate()); + return this.updateById(entity); + } + + @Override + public void delete(ModuleButtonEntity entity) { + this.removeById(entity.getId()); + } + + @Override + public List getList(List ids) { + if (ids.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(ModuleButtonEntity::getModuleId, ids); + queryWrapper.lambda().eq(ModuleButtonEntity::getEnabledMark, 1); + return this.list(queryWrapper); + } + + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ModuleColumnServiceImpl.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ModuleColumnServiceImpl.java new file mode 100644 index 0000000..65bc71c --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ModuleColumnServiceImpl.java @@ -0,0 +1,227 @@ +package jnpf.base.service.impl; + + +import jnpf.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import jnpf.base.Pagination; +import jnpf.base.entity.ModuleButtonEntity; +import jnpf.base.entity.ModuleColumnEntity; +import jnpf.base.mapper.ModuleColumnMapper; +import jnpf.base.service.ModuleColumnService; +import jnpf.util.DateUtil; +import jnpf.util.RandomUtil; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 列表权限 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Service +public class ModuleColumnServiceImpl extends SuperServiceImpl implements ModuleColumnService { + + @Autowired + private UserProvider userProvider; + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + // 排序 + queryWrapper.lambda().orderByAsc(ModuleColumnEntity::getSortCode) + .orderByDesc(ModuleColumnEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getEnabledMarkList(String enabledMark) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleColumnEntity::getEnabledMark, enabledMark); + // 排序 + queryWrapper.lambda().orderByAsc(ModuleColumnEntity::getSortCode) + .orderByDesc(ModuleColumnEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getList(String moduleId, Pagination pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleColumnEntity::getModuleId, moduleId); + if (!StringUtil.isEmpty(pagination.getKeyword())) { + queryWrapper.lambda().and( + t -> t.like(ModuleColumnEntity::getEnCode, pagination.getKeyword()).or().like(ModuleColumnEntity::getFullName, pagination.getKeyword()) + ); + } + // 排序 + queryWrapper.lambda().orderByAsc(ModuleColumnEntity::getSortCode) + .orderByDesc(ModuleColumnEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getList(String moduleId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleColumnEntity::getModuleId, moduleId); + // 排序 + queryWrapper.lambda().orderByAsc(ModuleColumnEntity::getSortCode) + .orderByDesc(ModuleColumnEntity::getCreatorTime); + return this.list(queryWrapper); + } + + + @Override + public List getListByBindTable(String bindTable) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleColumnEntity::getBindTable, bindTable); + // 排序 + queryWrapper.lambda().orderByAsc(ModuleColumnEntity::getSortCode) + .orderByDesc(ModuleColumnEntity::getCreatorTime); + List list = this.list(queryWrapper); + return list; + } + + @Override + public ModuleColumnEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleColumnEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public ModuleColumnEntity getInfo(String id, String moduleId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleColumnEntity::getId, id); + queryWrapper.lambda().eq(ModuleColumnEntity::getModuleId, moduleId); + return this.getOne(queryWrapper); + } + + @Override + public boolean isExistByFullName(String moduleId, String fullName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleColumnEntity::getFullName, fullName).eq(ModuleColumnEntity::getModuleId, moduleId); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(ModuleColumnEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public boolean isExistByEnCode(String moduleId, String enCode, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleColumnEntity::getEnCode, enCode).eq(ModuleColumnEntity::getModuleId, moduleId); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(ModuleColumnEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public void create(ModuleColumnEntity entity) { + entity.setSortCode(entity.getSortCode()); + entity.setId(RandomUtil.uuId()); + this.save(entity); + } + + @Override + @DSTransactional + public void create(List entitys) { + Long sortCode = RandomUtil.parses(); + String userId = userProvider.get().getUserId(); + for (ModuleColumnEntity entity : entitys) { + entity.setId(RandomUtil.uuId()); + entity.setSortCode(sortCode++); + entity.setEnabledMark("1".equals(String.valueOf(entity.getEnabledMark())) ? 0 : 1); + entity.setCreatorUserId(userId); + this.save(entity); + } + } + + @Override + public boolean update(String id, ModuleColumnEntity entity) { + entity.setId(id); + entity.setLastModifyTime(DateUtil.getNowDate()); + return this.updateById(entity); + } + + @Override + public void delete(ModuleColumnEntity entity) { + this.removeById(entity.getId()); + } + + @Override + @DSTransactional + public boolean first(String id) { + boolean isOk = false; + //获取要上移的那条数据的信息 + ModuleColumnEntity upEntity = this.getById(id); + Long upSortCode = upEntity.getSortCode() == null ? 0 : upEntity.getSortCode(); + //查询上几条记录 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .eq(ModuleColumnEntity::getModuleId, upEntity.getModuleId()) + .eq(ModuleColumnEntity::getBindTable, upEntity.getBindTable()) + .lt(ModuleColumnEntity::getSortCode, upSortCode) + .orderByDesc(ModuleColumnEntity::getSortCode); + List downEntity = this.list(queryWrapper); + if (downEntity.size() > 0) { + //交换两条记录的sort值 + Long temp = upEntity.getSortCode(); + upEntity.setSortCode(downEntity.get(0).getSortCode()); + downEntity.get(0).setSortCode(temp); + this.updateById(downEntity.get(0)); + this.updateById(upEntity); + isOk = true; + } + return isOk; + } + + @Override + @DSTransactional + public boolean next(String id) { + boolean isOk = false; + //获取要下移的那条数据的信息 + ModuleColumnEntity downEntity = this.getById(id); + Long upSortCode = downEntity.getSortCode() == null ? 0 : downEntity.getSortCode(); + //查询下几条记录 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .eq(ModuleColumnEntity::getModuleId, downEntity.getModuleId()) + .eq(ModuleColumnEntity::getBindTable, downEntity.getBindTable()) + .gt(ModuleColumnEntity::getSortCode, upSortCode) + .orderByAsc(ModuleColumnEntity::getSortCode); + List upEntity = this.list(queryWrapper); + if (upEntity.size() > 0) { + //交换两条记录的sort值 + Long temp = downEntity.getSortCode(); + downEntity.setSortCode(upEntity.get(0).getSortCode()); + upEntity.get(0).setSortCode(temp); + this.updateById(upEntity.get(0)); + this.updateById(downEntity); + isOk = true; + } + return isOk; + } + + @Override + public List getListByModuleId(List ids) { + if (ids.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(ModuleColumnEntity::getModuleId, ids); + queryWrapper.lambda().eq(ModuleColumnEntity::getEnabledMark, 1); + return this.list(queryWrapper); + } +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ModuleDataAuthorizeLinkDataServiceImpl.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ModuleDataAuthorizeLinkDataServiceImpl.java new file mode 100644 index 0000000..23f7521 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ModuleDataAuthorizeLinkDataServiceImpl.java @@ -0,0 +1,35 @@ +package jnpf.base.service.impl; + +import jnpf.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import jnpf.base.entity.ModuleDataAuthorizeLinkEntity; +import jnpf.base.mapper.ModuleDataAuthorizeLinkDataMapper; +import jnpf.base.service.ModuleDataAuthorizeLinkDataService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 数据权限方案 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Service +public class ModuleDataAuthorizeLinkDataServiceImpl extends SuperServiceImpl implements ModuleDataAuthorizeLinkDataService { + + + @Override + public ModuleDataAuthorizeLinkEntity getLinkDataEntityByMenuId(String menuId,String type) { + QueryWrapper linkEntityQueryWrapper = new QueryWrapper<>(); + linkEntityQueryWrapper.lambda().eq(ModuleDataAuthorizeLinkEntity::getModuleId,menuId).eq(ModuleDataAuthorizeLinkEntity::getDataType,type); + List list = this.list(linkEntityQueryWrapper); + if (list.size()>0){ + return list.get(0); + } + return new ModuleDataAuthorizeLinkEntity(); + } +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ModuleDataAuthorizeSchemeServiceImpl.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ModuleDataAuthorizeSchemeServiceImpl.java new file mode 100644 index 0000000..f0ce287 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ModuleDataAuthorizeSchemeServiceImpl.java @@ -0,0 +1,131 @@ +package jnpf.base.service.impl; + + +import jnpf.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import jnpf.base.entity.ModuleColumnEntity; +import jnpf.base.entity.ModuleDataAuthorizeSchemeEntity; +import jnpf.base.mapper.ModuleDataAuthorizeSchemeMapper; +import jnpf.base.service.ModuleDataAuthorizeSchemeService; +import jnpf.util.DateUtil; +import jnpf.util.RandomUtil; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * 数据权限方案 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Service +public class ModuleDataAuthorizeSchemeServiceImpl extends SuperServiceImpl implements ModuleDataAuthorizeSchemeService { + + @Autowired + private UserProvider userProvider; + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + // 排序 + queryWrapper.lambda().orderByDesc(ModuleDataAuthorizeSchemeEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getEnabledMarkList(String enabledMark) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleDataAuthorizeSchemeEntity::getEnabledMark, enabledMark); + // 排序 + queryWrapper.lambda().orderByDesc(ModuleDataAuthorizeSchemeEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getList(String moduleId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleDataAuthorizeSchemeEntity::getModuleId, moduleId); + // 排序 + queryWrapper.lambda().orderByDesc(ModuleDataAuthorizeSchemeEntity::getCreatorTime); + // 排序 + return this.list(queryWrapper); + } + + @Override + public ModuleDataAuthorizeSchemeEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleDataAuthorizeSchemeEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(ModuleDataAuthorizeSchemeEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setEnabledMark(1); + entity.setSortCode(RandomUtil.parses()); + this.save(entity); + } + + @Override + public boolean update(String id, ModuleDataAuthorizeSchemeEntity entity) { + entity.setId(id); + entity.setEnabledMark(1); + entity.setLastModifyTime(DateUtil.getNowDate()); + return this.updateById(entity); + } + + @Override + public void delete(ModuleDataAuthorizeSchemeEntity entity) { + this.removeById(entity.getId()); + } + + @Override + public Boolean isExistByFullName(String id, String fullName, String moduleId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleDataAuthorizeSchemeEntity::getModuleId, moduleId); + queryWrapper.lambda().eq(ModuleDataAuthorizeSchemeEntity::getFullName, fullName); + if (StringUtil.isNotEmpty(id)) { + queryWrapper.lambda().ne(ModuleDataAuthorizeSchemeEntity::getId, id); + } + return this.count(queryWrapper) > 0; + } + + @Override + public Boolean isExistByEnCode(String id, String enCode, String moduleId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleDataAuthorizeSchemeEntity::getModuleId, moduleId); + queryWrapper.lambda().eq(ModuleDataAuthorizeSchemeEntity::getEnCode, enCode); + if (StringUtil.isNotEmpty(id)) { + queryWrapper.lambda().ne(ModuleDataAuthorizeSchemeEntity::getId, id); + } + return this.count(queryWrapper) > 0; + } + + @Override + public Boolean isExistAllData(String moduleId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleDataAuthorizeSchemeEntity::getModuleId, moduleId); + queryWrapper.lambda().eq(ModuleDataAuthorizeSchemeEntity::getAllData, 1); + return this.count(queryWrapper) > 0; + } + + @Override + public List getListByModuleId(List ids) { + if (ids.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(ModuleDataAuthorizeSchemeEntity::getModuleId, ids); + queryWrapper.lambda().eq(ModuleDataAuthorizeSchemeEntity::getEnabledMark, 1); + return this.list(queryWrapper); + } +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ModuleDataAuthorizeServiceImpl.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ModuleDataAuthorizeServiceImpl.java new file mode 100644 index 0000000..39087f3 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ModuleDataAuthorizeServiceImpl.java @@ -0,0 +1,79 @@ +package jnpf.base.service.impl; + + +import jnpf.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import jnpf.base.entity.ModuleDataAuthorizeEntity; +import jnpf.base.mapper.ModuleDataAuthorizeMapper; +import jnpf.base.service.ModuleDataAuthorizeService; +import jnpf.util.DateUtil; +import jnpf.util.RandomUtil; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 数据权限配置 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Service +public class ModuleDataAuthorizeServiceImpl extends SuperServiceImpl implements ModuleDataAuthorizeService { + + @Autowired + private UserProvider userProvider; + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + // 排序 + queryWrapper.lambda().orderByDesc(ModuleDataAuthorizeEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getList(String moduleId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleDataAuthorizeEntity::getModuleId, moduleId); + // 排序 + queryWrapper.lambda().orderByDesc(ModuleDataAuthorizeEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public ModuleDataAuthorizeEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleDataAuthorizeEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(ModuleDataAuthorizeEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setEnabledMark(1); + entity.setSortCode(RandomUtil.parses()); + this.save(entity); + } + + @Override + public boolean update(String id, ModuleDataAuthorizeEntity entity) { + entity.setId(id); + entity.setEnabledMark(1); + entity.setLastModifyTime(DateUtil.getNowDate()); + return this.updateById(entity); + } + + @Override + public void delete(ModuleDataAuthorizeEntity entity) { + this.removeById(entity.getId()); + } + + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ModuleFormServiceImpl.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ModuleFormServiceImpl.java new file mode 100644 index 0000000..1f517ee --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ModuleFormServiceImpl.java @@ -0,0 +1,159 @@ +package jnpf.base.service.impl; + +import jnpf.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import jnpf.base.Pagination; +import jnpf.base.entity.ModuleFormEntity; +import jnpf.base.mapper.ModuleFormMapper; +import jnpf.base.service.ModuleFormService; +import jnpf.util.DateUtil; +import jnpf.util.RandomUtil; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * 表单权限 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Service +public class ModuleFormServiceImpl extends SuperServiceImpl implements ModuleFormService { + + @Autowired + private UserProvider userProvider; + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + // 排序 + queryWrapper.lambda().orderByAsc(ModuleFormEntity::getSortCode) + .orderByDesc(ModuleFormEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getEnabledMarkList(String enabledMark) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleFormEntity::getEnabledMark,enabledMark); + // 排序 + queryWrapper.lambda().orderByAsc(ModuleFormEntity::getSortCode) + .orderByDesc(ModuleFormEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getList(String moduleId, Pagination pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleFormEntity::getModuleId, moduleId); + if(!StringUtil.isEmpty(pagination.getKeyword())){ + queryWrapper.lambda().and( + t-> t.like(ModuleFormEntity::getEnCode,pagination.getKeyword()).or().like(ModuleFormEntity::getFullName,pagination.getKeyword()) + ); + } + // 排序 + queryWrapper.lambda().orderByAsc(ModuleFormEntity::getSortCode) + .orderByDesc(ModuleFormEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getList(String moduleId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleFormEntity::getModuleId, moduleId); + // 排序 + queryWrapper.lambda().orderByAsc(ModuleFormEntity::getSortCode) + .orderByDesc(ModuleFormEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public ModuleFormEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleFormEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public ModuleFormEntity getInfo(String id, String moduleId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleFormEntity::getId, id); + queryWrapper.lambda().eq(ModuleFormEntity::getModuleId, moduleId); + return this.getOne(queryWrapper); + } + + @Override + public boolean isExistByFullName(String moduleId, String fullName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleFormEntity::getFullName, fullName).eq(ModuleFormEntity::getModuleId, moduleId); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(ModuleFormEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public boolean isExistByEnCode(String moduleId, String enCode, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleFormEntity::getEnCode, enCode).eq(ModuleFormEntity::getModuleId, moduleId); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(ModuleFormEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public void create(ModuleFormEntity entity) { + entity.setId(RandomUtil.uuId()); + this.save(entity); + } + + @Override + @DSTransactional + public void create(List entitys) { + Long sortCode = RandomUtil.parses(); + String userId = userProvider.get().getUserId(); + for (ModuleFormEntity entity : entitys) { + entity.setId(RandomUtil.uuId()); + entity.setSortCode(sortCode++); + entity.setEnabledMark("1".equals(String.valueOf(entity.getEnabledMark()))?0:1); + entity.setCreatorUserId(userId); + this.save(entity); + } + } + + @Override + public boolean update(String id, ModuleFormEntity entity) { + entity.setId(id); + entity.setLastModifyTime(DateUtil.getNowDate()); + return this.updateById(entity); + } + + @Override + public void delete(ModuleFormEntity entity) { + this.removeById(entity.getId()); + } + + @Override + public List getListByModuleId(List ids) { + if (ids.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(ModuleFormEntity::getModuleId, ids); + queryWrapper.lambda().eq(ModuleFormEntity::getEnabledMark, 1); + return this.list(queryWrapper); + } + + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ModuleServiceImpl.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ModuleServiceImpl.java new file mode 100644 index 0000000..bba9d5f --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ModuleServiceImpl.java @@ -0,0 +1,546 @@ +package jnpf.base.service.impl; + + +import jnpf.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import jnpf.base.entity.*; +import jnpf.base.mapper.ModuleMapper; +import jnpf.base.model.module.ModuleExportModel; +import jnpf.base.service.*; +import jnpf.base.vo.DownloadVO; +import jnpf.config.ConfigValueUtil; +import jnpf.constant.JnpfConst; +import jnpf.constant.PermissionConst; +import jnpf.exception.DataException; +import jnpf.permission.entity.OrganizeAdministratorEntity; +import jnpf.permission.service.OrganizeAdministratorService; +import jnpf.util.*; +import jnpf.util.context.SpringContext; +import jnpf.emnus.ModuleTypeEnum; +import jnpf.util.FileExport; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import org.springframework.transaction.interceptor.TransactionAspectSupport; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 系统功能 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Service +public class ModuleServiceImpl extends SuperServiceImpl implements ModuleService { + + @Autowired + private UserProvider userProvider; + @Autowired + private ModuleButtonService moduleButtonService; + @Autowired + private ModuleColumnService moduleColumnService; + @Autowired + private ModuleDataAuthorizeService moduleDataAuthorizeService; + @Autowired + private ModuleButtonService buttonService; + @Autowired + private ModuleColumnService columnService; + @Autowired + private ModuleFormService formService; + @Autowired + private ModuleDataAuthorizeSchemeService schemeService; + @Autowired + private ModuleDataAuthorizeService authorizeService; + @Autowired + private FileExport fileExport; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private SystemService systemService; + @Autowired + private OrganizeAdministratorService organizeAdminTratorApi; + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().orderByAsc(ModuleEntity::getSortCode) + .orderByDesc(ModuleEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getList(List list) { + if (list.size() == 0) { + return new ArrayList<>(16); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(ModuleEntity::getSystemId, list); + queryWrapper.lambda().eq(ModuleEntity::getEnabledMark, 1); + queryWrapper.lambda().orderByAsc(ModuleEntity::getSortCode) + .orderByDesc(ModuleEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getList(String systemId, String category, String keyword, String type, String enabledMark, String parentId, boolean release) { + // 定义变量判断是否需要使用修改时间倒序 + boolean flag = false; + QueryWrapper queryWrapper = new QueryWrapper<>(); + QueryWrapper query = new QueryWrapper<>(); + query.lambda().eq(SystemEntity::getEnCode, JnpfConst.MAIN_SYSTEM_CODE); + query.lambda().select(SystemEntity::getId); + SystemEntity systemEntity = systemService.getOne(query); + if ("0".equals(systemId) && release) { + queryWrapper.lambda().eq(ModuleEntity::getCategory, "Web"); + queryWrapper.lambda().eq(ModuleEntity::getSystemId, systemEntity.getId()); + queryWrapper.lambda().select(ModuleEntity::getId); + List workModuleIds = this.list(queryWrapper).stream().map(ModuleEntity::getId).collect(Collectors.toList()); + // 重新定义一个查询对象 + queryWrapper = new QueryWrapper<>(); + if (!workModuleIds.isEmpty()) { + queryWrapper.lambda().notIn(ModuleEntity::getId, workModuleIds); + } + } + // 如果是主系统且不是管理员菜单需要去分级里面获取 + if (systemId.equals(systemEntity.getId()) && !userProvider.get().getIsAdministrator()) { + List collect = organizeAdminTratorApi.getOrganizeAdministratorEntity(UserProvider.getLoginUserId(), PermissionConst.MODULE, false) + .stream().map(OrganizeAdministratorEntity::getOrganizeId).collect(Collectors.toList()); + if (collect.size() > 0) { + queryWrapper.lambda().in(ModuleEntity::getId, collect); + } + } + // 根据系统id获取功能 + if (!"0".equals(systemId)) { + queryWrapper.lambda().eq(ModuleEntity::getSystemId, systemId); + } + if (!StringUtil.isEmpty(category)) { + flag = true; + queryWrapper.lambda().eq(ModuleEntity::getCategory, category); + } + if (!StringUtil.isEmpty(keyword)) { + flag = true; + queryWrapper.lambda().and(t -> t.like(ModuleEntity::getFullName, keyword)); + } + if (StringUtil.isNotEmpty(type)) { + flag = true; + queryWrapper.lambda().eq(ModuleEntity::getType, Integer.valueOf(type)); + } + if (StringUtil.isNotEmpty(enabledMark)) { + queryWrapper.lambda().eq(ModuleEntity::getEnabledMark, Integer.valueOf(enabledMark)); + } + if (StringUtil.isNotEmpty(parentId)) { + flag = true; + queryWrapper.lambda().eq(ModuleEntity::getParentId, parentId); + } + queryWrapper.lambda().orderByAsc(ModuleEntity::getSortCode) + .orderByDesc(ModuleEntity::getCreatorTime); + if (flag) { + queryWrapper.lambda().orderByDesc(ModuleEntity::getLastModifyTime); + } + // 移除工作流程菜单 + List moduleCode = JnpfConst.MODULE_CODE; + queryWrapper.lambda().notIn(ModuleEntity::getEnCode, moduleCode); + return this.list(queryWrapper); + } + + @Override + public List getList(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleEntity::getParentId, id); + queryWrapper.lambda().orderByAsc(ModuleEntity::getSortCode) + .orderByDesc(ModuleEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public ModuleEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public ModuleEntity getInfo(String id, String systemId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleEntity::getId, id); + queryWrapper.lambda().eq(ModuleEntity::getSystemId, systemId); + return this.getOne(queryWrapper); + } + + @Override + public List getInfoByFullName(String fullName, String systemId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleEntity::getFullName, fullName); + queryWrapper.lambda().eq(ModuleEntity::getSystemId, systemId); + return this.list(queryWrapper); + } + + @Override + public ModuleEntity getInfo(String id, String systemId, String parentId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleEntity::getId, id); + queryWrapper.lambda().eq(ModuleEntity::getSystemId, systemId); + queryWrapper.lambda().eq(ModuleEntity::getParentId, parentId); + return this.getOne(queryWrapper); + } + + @Override + public boolean isExistByFullName(ModuleEntity entity, String category, String systemId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleEntity::getFullName, entity.getFullName()).eq(ModuleEntity::getCategory, category); + if (!StringUtil.isEmpty(entity.getId())) { + queryWrapper.lambda().ne(ModuleEntity::getId, entity.getId()); + } + + // 通过系统id查询 + queryWrapper.lambda().eq(ModuleEntity::getSystemId, systemId); + + List entityList = this.list(queryWrapper); + if (entityList.size() > 0) { + return true; + } + return false; + } + + @Override + public boolean isExistByEnCode(ModuleEntity entity, String category, String systemId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleEntity::getEnCode, entity.getEnCode()).eq(ModuleEntity::getCategory, category); + if (!StringUtil.isEmpty(entity.getId())) { + queryWrapper.lambda().ne(ModuleEntity::getId, entity.getId()); + } + + List entityList = this.list(queryWrapper); + if (entityList.size() > 0) { + return true; + } else { + return false; + } + } + + @DSTransactional + @Override + public void delete(ModuleEntity entity) { + this.removeById(entity.getId()); + QueryWrapper buttonWrapper = new QueryWrapper<>(); + buttonWrapper.lambda().eq(ModuleButtonEntity::getModuleId, entity.getId()); + moduleButtonService.remove(buttonWrapper); + QueryWrapper columnWrapper = new QueryWrapper<>(); + columnWrapper.lambda().eq(ModuleColumnEntity::getModuleId, entity.getId()); + moduleColumnService.remove(columnWrapper); + QueryWrapper dataWrapper = new QueryWrapper<>(); + dataWrapper.lambda().eq(ModuleDataAuthorizeEntity::getModuleId, entity.getId()); + moduleDataAuthorizeService.remove(dataWrapper); + Object service = SpringContext.getBean("appDataServiceImpl"); + Class[] types = new Class[]{String.class}; + Object[] datas = new Object[]{entity.getId()}; + ReflectionUtil.invokeMethod(service, "delete", types, datas); + } + + @Override + public void deleteBySystemId(String systemId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleEntity::getSystemId, systemId); + this.remove(queryWrapper); + } + + @DSTransactional + @Override + public void deleteModule(ModuleEntity entity) { + QueryWrapper buttonWrapper = new QueryWrapper<>(); + buttonWrapper.lambda().eq(ModuleButtonEntity::getModuleId, entity.getId()); + moduleButtonService.remove(buttonWrapper); + QueryWrapper columnWrapper = new QueryWrapper<>(); + columnWrapper.lambda().eq(ModuleColumnEntity::getModuleId, entity.getId()); + moduleColumnService.remove(columnWrapper); + QueryWrapper formWrapper = new QueryWrapper<>(); + formWrapper.lambda().eq(ModuleFormEntity::getModuleId, entity.getId()); + formService.remove(formWrapper); + } + + @DSTransactional + @Override + public void create(ModuleEntity entity) { +// boolean flag = false; +// if (entity.getId() == null) { + entity.setId(RandomUtil.uuId()); +// flag = true; +// } + this.save(entity); + //添加默认按钮 + if ("3".equals(String.valueOf(entity.getType()))) { +// Map propJsonMap= JSONUtil.StringToMap(entity.getPropertyJson()); +// if(propJsonMap!=null){ +// VisualdevEntity visualdevEntity =visualdevService.getInfo(propJsonMap.get("moduleId").toString()); +// //去除模板中的F_ +// visualdevEntity= VisualUtil.delFKey(visualdevEntity); +// if(visualdevEntity!=null){ +// List btnData =new ArrayList<>(); +// Map column=JSONUtil.StringToMap(visualdevEntity.getColumnData()); +// if(column.get("columnBtnsList")!=null){ +// btnData.addAll(JSONUtil.getJsonToList(JSONUtil.getJsonToListMap(column.get("columnBtnsList").toString()),BtnData.class)); +// } +// if(column.get("btnsList")!=null){ +// btnData.addAll(JSONUtil.getJsonToList(JSONUtil.getJsonToListMap(column.get("btnsList").toString()),BtnData.class)); +// } +// if(btnData.size()>0){ +// for(BtnData btn:btnData){ +// ModuleButtonEntity moduleButtonEntity=new ModuleButtonEntity(); +// moduleButtonEntity.setId(RandomUtil.uuId()); +// moduleButtonEntity.setParentId("-1"); +// moduleButtonEntity.setFullName(btn.getLabel()); +// moduleButtonEntity.setEnCode("btn_"+btn.getValue()); +// moduleButtonEntity.setSortCode(0L); +// moduleButtonEntity.setModuleId(entity.getId()); +// moduleButtonEntity.setEnabledMark(1); +// moduleButtonEntity.setIcon(btn.getIcon()); +// moduleButtonService.save(moduleButtonEntity); +// } +// } +// List indexGridField6Models =new ArrayList<>(); +// if(column.get("columnList")!=null){ +// indexGridField6Models.addAll(JSONUtil.getJsonToList(JSONUtil.getJsonToListMap(column.get("columnList").toString()),IndexGridField6Model.class)); +// if(indexGridField6Models.size()>0){ +// for(IndexGridField6Model field6Model:indexGridField6Models){ +// ModuleColumnEntity moduleColumnEntity=new ModuleColumnEntity(); +// moduleColumnEntity.setId(RandomUtil.uuId()); +// moduleColumnEntity.setParentId("-1"); +// moduleColumnEntity.setFullName(field6Model.getLabel()); +// moduleColumnEntity.setEnCode(field6Model.getProp()); +// moduleColumnEntity.setSortCode(0L); +// moduleColumnEntity.setModuleId(entity.getId()); +// moduleColumnEntity.setEnabledMark(1); +// moduleColumnService.save(moduleColumnEntity); +// } +// } +// } +// } +// } + } else if ("4".equals(String.valueOf(entity.getType()))) { + for (int i = 0; i < 3; i++) { + String fullName = "新增"; + String value = "add"; + String icon = "el-icon-plus"; + if (i == 1) { + fullName = "编辑"; + value = "edit"; + icon = "el-icon-edit"; + } + if (i == 2) { + fullName = "删除"; + value = "remove"; + icon = "el-icon-delete"; + } + ModuleButtonEntity moduleButtonEntity = new ModuleButtonEntity(); + moduleButtonEntity.setId(RandomUtil.uuId()); + moduleButtonEntity.setParentId("-1"); + moduleButtonEntity.setFullName(fullName); + moduleButtonEntity.setEnCode("btn_" + value); + moduleButtonEntity.setSortCode(0L); + moduleButtonEntity.setModuleId(entity.getId()); + moduleButtonEntity.setEnabledMark(1); + moduleButtonEntity.setIcon(icon); + moduleButtonService.save(moduleButtonEntity); + } + + } + } + + @Override + public boolean update(String id, ModuleEntity entity) { + entity.setId(id); + entity.setLastModifyTime(DateUtil.getNowDate()); + return this.updateById(entity); + } + + @Override + public DownloadVO exportData(String id) { + //获取信息转model + ModuleEntity moduleEntity = getInfo(id); + List buttonServiceList = buttonService.getList(id); + List columnServiceList = columnService.getList(id); + List schemeServiceList = schemeService.getList(id); + List authorizeServiceList = authorizeService.getList(id); + List formList = formService.getList(id); + ModuleExportModel exportModel = new ModuleExportModel(); + exportModel.setModuleEntity(moduleEntity); + exportModel.setButtonEntityList(buttonServiceList); + exportModel.setColumnEntityList(columnServiceList); + exportModel.setFormEntityList(formList); + exportModel.setSchemeEntityList(schemeServiceList); + exportModel.setAuthorizeEntityList(authorizeServiceList); + //导出文件 + DownloadVO downloadVO = fileExport.exportFile(exportModel, configValueUtil.getTemporaryFilePath(), moduleEntity.getFullName(), ModuleTypeEnum.SYSTEM_MODULE.getTableName()); + return downloadVO; + } + + @Override + @DSTransactional + public boolean importData(ModuleExportModel exportModel) throws DataException { + try { + boolean isExists = true; + ModuleEntity moduleEntity = exportModel.getModuleEntity(); + //开始导入 + if (!isExistByFullName(moduleEntity, moduleEntity.getCategory(), moduleEntity.getSystemId()) + && !isExistByEnCode(moduleEntity, moduleEntity.getCategory(), moduleEntity.getSystemId())) { + isExists = false; + moduleEntity.setCreatorTime(new Date()); + moduleEntity.setCreatorUserId(UserProvider.getLoginUserId()); + moduleEntity.setLastModifyTime(null); + moduleEntity.setLastModifyUserId(null); + create(moduleEntity); + } + //按钮 + List buttonEntityList = JsonUtil.getJsonToList(exportModel.getButtonEntityList(), ModuleButtonEntity.class); + for (ModuleButtonEntity buttonEntity : buttonEntityList) { + if (buttonService.getInfo(buttonEntity.getId(), moduleEntity.getId()) == null + && !buttonService.isExistByFullName(moduleEntity.getId(), buttonEntity.getFullName(), buttonEntity.getId()) + && !buttonService.isExistByEnCode(moduleEntity.getId(), buttonEntity.getEnCode(), buttonEntity.getId()) + ) { + isExists = false; + buttonEntity.setModuleId(moduleEntity.getId()); + buttonEntity.setCreatorTime(new Date()); + buttonEntity.setCreatorUserId(UserProvider.getLoginUserId()); + buttonEntity.setLastModifyTime(null); + buttonEntity.setLastModifyUserId(null); + buttonService.create(buttonEntity); + } + } + //列表 + List columnEntityList = JsonUtil.getJsonToList(exportModel.getColumnEntityList(), ModuleColumnEntity.class); + for (ModuleColumnEntity columnEntity : columnEntityList) { + isExists = false; + columnEntity.setModuleId(moduleEntity.getId()); + columnEntity.setCreatorTime(new Date()); + columnEntity.setCreatorUserId(UserProvider.getLoginUserId()); + columnEntity.setLastModifyTime(null); + columnEntity.setLastModifyUserId(null); + columnService.create(columnEntity); + } + //表单 + List formEntityList = JsonUtil.getJsonToList(exportModel.getFormEntityList(), ModuleFormEntity.class); + for (ModuleFormEntity formEntity : formEntityList) { + isExists = false; + formEntity.setModuleId(moduleEntity.getId()); + formEntity.setCreatorTime(new Date()); + formEntity.setCreatorUserId(UserProvider.getLoginUserId()); + formEntity.setLastModifyTime(null); + formEntity.setLastModifyUserId(null); + formService.create(formEntity); + } + //数据权限 + Map authorizeId = new HashMap<>(16); + List authorizeEntityList = JsonUtil.getJsonToList(exportModel.getAuthorizeEntityList(), ModuleDataAuthorizeEntity.class); + for (ModuleDataAuthorizeEntity authorizeEntity : authorizeEntityList) { + isExists = false; + authorizeEntity.setModuleId(moduleEntity.getId()); + // 导入前id + String id = authorizeEntity.getId(); + authorizeEntity.setCreatorTime(new Date()); + authorizeEntity.setCreatorUserId(UserProvider.getLoginUserId()); + authorizeEntity.setLastModifyTime(null); + authorizeEntity.setLastModifyUserId(null); + authorizeService.create(authorizeEntity); + authorizeId.put(id, authorizeEntity.getId()); + } + //数据权限方案 + List schemeEntityList = JsonUtil.getJsonToList(exportModel.getSchemeEntityList(), ModuleDataAuthorizeSchemeEntity.class); + for (ModuleDataAuthorizeSchemeEntity schemeEntity : schemeEntityList) { + isExists = false; + schemeEntity.setModuleId(moduleEntity.getId()); + // 得到条件 + String conditionJson = schemeEntity.getConditionJson(); + if (StringUtil.isNotEmpty(conditionJson)) { + for (String oldId : authorizeId.keySet()) { + conditionJson = conditionJson.replaceAll(oldId, authorizeId.get(oldId)); + } + } + schemeEntity.setConditionJson(conditionJson); + schemeEntity.setCreatorTime(new Date()); + schemeEntity.setCreatorUserId(UserProvider.getLoginUserId()); + schemeEntity.setLastModifyTime(null); + schemeEntity.setLastModifyUserId(null); + schemeService.create(schemeEntity); + } + return isExists; + } catch (Exception e) { + e.printStackTrace(); + //手动回滚事务 + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + throw new DataException(e.getMessage()); + } + } + + @Override + @DSTransactional + public List getModuleList(String visualId) { + QueryWrapper moduleWrapper = new QueryWrapper<>(); + moduleWrapper.lambda().eq(ModuleEntity::getModuleId, visualId); + return this.list(moduleWrapper); + } + + @Override + public List getModuleBySystemIds(List ids) { + if (ids.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(ModuleEntity::getSystemId, ids); + queryWrapper.lambda().notIn(ModuleEntity::getEnCode, JnpfConst.MODULE_CODE); + queryWrapper.lambda().eq(ModuleEntity::getEnabledMark, 1); + return this.list(queryWrapper); + } + + @Override + public List getModuleByPortal(List portalIds) { + if (portalIds.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(ModuleEntity::getModuleId, portalIds); + return this.list(queryWrapper); + } + + @Override + public List getMainModule() { + SystemEntity mainSystem = systemService.getInfoByEnCode(JnpfConst.MAIN_SYSTEM_CODE); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleEntity::getSystemId, mainSystem.getId()); + queryWrapper.lambda().eq(ModuleEntity::getEnabledMark, 1); + // 移除工作流程菜单 + List moduleCode = JnpfConst.MODULE_CODE; + queryWrapper.lambda().notIn(ModuleEntity::getEnCode, moduleCode); + queryWrapper.lambda().orderByAsc(ModuleEntity::getSortCode).orderByDesc(ModuleEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getModuleByIds(List ids) { + if (ids.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(ModuleEntity::getId, ids); + // 移除工作流程菜单 + List moduleCode = JnpfConst.MODULE_CODE; + queryWrapper.lambda().notIn(ModuleEntity::getEnCode, moduleCode); + queryWrapper.lambda().eq(ModuleEntity::getEnabledMark, 1); + return this.list(queryWrapper); + } + + @Override + public List getListByEnCode(List enCodeList) { + if (enCodeList.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(ModuleEntity::getEnCode, enCodeList); + queryWrapper.lambda().eq(ModuleEntity::getEnabledMark, 1); + return this.list(queryWrapper); + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/PortalManageServiceImpl.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/PortalManageServiceImpl.java new file mode 100644 index 0000000..48f5428 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/PortalManageServiceImpl.java @@ -0,0 +1,129 @@ +package jnpf.base.service.impl; + +import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO; +import jnpf.base.entity.PortalManageEntity; +import jnpf.base.mapper.PortalManageMapper; +import jnpf.base.model.portalManage.PortalManagePage; +import jnpf.base.model.portalManage.PortalManagePageDO; +import jnpf.base.model.portalManage.PortalManagePrimary; +import jnpf.base.model.portalManage.PortalManageVO; +import jnpf.base.service.DictionaryDataService; +import jnpf.base.service.PortalManageService; +import jnpf.base.service.SuperServiceImpl; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.UserService; +import jnpf.util.StringUtil; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.function.Supplier; +import java.util.stream.Collectors; + + +/** + *

+ * 门户管理 服务实现类 + *

+ * + * @author YanYu + * @since 2023-02-16 + */ +@Service +public class PortalManageServiceImpl extends SuperServiceImpl implements PortalManageService { + + @Autowired + private UserService userService; + @Autowired + private PortalManageMapper portalManageMapper; + @Autowired + private DictionaryDataService dictionaryDataService; + + @Override + public void checkCreUp(PortalManageEntity creUpEntity) throws Exception{ + // 当ID为空时,为添加方法 + PortalManagePrimary primary = new PortalManagePrimary( + creUpEntity.getPlatform(), + creUpEntity.getPortalId(), + creUpEntity.getSystemId()); + if(creUpEntity.getId() == null){ + if(count(primary.getQuery()) > 0) throw new Exception("此系统与平台下门户已存在"); + } +// if(creUpEntity.getHomePageMark() == 1) { +// primary.getQuery().lambda().eq(PortalManageEntity::getEnabledMark, 1); +// PortalManageEntity one = getOne(primary.getQuery()); +// if(one != null && !one.getId().equals(creUpEntity.getId())){ +// throw new Exception("已存在默认首页,不允许被保存"); +// } +// } + } + + @Override + public PortalManageVO convertVO(PortalManageEntity entity){ + PortalManageVO vo = new PortalManageVO(); + BeanUtils.copyProperties(entity, vo); + vo.setId(entity.getId()); // 父类id声明泛型,会拷贝失败 + // 创建人 + UserEntity creatorUser = userService.getInfo(entity.getCreatorUserId()); + vo.setCreatorUser(creatorUser != null ? creatorUser.getRealName() + "/" + creatorUser.getAccount() : entity.getCreatorUserId()); + // 修改人 + UserEntity lastModifyUser = userService.getInfo(entity.getCreatorUserId()); + vo.setLastModifyUser(lastModifyUser != null ? lastModifyUser.getRealName() + "/" + lastModifyUser.getAccount() : ""); + // 门户名称 + try{ + vo.setFullName(portalManageMapper.getPortalFullName(entity.getPortalId())); + String categoryId = portalManageMapper.getPortalCategoryId(entity.getPortalId()); + String categoryName = dictionaryDataService.getInfo(portalManageMapper.getPortalCategoryId(entity.getPortalId())).getFullName(); + vo.setCategoryId(categoryId); + vo.setCategoryName(categoryName); + }catch (Exception e){ + System.out.println(e.getMessage()); + } + vo.setPlatform(entity.getPlatform()); + vo.setSystemId(entity.getSystemId()); + return vo; + } + + @Override + public List getList(PortalManagePrimary primary) { + return list(primary.getQuery()).stream().map(this::convertVO).collect(Collectors.toList()); + } + + @Override + public List getListByEnable(PortalManagePrimary primary) { + primary.getQuery().lambda().eq(PortalManageEntity::getEnabledMark, 1); + return getList(primary); + } + + @Override + public PageDTO getPage(PortalManagePage pmPage) { + String keyword = pmPage.getKeyword(); + if (StringUtil.isNotEmpty(keyword)) { + pmPage.setKeyword("%" + keyword + "%"); + } + PageDTO pageDto = portalManageMapper.selectPortalManageDoPage(pmPage.getPageDto(), pmPage); + pmPage.setTotal(pageDto.getTotal()); + return pageDto; + } + + @Override + public List getSelectList(PortalManagePage pmPage) { + List list = portalManageMapper.selectPortalManageDoList(pmPage); + return list; + } + + @Override + public void createBatch(List primaryLit) throws Exception { + List list = new ArrayList<>(); + for (PortalManagePrimary primary : primaryLit) { + if(list(primary.getQuery()).size() < 1){ + list.add(primary.getEntity()); + } + } + saveBatch(list); + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/PrintDevServiceImpl.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/PrintDevServiceImpl.java new file mode 100644 index 0000000..5fb837c --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/PrintDevServiceImpl.java @@ -0,0 +1,419 @@ +package jnpf.base.service.impl; + +import jnpf.base.service.SuperServiceImpl; +import com.alibaba.fastjson.JSONArray; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import jnpf.base.entity.DictionaryDataEntity; +import jnpf.base.entity.DictionaryTypeEntity; +import jnpf.base.service.DbLinkService; +import jnpf.base.service.DbTableService; +import jnpf.base.service.DictionaryDataService; +import jnpf.base.service.DictionaryTypeService; +import jnpf.config.ConfigValueUtil; +import jnpf.constant.MsgCode; +import jnpf.database.model.dbfield.JdbcColumnModel; +import jnpf.database.model.dto.PrepSqlDTO; +import jnpf.database.model.entity.DbLinkEntity; +import jnpf.database.util.DataSourceUtil; +import jnpf.database.util.DbTypeUtil; +import jnpf.database.util.JdbcUtil; +import jnpf.exception.DataException; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.UserService; +import jnpf.base.entity.OperatorRecordEntity; +import jnpf.base.entity.PrintDevEntity; +import jnpf.base.mapper.PrintDevMapper; +import jnpf.base.model.PaginationPrint; +import jnpf.base.model.PrintDevTreeModel; +import jnpf.base.model.PrintTableTreeModel; +import jnpf.base.model.print.PrintOption; +import jnpf.base.model.vo.PrintDevVO; +import jnpf.base.service.IPrintDevService; +import jnpf.base.util.PrintDevUtil; +import jnpf.util.JsonUtil; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import jnpf.util.treeutil.SumTree; +import jnpf.util.treeutil.newtreeutil.TreeDotUtils; +import lombok.SneakyThrows; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.sql.Timestamp; +import java.time.LocalDateTime; +import java.util.*; + +/** + * 打印模板-服务实现类 + * + * @author JNPF开发平台组 YY + * @version V3.2.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月30日 + */ +@Service +public class PrintDevServiceImpl extends SuperServiceImpl implements IPrintDevService { + + @Autowired + private DictionaryDataService dictionaryDataService; + @Autowired + private DictionaryTypeService dictionaryTypeService; + @Autowired + private UserService userService; + @Autowired + private UserProvider userProvider; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private DataSourceUtil dataSourceUtil; + @Autowired + private DbLinkService dbLinkService; + @Autowired + private DbTableService dbTableService; + @Autowired + private PrintDevMapper printDevMapper; + + @Override + public List getList(PaginationPrint paginationPrint) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(paginationPrint.getKeyword())) { + queryWrapper.lambda().and( + t-> t.like(PrintDevEntity::getFullName, paginationPrint.getKeyword()).or().like(PrintDevEntity::getEnCode, paginationPrint.getKeyword()) + ); + } + if (StringUtil.isNotEmpty(paginationPrint.getCategory())) { + queryWrapper.lambda().eq(PrintDevEntity::getCategory, paginationPrint.getCategory()); + } + queryWrapper.lambda().orderByAsc(PrintDevEntity::getSortCode).orderByDesc(PrintDevEntity::getCreatorTime); + Page page = new Page<>(paginationPrint.getCurrentPage(), paginationPrint.getPageSize()); + IPage iPage = this.page(page, queryWrapper); + return paginationPrint.setData(iPage.getRecords(), page.getTotal()); + } + + @Override + public List getTreeModel() throws Exception { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().orderByAsc(PrintDevEntity::getSortCode).orderByDesc(PrintDevEntity::getCreatorTime); + return setTreeModel(this.list(queryWrapper)); + } + + @Override + public List getTreeModel(Integer type) throws Exception { + QueryWrapper query = new QueryWrapper<>(); + query.lambda().eq(PrintDevEntity::getType, type). + eq(PrintDevEntity::getEnabledMark, 1). + orderByAsc(PrintDevEntity::getSortCode). + orderByDesc(PrintDevEntity::getCreatorTime); + List printEntityList = this.list(query); + return setTreeModel(printEntityList); + } + + private List setTreeModel(List printEntityList) throws Exception { + String encode = "printDev"; + //数据字典缺失 + DictionaryTypeEntity DictionaryType = dictionaryTypeService.getInfoByEnCode(encode); + if(DictionaryType == null){ + throw new Exception(MsgCode.PRI002.get()); + } + List dicDataList = dictionaryDataService. + getList(DictionaryType.getId()); + List modelAll = new LinkedList<>(); + //设置树形主节点(不显示没有子集的) + for (DictionaryDataEntity dicEntity : dicDataList) { + PrintDevTreeModel model = new PrintDevTreeModel(); + model.setFullName(dicEntity.getFullName()); + model.setId(dicEntity.getId()); + Long num = printEntityList.stream().filter(t -> t.getCategory().equals(dicEntity.getEnCode())).count(); + //编码底下存在的子节点总数 + if (num > 0) { + model.setNum(Integer.parseInt(num.toString())); + modelAll.add(model); + } + } + List userId = new ArrayList<>(); + printEntityList.forEach(t -> { + userId.add(t.getCreatorUserId()); + if (StringUtil.isNotEmpty(t.getLastModifyUserId())) { + userId.add(t.getLastModifyUserId()); + } + }); + List userList = userService.getUserName(userId); + //设置子节点分支 + for (PrintDevEntity printEntity : printEntityList) { + DictionaryDataEntity dicDataEntity = dicDataList.stream() + .filter(t -> t.getEnCode().equals(printEntity.getCategory())).findFirst().orElse(null); + //如果字典存在则装入容器 + PrintDevTreeModel model = JsonUtil.getJsonToBean(printEntity, PrintDevTreeModel.class); + if (dicDataEntity != null) { + //创建者 + UserEntity creatorUser = userList.stream().filter(t -> t.getId().equals(model.getCreatorUser())).findFirst().orElse(null); + model.setCreatorUser(creatorUser != null ? creatorUser.getRealName() + "/" + creatorUser.getAccount() : ""); + //修改人 + UserEntity lastmodifyuser = userList.stream().filter(t -> t.getId().equals(model.getLastModifyUser())).findFirst().orElse(null); + model.setLastModifyUser(lastmodifyuser != null ? lastmodifyuser.getRealName() + "/" + lastmodifyuser.getAccount() : ""); + + model.setParentId(dicDataEntity.getId()); + modelAll.add(model); + } + } + List> trees = TreeDotUtils.convertListToTreeDot(modelAll); + List list = JsonUtil.getJsonToList(trees, PrintDevVO.class); + return list; + } + + @Override + public Boolean checkNameExist(String fullName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(PrintDevEntity::getFullName, fullName); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(PrintDevEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public List getFlowTaskOperatorRecordList(String taskId) { + List operatorRecordList = null; + try { + // TODO 不同库之间的表名大小写问题 + String sql = "SELECT * FROM flow_taskoperatorrecord WHERE F_TaskId = ? ORDER BY F_HandleTime"; + /*@Cleanup Connection conn = ConnUtil.getConn(dataSourceUtil); + if(configValueUtil.isMultiTenancy()){ + if(DbTypeUtil.checkPostgre(dataSourceUtil)){ + JdbcUtil.creUpDe(new PrepSqlDTO("SET SEARCH_path To " + userProvider.get().getTenantDbConnectionString() + "").withConn(dataSourceUtil, null)); + } + }*/ + operatorRecordList = JdbcUtil.queryCustomMods(new PrepSqlDTO(sql, taskId).withConn(dataSourceUtil, null), OperatorRecordEntity.class); + //已办人员 + operatorRecordList.forEach(or -> { + or.setHandleTime(or.getHandleTimeOrigin().getTime()); + UserEntity userEntity = userService.getInfo(or.getHandleId()); + or.setUserName(userEntity != null ? userEntity.getRealName() + "/" + userEntity.getAccount() : ""); + }); + } catch (Exception e) { + e.getMessage(); + } + return operatorRecordList; + } + + @Override + public Map getDataBySql(String dbLinkId, String sqlTempLate) throws Exception { + Map map = new TreeMap<>(); + MultiConsumer>, DbLinkEntity> consumer = (i, dataList, dbLinkEntity)->{ + if (i == 0) { + //数据信息 + map.put("headTable", getDataMap(dataList)); + } else { + //查询子表数据信息 + map.put("T" + i, getDataMap(dataList)); + } + }; + sqlPrintCommon(dbLinkId, sqlTempLate, consumer); + return map; + } + + @FunctionalInterface + private interface MultiConsumer{ + void accept(T t, S s, U u); + } + + @Override + public List> getPintTabFieldStruct(String dbLinkId, String sqlTempLate) throws Exception { + List treeList = new ArrayList<>(); + MultiConsumer>, DbLinkEntity> consumer = (i, dataList, dbLinkEntity)->{ + PrintTableTreeModel printTable = new PrintTableTreeModel(); + Set tableNameSet = new HashSet<>(); + String parentId; + String headTable; + if (i == 0) { + parentId = "headTable"; + headTable = "主: "; + } else { + //查询子表 ============== + parentId = "T" + i; + headTable = "副_" + i + ": "; + } + printTable.setId(parentId); + treeSetField(treeList, tableNameSet, dbLinkEntity, dataList.get(0), parentId); + if(tableNameSet.size() > 0){ + printTable.setFullName(headTable + String.join("|", tableNameSet)); + }else { + printTable.setFullName(headTable); + } + printTable.setParentId("struct"); + treeList.add(printTable); + }; + sqlPrintCommon(dbLinkId, sqlTempLate, consumer); + return TreeDotUtils.convertListToTreeDot(treeList); + } + + + private void sqlPrintCommon(String dbLinkId, String sqlTempLate, MultiConsumer>, DbLinkEntity> consumer) throws Exception{ + DbLinkEntity dbLinkEntity = dbLinkService.getResource(dbLinkId); + //转换json + List> sqlList = JsonUtil.getJsonToList(JSONArray.parseArray(sqlTempLate)); + // 遍历Sql语句 + for (int i = 0; i < sqlList.size(); i++) { + List> dataList; + try { + // 获取表字段信息集合 + String sql = sqlList.get(i).get("sql").toString(); + String addition; + if(DbTypeUtil.checkOracle(dbLinkEntity)){ + addition = "SELECT major.* FROM\n" + + "\t(SELECT 1 from dual) temp\n" + + "LEFT JOIN \n" + + " \t({sql}) major\n" + + "ON \n" + + "\t1 = 1"; + }else { + addition = "SELECT major.* FROM\n" + + "\t(SELECT 1 AS tempColumn) AS temp\n" + + "LEFT JOIN \n" + + " \t({sql}) AS major\n" + + "ON \n" + + "\t1 = 1"; + } + sql = addition.replace("{sql}", sql); + dataList = JdbcUtil.queryJdbcColumns(new PrepSqlDTO(sql).withConn(dbLinkEntity)).get(); + if (dataList.size() == 0) { + dataList = (JdbcUtil.queryJdbcColumns(new PrepSqlDTO(sql).withConn(dbLinkEntity)).setIsValue(false).get()); + } + } catch (DataException e) { + throw new Exception(MsgCode.PRI005.get().replace("{index}", Integer.toString(i + 1)) + e.getMessage()); + } + if (i == 0) { + // 查询主表 获取表头信息(第一条且单条信息)============== + if (dataList.size() > 1) throw new Exception(MsgCode.PRI003.get()); + else if (dataList.size() == 0) throw new Exception(MsgCode.PRI004.get()); + } + consumer.accept(i, dataList, dbLinkEntity); + } + } + + public void treeSetField(List list, Set tableNameSet, DbLinkEntity dbLinkEntity, List dbJdbcModelList, String parentId) { + for (Map mapOne : getFieldMap(dbLinkEntity, dbJdbcModelList, tableNameSet)) { + PrintTableTreeModel fieldModel = new PrintTableTreeModel(); + fieldModel.setId(mapOne.get("field")); + fieldModel.setFullName(mapOne.get("fieldName")); + fieldModel.setParentId(parentId); + list.add(fieldModel); + } + } + + private List> getDataMap(List> dbJdbcModelList) { + List> mapList = new ArrayList<>(); + for (List mods : dbJdbcModelList) { + Map map = new HashMap<>(16); + for (JdbcColumnModel mod : mods) { + Object value = mod.getValue(); + if(value != null){ + // 对打印时间相关的值进行处理 +// if(mod.getDataType().equalsIgnoreCase("dateTime")){ +// LocalDateTime localDateTime = null; +// if(value instanceof LocalDateTime) localDateTime = (LocalDateTime)value; +// if(value instanceof Timestamp) localDateTime = ((Timestamp) value).toLocalDateTime(); +// if(localDateTime != null) value = localDateTime.getYear() + "年" +// + localDateTime.getMonthValue() + "月" + localDateTime.getDayOfMonth() + "日"; +// } + if(mod.getDataType().equalsIgnoreCase("decimal")){ + assert value instanceof BigDecimal; + value = ((BigDecimal)value).toPlainString(); + } + }else { + value = ""; + } + map.put(mod.getLabel(), value); + } + mapList.add(map); + } + return mapList; + } + + private List> getFieldMap(DbLinkEntity dbLinkEntity, List dbJdbcModelList, Set tableNameSet) { + List> mapList = new ArrayList<>(); + for (JdbcColumnModel model : dbJdbcModelList) { + // 获取表名 + Map map = new HashMap<>(); + map.put("field", model.getLabel()); + String tableInfo = model.getTable(); + String fieldInfo = model.getField(); + if(StringUtil.isNotEmpty(model.getTable())){ + // 部分数据库,无法从元数据中查出表、字段注释,比如Oracle + String[] tableColumnComment = PrintDevUtil.getTableColumnComment(dbLinkEntity, model.getTable(), model.getField()); + if(StringUtil.isNotEmpty(tableColumnComment[0])) tableInfo = tableInfo + " (" + tableColumnComment[0] + ")"; + if(StringUtil.isNotEmpty(tableColumnComment[1])) fieldInfo = fieldInfo + " (" + tableColumnComment[1] + ")"; + } + tableNameSet.add(tableInfo); // 表名 + map.put("fieldName", fieldInfo);// 表字段 + mapList.add(map); + } + return mapList; + } + + @Override + public void creUpdateCheck(PrintDevEntity printDevEntity, Boolean fullNameCheck, Boolean encodeCheck) throws Exception{ + String fullName = printDevEntity.getFullName(); + String encode = printDevEntity.getEnCode(); + // 名称长度验证 + if(fullName.length() > 80){ + throw new Exception(MsgCode.EXIST005.get()); + } + QueryWrapper query = new QueryWrapper<>(); + //重名验证 + if(fullNameCheck){ + query.lambda().eq(PrintDevEntity::getFullName, fullName); + if (printDevMapper.selectList(query).size() > 0) { + throw new Exception(MsgCode.EXIST003.get()); + } + } + //编码验证 + if(encodeCheck){ + query.clear(); + query.lambda().eq(PrintDevEntity::getEnCode, encode); + if (printDevMapper.selectList(query).size() > 0) { + throw new Exception(MsgCode.EXIST002.get()); + } + } + } + + @Override + public List getPrintTemplateOptions(List ids) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().in(PrintDevEntity::getId,ids); + wrapper.lambda().eq(PrintDevEntity::getEnabledMark,1); + List list = this.getBaseMapper().selectList(wrapper); + List options = JsonUtil.getJsonToList(list, PrintOption.class); + return options; + } + + @SneakyThrows + @Override + public Map getDataMap(PrintDevEntity entity, String formId) { + Map printDataMap; + try { + printDataMap = this.getDataBySql( + entity.getDbLinkId(), + entity.getSqlTemplate().replaceAll("@formId", "'" + formId + "'")); + } catch (Exception e) { + throw new Exception(e.getMessage()); + } + List> headTableList = (List>) printDataMap.get("headTable"); + printDataMap.remove("headTable"); + for (Map map : headTableList) { + printDataMap.putAll(map); + } + Map dataMap = new HashMap<>(16); + dataMap.put("printData", JsonUtil.getJsonToBean(JsonUtil.getObjectToStringAsDate(printDataMap), Map.class)); + String printTemplate = entity.getPrintTemplate(); + printTemplate = "
"+printTemplate+"

"; + dataMap.put("printTemplate", printTemplate); + List operatorRecordList = this.getFlowTaskOperatorRecordList(formId); + dataMap.put("operatorRecordList", operatorRecordList); + return dataMap; + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/PrintLogServiceImpl.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/PrintLogServiceImpl.java new file mode 100644 index 0000000..8e75b15 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/PrintLogServiceImpl.java @@ -0,0 +1,12 @@ +package jnpf.base.service.impl; + +import jnpf.base.entity.PrintLogEntity; +import jnpf.base.mapper.PrintLogMapper; +import jnpf.base.service.PrintLogService; +import jnpf.base.service.SuperServiceImpl; +import org.springframework.stereotype.Service; + +@Service +public class PrintLogServiceImpl extends SuperServiceImpl implements PrintLogService { + +} \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ProvinceAtlasServiceImpl.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ProvinceAtlasServiceImpl.java new file mode 100644 index 0000000..d366054 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ProvinceAtlasServiceImpl.java @@ -0,0 +1,42 @@ +package jnpf.base.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import jnpf.base.entity.ProvinceAtlasEntity; +import jnpf.base.mapper.ProvinceAtlasMapper; +import jnpf.base.service.ProvinceAtlasService; +import jnpf.base.service.SuperServiceImpl; +import jnpf.util.StringUtil; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 行政区划 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月27日 上午9:18 + */ +@Service +public class ProvinceAtlasServiceImpl extends SuperServiceImpl implements ProvinceAtlasService { + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ProvinceAtlasEntity::getEnabledMark, 1); + return this.list(queryWrapper); + } + + @Override + public List getListByPid(String pid) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(pid)) { + queryWrapper.lambda().eq(ProvinceAtlasEntity::getParentId, pid); + }else{ + queryWrapper.lambda().eq(ProvinceAtlasEntity::getParentId, "-1"); + } + queryWrapper.lambda().eq(ProvinceAtlasEntity::getEnabledMark, 1); + return this.list(queryWrapper); + } +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ProvinceServiceImpl.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ProvinceServiceImpl.java new file mode 100644 index 0000000..9bb5ce9 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ProvinceServiceImpl.java @@ -0,0 +1,218 @@ +package jnpf.base.service.impl; + + +import jnpf.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import jnpf.base.Page; +import jnpf.base.entity.ProvinceEntity; +import jnpf.base.mapper.ProvinceMapper; +import jnpf.base.service.ProvinceService; +import jnpf.util.RandomUtil; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import org.springframework.util.ObjectUtils; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Objects; + +/** + * 行政区划 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Service +public class ProvinceServiceImpl extends SuperServiceImpl implements ProvinceService { + + @Autowired + private UserProvider userProvider; + + @Override + public boolean isExistByFullName(String fullName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ProvinceEntity::getFullName, fullName); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(ProvinceEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public boolean isExistByEnCode(String enCode, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ProvinceEntity::getEnCode, enCode); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(ProvinceEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public List getList(String parentId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ProvinceEntity::getParentId, parentId); + // 排序 + queryWrapper.lambda().orderByDesc(ProvinceEntity::getCreatorTime); + return this.list(queryWrapper); + } + + + @Override + public List getList(String parentId, Page page) { + // 定义变量判断是否需要使用修改时间倒序 + boolean flag = false; + QueryWrapper queryWrapper = new QueryWrapper<>(); + // 模糊查询 + if (Objects.nonNull(page) && StringUtil.isNotEmpty(page.getKeyword())) { + flag = true; + queryWrapper.lambda().and( + t->t.like(ProvinceEntity::getFullName, page.getKeyword()).or() + .like(ProvinceEntity::getEnCode, page.getKeyword()) + ); + } + queryWrapper.lambda().eq(ProvinceEntity::getParentId, parentId); + // 排序 + queryWrapper.lambda().orderByAsc(ProvinceEntity::getSortCode).orderByDesc(ProvinceEntity::getCreatorTime); + if (flag) { + queryWrapper.lambda().orderByDesc(ProvinceEntity::getLastModifyTime); + } + return this.list(queryWrapper); + } + + @Override + public List getAllList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().orderByDesc(ProvinceEntity::getSortCode).orderByAsc(ProvinceEntity::getCreatorTime); + + return this.list(queryWrapper); + } + + @Override + public List getProListBytype(String type) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select(ProvinceEntity::getId,ProvinceEntity::getFullName).eq(ProvinceEntity::getType,type); + return this.list(queryWrapper); + } + + @Override + public List getProList(List ProIdList) { + if (ProIdList.size()>0){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select(ProvinceEntity::getId,ProvinceEntity::getFullName).in(ProvinceEntity::getId,ProIdList); + return this.list(queryWrapper); + } + return new ArrayList<>(); + } + + + @Override + public ProvinceEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ProvinceEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public ProvinceEntity getInfo(String fullName,List parentId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ProvinceEntity::getFullName, fullName); + if (parentId.size() > 0) { + queryWrapper.lambda().in(ProvinceEntity::getParentId, parentId); + } + return this.getOne(queryWrapper); + } + + + @Override + public void delete(ProvinceEntity entity) { + this.removeById(entity.getId()); + } + + @Override + public void create(ProvinceEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(userProvider.get().getUserId()); + this.save(entity); + } + + @Override + public boolean update(String id, ProvinceEntity entity) { + + entity.setId(id); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(userProvider.get().getUserId()); + return this.updateById(entity); + } + + @Override + @DSTransactional + public boolean first(String id) { + boolean isOk = false; + //获取要上移的那条数据的信息 + ProvinceEntity upEntity = this.getById(id); + Long upSortCode = upEntity.getSortCode() == null ? 0 : upEntity.getSortCode(); + //查询上几条记录 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .lt(ProvinceEntity::getSortCode, upSortCode) + .eq(ProvinceEntity::getParentId, upEntity.getParentId()) + .orderByDesc(ProvinceEntity::getSortCode); + List downEntity = this.list(queryWrapper); + if (downEntity.size() > 0) { + //交换两条记录的sort值 + Long temp = upEntity.getSortCode(); + upEntity.setSortCode(downEntity.get(0).getSortCode()); + downEntity.get(0).setSortCode(temp); + updateById(downEntity.get(0)); + updateById(upEntity); + isOk = true; + } + return isOk; + } + + @Override + @DSTransactional + public boolean next(String id) { + boolean isOk = false; + //获取要下移的那条数据的信息 + ProvinceEntity downEntity = this.getById(id); + Long upSortCode = downEntity.getSortCode() == null ? 0 : downEntity.getSortCode(); + //查询下几条记录 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .gt(ProvinceEntity::getSortCode, upSortCode) + .eq(ProvinceEntity::getParentId, downEntity.getParentId()) + .orderByAsc(ProvinceEntity::getSortCode); + List upEntity = this.list(queryWrapper); + if (upEntity.size() > 0) { + //交换两条记录的sort值 + Long temp = downEntity.getSortCode(); + downEntity.setSortCode(upEntity.get(0).getSortCode()); + upEntity.get(0).setSortCode(temp); + updateById(upEntity.get(0)); + updateById(downEntity); + isOk = true; + } + return isOk; + } + + @Override + public List infoList(List lists) { + List list =new ArrayList<>(); + if(!ObjectUtils.isEmpty(lists)){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(ProvinceEntity::getId, lists); + list = this.list(queryWrapper); + } + return list; + + } +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ScheduleLogServiceImpl.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ScheduleLogServiceImpl.java new file mode 100644 index 0000000..9f74efa --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ScheduleLogServiceImpl.java @@ -0,0 +1,76 @@ +package jnpf.base.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import jnpf.base.UserInfo; +import jnpf.base.entity.ScheduleLogEntity; +import jnpf.base.mapper.ScheduleLogMapper; +import jnpf.base.service.ScheduleLogService; +import jnpf.base.service.SuperServiceImpl; +import jnpf.util.RandomUtil; +import jnpf.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * 日程 + * + * @author JNPF开发平台组 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + */ +@Service +public class ScheduleLogServiceImpl extends SuperServiceImpl implements ScheduleLogService { + + + @Autowired + private UserProvider userProvider; + + @Override + public List getListAll(List scheduleIdList) { + List list = new ArrayList<>(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + if(scheduleIdList.size()>0){ + queryWrapper.lambda().in(ScheduleLogEntity::getScheduleId,scheduleIdList); + queryWrapper.lambda().orderByDesc(ScheduleLogEntity::getCreatorTime); + list = this.list(queryWrapper); + } + return list; + } + + @Override + public ScheduleLogEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ScheduleLogEntity::getId,id); + return this.getOne(queryWrapper); + } + + @Override + public void create(ScheduleLogEntity entity) { + UserInfo userInfo = userProvider.get(); + entity.setId(RandomUtil.uuId()); + entity.setCreatorTime(new Date()); + entity.setCreatorUserId(userInfo.getUserId()); + this.save(entity); + } + + @Override + public void delete(List scheduleIdList, String operationType) { + List listAll = getListAll(scheduleIdList); + for (ScheduleLogEntity scheduleLogEntity : listAll) { + scheduleLogEntity.setOperationType(operationType); + create(scheduleLogEntity); + } + } + + @Override + public boolean update(String id, ScheduleLogEntity entity) { + entity.setId(id); + boolean flag = this.updateById(entity); + return flag; + } + + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ScheduleNewServiceImpl.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ScheduleNewServiceImpl.java new file mode 100644 index 0000000..3de60d6 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ScheduleNewServiceImpl.java @@ -0,0 +1,416 @@ +package jnpf.base.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import jnpf.base.UserInfo; +import jnpf.base.entity.ScheduleLogEntity; +import jnpf.base.entity.ScheduleNewEntity; +import jnpf.base.entity.ScheduleNewUserEntity; +import jnpf.base.mapper.ScheduleNewMapper; +import jnpf.base.model.schedule.ScheduleDetailModel; +import jnpf.base.model.schedule.ScheduleJobModel; +import jnpf.base.model.schedule.ScheduleNewTime; +import jnpf.base.service.ScheduleLogService; +import jnpf.base.service.ScheduleNewService; +import jnpf.base.service.ScheduleNewUserService; +import jnpf.base.service.SuperServiceImpl; +import jnpf.base.util.SentMessageUtil; +import jnpf.base.util.job.ScheduleJobUtil; +import jnpf.message.model.message.SentMessageForm; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.UserService; +import jnpf.util.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 日程 + * + * @author JNPF开发平台组 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + */ +@Service +public class ScheduleNewServiceImpl extends SuperServiceImpl implements ScheduleNewService { + + @Autowired + private ScheduleLogService scheduleLogService; + @Autowired + private UserProvider userProvider; + @Autowired + private SentMessageUtil sentMessageUtil; + @Autowired + private UserService userService; + @Autowired + private RedisUtil redisUtil; + @Autowired + private ScheduleNewUserService scheduleNewUserService; + @Autowired + private ScheduleJobUtil scheduleJobUtil; + + @Override + public List getList(ScheduleNewTime scheduleNewTime) { + List scheduleId = scheduleNewUserService.getList().stream().map(ScheduleNewUserEntity::getScheduleId).collect(Collectors.toList()); + if (scheduleId.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(ScheduleNewEntity::getId, scheduleId); + queryWrapper.lambda().orderByDesc(ScheduleNewEntity::getAllDay); + queryWrapper.lambda().orderByAsc(ScheduleNewEntity::getStartDay); + queryWrapper.lambda().orderByAsc(ScheduleNewEntity::getEndDay); + queryWrapper.lambda().orderByDesc(ScheduleNewEntity::getCreatorTime); + List result = this.list(queryWrapper); + return result; + } + + @Override + public List getList(String groupId, Date date) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(groupId)) { + queryWrapper.lambda().eq(ScheduleNewEntity::getGroupId, groupId); + } + if (ObjectUtil.isNotEmpty(date)) { + queryWrapper.lambda().ge(ScheduleNewEntity::getStartDay, date); + } + return this.list(queryWrapper); + } + + @Override + public List getStartDayList(String groupId, Date date) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(groupId)) { + queryWrapper.lambda().eq(ScheduleNewEntity::getGroupId, groupId); + } + if (ObjectUtil.isNotEmpty(date)) { + queryWrapper.lambda().le(ScheduleNewEntity::getStartDay, date); + } + queryWrapper.lambda().orderByDesc(ScheduleNewEntity::getStartDay); + return this.list(queryWrapper); + } + + + @Override + public List getListAll(Date date) { + if (date == null) { + date = new Date(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + Integer seconds = 10; + Date end = DateUtil.dateAddSeconds(date, seconds); + Date start = DateUtil.dateAddSeconds(date, -seconds); + queryWrapper.lambda().between(ScheduleNewEntity::getPushTime, start, end); + return this.list(queryWrapper); + } + + @Override + public ScheduleNewEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ScheduleNewEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public List getGroupList(ScheduleDetailModel detailModel) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + String id = detailModel.getId(); + String groupId = detailModel.getGroupId(); + if (StringUtil.isNotEmpty(id)) { + queryWrapper.lambda().eq(ScheduleNewEntity::getId, id); + } else { + queryWrapper.lambda().eq(ScheduleNewEntity::getGroupId, groupId); + } + queryWrapper.lambda().orderByAsc(ScheduleNewEntity::getStartDay); + return this.list(queryWrapper); + } + + @Override + @DSTransactional + public void create(ScheduleNewEntity entity, List toUserIds, String groupId, String operationType, List idList) { + UserInfo userInfo = userProvider.get(); + entity.setCreatorUserId(userInfo.getUserId()); + boolean isUser = toUserIds.contains(userInfo.getUserId()); + if (!isUser) { + toUserIds.add(userInfo.getUserId()); + } + time(entity); + long time = entity.getEndDay().getTime() - entity.getStartDay().getTime(); + //间隔时间 + List dataList = new ArrayList<>(); + List listAll = new ArrayList<>(); + DateUtil.getNextDate(0, String.valueOf(entity.getRepetition()), entity.getStartDay(), entity.getRepeatTime(), dataList); + for (Date date : dataList) { + ScheduleNewEntity scheduleEntity = JsonUtil.getJsonToBean(entity, ScheduleNewEntity.class); + scheduleEntity.setStartDay(date); + scheduleEntity.setEndDay(new Date(date.getTime() + time)); + boolean isReminderTime = scheduleEntity.getReminderTime() != -2; + Integer reminderTime = scheduleEntity.getReminderTime() > 0 ? scheduleEntity.getReminderTime() : 0; + scheduleEntity.setPushTime(isReminderTime ? DateUtil.dateAddMinutes(scheduleEntity.getStartDay(), -reminderTime) : null); + listAll.add(scheduleEntity); + } + List scheduleJobList = new ArrayList<>(); + String id=""; + for (int i = 0; i < listAll.size(); i++) { + String randomId = idList.size() > 0 && idList.size()-1 >= i ? idList.get(i) : RandomUtil.uuId(); + if(StringUtil.isEmpty(id)){ + id = randomId; + } + ScheduleNewEntity scheduleEntity = listAll.get(i); + scheduleEntity.setId(randomId); + scheduleEntity.setCreatorTime(new Date()); + scheduleEntity.setCreatorUserId(userInfo.getUserId()); + scheduleEntity.setGroupId(groupId); + scheduleEntity.setEnabledMark(1); + this.save(scheduleEntity); + for (String toUserId : toUserIds) { + ScheduleNewUserEntity userEntity = new ScheduleNewUserEntity(); + userEntity.setScheduleId(scheduleEntity.getId()); + userEntity.setToUserId(toUserId); + userEntity.setEnabledMark(1); + userEntity.setType(!isUser && userInfo.getUserId().equals(toUserId) ? "1" : "2"); + scheduleNewUserService.create(userEntity); + } + boolean isTime = ObjectUtil.isNotEmpty(scheduleEntity.getPushTime()) && scheduleEntity.getPushTime().getTime() >= System.currentTimeMillis(); + ScheduleJobModel jobModel = new ScheduleJobModel(); + jobModel.setId(scheduleEntity.getId()); + jobModel.setScheduleTime(scheduleEntity.getPushTime()); + jobModel.setUserInfo(userInfo); + jobModel.setUserList(toUserIds); + if (isTime) { + scheduleJobList.add(jobModel); + } + //操作日志 + ScheduleLogEntity logEntity = JsonUtil.getJsonToBean(entity, ScheduleLogEntity.class); + logEntity.setOperationType(operationType); + logEntity.setUserId(JsonUtil.getObjectToString(toUserIds)); + logEntity.setScheduleId(scheduleEntity.getId()); + scheduleLogService.create(logEntity); + } + if("1".equals(operationType)){ + ScheduleDetailModel model = new ScheduleDetailModel(); + model.setGroupId(groupId); + model.setId(id); + model.setType("2"); + msg(toUserIds, userInfo, model, entity, "PZXTRC001" , "2"); + } + //推送任务调度 + job(scheduleJobList); + } + + @Override + @DSTransactional + public boolean update(String id, ScheduleNewEntity entity, List toUserIds, String type) { + UserInfo userInfo = userProvider.get(); + ScheduleNewEntity info = getInfo(id); + boolean flag = false; + String groupId = RandomUtil.uuId(); + if (info != null) { + //删除一个还是多个 + String delGroupId = info.getGroupId(); + Date startDay = "2".equals(type) ? info.getStartDay() : null; + List deleteList = "1".equals(type) ? new ArrayList() {{ + add(info); + }} : getList(delGroupId, startDay); + repeat(type,info); + updateStartDay(delGroupId,type,startDay); + List scheduleIdList = deleteList.stream().map(ScheduleNewEntity::getId).collect(Collectors.toList()); + deleteScheduleList(scheduleIdList); + create(entity, toUserIds, groupId, "2",scheduleIdList); + ScheduleDetailModel detailModel = new ScheduleDetailModel(); + detailModel.setGroupId(groupId); + List groupList = getGroupList(detailModel); + ScheduleDetailModel model = new ScheduleDetailModel(); + model.setGroupId(groupId); + model.setId(groupList.size() > 0 ? groupList.get(0).getId() : id); + model.setType("2"); + entity.setSend(""); + msg(toUserIds, userInfo, model, entity, "PZXTRC002" , "2"); + flag = true; + } + return flag; + } + + + @Override + @DSTransactional + public void deleteScheduleList(List idList) { + if (idList.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(ScheduleNewEntity::getId, idList); + this.remove(queryWrapper); + scheduleNewUserService.deleteByScheduleId(idList); + scheduleLogService.delete(idList, "3"); + } + } + + @Override + public boolean update(String id, ScheduleNewEntity entity) { + entity.setId(id); + return updateById(entity); + } + + @Override + @DSTransactional + public void delete(ScheduleNewEntity entity, String type) { + if (entity != null) { + UserInfo userInfo = userProvider.get(); + String userId = userInfo.getUserId(); + String groupId = entity.getGroupId(); + String delGroupId = entity.getGroupId(); + Date startDay = "2".equals(type) ? entity.getStartDay() : null; + List deleteList = "1".equals(type) ? new ArrayList() {{ + add(entity); + }} : getList(delGroupId, startDay); + List scheduleIdList = deleteList.stream().map(ScheduleNewEntity::getId).collect(Collectors.toList()); + if (entity.getCreatorUserId().equals(userId)) { + repeat(type,entity); + List toUserIds = scheduleNewUserService.getList(entity.getId(), null).stream().map(ScheduleNewUserEntity::getToUserId).collect(Collectors.toList()); + deleteScheduleList(scheduleIdList); + ScheduleDetailModel model = new ScheduleDetailModel(); + model.setGroupId(groupId); + model.setId(entity.getId()); + model.setType("3"); + entity.setSend(""); + msg(toUserIds, userInfo, model, entity, "PZXTRC003" , "2"); + } else { + //操作日志 + scheduleLogService.delete(scheduleIdList, "4"); + scheduleNewUserService.deleteByUserId(scheduleIdList); +// ScheduleDetailModel model = new ScheduleDetailModel(); +// model.setGroupId(groupId); +// model.setId(entity.getId()); +// model.setType("3"); +// List toUserIds = new ArrayList(){{{{add(userId);}}}}; +// msg(toUserIds, userInfo, model, entity, "PZXTRC003" , "2"); + } + } + } + + @Override + public void scheduleMessage(ScheduleJobModel scheduleModel) { + ScheduleNewEntity info = getInfo(scheduleModel.getId()); + if (info != null) { + List listAll = new ArrayList<>(); + listAll.add(info); + for (ScheduleNewEntity entity : listAll) { + UserInfo userInfo = scheduleModel.getUserInfo(); + UserEntity userEntity = userService.getInfo(entity.getCreatorUserId()); + List toUserIds = scheduleNewUserService.getList(entity.getId(), null).stream().map(ScheduleNewUserEntity::getToUserId).collect(Collectors.toList()); + ScheduleDetailModel model = new ScheduleDetailModel(); + model.setGroupId(entity.getGroupId()); + model.setId(entity.getId()); + if (userEntity != null) { + userInfo.setUserId(userEntity.getId()); + userInfo.setUserName(userEntity.getRealName()); + } + model.setType("1"); + msg(toUserIds, userInfo, model, entity, "PZXTRC001" , "2"); + } + } + } + + private void time(ScheduleNewEntity entity) { + // 判断是否全天 + if (entity.getAllDay() != 1) { + String startDate = DateUtil.dateToString(entity.getStartDay(), "yyyy-MM-dd") + " " + entity.getStartTime() + ":00"; + Date star = DateUtil.stringToDate(startDate); + entity.setStartDay(star); + if (entity.getDuration() != -1) { + Date end = DateUtil.dateAddMinutes(entity.getStartDay(), entity.getDuration()); + entity.setEndDay(end); + } else { + String endDate = DateUtil.dateToString(entity.getEndDay(), "yyyy-MM-dd") + " " + entity.getEndTime() + ":00"; + Date end = DateUtil.stringToDate(endDate); + entity.setEndDay(end); + } + }else { + String startDate = DateUtil.dateToString(entity.getStartDay(), "yyyy-MM-dd") + " " + "00:00:00"; + Date star = DateUtil.stringToDate(startDate); + entity.setStartDay(star); + entity.setStartTime("00:00"); + String endDate = DateUtil.dateToString(entity.getEndDay(), "yyyy-MM-dd") + " " + "23:59:59"; + Date end = DateUtil.stringToDate(endDate); + entity.setEndDay(end); + entity.setEndTime("23:59"); + } + Date repeatTime = entity.getRepeatTime(); + if (repeatTime != null) { + String repeat = DateUtil.dateToString(repeatTime, "yyyy-MM-dd") + " " + "23:59:59"; + Date repeatDate = DateUtil.stringToDate(repeat); + entity.setRepeatTime(repeatDate); + } + } + + private void msg(List toUserIds, UserInfo userInfo, ScheduleDetailModel model, ScheduleNewEntity entity, String templateId, String type) { + Map parameterMap = new HashMap<>(); + parameterMap.put("@Title",entity.getTitle()); + parameterMap.put("@CreatorUserName",userInfo.getUserName()); + parameterMap.put("@Content",StringUtil.isNotEmpty(entity.getContent())?entity.getContent():""); + parameterMap.put("@StartDate",DateUtil.daFormat(entity.getStartDay())); + parameterMap.put("@StartTime",entity.getStartTime()); + parameterMap.put("@EndDate",DateUtil.daFormat(entity.getEndDay())); + parameterMap.put("@EndTime",entity.getEndTime()); + parameterMap.put("Title",entity.getTitle()); + parameterMap.put("CreatorUserName",userInfo.getUserName()); + parameterMap.put("Content",StringUtil.isNotEmpty(entity.getContent())?entity.getContent():""); + parameterMap.put("StartDate",DateUtil.daFormat(entity.getStartDay())); + parameterMap.put("StartTime",entity.getStartTime()); + parameterMap.put("EndDate",DateUtil.daFormat(entity.getEndDay())); + parameterMap.put("EndTime",entity.getEndTime()); + SentMessageForm sentMessageForm = new SentMessageForm(); + sentMessageForm.setToUserIds(toUserIds); + sentMessageForm.setUserInfo(userInfo); + sentMessageForm.setParameterMap(parameterMap); + sentMessageForm.setTitle(entity.getTitle()); + sentMessageForm.setTemplateId(StringUtil.isNotEmpty(entity.getSend()) ? entity.getSend() : templateId); + sentMessageForm.setContent(JsonUtil.getObjectToString(model)); + Map contentMsg = JsonUtil.entityToMaps(model); + sentMessageForm.setContentMsg(contentMsg); + sentMessageForm.setId(model.getId()); + sentMessageForm.setType(4); + sentMessageUtil.sendDelegateMsg(sentMessageForm); + } + + private void job(List scheduleJobList) { + scheduleJobUtil.insertRedis(scheduleJobList, redisUtil); + } + + private void updateStartDay(String groupId,String type,Date startDay){ + if("2".equals(type)) { + Date startData = DateUtil.stringToDate(DateUtil.dateToString(startDay, "yyyy-MM-dd") + " " + "00:00:00"); + List startDayList = getStartDayList(groupId, startData); + if(startDayList.size()>0){ + Date start = startDayList.get(0).getStartDay(); + for (ScheduleNewEntity entity : startDayList) { + Date repeatTime = entity.getRepeatTime(); + if (repeatTime != null) { + String repeat = DateUtil.dateToString(start, "yyyy-MM-dd") + " " + "23:59:59"; + Date repeatDate = DateUtil.stringToDate(repeat); + entity.setRepeatTime(repeatDate); + update(entity.getId(),entity); + } + } + } + } + } + + private void repeat(String type, ScheduleNewEntity info){ + Date repeat = info.getRepeatTime(); + String groupId = info.getGroupId(); + List typeList = new ArrayList(){{add("2");}}; + if (typeList.contains(type) && ObjectUtil.isNotEmpty(repeat)) { + List list = getList(groupId, null); + List collect = list.stream().filter(t -> t.getStartDay().getTime() < info.getStartDay().getTime()).sorted(Comparator.comparing(ScheduleNewEntity::getStartDay).reversed()).collect(Collectors.toList()); + for (int i = 0; i < collect.size(); i++) { + ScheduleNewEntity scheduleNewEntity = collect.get(i); + String dateString = DateUtil.getDateString(collect.get(0).getStartDay(), "yyyy-MM-dd") + " 23:59:59"; + Date repeatTime = DateUtil.stringToDate(dateString); + scheduleNewEntity.setRepeatTime(repeatTime); + update(scheduleNewEntity.getId(), scheduleNewEntity); + } + } + } +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ScheduleNewUserServiceImpl.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ScheduleNewUserServiceImpl.java new file mode 100644 index 0000000..44b0c89 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/ScheduleNewUserServiceImpl.java @@ -0,0 +1,78 @@ +package jnpf.base.service.impl; + +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import jnpf.base.UserInfo; +import jnpf.base.entity.ScheduleNewUserEntity; +import jnpf.base.mapper.ScheduleNewUserMapper; +import jnpf.base.service.ScheduleNewUserService; +import jnpf.base.service.SuperServiceImpl; +import jnpf.util.RandomUtil; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 日程 + * + * @author JNPF开发平台组 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + */ +@Service +public class ScheduleNewUserServiceImpl extends SuperServiceImpl implements ScheduleNewUserService { + + @Autowired + private UserProvider userProvider; + + + @Override + public List getList(String scheduleId,String type) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ScheduleNewUserEntity::getScheduleId, scheduleId); + if(StringUtil.isNotEmpty(type)){ + queryWrapper.lambda().eq(ScheduleNewUserEntity::getType, type); + } + return this.list(queryWrapper); + } + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ScheduleNewUserEntity::getToUserId, userProvider.get().getUserId()); + queryWrapper.lambda().eq(ScheduleNewUserEntity::getEnabledMark, 1); + return this.list(queryWrapper); + } + + @Override + public void create(ScheduleNewUserEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(userProvider.get().getUserId()); + this.save(entity); + } + + @Override + @DSTransactional + public void deleteByScheduleId(List scheduleIdList) { + if (scheduleIdList.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(ScheduleNewUserEntity::getScheduleId, scheduleIdList); + this.remove(queryWrapper); + } + } + + @Override + public void deleteByUserId(List scheduleIdList) { + UserInfo userInfo = userProvider.get(); + if (scheduleIdList.size() > 0) { + UpdateWrapper updateWrapper = new UpdateWrapper<>(); + updateWrapper.lambda().eq(ScheduleNewUserEntity::getToUserId, userInfo.getUserId()); + updateWrapper.lambda().in(ScheduleNewUserEntity::getScheduleId, scheduleIdList); + updateWrapper.lambda().set(ScheduleNewUserEntity::getEnabledMark, 0); + this.update(updateWrapper); + } + } +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/SignServiceImpl.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/SignServiceImpl.java new file mode 100644 index 0000000..182921b --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/SignServiceImpl.java @@ -0,0 +1,93 @@ +package jnpf.base.service.impl; + + +import jnpf.base.mapper.SignMapper; +import jnpf.base.service.SignService; +import jnpf.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import jnpf.permission.entity.SignEntity; +import jnpf.util.RandomUtil; +import jnpf.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 个人签名 + * + * @author JNPF开发平台组 + * @copyright 引迈信息技术有限公司 + * @date 2022年9月2日 上午9:18 + */ +@Service +public class SignServiceImpl extends SuperServiceImpl implements SignService { + + @Autowired + private UserProvider userProvider; + + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SignEntity::getCreatorUserId, userProvider.get().getUserId()) + .orderByDesc(SignEntity::getCreatorTime); + + return this.list(queryWrapper); + } + + + @Override + public boolean create(SignEntity entity) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SignEntity::getIsDefault, 1) + .eq(SignEntity::getCreatorUserId, userProvider.get().getUserId()); + SignEntity signEntity = this.getOne(queryWrapper); + if (entity.getIsDefault() == 0) { + if (signEntity == null) { + entity.setIsDefault(1); + } + } else { + if (signEntity != null) { + signEntity.setIsDefault(0); + this.updateById(signEntity); + } + } + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(userProvider.get().getUserId()); + return this.save(entity); + } + + + @Override + public boolean delete(String id) { + return this.removeById(id); + } + + + @Override + public boolean updateDefault(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SignEntity::getIsDefault, 1).eq(SignEntity::getCreatorUserId, userProvider.get().getUserId()); + SignEntity signEntity = this.getOne(queryWrapper); + if (signEntity != null) { + signEntity.setIsDefault(0); + this.updateById(signEntity); + } + SignEntity entity = this.getById(id); + if (entity != null) { + entity.setIsDefault(1); + return this.updateById(entity); + } + return false; + } + + + @Override + public SignEntity getDefaultByUserId(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SignEntity::getIsDefault, 1).eq(SignEntity::getCreatorUserId, id); + return this.getOne(queryWrapper); + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/SmsTemplateServiceImpl.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/SmsTemplateServiceImpl.java new file mode 100644 index 0000000..178e852 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/SmsTemplateServiceImpl.java @@ -0,0 +1,134 @@ +package jnpf.base.service.impl; + +import jnpf.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import jnpf.base.Pagination; +import jnpf.base.entity.SmsTemplateEntity; +import jnpf.base.entity.SysConfigEntity; +import jnpf.base.mapper.SmsTemplateMapper; +import jnpf.base.model.systemconfig.SmsModel; +import jnpf.base.service.SmsTemplateService; +import jnpf.base.service.SysconfigService; +import jnpf.util.JsonUtil; +import jnpf.util.RandomUtil; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** +* @author Administrator +* @description 针对表【base_sms_template】的数据库操作Service实现 +* @createDate 2021-12-09 10:12:52 +*/ +@Service +public class SmsTemplateServiceImpl extends SuperServiceImpl implements SmsTemplateService { + + @Autowired + private UserProvider userProvider; + @Autowired + private SysconfigService sysconfigService; + + @Override + public List getList(String keyword) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SmsTemplateEntity::getEnabledMark, 1); + if (!StringUtil.isEmpty(keyword)) { + queryWrapper.lambda().and( + t -> t.like(SmsTemplateEntity::getTemplateId, keyword) + .or().like(SmsTemplateEntity::getFullName, keyword) + .or().like(SmsTemplateEntity::getEnCode, keyword) + ); + } + queryWrapper.lambda().orderByDesc(SmsTemplateEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getList(Pagination pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (!StringUtil.isEmpty(pagination.getKeyword())) { + queryWrapper.lambda().and( + t -> t.like(SmsTemplateEntity::getTemplateId, pagination.getKeyword()) + .or().like(SmsTemplateEntity::getFullName, pagination.getKeyword()) + .or().like(SmsTemplateEntity::getEnCode, pagination.getKeyword()) + ); + } + queryWrapper.lambda().orderByDesc(SmsTemplateEntity::getCreatorTime); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage userPage = this.page(page, queryWrapper); + return pagination.setData(userPage.getRecords(), page.getTotal()); + } + + @Override + public SmsTemplateEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SmsTemplateEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(SmsTemplateEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(userProvider.get().getUserId()); + this.save(entity); + } + + @Override + public boolean update(String id, SmsTemplateEntity entity) { + entity.setId(id); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(userProvider.get().getUserId()); + return this.updateById(entity); + } + + @Override + public void delete(SmsTemplateEntity entity) { + this.removeById(entity.getId()); + } + + @Override + public boolean isExistByTemplateName(String templateName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SmsTemplateEntity::getFullName, templateName); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(SmsTemplateEntity::getId, id); + } + return this.count(queryWrapper) > 0; + } + + @Override + public boolean isExistByEnCode(String enCode, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SmsTemplateEntity::getEnCode, enCode); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(SmsTemplateEntity::getId, id); + } + return this.count(queryWrapper) > 0; + } + + @Override + public SmsModel getSmsConfig() { + // 得到系统配置 + List configList = sysconfigService.getList("SysConfig"); + Map objModel = new HashMap<>(16); + for (SysConfigEntity entity : configList) { + objModel.put(entity.getFkey(), entity.getValue()); + } + SmsModel smsModel = JsonUtil.getJsonToBean(objModel, SmsModel.class); + return smsModel; + } + +} + + + + diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/SysconfigServiceImpl.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/SysconfigServiceImpl.java new file mode 100644 index 0000000..5ba80d4 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/SysconfigServiceImpl.java @@ -0,0 +1,166 @@ +package jnpf.base.service.impl; + + +import jnpf.base.model.MailAccount; +import jnpf.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import jnpf.base.entity.EmailConfigEntity; +import jnpf.base.entity.SysConfigEntity; +import jnpf.base.mapper.SysconfigMapper; +import jnpf.base.service.SysconfigService; +import jnpf.model.BaseSystemInfo; +import jnpf.base.util.*; +import jnpf.util.CacheKeyUtil; +import jnpf.util.JsonUtil; +import jnpf.util.RedisUtil; +import jnpf.util.context.SpringContext; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 系统配置 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Service +public class SysconfigServiceImpl extends SuperServiceImpl implements SysconfigService { + + @Autowired + private RedisUtil redisUtil; + @Autowired + private CacheKeyUtil cacheKeyUtil; + @Autowired + private Pop3Util pop3Util; + + @Override + public List getList(String type) { + List list =new ArrayList<>(); + if("WeChat".equals(type)){ + String cacheKey = cacheKeyUtil.getWechatConfig(); + if (redisUtil.exists(cacheKey)) { + list = JsonUtil.getJsonToList(String.valueOf(redisUtil.getString(cacheKey)), SysConfigEntity.class); + } else { + QueryWrapper queryWrapper = new QueryWrapper<>(); + list = this.list(queryWrapper).stream().filter(t->"QYHConfig".equals(t.getCategory())||"MPConfig".equals(t.getCategory())).collect(Collectors.toList()); + redisUtil.insert(cacheKey, JsonUtil.getObjectToString(list)); + } + } + if("SysConfig".equals(type)){ + String cacheKey = cacheKeyUtil.getSystemInfo(); + if (redisUtil.exists(cacheKey)) { + list = JsonUtil.getJsonToList(String.valueOf(redisUtil.getString(cacheKey)), SysConfigEntity.class); + } else { + QueryWrapper queryWrapper = new QueryWrapper<>(); + list = this.list(queryWrapper).stream().filter(t->!"QYHConfig".equals(t.getCategory())&&!"MPConfig".equals(t.getCategory())).collect(Collectors.toList()); + redisUtil.insert(cacheKey, JsonUtil.getObjectToString(list)); + } + } + return list; + } + + @Override + public BaseSystemInfo getWeChatInfo() { + Map objModel = new HashMap<>(16); + List list = this.getList("WeChat"); + for (SysConfigEntity entity : list) { + objModel.put(entity.getFkey(), entity.getValue()); + } + BaseSystemInfo baseSystemInfo = JsonUtil.getJsonToBean(objModel, BaseSystemInfo.class); + return baseSystemInfo; + } + @Override + public BaseSystemInfo getSysInfo() { + Map objModel = new HashMap<>(16); + List list = this.getList("SysConfig"); + for (SysConfigEntity entity : list) { + objModel.put(entity.getFkey(), entity.getValue()); + } + BaseSystemInfo baseSystemInfo = JsonUtil.getJsonToBean(objModel, BaseSystemInfo.class); + return baseSystemInfo; + } + + @Override + @DSTransactional + public void save(List entitys) { + String cacheKey = cacheKeyUtil.getSystemInfo(); + redisUtil.remove(cacheKey); + this.baseMapper.deleteFig(); + for (SysConfigEntity entity: entitys) { + entity.setCategory("SysConfig"); + this.baseMapper.insert(entity); + } + getSysInfo(); + } + @Override + @DSTransactional + public boolean saveMp(List entitys){ + String cacheKey = cacheKeyUtil.getWechatConfig(); + int flag=0; + redisUtil.remove(cacheKey); + this.baseMapper.deleteMpFig(); + for (SysConfigEntity entity: entitys) { + entity.setCategory("MPConfig"); + if(this.baseMapper.insert(entity)>0){ + flag++; + } + } + if(entitys.size()==flag){ + return true; + } + return false; + } + @Override + @DSTransactional + public void saveQyh(List entitys){ + String cacheKey = cacheKeyUtil.getWechatConfig(); + redisUtil.remove(cacheKey); + this.baseMapper.deleteQyhFig(); + for (SysConfigEntity entity: entitys) { + entity.setCategory("QYHConfig"); + this.baseMapper.insert(entity); + } + } + + @Override + public String checkLogin(EmailConfigEntity configEntity) { + MailAccount mailAccount = new MailAccount(); + mailAccount.setAccount(configEntity.getAccount()); + mailAccount.setPassword(configEntity.getPassword()); + mailAccount.setPop3Host(configEntity.getPop3Host()); + mailAccount.setPop3Port(configEntity.getPop3Port()); + mailAccount.setSmtpHost(configEntity.getSmtpHost()); + mailAccount.setSmtpPort(configEntity.getSmtpPort()); + if ("1".equals(String.valueOf(configEntity.getEmailSsl()))) { + mailAccount.setSsl(true); + } else { + mailAccount.setSsl(false); + } + if (mailAccount.getSmtpHost() != null) { + return SmtpUtil.checkConnected(mailAccount); + } + if (mailAccount.getPop3Host() != null) { + return pop3Util.checkConnected(mailAccount); + } + return "false"; + } + + @Override + public String getValueByKey(String keyStr) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SysConfigEntity::getFkey,keyStr); + SysConfigEntity sysConfigEntity = getOne(queryWrapper); + return sysConfigEntity.getValue(); + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/SystemServiceImpl.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/SystemServiceImpl.java new file mode 100644 index 0000000..c74766f --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/SystemServiceImpl.java @@ -0,0 +1,227 @@ +package jnpf.base.service.impl; + +import jnpf.base.UserInfo; +import jnpf.base.model.base.SystemBaeModel; +import jnpf.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import jnpf.base.entity.*; +import jnpf.base.mapper.SystemMapper; +import jnpf.base.service.*; +import jnpf.constant.JnpfConst; +import jnpf.constant.PermissionConst; +import jnpf.permission.entity.OrganizeAdministratorEntity; +import jnpf.permission.entity.PermissionGroupEntity; +import jnpf.permission.service.AuthorizeService; +import jnpf.permission.service.OrganizeAdministratorService; +import jnpf.permission.service.PermissionGroupService; +import jnpf.util.JsonUtil; +import jnpf.util.RandomUtil; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 系统 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Service +public class SystemServiceImpl extends SuperServiceImpl implements SystemService { + + @Autowired + private UserProvider userProvider; + @Autowired + private ModuleService moduleService; + @Autowired + private AuthorizeService authorizeApi; + @Autowired + private OrganizeAdministratorService organizeAdminTratorApi; + @Autowired + private PermissionGroupService permissionGroupApi; + + @Override + public List getList(String keyword, Boolean filterEnableMark, Boolean filterMain) { + return getList(keyword, filterEnableMark, false, filterMain, false); + } + + @Override + public List getList(String keyword, Boolean filterEnableMark, boolean verifyAuth, Boolean filterMain, boolean isList) { + List systemIds = new ArrayList<>(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + // 是否为列表,特殊处理 + if (isList) { + // 获取系统菜单 + List listByUserId = organizeAdminTratorApi.getOrganizeAdministratorEntity(UserProvider.getLoginUserId(), PermissionConst.SYSTEM, false); + List systemEntities = this.getListByIds(listByUserId.stream().map(OrganizeAdministratorEntity::getOrganizeId).collect(Collectors.toList())); + systemIds.addAll(systemEntities.stream().map(SystemEntity::getId).collect(Collectors.toList())); + } + if (StringUtil.isNotEmpty(keyword)) { + queryWrapper.lambda().and(t -> + t.like(SystemEntity::getFullName, keyword).or().like(SystemEntity::getEnCode, keyword) + ); + } + if (filterEnableMark) { + queryWrapper.lambda().eq(SystemEntity::getEnabledMark, 1); + } + if (verifyAuth) { + List currentUserSystem = getCurrentUserSystem(userProvider.get()); + if (currentUserSystem.size() == 0) { + return new ArrayList<>(); + } + systemIds.addAll(currentUserSystem); + queryWrapper.lambda().in(SystemEntity::getId, systemIds); + } + // 过滤掉开发平台 + if (filterMain != null && filterMain) { + queryWrapper.lambda().ne(SystemEntity::getEnCode, JnpfConst.MAIN_SYSTEM_CODE); + } + queryWrapper.lambda().orderByAsc(SystemEntity::getSortCode).orderByDesc(SystemEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getCurrentUserSystem(UserInfo userInfo) { + List systemList = new ArrayList<>(16); + if (!userInfo.getIsAdministrator()) { + List roleIds = permissionGroupApi.getPermissionGroupByUserId(userInfo.getUserId(), null, false) + .stream().map(PermissionGroupEntity::getId).collect(Collectors.toList()); + if (roleIds.size() > 0) { + systemList = authorizeApi.findSystem(roleIds); + } + } else { + List systemLists = this.getList(null, false, false); + systemList = JsonUtil.getJsonToList(systemLists, SystemBaeModel.class); + } + SystemEntity entity = this.getInfo(userInfo.getSystemId()); + if (entity != null) { + SystemBaeModel jsonToBean = JsonUtil.getJsonToBean(entity, SystemBaeModel.class); + SystemBaeModel systemBaeModel = systemList.stream().filter(t -> t.getId().equals(jsonToBean.getId())).findFirst().orElse(null); + if (systemBaeModel == null) { + systemList.add(jsonToBean); + } + } + return systemList.stream().map(SystemBaeModel::getId).collect(Collectors.toList()); + } + + @Override + public SystemEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SystemEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public Boolean isExistFullName(String id, String fullName) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SystemEntity::getFullName, fullName); + if (StringUtil.isNotEmpty(id)) { + queryWrapper.lambda().ne(SystemEntity::getId, id); + } + return this.count(queryWrapper) > 0; + } + + @Override + public Boolean isExistEnCode(String id, String enCode) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SystemEntity::getEnCode, enCode); + if (StringUtil.isNotEmpty(id)) { + queryWrapper.lambda().ne(SystemEntity::getId, id); + } + return this.count(queryWrapper) > 0; + } + + @Override + @Transactional + public Boolean create(SystemEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setIsMain(0); + entity.setCreatorUserId(userProvider.get().getUserId()); + entity.setCreatorTime(new Date()); + boolean save = this.save(entity); + if (!userProvider.get().getIsAdministrator() && save) { + // 当前用户创建的组织要赋予权限 + OrganizeAdministratorEntity organizeAdministratorEntity = new OrganizeAdministratorEntity(); + organizeAdministratorEntity.setUserId(userProvider.get().getUserId()); + organizeAdministratorEntity.setOrganizeId(entity.getId()); + organizeAdministratorEntity.setOrganizeType(PermissionConst.SYSTEM); + organizeAdminTratorApi.save(organizeAdministratorEntity); + } + return save; + } + + @Override + @Transactional + public Boolean update(String id, SystemEntity entity) { + entity.setId(id); + if (entity.getIsMain() == null) { + entity.setIsMain(0); + } + entity.setLastModifyUserId(userProvider.get().getUserId()); + entity.setLastModifyTime(new Date()); + return this.updateById(entity); + } + + @Override + @Transactional + public Boolean delete(String id) { + moduleService.deleteBySystemId(id); + return this.removeById(id); + } + + @Override + public List getListByIds(List list) { + List systemList = new ArrayList<>(16); + if (list.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(SystemEntity::getId, list); + queryWrapper.lambda().eq(SystemEntity::getEnabledMark, 1); + queryWrapper.lambda().orderByAsc(SystemEntity::getSortCode).orderByDesc(SystemEntity::getCreatorTime); + return this.list(queryWrapper); + } + return systemList; + } + + @Override + public SystemEntity getMainSystem() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SystemEntity::getIsMain, 1); + List list = this.list(queryWrapper); + if (list.size() > 0) { + return list.get(0); + } + List list1 = getList(null, true, false); + if (list1.size() > 0) { + return list1.get(0); + } + return new SystemEntity(); + } + + @Override + public List getMainSys(List systemIds) { + if (systemIds.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(SystemEntity::getId, systemIds); + queryWrapper.lambda().eq(SystemEntity::getIsMain, 1); + return this.list(queryWrapper); + } + + @Override + public SystemEntity getInfoByEnCode(String enCode) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SystemEntity::getEnCode, enCode); + return this.getOne(queryWrapper); + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/UserOnlineServiceImpl.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/UserOnlineServiceImpl.java new file mode 100644 index 0000000..354009a --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/service/impl/UserOnlineServiceImpl.java @@ -0,0 +1,72 @@ +package jnpf.base.service.impl; + + +import jnpf.base.Page; +import jnpf.base.UserInfo; +import jnpf.base.service.UserOnlineService; +import jnpf.message.model.UserOnlineModel; +import jnpf.base.util.*; +import jnpf.util.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 在线用户 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +@Service +public class UserOnlineServiceImpl implements UserOnlineService { + + @Autowired + private RedisUtil redisUtil; + @Autowired + private UserProvider userProvider; + @Autowired + private CacheKeyUtil cacheKeyUtil; + + @Override + public List getList(Page page) { + List userOnlineList = new ArrayList<>(); + List tokens = UserProvider.getLoginUserListToken(); + for (String token : tokens) { + UserInfo userInfo = UserProvider.getUser(token); + if(userInfo.getId() != null){ + if(UserProvider.isTempUser(userInfo)){ + //临时用户不显示 + continue; + } + UserOnlineModel userOnlineModel = new UserOnlineModel(); + userOnlineModel.setUserId(userInfo.getUserId()); + userOnlineModel.setUserName((userInfo.getUserName()) + "/" + userInfo.getUserAccount()); + userOnlineModel.setLoginIPAddress(userInfo.getLoginIpAddress()); + userOnlineModel.setLoginTime(userInfo.getLoginTime()); + userOnlineModel.setLoginPlatForm(userInfo.getLoginPlatForm()); + userOnlineModel.setTenantId(userInfo.getTenantId()); + userOnlineModel.setToken(token); + userOnlineModel.setDevice(userInfo.getLoginDevice()); + userOnlineList.add(userOnlineModel); + } + } + String tenantId =userProvider.get().getTenantId(); + userOnlineList = userOnlineList.stream().filter(t -> String.valueOf(t.getTenantId()).equals(String.valueOf(tenantId))).collect(Collectors.toList()); + if(!StringUtil.isEmpty(page.getKeyword())){ + userOnlineList=userOnlineList.stream().filter(t->t.getUserName().contains(page.getKeyword())).collect(Collectors.toList()); + } + userOnlineList.sort(Comparator.comparing(UserOnlineModel::getLoginTime).reversed()); + return userOnlineList; + } + + @Override + public void delete(String... token) { + AuthUtil.kickoutByToken(token); + } +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/AnnotationType.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/AnnotationType.java new file mode 100644 index 0000000..f302885 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/AnnotationType.java @@ -0,0 +1,32 @@ +package jnpf.base.util; + +import lombok.Data; + +/** + * 数据接口支持注解类型 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Data +public class AnnotationType { + /** + * USER 当前登陆者id + */ + public static final String USER = "@user"; + /** + * 当前登陆者部门id + */ + public static final String DEPARTMENT = "@department"; + /** + * 当前登陆者组织id + */ + public static final String ORGANIZE = "@organize"; + /** + * 当前登录者岗位id + */ + public static final String POSTION = "@postion"; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/ClassUtil.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/ClassUtil.java new file mode 100644 index 0000000..0ff0d79 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/ClassUtil.java @@ -0,0 +1,62 @@ +package jnpf.base.util; + + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.lang.reflect.Field; +import java.util.HashMap; +import java.util.Set; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +public class ClassUtil { + + private static void getProxyPojoValue(Object object, Set key1){ + String id = null; + // 返回参数 + HashMap hashMap = new HashMap<>(16); + for (String s : key1) { + Field[] fields = object.getClass().getDeclaredFields(); + for (Field field : fields) { + field.setAccessible(true); + + // 获取表名 + TableName table = object.getClass().getAnnotation(TableName.class); + if (table != null) { + String tableName = table.value(); + hashMap.putIfAbsent("tableName", tableName); + } + // 获取主键id + if (id == null) { + boolean isIdField = field.isAnnotationPresent(TableId.class); + if (isIdField) { + TableField tableField = field.getAnnotation(TableField.class); + if (s.toLowerCase().equals(field.getName().toLowerCase())) { + String tableId = tableField.value(); + hashMap.put(s,tableId); + id = tableId; + } + } + } + + // 获取字段的值 + boolean isTableField = field.isAnnotationPresent(TableField.class); + if (isTableField) { + TableField tableField = field.getAnnotation(TableField.class); + if (s.toLowerCase().equals(field.getName().toLowerCase())) { + String fieldValue = tableField.value(); + hashMap.put(s,fieldValue); + } + } + } + } + System.out.println(hashMap); + } +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/DataInterfaceParamUtil.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/DataInterfaceParamUtil.java new file mode 100644 index 0000000..1a62442 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/DataInterfaceParamUtil.java @@ -0,0 +1,38 @@ +package jnpf.base.util; + + +import jnpf.base.model.datainterface.DataInterfaceMarkModel; + +import java.util.Map; + +public class DataInterfaceParamUtil { + + /** + * 获取指定字符串所在的位置及应该赋予的值 + * + * @param map 位置、值 + * @param str 字符串 + * @param specifyString 指定字符串 + * @param value 值 + * @return + */ + public static Map getParamModel(Map map, String str, String specifyString, Object value) { + int frontLength = 0; + while (str.contains(specifyString)) { + int index = str.indexOf(specifyString); + boolean flag = false; + Double aDouble = new Double(index + frontLength + 1); + while (!flag) { + if (map.containsKey(aDouble)) { + aDouble += 0.0001; + } else { + map.put(aDouble, new DataInterfaceMarkModel(specifyString, value)); + flag = true; + } + } + frontLength += (index + specifyString.length()); + str = str.substring(index + specifyString.length()); + } + return map; + } +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/FileManageUtil.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/FileManageUtil.java new file mode 100644 index 0000000..8b1642f --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/FileManageUtil.java @@ -0,0 +1,70 @@ +package jnpf.base.util; + +import jnpf.config.ConfigValueUtil; +import jnpf.model.FileModel; +import jnpf.util.FileUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Component +public class FileManageUtil { + + @Autowired + private ConfigValueUtil configValueUtil; + + // 添加附件:将临时文件夹的文件拷贝到正式文件夹里面 + + /** + * 添加附件:将临时文件夹的文件拷贝到正式文件夹里面 + * @param data list集合 + */ + public void createFile(List data) { + if (data != null && data.size() > 0) { + String temporaryFilePath = configValueUtil.getTemporaryFilePath(); + String systemFilePath = configValueUtil.getSystemFilePath(); + for (FileModel item : data) { + FileUtil.copyFile(temporaryFilePath + item.getFileId(), systemFilePath + item.getFileId()); + } + } + } + + /** + * 更新附件 + * @param data list集合 + */ + public void updateFile(List data) { + if (data != null && data.size() > 0) { + String temporaryFilePath = configValueUtil.getTemporaryFilePath(); + String systemFilePath = configValueUtil.getSystemFilePath(); + for (FileModel item : data) { + if ("add".equals(item.getFileType())) { + FileUtil.copyFile(temporaryFilePath + item.getFileId(), systemFilePath + item.getFileId()); + } else if ("delete".equals(item.getFileType())) { + FileUtil.deleteFile(systemFilePath + item.getFileId()); + } + } + } + } + + /** + * 删除附件 + * @param data list集合 + */ + public void deleteFile(List data) { + if (data != null && data.size() > 0) { + String systemFilePath = configValueUtil.getSystemFilePath(); + for (FileModel item : data) { + FileUtil.deleteFile(systemFilePath + item.getFileId()); + } + } + } +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/MonitorUtil.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/MonitorUtil.java new file mode 100644 index 0000000..cbd21fe --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/MonitorUtil.java @@ -0,0 +1,198 @@ +package jnpf.base.util; + +import cn.hutool.core.date.BetweenFormatter; +import cn.hutool.core.date.DateUtil; +import jnpf.base.model.monitor.*; +import jnpf.util.IpUtil; +import lombok.Data; +import oshi.SystemInfo; +import oshi.hardware.CentralProcessor; +import oshi.hardware.GlobalMemory; +import oshi.hardware.HardwareAbstractionLayer; +import oshi.software.os.FileSystem; +import oshi.software.os.OSFileStore; +import oshi.software.os.OperatingSystem; +import oshi.util.FormatUtil; +import oshi.util.Util; + +import java.lang.management.ManagementFactory; +import java.net.InetAddress; +import java.net.NetworkInterface; +import java.text.DecimalFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.Enumeration; +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class MonitorUtil { + + private static final DecimalFormat DECIMAL_FORMAT = new DecimalFormat("0.00"); + private CpuModel cpu = null; + private DiskModel disk = null; + private MemoryModel memory = null; + private SwapModel swap = null; + private SystemModel system = null; + + public MonitorUtil() { + SystemInfo si = new SystemInfo(); + OperatingSystem os = si.getOperatingSystem(); + HardwareAbstractionLayer hal = si.getHardware(); + this.cpu = getCpuInfo(hal.getProcessor()); + this.memory = getMemoryInfo(hal.getMemory()); + this.disk = getDiskInfo(os); + this.system = getSystemInfo(os); + this.swap = getSwapInfo(hal.getMemory()); + } + + /** + * 获取磁盘信息 + * + * @return / + */ + private DiskModel getDiskInfo(OperatingSystem os) { + DiskModel diskInfo = new DiskModel(); + FileSystem fileSystem = os.getFileSystem(); + List fsArray = fileSystem.getFileStores(); + long total = 0L; + long available = 0L; + long used = 0L; + for (OSFileStore fs : fsArray) { + total += fs.getTotalSpace(); + available += fs.getUsableSpace(); + } + used = total - available; + diskInfo.setTotal(FormatUtil.formatBytes(total)); + diskInfo.setAvailable(FormatUtil.formatBytes(available)); + diskInfo.setUsed(FormatUtil.formatBytes(used)); + diskInfo.setUsageRate(DECIMAL_FORMAT.format(used / (double) total * 100)); + return diskInfo; + } + + /** + * 获取交换区信息 + * + * @param memory / + * @return / + */ + private SwapModel getSwapInfo(GlobalMemory memory) { + SwapModel swapInfo = new SwapModel(); + swapInfo.setTotal(FormatUtil.formatBytes(memory.getVirtualMemory().getSwapTotal())); + swapInfo.setAvailable(FormatUtil.formatBytes(memory.getVirtualMemory().getSwapTotal() - memory.getVirtualMemory().getSwapUsed())); + swapInfo.setUsageRate(DECIMAL_FORMAT.format(memory.getVirtualMemory().getSwapUsed() / (double) memory.getVirtualMemory().getSwapTotal() * 100)); + swapInfo.setUsed(FormatUtil.formatBytes(memory.getVirtualMemory().getSwapUsed())); + return swapInfo; + } + + /** + * 获取内存信息 + * + * @param memory / + * @return / + */ + private MemoryModel getMemoryInfo(GlobalMemory memory) { + MemoryModel memoryInfo = new MemoryModel(); + memoryInfo.setTotal(FormatUtil.formatBytes(memory.getTotal())); + memoryInfo.setAvailable(FormatUtil.formatBytes(memory.getAvailable())); + memoryInfo.setUsed(FormatUtil.formatBytes(memory.getTotal() - memory.getAvailable())); + memoryInfo.setUsageRate(DECIMAL_FORMAT.format((memory.getTotal() - memory.getAvailable()) / (double) memory.getTotal() * 100)); + return memoryInfo; + } + + /** + * 获取Cpu相关信息 + * + * @param processor / + * @return / + */ + private CpuModel getCpuInfo(CentralProcessor processor) { + CpuModel cpuInfo = new CpuModel(); + cpuInfo.setName(processor.getProcessorIdentifier().getName()); + cpuInfo.setPackageName(processor.getPhysicalPackageCount() + "个物理CPU"); + cpuInfo.setCore(processor.getPhysicalProcessorCount() + "个物理核心"); + cpuInfo.setCoreNumber(processor.getPhysicalProcessorCount()); + cpuInfo.setLogic(processor.getLogicalProcessorCount() + "个逻辑CPU"); + // CPU信息 + long[] prevTicks = processor.getSystemCpuLoadTicks(); + // 等待1秒... + Util.sleep(1000); + long[] ticks = processor.getSystemCpuLoadTicks(); + long user = ticks[CentralProcessor.TickType.USER.getIndex()] - prevTicks[CentralProcessor.TickType.USER.getIndex()]; + long nice = ticks[CentralProcessor.TickType.NICE.getIndex()] - prevTicks[CentralProcessor.TickType.NICE.getIndex()]; + long sys = ticks[CentralProcessor.TickType.SYSTEM.getIndex()] - prevTicks[CentralProcessor.TickType.SYSTEM.getIndex()]; + long idle = ticks[CentralProcessor.TickType.IDLE.getIndex()] - prevTicks[CentralProcessor.TickType.IDLE.getIndex()]; + long iowait = ticks[CentralProcessor.TickType.IOWAIT.getIndex()] - prevTicks[CentralProcessor.TickType.IOWAIT.getIndex()]; + long irq = ticks[CentralProcessor.TickType.IRQ.getIndex()] - prevTicks[CentralProcessor.TickType.IRQ.getIndex()]; + long softirq = ticks[CentralProcessor.TickType.SOFTIRQ.getIndex()] - prevTicks[CentralProcessor.TickType.SOFTIRQ.getIndex()]; + long steal = ticks[CentralProcessor.TickType.STEAL.getIndex()] - prevTicks[CentralProcessor.TickType.STEAL.getIndex()]; + long totalCpu = user + nice + sys + idle + iowait + irq + softirq + steal; + cpuInfo.setUsed(DECIMAL_FORMAT.format(100d * user / totalCpu + 100d * sys / totalCpu)); + cpuInfo.setIdle(DECIMAL_FORMAT.format(100d * idle / totalCpu)); + return cpuInfo; + } + + /** + * 获取系统相关信息,系统、运行天数、系统IP + * + * @param + * @return / + */ + private SystemModel getSystemInfo(OperatingSystem operatingSystem) { + SystemModel systemInfo = new SystemModel(); + String osName = System.getProperty("os.name"); + String os = osName; + if(osName.contains("Linux")){ + os = operatingSystem.toString(); + } + // jvm 运行时间 + long time = ManagementFactory.getRuntimeMXBean().getStartTime(); + Date date = new Date(time); + // 计算项目运行时间 + String formatBetween = DateUtil.formatBetween(date, new Date(), BetweenFormatter.Level.HOUR); + // 系统信息 + systemInfo.setOs(os); + systemInfo.setDay(formatBetween); + systemInfo.setIp(getLocalhostIp()); + return systemInfo; + } + + /** + *

获取当前服务器所有符合条件的网络地址

+ * + * @return List 网络地址列表 + * @throws Exception 默认异常 + */ + private static String getLocalhostIp() { + List result = new ArrayList<>(); + try { + // 遍历所有的网络接口 + for (Enumeration networkInterfaces = NetworkInterface.getNetworkInterfaces(); networkInterfaces.hasMoreElements(); ) { + NetworkInterface ni = (NetworkInterface) networkInterfaces.nextElement(); + // 在所有的接口下再遍历IP + for (Enumeration addresses = ni.getInetAddresses(); addresses.hasMoreElements(); ) { + InetAddress address = (InetAddress) addresses.nextElement(); + //排除LoopbackAddress、SiteLocalAddress、LinkLocalAddress、MulticastAddress类型的IP地址 + if (!address.isLoopbackAddress() + /*&& !inetAddr.isSiteLocalAddress()*/ + && !address.isLinkLocalAddress() && !address.isMulticastAddress()) { + String hostAddress = address.getHostAddress(); + result.add(hostAddress); + } + } + } + }catch (Exception e) { + + } + String ip = String.join(",",result); + return ip; + } + + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/OptimizeUtil.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/OptimizeUtil.java new file mode 100644 index 0000000..0bbb050 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/OptimizeUtil.java @@ -0,0 +1,53 @@ +package jnpf.base.util; + + +import java.util.Arrays; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +public class OptimizeUtil { + + /** + * 允许文件类型 + * + * @param fileType 文件所有类型 + * @param fileExtension 当前文件类型 + * @return + */ + public static boolean fileType(String fileType, String fileExtension) { + String[] allowExtension = fileType.split(","); + return Arrays.asList(allowExtension).contains(fileExtension.toLowerCase()); + } + + /** + * 允许图片类型 + * + * @param imageType 图片所有类型 + * @param fileExtension 当前图片类型 + * @return + */ + public static boolean imageType(String imageType, String fileExtension) { + String[] allowExtension = imageType.split(","); + return Arrays.asList(allowExtension).contains(fileExtension.toLowerCase()); + } + + /** + * 允许上传大小 + * + * @param fileSize 文件大小 + * @param maxSize 最大的文件 + * @return + */ + public static boolean fileSize(Long fileSize, int maxSize) { + if (fileSize > maxSize) { + return true; + } + return false; + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/Pop3Util.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/Pop3Util.java new file mode 100644 index 0000000..835bb85 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/Pop3Util.java @@ -0,0 +1,527 @@ +package jnpf.base.util; + +import jnpf.base.model.MailAccount; +import jnpf.base.model.MailFile; +import jnpf.config.ConfigValueUtil; +import jnpf.entity.EmailReceiveEntity; +import jnpf.util.DateUtil; +import jnpf.util.JsonUtil; +import jnpf.util.RandomUtil; +import lombok.Cleanup; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import javax.mail.*; +import javax.mail.internet.InternetAddress; +import javax.mail.internet.MimeMessage; +import javax.mail.internet.MimeMultipart; +import javax.mail.internet.MimeUtility; +import java.io.*; +import java.text.SimpleDateFormat; +import java.util.*; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Slf4j +@Component +public class Pop3Util { + + @Autowired + private ConfigValueUtil configValueUtil; + + /** + * 邮箱验证 + * + * @param mailAccount + * @return + */ + public String checkConnected(MailAccount mailAccount) { + try { + Properties props = getProperties(mailAccount.getSsl()); + Session session = getSession(props); + @Cleanup Store store = getStore(session, mailAccount); + return "true"; + } catch (Exception e) { + log.error(e.getMessage()); + return e.getMessage(); + } + } + + /** + * 接收邮件 + */ + public Map popMail(MailAccount mailAccount) { + List entity = new ArrayList<>(); + Map map = new HashMap<>(16); + try { + Properties props = getProperties(mailAccount.getSsl()); + Session session = getSession(props); + @Cleanup Store store = getStore(session, mailAccount); + @Cleanup Folder folder = getFolder(store); + int receiveCount = folder.getMessageCount(); + Message[] messages = folder.getMessages(); + entity = parseMessage(messages); + map.put("receiveCount", receiveCount); + map.put("mailList", entity); + return map; + } catch (Exception e) { + log.error(e.getMessage()); + } + return map; + } + + /** + * 删除邮件 + * + * @param mailAccount + * @param mid + */ + public void deleteMessage(MailAccount mailAccount, String mid) { + try { + Properties props = getProperties(false); + Session session = getSession(props); + @Cleanup Store store = getStore(session, mailAccount); + @Cleanup Folder folder = getFolder(store); + Message[] messages = folder.getMessages(); + deleteMessage(messages, mid); + } catch (Exception e) { + log.error(e.getMessage()); + } + } + + /** + * 获取Properties + * + * @param ssl + */ + private Properties getProperties(boolean ssl) { + Properties props = new Properties(); + props.setProperty("mail.store.protocol", "pop3"); + props.setProperty("mail.pop3.auth", "true"); + // 设置连接超时时间 + props.put("mail.pop3.connectiontimeout", "35000"); + // 设置读取超时时间 + props.put("mail.pop3.timeout", "10000"); + // 设置写入超时时间 + props.put("mail.pop3.writetimeout", "10000"); + if (ssl) { + props.put("mail.pop3.ssl.enable", "true"); + props.put("mail.pop3.socketFactory.fallback", "false"); + props.setProperty( "mail.pop3.socketFactory.class", "javax.net.ssl.SSLSocketFactory"); + } + return props; + } + + /** + * 获取Session + * + * @param props + */ + private Session getSession(Properties props) { + Session session = Session.getInstance(props); + session.setDebug(true); + return session; + } + + /** + * 获取Store + */ + private Store getStore(Session session, MailAccount mailAccount) throws Exception { + Store store = session.getStore(); + store.connect(mailAccount.getPop3Host(), mailAccount.getPop3Port(), mailAccount.getAccount(), mailAccount.getPassword()); + return store; + } + + /** + * 获取Folder + */ + private Folder getFolder(Store store) throws Exception { + Folder folder = store.getFolder("INBOX"); + folder.open(Folder.READ_ONLY); + return folder; + } + + /** + * 解析邮件 + * + * @param messages 要解析的邮件列表 + */ + private List parseMessage(Message... messages) throws MessagingException, IOException { + List receiveEntity = new ArrayList<>(); + if (messages == null || messages.length < 1) { + throw new MessagingException("未找到要解析的邮件!"); + } + List mailFiles = new ArrayList<>(); + String mailfiles = ""; + for (int i = 0, count = messages.length; i < count; i++) { + MimeMessage msg = (MimeMessage) messages[i]; + mailfiles = null; + boolean isContainerAttachment = isContainAttachment(msg); + if (isContainerAttachment) { + //保存附件 + mailFiles = saveAttachment(msg, configValueUtil.getEmailFilePath()); + mailfiles = JsonUtil.getObjectToString(mailFiles); + }else { + mailfiles="[]"; + } + StringBuilder content = new StringBuilder(30); + getMailTextContent(msg, content); + EmailReceiveEntity entity = new EmailReceiveEntity(); + entity.setId(RandomUtil.uuId()); + entity.setMAccount(getReceiveAddress(msg, null)); + entity.setMID(getMessageId(msg)); + if(getFrom(msg)==null){ + entity.setSender("00000"); + entity.setSenderName("匿名"); + }else { + entity.setSender(getFrom(msg).split("_")[0]); + entity.setSenderName(getFrom(msg).split("_")[1]); + } + entity.setSubject(getSubject(msg)); + entity.setBodyText(content.toString()); + entity.setAttachment(mailfiles); + entity.setFdate(msg.getSentDate()); + entity.setIsRead(0); + receiveEntity.add(entity); + } + return receiveEntity; + } + + /** + * 解析邮件 + * + * @param messages 要解析的邮件列表 + */ + private void deleteMessage(Message[] messages, String mid) throws MessagingException { + if (messages == null || messages.length < 1) { + throw new MessagingException("未找到要解析的邮件!"); + } + for (int i = 0; i < messages.length; i++) { + Message message = messages[i]; + MimeMessage msg = (MimeMessage) messages[i]; + if (deleteMessageId(msg, mid)) { + message.setFlag(Flags.Flag.DELETED, true); + } + } + } + + /** + * 判断mid是否一致 + * + * @param msg + * @param mid + * @return + * @throws MessagingException + */ + private boolean deleteMessageId(MimeMessage msg, String mid) throws MessagingException { + String messageId = msg.getMessageID(); + messageId = messageId.replace("<", ""); + messageId = messageId.replace(">", ""); + if (messageId.equals(mid)) { + return true; + } + return false; + } + + /** + * 获得邮件主题 + * + * @param msg 邮件内容 + * @return 解码后的邮件主题 + */ + private String getSubject(MimeMessage msg) throws UnsupportedEncodingException, MessagingException { + return MimeUtility.decodeText(msg.getSubject()); + } + + /** + * 获得邮件发件人 + * + * @param msg 邮件内容 + * @return 姓名 + * @throws MessagingException + * @throws UnsupportedEncodingException + */ + private String getFrom(MimeMessage msg) throws MessagingException, UnsupportedEncodingException { + String from = ""; + Address[] froms = msg.getFrom(); + InternetAddress address = (InternetAddress) froms[0]; + String person = address.getPersonal(); + if (person != null) { + person = MimeUtility.decodeText(person) + " "; + } else { + person = ""; + } + from = person + "_" + address.getAddress(); + return from; + } + + /** + * 获取邮件的id + */ + private String getMessageId(MimeMessage msg) throws MessagingException { + String messageId = msg.getMessageID(); + messageId = messageId.replace("<", ""); + messageId = messageId.replace(">", ""); + return messageId; + } + + /** + * 根据收件人类型,获取邮件收件人、抄送和密送地址。如果收件人类型为空,则获得所有的收件人 + *

Message.RecipientType.TO 收件人

+ *

Message.RecipientType.CC 抄送

+ *

Message.RecipientType.BCC 密送

+ * + * @param msg 邮件内容 + * @param type 收件人类型 + * @return 收件人1 <邮件地址1>, 收件人2 <邮件地址2>, ... + * @throws MessagingException + */ + private String getReceiveAddress(MimeMessage msg, Message.RecipientType type) throws MessagingException { + StringBuilder receiveAddress = new StringBuilder(); + Address[] addresss = null; + if (type == null) { + addresss = msg.getAllRecipients(); + } else { + addresss = msg.getRecipients(type); + } + if (addresss == null || addresss.length < 1) { + return null; + } + for (Address address : addresss) { + InternetAddress internetAddress = (InternetAddress) address; + receiveAddress.append(internetAddress.toUnicodeString()).append(","); + } + //删除最后一个逗号 + receiveAddress.deleteCharAt(receiveAddress.length() - 1); + return receiveAddress.toString(); + } + + /** + * 获得邮件发送时间 + * + * @param msg 邮件内容 + * @return yyyy年mm月dd日 星期X HH:mm + * @throws MessagingException + */ + private String getSentDate(MimeMessage msg, String pattern) throws MessagingException { + Date receivedDate = msg.getSentDate(); + if (receivedDate == null) { + return ""; + } + if (pattern == null || "".equals(pattern)) { + pattern = "yyyy年MM月dd日 E HH:mm "; + } + return new SimpleDateFormat(pattern).format(receivedDate); + } + + /** + * 判断邮件中是否包含附件 + * + * @return 邮件中存在附件返回true,不存在返回false + * @throws MessagingException + * @throws IOException + */ + private boolean isContainAttachment(Part part) throws MessagingException, IOException { + boolean flag = false; + if (part.isMimeType("multipart/*")) { + MimeMultipart multipart = (MimeMultipart) part.getContent(); + int partCount = multipart.getCount(); + for (int i = 0; i < partCount; i++) { + BodyPart bodyPart = multipart.getBodyPart(i); + String disp = bodyPart.getDisposition(); + if (disp != null && (disp.equalsIgnoreCase(Part.ATTACHMENT) || disp.equalsIgnoreCase(Part.INLINE))) { + flag = true; + } else if (bodyPart.isMimeType("multipart/*")) { + flag = isContainAttachment(bodyPart); + } else { + String contentType = bodyPart.getContentType(); + if (contentType.contains("application")) { + flag = true; + } + if (contentType.contains("name")) { + flag = true; + } + } + if (flag) { + break; + } + } + } else if (part.isMimeType("message/rfc822")) { + flag = isContainAttachment((Part) part.getContent()); + } + return flag; + } + + /** + * 判断邮件是否已读 + * + * @param msg 邮件内容 + * @return 如果邮件已读返回true, 否则返回false + * @throws MessagingException + */ + private boolean isSeen(MimeMessage msg) throws MessagingException { + return msg.getFlags().contains(Flags.Flag.SEEN); + } + + /** + * 判断邮件是否需要阅读回执 + * + * @param msg 邮件内容 + * @return 需要回执返回true, 否则返回false + * @throws MessagingException + */ + private boolean isReplySign(MimeMessage msg) throws MessagingException { + boolean replySign = false; + String[] headers = msg.getHeader("Disposition-Notification-To"); + if (headers != null) { + replySign = true; + } + return replySign; + } + + /** + * 获得邮件的优先级 + * + * @param msg 邮件内容 + * @return 1(High):紧急 3:普通(Normal) 5:低(Low) + * @throws MessagingException + */ + private String getPriority(MimeMessage msg) throws MessagingException { + String priority = "普通"; + String[] headers = msg.getHeader("X-Priority"); + if (headers != null) { + String headerPriority = headers[0]; + if (headerPriority.indexOf("1") != -1 || headerPriority.indexOf("High") != -1) { + priority = "紧急"; + } else if (headerPriority.indexOf("5") != -1 || headerPriority.indexOf("Low") != -1) { + priority = "低"; + } else { + priority = "普通"; + } + } + return priority; + } + + /** + * 获得邮件文本内容 + * + * @param part 邮件体 + * @param content 存储邮件文本内容的字符串 + * @throws MessagingException + * @throws IOException + */ + private void getMailTextContent(Part part, StringBuilder content) throws MessagingException, IOException { + boolean isContainTextAttach = part.getContentType().indexOf("name") > 0; + if (part.isMimeType("text/html") && !isContainTextAttach) { + content.append(part.getContent().toString()); + } else if (part.isMimeType("message/rfc822")) { + getMailTextContent((Part) part.getContent(), content); + } else if (part.isMimeType("multipart/*")) { + Multipart multipart = (Multipart) part.getContent(); + int partCount = multipart.getCount(); + for (int i = 0; i < partCount; i++) { + BodyPart bodyPart = multipart.getBodyPart(i); + getMailTextContent(bodyPart, content); + } + } + } + + /** + * 保存附件 + * + * @param part 邮件中多个组合体中的其中一个组合体 + * @param destDir 附件保存目录 + * @throws UnsupportedEncodingException + * @throws MessagingException + * @throws FileNotFoundException + * @throws IOException + */ + private List saveAttachment(Part part, String destDir) throws UnsupportedEncodingException, MessagingException, + FileNotFoundException, IOException { + List mailFiles = new ArrayList<>(); + if (part.isMimeType("multipart/*")) { + Multipart multipart = (Multipart) part.getContent(); + int partCount = multipart.getCount(); + for (int i = 0; i < partCount; i++) { + BodyPart bodyPart = multipart.getBodyPart(i); + String disp = bodyPart.getDisposition(); + if (disp != null && (disp.equalsIgnoreCase(Part.ATTACHMENT) || disp.equalsIgnoreCase(Part.INLINE))) { + MailFile mailFile = new MailFile(); + @Cleanup InputStream is = bodyPart.getInputStream(); + //解决附件中文乱码 + String fileName=MimeUtility.decodeText(bodyPart.getFileName()); + String fileType=fileName.split("\\.")[1]; + + mailFile.setFileId(RandomUtil.uuId()+"."+fileType); + saveFile(is, destDir, decodeText(mailFile.getFileId())); + File file = new File(destDir + decodeText(fileName)); + mailFile.setFileName(fileName); + mailFile.setFileSize(String.valueOf(file.length())); + mailFile.setFileState("-1"); + mailFile.setFileTime(DateUtil.getNow()); + mailFiles.add(mailFile); + } else if (bodyPart.isMimeType("multipart/*")) { + saveAttachment(bodyPart, destDir); + } else { + String contentType = bodyPart.getContentType(); + if (contentType.indexOf("name") != -1 || contentType.indexOf("application") != -1) { + saveFile(bodyPart.getInputStream(), destDir, decodeText(bodyPart.getFileName())); + File file = new File(destDir + decodeText(bodyPart.getFileName())); + MailFile mailFile = new MailFile(); + mailFile.setFileId(RandomUtil.uuId()); + mailFile.setFileName(file.getName()); + mailFile.setFileSize(String.valueOf(file.length())); + mailFile.setFileState("-1"); + mailFile.setFileTime(DateUtil.getNow()); + mailFiles.add(mailFile); + } + } + } + } else if (part.isMimeType("message/rfc822")) { + saveAttachment((Part) part.getContent(), destDir); + } + return mailFiles; + } + + /** + * 读取输入流中的数据保存至指定目录 + * + * @param is 输入流 + * @param fileName 文件名 + * @param destDir 文件存储目录 + * @throws FileNotFoundException + * @throws IOException + */ + private void saveFile(InputStream is, String destDir, String fileName) + throws FileNotFoundException, IOException { + @Cleanup BufferedInputStream bis = new BufferedInputStream(is); + @Cleanup FileOutputStream fileOutputStream = new FileOutputStream(new File(destDir + fileName)); + @Cleanup BufferedOutputStream bos = new BufferedOutputStream(fileOutputStream); + int len = -1; + while ((len = bis.read()) != -1) { + bos.write(len); + bos.flush(); + } + } + + /** + * 文本解码 + * + * @param encodeText 解码MimeUtility.encodeText(String text)方法编码后的文本 + * @return 解码后的文本 + * @throws UnsupportedEncodingException + */ + private String decodeText(String encodeText) throws UnsupportedEncodingException { + if (encodeText == null || "".equals(encodeText)) { + return ""; + } else { + return MimeUtility.decodeText(encodeText); + } + } +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/PrintDevUtil.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/PrintDevUtil.java new file mode 100644 index 0000000..0ad2bc8 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/PrintDevUtil.java @@ -0,0 +1,40 @@ +package jnpf.base.util; + +import jnpf.database.model.dbfield.JdbcColumnModel; +import jnpf.database.model.dbtable.JdbcTableModel; +import jnpf.database.model.entity.DbLinkEntity; + +import java.util.List; + +/** + * 打印模板-工具类 + * + * @author JNPF开发平台组 YY + * @version V3.2.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月30日 + */ +public class PrintDevUtil { + + /** + * 获取字段注释 + * [1]:表注释 [2]:字段注释 + */ + public static String[] getTableColumnComment(DbLinkEntity dbLinkEntity, String table, String columnName){ + try { + JdbcTableModel jdbcTableModel = new JdbcTableModel(dbLinkEntity, table); + String tableComment = jdbcTableModel.getComment(); + String columnComment = ""; + List columnList = jdbcTableModel.getJdbcColumnModelList(); + for(JdbcColumnModel column : columnList){ + if(column.getField().equalsIgnoreCase(columnName)){ + columnComment = column.getComment(); + } + } + return new String[] {tableComment, columnComment}; + } catch (Exception e) { + throw new RuntimeException("表信息抽取异常!", e); + } + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/RegexUtils.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/RegexUtils.java new file mode 100644 index 0000000..2d543fd --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/RegexUtils.java @@ -0,0 +1,173 @@ +package jnpf.base.util; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +public class RegexUtils { + /** + * 验证Email + * @param email email地址,格式:zhangsan@zuidaima.com,zhangsan@xxx.com.cn,xxx代表邮件服务商 + * @return 验证成功返回true,验证失败返回false + */ + public static boolean checkEmail(String email) { + String regex = "\\w+@\\w+\\.[a-z]+(\\.[a-z]+)?"; + return Pattern.matches(regex, email); + } + + /** + * 验证身份证号码 + * @param idCard 居民身份证号码15位或18位,最后一位可能是数字或字母 + * @return 验证成功返回true,验证失败返回false + */ + public static boolean checkIdCard(String idCard) { + String regex = "[1-9]\\d{13,16}[a-zA-Z0-9]{1}"; + return Pattern.matches(regex,idCard); + } + + /** + * 验证手机号码(支持国际格式,+86135xxxx...(中国内地),+00852137xxxx...(中国香港)) + * @param mobile 移动、联通、电信运营商的号码段 + *

移动的号段:134(0-8)、135、136、137、138、139、147(预计用于TD上网卡) + *、150、151、152、157(TD专用)、158、159、187(未启用)、188(TD专用)

+ *

联通的号段:130、131、132、155、156(世界风专用)、185(未启用)、186(3g)

+ *

电信的号段:133、153、180(未启用)、189

+ * @return 验证成功返回true,验证失败返回false + */ + public static boolean checkMobile(String mobile) { + String regex = "(\\+\\d+)?1[345789]\\d{9}$"; + return Pattern.matches(regex,mobile); + } + + /** + * 验证固定电话号码 + * @param phone 电话号码,格式:国家(地区)电话代码 + 区号(城市代码) + 电话号码,如:+8602085588447 + *

国家(地区) 代码 :标识电话号码的国家(地区)的标准国家(地区)代码。它包含从 0 到 9 的一位或多位数字, + * 数字之后是空格分隔的国家(地区)代码。

+ *

区号(城市代码):这可能包含一个或多个从 0 到 9 的数字,地区或城市代码放在圆括号—— + * 对不使用地区或城市代码的国家(地区),则省略该组件。

+ *

电话号码:这包含从 0 到 9 的一个或多个数字

+ * @return 验证成功返回true,验证失败返回false + */ + public static boolean checkPhone(String phone) { + String regex = "(\\+\\d+)?(\\d{3,4}\\-?)?\\d{7,8}$"; + return Pattern.matches(regex, phone); + } + + /** + * 验证整数(正整数和负整数) + * @param digit 一位或多位0-9之间的整数 + * @return 验证成功返回true,验证失败返回false + */ + public static boolean checkDigit(String digit) { + String regex = "\\-?[1-9]\\d+"; + return Pattern.matches(regex,digit); + } + + /** + * 验证整数和浮点数(正负整数和正负浮点数) + * @param decimals 一位或多位0-9之间的浮点数,如:1.23,233.30 + * @return 验证成功返回true,验证失败返回false + */ + public static boolean checkDecimals(String decimals) { + String regex = "\\-?[1-9]\\d+(\\.\\d+)?"; + return Pattern.matches(regex,decimals); + } + + /** + * 验证空白字符 + * @param blankSpace 空白字符,包括:空格、\t、\n、\r、\f、\x0B + * @return 验证成功返回true,验证失败返回false + */ + public static boolean checkBlankSpace(String blankSpace) { + String regex = "\\s+"; + return Pattern.matches(regex,blankSpace); + } + + /** + * 验证中文 + * @param chinese 中文字符 + * @return 验证成功返回true,验证失败返回false + */ + public static boolean checkChinese(String chinese) { + String regex = "^[\u4E00-\u9FA5]+$"; + return Pattern.matches(regex,chinese); + } + + /** + * 验证日期(年月日) + * @param birthday 日期,格式:1992-09-03,或1992.09.03 + * @return 验证成功返回true,验证失败返回false + */ + public static boolean checkBirthday(String birthday) { + String regex = "[1-9]{4}([-./])\\d{1,2}\\1\\d{1,2}"; + return Pattern.matches(regex,birthday); + } + + /** + * 验证URL地址 + * @param url 格式:http://blog.csdn.net:80/xyang81/article/details/7705960? 或 http://www.csdn.net:80 + * @return 验证成功返回true,验证失败返回false + */ + public static boolean checkUrl(String url) { + String regex = "(https?://(w{3}\\.)?)?\\w+\\.\\w+(\\.[a-zA-Z]+)*(:\\d{1,5})?(/\\w*)*(\\??(.+=.*)?(&.+=.*)?)?"; + return Pattern.matches(regex, url); + } + + /** + * 匹配中国邮政编码 + * @param postcode 邮政编码 + * @return 验证成功返回true,验证失败返回false + */ + public static boolean checkPostcode(String postcode) { + String regex = "[1-9]\\d{5}"; + return Pattern.matches(regex, postcode); + } + + /** + * 匹配IP地址(简单匹配,格式,如:192.168.1.1,127.0.0.1,没有匹配IP段的大小) + * @param ipAddress IPv4标准地址 + * @return 验证成功返回true,验证失败返回false + */ + public static boolean checkIpAddress(String ipAddress) { + String regex = "[1-9](\\d{1,2})?\\.(0|([1-9](\\d{1,2})?))\\.(0|([1-9](\\d{1,2})?))\\.(0|([1-9](\\d{1,2})?))"; + return Pattern.matches(regex, ipAddress); + } + + /** + * 验证整数和浮点数(正整数和正两位小数) + * @param decimals 整数或多位0-9之间的浮点数,如:1.23,233.30 + * @return 验证成功返回true,验证失败返回false + */ + public static boolean checkDecimals2(String decimals) { + String regex = "^(([1-9]{1}\\d*)|([0]{1}))(\\.(\\d){0,2})?$"; + return Pattern.matches(regex,decimals); + } + + /** + * 验证是否为正整数 + * @param digit 一位或多位0-9之间的整数 + * @return 验证成功返回true,验证失败返回false + */ + public static boolean checkDigit2(String digit) { + String regex = "[1-9]\\d*"; + return Pattern.matches(regex,digit); + } + + /** + * 验证请假时间为0.5的倍数 + * @param leave + * @return + */ + public static boolean checkLeave(String leave){ + String regex = "^[1-9]\\d*\\.[5]$|0\\.[5]$||\\d\\.0|^[1-9]\\d*$"; + return Pattern.matches(regex,leave); + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/SentMessageUtil.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/SentMessageUtil.java new file mode 100644 index 0000000..5353228 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/SentMessageUtil.java @@ -0,0 +1,1344 @@ +package jnpf.base.util; + +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONObject; +import jnpf.base.UserInfo; +import jnpf.base.entity.SysConfigEntity; +import jnpf.base.service.MessageTemplateService; +import jnpf.base.service.SmsTemplateService; +import jnpf.base.service.SysconfigService; +import jnpf.config.JnpfOauthConfig; +import jnpf.constant.MsgCode; +import jnpf.message.entity.*; +import jnpf.message.enums.MessageTypeEnum; +import jnpf.message.model.WxgzhMessageModel; +import jnpf.message.model.message.DingTalkModel; +import jnpf.message.model.message.EmailModel; +import jnpf.message.model.message.SentMessageForm; +import jnpf.base.model.systemconfig.SmsModel; +import jnpf.message.service.*; +import jnpf.message.util.*; +import jnpf.message.util.weixingzh.WXGZHWebChatUtil; +import jnpf.model.BaseSystemInfo; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.UserService; +import jnpf.util.*; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.text.StringSubstitutor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.nio.charset.StandardCharsets; +import java.util.*; +import java.util.regex.Pattern; + +/** + * 消息实体类 + * + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021/4/22 9:06 + */ +@Component +@Slf4j +public class SentMessageUtil { + + @Autowired + private UserService userService; + @Autowired + private UserProvider userProvider; + @Autowired + private SysconfigService sysconfigService; + @Autowired + private MessageService messageService; + @Autowired + private MessagereceiveService messagereceiveService; + @Autowired + private SynThirdInfoService synThirdInfoService; + + @Autowired + private MessageTemplateService messageTemplateService; + @Autowired + private SmsTemplateService smsTemplateService; + @Autowired + private SendMessageConfigService sendMessageConfigService; + + @Autowired + private SendConfigTemplateService sendConfigTemplateService; + + @Autowired + private AccountConfigService accountConfigService; + + @Autowired + private MessageTemplateConfigService messageTemplateConfigService; + @Autowired + private MessageMonitorService messageMonitorService; + @Autowired + private SmsFieldService smsFieldService; + @Autowired + private ShortLinkService shortLinkService; + @Autowired + private JnpfOauthConfig jnpfOauthConfig; + @Autowired + private WechatUserService wechatUserService; + @Autowired + private TemplateParamService templateParamService; + @Autowired + protected AuthUtil authUtil; + + /** + * 发送消息 + * + * @param sentMessageForm + */ + public void sendMessage(SentMessageForm sentMessageForm) { + List toUserIdsList = sentMessageForm.getToUserIds(); + // 模板id + String templateId = sentMessageForm.getTemplateId(); + // 参数 + Map parameterMap = sentMessageForm.getParameterMap(); + UserInfo userInfo = sentMessageForm.getUserInfo(); + boolean flag = true; + if (!(toUserIdsList != null && toUserIdsList.size() > 0)) { + log.error("接收人员为空"); + flag = false; + } + if (StringUtil.isEmpty(templateId)) { + log.error("模板Id为空"); + flag = false; + } + if (flag) { + // 获取发送配置详情 +// MessageTemplateEntity entity = messageTemplateService.getInfo(templateId); + SendMessageConfigEntity entity = sendMessageConfigService.getInfoByEnCode(templateId); + if (entity != null) { + templateId = entity.getId(); + } else { + entity = sendMessageConfigService.getInfo(templateId); + } + if (entity != null) { + List list = sendConfigTemplateService.getDetailListByParentId(templateId); + if (list != null && list.size() > 0) { + for (SendConfigTemplateEntity entity1 : list) { + if (parameterMap.get(entity1.getId() + "@Title") == null) { + parameterMap.put(entity1.getId() + "@Title", sentMessageForm.getTitle()); + } + if (parameterMap.get(entity1.getId() + "@CreatorUserName") == null) { + parameterMap.put(entity1.getId() + "@CreatorUserName", sentMessageForm.getUserInfo().getUserName()); + } + if (parameterMap.get(entity1.getId() + "@FlowLink") == null) { + parameterMap.put(entity1.getId() + "@FlowLink", ""); + } + if ("1".equals(String.valueOf(entity1.getEnabledMark()))) { + String sendType = entity1.getMessageType(); + MessageTypeEnum typeEnum = MessageTypeEnum.getByCode(sendType); + Map contentMsg = sentMessageForm.getContentMsg(); + switch (typeEnum) { + case SysMessage: + // 站内消息、 + for (String toUserId : toUserIdsList) { + List toUser = new ArrayList<>(); + String content = sentMessageForm.getContent(); + MessageTemplateConfigEntity templateConfigEntity = messageTemplateConfigService.getInfo(entity1.getTemplateId()); + String title = sentMessageForm.getTitle(); + String appLink = ""; + if (templateConfigEntity != null) { + title = templateConfigEntity.getTitle(); + String msg = contentMsg.get(toUserId) != null ? contentMsg.get(toUserId) : "{}"; + byte[] bytes = msg.getBytes(StandardCharsets.UTF_8); + String encode = Base64.getEncoder().encodeToString(bytes); + //流程审批页面链接地址 + //流程审批页面链接地址 + String pcLink = jnpfOauthConfig.getJnpfFrontDomain() + "/workFlowDetail?config=" + encode; + appLink = jnpfOauthConfig.getJnpfAppDomain() + "/pages/workFlow/flowBefore/index?config=" + encode; + //转换为短链 + String shortLink = shortLinkService.shortLink(pcLink + toUserId + templateConfigEntity.getMessageType()); + shortLink = getShortLink(pcLink, toUserId, shortLink, templateConfigEntity.getMessageType()); + String link = jnpfOauthConfig.getJnpfDomain() + "/api/message/ShortLink/" + shortLink; + if (StringUtil.isNotBlank(userInfo.getTenantId())) { + link = link + "/" + userInfo.getTenantId(); + } + if (title.contains("{@FlowLink}")) { + title = title.replace("{@FlowLink}", link + " "); + //链接数据保存 + this.saveShortLink(pcLink, appLink, shortLink, userInfo, toUserId, msg); + } + Map msgMap = new HashMap<>(); + msgMap = getParamMap(entity1.getId(), parameterMap); + if (StringUtil.isNotEmpty(title)) { + StringSubstitutor strSubstitutor = new StringSubstitutor(msgMap, "{", "}"); + title = strSubstitutor.replace(title); + } + } + toUser.add(toUserId); + messageService.sentMessage(toUser, title, content, contentMsg, userInfo); + //消息监控写入 + MessageMonitorEntity monitorEntity = new MessageMonitorEntity(); + monitorEntity.setId(RandomUtil.uuId()); + monitorEntity.setReceiveUser(JsonUtil.getObjectToString(toUser)); + monitorEntity.setSendTime(DateUtil.getNowDate()); + monitorEntity.setCreatorTime(DateUtil.getNowDate()); + monitorEntity.setCreatorUserId(userInfo.getUserId()); + createMessageMonitor(monitorEntity, templateConfigEntity, null, null, userInfo, toUser, title); + messageMonitorService.create(monitorEntity); + } + break; + case SmsMessage: + // 发送短信 + sendSms(toUserIdsList, userInfo, entity1, parameterMap, contentMsg); + break; + case MailMessage: + // 邮件 + SendMail(toUserIdsList, userInfo, sendType, entity1, parameterMap, contentMsg); + break; + case QyMessage: + // 企业微信 + JSONObject jsonObject = SendQyWebChat(toUserIdsList, userInfo, sendType, entity1, parameterMap, contentMsg); + if (!(Boolean) jsonObject.get("code")) { + log.error("发送企业微信消息失败,错误:" + jsonObject.get("error")); + } + break; + case DingMessage: + // 钉钉 + JSONObject jsonObject1 = SendDingTalk(toUserIdsList, userInfo, sendType, entity1, parameterMap, contentMsg); + if (!(Boolean) jsonObject1.get("code")) { + log.error("发送企业微信消息失败,错误:" + jsonObject1.get("error")); + } + break; + case WebHookMessage: + // webhook + SendWebHook(sendType, userInfo, entity1, parameterMap, new HashMap<>()); + break; + case WechatMessage: + // 微信公众号 + SendWXGzhChat(toUserIdsList, userInfo, sendType, entity1, contentMsg, parameterMap); + break; + default: + break; + } + } + } + } + } else { + for (String toUserId : toUserIdsList) { + List toUser = new ArrayList<>(); + toUser.add(toUserId); + String content = sentMessageForm.getContent(); + Map contentMsg = sentMessageForm.getContentMsg(); + String title = sentMessageForm.getTitle(); + messageService.sentMessage(toUser, title, content, contentMsg, userInfo); + //消息监控写入 + MessageMonitorEntity monitorEntity = new MessageMonitorEntity(); + monitorEntity.setId(RandomUtil.uuId()); + monitorEntity.setReceiveUser(JsonUtil.getObjectToString(toUser)); + monitorEntity.setSendTime(DateUtil.getNowDate()); + monitorEntity.setCreatorTime(DateUtil.getNowDate()); + monitorEntity.setCreatorUserId(userInfo.getUserId()); + monitorEntity.setMessageType("1"); + createMessageMonitor(monitorEntity, null, null, null, userInfo, toUser, title); + messageMonitorService.create(monitorEntity); + } + } + } + } + + + public void SendWebHook(String sendType, UserInfo userInfo, SendConfigTemplateEntity entity, Map parameterMap, Map contentMsg) { + MessageTemplateConfigEntity msgTemEntity = messageTemplateConfigService.getInfo(entity.getTemplateId()); + AccountConfigEntity accountEntity = accountConfigService.getInfo(entity.getAccountConfigId()); + MessageMonitorEntity monitorEntity = new MessageMonitorEntity(); + monitorEntity.setId(RandomUtil.uuId()); + monitorEntity.setSendTime(DateUtil.getNowDate()); + monitorEntity.setCreatorTime(DateUtil.getNowDate()); + monitorEntity.setCreatorUserId(userInfo.getUserId()); + String content = msgTemEntity.getContent(); + //获取消息模板参数 + parameterMap = getParamMap(entity.getId(), parameterMap); + // 替换参数 + if (StringUtil.isNotEmpty(content)) { + StringSubstitutor strSubstitutor = new StringSubstitutor(parameterMap, "{", "}"); + content = strSubstitutor.replace(content); + } + String title = msgTemEntity.getTitle(); + if (StringUtil.isNotEmpty(title)) { + StringSubstitutor strSubstitutor = new StringSubstitutor(parameterMap, "{", "}"); + title = strSubstitutor.replace(title); + } + title = systemParam(parameterMap, contentMsg, title, userInfo); + content = systemParam(parameterMap, contentMsg, content, userInfo); + if (entity != null) { + if (accountEntity != null) { + //创建消息监控 + monitorEntity = createMessageMonitor(monitorEntity, msgTemEntity, accountEntity, content, userInfo, null, title); + messageMonitorService.create(monitorEntity); + switch (accountEntity.getWebhookType()) { + case "1": + //钉钉 + if ("1".equals(accountEntity.getApproveType())) { + WebHookUtil.sendDDMessage(accountEntity.getWebhookAddress(), content); + } else if ("2".equals(accountEntity.getApproveType())) { + WebHookUtil.sendDingDing(accountEntity.getWebhookAddress(), accountEntity.getBearer(), content); + } + break; + case "2": + if ("1".equals(accountEntity.getApproveType())) { + WebHookUtil.callWeChatBot(accountEntity.getWebhookAddress(), content); + } + break; + default: + break; + } + } else { + monitorEntity = createMessageMonitor(monitorEntity, msgTemEntity, null, content, userInfo, null, title); + messageMonitorService.create(monitorEntity); + } + } else { + monitorEntity = createMessageMonitor(monitorEntity, msgTemEntity, null, content, userInfo, null, title); + messageMonitorService.create(monitorEntity); + } + } + + /** + * 发送企业微信消息 + * + * @param toUserIdsList + * @param userInfo + * @param sendType + * @param entity + * @param parameterMap + * @return + */ + public JSONObject SendQyWebChat(List toUserIdsList, UserInfo userInfo, String sendType, SendConfigTemplateEntity entity, Map parameterMap, Map contentMsg) { + MessageTemplateConfigEntity msgTemEntity = messageTemplateConfigService.getInfo(entity.getTemplateId()); + + JSONObject retJson = new JSONObject(); + boolean code = true; + StringBuilder error = new StringBuilder(); + // 获取接收人员的企业微信号、创建消息用户实体 + for (String userId : toUserIdsList) { + error = new StringBuilder(); + MessageMonitorEntity monitorEntity = new MessageMonitorEntity(); + monitorEntity.setId(RandomUtil.uuId()); + monitorEntity.setSendTime(DateUtil.getNowDate()); + monitorEntity.setCreatorTime(DateUtil.getNowDate()); + monitorEntity.setCreatorUserId(userInfo.getUserId()); + if (StringUtil.isEmpty(userId)) { + code = false; + error = error.append(";").append("接收人为空!"); + messageMonitorService.create(monitorEntity); + continue; + } + monitorEntity.setReceiveUser(userId); + UserEntity userEntity = userService.getInfo(userId); + if (ObjectUtil.isEmpty(userEntity)) { + code = false; + error = error.append(";").append("用户不存在!"); + messageMonitorService.create(monitorEntity); + continue; + } + if (msgTemEntity != null) { + //获取消息模板参数 + Map msgMap = getParamMap(entity.getId(), parameterMap); + // 替换参数 + String content = msgTemEntity.getContent(); + String msg = contentMsg.get(userId) != null ? contentMsg.get(userId) : "{}"; + byte[] bytes = msg.getBytes(StandardCharsets.UTF_8); + String encode = Base64.getEncoder().encodeToString(bytes); + //流程审批页面链接地址 + String pcLink = jnpfOauthConfig.getJnpfFrontDomain() + "/workFlowDetail?config=" + encode; + String appLink = jnpfOauthConfig.getJnpfAppDomain() + "/pages/workFlow/flowBefore/index?config=" + encode; + //转换为短链 + String shortLink = shortLinkService.shortLink(pcLink + userId + msgTemEntity.getMessageType()); + shortLink = getShortLink(pcLink, userId, shortLink, msgTemEntity.getMessageType()); + String msgTC = msgTemEntity.getTitle() + msgTemEntity.getContent(); + if (StringUtil.isNotBlank(msgTC)) { + if (msgTC.contains("{@FlowLink}")) { + //链接数据保存 + this.saveShortLink(pcLink, appLink, shortLink, userInfo, userId, msg); + } + } + String link = jnpfOauthConfig.getJnpfDomain() + "/api/message/ShortLink/" + shortLink; + if (StringUtil.isNotBlank(userInfo.getTenantId())) { + link = link + "/" + userInfo.getTenantId(); + } + if (StringUtil.isNotEmpty(content)) { + if (content.contains("{@FlowLink}")) { + content = content.replace("{@FlowLink}", link + " "); + } + StringSubstitutor strSubstitutor = new StringSubstitutor(msgMap, "{", "}"); + content = strSubstitutor.replace(content); + } + + // 替换参数 + String title = msgTemEntity.getTitle(); + if (StringUtil.isNotEmpty(title)) { + if (title.contains("{@FlowLink}")) { + title = title.replace("{@FlowLink}", link + " "); + } + StringSubstitutor strSubstitutor = new StringSubstitutor(msgMap, "{", "}"); + title = strSubstitutor.replace(title); + } + title = systemParam(parameterMap, contentMsg, title, userInfo); + content = systemParam(parameterMap, contentMsg, content, userInfo); + monitorEntity.setTitle(title); + monitorEntity.setContent(content); + // 获取系统配置 + Map objModel = getSystemConfig(); + BaseSystemInfo config = JsonUtil.getJsonToBean(objModel, BaseSystemInfo.class); + String corpId = config.getQyhCorpId(); + String agentId = config.getQyhAgentId(); + // 获取的应用的Secret值 + String corpSecret = config.getQyhAgentSecret(); + String wxUserId = ""; + StringBuilder toWxUserId = new StringBuilder(); + String toUserIdAll = ""; + StringBuilder nullUserInfo = new StringBuilder(); + List messageReceiveList = new ArrayList<>(); + + // 相关参数验证 + if (StringUtil.isEmpty(corpId)) { + log.error("企业ID为空"); + code = false; + error = error.append(";").append(userEntity.getRealName() + ":企业ID为空!"); + messageMonitorService.create(monitorEntity); + continue; + } + if (StringUtil.isEmpty(corpSecret)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":Secret为空!"); + messageMonitorService.create(monitorEntity); + continue; + } + if (StringUtil.isEmpty(agentId)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":AgentId为空!"); + messageMonitorService.create(monitorEntity); + continue; + } + if (StringUtil.isEmpty(content)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":内容为空!"); + messageMonitorService.create(monitorEntity); + continue; + } + // 创建消息实体 + MessageEntity messageEntity = JnpfMessageUtil.setMessageEntity(userInfo.getUserId(), content, null, Integer.parseInt(sendType)); + //创建消息监控 + monitorEntity = createMessageMonitor(monitorEntity, msgTemEntity, null, content, userInfo, null, title); + // 获取接收人员的企业微信号、创建消息用户实体 +// for (String userId : toUserIdsList) { + wxUserId = ""; + // 从同步表获取对应的企业微信ID + SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId("1", "2", userId); + if (synThirdInfoEntity != null) { + wxUserId = synThirdInfoEntity.getThirdObjId(); + } + if (StringUtil.isEmpty(wxUserId)) { + nullUserInfo = nullUserInfo.append(",").append(userId); + } else { + toWxUserId = toWxUserId.append("|").append(wxUserId); + } + messageReceiveList.add(JnpfMessageUtil.setMessageReceiveEntity(userId, title, Integer.valueOf(sendType))); +// } + + // 处理企业微信号信息串并验证 + toUserIdAll = toWxUserId.toString(); + if (StringUtil.isNotEmpty(toUserIdAll)) { + toUserIdAll = toUserIdAll.substring(1); + } + if (StringUtil.isEmpty(toUserIdAll)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":接收人对应的企业微信号全部为空!"); + messageMonitorService.create(monitorEntity); + continue; + } + // 发送企业信息信息 + retJson = QyWebChatUtil.sendWxMessage(corpId, corpSecret, agentId, toUserIdAll, content); + if (!retJson.getBoolean("code")) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":" + retJson.get("error")); + messageMonitorService.create(monitorEntity); + continue; + } + // 批量发送企业信息信息 +// retJson = QyWebChatUtil.sendWxMessage(corpId, corpSecret, agentId, toUserIdAll, content); +// messageMonitorService.create(monitorEntity); +// if (!retJson.getBoolean("code")) { +// return retJson; +// } + + // 企业微信号为空的信息写入备注 + if (StringUtil.isNotEmpty(nullUserInfo.toString())) { + messageEntity.setExcerpt(nullUserInfo.substring(1) + "对应的企业微信号为空"); + } + messageMonitorService.create(monitorEntity); + continue; + } else { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":消息模板数据不存在!"); + messageMonitorService.create(monitorEntity); + continue; + } + } + if (code) { + retJson.put("code", true); + retJson.put("error", MsgCode.SU012.get()); + } else { + String msg = error.toString(); + if (StringUtil.isNotBlank(msg)) { + msg = msg.substring(1); + } + retJson.put("code", false); + retJson.put("error", msg); + } + return retJson; + } + + /** + * List toUserIdsList, UserInfo userInfo, String sendType, MessageTemplateEntity entity, Map parameterMap + * + * @param toUserIdsList + * @param userInfo + * @param sendType + * @param entity + * @param parameterMap + * @return + */ + public JSONObject SendDingTalk(List toUserIdsList, UserInfo userInfo, String sendType, SendConfigTemplateEntity entity, Map parameterMap, Map contentMsg) { + MessageTemplateConfigEntity msgTemEntity = messageTemplateConfigService.getInfo(entity.getTemplateId()); + + boolean code = true; + StringBuilder error = new StringBuilder(); + JSONObject retJson = new JSONObject(); + for (String userId : toUserIdsList) { + error = new StringBuilder(); + //消息监控 + MessageMonitorEntity monitorEntity = new MessageMonitorEntity(); + monitorEntity.setId(RandomUtil.uuId()); + monitorEntity.setSendTime(DateUtil.getNowDate()); + monitorEntity.setCreatorTime(DateUtil.getNowDate()); + monitorEntity.setCreatorUserId(userInfo.getUserId()); + monitorEntity.setReceiveUser(userId); + if (StringUtil.isEmpty(userId)) { + code = false; + error = error.append(";").append("接收人为空!"); + messageMonitorService.create(monitorEntity); + continue; + } + UserEntity userEntity = userService.getInfo(userId); + if (ObjectUtil.isEmpty(userEntity)) { + code = false; + error = error.append(";").append("用户不存在!"); + messageMonitorService.create(monitorEntity); + continue; + } + if (msgTemEntity != null) { + String content = msgTemEntity.getContent(); + //获取消息模板参数 + Map msgMap = getParamMap(entity.getId(), parameterMap); + //转换链接 + String msg = contentMsg.get(userId) != null ? contentMsg.get(userId) : "{}"; + byte[] bytes = msg.getBytes(StandardCharsets.UTF_8); + String encode = Base64.getEncoder().encodeToString(bytes); + //流程审批页面链接地址 + String pcLink = jnpfOauthConfig.getJnpfFrontDomain() + "/workFlowDetail?config=" + encode; + String appLink = jnpfOauthConfig.getJnpfAppDomain() + "/pages/workFlow/flowBefore/index?config=" + encode; + //转换为短链 + String shortLink = shortLinkService.shortLink(pcLink + userId + msgTemEntity.getMessageType()); + shortLink = getShortLink(pcLink, userId, shortLink, msgTemEntity.getMessageType()); + String msgTC = msgTemEntity.getTitle() + msgTemEntity.getContent(); + if (StringUtil.isNotBlank(msgTC)) { + if (msgTC.contains("{@FlowLink}")) { + //链接数据保存 + this.saveShortLink(pcLink, appLink, shortLink, userInfo, userId, msg); + } + } + String link = jnpfOauthConfig.getJnpfDomain() + "/api/message/ShortLink/" + shortLink; + if (StringUtil.isNotBlank(userInfo.getTenantId())) { + link = link + "/" + userInfo.getTenantId(); + } + if (StringUtil.isNotEmpty(content)) { + if (content.contains("{@FlowLink}")) { + content = content.replace("{@FlowLink}", link + " "); + } + StringSubstitutor strSubstitutor = new StringSubstitutor(msgMap, "{", "}"); + content = strSubstitutor.replace(content); + } + // 替换参数 + String title = msgTemEntity.getTitle(); + if (StringUtil.isNotEmpty(title)) { + if (title.contains("{@FlowLink}")) { + title = title.replace("{@FlowLink}", link + " "); + } + StringSubstitutor strSubstitutor = new StringSubstitutor(msgMap, "{", "}"); + title = strSubstitutor.replace(title); + } + + title = systemParam(parameterMap, contentMsg, title, userInfo); + content = systemParam(parameterMap, contentMsg, content, userInfo); + monitorEntity.setTitle(title); + monitorEntity.setContent(content); + + Map objModel = getSystemConfig(); + DingTalkModel dingTalkModel = JsonUtil.getJsonToBean(objModel, DingTalkModel.class); + String appKey = dingTalkModel.getDingSynAppKey(); + String appSecret = dingTalkModel.getDingSynAppSecret(); + String agentId = dingTalkModel.getDingAgentId(); + String dingUserId = ""; + StringBuilder toDingUserId = new StringBuilder(); + String toUserIdAll = ""; + StringBuilder nullUserInfo = new StringBuilder(); + List messageReceiveList = new ArrayList<>(); + + // 相关参数验证 + if (StringUtil.isEmpty(appKey)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":AppKey为空!"); + messageMonitorService.create(monitorEntity); + continue; + } + if (StringUtil.isEmpty(appSecret)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":AppSecret为空!"); + messageMonitorService.create(monitorEntity); + continue; + } + if (StringUtil.isEmpty(agentId)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":AgentId为空!"); + messageMonitorService.create(monitorEntity); + continue; + } + if (StringUtil.isEmpty(content)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":AgentId为空!"); + messageMonitorService.create(monitorEntity); + continue; + } + // 创建消息实体 + MessageEntity messageEntity = JnpfMessageUtil.setMessageEntity(userInfo.getUserId(), content, null, Integer.parseInt(sendType)); + //创建消息监控 + monitorEntity = createMessageMonitor(monitorEntity, msgTemEntity, null, content, userInfo, null, title); + // 获取接收人员的钉钉号、创建消息用户实体 +// for (String userId : toUserIdsList) { + dingUserId = ""; + dingUserId = ""; + // 从同步表获取对应用户的钉钉ID + SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId("2", "2", userId); + if (synThirdInfoEntity != null) { + dingUserId = synThirdInfoEntity.getThirdObjId(); + } + if (StringUtil.isEmpty(dingUserId)) { + nullUserInfo = nullUserInfo.append(",").append(userId); + } else { + toDingUserId = toDingUserId.append(",").append(dingUserId); + } + messageReceiveList.add(JnpfMessageUtil.setMessageReceiveEntity(userId, title, Integer.valueOf(sendType))); + + // 处理接收人员的钉钉号信息串并验证 + toUserIdAll = toDingUserId.toString(); + if (StringUtil.isNotEmpty(toUserIdAll)) { + toUserIdAll = toUserIdAll.substring(1); + } + if (StringUtil.isEmpty(toUserIdAll)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":接收人对应的钉钉号为空!"); + messageMonitorService.create(monitorEntity); + continue; + } + // 发送钉钉信息 + retJson = DingTalkUtil.sendDingMessage(appKey, appSecret, agentId, toUserIdAll, content); + if (!retJson.getBoolean("code")) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":" + retJson.get("error")); + messageMonitorService.create(monitorEntity); + continue; + } + + // 钉钉号为空的信息写入备注 + if (StringUtil.isNotEmpty(nullUserInfo.toString())) { + messageEntity.setExcerpt(nullUserInfo.toString().substring(1) + "对应的钉钉号为空"); + } + messageMonitorService.create(monitorEntity); + continue; + } else { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":消息模板数据不存在"); + messageMonitorService.create(monitorEntity); + continue; + } + } + if (code) { + retJson.put("code", true); + retJson.put("error", MsgCode.SU012.get()); + } else { + String msg = error.toString(); + if (StringUtil.isNotBlank(msg)) { + msg = msg.substring(1); + } + retJson.put("code", false); + retJson.put("error", msg); + } + return retJson; + } + + /** + * 发送邮件 + * + * @param toUserIdsList + * @param userInfo + * @param sendType + * @param entity + * @param parameterMap + * @return + */ + public void SendMail(List toUserIdsList, UserInfo userInfo, String sendType, SendConfigTemplateEntity entity, Map parameterMap, Map contentMsg) { + MessageTemplateConfigEntity msgTemEntity = messageTemplateConfigService.getInfo(entity.getTemplateId()); + AccountConfigEntity accountEntity = accountConfigService.getInfo(entity.getAccountConfigId()); + for (String userId : toUserIdsList) { + //消息监控 + MessageMonitorEntity monitorEntity = new MessageMonitorEntity(); + monitorEntity.setId(RandomUtil.uuId()); + monitorEntity.setReceiveUser(JsonUtil.getObjectToString(toUserIdsList)); + monitorEntity.setSendTime(DateUtil.getNowDate()); + monitorEntity.setCreatorTime(DateUtil.getNowDate()); + monitorEntity.setCreatorUserId(userInfo.getUserId()); + if (StringUtil.isEmpty(userId)) { + log.error("接收人为空"); + messageMonitorService.create(monitorEntity); + continue; + } + monitorEntity.setReceiveUser(userId); + UserEntity userEntity = userService.getInfo(userId); + if (msgTemEntity != null) { + String msg = contentMsg.get(userId) != null ? contentMsg.get(userId) : "{}"; + byte[] bytes = msg.getBytes(StandardCharsets.UTF_8); + String encode = Base64.getEncoder().encodeToString(bytes); + //流程审批页面链接地址 + String pcLink = jnpfOauthConfig.getJnpfFrontDomain() + "/workFlowDetail?config=" + encode; + String appLink = jnpfOauthConfig.getJnpfAppDomain() + "/pages/workFlow/flowBefore/index?config=" + encode; + //转换为短链 + String shortLink = shortLinkService.shortLink(pcLink + userId + msgTemEntity.getMessageType()); + shortLink = getShortLink(pcLink, userId, shortLink, msgTemEntity.getMessageType()); + String msgTC = msgTemEntity.getTitle() + msgTemEntity.getContent(); + if (StringUtil.isNotBlank(msgTC)) { + if (msgTC.contains("{@FlowLink}")) { + //链接数据保存 + this.saveShortLink(pcLink, appLink, shortLink, userInfo, userId, msg); + } + } + String link = jnpfOauthConfig.getJnpfDomain() + "/api/message/ShortLink/" + shortLink; + if (StringUtil.isNotBlank(userInfo.getTenantId())) { + link = link + "/" + userInfo.getTenantId(); + } + Map msgMap = getParamMap(entity.getId(), parameterMap); + // 设置邮件标题 + String title = msgTemEntity.getTitle(); + if (title.contains("{@FlowLink}")) { + title = title.replace("{@FlowLink}", link + " "); + } + if (StringUtil.isNotEmpty(title)) { + StringSubstitutor strSubstitutor = new StringSubstitutor(msgMap, "{", "}"); + title = strSubstitutor.replace(title); + } + // 设置邮件内容 + String content = msgTemEntity.getContent(); + if (content.contains("{@FlowLink}")) { + content = content.replace("{@FlowLink}", link + " "); + } + //获取消息模板参数 + if (StringUtil.isNotEmpty(content)) { + StringSubstitutor strSubstitutor = new StringSubstitutor(msgMap, "{", "}"); + content = strSubstitutor.replace(content); + } + title = systemParam(parameterMap, contentMsg, title, userInfo); + content = systemParam(parameterMap, contentMsg, content, userInfo); + monitorEntity.setTitle(title); + monitorEntity.setContent(content); + if (accountEntity != null) { + // 获取系统配置 + Map objModel = new HashMap<>(); + objModel.put("emailSmtpHost", accountEntity.getSmtpServer()); + objModel.put("emailSmtpPort", accountEntity.getSmtpPort().toString()); + objModel.put("emailSenderName", accountEntity.getAddressorName()); + objModel.put("emailAccount", accountEntity.getSmtpUser()); + objModel.put("emailPassword", accountEntity.getSmtpPassword()); + objModel.put("emailSsl", accountEntity.getSslLink().equals("1") ? "true" : "false"); + + EmailModel emailModel = JsonUtil.getJsonToBean(objModel, EmailModel.class); + StringBuilder nullUserInfo = new StringBuilder(); + List messageReceiveList = new ArrayList<>(); + StringBuilder toUserMail = new StringBuilder(); + String userEmailAll = ""; + String userEmail = ""; + String userName = ""; + + // 相关参数验证 + if (StringUtil.isEmpty(emailModel.getEmailSmtpHost())) { + log.error("SMTP服务为空"); + messageMonitorService.create(monitorEntity); + continue; + } else if (StringUtil.isEmpty(emailModel.getEmailSmtpPort())) { + log.error("SMTP端口为空"); + messageMonitorService.create(monitorEntity); + continue; + } else if (StringUtil.isEmpty(emailModel.getEmailAccount())) { + log.error("发件人邮箱为空"); + messageMonitorService.create(monitorEntity); + continue; + } else if (StringUtil.isEmpty(emailModel.getEmailPassword())) { + log.error("发件人密码为空"); + messageMonitorService.create(monitorEntity); + continue; + } else { + // 设置邮件标题 + emailModel.setEmailTitle(title); + // 设置邮件内容 + emailModel.setEmailContent(content); + + // 创建消息实体 + MessageEntity messageEntity = JnpfMessageUtil.setMessageEntity(userInfo.getUserId(), title, emailModel.getEmailContent(), Integer.parseInt(sendType)); + //创建消息监控 + monitorEntity = createMessageMonitor(monitorEntity, msgTemEntity, accountEntity, content, userInfo, null, title); + // 获取收件人的邮箱地址、创建消息用户实体 +// for (String userId : toUserIdsList) { + if (userEntity != null) { + userEmail = StringUtil.isEmpty(userEntity.getEmail()) ? "" : userEntity.getEmail(); + userName = userEntity.getRealName(); + } + if (userEmail != null && !"".equals(userEmail)) { + if (EmailUtil.isEmail(userEmail)) { + toUserMail = toUserMail.append(",").append(userName).append("<").append(userEmail).append(">"); + } + } else { + nullUserInfo = nullUserInfo.append(",").append(userId); + } + messageReceiveList.add(JnpfMessageUtil.setMessageReceiveEntity(userId, title, Integer.parseInt(sendType))); +// } + + // 处理接收人员的邮箱信息串并验证 + userEmailAll = toUserMail.toString(); + if (StringUtil.isNotEmpty(userEmailAll)) { + userEmailAll = userEmailAll.substring(1); + } + if (StringUtil.isEmpty(userEmailAll)) { + log.error("接收人对应的邮箱格式错误"); + messageMonitorService.create(monitorEntity); + continue; + } else { + // 设置接收人员 + emailModel.setEmailToUsers(userEmailAll); + // 发送邮件 + JSONObject retJson = EmailUtil.sendMail(emailModel); + messageMonitorService.create(monitorEntity); + if (!retJson.getBoolean("code")) { + log.error("发送失败"); + continue; + } else { + // 邮箱地址为空的信息写入备注 + if (StringUtil.isNotEmpty(nullUserInfo.toString())) { + messageEntity.setExcerpt(nullUserInfo.substring(1) + "对应的邮箱为空"); + } + continue; + // 写入系统的消息表、消息用户表 + } + } + } + } + continue; + } + continue; + } + } + + /** + * 发送短信 + * + * @param toUserIdsList + * @param entity + * @param parameterMap + * @return + */ + public void sendSms(List toUserIdsList, UserInfo userInfo, SendConfigTemplateEntity entity, Map parameterMap, Map contentMsg) { + //获取短信配置 + AccountConfigEntity accountEntity = accountConfigService.getInfo(entity.getAccountConfigId()); + // 获取消息模板详情 + MessageTemplateConfigEntity msgTemEntity = messageTemplateConfigService.getInfo(entity.getTemplateId()); +// // 得到参数详情列表 +// List detailListByParentId = templateParamService.getDetailListByParentId(msgTemEntity.getId()); +// detailListByParentId.forEach(t-> { +// +// }); + for (String toUserId : toUserIdsList) { + //消息监控 + MessageMonitorEntity monitorEntity = new MessageMonitorEntity(); + monitorEntity.setId(RandomUtil.uuId()); + monitorEntity.setSendTime(DateUtil.getNowDate()); + monitorEntity.setCreatorTime(DateUtil.getNowDate()); + monitorEntity.setCreatorUserId(userInfo.getUserId()); + monitorEntity.setReceiveUser(toUserId); + String msg = contentMsg.get(toUserId) != null ? contentMsg.get(toUserId) : "{}"; + byte[] bytes = msg.getBytes(StandardCharsets.UTF_8); + String encode = Base64.getEncoder().encodeToString(bytes); + //流程审批页面链接地址 + //流程审批页面链接地址 + String pcLink = jnpfOauthConfig.getJnpfFrontDomain() + "/workFlowDetail?config=" + encode; + String appLink = jnpfOauthConfig.getJnpfAppDomain() + "/pages/workFlow/flowBefore/index?config=" + encode; + //转换为短链 + String shortLink = shortLinkService.shortLink(pcLink + toUserId + msgTemEntity.getMessageType()); + shortLink = getShortLink(pcLink, toUserId, shortLink, msgTemEntity.getMessageType()); + //发送给用户的链接 + String link = jnpfOauthConfig.getJnpfDomain() + "/api/message/ShortLink/" + shortLink; + if (StringUtil.isNotBlank(userInfo.getTenantId())) { + link = link + "/" + userInfo.getTenantId(); + } + //转换为短链 + + if (accountEntity != null) { + monitorEntity.setAccountId(accountEntity.getId()); + //账号配置——短信 + Map objModel = new HashMap<>(16); + objModel.put("aliAccessKey", accountEntity.getAppId()); + objModel.put("aliSecret", accountEntity.getAppSecret()); + objModel.put("tencentSecretId", accountEntity.getAppId()); + objModel.put("tencentSecretKey", accountEntity.getAppSecret()); + objModel.put("tencentAppId", accountEntity.getSdkAppId()); + objModel.put("tencentAppKey", accountEntity.getAppKey()); + SmsModel smsConfig = JsonUtil.getJsonToBean(objModel, SmsModel.class); + int company = Integer.parseInt(accountEntity.getChannel()); + // 组装接受用户 + StringBuffer toUserIdList = new StringBuffer(); +// for (String toUserId : toUserIdsList) { + UserEntity userEntity = userService.getInfo(toUserId); + if (isPhone(userEntity.getMobilePhone())) { + toUserIdList.append(userEntity.getMobilePhone() + ","); + } +// } + //获取消息模板参数 + Map msgMap = getParamMap(entity.getId(), parameterMap); +// if(parameterMap.containsKey("@flowLink")){ +// parameterMap.put("@flowLink",link); +// } + //短信参数 + Map smsMap = new HashMap<>(); + if (entity != null) { + smsMap = smsFieldService.getParamMap(entity.getTemplateId(), msgMap); + if (ObjectUtil.isNotEmpty(smsMap)) { + if (smsMap.containsValue("@FlowLink")) { + //链接数据保存 + this.saveShortLink(pcLink, appLink, shortLink, userInfo, toUserId, msg); + for (String key : smsMap.keySet()) { + if (smsMap.get(key).equals("@FlowLink")) { + smsMap.put(key, link + " "); + } + } + } + } + } +// if(smsMap.containsKey("title")) { +// smsMap.keySet().removeIf(k -> k.equals("title")); +// } + if (msgTemEntity != null) { + monitorEntity.setMessageTemplateId(msgTemEntity.getId()); + String endPoint = ""; + if ("1".equals(accountEntity.getChannel())) { + endPoint = accountEntity.getEndPoint(); + } else if ("2".equals(accountEntity.getChannel())) { + endPoint = accountEntity.getZoneName(); + } + String content = SmsUtil.querySmsTemplateContent(company, smsConfig, endPoint, accountEntity.getZoneParam(), msgTemEntity.getTemplateCode()); + if (StringUtil.isNotBlank(content) && !"null".equals(content)) { + if (ObjectUtil.isNotEmpty(smsMap) && !"null".equals(smsMap)) { + if ("1".equals(accountEntity.getChannel())) { + if (content.contains("${")) { + for (String key : smsMap.keySet()) { + content = content.replace("${" + key + "}", smsMap.get(key).toString()); + } + } + } else if ("2".equals(accountEntity.getChannel())) { + if (content.contains("{")) { + for (String key : smsMap.keySet()) { + content = content.replace("{" + key + "}", smsMap.get(key).toString()); + } + } + } + } + } + //创建消息监控 + monitorEntity = createMessageMonitor(monitorEntity, msgTemEntity, accountEntity, content, userInfo, null, null); + if (StringUtil.isEmpty(toUserIdList)) { + log.error("全部接收人对应的手机号码格式错误"); + messageMonitorService.create(monitorEntity); + continue; + } + SmsUtil.sentSms(company, smsConfig, endPoint, accountEntity.getZoneParam(), toUserIdList.toString(), accountEntity.getSmsSignature(), msgTemEntity.getTemplateCode(), smsMap); + messageMonitorService.create(monitorEntity); + continue; + } else { + log.error("消息模板数据不存在"); + messageMonitorService.create(monitorEntity); + continue; + } + } else { + log.error("账号配置数据不存在"); + messageMonitorService.create(monitorEntity); + continue; + } + } + } + + /** + * 发送微信公众号消息 + * + * @param toUserIdsList + * @param userInfo + * @param sendType + * @param entity + * @param parameterMap + * @return + */ + public JSONObject SendWXGzhChat(List toUserIdsList, UserInfo userInfo, String sendType, SendConfigTemplateEntity entity, Map contentMsg, Map parameterMap) { + //获取短信配置 + AccountConfigEntity accountEntity = accountConfigService.getInfo(entity.getAccountConfigId()); + // 获取消息模板详情 + MessageTemplateConfigEntity msgTemEntity = messageTemplateConfigService.getInfo(entity.getTemplateId()); + //消息监控 + JSONObject retJson = new JSONObject(); + boolean code = true; + StringBuilder error = new StringBuilder(); + for (String userId : toUserIdsList) { + MessageMonitorEntity monitorEntity = new MessageMonitorEntity(); + monitorEntity.setId(RandomUtil.uuId()); + monitorEntity.setSendTime(DateUtil.getNowDate()); + monitorEntity.setCreatorTime(DateUtil.getNowDate()); + monitorEntity.setCreatorUserId(userInfo.getUserId()); + error = new StringBuilder(); + if (StringUtil.isEmpty(userId)) { + code = false; + error = error.append(";").append("接收人为空!"); + messageMonitorService.create(monitorEntity); + continue; + } + UserEntity userEntity = userService.getById(userId); + if (ObjectUtil.isEmpty(userEntity)) { + code = false; + error = error.append(";").append("用户不存在!"); + messageMonitorService.create(monitorEntity); + continue; + } + monitorEntity.setReceiveUser(userId); + + if (ObjectUtil.isEmpty(msgTemEntity)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":消息模板数据不存在!"); + messageMonitorService.create(monitorEntity); + continue; + } + monitorEntity.setMessageTemplateId(msgTemEntity.getId()); + String content = msgTemEntity.getContent(); + String templateKId = msgTemEntity.getTemplateCode(); + if (ObjectUtil.isEmpty(accountEntity)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":公众号账号配置数据不存在!"); + messageMonitorService.create(monitorEntity); + continue; + } + monitorEntity.setAccountId(accountEntity.getId()); + //创建消息监控 + monitorEntity = createMessageMonitor(monitorEntity, msgTemEntity, accountEntity, content, userInfo, toUserIdsList, null); + // 获取系统配置 + String appId = accountEntity.getAppId(); + String appsecret = accountEntity.getAppSecret(); + String wxxcxAppId = msgTemEntity.getXcxAppId(); + String type = msgTemEntity.getWxSkip(); + + String title = ""; + //获取消息模板参数 + Map msgMap = getParamMap(entity.getId(), parameterMap); +// if(parameterMap.containsKey("@flowLink")){ +// parameterMap.put("@flowLink",link); +// } + //微信公众号参数 + Map smsMap = new HashMap<>(); + if (entity != null) { + smsMap = smsFieldService.getParamMap(entity.getTemplateId(), msgMap); + } + if (smsMap.containsKey("title")) { + title = smsMap.get("title").toString(); + smsMap.keySet().removeIf(k -> k.equals("title")); + } + monitorEntity.setTitle(title); + // 相关参数验证 + if (StringUtil.isEmpty(templateKId)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":微信公众号模板id未创建!"); + messageMonitorService.create(monitorEntity); + continue; + } + if (StringUtil.isEmpty(appId)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":公众号appid为空为空!"); + messageMonitorService.create(monitorEntity); + continue; + } + if (StringUtil.isEmpty(appsecret)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":公众号appsecret为空为空!"); + messageMonitorService.create(monitorEntity); + continue; + } + // 获取微信公众号的token + String token = WXGZHWebChatUtil.getAccessToken(appId, appsecret); + if (StringUtil.isEmpty(token)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":获取微信公众号token失败!"); + messageMonitorService.create(monitorEntity); + continue; + } + // 微信公众号发送消息 + String msg = contentMsg.get(userId) != null ? contentMsg.get(userId) : "{}"; + byte[] bytes = msg.getBytes(StandardCharsets.UTF_8); + String encode = Base64.getEncoder().encodeToString(bytes); + //流程审批页面链接地址 + String pcLink = jnpfOauthConfig.getJnpfFrontDomain() + "/workFlowDetail?config=" + encode; + String appLink = jnpfOauthConfig.getJnpfAppDomain() + "/pages/workFlow/flowBefore/index?config=" + encode; + //转换为短链 + String shortLink = shortLinkService.shortLink(pcLink + userId + msgTemEntity.getMessageType()); + shortLink = getShortLink(pcLink, userId, shortLink, msgTemEntity.getMessageType()); + if (!"1".equals(type)) { + //链接数据保存 + this.saveShortLink(pcLink, appLink, shortLink, userInfo, userId, msg); + } + String link = jnpfOauthConfig.getJnpfDomain() + "/api/message/ShortLink/" + shortLink; + if (StringUtil.isNotBlank(userInfo.getTenantId())) { + link = link + "/" + userInfo.getTenantId(); + } + if (ObjectUtil.isNotEmpty(smsMap)) { + for (String key : smsMap.keySet()) { + if (smsMap.get(key).equals("@FlowLink")) { + smsMap.put(key, link); + } + } + } else { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":公众号模板参数为空!"); + messageMonitorService.create(monitorEntity); + continue; + } + WechatUserEntity wechatUserEntity = wechatUserService.getInfoByGzhId(userId, accountEntity.getAppKey()); + if (wechatUserEntity != null) { + if (StringUtil.isNotBlank(wechatUserEntity.getOpenId())) { + String openid = wechatUserEntity.getOpenId(); + String apptoken = authUtil.loginTempUser(userId, userInfo.getTenantId()); + String pagepath = "/pages/workFlow/flowBefore/index?config=" + encode + "&token=" + apptoken; + if (ObjectUtil.isNotEmpty(smsMap)) { + //参数封装 + String message = WXGZHWebChatUtil.messageJson(templateKId, openid, wxxcxAppId, pagepath, smsMap, title, type, link); + //发送信息 + retJson = WXGZHWebChatUtil.sendMessage(token, message); + } + JSONObject rstObj = WXGZHWebChatUtil.getMessageList(token); + List wxgzhMessageModelList = JsonUtil.getJsonToList(rstObj.get("template_list"), WxgzhMessageModel.class); + WxgzhMessageModel messageModel = wxgzhMessageModelList.stream().filter(t -> t.getTemplateId().equals(templateKId)).findFirst().orElse(null); + if (ObjectUtil.isNotEmpty(messageModel)) { + content = messageModel.getContent(); + if (StringUtil.isNotBlank(content) && !"null".equals(content)) { + if (ObjectUtil.isNotEmpty(smsMap) && !"null".equals(smsMap)) { + if (content.contains(".DATA}")) { + for (String key : smsMap.keySet()) { + content = content.replace(key, smsMap.get(key).toString()); + } + } + } + } + } + if (!retJson.getBoolean("code")) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":" + retJson.get("error")); + messageMonitorService.create(monitorEntity); + continue; + } + messageMonitorService.create(monitorEntity); + continue; + + } else { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":" + "账号未绑定公众号"); + messageMonitorService.create(monitorEntity); + continue; + } + } else { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":" + "账号未绑定公众号"); + messageMonitorService.create(monitorEntity); + continue; + } + } + if (code) { + retJson.put("code", true); + retJson.put("error", MsgCode.SU012.get()); + } else { + String msg = error.toString(); + if (StringUtil.isNotBlank(msg)) { + msg = msg.substring(1); + } + retJson.put("code", false); + retJson.put("error", msg); + } + return retJson; + } + + /** + * 获取系统配置 + */ + private Map getSystemConfig() { + // 获取系统配置 + List configList = sysconfigService.getList("SysConfig"); + Map objModel = new HashMap<>(16); + for (SysConfigEntity entity : configList) { + objModel.put(entity.getFkey(), entity.getValue()); + } + return objModel; + } + + private Map getParamMap(String templateId, Map paramMap) { + Map map = new HashMap<>(); + for (String key : paramMap.keySet()) { + if (key.contains(templateId)) { + map.put(key.substring(templateId.length()), paramMap.get(key)); + } + } + return map; + } + + private MessageMonitorEntity createMessageMonitor(MessageMonitorEntity monitorEntity, MessageTemplateConfigEntity msgTemEntity, AccountConfigEntity accountEntity, String content, UserInfo userInfo, List toUserIdsList, String title) { + if (msgTemEntity != null) { + monitorEntity.setMessageTemplateId(msgTemEntity.getId()); + monitorEntity.setMessageSource(msgTemEntity.getMessageSource()); + if (StringUtil.isNotBlank(title)) { + monitorEntity.setTitle(title); + } else { + monitorEntity.setTitle(msgTemEntity.getTitle()); + } + monitorEntity.setMessageType(msgTemEntity.getMessageType()); + if ("6".equals(msgTemEntity.getMessageType()) && accountEntity != null) { + monitorEntity.setReceiveUser(accountEntity.getWebhookAddress()); + } else { + if (toUserIdsList != null && toUserIdsList.size() > 0) { + monitorEntity.setReceiveUser(JsonUtil.getObjectToString(toUserIdsList)); + } + } + } else { + if (StringUtil.isNotBlank(title)) { + monitorEntity.setTitle(title); + } + monitorEntity.setMessageType("1"); + } + if (accountEntity != null) { + monitorEntity.setAccountId(accountEntity.getId()); + monitorEntity.setAccountCode(accountEntity.getEnCode()); + monitorEntity.setAccountName(accountEntity.getFullName()); + } + monitorEntity.setContent(content); + return monitorEntity; + } + + private String getShortLink(String pcLink, String userId, String shortLink, String type) { + if (StringUtil.isNotBlank(shortLink)) { + ShortLinkEntity entity = shortLinkService.getInfoByLink(shortLink); + if (entity != null) { + if (pcLink.equals(entity.getRealPcLink())) { + return shortLink; + } else { + shortLink = shortLinkService.shortLink(pcLink + userId + type); + return getShortLink(pcLink, userId, shortLink, type); + } + } else { + return shortLink; + } + } else { + shortLink = shortLinkService.shortLink(pcLink + userId + type); + return getShortLink(pcLink, userId, shortLink, type); + } + } + + private void saveShortLink(String pcLink, String appLink, String shortLink, UserInfo userInfo, String userId, String bodyText) { + ShortLinkEntity shortLinkEntity = shortLinkService.getInfoByLink(shortLink); + if (shortLinkEntity == null) { + ShortLinkEntity entity = new ShortLinkEntity(); + Map sysConfig = getSystemConfig(); + String linkTime = sysConfig.get("linkTime"); + Integer isClick = 0; + if (StringUtil.isNotBlank(sysConfig.get("isClick")) && !"null".equals(sysConfig.get("isClick"))) { + isClick = Integer.parseInt(sysConfig.get("isClick")); + } + int unClickNum = 20; + if (StringUtil.isNotBlank(sysConfig.get("unClickNum")) && !"null".equals(sysConfig.get("unClickNum"))) { + unClickNum = Integer.parseInt(sysConfig.get("unClickNum")); + } + entity.setId(RandomUtil.uuId()); + entity.setRealPcLink(pcLink); + entity.setRealAppLink(appLink); + entity.setShortLink(shortLink); + entity.setBodyText(bodyText); +// entity.setTenantId(userInfo.getTenantId()); + entity.setUserId(userId); + entity.setIsUsed(isClick); + entity.setUnableNum(unClickNum); + entity.setClickNum(0); + if (StringUtil.isNotEmpty(linkTime)) { + Date unableTime = getUnableTime(linkTime); + entity.setUnableTime(unableTime); + } else { + entity.setUnableTime(DateUtil.dateAddHours(DateUtil.getNowDate(), 24)); + } + entity.setCreatorTime(DateUtil.getNowDate()); + entity.setCreatorUserId(userInfo.getUserId()); + shortLinkService.save(entity); + } + } + + private Date getUnableTime(String linkTime) { + Double time = Double.parseDouble(linkTime); + int second = Double.valueOf(time * 60 * 60).intValue(); + Date unableTime = DateUtil.dateAddSeconds(DateUtil.getNowDate(), second); + return unableTime; + } + + public static boolean isPhone(String phone) { + if (StringUtil.isNotBlank(phone) && !"null".equals(phone)) { + return Pattern.matches("^1[3-9]\\d{9}$", phone); + } + return false; + } + + public void sendDelegateMsg(SentMessageForm sentMessageForm){ + messageService.sentScheduleMessage(sentMessageForm,""); + } + + /** + * 系统参数替换 + * + * @param parameterMap + * @param contentMsg + * @param title + * @param userInfo + * @return + */ + private String systemParam(Map parameterMap, Map contentMsg, String title, UserInfo userInfo) { + if (parameterMap.isEmpty()) { + return title = title.replaceAll("\\{@Title}", contentMsg.get("Title")) + .replaceAll("\\{@CreatorUserName}", userInfo.getUserName()) + .replaceAll("\\{@Content}", contentMsg.get("Content")) + .replaceAll("\\{@Remark}", contentMsg.get("Remark")) + .replaceAll("\\{@StartDate}", contentMsg.get("StartDate")) + .replaceAll("\\{@StartTime}", contentMsg.get("StartTime")) + .replaceAll("\\{@EndDate}", contentMsg.get("EndDate")) + .replaceAll("\\{@FlowLink}", "") + .replaceAll("\\{@EndTime}", contentMsg.get("EndTime")); + } + return title; + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/SmsAliYunUtil.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/SmsAliYunUtil.java new file mode 100644 index 0000000..c68fa0a --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/SmsAliYunUtil.java @@ -0,0 +1,142 @@ +package jnpf.base.util; + +import com.aliyun.dysmsapi20170525.Client; +import com.aliyun.dysmsapi20170525.models.*; +import com.aliyun.teaopenapi.models.*; +import jnpf.util.JsonUtil; +import jnpf.util.ParameterUtil; +import jnpf.util.StringUtil; +import lombok.extern.slf4j.Slf4j; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * 阿里云发送短信 + * + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021/4/21 11:45 + */ +@Slf4j +public class SmsAliYunUtil { + + /** + * 使用AK&SK初始化账号Client + * + * @param accessKeyId + * @param accessKeySecret + * @param endpoint + * @return Client + */ + private static Client createClient(String accessKeyId, String accessKeySecret, String endpoint) { + try { + Config config = new Config() + // 您的AccessKey ID + .setAccessKeyId(accessKeyId) + // 您的AccessKey Secret + .setAccessKeySecret(accessKeySecret); + // 访问的域名 + config.endpoint = endpoint; + return new Client(config); + } catch (Exception e) { + log.error("创建阿里云短信客户端错误:" + e.getMessage()); + } + return null; + } + + /** + * 查询短信模板详情 + * + * @param accessKeyId + * @param accessKeySecret + * @param endpoint + * @param templateId + */ + public static List querySmsTemplateRequest(String accessKeyId, String accessKeySecret, String endpoint, String templateId) { + try { + Client client = createClient(accessKeyId, accessKeySecret, endpoint); + QuerySmsTemplateRequest querySmsTemplateRequest = new QuerySmsTemplateRequest() + .setTemplateCode(templateId); + QuerySmsTemplateResponse querySmsTemplateResponse = client.querySmsTemplate(querySmsTemplateRequest); + String templateContent = querySmsTemplateResponse.getBody().templateContent; + if (StringUtil.isNotEmpty(templateContent)) { + List list = new ArrayList<>(); + ParameterUtil.parse("${", "}", templateContent, list); + return list; + } else { + return null; + } + } catch (Exception e) { + log.error("查询阿里云短信模板错误:" + e.getMessage()); + } + return null; + } + + + /** + * 查询短信模板详情 + * + * @param accessKeyId + * @param accessKeySecret + * @param endpoint + * @param templateId + */ + public static String querySmsTemplateContent(String accessKeyId, String accessKeySecret, String endpoint, String templateId) { + try { + Client client = createClient(accessKeyId, accessKeySecret, endpoint); + QuerySmsTemplateRequest querySmsTemplateRequest = new QuerySmsTemplateRequest() + .setTemplateCode(templateId); + QuerySmsTemplateResponse querySmsTemplateResponse = client.querySmsTemplate(querySmsTemplateRequest); + String templateContent = querySmsTemplateResponse.getBody().templateContent; + if (StringUtil.isNotEmpty(templateContent)) { + return templateContent; + } else { + return null; + } + } catch (Exception e) { + log.error("查询阿里云短信模板错误:" + e.getMessage()); + } + return null; + } + /** + * 发送短信 + * + * @param accessKeyId + * @param accessKeySecret + * @param endpoint + * @param phoneNumbers + * @param signContent + * @param templateId + * @param map + * @return + */ + public static String sentSms(String accessKeyId, String accessKeySecret, String endpoint, String phoneNumbers, String signContent, String templateId, Map map) { + // 复制代码运行请自行打印 API 的返回值 + try { + Client client = createClient(accessKeyId, accessKeySecret, endpoint); + SendSmsRequest sendSmsRequest = new SendSmsRequest(); + // 接收者的号码 + sendSmsRequest.setPhoneNumbers(phoneNumbers); + // 签名 + sendSmsRequest.setSignName(signContent); + // 模板id + sendSmsRequest.setTemplateCode(templateId); + // 模板参数 + sendSmsRequest.setTemplateParam(JsonUtil.getObjectToString(map)); + SendSmsResponse sendSmsResponse = client.sendSms(sendSmsRequest); + if (!"Ok".equalsIgnoreCase(sendSmsResponse.body.code)) { + log.error("发送短信失败:" + sendSmsResponse.getBody().message); + return "发送短信失败:" + sendSmsResponse.getBody().message; + } + return "Ok"; + } catch (Exception e) { + log.error("发送短信失败:" + e.getMessage()); + return "发送短信失败:" + e.getMessage(); + } +// return null; + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/SmsTenCentCloudUtil.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/SmsTenCentCloudUtil.java new file mode 100644 index 0000000..0140c7b --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/SmsTenCentCloudUtil.java @@ -0,0 +1,165 @@ +package jnpf.base.util; + +import com.tencentcloudapi.common.Credential; +import com.tencentcloudapi.common.profile.ClientProfile; +import com.tencentcloudapi.common.profile.HttpProfile; +import com.tencentcloudapi.sms.v20210111.SmsClient; +import com.tencentcloudapi.sms.v20210111.models.*; +import jnpf.util.ParameterUtil; +import lombok.extern.slf4j.Slf4j; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + + +/** + * 腾讯云发送短信类 + * + * @author JNPF + * @版本: V3.2.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021/4/21 11:58 + */ +@Slf4j +public class SmsTenCentCloudUtil { + + /** + * 创建客户端 + * + * @param accessKeyId + * @param accessKeySecret + * @return + */ + private static SmsClient createClient(String accessKeyId, String accessKeySecret, String endpoint, String region) { + SmsClient smsClient = null; + try { + Credential cred = new Credential(accessKeyId, accessKeySecret); + // 实例化一个http选项,可选的,没有特殊需求可以跳过 + HttpProfile httpProfile = new HttpProfile(); + httpProfile.setEndpoint(endpoint); + // 实例化一个client选项,可选的,没有特殊需求可以跳过 + ClientProfile clientProfile = new ClientProfile(); + clientProfile.setHttpProfile(httpProfile); + // 实例化要请求产品的client对象,clientProfile是可选的 + smsClient = new SmsClient(cred, region, clientProfile); + } catch (Exception e) { + log.error("创建客户端失败:" + e.getMessage()); + } + return smsClient; + } + + /** + * 查询短信模板详情 + * + * @param accessKeyId + * @param accessKeySecret + * @param templateId + */ + public static List querySmsTemplateRequest(String accessKeyId, String accessKeySecret, String endpoint, String region, String templateId) { + try { + SmsClient smsClient = createClient(accessKeyId, accessKeySecret, endpoint, region); + // 实例化一个请求对象,每个接口都会对应一个request对象 + DescribeSmsTemplateListRequest req = new DescribeSmsTemplateListRequest(); + req.setTemplateIdSet(new Long[]{Long.valueOf(templateId)}); + req.setInternational(0L); + // 返回的resp是一个DescribeSmsTemplateListResponse的实例,与请求对象对应 + DescribeSmsTemplateListResponse resp = smsClient.DescribeSmsTemplateList(req); + // 输出json格式的字符串回包 + System.out.println(DescribeSmsTemplateListResponse.toJsonString(resp)); + DescribeTemplateListStatus[] describeTemplateStatusSet = resp.getDescribeTemplateStatusSet(); + for (DescribeTemplateListStatus describeTemplateListStatus : describeTemplateStatusSet) { + String templateContent = describeTemplateListStatus.getTemplateContent(); + List list = new ArrayList<>(); + ParameterUtil.parse("{", "}", templateContent, list); + return list; + } + } catch (Exception e) { + log.error("查询短信模板参数失败:" + e.getMessage()); + } + return null; + } + + /** + * 查询短信模板详情 + * + * @param accessKeyId + * @param accessKeySecret + * @param templateId + */ + public static String querySmsTemplateContent(String accessKeyId, String accessKeySecret, String endpoint, String region, String templateId) { + try { + SmsClient smsClient = createClient(accessKeyId, accessKeySecret, endpoint, region); + // 实例化一个请求对象,每个接口都会对应一个request对象 + DescribeSmsTemplateListRequest req = new DescribeSmsTemplateListRequest(); + req.setTemplateIdSet(new Long[]{Long.valueOf(templateId)}); + req.setInternational(0L); + // 返回的resp是一个DescribeSmsTemplateListResponse的实例,与请求对象对应 + DescribeSmsTemplateListResponse resp = smsClient.DescribeSmsTemplateList(req); + // 输出json格式的字符串回包 + System.out.println(DescribeSmsTemplateListResponse.toJsonString(resp)); + DescribeTemplateListStatus[] describeTemplateStatusSet = resp.getDescribeTemplateStatusSet(); + for (DescribeTemplateListStatus describeTemplateListStatus : describeTemplateStatusSet) { + String templateContent = describeTemplateListStatus.getTemplateContent(); + return templateContent; + } + } catch (Exception e) { + log.error("查询短信模板参数失败:" + e.getMessage()); + } + return null; + } + /** + * 发送短信 + * + * @param accessKeyId + * @param accessKeySecret + * @param phoneNumbers + * @param appId + * @param signContent + * @param templateId + * @param map + * @return + */ + public static String sentSms(String accessKeyId, String accessKeySecret, String endpoint, String region, String phoneNumbers, String appId, String signContent, String templateId, Map map) { + try { + SmsClient client = createClient(accessKeyId, accessKeySecret, endpoint, region); + // 实例化一个请求对象,每个接口都会对应一个request对象 + SendSmsRequest req = new SendSmsRequest(); + // 接收人 + String[] split = phoneNumbers.split(","); + req.setPhoneNumberSet(split); + // AppId + req.setSmsSdkAppId(appId); + // TemplateId + req.setTemplateId(templateId); + // SignName + req.setSignName(signContent); + // 参数 + List list = new ArrayList<>(); + for (String key : map.keySet()) { + String value = map.get(key) != null ? String.valueOf(map.get(key)) : ""; + list.add(value); + } + req.setTemplateParamSet(list.toArray(new String[list.size()])); + // 返回的resp是一个SendSmsResponse的实例,与请求对象对应 + SendSmsResponse resp = client.SendSms(req); + // 判断是否发送成功 + SendStatus[] sendStatusSet = resp.getSendStatusSet(); + for (SendStatus sendStatus : sendStatusSet) { + String code = sendStatus.getCode(); + if ("Ok".equalsIgnoreCase(code)) { + return "Ok"; + } else { + log.error("发送短信失败:" + sendStatus.getMessage()); + return "发送短信失败:" + sendStatus.getMessage(); + } + } + } catch (Exception e) { + log.error("发送短信失败:" + e.getMessage()); + return "发送短信失败:" + e.getMessage(); + } + return null; + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/SmsUtil.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/SmsUtil.java new file mode 100644 index 0000000..fce9d95 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/SmsUtil.java @@ -0,0 +1,68 @@ +package jnpf.base.util; + +import jnpf.base.model.systemconfig.SmsModel; +import org.springframework.stereotype.Component; + +import java.util.List; +import java.util.Map; + +/** + * 短信工具类 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-12-11 + */ +@Component +public class SmsUtil { + + /** + * 获取短信模板参数 + * + * @param type + * @param smsModel + * @param templateId + * @return + */ + public static List querySmsTemplateRequest(Integer type, SmsModel smsModel, String endpoint, String region, String templateId) { + if (type == 1) { + return SmsAliYunUtil.querySmsTemplateRequest(smsModel.getAliAccessKey(), smsModel.getAliSecret(), endpoint, templateId); + } + return SmsTenCentCloudUtil.querySmsTemplateRequest(smsModel.getTencentSecretId(), smsModel.getTencentSecretKey(), endpoint , region, templateId); + } + + /** + * 获取短信模板内容 + * + * @param type + * @param smsModel + * @param templateId + * @return + */ + public static String querySmsTemplateContent(Integer type, SmsModel smsModel, String endpoint, String region, String templateId) { + if (type == 1) { + return SmsAliYunUtil.querySmsTemplateContent(smsModel.getAliAccessKey(), smsModel.getAliSecret(), endpoint, templateId); + } + return SmsTenCentCloudUtil.querySmsTemplateContent(smsModel.getTencentSecretId(), smsModel.getTencentSecretKey(), endpoint , region, templateId); + } + + /** + * 发送消息 + * + * @param type + * @param smsModel + * @param phoneNumbers + * @param signContent + * @param templateId + * @param map + * @return + */ + public static String sentSms(Integer type, SmsModel smsModel, String endpoint, String region, String phoneNumbers, String signContent, String templateId, Map map) { + if (type == 1) { + return SmsAliYunUtil.sentSms(smsModel.getAliAccessKey(), smsModel.getAliSecret(), endpoint, phoneNumbers, signContent, templateId, map); + } + return SmsTenCentCloudUtil.sentSms(smsModel.getTencentSecretId(), smsModel.getTencentSecretKey(), endpoint, region, phoneNumbers, smsModel.getTencentAppId(), signContent, templateId, map); + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/SmtpUtil.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/SmtpUtil.java new file mode 100644 index 0000000..8496b49 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/SmtpUtil.java @@ -0,0 +1,167 @@ +package jnpf.base.util; + +import com.baomidou.mybatisplus.core.toolkit.Constants; +import jnpf.base.model.MailAccount; +import jnpf.base.model.MailFile; +import jnpf.base.model.MailModel; +import lombok.Cleanup; +import lombok.extern.slf4j.Slf4j; +import org.springframework.mail.javamail.JavaMailSenderImpl; +import org.springframework.mail.javamail.MimeMessageHelper; + +import javax.mail.Session; +import javax.mail.Transport; +import javax.mail.internet.MimeMessage; +import java.io.File; +import java.util.Properties; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Slf4j +public class SmtpUtil { + + private String host = null; + private Integer port = null; + private String username = null; + private String password = null; + private String emailform = null; + private String timeout = "2500"; + private String personal = null; + private JavaMailSenderImpl mailSender = null; + + + /** + * 邮箱验证 + * + * @param mailAccount + * @return + */ + public static String checkConnected(MailAccount mailAccount) { + try { + Properties props = getProperties(mailAccount.getSsl()); + Session session = getSession(props); + @Cleanup Transport transport = getTransport(session, mailAccount); + return "true"; + } catch (Exception e) { + log.error(e.getMessage()); + return e.getMessage(); + } + } + + /** + * 获取Session + * + * @param props + */ + private static Session getSession(Properties props) { + Session session = Session.getInstance(props); + session.setDebug(true); + return session; + } + + /** + * 获取Properties + * + * @param ssl + */ + private static Properties getProperties(boolean ssl) { + Properties props = new Properties(); + props.setProperty("mail.transport.protocol", "smtp"); + props.setProperty("mail.smtp.auth", "true"); + props.setProperty("mail.smtp.timeout", "2500"); + // 设置接收超时时间 + props.put("mail.smtp.connectiontimeout", "5000"); + // 设置写入超时时间 + props.put("mail.smtp.writetimeout", "25000"); + if (ssl) { + props.put("mail.smtp.ssl.enable", "true"); + props.put("mail.smtp.socketFactory.fallback", "false"); + props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory"); + } + return props; + } + + /** + * 获取Transport + */ + private static Transport getTransport(Session session, MailAccount mailAccount) throws Exception { + Transport transport = session.getTransport(); + transport.connect(mailAccount.getSmtpHost(), mailAccount.getSmtpPort(), mailAccount.getAccount(), mailAccount.getPassword()); + return transport; + } + + /** + * springboot发送邮件 + * @param mailAccount + */ + public SmtpUtil(MailAccount mailAccount) { + host = mailAccount.getSmtpHost(); + port = mailAccount.getSmtpPort(); + username = mailAccount.getAccount(); + password = mailAccount.getPassword(); + emailform = mailAccount.getAccount(); + personal = mailAccount.getAccountName(); + mailSender = createMailSender(); + } + + /** + * 邮件发送器 + * + * @return 配置好的工具 + */ + private JavaMailSenderImpl createMailSender() { + JavaMailSenderImpl sender = new JavaMailSenderImpl(); + sender.setHost(host); + sender.setPort(port); + sender.setUsername(username); + sender.setPassword(password); + sender.setDefaultEncoding(Constants.UTF_8); + Properties props = new Properties(); + props.setProperty("mail.smtp.auth", "true"); + props.setProperty("mail.smtp.timeout", timeout); + // 设置接收超时时间 + props.put("mail.smtp.connectiontimeout", "5000"); + // 设置写入超时时间 + props.put("mail.smtp.writetimeout", "25000"); + props.setProperty("mail.smtp.starttls.enable", "true"); + props.setProperty("mail.smtp.starttls.required", "true"); + props.setProperty("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory"); + sender.setJavaMailProperties(props); + return sender; + } + + /** + * 发送邮件 + * + * @param mailModel 邮件实体 + * @throws Exception 异常 + */ + public void sendMail(String type, String path, MailModel mailModel) throws Exception { + MimeMessage mimeMessage = mailSender.createMimeMessage(); + MimeMessageHelper messageHelper = new MimeMessageHelper(mimeMessage, true, Constants.UTF_8); + messageHelper.setFrom(emailform,mailModel.getFromName()); + messageHelper.setTo(mailModel.getRecipient()); + if (mailModel.getBcc() != null) { + messageHelper.setBcc(mailModel.getBcc()); + } + if (mailModel.getCc() != null) { + messageHelper.setCc(mailModel.getCc()); + } + messageHelper.setSubject(mailModel.getSubject()); + messageHelper.setText(mailModel.getBodyText(), true); + if (mailModel.getAttachment().size() > 0) { + for (MailFile mailFile : mailModel.getAttachment()) { +// UploadUtil.downToLocal(type, mailFile.getFileId(), FileTypeEnum.MAIL, path); + File file = new File(path + mailFile.getFileId()); + String fileName = mailFile.getFileId(); + messageHelper.addAttachment(fileName, file); + } + } + mailSender.send(mimeMessage); + } +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/SourceUtil.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/SourceUtil.java new file mode 100644 index 0000000..b4c3a15 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/SourceUtil.java @@ -0,0 +1,55 @@ +package jnpf.base.util; + +import com.baomidou.mybatisplus.annotation.DbType; +import com.baomidou.mybatisplus.generator.config.DataSourceConfig; +import jnpf.database.source.DbBase; +import jnpf.database.source.impl.DbPostgre; +import jnpf.database.util.*; +import jnpf.util.StringUtil; +import jnpf.util.data.DataSourceContextHolder; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +public class SourceUtil { + + public static DataSourceConfig dbConfig(String dbName, DataSourceUtil linkEntity) { + if (linkEntity == null) { + if(TenantDataSourceUtil.isTenantAssignDataSource()){ + linkEntity = TenantDataSourceUtil.getTenantAssignDataSource(DataSourceContextHolder.getDatasourceId()).toDbLinkEntity(); + }else{ + linkEntity = DynamicDataSourceUtil.dataSourceUtil.init(); + } + if (!"KingbaseES".equals(linkEntity.getDbType()) && !"PostgreSQL".equals(linkEntity.getDbType()) && StringUtil.isNotEmpty(dbName)) { + linkEntity.setDbName(dbName); + } + } + DataSourceConfig dsc = new DataSourceConfig(); + try { + DbBase dbBase = DbTypeUtil.getDb(linkEntity); + dsc.setDbType(dbBase.getMpDbType()); + dsc.setDriverName(dbBase.getDriver()); + dsc.setUsername(linkEntity.getUserName()); + dsc.setPassword(linkEntity.getPassword()); + dsc.setSchemaName(linkEntity.getDbSchema()); + + // oracle 默认 schema = username + if (dsc.getDbType().getDb().equalsIgnoreCase(DbType.ORACLE.getDb()) + || dsc.getDbType().getDb().equalsIgnoreCase(DbType.KINGBASE_ES.getDb())) { + dsc.setSchemaName(linkEntity.getUserName()); + } + //postgre默认 public + if (dsc.getDbType().getDb().equalsIgnoreCase(DbType.POSTGRE_SQL.getDb())) { + dsc.setSchemaName(DbPostgre.DEF_SCHEMA); + } + dsc.setUrl(ConnUtil.getUrl(linkEntity)); + } catch (Exception e) { + e.getStackTrace(); + } + return dsc; + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/SynDingTalkUtil.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/SynDingTalkUtil.java new file mode 100644 index 0000000..5e60f09 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/SynDingTalkUtil.java @@ -0,0 +1,580 @@ +package jnpf.base.util; + +import com.alibaba.fastjson.JSONObject; +import com.dingtalk.api.DefaultDingTalkClient; +import com.dingtalk.api.DingTalkClient; +import com.dingtalk.api.request.*; +import com.dingtalk.api.response.*; +import com.taobao.api.ApiException; +import jnpf.message.model.message.DingTalkDeptModel; +import jnpf.message.model.message.DingTalkUserModel; +import jnpf.message.model.message.OraganizeListVO; +import jnpf.permission.entity.OrganizeEntity; +import jnpf.util.StringUtil; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +/** + * 同步到企业微信的接口 + * + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021/4/30 17:11 + */ +public class SynDingTalkUtil { + + /** + * token 接口 + */ + public static final String TOKEN = "https://oapi.dingtalk.com/gettoken"; + + //--------------------------------------------部门-------------------------------------- + + /** + * 创建部门 + */ + public static final String CREATE_DEPARTMENT = "https://oapi.dingtalk.com/topapi/v2/department/create"; + + /** + * 更新部门 + */ + public static final String UPDATE_DEPARTMENT = "https://oapi.dingtalk.com/topapi/v2/department/update"; + + /** + * 删除部门 + */ + public static final String DELETE_DEPARTMENT = "https://oapi.dingtalk.com/topapi/v2/department/delete"; + + /** + * 获取部门列表 + */ + public static final String GET_DEPARTMENT_LIST = "https://oapi.dingtalk.com/topapi/v2/department/listsub"; + + /** + * 获取单个部门信息 + */ + public static final String GET_DEPARTMENT_INFO = "https://oapi.dingtalk.com/topapi/v2/department/get"; + + + //-------------------------------------------用户----------------------------------------------------- + + /** + * 创建用户 + */ + public static final String CREATE_USER = "https://oapi.dingtalk.com/topapi/v2/user/create"; + + /** + * 更新用户 + */ + public static final String UPDATE_USER = "https://oapi.dingtalk.com/topapi/v2/user/update"; + + /** + * 删除用户 + */ + public static final String DELETE_USER = "https://oapi.dingtalk.com/topapi/v2/user/delete"; + + /** + * 获取用户列表(返回精简的员工信息列表) + */ + public static final String GET_USER_LIST = "https://oapi.dingtalk.com/topapi/user/listsimple"; + + /** + * 获取用户列表(返回详细的员工信息列表) + */ + public static final String GET_USER_DETAIL_LIST = "https://oapi.dingtalk.com/topapi/v2/user/list"; + + /** + * 获取单个成员信息 + */ + public static final String GET_SINGLE_USER = "https://oapi.dingtalk.com/topapi/v2/user/get"; + + + + /** + * 获取接口访问凭证 + */ + public static JSONObject getAccessToken(String corpId, String corpSecret){ + JSONObject retMsg = new JSONObject(); + retMsg.put("code",true); + try{ + DingTalkClient client = new DefaultDingTalkClient(TOKEN); + OapiGettokenRequest req = new OapiGettokenRequest(); + req.setAppkey(corpId); + req.setAppsecret(corpSecret); + req.setHttpMethod("GET"); + OapiGettokenResponse rsp = client.execute(req); + retMsg.put("access_token", rsp.getAccessToken()); + if (!rsp.isSuccess()) { + retMsg.put("code", false); + retMsg.put("access_token", ""); + } + } catch (ApiException e) { + retMsg.put("code", false); + retMsg.put("access_token", ""); + } + + return retMsg; + } + + //------------------------------------接口:部门管理的增删改查------------------------------------- + + /** + * 创建钉钉部门接口 + * @param deptModel + * @param accessToken + * @return + */ + public static JSONObject createDepartment(DingTalkDeptModel deptModel, String accessToken) { + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + String deptId = "0"; + try { + DingTalkClient client = new DefaultDingTalkClient(CREATE_DEPARTMENT); + OapiV2DepartmentCreateRequest req = new OapiV2DepartmentCreateRequest(); + req.setParentId(deptModel.getParentId()); + req.setName(deptModel.getName()); + req.setOrder(deptModel.getOrder()); + req.setCreateDeptGroup(deptModel.getCreateDeptGroup()); + req.setSourceIdentifier(deptModel.getSourceIdentifier()); + OapiV2DepartmentCreateResponse rsp = client.execute(req, accessToken); + if (rsp.isSuccess()) { + codeFlag = true; + JSONObject bodyObject = JSONObject.parseObject(rsp.getBody()); + bodyObject = JSONObject.parseObject(bodyObject.getString("result")); + deptId = bodyObject.getLong("dept_id").toString(); + }else{ + codeFlag = false; + errorMsg = rsp.getErrmsg(); + } + } catch (ApiException e) { + codeFlag = false; + errorMsg = e.toString(); + } + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + retMsg.put("retDeptId",deptId); + return retMsg; + } + + /** + * 更新钉钉部门接口 + * @param deptModel + * @param accessToken + * @return + */ + public static JSONObject updateDepartment(DingTalkDeptModel deptModel, String accessToken) { + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + try { + DingTalkClient client = new DefaultDingTalkClient(UPDATE_DEPARTMENT); + OapiV2DepartmentUpdateRequest req = new OapiV2DepartmentUpdateRequest(); + req.setDeptId(deptModel.getDeptId()); + req.setParentId(deptModel.getParentId()); + req.setOrder(deptModel.getOrder()); + req.setName(deptModel.getName()); + // 设置部门主管,先建部门、再建设用户、再更新部门主管 + if(StringUtil.isNotEmpty(deptModel.getDeptManagerUseridList())){ + req.setDeptManagerUseridList(deptModel.getDeptManagerUseridList()); + } + OapiV2DepartmentUpdateResponse rsp = client.execute(req, accessToken); + if (!rsp.isSuccess()) { + codeFlag = false; + errorMsg = rsp.getErrmsg(); + } + } catch (ApiException e) { + codeFlag = false; + errorMsg = e.toString(); + } + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + return retMsg; + } + + /** + * 删除钉钉部门接口 + * @param id + * @param accessToken + * @return + */ + public static JSONObject deleteDepartment(Long id, String accessToken){ + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + + try { + DingTalkClient client = new DefaultDingTalkClient(DELETE_DEPARTMENT); + OapiV2DepartmentDeleteRequest req = new OapiV2DepartmentDeleteRequest(); + req.setDeptId(id); + OapiV2DepartmentDeleteResponse rsp = client.execute(req, accessToken); + if (!rsp.isSuccess()) { + codeFlag = false; + errorMsg = rsp.getErrmsg(); + } + } catch (ApiException e) { + codeFlag = false; + errorMsg = e.toString(); + } + + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + + return retMsg; + } + + /** + * 获取钉钉部门列表信息接口(一次只能获取下一级部门,不能多级查询) + * @param id + * @param accessToken + * @return + */ + public static JSONObject getDepartmentList(Long id, String accessToken){ + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + List departmentAllList = new ArrayList<>(); + + retMsg = getDepartmentListSub(id,accessToken,departmentAllList); + if(!retMsg.getBoolean("code")){ + codeFlag = false; + errorMsg = "获取钉钉所有部门列表失败"; + } + + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + retMsg.put("department",departmentAllList); + + return retMsg; + } + + /** + * 递归获取部门信息列表 + * @param id + * @param accessToken + * @param departmentAllList + * @return + */ + public static JSONObject getDepartmentListSub(Long id, String accessToken, List departmentAllList){ + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + List departmentList = new ArrayList<>(); + + try { + DingTalkClient client = new DefaultDingTalkClient(GET_DEPARTMENT_LIST); + OapiV2DepartmentListsubRequest req = new OapiV2DepartmentListsubRequest(); + req.setDeptId(id); + OapiV2DepartmentListsubResponse rsp = client.execute(req, accessToken); + if (!rsp.isSuccess()) { + retMsg.put("code",false); + retMsg.put("error",rsp.getErrmsg()); + return retMsg; + }else{ + departmentList = rsp.getResult(); + if(departmentList.size()>0){ + for(OapiV2DepartmentListsubResponse.DeptBaseResponse deptEntity : departmentList){ + departmentAllList.add(deptEntity); + retMsg = getDepartmentListSub(deptEntity.getDeptId(),accessToken,departmentAllList); + if(!retMsg.getBoolean("code")){ + codeFlag = false; + errorMsg = rsp.getErrmsg(); + break; + } + } + } + } + } catch (ApiException e) { + codeFlag = false; + errorMsg = e.toString(); + } + + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + + return retMsg; + } + + /** + * 获取指定的钉钉部门信息接口 + * @param deptId + * @param accessToken + * @return + */ + public static JSONObject getDepartmentInfo(Long deptId, String accessToken){ + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + OapiV2DepartmentGetResponse.DeptGetResponse departmentInfo = new OapiV2DepartmentGetResponse.DeptGetResponse(); + + try { + DingTalkClient client = new DefaultDingTalkClient(GET_DEPARTMENT_INFO); + OapiV2DepartmentGetRequest req = new OapiV2DepartmentGetRequest(); + req.setDeptId(deptId); + OapiV2DepartmentGetResponse rsp = client.execute(req, accessToken); + if (!rsp.isSuccess()) { + codeFlag = false; + errorMsg = rsp.getErrmsg(); + }else{ + departmentInfo = rsp.getResult(); + } + } catch (ApiException e) { + codeFlag = false; + errorMsg = e.toString(); + } + + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + retMsg.put("departmentInfo",departmentInfo); + + return retMsg; + } + + + //------------------------------------接口:用户管理的增删改查------------------------------------- + + /** + * 创建钉钉用户信息接口 + * @param userModel + * @param accessToken + * @return + */ + public static JSONObject createUser(DingTalkUserModel userModel, String accessToken){ + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + + try { + DingTalkClient client = new DefaultDingTalkClient(CREATE_USER); + OapiV2UserCreateRequest req = new OapiV2UserCreateRequest(); + req.setUserid(userModel.getUserid()); + req.setName(userModel.getName()); + req.setMobile(userModel.getMobile()); + req.setTelephone(userModel.getTelephone()); + req.setJobNumber(userModel.getJobNumber()); + req.setTitle(userModel.getTitle()); + req.setEmail(userModel.getEmail()); + req.setWorkPlace(userModel.getWorkPlace()); + req.setDeptIdList(userModel.getDeptIdList()); + req.setHiredDate(userModel.getHiredDate()); + // 以下属性未设置 + // hide_mobile org_email extension senior_mode login_email + // exclusive_account exclusive_account_type login_id init_password + + OapiV2UserCreateResponse rsp = client.execute(req, accessToken); + if (!rsp.isSuccess()) { + codeFlag = false; + errorMsg = rsp.getErrmsg(); + } + } catch (ApiException e) { + codeFlag = false; + errorMsg = e.toString(); + } + + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + return retMsg; + } + + + /** + * 更新钉钉用户信息接口 + * @param userModel + * @param accessToken + * @return + */ + public static JSONObject updateUser(DingTalkUserModel userModel, String accessToken){ + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + + try { + DingTalkClient client = new DefaultDingTalkClient(UPDATE_USER); + OapiV2UserUpdateRequest req = new OapiV2UserUpdateRequest(); + req.setUserid(userModel.getUserid()); + req.setName(userModel.getName()); + req.setMobile(userModel.getMobile()); + req.setTelephone(userModel.getTelephone()); + req.setJobNumber(userModel.getJobNumber()); + req.setTitle(userModel.getTitle()); + req.setEmail(userModel.getEmail()); + req.setWorkPlace(userModel.getWorkPlace()); + req.setDeptIdList(userModel.getDeptIdList()); + req.setHiredDate(userModel.getHiredDate()); + // 以下属性未设置 + // hide_mobile org_email extension senior_mode login_email + // exclusive_account exclusive_account_type login_id init_password + + OapiV2UserUpdateResponse rsp = client.execute(req, accessToken); + if (!rsp.isSuccess()) { + codeFlag = false; + errorMsg = rsp.getErrmsg(); + } + } catch (ApiException e) { + codeFlag = false; + errorMsg = e.toString(); + } + + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + return retMsg; + } + + /** + * 删除钉钉用户信息接口 + * @param userId + * @param accessToken + * @return + */ + public static JSONObject deleteUser(String userId, String accessToken){ + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + + try { + DingTalkClient client = new DefaultDingTalkClient(DELETE_USER); + OapiV2UserDeleteRequest req = new OapiV2UserDeleteRequest(); + req.setUserid(userId); + OapiV2UserDeleteResponse rsp = client.execute(req, accessToken); + if (!rsp.isSuccess()) { + codeFlag = false; + errorMsg = rsp.getErrmsg(); + } + } catch (ApiException e) { + codeFlag = false; + errorMsg = e.toString(); + } + + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + return retMsg; + } + + public static JSONObject getUserDingList(List departmentList, String accessToken){ + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + List userAllList = new ArrayList<>(); + + // 钉钉限制每页记录数:不超过100 +// retMsg = getUserListSub(1L,0L,100L,accessToken,userAllList); +// if(!retMsg.getBoolean("code")){ +// codeFlag = false; +// errorMsg = "获取钉钉所有用户列表失败"; +// } + + if(departmentList.size()>0 ){ + for(String deptId : departmentList){ + retMsg = getUserListSub(Long.parseLong(deptId),0L,100L,accessToken,userAllList); + if(!retMsg.getBoolean("code")){ + codeFlag = false; + errorMsg = "获取钉钉所有用户列表失败"; + break; + } + } + } + + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + retMsg.put("userlist",userAllList); + return retMsg; + } + + + public static JSONObject getUserList(List departmentList, String accessToken){ + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + List userAllList = new ArrayList<>(); + + // 钉钉限制每页记录数:不超过100 + retMsg = getUserListSub(1L,0L,100L,accessToken,userAllList); + if(!retMsg.getBoolean("code")){ + codeFlag = false; + errorMsg = "获取钉钉所有用户列表失败"; + } + + if(departmentList.size()>0 && retMsg.getBoolean("code")){ + for(DingTalkDeptModel deptEntity : departmentList){ + retMsg = getUserListSub(deptEntity.getDeptId(),0L,100L,accessToken,userAllList); + if(!retMsg.getBoolean("code")){ + codeFlag = false; + errorMsg = "获取钉钉所有用户列表失败"; + break; + } + } + } + + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + retMsg.put("userlist",userAllList); + return retMsg; + } + + public static JSONObject getUserListSub(Long deptId, Long cursor, Long size, String accessToken, + List userAllList){ + JSONObject retMsg = new JSONObject(); + List userList = new ArrayList<>(); + OapiV2UserListResponse.PageResult pageResult = new OapiV2UserListResponse.PageResult(); + + try { + DingTalkClient client = new DefaultDingTalkClient(GET_USER_DETAIL_LIST); + OapiV2UserListRequest req = new OapiV2UserListRequest(); + req.setDeptId(deptId); + req.setCursor(cursor); + req.setSize(size); + OapiV2UserListResponse rsp = client.execute(req, accessToken); + if(rsp.isSuccess()){ + pageResult = rsp.getResult(); + userList = pageResult.getList(); + for(OapiV2UserListResponse.ListUserResponse userEntity : userList){ + userAllList.add(userEntity); + } + if(pageResult.getHasMore()){ + retMsg = getUserListSub(deptId,pageResult.getNextCursor(),size,accessToken,userAllList); + if(!retMsg.getBoolean("code")){ + retMsg.put("code",false); + retMsg.put("error",rsp.getErrmsg()); + return retMsg; + } + } + } + } catch (ApiException e) { + retMsg.put("code",false); + retMsg.put("error",e.toString()); + return retMsg; + } + + retMsg.put("code",true); + retMsg.put("error",""); + return retMsg; + } + + + + /** + * 按目录树结构数据转化为列表 + * @param selectorVO + * @param organizeList + * @param listByOrder + */ + public static void getOrganizeTreeToList(OraganizeListVO selectorVO, Map organizeList, List listByOrder){ + if(selectorVO.isHasChildren()) { + List voChildren = selectorVO.getChildren(); + Iterator iterator = voChildren.iterator(); + while (iterator.hasNext()) { + OraganizeListVO organizeSelectorVO = iterator.next(); + OrganizeEntity entity = organizeList.get(organizeSelectorVO.getId()); + listByOrder.add(entity); + if (organizeSelectorVO.isHasChildren()) { + getOrganizeTreeToList(organizeSelectorVO, organizeList, listByOrder); + } + } + } + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/SynQyWebChatUtil.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/SynQyWebChatUtil.java new file mode 100644 index 0000000..adc2d54 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/SynQyWebChatUtil.java @@ -0,0 +1,458 @@ +package jnpf.base.util; + +import com.alibaba.fastjson.JSONObject; +import jnpf.exception.WxErrorException; +import jnpf.message.model.message.OraganizeListVO; +import jnpf.permission.entity.OrganizeEntity; +import jnpf.util.JsonUtil; +import jnpf.util.wxutil.HttpUtil; + +import java.util.*; + +/** + * 同步到企业微信的接口 + * + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021/4/21 8:20 + */ +public class SynQyWebChatUtil { + /** + * token 接口 + */ + public static final String TOKEN = "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=%s&corpsecret=%s"; + + //--------------------------------------------部门-------------------------------------- + + /** + * 创建部门 + */ + public static final String CREATE_DEPARTMENT = "https://qyapi.weixin.qq.com/cgi-bin/department/create?access_token=%s"; + + /** + * 更新部门 + */ + public static final String UPDATE_DEPARTMENT = "https://qyapi.weixin.qq.com/cgi-bin/department/update?access_token=%s"; + + /** + * 删除部门 + */ + public static final String DELETE_DEPARTMENT = "https://qyapi.weixin.qq.com/cgi-bin/department/delete?access_token=%s&id=%s"; + + /** + * 获取部门列表 + */ + public static final String GET_DEPARTMENT_LIST = "https://qyapi.weixin.qq.com/cgi-bin/department/list?access_token=%s&id=%s"; + + public static final String GET_DEPARTMENT_SIMPLELIST = "https://qyapi.weixin.qq.com/cgi-bin/department/simplelist?access_token=%s&id=%s"; + + //-------------------------------------------用户----------------------------------------------------- + + /** + * 创建用户 + */ + public static final String CREATE_USER = "https://qyapi.weixin.qq.com/cgi-bin/user/create?access_token=%s"; + + /** + * 更新用户 + */ + public static final String UPDATE_USER = "https://qyapi.weixin.qq.com/cgi-bin/user/update?access_token=%s"; + + /** + * 删除用户 + */ + public static final String DELETE_USER = "https://qyapi.weixin.qq.com/cgi-bin/user/delete?access_token=%s&userid=%s"; + + /** + * 获取用户列表(返回精简的员工信息列表) + */ + public static final String GET_USER_LIST = "https://qyapi.weixin.qq.com/cgi-bin/user/simplelist?access_token=%s&department_id=%s&fetch_child=%s"; + + /** + * 获取用户列表(返回详细的员工信息列表) + */ + public static final String GET_USER_DETAIL_LIST = "https://qyapi.weixin.qq.com/cgi-bin/user/list?access_token=%s&department_id=%s&fetch_child=%s"; + + /** + * 获取单个成员信息 + */ + public static final String GET_SINGLE_USER = "https://qyapi.weixin.qq.com/cgi-bin/user/get?access_token=%s&userid=%s"; + + /** + * 自建获取单个成员信息 + */ + public static final String GET_LINKEDCORP_USER = "https://qyapi.weixin.qq.com/cgi-bin/linkedcorp/user/get?access_token=%s"; + + + //-------------------------------------上传--------------------------------------------------- + + /** + * 上传素材 + */ + public static final String MEDIA_UPLOAD = "https://qyapi.weixin.qq.com/cgi-bin/media/upload?access_token=%s&type=%s"; + + //-------------------------------------消息-------------------------------------------------- + + /** + * 发送消息 + */ + public static final String SEND_MESSAGE = "https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=%s"; + + + /** + * 获取接口访问凭证 + */ + public static JSONObject getAccessToken(String corpId, String corpSecret) { + JSONObject rstObj = HttpUtil.httpRequest(String.format(TOKEN,corpId, corpSecret), "GET", null); + rstObj.put("code",true); + if (HttpUtil.isWxError(rstObj)) { + rstObj.put("code",false); + rstObj.put("access_token",""); + } + return rstObj; + } + + /** + * 发送消息 20210416 Add By GongXishan + * 不抛出异常,返回Json + */ + public static JSONObject sendMessage(String message, String accessToken){ + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + JSONObject rstObj = HttpUtil.httpRequest(String.format(SEND_MESSAGE, accessToken), "POST", message); + if (HttpUtil.isWxError(rstObj)) { + codeFlag = false; + errorMsg = rstObj.toString(); + } + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + return retMsg; + } + + + /** + * 向企业微信发送信息 + * @param corpId + * @param corpSecret + * @param agentId + * @param toUserId + * @param contents + * @return + */ + public static JSONObject sendWxMessage(String corpId, String corpSecret, String agentId, String toUserId, String contents) { + JSONObject retMsg = null; + JSONObject message = null; + JSONObject tokenObject = null; + JSONObject content = null; + + message = new JSONObject(); + message.put("touser", toUserId); + message.put("agentid", agentId); + content = new JSONObject(); + content.put("content", contents); + message.put("text", content); + message.put("msgtype", "text"); + tokenObject = getAccessToken(corpId, corpSecret); + if(tokenObject.getString("access_token")!=null && !"".equals(tokenObject.getString("access_token"))){ + retMsg = sendMessage(message.toJSONString(), tokenObject.getString("access_token")); + }else + { + retMsg.put("code",false); + retMsg.put("error","access_token值为空,不能发送信息!"); + } + return retMsg; + } + + //------------------------------------企业微信接口:部门管理的增删改查------------------------------------- + + /** + * 创建部门 + * @param department json数据格式 + * @param accessToken + * @return + * @throws WxErrorException + */ + public static JSONObject createDepartment(String department, String accessToken) throws WxErrorException { + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + String qyDeptId = "0"; + JSONObject rstObj = HttpUtil.httpRequest(String.format(CREATE_DEPARTMENT, accessToken), "POST", department); + if (HttpUtil.isWxError(rstObj)) { + codeFlag = false; + errorMsg = rstObj.toString(); + }else{ + codeFlag = true; + qyDeptId = rstObj.getInteger("id").toString(); + } + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + retMsg.put("retDeptId",qyDeptId); + return retMsg; + } + + /** + * 更新部门 + * @param department json数据格式 + * @param accessToken + * @return + * @throws WxErrorException + */ + public static JSONObject updateDepartment(String department, String accessToken) throws WxErrorException { + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + JSONObject rstObj = HttpUtil.httpRequest(String.format(UPDATE_DEPARTMENT, accessToken), "POST", department); + if (HttpUtil.isWxError(rstObj)) { + codeFlag = false; + errorMsg = rstObj.toString(); + } + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + + return retMsg; + } + + /** + * 删除部门 + * @param id 部门ID + * @param accessToken + * @return + * @throws WxErrorException + */ + public static JSONObject deleteDepartment(String id, String accessToken) throws WxErrorException { + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + JSONObject rstObj = HttpUtil.httpRequest(String.format(DELETE_DEPARTMENT, accessToken, id), "GET", null); + if (HttpUtil.isWxError(rstObj)) { + codeFlag = false; + errorMsg = rstObj.toString(); + } + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + + return retMsg; + } + + /** + * 部门列表 + * @param id 根部门ID + * @param accessToken + * @return + * @throws WxErrorException + */ + public static JSONObject getDepartmentList(String id, String accessToken) throws WxErrorException { + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + String departmentStr = ""; + JSONObject rstObj = HttpUtil.httpRequest(String.format(GET_DEPARTMENT_LIST, accessToken, id), "GET", null); + if (HttpUtil.isWxError(rstObj)) { + codeFlag = false; + errorMsg = rstObj.toString(); + }else{ + departmentStr = rstObj.getString("department"); + } + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + retMsg.put("department",departmentStr); + return retMsg; + } + + //------------------------------------------企业微信接口:用户管理的增删改查-------------------------------------------- + + /** + * 创建用户 + * @param user json数据格式 + * @param accessToken + * @return + * @throws WxErrorException + */ + public static JSONObject createUser(String user, String accessToken) throws WxErrorException { + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + JSONObject rstObj = HttpUtil.httpRequest(String.format(CREATE_USER, accessToken), "POST", user); + if (HttpUtil.isWxError(rstObj)) { + codeFlag = false; + errorMsg = rstObj.toString(); + } + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + return retMsg; + } + + /** + * 更新用户 + * @param user json数据格式 + * @param accessToken + * @return + * @throws WxErrorException + */ + public static JSONObject updateUser(String user, String accessToken) throws WxErrorException { + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + JSONObject rstObj = HttpUtil.httpRequest(String.format(UPDATE_USER, accessToken), "POST", user); + if (HttpUtil.isWxError(rstObj)) { + codeFlag = false; + errorMsg = rstObj.toString(); + } + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + return retMsg; + } + + /** + * 删除用户 + * @param id 用户ID + * @param accessToken + * @return + * @throws WxErrorException + */ + public static JSONObject deleteUser(String id, String accessToken) throws WxErrorException { + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + JSONObject rstObj = HttpUtil.httpRequest(String.format(DELETE_USER, accessToken, id), "GET", null); + if (HttpUtil.isWxError(rstObj)) { + codeFlag = false; + errorMsg = rstObj.toString(); + } + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + return retMsg; + } + + /** + * 获取单个成员信息 + * @param id 企业微信成员ID + * @param accessToken + * @return + * @throws WxErrorException + */ + public static JSONObject getUserById(String id, String accessToken) throws WxErrorException { + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + String userInfo = ""; + JSONObject rstObj = HttpUtil.httpRequest(String.format(GET_SINGLE_USER, accessToken, id), "GET", null); + if (HttpUtil.isWxError(rstObj)) { + codeFlag = false; + errorMsg = rstObj.toString(); + }else{ + userInfo = rstObj.toJSONString(); + } + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + retMsg.put("userinfo",userInfo); + return retMsg; + } + + /** + * 自建应用获取单个成员信息 + * @param id 企业微信成员ID + * @param accessToken + * @return + * @throws WxErrorException + */ + public static JSONObject getLinkedcorpUserById(String id, String accessToken) throws WxErrorException { + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + String userInfo = ""; + JSONObject userObject = new JSONObject(); + userObject.put("userid",id); + JSONObject rstObj = HttpUtil.httpRequest(String.format(GET_LINKEDCORP_USER, accessToken), "POST", JsonUtil.getObjectToString(userObject)); + if (HttpUtil.isWxError(rstObj)) { + codeFlag = false; + errorMsg = rstObj.toString(); + }else{ + userInfo = rstObj.getJSONObject("user_info").toJSONString(); + } + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + retMsg.put("userinfo",userInfo); + return retMsg; + } + + + /** + * 获取用户列表(返回精简的成员信息) + * @param id + * @param isGetChild 1-递归获取,0-只获取本部门 + * @param accessToken + * GET_USER_LIST + * @return + * @throws WxErrorException + */ + public static JSONObject getUserList(String id, String isGetChild, String accessToken) throws WxErrorException { + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + List> userList = new ArrayList<>(); + JSONObject rstObj = HttpUtil.httpRequest(String.format(GET_USER_DETAIL_LIST, accessToken, id,isGetChild), "GET", null); + if (HttpUtil.isWxError(rstObj)) { + codeFlag = false; + errorMsg = rstObj.toString(); + }else{ + userList = JsonUtil.getJsonToList(rstObj.getJSONArray("userlist")); + } + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + retMsg.put("userlist",userList); + return retMsg; + } + + /** + * 获取用户列表(返回详细的成员信息) + * @param id + * @param isGetChild 1-递归获取,0-只获取本部门 + * @param accessToken + * @return + * @throws WxErrorException + */ + public static JSONObject getUserDetailList(String id, String isGetChild, String accessToken) throws WxErrorException { + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + String userList = ""; + JSONObject rstObj = HttpUtil.httpRequest(String.format(GET_USER_DETAIL_LIST, accessToken, id,isGetChild), "GET", null); + if (HttpUtil.isWxError(rstObj)) { + codeFlag = false; + errorMsg = rstObj.toString(); + }else{ + userList = rstObj.getString("userlist"); + } + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + retMsg.put("userlist",userList); + return retMsg; + } + + + /** + * 按目录树结构数据转化为列表 + * @param selectorVO + * @param organizeList + * @param listByOrder + */ + public static void getOrganizeTreeToList(OraganizeListVO selectorVO, Map organizeList, List listByOrder){ + if(selectorVO.isHasChildren()) { + List voChildren = selectorVO.getChildren(); + Iterator iterator = voChildren.iterator(); + while (iterator.hasNext()) { + OraganizeListVO organizeSelectorVO = iterator.next(); + OrganizeEntity entity = organizeList.get(organizeSelectorVO.getId()); + listByOrder.add(entity); + if (organizeSelectorVO.isHasChildren()) { + getOrganizeTreeToList(organizeSelectorVO, organizeList, listByOrder); + } + } + } + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/TempJsonUtil.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/TempJsonUtil.java new file mode 100644 index 0000000..04684e3 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/TempJsonUtil.java @@ -0,0 +1,1611 @@ +//package jnpf.util; +// +//import jnpf.base.UserInfo; +//import jnpf.base.service.BillRuleService; +//import jnpf.base.service.DataInterfaceService; +//import jnpf.base.service.DictionaryDataService; +//import jnpf.base.service.DictionaryTypeService; +//import jnpf.config.ConfigValueUtil; +//import jnpf.entity.system.base.DictionaryDataEntity; +//import jnpf.entity.system.base.DictionaryTypeEntity; +//import jnpf.entity.system.permission.OrganizeEntity; +//import jnpf.entity.system.permission.PositionEntity; +//import jnpf.entity.system.permission.UserEntity; +//import jnpf.exception.DataException; +//import jnpf.model.system.permission.user.UserAllModel; +//import jnpf.model.visualdev.visualdevmodeldata.FormDataModel; +//import jnpf.model.visualdev.visualdevmodeldata.fields.FieLdsModel; +//import jnpf.model.visualdev.visualdevmodeldata.fields.config.ConfigModel; +//import jnpf.permission.service.OrganizeService; +//import jnpf.permission.service.PositionService; +//import jnpf.permission.service.UserService; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.stereotype.Component; +// +//import java.sql.Connection; +//import java.sql.PreparedStatement; +//import java.sql.ResultSet; +//import java.sql.SQLException; +//import java.util.*; +//import java.util.stream.Collectors; +// +//@Component +//public class TempJsonUtil { +// +// @Autowired +// private UserService userService; +// @Autowired +// private BillRuleService billRuleService; +// @Autowired +// private PositionService positionService; +// @Autowired +// private UserProvider userProvider; +// @Autowired +// private ConfigValueUtil configValueUtil; +// @Autowired +// private DataSourceUtil dataSourceUtil; +// @Autowired +// private OrganizeService organizeService; +// @Autowired +// private DictionaryTypeService dictionaryTypeService; +// @Autowired +// private DictionaryDataService dictionaryDataService; +// @Autowired +// private DataInterfaceService dataInterfaceService; +// @Autowired +// private VisualdevModelDataService visualdevModelDataService; +// @Autowired +// private VisualdevService visualdevService; +// +// //--------------------------列表---------------------------------------------- +// +// /** +// * 获取有表数据 +// * +// * @param visualdevEntity 实体 +// * @param tableModelList 表字段 +// * @param keyJsonMap 搜索字段 +// */ +// public List> listTable(VisualdevEntity visualdevEntity, List tableModelList, Map keyJsonMap) throws DataException { +// Map columnData = JSONUtil.StringToMap(visualdevEntity.getColumnData()); +// List modelList = JSONUtil.getJsonToList(columnData.get("columnList").toString(), IndexGridField6Model.class); +// String mainTable = tableModelList.stream().filter(t -> "1".equals(t.getTypeId())).findFirst().get().getTable(); +// StringBuilder feilds = new StringBuilder(); +// for (IndexGridField6Model model : modelList) { +// feilds.append(model.getProp() + ","); +// } +// if (modelList.size() > 0) { +// feilds.append("F_ID"); +// } +// StringBuilder sql = new StringBuilder(); +// sql.append("select " + feilds + " from" + " " + mainTable); +// if (!StringUtil.isEmpty(columnData.get("defaultSidx").toString())) { +// sql.append(" order by " + columnData.get("defaultSidx").toString() + " " + columnData.get("sort").toString()); +// } else { +// sql.append(" order by F_Id " + columnData.get("sort").toString()); +// } +// List list = getTableDataList(sql.toString()); +// List> result = getList(list, visualdevEntity.getFormData(), keyJsonMap, true); +// return result; +// } +// +// /** +// * 获取无表数据 +// * +// * @param list 数据 +// * @param visualdevEntity 实体 +// * @param keyJsonMap 搜索字段 +// * @return +// */ +// public List> list(VisualdevEntity visualdevEntity, List list, Map keyJsonMap) { +// List> result = getList(list, visualdevEntity.getFormData(), keyJsonMap, false); +// return result; +// } +// +// /** +// * 列表数据转换 +// * +// * @param list 数据的list +// * @param formDataJson formTempJson +// * @param keyJsonMap 搜索字段 +// * @return +// */ +// private List> getList(List list, String formDataJson, Map keyJsonMap, boolean typeKey) { +// List userAll = userService.getAll(); +// Map jnpfKey = new HashMap<>(16); +// Map keyList = new HashMap<>(16); +// //formTempJson +// FormDataModel formDataModels = JSONUtil.getJsonToBean(formDataJson, FormDataModel.class); +// List fieLdsModelList = JSONUtil.getJsonToList(formDataModels.getFields(), FieLdsModel.class); +// tempListJson(fieLdsModelList, jnpfKey, keyList, typeKey); +// //返回结果 +// List> realList = new ArrayList<>(); +// boolean flag = keyJsonMap != null ? true : false; +// for (VisualdevModelDataEntity dataEntity : list) { +// Map formData = JSONUtil.StringToMap(dataEntity.getData()); +// //判断对象是否有匹配 +// boolean iskey = false; +// Map resulMap = new HashMap<>(16); +// if (formData != null) { +// for (String key : formData.keySet()) { +// String modelKey = jnpfKey.get(key); +// if (typeKey) { +// modelKey = jnpfKey.get(key.toUpperCase()); +// } +// Object formValue = formData.get(key); +// List fullName = new ArrayList<>(); +// if (!iskey && flag) { +// for (String jsonKey : keyJsonMap.keySet()) { +// if (jsonKey.equals(key)) { +// iskey = String.valueOf(formValue).contains(String.valueOf(keyJsonMap.get(jsonKey))); +// } +// } +// } +// if ("select".equals(modelKey) || "radio".equals(modelKey)) { +// List optionList = (List) keyList.get(key); +// OptinModels model = optionList.stream().filter(t -> t.getId().equals(formValue)).findFirst().orElse(null); +// if (model != null) { +// formData.put(key, model.getFullName()); +// } +// } +// if ("createUser".equals(modelKey) || "modifyUser".equals(modelKey)) { +// UserAllModel userModel = userAll.stream().filter(t -> t.getId().equals(formValue)).findFirst().orElse(null); +// if (userModel != null) { +// formData.put(key, userModel.getRealName()); +// } +// } +// if ("checkbox".equals(modelKey)) { +// if (formValue != null) { +// List checkbox = new ArrayList<>(); +// if (formValue instanceof String) { +// checkbox = JSONUtil.getJsonToList(String.valueOf(formValue), String.class); +// } else { +// checkbox = (List) formValue; +// } +// if (checkbox != null) { +// List optionList = (List) keyList.get(key); +// for (String checkValue : checkbox) { +// OptinModels model = optionList.stream().filter(t -> t.getId().equals(checkValue)).findFirst().orElse(null); +// if (model != null) { +// fullName.add(model.getFullName()); +// } +// } +// formData.put(key, String.join("", fullName)); +// } +// } +// } +// //公司和部门 +// if ("comSelect".equals(modelKey) || "depSelect".equals(modelKey) || "currDept".equals(modelKey)) { +// List optionList = (List) keyList.get(key); +// OrganizeEntity organize = optionList.stream().filter(t -> t.getId().equals(formValue)).findFirst().orElse(null); +// if (organize != null) { +// formData.put(key, organize.getFullName()); +// } +// } +// //用户 +// if ("userSelect".equals(modelKey)) { +// List userList = (List) keyList.get(key); +// UserEntity user = userList.stream().filter(t -> t.getId().equals(formValue)).findFirst().orElse(null); +// if (user != null) { +// formData.put(key, user.getRealName()); +// } +// } +// //岗位 +// if ("posSelect".equals(modelKey) || "currPosition".equals(modelKey)) { +// List positionList = (List) keyList.get(key); +// PositionEntity position = positionList.stream().filter(t -> t.getId().equals(formValue)).findFirst().orElse(null); +// if (position != null) { +// formData.put(key, position.getFullName()); +// } +// } +// //字典 +// if ("dicSelect".equals(modelKey)) { +// List dictypeList = (List) keyList.get(key); +// DictionaryTypeEntity dic = dictypeList.stream().filter(t -> t.getId().equals(formValue)).findFirst().orElse(null); +// if (dic != null) { +// formData.put(key, dic.getFullName()); +// } +// } +// //日期 +// if ("date".equals(modelKey)) { +// Object valuse = formData.get(key); +// formData.put(key, ""); +// if (StringUtil.isNotEmpty(String.valueOf(valuse)) && valuse != null) { +// if (valuse instanceof String) { +// String value = String.valueOf(valuse); +// if (StringUtil.isNotEmpty(value)) { +// String dateValue = "1970-01-01"; +// if (value.length() > 10) { +// dateValue = DateUtil.daFormat(DateUtil.StringToDate(value)); +// } else { +// dateValue = DateUtil.daFormat(DateUtil.StringToDate(value + " 00:00:00")); +// } +// if (!"1970-01-01".equals(dateValue)) { +// formData.put(key, dateValue); +// } +// } +// } else if (valuse instanceof Long) { +// Long value = Long.valueOf(String.valueOf(valuse)); +// String dateValue = DateUtil.daFormat(value); +// formData.put(key, dateValue); +// } +// } +// } +// resulMap = formData; +// } +// } +// resulMap.put("id", dataEntity.getId()); +// if (flag) { +// if (iskey) { +// realList.add(resulMap); +// } +// } else { +// realList.add(resulMap); +// } +// } +// return realList; +// } +// +// /** +// * 列表解析json +// * +// * @param list 模板json +// * @param jnpfKey 主表的jnpfkey +// * @param keyList 主表字段存的list +// */ +// private void tempListJson(List list, Map jnpfKey, Map keyList, boolean typeKey) { +// List dicDatayList = dictionaryDataService.getList(); +// List organizeList = organizeService.getList(); +// List userList = userService.getList(); +// List positionList = positionService.getList(); +// List dictypeList = dictionaryTypeService.getList(); +// for (FieLdsModel fieLdsModel : list) { +// String model = fieLdsModel.getVModel(); +// if (typeKey) { +// model = model.toUpperCase(); +// } +// ConfigModel config = fieLdsModel.getConfig(); +// String key = config.getJnpfKey(); +// jnpfKey.put(model, key); +// if ("select".equals(key) || "checkbox".equals(key) || "radio".equals(key)) { +// String type = config.getDataType(); +// List optionslList = new ArrayList<>(); +// String fullName = config.getProps().getLabel(); +// String value = config.getProps().getValue(); +// if ("dictionary".equals(type)) { +// String dictionaryType = config.getDictionaryType(); +// List dicList = dicDatayList.stream().filter(t -> t.getDictionaryTypeId().equals(dictionaryType)).collect(Collectors.toList()); +// for (DictionaryDataEntity dataEntity : dicList) { +// OptinModels optionsModel = new OptinModels(); +// optionsModel.setId(dataEntity.getId()); +// optionsModel.setFullName(dataEntity.getFullName()); +// optionslList.add(optionsModel); +// } +// } else if ("static".equals(type)) { +// String optionsJson = "[]"; +// if (fieLdsModel.getSlot() != null) { +// //新的json +// optionsJson = fieLdsModel.getSlot().getOptions(); +// } else if (config.getOptions() != null) { +// //旧的json +// optionsJson = config.getOptions(); +// } +// List> staticList = JSONUtil.getJsonToListMap(optionsJson); +// for (Map options : staticList) { +// OptinModels optionsModel = new OptinModels(); +// optionsModel.setId(String.valueOf(options.get(value))); +// optionsModel.setFullName(String.valueOf(options.get(fullName))); +// optionslList.add(optionsModel); +// } +// } else if ("dynamic".equals(type)) { +// String propsUrl = config.getPropsUrl(); +// //获取远端数据 +// Object object = dataInterfaceService.infoToId(propsUrl); +// Map dynamicMap = JSONUtil.EntityToMap(object); +// if (dynamicMap.get("data") != null) { +// List> dataList = JSONUtil.getJsonToListMap(dynamicMap.get("data").toString()); +// for (Map options : dataList) { +// OptinModels optionsModel = new OptinModels(); +// optionsModel.setId(String.valueOf(options.get(value))); +// optionsModel.setFullName(String.valueOf(options.get(fullName))); +// optionslList.add(optionsModel); +// } +// } +// } +// keyList.put(model, optionslList); +// } +// //公司和部门 +// if ("comSelect".equals(key) || "depSelect".equals(key) || "currDept".equals(key)) { +// keyList.put(model, organizeList); +// } +// //用户 +// if ("userSelect".equals(key)) { +// keyList.put(model, userList); +// } +// //岗位 +// if ("posSelect".equals(key) || "currPosition".equals(key)) { +// keyList.put(model, positionList); +// } +// //数据字典 +// if ("dicSelect".equals(key)) { +// keyList.put(model, dictypeList); +// } +// } +// } +// +// //---------------------------删除-------------------------------------------- +// public void delete(String id, List tableModelList) throws DataException { +// String mastTableName = tableModelList.stream().filter(t -> "1".equals(t.getTypeId())).findFirst().get().getTable(); +// StringBuffer delMast = new StringBuffer("delete from " + mastTableName + " where F_ID='" + id + "';"); +// List childTable = tableModelList.stream().filter(t -> !"1".equals(t.getTypeId())).collect(Collectors.toList()); +// StringBuffer delTable = new StringBuffer(); +// for (FlowTableModel table : childTable) { +// String tableName = table.getTable(); +// String mastFile = table.getRelationField(); +// delTable.append("delete from " + tableName + " where " + mastFile + "='" + id + "';"); +// } +// StringBuffer delete = new StringBuffer(); +// delete.append(delMast); +// if (delTable.length() > 0) { +// delete.append(delTable); +// } +// opaTableDataInfo(delete.toString()); +// } +// +// //---------------------------信息----------------------------------------------- +// +// /** +// * 信息有表 +// * +// * @param id 主键 +// * @param list 模板json +// * @param tableModelList 表字段 +// * @return +// */ +// public Map info(String id, List list, List tableModelList) throws DataException { +// //主表字段的jnpfkey +// Map mast = new HashMap<>(16); +// //子表字段的jnpfkey +// Map> table = new HashMap<>(16); +// //提交数据对应的子表 +// Map tableModel = new HashMap<>(16); +// //封装数据 +// tempTableJson(list, mast, table, tableModel, 1); +// //返回结果 +// Map result = new HashMap<>(16); +// infoTableData(id, tableModelList, mast, tableModel, table, result); +// return result; +// } +// +// /** +// * 无表信息 +// * +// * @param dataMap 数据 +// * @param list 模板json +// * @return +// */ +// public Map info(Map dataMap, List list) throws DataException { +// //主表字段的jnpfkey +// Map mast = new HashMap<>(16); +// //子表字段的jnpfkey +// Map> table = new HashMap<>(16); +// tempNoTableJson(list, mast, table); +// //返回结果 +// Map result = new HashMap<>(16); +// infoData(dataMap, mast, table, result); +// return result; +// } +// +// //----------------------------修改-------------------------------------------- +// +// /** +// * 有表修改 +// * +// * @param formId 主键 +// * @param dataMap 数据 +// * @param list 模板json +// * @param tableModelList 表字段 +// */ +// public void update(String formId, Map dataMap, List list, List tableModelList) throws DataException { +// String mastTableName = tableModelList.stream().filter(t -> "1".equals(t.getTypeId())).findFirst().get().getTable(); +// //主表字段的jnpfkey +// Map mast = new HashMap<>(16); +// //子表字段的jnpfkey +// Map> table = new HashMap<>(16); +// //提交数据对应的子表 +// Map tableModel = new HashMap<>(16); +// tempTableJson(list, mast, table, tableModel, 0); +// int type = 1; +// //主表的sql语句 +// mastTable(mastTableName, formId, dataMap, mast, type); +// //子表的sql语句 +// if (tableModel.size() > 0) { +// childTable(tableModelList, tableModel, table, dataMap, type, formId); +// } +// //最后的sql语句 +//// String resultSql = resultSql(mastTableName, formId, dataMap, tableModelList, mast, table, tableModel, type); +//// opaTableDataInfo(resultSql); +// } +// +// /** +// * 无表修改 +// * +// * @param dataMap 数据 +// * @param list 模板json +// */ +// public void update(Map dataMap, List list) throws DataException { +// //主表字段的jnpfkey +// Map mast = new HashMap<>(16); +// //子表字段的jnpfkey +// Map> table = new HashMap<>(16); +// //封装数据 +// tempNoTableJson(list, mast, table); +// for (String key : dataMap.keySet()) { +// String jnpfkey = mast.get(key); +// if (jnpfkey != null) { +// Object value = dataMap.get(key); +// Object dataValue = assigments(jnpfkey, value, 1, mast, key, 1); +// dataMap.put(key, dataValue); +// } else { +// Map childJnpfKey = table.get(key); +// List> childList = (List>) dataMap.get(key); +// for (Map childMap : childList) { +// for (String child : childMap.keySet()) { +// String childkey = childJnpfKey.get(child); +// Object childValue = childMap.get(child); +// Object dataValue = assigments(childkey, childValue, 1, childJnpfKey, childkey, 1); +// childMap.put(child, dataValue); +// } +// } +// } +// } +// } +// +// //--------------------------新增------------------------------------------------ +// +// /** +// * 有表新增 +// * +// * @param formId 主键 +// * @param dataMap 数据 +// * @param list 模板json +// * @param tableModelList 表字段 +// */ +// public void create(String formId, Map dataMap, List list, List tableModelList) throws DataException { +// String mastTableName = tableModelList.stream().filter(t -> "1".equals(t.getTypeId())).findFirst().get().getTable(); +// //主表字段的jnpfkey +// Map mast = new HashMap<>(16); +// //子表字段的jnpfkey +// Map> table = new HashMap<>(16); +// //提交数据对应的子表 +// Map tableModel = new HashMap<>(16); +// tempTableJson(list, mast, table, tableModel, 0); +// int type = 0; +// //主表的sql语句 +// mastTable(mastTableName, formId, dataMap, mast, type); +// //子表的sql语句 +// if (tableModel.size() > 0) { +// childTable(tableModelList, tableModel, table, dataMap, type, formId); +// } +// //最后的sql语句 +//// String resultSql = resultSql(mastTableName, formId, dataMap, tableModelList, mast, table, tableModel, type); +//// opaTableDataInfo(resultSql); +// } +// +// /** +// * 无表新增 +// * +// * @param dataMap 数据 +// * @param list 模板json +// */ +// public void create(Map dataMap, List list) throws DataException { +// //主表字段的jnpfkey +// Map mast = new HashMap<>(16); +// //子表字段的jnpfkey +// Map> table = new HashMap<>(16); +// //封装数据 +// tempNoTableJson(list, mast, table); +// for (String key : dataMap.keySet()) { +// String jnpfkey = mast.get(key); +// if (jnpfkey != null) { +// Object value = dataMap.get(key); +// Object dataValue = assigments(jnpfkey, value, 0, mast, key, 1); +// dataMap.put(key, dataValue); +// } else { +// Map childJnpfKey = table.get(key); +// List> childList = (List>) dataMap.get(key); +// for (Map childMap : childList) { +// for (String child : childMap.keySet()) { +// String childkey = childJnpfKey.get(child); +// Object childValue = childMap.get(child); +// Object dataValue = assigments(childkey, childValue, 0, childJnpfKey, childkey, 1); +// childMap.put(child, dataValue); +// } +// } +// } +// } +// } +// +// //---------------------------封装数据类型------------------------------------------------------- +// +// /** +// * 封装无表字段 +// * +// * @param list 表单模板 +// * @param mastTable 主表字段类型 +// * @param table 子表类型 +// */ +// private void tempNoTableJson(List list, Map mastTable, Map> table) { +// for (FieLdsModel fieLdsModel : list) { +// String jnpfkey = fieLdsModel.getConfig().getJnpfKey(); +// String model = fieLdsModel.getVModel(); +// if (!"table".equals(jnpfkey)) { +// mastTable.put(model, jnpfkey); +// if ("billRule".equals(jnpfkey)) { +// String mastRule = fieLdsModel.getConfig().getRule(); +// mastTable.put(model + "_rule", mastRule); +// } +// } else { +// tableTempChildJson(model, fieLdsModel.getConfig().getChildren(), table, false); +// } +// } +// } +// +// /** +// * 封装主表数据类型 +// * +// * @param list 表单模板 +// * @param mastTable 主表字段类型 +// * @param table 子表类型 +// * @param tableModel 表单对应的子表 +// * @param type 0.新增、修改 1.查询 +// */ +// private void tempTableJson(List list, Map mastTable, Map> table, Map tableModel, int type) { +// for (FieLdsModel fieLdsModel : list) { +// String jnpfkey = fieLdsModel.getConfig().getJnpfKey(); +// String model = fieLdsModel.getVModel(); +// if (!"table".equals(jnpfkey)) { +// model = model.toUpperCase(); +// mastTable.put(model, jnpfkey); +// if ("billRule".equals(jnpfkey)) { +// String mastRule = fieLdsModel.getConfig().getRule(); +// mastTable.put(model + "_rule", mastRule); +// } +// } else { +// String tableName = fieLdsModel.getConfig().getTableName(); +// if (type == 0) { +// tableModel.put(model, tableName); +// } else { +// tableModel.put(tableName, model); +// } +// tableTempChildJson(tableName, fieLdsModel.getConfig().getChildren(), table, true); +// } +// } +// } +// +// /** +// * 封装子表数据类型 +// * +// * @param tableName 子表的表 +// * @param childlist 子表的数据类型 +// * @param table 表单对应的字段,用于获取子表 +// */ +// private void tableTempChildJson(String tableName, List childlist, Map> table, boolean tableType) { +// Map childField = new HashMap<>(16); +// for (FieLdsModel fieLdsModel : childlist) { +// String jnpfkey = fieLdsModel.getConfig().getJnpfKey(); +// String model = fieLdsModel.getVModel(); +// if (tableType) { +// model = model.toUpperCase(); +// } +// childField.put(model, jnpfkey); +// if ("billRule".equals(jnpfkey)) { +// String mastRule = fieLdsModel.getConfig().getRule(); +// childField.put(model + "_rule", mastRule); +// } +// } +// table.put(tableName, childField); +// } +// +// /** +// * 有表信息 +// * +// * @param id 主键 +// * @param list 表单模板 +// * @param mast 主表字段的jnpfkey +// * @param tableModelKey 子表的对应的model属性 +// * @param table 子表字段的jnpfkey +// * @param result 最后结果 +// */ +// private void infoTableData(String id, List list, Map mast, Map tableModelKey, Map> table, Map result) throws DataException { +// String mastTableName = list.stream().filter(t -> "1".equals(t.getTypeId())).findFirst().get().getTable(); +// StringBuffer mastInfo = new StringBuffer("select * from " + mastTableName + " where F_ID='" + id + "'"); +// Map mastData = getMast(mastInfo.toString()); +// List tableListAll = list.stream().filter(t -> !"1".equals(t.getTypeId())).collect(Collectors.toList()); +// //主表数据 +// for (String key : mast.keySet()) { +// String jnpfkey = mast.get(key); +// Object dataValue = mastData.get(key.toUpperCase()); +// Object value = assigments(jnpfkey, dataValue, 2, mast, key, 0); +// if (dataValue != null) { +// result.put(key.toUpperCase(), value); +// } +// } +// //子表数据 +// for (FlowTableModel tableModel : tableListAll) { +// String tableName = tableModel.getTable(); +// StringBuffer tableInfo = new StringBuffer("select * from " + tableName + " where " + tableModel.getTableField() + "='" + id + "'"); +// List> tableList = getTableList(tableInfo.toString()); +// List> tableResult = new ArrayList<>(); +// Map tableJnpf = table.get(tableName); +// for (Map tableInfoModel : tableList) { +// Map tablValue = new HashMap<>(16); +// for (String key : tableJnpf.keySet()) { +// String childkey = tableJnpf.get(key); +// Object childValue = tableInfoModel.get(key.toUpperCase()); +// Object value = assigments(childkey, childValue, 2, tableJnpf, key, 0); +// if (childValue != null) { +// tablValue.put(key.toUpperCase(), value); +// } +// } +// tableResult.add(tablValue); +// } +// if (tableModelKey.get(tableName) != null) { +// result.put(tableModelKey.get(tableName), tableResult); +// } +// } +// } +// +// /** +// * 无表信息 +// * +// * @param dataMap 表单模板 +// * @param mast 主表字段的jnpfkey +// * @param table 子表字段的jnpfkey +// * @param result 最后结果 +// */ +// private void infoData(Map dataMap, Map mast, Map> table, Map result) throws DataException { +// for (String key : dataMap.keySet()) { +// String jnpfkey = mast.get(key); +// if (jnpfkey != null) { +// Object value = dataMap.get(key); +// Object dataValue = assigments(jnpfkey, value, 2, mast, key, 1); +// result.put(key, dataValue); +// } else { +// Map childJnpfKey = table.get(key); +// List> childList = (List>) dataMap.get(key); +// for (Map childMap : childList) { +// for (String child : childMap.keySet()) { +// String childkey = childJnpfKey.get(child); +// Object childValue = childMap.get(child); +// Object dataValue = assigments(childkey, childValue, 2, childJnpfKey, child, 1); +// childMap.put(child, dataValue); +// } +// } +// result.put(key, childList); +// } +// } +// } +// //--------------------------------------封装生成的sql语句------------------------------------------ +// +// /** +// * 主表的sql语句 +// * +// * @param mastTableName 主表 +// * @param formId 主键值 +// * @param dataMap 表单数据 +// * @param mast 主表的jnpfkey +// * @param type 判断新增还是删除 +// * @throws DataException +// */ +// public void mastTable(String mastTableName, String formId, Map dataMap, Map mast, int type) throws DataException { +// Connection conn = getTableConn(); +// StringBuffer delMast = new StringBuffer("delete from " + mastTableName + " where F_ID=?"); +// StringBuffer mastSql = new StringBuffer("INSERT INTO " + mastTableName); +// StringBuffer mastfile = new StringBuffer("(F_ID,"); +// StringBuffer mastFileValue = new StringBuffer("(?,"); +// Map pstMastValue = new LinkedHashMap<>(); +// for (String key : dataMap.keySet()) { +// if (mast.get(key) != null) { +// String jnpfkey = mast.get(key); +// Object dataValue = dataMap.get(key); +// Object mastValue = assigments(jnpfkey, dataValue, type, mast, key, 0); +// mastfile.append(key + ","); +// //处理oracle的日期格式 +// String file = "?,"; +// if (dataSourceUtil.getDataType().toLowerCase().contains("oracle") && "date".equals(jnpfkey)) { +// if (String.valueOf(mastValue).length() < 11) { +// mastValue = mastValue + " 00:00:00"; +// } +// file = "to_date(?,'yyyy-mm-dd HH24:mi:ss'),"; +// } +// pstMastValue.put(key, mastValue); +// mastFileValue.append(file); +// } +// } +// //主表去掉最后 +// mastfile = mastfile.deleteCharAt(mastfile.length() - 1).append(")"); +// mastFileValue = mastFileValue.deleteCharAt(mastFileValue.length() - 1).append(")"); +// mastSql.append(mastfile + " VALUES " + mastFileValue); +// try { +// conn.setAutoCommit(false); +// if (type == 1) { +// PreparedStatement delete = conn.prepareStatement(delMast.toString()); +// delete.setObject(1, formId); +// delete.addBatch(); +// delete.executeBatch(); +// conn.commit(); +// delete.close(); +// conn.close(); +// } +// PreparedStatement save = conn.prepareStatement(mastSql.toString()); +// int num = 1; +// save.setObject(num, formId); +// num++; +// for (String pstKey : pstMastValue.keySet()) { +// //最后通过jnpfkey修改值 +// String jnpfkey = mast.get(pstKey); +// Object mastvalue = pstMastValue.get(pstKey); +// Object MastValue = assigments(jnpfkey, mastvalue, type, mast, pstKey, 0); +// save.setObject(num, MastValue); +// num++; +// } +// save.addBatch(); +// save.executeBatch(); +// conn.commit(); +// save.close(); +// conn.close(); +// } catch (SQLException e) { +// throw new DataException("数据错误:" + e.getMessage()); +// } +// } +// +// /** +// * 子表的sql语句 +// * +// * @param tableModelList 子表的table +// * @param tableModel 表单对应的子表 +// * @param table 子表的jnpfkey +// * @param dataMap 表单数据 +// * @param type 判断新增还是删除 +// * @param formId 主键值 +// */ +// public void childTable(List tableModelList, Map tableModel, Map> table, Map dataMap, int type, String formId) throws DataException { +// Connection conn = getTableConn(); +// try { +// for (String tableName : tableModel.keySet()) { +// conn.setAutoCommit(false); +// String childTable = tableModel.get(tableName); +// String mastFile = tableModelList.stream().filter(t -> t.getTable().equals(childTable)).findFirst().get().getTableField(); +// Map tableJnpfKey = table.get(childTable); +// List> tableList = (List>) dataMap.get(tableName); +// StringBuffer delSql = new StringBuffer("delete from " + childTable + " where " + mastFile + "=?"); +// StringBuffer saveSql = new StringBuffer("INSERT INTO " + childTable + "(" + mastFile + ",F_ID,"); +// StringBuffer tablefile = new StringBuffer(); +// StringBuffer tablefileValue = new StringBuffer("(?,?,"); +// Map fileAll = new LinkedHashMap<>(); +// for (String tableFile : tableJnpfKey.keySet()) { +// fileAll.put(tableFile, null); +// tablefile.append(tableFile + ","); +// //处理oracle的日期格式 +// String file = "?,"; +// if (dataSourceUtil.getDataType().toLowerCase().contains("oracle") && "date".equals(tableJnpfKey.get(tableFile))) { +// file = "to_date(?,'yyyy-mm-dd HH24:mi:ss'),"; +// } +// tablefileValue.append(file); +// } +// if (type == 1) { +// PreparedStatement delete = conn.prepareStatement(delSql.toString()); +// delete.setObject(1, formId); +// delete.addBatch(); +// delete.executeBatch(); +// delete.commit(); +// delete.close(); +// conn.close(); +// } +// if (tablefile.length() > 0) { +// tablefile = tablefile.deleteCharAt(tablefile.length() - 1).append(")"); +// tablefileValue = tablefileValue.deleteCharAt(tablefileValue.length() - 1).append(")"); +// saveSql.append(tablefile + " VALUES " + tablefileValue); +// PreparedStatement statement = conn.prepareStatement(saveSql.toString()); +// for (Map child : tableList) { +// int num = 1; +// statement.setObject(num, formId); +// num++; +// statement.setObject(num, RandomUtil.uuId()); +// num++; +// for (String childkey : fileAll.keySet()) { +// //最后通过jnpfkey修改值 +// String childjnpfkey = tableJnpfKey.get(childkey); +// Object childvalue = child.get(childkey); +// Object chilValue = assigments(childjnpfkey, childvalue, type, tableJnpfKey, childkey, 0); +// statement.setObject(num, chilValue); +// num++; +// } +// statement.addBatch(); +// } +// statement.executeBatch(); +// } +// conn.commit(); +// } +// statement.close(); +// conn.close(); +// } catch (Exception e) { +// throw new DataException("数据错误:" + e.getMessage()); +// } +// } +// +// /** +// * 获取最后sql语句 +// * +// * @param mastTableName 主表 +// * @param formId 主键值 +// * @param dataMap 表单数据 +// * @param mast 主表的jnpfkey +// * @param table 子表的jnpfkey +// * @param tableModel 表单对应的子表 +// * @param type 判断新增还是删除 +// * @return +// */ +// private String resultSql(String mastTableName, String formId, Map dataMap, List tableModelList, Map mast, Map> table, Map tableModel, int type) throws DataException { +// //删除语句 +// StringBuffer delMast = new StringBuffer("delete from " + mastTableName + " where F_ID='" + formId + "';"); +// StringBuffer deletetable = new StringBuffer(); +// //主表拼接字段 +// StringBuffer mastSql = new StringBuffer("INSERT INTO " + mastTableName + " "); +// StringBuffer mastfile = new StringBuffer("(F_ID,"); +// StringBuffer mastvalue = new StringBuffer("('" + formId + "',"); +// //子表拼接字段 +// StringBuffer tableSql = new StringBuffer(); +// for (String key : dataMap.keySet()) { +// if (mast.get(key) != null) { +// String jnpfkey = mast.get(key); +// Object dataValue = dataMap.get(key); +// mastfile.append(key + ","); +// Object mastValue = assigments(jnpfkey, dataValue, type, mast, key, 0); +// if (mastValue != null) { +// mastvalue.append("'" + mastValue + "',"); +// } else { +// mastvalue.append(mastValue + ","); +// } +// dataMap.put(key, mastValue); +// } else { +// //获取table名称 +// String tableName = tableModel.get(key); +// String mastFile = tableModelList.stream().filter(t -> t.getTable().equals(tableName)).findFirst().get().getTableField(); +// Map tableJnpfKey = table.get(tableName); +// List> tableList = (List>) dataMap.get(key); +// //子表字段 +// StringBuffer tableFiled = new StringBuffer("F_ID,"); +// //子表数据 +// StringBuffer tablevalue = new StringBuffer(); +// int num = 0; +// for (Map child : tableList) { +// StringBuffer value = new StringBuffer(); +// StringBuffer filed = new StringBuffer(); +// for (String childkey : child.keySet()) { +// //最后通过jnpfkey修改值 +// String childjnpfkey = tableJnpfKey.get(childkey); +// Object childvalue = child.get(childkey); +// Object chilValue = assigments(childjnpfkey, childvalue, type, tableJnpfKey, childkey, 0); +// if (chilValue != null) { +// value.append("'" + chilValue + "',"); +// } else { +// value.append(chilValue + ","); +// } +// child.put(childkey, chilValue); +// //添加字段 +// filed.append(childkey + ","); +// } +// //只加一次字段 +// if (num == 0) { +// tableFiled.append(filed); +// num++; +// } +// if (value.length() > 0) { +// value = value.deleteCharAt(value.length() - 1); +// tablevalue.append("('" + RandomUtil.uuId() + "'," + value + ",'" + formId + "'),"); +// } +// } +// if (tablevalue.length() > 0) { +// tableFiled.append(mastFile); +// tablevalue = tablevalue.deleteCharAt(tablevalue.length() - 1); +// tableSql.append("INSERT INTO " + tableName + "(" + tableFiled + ") VALUES " + tablevalue + ";"); +// } +// deletetable.append("delete from " + tableName + " where " + mastFile + "='" + formId + "';"); +// } +// } +// //主表去掉最后 +// mastfile = mastfile.deleteCharAt(mastfile.length() - 1).append(")"); +// mastvalue = mastvalue.deleteCharAt(mastvalue.length() - 1).append(")"); +// mastSql.append(mastfile + " value " + mastvalue + ";"); +// //最后语句 +// StringBuffer resultSql = new StringBuffer(); +// if (type == 0) { +// resultSql.append(mastSql.toString() + tableSql); +// } else { +// resultSql.append(delMast + mastSql.toString() + deletetable + tableSql); +// } +// return resultSql.toString(); +// } +// +// /** +// * 表单特殊字段赋值 +// * +// * @param jnpfkey 数据类型 +// * @param dataValue 表单值 +// * @param type 0.新增 1.修改 2.查询 +// * @param tableType 0.有表 1.无表 +// */ +// private Object assigments(String jnpfkey, Object dataValue, int type, Map mast, String rule, int tableType) throws DataException { +// UserInfo userInfo = userProvider.get(); +// List userAll = userService.getAll(); +// Object value = dataValue; +// switch (jnpfkey) { +// case "billRule": +// if (type == 0) { +// String ruleNo = billRuleService.GetBillNumber(mast.get(rule + "_rule"), false); +// value = ruleNo; +// } +// break; +// case "createUser": +// if (type == 0) { +// value = userInfo.getUserId(); +// } +// if (type == 1) { +// String userValue = String.valueOf(value); +// UserAllModel model = userAll.stream().filter(t -> t.getRealName().equals(userValue)).findFirst().orElse(null); +// value = ""; +// if (model != null) { +// value = model.getId(); +// } +// } +// if (type == 2) { +// String userValue = String.valueOf(value); +// UserAllModel model = userAll.stream().filter(t -> t.getId().equals(userValue)).findFirst().orElse(null); +// value = ""; +// if (model != null) { +// value = model.getRealName(); +// } +// } +// break; +// case "createTime": +// if (type == 0) { +// value = DateUtil.getNow(); +// } +// if (type == 2) { +// value = DateUtil.StringToDate(String.valueOf(value)); +// } +// break; +// case "modifyUser": +// if (type == 0) { +// value = ""; +// } +// if (type == 1) { +// value = userInfo.getUserId(); +// } +// if (type == 2) { +// String userValue = String.valueOf(value); +// UserAllModel model = userAll.stream().filter(t -> t.getId().equals(userValue)).findFirst().orElse(null); +// value = ""; +// if (model != null) { +// value = model.getRealName(); +// } +// } +// break; +// case "modifyTime": +// if (type == 1) { +// value = DateUtil.getNow(); +// } +// if (type == 0) { +// value = null; +// } +// if (type == 2) { +// if (value == null) { +// value = ""; +// } +// } +// break; +// case "currDept": +// if (type == 0) { +// value = userInfo.getOrganizeId(); +// } +// if (type == 1) { +// String depName = String.valueOf(value); +// UserAllModel model = userAll.stream().filter(t -> t.getOrganize().equals(depName)).findFirst().orElse(null); +// value = ""; +// if (model != null) { +// value = model.getOrganize(); +// } +// } +// if (type == 2) { +// UserAllModel model = userAll.stream().filter(t -> t.getId().equals(userInfo.getUserId())).findFirst().orElse(null); +// value = ""; +// if (model != null) { +// value = model.getOrganize(); +// } +// } +// break; +// case "currCompany": +// if (type == 0) { +// UserEntity userEntity = userService.getInfo(userInfo.getUserId()); +// OrganizeEntity info = organizeService.getInfo(userEntity.getId()); +// value = info.getParentId(); +// } +// if (type == 1) { +// String company = String.valueOf(value); +// UserAllModel model = userAll.stream().filter(t -> t.getOrganize().equals(company)).findFirst().orElse(null); +// value = ""; +// if (model != null) { +// value = model.getOrganize(); +// } +// } +// if (type == 2) { +// UserEntity userEntity = userService.getInfo(userInfo.getUserId()); +// OrganizeEntity info = organizeService.getInfo(userEntity.getId()); +// value = info.getParentId(); +// } +// break; +// case "currPosition": +// UserEntity userEntity = userService.getInfo(userInfo.getUserId()); +// PositionEntity positionEntity = positionService.getInfo(userEntity.getPositionId().split(",")[0]); +// if (type == 0) { +// value = positionEntity != null ? positionEntity.getId() : ""; +// } +// if (type == 2) { +// value = positionEntity != null ? positionEntity.getFullName() : ""; +// } +// break; +// case "uploadFz": +// if (tableType == 0) { +// if (type == 2) { +// value = JSONUtil.getJsonToListMap(String.valueOf(value)); +// } else { +// value = String.valueOf(value); +// } +// } +// break; +// case "uploadImg": +// if (tableType == 0) { +// if (type == 2) { +// value = JSONUtil.getJsonToListMap(String.valueOf(value)); +// } else { +// value = String.valueOf(value); +// } +// } +// break; +// case "checkbox": +// if (tableType == 0) { +// if (type == 2) { +// value = JSONUtil.getJsonToList(String.valueOf(value), String.class); +// } else { +// value = String.valueOf(value); +// } +// } +// break; +// case "cascader": +// if (tableType == 0) { +// if (type == 2) { +// value = JSONUtil.getJsonToList(String.valueOf(value), String.class); +// } else { +// value = String.valueOf(value); +// } +// } +// break; +// case "dateRange": +// if (tableType == 0) { +// if (type == 2) { +// value = JSONUtil.getJsonToList(String.valueOf(value), String.class); +// } else { +// value = String.valueOf(value); +// } +// } +// break; +// case "timeRange": +// if (tableType == 0) { +// if (type == 2) { +// value = JSONUtil.getJsonToList(String.valueOf(value), String.class); +// } else { +// value = String.valueOf(value); +// } +// } +// break; +// case "date": +// if (tableType == 0 && value != null) { +// if (type == 0 || type == 1) { +// if (value instanceof Long) { +// value = DateUtil.daFormat(new Date(Long.valueOf(String.valueOf(value)))); +// } +// } +// if (type == 2) { +// value = DateUtil.StringToDate(String.valueOf(value)).getTime(); +// } +// } +// break; +// default: +// if (value != null && !"".equals(value)) { +// value = String.valueOf(value); +// }else{ +// value = null; +// } +// break; +// } +// return value; +// } +// +// +// //-------------------------有表数据库连接-------------------------------------------- +// +// /** +// * 获取有子表数据 +// * +// * @param sql sql语句 +// * @return +// * @throws DataException +// */ +// private List> getTableList(String sql) throws DataException { +// Connection conn = getTableConn(); +// ResultSet rs = JdbcUtil.query(conn, sql); +// List> dataList = JdbcUtil.convertListString(rs); +// List> resultList = new ArrayList<>(); +// for (Map data : dataList) { +// Map objectMap = new HashMap<>(16); +// for (String key : data.keySet()) { +// objectMap.put(key.toUpperCase(), data.get(key)); +// } +// resultList.add(objectMap); +// } +// return resultList; +// } +// +// /** +// * 获取主表数据 +// * +// * @param sql sql语句 +// * @return +// * @throws DataException +// */ +// private Map getMast(String sql) { +// Connection conn = getTableConn(); +// ResultSet rs = JdbcUtil.query(conn, sql); +// Map mast = JdbcUtil.convertMapString(rs); +// Map result = new HashMap<>(16); +// for (String key : mast.keySet()) { +// result.put(key.toUpperCase(), mast.get(key)); +// } +// return result; +// } +// +// //获取有表的数据库连接 +// private Connection getTableConn() { +// dataSourceUtil = SpringContext.getBean(DataSourceUtil.class); +// String TenId = ""; +// if (!configValueUtil.isMultiTenancy()) { +// TenId = dataSourceUtil.getDbName(); +// } else { +// TenId = userProvider.get().getTenantDbConnectionString(); +// } +// Connection conn = ConnUtil.getConn(dataSourceUtil.getUserName(), dataSourceUtil.getPassword(), dataSourceUtil.getUrl().replace("{dbName}", TenId)); +// return conn; +// } +// +// /** +// * 增加删除修改有表单条数据 +// * +// * @param sql sql语句 +// * @return +// * @throws DataException +// */ +// private void opaTableDataInfo(String sql) throws DataException { +// Connection conn = getTableConn(); +// JdbcUtil.custom(conn, sql); +// } +// +// /** +// * 获取有表列表数据 +// * +// * @param sql sql语句 +// */ +// private List getTableDataList(String sql) throws DataException { +// List list = new ArrayList<>(); +// Connection conn = getTableConn(); +// ResultSet rs = JdbcUtil.query(conn, sql); +// List> dataList = JdbcUtil.convertList(rs); +// for (Map dataMap : dataList) { +// VisualdevModelDataEntity dataEntity = new VisualdevModelDataEntity(); +// Map objectMap = new HashMap<>(16); +// for (String key : dataMap.keySet()) { +// objectMap.put(key.toUpperCase(), dataMap.get(key)); +// } +// dataEntity.setData(JSONUtil.getObjectToStringDateFormat(objectMap, "yyyy-MM-dd HH:mm:ss")); +// if (dataMap.containsKey("F_ID")) { +// dataEntity.setId(dataMap.get("F_ID").toString()); +// } else if (dataMap.containsKey("F_Id")) { +// dataEntity.setId(dataMap.get("F_Id").toString()); +// } +// list.add(dataEntity); +// } +// return list; +// } +// +// +// //---------------------------------------------关联表单------------------------------------------------------------------ +// +// /** +// * 替换app静态数据到slot +// * +// * @param formData 主表引擎的json +// * @param tableVmodel 子表对应的字段 +// * @param type 0.工作流 1.app +// */ +// private void tempJonsMast(List formData, Map tableVmodel, List mastModel, Map> tableModel, int type) { +// for (FieLdsModel model : formData) { +// ConfigModel config = model.getConfig(); +// String mastVmodel = model.getVModel(); +// mastModel.add(mastVmodel); +// if (type == 1) { +// if (JnpfKeyConsts.RADIO.equals(config.getJnpfKey()) || JnpfKeyConsts.SELECT.equals(config.getJnpfKey()) || JnpfKeyConsts.CHECKBOX.equals(config.getJnpfKey())) { +// if (DataTypeConst.STATIC.equals(config.getDataType())) { +// SlotModel slotModel = new SlotModel(); +// slotModel.setOptions(config.getOptions()); +// model.setSlot(slotModel); +// } +// } +// } +// if ("table".equals(config.getJnpfKey())) { +// List children = config.getChildren(); +// String tableName = config.getTableName(); +// String vmodel = model.getVModel(); +// tableVmodel.put(tableName, vmodel); +// tempJonsChild(children, tableModel, tableName, type); +// } +// } +// } +// +// /** +// * 封装子表 +// * +// * @param children 子表的json +// * @param tableModel 子表的字段 +// * @param type 0.工作流 1.app +// * @param tableName 表名称 +// */ +// private void tempJonsChild(List children, Map> tableModel, String tableName, int type) { +// List tableModelAll = new ArrayList<>(); +// for (FieLdsModel model : children) { +// ConfigModel config = model.getConfig(); +// String vmodel = model.getVModel(); +// tableModelAll.add(vmodel); +// if (type == 1) { +// if (JnpfKeyConsts.RADIO.equals(config.getJnpfKey()) || JnpfKeyConsts.SELECT.equals(config.getJnpfKey()) || JnpfKeyConsts.CHECKBOX.equals(config.getJnpfKey())) { +// if (DataTypeConst.STATIC.equals(config.getDataType())) { +// SlotModel slotModel = new SlotModel(); +// slotModel.setOptions(config.getOptions()); +// model.setSlot(slotModel); +// } +// } +// } +// } +// tableModel.put(tableName, tableModelAll); +// } +// +// //有表的详情数据 +// public Map tableInfo(String id, List formData, List list, int type) throws DataException { +// //主表字段 +// List mastModel = new ArrayList<>(); +// //子表字段 +// Map> childModel = new HashMap<>(16); +// //子表的model +// Map tableVmodel = new HashMap<>(16); +// //封装数据 +// tempJonsMast(formData, tableVmodel, mastModel, childModel, type); +// //主表查询数据 +// String mastTableName = list.stream().filter(t -> "1".equals(t.getTypeId())).findFirst().get().getTable(); +// StringBuffer mastInfo = new StringBuffer("select F_ID," + String.join(",", mastModel) + " from " + mastTableName + " where F_ID='" + id + "'"); +// Map data = getMast(mastInfo.toString()); +// //子表查询数据 +// List childList = list.stream().filter(t -> !"1".equals(t.getTypeId())).collect(Collectors.toList()); +// for (FlowTableModel tableModel : childList) { +// String tableName = tableModel.getRelationTable(); +// String mastField = tableModel.getRelationField(); +// List childModelAll = childModel.get(tableName); +// StringBuffer childInfo = new StringBuffer("select F_ID," + String.join(",", childModelAll) + " from " + tableName + " where " + mastField + "='" + id + "'"); +// List> childData = getTableList(childInfo.toString()); +// String childVmodel = tableVmodel.get(tableName); +// data.put(childVmodel, childData); +// } +// return data; +// } +// +// //详情转换成中文 +// public Map resultData(String id, List fieLdsList, Map data, int type) { +// //主表的数据 +// Map mastKey = new HashMap<>(16); +// Map> mastList = new HashMap<>(16); +// //子表的数据 +// Map> tableKey = new HashMap<>(16); +// Map>> tableList = new HashMap<>(16); +// //存关联表单字段 +// Map> relation = new HashMap<>(16); +// jnpfKey(fieLdsList, mastKey, mastList, tableKey, tableList, relation); +// Map result = data(data, mastKey, mastList, tableKey, tableList, relation); +// return result; +// } +// +// //表单的id转成名称 +// private Map data(Map data, Map mastKey, Map> mastList, Map> tableKey, Map>> tableList, Map> relation) { +// Map result = new HashMap<>(16); +// //公司、部门 +// List organizeList = organizeService.getList(); +// //岗位 +// List positionList = positionService.getList(); +// //用户 +// List userList = userService.getList(); +// //数据字典 +// List dicDataList = dictionaryDataService.getList(); +// for (String key : data.keySet()) { +// if (mastKey.get(key) != null) { +// String jnpfKey = mastKey.get(key); +// Object value = data.get(key); +// String dataValue = String.valueOf(value); +// if (JnpfKeyConsts.SELECT.equals(jnpfKey) || JnpfKeyConsts.CHECKBOX.equals(jnpfKey) || JnpfKeyConsts.RADIO.equals(jnpfKey)) { +// List list = mastList.get(key); +// if (list.size() > 0) { +// if (JnpfKeyConsts.CHECKBOX.equals(jnpfKey)) { +// List checkList = (List) value; +// List checkData = new ArrayList<>(); +// if (checkList != null) { +// for (String chedk : checkList) { +// OptinModels optinModels = list.stream().filter(t -> t.getId().equals(chedk)).findFirst().orElse(null); +// if (optinModels != null) { +// checkData.add(optinModels.getFullName()); +// } else { +// checkData.add(chedk); +// } +// } +// } +// value = String.join(",", checkData); +// } else { +// OptinModels optinModels = list.stream().filter(t -> t.getId().equals(dataValue)).findFirst().orElse(null); +// if (optinModels != null) { +// value = optinModels.getFullName(); +// } +// } +// } +// } +// //公司和部门 +// if ("comSelect".equals(key) || "depSelect".equals(key) || "currDept".equals(key) || "currCompany".equals(key)) { +// OrganizeEntity organizeEntity = organizeList.stream().filter(t -> t.getId().equals(dataValue)).findFirst().orElse(null); +// if (organizeEntity != null) { +// value = organizeEntity.getFullName(); +// } +// } +// //用户 +// if ("userSelect".equals(key)) { +// UserEntity userEntity = userList.stream().filter(t -> t.getId().equals(dataValue)).findFirst().orElse(null); +// if (userEntity != null) { +// value = userEntity.getRealName(); +// } +// } +// //岗位 +// if ("posSelect".equals(key) || "currPosition".equals(key)) { +// PositionEntity positionEntity = positionList.stream().filter(t -> t.getId().equals(dataValue)).findFirst().orElse(null); +// if (positionEntity != null) { +// value = positionEntity.getFullName(); +// } +// } +// if ("relationForm".equals(key)) { +// Map relationMap = relation.get(key); +// String modelId = relationMap.get("modelId"); +// String relaField = relationMap.get("relaField"); +// VisualdevEntity visualdevEntity = visualdevService.getInfo(modelId); +// //formTempJson +// FormDataModel formData = JSONUtil.getJsonToBean(visualdevEntity.getFormData(), FormDataModel.class); +// List list = JSONUtil.getJsonToList(formData.getFields(), FieLdsModel.class); +// //数据表 +// List tableModelList = JSONUtil.getJsonToList(visualdevEntity.getTables(), FlowTableModel.class); +// FieLdsModel fieLdsModel = list.stream().filter(t -> t.getVModel().equals(relaField)).findFirst().get(); +// Object objectData = ""; +// if (tableModelList.size() > 0) { +// String table = tableModelList.stream().filter(t -> "1".equals(t.getTypeId())).findFirst().get().getTable(); +// String sql = "select * from " + table + " where F_ID" + dataValue; +// Map relationData = getMast(sql); +// objectData = relationData.get(relaField); +// } else { +// VisualdevModelDataEntity info = visualdevModelDataService.getInfo(dataValue); +// Map relationData = getMast(info.getData()); +// objectData = relationData.get(relaField); +// } +// value = relation(objectData, fieLdsModel, organizeList, positionList, userList); +// } +// result.put(key, value); +// } else { +// List> childListAll = (List>) data.get(key); +// List> childResultList = new ArrayList<>(); +// for (Map childList : childListAll) { +// Map childKeyAll = tableKey.get(key); +// Map resultData = new HashMap<>(16); +// for (String childKey : childList.keySet()) { +// String jnpfKey = childKeyAll.get(childKey); +// Object value = childList.get(childKey); +// String dataValue = String.valueOf(value); +// if (JnpfKeyConsts.SELECT.equals(jnpfKey) || JnpfKeyConsts.CHECKBOX.equals(jnpfKey) || JnpfKeyConsts.RADIO.equals(jnpfKey)) { +// List list = tableList.get(key).get(childKey); +// if (list.size() > 0) { +// OptinModels optinModels = list.stream().filter(t -> t.getId().equals(dataValue)).findFirst().orElse(null); +// if (optinModels != null) { +// value = optinModels.getFullName(); +// } +// } else { +// DictionaryDataEntity dictionaryDataEntity = dicDataList.stream().filter(t -> t.getId().equals(dataValue)).findFirst().orElse(null); +// if (dictionaryDataEntity != null) { +// value = dictionaryDataEntity.getFullName(); +// } +// } +// } +// //公司和部门 +// if ("comSelect".equals(key) || "depSelect".equals(key) || "currDept".equals(key) || "currCompany".equals(key)) { +// OrganizeEntity organizeEntity = organizeList.stream().filter(t -> t.getId().equals(dataValue)).findFirst().orElse(null); +// if (organizeEntity != null) { +// value = organizeEntity.getFullName(); +// } +// } +// //用户 +// if ("userSelect".equals(key)) { +// UserEntity userEntity = userList.stream().filter(t -> t.getId().equals(dataValue)).findFirst().orElse(null); +// if (userEntity != null) { +// value = userEntity.getRealName(); +// } +// } +// //岗位 +// if ("posSelect".equals(key) || "currPosition".equals(key)) { +// PositionEntity positionEntity = positionList.stream().filter(t -> t.getId().equals(dataValue)).findFirst().orElse(null); +// if (positionEntity != null) { +// value = positionEntity.getFullName(); +// } +// } +// resultData.put(childKey, value); +// } +// childResultList.add(resultData); +// } +// result.put(key, childResultList); +// } +// } +// return result; +// } +// +// //处理主表jnpfkey +// private void jnpfKey(List fieLdsList, Map mastKey, Map> mastList, Map> tableKey, Map>> tableList, Map> relation) { +// for (FieLdsModel field : fieLdsList) { +// String jnpfkey = field.getConfig().getJnpfKey(); +// String model = field.getVModel(); +// if (!"table".equals(jnpfkey)) { +// if (!"JNPFText".equals(jnpfkey) && !"divider".equals(jnpfkey)) { +// mastKey.put(model, jnpfkey); +// List optinModelsList = new ArrayList<>(); +// keyList(jnpfkey, field, optinModelsList); +// mastList.put(model, optinModelsList); +// } +// if ("relationForm".equals(jnpfkey)) { +// String modelId = field.getModelId(); +// String relaField = field.getRelationField(); +// Map form = new HashMap<>(16); +// form.put("modelId", modelId); +// form.put("relaField", relaField); +// relation.put(model, form); +// } +// } else { +// childJnpfKey(field, tableKey, tableList); +// } +// } +// } +// +// //处理关联表单 +// private Object relation(Object value, FieLdsModel fieLdsModel, List organizeList, List positionList, List userList) { +// String key = fieLdsModel.getConfig().getJnpfKey(); +// String dataValue = String.valueOf(value); +// //公司和部门 +// if ("comSelect".equals(key) || "depSelect".equals(key) || "currDept".equals(key) || "currCompany".equals(key)) { +// OrganizeEntity organizeEntity = organizeList.stream().filter(t -> t.getId().equals(dataValue)).findFirst().orElse(null); +// if (organizeEntity != null) { +// value = organizeEntity.getFullName(); +// } +// } +// //用户 +// if ("userSelect".equals(key)) { +// UserEntity userEntity = userList.stream().filter(t -> t.getId().equals(dataValue)).findFirst().orElse(null); +// if (userEntity != null) { +// value = userEntity.getRealName(); +// } +// } +// //岗位 +// if ("posSelect".equals(key) || "currPosition".equals(key)) { +// PositionEntity positionEntity = positionList.stream().filter(t -> t.getId().equals(dataValue)).findFirst().orElse(null); +// if (positionEntity != null) { +// value = positionEntity.getFullName(); +// } +// } +// if (JnpfKeyConsts.SELECT.equals(key) || JnpfKeyConsts.CHECKBOX.equals(key) || JnpfKeyConsts.RADIO.equals(key)) { +// List list = new ArrayList<>(); +// keyList(key, fieLdsModel, list); +// if (list.size() > 0) { +// if (JnpfKeyConsts.CHECKBOX.equals(key)) { +// List checkList = (List) value; +// List checkData = new ArrayList<>(); +// if (checkList != null) { +// for (String chedk : checkList) { +// OptinModels optinModels = list.stream().filter(t -> t.getId().equals(chedk)).findFirst().orElse(null); +// if (optinModels != null) { +// checkData.add(optinModels.getFullName()); +// } else { +// checkData.add(chedk); +// } +// } +// } +// value = String.join(",", checkData); +// } else { +// OptinModels optinModels = list.stream().filter(t -> t.getId().equals(dataValue)).findFirst().orElse(null); +// if (optinModels != null) { +// value = optinModels.getFullName(); +// } +// } +// } +// } +// return value; +// } +// +// //处理子表jnpfkey +// private void childJnpfKey(FieLdsModel fieLdsModel, Map> tableKey, Map>> tableList) { +// String vmodel = fieLdsModel.getVModel(); +// List fieLdsList = fieLdsModel.getConfig().getChildren(); +// Map tablJnpfKey = new HashMap<>(16); +// Map> tableOptionList = new HashMap<>(16); +// for (FieLdsModel field : fieLdsList) { +// String jnpfkey = field.getConfig().getJnpfKey(); +// String model = field.getVModel(); +// tablJnpfKey.put(model, jnpfkey); +// List optinModelsList = new ArrayList<>(); +// keyList(jnpfkey, field, optinModelsList); +// tableOptionList.put(model, optinModelsList); +// } +// tableKey.put(vmodel, tablJnpfKey); +// tableList.put(vmodel, tableOptionList); +// } +// +// //处理静态数据和远端数据 +// private void keyList(String jnpfKey, FieLdsModel fieLdsModel, List optionslList) { +// ConfigModel config = fieLdsModel.getConfig(); +// SlotModel slotModel = fieLdsModel.getSlot(); +// if (JnpfKeyConsts.SELECT.equals(jnpfKey) || JnpfKeyConsts.CHECKBOX.equals(jnpfKey) || JnpfKeyConsts.RADIO.equals(jnpfKey)) { +// String type = config.getDataType(); +// ConfigPropsModel configPropsModel = JSONUtil.getJsonToBean(config.getProps(), ConfigPropsModel.class); +// String fullName = configPropsModel.getLabel(); +// String value = configPropsModel.getValue(); +// String optionsAll = slotModel.getOptions(); +// if (DataTypeConst.STATIC.equals(type)) { +// List> staticList = JSONUtil.getJsonToListMap(optionsAll); +// for (Map options : staticList) { +// OptinModels optionsModel = new OptinModels(); +// optionsModel.setId(String.valueOf(options.get(value))); +// optionsModel.setFullName(String.valueOf(options.get(fullName))); +// optionslList.add(optionsModel); +// } +// } else if (DataTypeConst.DYNAMIC.equals(type)) { +// String dynId = config.getPropsUrl(); +// //查询外部接口 +// Map dynamicMap = new HashMap<>(16); +// if (dynamicMap.get("data") != null) { +// List> dataList = JSONUtil.getJsonToListMap(dynamicMap.get("data").toString()); +// for (Map options : dataList) { +// OptinModels optionsModel = new OptinModels(); +// optionsModel.setId(String.valueOf(options.get(value))); +// optionsModel.setFullName(String.valueOf(options.get(fullName))); +// optionslList.add(optionsModel); +// } +// } +// } +// } +// } +// +// +//} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/TestSendConfigUtil.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/TestSendConfigUtil.java new file mode 100644 index 0000000..9df8cfe --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/TestSendConfigUtil.java @@ -0,0 +1,1073 @@ +package jnpf.base.util; + +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONObject; +import jnpf.base.UserInfo; +import jnpf.base.entity.MessageTemplateEntity; +import jnpf.base.entity.SmsTemplateEntity; +import jnpf.base.entity.SysConfigEntity; +import jnpf.base.model.systemconfig.SmsModel; +import jnpf.base.service.MessageTemplateService; +import jnpf.base.service.SmsTemplateService; +import jnpf.base.service.SysconfigService; +import jnpf.base.util.SmsUtil; +import jnpf.constant.MsgCode; +import jnpf.message.entity.*; +import jnpf.message.enums.MessageTypeEnum; +import jnpf.message.model.WxgzhMessageModel; +import jnpf.message.model.message.DingTalkModel; +import jnpf.message.model.message.EmailModel; +import jnpf.message.model.messagetemplateconfig.TemplateParamModel; +import jnpf.message.model.sendmessageconfig.SendConfigTemplateModel; +import jnpf.message.service.*; +import jnpf.message.util.*; +import jnpf.message.util.weixingzh.WXGZHWebChatUtil; +import jnpf.model.BaseSystemInfo; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.UserService; +import jnpf.util.*; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.text.StringSubstitutor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.*; +import java.util.regex.Pattern; + +@Component +@Slf4j +public class TestSendConfigUtil { + + @Autowired + private UserService userService; + @Autowired + private UserProvider userProvider; + @Autowired + private SysconfigService sysconfigService; + @Autowired + private MessageService messageService; + @Autowired + private MessagereceiveService messagereceiveService; + @Autowired + private SynThirdInfoService synThirdInfoService; + + @Autowired + private MessageTemplateService messageTemplateService; + @Autowired + private SmsTemplateService smsTemplateService; + @Autowired + private MessageTemplateConfigService messageTemplateConfigService; + + @Autowired + private TemplateParamService templateParamService; + @Autowired + private SmsFieldService smsFieldService; + @Autowired + private AccountConfigService accountConfigService; + @Autowired + private MessageMonitorService messageMonitorService; + @Autowired + private WechatUserService wechatUserService; + + /** + * 测试发送配置 + */ + public String sendMessage(SendConfigTemplateModel model, UserInfo userInfo) { + List toUserIdsList = model.getToUser(); + // 模板id + String templateId = model.getTemplateId(); + // 参数 + Map parameterMap = new HashMap<>(); + List paramModelList = JsonUtil.getJsonToList(model.getParamJson(), TemplateParamModel.class); + if (paramModelList != null && paramModelList.size() > 0) { + for (TemplateParamModel paramModel : paramModelList) { + parameterMap.put(paramModel.getField(), paramModel.getValue()); + } + } + boolean flag = true; + if (!"webhook".equals(model.getMessageType())) { + if (!(toUserIdsList != null && toUserIdsList.size() > 0)) { + log.error("接收人员为空"); + flag = false; + } + } + if (StringUtil.isEmpty(templateId)) { + log.error("模板Id为空"); + flag = false; + } + if (flag) { + // 获取消息模板详情 + MessageTemplateConfigEntity entity = messageTemplateConfigService.getInfo(templateId); + // 替换参数 + String content = entity.getContent(); + // 替换参数 + if (StringUtil.isNotEmpty(content)) { + StringSubstitutor strSubstitutor = new StringSubstitutor(parameterMap, "{", "}"); + content = strSubstitutor.replace(content); + } + if (entity != null) { + MessageTypeEnum typeEnum = MessageTypeEnum.getByCode(entity.getMessageType()); + String sendType = entity.getMessageType(); + switch (typeEnum) { + case SysMessage: + // 站内消息 + String title = entity.getTitle(); + if (StringUtil.isNotEmpty(title)) { + StringSubstitutor strSubstitutor = new StringSubstitutor(parameterMap, "{", "}"); + title = strSubstitutor.replace(title); + } + MessageTemplateConfigEntity msgTemEntity = messageTemplateConfigService.getInfo(model.getTemplateId()); + Integer source = Integer.parseInt(msgTemEntity.getMessageSource()); + Integer type = Integer.parseInt(msgTemEntity.getMessageType()); + messageService.sentMessage(toUserIdsList, title, content, userInfo, source, type, true); + if ("1".equals(msgTemEntity.getMessageSource())) { + content = null; + } +// MessageMonitorEntity monitorEntity = createSysMessageMonitor(msgTemEntity, content, userInfo, toUser, title); +// messageMonitorService.create(monitorEntity); + break; + case SmsMessage: + // 发送短信 + JSONObject jsonObject1 = sendSms(toUserIdsList, model, parameterMap); + if (!(Boolean) jsonObject1.get("code")) { + return "发送短信消息失败,错误:" + jsonObject1.get("error"); + } + break; + case MailMessage: + // 邮件 + JSONObject jsonObject2 = SendMail(toUserIdsList, userInfo, sendType, model, parameterMap); + if (!(Boolean) jsonObject2.get("code")) { + return "发送邮件消息失败,错误:" + jsonObject2.get("error"); + } + break; + case QyMessage: + // 企业微信 + JSONObject jsonObject3 = SendQyWebChat(toUserIdsList, userInfo, sendType, model, parameterMap); + if (!(Boolean) jsonObject3.get("code")) { + return "发送企业微信消息失败,错误:" + jsonObject3.get("error"); + } + break; + case DingMessage: + // 钉钉 + JSONObject jsonObject4 = SendDingTalk(toUserIdsList, userInfo, sendType, model, parameterMap); + if (!(Boolean) jsonObject4.get("code")) { + return "发送钉钉消息失败,错误:" + jsonObject4.get("error"); + } + break; + case WebHookMessage: + // webhook + JSONObject jsonObject5 = SendWebHook(sendType, userInfo, model, parameterMap); + if (!(Boolean) jsonObject5.get("code")) { + return "发送webhook消息失败,错误:" + jsonObject5.get("error"); + } + break; + case WechatMessage: + // 微信公众号 + JSONObject jsonObject6 = SendWXGzhChat(toUserIdsList, userInfo, sendType, model, parameterMap); + if (!(Boolean) jsonObject6.get("code")) { + return "发送微信公众号消息失败,错误:" + jsonObject6.get("error"); + } + break; + default: + break; + } + } + } + return null; + } + + private JSONObject SendWebHook(String sendType, UserInfo userInfo, SendConfigTemplateModel model, Map parameterMap) { + MessageTemplateConfigEntity entity = messageTemplateConfigService.getInfo(model.getTemplateId()); + String content = entity.getContent(); + JSONObject retJson = new JSONObject(); + MessageMonitorEntity monitorEntity = new MessageMonitorEntity(); + monitorEntity.setId(RandomUtil.uuId()); + monitorEntity.setSendTime(DateUtil.getNowDate()); + monitorEntity.setCreatorTime(DateUtil.getNowDate()); + monitorEntity.setCreatorUserId(userInfo.getUserId()); + + // 替换参数 + if (StringUtil.isNotEmpty(content)) { + StringSubstitutor strSubstitutor = new StringSubstitutor(parameterMap, "{", "}"); + content = strSubstitutor.replace(content); + } + AccountConfigEntity entity1 = accountConfigService.getInfo(model.getAccountConfigId()); + if (entity != null) { + //消息监控-消息模板写入 + monitorEntity.setMessageType(entity.getMessageType()); + monitorEntity.setMessageTemplateId(entity.getId()); + String title = entity.getTitle(); + if (StringUtil.isNotEmpty(title)) { + StringSubstitutor strSubstitutor = new StringSubstitutor(parameterMap, "{", "}"); + title = strSubstitutor.replace(title); + } + monitorEntity.setTitle(title); + monitorEntity.setReceiveUser(entity1.getWebhookAddress()); + monitorEntity.setContent(content); + monitorEntity.setMessageSource(entity.getMessageSource()); + if (entity1 != null) { + //消息监控-账号配置写入 + monitorEntity.setAccountId(entity1.getId()); + monitorEntity.setAccountCode(entity1.getEnCode()); + monitorEntity.setAccountName(entity1.getFullName()); + switch (entity1.getWebhookType()) { + case "1": + //钉钉 + if ("1".equals(entity1.getApproveType())) { + JSONObject result = WebHookUtil.sendDDMessage(entity1.getWebhookAddress(), content); + messageMonitorService.create(monitorEntity); + if (ObjectUtil.isNotEmpty(result)) { + if (!"0".equals(result.get("errcode").toString())) { + retJson.put("code", false); + retJson.put("error", result.get("errmsg")); + return retJson; + } + } else { + retJson.put("code", false); + retJson.put("error", "webhook账号地址配置错误!"); + return retJson; + } + } else if ("2".equals(entity1.getApproveType())) { + JSONObject result = WebHookUtil.sendDingDing(entity1.getWebhookAddress(), entity1.getBearer(), content); + messageMonitorService.create(monitorEntity); + if (ObjectUtil.isNotEmpty(result)) { + if (!"0".equals(result.get("errcode").toString())) { + retJson.put("code", false); + retJson.put("error", result.get("errmsg")); + return retJson; + } + } else { + retJson.put("code", false); + retJson.put("error", "webhook账号地址配置错误!"); + return retJson; + } + } + break; + case "2": + if ("1".equals(entity1.getApproveType())) { + JSONObject result = WebHookUtil.callWeChatBot(entity1.getWebhookAddress(), content); + messageMonitorService.create(monitorEntity); + if (!"0".equals(result.get("errcode").toString())) { + retJson.put("code", false); + retJson.put("error", result.get("errmsg")); + return retJson; + } + } + break; + default: + break; + } + } else { + retJson.put("code", false); + retJson.put("error", "账号配置数据不存在!"); + messageMonitorService.create(monitorEntity); + return retJson; + } + } else { + retJson.put("code", false); + retJson.put("error", "消息模板数据不存在!"); + messageMonitorService.create(monitorEntity); + return retJson; + } + retJson.put("code", true); + retJson.put("error", MsgCode.SU012.get()); + return retJson; + } + + /** + * 发送企业微信消息 + * + * @param toUserIdsList + * @param userInfo + * @param sendType + * @param parameterMap + * @return + */ + private JSONObject SendQyWebChat(List toUserIdsList, UserInfo userInfo, String sendType, SendConfigTemplateModel model, Map parameterMap) { + JSONObject retJson = new JSONObject(); + boolean code = true; + StringBuilder error = new StringBuilder(); + MessageTemplateConfigEntity entity = messageTemplateConfigService.getInfo(model.getTemplateId()); + + //创建消息监控 + MessageMonitorEntity monitorEntity = new MessageMonitorEntity(); + monitorEntity.setId(RandomUtil.uuId()); + monitorEntity.setSendTime(DateUtil.getNowDate()); + monitorEntity.setReceiveUser(JsonUtil.getObjectToString(toUserIdsList)); + monitorEntity.setCreatorTime(DateUtil.getNowDate()); + monitorEntity.setCreatorUserId(userInfo.getUserId()); + //消息监控-消息模板写入 + monitorEntity.setMessageType(entity.getMessageType()); + monitorEntity.setMessageSource(entity.getMessageSource()); + monitorEntity.setMessageTemplateId(entity.getId()); + + String content = entity.getContent(); + // 替换参数 + if (StringUtil.isNotEmpty(content)) { + StringSubstitutor strSubstitutor = new StringSubstitutor(parameterMap, "{", "}"); + content = strSubstitutor.replace(content); + } + + String title = entity.getTitle(); + if (StringUtil.isNotEmpty(title)) { + StringSubstitutor strSubstitutor = new StringSubstitutor(parameterMap, "{", "}"); + title = strSubstitutor.replace(title); + } + monitorEntity.setTitle(title); + monitorEntity.setContent(content); + for (String userId : toUserIdsList) { + UserEntity userEntity = userService.getInfo(userId); + if (entity != null) { + // 获取系统配置 + Map objModel = getSystemConfig(); + BaseSystemInfo config = JsonUtil.getJsonToBean(objModel, BaseSystemInfo.class); + String corpId = config.getQyhCorpId(); + String agentId = config.getQyhAgentId(); + // 获取的应用的Secret值 + String corpSecret = config.getQyhAgentSecret(); + + String wxUserId = ""; + StringBuilder toWxUserId = new StringBuilder(); + String toUserIdAll = ""; + StringBuilder nullUserInfo = new StringBuilder(); + List messageReceiveList = new ArrayList<>(); + + // 相关参数验证 + if (StringUtil.isEmpty(corpId)) { + log.error("企业ID为空"); + code = false; + error = error.append(";").append(userEntity.getRealName() + ":企业ID为空!"); + continue; + } + if (StringUtil.isEmpty(corpSecret)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":凭证密钥为空!"); + continue; + } + if (StringUtil.isEmpty(agentId)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":企业微信应用凭证为空!"); + continue; + } + if (StringUtil.isEmpty(content)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":内容为空!"); + continue; + } + if (StringUtil.isEmpty(userId)) { + code = false; + error = error.append(";").append("接收人为空!"); + continue; + } + // 创建消息实体 + MessageEntity messageEntity = JnpfMessageUtil.setMessageEntity(userInfo.getUserId(), content, null, Integer.parseInt(sendType)); + + // 获取接收人员的企业微信号、创建消息用户实体 + wxUserId = ""; + // 从同步表获取对应的企业微信ID + SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId("1", "2", userId); + if (synThirdInfoEntity != null) { + wxUserId = synThirdInfoEntity.getThirdObjId(); + } + if (StringUtil.isEmpty(wxUserId)) { + nullUserInfo = nullUserInfo.append(",").append(userId); + } else { + toWxUserId = toWxUserId.append("|").append(wxUserId); + } + messageReceiveList.add(JnpfMessageUtil.setMessageReceiveEntity(userId, title, Integer.valueOf(sendType))); + + // 处理企业微信号信息串并验证 + toUserIdAll = toWxUserId.toString(); + if (StringUtil.isNotEmpty(toUserIdAll)) { + toUserIdAll = toUserIdAll.substring(1); + } + if (StringUtil.isEmpty(toUserIdAll)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":接收人对应的企业微信号全部为空!"); + continue; + } + + // 批量发送企业信息信息 + retJson = QyWebChatUtil.sendWxMessage(corpId, corpSecret, agentId, toUserIdAll, content); + if (!retJson.getBoolean("code")) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":" + retJson.get("error")); + continue; + } + + // 企业微信号为空的信息写入备注 + if (StringUtil.isNotEmpty(nullUserInfo.toString())) { + messageEntity.setExcerpt(nullUserInfo.substring(1) + "对应的企业微信号为空"); + } + continue; + } else { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":消息模板数据不存在!"); + continue; + } + } + messageMonitorService.create(monitorEntity); + if (code) { + retJson.put("code", true); + retJson.put("error", MsgCode.SU012.get()); + } else { + String msg = error.toString(); + msg = msg.substring(1); + retJson.put("code", false); + retJson.put("error", msg); + } + return retJson; + } + + /** + * List toUserIdsList, UserInfo userInfo, String sendType, MessageTemplateEntity entity, Map parameterMap + * + * @param toUserIdsList + * @param userInfo + * @param sendType + * @param parameterMap + * @return + */ + private JSONObject SendDingTalk(List toUserIdsList, UserInfo userInfo, String sendType, SendConfigTemplateModel model, Map parameterMap) { + JSONObject retJson = new JSONObject(); + boolean code = true; + StringBuilder error = new StringBuilder(); + //创建消息监控 + MessageTemplateConfigEntity entity = messageTemplateConfigService.getInfo(model.getTemplateId()); + + MessageMonitorEntity monitorEntity = new MessageMonitorEntity(); + monitorEntity.setId(RandomUtil.uuId()); + monitorEntity.setSendTime(DateUtil.getNowDate()); + monitorEntity.setReceiveUser(JsonUtil.getObjectToString(toUserIdsList)); + monitorEntity.setCreatorTime(DateUtil.getNowDate()); + monitorEntity.setCreatorUserId(userInfo.getUserId()); + //消息监控-消息模板写入 + monitorEntity.setMessageType(entity.getMessageType()); + monitorEntity.setMessageSource(entity.getMessageSource()); + monitorEntity.setMessageTemplateId(entity.getId()); + + String content = entity.getContent(); + // 替换参数 + if (StringUtil.isNotEmpty(content)) { + StringSubstitutor strSubstitutor = new StringSubstitutor(parameterMap, "{", "}"); + content = strSubstitutor.replace(content); + } + + String title = entity.getTitle(); + if (StringUtil.isNotEmpty(title)) { + StringSubstitutor strSubstitutor = new StringSubstitutor(parameterMap, "{", "}"); + title = strSubstitutor.replace(title); + } + monitorEntity.setTitle(title); + monitorEntity.setContent(content); + for (String userId : toUserIdsList) { + UserEntity userEntity = userService.getInfo(userId); + if (entity != null) { + // 获取系统配置 + Map objModel = getSystemConfig(); + DingTalkModel dingTalkModel = JsonUtil.getJsonToBean(objModel, DingTalkModel.class); + String appKey = dingTalkModel.getDingSynAppKey(); + String appSecret = dingTalkModel.getDingSynAppSecret(); + String agentId = dingTalkModel.getDingAgentId(); + String dingUserId = ""; + StringBuilder toDingUserId = new StringBuilder(); + String toUserIdAll = ""; + StringBuilder nullUserInfo = new StringBuilder(); + List messageReceiveList = new ArrayList<>(); + + // 相关参数验证 + if (StringUtil.isEmpty(appKey)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":AppKey为空!"); + continue; + } + if (StringUtil.isEmpty(appSecret)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":AppSecret为空!"); + continue; + } + if (StringUtil.isEmpty(agentId)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":AgentId为空!"); + continue; + } + if (StringUtil.isEmpty(content)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":内容为空!"); + continue; + } + if (StringUtil.isEmpty(userId)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":接收人为空!"); + continue; + } + + // 创建消息实体 + MessageEntity messageEntity = JnpfMessageUtil.setMessageEntity(userInfo.getUserId(), content, null, Integer.parseInt(sendType)); + + // 获取接收人员的钉钉号、创建消息用户实体 + dingUserId = ""; + // 从同步表获取对应用户的钉钉ID + SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId("2", "2", userId); + if (synThirdInfoEntity != null) { + dingUserId = synThirdInfoEntity.getThirdObjId(); + } + if (StringUtil.isEmpty(dingUserId)) { + nullUserInfo = nullUserInfo.append(",").append(userId); + } else { + toDingUserId = toDingUserId.append(",").append(dingUserId); + } + messageReceiveList.add(JnpfMessageUtil.setMessageReceiveEntity(userId, title, Integer.valueOf(sendType))); + + // 处理接收人员的钉钉号信息串并验证 + toUserIdAll = toDingUserId.toString(); + if (StringUtil.isNotEmpty(toUserIdAll)) { + toUserIdAll = toUserIdAll.substring(1); + } + if (StringUtil.isEmpty(toUserIdAll)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":接收人对应的钉钉号为空!"); + continue; + } + + // 批量发送钉钉信息 + retJson = DingTalkUtil.sendDingMessage(appKey, appSecret, agentId, toUserIdAll, content); + if (!retJson.getBoolean("code")) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":" + retJson.get("error")); + continue; + } + + // 钉钉号为空的信息写入备注 + if (StringUtil.isNotEmpty(nullUserInfo.toString())) { + messageEntity.setExcerpt(nullUserInfo.toString().substring(1) + "对应的钉钉号为空!"); + } + continue; + } else { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":消息模板数据不存在!"); + continue; + } + } + messageMonitorService.create(monitorEntity); + if (code) { + retJson.put("code", true); + retJson.put("error", MsgCode.SU012.get()); + } else { + String msg = error.toString(); + msg = msg.substring(1); + retJson.put("code", false); + retJson.put("error", msg); + } + return retJson; + } + + /** + * 发送邮件 + * + * @param toUserIdsList + * @param userInfo + * @param sendType + * @param parameterMap + * @return + */ + private JSONObject SendMail(List toUserIdsList, UserInfo userInfo, String sendType, SendConfigTemplateModel model, Map parameterMap) { + JSONObject retJson = new JSONObject(); + boolean code = true; + StringBuilder error = new StringBuilder(); + //创建消息监控 + MessageTemplateConfigEntity entity = messageTemplateConfigService.getInfo(model.getTemplateId()); + AccountConfigEntity entity1 = accountConfigService.getInfo(model.getAccountConfigId()); + MessageMonitorEntity monitorEntity = new MessageMonitorEntity(); + monitorEntity.setId(RandomUtil.uuId()); + monitorEntity.setSendTime(DateUtil.getNowDate()); + monitorEntity.setReceiveUser(JsonUtil.getObjectToString(toUserIdsList)); + monitorEntity.setCreatorTime(DateUtil.getNowDate()); + monitorEntity.setCreatorUserId(userInfo.getUserId()); + //消息监控-消息模板写入 + monitorEntity.setMessageType(entity.getMessageType()); + monitorEntity.setMessageSource(entity.getMessageSource()); + monitorEntity.setMessageTemplateId(entity.getId()); + //消息监控-账号配置写入 + monitorEntity.setAccountId(entity1.getId()); + monitorEntity.setAccountCode(entity1.getEnCode()); + monitorEntity.setAccountName(entity1.getFullName()); + String content = entity.getContent(); + // 替换参数 + if (StringUtil.isNotEmpty(content)) { + StringSubstitutor strSubstitutor = new StringSubstitutor(parameterMap, "{", "}"); + content = strSubstitutor.replace(content); + } + + String title = entity.getTitle(); + if (StringUtil.isNotEmpty(title)) { + StringSubstitutor strSubstitutor = new StringSubstitutor(parameterMap, "{", "}"); + title = strSubstitutor.replace(title); + } + monitorEntity.setTitle(title); + monitorEntity.setContent(content); + for (String userId : toUserIdsList) { + UserEntity userEntity = userService.getInfo(userId); + if (userEntity != null) { + if (entity != null) { + if (entity1 != null) { + + Map objModel = new HashMap<>(); + objModel.put("emailSmtpHost", entity1.getSmtpServer()); + objModel.put("emailSmtpPort", entity1.getSmtpPort().toString()); + objModel.put("emailSenderName", entity1.getAddressorName()); + objModel.put("emailAccount", entity1.getSmtpUser()); + objModel.put("emailPassword", entity1.getSmtpPassword()); + objModel.put("emailSsl", entity1.getSslLink().equals("1") ? "true" : "false"); + + EmailModel emailModel = JsonUtil.getJsonToBean(objModel, EmailModel.class); + StringBuilder nullUserInfo = new StringBuilder(); + List messageReceiveList = new ArrayList<>(); + StringBuilder toUserMail = new StringBuilder(); + String userEmailAll = ""; + String userEmail = ""; + String userName = ""; + + // 相关参数验证 + if (StringUtil.isEmpty(emailModel.getEmailSmtpHost())) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":SMTP服务为空!"); + continue; + } else if (StringUtil.isEmpty(emailModel.getEmailSmtpPort())) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":SMTP端口为空!"); + continue; + } else if (StringUtil.isEmpty(emailModel.getEmailAccount())) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":发件人邮箱为空!"); + continue; + } else if (StringUtil.isEmpty(emailModel.getEmailPassword())) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":发件人密码为空!"); + continue; + } else if (StringUtil.isEmpty(userId)) { + code = false; + error = error.append(";").append("接收人为空!"); + continue; + } else { + // 设置邮件标题 + emailModel.setEmailTitle(title); + // 设置邮件内容 + emailModel.setEmailContent(content); + + // 创建消息实体 + MessageEntity messageEntity = JnpfMessageUtil.setMessageEntity(userInfo.getUserId(), emailModel.getEmailTitle(), emailModel.getEmailContent(), Integer.parseInt(sendType)); + + // 获取收件人的邮箱地址、创建消息用户实体 + if (userEntity != null) { + userEmail = StringUtil.isEmpty(userEntity.getEmail()) ? "" : userEntity.getEmail(); + userName = userEntity.getRealName(); + } + if (userEmail != null && !"".equals(userEmail)) { + if (EmailUtil.isEmail(userEmail)) { + toUserMail = toUserMail.append(",").append(userName).append("<").append(userEmail).append(">"); + } + } else { + nullUserInfo = nullUserInfo.append(",").append(userId); + } + messageReceiveList.add(JnpfMessageUtil.setMessageReceiveEntity(userId, title, Integer.valueOf(sendType))); + + // 处理接收人员的邮箱信息串并验证 + userEmailAll = toUserMail.toString(); + if (StringUtil.isNotEmpty(userEmailAll)) { + userEmailAll = userEmailAll.substring(1); + } + if (StringUtil.isEmpty(userEmailAll)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":接收人为空!"); + continue; + } else { + // 设置接收人员 + emailModel.setEmailToUsers(userEmailAll); + // 发送邮件 + retJson = EmailUtil.sendMail(emailModel); + if (!retJson.getBoolean("code")) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":" + retJson.get("error")); + continue; + } else { + // 邮箱地址为空的信息写入备注 + if (StringUtil.isNotEmpty(nullUserInfo.toString())) { + messageEntity.setExcerpt(nullUserInfo.substring(1) + "对应的邮箱为空"); + } + continue; + // 写入系统的消息表、消息用户表 + } + } + } + } else { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":账号配置数据不存在!"); + continue; + } + } else { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":消息模板数据不存在!"); + continue; + } + } + } + messageMonitorService.create(monitorEntity); + if (code) { + retJson.put("code", true); + retJson.put("error", MsgCode.SU012.get()); + } else { + String msg = error.toString(); + msg = msg.substring(1); + retJson.put("code", false); + retJson.put("error", msg); + } + return retJson; + } + + /** + * 发送短信 + * + * @param toUserIdsList + * @param parameterMap + * @return + */ + private JSONObject sendSms(List toUserIdsList, SendConfigTemplateModel model, Map parameterMap) { + UserInfo userInfo = userProvider.get(); + JSONObject retJson = new JSONObject(); + boolean code = true; + StringBuilder error = new StringBuilder(); + + //创建消息监控 + MessageTemplateConfigEntity entity = messageTemplateConfigService.getInfo(model.getTemplateId()); + AccountConfigEntity entity1 = accountConfigService.getInfo(model.getAccountConfigId()); + MessageMonitorEntity monitorEntity = new MessageMonitorEntity(); + monitorEntity.setId(RandomUtil.uuId()); + monitorEntity.setSendTime(DateUtil.getNowDate()); + monitorEntity.setReceiveUser(JsonUtil.getObjectToString(toUserIdsList)); + monitorEntity.setCreatorTime(DateUtil.getNowDate()); + monitorEntity.setCreatorUserId(userInfo.getUserId()); + //消息监控-消息模板写入 + monitorEntity.setMessageType(entity.getMessageType()); + monitorEntity.setMessageSource(entity.getMessageSource()); + monitorEntity.setMessageTemplateId(entity.getId()); + //消息监控-账号配置写入 + monitorEntity.setAccountId(entity1.getId()); + monitorEntity.setAccountCode(entity1.getEnCode()); + monitorEntity.setAccountName(entity1.getFullName()); + String content = entity.getContent(); + // 替换参数 + if (StringUtil.isNotEmpty(content)) { + StringSubstitutor strSubstitutor = new StringSubstitutor(parameterMap, "{", "}"); + content = strSubstitutor.replace(content); + } + + String title = entity.getTitle(); + if (StringUtil.isNotEmpty(title)) { + StringSubstitutor strSubstitutor = new StringSubstitutor(parameterMap, "{", "}"); + title = strSubstitutor.replace(title); + } + monitorEntity.setTitle(title); + monitorEntity.setContent(content); + for (String userId : toUserIdsList) { + UserEntity userEntity = userService.getInfo(userId); + if (entity != null) { + if (entity1 != null) { + //账号配置——短信 + Map objModel = new HashMap<>(16); + objModel.put("aliAccessKey", entity1.getAppId()); + objModel.put("aliSecret", entity1.getAppSecret()); + objModel.put("tencentSecretId", entity1.getAppId()); + objModel.put("tencentSecretKey", entity1.getAppSecret()); + objModel.put("tencentAppId", entity1.getSdkAppId()); + objModel.put("tencentAppKey", entity1.getAppKey()); + SmsModel smsConfig = JsonUtil.getJsonToBean(objModel, SmsModel.class); + int company = Integer.parseInt(entity1.getChannel()); + // 组装接受用户 + StringBuffer toUserIdList = new StringBuffer(); + + if (isPhone(userEntity.getMobilePhone())) { + toUserIdList.append(userEntity.getMobilePhone() + ","); + } + //短信参数 + Map smsMap = new HashMap<>(); + if (entity != null) { + smsMap = smsFieldService.getParamMap(entity.getId(), parameterMap); + } else { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":消息模板数据不存在!"); + continue; + } + // 发送短信 + String endPoint = ""; + if ("1".equals(entity1.getChannel())) { + endPoint = entity1.getEndPoint(); + } else if ("2".equals(entity1.getChannel())) { + endPoint = entity1.getZoneName(); + } + content = SmsUtil.querySmsTemplateContent(company, smsConfig, endPoint, entity1.getZoneParam(), entity.getTemplateCode()); + if (StringUtil.isNotBlank(content) && !"null".equals(content)) { + if ("1".equals(entity1.getChannel())) { + if (content.contains("${")) { + for (String key : smsMap.keySet()) { + if (StringUtil.isNotBlank(String.valueOf(smsMap.get(key))) && smsMap.get(key) != null) { + String v = String.valueOf(smsMap.get(key)); + content = content.replace("${" + key + "}", smsMap.get(key).toString()); + } + } + } + } else if ("2".equals(entity1.getChannel())) { + if (content.contains("{")) { + for (String key : smsMap.keySet()) { + if (StringUtil.isNotBlank(String.valueOf(smsMap.get(key))) && smsMap.get(key) != null) { + content = content.replace("{" + key + "}", smsMap.get(key).toString()); + } + } + } + } + } + monitorEntity.setContent(content); + if (StringUtil.isEmpty(toUserIdList)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":手机号码格式错误!"); + continue; + } + String result = SmsUtil.sentSms(company, smsConfig, endPoint, entity1.getZoneParam(), toUserIdList.toString(), entity1.getSmsSignature(), entity.getTemplateCode(), smsMap); + if (!"Ok".equalsIgnoreCase(result)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":" + result); + continue; + } + continue; + } else { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":账号配置数据不存在!"); + continue; + } + } else { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":消息模板数据不存在!"); + continue; + } + } + messageMonitorService.create(monitorEntity); + if (code) { + retJson.put("code", true); + retJson.put("error", MsgCode.SU012.get()); + } else { + String msg = error.toString(); + msg = msg.substring(1); + retJson.put("code", false); + retJson.put("error", msg); + } + return retJson; + } + + /** + * 发送微信公众号消息 + * + * @param toUserIdsList + * @param userInfo + * @param sendType + * @param parameterMap + * @return + */ + public JSONObject SendWXGzhChat(List toUserIdsList, UserInfo userInfo, String sendType, SendConfigTemplateModel model, Map parameterMap) { + JSONObject retJson = new JSONObject(); + boolean code = true; + StringBuilder error = new StringBuilder(); + //创建消息监控 + MessageTemplateConfigEntity entity = messageTemplateConfigService.getInfo(model.getTemplateId()); + AccountConfigEntity entity1 = accountConfigService.getInfo(model.getAccountConfigId()); + MessageMonitorEntity monitorEntity = new MessageMonitorEntity(); + monitorEntity.setId(RandomUtil.uuId()); + monitorEntity.setSendTime(DateUtil.getNowDate()); + monitorEntity.setReceiveUser(JsonUtil.getObjectToString(toUserIdsList)); + monitorEntity.setCreatorTime(DateUtil.getNowDate()); + monitorEntity.setCreatorUserId(userInfo.getUserId()); + //消息监控-消息模板写入 + monitorEntity.setMessageType(entity.getMessageType()); + monitorEntity.setMessageSource(entity.getMessageSource()); + monitorEntity.setMessageTemplateId(entity.getId()); + //消息监控-账号配置写入 + monitorEntity.setAccountId(entity1.getId()); + monitorEntity.setAccountCode(entity1.getEnCode()); + monitorEntity.setAccountName(entity1.getFullName()); + String content = entity.getContent(); + // 替换参数 + if (StringUtil.isNotEmpty(content)) { + StringSubstitutor strSubstitutor = new StringSubstitutor(parameterMap, "{", "}"); + content = strSubstitutor.replace(content); + } + + String title = entity.getTitle(); + if (StringUtil.isNotEmpty(title)) { + StringSubstitutor strSubstitutor = new StringSubstitutor(parameterMap, "{", "}"); + title = strSubstitutor.replace(title); + } + monitorEntity.setTitle(title); + monitorEntity.setContent(content); + for (String userId : toUserIdsList) { + if (StringUtil.isEmpty(userId)) { + code = false; + error = error.append(";").append("接收人为空!"); + continue; + } + UserEntity userEntity = userService.getById(userId); + AccountConfigEntity accountEntity = accountConfigService.getInfo(model.getAccountConfigId()); + // 获取消息模板详情 + MessageTemplateConfigEntity msgTemEntity = messageTemplateConfigService.getInfo(model.getTemplateId()); + if (msgTemEntity != null) { + String templateKId = msgTemEntity.getTemplateCode(); + //微信公众号参数 + Map smsMap = new HashMap<>(); + if (model != null) { + smsMap = smsFieldService.getParamMap(model.getTemplateId(), parameterMap); + } + if (smsMap.containsKey("title")) { + title = smsMap.get("title").toString(); + smsMap.keySet().removeIf(k -> k.equals("title")); + } + monitorEntity.setTitle(title); + if (ObjectUtil.isNotEmpty(accountEntity)) { + // 获取系统配置 + String appId = accountEntity.getAppId(); + String appsecret = accountEntity.getAppSecret(); + String wxxcxAppId = msgTemEntity.getXcxAppId(); + String type = msgTemEntity.getWxSkip(); + + // 相关参数验证 + if (StringUtil.isEmpty(templateKId)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":微信公众号模板id未创建!"); + messageMonitorService.create(monitorEntity); + continue; + } + if (StringUtil.isEmpty(appId)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":公众号appid为空为空!"); + messageMonitorService.create(monitorEntity); + continue; + } + if (StringUtil.isEmpty(appsecret)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":公众号appsecret为空为空!"); + messageMonitorService.create(monitorEntity); + continue; + } + // 获取微信公众号的token + String token = WXGZHWebChatUtil.getAccessToken(appId, appsecret); + if (StringUtil.isEmpty(token)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":获取微信公众号token失败!"); + messageMonitorService.create(monitorEntity); + continue; + } + // 微信公众号发送消息 + //获取用户在对应微信公众号上的openid + WechatUserEntity wechatUserEntity = wechatUserService.getInfoByGzhId(userId, accountEntity.getAppKey()); + if (wechatUserEntity != null) { + if (StringUtil.isNotBlank(wechatUserEntity.getOpenId())) { + String openid = wechatUserEntity.getOpenId(); + String pagepath = "pages/login/index?tag=1&flowId="; + //参数封装 + String message = WXGZHWebChatUtil.messageJson(templateKId, openid, wxxcxAppId, pagepath, smsMap, title, "2", null); + //发送信息 + retJson = WXGZHWebChatUtil.sendMessage(token, message); + JSONObject rstObj = WXGZHWebChatUtil.getMessageList(token); + List wxgzhMessageModelList = JsonUtil.getJsonToList(rstObj.get("template_list"), WxgzhMessageModel.class); + WxgzhMessageModel messageModel = wxgzhMessageModelList.stream().filter(t -> t.getTemplateId().equals(templateKId)).findFirst().orElse(null); + if (ObjectUtil.isNotEmpty(messageModel)) { + content = messageModel.getContent(); + if (StringUtil.isNotBlank(content) && !"null".equals(content)) { + if (ObjectUtil.isNotEmpty(smsMap) && !"null".equals(smsMap)) { + if (content.contains(".DATA}")) { + for (String key : smsMap.keySet()) { + content = content.replace(key, smsMap.get(key).toString()); + } + } + } + } + } + //创建消息监控 + monitorEntity.setContent(content); + if (!retJson.getBoolean("code")) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":" + retJson.get("error")); + messageMonitorService.create(monitorEntity); + continue; + } + messageMonitorService.create(monitorEntity); + continue; + } else { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":" + "账号未绑定公众号!"); + messageMonitorService.create(monitorEntity); + continue; + } + } else { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":" + "账号未绑定公众号!"); + messageMonitorService.create(monitorEntity); + continue; + } + } else { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":账号配置数据不存在!"); + messageMonitorService.create(monitorEntity); + continue; + } + } else { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":消息模板数据不存在!"); + messageMonitorService.create(monitorEntity); + continue; + } + } + if (code) { + retJson.put("code", true); + retJson.put("error", MsgCode.SU012.get()); + } else { + String msg = error.toString(); + msg = msg.substring(1); + retJson.put("code", false); + retJson.put("error", msg); + } + return retJson; + } + + /** + * 获取系统配置 + */ + private Map getSystemConfig() { + // 获取系统配置 + List configList = sysconfigService.getList("SysConfig"); + Map objModel = new HashMap<>(16); + for (SysConfigEntity entity : configList) { + objModel.put(entity.getFkey(), entity.getValue()); + } + return objModel; + } + + private MessageMonitorEntity createSysMessageMonitor(MessageTemplateConfigEntity msgTemEntity, String content, UserInfo userInfo, List toUserIdsList, String title) { + MessageMonitorEntity monitorEntity = new MessageMonitorEntity(); + monitorEntity.setId(RandomUtil.uuId()); + monitorEntity.setMessageType(msgTemEntity.getMessageType()); + monitorEntity.setMessageSource(msgTemEntity.getMessageSource()); + monitorEntity.setSendTime(DateUtil.getNowDate()); + monitorEntity.setMessageTemplateId(msgTemEntity.getId()); + monitorEntity.setTitle(title); + monitorEntity.setReceiveUser(JsonUtil.getObjectToString(toUserIdsList)); + monitorEntity.setContent(content); + monitorEntity.setCreatorTime(DateUtil.getNowDate()); + monitorEntity.setCreatorUserId(userInfo.getUserId()); + return monitorEntity; + } + + public static boolean isPhone(String phone) { + if (StringUtil.isNotBlank(phone) && !"null".equals(phone)) { + return Pattern.matches("^1[3-9]\\d{9}$", phone); + } + return false; + } +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/dbutil/TableUtil.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/dbutil/TableUtil.java new file mode 100644 index 0000000..219f767 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/dbutil/TableUtil.java @@ -0,0 +1,60 @@ +package jnpf.base.util.dbutil; + +import jnpf.database.constant.DbConst; + +import java.util.Random; + +/** + * 表字段相关工具类 + * + * @author JNPF开发平台组 YanYu + * @version V3.3 + * @copyright 引迈信息技术有限公司 + * @date 2022-06-08 + */ +public class TableUtil { + + + /** + * 随机生成包含大小写字母及数字的字符串 + * + * @param length + * @return + */ + public static String getStringRandom(int length) { + String val = ""; + Random random = new Random(); + //参数length,表示生成几位随机数 + for (int i = 0; i < length; i++) { + String charOrNum = random.nextInt(2) % 2 == 0 ? "char" : "num"; + //输出字母还是数字 + if ("char".equalsIgnoreCase(charOrNum)) { + //输出是大写字母还是小写字母 + int temp = random.nextInt(2) % 2 == 0 ? 65 : 97; + val += (char) (random.nextInt(26) + temp); + } else if ("num".equalsIgnoreCase(charOrNum)) { + val += String.valueOf(random.nextInt(10)); + } + } + return val; + } + + /** + * 检测自带表 + * + * @param tableName 表明 + * @return ignore + */ + public static Boolean checkByoTable(String tableName) { + String[] tables = DbConst.BYO_TABLE.split(","); + boolean exists; + for (String table : tables) { + exists = tableName.toLowerCase().equals(table); + if (exists) { + return true; + } + } + return false; + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/interfaceUtil/InterfaceUtil.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/interfaceUtil/InterfaceUtil.java new file mode 100644 index 0000000..085d5c0 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/interfaceUtil/InterfaceUtil.java @@ -0,0 +1,133 @@ +package jnpf.base.util.interfaceUtil; + +import cn.hutool.core.collection.CollectionUtil; +import jnpf.util.CollectionUtils; +import jnpf.util.DateUtil; +import jnpf.util.ServletUtil; +import jnpf.util.StringUtil; +import org.apache.commons.codec.binary.Base64; +import org.apache.commons.codec.binary.Hex; +import org.apache.commons.codec.binary.StringUtils; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; +import java.text.SimpleDateFormat; +import java.time.OffsetDateTime; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import java.util.*; + +/** + * 接口工具类 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/6/13 10:38 + */ +public class InterfaceUtil { + public static final String ALGORITH_FORMAC = "HmacSHA256"; + public static final String HOST = "Host"; + public static final String YMDATE = "YmDate"; + public static final String CONTENT_TYPE = " Content-Type"; + public static final String CHARSET_NAME = "utf-8"; + public static final String USERKEY = "UserKey"; + + /** + * 验证签名 + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2022/6/14 + */ + public static boolean verifySignature(String secret, String author) throws NoSuchAlgorithmException, InvalidKeyException, UnsupportedEncodingException { + String method = ServletUtil.getRequest().getMethod(); + String url = ServletUtil.getRequest().getRequestURI(); + String ymdate = ServletUtil.getRequest().getHeader(YMDATE); + String host = ServletUtil.getRequest().getHeader(HOST); + String source = new StringBuilder() + .append(method).append('\n') + .append(url).append('\n') + .append(ymdate).append('\n') + .append(host).append('\n').toString(); + Mac mac = Mac.getInstance(ALGORITH_FORMAC); + SecretKeySpec secretKeySpec = new SecretKeySpec(Base64.decodeBase64(secret), ALGORITH_FORMAC); + mac.init(secretKeySpec); + String signature = Hex.encodeHexString(mac.doFinal(source.getBytes(CHARSET_NAME))); + if (author.equals(signature)) { + return true; + } + return false; + } + /** + * map转 name=value&name=value格式 + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2022/6/14 + */ + public static String createLinkStringByGet(Map params) throws UnsupportedEncodingException { + List keys = new ArrayList(params.keySet()); + Collections.sort(keys); + String prestr = ""; + for (int i = 0; i < keys.size(); i++) { + String key = keys.get(i); + String value = params.get(key); + value = URLEncoder.encode(value, "UTF-8"); + if (i == keys.size() - 1) {//拼接时,不包括最后一个&字符 + prestr = prestr + key + "=" + value; + } else { + prestr = prestr + key + "=" + value + "&"; + } + } + return prestr; + } + + /** + * 判断map内有没有指定key的值 + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2022/6/14 + */ + public static boolean checkParam(Map map,String str){ + if(CollectionUtil.isEmpty(map)){ + return false; + } + if(StringUtil.isEmpty(str)){ + return false; + } + if(map.get(str)!=null&& StringUtil.isNotEmpty(map.get(str))){ + return true; + } + return false; + } + +// + public static Map getAuthorization(String intefaceId, String appId, String appSecret, Map map){ + Map resultMap=new HashMap<>(); + try { + String method = ServletUtil.getRequest().getMethod(); + String url ="/api/system/DataInterface/"+intefaceId+"/Actions/Response"; + String ymdate = ""+DateUtil.getNowDate().getTime(); + String host = ServletUtil.getRequest().getHeader(HOST); + String source = new StringBuilder() + .append(method).append('\n') + .append(url).append('\n') + .append(ymdate).append('\n') + .append(host).append('\n').toString(); + Mac mac = Mac.getInstance(ALGORITH_FORMAC); + SecretKeySpec secretKeySpec = new SecretKeySpec(Base64.decodeBase64(appSecret), ALGORITH_FORMAC); + mac.init(secretKeySpec); + String signature = Hex.encodeHexString(mac.doFinal(source.getBytes(CHARSET_NAME))); + resultMap.put("YmDate",ymdate); + resultMap.put("Authorization",appId+"::"+signature); + return resultMap; + }catch (Exception e){} + return resultMap; + } +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/job/Schedule.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/job/Schedule.java new file mode 100644 index 0000000..e89f66d --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/job/Schedule.java @@ -0,0 +1,62 @@ +package jnpf.base.util.job; + +import cn.hutool.core.util.ObjectUtil; +import jnpf.base.UserInfo; +import jnpf.base.entity.ScheduleNewEntity; +import jnpf.base.model.schedule.ScheduleJobModel; +import jnpf.base.service.ScheduleNewService; +import jnpf.config.ConfigValueUtil; +import jnpf.util.RedisUtil; +import jnpf.util.StringUtil; +import jnpf.util.data.DataSourceContextHolder; +import lombok.extern.slf4j.Slf4j; +import org.quartz.DisallowConcurrentExecution; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.scheduling.quartz.QuartzJobBean; + +import java.util.List; +import java.util.concurrent.TimeUnit; + +@Slf4j +@DisallowConcurrentExecution +public class Schedule extends QuartzJobBean { + + @Autowired + private RedisUtil redisUtil; + @Autowired + private ScheduleNewService scheduleNewService; + @Autowired + private RedisTemplate redisTemplate; + @Autowired + private ScheduleJobUtil scheduleJobUtil; + @Autowired + private ConfigValueUtil configValueUtil; + + @Override + protected void executeInternal(JobExecutionContext context) throws JobExecutionException { + List listRedis = scheduleJobUtil.getListRedis(redisUtil); + for (ScheduleJobModel jobModel : listRedis) { + String id = jobModel.getId(); + boolean useSuccess = redisTemplate.opsForValue().setIfAbsent(ScheduleJobUtil.WORKTIMEOUT_REDIS_KEY + "_key:" + id, System.currentTimeMillis(), 100, TimeUnit.SECONDS); + if (!useSuccess) continue; + UserInfo userInfo = jobModel.getUserInfo(); + if (configValueUtil.isMultiTenancy()) { + if (StringUtil.isNotEmpty(userInfo.getTenantDbConnectionString())) { + DataSourceContextHolder.setDatasource(userInfo.getTenantId(), userInfo.getTenantDbConnectionString(), userInfo.isAssignDataSource()); + } + } + ScheduleNewEntity info = scheduleNewService.getInfo(id); + boolean msg = info != null && System.currentTimeMillis() >= jobModel.getScheduleTime().getTime(); + if (msg) { + scheduleNewService.scheduleMessage(jobModel); + } + boolean delete = (ObjectUtil.isNull(info) || msg); + if (delete) { + redisUtil.removeHash(ScheduleJobUtil.WORKTIMEOUT_REDIS_KEY, id); + } + } + } +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/job/ScheduleConfig.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/job/ScheduleConfig.java new file mode 100644 index 0000000..730655a --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/job/ScheduleConfig.java @@ -0,0 +1,28 @@ +package jnpf.base.util.job; + +import org.quartz.*; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class ScheduleConfig { + + @Bean + public JobDetail testJobDetail() { + JobDetail JobDetail = JobBuilder.newJob(Schedule.class) + .storeDurably() //必须调用该方法,添加任务 + .build(); + return JobDetail; + } + + @Bean + public Trigger testTrigger() { + CronScheduleBuilder cronScheduleBuilder = CronScheduleBuilder.cronSchedule("0 0/5 * * * ?"); + Trigger trigger = TriggerBuilder.newTrigger() + .forJob(testJobDetail()) + .withSchedule(cronScheduleBuilder) //对触发器配置任务 + .build(); + return trigger; + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/job/ScheduleJobUtil.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/job/ScheduleJobUtil.java new file mode 100644 index 0000000..cd815ef --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/job/ScheduleJobUtil.java @@ -0,0 +1,92 @@ +package jnpf.base.util.job; + +import jnpf.base.model.schedule.ScheduleJobModel; +import jnpf.config.ConfigValueUtil; +import jnpf.util.JsonUtil; +import jnpf.util.RedisUtil; +import jnpf.util.StringUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.DependsOn; +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ScheduledThreadPoolExecutor; + +/** + * 流程设计 + * + * @author JNPF开发平台组 + * @version V3.3.0 flowable + * @copyright 引迈信息技术有限公司 + * @date 2022/6/15 17:37 + */ +@Component +@Slf4j +@DependsOn("threadPoolTaskExecutor") +public class ScheduleJobUtil { + /** + * 缓存key + */ + public static final String WORKTIMEOUT_REDIS_KEY = "idgenerator_Schedule"; + + @Autowired + private RedisUtil redisUtil; + @Autowired + private ConfigValueUtil configValueUtil; + + private ScheduledThreadPoolExecutor scheduledThreadPoolExecutor; + + ScheduleJobUtil(ThreadPoolTaskExecutor threadPoolTaskExecutor) { + scheduledThreadPoolExecutor = new ScheduledThreadPoolExecutor(2, threadPoolTaskExecutor.getThreadPoolExecutor().getThreadFactory()); + } + + /** + * 将数据放入缓存 + * + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2022/6/2 + */ + public void insertRedis(List scheduleJobList, RedisUtil redisUtil) { + for (ScheduleJobModel jobModel : scheduleJobList) { + String id = jobModel.getId(); + String objectToString = JsonUtil.getObjectToString(jobModel); + redisUtil.insertHash(WORKTIMEOUT_REDIS_KEY, id, objectToString); + } + } + + /** + * 定时器取用数据调用创建方法 + * + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2022/6/2 + */ + public List getListRedis(RedisUtil redisUtil) { + List scheduleJobList = new ArrayList<>(); + if (redisUtil.exists(WORKTIMEOUT_REDIS_KEY)) { + Map map = redisUtil.getMap(WORKTIMEOUT_REDIS_KEY); + for (String object : map.keySet()) { + if (map.get(object) instanceof String) { + ScheduleJobModel scheduleJobModel = JsonUtil.getJsonToBean(String.valueOf(map.get(object)), ScheduleJobModel.class); + if(StringUtil.isNotEmpty(scheduleJobModel.getId())) { + scheduleJobList.add(scheduleJobModel); + }else { + redisUtil.removeHash(WORKTIMEOUT_REDIS_KEY,object); + } + }else { + redisUtil.removeHash(WORKTIMEOUT_REDIS_KEY,object); + } + } + } + return scheduleJobList; + } + + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/visualUtil/ChooseFiledTypeUtil.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/visualUtil/ChooseFiledTypeUtil.java new file mode 100644 index 0000000..cc08e59 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/visualUtil/ChooseFiledTypeUtil.java @@ -0,0 +1,41 @@ +package jnpf.base.util.visualUtil; + +import jnpf.util.visiual.JnpfKeyConsts; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.4 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2022/5/9 + */ +public class ChooseFiledTypeUtil { + + /** + * 根据 控件字段返回 所需字段类型 + * @param jnpfKey + * @return + */ + public static String getTypeByJnpfKey(String jnpfKey){ + String type = "varchar"; + switch (jnpfKey) { + case JnpfKeyConsts.TIME: + case JnpfKeyConsts.DATE: + case JnpfKeyConsts.CREATETIME: + case JnpfKeyConsts.MODIFYTIME: + type = "datetime"; + break; + case JnpfKeyConsts.NUM_INPUT: + case JnpfKeyConsts.CALCULATE: + type = "double"; + break; + case JnpfKeyConsts.EDITOR: + + type = "text"; + break; + } + return type; + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/visualUtil/PubulishUtil.java b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/visualUtil/PubulishUtil.java new file mode 100644 index 0000000..d0c7bfa --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-biz/src/main/java/jnpf/base/util/visualUtil/PubulishUtil.java @@ -0,0 +1,580 @@ +package jnpf.base.util.visualUtil; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import jnpf.base.UserInfo; +import jnpf.base.entity.*; +import jnpf.base.model.module.PropertyJsonModel; +import jnpf.base.model.online.AuthFlieds; +import jnpf.base.model.online.PerColModels; +import jnpf.base.model.online.VisualMenuModel; +import jnpf.base.service.*; +import jnpf.emnus.SearchMethodEnum; +import jnpf.permission.model.authorize.ConditionModel; +import jnpf.util.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 功能发布 + * + * @author JNPF开发平台组 + * @version V3.4 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2022/4/7 + */ +@Component +public class PubulishUtil { + @Autowired + private UserProvider userProvider; + @Autowired + private ModuleService moduleService; + @Autowired + private ModuleButtonService moduleButtonService; + @Autowired + private ModuleColumnService moduleColumnService; + @Autowired + private ModuleFormService moduleFormService; + @Autowired + private ModuleDataAuthorizeService moduleDataAuthorizeService; + @Autowired + private ModuleDataAuthorizeSchemeService moduleDataAuthorizeSchemeService; + + /** + * 功能类型 + */ + private final static Integer Type = 3; + + /** + * pc父级菜单 默认 + */ + private static final String pcCate = "功能示例"; + + + /** + * app父级菜单 默认 + */ + private static final String appCate = "移动应用"; + + /** + * pc端分类 + */ + private static final String pcCategory = "Web"; + + /** + * app端分类 + */ + private static final String appCategory = "App"; + + /** + * pc父级菜单id 默认 + */ + private String parentId; + + /** + * app父级菜单id + */ + private String appParentId; + + /** + * 图标 + */ + private final static String icon = "icon-ym icon-ym-webForm"; + + private final static List symbol = new ArrayList() {{ + add("@userId"); + add("@organizeId"); + }}; + + public Integer publishMenu(VisualMenuModel visualMenuModel) { + UserInfo userInfo = userProvider.get(); + + List moduleList = moduleService.getModuleList(visualMenuModel.getId()); + + ModuleEntity moduleEntity = new ModuleEntity(); + String uuid = RandomUtil.uuId(); + String appUuid = RandomUtil.uuId(); + + PerColModels pcPerCols = visualMenuModel.getPcPerCols() != null ? visualMenuModel.getPcPerCols() : new PerColModels(); + PerColModels appPerCols = visualMenuModel.getAppPerCols() != null ? visualMenuModel.getAppPerCols() : new PerColModels(); + + moduleEntity.setCategory(pcCategory); + + moduleEntity.setFullName(visualMenuModel.getFullName()); + moduleEntity.setEnCode(visualMenuModel.getEncode()); + moduleEntity.setIcon(icon); + moduleEntity.setType(visualMenuModel.getType()); + moduleEntity.setModuleId(visualMenuModel.getId()); + PropertyJsonModel jsonModel = new PropertyJsonModel(); + jsonModel.setModuleId(visualMenuModel.getId()); + jsonModel.setIconBackgroundColor(""); + jsonModel.setIsTree(0); + moduleEntity.setPropertyJson(JsonUtil.getObjectToString(jsonModel)); + moduleEntity.setSortCode((999L)); + moduleEntity.setEnabledMark(1); + moduleEntity.setIsButtonAuthorize(1); + moduleEntity.setIsColumnAuthorize(1); + moduleEntity.setIsDataAuthorize(1); + moduleEntity.setIsFormAuthorize(1); + moduleEntity.setCreatorTime(DateUtil.getNowDate()); + moduleEntity.setCreatorUserId(userInfo.getUserId()); + moduleEntity.setId(uuid); + String address = Objects.equals(visualMenuModel.getType(), 8) ? "portal" : "model"; + moduleEntity.setUrlAddress(address + "/" + visualMenuModel.getEncode()); + + boolean menu = false; + + if (1 == visualMenuModel.getPc()) { + List pcModuleList = moduleList.stream().filter(module -> pcCategory.equals(module.getCategory())).collect(Collectors.toList()); + //是否生成过菜单 + if (pcModuleList.size() > 0) { + for (ModuleEntity entity : pcModuleList) { + String menuId = entity.getId(); + //变更权限 + if (pcPerCols != null) alterPer(entity, pcPerCols); + moduleEntity.setParentId(entity.getParentId()); + moduleEntity.setSystemId(entity.getSystemId()); + moduleEntity.setId(menuId); + moduleEntity.setSortCode(entity.getSortCode()); + moduleEntity.setIcon(entity.getIcon()); + //更新菜单 + menu = moduleService.update(entity.getId(), moduleEntity); + } + } else { + //创建菜单 + moduleEntity.setParentId(visualMenuModel.getPcModuleParentId()); + moduleEntity.setSystemId(visualMenuModel.getPcSystemId()); + if (StringUtil.isEmpty(moduleEntity.getParentId())) { + return 3; + } + menu = this.createMenu(moduleEntity); + + if (pcPerCols != null) batchCreatePermissions(pcPerCols, uuid); + } + if (!menu) { + return 2; + } + } + moduleEntity.setCategory(appCategory); + moduleEntity.setId(appUuid); + String portalAddress = Objects.equals(visualMenuModel.getType(), 8) ? "visualPortal" : "dynamicModel"; + moduleEntity.setUrlAddress("/pages/apply/" + portalAddress + "/index?id=" + visualMenuModel.getId()); + moduleEntity.setEnCode(visualMenuModel.getEncode()); + if (1 == visualMenuModel.getApp()) { + List appModuleList = moduleList.stream().filter(module -> appCategory.equals(module.getCategory())).collect(Collectors.toList()); + if (appModuleList.size() > 0) { + for (ModuleEntity entity : appModuleList) { + String menuId = entity.getId(); + //变更权限 + if (appPerCols != null) alterPer(entity, appPerCols); + moduleEntity.setParentId(entity.getParentId()); + moduleEntity.setSystemId(entity.getSystemId()); + moduleEntity.setId(menuId); + moduleEntity.setSortCode(entity.getSortCode()); + moduleEntity.setIcon(entity.getIcon()); + //更新菜单 + menu = moduleService.update(entity.getId(), moduleEntity); + } + } else { + moduleEntity.setParentId(visualMenuModel.getAppModuleParentId()); + moduleEntity.setSystemId(visualMenuModel.getAppSystemId()); + if (StringUtil.isEmpty(moduleEntity.getParentId())) { + return 3; + } + menu = this.createMenu(moduleEntity); + if (appPerCols != null) batchCreatePermissions(appPerCols, appUuid); + } + + if (!menu) { + //创建失败,编码或名称是否重复 + return 2; + } + } + return 1;//同步成功 + } + + /** + * 创建菜单验证 + * + * @param moduleEntity + * @return + */ + private boolean createMenu(ModuleEntity moduleEntity) { + if (moduleService.isExistByFullName(moduleEntity, moduleEntity.getCategory(), moduleEntity.getSystemId())) { + return false; + } + if (moduleService.isExistByEnCode(moduleEntity, moduleEntity.getCategory(), moduleEntity.getSystemId())) { + return false; + } + moduleService.save(moduleEntity); + return true; + } + + private void batchCreatePermissions(PerColModels perColModels, String moduleId) { + + List buttonPermission = Objects.nonNull(perColModels.getButtonPermission()) ? perColModels.getButtonPermission() : new ArrayList<>(); + List formPermission = Objects.nonNull(perColModels.getFormPermission()) ? perColModels.getFormPermission() : new ArrayList<>(); + List listPermission = Objects.nonNull(perColModels.getListPermission()) ? perColModels.getListPermission() : new ArrayList<>(); + List dataPermission = Objects.nonNull(perColModels.getDataPermission()) ? perColModels.getDataPermission() : new ArrayList<>(); + List dataPermissionScheme = Objects.nonNull(perColModels.getDataPermissionScheme()) ? perColModels.getDataPermissionScheme() : new ArrayList<>(); + + //按钮 + List buttonEntities = buttonPermission.stream().map(button -> { + ModuleButtonEntity buttonEntity = new ModuleButtonEntity(); + buttonEntity.setEnabledMark(button.getStatus() ? 1 : 0); + buttonEntity.setEnCode(button.getEncode()); + buttonEntity.setFullName(button.getFullName()); + buttonEntity.setParentId("-1"); + buttonEntity.setModuleId(moduleId); + buttonEntity.setSortCode(0L); + return buttonEntity; + }).collect(Collectors.toList()); + + //表单权限 + List moduleFormEntities = formPermission.stream().map(form -> { + ModuleFormEntity formEntity = new ModuleFormEntity(); + formEntity.setBindTable(form.getBindTableName()); + formEntity.setEnabledMark(form.getStatus() ? 1 : 0); + formEntity.setEnCode(form.getEncode()); + formEntity.setFullName(form.getFullName()); + formEntity.setParentId("-1"); + formEntity.setModuleId(moduleId); + formEntity.setFieldRule(form.getRule()); + formEntity.setChildTableKey(form.getChildTableKey()); + formEntity.setSortCode(0L); + return formEntity; + }).collect(Collectors.toList()); + + //列表 + List moduleColumnEntities = listPermission.stream().map(list -> { + ModuleColumnEntity moduleColumnEntity = new ModuleColumnEntity(); + moduleColumnEntity.setBindTable(list.getBindTableName()); + moduleColumnEntity.setEnabledMark(list.getStatus() ? 1 : 0); + moduleColumnEntity.setEnCode(list.getEncode()); + moduleColumnEntity.setFullName(list.getFullName()); + moduleColumnEntity.setParentId("-1"); + moduleColumnEntity.setModuleId(moduleId); + moduleColumnEntity.setSortCode(0L); + moduleColumnEntity.setChildTableKey(list.getChildTableKey()); + moduleColumnEntity.setFieldRule(list.getRule()); + return moduleColumnEntity; + }).collect(Collectors.toList()); + + List moduleDataEntities = new ArrayList<>(); + + + //数据权限 + for (AuthFlieds authFlieds : dataPermission) { + ModuleDataAuthorizeEntity authorizeEntity = new ModuleDataAuthorizeEntity(); + authorizeEntity.setBindTable(authFlieds.getBindTableName()); + authorizeEntity.setConditionSymbol(symbol.contains(authFlieds.getAuthCondition()) ? SearchMethodEnum.Equal.getSymbol() : SearchMethodEnum.Included.getSymbol()); + authorizeEntity.setId(authFlieds.getId()); + authorizeEntity.setDescription("同步菜单自动生成"); + authorizeEntity.setEnCode(authFlieds.getEncode()); + authorizeEntity.setFieldRule(authFlieds.getRule()); + authorizeEntity.setFullName(authFlieds.getFullName()); + authorizeEntity.setModuleId(moduleId); + authorizeEntity.setType("varchar"); + authorizeEntity.setConditionText(authFlieds.getAuthCondition()); + authorizeEntity.setEnabledMark(1); + authorizeEntity.setSortCode(-9527l); + moduleDataEntities.add(authorizeEntity); + } + + for (ModuleButtonEntity btn : buttonEntities) { + moduleButtonService.create(btn); + } + for (ModuleFormEntity formEntity : moduleFormEntities) { + moduleFormService.create(formEntity); + } + for (ModuleColumnEntity moduleColumnEntity : moduleColumnEntities) { + moduleColumnService.create(moduleColumnEntity); + } + for (ModuleDataAuthorizeEntity authorizeEntity : moduleDataEntities) { + moduleDataAuthorizeService.save(authorizeEntity); + } + + //方案 + for (ModuleDataAuthorizeSchemeEntity moduleDataAuthorizeEntity : dataPermissionScheme) { + moduleDataAuthorizeEntity.setModuleId(moduleId); + + //字段是数据库现有字段,那生成的方案里面的id必须是字段id + List dataAuthorizeEntityList = moduleDataAuthorizeService.getList(moduleId); + for (ModuleDataAuthorizeEntity auth : dataAuthorizeEntityList) { + if (moduleDataAuthorizeEntity.getDescription().equals(auth.getFieldRule() + "_" + auth.getEnCode() + "_" + auth.getConditionSymbol()) + && Objects.equals(-9527l, moduleDataAuthorizeEntity.getSortCode())) { + String conditionJson = moduleDataAuthorizeEntity.getConditionJson(); + List listc = JsonUtil.getJsonToList(conditionJson, ConditionModel.class); + ConditionModel.ConditionItemModel conditionItemModel = listc.get(0).getGroups().get(0); + conditionItemModel.setId(auth.getId()); + moduleDataAuthorizeEntity.setConditionJson(JsonUtil.getObjectToString(listc)); + } + } + moduleDataAuthorizeSchemeService.save(moduleDataAuthorizeEntity); + } + + //创建全部数据方案 + if (Objects.nonNull(perColModels.getDataPermission())) { + Boolean exist = moduleDataAuthorizeSchemeService.isExistAllData(moduleId); + if (!exist) { + ModuleDataAuthorizeSchemeEntity moduleDataAuthorizeSchemeEntity = new ModuleDataAuthorizeSchemeEntity(); + moduleDataAuthorizeSchemeEntity.setFullName("全部数据"); + moduleDataAuthorizeSchemeEntity.setEnCode("jnpf_alldata"); + moduleDataAuthorizeSchemeEntity.setAllData(1); + moduleDataAuthorizeSchemeEntity.setModuleId(moduleId); + moduleDataAuthorizeSchemeService.create(moduleDataAuthorizeSchemeEntity); + } + } + } + + private void getModuleParentId() { + QueryWrapper moduleWrapper = new QueryWrapper<>(); + moduleWrapper.lambda().eq(ModuleEntity::getFullName, pcCate).eq(ModuleEntity::getCategory, pcCategory); + ModuleEntity pcModule = moduleService.getOne(moduleWrapper); + if (pcModule != null) { + this.setParentId(pcModule.getId()); + } + QueryWrapper appWrapper = new QueryWrapper<>(); + appWrapper.lambda().eq(ModuleEntity::getFullName, appCate).eq(ModuleEntity::getCategory, appCategory); + ModuleEntity appModule = moduleService.getOne(appWrapper); + if (appModule != null) { + this.setAppParentId(appModule.getId()); + } + } + + /** + * 自动变更权限 + * + * @param entity + * @param perColModel + * @return + */ + private void alterPer(ModuleEntity entity, PerColModels perColModel) { + String moduleMainId = entity.getId(); + + PerColModels perColModels = new PerColModels(); + //列表 + if (perColModel.getListPermission() != null) { + Map colMap = new HashMap<>(); + List columnEntities = moduleColumnService.getList(moduleMainId); + columnEntities.stream().forEach(col -> colMap.put(col.getEnCode(), col.getId())); + List listPermission = perColModel.getListPermission() != null ? perColModel.getListPermission() : new ArrayList<>(); + + //只变更状态 + List authColList = intersectList1(listPermission, colMap); + Map stateMap = new HashMap<>(); + authColList.stream().forEach(auth -> stateMap.put(auth.getEncode(), auth.getStatus())); + for (ModuleColumnEntity columnEntity : columnEntities) { + if (Objects.nonNull(stateMap.get(columnEntity.getEnCode()))) { + columnEntity.setEnabledMark(stateMap.get(columnEntity.getEnCode()) ? 1 : 0); + moduleColumnService.update(columnEntity.getId(), columnEntity); + } + } + //新增 + List authColCreList = intersectList2(listPermission, authColList); + perColModels.setListPermission(authColCreList); + //删除 +// Map colDataMap = intersectList3(colMap, authColList); +// List colEnties = columnEntities.stream().filter(col -> colDataMap.get(col.getEnCode()) != null).collect(Collectors.toList()); +// for (ModuleColumnEntity moduleColumnEntity : colEnties) { +// moduleColumnService.delete(moduleColumnEntity); +// } + } + + //表单 + if (perColModel.getFormPermission() != null) { + Map formMap = new HashMap<>(); + List formEntities = moduleFormService.getList(moduleMainId); + formEntities.stream().forEach(form -> formMap.put(form.getEnCode(), form.getId())); + List formPermission = perColModel.getFormPermission() != null ? perColModel.getFormPermission() : new ArrayList<>(); + List authFormList = intersectList1(formPermission, formMap); + + Map stateFMap = new HashMap<>(); + authFormList.stream().forEach(auth -> stateFMap.put(auth.getEncode(), auth.getStatus())); + for (ModuleFormEntity formEntity : formEntities) { + if (Objects.nonNull(stateFMap.get(formEntity.getEnCode()))) { + formEntity.setEnabledMark(stateFMap.get(formEntity.getEnCode()) ? 1 : 0); + moduleFormService.update(formEntity.getId(), formEntity); + } + } + + List authFormCreList = intersectList2(formPermission, authFormList); + perColModels.setFormPermission(authFormCreList); +// Map formDataMap = intersectList3(formMap, authFormList); +// List formEnties = formEntities.stream().filter(form -> formDataMap.get(form.getEnCode()) != null).collect(Collectors.toList()); +// for (ModuleFormEntity formEntity : formEnties) { +// moduleFormService.delete(formEntity); +// } + } + //按钮权限 + if (perColModel.getButtonPermission() != null) { + Map btnMap = new HashMap<>(); + List buttonEntities = moduleButtonService.getList(moduleMainId); + buttonEntities.stream().forEach(btn -> btnMap.put(btn.getEnCode(), btn.getId())); + List buttonPermission = perColModel.getButtonPermission() != null ? perColModel.getButtonPermission() : new ArrayList<>(); + List authBtnList = intersectList1(buttonPermission, btnMap); + Map stateBMap = new HashMap<>(); + + authBtnList.stream().forEach(auth -> stateBMap.put(auth.getEncode(), auth.getStatus())); + for (ModuleButtonEntity btnEntity : buttonEntities) { + if (Objects.nonNull(stateBMap.get(btnEntity.getEnCode()))) { + btnEntity.setEnabledMark(stateBMap.get(btnEntity.getEnCode()) ? 1 : 0); + moduleButtonService.update(btnEntity.getId(), btnEntity); + } + } + + List authBtnCreList = intersectList2(buttonPermission, authBtnList); +// Map btnDataMap = intersectList3(btnMap, authBtnList); +// List btnEnties = buttonEntities.stream().filter(btn -> btnDataMap.get(btn.getEnCode()) != null).collect(Collectors.toList()); +// for (ModuleButtonEntity buttonEntity : btnEnties) { +// moduleButtonService.delete(buttonEntity); +// } + + perColModels.setButtonPermission(authBtnCreList); + } + //表单权限字段 + if (perColModel.getDataPermission() != null) { + List dataAuthorizeEntityList = moduleDataAuthorizeService.getList(moduleMainId); + List dataPermission = perColModel.getDataPermission() != null ? perColModel.getDataPermission() : new ArrayList<>(); + List dataPermissionList = new ArrayList<>(dataPermission); + //交集 + List authDataList = new ArrayList<>(); + for (AuthFlieds authFlieds : dataPermission) { + for (ModuleDataAuthorizeEntity authorizeEntity : dataAuthorizeEntityList) { + String conditions = symbol.contains(authFlieds.getAuthCondition()) ? SearchMethodEnum.Equal.getSymbol() : SearchMethodEnum.Included.getSymbol(); + if (authorizeEntity.getConditionText().equalsIgnoreCase(authFlieds.getAuthCondition()) + && authorizeEntity.getConditionSymbol().equalsIgnoreCase(conditions) + && authorizeEntity.getEnCode().equalsIgnoreCase(authFlieds.getEncode())) { + authDataList.add(authFlieds); + } + } + } + List authDataCreList = intersectList2(dataPermission, authDataList); + //需要删除 + List collect = dataPermissionList.stream().map(AuthFlieds::getEncode).collect(Collectors.toList()); + List dataEntities = new ArrayList<>(); + if (dataAuthorizeEntityList.size() > 0) { + for (ModuleDataAuthorizeEntity item : dataAuthorizeEntityList) { + if (!collect.contains(item.getEnCode()) && Objects.equals(-9527l, item.getSortCode())) { + if((symbol.contains(item.getConditionText()) && SearchMethodEnum.Equal.getSymbol().equals(item.getConditionSymbol())) + ||(!symbol.contains(item.getConditionText()) && SearchMethodEnum.Included.getSymbol().equals(item.getConditionSymbol()))){ + //需要移除的权限 + dataEntities.add(item); + } + } + } + } + for (ModuleDataAuthorizeEntity dataEntity : dataEntities) { + moduleDataAuthorizeService.delete(dataEntity); + } + perColModels.setDataPermission(authDataCreList); + } + //表单权限方案 + if (perColModel.getDataPermissionScheme() != null) { + //交集 + List togetherList = new ArrayList<>(); + List dataAuthorizeSchemeList = moduleDataAuthorizeSchemeService.getList(moduleMainId); + List dataPermissionScheme = perColModel.getDataPermissionScheme(); + List dataPermissionSchemeClone = new ArrayList<>(dataPermissionScheme); + + for (ModuleDataAuthorizeSchemeEntity authFlieds : dataPermissionScheme) { + for (ModuleDataAuthorizeSchemeEntity schemeEntity : dataAuthorizeSchemeList) { + if (schemeEntity.getConditionJson() == null) { + continue; + } + if (Objects.equals(-9527l, schemeEntity.getSortCode()) && schemeEntity.getConditionText().contains(authFlieds.getConditionText())) { + togetherList.add(authFlieds); + } + } + } + + //需要新增 dataPermissionScheme + dataPermissionScheme.removeAll(togetherList); + + //需要删除 + List collect = dataPermissionSchemeClone.stream().map(ModuleDataAuthorizeSchemeEntity::getDescription).collect(Collectors.toList()); + List deleteSchemeList = new ArrayList<>(); + if (dataAuthorizeSchemeList.size() > 0) { + for (ModuleDataAuthorizeSchemeEntity item : dataAuthorizeSchemeList) { + if (!collect.contains(item.getDescription()) && Objects.equals(-9527l, item.getSortCode())) { + //需要移除的权限方案 + deleteSchemeList.add(item); + } + } + } + + for (ModuleDataAuthorizeSchemeEntity scheme : deleteSchemeList) { + moduleDataAuthorizeSchemeService.delete(scheme); + } + ; + perColModels.setDataPermissionScheme(new ArrayList<>(dataPermissionScheme)); + } + + //新增的权限 + batchCreatePermissions(perColModels, moduleMainId); + + } + + + /** + * 取交集 (不需要变动的数据) + * + * @param authFlieds 新提交过来的 + * @param databaseMap 数据库存在数据 + * @return + */ + private List intersectList1(List authFlieds, Map databaseMap) { + List lastList = new LinkedList<>(); + for (AuthFlieds authFlied : authFlieds) { + if (databaseMap.containsKey(authFlied.getEncode())) { + lastList.add(authFlied); + } + } + return lastList; + } + + /** + * 求差集 (需要新增的数据) create + * + * @param auth1 新提交过来的 + * @param auth2 与数据库的交集 + * @return + */ + private List intersectList2(List auth1, List auth2) { + auth1.removeAll(auth2); + return auth1; + } + + /** + * 求差集 (需要变更的数据) delete + * + * @param databaseMap 数据库已存在的数据 + * @param auth2 与数据库的交集 + * @return + */ + private Map intersectList3(Map databaseMap, List auth2) { + Map changeMap = new HashMap<>(); + changeMap.putAll(databaseMap); + for (AuthFlieds authFlieds : auth2) { + if (databaseMap.get(authFlieds.getEncode()) != null) { + changeMap.remove(authFlieds.getEncode()); + } + } + return changeMap; + } + + public void setParentId(String parentId) { + this.parentId = parentId; + } + + public void setAppParentId(String appParentId) { + this.appParentId = appParentId; + } + + + public void publishPortalMenu(VisualMenuModel visualMenuModel) { + + } +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-controller/pom.xml b/jnpf-java-boot/jnpf-system/jnpf-system-controller/pom.xml new file mode 100644 index 0000000..cb5e3cc --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-controller/pom.xml @@ -0,0 +1,27 @@ + + + + jnpf-system + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-system-controller + + + + com.jnpf + jnpf-system-biz + ${project.version} + + + com.jnpf + jnpf-visualdev-base-entity + ${project.version} + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/AdvancedQueryController.java b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/AdvancedQueryController.java new file mode 100644 index 0000000..848b84b --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/AdvancedQueryController.java @@ -0,0 +1,140 @@ +package jnpf.base.controller; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import jnpf.base.controller.SuperController; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.UserInfo; +import jnpf.base.entity.AdvancedQueryEntity; +import jnpf.base.model.advancedquery.AdvancedQueryListVO; +import jnpf.base.model.advancedquery.AdvancedQuerySchemeForm; +import jnpf.base.service.AdvancedQueryService; +import jnpf.base.vo.ListVO; +import jnpf.constant.MsgCode; +import jnpf.exception.DataException; +import jnpf.util.JsonUtil; +import jnpf.util.JsonUtilEx; +import jnpf.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; + +/** + * 高级查询方案管理 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2022/5/30 + */ +@Tag(name = "高级查询方案管理", description = "AdvancedQuery") +@RestController +@RequestMapping("/api/system/AdvancedQuery") +public class AdvancedQueryController extends SuperController { + + @Autowired + private AdvancedQueryService queryService; + @Autowired + private UserProvider userProvider; + + /** + * 新建 + * + * @param advancedQuerySchemeForm 实体对象 + * @return + */ + @Operation(summary = "新建方案") + @Parameters({ + @Parameter(name = "advancedQuerySchemeForm", description = "实体对象", required = true) + }) + @PostMapping + public ActionResult create(@RequestBody @Valid AdvancedQuerySchemeForm advancedQuerySchemeForm) { + AdvancedQueryEntity entity = JsonUtil.getJsonToBean(advancedQuerySchemeForm, AdvancedQueryEntity.class); + queryService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 修改方案 + * + * @param id 主键 + * @param advancedQuerySchemeForm 实体对象 + * @return + */ + @Operation(summary = "修改方案") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "advancedQuerySchemeForm", description = "实体对象", required = true) + }) + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid AdvancedQuerySchemeForm advancedQuerySchemeForm) { + AdvancedQueryEntity entity = JsonUtil.getJsonToBean(advancedQuerySchemeForm, AdvancedQueryEntity.class); + entity.setId(id); + queryService.updateById(entity); + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除 + * + * @param id 主键值 + * @return ignore + */ + @Operation(summary = "删除方案") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + UserInfo userInfo = userProvider.get(); + AdvancedQueryEntity entity = queryService.getInfo(id,userInfo.getUserId()); + if (entity != null) { + queryService.removeById(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + /** + * 列表 + * + * @param moduleId 功能主键 + * @return ignore + */ + @Operation(summary = "方案列表") + @Parameters({ + @Parameter(name = "moduleId", description = "功能主键", required = true) + }) + @GetMapping("/{moduleId}/List") + public ActionResult> list(@PathVariable("moduleId") String moduleId) { + UserInfo userInfo = userProvider.get(); + List data = queryService.getList(moduleId,userInfo); + List list = JsonUtil.getJsonToList(data, AdvancedQueryListVO.class); + ListVO vo = new ListVO<>(); + vo.setList(list); + return ActionResult.success(vo); + } + /** + * 信息 + * + * @param id 主键值 + * @return ignore + * @throws DataException ignore + */ + @Operation(summary = "获取方案信息") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) throws DataException { + UserInfo userInfo = userProvider.get(); + AdvancedQueryEntity entity = queryService.getInfo(id,userInfo.getUserId()); + AdvancedQuerySchemeForm vo = JsonUtilEx.getJsonToBeanEx(entity, AdvancedQuerySchemeForm.class); + return ActionResult.success(vo); + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/AreaController.java b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/AreaController.java new file mode 100644 index 0000000..2916466 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/AreaController.java @@ -0,0 +1,285 @@ +package jnpf.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.Page; +import jnpf.base.service.ProvinceService; +import jnpf.base.vo.ListVO; +import jnpf.base.entity.ProvinceEntity; +import jnpf.constant.MsgCode; +import jnpf.exception.DataException; +import jnpf.base.model.province.*; +import jnpf.util.JsonUtil; +import jnpf.util.JsonUtilEx; +import jnpf.util.StringUtil; +import jnpf.util.treeutil.ListToTreeUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 行政区划 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Tag(name = "行政区划", description = "Area") +@RestController +@RequestMapping("/api/system/Area") +public class AreaController extends SuperController { + + @Autowired + private ProvinceService provinceService; + + /** + * 列表(异步加载) + * + * @param nodeId 节点主键 + * @param page 关键字 + * @return + */ + @Operation(summary = "列表(异步加载)") + @Parameters({ + @Parameter(name = "nodeId", description = "节点主键", required = true) + }) + @SaCheckPermission("system.area") + @GetMapping("/{nodeId}") + public ActionResult> list(@PathVariable("nodeId") String nodeId, Page page) { + List data = provinceService.getList(nodeId, page); + List dataAll = data; + List result = JsonUtil.getJsonToList(ListToTreeUtil.treeWhere(data, dataAll), ProvinceEntity.class); + List treeList = JsonUtil.getJsonToList(result, ProvinceListVO.class); + int i = 0; + for (ProvinceListVO entity : treeList) { + boolean childNode = provinceService.getList(entity.getId()).size() <= 0; + ProvinceListVO provinceListVO = JsonUtil.getJsonToBean(entity, ProvinceListVO.class); + provinceListVO.setIsLeaf(childNode); + provinceListVO.setHasChildren(!childNode); + treeList.set(i, provinceListVO); + i++; + } + ListVO vo = new ListVO<>(); + vo.setList(treeList); + return ActionResult.success(vo); + } + + /** + * 获取行政区划下拉框数据 + * + * @param id 主键 + * @param ids 主键集合 + * @return + */ + @Operation(summary = "获取行政区划下拉框数据") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "ids", description = "主键集合", required = true) + }) + @GetMapping("/{id}/Selector/{ids}") + public ActionResult> selectList(@PathVariable("id") String id, @PathVariable("ids") String ids) { + List data = provinceService.getList(id); + data = data.stream().filter(t -> t.getEnabledMark() == 1).collect(Collectors.toList()); + if (!"0".equals(ids)) { + //排除子集 + filterData(data, new ArrayList<>(Arrays.asList(new String[]{ids}))); + } + List treeList = JsonUtil.getJsonToList(data, ProvinceSelectListVO.class); + int i = 0; + for (ProvinceSelectListVO entity : treeList) { +// boolean childNode = provinceService.getList(entity.getId()).size() <= 0; + ProvinceSelectListVO provinceListVO = JsonUtil.getJsonToBean(entity, ProvinceSelectListVO.class); + provinceListVO.setIsLeaf(false); + treeList.set(i, provinceListVO); + i++; + } + ListVO vo = new ListVO<>(); + vo.setList(treeList); + return ActionResult.success(vo); + } + + /** + * 递归排除子集 + * + * @param data 普通列表 + * @param id ignore + */ + private void filterData(List data, List id) { + List collect = null; + //获取子集信息 + for (String ids : id) { + collect = data.stream().filter(t -> ids.equals(t.getParentId())).collect(Collectors.toList()); + data.removeAll(collect); + } + //递归移除子集的子集 + if(collect != null){ + if (collect.size() > 0) { + filterData(data, collect.stream().map(t -> t.getId()).collect(Collectors.toList())); + } + } + } + + /** + * 信息 + * + * @param id 主键值 + * @return ignore + */ + @Operation(summary = "获取行政区划信息") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("system.area") + @GetMapping("/{id}/Info") + public ActionResult info(@PathVariable("id") String id) throws DataException { + ProvinceEntity entity = provinceService.getInfo(id); + ProvinceInfoVO vo = JsonUtilEx.getJsonToBeanEx(entity, ProvinceInfoVO.class); + if (!"-1".equals(entity.getParentId())) { + ProvinceEntity parent = provinceService.getInfo(entity.getParentId()); + vo.setParentName(parent.getFullName()); + } + return ActionResult.success(vo); + } + + /** + * 新建 + * + * @param provinceCrForm 实体对象 + * @return ignore + */ + @Operation(summary = "添加行政区划") + @Parameters({ + @Parameter(name = "provinceCrForm", description = "实体对象", required = true) + }) + @SaCheckPermission("system.area") + @PostMapping + public ActionResult create(@RequestBody @Valid ProvinceCrForm provinceCrForm) { + ProvinceEntity entity = JsonUtil.getJsonToBean(provinceCrForm, ProvinceEntity.class); + if (provinceService.isExistByEnCode(provinceCrForm.getEnCode(), entity.getId())) { + return ActionResult.fail("区域编码不能重复"); + } + if (StringUtil.isEmpty(provinceCrForm.getParentId())) { + entity.setParentId("-1"); + } + if (entity.getParentId().equals("-1")) { + entity.setType("1"); + } else { + ProvinceEntity info = provinceService.getInfo(entity.getParentId()); + int type = info!=null? Integer.valueOf(info.getType()) + 1 : 1; + entity.setType(String.valueOf(type)); + } + provinceService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 更新 + * + * @param id 主键值 + * @param provinceUpForm ignore + * @return ignore + */ + @Operation(summary = "修改行政区划") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true), + @Parameter(name = "provinceUpForm", description = "实体对象", required = true) + }) + @SaCheckPermission("system.area") + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid ProvinceUpForm provinceUpForm) { + ProvinceEntity entity = JsonUtil.getJsonToBean(provinceUpForm, ProvinceEntity.class); + if (provinceService.isExistByEnCode(provinceUpForm.getEnCode(), id)) { + return ActionResult.fail("区域编码不能重复"); + } + boolean flag = provinceService.update(id, entity); + if (!flag) { + return ActionResult.fail(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除 + * + * @param id 主键值 + * @return ignore + */ + @Operation(summary = "删除") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("system.area") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + if (provinceService.getList(id).size() == 0) { + ProvinceEntity entity = provinceService.getInfo(id); + if (entity != null) { + provinceService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } else { + return ActionResult.fail("删除失败,当前有子节点数据"); + } + } + + /** + * 更新行政区划状态 + * + * @param id 主键值 + * @return ignore + */ + @Operation(summary = "更新行政区划状态") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("system.area") + @PutMapping("/{id}/Actions/State") + public ActionResult upState(@PathVariable("id") String id) { + ProvinceEntity entity = provinceService.getInfo(id); + if (entity.getEnabledMark() == null || "1".equals(String.valueOf(entity.getEnabledMark()))) { + entity.setEnabledMark(0); + } else { + entity.setEnabledMark(1); + } + boolean flag = provinceService.update(id, entity); + if (!flag) { + return ActionResult.fail(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 行政区划id转名称 + * + * @param model 二维数组 + * @return ignore + */ + @Operation(summary = "行政区划id转名称") + @Parameters({ + @Parameter(name = "model", description = "二维数组", required = true) + }) + @PostMapping("/GetAreaByIds") + public ActionResult getAreaByIds(@RequestBody AreaModel model) { + // 返回给前端的list + List> list = new LinkedList<>(); + for (List idList : model.getIdsList()) { + List proList = provinceService.getProList(idList); + List collect = proList.stream().map(ProvinceEntity::getFullName).collect(Collectors.toList()); + list.add(collect); + } + return ActionResult.success(list); + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/BillRuleController.java b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/BillRuleController.java new file mode 100644 index 0000000..f01e57a --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/BillRuleController.java @@ -0,0 +1,304 @@ +package jnpf.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.annotation.HandleLog; +import jnpf.base.ActionResult; +import jnpf.base.model.billrule.*; +import jnpf.base.service.DictionaryDataService; +import jnpf.base.vo.DownloadVO; +import jnpf.base.vo.PageListVO; +import jnpf.base.vo.PaginationVO; +import jnpf.base.service.BillRuleService; +import jnpf.base.entity.BillRuleEntity; +import jnpf.config.ConfigValueUtil; +import jnpf.constant.MsgCode; +import jnpf.exception.DataException; +import jnpf.exception.WorkFlowException; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.UserService; +import jnpf.util.*; +import jnpf.emnus.ModuleTypeEnum; +import jnpf.util.DataFileExport; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import java.util.ArrayList; +import java.util.List; + +/** + * 单据规则 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Tag(name = "单据规则", description = "BillRule") +@RestController +@RequestMapping("/api/system/BillRule") +public class BillRuleController extends SuperController { + + @Autowired + private DataFileExport fileExport; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private BillRuleService billRuleService; + @Autowired + private UserService userService; + @Autowired + private DictionaryDataService dictionaryDataService; + /** + * 列表 + * + * @param pagination 分页参数 + * @return ignore + */ + @HandleLog(moduleName = "单据规则", requestMethod = "查询") + @Operation(summary = "获取单据规则列表(带分页)") + @SaCheckPermission("system.billRule") + @GetMapping + public ActionResult> list(BillRulePagination pagination) { + List list = billRuleService.getList(pagination); + List listVO = new ArrayList<>(); + list.forEach(entity->{ + BillRuleListVO vo = JsonUtil.getJsonToBean(entity, BillRuleListVO.class); + if(StringUtil.isNotEmpty(entity.getCategory())){ + vo.setCategory(dictionaryDataService.getInfo(entity.getCategory()).getFullName()); + } + + UserEntity userEntity = userService.getInfo(entity.getCreatorUserId()); + if(userEntity != null){ + vo.setCreatorUser(userEntity.getRealName() + "/" + userEntity.getAccount()); + } + listVO.add(vo); + }); + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(listVO, paginationVO); + } + + /** + * 列表 + * + * @return ignore + */ + @HandleLog(moduleName = "单据规则", requestMethod = "查询") + @Operation(summary = "获取单据规则下拉框") + @GetMapping("/Selector") + public ActionResult selectList(BillRulePagination pagination) { + List list = billRuleService.getListByCategory(pagination.getCategoryId(),pagination); + List listVO = new ArrayList<>(); + list.forEach(entity->{ + BillRuleListVO vo = JsonUtil.getJsonToBean(entity, BillRuleListVO.class); + if(StringUtil.isNotEmpty(entity.getCategory())){ + vo.setCategory(dictionaryDataService.getInfo(entity.getCategory()).getFullName()); + } + + UserEntity userEntity = userService.getInfo(entity.getCreatorUserId()); + if(userEntity != null){ + vo.setCreatorUser(userEntity.getRealName() + "/" + userEntity.getAccount()); + } + listVO.add(vo); + }); + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(listVO, paginationVO); + } + + + /** + * 更新组织状态 + * + * @param id 主键值 + * @return ignore + */ + @HandleLog(moduleName = "单据规则", requestMethod = "修改") + @Operation(summary = "更新单据规则状态") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("system.billRule") + @PutMapping("/{id}/Actions/State") + public ActionResult update(@PathVariable("id") String id) { + BillRuleEntity entity = billRuleService.getInfo(id); + if (entity != null) { + if ("1".equals(String.valueOf(entity.getEnabledMark()))) { + entity.setEnabledMark(0); + } else { + entity.setEnabledMark(1); + } + billRuleService.update(entity.getId(), entity); + return ActionResult.success(MsgCode.SU004.get()); + } + return ActionResult.fail(MsgCode.FA002.get()); + } + + /** + * 信息 + * + * @param id 主键值 + * @return ignore + */ + @HandleLog(moduleName = "单据规则", requestMethod = "查询") + @Operation(summary = "获取单据规则信息") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("system.billRule") + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) throws DataException { + BillRuleEntity entity = billRuleService.getInfo(id); + BillRuleInfoVO vo = JsonUtilEx.getJsonToBeanEx(entity, BillRuleInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 获取单据流水号 + * + * @param enCode 参数编码 + * @return ignore + */ + @HandleLog(moduleName = "单据规则", requestMethod = "查询") + @Operation(summary = "获取单据流水号(工作流调用)") + @Parameters({ + @Parameter(name = "enCode", description = "参数编码", required = true) + }) + @GetMapping("/BillNumber/{enCode}") + public ActionResult getBillNumber(@PathVariable("enCode") String enCode) throws DataException { + String data = billRuleService.getBillNumber(enCode, false); + return ActionResult.success("获取成功", data); + } + + /** + * 新建 + * + * @param billRuleCrForm 实体对象 + * @return ignore + */ + @HandleLog(moduleName = "单据规则", requestMethod = "新增") + @Operation(summary = "添加单据规则") + @Parameters({ + @Parameter(name = "billRuleCrForm", description = "实体对象", required = true) + }) + @SaCheckPermission("system.billRule") + @PostMapping + public ActionResult create(@RequestBody @Valid BillRuleCrForm billRuleCrForm) { + + BillRuleEntity entity = JsonUtil.getJsonToBean(billRuleCrForm, BillRuleEntity.class); + if (billRuleService.isExistByFullName(entity.getFullName(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (billRuleService.isExistByEnCode(entity.getEnCode(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + billRuleService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 更新 + * + * @param billRuleUpForm 实体对象 + * @param id 主键值 + * @return ignore + */ + @HandleLog(moduleName = "单据规则", requestMethod = "修改") + @Operation(summary = "修改单据规则") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true), + @Parameter(name = "billRuleUpForm", description = "实体对象", required = true) + }) + @SaCheckPermission("system.billRule") + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody BillRuleUpForm billRuleUpForm) { + BillRuleEntity entity = JsonUtil.getJsonToBean(billRuleUpForm, BillRuleEntity.class); + if (billRuleService.isExistByFullName(entity.getFullName(), id)) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (billRuleService.isExistByEnCode(entity.getEnCode(), id)) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + boolean flag = billRuleService.update(id, entity); + if (!flag) { + return ActionResult.fail(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除 + * + * @param id 主键值 + * @return ignore + */ + @HandleLog(moduleName = "单据规则", requestMethod = "删除") + @Operation(summary = "删除单据规则") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("system.billRule") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + BillRuleEntity entity = billRuleService.getInfo(id); + if (entity != null) { + if (!StringUtil.isEmpty(entity.getOutputNumber())) { + return ActionResult.fail("单据已经被使用,不允许被删除"); + } else { + billRuleService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + /** + * 导出单据规则 + * + * @param id 打印模板id + * @return ignore + */ + @HandleLog(moduleName = "单据规则", requestMethod = "导出") + @Operation(summary = "导出") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("system.billRule") + @GetMapping("/{id}/Actions/Export") + public ActionResult export(@PathVariable String id) { + BillRuleEntity entity = billRuleService.getInfo(id); + //导出文件 + DownloadVO downloadVO = fileExport.exportFile(entity, configValueUtil.getTemporaryFilePath(), entity.getFullName(), ModuleTypeEnum.SYSTEM_BILLRULE.getTableName()); + return ActionResult.success(downloadVO); + } + + /** + * 导入单据规则 + * + * @param multipartFile 备份json文件 + * @return 执行结果标识 + */ + @HandleLog(moduleName = "单据规则", requestMethod = "导入") + @Operation(summary = "导入") + @SaCheckPermission("system.billRule") + @PostMapping(value = "/Actions/Import", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public ActionResult importData(@RequestPart("file") MultipartFile multipartFile) throws DataException { + //判断是否为.json结尾 + if (FileUtil.existsSuffix(multipartFile, ModuleTypeEnum.SYSTEM_BILLRULE.getTableName())) { + return ActionResult.fail(MsgCode.IMP002.get()); + } + try { + String fileContent = FileUtil.getFileContent(multipartFile); + BillRuleEntity entity = JsonUtil.getJsonToBean(fileContent, BillRuleEntity.class); + return billRuleService.ImportData(entity); + } catch (Exception e) { + throw new DataException("导入失败,数据有误"); + } + + } +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/CacheManageController.java b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/CacheManageController.java new file mode 100644 index 0000000..87ec0dd --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/CacheManageController.java @@ -0,0 +1,138 @@ +package jnpf.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.Page; +import jnpf.base.vo.ListVO; +import jnpf.base.model.cachemanage.CacheManageInfoVO; +import jnpf.base.model.cachemanage.CacheManageListVO; +import jnpf.util.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 缓存管理 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Tag(name = "缓存管理", description = "CacheManage") +@RestController +@RequestMapping("/api/system/CacheManage") +public class CacheManageController { + + @Autowired + private RedisUtil redisUtil; + @Autowired + private UserProvider userProvider; + + /** + * 获取缓存列表 + * + * @param page 分页参数 + * @return ignore + */ + @Operation(summary = "获取缓存列表") + @SaCheckPermission("system.cache") + @GetMapping + public ActionResult> getList(Page page) { + String tenantId = userProvider.get().getTenantId(); + List list = new ArrayList<>(); + Set data = redisUtil.getAllKeys(); + for (String key : data) { + try { + if (!StringUtil.isEmpty(tenantId) && key.contains(tenantId)) { + CacheManageListVO model = new CacheManageListVO(); + model.setName(key); + model.setCacheSize(String.valueOf(redisUtil.getString(key)).getBytes().length); + model.setOverdueTime(new Date((DateUtil.getTime(new Date()) + redisUtil.getLiveTime(key)) * 1000).getTime()); + list.add(model); + } else if (StringUtil.isEmpty(tenantId)) { + CacheManageListVO model = new CacheManageListVO(); + model.setName(key); + model.setCacheSize(String.valueOf(redisUtil.getString(key)).getBytes().length); + model.setOverdueTime(new Date((DateUtil.getTime(new Date()) + redisUtil.getLiveTime(key)) * 1000).getTime()); + list.add(model); + } + }catch (Exception e){ + } + } + list = list.stream().sorted(Comparator.comparing(CacheManageListVO::getOverdueTime)).collect(Collectors.toList()); + if (StringUtil.isNotEmpty(page.getKeyword())) { + list = list.stream().filter(t -> t.getName().contains(page.getKeyword())).collect(Collectors.toList()); + } + ListVO vo = new ListVO<>(); + vo.setList(list); + return ActionResult.success(vo); + } + + /** + * 获取缓存信息 + * + * @param name 主键值 + * @return ignore + */ + @Operation(summary = "获取缓存信息") + @Parameter(name = "name", description = "主键值", required = true) + @SaCheckPermission("system.cache") + @GetMapping("/{name}") + public ActionResult info(@PathVariable("name") String name) { + name = XSSEscape.escape(name); + String json = String.valueOf(redisUtil.getString(name)); + CacheManageInfoVO vo = new CacheManageInfoVO(); + vo.setName(name); + vo.setValue(json); + return ActionResult.success(vo); + } + + /** + * 清空所有缓存 + * + * @return ignore + */ + @Operation(summary = "清空所有缓存") + @SaCheckPermission("system.cache") + @PostMapping("/Actions/ClearAll") + public ActionResult clearAll() { + String tenantId = userProvider.get().getTenantId(); + if ("".equals(tenantId)) { + Set keys = redisUtil.getAllKeys(); + for (String key : keys) { + redisUtil.remove(key); + } + } else { + Set data = redisUtil.getAllKeys(); + String clientKey = UserProvider.getToken(); + System.out.println(clientKey); + for (String key : data) { + if (key.contains(tenantId)) { + redisUtil.remove(key); + } + } + } + return ActionResult.success("清理成功"); + } + + /** + * 清空单个缓存 + * + * @param name 主键值 + * @return ignore + */ + @Operation(summary = "清空单个缓存") + @Parameter(name = "name", description = "主键值", required = true) + @SaCheckPermission("system.cache") + @DeleteMapping("/{name}") + public ActionResult clear(@PathVariable("name") String name) { + redisUtil.remove(name); + return ActionResult.success("清空成功"); + } +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/ComFieldsController.java b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/ComFieldsController.java new file mode 100644 index 0000000..16c0147 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/ComFieldsController.java @@ -0,0 +1,139 @@ +package jnpf.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import jnpf.base.controller.SuperController; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.service.ComFieldsService; +import jnpf.base.vo.ListVO; +import jnpf.base.entity.ComFieldsEntity; +import jnpf.constant.MsgCode; +import jnpf.exception.DataException; +import jnpf.base.model.comfields.ComFieldsCrForm; +import jnpf.base.model.comfields.ComFieldsInfoVO; +import jnpf.base.model.comfields.ComFieldsListVO; +import jnpf.base.model.comfields.ComFieldsUpForm; +import jnpf.util.JsonUtil; +import jnpf.util.JsonUtilEx; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; + +/** + * 常用字段 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Tag(name = "常用字段", description = "CommonFields") +@RestController +@RequestMapping("/api/system/CommonFields") +public class ComFieldsController extends SuperController { + + @Autowired + private ComFieldsService comFieldsService; + + /** + * 获取常用字段列表 + * + * @return ignore + */ + @Operation(summary = "获取常用字段列表") + @SaCheckPermission("systemData.dataModel") + @GetMapping + public ActionResult> list() { + List data = comFieldsService.getList(); + List list = JsonUtil.getJsonToList(data, ComFieldsListVO.class); + ListVO vo = new ListVO<>(); + vo.setList(list); + return ActionResult.success(vo); + } + + /** + * 获取常用字段 + * + * @param id 主键 + * @return ignore + */ + @Operation(summary = "获取常用字段") + @Parameter(name = "id", description = "主键", required = true) + @SaCheckPermission("systemData.dataModel") + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) throws DataException { + ComFieldsEntity entity = comFieldsService.getInfo(id); + ComFieldsInfoVO vo = JsonUtilEx.getJsonToBeanEx(entity, ComFieldsInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 新增常用字段 + * + * @param comFieldsCrForm 新增常用字段模型 + * @return ignore + */ + @Operation(summary = "添加常用字段") + @Parameter(name = "comFieldsCrForm", description = "新建模型", required = true) + @SaCheckPermission("systemData.dataModel") + @PostMapping + public ActionResult create(@RequestBody @Valid ComFieldsCrForm comFieldsCrForm) { + ComFieldsEntity entity = JsonUtil.getJsonToBean(comFieldsCrForm, ComFieldsEntity.class); + if (comFieldsService.isExistByFullName(entity.getField(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + comFieldsService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 修改常用字段 + * + * @param id 主键 + * @param comFieldsUpForm 修改常用字段模型 + * @return ignore + */ + @Operation(summary = "修改常用字段") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "comFieldsUpForm", description = "修改模型", required = true) + }) + @SaCheckPermission("systemData.dataModel") + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid ComFieldsUpForm comFieldsUpForm) { + ComFieldsEntity entity = JsonUtil.getJsonToBean(comFieldsUpForm, ComFieldsEntity.class); + if (comFieldsService.isExistByFullName(entity.getField(), id)) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + boolean flag = comFieldsService.update(id, entity); + if (!flag) { + return ActionResult.fail(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除常用字段 + * + * @param id 主键 + * @return ignore + */ + @Operation(summary = "删除常用字段") + @Parameter(name = "id", description = "主键", required = true) + @SaCheckPermission("systemData.dataModel") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + ComFieldsEntity entity = comFieldsService.getInfo(id); + if (entity != null) { + comFieldsService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } +} + diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/CommonWordsController.java b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/CommonWordsController.java new file mode 100644 index 0000000..0583057 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/CommonWordsController.java @@ -0,0 +1,179 @@ +package jnpf.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.annotation.SaMode; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.entity.CommonWordsEntity; +import jnpf.base.entity.SystemEntity; +import jnpf.base.model.commonword.ComWordsPagination; +import jnpf.base.model.commonword.CommonWordsForm; +import jnpf.base.model.commonword.CommonWordsVO; +import jnpf.base.service.CommonWordsService; +import jnpf.base.service.SystemService; +import jnpf.base.vo.ListVO; +import jnpf.base.vo.PageListVO; +import jnpf.base.vo.PaginationVO; +import jnpf.constant.MsgCode; +import jnpf.util.JsonUtil; +import jnpf.util.RandomUtil; +import jnpf.util.StringUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 常用语控制类 + * + * @author JNPF开发平台组 YanYu + * @version v3.4.6 + * @copyrignt 引迈信息技术有限公司 + * @date 2023-01-06 + */ +@Tag(name = "审批常用语", description = "commonWords") +@RestController +@RequestMapping("/api/system/CommonWords") +public class CommonWordsController extends SuperController { + + @Autowired + private CommonWordsService commonWordsService; + @Autowired + private SystemService systemService; + + + /** + * 列表 + * + * @param comWordsPagination 页面参数对象 + * @return 列表结果集 + */ + @Operation(summary = "当前系统应用列表") + @GetMapping() + public ActionResult> getList(ComWordsPagination comWordsPagination) { + List entityList = commonWordsService.getSysList(comWordsPagination, false); + List voList = JsonUtil.getJsonToList(entityList, CommonWordsVO.class); + formatSystemNames(voList); + return ActionResult.page(voList, JsonUtil.getJsonToBean(comWordsPagination, PaginationVO.class)); + } + + /** + * 获取信息 + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取信息") + @Parameter(name = "id", description = "主键", required = true) + @SaCheckPermission(value = {"commonWords", "workFlow.flowTodo"}, mode = SaMode.OR) + @GetMapping("/{id}") + public ActionResult getInfo(@PathVariable String id) { + CommonWordsEntity entity = commonWordsService.getById(id); + if(StringUtil.isNotEmpty(entity.getSystemIds())){ + String[] sysIds = entity.getSystemIds().split(","); + List ids = new ArrayList<>(); + for(String sysId : sysIds){ + if(!StringUtil.isEmpty(sysId)) { + SystemEntity systemEntity = systemService.getInfo(sysId); + if (systemEntity != null && systemEntity.getEnabledMark() == 1) { + ids.add(sysId); + } + } + } + if(ids.size() > 0){ + entity.setSystemIds(StringUtil.join(ids, ",")); + }else { + entity.setSystemIds(null); + } + } + CommonWordsVO vo = JsonUtil.getJsonToBean(entity, CommonWordsVO.class); + return ActionResult.success(vo); + } + + /** + * 下拉列表 + * + * @return + */ + @Operation(summary = "下拉列表") + @SaCheckPermission(value = {"commonWords", "workFlow.flowTodo"}, mode = SaMode.OR) + @GetMapping("/Selector") + public ActionResult> getSelect(String type) { + List voList = JsonUtil.getJsonToList(commonWordsService.getListModel(type), CommonWordsVO.class); + formatSystemNames(voList); + return ActionResult.success(new ListVO<>(voList)); + } + + /** + * 新建 + * + * @param commonWordsForm 实体模型 + * @return + */ + @Operation(summary = "新建") + @SaCheckPermission(value = {"commonWords", "workFlow.flowTodo"}, mode = SaMode.OR) + @Parameter(name = "commonWordsForm", description = "实体模型", required = true) + @PostMapping("") + public ActionResult create(@RequestBody CommonWordsForm commonWordsForm) { + CommonWordsEntity entity = JsonUtil.getJsonToBean(commonWordsForm, CommonWordsEntity.class); + entity.setId(RandomUtil.uuId()); + commonWordsService.save(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 修改 + * @param commonWordsForm 实体模型 + * @return + */ + @Operation(summary = "修改") + @SaCheckPermission(value = {"commonWords", "workFlow.flowTodo"}, mode = SaMode.OR) + @Parameters({ + @Parameter(name = "commonWordsForm", description = "实体模型", required = true) + }) + @PutMapping("/{id}") + public ActionResult update(@RequestBody CommonWordsForm commonWordsForm) { + CommonWordsEntity entity = JsonUtil.getJsonToBean(commonWordsForm, CommonWordsEntity.class); + entity.setId(commonWordsForm.getId()); + commonWordsService.updateById(entity); + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除 + * + * @param id 主键 + * @return + */ + @Operation(summary = "删除") + @SaCheckPermission("commonWords") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable String id) { + //对象存在判断 + if (commonWordsService.getById(id) != null) { + commonWordsService.removeById(id); + return ActionResult.success(MsgCode.SU003.get()); + } else { + return ActionResult.fail(MsgCode.FA003.get()); + } + } + + private void formatSystemNames(List voList){ + voList.forEach(vo->{ + if(StringUtil.isNotEmpty(vo.getSystemIds())){ + List sysNameList = systemService.getListByIds(vo.getSystemIds()).stream() + .map(SystemEntity::getFullName).collect(Collectors.toList()); + vo.setSystemNames(StringUtil.join(sysNameList, ",")); + } + }); + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/DataInterfaceController.java b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/DataInterfaceController.java new file mode 100644 index 0000000..86694eb --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/DataInterfaceController.java @@ -0,0 +1,654 @@ +package jnpf.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.serializer.SerializerFeature; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import jnpf.base.*; +import jnpf.base.entity.DataInterfaceEntity; +import jnpf.base.entity.DictionaryDataEntity; +import jnpf.base.entity.InterfaceOauthEntity; +import jnpf.base.model.datainterface.*; +import jnpf.base.service.DataInterfaceService; +import jnpf.base.service.DictionaryDataService; +import jnpf.base.service.DictionaryTypeService; +import jnpf.base.service.InterfaceOauthService; +import jnpf.base.util.interfaceUtil.InterfaceUtil; +import jnpf.base.vo.PageListVO; +import jnpf.constant.DbSensitiveConstant; +import jnpf.base.vo.DownloadVO; +import jnpf.base.vo.ListVO; +import jnpf.base.vo.PaginationVO; +import jnpf.config.ConfigValueUtil; +import jnpf.constant.MsgCode; +import jnpf.constant.FileTypeConstant; +import jnpf.emnus.ModuleTypeEnum; +import jnpf.exception.DataException; +import jnpf.database.util.*; +import jnpf.util.*; +import jnpf.util.data.DataSourceContextHolder; +import jnpf.util.enums.DictionaryDataEnum; +import jnpf.util.treeutil.SumTree; +import jnpf.util.treeutil.TreeDotUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import java.util.*; + +/** + * 数据接口 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-03-15 10:29 + */ +@Tag(name = "数据接口", description = "DataInterface") +@RestController +@RequestMapping(value = "/api/system/DataInterface") +public class DataInterfaceController extends SuperController { + @Autowired + private DataInterfaceService dataInterfaceService; + @Autowired + private DictionaryDataService dictionaryDataService; + @Autowired + private DictionaryTypeService dictionaryTypeService; + @Autowired + private UserProvider userProvider; + @Autowired + private Props props; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private InterfaceOauthService interfaceOauthService; + @Autowired + private DataFileExport fileExport; + + /** + * 获取接口列表(分页) + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "获取接口列表(分页)") + @SaCheckPermission("systemData.dataInterface") + @GetMapping + public ActionResult> getList(PaginationDataInterface pagination) { + List data = dataInterfaceService.getList(pagination, null, 0); + List list = JsonUtil.getJsonToList(data, DataInterfaceListVO.class); + // 添加tenantId字段 + for (DataInterfaceListVO vo : list) { + // 类别转换 + if ("1".equals(vo.getType())) { + vo.setType("SQL操作"); + } else if ("2".equals(vo.getType())) { + vo.setType("静态数据"); + } else if ("3".equals(vo.getType())) { + vo.setType("Api数据"); + } + if (StringUtil.isNotEmpty(userProvider.get().getTenantId())) { + vo.setTenantId(userProvider.get().getTenantId()); + } + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(list, paginationVO); + } + + /** + * 获取接口列表(工作流选择时调用) + * + * @param pagination 分页参数 + * @return ignore + */ + @Operation(summary = "获取接口列表(工作流选择时调用)") + @GetMapping("/getList") + public ActionResult> getLists(PaginationDataInterfaceModel pagination) { + List data = dataInterfaceService.getList(pagination, pagination.getType(), 1); + List list = JsonUtil.getJsonToList(data, DataInterfaceGetListVO.class); + for (DataInterfaceGetListVO vo : list) { + // 类别转换 + if ("1".equals(vo.getType())) { + vo.setType("SQL操作"); + } else if ("2".equals(vo.getType())) { + vo.setType("静态数据"); + } else if ("3".equals(vo.getType())) { + vo.setType("Api数据"); + } + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(list, paginationVO); + } + + /** + * 获取接口列表下拉框 + * + * @return + */ + @Operation(summary = "获取接口列表下拉框") + @GetMapping("/Selector") + public ActionResult> getSelector() { + List tree = new ArrayList<>(); + List data = dataInterfaceService.getList(false); + List dataEntityList = dictionaryDataService.getList(dictionaryTypeService.getInfoByEnCode(DictionaryDataEnum.SYSTEM_DATAINTERFACE.getDictionaryTypeId()).getId()); + // 获取数据接口外层菜单 + for (DictionaryDataEntity dictionaryDataEntity : dataEntityList) { + DataInterfaceTreeModel firstModel = JsonUtil.getJsonToBean(dictionaryDataEntity, DataInterfaceTreeModel.class); + firstModel.setId(dictionaryDataEntity.getId()); + firstModel.setCategory("0"); + long num = data.stream().filter(t -> t.getCategory().equals(dictionaryDataEntity.getId())).count(); + if (num > 0) { + tree.add(firstModel); + } + } + for (DataInterfaceEntity entity : data) { + DataInterfaceTreeModel treeModel = JsonUtil.getJsonToBean(entity, DataInterfaceTreeModel.class); + treeModel.setCategory("1"); + treeModel.setParentId(entity.getCategory()); + treeModel.setId(entity.getId()); + DictionaryDataEntity dataEntity = dictionaryDataService.getInfo(entity.getCategory()); + if (dataEntity != null) { + tree.add(treeModel); + } + } + List> sumTrees = TreeDotUtils.convertListToTreeDot(tree); + List list = JsonUtil.getJsonToList(sumTrees, DataInterfaceTreeVO.class); + ListVO vo = new ListVO<>(); + vo.setList(list); + return ActionResult.success(list); + } + + /** + * 获取接口参数列表下拉框 + * + * @param id 主键 + * @return ignore + */ + @Operation(summary = "获取接口参数列表下拉框") + @Parameter(name = "id", description = "主键", required = true) + @SaCheckPermission("systemData.dataInterface") + @GetMapping("/GetParam/{id}") + public ActionResult> getSelector(@PathVariable("id") String id) { + DataInterfaceEntity entity = dataInterfaceService.getInfo(id); + if (entity!=null) { + String parameterJson = entity.getParameterJson(); + List jsonToList = JsonUtil.getJsonToList(parameterJson, DataInterfaceModel.class); + return ActionResult.success(jsonToList == null ? new ArrayList<>() : jsonToList); + } + return ActionResult.fail("数据不存在"); + } + + /** + * 获取接口数据 + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取接口数据") + @Parameter(name = "id", description = "主键", required = true) + @SaCheckPermission("systemData.dataInterface") + @GetMapping("/{id}") + public ActionResult getInfo(@PathVariable("id") String id) throws DataException { + DataInterfaceEntity entity = dataInterfaceService.getInfo(id); + DataInterfaceVo vo = JsonUtil.getJsonToBean(entity, DataInterfaceVo.class); + return ActionResult.success(vo); + } + + /** + * 添加接口 + * + * @param dataInterfaceCrForm 实体模型 + * @return + */ + @Operation(summary = "添加接口") + @Parameter(name = "dataInterfaceCrForm", description = "实体模型", required = true) + @SaCheckPermission("systemData.dataInterface") + @PostMapping + public ActionResult create(@RequestBody @Valid DataInterfaceCrForm dataInterfaceCrForm) throws DataException { + DataInterfaceEntity entity = JsonUtil.getJsonToBean(dataInterfaceCrForm, DataInterfaceEntity.class); + // 判断是否有敏感字 + String containsSensitive = containsSensitive(entity); + if (StringUtil.isNotEmpty(containsSensitive)) { + return ActionResult.fail("当前SQL含有敏感字:" + containsSensitive); + } + if (dataInterfaceService.isExistByFullNameOrEnCode(entity.getId(), entity.getFullName(), null)) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (dataInterfaceService.isExistByFullNameOrEnCode(entity.getId(), null, entity.getEnCode())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + dataInterfaceService.create(entity); + return ActionResult.success("接口创建成功"); + } + + /** + * 判断是否有敏感字 + * + * @param entity + * @return + */ + private String containsSensitive(DataInterfaceEntity entity) { + // 判断是否有敏感字 + if (entity.getType() == 1 && (entity.getAction() != null && entity.getAction() == 3)) { + DataConfigJsonModel dataConfigJsonModel = JsonUtil.getJsonToBean(entity.getDataConfigJson(), DataConfigJsonModel.class); + String sql = dataConfigJsonModel.getSqlData().getSql(); + if (StringUtil.isNotEmpty(sql)) { + String[] split = DbSensitiveConstant.SENSITIVE.split(","); + for (String str : split) { + str = str.trim(); + String[] matchStr = new String[]{str + " ", str.trim() + "-"}; + for (String s : matchStr) { + boolean contains = sql.toUpperCase().contains(s); + if (contains) { + return str.trim(); + } + } + } + } + } + return ""; + } + + /** + * 修改接口 + * + * @param dataInterfaceUpForm 实体模型 + * @param id 主键 + * @return + */ + @Operation(summary = "修改接口") + @Parameters({ + @Parameter(name = "dataInterfaceUpForm", description = "实体模型", required = true), + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("systemData.dataInterface") + @PutMapping("/{id}") + public ActionResult update(@RequestBody @Valid DataInterfaceUpForm dataInterfaceUpForm, @PathVariable("id") String id) throws DataException { + DataInterfaceEntity entity = JsonUtilEx.getJsonToBeanEx(dataInterfaceUpForm, DataInterfaceEntity.class); + // 判断是否有敏感字 + String containsSensitive = containsSensitive(entity); + if (StringUtil.isNotEmpty(containsSensitive)) { + return ActionResult.fail("当前SQL含有敏感字:" + containsSensitive); + } + if (dataInterfaceService.isExistByFullNameOrEnCode(id, entity.getFullName(), null)) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (dataInterfaceService.isExistByFullNameOrEnCode(id, null, entity.getEnCode())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + boolean flag = dataInterfaceService.update(entity, id); + if (!flag) { + return ActionResult.fail(MsgCode.FA001.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除接口 + * + * @param id 主键 + * @return + */ + @Operation(summary = "删除接口") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("systemData.dataInterface") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable String id) { + DataInterfaceEntity entity = dataInterfaceService.getInfo(id); + if (entity != null) { + dataInterfaceService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA001.get()); + } + + /** + * 更新接口状态 + * + * @param id 主键 + * @return + */ + @Operation(summary = "更新接口状态") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("systemData.dataInterface") + @PutMapping("/{id}/Actions/State") + public ActionResult update(@PathVariable("id") String id) throws DataException { + DataInterfaceEntity entity = dataInterfaceService.getInfo(id); + if (entity != null) { + if (entity.getEnabledMark() == 0) { + entity.setEnabledMark(1); + } else { + entity.setEnabledMark(0); + } + dataInterfaceService.update(entity, id); + return ActionResult.success("更新接口状态成功"); + } + return ActionResult.fail(MsgCode.FA001.get()); + } + + /** + * 获取接口分页数据 + * + * @param id 主键 + * @param page 分页参数 + * @return + */ + @Operation(summary = "获取接口分页数据") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "page", description = "分页参数", required = true) + }) + @PostMapping("/{id}/Actions/List") + public ActionResult infoToIdPageList(@PathVariable("id") String id, @RequestBody DataInterfacePage page) { + ActionResult result = dataInterfaceService.infoToIdPageList(id, page); + return result; + } + + /** + * 获取接口详情数据 + * + * @param id 主键 + * @param page 分页参数 + * @return + */ + @Operation(summary = "获取接口详情数据") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "page", description = "分页参数", required = true) + }) + @PostMapping("/{id}/Actions/InfoByIds") + public ActionResult>> infoByIds(@PathVariable("id") String id, @RequestBody DataInterfacePage page) { + List> data = dataInterfaceService.infoToInfo(id, page); + return ActionResult.success(data); + } + + /** + * 测试接口 + * + * @param id 主键 + * @param objectMap 参数、参数值对象 + * @return + */ + @Operation(summary = "测试接口") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "objectMap", description = "参数、参数值对象") + }) + @PostMapping("/{id}/Actions/Preview") + @NoDataSourceBind + public ActionResult callPreview(@PathVariable("id") String id, @RequestBody(required = false) Map objectMap) { + DataInterfaceParamModel model = JsonUtil.getJsonToBean(objectMap, DataInterfaceParamModel.class); + Map map = null; + if (model != null) { + if (configValueUtil.isMultiTenancy()) { + // 判断是不是从外面直接请求 + if (StringUtil.isNotEmpty(model.getTenantId())) { + //切换成租户库 + try{ + TenantDataSourceUtil.switchTenant(model.getTenantId()); + }catch (Exception e){ + return ActionResult.fail(ActionResultCode.SessionOverdue.getMessage()); + } + } else { + UserInfo userInfo = UserProvider.getUser(); + if (Objects.isNull(userInfo.getUserId())) { + return ActionResult.fail(ActionResultCode.SessionOverdue.getMessage()); + } + DataSourceContextHolder.setDatasource(userInfo.getTenantId(), userInfo.getTenantDbConnectionString(), userInfo.isAssignDataSource()); + } + } + if (model.getParamList() != null && model.getParamList().size() > 0) { + map = new HashMap<>(16); + List jsonToList = JsonUtil.getJsonToList(model.getParamList(), DataInterfaceModel.class); + for (DataInterfaceModel dataInterfaceModel : jsonToList) { + map.put(dataInterfaceModel.getField(), dataInterfaceModel.getDefaultValue()); + } + } + } + ActionResult actionResult = dataInterfaceService.infoToId(id, null, map); + if (actionResult.getCode() == 200) { + actionResult.setMsg("接口请求成功"); + } + return actionResult; + } + + /** + * 访问接口GET + * + * @param id 主键 + * @param map 参数、参数值对象 + * @return + */ + @Operation(summary = "访问接口GET") + @GetMapping("/{id}/Actions/Response") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "map", description = "参数、参数值对象") + }) + @NoDataSourceBind + public ActionResult getResponse(@PathVariable("id") String id,@RequestParam(required = false) Map map) { + DataInterfaceActionModel entity; + try{ + entity= dataInterfaceService.checkParams(map); + entity.setInvokType("GET"); + }catch (Exception e){ + return ActionResult.fail(e.getMessage()); + } + String name = null; + if (configValueUtil.isMultiTenancy()) { + // 判断是不是从外面直接请求 + if (StringUtil.isNotEmpty(entity.getTenantId())) { + //切换成租户库 + try{ + TenantDataSourceUtil.switchTenant(entity.getTenantId()); + }catch (Exception e){ + return ActionResult.fail(ActionResultCode.SessionOverdue.getMessage()); + } + } else { + UserInfo userInfo = UserProvider.getUser(); + if (Objects.isNull(userInfo.getUserId())) { + return ActionResult.fail(ActionResultCode.SessionOverdue.getMessage()); + } + DataSourceContextHolder.setDatasource(userInfo.getTenantId(), userInfo.getTenantDbConnectionString(), userInfo.isAssignDataSource()); + } + } + return dataInterfaceService.infoToIdNew(id, name, entity); + } + + /** + * 访问接口POST + * + * @param id 主键 + * @param map 参数、参数值对象 + * @return + */ + @Operation(summary = "访问接口POST") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "map", description = "参数、参数值对象") + }) + @PostMapping("/{id}/Actions/Response") + @NoDataSourceBind + public ActionResult postResponse(@PathVariable("id") String id, @RequestBody(required = false) Map map) { + DataInterfaceActionModel entity; + try{ + entity= dataInterfaceService.checkParams(map); + entity.setInvokType("POST"); + }catch (Exception e){ + return ActionResult.fail(e.getMessage()); + } + String name = null; + if (configValueUtil.isMultiTenancy()) { + // 判断是不是从外面直接请求 + if (StringUtil.isNotEmpty(entity.getTenantId())) { + //切换成租户库 + try{ + TenantDataSourceUtil.switchTenant(entity.getTenantId()); + }catch (Exception e){ + return ActionResult.fail(ActionResultCode.SessionOverdue.getMessage()); + } + } else { + UserInfo userInfo = UserProvider.getUser(); + if (Objects.isNull(userInfo.getUserId())) { + return ActionResult.fail(ActionResultCode.SessionOverdue.getMessage()); + } + DataSourceContextHolder.setDatasource(userInfo.getTenantId(), userInfo.getTenantDbConnectionString(), userInfo.isAssignDataSource()); + } + } + return dataInterfaceService.infoToIdNew(id, name, entity); + } + + /** + * 外部接口获取authorization + * + * @param appId 应用id + * @param intefaceId 接口id + * @param map 参数、参数值对象 + * @return + */ + @Operation(summary = "外部接口获取authorization") + @Parameters({ + @Parameter(name = "appId", description = "应用id", required = true), + @Parameter(name = "intefaceId", description = "接口id"), + @Parameter(name = "map", description = "参数、参数值对象") + }) + @PostMapping("/Actions/GetAuth") + @NoDataSourceBind + public ActionResult getAuthorization(@RequestParam("appId") String appId,@RequestParam("intefaceId") String intefaceId, @RequestBody(required = false) Map map) { + InterfaceOauthEntity infoByAppId = interfaceOauthService.getInfoByAppId(appId); + if(infoByAppId==null){ + return ActionResult.fail("appId参数错误"); + } + Map authorization = InterfaceUtil.getAuthorization(intefaceId,appId,infoByAppId.getAppSecret(), map); + return ActionResult.success(MsgCode.SU005.get(),authorization); + } + + /** + * 数据接口导出功能 + * + * @param id 接口id + */ + @Operation(summary = "导出数据接口数据") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("systemData.dataInterface") + @GetMapping("/{id}/Actions/Export") + public ActionResult exportFile(@PathVariable("id") String id) { + DataInterfaceEntity entity = dataInterfaceService.getInfo(id); + //导出文件 + DownloadVO downloadVO = fileExport.exportFile(entity, configValueUtil.getTemporaryFilePath(), entity.getFullName(), ModuleTypeEnum.SYSTEM_DATAINTEFASE.getTableName()); + return ActionResult.success(downloadVO); + } + + /** + * 数据接口导入功能 + * + * @param multipartFile + * @return + * @throws DataException + */ + @Operation(summary = "数据接口导入功能") + @SaCheckPermission("systemData.dataInterface") + @PostMapping(value = "/Actions/Import", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public ActionResult importFile(@RequestPart("file") MultipartFile multipartFile) throws DataException { + //判断是否为.json结尾 + if (FileUtil.existsSuffix(multipartFile, ModuleTypeEnum.SYSTEM_DATAINTEFASE.getTableName())) { + return ActionResult.fail("导入文件格式错误"); + } + //读取文件内容 + String fileContent = FileUtil.getFileContent(multipartFile); + try { + DataInterfaceEntity entity = JsonUtil.getJsonToBean(fileContent, DataInterfaceEntity.class); + // 验证数据是否正常 + if (dictionaryDataService.getInfo(entity.getCategory()) == null) { + return ActionResult.fail(MsgCode.IMP004.get()); + } + if (dataInterfaceService.getInfo(entity.getId()) == null && + !dataInterfaceService.isExistByFullNameOrEnCode(entity.getId(), entity.getFullName(), null) && + !dataInterfaceService.isExistByFullNameOrEnCode(entity.getId(), null, entity.getEnCode())) { + dataInterfaceService.create(entity); + return ActionResult.success("导入成功"); + } + } catch (Exception e) { + throw new DataException("导入失败,数据有误"); + } + return ActionResult.fail("数据已存在"); + } + + + /** + * 获取接口字段 + * + * @param id 主键 + * @param objectMap 参数、参数值 + * @return + */ + @Operation(summary = "获取接口字段") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "objectMap", description = "参数、参数值") + }) + @PostMapping("/{id}/Actions/GetFields") + public ActionResult getFields(@PathVariable("id") String id, @RequestBody(required = false) Map objectMap) { + DataInterfacePage model = JsonUtil.getJsonToBean(objectMap, DataInterfacePage.class); + ActionResult actionResult = dataInterfaceService.infoToIdPageList(id, model); + if (actionResult.getCode() == 200) { + try{ + Object data = actionResult.getData(); + if (data instanceof List) { + List> list=(List)data; + List listKey=new ArrayList(); + for(String key:list.get(0).keySet()){ + listKey.add(key); + } + actionResult.setData(listKey); + }else{ + Map map=JsonUtil.stringToMap(JSONObject.toJSONString(data, SerializerFeature.WriteMapNullValue)); + List> list=(List)map.get("list"); + List listKey=new ArrayList(); + for(String key:list.get(0).keySet()){ + listKey.add(key); + } + actionResult.setData(listKey); + } + }catch (Exception e){ + return ActionResult.fail("接口不符合规范!"); + } + } + return actionResult; + } + /** + * 复制数据接口 + * + * @param id 数据接口ID + * @return 执行结构 + * @throws DataException ignore + */ + @Operation(summary = "复制数据接口") + @Parameters({ + @Parameter(name = "id", description = "数据接口ID", required = true) + }) + @SaCheckPermission("systemData.dataInterface") + @PostMapping("/{id}/Actions/Copy") + public ActionResult Copy(@PathVariable("id") String id) throws DataException { + String randomCode = TableUtil.getStringRandom(5); + DataInterfaceEntity entity = dataInterfaceService.getInfo(id); + entity.setFullName(entity.getFullName() + ".副本" + randomCode); + if(entity.getFullName().length() > 50) return ActionResult.fail(MsgCode.COPY001.get()); + entity.setEnCode(entity.getEnCode() + "." + randomCode); + entity.setEnabledMark(0); + dataInterfaceService.create(entity); + return ActionResult.success(MsgCode.SU007.get()); + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/DataInterfaceLogController.java b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/DataInterfaceLogController.java new file mode 100644 index 0000000..1d0902e --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/DataInterfaceLogController.java @@ -0,0 +1,68 @@ +package jnpf.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.Pagination; +import jnpf.base.entity.DataInterfaceLogEntity; +import jnpf.base.model.datainterface.DataInterfaceLogVO; +import jnpf.base.service.DataInterfaceLogService; +import jnpf.base.vo.PageListVO; +import jnpf.base.vo.PaginationVO; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.UserService; +import jnpf.util.JsonUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * 数据接口调用日志控制器 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-06-03 + */ +@Tag(description = "DataInterfaceLog", name = "数据接口调用日志") +@RestController +@RequestMapping("/api/system/DataInterfaceLog") +public class DataInterfaceLogController extends SuperController { + @Autowired + private DataInterfaceLogService dataInterfaceLogService; + @Autowired + private UserService userService; + + /** + * 获取数据接口调用日志列表 + * + * @param id 主键 + * @param pagination 分页参数 + * @return ignore + */ + @Operation(summary = "获取数据接口调用日志列表") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("systemData.dataInterface") + @GetMapping("{id}") + public ActionResult> getList(@PathVariable("id") String id, Pagination pagination) { + List list = dataInterfaceLogService.getList(id, pagination); + List voList = JsonUtil.getJsonToList(list, DataInterfaceLogVO.class); + for (DataInterfaceLogVO vo : voList) { + UserEntity entity = userService.getInfo(vo.getUserId()); + if (entity != null) { + vo.setUserId(entity.getRealName() + "/" + entity.getAccount()); + } + } + PaginationVO vo = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(voList, vo); + } +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/DataInterfaceVariateController.java b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/DataInterfaceVariateController.java new file mode 100644 index 0000000..1f48689 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/DataInterfaceVariateController.java @@ -0,0 +1,276 @@ +package jnpf.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import jnpf.base.ActionResult; +import jnpf.base.Page; +import jnpf.base.entity.DataInterfaceEntity; +import jnpf.base.entity.DataInterfaceVariateEntity; +import jnpf.base.model.datainterfacevariate.DataInterfaceVariateListVO; +import jnpf.base.model.datainterfacevariate.DataInterfaceVariateModel; +import jnpf.base.model.datainterfacevariate.DataInterfaceVariateSelectorVO; +import jnpf.base.model.datainterfacevariate.DataInterfaceVariateVO; +import jnpf.base.service.DataInterfaceService; +import jnpf.base.service.DataInterfaceVariateService; +import jnpf.base.vo.DownloadVO; +import jnpf.base.vo.ListVO; +import jnpf.config.ConfigValueUtil; +import jnpf.constant.FileTypeConstant; +import jnpf.constant.MsgCode; +import jnpf.database.util.TableUtil; +import jnpf.emnus.ModuleTypeEnum; +import jnpf.exception.DataException; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.UserService; +import jnpf.util.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 数据接口变量 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-03-15 10:29 + */ +@Tag(name = "数据接口变量", description = "DataInterfaceVariate") +@RestController +@RequestMapping(value = "/api/system/DataInterfaceVariate") +public class DataInterfaceVariateController { + + @Autowired + private DataInterfaceVariateService dataInterfaceVariateService; + @Autowired + private UserService userApi; + @Autowired + private DataInterfaceService dataInterfaceService; + @Autowired + private DataFileExport fileExport; + @Autowired + private ConfigValueUtil configValueUtil; + + /** + * 获取数据接口变量 + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取数据接口变量") + @SaCheckPermission("systemData.dataInterface") + @Parameter(name = "id", description = "自然主键") + @GetMapping("/{id}") + public ActionResult> list(@PathVariable("id") String id, Page page) { + List list = new ArrayList<>(); + List data = dataInterfaceVariateService.getList(id, page); + data.forEach(t -> { + DataInterfaceVariateListVO vo = new DataInterfaceVariateListVO(); + vo.setId(t.getId()); + vo.setInterfaceId(t.getInterfaceId()); + vo.setFullName(t.getFullName()); + vo.setValue(t.getValue()); + vo.setCreatorTime(t.getCreatorTime() != null ? t.getCreatorTime().getTime() : null); + vo.setLastModifyTime(t.getLastModifyTime() != null ? t.getLastModifyTime().getTime() : null); + UserEntity userEntity = userApi.getInfo(t.getCreatorUserId()); + vo.setCreatorUser(userEntity != null ? userEntity.getRealName() + "/" + userEntity.getAccount() : null); + list.add(vo); + }); + ListVO listVO = new ListVO<>(); + listVO.setList(list); + return ActionResult.success(listVO); + } + + /** + * 下拉列表 + * + * @return + */ + @Operation(summary = "下拉列表") + @SaCheckPermission("systemData.dataInterface") + @GetMapping("/Selector") + public ActionResult> selector() { + List data = dataInterfaceVariateService.getList(null, null); + List list = dataInterfaceService.getList(data.stream().map(DataInterfaceVariateEntity::getInterfaceId).collect(Collectors.toList())); + List jsonToList = JsonUtil.getJsonToList(list, DataInterfaceVariateSelectorVO.class); + jsonToList.forEach(t -> { + t.setParentId("-1"); + t.setType(0); + }); + jsonToList.forEach(t -> { + List collect = data.stream().filter(variateEntity -> t.getId().equals(variateEntity.getInterfaceId())).collect(Collectors.toList()); + List selectorVOS = JsonUtil.getJsonToList(collect, DataInterfaceVariateSelectorVO.class); + selectorVOS.forEach(selectorVO -> { + selectorVO.setParentId(t.getId()); + selectorVO.setType(1); + }); + t.setChildren(selectorVOS); + }); + return ActionResult.success(jsonToList); + } + + /** + * 详情 + * + * @param id 主键 + * @return + */ + @Operation(summary = "详情") + @SaCheckPermission("systemData.dataInterface") + @Parameter(name = "id", description = "自然主键") + @GetMapping("/{id}/Info") + public ActionResult info(@PathVariable("id") String id) { + DataInterfaceVariateEntity entity = dataInterfaceVariateService.getInfo(id); + DataInterfaceVariateVO vo = JsonUtil.getJsonToBean(entity, DataInterfaceVariateVO.class); + return ActionResult.success(vo); + } + + /** + * 导出 + * + * @param id 自然主键 + * @return + */ + @Operation(summary = "导出") + @SaCheckPermission("systemData.dataInterface") + @Parameter(name = "id", description = "自然主键") + @GetMapping("/{id}/Actions/Export") + public ActionResult export(@PathVariable("id") String id) { + DataInterfaceVariateEntity entity = dataInterfaceVariateService.getInfo(id); + DownloadVO downloadVO = fileExport.exportFile(entity, configValueUtil.getTemporaryFilePath(), entity.getFullName(), ModuleTypeEnum.SYSTEM_DATAINTEFASE_VARIATE.getTableName()); + return ActionResult.success(downloadVO); + } + + /** + * 添加 + * + * @param dataInterfaceVariateModel 模型 + * @return + */ + @Operation(summary = "添加") + @SaCheckPermission("systemData.dataInterface") + @Parameter(name = "dataInterfaceVariateModel", description = "模型") + @PostMapping + public ActionResult create(@RequestBody DataInterfaceVariateModel dataInterfaceVariateModel) { + DataInterfaceVariateEntity entity = JsonUtil.getJsonToBean(dataInterfaceVariateModel, DataInterfaceVariateEntity.class); + if (entity.getFullName().contains("@")) { + return ActionResult.fail("变量名不能包含敏感字符"); + } + if (dataInterfaceVariateService.isExistByFullName(entity)) { + return ActionResult.fail("变量名已存在"); + } + dataInterfaceVariateService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 修改 + * + * @param id 自然主键 + * @param dataInterfaceVariateModel 模型 + * @return + */ + @Operation(summary = "修改") + @SaCheckPermission("systemData.dataInterface") + @Parameters({ + @Parameter(name = "id", description = "自然主键"), + @Parameter(name = "dataInterfaceVariateModel", description = "模型") + }) + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody DataInterfaceVariateModel dataInterfaceVariateModel) { + DataInterfaceVariateEntity entity = JsonUtil.getJsonToBean(dataInterfaceVariateModel, DataInterfaceVariateEntity.class); + if (entity.getFullName().contains("@")) { + return ActionResult.fail("变量名不能包含敏感字符"); + } + entity.setId(id); + if (dataInterfaceVariateService.isExistByFullName(entity)) { + return ActionResult.fail("变量名已存在"); + } + dataInterfaceVariateService.update(entity); + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除 + * + * @param id 自然主键 + * @return + */ + @Operation(summary = "删除") + @SaCheckPermission("systemData.dataInterface") + @Parameters({ + @Parameter(name = "id", description = "自然主键") + }) + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + DataInterfaceVariateEntity entity = dataInterfaceVariateService.getInfo(id); + if (entity == null) { + return ActionResult.fail(MsgCode.FA001.get()); + } + dataInterfaceVariateService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + + /** + * 导入 + * + * @param multipartFile 文件 + * @return + */ + @Operation(summary = "导入") + @SaCheckPermission("systemData.dataInterface") + @PostMapping(value = "/Actions/Import", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public ActionResult delete(@RequestPart("file") MultipartFile multipartFile) { + //判断是否为.json结尾 + if (FileUtil.existsSuffix(multipartFile, ModuleTypeEnum.SYSTEM_DATAINTEFASE_VARIATE.getTableName())) { + return ActionResult.fail("导入文件格式错误"); + } + //读取文件内容 + String fileContent = FileUtil.getFileContent(multipartFile); + try { + DataInterfaceVariateEntity entity = JsonUtil.getJsonToBean(fileContent, DataInterfaceVariateEntity.class); + if (dataInterfaceVariateService.getInfo(entity.getId()) == null && + !dataInterfaceVariateService.isExistByFullName(entity)) { + dataInterfaceVariateService.create(entity); + return ActionResult.success("导入成功"); + } + } catch (Exception e) { + throw new DataException("导入失败,数据有误"); + } + return ActionResult.fail("数据已存在"); + } + + /** + * 复制 + * + * @param id 自然主键 + * @return + */ + @Operation(summary = "复制") + @SaCheckPermission("systemData.dataInterface") + @Parameter(name = "id", description = "自然主键", required = true) + @PostMapping("/{id}/Actions/Copy") + public ActionResult copy(@PathVariable("id") String id) { + String randomCode = TableUtil.getStringRandom(5); + DataInterfaceVariateEntity entity = dataInterfaceVariateService.getInfo(id); + entity.setFullName(entity.getFullName() + ".副本" + randomCode); + if(entity.getFullName().length() > 50) return ActionResult.fail(MsgCode.COPY001.get()); + entity.setId(null); + entity.setLastModifyTime(null); + entity.setLastModifyUserId(null); + entity.setId(RandomUtil.uuId()); + entity.setCreatorTime(new Date()); + dataInterfaceVariateService.create(entity); + return ActionResult.success(MsgCode.SU007.get()); + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/DbLinkController.java b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/DbLinkController.java new file mode 100644 index 0000000..bb94187 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/DbLinkController.java @@ -0,0 +1,275 @@ +package jnpf.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import jnpf.base.controller.SuperController; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.entity.DictionaryDataEntity; +import jnpf.base.model.dblink.*; +import jnpf.base.service.DbLinkService; +import jnpf.base.service.DictionaryDataService; +import jnpf.base.service.DictionaryTypeService; +import jnpf.base.vo.ListVO; +import jnpf.base.vo.PageListVO; +import jnpf.base.vo.PaginationVO; +import jnpf.constant.MsgCode; +import jnpf.database.model.entity.DbLinkEntity; +import jnpf.database.util.DataSourceUtil; +import jnpf.exception.DataException; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.UserService; +import jnpf.util.JsonUtil; +import jnpf.util.XSSEscape; +import jnpf.util.enums.DictionaryDataEnum; +import jnpf.util.treeutil.SumTree; +import jnpf.util.treeutil.newtreeutil.TreeDotUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 数据连接 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Tag(name = "数据连接", description = "DataSource") +@RestController +@RequestMapping("/api/system/DataSource") +public class DbLinkController extends SuperController { + + @Autowired + private DbLinkService dblinkService; + @Autowired + private UserService userService; + @Autowired + private DictionaryDataService dictionaryDataService; + @Autowired + private DictionaryTypeService dictionaryTypeService; + @Autowired + private DataSourceUtil dataSourceUtil; + + /** + * 列表 + * + * @param type 类型 + * @return + */ + @GetMapping("/Selector") + @Operation(summary = "获取数据连接下拉框列表") + public ActionResult> selectorList(String type) { + List modelAll = new LinkedList<>(); + List dbLinkList = dblinkService.getList(); + List dictionaryDataList = dictionaryDataService.getList(dictionaryTypeService.getInfoByEnCode(DictionaryDataEnum.SYSTEM_DBLINK.getDictionaryTypeId()).getId()); + // 1、连接中字典目录 + for (DictionaryDataEntity entity : dictionaryDataList) { + long num = dbLinkList.stream().filter(t -> t.getDbType().equals(entity.getEnCode())).count(); + if (num > 0){ + DbLinkModel model = new DbLinkModel(); + model.setNum(num); + model.setFullName(entity.getFullName()); + model.setParentId("-1"); + model.setId(entity.getId()); + modelAll.add(model); + } + } + // 2、字典中的连接集合 + for (DbLinkEntity entity : dbLinkList) { + dictionaryDataList.stream().filter(t -> t.getEnCode().equals(entity.getDbType())).findFirst().ifPresent((dataEntity)->{ + DbLinkModel model = JsonUtil.getJsonToBean(entity, DbLinkModel.class); + model.setParentId(dataEntity.getId()); + modelAll.add(model); + }); + } + List> trees = TreeDotUtils.convertListToTreeDot(modelAll.stream().sorted(Comparator.comparing(DbLinkModel::getFullName)).collect(Collectors.toList())); + List list = new ArrayList<>(); + // type为空时返回默认库 + if(type == null){ + DbLinkListVO dbLink = new DbLinkListVO(); + dbLink.setFullName("默认数据库"); + dbLink.setId("0"); + dbLink.setDbType(dataSourceUtil.getDbType()); + DbLinkSelectorListVO defaultDb = new DbLinkSelectorListVO(); + defaultDb.setFullName(""); + defaultDb.setChildren(Collections.singletonList(dbLink)); + list.add(defaultDb); + } + list.addAll(JsonUtil.getJsonToList(trees, DbLinkSelectorListVO.class)); + return ActionResult.success(new ListVO<>(list)); + } + + /** + * 2:列表 + * + * @param page 关键字 + * @return ignore + */ + @GetMapping + @Operation(summary = "获取数据连接列表") + public ActionResult> getList(PaginationDbLink page) { + List data = dblinkService.getList(page); + List userId = data.stream().map(t -> t.getCreatorUserId()).collect(Collectors.toList()); + List lastUserId = data.stream().map(t -> t.getLastModifyUserId()).collect(Collectors.toList()); + List userEntities = userService.getUserName(userId); + List lastUserIdEntities = userService.getUserName(lastUserId); + List typeList = dictionaryDataService.getList(dictionaryTypeService.getInfoByEnCode(DictionaryDataEnum.SYSTEM_DBLINK.getDictionaryTypeId()).getId()); + List jsonToList = JsonUtil.getJsonToList(data, DbLinkListVO.class); + for (DbLinkListVO vo : jsonToList) { + //存在类型的字典对象 + DictionaryDataEntity dataEntity = typeList.stream().filter(t -> t.getEnCode().equals(vo.getDbType())).findFirst().orElse(null); + if (dataEntity != null) { + vo.setDbType(dataEntity.getFullName()); + } else { + vo.setDbType(""); + } + //创建者 + UserEntity creatorUser = userEntities.stream().filter(t -> t.getId().equals(vo.getCreatorUser())).findFirst().orElse(null); + vo.setCreatorUser(creatorUser != null ? creatorUser.getRealName() + "/" + creatorUser.getAccount() : vo.getCreatorUser()); + //修改人 + UserEntity lastModifyUser = lastUserIdEntities.stream().filter(t -> t.getId().equals(vo.getLastModifyUser())).findFirst().orElse(null); + vo.setLastModifyUser(lastModifyUser != null ? lastModifyUser.getRealName() + "/" + lastModifyUser.getAccount() : vo.getLastModifyUser()); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(page, PaginationVO.class); + return ActionResult.page(jsonToList , paginationVO); + } + + /** + * 列表分组 + * + * @param page 查询条件 + * @return 数据源分组列表 + */ + @GetMapping("/getGroup") + @Operation(summary = "获取数据连接列表") + public ActionResult>> getGroup(PaginationDbLink page) { + ActionResult> result = getList(page); + List voList = result.getData().getList(); + // host分组 + Set hostSet = voList.stream().sorted(Comparator.comparing(DbLinkListVO::getHost)) + .map(DbLinkListVO::getHost).collect(Collectors.toSet()); + List> groupList = new ArrayList<>(); + for (String host : hostSet) { + Map groupMap = new HashMap<>(); + groupMap.put("host", host); + groupMap.put("options", voList.stream().filter(vo->vo.getHost().equals(host)).toArray()); + groupList.add(groupMap); + } + return ActionResult.success(groupList); + } + + /** + * 3:单条数据连接 + * + * @param id 主键 + * @return ignore + * @throws DataException ignore + */ + @GetMapping("/{id}") + @Operation(summary = "获取数据连接") + @Parameters({ + @Parameter(name = "id", description = "主键") + }) + @SaCheckPermission("systemData.dataSource") + public ActionResult get(@PathVariable("id") String id) throws DataException { + return ActionResult.success(new DbLinkInfoVO().getDbLinkInfoVO(dblinkService.getInfo(XSSEscape.escape(id)))); + } + + /** + * 4:新建数据连接 + * + * @param dbLinkCreUpForm 新建数据连接表单对象 + * @return ignore + */ + @PostMapping + @Operation(summary = "添加数据连接") + @Parameters({ + @Parameter(name = "dbLinkCreUpForm", description = "新建数据连接表单对象", required = true) + }) + @SaCheckPermission("systemData.dataSource") + public ActionResult create(@RequestBody @Valid DbLinkCreUpForm dbLinkCreUpForm) { + DbLinkEntity entity = dbLinkCreUpForm.getDbLinkEntity(dbLinkCreUpForm); + if (dblinkService.isExistByFullName(entity.getFullName(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + dblinkService.create(entity); + return ActionResult.success("创建成功"); + } + + /** + * 5:更新数据连接 + * + * @param id 主键 + * @param dbLinkCreUpForm dto实体 + * @return ignore + */ + @PutMapping("/{id}") + @Operation(summary = "修改数据连接") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "dbLinkCreUpForm", description = "新建数据连接表单对象", required = true) + }) + @SaCheckPermission("systemData.dataSource") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid DbLinkCreUpForm dbLinkCreUpForm) { + id = XSSEscape.escape(id); + DbLinkEntity entity = dbLinkCreUpForm.getDbLinkEntity(dbLinkCreUpForm); + if (dblinkService.isExistByFullName(entity.getFullName(), id)) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (!dblinkService.update(id, entity)) { + return ActionResult.fail(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 6:删除 + * + * @param id 主键 + * @return ignore + */ + @DeleteMapping("/{id}") + @Operation(summary = "删除数据连接") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("systemData.dataSource") + public ActionResult delete(@PathVariable("id") String id) { + DbLinkEntity entity = dblinkService.getInfo(id); + if (entity != null) { + dblinkService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + /** + * 7:测试连接 + * + * @param dbLinkBaseForm 数据连接参数 + * @return ignore + * @throws DataException ignore + */ + @PostMapping("/Actions/Test") + @Operation(summary = "测试连接") + @Parameters({ + @Parameter(name = "dbLinkBaseForm", description = "数据连接参数", required = true) + }) + @SaCheckPermission("systemData.dataSource") + public ActionResult test(@RequestBody DbLinkBaseForm dbLinkBaseForm) throws Exception { + boolean data = dblinkService.testDbConnection(dbLinkBaseForm.getDbLinkEntity(dbLinkBaseForm)); + if (data) { + return ActionResult.success("连接成功"); + } else { + return ActionResult.fail("连接失败"); + } + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/DbSyncController.java b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/DbSyncController.java new file mode 100644 index 0000000..96d6ba3 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/DbSyncController.java @@ -0,0 +1,293 @@ +package jnpf.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import com.alibaba.fastjson.JSONObject; +import com.google.common.collect.ImmutableMap; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.model.dbsync.DbSyncForm; +import jnpf.base.model.dbsync.DbSyncPrintForm; +import jnpf.base.model.dbsync.DbSyncVo; +import jnpf.base.service.DbLinkService; +import jnpf.base.service.DbSyncService; +import jnpf.base.service.DbTableService; +import jnpf.database.datatype.db.interfaces.DtInterface; +import jnpf.database.datatype.sync.util.DtSyncUtil; +import jnpf.database.model.dbfield.DbFieldModel; +import jnpf.database.model.dto.PrepSqlDTO; +import jnpf.database.model.entity.DbLinkEntity; +import jnpf.database.source.impl.DbOracle; +import jnpf.database.sql.model.SqlPrintHandler; +import jnpf.database.sql.param.FormatSqlOracle; +import jnpf.database.sql.param.base.FormatSql; +import jnpf.database.sql.util.SqlFastUtil; +import jnpf.database.util.DataSourceUtil; +import jnpf.database.util.TenantDataSourceUtil; +import jnpf.exception.DataException; +import jnpf.util.data.DataSourceContextHolder; +import lombok.Cleanup; +import lombok.Data; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.io.File; +import java.sql.Connection; +import java.util.*; + +/** + * 数据同步 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Tag(name = "数据同步", description = "DataSync") +@RestController +@RequestMapping("/api/system/DataSync") +public class DbSyncController { + + @Autowired + private DbSyncService dbSyncService; + @Autowired + private DbLinkService dblinkService; + @Autowired + private DbTableService dbTableService; + @Autowired + private SqlPrintHandler sqlPrintHandler; + @Autowired + private DataSourceUtil dataSourceUtil; + + /** + * 验证连接 + * + * @param dbSyncForm 页面参数 + * @return + * @throws Exception + */ + @PostMapping("Actions/checkDbLink") + @Parameters({ + @Parameter(name = "dbSyncForm", description = "页面参数", required = true) + }) + @SaCheckPermission("systemData.dataSync") + @Operation(summary = "验证连接") + public ActionResult checkDbLink(@RequestBody DbSyncForm dbSyncForm) throws Exception { + String fromDbType; + String toDbType; + DbSyncVo vo = new DbSyncVo(); + try { + DbLinkEntity dbLinkEntity = dblinkService.getResource(dbSyncForm.getDbConnectionFrom()); + DbLinkEntity dbLinkEntity1 = dblinkService.getResource(dbSyncForm.getDbConnectionTo()); + fromDbType = dbLinkEntity.getDbType(); + toDbType = dbLinkEntity1.getDbType(); + @Cleanup Connection conn = PrepSqlDTO.getConn(dbLinkEntity); + @Cleanup Connection conn1 = PrepSqlDTO.getConn(dbLinkEntity1); + if (conn.getMetaData().getURL().equals(conn1.getMetaData().getURL())) { + return ActionResult.fail("数据库连接不能相同"); + } + vo.setCheckDbFlag(true); + vo.setTableList(SqlFastUtil.getTableList(dbLinkEntity, null)); + // 字段类型全部对应关系 + Map> ruleMap = getConvertRules(fromDbType, toDbType).getData(); + Map defaultRuleMap = getDefaultRules(fromDbType, toDbType).getData(); + // 默认类型置顶 + for (String key : defaultRuleMap.keySet()) { + List list = ruleMap.get(key); + if(list != null){ + String rule = defaultRuleMap.get(key); + list.remove(rule); + list.add(0, rule + " (默认)"); + ruleMap.put(key, list); + } + } + vo.setConvertRuleMap(ruleMap); + }catch (Exception e){ + return ActionResult.fail("数据库连接失败"); + } + return ActionResult.success(vo); + } + + /** + * 执行数据同步 + * + * @param dbSyncForm 数据同步参数 + * @return ignore + * @throws Exception ignore + */ + @PostMapping + @Operation(summary = "数据同步校验") + @Parameters({ + @Parameter(name = "dbSyncForm", description = "页面参数", required = true) + }) + @SaCheckPermission("systemData.dataSync") + public ActionResult checkExecute(@RequestBody DbSyncForm dbSyncForm) throws Exception { + int status; + try { + status = dbSyncService.executeCheck(dbSyncForm.getDbConnectionFrom(), dbSyncForm.getDbConnectionTo(), dbSyncForm.getConvertRuleMap(), dbSyncForm.getDbTable()); + } catch (Exception e) { + e.printStackTrace(); + return ActionResult.fail(e.getMessage()); + } + if (status == -1) { + return ActionResult.fail("请检查,同一数据库下无法同步数据"); + } + return ActionResult.success(status); + } + + /** + * 执行数据同步 + * + * @param dbSyncForm 数据同步参数 + * @return ignore + * @throws Exception ignore + */ + @PostMapping("Actions/Execute") + @Operation(summary = "执行数据同步") + @Parameters({ + @Parameter(name = "dbSyncForm", description = "页面参数", required = true) + }) + @SaCheckPermission("systemData.dataSync") + public ActionResult execute(@RequestBody DbSyncForm dbSyncForm) { + try{ + dbSyncService.execute(dbSyncForm.getDbConnectionFrom(), dbSyncForm.getDbConnectionTo(), dbSyncForm.getConvertRuleMap(), dbSyncForm.getDbTable()); + }catch (Exception e){ + e.printStackTrace(); + return ActionResult.fail("同步失败:" + e.getMessage()); + } + return ActionResult.success("成功"); + } + + /** + * 批量执行数据同步 + * + * @param dbSyncForm 数据同步参数 + * @return ignore + * @throws Exception ignore + */ + @PostMapping("Actions/batchExecute") + @Operation(summary = "批量执行数据同步") + @Parameters({ + @Parameter(name = "dbSyncForm", description = "页面参数", required = true) + }) + @SaCheckPermission("systemData.dataSync") + public ActionResult> executeBatch(@RequestBody DbSyncForm dbSyncForm) { + Map result = dbSyncService.executeBatch(dbSyncForm.getDbConnectionFrom(), dbSyncForm.getDbConnectionTo(), dbSyncForm.getConvertRuleMap(), dbSyncForm.getDbTableList()); + return ActionResult.success("操作成功", result); + } + + /** + * 获取数据类型默认转换规则 + * 一对一 + * @param fromDbType 被转换数据库类型 + * @param toDbType 转换数据库类型 + * @return 转换规则 + * @throws Exception 未找到数库 + */ + @GetMapping("Actions/getDefaultRules") + @SaCheckPermission("systemData.dataSync") + @Operation(summary = "获取一对一数据类型默认转换规则") + public static ActionResult> getDefaultRules(String fromDbType, String toDbType) throws Exception{ + Map map = new LinkedHashMap<>(); + for (DtInterface dtInterface : DtInterface.getClz(fromDbType).getEnumConstants()) { + DtInterface toFixCovert = DtSyncUtil.getToFixCovert(dtInterface, toDbType); + if(toFixCovert != null){ + map.put(dtInterface.getDataType(), toFixCovert.getDataType()); + } + } + return ActionResult.success(map); + } + + /** + * 获取数据类型转换规则 + * 一对多 + * @param fromDbType 被转换数据库类型 + * @param toDbType 转换数据库类型 + * @return 转换规则 + * @throws Exception 未找到数库 + */ + @GetMapping("Actions/getConvertRules") + @SaCheckPermission("systemData.dataSync") + @Operation(summary = "获取一对多数据类型转换规则") + public static ActionResult>> getConvertRules(String fromDbType, String toDbType) throws Exception{ + Map> map = new LinkedHashMap<>(); + for (DtInterface dtInterface : DtInterface.getClz(fromDbType).getEnumConstants()) { + List list = new LinkedList<>(); + DtInterface[] allConverts = DtSyncUtil.getAllConverts(dtInterface, toDbType); + if(allConverts != null){ + for (DtInterface allConvert : allConverts) { + list.add(allConvert.getDataType()); + } + map.put(dtInterface.getDataType(), list); + } + } + return ActionResult.success(map); + } + + /* ===================================== SQL转换项目 ======================================= */ + + /** + * 打印转换SQL + * + * @param form 参数表单 + */ + @PostMapping("Actions/print") + @Operation(summary = "打印同步表") + public ActionResult print(@RequestBody DbSyncPrintForm form) throws Exception{ + PrintFunction func = ()-> dbSyncService.printDbInit(form.getDbLinkFrom(), form.getDbTypeTo(), + form.getDbTableList(), form.getConvertRuleMap(), form.getPrintType()); + return ActionResult.success(printCommon(form, form.getPrintType(), func)); + } + + @FunctionalInterface + public interface PrintFunction { + Object execute() throws Exception; + } + + private Object printCommon(DbSyncPrintForm form, String printType, PrintFunction func) throws Exception { + sqlPrintHandler.start(form.getOutPath(), true, true, true, form.getDbTypeTo()); + boolean flag = new File(form.getOutPath()).mkdir(); + sqlPrintHandler.setFileName(form.getOutFileName()); + Object obj = func.execute(); + sqlPrintHandler.print(); + sqlPrintHandler.close(); + SqlPrintHandler.openDirectory(new File(form.getOutPath()).getPath()); + return obj; + } + + /** + * 数据类型转换 + * + * @param dataType 数据类型 例如:varchar(50) + * @param fromDbEncode 源数据库类型 + * @param toDbEncode 目标数据库类型 + */ + @GetMapping("getConvertDataType") + @Operation(summary = "数据类型转换") + public String getConvertDataType(String dataType, String dtLength, String fromDbEncode, String toDbEncode) throws Exception{ + DbFieldModel dbFieldModel = new DbFieldModel(); + dbFieldModel.setLength(dtLength); + DtInterface toFixCovert = DtSyncUtil.getToFixCovert(DtInterface.newInstanceByDt(dataType, fromDbEncode), toDbEncode); + dbFieldModel.setDataType(toFixCovert.getDataType()); + return dbFieldModel.formatDataTypeByView(toDbEncode); + } + + @PostMapping("formatOracleValue") + @Operation(summary = "格式化SQL语句中的Oracle值") + public String getConvertDataType(@RequestBody String data) throws Exception{ + Map json = JSONObject.parseObject(data).getInnerMap(); + // 指定F_Id为主键 + Map dataMap = JSONObject.parseObject(json.get("dataMap").toString()).getInnerMap(); + // 特殊处理:存在值超过2000的字符 + StringBuilder valStrBuilder = new StringBuilder(); + String context = FormatSqlOracle.clobExecute(DbOracle.ORACLE, json.get("valueStr"), + json.get("table").toString(), json.get("column").toString(), dataMap, valStrBuilder).toString(); + return valStrBuilder.toString(); + } + + + + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/DbTableController.java b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/DbTableController.java new file mode 100644 index 0000000..a938244 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/DbTableController.java @@ -0,0 +1,400 @@ +package jnpf.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import com.alibaba.fastjson.JSONObject; +import com.google.common.base.CaseFormat; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.Page; +import jnpf.base.Pagination; +import jnpf.base.model.dbtable.dto.DbTableFieldDTO; +import jnpf.base.model.dbtable.vo.DbFieldVO; +import jnpf.base.model.dbtable.vo.DbTableInfoVO; +import jnpf.base.model.dbtable.vo.DbTableListVO; +import jnpf.base.service.DbTableService; +import jnpf.base.vo.DownloadVO; +import jnpf.base.vo.ListVO; +import jnpf.base.vo.PageListVO; +import jnpf.base.vo.PaginationVO; +import jnpf.config.ConfigValueUtil; +import jnpf.constant.MsgCode; +import jnpf.database.datatype.model.DtModelDTO; +import jnpf.database.model.dbfield.DbFieldModel; +import jnpf.database.model.dbtable.DbTableFieldModel; +import jnpf.database.model.page.DbTableDataForm; +import jnpf.exception.DataException; +import jnpf.base.entity.PrintDevEntity; +import jnpf.util.*; +import jnpf.emnus.ModuleTypeEnum; +import jnpf.util.FileExport; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import java.util.List; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +/** + * 数据建模 + * N:方法说明 - 微服务同步使用 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Tag(name = "数据建模", description = "DataModel") +@RestController +@RequestMapping("/api/system/DataModel") +@Slf4j +public class DbTableController { + + @Autowired + private DbTableService dbTableService; + @Autowired + private FileExport fileExport; + @Autowired + private ConfigValueUtil configValueUtil; + + /** + * 1:列表 + * + * @param id 连接id + * @param pagination 关键词 + * @return 数据库表列表 + * @throws DataException ignore + */ + @Operation(summary = "获取数据库表列表") + @Parameters({ + @Parameter(name = "id", description = "连接id", required = true) + }) + @GetMapping("/{id}/Tables") + public ActionResult> getList(@PathVariable("id") String id, Pagination pagination) throws Exception { + try { + List tableList = dbTableService.getListPage(XSSEscape.escape(id), pagination); + return ActionResult.success(new DbTableListVO<>(tableList, JsonUtil.getJsonToBean(pagination, PaginationVO.class))); + } catch (Exception e) { + throw new DataException("数据库连接失败"); + } + } + + /** + * 1:列表 + * + * @param id 连接id + * @param page 关键字 + * @return 数据库表列表 + * @throws DataException ignore + */ + @Operation(summary = "获取数据库表列表") + @Parameters({ + @Parameter(name = "id", description = "连接id", required = true) + }) + @GetMapping("/{id}/TableAll") + public ActionResult> getList(@PathVariable("id") String id, Page page) throws Exception { + List tableList = dbTableService.getListPage(XSSEscape.escape(id), page); + ListVO list = new ListVO<>(); + list.setList(tableList); + return ActionResult.success(list); + } + + /** + * 2:预览数据库表 + * + * @param dbTableDataForm 查询条件 + * @param linkId 接Id + * @param tableName 表名 + * @return 数据库表 + * @throws Exception ignore + */ + @Operation(summary = "预览数据库表") + @Parameters({ + @Parameter(name = "linkId", description = "数据连接ID", required = true), + @Parameter(name = "tableName", description = "表名", required = true) + }) + @SaCheckPermission("systemData.dataModel") + @GetMapping("/{linkId}/Table/{tableName}/Preview") + public ActionResult>> data(DbTableDataForm dbTableDataForm, @PathVariable("linkId") String linkId, @PathVariable("tableName") String tableName) throws Exception { + String escape = XSSEscape.escape(linkId); + String escapeTableName = XSSEscape.escape(tableName); + List> data = dbTableService.getData(dbTableDataForm, escape, escapeTableName); + PaginationVO paginationVO = JsonUtilEx.getJsonToBeanEx(dbTableDataForm, PaginationVO.class); + return ActionResult.page(data, paginationVO); + } + + /** + * 3:列表 + * + * @param linkId 数据连接ID + * @param tableName 表名 + * @return 列表 + * @throws DataException ignore + */ + @GetMapping("/{linkId}/Tables/{tableName}/Fields/Selector") + @Operation(summary = "获取数据库表字段下拉框列表") + @Parameters({ + @Parameter(name = "linkId", description = "数据连接ID", required = true), + @Parameter(name = "tableName", description = "表名", required = true) + }) + public ActionResult> selectorList(@PathVariable("linkId") String linkId, @PathVariable("tableName") String tableName) throws Exception { + List data = dbTableService.getFieldList(linkId, tableName); + List vos = JsonUtil.getJsonToList(data, DbFieldVO.class); + ListVO vo = new ListVO<>(); + vo.setList(vos); + return ActionResult.success(vo); + } + + /** + * 4:字段列表 + * + * @param linkId 连接Id + * @param tableName 表名 + * @param type 类型 + * @return 段列表 + * @throws DataException ignore + */ + @Operation(summary = "获取数据库表字段列表") + @Parameters({ + @Parameter(name = "linkId", description = "数据连接ID", required = true), + @Parameter(name = "tableName", description = "表名", required = true), + @Parameter(name = "type", description = "类型") + }) + @GetMapping("/{linkId}/Tables/{tableName}/Fields") + public ActionResult> fieldList(@PathVariable("linkId") String linkId, @PathVariable("tableName") String tableName, String type) throws Exception { + List data = dbTableService.getFieldList(linkId, tableName); + List voList = data.stream().map(DbFieldVO::new).collect(Collectors.toList()); + for (DbFieldVO vo : voList) { + String columnName = vo.getField(); + if ("1".equals(type)) { + String name = vo.getField().toLowerCase().replaceAll("f_", ""); + vo.setField(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, name)); + } + vo.setColumnName(columnName); + } + ListVO vo = new ListVO<>(); + vo.setList(voList); + return ActionResult.success(vo); + } + + /** + * 5:编辑显示 - 表、字段信息 + * + * @param dbLinkId 连接Id + * @param tableName 表名 + * @return 表、字段信息 + * @throws DataException ignore + */ + @Operation(summary = "获取表及表字段信息") + @Parameters({ + @Parameter(name = "dbLinkId", description = "数据连接ID", required = true), + @Parameter(name = "tableName", description = "表名", required = true) + }) + @SaCheckPermission("systemData.dataModel") + @GetMapping("/{dbLinkId}/Table/{tableName}") + public ActionResult get(@PathVariable("dbLinkId") String dbLinkId, @PathVariable("tableName") String tableName) throws Exception { + return ActionResult.success(new DbTableInfoVO(dbTableService.getTable(dbLinkId, tableName), dbTableService.getFieldList(dbLinkId, tableName))); + } + + /** + * 6:新建表 + * + * @param linkId 连接Id + * @return 执行结果 + * @throws DataException ignore + */ + @Operation(summary = "新建") + @Parameters({ + @Parameter(name = "linkId", description = "数据连接ID", required = true), + @Parameter(name = "dbTableFieldDTO", description = "建表参数对象", required = true) + }) + @SaCheckPermission("systemData.dataModel") + @PostMapping("{linkId}/Table") + public ActionResult create(@PathVariable("linkId") String linkId, @RequestBody @Valid DbTableFieldDTO dbTableFieldDTO) throws Exception { + try{ + int status = dbTableService.createTable(dbTableFieldDTO.getCreDbTableModel(linkId)); + if (status == 1) { + return ActionResult.success(MsgCode.SU001.get()); + } else if (status == 0) { + return ActionResult.fail("表名称不能重复"); + } else { + return ActionResult.fail("添加失败"); + } + }catch (Exception e){ + return ActionResult.fail(e.getMessage()); + } + } + + /** + * 7:更新 + * + * @param linkId 连接Id + * @return 执行结果 + * @throws DataException ignore + */ + @Operation(summary = "更新") + @Parameters({ + @Parameter(name = "linkId", description = "数据连接ID", required = true), + @Parameter(name = "dbTableFieldDTO", description = "建表参数对象", required = true) + }) + @SaCheckPermission("systemData.dataModel") + @PutMapping("/{linkId}/Table") + public ActionResult update(@PathVariable("linkId") String linkId, @RequestBody @Valid DbTableFieldDTO dbTableFieldDTO) throws Exception { + DbTableFieldModel dbTableModel = dbTableFieldDTO.getUpDbTableModel(linkId); + // 当修改表名时,验证是否与其他表名重名 + if(!dbTableModel.getUpdateNewTable().equals(dbTableModel.getUpdateOldTable())){ + if(dbTableService.isExistTable(linkId, dbTableModel.getUpdateNewTable())){ + return ActionResult.fail("表名称不能重复"); + } + } + try{ + dbTableService.update(dbTableModel); + return ActionResult.success(MsgCode.SU004.get()); + }catch (Exception e){ + return ActionResult.fail(e.getMessage()); + } + } + + /** + * 8:更新 + * + * @param linkId 连接Id + * @return 执行结果 + * @throws DataException ignore + */ + @Operation(summary = "添加字段") + @Parameters({ + @Parameter(name = "linkId", description = "数据连接ID", required = true), + @Parameter(name = "dbTableFieldDTO", description = "建表参数对象", required = true) + }) + @SaCheckPermission("systemData.dataModel") + @PutMapping("/{linkId}/addFields") + public ActionResult addField(@PathVariable("linkId") String linkId, @RequestBody @Valid DbTableFieldDTO dbTableFieldDTO) throws Exception { + DbTableFieldModel dbTableModel = dbTableFieldDTO.getUpDbTableModel(linkId); + dbTableService.addField(dbTableModel); + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 9:删除 + * + * @param linkId 连接Id + * @param tableName 表名 + * @return 执行结果 + * @throws DataException ignore + */ + @Operation(summary = "删除") + @Parameters({ + @Parameter(name = "linkId", description = "数据连接ID", required = true), + @Parameter(name = "tableName", description = "表名", required = true) + }) + @SaCheckPermission("systemData.dataModel") + @DeleteMapping("/{linkId}/Table/{tableName}") + public ActionResult delete(@PathVariable("linkId") String linkId, @PathVariable("tableName") String tableName) throws Exception { + dbTableService.delete(linkId, tableName); + return ActionResult.success(MsgCode.SU003.get()); + } + + /** + * 删除全部表(慎用) + * + * @param linkId 连接Id + * @return 执行结果 + * @throws DataException ignore + */ + @Operation(summary = "删除全部表") + @Parameters({ + @Parameter(name = "linkId", description = "数据连接ID", required = true), + }) + @SaCheckPermission("systemData.dataModel") + @DeleteMapping("/{linkId}/deleteAllTable") + public ActionResult deleteAllTable(@PathVariable("linkId") String linkId, String dbType) throws Exception { + dbTableService.deleteAllTable(linkId, dbType); + return ActionResult.success(MsgCode.SU003.get()); + } + + /** + * 10:导入 + * + * @param linkId 连接id + * @param multipartFile 文件 + * @return 执行结果 + * @throws DataException ignore + */ + @Operation(summary = "导入") + @Parameters({ + @Parameter(name = "linkId", description = "数据连接ID", required = true), + }) + @SaCheckPermission("systemData.dataModel") + @PostMapping(value = "/{linkId}/Actions/Import", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public ActionResult> importData(@PathVariable String linkId, @RequestPart("file") MultipartFile multipartFile) throws Exception { + //判断是否为.json结尾 + if (FileUtil.existsSuffix(multipartFile, ModuleTypeEnum.SYSTEM_DBTABLE.getTableName())) { + return ActionResult.fail(MsgCode.IMP002.get()); + } + // 读取文件内容 + String fileContent = FileUtil.getFileContent(multipartFile); + DbTableFieldModel dbTableFieldModel = JSONObject.parseObject(fileContent, DbTableFieldModel.class); + + // 数据类型长度解析(enum枚举无法Json化) + for (DbFieldModel dbFieldModel : dbTableFieldModel.getDbFieldModelList()) { + String formatDataType = dbFieldModel.getLength(); + String dataType = ""; + String dtLength = ""; + if(formatDataType.contains("(")){ + Matcher matcher = Pattern.compile("(.+)\\((.*)\\)").matcher(formatDataType); + if(matcher.find()){ + dataType = matcher.group(1).trim(); + dtLength = matcher.group(2).trim(); + } + }else { + dataType = formatDataType.trim(); + } + dbFieldModel.setDtModelDTO(new DtModelDTO(dataType, dtLength, dbTableFieldModel.getDbEncode(), false) + .setConvertType(DtModelDTO.DB_VAL)); + } + + dbTableFieldModel.setDbLinkId(linkId); + int i = dbTableService.createTable(dbTableFieldModel); + if(i == 1){ + return ActionResult.success(MsgCode.IMP001.get()); + }else { + return ActionResult.fail(MsgCode.DB007.get()); + } + } + + /** + * 11:导出 + * + * @param tableName 表明 + * @param linkId 连接id + * @return 执行结果 + */ + @Operation(summary = "导出") + @Parameters({ + @Parameter(name = "tableName", description = "表明", required = true), + @Parameter(name = "linkId", description = "连接id", required = true) + }) + @SaCheckPermission("systemData.dataModel") + @GetMapping("/{linkId}/Table/{tableName}/Actions/Export") + public ActionResult export(@PathVariable String tableName, @PathVariable String linkId) throws Exception { + DbTableFieldModel dbTable = dbTableService.getDbTableModel(linkId, tableName); + dbTable.getDbFieldModelList().forEach(dbField->{ + dbField.setLength(dbField.getDtModelDTO().convert().formatDataType()); + dbField.setDtModelDTO(null); + }); + //导出文件 + DownloadVO downloadVO = fileExport.exportFile(dbTable, configValueUtil.getTemporaryFilePath(), + dbTable.getTable() + "_", ModuleTypeEnum.SYSTEM_DBTABLE.getTableName()); + return ActionResult.success(downloadVO); + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/DictionaryDataController.java b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/DictionaryDataController.java new file mode 100644 index 0000000..9f33253 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/DictionaryDataController.java @@ -0,0 +1,444 @@ +package jnpf.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import jnpf.base.controller.SuperController; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.model.dictionarytype.DictionaryExportModel; +import jnpf.base.service.DictionaryDataService; +import jnpf.base.service.DictionaryTypeService; +import jnpf.base.vo.DownloadVO; +import jnpf.base.vo.ListVO; +import jnpf.base.entity.DictionaryDataEntity; +import jnpf.base.entity.DictionaryTypeEntity; +import jnpf.config.ConfigValueUtil; +import jnpf.constant.MsgCode; +import jnpf.exception.DataException; +import jnpf.base.model.dictionarydata.*; +import jnpf.base.model.dictionarytype.DictionaryTypeSelectModel; +import jnpf.base.model.dictionarytype.DictionaryTypeSelectVO; +import jnpf.util.FileUtil; +import jnpf.util.JsonUtil; +import jnpf.util.JsonUtilEx; +import jnpf.util.StringUtil; +import jnpf.emnus.ModuleTypeEnum; +import jnpf.util.treeutil.ListToTreeUtil; +import jnpf.util.treeutil.SumTree; +import jnpf.util.treeutil.newtreeutil.TreeDotUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 字典数据 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Tag(name = "数据字典", description = "DictionaryData") +@RestController +@RequestMapping("/api/system/DictionaryData") +public class DictionaryDataController extends SuperController { + + @Autowired + private DictionaryDataService dictionaryDataService; + @Autowired + private DictionaryTypeService dictionaryTypeService; + @Autowired + private ConfigValueUtil configValueUtil; + + /** + * 获取数据字典列表 + * + * @param dictionaryTypeId 数据字典id + * @param pageDictionaryData 分页参数 + * @return ignore + */ + @Operation(summary = "获取数据字典列表") + @Parameters({ + @Parameter(name = "dictionaryTypeId", description = "数据分类id", required = true) + }) + @GetMapping("/{dictionaryTypeId}") + public ActionResult bindDictionary(@PathVariable("dictionaryTypeId") String dictionaryTypeId, PageDictionaryData pageDictionaryData) { + List data = dictionaryDataService.getList(dictionaryTypeId); + List dataAll = data; + if (StringUtil.isNotEmpty(pageDictionaryData.getKeyword())) { + data = data.stream().filter(t -> t.getFullName().contains(pageDictionaryData.getKeyword()) || t.getEnCode().contains(pageDictionaryData.getKeyword())).collect(Collectors.toList()); + } + if (pageDictionaryData.getIsTree() != null && "1".equals(pageDictionaryData.getIsTree())) { + List treeData = JsonUtil.getJsonToList(ListToTreeUtil.treeWhere(data, dataAll), DictionaryDataEntity.class); + List voListVO = JsonUtil.getJsonToList(treeData, DictionaryDataModel.class); + List> sumTrees = TreeDotUtils.convertListToTreeDot(voListVO); + List list = JsonUtil.getJsonToList(sumTrees, DictionaryDataListVO.class); + ListVO treeVo = new ListVO<>(); + treeVo.setList(list); + return ActionResult.success(treeVo); + } + List voListVO = JsonUtil.getJsonToList(data, DictionaryDataModel.class); + ListVO treeVo = new ListVO<>(); + treeVo.setList(voListVO); + return ActionResult.success(treeVo); + } + + + /** + * 获取数据字典列表 + * + * @return ignore + */ + @Operation(summary = "获取数据字典列表(分类+内容)") + @GetMapping("/All") + public ActionResult>> allBindDictionary() { + List dictionaryTypeList = dictionaryTypeService.getList(); + List> list = new ArrayList<>(); + for (DictionaryTypeEntity dictionaryTypeEntity : dictionaryTypeList) { + List childNodeList = dictionaryDataService.getList(dictionaryTypeEntity.getId(), true); + if (dictionaryTypeEntity.getIsTree().compareTo(1) == 0) { + List> selectList = new ArrayList<>(); + for (DictionaryDataEntity item : childNodeList) { + Map ht = new HashMap<>(16); + ht.put("fullName", item.getFullName()); + ht.put("enCode", item.getEnCode()); + ht.put("id", item.getId()); + ht.put("parentId", item.getParentId()); + selectList.add(ht); + } + List jsonToList = JsonUtil.getJsonToList(selectList, DictionaryDataAllModel.class); + //==============转换树 + List> list1 = TreeDotUtils.convertListToTreeDot(jsonToList); + List list2 = JsonUtil.getJsonToList(list1, DictionaryDataAllVO.class); + //============== + Map htItem = new HashMap<>(16); + htItem.put("id", dictionaryTypeEntity.getId()); + htItem.put("enCode", dictionaryTypeEntity.getEnCode()); + htItem.put("dictionaryList", list2); + htItem.put("isTree", 1); + list.add(htItem); + } else { + List> selectList = new ArrayList<>(); + for (DictionaryDataEntity item : childNodeList) { + Map ht = new HashMap<>(16); + ht.put("enCode", item.getEnCode()); + ht.put("id", item.getId()); + ht.put("fullName", item.getFullName()); + selectList.add(ht); + } + Map htItem = new HashMap<>(16); + htItem.put("id", dictionaryTypeEntity.getId()); + htItem.put("enCode", dictionaryTypeEntity.getEnCode()); + htItem.put("dictionaryList", selectList); + htItem.put("isTree", 0); + list.add(htItem); + } + } + ListVO> vo = new ListVO<>(); + vo.setList(list); + return ActionResult.success(vo); + } + + + /** + * 获取数据字典下拉框数据 + * + * @param dictionaryTypeId 类别主键 + * @param isTree 是否为树 + * @param id 主键 + * @return ignore + */ + @Operation(summary = "获取数据字典分类下拉框数据") + @Parameters({ + @Parameter(name = "dictionaryTypeId", description = "数据分类id", required = true), + @Parameter(name = "isTree", description = "是否树形"), + @Parameter(name = "id", description = "主键", required = true) + }) + @GetMapping("{dictionaryTypeId}/Selector/{id}") + public ActionResult> treeView(@PathVariable("dictionaryTypeId") String dictionaryTypeId, String isTree, @PathVariable("id") String id) { + DictionaryTypeEntity typeEntity = dictionaryTypeService.getInfo(dictionaryTypeId); + List treeList = new ArrayList<>(); + DictionaryDataModel treeViewModel = new DictionaryDataModel(); + treeViewModel.setId("0"); + treeViewModel.setFullName(typeEntity.getFullName()); + treeViewModel.setParentId("-1"); + treeViewModel.setIcon("fa fa-tags"); + treeList.add(treeViewModel); + if ("1".equals(isTree)) { + List data = dictionaryDataService.getList(dictionaryTypeId).stream().filter(t -> "1".equals(String.valueOf(t.getEnabledMark()))).collect(Collectors.toList()); + //过滤子集 + if (!"0".equals(id)) { + data.remove(dictionaryDataService.getInfo(id)); + } + for (DictionaryDataEntity entity : data) { + DictionaryDataModel treeModel = new DictionaryDataModel(); + treeModel.setId(entity.getId()); + treeModel.setFullName(entity.getFullName()); + treeModel.setParentId("-1".equals(entity.getParentId()) ? entity.getDictionaryTypeId() : entity.getParentId()); + treeList.add(treeModel); + } + } + List> sumTrees = TreeDotUtils.convertListToTreeDotFilter(treeList); + List list = JsonUtil.getJsonToList(sumTrees, DictionaryDataSelectVO.class); + ListVO treeVo = new ListVO<>(); + treeVo.setList(list); + return ActionResult.success(treeVo); + } + + /** + * 获取字典分类 + * + * @param dictionaryTypeId 分类id、分类编码 + * @return ignore + */ + @Operation(summary = "获取某个字典数据下拉框列表") + @Parameters({ + @Parameter(name = "dictionaryTypeId", description = "数据分类id", required = true) + }) + @GetMapping("/{dictionaryTypeId}/Data/Selector") + public ActionResult> selectorOneTreeView(@PathVariable("dictionaryTypeId") String dictionaryTypeId) { + List data = dictionaryDataService.getList(dictionaryTypeId, true); + if(data.isEmpty()){ + DictionaryTypeEntity typeEntity = dictionaryTypeService.getInfoByEnCode(dictionaryTypeId); + if(typeEntity != null){ + data = dictionaryDataService.getList(typeEntity.getId(), true); + } + + } + List voListVO = JsonUtil.getJsonToList(data, DictionaryTypeSelectModel.class); + List> sumTrees = TreeDotUtils.convertListToTreeDot(voListVO); + List list = JsonUtil.getJsonToList(sumTrees, DictionaryTypeSelectVO.class); + ListVO vo = new ListVO<>(); + vo.setList(list); + return ActionResult.success(vo); + } + + /** + * 获取数据字典信息 + * + * @param id 主键 + * @return ignore + * @throws DataException ignore + */ + @Operation(summary = "获取数据字典信息") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @GetMapping("/{id}/Info") + public ActionResult info(@PathVariable("id") String id) throws DataException { + DictionaryDataEntity entity = dictionaryDataService.getInfo(id); + DictionaryDataInfoVO vo = JsonUtilEx.getJsonToBeanEx(entity, DictionaryDataInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 重复验证(名称) + * + * @param dictionaryTypeId 类别主键 + * @param fullName 名称 + * @param id 主键值 + * @return ignore + */ + @Operation(summary = "(待定)重复验证(名称)") + @GetMapping("/IsExistByFullName") + public ActionResult isExistByFullName(String dictionaryTypeId, String fullName, String id) { + boolean data = dictionaryDataService.isExistByFullName(dictionaryTypeId, fullName, id); + return ActionResult.success(data); + } + + /** + * 重复验证(编码) + * + * @param dictionaryTypeId 类别主键 + * @param enCode 编码 + * @param id 主键值 + * @return ignore + */ + @Operation(summary = "(待定)重复验证(编码)") + @GetMapping("/IsExistByEnCode") + public ActionResult isExistByEnCode(String dictionaryTypeId, String enCode, String id) { + boolean data = dictionaryDataService.isExistByEnCode(dictionaryTypeId, enCode, id); + return ActionResult.success(data); + } + + + /** + * 添加数据字典 + * + * @param dictionaryDataCrForm 实体对象 + * @return ignore + */ + @Operation(summary = "添加数据字典") + @Parameters({ + @Parameter(name = "dictionaryDataCrForm", description = "实体对象", required = true) + }) + @SaCheckPermission("systemData.dictionary") + @PostMapping + public ActionResult create(@RequestBody @Valid DictionaryDataCrForm dictionaryDataCrForm) { + DictionaryDataEntity entity = JsonUtil.getJsonToBean(dictionaryDataCrForm, DictionaryDataEntity.class); + if (dictionaryDataService.isExistByFullName(entity.getDictionaryTypeId(), entity.getFullName(), entity.getId())) { + return ActionResult.fail("字典名称不能重复"); + } + if (dictionaryDataService.isExistByEnCode(entity.getDictionaryTypeId(), entity.getEnCode(), entity.getId())) { + return ActionResult.fail("字典编码不能重复"); + } + dictionaryDataService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 修改数据字典 + * + * @param id 主键值 + * @param dictionaryDataUpForm 实体对象 + * @return ignore + */ + @Operation(summary = "修改数据字典") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true), + @Parameter(name = "dictionaryDataUpForm", description = "实体对象", required = true) + }) + @SaCheckPermission("systemData.dictionary") + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid DictionaryDataUpForm dictionaryDataUpForm) { + DictionaryDataEntity entity = JsonUtil.getJsonToBean(dictionaryDataUpForm, DictionaryDataEntity.class); + if (dictionaryDataService.isExistByFullName(entity.getDictionaryTypeId(), entity.getFullName(), id)) { + return ActionResult.fail("字典名称不能重复"); + } + if (dictionaryDataService.isExistByEnCode(entity.getDictionaryTypeId(), entity.getEnCode(), id)) { + return ActionResult.fail("字典编码不能重复"); + } + boolean flag = dictionaryDataService.update(id, entity); + if (!flag) { + return ActionResult.fail(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + + } + + /** + * 删除数据字典 + * + * @param id 主键值 + * @return ignore + */ + @Operation(summary = "删除数据字典") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("systemData.dictionary") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + DictionaryDataEntity entity = dictionaryDataService.getInfo(id); + if (entity != null) { + if (dictionaryDataService.isExistSubset(entity.getId())) { + return ActionResult.fail("字典类型下面有字典值禁止删除"); + } + dictionaryDataService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + /** + * 更新字典状态 + * + * @param id 主键值 + * @return ignore + */ + @Operation(summary = "更新字典状态") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("systemData.dictionary") + @PutMapping("/{id}/Actions/State") + public ActionResult update(@PathVariable("id") String id) { + DictionaryDataEntity entity = dictionaryDataService.getInfo(id); + if (entity != null) { + if ("1".equals(String.valueOf(entity.getEnabledMark()))) { + entity.setEnabledMark(0); + } else { + entity.setEnabledMark(1); + } + boolean flag = dictionaryDataService.update(entity.getId(), entity); + if (!flag) { + return ActionResult.success(MsgCode.FA002.get()); + } + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 数据字典导出功能 + * + * @param id 接口id + * @return ignore + */ + @Operation(summary = "导出数据字典数据") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("systemData.dictionary") + @GetMapping("/{id}/Actions/Export") + public ActionResult exportFile(@PathVariable("id") String id) { + DownloadVO downloadVO = dictionaryDataService.exportData(id); + return ActionResult.success(downloadVO); + } + + /** + * 数据字典导入功能 + * + * @param multipartFile 文件 + * @return ignore + * @throws DataException ignore + */ + @Operation(summary = "数据字典导入功能") + @SaCheckPermission("systemData.dictionary") + @PostMapping(value = "/Actions/Import", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public ActionResult importFile(@RequestPart("file") MultipartFile multipartFile) throws DataException { + //判断是否为.json结尾 + if (FileUtil.existsSuffix(multipartFile, ModuleTypeEnum.SYSTEM_DICTIONARYDATA.getTableName())) { + return ActionResult.fail(MsgCode.IMP002.get()); + } + //获取文件内容 + String fileContent = FileUtil.getFileContent(multipartFile); + try { + DictionaryExportModel exportModel = JsonUtil.getJsonToBean(fileContent, DictionaryExportModel.class); + List list = exportModel.getList(); + //父级分类id不存在的话,直接抛出异常 + //如果分类只有一个 + if (list.size() == 1 && !"-1".equals(list.get(0).getParentId()) && dictionaryTypeService.getInfo(list.get(0).getParentId()) == null) { + return ActionResult.fail("导入失败,查询不到上级分类"); + } + //如果有多个需要验证分类是否存在 + if (list.stream().filter(t -> "-1".equals(t.getParentId())).count() < 1) { + boolean exist = false; + for (DictionaryTypeEntity dictionaryTypeEntity : list) { + //判断父级是否存在 + if (dictionaryTypeService.getInfo(dictionaryTypeEntity.getParentId()) != null) { + exist = true; + } + } + if (!exist) { + return ActionResult.fail("导入失败,查询不到上级分类"); + } + } + //判断数据是否存在 + boolean isExists = dictionaryDataService.importData(exportModel); + if (isExists) { + return ActionResult.fail(MsgCode.IMP003.get()); + } + } catch (Exception e) { + throw new DataException(MsgCode.IMP004.get()); + } + return ActionResult.success(MsgCode.IMP001.get()); + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/DictionaryTypeController.java b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/DictionaryTypeController.java new file mode 100644 index 0000000..641879b --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/DictionaryTypeController.java @@ -0,0 +1,264 @@ +package jnpf.base.controller; + + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import jnpf.base.Page; +import jnpf.base.controller.SuperController; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.exception.DataException; +import jnpf.util.JsonUtil; +import jnpf.base.ActionResult; +import jnpf.base.vo.ListVO; +import jnpf.base.model.dictionarytype.*; +import jnpf.base.entity.DictionaryTypeEntity; +import jnpf.base.service.DictionaryTypeService; +import jnpf.util.RandomUtil; +import jnpf.util.StringUtil; +import jnpf.util.treeutil.SumTree; +import jnpf.util.treeutil.TreeDotUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 字典分类 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月27日 上午9:18 + */ +@Tag(name = "数据字典分类", description = "DictionaryType") +@RestController +@RequestMapping("/api/system/DictionaryType") +public class DictionaryTypeController extends SuperController { + + @Autowired + private DictionaryTypeService dictionaryTypeService; + + /** + * 获取字典分类 + * + * @return + */ + @Operation(summary = "获取字典分类") + @GetMapping + public ActionResult> list() { + List data = dictionaryTypeService.getList(); + List voListVO = JsonUtil.getJsonToList(data, DictionaryTypeModel.class); + voListVO.forEach(vo -> { + if (StringUtil.isNotEmpty(vo.getCategory()) && "1".equals(vo.getCategory()) && "-1".equals(vo.getParentId())) { + vo.setCategory("系统"); + vo.setParentId("1"); + } else if (StringUtil.isNotEmpty(vo.getCategory()) && "0".equals(vo.getCategory()) && "-1".equals(vo.getParentId())) { + vo.setCategory("业务"); + vo.setParentId("0"); + } + }); + List> sumTrees = TreeDotUtils.convertListToTreeDot(voListVO); + List list = JsonUtil.getJsonToList(sumTrees, DictionaryTypeListVO.class); + + DictionaryTypeListVO parentVO = new DictionaryTypeListVO(); + parentVO.setFullName("系统字典"); + parentVO.setChildren(new ArrayList<>()); + parentVO.setId("1"); + DictionaryTypeListVO parentVO1 = new DictionaryTypeListVO(); + parentVO1.setFullName("业务字典"); + parentVO1.setChildren(new ArrayList<>()); + parentVO1.setId("0"); + + list.forEach(vo -> { + if ("系统".equals(vo.getCategory())) { + List children = parentVO.getChildren(); + children.add(vo); + parentVO.setHasChildren(true); + }else { + List children = parentVO1.getChildren(); + children.add(vo); + parentVO1.setHasChildren(true); + } + }); + List listVo = new ArrayList<>(); + listVo.add(parentVO1); + listVo.add(parentVO); + + ListVO vo = new ListVO<>(); + vo.setList(listVo); + return ActionResult.success(vo); + } + + + /** + * 获取字典分类 + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取所有字典分类下拉框列表") + @Parameter(name = "id", description = "主键", required = true) + @GetMapping("/Selector/{id}") + public ActionResult> selectorTreeView(@PathVariable("id") String id) { + List data = dictionaryTypeService.getList(); + if (!"0".equals(id)) { + data.remove(dictionaryTypeService.getInfo(id)); + } + List voListVO = JsonUtil.getJsonToList(data, DictionaryTypeModel.class); + voListVO.forEach(vo -> { + if (StringUtil.isNotEmpty(vo.getCategory()) && "1".equals(vo.getCategory()) && "-1".equals(vo.getParentId())) { + vo.setCategory("系统"); + vo.setParentId("1"); + } else if (StringUtil.isNotEmpty(vo.getCategory()) && "0".equals(vo.getCategory()) && "-1".equals(vo.getParentId())) { + vo.setCategory("业务"); + vo.setParentId("0"); + } + }); + List> sumTrees = TreeDotUtils.convertListToTreeDot(voListVO); + List list = JsonUtil.getJsonToList(sumTrees, DictionaryTypeListVO.class); + + DictionaryTypeListVO parentVO = new DictionaryTypeListVO(); + parentVO.setFullName("系统字典"); + parentVO.setChildren(new ArrayList<>()); + parentVO.setId("1"); + DictionaryTypeListVO parentVO1 = new DictionaryTypeListVO(); + parentVO1.setFullName("业务字典"); + parentVO1.setChildren(new ArrayList<>()); + parentVO1.setId("0"); + + list.forEach(vo -> { + if ("系统".equals(vo.getCategory())) { + List children = parentVO.getChildren(); + children.add(vo); + parentVO.setHasChildren(true); + }else { + List children = parentVO1.getChildren(); + children.add(vo); + parentVO1.setHasChildren(true); + } + }); + List listVo = new ArrayList<>(); + listVo.add(parentVO1); + listVo.add(parentVO); + + ListVO vo = new ListVO<>(); + vo.setList(listVo); + return ActionResult.success(vo); + } + + /** + * 获取字典分类信息 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "获取字典分类信息") + @Parameter(name = "id", description = "主键", required = true) + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) throws DataException { + DictionaryTypeEntity entity = dictionaryTypeService.getInfo(id); + if ("-1".equals(entity.getParentId())) { + entity.setParentId(String.valueOf(entity.getCategory())); + } + DictionaryTypeInfoVO vo = JsonUtil.getJsonToBeanEx(entity, DictionaryTypeInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 添加字典分类 + * + * @param dictionaryTypeCrForm 实体对象 + * @return + */ + @Operation(summary = "添加字典分类") + @Parameter(name = "dictionaryTypeCrForm", description = "实体对象", required = true) + @SaCheckPermission("systemData.dictionary") + @PostMapping + public ActionResult create(@RequestBody @Valid DictionaryTypeCrForm dictionaryTypeCrForm) { + DictionaryTypeEntity entity = JsonUtil.getJsonToBean(dictionaryTypeCrForm, DictionaryTypeEntity.class); + if ("0".equals(entity.getParentId()) || "1".equals(entity.getParentId())) { + entity.setCategory(Integer.parseInt(entity.getParentId())); + entity.setParentId("-1"); + } else { + DictionaryTypeEntity entity1 = dictionaryTypeService.getInfo(dictionaryTypeCrForm.getParentId()); + entity.setCategory(entity1.getCategory()); + } + if (dictionaryTypeService.isExistByFullName(entity.getFullName(), entity.getId())) { + return ActionResult.fail("名称不能重复"); + } + if (dictionaryTypeService.isExistByEnCode(entity.getEnCode(), entity.getId())) { + return ActionResult.fail("编码不能重复"); + } + dictionaryTypeService.create(entity); + return ActionResult.success("新建成功"); + } + + /** + * 修改字典分类 + * + * @param dictionaryTypeUpForm 实体对象 + * @param id 主键值 + * @return + */ + @Operation(summary = "修改字典分类") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true), + @Parameter(name = "dictionaryTypeUpForm", description = "实体对象", required = true) + }) + @SaCheckPermission("systemData.dictionary") + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid DictionaryTypeUpForm dictionaryTypeUpForm) { + DictionaryTypeEntity entity = JsonUtil.getJsonToBean(dictionaryTypeUpForm, DictionaryTypeEntity.class); + if ("0".equals(entity.getParentId()) || "1".equals(entity.getParentId())) { + entity.setCategory(Integer.parseInt(entity.getParentId())); + entity.setParentId("-1"); + } else { + DictionaryTypeEntity entity1 = dictionaryTypeService.getInfo(dictionaryTypeUpForm.getParentId()); + entity.setCategory(entity1.getCategory()); + } + if (dictionaryTypeService.isExistByFullName(entity.getFullName(), id)) { + return ActionResult.fail("名称不能重复"); + } + if (dictionaryTypeService.isExistByEnCode(entity.getEnCode(), id)) { + return ActionResult.fail("编码不能重复"); + } + boolean flag = dictionaryTypeService.update(id, entity); + if (!flag) { + return ActionResult.success("更新失败,数据不存在"); + } + return ActionResult.success("更新成功"); + } + + /** + * 删除字典分类 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "删除字典分类") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("systemData.dictionary") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + DictionaryTypeEntity entity = dictionaryTypeService.getInfo(id); + if (entity != null) { + boolean isOk = dictionaryTypeService.delete(entity); + if (isOk) { + return ActionResult.success("删除成功"); + } else { + return ActionResult.fail("字典类型下面有字典值禁止删除"); + } + } + return ActionResult.fail("删除失败,数据不存在"); + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/InterfaceOauthController.java b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/InterfaceOauthController.java new file mode 100644 index 0000000..fcbd449 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/InterfaceOauthController.java @@ -0,0 +1,301 @@ +package jnpf.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.entity.DataInterfaceEntity; +import jnpf.base.entity.DataInterfaceLogEntity; +import jnpf.base.entity.DataInterfaceUserEntity; +import jnpf.base.entity.InterfaceOauthEntity; +import jnpf.base.model.InterfaceOauth.*; +import jnpf.base.model.datainterface.DataInterfaceVo; +import jnpf.base.service.DataInterfaceLogService; +import jnpf.base.service.DataInterfaceService; +import jnpf.base.service.DataInterfaceUserService; +import jnpf.base.service.InterfaceOauthService; +import jnpf.base.vo.PageListVO; +import jnpf.base.vo.PaginationVO; +import jnpf.constant.MsgCode; +import jnpf.exception.DataException; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.UserService; +import jnpf.util.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; + + +/** + * 接口认证控制器 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/6/8 + */ +@Tag(name = "接口认证", description = "interfaceoauth") +@RestController +@RequestMapping(value = "/api/system/InterfaceOauth") +public class InterfaceOauthController extends SuperController { + @Autowired + private DataInterfaceService dataInterfaceService; + @Autowired + private DataInterfaceLogService dataInterfaceLogService; + + @Autowired + private InterfaceOauthService interfaceOauthService; + + @Autowired + private UserService userService; + + @Autowired + private UserProvider userProvider; + + @Autowired + private DataInterfaceUserService dataInterfaceUserService; + + + /** + * 获取接口认证列表(分页) + * + * @param pagination 分页参数 + * @return ignore + */ + @Operation(summary = "获取接口认证列表(分页)") + @SaCheckPermission("systemData.interfaceAuth") + @GetMapping + public ActionResult> getList(PaginationOauth pagination) { + List data = interfaceOauthService.getList(pagination); + List jsonToList = JsonUtil.getJsonToList(data, InterfaceIdentListVo.class); + jsonToList.forEach(item -> { + if (StringUtil.isNotEmpty(userProvider.get().getTenantId())) { + item.setTenantId(userProvider.get().getTenantId()); + } + if (item.getCreatorUserId() != null) { + item.setCreatorUser(userService.getInfo(item.getCreatorUserId()).getRealName()); + } + }); + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(jsonToList, paginationVO); + } + + /** + * 添加接口认证 + * + * @param interfaceIdentForm 添加接口认证模型 + * @return ignore + */ + @Operation(summary = "添加接口认证") + @Parameter(name = "interfaceIdentForm", description = "添加接口认证模型", required = true) + @SaCheckPermission("systemData.interfaceAuth") + @PostMapping + public ActionResult create(@RequestBody @Valid InterfaceIdentForm interfaceIdentForm) { + InterfaceOauthEntity entity = JsonUtil.getJsonToBean(interfaceIdentForm, InterfaceOauthEntity.class); + if (interfaceOauthService.isExistByAppName(entity.getAppName(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (interfaceOauthService.isExistByAppId(entity.getAppId(), entity.getId())) { + return ActionResult.fail("内容不能重复"); + } + interfaceOauthService.create(entity); + + + return ActionResult.success("接口认证创建成功"); + } + + + /** + * 修改接口认证 + * + * @param interfaceIdentForm 添加接口认证模型 + * @return ignore + */ + @Operation(summary = "修改接口认证") + @Parameters({ + @Parameter(name = "interfaceIdentForm", description = "添加接口认证模型", required = true), + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("systemData.interfaceAuth") + @PutMapping("/{id}") + public ActionResult update(@RequestBody @Valid InterfaceIdentForm interfaceIdentForm, @PathVariable("id") String id) throws DataException { + InterfaceOauthEntity entity = JsonUtil.getJsonToBean(interfaceIdentForm, InterfaceOauthEntity.class); + if (interfaceOauthService.isExistByAppName(entity.getAppName(), id)) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (interfaceOauthService.isExistByAppId(entity.getAppId(), id)) { + return ActionResult.fail("内容不能重复"); + } + boolean flag = interfaceOauthService.update(entity, id); + if (flag == false) { + return ActionResult.fail(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除接口认证 + * + * @param id 主键 + * @return + */ + @Operation(summary = "删除接口") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("systemData.interfaceAuth") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable String id) { + InterfaceOauthEntity entity = interfaceOauthService.getInfo(id); + if (entity != null) { + interfaceOauthService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + /** + * 获取秘钥 + * + * @return + */ + @Operation(summary = "获取接口认证密钥") + @SaCheckPermission("systemData.interfaceAuth") + @GetMapping("/getAppSecret") + public ActionResult getAppSecret() { + String uuid = UUID.randomUUID().toString().replace("-", ""); + return ActionResult.success("获取成功", uuid); + } + + + /** + * 保存綁定认证接口 + * + * @return + */ + @Operation(summary = "保存綁定认证接口") + @Parameters({ + @Parameter(name = "identInterfaceListModel", description = "授权接口列表模型", required = true) + }) + @SaCheckPermission("systemData.interfaceAuth") + @PostMapping("/saveInterfaceList") + public ActionResult getInterfaceList(@RequestBody IdentInterfaceListModel identInterfaceListModel) { + InterfaceOauthEntity entity = new InterfaceOauthEntity(); + entity.setId(identInterfaceListModel.getInterfaceIdentId()); + entity.setDataInterfaceIds(identInterfaceListModel.getDataInterfaceIds()); + boolean b = interfaceOauthService.updateById(entity); + if (b) { + return ActionResult.success(MsgCode.SU002.get()); + } + return ActionResult.success(MsgCode.FA101.get()); + } + + /** + * 获取接口授权绑定接口列表 + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取认证基础信息及接口列表") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("systemData.interfaceAuth") + @GetMapping("/{id}") + public ActionResult getInterfaceList(@PathVariable("id") String id) { + InterfaceOauthEntity entity = interfaceOauthService.getInfo(id); + InterfaceIdentVo bean = JsonUtil.getJsonToBean(entity, InterfaceIdentVo.class); + if (StringUtils.isNotEmpty(bean.getDataInterfaceIds())) { + List listDataInterfaceVo = new ArrayList<>(); + List list = dataInterfaceService.getList(false); + list.forEach(item -> { + if (bean.getDataInterfaceIds().contains(item.getId())) { + DataInterfaceVo dataInterfaceVo = JsonUtil.getJsonToBean(item, DataInterfaceVo.class); + listDataInterfaceVo.add(dataInterfaceVo); + } + }); + bean.setList(listDataInterfaceVo); + } + + //添加授权用户信息 + List listIuv =new ArrayList<>(); + List select = dataInterfaceUserService.select(id); + for(DataInterfaceUserEntity diue:select){ + String userId = diue.getUserId(); + UserEntity info = userService.getInfo(userId); + InterfaceUserVo iuv=new InterfaceUserVo(); + iuv.setUserId(userId); + iuv.setUserKey(diue.getUserKey()); + iuv.setUserName(info.getRealName()+"/"+info.getAccount()); + listIuv.add(iuv); + } + bean.setUserList(listIuv); + return ActionResult.success("获取成功", bean); + } + + /** + * 获取日志列表 + * + * @param id 主键 + * @param paginationIntrfaceLog 分页参数 + * @return + */ + @Operation(summary = "获取日志列表") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("systemData.interfaceAuth") + @GetMapping("/dataInterfaceLog/{id}") + public ActionResult> getInterfaceList(@PathVariable("id") String id,PaginationIntrfaceLog paginationIntrfaceLog) { + InterfaceOauthEntity entity = interfaceOauthService.getInfo(id); + List voList = null; + PaginationVO vo = null; + if (entity!=null&&StringUtils.isNotEmpty(entity.getDataInterfaceIds())) { + String dataInterfaceIds = entity.getDataInterfaceIds(); + String[] split = dataInterfaceIds.split(","); + List list = Arrays.asList(split); + List listByIds = dataInterfaceLogService.getListByIds(entity.getAppId(),list, paginationIntrfaceLog); + voList = JsonUtil.getJsonToList(listByIds, IdentDataInterfaceLogVO.class); + List listDataInt = dataInterfaceService.getList(false); + for (IdentDataInterfaceLogVO invo : voList) { + if (StringUtil.isNotEmpty(userProvider.get().getTenantId())) { + invo.setTenantId(userProvider.get().getTenantId()); + } + //绑定用户 + UserEntity userEntity = userService.getInfo(invo.getUserId()); + if (userEntity != null) { + invo.setUserId(userEntity.getRealName() + "/" + userEntity.getAccount()); + } + //绑定接口基础数据 + listDataInt.forEach(item -> { + if (invo.getInvokId().contains(item.getId())) { + DataInterfaceVo dataInterfaceVo = JsonUtil.getJsonToBean(item, DataInterfaceVo.class); + invo.setFullName(dataInterfaceVo.getFullName()); + invo.setEnCode(dataInterfaceVo.getEnCode()); + } + }); + } + vo = JsonUtil.getJsonToBean(paginationIntrfaceLog, PaginationVO.class); + + } + return ActionResult.page(voList, vo); + } + + + @Operation(summary = "授权用户") + @SaCheckPermission("systemData.interfaceAuth") + @PostMapping("/SaveUserList") + public ActionResult saveUserList(@RequestBody InterfaceUserForm interfaceUserForm) { + dataInterfaceUserService.saveUserList(interfaceUserForm); + return ActionResult.success(MsgCode.SU002.get()); + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/MessageTemplateController.java b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/MessageTemplateController.java new file mode 100644 index 0000000..67950ce --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/MessageTemplateController.java @@ -0,0 +1,270 @@ +package jnpf.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.Pagination; +import jnpf.base.entity.MessageTemplateEntity; +import jnpf.base.entity.SmsTemplateEntity; +import jnpf.base.model.messagetemplate.*; +import jnpf.base.model.systemconfig.SmsModel; +import jnpf.base.service.MessageTemplateService; +import jnpf.base.service.SmsTemplateService; +import jnpf.base.util.SmsUtil; +import jnpf.base.vo.PageListVO; +import jnpf.base.vo.PaginationVO; +import jnpf.constant.MsgCode; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.UserService; +import jnpf.util.JsonUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; +import java.util.Map; + +/** + * 消息模板控制类 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-12-08 + */ +@Tag(description = "BaseMessageTemplateController", name = "消息模板控制类") +@RestController +@RequestMapping("/api/system/MessageTemplate") +public class MessageTemplateController extends SuperController { + + @Autowired + private MessageTemplateService messageTemplateService; + @Autowired + private SmsTemplateService smsTemplateService; + @Autowired + private UserService userService; + + /** + * 消息模板列表 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "消息模板列表") + @SaCheckPermission("msgTemplate") + @GetMapping + public ActionResult> list(Pagination pagination) { + List list = messageTemplateService.getList(pagination, false); + List listVO = JsonUtil.getJsonToList(list, MessageTemplateListVO.class); + for (MessageTemplateListVO messageTemplateListVO : listVO) { + StringBuilder noticeMethod = new StringBuilder(); + if (messageTemplateListVO.getIsDingTalk() == 1) { + noticeMethod.append("、阿里钉钉"); + } + if (messageTemplateListVO.getIsEmail() == 1) { + noticeMethod.append("、电子邮箱"); + } + if (messageTemplateListVO.getIsSms() == 1) { + noticeMethod.append("、短信"); + } + if (messageTemplateListVO.getIsStationLetter() == 1) { + noticeMethod.append("、站内信"); + } + if (messageTemplateListVO.getIsWecom() == 1) { + noticeMethod.append("、企业微信"); + } + if (noticeMethod.length() > 0) { + messageTemplateListVO.setNoticeMethod(noticeMethod.toString().replaceFirst("、", "")); + } + if ("1".equals(messageTemplateListVO.getCategory())) { + messageTemplateListVO.setCategory("普通"); + } else if ("2".equals(messageTemplateListVO.getCategory())) { + messageTemplateListVO.setCategory("重要"); + } else if ("3".equals(messageTemplateListVO.getCategory())) { + messageTemplateListVO.setCategory("紧急"); + } + UserEntity entity = userService.getInfo(messageTemplateListVO.getCreatorUserId()); + messageTemplateListVO.setCreatorUser(entity!= null ? entity.getRealName() + "/" + entity.getAccount() : null); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(listVO, paginationVO); + } + + /** + * 消息模板下拉框 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "消息模板下拉框") + @GetMapping("/Selector") + public ActionResult selector(Pagination pagination) { + List list = messageTemplateService.getList(pagination, true); + for (MessageTemplateEntity entity : list) { + if ("1".equals(entity.getCategory())) { + entity.setCategory("普通"); + } else if ("2".equals(entity.getCategory())) { + entity.setCategory("重要"); + } else if ("3".equals(entity.getCategory())) { + entity.setCategory("紧急"); + } + } + List listVO = JsonUtil.getJsonToList(list, MessageTemplateSelector.class); + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(listVO, paginationVO); + } + + /** + * 获取消息模板 + * + * @param id + * @return + */ + @Operation(summary = "获取消息模板") + @Parameter(name = "id", description = "主键", required = true) + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) { + MessageTemplateEntity entity = messageTemplateService.getInfo(id); + MessageTemplateVO vo = JsonUtil.getJsonToBean(entity, MessageTemplateVO.class); + SmsTemplateEntity info = smsTemplateService.getInfo(vo.getSmsId()); + vo.setSmsTemplateName(info != null ? info.getFullName() : null); + return ActionResult.success(vo); + } + + /** + * 获取消息模板参数 + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取消息模板参数") + @Parameter(name = "id", description = "主键", required = true) + @GetMapping("/getTemplate/{id}") + public ActionResult getParameter(@PathVariable("id") String id) { + MessageTemplateEntity entity = messageTemplateService.getInfo(id); + if (entity == null) { + return ActionResult.fail("模板不存在"); + } + // 获取参数 + String templateJson = entity.getTemplateJson(); + Map map = JsonUtil.stringToMap(templateJson); + // 如果是短信,获取短信模板参数 + if (entity.getIsSms() == 1) { + SmsModel smsModel = smsTemplateService.getSmsConfig(); + String smsId = entity.getSmsId(); + SmsTemplateEntity info = smsTemplateService.getInfo(smsId); + List list = SmsUtil.querySmsTemplateRequest(info.getCompany(), smsModel, info.getEndpoint(), info.getRegion(), info.getTemplateId()); + for (String key : list) { + map.put(key, null); + } + } + return ActionResult.success(map); + } + + /** + * 新建 + * + * @param messageTemplateCrForm 新建消息模板 + * @return + */ + @Operation(summary = "新建") + @Parameter(name = "messageTemplateCrForm", description = "新建消息模板", required = true) + @SaCheckPermission("msgTemplate") + @PostMapping + public ActionResult create(@RequestBody @Valid MessageTemplateCrForm messageTemplateCrForm) { + MessageTemplateEntity entity = JsonUtil.getJsonToBean(messageTemplateCrForm, MessageTemplateEntity.class); + if (messageTemplateService.isExistByFullName(entity.getFullName(), entity.getId())) { + return ActionResult.fail("新建失败,名称不能重复"); + } + if (messageTemplateService.isExistByEnCode(entity.getEnCode(), entity.getId())) { + return ActionResult.fail("新建失败,编码不能重复"); + } + messageTemplateService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 修改 + * + * @param id 主键 + * @param messageTemplateUpForm 修改消息模板 + * @return + */ + @Operation(summary = "修改") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "messageTemplateUpForm", description = "修改消息模板", required = true) + }) + @SaCheckPermission("msgTemplate") + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid MessageTemplateUpForm messageTemplateUpForm) { + MessageTemplateEntity entity = JsonUtil.getJsonToBean(messageTemplateUpForm, MessageTemplateEntity.class); + if (entity != null) { + if (messageTemplateService.isExistByFullName(entity.getFullName(), id)) { + return ActionResult.fail("更新失败,名称不能重复"); + } + if (messageTemplateService.isExistByEnCode(entity.getEnCode(), id)) { + return ActionResult.fail("更新失败,编码不能重复"); + } + boolean flag = messageTemplateService.update(id, entity); + if (!flag) { + return ActionResult.fail(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + return ActionResult.fail(MsgCode.FA002.get()); + } + + /** + * 删除 + * + * @param id 主键 + * @return + */ + @Operation(summary = "删除") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("msgTemplate") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + MessageTemplateEntity entity = messageTemplateService.getInfo(id); + if (entity == null) { + return ActionResult.fail(MsgCode.FA003.get()); + } + messageTemplateService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + + /** + * 修改状态 + * + * @param id 主键 + * @return + */ + @Operation(summary = "修改状态") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("msgTemplate") + @PutMapping("/{id}/Actions/State") + public ActionResult update(@PathVariable("id") String id) { + MessageTemplateEntity entity = messageTemplateService.getInfo(id); + if (entity != null) { + if (entity.getEnabledMark() == 0) { + entity.setEnabledMark(1); + } else { + entity.setEnabledMark(0); + } + boolean flag = messageTemplateService.update(id, entity); + if (!flag) { + return ActionResult.fail(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + return ActionResult.success(MsgCode.FA002.get()); + } +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/ModuleButtonController.java b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/ModuleButtonController.java new file mode 100644 index 0000000..e107d37 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/ModuleButtonController.java @@ -0,0 +1,206 @@ +package jnpf.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import jnpf.base.controller.SuperController; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.Pagination; +import jnpf.base.service.ModuleButtonService; +import jnpf.base.vo.ListVO; +import jnpf.base.entity.ModuleButtonEntity; +import jnpf.constant.MsgCode; +import jnpf.exception.DataException; +import jnpf.base.model.button.*; +import jnpf.util.JsonUtil; +import jnpf.util.JsonUtilEx; +import jnpf.util.treeutil.SumTree; +import jnpf.util.treeutil.newtreeutil.TreeDotUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 按钮权限 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Tag(name = "按钮权限", description = "ModuleButton") +@RestController +@RequestMapping("/api/system/ModuleButton") +public class ModuleButtonController extends SuperController { + + @Autowired + private ModuleButtonService moduleButtonService; + + /** + * 按钮按钮权限列表 + * + * @param menuId 功能主键 + * @param pagination 分页参数 + * @return ignore + */ + @Operation(summary = "获取按钮权限列表") + @Parameters({ + @Parameter(name = "menuId", description = "功能主键", required = true) + }) + @SaCheckPermission("system.menu") + @GetMapping("/{menuId}/List") + public ActionResult list(@PathVariable("menuId") String menuId, Pagination pagination) { + List data = moduleButtonService.getList(menuId, pagination); + List treeList = JsonUtil.getJsonToList(data, ButtonTreeListModel.class); + List> sumTrees = TreeDotUtils.convertListToTreeDot(treeList); + if (data.size() > sumTrees.size()) { + List list = JsonUtil.getJsonToList(sumTrees, ButtonTreeListVO.class); + ListVO treeVo = new ListVO<>(); + treeVo.setList(list); + return ActionResult.success(treeVo); + } + List list = JsonUtil.getJsonToList(treeList, ButtonListVO.class); + ListVO treeVo1 = new ListVO<>(); + treeVo1.setList(list); + return ActionResult.success(treeVo1); + } + + + /** + * 按钮按钮权限列表 + * + * @param menuId 功能主键 + * @return ignore + */ + @Operation(summary = "获取按钮权限下拉框") + @Parameters({ + @Parameter(name = "menuId", description = "功能主键", required = true) + }) + @GetMapping("/{menuId}/Selector") + public ActionResult> selectList(@PathVariable("menuId") String menuId) { + List data = moduleButtonService.getList(menuId); + List treeList = JsonUtil.getJsonToList(data, ButtonTreeListModel.class); + List> sumTrees = TreeDotUtils.convertListToTreeDot(treeList); + List list = JsonUtil.getJsonToList(sumTrees, ButtonTreeListVO.class); + ListVO treeVo = new ListVO<>(); + treeVo.setList(list); + return ActionResult.success(treeVo); + } + + + /** + * 获取按钮权限信息 + * + * @param id 主键值 + * @return ignore + */ + @Operation(summary = "获取按钮权限信息") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("system.menu") + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) throws DataException { + ModuleButtonEntity entity = moduleButtonService.getInfo(id); + ModuleButtonInfoVO vo = JsonUtilEx.getJsonToBeanEx(entity, ModuleButtonInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 新建按钮权限 + * + * @param moduleButtonCrForm 实体对象 + * @return ignore + */ + @Operation(summary = "新建按钮权限") + @Parameters({ + @Parameter(name = "moduleButtonCrForm", description = "实体对象", required = true) + }) + @SaCheckPermission("system.menu") + @PostMapping + public ActionResult create(@RequestBody ModuleButtonCrForm moduleButtonCrForm) { + ModuleButtonEntity entity = JsonUtil.getJsonToBean(moduleButtonCrForm, ModuleButtonEntity.class); + if (moduleButtonService.isExistByEnCode(entity.getModuleId(), entity.getEnCode(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + moduleButtonService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 更新按钮权限 + * + * @param id 主键值 + * @param moduleButtonUpForm 更新参数 + * @return ignore + */ + @Operation(summary = "更新按钮权限") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true), + @Parameter(name = "moduleButtonUpForm", description = "实体对象", required = true) + }) + @SaCheckPermission("system.menu") + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody ModuleButtonUpForm moduleButtonUpForm) { + ModuleButtonEntity entity = JsonUtil.getJsonToBean(moduleButtonUpForm, ModuleButtonEntity.class); + if (moduleButtonService.isExistByEnCode(entity.getModuleId(), entity.getEnCode(), id)) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + boolean flag = moduleButtonService.update(id, entity); + if (flag == false) { + return ActionResult.success(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除按钮权限 + * + * @param id 主键值 + * @return ignore + */ + @Operation(summary = "删除按钮权限") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("system.menu") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + ModuleButtonEntity entity = moduleButtonService.getInfo(id); + if (entity != null) { + moduleButtonService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + /** + * 更新菜单状态 + * + * @param id 主键值 + * @return ignore + */ + @Operation(summary = "更新菜单状态") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("system.menu") + @PutMapping("/{id}/Actions/State") + public ActionResult upState(@PathVariable("id") String id) { + ModuleButtonEntity entity = moduleButtonService.getInfo(id); + if (entity.getEnabledMark() == null || "1".equals(String.valueOf(entity.getEnabledMark()))) { + entity.setEnabledMark(0); + } else { + entity.setEnabledMark(1); + } + boolean flag = moduleButtonService.update(id, entity); + if (!flag) { + return ActionResult.success(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/ModuleColumnController.java b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/ModuleColumnController.java new file mode 100644 index 0000000..cdda5ec --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/ModuleColumnController.java @@ -0,0 +1,388 @@ +package jnpf.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.Pagination; +import jnpf.base.entity.ModuleEntity; +import jnpf.base.model.ColumnDataModel; +import jnpf.base.model.Template6.ColumnListField; +import jnpf.base.model.module.PropertyJsonModel; +import jnpf.base.service.ModuleColumnService; +import jnpf.base.service.ModuleService; +import jnpf.base.vo.ListVO; +import jnpf.base.entity.ModuleColumnEntity; +import jnpf.constant.MsgCode; +import jnpf.exception.DataException; +import jnpf.base.model.column.*; +import jnpf.util.JsonUtil; +import jnpf.util.JsonUtilEx; +import jnpf.util.ReflectionUtil; +import jnpf.util.StringUtil; +import jnpf.util.context.SpringContext; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.*; + +/** + * 列表权限 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Tag(name = "列表权限", description = "ModuleColumn") +@Validated +@RestController +@RequestMapping("/api/system/ModuleColumn") +public class ModuleColumnController extends SuperController { + + @Autowired + private ModuleColumnService moduleColumnService; + @Autowired + private ModuleService moduleService; + + /** + * 获取列表权限信息列表 + * + * @param moduleId 功能主键 + * @param pagination 分页参数 + * @return ignore + */ + @Operation(summary = "获取列表权限列表") + @Parameters({ + @Parameter(name = "moduleId", description = "功能主键", required = true) + }) + @SaCheckPermission("system.menu") + @GetMapping("/{moduleId}/Fields") + public ActionResult> getList(@PathVariable("moduleId") String moduleId, Pagination pagination) { + List list = moduleColumnService.getList(moduleId, pagination); + List voList = JsonUtil.getJsonToList(list, ColumnListVO.class); + voList.stream().forEach(t-> { + String enCode = t.getEnCode(); + if (StringUtil.isNotEmpty(enCode)) { + if (enCode.contains("-")){ + enCode = enCode.substring(enCode.indexOf("-")+1); + } + t.setEnCode(enCode.replace("jnpf_" + t.getBindTable() + "_jnpf_", "")); + } + }); + ListVO vo = new ListVO<>(); + vo.setList(voList); + return ActionResult.success(vo); + } + + /** + * 菜单列表权限 + * + * @param moduleId 功能主键 + * @return ignore + */ + @Operation(summary = "菜单列表权限") + @Parameters({ + @Parameter(name = "moduleId", description = "功能主键", required = true) + }) + @SaCheckPermission("system.menu") + @GetMapping("/{moduleId}/FieldList") + public ActionResult>> fieldList(@PathVariable("moduleId") String moduleId) { + List> list = new ArrayList<>(); + // 得到菜单id + ModuleEntity entity = moduleService.getInfo(moduleId); + if (entity != null) { + PropertyJsonModel model = JsonUtil.getJsonToBean(entity.getPropertyJson(), PropertyJsonModel.class); + if (model == null) { + model = new PropertyJsonModel(); + } + // 得到bean + Object bean = SpringContext.getBean("visualdevServiceImpl"); + Object method = ReflectionUtil.invokeMethod(bean, "getInfo", new Class[]{String.class}, new Object[]{model.getModuleId()}); + Map map = JsonUtil.entityToMap(method); + boolean isPc = entity.getCategory().equalsIgnoreCase("web"); + if (map!=null){ + Object columnData = isPc ? map.get("columnData") : map.get("appColumnData") ; + if (Objects.nonNull(columnData)){ + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData.toString(), ColumnDataModel.class); + List columnListFields = JsonUtil.getJsonToList(columnDataModel.getDefaultColumnList(), ColumnListField.class); + if (Objects.nonNull(columnListFields)) { + columnListFields.stream().forEach(col -> { + Map dataMap = new HashMap<>(); + dataMap.put("field", col.getProp()); + dataMap.put("fieldName", col.getLabel()); + list.add(dataMap); + }); + } + } + } + } + + +// if (map != null && map.containsKey("formData")) { +// // 需要排除的key +// String[] filterKey = new String[]{"PsdInput", "colorPicker", "rate", "slider", "divider", +// "uploadImg", "uploadFz", "editor", "JNPFText", "relationFormAttr", "popupAttr", "groupTitle"}; +// List filterKeyList = Arrays.asList(filterKey); +// FormDataModel formDataModel = JsonUtil.getJsonToBean(String.valueOf(map.get("formData")), FormDataModel.class); +// List fieLdsModelList = JsonUtil.getJsonToList(formDataModel.getFields(), FieLdsModel.class); +// RecursionForm recursionForm = new RecursionForm(); +// recursionForm.setList(fieLdsModelList); +// recursionForm.setTableModelList(JsonUtil.getJsonToList(String.valueOf(map.get("tables")), TableModel.class)); +// List formAllModel = new ArrayList<>(); +// FormCloumnUtil.recursionForm(recursionForm, formAllModel); +// for (FormAllModel allModel : formAllModel) { +// if (FormEnum.mast.getMessage().equals(allModel.getJnpfKey())) { +// FormColumnModel formColumnModel = allModel.getFormColumnModel(); +// FieLdsModel fieLdsModel = formColumnModel.getFieLdsModel(); +// long count = filterKeyList.stream().filter(t -> fieLdsModel != null && fieLdsModel.getConfig()!=null && t.equals(fieLdsModel.getConfig().getJnpfKey())).count(); +// if (count < 1) { +// if (fieLdsModel != null && StringUtil.isNotEmpty(fieLdsModel.getVModel())) { +// Map map1 = new HashedMap<>(); +// map1.put("field", fieLdsModel.getVModel()); +// map1.put("fieldName", fieLdsModel.getConfig().getLabel()); +// list.add(map1); +// } +// } +// } else if (FormEnum.mastTable.getMessage().equals(allModel.getJnpfKey())) { +// FormMastTableModel formColumnModel = allModel.getFormMastTableModel(); +// FieLdsModel fieLdsModel = formColumnModel.getMastTable().getFieLdsModel(); +// long count = filterKeyList.stream().filter(t -> fieLdsModel != null && fieLdsModel.getConfig() != null && t.equals(fieLdsModel.getConfig().getJnpfKey())).count(); +// if (count < 1) { +// if (fieLdsModel != null && StringUtil.isNotEmpty(fieLdsModel.getVModel())) { +// Map map1 = new HashedMap<>(); +// map1.put("field", fieLdsModel.getVModel()); +// map1.put("fieldName", fieLdsModel.getConfig().getLabel()); +// list.add(map1); +// } +// } +// } +// +///// 后面会用到 +//// else if (FormEnum.table.getMessage().equals(allModel.getJnpfKey())) { +//// FormColumnTableModel childList = allModel.getChildList(); +//// List childList1 = childList.getChildList(); +//// for (FormColumnModel formColumnModel : childList1) { +//// FieLdsModel fieLdsModel = formColumnModel.getFieLdsModel(); +//// if (StringUtil.isNotEmpty(fieLdsModel.getVModel())) { +//// Map map1 = new HashedMap<>(); +//// map1.put("field", fieLdsModel.getVModel()); +//// map1.put("fieldName", fieLdsModel.getConfig().getLabel()); +//// list.add(map1); +//// } +//// } +//// } +///// +// } +// } + return ActionResult.success(list); + } + + /** + * 获取列表权限信息 + * + * @param id 主键值 + * @return ignore + * @throws DataException ignore + */ + @Operation(summary = "获取列表权限信息") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) throws DataException { + ModuleColumnEntity entity = moduleColumnService.getInfo(id); + String enCode = entity.getEnCode(); + if (StringUtil.isNotEmpty(enCode)) { + if (enCode.contains("-") && entity.getFieldRule()==2){ + enCode = enCode.substring(enCode.indexOf("-")+1); + entity.setEnCode(enCode); + } + if (Objects.equals(entity.getFieldRule(),1) && entity.getBindTable()!=null){ + entity.setEnCode(enCode.replace("jnpf_" + entity.getBindTable() + "_jnpf_", "")); + } + } + ModuleColumnInfoVO vo = JsonUtilEx.getJsonToBeanEx(entity, ModuleColumnInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 新建列表权限 + * + * @param moduleColumnCrForm 实体对象 + * @return ignore + */ + @Operation(summary = "新建列表权限") + @Parameters({ + @Parameter(name = "moduleColumnCrForm", description = "实体对象", required = true) + }) + @SaCheckPermission("system.menu") + @PostMapping + public ActionResult create(@RequestBody @Valid ModuleColumnCrForm moduleColumnCrForm) { + ModuleEntity moduleEntity = moduleService.getInfo(moduleColumnCrForm.getModuleId()); + ModuleColumnEntity entity = JsonUtil.getJsonToBean(moduleColumnCrForm, ModuleColumnEntity.class); + + if (moduleEntity != null){ + PropertyJsonModel model = JsonUtil.getJsonToBean(moduleEntity.getPropertyJson(), PropertyJsonModel.class); + if (model == null) { + model = new PropertyJsonModel(); + } + if (entity.getFieldRule() == 1 && StringUtil.isNotEmpty(moduleColumnCrForm.getBindTable())) { + String enCode = "jnpf_" + moduleColumnCrForm.getBindTable() + "_jnpf_" + entity.getEnCode(); + entity.setEnCode(enCode); + } + + if (entity.getFieldRule() == 2 && StringUtil.isNotEmpty(moduleColumnCrForm.getChildTableKey())) { + // 得到bean +// Object bean = SpringContext.getBean("visualdevServiceImpl"); +// Object method = ReflectionUtil.invokeMethod(bean, "getTableNameToKey", new Class[]{String.class}, new Object[]{model.getModuleId()}); +// Map map = JsonUtil.entityToMap(method); +// +// String enCode = map.get(moduleColumnCrForm.getBindTable().toLowerCase()) + "-" + entity.getEnCode(); + String enCode = moduleColumnCrForm.getChildTableKey() + "-" + entity.getEnCode(); + entity.setEnCode(enCode); + } + } + if (moduleColumnService.isExistByEnCode(entity.getModuleId(), entity.getEnCode(), entity.getId())) { + return ActionResult.fail("字段名称不能重复"); + } + moduleColumnService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 更新列表权限 + * + * @param id 主键值 + * @param moduleColumnUpForm 实体对象 + * @return ignore + */ + @Operation(summary = "更新列表权限") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true), + @Parameter(name = "moduleColumnUpForm", description = "实体对象", required = true) + }) + @SaCheckPermission("system.menu") + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid ModuleColumnUpForm moduleColumnUpForm) { + ModuleEntity moduleEntity = moduleService.getInfo(moduleColumnUpForm.getModuleId()); + ModuleColumnEntity entity = JsonUtil.getJsonToBean(moduleColumnUpForm, ModuleColumnEntity.class); + if (moduleEntity != null){ + PropertyJsonModel model = JsonUtil.getJsonToBean(moduleEntity.getPropertyJson(), PropertyJsonModel.class); + if (model == null) { + model = new PropertyJsonModel(); + } + if (entity.getFieldRule() == 1 && StringUtil.isNotEmpty(moduleColumnUpForm.getBindTable())) { + String enCode = "jnpf_" + moduleColumnUpForm.getBindTable() + "_jnpf_" + entity.getEnCode(); + entity.setEnCode(enCode); + } + + if (entity.getFieldRule() == 2 && StringUtil.isNotEmpty(moduleColumnUpForm.getChildTableKey())) { +// // 得到bean +// Object bean = SpringContext.getBean("visualdevServiceImpl"); +// Object method = ReflectionUtil.invokeMethod(bean, "getTableNameToKey", new Class[]{String.class}, new Object[]{model.getModuleId()}); +// Map map = JsonUtil.entityToMap(method); + +// String enCode = map.get(moduleColumnUpForm.getBindTable().toLowerCase()) + "-" + entity.getEnCode(); + String enCode = moduleColumnUpForm.getChildTableKey() + "-" + entity.getEnCode(); + entity.setEnCode(enCode); + } + } + if (moduleColumnService.isExistByEnCode(entity.getModuleId(), entity.getEnCode(), id)) { + return ActionResult.fail("字段名称不能重复"); + } + boolean flag = moduleColumnService.update(id, entity); + if (!flag) { + return ActionResult.success(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除列表权限 + * + * @param id 主键值 + * @return ignore + */ + @Operation(summary = "删除列表权限") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("system.menu") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + ModuleColumnEntity entity = moduleColumnService.getInfo(id); + if (entity != null) { + moduleColumnService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + /** + * 更新列表权限状态 + * + * @param id 主键值 + * @return ignore + */ + @Operation(summary = "更新列表权限状态") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("system.menu") + @PutMapping("/{id}/Actions/State") + public ActionResult upState(@PathVariable("id") String id) { + ModuleColumnEntity entity = moduleColumnService.getInfo(id); + if (entity.getEnabledMark() == null || "1".equals(String.valueOf(entity.getEnabledMark()))) { + entity.setEnabledMark(0); + } else { + entity.setEnabledMark(1); + } + boolean flag = moduleColumnService.update(id, entity); + if (!flag) { + return ActionResult.success(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 批量新建 + * + * @param columnBatchForm 权限模型 + * @return ignore + */ + @Operation(summary = "批量新建列表权限") + @Parameters({ + @Parameter(name = "columnBatchForm", description = "权限模型", required = true) + }) + @SaCheckPermission("system.menu") + @PostMapping("/Actions/Batch") + public ActionResult batchCreate(@RequestBody @Valid ColumnBatchForm columnBatchForm) { + List entitys = columnBatchForm.getColumnJson() != null ? JsonUtil.getJsonToList(columnBatchForm.getColumnJson(), ModuleColumnEntity.class) : new ArrayList<>(); + List name = new ArrayList<>(); + for (ModuleColumnEntity entity : entitys) { + entity.setModuleId(columnBatchForm.getModuleId()); + if (entity.getFieldRule() == 1 ) { + String enCode = "jnpf_" + entity.getBindTable() + "_jnpf_" + entity.getEnCode(); + entity.setEnCode(enCode); + } + if (entity.getFieldRule() == 2 ) { + String enCode = entity.getChildTableKey() + "-" + entity.getEnCode(); + entity.setEnCode(enCode); + } + if (moduleColumnService.isExistByEnCode(entity.getModuleId(), entity.getEnCode(), null)) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + if (name.contains(entity.getEnCode())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + name.add(entity.getEnCode()); + } + moduleColumnService.create(entitys); + return ActionResult.success(MsgCode.SU001.get()); + } +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/ModuleController.java b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/ModuleController.java new file mode 100644 index 0000000..e618e5d --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/ModuleController.java @@ -0,0 +1,653 @@ +package jnpf.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import jnpf.base.entity.*; +import jnpf.base.service.*; +import jnpf.base.vo.DownloadVO; +import jnpf.constant.JnpfConst; +import jnpf.constant.MsgCode; +import jnpf.base.model.module.MenuSelectVO; +import jnpf.constant.PermissionConst; +import jnpf.model.AppDataInfoModel; +import jnpf.model.AppObjectDataModel; +import jnpf.model.FlowWorkModel; +import jnpf.model.UserMenuModel; +import jnpf.permission.entity.AuthorizeEntity; +import jnpf.permission.entity.OrganizeAdministratorEntity; +import jnpf.permission.entity.PermissionGroupEntity; +import jnpf.permission.model.user.UserIdListVo; +import jnpf.permission.service.AuthorizeService; +import jnpf.permission.service.OrganizeAdministratorService; +import jnpf.permission.service.PermissionGroupService; +import jnpf.permission.service.UserService; +import jnpf.util.*; +import jnpf.exception.DataException; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.model.module.*; +import jnpf.util.context.SpringContext; +import jnpf.emnus.ModuleTypeEnum; +import jnpf.util.treeutil.ListToTreeUtil; +import jnpf.util.treeutil.SumTree; +import jnpf.util.treeutil.TreeViewModel; +import jnpf.util.treeutil.newtreeutil.TreeDotUtils; +import jnpf.base.vo.ListVO; +import jnpf.util.type.AuthorizeType; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 系统功能 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Tag(name = "系统菜单", description = "menu") +@RestController +@RequestMapping("/api/system/Menu") +public class ModuleController extends SuperController { + + @Autowired + private ModuleService moduleService; + @Autowired + private RedisUtil redisUtil; + @Autowired + private CacheKeyUtil cacheKeyUtil; + @Autowired + private UserProvider userProvider; + @Autowired + private SystemService systemService; + @Autowired + private PermissionGroupService permissionGroupApi; + @Autowired + private ModuleButtonService buttonService; + @Autowired + private ModuleColumnService columnService; + @Autowired + private ModuleFormService formService; + @Autowired + private ModuleDataAuthorizeSchemeService dataAuthorizeSchemeService; + @Autowired + private AuthorizeService authorizeApi; + @Autowired + private UserService userApi; + + + /** + * 获取菜单列表 + * + * @param systemId 系统id + * @param paginationMenu 分页参数 + * @return ignore + */ + @Operation(summary = "获取菜单列表") + @Parameters({ + @Parameter(name = "systemId", description = "系统id", required = true) + }) + @GetMapping("/ModuleBySystem/{systemId}") + public ActionResult> list(@PathVariable("systemId") String systemId, PaginationMenu paginationMenu) { + List data = moduleService.getList(systemId, paginationMenu.getCategory(), paginationMenu.getKeyword(), null, null, null, false); + List list = JsonUtil.getJsonToList(data, UserMenuModel.class); + List> menuList = TreeDotUtils.convertListToTreeDot(list); + List menuvo = JsonUtil.getJsonToList(menuList, MenuListVO.class); + ListVO vo = new ListVO(); + vo.setList(menuvo); + return ActionResult.success(vo); + } + + /** + * 获取菜单列表(下拉框) + * + * @param category 分类 + * @param id 主键 + * @return ignore + */ + @Operation(summary = "获取菜单列表(下拉框)") + @Parameters({ + @Parameter(name = "category", description = "分类"), + @Parameter(name = "id", description = "主键", required = true) + }) + @GetMapping("/Selector/{id}") + public ActionResult> treeView(String category, @PathVariable("id") String id) { + String systemId = "App".equals(category) ? userProvider.get().getAppSystemId() : userProvider.get().getSystemId(); + List data = moduleService.getList(systemId, category, null, "1", "1", null, false); + if (!"0".equals(id)) { + data.remove(moduleService.getInfo(id)); + } + List list = JsonUtil.getJsonToList(data, UserMenuModel.class); + List> menuList = TreeDotUtils.convertListToTreeDotFilter(list); + List menuvo = JsonUtil.getJsonToList(menuList, MenuSelectVO.class); + ListVO vo = new ListVO(); + vo.setList(menuvo); + return ActionResult.success(vo); + } + + /** + * 获取开发平台菜单 + * + * @return ignore + */ + @Operation(summary = "获取开发平台菜单") + @GetMapping("/SystemSelector") + public ActionResult> mainSystemSelector() { + SystemEntity mainSystem = systemService.getInfoByEnCode(JnpfConst.MAIN_SYSTEM_CODE); + List data = moduleService.getList(mainSystem.getId(), null, null, null, "1", null, false); + List list = JsonUtil.getJsonToList(data, UserMenuModel.class); + list.forEach(t -> { + if ("-1".equals(t.getParentId())) { + t.setParentId(t.getSystemId()); + } + }); + UserMenuModel userMenuModel = JsonUtil.getJsonToBean(mainSystem, UserMenuModel.class); + userMenuModel.setType(0); + userMenuModel.setParentId("-1"); + list.add(userMenuModel); + List> menuList = TreeDotUtils.convertListToTreeDotFilter(list); + List menuvo = JsonUtil.getJsonToList(menuList, MenuSelectVO.class); + ListVO vo = new ListVO(); + vo.setList(menuvo); + return ActionResult.success(vo); + } + + /** + * 通过系统id获取菜单列表(下拉框) + * + * @param category 分类 + * @param id 主键 + * @return ignore + */ + @Operation(summary = "通过系统id获取菜单列表(下拉框)") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "systemId", description = "系统主键", required = true) + }) + @GetMapping("/Selector/{id}/{systemId}") + public ActionResult> treeView(String category, @PathVariable("id") String id, @PathVariable("systemId") String systemId) { + List data = moduleService.getList(systemId, category, null, "1", "1", null, true); + if (!"0".equals(id)) { + data.remove(moduleService.getInfo(id)); + } + List list = JsonUtil.getJsonToList(data, UserMenuModel.class); + if ("0".equals(systemId)) { + List list1 = systemService.getList(null, true, true); + list.forEach(t -> { + if ("-1".equals(t.getParentId())) { + t.setParentId(t.getSystemId()); + } + }); + List jsonToList = JsonUtil.getJsonToList(list1, UserMenuModel.class); + jsonToList.forEach(t -> { + t.setType(0); + t.setParentId("-1"); + }); + list.addAll(jsonToList); + } + List> menuList = TreeDotUtils.convertListToTreeDotFilter(list); + List menuvo = JsonUtil.getJsonToList(menuList, MenuSelectAllVO.class); + ListVO vo = new ListVO(); + vo.setList(menuvo); + return ActionResult.success(vo); + } + + /** + * 获取菜单权限返回权限组 + * + * @param id 主键 + * @return ignore + */ + @Operation(summary = "获取菜单权限返回权限组") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @GetMapping("/getPermissionGroup/{id}") + public ActionResult> getPermissionGroup(@PathVariable("id") String id) { + Map map = new HashMap<>(2); + int type = 0; // 0未开启权限,1有 + List list = new ArrayList<>(); + // 获取当前菜单开启了哪些权限 + ModuleEntity entity = moduleService.getInfo(id); + if (entity == null) { + return ActionResult.fail(MsgCode.FA001.get()); + } + // 权限是否被绑定,是否有权限 + List buttonList = buttonService.getList(id); + List columnList = columnService.getList(id); + List formList = formService.getList(id); + List dataAuthorizeList = dataAuthorizeSchemeService.getList(id); + if (buttonList.size() > 0 || columnList.size() > 0 || formList.size() >0 || dataAuthorizeList.size() > 0) { + List authorizeByItem = authorizeApi.getAuthorizeByItem(AuthorizeType.MODULE, entity.getId()); + List collect = authorizeByItem.stream().map(AuthorizeEntity::getObjectId).collect(Collectors.toList()); + List permissionGroupByUserId = permissionGroupApi.list(collect); + list = JsonUtil.getJsonToList(permissionGroupByUserId, FlowWorkModel.class); + list.forEach(t -> t.setIcon("icon-ym icon-ym-authGroup")); + if (list.size() > 0) { + type = 1; + } else { + type = 2; + } + } + map.put("list", list); + map.put("type", type); + return ActionResult.success(map); + } + + /** + * 通过权限组id获取相关权限 + * + * @param id 主键 + * @return ignore + */ + @Operation(summary = "通过权限组id获取相关权限") + @Parameters({ + @Parameter(name = "id", description = "权限组id", required = true) + }) + @GetMapping("/getPermission/{id}/{permissionId}") + public ActionResult getPermission(@PathVariable("id") String id, @PathVariable("permissionId") String permissionId) { + // 获取当前菜单开启了哪些权限 + ModuleEntity entity = moduleService.getInfo(id); + if (entity == null) { + return ActionResult.fail(MsgCode.FA001.get()); + } + PermissionGroupEntity permissionGroupEntity = permissionGroupApi.info(permissionId); + if (permissionGroupEntity == null) { + return ActionResult.fail(MsgCode.FA001.get()); + } + // 权限组的权限 + List authList = authorizeApi.getListByObjectId(Collections.singletonList(permissionId)); + + ModulePermissionVO modulePermissionVO = new ModulePermissionVO(); + + ModulePermissionModel permissionMemberModel = new ModulePermissionModel(); + permissionMemberModel.setFullName("权限成员"); + permissionMemberModel.setType(1); + List permissionMember = new ArrayList<>(); + if (StringUtil.isNotEmpty(permissionGroupEntity.getPermissionMember())) { + List userIdListVos = userApi.selectedByIds(Arrays.asList(permissionGroupEntity.getPermissionMember().split(","))); + permissionMember = JsonUtil.getJsonToList(userIdListVos, ModulePermissionModel.ModulePermissionBaseModel.class); + } + permissionMemberModel.setList(permissionMember); + modulePermissionVO.setPermissionMember(permissionMemberModel); + + + ModulePermissionModel moduleButtonPermissionModel = new ModulePermissionModel(); + moduleButtonPermissionModel.setFullName("按钮权限"); + List buttonList = buttonService.getList(id); + if (buttonList.size() > 0) { + int type = 2; + List collect = buttonList.stream() + .filter(t -> authList.stream().map(AuthorizeEntity::getItemId).collect(Collectors.toList()) + .contains(t.getId())).collect(Collectors.toList()); + List buttonPermissionList = JsonUtil.getJsonToList(collect, ModulePermissionModel.ModulePermissionBaseModel.class); + moduleButtonPermissionModel.setList(buttonPermissionList); + if (buttonPermissionList.size() > 0) { + type = 1; + } + moduleButtonPermissionModel.setType(type); + } + modulePermissionVO.setButtonAuthorize(moduleButtonPermissionModel); + + ModulePermissionModel moduleColumnPermissionModel = new ModulePermissionModel(); + moduleColumnPermissionModel.setFullName("列表权限"); + List columnList = columnService.getList(id); + if (columnList.size() > 0) { + int type = 2; + List collect = columnList.stream() + .filter(t -> authList.stream().map(AuthorizeEntity::getItemId).collect(Collectors.toList()) + .contains(t.getId())).collect(Collectors.toList()); + List buttonPermissionList = JsonUtil.getJsonToList(collect, ModulePermissionModel.ModulePermissionBaseModel.class); + moduleColumnPermissionModel.setList(buttonPermissionList); + if (buttonPermissionList.size() > 0) { + type = 1; + } + moduleColumnPermissionModel.setType(type); + } + modulePermissionVO.setColumnAuthorize(moduleColumnPermissionModel); + + ModulePermissionModel moduleFromPermissionModel = new ModulePermissionModel(); + moduleFromPermissionModel.setFullName("表单权限"); + List formList = formService.getList(id); + if (formList.size() > 0) { + int type = 2; + List collect = formList.stream() + .filter(t -> authList.stream().map(AuthorizeEntity::getItemId).collect(Collectors.toList()) + .contains(t.getId())).collect(Collectors.toList()); + List buttonPermissionList = JsonUtil.getJsonToList(collect, ModulePermissionModel.ModulePermissionBaseModel.class); + moduleFromPermissionModel.setList(buttonPermissionList); + if (buttonPermissionList.size() > 0) { + type = 1; + } + moduleFromPermissionModel.setType(type); + } + modulePermissionVO.setFormAuthorize(moduleFromPermissionModel); + + ModulePermissionModel moduleDataPermissionModel = new ModulePermissionModel(); + moduleDataPermissionModel.setFullName("数据权限"); + List dataAuthorizeList = dataAuthorizeSchemeService.getList(id); + if (dataAuthorizeList.size() > 0) { + int type = 2; + List collect = dataAuthorizeList.stream() + .filter(t -> authList.stream().map(AuthorizeEntity::getItemId).collect(Collectors.toList()) + .contains(t.getId())).collect(Collectors.toList()); + List buttonPermissionList = JsonUtil.getJsonToList(collect, ModulePermissionModel.ModulePermissionBaseModel.class); + moduleDataPermissionModel.setList(buttonPermissionList); + if (buttonPermissionList.size() > 0) { + type = 1; + } + moduleDataPermissionModel.setType(type); + } + modulePermissionVO.setDataAuthorize(moduleDataPermissionModel); + + return ActionResult.success(modulePermissionVO); + } + + /** + * 获取菜单列表(下拉框) + * + * @param category 分类 + * @return ignore + */ + @Operation(summary = "获取菜单列表下拉框") + @GetMapping("/Selector/All") + public ActionResult> menuSelect(String category) { + List data = moduleService.getList("0", category, null, null, "1", null, false); + List list = JsonUtil.getJsonToList(data, UserMenuModel.class); + List list1 = systemService.getList(null, true, false); + list.forEach(t -> { + t.setHasModule(!"1".equals(String.valueOf(t.getType()))); + if ("-1".equals(t.getParentId())) { + t.setParentId(t.getSystemId()); + } + }); + List jsonToList = JsonUtil.getJsonToList(list1, UserMenuModel.class); + jsonToList.forEach(t -> { + t.setType(0); + t.setHasModule(false); + t.setParentId("-1"); + }); + list.addAll(jsonToList); + List> menuList = TreeDotUtils.convertListToTreeDotFilter(list); + List menuvo = JsonUtil.getJsonToList(menuList, MenuSelectAllVO.class); + ListVO vo = new ListVO(); + vo.setList(menuvo); + return ActionResult.success(vo); + } + + + /** + * 系统功能类别树形 + * + * @return ignore + */ + @Operation(summary = "系统功能类别树形") + @GetMapping("/{systemId}/TreeView") + public ActionResult treeView(@PathVariable("systemId") String systemId) { + List moduleList = moduleService.getList(systemId,null, null, null, null,"0", true); + List treeList = new ArrayList<>(); + TreeViewModel treeViewModel = new TreeViewModel(); + treeViewModel.setId("apply"); + treeViewModel.setText("软件开发平台"); + treeViewModel.setParentId("0"); + treeViewModel.setImg("fa fa-windows apply"); + treeList.add(treeViewModel); + for (ModuleEntity entity : moduleList) { + TreeViewModel treeModel = new TreeViewModel(); + treeModel.setId(entity.getId()); + treeModel.setText(entity.getFullName()); + treeModel.setParentId("apply"); + treeModel.setImg("fa fa-tags"); + treeList.add(treeModel); + } + return ActionResult.success(ListToTreeUtil.toTreeView(treeList)); + } + + + /** + * 获取菜单信息 + * + * @param id 主键值 + * @return ignore + * @throws DataException ignore + */ + @Operation(summary = "获取菜单信息") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("system.menu") + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) throws DataException { + ModuleEntity entity = moduleService.getInfo(id); + ModuleInfoVO vo = JsonUtilEx.getJsonToBeanEx(entity, ModuleInfoVO.class); + return ActionResult.success(vo); + } + + + /** + * 新建系统功能 + * + * @param moduleCrForm 实体对象 + * @return ignore + */ + @Operation(summary = "新建系统功能") + @Parameters({ + @Parameter(name = "moduleCrForm", description = "实体对象", required = true) + }) + @SaCheckPermission("system.menu") + @PostMapping + public ActionResult create(@RequestBody @Valid ModuleCrForm moduleCrForm) { + ModuleEntity entity = JsonUtil.getJsonToBean(moduleCrForm, ModuleEntity.class); + if (entity.getUrlAddress() != null) { + entity.setUrlAddress(entity.getUrlAddress().trim()); + } + if (moduleService.isExistByFullName(entity, moduleCrForm.getCategory(), moduleCrForm.getSystemId())) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (moduleService.isExistByEnCode(entity, moduleCrForm.getCategory(), moduleCrForm.getSystemId())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + moduleService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 更新系统功能 + * + * @param id 主键值 + * @param moduleUpForm 实体对象 + * @return ignore + */ + @Operation(summary = "更新系统功能") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true), + @Parameter(name = "moduleUpForm", description = "实体对象", required = true) + }) + @SaCheckPermission("system.menu") + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid ModuleUpForm moduleUpForm) { + ModuleEntity entity = JsonUtil.getJsonToBean(moduleUpForm, ModuleEntity.class); + //判断如果是目录则不能修改类型 + ModuleEntity moduleEntity = moduleService.getInfo(id); + if (moduleEntity != null && moduleEntity.getType() == 1 && entity.getType() != 1 && moduleService.getList(moduleEntity.getId()).size() > 0) { + return ActionResult.fail("当前目录存在数据,不能修改类型"); + } + entity.setId(id); + Object bean = SpringContext.getBean("appDataServiceImpl"); + AppDataInfoModel appDataInfoModel = null; + if (entity.getUrlAddress() != null) { + entity.setUrlAddress(entity.getUrlAddress().trim()); + String urlAddress = ""; + Object method = ReflectionUtil.invokeMethod(bean, "getInfo", new Class[]{String.class}, new Object[]{id}); + appDataInfoModel = JsonUtil.getJsonToBean(method, AppDataInfoModel.class); + if (appDataInfoModel != null && StringUtil.isNotEmpty(appDataInfoModel.getObjectData())) { + AppObjectDataModel objectDataModel = JsonUtil.getJsonToBean(appDataInfoModel.getObjectData(), AppObjectDataModel.class); + if (StringUtil.isNotEmpty(objectDataModel.getUrlAddress())) { + urlAddress = appDataInfoModel.getObjectData().replaceAll(objectDataModel.getUrlAddress(), entity.getUrlAddress()); + } + appDataInfoModel.setObjectData(urlAddress); + } + } + if (moduleService.isExistByFullName(entity, moduleUpForm.getCategory(), moduleUpForm.getSystemId())) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (moduleService.isExistByEnCode(entity, moduleUpForm.getCategory(), moduleUpForm.getSystemId())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + boolean flag = moduleService.update(id, entity); + if (!flag) { + return ActionResult.fail(MsgCode.FA002.get()); + } + // 修改常用应用数据 + if (appDataInfoModel != null) { + Object method = ReflectionUtil.invokeMethod(bean, "update", new Class[]{AppDataInfoModel.class}, new Object[]{appDataInfoModel}); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除系统功能 + * + * @param id 主键值 + * @return ignore + */ + @Operation(summary = "删除系统功能") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("system.menu") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + ModuleEntity entity = moduleService.getInfo(id); + if (entity != null) { + List list = moduleService.getList().stream().filter(t -> t.getParentId().equals(entity.getId())).collect(Collectors.toList()); + if (list.size() > 0) { + return ActionResult.fail("删除失败,请先删除子菜单。"); + } + moduleService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + /** + * 更新菜单状态 + * + * @param id 主键值 + * @return ignore + */ + @Operation(summary = "更新菜单状态") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("system.menu") + @PutMapping("/{id}/Actions/State") + public ActionResult upState(@PathVariable("id") String id) { + ModuleEntity entity = moduleService.getInfo(id); + if (entity != null) { + if (entity.getEnabledMark() == null || "1".equals(String.valueOf(entity.getEnabledMark()))) { + entity.setEnabledMark(0); + } else { + entity.setEnabledMark(1); + } + moduleService.update(id, entity); + //清除redis权限 + String cacheKey = cacheKeyUtil.getUserAuthorize() + userProvider.get().getUserId(); + if (redisUtil.exists(cacheKey)) { + redisUtil.remove(cacheKey); + } + return ActionResult.success(MsgCode.SU004.get()); + } + return ActionResult.fail(MsgCode.FA002.get()); + } + + /** + * 系统菜单导出功能 + * + * @param id 接口id + * @return ignore + */ + @Operation(summary = "导出系统菜单数据") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("system.menu") + @GetMapping("/{id}/Actions/Export") + public ActionResult exportFile(@PathVariable("id") String id) { + DownloadVO downloadVO = moduleService.exportData(id); + return ActionResult.success(downloadVO); + } + + /** + * 系统菜单导入功能 + * + * @param systemId 系统id + * @param multipartFile 文件 + * @param parentId 父级id + * @param category 分类 + * @return ignore + */ + @Operation(summary = "系统菜单导入功能") + @Parameters({ + @Parameter(name = "systemId", description = "系统id", required = true), + }) + @SaCheckPermission("system.menu") + @PostMapping(value = "/{systemId}/Actions/Import", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public ActionResult importFile(@PathVariable("systemId") String systemId, + @RequestPart("file") MultipartFile multipartFile, + @RequestParam("parentId") String parentId, + @RequestParam("category") String category) throws DataException { + //判断是否为.bm结尾 + if (FileUtil.existsSuffix(multipartFile, ModuleTypeEnum.SYSTEM_MODULE.getTableName())) { + return ActionResult.fail(MsgCode.IMP002.get()); + } + try { + //读取文件内容 + String fileContent = FileUtil.getFileContent(multipartFile); + //转model后导入 + ModuleExportModel exportModel = JsonUtil.getJsonToBean(fileContent, ModuleExportModel.class); + ModuleEntity moduleEntity = exportModel.getModuleEntity(); + if (!category.equals(moduleEntity.getCategory())) { + return ActionResult.fail("当前导入菜单为" + category.toUpperCase() + "端菜单,请在对应模块下导入!"); + } + if ("App".equals(moduleEntity.getCategory()) && "-1".equals(parentId)) { + return ActionResult.fail("请在顶级节点下创建目录后再进行菜单导入"); + } + // 设置系统id然后重新赋值 + moduleEntity.setSystemId(systemId); + moduleEntity.setId(null); + moduleEntity.setParentId(parentId); + //清空同步菜单记录 避免重复 + moduleEntity.setModuleId(null); + String enCode = moduleEntity.getEnCode(); + moduleEntity.setEnCode(moduleEntity.getEnCode() + "_" + RandomUtil.getRandomCode()); + if (moduleEntity.getType() == 3) { + moduleEntity.setUrlAddress(moduleEntity.getUrlAddress().replace(enCode, moduleEntity.getEnCode())); + } + if (moduleService.isExistByFullName(moduleEntity, moduleEntity.getCategory(), moduleEntity.getSystemId()) + // 导入编码相同导致前端路由跳转有问题,暂时取消编码验证,直接替换编码 +// || +// moduleService.isExistByEnCode(moduleEntity, moduleEntity.getCategory(), moduleEntity.getSystemId()) + ) { + return ActionResult.fail(MsgCode.IMP003.get()); + } + exportModel.setModuleEntity(moduleEntity); + boolean isExists = moduleService.importData(exportModel); + if (isExists) { + return ActionResult.fail(MsgCode.IMP003.get()); + } + } catch (Exception e) { + throw new DataException(MsgCode.IMP004.get()); + } + return ActionResult.success(MsgCode.IMP001.get()); + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/ModuleDataAuthorizeController.java b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/ModuleDataAuthorizeController.java new file mode 100644 index 0000000..2c7fd8f --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/ModuleDataAuthorizeController.java @@ -0,0 +1,306 @@ +package jnpf.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import jnpf.base.controller.SuperController; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.entity.ModuleDataAuthorizeSchemeEntity; +import jnpf.base.entity.ModuleEntity; +import jnpf.base.model.module.PropertyJsonModel; +import jnpf.base.service.ModuleDataAuthorizeSchemeService; +import jnpf.base.service.ModuleDataAuthorizeService; +import jnpf.base.service.ModuleService; +import jnpf.base.vo.ListVO; +import jnpf.base.entity.ModuleDataAuthorizeEntity; +import jnpf.constant.MsgCode; +import jnpf.emnus.SearchMethodEnum; +import jnpf.exception.DataException; +import jnpf.base.model.moduledataauthorize.DataAuthorizeCrForm; +import jnpf.base.model.moduledataauthorize.DataAuthorizeInfoVO; +import jnpf.base.model.moduledataauthorize.DataAuthorizeListVO; +import jnpf.base.model.moduledataauthorize.DataAuthorizeUpForm; +import jnpf.model.*; +import jnpf.model.visualJson.FieLdsModel; +import jnpf.model.visualJson.FormCloumnUtil; +import jnpf.model.visualJson.FormDataModel; +import jnpf.model.visualJson.TableModel; +import jnpf.model.visualJson.analysis.*; +import jnpf.permission.model.authorize.AuthorizeConditionEnum; +import jnpf.permission.model.authorize.ConditionModel; +import jnpf.util.JsonUtil; +import jnpf.util.JsonUtilEx; +import jnpf.util.ReflectionUtil; +import jnpf.util.StringUtil; +import jnpf.util.context.SpringContext; +import org.apache.commons.collections4.map.HashedMap; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; + + +/** + * 数据权限配置 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Tag(name = "数据权限字段管理", description = "ModuleDataAuthorize") +@RestController +@RequestMapping("/api/system/ModuleDataAuthorize") +public class ModuleDataAuthorizeController extends SuperController { + + @Autowired + private ModuleDataAuthorizeService dataAuthorizeService; + @Autowired + private ModuleDataAuthorizeSchemeService dataAuthorizeSchemeService; + @Autowired + private ModuleService moduleService; + + /** + * 获取数据权限配置信息列表 + * + * @param moduleId 功能主键 + * @return ignore + */ + @Operation(summary = "获取字段列表") + @Parameters({ + @Parameter(name = "moduleId", description = "功能主键", required = true) + }) + @SaCheckPermission("system.menu") + @GetMapping("/{moduleId}/List") + public ActionResult> list(@PathVariable("moduleId") String moduleId) { + List data = dataAuthorizeService.getList(moduleId); + List list = JsonUtil.getJsonToList(data, DataAuthorizeListVO.class); + list.stream().forEach(t->{ + String conditionSymbol = StringUtil.isNotEmpty(t.getConditionSymbol())?t.getConditionSymbol():""; + StringJoiner symbolJoiner = new StringJoiner(","); + String[] symbolSplit = conditionSymbol.split(","); + for(String id :symbolSplit){ + SearchMethodEnum itemMethod = SearchMethodEnum.getSearchMethod(id); + if(itemMethod!=null){ + symbolJoiner.add(itemMethod.getMessage()); + } + } + t.setConditionText(StringUtil.isNotEmpty(t.getConditionText())?t.getConditionText():""); + StringJoiner textJoiner = new StringJoiner(","); + String conditionText = StringUtil.isNotEmpty(t.getConditionText())?t.getConditionText():""; + String[] textSplit = conditionText.split(","); + for(String id :textSplit){ + AuthorizeConditionEnum itemMethod = AuthorizeConditionEnum.getByMessage(id); + if(itemMethod!=null){ + textJoiner.add(itemMethod.getMessage()); + } + } + t.setConditionSymbolName(symbolJoiner.toString()); + t.setConditionName(textJoiner.toString()); + if(StringUtil.isNotEmpty(t.getBindTable())){ + t.setEnCode(StringUtil.isNotEmpty(t.getEnCode()) ? t.getEnCode().replace(t.getBindTable() + ".", "") : ""); + } + }); + + ListVO vo = new ListVO<>(); + vo.setList(list); + return ActionResult.success(vo); + } + + /** + * 菜单数据权限 + * + * @param moduleId 功能主键 + * @return ignore + */ + @Operation(summary = "菜单数据权限") + @Parameters({ + @Parameter(name = "moduleId", description = "功能主键", required = true) + }) + @SaCheckPermission("system.menu") + @GetMapping("/{moduleId}/FieldList") + public ActionResult>> fieldList(@PathVariable("moduleId") String moduleId) { + List> list = new ArrayList<>(); + // 得到菜单id + ModuleEntity entity = moduleService.getInfo(moduleId); + PropertyJsonModel model = JsonUtil.getJsonToBean(entity.getPropertyJson(), PropertyJsonModel.class); + if (model == null) { + model = new PropertyJsonModel(); + } + // 得到bean + Object bean = SpringContext.getBean("visualdevServiceImpl"); + Object method = ReflectionUtil.invokeMethod(bean, "getInfo", new Class[]{String.class}, new Object[]{model.getModuleId()}); + Map map = JsonUtil.entityToMap(method); + if (map != null && map.containsKey("formData")) { + FormDataModel formDataModel = JsonUtil.getJsonToBean(String.valueOf(map.get("formData")), FormDataModel.class); + List fieLdsModelList = JsonUtil.getJsonToList(formDataModel.getFields(), FieLdsModel.class); + RecursionForm recursionForm = new RecursionForm(); + recursionForm.setList(fieLdsModelList); + recursionForm.setTableModelList(JsonUtil.getJsonToList(String.valueOf(map.get("tables")), TableModel.class)); + List formAllModel = new ArrayList<>(); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + for (FormAllModel allModel : formAllModel) { + if (FormEnum.table.getMessage().equals(allModel.getJnpfKey())) { + FormColumnTableModel childList = allModel.getChildList(); + List childList1 = childList.getChildList(); + for (FormColumnModel formColumnModel : childList1) { + FieLdsModel fieLdsModel = formColumnModel.getFieLdsModel(); + if (StringUtil.isNotEmpty(fieLdsModel.getVModel())) { + Map map1 = new HashedMap<>(); + map1.put("field", fieLdsModel.getVModel()); + map1.put("fieldName", fieLdsModel.getConfig().getLabel()); + list.add(map1); + } + } + } else + if (FormEnum.mast.getMessage().equals(allModel.getJnpfKey())) { + FormColumnModel formColumnModel = allModel.getFormColumnModel(); + FieLdsModel fieLdsModel = formColumnModel.getFieLdsModel(); + if (StringUtil.isNotEmpty(fieLdsModel.getVModel())) { + Map map1 = new HashedMap<>(); + map1.put("field", fieLdsModel.getVModel()); + map1.put("fieldName", fieLdsModel.getConfig().getLabel()); + list.add(map1); + } + } else if (FormEnum.mastTable.getMessage().equals(allModel.getJnpfKey())) { + FormMastTableModel formColumnModel = allModel.getFormMastTableModel(); + FieLdsModel fieLdsModel = formColumnModel.getMastTable().getFieLdsModel(); + if (StringUtil.isNotEmpty(fieLdsModel.getVModel())) { + Map map1 = new HashedMap<>(); + map1.put("field", fieLdsModel.getVModel()); + map1.put("fieldName", fieLdsModel.getConfig().getLabel()); + list.add(map1); + } + } + } + } + return ActionResult.success(list); + } + + /** + * 获取数据权限配置信息 + * + * @param id 主键值 + * @return ignore + * @throws DataException ignore + */ + @Operation(summary = "获取数据权限配置信息") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("system.menu") + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) throws DataException { + ModuleDataAuthorizeEntity entity = dataAuthorizeService.getInfo(id); + ModuleEntity moduleEntity = moduleService.getInfo(entity.getModuleId()); + if (moduleEntity != null && StringUtil.isNotEmpty(entity.getBindTable())) { + entity.setEnCode(StringUtil.isNotEmpty(entity.getEnCode()) ? entity.getEnCode().replace(entity.getBindTable() + ".", "") : ""); + } + DataAuthorizeInfoVO vo = JsonUtilEx.getJsonToBeanEx(entity, DataAuthorizeInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 新建数据权限配置 + * + * @param dataAuthorizeCrForm 实体对象 + * @return ignore + */ + @Operation(summary = "新建数据权限配置") + @Parameters({ + @Parameter(name = "dataAuthorizeCrForm", description = "实体对象", required = true) + }) + @SaCheckPermission("system.menu") + @PostMapping + public ActionResult create(@RequestBody @Valid DataAuthorizeCrForm dataAuthorizeCrForm) { + ModuleEntity moduleEntity = moduleService.getInfo(dataAuthorizeCrForm.getModuleId()); + ModuleDataAuthorizeEntity entity = JsonUtil.getJsonToBean(dataAuthorizeCrForm, ModuleDataAuthorizeEntity.class); + entity.setPropertyJson(dataAuthorizeCrForm.getChildTableKey()); + if (moduleEntity != null && moduleEntity.getType() == 3 && entity.getFieldRule() != 0 && StringUtil.isNotEmpty(entity.getBindTable())) { + String enCode = entity.getBindTable() + "." + entity.getEnCode(); + entity.setEnCode(enCode); + } + dataAuthorizeService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 更新数据权限配置 + * + * @param id 主键值 + * @param dataAuthorizeUpForm 实体对象 + * @return ignore + */ + @Operation(summary = "更新数据权限配置") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true), + @Parameter(name = "dataAuthorizeUpForm", description = "实体对象", required = true) + }) + @SaCheckPermission("system.menu") + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid DataAuthorizeUpForm dataAuthorizeUpForm) { + ModuleEntity moduleEntity = moduleService.getInfo(dataAuthorizeUpForm.getModuleId()); + ModuleDataAuthorizeEntity entity = JsonUtil.getJsonToBean(dataAuthorizeUpForm, ModuleDataAuthorizeEntity.class); + if (moduleEntity != null && moduleEntity.getType() == 3 && entity.getFieldRule() == 1 && StringUtil.isNotEmpty(entity.getBindTable())) { + String enCode = entity.getBindTable() + "." + entity.getEnCode(); + entity.setEnCode(enCode); + } + entity.setPropertyJson(dataAuthorizeUpForm.getChildTableKey()); + boolean flag = dataAuthorizeService.update(id, entity); + if (!flag) { + return ActionResult.success(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除数据权限配置 + * + * @param id 主键值 + * @return ignore + */ + @Operation(summary = "删除数据权限配置") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("system.menu") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + ModuleDataAuthorizeEntity entity = dataAuthorizeService.getInfo(id); + //菜单id + String moduleId = entity.getModuleId(); + //该菜单下的数据权限方案 + List list = dataAuthorizeSchemeService.getList(moduleId); + + String schemeName = null; + for (ModuleDataAuthorizeSchemeEntity schemeEntity : list) { + List conditionModels = JsonUtil.getJsonToList(schemeEntity.getConditionJson(), ConditionModel.class); + if (conditionModels != null) { + for (ConditionModel conditionModel : conditionModels) { + List groups = conditionModel.getGroups(); + for (ConditionModel.ConditionItemModel conditionItemModel : groups) { + if (conditionItemModel.getField().equalsIgnoreCase(entity.getEnCode())) { + schemeName = schemeEntity.getFullName(); + break; + } + } + } + } + } + if (StringUtil.isNotEmpty(schemeName)) { + return ActionResult.fail("该字段在方案 " + schemeName + " 中已被使用"); + } + if (entity != null) { + dataAuthorizeService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/ModuleDataAuthorizeLinkController.java b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/ModuleDataAuthorizeLinkController.java new file mode 100644 index 0000000..767d125 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/ModuleDataAuthorizeLinkController.java @@ -0,0 +1,184 @@ +package jnpf.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.hutool.core.util.ObjectUtil; +import com.google.common.base.CaseFormat; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.Pagination; +import jnpf.base.entity.ModuleDataAuthorizeLinkEntity; +import jnpf.base.entity.ModuleEntity; +import jnpf.base.model.dbtable.vo.DbFieldVO; +import jnpf.base.model.module.PropertyJsonModel; +import jnpf.base.model.moduledataauthorize.DataAuthorizeLinkForm; +import jnpf.base.model.moduledataauthorize.DataAuthorizeTableNameVO; +import jnpf.base.service.DbTableService; +import jnpf.base.service.ModuleDataAuthorizeLinkDataService; +import jnpf.base.service.ModuleService; +import jnpf.base.vo.PaginationVO; +import jnpf.database.model.dbfield.DbFieldModel; +import jnpf.model.visualJson.TableModel; +import jnpf.util.*; +import jnpf.util.context.SpringContext; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 数据权限字段管理 数据连接 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2022/6/7 + */ +@Tag(name = "数据权限字段管理数据连接" , description = "ModuleDataAuthorizeLink") +@RestController +@RequestMapping("/api/system/ModuleDataAuthorizeLink") +public class ModuleDataAuthorizeLinkController { + + @Autowired + private ModuleDataAuthorizeLinkDataService linkDataService; + @Autowired + private ModuleService moduleService; + @Autowired + private DbTableService dbTableService; + + /** + * 页面参数 + * + * @param linkForm 页面参数 + * @return + */ + @Operation(summary = "保存编辑数据连接") + @Parameters({ + @Parameter(name = "linkForm", description = "页面参数", required = true) + }) + @SaCheckPermission("system.menu") + @PostMapping("/saveLinkData") + public ActionResult saveLinkData(@RequestBody @Valid DataAuthorizeLinkForm linkForm) { + ModuleDataAuthorizeLinkEntity linkDataEntity = JsonUtil.getJsonToBean(linkForm, ModuleDataAuthorizeLinkEntity.class); + if (StringUtil.isEmpty(linkDataEntity.getId())) { + linkDataEntity.setId(RandomUtil.uuId()); + linkDataService.save(linkDataEntity); + return ActionResult.success("保存成功"); + } else { + linkDataService.updateById(linkDataEntity); + return ActionResult.success("更新成功"); + } + } + + /** + * 获取表名 + * + * @param menuId 菜单id + * @param type 分类 + * @return + */ + @Operation(summary = "获取表名") + @Parameters({ + @Parameter(name = "menuId", description = "菜单id", required = true), + @Parameter(name = "type", description = "分类", required = true) + }) + @SaCheckPermission("system.menu") + @GetMapping("/getVisualTables/{menuId}/{type}") + public ActionResult getVisualTables(@PathVariable("menuId") String menuId, @PathVariable("type") String type) { + ModuleEntity info = moduleService.getInfo(menuId); + DataAuthorizeTableNameVO vo = null; + if (ObjectUtil.isNotNull(info)) { + PropertyJsonModel model = JsonUtil.getJsonToBean(info.getPropertyJson(), PropertyJsonModel.class); + if (model == null) { + model = new PropertyJsonModel(); + } + //功能 + if (info.getType() == 3) { + // 得到bean + Object bean = SpringContext.getBean("visualdevServiceImpl"); + Object method = ReflectionUtil.invokeMethod(bean, "getInfo" , new Class[]{String.class}, new Object[]{model.getModuleId()}); + Map map = JsonUtil.entityToMap(method); + if (map != null) { + List tables = JsonUtil.getJsonToList(String.valueOf(map.get("tables")), TableModel.class); + List collect = tables.stream().map(t -> t.getTable()).collect(Collectors.toList()); + vo = DataAuthorizeTableNameVO.builder().linkTables(collect).linkId(String.valueOf(map.get("dbLinkId"))).build(); + } + } else { + ModuleDataAuthorizeLinkEntity linkDataEntity = linkDataService.getLinkDataEntityByMenuId(menuId,type); + String linkTables = linkDataEntity.getLinkTables(); + List tables = StringUtil.isNotEmpty(linkTables) ? Arrays.asList(linkTables.split(",")) : new ArrayList<>(); + vo = DataAuthorizeTableNameVO.builder().linkTables(tables).linkId(linkDataEntity.getLinkId()).build(); + } + } + return ActionResult.success(vo); + } + + /** + * 数据连接信息 + * + * @param menudId 菜单id + * @param type 分类 + * @return + */ + @Operation(summary = "数据连接信息") + @Parameters({ + @Parameter(name = "menudId", description = "菜单id", required = true), + @Parameter(name = "type", description = "分类", required = true) + }) + @SaCheckPermission("system.menu") + @GetMapping("/getInfo/{menudId}/{type}") + public ActionResult getInfo(@PathVariable("menudId") String menudId,@PathVariable("type") String type) { + ModuleDataAuthorizeLinkEntity linkDataEntity = linkDataService.getLinkDataEntityByMenuId(menudId,type); + DataAuthorizeLinkForm linkForm = JsonUtil.getJsonToBean(linkDataEntity, DataAuthorizeLinkForm.class); + return ActionResult.success(linkForm); + } + + /** + * 表名获取数据表字段 + * + * @param linkId 连接id + * @param tableName 表名 + * @param menuType 菜单类型 + * @param dataType 数据类型 + * @param pagination 分页模型 + * @return + * @throws Exception + */ + @Operation(summary = "表名获取数据表字段") + @Parameters({ + @Parameter(name = "linkId", description = "连接id", required = true), + @Parameter(name = "tableName", description = "表名", required = true), + @Parameter(name = "menuType", description = "菜单类型", required = true), + @Parameter(name = "dataType", description = "数据类型", required = true) + }) + @SaCheckPermission("system.menu") + @GetMapping("/{linkId}/Tables/{tableName}/Fields/{menuType}/{dataType}") + public ActionResult getTableInfoByTableName(@PathVariable("linkId") String linkId, @PathVariable("tableName") String tableName, @PathVariable("menuType") Integer menuType,@PathVariable("dataType") Integer dataType, Pagination pagination) throws Exception { + List data = dbTableService.getFieldList(linkId, tableName); + List vos = JsonUtil.getJsonToList(data, DbFieldVO.class); + if (StringUtil.isNotEmpty(pagination.getKeyword())) { + vos = vos.stream().filter(vo -> { + boolean ensure; + String fieldName = vo.getFieldName(); + fieldName = Optional.ofNullable(fieldName).orElse(""); + ensure = fieldName.toLowerCase().contains(pagination.getKeyword().toLowerCase()) || vo.getField().toLowerCase().contains(pagination.getKeyword().toLowerCase()); + return ensure; + }).collect(Collectors.toList()); + } + if (menuType==2 && dataType!=3){ + for (DbFieldVO vo : vos){ + String name = vo.getField().toLowerCase().replaceAll("f_", ""); + vo.setField(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, name)); + } + } + List listPage = PageUtil.getListPage((int) pagination.getCurrentPage(), (int) pagination.getPageSize(), vos); + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + paginationVO.setTotal(vos.size()); + return ActionResult.page(listPage,paginationVO); + } +} + diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/ModuleDataAuthorizeSchemeController.java b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/ModuleDataAuthorizeSchemeController.java new file mode 100644 index 0000000..a489721 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/ModuleDataAuthorizeSchemeController.java @@ -0,0 +1,163 @@ +package jnpf.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import jnpf.base.controller.SuperController; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.service.ModuleDataAuthorizeSchemeService; +import jnpf.base.vo.ListVO; +import jnpf.base.entity.ModuleDataAuthorizeSchemeEntity; +import jnpf.constant.MsgCode; +import jnpf.exception.DataException; +import jnpf.base.model.moduledataauthorizescheme.DataAuthorizeSchemeCrForm; +import jnpf.base.model.moduledataauthorizescheme.DataAuthorizeSchemeInfoVO; +import jnpf.base.model.moduledataauthorizescheme.DataAuthorizeSchemeListVO; +import jnpf.base.model.moduledataauthorizescheme.DataAuthorizeSchemeUpForm; +import jnpf.util.JsonUtil; +import jnpf.util.JsonUtilEx; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; + +/** + * 数据权限方案 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Tag(name = "数据权限方案", description = "ModuleDataAuthorizeScheme") +@RestController +@RequestMapping("/api/system/ModuleDataAuthorizeScheme") +public class ModuleDataAuthorizeSchemeController extends SuperController { + + @Autowired + private ModuleDataAuthorizeSchemeService schemeService; + + /** + * 列表 + * + * @param moduleId 功能主键 + * @return ignore + */ + @Operation(summary = "方案列表") + @Parameters({ + @Parameter(name = "moduleId", description = "功能主键", required = true) + }) + @GetMapping("/{moduleId}/List") + public ActionResult> list(@PathVariable("moduleId") String moduleId) { + List data = schemeService.getList(moduleId); + List list = JsonUtil.getJsonToList(data, DataAuthorizeSchemeListVO.class); + ListVO vo = new ListVO<>(); + vo.setList(list); + return ActionResult.success(vo); + } + + /** + * 信息 + * + * @param id 主键值 + * @return ignore + * @throws DataException ignore + */ + @Operation(summary = "获取方案信息") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("system.menu") + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) throws DataException { + ModuleDataAuthorizeSchemeEntity entity = schemeService.getInfo(id); + DataAuthorizeSchemeInfoVO vo = JsonUtilEx.getJsonToBeanEx(entity, DataAuthorizeSchemeInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 新建 + * + * @param dataAuthorizeSchemeCrForm 实体对象 + * @return ignore + */ + @Operation(summary = "新建方案") + @Parameters({ + @Parameter(name = "dataAuthorizeSchemeCrForm", description = "实体对象", required = true) + }) + @SaCheckPermission("system.menu") + @PostMapping + public ActionResult create(@RequestBody @Valid DataAuthorizeSchemeCrForm dataAuthorizeSchemeCrForm) { + ModuleDataAuthorizeSchemeEntity entity = JsonUtil.getJsonToBean(dataAuthorizeSchemeCrForm, ModuleDataAuthorizeSchemeEntity.class); + // 判断fullName是否重复 + if (schemeService.isExistByFullName(entity.getId(), entity.getFullName(), entity.getModuleId())) { + return ActionResult.fail("已存在相同名称"); + } + // 判断encode是否重复 + if (schemeService.isExistByEnCode(entity.getId(), entity.getEnCode(), entity.getModuleId())) { + return ActionResult.fail("已存在相同编码"); + } + schemeService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 更新 + * + * @param id 主键值 + * @param dataAuthorizeSchemeUpForm 实体对象 + * @return ignore + */ + @Operation(summary = "更新方案") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true), + @Parameter(name = "dataAuthorizeSchemeUpForm", description = "实体对象", required = true) + }) + @SaCheckPermission("system.menu") + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid DataAuthorizeSchemeUpForm dataAuthorizeSchemeUpForm) { + ModuleDataAuthorizeSchemeEntity entity = JsonUtil.getJsonToBean(dataAuthorizeSchemeUpForm, ModuleDataAuthorizeSchemeEntity.class); + // 判断encode是否重复 + if ("1".equals(String.valueOf(entity.getAllData()))) { + return ActionResult.fail("修改失败,该方案不允许编辑"); + } + // 判断fullName是否重复 + if (schemeService.isExistByFullName(id, entity.getFullName(), entity.getModuleId())) { + return ActionResult.fail("已存在相同名称"); + } + // 判断encode是否重复 + if (schemeService.isExistByEnCode(id, entity.getEnCode(), entity.getModuleId())) { + return ActionResult.fail("已存在相同编码"); + } + boolean flag = schemeService.update(id, entity); + if (!flag) { + return ActionResult.success(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除 + * + * @param id 主键值 + * @return ignore + */ + @Operation(summary = "删除方案") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("system.menu") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + ModuleDataAuthorizeSchemeEntity entity = schemeService.getInfo(id); + if (entity != null) { + schemeService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/ModuleFormController.java b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/ModuleFormController.java new file mode 100644 index 0000000..75d1e27 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/ModuleFormController.java @@ -0,0 +1,351 @@ +package jnpf.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import jnpf.base.controller.SuperController; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.Pagination; +import jnpf.base.entity.ModuleEntity; +import jnpf.base.entity.ModuleFormEntity; +import jnpf.base.model.form.*; +import jnpf.base.model.module.PropertyJsonModel; +import jnpf.base.service.ModuleFormService; +import jnpf.base.service.ModuleService; +import jnpf.base.vo.ListVO; +import jnpf.constant.MsgCode; +import jnpf.exception.DataException; +import jnpf.model.*; +import jnpf.model.visualJson.FieLdsModel; +import jnpf.model.visualJson.FormCloumnUtil; +import jnpf.model.visualJson.FormDataModel; +import jnpf.model.visualJson.TableModel; +import jnpf.model.visualJson.analysis.*; +import jnpf.util.JsonUtil; +import jnpf.util.JsonUtilEx; +import jnpf.util.ReflectionUtil; +import jnpf.util.StringUtil; +import jnpf.util.context.SpringContext; +import org.apache.commons.collections4.map.HashedMap; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 表单权限 + * 版本: V3.1.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2021-09-14 + */ +@Tag(name = "表单权限", description = "ModuleForm") +@RestController +@RequestMapping("/api/system/ModuleForm") +public class ModuleFormController extends SuperController { + + @Autowired + private ModuleFormService moduleFormService; + @Autowired + private ModuleService moduleService; + + /** + * 获取表单权限列表 + * + * @param moduleId 功能主键 + * @param pagination 分页参数 + * @return ignore + */ + @Operation(summary = "获取表单权限列表") + @Parameters({ + @Parameter(name = "moduleId", description = "功能主键", required = true) + }) + @SaCheckPermission("system.menu") + @GetMapping("/{moduleId}/Fields") + public ActionResult> getList(@PathVariable("moduleId") String moduleId, Pagination pagination) { + List list = moduleFormService.getList(moduleId, pagination); + List voList = JsonUtil.getJsonToList(list, ModuleFormListVO.class); + voList.stream().forEach(t-> { + String enCode = t.getEnCode(); + if (StringUtil.isNotEmpty(enCode)) { + if (enCode.contains("-")){ + enCode = enCode.substring(enCode.indexOf("-")+1); + } + t.setEnCode(enCode.replace("jnpf_" + t.getBindTable() + "_jnpf_", "")); + } + }); + ListVO vo = new ListVO<>(); + vo.setList(voList); + return ActionResult.success(vo); + } + + /** + * 菜单数据权限 + * + * @param moduleId 功能主键 + * @return ignore + */ + @Operation(summary = "菜单数据权限") + @Parameters({ + @Parameter(name = "moduleId", description = "功能主键", required = true) + }) + @SaCheckPermission("system.menu") + @GetMapping("/{moduleId}/FieldList") + public ActionResult>> fieldList(@PathVariable("moduleId") String moduleId) { + List> list = new ArrayList<>(); + // 得到菜单id + ModuleEntity entity = moduleService.getInfo(moduleId); + PropertyJsonModel model = JsonUtil.getJsonToBean(entity.getPropertyJson(), PropertyJsonModel.class); + if (model == null) { + model = new PropertyJsonModel(); + } + // 得到bean + Object bean = SpringContext.getBean("visualdevServiceImpl"); + Object method = ReflectionUtil.invokeMethod(bean, "getInfo", new Class[]{String.class}, new Object[]{model.getModuleId()}); + Map map = JsonUtil.entityToMap(method); + if (map != null && map.containsKey("formData")) { + FormDataModel formDataModel = JsonUtil.getJsonToBean(String.valueOf(map.get("formData")), FormDataModel.class); + List fieLdsModelList = JsonUtil.getJsonToList(formDataModel.getFields(), FieLdsModel.class); + RecursionForm recursionForm = new RecursionForm(); + recursionForm.setList(fieLdsModelList); + recursionForm.setTableModelList(JsonUtil.getJsonToList(String.valueOf(map.get("tables")), TableModel.class)); + List formAllModel = new ArrayList<>(); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + for (FormAllModel allModel : formAllModel) { + if (FormEnum.table.getMessage().equals(allModel.getJnpfKey())) { + FormColumnTableModel childList = allModel.getChildList(); + Map map1 = new HashedMap<>(); + map1.put("field", childList.getTableModel()); + map1.put("fieldName", childList.getLabel()); + list.add(map1); + } else if (FormEnum.mast.getMessage().equals(allModel.getJnpfKey())) { + FormColumnModel formColumnModel = allModel.getFormColumnModel(); + FieLdsModel fieLdsModel = formColumnModel.getFieLdsModel(); + if (StringUtil.isNotEmpty(fieLdsModel.getVModel())) { + Map map1 = new HashedMap<>(); + map1.put("field", fieLdsModel.getVModel()); + map1.put("fieldName", fieLdsModel.getConfig().getLabel()); + list.add(map1); + } + } else if (FormEnum.mastTable.getMessage().equals(allModel.getJnpfKey())) { + FormMastTableModel formColumnModel = allModel.getFormMastTableModel(); + FieLdsModel fieLdsModel = formColumnModel.getMastTable().getFieLdsModel(); + if (StringUtil.isNotEmpty(fieLdsModel.getVModel())) { + Map map1 = new HashedMap<>(); + map1.put("field", fieLdsModel.getVModel()); + map1.put("fieldName", fieLdsModel.getConfig().getLabel()); + list.add(map1); + } + } + } + } + return ActionResult.success(list); + } + + /** + * 获取表单权限信息 + * + * @param id 主键值 + * @return ignore + * @throws DataException ignore + */ + @Operation(summary = "获取表单权限信息") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) throws DataException { + ModuleFormEntity entity = moduleFormService.getInfo(id); + String enCode = entity.getEnCode(); + if (StringUtil.isNotEmpty(enCode)) { + if (enCode.contains("-") && entity.getFieldRule()==2){ + enCode = enCode.substring(enCode.indexOf("-")+1); + entity.setEnCode(enCode); + } + if (entity.getFieldRule()==1 && entity.getBindTable()!=null){ + entity.setEnCode(enCode.replace("jnpf_" + entity.getBindTable() + "_jnpf_", "")); + } + } + ModuleFormInfoVO vo = JsonUtilEx.getJsonToBeanEx(entity, ModuleFormInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 新建表单权限 + * + * @param moduleFormCrForm 实体对象 + * @return ignore + */ + @Operation(summary = "新建表单权限") + @Parameters({ + @Parameter(name = "moduleFormCrForm", description = "实体对象", required = true) + }) + @SaCheckPermission("system.menu") + @PostMapping + public ActionResult create(@RequestBody @Valid ModuleFormCrForm moduleFormCrForm) { + ModuleEntity moduleEntity = moduleService.getInfo(moduleFormCrForm.getModuleId()); + ModuleFormEntity entity = JsonUtil.getJsonToBean(moduleFormCrForm, ModuleFormEntity.class); + + if (moduleEntity != null){ + PropertyJsonModel model = JsonUtil.getJsonToBean(moduleEntity.getPropertyJson(), PropertyJsonModel.class); + if (model == null) { + model = new PropertyJsonModel(); + } + if (entity.getFieldRule() == 1 && StringUtil.isNotEmpty(moduleFormCrForm.getBindTable())) { + String enCode = "jnpf_" + moduleFormCrForm.getBindTable() + "_jnpf_" + entity.getEnCode(); + entity.setEnCode(enCode); + } + + if (entity.getFieldRule() == 2 && StringUtil.isNotEmpty(moduleFormCrForm.getChildTableKey())) { + // 得到bean +// Object bean = SpringContext.getBean("visualdevServiceImpl"); +// Object method = ReflectionUtil.invokeMethod(bean, "getTableNameToKey", new Class[]{String.class}, new Object[]{model.getModuleId()}); +// Map map = JsonUtil.entityToMap(method); +// +// String enCode = map.get(moduleFormCrForm.getBindTable().toLowerCase()) + "-" + entity.getEnCode(); + String enCode = moduleFormCrForm.getChildTableKey() + "-" + entity.getEnCode(); + entity.setEnCode(enCode); + } + } + if (moduleFormService.isExistByEnCode(entity.getModuleId(), entity.getEnCode(), entity.getId())) { + return ActionResult.fail("字段名称不能重复"); + } + moduleFormService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 更新表单权限 + * + * @param id 主键值 + * @param moduleFormUpForm 实体对象 + * @return ignore + */ + @Operation(summary = "更新表单权限") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true), + @Parameter(name = "moduleFormUpForm", description = "实体对象", required = true) + }) + @SaCheckPermission("system.menu") + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid ModuleFormUpForm moduleFormUpForm) { + ModuleEntity moduleEntity = moduleService.getInfo(moduleFormUpForm.getModuleId()); + ModuleFormEntity entity = JsonUtil.getJsonToBean(moduleFormUpForm, ModuleFormEntity.class); + if (moduleEntity != null){ + PropertyJsonModel model = JsonUtil.getJsonToBean(moduleEntity.getPropertyJson(), PropertyJsonModel.class); + if (model == null) { + model = new PropertyJsonModel(); + } + if (entity.getFieldRule() == 1 && StringUtil.isNotEmpty(moduleFormUpForm.getBindTable())) { + String enCode = "jnpf_" + moduleFormUpForm.getBindTable() + "_jnpf_" + entity.getEnCode(); + entity.setEnCode(enCode); + } + + if (entity.getFieldRule() == 2 && StringUtil.isNotEmpty(moduleFormUpForm.getChildTableKey())) { +// // 得到bean +// Object bean = SpringContext.getBean("visualdevServiceImpl"); +// Object method = ReflectionUtil.invokeMethod(bean, "getTableNameToKey", new Class[]{String.class}, new Object[]{model.getModuleId()}); +// Map map = JsonUtil.entityToMap(method); +// +// String enCode = map.get(moduleFormUpForm.getBindTable().toLowerCase()) + "-" + entity.getEnCode(); + String enCode = moduleFormUpForm.getChildTableKey() + "-" + entity.getEnCode(); + entity.setEnCode(enCode); + } + } + if (moduleFormService.isExistByEnCode(entity.getModuleId(), entity.getEnCode(), id)) { + return ActionResult.fail("字段名称不能重复"); + } + boolean flag = moduleFormService.update(id, entity); + if (!flag) { + return ActionResult.success(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除表单权限 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "删除表单权限") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("system.menu") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + ModuleFormEntity entity = moduleFormService.getInfo(id); + if (entity != null) { + moduleFormService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + /** + * 批量新建 + * + * @param formBatchForm 批量表单模型 + * @return + */ + @Operation(summary = "批量新建表单权限") + @Parameters({ + @Parameter(name = "formBatchForm", description = "批量表单模型", required = true) + }) + @SaCheckPermission("system.menu") + @PostMapping("/Actions/Batch") + public ActionResult batchCreate(@RequestBody @Valid FormBatchForm formBatchForm) { + List entitys = formBatchForm.getFormJson() != null ? JsonUtil.getJsonToList(formBatchForm.getFormJson(), ModuleFormEntity.class) : new ArrayList<>(); + List name = new ArrayList<>(); + for (ModuleFormEntity entity : entitys) { + if (entity.getFieldRule() == 1 ) { + String enCode = "jnpf_" + entity.getBindTable() + "_jnpf_" + entity.getEnCode(); + entity.setEnCode(enCode); + } + if (entity.getFieldRule() == 2 ) { + String enCode = entity.getChildTableKey() + "-" + entity.getEnCode(); + entity.setEnCode(enCode); + } + entity.setModuleId(formBatchForm.getModuleId()); + if (moduleFormService.isExistByEnCode(entity.getModuleId(), entity.getEnCode(), null)) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + if (name.contains(entity.getEnCode())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + name.add(entity.getEnCode()); + } + moduleFormService.create(entitys); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 更新表单权限状态 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "更新表单权限状态") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("system.menu") + @PutMapping("/{id}/Actions/State") + public ActionResult upState(@PathVariable("id") String id) { + ModuleFormEntity entity = moduleFormService.getInfo(id); + entity.setEnabledMark("1".equals(String.valueOf(entity.getEnabledMark())) ? 0 : 1); + boolean flag = moduleFormService.update(id, entity); + if (!flag) { + return ActionResult.success(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/MonitorController.java b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/MonitorController.java new file mode 100644 index 0000000..745c0ca --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/MonitorController.java @@ -0,0 +1,42 @@ +package jnpf.base.controller; + + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.model.monitor.MonitorListVO; +import jnpf.util.JsonUtil; +import jnpf.base.util.MonitorUtil; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 系统监控 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Tag(name = "系统监控", description = "Monitor") +@RestController +@RequestMapping("/api/system/Monitor") +public class MonitorController { + + /** + * 系统监控 + * + * @return ignore + */ + @Operation(summary = "系统监控") + @SaCheckPermission("system.monitor") + @GetMapping + public ActionResult list() { + MonitorUtil monitorUtil = new MonitorUtil(); + MonitorListVO vo = JsonUtil.getJsonToBean(monitorUtil, MonitorListVO.class); + vo.setTime(System.currentTimeMillis()); + return ActionResult.success(vo); + } +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/PortalManageController.java b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/PortalManageController.java new file mode 100644 index 0000000..0548f93 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/PortalManageController.java @@ -0,0 +1,96 @@ +package jnpf.base.controller; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import jnpf.base.ActionResult; +import jnpf.base.entity.PortalManageEntity; +import jnpf.base.model.portalManage.*; +import jnpf.base.service.PortalManageService; +import jnpf.base.vo.PageListVO; +import jnpf.constant.MsgCode; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 门户管理 + * + * @author JNPF开发平台组 YanYu + * @version v3.4.6 + * @copyrignt 引迈信息技术有限公司 + * @date 2023-02-16 + */ +@Slf4j +@RestController +@Tag(name = "门户管理", description = "PortalManage") +@RequestMapping("/api/system/PortalManage") +public class PortalManageController extends SuperController { + + @Autowired + PortalManageService portalManageService; +// @Autowired +// PortalService portalApi; +// @Autowired +// private AuthorizeService authorizeService; + + @Operation(summary = "新增") + @PostMapping + public ActionResult create(@RequestBody @Valid PortalManageCreForm portalManageForm) { + PortalManageEntity entity = portalManageForm.convertEntity(); + try { + portalManageService.checkCreUp(entity); + } catch (Exception e) { + return ActionResult.fail(e.getMessage()); + } + portalManageService.save(entity); + return ActionResult.success(MsgCode.SU018.get()); + } + + @Operation(summary = "删除") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable String id) { + boolean flag = portalManageService.removeById(id); + if(flag){ + // 删除绑定的所有权限 +// authorizeService.remove(new AuthorizePortalManagePrimary(null, id).getQuery()); + return ActionResult.success(MsgCode.SU003.get()); + } else { + return ActionResult.fail("删除失败"); + } + } + + @Operation(summary = "编辑") + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid PortalManageUpForm portalManageUpForm){ + PortalManageEntity update = portalManageUpForm.convertEntity(); + try { + portalManageService.checkCreUp(update); + } catch (Exception e) { + return ActionResult.fail(e.getMessage()); + } + portalManageService.updateById(update); + return ActionResult.success(MsgCode.SU004.get()); + } + + @Operation(summary = "查看") + @GetMapping("/{id}") + public ActionResult getOne(@PathVariable("id") String id) { + PortalManageEntity entity = portalManageService.getById(id); + return ActionResult.success(portalManageService.convertVO(entity)); + } + + @Operation(summary = "列表") + @GetMapping("/list/{systemId}") + public ActionResult> getPage(@PathVariable("systemId") String systemId, PortalManagePage pmPage) { + pmPage.setSystemId(systemId); + return ActionResult.page( + portalManageService.getPage(pmPage).getRecords() + .stream().map(PortalManagePageDO::convert).collect(Collectors.toList()), + pmPage.getPaginationVO()); + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/PrintDevController.java b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/PrintDevController.java new file mode 100644 index 0000000..207f536 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/PrintDevController.java @@ -0,0 +1,452 @@ +package jnpf.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.controller.SuperController; +import jnpf.base.entity.DictionaryDataEntity; +import jnpf.base.entity.DictionaryTypeEntity; +import jnpf.base.service.DictionaryDataService; +import jnpf.base.service.DictionaryTypeService; +import jnpf.base.vo.DownloadVO; +import jnpf.base.vo.ListVO; +import jnpf.base.vo.PageListVO; +import jnpf.base.vo.PaginationVO; +import jnpf.config.ConfigValueUtil; +import jnpf.constant.MsgCode; +import jnpf.exception.DataException; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.UserService; +import jnpf.base.entity.OperatorRecordEntity; +import jnpf.base.entity.PrintDevEntity; +import jnpf.base.model.PaginationPrint; +import jnpf.base.model.PrintTableTreeModel; +import jnpf.base.model.dto.PrintDevFormDTO; +import jnpf.base.model.print.PrintOption; +import jnpf.base.model.query.PrintDevDataQuery; +import jnpf.base.model.query.PrintDevFieldsQuery; +import jnpf.base.model.vo.PrintDevListVO; +import jnpf.base.model.vo.PrintDevVO; +import jnpf.base.service.IPrintDevService; +import jnpf.util.*; +import jnpf.emnus.ModuleTypeEnum; +import jnpf.util.FileExport; +import jnpf.util.treeutil.SumTree; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 打印模板 -控制器 + * + * @author JNPF开发平台组 YY + * @version V3.2.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月30日 + */ +@Tag(name = "打印模板", description = "print") +@RestController +@RequestMapping("/api/system/printDev") +public class PrintDevController extends SuperController { + + @Autowired + private IPrintDevService iPrintDevService; + @Autowired + private FileExport fileExport; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private DictionaryDataService dictionaryDataService; + @Autowired + private DictionaryTypeService dictionaryTypeService; + @Autowired + private UserService userService; + + /** + * 查询打印列表 + * @param ids + * @return + */ + @Operation(summary = "查询打印列表") + @Parameters({ + @Parameter(name = "ids", description = "主键集合") + }) + @SaCheckPermission("system.printDev") + @PostMapping("getListById") + public List getListById(@RequestBody List ids) { + + + return iPrintDevService.getPrintTemplateOptions(ids); + } + + @Operation(summary = "查询打印列表") + @Parameters({ + @Parameter(name = "data", description = "打印模板-数查询对象") + }) + @SaCheckPermission("system.printDev") + @PostMapping("getListOptions") + public ActionResult getListOptions(@RequestBody PrintDevDataQuery data) { + List ids = data.getIds(); + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().in(PrintDevEntity::getId,ids); + wrapper.lambda().eq(PrintDevEntity::getEnabledMark,1); + List list = iPrintDevService.getBaseMapper().selectList(wrapper); + List options = JsonUtil.getJsonToList(list, PrintOption.class); + return ActionResult.success(options); + } + + + + /*============增删改==============*/ + + /** + * 新增打印模板对象 + * + * @param printDevForm 打印模板数据传输对象 + * @return 执行结果标识 + */ + @Operation(summary = "新增") + @Parameters({ + @Parameter(name = "printDevForm", description = "打印模板数据传输对象") + }) + @SaCheckPermission("system.printDev") + @PostMapping + public ActionResult create(@RequestBody @Valid PrintDevFormDTO printDevForm) { + PrintDevEntity printDevEntity = JsonUtil.getJsonToBean(printDevForm, PrintDevEntity.class); + // 校验 + try{ + iPrintDevService.creUpdateCheck(printDevEntity, true, true); + }catch (Exception e){ + return ActionResult.fail(e.getMessage()); + } + printDevEntity.setId(RandomUtil.uuId()); + iPrintDevService.save(printDevEntity); + return ActionResult.success(MsgCode.SU001.get()); + } + + @Operation(summary = "Sql数据获取") + @GetMapping("/BatchData") + public ActionResult getBatchData(PrintDevDataQuery printDevSqlDataQuery) { + String id = XSSEscape.escape(printDevSqlDataQuery.getId()); + String formId = XSSEscape.escape(printDevSqlDataQuery.getFormId()); + PrintDevEntity entity = iPrintDevService.getById(id); + if(entity == null){ + return ActionResult.fail(MsgCode.PRI001.get()); + } + + ArrayList list = new ArrayList<>(); + List record = Arrays.asList(formId.split(",")); + record.forEach(rid->{ + list.add(iPrintDevService.getDataMap(entity,rid)); + }); + return ActionResult.success(list); + } + + /** + * 删除打印模板 + * + * @param id 打印模板id + * @param printDevForm 打印模板数据传输对象 + * @return 执行结果标识 + */ + @Operation(summary = "编辑") + @Parameters({ + @Parameter(name = "id", description = "打印模板id"), + @Parameter(name = "printDevForm", description = "打印模板数据传输对象") + }) + @SaCheckPermission("system.printDev") + @PutMapping("/{id}") + public ActionResult update(@PathVariable String id, @RequestBody @Valid PrintDevFormDTO printDevForm) { + PrintDevEntity printDevEntity = JsonUtil.getJsonToBean(printDevForm, PrintDevEntity.class); + PrintDevEntity originEntity = iPrintDevService.getById(id); + try{ + iPrintDevService.creUpdateCheck(printDevEntity, + !originEntity.getFullName().equals(printDevForm.getFullName()), + !originEntity.getEnCode().equals(printDevForm.getEnCode())); + }catch (Exception e){ + return ActionResult.fail(e.getMessage()); + } + printDevEntity.setId(id); + iPrintDevService.updateById(printDevEntity); + return ActionResult.success(MsgCode.SU004.get()); + } + + + /** + * 复制打印模板 + * + * @param id 打印模板id + * @return 执行结果标识 + */ + @Operation(summary = "复制") + @Parameters({ + @Parameter(name = "id", description = "打印模板id") + }) + @SaCheckPermission("system.printDev") + @PostMapping("/{id}/Actions/Copy") + public ActionResult> copy(@PathVariable String id) { + int randomNum = (int)(Math.random() * 100000); + PrintDevEntity entity = iPrintDevService.getById(id); + entity.setFullName(entity.getFullName() + ".副本" + randomNum); + if(entity.getFullName().length() > 50){ + return ActionResult.fail(MsgCode.PRI006.get()); + } + entity.setEnCode(entity.getEnCode() + "." + randomNum); + entity.setId(RandomUtil.uuId()); + entity.setEnabledMark(0); + entity.setLastModifyTime(null); + entity.setLastModifyUserId(null); + entity.setId(RandomUtil.uuId()); + entity.setCreatorTime(new Date()); + entity.setCreatorUserId(UserProvider.getLoginUserId()); + PrintDevEntity entityBean = JsonUtil.getJsonToBean(entity, PrintDevEntity.class); + iPrintDevService.save(entityBean); + return ActionResult.success(MsgCode.SU007.get()); + } + + /** + * 删除打印模板 + * + * @param id 打印模板id + * @return ignore + */ + @Operation(summary = "删除") + @Parameters({ + @Parameter(name = "id", description = "打印模板id") + }) + @SaCheckPermission("system.printDev") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable String id) { + //对象存在判断 + if (iPrintDevService.getById(id) != null) { + iPrintDevService.removeById(id); + return ActionResult.success(MsgCode.SU003.get()); + } else { + return ActionResult.fail(MsgCode.FA003.get()); + } + } + + /** + * 修改打印模板可用状态 + * + * @param id 打印模板id + * @return 执行结果标识 + */ + @Operation(summary = "修改状态") + @Parameters({ + @Parameter(name = "id", description = "打印模板id") + }) + @SaCheckPermission("system.printDev") + @PutMapping("/{id}/Actions/State") + public ActionResult> state(@PathVariable String id) { + PrintDevEntity entity = iPrintDevService.getById(id); + if (entity != null) { + if ("1".equals(entity.getEnabledMark().toString())) { + entity.setEnabledMark(0); + } else { + entity.setEnabledMark(1); + } + iPrintDevService.updateById(entity); + return ActionResult.success(MsgCode.SU004.get()); + } + return ActionResult.fail(MsgCode.FA002.get()); + } + + /*============查询==============*/ + + /** + * 查看单个模板详情 + * + * @param id 打印模板id + * @return 单个模板对象 + */ + @Operation(summary = "预览") + @Parameters({ + @Parameter(name = "id", description = "打印模板id") + }) + @SaCheckPermission("system.printDev") + @GetMapping("/{id}") + public ActionResult info(@PathVariable String id) { + return ActionResult.success(iPrintDevService.getById(id)); + } + + /** + * 查看所有模板 + * + * @return 所有模板集合 + */ + @Operation(summary = "列表") + @SaCheckPermission("system.printDev") + @GetMapping + public ActionResult list(PaginationPrint paginationPrint) { + List list = iPrintDevService.getList(paginationPrint); + List userId = list.stream().map(t -> t.getCreatorUserId()).collect(Collectors.toList()); + List lastUserId = list.stream().map(t -> t.getLastModifyUserId()).collect(Collectors.toList()); + lastUserId.removeAll(Collections.singleton(null)); + List userEntities = userService.getUserName(userId); + List lastUserIdEntities = userService.getUserName(lastUserId); + DictionaryTypeEntity typeEntity = dictionaryTypeService.getInfoByEnCode("printDev"); + List typeList = dictionaryDataService.getList(typeEntity.getId()); + List listVOS = new ArrayList<>(); + for (PrintDevEntity entity : list) { + PrintDevListVO vo = JsonUtil.getJsonToBean(entity, PrintDevListVO.class); + DictionaryDataEntity dataEntity = typeList.stream().filter(t -> t.getEnCode().equals(entity.getCategory())).findFirst().orElse(null); + if (dataEntity != null) { + vo.setCategory(dataEntity.getFullName()); + } else { + vo.setCategory(""); + } + //创建者 + UserEntity creatorUser = userEntities.stream().filter(t -> t.getId().equals(entity.getCreatorUserId())).findFirst().orElse(null); + vo.setCreatorUser(creatorUser != null ? creatorUser.getRealName() + "/" + creatorUser.getAccount() : entity.getCreatorUserId()); + //修改人 + UserEntity lastModifyUser = lastUserIdEntities.stream().filter(t -> t.getId().equals(entity.getLastModifyUserId())).findFirst().orElse(null); + vo.setLastModifyUser(lastModifyUser != null ? lastModifyUser.getRealName() + "/" + lastModifyUser.getAccount() : entity.getLastModifyUserId()); + listVOS.add(vo); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(paginationPrint, PaginationVO.class); + return ActionResult.page(listVOS , paginationVO); + } + + /** + * 下拉列表 + * + * @return 返回列表数据 + */ + @Operation(summary = "下拉列表") + @GetMapping("/Selector") + public ActionResult> selectorList(Integer type){ + ListVO vo = new ListVO<>(); + try{ + vo.setList(iPrintDevService.getTreeModel(type)); + return ActionResult.success(vo); + }catch (Exception e){ + return ActionResult.fail(e.getMessage()); + } + } + + /** + * 根据sql获取内容 + * @param printDevSqlDataQuery 打印模板查询对象 + * @return 打印模板对应内容 + */ + @Operation(summary = "Sql数据获取") + @SaCheckPermission("system.printDev") + @GetMapping("/Data") + public ActionResult> getFieldData(PrintDevDataQuery printDevSqlDataQuery) { + String id = XSSEscape.escape(printDevSqlDataQuery.getId()); + String formId = XSSEscape.escape(printDevSqlDataQuery.getFormId()); + PrintDevEntity entity = iPrintDevService.getById(id); + if(entity == null){ + return ActionResult.fail(MsgCode.PRI001.get()); + } + Map printDataMap; + try { + printDataMap = iPrintDevService.getDataBySql( + entity.getDbLinkId(), + entity.getSqlTemplate().replaceAll("@formId", "'" + formId + "'")); + } catch (Exception e) { + e.printStackTrace(); + return ActionResult.fail(e.getMessage()); + } + List> headTableList = (List>) printDataMap.get("headTable"); + printDataMap.remove("headTable"); + for (Map map : headTableList) { + printDataMap.putAll(map); + } + Map dataMap = new HashMap<>(16); + dataMap.put("printData", JsonUtil.getJsonToBean(JsonUtil.getObjectToStringAsDate(printDataMap), Map.class)); + dataMap.put("printTemplate", entity.getPrintTemplate()); + List operatorRecordList = iPrintDevService.getFlowTaskOperatorRecordList(formId); + dataMap.put("operatorRecordList", operatorRecordList); + return ActionResult.success(dataMap); + } + + /** + * 获取打印模块字段信息 + * + * @param printDevFieldsQuery 打印模板查询对象 + * @return 字段信息数据 + */ + @Operation(summary = "Sql字段获取") + @Parameters({ + @Parameter(name = "printDevFieldsQuery", description = "打印模板查询对象") + }) + @SaCheckPermission("system.printDev") + @PostMapping("/Fields") + public ActionResult>> getFields(@RequestBody PrintDevFieldsQuery printDevFieldsQuery) { + String dbLinkId = XSSEscape.escape(printDevFieldsQuery.getDbLinkId()); + try { + List> printTableFields = iPrintDevService.getPintTabFieldStruct(dbLinkId, + printDevFieldsQuery.getSqlTemplate().replaceAll("@formId", " null ")); + + return ActionResult.success(printTableFields); + } catch (Exception e) { + return ActionResult.fail(e.getMessage()); + } + } + + /*==========行为============*/ + + /** + * 导出打印模板备份json + * + * @param id 打印模板id + */ + @Operation(summary = "导出") + @Parameters({ + @Parameter(name = "id", description = "打印模板id") + }) + @SaCheckPermission("system.printDev") + @GetMapping("/{id}/Actions/Export") + public ActionResult export(@PathVariable String id) { + PrintDevEntity entity = iPrintDevService.getById(id); + //导出文件 + DownloadVO downloadVO = fileExport.exportFile(entity, configValueUtil.getTemporaryFilePath(), entity.getFullName(), ModuleTypeEnum.SYSTEM_PRINT.getTableName()); + return ActionResult.success(downloadVO); + } + + /** + * 导入打印模板备份json + * + * @param multipartFile 备份json文件 + * @return 执行结果标识 + */ + @Operation(summary = "导入") + @SaCheckPermission("system.printDev") + @PostMapping(value = "/Actions/ImportData", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public ActionResult> importData(@RequestPart("file") MultipartFile multipartFile) throws DataException { + //判断是否为.json结尾 + if (FileUtil.existsSuffix(multipartFile, ModuleTypeEnum.SYSTEM_PRINT.getTableName())) { + return ActionResult.fail(MsgCode.IMP002.get()); + } + //读取文件内容 + String fileContent = FileUtil.getFileContent(multipartFile); + try { + PrintDevEntity entity = JsonUtil.getJsonToBean(fileContent, PrintDevEntity.class); + //id为空切名称不存在时 + if (iPrintDevService.getById(entity.getId()) == null && + !iPrintDevService.checkNameExist(entity.getFullName(), entity.getId())) { + entity.setCreatorTime(new Date()); + entity.setCreatorUserId(UserProvider.getLoginUserId()); + entity.setLastModifyTime(null); + entity.setLastModifyUserId(null); + iPrintDevService.saveOrUpdate(entity); + return ActionResult.success(MsgCode.IMP001.get()); + } + } catch (Exception e) { + throw new DataException(MsgCode.IMP004.get()); + } + return ActionResult.fail(MsgCode.IMP003.get()); + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/PrintLogController.java b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/PrintLogController.java new file mode 100644 index 0000000..ff7ea5a --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/PrintLogController.java @@ -0,0 +1,125 @@ +package jnpf.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.UserInfo; +import jnpf.base.model.vo.PrintLogVO; +import jnpf.base.vo.PaginationVO; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.UserService; +import jnpf.util.*; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import jnpf.base.ActionResult; +import jnpf.base.entity.PrintLogEntity; +import jnpf.base.service.PrintLogService; +import org.springframework.validation.annotation.Validated; +import jnpf.base.model.printlog.PrintLogInfo; +import jnpf.base.model.printlog.PrintLogQuery; +import org.springframework.web.bind.annotation.*; + +import java.util.*; +import java.util.stream.Collectors; + +@Tag(name = "打印模板日志", description = "PrintLogController") +@RestController +@RequestMapping("/api/system/printLog") +public class PrintLogController { + @Autowired + private PrintLogService printLogService; + + @Autowired + private UserProvider userProvider; + + @Autowired + private UserService userService; + + /** + * 获取列表 + * + * @param page 分页模型 + * @return + */ + @Operation(summary = "获取列表") + @Parameters({ + @Parameter(name = "id", description = "打印模板ID", required = true) + }) + @SaCheckPermission("system.printDev") + @GetMapping("/{id}") + public ActionResult list(@PathVariable("id") String printId, PrintLogQuery page) { + QueryWrapper wrapper = new QueryWrapper<>(); + String startTime = page.getStartTime(); + String endTime = page.getEndTime(); + + if (!StringUtil.isEmpty(startTime) && !StringUtil.isEmpty(endTime)) { + Date startTimes = DateUtil.stringToDate(DateUtil.daFormatYmd(Long.parseLong(startTime)) + " 00:00:00"); + Date endTimes = DateUtil.stringToDate(DateUtil.daFormatYmd(Long.parseLong(endTime)) + " 23:59:59"); + wrapper.lambda().ge(PrintLogEntity::getCreatorTime, startTimes).le(PrintLogEntity::getCreatorTime, endTimes); + } + + if (StringUtils.isNoneBlank(printId)) { + wrapper.lambda().eq(PrintLogEntity::getPrintId, printId); + } + if (StringUtils.isNoneBlank(page.getKeyword())) { + wrapper.lambda().like(PrintLogEntity::getPrintTitle, page.getKeyword()); + } + wrapper.lambda().orderByDesc(PrintLogEntity::getCreatorTime); + Page pageData = new Page<>(page.getCurrentPage(), page.getPageSize()); + IPage printIPage = printLogService.page(pageData, wrapper); + // 转化名称 + try { + + List records = printIPage.getRecords(); + List collect = records.stream().map(PrintLogEntity::getCreatorUserId).filter(Objects::nonNull).collect(Collectors.toList()); + if (collect.size() > 0) { + List list = userService.getBaseMapper().selectBatchIds(collect); + Map map = list.stream().collect(Collectors.toMap(UserEntity::getId, UserEntity::getRealName)); + for (PrintLogEntity record : records) { + record.setCreatorUserId(map.get(record.getCreatorUserId())); + } + printIPage.setRecords(records); + } + + + page.setData(printIPage.getRecords(), printIPage.getTotal()); + } catch (Exception ignored) { + + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(page, PaginationVO.class); + List list = JsonUtil.getJsonToList( printIPage.getRecords(), PrintLogVO.class); + + return ActionResult.page(list, paginationVO); + } + + /** + * 保存信息 + * + * @param info 实体对象 + * @return + */ + @Operation(summary = "保存信息") + @Parameters({ + @Parameter(name = "info", description = "实体对象", required = true) + }) + @SaCheckPermission("system.printDev") + @PostMapping("save") + public ActionResult save(@RequestBody @Validated PrintLogInfo info) { + PrintLogEntity printLogEntity = BeanUtil.copyProperties(info, PrintLogEntity.class); + UserInfo userInfo = userProvider.get(); + + printLogEntity.setId(RandomUtil.uuId()); + printLogEntity.setCreatorTime(new Date()); + printLogEntity.setCreatorUserId(userInfo.getUserId()); + printLogService.save(printLogEntity); + return ActionResult.success("保存成功"); + } + + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/ProvinceAtlasController.java b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/ProvinceAtlasController.java new file mode 100644 index 0000000..bc0360c --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/ProvinceAtlasController.java @@ -0,0 +1,198 @@ +package jnpf.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.google.common.base.Joiner; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.entity.ProvinceAtlasEntity; +import jnpf.base.model.province.AtlasJsonModel; +import jnpf.base.model.province.ProvinceListTreeVO; +import jnpf.base.service.ProvinceAtlasService; +import jnpf.util.JsonUtil; +import jnpf.util.StringUtil; +import jnpf.util.wxutil.HttpUtil; +import net.sourceforge.pinyin4j.PinyinHelper; +import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType; +import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat; +import net.sourceforge.pinyin4j.format.HanyuPinyinToneType; +import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +/** + * 行政区划-地图 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2023/1/29 10:41:25 + */ +@Tag(name = "行政区划-地图", description = "atlas") +@RestController +@RequestMapping("/api/system/atlas") +public class ProvinceAtlasController extends SuperController { + + @Autowired + private ProvinceAtlasService provinceAtlasService; + public static final String ATLAS_URL = "https://geo.datav.aliyun.com/areas_v3/bound/geojson?code="; + + //树形递归 + private static boolean addChild(ProvinceListTreeVO node, List list) { + for (int i = 0; i < list.size(); i++) { + ProvinceListTreeVO n = list.get(i); + if (n.getId().equals(node.getParentId())) { + if (n.getChildren() == null) { + n.setChildren(new ArrayList<>()); + } + List children = n.getChildren(); + children.add(node); + n.setChildren(children); + return true; + } + if (n.getChildren() != null && n.getChildren().size() > 0) { + List children = n.getChildren(); + if (addChild(node, children)) { + return true; + } + } + + } + return false; + } + + /** + * 获取所有列表 + * + * @return ignore + */ + @Operation(summary = "获取所有列表") + @GetMapping + public ActionResult> list() { + List list = provinceAtlasService.getList(); + List listVOS = JsonUtil.getJsonToList(list, ProvinceListTreeVO.class); + listVOS.forEach(item -> { + if( StringUtil.isNotEmpty(item.getAtlasCenter())){ + String[] split = item.getAtlasCenter().split(","); + item.setCenterLong(new BigDecimal(split[0])); + item.setCenterLat(new BigDecimal(split[1])); + } + }); + for (int i = 0; i < listVOS.size(); i++) { + ProvinceListTreeVO item = listVOS.get(i); + if (!StringUtil.isEmpty(item.getParentId())) { + if (addChild(item, listVOS) && listVOS.size() > 0) { + listVOS.remove(item); + i--; + } + } + } + return ActionResult.success(listVOS); + } + + /** + * 获取列表 + * + * @param pid 主键 + * @return + */ + @Operation(summary = "获取列表") + @Parameters({ + @Parameter(name = "pid", description = "主键", required = true) + }) + @GetMapping("/list/{pid}") + public ActionResult> getListByPid(@PathVariable("pid") String pid) { + List list = provinceAtlasService.getListByPid(pid); + List listVOS = JsonUtil.getJsonToList(list, ProvinceListTreeVO.class); + return ActionResult.success(listVOS); + } + + /** + * 获取地图json + * + * @param code 编码 + * @return + */ + @Operation(summary = "获取地图json") + @Parameters({ + @Parameter(name = "code", description = "编码", required = true) + }) + @GetMapping("/geojson") + public ActionResult geojson(@RequestParam("code") String code) { + List listByPid = provinceAtlasService.getListByPid(code); + String url = ATLAS_URL + code; + if (CollectionUtils.isNotEmpty(listByPid)) { + url += "_full"; + } + JSONObject rstObj; + try { + rstObj = HttpUtil.httpRequest(url, "GET", null); + } catch (Exception e) { + return ActionResult.fail("请求发生错误!"); + } + if (rstObj == null) { + return ActionResult.fail("获取不到数据!"); + } + return ActionResult.success(rstObj); + } + + /** + * 同步行政区划信息 + * + * @return + */ + @Operation(summary = "同步行政区划信息") + @GetMapping("/crePy") + public ActionResult crePy() { + List list = provinceAtlasService.list(); + for (ProvinceAtlasEntity p : list) { + + String url = ATLAS_URL + p.getId(); + JSONObject rstObj; + try { + rstObj = HttpUtil.httpRequest(url, "GET", null); + if (rstObj == null) { + provinceAtlasService.removeById(p); + } else { + //将获取到的信息写入表 + AtlasJsonModel jsonToBean = JsonUtil.getJsonToBean(rstObj, AtlasJsonModel.class); + List center = jsonToBean.getFeatures().get(0).getProperties().getCenter(); + p.setAtlasCenter(Joiner.on(",").join(center)); + //生成拼音 +// String getpy = getpy(p.getFullName()); +// p.setQuickQuery(getpy); + provinceAtlasService.updateById(p); + } + } catch (Exception e) { + e.printStackTrace(); + return ActionResult.fail("请求发生错误!"); + } + } + return ActionResult.success(); + } + + private String getpy(String name) { + HanyuPinyinOutputFormat outputFormat = new HanyuPinyinOutputFormat(); + outputFormat.setCaseType(HanyuPinyinCaseType.LOWERCASE); + outputFormat.setToneType(HanyuPinyinToneType.WITHOUT_TONE); + StringBuilder result = new StringBuilder(); + char[] charArray = name.toCharArray(); + for (char c : charArray) { + try { + String[] pinyinArray = PinyinHelper.toHanyuPinyinStringArray(c, outputFormat); + result.append(pinyinArray[0]); + } catch (BadHanyuPinyinOutputFormatCombination e) { + e.printStackTrace(); + } + } + return result.toString(); + } +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/ScheduleNewController.java b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/ScheduleNewController.java new file mode 100644 index 0000000..ed0c2f3 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/ScheduleNewController.java @@ -0,0 +1,258 @@ +package jnpf.base.controller; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import jnpf.base.ActionResult; +import jnpf.base.entity.DictionaryDataEntity; +import jnpf.base.entity.ScheduleNewEntity; +import jnpf.base.entity.ScheduleNewUserEntity; +import jnpf.base.model.schedule.*; +import jnpf.base.service.DictionaryDataService; +import jnpf.base.service.ScheduleNewService; +import jnpf.base.service.ScheduleNewUserService; +import jnpf.base.vo.ListVO; +import jnpf.message.entity.SendMessageConfigEntity; +import jnpf.message.service.SendMessageConfigService; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.UserService; +import jnpf.util.*; +import jnpf.util.data.DataSourceContextHolder; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 日程 + * + * @author JNPF开发平台组 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + */ +@Tag(name = "日程", description = "Schedule") +@RestController +@RequestMapping("/api/system/Schedule") +public class ScheduleNewController extends SuperController { + + + @Autowired + private UserService userService; + @Autowired + private SendMessageConfigService messageTemplateConfigService; + @Autowired + private DictionaryDataService dictionaryDataService; + @Autowired + private ScheduleNewService scheduleNewService; + @Autowired + private ScheduleNewUserService scheduleNewUserService; + + /** + * 获取日程安排列表 + * + * @param scheduleNewTime 分页模型 + * @return + */ + @Operation(summary = "获取日程安排列表") + @GetMapping + public ActionResult> list(ScheduleNewTime scheduleNewTime) { + List list = scheduleNewService.getList(scheduleNewTime); + Date start = DateUtil.stringToDates(scheduleNewTime.getStartTime()); + Date end = DateUtil.stringToDates(scheduleNewTime.getEndTime()); + List dataAll = DateUtil.getAllDays(start, end); + List result = new ArrayList<>(); + if (list.size() > 0) { + for (Date date : dataAll) { + for (ScheduleNewEntity entity : list) { + Date startDay = DateUtil.stringToDates(DateUtil.daFormat(entity.getStartDay())); + Date endDay = DateUtil.stringToDates(DateUtil.daFormat(entity.getEndDay())); + if(DateUtil.isEffectiveDate(date,startDay,endDay)){ + result.add(entity); + } + } + } + } + for (ScheduleNewEntity entity : result) { + if (entity.getAllDay() == 1) { + entity.setEndDay(DateUtil.dateAddSeconds(entity.getEndDay(), 1)); + } + } + List vo = JsonUtil.getJsonToList(result, ScheduleNewListVO.class); + ListVO listVO = new ListVO(); + listVO.setList(vo); + return ActionResult.success(listVO); + } + + /** + * 获取日程安排列表 + * + * @param scheduleNewTime 分页模型 + * @return + */ + @Operation(summary = "获取日程安排列表") + @GetMapping("/AppList") + public ActionResult selectList(ScheduleNewTime scheduleNewTime) { + Map signMap = new HashMap<>(16); + List list = scheduleNewService.getList(scheduleNewTime); + Date start = DateUtil.stringToDates(scheduleNewTime.getStartTime()); + Date end = DateUtil.stringToDates(scheduleNewTime.getEndTime()); + List dateList = new ArrayList() {{ + add(start); + add(end); + }}; + if(StringUtils.isNotEmpty(scheduleNewTime.getDateTime())){ + dateList.add(DateUtil.strToDate(scheduleNewTime.getDateTime())); + } + Date minDate = dateList.stream().min(Date::compareTo).get(); + Date maxDate = dateList.stream().max(Date::compareTo).get(); + List dataAll = DateUtil.getAllDays(minDate, maxDate); + ScheduleNewAppListVO vo = new ScheduleNewAppListVO(); + String pattern = "yyyyMMdd"; + String dateTime = StringUtils.isEmpty(scheduleNewTime.getDateTime()) ? DateUtil.dateNow(pattern) : scheduleNewTime.getDateTime().replaceAll("-", ""); + List todayList = new ArrayList<>(); + for (Date date : dataAll) { + String time = DateUtil.dateToString(date, pattern); + List result = new ArrayList<>(); + for (ScheduleNewEntity entity : list) { + Date startDay = DateUtil.stringToDates(DateUtil.daFormat(entity.getStartDay())); + Date endDay = DateUtil.stringToDates(DateUtil.daFormat(entity.getEndDay())); + if(DateUtil.isEffectiveDate(date,startDay,endDay)){ + result.add(entity); + } + } + signMap.put(time, result.size()); + if(time.equals(dateTime)){ + todayList.addAll(result); + } + } + vo.setSignList(signMap); + vo.setTodayList(JsonUtil.getJsonToList(todayList, ScheduleNewListVO.class)); + return ActionResult.success(vo); + } + + /** + * 信息 + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取日程安排信息") + @GetMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult info(@PathVariable("id") String id) { + ScheduleNewEntity entity = scheduleNewService.getInfo(id); + ScheduleNewInfoVO vo = JsonUtil.getJsonToBean(entity, ScheduleNewInfoVO.class); + if (vo != null) { + SendMessageConfigEntity config = messageTemplateConfigService.getInfo(vo.getSend()); + vo.setSendName(config!=null?config.getFullName():""); + List toUserIds = scheduleNewUserService.getList(entity.getId(),"2").stream().map(ScheduleNewUserEntity::getToUserId).collect(Collectors.toList()); + vo.setToUserIds(toUserIds); + return ActionResult.success(vo); + } + return ActionResult.fail("数据不存在"); + } + + /** + * 信息 + * + * @param detailModel 查询模型 + * @return + */ + @Operation(summary = "获取日程安排信息") + @GetMapping("/detail") + public ActionResult detail(ScheduleDetailModel detailModel) { + List groupList = scheduleNewService.getGroupList(detailModel); + ScheduleNewEntity entity = groupList.size() > 0 ? groupList.get(0) : null; + boolean isVO = entity != null; + if (isVO) { + ScheduleNewDetailInfoVO vo = JsonUtil.getJsonToBean(entity, ScheduleNewDetailInfoVO.class); + DictionaryDataEntity info = dictionaryDataService.getInfo(entity.getCategory()); + vo.setCategory(info != null ? info.getFullName() : ""); + vo.setUrgent("1".equals(vo.getUrgent()) ? "普通" : "2".equals(vo.getUrgent()) ? "重要" : "紧急"); + UserEntity infoById = userService.getInfo(vo.getCreatorUserId()); + vo.setCreatorUserId(infoById != null ? infoById.getRealName() + "/" + infoById.getAccount() : ""); + List toUserIds = scheduleNewUserService.getList(entity.getId(),"2").stream().map(ScheduleNewUserEntity::getToUserId).collect(Collectors.toList()); + List userName = userService.getUserName(toUserIds); + StringJoiner joiner = new StringJoiner(","); + for (UserEntity userEntity : userName) { + joiner.add(userEntity.getRealName() + "/" + userEntity.getAccount()); + } + vo.setToUserIds(joiner.toString()); + return ActionResult.success(vo); + } + return ActionResult.fail("该日程已被删除"); + } + + /** + * 新建 + * + * @param scheduleCrForm 日程模型 + * @return + */ + @Operation(summary = "新建日程安排") + @PostMapping + @Parameters({ + @Parameter(name = "scheduleCrForm", description = "日程模型",required = true), + }) + public ActionResult create(@RequestBody @Valid ScheduleNewCrForm scheduleCrForm) { + ScheduleNewEntity entity = JsonUtil.getJsonToBean(scheduleCrForm, ScheduleNewEntity.class); + scheduleNewService.create(entity, scheduleCrForm.getToUserIds(), RandomUtil.uuId(),"1",new ArrayList<>()); + return ActionResult.success("新建成功"); + } + + /** + * 更新 + * + * @param id 主键 + * @param scheduleUpForm 日程模型 + * @param type 1.此日程 2.此日程及后续 3.所有日程 + * @return + */ + @Operation(summary = "更新日程安排") + @PutMapping("/{id}/{type}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "scheduleUpForm", description = "日程模型", required = true), + @Parameter(name = "type", description = "类型", required = true), + }) + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid ScheduleNewUpForm scheduleUpForm, @PathVariable("type") String type) { + if("1".equals(type)){ + scheduleUpForm.setRepeatTime(null); + scheduleUpForm.setRepetition(1); + } + ScheduleNewEntity entity = JsonUtil.getJsonToBean(scheduleUpForm, ScheduleNewEntity.class); + boolean flag = scheduleNewService.update(id, entity, scheduleUpForm.getToUserIds(), type); + if (flag == false) { + return ActionResult.fail("更新失败,数据不存在"); + } + return ActionResult.success("更新成功"); + } + + /** + * 删除 + * + * @param id 主键 + * @param type 1.此日程 2.此日程及后续 3.所有日程 + * @return + */ + @Operation(summary = "删除日程安排") + @DeleteMapping("/{id}/{type}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "type", description = "类型", required = true), + }) + public ActionResult delete(@PathVariable("id") String id, @PathVariable("type") String type) { + ScheduleNewEntity entity = scheduleNewService.getInfo(id); + if (entity != null) { + scheduleNewService.delete(entity, type); + return ActionResult.success("删除成功"); + } + return ActionResult.fail("删除失败,数据不存在"); + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/SmsTemplateController.java b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/SmsTemplateController.java new file mode 100644 index 0000000..cc9a0b0 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/SmsTemplateController.java @@ -0,0 +1,234 @@ +package jnpf.base.controller; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.Page; +import jnpf.base.Pagination; +import jnpf.base.entity.SmsTemplateEntity; +import jnpf.base.model.smstemplate.*; +import jnpf.base.service.SmsTemplateService; +import jnpf.base.util.SmsUtil; +import jnpf.base.vo.ListVO; +import jnpf.base.vo.PageListVO; +import jnpf.base.vo.PaginationVO; +import jnpf.base.model.systemconfig.SmsModel; +import jnpf.constant.MsgCode; +import jnpf.util.JsonUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.ArrayList; +import java.util.List; + +/** + * 短信模板控制类 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-12-09 + */ +@Tag(description = "SmsTemplateController", name = "短信模板控制类") +@RestController +@RequestMapping("/api/system/SmsTemplate") +public class SmsTemplateController extends SuperController { + + @Autowired + private SmsTemplateService smsTemplateService; + + /** + * 短信模板列表 + * + * @param pagination + * @return + */ + @Operation(summary = "短信模板列表") + @GetMapping + public ActionResult> list(Pagination pagination) { + List list = smsTemplateService.getList(pagination); + List listVO = JsonUtil.getJsonToList(list, SmsTemplateListVO.class); + for (SmsTemplateListVO smsTemplateListVO : listVO) { + if ("1".equals(smsTemplateListVO.getCompany())) { + smsTemplateListVO.setCompany("阿里"); + } else if ("2".equals(smsTemplateListVO.getCompany())) { + smsTemplateListVO.setCompany("腾讯"); + } + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(listVO, paginationVO); + } + + /** + * 短信模板下拉框 + * + * @return + */ + @Operation(summary = "短信模板下拉框") + @GetMapping("/Selector") + public ActionResult> selector(Page page) { + List list = smsTemplateService.getList(page.getKeyword()); + List jsonToList = JsonUtil.getJsonToList(list, SmsTemplateSelector.class); + for (SmsTemplateSelector smsTemplateSelector : jsonToList) { + if ("1".equals(smsTemplateSelector.getCompany())) { + smsTemplateSelector.setCompany("阿里"); + } else if ("2".equals(smsTemplateSelector.getCompany())) { + smsTemplateSelector.setCompany("腾讯"); + } + } + ListVO listVO = new ListVO<>(); + listVO.setList(jsonToList); + return ActionResult.success(listVO); + } + + /** + * 获取消息模板 + * + * @param id + * @return + */ + @Operation(summary = "获取短信模板") + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) { + SmsTemplateEntity entity = smsTemplateService.getInfo(id); + SmsTemplateVO vo = JsonUtil.getJsonToBean(entity, SmsTemplateVO.class); + return ActionResult.success(vo); + } + + /** + * 新建 + * + * @return + */ + @Operation(summary = "新建") + @PostMapping + public ActionResult create(@RequestBody @Valid SmsTemplateCrForm smsTemplateCrForm) { + SmsTemplateEntity entity = JsonUtil.getJsonToBean(smsTemplateCrForm, SmsTemplateEntity.class); + if (smsTemplateService.isExistByTemplateName(entity.getFullName(), entity.getId())) { + return ActionResult.fail("新建失败,模板名称不能重复"); + } + if (smsTemplateService.isExistByEnCode(entity.getEnCode(), entity.getId())) { + return ActionResult.fail("新建失败,模板编码不能重复"); + } + smsTemplateService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 修改 + * + * @return + */ + @Operation(summary = "修改") + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid SmsTemplateUpForm smsTemplateUpForm) { + SmsTemplateEntity entity = JsonUtil.getJsonToBean(smsTemplateUpForm, SmsTemplateEntity.class); + if (smsTemplateService.isExistByTemplateName(entity.getFullName(), id)) { + return ActionResult.fail("修改失败,模板名称不能重复"); + } + if (smsTemplateService.isExistByEnCode(entity.getEnCode(), id)) { + return ActionResult.fail("修改失败,模板编码不能重复"); + } + boolean flag = smsTemplateService.update(id, entity); + if (!flag) { + return ActionResult.fail(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除 + * + * @return + */ + @Operation(summary = "删除") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + SmsTemplateEntity entity = smsTemplateService.getInfo(id); + if (entity == null) { + return ActionResult.fail(MsgCode.FA003.get()); + } + smsTemplateService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + + /** + * 修改状态 + * + * @return + */ + @Operation(summary = "修改状态") + @PutMapping("/{id}/Actions/State") + public ActionResult update(@PathVariable("id") String id) { + SmsTemplateEntity entity = smsTemplateService.getInfo(id); + if (entity != null) { + if (entity.getEnabledMark() == 0) { + entity.setEnabledMark(1); + } else { + entity.setEnabledMark(0); + } + boolean flag = smsTemplateService.update(id, entity); + if (!flag) { + return ActionResult.fail(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + return ActionResult.fail(MsgCode.FA002.get()); + } + + @Operation(summary = "获取模板参数") + @PostMapping("/getTemplate") + public ActionResult testConnect(@RequestBody SmsTemplateCrForm smsTemplateCrForm) { + // 定义返回对象 + List list = null; + if (smsTemplateCrForm != null) { + // 得到短信模型 + SmsModel smsModel = smsTemplateService.getSmsConfig(); + list = SmsUtil.querySmsTemplateRequest(smsTemplateCrForm.getCompany(), smsModel, smsTemplateCrForm.getEndpoint(), smsTemplateCrForm.getRegion(), smsTemplateCrForm.getTemplateId()); + } + if (list == null) { + return ActionResult.fail("短信模板不存在"); + } + return ActionResult.success(list); + } + + /** + * 获取指定短信模板参数 + * + * @return + */ + @Operation(summary = "获取指定短信模板参数") + @GetMapping("/getTemplate/{id}") + public ActionResult getTemplateById(@PathVariable("id") String id) { + // 定义返回对象 + List list = new ArrayList<>(); + SmsTemplateEntity entity = smsTemplateService.getInfo(id); + if (entity != null && entity.getCompany() != null) { + // 得到系统配置 + SmsModel smsModel = smsTemplateService.getSmsConfig(); + list = SmsUtil.querySmsTemplateRequest(entity.getCompany(), smsModel, entity.getEndpoint(), entity.getRegion(), entity.getTemplateId()); + } + if (list == null) { + return ActionResult.success(new ArrayList<>()); + } + return ActionResult.success(list); + } + + @Operation(summary = "发送测试短信") + @PostMapping("/testSent") + public ActionResult testSentSms(@RequestBody SmsTemplateCrForm smsTemplateCrForm) { + if (smsTemplateCrForm.getCompany() != null) { + // 得到短信模型 + SmsModel smsModel = smsTemplateService.getSmsConfig(); + // 发送短信 + String sentCode = SmsUtil.sentSms(smsTemplateCrForm.getCompany(), smsModel, smsTemplateCrForm.getEndpoint(), smsTemplateCrForm.getRegion(), smsTemplateCrForm.getPhoneNumbers(), smsTemplateCrForm.getSignContent(), smsTemplateCrForm.getTemplateId(), smsTemplateCrForm.getParameters()); + if ("OK".equalsIgnoreCase(sentCode)) { + return ActionResult.success("验证通过"); + } + } + return ActionResult.fail("验证失败"); + } + + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/SynThirdInfoController.java b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/SynThirdInfoController.java new file mode 100644 index 0000000..9d4ab84 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/SynThirdInfoController.java @@ -0,0 +1,886 @@ +package jnpf.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import jnpf.base.controller.SuperController; +import cn.hutool.core.util.BooleanUtil; +import com.alibaba.fastjson.JSONObject; +import com.dingtalk.api.response.OapiV2DepartmentListsubResponse; +import com.dingtalk.api.response.OapiV2UserListResponse; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.UserInfo; +import jnpf.config.ConfigValueUtil; +import jnpf.constant.MsgCode; +import jnpf.exception.DataException; +import jnpf.exception.WxErrorException; +import jnpf.message.entity.SynThirdInfoEntity; +import jnpf.message.model.message.*; +import jnpf.message.service.MessageService; +import jnpf.message.service.SynThirdDingTalkService; +import jnpf.message.service.SynThirdInfoService; +import jnpf.message.service.SynThirdQyService; +import jnpf.base.util.SynDingTalkUtil; +import jnpf.base.util.SynQyWebChatUtil; +import jnpf.message.util.SynThirdConsts; +import jnpf.message.util.SynThirdTotal; +import jnpf.model.BaseSystemInfo; +import jnpf.permission.entity.OrganizeEntity; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.model.organize.OrganizeModel; +import jnpf.permission.service.OrganizeService; +import jnpf.permission.service.UserService; +import jnpf.util.*; +import jnpf.util.treeutil.SumTree; +import jnpf.util.treeutil.newtreeutil.TreeDotUtils; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.text.ParseException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.Executor; +import java.util.stream.Collectors; + +/** + * 第三方工具的公司-部门-用户同步表模型 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/4/25 9:30 + */ +@Tag(name = "第三方信息同步", description = "SynThirdInfo") +@RestController +@RequestMapping("/api/system/SynThirdInfo") +@Slf4j +public class SynThirdInfoController extends SuperController { + @Autowired + private UserProvider userProvider; + @Autowired + private SynThirdInfoService synThirdInfoService; + @Autowired + private SynThirdQyService synThirdQyService; + @Autowired + private SynThirdDingTalkService synThirdDingTalkService; + @Autowired + private OrganizeService organizeService; + @Autowired + private UserService userService; + @Autowired + private Executor executor; + @Autowired + private RedisUtil redisUtil; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private MessageService messageService; + + /** + * 新增同步表信息 + * + * @param synThirdInfoCrForm 新建模型 + * @return ignore + */ + @Operation(summary = "新增同步表信息") + @Parameters({ + @Parameter(name = "synThirdInfoCrForm", description = "同步信息模型", required = true) + }) + @SaCheckPermission("system.sysConfig") + @PostMapping + @DSTransactional + public ActionResult create(@RequestBody @Valid SynThirdInfoCrForm synThirdInfoCrForm) throws DataException { + UserInfo userInfo = userProvider.get(); + SynThirdInfoEntity entity = JsonUtil.getJsonToBean(synThirdInfoCrForm, SynThirdInfoEntity.class); + entity.setCreatorUserId(userInfo.getUserId()); + entity.setCreatorTime(DateUtil.getNowDate()); + entity.setId(RandomUtil.uuId()); + synThirdInfoService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 获取同步表信息 + * + * @param id 主键 + * @return ignore + */ + @Operation(summary = "获取同步表信息") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("system.sysConfig") + @GetMapping("/{id}") + public SynThirdInfoEntity getInfo(@PathVariable("id") String id) { + SynThirdInfoEntity entity = synThirdInfoService.getInfo(id); + return entity; + } + + /** + * 获取指定类型的同步对象 + * + * @param thirdType 1:企业微信 2:钉钉 + * @param dataType 1:公司 2:部门 3:用户 + * @param id dataType对应的对象ID + * @return ignore + */ + @Operation(summary = "获取指定类型的同步对象") + @GetMapping("/getInfoBySysObjId/{thirdType}/{dataType}/{id}") + public SynThirdInfoEntity getInfoBySysObjId(@PathVariable("thirdType") String thirdType, @PathVariable("dataType") String dataType, @PathVariable("id") String id) { + SynThirdInfoEntity entity = synThirdInfoService.getInfoBySysObjId(thirdType, dataType, id); + return entity; + } + + + /** + * 更新同步表信息 + * + * @param id 主键 + * @param synThirdInfoUpForm 修改对象 + * @return ignore + * @throws DataException ignore + */ + @Operation(summary = "更新同步表信息") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "synThirdInfoUpForm", description = "同步模型", required = true) + }) + @SaCheckPermission("system.sysConfig") + @PutMapping("/{id}") + @DSTransactional + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid SynThirdInfoUpForm synThirdInfoUpForm) throws DataException { + SynThirdInfoEntity entity = synThirdInfoService.getInfo(id); + UserInfo userInfo = userProvider.get(); + if (entity != null) { + SynThirdInfoEntity entityUpd = JsonUtil.getJsonToBean(synThirdInfoUpForm, SynThirdInfoEntity.class); + entityUpd.setCreatorUserId(entity.getCreatorUserId()); + entityUpd.setCreatorTime(entity.getCreatorTime()); + entityUpd.setLastModifyUserId(userInfo.getUserId()); + entityUpd.setLastModifyTime(DateUtil.getNowDate()); + synThirdInfoService.update(id, entityUpd); + + return ActionResult.success(MsgCode.SU004.get()); + } else { + return ActionResult.fail(MsgCode.FA002.get()); + } + } + + + /** + * 删除同步表信息 + * + * @param id 主键 + * @return ignore + */ + @Operation(summary = "删除同步表信息") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("system.sysConfig") + @DeleteMapping("/{id}") + @DSTransactional + public ActionResult delete(@PathVariable("id") String id) { + SynThirdInfoEntity entity = synThirdInfoService.getInfo(id); + if (entity != null) { + synThirdInfoService.delete(entity); + } + return ActionResult.success(MsgCode.SU003.get()); + } + + + /** + * 获取第三方(如:企业微信、钉钉)的组织与用户同步统计信息 + * + * @param thirdType 第三方类型(1:企业微信;2:钉钉) + * @return ignore + */ + @Operation(summary = "获取第三方(如:企业微信、钉钉)的组织与用户同步统计信息") + @Parameters({ + @Parameter(name = "thirdType", description = "第三方类型(1:企业微信;2:钉钉)", required = true) + }) + @SaCheckPermission("system.sysConfig") + @GetMapping("/getSynThirdTotal/{thirdType}") + public ActionResult> getSynThirdTotal(@PathVariable("thirdType") String thirdType) { + List synTotalList = new ArrayList<>(); + synTotalList.add(synThirdInfoService.getSynTotal(thirdType, SynThirdConsts.DATA_TYPE_ORG)); + synTotalList.add(synThirdInfoService.getSynTotal(thirdType, SynThirdConsts.DATA_TYPE_USER)); + return ActionResult.success(synTotalList); + } + + /** + * 获取第三方(如:企业微信、钉钉)的组织或用户同步统计信息 + * + * @param thirdType 第三方类型(1:企业微信;2:钉钉) + * @param dataType 数据类型(1:组织(公司与部门);2:用户) + * @return ignore + */ + @Operation(summary = "获取第三方(如:企业微信、钉钉)的组织或用户同步统计信息") + @Parameters({ + @Parameter(name = "thirdType", description = "第三方类型(1:企业微信;2:钉钉)", required = true), + @Parameter(name = "dataType", description = "数据类型(1:组织(公司与部门);2:用户)", required = true) + }) + @SaCheckPermission("system.sysConfig") + @GetMapping("/getSynThirdTotal/{thirdType}/{dataType}") + public SynThirdTotal getSynThirdTotal(@PathVariable("thirdType") String thirdType, @PathVariable("dataType") String dataType) { + SynThirdTotal synThirdTotal = synThirdInfoService.getSynTotal(thirdType, dataType); + return synThirdTotal; + } + + //==================================企业微信的公司-部门-用户批量同步到本系统20220609================================== + + /** + * 本地所有组织信息(包含公司和部门)同步到企业微信 + * 不带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * + * @return ignore + * @throws WxErrorException ignore + */ + @Operation(summary = "本地所有组织信息(包含公司和部门)同步到企业微信") + @Parameters({ + @Parameter(name = "type", description = "类型", required = true) + }) + @SaCheckPermission("system.sysConfig") + @GetMapping("/synAllOrganizeSysToQy") + public ActionResult synAllOrganizeSysToQy(@RequestParam("type") String type) throws WxErrorException { + if("1".equals(type)){ + //类型为1走企业微信组织信息同步到本地 + ActionResult actionResult = this.synAllOrganizeQyToSys(); + return actionResult; + } + JSONObject retMsg = new JSONObject(); + BaseSystemInfo config = synThirdQyService.getQyhConfig(); + String corpId = config.getQyhCorpId(); + // 向企业微信插入数据需要另外token(凭证密钥) + String corpSecret = config.getQyhAgentSecret(); + String access_token = ""; + try { + // 获取Token值 + JSONObject tokenObject = SynQyWebChatUtil.getAccessToken(corpId, corpSecret); + if (!tokenObject.getBoolean("code")) { + return ActionResult.fail("获取企业微信access_token失败"); + } + access_token = tokenObject.getString("access_token"); + + // 获取同步表、部门表的信息 + List synThirdInfoList = synThirdInfoService.getList(SynThirdConsts.THIRD_TYPE_QY, SynThirdConsts.DATA_TYPE_ORG); + Map organizeList = organizeService.getOrgMapsAll(); + + // 部门进行树结构化,固化上下层级序列化 + List organizeModelList = JsonUtil.getJsonToList(organizeList.values(), OrganizeModel.class); + List> trees = TreeDotUtils.convertListToTreeDot(organizeModelList); + List listVO = JsonUtil.getJsonToList(trees, OraganizeListVO.class); + + // 转化成为按上下层级顺序排序的列表数据 + List listByOrder = new ArrayList<>(); + for (OraganizeListVO organizeVo : listVO) { + OrganizeEntity entity = organizeList.get(organizeVo.getId()); + listByOrder.add(entity); + SynQyWebChatUtil.getOrganizeTreeToList(organizeVo, organizeList, listByOrder); + } + + // 根据同步表、公司表进行比较,判断不存的执行删除 + for (SynThirdInfoEntity synThirdInfoEntity : synThirdInfoList) { + if (organizeList.get(synThirdInfoEntity.getSysObjId()) == null) { + //执行删除操作 +// retMsg = synThirdQyService.deleteDepartmentSysToQy(true, synThirdInfoEntity.getSysObjId(), access_token); + } + } + + synThirdInfoList = synThirdInfoService.getList(SynThirdConsts.THIRD_TYPE_QY, SynThirdConsts.DATA_TYPE_ORG); + // 根据公司表、同步表进行比较,决定执行创建、还是更新 + for (OrganizeEntity organizeEntity : listByOrder) { + if (synThirdInfoList.stream().filter(t -> t.getSysObjId().equals(organizeEntity.getId())).count() > 0 ? true : false) { + // 执行更新功能 + retMsg = synThirdQyService.updateDepartmentSysToQy(true, organizeEntity, access_token); + } else { + // 执行创建功能 + retMsg = synThirdQyService.createDepartmentSysToQy(true, organizeEntity, access_token); + } + } + } catch (Exception e) { + ActionResult.fail(e.toString()); + } + //获取结果 + SynThirdTotal synThirdTotal = synThirdInfoService.getSynTotal(SynThirdConsts.THIRD_TYPE_QY, SynThirdConsts.DATA_TYPE_ORG); + return ActionResult.success(synThirdTotal); + } + + + /** + * 本地所有用户信息同步到企业微信 + * 不带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * + * @return ignore + * @throws WxErrorException ignore + */ + @Operation(summary = "本地所有用户信息同步到企业微信") + @Parameters({ + @Parameter(name = "type", description = "类型", required = true) + }) + @SaCheckPermission("system.sysConfig") + @GetMapping("/synAllUserSysToQy") + public ActionResult synAllUserSysToQy(@RequestParam("type") String type) throws WxErrorException { + if("1".equals(type)){ + //类型为1走企业微信用户同步到本地 + ActionResult actionResult = this.synAllUserQyToSys(); + return actionResult; + } + JSONObject retMsg = new JSONObject(); + BaseSystemInfo config = synThirdQyService.getQyhConfig(); + String corpId = config.getQyhCorpId(); + // 向企业微信插入数据需要另外token(凭证密钥) + String corpSecret = config.getQyhAgentSecret(); + String access_token = ""; + + try { + // 获取Token值 + JSONObject tokenObject = SynQyWebChatUtil.getAccessToken(corpId, corpSecret); + if (!tokenObject.getBoolean("code")) { + return ActionResult.fail("获取企业微信access_token失败"); + } + access_token = tokenObject.getString("access_token"); + + // 获取同步表、用户表的信息 + List synThirdInfoList = synThirdInfoService.getList(SynThirdConsts.THIRD_TYPE_QY, SynThirdConsts.DATA_TYPE_USER); + List userList = userService.getList(false); + + // 根据同步表、公司表进行比较,判断不存的执行删除 + for (SynThirdInfoEntity synThirdInfoEntity : synThirdInfoList) { + if (userList.stream().filter(t -> t.getId().equals(synThirdInfoEntity.getSysObjId())).count() == 0 ? true : false) { + //执行删除操作 + retMsg = synThirdQyService.deleteUserSysToQy(true, synThirdInfoEntity.getSysObjId(), access_token); + } + } + + // 根据公司表、同步表进行比较,决定执行创建、还是更新 + for (UserEntity userEntity : userList) { + if (synThirdInfoList.stream().filter(t -> t.getSysObjId().equals(userEntity.getId())).count() == 0 ? true : false) { + // 执行创建功能 + retMsg = synThirdQyService.createUserSysToQy(true, userEntity, access_token); + } else { + // 执行更新功能 + retMsg = synThirdQyService.updateUserSysToQy(true, userEntity, access_token); + } + } + } catch (Exception e) { + ActionResult.fail(e.toString()); + } + + //获取结果 + SynThirdTotal synThirdTotal = synThirdInfoService.getSynTotal(SynThirdConsts.THIRD_TYPE_QY, SynThirdConsts.DATA_TYPE_USER); + return ActionResult.success(synThirdTotal); + } + + //==================================企业微信的公司-部门-用户批量同步到本系统20220609================================== + + /** + * 企业微信所有组织信息(包含公司和部门)同步到本系统 + * + * @return ignore + */ + @Operation(summary = "企业微信所有组织信息(包含公司和部门)同步到本系统") + @SaCheckPermission("system.sysConfig") + @GetMapping("/synAllOrganizeQyToSys") + public ActionResult synAllOrganizeQyToSys() { + // 设置redis的key + String synDing = ""; + UserInfo userInfo = userProvider.get(); + if (configValueUtil.isMultiTenancy()) { + synDing = userInfo.getTenantId() + "_" + userInfo.getUserId() + "_synAllOrganizeQyToSys"; + } else { + synDing = userInfo.getUserId() + "_synAllOrganizeQyToSys"; + } + // 如果redis中存在key说明同步正在进行 + if (redisUtil.exists(synDing)) { + return ActionResult.fail("正在进行同步,请稍后再试"); + } + BaseSystemInfo config = synThirdQyService.getQyhConfig(); + + // 获取Token值 + JSONObject tokenObject = SynQyWebChatUtil.getAccessToken(config.getQyhCorpId(), config.getQyhCorpSecret()); + if (!tokenObject.getBoolean("code")) { + return ActionResult.fail("获取企业微信的access_token失败"); + } + + // 异步执行 + String finalSynDing = synDing; + executor.execute(() -> { + String userId = userInfo.getUserId(); + try { + redisUtil.insert(finalSynDing, "true"); + String access_token = tokenObject.getString("access_token"); + + List DingDeptList = new ArrayList<>(); + + List QyDeptAllList = new ArrayList<>(); + + // 获取同步表的信息 + List synThirdInfoList = synThirdInfoService.syncThirdInfoByType(SynThirdConsts.THIRD_TYPE_QY_To_Sys, SynThirdConsts.DATA_TYPE_ORG, SynThirdConsts.THIRD_TYPE_QY); + + // 获取企业微信上的根目录部门(本系统的组织) + String departId = SynThirdConsts.QY_ROOT_DEPT_ID; + + // 获取企业微信上的部门列表 + JSONObject retMsg = SynQyWebChatUtil.getDepartmentList(departId, access_token); + StringBuilder department = new StringBuilder(retMsg.get("department").toString()); + QyDeptAllList = JsonUtil.getJsonToList(department.toString(),QyWebChatDeptModel.class); + + + // 根据同步表、公司表进行比较,判断不存的执行删除 + for (SynThirdInfoEntity synThirdInfoEntity : synThirdInfoList) { + if (QyDeptAllList.stream().filter(t -> String.valueOf(t.getParentid()).equals(synThirdInfoEntity.getThirdObjId())).count() == 0) { +// // 执行删除操作 +// retMsg = synThirdDingTalkService.deleteDepartmentDingToSys(true, synThirdInfoEntity.getThirdObjId()); + } + } + + // 删除后需要重新获取数据 + synThirdInfoList = synThirdInfoService.getList(SynThirdConsts.THIRD_TYPE_QY_To_Sys, SynThirdConsts.DATA_TYPE_ORG); + + // 根据公司表、同步表进行比较,决定执行创建、还是更新 + for (QyWebChatDeptModel qyWebChatDeptModel : QyDeptAllList) { + if (synThirdInfoList.stream().filter(t -> t.getThirdObjId().equals(String.valueOf(qyWebChatDeptModel.getId()))).count() > 0) { + // 执行本地更新功能 + synThirdQyService.updateDepartmentQyToSys(true, qyWebChatDeptModel, access_token); + } else { + // 执行本的创建功能 + synThirdQyService.createDepartmentQyToSys(true, qyWebChatDeptModel, access_token); + } + } + } catch (Exception e) { + log.error(finalSynDing + ",企业微信所有组织信息同步到本系统失败:" + e.getMessage()); + } finally { + redisUtil.remove(finalSynDing); + List toUserId = new ArrayList<>(1); + toUserId.add(userId); + messageService.sentMessage(toUserId, "企业微信所有组织信息同步到本系统", "同步完成", userInfo,1,1); + } + }); + return ActionResult.success("正在进行同步,请稍等"); + } + + + /** + * 企业微信所有用户信息同步到本系统 + * + * @return ignore + */ + @Operation(summary = "企业微信所有用户信息同步到本系统") + @SaCheckPermission("system.sysConfig") + @GetMapping("/synAllUserQyToSys") + @Transactional + public ActionResult synAllUserQyToSys() { + // 设置redis的key + String synDing = ""; + UserInfo userInfo = userProvider.get(); + if (configValueUtil.isMultiTenancy()) { + synDing = userInfo.getTenantId() + "_" + userInfo.getUserId() + "_synAllUserQyToSys"; + } else { + synDing = userInfo.getUserId() + "_synAllUserQyToSys"; + } + // 如果redis中存在key说明同步正在进行 + if (redisUtil.exists(synDing)) { + return ActionResult.fail("正在进行同步,请稍后再试"); + } + // 获取已同步的部门信息 + List synThirdOrgList = synThirdInfoService.getList(SynThirdConsts.THIRD_TYPE_QY_To_Sys, SynThirdConsts.DATA_TYPE_ORG); + List dingDeptIdList = new ArrayList<>(); + if (synThirdOrgList != null && synThirdOrgList.size() > 0) { + dingDeptIdList = synThirdOrgList.stream().map(SynThirdInfoEntity::getThirdObjId).distinct().collect(Collectors.toList()); + } else { + return ActionResult.fail("请先从企业微信同步部门到本地"); + } + + // 获取Token值 + BaseSystemInfo config = synThirdQyService.getQyhConfig(); + JSONObject tokenObject = SynQyWebChatUtil.getAccessToken(config.getQyhCorpId(), config.getQyhCorpSecret()); + if (!tokenObject.getBoolean("code")) { + return ActionResult.fail("获取企业微信的access_token失败"); + } + // 异步执行 + List finalDingDeptIdList = dingDeptIdList; + String finalSynDing = synDing; + executor.execute(() -> { + String userId = userInfo.getUserId(); + try { + redisUtil.insert(finalSynDing, "true"); + List dingUserList = new ArrayList<>(); + List qyUserAllList = new ArrayList<>(); + String access_token = tokenObject.getString("access_token"); + + // 获取企业微信的用户列表 + JSONObject retMsg = SynQyWebChatUtil.getUserList("1", "1",access_token); + StringBuilder department = new StringBuilder(retMsg.get("userlist").toString()); + qyUserAllList = JsonUtil.getJsonToList(retMsg.get("userlist"),QyWebChatUserModel.class); + + // 获取同步表、用户表的信息 + List synThirdInfoList = synThirdInfoService.syncThirdInfoByType(SynThirdConsts.THIRD_TYPE_QY_To_Sys, SynThirdConsts.DATA_TYPE_USER, SynThirdConsts.THIRD_TYPE_QY); + + // 根据同步表、公司表进行比较,判断不存的执行删除 + for (SynThirdInfoEntity synThirdInfoEntity : synThirdInfoList) { + // 线上不包含中间表的这条记录 + if (qyUserAllList.stream().filter(t -> t.getUserid().equals(synThirdInfoEntity.getThirdObjId())).count() == 0) { + // 执行删除此条中间表记录 + synThirdDingTalkService.deleteUserDingToSys(true, synThirdInfoEntity.getThirdObjId()); + } + } + // 得到企业微信信息 + List synThirdInfoLists = synThirdInfoService.syncThirdInfoByType(SynThirdConsts.THIRD_TYPE_QY_To_Sys, SynThirdConsts.DATA_TYPE_USER, SynThirdConsts.THIRD_TYPE_QY); + // 根据公司表、同步表进行比较,决定执行创建、还是更新 + for (QyWebChatUserModel qyWebChatUserModel : qyUserAllList) { + if (synThirdInfoList.stream().filter(t -> t.getThirdObjId().equals(qyWebChatUserModel.getUserid())).count() == 0 + && synThirdInfoLists.stream().filter(t -> t.getThirdObjId().equals(qyWebChatUserModel.getUserid())).count() == 0) { + // 执行创建功能 + synThirdQyService.createUserQyToSys(true, qyWebChatUserModel,access_token); + } else { + // 执行更新功能 + synThirdQyService.updateUserQyToSystem(true, qyWebChatUserModel,access_token); + } + } + } catch (Exception e) { + e.printStackTrace(); + log.error(finalSynDing + ",企业微信所有用户信息同步到本系统失败:" + e.getMessage()); + } finally { + redisUtil.remove(finalSynDing); + List toUserId = new ArrayList<>(1); + toUserId.add(userId); + messageService.sentMessage(toUserId, "企业微信所有用户信息同步到本系统", "同步完成", userInfo,1,1); + } + }); + return ActionResult.success("正在进行同步,请稍等"); + } + + //==================================本系统的公司-部门-用户批量同步到钉钉================================== + + /** + * 本地所有组织信息(包含公司和部门)同步到钉钉 + * 不带第三方错误定位判断的功能代码 20210604 + * + * @return ignore + */ + @Operation(summary = "本地所有组织信息(包含公司和部门)同步到钉钉") + @Parameters({ + @Parameter(name = "type", description = "类型", required = true) + }) + @SaCheckPermission("system.sysConfig") + @GetMapping("/synAllOrganizeSysToDing") + public ActionResult synAllOrganizeSysToDing(@RequestParam("type") String type) { + if("1".equals(type)){ + //类型为1走钉钉组织部门信息同步到本地 + ActionResult actionResult = this.synAllOrganizeDingToSys(); + return actionResult; + } + JSONObject retMsg = new JSONObject(); + BaseSystemInfo config = synThirdDingTalkService.getDingTalkConfig(); + String corpId = config.getDingSynAppKey(); + String corpSecret = config.getDingSynAppSecret(); + + try { + // 获取Token值 + JSONObject tokenObject = SynDingTalkUtil.getAccessToken(corpId, corpSecret); + if (!tokenObject.getBoolean("code")) { + return ActionResult.fail("获取钉钉的access_token失败"); + } + String access_token = tokenObject.getString("access_token"); + + // 获取同步表、部门表的信息 + List synThirdInfoList = synThirdInfoService.getList(SynThirdConsts.THIRD_TYPE_DING, SynThirdConsts.DATA_TYPE_ORG); + Map organizeList = organizeService.getOrgMapsAll(); + + // 部门进行树结构化,固化上下层级序列化 + List organizeModelList = JsonUtil.getJsonToList(organizeList.values(), OrganizeModel.class); + List> trees = TreeDotUtils.convertListToTreeDot(organizeModelList); + List listVO = JsonUtil.getJsonToList(trees, OraganizeListVO.class); + + // 转化成为按上下层级顺序排序的列表数据 + List listByOrder = new ArrayList<>(); + for (OraganizeListVO organizeVo : listVO) { + OrganizeEntity entity = organizeList.get(organizeVo.getId()); + listByOrder.add(entity); + SynDingTalkUtil.getOrganizeTreeToList(organizeVo, organizeList, listByOrder); + } + + // 根据同步表、公司表进行比较,判断不存的执行删除 + for (SynThirdInfoEntity synThirdInfoEntity : synThirdInfoList) { + if (organizeList.get(synThirdInfoEntity.getSysObjId()) == null) { + //执行删除操作 + retMsg = synThirdDingTalkService.deleteDepartmentSysToDing(true, synThirdInfoEntity.getSysObjId(), access_token); + } + } + + synThirdInfoList = synThirdInfoService.getList(SynThirdConsts.THIRD_TYPE_DING, SynThirdConsts.DATA_TYPE_ORG); + // 根据公司表、同步表进行比较,决定执行创建、还是更新 + for (OrganizeEntity organizeEntity : listByOrder) { + if (synThirdInfoList.stream().filter(t -> t.getSysObjId().equals(organizeEntity.getId())).count() > 0 ? true : false) { + // 执行更新功能 + retMsg = synThirdDingTalkService.updateDepartmentSysToDing(true, organizeEntity, access_token); + } else { + // 执行创建功能 + retMsg = synThirdDingTalkService.createDepartmentSysToDing(true, organizeEntity, access_token); + } + } + } catch (Exception e) { + ActionResult.fail(e.toString()); + } + + //获取结果 + SynThirdTotal synThirdTotal = synThirdInfoService.getSynTotal(SynThirdConsts.THIRD_TYPE_DING, SynThirdConsts.DATA_TYPE_ORG); + return ActionResult.success(synThirdTotal); + } + + + /** + * 本地所有用户信息同步到钉钉 + * 不带第三方错误定位判断的功能代码 20210604 + * + * @return ignore + */ + @Operation(summary = "本地所有用户信息同步到钉钉") + @Parameters({ + @Parameter(name = "type", description = "类型", required = true) + }) + @SaCheckPermission("system.sysConfig") + @GetMapping("/synAllUserSysToDing") + public ActionResult synAllUserSysToDing(@RequestParam("type") String type) throws ParseException { + if("1".equals(type)){ + //类型为1走钉钉用户信息同步到本地 + ActionResult actionResult = this.synAllUserDingToSys(); + return actionResult; + } + JSONObject retMsg = new JSONObject(); + BaseSystemInfo config = synThirdDingTalkService.getDingTalkConfig(); + String corpId = config.getDingSynAppKey(); + String corpSecret = config.getDingSynAppSecret(); + + try { + // 获取Token值 + JSONObject tokenObject = SynDingTalkUtil.getAccessToken(corpId, corpSecret); + if (!tokenObject.getBoolean("code")) { + return ActionResult.success("获取钉钉的access_token失败"); + } + String access_token = tokenObject.getString("access_token"); + + // 获取同步表、用户表的信息 + List synThirdInfoList = synThirdInfoService.getList(SynThirdConsts.THIRD_TYPE_DING, SynThirdConsts.DATA_TYPE_USER); + List userList = userService.getList(false); + + // 根据同步表、公司表进行比较,判断不存的执行删除 + for (SynThirdInfoEntity synThirdInfoEntity : synThirdInfoList) { + if (userList.stream().filter(t -> t.getId().equals(synThirdInfoEntity.getSysObjId())).count() == 0 ? true : false) { + // 执行删除操作 + retMsg = synThirdDingTalkService.deleteUserSysToDing(true, synThirdInfoEntity.getSysObjId(), access_token); + } + } + + // 根据公司表、同步表进行比较,决定执行创建、还是更新 + for (UserEntity userEntity : userList) { + if (synThirdInfoList.stream().filter(t -> t.getSysObjId().equals(userEntity.getId())).count() == 0 ? true : false) { + // 执行创建功能 + retMsg = synThirdDingTalkService.createUserSysToDing(true, userEntity, access_token); + } else { + // 执行更新功能 + retMsg = synThirdDingTalkService.updateUserSysToDing(true, userEntity, access_token); + } + } + } catch (Exception e) { + ActionResult.fail(e.toString()); + } + + //获取结果 + SynThirdTotal synThirdTotal = synThirdInfoService.getSynTotal(SynThirdConsts.THIRD_TYPE_DING, SynThirdConsts.DATA_TYPE_USER); + return ActionResult.success(synThirdTotal); + } + + + //==================================钉钉的公司-部门-用户批量同步到本系统20220330================================== + + /** + * 钉钉所有组织信息(包含公司和部门)同步到本系统 + * 不带第三方错误定位判断的功能代码 20220330 + * + * @return ignore + */ + @Operation(summary = "钉钉所有组织信息(包含公司和部门)同步到本系统") + @SaCheckPermission("system.sysConfig") + @GetMapping("/synAllOrganizeDingToSys") + public ActionResult synAllOrganizeDingToSys() { + // 设置redis的key + String synDing = ""; + UserInfo userInfo = userProvider.get(); + if (configValueUtil.isMultiTenancy()) { + synDing = userInfo.getTenantId() + "_" + userInfo.getUserId() + "_synAllOrganizeDingToSys"; + } else { + synDing = userInfo.getUserId() + "_synAllOrganizeDingToSys"; + } + // 如果redis中存在key说明同步正在进行 + if (redisUtil.exists(synDing)) { + return ActionResult.fail("正在进行同步,请稍后再试"); + } + BaseSystemInfo config = synThirdDingTalkService.getDingTalkConfig(); + + // 获取Token值 + JSONObject tokenObject = SynDingTalkUtil.getAccessToken(config.getDingSynAppKey(), config.getDingSynAppSecret()); + if (!tokenObject.getBoolean("code")) { + return ActionResult.fail("获取钉钉的access_token失败"); + } + + // 异步执行 + String finalSynDing = synDing; + executor.execute(() -> { + String userId = userInfo.getUserId(); + try { + redisUtil.insert(finalSynDing, "true"); + + List DingDeptList = new ArrayList<>(); + + List DingDeptAllList = new ArrayList<>(); + String access_token = tokenObject.getString("access_token"); + + // 获取同步表的信息 + List synThirdInfoList = synThirdInfoService.syncThirdInfoByType(SynThirdConsts.THIRD_TYPE_DING_To_Sys, SynThirdConsts.DATA_TYPE_ORG, SynThirdConsts.THIRD_TYPE_DING); + + // 获取钉钉上的根目录部门(本系统的组织) + long departId = SynThirdConsts.DING_ROOT_DEPT_ID; + if (StringUtil.isNoneBlank(config.getDingDepartment())) { + departId = Long.parseLong(config.getDingDepartment()); + } + synThirdInfoService.initBaseDept(departId, access_token,SynThirdConsts.THIRD_TYPE_DING_To_Sys); + + // 获取钉钉上的部门列表 + JSONObject retMsg = SynDingTalkUtil.getDepartmentList(departId, access_token); + DingDeptList = (List) retMsg.get("department"); + List dingDeptListVo = JsonUtil.getJsonToList(DingDeptList, DingTalkDeptModel.class); + DingDeptAllList.addAll(dingDeptListVo); + + + // 根据同步表、公司表进行比较,判断不存的执行删除 + for (SynThirdInfoEntity synThirdInfoEntity : synThirdInfoList) { + if (DingDeptAllList.stream().filter(t -> String.valueOf(t.getDeptId()).equals(synThirdInfoEntity.getThirdObjId())).count() == 0) { +// // 执行删除操作 +// retMsg = synThirdDingTalkService.deleteDepartmentDingToSys(true, synThirdInfoEntity.getThirdObjId()); + } + } + + // 删除后需要重新获取数据 + synThirdInfoList = synThirdInfoService.getList(SynThirdConsts.THIRD_TYPE_DING_To_Sys, SynThirdConsts.DATA_TYPE_ORG); + + // 根据公司表、同步表进行比较,决定执行创建、还是更新 + for (DingTalkDeptModel dingDeptEntity : DingDeptAllList) { + if (synThirdInfoList.stream().filter(t -> t.getThirdObjId().equals(String.valueOf(dingDeptEntity.getDeptId()))).count() > 0) { + // 执行本地更新功能 + synThirdDingTalkService.updateDepartmentDingToSys(true, dingDeptEntity, access_token); + } else { + // 执行本的创建功能 + synThirdDingTalkService.createDepartmentDingToSys(true, dingDeptEntity, access_token); + } + } + } catch (Exception e) { + log.error(finalSynDing + ",钉钉所有组织信息同步到本系统失败:" + e.getMessage()); + } finally { + redisUtil.remove(finalSynDing); + List toUserId = new ArrayList<>(1); + toUserId.add(userId); + messageService.sentMessage(toUserId, "钉钉所有组织信息同步到本系统", "同步完成", userInfo,1,1); + } + }); + return ActionResult.success("正在进行同步,请稍等"); + } + + + /** + * 钉钉所有用户信息同步到本系统 + * 不带第三方错误定位判断的功能代码 20210604 + * + * @return ignore + */ + @Operation(summary = "钉钉所有用户信息同步到本系统") + @SaCheckPermission("system.sysConfig") + @GetMapping("/synAllUserDingToSys") + @Transactional + public ActionResult synAllUserDingToSys() { + // 设置redis的key + String synDing = ""; + UserInfo userInfo = userProvider.get(); + if (configValueUtil.isMultiTenancy()) { + synDing = userInfo.getTenantId() + "_" + userInfo.getUserId() + "_synAllUserDingToSys"; + } else { + synDing = userInfo.getUserId() + "_synAllUserDingToSys"; + } + // 如果redis中存在key说明同步正在进行 + if (redisUtil.exists(synDing)) { + return ActionResult.fail("正在进行同步,请稍后再试"); + } + // 获取已同步的部门信息 + List synThirdOrgList = synThirdInfoService.getList(SynThirdConsts.THIRD_TYPE_DING_To_Sys, SynThirdConsts.DATA_TYPE_ORG); + List dingDeptIdList = new ArrayList<>(); + if (synThirdOrgList != null && synThirdOrgList.size() > 0) { + dingDeptIdList = synThirdOrgList.stream().map(SynThirdInfoEntity::getThirdObjId).distinct().collect(Collectors.toList()); + } else { + return ActionResult.fail("请先从钉钉同步部门到本地"); + } + + // 获取Token值 + BaseSystemInfo config = synThirdDingTalkService.getDingTalkConfig(); + JSONObject tokenObject = SynDingTalkUtil.getAccessToken(config.getDingSynAppKey(), config.getDingSynAppSecret()); + if (!tokenObject.getBoolean("code")) { + return ActionResult.fail("获取钉钉的access_token失败"); + } + // 异步执行 + List finalDingDeptIdList = dingDeptIdList; + String finalSynDing = synDing; + executor.execute(() -> { + String userId = userInfo.getUserId(); + try { + redisUtil.insert(finalSynDing, "true"); + List dingUserList = new ArrayList<>(); + String access_token = tokenObject.getString("access_token"); + + // 获取钉钉的用户列表 + JSONObject retMsg = SynDingTalkUtil.getUserDingList(finalDingDeptIdList, access_token); + dingUserList = (List) retMsg.get("userlist"); + + // 获取同步表、用户表的信息 + List synThirdInfoList = synThirdInfoService.syncThirdInfoByType(SynThirdConsts.THIRD_TYPE_DING_To_Sys, SynThirdConsts.DATA_TYPE_USER, SynThirdConsts.THIRD_TYPE_DING); + + // 根据同步表、公司表进行比较,判断不存的执行删除 + for (SynThirdInfoEntity synThirdInfoEntity : synThirdInfoList) { + // 线上不包含中间表的这条记录 + if (dingUserList.stream().filter(t -> t.getUserid().equals(synThirdInfoEntity.getThirdObjId())).count() == 0) { + // 执行删除此条中间表记录 + synThirdDingTalkService.deleteUserDingToSys(true, synThirdInfoEntity.getThirdObjId()); + } + } + // 得到推送钉钉信息 + List synThirdInfoLists = synThirdInfoService.syncThirdInfoByType(SynThirdConsts.THIRD_TYPE_DING, SynThirdConsts.DATA_TYPE_USER, SynThirdConsts.THIRD_TYPE_DING); + // 根据公司表、同步表进行比较,决定执行创建、还是更新 + for (OapiV2UserListResponse.ListUserResponse dingUserModel : dingUserList) { + if (synThirdInfoList.stream().filter(t -> t.getThirdObjId().equals(dingUserModel.getUserid())).count() == 0 + && synThirdInfoLists.stream().filter(t -> t.getThirdObjId().equals(dingUserModel.getUserid())).count() == 0) { + // 执行创建功能 + synThirdDingTalkService.createUserDingToSys(true, dingUserModel, access_token); + } else { + // 执行更新功能 + synThirdDingTalkService.updateUserDingToSystem(true, dingUserModel); + } + } + } catch (Exception e) { + e.printStackTrace(); + log.error(finalSynDing + ",钉钉所有用户信息同步到本系统失败:" + e.getMessage()); + } finally { + redisUtil.remove(finalSynDing); + List toUserId = new ArrayList<>(1); + toUserId.add(userId); + messageService.sentMessage(toUserId, "钉钉所有用户信息同步到本系统", "同步完成", userInfo,1,1); + } + }); + return ActionResult.success("正在进行同步,请稍等"); + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/SysConfigController.java b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/SysConfigController.java new file mode 100644 index 0000000..27aa5fe --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/SysConfigController.java @@ -0,0 +1,225 @@ +package jnpf.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import jnpf.base.controller.SuperController; +import cn.hutool.json.JSONUtil; +import com.alibaba.fastjson.JSONObject; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.entity.EmailConfigEntity; +import jnpf.base.entity.SysConfigEntity; +import jnpf.base.model.systemconfig.EmailTestForm; +import jnpf.base.model.systemconfig.SysConfigModel; +import jnpf.base.service.SysconfigService; +import jnpf.constant.MsgCode; +import jnpf.message.entity.QyWebChatModel; +import jnpf.message.model.message.DingTalkModel; +import jnpf.message.util.DingTalkUtil; +import jnpf.message.util.QyWebChatUtil; +import jnpf.permission.model.user.form.UserUpAdminForm; +import jnpf.permission.model.user.vo.UserAdminVO; +import jnpf.permission.service.UserService; +import jnpf.util.JsonUtil; +import jnpf.util.RandomUtil; +import jnpf.util.wxutil.HttpUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.*; + +/** + * 系统配置 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Tag(name = "系统配置", description = "SysConfig") +@RestController +@RequestMapping("/api/system/SysConfig") +public class SysConfigController extends SuperController { + + @Autowired + private SysconfigService sysconfigService; + + @Autowired + private UserService userService; + + /** + * 列表 + * + * @return ignore + */ + @Operation(summary = "列表") + @GetMapping + public ActionResult list() { + List list = sysconfigService.getList("SysConfig"); + HashMap map = new HashMap<>(16); + for (SysConfigEntity sys : list) { + map.put(sys.getFkey(), sys.getValue()); + } + SysConfigModel sysConfigModel = JsonUtil.getJsonToBean(map, SysConfigModel.class); + return ActionResult.success(sysConfigModel); + } + + /** + * 保存设置 + * + * @param sysConfigModel 系统配置模型 + * @return ignore + */ + @Operation(summary = "更新系统配置") + @Parameter(name = "sysConfigModel", description = "系统模型", required = true) + @SaCheckPermission("system.sysConfig") + @PutMapping + public ActionResult save(@RequestBody SysConfigModel sysConfigModel) { + if (Objects.nonNull(sysConfigModel.getVerificationCodeNumber())) { + if (sysConfigModel.getVerificationCodeNumber() > 6) { + return ActionResult.fail("验证码位数不能大于6"); + } + if (sysConfigModel.getVerificationCodeNumber() < 3) { + return ActionResult.fail("验证码位数不能小于3"); + } + } + List entitys = new ArrayList<>(); + Map map = JsonUtil.entityToMap(sysConfigModel); + map.put("isLog", "1"); + map.put("sysTheme", "1"); + map.put("pageSize", "30"); + map.put("lastLoginTime", 1); + for (Map.Entry entry : map.entrySet()) { + SysConfigEntity entity = new SysConfigEntity(); + entity.setId(RandomUtil.uuId()); + entity.setFkey(entry.getKey()); + entity.setValue(String.valueOf(entry.getValue())); + entitys.add(entity); + } + sysconfigService.save(entitys); + return ActionResult.success(MsgCode.SU005.get()); + } + + /** + * 邮箱账户密码验证 + * + * @param emailTestForm 邮箱测试模型 + * @return ignore + */ + @Operation(summary = "邮箱连接测试") + @Parameter(name = "emailTestForm", description = "邮箱测试模型", required = true) + @SaCheckPermission("system.sysConfig") + @PostMapping("/Email/Test") + public ActionResult checkLogin(@RequestBody EmailTestForm emailTestForm) { + EmailConfigEntity entity = JsonUtil.getJsonToBean(emailTestForm, EmailConfigEntity.class); + entity.setEmailSsl(Integer.valueOf(emailTestForm.getSsl())); + String result = sysconfigService.checkLogin(entity); + if ("true".equals(result)) { + return ActionResult.success(MsgCode.SU017.get()); + } else { + return ActionResult.fail(result); + } + } + + + //=====================================测试企业微信、钉钉的连接===================================== + + /** + * 测试企业微信配置的连接功能 + * + * @param type 0-发送消息,1-同步组织 + * @param qyWebChatModel 企业微信模型 + * @return ignore + */ + @Operation(summary = "测试企业微信配置的连接") + @Parameters({ + @Parameter(name = "type", description = "0-发送消息,1-同步组织", required = true), + @Parameter(name = "qyWebChatModel", description = "企业微信模型", required = true) + }) + @SaCheckPermission("system.sysConfig") + @PostMapping("{type}/testQyWebChatConnect") + public ActionResult testQyWebChatConnect(@PathVariable("type") String type, @RequestBody @Valid QyWebChatModel qyWebChatModel) { + JSONObject retMsg = new JSONObject(); + // 测试发送消息、组织同步的连接 + String corpId = qyWebChatModel.getQyhCorpId(); + String agentSecret = qyWebChatModel.getQyhAgentSecret(); + String corpSecret = qyWebChatModel.getQyhCorpSecret(); + // 测试发送消息的连接 + if ("0".equals(type)) { + retMsg = QyWebChatUtil.getAccessToken(corpId, agentSecret); + if (HttpUtil.isWxError(retMsg)) { + return ActionResult.fail("测试发送消息的连接失败:" + retMsg.getString("errmsg")); + } + return ActionResult.success("测试发送消息连接成功"); + } else if ("1".equals(type)) { + retMsg = QyWebChatUtil.getAccessToken(corpId, corpSecret); + if (HttpUtil.isWxError(retMsg)) { + return ActionResult.fail("测试组织同步的连接失败:" + retMsg.getString("errmsg")); + } + return ActionResult.success("测试组织同步连接成功"); + } + return ActionResult.fail("测试连接类型错误"); + } + + /** + * 测试钉钉配置的连接功能 + * + * @param dingTalkModel 钉钉模板 + * @return ignore + */ + @Operation(summary = "测试钉钉配置的连接") + @Parameters({ + @Parameter(name = "dingTalkModel", description = "钉钉模型", required = true) + }) + @SaCheckPermission("system.sysConfig") + @PostMapping("/testDingTalkConnect") + public ActionResult testDingTalkConnect(@RequestBody @Valid DingTalkModel dingTalkModel) { + JSONObject retMsg = new JSONObject(); + // 测试钉钉配置的连接 + String appKey = dingTalkModel.getDingSynAppKey(); + String appSecret = dingTalkModel.getDingSynAppSecret(); + /// +// String agentId = dingTalkModel.getDingAgentId(); + // 测试钉钉的连接 + retMsg = DingTalkUtil.getAccessToken(appKey, appSecret); + if (!retMsg.getBoolean("code")) { + return ActionResult.fail("测试钉钉连接失败:" + retMsg.getString("error")); + } + + return ActionResult.success("测试钉钉连接成功"); + } + + /** + * 获取管理员集合 + * + * @return + */ + @Operation(summary = "获取管理员集合") + @SaCheckPermission("system.sysConfig") + @GetMapping("/getAdminList") + public ActionResult> getAdminList(){ + List admins = JsonUtil.getJsonToList(userService.getAdminList(), UserAdminVO.class); + return ActionResult.success(admins); + } + + /** + * 获取管理员集合 + * + * @param userUpAdminForm 超级管理员设置表单参数 + * @return + */ + @Operation(summary = "获取管理员集合") + @Parameters({ + @Parameter(name = "userUpAdminForm", description = "超级管理员设置表单参数", required = true) + }) + @SaCheckPermission("system.sysConfig") + @PutMapping("/setAdminList") + public ActionResult setAdminList(@RequestBody UserUpAdminForm userUpAdminForm){ + userService.setAdminListByIds(userUpAdminForm.getAdminIds()); + return ActionResult.success(MsgCode.SU004.get()); + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/SystemController.java b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/SystemController.java new file mode 100644 index 0000000..6014929 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/SystemController.java @@ -0,0 +1,232 @@ +package jnpf.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.entity.SystemEntity; +import jnpf.base.model.base.*; +import jnpf.base.service.CommonWordsService; +import jnpf.base.service.SystemService; +import jnpf.base.vo.ListVO; +import jnpf.constant.JnpfConst; +import jnpf.constant.MsgCode; +import jnpf.constant.PermissionConst; +import jnpf.message.util.OnlineUserModel; +import jnpf.message.util.OnlineUserProvider; +import jnpf.permission.entity.OrganizeAdministratorEntity; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.OrganizeAdministratorService; +import jnpf.permission.service.UserService; +import jnpf.util.JsonUtil; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * 系统控制器 + * + * @author :JNPF开发平台组 + * @version: V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date :2022/6/21 15:33 + */ +@Tag(name = "系统", description = "system") +@RestController +@RequestMapping("/api/system/System") +public class SystemController extends SuperController { + + @Autowired + private SystemService systemService; + @Autowired + private UserService userApi; + @Autowired + private UserProvider userProvider; + @Autowired + private CommonWordsService commonWordsService; + @Autowired + private OrganizeAdministratorService organizeAdminTratorApi; + + /** + * 获取系统列表 + * + * @param page 关键字 + * @return ignore + */ + @Operation(summary = "获取系统列表") + @SaCheckPermission("system.menu") + @GetMapping + public ActionResult> list(SystemPageVO page) { + List list = systemService.getList(page.getKeyword(), page.getEnableMark() != null && page.getEnableMark().equals("1"), true, page.getSelector(), true); + List jsonToList = JsonUtil.getJsonToList(list, SystemListVO.class); + return ActionResult.success(new ListVO<>(jsonToList)); + } + + /** + * 获取系统详情 + * + * @param id 主键 + * @return ignore + */ + @Operation(summary = "获取系统详情") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("system.menu") + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) { + SystemEntity entity = systemService.getInfo(id); + if (entity == null) { + return ActionResult.fail(MsgCode.FA001.get()); + } + SystemVO jsonToBean = JsonUtil.getJsonToBean(entity, SystemVO.class); + return ActionResult.success(jsonToBean); + } + + /** + * 新建系统 + * + * @param systemCrModel 新建模型 + * @return ignore + */ + @Operation(summary = "新建系统") + @Parameters({ + @Parameter(name = "systemCrModel", description = "新建模型", required = true) + }) + @SaCheckPermission("system.menu") + @PostMapping + public ActionResult create(@RequestBody SystemCrModel systemCrModel) { + SystemEntity entity = JsonUtil.getJsonToBean(systemCrModel, SystemEntity.class); + if (systemService.isExistFullName(entity.getId(), entity.getFullName())) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (systemService.isExistEnCode(entity.getId(), entity.getEnCode())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + systemService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 修改系统 + * + * @param id 主键 + * @param systemUpModel 修改模型 + * @return ignore + */ + @Operation(summary = "修改系统") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "systemCrModel", description = "修改模型", required = true) + }) + @SaCheckPermission("system.menu") + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody SystemUpModel systemUpModel) { + SystemEntity systemEntity = systemService.getInfo(id); + if (systemEntity == null) { + return ActionResult.fail(MsgCode.FA002.get()); + } + // 主系统不允许禁用 + if (systemEntity.getIsMain() != null && systemEntity.getIsMain() == 1 && systemUpModel.getEnabledMark() == 0) { + return ActionResult.fail("更新失败,主系统不允许禁用"); + } + SystemEntity entity = JsonUtil.getJsonToBean(systemUpModel, SystemEntity.class); + entity.setIsMain(systemEntity.getIsMain()); + if (systemService.isExistFullName(id, entity.getFullName())) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (systemService.isExistEnCode(id, entity.getEnCode())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + systemService.update(id, entity); + // 如果禁用了系统,则需要将系统 + if (systemEntity.getEnabledMark() == 1 && entity.getEnabledMark() == 0) { + sentMessage("应用已被禁用,正为您切换应用", systemEntity); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除系统 + * + * @param id 主键 + * @return ignore + */ + @Operation(summary = "删除系统") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("system.menu") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + SystemEntity entity = systemService.getInfo(id); + if (entity == null) { + return ActionResult.fail(MsgCode.FA003.get()); + } + if (entity.getIsMain() != null && entity.getIsMain() == 1) { + return ActionResult.fail("主系统不允许删除"); + } + // 系统绑定审批常用语时不允许被删除 + if(commonWordsService.existSystem(id)){ + return ActionResult.fail("系统在审批常用语中被使用,不允许删除"); + }else { + systemService.delete(id); + sentMessage("应用已被删除,正为您切换应用", entity); + } + return ActionResult.success(MsgCode.SU003.get()); + } + + private void sentMessage(String message, SystemEntity entity) { + // 如果禁用了系统,则需要将系统 + List onlineUserList = OnlineUserProvider.getOnlineUserList(); + SystemEntity mainSystem = systemService.getInfoByEnCode(JnpfConst.MAIN_SYSTEM_CODE); + // 所有在线用户信息 + Map userEntityMap = userApi.getUserName(onlineUserList.stream().map(OnlineUserModel::getUserId).collect(Collectors.toList())) + .stream().collect(Collectors.toMap(UserEntity::getId, Function.identity())); + for (OnlineUserModel item : onlineUserList) { + UserEntity userEntity = userEntityMap.get(item.getUserId()); + String systemId = userEntity.getSystemId(); + if (item.getIsMobileDevice()) { + systemId = userEntity.getAppSystemId(); + } + if (userEntity == null || + ((Objects.equals(userEntity.getIsAdministrator(), 1) + || organizeAdminTratorApi.getOrganizeAdministratorEntity(item.getUserId(), PermissionConst.SYSTEM, false).size() > 0 + || organizeAdminTratorApi.getOrganizeAdministratorEntity(item.getUserId(), PermissionConst.MODULE, false).size()> 0) + && systemId.equals(mainSystem.getId()) + ) + || (!userProvider.get(item.getToken()).getSystemIds().contains(entity.getId())) + ) { + continue; + } + if (item.getWebSocket().isOpen()) { + Map maps = new HashMap<>(1); + maps.put("msg", message); + if (item.getIsMobileDevice()) { + maps.put("method", "logout"); + maps.put("msg", message.contains("禁用") ? "应用已被禁用,正在退出!" : "应用已被删除,正在退出!"); + } else { + maps.put("method", "refresh"); + } + if (StringUtil.isNotEmpty(userProvider.get().getTenantId())) { + if (userProvider.get().getTenantId().equals(item.getTenantId())) { + item.getWebSocket().getAsyncRemote().sendText(JsonUtil.getObjectToString(maps)); + } + } else { + item.getWebSocket().getAsyncRemote().sendText(JsonUtil.getObjectToString(maps)); + } + } + } + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/UserOnlineController.java b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/UserOnlineController.java new file mode 100644 index 0000000..1761abb --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-controller/src/main/java/jnpf/base/controller/UserOnlineController.java @@ -0,0 +1,86 @@ +package jnpf.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.Page; +import jnpf.base.model.online.BatchOnlineModel; +import jnpf.base.service.UserOnlineService; +import jnpf.constant.MsgCode; +import jnpf.message.model.UserOnlineModel; +import jnpf.message.model.UserOnlineVO; +import jnpf.util.JsonUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.stream.Collectors; + +/** + * 在线用户 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月26日 上午9:18 + */ +@Tag(name = "在线用户", description = "Online") +@RestController +@RequestMapping("/api/system/OnlineUser") +public class UserOnlineController { + + @Autowired + private UserOnlineService userOnlineService; + + /** + * 列表 + * + * @param page 分页参数 + * @return ignore + */ + @Operation(summary = "获取在线用户列表") + @SaCheckPermission("permission.userOnline") + @GetMapping + public ActionResult> list(Page page) { + List data = userOnlineService.getList(page); + List voList= data.stream().map(online->{ + UserOnlineVO vo = JsonUtil.getJsonToBean(online, UserOnlineVO.class); + vo.setUserId(online.getToken()); + //vo.setUserName(vo.getUserName() + "/" + online.getDevice()); + return vo; + }).collect(Collectors.toList()); + return ActionResult.success(voList); + } + + /** + * 注销 + * + * @param token 主键值 + * @return + */ + @Operation(summary = "强制下线") + @Parameter(name = "token", description = "token", required = true) + @SaCheckPermission("permission.userOnline") + @DeleteMapping("/{token}") + public ActionResult delete(@PathVariable("token") String token) { + userOnlineService.delete(token); + return ActionResult.success("操作成功"); + } + + /** + * 批量下线用户 + * + * @param model 主键值 + * @return ignore + */ + @Operation(summary = "批量下线用户") + @Parameter(name = "model", description = "在线用户id集合", required = true) + @SaCheckPermission("permission.userOnline") + @DeleteMapping + public ActionResult clear(@RequestBody BatchOnlineModel model) { + userOnlineService.delete(model.getIds()); + return ActionResult.success("操作成功"); + } +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/pom.xml b/jnpf-java-boot/jnpf-system/jnpf-system-entity/pom.xml new file mode 100644 index 0000000..471c8e3 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/pom.xml @@ -0,0 +1,22 @@ + + + + jnpf-system + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-system-entity + + + + com.jnpf + jnpf-common-all + ${project.version} + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/AdvancedQueryEntity.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/AdvancedQueryEntity.java new file mode 100644 index 0000000..0e41139 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/AdvancedQueryEntity.java @@ -0,0 +1,45 @@ +package jnpf.base.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.util.Date; + +/** + * 高级查询 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2022/5/30 + */ +@Data +@TableName("base_advanced_query_scheme") +public class AdvancedQueryEntity extends SuperExtendEntity { + + /** + * 方案名称 + */ + @TableField("f_full_name") + private String fullName; + + /** + * 方案名称 + */ + @TableField("f_match_logic") + private String matchLogic; + + /** + * 条件规则Json + */ + @TableField("f_condition_json") + private String conditionJson; + + /** + * 菜单主键 + */ + @TableField("f_module_id") + private String moduleId; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/BillRuleEntity.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/BillRuleEntity.java new file mode 100644 index 0000000..cf700fd --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/BillRuleEntity.java @@ -0,0 +1,86 @@ +package jnpf.base.entity; + +import jnpf.base.entity.SuperExtendEntity; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 单据规则 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月27日 上午9:18 + */ +@Data +@TableName("base_bill_rule") +public class BillRuleEntity extends SuperExtendEntity.SuperExtendDEEntity implements Serializable { + + /** + * 单据名称 + */ + @TableField("f_full_name") + private String fullName; + + /** + * 单据编码 + */ + @TableField("f_en_code") + private String enCode; + + /** + * 单据前缀 + */ + @TableField("f_prefix") + private String prefix; + + /** + * 日期格式 + */ + @TableField("f_date_format") + private String dateFormat; + + /** + * 流水位数 + */ + @TableField("f_digit") + private Integer digit; + + /** + * 流水起始 + */ + @TableField("f_start_number") + private String startNumber; + + /** + * 流水范例 + */ + @TableField("f_example") + private String example; + + /** + * 当前流水号 + */ + @TableField("f_this_number") + private Integer thisNumber; + + /** + * 输出流水号 + */ + @TableField("f_output_number") + private String outputNumber; + + /** + * 分类 + */ + @TableField("f_category") + private String category; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ComFieldsEntity.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ComFieldsEntity.java new file mode 100644 index 0000000..47fec8f --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ComFieldsEntity.java @@ -0,0 +1,37 @@ +package jnpf.base.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; + +/** + * + * 常用字段表 + * 版本: V3.0.0 + * 版权: 引迈信息技术有限公司 + * 作者: 管理员/admin + * 日期: 2020-07-23 09:54 + */ +@Data +@TableName("base_common_fields") +public class ComFieldsEntity extends SuperExtendEntity.SuperExtendDEEntity implements Serializable { + + @TableField("f_field_name") + private String fieldName; + + @TableField("f_field") + private String field; + + @TableField("f_data_type") + private String datatype; + + @TableField("f_data_length") + private String datalength; + + @TableField("f_allow_null") + private String allowNull; + +} + diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/CommonWordsEntity.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/CommonWordsEntity.java new file mode 100644 index 0000000..92d8f02 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/CommonWordsEntity.java @@ -0,0 +1,42 @@ +package jnpf.base.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 审批常用语 Entity + * + * @author JNPF开发平台组 YanYu + * @version v3.4.6 + * @copyrignt 引迈信息技术有限公司 + * @date 2023-01-06 + */ +@TableName("base_common_words") +@Schema(description = "CommonWords对象", name = "审批常用语") +@Data +public class CommonWordsEntity extends SuperExtendEntity.SuperExtendEnabledEntity { + + /** + * 应用id + */ + @TableField("f_system_ids") + private String systemIds; + + /** + * 常用语 + */ + @TableField("f_common_words_text") + private String commonWordsText; + + /** + * 常用语类型(0:系统,1:个人) + */ + @TableField("f_common_words_type") + private Integer commonWordsType; + + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/DataInterfaceEntity.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/DataInterfaceEntity.java new file mode 100644 index 0000000..cba2f9d --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/DataInterfaceEntity.java @@ -0,0 +1,100 @@ +package jnpf.base.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; + +import java.io.Serializable; + +/** + * 数据接口 + */ +@Data +@TableName("base_data_interface") +public class DataInterfaceEntity extends SuperExtendEntity.SuperExtendDEEntity implements Serializable { + + /** + * 分类 + */ + @TableField("f_category") + private String category; + + /** + * 接口名称 + */ + @TableField("f_full_name") + private String fullName; + + /** + * 接口编码 + */ + @TableField("f_en_code") + private String enCode; + + /** + * 类型(1-sql,2-静态数据,3-api) + */ + @TableField("f_type") + private Integer type; + + /** + * 动作(3-查询) + */ + @TableField("f_action") + private Integer action; + + /** + * 分页(0-禁用,1-启用) + */ + @TableField("f_has_page") + private Integer hasPage; + + /** + * 后置接口(0-否 1-是) + */ + @TableField("f_is_postposition") + private Integer isPostPosition; + + /** + * 数据配置json + */ + @TableField("f_data_config_json") + private String dataConfigJson; + + /** + * 数据统计json + */ + @TableField("f_data_count_json") + private String dataCountJson; + + /** + * 数据回显json + */ + @TableField("f_data_echo_json") + private String dataEchoJson; + + /** + * 异常验证json + */ + @TableField("f_data_exception_json") + private String dataExceptionJson; + + /** + * 数据处理json + */ + @TableField("f_data_js_json") + private String dataJsJson; + + /** + * 参数json + */ + @TableField("f_parameter_json") + private String parameterJson; + + /** + * 字段JSON + */ + @TableField("f_field_json") + private String fieldJson; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/DataInterfaceLogEntity.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/DataInterfaceLogEntity.java new file mode 100644 index 0000000..35ac2b8 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/DataInterfaceLogEntity.java @@ -0,0 +1,71 @@ +package jnpf.base.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 数据接口调用日志 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-06-03 + */ +@Data +@TableName("base_data_interface_log") +public class DataInterfaceLogEntity extends SuperExtendEntity implements Serializable { + + /** + * 调用接口id + */ + @TableField("f_invok_id") + private String invokId; + + /** + * 调用时间 + */ + @TableField(value = "f_invok_time", fill = FieldFill.INSERT) + private Date invokTime; + + /** + * 调用者id + */ + @TableField("f_user_id") + private String userId; + + /** + * 请求ip + */ + @TableField("f_invok_ip") + private String invokIp; + + /** + * 请求设备 + */ + @TableField("f_invok_device") + private String invokDevice; + + /** + * 请求类型 + */ + @TableField("f_invok_type") + private String invokType; + + /** + * 请求耗时 + */ + @TableField("f_invok_waste_time") + private Integer invokWasteTime; + + /** + * 接口授权AppId + */ + @TableField("f_oauth_app_id") + private String oauthAppId; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/DataInterfaceUserEntity.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/DataInterfaceUserEntity.java new file mode 100644 index 0000000..941a9ba --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/DataInterfaceUserEntity.java @@ -0,0 +1,39 @@ +package jnpf.base.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.util.Date; + +/** + * @author JNPF开发平台组 + * @version V3.4.7 + * @copyright 引迈信息技术有限公司 + * @date 2021/9/20 9:22 + */ +@Data +@TableName("base_data_interface_user") +public class DataInterfaceUserEntity extends SuperBaseEntity.SuperCBaseEntity { + /** + * 用户主键 + */ + @TableField("f_user_id") + private String userId; + /** + * 用户密钥 + */ + @TableField("f_user_key") + private String userKey; + /** + * 接口认证主键 + */ + @TableField("f_oauth_id") + private String oauthId; + /** + * 排序 + */ + @TableField("f_sort_code") + private Long sortCode; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/DataInterfaceVariateEntity.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/DataInterfaceVariateEntity.java new file mode 100644 index 0000000..fa5a03c --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/DataInterfaceVariateEntity.java @@ -0,0 +1,39 @@ +package jnpf.base.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; + +/** + * 数据接口变量 + */ +@Data +@TableName("base_data_interface_variate") +public class DataInterfaceVariateEntity extends SuperExtendEntity implements Serializable { + + /** + * 数据接口id + */ + @TableField("f_interface_id") + private String interfaceId; + + /** + * 变量名 + */ + @TableField("f_full_name") + private String fullName; + + /** + * 表达式 + */ + @TableField("f_expression") + private String expression; + + /** + * 变量值 + */ + @TableField("f_value") + private String value; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/DbBackupEntity.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/DbBackupEntity.java new file mode 100644 index 0000000..0f83960 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/DbBackupEntity.java @@ -0,0 +1,56 @@ +package jnpf.base.entity; + +import jnpf.base.entity.SuperExtendEntity; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 数据备份 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月27日 上午9:18 + */ +@Data +//@TableName("base_dbbackup") +public class DbBackupEntity extends SuperExtendEntity.SuperExtendDEEntity implements Serializable { + + /** + * 备份库名 + */ + @TableField("F_BACKUPDBNAME") + private String backupDbName; + + /** + * 备份时间 + */ + @TableField("F_BACKUPTIME") + private Date backupTime; + + /** + * 文件名称 + */ + @TableField("F_FILENAME") + private String fileName; + + /** + * 文件大小 + */ + @TableField("F_FILESIZE") + private String fileSize; + + /** + * 文件路径 + */ + @TableField("F_FILEPATH") + private String filePath; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/DictionaryDataEntity.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/DictionaryDataEntity.java new file mode 100644 index 0000000..74b5e99 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/DictionaryDataEntity.java @@ -0,0 +1,62 @@ +package jnpf.base.entity; + +import jnpf.base.entity.SuperExtendEntity; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 字典数据 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月27日 上午9:18 + */ +@Data +@TableName("base_dictionary_data") +public class DictionaryDataEntity extends SuperExtendEntity.SuperExtendDEEntity implements Serializable { + + /** + * 上级 + */ + @TableField("f_parent_id") + private String parentId; + + /** + * 名称 + */ + @TableField("f_full_name") + private String fullName; + + /** + * 编码 + */ + @TableField("f_en_code") + private String enCode; + + /** + * 拼音 + */ + @TableField("f_simple_spelling") + private String simpleSpelling; + + /** + * 默认 + */ + @TableField("f_is_default") + private Integer isDefault; + + /** + * 类别主键 + */ + @TableField("f_dictionary_type_id") + private String dictionaryTypeId; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/DictionaryTypeEntity.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/DictionaryTypeEntity.java new file mode 100644 index 0000000..a0fed00 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/DictionaryTypeEntity.java @@ -0,0 +1,57 @@ +package jnpf.base.entity; + +import jnpf.base.entity.SuperExtendEntity; +import com.alibaba.fastjson.annotation.JSONField; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 字典分类 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月27日 上午9:18 + */ +@Data +@TableName("base_dictionary_type") +public class DictionaryTypeEntity extends SuperExtendEntity.SuperExtendDEEntity implements Serializable { + + /** + * 上级 + */ + @TableField("f_parent_id") + private String parentId; + + /** + * 名称 + */ + @TableField("f_full_name") + private String fullName; + + /** + * 编码 + */ + @TableField("f_en_code") + private String enCode; + + /** + * 树形 + */ + @TableField("f_is_tree") + private Integer isTree; + + /** + * 类型 + */ + @TableField("f_type") + private Integer category; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/EmailConfigEntity.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/EmailConfigEntity.java new file mode 100644 index 0000000..fe6716e --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/EmailConfigEntity.java @@ -0,0 +1,75 @@ +package jnpf.base.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; + +/** + * 邮件配置 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月26日 上午9:18 + */ +@Data +@TableName("ext_email_config") +public class EmailConfigEntity extends SuperExtendEntity.SuperExtendDEEntity implements Serializable { + + /** + * POP3服务 + */ + @TableField("F_POP3_HOST") + private String pop3Host; + + /** + * POP3端口 + */ + @TableField("F_POP3_PORT") + private Integer pop3Port; + + /** + * SMTP服务 + */ + @TableField("F_SMTP_HOST") + private String smtpHost; + + /** + * SMTP端口 + */ + @TableField("F_SMTP_PORT") + private Integer smtpPort; + + /** + * 账户 + */ + @TableField("F_ACCOUNT") + private String account; + + /** + * 密码 + */ + @TableField("F_PASSWORD") + private String password; + + /** + * SSL登录 + */ + @TableField("F_SSL") + private Integer emailSsl=0; + + /** + * 发件人名称 + */ + @TableField("F_SENDER_NAME") + private String senderName; + + /** + * 我的文件夹 + */ + @TableField("F_FOLDER_JSON") + private String folderJson; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/EmailReceiveEntity.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/EmailReceiveEntity.java new file mode 100644 index 0000000..5c83464 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/EmailReceiveEntity.java @@ -0,0 +1,91 @@ +package jnpf.entity; + +import jnpf.base.entity.SuperExtendEntity; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +/** + * 邮件接收 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月26日 上午9:18 + */ +@Data +@TableName("ext_email_receive") +public class EmailReceiveEntity extends SuperExtendEntity.SuperExtendDEEntity { + + /** + * 类型 + */ + @TableField("F_TYPE") + private Integer type; + + /** + * 邮箱账户 + */ + @TableField(value = "F_MACCOUNT",fill= FieldFill.INSERT) + private String mAccount; + + /** + * F_MID + */ + @TableField("F_MID") + private String mID; + + /** + * 发件人 + */ + @TableField("F_SENDER") + private String sender; + + /** + * 发件人名称 + */ + @TableField("F_SENDER_NAME") + private String senderName; + + /** + * 主题 + */ + @TableField("F_SUBJECT") + private String subject; + + /** + * 正文 + */ + @TableField("F_BODY_TEXT") + private String bodyText; + + /** + * 附件 + */ + @TableField("F_ATTACHMENT") + private String attachment; + + /** + * 阅读 + */ + @TableField("F_READ") + private Integer isRead; + + /** + * F_Date + */ + @TableField("F_DATE") + private Date fdate; + + /** + * 星标 + */ + @TableField("F_STARRED") + private Integer starred; + +} \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/InterfaceOauthEntity.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/InterfaceOauthEntity.java new file mode 100644 index 0000000..5b23d56 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/InterfaceOauthEntity.java @@ -0,0 +1,74 @@ +package jnpf.base.entity; + +import jnpf.base.entity.SuperExtendEntity; +import com.baomidou.mybatisplus.annotation.FieldStrategy; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 接口认证对象 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/6/8 9:27 + */ +@Data +@TableName("base_data_interface_oauth") +public class InterfaceOauthEntity extends SuperExtendEntity.SuperExtendDEEntity implements Serializable { + + /** + * 应用id appId + */ + @TableField("f_app_id") + private String appId; + + /** + * 应用名称 + */ + @TableField("f_app_name") + private String appName; + + /** + * 应用秘钥 + */ + @TableField("f_app_secret") + private String appSecret; + + /** + * 验证签名 + */ + @TableField("f_verify_signature") + private Integer verifySignature; + + /** + * 使用期限 + */ + @TableField(value="f_useful_life",updateStrategy = FieldStrategy.IGNORED) + private Date usefulLife; + + /** + * 白名单 + */ + @TableField("f_white_list") + private String whiteList; + + /** + * 黑名单 + */ + @TableField("f_black_list") + private String blackList; + + /** + * 接口id + */ + @TableField("f_data_interface_ids") + private String dataInterfaceIds; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/MessageTemplateEntity.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/MessageTemplateEntity.java new file mode 100644 index 0000000..c5047b6 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/MessageTemplateEntity.java @@ -0,0 +1,97 @@ +package jnpf.base.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; + +/** + * 消息模板表 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年12月8日17:40:37 + */ +@Data +@EqualsAndHashCode +@TableName("base_msg_template") +public class MessageTemplateEntity extends SuperExtendEntity.SuperExtendEnabledEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 分类(数据字典) + */ + @TableField(value = "F_CATEGORY") + private String category; + + /** + * 模板名称 + */ + @TableField(value = "F_FULLNAME") + private String fullName; + + /** + * 标题 + */ + @TableField(value = "F_TITLE") + private String title; + + /** + * 是否站内信 + */ + @TableField(value = "F_ISSTATIONLETTER") + private Integer isStationLetter; + + /** + * 是否邮箱 + */ + @TableField(value = "F_ISEMAIL") + private Integer isEmail; + + /** + * 是否企业微信 + */ + @TableField(value = "F_ISWECOM") + private Integer isWecom; + + /** + * 是否钉钉 + */ + @TableField(value = "F_ISDINGTALK") + private Integer isDingTalk; + + /** + * 是否短信 + */ + @TableField(value = "F_ISSMS") + private Integer isSms; + + /** + * 短信模板ID + */ + @TableField(value = "F_SMSID") + private String smsId; + + /** + * 模板参数JSON + */ + @TableField(value = "F_TEMPLATEJSON") + private String templateJson; + + /** + * 内容 + */ + @TableField(value = "F_CONTENT") + private String content; + + /** + * 编码 + */ + @TableField("F_ENCODE") + private String enCode; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ModuleButtonEntity.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ModuleButtonEntity.java new file mode 100644 index 0000000..6ee8b5d --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ModuleButtonEntity.java @@ -0,0 +1,68 @@ +package jnpf.base.entity; + +import jnpf.base.entity.SuperExtendEntity; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 按钮权限 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月27日 上午9:18 + */ +@Data +@TableName("base_module_button") +public class ModuleButtonEntity extends SuperExtendEntity.SuperExtendDEEntity implements Serializable { + + /** + * 按钮上级 + */ + @TableField("f_parent_id") + private String parentId; + + /** + * 按钮名称 + */ + @TableField("f_full_name") + private String fullName; + + /** + * 按钮编码 + */ + @TableField("f_en_code") + private String enCode; + + /** + * 按钮图标 + */ + @TableField("f_icon") + private String icon; + + /** + * 请求地址 + */ + @TableField("f_url_address") + private String urlAddress; + + /** + * 扩展属性 + */ + @TableField("f_property_json") + private String propertyJson; + + /** + * 功能主键 + */ + @TableField("f_module_id") + private String moduleId; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ModuleColumnEntity.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ModuleColumnEntity.java new file mode 100644 index 0000000..5d3061c --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ModuleColumnEntity.java @@ -0,0 +1,80 @@ +package jnpf.base.entity; + +import jnpf.base.entity.SuperExtendEntity; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 列表权限 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月27日 上午9:18 + */ +@Data +@TableName("base_module_column") +public class ModuleColumnEntity extends SuperExtendEntity.SuperExtendDEEntity implements Serializable { + + /** + * 列表上级 + */ + @TableField("f_parent_id") + private String parentId; + + /** + * 列表名称 + */ + @TableField("f_full_name") + private String fullName; + + /** + * 列表编码 + */ + @TableField("f_en_code") + private String enCode; + + /** + * 绑定表格Id + */ + @TableField("f_bind_table") + private String bindTable; + + /** + * 绑定表格描述 + */ + @TableField("f_bind_table_name") + private String bindTableName; + + /** + * 扩展属性 + */ + @TableField("f_property_json") + private String propertyJson; + + /** + * 功能主键 + */ + @TableField("f_module_id") + private String moduleId; + + /** + * 字段规则 主从 + */ + @TableField("f_field_rule") + private Integer fieldRule; + + /** + * 子表规则key + */ + @TableField("f_child_table_key") + private String childTableKey; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ModuleDataAuthorizeEntity.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ModuleDataAuthorizeEntity.java new file mode 100644 index 0000000..9b56a47 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ModuleDataAuthorizeEntity.java @@ -0,0 +1,98 @@ +package jnpf.base.entity; + +import jnpf.base.entity.SuperExtendEntity; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 数据权限配置 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月27日 上午9:18 + */ +@Data +@TableName("base_module_authorize") +public class ModuleDataAuthorizeEntity extends SuperExtendEntity.SuperExtendDEEntity implements Serializable { + + /** + * 字段名称 + */ + @TableField("f_full_name") + private String fullName; + + /** + * 时间类型 + */ + @TableField("f_format") + private String format; + + /** + * 字段编码 + */ + @TableField("f_en_code") + private String enCode; + + /** + * 字段类型 + */ + @TableField("f_type") + private String type; + + /** + * 条件符号 + */ + @TableField("f_condition_symbol") + private String conditionSymbol; + + /** + * 条件符号Json + */ + @TableField("f_property_json") + private String conditionSymbolJson; + + /** + * 条件内容 + */ + @TableField("f_condition_text") + private String conditionText; + + /** + * 扩展属性 + */ + @TableField("f_property_json") + private String propertyJson; + + /** + * 菜单主键 + */ + @TableField("f_module_id") + private String moduleId; + + /** + * 字段规则 主从 + */ + @TableField("f_field_rule") + private Integer fieldRule; + + /** + * 绑定表格Id + */ + @TableField("f_bind_table") + private String bindTable; + + /** + * 子表规则key + */ + @TableField("f_child_table_key") + private String childTableKey; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ModuleDataAuthorizeLinkEntity.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ModuleDataAuthorizeLinkEntity.java new file mode 100644 index 0000000..8f3c907 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ModuleDataAuthorizeLinkEntity.java @@ -0,0 +1,41 @@ +package jnpf.base.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +/** + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2022/6/7 + */ +@Data +@TableName("base_module_link") +public class ModuleDataAuthorizeLinkEntity extends SuperExtendEntity { + + /** + * 菜单主键 + */ + @TableField("f_module_id") + private String moduleId; + + /** + * 数据源连接 + */ + @TableField("f_link_id") + private String linkId; + + /** + * 连接表名 + */ + @TableField("f_link_tables") + private String linkTables; + + /** + * 权限类型(表单权限,数据权限,列表权限) + */ + @TableField("f_type") + private String dataType; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ModuleDataAuthorizeSchemeEntity.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ModuleDataAuthorizeSchemeEntity.java new file mode 100644 index 0000000..8f3c0d9 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ModuleDataAuthorizeSchemeEntity.java @@ -0,0 +1,68 @@ +package jnpf.base.entity; + +import jnpf.base.entity.SuperExtendEntity; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 数据权限方案 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月27日 上午9:18 + */ +@Data +@TableName("base_module_scheme") +public class ModuleDataAuthorizeSchemeEntity extends SuperExtendEntity.SuperExtendDEEntity implements Serializable { + + /** + * 方案编码 + */ + @TableField("f_en_code") + private String enCode; + + /** + * 方案名称 + */ + @TableField("f_full_name") + private String fullName; + + /** + * 条件规则Json + */ + @TableField("f_condition_json") + private String conditionJson; + + /** + * 条件规则描述 + */ + @TableField("f_condition_text") + private String conditionText; + + /** + * 功能主键 + */ + @TableField("f_module_id") + private String moduleId; + + /** + * 全部数据标识 + */ + @TableField("f_all_data") + private Integer allData; + + /** + * 分组匹配逻辑 + */ + @TableField("f_match_logic") + private String matchLogic; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ModuleEntity.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ModuleEntity.java new file mode 100644 index 0000000..558967f --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ModuleEntity.java @@ -0,0 +1,113 @@ +package jnpf.base.entity; + +import jnpf.base.entity.SuperEntity; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 系统功能 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月27日 上午9:18 + */ +@Data +@TableName("base_module") +public class ModuleEntity extends SuperExtendEntity.SuperExtendDEEntity implements Serializable { + + /** + * 功能上级 + */ + @TableField("f_parent_id") + private String parentId; + + /** + * 功能类别 + */ + @TableField("f_type") + private Integer type; + + /** + * 功能名称 + */ + @TableField("f_full_name") + private String fullName; + + /** + * 功能编码 + */ + @TableField("f_en_code") + private String enCode; + + /** + * 功能地址 + */ + @TableField("f_url_address") + private String urlAddress; + + /** + * 按钮权限 + */ + @TableField("f_is_button_authorize") + private Integer isButtonAuthorize; + + /** + * 列表权限 + */ + @TableField("f_is_column_authorize") + private Integer isColumnAuthorize; + + /** + * 数据权限 + */ + @TableField("f_is_data_authorize") + private Integer isDataAuthorize; + + /** + * 表单权限 + */ + @TableField("f_is_form_authorize") + private Integer isFormAuthorize; + + /** + * 扩展属性 + */ + @TableField("f_property_json") + private String propertyJson; + + /** + * 菜单图标 + */ + @TableField("f_icon") + private String icon; + /** + * 链接目标 + */ + @TableField("f_link_target") + private String linkTarget; + /** + * 菜单分类 Web、App + */ + @TableField("f_category") + private String category; + /** + * 关联功能id + */ + @TableField("f_module_id") + private String moduleId; + + /** + * 关联系统id + */ + @TableField("f_system_id") + private String systemId; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ModuleFormEntity.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ModuleFormEntity.java new file mode 100644 index 0000000..e6321ee --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ModuleFormEntity.java @@ -0,0 +1,73 @@ +package jnpf.base.entity; + +import jnpf.base.entity.SuperExtendEntity; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +/** + * + * 表单权限 + * 版本: V3.1.0 + * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * 作者: JNPF开发平台组 + * 日期: 2021-09-14 + */ +@Data +@TableName("base_module_form") +public class ModuleFormEntity extends SuperExtendEntity.SuperExtendDEEntity { + + /** + * 表单上级 + */ + @TableField("f_parent_id") + private String parentId; + + /** + * 表单名称 + */ + @TableField("f_full_name") + private String fullName; + + /** + * 表单编码 + */ + @TableField("f_en_code") + private String enCode; + + /** + * 扩展属性 + */ + @TableField("f_property_json") + private String propertyJson; + + /** + * 功能主键 + */ + @TableField("f_module_id") + private String moduleId; + + /** + * 字段规则 主从 + */ + @TableField("f_field_rule") + private Integer fieldRule; + + /** + * 绑定表格Id + */ + @TableField("f_bind_table") + private String bindTable; + + /** + * 子表规则key + */ + @TableField("f_child_table_key") + private String childTableKey; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/OperatorRecordEntity.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/OperatorRecordEntity.java new file mode 100644 index 0000000..84436cf --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/OperatorRecordEntity.java @@ -0,0 +1,133 @@ +package jnpf.base.entity; + +import jnpf.base.entity.SuperBaseEntity; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import jnpf.database.model.dto.ModelDTO; +import jnpf.database.model.interfaces.JdbcGetMod; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.Date; + +/** + * 打印模板-流程经办记录 + * + * @author JNPF开发平台组 YY + * @version V3.2.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月30日 + */ +@Data +@TableName("flow_task_operator_record") +public class OperatorRecordEntity extends SuperExtendEntity implements JdbcGetMod { + + /** + * 节点编码 + */ + @TableField("F_NODECODE") + private String nodeCode; + + /** + * 节点名称 + */ + @TableField("F_NODENAME") + private String nodeName; + + /** + * 经办状态 0-拒绝、1-同意、2-提交、3-撤回、4-终止、5-指派、6-加签、7-转办 + */ + @TableField("F_HANDLESTATUS") + private Integer handleStatus; + + /** + * 经办人员 + */ + @TableField("F_HANDLEID") + private String handleId; + + /** + * 经办人员 + */ + @TableField(exist = false) + private String userName; + + /** + * 经办时间 + */ + @TableField("F_HANDLETIME") + private Date handleTimeOrigin; + + /** + * 经办时间(时间戳) + */ + private Long handleTime; + + /** + * 经办理由 + */ + @TableField("F_HANDLEOPINION") + private String handleOpinion; + + /** + * 流转操作人 + */ + @TableField("F_OPERATORID") + private String operatorId; + + /** + * 经办主键 + */ + @TableField(value="F_TASKOPERATORID",fill = FieldFill.UPDATE) + private String taskOperatorId; + + /** + * 节点主键 + */ + @TableField(value="F_TASKNODEID",fill = FieldFill.UPDATE) + private String taskNodeId; + + /** + * 任务主键 + */ + @TableField("F_TASKID") + private String taskId; + + /** + * 签名图片 + */ + @TableField("F_SIGNIMG") + private String signImg; + + /** + * 0.进行数据 -1.作废数据 1.加签数据 3.已办不显示数据 + */ + @TableField("F_STATUS") + private String status; + + @Override + public void setMod(ModelDTO modelDTO){ + try{ + ResultSet resultSet = modelDTO.getResultSet(); + this.setId(resultSet.getString("F_ID")); + this.setNodeCode(resultSet.getString("F_NODECODE")); + this.setNodeName(resultSet.getString("F_NODENAME")); + this.setHandleStatus(resultSet.getInt("F_HANDLESTATUS")); + this.setHandleId(resultSet.getString("F_HANDLEID")); + this.setHandleTimeOrigin(resultSet.getTimestamp("F_HANDLETIME")); + this.setHandleOpinion(resultSet.getString("F_HANDLEOPINION")); + this.setOperatorId(resultSet.getString("F_OPERATORID")); + this.setTaskOperatorId(resultSet.getString("F_TASKOPERATORID")); + this.setTaskNodeId(resultSet.getString("F_TASKNODEID")); + this.setTaskId(resultSet.getString("F_TASKID")); + this.setSignImg(resultSet.getString("F_SIGNIMG")); + this.setStatus(resultSet.getString("F_STATUS")); + }catch (SQLException e){ + e.printStackTrace(); + } + } +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/PortalManageEntity.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/PortalManageEntity.java new file mode 100644 index 0000000..cc0edae --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/PortalManageEntity.java @@ -0,0 +1,41 @@ +package jnpf.base.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import java.time.LocalDateTime; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + *

+ * 门户管理 + *

+ * + * @author YanYu + * @since 2023-02-16 + */ +@TableName("base_portal_manage") +@Schema(description = "PortalManage对象") +@Data +public class PortalManageEntity extends SuperExtendEntity.SuperExtendDEEntity { + + @Schema(description = "门户_id") + @TableField("F_PORTAL_ID") + private String portalId; + + @Schema(description = "系统_id") + @TableField("F_SYSTEM_ID") + private String systemId; + + @Schema(description = "平台") + @NotNull(message = "必填") + @TableField("F_PLATFORM") + private String platform; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/PrintDevEntity.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/PrintDevEntity.java new file mode 100644 index 0000000..65f2ed7 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/PrintDevEntity.java @@ -0,0 +1,83 @@ +package jnpf.base.entity; + +import jnpf.base.entity.SuperExtendEntity; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.time.LocalDateTime; +import java.util.Date; + +/** + * 打印模板-实体类 + * + * @author JNPF开发平台组 YY + * @version V3.2.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月30日 + */ +@Data +@EqualsAndHashCode +@TableName("base_print_template") +public class PrintDevEntity extends SuperExtendEntity.SuperExtendDEEntity { + + private static final long serialVersionUID = 1L; + + /** + * 名称 + */ + @TableField("F_FULL_NAME") + private String fullName; + + /** + * 编码 + */ + @TableField("F_EN_CODE") + private String enCode; + + /** + * 分类 + */ + @TableField("F_CATEGORY") + private String category; + + /** + * 类型(1-流程表单 2-功能表单) + */ + @TableField("F_TYPE") + private Integer type; + + /** + * 连接数据 _id + */ + @TableField("F_DB_LINK_ID") + private String dbLinkId; + + /** + * sql语句 + */ + @TableField("F_SQL_TEMPLATE") + private String sqlTemplate; + + /** + * 左侧字段 + */ + @TableField("F_LEFT_FIELDS") + private String leftFields; + + /** + * 打印模板 + */ + @TableField("F_PRINT_TEMPLATE") + private String printTemplate; + + /** + * 纸张参数 + */ + @TableField("F_PAGE_PARAM") + private String pageParam; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/PrintLogEntity.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/PrintLogEntity.java new file mode 100644 index 0000000..4183621 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/PrintLogEntity.java @@ -0,0 +1,34 @@ +package jnpf.base.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.util.Date; + + +@Data +@TableName("base_print_log") +public class PrintLogEntity extends SuperExtendEntity { + + /** + * 打印条数 + */ + @TableField("F_PRINT_NUM") + private Integer printNum; + + /** + * 打印功能名称 + */ + @TableField("F_PRINT_TITLE") + private String printTitle; + + /** + * 模板id + */ + @TableField("F_PRINT_ID") + private String printId; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ProvinceAtlasEntity.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ProvinceAtlasEntity.java new file mode 100644 index 0000000..e2f7316 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ProvinceAtlasEntity.java @@ -0,0 +1,68 @@ +package jnpf.base.entity; + +import jnpf.base.entity.SuperExtendEntity; +import com.alibaba.fastjson.annotation.JSONField; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 行政区划-地图 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月27日 上午9:18m + */ +@Data +@TableName("base_province_atlas") +public class ProvinceAtlasEntity extends SuperExtendEntity.SuperExtendDEEntity implements Serializable { + + /** + * 区域上级 + */ + @TableField("F_PARENT_ID") + private String parentId; + + /** + * 区域编号 + */ + @TableField("F_EN_CODE") + private String enCode; + + /** + * 区域名称 + */ + @TableField("F_FULL_NAME") + private String fullName; + + /** + * 快速查询 + */ + @TableField("F_QUICK_QUERY") + private String quickQuery; + + /** + * 区域类型 + */ + @TableField("F_TYPE") + private String type; + + /** + * 行政区划编码 + */ + @TableField("F_DIVISION_CODE") + private String divisionCode; + + /** + * 中心经纬度 + */ + @TableField("F_ATLAS_CENTER") + private String atlasCenter; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ProvinceEntity.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ProvinceEntity.java new file mode 100644 index 0000000..6404e6f --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ProvinceEntity.java @@ -0,0 +1,56 @@ +package jnpf.base.entity; + +import jnpf.base.entity.SuperExtendEntity; +import com.alibaba.fastjson.annotation.JSONField; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 行政区划 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月27日 上午9:18m + */ +@Data +@TableName("base_province") +public class ProvinceEntity extends SuperExtendEntity.SuperExtendDEEntity implements Serializable { + /** + * 区域上级 + */ + @TableField("F_PARENT_ID") + private String parentId; + + /** + * 区域编号 + */ + @TableField("F_EN_CODE") + private String enCode; + + /** + * 区域名称 + */ + @TableField("F_FULL_NAME") + private String fullName; + + /** + * 快速查询 + */ + @TableField("F_QUICK_QUERY") + private String quickQuery; + + /** + * 区域类型 + */ + @TableField("F_TYPE") + private String type; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ScheduleLogEntity.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ScheduleLogEntity.java new file mode 100644 index 0000000..9db9c19 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ScheduleLogEntity.java @@ -0,0 +1,152 @@ +package jnpf.base.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +/** + * 日程安排 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月26日 上午9:18 + */ +@Data +@TableName("base_schedule_log") +public class ScheduleLogEntity extends SuperExtendEntity.SuperExtendDEEntity { + /** + * 分类 + */ + @TableField("F_CATEGORY") + private String category; + + /** + * 紧急程度 + */ + @TableField("F_URGENT") + private Integer urgent; + + /** + * 标题 + */ + @TableField("F_TITLE") + private String title; + + /** + * 内容 + */ + @TableField("F_CONTENT") + private String content; + + /** + * 全天 + */ + @TableField("F_ALL_DAY") + private Integer allDay; + + /** + * 开始时间 + */ + @TableField("F_START_DAY") + private Date startDay; + + /** + * 开始日期 + */ + @TableField("F_START_TIME") + private String startTime; + + /** + * 结束时间 + */ + @TableField("F_END_DAY") + private Date endDay; + + /** + * 结束日期 + */ + @TableField("F_END_TIME") + private String endTime; + + /** + * 时长 + */ + @TableField("F_DURATION") + private Integer duration; + + /** + * 颜色 + */ + @TableField("F_COLOR") + private String color; + + /** + * 提醒时长 -2不提醒 -1开始 其他是分钟 + */ + @TableField("F_REMINDER_TIME") + private Integer reminderTime; + + /** + * 提醒方式(1-默认 2-自定义) + */ + @TableField("F_REMINDER_TYPE") + private Integer reminderType; + + /** + * 发送配置id + */ + @TableField("F_SEND_CONFIG_ID") + private String send; + + /** + * 发送配置名称 + */ + @TableField("F_SEND_CONFIG_NAME") + private String sendConfigName; + + /** + * 重复提醒 1.不重复 2.每天重复 3.每周重复 4.每月重复 5.每年重复 + */ + @TableField("F_REPETITION") + private Integer repetition; + + /** + * 结束重复 + */ + @TableField("F_REPEAT_TIME") + private Date repeatTime; + + /** + * 推送时间 + */ + @TableField("F_PUSH_TIME") + private Date pushTime; + + /** + * 分组id + */ + @TableField("F_GROUP_ID") + private String groupId; + + /** + * 参与用户 + */ + @TableField("F_USER_ID") + private String userId; + + /** + * 日程id + */ + @TableField("F_SCHEDULE_ID") + private String scheduleId; + + /** + * 操作类型 1.新增 2.修改 3.删除 4.参与人删除 + */ + @TableField("F_OPERATION_TYPE") + private String operationType; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ScheduleNewEntity.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ScheduleNewEntity.java new file mode 100644 index 0000000..c125516 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ScheduleNewEntity.java @@ -0,0 +1,134 @@ +package jnpf.base.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +/** + * 日程安排 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月26日 上午9:18 + */ +@Data +@TableName("base_schedule") +public class ScheduleNewEntity extends SuperExtendEntity.SuperExtendDEEntity { + /** + * 分类 + */ + @TableField("F_CATEGORY") + private String category; + + /** + * 紧急程度 + */ + @TableField("F_URGENT") + private Integer urgent; + + /** + * 标题 + */ + @TableField("F_TITLE") + private String title; + + /** + * 内容 + */ + @TableField("F_CONTENT") + private String content; + + /** + * 全天 + */ + @TableField("F_ALL_DAY") + private Integer allDay; + + /** + * 开始时间 + */ + @TableField("F_START_DAY") + private Date startDay; + + /** + * 开始日期 + */ + @TableField("F_START_TIME") + private String startTime; + + /** + * 结束时间 + */ + @TableField("F_END_DAY") + private Date endDay; + + /** + * 结束日期 + */ + @TableField("F_END_TIME") + private String endTime; + + /** + * 时长 + */ + @TableField("F_DURATION") + private Integer duration; + + /** + * 颜色 + */ + @TableField("F_COLOR") + private String color; + + /** + * 提醒时长-2不提醒 -1开始 其他是分钟 + */ + @TableField("F_REMINDER_TIME") + private Integer reminderTime; + + /** + * 提醒方式(1-默认 2-自定义) + */ + @TableField("F_REMINDER_TYPE") + private Integer reminderType; + + /** + * 发送配置id + */ + @TableField("F_SEND_CONFIG_ID") + private String send; + + /** + * 发送配置名称 + */ + @TableField("F_SEND_CONFIG_NAME") + private String sendConfigName; + + /** + * 重复提醒1.不重复 2.每天重复 3.每周重复 4.每月重复 5.每年重复 + */ + @TableField("F_REPETITION") + private Integer repetition; + + /** + * 结束重复 + */ + @TableField("F_REPEAT_TIME") + private Date repeatTime; + + /** + * 推送时间 + */ + @TableField("F_PUSH_TIME") + private Date pushTime; + + /** + * 分组id + */ + @TableField("F_GROUP_ID") + private String groupId; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ScheduleNewUserEntity.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ScheduleNewUserEntity.java new file mode 100644 index 0000000..2ef466f --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/ScheduleNewUserEntity.java @@ -0,0 +1,38 @@ +package jnpf.base.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + + +/** + * 日程安排 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月26日 上午9:18 + */ +@Data +@TableName("base_schedule_user") +public class ScheduleNewUserEntity extends SuperExtendEntity.SuperExtendDEEntity { + /** + * 日程id + */ + @TableField("F_SCHEDULE_ID") + private String scheduleId; + + /** + * 用户id + */ + @TableField("F_TO_USER_ID") + private String toUserId; + + /** + * 类型(1-系统添加 2-用户添加) + */ + @TableField("F_TYPE") + private String type; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/SmsTemplateEntity.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/SmsTemplateEntity.java new file mode 100644 index 0000000..08c3a24 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/SmsTemplateEntity.java @@ -0,0 +1,86 @@ +package jnpf.base.entity; + +import jnpf.base.entity.SuperEntity; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 短息模板表 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年12月8日17:40:37 + */ +//@TableName("base_sms_template") +@Data +public class SmsTemplateEntity extends SuperEntity implements Serializable { + + /** + * 短信提供商 + */ + @TableField(value = "F_COMPANY") + private Integer company; + + /** + * 应用编号 + */ + @TableField(value = "F_APPID") + private String appId; + + /** + * 签名内容 + */ + @TableField(value = "F_SIGNCONTENT") + private String signContent; + + /** + * 模板编号 + */ + @TableField(value = "F_TEMPLATEID") + private String templateId; + + /** + * 模板名称 + */ + @TableField(value = "F_FULLNAME") + private String fullName; + + /** + * 模板参数JSON + */ + @TableField(value = "F_TEMPLATEJSON") + private String templateJson; + + /** + * 有效标志 + */ + @TableField("F_ENABLEDMARK") + private Integer enabledMark; + + /** + * 编码 + */ + @TableField("F_ENCODE") + private String enCode; + + /** + * endpoint + */ + @TableField("F_ENDPOINT") + private String endpoint; + + /** + * 地域参数 + */ + @TableField("F_REGION") + private String region; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/SysConfigEntity.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/SysConfigEntity.java new file mode 100644 index 0000000..d304cb8 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/SysConfigEntity.java @@ -0,0 +1,45 @@ +package jnpf.base.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; + +/** + * 系统配置 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月27日 上午9:18 + */ +@Data +@TableName("base_sys_config") +public class SysConfigEntity extends SuperExtendEntity implements Serializable { + + /** + * 名称 + */ + @TableField("F_FULL_NAME") + private String fullName; + + /** + * 键 + */ + @TableField("F_KEY") + private String fkey; + + /** + * 值 + */ + @TableField("F_VALUE") + private String value; + + /** + * 分类 + */ + @TableField("F_CATEGORY") + private String category; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/SystemEntity.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/SystemEntity.java new file mode 100644 index 0000000..c6aa741 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/SystemEntity.java @@ -0,0 +1,66 @@ +package jnpf.base.entity; + +import jnpf.base.entity.SuperEntity; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +/** + * 系统 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Data +@TableName("base_system") +public class SystemEntity extends SuperExtendEntity.SuperExtendDEEntity { + /** + * 系统名称 + */ + @TableField("F_FULL_NAME") + private String fullName; + + /** + * 系统编号 + */ + @TableField("F_EN_CODE") + private String enCode; + + /** + * 系统图标 + */ + @TableField("F_ICON") + private String icon; + + /** + * 是否是主系统(0-不是,1-是) + */ + @TableField("F_IS_MAIN") + private Integer isMain; + + /** + * 扩展属性 + */ + @TableField("F_PROPERTY_JSON") + private String propertyJson; + + /** + * 导航图标 + */ + @TableField("f_navigation_icon") + private String navigationIcon; + + /** + * Logo图标 + */ + @TableField("f_work_logo_icon") + private String workLogoIcon; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/VisualDataMapEntity.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/VisualDataMapEntity.java new file mode 100644 index 0000000..dd8f1bc --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/entity/VisualDataMapEntity.java @@ -0,0 +1,98 @@ +package jnpf.base.entity; + +import jnpf.base.entity.SuperBaseEntity; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 大屏地图 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月26日 上午9:18 + */ +@Data +@TableName("visualdata_map") +public class VisualDataMapEntity extends SuperBaseEntity.SuperTBaseEntity implements Serializable { + + /** + * 名称 + */ + @TableField("F_FULLNAME") + private String fullName; + + /** + * 编码 + */ + @TableField("F_ENCODE") + private String enCode; + + /** + * 地图数据 + */ + @TableField("F_Data") + private String data; + + /** + * 排序 + */ + @TableField("F_SORTCODE") + private Long sortCode; + + /** + * 有效标识 + */ + @TableField("F_ENABLEDMARK") + private Integer enabledMark; + + /** + * 创建时间 + */ + @TableField("F_CREATORTIME") + private Date creatorTime; + + /** + * 创建人 + */ + @TableField("F_CREATORUSERID") + private String creatorUser; + + /** + * 修改时间 + */ + @TableField("F_LASTMODIFYTIME") + private Date lastModifyTime; + + /** + * 修改人 + */ + @TableField("F_LASTMODIFYUSERID") + private String lastModifyUser; + + /** + * 删除标志 + */ + @TableField("F_DELETEMARK") + private Integer deleteMark; + + /** + * 删除时间 + */ + @TableField("F_DELETETIME") + private Date deleteTime; + + /** + * 删除人 + */ + @TableField("F_DELETEUSERID") + private String deleteUserId; + +} + diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/InterfaceOauth/IdentDataInterfaceLogVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/InterfaceOauth/IdentDataInterfaceLogVO.java new file mode 100644 index 0000000..0ea8f9a --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/InterfaceOauth/IdentDataInterfaceLogVO.java @@ -0,0 +1,56 @@ +package jnpf.base.model.InterfaceOauth; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 数据接口调用日志 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-06-10 + */ +@Data +public class IdentDataInterfaceLogVO implements Serializable { + + @Schema(description = "主键") + private String id; + + @Schema(description = "调用id") + private String invokId; + + @Schema(description = "调用时间") + private Date invokTime; + + @Schema(description = "用户id") + private String userId; + + @Schema(description = "调用ip") + private String invokIp; + + @Schema(description = "调用设备") + private String invokDevice; + + @Schema(description = "调用类型") + private String invokType; + + @Schema(description = "调用响应时间") + private Integer invokWasteTime; + + @Schema(description = "租户id") + private String tenantId; + + @Schema(description = "授权码") + private String oauthAppId; + + @Schema(description = "名称") + private String fullName; + + @Schema(description = "编码") + private String enCode; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/InterfaceOauth/IdentInterfaceListModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/InterfaceOauth/IdentInterfaceListModel.java new file mode 100644 index 0000000..5d2ee12 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/InterfaceOauth/IdentInterfaceListModel.java @@ -0,0 +1,22 @@ +package jnpf.base.model.InterfaceOauth; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 授权接口列表 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/6/9 18:12 + */ +@Data +public class IdentInterfaceListModel { + + @Schema(description = "接口认证id") + private String interfaceIdentId; + + @Schema(description = "接口id") + private String dataInterfaceIds; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/InterfaceOauth/InterfaceIdentForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/InterfaceOauth/InterfaceIdentForm.java new file mode 100644 index 0000000..a51d414 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/InterfaceOauth/InterfaceIdentForm.java @@ -0,0 +1,53 @@ +package jnpf.base.model.InterfaceOauth; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.util.Date; + +/** + * 接口认证表单 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/6/8 9:57 + */ +@Data +public class InterfaceIdentForm { + + @Schema(description = "应用id") + @NotBlank(message = "appId不能为空") + private String appId; + + @Schema(description = "应用名称") + @NotBlank(message = "应用名称不能为空") + private String appName; + + @Schema(description = "应用秘钥") + @NotBlank(message = "appSecret不能为空") + private String appSecret; + + @Schema(description = "验证签名") + private Integer verifySignature; + + @Schema(description = "使用期限") + private Date usefulLife; + + @Schema(description = "白名单") + private String whiteList; + + @Schema(description = "黑名单") + private String blackList; + + @Schema(description = "排序") + private Long sortCode; + + @Schema(description = "状态") + private Integer enabledMark; + + @Schema(description = "说明") + private String description; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/InterfaceOauth/InterfaceIdentListVo.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/InterfaceOauth/InterfaceIdentListVo.java new file mode 100644 index 0000000..410a622 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/InterfaceOauth/InterfaceIdentListVo.java @@ -0,0 +1,53 @@ +package jnpf.base.model.InterfaceOauth; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +/** + * 接口认证列表对象 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/7/6 10:50 + */ +@Data +public class InterfaceIdentListVo { + @Schema(description = "id") + private String id; + + @Schema(description = "应用id") + private String appId; + + @Schema(description = "应用名称") + private String appName; + + @Schema(description = "使用期限") + private Date usefulLife; + + @Schema(description = "创建人id") + private String creatorUserId; + + @Schema(description = "创建人") + private String creatorUser; + + @Schema(description = "创建时间") + private Long creatorTime; + + @Schema(description = "修改时间") + private Long lastModifyTime; + + @Schema(description = "排序") + private Long sortCode; + + @Schema(description = "状态") + private Integer enabledMark; + + @Schema(description = "租户id") + private String tenantId; + + @Schema(description = "绑定接口") + private String dataInterfaceIds; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/InterfaceOauth/InterfaceIdentVo.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/InterfaceOauth/InterfaceIdentVo.java new file mode 100644 index 0000000..a41bb30 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/InterfaceOauth/InterfaceIdentVo.java @@ -0,0 +1,90 @@ +package jnpf.base.model.InterfaceOauth; + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.base.model.datainterface.DataInterfaceVo; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +/** + * 接口认证vo + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/6/8 10:16 + */ +@Data +public class InterfaceIdentVo { + + @Schema(description = "id") + private String id; + + @Schema(description = "应用id") + private String appId; + + @Schema(description = "应用名称") + private String appName; + + @Schema(description = "应用秘钥") + private String appSecret; + + @Schema(description = "验证签名") + private Integer verifySignature; + + @Schema(description = "使用期限") + private Date usefulLife; + + @Schema(description = "白名单") + private String whiteList; + + @Schema(description = "黑名单") + private String blackList; + + @Schema(description = "排序") + private Long sortCode; + + @Schema(description = "状态") + private Integer enabledMark; + + @Schema(description = "说明") + private String description; + + @Schema(description = "创建人id") + private String creatorUserId; + + @Schema(description = "创建人") + private String creatorUser; + + @Schema(description = "创建时间") + private Long creatorTime; + + @Schema(description = "修改人id") + private String lastModifyUserId; + + @Schema(description = "修改人") + private String lastModifyUser; + + @Schema(description = "修改时间") + private Long lastModifyTime; + + @Schema(description = "租户id") + private String tenantId; + + + + /** + * 接口列表 + */ + @Schema(description = "接口列表字符串") + private String dataInterfaceIds; + /** + * 接口列表 + */ + @Schema(description = "接口列表") + private List list; + + @Schema(description = "授权用户列表") + private List userList; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/InterfaceOauth/InterfaceUserForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/InterfaceOauth/InterfaceUserForm.java new file mode 100644 index 0000000..d398b10 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/InterfaceOauth/InterfaceUserForm.java @@ -0,0 +1,24 @@ +package jnpf.base.model.InterfaceOauth; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * 授权用户表单 + * + * @author JNPF开发平台组 + * @version V3.4.7 + * @copyright 引迈信息技术有限公司 + * @date 2021/9/20 9:22 + */ +@Data +public class InterfaceUserForm { + + @Schema(description = "接口认证id") + private String interfaceIdentId; + + @Schema(description = "授权用户列表") + private List userIds; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/InterfaceOauth/InterfaceUserVo.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/InterfaceOauth/InterfaceUserVo.java new file mode 100644 index 0000000..6023a8d --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/InterfaceOauth/InterfaceUserVo.java @@ -0,0 +1,25 @@ +package jnpf.base.model.InterfaceOauth; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 授权用户展示 + * + * @author JNPF开发平台组 + * @version V3.4.7 + * @copyright 引迈信息技术有限公司 + * @date 2021/9/20 9:22 + */ +@Data +public class InterfaceUserVo { + + @Schema(description = "用户id") + private String userId; + + @Schema(description = "用户名称") + private String userName; + + @Schema(description = "用户密钥") + private String userKey; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/InterfaceOauth/PaginationIntrfaceLog.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/InterfaceOauth/PaginationIntrfaceLog.java new file mode 100644 index 0000000..9ac94c9 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/InterfaceOauth/PaginationIntrfaceLog.java @@ -0,0 +1,17 @@ +package jnpf.base.model.InterfaceOauth; + +import jnpf.base.PaginationTime; +import lombok.Data; + +/** + * 日志列表查询 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/6/10 11:24 + */ +@Data +public class PaginationIntrfaceLog extends PaginationTime { + private String keyword; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/InterfaceOauth/PaginationOauth.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/InterfaceOauth/PaginationOauth.java new file mode 100644 index 0000000..0664250 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/InterfaceOauth/PaginationOauth.java @@ -0,0 +1,17 @@ +package jnpf.base.model.InterfaceOauth; + +import jnpf.base.Pagination; +import lombok.Data; + +/** + * 接口认证查询参数 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/6/8 10:33 + */ +@Data +public class PaginationOauth extends Pagination { + private String keyword; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/MailAccount.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/MailAccount.java new file mode 100644 index 0000000..1340d4f --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/MailAccount.java @@ -0,0 +1,23 @@ +package jnpf.base.model; + +import lombok.Data; + +@Data +public class MailAccount { + // pop3服务 + private String pop3Host; + // pop3端口 + private int pop3Port; + // smtp服务 + private String smtpHost; + // smtp端口 + private int smtpPort; + // 账户 + private String account; + // 账户名称 + private String accountName; + // 密码 + private String password; + // SSL + private Boolean ssl; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/MailFile.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/MailFile.java new file mode 100644 index 0000000..3a31e2b --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/MailFile.java @@ -0,0 +1,12 @@ +package jnpf.base.model; + +import lombok.Data; + +@Data +public class MailFile { + private String fileId; + private String fileName; + private String fileSize; + private String fileTime; + private String fileState; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/MailModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/MailModel.java new file mode 100644 index 0000000..ed5e6aa --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/MailModel.java @@ -0,0 +1,23 @@ +package jnpf.base.model; + +import lombok.Data; + +import java.time.LocalDateTime; +import java.util.List; + +@Data +public class MailModel { + private String uid; + private String from; + private String fromName; + private String recipient; + private String toName; + private String cc; + private String ccName; + private String bcc; + private String bccName; + private String subject; + private String bodyText; + private List attachment; + private LocalDateTime date; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/PaginationPrint.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/PaginationPrint.java new file mode 100644 index 0000000..b5a48b8 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/PaginationPrint.java @@ -0,0 +1,15 @@ +package jnpf.base.model; + +import jnpf.base.Pagination; +import lombok.Data; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-11-20 + */ +@Data +public class PaginationPrint extends Pagination { + private String category; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/PrintDevTreeModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/PrintDevTreeModel.java new file mode 100644 index 0000000..876f536 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/PrintDevTreeModel.java @@ -0,0 +1,123 @@ +package jnpf.base.model; + +import com.alibaba.fastjson.annotation.JSONField; +import jnpf.util.treeutil.SumTree; +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * 打印模板数树形视图对象 + * + * @author JNPF开发平台组 YY + * @version V3.2.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月30日 + */ +@Data +public class PrintDevTreeModel extends SumTree { + + /** + * 分类下模板数量 + */ + private Integer num; + + /** + * 主键_id + */ + private String id; + + /** + * 名称 + */ + private String fullName; + + /** + * 编码 + */ + private String enCode; + + /** + * 分类 + */ + private String category; + + /** + * 类型 + */ + private Integer type; + + /** + * 描述 + */ + private String description; + + /** + * 排序码 + */ + private Integer sortCode; + + /** + * 有效标志 + */ + private Integer enabledMark; + + /** + * 创建时间 + */ + private Long creatorTime; + + /** + * 创建用户_id + */ + @JSONField(name = "creatorUserId") + private String creatorUser; + + /** + * 修改时间 + */ + private Long lastModifyTime; + + /** + * 修改用户_id + */ + @JSONField(name = "lastModifyUserId") + private String lastModifyUser; + + /** + * 删除标志 + */ + private Integer deleteMark; + + /** + * 删除时间 + */ + private LocalDateTime deleteTime; + + /** + * 删除用户_id + */ + private String deleteUserId; + + /** + * 连接数据 _id + */ + private String dbLinkId; + + /** + * sql语句 + */ + private String sqlTemplate; + + /** + * 左侧字段 + */ + private String leftFields; + + /** + * 打印模板 + */ + private String printTemplate; + + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/PrintTableTreeModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/PrintTableTreeModel.java new file mode 100644 index 0000000..0b0e49d --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/PrintTableTreeModel.java @@ -0,0 +1,19 @@ +package jnpf.base.model; + +import jnpf.util.treeutil.SumTree; +import lombok.Data; + +/** + * 类功能 + * + * @author JNPF开发平台组 YanYu + * @version V3.3 + * @copyright 引迈信息技术有限公司 + * @date 2022-07-22 + */ +@Data +public class PrintTableTreeModel extends SumTree { + + private String fullName; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/RequestParameterModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/RequestParameterModel.java new file mode 100644 index 0000000..28260a9 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/RequestParameterModel.java @@ -0,0 +1,27 @@ +package jnpf.base.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class RequestParameterModel { + @Schema(description = "参数名称") + private String parameter; + @Schema(description = "绑定字段") + private String field; + @Schema(description = "参数类型") + private String type; + @Schema(description = "操作符") + private String opt; + @Schema(description = "1-必填 ,0-非必填") + private Integer required; + @Schema(description = "默认值") + private String defaultVal; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/ResponseParametersModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/ResponseParametersModel.java new file mode 100644 index 0000000..dfa862a --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/ResponseParametersModel.java @@ -0,0 +1,27 @@ +package jnpf.base.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class ResponseParametersModel { + @Schema(description = "参数名称") + private String parameter; + @Schema(description = "绑定字段") + private String field; + @Schema(description = "参数类型") + private String type; + @Schema(description = "示例值") + private String sample; + @Schema(description = "描述") + private String remark; + @Schema(description = "是否分页(1-分页 ,0-不分页)") + private String pagination; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/advancedquery/AdvancedQueryListVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/advancedquery/AdvancedQueryListVO.java new file mode 100644 index 0000000..1b2361b --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/advancedquery/AdvancedQueryListVO.java @@ -0,0 +1,10 @@ +package jnpf.base.model.advancedquery; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class AdvancedQueryListVO extends AdvancedQuerySchemeForm{ + @Schema(description = "主键") + private String id; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/advancedquery/AdvancedQuerySchemeForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/advancedquery/AdvancedQuerySchemeForm.java new file mode 100644 index 0000000..aceb44d --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/advancedquery/AdvancedQuerySchemeForm.java @@ -0,0 +1,31 @@ +package jnpf.base.model.advancedquery; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * + * 高级查询表单 + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2022/5/30 + */ +@Data +public class AdvancedQuerySchemeForm implements Serializable { + @Schema(description = "名称") + @NotBlank(message = "必填") + private String fullName; + @Schema(description = "条件") + @NotBlank(message = "必填") + private String conditionJson; + @Schema(description = "匹配标志") + @NotBlank(message = "必填") + private String matchLogic; + @Schema(description = "菜单id") + @NotBlank(message = "当前菜单不能为空") + private String moduleId; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/base/SystemBaeModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/base/SystemBaeModel.java new file mode 100644 index 0000000..b6b77c5 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/base/SystemBaeModel.java @@ -0,0 +1,18 @@ +package jnpf.base.model.base; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author :JNPF开发平台组 + * @version: V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date :2022/6/22 14:26 + */ +@Data +public class SystemBaeModel extends SystemCrModel implements Serializable { + + private String id; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/base/SystemCrModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/base/SystemCrModel.java new file mode 100644 index 0000000..98e6b69 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/base/SystemCrModel.java @@ -0,0 +1,47 @@ +package jnpf.base.model.base; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @author :JNPF开发平台组 + * @version: V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date :2022/6/21 16:00 + */ +@Data +public class SystemCrModel implements Serializable { + + @Schema(description = "名称") + @NotBlank(message = "系统名称不能为空") + private String fullName; + + @Schema(description = "编码") + @NotBlank(message = "系统编码不能为空") + private String enCode; + + @Schema(description = "图标") + @NotBlank(message = "系统图标不能为空") + private String icon; + + @NotBlank(message = "排序码") + private Long sortCode; + + @NotBlank(message = "有效标志") + private Integer enabledMark; + + @NotBlank(message = "说明") + private String description; + + @NotBlank(message = "扩展属性") + private String propertyJson; + + @Schema(description = "导航图片") + private String navigationIcon; + @Schema(description = "Logo图片") + private String workLogoIcon; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/base/SystemListVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/base/SystemListVO.java new file mode 100644 index 0000000..f5bf4fb --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/base/SystemListVO.java @@ -0,0 +1,56 @@ +package jnpf.base.model.base; + + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.constant.JnpfConst; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author :JNPF开发平台组 + * @version: V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date :2022/6/21 15:50 + */ +@Data +public class SystemListVO implements Serializable { + + @Schema(description = "主键") + private String id; + + @Schema(description = "名称") + private String fullName; + + @Schema(description = "编码") + private String enCode; + + @Schema(description = "图标") + private String icon; + + @Schema(description = "排序码") + private Long sortCode; + + @Schema(description = "有效标志") + private Integer enabledMark; + + @Schema(description = "扩展属性") + private String propertyJson; + + @Schema(description = "是否主系统") + private Integer isMain; + @Schema(description = "是否为开发平台") + private boolean mainSystem; + @Schema(description = "导航图片") + private String navigationIcon; + @Schema(description = "Logo图片") + private String workLogoIcon; + + public boolean isMainSystem() { + if (JnpfConst.MAIN_SYSTEM_CODE.equals(this.getEnCode())) { + return true; + } + return false; + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/base/SystemPageVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/base/SystemPageVO.java new file mode 100644 index 0000000..b3a6595 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/base/SystemPageVO.java @@ -0,0 +1,21 @@ +package jnpf.base.model.base; + +import jnpf.base.Page; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 类功能 + * + * @author JNPF开发平台组 YanYu + * @version v3.4.6 + * @copyrignt 引迈信息技术有限公司 + * @date 2023-02-27 + */ +@Data +public class SystemPageVO extends Page { + + private String enableMark; + + private Boolean selector; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/base/SystemUpModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/base/SystemUpModel.java new file mode 100644 index 0000000..b61db9e --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/base/SystemUpModel.java @@ -0,0 +1,15 @@ +package jnpf.base.model.base; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author :JNPF开发平台组 + * @version: V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date :2022/6/21 16:49 + */ +@Data +public class SystemUpModel extends SystemCrModel implements Serializable { +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/base/SystemVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/base/SystemVO.java new file mode 100644 index 0000000..d2c7872 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/base/SystemVO.java @@ -0,0 +1,46 @@ +package jnpf.base.model.base; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author :JNPF开发平台组 + * @version: V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date :2022/6/21 15:58 + */ +@Data +public class SystemVO implements Serializable { + + @Schema(description = "主键") + private String id; + + @Schema(description = "名称") + private String fullName; + + @Schema(description = "编码") + private String enCode; + + @Schema(description = "图标") + private String icon; + + @Schema(description = "排序码") + private Long sortCode; + + @Schema(description = "有效标志") + private Integer enabledMark; + + @Schema(description = "说明") + private String description; + + @Schema(description = "扩展属性") + private String propertyJson; + + @Schema(description = "导航图片") + private String navigationIcon; + @Schema(description = "Logo图片") + private String workLogoIcon; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/billrule/BillRuleCrForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/billrule/BillRuleCrForm.java new file mode 100644 index 0000000..46920d9 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/billrule/BillRuleCrForm.java @@ -0,0 +1,44 @@ +package jnpf.base.model.billrule; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import javax.validation.constraints.NotBlank; + +import javax.validation.constraints.NotNull; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:28 + */ +@Data +public class BillRuleCrForm { + @NotBlank(message = "必填") + @Schema(description = "业务名称") + private String fullName; + @NotBlank(message = "必填") + @Schema(description = "流水位数") + private String enCode; + @NotBlank(message = "必填") + @Schema(description = "流水前缀") + private String prefix; + @NotBlank(message = "必填") + @Schema(description = "流水日期格式") + private String dateFormat; + @NotNull(message = "必填") + @Schema(description = "流水位数") + private Integer digit; + @NotBlank(message = "必填") + @Schema(description = "流水起始") + private String startNumber; + @Schema(description = "流水范例") + private String example; + @Schema(description = "状态(0-禁用,1-启用)") + private Integer enabledMark; + @Schema(description = "流水说明") + private String description; + private long sortCode; + private String category; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/billrule/BillRuleInfoVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/billrule/BillRuleInfoVO.java new file mode 100644 index 0000000..b7f0d7a --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/billrule/BillRuleInfoVO.java @@ -0,0 +1,39 @@ +package jnpf.base.model.billrule; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:30 + */ +@Data +public class BillRuleInfoVO { + @Schema(description = "id") + private String id; + @Schema(description = "业务名称") + private String fullName; + @Schema(description = "流水位数") + private String enCode; + @Schema(description = "流水前缀") + private String prefix; + @Schema(description = "流水日期格式") + private String dateFormat; + @Schema(description = "流水位数") + private Integer digit; + @Schema(description = "流水起始") + private String startNumber; + @Schema(description = "流水范例") + private String example; + @Schema(description = "状态(0-禁用,1-启用)") + private Integer enabledMark; + @Schema(description = "流水说明") + private String description; + @Schema(description = "排序码") + private Long sortCode; + @Schema(description = "业务分类") + private String category; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/billrule/BillRuleListVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/billrule/BillRuleListVO.java new file mode 100644 index 0000000..4a91285 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/billrule/BillRuleListVO.java @@ -0,0 +1,40 @@ +package jnpf.base.model.billrule; + +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:30 + */ +@Data +public class BillRuleListVO { + + @Schema(description = "id") + private String id; + @Schema(description = "业务名称") + private String fullName; + @Schema(description = "业务编码") + private String enCode; + @Schema(description = "流水起始") + private String startNumber; + @Schema(description = "当前流水号") + private String outputNumber; + @Schema(description = "状态(0-禁用,1-启用)") + private Integer enabledMark; + @Schema(description = "排序码") + private Long sortCode; + @Schema(description = "创建人") + private String creatorUser; + @Schema(description = "创建时间") + private Long creatorTime; + @Schema(description = "最后修改时间") + private Long lastModifyTime; + @Schema(description = "业务分类") + private String category; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/billrule/BillRulePagination.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/billrule/BillRulePagination.java new file mode 100644 index 0000000..e9f726f --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/billrule/BillRulePagination.java @@ -0,0 +1,12 @@ +package jnpf.base.model.billrule; + + +import jnpf.base.Pagination; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class BillRulePagination extends Pagination { + @Schema(description = "分类id") + private String categoryId; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/billrule/BillRuleUpForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/billrule/BillRuleUpForm.java new file mode 100644 index 0000000..cc1632e --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/billrule/BillRuleUpForm.java @@ -0,0 +1,15 @@ +package jnpf.base.model.billrule; + +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:30 + */ +@Data +public class BillRuleUpForm extends BillRuleCrForm { + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/button/ButtonListVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/button/ButtonListVO.java new file mode 100644 index 0000000..397e926 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/button/ButtonListVO.java @@ -0,0 +1,22 @@ +package jnpf.base.model.button; + +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class ButtonListVO { + private Long sortCode; + private String id; + private String parentId; + private String fullName; + private String enCode; + private String icon; + private Integer enabledMark; + private String description; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/button/ButtonModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/button/ButtonModel.java new file mode 100644 index 0000000..48d3e8c --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/button/ButtonModel.java @@ -0,0 +1,19 @@ +package jnpf.base.model.button; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * 按钮 + */ +@Data +public class ButtonModel implements Serializable { + private String id; + private String parentId; + private String fullName; + private String enCode; + private String icon; + private String urlAddress; + private String moduleId; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/button/ButtonTreeListModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/button/ButtonTreeListModel.java new file mode 100644 index 0000000..9c4358f --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/button/ButtonTreeListModel.java @@ -0,0 +1,24 @@ +package jnpf.base.model.button; + + +import jnpf.util.treeutil.SumTree; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:30 + */ +@Data +public class ButtonTreeListModel extends SumTree { + private String id; + private String parentId; + private String fullName; + private String enCode; + private String icon; + private Integer enabledMark; + private String description; + private Long sortCode; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/button/ButtonTreeListSelectVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/button/ButtonTreeListSelectVO.java new file mode 100644 index 0000000..319aa92 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/button/ButtonTreeListSelectVO.java @@ -0,0 +1,21 @@ +package jnpf.base.model.button; + +import lombok.Data; + +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class ButtonTreeListSelectVO { + private String id; + private String parentId; + private String fullName; + private String icon; + private List children; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/button/ButtonTreeListVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/button/ButtonTreeListVO.java new file mode 100644 index 0000000..14888c4 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/button/ButtonTreeListVO.java @@ -0,0 +1,37 @@ +package jnpf.base.model.button; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +@JsonInclude(JsonInclude.Include.NON_NULL) +public class ButtonTreeListVO { + @Schema(description = "排序码") + private Long sortCode; + @Schema(description = "主键") + private String id; + @Schema(description = "父级id") + private String parentId; + @Schema(description = "名称") + private String fullName; + @Schema(description = "图标") + private String icon; + @Schema(description = "编码") + private String enCode; + @Schema(description = "有效标志") + private Integer enabledMark; + @Schema(description = "是否有子集") + private Boolean hasChildren; + @Schema(description = "子集集合") + private List children; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/button/ButtonVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/button/ButtonVO.java new file mode 100644 index 0000000..2c32e5f --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/button/ButtonVO.java @@ -0,0 +1,29 @@ +package jnpf.base.model.button; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class ButtonVO { + @Schema(description = "按钮主键") + private String id; + @Schema(description = "按钮上级") + private String parentId; + @Schema(description = "按钮名称") + private String fullName; + @Schema(description = "按钮编码") + private String enCode; + @Schema(description = "按钮图标") + private String icon; + @Schema(description = "请求地址") + private String urlAddress; + @Schema(description = "功能主键") + private String moduleId; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/button/ModuleButtonCrForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/button/ModuleButtonCrForm.java new file mode 100644 index 0000000..2db6772 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/button/ModuleButtonCrForm.java @@ -0,0 +1,32 @@ +package jnpf.base.model.button; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * @author 引迈 + */ +@Data +public class ModuleButtonCrForm { + @Schema(description = "编码") + private String enCode; + + @Schema(description = "有效标志") + private Integer enabledMark; + + @Schema(description = "图标") + private String icon; + + @Schema(description = "名称") + private String fullName; + + @Schema(description = "说明") + private String description; + + @Schema(description = "父级id") + private String parentId; + @Schema(description = "菜单id") + private String moduleId; + @Schema(description = "排序码") + private Long sortCode; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/button/ModuleButtonInfoVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/button/ModuleButtonInfoVO.java new file mode 100644 index 0000000..3aca85a --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/button/ModuleButtonInfoVO.java @@ -0,0 +1,23 @@ +package jnpf.base.model.button; + +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class ModuleButtonInfoVO { + private String enCode; + private Integer enabledMark; + private String fullName; + private String icon; + private String id; + private String parentId; + private String description; + private String moduleId; + private Long sortCode; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/button/ModuleButtonUpForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/button/ModuleButtonUpForm.java new file mode 100644 index 0000000..aaf4fd4 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/button/ModuleButtonUpForm.java @@ -0,0 +1,14 @@ +package jnpf.base.model.button; + +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class ModuleButtonUpForm extends ModuleButtonCrForm{ +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/cachemanage/CacheManageInfoVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/cachemanage/CacheManageInfoVO.java new file mode 100644 index 0000000..4e7a0d4 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/cachemanage/CacheManageInfoVO.java @@ -0,0 +1,19 @@ +package jnpf.base.model.cachemanage; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class CacheManageInfoVO { + @Schema(description = "名称") + private String name; + @Schema(description = "值") + private String value; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/cachemanage/CacheManageListVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/cachemanage/CacheManageListVO.java new file mode 100644 index 0000000..5a2e2e9 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/cachemanage/CacheManageListVO.java @@ -0,0 +1,21 @@ +package jnpf.base.model.cachemanage; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class CacheManageListVO { + @Schema(description = "名称") + private String name; + @Schema(description = "过期时间",example = "1") + private Long overdueTime; + @Schema(description = "大小") + private Integer cacheSize; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/column/ColumnBatchForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/column/ColumnBatchForm.java new file mode 100644 index 0000000..3c1f866 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/column/ColumnBatchForm.java @@ -0,0 +1,31 @@ +package jnpf.base.model.column; + +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.hibernate.validator.constraints.NotBlank; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class ColumnBatchForm { + @Schema(description = "菜单id") + @NotBlank(message = "必填") + private String moduleId; + @Schema(description = "表名") + private String bindTable; + @Schema(description = "绑定表说明") + private String bindTableName; + @Schema(description = "列JSON") + private Object columnJson; + @Schema(description = "排序码") + private Long sortCode; + @Schema(description = "字段规则") + private Integer fieldRule; + private String childTableKey; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/column/ColumnListVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/column/ColumnListVO.java new file mode 100644 index 0000000..8a177bc --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/column/ColumnListVO.java @@ -0,0 +1,27 @@ +package jnpf.base.model.column; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class ColumnListVO { + @Schema(description = "主键") + private String id; + @Schema(description = "列表名称") + private String fullName; + @Schema(description = "编码") + private String enCode; + @Schema(description = "表格") + private String bindTable; + @Schema(description = "是否启用") + private Integer enabledMark; + @Schema(description = "排序码") + private Long sortCode; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/column/ColumnModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/column/ColumnModel.java new file mode 100644 index 0000000..e886b3f --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/column/ColumnModel.java @@ -0,0 +1,19 @@ +package jnpf.base.model.column; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * 列表 + */ +@Data +public class ColumnModel implements Serializable { + private String id; + private String parentId; + private String fullName; + private String enCode; + private String bindTable; + private String bindTableName; + private String moduleId; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/column/ModuleColumnCrForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/column/ModuleColumnCrForm.java new file mode 100644 index 0000000..146742d --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/column/ModuleColumnCrForm.java @@ -0,0 +1,46 @@ +package jnpf.base.model.column; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class ModuleColumnCrForm { + @Schema(description = "编码") + private String enCode; + + @Schema(description = "是否启用") + private Integer enabledMark; + + @Schema(description = "列表名称") + private String fullName; + + @Schema(description = "说明") + private String description; + + @Schema(description = "菜单id") + private String moduleId; + + @Schema(description = "表名") + private String bindTable; + + @Schema(description = "绑定表说明") + private String bindTableName; + + @Schema(description = "排序码") + private Long sortCode; + + @Schema(description = "字段规则") + private Integer fieldRule; + + @Schema(description = "表名") + private String tableName; + + private String childTableKey; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/column/ModuleColumnInfoVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/column/ModuleColumnInfoVO.java new file mode 100644 index 0000000..2151ac9 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/column/ModuleColumnInfoVO.java @@ -0,0 +1,47 @@ +package jnpf.base.model.column; + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.util.visiual.JnpfKeyConsts; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class ModuleColumnInfoVO { + @Schema(description = "是否启用") + private Integer enabledMark; + + @Schema(description = "列表名称") + private String fullName; + + @Schema(description = "说明") + private String description; + + @Schema(description = "编码") + private String enCode; + + @Schema(description = "主键") + private String id; + + @Schema(description = "表名") + private String bindTable; + + @Schema(description = "绑定表说明") + private String bindTableName; + + @Schema(description = "菜单id") + private String moduleId; + + @Schema(description = "排序码") + private Long sortCode; + + @Schema(description = "字段规则") + private Integer fieldRule; + + private String childTableKey = JnpfKeyConsts.CHILD_TABLE_PREFIX; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/column/ModuleColumnUpForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/column/ModuleColumnUpForm.java new file mode 100644 index 0000000..3e97b64 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/column/ModuleColumnUpForm.java @@ -0,0 +1,39 @@ +package jnpf.base.model.column; + +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class ModuleColumnUpForm { + private String creatorUserId; + + private Integer enabledMark; + + private String fullName; + + private String description; + + private Long sortCode; + + private String enCode; + + private String creatorTime; + + private String moduleId; + + private String bindTable; + + private String bindTableName; + + private Integer fieldRule; + + private String tableName; + + private String childTableKey; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/comfields/ComFieldsCrForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/comfields/ComFieldsCrForm.java new file mode 100644 index 0000000..b814e2f --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/comfields/ComFieldsCrForm.java @@ -0,0 +1,33 @@ +package jnpf.base.model.comfields; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import javax.validation.constraints.NotBlank; + +import javax.validation.constraints.NotNull; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class ComFieldsCrForm { + @Schema(description = "字段名") + @NotBlank(message = "必填") + private String fieldName; + @Schema(description = "字段") + @NotBlank(message = "必填") + private String field; + @Schema(description = "类型") + @NotBlank(message = "必填") + private String dataType; + @Schema(description = "长度") + @NotBlank(message = "必填") + private String dataLength; + @Schema(description = "是否必填") + @NotNull(message = "必填") + private Integer allowNull; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/comfields/ComFieldsInfoVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/comfields/ComFieldsInfoVO.java new file mode 100644 index 0000000..75af465 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/comfields/ComFieldsInfoVO.java @@ -0,0 +1,31 @@ +package jnpf.base.model.comfields; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.hibernate.validator.constraints.NotBlank; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class ComFieldsInfoVO { + @Schema(description = "主键") + private String id; + @Schema(description = "字段名") + private String fieldName; + @Schema(description = "类型") + private String dataType; + @Schema(description = "字段") + @NotBlank(message = "必填") + private String field; + @Schema(description = "长度") + private String dataLength; + @Schema(description = "是否必填") + private Integer allowNull; + @Schema(description = "创建时间") + private long creatorTime; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/comfields/ComFieldsListVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/comfields/ComFieldsListVO.java new file mode 100644 index 0000000..bee0ed0 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/comfields/ComFieldsListVO.java @@ -0,0 +1,23 @@ +package jnpf.base.model.comfields; + +import lombok.Data; +import javax.validation.constraints.NotBlank; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class ComFieldsListVO { + private String id; + private String fieldName; + private String dataType; + private String dataLength; + private Integer allowNull; + @NotBlank(message = "必填") + private String field; + private Long creatorTime; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/comfields/ComFieldsUpForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/comfields/ComFieldsUpForm.java new file mode 100644 index 0000000..9e6cb13 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/comfields/ComFieldsUpForm.java @@ -0,0 +1,15 @@ +package jnpf.base.model.comfields; + +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class ComFieldsUpForm extends ComFieldsCrForm{ + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/commonword/ComWordsPagination.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/commonword/ComWordsPagination.java new file mode 100644 index 0000000..a4db5ac --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/commonword/ComWordsPagination.java @@ -0,0 +1,23 @@ +package jnpf.base.model.commonword; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import jnpf.base.Pagination; +import jnpf.base.entity.CommonWordsEntity; +import lombok.Data; + +/** + * 类功能 + * + * @author JNPF开发平台组 YanYu + * @version v3.4.6 + * @copyrignt 引迈信息技术有限公司 + * @date 2023-01-07 + */ +@Data +public class ComWordsPagination extends Pagination { + + public Page getPage(){ + return new Page<>(getCurrentPage(), getPageSize(), getTotal()); + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/commonword/ComWordsTreeModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/commonword/ComWordsTreeModel.java new file mode 100644 index 0000000..8e55a63 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/commonword/ComWordsTreeModel.java @@ -0,0 +1,64 @@ +package jnpf.base.model.commonword; + +import jnpf.util.treeutil.SumTree; +import lombok.Data; + +import java.util.List; + +/** + * 类功能 + * + * @author JNPF开发平台组 YanYu + * @version v3.4.6 + * @copyrignt 引迈信息技术有限公司 + * @date 2023-01-09 + */ +@Data +public class ComWordsTreeModel extends SumTree { + + /** + * 分类下模板数量 + */ + private Integer num; + + /** + * 显示名 + */ + private String fullName; + + /** + * 自然主键 + */ + private String id; + + /** + * 应用id + */ + private List systemIds; + + /** + * 应用名称 + */ + private String systemNames; + + /** + * 常用语 + */ + private String commonWordsText; + + /** + * 常用语类型(0:系统,1:个人) + */ + private Integer commonWordsType; + + /** + * 排序 + */ + private Long sortCode; + + /** + * 有效标志 + */ + private Integer enabledMark; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/commonword/CommonWordsForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/commonword/CommonWordsForm.java new file mode 100644 index 0000000..b326280 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/commonword/CommonWordsForm.java @@ -0,0 +1,39 @@ +package jnpf.base.model.commonword; + + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.util.StringUtil; +import lombok.Data; + +import java.util.List; + +/** + * 类功能 + * + * @author JNPF开发平台组 YanYu + * @version v3.4.6 + * @copyrignt 引迈信息技术有限公司 + * @date 2023-01-07 + */ +@Data +@Schema(description = "CommonWordsForm对象", name = "审批常用语表单对象") +public class CommonWordsForm { + + @Schema(description = "常用语Id") + private String id; + @Schema(description = "常用语类型(0:系统,1:个人)") + private Integer commonWordsType; + @Schema(description = "常用语") + private String commonWordsText; + @Schema(description = "应用id集合") + private List systemIds; + @Schema(description = "排序") + private Long sortCode; + @Schema(description = "有效标志") + private Integer enabledMark; + + public String getSystemIds() { + return StringUtil.join(this.systemIds, ","); + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/commonword/CommonWordsVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/commonword/CommonWordsVO.java new file mode 100644 index 0000000..9f18cdb --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/commonword/CommonWordsVO.java @@ -0,0 +1,44 @@ +package jnpf.base.model.commonword; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Arrays; +import java.util.List; + +/** + * 审批常用语 Entity + * + * @author JNPF开发平台组 YanYu + * @version v3.4.6 + * @copyrignt 引迈信息技术有限公司 + * @date 2023-01-06 + */ +@Data +@Schema(description = "CommonWords对象", name = "审批常用语") +public class CommonWordsVO implements Serializable { + + @Schema(description = "自然主键") + private String id; + @Schema(description = "应用id") + private List systemIds; + @Schema(description = "应用名称") + private String systemNames; + @Schema(description = "常用语") + private String commonWordsText; + @Schema(description = "常用语类型(0:系统,1:个人)") + private Integer commonWordsType; + @Schema(description = "排序") + private Long sortCode; + @Schema(description = "有效标志") + private Integer enabledMark; + + public void setSystemIds(String systemIds) { + if(systemIds != null){ + this.systemIds = Arrays.asList(systemIds.split(",")); + } + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/ApiDateModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/ApiDateModel.java new file mode 100644 index 0000000..da61346 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/ApiDateModel.java @@ -0,0 +1,24 @@ +package jnpf.base.model.datainterface; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class ApiDateModel implements Serializable { + @Schema(description = "请求方式") + private Integer method; + @Schema(description = "URL") + private String url; + @Schema(description = "请求头") + private List header; + private List query; + private String body; + @Schema(description = "body类型") + private Integer bodyType; +// private List extraParameters; +// private String bodyJson; +// private String bodyXml; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataConfigJsonModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataConfigJsonModel.java new file mode 100644 index 0000000..a0b8d83 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataConfigJsonModel.java @@ -0,0 +1,22 @@ +package jnpf.base.model.datainterface; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class DataConfigJsonModel implements Serializable { + /** + * 静态数据 + */ + private String staticData; + /** + * 静态数据 + */ + private SqlDateModel sqlData; + /** + * 静态数据 + */ + private ApiDateModel apiData; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceActionModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceActionModel.java new file mode 100644 index 0000000..8fc0740 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceActionModel.java @@ -0,0 +1,29 @@ +package jnpf.base.model.datainterface; + + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Map; + +/** + * 访问接口参数 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/6/10 16:48 + */ +@Data +@Schema(description="访问接口参数") +public class DataInterfaceActionModel { + @Schema(description = "租户id") + private String tenantId; + @Schema(description = "认证字符串") + private String authString; + @Schema(description = "接口参数") + private Map map; + @Schema(description = "接口类型") + private String invokType; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceActionVo.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceActionVo.java new file mode 100644 index 0000000..a5b4a13 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceActionVo.java @@ -0,0 +1,20 @@ +package jnpf.base.model.datainterface; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 数据接口调用返回模型 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-12-24 + */ +@Data +public class DataInterfaceActionVo implements Serializable { + + private Object data; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceCrForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceCrForm.java new file mode 100644 index 0000000..068b8bc --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceCrForm.java @@ -0,0 +1,49 @@ +package jnpf.base.model.datainterface; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +@Data +public class DataInterfaceCrForm { + @Schema(description ="编码") + @NotNull(message = "接口编码不能为空") + private String enCode; + @Schema(description ="接口名称") + @NotNull(message = "接口名称不能为空") + private String fullName; + @Schema(description ="分类id") + @NotNull(message = "分类id不能为空") + private String category; + @Schema(description ="数据类型") + @NotNull(message = "数据类型不能为空") + private Integer type; + @Schema(description ="是否分页") + private int hasPage; + @Schema(description ="请求方式") + private int action; + @Schema(description ="排序") + private Long sortCode; + @Schema(description ="状态(0-默认,禁用,1-启用)") + private Integer enabledMark; + @Schema(description ="说明备注") + private String description; + @Schema(description ="字段JSON") + private String fieldJson; + @Schema(description ="参数json") + private String parameterJson; + @Schema(description ="后置接口") + private Integer isPostPosition; + @Schema(description ="数据配置json") + private String dataConfigJson; + @Schema(description ="数据统计json") + private String dataCountJson; + @Schema(description ="数据回显json") + private String dataEchoJson; + @Schema(description ="数据处理json") + private String dataJsJson; + @Schema(description ="异常验证json") + private String dataExceptionJson; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceGetListVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceGetListVO.java new file mode 100644 index 0000000..811701e --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceGetListVO.java @@ -0,0 +1,38 @@ +package jnpf.base.model.datainterface; + + +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * 工作流调用弹框时使用 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-12-24 + */ +@Data +public class DataInterfaceGetListVO implements Serializable { + @Schema(description ="主键Id") + private String id; + @Schema(description ="接口名称") + private String fullName; + @Schema(description ="接口类型") + private String type; +// @Schema(description ="类别") +// private String requestMethod; + @Schema(description ="编码") + private String enCode; + @Schema(description ="请求参数") + private String parameterJson; + @Schema(description ="字段JSON") + private String fieldJson; + @Schema(description ="后置接口") + private Integer isPostPosition; + @Schema(description ="是否真分页:0-不分页,1-分页") + private Integer hasPage; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceInvokeModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceInvokeModel.java new file mode 100644 index 0000000..b9353ff --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceInvokeModel.java @@ -0,0 +1,36 @@ +package jnpf.base.model.datainterface; + +import jnpf.base.Pagination; +import lombok.Data; + +import java.io.Serializable; +import java.util.Map; + +@Data +public class DataInterfaceInvokeModel implements Serializable { + private String id; + private String tenantId; + private Map map; + private String token; + private Pagination pagination; + private Map showMap; + + public DataInterfaceInvokeModel() { + } + + public DataInterfaceInvokeModel(String id, String tenantId, Map map, String token) { + this.id = id; + this.tenantId = tenantId; + this.map = map; + this.token = token; + } + + public DataInterfaceInvokeModel(String id, String tenantId, Map map, String token, Pagination pagination, Map showMap) { + this.id = id; + this.tenantId = tenantId; + this.map = map; + this.token = token; + this.pagination = pagination; + this.showMap = showMap; + } +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceListVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceListVO.java new file mode 100644 index 0000000..75d0354 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceListVO.java @@ -0,0 +1,27 @@ +package jnpf.base.model.datainterface; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class DataInterfaceListVO { + @Schema(description ="主键Id") + private String id; + @Schema(description ="接口名称") + private String fullName; + @Schema(description ="接口类型") + private String type; + @Schema(description ="编码") + private String enCode; + @Schema(description ="排序") + private Long sortCode; + @Schema(description ="状态(0-默认,禁用,1-启用)") + private Integer enabledMark; + @Schema(description ="创建时间") + private Long creatorTime; + @Schema(description ="tenantId") + private String tenantId; + @Schema(description ="后置接口") + private Integer isPostPosition; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceLogVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceLogVO.java new file mode 100644 index 0000000..a96c96a --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceLogVO.java @@ -0,0 +1,42 @@ +package jnpf.base.model.datainterface; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 数据接口调用日志 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-06-10 + */ +@Data +public class DataInterfaceLogVO implements Serializable { + + @Schema(description = "主键") + private String id; + + @Schema(description = "调用时间") + private Date invokTime; + + @Schema(description = "用户id") + private String userId; + + @Schema(description = "调用ip") + private String invokIp; + + @Schema(description = "调用设备") + private String invokDevice; + + @Schema(description = "调用类型") + private String invokType; + + @Schema(description = "调用响应时间") + private Integer invokWasteTime; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceMarkModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceMarkModel.java new file mode 100644 index 0000000..b3cc810 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceMarkModel.java @@ -0,0 +1,21 @@ +package jnpf.base.model.datainterface; + +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.io.Serializable; + +@Data +@AllArgsConstructor +public class DataInterfaceMarkModel implements Serializable { + + /** + * 标记名称 + */ + private String markName; + + /** + * 值 + */ + private Object value; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceModel.java new file mode 100644 index 0000000..e49bd88 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceModel.java @@ -0,0 +1,26 @@ +package jnpf.base.model.datainterface; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * 自定义参数模型 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-12-13 + */ +@Data +public class DataInterfaceModel extends ParamModel implements Serializable { + + /** + * 是否为空(0允许,1不允许) + */ + @Schema(description = "是否为空(0允许,1不允许)") + private Integer required; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfacePage.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfacePage.java new file mode 100644 index 0000000..2198d9d --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfacePage.java @@ -0,0 +1,42 @@ +package jnpf.base.model.datainterface; + + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.base.Pagination; +import lombok.Data; + +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class DataInterfacePage extends Pagination { + + //远端接口id + @Schema(description = "远端接口id") + private String interfaceId; + //保存字段 + @Schema(description = "保存字段") + private String propsValue; + //查询字段 + @Schema(description = "查询字段") + private String relationField; + //查询字段(多个) + @Schema(description = "查询字段(多个)") + private String columnOptions; + //数据id + @Schema(description = "数据id") + private String id; + + @Schema(description = "id集合") + private Object ids; + + @Schema(description = "参数集合") + private List paramList; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfacePageModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfacePageModel.java new file mode 100644 index 0000000..1b1538c --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfacePageModel.java @@ -0,0 +1,28 @@ +package jnpf.base.model.datainterface; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +@Schema(description = "分页模型") +public class DataInterfacePageModel implements Serializable { + @Schema(description = "总计SQL") + private String countSql; + @Schema(description = "详情SQL") + private String echoSql; + @Schema(description = "详情路径") + private String echoPath; + @Schema(description = "详情方法") + private String echoReqMethod; + @Schema(description = "详情请求参数") + private List echoReqParameters; + @Schema(description = "详情请求头") + private List echoReqHeaders; + @Schema(description = "分页参数") + private List pageParameters; + @Schema(description = "详情参数") + private List echoParameters; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceParamModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceParamModel.java new file mode 100644 index 0000000..598a013 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceParamModel.java @@ -0,0 +1,22 @@ +package jnpf.base.model.datainterface; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author :JNPF开发平台组 + * @version: V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date :2022/6/2 18:09 + */ +@Data +public class DataInterfaceParamModel implements Serializable { + + private String tenantId; + + private String origin; + + private List paramList; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceTreeModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceTreeModel.java new file mode 100644 index 0000000..ca802e8 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceTreeModel.java @@ -0,0 +1,12 @@ +package jnpf.base.model.datainterface; + +import jnpf.util.treeutil.SumTree; +import lombok.Data; + +@Data +public class DataInterfaceTreeModel extends SumTree { +// private String id; +// private String parentId; + private String fullName; + private String category; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceTreeVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceTreeVO.java new file mode 100644 index 0000000..d94c790 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceTreeVO.java @@ -0,0 +1,21 @@ +package jnpf.base.model.datainterface; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +@Data +public class DataInterfaceTreeVO { + @Schema(description ="分类Id") + private String category; + @Schema(description ="接口名称") + private String fullName; + @Schema(description ="主键") + private String id; + @Schema(description ="是否有子集") + private Boolean hasChildren; + @Schema(description ="子集集合") + private List children; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceUpForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceUpForm.java new file mode 100644 index 0000000..f1db2f6 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceUpForm.java @@ -0,0 +1,7 @@ +package jnpf.base.model.datainterface; +import lombok.Data; + +@Data +public class DataInterfaceUpForm extends DataInterfaceCrForm { + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceVo.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceVo.java new file mode 100644 index 0000000..94ba103 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/DataInterfaceVo.java @@ -0,0 +1,44 @@ +package jnpf.base.model.datainterface; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class DataInterfaceVo { + @Schema(description ="主键id") + private String id; + @Schema(description ="编码") + private String enCode; + @Schema(description ="接口名称") + private String fullName; + @Schema(description ="分类id") + private String category; + @Schema(description ="数据类型") + private Integer type; + @Schema(description ="是否分页") + private Integer hasPage; + @Schema(description ="请求方式") + private Integer action; + @Schema(description ="排序") + private Long sortCode; + @Schema(description ="状态(0-默认,禁用,1-启用)") + private Integer enabledMark; + @Schema(description ="说明备注") + private String description; + @Schema(description ="字段JSON") + private String fieldJson; + @Schema(description ="参数json") + private String parameterJson; + @Schema(description ="后置接口") + private Integer isPostPosition; + @Schema(description ="数据配置json") + private String dataConfigJson; + @Schema(description ="数据统计json") + private String dataCountJson; + @Schema(description ="数据回显json") + private String dataEchoJson; + @Schema(description ="数据处理json") + private String dataJsJson; + @Schema(description ="异常验证json") + private String dataExceptionJson; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/ExtraModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/ExtraModel.java new file mode 100644 index 0000000..f344fad --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/ExtraModel.java @@ -0,0 +1,15 @@ +package jnpf.base.model.datainterface; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +@Data +@Schema(description = "分页参数模型") +public class ExtraModel implements Serializable { + @Schema(description = "字段名称") + private String fieldName; + @Schema(description = "字段名") + private String field; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/FieldModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/FieldModel.java new file mode 100644 index 0000000..6da089e --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/FieldModel.java @@ -0,0 +1,18 @@ +package jnpf.base.model.datainterface; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class FieldModel implements Serializable { + @Schema(description = "主键") + private String id; + + @Schema(description = "参数名称") + private String field; + + @Schema(description = "默认值") + private String defaultValue; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/HeadModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/HeadModel.java new file mode 100644 index 0000000..6ea7e95 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/HeadModel.java @@ -0,0 +1,13 @@ +package jnpf.base.model.datainterface; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class HeadModel extends ParamModel implements Serializable { + + @Schema(description = "来源") + private String source; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/PageParamModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/PageParamModel.java new file mode 100644 index 0000000..ebfb63f --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/PageParamModel.java @@ -0,0 +1,15 @@ +package jnpf.base.model.datainterface; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +@Data +@Schema(description = "分页参数模型") +public class PageParamModel implements Serializable { + @Schema(description = "字段名称") + private String fieldName; + @Schema(description = "字段名") + private String field; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/PaginationDataInterface.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/PaginationDataInterface.java new file mode 100644 index 0000000..57b8f93 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/PaginationDataInterface.java @@ -0,0 +1,25 @@ +package jnpf.base.model.datainterface; + + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.base.Pagination; +import lombok.Data; + +@Data +public class PaginationDataInterface extends Pagination { + @Schema(description = "分类id") + private String category; + /** + * 请求方式 + */ + @Schema(description = "是否分页 0-不分页 1-分页") + private Integer hasPage; + @Schema(description = "有效标志") + private Integer enabledMark; + + /** + * 请求方式 + */ + @Schema(description = "请求方式") + private String dataType; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/PaginationDataInterfaceModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/PaginationDataInterfaceModel.java new file mode 100644 index 0000000..7cdfae3 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/PaginationDataInterfaceModel.java @@ -0,0 +1,24 @@ +package jnpf.base.model.datainterface; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * 工作流选择时使用 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-12-24 + */ +@Data +public class PaginationDataInterfaceModel extends PaginationDataInterface implements Serializable { + /** + * 请求方式 + */ + @Schema(description = "请求方式") + private String type; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/ParamModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/ParamModel.java new file mode 100644 index 0000000..57bc7cd --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/ParamModel.java @@ -0,0 +1,26 @@ +package jnpf.base.model.datainterface; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class ParamModel extends FieldModel implements Serializable { + + @Schema(description = "列说明") + private String fieldName; + + /** + * 参数类型 + * 字符串 + * 整型 + * 日期时间 + * 浮点 + * 长整型 + * 文本 + */ + @Schema(description = "参数类型") + private String dataType; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/SqlDateModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/SqlDateModel.java new file mode 100644 index 0000000..1c5b15d --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterface/SqlDateModel.java @@ -0,0 +1,14 @@ +package jnpf.base.model.datainterface; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class SqlDateModel implements Serializable { + @Schema(description = "连接id") + private String dbLinkId; + @Schema(description = "SQL") + private String sql; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterfacevariate/DataInterfaceVariateListVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterfacevariate/DataInterfaceVariateListVO.java new file mode 100644 index 0000000..1a7ae12 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterfacevariate/DataInterfaceVariateListVO.java @@ -0,0 +1,16 @@ +package jnpf.base.model.datainterfacevariate; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class DataInterfaceVariateListVO implements Serializable { + private String id; + private String interfaceId; + private String fullName; + private String value; + private String creatorUser; + private Long creatorTime; + private Long lastModifyTime; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterfacevariate/DataInterfaceVariateModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterfacevariate/DataInterfaceVariateModel.java new file mode 100644 index 0000000..eedcd11 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterfacevariate/DataInterfaceVariateModel.java @@ -0,0 +1,17 @@ +package jnpf.base.model.datainterfacevariate; + +import jnpf.util.treeutil.SumTree; +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +@Data +public class DataInterfaceVariateModel extends SumTree implements Serializable { + @NotNull(message = "接口id不能为空") + private String interfaceId; + @NotNull(message = "参数名称不能为空") + private String fullName; + private String expression; + private String value; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterfacevariate/DataInterfaceVariateSelectorVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterfacevariate/DataInterfaceVariateSelectorVO.java new file mode 100644 index 0000000..6d36a18 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterfacevariate/DataInterfaceVariateSelectorVO.java @@ -0,0 +1,15 @@ +package jnpf.base.model.datainterfacevariate; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class DataInterfaceVariateSelectorVO implements Serializable { + private String id; + private String fullName; + private String parentId; + private Integer type; + private List children; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterfacevariate/DataInterfaceVariateVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterfacevariate/DataInterfaceVariateVO.java new file mode 100644 index 0000000..ce5a138 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/datainterfacevariate/DataInterfaceVariateVO.java @@ -0,0 +1,11 @@ +package jnpf.base.model.datainterfacevariate; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class DataInterfaceVariateVO extends DataInterfaceVariateModel implements Serializable { + private String id; + private Integer isPostPosition; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbbackup/DbBackupListVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbbackup/DbBackupListVO.java new file mode 100644 index 0000000..0bd8d7a --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbbackup/DbBackupListVO.java @@ -0,0 +1,31 @@ +package jnpf.base.model.dbbackup; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class DbBackupListVO { + + @Schema(description = "备份主键") + private String id; + + @Schema(description = "文件名称") + private String fileName; + + @Schema(description = "文件大小") + private String fileSize; + + @Schema(description = "创建时间",example = "1") + private Long creatorTime; + + @Schema(description = "文件访问地址") + private String fileUrl; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dblink/DbLinkBaseForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dblink/DbLinkBaseForm.java new file mode 100644 index 0000000..712aa90 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dblink/DbLinkBaseForm.java @@ -0,0 +1,100 @@ +package jnpf.base.model.dblink; + +import cn.hutool.json.JSONUtil; +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.database.model.entity.DbLinkEntity; +import jnpf.database.source.impl.DbOracle; +import jnpf.util.JsonUtil; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.util.HashMap; +import java.util.Map; + +/** + * 数据库基础表单对象 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class DbLinkBaseForm { + + /** + * 排序码 + */ + @Schema(description = "排序码") + private long sortCode; + + @Schema(description = "连接名") + @NotBlank(message = "必填") + private String fullName; + + @Schema(description = "数据库类型编码") + @NotBlank(message = "必填") + private String dbType; + + @Schema(description = "用户") + @NotBlank(message = "必填") + private String userName; + + @Schema(description = "数据库名") + private String serviceName; + + @Schema(description = "密码") + @NotBlank(message = "必填") + private String password; + + @Schema(description = "端口") + @NotBlank(message = "必填") + private String port; + + @Schema(description = "ip地址") + @NotBlank(message = "必填") + private String host; + + @Schema(description = "模式") + private String dbSchema; + + @Schema(description = "表空间") + private String tableSpace; + + @Schema(description = "oracle扩展(true:开启,false:关闭)") + private Boolean oracleExtend; + + @Schema(description = "oracle连接类型") + private String oracleLinkType; + + @Schema(description = "oracle服务名") + private String oracleService; + + @Schema(description = "oracle角色") + private String oracleRole; + + + + /** + * 根据表单对象返回连接实体类 + * @param dbLinkBaseForm 连接表单对象 + * @return 连接实体对象 + */ + public DbLinkEntity getDbLinkEntity(DbLinkBaseForm dbLinkBaseForm){ + DbLinkEntity entity = JsonUtil.getJsonToBean(dbLinkBaseForm, DbLinkEntity.class); + if (dbLinkBaseForm.getOracleExtend() != null && dbLinkBaseForm.getOracleExtend()) { + entity.setOracleExtend(1); + } else { + entity.setOracleExtend(0); + } + entity.setDbTableSpace(dbLinkBaseForm.getTableSpace()); + entity.setDbName(dbLinkBaseForm.getServiceName()); + Map oracleParam = new HashMap<>(16); + oracleParam.put(DbOracle.ORACLE_LINK_TYPE,dbLinkBaseForm.getOracleLinkType()); + oracleParam.put(DbOracle.ORACLE_SERVICE,dbLinkBaseForm.getOracleService()); + oracleParam.put(DbOracle.ORACLE_ROLE,dbLinkBaseForm.getOracleRole()); + entity.setOracleParam(JSONUtil.toJsonStr(oracleParam)); + return entity; + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dblink/DbLinkCreUpForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dblink/DbLinkCreUpForm.java new file mode 100644 index 0000000..cfa001f --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dblink/DbLinkCreUpForm.java @@ -0,0 +1,23 @@ +package jnpf.base.model.dblink; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * 数据连接表单对象 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class DbLinkCreUpForm extends DbLinkBaseForm{ + + @Schema(description = "有效标识") + @NotNull(message = "必填") + private boolean enabledMark; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dblink/DbLinkInfoVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dblink/DbLinkInfoVO.java new file mode 100644 index 0000000..2caedc0 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dblink/DbLinkInfoVO.java @@ -0,0 +1,51 @@ +package jnpf.base.model.dblink; + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.database.model.entity.DbLinkEntity; +import jnpf.database.source.impl.DbOracle; +import jnpf.exception.DataException; +import jnpf.util.JsonUtil; +import jnpf.util.JsonUtilEx; +import jnpf.util.StringUtil; +import jnpf.util.XSSEscape; +import lombok.Data; + +import java.util.Map; + +/** + * 页面显示对象 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class DbLinkInfoVO extends DbLinkBaseForm { + + /** + * 获取连接页面显示对象 + * @param entity 连接实体对象 + * @return 返回显示对象 + * @throws DataException ignore + */ + public DbLinkInfoVO getDbLinkInfoVO(DbLinkEntity entity) throws DataException { + DbLinkInfoVO vo = JsonUtilEx.getJsonToBeanEx(entity, DbLinkInfoVO.class); + vo.setServiceName(XSSEscape.escape(entity.getDbName())); + vo.setTableSpace(XSSEscape.escape(entity.getDbTableSpace())); + vo.setOracleExtend(entity.getOracleExtend() != null && entity.getOracleExtend() == 1); + if(StringUtil.isNotEmpty(entity.getOracleParam())){ + Map oracleParam = JsonUtil.stringToMap(entity.getOracleParam()); + if(oracleParam.size() > 0){ + vo.setOracleLinkType(oracleParam.get(DbOracle.ORACLE_LINK_TYPE).toString()); + vo.setOracleRole(oracleParam.get(DbOracle.ORACLE_ROLE).toString()); + vo.setOracleService(oracleParam.get(DbOracle.ORACLE_SERVICE).toString()); + } + } + return vo; + } + + @Schema(description = "主键") + private String id; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dblink/DbLinkListVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dblink/DbLinkListVO.java new file mode 100644 index 0000000..38a7dd0 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dblink/DbLinkListVO.java @@ -0,0 +1,45 @@ +package jnpf.base.model.dblink; + +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class DbLinkListVO { + @Schema(description = "连接名称") + private String fullName; + @Schema(description = "连接驱动") + private String dbType; + @Schema(description = "主机名称") + private String host; + @Schema(description = "端口") + private String port; + @Schema(description = "创建时间",example = "1") + private Long creatorTime; + @Schema(description = "创建人") + @JSONField(name = "creatorUserId") + private String creatorUser; + @Schema(description = "主键") + private String id; + @Schema(description = "修改时间") + private Long lastModifyTime; + @Schema(description = "修改用户") + @JSONField(name = "lastModifyUserId") + private String lastModifyUser; + @Schema(description = "有效标志") + private Integer enabledMark; + @Schema(description = "排序码") + private Long sortCode; + @Schema(description = "数据库名") + private String dbName; + @Schema(description = "用户名") + private String userName; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dblink/DbLinkModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dblink/DbLinkModel.java new file mode 100644 index 0000000..1b65ba7 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dblink/DbLinkModel.java @@ -0,0 +1,24 @@ +package jnpf.base.model.dblink; + +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.util.treeutil.SumTree; +import lombok.Data; + +@Data +public class DbLinkModel extends SumTree { + private String fullName; + private String dbType; + private String host; + private String port; + private Long creatorTime; + @JSONField(name = "creatorUserId") + private String creatorUser; + private String id; + private Long lastModifyTime; + @JSONField(name = "lastModifyUserId") + private String lastModifyUser; + private Integer enabledMark; + private Long sortCode; + private Long num; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dblink/DbLinkSelectorListVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dblink/DbLinkSelectorListVO.java new file mode 100644 index 0000000..8f9dc03 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dblink/DbLinkSelectorListVO.java @@ -0,0 +1,46 @@ +package jnpf.base.model.dblink; + +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class DbLinkSelectorListVO { + @Schema(description = "连接名称") + private String fullName; + @Schema(description = "连接驱动") + private String dbType; + @Schema(description = "主机名称") + private String host; + @Schema(description = "端口") + private String port; + @Schema(description = "创建时间",example = "1") + private Long creatorTime; + @Schema(description = "创建人") + @JSONField(name = "creatorUserId") + private String creatorUser; + @Schema(description = "主键") + private String id; + @Schema(description = "修改时间") + private Long lastModifyTime; + @Schema(description = "修改用户") + @JSONField(name = "lastModifyUserId") + private String lastModifyUser; + @Schema(description = "有效标志") + private Integer enabledMark; + @Schema(description = "排序码") + private Long sortCode; + @Schema(description = "数量") + private Long num; + @Schema(description = "子节点") + private List children; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dblink/PaginationDbLink.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dblink/PaginationDbLink.java new file mode 100644 index 0000000..1f92939 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dblink/PaginationDbLink.java @@ -0,0 +1,21 @@ +package jnpf.base.model.dblink; + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.base.Pagination; +import lombok.Data; + +/** + * 数据连接分页 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-11-20 + */ +@Data +public class PaginationDbLink extends Pagination { + + @Schema(description = "数据库类型") + private String dbType; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbsync/DbSyncForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbsync/DbSyncForm.java new file mode 100644 index 0000000..e2ee371 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbsync/DbSyncForm.java @@ -0,0 +1,36 @@ +package jnpf.base.model.dbsync; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import javax.validation.constraints.NotBlank; +import java.util.List; +import java.util.Map; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class DbSyncForm { + @NotBlank(message = "必填") + @Schema(description = "被同步库连接") + private String dbConnectionFrom; + @NotBlank(message = "必填") + @Schema(description = "同步至库连接") + private String dbConnectionTo; + @NotBlank(message = "必填") + @Schema(description = "单个同步表名") + private String dbTable; + @Schema(description = "批量同步表名集合") + private List dbTableList; + @Schema(description = "被转换库名") + private String dbNameFrom; + @Schema(description = "转换库名") + private String dbNameTo; + @Schema(description = "转换规则") + private Map convertRuleMap; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbsync/DbSyncPrintForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbsync/DbSyncPrintForm.java new file mode 100644 index 0000000..c31d23e --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbsync/DbSyncPrintForm.java @@ -0,0 +1,42 @@ +package jnpf.base.model.dbsync; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotBlank; +import java.util.List; +import java.util.Map; + +/** + * 类功能 + * + * @author JNPF开发平台组 YanYu + * @version v3.4.5 + * @copyrignt 引迈信息技术有限公司 + * @date 2023-01-05 + */ +@Data +@Accessors(chain = true) +public class DbSyncPrintForm { + + @NotBlank + @Schema(description = "被同步库连接") + private String dbLinkFrom; + @Schema(description = "同步至库类型") + private String dbTypeTo; + @Schema(description = "批量同步表名集合") + private List dbTableList; + @Schema(description = "转换规则") + private Map convertRuleMap; + @Schema(description = "输出路径") + private String outPath; + @Schema(description = "输出路径") + private String outFileName; + @Schema(description = "打印类型") + private String printType; + @Schema(description = "多表开关") + private Boolean multiTabFlag; + + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbsync/DbSyncVo.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbsync/DbSyncVo.java new file mode 100644 index 0000000..b4bcc4e --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbsync/DbSyncVo.java @@ -0,0 +1,35 @@ +package jnpf.base.model.dbsync; + +import jnpf.database.model.dbtable.DbTableFieldModel; +import lombok.Data; + +import java.util.List; +import java.util.Map; + +/** + * 类功能 + * + * @author JNPF开发平台组 YanYu + * @version V3.3 + * @copyright 引迈信息技术有限公司 + * @date 2022-06-01 + */ +@Data +public class DbSyncVo { + + /** + * 验证结果 + */ + private Boolean checkDbFlag; + + /** + * 表集合 + */ + private List tableList; + + /** + * 转换规则 + */ + private Map> convertRuleMap; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbtable/dto/DbTableFieldDTO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbtable/dto/DbTableFieldDTO.java new file mode 100644 index 0000000..d724849 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbtable/dto/DbTableFieldDTO.java @@ -0,0 +1,83 @@ +package jnpf.base.model.dbtable.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.base.model.dbtable.form.DbFieldForm; +import jnpf.base.model.dbtable.form.DbTableForm; +import jnpf.database.constant.DbAliasConst; +import jnpf.database.model.dbfield.DbFieldModel; +import jnpf.database.model.dbtable.DbTableFieldModel; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * 建表参数对象 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class DbTableFieldDTO { + + @Schema(description = "表基本信息") + private DbTableForm tableInfo; + + @Schema(description = "字段信息") + private List tableFieldList; + + /** + * 获取表模型 + * + * @param dbLinkId 数据库连接Id + * @return 表模型 + */ + public DbTableFieldModel getCreDbTableModel(String dbLinkId){ + String table = this.getTableInfo().getNewTable(); + return toCommon(table, null, null, dbLinkId); + } + + public DbTableFieldModel getUpDbTableModel(String dbLinkId){ + // 更新时用表 + String oldTable = this.getTableInfo().getTable(); + String newTable = this.getTableInfo().getNewTable(); + return toCommon(null, oldTable, newTable, dbLinkId); + } + + private DbTableFieldModel toCommon(String table, String oldTable, String newTable, String dbLinkId) { + DbTableFieldModel dbTableModel = new DbTableFieldModel(); + DbTableForm dbTableForm = this.getTableInfo(); + // 数据连接Id + dbTableModel.setDbLinkId(dbLinkId); + // 创建表名 + dbTableModel.setTable(table); + // 更新时表名 + dbTableModel.setUpdateOldTable(oldTable); + dbTableModel.setUpdateNewTable(newTable); + // 表注释 + dbTableModel.setComment(dbTableForm.getTableName()); + // 表字段集合 + List list = new ArrayList<>(); + for (DbFieldForm dbFieldForm : this.getTableFieldList()) { + // 字段 + DbFieldModel dbFieldModel = new DbFieldModel(); + // 字段名 + dbFieldModel.setField(dbFieldForm.getField()); + // 字段注释 + dbFieldModel.setComment(dbFieldForm.getFieldName()); + // 主键 + dbFieldModel.setIsPrimaryKey(dbFieldForm.getPrimaryKey() == 1); + // 非空 + dbFieldModel.setNullSign(DbAliasConst.ALLOW_NULL.getSign(dbFieldForm.getAllowNull())); + // 数据类型 + dbFieldModel.setLength(dbFieldForm.getDataLength()); + dbFieldModel.setDataType(dbFieldForm.getDataType()); + list.add(dbFieldModel); + } + dbTableModel.setDbFieldModelList(list); + return dbTableModel; + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbtable/form/DbFieldForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbtable/form/DbFieldForm.java new file mode 100644 index 0000000..8833ae0 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbtable/form/DbFieldForm.java @@ -0,0 +1,47 @@ +package jnpf.base.model.dbtable.form; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +/** + * 表字段表单信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class DbFieldForm { + + @NotBlank(message = "必填") + @Schema(description = "字段名") + private String field; + + @NotBlank(message = "必填") + @Schema(description = "字段说明") + private String fieldName; + + @NotBlank(message = "必填") + @Schema(description = "数据类型") + private String dataType; + + @NotBlank(message = "必填") + @Schema(description = "数据长度") + private String dataLength; + + @NotNull(message = "必填") + @Schema(description = "允许空") + private Integer allowNull; + + @NotBlank(message = "必填") + @Schema(description = "插入位置") + private String index; + + @Schema(description = "主键") + private Integer primaryKey; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbtable/form/DbTableForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbtable/form/DbTableForm.java new file mode 100644 index 0000000..5a3cf50 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbtable/form/DbTableForm.java @@ -0,0 +1,29 @@ +package jnpf.base.model.dbtable.form; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * 表信息表单信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class DbTableForm { + + @Schema(description = "表名") + private String table; + + @NotBlank(message = "必填") + @Schema(description = "表说明") + private String tableName; + + @Schema(description = "新表名") + private String newTable; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbtable/vo/DbFieldVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbtable/vo/DbFieldVO.java new file mode 100644 index 0000000..c47ab11 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbtable/vo/DbFieldVO.java @@ -0,0 +1,49 @@ +package jnpf.base.model.dbtable.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.database.constant.DbAliasConst; +import jnpf.database.datatype.viewshow.constant.DtViewConst; +import jnpf.database.model.dbfield.DbFieldModel; +import jnpf.util.StringUtil; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +@NoArgsConstructor +public class DbFieldVO { + @Schema(description = "数据库字段名") + private String columnName; + + @Schema(description = "字段名") + private String field; + @Schema(description = "字段说明") + private String fieldName; + @Schema(description = "数据类型") + private String dataType; + @Schema(description = "数据长度") + private String dataLength; + @Schema(description = "主键") + private Integer primaryKey; + @Schema(description = "允空") + private Integer allowNull; + @Schema(description = "自增标识 1:是 0:否") + private Integer autoIncrement; + + public DbFieldVO(DbFieldModel dbFieldModel){ + this.field = dbFieldModel.getField(); + this.fieldName = dbFieldModel.getComment(); + this.dataType = dbFieldModel.getDataType(); + this.dataLength = StringUtil.isNotEmpty(dbFieldModel.getLength()) ? dbFieldModel.getLength() : DtViewConst.DEFAULT;; + this.primaryKey = DbAliasConst.PRIMARY_KEY.getNum(dbFieldModel.getIsPrimaryKey()); + this.allowNull = DbAliasConst.ALLOW_NULL.getNum(dbFieldModel.getNullSign()); + this.autoIncrement = DbAliasConst.AUTO_INCREMENT.getNum(dbFieldModel.getIsAutoIncrement()); + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbtable/vo/DbTableInfoVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbtable/vo/DbTableInfoVO.java new file mode 100644 index 0000000..4a70813 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbtable/vo/DbTableInfoVO.java @@ -0,0 +1,42 @@ +package jnpf.base.model.dbtable.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.database.model.dbfield.DbFieldModel; +import jnpf.database.model.dbtable.DbTableFieldModel; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.ArrayList; +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +@NoArgsConstructor +public class DbTableInfoVO { + + @Schema(description = "表信息") + private DbTableVO tableInfo; + @Schema(description = "字段信息集合") + private List tableFieldList; + @Schema(description = "表是否存在信息") + private Boolean hasTableData; + + public DbTableInfoVO(DbTableFieldModel dbTableModel, List dbFieldModelList){ + if(dbTableModel != null){ + List list = new ArrayList<>(); + for (DbFieldModel dbFieldModel : dbFieldModelList) { + list.add(new DbFieldVO(dbFieldModel)); + } + this.tableFieldList = list; + this.tableInfo = new DbTableVO(dbTableModel); + this.hasTableData = dbTableModel.getHasTableData(); + } + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbtable/vo/DbTableListVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbtable/vo/DbTableListVO.java new file mode 100644 index 0000000..2a2bf08 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbtable/vo/DbTableListVO.java @@ -0,0 +1,31 @@ +package jnpf.base.model.dbtable.vo; + +import jnpf.base.vo.PaginationVO; +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.util.List; + +/** + * 表列表返回对象 + * + * @author JNPF开发平台组 YanYu + * @version v3.4.8 + * @copyrignt 引迈信息技术有限公司 + * @date 2023-03-16 + */ +@Data +@AllArgsConstructor +public class DbTableListVO { + + /** + * 数据集合 + */ + private List list; + + /** + * 分页信息 + */ + PaginationVO pagination; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbtable/vo/DbTableVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbtable/vo/DbTableVO.java new file mode 100644 index 0000000..60aff88 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dbtable/vo/DbTableVO.java @@ -0,0 +1,33 @@ +package jnpf.base.model.dbtable.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.database.model.dbtable.DbTableFieldModel; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +@NoArgsConstructor +public class DbTableVO { + + @NotBlank(message = "必填") + @Schema(description = "表名") + private String table; + @NotBlank(message = "必填") + @Schema(description = "表注释") + private String tableName; + + public DbTableVO(DbTableFieldModel dbTableFieldModel){ + this.table = dbTableFieldModel.getTable(); + this.tableName = dbTableFieldModel.getComment(); + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/DictionaryDataAllModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/DictionaryDataAllModel.java new file mode 100644 index 0000000..2aec847 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/DictionaryDataAllModel.java @@ -0,0 +1,17 @@ +package jnpf.base.model.dictionarydata; + +import jnpf.util.treeutil.SumTree; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class DictionaryDataAllModel extends SumTree { + private String fullName; + private String enCode; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/DictionaryDataAllVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/DictionaryDataAllVO.java new file mode 100644 index 0000000..ffdd723 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/DictionaryDataAllVO.java @@ -0,0 +1,23 @@ +package jnpf.base.model.dictionarydata; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.Data; + +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +@JsonInclude(JsonInclude.Include.NON_NULL) +public class DictionaryDataAllVO { + private String id; + private String fullName; + private String parentId; + private String enCode; + private List children; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/DictionaryDataCrForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/DictionaryDataCrForm.java new file mode 100644 index 0000000..c29c5aa --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/DictionaryDataCrForm.java @@ -0,0 +1,37 @@ +package jnpf.base.model.dictionarydata; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import javax.validation.constraints.NotBlank; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class DictionaryDataCrForm { + @NotBlank(message = "必填") + @Schema(description = "项目代码") + private String enCode; + + @Schema(description = "有效标志") + private Integer enabledMark; + + @NotBlank(message = "必填") + @Schema(description = "上级项目名称") + private String fullName; + + @Schema(description = "说明") + private String description; + + @NotBlank(message = "必填") + @Schema(description = "上级id,没有传0") + private String parentId; + @Schema(description = "分类id") + private String dictionaryTypeId; + @Schema(description = "排序码") + private long sortCode; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/DictionaryDataExportModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/DictionaryDataExportModel.java new file mode 100644 index 0000000..d19d2ea --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/DictionaryDataExportModel.java @@ -0,0 +1,102 @@ +package jnpf.base.model.dictionarydata; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 数据字典数据模板 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-06-11 + */ +@Data +public class DictionaryDataExportModel implements Serializable { + /** + * 主键 + */ + private String id; + + /** + * 上级 + */ + private String parentId; + + /** + * 名称 + */ + private String fullName; + + /** + * 编码 + */ + private String enCode; + + /** + * 拼音 + */ + private String simpleSpelling; + + /** + * 默认 + */ + private Integer isDefault; + + /** + * 描述 + */ + private String description; + + /** + * 排序码 + */ + private Long sortCode; + + /** + * 有效标志 + */ + private Integer enabledMark; + + /** + * 创建时间 + */ + private Date creatorTime; + + /** + * 创建用户 + */ + private String creatorUserId; + + /** + * 修改时间 + */ + private Date lastModifyTime; + + /** + * 修改用户 + */ + private String lastModifyUserId; + + /** + * 删除标志 + */ + private Integer deleteMark; + + /** + * 删除时间 + */ + private Date deleteTime; + + /** + * 删除用户 + */ + private String deleteUserId; + + /** + * 类别主键 + */ + private String dictionaryTypeId; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/DictionaryDataInfoVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/DictionaryDataInfoVO.java new file mode 100644 index 0000000..5eb86cd --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/DictionaryDataInfoVO.java @@ -0,0 +1,31 @@ +package jnpf.base.model.dictionarydata; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class DictionaryDataInfoVO { + @Schema(description = "主键") + private String id; + @Schema(description = "父级主键") + private String parentId; + @Schema(description = "说明") + private String description; + @Schema(description = "名称") + private String fullName; + @Schema(description = "编码") + private String enCode; + @Schema(description = "有效标志") + private Integer enabledMark; + @Schema(description = "分类id") + private String dictionaryTypeId; + @Schema(description = "排序码") + private long sortCode; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/DictionaryDataListTreeVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/DictionaryDataListTreeVO.java new file mode 100644 index 0000000..f1e301c --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/DictionaryDataListTreeVO.java @@ -0,0 +1,24 @@ +package jnpf.base.model.dictionarydata; + +import lombok.Data; + +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class DictionaryDataListTreeVO { + private String id; + private String parentId; + private Boolean hasChildren; + private List children; + private String fullName; + private String enCode; + private Integer enabledMark; + private Long sortCode; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/DictionaryDataListVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/DictionaryDataListVO.java new file mode 100644 index 0000000..2879aaa --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/DictionaryDataListVO.java @@ -0,0 +1,25 @@ +package jnpf.base.model.dictionarydata; + +import lombok.Data; + +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class DictionaryDataListVO { + private String id; + private String fullName; + private String enCode; + private Integer enabledMark; + private Boolean hasChildren; + private String parentId; + private List children; + private Long sortCode; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/DictionaryDataModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/DictionaryDataModel.java new file mode 100644 index 0000000..0af8495 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/DictionaryDataModel.java @@ -0,0 +1,22 @@ +package jnpf.base.model.dictionarydata; + +import jnpf.util.treeutil.SumTree; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class DictionaryDataModel extends SumTree { + private String id; + private String parentId; + private String fullName; + private String enCode; + private Integer enabledMark; + private String icon; + private long sortCode; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/DictionaryDataSelectVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/DictionaryDataSelectVO.java new file mode 100644 index 0000000..b7ae019 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/DictionaryDataSelectVO.java @@ -0,0 +1,33 @@ +package jnpf.base.model.dictionarydata; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +@JsonInclude(JsonInclude.Include.NON_NULL) +public class DictionaryDataSelectVO { + @Schema(description = "主键") + private String id; + @Schema(description = "父级主键") + private String parentId; + @Schema(description = "是否有子集") + private Boolean hasChildren; + @Schema(description = "子集集合") + private List children; + @Schema(description = "名称") + private String fullName; + @Schema(description = "图标") + private String icon; + @Schema(description = "分类id") + private String dictionaryTypeId; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/DictionaryDataUpForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/DictionaryDataUpForm.java new file mode 100644 index 0000000..57b79cd --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/DictionaryDataUpForm.java @@ -0,0 +1,15 @@ +package jnpf.base.model.dictionarydata; + +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class DictionaryDataUpForm extends DictionaryDataCrForm{ + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/PageDictionaryData.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/PageDictionaryData.java new file mode 100644 index 0000000..67cd952 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarydata/PageDictionaryData.java @@ -0,0 +1,18 @@ +package jnpf.base.model.dictionarydata; + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.base.Page; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class PageDictionaryData extends Page { + @Schema(description = "是否树形") + private String isTree; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarytype/DictionaryExportModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarytype/DictionaryExportModel.java new file mode 100644 index 0000000..222d058 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarytype/DictionaryExportModel.java @@ -0,0 +1,31 @@ +package jnpf.base.model.dictionarytype; + +import jnpf.base.entity.DictionaryTypeEntity; +import jnpf.base.model.dictionarydata.DictionaryDataExportModel; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 数据字典导入导出模板 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-06-11 + */ +@Data +public class DictionaryExportModel implements Serializable { + + /** + * 字典分类 + */ + private List list; + + /** + * 数据集合 + */ + private List modelList; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarytype/DictionaryTypeCrForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarytype/DictionaryTypeCrForm.java new file mode 100644 index 0000000..9cfdff3 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarytype/DictionaryTypeCrForm.java @@ -0,0 +1,36 @@ +package jnpf.base.model.dictionarytype; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.hibernate.validator.constraints.NotBlank; + +import javax.validation.constraints.NotNull; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class DictionaryTypeCrForm { + @Schema(description = "父级主键") + @org.hibernate.validator.constraints.NotBlank(message = "必填") + private String parentId; + @Schema(description = "名称") + @org.hibernate.validator.constraints.NotBlank(message = "必填") + private String fullName; + @Schema(description = "编码") + @NotBlank(message = "必填") + private String enCode; + @Schema(description = "是否树形") + @NotNull(message = "必填") + private Integer isTree; + @Schema(description = "说明") + private String description; + @Schema(description = "排序码") + private long sortCode; + @Schema(description = "类型") + private Integer category; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarytype/DictionaryTypeInfoVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarytype/DictionaryTypeInfoVO.java new file mode 100644 index 0000000..cad106b --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarytype/DictionaryTypeInfoVO.java @@ -0,0 +1,31 @@ +package jnpf.base.model.dictionarytype; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class DictionaryTypeInfoVO { + @Schema(description = "主键") + private String id; + @Schema(description = "父级主键") + private String parentId; + @Schema(description = "名称") + private String fullName; + @Schema(description = "编码") + private String enCode; + @Schema(description = "是否树形") + private Integer isTree; + @Schema(description = "说明") + private String description; + @Schema(description = "排序码") + private long sortCode; + @Schema(description = "类型") + private Integer category; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarytype/DictionaryTypeListVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarytype/DictionaryTypeListVO.java new file mode 100644 index 0000000..aabf554 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarytype/DictionaryTypeListVO.java @@ -0,0 +1,30 @@ +package jnpf.base.model.dictionarytype; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class DictionaryTypeListVO { + @Schema(description = "主键") + private String id; + @Schema(description = "父级id") + private String parentId; + @Schema(description = "是否有下级") + private Boolean hasChildren; + @Schema(description = "是否为树") + private Integer isTree; + @Schema(description = "子集集合") + private List children = new ArrayList<>(); + @Schema(description = "名称") + private String fullName; + @Schema(description = "编码") + private String enCode; + @Schema(description = "排序码") + private long sortCode; + @Schema(description = "类型") + private String category; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarytype/DictionaryTypeModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarytype/DictionaryTypeModel.java new file mode 100644 index 0000000..0319c04 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarytype/DictionaryTypeModel.java @@ -0,0 +1,15 @@ +package jnpf.base.model.dictionarytype; + +import jnpf.util.treeutil.SumTree; +import lombok.Data; + +@Data +public class DictionaryTypeModel extends SumTree { + private String id; + private String parentId; + private String fullName; + private Integer isTree; + private String enCode; + private long sortCode; + private String category; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarytype/DictionaryTypeSelectModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarytype/DictionaryTypeSelectModel.java new file mode 100644 index 0000000..c6b96fb --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarytype/DictionaryTypeSelectModel.java @@ -0,0 +1,20 @@ +package jnpf.base.model.dictionarytype; + +import jnpf.util.treeutil.SumTree; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class DictionaryTypeSelectModel extends SumTree { + private String id; + private String parentId; + private String fullName; + private String enCode; + private String sortCode; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarytype/DictionaryTypeSelectVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarytype/DictionaryTypeSelectVO.java new file mode 100644 index 0000000..7f95f51 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarytype/DictionaryTypeSelectVO.java @@ -0,0 +1,30 @@ +package jnpf.base.model.dictionarytype; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class DictionaryTypeSelectVO { + @Schema(description = "主键") + private String id; + @Schema(description = "父级主键") + private String parentId; + @Schema(description = "是否有子集") + private Boolean hasChildren; + @Schema(description = "子集集合") + private List children = new ArrayList<>(); + @Schema(description = "名称") + private String fullName; + @Schema(description = "编码") + private String enCode; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarytype/DictionaryTypeUpForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarytype/DictionaryTypeUpForm.java new file mode 100644 index 0000000..397389d --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dictionarytype/DictionaryTypeUpForm.java @@ -0,0 +1,14 @@ +package jnpf.base.model.dictionarytype; + +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class DictionaryTypeUpForm extends DictionaryTypeCrForm { +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dto/PrintDevFormDTO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dto/PrintDevFormDTO.java new file mode 100644 index 0000000..c309d74 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dto/PrintDevFormDTO.java @@ -0,0 +1,68 @@ +package jnpf.base.model.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.time.LocalDateTime; + +/** + * 打印模板-数据传输对象 + * + * @author JNPF开发平台组 YY + * @version V3.2.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月30日 + */ +@Data +public class PrintDevFormDTO { + + @Schema(description = "主键_id") + private String id; + + @NotBlank(message = "必填") + @Schema(description = "名称") + private String fullName; + + @NotBlank(message = "必填") + @Schema(description = "编码",required = true) + private String enCode; + + @NotBlank(message = "必填") + @Schema(description = "分类") + private String category; + + @NotNull(message = "必填") + @Schema(description = "类型") + private Integer type; + + @Schema(description = "描述") + private String description; + + @NotNull(message = "必填") + @Schema(description = "排序码") + private Long sortCode; + + @NotNull(message = "必填") + @Schema(description = "有效标志") + private Integer enabledMark; + + @NotBlank(message = "必填") + @Schema(description = "连接数据_id") + private String dbLinkId; + + @Schema(description = "sql语句") + private String sqlTemplate; + + @Schema(description = "左侧字段") + private String leftFields; + + @Schema(description = "打印模板") + private String printTemplate; + + @Schema(description = "纸张参数") + private String pageParam; + + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dto/PrintDevPaginationDTO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dto/PrintDevPaginationDTO.java new file mode 100644 index 0000000..8e3789e --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/dto/PrintDevPaginationDTO.java @@ -0,0 +1,125 @@ +package jnpf.base.model.dto; + +import jnpf.base.Pagination; +import jnpf.base.model.PrintDevTreeModel; +import lombok.Data; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * 打印模板-数据传输对象 + * + * @author JNPF开发平台组 YY + * @version V3.2.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月30日 + */ +@Data +public class PrintDevPaginationDTO extends Pagination { + + /** + * 分类下模板数量 + */ + private Integer num; + + /** + * 主键_id + */ + private String id; + + /** + * 名称 + */ + private String fullName; + + /** + * 编码 + */ + private String encode; + + /** + * 分类 + */ + private String category; + + /** + * 类型 + */ + private Integer type; + + /** + * 描述 + */ + private String description; + + /** + * 排序码 + */ + private Integer sortCode; + + /** + * 有效标志 + */ + private Integer enabledMark; + + /** + * 创建时间 + */ + private LocalDateTime creatorTime; + + /** + * 创建用户_id + */ + private String creatorUserId; + + /** + * 修改时间 + */ + private LocalDateTime lastModifyTime; + + /** + * 修改用户_id + */ + private String lastModifyUserId; + + /** + * 删除标志 + */ + private Integer deleteMark; + + /** + * 删除时间 + */ + private LocalDateTime deleteTime; + + /** + * 删除用户_id + */ + private String deleteUserId; + + /** + * 连接数据 _id + */ + private String dbLinkId; + + /** + * sql语句 + */ + private String sqlTemplate; + + /** + * 左侧字段 + */ + private String leftFields; + + /** + * 打印模板 + */ + private String printTemplate; + + /** + * 子节点 + */ + private List children; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/form/FormBatchForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/form/FormBatchForm.java new file mode 100644 index 0000000..cedf879 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/form/FormBatchForm.java @@ -0,0 +1,28 @@ +package jnpf.base.model.form; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021-09-14 + */ +@Data +public class FormBatchForm { + @Schema(description = "菜单id") + @NotBlank(message = "必填") + private String moduleId; + @Schema(description = "数据") + private Object formJson; + @Schema(description = "排序码") + private Long sortCode; + @Schema(description = "规则") + private Integer fieldRule; + @Schema(description = "绑定表") + private String bindTable; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/form/ModuleFormCrForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/form/ModuleFormCrForm.java new file mode 100644 index 0000000..60ec43b --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/form/ModuleFormCrForm.java @@ -0,0 +1,38 @@ +package jnpf.base.model.form; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021-09-14 + */ +@Data +public class ModuleFormCrForm { + + @Schema(description = "编码") + private String enCode; + + @Schema(description = "状态") + private Integer enabledMark; + + @Schema(description = "名称") + private String fullName; + + @Schema(description = "备注") + private String description; + + @Schema(description = "菜单id") + private String moduleId; + + @Schema(description = "排序码") + private Long sortCode; + @Schema(description = "规则") + private Integer fieldRule; + @Schema(description = "绑定表") + private String bindTable; + private String childTableKey; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/form/ModuleFormInfoVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/form/ModuleFormInfoVO.java new file mode 100644 index 0000000..6d061c5 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/form/ModuleFormInfoVO.java @@ -0,0 +1,42 @@ +package jnpf.base.model.form; + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.util.visiual.JnpfKeyConsts; +import lombok.Data; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021-09-14 + */ +@Data +public class ModuleFormInfoVO { + + @Schema(description = "主键") + private String id; + + @Schema(description = "编码") + private String enCode; + + @Schema(description = "状态") + private Integer enabledMark; + + @Schema(description = "名称") + private String fullName; + + @Schema(description = "备注") + private String description; + + @Schema(description = "菜单id") + private String moduleId; + + @Schema(description = "排序码") + private Long sortCode; + + @Schema(description = "规则") + private Integer fieldRule; + @Schema(description = "绑定表") + private String bindTable; + private String childTableKey = JnpfKeyConsts.CHILD_TABLE_PREFIX; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/form/ModuleFormListVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/form/ModuleFormListVO.java new file mode 100644 index 0000000..edf0876 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/form/ModuleFormListVO.java @@ -0,0 +1,38 @@ +package jnpf.base.model.form; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021-09-14 + */ +@Data +public class ModuleFormListVO { + + @Schema(description = "主键") + private String id; + + @Schema(description = "编码") + private String enCode; + + @Schema(description = "状态") + private Integer enabledMark; + + @Schema(description = "名称") + private String fullName; + + @Schema(description = "备注") + private String description; + + @Schema(description = "菜单id") + private String moduleId; + + @Schema(description = "排序码") + private Long sortCode; + @Schema(description = "绑定表") + private String bindTable; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/form/ModuleFormModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/form/ModuleFormModel.java new file mode 100644 index 0000000..8cd1ffe --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/form/ModuleFormModel.java @@ -0,0 +1,19 @@ +package jnpf.base.model.form; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021-09-14 + */ +@Data +public class ModuleFormModel { + private String id; + private String fullName; + private String parentId; + private String enCode; + private String moduleId; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/form/ModuleFormUpForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/form/ModuleFormUpForm.java new file mode 100644 index 0000000..96fb313 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/form/ModuleFormUpForm.java @@ -0,0 +1,15 @@ +package jnpf.base.model.form; + +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021-09-14 + */ +@Data +public class ModuleFormUpForm extends ModuleFormCrForm{ + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/messagetemplate/MessageTemplateCrForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/messagetemplate/MessageTemplateCrForm.java new file mode 100644 index 0000000..b159ecb --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/messagetemplate/MessageTemplateCrForm.java @@ -0,0 +1,97 @@ +package jnpf.base.model.messagetemplate; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 新建消息模板 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-12-09 + */ +@Data +public class MessageTemplateCrForm implements Serializable { + /** + * 分类(数据字典) + */ + @Schema(description = "分类") + @NotBlank(message = "消息类型不能为空") + private String category; + + /** + * 模板名称 + */ + @Schema(description = "模板名称") + @NotBlank(message = "模板名称不能为空") + private String fullName; + + /** + * 标题 + */ + @Schema(description = "标题") + @NotBlank(message = "消息标题不能为空") + private String title; + + /** + * 是否站内信 + */ + @Schema(description = "是否站内信") + private Integer isStationLetter; + + /** + * 是否邮箱 + */ + @Schema(description = "是否邮箱") + private Integer isEmail; + + /** + * 是否企业微信 + */ + @Schema(description = "是否企业微信") + private Integer isWecom; + + /** + * 是否钉钉 + */ + @Schema(description = "是否钉钉") + private Integer isDingTalk; + + /** + * 是否短信 + */ + @Schema(description = "是否短信") + private Integer isSms; + + /** + * 短信模板ID + */ + @Schema(description = "短信模板ID") + private String smsId; + + /** + * 模板参数JSON + */ + @Schema(description = "模板参数JSON") + private String templateJson; + + /** + * 内容 + */ + @Schema(description = "内容") + private String content; + + /** + * 有效标志 + */ + @Schema(description = "有效标志") + private Integer enabledMark; + + @Schema(description = "编码") + private String enCode; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/messagetemplate/MessageTemplateListVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/messagetemplate/MessageTemplateListVO.java new file mode 100644 index 0000000..bfbb2d5 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/messagetemplate/MessageTemplateListVO.java @@ -0,0 +1,78 @@ +package jnpf.base.model.messagetemplate; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 消息模板 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-12-09 + */ +@Data +public class MessageTemplateListVO implements Serializable { + @Schema(description = "主键") + private String id; + @Schema(description = "消息类型") + private String category; + @Schema(description = "模板名称") + private String fullName; + @Schema(description = "创建人") + private String creatorUser; + @Schema(description = "创建时间") + private Date creatorTime; + @Schema(description = "修改时间") + private Date lastModifyTime; + + /** + * 通知方式 + */ + @Schema(description = "通知方式") + private String noticeMethod; + + /** + * 标题 + */ + @Schema(description = "标题") + private String title; + /** + * 内容 + */ + @Schema(description = "内容") + private String content; + /** + * 有效标志 + */ + @Schema(description = "有效标志") + private Integer enabledMark; + + @Schema(description = "编码") + private String enCode; + + @Schema(description = "是否站内信") + @JsonIgnore + private Integer isStationLetter; + @Schema(description = "是否邮件") + @JsonIgnore + private Integer isEmail; + @Schema(description = "是否微信") + @JsonIgnore + private Integer isWecom; + @Schema(description = "是否钉钉") + @JsonIgnore + private Integer isDingTalk; + @Schema(description = "是否短信") + @JsonIgnore + private Integer isSms; + + @Schema(description = "创建用户") + @JsonIgnore + private String creatorUserId; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/messagetemplate/MessageTemplateSelector.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/messagetemplate/MessageTemplateSelector.java new file mode 100644 index 0000000..ab4a31f --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/messagetemplate/MessageTemplateSelector.java @@ -0,0 +1,30 @@ +package jnpf.base.model.messagetemplate; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-12-11 + */ +@Data +public class MessageTemplateSelector implements Serializable { + @Schema(description = "主键") + private String id; + @Schema(description = "模板名称") + private String fullName; + @Schema(description = "消息类型") + private String category; + @Schema(description = "标题") + private String title; + @Schema(description = "内容") + private String content; + @Schema(description = "模板参数JSON") + private String templateJson; + @Schema(description = "编码") + private String enCode; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/messagetemplate/MessageTemplateUpForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/messagetemplate/MessageTemplateUpForm.java new file mode 100644 index 0000000..a0e4051 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/messagetemplate/MessageTemplateUpForm.java @@ -0,0 +1,18 @@ +package jnpf.base.model.messagetemplate; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 新建消息模板 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-12-09 + */ +@Data +public class MessageTemplateUpForm extends MessageTemplateCrForm implements Serializable { + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/messagetemplate/MessageTemplateVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/messagetemplate/MessageTemplateVO.java new file mode 100644 index 0000000..6fd31bc --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/messagetemplate/MessageTemplateVO.java @@ -0,0 +1,98 @@ +package jnpf.base.model.messagetemplate; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-12-09 + */ +@Data +public class MessageTemplateVO implements Serializable { + @Schema(description = "主键") + private String id; + /** + * 分类(数据字典) + */ + @Schema(description = "分类") + private String category; + + /** + * 模板名称 + */ + @Schema(description = "模板名称") + private String fullName; + + /** + * 标题 + */ + @Schema(description = "标题") + private String title; + + /** + * 是否站内信 + */ + @Schema(description = "是否站内信") + private Integer isStationLetter; + + /** + * 是否邮箱 + */ + @Schema(description = "是否邮箱") + private Integer isEmail; + + /** + * 是否企业微信 + */ + @Schema(description = "是否企业微信") + private Integer isWecom; + + /** + * 是否钉钉 + */ + @Schema(description = "是否钉钉") + private Integer isDingTalk; + + /** + * 是否短信 + */ + @Schema(description = "是否短信") + private Integer isSms; + + /** + * 短信模板ID + */ + @Schema(description = "短信模板ID") + private String smsId; + + /** + * 模板参数JSON + */ + @Schema(description = "模板参数JSON") + private String templateJson; + + /** + * 内容 + */ + @Schema(description = "内容") + private String content; + + /** + * 有效标志 + */ + @Schema(description = "有效标志") + private Integer enabledMark; + + /** + * 短信模板Id + */ + @Schema(description = "短信模板Id") + private String smsTemplateName; + + @Schema(description = "编码") + private String enCode; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/MenuListVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/MenuListVO.java new file mode 100644 index 0000000..d06ff2c --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/MenuListVO.java @@ -0,0 +1,42 @@ +package jnpf.base.model.module; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class MenuListVO { + @Schema(description = "主键") + private String id; + @Schema(description = "是否有下级菜单") + private Boolean hasChildren; + @Schema(description = "上级ID") + private String parentId; + @Schema(description = "状态") + private Integer enabledMark; + @Schema(description = "菜单名称") + private String fullName; + @Schema(description = " 图标") + private String icon; + @Schema(description = "链接地址") + private String urlAddress; + @Schema(description = "菜单类型",example = "1") + private Integer type; + @Schema(description = "下级菜单列表") + private List children; + private Integer isButtonAuthorize; + private Integer isColumnAuthorize; + private Integer isDataAuthorize; + private Integer isFormAuthorize; + private Long sortCode; + + private String systemId; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/MenuSelectAllVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/MenuSelectAllVO.java new file mode 100644 index 0000000..ca2dd38 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/MenuSelectAllVO.java @@ -0,0 +1,48 @@ +package jnpf.base.model.module; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class MenuSelectAllVO { + @Schema(description = "主键") + private String id; + @Schema(description = "是否有下级菜单") + private Boolean hasChildren; + @Schema(description = "上级ID") + private String parentId; + @Schema(description = "状态") + private Integer enabledMark; + @Schema(description = "菜单名称") + private String fullName; + @Schema(description = " 图标") + private String icon; + @Schema(description = "链接地址") + private String urlAddress; + @Schema(description = "菜单类型",example = "1") + private Integer type; + @Schema(description = "下级菜单列表") + private List children; + private Long sortCode; + @Schema(description = "配置") + private String propertyJson; + + @Schema(description = "外链") + private String linkTarget; + @Schema(description = "编码") + private String enCode; + + @Schema(description = "系统id") + private String systemId; + @Schema(description = "是否菜单") + private Boolean hasModule; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/MenuSelectVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/MenuSelectVO.java new file mode 100644 index 0000000..c0953b9 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/MenuSelectVO.java @@ -0,0 +1,49 @@ +package jnpf.base.model.module; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class MenuSelectVO { + @Schema(description = "主键") + private String id; + @Schema(description = "父主键") + private String parentId; + @Schema(description = "名称") + private String fullName; + @Schema(description = "是否按钮权限") + private Integer isButtonAuthorize; + @Schema(description = "是否列表权限") + private Integer isColumnAuthorize; + @Schema(description = "是否数据权限") + private Integer isDataAuthorize; + @Schema(description = "排序码") + private Long sortCode; + @Schema(description = "图标") + private String icon; + @Schema(description = "是否有下级菜单") + private Boolean hasChildren; + @Schema(description = "下级菜单列表") + private List children; + + @Schema(description = "外链") + private String linkTarget; + @Schema(description = "编码") + private String enCode; + + + @Schema(description = "系统id") + private String systemId; + + @Schema(description = "分类") + private Integer type; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/ModuleCrForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/ModuleCrForm.java new file mode 100644 index 0000000..1b33e95 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/ModuleCrForm.java @@ -0,0 +1,50 @@ +package jnpf.base.model.module; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class ModuleCrForm { + @Schema(description = "父主键") + private String parentId; + @Schema(description = "名称") + private String fullName; + @Schema(description = "是否按钮权限") + private Integer isButtonAuthorize; + @Schema(description = "是否列表权限") + private Integer isColumnAuthorize; + @Schema(description = "是否数据权限") + private Integer isDataAuthorize; + @Schema(description = "是否表单权限") + private Integer isFormAuthorize; + @Schema(description = "编码") + private String enCode; + @Schema(description = "图标") + private String icon; + @Schema(description = "分类") + private Integer type; + @Schema(description = "URL地址") + private String urlAddress; + @Schema(description = "外链") + private String linkTarget; + @Schema(description = "分类") + private String category; + @Schema(description = "说明") + private String description; + @Schema(description = "有效标志") + private Integer enabledMark; + @Schema(description = "排序码") + private long sortCode; + @Schema(description = "扩展json") + private String propertyJson; + + @Schema(description = "系统id") + private String systemId; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/ModuleExportModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/ModuleExportModel.java new file mode 100644 index 0000000..2415ae1 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/ModuleExportModel.java @@ -0,0 +1,24 @@ +package jnpf.base.model.module; + +import jnpf.base.entity.*; +import lombok.Data; + +import java.util.List; + +/** + * 系统菜单导出模型 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-06-17 + */ +@Data +public class ModuleExportModel { + private ModuleEntity moduleEntity; + private List buttonEntityList; + private List columnEntityList; + private List formEntityList; + private List schemeEntityList; + private List authorizeEntityList; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/ModuleInfoVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/ModuleInfoVO.java new file mode 100644 index 0000000..ceaaa1c --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/ModuleInfoVO.java @@ -0,0 +1,17 @@ +package jnpf.base.model.module; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class ModuleInfoVO extends ModuleCrForm{ + @Schema(description = "主键") + private String id; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/ModuleModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/ModuleModel.java new file mode 100644 index 0000000..b843628 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/ModuleModel.java @@ -0,0 +1,27 @@ +package jnpf.base.model.module; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * 功能 + */ +@Data +public class ModuleModel implements Serializable { + private String id; + private String parentId; + private String fullName; + private String icon; + //1-类别、2-页面 + private int type; + private String urlAddress; + private String linkTarget; + private String category; + private String description; + private Long sortCode=999999L; + private String enCode; + private String propertyJson; + + private String systemId; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/ModulePermissionModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/ModulePermissionModel.java new file mode 100644 index 0000000..4e1e3e2 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/ModulePermissionModel.java @@ -0,0 +1,23 @@ +package jnpf.base.model.module; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class ModulePermissionModel implements Serializable { + + @Schema(description = "名称") + private String fullName; + @Schema(description = "是否有权限 0-未开启 1-有权限 2-无权限") + private int type; + private List list; + + @Data + public static class ModulePermissionBaseModel { + private String id; + private String fullName; + } +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/ModulePermissionVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/ModulePermissionVO.java new file mode 100644 index 0000000..6e05c42 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/ModulePermissionVO.java @@ -0,0 +1,23 @@ +package jnpf.base.model.module; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class ModulePermissionVO implements Serializable { + + @Schema(description = "按钮权限") + private ModulePermissionModel buttonAuthorize; + @Schema(description = "列表权限") + private ModulePermissionModel columnAuthorize; + @Schema(description = "表单权限") + private ModulePermissionModel formAuthorize; + @Schema(description = "数据权限") + private ModulePermissionModel dataAuthorize; + @Schema(description = "权限成员") + private ModulePermissionModel permissionMember; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/ModuleUpForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/ModuleUpForm.java new file mode 100644 index 0000000..c81cab8 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/ModuleUpForm.java @@ -0,0 +1,15 @@ +package jnpf.base.model.module; + +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class ModuleUpForm extends ModuleCrForm{ + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/ModuleVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/ModuleVO.java new file mode 100644 index 0000000..e38d0c0 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/ModuleVO.java @@ -0,0 +1,27 @@ +package jnpf.base.model.module; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class ModuleVO { + @Schema(description = "功能主键") + private String id; + @Schema(description = "功能上级") + private String parentId; + @Schema(description = "功能类别【1-类别、2-页面】") + private Integer type; + @Schema(description = "功能名称") + private String fullName; + @Schema(description = "功能编码") + private String enCode; + @Schema(description = "功能地址") + private String urlAddress; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/PaginationMenu.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/PaginationMenu.java new file mode 100644 index 0000000..9307c75 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/PaginationMenu.java @@ -0,0 +1,18 @@ +package jnpf.base.model.module; + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.base.Page; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class PaginationMenu extends Page { + @Schema(description = "分类") + private String category; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/PropertyJsonModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/PropertyJsonModel.java new file mode 100644 index 0000000..8463eda --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/module/PropertyJsonModel.java @@ -0,0 +1,17 @@ +package jnpf.base.model.module; + +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class PropertyJsonModel { + private String iconBackgroundColor; + private String moduleId; + private Integer isTree; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/moduledataauthorize/DataAuthorizeCrForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/moduledataauthorize/DataAuthorizeCrForm.java new file mode 100644 index 0000000..4766079 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/moduledataauthorize/DataAuthorizeCrForm.java @@ -0,0 +1,41 @@ +package jnpf.base.model.moduledataauthorize; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class DataAuthorizeCrForm { + @Schema(description = "名称") + private String fullName; + + @Schema(description = "编码") + private String enCode; + + @Schema(description = "分类") + private String type; + + @Schema(description = "条件") + private String conditionSymbol; + + @Schema(description = "条件文本") + private String conditionText; + + @Schema(description = "说明") + private String description; + + @Schema(description = "菜单id") + private String moduleId; + @Schema(description = "规则") + private Integer fieldRule; + @Schema(description = "绑定表") + private String bindTable; + private String childTableKey; + private String format; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/moduledataauthorize/DataAuthorizeInfoVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/moduledataauthorize/DataAuthorizeInfoVO.java new file mode 100644 index 0000000..31ce6a3 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/moduledataauthorize/DataAuthorizeInfoVO.java @@ -0,0 +1,38 @@ +package jnpf.base.model.moduledataauthorize; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class DataAuthorizeInfoVO { + + @Schema(description = "主键") + private String id; + + @Schema(description = "名称") + private String fullName; + + @Schema(description = "编码") + private String enCode; + + @Schema(description = "分类") + private String type; + + @Schema(description = "条件") + private String conditionSymbol; + + @Schema(description = "条件文本") + private String conditionText; + @Schema(description = "菜单id") + private String moduleId; + + @Schema(description = "说明") + private String description; + @Schema(description = "规则") + private Integer fieldRule; + @Schema(description = "绑定表") + private String bindTable; + private String childTableKey; + private String format; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/moduledataauthorize/DataAuthorizeLinkForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/moduledataauthorize/DataAuthorizeLinkForm.java new file mode 100644 index 0000000..d8b9033 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/moduledataauthorize/DataAuthorizeLinkForm.java @@ -0,0 +1,29 @@ +package jnpf.base.model.moduledataauthorize; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * 数据权限 连接表单 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2022/6/7 + */ +@Data +public class DataAuthorizeLinkForm { + @Schema(description = "主键") + private String id; + @Schema(description = "菜单id") + @NotBlank(message = "必填") + private String moduleId; + @Schema(description = "连接id") + private String linkId; + @Schema(description = "连接表") + private String linkTables; + @Schema(description = "数据类型") + private String dataType; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/moduledataauthorize/DataAuthorizeListVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/moduledataauthorize/DataAuthorizeListVO.java new file mode 100644 index 0000000..50e8ef2 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/moduledataauthorize/DataAuthorizeListVO.java @@ -0,0 +1,45 @@ +package jnpf.base.model.moduledataauthorize; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class DataAuthorizeListVO { + + @Schema(description = "主键") + private String id; + + @Schema(description = "名称") + private String fullName; + + @Schema(description = "时间格式") + private String format; + + @Schema(description = "编码") + private String enCode; + + @Schema(description = "分类") + private String type; + + @Schema(description = "条件") + private String conditionSymbol; + + @Schema(description = "条件名称") + private String conditionSymbolName; + + @Schema(description = "条件文本") + private String conditionText; + + @Schema(description = "条件") + private String conditionName; + + @Schema(description = "绑定表") + private String bindTable; + + @Schema(description = "规则") + private String fieldRule; + + @Schema(description = "关联字段") + private String childTableKey; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/moduledataauthorize/DataAuthorizeTableNameVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/moduledataauthorize/DataAuthorizeTableNameVO.java new file mode 100644 index 0000000..653006b --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/moduledataauthorize/DataAuthorizeTableNameVO.java @@ -0,0 +1,16 @@ +package jnpf.base.model.moduledataauthorize; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Builder; +import lombok.Data; + +import java.util.List; + +@Data +@Builder +public class DataAuthorizeTableNameVO { + @Schema(description = "连接id") + private String linkId; + @Schema(description = "连接表集合") + private List linkTables; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/moduledataauthorize/DataAuthorizeUpForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/moduledataauthorize/DataAuthorizeUpForm.java new file mode 100644 index 0000000..8747c4b --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/moduledataauthorize/DataAuthorizeUpForm.java @@ -0,0 +1,15 @@ +package jnpf.base.model.moduledataauthorize; + +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class DataAuthorizeUpForm extends DataAuthorizeCrForm{ + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/moduledataauthorizescheme/DataAuthorizeSchemeCrForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/moduledataauthorizescheme/DataAuthorizeSchemeCrForm.java new file mode 100644 index 0000000..0a45fbf --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/moduledataauthorizescheme/DataAuthorizeSchemeCrForm.java @@ -0,0 +1,35 @@ +package jnpf.base.model.moduledataauthorizescheme; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class DataAuthorizeSchemeCrForm { + @NotBlank(message = "方案名称不能为空") + private String fullName; + + private Object conditionJson; + + private String conditionText; + + private String moduleId; + + @NotBlank(message = "方案编码不能为空") + private String enCode; + + /** + * 全部数据标识 + */ + private Integer allData; + /** + * 分组匹配逻辑 + */ + private String matchLogic; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/moduledataauthorizescheme/DataAuthorizeSchemeInfoVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/moduledataauthorizescheme/DataAuthorizeSchemeInfoVO.java new file mode 100644 index 0000000..dd8740d --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/moduledataauthorizescheme/DataAuthorizeSchemeInfoVO.java @@ -0,0 +1,36 @@ +package jnpf.base.model.moduledataauthorizescheme; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class DataAuthorizeSchemeInfoVO { + + @Schema(description = "主键") + private String id; + + @Schema(description = "名称") + private String fullName; + + @Schema(description = "条件文本") + private String conditionText; + + @Schema(description = "条件json") + private String conditionJson; + + @Schema(description = "功能主键") + private String moduleId; + + @Schema(description = "编码") + private String enCode; + + /** + * ȫ�����ݱ�ʶ + */ + @Schema(description = "是否全部数据") + private Integer allData; + + @Schema(description = "分组匹配逻辑") + private String matchLogic; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/moduledataauthorizescheme/DataAuthorizeSchemeListVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/moduledataauthorizescheme/DataAuthorizeSchemeListVO.java new file mode 100644 index 0000000..c2d5016 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/moduledataauthorizescheme/DataAuthorizeSchemeListVO.java @@ -0,0 +1,34 @@ +package jnpf.base.model.moduledataauthorizescheme; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF����ƽ̨�� + * @version V3.1.0 + * @copyright ������Ϣ�������޹�˾ + * @date 2021/3/12 15:31 + */ +@Data +public class DataAuthorizeSchemeListVO { + + @Schema(description = "主键") + private String id; + + @Schema(description = "名称") + private String fullName; + + @Schema(description = "条件文本") + private String conditionText; + + @Schema(description = "编码") + private String enCode; + + @Schema(description = "是否全部数据") + private Integer allData; + + @Schema(description = "分组匹配逻辑") + private String matchLogic; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/moduledataauthorizescheme/DataAuthorizeSchemeUpForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/moduledataauthorizescheme/DataAuthorizeSchemeUpForm.java new file mode 100644 index 0000000..66e98d6 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/moduledataauthorizescheme/DataAuthorizeSchemeUpForm.java @@ -0,0 +1,6 @@ +package jnpf.base.model.moduledataauthorizescheme; +import lombok.Data; + +@Data +public class DataAuthorizeSchemeUpForm extends DataAuthorizeSchemeCrForm { +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/monitor/CpuModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/monitor/CpuModel.java new file mode 100644 index 0000000..2acad38 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/monitor/CpuModel.java @@ -0,0 +1,31 @@ +package jnpf.base.model.monitor; + +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class CpuModel { + @Schema(description = "cpu名称") + private String name; + @Schema(description = "物理CPU个数") + @JSONField(name="package") + private String packageName; + @Schema(description = "CPU内核个数") + private String core; + @Schema(description = "内核个数") + private int coreNumber; + @Schema(description = "逻辑CPU个数") + private String logic; + @Schema(description = "CPU已用百分比") + private String used; + @Schema(description = "未用百分比") + private String idle; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/monitor/DiskModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/monitor/DiskModel.java new file mode 100644 index 0000000..c6c3929 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/monitor/DiskModel.java @@ -0,0 +1,23 @@ +package jnpf.base.model.monitor; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class DiskModel { + @Schema(description = "硬盘总容量") + private String total; + @Schema(description = "空闲硬盘") + private String available; + @Schema(description = "已使用") + private String used; + @Schema(description = "已使用百分比") + private String usageRate; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/monitor/MemoryModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/monitor/MemoryModel.java new file mode 100644 index 0000000..eb2d13b --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/monitor/MemoryModel.java @@ -0,0 +1,23 @@ +package jnpf.base.model.monitor; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class MemoryModel { + @Schema(description = "总内存") + private String total; + @Schema(description = "空闲内存") + private String available; + @Schema(description = "已使用") + private String used; + @Schema(description = "已使用百分比") + private String usageRate; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/monitor/MonitorListVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/monitor/MonitorListVO.java new file mode 100644 index 0000000..878d308 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/monitor/MonitorListVO.java @@ -0,0 +1,25 @@ +package jnpf.base.model.monitor; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class MonitorListVO { + @Schema(description = "系统信息") + private SystemModel system; + @Schema(description = "CPU信息") + private CpuModel cpu; + @Schema(description = "内存信息") + private MemoryModel memory; + @Schema(description = "硬盘信息") + private DiskModel disk; + @Schema(description = "当前时间") + private Long time; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/monitor/SwapModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/monitor/SwapModel.java new file mode 100644 index 0000000..65f35ea --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/monitor/SwapModel.java @@ -0,0 +1,18 @@ +package jnpf.base.model.monitor; + +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class SwapModel { + private String total; + private String available; + private String used; + private String usageRate; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/monitor/SystemModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/monitor/SystemModel.java new file mode 100644 index 0000000..39a7f05 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/monitor/SystemModel.java @@ -0,0 +1,21 @@ +package jnpf.base.model.monitor; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class SystemModel { + @Schema(description = "系统") + private String os; + @Schema(description = "服务器IP") + private String ip; + @Schema(description = "运行时间") + private String day; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/online/AuthFlieds.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/online/AuthFlieds.java new file mode 100644 index 0000000..f77390e --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/online/AuthFlieds.java @@ -0,0 +1,56 @@ +package jnpf.base.model.online; + +import lombok.Builder; +import lombok.Data; +/** + * + * + * @author JNPF开发平台组 + * @version V3.4 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2022/4/6 + */ +@Data +@Builder +public class AuthFlieds { + + private String id; + /** + * 字段名 + */ + private String fullName; + /** + * 是否启用 + */ + private Boolean status; + + /** + * encode + */ + private String encode; + + /** + * 规则 (0.主表规则 1.副表规则 2.子表规则) + */ + private Integer rule; + + /** + * 控件类型 + */ + private String jnpfKey; + + /** + * 数据权限条件 + */ + private String AuthCondition; + + /** + * 表名 + */ + private String bindTableName; + + /** + * 子表规则key + */ + private String childTableKey; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/online/BatchOnlineModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/online/BatchOnlineModel.java new file mode 100644 index 0000000..4e04b83 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/online/BatchOnlineModel.java @@ -0,0 +1,18 @@ +package jnpf.base.model.online; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-12-15 + */ +@Data +public class BatchOnlineModel implements Serializable { + @Schema(description = "id集合") + private String[] ids; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/online/PerColModels.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/online/PerColModels.java new file mode 100644 index 0000000..df24d05 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/online/PerColModels.java @@ -0,0 +1,44 @@ +package jnpf.base.model.online; + +import jnpf.base.entity.ModuleDataAuthorizeEntity; +import jnpf.base.entity.ModuleDataAuthorizeSchemeEntity; +import lombok.Data; + +import java.util.List; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.4 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2022/4/7 + */ +@Data +public class PerColModels { + /** + * 数据权限 + */ + private List dataPermission; + + /** + * 表单权限 + */ + private List formPermission; + + /** + * 列表权限 + */ + private List listPermission; + + /** + * 按钮权限 + */ + private List buttonPermission; + + /** + * 数据权限方案 + */ + private List dataPermissionScheme; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/online/VisualMenuModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/online/VisualMenuModel.java new file mode 100644 index 0000000..99eab3e --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/online/VisualMenuModel.java @@ -0,0 +1,55 @@ +package jnpf.base.model.online; + +import lombok.Data; + +import java.util.List; + +/** + * 可视化菜单对象 + * + * @author JNPF开发平台组 + * @version V3.4 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2022/4/6 + */ +@Data +public class VisualMenuModel { + /** + * 功能id + */ + private String id; + + /** + * pc 按钮配置 + */ + private PerColModels pcPerCols; + + /** + * app 按钮配置 + */ + private PerColModels appPerCols; + + /** + * 功能名 + */ + private String fullName; + + /** + * 功能编码 + */ + private String encode; + + private Integer pc; + + private Integer app; + + private String pcModuleParentId; + + private String appModuleParentId; + + private String pcSystemId; + + private String appSystemId; + + private Integer type; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/portalManage/PortalManageCreForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/portalManage/PortalManageCreForm.java new file mode 100644 index 0000000..accf24b --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/portalManage/PortalManageCreForm.java @@ -0,0 +1,57 @@ +package jnpf.base.model.portalManage; + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.base.entity.PortalManageEntity; +import jnpf.util.RandomUtil; +import lombok.Data; +import org.springframework.beans.BeanUtils; + +import javax.validation.constraints.NotNull; + +/** + * 门户管理表单创建对象 + * + * @author JNPF开发平台组 YanYu + * @version v3.4.6 + * @copyrignt 引迈信息技术有限公司 + * @date 2023-02-16 + */ +@Data +public class PortalManageCreForm { + + @Schema(description = "说明") + private String description; + + @Schema(description = "门户_id") +// @NotNull(message = "必填") + private String portalId; + + @Schema(description = "系统_id") +// @NotNull(message = "必填") + private String systemId; + + @Schema(description = "平台") +// @NotNull(message = "必填") + private String platform; + + @Schema(description = "默认首页") +// @NotNull(message = "必填") + private Integer homePageMark; + + @Schema(description = "排序码") +// @NotNull(message = "必填") + private Long sortCode; + + @Schema(description = "有效标志") +// @NotNull(message = "必填") + private Integer enabledMark; + + public PortalManageEntity convertEntity(){ + PortalManageEntity portalManageEntity = new PortalManageEntity(); + BeanUtils.copyProperties(this, portalManageEntity); + portalManageEntity.setPlatform(portalManageEntity.getPlatform()); + portalManageEntity.setId(RandomUtil.uuId()); + return portalManageEntity; + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/portalManage/PortalManagePage.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/portalManage/PortalManagePage.java new file mode 100644 index 0000000..d108793 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/portalManage/PortalManagePage.java @@ -0,0 +1,47 @@ +package jnpf.base.model.portalManage; + +import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO; +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.base.Pagination; +import jnpf.base.vo.PaginationVO; +import lombok.Data; + +/** + * 类功能 + * + * @author JNPF开发平台组 YanYu + * @version v3.4.8 + * @copyrignt 引迈信息技术有限公司 + * @date 2023-04-17 + */ +@Data +public class PortalManagePage extends Pagination { + + @Schema(description = "平台") + private String platform; + + @Schema(description = "分类(字典)") + private String category; + + @Schema(description = "系统ID") + private String systemId; + + @Schema(description = "是否禁用") + private Integer enabledMark; + + @Schema(description = "是否禁用") + private Integer state; + + public PageDTO getPageDto(){ + return new PageDTO(getCurrentPage(), getPageSize()); + } + + public PaginationVO getPaginationVO(){ + PaginationVO paginationVO = new PaginationVO(); + paginationVO.setTotal(Long.valueOf(getTotal()).intValue()); + paginationVO.setCurrentPage(getCurrentPage()); + paginationVO.setPageSize(getPageSize()); + return paginationVO; + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/portalManage/PortalManagePageDO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/portalManage/PortalManagePageDO.java new file mode 100644 index 0000000..97aaa40 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/portalManage/PortalManagePageDO.java @@ -0,0 +1,66 @@ +package jnpf.base.model.portalManage; + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.base.entity.PortalManageEntity; +import lombok.Data; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.BeanUtils; + +import java.util.Date; + + +/** + * 类功能 + * + * @author JNPF开发平台组 YanYu + * @version v3.4.6 + * @copyrignt 引迈信息技术有限公司 + * @date 2023-02-16 + */ +@Data +public class PortalManagePageDO extends PortalManageEntity { + + @Schema(description = "门户管理ID") + private String id; + + @Schema(description = "门户名") + private String portalName; + + @Schema(description = "分类名") + private String categoryName; + + @Schema(description = "分类Id") + private String categoryId; + + @Schema(description = "创建者名") + private String createUserName; + + @Schema(description = "创建时间") + private Date creatorTime; + + @Schema(description = "创建者账号") + private String createUserAccount; + + @Schema(description = "修改者名") + private String modifyUserName; + + @Schema(description = "修改者账号") + private String modifyUserAccount; + + @Schema(description = "最后修改时间") + private Date lastModifyTime; + + public PortalManageVO convert(){ + PortalManageVO vo = new PortalManageVO(); + BeanUtils.copyProperties(this, vo); + // 创建人 + if(StringUtils.isNotEmpty(createUserName)) vo.setCreatorUser(createUserName + "/" + createUserAccount); + // 修改人 + if(StringUtils.isNotEmpty(modifyUserName)) vo.setLastModifyUser(modifyUserName + "/" + modifyUserAccount); + // 门户名称 + vo.setFullName(portalName); + vo.setCategoryName(categoryName); + return vo; + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/portalManage/PortalManagePrimary.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/portalManage/PortalManagePrimary.java new file mode 100644 index 0000000..05e632c --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/portalManage/PortalManagePrimary.java @@ -0,0 +1,47 @@ +package jnpf.base.model.portalManage; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.base.MyBatisPrimaryBase; +import jnpf.base.entity.PortalManageEntity; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 门户管理联合主键类 + * + * @author JNPF开发平台组 YanYu + * @version v3.4.8 + * @copyrignt 引迈信息技术有限公司 + * @date 2023-04-20 + */ +@Data +@Accessors(chain = true) +@AllArgsConstructor +public class PortalManagePrimary extends MyBatisPrimaryBase { + + @Schema(description = "平台") + private String platform; + + @Schema(description = "门户ID") + private String portalId; + + @Schema(description = "系统ID") + private String systemId; + + public QueryWrapper getQuery(){ + if(this.platform != null) queryWrapper.lambda().eq(PortalManageEntity::getPlatform, platform); + if(this.portalId != null) queryWrapper.lambda().eq(PortalManageEntity::getPortalId, portalId); + if(this.systemId != null) queryWrapper.lambda().eq(PortalManageEntity::getSystemId, systemId); + return queryWrapper; + } + + @Override + public PortalManageEntity getEntity() throws Exception { + PortalManageEntity entity = super.getEntity(); + entity.setSortCode(0L); + return entity; + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/portalManage/PortalManageUpForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/portalManage/PortalManageUpForm.java new file mode 100644 index 0000000..ce4f431 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/portalManage/PortalManageUpForm.java @@ -0,0 +1,54 @@ +package jnpf.base.model.portalManage; + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.base.entity.PortalManageEntity; +import lombok.Data; +import org.springframework.beans.BeanUtils; + +import javax.validation.constraints.NotNull; + +/** + * 门户管理表单更新对象 + * + * @author JNPF开发平台组 YanYu + * @version v3.4.6 + * @copyrignt 引迈信息技术有限公司 + * @date 2023-02-18 + */ +@Data +public class PortalManageUpForm { + + @Schema(description = "主键_id") + @NotNull(message = "必填") + private String id; + + @Schema(description = "说明") + private String description; + + @Schema(description = "门户_id") + @NotNull(message = "必填") + private String portalId; + + @Schema(description = "默认首页") + private Integer homePageMark; + + @Schema(description = "排序码") + @NotNull(message = "必填") + private Long sortCode; + + @Schema(description = "有效标志") + @NotNull(message = "必填") + private Integer enabledMark; + + @Schema(description = "平台") + @NotNull(message = "必填") + private String platform; + + public PortalManageEntity convertEntity(){ + PortalManageEntity portalManageEntity = new PortalManageEntity(); + BeanUtils.copyProperties(this, portalManageEntity); + portalManageEntity.setPlatform(portalManageEntity.getPlatform()); + return portalManageEntity; + } + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/portalManage/PortalManageVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/portalManage/PortalManageVO.java new file mode 100644 index 0000000..5328fe9 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/portalManage/PortalManageVO.java @@ -0,0 +1,65 @@ +package jnpf.base.model.portalManage; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +/** + * 类功能 + * + * @author JNPF开发平台组 YanYu + * @version v3.4.6 + * @copyrignt 引迈信息技术有限公司 + * @date 2023-02-16 + */ +@Data +public class PortalManageVO { + + @Schema(description = "主键_id") + private String id; + + @Schema(description = "门户_id") + private String portalId; + + @Schema(description = "分类") + private String categoryId; + + @Schema(description = "分类") + private String categoryName; + + @Schema(description = "平台") + private String platform; + + @Schema(description = "说明") + private String description; + + @Schema(description = "门户名称") + private String fullName; + + @Schema(description = "默认首页") + private Integer homePageMark; + + @Schema(description = "排序码") + private Long sortCode; + + @Schema(description = "有效标志") + private Integer enabledMark; + + @Schema(description = "创建用户") + private String creatorUser; + + @Schema(description = "创建时间") + private Date creatorTime; + + @Schema(description = "最后修改人") + private String lastModifyUser; + + @Schema(description = "最后修改时间") + private Date lastModifyTime; + + @Schema(description = "系统_id") + private String systemId; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/portalManage/PortalPagination.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/portalManage/PortalPagination.java new file mode 100644 index 0000000..c65b5c8 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/portalManage/PortalPagination.java @@ -0,0 +1,29 @@ +package jnpf.base.model.portalManage; + + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.base.Pagination; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2020-10-21 14:23:30 + */ +@Data +@Schema(description = "查询条件") +public class PortalPagination extends Pagination { + /** + * 分类 + */ + @Schema(description = "分类(字典)") + private String category; + + /** + * 类型(0-门户设计,1-配置路径) + */ + @Schema(description = "类型(0-门户设计,1-配置路径)") + private Integer type; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/print/PrintOption.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/print/PrintOption.java new file mode 100644 index 0000000..75046a3 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/print/PrintOption.java @@ -0,0 +1,12 @@ +package jnpf.base.model.print; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class PrintOption { + @Schema(description = "主键") + private String id; + @Schema(description = "名称") + private String fullName; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/printlog/PrintLogInfo.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/printlog/PrintLogInfo.java new file mode 100644 index 0000000..6fbd874 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/printlog/PrintLogInfo.java @@ -0,0 +1,23 @@ + + +package jnpf.base.model.printlog; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +@Data +public class PrintLogInfo { + @Schema(description = "主键") + private String id; + @Schema(description = "打印人") + private String printMan; + @Schema(description = "打印时间") + private Date printTime; + @Schema(description = "打印数量") + private Integer printNum; + @Schema(description = "打印标题") + private String printTitle; + @Schema(description = "打印id") + private String printId; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/printlog/PrintLogQuery.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/printlog/PrintLogQuery.java new file mode 100644 index 0000000..9121cfd --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/printlog/PrintLogQuery.java @@ -0,0 +1,15 @@ +package jnpf.base.model.printlog; + +import jnpf.base.Pagination; +import jnpf.base.entity.PrintLogEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + + +@Data +@EqualsAndHashCode(callSuper = false) +public class PrintLogQuery extends Pagination { + + private String startTime; + private String endTime; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/province/AreaModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/province/AreaModel.java new file mode 100644 index 0000000..e3fab41 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/province/AreaModel.java @@ -0,0 +1,17 @@ +package jnpf.base.model.province; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2022-01-05 + */ +@Data +public class AreaModel implements Serializable { + private List> idsList; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/province/AtlasFeaturesModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/province/AtlasFeaturesModel.java new file mode 100644 index 0000000..0f5f8d0 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/province/AtlasFeaturesModel.java @@ -0,0 +1,10 @@ +package jnpf.base.model.province; + +import lombok.Data; + +@Data +public class AtlasFeaturesModel { + private String type; + private AtlasPropModel properties; + private Object geometry; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/province/AtlasJsonModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/province/AtlasJsonModel.java new file mode 100644 index 0000000..8c6fc3c --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/province/AtlasJsonModel.java @@ -0,0 +1,20 @@ +package jnpf.base.model.province; + +import lombok.Data; + +import java.util.List; + +/** + * 流程设计 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2023/2/1 9:48:02 + */ +@Data +public class AtlasJsonModel { + private String type; + private List features; +} + diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/province/AtlasPropModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/province/AtlasPropModel.java new file mode 100644 index 0000000..d8ab11c --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/province/AtlasPropModel.java @@ -0,0 +1,18 @@ +package jnpf.base.model.province; + +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +@Data +public class AtlasPropModel { + private Integer adcode; + private String name; + private List center; + private List centroid; + private Integer childrenNum; + private String level; + private List acroutes; + private Object parent; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/province/ProvinceCrForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/province/ProvinceCrForm.java new file mode 100644 index 0000000..6a683cf --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/province/ProvinceCrForm.java @@ -0,0 +1,39 @@ +package jnpf.base.model.province; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.hibernate.validator.constraints.NotBlank; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class ProvinceCrForm { + @Schema(description = "编码") + @org.hibernate.validator.constraints.NotBlank(message = "必填") + private String enCode; + + @Schema(description = "有效标志") + private Integer enabledMark; + + @Schema(description = "名称") + @org.hibernate.validator.constraints.NotBlank(message = "必填") + private String fullName; + + @Schema(description = "说明") + private String description; + + @Schema(description = "上级id") + @NotBlank(message = "必填") + private String parentId; + + @Schema(description = "分类") + private String type; + + @Schema(description = "排序码") + private long sortCode; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/province/ProvinceInfoVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/province/ProvinceInfoVO.java new file mode 100644 index 0000000..46a8064 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/province/ProvinceInfoVO.java @@ -0,0 +1,40 @@ +package jnpf.base.model.province; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class ProvinceInfoVO { + + @Schema(description = "主键") + private String id; + + @Schema(description = "名称") + private String fullName; + + @Schema(description = "编码") + private String enCode; + + @Schema(description = "有效标志") + private Integer enabledMark; + + @Schema(description = "说明") + private String description; + + @Schema(description = "分类") + private String type; + + @Schema(description = "上级id") + private String parentId; + @Schema(description = "上级名称") + private String parentName; + @Schema(description = "排序码") + private long sortCode; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/province/ProvinceListTreeVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/province/ProvinceListTreeVO.java new file mode 100644 index 0000000..be33733 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/province/ProvinceListTreeVO.java @@ -0,0 +1,32 @@ +package jnpf.base.model.province; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +@Data +public class ProvinceListTreeVO { + @Schema(description = "子集集合") + List children; + @Schema(description = "主键") + private String id; + @Schema(description = "名称") + private String fullName; + @Schema(description = "编码") + private String enCode; + @Schema(description = "上级id") + private String parentId; + @Schema(description = "有效标志") + private Integer enabledMark; + @Schema(description = "是否有子集相反") + private Boolean isLeaf; + @Schema(description = "是否有子集") + private Boolean hasChildren; + @Schema(description = "排序码") + private long sortCode; + private String atlasCenter; + private BigDecimal centerLong; + private BigDecimal centerLat; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/province/ProvinceListVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/province/ProvinceListVO.java new file mode 100644 index 0000000..ec115a9 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/province/ProvinceListVO.java @@ -0,0 +1,33 @@ +package jnpf.base.model.province; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class ProvinceListVO { + @Schema(description = "主键") + private String id; + + @Schema(description = "名称") + private String fullName; + + @Schema(description = "编码") + private String enCode; + + @Schema(description = "有效标志") + private Integer enabledMark; + @Schema(description = "是否有子集") + private Boolean hasChildren; + + @Schema(description = "是否有子集取反") + private Boolean isLeaf; + @Schema(description = "排序码") + private long sortCode; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/province/ProvinceSelectListVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/province/ProvinceSelectListVO.java new file mode 100644 index 0000000..e842daf --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/province/ProvinceSelectListVO.java @@ -0,0 +1,23 @@ +package jnpf.base.model.province; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class ProvinceSelectListVO { + @Schema(description = "主键") + private String id; + + @Schema(description = "名称") + private String fullName; + + @Schema(description = "是否显示下级可点击按钮") + private Boolean isLeaf; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/province/ProvinceUpForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/province/ProvinceUpForm.java new file mode 100644 index 0000000..42e078b --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/province/ProvinceUpForm.java @@ -0,0 +1,15 @@ +package jnpf.base.model.province; + +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class ProvinceUpForm extends ProvinceCrForm { + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/query/PrintDevDataQuery.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/query/PrintDevDataQuery.java new file mode 100644 index 0000000..9a72898 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/query/PrintDevDataQuery.java @@ -0,0 +1,38 @@ +package jnpf.base.model.query; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.util.List; + +/** + * 打印模板-数查询对象 + * + * @author JNPF开发平台组 YY + * @version V3.2.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月30日 + */ +@Data +public class PrintDevDataQuery { + + /** + * 打印模板id + */ + @NotBlank(message = "必填") + @Schema(description = "打印模板id") + private String id; + + /** + * 表单id + */ + @NotBlank(message = "必填") + @Schema(description = "表单id") + private String formId; + + @NotBlank(message = "必填") + @Schema(description = "打印模板id") + private List ids; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/query/PrintDevFieldsQuery.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/query/PrintDevFieldsQuery.java new file mode 100644 index 0000000..ae886ca --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/query/PrintDevFieldsQuery.java @@ -0,0 +1,33 @@ +package jnpf.base.model.query; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * 打印模板-数查询对象 + * + * @author JNPF开发平台组 YY + * @version V3.2.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月30日 + */ +@Data +public class PrintDevFieldsQuery { + + /** + * sql语句 + */ + @NotBlank(message = "必填") + @Schema(description = "sql语句") + private String sqlTemplate; + + /** + * 连接id + */ + @NotBlank(message = "必填") + @Schema(description = "连接id") + private String dbLinkId; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/resource/ResourceModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/resource/ResourceModel.java new file mode 100644 index 0000000..5ac2c30 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/resource/ResourceModel.java @@ -0,0 +1,21 @@ +package jnpf.base.model.resource; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * 资源 + */ +@Data +public class ResourceModel implements Serializable { + private String id; + private String fullName; + private String enCode; + private String conditionJson; + private String conditionText; + private Integer allData; + private String moduleId; + private String matchLogic; + private String objectId; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/schedule/ScheduleDetailModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/schedule/ScheduleDetailModel.java new file mode 100644 index 0000000..cbba1b1 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/schedule/ScheduleDetailModel.java @@ -0,0 +1,15 @@ +package jnpf.base.model.schedule; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class ScheduleDetailModel { + @Schema(description ="分组主键") + private String groupId; + @Schema(description ="主键") + private String id; + @Schema(description = "类型") + private String type; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/schedule/ScheduleJobModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/schedule/ScheduleJobModel.java new file mode 100644 index 0000000..b3c5322 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/schedule/ScheduleJobModel.java @@ -0,0 +1,16 @@ +package jnpf.base.model.schedule; + +import jnpf.base.UserInfo; +import lombok.Data; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Data +public class ScheduleJobModel { + private UserInfo userInfo = new UserInfo(); + private Date scheduleTime = new Date(); + private List userList = new ArrayList<>(); + private String id; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/schedule/ScheduleNewAppListVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/schedule/ScheduleNewAppListVO.java new file mode 100644 index 0000000..f57822b --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/schedule/ScheduleNewAppListVO.java @@ -0,0 +1,19 @@ +package jnpf.base.model.schedule; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Data +public class ScheduleNewAppListVO { + + @Schema(description ="app数量") + private Map signList= new HashMap<>(); + @Schema(description ="当天内容") + private List todayList= new ArrayList<>(); +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/schedule/ScheduleNewCrForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/schedule/ScheduleNewCrForm.java new file mode 100644 index 0000000..df46552 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/schedule/ScheduleNewCrForm.java @@ -0,0 +1,49 @@ +package jnpf.base.model.schedule; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author JNPF开发平台组 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + */ +@Data +public class ScheduleNewCrForm { + + private String category; + + private String urgent = "1"; + + private String title; + + private String content; + + private Integer allDay = 1; + + private Long startDay = System.currentTimeMillis(); + + private String startTime = "00:00"; + + private Long endDay = System.currentTimeMillis(); + + private String endTime = "23:59"; + + private Integer duration = -1; + + private List toUserIds = new ArrayList<>(); + + private String color; + + private Integer reminderTime = -2; + + private Integer reminderType = 1; + + private String send; + + private String sendName; + + private Integer repetition = 1; + + private Long repeatTime; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/schedule/ScheduleNewDetailInfoVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/schedule/ScheduleNewDetailInfoVO.java new file mode 100644 index 0000000..d249b1d --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/schedule/ScheduleNewDetailInfoVO.java @@ -0,0 +1,18 @@ +package jnpf.base.model.schedule; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + + +/** + * @author JNPF开发平台组 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + */ +@Data +public class ScheduleNewDetailInfoVO extends ScheduleNewListVO { + + @Schema(description ="参与人") + private String toUserIds; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/schedule/ScheduleNewInfoVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/schedule/ScheduleNewInfoVO.java new file mode 100644 index 0000000..21a1aa4 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/schedule/ScheduleNewInfoVO.java @@ -0,0 +1,19 @@ +package jnpf.base.model.schedule; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * @author JNPF开发平台组 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + */ +@Data +public class ScheduleNewInfoVO extends ScheduleNewListVO { + + @Schema(description ="参与人") + private List toUserIds; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/schedule/ScheduleNewListVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/schedule/ScheduleNewListVO.java new file mode 100644 index 0000000..f41774a --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/schedule/ScheduleNewListVO.java @@ -0,0 +1,70 @@ +package jnpf.base.model.schedule; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * @author JNPF开发平台组 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + */ +@Data +public class ScheduleNewListVO { + @Schema(description ="主键") + private String id; + + @Schema(description ="工作类型") + private String category; + + @Schema(description ="紧急程度") + private String urgent; + + @Schema(description ="标题") + private String title; + + @Schema(description ="内容") + private String content; + + @Schema(description ="是否全天") + private Integer allDay; + + @Schema(description ="开始时间") + private Long startDay; + + @Schema(description ="开始时间") + private String startTime; + + @Schema(description ="结束时间") + private Long endDay; + + @Schema(description ="结束时间") + private String endTime; + + @Schema(description ="时长") + private Integer duration; + + @Schema(description ="颜色") + private String color; + + @Schema(description ="提醒时间") + private Integer reminderTime; + + @Schema(description ="提醒方式") + private Integer reminderType; + + @Schema(description ="发送配置") + private String send; + + @Schema(description ="发送名称") + private String sendName; + + @Schema(description ="重复提醒") + private Integer repetition; + + @Schema(description ="结束重复") + private Long repeatTime; + + @Schema(description ="创建人") + private String creatorUserId; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/schedule/ScheduleNewTime.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/schedule/ScheduleNewTime.java new file mode 100644 index 0000000..46bc1d2 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/schedule/ScheduleNewTime.java @@ -0,0 +1,15 @@ +package jnpf.base.model.schedule; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class ScheduleNewTime { + @Schema(description = "开始时间") + private String startTime; + @Schema(description = "结束时间") + private String endTime; + @Schema(description = "当前时间") + private String dateTime; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/schedule/ScheduleNewUpForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/schedule/ScheduleNewUpForm.java new file mode 100644 index 0000000..9a82617 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/schedule/ScheduleNewUpForm.java @@ -0,0 +1,6 @@ +package jnpf.base.model.schedule; +import lombok.Data; + +@Data +public class ScheduleNewUpForm extends ScheduleNewCrForm { +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/sign/SignForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/sign/SignForm.java new file mode 100644 index 0000000..3edd2a3 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/sign/SignForm.java @@ -0,0 +1,25 @@ +package jnpf.base.model.sign; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.util.Date; + +/** + * 个人签名 + * + * @author JNPF开发平台组 + * @copyright 引迈信息技术有限公司 + * @date 2022年9月2日 上午9:18 + */ +@Data +public class SignForm { + + @Schema(description = "签名图片") + private String signImg; + @Schema(description = "状态") + private Integer isDefault; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/sign/SignListVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/sign/SignListVO.java new file mode 100644 index 0000000..23f35de --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/sign/SignListVO.java @@ -0,0 +1,24 @@ +package jnpf.base.model.sign; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +/** + * 个人签名 + * + * @author JNPF开发平台组 + * @copyright 引迈信息技术有限公司 + * @date 2022年9月2日 上午9:18 + */ +@Data +public class SignListVO { + @Schema(description = "id") + private String id; + @Schema(description = "签名图片") + private String signImg; + @Schema(description = "是否默认") + private Integer isDefault; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/smstemplate/SmsTemplateCrForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/smstemplate/SmsTemplateCrForm.java new file mode 100644 index 0000000..23ea639 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/smstemplate/SmsTemplateCrForm.java @@ -0,0 +1,47 @@ +package jnpf.base.model.smstemplate; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.Map; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-12-09 + */ +@Data +public class SmsTemplateCrForm implements Serializable { + @NotBlank(message = "模板编号不能为空") + private String templateId; + @NotBlank(message = "模板名称不能为空") + private String fullName; + @NotNull(message = "短信厂家不能为空") + private Integer company; + private String appId; + @NotBlank(message = "签名内容不能为空") + private String signContent; + private Integer enabledMark; + /** + * 测试短信接收人 + */ + private String phoneNumbers; + + private Map parameters; + + @NotBlank(message = "模板编码不能为空") + private String enCode; + + /** + * Endpoint + */ + private String endpoint; + + /** + * region + */ + private String region; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/smstemplate/SmsTemplateListVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/smstemplate/SmsTemplateListVO.java new file mode 100644 index 0000000..ee315a8 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/smstemplate/SmsTemplateListVO.java @@ -0,0 +1,24 @@ +package jnpf.base.model.smstemplate; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 短信列表模型 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-12-09 + */ +@Data +public class SmsTemplateListVO implements Serializable { + private String id; + private String company; + private Integer enabledMark; + private String fullName; + private String enCode; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/smstemplate/SmsTemplateSelector.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/smstemplate/SmsTemplateSelector.java new file mode 100644 index 0000000..1a9c9ec --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/smstemplate/SmsTemplateSelector.java @@ -0,0 +1,19 @@ +package jnpf.base.model.smstemplate; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-12-11 + */ +@Data +public class SmsTemplateSelector implements Serializable { + private String id; + private String fullName; + private String enCode; + private String company; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/smstemplate/SmsTemplateUpForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/smstemplate/SmsTemplateUpForm.java new file mode 100644 index 0000000..89ace2b --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/smstemplate/SmsTemplateUpForm.java @@ -0,0 +1,16 @@ +package jnpf.base.model.smstemplate; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-12-09 + */ +@Data +public class SmsTemplateUpForm extends SmsTemplateCrForm implements Serializable { + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/smstemplate/SmsTemplateVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/smstemplate/SmsTemplateVO.java new file mode 100644 index 0000000..fac0642 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/smstemplate/SmsTemplateVO.java @@ -0,0 +1,27 @@ +package jnpf.base.model.smstemplate; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 回显短信模板 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-12-09 + */ +@Data +public class SmsTemplateVO implements Serializable { + private String id; + private String templateId; + private Integer company; + private String signContent; + private Integer enabledMark; + private String fullName; + + private String enCode; + private String endpoint; + private String region; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/systemconfig/EmailTestForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/systemconfig/EmailTestForm.java new file mode 100644 index 0000000..eab0f40 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/systemconfig/EmailTestForm.java @@ -0,0 +1,36 @@ +package jnpf.base.model.systemconfig; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import javax.validation.constraints.NotBlank; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class EmailTestForm { + @NotBlank(message = "必填") + @Schema(description = "邮箱地址") + private String account; + @NotBlank(message = "必填") + @Schema(description = "邮箱密码") + private String password; + @NotBlank(message = "必填") + @Schema(description = "POP3服务") + private String pop3Host; + @NotBlank(message = "必填") + @Schema(description = "POP3端口") + private Integer pop3Port; + @NotBlank(message = "必填") + @Schema(description = "SMTP服务") + private String smtpHost; + @NotBlank(message = "必填") + @Schema(description = "SMTP端口") + private Integer smtpPort; + @Schema(description = "ssl登录") + private String ssl ; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/systemconfig/SaveSysConfigForm.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/systemconfig/SaveSysConfigForm.java new file mode 100644 index 0000000..2faa7cd --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/systemconfig/SaveSysConfigForm.java @@ -0,0 +1,17 @@ +package jnpf.base.model.systemconfig; + +import lombok.Data; + +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class SaveSysConfigForm { + List configList; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/systemconfig/SmsModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/systemconfig/SmsModel.java new file mode 100644 index 0000000..4123562 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/systemconfig/SmsModel.java @@ -0,0 +1,29 @@ +package jnpf.base.model.systemconfig; + +import lombok.Data; + +/** + * 发送短信配置模型 + * + * @版本: V3.1.0 + * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @作者: JNPF开发平台组 + * @日期: 2021/4/20 14:22 + */ +@Data +public class SmsModel { + /** + * 阿里 + */ + private String aliAccessKey; + private String aliSecret; + + /** + * 腾讯 + */ + private String tencentSecretId; + private String tencentSecretKey; + private String tencentAppId; + private String tencentAppKey; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/systemconfig/SysConfigListVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/systemconfig/SysConfigListVO.java new file mode 100644 index 0000000..d5e9ae5 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/systemconfig/SysConfigListVO.java @@ -0,0 +1,17 @@ +package jnpf.base.model.systemconfig; + +import lombok.Data; + +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class SysConfigListVO { + List list; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/systemconfig/SysConfigModel.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/systemconfig/SysConfigModel.java new file mode 100644 index 0000000..aba9f42 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/systemconfig/SysConfigModel.java @@ -0,0 +1,272 @@ +package jnpf.base.model.systemconfig; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/12 15:31 + */ +@Data +public class SysConfigModel { + @NotBlank(message = "必填") + @Schema(description = "系统名称") + private String sysName; + @NotBlank(message = "必填") + @Schema(description = "系统描述") + private String sysDescription; + @NotBlank(message = "必填") + @Schema(description = "系统版本") + private String sysVersion; + @NotBlank(message = "必填") + @Schema(description = "版权信息") + private String copyright; + @NotBlank(message = "必填") + @Schema(description = "公司名称") + private String companyName; + @NotBlank(message = "必填") + @Schema(description = "公司简称") + private String companyCode; + @NotBlank(message = "必填") + @Schema(description = "公司地址") + private String companyAddress; + @NotBlank(message = "必填") + @Schema(description = "公司法人") + private String companyContacts; + @NotBlank(message = "必填") + @Schema(description = "公司电话") + private String companyTelePhone; + @NotBlank(message = "必填") + @Schema(description = "公司邮箱") + private String companyEmail; + + /** + * 登录图标 + */ + @Schema(description = "登录图标") + private String loginIcon; + + /** + * 导航图标 + */ + @Schema(description = "导航图标") + private String navigationIcon; + /** + * logo图标 + */ + @Schema(description = "logo图标") + private String logoIcon; + /** + * App图标 + */ + @Schema(description = "App图标") + private String appIcon; + + /** + * 1--后登陆踢出先登录 + * 2--同时登陆 + */ + @NotBlank(message = "必填") + @Schema(description = "单一登录方式") + private Integer singleLogin; + /** + * 密码错误次数 + */ + @Schema(description = "密码错误次数") + @NotNull(message = "必填") + private Integer passwordErrorsNumber; + /** + * 错误策略 1--账号锁定 2--延时登录 + */ + @Schema(description = "错误策略") + private Integer lockType; + /** + * 延时登录时间 + */ + @Schema(description = "延时登录时间") + private Integer lockTime; + /** + * 是否开启验证码 + */ + @Schema(description = "是否开启验证码") + private Integer enableVerificationCode; + /** + * 验证码位数 + */ + @Schema(description = "验证码位数") + private Integer verificationCodeNumber; + + + @NotBlank(message = "必填") + @Schema(description = "超出登出") + private String tokenTimeout; + @NotBlank(message = "必填") + @Schema(description = "是否开启上次登录提醒") + private Integer lastLoginTimeSwitch; + @NotBlank(message = "必填") + @Schema(description = "是否开启白名单验证") + private Integer whitelistSwitch; + @NotBlank(message = "必填") + @Schema(description = "白名单") + private String whiteListIp; + @NotBlank(message = "必填") + @Schema(description = "POP3服务主机地址") + private String emailPop3Host; + @NotBlank(message = "必填") + @Schema(description = "POP3服务端口") + private String emailPop3Port; + @NotBlank(message = "必填") + @Schema(description = "SMTP服务主机地址") + private String emailSmtpHost; + @NotBlank(message = "必填") + @Schema(description = "邮件显示名称") + private String emailSmtpPort; + @NotBlank(message = "必填") + @Schema(description = "系统名称") + private String emailSenderName; + @NotBlank(message = "必填") + @Schema(description = "邮箱账户") + private String emailAccount; + @NotBlank(message = "必填") + @Schema(description = "邮箱密码") + private String emailPassword; + @NotBlank(message = "必填") + @Schema(description = "是否开启SSL服务登录") + private Integer emailSsl; + + + @NotBlank(message = "必填") + @Schema(description = "授权密钥") + private String registerKey; + private String lastLoginTime; + private String pageSize; + private String sysTheme; + private String isLog; + + // 短信配置 + /** + * 阿里 + */ + private String aliAccessKey; + private String aliSecret; + + /** + * 腾讯 + */ + private String tencentSecretId; + private String tencentSecretKey; + private String tencentAppId; + private String tencentAppKey; + // End 短信配置 + + /** + * 企业微信配置 + */ + /** 发消息 */ + private String qyhCorpId; + private String qyhAgentId; + private String qyhAgentSecret; + /** 同步消息 */ + private String qyhCorpSecret; + private Integer qyhIsSynOrg; + private Integer qyhIsSynUser; + + /** + * 钉钉 发消息 + */ + private String dingSynAppKey; + private String dingSynAppSecret; + private String dingAgentId; + private Integer dingSynIsSynOrg; + private Integer dingSynIsSynUser; + + /** + * 审批链接时效性 + */ + private String linkTime; + + /** + * 链接点击次数 + */ + private Integer isClick; + + /** + * 链接失效次数 + */ + private Integer unClickNum; + + /** 密码策略 */ + /** + * 密码定期更新开关 + */ + private Integer passwordIsUpdatedRegularly; + + /** + * 更新周期 + */ + private Integer updateCycle; + + /** + * 提前N天提醒更新 + */ + private Integer updateInAdvance; + + /** + * 密码强度限制开关 + */ + private Integer passwordStrengthLimit; + + /** + * 最小长度开关 + */ + private Integer passwordLengthMin; + + /** + * 密码最小长度限制 + */ + private Integer passwordLengthMinNumber; + + /** + * 是否包含数字 + */ + private Integer containsNumbers; + + /** + * 是否包含小写字母 + */ + private Integer includeLowercaseLetters; + + /** + * 是否包含大写字母 + */ + private Integer includeUppercaseLetters; + + /** + * 是否包含字符 + */ + private Integer containsCharacters; + + /** + * 是否禁用旧密码开关 + */ + private Integer disableOldPassword; + + /** + * 禁用旧密码个数 + */ + private Integer disableTheNumberOfOldPasswords; + + /** + * 初始密码强制修改开关 + */ + private Integer mandatoryModificationOfInitialPassword; + + @Schema(description = "窗口标题") + private String title; + +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/vo/PrintDevListVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/vo/PrintDevListVO.java new file mode 100644 index 0000000..af3a146 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/vo/PrintDevListVO.java @@ -0,0 +1,35 @@ +package jnpf.base.model.vo; + +import lombok.Data; + +/** + * 分页列表 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-11-20 + */ +@Data +public class PrintDevListVO { + + private String id; + + private String fullName; + + private String enCode; + + private Integer enabledMark; + + private String creatorUser; + + private Long creatorTime; + + private String lastModifyUser; + + private Long lastModifyTime; + + private Long sortCode; + + private String category; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/vo/PrintDevVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/vo/PrintDevVO.java new file mode 100644 index 0000000..fa58d76 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/vo/PrintDevVO.java @@ -0,0 +1,124 @@ +package jnpf.base.model.vo; + +import jnpf.base.model.PrintDevTreeModel; +import lombok.Data; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * 打印模板数视图对象 + * + * @author JNPF开发平台组 YY + * @version V3.2.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月30日 + */ +@Data +public class PrintDevVO { + + /** + * 分类下模板数量 + */ + private Integer num; + + /** + * 主键_id + */ + private String id; + + /** + * 名称 + */ + private String fullName; + + /** + * 编码 + */ + private String encode; + + /** + * 分类 + */ + private String category; + + /** + * 类型 + */ + private Integer type; + + /** + * 描述 + */ + private String description; + + /** + * 排序码 + */ + private Integer sortCode; + + /** + * 有效标志 + */ + private Integer enabledMark; + + /** + * 创建时间 + */ + private LocalDateTime creatorTime; + + /** + * 创建用户_id + */ + private String creatorUserId; + + /** + * 修改时间 + */ + private LocalDateTime lastModifyTime; + + /** + * 修改用户_id + */ + private String lastModifyUserId; + + /** + * 删除标志 + */ + private Integer deleteMark; + + /** + * 删除时间 + */ + private LocalDateTime deleteTime; + + /** + * 删除用户_id + */ + private String deleteUserId; + + /** + * 连接数据 _id + */ + private String dbLinkId; + + /** + * sql语句 + */ + private String sqlTemplate; + + /** + * 左侧字段 + */ + private String leftFields; + + /** + * 打印模板 + */ + private String printTemplate; + + /** + * 子节点 + */ + private List children; +} diff --git a/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/vo/PrintLogVO.java b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/vo/PrintLogVO.java new file mode 100644 index 0000000..bdb3be7 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/jnpf-system-entity/src/main/java/jnpf/base/model/vo/PrintLogVO.java @@ -0,0 +1,30 @@ +package jnpf.base.model.vo; + +import lombok.Data; + +@Data +public class PrintLogVO { + + /** + * 打印人 + */ + private String printMan; + /** + * 打印时间 + */ +// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", locale = "zh") + private long printTime; + /** + * 打印条数 + */ + private Integer printNum; + /** + * 打印功能名称 + */ + private String printTitle; + + /** + * 基于哪一个模板 + */ + private String printId; +} diff --git a/jnpf-java-boot/jnpf-system/pom.xml b/jnpf-java-boot/jnpf-system/pom.xml new file mode 100644 index 0000000..34d5f73 --- /dev/null +++ b/jnpf-java-boot/jnpf-system/pom.xml @@ -0,0 +1,20 @@ + + + + jnpf-java-boot + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-system + pom + + jnpf-system-entity + jnpf-system-biz + jnpf-system-controller + + + diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/pom.xml b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/pom.xml new file mode 100644 index 0000000..1e5e93e --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/pom.xml @@ -0,0 +1,27 @@ + + + + jnpf-visualdata + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-visualdata-biz + + + + com.jnpf + jnpf-visualdata-entity + ${project.version} + + + + com.squareup.okhttp3 + okhttp + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/mapper/VisualCategoryMapper.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/mapper/VisualCategoryMapper.java new file mode 100644 index 0000000..e7c04bc --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/mapper/VisualCategoryMapper.java @@ -0,0 +1,16 @@ +package jnpf.visualdata.mapper; + +import jnpf.base.mapper.SuperMapper; +import jnpf.visualdata.entity.VisualCategoryEntity; + +/** + * 大屏分类 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +public interface VisualCategoryMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/mapper/VisualComponentMapper.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/mapper/VisualComponentMapper.java new file mode 100644 index 0000000..14e7337 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/mapper/VisualComponentMapper.java @@ -0,0 +1,16 @@ +package jnpf.visualdata.mapper; + +import jnpf.base.mapper.SuperMapper; +import jnpf.visualdata.entity.VisualComponentEntity; + +/** + * 大屏组件库 + * + * @author JNPF开发平台组 + * @version V3.5.0 + * @copyright 引迈信息技术有限公司 + * @date 2023年7月7日 + */ +public interface VisualComponentMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/mapper/VisualConfigMapper.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/mapper/VisualConfigMapper.java new file mode 100644 index 0000000..0620374 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/mapper/VisualConfigMapper.java @@ -0,0 +1,16 @@ +package jnpf.visualdata.mapper; + +import jnpf.base.mapper.SuperMapper; +import jnpf.visualdata.entity.VisualConfigEntity; + +/** + * 大屏基本配置 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +public interface VisualConfigMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/mapper/VisualDbMapper.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/mapper/VisualDbMapper.java new file mode 100644 index 0000000..b5ba83e --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/mapper/VisualDbMapper.java @@ -0,0 +1,16 @@ +package jnpf.visualdata.mapper; + +import jnpf.base.mapper.SuperMapper; +import jnpf.visualdata.entity.VisualDbEntity; + +/** + * 大屏数据源配置 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +public interface VisualDbMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/mapper/VisualMapMapper.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/mapper/VisualMapMapper.java new file mode 100644 index 0000000..780b2c4 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/mapper/VisualMapMapper.java @@ -0,0 +1,16 @@ +package jnpf.visualdata.mapper; + +import jnpf.base.mapper.SuperMapper; +import jnpf.visualdata.entity.VisualMapEntity; + +/** + * 大屏地图配置 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +public interface VisualMapMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/mapper/VisualMapper.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/mapper/VisualMapper.java new file mode 100644 index 0000000..a3653f4 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/mapper/VisualMapper.java @@ -0,0 +1,16 @@ +package jnpf.visualdata.mapper; + +import jnpf.base.mapper.SuperMapper; +import jnpf.visualdata.entity.VisualEntity; + +/** + * 大屏基本信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +public interface VisualMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/mapper/VisualRecordMapper.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/mapper/VisualRecordMapper.java new file mode 100644 index 0000000..957727e --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/mapper/VisualRecordMapper.java @@ -0,0 +1,16 @@ +package jnpf.visualdata.mapper; + +import jnpf.base.mapper.SuperMapper; +import jnpf.visualdata.entity.VisualRecordEntity; + +/** + * 大屏数据集 + * + * @author JNPF开发平台组 + * @version V3.5.0 + * @copyright 引迈信息技术有限公司 + * @date 2023年7月7日 + */ +public interface VisualRecordMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/VisualCategoryService.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/VisualCategoryService.java new file mode 100644 index 0000000..f612bd6 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/VisualCategoryService.java @@ -0,0 +1,73 @@ +package jnpf.visualdata.service; + +import jnpf.base.service.SuperService; +import jnpf.visualdata.entity.VisualCategoryEntity; +import jnpf.visualdata.model.VisualPagination; + +import java.util.List; + +/** + * 大屏 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +public interface VisualCategoryService extends SuperService { + + /** + * 列表 + * + * @param pagination 条件 + * @return 大屏分类列表(分页) + */ + List getList(VisualPagination pagination); + + /** + * 列表 + * + * @return 大屏分类列表 + */ + List getList(); + + /** + * 验证值 + * + * @param value 名称 + * @param id 主键值 + * @return ignore + */ + boolean isExistByValue(String value, String id); + + /** + * 信息 + * + * @param id 主键值 + * @return ignore + */ + VisualCategoryEntity getInfo(String id); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(VisualCategoryEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return ignore + */ + boolean update(String id, VisualCategoryEntity entity); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(VisualCategoryEntity entity); +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/VisualComponentService.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/VisualComponentService.java new file mode 100644 index 0000000..f79522c --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/VisualComponentService.java @@ -0,0 +1,64 @@ +package jnpf.visualdata.service; + +import jnpf.base.service.SuperService; +import jnpf.visualdata.entity.VisualComponentEntity; +import jnpf.visualdata.model.visualcomponent.VisualComponentPaginationModel; + +import java.util.List; + +/** + * 大屏组件库 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +public interface VisualComponentService extends SuperService { + + /** + * 列表 + * + * @param pagination 条件 + * @return + */ + List getList(VisualComponentPaginationModel pagination); + + /** + * 列表 + * + * @return + */ + List getList(); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + VisualComponentEntity getInfo(String id); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(VisualComponentEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return + */ + boolean update(String id, VisualComponentEntity entity); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(VisualComponentEntity entity); +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/VisualConfigService.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/VisualConfigService.java new file mode 100644 index 0000000..2149bcd --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/VisualConfigService.java @@ -0,0 +1,55 @@ +package jnpf.visualdata.service; + +import jnpf.base.service.SuperService; +import jnpf.visualdata.entity.VisualConfigEntity; + +import java.util.List; + +/** + * 大屏基本配置 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +public interface VisualConfigService extends SuperService { + + /** + * 信息 + * + * @return + */ + List getList(); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + VisualConfigEntity getInfo(String id); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(VisualConfigEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return + */ + boolean update(String id, VisualConfigEntity entity); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(VisualConfigEntity entity); +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/VisualDbService.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/VisualDbService.java new file mode 100644 index 0000000..5816ff9 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/VisualDbService.java @@ -0,0 +1,82 @@ +package jnpf.visualdata.service; + +import jnpf.base.service.SuperService; +import jnpf.visualdata.entity.VisualDbEntity; +import jnpf.visualdata.model.VisualPagination; + +import java.util.List; +import java.util.Map; + +/** + * 大屏数据源配置 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +public interface VisualDbService extends SuperService { + + /** + * 列表 + * + * @param pagination 条件 + * @return + */ + List getList(VisualPagination pagination); + + /** + * 列表 + * + * @return + */ + List getList(); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + VisualDbEntity getInfo(String id); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(VisualDbEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return + */ + boolean update(String id, VisualDbEntity entity); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(VisualDbEntity entity); + + /** + * 测试连接 + * + * @param entity 实体对象 + * @return + */ + boolean dbTest(VisualDbEntity entity); + + /** + * 执行sql + * + * @param entity 实体对象 + * @param sql sql + * @return + */ + List> query(VisualDbEntity entity, String sql); +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/VisualMapService.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/VisualMapService.java new file mode 100644 index 0000000..e679246 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/VisualMapService.java @@ -0,0 +1,66 @@ +package jnpf.visualdata.service; + +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; +import jnpf.base.service.SuperService; +import jnpf.visualdata.entity.VisualMapEntity; +import jnpf.visualdata.model.VisualPagination; + +import java.util.List; + +/** + * 大屏地图配置 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +public interface VisualMapService extends SuperService { + + /** + * 列表 + * + * @param pagination 条件 + * @return + */ + List getList(VisualPagination pagination); + + /** + * 列表 + * @param pagination 条件 + * @param columns 筛选字段 + * @return + */ + List getListWithColnums(VisualPagination pagination, SFunction... columns); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + VisualMapEntity getInfo(String id); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(VisualMapEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return + */ + boolean update(String id, VisualMapEntity entity); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(VisualMapEntity entity); +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/VisualRecordService.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/VisualRecordService.java new file mode 100644 index 0000000..752bcc1 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/VisualRecordService.java @@ -0,0 +1,64 @@ +package jnpf.visualdata.service; + +import jnpf.base.service.SuperService; +import jnpf.visualdata.entity.VisualRecordEntity; +import jnpf.visualdata.model.VisualPagination; + +import java.util.List; + +/** + * 大屏数据集 + * + * @author JNPF开发平台组 + * @version V3.5.0 + * @copyright 引迈信息技术有限公司 + * @date 2023年7月7日 + */ +public interface VisualRecordService extends SuperService { + + /** + * 列表 + * + * @param pagination 条件 + * @return + */ + List getList(VisualPagination pagination); + + /** + * 列表 + * + * @return + */ + List getList(); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + VisualRecordEntity getInfo(String id); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(VisualRecordEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return + */ + boolean update(String id, VisualRecordEntity entity); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(VisualRecordEntity entity); +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/VisualService.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/VisualService.java new file mode 100644 index 0000000..6f9c40d --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/VisualService.java @@ -0,0 +1,79 @@ +package jnpf.visualdata.service; + +import jnpf.base.service.SuperService; +import jnpf.exception.DataException; +import jnpf.visualdata.entity.VisualConfigEntity; +import jnpf.visualdata.entity.VisualEntity; +import jnpf.visualdata.model.visual.VisualPaginationModel; + +import java.util.List; + +/** + * 大屏基本信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +public interface VisualService extends SuperService { + + /** + * 列表 + * + * @param pagination 条件 + * @return + */ + List getList(VisualPaginationModel pagination); + + /** + * 列表 + * + * @return + */ + List getList(); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + VisualEntity getInfo(String id); + + /** + * 创建 + * + * @param entity 实体对象 + * @param configEntity 配置属性 + */ + void create(VisualEntity entity, VisualConfigEntity configEntity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @param configEntity 配置属性 + * @return + */ + boolean update(String id, VisualEntity entity, VisualConfigEntity configEntity); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(VisualEntity entity); + + /** + * 创建 + * + * @param entity 实体对象 + * @param configEntity 配置属性 + * @throws DataException + */ + void createImport(VisualEntity entity, VisualConfigEntity configEntity) throws DataException; + + +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/impl/VisualCategoryServiceImpl.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/impl/VisualCategoryServiceImpl.java new file mode 100644 index 0000000..d11c60e --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/impl/VisualCategoryServiceImpl.java @@ -0,0 +1,78 @@ +package jnpf.visualdata.service.impl; + +import com.alibaba.druid.util.StringUtils; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import jnpf.base.service.SuperServiceImpl; +import jnpf.util.RandomUtil; +import jnpf.visualdata.entity.VisualCategoryEntity; +import jnpf.visualdata.mapper.VisualCategoryMapper; +import jnpf.visualdata.model.VisualPagination; +import jnpf.visualdata.service.VisualCategoryService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 大屏分类 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@Service +public class VisualCategoryServiceImpl extends SuperServiceImpl implements VisualCategoryService { + + @Override + public List getList(VisualPagination pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().orderByAsc(VisualCategoryEntity::getCategorykey); + Page page = new Page(pagination.getCurrent(), pagination.getSize()); + IPage iPages = this.page(page, queryWrapper); + return pagination.setData(iPages); + } + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + return this.list(queryWrapper); + } + + @Override + public boolean isExistByValue(String value, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(VisualCategoryEntity::getCategoryvalue, value); + if (!StringUtils.isEmpty(id)) { + queryWrapper.lambda().ne(VisualCategoryEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public VisualCategoryEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(VisualCategoryEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(VisualCategoryEntity entity) { + entity.setId(RandomUtil.uuId()); + this.save(entity); + } + + @Override + public boolean update(String id, VisualCategoryEntity entity) { + entity.setId(id); + return this.updateById(entity); + } + + @Override + public void delete(VisualCategoryEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/impl/VisualComponentServiceImpl.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/impl/VisualComponentServiceImpl.java new file mode 100644 index 0000000..7c7a546 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/impl/VisualComponentServiceImpl.java @@ -0,0 +1,69 @@ +package jnpf.visualdata.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import jnpf.base.service.SuperServiceImpl; +import jnpf.util.RandomUtil; +import jnpf.visualdata.entity.VisualComponentEntity; +import jnpf.visualdata.mapper.VisualComponentMapper; +import jnpf.visualdata.model.visualcomponent.VisualComponentPaginationModel; +import jnpf.visualdata.service.VisualComponentService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 大屏组件库 + * + * @author JNPF开发平台组 + * @version V3.5.0 + * @copyright 引迈信息技术有限公司 + * @date 2023年7月7日 + */ +@Service +public class VisualComponentServiceImpl extends SuperServiceImpl implements VisualComponentService { + + @Override + public List getList(VisualComponentPaginationModel pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(VisualComponentEntity::getType, pagination.getType()); + Page page = new Page(pagination.getCurrent(), pagination.getSize()); + IPage iPages = this.page(page, queryWrapper); + return pagination.setData(iPages); + } + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + return this.list(queryWrapper); + } + + @Override + public VisualComponentEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(VisualComponentEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(VisualComponentEntity entity) { + entity.setId(RandomUtil.uuId()); + this.save(entity); + } + + @Override + public boolean update(String id, VisualComponentEntity entity) { + entity.setId(id); + return this.updateById(entity); + } + + @Override + public void delete(VisualComponentEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } + + +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/impl/VisualConfigServiceImpl.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/impl/VisualConfigServiceImpl.java new file mode 100644 index 0000000..31d1349 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/impl/VisualConfigServiceImpl.java @@ -0,0 +1,56 @@ +package jnpf.visualdata.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import jnpf.base.service.SuperServiceImpl; +import jnpf.util.RandomUtil; +import jnpf.visualdata.entity.VisualConfigEntity; +import jnpf.visualdata.mapper.VisualConfigMapper; +import jnpf.visualdata.service.VisualConfigService; +import org.springframework.stereotype.Service; + +import java.util.List; + + +/** + * 大屏基本配置 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@Service +public class VisualConfigServiceImpl extends SuperServiceImpl implements VisualConfigService { + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + return this.list(queryWrapper); + } + + @Override + public VisualConfigEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(VisualConfigEntity::getVisualId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(VisualConfigEntity entity) { + entity.setId(RandomUtil.uuId()); + this.save(entity); + } + + @Override + public boolean update(String id, VisualConfigEntity entity) { + entity.setId(id); + return this.updateById(entity); + } + + @Override + public void delete(VisualConfigEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/impl/VisualDbServiceImpl.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/impl/VisualDbServiceImpl.java new file mode 100644 index 0000000..38afaee --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/impl/VisualDbServiceImpl.java @@ -0,0 +1,112 @@ +package jnpf.visualdata.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import jnpf.base.service.SuperServiceImpl; +import jnpf.database.model.dto.PrepSqlDTO; +import jnpf.database.util.ConnUtil; +import jnpf.database.util.JdbcUtil; +import jnpf.util.RandomUtil; +import jnpf.util.UserProvider; +import jnpf.visualdata.entity.VisualDbEntity; +import jnpf.visualdata.mapper.VisualDbMapper; +import jnpf.visualdata.model.VisualPagination; +import jnpf.visualdata.service.VisualDbService; +import lombok.Cleanup; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.sql.Connection; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * 大屏数据源配置 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@Service +public class VisualDbServiceImpl extends SuperServiceImpl implements VisualDbService { + + @Autowired + private UserProvider userProvider; + + @Override + public List getList(VisualPagination pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().orderByDesc(VisualDbEntity::getCreateTime); + Page page = new Page(pagination.getCurrent(), pagination.getSize()); + IPage iPages = this.page(page, queryWrapper); + return pagination.setData(iPages); + } + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().orderByDesc(VisualDbEntity::getCreateTime); + return this.list(queryWrapper); + } + + @Override + public VisualDbEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(VisualDbEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(VisualDbEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setCreateTime(new Date()); + entity.setUpdateUser(UserProvider.getLoginUserId()); + this.save(entity); + } + + @Override + public boolean update(String id, VisualDbEntity entity) { + entity.setId(id); + entity.setUpdateTime(new Date()); + entity.setUpdateUser(UserProvider.getLoginUserId()); + return this.updateById(entity); + } + + @Override + public void delete(VisualDbEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } + + @Override + public boolean dbTest(VisualDbEntity entity) { + boolean flag = false; + try { + @Cleanup Connection conn = ConnUtil.getConn(entity.getUsername(), entity.getPassword(), entity.getUrl()); + flag = conn != null; + } catch (Exception e) { + log.error(e.getMessage()); + } + return flag; + } + + @Override + public List> query(VisualDbEntity entity, String sql) { + List> data = new ArrayList<>(); + try { + @Cleanup Connection conn = ConnUtil.getConn(entity.getUsername(), entity.getPassword(), entity.getUrl()); + if (conn != null) { + data = JdbcUtil.queryList(new PrepSqlDTO(sql).withConn(entity.getUsername(), entity.getPassword(), entity.getUrl())).setIsLowerCase(true).get(); + } + } catch (Exception e) { + log.error(e.getMessage()); + } + return data; + } + +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/impl/VisualMapServiceImpl.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/impl/VisualMapServiceImpl.java new file mode 100644 index 0000000..e61902b --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/impl/VisualMapServiceImpl.java @@ -0,0 +1,70 @@ +package jnpf.visualdata.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import jnpf.base.service.SuperServiceImpl; +import jnpf.util.RandomUtil; +import jnpf.visualdata.entity.VisualMapEntity; +import jnpf.visualdata.mapper.VisualMapMapper; +import jnpf.visualdata.model.VisualPagination; +import jnpf.visualdata.service.VisualMapService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 大屏地图配置 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@Service +public class VisualMapServiceImpl extends SuperServiceImpl implements VisualMapService { + + @Override + public List getList(VisualPagination pagination) { + return getListWithColnums(pagination); + } + + + @Override + public List getListWithColnums(VisualPagination pagination, SFunction... columns) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .select(columns). + orderByAsc(VisualMapEntity::getId); + Page page = new Page(pagination.getCurrent(), pagination.getSize()); + IPage iPages = this.page(page, queryWrapper); + return pagination.setData(iPages); + } + + @Override + public VisualMapEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(VisualMapEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(VisualMapEntity entity) { + entity.setId(RandomUtil.uuId()); + this.save(entity); + } + + @Override + public boolean update(String id, VisualMapEntity entity) { + entity.setId(id); + return this.updateById(entity); + } + + @Override + public void delete(VisualMapEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/impl/VisualRecordServiceImpl.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/impl/VisualRecordServiceImpl.java new file mode 100644 index 0000000..4c04608 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/impl/VisualRecordServiceImpl.java @@ -0,0 +1,68 @@ +package jnpf.visualdata.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import jnpf.base.service.SuperServiceImpl; +import jnpf.util.RandomUtil; +import jnpf.visualdata.entity.VisualRecordEntity; +import jnpf.visualdata.mapper.VisualRecordMapper; +import jnpf.visualdata.model.VisualPagination; +import jnpf.visualdata.service.VisualRecordService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 大屏数据集 + * + * @author JNPF开发平台组 + * @version V3.5.0 + * @copyright 引迈信息技术有限公司 + * @date 2023年7月7日 + */ +@Service +public class VisualRecordServiceImpl extends SuperServiceImpl implements VisualRecordService { + + @Override + public List getList(VisualPagination pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + Page page = new Page(pagination.getCurrent(), pagination.getSize()); + IPage iPages = this.page(page, queryWrapper); + return pagination.setData(iPages); + } + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + return this.list(queryWrapper); + } + + @Override + public VisualRecordEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(VisualRecordEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(VisualRecordEntity entity) { + entity.setId(RandomUtil.uuId()); + this.save(entity); + } + + @Override + public boolean update(String id, VisualRecordEntity entity) { + entity.setId(id); + return this.updateById(entity); + } + + @Override + public void delete(VisualRecordEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } + + +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/impl/VisualServiceImpl.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/impl/VisualServiceImpl.java new file mode 100644 index 0000000..c9e88f6 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-biz/src/main/java/jnpf/visualdata/service/impl/VisualServiceImpl.java @@ -0,0 +1,106 @@ +package jnpf.visualdata.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import jnpf.constant.MsgCode; +import jnpf.base.service.SuperServiceImpl; +import jnpf.exception.DataException; +import jnpf.util.RandomUtil; +import jnpf.util.UserProvider; +import jnpf.visualdata.entity.VisualConfigEntity; +import jnpf.visualdata.entity.VisualEntity; +import jnpf.visualdata.mapper.VisualMapper; +import jnpf.visualdata.model.visual.VisualPaginationModel; +import jnpf.visualdata.service.VisualConfigService; +import jnpf.visualdata.service.VisualService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +/** + * 大屏基本信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@Service +public class VisualServiceImpl extends SuperServiceImpl implements VisualService { + + @Autowired + private UserProvider userProvider; + @Autowired + private VisualConfigService configService; + + @Override + public List getList(VisualPaginationModel pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(VisualEntity::getCategory, pagination.getCategory()); + queryWrapper.lambda().orderByDesc(VisualEntity::getCreateTime); + Page page = new Page(pagination.getCurrent(), pagination.getSize()); + IPage iPages = this.page(page, queryWrapper); + return pagination.setData(iPages); + } + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().orderByDesc(VisualEntity::getCreateTime); + return this.list(queryWrapper); + } + + @Override + public VisualEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(VisualEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(VisualEntity entity, VisualConfigEntity configEntity) { + entity.setId(RandomUtil.uuId()); + entity.setCreateTime(new Date()); + entity.setUpdateUser(UserProvider.getLoginUserId()); + entity.setStatus(1); + entity.setIsDeleted(0); + this.save(entity); + configEntity.setVisualId(entity.getId()); + configService.create(configEntity); + } + + @Override + public boolean update(String id, VisualEntity entity, VisualConfigEntity configEntity) { + entity.setId(id); + entity.setUpdateTime(new Date()); + entity.setUpdateUser(UserProvider.getLoginUserId()); + boolean flag = this.updateById(entity); + if (configEntity != null) { + configService.update(configEntity.getId(), configEntity); + } + return flag; + } + + @Override + public void delete(VisualEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + VisualConfigEntity config = configService.getInfo(entity.getId()); + configService.delete(config); + } + } + + @Override + public void createImport(VisualEntity entity, VisualConfigEntity configEntity) throws DataException { + try { + this.save(entity); + configService.create(configEntity); + }catch (Exception e){ + throw new DataException(MsgCode.IMP003.get()); + } + + } +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-controller/pom.xml b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-controller/pom.xml new file mode 100644 index 0000000..1837aee --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-controller/pom.xml @@ -0,0 +1,22 @@ + + + + jnpf-visualdata + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-visualdata-controller + + + + com.jnpf + jnpf-visualdata-biz + ${project.version} + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-controller/src/main/java/jnpf/visualdata/controller/VisualCategoryController.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-controller/src/main/java/jnpf/visualdata/controller/VisualCategoryController.java new file mode 100644 index 0000000..accddaa --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-controller/src/main/java/jnpf/visualdata/controller/VisualCategoryController.java @@ -0,0 +1,155 @@ +package jnpf.visualdata.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import jnpf.base.ActionResult; +import jnpf.base.controller.SuperController; +import jnpf.util.JsonUtil; +import jnpf.visualdata.entity.VisualCategoryEntity; +import jnpf.visualdata.model.VisualPageVO; +import jnpf.visualdata.model.VisualPagination; +import jnpf.visualdata.model.visualcategory.VisualCategoryCrForm; +import jnpf.visualdata.model.visualcategory.VisualCategoryInfoVO; +import jnpf.visualdata.model.visualcategory.VisualCategoryListVO; +import jnpf.visualdata.model.visualcategory.VisualCategoryUpForm; +import jnpf.visualdata.service.VisualCategoryService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; + +/** + * 大屏分类 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@RestController +@Tag(name = "大屏分类", description = "category") +@RequestMapping("/api/blade-visual/category") +public class VisualCategoryController extends SuperController { + + @Autowired + private VisualCategoryService categoryService; + + /** + * 列表 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "列表") + @GetMapping("/page") + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult> list(VisualPagination pagination) { + List data = categoryService.getList(pagination); + List list = JsonUtil.getJsonToList(data, VisualCategoryListVO.class); + VisualPageVO paginationVO = JsonUtil.getJsonToBean(pagination, VisualPageVO.class); + paginationVO.setRecords(list); + return ActionResult.success(paginationVO); + } + + /** + * 列表 + * + * @return + */ + @Operation(summary = "列表") + @GetMapping("/list") + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult> list() { + List data = categoryService.getList(); + List list = JsonUtil.getJsonToList(data, VisualCategoryListVO.class); + return ActionResult.success(list); + } + + /** + * 详情 + * + * @param id 主键 + * @return + */ + @Operation(summary = "详情") + @GetMapping("/detail") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult info(@RequestParam("id") String id) { + VisualCategoryEntity entity = categoryService.getInfo(id); + VisualCategoryInfoVO vo = JsonUtil.getJsonToBean(entity, VisualCategoryInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 新增 + * + * @param categoryCrForm 大屏分类模型 + * @return + */ + @Operation(summary = "新增") + @PostMapping("/save") + @Parameters({ + @Parameter(name = "categoryCrForm", description = "大屏分类模型",required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult create(@RequestBody @Valid VisualCategoryCrForm categoryCrForm) { + VisualCategoryEntity entity = JsonUtil.getJsonToBean(categoryCrForm, VisualCategoryEntity.class); + if (categoryService.isExistByValue(entity.getCategoryvalue(), entity.getId())) { + return ActionResult.fail("模块键值已存在"); + } + categoryService.create(entity); + return ActionResult.success("新建成功"); + } + + /** + * 修改 + * + * @param categoryUpForm 大屏分类模型 + * @return + */ + @Operation(summary = "修改") + @PostMapping("/update") + @Parameters({ + @Parameter(name = "categoryUpForm", description = "大屏分类模型",required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult update(@RequestBody VisualCategoryUpForm categoryUpForm) { + VisualCategoryEntity entity = JsonUtil.getJsonToBean(categoryUpForm, VisualCategoryEntity.class); + if (categoryService.isExistByValue(entity.getCategoryvalue(), entity.getId())) { + return ActionResult.fail("模块键值已存在"); + } + boolean flag = categoryService.update(categoryUpForm.getId(), entity); + if (!flag) { + return ActionResult.fail("更新失败,数据不存在"); + } + return ActionResult.success("更新成功"); + } + + /** + * 删除 + * + * @param ids 主键 + * @return + */ + @Operation(summary = "删除") + @PostMapping("/remove") + @Parameters({ + @Parameter(name = "ids", description = "主键", required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult delete(String ids) { + VisualCategoryEntity entity = categoryService.getInfo(ids); + if (entity != null) { + categoryService.delete(entity); + return ActionResult.success("删除成功"); + } + return ActionResult.fail("删除失败,数据不存在"); + } + +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-controller/src/main/java/jnpf/visualdata/controller/VisualComponentController.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-controller/src/main/java/jnpf/visualdata/controller/VisualComponentController.java new file mode 100644 index 0000000..4a7d9d2 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-controller/src/main/java/jnpf/visualdata/controller/VisualComponentController.java @@ -0,0 +1,152 @@ +package jnpf.visualdata.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import jnpf.base.ActionResult; +import jnpf.base.controller.SuperController; +import jnpf.util.JsonUtil; +import jnpf.util.StringUtil; +import jnpf.visualdata.entity.VisualComponentEntity; +import jnpf.visualdata.model.VisualPageVO; +import jnpf.visualdata.model.visualcomponent.*; +import jnpf.visualdata.service.VisualComponentService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 大屏组件库 + * + * @author JNPF开发平台组 + * @version V3.5.0 + * @copyright 引迈信息技术有限公司 + * @date 2023年7月7日 + */ +@RestController +@Tag(name = "大屏组件库配置", description = "component") +@RequestMapping("/api/blade-visual/component") +public class VisualComponentController extends SuperController { + + @Autowired + private VisualComponentService componentService; + + /** + * 分页 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "分页") + @GetMapping("/list") + public ActionResult> list(VisualComponentPaginationModel pagination) { + List data = componentService.getList(pagination); + List list = JsonUtil.getJsonToList(data, VisualComponentListVO.class); + VisualPageVO paginationVO = JsonUtil.getJsonToBean(pagination, VisualPageVO.class); + paginationVO.setRecords(list); + return ActionResult.success(paginationVO); + } + + /** + * 详情 + * + * @param id 主键 + * @return + */ + @Operation(summary = "详情") + @GetMapping("/detail") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult info(@RequestParam("id")String id) { + VisualComponentEntity entity = componentService.getInfo(id); + VisualComponentInfoVO vo = JsonUtil.getJsonToBean(entity, VisualComponentInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 新增或修改 + * + * @param recordUpForm 数据模型 + * @return + */ + @Operation(summary = "新增或修改") + @PostMapping("/submit") + @Parameters({ + @Parameter(name = "recordUpForm", description = "数据模型",required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult submit(@RequestBody VisualComponentUpForm recordUpForm) { + VisualComponentEntity entity = JsonUtil.getJsonToBean(recordUpForm, VisualComponentEntity.class); + if (StringUtil.isEmpty(entity.getId())) { + componentService.create(entity); + return ActionResult.success("新建成功"); + } else { + componentService.update(entity.getId(), entity); + return ActionResult.success("更新成功"); + } + } + + /** + * 新增 + * + * @param recordCrForm 数据模型 + * @return + */ + @Operation(summary = "新增") + @PostMapping("/save") + @Parameters({ + @Parameter(name = "recordCrForm", description = "数据模型",required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult create(@RequestBody VisualComponentCrForm recordCrForm) { + VisualComponentEntity entity = JsonUtil.getJsonToBean(recordCrForm, VisualComponentEntity.class); + componentService.create(entity); + return ActionResult.success("新建成功"); + } + + /** + * 修改 + * + * @param recordUpForm 数据模型 + * @return + */ + @Operation(summary = "修改") + @PostMapping("/update") + @Parameters({ + @Parameter(name = "recordUpForm", description = "数据模型",required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult update(@RequestBody VisualComponentUpForm recordUpForm) { + VisualComponentEntity entity = JsonUtil.getJsonToBean(recordUpForm, VisualComponentEntity.class); + componentService.update(entity.getId(), entity); + return ActionResult.success("更新成功"); + } + + /** + * 删除 + * + * @param ids 主键 + * @return + */ + @Operation(summary = "删除") + @PostMapping("/remove") + @Parameters({ + @Parameter(name = "ids", description = "主键", required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult delete(String ids) { + VisualComponentEntity entity = componentService.getInfo(ids); + if (entity != null) { + componentService.delete(entity); + return ActionResult.success("删除成功"); + } + return ActionResult.fail("删除失败,数据不存在"); + } + + +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-controller/src/main/java/jnpf/visualdata/controller/VisualController.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-controller/src/main/java/jnpf/visualdata/controller/VisualController.java new file mode 100644 index 0000000..a16ffa3 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-controller/src/main/java/jnpf/visualdata/controller/VisualController.java @@ -0,0 +1,431 @@ +package jnpf.visualdata.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.hutool.http.HttpRequest; +import cn.hutool.http.Method; +import cn.xuyanwu.spring.file.storage.FileInfo; +import com.google.common.base.Joiner; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import jnpf.base.ActionResult; +import jnpf.base.controller.SuperController; +import jnpf.base.vo.DownloadVO; +import jnpf.base.vo.ListVO; +import jnpf.config.ConfigValueUtil; +import jnpf.constant.FileTypeConstant; +import jnpf.constant.MsgCode; +import jnpf.emnus.ModuleTypeEnum; +import jnpf.exception.DataException; +import jnpf.model.FileListVO; +import jnpf.util.*; +import jnpf.util.FileExport; +import jnpf.util.FileUploadUtils; +import jnpf.visualdata.entity.VisualCategoryEntity; +import jnpf.visualdata.entity.VisualConfigEntity; +import jnpf.visualdata.entity.VisualEntity; +import jnpf.visualdata.enums.VisualImgEnum; +import jnpf.visualdata.model.VisualPageVO; +import jnpf.visualdata.model.visual.*; +import jnpf.visualdata.model.visualcategory.VisualCategoryListVO; +import jnpf.visualdata.model.visualconfig.VisualConfigInfoModel; +import jnpf.visualdata.model.visualfile.ImageVO; +import jnpf.visualdata.service.VisualCategoryService; +import jnpf.visualdata.service.VisualConfigService; +import jnpf.visualdata.service.VisualService; +import okhttp3.Headers; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import java.io.IOException; +import java.time.Duration; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 大屏基本信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@RestController +@Tag(name = "大屏基本信息", description = "visual") +@RequestMapping("/api/blade-visual/visual") +public class VisualController extends SuperController { + + @Autowired + private FileExport fileExport; + @Autowired + private VisualService visualService; + @Autowired + private VisualConfigService configService; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private VisualCategoryService categoryService; + + /** + * 列表 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "分页") + @GetMapping("/list") + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult> list(VisualPaginationModel pagination) { + List data = visualService.getList(pagination); + List list = JsonUtil.getJsonToList(data, VisualListVO.class); + VisualPageVO paginationVO = JsonUtil.getJsonToBean(pagination, VisualPageVO.class); + paginationVO.setRecords(list); + return ActionResult.success(paginationVO); + } + + /** + * 详情 + * + * @param id 主键 + * @return + */ + @Operation(summary = "详情") + @GetMapping("/detail") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult info(@RequestParam("id")String id) { + VisualEntity visual = visualService.getInfo(id); + VisualConfigEntity config = configService.getInfo(id); + VisualInfoVO vo = new VisualInfoVO(); + vo.setVisual(JsonUtil.getJsonToBean(visual, VisualInfoModel.class)); + vo.setConfig(JsonUtil.getJsonToBean(config, VisualConfigInfoModel.class)); + return ActionResult.success(vo); + } + + /** + * 新增 + * + * @param visualCrform 大屏模型 + * @return + */ + @Operation(summary = "新增") + @PostMapping("/save") + @Parameters({ + @Parameter(name = "visualCrform", description = "大屏模型",required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult create(@RequestBody @Valid VisualCrform visualCrform) { + VisualEntity visual = JsonUtil.getJsonToBean(visualCrform.getVisual(), VisualEntity.class); + visual.setBackgroundUrl(VisusalImgUrl.url + configValueUtil.getBiVisualPath() + "bg/bg1.png"); + VisualConfigEntity config = JsonUtil.getJsonToBean(visualCrform.getConfig(), VisualConfigEntity.class); + visualService.create(visual, config); + Map data = new HashMap<>(16); + data.put("id", visual.getId()); + return ActionResult.success(data); + } + + /** + * 修改 + * + * @param categoryUpForm 大屏模型 + * @return + */ + @Operation(summary = "修改") + @PostMapping("/update") + @Parameters({ + @Parameter(name = "categoryUpForm", description = "大屏模型",required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult update(@RequestBody VisualUpform categoryUpForm) { + VisualEntity visual = JsonUtil.getJsonToBean(categoryUpForm.getVisual(), VisualEntity.class); + VisualConfigEntity config = JsonUtil.getJsonToBean(categoryUpForm.getConfig(), VisualConfigEntity.class); + visualService.update(visual.getId(), visual, config); + return ActionResult.success("更新成功"); + } + + /** + * 删除 + * + * @param ids 主键 + * @return + */ + @Operation(summary = "删除") + @PostMapping("/remove") + @Parameters({ + @Parameter(name = "ids", description = "主键", required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult delete(@RequestParam("ids")String ids) { + VisualEntity entity = visualService.getInfo(ids); + if (entity != null) { + visualService.delete(entity); + return ActionResult.success("删除成功"); + } + return ActionResult.fail("删除失败,数据不存在"); + } + + /** + * 复制 + * + * @param id 主键 + * @return + */ + @Operation(summary = "复制") + @PostMapping("/copy") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult copy(@RequestParam("id")String id) { + VisualEntity entity = visualService.getInfo(id); + VisualConfigEntity config = configService.getInfo(id); + if (entity != null) { + entity.setTitle(entity.getTitle() + "_复制"); + visualService.create(entity, config); + return ActionResult.success("操作成功", entity.getId()); + } + return ActionResult.fail("复制失败"); + } + + /** + * 获取类型 + * + * @return + */ + @Operation(summary = "获取类型") + @GetMapping("/category") + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult> list() { + List data = categoryService.getList(); + List list = JsonUtil.getJsonToList(data, VisualCategoryListVO.class); + return ActionResult.success(list); + } + + /** + * 上传文件 + * + * @param file 文件 + * @param type 类型 + * @return + */ + @NoDataSourceBind() + @Operation(summary = "上传文件") + @Parameters({ + @Parameter(name = "type", description = "类型",required = true), + }) + @PostMapping(value = "/put-file/{type}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public ActionResult file(MultipartFile file, @PathVariable("type") String type) { + ImageVO vo = new ImageVO(); + VisualImgEnum imgEnum = VisualImgEnum.getByMessage(type); + if (imgEnum != null) { + String path = imgEnum.getMessage(); + String filePath = configValueUtil.getBiVisualPath() + path + "/"; + String name = RandomUtil.uuId() + "." + UpUtil.getFileType(file); + //上传文件 + FileInfo fileInfo = FileUploadUtils.uploadFile(file, filePath, name); + vo.setOriginalName(fileInfo.getOriginalFilename()); + vo.setLink(VisusalImgUrl.url + fileInfo.getPath() + fileInfo.getFilename()); + vo.setName(VisusalImgUrl.url + fileInfo.getPath() + fileInfo.getFilename()); + } + return ActionResult.success(vo); + } + + /** + * 获取图片列表 + * + * @param type 文件夹 + * @return + */ + @NoDataSourceBind() + @Operation(summary = "获取图片列表") + @GetMapping("/{type}") + @Parameters({ + @Parameter(name = "type", description = "文件夹", required = true), + }) + public ActionResult> getFile(@PathVariable("type") String type) { + List vo = new ArrayList<>(); + VisualImgEnum imgEnum = VisualImgEnum.getByMessage(type); + if (imgEnum != null) { + String path = configValueUtil.getBiVisualPath() + imgEnum.getMessage() + "/"; + List fileList = FileUploadUtils.getFileList(path); + fileList.forEach(fileListVO -> { + ImageVO imageVO = new ImageVO(); + imageVO.setName(fileListVO.getFileName()); + imageVO.setLink(VisusalImgUrl.url + fileListVO.getFileName()); + imageVO.setOriginalName(fileListVO.getFileName()); + vo.add(imageVO); + }); + } + return ActionResult.success(vo); + } + + /** + * 大屏下拉框 + */ + @Operation(summary = "大屏下拉框") + @GetMapping("/Selector") + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult> selector() { + List visualList = visualService.getList(); + List categoryList = categoryService.getList(); + List listVos = new ArrayList<>(); + for (VisualCategoryEntity category : categoryList) { + VisualSelectorVO categoryModel = new VisualSelectorVO(); + categoryModel.setId(category.getCategoryvalue()); + categoryModel.setFullName(category.getCategorykey()); + List visualAll = visualList.stream().filter(t -> t.getCategory().equals(category.getCategoryvalue())).collect(Collectors.toList()); + if (visualAll.size() > 0) { + List childList = new ArrayList<>(); + for (VisualEntity visual : visualAll) { + VisualSelectorVO visualModel = new VisualSelectorVO(); + visualModel.setId(visual.getId()); + visualModel.setFullName(visual.getTitle()); + visualModel.setChildren(null); + visualModel.setHasChildren(false); + childList.add(visualModel); + } + categoryModel.setHasChildren(true); + categoryModel.setChildren(childList); + listVos.add(categoryModel); + } + } + ListVO vo = new ListVO(); + vo.setList(listVos); + return ActionResult.success(vo); + } + + /** + * 大屏导出 + * + * @param id 主键 + * @return + */ + @Operation(summary = "大屏导出") + @PostMapping("/{id}/Actions/ExportData") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult exportData(@PathVariable("id") String id) { + VisualEntity entity = visualService.getInfo(id); + VisualConfigEntity configEntity = configService.getInfo(id); + VisualModel model = new VisualModel(); + model.setEntity(entity); + model.setConfigEntity(configEntity); + DownloadVO downloadVO = fileExport.exportFile(model, configValueUtil.getTemporaryFilePath(), entity.getTitle(), ModuleTypeEnum.VISUAL_DATA.getTableName()); + return ActionResult.success(downloadVO); + } + + /** + * 大屏导入 + * + * @param multipartFile 文件 + * @return + */ + @Operation(summary = "大屏导入") + @SaCheckPermission("onlineDev.dataScreen") + @PostMapping(value = "/Model/Actions/ImportData", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public ActionResult ImportData(MultipartFile multipartFile) throws DataException { + //判断是否为.json结尾 + if (FileUtil.existsSuffix(multipartFile, ModuleTypeEnum.VISUAL_DATA.getTableName())) { + return ActionResult.fail(MsgCode.IMP002.get()); + } + //获取文件内容 + String fileContent = FileUtil.getFileContent(multipartFile); + VisualModel vo = JsonUtil.getJsonToBean(fileContent, VisualModel.class); + visualService.createImport(vo.getEntity(), vo.getConfigEntity()); + return ActionResult.success(MsgCode.SU000.get()); + } + + /** + * 获取API动态数据 + * + * @param apiRequest 大屏模型 + * @return + */ + @Operation(summary = "获取API动态数据") + @PostMapping(value = "/GetApiData") + @Parameters({ + @Parameter(name = "apiRequest", description = "大屏模型",required = true), + }) + public String getApiData(@RequestBody @Valid VisualApiRequest apiRequest) throws IOException { + OkHttpClient client = new OkHttpClient.Builder().callTimeout(Duration.ofSeconds(apiRequest.getTimeout())).build(); + Headers headers; + Request request; + if (!apiRequest.getHeaders().isEmpty()) { + Headers.Builder builder = new Headers.Builder(); + apiRequest.getHeaders().forEach((k, v) -> { + builder.add(k, v); + }); + headers = builder.build(); + } else { + headers = new Headers.Builder().build(); + } + if (apiRequest.getMethod().equalsIgnoreCase("post")) { + request = new Request.Builder().url(apiRequest.getUrl()) + .post(okhttp3.RequestBody.create(okhttp3.MediaType.parse("application/json;charset=utf-8"), apiRequest.getParams().isEmpty() ? "" : JsonUtil.getObjectToString(apiRequest.getParams()))) + .headers(headers) + .build(); + } else { + String params = Joiner.on("&") + .useForNull("") + .withKeyValueSeparator("=") + .join(apiRequest.getParams()); + request = new Request.Builder().url(apiRequest.getUrl() + (apiRequest.getUrl().contains("?") ? "&" : "?") + params) + .get() + .headers(headers) + .build(); + } + return client.newCall(request).execute().body().string(); + } + + + /** + * 获取API动态数据 + * + * @param proxyModel 代理模型 + * @return + */ + @Operation(summary = "获取API动态数据") + @PostMapping(value = "/proxy") + @Parameters({ + @Parameter(name = "proxyModel", description = "代理模型",required = true), + }) + public String getApiData(@RequestBody @Valid VisualProxyModel proxyModel) throws IOException { + Map headers; + boolean isForm = false; + if (!proxyModel.getHeaders().isEmpty()) { + headers = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); + headers.putAll(proxyModel.getHeaders()); + if(headers.containsKey("form")){ + //头部指定当前为form表单 + isForm = true; + } + } else { + headers = new HashMap<>(1, 1); + } + //Header无自定义TOKEN 取当前TOKEN + if(!headers.containsKey("Authorization")){ + String token = UserProvider.getToken(); + if(StringUtil.isNotEmpty(token)){ + headers.put("Authorization", token); + } + } + HttpRequest httpRequest = HttpRequest.of(proxyModel.getUrl()).method(Method.valueOf(proxyModel.getMethod().toUpperCase())).addHeaders(headers); + if(isForm){ + httpRequest.form(proxyModel.getData()); + }else if(proxyModel.getData() != null && !proxyModel.getData().isEmpty()){ + httpRequest.body(JsonUtil.getObjectToString(proxyModel.getData())); + }else { + httpRequest.form(proxyModel.getParams()); + } + return httpRequest.timeout(10000).execute().body(); + } +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-controller/src/main/java/jnpf/visualdata/controller/VisualDbController.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-controller/src/main/java/jnpf/visualdata/controller/VisualDbController.java new file mode 100644 index 0000000..beef3a8 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-controller/src/main/java/jnpf/visualdata/controller/VisualDbController.java @@ -0,0 +1,209 @@ +package jnpf.visualdata.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import jnpf.base.ActionResult; +import jnpf.base.controller.SuperController; +import jnpf.util.JsonUtil; +import jnpf.util.StringUtil; +import jnpf.visualdata.entity.VisualDbEntity; +import jnpf.visualdata.model.VisualPageVO; +import jnpf.visualdata.model.VisualPagination; +import jnpf.visualdata.model.visualdb.*; +import jnpf.visualdata.service.VisualDbService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * 大屏数据源配置 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@RestController +@Tag(name = "大屏数据源配置", description = "db") +@RequestMapping("/api/blade-visual/db") +public class VisualDbController extends SuperController { + + @Autowired + private VisualDbService dbService; + + /** + * 分页 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "分页") + @GetMapping("/list") + public ActionResult> list(VisualPagination pagination) { + List data = dbService.getList(pagination); + List list = JsonUtil.getJsonToList(data, VisualDbListVO.class); + VisualPageVO paginationVO = JsonUtil.getJsonToBean(pagination, VisualPageVO.class); + paginationVO.setRecords(list); + return ActionResult.success(paginationVO); + } + + /** + * 详情 + * + * @param id 主键 + * @return + */ + @Operation(summary = "详情") + @GetMapping("/detail") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult info(@RequestParam("id")String id) { + VisualDbEntity entity = dbService.getInfo(id); + VisualDbInfoVO vo = JsonUtil.getJsonToBean(entity, VisualDbInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 新增或修改 + * + * @param dbUpForm 数据模型 + * @return + */ + @Operation(summary = "新增或修改") + @PostMapping("/submit") + @Parameters({ + @Parameter(name = "dbUpForm", description = "数据模型",required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult submit(@RequestBody VisualDbUpForm dbUpForm) { + VisualDbEntity entity = JsonUtil.getJsonToBean(dbUpForm, VisualDbEntity.class); + if (StringUtil.isEmpty(entity.getId())) { + dbService.create(entity); + return ActionResult.success("新建成功"); + } else { + dbService.update(entity.getId(), entity); + return ActionResult.success("更新成功"); + } + } + + /** + * 新增 + * + * @param dbCrForm 数据模型 + * @return + */ + @Operation(summary = "新增") + @PostMapping("/save") + @Parameters({ + @Parameter(name = "dbCrForm", description = "数据模型",required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult create(@RequestBody VisualDbCrForm dbCrForm) { + VisualDbEntity entity = JsonUtil.getJsonToBean(dbCrForm, VisualDbEntity.class); + dbService.create(entity); + return ActionResult.success("新建成功"); + } + + /** + * 修改 + * + * @param dbUpForm 数据模型 + * @return + */ + @Operation(summary = "修改") + @PostMapping("/update") + @Parameters({ + @Parameter(name = "dbUpForm", description = "数据模型",required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult update(@RequestBody VisualDbUpForm dbUpForm) { + VisualDbEntity entity = JsonUtil.getJsonToBean(dbUpForm, VisualDbEntity.class); + dbService.update(entity.getId(), entity); + return ActionResult.success("更新成功"); + } + + /** + * 删除 + * + * @param ids 主键 + * @return + */ + @Operation(summary = "删除") + @PostMapping("/remove") + @Parameters({ + @Parameter(name = "ids", description = "主键", required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult delete(String ids) { + VisualDbEntity entity = dbService.getInfo(ids); + if (entity != null) { + dbService.delete(entity); + return ActionResult.success("删除成功"); + } + return ActionResult.fail("删除失败,数据不存在"); + } + + /** + * 下拉数据源 + * + * @return + */ + @Operation(summary = "下拉数据源") + @GetMapping("/db-list") + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult> list() { + List data = dbService.getList(); + List list = JsonUtil.getJsonToList(data, VisualDbSelectVO.class); + return ActionResult.success(list); + } + + /** + * 数据源测试连接 + * + * @param dbCrForm 数据源模型 + * @return + */ + @Operation(summary = "数据源测试连接") + @PostMapping("/db-test") + @Parameters({ + @Parameter(name = "dbCrForm", description = "数据源模型",required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult test(@RequestBody VisualDbCrForm dbCrForm) { + VisualDbEntity entity = JsonUtil.getJsonToBean(dbCrForm, VisualDbEntity.class); + boolean flag = dbService.dbTest(entity); + if (flag) { + return ActionResult.success("连接成功"); + } + return ActionResult.fail("连接失败"); + } + + /** + * 动态执行SQL + * + * @param queryForm 数据模型 + * @return + */ + @Operation(summary = "动态执行SQL") + @PostMapping("/dynamic-query") + @Parameters({ + @Parameter(name = "queryForm", description = "数据模型",required = true), + }) + public ActionResult query(@RequestBody VisualDbQueryForm queryForm) { + VisualDbEntity entity = dbService.getInfo(queryForm.getId()); + List> data = new ArrayList<>(); + if (entity != null) { + data = dbService.query(entity, queryForm.getSql()); + } + return ActionResult.success(data); + } + +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-controller/src/main/java/jnpf/visualdata/controller/VisualMapController.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-controller/src/main/java/jnpf/visualdata/controller/VisualMapController.java new file mode 100644 index 0000000..25573fa --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-controller/src/main/java/jnpf/visualdata/controller/VisualMapController.java @@ -0,0 +1,149 @@ +package jnpf.visualdata.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import jnpf.base.ActionResult; +import jnpf.base.controller.SuperController; +import jnpf.util.JsonUtil; +import jnpf.visualdata.entity.VisualMapEntity; +import jnpf.visualdata.model.VisualPageVO; +import jnpf.visualdata.model.VisualPagination; +import jnpf.visualdata.model.visualmap.VisualMapCrForm; +import jnpf.visualdata.model.visualmap.VisualMapInfoVO; +import jnpf.visualdata.model.visualmap.VisualMapListVO; +import jnpf.visualdata.model.visualmap.VisualMapUpForm; +import jnpf.visualdata.service.VisualMapService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + + +/** + * 大屏地图 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@RestController +@Tag(name = "大屏地图", description = "map") +@RequestMapping("/api/blade-visual/map") +public class VisualMapController extends SuperController { + + @Autowired + private VisualMapService mapService; + + /** + * 分页 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "分页") + @GetMapping("/list") + public ActionResult> list(VisualPagination pagination) { + List data = mapService.getListWithColnums(pagination, VisualMapEntity::getId, VisualMapEntity::getName); + List list = JsonUtil.getJsonToList(data, VisualMapListVO.class); + VisualPageVO paginationVO = JsonUtil.getJsonToBean(pagination, VisualPageVO.class); + paginationVO.setRecords(list); + return ActionResult.success(paginationVO); + } + + /** + * 详情 + * + * @param id 主键 + * @return + */ + @Operation(summary = "详情") + @GetMapping("/detail") + public ActionResult info(String id) { + VisualMapEntity entity = mapService.getInfo(id); + VisualMapInfoVO vo = JsonUtil.getJsonToBean(entity, VisualMapInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 新增 + * + * @param mapCrForm 地图模型 + * @return + */ + @Operation(summary = "新增") + @PostMapping("/save") + @Parameters({ + @Parameter(name = "mapCrForm", description = "地图模型", required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult create(@RequestBody VisualMapCrForm mapCrForm) { + VisualMapEntity entity = JsonUtil.getJsonToBean(mapCrForm, VisualMapEntity.class); + mapService.create(entity); + return ActionResult.success("新建成功"); + } + + /** + * 修改 + * + * @param mapUpForm 地图模型 + * @return + */ + @Operation(summary = "修改") + @PostMapping("/update") + @Parameters({ + @Parameter(name = "mapUpForm", description = "地图模型", required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult update(@RequestBody VisualMapUpForm mapUpForm) { + VisualMapEntity entity = JsonUtil.getJsonToBean(mapUpForm, VisualMapEntity.class); + boolean flag = mapService.update(mapUpForm.getId(), entity); + if (!flag) { + return ActionResult.fail("更新失败,数据不存在"); + } + return ActionResult.success("更新成功"); + } + + /** + * 删除 + * + * @param ids 主键 + * @return + */ + @Operation(summary = "删除") + @PostMapping("/remove") + @Parameters({ + @Parameter(name = "ids", description = "主键", required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult delete(@RequestParam("ids") String ids) { + VisualMapEntity entity = mapService.getInfo(ids); + if (entity != null) { + mapService.delete(entity); + return ActionResult.success("删除成功"); + } + return ActionResult.fail("删除失败,数据不存在"); + } + + /** + * 数据详情 + * + * @param id 主键 + * @return + */ + @Operation(summary = "数据详情") + @GetMapping("/data") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public Map dataInfo(@RequestParam("id") String id) { + VisualMapEntity entity = mapService.getInfo(id); + Map data = JsonUtil.stringToMap(entity.getData()); + return data; + } + +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-controller/src/main/java/jnpf/visualdata/controller/VisualRecordController.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-controller/src/main/java/jnpf/visualdata/controller/VisualRecordController.java new file mode 100644 index 0000000..7379611 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-controller/src/main/java/jnpf/visualdata/controller/VisualRecordController.java @@ -0,0 +1,156 @@ +package jnpf.visualdata.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import jnpf.base.ActionResult; +import jnpf.base.controller.SuperController; +import jnpf.util.JsonUtil; +import jnpf.util.StringUtil; +import jnpf.visualdata.entity.VisualRecordEntity; +import jnpf.visualdata.model.VisualPageVO; +import jnpf.visualdata.model.VisualPagination; +import jnpf.visualdata.model.visualrecord.VisualRecordCrForm; +import jnpf.visualdata.model.visualrecord.VisualRecordInfoVO; +import jnpf.visualdata.model.visualrecord.VisualRecordListVO; +import jnpf.visualdata.model.visualrecord.VisualRecordUpForm; +import jnpf.visualdata.service.VisualRecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 大屏数据源配置 + * + * @author JNPF开发平台组 + * @version V3.5.0 + * @copyright 引迈信息技术有限公司 + * @date 2023年7月7日 + */ +@RestController +@Tag(name = "大屏数据集配置", description = "record") +@RequestMapping("/api/blade-visual/record") +public class VisualRecordController extends SuperController { + + @Autowired + private VisualRecordService recordService; + + /** + * 分页 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "分页") + @GetMapping("/list") + public ActionResult> list(VisualPagination pagination) { + List data = recordService.getList(pagination); + List list = JsonUtil.getJsonToList(data, VisualRecordListVO.class); + VisualPageVO paginationVO = JsonUtil.getJsonToBean(pagination, VisualPageVO.class); + paginationVO.setRecords(list); + return ActionResult.success(paginationVO); + } + + /** + * 详情 + * + * @param id 主键 + * @return + */ + @Operation(summary = "详情") + @GetMapping("/detail") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult info(@RequestParam("id")String id) { + VisualRecordEntity entity = recordService.getInfo(id); + VisualRecordInfoVO vo = JsonUtil.getJsonToBean(entity, VisualRecordInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 新增或修改 + * + * @param recordUpForm 数据模型 + * @return + */ + @Operation(summary = "新增或修改") + @PostMapping("/submit") + @Parameters({ + @Parameter(name = "recordUpForm", description = "数据模型",required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult submit(@RequestBody VisualRecordUpForm recordUpForm) { + VisualRecordEntity entity = JsonUtil.getJsonToBean(recordUpForm, VisualRecordEntity.class); + if (StringUtil.isEmpty(entity.getId())) { + recordService.create(entity); + return ActionResult.success("新建成功"); + } else { + recordService.update(entity.getId(), entity); + return ActionResult.success("更新成功"); + } + } + + /** + * 新增 + * + * @param recordCrForm 数据模型 + * @return + */ + @Operation(summary = "新增") + @PostMapping("/save") + @Parameters({ + @Parameter(name = "recordCrForm", description = "数据模型",required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult create(@RequestBody VisualRecordCrForm recordCrForm) { + VisualRecordEntity entity = JsonUtil.getJsonToBean(recordCrForm, VisualRecordEntity.class); + recordService.create(entity); + return ActionResult.success("新建成功"); + } + + /** + * 修改 + * + * @param recordUpForm 数据模型 + * @return + */ + @Operation(summary = "修改") + @PostMapping("/update") + @Parameters({ + @Parameter(name = "recordUpForm", description = "数据模型",required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult update(@RequestBody VisualRecordUpForm recordUpForm) { + VisualRecordEntity entity = JsonUtil.getJsonToBean(recordUpForm, VisualRecordEntity.class); + recordService.update(entity.getId(), entity); + return ActionResult.success("更新成功"); + } + + /** + * 删除 + * + * @param ids 主键 + * @return + */ + @Operation(summary = "删除") + @PostMapping("/remove") + @Parameters({ + @Parameter(name = "ids", description = "主键", required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult delete(String ids) { + VisualRecordEntity entity = recordService.getInfo(ids); + if (entity != null) { + recordService.delete(entity); + return ActionResult.success("删除成功"); + } + return ActionResult.fail("删除失败,数据不存在"); + } + + +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-controller/src/main/java/jnpf/visualdata/controller/aop/VisualBindAspect.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-controller/src/main/java/jnpf/visualdata/controller/aop/VisualBindAspect.java new file mode 100644 index 0000000..2369202 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-controller/src/main/java/jnpf/visualdata/controller/aop/VisualBindAspect.java @@ -0,0 +1,74 @@ +package jnpf.visualdata.controller.aop; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-03-26 + */ + +import jnpf.base.UserInfo; +import jnpf.config.ConfigValueUtil; +import jnpf.util.ServletUtil; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import jnpf.util.data.DataSourceContextHolder; +import lombok.extern.slf4j.Slf4j; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/15 17:12 + */ +@Slf4j +@Aspect +@Component +@Order(1) +public class VisualBindAspect { + + + @Autowired + private UserProvider userProvider; + @Autowired + private ConfigValueUtil configValueUtil; + + @Pointcut("execution(* jnpf.*.controller.VisualCategoryController.list(..)) || execution(* jnpf.*.controller.VisualMapController.dataInfo(..))") + public void bindDataSource() { + + } + + /** + * NoDataSourceBind 不需要绑定数据库的注解 + * + * @param pjp + * @return + * @throws Throwable + */ + @Around("bindDataSource()") + public Object doAroundService(ProceedingJoinPoint pjp) throws Throwable { + if (configValueUtil.isMultiTenancy()) { + String jwtToken = ServletUtil.getRequest().getHeader("Authorization"); + if(StringUtil.isEmpty(jwtToken)){ + //兼容旧版大屏前端 + jwtToken = ServletUtil.getRequest().getParameter("token"); + } + UserInfo userInfo = userProvider.get(jwtToken); + if(userInfo.getTenantId() == null){ + throw new RuntimeException("租户信息为空: " + jwtToken); + } + //设置租户 + DataSourceContextHolder.setDatasource(userInfo.getTenantId(), userInfo.getTenantDbConnectionString(), userInfo.isAssignDataSource()); + } + Object obj = pjp.proceed(); + return obj; + } +} + diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-controller/src/main/java/jnpf/visualdata/utils/VisualDataPermissionUtil.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-controller/src/main/java/jnpf/visualdata/utils/VisualDataPermissionUtil.java new file mode 100644 index 0000000..2406e8f --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-controller/src/main/java/jnpf/visualdata/utils/VisualDataPermissionUtil.java @@ -0,0 +1,35 @@ +package jnpf.visualdata.utils; + +import cn.dev33.satoken.stp.StpUtil; +import jnpf.config.ConfigValueUtil; +import jnpf.util.ServletUtil; +import org.springframework.stereotype.Component; + +import java.util.Map; + +@Component +public class VisualDataPermissionUtil { + + private static ConfigValueUtil configValueUtil; + private static final String[] refererPath = new String[]{"**/DataV/view/{id}", "**/DataV/build/{id}"}; + + public VisualDataPermissionUtil(ConfigValueUtil configValueUtil) { + VisualDataPermissionUtil.configValueUtil = configValueUtil; + } + + public static void checkByReferer() { + if (configValueUtil.isEnablePreAuth()) { + String referer = ServletUtil.getHeader("Referer"); + String id = null; + for (String s : refererPath) { + Map pathVariables = ServletUtil.getPathVariables(s, referer); + id = pathVariables.get("id"); + if (id != null) { + id = id.split("[?]")[0]; + break; + } + } + StpUtil.checkPermissionOr("onlineDev.dataScreen", id); + } + } +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/pom.xml b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/pom.xml new file mode 100644 index 0000000..f794c78 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/pom.xml @@ -0,0 +1,29 @@ + + + + jnpf-visualdata + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-visualdata-entity + + + + com.jnpf + jnpf-common-all + ${project.version} + compile + + + + com.jnpf + jnpf-exception + ${project.version} + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/entity/VisualCategoryEntity.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/entity/VisualCategoryEntity.java new file mode 100644 index 0000000..4e3e3fd --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/entity/VisualCategoryEntity.java @@ -0,0 +1,41 @@ +package jnpf.visualdata.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +/** + * 大屏分类 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@Data +@TableName("blade_visual_category") +public class VisualCategoryEntity { + /** 主键 */ + @TableId("ID") + private String id; + + /** 分类值 */ + @TableField("CATEGORY_KEY") + private String categorykey; + + /** 分类名称 */ + @TableField("CATEGORY_VALUE") + private String categoryvalue; + + /** 是否删除 */ + @TableField("IS_DELETED") + private String isdeleted; + + /** + * 租户id + */ + @TableField("f_tenant_id") + private String tenantId; + +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/entity/VisualComponentEntity.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/entity/VisualComponentEntity.java new file mode 100644 index 0000000..efcf546 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/entity/VisualComponentEntity.java @@ -0,0 +1,46 @@ +package jnpf.visualdata.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +/** + * 大屏组件库 + * + * @author JNPF开发平台组 + * @version V3.5.0 + * @copyright 引迈信息技术有限公司 + * @date 2023年7月7日 + */ +@Data +@TableName("blade_visual_component") +public class VisualComponentEntity { + + /** 主键 */ + @TableId("ID") + private String id; + + /** 组件名称 */ + @TableField("name") + private String name; + + /** 组件内容 */ + @TableField("content") + private String content; + + /** 组件类型 */ + @TableField("type") + private Integer type; + + /** 组件图片 */ + @TableField("img") + private String img; + + /** + * 租户id + */ + @TableField("f_tenant_id") + private String tenantId; + +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/entity/VisualConfigEntity.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/entity/VisualConfigEntity.java new file mode 100644 index 0000000..f238553 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/entity/VisualConfigEntity.java @@ -0,0 +1,41 @@ +package jnpf.visualdata.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +/** + * 大屏基本配置 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@Data +@TableName("blade_visual_config") +public class VisualConfigEntity { + /** 主键 */ + @TableId("ID") + private String id; + + /** 可视化表主键 */ + @TableField("VISUAL_ID") + private String visualId; + + /** 配置json */ + @TableField("DETAIL") + private String detail; + + /** 组件json */ + @TableField("COMPONENT") + private String component; + + /** + * 租户id + */ + @TableField("f_tenant_id") + private String tenantId; + +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/entity/VisualDbEntity.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/entity/VisualDbEntity.java new file mode 100644 index 0000000..c548b4f --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/entity/VisualDbEntity.java @@ -0,0 +1,83 @@ +package jnpf.visualdata.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.util.Date; + +/** + * 大屏数据源配置 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@Data +@TableName("blade_visual_db") +public class VisualDbEntity { + /** 主键 */ + @TableId("ID") + private String id; + + /** 名称 */ + @TableField("NAME") + private String name; + + /** 驱动类 */ + @TableField("DRIVER_CLASS") + private String driverClass; + + /** 连接地址 */ + @TableField("URL") + private String url; + + /** 用户名 */ + @TableField("USERNAME") + private String username; + + /** 密码 */ + @TableField("PASSWORD") + private String password; + + /** 备注 */ + @TableField("REMARK") + private String remark; + + /** 创建人 */ + @TableField("CREATE_USER") + private String createUser; + + /** 创建部门 */ + @TableField("CREATE_DEPT") + private String createDept; + + /** 创建时间 */ + @TableField("CREATE_TIME") + private Date createTime; + + /** 修改人 */ + @TableField("UPDATE_USER") + private String updateUser; + + /** 修改时间 */ + @TableField("UPDATE_TIME") + private Date updateTime; + + /** 状态 */ + @TableField("STATUS") + private String status; + + /** 是否已删除 */ + @TableField("IS_DELETED") + private String isDeleted; + + /** + * 租户id + */ + @TableField("f_tenant_id") + private String tenantId; + +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/entity/VisualEntity.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/entity/VisualEntity.java new file mode 100644 index 0000000..ee9d79e --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/entity/VisualEntity.java @@ -0,0 +1,75 @@ +package jnpf.visualdata.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.util.Date; + +/** + * 大屏基本信息 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@Data +@TableName("blade_visual") +public class VisualEntity { + /** 主键 */ + @TableId("ID") + private String id; + + /** 大屏标题 */ + @TableField("TITLE") + private String title; + + /** 大屏背景 */ + @TableField("BACKGROUND_URL") + private String backgroundUrl; + + /** 大屏类型 */ + @TableField("CATEGORY") + private String category; + + /** 发布密码 */ + @TableField("PASSWORD") + private String password; + + /** 创建人 */ + @TableField("CREATE_USER") + private String createUser; + + /** 创建部门 */ + @TableField("CREATE_DEPT") + private String createDept; + + /** 创建时间 */ + @TableField("CREATE_TIME") + private Date createTime; + + /** 修改人 */ + @TableField("UPDATE_USER") + private String updateUser; + + /** 修改时间 */ + @TableField("UPDATE_TIME") + private Date updateTime; + + /** 状态 */ + @TableField("STATUS") + private Integer status; + + /** 是否已删除 */ + @TableField("IS_DELETED") + private Integer isDeleted; + + /** + * 租户id + */ + @TableField("f_tenant_id") + private String tenantId; + +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/entity/VisualMapEntity.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/entity/VisualMapEntity.java new file mode 100644 index 0000000..7a31a09 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/entity/VisualMapEntity.java @@ -0,0 +1,37 @@ +package jnpf.visualdata.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +/** + * 大屏地图配置 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@Data +@TableName("blade_visual_map") +public class VisualMapEntity { + /** 主键 */ + @TableId("ID") + private String id; + + /** 地图名称 */ + @TableField("NAME") + private String name; + + /** 地图数据 */ + @TableField("DATA") + private String data; + + /** + * 租户id + */ + @TableField("f_tenant_id") + private String tenantId; + +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/entity/VisualRecordEntity.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/entity/VisualRecordEntity.java new file mode 100644 index 0000000..6673381 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/entity/VisualRecordEntity.java @@ -0,0 +1,88 @@ +package jnpf.visualdata.entity; + +import com.alibaba.fastjson.annotation.JSONField; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +/** + * 大屏数据集 + * + * @author JNPF开发平台组 + * @version V3.5.0 + * @copyright 引迈信息技术有限公司 + * @date 2023年7月7日 + */ +@Data +@TableName("blade_visual_record") +public class VisualRecordEntity { + + /** 主键 */ + @TableId("ID") + private String id; + + /** 名称 */ + @TableField("name") + private String name; + + /** 请求地址 */ + @TableField("url") + private String url; + + /** 数据集类型 */ + @TableField("dataType") + private Integer dataType; + + /** 请求方法 */ + @TableField("dataMethod") + private String dataMethod; + + /** 数据集类型 */ + @TableField("dataHeader") + private String dataHeader; + + /** 请求数据 */ + @TableField("data") + private String data; + + /** 请求参数 */ + @TableField("dataQuery") + private String dataQuery; + + /** 请求参数类型 */ + @TableField("dataQueryType") + private String dataQueryType; + + /** 过滤器 */ + @TableField("dataFormatter") + private String dataFormatter; + + /** 开启跨域 */ + @TableField("proxy") + private Boolean proxy; + + /** WebSocket地址 */ + @TableField("wsUrl") + private String wsUrl; + + /** 数据集类型 */ + @TableField("dbsql") + private String dbsql; + + /** 数据集类型 */ + @TableField("fsql") + @JSONField(name = "sql") + private String fsql; + + /** 数据集类型 */ + @TableField("result") + private String result; + + /** + * 租户id + */ + @TableField("f_tenant_id") + private String tenantId; + +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/enums/VisualImgEnum.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/enums/VisualImgEnum.java new file mode 100644 index 0000000..6266a98 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/enums/VisualImgEnum.java @@ -0,0 +1,71 @@ +package jnpf.visualdata.enums; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +public enum VisualImgEnum { + /** + * 背景图片 + */ + BG("0", "bg"), + /** + * 图片框 + */ + BORDER("1", "border"), + /** + * 图片 + */ + SOURCE("2", "source"), + /** + * banner + */ + BANNER("3", "banner"), + /** + * banner + */ + BACKGROUND("5", "background"), + /** + * 大屏截图 + */ + SCREENSHOT("4", "screenShot"); + + /** + * 状态码 + */ + private String code; + /** + * 消息 + */ + private String message; + + VisualImgEnum(String code, String message) { + this.code = code; + this.message = message; + } + + public String getCode() { + return code; + } + + public String getMessage() { + return message; + } + + /** + * 判断名称是否存在 + * + * @return boolean + */ + public static VisualImgEnum getByMessage(String type) { + for (VisualImgEnum value : VisualImgEnum.values()) { + if(value.code.contains(type) || value.getMessage().contains(type)){ + return value; + } + } + return null; + } + +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/VisualPageVO.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/VisualPageVO.java new file mode 100644 index 0000000..1e7bf06 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/VisualPageVO.java @@ -0,0 +1,43 @@ +package jnpf.visualdata.model; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@Data +public class VisualPageVO { + /** + * 数据 + */ + @Schema(description ="数据") + private List records; + /** + * 当前页 + */ + @Schema(description ="当前页") + private Long current; + /** + * 每页行数 + */ + @Schema(description ="每页行数") + private Long size; + /** + * 总记录数 + */ + @Schema(description ="总记录数") + private Long total; + /** + * 总页数 + */ + @Schema(description ="总页数") + private Long pages; + +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/VisualPagination.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/VisualPagination.java new file mode 100644 index 0000000..49ea5e1 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/VisualPagination.java @@ -0,0 +1,37 @@ +package jnpf.visualdata.model; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@Data +public class VisualPagination { + @Schema(description ="每页条数",example = "10") + private long size=10; + @Schema(description ="当前页数",example = "1") + private long current=1; + @Schema(hidden = true) + private long total; + @Schema(hidden = true) + private long pages; + + public List setData(IPage page) { + this.total = page.getTotal(); + if (this.total > 0) { + this.pages = this.total % this.size == 0 ? this.total / this.size : this.total / this.size + 1; + } else { + this.pages = 0L; + } + return page.getRecords(); + } +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualApiRequest.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualApiRequest.java new file mode 100644 index 0000000..5cb7867 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualApiRequest.java @@ -0,0 +1,32 @@ +package jnpf.visualdata.model.visual; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.util.Collections; +import java.util.Map; + +/** + * 请求Api数据结构 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@Data +public class VisualApiRequest { + + @NotBlank + @Schema(description ="路径") + private String url; + @NotBlank + @Schema(description ="每页条数") + private String method; + @Schema(description ="每页条数") + private Map headers = Collections.emptyMap(); + @Schema(description ="每页条数") + private Map params = Collections.emptyMap(); + @Schema(description ="每页条数") + private int timeout = 3; +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualCrModel.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualCrModel.java new file mode 100644 index 0000000..a9ed3b1 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualCrModel.java @@ -0,0 +1,21 @@ +package jnpf.visualdata.model.visual; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@Data +public class VisualCrModel { + @Schema(description ="标题") + private String title; + @Schema(description ="密码") + private String password; + @Schema(description ="分类") + private String category; +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualCrform.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualCrform.java new file mode 100644 index 0000000..6681687 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualCrform.java @@ -0,0 +1,21 @@ +package jnpf.visualdata.model.visual; + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.visualdata.model.visualconfig.VisualConfigCrForm; +import lombok.Data; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@Data +public class VisualCrform { + @Schema(description ="大屏基本信息") + private VisualCrModel visual; + @Schema(description ="大屏配置") + private VisualConfigCrForm config; +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualInfoModel.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualInfoModel.java new file mode 100644 index 0000000..7a526be --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualInfoModel.java @@ -0,0 +1,19 @@ +package jnpf.visualdata.model.visual; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@Data +public class VisualInfoModel extends VisualCrModel{ + @Schema(description ="背景url") + private String backgroundUrl; + @Schema(description ="主键") + private String id; +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualInfoVO.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualInfoVO.java new file mode 100644 index 0000000..256289d --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualInfoVO.java @@ -0,0 +1,21 @@ +package jnpf.visualdata.model.visual; + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.visualdata.model.visualconfig.VisualConfigInfoModel; +import lombok.Data; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@Data +public class VisualInfoVO { + @Schema(description ="大屏基本信息") + private VisualInfoModel visual; + @Schema(description ="大屏配置") + private VisualConfigInfoModel config; +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualListVO.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualListVO.java new file mode 100644 index 0000000..6371b34 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualListVO.java @@ -0,0 +1,28 @@ +package jnpf.visualdata.model.visual; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@Data +public class VisualListVO { + @Schema(description ="背景url") + private String backgroundUrl; + @Schema(description ="标题") + private String title; + @Schema(description ="密码") + private String password; + @Schema(description ="主键") + private String id; + @Schema(description ="发布状态") + private Integer status; + @Schema(description ="分类") + private String category; + +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualModel.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualModel.java new file mode 100644 index 0000000..b46147f --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualModel.java @@ -0,0 +1,22 @@ +package jnpf.visualdata.model.visual; + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.visualdata.entity.VisualConfigEntity; +import jnpf.visualdata.entity.VisualEntity; +import lombok.Data; + +/** + * 大屏导出 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年7月10日 + */ +@Data +public class VisualModel { + @Schema(description ="大屏基本信息") + private VisualEntity entity; + @Schema(description ="大屏配置信息") + private VisualConfigEntity configEntity; +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualPaginationModel.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualPaginationModel.java new file mode 100644 index 0000000..33f025e --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualPaginationModel.java @@ -0,0 +1,21 @@ +package jnpf.visualdata.model.visual; + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.visualdata.model.VisualPagination; +import lombok.Data; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@Data +public class VisualPaginationModel extends VisualPagination { + @Schema(description ="分类") + private Integer category; + + +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualProxyModel.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualProxyModel.java new file mode 100644 index 0000000..3f05f8b --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualProxyModel.java @@ -0,0 +1,36 @@ +package jnpf.visualdata.model.visual; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.util.Collections; +import java.util.Map; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.5.0 + * @copyright 引迈信息技术有限公司 + * @date 2023年7月7日 + */ +@Data +public class VisualProxyModel { + + @NotBlank + @Schema(description ="路径") + private String url; + @NotBlank + @Schema(description ="请求方式") + private String method; + @Schema(description ="headers") + private Map headers = Collections.emptyMap(); + @Schema(description ="data") + private Map data = null; + @Schema(description ="params") + private Map params = Collections.emptyMap(); + @Schema(description ="每页条数") + private int timeout = 3; + +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualSelectorVO.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualSelectorVO.java new file mode 100644 index 0000000..8059239 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualSelectorVO.java @@ -0,0 +1,25 @@ +package jnpf.visualdata.model.visual; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@Data +public class VisualSelectorVO { + @Schema(description ="主键") + private String id; + @Schema(description ="名称") + private String fullName; + @Schema(description ="是否有下级") + private Boolean hasChildren; + @Schema(description ="下级") + private List children; +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualUpModel.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualUpModel.java new file mode 100644 index 0000000..23d4711 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualUpModel.java @@ -0,0 +1,21 @@ +package jnpf.visualdata.model.visual; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@Data +public class VisualUpModel extends VisualCrModel{ + @Schema(description ="背景url") + private String backgroundUrl; + @Schema(description ="发布状态") + private String status; + @Schema(description ="主键") + private String id; +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualUpform.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualUpform.java new file mode 100644 index 0000000..79f9dab --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visual/VisualUpform.java @@ -0,0 +1,21 @@ +package jnpf.visualdata.model.visual; + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.visualdata.model.visualconfig.VisualConfigUpForm; +import lombok.Data; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@Data +public class VisualUpform { + @Schema(description ="大屏基本信息") + private VisualUpModel visual; + @Schema(description ="大屏配置") + private VisualConfigUpForm config; +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualcategory/VisualCategoryCrForm.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualcategory/VisualCategoryCrForm.java new file mode 100644 index 0000000..ec7334b --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualcategory/VisualCategoryCrForm.java @@ -0,0 +1,21 @@ +package jnpf.visualdata.model.visualcategory; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@Data +public class VisualCategoryCrForm { + @Schema(description ="分类键值") + private String categoryKey; + @Schema(description ="分类名称") + private String categoryValue; + @Schema(description ="是否已删除") + private Integer isDeleted; +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualcategory/VisualCategoryInfoVO.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualcategory/VisualCategoryInfoVO.java new file mode 100644 index 0000000..d677292 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualcategory/VisualCategoryInfoVO.java @@ -0,0 +1,23 @@ +package jnpf.visualdata.model.visualcategory; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@Data +public class VisualCategoryInfoVO { + @Schema(description ="分类键值") + private String categoryKey; + @Schema(description ="分类名称") + private String categoryValue; + @Schema(description ="主键") + private String id; + @Schema(description ="是否已删除") + private Integer isDeleted; +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualcategory/VisualCategoryListVO.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualcategory/VisualCategoryListVO.java new file mode 100644 index 0000000..16b092b --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualcategory/VisualCategoryListVO.java @@ -0,0 +1,23 @@ +package jnpf.visualdata.model.visualcategory; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@Data +public class VisualCategoryListVO { + @Schema(description ="分类键值") + private String categoryKey; + @Schema(description ="分类名称") + private String categoryValue; + @Schema(description ="主键") + private String id; + @Schema(description ="是否已删除") + private Integer isDeleted; +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualcategory/VisualCategoryUpForm.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualcategory/VisualCategoryUpForm.java new file mode 100644 index 0000000..2a10b9a --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualcategory/VisualCategoryUpForm.java @@ -0,0 +1,17 @@ +package jnpf.visualdata.model.visualcategory; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@Data +public class VisualCategoryUpForm extends VisualCategoryCrForm { + @Schema(description ="主键") + private String id; +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualcomponent/VisualComponentCrForm.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualcomponent/VisualComponentCrForm.java new file mode 100644 index 0000000..551a593 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualcomponent/VisualComponentCrForm.java @@ -0,0 +1,31 @@ +package jnpf.visualdata.model.visualcomponent; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.5.0 + * @copyright 引迈信息技术有限公司 + * @date 2023年7月7日 + */ +@Data +public class VisualComponentCrForm { + + + @Schema(description = "主键") + private String id; + + @Schema(description = "主键") + private String name; + + @Schema(description = "组件内容") + private String content; + + @Schema(description = "组件类型") + private Integer type; + + @Schema(description = "组件图片") + private String img; +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualcomponent/VisualComponentInfoVO.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualcomponent/VisualComponentInfoVO.java new file mode 100644 index 0000000..bcb89cc --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualcomponent/VisualComponentInfoVO.java @@ -0,0 +1,15 @@ +package jnpf.visualdata.model.visualcomponent; +import lombok.Data; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.5.0 + * @copyright 引迈信息技术有限公司 + * @date 2023年7月7日 + */ +@Data +public class VisualComponentInfoVO extends VisualComponentCrForm { + +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualcomponent/VisualComponentListVO.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualcomponent/VisualComponentListVO.java new file mode 100644 index 0000000..e162da6 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualcomponent/VisualComponentListVO.java @@ -0,0 +1,27 @@ +package jnpf.visualdata.model.visualcomponent; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.5.0 + * @copyright 引迈信息技术有限公司 + * @date 2023年7月7日 + */ +@Data +public class VisualComponentListVO { + + @Schema(description = "主键") + private String id; + + @Schema(description = "主键") + private String name; + + @Schema(description = "组件类型") + private String type; + + @Schema(description = "组件图片") + private String img; +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualcomponent/VisualComponentPaginationModel.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualcomponent/VisualComponentPaginationModel.java new file mode 100644 index 0000000..36f29c7 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualcomponent/VisualComponentPaginationModel.java @@ -0,0 +1,20 @@ +package jnpf.visualdata.model.visualcomponent; + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.visualdata.model.VisualPagination; +import lombok.Data; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.5.0 + * @copyright 引迈信息技术有限公司 + * @date 2023年7月7日 + */ +@Data +public class VisualComponentPaginationModel extends VisualPagination { + @Schema(description = "组件类型(0,1)") + private Integer type; + +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualcomponent/VisualComponentUpForm.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualcomponent/VisualComponentUpForm.java new file mode 100644 index 0000000..e288ece --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualcomponent/VisualComponentUpForm.java @@ -0,0 +1,15 @@ +package jnpf.visualdata.model.visualcomponent; +import lombok.Data; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.5.0 + * @copyright 引迈信息技术有限公司 + * @date 2023年7月7日 + */ +@Data +public class VisualComponentUpForm extends VisualComponentCrForm { + +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualconfig/VisualConfigCrForm.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualconfig/VisualConfigCrForm.java new file mode 100644 index 0000000..7727599 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualconfig/VisualConfigCrForm.java @@ -0,0 +1,19 @@ +package jnpf.visualdata.model.visualconfig; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@Data +public class VisualConfigCrForm { + @Schema(description ="大屏详情") + private String detail; + @Schema(description ="内容") + private String component; +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualconfig/VisualConfigInfoModel.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualconfig/VisualConfigInfoModel.java new file mode 100644 index 0000000..cf9a2d7 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualconfig/VisualConfigInfoModel.java @@ -0,0 +1,19 @@ +package jnpf.visualdata.model.visualconfig; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@Data +public class VisualConfigInfoModel extends VisualConfigCrForm{ + @Schema(description ="大屏配置主键") + private String id; + @Schema(description ="大屏基本主键") + private String visualId; +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualconfig/VisualConfigUpForm.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualconfig/VisualConfigUpForm.java new file mode 100644 index 0000000..bd424a6 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualconfig/VisualConfigUpForm.java @@ -0,0 +1,19 @@ +package jnpf.visualdata.model.visualconfig; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@Data +public class VisualConfigUpForm extends VisualConfigCrForm { + @Schema(description ="大屏配置主键") + private String id; + @Schema(description ="大屏基本主键") + private String visualId; +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualdb/VisualDbCrForm.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualdb/VisualDbCrForm.java new file mode 100644 index 0000000..165a61a --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualdb/VisualDbCrForm.java @@ -0,0 +1,27 @@ +package jnpf.visualdata.model.visualdb; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@Data +public class VisualDbCrForm { + @Schema(description ="驱动") + private String driverClass; + @Schema(description ="密码") + private String password; + @Schema(description ="连接") + private String url; + @Schema(description ="用户名") + private String username; + @Schema(description ="名称") + private String name; + @Schema(description ="备注") + private String remark; +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualdb/VisualDbInfoVO.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualdb/VisualDbInfoVO.java new file mode 100644 index 0000000..9569b6a --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualdb/VisualDbInfoVO.java @@ -0,0 +1,50 @@ +package jnpf.visualdata.model.visualdb; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@Data +public class VisualDbInfoVO { + /** 主键 */ + @Schema(description ="主键") + private String id; + + /** 名称 */ + @Schema(description ="名称") + private String name; + + /** 驱动类 */ + @Schema(description ="驱动类") + private String driverClass; + + /** 连接地址 */ + @Schema(description ="连接地址") + private String url; + + /** 用户名 */ + @Schema(description ="用户名") + private String username; + + /** 密码 */ + @Schema(description ="密码") + private String password; + + /** 备注 */ + @Schema(description ="备注") + private String remark; + + /** 状态 */ + @Schema(description ="状态") + private String status; + + /** 是否已删除 */ + @Schema(description ="是否已删除") + private String isDeleted; +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualdb/VisualDbListVO.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualdb/VisualDbListVO.java new file mode 100644 index 0000000..1b0a44c --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualdb/VisualDbListVO.java @@ -0,0 +1,30 @@ +package jnpf.visualdata.model.visualdb; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@Data +public class VisualDbListVO { + @Schema(description ="驱动") + private String driverClass; + @Schema(description ="名称") + private String name; + @Schema(description ="用户名") + private String username; + @Schema(description ="连接") + private String url; + @Schema(description ="主键") + private String id; + @Schema(description ="备注") + private String remark; + @Schema(description ="密码") + private String password; + +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualdb/VisualDbQueryForm.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualdb/VisualDbQueryForm.java new file mode 100644 index 0000000..049e5b5 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualdb/VisualDbQueryForm.java @@ -0,0 +1,19 @@ +package jnpf.visualdata.model.visualdb; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@Data +public class VisualDbQueryForm { + @Schema(description ="主键") + private String id; + @Schema(description ="sql语句") + private String sql; +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualdb/VisualDbSelectVO.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualdb/VisualDbSelectVO.java new file mode 100644 index 0000000..2514559 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualdb/VisualDbSelectVO.java @@ -0,0 +1,22 @@ +package jnpf.visualdata.model.visualdb; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@Data +public class VisualDbSelectVO { + @Schema(description ="驱动") + private String driverClass; + @Schema(description ="名称") + private String name; + @Schema(description ="主键") + private String id; + +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualdb/VisualDbUpForm.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualdb/VisualDbUpForm.java new file mode 100644 index 0000000..951144c --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualdb/VisualDbUpForm.java @@ -0,0 +1,19 @@ +package jnpf.visualdata.model.visualdb; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@Data +public class VisualDbUpForm extends VisualDbCrForm{ + @Schema(description ="主键") + private String id; + + +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualfile/ImageVO.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualfile/ImageVO.java new file mode 100644 index 0000000..3cdc19b --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualfile/ImageVO.java @@ -0,0 +1,23 @@ +package jnpf.visualdata.model.visualfile; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@Data +public class ImageVO { + @Schema(description ="路径") + private String domain; + @Schema(description ="链接") + private String link; + @Schema(description ="名称") + private String name; + @Schema(description ="名称") + private String originalName; +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualmap/VisualMapCrForm.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualmap/VisualMapCrForm.java new file mode 100644 index 0000000..0d00d30 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualmap/VisualMapCrForm.java @@ -0,0 +1,19 @@ +package jnpf.visualdata.model.visualmap; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@Data +public class VisualMapCrForm { + @Schema(description ="地图名称") + private String name; + @Schema(description ="地图数据") + private String data; +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualmap/VisualMapInfoVO.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualmap/VisualMapInfoVO.java new file mode 100644 index 0000000..52aac5b --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualmap/VisualMapInfoVO.java @@ -0,0 +1,21 @@ +package jnpf.visualdata.model.visualmap; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@Data +public class VisualMapInfoVO { + @Schema(description ="地图名称") + private String name; + @Schema(description ="地图数据") + private String data; + @Schema(description ="主键") + private String id; +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualmap/VisualMapListVO.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualmap/VisualMapListVO.java new file mode 100644 index 0000000..b317aeb --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualmap/VisualMapListVO.java @@ -0,0 +1,19 @@ +package jnpf.visualdata.model.visualmap; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@Data +public class VisualMapListVO { + @Schema(description ="地图名称") + private String name; + @Schema(description ="主键") + private String id; +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualmap/VisualMapUpForm.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualmap/VisualMapUpForm.java new file mode 100644 index 0000000..fce8a4d --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualmap/VisualMapUpForm.java @@ -0,0 +1,17 @@ +package jnpf.visualdata.model.visualmap; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年6月15日 + */ +@Data +public class VisualMapUpForm extends VisualMapCrForm { + @Schema(description ="主键") + private String id; +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualrecord/VisualRecordCrForm.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualrecord/VisualRecordCrForm.java new file mode 100644 index 0000000..b189f68 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualrecord/VisualRecordCrForm.java @@ -0,0 +1,61 @@ +package jnpf.visualdata.model.visualrecord; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.5.0 + * @copyright 引迈信息技术有限公司 + * @date 2023年7月7日 + */ +@Data +public class VisualRecordCrForm { + + + @Schema(description = "主键") + private String id; + + @Schema(description = "名称") + private String name; + + @Schema(description = "请求地址") + private String url; + + @Schema(description = "数据集类型") + private Integer dataType; + + @Schema(description = "请求方法") + private String dataMethod; + + @Schema(description = "数据集类型") + private String dataHeader; + + @Schema(description = "请求数据") + private String data; + + @Schema(description = "请求参数") + private String dataQuery; + + @Schema(description = "请求参数类型") + private String dataQueryType; + + @Schema(description = "过滤器") + private String dataFormatter; + + @Schema(description = "开启跨域") + private Boolean proxy; + + @Schema(description = "WebSocket地址") + private String wsUrl; + + @Schema(description = "数据集类型") + private String dbsql; + + @Schema(description = "数据集类型") + private String sql; + + @Schema(description = "数据集类型") + private String result; +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualrecord/VisualRecordInfoVO.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualrecord/VisualRecordInfoVO.java new file mode 100644 index 0000000..e8cafd9 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualrecord/VisualRecordInfoVO.java @@ -0,0 +1,15 @@ +package jnpf.visualdata.model.visualrecord; +import lombok.Data; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.5.0 + * @copyright 引迈信息技术有限公司 + * @date 2023年7月7日 + */ +@Data +public class VisualRecordInfoVO extends VisualRecordCrForm { + +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualrecord/VisualRecordListVO.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualrecord/VisualRecordListVO.java new file mode 100644 index 0000000..543a648 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualrecord/VisualRecordListVO.java @@ -0,0 +1,25 @@ +package jnpf.visualdata.model.visualrecord; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.5.0 + * @copyright 引迈信息技术有限公司 + * @date 2023年7月7日 + */ +@Data +public class VisualRecordListVO { + + @Schema(description = "主键") + private String id; + + @Schema(description = "名称") + private String name; + + @Schema(description = "数据集类型") + private Integer dataType; + +} diff --git a/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualrecord/VisualRecordUpForm.java b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualrecord/VisualRecordUpForm.java new file mode 100644 index 0000000..c1e45cc --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/jnpf-visualdata-entity/src/main/java/jnpf/visualdata/model/visualrecord/VisualRecordUpForm.java @@ -0,0 +1,15 @@ +package jnpf.visualdata.model.visualrecord; +import lombok.Data; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.5.0 + * @copyright 引迈信息技术有限公司 + * @date 2023年7月7日 + */ +@Data +public class VisualRecordUpForm extends VisualRecordCrForm { + +} diff --git a/jnpf-java-boot/jnpf-visualdata/pom.xml b/jnpf-java-boot/jnpf-visualdata/pom.xml new file mode 100644 index 0000000..1823547 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdata/pom.xml @@ -0,0 +1,20 @@ + + + + jnpf-java-boot + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-visualdata + pom + + jnpf-visualdata-entity + jnpf-visualdata-biz + jnpf-visualdata-controller + + + diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/pom.xml b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/pom.xml new file mode 100644 index 0000000..7e13dbb --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/pom.xml @@ -0,0 +1,53 @@ + + + + jnpf-visualdev-base + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-visualdev-base-biz + + + + com.jnpf + jnpf-visualdev-base-entity + ${project.version} + + + + org.apache.velocity + velocity-engine-core + + + + com.baomidou + mybatis-plus-generator + + + + com.jnpf + jnpf-visualdev-generater-entity + ${project.version} + compile + + + org.mybatis.dynamic-sql + mybatis-dynamic-sql + + + com.jnpf + jnpf-form-biz + ${project.version} + + + com.jnpf + jnpf-workflow-engine-biz + ${project.version} + + + + diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/mapper/FilterMapper.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/mapper/FilterMapper.java new file mode 100644 index 0000000..10fa9cf --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/mapper/FilterMapper.java @@ -0,0 +1,10 @@ +package jnpf.base.mapper; + +import jnpf.base.entity.FilterEntity; +import org.apache.ibatis.annotations.Mapper; +import org.springframework.stereotype.Repository; + +@Mapper +@Repository +public interface FilterMapper extends SuperMapper { +} \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/mapper/VisualdevMapper.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/mapper/VisualdevMapper.java new file mode 100644 index 0000000..ebd94ef --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/mapper/VisualdevMapper.java @@ -0,0 +1,17 @@ +package jnpf.base.mapper; + + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.base.entity.VisualdevEntity; + +/** + * + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @author JNPF开发平台组 + * @date 2021/3/16 + */ +public interface VisualdevMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/mapper/VisualdevReleaseMapper.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/mapper/VisualdevReleaseMapper.java new file mode 100644 index 0000000..8d25646 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/mapper/VisualdevReleaseMapper.java @@ -0,0 +1,17 @@ +package jnpf.base.mapper; + + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.base.entity.VisualdevReleaseEntity; + +/** + * + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @author JNPF开发平台组 + * @date 2021/3/16 + */ +public interface VisualdevReleaseMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/mapper/VisualdevShortLinkMapper.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/mapper/VisualdevShortLinkMapper.java new file mode 100644 index 0000000..59a5f4a --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/mapper/VisualdevShortLinkMapper.java @@ -0,0 +1,14 @@ +package jnpf.base.mapper; + +import jnpf.base.entity.VisualdevShortLinkEntity; + +/** + * 在线表单外链mapper + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/12/30 11:30:09 + */ +public interface VisualdevShortLinkMapper extends SuperMapper { +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/service/FilterService.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/service/FilterService.java new file mode 100644 index 0000000..5afca5e --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/service/FilterService.java @@ -0,0 +1,25 @@ +package jnpf.base.service; +import jnpf.base.entity.FilterEntity; +import jnpf.base.entity.VisualdevEntity; +import jnpf.base.model.filter.RuleInfo; +import org.mybatis.dynamic.sql.SqlTable; +import org.mybatis.dynamic.sql.select.QueryExpressionDSL; +import org.mybatis.dynamic.sql.select.SelectModel; + +import java.util.List; +import java.util.Map; + + +public interface FilterService extends SuperService { + void saveRuleList(String moduleId, VisualdevEntity visualdevEntity, Integer app, Integer pc, Map tableMap); + + void updateRuleList(String moduleId, VisualdevEntity columnData, Integer app, Integer pc, Map tableMap); + + + void handleWhereCondition(SqlTable sqlTable, QueryExpressionDSL.QueryExpressionWhereBuilder where, String id, Map subSqlTableMap, String databaseProductName, Map params); + + void handleWhereCondition(SqlTable sqlTable, QueryExpressionDSL.QueryExpressionWhereBuilder where, String id, Map subSqlTableMap, String databaseProductName); + + // 获取过滤配置 + List getCondition(String id); +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/service/VisualdevReleaseService.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/service/VisualdevReleaseService.java new file mode 100644 index 0000000..80ac738 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/service/VisualdevReleaseService.java @@ -0,0 +1,27 @@ +package jnpf.base.service; + + +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; +import jnpf.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import jnpf.base.entity.VisualdevReleaseEntity; +import jnpf.engine.entity.FlowTaskEntity; + +import java.util.List; + + +/** + * + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @author JNPF开发平台组 + * @date 2021/3/16 + */ +public interface VisualdevReleaseService extends SuperService { + + long beenReleased(String id); + + List selectorList(); + +} + diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/service/VisualdevService.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/service/VisualdevService.java new file mode 100644 index 0000000..b30f295 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/service/VisualdevService.java @@ -0,0 +1,76 @@ +package jnpf.base.service; + + +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; +import jnpf.base.entity.VisualdevEntity; +import jnpf.base.entity.VisualdevReleaseEntity; +import jnpf.base.model.PaginationVisualdev; +import jnpf.exception.WorkFlowException; + +import java.util.List; +import java.util.Map; + +/** + * + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @author JNPF开发平台组 + * @date 2021/3/16 + */ +public interface VisualdevService extends SuperService { + + List getList(PaginationVisualdev paginationVisualdev); + + List getPageList(PaginationVisualdev paginationVisualdev); + + List getList(); + + VisualdevEntity getInfo(String id); + + + /** + * 获取已发布的版本, 若未发布获取当前版本 + * @param id + * @return + */ + VisualdevEntity getReleaseInfo(String id); + + /** + * 获取动态设计子表名和实际库表名的对应 + * @param formData + * @return + */ + Map getTableMap(String formData); + + Boolean create(VisualdevEntity entity); + + boolean update(String id, VisualdevEntity entity) throws Exception; + + void delete(VisualdevEntity entity) throws WorkFlowException; + + /** + * 根据encode判断是否有相同值 + * @param encode + * @return + */ + Integer getObjByEncode (String encode, Integer type); + + /** + * 根据name判断是否有相同值 + * @param name + * @return + */ + Integer getCountByName (String name, Integer type); + + /** + * 无表生成有表 + * @param entity + */ + void createTable(VisualdevEntity entity) throws WorkFlowException; + + Map getTableNameToKey(String modelId); + + Boolean getPrimaryDbField(String linkId, String table) throws Exception; + + List selectorList(); +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/service/VisualdevShortLinkService.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/service/VisualdevShortLinkService.java new file mode 100644 index 0000000..c013414 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/service/VisualdevShortLinkService.java @@ -0,0 +1,14 @@ +package jnpf.base.service; + +import jnpf.base.entity.VisualdevShortLinkEntity; + +/** + * 在线表单外链service + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/12/30 11:30:57 + */ +public interface VisualdevShortLinkService extends SuperService { +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/service/impl/FilterServiceImpl.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/service/impl/FilterServiceImpl.java new file mode 100644 index 0000000..16fd43d --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/service/impl/FilterServiceImpl.java @@ -0,0 +1,188 @@ +package jnpf.base.service.impl; + +import cn.hutool.json.JSONUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import jnpf.base.entity.FilterEntity; +import jnpf.base.entity.VisualdevEntity; +import jnpf.base.mapper.FilterMapper; +import jnpf.base.model.filter.RuleInfo; +import jnpf.base.service.FilterService; +import jnpf.base.service.SuperServiceImpl; +import jnpf.base.util.OnlineFilterUtil; +import jnpf.database.util.DbTypeUtil; +import jnpf.database.util.DynamicDataSourceUtil; +import jnpf.util.JsonUtil; +import jnpf.util.RandomUtil; +import jnpf.util.context.RequestContext; +import org.apache.commons.lang3.StringUtils; +import org.mybatis.dynamic.sql.AndOrCriteriaGroup; +import org.mybatis.dynamic.sql.DerivedColumn; +import org.mybatis.dynamic.sql.SqlBuilder; +import org.mybatis.dynamic.sql.SqlTable; +import org.mybatis.dynamic.sql.select.QueryExpressionDSL; +import org.mybatis.dynamic.sql.select.SelectModel; +import org.mybatis.dynamic.sql.where.WhereModel; +import org.springframework.stereotype.Service; + +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; + +@Service +public class FilterServiceImpl extends SuperServiceImpl implements FilterService { + + @Override + public void saveRuleList(String moduleId, VisualdevEntity visualdevEntity, Integer app, Integer pc, Map tableMap) { + + String columnData = visualdevEntity.getColumnData(); + String appColumnData = visualdevEntity.getAppColumnData(); + + if (columnData == null || columnData.length() == 0) { + columnData = "{}"; + } + if (appColumnData == null || appColumnData.length() == 0) { + appColumnData = "{}"; + } + Map config = JsonUtil.getJsonToBean(columnData, Map.class); + String ruleList = JSONUtil.toJsonStr(config.get("ruleList")); + Map configApp = JsonUtil.getJsonToBean(appColumnData, Map.class); + String ruleListApp = JSONUtil.toJsonStr(configApp.get("ruleListApp")); + FilterEntity entity = new FilterEntity(); + entity.setId(RandomUtil.uuId()); + entity.setModuleId(moduleId); + replaceRealValue(app, pc, tableMap, ruleList, ruleListApp, entity); + entity.setCreatorTime(new Date()); + entity.setLastModifyTime(new Date()); + this.save(entity); + } + + @Override + public void updateRuleList(String moduleId, VisualdevEntity visualdevEntity, Integer app, Integer pc, Map tableMap) { + String columnData = visualdevEntity.getColumnData(); + String appColumnData = visualdevEntity.getAppColumnData(); + if (columnData == null || columnData.length() == 0) { + columnData = "{}"; + } + if (appColumnData == null || appColumnData.length() == 0) { + appColumnData = "{}"; + } + + Map config = JsonUtil.getJsonToBean(columnData, Map.class); + String ruleList = JSONUtil.toJsonStr(config.get("ruleList")); + Map configApp = JsonUtil.getJsonToBean(appColumnData, Map.class); + String ruleListApp = JSONUtil.toJsonStr(configApp.get("ruleListApp")); + + List list = this.getBaseMapper() + .selectList(new QueryWrapper().lambda().eq(FilterEntity::getModuleId, moduleId)); + if (list == null || list.size() == 0) { + this.saveRuleList(moduleId, visualdevEntity,app,pc, tableMap); + } else { + FilterEntity entity = list.get(0); + replaceRealValue(app, pc, tableMap, ruleList, ruleListApp, entity); + entity.setLastModifyTime(new Date()); + this.updateById(entity); + } + } + + /** + * 把子表的表名换成实际数据库表名 + * @param app 是否更新app配置 + * @param pc 是否更新pc配置 + * @param tableMap 虚拟表名和实际表名映射 + * @param ruleList pc配置 + * @param ruleListApp app配置 + * @param entity 更新的数据 + */ + private void replaceRealValue(Integer app, Integer pc, Map tableMap, String ruleList, String ruleListApp, FilterEntity entity) { + if(app == 1 && StringUtils.isNotBlank(ruleListApp)){ + for(String key : tableMap.keySet()){ + ruleListApp = ruleListApp.replaceAll(key,tableMap.get(key)); + } + + entity.setConfigApp(ruleListApp); + } + if(pc==1 && StringUtils.isNotBlank(ruleList)){ + for(String key : tableMap.keySet()){ + ruleList = ruleList.replaceAll(key,tableMap.get(key)); + } + entity.setConfig(ruleList); + } + } + + + @Override + public void handleWhereCondition(SqlTable sqlTable, QueryExpressionDSL.QueryExpressionWhereBuilder where, String id, Map subSqlTableMap, String databaseProductName, Map params) { + try { + DynamicDataSourceUtil.switchToDataSource(null); + List ruleInfos = this.getCondition(id); + + QueryExpressionDSL.QueryExpressionWhereBuilder whereFilter = SqlBuilder.select(sqlTable.allColumns()).from(sqlTable).where(); + + for (int i = 0; i < ruleInfos.size(); i++) { + RuleInfo info = ruleInfos.get(i); + OnlineFilterUtil genUtil = JsonUtil.getJsonToBean(info, OnlineFilterUtil.class); + genUtil.setDbType(DbTypeUtil.getDbEncodeByProductName(databaseProductName)); + genUtil.setSubSqlTableMap(subSqlTableMap); + genUtil.setParams(params); + genUtil.solveValue(whereFilter, sqlTable); + } + + Method method = whereFilter.getClass().getDeclaredMethod("buildWhereModel"); + method.setAccessible(true); + WhereModel invoke = (WhereModel) method.invoke(whereFilter); + List groupList = invoke.subCriteria(); + where.and(DerivedColumn.of("1"), SqlBuilder.isEqualTo(1), groupList); + + + } catch (Exception ignored) { + }finally { + DynamicDataSourceUtil.clearSwitchDataSource(); + } + + } + + /** + * 在线过滤查询 + * @param sqlTable + * @param where + * @param id + * @param subSqlTableMap + * @param databaseProductName + */ + @Override + public void handleWhereCondition(SqlTable sqlTable, QueryExpressionDSL.QueryExpressionWhereBuilder where, String id, Map subSqlTableMap, String databaseProductName) { + this.handleWhereCondition(sqlTable,where,id,subSqlTableMap,databaseProductName,null); + } + + /** + * 获取过滤配置 + * @param id + * @return + */ + @Override + public List getCondition(String id) { + if (StringUtils.isEmpty(id)) { + return new ArrayList<>(); + } + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().eq(FilterEntity::getModuleId, id); + FilterEntity entity = this.getOne(wrapper); + // 获取app端还是web端 + String config; + boolean isApp = !RequestContext.isOrignPc(); + if(isApp){ + config = entity.getConfigApp(); + }else{ + config = entity.getConfig(); + } + + List ruleInfos = new ArrayList<>(); + if(StringUtils.isNoneBlank(config)){ + ruleInfos = JsonUtil.getJsonToList(config, RuleInfo.class); + } + + return ruleInfos; + } +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/service/impl/VisualdevReleaseServiceImpl.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/service/impl/VisualdevReleaseServiceImpl.java new file mode 100644 index 0000000..ddf91c8 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/service/impl/VisualdevReleaseServiceImpl.java @@ -0,0 +1,44 @@ +package jnpf.base.service.impl; + + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; +import jnpf.base.entity.VisualdevReleaseEntity; +import jnpf.base.mapper.VisualdevReleaseMapper; +import jnpf.base.service.SuperServiceImpl; +import jnpf.base.service.VisualdevReleaseService; +import jnpf.engine.entity.FlowTaskEntity; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/3/16 + */ +@Service +public class VisualdevReleaseServiceImpl extends SuperServiceImpl implements VisualdevReleaseService { + + @Override + public long beenReleased(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(VisualdevReleaseEntity::getId, id); + return this.count(queryWrapper); + } + + @Override + public List selectorList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select( + VisualdevReleaseEntity::getId, + VisualdevReleaseEntity::getFullName, + VisualdevReleaseEntity::getWebType, + VisualdevReleaseEntity::getEnableFlow, + VisualdevReleaseEntity::getType, + VisualdevReleaseEntity::getCategory); + return this.list(queryWrapper); + } +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/service/impl/VisualdevServiceImpl.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/service/impl/VisualdevServiceImpl.java new file mode 100644 index 0000000..9994992 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/service/impl/VisualdevServiceImpl.java @@ -0,0 +1,424 @@ +package jnpf.base.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; +import jnpf.base.entity.VisualdevReleaseEntity; +import jnpf.base.model.PaginationVisualdev; +import jnpf.base.service.FilterService; +import jnpf.base.service.SuperServiceImpl; +import com.alibaba.fastjson.JSONArray; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import jnpf.base.entity.VisualdevEntity; +import jnpf.base.mapper.VisualdevMapper; +import jnpf.base.service.VisualdevReleaseService; +import jnpf.base.util.VisualFlowFormUtil; +import jnpf.database.model.dbfield.DbFieldModel; +import jnpf.database.model.dbtable.DbTableFieldModel; +import jnpf.database.util.TenantDataSourceUtil; +import jnpf.base.service.VisualdevService; +import jnpf.model.visualJson.FormCloumnUtil; +import jnpf.model.visualJson.FormDataModel; +import jnpf.model.visualJson.TableModel; +import jnpf.model.visualJson.analysis.RecursionForm; +import jnpf.model.visualJson.config.ConfigModel; +import jnpf.onlinedev.model.OnlineDevData; +import jnpf.engine.service.FlowTemplateService; +import jnpf.service.FlowFormService; +import jnpf.model.form.VisualTableModel; +import jnpf.exception.WorkFlowException; +import jnpf.model.visualJson.analysis.FormAllModel; +import jnpf.model.visualJson.FieLdsModel; +import jnpf.util.*; +import jnpf.util.visiual.JnpfKeyConsts; +import lombok.SneakyThrows; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/3/16 + */ +@Service +public class VisualdevServiceImpl extends SuperServiceImpl implements VisualdevService { + + @Autowired + private ConcurrencyUtils concurrencyVisualUtils; + @Autowired + private FlowFormService flowFormService; + @Autowired + private FlowTemplateService flowTemplateService; + @Autowired + private UserProvider userProvider; + @Autowired + private VisualDevTableCre visualDevTableCreUtil; + @Autowired + private ConcurrencyUtils concurrencyUtils; + @Autowired + private DbTableServiceImpl dbTableService; + @Autowired + private FilterService filterService; + @Autowired + private VisualdevReleaseService visualdevReleaseService; + @Autowired + private VisualFlowFormUtil visualFlowFormUtil; + + @Override + public List getList(PaginationVisualdev paginationVisualdev) { + // 定义变量判断是否需要使用修改时间倒序 + boolean flag = false; + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select(VisualdevEntity::getId,VisualdevEntity::getCategory,VisualdevEntity::getEnCode,VisualdevEntity::getFullName, + VisualdevEntity::getCreatorTime,VisualdevEntity::getCreatorUserId,VisualdevEntity::getLastModifyTime,VisualdevEntity::getLastModifyUserId, + VisualdevEntity::getEnableFlow,VisualdevEntity::getEnabledMark,VisualdevEntity::getSortCode,VisualdevEntity::getState,VisualdevEntity::getType, + VisualdevEntity::getWebType,VisualdevEntity::getVisualTables); + if (!StringUtil.isEmpty(paginationVisualdev.getKeyword())) { + flag = true; + queryWrapper.lambda().like(VisualdevEntity::getFullName, paginationVisualdev.getKeyword()); + } + queryWrapper.lambda().eq(VisualdevEntity::getType, paginationVisualdev.getType()); + if (StringUtil.isNotEmpty(paginationVisualdev.getCategory())) { + flag = true; + queryWrapper.lambda().eq(VisualdevEntity::getCategory, paginationVisualdev.getCategory()); + } + // 排序 + queryWrapper.lambda().orderByAsc(VisualdevEntity::getSortCode).orderByDesc(VisualdevEntity::getCreatorTime); + if (flag) { + queryWrapper.lambda().orderByDesc(VisualdevEntity::getLastModifyTime); + } + Page page = new Page<>(paginationVisualdev.getCurrentPage(), paginationVisualdev.getPageSize()); + IPage userPage = this.page(page, queryWrapper); + return paginationVisualdev.setData(userPage.getRecords(), page.getTotal()); + } + + @Override + public List getPageList(PaginationVisualdev paginationVisualdev) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (!StringUtil.isEmpty(paginationVisualdev.getKeyword())) { + queryWrapper.lambda().like(VisualdevReleaseEntity::getFullName, paginationVisualdev.getKeyword()); + } + if (ObjectUtil.isNotEmpty(paginationVisualdev.getType())) { + queryWrapper.lambda().eq(VisualdevReleaseEntity::getType, paginationVisualdev.getType()); + } + if (ObjectUtil.isNotEmpty(paginationVisualdev.getWebType())) { + queryWrapper.lambda().eq(VisualdevReleaseEntity::getWebType, paginationVisualdev.getWebType()); + } + if (ObjectUtil.isNotEmpty(paginationVisualdev.getEnableFlow())) { + queryWrapper.lambda().eq(VisualdevReleaseEntity::getEnableFlow, paginationVisualdev.getEnableFlow()); + } + if (StringUtil.isNotEmpty(paginationVisualdev.getCategory())) { + queryWrapper.lambda().eq(VisualdevReleaseEntity::getCategory, paginationVisualdev.getCategory()); + } + // 排序 + queryWrapper.lambda().orderByAsc(VisualdevReleaseEntity::getSortCode).orderByDesc(VisualdevReleaseEntity::getCreatorTime); + Page page = new Page<>(paginationVisualdev.getCurrentPage(), paginationVisualdev.getPageSize()); + IPage userPage = visualdevReleaseService.page(page, queryWrapper); + List list = JsonUtil.getJsonToList(userPage.getRecords(),VisualdevEntity.class); + return paginationVisualdev.setData(list, page.getTotal()); + } + + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().orderByAsc(VisualdevEntity::getSortCode).orderByDesc(VisualdevEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public VisualdevEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(VisualdevEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public VisualdevEntity getReleaseInfo(String id) { + VisualdevReleaseEntity visualdevReleaseEntity = visualdevReleaseService.getById(id); + VisualdevEntity visualdevEntity = null; + if(visualdevReleaseEntity != null){ + visualdevEntity = JsonUtil.getJsonToBean(visualdevReleaseEntity, VisualdevEntity.class); + } + if(visualdevEntity == null){ + visualdevEntity = getById(id); + } + return visualdevEntity; + } + + @Override + public Map getTableMap(String formData){ + Map tableMap = new HashMap<>(); + if(StringUtil.isEmpty(formData)){ + return tableMap; + } + FormDataModel formDataModel = JsonUtil.getJsonToBean(formData, FormDataModel.class); + String fields = formDataModel.getFields(); + List list = JsonUtil.getJsonToList(fields, FieLdsModel.class); + list.forEach(item->{ + this.solveTableName(item,tableMap); + }); + return tableMap; + } + + private void solveTableName(FieLdsModel item, Map tableMap){ + ConfigModel config = item.getConfig(); + if(config!=null){ + List children = config.getChildren(); + if("table".equals(config.getJnpfKey())){ + if(children!=null && children.size()>0 ){ + FieLdsModel fieLdsModel = children.get(0); + String parentVModel = item.getVModel(); + String relationTable = fieLdsModel.getConfig().getRelationTable(); + tableMap.put(parentVModel,relationTable); + } + } + if(children!=null){ + children.forEach( item2 ->{ + this.solveTableName(item2, tableMap); + }); + } + } + }; + + + @Override + @SneakyThrows + public Boolean create(VisualdevEntity entity) { + if (StringUtil.isEmpty(entity.getId())) { + entity.setId(RandomUtil.uuId()); + } + FormDataModel formDataModel = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + if (formDataModel != null) { + Map tableMap = this.getTableMap(entity.getFormData()); + // 保存app,pc过滤配置 + filterService.saveRuleList(entity.getId(),entity,1,1,tableMap); + //是否开启安全锁 + Boolean concurrencyLock = formDataModel.getConcurrencyLock(); + int primaryKeyPolicy = formDataModel.getPrimaryKeyPolicy(); + Boolean logicalDelete = formDataModel.getLogicalDelete(); + + //判断是否要创表 + List tableModels = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + //有表 + if (tableModels.size() > 0) { + List visualTables = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + TableModel mainTable = visualTables.stream().filter(f -> f.getTypeId().equals("1" )).findFirst().orElse(null); + + for (TableModel tableModel : visualTables) { + Boolean isAutoIncre = this.getPrimaryDbField(entity.getDbLinkId(), tableModel.getTable()); + // 1:雪花ID 2:自增ID + if(primaryKeyPolicy == 1){ + if (isAutoIncre != null && isAutoIncre) { + throw new WorkFlowException("主键策略:[雪花ID],表[ " + tableModel.getTable() + " ]主键设置不支持!" ); + } + }else if(primaryKeyPolicy == 2){ + if (isAutoIncre == null || !isAutoIncre) { + throw new WorkFlowException("主键策略:[自增ID],表[ " + tableModel.getTable() + " ]主键设置不支持!" ); + } + } + } + //在主表创建锁字段 + try { + if (logicalDelete && mainTable!=null) { + //在主表创建逻辑删除 + concurrencyUtils.creDeleteMark(mainTable.getTable(), entity.getDbLinkId()); + } + if (concurrencyLock) { + concurrencyUtils.createVersion(mainTable.getTable(), entity.getDbLinkId()); + } + if (entity.getEnableFlow() == 1) { + concurrencyUtils.createFlowTaskId(mainTable.getTable(), entity.getDbLinkId()); + } + concurrencyUtils.createFlowEngine(mainTable.getTable(), entity.getDbLinkId()); + } catch (Exception e) { + e.printStackTrace(); + System.out.println("创建锁字段失败" ); + e.printStackTrace(); + } + } + } + entity.setEnabledMark(0); + entity.setState(0); + entity.setCreatorTime(new Date()); + entity.setCreatorUserId(UserProvider.getLoginUserId()); + entity.setLastModifyTime(null); + entity.setLastModifyUserId(null); + // 启用流程 在表单新增一条 提供给流程使用 + if (OnlineDevData.STATE_ENABLE == entity.getEnableFlow() && entity.getType() < 3) { + visualFlowFormUtil.saveLogicFlowAndForm(entity); + } + this.removeById(entity.getId()); + return this.saveOrUpdate(entity); + } + + @Override + public boolean update(String id, VisualdevEntity entity) throws Exception { + entity.setId(id); + entity.setLastModifyUserId(userProvider.get().getUserId()); + boolean b = this.updateById(entity); + //代码生成修改时就要生成字段 + FormDataModel formDataModel = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + if (formDataModel != null) { + //是否开启安全锁 + Boolean concurrencyLock = formDataModel.getConcurrencyLock(); + Boolean logicalDelete = formDataModel.getLogicalDelete(); + int primaryKeyPolicy = formDataModel.getPrimaryKeyPolicy(); + //判断是否要创表 + List visualTables = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + //有表 + if (visualTables.size() > 0) { + if (formDataModel != null) { + try { + TableModel mainTable = visualTables.stream().filter(f -> f.getTypeId().equals("1" )).findFirst().orElse(null); + if (logicalDelete && mainTable != null) { + //在主表创建逻辑删除 + concurrencyUtils.creDeleteMark(mainTable.getTable(), entity.getDbLinkId()); + } + if (concurrencyLock) { + //在主表创建锁字段 + concurrencyUtils.createVersion(mainTable.getTable(), entity.getDbLinkId()); + } + if (primaryKeyPolicy == 2) { + concurrencyUtils.createFlowTaskId(mainTable.getTable(), entity.getDbLinkId()); + } + concurrencyUtils.createFlowEngine(mainTable.getTable(), entity.getDbLinkId()); + } catch (Exception e) { + e.printStackTrace(); + } + //判断自增是否匹配 + concurrencyUtils.checkAutoIncrement(primaryKeyPolicy,entity.getDbLinkId(),visualTables); + } + } + } + return b; + } + + @Override + public void delete(VisualdevEntity entity) throws WorkFlowException { + if (entity != null) { + //删除表单 + flowFormService.removeById(entity.getId()); + List ids = new ArrayList<>(); + ids.add(entity.getId()); + this.removeByIds(ids); + } + } + + @Override + public Integer getObjByEncode(String encode, Integer type) { + QueryWrapper visualWrapper = new QueryWrapper<>(); + visualWrapper.lambda().eq(VisualdevEntity::getEnCode, encode).eq(VisualdevEntity::getType, type); + Integer count = (int) this.count(visualWrapper); + return count; + } + + @Override + public Integer getCountByName(String name, Integer type) { + QueryWrapper visualWrapper = new QueryWrapper<>(); + visualWrapper.lambda().eq(VisualdevEntity::getFullName, name).eq(VisualdevEntity::getType, type); + Integer count = (int) this.count(visualWrapper); + return count; + } + + @Override + public void createTable(VisualdevEntity entity) throws WorkFlowException { + boolean isTenant = TenantDataSourceUtil.isTenantColumn(); + FormDataModel formDataModel = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + //是否开启安全锁 + Boolean concurrencyLock = formDataModel.getConcurrencyLock(); + int primaryKeyPolicy = formDataModel.getPrimaryKeyPolicy(); + Boolean logicalDelete = formDataModel.getLogicalDelete(); + + Map formMap = JsonUtil.stringToMap(entity.getFormData()); + List list = JsonUtil.getJsonToList(formMap.get("fields" ), FieLdsModel.class); + JSONArray formJsonArray = JsonUtil.getJsonToJsonArray(String.valueOf(formMap.get("fields" ))); + List visualTables = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + + List formAllModel = new ArrayList<>(); + RecursionForm recursionForm = new RecursionForm(); + recursionForm.setTableModelList(visualTables); + recursionForm.setList(list); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + + String tableName = "mt" + RandomUtil.uuId(); + + String dbLinkId = entity.getDbLinkId(); + VisualTableModel model = new VisualTableModel(formJsonArray, formAllModel, tableName, dbLinkId, entity.getFullName(), concurrencyLock, primaryKeyPolicy,logicalDelete); + List tableModelList = visualDevTableCreUtil.tableList(model); + + if (formDataModel != null) { + try { + TableModel mainTable = visualTables.stream().filter(f -> f.getTypeId().equals("1" )).findFirst().orElse(null); + if (OnlineDevData.STATE_ENABLE.equals(entity.getEnableFlow()) && mainTable != null) { + concurrencyUtils.createFlowEngine(mainTable.getTable(), entity.getDbLinkId()); + } + if (logicalDelete && mainTable != null) { + //在主表创建逻辑删除 + concurrencyUtils.creDeleteMark(mainTable.getTable(), entity.getDbLinkId()); + } + if (concurrencyLock) { + //在主表创建锁字段 + concurrencyUtils.createVersion(mainTable.getTable(), entity.getDbLinkId()); + } + if (entity.getEnableFlow() == 1) { + concurrencyUtils.createFlowTaskId(mainTable.getTable(), entity.getDbLinkId()); + } + if (isTenant) { + for (TableModel tableModel : visualTables) { + concurrencyUtils.createTenantId(tableModel.getTable(), entity.getDbLinkId()); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + } + formMap.put("fields" , formJsonArray); + //更新 + entity.setFormData(JsonUtil.getObjectToString(formMap)); + entity.setVisualTables(JsonUtil.getObjectToString(tableModelList)); + } + + @Override + public Map getTableNameToKey(String modelId) { + Map childKeyMap = new HashMap<>(); + VisualdevEntity info = this.getInfo(modelId); + FormDataModel formDataModel = JsonUtil.getJsonToBean(info.getFormData(), FormDataModel.class); + List fieLdsModels = JsonUtil.getJsonToList(formDataModel.getFields(), FieLdsModel.class); + List childFields = fieLdsModels.stream().filter(f -> JnpfKeyConsts.CHILD_TABLE.equals(f.getConfig().getJnpfKey())).collect(Collectors.toList()); + childFields.stream().forEach(c -> + childKeyMap.put(c.getConfig().getTableName().toLowerCase(), c.getVModel()) + ); + return childKeyMap; + } + + @Override + public Boolean getPrimaryDbField(String linkId, String table) throws Exception{ + DbTableFieldModel dbTableModel = dbTableService.getDbTableModel(linkId, table); + List data = dbTableModel.getDbFieldModelList(); + DbFieldModel dbFieldModel = data.stream().filter(DbFieldModel::getIsPrimaryKey).findFirst().orElse(null); + if (dbFieldModel != null){ + return dbFieldModel.getIsAutoIncrement() != null && dbFieldModel.getIsAutoIncrement(); + }else { + return null; + } + } + + @Override + public List selectorList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select( + VisualdevEntity::getId, + VisualdevEntity::getFullName, + VisualdevEntity::getWebType, + VisualdevEntity::getEnableFlow, + VisualdevEntity::getType, + VisualdevEntity::getCategory); + return this.list(queryWrapper); + } +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/service/impl/VisualdevShortLinkServiceImpl.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/service/impl/VisualdevShortLinkServiceImpl.java new file mode 100644 index 0000000..2df5b7e --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/service/impl/VisualdevShortLinkServiceImpl.java @@ -0,0 +1,19 @@ +package jnpf.base.service.impl; + +import jnpf.base.entity.VisualdevShortLinkEntity; +import jnpf.base.mapper.VisualdevShortLinkMapper; +import jnpf.base.service.SuperServiceImpl; +import jnpf.base.service.VisualdevShortLinkService; +import org.springframework.stereotype.Service; + +/** + * 在线表单外链service实现 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/12/30 11:31:45 + */ +@Service +public class VisualdevShortLinkServiceImpl extends SuperServiceImpl implements VisualdevShortLinkService { +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/OnlineFilterUtil.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/OnlineFilterUtil.java new file mode 100644 index 0000000..24f1951 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/OnlineFilterUtil.java @@ -0,0 +1,744 @@ +package jnpf.base.util; + +import com.alibaba.fastjson.JSONArray; +import jnpf.database.source.DbBase; +import jnpf.util.JsonUtil; +import jnpf.util.StringUtil; +import jnpf.util.visiual.JnpfKeyConsts; +import lombok.Data; +import org.apache.commons.lang3.StringUtils; +import org.mybatis.dynamic.sql.AndOrCriteriaGroup; +import org.mybatis.dynamic.sql.SqlBuilder; +import org.mybatis.dynamic.sql.SqlTable; +import org.mybatis.dynamic.sql.select.QueryExpressionDSL; +import org.mybatis.dynamic.sql.select.SelectModel; + +import java.math.BigDecimal; +import java.text.DecimalFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; + +@Data +public class OnlineFilterUtil { + /** + * 表字段名和对应的表对象映射 + */ + Map subSqlTableMap; + /** + * 额外参数 + */ + Map params; + /** + * 字段说明 + */ + private String fieldName; + /** + * 运算符 + */ + private String operator; + /** + * 逻辑拼接符号 + */ + private String logic; + /** + * 组件标识 + */ + private String jnpfKey; + /** + * 字段key + */ + private String field; + /** + * 自定义的值 + */ + private String fieldValue; + /** + * 自定义的值2 + */ + private String fieldValue2; + + private List selectIgnore; + + /** + * 显示类型 + */ + private String showLevel; + + + /** + * 数据库类型 + */ + private String dbType; + /** + * 日期格式 + */ + private String format; + + /** + * 数字精度 + */ + private String precision; + + /** + * @param where where对象 + * @param sqlTable sql表对象,默认传主表 + * @return + */ + public QueryExpressionDSL.QueryExpressionWhereBuilder solveValue(QueryExpressionDSL.QueryExpressionWhereBuilder where, SqlTable sqlTable) { + + if (!this.preHandle()) return where; + + + MyType myType = myControl(jnpfKey); + if (fieldValue == null) { + fieldValue = ""; + } + try { + ArrayList splitKey = new ArrayList() {{ + add(JnpfKeyConsts.DATE); + add(JnpfKeyConsts.TIME); + add(JnpfKeyConsts.NUM_INPUT); + add(JnpfKeyConsts.CREATETIME); + add(JnpfKeyConsts.MODIFYTIME); + }}; + + if (splitKey.contains(jnpfKey) && "between".equals(operator)) { + List data = JsonUtil.getJsonToList(fieldValue, String.class); + fieldValue = data.get(0); + fieldValue2 = data.get(1); + } + selectIgnore = new ArrayList() {{ + add(JnpfKeyConsts.COMSELECT); + add(JnpfKeyConsts.ADDRESS); + add(JnpfKeyConsts.CASCADER); + add(JnpfKeyConsts.CHECKBOX); + add(JnpfKeyConsts.DEPSELECT); + }}; + + + String fieldKey = ""; + // 替换子表的sqlTable + if (field.indexOf("-" ) > 0) { + fieldKey = field.split("-" )[0]; + sqlTable = this.subSqlTableMap.get(fieldKey); + field = field.split("-" )[1]; + } + // 替换副表的字段 + if (field.indexOf("_jnpf_" ) > 0) { + + sqlTable = this.subSqlTableMap.get(field); + field = field.split("_jnpf_" )[1]; + } + + + myType.judge(where, sqlTable, field); + return where; + } catch (Exception e) { + return where; + } + } + + /** + * 前置异常或边界情况处理 + */ + private boolean preHandle() { + if (params != null) { + // 判断是否只需处理子副表,忽略主表 + Boolean onlySubTable = (Boolean) params.get("onlySubTable" ); + // 如果是主表 + if (onlySubTable && !field.contains("_jnpf_" ) && !field.contains("-" )) { + return false; + } + // 不拼接副表 + if (onlySubTable && field.contains("_jnpf_" )) { + return false; + } + } + + return true; + } + + /** + * 判断控件的所属类型 + * + * @param jnpfKey 控件标识 + * @return 控件类型 + */ + public MyType myControl(String jnpfKey) { + MyType myType; + switch (jnpfKey) { + case JnpfKeyConsts.COM_INPUT: + case JnpfKeyConsts.TEXTAREA: + case JnpfKeyConsts.BILLRULE: + case JnpfKeyConsts.POPUPTABLESELECT: + case JnpfKeyConsts.RELATIONFORM: + case JnpfKeyConsts.RELATIONFORM_ATTR: + case JnpfKeyConsts.POPUPSELECT: + case JnpfKeyConsts.POPUPSELECT_ATTR: + myType = new BasicControl(); + break; + case JnpfKeyConsts.CALCULATE: + case JnpfKeyConsts.NUM_INPUT: + myType = new NumControl(); + break; + case JnpfKeyConsts.DATE: + case JnpfKeyConsts.CREATETIME: + case JnpfKeyConsts.MODIFYTIME: + myType = new DateControl(); + break; + case JnpfKeyConsts.TIME: + myType = new TimeControl(); + break; + default: + myType = new SelectControl(); + } + return myType; + } + + + /** + * 基础类型 + */ + class BasicControl extends MyType { + + @Override + void judge(QueryExpressionDSL.QueryExpressionWhereBuilder where, SqlTable sqlTable, String field) { + if ("&&".equals(logic)) { + switch (operator) { + case "null": + List group = new ArrayList<>(); + group.add(SqlBuilder.or(sqlTable.column(field), SqlBuilder.isEqualTo("" ))); + where.and(sqlTable.column(field), SqlBuilder.isNull(), group); + break; + case "notNull": + List group2 = new ArrayList<>(); + group2.add(SqlBuilder.and(sqlTable.column(field), SqlBuilder.isNotEqualTo("" ))); + where.and(sqlTable.column(field), SqlBuilder.isNotNull(), group2); + break; + case "==": + where.and(sqlTable.column(field), SqlBuilder.isEqualTo(fieldValue)); + break; + case "<>": + where.and(sqlTable.column(field), SqlBuilder.isNotEqualTo(fieldValue)); + break; + case "like": + convertSqlServerLike(); + where.and(sqlTable.column(field), SqlBuilder.isLike("%" + fieldValue + "%" )); + break; + case "notLike": + convertSqlServerLike(); + where.and(sqlTable.column(field), SqlBuilder.isNotLike("%" + fieldValue + "%" )); + break; + } + + } else { + switch (operator) { + case "null": + List group = new ArrayList<>(); + group.add(SqlBuilder.or(sqlTable.column(field), SqlBuilder.isEqualTo("" ))); + where.or(sqlTable.column(field), SqlBuilder.isNull(), group); + break; + case "notNull": + List group2 = new ArrayList<>(); + group2.add(SqlBuilder.and(sqlTable.column(field), SqlBuilder.isNotEqualTo("" ))); + where.or(sqlTable.column(field), SqlBuilder.isNotNull(), group2); + break; + case "==": + where.or(sqlTable.column(field), SqlBuilder.isEqualTo(fieldValue)); + break; + case "<>": + + where.or(sqlTable.column(field), SqlBuilder.isNotEqualTo(fieldValue)); + + break; + case "like": + convertSqlServerLike(); + where.or(sqlTable.column(field), SqlBuilder.isLike("%" + fieldValue + "%" )); + break; + case "notLike": + convertSqlServerLike(); + where.or(sqlTable.column(field), SqlBuilder.isNotLike("%" + fieldValue + "%" )); + break; + } + + + } + } + } + + class NumControl extends MyType { + @Override + void judge(QueryExpressionDSL.QueryExpressionWhereBuilder where, SqlTable sqlTable, String field) { + BigDecimal num1 = null; + BigDecimal num2 = null; + if(StringUtil.isNotEmpty(fieldValue)){ + num1 = new BigDecimal(fieldValue); + } + if (StringUtil.isNotEmpty(fieldValue2)) { + num2 = new BigDecimal(fieldValue2); + } + // 精度处理 + String fieldPrecisionValue; + String fieldPrecisionValue2; + if (StringUtils.isNotBlank(precision)) { + String zeroNum = "0." + StringUtils.repeat("0" , Integer.parseInt(precision)); + DecimalFormat numFormat = new DecimalFormat(zeroNum); + fieldPrecisionValue = numFormat.format(new BigDecimal(fieldValue)); + num1 = new BigDecimal(fieldPrecisionValue); + if (fieldValue2 != null) { + fieldPrecisionValue2 = numFormat.format(new BigDecimal(fieldValue2)); + num2 = new BigDecimal(fieldPrecisionValue2); + } + } + + if ("&&".equals(logic)) { + switch (operator) { + case "null": + List group = new ArrayList<>(); + where.and(sqlTable.column(field), SqlBuilder.isNull(), group); + break; + case "notNull": + List group2 = new ArrayList<>(); + where.and(sqlTable.column(field), SqlBuilder.isNotNull(), group2); + break; + case "==": + where.and(sqlTable.column(field), SqlBuilder.isEqualTo(num1)); + break; + case "<>": + + where.and(sqlTable.column(field), SqlBuilder.isNotEqualTo(num1)); + + break; + case ">": + where.and(sqlTable.column(field), SqlBuilder.isGreaterThan(num1)); + + break; + case "<": + where.and(sqlTable.column(field), SqlBuilder.isLessThan(num1)); + break; + case ">=": + where.and(sqlTable.column(field), SqlBuilder.isGreaterThanOrEqualTo(num1)); + break; + case "<=": + where.and(sqlTable.column(field), SqlBuilder.isLessThanOrEqualTo(num1)); + break; + case "between": + where.and(sqlTable.column(field), SqlBuilder.isGreaterThanOrEqualTo(num1)); + where.and(sqlTable.column(field), SqlBuilder.isLessThanOrEqualTo(num2)); + break; + } + } else { + switch (operator) { + case "null": + List group = new ArrayList<>(); + where.or(sqlTable.column(field), SqlBuilder.isNull(), group); + break; + case "notNull": + List group2 = new ArrayList<>(); + where.or(sqlTable.column(field), SqlBuilder.isNotNull(), group2); + break; + case "==": + where.or(sqlTable.column(field), SqlBuilder.isEqualTo(num1)); + break; + case "<>": + where.or(sqlTable.column(field), SqlBuilder.isNotEqualTo(num1)); + + break; + case ">": + where.or(sqlTable.column(field), SqlBuilder.isGreaterThan(num1)); + break; + case "<": + where.or(sqlTable.column(field), SqlBuilder.isLessThan(num1)); + break; + case ">=": + where.or(sqlTable.column(field), SqlBuilder.isGreaterThanOrEqualTo(num1)); + break; + case "<=": + where.or(sqlTable.column(field), SqlBuilder.isLessThanOrEqualTo(num1)); + break; + case "between": + where.or(sqlTable.column(field), SqlBuilder.isGreaterThanOrEqualTo(num1)); + where.and(sqlTable.column(field), SqlBuilder.isLessThanOrEqualTo(num2)); + break; + } + } + } + + + } + + class DateControl extends MyType { + @Override + void judge(QueryExpressionDSL.QueryExpressionWhereBuilder where, SqlTable sqlTable, String field) { + Long time = null; + Long time2 = null; + Date date = new Date(); + Date date2 = new Date(); + if (StringUtils.isNoneBlank(fieldValue)) { + time = Long.valueOf(fieldValue); + date = new Date(time); + } + if (StringUtils.isNoneBlank(fieldValue2)) { + time2 = Long.valueOf(fieldValue2); + // 日期类型的要加上当天的23:59:59 + if(JnpfKeyConsts.DATE.equals(jnpfKey)){ + date2 = new Date(time2+ 60 * 60 * 24 * 1000-1000); + }else{ + date2 = new Date(time2); + } + + } + + if ("&&".equals(logic)) { + switch (operator) { + case "null": + List group = new ArrayList<>(); + where.and(sqlTable.column(field), SqlBuilder.isNull(), group); + break; + case "notNull": + List group2 = new ArrayList<>(); + where.and(sqlTable.column(field), SqlBuilder.isNotNull(), group2); + break; + case "==": + where.and(sqlTable.column(field), SqlBuilder.isEqualTo(date)); + break; + case "<>": + where.and(sqlTable.column(field), SqlBuilder.isNotEqualTo(date)); + break; + case ">": + where.and(sqlTable.column(field), SqlBuilder.isGreaterThan(date)); + break; + case "<": + where.and(sqlTable.column(field), SqlBuilder.isLessThan(date)); + break; + case ">=": + where.and(sqlTable.column(field), SqlBuilder.isGreaterThanOrEqualTo(date)); + break; + case "<=": + where.and(sqlTable.column(field), SqlBuilder.isLessThanOrEqualTo(date)); + break; + case "between": + where.and(sqlTable.column(field), SqlBuilder.isGreaterThanOrEqualTo(date)); + where.and(sqlTable.column(field), SqlBuilder.isLessThanOrEqualTo(date2)); + break; + } + + + } else { + switch (operator) { + case "null": + List group = new ArrayList<>(); + where.or(sqlTable.column(field), SqlBuilder.isNull(), group); + break; + case "notNull": + List group2 = new ArrayList<>(); + where.or(sqlTable.column(field), SqlBuilder.isNotNull(), group2); + break; + case "==": + where.or(sqlTable.column(field), SqlBuilder.isEqualTo(date)); + break; + case "<>": + where.or(sqlTable.column(field), SqlBuilder.isNotEqualTo(date)); + break; + case ">": + where.or(sqlTable.column(field), SqlBuilder.isGreaterThan(date)); + break; + case "<": + where.or(sqlTable.column(field), SqlBuilder.isLessThan(date)); + break; + case ">=": + where.or(sqlTable.column(field), SqlBuilder.isGreaterThanOrEqualTo(date)); + break; + case "<=": + where.or(sqlTable.column(field), SqlBuilder.isLessThanOrEqualTo(date)); + break; + case "between": + where.or(sqlTable.column(field), SqlBuilder.isGreaterThanOrEqualTo(date)); + where.and(sqlTable.column(field), SqlBuilder.isLessThanOrEqualTo(date2)); + break; + } + + + } + } + + } + + class TimeControl extends MyType { + @Override + void judge(QueryExpressionDSL.QueryExpressionWhereBuilder where, SqlTable sqlTable, String field) { + if ("&&".equals(logic)) { + switch (operator) { + case "null": + List group = new ArrayList<>(); + where.and(sqlTable.column(field), SqlBuilder.isNull(), group); + break; + case "notNull": + List group2 = new ArrayList<>(); + where.and(sqlTable.column(field), SqlBuilder.isNotNull(), group2); + break; + case "==": + where.and(sqlTable.column(field), SqlBuilder.isEqualTo(fieldValue)); + break; + case "<>": + where.and(sqlTable.column(field), SqlBuilder.isNotEqualTo(fieldValue)); + break; + case ">": + where.and(sqlTable.column(field), SqlBuilder.isGreaterThan(fieldValue)); + break; + case "<": + where.and(sqlTable.column(field), SqlBuilder.isLessThan(fieldValue)); + break; + case ">=": + where.and(sqlTable.column(field), SqlBuilder.isGreaterThanOrEqualTo(fieldValue)); + break; + case "<=": + where.and(sqlTable.column(field), SqlBuilder.isLessThanOrEqualTo(fieldValue)); + break; + case "between": + where.and(sqlTable.column(field), SqlBuilder.isGreaterThanOrEqualTo(fieldValue)); + where.and(sqlTable.column(field), SqlBuilder.isLessThanOrEqualTo(fieldValue2)); + break; + } + + } else { + switch (operator) { + case "null": + List group = new ArrayList<>(); + where.or(sqlTable.column(field), SqlBuilder.isNull(), group); + break; + case "notNull": + List group2 = new ArrayList<>(); + where.or(sqlTable.column(field), SqlBuilder.isNotNull(), group2); + break; + case "==": + where.or(sqlTable.column(field), SqlBuilder.isEqualTo(fieldValue)); + break; + case "<>": + where.or(sqlTable.column(field), SqlBuilder.isNotEqualTo(fieldValue)); + break; + case ">": + where.or(sqlTable.column(field), SqlBuilder.isGreaterThan(fieldValue)); + break; + case "<": + where.or(sqlTable.column(field), SqlBuilder.isLessThan(fieldValue)); + break; + case ">=": + where.or(sqlTable.column(field), SqlBuilder.isGreaterThanOrEqualTo(fieldValue)); + break; + case "<=": + where.or(sqlTable.column(field), SqlBuilder.isLessThanOrEqualTo(fieldValue)); + break; + case "between": + where.or(sqlTable.column(field), SqlBuilder.isGreaterThanOrEqualTo(fieldValue)); + where.and(sqlTable.column(field), SqlBuilder.isLessThanOrEqualTo(fieldValue2)); + break; + } + + } + } + } + + /** + * 下拉控件类型 + */ + class SelectControl extends MyType { + @Override + void judge(QueryExpressionDSL.QueryExpressionWhereBuilder where, SqlTable sqlTable, String field) { + List list = new ArrayList<>(); + + if (selectIgnore.contains(jnpfKey) && StringUtils.isBlank(fieldValue)) { + fieldValue = "[]"; + } + if ("&&".equals(logic)) { + switch (operator) { + case "null": + List group = new ArrayList<>(); + if(!DbBase.ORACLE.equals(dbType)){ + group.add(SqlBuilder.or(sqlTable.column(field), SqlBuilder.isEqualTo(""))); + } + group.add(SqlBuilder.or(sqlTable.column(field), SqlBuilder.isEqualTo("[]"))); + where.and(sqlTable.column(field), SqlBuilder.isNull(), group); + break; + case "notNull": + List group2 = new ArrayList<>(); + if(!DbBase.ORACLE.equals(dbType)){ + group2.add(SqlBuilder.and(sqlTable.column(field), SqlBuilder.isNotEqualTo(""))); + } + group2.add(SqlBuilder.and(sqlTable.column(field), SqlBuilder.isNotEqualTo("[]"))); + where.and(sqlTable.column(field), SqlBuilder.isNotNull(), group2); + break; + case "==": + convertSqlServerLike(); + where.and(sqlTable.column(field), SqlBuilder.isLike(fieldValue)); + break; + case "<>": + where.and(sqlTable.column(field), SqlBuilder.isNotLike(fieldValue)); + break; + case "like": + convertSqlServerLike(); + where.and(sqlTable.column(field), SqlBuilder.isLike("%" + fieldValue + "%" )); + break; + case "notLike": + convertSqlServerLike(); + where.and(sqlTable.column(field), SqlBuilder.isNotLike("%" + fieldValue + "%" )); + break; + case "in": + List dataList = this.solveListValue(fieldValue); + if (dataList.size() > 0) { + List group3 = new ArrayList<>(); + String valueFirst = ""; + for (int i = 0; i < dataList.size(); i++) { + String value = dataList.get(i); + value = convertSqlServerLike(value); + AndOrCriteriaGroup condition = null; + if (i == 0) { + valueFirst = value; + } else { + condition = SqlBuilder.or(sqlTable.column(field), SqlBuilder.isLike("%" + value + "%" )); + group3.add(condition); + } + + } + where.and(sqlTable.column(field), SqlBuilder.isLike("%" + valueFirst + "%" ), group3); + } + if(JnpfKeyConsts.CASCADER.equals(jnpfKey) || JnpfKeyConsts.COMSELECT.equals(jnpfKey) || JnpfKeyConsts.ADDRESS.equals(jnpfKey)){ + where.and(sqlTable.column(field), SqlBuilder.isNotNull()); + where.and(sqlTable.column(field), SqlBuilder.isNotEqualTo("[]")); + } + break; + case "notIn": + List dataList2 = this.solveListValue(fieldValue); + if (dataList2.size() > 0) { + for (int i = 0; i < dataList2.size(); i++) { + String value = dataList2.get(i); + where.and(sqlTable.column(field), SqlBuilder.isNotLike("%" + value + "%" )); + } + } + if(JnpfKeyConsts.CASCADER.equals(jnpfKey) || JnpfKeyConsts.COMSELECT.equals(jnpfKey) || JnpfKeyConsts.ADDRESS.equals(jnpfKey)){ + where.and(sqlTable.column(field), SqlBuilder.isNotNull()); + where.and(sqlTable.column(field), SqlBuilder.isNotEqualTo("[]")); + } + break; + } + + } else { + + switch (operator) { + case "null": + List group = new ArrayList<>(); + if(!DbBase.ORACLE.equals(dbType)){ + group.add(SqlBuilder.or(sqlTable.column(field), SqlBuilder.isEqualTo(""))); + } + group.add(SqlBuilder.or(sqlTable.column(field), SqlBuilder.isEqualTo("[]"))); + where.or(sqlTable.column(field), SqlBuilder.isNull(), group); + break; + case "notNull": + List group2 = new ArrayList<>(); + if(!DbBase.ORACLE.equals(dbType)){ + group2.add(SqlBuilder.and(sqlTable.column(field), SqlBuilder.isNotEqualTo(""))); + } + group2.add(SqlBuilder.and(sqlTable.column(field), SqlBuilder.isNotEqualTo("[]"))); + where.or(sqlTable.column(field), SqlBuilder.isNotNull(), group2); + break; + case "==": + where.or(sqlTable.column(field), SqlBuilder.isEqualTo(fieldValue)); + break; + case "<>": + + where.or(sqlTable.column(field), SqlBuilder.isNotEqualTo(fieldValue)); + break; + case "like": + convertSqlServerLike(); + where.or(sqlTable.column(field), SqlBuilder.isLike("%" + fieldValue + "%" )); + break; + case "notLike": + convertSqlServerLike(); + where.or(sqlTable.column(field), SqlBuilder.isNotLike("%" + fieldValue + "%" )); + break; + case "in": + if (selectIgnore.contains(jnpfKey)) { + convertSqlServerLike(); + where.or(sqlTable.column(field), SqlBuilder.isLike(fieldValue)); + } else { + if (list.size() > 0) { + where.or(sqlTable.column(field), SqlBuilder.isIn(list)); + } + + } + if(JnpfKeyConsts.CASCADER.equals(jnpfKey) || JnpfKeyConsts.COMSELECT.equals(jnpfKey) || JnpfKeyConsts.ADDRESS.equals(jnpfKey)){ + where.and(sqlTable.column(field), SqlBuilder.isNotNull()); + where.and(sqlTable.column(field), SqlBuilder.isNotEqualTo("[]")); + } + break; + case "notIn": + if (selectIgnore.contains(jnpfKey)) { + List data = JsonUtil.getJsonToList(fieldValue, String.class); + if (data.size() > 0) { + where.or(sqlTable.column(field), SqlBuilder.isNotLike(data)); + } + + } else { + if (list != null && list.size() > 0) { + where.or(sqlTable.column(field), SqlBuilder.isNotIn(list)); + } + + } + if(JnpfKeyConsts.CASCADER.equals(jnpfKey) || JnpfKeyConsts.COMSELECT.equals(jnpfKey) || JnpfKeyConsts.ADDRESS.equals(jnpfKey)){ + where.and(sqlTable.column(field), SqlBuilder.isNotNull()); + where.and(sqlTable.column(field), SqlBuilder.isNotEqualTo("[]")); + } + break; + } + + } + } + + private ArrayList solveListValue(String fieldValue) { + ArrayList result = new ArrayList<>(); + try { + List list = JsonUtil.getJsonToList(fieldValue, List.class); + for (List listSub : list) { + result.add(JSONArray.toJSONString(listSub)); + // 组织选择需要取最后每个数组最后一个 + String value = (String)listSub.get(listSub.size() - 1); + result.add(value); + } + + }catch (Exception e){ + List list = JsonUtil.getJsonToList(fieldValue, String.class); + result.add(JSONArray.toJSONString(list)); + result.addAll(list); + } + return result; + } + + } + + private abstract class MyType { + abstract void judge(QueryExpressionDSL.QueryExpressionWhereBuilder where, SqlTable sqlTable, String field); + } + + /** + * SQLSERVER数据库 like括号语法 + * + * @param val + * @return + */ + private String convertSqlServerLike(String val) { + if (DbBase.SQL_SERVER.equals(dbType)) { + val = val.replaceAll("\\[" , "[[]" ); + } + return val; + } + + private void convertSqlServerLike() { + if (DbBase.SQL_SERVER.equals(dbType)) { + fieldValue = convertSqlServerLike(fieldValue); + } + } + + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/ReadFile.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/ReadFile.java new file mode 100644 index 0000000..1964f31 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/ReadFile.java @@ -0,0 +1,95 @@ +package jnpf.base.util; + +import jnpf.base.model.read.ReadEnum; +import jnpf.base.model.read.ReadListVO; +import jnpf.base.model.read.ReadModel; +import jnpf.util.FileUtil; +import jnpf.util.RandomUtil; +import lombok.Cleanup; +import lombok.extern.slf4j.Slf4j; + +import java.io.*; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/8/20 + */ +@Slf4j +public class ReadFile { + + + /** + * 预览代码 + * + * @param codePath + * @return + */ + public static List priviewCode(String codePath) { + File fileAll = new File(jnpf.util.XSSEscape.escapePath(codePath)); + List fileList = new ArrayList<>(); + if (fileAll.exists()) { + FileUtil.getFile(fileAll, fileList); + } + Map> data = new LinkedHashMap<>(); + for (int i = fileList.size() - 1; i >= 0; i--) { + File file = fileList.get(i); + String path = file.getAbsolutePath(); + ReadEnum readEnum = ReadEnum.getMessage(path); + if (readEnum != null) { + ReadModel readModel = new ReadModel(); + String fileContent = readFile(file); + readModel.setFileContent(fileContent); + readModel.setFileName(file.getName()); + readModel.setFileType(readEnum.getMessage()); + readModel.setId(RandomUtil.uuId()); + String folderName = FileUtil.getFileType(file); + readModel.setFolderName(folderName); + List readModelList = data.get(readEnum.getMessage()) != null ? data.get(readEnum.getMessage()) : new ArrayList<>(); + readModelList.add(readModel); + data.put(readEnum.getMessage(), readModelList); + } + } + List list = new ArrayList<>(); + for (String fileName : data.keySet()) { + ReadListVO listVO = new ReadListVO(); + listVO.setFileName(fileName); + listVO.setChildren(data.get(fileName)); + listVO.setId(RandomUtil.uuId()); + list.add(listVO); + } + return list; + } + + + /** + * 读取指定目录下的文件 + * + * @param path 文件的路径 + * @return 文件内容 + */ + private static String readFile(File path) { + String fileRead = ""; + try { + //创建一个输入流对象 + @Cleanup InputStream is = new FileInputStream(path); + @Cleanup ByteArrayOutputStream out = new ByteArrayOutputStream(); + byte[] buffer = new byte[1024]; + int n; + while ((n = is.read(buffer)) != -1) { + out.write(buffer, 0, n); + } + //释放资源 + is.close(); + fileRead = out.toString(); + } catch (IOException e) { + log.error("代码生成器读取文件报错:" + e.getMessage()); + } + return fileRead; + } +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/SourceUtil.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/SourceUtil.java new file mode 100644 index 0000000..c0b8c11 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/SourceUtil.java @@ -0,0 +1,49 @@ +package jnpf.base.util; + +import com.baomidou.mybatisplus.annotation.DbType; +import com.baomidou.mybatisplus.generator.config.DataSourceConfig; +import jnpf.database.source.DbBase; +import jnpf.database.source.impl.DbPostgre; +import jnpf.database.util.*; +import jnpf.util.StringUtil; +import jnpf.util.data.DataSourceContextHolder; + + +public class SourceUtil { + public static DataSourceConfig dbConfig(String dbName, DataSourceUtil linkEntity) { + if (linkEntity == null) { + if(TenantDataSourceUtil.isTenantAssignDataSource()){ + linkEntity = TenantDataSourceUtil.getTenantAssignDataSource(DataSourceContextHolder.getDatasourceId()).toDbLinkEntity(); + }else{ + linkEntity = DynamicDataSourceUtil.dataSourceUtil.init(); + } + if (!"PostgreSQL".equals(linkEntity.getDbType()) && StringUtil.isNotEmpty(dbName)) { + linkEntity.setDbName(dbName); + } + } + DataSourceConfig dsc = new DataSourceConfig(); + try { + DbBase dbBase = DbTypeUtil.getDb(linkEntity); + dsc.setDbType(dbBase.getMpDbType()); + dsc.setDriverName(dbBase.getDriver()); + dsc.setUsername(linkEntity.getUserName()); + dsc.setPassword(linkEntity.getPassword()); + dsc.setSchemaName(linkEntity.getDbSchema()); + + // oracle 默认 schema = username + if (dsc.getDbType().getDb().equalsIgnoreCase(DbType.ORACLE.getDb()) + || dsc.getDbType().getDb().equalsIgnoreCase(DbType.KINGBASE_ES.getDb())) { + dsc.setSchemaName(linkEntity.getUserName()); + } + //postgre默认 public + if (dsc.getDbType().getDb().equalsIgnoreCase(DbType.POSTGRE_SQL.getDb())) { + dsc.setSchemaName(DbPostgre.DEF_SCHEMA); + } + dsc.setUrl(ConnUtil.getUrl(linkEntity)); + } catch (Exception e) { + e.getStackTrace(); + } + return dsc; + } + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/VisualFlowFormUtil.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/VisualFlowFormUtil.java new file mode 100644 index 0000000..78494a4 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/VisualFlowFormUtil.java @@ -0,0 +1,290 @@ +package jnpf.base.util; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import jnpf.base.ActionResult; +import jnpf.base.entity.DictionaryDataEntity; +import jnpf.base.entity.DictionaryTypeEntity; +import jnpf.base.entity.VisualdevEntity; +import jnpf.base.service.DictionaryDataService; +import jnpf.base.service.DictionaryTypeService; +import jnpf.constant.MsgCode; +import jnpf.engine.entity.FlowTemplateEntity; +import jnpf.engine.entity.FlowTemplateJsonEntity; +import jnpf.engine.model.flowtemplate.FlowTemplateCrForm; +import jnpf.engine.model.flowtemplate.FlowTemplateInfoVO; +import jnpf.engine.service.FlowTemplateJsonService; +import jnpf.engine.service.FlowTemplateService; +import jnpf.entity.FlowFormEntity; +import jnpf.exception.WorkFlowException; +import jnpf.onlinedev.model.OnlineDevData; +import jnpf.service.FlowFormService; +import jnpf.util.JsonUtil; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import jnpf.util.enums.DictionaryDataEnum; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.*; + +/** + * 在线开发流程及表单相关方法 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/12/29 11:04:45 + */ +@Component +@Slf4j +public class VisualFlowFormUtil { + @Autowired + private FlowFormService flowFormService; + @Autowired + private FlowTemplateService flowTemplateService; + @Autowired + private FlowTemplateJsonService flowTemplateJsonService; + @Autowired + private DictionaryTypeService dictionaryTypeService; + @Autowired + private DictionaryDataService dictionaryDataService; + @Autowired + private UserProvider userProvider; + + /** + * 修改流程基本信息及状态 + * + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2022/12/29 + */ + public ActionResult saveOrUpdateFlowTemp(VisualdevEntity entity, Integer state, Boolean isSave) { + ActionResult result; + FlowTemplateCrForm flowTemplateCrForm = new FlowTemplateCrForm(); + BeanUtils.copyProperties(entity, flowTemplateCrForm); + flowTemplateCrForm.setFullName(entity.getFullName()); + flowTemplateCrForm.setEnCode(entity.getEnCode()); + flowTemplateCrForm.setId(entity.getId()); + flowTemplateCrForm.setType(OnlineDevData.FLOW_TYPE_DEV); + flowTemplateCrForm.setFormId(entity.getId()); + flowTemplateCrForm.setCategory(categaryMapping(entity.getCategory())); + if (flowTemplateService.isExistByFullName(flowTemplateCrForm.getFullName(), flowTemplateCrForm.getId())) { + return ActionResult.fail("流程名称不能重复"); + } + if (flowTemplateService.isExistByEnCode(flowTemplateCrForm.getEnCode(), flowTemplateCrForm.getId())) { + return ActionResult.fail("流程编码不能重复"); + } + try { + FlowTemplateEntity info = flowTemplateService.getById(entity.getId()); + if (info==null) { + FlowTemplateEntity creEntity = JsonUtil.getJsonToBean(flowTemplateCrForm, FlowTemplateEntity.class); + creEntity.setEnabledMark(OnlineDevData.STATE_DISABLE); + flowTemplateService.create(creEntity); + result = ActionResult.success("创建成功"); + } else { + FlowTemplateEntity creEntity = JsonUtil.getJsonToBean(flowTemplateCrForm, FlowTemplateEntity.class); + if(Objects.equals(state,OnlineDevData.STATE_ENABLE)){ + creEntity.setEnabledMark(OnlineDevData.STATE_ENABLE); + } + flowTemplateService.update(entity.getId(), creEntity); + result = ActionResult.success("修改成功"); + } + } catch (Exception e) { + result = ActionResult.fail("操作失败!"); + } + return result; + } + + /** + * 保存或修改流程表单信息 + * + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2022/12/29 + */ + public void saveOrUpdateForm(VisualdevEntity entity, int enabledMark, boolean isSave) throws WorkFlowException { + String userId = userProvider.get().getUserId(); + FlowFormEntity flowFormEntity = Optional.ofNullable(flowFormService.getById(entity.getId())).orElse(new FlowFormEntity()); + flowFormEntity.setId(entity.getId()); +// String copyNum = UUID.randomUUID().toString().substring(0, 5); + flowFormEntity.setEnCode(entity.getEnCode()); + flowFormEntity.setFullName(entity.getFullName()); + //功能流程(在线开发-自定义表单-隐藏) + flowFormEntity.setFlowType(OnlineDevData.FLOW_TYPE_DEV); + flowFormEntity.setFormType(OnlineDevData.FORM_TYPE_DEV); + if (entity.getType() == 4) {//功能系统表单,代码生成-功能系统表单 + flowFormEntity.setFormType(OnlineDevData.FORM_TYPE_SYS); + } + if (entity.getType() == 3) {//发起系统表单,代码生成-发起系统表单 + flowFormEntity.setFlowType(OnlineDevData.FLOW_TYPE_FLOW); + flowFormEntity.setFormType(OnlineDevData.FORM_TYPE_SYS); + } + flowFormEntity.setCategory(entity.getCategory()); + flowFormEntity.setPropertyJson(entity.getFormData()); + flowFormEntity.setDescription(entity.getDescription()); + flowFormEntity.setSortCode(entity.getSortCode()); + flowFormEntity.setEnabledMark(enabledMark); + if (isSave) { + flowFormEntity.setCreatorTime(new Date()); + flowFormEntity.setCreatorUserId(userId); + } else { + + flowFormEntity.setLastModifyTime(new Date()); + flowFormEntity.setLastModifyUserId(userId); + } + flowFormEntity.setTableJson(entity.getVisualTables()); + flowFormEntity.setDbLinkId(entity.getDbLinkId()); + flowFormEntity.setFlowId(entity.getId()); + //判断名称是否重复 + if (flowFormService.isExistByFullName(flowFormEntity.getFullName(), flowFormEntity.getId())) { + throw new WorkFlowException(MsgCode.EXIST001.get()); + } + //判断编码是否重复 + if (flowFormService.isExistByEnCode(flowFormEntity.getEnCode(), flowFormEntity.getId())) { + throw new WorkFlowException(MsgCode.EXIST002.get()); + } + flowFormService.saveOrUpdate(flowFormEntity); + } + + /** + * 删除流程引擎信息 + * + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2022/12/29 + */ + public void deleteTemplateInfo(String id) { + String msg = ""; + try { + FlowTemplateEntity entity = flowTemplateService.getInfo(id); + flowTemplateService.delete(entity); + } catch (Exception e) { + msg = e.getMessage(); + } + } + + /** + * 获取流程引擎信息 + * + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2022/12/29 + */ + public FlowTemplateInfoVO getTemplateInfo(String id) { + FlowFormEntity byId = flowFormService.getById(id); + FlowTemplateInfoVO vo = new FlowTemplateInfoVO(); + try { + vo = flowTemplateService.info(byId.getFlowId()); + } catch (Exception e) { + vo = null; + } + return vo; + } + + /** + * 获取字典相关列表 + * + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2022/12/29 + */ + public List getListByTypeDataCode(Integer type) { + return getListByTypeDataCode(DictionaryDataEnum.getTypeId(type)); + } + + /** + * 获取字典数据 + * + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2022/12/29 + */ + public DictionaryDataEntity getdictionaryDataInfo(String category) { + return dictionaryDataService.getInfo(category); + } + + /** + * 将在线开发分类字段转换成流程分类字段id + * + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2022/12/28 + */ + public String categaryMapping(String devCateId) { + //流程分类 + String flowCateId = ""; + try { + List flowDictionList = getListByTypeDataCode(DictionaryDataEnum.FLOWWOEK_ENGINE.getDictionaryTypeId()); + List devDictionList = getListByTypeDataCode(DictionaryDataEnum.VISUALDEV.getDictionaryTypeId()); + for (DictionaryDataEntity devItem : devDictionList) { + if (devItem.getId().equals(devCateId)) { + for (DictionaryDataEntity flowItem : flowDictionList) { + if (flowItem.getEnCode().equals(devItem.getEnCode())) { + flowCateId = flowItem.getId(); + } + if (StringUtil.isEmpty(flowCateId) && OnlineDevData.DEFAULT_CATEGATY_ENCODE.equals(flowItem.getEnCode())) {//没值,给默认 + flowCateId = flowItem.getId(); + } + } + } + } + } catch (Exception e) { + log.error("分类字段转换失败!:{}", e.getMessage()); + } + return flowCateId; + } + + /** + * 获取字典数据信息列表 + * + * @param typeCode 字典分类code + * @return + */ + public List getListByTypeDataCode(String typeCode) { + DictionaryTypeEntity dictionaryTypeEntity = dictionaryTypeService.getInfoByEnCode(typeCode); + List list = null; + if (dictionaryTypeEntity != null) { + list = dictionaryDataService.getList(dictionaryTypeEntity.getId()); + } + return list; + } + + /** + * 删除流程表单信息 + * + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2022/12/29 + */ + public void deleteFlowForm(String id) { + try { + flowFormService.removeById(id); + } catch (Exception e) { + } + } + + /** + * 逻辑删除恢复流程和表单 + * + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2022/12/29 + */ + public void saveLogicFlowAndForm(VisualdevEntity entity) throws WorkFlowException { + flowFormService.saveLogicFlowAndForm(entity.getId()); + flowTemplateService.saveLogicFlowAndForm(entity.getId()); + this.saveOrUpdateForm(entity, OnlineDevData.STATE_ENABLE, false); + this.saveOrUpdateFlowTemp(entity, OnlineDevData.STATE_DISABLE, false); + } +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/VisualUtil.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/VisualUtil.java new file mode 100644 index 0000000..6b84b6f --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/VisualUtil.java @@ -0,0 +1,448 @@ +package jnpf.base.util; + +import jnpf.base.entity.ModuleDataAuthorizeEntity; +import jnpf.base.entity.ModuleDataAuthorizeSchemeEntity; +import jnpf.base.entity.VisualdevEntity; +import jnpf.base.model.ColumnDataModel; +import jnpf.base.model.Template6.BtnData; +import jnpf.base.model.Template6.ColumnListField; +import jnpf.base.model.VisualDevPubModel; +import jnpf.base.model.VisualWebTypeEnum; +import jnpf.base.model.online.AuthFlieds; +import jnpf.base.model.online.PerColModels; +import jnpf.base.model.online.VisualMenuModel; +import jnpf.base.util.common.DataControlUtils; +import jnpf.constant.MsgCode; +import jnpf.emnus.SearchMethodEnum; +import jnpf.model.visualJson.*; +import jnpf.model.visualJson.analysis.FormAllModel; +import jnpf.model.visualJson.analysis.FormColumnModel; +import jnpf.model.visualJson.analysis.FormEnum; +import jnpf.model.visualJson.analysis.RecursionForm; +import jnpf.model.visualJson.config.ConfigModel; +import jnpf.permission.model.authorize.AuthorizeConditionEnum; +import jnpf.permission.model.authorize.ConditionModel; +import jnpf.util.JsonUtil; +import jnpf.util.RandomUtil; +import jnpf.util.StringUtil; +import jnpf.util.visiual.JnpfKeyConsts; +import org.apache.commons.lang3.StringUtils; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/3/16 + */ +public class VisualUtil { + + public static List symbol = new ArrayList(){{add("@userId");add("@organizeId");}}; + + /** + * @param entity + * @return + * @Description 删除F_, 且全转小写 + */ + public static VisualdevEntity delfKey(VisualdevEntity entity) { + + List list = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + + for (TableModel tableModel : list) { + List fields = tableModel.getFields(); + if (StringUtil.isNotEmpty(tableModel.getTableField()) && "f_".equalsIgnoreCase(tableModel.getTableField().substring(0, 2))) { + tableModel.setTableField(tableModel.getTableField().substring(2).toLowerCase()); + } + if (StringUtil.isNotEmpty(tableModel.getRelationField()) && "f_".equalsIgnoreCase(tableModel.getRelationField().substring(0, 2))) { + tableModel.setRelationField(tableModel.getRelationField().substring(2).toLowerCase()); + } + for (TableFields tableFields : fields) { + String feild = tableFields.getField().toLowerCase(); + if ("f_".equals(feild.substring(0, 2))) { + tableFields.setField(feild.substring(2).toLowerCase()); + } else { + tableFields.setField(feild.toLowerCase()); + } + tableModel.setFields(fields); + } + } + entity.setVisualTables(JsonUtil.getObjectToString(list)); + + //取出列表数据中的查询列表和数据列表 + Map columnDataMap = JsonUtil.stringToMap(entity.getColumnData()); + if (columnDataMap != null) { + for (Map.Entry entry : columnDataMap.entrySet()) { + if ("searchList".equals(entry.getKey())) { + List fieLdsModelList = JsonUtil.getJsonToList(entry.getValue(), FieLdsModel.class); + for (FieLdsModel fieLdsModel : fieLdsModelList) { + String vModel = fieLdsModel.getVModel().toLowerCase(); + String modelStr = fieLdsModel.getVModel(); + //去除F_ + if (!StringUtil.isEmpty(vModel) && "f_".equals(vModel.substring(0, 2))) { + fieLdsModel.setVModel(modelStr.substring(2).toLowerCase()); + } else if (!StringUtil.isEmpty(vModel)) { + fieLdsModel.setVModel(modelStr.toLowerCase()); + } + + } + entry.setValue(fieLdsModelList); + } + if ("columnList".equals(entry.getKey())) { + List columnListFields = JsonUtil.getJsonToList(entry.getValue(), ColumnListField.class); + for (ColumnListField columnListField : columnListFields) { + String prop = columnListField.getProp().toLowerCase(); + String modelStr = columnListField.getProp(); + //去除F_ + if (!StringUtil.isEmpty(prop) && "f_".equals(prop.substring(0, 2))) { + columnListField.setProp(modelStr.substring(2).toLowerCase()); + } else if (!StringUtil.isEmpty(prop)) { + columnListField.setProp(modelStr.toLowerCase()); + } + } + entry.setValue(columnListFields); + } + } + } + + entity.setColumnData(JsonUtil.getObjectToString(columnDataMap)); + + + Map formData = JsonUtil.stringToMap(entity.getFormData()); + + List modelList = JsonUtil.getJsonToList(formData.get("fields").toString(), FieLdsModel.class); + for (FieLdsModel fieLdsModel : modelList) { + //去除F_ + if (!StringUtil.isEmpty(fieLdsModel.getVModel())) { + if ("f_".equals(fieLdsModel.getVModel().substring(0, 2).toLowerCase())) { + String modelStr = fieLdsModel.getVModel(); + fieLdsModel.setVModel(modelStr.substring(2).toLowerCase()); + } else { + String modelStr = fieLdsModel.getVModel(); + fieLdsModel.setVModel(modelStr.toLowerCase()); + } + } + + ConfigModel configModel = fieLdsModel.getConfig(); + //子表 + if ("table".equals(configModel.getJnpfKey())) { + List childlist = JsonUtil.getJsonToList(configModel.getChildren(), FieLdsModel.class); + for (FieLdsModel childmodel : childlist) { + //前台界面的属性去掉前2个 + if (StringUtil.isNotEmpty(childmodel.getVModel())) { + if ("f_".equals(childmodel.getVModel().substring(0, 2).toLowerCase())) { + String vmodel = childmodel.getVModel().substring(2).toLowerCase(); + childmodel.setVModel(vmodel); + } else { + String vmodel = childmodel.getVModel().toLowerCase(); + childmodel.setVModel(vmodel); + } + } + } + fieLdsModel.getConfig().setChildren(childlist); + } + } + formData.put("fields", JsonUtil.getObjectToString(modelList)); + entity.setFormData(JsonUtil.getObjectToString(formData)); + + return entity; + } + + public static VisualMenuModel getVisual(VisualdevEntity visualdevEntity, VisualDevPubModel visualDevPubModel) { + VisualMenuModel visualMenuModel = new VisualMenuModel(); + visualMenuModel.setFullName(visualdevEntity.getFullName()); + visualMenuModel.setEncode(visualdevEntity.getEnCode()); + + if (!VisualWebTypeEnum.DATA_VIEW.getType().equals(visualdevEntity.getWebType())) {//数据视图不解析formdata + FormDataModel formDataModel = JsonUtil.getJsonToBean(visualdevEntity.getFormData(), FormDataModel.class); + //递归封装表单数据 + List formAllModel = new ArrayList<>(); + RecursionForm recursionForm = new RecursionForm(); + List tableModels = JsonUtil.getJsonToList(visualdevEntity.getVisualTables(), TableModel.class); + TableModel tableModel = tableModels.stream().filter(t -> t.getTypeId().equals("1")).findFirst().orElse(null); + recursionForm.setTableModelList(tableModels); + recursionForm.setList(JsonUtil.getJsonToList(formDataModel.getFields(), FieLdsModel.class)); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + + //主表数据 + List mast = formAllModel.stream().filter(t -> FormEnum.mast.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + //列表子表数据 + List mastTable = formAllModel.stream().filter(t -> FormEnum.mastTable.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + //子表 + List childTable = formAllModel.stream().filter(t -> FormEnum.table.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + + String mainTableName = tableModel.getTable(); + List allColumnDataList = new ArrayList<>(); + mast.stream().forEach(formModel -> { + String vModel = formModel.getFormColumnModel().getFieLdsModel().getVModel(); + String tableName = formModel.getFormColumnModel().getFieLdsModel().getConfig().getTableName(); + if (StringUtil.isNotEmpty(vModel)) { + String label = formModel.getFormColumnModel().getFieLdsModel().getConfig().getLabel(); + AuthFlieds authFlieds = AuthFlieds.builder().encode(vModel).fullName(label).status(false).rule(0).bindTableName(tableName) + .jnpfKey(formModel.getFormColumnModel().getFieLdsModel().getConfig().getJnpfKey()).build(); + allColumnDataList.add(authFlieds); + } + }); + mastTable.stream().forEach(formModel -> { + String vModel = formModel.getFormMastTableModel().getMastTable().getFieLdsModel().getVModel(); + String tableName = formModel.getFormMastTableModel().getMastTable().getFieLdsModel().getConfig().getTableName(); + if (StringUtil.isNotEmpty(vModel)) { + String label = formModel.getFormMastTableModel().getMastTable().getFieLdsModel().getConfig().getLabel(); + AuthFlieds authFlieds = AuthFlieds.builder().encode(vModel).fullName(label).status(false).rule(1).bindTableName(tableName) + .jnpfKey(formModel.getFormMastTableModel().getMastTable().getFieLdsModel().getConfig().getJnpfKey()).build(); + allColumnDataList.add(authFlieds); + } + }); + + childTable.stream().forEach(formModel -> { + String vModel = formModel.getChildList().getTableModel(); + String tableName = formModel.getChildList().getTableName(); + String label = formModel.getChildList().getLabel(); + if (StringUtil.isNotEmpty(vModel)) { + AuthFlieds authFlieds = AuthFlieds.builder().encode(vModel).fullName(label).status(false).rule(0).jnpfKey(formModel.getJnpfKey()).bindTableName(tableName).build(); + allColumnDataList.add(authFlieds); + } + List childList = formModel.getChildList().getChildList(); + for (FormColumnModel columnModel : childList) { + String childlabel = columnModel.getFieLdsModel().getConfig().getLabel(); + String childvModel = columnModel.getFieLdsModel().getVModel(); + if (StringUtil.isNotEmpty(childvModel)) { + AuthFlieds authFlieds = AuthFlieds.builder().encode(vModel + "-" + childvModel).fullName(label + "-" + childlabel).status(false).bindTableName(tableName).rule(2).childTableKey(vModel) + .jnpfKey(columnModel.getFieLdsModel().getConfig().getJnpfKey()).build(); + allColumnDataList.add(authFlieds); + } + } + }); + + //分配对应权限 + if (1 == visualDevPubModel.getPc()) { + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(visualdevEntity.getColumnData(), ColumnDataModel.class); + visualMenuModel.setPcPerCols(new PerColModels()); + if (Objects.nonNull(columnDataModel)) { + visualMenuModel.setPcPerCols(fillPermission(columnDataModel, allColumnDataList, true, mainTableName)); + } + } + + if (1 == visualDevPubModel.getApp()) { + ColumnDataModel appColumnDataModel = JsonUtil.getJsonToBean(visualdevEntity.getAppColumnData(), ColumnDataModel.class); + visualMenuModel.setAppPerCols(new PerColModels()); + if (Objects.nonNull(appColumnDataModel)) { + visualMenuModel.setAppPerCols(fillPermission(appColumnDataModel, allColumnDataList, false, mainTableName)); + } + } + } + + visualMenuModel.setFullName(visualdevEntity.getFullName()); + visualMenuModel.setEncode(visualdevEntity.getEnCode()); + visualMenuModel.setId(visualdevEntity.getId()); + return visualMenuModel; + } + + /** + * 填充权限字段 + * + * @param columnDataModel + * @param allColumnDataList + * @param isPC + * @return + */ + private static PerColModels fillPermission(ColumnDataModel columnDataModel, List allColumnDataList, Boolean isPC, String mainTable) { + PerColModels perColModel = new PerColModels(); + + List columnListFields = JsonUtil.getJsonToList(columnDataModel.getDefaultColumnList(), ColumnListField.class); + //副表正则 + String reg = "^[jnpf_]\\S*_jnpf\\S*"; + + //按钮 + if (columnDataModel.getUseBtnPermission()) { + perColModel.setButtonPermission(getAuthFiledList(isPC, columnDataModel)); + } + //列表 + if (columnDataModel.getUseColumnPermission() && columnListFields != null) { + List colAuthFileds = columnListFields.stream().map(col -> { + boolean matches = col.getProp().matches(reg); + String childTableKey = ""; + int rule = 0; + String tableName; + if (col.getConfig() == null) { + tableName = mainTable; + } else { + tableName = col.getConfig().getRelationTable() != null ? col.getConfig().getRelationTable() : StringUtil.isNotEmpty(col.getConfig().getTableName()) ? col.getConfig().getTableName() : mainTable; + } + if (matches) { + rule = 1; + } else { + rule = col.getProp().contains("tableField") ? 2 : 0; + childTableKey = col.getProp().contains("tableField") ? col.getProp().substring(0, col.getProp().indexOf("-")) : null; + } + return AuthFlieds.builder().encode(col.getProp()).fullName(col.getLabel()).status(col.getChecked()).rule(rule).bindTableName(tableName).childTableKey(childTableKey).build(); + }).collect(Collectors.toList()); + perColModel.setListPermission(colAuthFileds); + } + + //表单 + if (columnDataModel.getUseFormPermission()) { + List formAuthList = allColumnDataList.stream().map(colFlied -> { + return AuthFlieds.builder().encode(colFlied.getEncode()).fullName(colFlied.getFullName()).status(true).rule(colFlied.getRule()).childTableKey(colFlied.getChildTableKey()) + .bindTableName(colFlied.getBindTableName()).build(); + }).collect(Collectors.toList()); + perColModel.setFormPermission(formAuthList); + } + + + + + //数据权限 + if (columnDataModel.getUseDataPermission() && columnListFields != null) { + List dataAuthFileds = new LinkedList<>(); + List mainColFieldList = columnListFields.stream() + .filter(col -> !col.getProp().matches(reg) && !col.getProp().contains("tableField")).collect(Collectors.toList()); + //先取状态 +// mainColFieldList= mainColFieldList.stream().filter(field->field.getChecked()).collect(Collectors.toList()); + //去重 + mainColFieldList = mainColFieldList.stream().filter(DataControlUtils.distinctByKey(data -> data.getJnpfKey())).collect(Collectors.toList()); + for (ColumnListField field : mainColFieldList) { + String tableName = StringUtils.isNotEmpty(field.getConfig().getTableName()) ? field.getConfig().getTableName() : mainTable; + if (JnpfKeyConsts.CREATEUSER.equals(field.getJnpfKey())) { + AuthFlieds authFlied1 = AuthFlieds.builder().encode(field.getProp()).fullName(field.getLabel()).status(field.getChecked()).jnpfKey(field.getJnpfKey()).rule(0) + .bindTableName(tableName).AuthCondition(AuthorizeConditionEnum.USER.getCondition()).id(RandomUtil.uuId()).build(); + AuthFlieds authFlied2 = AuthFlieds.builder().encode(field.getProp()).fullName(field.getLabel()).status(field.getChecked()).jnpfKey(field.getJnpfKey()).rule(0) + .bindTableName(tableName).AuthCondition(AuthorizeConditionEnum.USERANDUNDER.getCondition()).id(RandomUtil.uuId()).build(); + dataAuthFileds.add(authFlied1); + dataAuthFileds.add(authFlied2); + } else if (JnpfKeyConsts.CURRORGANIZE.equals(field.getJnpfKey())) { + AuthFlieds authFlied1 = AuthFlieds.builder().encode(field.getProp()).fullName(field.getLabel()).status(field.getChecked()).bindTableName(tableName) + .jnpfKey(field.getJnpfKey()).rule(0).AuthCondition(AuthorizeConditionEnum.ORGANIZE.getCondition()) + .id(RandomUtil.uuId()).build(); + AuthFlieds authFlied2 = AuthFlieds.builder().encode(field.getProp()).fullName(field.getLabel()).status(field.getChecked()).bindTableName(tableName) + .jnpfKey(field.getJnpfKey()).rule(0).AuthCondition(AuthorizeConditionEnum.ORGANIZEANDUNDER.getCondition()) + .id(RandomUtil.uuId()).build(); + AuthFlieds authFlied3 = AuthFlieds.builder().encode(field.getProp()).fullName(field.getLabel()).status(field.getChecked()).bindTableName(tableName) + .jnpfKey(field.getJnpfKey()).rule(0).AuthCondition(AuthorizeConditionEnum.BRANCHMANAGEORG.getCondition()) + .id(RandomUtil.uuId()).build(); + dataAuthFileds.add(authFlied1); + dataAuthFileds.add(authFlied2); + dataAuthFileds.add(authFlied3); + } + } + perColModel.setDataPermission(dataAuthFileds); + //权限方案生成对象列表 + List schemeAuthList = new ArrayList<>(dataAuthFileds); + List dataPermissionScheme=new ArrayList<>(); + for (AuthFlieds authFlieds : schemeAuthList) { + String conditionSymbol = symbol.contains(authFlieds.getAuthCondition()) ? SearchMethodEnum.Equal.getSymbol() : SearchMethodEnum.Included.getSymbol(); + ModuleDataAuthorizeSchemeEntity schemeEntity = new ModuleDataAuthorizeSchemeEntity(); + schemeEntity.setFullName(getSchemeNameByCondition(authFlieds.getAuthCondition())); + schemeEntity.setEnCode(RandomUtil.uuId()); + SearchMethodEnum searchMethod = SearchMethodEnum.getSearchMethod(conditionSymbol); + String name = searchMethod!=null?searchMethod.getMessage(): ""; + String conditionText = "【{" + authFlieds.getFullName() + "} " + "{"+name+"}" + " {" + authFlieds.getAuthCondition() + "}" + "】"; + List conditionModels = new ArrayList<>(); + ConditionModel conditionModel = new ConditionModel(); + conditionModel.setLogic(SearchMethodEnum.And.getSymbol()); + ConditionModel.ConditionItemModel conditionItemModel = conditionModel.new ConditionItemModel(); + conditionItemModel.setField(authFlieds.getEncode()); + conditionItemModel.setId(authFlieds.getId()); + conditionItemModel.setOp(conditionSymbol); + conditionItemModel.setFieldRule(String.valueOf(authFlieds.getRule())); + conditionItemModel.setValue(authFlieds.getAuthCondition()); + conditionItemModel.setConditionText(authFlieds.getAuthCondition()); + conditionItemModel.setType("Varchar" ); + conditionItemModel.setBindTable(authFlieds.getBindTableName()); + List groups = new ArrayList<>(); + groups.add(conditionItemModel); + conditionModel.setGroups(groups); + conditionModels.add(conditionModel); + schemeEntity.setConditionJson(JsonUtil.getObjectToString(conditionModels)); + schemeEntity.setConditionText(conditionText); + schemeEntity.setEnabledMark(1); + schemeEntity.setDescription(authFlieds.getRule()+"_"+authFlieds.getEncode()+"_"+conditionSymbol); + schemeEntity.setMatchLogic("and");//添加方案时默认数据权限方案分组匹配逻辑为and + schemeEntity.setSortCode(-9527l); + dataPermissionScheme.add(schemeEntity); + } + //数据权限方案 + perColModel.setDataPermissionScheme(dataPermissionScheme); + } + return perColModel; + } + + /** + * 获取系统按钮集合 + * + * @param isPC 是否pc端 + * @return + */ + private static List getAuthFiledList(Boolean isPC, ColumnDataModel columnDataModel) { + List btnList = new ArrayList<>(6); + String btnValues = AuthPerConfirm(columnDataModel); + btnList.add(AuthFlieds.builder().fullName("新增").encode("btn_add").status(false).build()); + btnList.add(AuthFlieds.builder().fullName("编辑").encode("btn_edit").status(false).build()); + btnList.add(AuthFlieds.builder().fullName("删除").encode("btn_remove").status(false).build()); + btnList.add(AuthFlieds.builder().fullName("详情").encode("btn_detail").status(false).build()); + //pc端 按钮 + if (isPC) { + btnList.add(AuthFlieds.builder().fullName("导入").encode("btn_upload").status(false).build()); + btnList.add(AuthFlieds.builder().fullName("导出").encode("btn_download").status(false).build()); + btnList.add(AuthFlieds.builder().fullName("批量删除").encode("btn_batchRemove").status(false).build()); + btnList.add(AuthFlieds.builder().fullName("批量打印").encode("btn_batchPrint").status(false).build()); + } + btnList.stream().filter(btn -> btnValues.contains(btn.getEncode().replace("btn_", ""))).forEach(btn -> btn.setStatus(true)); + //自定义按钮区 + List CustomBtnList = JsonUtil.getJsonToList(columnDataModel.getCustomBtnsList(), BtnData.class); + if (Objects.nonNull(CustomBtnList)) { + List CustomBtnAuth = CustomBtnList.stream().map(cus -> AuthFlieds.builder().fullName(cus.getLabel()).encode(cus.getValue()).status(true).build()).collect(Collectors.toList()); + btnList.addAll(CustomBtnAuth); + } + return btnList; + } + + private static String AuthPerConfirm(ColumnDataModel columnDataModel) { + List btnDataList = new ArrayList<>(); + List BtnList = JsonUtil.getJsonToList(columnDataModel.getBtnsList(), BtnData.class); + List ColumnBtnList = JsonUtil.getJsonToList(columnDataModel.getColumnBtnsList(), BtnData.class); + + btnDataList.addAll(BtnList); + btnDataList.addAll(ColumnBtnList); + + String btnValue = btnDataList.stream().map(btn -> btn.getValue()).collect(Collectors.joining(",")); + return btnValue; + } + + /** + * 检验是否可发布 + * + * @param entity + * @param Action + * @return + */ + public static String checkPublishVisualModel(VisualdevEntity entity, String Action) { + String errorMsg = null; + FormDataModel formDataModel = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + errorMsg = formDataModel == null ? MsgCode.VS401.get() + Action + "!" : null; + if (VisualWebTypeEnum.FORM_LIST.getType().equals(entity.getWebType())) { + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(entity.getColumnData(), ColumnDataModel.class); + errorMsg = columnDataModel == null ? MsgCode.VS402.get() + Action + "!" : null; + } + return errorMsg; + } + + public static String getSchemeNameByCondition(String condition) { + String name = "default"; + if (AuthorizeConditionEnum.USER.getCondition().equals(condition)) { + name = "当前用户"; + } else if (AuthorizeConditionEnum.USERANDUNDER.getCondition().equals(condition)) { + name = "当前用户及下属"; + } else if (AuthorizeConditionEnum.ORGANIZE.getCondition().equals(condition)) { + name = "当前组织"; + } else if (AuthorizeConditionEnum.ORGANIZEANDUNDER.getCondition().equals(condition)) { + name = "当前组织及子组织"; + } else if (AuthorizeConditionEnum.BRANCHMANAGEORG.getCondition().equals(condition)) { + name = "当前分管组织"; + } else if (AuthorizeConditionEnum.BRANCHMANAGEORGANIZEUNDER.getCondition().equals(condition)) { + name = "当前分管组织及子组织"; + } + return name; + } +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/VisualUtils.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/VisualUtils.java new file mode 100644 index 0000000..1c9601e --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/VisualUtils.java @@ -0,0 +1,688 @@ +package jnpf.base.util; + + +import cn.afterturn.easypoi.excel.ExcelExportUtil; +import cn.afterturn.easypoi.excel.entity.ExportParams; +import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; +import cn.hutool.core.util.StrUtil; +import cn.xuyanwu.spring.file.storage.FileInfo; +import jnpf.base.entity.VisualdevEntity; +import jnpf.base.model.ColumnDataModel; +import jnpf.base.model.ExportSelectedModel; +import jnpf.base.model.Template6.ColumnListField; +import jnpf.base.vo.DownloadVO; +import jnpf.config.ConfigValueUtil; +import jnpf.database.model.dbtable.JdbcTableModel; +import jnpf.database.model.entity.DbLinkEntity; +import jnpf.database.model.interfaces.DbSourceOrDbLink; +import jnpf.database.util.ConnUtil; +import jnpf.database.util.DataSourceUtil; +import jnpf.exception.DataException; +import jnpf.model.visualJson.FieLdsModel; +import jnpf.model.visualJson.FormDataModel; +import jnpf.model.visualJson.config.HeaderModel; +import jnpf.util.*; +import jnpf.util.context.SpringContext; +import jnpf.util.visiual.JnpfKeyConsts; +import lombok.Cleanup; +import lombok.extern.slf4j.Slf4j; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.ss.usermodel.Workbook; +import org.springframework.web.multipart.MultipartFile; + +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 可视化工具类 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021年3月13日16:37:40 + */ +@Slf4j +public class VisualUtils { + + private static DataSourceUtil dataSourceUtil = SpringContext.getBean(DataSourceUtil.class); + private static ConfigValueUtil configValueUtil = SpringContext.getBean(ConfigValueUtil.class); + private static UserProvider userProvider = SpringContext.getBean(UserProvider.class); + private static FlowFormDataUtil flowFormDataUtil = SpringContext.getBean(FlowFormDataUtil.class); + + + /** + * 去除多级嵌套控件 + * + * @return + */ + public static List deleteMoreVmodel(FieLdsModel model) { + if ("".equals(model.getVModel()) && model.getConfig().getChildren() != null) { + List childModelList = JsonUtil.getJsonToList(model.getConfig().getChildren(), FieLdsModel.class); + return childModelList; + } + return null; + } + + public static List deleteMore(List modelList) { + List newModelList = new ArrayList<>(); + for (FieLdsModel model : modelList) { + List newList = deleteMoreVmodel(model); + if (newList == null || JnpfKeyConsts.CHILD_TABLE.equals(model.getConfig().getJnpfKey())) { + newModelList.add(model); + } else { + newModelList.addAll(deleteMore(newList)); + } + } + return newModelList; + } + + /** + * 返回主键名称 + * + * @param dbSourceOrDbLink + * @param mainTable + * @return + */ + public static String getpKey(DbSourceOrDbLink dbSourceOrDbLink, String mainTable) throws SQLException { + String pKeyName = "f_id"; + //catalog 数据库名 + String tmpKey = JdbcTableModel.getPrimary(dbSourceOrDbLink, mainTable); + if (StrUtil.isNotEmpty(tmpKey)) { + pKeyName = tmpKey; + } + return pKeyName; + } + + /** + * 获取有表的数据库连接 + * + * @return + */ + public static Connection getTableConn() { + String tenId; + if (!configValueUtil.isMultiTenancy()) { + tenId = dataSourceUtil.getDbName(); + } else { + if (!"PostgreSQL".equals(dataSourceUtil.getDbType())) { + tenId = userProvider.get().getTenantDbConnectionString(); + } else { + tenId = dataSourceUtil.getDbName(); + } + } + try { + return ConnUtil.getConn(dataSourceUtil, tenId); + } catch (DataException e) { + e.printStackTrace(); + } + return null; + } + + /** + * 判断主键是否为自增长 + * + * @param dbSourceOrDbLink + * @param table + * @param key + * @return + * @throws SQLException + */ + public static String primaryKeyTypeIsAuto(DbSourceOrDbLink dbSourceOrDbLink, String table, String key) throws SQLException { + Connection conn = ConnUtil.getConnOrDefault(dbSourceOrDbLink); + ResultSet rs = conn.getMetaData().getColumns(conn.getCatalog(), (String) null, table, key); + + String var3; + try { + if (!rs.next()) { + var3 = ""; + return var3; + } + + var3 = rs.getString("IS_AUTOINCREMENT"); + } finally { + if (Collections.singletonList(rs).get(0) != null) { + rs.close(); + } + + } + + return var3; + } + + /** + * 在线开发多数据源连接 + * + * @return + */ + public static Connection getDataConn(DbLinkEntity linkEntity) throws SQLException { + Connection conn = null; + try { + conn = ConnUtil.getConnOrDefault(linkEntity); + } catch (DataException e) { + e.printStackTrace(); + } + return conn; + } + + /** + * 导出在线开发的表格 + * + * @param visualdevEntity + * @param list + * @param keys + * @param sheetName + * @return + */ + public static DownloadVO createModelExcel(VisualdevEntity visualdevEntity, List> list, Collection keys, String sheetName) { + //判断sheetName + boolean SheetTitleWithField = !sheetName.equals("表单信息"); + DownloadVO vo = DownloadVO.builder().build(); + try { + //去除空数据 + List> dataList = new ArrayList<>(); + for (Map map : list) { + int i = 0; + for (String key : keys) { + //子表 + if (key.toLowerCase().startsWith(JnpfKeyConsts.CHILD_TABLE_PREFIX)) { + String tableField = key.substring(0, key.indexOf("-")); + String field = key.substring(key.indexOf("-") + 1); + Object o = map.get(tableField); + if (o != null) { + List> childList = (List>) o; + for (Map childMap : childList) { + if (childMap.get(field) != null) { + i++; + } + } + } + } else { + Object o = map.get(key); + if (o != null) { + i++; + } + } + } + if (i > 0) { + dataList.add(map); + } + } + + FormDataModel formDataModel = JsonUtil.getJsonToBean(visualdevEntity.getFormData(), FormDataModel.class); + List fieLdsModelList = JsonUtil.getJsonToList(formDataModel.getFields(), FieLdsModel.class); + //递归 + List allFields = new ArrayList<>(); + recursionFields(fieLdsModelList, allFields); + + Map mainMap = new HashMap<>(); + allFields.stream().filter(a -> !a.getConfig().getJnpfKey().equals(JnpfKeyConsts.CHILD_TABLE)).forEach(m -> mainMap.put(m.getVModel(), m.getConfig().getLabel())); + List childFields = allFields.stream().filter(a -> a.getConfig().getJnpfKey().equals(JnpfKeyConsts.CHILD_TABLE)).collect(Collectors.toList()); + //创建导出属性对象 + List child = new ArrayList<>(); + List allExportModelList = new ArrayList<>(); + for (String key : keys) { + ExportSelectedModel exportSelectedModel = new ExportSelectedModel(); + if (key.toLowerCase().startsWith(JnpfKeyConsts.CHILD_TABLE_PREFIX)) { + String tableField = key.substring(0, key.indexOf("-")); + String field = key.substring(key.indexOf("-") + 1); + exportSelectedModel.setTableField(tableField); + exportSelectedModel.setField(field); + child.add(exportSelectedModel); + } else { + exportSelectedModel.setField(key); + exportSelectedModel.setLabel(mainMap.get(key)); + allExportModelList.add(exportSelectedModel); + } + } + Map> childGroups = child.stream() + .collect(Collectors.groupingBy(ExportSelectedModel::getTableField, LinkedHashMap::new, Collectors.toList())); + List keyForIndex = new ArrayList<>(); + for (String key : keys) { + keyForIndex.add(key); + } + for (Map.Entry> entry : childGroups.entrySet()) { + String key = entry.getKey(); + List collect = keyForIndex.stream().filter(k -> k.startsWith(key)).collect(Collectors.toList()); + String s = keyForIndex.stream().filter(keyF -> keyF.startsWith(key)).findFirst().orElse(""); + int i = keyForIndex.indexOf(s); + keyForIndex.removeAll(collect); + List value = entry.getValue(); + FieLdsModel fieLdsModel = childFields.stream().filter(c -> c.getVModel().equals(key)).findFirst().orElse(null); + Map childMap = new HashMap<>(16); + fieLdsModel.getConfig().getChildren().stream().forEach(c -> childMap.put(c.getVModel(), c.getConfig().getLabel())); + value.stream().forEach(v -> + v.setLabel(childMap.get(v.getField())) + ); + ExportSelectedModel exportSelectedModel = new ExportSelectedModel(); + exportSelectedModel.setTableField(key); + exportSelectedModel.setSelectedModelList(value); + exportSelectedModel.setLabel(fieLdsModel.getConfig().getLabel()); + allExportModelList.add(i, exportSelectedModel); + } + + List entitys = new ArrayList<>(); + for (ExportSelectedModel selectModel : allExportModelList) { + ExcelExportEntity exportEntity; + if (StringUtil.isNotEmpty(selectModel.getTableField())) { + exportEntity = new ExcelExportEntity(selectModel.getLabel() + "(" + selectModel.getTableField() + ")" , selectModel.getTableField()); + //+"("+selectModel.getTableField()+"-"+m.getField()+")" + exportEntity.setList(selectModel.getSelectedModelList().stream().map(m -> new ExcelExportEntity(m.getLabel() + (SheetTitleWithField ? "(" + selectModel.getTableField() + "-" + m.getField() + ")" : "") + , m.getField())).collect(Collectors.toList())); + } else { + // +"("+selectModel.getField()+")" + exportEntity = new ExcelExportEntity(selectModel.getLabel() + (SheetTitleWithField ? "(" + selectModel.getField() + ")" : ""), selectModel.getField()); + } + entitys.add(exportEntity); + } + + if (sheetName.equals("错误报告")) { + entitys.add(new ExcelExportEntity("异常原因", "errorsInfo")); + } + + //复杂表头-表头和数据处理 + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(visualdevEntity.getColumnData(), ColumnDataModel.class); + List complexHeaderList = columnDataModel.getComplexHeaderList(); + if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) { + entitys = complexHeaderHandel(entitys, complexHeaderList); + dataList = complexHeaderDataHandel(dataList, complexHeaderList); + } + + ExportParams exportParams = new ExportParams(null, sheetName); + @Cleanup Workbook workbook = new HSSFWorkbook(); + if (entitys.size() > 0) { + if (dataList.size() == 0) { + dataList.add(new HashMap<>()); + } + workbook = ExcelExportUtil.exportExcel(exportParams, entitys, dataList); + } + String fileName = sheetName + DateUtil.dateNow("yyyyMMddHHmmss") + ".xls"; + MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName); + String temporaryFilePath = configValueUtil.getTemporaryFilePath(); + FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName); + vo.setName(fileInfo.getFilename()); + vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName); + } catch (Exception e) { + log.error("信息导出Excel错误:{}", e.getMessage()); + e.printStackTrace(); + } + return vo; + } + + public static void recursionFields(List fieLdsModelList, List allFields) { + for (FieLdsModel fieLdsModel : fieLdsModelList) { + if (JnpfKeyConsts.CHILD_TABLE.equals(fieLdsModel.getConfig().getJnpfKey())) { + allFields.add(fieLdsModel); + } else { + if (fieLdsModel.getConfig().getChildren() != null) { + recursionFields(fieLdsModel.getConfig().getChildren(), allFields); + } else { + if (StringUtil.isNotEmpty(fieLdsModel.getVModel())) { + allFields.add(fieLdsModel); + } + } + } + } + } + + /** + * 视图导出 + * + * @param visualdevEntity + * @param list + * @param keys + * @param sheetName + * @return + */ + public static DownloadVO createModelExcelApiData(VisualdevEntity visualdevEntity, List> list, Collection keys, String sheetName) { + + //判断sheetName + DownloadVO vo = DownloadVO.builder().build(); + try { + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(visualdevEntity.getColumnData(), ColumnDataModel.class); + List columnListAll = JsonUtil.getJsonToList(columnDataModel.getColumnList(), ColumnListField.class); + List entitys = new ArrayList<>(); + + for (ColumnListField selectModel : columnListAll) { + if (keys.contains(selectModel.getProp())) { + ExcelExportEntity exportEntity = new ExcelExportEntity(selectModel.getLabel()); + exportEntity.setKey(selectModel.getProp()); + exportEntity.setName(selectModel.getLabel()); + entitys.add(exportEntity); + } + } + + if (sheetName.equals("错误报告")) { + entitys.add(new ExcelExportEntity("异常原因", "errorsInfo")); + } + + //复杂表头-表头和数据处理 + List complexHeaderList = columnDataModel.getComplexHeaderList(); + if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) { + entitys = complexHeaderHandel(entitys, complexHeaderList); + list = complexHeaderDataHandel(list, complexHeaderList); + } + + ExportParams exportParams = new ExportParams(null, sheetName); + @Cleanup Workbook workbook = new HSSFWorkbook(); + if (entitys.size() > 0) { + if (list.size() == 0) { + list.add(new HashMap<>()); + } + workbook = ExcelExportUtil.exportExcel(exportParams, entitys, list); + } + String fileName = sheetName + DateUtil.dateNow("yyyyMMddHHmmss") + ".xls"; + MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName); + String temporaryFilePath = configValueUtil.getTemporaryFilePath(); + FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName); + vo.setName(fileInfo.getFilename()); + vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName); + } catch (Exception e) { + log.error("信息导出Excel错误:{}", e.getMessage()); + e.printStackTrace(); + } + return vo; + } + + /** + * @param mapList + * @return List> + * @Date 21:51 2020/11/11 + * @Description 将map中的所有key转化为小写 + */ + public static List> toLowerKeyList(List> mapList) { + List> newMapList = new ArrayList<>(); + for (Map map : mapList) { + Map resultMap = new HashMap(16); + Set sets = map.keySet(); + for (String key : sets) { + resultMap.put(key.toLowerCase(), map.get(key)); + } + newMapList.add(resultMap); + } + return newMapList; + } + + /** + * @param map + * @return + * @Description 删除模板字段下划线 + */ + public static Map toLowerKey(Map map) { + Map resultMap = new HashMap<>(16); + Set sets = map.keySet(); + for (String key : sets) { + resultMap.put(key.toLowerCase(), map.get(key)); + } + return resultMap; + } + + // /** +// * 审批流提交 +// * @param visualdevEntity +// * @param flowTaskId +// * @param formdata +// * @param userInfo +// */ +// public static void submitFlowTask(VisualdevEntity visualdevEntity, String flowTaskId, Object formdata, UserInfo userInfo, FlowModel flowModel) throws WorkFlowException { +// //审批流 +// if (visualdevEntity.getWebType().equals(VisualWebTypeEnum.FLOW_FROM.getType() )){ +// try { +// FlowEngineService flowEngineService = SpringContext.getBean(FlowEngineService.class); +// FlowEngineEntity flowEngineEntity = flowEngineService.getInfo(visualdevEntity.getFlowId()); +// FlowTaskService flowTaskService = SpringContext.getBean(FlowTaskService.class); +// FlowTaskNewService flowTaskNewService = SpringContext.getBean(FlowTaskNewService.class); +// FlowTaskEntity flowTaskEntity = flowTaskService.getInfoSubmit(flowTaskId, FlowTaskEntity::getId); +// String id = null; +// if (flowTaskEntity != null) { +// id = flowTaskEntity.getId(); +// } +// String flowTitle = userInfo.getUserName() +"的"+ visualdevEntity.getFullName(); +// String billNo ="#Visual"+ DateUtil.getNow(); +// flowModel.setId(id); +// flowModel.setFlowId(flowEngineEntity.getId()); +// flowModel.setProcessId(flowTaskId); +// flowModel.setFlowTitle(flowTitle); +// flowModel.setBillNo(billNo); +// Map data = JsonUtil.entityToMap(formdata); +// flowModel.setFormData(data); +// flowModel.setUserInfo(userInfo); +// flowTaskNewService.submit(flowModel); +// } catch (WorkFlowException e) { +// throw new WorkFlowException(e.getCode(),e.getMessage()); +// } +// } +// } + public static String exampleExcelMessage(FieLdsModel model) { + String message = ""; + String jnpfKey = model.getConfig().getJnpfKey(); + switch (jnpfKey) { + case JnpfKeyConsts.CREATEUSER: + case JnpfKeyConsts.MODIFYUSER: + case JnpfKeyConsts.CREATETIME: + case JnpfKeyConsts.MODIFYTIME: + case JnpfKeyConsts.CURRORGANIZE: + case JnpfKeyConsts.CURRPOSITION: + case JnpfKeyConsts.CURRDEPT: + case JnpfKeyConsts.BILLRULE: + message = "系统自动生成"; + break; + case JnpfKeyConsts.COMSELECT: + message = model.getMultiple() ? "例:引迈信息/产品部,引迈信息/技术部" : "例:引迈信息/技术部"; + break; + case JnpfKeyConsts.DEPSELECT: + message = model.getMultiple() ? "例:产品部/部门编码,技术部/部门编码" : "例:技术部/部门编码"; + break; + case JnpfKeyConsts.POSSELECT: + message = model.getMultiple() ? "例:技术经理/岗位编码,技术员/岗位编码" : "例:技术员/岗位编码"; + break; + case JnpfKeyConsts.USERSELECT: + message = model.getMultiple() ? "例:张三/账号,李四/账号" : "例:张三/账号"; + break; + case JnpfKeyConsts.CUSTOMUSERSELECT: + message = model.getMultiple() ? "例:方方/账号,技术部/部门编码" : "例:方方/账号"; + break; + case JnpfKeyConsts.ROLESELECT: + message = model.getMultiple() ? "例:研发人员/角色编码,测试人员/角色编码" : "例:研发人员/角色编码"; + break; + case JnpfKeyConsts.GROUPSELECT: + message = model.getMultiple() ? "例:A分组/分组编码,B分组/分组编码" : "例:A分组/分组编码"; + break; + case JnpfKeyConsts.DATE: + message = String.format("例: %s", model.getFormat()); + break; + case JnpfKeyConsts.TIME: +// message = "例: HH:mm:ss"; + message = String.format("例: %s", model.getFormat()); + break; + case JnpfKeyConsts.ADDRESS: + switch (model.getLevel()) { + case 0: + message = model.getMultiple() ? "例:福建省,广东省" : "例:福建省"; + break; + case 1: + message = model.getMultiple() ? "例:福建省/莆田市,广东省/广州市" : "例:福建省/莆田市"; + break; + case 2: + message = model.getMultiple() ? "例:福建省/莆田市/城厢区,广东省/广州市/荔湾区" : "例:福建省/莆田市/城厢区"; + break; + case 3: + message = model.getMultiple() ? "例:福建省/莆田市/城厢区/霞林街道,广东省/广州市/荔湾区/沙面街道" : "例:福建省/莆田市/城厢区/霞林街道"; + break; + default: + break; + } + break; + default: + break; + } + return message; + } + + /** + * 复杂表头表头处理--代码生成 + * + * @param dataList + * @param complexHeaderList + * @return + */ + public static List complexHeaderHandel(List dataList, List complexHeaderList) { + List complexHeaderListStr = new ArrayList<>(); + complexHeaderList.forEach(item -> complexHeaderListStr.addAll(item.getChildColumns())); + Map complexMap1 = new HashMap<>(); + List dataListRes = new ArrayList<>(); + int n = 0;//记录新数组下标用的,(dataListRes.add的地方就要n++) + for (HeaderModel item : complexHeaderList) { + complexMap1.put(item.getId(), n); + ExcelExportEntity export = new ExcelExportEntity(item.getFullName() + "(" + item.getId() + ")", item.getId()); + List list = new ArrayList<>(); + export.setList(list); + dataListRes.add(export); + n++; + } + for (ExcelExportEntity entity : dataList) { + if (complexHeaderListStr.contains(entity.getKey())) { + for (HeaderModel item : complexHeaderList) { + if (item.getChildColumns().contains(entity.getKey())) { + ExcelExportEntity export = dataListRes.get(complexMap1.get(item.getId())); + List list = export.getList() != null ? export.getList() : new ArrayList<>(); + list.add(entity); + export.setList(list); + dataListRes.set(complexMap1.get(item.getId()), export); + continue; + } + } + } else { + dataListRes.add(entity); + n++; + } + } + return dataListRes; + } + + /** + * 复杂表头数据处理 + * + * @param dataListRes + * @param complexHeaderList + * @return + */ + public static List> complexHeaderDataHandel(List> dataListRes, List complexHeaderList) { + List complexHeaderListStr = new ArrayList<>(); + complexHeaderList.forEach(item -> complexHeaderListStr.addAll(item.getChildColumns())); + List complexMap1 = new ArrayList<>(); + List> dataList = new ArrayList<>(dataListRes); + for (Map map : dataList) { + Set keyset = new HashSet<>(map.keySet()); + for (String key : keyset) { + if (complexHeaderListStr.contains(key)) { + for (HeaderModel item : complexHeaderList) { + if (item.getChildColumns().contains(key)) { + if (complexMap1.contains(item.getId())) { + List list1 = (List) map.get(item.getId()); + Map obj = list1 != null && list1.get(0) != null ? (Map) list1.get(0) : new HashMap<>(); + obj.put(key, map.get(key)); + map.put(item.getId(), new ArrayList() {{ + add(obj); + }}); + } else { + complexMap1.add(item.getId()); + Map obj = new HashMap<>(); + obj.put(key, map.get(key)); + map.put(item.getId(), new ArrayList() {{ + add(obj); + }}); + } + continue; + } + } + } + } + } + return dataList; + } + + /** + * 复杂表头表头处理--在线开发 + * + * @param dataList + * @param complexHeaderList + * @return + */ + public static List> complexHeaderHandelOnline(List> dataList, List complexHeaderList) { + List complexHeaderListStr = new ArrayList<>(); + complexHeaderList.forEach(item -> complexHeaderListStr.addAll(item.getChildColumns())); + List uploadColumn = dataList.stream().map(t -> t.get("id")).collect(Collectors.toList()); + Map complexMap1 = new HashMap<>(); + List> dataListRes = new ArrayList<>(); + int n = 0;//记录新数组下标用的,(dataListRes.add的地方就要n++) + for (HeaderModel item : complexHeaderList) { + if (item.getChildColumns().size() > 0) { + List complexHasColumn = item.getChildColumns().stream().filter(t -> uploadColumn.contains(t)).collect(Collectors.toList()); + //判断复杂表头的字段是否有可导入字段--没有的话不生成复杂表头 + if (complexHasColumn.size() > 0) { + complexMap1.put(item.getId(), n); + Map map = new HashMap<>(); + map.put("id", item.getId()); + map.put("fullName", item.getFullName()); + dataListRes.add(map); + n++; + } + } + } + for (Map entity : dataList) { + if (complexHeaderListStr.contains(entity.get("id"))) { + for (HeaderModel item : complexHeaderList) { + if (item.getChildColumns().contains(entity.get("id"))) { + Map map = dataListRes.get(complexMap1.get(item.getId())); + List> listmap = new ArrayList<>(); + if (map.get("children") == null) { + listmap.add(entity); + } else { + listmap = (List>) map.get("children"); + listmap.add(entity); + } + map.put("children", listmap); + dataListRes.set(complexMap1.get(item.getId()), map); + continue; + } + } + } else { + dataListRes.add(entity); + } + } + return dataListRes; + } + + /** + * 复杂表头数据导入处理--在线开发 + * + * @param dataList + * @param entity + * @return + */ + public static List> complexImportsDataOnline(List> dataList, VisualdevEntity entity) { + List> listRes = new ArrayList<>(); + //复杂表头-表头和数据处理 + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(entity.getColumnData(), ColumnDataModel.class); + List complexHeaderList = columnDataModel.getComplexHeaderList(); + if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) { + for (Map mapone : dataList) { + for (HeaderModel item : complexHeaderList) { + Object remove = mapone.remove(item.getId()); + if (remove != null) { + List> listC = (List>) remove; + if (listC.size() > 0) { + mapone.putAll(listC.get(0)); + } + } + } + listRes.add(mapone); + } + } else { + listRes = dataList; + } + return listRes; + } +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/app/AppGenModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/app/AppGenModel.java new file mode 100644 index 0000000..b496b10 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/app/AppGenModel.java @@ -0,0 +1,77 @@ +package jnpf.base.util.app; + +import jnpf.base.UserInfo; +import jnpf.base.entity.VisualdevEntity; +import jnpf.base.model.DownloadCodeForm; +import jnpf.database.model.entity.DbLinkEntity; +import jnpf.database.util.DataSourceUtil; +import jnpf.model.visualJson.FormDataModel; +import lombok.Data; + +/** + * + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @author JNPF开发平台组 + * @date 2021/10/25 + */ +@Data +public class AppGenModel { + /** + * 文件夹名字 + */ + private String fileName; + /** + * 实体对象 + */ + private VisualdevEntity entity; + /** + * 下载对象 + */ + private DownloadCodeForm downloadCodeForm; + /** + * 表单对象 + */ + private FormDataModel model; + /** + * 模板文件 + */ + private String templatePath; + /** + * 主键 + */ + private String pKeyName; + /** + * 本地数据源 + */ + private DataSourceUtil dataSourceUtil; + /** + * 数据连接 + */ + private DbLinkEntity linkEntity; + /** + * 个人信息 + */ + private UserInfo userInfo; + /** + * 生成文件名字 + */ + private String className; + /** + * 数据库表 + */ + private String table; + /** + * 生成路径 + */ + private String serviceDirectory; + /** + * 模板路径 + */ + private String templateCodePath; + + private Boolean groupTable; + + private String type; + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/app/AppGenUtil.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/app/AppGenUtil.java new file mode 100644 index 0000000..73a4aab --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/app/AppGenUtil.java @@ -0,0 +1,987 @@ +package jnpf.base.util.app; + +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.core.toolkit.StringPool; +import com.baomidou.mybatisplus.generator.InjectionConfig; +import com.baomidou.mybatisplus.generator.config.*; +import com.baomidou.mybatisplus.generator.config.po.TableField; +import com.baomidou.mybatisplus.generator.config.po.TableInfo; +import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy; +import com.google.common.base.CaseFormat; +import jnpf.base.UserInfo; +import jnpf.base.entity.VisualdevEntity; +import jnpf.base.model.ColumnDataModel; +import jnpf.base.model.DownloadCodeForm; +import jnpf.base.model.Template6.ColumnListField; +import jnpf.base.model.Template7.Template7Model; +import jnpf.base.model.VisualWebTypeEnum; +import jnpf.base.model.Template6.BtnData; +import jnpf.base.util.SourceUtil; +import jnpf.base.util.VisualUtils; +import jnpf.base.util.common.DataControlUtils; +import jnpf.base.util.common.FormCommonUtil; +import jnpf.base.util.custom.CustomGenerator; +import jnpf.database.model.entity.DbLinkEntity; +import jnpf.database.model.superQuery.SuperJsonModel; +import jnpf.database.util.DbTypeUtil; +import jnpf.database.util.TenantDataSourceUtil; +import jnpf.exception.DataException; +import jnpf.generater.model.GenBaseInfo; +import jnpf.generater.model.GenFileNameSuffix; +import jnpf.model.visualJson.*; +import jnpf.model.visualJson.analysis.*; +import jnpf.model.visualJson.config.ConfigModel; +import jnpf.util.DateUtil; +import jnpf.util.JsonUtil; +import jnpf.util.StringUtil; +import jnpf.util.XSSEscape; +import jnpf.util.visiual.JnpfKeyConsts; +import lombok.Cleanup; +import org.apache.commons.io.IOUtils; +import org.apache.velocity.Template; +import org.apache.velocity.VelocityContext; +import org.apache.velocity.app.Velocity; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.StringWriter; +import java.math.BigDecimal; +import java.sql.SQLException; +import java.util.*; +import java.util.stream.Collectors; + +public class AppGenUtil { + + + //+-----------------------------界面2021.8.13------------------------------------------------------------ + + public void htmlTemplates(AppGenModel appGenModel) { + Map map = new HashMap<>(16); + VisualdevEntity entity = appGenModel.getEntity(); + List formAllModel = new ArrayList<>(); + Map> tempMap = new HashMap<>(); + Map tableNameAll = this.forDataMode(appGenModel, formAllModel); + + FormDataModel model = appGenModel.getModel(); + String className = model.getClassName().substring(0, 1).toUpperCase() + model.getClassName().substring(1); + Template7Model templateModel = templateModel(appGenModel, className); + + List mast = this.mast(formAllModel); + List> child = new ArrayList<>(); + this.childModel(formAllModel, child, tableNameAll, tempMap); + + Map> mastListAll = this.mastTableModel(formAllModel, map, tableNameAll); + + this.templateJson(formAllModel, tempMap); + map.put("tempJson", tempMap); + map.put("moduleId", appGenModel.getEntity().getId()); + map.put("children", child); + map.put("groupTable", appGenModel.getGroupTable()); + map.put("type", appGenModel.getType()); + map.put("fields", mast); + map.put("genInfo", templateModel); + map.put("modelName", model.getClassName()); + map.put("package", "jnpf"); + map.put("isModel", "true"); + String modelPathName = model.getClassName().substring(0, 1).toLowerCase() + model.getClassName().substring(1); + map.put("modelPathName", modelPathName); + map.put("flowEnCode", entity.getEnCode()); + map.put("flowId", entity.getId()); + map.put("webType", entity.getWebType()); + map.put("isFlow", Objects.equals(entity.getEnableFlow(), 1)); + this.formData(map, appGenModel, formAllModel, tableNameAll); + + List getTemplate = this.getTemplate(appGenModel, false); + String path = templateModel.getServiceDirectory() + appGenModel.getFileName(); + + boolean type = this.isForm(appGenModel); + this.htmlTemplates(map, getTemplate, path, templateModel.getClassName(), modelPathName, !type); + + } + + + private void templateJson(List formAllModel, Map> tempMap) { + for (FormAllModel model : formAllModel) { + if (FormEnum.mast.getMessage().equals(model.getJnpfKey())) { + List templateJsonAll = new ArrayList<>(); + templateJsonAll.addAll(model.getFormColumnModel().getFieLdsModel().getConfig().getTemplateJson()); + List templateJsonModelList = JsonUtil.getJsonToList(model.getFormColumnModel().getFieLdsModel().getTemplateJson(), TemplateJsonModel.class); + templateJsonAll.addAll(templateJsonModelList); + String vModel = model.getFormColumnModel().getFieLdsModel().getVModel(); + for (TemplateJsonModel templateJsonModel : templateJsonAll) { + if (StringUtil.isNotEmpty(templateJsonModel.getRelationField())) { + Set fieldList = tempMap.get(templateJsonModel.getRelationField()) != null ? tempMap.get(templateJsonModel.getRelationField()) : new HashSet<>(); + fieldList.add(vModel); + tempMap.put(templateJsonModel.getRelationField().toLowerCase(), fieldList); + } + } + model.getFormColumnModel().getFieLdsModel().getConfig().setTemplateJson(templateJsonAll); + } + + if (FormEnum.mastTable.getMessage().equals(model.getJnpfKey())) { + List templateJsonAll = new ArrayList<>(); + templateJsonAll.addAll(model.getFormMastTableModel().getMastTable().getFieLdsModel().getConfig().getTemplateJson()); + List templateJsonModelList = JsonUtil.getJsonToList(model.getFormMastTableModel().getMastTable().getFieLdsModel().getTemplateJson(), TemplateJsonModel.class); + templateJsonAll.addAll(templateJsonModelList); + String vModel = model.getFormMastTableModel().getMastTable().getFieLdsModel().getVModel(); + for (TemplateJsonModel templateJsonModel : templateJsonAll) { + if (StringUtil.isNotEmpty(templateJsonModel.getRelationField())) { + Set fieldList = tempMap.get(templateJsonModel.getRelationField()) != null ? tempMap.get(templateJsonModel.getRelationField()) : new HashSet<>(); + fieldList.add(vModel); + tempMap.put(templateJsonModel.getRelationField().toLowerCase(), fieldList); + } + } + model.getFormMastTableModel().getMastTable().getFieLdsModel().getConfig().setTemplateJson(templateJsonAll); + } + } + } + + /** + * 获取模板 + * + * @param appGenModel + * @param isChild + * @return + */ + private List getTemplate(AppGenModel appGenModel, boolean isChild) { + List templates = this.getTemplate(appGenModel, isChild, false); + return templates; + } + + /** + * 获取模板 + * + * @param appGenModel + * @param isChild + * @return + */ + private List getTemplate(AppGenModel appGenModel, boolean isChild, boolean isMastTable) { + String template = this.tempPath(appGenModel); + VisualdevEntity entity = appGenModel.getEntity(); + boolean isType = !VisualWebTypeEnum.FORM.getType().equals(entity.getWebType()); + List templates = new ArrayList<>(); + templates.add(template + File.separator + "app" + File.separator + "form.vue.vm"); + if(!Objects.equals(entity.getType(),3)) { + //模板2 + if (VisualWebTypeEnum.FORM_LIST.getType().equals(entity.getWebType())) { + ColumnDataModel appColumnDataModel = JsonUtil.getJsonToBean(entity.getColumnData(), ColumnDataModel.class); + List columnBtnDataList = JsonUtil.getJsonToList(appColumnDataModel.getColumnBtnsList(), BtnData.class); + boolean detail = columnBtnDataList.stream().filter(t -> "detail".equals(t.getValue())).count() > 0; + if (entity.getEnableFlow() == 0 && isType && detail) { + templates.add(template + File.separator + "app" + File.separator + "detail.vue.vm"); + } + } + //除了模板4,其他都有index的模板 + boolean index = !(VisualWebTypeEnum.FORM.getType().equals(entity.getWebType()) && entity.getEnableFlow() != 1); + if (index) { + templates.add(template + File.separator + "app" + File.separator + "index.vue.vm"); + } + } + return templates; + } + + /** + * 获取文件名 + * + * @param path 路径 + * @param template 模板名称 + * @param className 文件名称 + * @return + */ + private String getFileNames(String path, String template, String className, String modePath, boolean isIndex) { + path = XSSEscape.escapePath(path); + modePath = XSSEscape.escapePath(modePath); + className = XSSEscape.escapePath(className); + String pathName = className.substring(0, 1).toLowerCase() + className.substring(1); + if (template.contains("index.vue.vm") || template.contains("detail.vue.vm")) { + String indexHtmlPath = path + File.separator + "html" + File.separator + "app"; + indexHtmlPath += isIndex ? File.separator + "index" + File.separator + pathName : File.separator + pathName; + File indexfile = new File(indexHtmlPath); + if (!indexfile.exists()) { + indexfile.mkdirs(); + } + className = template.contains("index.vue.vm") ? "index" : "detail"; + return indexHtmlPath + File.separator + className + ".vue"; + } + if (template.contains("form.vue.vm")) { + String formHtmlPath = path + File.separator + "html" + File.separator + "app"; + formHtmlPath += isIndex ? File.separator + "form" + File.separator + pathName : File.separator + pathName; + File formfile = new File(formHtmlPath); + if (!formfile.exists()) { + formfile.mkdirs(); + } + className = isIndex ? "index" : "form"; + return formHtmlPath + File.separator + className + ".vue"; + } + return null; + } + + /** + * 渲染html模板 + * + * @param path 路径 + * @param object 模板数据 + * @param path 模板路径 + */ + private void htmlTemplates(Object object, List templates, String path, String className, String modePath, boolean isIndex) { + //界面模板 + VelocityContext context = new VelocityContext(); + context.put("context", object); + for (String template : templates) { + // 渲染模板 + try { + @Cleanup StringWriter sw = new StringWriter(); + Template tpl = Velocity.getTemplate(template, Constants.UTF_8); + tpl.merge(context, sw); + String fileNames = getFileNames(path, template, className, modePath, isIndex); + if (fileNames != null) { + File file = new File(fileNames); + if (!file.exists()) { + file.createNewFile(); + } + @Cleanup FileOutputStream fos = new FileOutputStream(file); + IOUtils.write(sw.toString(), fos, Constants.UTF_8); + IOUtils.closeQuietly(sw); + IOUtils.closeQuietly(fos); + } + } catch (IOException e) { + e.printStackTrace(); + System.out.println("渲染模板失败,表名:" + e); + } + } + } + + /** + * 封装主表数据 + */ + private List mast(List formAllModel) { + List mast = formAllModel.stream().filter(t -> FormEnum.mast.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + //主表赋值 + for (int i = 0; i < mast.size(); i++) { + FieLdsModel fieLdsModel = mast.get(i).getFormColumnModel().getFieLdsModel(); + this.model(fieLdsModel); + String vmodel = fieLdsModel.getVModel(); + String jnpfKey = fieLdsModel.getConfig().getJnpfKey(); + if (StringUtil.isEmpty(vmodel)) { + mast.remove(i); + i--; + } + } + return mast; + } + + /** + * 封装mastTable数据 + */ + private Map> mastTableModel(List formAllModel, Map map, Map tableNameAll) { + List mastTable = formAllModel.stream().filter(t -> FormEnum.mastTable.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + Map> mastListAll = mastTable.stream().collect(Collectors.groupingBy(e -> e.getFormMastTableModel().getTable())); + Map mastTableNameAll = new HashMap<>(); + Map> mastTableList = new HashMap<>(); + //表单主表 + for (String mastkey : mastListAll.keySet()) { + List mastList = mastListAll.get(mastkey); + for (FormAllModel fieLdsList : mastList) { + FieLdsModel fieLdsModel = fieLdsList.getFormMastTableModel().getMastTable().getFieLdsModel(); + this.model(fieLdsModel); + } + mastListAll.put(mastkey, mastList); + String tableName = tableNameAll.get(mastkey); + String name = tableName.substring(0, 1).toUpperCase() + tableName.substring(1); + mastTableNameAll.put(mastkey, name); + mastTableList.put(tableName.toLowerCase(), mastList); + } + map.put("mastTableName", mastTableNameAll); + map.put("tableName", tableNameAll); + map.put("mastTable", mastTableList); + return mastListAll; + } + + /** + * 封装子表数据 + */ + private void childModel(List formAllModel, List> child, Map tableNameAll, Map> tempMap) { + List table = formAllModel.stream().filter(t -> FormEnum.table.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + for (FormAllModel formModel : table) { + FormColumnTableModel childList = formModel.getChildList(); + List thousandsField = new ArrayList<>(); + List summaryField = new ArrayList<>(); + String tableName = childList.getTableName(); + List summaryFieldAll = JsonUtil.getJsonToList(childList.getSummaryField(),String.class); + Integer addType = childList.getAddType(); + String name = tableNameAll.get(tableName); + String className = name.substring(0, 1).toUpperCase() + name.substring(1); + List tableList = childList.getChildList(); + for (int i = 0; i < tableList.size(); i++) { + FormColumnModel columnModel = tableList.get(i); + FieLdsModel fieLdsModel = columnModel.getFieLdsModel(); + model(fieLdsModel); + if(fieLdsModel.isThousands()) { + thousandsField.add(fieLdsModel.getVModel()); + } + if(!fieLdsModel.getConfig().getNoShow() && summaryFieldAll.contains(fieLdsModel.getVModel())){ + summaryField.add(fieLdsModel.getVModel()); + } + if (addType == 1) { + Object defaltValue = fieLdsModel.getConfig().getDefaultValue(); + if (defaltValue instanceof String) { + defaltValue = ""; + } else if (defaltValue instanceof BigDecimal) { + defaltValue = 0; + } else if (defaltValue instanceof List) { + defaltValue = new ArrayList<>(); + } + fieLdsModel.getConfig().setDefaultValue(defaltValue); + } + List templateJsonAll = new ArrayList<>(); + templateJsonAll.addAll(fieLdsModel.getConfig().getTemplateJson()); + List templateJsonModelList = JsonUtil.getJsonToList(fieLdsModel.getTemplateJson(), TemplateJsonModel.class); + templateJsonAll.addAll(templateJsonModelList); + for (TemplateJsonModel templateJsonModel : templateJsonAll) { + if (StringUtil.isNotEmpty(templateJsonModel.getRelationField())) { + String[] fieldList = templateJsonModel.getRelationField().split("-"); + if (fieldList.length > 1) { + templateJsonModel.setRelationField(className.toLowerCase() + "-" + fieldList[1]); + } + } + } + for (TemplateJsonModel templateJsonModel : templateJsonModelList) { + if (StringUtil.isNotEmpty(templateJsonModel.getRelationField())) { + String[] fieldList = templateJsonModel.getRelationField().split("-"); + if (fieldList.length > 1) { + templateJsonModel.setRelationField(className.toLowerCase() + "List-" + fieldList[1]); + } + } + } + fieLdsModel.setTemplateJson(JsonUtil.getObjectToString(templateJsonModelList)); + fieLdsModel.getConfig().setTemplateJson(templateJsonAll); + } + childList.setThousandsField(thousandsField); + childList.setSummaryField(JsonUtil.getObjectToString(summaryField)); + childList.setChildList(tableList); + Map childs = JsonUtil.entityToMap(childList); + childs.put("className", className); + childs.put("children", childList); + child.add(childs); + } + } + + /** + * 封装model数据 + */ + private void model(FieLdsModel fieLdsModel) { + ConfigModel configModel = fieLdsModel.getConfig(); + String jnpfKey = configModel.getJnpfKey(); + if (configModel.getDefaultValue() instanceof String) { + configModel.setValueType("String"); + } + if (configModel.getDefaultValue() == null) { + configModel.setValueType("undefined"); + if (JnpfKeyConsts.NUM_INPUT.equals(jnpfKey)) { + configModel.setDefaultValue(ObjectUtil.isNotEmpty(fieLdsModel.getMin()) ? fieLdsModel.getMin() : 0); + configModel.setValueType(null); + } + if (JnpfKeyConsts.ADDRESS.equals(jnpfKey)) { + configModel.setDefaultValue(new ArrayList<>()); + configModel.setValueType(null); + } + } + if (JnpfKeyConsts.SWITCH.equals(jnpfKey)) { + if (configModel.getDefaultValue() instanceof Boolean) { + Boolean defaultValue = (Boolean) configModel.getDefaultValue(); + configModel.setDefaultValue(defaultValue ? 1 : 0); + } + } + if (JnpfKeyConsts.TREESELECT.equals(jnpfKey)) { + configModel.setValueType(fieLdsModel.getMultiple() ? configModel.getValueType() : "undefined"); + } + fieLdsModel.setConfig(configModel); + } + + /** + * 封装表对应的输出名字 + */ + private Map tableName(List tableModelList, DownloadCodeForm downloadCodeForm) { + Map tableClass = new HashMap<>(16); + int i = 0; + for (TableModel tableModel : tableModelList) { + if ("0".equals(tableModel.getTypeId())) { + String[] subClassName = downloadCodeForm.getSubClassName().split(","); + tableClass.put(tableModel.getTable(), subClassName[i]); + i++; + } + } + return tableClass; + } + + /** + * 封装页面数据 + */ + private void formData(Map map, AppGenModel appGenModel, List formAllModel, Map tableNameAll) { + FormDataModel model = appGenModel.getModel(); + //界面 + map.put("module", model.getAreasName()); + map.put("className", model.getClassName().substring(0, 1).toUpperCase() + model.getClassName().substring(1)); + map.put("formRef", model.getFormRef()); + map.put("hasConfirmAndAddBtn", model.getHasConfirmAndAddBtn()); + map.put("formModel", model.getFormModel()); + map.put("size", model.getSize()); + map.put("labelPosition", model.getLabelPosition()); + map.put("labelWidth", model.getLabelWidth()); + map.put("formRules", model.getFormRules()); + map.put("gutter", model.getGutter()); + map.put("disabled", model.getDisabled()); + map.put("span", model.getSpan()); + map.put("formBtns", model.getFormBtns()); + map.put("idGlobal", model.getIdGlobal()); + map.put("popupType", model.getPopupType()); + map.put("form", formAllModel); + map.put("infoVO", "1"); + + //列表 + boolean isPage = this.isType(appGenModel); + if (isPage) { + List columnList = new ArrayList<>(); + String page = "1"; + String sort = ""; + String defaultSidx = ""; + int pageSize = 20; + boolean thousands = false; + SuperJsonModel ruleQueryJson = new SuperJsonModel(); + VisualdevEntity entity = appGenModel.getEntity(); + if (StringUtil.isNotEmpty(entity.getColumnData())) { + String columnData = entity.getColumnData(); + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class); + page = columnDataModel.getHasPage() ? "0" : "1"; + sort = columnDataModel.getSort(); + pageSize = columnDataModel.getPageSize(); + defaultSidx = columnDataModel.getDefaultSidx(); + thousands = columnDataModel.isThousands(); + this.columnData(formAllModel, columnDataModel, tableNameAll, map); + List btns = StringUtil.isNotEmpty(columnDataModel.getBtnsList()) ? JsonUtil.getJsonToList(columnDataModel.getBtnsList(), BtnData.class) : new ArrayList<>(); + columnList = StringUtil.isNotEmpty(columnDataModel.getColumnBtnsList()) ? JsonUtil.getJsonToList(columnDataModel.getColumnBtnsList(), BtnData.class) : new ArrayList<>(); + columnList.addAll(btns); + ruleQueryJson = columnDataModel.getRuleListApp(); + } + //合计千分位 + List mast = formAllModel.stream().filter(t -> FormEnum.mast.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + List mastTable = formAllModel.stream().filter(t -> FormEnum.mastTable.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + List thousandsField = FormCommonUtil.getSummaryThousandList(mast,mastTable, 4); + map.put("page", page); + map.put("sort", sort); + map.put("defaultSidx", defaultSidx); + map.put("pageSize", pageSize); + map.put("columnBtnsList", columnList); + map.put("thousands" , thousands); + map.put("thousandsField",JsonUtil.getObjectToString(thousandsField)); + map.put("ruleQueryJson", JSONObject.toJSONString(ruleQueryJson)); + } + //共用 + String pKeyName = appGenModel.getPKeyName(); + map.put("pKeyName", pKeyName); + } + + /** + * 封装列表数据 + */ + private void columnData(List formAllModel, ColumnDataModel columnDataModel, Map tableNameAll, Map map) { + List mast = formAllModel.stream().filter(t -> FormEnum.mast.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + List mastTable = formAllModel.stream().filter(t -> FormEnum.mastTable.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + //显示数据 + List columnListAll = JsonUtil.getJsonToList(columnDataModel.getColumnList(), ColumnListField.class); + Map> mastTableList = new HashMap<>(); + Map> childColumnList = new HashMap<>(); + List columnMastList = new ArrayList<>(); + for (ColumnListField columnList : columnListAll) { + String prop = columnList.getProp(); + FormAllModel model = mastTable.stream().filter(t -> t.getFormMastTableModel().getVModel().equals(prop)).findFirst().orElse(null); + if (model == null) { + String[] split = prop.split("-"); + if (split.length == 1) { + columnMastList.add(columnList); + } else { + List childList = childColumnList.get(split[0]) != null ? childColumnList.get(split[0]) : new ArrayList<>(); + String vModel = split[1]; + columnList.setVModel(vModel); + childList.add(columnList); + childColumnList.put(split[0], childList); + } + } else { + FormMastTableModel formMastTableModel = model.getFormMastTableModel(); + String tableName = formMastTableModel.getTable(); + List columnListList = mastTableList.get(tableName) != null ? mastTableList.get(tableName) : new ArrayList<>(); + model.setFormMastTableModel(formMastTableModel); + columnListList.add(model); + mastTableList.put(tableName, columnListList); + } + } + map.put("childColumnList", childColumnList); + map.put("columnList", columnMastList); + map.put("columnMastList", mastTableList); + map.put("AppColumnList", columnDataModel.getColumnList()); + //排序 + List sortListAll = JsonUtil.getJsonToList(columnDataModel.getSortList(), ColumnListField.class); + List sortList = new ArrayList<>(); + for (int i = 0; i < sortListAll.size(); i++) { + ColumnListField columnList = sortListAll.get(i); + String prop = columnList.getProp(); + FormAllModel model = mast.stream().filter(t -> prop.equals(t.getFormColumnModel().getFieLdsModel().getVModel())).findFirst().orElse(null); + if (model != null) { + sortList.add(columnList); + } + } + map.put("sortList", sortList); + boolean isSidx = sortList.stream().filter(t -> t.getProp().equals(columnDataModel.getDefaultSidx())).count() > 0; + if (isSidx) { + map.put("defaultSidx", columnDataModel.getDefaultSidx()); + } + //搜索 + List searchVOList = JsonUtil.getJsonToList(columnDataModel.getSearchList(), FieLdsModel.class); + List mastTableSearch = new ArrayList<>(); + List childSearch = new ArrayList<>(); + List mastSearch = new ArrayList<>(); + List> searchAll = new LinkedList<>(); + for (FieLdsModel columnSearch : searchVOList) { + List templateJsonAll = new ArrayList<>(); + ConfigModel config = columnSearch.getConfig(); + templateJsonAll.addAll(config.getTemplateJson()); + List templateJsonModelList = JsonUtil.getJsonToList(columnSearch.getTemplateJson(), TemplateJsonModel.class); + templateJsonAll.addAll(templateJsonModelList); + config.setTemplateJson(templateJsonAll); + Map column = new HashMap<>(); + String vmodel = columnSearch.getId(); + boolean isMast = mast.stream().filter(t -> vmodel.equals(t.getFormColumnModel().getFieLdsModel().getVModel())).count() > 0; + boolean isMastTable = mastTable.stream().filter(t -> vmodel.equals(t.getFormMastTableModel().getVModel())).count() > 0; + Object value = columnSearch.getValue(); + if (value instanceof String) { + config.setValueType("String"); + } + if (isMast) { + column.put("key", "mastSearch"); + mastSearch.add(columnSearch); + } else if (isMastTable) { + column.put("key", "mastTableSearch"); + mastTableSearch.add(columnSearch); + } else { + columnSearch.setVModel(vmodel.replaceAll("-", "_")); + column.put("key", "childSearch"); + childSearch.add(columnSearch); + } + column.put("html", columnSearch); + searchAll.add(column); + } + map.put("searchAll", searchAll); + map.put("searchList", mastTableSearch); + map.put("childSearch", childSearch); + map.put("mastsearchList", mastSearch); + map.put("useDataPermission", columnDataModel.getUseDataPermission() != null ? columnDataModel.getUseDataPermission() : false); + map.put("useBtnPermission", columnDataModel.getUseBtnPermission() != null ? columnDataModel.getUseBtnPermission() : false); + map.put("useFormPermission", columnDataModel.getUseFormPermission() != null ? columnDataModel.getUseFormPermission() : false); + map.put("useColumnPermission", columnDataModel.getUseColumnPermission() != null ? columnDataModel.getUseColumnPermission() : false); + } + + + //----------------------------代码------------------------------------------------------- + + /** + * 生成表集合 + * + * @param appGenModel 对象 + * @throws SQLException + */ + public void generate(AppGenModel appGenModel) throws SQLException { + VisualdevEntity entity = appGenModel.getEntity(); + List list = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + DownloadCodeForm downloadCodeForm = appGenModel.getDownloadCodeForm(); + List tableModelList = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + Map tableNameAll = this.tableName(tableModelList, downloadCodeForm); + //生成代码 + for (TableModel model : list) { + String table = model.getTable(); + appGenModel.setTable(table); + if ("1".equals(model.getTypeId())) { + appGenModel.setClassName(downloadCodeForm.getClassName()); + this.setCode(appGenModel); + } else if ("0".equals(model.getTypeId())) { + String name = tableNameAll.get(table); + String className = name.substring(0, 1).toUpperCase() + name.substring(1); + appGenModel.setClassName(className); + this.childTable(appGenModel); + } + } + } + + /** + * 生成主表 + * + * @param appGenModel 对象 + * @throws SQLException + */ + private void setCode(AppGenModel appGenModel) throws SQLException { + DownloadCodeForm downloadCodeForm = appGenModel.getDownloadCodeForm(); + //tableJson + Map columndata = new HashMap<>(16); + String className = downloadCodeForm.getClassName().substring(0, 1).toUpperCase() + downloadCodeForm.getClassName().substring(1); + Template7Model model = this.templateModel(appGenModel, className); + this.columData(columndata, appGenModel, model); + DbLinkEntity linkEntity = appGenModel.getLinkEntity(); + columndata.put("DSId", linkEntity != null ? linkEntity.getId() : "master"); + try { + // 判断当前数据库类型 + columndata.put("dbType", DbTypeUtil.getDb(appGenModel.getDataSourceUtil()).getJnpfDbEncode()); + } catch (DataException e) { + e.printStackTrace(); + } + this.javaGenerate(columndata, model, appGenModel, true); + } + + /** + * 生成子表 + * + * @param appGenModel 封装对象 + */ + private void childTable(AppGenModel appGenModel) { + Template7Model model = this.templateModel(appGenModel, appGenModel.getClassName()); + Map columndata = new HashMap<>(16); + columndata.put("genInfo", model); + DbLinkEntity linkEntity = appGenModel.getLinkEntity(); + columndata.put("DSId", linkEntity != null ? linkEntity.getId() : "master"); + this.javaGenerate(columndata, model, appGenModel, false); + } + + /** + * 封装数据 + * + * @param appGenModel + * @param className + * @return + */ + private Template7Model templateModel(AppGenModel appGenModel, String className) { + DownloadCodeForm downloadCodeForm = appGenModel.getDownloadCodeForm(); + Template7Model template7Model = new Template7Model(); + template7Model.setClassName(className); + template7Model.setServiceDirectory(appGenModel.getServiceDirectory()); + template7Model.setCreateDate(DateUtil.daFormat(new Date())); + template7Model.setCreateUser(GenBaseInfo.AUTHOR); + template7Model.setCopyright(GenBaseInfo.COPYRIGHT); + template7Model.setDescription(downloadCodeForm.getDescription()); + return template7Model; + } + + /** + * 封装数据 + * + * @param formAllModel + */ + private Map forDataMode(AppGenModel appGenModel, List formAllModel) { + VisualdevEntity entity = appGenModel.getEntity(); + //formTempJson + FormDataModel formData = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + List tableModelList = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + RecursionForm recursionForm = new RecursionForm(list, tableModelList); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + Map tableNameAll = this.tableName(tableModelList, appGenModel.getDownloadCodeForm()); + return tableNameAll; + } + + /** + * 封装数据 + * + * @param columndata + * @param model + * @param appGenModel + * @param isMast + */ + private void javaGenerate(Map columndata, Template7Model model, AppGenModel appGenModel, boolean isMast) { + CustomGenerator mpg = new CustomGenerator(columndata); + // 全局配置 + GlobalConfig gc = new GlobalConfig(); + gc.setFileOverride(true); + // 不需要ActiveRecord特性的请改为false + gc.setActiveRecord(false); + // XML 二级缓存 + gc.setEnableCache(false); + // XML ResultMap + gc.setBaseResultMap(false); + // XML columList + gc.setBaseColumnList(false); + gc.setAuthor(model.getCreateUser()); + gc.setOpen(false); + + // 自定义文件命名,注意 %s 会自动填充表实体属性! + String className = model.getClassName(); + if (isMast) { + gc.setControllerName(className + GenFileNameSuffix.CONTROLLER); + } + gc.setEntityName(className + GenFileNameSuffix.ENTITY); + gc.setMapperName(className + GenFileNameSuffix.MAPPER); + gc.setXmlName(className + GenFileNameSuffix.MAPPER_XML); + gc.setServiceName(className + GenFileNameSuffix.SERVICE); + gc.setServiceImplName(className + GenFileNameSuffix.SERVICEIMPL); + mpg.setGlobalConfig(gc); + + // 数据源配置 + UserInfo userInfo = appGenModel.getUserInfo(); + DbLinkEntity linkEntity = appGenModel.getLinkEntity(); + + mpg.setDataSource(SourceUtil.dbConfig(TenantDataSourceUtil.getTenantSchema(), linkEntity)); + + // 策略配置 + StrategyConfig strategy = new StrategyConfig(); + strategy.setEntityLombokModel(true); + // 表名生成策略 + strategy.setNaming(NamingStrategy.underline_to_camel); + // 需要生成的表 + String table = appGenModel.getTable(); + strategy.setInclude(table); + strategy.setRestControllerStyle(true); + mpg.setStrategy(strategy); + + // 包配置 + PackageConfig pc = new PackageConfig(); + pc.setParent("jnpf"); + if (columndata.get("isForm") != null) { + pc.setParent("jnpf." + columndata.get("isForm")); + } + mpg.setPackageInfo(pc); + + // 自定义配置 + InjectionConfig cfg = new InjectionConfig() { + @Override + public void initMap() { + // to do nothing + } + }; + List focList = new ArrayList<>(); + String javaPath = model.getServiceDirectory(); + String templatePath = this.tempPath(appGenModel); + String fileName = appGenModel.getFileName(); + String path = appGenModel.getTemplateCodePath(); + if (isMast) { + focList.add(new FileOutConfig(templatePath + File.separator + "java" + File.separator + "Controller.java.vm") { + @Override + public String outputFile(TableInfo tableInfo) { + return javaPath + fileName + File.separator + "java" + File.separator + "controller" + File.separator + tableInfo.getControllerName() + StringPool.DOT_JAVA; + } + }); + } + focList.add(new FileOutConfig(templatePath + File.separator + "java" + File.separator + "Entity.java.vm") { + @Override + public String outputFile(TableInfo tableInfo) { + List fieldAll = tableInfo.getFields(); + TableField mainTableField = fieldAll.stream().filter(tableField -> tableField.isKeyFlag()).findFirst().orElse(null); + fieldAll = fieldAll.stream().filter(DataControlUtils.distinctByKey(t -> t.getName())).collect(Collectors.toList()); + if (mainTableField != null) { + fieldAll.stream().filter(tableField -> tableField.getName().equals(mainTableField.getName())).forEach(t -> t.setKeyFlag(mainTableField.isKeyFlag())); + } + for (TableField field : fieldAll) { + String name = field.getName().toLowerCase().replaceAll("f_", ""); + field.setPropertyName(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, name)); + } + tableInfo.setFields(fieldAll); + return javaPath + fileName + File.separator + "java" + File.separator + "entity" + File.separator + tableInfo.getEntityName() + StringPool.DOT_JAVA; + } + }); + focList.add(new FileOutConfig(templatePath + File.separator + "java" + File.separator + "Mapper.java.vm") { + @Override + public String outputFile(TableInfo tableInfo) { + return javaPath + fileName + File.separator + "java" + File.separator + "mapper" + File.separator + tableInfo.getMapperName() + StringPool.DOT_JAVA; + } + }); + focList.add(new FileOutConfig(templatePath + File.separator + "java" + File.separator + "Mapper.xml.vm") { + @Override + public String outputFile(TableInfo tableInfo) { + return javaPath + fileName + File.separator + "resources" + File.separator + "mapper" + File.separator + tableInfo.getMapperName() + StringPool.DOT_XML; + } + }); + focList.add(new FileOutConfig(templatePath + File.separator + "java" + File.separator + "Service.java.vm") { + @Override + public String outputFile(TableInfo tableInfo) { + return javaPath + fileName + File.separator + "java" + File.separator + "service" + File.separator + tableInfo.getServiceName() + StringPool.DOT_JAVA; + } + }); + focList.add(new FileOutConfig(templatePath + File.separator + "java" + File.separator + "ServiceImpl.java.vm") { + @Override + public String outputFile(TableInfo tableInfo) { + return javaPath + fileName + File.separator + "java" + File.separator + "service" + File.separator + "impl" + File.separator + tableInfo.getServiceImplName() + StringPool.DOT_JAVA; + } + }); + cfg.setFileOutConfigList(focList); + mpg.setTemplate(new TemplateConfig().setXml(null).setMapper(null).setController(null).setEntity(null).setService(null).setServiceImpl(null)); + mpg.setCfg(cfg); + // 执行生成 + mpg.execute(path); + } + + /** + * 封装数据 + * + * @param formAllModel + * @param system + */ + private void system(List formAllModel, List system) { + List mast = formAllModel.stream().filter(t -> FormEnum.mast.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + for (int i = 0; i < mast.size(); i++) { + FormAllModel mastModel = mast.get(i); + FieLdsModel fieLdsModel = mastModel.getFormColumnModel().getFieLdsModel(); + String model = fieLdsModel.getVModel(); + if (StringUtil.isNotEmpty(model)) { + system.add(fieLdsModel); + } + } + } + + /** + * 封装数据 + */ + private void mastTable(List formAllModel, Map columndata, AppGenModel appGenModel, Map tableNameAll) throws SQLException { + List mastTable = formAllModel.stream().filter(t -> FormEnum.mastTable.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + Map> mastListAll = mastTable.stream().collect(Collectors.groupingBy(e -> e.getFormMastTableModel().getTable())); + DbLinkEntity linkEntity = appGenModel.getLinkEntity(); + List tableModelList = JsonUtil.getJsonToList(appGenModel.getEntity().getVisualTables(), TableModel.class); + List> mastTableNameAll = new ArrayList<>(); + for (String mastkey : mastListAll.keySet()) { + Map childMap = new HashMap<>(); + String mastTableName = tableNameAll.get(mastkey); + String className = mastTableName.substring(0, 1).toUpperCase() + mastTableName.substring(1); + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equals(mastkey)).findFirst().orElse(null); + if (tableModel != null) { + //获取主表主键 + String chidKeyName = VisualUtils.getpKey(linkEntity, tableModel.getTable()); + String tableField = tableModel.getTableField().trim().replaceAll(":\"f_", ":\""); + childMap.put("tableField", tableField); + String relationField = tableModel.getRelationField().trim().replaceAll(":\"f_", ":\""); + childMap.put("relationField", relationField); + childMap.put("className", className); + String keyName = chidKeyName.trim().toLowerCase().replaceAll("f_", ""); + childMap.put("chidKeyName", keyName); + childMap.put("childList", mastListAll.get(mastkey)); + childMap.put("table", mastkey); + mastTableNameAll.add(childMap); + } + } + columndata.put("tableNameAll", mastTableNameAll); + } + + /** + * 封装数据 + * + * @param formAllModel + * @param child + * @param appGenModel + * @throws SQLException + */ + private void child(List formAllModel, List> child, AppGenModel appGenModel, Map tableNameAll) throws SQLException { + List table = formAllModel.stream().filter(t -> FormEnum.table.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + DbLinkEntity linkEntity = appGenModel.getLinkEntity(); + List tableModelList = JsonUtil.getJsonToList(appGenModel.getEntity().getVisualTables(), TableModel.class); + for (FormAllModel tableModelAll : table) { + FormColumnTableModel childList = tableModelAll.getChildList(); + String childTableName = childList.getTableName(); + String name = tableNameAll.get(childTableName); + List columnList = childList.getChildList(); + for (int i = 0; i < columnList.size(); i++) { + FormColumnModel columnModel = columnList.get(i); + FieLdsModel fieLdsModel = columnModel.getFieLdsModel(); + String model = fieLdsModel.getVModel(); + String jnpfKey = fieLdsModel.getConfig().getJnpfKey(); + if (StringUtil.isEmpty(model)) { + columnList.remove(i); + i--; + } + } + childList.setChildList(columnList); + Map childs = JsonUtil.entityToMap(childList); + String childClassName = name.substring(0, 1).toUpperCase() + name.substring(1); + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equals(childList.getTableName())).findFirst().orElse(null); + if (tableModel != null) { + //获取主表主键 + String chidKeyName = VisualUtils.getpKey(linkEntity, tableModel.getTable()); + String tableField = tableModel.getTableField().trim().replaceAll(":\"f_", ":\""); + childs.put("tableField", tableField); + String relationField = tableModel.getRelationField().trim().replaceAll(":\"f_", ":\""); + childs.put("relationField", relationField); + childs.put("className", childClassName); + String keyName = chidKeyName.trim().toLowerCase().replaceAll("f_", ""); + childs.put("chidKeyName", keyName); + child.add(childs); + } + } + } + + /** + * 封装数据 + * + * @param columndata + * @param appGenModel + * @param template7Model + * @throws SQLException + */ + private void columData(Map columndata, AppGenModel appGenModel, Template7Model template7Model) throws SQLException { + VisualdevEntity entity = appGenModel.getEntity(); + List formAllModel = new ArrayList<>(); + Map tableNameAll = this.forDataMode(appGenModel, formAllModel); + //主表数据 + List system = new ArrayList<>(); + this.system(formAllModel, system); + //子表的属性 + List> child = new ArrayList<>(); + this.child(formAllModel, child, appGenModel, tableNameAll); + //表单子表 + this.mastTable(formAllModel, columndata, appGenModel, tableNameAll); + + boolean isPage = this.isType(appGenModel); + if (isPage) { + String columnData = entity.getColumnData(); + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class); + //分页 + columndata.put("sort", columnDataModel.getSort()); + columndata.put("page", columnDataModel.getHasPage() ? "0" : "1"); + columnData(formAllModel, columnDataModel, tableNameAll, columndata); + } + DownloadCodeForm downloadCodeForm = appGenModel.getDownloadCodeForm(); + columndata.put("genInfo", template7Model); + columndata.put("areasName", downloadCodeForm.getModule()); + columndata.put("modelName", template7Model.getClassName()); + columndata.put("typeId", 1); + columndata.put("system", system); + columndata.put("child", child); + String pKeyName = appGenModel.getPKeyName(); + columndata.put("pKeyName", pKeyName); + columndata.put("isModel", "true"); + String modelPathName = downloadCodeForm.getClassName().substring(0, 1).toLowerCase() + downloadCodeForm.getClassName().substring(1); + columndata.put("modelPathName", modelPathName); + } + + + private String tempPath(AppGenModel appGenModel) { + String tempPath = appGenModel.getTemplatePath(); + VisualdevEntity entity = appGenModel.getEntity(); + if(!Objects.equals(entity.getType(),3)) { + if (VisualWebTypeEnum.FORM.getType().equals(entity.getWebType())) { + tempPath = entity.getEnableFlow() == 1 ? "TemplateCode5" : "TemplateCode4"; + } else if (VisualWebTypeEnum.FORM_LIST.getType().equals(entity.getWebType())) { + tempPath = entity.getEnableFlow() == 1 ? "TemplateCode3" : "TemplateCode2"; + } + } + return tempPath; + } + + private boolean isType(AppGenModel appGenModel) { + VisualdevEntity entity = appGenModel.getEntity(); + boolean type = !VisualWebTypeEnum.FORM.getType().equals(entity.getWebType()); + return type; + } + + private boolean isForm(AppGenModel appGenModel) { + VisualdevEntity entity = appGenModel.getEntity(); + boolean type = (VisualWebTypeEnum.FORM_LIST.getType().equals(entity.getWebType()) && entity.getEnableFlow() == 0); + return type; + } + + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/common/DataControlUtils.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/common/DataControlUtils.java new file mode 100644 index 0000000..9d367f5 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/common/DataControlUtils.java @@ -0,0 +1,106 @@ +package jnpf.base.util.common; + +import com.alibaba.fastjson.JSONObject; +import com.google.common.base.Function; +import com.google.common.base.Predicate; +import jnpf.model.visualJson.FieLdsModel; +import jnpf.util.JsonUtil; +import jnpf.util.visiual.JnpfKeyConsts; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * 代码生成器数据处理工具类 + * + * @author JNPF开发平台组 + * @version V3.2.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/8/26 + */ +public class DataControlUtils { + + /** + * 将字符串的首字母转大写 + * @param name 需要转换的字符串 + * @return + */ + public static String captureName(String name) { + char[] ch = name.toCharArray(); + for (int i = 0; i < ch.length; i++) { + if (i == 0) { + ch[0] = Character.toUpperCase(ch[0]); + } + } + StringBuffer a = new StringBuffer(); + a.append(ch); + return a.toString(); + + } + + public static String initialLowercase(String name) { + char[] ch = name.toCharArray(); + for (int i = 0; i < ch.length; i++) { + if (i == 0) { + ch[0] = Character.toLowerCase(ch[0]); + } + } + StringBuffer a = new StringBuffer(); + a.append(ch); + return a.toString(); + } + + public static String getPlaceholder(String jnpfKey){ + String placeholderName = "请选择"; + switch (jnpfKey){ + case JnpfKeyConsts.BILLRULE: + case JnpfKeyConsts.MODIFYUSER: + case JnpfKeyConsts.CREATEUSER: + case JnpfKeyConsts.COM_INPUT: + case JnpfKeyConsts.TEXTAREA: + placeholderName = "请输入"; + break; + default: + break; + } + return placeholderName; + } + + /** + * 去重 + * @param keyExtractor + * @param + * @return + */ + public static Predicate distinctByKey(Function keyExtractor) { + Map seen = new ConcurrentHashMap<>(); + return t -> seen.putIfAbsent(keyExtractor.apply(t), Boolean.TRUE) == null; + } + + public static FieLdsModel setAbleIDs(FieLdsModel fieLdsModel){ + if (fieLdsModel.getAbleDepIds()!= null){ + fieLdsModel.setAbleDepIds(JSONObject.toJSONString(fieLdsModel.getAbleDepIds())); + } + if (fieLdsModel.getAblePosIds()!= null){ + fieLdsModel.setAblePosIds(JSONObject.toJSONString(fieLdsModel.getAblePosIds())); + } + if (fieLdsModel.getAbleUserIds()!= null){ + fieLdsModel.setAbleUserIds(JSONObject.toJSONString(fieLdsModel.getAbleUserIds())); + } + if (fieLdsModel.getAbleRoleIds()!= null){ + fieLdsModel.setAbleRoleIds(JSONObject.toJSONString(fieLdsModel.getAbleRoleIds())); + } + if (fieLdsModel.getAbleGroupIds()!= null){ + fieLdsModel.setAbleGroupIds(JSONObject.toJSONString(fieLdsModel.getAbleGroupIds())); + } + if (fieLdsModel.getAbleIds()!= null){ + fieLdsModel.setAbleIds(JSONObject.toJSONString(fieLdsModel.getAbleIds())); + } + //model字段验证reg转换 + if (fieLdsModel.getConfig().getRegList() != null) { + String o1 = JSONObject.toJSONString(JsonUtil.getObjectToString(fieLdsModel.getConfig().getRegList())); + fieLdsModel.getConfig().setReg(o1); + } + return fieLdsModel; + } +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/common/FormCommonUtil.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/common/FormCommonUtil.java new file mode 100644 index 0000000..511af5c --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/common/FormCommonUtil.java @@ -0,0 +1,207 @@ +package jnpf.base.util.common; + +import com.baomidou.mybatisplus.core.toolkit.StringPool; +import com.baomidou.mybatisplus.generator.config.FileOutConfig; +import com.baomidou.mybatisplus.generator.config.po.TableField; +import com.baomidou.mybatisplus.generator.config.po.TableInfo; +import com.google.common.base.CaseFormat; +import jnpf.base.model.DownloadCodeForm; +import jnpf.base.model.print.PrintOption; +import jnpf.base.service.IPrintDevService; +import jnpf.model.visualJson.FieLdsModel; +import jnpf.model.visualJson.analysis.FormAllModel; +import jnpf.util.FilePathUtil; +import jnpf.util.FileUploadUtils; +import jnpf.util.TableFeildsEnum; +import jnpf.util.context.SpringContext; +import org.apache.commons.collections4.CollectionUtils; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 代码生成通用方法类 + * 微服务单体不同处在此类 调整变通 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2023/3/22 11:08:06 + */ +public class FormCommonUtil { + + public static final String IS_CLOUD = "single"; + + private static IPrintDevService iPrintDevService = SpringContext.getBean(IPrintDevService.class); + + /** + * 获取需要生成的文件对象 + * + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2023/3/22 + */ + public static FileOutConfig getFileOutConfig(String fileName, String templatePath, DownloadCodeForm downloadCodeForm, String javaPath, String temName, + String typeStr, boolean concurrencyLock) { + return new FileOutConfig(templatePath + File.separator + "java" + File.separator + temName) { + @Override + public String outputFile(TableInfo tableInfo) { + if ("entity".equals(typeStr)) { + List fieldAll = tableInfo.getFields(); + TableField mainTableField = fieldAll.stream().filter(tableField -> tableField.isKeyFlag()).findFirst().orElse(null); + fieldAll = fieldAll.stream().filter(DataControlUtils.distinctByKey(t -> t.getName())).collect(Collectors.toList()); + if (mainTableField != null) { + fieldAll.stream().filter(tableField -> tableField.getName().equals(mainTableField.getName())).forEach(t -> t.setKeyFlag(mainTableField.isKeyFlag())); + } + for (TableField field : fieldAll) { + String name = field.getName().toLowerCase().replaceAll("f_" , "" ); + field.setPropertyName(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, name)); + boolean fv = field.getName().equalsIgnoreCase(TableFeildsEnum.VERSION.getField() ); + if (fv && concurrencyLock) { + field.setFill("1" ); + } + } + tableInfo.setFields(fieldAll); + } + String eachName = ""; + String frontName = ""; + String modulName = downloadCodeForm.getModule(); + String framePath = downloadCodeForm.getModulePackageName(); + switch (typeStr) { + case "controller": + eachName = tableInfo.getControllerName(); + framePath = getCloudPath("-controller" , downloadCodeForm); + break; + case "entity": + eachName = tableInfo.getEntityName(); + framePath = getCloudPath("-entity" , downloadCodeForm); + break; + case "mapper": + eachName = tableInfo.getMapperName(); + framePath = getCloudPath("-biz" , downloadCodeForm); + break; + case "xml": + eachName = tableInfo.getMapperName(); + if ("cloud".equals(FormCommonUtil.IS_CLOUD)) { + framePath = "jnpf-" + modulName + File.separator + "jnpf-" + modulName + "-biz" + File.separator + + "src" + File.separator + "main" + File.separator + "resources"; + return javaPath + fileName + File.separator + "java" + File.separator + framePath + File.separator + "mapper" + + File.separator + eachName + StringPool.DOT_XML; + } + return javaPath + fileName + File.separator + "resources" + File.separator + "mapper" + + File.separator + eachName + StringPool.DOT_XML; + case "service": + eachName = tableInfo.getServiceName(); + framePath = getCloudPath("-biz" , downloadCodeForm); + break; + case "impl": + eachName = tableInfo.getServiceImplName(); + frontName = "service" + File.separator; + framePath = getCloudPath("-biz" , downloadCodeForm); + default: + break; + } + return javaPath + fileName + File.separator + "java" + File.separator + framePath + File.separator + frontName + typeStr + + File.separator + eachName + StringPool.DOT_JAVA; + } + }; + } + + /** + * 获取微服务框架路径 + * + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2023/3/22 + */ + public static String getCloudPath(String houzui, DownloadCodeForm downloadCodeForm) { + String framePath = ""; + boolean isCloud = "cloud".equals(FormCommonUtil.IS_CLOUD); + if (isCloud) { + framePath = "jnpf-" + downloadCodeForm.getModule() + + File.separator + + "jnpf-" + downloadCodeForm.getModule() + houzui + + File.separator + + "src" + File.separator + "main" + File.separator + "java" + + File.separator + + downloadCodeForm.getModulePackageName(); + } else { + framePath = downloadCodeForm.getModulePackageName(); + } + return framePath; + } + + + public static String getLocalBasePath() { + return FileUploadUtils.getLocalBasePath(); + } + + public static String getPath(String type) { + return FilePathUtil.getFilePath(type); + } + + public static List getList(List ids) { + return iPrintDevService.getPrintTemplateOptions(ids); + } + + /** + * 合计和千分位字段转换至前端可用 + * @param sourceList 原字段列表 + * @param type 列表类型4为行内编辑 + * @return 新字段列表 + */ + public static List getSummaryList(List sourceList,Integer type){ + List finalFieldsTotal = new ArrayList<>(); + String suffix = "_name"; + if (type == 4) { + suffix = ""; + } + if(CollectionUtils.isEmpty(sourceList)){return finalFieldsTotal;} + for (String field : sourceList) { + String finalField; + if (field.startsWith("jnpf" )) { + String fieldName = field.substring(field.lastIndexOf("jnpf_" )).replace("jnpf_" , "" ); + String tableName = field.substring(field.indexOf("_" ) + 1, field.lastIndexOf("_jnpf" )); + finalField = tableName + "." + fieldName + suffix; + } else { + finalField = field + suffix; + } + finalFieldsTotal.add(finalField); + } + return finalFieldsTotal; + } + + /** + * 合计千分位字段列表 + * + * @param mast 主表字段 + * @param mastTable 副表字段 + * @param type 列表类型 4-行内编辑 + * @return + */ + public static List getSummaryThousandList(List mast, List mastTable, Integer type) { + String suffix = "_name"; + if (type == 4) { + suffix = ""; + } + List thousandsField = new ArrayList<>(); + for (FormAllModel f : mast) { + FieLdsModel fm = f.getFormColumnModel().getFieLdsModel(); + if (fm.isThousands()) { + thousandsField.add(fm.getVModel() + suffix); + } + } + for (FormAllModel f : mastTable) { + FieLdsModel fm = f.getFormMastTableModel().getMastTable().getFieLdsModel(); + if (fm.isThousands()) { + thousandsField.add(f.getFormMastTableModel().getTable() + "." + fm.getVModel() + suffix); + } + } + return thousandsField; + } + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/common/FunctionFormPublicUtil.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/common/FunctionFormPublicUtil.java new file mode 100644 index 0000000..828202c --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/common/FunctionFormPublicUtil.java @@ -0,0 +1,233 @@ +package jnpf.base.util.common; + +import jnpf.base.entity.VisualdevEntity; +import jnpf.base.model.DownloadCodeForm; +import jnpf.emnus.ModuleTypeEnum; +import jnpf.entity.FlowFormEntity; +import jnpf.model.form.DraftJsonModel; +import jnpf.model.form.FormDraftJsonModel; +import jnpf.model.visualJson.FieLdsModel; +import jnpf.model.visualJson.FormCloumnUtil; +import jnpf.model.visualJson.FormDataModel; +import jnpf.model.visualJson.TableModel; +import jnpf.model.visualJson.analysis.*; +import jnpf.model.visualJson.config.ConfigModel; +import jnpf.util.JsonUtil; +import jnpf.util.StringUtil; +import jnpf.util.visiual.JnpfKeyConsts; +import lombok.Cleanup; + +import java.io.File; +import java.io.FileWriter; +import java.io.Writer; +import java.util.*; +import java.util.stream.Collectors; + +/** + * + * 功能流程公共工具 + * @author JNPF开发平台组 + * @version V3.2.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/8/25 + */ +public class FunctionFormPublicUtil { + + public static FlowFormEntity exportFlowFormJson(VisualdevEntity entity, DownloadCodeForm downloadCodeForm) { + FlowFormEntity flowFormEntity = new FlowFormEntity(); + flowFormEntity.setId(entity.getId()); + flowFormEntity.setEnCode(entity.getEnCode()); + flowFormEntity.setFullName(entity.getFullName()); + flowFormEntity.setFlowType(1); + flowFormEntity.setFormType(1); + flowFormEntity.setCategory(entity.getCategory()); + flowFormEntity.setDescription(entity.getDescription()); + flowFormEntity.setSortCode(entity.getSortCode()); + flowFormEntity.setCreatorTime(entity.getCreatorTime()); + flowFormEntity.setCreatorUserId(entity.getCreatorUserId()); + flowFormEntity.setTableJson(entity.getVisualTables()); + flowFormEntity.setDbLinkId(entity.getDbLinkId()); + //填写默认url + String appUrl = "/pages/apply/" + downloadCodeForm.getClassName(); + flowFormEntity.setAppUrlAddress(appUrl); + String formFileName = downloadCodeForm.isVue3() ? "/Form.vue" : "/form.vue"; + String webUrl = "extend/" + downloadCodeForm.getClassName().toLowerCase() + formFileName; + flowFormEntity.setUrlAddress(webUrl); + String downloadClassName = downloadCodeForm.getClassName().substring(0, 1).toUpperCase() + downloadCodeForm.getClassName().substring(1); + String interfaceUrl = "/api/" + downloadCodeForm.getModule() + "/" + downloadClassName; + flowFormEntity.setInterfaceUrl(interfaceUrl); + + if (Objects.equals(entity.getType(), 3)) { + flowFormEntity.setFlowType(0); + webUrl = "workFlow/workFlowForm/" + downloadCodeForm.getClassName().toLowerCase() + "/index.vue"; + flowFormEntity.setUrlAddress(webUrl); + interfaceUrl = "/api/workflow/" + downloadCodeForm.getModule() + "/" + downloadClassName; + flowFormEntity.setInterfaceUrl(interfaceUrl); + } + + List formAllModel = new ArrayList<>(); + forDataMode(entity,formAllModel); + List mastList = formAllModel.stream().filter(t -> FormEnum.mast.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + List tempJson = new ArrayList<>(); + for (FormAllModel mastModel : mastList) { + FieLdsModel fieLdsModel = mastModel.getFormColumnModel().getFieLdsModel(); + String model = fieLdsModel.getVModel(); + ConfigModel config = fieLdsModel.getConfig(); + if(StringUtil.isNotEmpty(model)){ + DraftJsonModel engineModel = new DraftJsonModel(); + String label = config.getLabel(); + engineModel.setFiledId(model); + engineModel.setFiledName(label); + engineModel.setRequired(config.isRequired()); + engineModel.setJnpfKey(config.getJnpfKey()); + engineModel.setMultiple(fieLdsModel.getMultiple()); + tempJson.add(engineModel); + } + } + List tableList = formAllModel.stream().filter(t -> FormEnum.table.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + List tableModelList = JsonUtil.getJsonToList(entity.getVisualTables(),TableModel.class); + Map tableListAll = tableNameRename(downloadCodeForm,tableModelList); + for (FormAllModel model : tableList) { + String table = model.getChildList().getTableName(); + String name = tableListAll.get(table); + FormColumnTableModel childList = model.getChildList(); + String label = childList.getLabel(); + boolean required = childList.isRequired(); + DraftJsonModel engineModel = new DraftJsonModel(); + engineModel.setFiledId(name.toLowerCase()+"List"); + engineModel.setFiledName(label); + engineModel.setRequired(required); + tempJson.add(engineModel); + for (FormColumnModel columnModel : model.getChildList().getChildList()) { + String vModel = columnModel.getFieLdsModel().getVModel(); + String childLable = columnModel.getFieLdsModel().getConfig().getLabel(); + ConfigModel config = columnModel.getFieLdsModel().getConfig(); + if(StringUtil.isNotEmpty(vModel)) { + DraftJsonModel childModel = new DraftJsonModel(); + childModel.setFiledId(name.toLowerCase() + "List-" + vModel); + childModel.setFiledName(label+"-"+childLable); + childModel.setRequired(config.isRequired()); + childModel.setJnpfKey(config.getJnpfKey()); + childModel.setMultiple(columnModel.getFieLdsModel().getMultiple()); + tempJson.add(childModel); + } + } + } + List mastTableList = formAllModel.stream().filter(t -> FormEnum.mastTable.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + for (FormAllModel mastTableModel : mastTableList) { + FormMastTableModel formMastTableModel = mastTableModel.getFormMastTableModel(); + FieLdsModel fieLdsModel = formMastTableModel.getMastTable().getFieLdsModel(); + String model = formMastTableModel.getVModel(); + ConfigModel config = fieLdsModel.getConfig(); + if(StringUtil.isNotEmpty(model)){ + DraftJsonModel engineModel = new DraftJsonModel(); + String label = config.getLabel(); + engineModel.setFiledId(model); + engineModel.setFiledName(label); + engineModel.setRequired(config.isRequired()); + engineModel.setJnpfKey(config.getJnpfKey()); + engineModel.setMultiple(fieLdsModel.getMultiple()); + tempJson.add(engineModel); + } + } + FormDraftJsonModel draftJsonModel = new FormDraftJsonModel(); + String Tem = JsonUtil.getObjectToString(tempJson); + flowFormEntity.setPropertyJson(Tem); + tableJson(tableList, flowFormEntity, tableListAll); + draftJsonModel.setDraftJson(Tem); + draftJsonModel.setTableJson(entity.getVisualTables()); + flowFormEntity.setDraftJson(JsonUtil.getObjectToString(draftJsonModel)); + return flowFormEntity; + } + + + + /** + * 创建文件 + * @param data + * @param path + */ + public static void createFile(String data, String path) { + try { + File file = new File(path+File.separator+"flow."+ ModuleTypeEnum.FLOW_FLOWENGINE.getTableName()); + boolean b = file.createNewFile(); + if(b) { + @Cleanup Writer out = new FileWriter(file); + out.write(data); + out.close(); + } + }catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * 封装数据 + * + * @param entity + * @param formAllModel + */ + private static void forDataMode(VisualdevEntity entity, List formAllModel) { + //formTempJson + FormDataModel formData = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + List tableModelList = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + RecursionForm recursionForm = new RecursionForm(list,tableModelList); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + } + + public static Map tableNameRename(DownloadCodeForm downloadCodeForm, List tableModelList){ + Map tableNameMap = new HashMap<>(16); + int i = 0; + for (TableModel tableModel : tableModelList) { + if ("0".equals(tableModel.getTypeId())) { + String[] subClassName = downloadCodeForm.getSubClassName().split(","); + tableNameMap.put(tableModel.getTable(), subClassName[i]); + i++; + }else { + tableNameMap.put(tableModel.getTable(),downloadCodeForm.getClassName()); + } + } + return tableNameMap; + } + + private static void tableJson(List tableList, VisualdevEntity entity, Map tableListAll) { +// String json = entity.getFlowTemplateJson(); +// for (FormAllModel model : tableList) { +// String table = model.getChildList().getTableName(); +// String tableModel = model.getChildList().getTableModel(); +// String name = tableListAll.get(table); +// json = json.replaceAll(tableModel, name.toLowerCase() + "List"); +// } +// entity.setFlowTemplateJson(json); +// } + } + private static void tableJson(List tableList, FlowFormEntity entity, Map tableListAll) { + String json = entity.getPropertyJson(); + for (FormAllModel model : tableList) { + String table = model.getChildList().getTableName(); + String tableModel = model.getChildList().getTableModel(); + String name = tableListAll.get(table); + json = json.replaceAll(tableModel, name.toLowerCase() + "List"); + } + entity.setPropertyJson(json); + } + + public static void getTableModels(List fieLdsModelList, List tableModelFields){ + for (FieLdsModel fieLdsModel : fieLdsModelList){ + String jnpfKey = fieLdsModel.getConfig().getJnpfKey(); + if (JnpfKeyConsts.CHILD_TABLE.equals(jnpfKey)){ + tableModelFields.add(fieLdsModel); + } else { + List children = fieLdsModel.getConfig().getChildren(); + if (children!= null){ + getTableModels(children, tableModelFields); + } else { + continue; + } + } + } + + } + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/common/SuperQueryUtil.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/common/SuperQueryUtil.java new file mode 100644 index 0000000..abc4a65 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/common/SuperQueryUtil.java @@ -0,0 +1,48 @@ +package jnpf.base.util.common; + +import jnpf.emnus.ModuleTypeEnum; +import jnpf.util.XSSEscape; +import lombok.Cleanup; + +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.io.Writer; + +public class SuperQueryUtil { + + public static void CreateJsFile(String data,String path,String jsFileType) throws IOException { + String content = "const "+jsFileType+" = " + data; + + File jsFile = new File(path); + Writer writer = null; + try { + writer = new FileWriter(jsFile); + writer.write(content); + writer.write(System.getProperty("line.separator")); + writer.write("export default "+jsFileType); + } catch (IOException e) { + e.printStackTrace(); + } finally { + if (writer!=null){ + writer.close(); + } + } + } + + public static void CreateFlowFormJsonFile(String data, String path){ + try { + File file = new File(XSSEscape.escapePath(path+File.separator+"flowForm."+ ModuleTypeEnum.FLOW_FLOWDFORM.getTableName())); + boolean b = file.createNewFile(); + if(b) { + @Cleanup Writer out = new FileWriter(file); + out.write(data); + out.close(); + } + }catch (Exception e) { + e.printStackTrace(); + } + } + + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/custom/CustomGenerator.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/custom/CustomGenerator.java new file mode 100644 index 0000000..6830187 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/custom/CustomGenerator.java @@ -0,0 +1,171 @@ +package jnpf.base.util.custom; + +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.Version; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import com.baomidou.mybatisplus.extension.activerecord.Model; +import com.baomidou.mybatisplus.generator.InjectionConfig; +import com.baomidou.mybatisplus.generator.config.*; +import com.baomidou.mybatisplus.generator.config.builder.ConfigBuilder; +import com.baomidou.mybatisplus.generator.config.po.TableInfo; +import com.baomidou.mybatisplus.generator.engine.AbstractTemplateEngine; +import jnpf.util.StringUtil; +import lombok.extern.slf4j.Slf4j; + +import java.io.Serializable; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + + +@Slf4j +public class CustomGenerator { + + public ConfigBuilder config; + public InjectionConfig injectionConfig; + public DataSourceConfig dataSource; + public StrategyConfig strategy; + public PackageConfig packageInfo; + public TemplateConfig template; + public GlobalConfig globalConfig; + public AbstractTemplateEngine templateEngine; + + private Map customParams; + + public CustomGenerator(Map customParams) { + this.customParams = customParams; + } + + public void execute(String path) { + if (null == this.config) { + this.config = new ConfigBuilder(this.packageInfo, this.dataSource, this.strategy, this.template, this.globalConfig); + if (null != this.injectionConfig) { + this.injectionConfig.setConfig(this.config); + } + } + if (null == this.templateEngine) { + if(customParams != null){ + this.templateEngine = new CustomTemplateEngine(customParams,path); + }else{ + this.templateEngine = new CustomTemplateEngine(path); + } + } + this.templateEngine.init(this.pretreatmentConfigBuilder(this.config)).mkdirs().batchOutput().open(); + } + + protected List getAllTableInfoList(ConfigBuilder config) { + return config.getTableInfoList(); + } + + protected ConfigBuilder pretreatmentConfigBuilder(ConfigBuilder config) { + if (null != this.injectionConfig) { + this.injectionConfig.initMap(); + config.setInjectionConfig(this.injectionConfig); + } + List tableList = this.getAllTableInfoList(config); + Iterator var3 = tableList.iterator(); + while(var3.hasNext()) { + TableInfo tableInfo = (TableInfo)var3.next(); + if (config.getGlobalConfig().isActiveRecord()) { + tableInfo.setImportPackages(Model.class.getCanonicalName()); + } + if (tableInfo.isConvert()) { + tableInfo.setImportPackages(TableName.class.getCanonicalName()); + } + if (config.getStrategyConfig().getLogicDeleteFieldName() != null && tableInfo.isLogicDelete(config.getStrategyConfig().getLogicDeleteFieldName())) { + tableInfo.setImportPackages(TableLogic.class.getCanonicalName()); + } + if (StringUtil.isNotEmpty(config.getStrategyConfig().getVersionFieldName())) { + tableInfo.setImportPackages(Version.class.getCanonicalName()); + } + if (StringUtil.isNotEmpty(config.getStrategyConfig().getSuperEntityClass())) { + tableInfo.setImportPackages(config.getStrategyConfig().getSuperEntityClass()); + } else { + tableInfo.setImportPackages(Serializable.class.getCanonicalName()); + } + if (config.getStrategyConfig().isEntityBooleanColumnRemoveIsPrefix()) { + tableInfo.getFields().stream().filter((field) -> { + return "boolean".equalsIgnoreCase(field.getPropertyType()); + }).filter((field) -> { + return field.getPropertyName().startsWith("is"); + }).forEach((field) -> { + field.setPropertyName(config.getStrategyConfig(), StringUtils.removePrefixAfterPrefixToLower(field.getPropertyName(), 2)); + }); + } + } + return config.setTableInfoList(tableList); + } + + public DataSourceConfig getDataSource() { + return this.dataSource; + } + + public CustomGenerator setDataSource(DataSourceConfig dataSource) { + this.dataSource = dataSource; + return this; + } + + public StrategyConfig getStrategy() { + return this.strategy; + } + + public CustomGenerator setStrategy(StrategyConfig strategy) { + this.strategy = strategy; + return this; + } + + public PackageConfig getPackageInfo() { + return this.packageInfo; + } + + public CustomGenerator setPackageInfo(PackageConfig packageInfo) { + this.packageInfo = packageInfo; + return this; + } + + public TemplateConfig getTemplate() { + return this.template; + } + + public CustomGenerator setTemplate(TemplateConfig template) { + this.template = template; + return this; + } + + public ConfigBuilder getConfig() { + return this.config; + } + + public CustomGenerator setConfig(ConfigBuilder config) { + this.config = config; + return this; + } + + public GlobalConfig getGlobalConfig() { + return this.globalConfig; + } + + public CustomGenerator setGlobalConfig(GlobalConfig globalConfig) { + this.globalConfig = globalConfig; + return this; + } + + public InjectionConfig getCfg() { + return this.injectionConfig; + } + + public CustomGenerator setCfg(InjectionConfig injectionConfig) { + this.injectionConfig = injectionConfig; + return this; + } + + public AbstractTemplateEngine getTemplateEngine() { + return this.templateEngine; + } + + public CustomGenerator setTemplateEngine(AbstractTemplateEngine templateEngine) { + this.templateEngine = templateEngine; + return this; + } +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/custom/CustomTemplateEngine.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/custom/CustomTemplateEngine.java new file mode 100644 index 0000000..8688eb6 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/custom/CustomTemplateEngine.java @@ -0,0 +1,75 @@ +package jnpf.base.util.custom; + + +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.generator.config.ConstVal; +import com.baomidou.mybatisplus.generator.config.builder.ConfigBuilder; +import com.baomidou.mybatisplus.generator.engine.AbstractTemplateEngine; +import jnpf.util.StringUtil; +import org.apache.velocity.Template; +import org.apache.velocity.VelocityContext; +import org.apache.velocity.app.VelocityEngine; + +import java.io.BufferedWriter; +import java.io.FileOutputStream; +import java.io.OutputStreamWriter; +import java.util.Map; +import java.util.Properties; + +public class CustomTemplateEngine extends AbstractTemplateEngine { + + private static final String DOT_VM = ".vm"; + private VelocityEngine velocityEngine; + + private Map customParams; + + private String path; + + public CustomTemplateEngine(String path) { + this.path = path; + } + + public CustomTemplateEngine(Map customParams, String path) { + this.customParams = customParams; + this.path = path; + } + + @Override + public CustomTemplateEngine init(ConfigBuilder configBuilder) { + super.init(configBuilder); + if (null == this.velocityEngine) { + Properties p = new Properties(); + p.setProperty(VelocityEngine.FILE_RESOURCE_LOADER_PATH, path); + p.setProperty("ISO-8859-1", Constants.UTF_8); + p.setProperty("output.encoding", Constants.UTF_8); + this.velocityEngine = new VelocityEngine(p); + } + + return this; + } + + @Override + public void writer(Map objectMap, String templatePath, String outputFile) throws Exception { + if (!StringUtil.isEmpty(templatePath)) { + Template template = this.velocityEngine.getTemplate(templatePath, ConstVal.UTF8); + FileOutputStream fos = new FileOutputStream(outputFile); + BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(fos, ConstVal.UTF8)); + if(customParams!= null){ + objectMap.putAll(customParams); + } + template.merge(new VelocityContext(objectMap), writer); + writer.close(); + } + } + + @Override + public String templateFilePath(String filePath) { + if (null != filePath && !filePath.contains(".vm")) { + StringBuilder fp = new StringBuilder(); + fp.append(filePath).append(".vm"); + return fp.toString(); + } else { + return filePath; + } + } +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/custom/VelocityEnum.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/custom/VelocityEnum.java new file mode 100644 index 0000000..7668b36 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/custom/VelocityEnum.java @@ -0,0 +1,20 @@ +package jnpf.base.util.custom; + +import com.baomidou.mybatisplus.core.toolkit.Constants; +import org.apache.velocity.app.Velocity; +import org.apache.velocity.app.VelocityEngine; + +import java.util.Properties; + +public enum VelocityEnum { + init; + + public void initVelocity(String path){ + Properties p = new Properties(); + p.setProperty(VelocityEngine.FILE_RESOURCE_LOADER_PATH, path); + p.setProperty("ISO-8859-1", Constants.UTF_8); + p.setProperty("output.encoding", Constants.UTF_8); + Velocity.init(p); + } + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/form/FormGenModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/form/FormGenModel.java new file mode 100644 index 0000000..e7e8ec1 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/form/FormGenModel.java @@ -0,0 +1,83 @@ +package jnpf.base.util.form; + +import jnpf.base.UserInfo; +import jnpf.base.entity.VisualdevEntity; +import jnpf.base.model.DownloadCodeForm; +import jnpf.config.ConfigValueUtil; +import jnpf.database.model.entity.DbLinkEntity; +import jnpf.database.util.DataSourceUtil; +import jnpf.model.visualJson.FormDataModel; +import lombok.Data; + +/** + * + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @author JNPF开发平台组 + * @date 2021/10/25 + */ +@Data +public class FormGenModel { + private ConfigValueUtil configValueUtil; + /** + * 文件夹名字 + */ + private String fileName; + /** + * 实体对象 + */ + private VisualdevEntity entity; + /** + * 下载对象 + */ + private DownloadCodeForm downloadCodeForm; + /** + * 表单对象 + */ + private FormDataModel model; + /** + * 模板文件 + */ + private String templatePath; + /** + * 主键 + */ + private String pKeyName; + /** + * 本地数据源 + */ + private DataSourceUtil dataSourceUtil; + /** + * 数据连接 + */ + private DbLinkEntity linkEntity; + /** + * 个人信息 + */ + private UserInfo userInfo; + /** + * 生成文件名字 + */ + private String className; + /** + * 数据库表 + */ + private String table; + /** + * 生成路径 + */ + private String serviceDirectory; + /** + * 模板路径 + */ + private String templateCodePath; + + private Boolean groupTable; + + private String type; + /** + * 是否主表 + */ + private boolean isMainTable; + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/form/FormGenUtil.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/form/FormGenUtil.java new file mode 100644 index 0000000..781a40f --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/form/FormGenUtil.java @@ -0,0 +1,2001 @@ +package jnpf.base.util.form; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.serializer.SerializerFeature; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.core.toolkit.StringPool; +import com.baomidou.mybatisplus.generator.InjectionConfig; +import com.baomidou.mybatisplus.generator.config.*; +import com.baomidou.mybatisplus.generator.config.po.TableField; +import com.baomidou.mybatisplus.generator.config.po.TableInfo; +import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy; +import com.google.common.base.CaseFormat; +import jnpf.base.UserInfo; +import jnpf.base.entity.VisualdevEntity; +import jnpf.base.model.ColumnDataModel; +import jnpf.base.model.DownloadCodeForm; +import jnpf.base.model.Template6.AuthorityModel; +import jnpf.base.model.Template6.BtnData; +import jnpf.base.model.Template6.ColumnListField; +import jnpf.base.model.Template7.Template7Model; +import jnpf.base.model.VisualWebTypeEnum; +import jnpf.base.util.SourceUtil; +import jnpf.base.util.VisualUtils; +import jnpf.base.util.common.DataControlUtils; +import jnpf.base.util.common.FormCommonUtil; +import jnpf.base.util.common.FunctionFormPublicUtil; +import jnpf.base.util.common.SuperQueryUtil; +import jnpf.base.util.custom.CustomGenerator; +import jnpf.base.util.fuctionFormVue3.common.GenerateCommon; +import jnpf.base.util.fuctionFormVue3.common.GenerateParamModel; +import jnpf.constant.FileTypeConstant; +import jnpf.constant.MsgCode; +import jnpf.database.model.entity.DbLinkEntity; +import jnpf.database.model.superQuery.SuperJsonModel; +import jnpf.database.util.TenantDataSourceUtil; +import jnpf.entity.FlowFormEntity; +import jnpf.generater.model.FormDesign.*; +import jnpf.generater.model.GenBaseInfo; +import jnpf.generater.model.GenFileNameSuffix; +import jnpf.model.visualJson.*; +import jnpf.model.visualJson.analysis.*; +import jnpf.model.visualJson.config.ConfigModel; +import jnpf.model.visualJson.config.HeaderModel; +import jnpf.util.DateUtil; +import jnpf.util.JsonUtil; +import jnpf.util.StringUtil; +import jnpf.util.XSSEscape; +import jnpf.util.visiual.JnpfKeyConsts; +import lombok.Cleanup; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.io.IOUtils; +import org.apache.velocity.Template; +import org.apache.velocity.VelocityContext; +import org.apache.velocity.app.Velocity; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.StringWriter; +import java.lang.reflect.Field; +import java.sql.SQLException; +import java.util.*; +import java.util.stream.Collectors; + +public class FormGenUtil { + + + //+-----------------------------界面2021.8.13------------------------------------------------------------ + + public void htmlTemplates(FormGenModel genModel) throws Exception { + //对象 + htmlTemplatesList(genModel); + + + VisualdevEntity entity = genModel.getEntity(); + DbLinkEntity linkEntity = genModel.getLinkEntity(); + DownloadCodeForm downloadCodeForm = genModel.getDownloadCodeForm(); + String className = downloadCodeForm.getClassName().substring(0, 1).toUpperCase() + downloadCodeForm.getClassName().substring(1); + Template7Model templateModel = this.templateModel(genModel, className); + + List formAllModel = new ArrayList<>(); + RecursionForm recursionForm = new RecursionForm(); + recursionForm.setTableModelList(JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class)); + FormDataModel formData = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + recursionForm.setList(JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class)); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + + + //执行代码生成器 + GenerateParamModel generateParamModel = new GenerateParamModel().builder() + .dataSourceUtil(genModel.getDataSourceUtil()) + .path(FormCommonUtil.getLocalBasePath() + genModel.getConfigValueUtil()) + .fileName(genModel.getFileName()) + .templatesPath(genModel.getTemplatePath()) + .downloadCodeForm(downloadCodeForm) + .entity(genModel.getEntity()) + .userInfo(genModel.getUserInfo()) + .configValueUtil(genModel.getConfigValueUtil()) + .linkEntity(genModel.getLinkEntity()) + .pKeyName(genModel.getPKeyName()) + .className(className) + .isMainTable(true) + .table(genModel.getTable()) + .build(); + Map columndata = getcolumndata(generateParamModel); + + //form的属性 + List table = formAllModel.stream().filter(t -> FormEnum.table.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + List mastTable = formAllModel.stream().filter(t -> FormEnum.mastTable.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + //子表导入 + List tableModelList = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + Map tableRenames = tableName(tableModelList, generateParamModel.getDownloadCodeForm()); + List formChildList = new ArrayList<>(); + Map> groupColumnDataMap = mastTable.stream().collect(Collectors.groupingBy(m -> m.getFormMastTableModel().getTable())); + + Map childKeyTableNameMap = new HashMap<>(8); + table.stream().forEach(t -> childKeyTableNameMap.put(t.getChildList().getTableModel(), t.getChildList().getTableName())); + + columndata.put("package", generateParamModel.getDownloadCodeForm().getModulePackageName()); + columndata.put("modelPathName", generateParamModel.getDownloadCodeForm().getModulePackageName()); + columndata.put("className", className); + columndata.put("form", formAllModel); + columndata.put("isMain", true); + columndata.put("dbLinkId", linkEntity != null ? linkEntity.getId() : "0"); + columndata.put("tableRenames", JSONObject.toJSONString(JsonUtil.getObjectToString(tableRenames))); + columndata.put("childKeyTableNameMap", JSONObject.toJSONString(JsonUtil.getObjectToString(childKeyTableNameMap))); + + + List getTemplate = this.getTemplate(genModel, false, false); + String path = templateModel.getServiceDirectory() + genModel.getFileName(); + FormDataModel model = genModel.getModel(); + String modelPathName = model.getClassName().substring(0, 1).toLowerCase() + model.getClassName().substring(1); + this.htmlTemplates(columndata, getTemplate, path, templateModel.getClassName(), modelPathName, downloadCodeForm); + + //副表model + for (String key : groupColumnDataMap.keySet()) { + Map objectMap = new HashMap<>(); + String childClassName = DataControlUtils.captureName(tableRenames.get(key)); + ColumnListDataModel columnListDataModel = new ColumnListDataModel(); + columnListDataModel.setModelName(childClassName); + columnListDataModel.setModelUpName(DataControlUtils.captureName(childClassName)); + columnListDataModel.setModelLowName(DataControlUtils.initialLowercase(childClassName)); + List allModels = groupColumnDataMap.get(key); + allModels.stream().forEach(m -> { + String vModel = m.getFormMastTableModel().getField(); + m.getFormMastTableModel().getMastTable().getFieLdsModel().setVModel(vModel); + }); + List fields = allModels.stream().map(m -> + m.getFormMastTableModel().getField()).collect(Collectors.toList()); + columnListDataModel.setFieldList(fields); + columnListDataModel.setFieLdsModelList(allModels.stream().map(al -> al.getFormMastTableModel()).collect(Collectors.toList())); + columnListDataModel.setTableName(key); + formChildList.add(columnListDataModel); + List children = allModels.stream().map(allModel -> allModel.getFormMastTableModel().getMastTable()).collect(Collectors.toList()); + //表字段给的范围-转换json + children.forEach(item -> { + item.setFieLdsModel(DataControlUtils.setAbleIDs(item.getFieLdsModel())); + }); + FormColumnTableModel formColumnTableModel = new FormColumnTableModel(); + formColumnTableModel.setChildList(children); + objectMap.put("children", formColumnTableModel); + objectMap.put("genInfo", generateParamModel.getTemplate7Model()); + objectMap.put("package", generateParamModel.getDownloadCodeForm().getModulePackageName()); + objectMap.put("module", downloadCodeForm.getModule()); + objectMap.put("className", childClassName); + List template = this.getTemplate(genModel, false, true); + this.htmlTemplates(objectMap, template, path, childClassName, modelPathName, downloadCodeForm); + } + //子表model + for (int i = 0; i < table.size(); i++) { + FormColumnTableModel childList = table.get(i).getChildList(); + Map objectMap = JsonUtil.entityToMap(childList); + List tableList = childList.getChildList(); + String childClassName = DataControlUtils.captureName(tableRenames.get(childList.getTableName())); + //导入字段属性设置 + if (VisualWebTypeEnum.FORM_LIST.getType().equals(entity.getWebType()) && !Objects.equals(entity.getType(), 3)) { + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(entity.getColumnData(), ColumnDataModel.class); + if (columnDataModel.getUploaderTemplateJson() != null) { + UploaderTemplateModel uploaderTemplateModel = JsonUtil.getJsonToBean(columnDataModel.getUploaderTemplateJson(), UploaderTemplateModel.class); + List selectKey = uploaderTemplateModel.getSelectKey() != null ? uploaderTemplateModel.getSelectKey() : Collections.EMPTY_LIST; + tableList.stream().forEach(item -> { + String childFieldKey = item.getFieLdsModel().getConfig().getParentVModel() + "-" + item.getFieLdsModel().getVModel(); + if (selectKey.contains(childFieldKey)) { + item.getFieLdsModel().setNeedImport(true); + } + }); + } + } + + //子表别名 + childList.setAliasClassName(childClassName); + childList.setAliasUpName(DataControlUtils.captureName(childClassName)); + childList.setAliasLowName(DataControlUtils.initialLowercase(childClassName)); + objectMap.put("children", childList); + objectMap.put("genInfo", generateParamModel.getTemplate7Model()); + objectMap.put("package", generateParamModel.getDownloadCodeForm().getModulePackageName()); + objectMap.put("module", downloadCodeForm.getModule()); + objectMap.put("className", childClassName); + List template = this.getTemplate(genModel, true, false); + this.htmlTemplates(objectMap, template, path, childClassName, modelPathName, downloadCodeForm); + } + + //复杂表头 + createComplexHeaderExcelVo(path,generateParamModel,entity,downloadCodeForm,columndata); + + /** + * 生成表单设计json文件 + */ + if (entity.getEnableFlow() == 1) { + FlowFormEntity flowFormEntity = FunctionFormPublicUtil.exportFlowFormJson(entity, downloadCodeForm); + SuperQueryUtil.CreateFlowFormJsonFile(JsonUtil.getObjectToString(flowFormEntity), path); + } + } + + + /** + * 复杂表头 对象生成。 + * @param path + * @param generateParamModel + * @param entity + * @param downloadCodeForm + * @param objectAll + */ + private void createComplexHeaderExcelVo(String path, GenerateParamModel generateParamModel, VisualdevEntity entity, + DownloadCodeForm downloadCodeForm, Map objectAll) { + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(entity.getColumnData(), ColumnDataModel.class); + if(VisualWebTypeEnum.FORM_LIST.getType().equals(entity.getWebType()) ) { + JsonUtil.getListToJsonArray(columnDataModel.getComplexHeaderList()); + List complexHeaderList = columnDataModel.getComplexHeaderList(); + String templateName = "java" + File.separator + "ExcelVO.java.vm"; + VelocityContext context = new VelocityContext(); + Map object = new HashMap<>(); + object.put("genInfo", generateParamModel.getTemplate7Model()); + object.put("package", generateParamModel.getDownloadCodeForm().getModulePackageName()); + object.put("module", downloadCodeForm.getModule()); + object.put("isMain", true); + object.put("isComplexVo", true); + object.put("importFields", objectAll.get("importFields")); + for (HeaderModel item : complexHeaderList) { + if (item.getChildColumns().size() > 0) { + String className = "Complex" + item.getId(); + object.put("complexList", JsonUtil.getListToJsonArray(item.getChildColumns())); + object.put("className", className); + context.put("context", object); + String fileNames = GenerateCommon.getFileName(path, templateName, className, downloadCodeForm); + GenerateCommon.velocityWriterFile(context, templateName, fileNames); + } + } + } + } + + /** + * 获取模板 + * + * @param genModel + * @param isChild + * @return + */ + private List getTemplate(FormGenModel genModel, boolean isChild, boolean isMastTable) { + List templates = new ArrayList<>(); + String template = this.tempPath(genModel); + VisualdevEntity entity = genModel.getEntity(); + ColumnDataModel columnDataModel = StringUtil.isNotEmpty(entity.getColumnData()) ? JsonUtil.getJsonToBean(entity.getColumnData(), ColumnDataModel.class) : new ColumnDataModel(); + List btnDataList = JsonUtil.getJsonToList(columnDataModel.getBtnsList(), BtnData.class); + List importList = new ArrayList() {{ + add("upload"); + }}; + boolean hasImport = btnDataList.stream().filter(t -> importList.contains(t.getValue())).count() > 0; + List templateCode = new ArrayList() {{ + add("TemplateCode2"); + add("TemplateCode3"); + }}; + boolean hasExcel = hasImport && templateCode.contains(template); + if (isChild || isMastTable) { + templates.add("java" + File.separator + "Model.java.vm"); + if (hasExcel && isChild) { + templates.add("java" + File.separator + "ExcelVO.java.vm"); + } + } else { + //后端 + templates.add("java" + File.separator + "Form.java.vm"); + templates.add("java" + File.separator + "Constant.java.vm"); + boolean isPage = this.isType(genModel); + if (isPage) { + templates.add("java" + File.separator + "Pagination.java.vm"); + } + if (hasExcel) { + templates.add("java" + File.separator + "ExcelVO.java.vm"); + templates.add("java" + File.separator + "ExcelErrorVO.java.vm"); + } + } + return templates; + } + + private String tempPath(FormGenModel genModel) { + String tempPath = genModel.getTemplatePath(); + VisualdevEntity entity = genModel.getEntity(); + if(!Objects.equals(entity.getType(),3)) { + if (VisualWebTypeEnum.FORM.getType().equals(entity.getWebType())) { + tempPath = entity.getEnableFlow() == 1 ? "TemplateCode5" : "TemplateCode4"; + } else if (VisualWebTypeEnum.FORM_LIST.getType().equals(entity.getWebType())) { + tempPath = entity.getEnableFlow() == 1 ? "TemplateCode3" : "TemplateCode2"; + } + } + return tempPath; + } + + /** + * 获取文件名 + * + * @param path 路径 + * @param template 模板名称 + * @param className 文件名称 + * @return + */ + private String getFileNames(String path, String template, String className, String modePath, DownloadCodeForm downloadCodeForm) { + path = XSSEscape.escapePath(path); + modePath = XSSEscape.escapePath(modePath); + className = XSSEscape.escapePath(className); + //是否微服务路径 + if (template.contains("extraForm.vue.vm") || template.contains("Form.vue.vm") || template.contains("index.vue.vm") + || template.contains("indexEdit.vue.vm") || template.contains("Detail.vue.vm")) { + String htmlPath = XSSEscape.escapePath(path + File.separator + "html" + File.separator + "web" + File.separator + className.toLowerCase()); + File htmlfile = new File(htmlPath); + if (!htmlfile.exists()) { + htmlfile.mkdirs(); + } + if (template.contains("extraForm.vue.vm")) { + className = "extraForm"; + return htmlPath + File.separator + className + ".vue"; + } + if (template.contains("Form.vue.vm")) { + className = "Form"; + return htmlPath + File.separator + className.toLowerCase() + ".vue"; + } + if (template.contains("index.vue.vm")) { + className = "index"; + return htmlPath + File.separator + className + ".vue"; + } + if (template.contains("indexEdit.vue.vm")) { + className = "index"; + return htmlPath + File.separator + className + ".vue"; + } + if (template.contains("Detail.vue.vm")) { + className = "Detail"; + return htmlPath + File.separator + className + ".vue"; + } + } + String framePath = "jnpf-" + downloadCodeForm.getModule() + + File.separator + + "jnpf-" + downloadCodeForm.getModule() + "-entity" + + File.separator + + "src" + File.separator + "main" + File.separator + "java" + + File.separator + + downloadCodeForm.getModulePackageName(); + String modelPath = XSSEscape.escapePath(path + File.separator + "java" + File.separator + framePath + File.separator + "model" + File.separator + modePath.toLowerCase()); + File modelfile = new File(modelPath); + if (!modelfile.exists()) { + modelfile.mkdirs(); + } + if (template.contains("Model.java.vm")) { + return modelPath + File.separator + className + "Model.java"; + } + if (template.contains("InfoVO.java.vm")) { + return modelPath + File.separator + className + "InfoVO.java"; + } + if (template.contains("Form.java.vm")) { + return modelPath + File.separator + className + "Form.java"; + } + if (template.contains("Constant.java.vm")) { + return modelPath + File.separator + className + "Constant.java"; + } + if (template.contains("ListVO.java.vm")) { + return modelPath + File.separator + className + "ListVO.java"; + } + if (template.contains("Pagination.java.vm")) { + return modelPath + File.separator + className + "Pagination.java"; + } + if (template.contains("ExcelVO.java.vm")) { + return modelPath + File.separator + className + "ExcelVO.java"; + } + if (template.contains("ExcelErrorVO.java.vm")) { + return modelPath + File.separator + className + "ExcelErrorVO.java"; + } + return null; + } + + /** + * 渲染html模板 + * + * @param path 路径 + * @param object 模板数据 + * @param path 模板路径 + */ + private void htmlTemplates(Object object, List templates, String path, String className, String modePath, DownloadCodeForm downloadCodeForm) { + VelocityContext context = new VelocityContext(); + context.put("context", object); + for (String template : templates) { + try { + @Cleanup StringWriter sw = new StringWriter(); + Template tpl = Velocity.getTemplate(template, Constants.UTF_8); + tpl.merge(context, sw); + String fileNames = getFileNames(path, template, className, modePath, downloadCodeForm); + if (fileNames != null) { + File file = new File(fileNames); + if (!file.exists()) { + file.createNewFile(); + } + @Cleanup FileOutputStream fos = new FileOutputStream(file); + IOUtils.write(sw.toString(), fos, Constants.UTF_8); + IOUtils.closeQuietly(sw); + IOUtils.closeQuietly(fos); + } + } catch (IOException e) { + e.printStackTrace(); + System.out.println("渲染模板失败,表名:" + e); + } + } + } + + /** + * 封装列表数据 + */ + private void columnData(List formAllModel, ColumnDataModel columnDataModel, Map tableNameAll, Map map) { + List mast = formAllModel.stream().filter(t -> FormEnum.mast.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + List mastTable = formAllModel.stream().filter(t -> FormEnum.mastTable.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + //显示数据 + List columnListAll = JsonUtil.getJsonToList(columnDataModel.getColumnList(), ColumnListField.class); + Map> mastTableList = new HashMap<>(); + Map> childColumnList = new HashMap<>(); + List columnMastList = new ArrayList<>(); + for (ColumnListField columnList : columnListAll) { + String prop = columnList.getProp(); + FormAllModel model = mastTable.stream().filter(t -> t.getFormMastTableModel().getVModel().equals(prop)).findFirst().orElse(null); + if (model == null) { + String[] split = prop.split("-"); + if (split.length == 1) { + columnMastList.add(columnList); + } else { + List childList = childColumnList.get(split[0]) != null ? childColumnList.get(split[0]) : new ArrayList<>(); + String vModel = split[1]; + columnList.setVModel(vModel); + childList.add(columnList); + childColumnList.put(split[0], childList); + } + } else { + FormMastTableModel formMastTableModel = model.getFormMastTableModel(); + String tableName = formMastTableModel.getTable(); + List columnListList = mastTableList.get(tableName) != null ? mastTableList.get(tableName) : new ArrayList<>(); + model.setFormMastTableModel(formMastTableModel); + columnListList.add(model); + mastTableList.put(tableName, columnListList); + } + } + map.put("childColumnList", childColumnList); + map.put("columnList", columnMastList); + map.put("columnMastList", mastTableList); + map.put("AppColumnList", columnDataModel.getColumnList()); + //导入 + UploaderTemplateModel uploaderTemplateModel = JsonUtil.getJsonToBean(columnDataModel.getUploaderTemplateJson(), UploaderTemplateModel.class); + List selectKey = uploaderTemplateModel.getSelectKey(); + int headerRowIndex = selectKey.stream().filter(t -> t.split("-").length > 1).count() > 0 ? 2 : 1; + map.put("headerRowIndex", headerRowIndex); + map.put("uploaderDataType", "2".equals(uploaderTemplateModel.getDataType())); + //排序 + String sort = StringUtil.isNotEmpty(columnDataModel.getSortList()) ? columnDataModel.getSortList() : "[]"; + List sortListAll = JsonUtil.getJsonToList(sort, ColumnListField.class); + List sortList = new ArrayList<>(); + for (int i = 0; i < sortListAll.size(); i++) { + ColumnListField columnList = sortListAll.get(i); + String prop = columnList.getProp(); + FormAllModel model = mast.stream().filter(t -> prop.equals(t.getFormColumnModel().getFieLdsModel().getVModel())).findFirst().orElse(null); + if (model != null) { + sortList.add(columnList); + } + } + map.put("sortList", sortList); + boolean isSidx = sortList.stream().filter(t -> t.getProp().equals(columnDataModel.getDefaultSidx())).count() > 0; + if (isSidx) { + map.put("defaultSidx", columnDataModel.getDefaultSidx()); + } + //搜索 + List searchVOList = JsonUtil.getJsonToList(columnDataModel.getSearchList(), FieLdsModel.class); + List mastTableSearch = new ArrayList<>(); + List childSearch = new ArrayList<>(); + List mastSearch = new ArrayList<>(); + List> searchAll = new LinkedList<>(); + for (FieLdsModel columnSearch : searchVOList) { + List templateJsonAll = new ArrayList<>(); + templateJsonAll.addAll(columnSearch.getConfig().getTemplateJson()); + List templateJsonModelList = JsonUtil.getJsonToList(columnSearch.getTemplateJson(), TemplateJsonModel.class); + templateJsonAll.addAll(templateJsonModelList); + columnSearch.getConfig().setTemplateJson(templateJsonAll); + Map column = new HashMap<>(); + String vmodel = columnSearch.getVModel(); + boolean isMast = mast.stream().filter(t -> vmodel.equals(t.getFormColumnModel().getFieLdsModel().getVModel())).count() > 0; + boolean isMastTable = mastTable.stream().filter(t -> vmodel.equals(t.getFormMastTableModel().getVModel())).count() > 0; + if (isMast) { + column.put("key", "mastSearch"); + mastSearch.add(columnSearch); + } else if (isMastTable) { + column.put("key", "mastTableSearch"); + mastTableSearch.add(columnSearch); + } else { + columnSearch.setVModel(columnSearch.getVModel().replaceAll("-", "_")); + column.put("key", "childSearch"); + childSearch.add(columnSearch); + } + column.put("html", columnSearch); + searchAll.add(column); + } + map.put("searchAll", searchAll); + map.put("searchList", mastTableSearch); + map.put("childSearch", childSearch); + map.put("mastsearchList", mastSearch); + map.put("useDataPermission", columnDataModel.getUseDataPermission() != null ? columnDataModel.getUseDataPermission() : false); + map.put("useBtnPermission", columnDataModel.getUseBtnPermission() != null ? columnDataModel.getUseBtnPermission() : false); + map.put("useFormPermission", columnDataModel.getUseFormPermission() != null ? columnDataModel.getUseFormPermission() : false); + map.put("useColumnPermission", columnDataModel.getUseColumnPermission() != null ? columnDataModel.getUseColumnPermission() : false); + } + + //小沈代码 + public void htmlTemplatesList(FormGenModel formGenModel) { + VisualdevEntity entity = formGenModel.getEntity(); + DownloadCodeForm downloadCodeForm = formGenModel.getDownloadCodeForm(); + FormDataModel model = formGenModel.getModel(); + String template = formGenModel.getTemplatePath(); + String pKeyName = formGenModel.getPKeyName(); + ColumnDataModel columnDataModel = StringUtil.isNotEmpty(entity.getColumnData()) ? JsonUtil.getJsonToBean(entity.getColumnData(), ColumnDataModel.class) : new ColumnDataModel(); + Integer type = columnDataModel.getType(); + if(!StringUtil.isNotEmpty(entity.getColumnData())){ + columnDataModel.setColumnList("[]"); + columnDataModel.setHasPage(true); + columnDataModel.setRuleList(new SuperJsonModel()); + } + + //按钮 + List btnsListAll = new ArrayList<>(); + List bntList = StringUtil.isNotEmpty(columnDataModel.getBtnsList()) ? JsonUtil.getJsonToList(columnDataModel.getBtnsList(), BtnData.class) : new ArrayList<>(); + List columnBtnsList = StringUtil.isNotEmpty(columnDataModel.getColumnBtnsList()) ? JsonUtil.getJsonToList(columnDataModel.getColumnBtnsList(), BtnData.class) : new ArrayList<>(); + btnsListAll.addAll(bntList); + btnsListAll.addAll(columnBtnsList); + columnDataModel.setBtnsList(btnsListAll); + List templates = new ArrayList<>(); + //前端页面 + List templateCodeList = new ArrayList() {{ + add("TemplateCode2"); + add("TemplateCode3"); + add("TemplateCode5"); + }}; + if (templateCodeList.contains(template)) { + if (Objects.equals(type, 4)) { + templates.add(template + File.separator + "html" + File.separator + "indexEdit.vue.vm"); + if("TemplateCode2".equals(template)) { + templates.add(template + File.separator + "html" + File.separator + "extraForm.vue.vm"); + } + } else { + templates.add(template + File.separator + "html" + File.separator + "index.vue.vm"); + templates.add(template + File.separator + "html" + File.separator + "Form.vue.vm"); + } + } else { + templates.add(template + File.separator + "html" + File.separator + "index.vue.vm"); + } + if ("TemplateCode2".equals(template)) { + templates.add(template + File.separator + "html" + File.separator + "Detail.vue.vm"); + } + + //自定义包名 + Map map = new HashMap<>(16); + //formTempJson + FormDataModel formData = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + List columnList = JsonUtil.getJsonToList(columnDataModel.getColumnList(), ColumnListField.class); + List formAllModel = new ArrayList<>(); + RecursionForm recursionForm = new RecursionForm(); + recursionForm.setTableModelList(JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class)); + recursionForm.setList(list); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + List formAllList = JsonUtil.getJsonToList(formAllModel, FormAllModel.class); + + List tableModelFields = new ArrayList<>(); + FunctionFormPublicUtil.getTableModels(list, tableModelFields); + + //form的属性 + List mast = formAllModel.stream().filter(t -> FormEnum.mast.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + List table = formAllModel.stream().filter(t -> FormEnum.table.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + List mastTable = formAllModel.stream().filter(t -> FormEnum.mastTable.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + map.put("ableAll", JsonUtil.getListToJsonArray(formAllModel)); + //columnTempJson + + //主表的属性 + for (int i = 0; i < mast.size(); i++) { + FormAllModel mastModel = mast.get(i); + FieLdsModel fieLdsModel = mastModel.getFormColumnModel().getFieLdsModel(); + //接口templatejson转换 + if (StringUtil.isNotEmpty(fieLdsModel.getVModel())) { + List templateJson = fieLdsModel.getConfig().getTemplateJson(); + templateJson.addAll(JsonUtil.getJsonToList(fieLdsModel.getTemplateJson(),TemplateJsonModel.class)); + fieLdsModel.setTemplateJson(JsonUtil.getObjectToString(templateJson)); + } + } + + //副表的属性 + for (int i = 0; i < mastTable.size(); i++) { + FormAllModel mastModel = mastTable.get(i); + FieLdsModel fieLdsModel = mastModel.getFormMastTableModel().getMastTable().getFieLdsModel(); + //接口templatejson转换 + if (StringUtil.isNotEmpty(fieLdsModel.getVModel())) { + List templateJson = fieLdsModel.getConfig().getTemplateJson(); + templateJson.addAll(JsonUtil.getJsonToList(fieLdsModel.getTemplateJson(),TemplateJsonModel.class)); + fieLdsModel.setTemplateJson(JsonUtil.getObjectToString(templateJson)); + } + } + + List id = new ArrayList<>(); + List complexHeaderModelList = JsonUtil.getJsonToList(columnDataModel.getColumnList(), ColumnListModel.class); + //复杂表头 + List complexHeaderList = columnDataModel.getComplexHeaderList(); + if(!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) { + for (HeaderModel headerModel : complexHeaderList) { + List childColumns = headerModel.getChildColumns(); + List columnListModelList = complexHeaderModelList.stream().filter(t -> childColumns.contains(t.getId())).collect(Collectors.toList()); + List formColumnModel = new ArrayList<>(); + for (ColumnListModel columnListModel : columnListModelList) { + FormColumnModel columnModel = new FormColumnModel(); + FieLdsModel fieLdsModel = JsonUtil.getJsonToBean(columnListModel, FieLdsModel.class); + columnModel.setFieLdsModel(fieLdsModel); + formColumnModel.add(columnModel); + } + headerModel.setChildList(formColumnModel); + id.addAll(childColumns); + } + } + + List tablesList = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + //列表字段 + List columnListModelList = JsonUtil.getJsonToList(columnDataModel.getColumnList(), ColumnListModel.class).stream().filter(t->!id.contains(t.getId())).collect(Collectors.toList()); + List notChildColList = columnListModelList.stream().filter(copy -> !copy.getVModel().toLowerCase().startsWith("tablefield")).collect(Collectors.toList()); + + //列表子表折叠 + List cldColModelList = new ArrayList<>(); + + List tablekeys = table.stream().map(t -> t.getChildList().getTableModel()).collect(Collectors.toList()); + Map keyNum = new HashMap<>(); + for (String key : tablekeys) { + ColumnListModel columnListModel = columnListModelList.stream().filter(c -> c.getProp().startsWith(key)).findFirst().orElse(null); + int i = columnListModelList.indexOf(columnListModel); + keyNum.put(key, i); + } + + Map> childFiledLists = columnListModelList.stream().filter(c -> c.getProp().toLowerCase() + .contains("tablefield")).collect(Collectors.groupingBy(t -> t.getProp().substring(0, t.getProp().lastIndexOf("-")))); + List childModels = new ArrayList<>(); + Iterator>> colentries = childFiledLists.entrySet().iterator(); + while (colentries.hasNext()) { + Map.Entry> next = colentries.next(); + ColumnListModel listModel = new ColumnListModel(); + ColumnChildListModel mod = new ColumnChildListModel(); + mod.setTableField(next.getKey()); + List value = next.getValue(); + value.get(0).setFirst(true); + String label = value.get(0).getLabel(); + String substring = label.substring(0, label.lastIndexOf("-")); + mod.setLabel(substring); + value.stream().forEach(v -> { + String prop = v.getProp(); + String valueLabel = v.getLabel(); + String propSub = prop.substring(prop.lastIndexOf("-") + 1); + String labelSub = valueLabel.substring(valueLabel.lastIndexOf("-") + 1); + v.setLabel(labelSub); + v.setProp(propSub); + }); + mod.setFields(value); + listModel.setProp(next.getKey()); + listModel.setColumnChildListModel(mod); + listModel.setJnpfKey(JnpfKeyConsts.CHILD_TABLE); + childModels.add(mod); + int i = keyNum.get(next.getKey()); + columnListModelList.set(i, listModel); + cldColModelList.add(listModel); + } + + columnListModelList = columnListModelList.stream().filter(c -> { + boolean b = true; + if (c.getId() != null && c.getId().toLowerCase().contains("tablefield")) { + if (!c.getJnpfKey().equals(JnpfKeyConsts.CHILD_TABLE)) { + b = false; + } + } + return b; + }).collect(Collectors.toList()); + + //取对应表的别名 + Map tableNameRenames = FunctionFormPublicUtil.tableNameRename(downloadCodeForm, tablesList); + + List allColumnFiledModelList = new ArrayList<>(); + allColumnFiledModelList.addAll(mast.stream().map(ma -> ma.getFormColumnModel().getFieLdsModel()).collect(Collectors.toList())); + allColumnFiledModelList.addAll(mastTable.stream().map(mt -> mt.getFormMastTableModel().getMastTable().getFieLdsModel()).collect(Collectors.toList())); + for (FormAllModel allModel : table) { + List childList = allModel.getChildList().getChildList(); + for (FormColumnModel formColumnModel : childList) { + allColumnFiledModelList.add(formColumnModel.getFieLdsModel()); + } + } + columnListModelList.stream().forEach(c -> { + String prop = c.getProp(); + FieLdsModel fieLdsModel = allColumnFiledModelList.stream().filter(f -> prop.equals(f.getId())).findFirst().orElse(null); + if (fieLdsModel != null) { + c.setDataType(fieLdsModel.getConfig().getDataType()); + c.setVModel(fieLdsModel.getVModel()); + c.setMultiple(c.getMultiple() != null ? c.getMultiple() : fieLdsModel.getMultiple()); + //数字组件新增属性 + c.setAddonBefore(fieLdsModel.getAddonBefore()); + c.setAddonAfter(fieLdsModel.getAddonAfter()); + c.setIsAmountChinese(fieLdsModel.getIsAmountChinese()); + c.setThousands(fieLdsModel.isThousands()); + c.setControls(fieLdsModel.getControls()); + //时间控件添加字段 + c.setStartTime(fieLdsModel.getStartTime()); + c.setEndTime(fieLdsModel.getEndTime()); + c.setStartRelationField(fieLdsModel.getConfig().getStartRelationField()); + c.setEndRelationField(fieLdsModel.getConfig().getEndRelationField()); + + if (fieLdsModel.getSelectType() != null) { + c.setSelectType(fieLdsModel.getSelectType()); + c.setAbleIds(fieLdsModel.getAbleIds()); + c.setAbleDepIds(fieLdsModel.getAbleDepIds()); + c.setAbleGroupIds(fieLdsModel.getAbleGroupIds()); + c.setAblePosIds(fieLdsModel.getAblePosIds()); + c.setAbleRoleIds(fieLdsModel.getAbleRoleIds()); + c.setAbleUserIds(fieLdsModel.getAbleUserIds()); + } + } + }); + + //列表中区别子表正则 + String reg = "^[jnpf_]\\S*_jnpf\\S*"; + columnListModelList.stream().filter(c -> c.getProp().matches(reg)).forEach( + cl -> { + String s = cl.getProp(); + String s1 = s.substring(s.lastIndexOf("jnpf_")).replace("jnpf_", ""); + String s2 = s.substring(s.indexOf("_") + 1, s.lastIndexOf("_jnpf")); + cl.setNewProp(s2.toLowerCase() + "." + s1); + cl.setColumnTableName(s2); + } + ); + + List searchList = StringUtil.isNotEmpty(columnDataModel.getSearchList()) ? JsonUtil.getJsonToList(columnDataModel.getSearchList(), FieLdsModel.class) : new ArrayList<>(); + + for (FieLdsModel fieLdsModel : searchList) { + Object value = fieLdsModel.getValue(); + if(value instanceof String){ + fieLdsModel.getConfig().setValueType("String"); + } + String vModel = fieLdsModel.getId(); + if (vModel.contains("-")) { + vModel = vModel.replaceAll("-", "_"); + } + fieLdsModel.getConfig().setLabel(fieLdsModel.getLabel()); + fieLdsModel.setVModel(vModel); + } + + //查询条件 + Map searchAll = new HashMap<>(); + List searchTypeModelList = new ArrayList<>(); + List jnpfkey = new ArrayList() {{ + add(JnpfKeyConsts.COM_INPUT); + add(JnpfKeyConsts.TEXTAREA); + }}; + searchList.stream().forEach(fieLdsModel -> { + SearchTypeModel searchTypeModel = new SearchTypeModel(); + searchTypeModel.setJnpfKey(fieLdsModel.getConfig().getJnpfKey()); + Integer seachType = fieLdsModel.getSearchType(); + if (jnpfkey.contains(searchTypeModel.getJnpfKey()) && seachType.equals(3)) { + seachType = 2; + } + searchTypeModel.setSearchType(seachType); + searchTypeModel.setVModel(fieLdsModel.getVModel()); + searchTypeModel.setLabel(fieLdsModel.getConfig().getLabel()); + searchTypeModel.setFormat(fieLdsModel.getFormat()); + String placeholder = fieLdsModel.getSearchType().equals(3) ? fieLdsModel.getPlaceholder() + : DataControlUtils.getPlaceholder(fieLdsModel.getConfig().getJnpfKey()); + if (searchTypeModel.getSearchType().equals(3)) { + searchAll.put(searchTypeModel.getVModel(), searchTypeModel.getLabel()); + } + searchTypeModel.setPlaceholder(placeholder); + ConfigModel config = fieLdsModel.getConfig(); + config.setDefaultValue(fieLdsModel.getValue()); + if (config.getDefaultValue() instanceof String) { + config.setValueType("String"); + } + if (config.getDefaultValue() == null) { + config.setValueType("undefined"); + } + searchTypeModel.setConfig(config); + searchTypeModel.setShowLevel(fieLdsModel.getShowLevel()); + searchTypeModel.setMultiple(String.valueOf(fieLdsModel.getSearchMultiple())); + searchTypeModelList.add(searchTypeModel); + }); + TableModel mainTableModel = tablesList.stream().filter(t -> t.getTypeId().equals("1")).findFirst().orElse(null); + + if (searchTypeModelList.size() > 0) { + for (TableFields tableFields : mainTableModel.getFields()) { + searchTypeModelList.stream().forEach(searchTypeModel -> { + if (searchTypeModel.getVModel().equals(tableFields.getField())) { + searchTypeModel.setDataType(tableFields.getDataType()); + } + }); + } + } + //子表赋值 + List> child = new ArrayList<>(); + for (int i = 0; i < table.size(); i++) { + FormColumnTableModel childList = table.get(i).getChildList(); + List tableList = childList.getChildList(); + String sClassName = tableNameRenames.get(childList.getTableName()); + for (FormColumnModel columnModel : tableList) { + FieLdsModel fieLdsModel = columnModel.getFieLdsModel(); + List templateJsonAll = new ArrayList<>(); + templateJsonAll.addAll(fieLdsModel.getConfig().getTemplateJson()); + List templateJsonModelList = JsonUtil.getJsonToList(fieLdsModel.getTemplateJson(), TemplateJsonModel.class); + templateJsonAll.addAll(templateJsonModelList); + for (TemplateJsonModel templateJsonModel : templateJsonAll) { + if (StringUtil.isNotEmpty(templateJsonModel.getRelationField())) { + String[] fieldList = templateJsonModel.getRelationField().split("-"); + if (fieldList.length > 1) { + templateJsonModel.setRelationField(sClassName.toLowerCase() + "-" + fieldList[1]); + } + } + } + for (TemplateJsonModel templateJsonModel : templateJsonModelList) { + if (StringUtil.isNotEmpty(templateJsonModel.getRelationField())) { + String[] fieldList = templateJsonModel.getRelationField().split("-"); + if (fieldList.length > 1) { + templateJsonModel.setRelationField(sClassName.toLowerCase() + "List-" + fieldList[1]); + } + } + } + fieLdsModel.setTemplateJson(JsonUtil.getObjectToString(templateJsonModelList)); + fieLdsModel.getConfig().setTemplateJson(templateJsonAll); + } + childList.setChildList(tableList); + Map childs = JsonUtil.entityToMap(childList); + String className = DataControlUtils.captureName(sClassName); + childs.put("className", className); + child.add(childs); + } + + //界面 + //是否开启行内编辑columnDataListFiled + map.put("lineEdit", Objects.equals(columnDataModel.getType(), 4)); + //是否开启分组表格 + if (Objects.equals(columnDataModel.getType(), 3)) { + ColumnListModel columnListModel = columnListModelList.get(0); + columnListModel.setFirst(true); + columnListModelList.set(0, columnListModel); + } + + //判断列表是否存在冻结 + boolean none = columnListModelList.stream().anyMatch(c -> "left".equals(c.getFixed()) || "right".equals(c.getFixed())); + map.put("hasFixed", none); + Set set = new HashSet<>(); + List nameAgain = new ArrayList<>(); + + map.put("nameAgain", nameAgain); + map.put("groupTable", Objects.equals(columnDataModel.getType(), 3)); + //树形同步异步 + if (Objects.equals(columnDataModel.getType(), 5)) { + columnDataModel.setHasPage(false); + } + map.put("treeTable", Objects.equals(columnDataModel.getType(), 5)); + map.put("treeLazyType", true); + map.put("parentField", columnDataModel.getParentField()); + map.put("subField", columnDataModel.getSubField()); + //合计 + boolean configurationTotal = columnDataModel.isShowSummary(); + if (Objects.equals(columnDataModel.getType(), 3) || Objects.equals(columnDataModel.getType(), 5)) { + configurationTotal = false; + } + map.put("configurationTotal", configurationTotal); + List summaryList = CollectionUtils.isEmpty(columnDataModel.getSummaryField()) ? Collections.EMPTY_LIST : columnDataModel.getSummaryField(); + map.put("fieldsTotal", JsonUtil.getObjectToString(summaryList)); + //合计千分位 + List thousandsField = ObjectUtil.isNotEmpty(columnDataModel.getType())?FormCommonUtil.getSummaryThousandList(mast, mastTable, columnDataModel.getType()):new ArrayList<>(); + map.put("thousandsField", JsonUtil.getObjectToString(thousandsField)); + //乐观锁 + map.put("type", type); + map.put("hasConfirmAndAddBtn", formData.getHasConfirmAndAddBtn()); + map.put("version", formData.getConcurrencyLock()); + map.put("logicalDelete", formData.getLogicalDelete()); + map.put("module", downloadCodeForm.getModule()); + map.put("className", DataControlUtils.captureName(model.getClassName())); + map.put("formRef", model.getFormRef()); + map.put("formModel", model.getFormModel()); + map.put("size", model.getSize()); + map.put("labelPosition", model.getLabelPosition()); + map.put("generalWidth", model.getGeneralWidth()); + map.put("fullScreenWidth", model.getFullScreenWidth()); + map.put("drawerWidth", model.getDrawerWidth()); + map.put("formStyle", model.getFormStyle()); + map.put("labelWidth", model.getLabelWidth()); + map.put("formRules", model.getFormRules()); + map.put("gutter", model.getGutter()); + map.put("disabled", model.getDisabled()); + map.put("span", model.getSpan()); + map.put("formBtns", model.getFormBtns()); + map.put("idGlobal", model.getIdGlobal()); + map.put("popupType", Objects.equals(entity.getWebType(),1) ? "fullScreen": model.getPopupType()); + map.put("form", formAllList); + map.put("columnData", columnDataModel); + + //todo 1231546 + map.put("complexHeaderList",complexHeaderList); + map.put("columnDataListFiled", columnListModelList); + map.put("childModels", childModels); + map.put("searchList", searchList); + map.put("childTableStyle", columnDataModel.getChildTableStyle()); + map.put("cldColModelList", cldColModelList); + map.put("notChildColList", notChildColList); + + map.put("flowFormId", entity.getId()); + map.put("enCode", entity.getEnCode()); + + map.put("dataType", columnDataModel.getHasPage() ? 0 : 1); + map.put("ruleQueryJson", JSONObject.toJSONString(columnDataModel.getRuleList())); + + //按钮 + map.put("HasCancelBtn", formData.getHasCancelBtn()); + map.put("HasConfirmBtn", formData.getHasConfirmBtn()); + map.put("HasPrintBtn", formData.getHasPrintBtn()); + map.put("CancelButton", formData.getCancelButtonText()); + map.put("ConfirmButton", formData.getConfirmButtonText()); + map.put("PrintButton", formData.getPrintButtonText()); + map.put("webType", entity.getWebType()); + map.put("isFlow", Objects.equals(entity.getEnableFlow(),1)); + String[] printId = formData.getPrintId() != null ? formData.getPrintId() : new String[]{}; + // 打印模板如果是有多个需要查询标题 + if (printId.length > 1) { + map.put("printOptions", FormCommonUtil.getList(Arrays.asList(printId))); + } + + // 打印模板批量的标题 + List printIds = StringUtil.isNotEmpty(columnDataModel.getPrintIds()) ? JsonUtil.getJsonToList(columnDataModel.getPrintIds(), String.class) : new ArrayList<>(); + if (printIds != null && printIds.size() > 0) { + map.put("printListOptions", FormCommonUtil.getList(printIds)); + } + + String printIdAll = String.join(",", printId); + map.put("printId", printIdAll); + map.put("moduleId", entity.getId()); + + map.put("groupField", columnDataModel.getGroupField()); + if(Objects.equals(columnDataModel.getType(),2)){ + String treeRelationField = columnDataModel.getTreeRelation().replaceAll("-", "_"); + map.put("treeRelationField", treeRelationField); + } + + //列表子表数据model + List formChildList = new ArrayList<>(); + Map> groupColumnDataMap = mastTable.stream().collect(Collectors.groupingBy(m -> m.getFormMastTableModel().getTable())); + Iterator>> entries = groupColumnDataMap.entrySet().iterator(); + while (entries.hasNext()) { + Map.Entry> formEntries = entries.next(); + Map objectMap = new HashMap<>(); + String className = DataControlUtils.captureName(tableNameRenames.get(formEntries.getKey())); + ColumnListDataModel columnListDataModel = new ColumnListDataModel(); + columnListDataModel.setModelName(className); + columnListDataModel.setModelUpName(DataControlUtils.captureName(className)); + columnListDataModel.setModelLowName(DataControlUtils.initialLowercase(className)); + List allModels = formEntries.getValue(); + allModels.stream().forEach(m -> { + String vModel = m.getFormMastTableModel().getField(); + m.getFormMastTableModel().getMastTable().getFieLdsModel().setVModel(vModel); + }); + List fields = allModels.stream().map(m -> + m.getFormMastTableModel().getField()).collect(Collectors.toList()); + columnListDataModel.setFieldList(fields); + columnListDataModel.setFieLdsModelList(allModels.stream().map(al -> al.getFormMastTableModel()).collect(Collectors.toList())); + columnListDataModel.setTableName(formEntries.getKey()); + formChildList.add(columnListDataModel); + List children = formEntries.getValue().stream().map(allModel -> allModel.getFormMastTableModel().getMastTable()).collect(Collectors.toList()); + //表字段给的范围-转换json + children.forEach(item -> { + item.setFieLdsModel(DataControlUtils.setAbleIDs(item.getFieLdsModel())); + }); + FormColumnTableModel formColumnTableModel = new FormColumnTableModel(); + formColumnTableModel.setChildList(children); + objectMap.put("children", formColumnTableModel); + objectMap.put("module", model.getAreasName()); + objectMap.put("className", className); + } + + //共用 + map.put("children", child); + map.put("mastTable", mastTable); + map.put("fields", mast); + map.put("columnChildren", formChildList); + pKeyName = pKeyName.toLowerCase().trim().replaceAll("f_", ""); + pKeyName = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, pKeyName); + map.put("pKeyName", pKeyName); + map.put("columnList", columnList); + String modelPathName = downloadCodeForm.getClassName().toLowerCase(); + map.put("modelPathName", modelPathName); + map.put("formModelName", entity.getFullName()); + map.put("isMain", true); + + //是否开启高级查询 + Boolean hasSuperQuery = columnDataModel.getHasSuperQuery(); + map.put("superQuery", hasSuperQuery); + + String path = formGenModel.getServiceDirectory() + formGenModel.getFileName(); + String className = model.getClassName().substring(0, 1).toUpperCase() + model.getClassName().substring(1); + String modePath = model.getClassName().substring(0, 1).toLowerCase() + model.getClassName().substring(1); + htmlTemplates(map, templates, path, className, modePath, downloadCodeForm); + + try { + if (VisualWebTypeEnum.FORM_LIST.getType().equals(entity.getWebType()) && !Objects.equals(entity.getType(), 3)) { + Map columnDataModelMap = JsonUtil.stringToMap(entity.getColumnData()); + String colData = JSONObject.toJSONString(columnDataModelMap.get("columnList"), SerializerFeature.WriteMapNullValue); + String colListJsPath = path + File.separator + "html" + File.separator + "web" + File.separator + modelPathName + File.separator + "columnList.js"; + SuperQueryUtil.CreateJsFile(colData, colListJsPath, "columnList"); + if (hasSuperQuery) { + String superSqJsPath = path + File.separator + "html" + File.separator + "web" + File.separator + modelPathName + File.separator + "superQueryJson.js"; + String data = JSONObject.toJSONString(columnDataModelMap.get("columnOptions"), SerializerFeature.WriteMapNullValue); + SuperQueryUtil.CreateJsFile(data, superSqJsPath, "superQueryJson"); + } + } + } catch (Exception e) { + + } + } + + + //----------------------------代码------------------------------------------------------- + + /** + * 生成表集合 + * + * @param genModel 对象 + * @throws SQLException + */ + public void generate(FormGenModel genModel) throws Exception { + VisualdevEntity entity = genModel.getEntity(); + List list = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + DownloadCodeForm downloadCodeForm = genModel.getDownloadCodeForm(); + List tableModelList = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + Map tableNameAll = tableName(tableModelList, downloadCodeForm); + //生成代码 + for (TableModel model : list) { + String table = model.getTable(); + genModel.setTable(table); + genModel.setClassName(tableNameAll.get(model.getTable())); + genModel.setMainTable(false); + if ("1".equals(model.getTypeId())) { + genModel.setClassName(downloadCodeForm.getClassName()); + genModel.setMainTable(true); + this.setCode(genModel); + } else if ("0".equals(model.getTypeId())) { + String name = tableNameAll.get(table); + String className = name.substring(0, 1).toUpperCase() + name.substring(1); + genModel.setClassName(className); + this.setCode(genModel); + } + } + } + + /** + * 生成主表 + * + * @param genModel 对象 + * @throws SQLException + */ + private void setCode(FormGenModel genModel) throws Exception { + DownloadCodeForm downloadCodeForm = genModel.getDownloadCodeForm(); + String className = genModel.getClassName().substring(0, 1).toUpperCase() + genModel.getClassName().substring(1); + Template7Model model = this.templateModel(genModel, className); + //执行代码生成器 + GenerateParamModel generateParamModel = new GenerateParamModel().builder() + .dataSourceUtil(genModel.getDataSourceUtil()) + .path(FormCommonUtil.getLocalBasePath() + genModel.getConfigValueUtil()) + .fileName(genModel.getFileName()) + .templatesPath(genModel.getTemplatePath()) + .downloadCodeForm(downloadCodeForm) + .entity(genModel.getEntity()) + .userInfo(genModel.getUserInfo()) + .configValueUtil(genModel.getConfigValueUtil()) + .linkEntity(genModel.getLinkEntity()) + .pKeyName(genModel.getPKeyName()) + .className(className) + .isMainTable(genModel.isMainTable()) + .table(genModel.getTable()) + .build(); + Map columndata = getcolumndata(generateParamModel); + this.javaGenerate(columndata, model, genModel, genModel.isMainTable()); + } + + /** + * 封装数据 + * + * @param genModel + * @param className + * @return + */ + private Template7Model templateModel(FormGenModel genModel, String className) { + DownloadCodeForm downloadCodeForm = genModel.getDownloadCodeForm(); + Template7Model template7Model = new Template7Model(); + template7Model.setClassName(className); + template7Model.setServiceDirectory(genModel.getServiceDirectory()); + template7Model.setCreateDate(DateUtil.daFormat(new Date())); + template7Model.setCreateUser(GenBaseInfo.AUTHOR); + template7Model.setCopyright(GenBaseInfo.COPYRIGHT); + template7Model.setDescription(downloadCodeForm.getDescription()); + return template7Model; + } + + /** + * 封装数据 + * + * @param formAllModel + */ + private Map forDataMode(FormGenModel genModel, List formAllModel) { + VisualdevEntity entity = genModel.getEntity(); + FormDataModel formData = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + List tableModelList = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + RecursionForm recursionForm = new RecursionForm(list, tableModelList); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + Map tableNameAll = this.tableName(tableModelList, genModel.getDownloadCodeForm()); + return tableNameAll; + } + + /** + * 封装数据 + * + * @param columndata + * @param model + * @param genModel + * @param isMast + */ + private void javaGenerate(Map columndata, Template7Model model, FormGenModel genModel, boolean isMast) { + CustomGenerator mpg = new CustomGenerator(columndata); + // 全局配置 + GlobalConfig gc = new GlobalConfig(); + gc.setFileOverride(true); + // 不需要ActiveRecord特性的请改为false + gc.setActiveRecord(false); + // XML 二级缓存 + gc.setEnableCache(false); + // XML ResultMap + gc.setBaseResultMap(false); + // XML columList + gc.setBaseColumnList(false); + gc.setAuthor(model.getCreateUser()); + gc.setOpen(false); + + // 自定义文件命名,注意 %s 会自动填充表实体属性! + String className = model.getClassName(); + if (isMast) { + gc.setControllerName(className + GenFileNameSuffix.CONTROLLER); + } + gc.setEntityName(className + GenFileNameSuffix.ENTITY); + gc.setMapperName(className + GenFileNameSuffix.MAPPER); + gc.setXmlName(className + GenFileNameSuffix.MAPPER_XML); + gc.setServiceName(className + GenFileNameSuffix.SERVICE); + gc.setServiceImplName(className + GenFileNameSuffix.SERVICEIMPL); + mpg.setGlobalConfig(gc); + + // 数据源配置 + UserInfo userInfo = genModel.getUserInfo(); + DbLinkEntity linkEntity = genModel.getLinkEntity(); + + mpg.setDataSource(SourceUtil.dbConfig(TenantDataSourceUtil.getTenantSchema(), linkEntity)); + + // 策略配置 + StrategyConfig strategy = new StrategyConfig(); + strategy.setEntityLombokModel(true); + // 表名生成策略 + strategy.setNaming(NamingStrategy.underline_to_camel); + // 需要生成的表 + String table = genModel.getTable(); + strategy.setInclude(table); + strategy.setRestControllerStyle(true); + mpg.setStrategy(strategy); + + // 包配置 + PackageConfig pc = new PackageConfig(); + DownloadCodeForm downloadCodeForm = genModel.getDownloadCodeForm(); + pc.setParent(downloadCodeForm.getModulePackageName()); + mpg.setPackageInfo(pc); + + // 自定义配置 + InjectionConfig cfg = new InjectionConfig() { + @Override + public void initMap() { + // to do nothing + } + }; + List focList = new ArrayList<>(); + String javaPath = model.getServiceDirectory(); + String templatePath = this.tempPath(genModel); + String fileName = genModel.getFileName(); + String path = genModel.getTemplateCodePath(); + String module = downloadCodeForm.getModule(); + String modulePackageName = downloadCodeForm.getModulePackageName(); + String flowWorkPath = "jnpf-" + module + File.separator + "jnpf-" + module + "-%s" + File.separator + "src" + File.separator + "main" + File.separator + "java" + File.separator + modulePackageName + File.separator + "%s"; + if(Objects.equals(genModel.getEntity(),3)){ + flowWorkPath = "jnpf-workflow" + File.separator + "jnpf-workflow-form" + File.separator + "jnpf-workflow-form-%s" + File.separator + "src" + File.separator + "main" + File.separator + "java" + File.separator + "jnpf" + File.separator + "form" + File.separator + "%s"; + } + if (isMast) { + String controller = String.format(flowWorkPath, "controller", "controller"); + focList.add(new FileOutConfig("java" + File.separator + "Controller.java.vm") { + @Override + public String outputFile(TableInfo tableInfo) { + return javaPath + fileName + File.separator + "java" + File.separator + controller + File.separator + tableInfo.getControllerName() + StringPool.DOT_JAVA; + } + }); + } + String entity = String.format(flowWorkPath, "entity", "entity"); + focList.add(new FileOutConfig("java" + File.separator + "Entity.java.vm") { + @Override + public String outputFile(TableInfo tableInfo) { + List fieldAll = tableInfo.getFields(); + TableField mainTableField = fieldAll.stream().filter(tableField -> tableField.isKeyFlag()).findFirst().orElse(null); + fieldAll = fieldAll.stream().filter(DataControlUtils.distinctByKey(t -> t.getName())).collect(Collectors.toList()); + if (mainTableField != null) { + fieldAll.stream().filter(tableField -> tableField.getName().equals(mainTableField.getName())).forEach(t -> t.setKeyFlag(mainTableField.isKeyFlag())); + } + for (TableField field : fieldAll) { + String name = field.getName().toLowerCase().replaceAll("f_", ""); + field.setPropertyName(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, name)); + } + tableInfo.setFields(fieldAll); + return javaPath + fileName + File.separator + "java" + File.separator + entity + File.separator + tableInfo.getEntityName() + StringPool.DOT_JAVA; + } + }); + String mapper = String.format(flowWorkPath, "biz", "mapper"); + focList.add(new FileOutConfig("java" + File.separator + "Mapper.java.vm") { + @Override + public String outputFile(TableInfo tableInfo) { + return javaPath + fileName + File.separator + "java" + File.separator + mapper + File.separator + tableInfo.getMapperName() + StringPool.DOT_JAVA; + } + }); + String mapperxml = "resources" + File.separator + "mapper"; + focList.add(new FileOutConfig("java" + File.separator + "Mapper.xml.vm") { + @Override + public String outputFile(TableInfo tableInfo) { + return javaPath + fileName + File.separator + mapperxml + File.separator + tableInfo.getMapperName() + StringPool.DOT_XML; + } + }); + String service = String.format(flowWorkPath, "biz", "service"); + focList.add(new FileOutConfig("java" + File.separator + "Service.java.vm") { + @Override + public String outputFile(TableInfo tableInfo) { + return javaPath + fileName + File.separator + "java" + File.separator + service + File.separator + tableInfo.getServiceName() + StringPool.DOT_JAVA; + } + }); + String serviceImpl = String.format(flowWorkPath, "biz", "service" + File.separator + "impl"); + focList.add(new FileOutConfig("java" + File.separator + "ServiceImpl.java.vm") { + @Override + public String outputFile(TableInfo tableInfo) { + return javaPath + fileName + File.separator + "java" + File.separator + serviceImpl + File.separator + tableInfo.getServiceImplName() + StringPool.DOT_JAVA; + } + }); + cfg.setFileOutConfigList(focList); + mpg.setTemplate(new TemplateConfig().setXml(null).setMapper(null).setController(null).setEntity(null).setService(null).setServiceImpl(null)); + mpg.setCfg(cfg); + // 执行生成 + mpg.execute(path); + } + + + /** + * 获取传递参数 + * + * @param generateParamModel + * @return + * @throws Exception + */ + private Map getcolumndata(GenerateParamModel generateParamModel) throws Exception { + Map columndata = new HashMap<>(16); + DownloadCodeForm downloadCodeForm = generateParamModel.getDownloadCodeForm(); + VisualdevEntity entity = generateParamModel.getEntity(); + DbLinkEntity linkEntity = generateParamModel.getLinkEntity(); + String className = generateParamModel.getClassName(); + String pKeyName = generateParamModel.getPKeyName(); + //代码生成基础信息 + Template7Model template7Model = GenerateCommon.getTemplate7Model(className); + template7Model.setTableName(downloadCodeForm.getClassName()); + template7Model.setDescription(downloadCodeForm.getDescription()); + generateParamModel.setTemplate7Model(template7Model); + //自定义包名 + String modulePackageName = downloadCodeForm.getModulePackageName(); + //tableJson + List tableModelList = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + //formTempJson + FormDataModel formData = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + //设置乐观锁参数用于其他位置判断 + generateParamModel.setConcurrencyLock(formData.getConcurrencyLock()); + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + //主表 + TableModel mainTable = tableModelList.stream().filter(t -> t.getTypeId().equals("1")).findFirst().orElse(null); + //表别名 + Map tableRenames = tableName(tableModelList, generateParamModel.getDownloadCodeForm()); + String mainModelName = DataControlUtils.captureName(tableRenames.get(mainTable.getTable())); + //赋值主键 + tableModelList.stream().forEach(t -> { + try { + t.setTableKey(VisualUtils.getpKey(linkEntity, t.getTable())); + } catch (SQLException sqlException) { + sqlException.printStackTrace(); + } + }); + + //所有控件 + List formAllModel = new ArrayList<>(); + RecursionForm recursionForm = new RecursionForm(); + recursionForm.setTableModelList(JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class)); + recursionForm.setList(list); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + //主表控件 + List mast = formAllModel.stream().filter(t -> FormEnum.mast.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + //子表控件 + List table = formAllModel.stream().filter(t -> FormEnum.table.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + //副表控件 + List mastTable = formAllModel.stream().filter(t -> FormEnum.mastTable.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + + List subTableName = new ArrayList<>(); + for (FormAllModel allModel : table) { + FormColumnTableModel childList = allModel.getChildList(); + if (childList != null) { + subTableName.add(childList.getTableName()); + } + } + //子表(tableField,tableName)->tablefield1->realname + Map childKeyTableNameMap = new HashMap<>(8); + table.stream().forEach(t -> childKeyTableNameMap.put(t.getChildList().getTableModel(), t.getChildList().getTableName())); + + //子表集合 + List childTableNameList = new ArrayList<>(); + //全部表 + List allTableNameList = new ArrayList<>(); + for (TableModel tableModel : tableModelList) { + TableModel Model = new TableModel(); + Model.setInitName(tableModel.getTable()); + Model.setTable(tableRenames.get(tableModel.getTable())); + Model.setTableField(DataControlUtils.captureName(tableModel.getTableField())); + if (Model.getTable().equals(mainTable.getTable())) { + Model.setTableTag("main"); + } else { + Model.setTableTag(subTableName.contains(Model.getTable()) ? "sub" : "sub-jnpf"); + } + allTableNameList.add(Model); + if ("0".equals(tableModel.getTypeId())) { + childTableNameList.add(Model); + } + } + TableModel mainTableModel = tableModelList.stream().filter(t -> t.getTypeId().equals("1")).findFirst().orElse(null); + //主表的字段 + if (mainTableModel == null || CollectionUtils.isEmpty(mainTableModel.getFields())) { + throw new SQLException(MsgCode.COD001.get()); + } + + //主表的属性 + List mastTableHandle = new ArrayList<>(); + for (int i = 0; i < mast.size(); i++) { + FormAllModel mastModel = mast.get(i); + FieLdsModel fieLdsModel = mastModel.getFormColumnModel().getFieLdsModel(); + //接口templatejson转换 + if (StringUtil.isNotEmpty(fieLdsModel.getVModel())) { + List templateJson = fieLdsModel.getConfig().getTemplateJson(); + String json = templateJson.size() > 0 ? JsonUtil.getObjectToString(templateJson) : fieLdsModel.getTemplateJson(); + fieLdsModel.setTemplateJson(json); + mastTableHandle.add(fieLdsModel); + } + } + //副表模型 + List columnTableHandle = new ArrayList<>(); + //副表数据model + Map> groupColumnDataMap = mastTable.stream().collect(Collectors.groupingBy(m -> m.getFormMastTableModel().getTable())); + for (String key : groupColumnDataMap.keySet()) { + String classNameMast = DataControlUtils.captureName(tableRenames.get(key)); + ColumnListDataModel columnListDataModel = new ColumnListDataModel(); + columnListDataModel.setModelName(classNameMast); + columnListDataModel.setModelUpName(DataControlUtils.captureName(classNameMast)); + columnListDataModel.setModelLowName(DataControlUtils.initialLowercase(classNameMast)); + List allModels = groupColumnDataMap.get(key); + List fields = allModels.stream().map(m -> m.getFormMastTableModel().getField()).collect(Collectors.toList()); + columnListDataModel.setFieldList(fields); + columnListDataModel.setFieLdsModelList(allModels.stream().map(al -> al.getFormMastTableModel()).collect(Collectors.toList())); + columnListDataModel.setTableName(key); + List collect = allModels.stream().map(all -> all.getFormMastTableModel().getMastTable().getFieLdsModel()).collect(Collectors.toList()); + collect.stream().forEach(c -> { + String vmodel = c.getVModel().substring(c.getVModel().lastIndexOf("jnpf_")).replace("jnpf_", ""); + c.setVModel(vmodel); + List templateJson = c.getConfig().getTemplateJson(); + String json = templateJson.size() > 0 ? JsonUtil.getObjectToString(templateJson) : c.getTemplateJson(); + c.setTemplateJson(json); + }); + columnListDataModel.setFieLdsModels(collect); + + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equalsIgnoreCase(columnListDataModel.getTableName())).findFirst().orElse(null); + if (ObjectUtil.isNotEmpty(tableModel)) { + columnListDataModel.setMainKey(tableModel.getRelationField()); + columnListDataModel.setRelationField(tableModel.getTableField()); + columnListDataModel.setMainUpKey(DataControlUtils.captureName(tableModel.getRelationField())); + columnListDataModel.setRelationUpField(DataControlUtils.captureName(tableModel.getTableField())); + String tableKey = tableModel.getTableKey().toLowerCase().replace("f_", ""); + tableKey = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, tableKey); + columnListDataModel.setMainField(DataControlUtils.captureName(tableKey)); + } + columnTableHandle.add(columnListDataModel); + } + //子表的属性 + List> childTableHandle = new ArrayList<>(); + for (int i = 0; i < table.size(); i++) { + FormColumnTableModel childList = table.get(i).getChildList(); + List childListAll = childList.getChildList(); + String classNameChild = DataControlUtils.captureName(tableRenames.get(childList.getTableName())); + //子表别名 + childList.setAliasClassName(classNameChild); + childList.setAliasUpName(DataControlUtils.captureName(classNameChild)); + childList.setAliasLowName(DataControlUtils.initialLowercase(classNameChild)); + for (FormColumnModel columnModel : childListAll) { + FieLdsModel fieLdsModel = columnModel.getFieLdsModel(); + List templateJson = fieLdsModel.getConfig().getTemplateJson(); + String json = templateJson.size() > 0 ? JsonUtil.getObjectToString(templateJson) : fieLdsModel.getTemplateJson(); + fieLdsModel.setTemplateJson(json); + } + Map childs = JsonUtil.entityToMap(childList); + Optional first1 = tableModelList.stream().filter(t -> t.getTable().equals(childList.getTableName())).findFirst(); + if (!first1.isPresent()) { + throw new SQLException(MsgCode.COD001.get()); + } + TableModel tableModel = first1.get(); + //获取主键-外键字段-关联主表字段 + String chidKeyName = VisualUtils.getpKey(linkEntity, tableModel.getTable()); + String chidKeyField = chidKeyName.trim().toLowerCase().replaceAll("f_", ""); + chidKeyField = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, chidKeyField); + childs.put("chidKeyName", chidKeyField); + String tableField = tableModel.getTableField().trim().replaceAll(":\"f_", ":\""); + childs.put("tablefield", tableField); + String relationField = tableModel.getRelationField().trim().replaceAll(":\"f_", ":\""); + childs.put("relationField", relationField); + childTableHandle.add(childs); + } + + //++++++++++++++++++++++++++++主副子通用参数++++++++++++++++++++++++++// + //微服务标识 + columndata.put("isCloud", GenerateCommon.IS_CLOUD); + //是列表,是流程判断 + if (VisualWebTypeEnum.FORM_LIST.getType().equals(entity.getWebType()) && !Objects.equals(entity.getType(), 3)) { + columndata.put("isList", true); + //添加列表参数 + getListColumndata(generateParamModel, columndata); + } + if (Objects.equals(entity.getEnableFlow(), 1)) { + columndata.put("isFlow", true); + } + //后台 + columndata.put("module", downloadCodeForm.getModule()); + columndata.put("genInfo", template7Model); + columndata.put("modelName", template7Model.getClassName()); + //表单非系统控件字段--为了加null可以更新 + columndata.put("tableNotSystemField", GenerateCommon.getNotSystemFields(mast, mastTable, table, generateParamModel)); + //主副子 控件字段(已处理数据) + columndata.put("mastTableHandle", mastTableHandle);//原system + columndata.put("columnTableHandle", columnTableHandle);//原columnChildren + columndata.put("childTableHandle", childTableHandle);//原child + columndata.put("children", childTableHandle);//原child + columndata.put("mainModelName", mainModelName); + //数据源 + if (ObjectUtil.isNotEmpty(linkEntity)) { + columndata.put("DS", linkEntity.getFullName()); + } + // 数据源配置 + DataSourceConfig dsc = SourceUtil.dbConfig(TenantDataSourceUtil.getTenantSchema(), linkEntity); + //数据库类型 + columndata.put("dbType", dsc.getDbType().getDb()); + // 包名 + columndata.put("modulePackageName", modulePackageName); + columndata.put("pKeyName", pKeyName); + columndata.put("VisualDevId", entity.getId()); + + columndata.put("formDataStr", JSONObject.toJSONString(GenerateCommon.objRemoveJson(entity.getFormData()))); + columndata.put("tableListStr", JSONObject.toJSONString(entity.getVisualTables())); + //++++++++++++++++++++++++++++仅主表参数++++++++++++++++++++++++++// + if (generateParamModel.isMainTable()) { + //后台 + columndata.put("main", true); + //模板名称 + columndata.put("formModelName", entity.getFullName()); + //乐观锁 + columndata.put("version", formData.getConcurrencyLock()); + //删除标志 + columndata.put("logicalDelete", formData.getLogicalDelete()); + //雪花 + columndata.put("snowflake", formData.getPrimaryKeyPolicy() == 1); + } + return columndata; + } + + /** + * 获取列表传递参数 + * + * @param generateParamModel + * @return + * @throws Exception + */ + private void getListColumndata(GenerateParamModel generateParamModel, Map listMap) throws Exception { + DownloadCodeForm downloadCodeForm = generateParamModel.getDownloadCodeForm(); + VisualdevEntity entity = generateParamModel.getEntity(); + DbLinkEntity linkEntity = generateParamModel.getLinkEntity(); + String className = generateParamModel.getClassName(); + //代码生成基础信息 + Template7Model template7Model = GenerateCommon.getTemplate7Model(className); + template7Model.setTableName(downloadCodeForm.getClassName()); + template7Model.setDescription(downloadCodeForm.getDescription()); + generateParamModel.setTemplate7Model(template7Model); + //tableJson + List tableModelList = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + //formTempJson + FormDataModel formData = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + //设置乐观锁参数用于其他位置判断 + generateParamModel.setConcurrencyLock(formData.getConcurrencyLock()); + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + //主表 + TableModel mainTable = tableModelList.stream().filter(t -> t.getTypeId().equals("1")).findFirst().orElse(null); + //表别名 + Map tableRenames = tableName(tableModelList, generateParamModel.getDownloadCodeForm()); + //赋值主键 + tableModelList.stream().forEach(t -> { + try { + t.setTableKey(VisualUtils.getpKey(linkEntity, t.getTable())); + } catch (SQLException sqlException) { + sqlException.printStackTrace(); + } + }); + List formAllModel = new ArrayList<>(); + RecursionForm recursionForm = new RecursionForm(); + recursionForm.setTableModelList(JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class)); + recursionForm.setList(list); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + //主表数据 + List mast = formAllModel.stream().filter(t -> FormEnum.mast.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + //子表数据 + List table = formAllModel.stream().filter(t -> FormEnum.table.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + //副表数据 + List mastTable = formAllModel.stream().filter(t -> FormEnum.mastTable.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + List subTableName = new ArrayList<>(); + for (FormAllModel allModel : table) { + FormColumnTableModel childList = allModel.getChildList(); + if (childList != null) { + subTableName.add(childList.getTableName()); + } + } + //子表集合 + List childTableNameList = new ArrayList<>(); + //全部表 + List allTableNameList = new ArrayList<>(); + for (TableModel tableModel : tableModelList) { + TableModel Model = new TableModel(); + Model.setInitName(tableModel.getTable()); + Model.setTable(tableRenames.get(tableModel.getTable())); + Model.setTableField(DataControlUtils.captureName(tableModel.getTableField())); + if (Model.getTable().equals(mainTable.getTable())) { + Model.setTableTag("main"); + } else { + Model.setTableTag(subTableName.contains(Model.getTable()) ? "sub" : "sub-jnpf"); + } + allTableNameList.add(Model); + if ("0".equals(tableModel.getTypeId())) { + childTableNameList.add(Model); + } + } + //子表(tableField,tableName)->tablefield1->realname + Map childKeyTableNameMap = new HashMap<>(8); + table.stream().forEach(t -> childKeyTableNameMap.put(t.getChildList().getTableModel(), t.getChildList().getTableName())); + TableModel mainTableModel = tableModelList.stream().filter(t -> t.getTypeId().equals("1")).findFirst().orElse(null); + //主表的字段 + if (mainTableModel == null || CollectionUtils.isEmpty(mainTableModel.getFields())) { + throw new SQLException(MsgCode.COD001.get()); + } + + //columnTempJson + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(entity.getColumnData(), ColumnDataModel.class); + //app 列表对象 + ColumnDataModel appColumnDataModel = JsonUtil.getJsonToBean(entity.getAppColumnData(), ColumnDataModel.class); + + //按钮 + List btnPcList = JsonUtil.getJsonToList(columnDataModel.getBtnsList(), BtnData.class); + List columnBtnPcList = JsonUtil.getJsonToList(columnDataModel.getColumnBtnsList(), BtnData.class); + List btnAppList = JsonUtil.getJsonToList(appColumnDataModel.getBtnsList(), BtnData.class); + List columnBtnAppList = JsonUtil.getJsonToList(appColumnDataModel.getColumnBtnsList(), BtnData.class); + List btnDataList = new ArrayList<>(btnPcList); + List collect3 = btnPcList.stream().map(BtnData::getValue).collect(Collectors.toList()); + btnDataList.addAll(btnAppList.stream().filter(t -> !collect3.contains(t.getValue())).collect(Collectors.toList())); + List columnBtnDataList = new ArrayList<>(columnBtnPcList); + List collect4 = columnBtnPcList.stream().map(BtnData::getValue).collect(Collectors.toList()); + columnBtnDataList.addAll(columnBtnAppList.stream().filter(t -> !collect4.contains(t.getValue())).collect(Collectors.toList())); + //是否有导入按钮--webtype==2开启列表 + boolean hasUploadBtn = Objects.equals(entity.getWebType(), 2) && btnDataList.stream().anyMatch(btn -> btn.getValue().equals("upload")); + //是否有下载按钮 + boolean hasDownloadBtn = Objects.equals(entity.getWebType(), 2) && btnDataList.stream().anyMatch(btn -> btn.getValue().equals("download")); + //是否有下载按钮 + boolean hasPrintBtn = Objects.equals(entity.getWebType(), 2) && btnDataList.stream().anyMatch(btn -> btn.getValue().equals("batchPrint")); + boolean hasRemoveBtn = Objects.equals(entity.getWebType(), 2) && btnDataList.stream().anyMatch(btn -> btn.getValue().equals("batchRemove")); + //列表和查询 + List columnList = JsonUtil.getJsonToList(columnDataModel.getColumnList(), ColumnListField.class); + List searchList = JsonUtil.getJsonToList(columnDataModel.getSearchList(), SearchTypeModel.class); + List columnAppList = JsonUtil.getJsonToList(appColumnDataModel.getColumnList(), ColumnListField.class); + List searchAppList = JsonUtil.getJsonToList(appColumnDataModel.getSearchList(), SearchTypeModel.class); + //-----------------------------------------------------search start--------------------------------------- + //列表全字段 + List columnListAll = new ArrayList<>(columnList); + List cLaArr = columnListAll.stream().map(ColumnListField::getProp).collect(Collectors.toList()); + columnAppList.stream().forEach(t -> { + if (!cLaArr.contains(t.getProp())) { + columnListAll.add(t); + cLaArr.add(t.getProp()); + } + }); + //查询全字段 + List searchListAll = new ArrayList<>(searchList); + List cSaArr = searchListAll.stream().map(SearchTypeModel::getId).collect(Collectors.toList()); + searchAppList.stream().forEach(t -> { + if (!cSaArr.contains(t.getId())) { + searchListAll.add(t); + cSaArr.add(t.getId()); + } + }); + + //添加左侧树查询字段 + addTreeSearchField(mainTableModel, columnDataModel, searchList); + addTreeSearchField(mainTableModel, columnDataModel, searchAppList); + addTreeSearchField(mainTableModel, columnDataModel, searchListAll); + + //查询字段转换 + List groupModels = getListSearchGroupModels(tableModelList, mainTable, tableRenames, childKeyTableNameMap, mainTableModel, searchList); + List groupAppModels = getListSearchGroupModels(tableModelList, mainTable, tableRenames, childKeyTableNameMap, mainTableModel, searchAppList); + List groupAllModels = getListSearchGroupModels(tableModelList, mainTable, tableRenames, childKeyTableNameMap, mainTableModel, searchListAll); + + //-----------------------------------------------------search enddd--------------------------------------- + //权限 + AuthorityModel authority = new AuthorityModel(); + BeanUtil.copyProperties(columnDataModel, authority); + //导入字段 + List> allUploadTemplates = new ArrayList<>(); + boolean importHasChildren = false; + String importType = "1"; + UploaderTemplateModel uploaderTemplateModel = JsonUtil.getJsonToBean(columnDataModel.getUploaderTemplateJson(), UploaderTemplateModel.class); + if (hasUploadBtn && uploaderTemplateModel != null && uploaderTemplateModel.getSelectKey() != null) { + importType = uploaderTemplateModel.getDataType(); + List selectKey = uploaderTemplateModel.getSelectKey(); + Map> childMap = new HashMap<>(); + //判断是否存在子表的导入导出 + for (String item : selectKey) { + if (item.toLowerCase().contains(JnpfKeyConsts.CHILD_TABLE_PREFIX)) { + importHasChildren = true; + String[] split = item.split("-"); + if (childMap.get(split[0]) == null) { + List keys = new ArrayList<>(); + keys.add(split[1]); + childMap.put(split[0], keys); + } else { + List keys = childMap.get(split[0]); + keys.add(split[1]); + childMap.replace(split[0], keys); + } + } else { + //主表字段 + for (FormAllModel fam : mast) { + FieLdsModel fieLdsModel = fam.getFormColumnModel().getFieLdsModel(); + if (item.equals(fieLdsModel.getVModel())) { + Map map = JsonUtil.entityToMap(fieLdsModel); + map.put("label", fieLdsModel.getConfig().getLabel()); + allUploadTemplates.add(map); + } + } + //副表字段 + for (FormAllModel fam : mastTable) { + FieLdsModel fieLdsModel = fam.getFormMastTableModel().getMastTable().getFieLdsModel(); + if (item.equals(fieLdsModel.getVModel())) { + Map map = JsonUtil.entityToMap(fieLdsModel); + map.put("label", fieLdsModel.getConfig().getLabel()); + allUploadTemplates.add(map); + } + } + } + } + for (FormAllModel fam : table) { + FormColumnTableModel child = fam.getChildList(); + FormColumnTableModel childRes = new FormColumnTableModel(); + BeanUtil.copyProperties(child, childRes); + String childClassName = DataControlUtils.captureName(tableRenames.get(childRes.getTableName())); + //子表别名 + childRes.setAliasClassName(childClassName); + childRes.setAliasUpName(DataControlUtils.captureName(childClassName)); + childRes.setAliasLowName(DataControlUtils.initialLowercase(childClassName)); + String tableModel = child.getTableModel(); + List childList1 = child.getChildList(); + //获取该子表的所有需要导入字段 + List keys = childMap.get(tableModel) != null ? childMap.get(tableModel) : Collections.EMPTY_LIST; + List collect = childList1.stream().filter(t -> keys.contains(t.getFieLdsModel().getVModel())).collect(Collectors.toList()); + childRes.setChildList(collect); + Map childFilesMap = JsonUtil.entityToMap(childRes); + childFilesMap.put("vModel", childRes.getTableModel()); + //添加整个子表 + allUploadTemplates.add(childFilesMap); + } + } + //导入重复字段,需要标记(子表也以label判断重复) + Set set = new HashSet<>(); + List nameAgain = new ArrayList<>(); + for (Map f : allUploadTemplates) { + if (!set.add(String.valueOf(f.get("label")))) { + nameAgain.add(String.valueOf(f.get("vModel"))); + } + } + + //树形列表参数 + if (Objects.equals(columnDataModel.getType(), 5)) { + columnDataModel.setHasPage(false); + } + String parentField = StringUtil.isNotEmpty(columnDataModel.getParentField()) ? columnDataModel.getParentField() : ""; + if (StringUtil.isNotEmpty(parentField)) { + parentField = parentField.substring(0, 1).toUpperCase() + parentField.substring(1); + } + String subField = StringUtil.isNotEmpty(columnDataModel.getSubField()) ? columnDataModel.getSubField() : ""; + if (StringUtil.isNotEmpty(subField)) { + subField = subField.substring(0, 1).toUpperCase() + subField.substring(1); + } + //导出字段属性转换 + List listOptions = GenerateCommon.getExpotColumn(columnList); + //++++++++++++++++++++++++++++主副子通用参数++++++++++++++++++++++++++/ + listMap.put("hasPage", columnDataModel.getHasPage()); + listMap.put("defaultSidx", columnDataModel.getDefaultSidx()); + listMap.put("sort", columnDataModel.getSort()); + listMap.put("authority", authority); + //app pc 数据权限是否开启 + listMap.put("pcDataPermisson", columnDataModel.getUseDataPermission()); + listMap.put("appDataPermisson", appColumnDataModel.getUseDataPermission()); + listMap.put("groupModels", groupModels); + listMap.put("groupAppModels", groupAppModels); + listMap.put("childTableNameList", childTableNameList); + listMap.put("allTableNameList", allTableNameList); + //是否开启高级查询 + listMap.put("superQuery", columnDataModel.getHasSuperQuery()); + listMap.put("ruleQuery", true); + + //++++++++++++++++++++++++++++仅主表参数++++++++++++++++++++++++++// + if (generateParamModel.isMainTable()) { + //列表全属性 + listMap.put("columnDataStr", JSONObject.toJSONString(GenerateCommon.objRemoveJson(entity.getColumnData()))); + listMap.put("appColumnDataStr", JSONObject.toJSONString(GenerateCommon.objRemoveJson(entity.getAppColumnData()))); + listMap.put("columnData", JsonUtil.stringToMap(entity.getColumnData())); + //列表-pc-app-并集 + listMap.put("columnList", columnList); + listMap.put("searchList", searchList); + listMap.put("columnAppList", columnAppList); + listMap.put("searchAppList", searchAppList); + listMap.put("columnListAll", columnListAll); + listMap.put("searchListAll", searchListAll); + //子表样式 + listMap.put("childTableStyle", columnDataModel.getChildTableStyle()); + + //左侧树 + listMap.put("leftTreeTable", columnDataModel.getType() == 2); + //分组 + listMap.put("groupTable", columnDataModel.getType() == 3); + listMap.put("groupField", columnDataModel.getGroupField()); + //行内编辑 + listMap.put("lineEdit", columnDataModel.getType() == 4); + //树形参数 + listMap.put("treeTable", columnDataModel.getType() == 5); + //合计 + boolean configurationTotal = columnDataModel.isShowSummary(); + if (columnDataModel.getType() == 3 || columnDataModel.getType() == 5) { + configurationTotal = false; + } + listMap.put("configurationTotal", configurationTotal); + List summaryList = CollectionUtils.isEmpty(columnDataModel.getSummaryField()) ? Collections.EMPTY_LIST : columnDataModel.getSummaryField(); + listMap.put("fieldsTotal", JsonUtil.getObjectToString(summaryList)); + //按键 + listMap.put("btnsList", btnDataList); + listMap.put("columnBtnsList", columnBtnDataList); + listMap.put("btnPcList", btnPcList); + listMap.put("columnBtnPcList", columnBtnPcList); + + listMap.put("hasDownloadBtn", hasDownloadBtn); + listMap.put("hasUploadBtn", hasUploadBtn); + listMap.put("hasPrintBtn", hasPrintBtn); + listMap.put("hasRemoveBtn", hasRemoveBtn); + + listMap.put("parentField", parentField); + listMap.put("subField", subField); + //导入的字段 + listMap.put("importFields", allUploadTemplates); + //是否有子表-用于判断导入excel表头是否有两行 + listMap.put("importHasChildren", importHasChildren); + listMap.put("importType", importType); + //导入字段名称是否重复 + listMap.put("nameAgain", nameAgain); + listMap.put("listOptions", listOptions); + + // 是否存在列表子表数据 + listMap.put("hasSub", mastTable.size() > 0 ? true : false); + + //复杂表头 + List complexFieldList = new ArrayList<>(); + List> complexHeaderList = new ArrayList<>(); + for (HeaderModel headerModel : columnDataModel.getComplexHeaderList()) { + complexFieldList.addAll(headerModel.getChildColumns()); + Map map = JsonUtil.entityToMap(headerModel); + //复杂表头添加导入字段信息 + List> uploadFieldList = new ArrayList<>(); + for (Map uploadmap : allUploadTemplates) { + if (headerModel.getChildColumns().contains(uploadmap.get("vModel"))) { + uploadFieldList.add(uploadmap); + } + } + map.put("uploadFieldList", uploadFieldList); + complexHeaderList.add(map); + } + listMap.put("complexHeaderList", JsonUtil.getListToJsonArray(complexHeaderList)); + listMap.put("complexFieldList", JsonUtil.getListToJsonArray(complexFieldList)); + + } + } + + /** + * 添加左侧树查询字段 + * + * @param mainTableModel + * @param columnDataModel + * @param searchListAll + */ + private static void addTreeSearchField(TableModel mainTableModel, ColumnDataModel columnDataModel, List searchListAll) { + List cSaArr = searchListAll.stream().map(SearchTypeModel::getId).collect(Collectors.toList()); + //左侧树-若查询列表内没有需要添加到查询字段内 + if (Objects.equals(columnDataModel.getType(), 2)) { + String treeRelationField = columnDataModel.getTreeRelation(); + if (!cSaArr.contains(treeRelationField)) { + SearchTypeModel searchTypeModel = new SearchTypeModel(); + searchTypeModel.setId(treeRelationField); + searchTypeModel.setSearchType(2); + if (columnDataModel.getTreeDataSource().equals("organize")) { + searchTypeModel.setJnpfKey(JnpfKeyConsts.COMSELECT); + searchTypeModel.setSearchType(1); + } + searchTypeModel.setLabel("tree"); + searchTypeModel.setTableName(mainTableModel.getTable()); + searchListAll.add(searchTypeModel); + cSaArr.add(searchTypeModel.getId()); + } + } + } + + + /** + * 查询字段配置调整 + * + * @param tableModelList + * @param mainTable + * @param tableRenames + * @param childKeyTableNameMap + * @param mainTableModel + * @param searchListAll + * @return + */ + private static List getListSearchGroupModels(List tableModelList, TableModel mainTable, Map tableRenames, Map childKeyTableNameMap, TableModel mainTableModel, List searchListAll) { + List groupModels = new ArrayList<>(); + List rangeToLike = new ArrayList() {{ + add(JnpfKeyConsts.COM_INPUT); + add(JnpfKeyConsts.TEXTAREA); + }}; + //查询全字段-转换--pagenation-字段不用替换了 + searchListAll.stream().forEach(t -> { + t.setId(t.getId().replace("-", "_")); + //单行和多行范围查询转模糊 + if (Objects.equals(t.getSearchType(), 3) && rangeToLike.contains(t.getConfig().getJnpfKey())) { + t.setSearchType(2); + } + }); + if (searchListAll.size() > 0) { + //主表 + for (TableFields tableFields : mainTableModel.getFields()) { + searchListAll.stream().forEach(searchTypeModel -> { + if (searchTypeModel.getId().equals(tableFields.getField())) { + searchTypeModel.setDataType(tableFields.getDataType()); + } + }); + } + //鉴别列表子表正则 + String reg = "^[jnpf_]\\S*_jnpf\\S*"; + searchListAll.stream().filter(s -> s.getId().matches(reg)).forEach(cl -> { + String s = cl.getId(); + String s1 = s.substring(s.lastIndexOf("jnpf_")).replace("jnpf_", ""); + String s2 = s.substring(s.indexOf("_") + 1, s.lastIndexOf("_jnpf")); + cl.setAfterVModel(s1); + cl.setTableName(s2); + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equalsIgnoreCase(s2)).findFirst().orElse(null); + cl.setDataType(tableModel.getFields().stream().filter(t -> t.getField().equalsIgnoreCase(s1)).findFirst().orElse(null).getDataType()); + } + ); + //副表 + Map> collect = searchListAll.stream().filter(s -> s.getId().matches(reg)).collect(Collectors.groupingBy(t -> t.getTableName())); + groupModels = collect.entrySet().stream().map(c -> { + ListSearchGroupModel groupModel = new ListSearchGroupModel(); + groupModel.setModelName(tableRenames.get(c.getKey())); + groupModel.setTableName(c.getKey()); + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equalsIgnoreCase(c.getKey())).findFirst().orElse(null); + groupModel.setForeignKey(tableModel.getTableField()); + groupModel.setMainKey(tableModel.getRelationField()); + groupModel.setSearchTypeModelList(c.getValue()); + return groupModel; + } + ).collect(Collectors.toList()); + + //子表 + Map> collect1 = searchListAll.stream().filter(s -> s.getId().toLowerCase().contains(JnpfKeyConsts.CHILD_TABLE_PREFIX)) + .collect(Collectors.groupingBy(t -> t.getId().substring(0, t.getId().lastIndexOf("_")))); + List collect2 = collect1.entrySet().stream().map(c -> { + ListSearchGroupModel groupModel = new ListSearchGroupModel(); + String tableName = childKeyTableNameMap.get(c.getKey()); + groupModel.setModelName(tableRenames.get(tableName)); + groupModel.setTableName(tableName); + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equalsIgnoreCase(tableName)).findFirst().orElse(null); + groupModel.setForeignKey(tableModel.getTableField()); + groupModel.setMainKey(tableModel.getRelationField()); + List value = c.getValue(); + value.stream().forEach(v -> { + String vmodelall = v.getId(); + String substring = vmodelall.substring(vmodelall.lastIndexOf("_") + 1); + v.setAfterVModel(substring); + }); + groupModel.setSearchTypeModelList(value); + return groupModel; + } + ).collect(Collectors.toList()); + groupModels.addAll(collect2); + + ListSearchGroupModel groupModel = new ListSearchGroupModel(); + groupModel.setSearchTypeModelList(searchListAll.stream().filter(s -> !s.getId().matches(reg) + && !s.getId().toLowerCase().contains(JnpfKeyConsts.CHILD_TABLE_PREFIX)).collect(Collectors.toList())); + groupModel.setTableName(mainTable.getTable()); + groupModel.setModelName(tableRenames.get(mainTable.getTable())); + groupModels.add(groupModel); + } + return groupModels; + } + + /** + * 封装表对应的输出名字 + */ + private Map tableName(List tableModelList, DownloadCodeForm downloadCodeForm) { + Map tableClass = new HashMap<>(16); + int i = 0; + for (TableModel tableModel : tableModelList) { + if ("0".equals(tableModel.getTypeId())) { + String[] subClassName = downloadCodeForm.getSubClassName().split(","); + tableClass.put(tableModel.getTable(), subClassName[i]); + i++; + } + if ("1".equals(tableModel.getTypeId())) { + tableClass.put(tableModel.getTable(), downloadCodeForm.getClassName()); + } + } + return tableClass; + } + + private boolean isType(FormGenModel genModel) { + VisualdevEntity entity = genModel.getEntity(); + boolean type = !VisualWebTypeEnum.FORM.getType().equals(entity.getWebType()); + return type; + } + + private boolean isForm(FormGenModel genModel) { + VisualdevEntity entity = genModel.getEntity(); + boolean type = (VisualWebTypeEnum.FORM_LIST.getType().equals(entity.getWebType()) && entity.getEnableFlow() == 0); + return type; + } + + private void listToString(Map fieLdsModelMap, FieLdsModel fieLdsModel) { + ConfigModel configModel = fieLdsModel.getConfig(); + String dataType = configModel.getDataType(); + List templateJson = configModel.getTemplateJson(); + templateJson.addAll(JsonUtil.getJsonToList(fieLdsModel.getTemplateJson(), TemplateJsonModel.class)); + JSONArray jsonArray = JsonUtil.getListToJsonArray(templateJson); + fieLdsModelMap.put("templateJsonString", JSONObject.toJSONString(jsonArray.toJSONString())); + String options = fieLdsModel.getOptions(); + if (StringUtil.isNotEmpty(options)) { + JSONArray list = !"dictionary".equals(dataType) ? JsonUtil.getJsonToJsonArray(options) : new JSONArray(); + fieLdsModelMap.put("optionsString", JSONObject.toJSONString(list.toJSONString())); + } + } + + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/fuctionFormVue3/GenerateForm.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/fuctionFormVue3/GenerateForm.java new file mode 100644 index 0000000..e95e56c --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/fuctionFormVue3/GenerateForm.java @@ -0,0 +1,39 @@ +package jnpf.base.util.fuctionFormVue3; + +import jnpf.base.util.fuctionFormVue3.common.GenerateInterface; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +/** + * @author JNPF开发平台组 + * @version V3.5.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/5/31 + */ +public class GenerateForm implements GenerateInterface { + + @Override + public List getTemplates(String templatePath, int type, boolean hasImport) { + List templates = new ArrayList<>(); + //前端 + templates.add(templatePath + File.separator + "html" + File.separator + "index.vue.vm"); + templates.add(templatePath + File.separator + "html" + File.separator + "FormPopup.vue.vm"); + //api接口 + templates.add(File.separator + "helper" + File.separator + "api.ts.vm"); + //后端 + templates.add(File.separator + "java" + File.separator + "Form.java.vm"); + templates.add(File.separator + "java" + File.separator + "Constant.java.vm" ); + return templates; + } + + @Override + public List getChildTemps(boolean isChild) { + List templates = new ArrayList<>(); + if (isChild) { + templates.add(File.separator + "java" + File.separator + "Model.java.vm"); + } + return templates; + } +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/fuctionFormVue3/GenerateFormFlow.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/fuctionFormVue3/GenerateFormFlow.java new file mode 100644 index 0000000..bfadd16 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/fuctionFormVue3/GenerateFormFlow.java @@ -0,0 +1,40 @@ +package jnpf.base.util.fuctionFormVue3; + + +import jnpf.base.util.fuctionFormVue3.common.GenerateInterface; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +/** + * @author JNPF开发平台组 + * @version V3.5.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/5/31 + */ +public class GenerateFormFlow implements GenerateInterface { + @Override + public List getTemplates(String templatePath, int type, boolean hasImport) { + List templates = new ArrayList<>(); + //前端 + templates.add(templatePath + File.separator + "html" + File.separator + "index.vue.vm"); + templates.add(templatePath + File.separator + "html" + File.separator + "Form.vue.vm"); + //api接口 + templates.add(File.separator + "helper" + File.separator + "api.ts.vm"); + //后端 + templates.add(File.separator + "java" + File.separator + "Form.java.vm"); + templates.add(File.separator + "java" + File.separator + "Constant.java.vm"); + return templates; + } + + @Override + public List getChildTemps(boolean isChild) { + List templates = new ArrayList<>(); + if (isChild) { + templates.add(File.separator + "java" + File.separator + "Model.java.vm"); + } + return templates; + } + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/fuctionFormVue3/GenerateFormList.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/fuctionFormVue3/GenerateFormList.java new file mode 100644 index 0000000..ee40c9c --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/fuctionFormVue3/GenerateFormList.java @@ -0,0 +1,56 @@ +package jnpf.base.util.fuctionFormVue3; + + +import jnpf.base.util.fuctionFormVue3.common.GenerateInterface; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +/** + * @author JNPF开发平台组 + * @version V3.5.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/5/31 + */ +public class GenerateFormList implements GenerateInterface { + /** + * 界面的模板 + * + * @return + */ + @Override + public List getTemplates(String templatePath, int type, boolean hasImport) { + List templates = new ArrayList<>(); + //前端页面 + if (type == 4) { + templates.add(templatePath + File.separator + "html" + File.separator + "indexEdit.vue.vm" ); + templates.add(templatePath + File.separator + "html" + File.separator + "extraForm.vue.vm" ); + } else { + templates.add(templatePath + File.separator + "html" + File.separator + "index.vue.vm" ); + templates.add(templatePath + File.separator + "html" + File.separator + "Form.vue.vm" ); + } + templates.add(templatePath + File.separator + "html" + File.separator + "Detail.vue.vm" ); + //api接口 + templates.add(File.separator + "helper" + File.separator + "api.ts.vm" ); + //后端 + templates.add(File.separator + "java" + File.separator + "Form.java.vm" ); + if (hasImport) { + templates.add(File.separator + "java" + File.separator + "ExcelVO.java.vm" ); + templates.add(File.separator + "java" + File.separator + "ExcelErrorVO.java.vm" ); + } + templates.add(File.separator + "java" + File.separator + "Pagination.java.vm" ); + templates.add(File.separator + "java" + File.separator + "Constant.java.vm" ); + return templates; + } + + @Override + public List getChildTemps(boolean isChild) { + List templates = new ArrayList<>(); + if(isChild){ + templates.add(File.separator + "java" + File.separator + "Model.java.vm" ); + templates.add(File.separator + "java" + File.separator + "ExcelVO.java.vm" ); + } + return templates; + } +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/fuctionFormVue3/GenerateFormListFlow.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/fuctionFormVue3/GenerateFormListFlow.java new file mode 100644 index 0000000..3a75725 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/fuctionFormVue3/GenerateFormListFlow.java @@ -0,0 +1,54 @@ +package jnpf.base.util.fuctionFormVue3; + +import jnpf.base.util.fuctionFormVue3.common.GenerateInterface; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +/** + * @author JNPF开发平台组 + * @version V3.5.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/5/31 + */ +public class GenerateFormListFlow implements GenerateInterface { + /** + * 界面的模板 + * + * @return + */ + @Override + public List getTemplates(String templatePath, int type, boolean hasImport) { + List templates = new ArrayList<>(); + //前端页面 + if (type == 4) { + templates.add(templatePath + File.separator + "html" + File.separator + "indexEdit.vue.vm"); + templates.add(templatePath + File.separator + "html" + File.separator + "Form.vue.vm"); + } else { + templates.add(templatePath + File.separator + "html" + File.separator + "index.vue.vm"); + templates.add(templatePath + File.separator + "html" + File.separator + "Form.vue.vm"); + } + //api接口 + templates.add(File.separator + "helper" + File.separator + "api.ts.vm"); + //后端 + templates.add(File.separator + "java" + File.separator + "Form.java.vm"); + if (hasImport) { + templates.add(File.separator + "java" + File.separator + "ExcelVO.java.vm"); + templates.add(File.separator + "java" + File.separator + "ExcelErrorVO.java.vm"); + } + templates.add(File.separator + "java" + File.separator + "Pagination.java.vm"); + templates.add(File.separator + "java" + File.separator + "Constant.java.vm"); + return templates; + } + + @Override + public List getChildTemps(boolean isChild) { + List templates = new ArrayList<>(); + if (isChild) { + templates.add(File.separator + "java" + File.separator + "Model.java.vm"); + templates.add(File.separator + "java" + File.separator + "ExcelVO.java.vm"); + } + return templates; + } +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/fuctionFormVue3/GenerateWorkFlow.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/fuctionFormVue3/GenerateWorkFlow.java new file mode 100644 index 0000000..6ce4d59 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/fuctionFormVue3/GenerateWorkFlow.java @@ -0,0 +1,36 @@ +package jnpf.base.util.fuctionFormVue3; + +import jnpf.base.util.fuctionFormVue3.common.GenerateInterface; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +/** + * @author JNPF开发平台组 + * @version V3.5.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/5/31 + */ +public class GenerateWorkFlow implements GenerateInterface { + + @Override + public List getTemplates(String templatePath, int type, boolean hasImport) { + List templates = new ArrayList<>(); + //前端 + templates.add(templatePath + File.separator + "html" + File.separator + "index.vue.vm"); + //后端 + templates.add(File.separator + "java" + File.separator + "Form.java.vm"); + templates.add(File.separator + "java" + File.separator + "Constant.java.vm"); + return templates; + } + + @Override + public List getChildTemps(boolean isChild) { + List templates = new ArrayList<>(); + if (isChild) { + templates.add(File.separator + "java" + File.separator + "Model.java.vm"); + } + return templates; + } +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/fuctionFormVue3/common/GenerateCommon.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/fuctionFormVue3/common/GenerateCommon.java new file mode 100644 index 0000000..01fe812 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/fuctionFormVue3/common/GenerateCommon.java @@ -0,0 +1,612 @@ +package jnpf.base.util.fuctionFormVue3.common; + +import cn.hutool.core.bean.BeanUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.core.toolkit.StringPool; +import com.baomidou.mybatisplus.generator.config.FileOutConfig; +import com.baomidou.mybatisplus.generator.config.po.TableField; +import com.baomidou.mybatisplus.generator.config.po.TableInfo; +import com.google.common.base.CaseFormat; +import jnpf.base.model.DownloadCodeForm; +import jnpf.base.model.Template6.ColumnListField; +import jnpf.base.model.Template7.Template7Model; +import jnpf.base.model.print.PrintOption; +import jnpf.base.service.IPrintDevService; +import jnpf.base.util.common.DataControlUtils; +import jnpf.constant.FileTypeConstant; +import jnpf.model.visualJson.FieLdsModel; +import jnpf.model.visualJson.TemplateJsonModel; +import jnpf.model.visualJson.analysis.FormAllModel; +import jnpf.model.visualJson.analysis.FormColumnModel; +import jnpf.model.visualJson.analysis.FormEnum; +import jnpf.util.*; +import jnpf.util.context.SpringContext; +import jnpf.util.visiual.JnpfKeyConsts; +import lombok.Cleanup; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.io.IOUtils; +import org.apache.velocity.Template; +import org.apache.velocity.VelocityContext; +import org.apache.velocity.app.Velocity; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.StringWriter; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author JNPF开发平台组 + * @version V3.5.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/5/31 + */ +public class GenerateCommon { + public static final String IS_CLOUD = "single" ; + + private static IPrintDevService iPrintDevService = SpringContext.getBean(IPrintDevService.class); + + public static String getLocalBasePath() { + return FileUploadUtils.getLocalBasePath(); + } + + public static String getPath(String type) { + return FilePathUtil.getFilePath(type); + } + + public static List getList(List ids) { + return iPrintDevService.getPrintTemplateOptions(ids); + } + + /** + * 获取代码生成基础信息 + * + * @param className + * @return + */ + public static Template7Model getTemplate7Model(String className) { + Template7Model temModel = new Template7Model(); + temModel.setServiceDirectory(GenerateCommon.getPath(FileTypeConstant.CODETEMP)); + temModel.setCreateDate(DateUtil.daFormat(new Date())); + temModel.setCreateUser(GenerateConstant.AUTHOR); + temModel.setCopyright(GenerateConstant.COPYRIGHT); + temModel.setClassName(DataControlUtils.captureName(className)); + temModel.setVersion(GenerateConstant.VERSION); + temModel.setDescription(GenerateConstant.DESCRIPTION); + return temModel; + } + + /** + * 获取微服务框架路径 + * + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2023/3/22 + */ + public static String getCloudPath(String houzui, DownloadCodeForm downloadCodeForm) { + //发起表单 + if ("form".equals(downloadCodeForm.getModule())) { + return "jnpf-workflow" + File.separator + "jnpf-workflow-form" + File.separator + "jnpf-workflow-" + downloadCodeForm.getModule() + houzui + File.separator + + "src" + File.separator + "main" + File.separator + "java" + File.separator + "jnpf" + File.separator + "form" ; + } + String framePath = "jnpf-" + downloadCodeForm.getModule() + File.separator + "jnpf-" + downloadCodeForm.getModule() + houzui + File.separator + + "src" + File.separator + "main" + File.separator + "java" + File.separator + downloadCodeForm.getModulePackageName(); + return framePath; + } + + /** + * 获取需要生成的文件对象 + * + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2023/3/22 + */ + public static FileOutConfig getFileOutConfig(String fileName, DownloadCodeForm downloadCodeForm, String javaPath, String temName, + String typeStr, boolean concurrencyLock) { + return new FileOutConfig("java" + File.separator + temName) { + @Override + public String outputFile(TableInfo tableInfo) { + if ("entity".equals(typeStr)) { + List fieldAll = tableInfo.getFields(); + TableField mainTableField = fieldAll.stream().filter(tableField -> tableField.isKeyFlag()).findFirst().orElse(null); + fieldAll = fieldAll.stream().filter(DataControlUtils.distinctByKey(t -> t.getName())).collect(Collectors.toList()); + if (mainTableField != null) { + fieldAll.stream().filter(tableField -> tableField.getName().equals(mainTableField.getName())).forEach(t -> t.setKeyFlag(mainTableField.isKeyFlag())); + } + for (TableField field : fieldAll) { + String name = field.getName().toLowerCase().replaceAll("f_" , ""); + field.setPropertyName(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, name)); + boolean fv = field.getName().equalsIgnoreCase(TableFeildsEnum.VERSION.getField()); + if (fv && concurrencyLock) { + field.setFill("1"); + } + } + tableInfo.setFields(fieldAll); + } + String eachName = "" ; + String frontName = "" ; + String modulName = downloadCodeForm.getModule(); + String framePath = downloadCodeForm.getModulePackageName(); + switch (typeStr) { + case "controller": + eachName = tableInfo.getControllerName(); + framePath = getCloudPath("-controller" , downloadCodeForm); + break; + case "entity": + eachName = tableInfo.getEntityName(); + framePath = getCloudPath("-entity" , downloadCodeForm); + break; + case "mapper": + eachName = tableInfo.getMapperName(); + framePath = getCloudPath("-biz" , downloadCodeForm); + break; + case "xml": + eachName = tableInfo.getMapperName(); + if ("cloud".equals(GenerateCommon.IS_CLOUD)) { + String fileFront = "jnpf-" + modulName + File.separator + "jnpf-" + modulName + "-biz" + File.separator; + if ("form".equals(modulName)) { + fileFront = "jnpf-workflow" + File.separator + "jnpf-workflow-form" + File.separator + "jnpf-workflow-form-biz" + File.separator; + } + framePath = fileFront + "src" + File.separator + "main" + File.separator + "resources" ; + return javaPath + fileName + File.separator + "java" + File.separator + framePath + File.separator + "mapper" + + File.separator + eachName + StringPool.DOT_XML; + } + return javaPath + fileName + File.separator + "resources" + File.separator + "mapper" + + File.separator + eachName + StringPool.DOT_XML; + case "service": + eachName = tableInfo.getServiceName(); + framePath = getCloudPath("-biz" , downloadCodeForm); + break; + case "impl": + eachName = tableInfo.getServiceImplName(); + frontName = "service" + File.separator; + framePath = getCloudPath("-biz" , downloadCodeForm); + default: + break; + } + return javaPath + fileName + File.separator + "java" + File.separator + framePath + File.separator + frontName + typeStr + + File.separator + eachName + StringPool.DOT_JAVA; + } + }; + } + + /** + * 下载文件列表 + * + * @param generateParamModel + * @return + */ + public static List getJavaFiles(GenerateParamModel generateParamModel) { + String fileName = generateParamModel.getFileName(); + DownloadCodeForm downloadCodeForm = generateParamModel.getDownloadCodeForm(); + Template7Model template7Model = generateParamModel.getTemplate7Model(); + List focList = new ArrayList<>(); + String javaPath = GenerateCommon.getLocalBasePath() + template7Model.getServiceDirectory(); + if (generateParamModel.isMainTable()) { + focList.add(GenerateCommon.getFileOutConfig(fileName, downloadCodeForm, javaPath, "Controller.java.vm" , "controller" , false)); + focList.add(GenerateCommon.getFileOutConfig(fileName, downloadCodeForm, javaPath, "Entity.java.vm" , "entity" , generateParamModel.isConcurrencyLock())); + } else { + focList.add(GenerateCommon.getFileOutConfig(fileName, downloadCodeForm, javaPath, "Entity.java.vm" , "entity" , false)); + } + focList.add(GenerateCommon.getFileOutConfig(fileName, downloadCodeForm, javaPath, "Mapper.java.vm" , "mapper" , false)); + focList.add(GenerateCommon.getFileOutConfig(fileName, downloadCodeForm, javaPath, "Mapper.xml.vm" , "xml" , false)); + focList.add(GenerateCommon.getFileOutConfig(fileName, downloadCodeForm, javaPath, "Service.java.vm" , "service" , false)); + focList.add(GenerateCommon.getFileOutConfig(fileName, downloadCodeForm, javaPath, "ServiceImpl.java.vm" , "impl" , false)); + return focList; + } + + /** + * 获取导出字段 + * + * @param columnList + * @return + */ + public static List getExpotColumn(List columnList) { + List listOptions = new ArrayList<>(); + columnList.forEach(item -> { + ColumnListField columnListField = new ColumnListField(); + BeanUtil.copyProperties(item, columnListField); + if (item.getVModel().toLowerCase().startsWith(JnpfKeyConsts.CHILD_TABLE_PREFIX)) { + columnListField.setTableType(2); + columnListField.setVModel(item.getVModel().split("-")[1]); + } else if (item.getVModel().toLowerCase().contains("_jnpf_")) { + columnListField.setTableType(1); + columnListField.setVModel(item.getVModel().split("_jnpf_")[1]); + } else { + columnListField.setTableType(0); + } + if ("static".equals(item.getConfig().getDataType())) { + columnListField.setOptions(JsonUtil.getObjectToString(item.getOptions())); + if (item.getJnpfKey().equals(JnpfKeyConsts.CHECKBOX)) { + columnListField.setMultiple(true); + } + } + listOptions.add(columnListField); + }); + return listOptions; + } + + /** + * 合计和千分位字段转换至前端可用 + * + * @param sourceList 原字段列表 + * @param type 列表类型4为行内编辑 + * @return 新字段列表 + */ + public static List getSummaryList(List sourceList, Integer type) { + List finalFieldsTotal = new ArrayList<>(); + String suffix = "" ; +// if (type == 4) { +// suffix = "_name" ; +// } + if (CollectionUtils.isEmpty(sourceList)) { + return finalFieldsTotal; + } + for (String field : sourceList) { + String finalField; + if (field.startsWith("jnpf")) { + String fieldName = field.substring(field.lastIndexOf("jnpf_")).replace("jnpf_" , ""); + String tableName = field.substring(field.indexOf("_") + 1, field.lastIndexOf("_jnpf")); + finalField = tableName + "." + fieldName + suffix; + } else { + finalField = field + suffix; + } + finalFieldsTotal.add(finalField); + } + return finalFieldsTotal; + } + + + /** + * 合计千分位字段列表 + * + * @param mast 主表字段 + * @param mastTable 副表字段 + * @param type 列表类型 4-行内编辑 + * @return + */ + public static List getSummaryThousandList(List mast, List mastTable, Integer type) { + String suffix = "_name" ; + if (type == 4) { + suffix = "" ; + } + List thousandsField = new ArrayList<>(); + for (FormAllModel f : mast) { + FieLdsModel fm = f.getFormColumnModel().getFieLdsModel(); + if (fm.isThousands()) { + thousandsField.add(fm.getVModel() + suffix); + } + } + for (FormAllModel f : mastTable) { + FieLdsModel fm = f.getFormMastTableModel().getMastTable().getFieLdsModel(); + if (fm.isThousands()) { + thousandsField.add(f.getFormMastTableModel().getTable() + "." + fm.getVModel() + suffix); + } + } + return thousandsField; + } + + + /** + * 根据模板 获取文件名 + * + * @param path 路径 + * @param template 模板名称 + * @param className 文件名称 + * @return + */ + public static String getFileName(String path, String template, String className, DownloadCodeForm downloadCodeForm) { + String framePath = GenerateCommon.getCloudPath("-entity" , downloadCodeForm); + String modelfolder = downloadCodeForm.getClassName(); + String modelPath = XSSEscape.escapePath(path + File.separator + "java" + File.separator + framePath + File.separator + "model" + + File.separator + modelfolder.toLowerCase()); + String htmlPath = XSSEscape.escapePath(path + File.separator + "html" + File.separator + "web" + File.separator + modelfolder.toLowerCase()); + String htmlTSPath = XSSEscape.escapePath(path + File.separator + "html" + File.separator + "web" + File.separator + + modelfolder.toLowerCase() + File.separator + "helper"); + File htmlfile = new File(htmlPath); + File modelfile = new File(modelPath); + File htmlJSfile = new File(htmlTSPath); + if (!htmlfile.exists()) { + htmlfile.mkdirs(); + } + if (!modelfile.exists()) { + modelfile.mkdirs(); + } + if (!htmlJSfile.exists() && !"form".equals(downloadCodeForm.getModule())) { + htmlJSfile.mkdirs(); + } + if (template.contains("extraForm.vue.vm")) { + return htmlPath + File.separator + "ExtraForm.vue" ; + } + if (template.contains("Form.vue.vm")) { + return htmlPath + File.separator + "Form.vue" ; + } + if (template.contains("FormPopup.vue.vm")) { + return htmlPath + File.separator + "FormPopup.vue" ; + } + if (template.contains("index.vue.vm")) { + return htmlPath + File.separator + "index.vue" ; + } + if (template.contains("indexEdit.vue.vm")) { + return htmlPath + File.separator + "index.vue" ; + } + if (template.contains("Detail.vue.vm")) { + return htmlPath + File.separator + "Detail.vue" ; + } + if (template.contains("api.ts.vm")) { + return htmlPath + File.separator + "helper" + File.separator + "api.ts" ; + } + //后端代码 + if (template.contains("InfoVO.java.vm")) { + return modelPath + File.separator + className + "InfoVO.java" ; + } + if (template.contains("Form.java.vm")) { + return modelPath + File.separator + className + "Form.java" ; + } + if (template.contains("ListVO.java.vm")) { + return modelPath + File.separator + className + "ListVO.java" ; + } + if (template.contains("GroupVO.java.vm")) { + return modelPath + File.separator + className + "GroupVO.java" ; + } + if (template.contains("Pagination.java.vm")) { + return modelPath + File.separator + className + "Pagination.java" ; + } + if (template.contains("ExcelVO.java.vm")) { + return modelPath + File.separator + className + "ExcelVO.java" ; + } + if (template.contains("ExcelErrorVO.java.vm")) { + return modelPath + File.separator + className + "ExcelErrorVO.java" ; + } + if (template.contains("Model.java.vm")) { + return modelPath + File.separator + className + "Model.java" ; + } + if (template.contains("ListVO.java.vm")) { + return modelPath + File.separator + className + "ListVO.java" ; + } + if (template.contains("Constant.java.vm")) { + return modelPath + File.separator + className + "Constant.java" ; + } + return null; + } + + /** + * 生成代码 + * + * @param context + * @param template + * @param fileNames + */ + public static void velocityWriterFile(VelocityContext context, String template, String fileNames) { + try { + // 渲染模板 + @Cleanup StringWriter sw = new StringWriter(); + Template tpl = Velocity.getTemplate(template, Constants.UTF_8); + tpl.merge(context, sw); + if (fileNames != null) { + File file = new File(XSSEscape.escapePath(fileNames)); + if (!file.exists()) { + file.createNewFile(); + } + @Cleanup FileOutputStream fos = new FileOutputStream(file); + IOUtils.write(sw.toString(), fos, Constants.UTF_8); + IOUtils.closeQuietly(sw); + IOUtils.closeQuietly(fos); + } + } catch (IOException e) { + e.printStackTrace(); + System.out.println("渲染模板失败,表名:" + e); + } + } + + /** + * 获取接口参数配置,templatejson + * + * @param allModels + * @return + */ + public static Map getInterTemplateJson(List allModels, Map childTableKey) { + Map map = new HashMap<>(); + for (FormAllModel item : allModels) { + if (FormEnum.mast.getMessage().equals(item.getJnpfKey())) { + FieLdsModel fieLdsModel = BeanUtil.copyProperties(item.getFormColumnModel().getFieLdsModel(), FieLdsModel.class); + if (StringUtil.isNotEmpty(fieLdsModel.getVModel())) { + map.put(fieLdsModel.getVModel(), getTemJsonModel(fieLdsModel, childTableKey)); + } + } + if (FormEnum.mastTable.getMessage().equals(item.getJnpfKey())) { + FieLdsModel fieLdsModel = BeanUtil.copyProperties(item.getFormMastTableModel().getMastTable().getFieLdsModel(), FieLdsModel.class); + if (StringUtil.isNotEmpty(fieLdsModel.getVModel())) { + map.put(item.getFormMastTableModel().getVModel(), getTemJsonModel(fieLdsModel, childTableKey)); + } + } + if (FormEnum.table.getMessage().equals(item.getJnpfKey())) { + List childList = item.getChildList().getChildList(); + for (FormColumnModel columnModel : childList) { + FieLdsModel fieLdsModel = BeanUtil.copyProperties(columnModel.getFieLdsModel(), FieLdsModel.class); + if (StringUtil.isNotEmpty(fieLdsModel.getVModel())) { + map.put(item.getChildList().getAliasLowName() + fieLdsModel.getVModel(), getTemJsonModel(fieLdsModel, childTableKey)); + } + } + } + } + return map; + } + + private static List getTemJsonModel(FieLdsModel fieLdsModel, Map childTableKey) { + List templateJson = fieLdsModel.getConfig().getTemplateJson(); + List json = templateJson.size() > 0 ? templateJson : + JsonUtil.getJsonToList(fieLdsModel.getTemplateJson(), TemplateJsonModel.class); + for (TemplateJsonModel t : json) { + if (t.getRelationField() != null && t.getRelationField().contains("-")) { + String[] split = t.getRelationField().split("-"); + t.setRelationField(childTableKey.get(split[0]) + "List-" + split[1]); + } + } + return json; + } + + /** + * 获取非系统控件字段 + * + * @return + */ + public static List getNotSystemFields(List mast, List mastTable, List childTable, + GenerateParamModel generateParamModel) { + List list = new ArrayList<>(); + String table = generateParamModel.getTable(); + boolean mainTable = generateParamModel.isMainTable(); + List fields = new ArrayList<>(); + for (FormAllModel fam : mast) { + if (mainTable) { + fields.add(fam.getFormColumnModel()); + } + } + for (FormAllModel fam : mastTable) { + if (table.equals(fam.getFormMastTableModel().getTable())) { + fields.add(fam.getFormMastTableModel().getMastTable()); + } + } + for (FormAllModel fam : childTable) { + if (table.equals(fam.getChildList().getTableName())) { + fields.addAll(fam.getChildList().getChildList()); + } + } + for (FormColumnModel fcm : fields) { + if (!JnpfKeyConsts.getSystemKey().contains(fcm.getFieLdsModel().getConfig().getJnpfKey())) { + list.add(fcm.getFieLdsModel().getVModel().toUpperCase()); + } + } + return list; + } + + + /** + * 移除对象内的json字符串 + * + * @param str + * @return + */ + public static String objRemoveJson(String str) { + JSONObject object = JSONObject.parseObject(str); + + JSONArray columnList = object.getJSONArray("columnList"); + removeJson(columnList); + object.put("columnList" , columnList); + + JSONArray searchList = object.getJSONArray("searchList"); + removeJson(searchList); + object.put("searchList" , searchList); + + JSONObject ruleList = object.getJSONObject("ruleList"); + ruleRemoveJson(ruleList); + object.put("ruleList" , ruleList); + + JSONObject ruleListApp = object.getJSONObject("ruleListApp"); + ruleRemoveJson(ruleListApp); + object.put("ruleListApp" , ruleListApp); + + JSONArray columnOptions = object.getJSONArray("columnOptions"); + removeJson(columnOptions); + object.put("columnOptions" , columnOptions); + + JSONArray defaultColumnList = object.getJSONArray("defaultColumnList"); + removeJson(defaultColumnList); + object.put("defaultColumnList" , defaultColumnList); + + JSONArray sortList = object.getJSONArray("sortList"); + removeJson(sortList); + object.put("sortList" , sortList); + + JSONArray fields = object.getJSONArray("fields"); + removeJson(fields); + object.put("fields" , fields); + + object.remove("funcs"); + return object.toJSONString(); + } + + private static void ruleRemoveJson(JSONObject ruleList) { + if (ruleList != null) { + JSONArray conditionList = ruleList.getJSONArray("conditionList"); + if (conditionList != null) { + for (Object o : conditionList) { + JSONObject obj = (JSONObject) o; + JSONArray groups = obj.getJSONArray("groups"); + removeJson(groups); + obj.put("groups" , groups); + } + ruleList.put("conditionList" , conditionList); + } + } + } + + /** + * 递归移除对应属性 + * + * @param jsonArray + */ + public static void removeJson(JSONArray jsonArray) { + if (jsonArray == null || jsonArray.size() == 0) { + return; + } + for (int i = 0; i < jsonArray.size(); i++) { + JSONObject jsonObject = (JSONObject) jsonArray.get(i); + String jnpfkey = jsonObject.getJSONObject("__config__").getString("jnpfKey"); + List childrenListAll = new ArrayList() {{ + add(FormEnum.card.getMessage()); + add(FormEnum.row.getMessage()); + add(FormEnum.tab.getMessage()); + add(FormEnum.collapse.getMessage()); + add(FormEnum.collapseItem.getMessage()); + add(FormEnum.tabItem.getMessage()); + add(FormEnum.tableGrid.getMessage()); + add(FormEnum.tableGridTr.getMessage()); + add(FormEnum.tableGridTd.getMessage()); + }}; + if (childrenListAll.contains(jnpfkey) || StringUtil.isEmpty(jnpfkey)) { + JSONObject config = jsonObject.getJSONObject("__config__"); + config.remove("on"); + JSONArray childArray = config.getJSONArray("children"); + removeJson(childArray); + config.put("children" , childArray); + jsonObject.put("__config__" , config); + } else if (FormEnum.table.getMessage().equals(jnpfkey)) { + JSONObject configA = jsonObject.getJSONObject("__config__"); + configA.remove("on"); + JSONArray children = configA.getJSONArray("children"); + for (int k = 0; k < children.size(); k++) { + JSONObject childrenObject = (JSONObject) children.get(k); + childrenObject.remove("on"); + JSONObject config = childrenObject.getJSONObject("__config__"); + config.remove("on"); + if (!"static".equals(config.get("dataType"))) { + childrenObject.remove("options"); + config.remove("options"); + } + childrenObject.put("__config__" , config); + } + configA.put("children" , children); + if (!"static".equals(configA.get("dataType"))) { + jsonObject.remove("options"); + configA.remove("options"); + } + jsonObject.put("__config__" , configA); + } + jsonObject.remove("on"); + JSONObject config = jsonObject.getJSONObject("__config__"); + config.remove("on"); + if (!"static".equals(config.get("dataType"))) { + jsonObject.remove("options"); + config.remove("options"); + } + jsonObject.put("__config__" , config); + } + } + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/fuctionFormVue3/common/GenerateConstant.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/fuctionFormVue3/common/GenerateConstant.java new file mode 100644 index 0000000..f1f92b8 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/fuctionFormVue3/common/GenerateConstant.java @@ -0,0 +1,31 @@ +package jnpf.base.util.fuctionFormVue3.common; + +/** + * @author JNPF开发平台组 + * @version V3.5.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/5/31 + */ +public class GenerateConstant { + + /** + * 作者 + */ + public static final String AUTHOR = "JNPF开发平台组"; + + /** + * 版本 + */ + public static final String VERSION = "V3.5"; + + /** + * 版权 + */ + public static final String COPYRIGHT = "引迈信息技术有限公司(https://www.jnpfsoft.com)"; + + /** + * 描述 + */ + public static final String DESCRIPTION = ""; + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/fuctionFormVue3/common/GenerateInterface.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/fuctionFormVue3/common/GenerateInterface.java new file mode 100644 index 0000000..cc9bebc --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/fuctionFormVue3/common/GenerateInterface.java @@ -0,0 +1,30 @@ +package jnpf.base.util.fuctionFormVue3.common; + +import java.util.List; + +/** + * @author JNPF开发平台组 + * @version V3.5.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/5/31 + */ +public interface GenerateInterface { + + /** + * 获取 前端 及 后端模板 + * + * @param templatePath + * @param type + * @param hasImport + * @return + */ + List getTemplates(String templatePath, int type, boolean hasImport); + + /** + * 获取副子表model、list模板 + * + * @param isChild + * @return + */ + List getChildTemps(boolean isChild); +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/fuctionFormVue3/common/GenerateParamModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/fuctionFormVue3/common/GenerateParamModel.java new file mode 100644 index 0000000..9cd272e --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/fuctionFormVue3/common/GenerateParamModel.java @@ -0,0 +1,61 @@ +package jnpf.base.util.fuctionFormVue3.common; + +import jnpf.base.UserInfo; +import jnpf.base.entity.VisualdevEntity; +import jnpf.base.model.DownloadCodeForm; +import jnpf.base.model.Template7.Template7Model; +import jnpf.config.ConfigValueUtil; +import jnpf.database.model.entity.DbLinkEntity; +import jnpf.database.util.DataSourceUtil; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @author JNPF开发平台组 + * @version V3.5.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/5/31 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class GenerateParamModel { + private DataSourceUtil dataSourceUtil; + private String path; + private String fileName; + private String templatesPath; + private DownloadCodeForm downloadCodeForm; + private VisualdevEntity entity; + private UserInfo userInfo; + private ConfigValueUtil configValueUtil; + private DbLinkEntity linkEntity; + /** + * 当前表名 + */ + private String table; + /** + * 主表主键 + */ + private String pKeyName; + /** + * 当前表类名 + */ + private String className; + /** + * 代码生成基础信息 + */ + private Template7Model template7Model; + + /** + * 乐观锁 + */ + private boolean concurrencyLock; + /** + * 是否主表 + */ + private boolean isMainTable; + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/functionForm/CodeGenerateUtil.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/functionForm/CodeGenerateUtil.java new file mode 100644 index 0000000..6a1733a --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/functionForm/CodeGenerateUtil.java @@ -0,0 +1,53 @@ +package jnpf.base.util.functionForm; + +import jnpf.base.UserInfo; +import jnpf.base.entity.VisualdevEntity; +import jnpf.base.model.DownloadCodeForm; +import jnpf.config.ConfigValueUtil; +import jnpf.database.model.entity.DbLinkEntity; +import jnpf.database.util.DataSourceUtil; +import jnpf.model.visualJson.FormDataModel; + +import java.sql.SQLException; + +/** + * 代码生成实现接口 + * + * @author JNPF开发平台组 + * @version V3.2 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/10/8 + */ +public interface CodeGenerateUtil { + /** + * 生成前端页面 + * + * @param fileName + * @param entity + * @param downloadCodeForm + * @param model + * @param templatePath + * @param userInfo + * @param configValueUtil + * @param pKeyName + */ + void htmlTemplates(String fileName, VisualdevEntity entity, DownloadCodeForm downloadCodeForm, FormDataModel model, String templatePath, UserInfo userInfo, ConfigValueUtil configValueUtil, String pKeyName) throws Exception; + + + /** + * 生成后端代码 + * + * @param entity + * @param dataSourceUtil + * @param fileName + * @param templatePath + * @param downloadCodeForm + * @param userInfo + * @param configValueUtil + * @param linkEntity + * @throws SQLException + */ + void generate(VisualdevEntity entity, DataSourceUtil dataSourceUtil, String fileName, String templatePath, DownloadCodeForm downloadCodeForm, UserInfo userInfo, ConfigValueUtil configValueUtil, DbLinkEntity linkEntity) throws SQLException; + + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/functionForm/FlowFormUtil.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/functionForm/FlowFormUtil.java new file mode 100644 index 0000000..ee121f1 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/functionForm/FlowFormUtil.java @@ -0,0 +1,810 @@ +package jnpf.base.util.functionForm; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.generator.InjectionConfig; +import com.baomidou.mybatisplus.generator.config.*; +import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy; +import com.google.common.base.CaseFormat; +import jnpf.base.UserInfo; +import jnpf.base.entity.VisualdevEntity; +import jnpf.base.model.ColumnDataModel; +import jnpf.base.model.DownloadCodeForm; +import jnpf.base.model.Template7.Template7Model; +import jnpf.base.util.SourceUtil; +import jnpf.base.util.VisualUtils; +import jnpf.base.util.common.DataControlUtils; +import jnpf.base.util.common.FormCommonUtil; +import jnpf.base.util.common.FunctionFormPublicUtil; +import jnpf.base.util.common.SuperQueryUtil; +import jnpf.base.util.custom.CustomGenerator; +import jnpf.config.ConfigValueUtil; +import jnpf.constant.FileTypeConstant; +import jnpf.constant.MsgCode; +import jnpf.database.model.entity.DbLinkEntity; +import jnpf.database.util.DataSourceUtil; +import jnpf.database.util.TenantDataSourceUtil; +import jnpf.entity.FlowFormEntity; +import jnpf.generater.model.FormDesign.ColumnListDataModel; +import jnpf.generater.model.GenBaseInfo; +import jnpf.generater.model.GenFileNameSuffix; +import jnpf.model.visualJson.*; +import jnpf.model.visualJson.analysis.*; +import jnpf.model.visualJson.config.ConfigModel; +import jnpf.model.visualJson.props.PropsModel; +import jnpf.util.DateUtil; +import jnpf.util.JsonUtil; +import jnpf.util.StringUtil; +import jnpf.util.XSSEscape; +import jnpf.util.visiual.JnpfKeyConsts; +import lombok.Cleanup; +import org.apache.commons.io.IOUtils; +import org.apache.velocity.Template; +import org.apache.velocity.VelocityContext; +import org.apache.velocity.app.Velocity; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.StringWriter; +import java.sql.SQLException; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 纯表单(带流程) + * + * @author JNPF开发平台组 + * @version V3.2.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/9/4 + */ +public class FlowFormUtil implements CodeGenerateUtil { + + private static FlowFormUtil flowFormUtil = new FlowFormUtil(); + + private FlowFormUtil() { + + } + + public static FlowFormUtil getFormUtil() { + return flowFormUtil; + } + + //------------------------------------界面---------------------------------- + + /** + * 界面模板 + * + * @param fileName 文件夹名称 + * @param downloadCodeForm 文件名称 + * @param model 模型 + * @param templatePath 模板路径 + * @param userInfo 用户 + * @param configValueUtil 下载路径 + */ + @Override + public void htmlTemplates(String fileName, VisualdevEntity entity, DownloadCodeForm downloadCodeForm, FormDataModel model, String templatePath, + UserInfo userInfo, ConfigValueUtil configValueUtil, String pKeyName) throws Exception { + //自定义包名 + String modulePackageName = downloadCodeForm.getModulePackageName(); + Map map = new HashMap<>(16); + //formTempJson + FormDataModel formData = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + List tablesList = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + List formAllModel = new ArrayList<>(); + RecursionForm recursionForm = new RecursionForm(); + recursionForm.setTableModelList(tablesList); + recursionForm.setList(list); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + + //form的属性 + List mast = formAllModel.stream().filter(t -> FormEnum.mast.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + List table = formAllModel.stream().filter(t -> FormEnum.table.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + List mastTable = formAllModel.stream().filter(t -> FormEnum.mastTable.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + map.put("ableAll" , JsonUtil.getListToJsonArray(formAllModel)); + //form和model + Template7Model temModel = new Template7Model(); + temModel.setServiceDirectory(configValueUtil.getServiceDirectoryPath()); + temModel.setCreateDate(DateUtil.daFormat(new Date())); + temModel.setCreateUser(GenBaseInfo.AUTHOR); + temModel.setCopyright(GenBaseInfo.COPYRIGHT); + temModel.setClassName(DataControlUtils.captureName(downloadCodeForm.getClassName())); + temModel.setVersion(GenBaseInfo.VERSION); + temModel.setDescription(GenBaseInfo.DESCRIPTION); + + //取对应表的别名 + Map tableNameRenames = FunctionFormPublicUtil.tableNameRename(downloadCodeForm, tablesList); + + //子表赋值 + List> child = new ArrayList<>(); + for (int i = 0; i < table.size(); i++) { + FormColumnTableModel childList = table.get(i).getChildList(); + List tableList = childList.getChildList(); + String sClassName = tableNameRenames.get(childList.getTableName()); + List thousandsField=new ArrayList<>(); + for (FormColumnModel columnModel : tableList) { + FieLdsModel fieLdsModel = columnModel.getFieLdsModel(); + List templateJsonAll = new ArrayList<>(); + templateJsonAll.addAll(fieLdsModel.getConfig().getTemplateJson()); + List templateJsonModelList = JsonUtil.getJsonToList(fieLdsModel.getTemplateJson(), TemplateJsonModel.class); + templateJsonAll.addAll(templateJsonModelList); + for (TemplateJsonModel templateJsonModel : templateJsonAll) { + if (StringUtil.isNotEmpty(templateJsonModel.getRelationField())) { + String[] fieldList = templateJsonModel.getRelationField().split("-"); + if (fieldList.length > 1) { + templateJsonModel.setRelationField(sClassName.toLowerCase() + "-" + fieldList[1]); + } + } + } + for (TemplateJsonModel templateJsonModel : templateJsonModelList) { + if (StringUtil.isNotEmpty(templateJsonModel.getRelationField())) { + String[] fieldList = templateJsonModel.getRelationField().split("-"); + if (fieldList.length > 1) { + templateJsonModel.setRelationField(sClassName.toLowerCase() + "List-" + fieldList[1]); + } + } + } + fieLdsModel.setTemplateJson(JsonUtil.getObjectToString(templateJsonModelList)); + fieLdsModel.getConfig().setTemplateJson(templateJsonAll); + } + childList.setChildList(tableList); + childList.setThousandsField(thousandsField); + Map childs = JsonUtil.entityToMap(childList); + String className = DataControlUtils.captureName(sClassName); + childs.put("className" , className); + child.add(childs); + } + //主表赋值 + for (int i = 0; i < mast.size(); i++) { + FieLdsModel fieLdsModel = mast.get(i).getFormColumnModel().getFieLdsModel(); + ConfigModel configModel = fieLdsModel.getConfig(); + if (configModel.getDefaultValue() instanceof String) { + configModel.setValueType("String"); + } + if (configModel.getDefaultValue() == null) { + configModel.setValueType("undefined"); + } + fieLdsModel.setConfig(configModel); + String vmodel = fieLdsModel.getVModel(); + if (StringUtil.isEmpty(vmodel)) { + mast.remove(i); + i--; + } + List templateJson = fieLdsModel.getConfig().getTemplateJson(); + String json = templateJson.size() > 0 ? JsonUtil.getObjectToString(templateJson):fieLdsModel.getTemplateJson(); + fieLdsModel.setTemplateJson(json); + } + //表单子表模型 + List formChildList = new ArrayList<>(); + //列表子表数据model + Map> groupColumnDataMap = mastTable.stream().collect(Collectors.groupingBy(m -> m.getFormMastTableModel().getTable())); + Iterator>> entries = groupColumnDataMap.entrySet().iterator(); + while (entries.hasNext()) { + Map.Entry> formEntries = entries.next(); + Map objectMap = new HashMap<>(); + String className = DataControlUtils.captureName(tableNameRenames.get(formEntries.getKey())); + ColumnListDataModel columnListDataModel = new ColumnListDataModel(); + columnListDataModel.setModelName(className); + columnListDataModel.setModelUpName(DataControlUtils.captureName(className)); + columnListDataModel.setModelLowName(DataControlUtils.initialLowercase(className)); + List allModels = formEntries.getValue(); + allModels.stream().forEach(m -> { + String vModel = m.getFormMastTableModel().getField(); + m.getFormMastTableModel().getMastTable().getFieLdsModel().setVModel(vModel); + }); + List fields = allModels.stream().map(m -> + m.getFormMastTableModel().getField()).collect(Collectors.toList()); + columnListDataModel.setFieldList(fields); + columnListDataModel.setFieLdsModelList(allModels.stream().map(al -> al.getFormMastTableModel()).collect(Collectors.toList())); + columnListDataModel.setTableName(formEntries.getKey()); + formChildList.add(columnListDataModel); + List children = formEntries.getValue().stream().map(allModel -> + allModel.getFormMastTableModel().getMastTable()).collect(Collectors.toList()); + //表字段给的范围-转换json + children.forEach(item -> { + item.setFieLdsModel(DataControlUtils.setAbleIDs(item.getFieLdsModel())); + }); + FormColumnTableModel formColumnTableModel = new FormColumnTableModel(); + formColumnTableModel.setChildList(children); + objectMap.put("children" , formColumnTableModel); + objectMap.put("genInfo" , temModel); + objectMap.put("package" , modulePackageName); + objectMap.put("module" , model.getAreasName()); + objectMap.put("className" , className); + objectMap.put("isMast" , "mast"); + childrenTemplates(FormCommonUtil.getLocalBasePath() + model.getServiceDirectory() + fileName, objectMap, templatePath, className, downloadCodeForm); + } + //子表model + for (int i = 0; i < table.size(); i++) { + FormColumnTableModel childList = table.get(i).getChildList(); + //表字段给的范围-转换json + childList.getChildList().forEach(item -> { + item.setFieLdsModel(DataControlUtils.setAbleIDs(item.getFieLdsModel())); + }); + Map objectMap = JsonUtil.entityToMap(childList); + String className = DataControlUtils.captureName(tableNameRenames.get(childList.getTableName())); + objectMap.put("children" , childList); + objectMap.put("genInfo" , temModel); + objectMap.put("package" , modulePackageName); + objectMap.put("module" , model.getAreasName()); + objectMap.put("className" , className); + childrenTemplates(FormCommonUtil.getLocalBasePath() + model.getServiceDirectory() + fileName, objectMap, templatePath, className, downloadCodeForm); + } + + //界面 + map.put("module" , downloadCodeForm.getModule()); + map.put("className" , DataControlUtils.captureName(model.getClassName())); + map.put("formRef" , model.getFormRef()); + map.put("formModel" , model.getFormModel()); + map.put("size" , model.getSize()); + map.put("labelPosition" , model.getLabelPosition()); + map.put("generalWidth" , model.getGeneralWidth()); + map.put("formStyle" , model.getFormStyle()); + map.put("labelWidth" , model.getLabelWidth()); + map.put("formRules" , model.getFormRules()); + map.put("gutter" , model.getGutter()); + map.put("disabled" , model.getDisabled()); + map.put("span" , model.getSpan()); + map.put("formBtns" , model.getFormBtns()); + map.put("idGlobal" , model.getIdGlobal()); + map.put("popupType" , model.getPopupType()); + map.put("form" , formAllModel); + map.put("fullScreenWidth" , model.getFullScreenWidth()); + map.put("groupColumnDataMap" , groupColumnDataMap); + map.put("genInfo" , temModel); + map.put("modelName" , model.getClassName()); + map.put("package" , modulePackageName); + map.put("formModelName" , entity.getFullName()); + //共用 + map.put("children" , child); + map.put("fields" , mast); + map.put("mastTable" , mastTable); + map.put("columnChildren" , formChildList); + pKeyName = pKeyName.toLowerCase().trim().replaceAll("f_" , ""); + map.put("pKeyName" , pKeyName); + String modelPathName = downloadCodeForm.getClassName().toLowerCase(); + map.put("modelPathName" , modelPathName); + map.put("formModelName" , entity.getFullName()); + map.put("formId" , entity.getId()); + htmlTemplates(FormCommonUtil.getLocalBasePath() + model.getServiceDirectory() + fileName, map, templatePath, downloadCodeForm); + + /** + * 生成表单设计json文件 + */ + String path = FormCommonUtil.getLocalBasePath() + configValueUtil.getServiceDirectoryPath() + fileName; + FlowFormEntity flowFormEntity = FunctionFormPublicUtil.exportFlowFormJson(entity, downloadCodeForm); + SuperQueryUtil.CreateFlowFormJsonFile(JsonUtil.getObjectToString(flowFormEntity), path); + } + + /** + * 获取文件名 + * + * @param path 路径 + * @param template 模板名称 + * @param className 文件名称 + * @return + */ + private static String getFileName(String path, String template, String className, DownloadCodeForm downloadCodeForm) { + //是否微服务路径 + String framePath = FormCommonUtil.getCloudPath("-entity" , downloadCodeForm); + String modelPath = XSSEscape.escapePath(path + File.separator + "java" + File.separator + framePath + File.separator + "model" + + File.separator + className.toLowerCase()); + String htmlPath = XSSEscape.escapePath(path + File.separator + "html" + File.separator + "web" + File.separator + className.toLowerCase()); + File htmlfile = new File(htmlPath); + File modelfile = new File(modelPath); + if (!htmlfile.exists()) { + htmlfile.mkdirs(); + } + if (!modelfile.exists()) { + modelfile.mkdirs(); + } + if (template.contains("index.vue.vm")) { + className = "index"; + return htmlPath + File.separator + className + ".vue"; + } + if (template.contains("form.vue.vm")) { + className = "form"; + return htmlPath + File.separator + className + ".vue"; + } + if (template.contains("CrForm.java.vm")) { + return modelPath + File.separator + className + "CrForm.java"; + } + if (template.contains("InfoVO.java.vm")) { + return modelPath + File.separator + className + "InfoVO.java"; + } + return null; + } + + /** + * 界面的模板 + * + * @param template 模板集合 + * @return + */ + private static List getTemplates(String template) { + List templates = new ArrayList<>(); + templates.add(template + File.separator + "html" + File.separator + "index.vue.vm"); + templates.add(template + File.separator + "html" + File.separator + "form.vue.vm"); + templates.add(template + File.separator + "java" + File.separator + "CrForm.java.vm"); + templates.add(template + File.separator + "java" + File.separator + "InfoVO.java.vm"); + return templates; + } + + /** + * 渲染html模板 + * + * @param path 路径 + * @param object 模板数据 + * @param templatePath 模板路径 + */ + private static void htmlTemplates(String path, Map object, String templatePath, DownloadCodeForm downloadCodeForm) throws Exception { + List templates = getTemplates(templatePath); + //界面模板 + VelocityContext context = new VelocityContext(); + context.put("context" , object); + for (String template : templates) { + try { + // 渲染模板 + @Cleanup StringWriter sw = new StringWriter(); + Template tpl = Velocity.getTemplate(template, Constants.UTF_8); + tpl.merge(context, sw); + String className = object.get("className").toString(); + String fileNames = getFileName(path, template, className, downloadCodeForm); + if (fileNames != null) { + File file = new File(XSSEscape.escapePath(fileNames)); + if (!file.exists()) { + file.createNewFile(); + } + @Cleanup FileOutputStream fos = new FileOutputStream(file); + IOUtils.write(sw.toString(), fos, Constants.UTF_8); + IOUtils.closeQuietly(sw); + IOUtils.closeQuietly(fos); + } + } catch (IOException e) { + e.printStackTrace(); + System.out.println("渲染模板失败,表名:" + e); + } + } + } + + /** + * 渲染html模板 + * + * @param path 路径 + * @param object 模板数据 + * @param templatePath 模板路径 + */ + private static void childrenTemplates(String path, Map object, String templatePath, String className, DownloadCodeForm downloadCodeForm) throws Exception { + //是否微服务路径 + String framePath = FormCommonUtil.getCloudPath("-entity" , downloadCodeForm); + String model = downloadCodeForm.getClassName(); + List templates = new ArrayList<>(); + templates.add(templatePath + File.separator + "java" + File.separator + "Model.java.vm"); + //界面模板 + VelocityContext context = new VelocityContext(); + context.put("context" , object); + for (String template : templates) { + try { + // 渲染模板 + @Cleanup StringWriter sw = new StringWriter(); + Template tpl = Velocity.getTemplate(template, Constants.UTF_8); + tpl.merge(context, sw); + String dirNames = path + File.separator + "java" + File.separator + framePath + File.separator + "model" + File.separator + model.toLowerCase(); + String fileNames = dirNames + File.separator + className + "Model.java"; + File file = new File(XSSEscape.escapePath(fileNames)); + if (!file.exists()) { + File dirFile = new File(XSSEscape.escapePath(dirNames)); + if (!dirFile.exists()) { + dirFile.mkdirs(); + } + file.createNewFile(); + } + @Cleanup FileOutputStream fos = new FileOutputStream(file); + IOUtils.write(sw.toString(), fos, Constants.UTF_8); + IOUtils.closeQuietly(sw); + IOUtils.closeQuietly(fos); + } catch (IOException e) { + e.printStackTrace(); + System.out.println("渲染模板失败,表名:" + e); + } + } + } + //-------------------------代码---------------------------------- + + /** + * 生成主表 + * + * @param dataSourceUtil 数据源 + * @param path 路径 + * @param fileName 文件夹名称 + * @param downloadCodeForm 文件名称 + * @param entity 实体 + * @param userInfo 用户 + * @param configValueUtil 下载路径 + */ + private static void setCode(DataSourceUtil dataSourceUtil, String path, String fileName, String templatePath, DownloadCodeForm downloadCodeForm, VisualdevEntity entity, + UserInfo userInfo, ConfigValueUtil configValueUtil, DbLinkEntity linkEntity) throws SQLException { + //自定义包名 + String modulePackageName = downloadCodeForm.getModulePackageName(); + //tableJson + List tableModelList = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + //赋值主键 + tableModelList.stream().forEach(t -> { + try { + t.setTableKey(VisualUtils.getpKey(linkEntity, t.getTable())); + } catch (SQLException sqlException) { + sqlException.printStackTrace(); + } + }); + Map columndata = new HashMap<>(16); + Template7Model model = new Template7Model(); + model.setTableName(downloadCodeForm.getClassName()); + model.setClassName(DataControlUtils.captureName(downloadCodeForm.getClassName())); + model.setServiceDirectory(configValueUtil.getServiceDirectoryPath()); + model.setCreateDate(DateUtil.daFormat(new Date())); + model.setCreateUser(GenBaseInfo.AUTHOR); + model.setCopyright(GenBaseInfo.COPYRIGHT); + model.setDescription(downloadCodeForm.getDescription()); + + //formTempJson + FormDataModel formData = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(entity.getColumnData(), ColumnDataModel.class); + //app 列表对象 + ColumnDataModel appColumnDataModel = JsonUtil.getJsonToBean(entity.getAppColumnData(), ColumnDataModel.class); + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + List formAllModel = new ArrayList<>(); + RecursionForm recursionForm = new RecursionForm(); + recursionForm.setTableModelList(JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class)); + recursionForm.setList(list); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + //主表数据 + List mast = formAllModel.stream().filter(t -> FormEnum.mast.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + List table = formAllModel.stream().filter(t -> FormEnum.table.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + List mastTable = formAllModel.stream().filter(t -> FormEnum.mastTable.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + //列表子表数据model + Map> groupColumnDataMap = mastTable.stream().collect(Collectors.groupingBy(m -> m.getFormMastTableModel().getTable())); + //取对应表的别名 + Map tableNameRenames = FunctionFormPublicUtil.tableNameRename(downloadCodeForm, tableModelList); + //子表集合 + List childTableNameList = new ArrayList<>(); + //全部表 + List allTableNameList = new ArrayList<>(); + for (TableModel tableModel : tableModelList) { + TableModel Model = new TableModel(); + Model.setInitName(tableModel.getTable()); + Model.setTable(tableNameRenames.get(tableModel.getTable())); + Model.setTableField(DataControlUtils.captureName(tableModel.getTableField())); + Model.setTypeId(tableModel.getTypeId()); + allTableNameList.add(Model); + if ("0".equals(tableModel.getTypeId())) { + childTableNameList.add(Model); + } + } + + //表单子表模型 + List formChildList = new ArrayList<>(); + //列表子表数据model + Iterator>> entries = groupColumnDataMap.entrySet().iterator(); + while (entries.hasNext()) { + Map.Entry> formEntries = entries.next(); + String className = DataControlUtils.captureName(tableNameRenames.get(formEntries.getKey())); + ColumnListDataModel columnListDataModel = new ColumnListDataModel(); + columnListDataModel.setModelName(className); + columnListDataModel.setModelUpName(DataControlUtils.captureName(className)); + columnListDataModel.setModelLowName(DataControlUtils.initialLowercase(className)); + List allModels = formEntries.getValue(); + List fields = allModels.stream().map(m -> + m.getFormMastTableModel().getField()).collect(Collectors.toList()); + columnListDataModel.setFieldList(fields); + columnListDataModel.setFieLdsModelList(allModels.stream().map(al -> al.getFormMastTableModel()).collect(Collectors.toList())); + columnListDataModel.setTableName(formEntries.getKey()); + formChildList.add(columnListDataModel); + } + formChildList.stream().forEach(f -> { + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equalsIgnoreCase(f.getTableName())).findFirst().orElse(null); + if (ObjectUtil.isNotEmpty(tableModel)) { + f.setMainKey(tableModel.getRelationField()); + f.setRelationField(tableModel.getTableField()); + f.setMainUpKey(DataControlUtils.captureName(tableModel.getRelationField())); + f.setRelationUpField(DataControlUtils.captureName(tableModel.getTableField())); + String tableKey = tableModel.getTableKey().toLowerCase().replace("f_" , ""); + tableKey = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, tableKey); + f.setMainField(DataControlUtils.captureName(tableKey)); + } + }); + + //主表的字段 + Optional first = tableModelList.stream().filter(t -> "1".equals(t.getTypeId())).findFirst(); + if (!first.isPresent()) { + throw new SQLException(MsgCode.COD001.get()); + } + String tableName = first.get().getTable(); + String billNo = ""; + List system = new ArrayList<>(); + for (int i = 0; i < mast.size(); i++) { + FormAllModel mastModel = mast.get(i); + FieLdsModel fieLdsModel = mastModel.getFormColumnModel().getFieLdsModel(); + if (StringUtil.isNotEmpty(fieLdsModel.getVModel())) { + system.add(fieLdsModel); + } + } + + //列表子表 + List childSystem = new ArrayList<>(); + for (int i = 0; i < mastTable.size(); i++) { + FormAllModel mastModel = mastTable.get(i); + FieLdsModel fieLdsModel = mastModel.getFormMastTableModel().getMastTable().getFieLdsModel(); + PropsModel propsModel = fieLdsModel.getProps(); + String vModel = fieLdsModel.getVModel(); + if (StringUtil.isNotEmpty(vModel)) { + fieLdsModel.setVModel(vModel.substring(vModel.lastIndexOf("jnpf_")).replace("jnpf_" , "")); + fieLdsModel.setProps(propsModel); + childSystem.add(fieLdsModel); + } + } + + //获取主表主键 + String pKeyName = VisualUtils.getpKey(linkEntity, tableName).toLowerCase().trim().replaceAll("f_" , ""); + //子表的属性 + List> child = new ArrayList<>(); + for (int i = 0; i < table.size(); i++) { + FormColumnTableModel childList = table.get(i).getChildList(); + String className = DataControlUtils.captureName(tableNameRenames.get(childList.getTableName())); + Map childs = JsonUtil.entityToMap(childList); + Optional first1 = tableModelList.stream().filter(t -> t.getTable().equals(childList.getTableName())).findFirst(); + if (!first1.isPresent()) { + throw new SQLException(MsgCode.COD001.get()); + } + TableModel tableModel = first1.get(); + //获取主表主键 + String chidKeyName = VisualUtils.getpKey(linkEntity, tableModel.getTable()); + String tableField = tableModel.getTableField().trim().replaceAll(":\"f_" , ":\""); + childs.put(JnpfKeyConsts.CHILD_TABLE_PREFIX, tableField); + String relationField = tableModel.getRelationField().trim().replaceAll(":\"f_" , ":\""); + childs.put("relationField" , relationField); + childs.put("className" , className); + String keyName = chidKeyName.trim().toLowerCase().replaceAll("f_" , ""); + childs.put("chidKeyName" , keyName); + child.add(childs); + } + + //后台 + columndata.put("module" , downloadCodeForm.getModule()); + columndata.put("genInfo" , model); + columndata.put("modelName" , model.getClassName()); + columndata.put("typeId" , 1); + columndata.put("system" , system); + columndata.put("childSystem" , childSystem); + columndata.put("child" , child); + columndata.put("childTableNameList" , childTableNameList); + columndata.put("billNo" , billNo); + columndata.put("pKeyName" , pKeyName); + columndata.put("fieldsSize" , system.size()); + columndata.put("main" , true); + columndata.put("mast" , mast); + columndata.put("childtable" , table); + columndata.put("mastTable" , mastTable); + columndata.put("groupColumnDataMap" , groupColumnDataMap); + columndata.put("columnChildren" , formChildList); + columndata.put("dbLink" , entity.getDbLinkId()); + + // 是否存在过滤条件 + columndata.put("hasFilter" , false); + if (columnDataModel != null) { + List ruleList = JsonUtil.getJsonToList(columnDataModel.getRuleList(), Map.class); + if (ruleList != null && ruleList.size() > 0) { + columndata.put("hasFilter" , true); + } + } + columndata.put("hasAppFilter" , false); + if (appColumnDataModel != null) { + List ruleListApp = JsonUtil.getJsonToList(appColumnDataModel.getRuleListApp(), Map.class); + if (ruleListApp != null && ruleListApp.size() > 0) { + columndata.put("hasAppFilter" , true); + } + } + //雪花 + columndata.put("snowflake" , formData.getPrimaryKeyPolicy() == 1); + //微服务标识 + columndata.put("isCloud" , FormCommonUtil.IS_CLOUD); + //数据源 + if (linkEntity != null) { + columndata.put("DS" , linkEntity.getFullName()); + } + CustomGenerator mpg = new CustomGenerator(columndata); + // 全局配置 + GlobalConfig gc = new GlobalConfig(); + gc.setFileOverride(true); + // 不需要ActiveRecord特性的请改为false + gc.setActiveRecord(false); + // XML 二级缓存 + gc.setEnableCache(false); + // XML ResultMap + gc.setBaseResultMap(false); + // XML columList + gc.setBaseColumnList(false); + gc.setAuthor(userInfo.getUserName() + "/" + userInfo.getUserAccount()); + gc.setOpen(false); + + // 自定义文件命名,注意 %s 会自动填充表实体属性! + gc.setEntityName(model.getClassName() + GenFileNameSuffix.ENTITY); + gc.setMapperName(model.getClassName() + GenFileNameSuffix.MAPPER); + gc.setXmlName(model.getClassName() + GenFileNameSuffix.MAPPER_XML); + gc.setServiceName(model.getClassName() + GenFileNameSuffix.SERVICE); + gc.setServiceImplName(model.getClassName() + GenFileNameSuffix.SERVICEIMPL); + gc.setControllerName(model.getClassName() + GenFileNameSuffix.CONTROLLER); + mpg.setGlobalConfig(gc); + + // 数据源配置 + mpg.setDataSource(SourceUtil.dbConfig(TenantDataSourceUtil.getTenantSchema(), linkEntity)); + + // 策略配置 + StrategyConfig strategy = new StrategyConfig(); + strategy.setEntityLombokModel(true); + // 表名生成策略 + strategy.setNaming(NamingStrategy.underline_to_camel); + // 需要生成的表 + strategy.setInclude(tableName); + strategy.setRestControllerStyle(true); + mpg.setStrategy(strategy); + + // 包配置 + PackageConfig pc = new PackageConfig(); + pc.setParent(modulePackageName); + mpg.setPackageInfo(pc); + // 包名 + columndata.put("modulePackageName" , modulePackageName); + + // 自定义配置 + InjectionConfig cfg = new InjectionConfig() { + @Override + public void initMap() { + // to do nothing + } + }; + List focList = new ArrayList<>(); + String javaPath = FormCommonUtil.getLocalBasePath() + model.getServiceDirectory(); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "Controller.java.vm" , "controller" , false)); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "Entity.java.vm" , "entity" , formData.getConcurrencyLock())); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "Mapper.java.vm" , "mapper" , false)); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "Mapper.xml.vm" , "xml" , false)); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "Service.java.vm" , "service" , false)); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "ServiceImpl.java.vm" , "impl" , false)); + + cfg.setFileOutConfigList(focList); + mpg.setTemplate(new TemplateConfig().setXml(null).setMapper(null).setController(null).setEntity(null).setService(null).setServiceImpl(null)); + mpg.setCfg(cfg); + // 执行生成 + mpg.execute(path); + } + + /** + * 生成子表 + * + * @param downloadCodeForm 表单信息 + * @param dataSourceUtil 数据源 + * @param path 路径 + * @param fileName 文件夹名称 + * @param className 文件名称 + * @param table 子表 + * @param userInfo 用户 + * @param configValueUtil 下载路径 + */ + private static void childTable(DataSourceUtil dataSourceUtil, String path, String fileName, String templatePath, DownloadCodeForm downloadCodeForm, + String className, String table, UserInfo userInfo, ConfigValueUtil configValueUtil, DbLinkEntity linkEntity) { + //自定义包名 + String modulePackageName = downloadCodeForm.getModulePackageName(); + Map columndata = new HashMap<>(16); + + Template7Model model = new Template7Model(); + model.setClassName(table); + model.setServiceDirectory(configValueUtil.getServiceDirectoryPath()); + model.setCreateDate(DateUtil.daFormat(new Date())); + model.setCreateUser(GenBaseInfo.AUTHOR); + model.setCopyright(GenBaseInfo.COPYRIGHT); + model.setDescription(table); + + //数据源 + if (ObjectUtil.isNotEmpty(linkEntity)) { + columndata.put("DS" , linkEntity.getFullName()); + } + columndata.put("genInfo" , model); + CustomGenerator mpg = new CustomGenerator(columndata); + // 全局配置 + GlobalConfig gc = new GlobalConfig(); + gc.setFileOverride(true); + // 不需要ActiveRecord特性的请改为false + gc.setActiveRecord(false); + // XML 二级缓存 + gc.setEnableCache(false); + // XML ResultMap + gc.setBaseResultMap(false); + // XML columList + gc.setBaseColumnList(false); + gc.setAuthor(model.getCreateUser()); + gc.setOpen(false); + + // 自定义文件命名,注意 %s 会自动填充表实体属性! + gc.setEntityName(className + GenFileNameSuffix.ENTITY); + gc.setMapperName(className + GenFileNameSuffix.MAPPER); + gc.setXmlName(className + GenFileNameSuffix.MAPPER_XML); + gc.setServiceName(className + GenFileNameSuffix.SERVICE); + gc.setServiceImplName(className + GenFileNameSuffix.SERVICEIMPL); + mpg.setGlobalConfig(gc); + + // 数据源配置 + mpg.setDataSource(SourceUtil.dbConfig(TenantDataSourceUtil.getTenantSchema(), linkEntity)); + + // 策略配置 + StrategyConfig strategy = new StrategyConfig(); + strategy.setEntityLombokModel(true); + // 表名生成策略 + strategy.setNaming(NamingStrategy.underline_to_camel); + // 需要生成的表 + strategy.setInclude(table); + strategy.setRestControllerStyle(true); + mpg.setStrategy(strategy); + + // 包配置 + PackageConfig pc = new PackageConfig(); + pc.setParent(modulePackageName); + mpg.setPackageInfo(pc); + //包名 + columndata.put("modulePackageName" , modulePackageName); + + // 自定义配置 + InjectionConfig cfg = new InjectionConfig() { + @Override + public void initMap() { + // to do nothing + } + }; + List focList = new ArrayList<>(); + String javaPath = FormCommonUtil.getLocalBasePath() + model.getServiceDirectory(); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "Entity.java.vm" , "entity" , false)); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "Mapper.java.vm" , "mapper" , false)); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "Mapper.xml.vm" , "xml" , false)); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "Service.java.vm" , "service" , false)); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "ServiceImpl.java.vm" , "impl" , false)); + + cfg.setFileOutConfigList(focList); + mpg.setTemplate(new TemplateConfig().setXml(null).setMapper(null).setController(null).setEntity(null).setService(null).setServiceImpl(null)); + mpg.setCfg(cfg); + // 执行生成 + mpg.execute(path); + } + + /** + * 生成表集合 + * + * @param entity 实体 + * @param dataSourceUtil 数据源 + * @param fileName 文件夹名称 + * @param downloadCodeForm 文件名称 + * @param userInfo 用户 + * @param configValueUtil 下载路径 + */ + @Override + public void generate(VisualdevEntity entity, DataSourceUtil dataSourceUtil, String fileName, String templatePath, DownloadCodeForm downloadCodeForm, + UserInfo userInfo, ConfigValueUtil configValueUtil, DbLinkEntity linkEntity) throws SQLException { + List list = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + //生成代码 + int i = 0; + for (TableModel model : list) { + if ("1".equals(model.getTypeId())) { + setCode(dataSourceUtil, FormCommonUtil.getLocalBasePath() + FormCommonUtil.getPath(FileTypeConstant.TEMPLATECODEPATH), + fileName, templatePath, downloadCodeForm, entity, userInfo, configValueUtil, linkEntity); + } else if ("0".equals(model.getTypeId())) { + String name = downloadCodeForm.getSubClassName().split(",")[i]; + String className = DataControlUtils.captureName(name); + childTable(dataSourceUtil, FormCommonUtil.getLocalBasePath() + FormCommonUtil.getPath(FileTypeConstant.TEMPLATECODEPATH), + fileName, templatePath, downloadCodeForm, className, model.getTable(), userInfo, configValueUtil, linkEntity); + i++; + } + } + } + + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/functionForm/FormListUtil.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/functionForm/FormListUtil.java new file mode 100644 index 0000000..cab1ed9 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/functionForm/FormListUtil.java @@ -0,0 +1,2030 @@ +package jnpf.base.util.functionForm; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.generator.InjectionConfig; +import com.baomidou.mybatisplus.generator.config.*; +import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy; +import com.google.common.base.CaseFormat; +import jnpf.base.UserInfo; +import jnpf.base.entity.VisualdevEntity; +import jnpf.base.model.ColumnDataModel; +import jnpf.base.model.DownloadCodeForm; +import jnpf.base.model.Template6.AuthorityModel; +import jnpf.base.model.Template6.BtnData; +import jnpf.base.model.Template6.ColumnListField; +import jnpf.base.model.Template7.Template7Model; +import jnpf.base.model.print.PrintOption; +import jnpf.base.util.SourceUtil; +import jnpf.base.util.VisualUtils; +import jnpf.base.util.common.DataControlUtils; +import jnpf.base.util.common.FormCommonUtil; +import jnpf.base.util.common.FunctionFormPublicUtil; +import jnpf.base.util.common.SuperQueryUtil; +import jnpf.base.util.custom.CustomGenerator; +import jnpf.config.ConfigValueUtil; +import jnpf.constant.FileTypeConstant; +import jnpf.constant.MsgCode; +import jnpf.database.model.entity.DbLinkEntity; +import jnpf.database.util.DataSourceUtil; +import jnpf.database.util.TenantDataSourceUtil; +import jnpf.generater.model.FormDesign.*; +import jnpf.generater.model.GenBaseInfo; +import jnpf.generater.model.GenFileNameSuffix; +import jnpf.model.visualJson.*; +import jnpf.model.visualJson.analysis.*; +import jnpf.model.visualJson.config.ConfigModel; +import jnpf.util.DateUtil; +import jnpf.util.JsonUtil; +import jnpf.util.StringUtil; +import jnpf.util.XSSEscape; +import jnpf.util.visiual.JnpfKeyConsts; +import lombok.Cleanup; +import org.apache.commons.io.IOUtils; +import org.apache.velocity.Template; +import org.apache.velocity.VelocityContext; +import org.apache.velocity.app.Velocity; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.StringWriter; +import java.sql.SQLException; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 列表表单 + * + * @author JNPF开发平台组 + * @version V3.2.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/9/4 + * @Description 功能列表 + */ +public class FormListUtil implements CodeGenerateUtil { + + private static FormListUtil formListUtil = new FormListUtil(); + + + private FormListUtil() { + + } + + public static FormListUtil getFormListUtil() { + return formListUtil; + } + + + //------------------------------------界面---------------------------------- + + /** + * 生成主表 + * + * @param dataSourceUtil 数据源 + * @param path 路径 + * @param fileName 文件夹名称 + * @param downloadCodeForm 文件名称 + * @param entity 实体 + * @param userInfo 用户 + */ + private static void setCode(DataSourceUtil dataSourceUtil, String path, String fileName, String templatePath, DownloadCodeForm downloadCodeForm, VisualdevEntity entity, + UserInfo userInfo, DbLinkEntity linkEntity) throws SQLException { + //自定义包名 + String modulePackageName = downloadCodeForm.getModulePackageName(); + + //tableJson + List tableModelList = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + //主表 + TableModel mainTable = tableModelList.stream().filter(t -> t.getTypeId().equals("1")).findFirst().orElse(null); + + //获取主表主键 + String pKeyName = VisualUtils.getpKey(linkEntity, mainTable.getTable()).toLowerCase().trim().replaceAll("f_", ""); + pKeyName = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, pKeyName); + + //赋值主键 + tableModelList.stream().forEach(t -> { + try { + t.setTableKey(VisualUtils.getpKey(linkEntity, t.getTable())); + } catch (SQLException sqlException) { + sqlException.printStackTrace(); + } + }); + Map columndata = new HashMap<>(16); + Template7Model model = new Template7Model(); + model.setTableName(downloadCodeForm.getClassName()); + model.setClassName(DataControlUtils.captureName(downloadCodeForm.getClassName())); + model.setServiceDirectory(FormCommonUtil.getPath(FileTypeConstant.CODETEMP)); + model.setCreateDate(DateUtil.daFormat(new Date())); + model.setCreateUser(GenBaseInfo.AUTHOR); + model.setCopyright(GenBaseInfo.COPYRIGHT); + model.setDescription(downloadCodeForm.getDescription()); + //pc列表对象 + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(entity.getColumnData(), ColumnDataModel.class); + //app 列表对象 + ColumnDataModel appColumnDataModel = JsonUtil.getJsonToBean(entity.getAppColumnData(), ColumnDataModel.class); + //按钮 + List btnDataList = JsonUtil.getJsonToList(columnDataModel.getBtnsList(), BtnData.class); + List columnBtnDataList = JsonUtil.getJsonToList(columnDataModel.getColumnBtnsList(), BtnData.class); + //是否有导入按钮 + boolean hasUploadBtn = btnDataList.stream().anyMatch(btn -> btn.getValue().equals("upload")); + + List columnList = JsonUtil.getJsonToList(columnDataModel.getColumnList(), ColumnListField.class); + List searchList = JsonUtil.getJsonToList(columnDataModel.getSearchList(), FieLdsModel.class); + + //权限 + AuthorityModel authority = new AuthorityModel(); + BeanUtil.copyProperties(columnDataModel, authority); + + //取对应表的别名 + Map tableNameRenames = FunctionFormPublicUtil.tableNameRename(downloadCodeForm, tableModelList); + + //子表集合 + List childTableNameList = new ArrayList<>(); + //全部表 + List allTableNameList = new ArrayList<>(); + + //formTempJson + FormDataModel formData = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + + List tableModelFields = new ArrayList<>(); + FunctionFormPublicUtil.getTableModels(list, tableModelFields); + + List formAllModel = new ArrayList<>(); + RecursionForm recursionForm = new RecursionForm(); + recursionForm.setTableModelList(JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class)); + recursionForm.setList(list); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + //主表数据 + List mast = formAllModel.stream().filter(t -> FormEnum.mast.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + List table = formAllModel.stream().filter(t -> FormEnum.table.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + //列表子表数据 + List mastTable = formAllModel.stream().filter(t -> FormEnum.mastTable.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + List subTableName = new ArrayList<>(); + for (FormAllModel allModel : table) { + FormColumnTableModel childList = allModel.getChildList(); + if (childList != null) { + subTableName.add(childList.getTableName()); + } + } + for (TableModel tableModel : tableModelList) { + TableModel Model = new TableModel(); + Model.setInitName(tableModel.getTable()); + Model.setTable(tableNameRenames.get(tableModel.getTable())); + Model.setTableField(DataControlUtils.captureName(tableModel.getTableField())); + if (Model.getTable().equals(mainTable.getTable())) { + Model.setTableTag("main"); + } else { + Model.setTableTag(subTableName.contains(Model.getTable()) ? "sub" : "sub-jnpf"); + } + allTableNameList.add(Model); + if ("0".equals(tableModel.getTypeId())) { + childTableNameList.add(Model); + } + } + //子表(tableField,tableName) + Map childKeyTableNameMap = new HashMap<>(8); + table.stream().forEach(t -> childKeyTableNameMap.put(t.getChildList().getTableModel(), t.getChildList().getTableName())); + + String treeRelationField = columnDataModel.getTreeRelation().replaceAll("-", "_"); + + //查询条件 + List jnpfkey = new ArrayList() {{ + add(JnpfKeyConsts.COM_INPUT); + add(JnpfKeyConsts.TEXTAREA); + }}; + List searchTypeModelList = new ArrayList<>(); + searchList.stream().forEach(fieLdsModel -> { + SearchTypeModel searchTypeModel = new SearchTypeModel(); + searchTypeModel.setJnpfKey(fieLdsModel.getConfig().getJnpfKey()); + Integer seachType = fieLdsModel.getSearchType(); + if (jnpfkey.contains(searchTypeModel.getJnpfKey()) && seachType.equals(3)) { + seachType = 2; + } + searchTypeModel.setSearchType(seachType); + String vModel = fieLdsModel.getVModel(); + vModel = vModel.replaceAll("-", "_"); + searchTypeModel.setVModel(vModel); + searchTypeModel.setLabel(fieLdsModel.getConfig().getLabel()); + searchTypeModel.setFormat(fieLdsModel.getFormat()); + searchTypeModel.setMultiple((String.valueOf(fieLdsModel.getSearchMultiple()))); + searchTypeModelList.add(searchTypeModel); + }); + TableModel mainTableModel = tableModelList.stream().filter(t -> t.getTypeId().equals("1")).findFirst().orElse(null); + if (columnDataModel.getType() == 2) { + SearchTypeModel searchTypeModel = searchTypeModelList.stream().filter(t -> t.getVModel().equals(treeRelationField)).findFirst().orElse(null); + if (searchTypeModel == null) { + searchTypeModel = new SearchTypeModel(); + searchTypeModel.setVModel(treeRelationField); + searchTypeModel.setSearchType(2); + if (columnDataModel.getTreeDataSource().equals("organize")) { + searchTypeModel.setJnpfKey(JnpfKeyConsts.COMSELECT); + searchTypeModel.setSearchType(1); + } + searchTypeModel.setLabel("tree"); + searchTypeModel.setTableName(mainTableModel.getTable()); + searchTypeModelList.add(searchTypeModel); + } + } + + List groupModels = new ArrayList<>(); + if (searchTypeModelList.size() > 0) { + //主表 + for (TableFields tableFields : mainTableModel.getFields()) { + searchTypeModelList.stream().forEach(searchTypeModel -> { + if (searchTypeModel.getVModel().equals(tableFields.getField())) { + searchTypeModel.setDataType(tableFields.getDataType()); + } + }); + } + //鉴别列表子表正则 + String reg = "^[jnpf_]\\S*_jnpf\\S*"; + searchTypeModelList.stream().filter(s -> s.getVModel().matches(reg)).forEach(cl -> { + String s = cl.getVModel(); + String s1 = s.substring(s.lastIndexOf("jnpf_")).replace("jnpf_", ""); + String s2 = s.substring(s.indexOf("_") + 1, s.lastIndexOf("_jnpf")); + cl.setAfterVModel(s1); + cl.setTableName(s2); + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equalsIgnoreCase(s2)).findFirst().orElse(null); + cl.setDataType(tableModel.getFields().stream().filter(t -> t.getField().equalsIgnoreCase(s1)).findFirst().orElse(null).getDataType()); + } + ); + //逻辑查询条件 + Map> collect = searchTypeModelList.stream().filter(s -> s.getVModel().matches(reg)).collect(Collectors.groupingBy(t -> t.getTableName())); + groupModels = collect.entrySet().stream().map(c -> { + ListSearchGroupModel groupModel = new ListSearchGroupModel(); + groupModel.setModelName(tableNameRenames.get(c.getKey())); + groupModel.setTableName(c.getKey()); + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equalsIgnoreCase(c.getKey())).findFirst().orElse(null); + groupModel.setForeignKey(tableModel.getTableField()); + groupModel.setMainKey(tableModel.getRelationField()); + groupModel.setSearchTypeModelList(c.getValue()); + return groupModel; + } + ).collect(Collectors.toList()); + + //子表 + Map> collect1 = searchTypeModelList.stream().filter(s -> s.getVModel().toLowerCase().contains(JnpfKeyConsts.CHILD_TABLE_PREFIX)) + .collect(Collectors.groupingBy(t -> t.getVModel().substring(0, t.getVModel().lastIndexOf("_")))); + List collect2 = collect1.entrySet().stream().map(c -> { + ListSearchGroupModel groupModel = new ListSearchGroupModel(); + String tableName = childKeyTableNameMap.get(c.getKey()); + groupModel.setModelName(tableNameRenames.get(tableName)); + groupModel.setTableName(tableName); + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equalsIgnoreCase(tableName)).findFirst().orElse(null); + groupModel.setForeignKey(tableModel.getTableField()); + groupModel.setMainKey(tableModel.getRelationField()); + List value = c.getValue(); + value.stream().forEach(v -> { + String vModel = v.getVModel(); + String substring = vModel.substring(vModel.lastIndexOf("_") + 1); + v.setAfterVModel(substring); + }); + groupModel.setSearchTypeModelList(value); + return groupModel; + } + ).collect(Collectors.toList()); + groupModels.addAll(collect2); + + ListSearchGroupModel groupModel = new ListSearchGroupModel(); + groupModel.setSearchTypeModelList(searchTypeModelList.stream().filter(s -> !s.getVModel().matches(reg) + && !s.getVModel().toLowerCase().contains(JnpfKeyConsts.CHILD_TABLE_PREFIX)).collect(Collectors.toList())); + groupModel.setTableName(mainTable.getTable()); + groupModel.setModelName(tableNameRenames.get(mainTable.getTable())); + groupModels.add(groupModel); + } + + + //-----------------------------------------------------app state------------------------------------------ + //查询条件 + List searchAppList = JsonUtil.getJsonToList(appColumnDataModel.getSearchList(), FieLdsModel.class); + List searchTypeAppModelList = new ArrayList<>(); + searchAppList.stream().forEach(fieLdsModel -> { + SearchTypeModel searchTypeModel = new SearchTypeModel(); + searchTypeModel.setJnpfKey(fieLdsModel.getConfig().getJnpfKey()); + Integer seachType = fieLdsModel.getSearchType(); + if (jnpfkey.contains(searchTypeModel.getJnpfKey()) && seachType.equals(3)) { + seachType = 2; + } + searchTypeModel.setSearchType(seachType); + String vModel = fieLdsModel.getVModel(); + vModel = vModel.replaceAll("-", "_"); + searchTypeModel.setVModel(vModel); + searchTypeModel.setLabel(fieLdsModel.getConfig().getLabel()); + searchTypeModel.setFormat(fieLdsModel.getFormat()); + searchTypeModel.setMultiple((String.valueOf(fieLdsModel.getSearchMultiple()))); + searchTypeAppModelList.add(searchTypeModel); + }); + + + List groupAppModels = new ArrayList<>(); + if (searchTypeAppModelList.size() > 0) { + //主表 + for (TableFields tableFields : mainTableModel.getFields()) { + searchTypeAppModelList.stream().forEach(searchTypeModel -> { + if (searchTypeModel.getVModel().equals(tableFields.getField())) { + searchTypeModel.setDataType(tableFields.getDataType()); + } + }); + } + //鉴别列表子表正则 + String reg = "^[jnpf_]\\S*_jnpf\\S*"; + searchTypeAppModelList.stream().filter(s -> s.getVModel().matches(reg)).forEach(cl -> { + String s = cl.getVModel(); + String s1 = s.substring(s.lastIndexOf("jnpf_")).replace("jnpf_", ""); + String s2 = s.substring(s.indexOf("_") + 1, s.lastIndexOf("_jnpf")); + cl.setAfterVModel(s1); + cl.setTableName(s2); + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equalsIgnoreCase(s2)).findFirst().orElse(null); + cl.setDataType(tableModel.getFields().stream().filter(t -> t.getField().equalsIgnoreCase(s1)).findFirst().orElse(null).getDataType()); + } + ); + //副表 + Map> collect = searchTypeAppModelList.stream().filter(s -> s.getVModel().matches(reg)).collect(Collectors.groupingBy(t -> t.getTableName())); + groupAppModels = collect.entrySet().stream().map(c -> { + ListSearchGroupModel groupModel = new ListSearchGroupModel(); + groupModel.setModelName(tableNameRenames.get(c.getKey())); + groupModel.setTableName(c.getKey()); + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equalsIgnoreCase(c.getKey())).findFirst().orElse(null); + groupModel.setForeignKey(tableModel.getTableField()); + groupModel.setMainKey(tableModel.getRelationField()); + groupModel.setSearchTypeModelList(c.getValue()); + return groupModel; + } + ).collect(Collectors.toList()); + + //子表 + Map> collect1 = searchTypeAppModelList.stream().filter(s -> s.getVModel().toLowerCase().contains(JnpfKeyConsts.CHILD_TABLE_PREFIX)) + .collect(Collectors.groupingBy(t -> t.getVModel().substring(0, t.getVModel().lastIndexOf("_")))); + List collect2 = collect1.entrySet().stream().map(c -> { + ListSearchGroupModel groupModel = new ListSearchGroupModel(); + String tableName = childKeyTableNameMap.get(c.getKey()); + groupModel.setModelName(tableNameRenames.get(tableName)); + groupModel.setTableName(tableName); + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equalsIgnoreCase(tableName)).findFirst().orElse(null); + groupModel.setForeignKey(tableModel.getTableField()); + groupModel.setMainKey(tableModel.getRelationField()); + List value = c.getValue(); + value.stream().forEach(v -> { + String vModel = v.getVModel(); + String substring = vModel.substring(vModel.lastIndexOf("_") + 1); + v.setAfterVModel(substring); + }); + groupModel.setSearchTypeModelList(value); + return groupModel; + } + ).collect(Collectors.toList()); + groupAppModels.addAll(collect2); + + ListSearchGroupModel groupModel = new ListSearchGroupModel(); + groupModel.setSearchTypeModelList(searchTypeAppModelList.stream().filter(s -> + !s.getVModel().matches(reg) && !s.getVModel().toLowerCase().contains(JnpfKeyConsts.CHILD_TABLE_PREFIX)).collect(Collectors.toList())); + groupModel.setTableName(mainTable.getTable()); + groupModel.setModelName(tableNameRenames.get(mainTable.getTable())); + groupAppModels.add(groupModel); + } + + //-----------------------------------------------------app end------------------------------------------ + + + //表单子表模型 + List formChildList = new ArrayList<>(); + + //列表子表数据model + Map> groupColumnDataMap = mastTable.stream().collect(Collectors.groupingBy(m -> m.getFormMastTableModel().getTable())); + Iterator>> entries = groupColumnDataMap.entrySet().iterator(); + while (entries.hasNext()) { + Map.Entry> formEntries = entries.next(); + String className = DataControlUtils.captureName(tableNameRenames.get(formEntries.getKey())); + ColumnListDataModel columnListDataModel = new ColumnListDataModel(); + columnListDataModel.setModelName(className); + columnListDataModel.setModelUpName(DataControlUtils.captureName(className)); + columnListDataModel.setModelLowName(DataControlUtils.initialLowercase(className)); + List allModels = formEntries.getValue(); + List fields = allModels.stream().map(m -> + m.getFormMastTableModel().getField()).collect(Collectors.toList()); + columnListDataModel.setFieldList(fields); + columnListDataModel.setFieLdsModelList(allModels.stream().map(al -> al.getFormMastTableModel()).collect(Collectors.toList())); + columnListDataModel.setTableName(formEntries.getKey()); + + List collect = allModels.stream().map(all -> all.getFormMastTableModel().getMastTable().getFieLdsModel()).collect(Collectors.toList()); + collect.stream().forEach(c -> { + String vmodel = c.getVModel().substring(c.getVModel().lastIndexOf("jnpf_")).replace("jnpf_", ""); + c.setVModel(vmodel); + List templateJson = c.getConfig().getTemplateJson(); + String json = templateJson.size() > 0 ? JSONObject.toJSONString(JsonUtil.getObjectToString(templateJson)) + : JSONObject.toJSONString(JsonUtil.getObjectToString(JsonUtil.getJsonToList(c.getTemplateJson(), TemplateJsonModel.class))); + c.setTemplateJson(json); + }); + columnListDataModel.setFieLdsModels(collect); + formChildList.add(columnListDataModel); + } + + formChildList.stream().forEach(f -> { + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equalsIgnoreCase(f.getTableName())).findFirst().orElse(null); + if (ObjectUtil.isNotEmpty(tableModel)) { + f.setMainKey(tableModel.getRelationField()); + f.setRelationField(tableModel.getTableField()); + f.setMainUpKey(DataControlUtils.captureName(tableModel.getRelationField())); + f.setRelationUpField(DataControlUtils.captureName(tableModel.getTableField())); + String tableKey = tableModel.getTableKey().toLowerCase().replace("f_", ""); + tableKey = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, tableKey); + f.setMainField(DataControlUtils.captureName(tableKey)); + } + }); + + //主表的字段 + Optional first = tableModelList.stream().filter(t -> "1".equals(t.getTypeId())).findFirst(); + if (!first.isPresent()) { + throw new SQLException(MsgCode.COD001.get()); + } + String tableName = first.get().getTable(); + String billNo = ""; + List system = new ArrayList<>(); + for (int i = 0; i < mast.size(); i++) { + FormAllModel mastModel = mast.get(i); + FieLdsModel fieLdsModel = mastModel.getFormColumnModel().getFieLdsModel(); + if (StringUtil.isNotEmpty(fieLdsModel.getVModel())) { + List templateJson = fieLdsModel.getConfig().getTemplateJson(); + String json = templateJson.size() > 0 ? JSONObject.toJSONString(JsonUtil.getObjectToString(templateJson)) + : JSONObject.toJSONString(JsonUtil.getObjectToString(JsonUtil.getJsonToList(fieLdsModel.getTemplateJson(), TemplateJsonModel.class))); + fieLdsModel.setTemplateJson(json); + system.add(fieLdsModel); + } + } + //详情 主表 + List mainDeatail = mast.stream().map(mas -> mas.getFormColumnModel().getFieLdsModel()).collect(Collectors.toList()); + + //子表的属性 + List> child = new ArrayList<>(); + for (int i = 0; i < table.size(); i++) { + FormColumnTableModel childList = table.get(i).getChildList(); + List childListAll = childList.getChildList(); + for (FormColumnModel columnModel : childListAll) { + FieLdsModel fieLdsModel = columnModel.getFieLdsModel(); + List templateJson = fieLdsModel.getConfig().getTemplateJson(); + String json = templateJson.size() > 0 ? JSONObject.toJSONString(JsonUtil.getObjectToString(templateJson)) + : JSONObject.toJSONString(JsonUtil.getObjectToString(JsonUtil.getJsonToList(fieLdsModel.getTemplateJson(), TemplateJsonModel.class))); + fieLdsModel.setTemplateJson(json); + } + String className = DataControlUtils.captureName(tableNameRenames.get(childList.getTableName())); + childList.setAliasClassName(className); + Map childs = JsonUtil.entityToMap(childList); + Optional first1 = tableModelList.stream().filter(t -> t.getTable().equals(childList.getTableName())).findFirst(); + if (!first1.isPresent()) { + throw new SQLException(MsgCode.COD001.get()); + } + TableModel tableModel = first1.get(); + //获取主表主键 + String chidKeyName = VisualUtils.getpKey(linkEntity, tableModel.getTable()); + String tableField = tableModel.getTableField().trim().replaceAll(":\"f_", ":\""); + childs.put(JnpfKeyConsts.CHILD_TABLE_PREFIX, tableField); + String relationField = tableModel.getRelationField().trim().replaceAll(":\"f_", ":\""); + childs.put("relationField", relationField); + childs.put("className", className); + String chidKeyField = chidKeyName.trim().toLowerCase().replaceAll("f_", ""); + chidKeyField = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, chidKeyField); + childs.put("chidKeyName", chidKeyField); + child.add(childs); + } + + //导入字段 + List allUploadTemplates = new ArrayList<>(); + boolean imHasChildren = false; + UploaderTemplateModel uploaderTemplateModel = JsonUtil.getJsonToBean(columnDataModel.getUploaderTemplateJson(), UploaderTemplateModel.class); + if (hasUploadBtn && uploaderTemplateModel != null && uploaderTemplateModel.getSelectKey() != null) { + List cols = new ArrayList<>(); + for (String upload : uploaderTemplateModel.getSelectKey()) { + ColumnChildListModel columnChildListModel = new ColumnChildListModel(); + String tableField; + String vModel; + ColumnListField field = columnList.stream().filter(c -> c.getProp().equals(upload)).findFirst().orElse(new ColumnListField()); + String label = field.getConfig() != null ? field.getConfig().getLabel() : ""; + if (upload.toLowerCase().startsWith(JnpfKeyConsts.CHILD_TABLE_PREFIX)) { + tableField = upload.substring(0, upload.indexOf("-")); + vModel = upload.substring(upload.indexOf("-") + 1); + imHasChildren = true; + } else if (upload.toLowerCase().startsWith("jnpf_")) { + List masField = mastTable.stream().map(m -> m.getFormMastTableModel().getMastTable().getFieLdsModel()).collect(Collectors.toList()); + FieLdsModel masF = masField.stream().filter(mas -> + upload.substring(upload.lastIndexOf("jnpf_") + 5) + .equals(mas.getVModel()) + ).findFirst().orElse(new FieLdsModel()); + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equals(masF.getConfig().getTableName())).findFirst().orElse(null); + masF.setRelationTableForeign(tableModel.getTableField()); + masF.setMainTableId(tableModel.getRelationField()); + String name = tableModel.getTableKey().toLowerCase().replaceAll("f_", ""); + masF.setChildMainKey(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, name)); + masF.setTableType(1); + masF.setBeforeVmodel(upload); + allUploadTemplates.add(masF); + tableField = ""; + vModel = upload; + } else { + tableField = ""; + vModel = upload; + List mastField = mast.stream().map(m -> m.getFormColumnModel().getFieLdsModel()).collect(Collectors.toList()); + FieLdsModel mastF = mastField.stream().filter(mas -> mas.getVModel().equals(upload)).findFirst().orElse(new FieLdsModel()); + mastF.setTableType(0); + allUploadTemplates.add(mastF); + } + columnChildListModel.setTableField(tableField); + columnChildListModel.setLabel(label); + columnChildListModel.setVModel(vModel); + cols.add(columnChildListModel); + } + Map> improtCollect = cols.stream().filter(col -> + StringUtil.isNotEmpty(col.getTableField())).collect(Collectors.groupingBy(ColumnChildListModel::getTableField)); + for (Map.Entry> m : improtCollect.entrySet()) { + String tableFiled = m.getKey(); + FieLdsModel fieLdsModel = tableModelFields.stream().filter(t -> t.getVModel().equals(tableFiled)).findFirst().orElse(null); + List children = fieLdsModel.getConfig().getChildren(); + List chlidFields = new ArrayList<>(); + for (ColumnChildListModel columnChildListModel : m.getValue()) { + FieLdsModel fieLdsModel2 = children.stream().filter(ch -> ch.getVModel().equals(columnChildListModel.getVModel())).findFirst().orElse(null); + chlidFields.add(fieLdsModel2); + } + String tableName1 = fieLdsModel.getConfig().getTableName(); + fieLdsModel.getConfig().setAliasClassName(tableNameRenames.get(tableName1)); + fieLdsModel.getConfig().setChildren(chlidFields); + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equals(fieLdsModel.getConfig().getTableName())).findFirst().orElse(null); + fieLdsModel.setRelationTableForeign(tableModel.getTableField()); + fieLdsModel.setMainTableId(tableModel.getRelationField()); + String tableKey = tableModel.getTableKey(); + String name = tableKey.toLowerCase().replaceAll("f_", ""); + fieLdsModel.setChildMainKey(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, name)); + fieLdsModel.setTableType(2); + allUploadTemplates.add(fieLdsModel); + } + } + + //树形列表参数 + if (columnDataModel.getType() == 5) { + columnDataModel.setHasPage(false); + } + String parentField = StringUtil.isNotEmpty(columnDataModel.getParentField()) ? + columnDataModel.getParentField() : ""; + if (StringUtil.isNotEmpty(parentField)) { + parentField = parentField.substring(0, 1).toUpperCase() + parentField.substring(1); + } + String subField = StringUtil.isNotEmpty(columnDataModel.getSubField()) ? + columnDataModel.getSubField() : ""; + if (StringUtil.isNotEmpty(subField)) { + subField = subField.substring(0, 1).toUpperCase() + subField.substring(1); + } + + //导出字段属性转换 + List listOptions = new ArrayList<>(); + columnList.forEach(item -> { + ColumnListField columnListField = new ColumnListField(); + BeanUtil.copyProperties(item, columnListField); + if (item.getVModel().toLowerCase().startsWith(JnpfKeyConsts.CHILD_TABLE_PREFIX)) { + columnListField.setTableType(2); + columnListField.setVModel(item.getVModel().split("-")[1]); + } else if (item.getVModel().toLowerCase().contains("_jnpf_")) { + columnListField.setTableType(1); + columnListField.setVModel(item.getVModel().split("_jnpf_")[1]); + } else { + columnListField.setTableType(0); + } + if ("static".equals(item.getConfig().getDataType())) { + columnListField.setOptions(JsonUtil.getObjectToString(item.getOptions())); + if (item.getJnpfKey().equals(JnpfKeyConsts.CHECKBOX)) { + columnListField.setMultiple(true); + } + } + listOptions.add(columnListField); + }); + + columndata.put("treeTable", columnDataModel.getType() == 5); + columndata.put("treeLazyType", true); + columndata.put("parentField", parentField); + columndata.put("subField", subField); + columndata.put("dbLink" , entity.getDbLinkId()); + + // 是否存在列表子表数据 + columndata.put("hasSub", groupColumnDataMap.size() > 0 ? true : false); + + //后台 + columndata.put("importFields", allUploadTemplates); + columndata.put("importHasChildren", imHasChildren); + columndata.put("module", downloadCodeForm.getModule()); + columndata.put("genInfo", model); + columndata.put("modelName", model.getClassName()); + columndata.put("typeId", 1); + columndata.put("system", system); + columndata.put("child", child); + columndata.put("billNo", billNo); + columndata.put("pKeyName", pKeyName); + columndata.put("fieldsSize", system.size()); + columndata.put("btnsList", btnDataList); + columndata.put("searchList", searchList); + columndata.put("columnList", columnList); + columndata.put("listOptions", listOptions); + columndata.put("hasPage", columnDataModel.getHasPage()); + columndata.put("main", true); + columndata.put("defaultSidx", columnDataModel.getDefaultSidx()); + columndata.put("sort", columnDataModel.getSort()); + columndata.put("searchTypeModelList", searchTypeModelList); + columndata.put("columnBtnsList", columnBtnDataList); + columndata.put("mast", mast); + columndata.put("childtable", table); + columndata.put("authority", authority); + //app pc 数据权限是否开启 + columndata.put("pcDataPermisson", columnDataModel.getUseDataPermission()); + columndata.put("appDataPermisson", appColumnDataModel.getUseDataPermission()); + columndata.put("columnChildren", formChildList); + columndata.put("groupModels", groupModels); + columndata.put("groupAppModels", groupAppModels); + columndata.put("childTableNameList", childTableNameList); + columndata.put("allTableNameList", allTableNameList); + columndata.put("mainDeatail", mainDeatail); + columndata.put("superQuery", columnDataModel.getHasSuperQuery()); + columndata.put("ruleQuery", true); + columndata.put("groupTable", columnDataModel.getType() == 3); + columndata.put("groupField", columnDataModel.getGroupField()); + columndata.put("lineEdit", columnDataModel.getType() == 4); + columndata.put("formModelName", entity.getFullName()); + //乐观锁 + columndata.put("version", formData.getConcurrencyLock()); + //删除标志 + columndata.put("logicalDelete", formData.getLogicalDelete()); + //雪花 + columndata.put("snowflake", formData.getPrimaryKeyPolicy() == 1); + //微服务标识 + columndata.put("isCloud", FormCommonUtil.IS_CLOUD); + //数据源 + if (ObjectUtil.isNotEmpty(linkEntity)) { + columndata.put("DS", linkEntity.getFullName()); + } + + // 是否存在过滤条件 + columndata.put("hasFilter",false); + if(columnDataModel!=null){ + List ruleList = JsonUtil.getJsonToList(columnDataModel.getRuleList(), Map.class); + if(ruleList!=null && ruleList.size()>0){ + columndata.put("hasFilter",true); + } + } + columndata.put("hasAppFilter",false); + if(appColumnDataModel!=null){ + List ruleListApp = JsonUtil.getJsonToList(appColumnDataModel.getRuleListApp(), Map.class); + if(ruleListApp!=null && ruleListApp.size()>0){ + columndata.put("hasAppFilter",true); + } + } + + CustomGenerator mpg = new CustomGenerator(columndata); + // 全局配置 + GlobalConfig gc = new GlobalConfig(); + gc.setFileOverride(true); + // 不需要ActiveRecord特性的请改为false + gc.setActiveRecord(false); + // XML 二级缓存 + gc.setEnableCache(false); + // XML ResultMap + gc.setBaseResultMap(false); + // XML columList + gc.setBaseColumnList(false); + gc.setAuthor(userInfo.getUserName() + "/" + userInfo.getUserAccount()); + gc.setOpen(false); + + // 自定义文件命名,注意 %s 会自动填充表实体属性! + gc.setEntityName(model.getClassName() + GenFileNameSuffix.ENTITY); + gc.setMapperName(model.getClassName() + GenFileNameSuffix.MAPPER); + gc.setXmlName(model.getClassName() + GenFileNameSuffix.MAPPER_XML); + gc.setServiceName(model.getClassName() + GenFileNameSuffix.SERVICE); + gc.setServiceImplName(model.getClassName() + GenFileNameSuffix.SERVICEIMPL); + gc.setControllerName(model.getClassName() + GenFileNameSuffix.CONTROLLER); + mpg.setGlobalConfig(gc); + + // 数据源配置 + DataSourceConfig dsc = SourceUtil.dbConfig(TenantDataSourceUtil.getTenantSchema(), linkEntity); + mpg.setDataSource(dsc); + //数据库类型 + columndata.put("dbType", dsc.getDbType().getDb()); + + // 策略配置 + StrategyConfig strategy = new StrategyConfig(); + strategy.setEntityLombokModel(true); + // 表名生成策略 + strategy.setNaming(NamingStrategy.underline_to_camel); + // 需要生成的表 + strategy.setInclude(tableName); + strategy.setRestControllerStyle(true); + mpg.setStrategy(strategy); + + // 包配置 + PackageConfig pc = new PackageConfig(); + pc.setParent(modulePackageName); + mpg.setPackageInfo(pc); + // 包名 + columndata.put("modulePackageName", modulePackageName); + + // 自定义配置 + InjectionConfig cfg = new InjectionConfig() { + @Override + public void initMap() { + // to do nothing + } + }; + List focList = new ArrayList<>(); + String javaPath = FormCommonUtil.getLocalBasePath() + model.getServiceDirectory(); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "Controller.java.vm", "controller", false)); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "Entity.java.vm", "entity", formData.getConcurrencyLock())); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "Mapper.java.vm", "mapper", false)); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "Mapper.xml.vm", "xml", false)); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "Service.java.vm", "service", false)); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "ServiceImpl.java.vm", "impl", false)); + + cfg.setFileOutConfigList(focList); + mpg.setTemplate(new TemplateConfig().setXml(null).setMapper(null).setController(null).setEntity(null).setService(null).setServiceImpl(null)); + mpg.setCfg(cfg); + // 执行生成 + mpg.execute(path); + } + + /** + * 获取文件名 + * + * @param path 路径 + * @param template 模板名称 + * @param className 文件名称 + * @return + */ + private static String getFileName(String path, String template, String className, DownloadCodeForm downloadCodeForm) { + //是否微服务路径 + String framePath = FormCommonUtil.getCloudPath("-entity", downloadCodeForm); + String modelPath = XSSEscape.escapePath(path + File.separator + "java" + File.separator + framePath + File.separator + "model" + + File.separator + className.toLowerCase()); + String htmlPath = XSSEscape.escapePath(path + File.separator + "html" + File.separator + "web" + File.separator + className.toLowerCase()); + File htmlfile = new File(htmlPath); + File modelfile = new File(modelPath); + if (!htmlfile.exists()) { + htmlfile.mkdirs(); + } + if (!modelfile.exists()) { + modelfile.mkdirs(); + } + if (template.contains("extraForm.vue.vm")) { + className = "extraForm"; + return htmlPath + File.separator + className + ".vue"; + } + if (template.contains("Form.vue.vm")) { + className = "Form"; + return htmlPath + File.separator + className.toLowerCase() + ".vue"; + } + if (template.contains("index.vue.vm")) { + className = "index"; + return htmlPath + File.separator + className + ".vue"; + } + if (template.contains("indexEdit.vue.vm")) { + className = "index"; + return htmlPath + File.separator + className + ".vue"; + } + if (template.contains("ExportBox.vue.vm")) { + className = "ExportBox"; + return htmlPath + File.separator + className + ".vue"; + } + if (template.contains("Detail.vue.vm")) { + className = "Detail"; + return htmlPath + File.separator + className + ".vue"; + } + if (template.contains("InfoVO.java.vm")) { + return modelPath + File.separator + className + "InfoVO.java"; + } + if (template.contains("Form.java.vm")) { + return modelPath + File.separator + className + "Form.java"; + } + if (template.contains("ListVO.java.vm")) { + return modelPath + File.separator + className + "ListVO.java"; + } + if (template.contains("GroupVO.java.vm")) { + return modelPath + File.separator + className + "GroupVO.java"; + } + if (template.contains("Pagination.java.vm")) { + return modelPath + File.separator + className + "Pagination.java"; + } + if (template.contains("ExcelVO.java.vm")) { + return modelPath + File.separator + className + "ExcelVO.java"; + } + if (template.contains("ExcelErrorVO.java.vm")) { + return modelPath + File.separator + className + "ExcelErrorVO.java"; + } + return null; + } + + /** + * 界面的模板 + * + * @param template 模板集合 + * @return + */ + private static List getTemplates(String template, int type, boolean hasImport) { + List templates = new ArrayList<>(); + //前端页面 + if (type == 4) { + templates.add(template + File.separator + "html" + File.separator + "indexEdit.vue.vm"); + templates.add(template + File.separator + "html" + File.separator + "extraForm.vue.vm"); + } else { + templates.add(template + File.separator + "html" + File.separator + "index.vue.vm"); + templates.add(template + File.separator + "html" + File.separator + "Form.vue.vm"); + } + templates.add(template + File.separator + "html" + File.separator + "ExportBox.vue.vm"); + templates.add(template + File.separator + "html" + File.separator + "Detail.vue.vm"); + //后端 + templates.add(template + File.separator + "java" + File.separator + "InfoVO.java.vm"); + templates.add(template + File.separator + "java" + File.separator + "Form.java.vm"); + templates.add(template + File.separator + "java" + File.separator + "ListVO.java.vm"); + if (type == 3) { + templates.add(template + File.separator + "java" + File.separator + "GroupVO.java.vm"); + } + if (hasImport) { + templates.add(template + File.separator + "java" + File.separator + "ExcelVO.java.vm"); + templates.add(template + File.separator + "java" + File.separator + "ExcelErrorVO.java.vm"); + } + templates.add(template + File.separator + "java" + File.separator + "Pagination.java.vm"); + return templates; + } + + /** + * 渲染html模板 + * + * @param path 路径 + * @param object 模板数据 + * @param templatePath 模板路径 + */ + private static void htmlTemplates(String path, Map object, String templatePath, int type, boolean hasImport, DownloadCodeForm downloadCodeForm) throws Exception { + List templates = getTemplates(templatePath, type, hasImport); + //界面模板 + VelocityContext context = new VelocityContext(); + context.put("context", object); + for (String template : templates) { + try { + // 渲染模板 + @Cleanup StringWriter sw = new StringWriter(); + Template tpl; + if (template.contains("index.vue.vm") && type == 4) { + String s = template.replace("index", "indexEdit"); + tpl = Velocity.getTemplate(s, Constants.UTF_8); + } else { + tpl = Velocity.getTemplate(template, Constants.UTF_8); + } + tpl.merge(context, sw); + String className = object.get("className").toString(); + String fileNames = getFileName(path, template, className, downloadCodeForm); + if (fileNames != null) { + File file = new File(XSSEscape.escapePath(fileNames)); + if (!file.exists()) { + file.createNewFile(); + } + @Cleanup FileOutputStream fos = new FileOutputStream(file); + IOUtils.write(sw.toString(), fos, Constants.UTF_8); + IOUtils.closeQuietly(sw); + IOUtils.closeQuietly(fos); + } + } catch (IOException e) { + e.printStackTrace(); + System.out.println("渲染模板失败,表名:" + e); + } + } + } + + public static String getChildrenFileName(String dirNames, String template, String className) { + String finallyPath = ""; + if (template.contains("Model.java.vm")) { + finallyPath = dirNames + File.separator + className + "Model.java"; + } else if (template.contains("ListVO.java.vm")) { + finallyPath = dirNames + File.separator + className + "ListVO.java"; + } + return finallyPath; + } + + /** + * 渲染html模板 + * + * @param path 路径 + * @param object 模板数据 + * @param templatePath 模板路径 + */ + private static void childrenTemplates(String path, Map object, String templatePath, String className, + DownloadCodeForm downloadCodeForm, Boolean isChild) { + //是否微服务路径 + String framePath = FormCommonUtil.getCloudPath("-entity", downloadCodeForm); + String model = downloadCodeForm.getClassName(); + List templates = new ArrayList<>(); + templates.add(templatePath + File.separator + "java" + File.separator + "Model.java.vm"); + if (isChild) { + templates.add(templatePath + File.separator + "java" + File.separator + "ListVO.java.vm"); + } + //界面模板 + VelocityContext context = new VelocityContext(); + context.put("context", object); + for (String template : templates) { + try { + // 渲染模板 + @Cleanup StringWriter sw = new StringWriter(); + Template tpl = Velocity.getTemplate(template, Constants.UTF_8); + tpl.merge(context, sw); + String dirNames = path + File.separator + "java" + File.separator + framePath + File.separator + "model" + File.separator + model.toLowerCase(); + String fileNames = getChildrenFileName(dirNames, template, className); + if (fileNames != null) { + File file = new File(XSSEscape.escapePath(fileNames)); + if (!file.exists()) { + File dirFile = new File(XSSEscape.escapePath(dirNames)); + if (!dirFile.exists()) { + dirFile.mkdirs(); + } + file.createNewFile(); + } + @Cleanup FileOutputStream fos = new FileOutputStream(file); + IOUtils.write(sw.toString(), fos, Constants.UTF_8); + IOUtils.closeQuietly(sw); + IOUtils.closeQuietly(fos); + } + } catch (IOException e) { + e.printStackTrace(); + System.out.println("渲染模板失败,表名:" + e); + } + } + } + //-------------------------代码---------------------------------- + + /** + * 生成子表 + * + * @param path + * @param fileName + * @param templatePath + * @param entity + * @param downloadCodeForm + * @param table + * @param userInfo + * @param linkEntity + * @throws SQLException + */ + private static void childTable(DataSourceUtil dataSourceUtil, String path, String fileName, String templatePath, VisualdevEntity entity, DownloadCodeForm downloadCodeForm, + String table, UserInfo userInfo, DbLinkEntity linkEntity) throws SQLException { + //自定义包名 + String modulePackageName = downloadCodeForm.getModulePackageName(); + Map columndata = new HashMap<>(16); + //tableJson + List tableModelList = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + //主表 + TableModel mainTable = tableModelList.stream().filter(t -> t.getTypeId().equals("1")).findFirst().orElse(null); + + //pc列表对象 + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(entity.getColumnData(), ColumnDataModel.class); + //app 列表对象 + ColumnDataModel appColumnDataModel = JsonUtil.getJsonToBean(entity.getAppColumnData(), ColumnDataModel.class); + + List searchList = JsonUtil.getJsonToList(columnDataModel.getSearchList(), FieLdsModel.class); + + //权限 + AuthorityModel authority = new AuthorityModel(); + BeanUtil.copyProperties(columnDataModel, authority); + + //取对应表的别名 + Map tableNameRenames = FunctionFormPublicUtil.tableNameRename(downloadCodeForm, tableModelList); + + //子表集合 + List childTableNameList = new ArrayList<>(); + //全部表 + List allTableNameList = new ArrayList<>(); + + //formTempJson + FormDataModel formData = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + List formAllModel = new ArrayList<>(); + RecursionForm recursionForm = new RecursionForm(); + recursionForm.setTableModelList(JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class)); + recursionForm.setList(list); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + //主表数据 + List mast = formAllModel.stream().filter(t -> FormEnum.mast.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + List tables = formAllModel.stream().filter(t -> FormEnum.table.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + //列表子表数据 + List mastTable = formAllModel.stream().filter(t -> FormEnum.mastTable.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + + String treeRelationField = columnDataModel.getTreeRelation().replaceAll("-", "_"); + for (TableModel tableModel : tableModelList) { + TableModel Model = new TableModel(); + Model.setInitName(tableModel.getTable()); + Model.setTable(tableNameRenames.get(tableModel.getTable())); + Model.setTableField(DataControlUtils.captureName(tableModel.getTableField())); + Model.setTypeId(tableModel.getTypeId()); + allTableNameList.add(Model); + if ("0".equals(tableModel.getTypeId())) { + childTableNameList.add(Model); + } + } + //子表(tableField,tableName) + Map childKeyTableNameMap = new HashMap<>(8); + tables.stream().forEach(t -> childKeyTableNameMap.put(t.getChildList().getTableModel(), t.getChildList().getTableName())); + //查询条件 + List jnpfkey = new ArrayList() {{ + add(JnpfKeyConsts.COM_INPUT); + add(JnpfKeyConsts.TEXTAREA); + }}; + List searchTypeModelList = new ArrayList<>(); + searchList.stream().forEach(fieLdsModel -> { + SearchTypeModel searchTypeModel = new SearchTypeModel(); + searchTypeModel.setJnpfKey(fieLdsModel.getConfig().getJnpfKey()); + Integer seachType = fieLdsModel.getSearchType(); + if (jnpfkey.contains(searchTypeModel.getJnpfKey()) && seachType.equals(3)) { + seachType = 2; + } + searchTypeModel.setSearchType(seachType); + String vModel = fieLdsModel.getVModel(); + vModel = vModel.replaceAll("-", "_"); + searchTypeModel.setVModel(vModel); + searchTypeModel.setLabel(fieLdsModel.getConfig().getLabel()); + searchTypeModel.setFormat(fieLdsModel.getFormat()); + searchTypeModel.setMultiple((String.valueOf(fieLdsModel.getSearchMultiple()))); + searchTypeModelList.add(searchTypeModel); + }); + TableModel mainTableModel = tableModelList.stream().filter(t -> t.getTypeId().equals("1")).findFirst().orElse(null); + if (columnDataModel.getType() == 2) { + SearchTypeModel searchTypeModel = new SearchTypeModel(); + searchTypeModel.setVModel(treeRelationField); + searchTypeModel.setSearchType(2); + if (columnDataModel.getTreeDataSource().equals("organize")) { + searchTypeModel.setJnpfKey(JnpfKeyConsts.COMSELECT); + searchTypeModel.setSearchType(1); + } + searchTypeModel.setLabel("tree"); + searchTypeModel.setTableName(mainTableModel.getTable()); + searchTypeModelList.add(searchTypeModel); + } + + List groupModels = new ArrayList<>(); + if (searchTypeModelList.size() > 0) { + //主表 + for (TableFields tableFields : mainTableModel.getFields()) { + searchTypeModelList.stream().forEach(searchTypeModel -> { + if (searchTypeModel.getVModel().equals(tableFields.getField())) { + searchTypeModel.setDataType(tableFields.getDataType()); + } + }); + } + //鉴别列表子表正则 + String reg = "^[jnpf_]\\S*_jnpf\\S*"; + searchTypeModelList.stream().filter(s -> s.getVModel().matches(reg)).forEach(cl -> { + String s = cl.getVModel(); + String s1 = s.substring(s.lastIndexOf("jnpf_")).replace("jnpf_", ""); + String s2 = s.substring(s.indexOf("_") + 1, s.lastIndexOf("_jnpf")); + cl.setAfterVModel(s1); + cl.setTableName(s2); + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equalsIgnoreCase(s2)).findFirst().orElse(null); + cl.setDataType(tableModel.getFields().stream().filter(t -> t.getField().equalsIgnoreCase(s1)).findFirst().orElse(null).getDataType()); + } + ); + //副表 + Map> collect = searchTypeModelList.stream().filter(s -> s.getVModel().matches(reg)).collect(Collectors.groupingBy(t -> t.getTableName())); + groupModels = collect.entrySet().stream().map(c -> { + ListSearchGroupModel groupModel = new ListSearchGroupModel(); + groupModel.setModelName(tableNameRenames.get(c.getKey())); + groupModel.setTableName(c.getKey()); + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equalsIgnoreCase(c.getKey())).findFirst().orElse(null); + groupModel.setForeignKey(tableModel.getTableField()); + groupModel.setMainKey(tableModel.getRelationField()); + groupModel.setSearchTypeModelList(c.getValue()); + return groupModel; + } + ).collect(Collectors.toList()); + + //子表 + Map> collect1 = searchTypeModelList.stream().filter(s -> s.getVModel().toLowerCase().contains(JnpfKeyConsts.CHILD_TABLE_PREFIX)) + .collect(Collectors.groupingBy(t -> t.getVModel().substring(0, t.getVModel().lastIndexOf("_")))); + List collect2 = collect1.entrySet().stream().map(c -> { + ListSearchGroupModel groupModel = new ListSearchGroupModel(); + String tableName = childKeyTableNameMap.get(c.getKey()); + groupModel.setModelName(tableNameRenames.get(tableName)); + groupModel.setTableName(tableName); + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equalsIgnoreCase(tableName)).findFirst().orElse(null); + groupModel.setForeignKey(tableModel.getTableField()); + groupModel.setMainKey(tableModel.getRelationField()); + List value = c.getValue(); + value.stream().forEach(v -> { + String vModel = v.getVModel(); + String substring = vModel.substring(vModel.lastIndexOf("_") + 1); + v.setAfterVModel(substring); + }); + groupModel.setSearchTypeModelList(value); + return groupModel; + } + ).collect(Collectors.toList()); + groupModels.addAll(collect2); + + ListSearchGroupModel groupModel = new ListSearchGroupModel(); + groupModel.setSearchTypeModelList(searchTypeModelList.stream().filter(s -> !s.getVModel().matches(reg) + && !s.getVModel().toLowerCase().contains(JnpfKeyConsts.CHILD_TABLE_PREFIX)).collect(Collectors.toList())); + groupModel.setTableName(mainTable.getTable()); + groupModel.setModelName(tableNameRenames.get(mainTable.getTable())); + groupModels.add(groupModel); + } + + //=======app + //查询条件 + List searchAppList = JsonUtil.getJsonToList(appColumnDataModel.getSearchList(), FieLdsModel.class); + List searchTypeAppModelList = new ArrayList<>(); + searchAppList.stream().forEach(fieLdsModel -> { + SearchTypeModel searchTypeModel = new SearchTypeModel(); + searchTypeModel.setJnpfKey(fieLdsModel.getConfig().getJnpfKey()); + Integer seachType = fieLdsModel.getSearchType(); + if (jnpfkey.contains(searchTypeModel.getJnpfKey()) && seachType.equals(3)) { + seachType = 2; + } + searchTypeModel.setSearchType(seachType); + String vModel = fieLdsModel.getVModel(); + vModel = vModel.replaceAll("-", "_"); + searchTypeModel.setVModel(vModel); + searchTypeModel.setLabel(fieLdsModel.getConfig().getLabel()); + searchTypeModel.setFormat(fieLdsModel.getFormat()); + searchTypeModel.setMultiple((String.valueOf(fieLdsModel.getSearchMultiple()))); + searchTypeAppModelList.add(searchTypeModel); + }); + + + List groupAppModels = new ArrayList<>(); + if (searchTypeAppModelList.size() > 0) { + //主表 + for (TableFields tableFields : mainTableModel.getFields()) { + searchTypeAppModelList.stream().forEach(searchTypeModel -> { + if (searchTypeModel.getVModel().equals(tableFields.getField())) { + searchTypeModel.setDataType(tableFields.getDataType()); + } + }); + } + //鉴别列表子表正则 + String reg = "^[jnpf_]\\S*_jnpf\\S*"; + searchTypeAppModelList.stream().filter(s -> s.getVModel().matches(reg)).forEach(cl -> { + String s = cl.getVModel(); + String s1 = s.substring(s.lastIndexOf("jnpf_")).replace("jnpf_", ""); + String s2 = s.substring(s.indexOf("_") + 1, s.lastIndexOf("_jnpf")); + cl.setAfterVModel(s1); + cl.setTableName(s2); + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equalsIgnoreCase(s2)).findFirst().orElse(null); + cl.setDataType(tableModel.getFields().stream().filter(t -> t.getField().equalsIgnoreCase(s1)).findFirst().orElse(null).getDataType()); + } + ); + //副表 + Map> collect = searchTypeAppModelList.stream().filter(s -> + s.getVModel().matches(reg)).collect(Collectors.groupingBy(t -> t.getTableName())); + groupAppModels = collect.entrySet().stream().map(c -> { + ListSearchGroupModel groupModel = new ListSearchGroupModel(); + groupModel.setModelName(tableNameRenames.get(c.getKey())); + groupModel.setTableName(c.getKey()); + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equalsIgnoreCase(c.getKey())).findFirst().orElse(null); + groupModel.setForeignKey(tableModel.getTableField()); + groupModel.setMainKey(tableModel.getRelationField()); + groupModel.setSearchTypeModelList(c.getValue()); + return groupModel; + } + ).collect(Collectors.toList()); + + //子表 + Map> collect1 = searchTypeAppModelList.stream().filter(s -> s.getVModel().toLowerCase().contains(JnpfKeyConsts.CHILD_TABLE_PREFIX)) + .collect(Collectors.groupingBy(t -> t.getVModel().substring(0, t.getVModel().lastIndexOf("_")))); + List collect2 = collect1.entrySet().stream().map(c -> { + ListSearchGroupModel groupModel = new ListSearchGroupModel(); + String tableName = childKeyTableNameMap.get(c.getKey()); + groupModel.setModelName(tableNameRenames.get(tableName)); + groupModel.setTableName(tableName); + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equalsIgnoreCase(tableName)).findFirst().orElse(null); + groupModel.setForeignKey(tableModel.getTableField()); + groupModel.setMainKey(tableModel.getRelationField()); + List value = c.getValue(); + value.stream().forEach(v -> { + String vModel = v.getVModel(); + String substring = vModel.substring(vModel.lastIndexOf("_") + 1); + v.setAfterVModel(substring); + }); + groupModel.setSearchTypeModelList(value); + return groupModel; + } + ).collect(Collectors.toList()); + groupAppModels.addAll(collect2); + + ListSearchGroupModel groupModel = new ListSearchGroupModel(); + groupModel.setSearchTypeModelList(searchTypeAppModelList.stream().filter(s -> !s.getVModel().matches(reg) + && !s.getVModel().toLowerCase().contains(JnpfKeyConsts.CHILD_TABLE_PREFIX)).collect(Collectors.toList())); + groupModel.setTableName(mainTable.getTable()); + groupModel.setModelName(tableNameRenames.get(mainTable.getTable())); + groupAppModels.add(groupModel); + } + //===============================end + Template7Model model = new Template7Model(); + model.setClassName(DataControlUtils.captureName(tableNameRenames.get(table))); + model.setServiceDirectory(FormCommonUtil.getPath(FileTypeConstant.CODETEMP)); + model.setCreateDate(DateUtil.daFormat(new Date())); + model.setCreateUser(GenBaseInfo.AUTHOR); + model.setCopyright(GenBaseInfo.COPYRIGHT); + model.setDescription(downloadCodeForm.getDescription()); + + + //后台 + if (columnDataModel.getType() == 5) { + columnDataModel.setHasPage(false); + } + columndata.put("module", downloadCodeForm.getModule()); + columndata.put("genInfo", model); + columndata.put("modelName", model.getClassName()); + columndata.put("typeId", 1); + columndata.put("searchList", searchList); + columndata.put("hasPage", columnDataModel.getHasPage()); + columndata.put("defaultSidx", columnDataModel.getDefaultSidx()); + columndata.put("sort", columnDataModel.getSort()); + columndata.put("searchTypeModelList", searchTypeModelList); + columndata.put("mast", mast); + columndata.put("childtable", table); + columndata.put("authority", authority); + //app pc 数据权限是否开启 + columndata.put("pcDataPermisson", columnDataModel.getUseDataPermission()); + columndata.put("appDataPermisson", appColumnDataModel.getUseDataPermission()); + columndata.put("groupModels", groupModels); + columndata.put("groupAppModels", groupAppModels); + columndata.put("childTableNameList", childTableNameList); + columndata.put("allTableNameList", allTableNameList); + columndata.put("superQuery", columnDataModel.getHasSuperQuery()); + TableModel maina = tableModelList.stream().filter(t -> t.getTypeId().equals("1")).findFirst().orElse(null); + String className = DataControlUtils.captureName(tableNameRenames.get(maina.getTable())); + columndata.put("mainModelName", className); + columndata.put("isCloud", FormCommonUtil.IS_CLOUD); + //数据源 + if (ObjectUtil.isNotEmpty(linkEntity)) { + columndata.put("DS", linkEntity.getFullName()); + } + columndata.put("genInfo", model); + CustomGenerator mpg = new CustomGenerator(columndata); + // 全局配置 + GlobalConfig gc = new GlobalConfig(); + gc.setFileOverride(true); + // 不需要ActiveRecord特性的请改为false + gc.setActiveRecord(false); + // XML 二级缓存 + gc.setEnableCache(false); + // XML ResultMap + gc.setBaseResultMap(false); + // XML columList + gc.setBaseColumnList(false); + gc.setAuthor(model.getCreateUser()); + gc.setOpen(false); + + // 自定义文件命名,注意 %s 会自动填充表实体属性! + gc.setEntityName(model.getClassName() + GenFileNameSuffix.ENTITY); + gc.setMapperName(model.getClassName() + GenFileNameSuffix.MAPPER); + gc.setXmlName(model.getClassName() + GenFileNameSuffix.MAPPER_XML); + gc.setServiceName(model.getClassName() + GenFileNameSuffix.SERVICE); + gc.setServiceImplName(model.getClassName() + GenFileNameSuffix.SERVICEIMPL); + mpg.setGlobalConfig(gc); + + // 数据源配置 + DataSourceConfig dsc = SourceUtil.dbConfig(TenantDataSourceUtil.getTenantSchema(), linkEntity); + mpg.setDataSource(dsc); + //数据库类型 + columndata.put("dbType", dsc.getDbType().getDb()); + + // 策略配置 + StrategyConfig strategy = new StrategyConfig(); + strategy.setEntityLombokModel(true); + // 表名生成策略 + strategy.setNaming(NamingStrategy.underline_to_camel); + // 需要生成的表 + strategy.setInclude(table); + strategy.setRestControllerStyle(true); + mpg.setStrategy(strategy); + + // 包配置 + PackageConfig pc = new PackageConfig(); + pc.setParent(modulePackageName); + mpg.setPackageInfo(pc); + //包名 + columndata.put("modulePackageName", modulePackageName); + // 自定义配置 + InjectionConfig cfg = new InjectionConfig() { + @Override + public void initMap() { + // to do nothing + } + }; + List focList = new ArrayList<>(); + String javaPath = FormCommonUtil.getLocalBasePath() + model.getServiceDirectory(); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "Entity.java.vm", "entity", false)); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "Mapper.java.vm", "mapper", false)); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "Mapper.xml.vm", "xml", false)); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "Service.java.vm", "service", false)); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "ServiceImpl.java.vm", "impl", false)); + + cfg.setFileOutConfigList(focList); + mpg.setTemplate(new TemplateConfig().setXml(null).setMapper(null).setController(null).setEntity(null).setService(null).setServiceImpl(null)); + mpg.setCfg(cfg); + // 执行生成 + mpg.execute(path); + } + + /** + * 界面模板 + * + * @param fileName 文件夹名称 + * @param downloadCodeForm 文件名称 + * @param model 模型 + * @param templatePath 模板路径 + * @param userInfo 用户 + */ + @Override + public void htmlTemplates(String fileName, VisualdevEntity entity, DownloadCodeForm downloadCodeForm, FormDataModel model, String templatePath, + UserInfo userInfo, ConfigValueUtil configValueUtil, String pKeyName) throws Exception { + //自定义包名 + String modulePackageName = downloadCodeForm.getModulePackageName(); + Map map = new HashMap<>(16); + //formTempJson + FormDataModel formData = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(entity.getColumnData(), ColumnDataModel.class); + List columnList = JsonUtil.getJsonToList(columnDataModel.getColumnList(), ColumnListField.class); + List formAllModel = new ArrayList<>(); + RecursionForm recursionForm = new RecursionForm(); + recursionForm.setTableModelList(JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class)); + recursionForm.setList(list); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + + List tableModelFields = new ArrayList<>(); + FunctionFormPublicUtil.getTableModels(list, tableModelFields); + + //form的属性 + List mast = formAllModel.stream().filter(t -> FormEnum.mast.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + List table = formAllModel.stream().filter(t -> FormEnum.table.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + List mastTable = formAllModel.stream().filter(t -> FormEnum.mastTable.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + map.put("ableAll", JsonUtil.getListToJsonArray(formAllModel)); + //columnTempJson + Map columnDataMap = JsonUtil.stringToMap(entity.getColumnData()); + + List tablesList = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + //主表 + TableModel mainTableModel = tablesList.stream().filter(t -> t.getTypeId().equals("1")).findFirst().orElse(null); + //列表字段 + List columnListModelList = JsonUtil.getJsonToList(columnDataModel.getColumnList(), ColumnListModel.class); + List notChildColList = columnListModelList.stream().filter(copy -> !copy.getVModel().toLowerCase().startsWith(JnpfKeyConsts.CHILD_TABLE_PREFIX)).collect(Collectors.toList()); + + //按钮 + List btnDataList = JsonUtil.getJsonToList(columnDataModel.getBtnsList(), BtnData.class); + boolean hasUploadBtn = btnDataList.stream().anyMatch(btn -> btn.getValue().equals("upload")); + + //列表子表折叠 + List cldColModelList = new ArrayList<>(); + + List tablekeys = table.stream().map(t -> t.getChildList().getTableModel()).collect(Collectors.toList()); + Map keyNum = new HashMap<>(); + for (String key : tablekeys) { + ColumnListModel columnListModel = columnListModelList.stream().filter(c -> c.getProp().startsWith(key)).findFirst().orElse(null); + int i = columnListModelList.indexOf(columnListModel); + keyNum.put(key, i); + } + + Map> childFiledLists = columnListModelList.stream().filter(c -> c.getProp().toLowerCase() + .contains(JnpfKeyConsts.CHILD_TABLE_PREFIX)).collect(Collectors.groupingBy(t -> t.getProp().substring(0, t.getProp().indexOf("-")))); + List childModels = new ArrayList<>(); + Iterator>> colentries = childFiledLists.entrySet().iterator(); + while (colentries.hasNext()) { + Map.Entry> next = colentries.next(); + ColumnListModel listModel = new ColumnListModel(); + ColumnChildListModel mod = new ColumnChildListModel(); + mod.setTableField(next.getKey()); + List value = next.getValue(); + value.get(0).setFirst(true); + String label = value.get(0).getLabel(); + String substring = label.substring(0, label.indexOf("-")); + mod.setLabel(substring); + value.stream().forEach(v -> { + String prop = v.getProp(); + String valueLabel = v.getLabel(); + String propSub = prop.substring(prop.indexOf("-") + 1); + String labelSub = valueLabel.substring(valueLabel.indexOf("-") + 1); + v.setLabel(labelSub); + v.setProp(propSub); + }); + mod.setFields(value); + listModel.setProp(next.getKey()); + listModel.setColumnChildListModel(mod); + listModel.setJnpfKey(JnpfKeyConsts.CHILD_TABLE); + childModels.add(mod); + int i = keyNum.get(next.getKey()); + columnListModelList.set(i, listModel); + cldColModelList.add(listModel); + } + + columnListModelList = columnListModelList.stream().filter(c -> { + boolean b = true; + if (c.getVModel() != null && c.getVModel().toLowerCase().contains(JnpfKeyConsts.CHILD_TABLE_PREFIX)) { + if (!c.getJnpfKey().equals(JnpfKeyConsts.CHILD_TABLE)) { + b = false; + } + } + return b; + }).collect(Collectors.toList()); + + //取对应表的别名 + Map tableNameRenames = FunctionFormPublicUtil.tableNameRename(downloadCodeForm, tablesList); + + List allColumnFiledModelList = new ArrayList<>(); + allColumnFiledModelList.addAll(mast.stream().map(ma -> ma.getFormColumnModel().getFieLdsModel()).collect(Collectors.toList())); + allColumnFiledModelList.addAll(mastTable.stream().map(mt -> mt.getFormMastTableModel().getMastTable().getFieLdsModel()).collect(Collectors.toList())); + for (FormAllModel allModel : table) { + List childList = allModel.getChildList().getChildList(); + for (FormColumnModel formColumnModel : childList) { + allColumnFiledModelList.add(formColumnModel.getFieLdsModel()); + } + } + columnListModelList.stream().forEach(c -> { + String prop = c.getProp(); + FieLdsModel fieLdsModel = allColumnFiledModelList.stream().filter(f -> prop.equals(f.getVModel())).findFirst().orElse(null); + if (fieLdsModel != null) { + c.setDataType(fieLdsModel.getConfig().getDataType()); + c.setVModel(fieLdsModel.getVModel()); + c.setMultiple(c.getMultiple() != null ? c.getMultiple() : fieLdsModel.getMultiple()); + if(StringUtil.isNotEmpty(c.getRelationField()) && c.getRelationField().contains("_jnpfTable_")){ + FormAllModel formAllModel1 = mast.stream().filter(t -> t.getFormColumnModel().getFieLdsModel().getVModel() + .equals(c.getProp())).findFirst().orElse(null); + if(formAllModel1!=null){ + c.setRelationField(formAllModel1.getFormColumnModel().getFieLdsModel().getRelationField()); + } + FormAllModel formAllModel2 = mastTable.stream().filter(t -> t.getFormMastTableModel().getVModel() + .equals(c.getProp())).findFirst().orElse(null); + if(formAllModel2!=null){ + c.setRelationField(formAllModel2.getFormMastTableModel().getMastTable().getFieLdsModel().getRelationField()); + } + } + //数字组件新增属性 + c.setAddonBefore(fieLdsModel.getAddonBefore()); + c.setAddonAfter(fieLdsModel.getAddonAfter()); + c.setIsAmountChinese(fieLdsModel.getIsAmountChinese()); + c.setThousands(fieLdsModel.isThousands()); + c.setControls(fieLdsModel.getControls()); + //时间控件添加字段 + c.setStartTime(fieLdsModel.getStartTime()); + c.setEndTime(fieLdsModel.getEndTime()); + c.setStartRelationField(fieLdsModel.getConfig().getStartRelationField()); + c.setEndRelationField(fieLdsModel.getConfig().getEndRelationField()); + + if (fieLdsModel.getSelectType() != null) { + c.setSelectType(fieLdsModel.getSelectType()); + c.setAbleIds(fieLdsModel.getAbleIds()); + c.setAbleDepIds(fieLdsModel.getAbleDepIds()); + c.setAbleGroupIds(fieLdsModel.getAbleGroupIds()); + c.setAblePosIds(fieLdsModel.getAblePosIds()); + c.setAbleRoleIds(fieLdsModel.getAbleRoleIds()); + c.setAbleUserIds(fieLdsModel.getAbleUserIds()); + } + } + }); + + //列表中区别子表正则 + String reg = "^[jnpf_]\\S*_jnpf\\S*"; + columnListModelList.stream().filter(c -> c.getProp().matches(reg)).forEach( + cl -> { + String s = cl.getProp(); + String s1 = s.substring(s.lastIndexOf("jnpf_")).replace("jnpf_", ""); + String s2 = s.substring(s.indexOf("_") + 1, s.lastIndexOf("_jnpf")); + cl.setNewProp(s2.toLowerCase() + "." + s1); + cl.setColumnTableName(s2); + } + ); + + List searchList = JsonUtil.getJsonToList(columnDataMap.get("searchList"), FieLdsModel.class); + + for (FieLdsModel fieLdsModel : searchList) { + String vModel = fieLdsModel.getVModel(); + if (vModel.contains("-")) { + vModel = vModel.replaceAll("-", "_"); + } + fieLdsModel.setVModel(vModel); + } + + //查询条件 + Map searchAll = new HashMap<>(); + List searchTypeModelList = new ArrayList<>(); + List jnpfkey = new ArrayList() {{ + add(JnpfKeyConsts.COM_INPUT); + add(JnpfKeyConsts.TEXTAREA); + }}; + searchList.stream().forEach(fieLdsModel -> { + SearchTypeModel searchTypeModel = new SearchTypeModel(); + searchTypeModel.setJnpfKey(fieLdsModel.getConfig().getJnpfKey()); + Integer seachType = fieLdsModel.getSearchType(); + if (jnpfkey.contains(searchTypeModel.getJnpfKey()) && seachType.equals(3)) { + seachType = 2; + } + searchTypeModel.setSearchType(seachType); + searchTypeModel.setVModel(fieLdsModel.getVModel()); + searchTypeModel.setLabel(fieLdsModel.getConfig().getLabel()); + searchTypeModel.setFormat(fieLdsModel.getFormat()); + String placeholder = fieLdsModel.getSearchType().equals(3) ? fieLdsModel.getPlaceholder() + : DataControlUtils.getPlaceholder(fieLdsModel.getConfig().getJnpfKey()); + if (searchTypeModel.getSearchType().equals(3)) { + searchAll.put(searchTypeModel.getVModel(), searchTypeModel.getLabel()); + } + searchTypeModel.setPlaceholder(placeholder); + searchTypeModel.setConfig(fieLdsModel.getConfig()); + searchTypeModel.setShowLevel(fieLdsModel.getShowLevel()); + searchTypeModel.setMultiple(String.valueOf(fieLdsModel.getSearchMultiple())); + searchTypeModelList.add(searchTypeModel); + }); + + if (searchTypeModelList.size() > 0) { + for (TableFields tableFields : mainTableModel.getFields()) { + searchTypeModelList.stream().forEach(searchTypeModel -> { + if (searchTypeModel.getVModel().equals(tableFields.getField())) { + searchTypeModel.setDataType(tableFields.getDataType()); + } + }); + } + } + //--------------------------------------add state--------------------------------------------- + Map columnAppDataMap = JsonUtil.stringToMap(entity.getAppColumnData()); + List searchAppList = JsonUtil.getJsonToList(columnAppDataMap.get("searchList"), FieLdsModel.class); + for (FieLdsModel fieLdsModel : searchAppList) { + String vModel = fieLdsModel.getVModel(); + if (vModel.contains("-")) { + vModel = vModel.replaceAll("-", "_"); + } + fieLdsModel.setVModel(vModel); + } + List searchTypeAppModelList = new ArrayList<>(); + searchAppList.stream().forEach(fieLdsModel -> { + SearchTypeModel searchTypeModel = new SearchTypeModel(); + searchTypeModel.setJnpfKey(fieLdsModel.getConfig().getJnpfKey()); + Integer seachType = fieLdsModel.getSearchType(); + if (jnpfkey.contains(searchTypeModel.getJnpfKey()) && seachType.equals(3)) { + seachType = 2; + } + searchTypeModel.setSearchType(seachType); + searchTypeModel.setVModel(fieLdsModel.getVModel()); + searchTypeModel.setLabel(fieLdsModel.getConfig().getLabel()); + searchTypeModel.setFormat(fieLdsModel.getFormat()); + String placeholder = fieLdsModel.getSearchType().equals(3) ? fieLdsModel.getPlaceholder() : DataControlUtils.getPlaceholder(fieLdsModel.getConfig().getJnpfKey()); + if (searchTypeModel.getSearchType().equals(3)) { + searchAll.put(searchTypeModel.getVModel(), searchTypeModel.getLabel()); + } + searchTypeModel.setPlaceholder(placeholder); + searchTypeModel.setConfig(fieLdsModel.getConfig()); + searchTypeModel.setShowLevel(fieLdsModel.getShowLevel()); + searchTypeModel.setMultiple(String.valueOf(fieLdsModel.getSearchMultiple())); + searchTypeAppModelList.add(searchTypeModel); + }); + + if (searchTypeAppModelList.size() > 0) { + for (TableFields tableFields : mainTableModel.getFields()) { + searchTypeAppModelList.stream().forEach(searchTypeModel -> { + if (searchTypeModel.getVModel().equals(tableFields.getField())) { + searchTypeModel.setDataType(tableFields.getDataType()); + } + }); + } + } + + List searchListAll = new ArrayList<>(); + List modelAll = new ArrayList<>(); + for (SearchTypeModel searchTypeModel : searchTypeModelList) { + if (searchAll.get(searchTypeModel.getVModel()) == null && !modelAll.contains(searchTypeModel.getVModel())) { + searchListAll.add(searchTypeModel); + modelAll.add(searchTypeModel.getVModel()); + } + } + for (SearchTypeModel searchTypeModel : searchTypeAppModelList) { + if (searchAll.get(searchTypeModel.getVModel()) == null && !modelAll.contains(searchTypeModel.getVModel())) { + searchListAll.add(searchTypeModel); + modelAll.add(searchTypeModel.getVModel()); + } + } + for (String key : searchAll.keySet()) { + SearchTypeModel typeModel = new SearchTypeModel(); + typeModel.setVModel(key); + typeModel.setSearchType(3); + typeModel.setLabel(searchAll.get(key)); + searchListAll.add(typeModel); + } + + String treeRelationField = columnDataModel.getTreeRelation().replaceAll("-", "_"); + //--------------------------------------add end--------------------------------------------- + + //--------------------------------------导入---------------------------------------------------- + List allUploadTemplates = new ArrayList<>(); + UploaderTemplateModel uploaderTemplateModel = JsonUtil.getJsonToBean(columnDataModel.getUploaderTemplateJson(), UploaderTemplateModel.class); + if (hasUploadBtn && ObjectUtil.isNotNull(uploaderTemplateModel) && uploaderTemplateModel.getSelectKey() != null) { + List cols = new ArrayList<>(); + for (String upload : uploaderTemplateModel.getSelectKey()) { + ColumnChildListModel columnChildListModel = new ColumnChildListModel(); + String tableField; + String vModel; + ColumnListField field = columnList.stream().filter(c -> c.getProp().equals(upload)).findFirst().orElse(new ColumnListField()); + String label = field.getConfig() != null ? field.getConfig().getLabel() : ""; + if (upload.toLowerCase().startsWith(JnpfKeyConsts.CHILD_TABLE_PREFIX)) { + tableField = upload.substring(0, upload.indexOf("-")); + vModel = upload.substring(upload.indexOf("-") + 1); + } else if (upload.toLowerCase().startsWith("jnpf_")) { + FormAllModel thisTableModel = mastTable.stream().filter(mb -> upload.equals(mb.getFormMastTableModel().getVModel())).findFirst().orElse(null); + FieLdsModel masF = thisTableModel != null ? thisTableModel.getFormMastTableModel().getMastTable().getFieLdsModel() : new FieLdsModel(); + if (masF.getConfig().getRegList() != null) { + String o1 = JSONObject.toJSONString(JsonUtil.getObjectToString(masF.getConfig().getRegList())); + masF.getConfig().setReg(o1); + } + masF.setTableType(1); + masF.setBeforeVmodel(upload); + FieLdsModel masFNiuNiu = new FieLdsModel(); + BeanUtil.copyProperties(masF, masFNiuNiu); + masFNiuNiu = DataControlUtils.setAbleIDs(masFNiuNiu); + allUploadTemplates.add(masFNiuNiu); + tableField = ""; + vModel = upload; + } else { + tableField = ""; + vModel = upload; + List mastField = mast.stream().map(m -> m.getFormColumnModel().getFieLdsModel()).collect(Collectors.toList()); + FieLdsModel mastF = mastField.stream().filter(mas -> mas.getVModel().equals(upload)).findFirst().orElse(new FieLdsModel()); + if (mastF.getConfig().getRegList() != null) { + String o1 = JSONObject.toJSONString(JsonUtil.getObjectToString(mastF.getConfig().getRegList())); + mastF.getConfig().setReg(o1); + } + mastF.setTableType(0); + FieLdsModel masFNiuNiu = new FieLdsModel(); + BeanUtil.copyProperties(mastF, masFNiuNiu); + masFNiuNiu = DataControlUtils.setAbleIDs(masFNiuNiu); + allUploadTemplates.add(masFNiuNiu); + } + columnChildListModel.setTableField(tableField); + columnChildListModel.setLabel(label); + columnChildListModel.setVModel(vModel); + cols.add(columnChildListModel); + } + Map> improtCollect = cols.stream().filter(col -> + StringUtil.isNotEmpty(col.getTableField())).collect(Collectors.groupingBy(ColumnChildListModel::getTableField)); + for (Map.Entry> m : improtCollect.entrySet()) { + String tableFiled = m.getKey(); + FieLdsModel fieLdsModel = tableModelFields.stream().filter(t -> t.getVModel().equals(tableFiled)).findFirst().orElse(null); + List children = fieLdsModel.getConfig().getChildren(); + List chlidFields = new ArrayList<>(); + String tableName1 = fieLdsModel.getConfig().getTableName(); + fieLdsModel.getConfig().setAliasClassName(tableNameRenames.get(tableName1)); + for (ColumnChildListModel columnChildListModel : m.getValue()) { + FieLdsModel fieLdsModel2 = children.stream().filter(ch -> ch.getVModel().equals(columnChildListModel.getVModel())).findFirst().orElse(null); + chlidFields.add(fieLdsModel2); + } + fieLdsModel.getConfig().setChildren(chlidFields); + fieLdsModel.setChildrenSize(chlidFields.size()); + fieLdsModel.setTableType(2); + allUploadTemplates.add(fieLdsModel); + } + } + //----------------------------------------------------------------导入 end + if (columnDataModel.getType() == 2) { + SearchTypeModel searchTypeModel = searchTypeModelList.stream().filter(t -> t.getVModel().equals(treeRelationField)).findFirst().orElse(null); + if (searchTypeModel == null) { + searchTypeModel = new SearchTypeModel(); + searchTypeModel.setVModel(treeRelationField); + searchTypeModel.setSearchType(2); + if (columnDataModel.getTreeDataSource().equals("organize")) { + searchTypeModel.setJnpfKey(JnpfKeyConsts.COMSELECT); + searchTypeModel.setSearchType(1); + } + searchTypeModel.setLabel("tree"); + searchTypeModel.setTableName(mainTableModel.getTable()); + searchTypeModelList.add(searchTypeModel); + } + } + + //表单子表模型 + List formChildList = new ArrayList<>(); + + //form和model + Template7Model temModel = new Template7Model(); + temModel.setServiceDirectory(FormCommonUtil.getPath(FileTypeConstant.CODETEMP)); + temModel.setCreateDate(DateUtil.daFormat(new Date())); + temModel.setCreateUser(GenBaseInfo.AUTHOR); + temModel.setCopyright(GenBaseInfo.COPYRIGHT); + temModel.setClassName(DataControlUtils.captureName(downloadCodeForm.getClassName())); + temModel.setDescription(""); + map.put("genInfo", temModel); + map.put("modelName", model.getClassName()); + map.put("package", modulePackageName); + + //子表赋值 + List> child = new ArrayList<>(); + for (int i = 0; i < table.size(); i++) { + FormColumnTableModel childList = table.get(i).getChildList(); + List tableList = childList.getChildList(); + String sClassName = tableNameRenames.get(childList.getTableName()); + List thousandsField=new ArrayList<>(); + for (FormColumnModel columnModel : tableList) { + FieLdsModel fieLdsModel = columnModel.getFieLdsModel(); + List templateJsonAll = new ArrayList<>(); + templateJsonAll.addAll(fieLdsModel.getConfig().getTemplateJson()); + List templateJsonModelList = JsonUtil.getJsonToList(fieLdsModel.getTemplateJson(), TemplateJsonModel.class); + templateJsonAll.addAll(templateJsonModelList); + for (TemplateJsonModel templateJsonModel : templateJsonAll) { + if (StringUtil.isNotEmpty(templateJsonModel.getRelationField())) { + String[] fieldList = templateJsonModel.getRelationField().split("-"); + if (fieldList.length > 1) { + templateJsonModel.setRelationField(sClassName.toLowerCase() + "-" + fieldList[1]); + } + } + } + for (TemplateJsonModel templateJsonModel : templateJsonModelList) { + if (StringUtil.isNotEmpty(templateJsonModel.getRelationField())) { + String[] fieldList = templateJsonModel.getRelationField().split("-"); + if (fieldList.length > 1) { + templateJsonModel.setRelationField(sClassName.toLowerCase() + "List-" + fieldList[1]); + } + } + } + fieLdsModel.setTemplateJson(JsonUtil.getObjectToString(templateJsonModelList)); + fieLdsModel.getConfig().setTemplateJson(templateJsonAll); + } + childList.setChildList(tableList); + childList.setThousandsField(thousandsField); + Map childs = JsonUtil.entityToMap(childList); + String className = DataControlUtils.captureName(sClassName); + childs.put("className", className); + child.add(childs); + } + //主表赋值 + for (int i = 0; i < mast.size(); i++) { + FieLdsModel fieLdsModel = mast.get(i).getFormColumnModel().getFieLdsModel(); + ConfigModel configModel = fieLdsModel.getConfig(); + + if (configModel.getDefaultValue() instanceof String) { + configModel.setValueType("String"); + } + if (configModel.getDefaultValue() == null) { + configModel.setValueType("undefined"); + } + fieLdsModel.setConfig(configModel); + + List templateJson = fieLdsModel.getConfig().getTemplateJson(); + String json = templateJson.size() > 0 ? JsonUtil.getObjectToString(templateJson):fieLdsModel.getTemplateJson(); + fieLdsModel.setTemplateJson(json); + } + + //列表子表数据model + Map> groupColumnDataMap = mastTable.stream().collect(Collectors.groupingBy(m -> m.getFormMastTableModel().getTable())); + Iterator>> entries = groupColumnDataMap.entrySet().iterator(); + while (entries.hasNext()) { + Map.Entry> formEntries = entries.next(); + Map objectMap = new HashMap<>(); + String className = DataControlUtils.captureName(tableNameRenames.get(formEntries.getKey())); + ColumnListDataModel columnListDataModel = new ColumnListDataModel(); + columnListDataModel.setModelName(className); + columnListDataModel.setModelUpName(DataControlUtils.captureName(className)); + columnListDataModel.setModelLowName(DataControlUtils.initialLowercase(className)); + List allModels = formEntries.getValue(); + allModels.stream().forEach(m -> { + String vModel = m.getFormMastTableModel().getField(); + m.getFormMastTableModel().getMastTable().getFieLdsModel().setVModel(vModel); + }); + List fields = allModels.stream().map(m -> + m.getFormMastTableModel().getField()).collect(Collectors.toList()); + columnListDataModel.setFieldList(fields); + columnListDataModel.setFieLdsModelList(allModels.stream().map(al -> al.getFormMastTableModel()).collect(Collectors.toList())); + columnListDataModel.setTableName(formEntries.getKey()); + formChildList.add(columnListDataModel); + List children = formEntries.getValue().stream().map(allModel -> allModel.getFormMastTableModel().getMastTable()).collect(Collectors.toList()); + //表字段给的范围-转换json + children.forEach(item -> { + item.setFieLdsModel(DataControlUtils.setAbleIDs(item.getFieLdsModel())); + }); + FormColumnTableModel formColumnTableModel = new FormColumnTableModel(); + formColumnTableModel.setChildList(children); + objectMap.put("children", formColumnTableModel); + objectMap.put("genInfo", temModel); + objectMap.put("package", modulePackageName); + objectMap.put("module", model.getAreasName()); + objectMap.put("className", className); + childrenTemplates(FormCommonUtil.getLocalBasePath() + model.getServiceDirectory() + fileName, objectMap, templatePath, className, downloadCodeForm, true); + } + + //子表model + for (int i = 0; i < table.size(); i++) { + FormColumnTableModel childList = table.get(i).getChildList(); + Map objectMap = JsonUtil.entityToMap(childList); + String className = DataControlUtils.captureName(tableNameRenames.get(childList.getTableName())); + //开启导入 + if (allUploadTemplates.size() > 0) { + FieLdsModel fieLdsModel = allUploadTemplates.stream().filter(f -> f.getVModel().equals(childList.getTableModel())).findFirst().orElse(null); + if (fieLdsModel != null) { + List children = fieLdsModel.getConfig().getChildren(); + for (FormColumnModel columnModel : childList.getChildList()) { + String vModel = columnModel.getFieLdsModel().getVModel(); + if (columnModel.getFieLdsModel().getConfig().getRegList() != null) { + String o1 = JSONObject.toJSONString(JsonUtil.getObjectToString(columnModel.getFieLdsModel().getConfig().getRegList())); + columnModel.getFieLdsModel().getConfig().setReg(o1); + } + boolean b = children.stream().anyMatch(c -> c.getVModel().equals(vModel)); + if (b) { + columnModel.getFieLdsModel().setNeedImport(true); + } + } + } + } + //表字段给的范围-转换json + childList.getChildList().forEach(item -> { + item.setFieLdsModel(DataControlUtils.setAbleIDs(item.getFieLdsModel())); + }); + objectMap.put("children", childList); + objectMap.put("genInfo", temModel); + objectMap.put("package", modulePackageName); + objectMap.put("module", model.getAreasName()); + objectMap.put("className", className); + childrenTemplates(FormCommonUtil.getLocalBasePath() + model.getServiceDirectory() + fileName, objectMap, templatePath, className, downloadCodeForm, false); + } + + //界面 + //是否开启行内编辑columnDataListFiled + map.put("lineEdit", columnDataModel.getType() == 4); + //是否开启分组表格 + if (columnDataModel.getType() == 3) { + ColumnListModel columnListModel = columnListModelList.get(0); + columnListModel.setFirst(true); + columnListModelList.set(0, columnListModel); + } + + //判断列表是否存在冻结 + boolean none = columnListModelList.stream().anyMatch(c -> "left".equals(c.getFixed()) || "right".equals(c.getFixed())); + map.put("hasFixed", none); + map.put("importFields", allUploadTemplates); + Set set = new HashSet<>(); + List nameAgain = new ArrayList<>(); + for (FieLdsModel f : allUploadTemplates) { + if (!set.add(f.getConfig().getLabel())) { + if (f.getTableType() == 1) { + nameAgain.add(f.getVModel()); + } else { + nameAgain.add(f.getBeforeVmodel()); + } + } + } + map.put("nameAgain", nameAgain); + if (uploaderTemplateModel != null) { + map.put("importIsUpdate", "2".equals(uploaderTemplateModel.getDataType())); + } + map.put("groupTable", columnDataModel.getType() == 3); + //树形同步异步 + if (columnDataModel.getType() == 5) { + columnDataModel.setHasPage(false); + columnDataMap.replace("hasPage", false); + } + map.put("treeTable", columnDataModel.getType() == 5); + map.put("treeLazyType", true); + map.put("parentField", columnDataModel.getParentField()); + map.put("subField", columnDataModel.getSubField()); + //合计 + boolean configurationTotal = columnDataModel.isShowSummary(); + if (columnDataModel.getType() == 3 || columnDataModel.getType() == 5) { + configurationTotal = false; + } + map.put("configurationTotal", configurationTotal); + List summaryList = FormCommonUtil.getSummaryList(columnDataModel.getSummaryField(), columnDataModel.getType()); + map.put("fieldsTotal", JsonUtil.getObjectToString(summaryList)); + + //合计千分位 + List thousandsField = FormCommonUtil.getSummaryThousandList(mast,mastTable, columnDataModel.getType()); + map.put("thousandsField", JsonUtil.getObjectToString(thousandsField)); + + //乐观锁 + map.put("version", formData.getConcurrencyLock()); + map.put("logicalDelete", formData.getLogicalDelete()); + map.put("module", downloadCodeForm.getModule()); + map.put("className", DataControlUtils.captureName(model.getClassName())); + map.put("formRef", model.getFormRef()); + map.put("formModel", model.getFormModel()); + map.put("size", model.getSize()); + map.put("labelPosition", model.getLabelPosition()); + map.put("generalWidth", model.getGeneralWidth()); + map.put("fullScreenWidth", model.getFullScreenWidth()); + map.put("drawerWidth", model.getDrawerWidth()); + map.put("formStyle", model.getFormStyle()); + map.put("labelWidth", model.getLabelWidth()); + map.put("formRules", model.getFormRules()); + map.put("gutter", model.getGutter()); + map.put("disabled", model.getDisabled()); + map.put("span", model.getSpan()); + map.put("formBtns", model.getFormBtns()); + map.put("idGlobal", model.getIdGlobal()); + map.put("popupType", model.getPopupType()); + map.put("form", formAllModel); + map.put("columnData", columnDataMap); + map.put("columnDataListFiled", columnListModelList); + map.put("childModels", childModels); + map.put("searchTypeList", searchListAll); + map.put("searchList", searchList); + map.put("childTableStyle", columnDataModel.getChildTableStyle()); + map.put("cldColModelList", cldColModelList); + map.put("notChildColList", notChildColList); + map.put("dataType", columnDataModel.getHasPage() ? 0 : 1); + + //按钮 + map.put("HasCancelBtn", formData.getHasCancelBtn()); + map.put("HasConfirmBtn", formData.getHasConfirmBtn()); + map.put("HasPrintBtn", formData.getHasPrintBtn()); + map.put("CancelButton", formData.getCancelButtonText()); + map.put("ConfirmButton", formData.getConfirmButtonText()); + map.put("PrintButton", formData.getPrintButtonText()); + String[] printId = formData.getPrintId() != null ? formData.getPrintId() : new String[]{}; + // 打印模板如果是有多个需要查询标题 + if (printId.length > 1) { + List printOptions = FormCommonUtil.getList(Arrays.asList(printId)); + map.put("printOptions", printOptions); + } + + // 打印模板批量的标题 + List printIds = JsonUtil.getJsonToList(columnDataMap.get("printIds"), String.class); + if (printIds != null && printIds.size() > 0) { + List printOptions = FormCommonUtil.getList(printIds); + map.put("printListOptions", printOptions); + } + + String printIdAll = String.join(",", printId); + map.put("printId", printIdAll); + map.put("moduleId", entity.getId()); + + map.put("groupField", columnDataModel.getGroupField()); + if (columnDataModel.getType() == 2) { + map.put("treeRelationField", treeRelationField); + SearchTypeModel searchTypeModel = searchListAll.stream().filter(t -> t.getVModel().equals(treeRelationField)).findFirst().orElse(null); + if (searchTypeModel == null) { + searchTypeModel = new SearchTypeModel(); + searchTypeModel.setVModel(treeRelationField); + searchTypeModel.setSearchType(2); + if (columnDataModel.getTreeDataSource().equals("organize")) { + searchTypeModel.setJnpfKey(JnpfKeyConsts.COMSELECT); + searchTypeModel.setSearchType(1); + } + searchTypeModel.setLabel("tree"); + searchTypeModel.setTableName(mainTableModel.getTable()); + map.put("hasTree", true); + map.put("treeRelation", searchTypeModel); + } + } + + //共用 + map.put("children", child); + map.put("mastTable", mastTable); + map.put("fields", mast); + map.put("columnChildren", formChildList); + pKeyName = pKeyName.toLowerCase().trim().replaceAll("f_", ""); + pKeyName = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, pKeyName); + map.put("pKeyName", pKeyName); + map.put("columnList", columnList); + String modelPathName = downloadCodeForm.getClassName().toLowerCase(); + map.put("modelPathName", modelPathName); + map.put("formModelName", entity.getFullName()); + map.put("isMain", true); + + //是否开启高级查询 + Boolean hasSuperQuery = columnDataModel.getHasSuperQuery(); + map.put("superQuery", hasSuperQuery); + + htmlTemplates(FormCommonUtil.getLocalBasePath() + model.getServiceDirectory() + fileName, map, templatePath, columnDataModel.getType(), hasUploadBtn, downloadCodeForm); + + String path = FormCommonUtil.getLocalBasePath() + model.getServiceDirectory() + fileName; + if (hasSuperQuery) { + String superSqJsPath = path + File.separator + "html" + File.separator + "web" + File.separator + modelPathName + File.separator + "superQueryJson.js"; + String data = columnDataModel.getColumnOptions().replaceAll("\\\\", ""); + SuperQueryUtil.CreateJsFile(data, superSqJsPath, "superQueryJson"); + } + String colData = columnDataModel.getColumnList().replaceAll("\\\\", ""); + String colListJsPath = path + File.separator + "html" + File.separator + "web" + File.separator + modelPathName + File.separator + "columnList.js"; + SuperQueryUtil.CreateJsFile(colData, colListJsPath, "columnList"); + } + + /** + * 生成表集合 + * + * @param entity 实体 + * @param dataSourceUtil 数据源 + * @param fileName 文件夹名称 + * @param downloadCodeForm 文件名称 + * @param userInfo 用户 + */ + @Override + public void generate(VisualdevEntity entity, DataSourceUtil dataSourceUtil, String fileName, String templatePath, + DownloadCodeForm downloadCodeForm, UserInfo userInfo, ConfigValueUtil configValueUtil, DbLinkEntity linkEntity) throws SQLException { + List list = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + //生成代码 + int i = 0; + for (TableModel model : list) { + if ("1".equals(model.getTypeId())) { + setCode(dataSourceUtil, FormCommonUtil.getLocalBasePath() + FormCommonUtil.getPath(FileTypeConstant.TEMPLATECODEPATH), + fileName, templatePath, downloadCodeForm, entity, userInfo, linkEntity); + } else if ("0".equals(model.getTypeId())) { + childTable(dataSourceUtil, FormCommonUtil.getLocalBasePath() + FormCommonUtil.getPath(FileTypeConstant.TEMPLATECODEPATH), + fileName, templatePath, entity, downloadCodeForm, model.getTable(), userInfo, linkEntity); + i++; + } + } + } + + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/functionForm/FormUtil.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/functionForm/FormUtil.java new file mode 100644 index 0000000..a748158 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/functionForm/FormUtil.java @@ -0,0 +1,772 @@ +package jnpf.base.util.functionForm; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.generator.InjectionConfig; +import com.baomidou.mybatisplus.generator.config.*; +import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy; +import com.google.common.base.CaseFormat; +import jnpf.base.UserInfo; +import jnpf.base.entity.VisualdevEntity; +import jnpf.base.model.DownloadCodeForm; +import jnpf.base.model.Template7.Template7Model; +import jnpf.base.util.SourceUtil; +import jnpf.base.util.VisualUtils; +import jnpf.base.util.common.DataControlUtils; +import jnpf.base.util.common.FormCommonUtil; +import jnpf.base.util.common.FunctionFormPublicUtil; +import jnpf.base.util.custom.CustomGenerator; +import jnpf.config.ConfigValueUtil; +import jnpf.constant.FileTypeConstant; +import jnpf.constant.MsgCode; +import jnpf.database.model.entity.DbLinkEntity; +import jnpf.database.util.DataSourceUtil; +import jnpf.database.util.TenantDataSourceUtil; +import jnpf.generater.model.FormDesign.ColumnListDataModel; +import jnpf.generater.model.GenBaseInfo; +import jnpf.generater.model.GenFileNameSuffix; +import jnpf.model.visualJson.*; +import jnpf.model.visualJson.analysis.*; +import jnpf.model.visualJson.config.ConfigModel; +import jnpf.model.visualJson.props.PropsModel; +import jnpf.util.DateUtil; +import jnpf.util.JsonUtil; +import jnpf.util.StringUtil; +import jnpf.util.XSSEscape; +import lombok.Cleanup; +import org.apache.commons.io.IOUtils; +import org.apache.velocity.Template; +import org.apache.velocity.VelocityContext; +import org.apache.velocity.app.Velocity; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.StringWriter; +import java.sql.SQLException; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 纯表单 + * + * @author JNPF开发平台组 + * @version V3.2.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/9/4 + */ +public class FormUtil implements CodeGenerateUtil { + + private static FormUtil formUtil = new FormUtil(); + + private FormUtil() { + + } + + public static FormUtil getFormUtil() { + return formUtil; + } + + //------------------------------------界面---------------------------------- + + /** + * 界面模板 + * + * @param fileName 文件夹名称 + * @param downloadCodeForm 文件名称 + * @param model 模型 + * @param templatePath 模板路径 + * @param userInfo 用户 + * @param configValueUtil 下载路径 + */ + @Override + public void htmlTemplates(String fileName, VisualdevEntity entity, DownloadCodeForm downloadCodeForm, FormDataModel model, String templatePath, + UserInfo userInfo, ConfigValueUtil configValueUtil, String pKeyName) throws Exception { + //自定义包名 + String modulePackageName = downloadCodeForm.getModulePackageName(); + Map map = new HashMap<>(16); + //formTempJson + FormDataModel formData = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + List tablesList = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + List formAllModel = new ArrayList<>(); + RecursionForm recursionForm = new RecursionForm(); + recursionForm.setTableModelList(tablesList); + recursionForm.setList(list); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + + //form的属性 + List mast = formAllModel.stream().filter(t -> FormEnum.mast.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + List table = formAllModel.stream().filter(t -> FormEnum.table.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + List mastTable = formAllModel.stream().filter(t -> FormEnum.mastTable.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + map.put("ableAll" , JsonUtil.getListToJsonArray(formAllModel)); + //form和model + Template7Model temModel = new Template7Model(); + temModel.setServiceDirectory(FormCommonUtil.getPath(FileTypeConstant.CODETEMP)); + temModel.setCreateDate(DateUtil.daFormat(new Date())); + temModel.setCreateUser(GenBaseInfo.AUTHOR); + temModel.setCopyright(GenBaseInfo.COPYRIGHT); + temModel.setClassName(DataControlUtils.captureName(downloadCodeForm.getClassName())); + temModel.setVersion(GenBaseInfo.VERSION); + temModel.setDescription(GenBaseInfo.DESCRIPTION); + + //取对应表的别名 + Map tableNameRenames = FunctionFormPublicUtil.tableNameRename(downloadCodeForm, tablesList); + + //子表赋值 + List> child = new ArrayList<>(); + for (int i = 0; i < table.size(); i++) { + FormColumnTableModel childList = table.get(i).getChildList(); + List tableList = childList.getChildList(); + String sClassName = tableNameRenames.get(childList.getTableName()); + List thousandsField = new ArrayList<>(); + for (FormColumnModel columnModel : tableList) { + FieLdsModel fieLdsModel = columnModel.getFieLdsModel(); + List templateJsonAll = new ArrayList<>(); + templateJsonAll.addAll(fieLdsModel.getConfig().getTemplateJson()); + List templateJsonModelList = JsonUtil.getJsonToList(fieLdsModel.getTemplateJson(), TemplateJsonModel.class); + templateJsonAll.addAll(templateJsonModelList); + for (TemplateJsonModel templateJsonModel : templateJsonAll) { + if (StringUtil.isNotEmpty(templateJsonModel.getRelationField())) { + String[] fieldList = templateJsonModel.getRelationField().split("-"); + if (fieldList.length > 1) { + templateJsonModel.setRelationField(sClassName.toLowerCase() + "-" + fieldList[1]); + } + } + } + for (TemplateJsonModel templateJsonModel : templateJsonModelList) { + if (StringUtil.isNotEmpty(templateJsonModel.getRelationField())) { + String[] fieldList = templateJsonModel.getRelationField().split("-"); + if (fieldList.length > 1) { + templateJsonModel.setRelationField(sClassName.toLowerCase() + "List-" + fieldList[1]); + } + } + } + fieLdsModel.setTemplateJson(JsonUtil.getObjectToString(templateJsonModelList)); + fieLdsModel.getConfig().setTemplateJson(templateJsonAll); + } + childList.setChildList(tableList); + childList.setThousandsField(thousandsField); + Map childs = JsonUtil.entityToMap(childList); + String className = DataControlUtils.captureName(sClassName); + childs.put("className" , className); + child.add(childs); + } + //主表赋值 + for (int i = 0; i < mast.size(); i++) { + FieLdsModel fieLdsModel = mast.get(i).getFormColumnModel().getFieLdsModel(); + ConfigModel configModel = fieLdsModel.getConfig(); + if (configModel.getDefaultValue() instanceof String) { + configModel.setValueType("String" ); + } + if (configModel.getDefaultValue() == null) { + configModel.setValueType("undefined" ); + } + fieLdsModel.setConfig(configModel); + String vmodel = fieLdsModel.getVModel(); + if (StringUtil.isEmpty(vmodel)) { + mast.remove(i); + i--; + } + List templateJson = fieLdsModel.getConfig().getTemplateJson(); + String json = templateJson.size() > 0 ? JsonUtil.getObjectToString(templateJson):fieLdsModel.getTemplateJson(); + fieLdsModel.setTemplateJson(json); + } + + + //表单子表模型 + List formChildList = new ArrayList<>(); + //列表子表数据model + Map> groupColumnDataMap = mastTable.stream().collect(Collectors.groupingBy(m -> m.getFormMastTableModel().getTable())); + Iterator>> entries = groupColumnDataMap.entrySet().iterator(); + while (entries.hasNext()) { + Map.Entry> formEntries = entries.next(); + Map objectMap = new HashMap<>(); + String className = DataControlUtils.captureName(tableNameRenames.get(formEntries.getKey())); + ColumnListDataModel columnListDataModel = new ColumnListDataModel(); + columnListDataModel.setModelName(className); + columnListDataModel.setModelUpName(DataControlUtils.captureName(className)); + columnListDataModel.setModelLowName(DataControlUtils.initialLowercase(className)); + List allModels = formEntries.getValue(); + allModels.stream().forEach(m -> { + String vModel = m.getFormMastTableModel().getField(); + m.getFormMastTableModel().getMastTable().getFieLdsModel().setVModel(vModel); + }); + List fields = allModels.stream().map(m -> + m.getFormMastTableModel().getField()).collect(Collectors.toList()); + columnListDataModel.setFieldList(fields); + columnListDataModel.setFieLdsModelList(allModels.stream().map(al -> al.getFormMastTableModel()).collect(Collectors.toList())); + columnListDataModel.setTableName(formEntries.getKey()); + formChildList.add(columnListDataModel); + List children = formEntries.getValue().stream().map(allModel -> allModel.getFormMastTableModel().getMastTable()).collect(Collectors.toList()); + //表字段给的范围-转换json + children.forEach(item -> { + item.setFieLdsModel(DataControlUtils.setAbleIDs(item.getFieLdsModel())); + }); + FormColumnTableModel formColumnTableModel = new FormColumnTableModel(); + formColumnTableModel.setChildList(children); + objectMap.put("children" , formColumnTableModel); + objectMap.put("genInfo" , temModel); + objectMap.put("package" , modulePackageName); + objectMap.put("module" , model.getAreasName()); + objectMap.put("className" , className); + objectMap.put("isMast" , "mast" ); + childrenTemplates(FormCommonUtil.getLocalBasePath() + model.getServiceDirectory() + fileName, objectMap, templatePath, className, downloadCodeForm); + } + //子表model + for (int i = 0; i < table.size(); i++) { + FormColumnTableModel childList = table.get(i).getChildList(); + //表字段给的范围-转换json + childList.getChildList().forEach(item -> { + item.setFieLdsModel(DataControlUtils.setAbleIDs(item.getFieLdsModel())); + }); + Map objectMap = JsonUtil.entityToMap(childList); + String className = DataControlUtils.captureName(tableNameRenames.get(childList.getTableName())); + objectMap.put("children" , childList); + objectMap.put("genInfo" , temModel); + objectMap.put("package" , modulePackageName); + objectMap.put("module" , model.getAreasName()); + objectMap.put("className" , className); + childrenTemplates(FormCommonUtil.getLocalBasePath() + model.getServiceDirectory() + fileName, objectMap, templatePath, className, downloadCodeForm); + } + + //界面 + map.put("module" , downloadCodeForm.getModule()); + map.put("className" , DataControlUtils.captureName(model.getClassName())); + map.put("formRef" , model.getFormRef()); + map.put("formModel" , model.getFormModel()); + map.put("size" , model.getSize()); + map.put("labelPosition" , model.getLabelPosition()); + map.put("generalWidth" , model.getGeneralWidth()); + map.put("formStyle" , model.getFormStyle()); + map.put("labelWidth" , model.getLabelWidth()); + map.put("formRules" , model.getFormRules()); + map.put("gutter" , model.getGutter()); + map.put("disabled" , model.getDisabled()); + map.put("span" , model.getSpan()); + map.put("formBtns" , model.getFormBtns()); + map.put("idGlobal" , model.getIdGlobal()); + map.put("popupType" , model.getPopupType()); + map.put("form" , formAllModel); + map.put("fullScreenWidth" , model.getFullScreenWidth()); + map.put("groupColumnDataMap" , groupColumnDataMap); + map.put("genInfo" , temModel); + map.put("modelName" , model.getClassName()); + map.put("package" , modulePackageName); + map.put("formModelName" , entity.getFullName()); + //共用 + map.put("children" , child); + map.put("fields" , mast); + map.put("mastTable" , mastTable); + map.put("columnChildren" , formChildList); + pKeyName = pKeyName.toLowerCase().trim().replaceAll("f_" , "" ); + map.put("pKeyName" , pKeyName); + String modelPathName = downloadCodeForm.getClassName().toLowerCase(); + map.put("modelPathName" , modelPathName); + map.put("formModelName" , entity.getFullName()); + htmlTemplates(FormCommonUtil.getLocalBasePath() + model.getServiceDirectory() + fileName, map, templatePath, downloadCodeForm); + + } + + /** + * 获取文件名 + * + * @param path 路径 + * @param template 模板名称 + * @param className 文件名称 + * @return + */ + private static String getFileName(String path, String template, String className, DownloadCodeForm downloadCodeForm) { + //是否微服务路径 + String framePath = FormCommonUtil.getCloudPath("-entity" , downloadCodeForm); + String modelPath = XSSEscape.escapePath(path + File.separator + "java" + File.separator + framePath + File.separator + "model" + + File.separator + className.toLowerCase()); + String htmlPath = XSSEscape.escapePath(path + File.separator + "html" + File.separator + "web" + File.separator + className.toLowerCase()); + File htmlfile = new File(htmlPath); + File modelfile = new File(modelPath); + if (!htmlfile.exists()) { + htmlfile.mkdirs(); + } + if (!modelfile.exists()) { + modelfile.mkdirs(); + } + if (template.contains("index.vue.vm" )) { + className = "index"; + return htmlPath + File.separator + className + ".vue"; + } + if (template.contains("CrForm.java.vm" )) { + return modelPath + File.separator + className + "CrForm.java"; + } + return null; + } + + /** + * 界面的模板 + * + * @param template 模板集合 + * @return + */ + private static List getTemplates(String template) { + List templates = new ArrayList<>(); + templates.add(template + File.separator + "html" + File.separator + "index.vue.vm"); + templates.add(template + File.separator + "java" + File.separator + "CrForm.java.vm"); + return templates; + } + + /** + * 渲染html模板 + * + * @param path 路径 + * @param object 模板数据 + * @param templatePath 模板路径 + */ + private static void htmlTemplates(String path, Map object, String templatePath, DownloadCodeForm downloadCodeForm) throws Exception { + List templates = getTemplates(templatePath); + //界面模板 + VelocityContext context = new VelocityContext(); + context.put("context" , object); + for (String template : templates) { + try { + // 渲染模板 + @Cleanup StringWriter sw = new StringWriter(); + Template tpl = Velocity.getTemplate(template, Constants.UTF_8); + tpl.merge(context, sw); + String className = object.get("className" ).toString(); + String fileNames = getFileName(path, template, className, downloadCodeForm); + if (fileNames != null) { + File file = new File(XSSEscape.escapePath(fileNames)); + if (!file.exists()) { + file.createNewFile(); + } + @Cleanup FileOutputStream fos = new FileOutputStream(file); + IOUtils.write(sw.toString(), fos, Constants.UTF_8); + IOUtils.closeQuietly(sw); + IOUtils.closeQuietly(fos); + } + } catch (IOException e) { + e.printStackTrace(); + System.out.println("渲染模板失败,表名:" + e); + } + } + } + + /** + * 渲染html模板 + * + * @param path 路径 + * @param object 模板数据 + * @param templatePath 模板路径 + */ + private static void childrenTemplates(String path, Map object, String templatePath, String className, DownloadCodeForm downloadCodeForm) throws Exception { + //是否微服务路径 + String framePath = FormCommonUtil.getCloudPath("-entity" , downloadCodeForm); + String model = downloadCodeForm.getClassName(); + List templates = new ArrayList<>(); + templates.add(templatePath + File.separator + "java" + File.separator + "Model.java.vm" ); + //界面模板 + VelocityContext context = new VelocityContext(); + context.put("context" , object); + for (String template : templates) { + try { + // 渲染模板 + @Cleanup StringWriter sw = new StringWriter(); + Template tpl = Velocity.getTemplate(template, Constants.UTF_8); + tpl.merge(context, sw); + String dirNames = path + File.separator + "java" + File.separator + framePath + File.separator + "model" + File.separator + model.toLowerCase(); + String fileNames = dirNames + File.separator + className + "Model.java"; + if (fileNames != null) { + File file = new File(XSSEscape.escapePath(fileNames)); + if (!file.exists()) { + File dirFile = new File(XSSEscape.escapePath(dirNames)); + if (!dirFile.exists()) { + dirFile.mkdirs(); + } + file.createNewFile(); + } + @Cleanup FileOutputStream fos = new FileOutputStream(file); + IOUtils.write(sw.toString(), fos, Constants.UTF_8); + IOUtils.closeQuietly(sw); + IOUtils.closeQuietly(fos); + } + } catch (IOException e) { + e.printStackTrace(); + System.out.println("渲染模板失败,表名:" + e); + } + } + } + //-------------------------代码---------------------------------- + + /** + * 生成主表 + * + * @param dataSourceUtil 数据源 + * @param path 路径 + * @param fileName 文件夹名称 + * @param downloadCodeForm 文件名称 + * @param entity 实体 + * @param userInfo 用户 + * @param configValueUtil 下载路径 + */ + private static void setCode(DataSourceUtil dataSourceUtil, String path, String fileName, String templatePath, DownloadCodeForm downloadCodeForm, VisualdevEntity entity, + UserInfo userInfo, ConfigValueUtil configValueUtil, DbLinkEntity linkEntity) throws SQLException { + //自定义包名 + String modulePackageName = downloadCodeForm.getModulePackageName(); + //tableJson + List tableModelList = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + //赋值主键 + tableModelList.stream().forEach(t -> { + try { + t.setTableKey(VisualUtils.getpKey(linkEntity, t.getTable())); + } catch (SQLException sqlException) { + sqlException.printStackTrace(); + } + }); + Map columndata = new HashMap<>(16); + Template7Model model = new Template7Model(); + model.setTableName(downloadCodeForm.getClassName()); + model.setClassName(DataControlUtils.captureName(downloadCodeForm.getClassName())); + model.setServiceDirectory(FormCommonUtil.getPath(FileTypeConstant.CODETEMP)); + model.setCreateDate(DateUtil.daFormat(new Date())); + model.setCreateUser(GenBaseInfo.AUTHOR); + model.setCopyright(GenBaseInfo.COPYRIGHT); + model.setDescription(downloadCodeForm.getDescription()); + + //formTempJson + FormDataModel formData = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + List formAllModel = new ArrayList<>(); + RecursionForm recursionForm = new RecursionForm(); + recursionForm.setTableModelList(JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class)); + recursionForm.setList(list); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + //主表数据 + List mast = formAllModel.stream().filter(t -> FormEnum.mast.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + List table = formAllModel.stream().filter(t -> FormEnum.table.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + List mastTable = formAllModel.stream().filter(t -> FormEnum.mastTable.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + + //列表子表数据model + Map> groupColumnDataMap = mastTable.stream().collect(Collectors.groupingBy(m -> m.getFormMastTableModel().getTable())); + //取对应表的别名 + Map tableNameRenames = FunctionFormPublicUtil.tableNameRename(downloadCodeForm, tableModelList); + //子表集合 + List childTableNameList = new ArrayList<>(); + //全部表 + List allTableNameList = new ArrayList<>(); + for (TableModel tableModel : tableModelList) { + TableModel Model = new TableModel(); + Model.setInitName(tableModel.getTable()); + Model.setTable(tableNameRenames.get(tableModel.getTable())); + Model.setTableField(DataControlUtils.captureName(tableModel.getTableField())); + Model.setTypeId(tableModel.getTypeId()); + allTableNameList.add(Model); + if ("0".equals(tableModel.getTypeId())) { + childTableNameList.add(Model); + } + } + //表单子表模型 + List formChildList = new ArrayList<>(); + //列表子表数据model + Iterator>> entries = groupColumnDataMap.entrySet().iterator(); + while (entries.hasNext()) { + Map.Entry> formEntries = entries.next(); + String className = DataControlUtils.captureName(tableNameRenames.get(formEntries.getKey())); + ColumnListDataModel columnListDataModel = new ColumnListDataModel(); + columnListDataModel.setModelName(className); + columnListDataModel.setModelUpName(DataControlUtils.captureName(className)); + columnListDataModel.setModelLowName(DataControlUtils.initialLowercase(className)); + List allModels = formEntries.getValue(); + List fields = allModels.stream().map(m -> + m.getFormMastTableModel().getField()).collect(Collectors.toList()); + columnListDataModel.setFieldList(fields); + columnListDataModel.setFieLdsModelList(allModels.stream().map(al -> al.getFormMastTableModel()).collect(Collectors.toList())); + columnListDataModel.setTableName(formEntries.getKey()); + formChildList.add(columnListDataModel); + } + formChildList.stream().forEach(f -> { + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equalsIgnoreCase(f.getTableName())).findFirst().orElse(null); + if (ObjectUtil.isNotEmpty(tableModel)) { + f.setMainKey(tableModel.getRelationField()); + f.setRelationField(tableModel.getTableField()); + f.setMainUpKey(DataControlUtils.captureName(tableModel.getRelationField())); + f.setRelationUpField(DataControlUtils.captureName(tableModel.getTableField())); + String tableKey = tableModel.getTableKey().toLowerCase().replace("f_" , "" ); + tableKey = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, tableKey); + f.setMainField(DataControlUtils.captureName(tableKey)); + } + }); + + //主表的字段 + Optional first = tableModelList.stream().filter(t -> "1".equals(t.getTypeId())).findFirst(); + if (!first.isPresent()) { + throw new SQLException(MsgCode.COD001.get()); + } + String tableName = first.get().getTable(); + String billNo = ""; + List system = new ArrayList<>(); + for (int i = 0; i < mast.size(); i++) { + FormAllModel mastModel = mast.get(i); + FieLdsModel fieLdsModel = mastModel.getFormColumnModel().getFieLdsModel(); + if (StringUtil.isNotEmpty(fieLdsModel.getVModel())) { + system.add(fieLdsModel); + } + } + + //列表子表 + List childSystem = new ArrayList<>(); + for (int i = 0; i < mastTable.size(); i++) { + FormAllModel mastModel = mastTable.get(i); + FieLdsModel fieLdsModel = mastModel.getFormMastTableModel().getMastTable().getFieLdsModel(); + PropsModel propsModel = fieLdsModel.getProps(); + String vModel = fieLdsModel.getVModel(); + if (StringUtil.isNotEmpty(vModel)) { + fieLdsModel.setVModel(vModel.substring(vModel.lastIndexOf("jnpf_")).replace("jnpf_" , "")); + fieLdsModel.setProps(propsModel); + childSystem.add(fieLdsModel); + } + } + + //获取主表主键 + String pKeyName = VisualUtils.getpKey(linkEntity, tableName).toLowerCase().trim().replaceAll("f_" , ""); + //子表的属性 + List> child = new ArrayList<>(); + for (int i = 0; i < table.size(); i++) { + FormColumnTableModel childList = table.get(i).getChildList(); + String className = DataControlUtils.captureName(tableNameRenames.get(childList.getTableName())); + Map childs = JsonUtil.entityToMap(childList); + Optional first1 = tableModelList.stream().filter(t -> t.getTable().equals(childList.getTableName())).findFirst(); + if (!first1.isPresent()) { + throw new SQLException(MsgCode.COD001.get()); + } + TableModel tableModel = first1.get(); + //获取主表主键 + String chidKeyName = VisualUtils.getpKey(linkEntity, tableModel.getTable()); + String tableField = tableModel.getTableField().trim().replaceAll(":\"f_" , ":\"" ); + childs.put("tableField" , tableField); + String relationField = tableModel.getRelationField().trim().replaceAll(":\"f_" , ":\"" ); + childs.put("relationField" , relationField); + childs.put("className" , className); + String keyName = chidKeyName.trim().toLowerCase().replaceAll("f_" , "" ); + childs.put("chidKeyName" , keyName); + child.add(childs); + } + //后台 + columndata.put("module" , downloadCodeForm.getModule()); + columndata.put("genInfo" , model); + columndata.put("modelName" , model.getClassName()); + columndata.put("typeId" , 1); + columndata.put("system" , system); + columndata.put("childSystem" , childSystem); + columndata.put("child" , child); + columndata.put("childTableNameList" , childTableNameList); + columndata.put("billNo" , billNo); + columndata.put("pKeyName" , pKeyName); + columndata.put("fieldsSize" , system.size()); + columndata.put("main" , true); + columndata.put("mast" , mast); + columndata.put("childtable" , table); + columndata.put("mastTable" , mastTable); + columndata.put("groupColumnDataMap" , groupColumnDataMap); + columndata.put("columnChildren" , formChildList); + //雪花 + columndata.put("snowflake" , formData.getPrimaryKeyPolicy() == 1); + //微服务标识 + columndata.put("isCloud" , FormCommonUtil.IS_CLOUD); + //数据源 + if (linkEntity != null) { + columndata.put("DS" , linkEntity.getFullName()); + } + CustomGenerator mpg = new CustomGenerator(columndata); + // 全局配置 + GlobalConfig gc = new GlobalConfig(); + gc.setFileOverride(true); + // 不需要ActiveRecord特性的请改为false + gc.setActiveRecord(false); + // XML 二级缓存 + gc.setEnableCache(false); + // XML ResultMap + gc.setBaseResultMap(false); + // XML columList + gc.setBaseColumnList(false); + gc.setAuthor(userInfo.getUserName() + "/" + userInfo.getUserAccount()); + gc.setOpen(false); + + // 自定义文件命名,注意 %s 会自动填充表实体属性! + gc.setEntityName(model.getClassName() + GenFileNameSuffix.ENTITY); + gc.setMapperName(model.getClassName() + GenFileNameSuffix.MAPPER); + gc.setXmlName(model.getClassName() + GenFileNameSuffix.MAPPER_XML); + gc.setServiceName(model.getClassName() + GenFileNameSuffix.SERVICE); + gc.setServiceImplName(model.getClassName() + GenFileNameSuffix.SERVICEIMPL); + gc.setControllerName(model.getClassName() + GenFileNameSuffix.CONTROLLER); + mpg.setGlobalConfig(gc); + + // 数据源配置 + DataSourceConfig dsc = SourceUtil.dbConfig(TenantDataSourceUtil.getTenantSchema(), linkEntity); + mpg.setDataSource(dsc); + + // 策略配置 + StrategyConfig strategy = new StrategyConfig(); + strategy.setEntityLombokModel(true); + // 表名生成策略 + strategy.setNaming(NamingStrategy.underline_to_camel); + // 需要生成的表 + strategy.setInclude(tableName); + strategy.setRestControllerStyle(true); + mpg.setStrategy(strategy); + + // 包配置 + PackageConfig pc = new PackageConfig(); + pc.setParent(modulePackageName); + mpg.setPackageInfo(pc); + // 包名 + columndata.put("modulePackageName" , modulePackageName); + + // 自定义配置 + InjectionConfig cfg = new InjectionConfig() { + @Override + public void initMap() { + // to do nothing + } + }; + List focList = new ArrayList<>(); + String javaPath = FormCommonUtil.getLocalBasePath() + model.getServiceDirectory(); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "Controller.java.vm" , "controller" , false)); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "Entity.java.vm" , "entity" , formData.getConcurrencyLock())); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "Mapper.java.vm" , "mapper" , false)); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "Mapper.xml.vm" , "xml" , false)); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "Service.java.vm" , "service" , false)); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "ServiceImpl.java.vm" , "impl" , false)); + + cfg.setFileOutConfigList(focList); + mpg.setTemplate(new TemplateConfig().setXml(null).setMapper(null).setController(null).setEntity(null).setService(null).setServiceImpl(null)); + mpg.setCfg(cfg); + // 执行生成 + mpg.execute(path); + } + + /** + * 生成子表 + * + * @param downloadCodeForm 表单信息 + * @param dataSourceUtil 数据源 + * @param path 路径 + * @param fileName 文件夹名称 + * @param className 文件名称 + * @param table 子表 + * @param userInfo 用户 + * @param configValueUtil 下载路径 + */ + private static void childTable(DataSourceUtil dataSourceUtil, String path, String fileName, String templatePath, DownloadCodeForm downloadCodeForm, String className, String table, + UserInfo userInfo, ConfigValueUtil configValueUtil, DbLinkEntity linkEntity) { + //自定义包名 + String modulePackageName = downloadCodeForm.getModulePackageName(); + Map columndata = new HashMap<>(16); + + Template7Model model = new Template7Model(); + model.setClassName(table); + model.setServiceDirectory(FormCommonUtil.getPath(FileTypeConstant.CODETEMP)); + model.setCreateDate(DateUtil.daFormat(new Date())); + model.setCreateUser(GenBaseInfo.AUTHOR); + model.setCopyright(GenBaseInfo.COPYRIGHT); + model.setDescription(table); + //数据源 + if (ObjectUtil.isNotEmpty(linkEntity)) { + columndata.put("DS" , linkEntity.getFullName()); + } + columndata.put("genInfo" , model); + CustomGenerator mpg = new CustomGenerator(columndata); + // 全局配置 + GlobalConfig gc = new GlobalConfig(); + gc.setFileOverride(true); + // 不需要ActiveRecord特性的请改为false + gc.setActiveRecord(false); + // XML 二级缓存 + gc.setEnableCache(false); + // XML ResultMap + gc.setBaseResultMap(false); + // XML columList + gc.setBaseColumnList(false); + gc.setAuthor(model.getCreateUser()); + gc.setOpen(false); + + // 自定义文件命名,注意 %s 会自动填充表实体属性! + gc.setEntityName(className + GenFileNameSuffix.ENTITY); + gc.setMapperName(className + GenFileNameSuffix.MAPPER); + gc.setXmlName(className + GenFileNameSuffix.MAPPER_XML); + gc.setServiceName(className + GenFileNameSuffix.SERVICE); + gc.setServiceImplName(className + GenFileNameSuffix.SERVICEIMPL); + mpg.setGlobalConfig(gc); + + // 数据源配置 + DataSourceConfig dsc = SourceUtil.dbConfig(TenantDataSourceUtil.getTenantSchema(), linkEntity); + mpg.setDataSource(dsc); + + // 策略配置 + StrategyConfig strategy = new StrategyConfig(); + strategy.setEntityLombokModel(true); + // 表名生成策略 + strategy.setNaming(NamingStrategy.underline_to_camel); + // 需要生成的表 + strategy.setInclude(table); + strategy.setRestControllerStyle(true); + mpg.setStrategy(strategy); + + // 包配置 + PackageConfig pc = new PackageConfig(); + pc.setParent(modulePackageName); + mpg.setPackageInfo(pc); + // 包名 + columndata.put("modulePackageName" , modulePackageName); + + // 自定义配置 + InjectionConfig cfg = new InjectionConfig() { + @Override + public void initMap() { + // to do nothing + } + }; + List focList = new ArrayList<>(); + String javaPath = FormCommonUtil.getLocalBasePath() + model.getServiceDirectory(); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "Entity.java.vm" , "entity" , false)); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "Mapper.java.vm" , "mapper" , false)); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "Mapper.xml.vm" , "xml" , false)); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "Service.java.vm" , "service" , false)); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "ServiceImpl.java.vm" , "impl" , false)); + cfg.setFileOutConfigList(focList); + mpg.setTemplate(new TemplateConfig().setXml(null).setMapper(null).setController(null).setEntity(null).setService(null).setServiceImpl(null)); + mpg.setCfg(cfg); + // 执行生成 + mpg.execute(path); + } + + /** + * 生成表集合 + * + * @param entity 实体 + * @param dataSourceUtil 数据源 + * @param fileName 文件夹名称 + * @param downloadCodeForm 文件名称 + * @param userInfo 用户 + * @param configValueUtil 下载路径 + */ + @Override + public void generate(VisualdevEntity entity, DataSourceUtil dataSourceUtil, String fileName, String templatePath, DownloadCodeForm downloadCodeForm, + UserInfo userInfo, ConfigValueUtil configValueUtil, DbLinkEntity linkEntity) throws SQLException { + List list = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + //生成代码 + int i = 0; + for (TableModel model : list) { + if ("1".equals(model.getTypeId())) { + setCode(dataSourceUtil, FormCommonUtil.getLocalBasePath() + FormCommonUtil.getPath(FileTypeConstant.TEMPLATECODEPATH), + fileName, templatePath, downloadCodeForm, entity, userInfo, configValueUtil, linkEntity); + } else if ("0".equals(model.getTypeId())) { + String name = downloadCodeForm.getSubClassName().split("," )[i]; + String className = DataControlUtils.captureName(name); + childTable(dataSourceUtil, FormCommonUtil.getLocalBasePath() + FormCommonUtil.getPath(FileTypeConstant.TEMPLATECODEPATH), + fileName, templatePath, downloadCodeForm, className, model.getTable(), userInfo, configValueUtil, linkEntity); + i++; + } + } + } + + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/functionForm/FunctionFlowUtil.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/functionForm/FunctionFlowUtil.java new file mode 100644 index 0000000..292d1a7 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/functionForm/FunctionFlowUtil.java @@ -0,0 +1,2006 @@ +package jnpf.base.util.functionForm; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.generator.InjectionConfig; +import com.baomidou.mybatisplus.generator.config.*; +import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy; +import com.google.common.base.CaseFormat; +import jnpf.base.UserInfo; +import jnpf.base.entity.VisualdevEntity; +import jnpf.base.model.ColumnDataModel; +import jnpf.base.model.DownloadCodeForm; +import jnpf.base.model.Template6.AuthorityModel; +import jnpf.base.model.Template6.BtnData; +import jnpf.base.model.Template6.ColumnListField; +import jnpf.base.model.Template7.Template7Model; +import jnpf.base.model.print.PrintOption; +import jnpf.base.util.SourceUtil; +import jnpf.base.util.VisualUtils; +import jnpf.base.util.common.DataControlUtils; +import jnpf.base.util.common.FormCommonUtil; +import jnpf.base.util.common.FunctionFormPublicUtil; +import jnpf.base.util.common.SuperQueryUtil; +import jnpf.base.util.custom.CustomGenerator; +import jnpf.config.ConfigValueUtil; +import jnpf.constant.FileTypeConstant; +import jnpf.constant.MsgCode; +import jnpf.database.model.entity.DbLinkEntity; +import jnpf.database.util.DataSourceUtil; +import jnpf.database.util.TenantDataSourceUtil; +import jnpf.entity.FlowFormEntity; +import jnpf.generater.model.FormDesign.*; +import jnpf.generater.model.GenBaseInfo; +import jnpf.generater.model.GenFileNameSuffix; +import jnpf.model.visualJson.*; +import jnpf.model.visualJson.analysis.*; +import jnpf.model.visualJson.config.ConfigModel; +import jnpf.util.DateUtil; +import jnpf.util.JsonUtil; +import jnpf.util.StringUtil; +import jnpf.util.XSSEscape; +import jnpf.util.visiual.JnpfKeyConsts; +import lombok.Cleanup; +import org.apache.commons.io.IOUtils; +import org.apache.velocity.Template; +import org.apache.velocity.VelocityContext; +import org.apache.velocity.app.Velocity; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.StringWriter; +import java.sql.SQLException; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/3/16 + * @Description 行内编辑 + */ +public class FunctionFlowUtil implements CodeGenerateUtil { + private static FunctionFlowUtil functionFlowUtil = new FunctionFlowUtil(); + + private FunctionFlowUtil() { + + } + + public static FunctionFlowUtil getFunctionFlowUtil() { + return functionFlowUtil; + } + + //------------------------------------界面---------------------------------- + + /** + * 界面模板 + * + * @param fileName 文件夹名称 + * @param downloadCodeForm 文件名称 + * @param model 模型 + * @param templatePath 模板路径 + * @param userInfo 用户 + * @param configValueUtil 下载路径 + */ + @Override + public void htmlTemplates(String fileName, VisualdevEntity entity, DownloadCodeForm downloadCodeForm, + FormDataModel model, String templatePath, UserInfo userInfo, + ConfigValueUtil configValueUtil, String pKeyName) throws Exception { + //自定义包名 + String modulePackageName = downloadCodeForm.getModulePackageName(); + Map map = new HashMap<>(16); + //formTempJson + FormDataModel formData = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(entity.getColumnData(), ColumnDataModel.class); + List columnList = JsonUtil.getJsonToList(columnDataModel.getColumnList(), ColumnListField.class); + List formAllModel = new ArrayList<>(); + RecursionForm recursionForm = new RecursionForm(); + recursionForm.setTableModelList(JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class)); + recursionForm.setList(list); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + + List tableModelFields = new ArrayList<>(); + FunctionFormPublicUtil.getTableModels(list, tableModelFields); + + //form的属性 + List mast = formAllModel.stream().filter(t -> FormEnum.mast.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + List table = formAllModel.stream().filter(t -> FormEnum.table.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + List mastTable = formAllModel.stream().filter(t -> FormEnum.mastTable.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + map.put("ableAll" , JsonUtil.getListToJsonArray(formAllModel)); + //columnTempJson + Map columnDataMap = JsonUtil.stringToMap(entity.getColumnData()); + + List tablesList = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + //列表字段 + List columnListModelList = JsonUtil.getJsonToList(columnDataModel.getColumnList(), ColumnListModel.class); + List notChildColList = columnListModelList.stream().filter(copy -> + !copy.getVModel().toLowerCase().startsWith(JnpfKeyConsts.CHILD_TABLE_PREFIX)).collect(Collectors.toList()); + + //按钮 + List btnDataList = JsonUtil.getJsonToList(columnDataModel.getBtnsList(), BtnData.class); + boolean hasUploadBtn = btnDataList.stream().anyMatch(btn -> btn.getValue().equals("upload" )); + + //列表子表折叠 + List cldColModelList = new ArrayList<>(); + + List tablekeys = table.stream().map(t -> t.getChildList().getTableModel()).collect(Collectors.toList()); + Map keyNum = new HashMap<>(); + for (String key : tablekeys) { + ColumnListModel columnListModel = columnListModelList.stream().filter(c -> c.getProp().startsWith(key)).findFirst().orElse(null); + int i = columnListModelList.indexOf(columnListModel); + keyNum.put(key, i); + } + + Map> childFiledLists = columnListModelList.stream().filter(c -> + c.getProp().toLowerCase().contains(JnpfKeyConsts.CHILD_TABLE_PREFIX)).collect(Collectors.groupingBy(t -> t.getProp().substring(0, t.getProp().indexOf("-")))); + List childModels = new ArrayList<>(); + Iterator>> colentries = childFiledLists.entrySet().iterator(); + while (colentries.hasNext()) { + Map.Entry> next = colentries.next(); + ColumnListModel listModel = new ColumnListModel(); + ColumnChildListModel mod = new ColumnChildListModel(); + mod.setTableField(next.getKey()); + List value = next.getValue(); + value.get(0).setFirst(true); + String label = value.get(0).getLabel(); + String substring = label.substring(0, label.indexOf("-" )); + mod.setLabel(substring); + value.stream().forEach(v -> { + String prop = v.getProp(); + String valueLabel = v.getLabel(); + String propSub = prop.substring(prop.indexOf("-" ) + 1); + String labelSub = valueLabel.substring(valueLabel.indexOf("-" ) + 1); + v.setLabel(labelSub); + v.setProp(propSub); + }); + mod.setFields(value); + listModel.setProp(next.getKey()); + listModel.setColumnChildListModel(mod); + listModel.setJnpfKey(JnpfKeyConsts.CHILD_TABLE); + childModels.add(mod); + int i = keyNum.get(next.getKey()); + columnListModelList.set(i, listModel); + cldColModelList.add(listModel); + } + + columnListModelList = columnListModelList.stream().filter(c -> { + boolean b = true; + if (c.getVModel() != null && c.getVModel().toLowerCase().contains(JnpfKeyConsts.CHILD_TABLE_PREFIX)) { + if (!c.getJnpfKey().equals(JnpfKeyConsts.CHILD_TABLE)) { + b = false; + } + } + return b; + }).collect(Collectors.toList()); + + //取对应表的别名 + Map tableNameRenames = FunctionFormPublicUtil.tableNameRename(downloadCodeForm, tablesList); + + List allColumnFiledModelList = new ArrayList<>(); + allColumnFiledModelList.addAll(mast.stream().map(ma -> ma.getFormColumnModel().getFieLdsModel()).collect(Collectors.toList())); + allColumnFiledModelList.addAll(mastTable.stream().map(mt -> mt.getFormMastTableModel().getMastTable().getFieLdsModel()).collect(Collectors.toList())); + for (FormAllModel allModel : table) { + List childList = allModel.getChildList().getChildList(); + for (FormColumnModel formColumnModel : childList) { + allColumnFiledModelList.add(formColumnModel.getFieLdsModel()); + } + } + columnListModelList.stream().forEach(c -> { + String prop = c.getProp(); + FieLdsModel fieLdsModel = allColumnFiledModelList.stream().filter(f -> prop.equals(f.getVModel())).findFirst().orElse(null); + if (fieLdsModel != null) { + c.setDataType(fieLdsModel.getConfig().getDataType()); + c.setVModel(fieLdsModel.getVModel()); + c.setMultiple(c.getMultiple() != null ? c.getMultiple() : fieLdsModel.getMultiple()); + if(StringUtil.isNotEmpty(c.getRelationField()) && c.getRelationField().contains("_jnpfTable_")){ + FormAllModel formAllModel1 = mast.stream().filter(t -> t.getFormColumnModel().getFieLdsModel().getVModel() + .equals(c.getProp())).findFirst().orElse(null); + if(formAllModel1!=null){ + c.setRelationField(formAllModel1.getFormColumnModel().getFieLdsModel().getRelationField()); + } + FormAllModel formAllModel2 = mastTable.stream().filter(t -> t.getFormMastTableModel().getVModel() + .equals(c.getProp())).findFirst().orElse(null); + if(formAllModel2!=null){ + c.setRelationField(formAllModel2.getFormMastTableModel().getMastTable().getFieLdsModel().getRelationField()); + } + } + //数字组件新增属性 + c.setAddonBefore(fieLdsModel.getAddonBefore()); + c.setAddonAfter(fieLdsModel.getAddonAfter()); + c.setIsAmountChinese(fieLdsModel.getIsAmountChinese()); + c.setThousands(fieLdsModel.isThousands()); + c.setControls(fieLdsModel.getControls()); + //时间控件添加字段 + c.setStartTime(fieLdsModel.getStartTime()); + c.setEndTime(fieLdsModel.getEndTime()); + c.setStartRelationField(fieLdsModel.getConfig().getStartRelationField()); + c.setEndRelationField(fieLdsModel.getConfig().getEndRelationField()); + + if (fieLdsModel.getSelectType() != null) { + c.setSelectType(fieLdsModel.getSelectType()); + c.setAbleIds(fieLdsModel.getAbleIds()); + c.setAbleDepIds(fieLdsModel.getAbleDepIds()); + c.setAbleGroupIds(fieLdsModel.getAbleGroupIds()); + c.setAblePosIds(fieLdsModel.getAblePosIds()); + c.setAbleRoleIds(fieLdsModel.getAbleRoleIds()); + c.setAbleUserIds(fieLdsModel.getAbleUserIds()); + } + } + }); + + //列表中区别子表正则 + String reg = "^[jnpf_]\\S*_jnpf\\S*"; + columnListModelList.stream().filter(c -> c.getProp().matches(reg)).forEach( + cl -> { + String s = cl.getProp(); + String s1 = s.substring(s.lastIndexOf("jnpf_" )).replace("jnpf_" , "" ); + String s2 = s.substring(s.indexOf("_" ) + 1, s.lastIndexOf("_jnpf" )); + cl.setNewProp(s2.toLowerCase() + "." + s1); + cl.setColumnTableName(s2); + } + ); + + List searchList = JsonUtil.getJsonToList(columnDataMap.get("searchList" ), FieLdsModel.class); + + for (FieLdsModel fieLdsModel : searchList) { + String vModel = fieLdsModel.getVModel(); + if (vModel.contains("-" )) { + vModel = vModel.replaceAll("-" , "_" ); + } + fieLdsModel.setVModel(vModel); + } + + //查询条件 + Map searchAll = new HashMap<>(); + List searchTypeModelList = new ArrayList<>(); + List jnpfkey = new ArrayList() {{ + add(JnpfKeyConsts.COM_INPUT); + add(JnpfKeyConsts.TEXTAREA); + }}; + searchList.stream().forEach(fieLdsModel -> { + SearchTypeModel searchTypeModel = new SearchTypeModel(); + searchTypeModel.setJnpfKey(fieLdsModel.getConfig().getJnpfKey()); + Integer seachType = fieLdsModel.getSearchType(); + if (jnpfkey.contains(searchTypeModel.getJnpfKey()) && seachType.equals(3)) { + seachType = 2; + } + searchTypeModel.setSearchType(seachType); + searchTypeModel.setVModel(fieLdsModel.getVModel()); + searchTypeModel.setLabel(fieLdsModel.getConfig().getLabel()); + searchTypeModel.setFormat(fieLdsModel.getFormat()); + String placeholder = fieLdsModel.getSearchType().equals(3) ? fieLdsModel.getPlaceholder() : DataControlUtils.getPlaceholder(fieLdsModel.getConfig().getJnpfKey()); + if (searchTypeModel.getSearchType().equals(3)) { + searchAll.put(searchTypeModel.getVModel(), searchTypeModel.getLabel()); + } + searchTypeModel.setPlaceholder(placeholder); + searchTypeModel.setConfig(fieLdsModel.getConfig()); + searchTypeModel.setShowLevel(fieLdsModel.getShowLevel()); + searchTypeModel.setMultiple(String.valueOf(fieLdsModel.getSearchMultiple())); + searchTypeModelList.add(searchTypeModel); + }); + TableModel mainTableModel = tablesList.stream().filter(t -> t.getTypeId().equals("1" )).findFirst().orElse(null); + + if (searchTypeModelList.size() > 0) { + for (TableFields tableFields : mainTableModel.getFields()) { + searchTypeModelList.stream().forEach(searchTypeModel -> { + if (searchTypeModel.getVModel().equals(tableFields.getField())) { + searchTypeModel.setDataType(tableFields.getDataType()); + } + }); + } + } + + + //--------------------------------------add state--------------------------------------------- + Map columnAppDataMap = JsonUtil.stringToMap(entity.getAppColumnData()); + List searchAppList = JsonUtil.getJsonToList(columnAppDataMap.get("searchList" ), FieLdsModel.class); + for (FieLdsModel fieLdsModel : searchAppList) { + String vModel = fieLdsModel.getVModel(); + if (vModel.contains("-" )) { + vModel = vModel.replaceAll("-" , "_" ); + } + fieLdsModel.setVModel(vModel); + } + List searchTypeAppModelList = new ArrayList<>(); + searchAppList.stream().forEach(fieLdsModel -> { + SearchTypeModel searchTypeModel = new SearchTypeModel(); + searchTypeModel.setJnpfKey(fieLdsModel.getConfig().getJnpfKey()); + Integer seachType = fieLdsModel.getSearchType(); + if (jnpfkey.contains(searchTypeModel.getJnpfKey()) && seachType.equals(3)) { + seachType = 2; + } + searchTypeModel.setSearchType(seachType); + searchTypeModel.setVModel(fieLdsModel.getVModel()); + searchTypeModel.setLabel(fieLdsModel.getConfig().getLabel()); + searchTypeModel.setFormat(fieLdsModel.getFormat()); + String placeholder = fieLdsModel.getSearchType().equals(3) ? fieLdsModel.getPlaceholder() : DataControlUtils.getPlaceholder(fieLdsModel.getConfig().getJnpfKey()); + if (searchTypeModel.getSearchType().equals(3)) { + searchAll.put(searchTypeModel.getVModel(), searchTypeModel.getLabel()); + } + searchTypeModel.setPlaceholder(placeholder); + searchTypeModel.setConfig(fieLdsModel.getConfig()); + searchTypeModel.setShowLevel(fieLdsModel.getShowLevel()); + searchTypeModel.setMultiple(String.valueOf(fieLdsModel.getSearchMultiple())); + searchTypeAppModelList.add(searchTypeModel); + }); + + if (searchTypeAppModelList.size() > 0) { + for (TableFields tableFields : mainTableModel.getFields()) { + searchTypeAppModelList.stream().forEach(searchTypeModel -> { + if (searchTypeModel.getVModel().equals(tableFields.getField())) { + searchTypeModel.setDataType(tableFields.getDataType()); + } + }); + } + } + + List searchListAll = new ArrayList<>(); + List modelAll = new ArrayList<>(); + for (SearchTypeModel searchTypeModel : searchTypeModelList) { + if (searchAll.get(searchTypeModel.getVModel()) == null && !modelAll.contains(searchTypeModel.getVModel())) { + searchListAll.add(searchTypeModel); + modelAll.add(searchTypeModel.getVModel()); + } + } + for (SearchTypeModel searchTypeModel : searchTypeAppModelList) { + if (searchAll.get(searchTypeModel.getVModel()) == null && !modelAll.contains(searchTypeModel.getVModel())) { + searchListAll.add(searchTypeModel); + modelAll.add(searchTypeModel.getVModel()); + } + } + for (String key : searchAll.keySet()) { + SearchTypeModel typeModel = new SearchTypeModel(); + typeModel.setVModel(key); + typeModel.setSearchType(3); + typeModel.setLabel(searchAll.get(key)); + searchListAll.add(typeModel); + } + + String treeRelationField = columnDataModel.getTreeRelation().replaceAll("-" , "_" ); + //--------------------------------------add end--------------------------------------------- + + //--------------------------------------导入---------------------------------------------------- + List allUploadTemplates = new ArrayList<>(); + UploaderTemplateModel uploaderTemplateModel = JsonUtil.getJsonToBean(columnDataModel.getUploaderTemplateJson(), UploaderTemplateModel.class); + if (hasUploadBtn && ObjectUtil.isNotNull(uploaderTemplateModel) && uploaderTemplateModel.getSelectKey() != null) { + List cols = new ArrayList<>(); + for (String upload : uploaderTemplateModel.getSelectKey()) { + ColumnChildListModel columnChildListModel = new ColumnChildListModel(); + String tableField; + String vModel; + ColumnListField field = columnList.stream().filter(c -> c.getProp().equals(upload)).findFirst().orElse(new ColumnListField()); + String label = field.getConfig() != null ? field.getConfig().getLabel() : ""; + if (upload.toLowerCase().startsWith(JnpfKeyConsts.CHILD_TABLE_PREFIX)) { + tableField = upload.substring(0, upload.indexOf("-")); + vModel = upload.substring(upload.indexOf("-") + 1); + } else if (upload.toLowerCase().startsWith("jnpf_")) { + FormAllModel thisTableModel = mastTable.stream().filter(mb -> upload.equals(mb.getFormMastTableModel().getVModel())).findFirst().orElse(null); + FieLdsModel masF = thisTableModel != null ? thisTableModel.getFormMastTableModel().getMastTable().getFieLdsModel() : new FieLdsModel(); + if (masF.getConfig().getRegList() != null) { + String o1 = JSONObject.toJSONString(JsonUtil.getObjectToString(masF.getConfig().getRegList())); + masF.getConfig().setReg(o1); + } + masF.setTableType(1); + masF.setBeforeVmodel(upload); + FieLdsModel masFNiuNiu = new FieLdsModel(); + BeanUtil.copyProperties(masF, masFNiuNiu); + masFNiuNiu = DataControlUtils.setAbleIDs(masFNiuNiu); + allUploadTemplates.add(masFNiuNiu); + tableField = ""; + vModel = upload; + } else { + tableField = ""; + vModel = upload; + List mastField = mast.stream().map(m -> m.getFormColumnModel().getFieLdsModel()).collect(Collectors.toList()); + FieLdsModel mastF = mastField.stream().filter(mas -> mas.getVModel().equals(upload)).findFirst().orElse(new FieLdsModel()); + if (mastF.getConfig().getRegList() != null) { + String o1 = JSONObject.toJSONString(JsonUtil.getObjectToString(mastF.getConfig().getRegList())); + mastF.getConfig().setReg(o1); + } + mastF.setTableType(0); + FieLdsModel masFNiuNiu = new FieLdsModel(); + BeanUtil.copyProperties(mastF, masFNiuNiu); + masFNiuNiu = DataControlUtils.setAbleIDs(masFNiuNiu); + allUploadTemplates.add(masFNiuNiu); + } + columnChildListModel.setTableField(tableField); + columnChildListModel.setLabel(label); + columnChildListModel.setVModel(vModel); + cols.add(columnChildListModel); + } + Map> improtCollect = cols.stream().filter(col -> + StringUtil.isNotEmpty(col.getTableField())).collect(Collectors.groupingBy(ColumnChildListModel::getTableField)); + for (Map.Entry> m : improtCollect.entrySet()) { + String tableFiled = m.getKey(); + FieLdsModel fieLdsModel = tableModelFields.stream().filter(t -> t.getVModel().equals(tableFiled)).findFirst().orElse(null); + List children = fieLdsModel.getConfig().getChildren(); + List chlidFields = new ArrayList<>(); + String tableName1 = fieLdsModel.getConfig().getTableName(); + fieLdsModel.getConfig().setAliasClassName(tableNameRenames.get(tableName1)); + for (ColumnChildListModel columnChildListModel : m.getValue()) { + FieLdsModel fieLdsModel2 = children.stream().filter(ch -> ch.getVModel().equals(columnChildListModel.getVModel())).findFirst().orElse(null); + chlidFields.add(fieLdsModel2); + } + fieLdsModel.getConfig().setChildren(chlidFields); + fieLdsModel.setChildrenSize(chlidFields.size()); + fieLdsModel.setTableType(2); + allUploadTemplates.add(fieLdsModel); + } + } + //----------------------------------------------------------------导入 end + if (columnDataModel.getType() == 2) { + SearchTypeModel searchTypeModel = searchTypeModelList.stream().filter(t -> t.getVModel().equals(treeRelationField)).findFirst().orElse(null); + if (searchTypeModel == null) { + searchTypeModel = new SearchTypeModel(); + searchTypeModel.setVModel(treeRelationField); + searchTypeModel.setSearchType(2); + searchTypeModel.setLabel("tree"); + if (columnDataModel.getTreeDataSource().equals("organize")) { + searchTypeModel.setJnpfKey(JnpfKeyConsts.COMSELECT); + searchTypeModel.setSearchType(1); + } + searchTypeModel.setLabel("tree"); + searchTypeModel.setTableName(mainTableModel.getTable()); + searchTypeModelList.add(searchTypeModel); + } + } + + //表单子表模型 + List formChildList = new ArrayList<>(); + + //form和model + Template7Model temModel = new Template7Model(); + temModel.setServiceDirectory(FormCommonUtil.getPath(FileTypeConstant.CODETEMP)); + temModel.setCreateDate(DateUtil.daFormat(new Date())); + temModel.setCreateUser(GenBaseInfo.AUTHOR); + temModel.setCopyright(GenBaseInfo.COPYRIGHT); + temModel.setClassName(DataControlUtils.captureName(downloadCodeForm.getClassName())); + temModel.setDescription(""); + map.put("genInfo", temModel); + map.put("modelName", model.getClassName()); + map.put("package", modulePackageName); + + //子表赋值 + List> child = new ArrayList<>(); + for (int i = 0; i < table.size(); i++) { + FormColumnTableModel childList = table.get(i).getChildList(); + List tableList = childList.getChildList(); + String sClassName = tableNameRenames.get(childList.getTableName()); + List thousandsField=new ArrayList<>(); + for (FormColumnModel columnModel : tableList) { + FieLdsModel fieLdsModel = columnModel.getFieLdsModel(); + List templateJsonAll = new ArrayList<>(); + templateJsonAll.addAll(fieLdsModel.getConfig().getTemplateJson()); + List templateJsonModelList = JsonUtil.getJsonToList(fieLdsModel.getTemplateJson(), TemplateJsonModel.class); + templateJsonAll.addAll(templateJsonModelList); + for (TemplateJsonModel templateJsonModel : templateJsonAll) { + if (StringUtil.isNotEmpty(templateJsonModel.getRelationField())) { + String[] fieldList = templateJsonModel.getRelationField().split("-"); + if (fieldList.length > 1) { + templateJsonModel.setRelationField(sClassName.toLowerCase() + "-" + fieldList[1]); + } + } + } + for (TemplateJsonModel templateJsonModel : templateJsonModelList) { + if (StringUtil.isNotEmpty(templateJsonModel.getRelationField())) { + String[] fieldList = templateJsonModel.getRelationField().split("-"); + if (fieldList.length > 1) { + templateJsonModel.setRelationField(sClassName.toLowerCase() + "List-" + fieldList[1]); + } + } + } + fieLdsModel.setTemplateJson(JsonUtil.getObjectToString(templateJsonModelList)); + fieLdsModel.getConfig().setTemplateJson(templateJsonAll); + } + childList.setChildList(tableList); + childList.setThousandsField(thousandsField); + Map childs = JsonUtil.entityToMap(childList); + String className = DataControlUtils.captureName(sClassName); + childs.put("className", className); + child.add(childs); + } + //主表赋值 + for (int i = 0; i < mast.size(); i++) { + FieLdsModel fieLdsModel = mast.get(i).getFormColumnModel().getFieLdsModel(); + ConfigModel configModel = fieLdsModel.getConfig(); + if (configModel.getDefaultValue() == null) { + configModel.setValueType("undefined"); + } else if (configModel.getDefaultValue() instanceof String) { + configModel.setValueType("String"); + } + fieLdsModel.setConfig(configModel); + + List templateJson = fieLdsModel.getConfig().getTemplateJson(); + String json = templateJson.size() > 0 ? JsonUtil.getObjectToString(templateJson):fieLdsModel.getTemplateJson(); + fieLdsModel.setTemplateJson(json); + } + + //列表子表数据model + Map> groupColumnDataMap = mastTable.stream().collect(Collectors.groupingBy(m -> m.getFormMastTableModel().getTable())); + Iterator>> entries = groupColumnDataMap.entrySet().iterator(); + while (entries.hasNext()) { + Map.Entry> formEntries = entries.next(); + Map objectMap = new HashMap<>(); + String className = DataControlUtils.captureName(tableNameRenames.get(formEntries.getKey())); + ColumnListDataModel columnListDataModel = new ColumnListDataModel(); + columnListDataModel.setModelName(className); + columnListDataModel.setModelUpName(DataControlUtils.captureName(className)); + columnListDataModel.setModelLowName(DataControlUtils.initialLowercase(className)); + List allModels = formEntries.getValue(); + allModels.stream().forEach(m -> { + String vModel = m.getFormMastTableModel().getField(); + m.getFormMastTableModel().getMastTable().getFieLdsModel().setVModel(vModel); + }); + List fields = allModels.stream().map(m -> + m.getFormMastTableModel().getField()).collect(Collectors.toList()); + columnListDataModel.setFieldList(fields); + columnListDataModel.setFieLdsModelList(allModels.stream().map(al -> al.getFormMastTableModel()).collect(Collectors.toList())); + columnListDataModel.setTableName(formEntries.getKey()); + formChildList.add(columnListDataModel); + List children = formEntries.getValue().stream().map(allModel -> allModel.getFormMastTableModel().getMastTable()).collect(Collectors.toList()); + //表字段给的范围-转换json + children.forEach(item -> { + item.setFieLdsModel(DataControlUtils.setAbleIDs(item.getFieLdsModel())); + }); + FormColumnTableModel formColumnTableModel = new FormColumnTableModel(); + formColumnTableModel.setChildList(children); + objectMap.put("children", formColumnTableModel); + objectMap.put("genInfo", temModel); + objectMap.put("package", modulePackageName); + objectMap.put("module", model.getAreasName()); + objectMap.put("className", className); + childrenTemplates(FormCommonUtil.getLocalBasePath() + model.getServiceDirectory() + fileName, objectMap, templatePath, className, downloadCodeForm, true); + } + + //子表model + for (int i = 0; i < table.size(); i++) { + FormColumnTableModel childList = table.get(i).getChildList(); + Map objectMap = JsonUtil.entityToMap(childList); + String className = DataControlUtils.captureName(tableNameRenames.get(childList.getTableName())); + //开启导入 + if (allUploadTemplates.size() > 0) { + FieLdsModel fieLdsModel = allUploadTemplates.stream().filter(f -> f.getVModel().equals(childList.getTableModel())).findFirst().orElse(null); + if (fieLdsModel != null) { + List children = fieLdsModel.getConfig().getChildren(); + for (FormColumnModel columnModel : childList.getChildList()) { + String vModel = columnModel.getFieLdsModel().getVModel(); + if (columnModel.getFieLdsModel().getConfig().getRegList() != null) { + String o1 = JSONObject.toJSONString(JsonUtil.getObjectToString(columnModel.getFieLdsModel().getConfig().getRegList())); + columnModel.getFieLdsModel().getConfig().setReg(o1); + } + boolean b = children.stream().anyMatch(c -> c.getVModel().equals(vModel)); + if (b) { + columnModel.getFieLdsModel().setNeedImport(true); + } + } + } + } + //表字段给的范围-转换json + childList.getChildList().forEach(item -> { + item.setFieLdsModel(DataControlUtils.setAbleIDs(item.getFieLdsModel())); + }); + objectMap.put("children", childList); + objectMap.put("genInfo", temModel); + objectMap.put("package", modulePackageName); + objectMap.put("module", model.getAreasName()); + objectMap.put("className", className); + childrenTemplates(FormCommonUtil.getLocalBasePath() + model.getServiceDirectory() + fileName, objectMap, templatePath, className, downloadCodeForm, false); + } + + //界面 + //是否开启行内编辑 + map.put("lineEdit", columnDataModel.getType() == 4); + //是否开启分组表格 + if (columnDataModel.getType() == 3) { + ColumnListModel columnListModel = columnListModelList.get(0); + columnListModel.setFirst(true); + columnListModelList.set(0, columnListModel); + } + + //判断列表是否存在冻结 + boolean none = columnListModelList.stream().anyMatch(c -> "left".equals(c.getFixed()) || "right".equals(c.getFixed())); + map.put("hasFixed", none); + map.put("importFields", allUploadTemplates); + Set set = new HashSet<>(); + List nameAgain = new ArrayList<>(); + for (FieLdsModel f : allUploadTemplates) { + if (!set.add(f.getConfig().getLabel())) { + if (f.getTableType() == 1) { + nameAgain.add(f.getVModel()); + } else { + nameAgain.add(f.getBeforeVmodel()); + } + } + } + map.put("nameAgain", nameAgain); + if (uploaderTemplateModel != null) { + map.put("importIsUpdate", "2".equals(uploaderTemplateModel.getDataType())); + } + map.put("groupTable", columnDataModel.getType() == 3); + //树形同步异步 + if (columnDataModel.getType() == 5) { + columnDataModel.setHasPage(false); + columnDataMap.replace("hasPage", false); + } + map.put("treeTable", columnDataModel.getType() == 5); + map.put("treeLazyType", true); + map.put("parentField", columnDataModel.getParentField()); + map.put("subField", columnDataModel.getSubField()); + //合计 + boolean configurationTotal = columnDataModel.isShowSummary(); + if (columnDataModel.getType() == 3 || columnDataModel.getType() == 5) { + configurationTotal = false; + } + map.put("configurationTotal", configurationTotal); + List summaryList = FormCommonUtil.getSummaryList(columnDataModel.getSummaryField(), columnDataModel.getType()); + map.put("fieldsTotal", JsonUtil.getObjectToString(summaryList)); + + //合计千分位 + List thousandsField = FormCommonUtil.getSummaryThousandList(mast,mastTable, columnDataModel.getType()); + map.put("thousandsField", JsonUtil.getObjectToString(thousandsField)); + + //乐观锁 + map.put("version", formData.getConcurrencyLock()); + map.put("logicalDelete", formData.getLogicalDelete()); + //界面 + map.put("module", downloadCodeForm.getModule()); + map.put("className", DataControlUtils.captureName(model.getClassName())); + map.put("formRef", model.getFormRef()); + map.put("formModel", model.getFormModel()); + map.put("size", model.getSize()); + map.put("labelPosition", model.getLabelPosition()); + map.put("generalWidth", model.getGeneralWidth()); + map.put("fullScreenWidth", model.getFullScreenWidth()); + map.put("drawerWidth", model.getDrawerWidth()); + map.put("formStyle", model.getFormStyle()); + map.put("labelWidth", model.getLabelWidth()); + map.put("formRules", model.getFormRules()); + map.put("gutter", model.getGutter()); + map.put("disabled", model.getDisabled()); + map.put("span", model.getSpan()); + map.put("formBtns", model.getFormBtns()); + map.put("idGlobal", model.getIdGlobal()); + map.put("popupType", model.getPopupType()); + map.put("form", formAllModel); + map.put("columnData", columnDataMap); + map.put("columnDataListFiled", columnListModelList); + map.put("childModels", childModels); + map.put("formModelName", entity.getFullName()); + map.put("flowFormId", entity.getId()); + map.put("searchTypeList", searchListAll); + map.put("searchList", searchList); + map.put("enCode", entity.getEnCode()); + map.put("childTableStyle", columnDataModel.getChildTableStyle()); + map.put("cldColModelList", cldColModelList); + map.put("notChildColList", notChildColList); + map.put("dataType", columnDataModel.getHasPage() ? 0 : 1); + map.put("groupField", columnDataModel.getGroupField()); + if (columnDataModel.getType() == 2) { + map.put("treeRelationField", treeRelationField); + SearchTypeModel searchTypeModel = searchListAll.stream().filter(t -> t.getVModel().equals(treeRelationField)).findFirst().orElse(null); + if (searchTypeModel == null) { + searchTypeModel = new SearchTypeModel(); + searchTypeModel.setVModel(treeRelationField); + searchTypeModel.setSearchType(2); + searchTypeModel.setLabel("tree"); + if (columnDataModel.getTreeDataSource().equals("organize")) { + searchTypeModel.setJnpfKey(JnpfKeyConsts.COMSELECT); + searchTypeModel.setSearchType(1); + } + searchTypeModel.setTableName(mainTableModel.getTable()); + map.put("hasTree", true); + map.put("treeRelation", searchTypeModel); + } + } + + //共用 + map.put("children", child); + map.put("mastTable", mastTable); + map.put("fields", mast); + map.put("columnChildren", formChildList); + pKeyName = pKeyName.toLowerCase().trim().replaceAll("f_", ""); + pKeyName = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, pKeyName); + map.put("pKeyName", pKeyName); + map.put("columnList", columnList); + String modelPathName = downloadCodeForm.getClassName().toLowerCase(); + map.put("modelPathName", modelPathName); + map.put("formModelName", entity.getFullName()); + map.put("isMain", true); + //雪花 + map.put("snowflake", formData.getPrimaryKeyPolicy() == 1); + + //是否开启高级查询 + Boolean hasSuperQuery = columnDataModel.getHasSuperQuery(); + map.put("superQuery", hasSuperQuery); + // 填充moduleId + map.put("moduleId", entity.getId()); + String[] printId = formData.getPrintId() != null ? formData.getPrintId() : new String[]{}; + // 打印模板如果是有多个需要查询标题 + if (printId.length > 1) { + List printOptions = FormCommonUtil.getList(Arrays.asList(printId)); + map.put("printOptions", printOptions); + } + // 打印模板批量的标题 + List printIds = JsonUtil.getJsonToList(columnDataMap.get("printIds"), String.class); + if (printIds != null && printIds.size() > 0) { + List printOptions = FormCommonUtil.getList(printIds); + map.put("printListOptions", printOptions); + } + String printIdAll = String.join(",", printId); + map.put("printId", printIdAll); + + htmlTemplates(FormCommonUtil.getLocalBasePath() + model.getServiceDirectory() + fileName, map, templatePath, columnDataModel.getType(), hasUploadBtn, downloadCodeForm); + + String path = FormCommonUtil.getLocalBasePath() + temModel.getServiceDirectory() + File.separator + fileName; + FlowFormEntity flowFormEntity = FunctionFormPublicUtil.exportFlowFormJson(entity, downloadCodeForm); + SuperQueryUtil.CreateFlowFormJsonFile(JsonUtil.getObjectToString(flowFormEntity), path); + + if (hasSuperQuery) { + String superSqJsPath = path + File.separator + "html" + File.separator + "web" + File.separator + modelPathName + File.separator + "superQueryJson.js"; + String data = columnDataModel.getColumnOptions().replaceAll("\\\\", ""); + SuperQueryUtil.CreateJsFile(data, superSqJsPath, "superQueryJson"); + } + String colData = columnDataModel.getColumnList().replaceAll("\\\\", ""); + String colListJsPath = path + File.separator + "html" + File.separator + "web" + File.separator + modelPathName + File.separator + "columnList.js"; + SuperQueryUtil.CreateJsFile(colData, colListJsPath, "columnList"); + } + + /** + * 获取文件名 + * + * @param path 路径 + * @param template 模板名称 + * @param className 文件名称 + * @return + */ + private static String getFileName(String path, String template, String className, DownloadCodeForm downloadCodeForm) { + //是否微服务路径 + String framePath = FormCommonUtil.getCloudPath("-entity", downloadCodeForm); + String modelPath = XSSEscape.escapePath(path + File.separator + "java" + File.separator + framePath + File.separator + "model" + + File.separator + className.toLowerCase()); + String htmlPath = XSSEscape.escapePath(path + File.separator + "html" + File.separator + "web" + File.separator + className.toLowerCase()); + File htmlfile = new File(htmlPath); + File modelfile = new File(modelPath); + if (!htmlfile.exists()) { + htmlfile.mkdirs(); + } + if (!modelfile.exists()) { + modelfile.mkdirs(); + } + if (template.contains("Form.vue.vm")) { + className = "Form"; + return htmlPath + File.separator + className.toLowerCase().toLowerCase() + ".vue"; + } + if (template.contains("index.vue.vm")) { + className = "index"; + return htmlPath + File.separator + className + ".vue"; + } + if (template.contains("indexEdit.vue.vm")) { + className = "index"; + return htmlPath + File.separator + className + ".vue"; + } + if (template.contains("indexEdit.vue.vm")) { + className = "index"; + return htmlPath + File.separator + className + ".vue"; + } + if (template.contains("ExportBox.vue.vm")) { + className = "ExportBox"; + return htmlPath + File.separator + className + ".vue"; + } + if (template.contains("InfoVO.java.vm")) { + return modelPath + File.separator + className + "InfoVO.java"; + } + if (template.contains("Form.java.vm")) { + return modelPath + File.separator + className + "Form.java"; + } + if (template.contains("ListVO.java.vm")) { + return modelPath + File.separator + className + "ListVO.java"; + } + if (template.contains("GroupVO.java.vm")) { + return modelPath + File.separator + className + "GroupVO.java"; + } + if (template.contains("Pagination.java.vm")) { + return modelPath + File.separator + className + "Pagination.java"; + } + if (template.contains("ExcelVO.java.vm")) { + return modelPath + File.separator + className + "ExcelVO.java"; + } + if (template.contains("ExcelErrorVO.java.vm")) { + return modelPath + File.separator + className + "ExcelErrorVO.java"; + } + return null; + } + + /** + * 界面的模板 + * + * @param template 模板集合 + * @return + */ + private static List getTemplates(String template, int type, boolean hasImport) { + List templates = new ArrayList<>(); + //前端页面 + if (type == 4) { + templates.add(template + File.separator + "html" + File.separator + "indexEdit.vue.vm"); + } else { + templates.add(template + File.separator + "html" + File.separator + "index.vue.vm"); + } + templates.add(template + File.separator + "html" + File.separator + "Form.vue.vm"); + templates.add(template + File.separator + "html" + File.separator + "ExportBox.vue.vm"); + templates.add(template + File.separator + "java" + File.separator + "InfoVO.java.vm"); + templates.add(template + File.separator + "java" + File.separator + "Form.java.vm"); + templates.add(template + File.separator + "java" + File.separator + "ListVO.java.vm"); + if (type == 3) { + templates.add(template + File.separator + "java" + File.separator + "GroupVO.java.vm"); + } + if (hasImport) { + templates.add(template + File.separator + "java" + File.separator + "ExcelVO.java.vm"); + templates.add(template + File.separator + "java" + File.separator + "ExcelErrorVO.java.vm"); + } + templates.add(template + File.separator + "java" + File.separator + "Pagination.java.vm"); + return templates; + } + + /** + * 渲染html模板 + * + * @param path 路径 + * @param object 模板数据 + * @param templatePath 模板路径 + */ + private static void htmlTemplates(String path, Map object, String templatePath, int type, boolean hasImport, DownloadCodeForm downloadCodeForm) throws Exception { + List templates = getTemplates(templatePath, type, hasImport); + //界面模板 + VelocityContext context = new VelocityContext(); + context.put("context", object); + for (String template : templates) { + try { + // 渲染模板 + @Cleanup StringWriter sw = new StringWriter(); + Template tpl; + if (template.contains("index.vue.vm") && type == 4) { + String s = template.replace("index", "indexEdit"); + tpl = Velocity.getTemplate(s, Constants.UTF_8); + } else { + tpl = Velocity.getTemplate(template, Constants.UTF_8); + } + tpl.merge(context, sw); + String className = object.get("className").toString(); + String fileNames = getFileName(path, template, className, downloadCodeForm); + if (fileNames != null) { + File file = new File(XSSEscape.escapePath(fileNames)); + if (!file.exists()) { + file.createNewFile(); + } + @Cleanup FileOutputStream fos = new FileOutputStream(file); + IOUtils.write(sw.toString(), fos, Constants.UTF_8); + IOUtils.closeQuietly(sw); + IOUtils.closeQuietly(fos); + } + } catch (IOException e) { + e.printStackTrace(); + System.out.println("渲染模板失败,表名:" + e); + } + } + } + + public static String getChildrenFileName(String dirNames, String template, String className) { + String finallyPath = ""; + if (template.contains("Model.java.vm")) { + finallyPath = dirNames + File.separator + className + "Model.java"; + } else if (template.contains("ListVO.java.vm")) { + finallyPath = dirNames + File.separator + className + "ListVO.java"; + } + return finallyPath; + } + + /** + * 渲染html模板 + * + * @param path 路径 + * @param object 模板数据 + * @param templatePath 模板路径 + */ + private static void childrenTemplates(String path, Map object, String templatePath, String className, DownloadCodeForm downloadCodeForm, Boolean isChild) { + //是否微服务路径 + String framePath = FormCommonUtil.getCloudPath("-entity", downloadCodeForm); + String model = downloadCodeForm.getClassName(); + List templates = new ArrayList<>(); + templates.add(templatePath + File.separator + "java" + File.separator + "Model.java.vm"); + if (isChild) { + templates.add(templatePath + File.separator + "java" + File.separator + "ListVO.java.vm"); + } + //界面模板 + VelocityContext context = new VelocityContext(); + context.put("context", object); + for (String template : templates) { + try { + // 渲染模板 + @Cleanup StringWriter sw = new StringWriter(); + Template tpl = Velocity.getTemplate(template, Constants.UTF_8); + tpl.merge(context, sw); + String dirNames = path + File.separator + "java" + File.separator + framePath + File.separator + "model" + File.separator + model.toLowerCase(); + String fileNames = getChildrenFileName(dirNames, template, className); + if (fileNames != null) { + File file = new File(XSSEscape.escapePath(fileNames)); + if (!file.exists()) { + File dirFile = new File(XSSEscape.escapePath(dirNames)); + if (!dirFile.exists()) { + dirFile.mkdirs(); + } + file.createNewFile(); + } + @Cleanup FileOutputStream fos = new FileOutputStream(file); + IOUtils.write(sw.toString(), fos, Constants.UTF_8); + IOUtils.closeQuietly(sw); + IOUtils.closeQuietly(fos); + } + } catch (IOException e) { + e.printStackTrace(); + System.out.println("渲染模板失败,表名:" + e); + } + } + } + //-------------------------代码---------------------------------- + + /** + * 生成主表 + * + * @param path 路径 + * @param fileName 文件夹名称 + * @param downloadCodeForm 文件名称 + * @param entity 实体 + * @param userInfo 用户 + * @param configValueUtil 下载路径 + */ + private static void setCode(String path, String fileName, String templatePath, DownloadCodeForm downloadCodeForm, VisualdevEntity entity, + UserInfo userInfo, ConfigValueUtil configValueUtil, DbLinkEntity linkEntity) throws SQLException { + //自定义包名 + String modulePackageName = downloadCodeForm.getModulePackageName(); + //tableJson + List tableModelList = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + //主表 + TableModel mainTable = tableModelList.stream().filter(t -> t.getTypeId().equals("1")).findFirst().orElse(null); + + //获取主表主键 + String pKeyName = VisualUtils.getpKey(linkEntity, mainTable.getTable()).toLowerCase().trim().replaceAll("f_", ""); + pKeyName = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, pKeyName); + + //赋值主键 + tableModelList.stream().forEach(t -> { + try { + t.setTableKey(VisualUtils.getpKey(linkEntity, t.getTable())); + } catch (SQLException sqlException) { + sqlException.printStackTrace(); + } + }); + Map columndata = new HashMap<>(16); + Template7Model model = new Template7Model(); + model.setTableName(downloadCodeForm.getClassName()); + model.setClassName(DataControlUtils.captureName(downloadCodeForm.getClassName())); + model.setServiceDirectory(FormCommonUtil.getPath(FileTypeConstant.CODETEMP)); + model.setCreateDate(DateUtil.daFormat(new Date())); + model.setCreateUser(GenBaseInfo.AUTHOR); + model.setCopyright(GenBaseInfo.COPYRIGHT); + model.setDescription(downloadCodeForm.getDescription()); + + //columnTempJson + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(entity.getColumnData(), ColumnDataModel.class); + //app 列表对象 + ColumnDataModel appColumnDataModel = JsonUtil.getJsonToBean(entity.getAppColumnData(), ColumnDataModel.class); + + //按钮 + List btnDataList = JsonUtil.getJsonToList(columnDataModel.getBtnsList(), BtnData.class); + List columnBtnDataList = JsonUtil.getJsonToList(columnDataModel.getColumnBtnsList(), BtnData.class); + //是否有导入按钮 + boolean hasUploadBtn = btnDataList.stream().anyMatch(btn -> btn.getValue().equals("upload")); + + List columnList = JsonUtil.getJsonToList(columnDataModel.getColumnList(), ColumnListField.class); + List searchList = JsonUtil.getJsonToList(columnDataModel.getSearchList(), FieLdsModel.class); + + //权限 + AuthorityModel authority = new AuthorityModel(); + BeanUtil.copyProperties(columnDataModel, authority); + + //取对应表的别名 + Map tableNameRenames = FunctionFormPublicUtil.tableNameRename(downloadCodeForm, tableModelList); + + //子表集合 + List childTableNameList = new ArrayList<>(); + //全部表 + List allTableNameList = new ArrayList<>(); + + //formTempJson + FormDataModel formData = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + + List tableModelFields = new ArrayList<>(); + FunctionFormPublicUtil.getTableModels(list, tableModelFields); + + List formAllModel = new ArrayList<>(); + RecursionForm recursionForm = new RecursionForm(); + recursionForm.setTableModelList(JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class)); + recursionForm.setList(list); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + //主表数据 + List mast = formAllModel.stream().filter(t -> FormEnum.mast.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + List table = formAllModel.stream().filter(t -> FormEnum.table.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + //列表子表数据 + List mastTable = formAllModel.stream().filter(t -> FormEnum.mastTable.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + + List subTableName = new ArrayList<>(); + for (FormAllModel allModel : table) { + FormColumnTableModel childList = allModel.getChildList(); + if (childList != null) { + subTableName.add(childList.getTableName()); + } + } + + for (TableModel tableModel : tableModelList) { + TableModel Model = new TableModel(); + Model.setInitName(tableModel.getTable()); + Model.setTable(tableNameRenames.get(tableModel.getTable())); + Model.setTableField(DataControlUtils.captureName(tableModel.getTableField())); + if (Model.getTable().equals(mainTable.getTable())) { + Model.setTableTag("main"); + } else { + Model.setTableTag(subTableName.contains(Model.getTable()) ? "sub" : "sub-jnpf"); + } + allTableNameList.add(Model); + if ("0".equals(tableModel.getTypeId())) { + childTableNameList.add(Model); + } + } + //子表(tableField,tableName) + Map childKeyTableNameMap = new HashMap<>(8); + table.stream().forEach(t -> childKeyTableNameMap.put(t.getChildList().getTableModel(), t.getChildList().getTableName())); + + String treeRelationField = columnDataModel.getTreeRelation().replaceAll("-", "_"); + + //查询条件 + List jnpfkey = new ArrayList() {{ + add(JnpfKeyConsts.COM_INPUT); + add(JnpfKeyConsts.TEXTAREA); + }}; + List searchTypeModelList = new ArrayList<>(); + searchList.stream().forEach(fieLdsModel -> { + SearchTypeModel searchTypeModel = new SearchTypeModel(); + searchTypeModel.setJnpfKey(fieLdsModel.getConfig().getJnpfKey()); + Integer seachType = fieLdsModel.getSearchType(); + if (jnpfkey.contains(searchTypeModel.getJnpfKey()) && seachType.equals(3)) { + seachType = 2; + } + searchTypeModel.setSearchType(seachType); + String vModel = fieLdsModel.getVModel(); + vModel = vModel.replaceAll("-", "_"); + searchTypeModel.setVModel(vModel); + searchTypeModel.setLabel(fieLdsModel.getConfig().getLabel()); + searchTypeModel.setFormat(fieLdsModel.getFormat()); + searchTypeModel.setMultiple((String.valueOf(fieLdsModel.getSearchMultiple()))); + searchTypeModelList.add(searchTypeModel); + }); + TableModel mainTableModel = tableModelList.stream().filter(t -> t.getTypeId().equals("1")).findFirst().orElse(null); + if (columnDataModel.getType() == 2) { + SearchTypeModel searchTypeModel = searchTypeModelList.stream().filter(t -> t.getVModel().equals(treeRelationField)).findFirst().orElse(null); + if (searchTypeModel == null) { + searchTypeModel = new SearchTypeModel(); + searchTypeModel.setVModel(treeRelationField); + searchTypeModel.setSearchType(2); + if (columnDataModel.getTreeDataSource().equals("organize")) { + searchTypeModel.setJnpfKey(JnpfKeyConsts.COMSELECT); + searchTypeModel.setSearchType(1); + } + searchTypeModel.setLabel("tree"); + searchTypeModel.setTableName(mainTableModel.getTable()); + searchTypeModelList.add(searchTypeModel); + } + } + + List groupModels = new ArrayList<>(); + if (searchTypeModelList.size() > 0) { + for (TableFields tableFields : mainTableModel.getFields()) { + searchTypeModelList.stream().forEach(searchTypeModel -> { + if (searchTypeModel.getVModel().equals(tableFields.getField())) { + searchTypeModel.setDataType(tableFields.getDataType()); + } + }); + } + //鉴别列表子表正则 + String reg = "^[jnpf_]\\S*_jnpf\\S*"; + searchTypeModelList.stream().filter(s -> s.getVModel().matches(reg)).forEach(cl -> { + String s = cl.getVModel(); + String s1 = s.substring(s.lastIndexOf("jnpf_")).replace("jnpf_", ""); + String s2 = s.substring(s.indexOf("_") + 1, s.lastIndexOf("_jnpf")); + cl.setAfterVModel(s1); + cl.setTableName(s2); + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equalsIgnoreCase(s2)).findFirst().orElse(null); + cl.setDataType(tableModel.getFields().stream().filter(t -> t.getField().equalsIgnoreCase(s1)).findFirst().orElse(null).getDataType()); + } + ); + //逻辑查询条件 + Map> collect = searchTypeModelList.stream().filter(s -> s.getVModel().matches(reg)).collect(Collectors.groupingBy(t -> t.getTableName())); + groupModels = collect.entrySet().stream().map(c -> { + ListSearchGroupModel groupModel = new ListSearchGroupModel(); + groupModel.setModelName(tableNameRenames.get(c.getKey())); + groupModel.setTableName(c.getKey()); + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equalsIgnoreCase(c.getKey())).findFirst().orElse(null); + groupModel.setForeignKey(tableModel.getTableField()); + groupModel.setMainKey(tableModel.getRelationField()); + groupModel.setSearchTypeModelList(c.getValue()); + return groupModel; + } + ).collect(Collectors.toList()); + + //子表 + Map> collect1 = searchTypeModelList.stream().filter(s -> s.getVModel().toLowerCase().contains(JnpfKeyConsts.CHILD_TABLE_PREFIX)) + .collect(Collectors.groupingBy(t -> t.getVModel().substring(0, t.getVModel().lastIndexOf("_")))); + List collect2 = collect1.entrySet().stream().map(c -> { + ListSearchGroupModel groupModel = new ListSearchGroupModel(); + String tableName = childKeyTableNameMap.get(c.getKey()); + groupModel.setModelName(tableNameRenames.get(tableName)); + groupModel.setTableName(tableName); + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equalsIgnoreCase(tableName)).findFirst().orElse(null); + groupModel.setForeignKey(tableModel.getTableField()); + groupModel.setMainKey(tableModel.getRelationField()); + List value = c.getValue(); + value.stream().forEach(v -> { + String vModel = v.getVModel(); + String substring = vModel.substring(vModel.lastIndexOf("_") + 1); + v.setAfterVModel(substring); + }); + groupModel.setSearchTypeModelList(value); + return groupModel; + } + ).collect(Collectors.toList()); + groupModels.addAll(collect2); + + ListSearchGroupModel groupModel = new ListSearchGroupModel(); + groupModel.setSearchTypeModelList(searchTypeModelList.stream().filter(s -> + !s.getVModel().matches(reg) && !s.getVModel().toLowerCase().contains(JnpfKeyConsts.CHILD_TABLE_PREFIX)).collect(Collectors.toList())); + groupModel.setTableName(mainTable.getTable()); + groupModel.setModelName(tableNameRenames.get(mainTable.getTable())); + groupModels.add(groupModel); + } + + //-----------------------------------------------------app state------------------------------------------ + //查询条件 + List searchAppList = JsonUtil.getJsonToList(appColumnDataModel.getSearchList(), FieLdsModel.class); + List searchTypeAppModelList = new ArrayList<>(); + searchAppList.stream().forEach(fieLdsModel -> { + SearchTypeModel searchTypeModel = new SearchTypeModel(); + searchTypeModel.setJnpfKey(fieLdsModel.getConfig().getJnpfKey()); + Integer seachType = fieLdsModel.getSearchType(); + if (jnpfkey.contains(searchTypeModel.getJnpfKey()) && seachType.equals(3)) { + seachType = 2; + } + searchTypeModel.setSearchType(seachType); + String vModel = fieLdsModel.getVModel(); + vModel = vModel.replaceAll("-", "_"); + searchTypeModel.setVModel(vModel); + searchTypeModel.setLabel(fieLdsModel.getConfig().getLabel()); + searchTypeModel.setFormat(fieLdsModel.getFormat()); + searchTypeModel.setMultiple((String.valueOf(fieLdsModel.getSearchMultiple()))); + searchTypeAppModelList.add(searchTypeModel); + }); + + + List groupAppModels = new ArrayList<>(); + if (searchTypeAppModelList.size() > 0) { + //主表 + for (TableFields tableFields : mainTableModel.getFields()) { + searchTypeAppModelList.stream().forEach(searchTypeModel -> { + if (searchTypeModel.getVModel().equals(tableFields.getField())) { + searchTypeModel.setDataType(tableFields.getDataType()); + } + }); + } + //鉴别列表子表正则 + String reg = "^[jnpf_]\\S*_jnpf\\S*"; + searchTypeAppModelList.stream().filter(s -> s.getVModel().matches(reg)).forEach(cl -> { + String s = cl.getVModel(); + String s1 = s.substring(s.lastIndexOf("jnpf_")).replace("jnpf_", ""); + String s2 = s.substring(s.indexOf("_") + 1, s.lastIndexOf("_jnpf")); + cl.setAfterVModel(s1); + cl.setTableName(s2); + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equalsIgnoreCase(s2)).findFirst().orElse(null); + cl.setDataType(tableModel.getFields().stream().filter(t -> t.getField().equalsIgnoreCase(s1)).findFirst().orElse(null).getDataType()); + } + ); + //副表 + Map> collect = searchTypeAppModelList.stream().filter(s -> s.getVModel().matches(reg)).collect(Collectors.groupingBy(t -> t.getTableName())); + groupAppModels = collect.entrySet().stream().map(c -> { + ListSearchGroupModel groupModel = new ListSearchGroupModel(); + groupModel.setModelName(tableNameRenames.get(c.getKey())); + groupModel.setTableName(c.getKey()); + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equalsIgnoreCase(c.getKey())).findFirst().orElse(null); + groupModel.setForeignKey(tableModel.getTableField()); + groupModel.setMainKey(tableModel.getRelationField()); + groupModel.setSearchTypeModelList(c.getValue()); + return groupModel; + } + ).collect(Collectors.toList()); + + //子表 + Map> collect1 = searchTypeAppModelList.stream().filter(s -> s.getVModel().toLowerCase().contains(JnpfKeyConsts.CHILD_TABLE_PREFIX)) + .collect(Collectors.groupingBy(t -> t.getVModel().substring(0, t.getVModel().lastIndexOf("_")))); + List collect2 = collect1.entrySet().stream().map(c -> { + ListSearchGroupModel groupModel = new ListSearchGroupModel(); + String tableName = childKeyTableNameMap.get(c.getKey()); + groupModel.setModelName(tableNameRenames.get(tableName)); + groupModel.setTableName(tableName); + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equalsIgnoreCase(tableName)).findFirst().orElse(null); + groupModel.setForeignKey(tableModel.getTableField()); + groupModel.setMainKey(tableModel.getRelationField()); + List value = c.getValue(); + value.stream().forEach(v -> { + String vModel = v.getVModel(); + String substring = vModel.substring(vModel.lastIndexOf("_") + 1); + v.setAfterVModel(substring); + }); + groupModel.setSearchTypeModelList(value); + return groupModel; + } + ).collect(Collectors.toList()); + groupAppModels.addAll(collect2); + + ListSearchGroupModel groupModel = new ListSearchGroupModel(); + groupModel.setSearchTypeModelList(searchTypeAppModelList.stream().filter(s -> + !s.getVModel().matches(reg) && !s.getVModel().toLowerCase().contains(JnpfKeyConsts.CHILD_TABLE_PREFIX)).collect(Collectors.toList())); + groupModel.setTableName(mainTable.getTable()); + groupModel.setModelName(tableNameRenames.get(mainTable.getTable())); + groupAppModels.add(groupModel); + } + + //-----------------------------------------------------app end------------------------------------------ + + + //表单子表模型 + List formChildList = new ArrayList<>(); + + //列表子表数据model + Map> groupColumnDataMap = mastTable.stream().collect(Collectors.groupingBy(m -> m.getFormMastTableModel().getTable())); + Iterator>> entries = groupColumnDataMap.entrySet().iterator(); + while (entries.hasNext()) { + Map.Entry> formEntries = entries.next(); + String className = DataControlUtils.captureName(tableNameRenames.get(formEntries.getKey())); + ColumnListDataModel columnListDataModel = new ColumnListDataModel(); + columnListDataModel.setModelName(className); + columnListDataModel.setModelUpName(DataControlUtils.captureName(className)); + columnListDataModel.setModelLowName(DataControlUtils.initialLowercase(className)); + List allModels = formEntries.getValue(); + List fields = allModels.stream().map(m -> + m.getFormMastTableModel().getField()).collect(Collectors.toList()); + columnListDataModel.setFieldList(fields); + columnListDataModel.setFieLdsModelList(allModels.stream().map(al -> al.getFormMastTableModel()).collect(Collectors.toList())); + columnListDataModel.setTableName(formEntries.getKey()); + + List collect = allModels.stream().map(all -> all.getFormMastTableModel().getMastTable().getFieLdsModel()).collect(Collectors.toList()); + collect.stream().forEach(c -> { + String vmodel = c.getVModel().substring(c.getVModel().lastIndexOf("jnpf_")).replace("jnpf_", ""); + c.setVModel(vmodel); + List templateJson = c.getConfig().getTemplateJson(); + String json = templateJson.size() > 0 ? JSONObject.toJSONString(JsonUtil.getObjectToString(templateJson)) + : JSONObject.toJSONString(JsonUtil.getObjectToString(JsonUtil.getJsonToList(c.getTemplateJson(), TemplateJsonModel.class))); + c.setTemplateJson(json); + }); + columnListDataModel.setFieLdsModels(collect); + formChildList.add(columnListDataModel); + } + + formChildList.stream().forEach(f -> { + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equalsIgnoreCase(f.getTableName())).findFirst().orElse(null); + if (ObjectUtil.isNotEmpty(tableModel)) { + f.setMainKey(tableModel.getRelationField()); + f.setRelationField(tableModel.getTableField()); + f.setMainUpKey(DataControlUtils.captureName(tableModel.getRelationField())); + f.setRelationUpField(DataControlUtils.captureName(tableModel.getTableField())); + String tableKey = tableModel.getTableKey().toLowerCase().replace("f_", ""); + tableKey = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, tableKey); + f.setMainField(DataControlUtils.captureName(tableKey)); + } + }); + + //主表的字段 + Optional first = tableModelList.stream().filter(t -> "1".equals(t.getTypeId())).findFirst(); + if (!first.isPresent()) { + throw new SQLException(MsgCode.COD001.get()); + } + String tableName = first.get().getTable(); + String billNo = ""; + List system = new ArrayList<>(); + for (int i = 0; i < mast.size(); i++) { + FormAllModel mastModel = mast.get(i); + FieLdsModel fieLdsModel = mastModel.getFormColumnModel().getFieLdsModel(); + if (StringUtil.isNotEmpty(fieLdsModel.getVModel())) { + List templateJson = fieLdsModel.getConfig().getTemplateJson(); + String json = templateJson.size() > 0 ? JSONObject.toJSONString(JsonUtil.getObjectToString(templateJson)) + : JSONObject.toJSONString(JsonUtil.getObjectToString(JsonUtil.getJsonToList(fieLdsModel.getTemplateJson(), TemplateJsonModel.class))); + fieLdsModel.setTemplateJson(json); + system.add(fieLdsModel); + } + } + + + //子表的属性 + List> child = new ArrayList<>(); + for (int i = 0; i < table.size(); i++) { + FormColumnTableModel childList = table.get(i).getChildList(); + List childListAll = childList.getChildList(); + for (FormColumnModel columnModel : childListAll) { + FieLdsModel fieLdsModel = columnModel.getFieLdsModel(); + List templateJson = fieLdsModel.getConfig().getTemplateJson(); + String json = templateJson.size() > 0 ? JSONObject.toJSONString(JsonUtil.getObjectToString(templateJson)) + : JSONObject.toJSONString(JsonUtil.getObjectToString(JsonUtil.getJsonToList(fieLdsModel.getTemplateJson(), TemplateJsonModel.class))); + fieLdsModel.setTemplateJson(json); + } + String className = DataControlUtils.captureName(tableNameRenames.get(childList.getTableName())); + childList.setAliasClassName(className); + Map childs = JsonUtil.entityToMap(childList); + Optional first1 = tableModelList.stream().filter(t -> t.getTable().equals(childList.getTableName())).findFirst(); + if (!first1.isPresent()) { + throw new SQLException(MsgCode.COD001.get()); + } + TableModel tableModel = first1.get(); + //获取主表主键 + String chidKeyName = VisualUtils.getpKey(linkEntity, tableModel.getTable()); + String tableField = tableModel.getTableField().trim().replaceAll(":\"f_" , ":\"" ); + childs.put("tableField" , tableField); + String relationField = tableModel.getRelationField().trim().replaceAll(":\"f_" , ":\"" ); + childs.put("relationField" , relationField); + childs.put("className" , className); + String chidKeyField = chidKeyName.trim().toLowerCase().replaceAll("f_" , "" ); + chidKeyField = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, chidKeyField); + childs.put("chidKeyName", chidKeyField); + child.add(childs); + } + + //导入字段 + List allUploadTemplates = new ArrayList<>(); + boolean imHasChildren = false; + UploaderTemplateModel uploaderTemplateModel = JsonUtil.getJsonToBean(columnDataModel.getUploaderTemplateJson(), UploaderTemplateModel.class); + if (hasUploadBtn && uploaderTemplateModel != null && uploaderTemplateModel.getSelectKey() != null) { + List cols = new ArrayList<>(); + for (String upload : uploaderTemplateModel.getSelectKey()) { + ColumnChildListModel columnChildListModel = new ColumnChildListModel(); + String tableField; + String vModel; + ColumnListField field = columnList.stream().filter(c -> c.getProp().equals(upload)).findFirst().orElse(new ColumnListField()); + String label = field.getConfig() != null ? field.getConfig().getLabel() : ""; + if (upload.toLowerCase().startsWith(JnpfKeyConsts.CHILD_TABLE_PREFIX)) { + tableField = upload.substring(0, upload.indexOf("-")); + vModel = upload.substring(upload.indexOf("-") + 1); + imHasChildren = true; + } else if (upload.toLowerCase().startsWith("jnpf_")) { + List masField = mastTable.stream().map(m -> m.getFormMastTableModel().getMastTable().getFieLdsModel()).collect(Collectors.toList()); + FieLdsModel masF = masField.stream().filter(mas -> + upload.substring(upload.lastIndexOf("jnpf_") + 5) + .equals(mas.getVModel()) + ).findFirst().orElse(new FieLdsModel()); + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equals(masF.getConfig().getTableName())).findFirst().orElse(null); + masF.setRelationTableForeign(tableModel.getTableField()); + masF.setMainTableId(tableModel.getRelationField()); + String name = tableModel.getTableKey().toLowerCase().replaceAll("f_", ""); + masF.setChildMainKey(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, name)); + masF.setTableType(1); + masF.setBeforeVmodel(upload); + allUploadTemplates.add(masF); + tableField = ""; + vModel = upload; + } else { + tableField = ""; + vModel = upload; + List mastField = mast.stream().map(m -> m.getFormColumnModel().getFieLdsModel()).collect(Collectors.toList()); + FieLdsModel mastF = mastField.stream().filter(mas -> mas.getVModel().equals(upload)).findFirst().orElse(new FieLdsModel()); + mastF.setTableType(0); + allUploadTemplates.add(mastF); + } + columnChildListModel.setTableField(tableField); + columnChildListModel.setLabel(label); + columnChildListModel.setVModel(vModel); + cols.add(columnChildListModel); + } + Map> improtCollect = cols.stream().filter(col -> + StringUtil.isNotEmpty(col.getTableField())).collect(Collectors.groupingBy(ColumnChildListModel::getTableField)); + for (Map.Entry> m : improtCollect.entrySet()) { + String tableFiled = m.getKey(); + FieLdsModel fieLdsModel = tableModelFields.stream().filter(t -> t.getVModel().equals(tableFiled)).findFirst().orElse(null); + List children = fieLdsModel.getConfig().getChildren(); + List chlidFields = new ArrayList<>(); + String tableName1 = fieLdsModel.getConfig().getTableName(); + fieLdsModel.getConfig().setAliasClassName(tableNameRenames.get(tableName1)); + for (ColumnChildListModel columnChildListModel : m.getValue()) { + FieLdsModel fieLdsModel2 = children.stream().filter(ch -> ch.getVModel().equals(columnChildListModel.getVModel())).findFirst().orElse(null); + chlidFields.add(fieLdsModel2); + } + fieLdsModel.getConfig().setChildren(chlidFields); + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equals(fieLdsModel.getConfig().getTableName())).findFirst().orElse(null); + fieLdsModel.setRelationTableForeign(tableModel.getTableField()); + fieLdsModel.setMainTableId(tableModel.getRelationField()); + String tableKey = tableModel.getTableKey(); + String name = tableKey.toLowerCase().replaceAll("f_", ""); + fieLdsModel.setChildMainKey(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, name)); + fieLdsModel.setTableType(2); + allUploadTemplates.add(fieLdsModel); + } + } + + //树形列表参数 + if (columnDataModel.getType() == 5) { + columnDataModel.setHasPage(false); + } + String parentField = StringUtil.isNotEmpty(columnDataModel.getParentField()) ? + columnDataModel.getParentField() : ""; + if (StringUtil.isNotEmpty(parentField)) { + parentField = parentField.substring(0, 1).toUpperCase() + parentField.substring(1); + } + String subField = StringUtil.isNotEmpty(columnDataModel.getSubField()) ? + columnDataModel.getSubField() : ""; + if (StringUtil.isNotEmpty(subField)) { + subField = subField.substring(0, 1).toUpperCase() + subField.substring(1); + } + + //导出字段属性转换 + List listOptions = new ArrayList<>(); + columnList.forEach(item -> { + ColumnListField columnListField = new ColumnListField(); + BeanUtil.copyProperties(item, columnListField); + if (item.getVModel().toLowerCase().startsWith(JnpfKeyConsts.CHILD_TABLE_PREFIX)) { + columnListField.setTableType(2); + columnListField.setVModel(item.getVModel().split("-")[1]); + } else if (item.getVModel().toLowerCase().contains("_jnpf_")) { + columnListField.setTableType(1); + columnListField.setVModel(item.getVModel().split("_jnpf_")[1]); + } else { + columnListField.setTableType(0); + } + if ("static".equals(item.getConfig().getDataType())) { + columnListField.setOptions(JsonUtil.getObjectToString(item.getOptions())); + if (item.getJnpfKey().equals(JnpfKeyConsts.CHECKBOX)) { + columnListField.setMultiple(true); + } + } + listOptions.add(columnListField); + }); + + columndata.put("treeTable" , columnDataModel.getType() == 5); + columndata.put("treeLazyType" , true); + columndata.put("parentField" , parentField); + columndata.put("subField" , subField); + columndata.put("dbLink" , entity.getDbLinkId()); + + //后台 + columndata.put("importFields", allUploadTemplates); + columndata.put("importHasChildren", imHasChildren); + columndata.put("module", downloadCodeForm.getModule()); + columndata.put("genInfo", model); + columndata.put("modelName", model.getClassName()); + columndata.put("typeId", 1); + columndata.put("system", system); + columndata.put("child", child); + columndata.put("billNo", billNo); + columndata.put("pKeyName", pKeyName); + columndata.put("fieldsSize", system.size()); + columndata.put("btnsList", btnDataList); + columndata.put("searchList", searchList); + columndata.put("columnList", columnList); + columndata.put("listOptions", listOptions); + columndata.put("hasPage", columnDataModel.getHasPage()); + columndata.put("VisualDevId", entity.getId()); + columndata.put("main", true); + columndata.put("defaultSidx", columnDataModel.getDefaultSidx()); + columndata.put("sort", columnDataModel.getSort()); + columndata.put("searchTypeModelList", searchTypeModelList); + columndata.put("columnBtnsList", columnBtnDataList); + columndata.put("mast", mast); + columndata.put("childtable", table); + columndata.put("authority", authority); + //微服务标识 + columndata.put("isCloud", FormCommonUtil.IS_CLOUD); + //app pc 数据权限是否开启 + columndata.put("pcDataPermisson", columnDataModel.getUseDataPermission()); + columndata.put("appDataPermisson", appColumnDataModel.getUseDataPermission()); + columndata.put("columnChildren", formChildList); + columndata.put("groupModels", groupModels); + columndata.put("groupAppModels", groupAppModels); + columndata.put("childTableNameList", childTableNameList); + columndata.put("allTableNameList", allTableNameList); + columndata.put("superQuery", columnDataModel.getHasSuperQuery()); + columndata.put("groupTable", columnDataModel.getType() == 3); + columndata.put("groupField", columnDataModel.getGroupField()); + columndata.put("lineEdit", columnDataModel.getType() == 4); + columndata.put("formModelName", entity.getFullName()); + //乐观锁 + columndata.put("version", formData.getConcurrencyLock()); + //删除标志 + columndata.put("logicalDelete", formData.getLogicalDelete()); + //雪花 + columndata.put("snowflake", formData.getPrimaryKeyPolicy() == 1); + //微服务标识 + columndata.put("isCloud", FormCommonUtil.IS_CLOUD); + // 是否存在列表子表数据 + columndata.put("hasSub", groupColumnDataMap.size() > 0 ? true : false); + // 是否存在过滤条件 + columndata.put("hasFilter", false); + List ruleList = JsonUtil.getJsonToList(columnDataModel.getRuleList(), Map.class); + if (ruleList != null && ruleList.size() > 0) { + columndata.put("hasFilter", true); + } + columndata.put("hasAppFilter",false); + List ruleListApp = JsonUtil.getJsonToList(appColumnDataModel.getRuleListApp(), Map.class); + if(ruleListApp!=null && ruleListApp.size()>0){ + columndata.put("hasAppFilter",true); + } + + if (ObjectUtil.isNotEmpty(linkEntity)) { + columndata.put("DS", linkEntity.getFullName()); + } + CustomGenerator mpg = new CustomGenerator(columndata); + // 全局配置 + GlobalConfig gc = new GlobalConfig(); + gc.setFileOverride(true); + // 不需要ActiveRecord特性的请改为false + gc.setActiveRecord(false); + // XML 二级缓存 + gc.setEnableCache(false); + // XML ResultMap + gc.setBaseResultMap(false); + // XML columList + gc.setBaseColumnList(false); + gc.setAuthor(userInfo.getUserName() + "/" + userInfo.getUserAccount()); + gc.setOpen(false); + + // 自定义文件命名,注意 %s 会自动填充表实体属性! + gc.setEntityName(model.getClassName() + GenFileNameSuffix.ENTITY); + gc.setMapperName(model.getClassName() + GenFileNameSuffix.MAPPER); + gc.setXmlName(model.getClassName() + GenFileNameSuffix.MAPPER_XML); + gc.setServiceName(model.getClassName() + GenFileNameSuffix.SERVICE); + gc.setServiceImplName(model.getClassName() + GenFileNameSuffix.SERVICEIMPL); + gc.setControllerName(model.getClassName() + GenFileNameSuffix.CONTROLLER); + mpg.setGlobalConfig(gc); + + // 数据源配置 + DataSourceConfig dsc = SourceUtil.dbConfig(TenantDataSourceUtil.getTenantSchema(), linkEntity); + mpg.setDataSource(dsc); + //数据库类型 + columndata.put("dbType", dsc.getDbType().getDb()); + + // 策略配置 + StrategyConfig strategy = new StrategyConfig(); + strategy.setEntityLombokModel(true); + // 表名生成策略 + strategy.setNaming(NamingStrategy.underline_to_camel); + // 需要生成的表 + strategy.setInclude(tableName); + strategy.setRestControllerStyle(true); + mpg.setStrategy(strategy); + + // 包配置 + PackageConfig pc = new PackageConfig(); + pc.setParent(modulePackageName); + mpg.setPackageInfo(pc); + // 包名 + columndata.put("modulePackageName", modulePackageName); + + // 自定义配置 + InjectionConfig cfg = new InjectionConfig() { + @Override + public void initMap() { + // to do nothing + } + }; + List focList = new ArrayList<>(); + String javaPath = FormCommonUtil.getLocalBasePath() + model.getServiceDirectory(); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "Controller.java.vm", "controller", false)); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "Entity.java.vm", "entity", formData.getConcurrencyLock())); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "Mapper.java.vm", "mapper", false)); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "Mapper.xml.vm", "xml", false)); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "Service.java.vm", "service", false)); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "ServiceImpl.java.vm", "impl", false)); + + cfg.setFileOutConfigList(focList); + mpg.setTemplate(new TemplateConfig().setXml(null).setMapper(null).setController(null).setEntity(null).setService(null).setServiceImpl(null)); + mpg.setCfg(cfg); + // 执行生成 + mpg.execute(path); + } + + + /** + * 生成子表 + * + * @param path 路径 + * @param fileName 文件夹名称 + * @param table 子表 + * @param userInfo 用户 + * @param configValueUtil 下载路径 + */ + private static void childTable(String path, String fileName, String templatePath, VisualdevEntity entity, DownloadCodeForm downloadCodeForm, String table, + UserInfo userInfo, ConfigValueUtil configValueUtil, DbLinkEntity linkEntity) throws SQLException { + //自定义包名 + String modulePackageName = downloadCodeForm.getModulePackageName(); + Map columndata = new HashMap<>(16); + //tableJson + List tableModelList = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + //主表 + TableModel mainTable = tableModelList.stream().filter(t -> t.getTypeId().equals("1")).findFirst().orElse(null); + + //pc列表对象 + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(entity.getColumnData(), ColumnDataModel.class); + //app 列表对象 + ColumnDataModel appColumnDataModel = JsonUtil.getJsonToBean(entity.getAppColumnData(), ColumnDataModel.class); + + List searchList = JsonUtil.getJsonToList(columnDataModel.getSearchList(), FieLdsModel.class); + + //权限 + AuthorityModel authority = new AuthorityModel(); + BeanUtil.copyProperties(columnDataModel, authority); + + //取对应表的别名 + Map tableNameRenames = FunctionFormPublicUtil.tableNameRename(downloadCodeForm, tableModelList); + + //子表集合 + List childTableNameList = new ArrayList<>(); + //全部表 + List allTableNameList = new ArrayList<>(); + + //formTempJson + FormDataModel formData = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + List formAllModel = new ArrayList<>(); + RecursionForm recursionForm = new RecursionForm(); + recursionForm.setTableModelList(JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class)); + recursionForm.setList(list); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + //主表数据 + List mast = formAllModel.stream().filter(t -> FormEnum.mast.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + List tables = formAllModel.stream().filter(t -> FormEnum.table.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + //列表子表数据 + List mastTable = formAllModel.stream().filter(t -> FormEnum.mastTable.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + + String treeRelationField = columnDataModel.getTreeRelation().replaceAll("-", "_"); + for (TableModel tableModel : tableModelList) { + TableModel Model = new TableModel(); + Model.setInitName(tableModel.getTable()); + Model.setTable(tableNameRenames.get(tableModel.getTable())); + Model.setTableField(DataControlUtils.captureName(tableModel.getTableField())); + Model.setTypeId(tableModel.getTypeId()); + allTableNameList.add(Model); + if ("0".equals(tableModel.getTypeId())) { + childTableNameList.add(Model); + } + } + //子表(tableField,tableName) + Map childKeyTableNameMap = new HashMap<>(8); + tables.stream().forEach(t -> childKeyTableNameMap.put(t.getChildList().getTableModel(), t.getChildList().getTableName())); + //查询条件 + List jnpfkey = new ArrayList() {{ + add(JnpfKeyConsts.COM_INPUT); + add(JnpfKeyConsts.TEXTAREA); + }}; + List searchTypeModelList = new ArrayList<>(); + searchList.stream().forEach(fieLdsModel -> { + SearchTypeModel searchTypeModel = new SearchTypeModel(); + searchTypeModel.setJnpfKey(fieLdsModel.getConfig().getJnpfKey()); + Integer seachType = fieLdsModel.getSearchType(); + if (jnpfkey.contains(searchTypeModel.getJnpfKey()) && seachType.equals(3)) { + seachType = 2; + } + searchTypeModel.setSearchType(seachType); + String vModel = fieLdsModel.getVModel(); + vModel = vModel.replaceAll("-", "_"); + searchTypeModel.setVModel(vModel); + searchTypeModel.setLabel(fieLdsModel.getConfig().getLabel()); + searchTypeModel.setFormat(fieLdsModel.getFormat()); + searchTypeModel.setMultiple((String.valueOf(fieLdsModel.getSearchMultiple()))); + searchTypeModelList.add(searchTypeModel); + }); + TableModel mainTableModel = tableModelList.stream().filter(t -> t.getTypeId().equals("1")).findFirst().orElse(null); + if (columnDataModel.getType() == 2) { + SearchTypeModel searchTypeModel = new SearchTypeModel(); + searchTypeModel.setVModel(treeRelationField); + searchTypeModel.setSearchType(2); + if (columnDataModel.getTreeDataSource().equals("organize")) { + searchTypeModel.setJnpfKey(JnpfKeyConsts.COMSELECT); + searchTypeModel.setSearchType(1); + } + searchTypeModel.setLabel("tree"); + searchTypeModel.setTableName(mainTableModel.getTable()); + searchTypeModelList.add(searchTypeModel); + } + + List groupModels = new ArrayList<>(); + if (searchTypeModelList.size() > 0) { + //主表 + for (TableFields tableFields : mainTableModel.getFields()) { + searchTypeModelList.stream().forEach(searchTypeModel -> { + if (searchTypeModel.getVModel().equals(tableFields.getField())) { + searchTypeModel.setDataType(tableFields.getDataType()); + } + }); + } + //鉴别列表子表正则 + String reg = "^[jnpf_]\\S*_jnpf\\S*"; + searchTypeModelList.stream().filter(s -> s.getVModel().matches(reg)).forEach(cl -> { + String s = cl.getVModel(); + String s1 = s.substring(s.lastIndexOf("jnpf_")).replace("jnpf_", ""); + String s2 = s.substring(s.indexOf("_") + 1, s.lastIndexOf("_jnpf")); + cl.setAfterVModel(s1); + cl.setTableName(s2); + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equalsIgnoreCase(s2)).findFirst().orElse(null); + cl.setDataType(tableModel.getFields().stream().filter(t -> t.getField().equalsIgnoreCase(s1)).findFirst().orElse(null).getDataType()); + } + ); + //副表 + Map> collect = searchTypeModelList.stream().filter(s -> s.getVModel().matches(reg)).collect(Collectors.groupingBy(t -> t.getTableName())); + groupModels = collect.entrySet().stream().map(c -> { + ListSearchGroupModel groupModel = new ListSearchGroupModel(); + groupModel.setModelName(tableNameRenames.get(c.getKey())); + groupModel.setTableName(c.getKey()); + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equalsIgnoreCase(c.getKey())).findFirst().orElse(null); + groupModel.setForeignKey(tableModel.getTableField()); + groupModel.setMainKey(tableModel.getRelationField()); + groupModel.setSearchTypeModelList(c.getValue()); + return groupModel; + } + ).collect(Collectors.toList()); + + //子表 + Map> collect1 = searchTypeModelList.stream().filter(s -> s.getVModel().toLowerCase().contains(JnpfKeyConsts.CHILD_TABLE_PREFIX)) + .collect(Collectors.groupingBy(t -> t.getVModel().substring(0, t.getVModel().lastIndexOf("_")))); + List collect2 = collect1.entrySet().stream().map(c -> { + ListSearchGroupModel groupModel = new ListSearchGroupModel(); + String tableName = childKeyTableNameMap.get(c.getKey()); + groupModel.setModelName(tableNameRenames.get(tableName)); + groupModel.setTableName(tableName); + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equalsIgnoreCase(tableName)).findFirst().orElse(null); + groupModel.setForeignKey(tableModel.getTableField()); + groupModel.setMainKey(tableModel.getRelationField()); + List value = c.getValue(); + value.stream().forEach(v -> { + String vModel = v.getVModel(); + String substring = vModel.substring(vModel.lastIndexOf("_") + 1); + v.setAfterVModel(substring); + }); + groupModel.setSearchTypeModelList(value); + return groupModel; + } + ).collect(Collectors.toList()); + groupModels.addAll(collect2); + + ListSearchGroupModel groupModel = new ListSearchGroupModel(); + groupModel.setSearchTypeModelList(searchTypeModelList.stream().filter(s -> + !s.getVModel().matches(reg) && !s.getVModel().toLowerCase().contains(JnpfKeyConsts.CHILD_TABLE_PREFIX)).collect(Collectors.toList())); + groupModel.setTableName(mainTable.getTable()); + groupModel.setModelName(tableNameRenames.get(mainTable.getTable())); + groupModels.add(groupModel); + } + + + //查询条件 + List searchAppList = JsonUtil.getJsonToList(appColumnDataModel.getSearchList(), FieLdsModel.class); + List searchTypeAppModelList = new ArrayList<>(); + searchAppList.stream().forEach(fieLdsModel -> { + SearchTypeModel searchTypeModel = new SearchTypeModel(); + searchTypeModel.setJnpfKey(fieLdsModel.getConfig().getJnpfKey()); + Integer seachType = fieLdsModel.getSearchType(); + if (jnpfkey.contains(searchTypeModel.getJnpfKey()) && seachType.equals(3)) { + seachType = 2; + } + searchTypeModel.setSearchType(seachType); + String vModel = fieLdsModel.getVModel(); + vModel = vModel.replaceAll("-", "_"); + searchTypeModel.setVModel(vModel); + searchTypeModel.setLabel(fieLdsModel.getConfig().getLabel()); + searchTypeModel.setFormat(fieLdsModel.getFormat()); + searchTypeModel.setMultiple((String.valueOf(fieLdsModel.getSearchMultiple()))); + searchTypeAppModelList.add(searchTypeModel); + }); + + + List groupAppModels = new ArrayList<>(); + if (searchTypeAppModelList.size() > 0) { + //主表 + for (TableFields tableFields : mainTableModel.getFields()) { + searchTypeAppModelList.stream().forEach(searchTypeModel -> { + if (searchTypeModel.getVModel().equals(tableFields.getField())) { + searchTypeModel.setDataType(tableFields.getDataType()); + } + }); + } + //鉴别列表子表正则 + String reg = "^[jnpf_]\\S*_jnpf\\S*"; + searchTypeAppModelList.stream().filter(s -> s.getVModel().matches(reg)).forEach(cl -> { + String s = cl.getVModel(); + String s1 = s.substring(s.lastIndexOf("jnpf_")).replace("jnpf_", ""); + String s2 = s.substring(s.indexOf("_") + 1, s.lastIndexOf("_jnpf")); + cl.setAfterVModel(s1); + cl.setTableName(s2); + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equalsIgnoreCase(s2)).findFirst().orElse(null); + cl.setDataType(tableModel.getFields().stream().filter(t -> t.getField().equalsIgnoreCase(s1)).findFirst().orElse(null).getDataType()); + } + ); + //副表 + Map> collect = searchTypeAppModelList.stream().filter(s -> s.getVModel().matches(reg)).collect(Collectors.groupingBy(t -> t.getTableName())); + groupAppModels = collect.entrySet().stream().map(c -> { + ListSearchGroupModel groupModel = new ListSearchGroupModel(); + groupModel.setModelName(tableNameRenames.get(c.getKey())); + groupModel.setTableName(c.getKey()); + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equalsIgnoreCase(c.getKey())).findFirst().orElse(null); + groupModel.setForeignKey(tableModel.getTableField()); + groupModel.setMainKey(tableModel.getRelationField()); + groupModel.setSearchTypeModelList(c.getValue()); + return groupModel; + } + ).collect(Collectors.toList()); + + //子表 + Map> collect1 = searchTypeAppModelList.stream().filter(s -> s.getVModel().toLowerCase().contains(JnpfKeyConsts.CHILD_TABLE_PREFIX)) + .collect(Collectors.groupingBy(t -> t.getVModel().substring(0, t.getVModel().lastIndexOf("_")))); + List collect2 = collect1.entrySet().stream().map(c -> { + ListSearchGroupModel groupModel = new ListSearchGroupModel(); + String tableName = childKeyTableNameMap.get(c.getKey()); + groupModel.setModelName(tableNameRenames.get(tableName)); + groupModel.setTableName(tableName); + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equalsIgnoreCase(tableName)).findFirst().orElse(null); + groupModel.setForeignKey(tableModel.getTableField()); + groupModel.setMainKey(tableModel.getRelationField()); + List value = c.getValue(); + value.stream().forEach(v -> { + String vModel = v.getVModel(); + String substring = vModel.substring(vModel.lastIndexOf("_") + 1); + v.setAfterVModel(substring); + }); + groupModel.setSearchTypeModelList(value); + return groupModel; + } + ).collect(Collectors.toList()); + groupAppModels.addAll(collect2); + + ListSearchGroupModel groupModel = new ListSearchGroupModel(); + groupModel.setSearchTypeModelList(searchTypeAppModelList.stream().filter(s -> + !s.getVModel().matches(reg) && !s.getVModel().toLowerCase().contains(JnpfKeyConsts.CHILD_TABLE_PREFIX)).collect(Collectors.toList())); + groupModel.setTableName(mainTable.getTable()); + groupModel.setModelName(tableNameRenames.get(mainTable.getTable())); + groupAppModels.add(groupModel); + } + + Template7Model model = new Template7Model(); + model.setClassName(DataControlUtils.captureName(tableNameRenames.get(table))); + model.setServiceDirectory(FormCommonUtil.getPath(FileTypeConstant.CODETEMP)); + model.setCreateDate(DateUtil.daFormat(new Date())); + model.setCreateUser(GenBaseInfo.AUTHOR); + model.setCopyright(GenBaseInfo.COPYRIGHT); + model.setDescription(downloadCodeForm.getDescription()); + + //后台 + columndata.put("module", downloadCodeForm.getModule()); + columndata.put("genInfo", model); + columndata.put("modelName", model.getClassName()); + columndata.put("typeId", 1); + columndata.put("searchList", searchList); + columndata.put("hasPage", columnDataModel.getHasPage()); + columndata.put("defaultSidx", columnDataModel.getDefaultSidx()); + columndata.put("sort", columnDataModel.getSort()); + columndata.put("searchTypeModelList", searchTypeModelList); + columndata.put("mast", mast); + columndata.put("childtable", table); + columndata.put("authority", authority); + //app pc 数据权限是否开启 + columndata.put("pcDataPermisson", columnDataModel.getUseDataPermission()); + columndata.put("appDataPermisson", appColumnDataModel.getUseDataPermission()); + columndata.put("groupModels", groupModels); + columndata.put("groupAppModels", groupAppModels); + columndata.put("childTableNameList", childTableNameList); + columndata.put("allTableNameList", allTableNameList); + columndata.put("superQuery", columnDataModel.getHasSuperQuery()); + TableModel maina = tableModelList.stream().filter(t -> t.getTypeId().equals("1")).findFirst().orElse(null); + String className = DataControlUtils.captureName(tableNameRenames.get(maina.getTable())); + columndata.put("mainModelName", className); + columndata.put("isCloud", FormCommonUtil.IS_CLOUD); + //数据源 + if (ObjectUtil.isNotEmpty(linkEntity)) { + columndata.put("DS", linkEntity.getFullName()); + } + columndata.put("genInfo", model); + CustomGenerator mpg = new CustomGenerator(columndata); + // 全局配置 + GlobalConfig gc = new GlobalConfig(); + gc.setFileOverride(true); + // 不需要ActiveRecord特性的请改为false + gc.setActiveRecord(false); + // XML 二级缓存 + gc.setEnableCache(false); + // XML ResultMap + gc.setBaseResultMap(false); + // XML columList + gc.setBaseColumnList(false); + gc.setAuthor(model.getCreateUser()); + gc.setOpen(false); + + // 自定义文件命名,注意 %s 会自动填充表实体属性! + gc.setEntityName(model.getClassName() + GenFileNameSuffix.ENTITY); + gc.setMapperName(model.getClassName() + GenFileNameSuffix.MAPPER); + gc.setXmlName(model.getClassName() + GenFileNameSuffix.MAPPER_XML); + gc.setServiceName(model.getClassName() + GenFileNameSuffix.SERVICE); + gc.setServiceImplName(model.getClassName() + GenFileNameSuffix.SERVICEIMPL); + mpg.setGlobalConfig(gc); + + // 数据源配置 + DataSourceConfig dsc = SourceUtil.dbConfig(TenantDataSourceUtil.getTenantSchema(), linkEntity); + mpg.setDataSource(dsc); + //数据库类型 + columndata.put("dbType", dsc.getDbType().getDb()); + + // 策略配置 + StrategyConfig strategy = new StrategyConfig(); + strategy.setEntityLombokModel(true); + // 表名生成策略 + strategy.setNaming(NamingStrategy.underline_to_camel); + // 需要生成的表 + strategy.setInclude(table); + strategy.setRestControllerStyle(true); + mpg.setStrategy(strategy); + + // 包配置 + PackageConfig pc = new PackageConfig(); + pc.setParent(modulePackageName); + mpg.setPackageInfo(pc); + // 包名 + columndata.put("modulePackageName", modulePackageName); + + // 自定义配置 + InjectionConfig cfg = new InjectionConfig() { + @Override + public void initMap() { + // to do nothing + } + }; + List focList = new ArrayList<>(); + String javaPath = FormCommonUtil.getLocalBasePath() + model.getServiceDirectory(); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "Entity.java.vm", "entity", false)); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "Mapper.java.vm", "mapper", false)); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "Mapper.xml.vm", "xml", false)); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "Service.java.vm", "service", false)); + focList.add(FormCommonUtil.getFileOutConfig(fileName, templatePath, downloadCodeForm, javaPath, "ServiceImpl.java.vm", "impl", false)); + + cfg.setFileOutConfigList(focList); + mpg.setTemplate(new TemplateConfig().setXml(null).setMapper(null).setController(null).setEntity(null).setService(null).setServiceImpl(null)); + mpg.setCfg(cfg); + // 执行生成 + mpg.execute(path); + } + + /** + * 生成表集合 + * + * @param entity 实体 + * @param dataSourceUtil 数据源 + * @param fileName 文件夹名称 + * @param downloadCodeForm 文件名称 + * @param userInfo 用户 + * @param configValueUtil 下载路径 + */ + @Override + public void generate(VisualdevEntity entity, DataSourceUtil dataSourceUtil, String fileName, String templatePath, DownloadCodeForm downloadCodeForm, + UserInfo userInfo, ConfigValueUtil configValueUtil, DbLinkEntity linkEntity) throws SQLException { + List list = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + //生成代码 + int i = 0; + for (TableModel model : list) { + if ("1".equals(model.getTypeId())) { + setCode(FormCommonUtil.getLocalBasePath() + FormCommonUtil.getPath(FileTypeConstant.TEMPLATECODEPATH), + fileName, templatePath, downloadCodeForm, entity, userInfo, configValueUtil, linkEntity); + } else if ("0".equals(model.getTypeId())) { + childTable(FormCommonUtil.getLocalBasePath() + FormCommonUtil.getPath(FileTypeConstant.TEMPLATECODEPATH), + fileName, templatePath, entity, downloadCodeForm, model.getTable(), userInfo, configValueUtil, linkEntity); + i++; + } + } + } + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/workFlow/WorkGenModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/workFlow/WorkGenModel.java new file mode 100644 index 0000000..6d7db45 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/workFlow/WorkGenModel.java @@ -0,0 +1,72 @@ +package jnpf.base.util.workFlow; + +import jnpf.base.UserInfo; +import jnpf.base.entity.VisualdevEntity; +import jnpf.base.model.DownloadCodeForm; +import jnpf.database.model.entity.DbLinkEntity; +import jnpf.database.util.DataSourceUtil; +import jnpf.model.visualJson.FormDataModel; +import lombok.Data; + +/** + * + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @author JNPF开发平台组 + * @date 2021/10/25 + */ +@Data +public class WorkGenModel { + /** + * 文件夹名字 + */ + private String fileName; + /** + * 实体对象 + */ + private VisualdevEntity entity; + /** + * 下载对象 + */ + private DownloadCodeForm downloadCodeForm; + /** + * 表单对象 + */ + private FormDataModel model; + /** + * 模板文件 + */ + private String templatePath; + /** + * 主键 + */ + private String pKeyName; + /** + * 本地数据源 + */ + private DataSourceUtil dataSourceUtil; + /** + * 数据连接 + */ + private DbLinkEntity linkEntity; + /** + * 个人信息 + */ + private UserInfo userInfo; + /** + * 生成文件名字 + */ + private String className; + /** + * 数据库表 + */ + private String table; + /** + * 生成路径 + */ + private String serviceDirectory; + /** + * 模板路径 + */ + private String templateCodePath; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/workFlow/WorkGenUtil.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/workFlow/WorkGenUtil.java new file mode 100644 index 0000000..f82dea9 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-biz/src/main/java/jnpf/base/util/workFlow/WorkGenUtil.java @@ -0,0 +1,1408 @@ +package jnpf.base.util.workFlow; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.core.toolkit.StringPool; +import com.baomidou.mybatisplus.generator.InjectionConfig; +import com.baomidou.mybatisplus.generator.config.*; +import com.baomidou.mybatisplus.generator.config.po.TableField; +import com.baomidou.mybatisplus.generator.config.po.TableInfo; +import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy; +import com.google.common.base.CaseFormat; +import jnpf.base.UserInfo; +import jnpf.base.entity.VisualdevEntity; +import jnpf.base.model.ColumnDataModel; +import jnpf.base.model.DownloadCodeForm; +import jnpf.base.model.Template6.AuthorityModel; +import jnpf.base.model.Template6.BtnData; +import jnpf.base.model.Template6.ColumnListField; +import jnpf.base.model.Template7.Template7Model; +import jnpf.base.model.VisualWebTypeEnum; +import jnpf.base.util.SourceUtil; +import jnpf.base.util.VisualUtils; +import jnpf.base.util.common.DataControlUtils; +import jnpf.base.util.common.FormCommonUtil; +import jnpf.base.util.common.FunctionFormPublicUtil; +import jnpf.base.util.common.SuperQueryUtil; +import jnpf.base.util.custom.CustomGenerator; +import jnpf.base.util.form.FormGenModel; +import jnpf.base.util.fuctionFormVue3.common.GenerateCommon; +import jnpf.base.util.fuctionFormVue3.common.GenerateParamModel; +import jnpf.constant.MsgCode; +import jnpf.database.model.entity.DbLinkEntity; +import jnpf.database.util.TenantDataSourceUtil; +import jnpf.entity.FlowFormEntity; +import jnpf.generater.model.FormDesign.ColumnListDataModel; +import jnpf.generater.model.FormDesign.ListSearchGroupModel; +import jnpf.generater.model.FormDesign.SearchTypeModel; +import jnpf.generater.model.GenBaseInfo; +import jnpf.generater.model.GenFileNameSuffix; +import jnpf.model.visualJson.*; +import jnpf.model.visualJson.analysis.*; +import jnpf.model.visualJson.config.ConfigModel; +import jnpf.model.visualJson.config.HeaderModel; +import jnpf.util.DateUtil; +import jnpf.util.JsonUtil; +import jnpf.util.StringUtil; +import jnpf.util.XSSEscape; +import jnpf.util.visiual.JnpfKeyConsts; +import lombok.Cleanup; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.io.IOUtils; +import org.apache.velocity.Template; +import org.apache.velocity.VelocityContext; +import org.apache.velocity.app.Velocity; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.StringWriter; +import java.math.BigDecimal; +import java.sql.SQLException; +import java.util.*; +import java.util.stream.Collectors; + +public class WorkGenUtil { + + //------------------------------------界面---------------------------------- + + /** + * 下载页面 + */ + public void htmlTemplates(FormGenModel workGenModel) { + Map map = new HashMap<>(16); + VisualdevEntity entity = workGenModel.getEntity(); + List formAllModel = new ArrayList<>(); + Map tableNameAll = this.forDataMode(workGenModel, formAllModel); + Map> tempMap = new HashMap<>(); + FormDataModel model = workGenModel.getModel(); + String className = model.getClassName().substring(0, 1).toUpperCase() + model.getClassName().substring(1); + String urlAddress = model.getClassName().substring(0, 1).toLowerCase() + model.getClassName().substring(1); + Template7Model templateModel = templateModel(workGenModel, className); + DownloadCodeForm downloadCodeForm = workGenModel.getDownloadCodeForm(); + + List mast = this.mast(formAllModel); + List> child = new ArrayList<>(); + this.childModel(formAllModel, child, tableNameAll, tempMap); + + Map> mastListAll = this.mastTableModel(formAllModel, map, tableNameAll); + + map.put("children", child); + map.put("fields", mast); + map.put("genInfo", templateModel); + map.put("modelName", model.getClassName()); + map.put("package", downloadCodeForm.getModulePackageName() + "." + downloadCodeForm.getModule()); + map.put("isModel", "true"); + map.put("primaryKeyPolicy", model.getPrimaryKeyPolicy() == 1); + map.put("concurrencyLock", model.getConcurrencyLock()); + String modelPathName = model.getClassName().substring(0, 1).toLowerCase() + model.getClassName().substring(1); + map.put("modelPathName", modelPathName); + map.put("flowEnCode", entity.getEnCode()); + map.put("flowId", entity.getId()); + map.put("isFlow", true); + this.formData(map, workGenModel, formAllModel, tableNameAll); + + List getTemplate = this.getTemplate(workGenModel, false); + String path = templateModel.getServiceDirectory() + workGenModel.getFileName(); + + this.templateJson(formAllModel, tempMap); + map.put("tempJson", tempMap); + this.htmlTemplates(map, getTemplate, path, templateModel.getClassName(), modelPathName); + + for (Map objectMap : child) { + objectMap.put("genInfo", templateModel); + objectMap.put("package", downloadCodeForm.getModulePackageName() + "." + downloadCodeForm.getModule()); + objectMap.put("modelPathName", modelPathName); + getTemplate = this.getTemplate(workGenModel, true); + String childName = objectMap.get("className").toString(); + objectMap.put("className", childName); + this.htmlTemplates(objectMap, getTemplate, path, childName, modelPathName); + } + + for (String mastKey : mastListAll.keySet()) { + List mastlist = mastListAll.get(mastKey).stream().map(t -> t.getFormMastTableModel()).collect(Collectors.toList()); + List childList = new LinkedList<>(); + for (FormMastTableModel columnModel : mastlist) { + String field = columnModel.getField(); + if (StringUtil.isNotEmpty(field)) { + FormColumnModel columnTable = columnModel.getMastTable(); + FieLdsModel fieLdsModel = columnTable.getFieLdsModel(); + fieLdsModel.setVModel(field); + columnTable.setFieLdsModel(fieLdsModel); + childList.add(columnTable); + } + } + getTemplate = this.getTemplate(workGenModel, true); + FormColumnTableModel mastTableModel = new FormColumnTableModel(); + mastTableModel.setChildList(childList); + String name = tableNameAll.get(mastKey); + String childName = name.substring(0, 1).toUpperCase() + name.substring(1); + Map objectMap = new HashMap<>(); + objectMap.put("children", mastTableModel); + objectMap.put("genInfo", templateModel); + objectMap.put("package", downloadCodeForm.getModulePackageName() + "." + downloadCodeForm.getModule()); + objectMap.put("className", childName); + objectMap.put("modelPathName", modelPathName); + this.htmlTemplates(objectMap, getTemplate, path, childName, modelPathName); + } + + /** + * 生成表单设计json文件 + */ + FlowFormEntity flowFormEntity = FunctionFormPublicUtil.exportFlowFormJson(entity, downloadCodeForm); + flowFormEntity.setFlowType(0); + flowFormEntity.setInterfaceUrl("/api/workflow/form/" + className); + flowFormEntity.setUrlAddress("workFlow/workFlowForm/" + urlAddress + "/"); + SuperQueryUtil.CreateFlowFormJsonFile(JsonUtil.getObjectToString(flowFormEntity), path); + } + + private void templateJson(List formAllModel, Map> tempMap) { + for (FormAllModel model : formAllModel) { + if (FormEnum.mast.getMessage().equals(model.getJnpfKey())) { + List templateJsonAll = new ArrayList<>(); + templateJsonAll.addAll(model.getFormColumnModel().getFieLdsModel().getConfig().getTemplateJson()); + List templateJsonModelList = JsonUtil.getJsonToList(model.getFormColumnModel().getFieLdsModel().getTemplateJson(), TemplateJsonModel.class); + templateJsonAll.addAll(templateJsonModelList); + String vModel = model.getFormColumnModel().getFieLdsModel().getVModel(); + for (TemplateJsonModel templateJsonModel : templateJsonAll) { + if (StringUtil.isNotEmpty(templateJsonModel.getRelationField())) { + Set fieldList = tempMap.get(templateJsonModel.getRelationField()) != null ? tempMap.get(templateJsonModel.getRelationField()) : new HashSet<>(); + fieldList.add(vModel); + tempMap.put(templateJsonModel.getRelationField().toLowerCase(), fieldList); + } + } + model.getFormColumnModel().getFieLdsModel().getConfig().setTemplateJson(templateJsonAll); + } + + if (FormEnum.mastTable.getMessage().equals(model.getJnpfKey())) { + List templateJsonAll = new ArrayList<>(); + templateJsonAll.addAll(model.getFormMastTableModel().getMastTable().getFieLdsModel().getConfig().getTemplateJson()); + List templateJsonModelList = JsonUtil.getJsonToList(model.getFormMastTableModel().getMastTable().getFieLdsModel().getTemplateJson(), TemplateJsonModel.class); + templateJsonAll.addAll(templateJsonModelList); + String vModel = model.getFormMastTableModel().getMastTable().getFieLdsModel().getVModel(); + for (TemplateJsonModel templateJsonModel : templateJsonAll) { + if (StringUtil.isNotEmpty(templateJsonModel.getRelationField())) { + Set fieldList = tempMap.get(templateJsonModel.getRelationField()) != null ? tempMap.get(templateJsonModel.getRelationField()) : new HashSet<>(); + fieldList.add(vModel); + tempMap.put(templateJsonModel.getRelationField().toLowerCase(), fieldList); + } + } + model.getFormMastTableModel().getMastTable().getFieLdsModel().getConfig().setTemplateJson(templateJsonAll); + } + } + } + + /** + * 封装页面数据 + */ + private void formData(Map map, FormGenModel workGenModel, List formAllModel, Map tableNameAll) { + FormDataModel model = workGenModel.getModel(); + DownloadCodeForm codeForm = workGenModel.getDownloadCodeForm(); + //界面 + map.put("module", codeForm.getModule()); + map.put("className", model.getClassName().substring(0, 1).toUpperCase() + model.getClassName().substring(1)); + map.put("formRef", model.getFormRef()); + map.put("formModel", model.getFormModel()); + map.put("size", model.getSize()); + map.put("labelPosition", model.getLabelPosition()); + map.put("labelWidth", model.getLabelWidth()); + map.put("formRules", model.getFormRules()); + map.put("gutter", model.getGutter()); + map.put("disabled", model.getDisabled()); + map.put("span", model.getSpan()); + map.put("formBtns", model.getFormBtns()); + map.put("idGlobal", model.getIdGlobal()); + map.put("popupType", model.getPopupType()); + map.put("form", formAllModel); + + //共用 + String pKeyName = workGenModel.getPKeyName(); + map.put("pKeyName", pKeyName); + } + + /** + * 获取模板 + * + * @param workGenModel + * @param isChild + * @return + */ + private List getTemplate(FormGenModel workGenModel, boolean isChild) { + String template = workGenModel.getTemplatePath(); + List templates = new ArrayList<>(); + //子表 + if (isChild) { + templates.add("java" + File.separator + "Model.java.vm"); + } else { + templates.add("java" + File.separator + "Form.java.vm"); + templates.add(template + File.separator + "html" + File.separator + "form.vue.vm"); + templates.add(template + File.separator + "html" + File.separator + "app.vue.vm"); + } + return templates; + } + + /** + * 获取文件名 + * + * @param path 路径 + * @param template 模板名称 + * @param className 文件名称 + * @return + */ + private String getFileNames(String path, String template, String className, String modePath) { + path = XSSEscape.escapePath(path); + modePath = XSSEscape.escapePath(modePath); + className = XSSEscape.escapePath(className); + String pathName = className.substring(0, 1).toLowerCase() + className.substring(1); + String pcHtmlPath = path + File.separator + "html" + File.separator + "web" + File.separator + pathName; + //pc的页面 + File pcHtmlfile = new File(pcHtmlPath); + if (template.contains("form.vue.vm")) { + if (!pcHtmlfile.exists()) { + pcHtmlfile.mkdirs(); + } + } + if (template.contains("form.vue.vm")) { + className = "index"; + return pcHtmlfile + File.separator + className + ".vue"; + } + //app的页面 + String appHtmlPath = path + File.separator + "html" + File.separator + "app" + File.separator + pathName; + File appHtmlfile = new File(appHtmlPath); + if (template.contains("app.vue.vm")) { + if (!appHtmlfile.exists()) { + appHtmlfile.mkdirs(); + } + } + if (template.contains("app.vue.vm")) { + className = "index"; + return appHtmlfile + File.separator + className + ".vue"; + } + //后台模型页面 + String modelPath = path + File.separator + "java" + File.separator + "jnpf-workflow" + File.separator + "jnpf-workflow-form" + File.separator + "jnpf-workflow-form-entity" + File.separator + "src" + File.separator + "main" + File.separator + "java" + File.separator + "jnpf" + File.separator + "form" + File.separator + "model"; + if (StringUtil.isNotEmpty(modePath)) { + modelPath = modelPath + File.separator + modePath; + } + File modelfile = new File(modelPath); + if (!modelfile.exists()) { + modelfile.mkdirs(); + } + if (template.contains("Form.java.vm")) { + return modelPath + File.separator + className + "Form.java"; + } + if (template.contains("Model.java.vm")) { + return modelPath + File.separator + className + "Model.java"; + } + return null; + } + + /** + * 渲染html模板 + * + * @param path 路径 + * @param object 模板数据 + * @param path 模板路径 + */ + private void htmlTemplates(Object object, List templates, String path, String className, String modePath) { + //界面模板 + VelocityContext context = new VelocityContext(); + context.put("context", object); + for (String template : templates) { + try { + // 渲染模板 + @Cleanup StringWriter sw = new StringWriter(); + Template tpl = Velocity.getTemplate(template, Constants.UTF_8); + tpl.merge(context, sw); + String fileNames = getFileNames(path, template, className, modePath); + if (fileNames != null) { + File file = new File(XSSEscape.escapePath(fileNames)); + if (!file.exists()) { + file.createNewFile(); + } + @Cleanup FileOutputStream fos = new FileOutputStream(file); + IOUtils.write(sw.toString(), fos, Constants.UTF_8); + IOUtils.closeQuietly(sw); + IOUtils.closeQuietly(fos); + } + } catch (IOException e) { + e.printStackTrace(); + System.out.println("渲染模板失败,表名:" + e); + } + } + } + + /** + * 封装主表数据 + */ + private List mast(List formAllModel) { + List mast = formAllModel.stream().filter(t -> FormEnum.mast.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + //主表赋值 + for (int i = 0; i < mast.size(); i++) { + FieLdsModel fieLdsModel = mast.get(i).getFormColumnModel().getFieLdsModel(); + model(fieLdsModel); + String vmodel = fieLdsModel.getVModel(); + if (StringUtil.isEmpty(vmodel)) { + mast.remove(i); + i--; + } + } + return mast; + } + + /** + * 封装mastTable数据 + */ + private Map> mastTableModel(List formAllModel, Map map, Map tableNameAll) { + List mastTable = formAllModel.stream().filter(t -> FormEnum.mastTable.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + Map> mastListAll = mastTable.stream().collect(Collectors.groupingBy(e -> e.getFormMastTableModel().getTable())); + Map mastTableNameAll = new HashMap<>(); + Map> mastTableList = new HashMap<>(); + //表单主表 + for (String mastkey : mastListAll.keySet()) { + List mastList = mastListAll.get(mastkey); + for (FormAllModel fieLdsList : mastList) { + FieLdsModel fieLdsModel = fieLdsList.getFormMastTableModel().getMastTable().getFieLdsModel(); + model(fieLdsModel); + } + mastListAll.put(mastkey, mastList); + String tableName = tableNameAll.get(mastkey); + String name = tableName.substring(0, 1).toUpperCase() + tableName.substring(1); + mastTableNameAll.put(mastkey, name); + mastTableList.put(tableName.toLowerCase(), mastList); + } + map.put("mastTableName", mastTableNameAll); + map.put("tableName", tableNameAll); + map.put("mastTable", mastTableList); + return mastListAll; + } + + /** + * 封装子表数据 + */ + private void childModel(List formAllModel, List> child, Map tableNameAll, Map> tempMap) { + List table = formAllModel.stream().filter(t -> FormEnum.table.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + for (FormAllModel formModel : table) { + FormColumnTableModel childList = formModel.getChildList(); + List thousandsField = new ArrayList<>(); + String tableName = childList.getTableName(); + Integer addType = childList.getAddType(); + String name = tableNameAll.get(tableName); + String className = name.substring(0, 1).toUpperCase() + name.substring(1); + List tableList = childList.getChildList(); + for (int i = 0; i < tableList.size(); i++) { + FormColumnModel columnModel = tableList.get(i); + FieLdsModel fieLdsModel = columnModel.getFieLdsModel(); + model(fieLdsModel); + if (fieLdsModel.isThousands()) { + thousandsField.add(fieLdsModel.getVModel()); + } + if (addType == 1) { + Object defaltValue = fieLdsModel.getConfig().getDefaultValue(); + if (defaltValue instanceof String) { + defaltValue = ""; + } else if (defaltValue instanceof BigDecimal) { + defaltValue = 0; + } else if (defaltValue instanceof List) { + defaltValue = new ArrayList<>(); + } + fieLdsModel.getConfig().setDefaultValue(defaltValue); + } + List templateJsonAll = new ArrayList<>(); + templateJsonAll.addAll(fieLdsModel.getConfig().getTemplateJson()); + List templateJsonModelList = JsonUtil.getJsonToList(fieLdsModel.getTemplateJson(), TemplateJsonModel.class); + templateJsonAll.addAll(templateJsonModelList); + for (TemplateJsonModel templateJsonModel : templateJsonAll) { + if (StringUtil.isNotEmpty(templateJsonModel.getRelationField())) { + String[] fieldList = templateJsonModel.getRelationField().split("-"); + if (fieldList.length > 1) { + templateJsonModel.setRelationField(className.toLowerCase() + "-" + fieldList[1]); + } + } + } + for (TemplateJsonModel templateJsonModel : templateJsonModelList) { + if (StringUtil.isNotEmpty(templateJsonModel.getRelationField())) { + String[] fieldList = templateJsonModel.getRelationField().split("-"); + if (fieldList.length > 1) { + templateJsonModel.setRelationField(className.toLowerCase() + "List-" + fieldList[1]); + } + } + } + fieLdsModel.setTemplateJson(JsonUtil.getObjectToString(templateJsonModelList)); + fieLdsModel.getConfig().setTemplateJson(templateJsonAll); + } + childList.setThousandsField(thousandsField); + childList.setChildList(tableList); + Map childs = JsonUtil.entityToMap(childList); + childs.put("className", className); + childs.put("children", childList); + child.add(childs); + } + } + + /** + * 封装model数据 + */ + private void model(FieLdsModel fieLdsModel) { + ConfigModel configModel = fieLdsModel.getConfig(); + String jnpfKey = configModel.getJnpfKey(); + if (configModel.getDefaultValue() instanceof String) { + configModel.setValueType("String"); + } + if (configModel.getDefaultValue() == null) { + configModel.setValueType("undefined"); + if (JnpfKeyConsts.NUM_INPUT.equals(jnpfKey)) { + configModel.setDefaultValue(ObjectUtil.isNotEmpty(fieLdsModel.getMin()) ? fieLdsModel.getMin() : 0); + configModel.setValueType(null); + } + if (JnpfKeyConsts.ADDRESS.equals(jnpfKey)) { + configModel.setDefaultValue(new ArrayList<>()); + configModel.setValueType(null); + } + } + if (JnpfKeyConsts.SWITCH.equals(jnpfKey)) { + if (configModel.getDefaultValue() instanceof Boolean) { + Boolean defaultValue = (Boolean) configModel.getDefaultValue(); + configModel.setDefaultValue(defaultValue ? 1 : 0); + } + } + if (JnpfKeyConsts.TREESELECT.equals(jnpfKey)) { + configModel.setValueType(fieLdsModel.getMultiple() ? configModel.getValueType() : "undefined"); + } + fieLdsModel.setConfig(configModel); + } + + /** + * 封装表对应的输出名字 + */ + private Map tableName(List tableModelList, DownloadCodeForm downloadCodeForm) { + Map tableClass = new HashMap<>(16); + int i = 0; + for (TableModel tableModel : tableModelList) { + if ("0".equals(tableModel.getTypeId())) { + String[] subClassName = downloadCodeForm.getSubClassName().split(","); + tableClass.put(tableModel.getTable(), subClassName[i]); + i++; + } + if ("1".equals(tableModel.getTypeId())) { + tableClass.put(tableModel.getTable(), downloadCodeForm.getClassName()); + } + } + return tableClass; + } + + + //----------------------------代码------------------------------------------------------- + + /** + * 生成表集合 + * + * @param genModel 对象 + * @throws SQLException + */ + public void generate(FormGenModel genModel) throws Exception { + VisualdevEntity entity = genModel.getEntity(); + List list = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + DownloadCodeForm downloadCodeForm = genModel.getDownloadCodeForm(); + List tableModelList = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + Map tableNameAll = tableName(tableModelList, downloadCodeForm); + //生成代码 + for (TableModel model : list) { + String table = model.getTable(); + genModel.setTable(table); + genModel.setClassName(tableNameAll.get(model.getTable())); + genModel.setMainTable(false); + if ("1".equals(model.getTypeId())) { + genModel.setClassName(downloadCodeForm.getClassName()); + genModel.setMainTable(true); + this.setCode(genModel); + } else if ("0".equals(model.getTypeId())) { + String name = tableNameAll.get(table); + String className = name.substring(0, 1).toUpperCase() + name.substring(1); + genModel.setClassName(className); + this.setCode(genModel); + } + } + } + + /** + * 生成主表 + * + * @throws SQLException + */ + private void setCode(FormGenModel genModel) throws Exception { + DownloadCodeForm downloadCodeForm = genModel.getDownloadCodeForm(); + String className = genModel.getClassName().substring(0, 1).toUpperCase() + genModel.getClassName().substring(1); + Template7Model model = this.templateModel(genModel, className); + //执行代码生成器 + GenerateParamModel generateParamModel = new GenerateParamModel().builder() + .dataSourceUtil(genModel.getDataSourceUtil()) + .path(FormCommonUtil.getLocalBasePath() + genModel.getConfigValueUtil()) + .fileName(genModel.getFileName()) + .templatesPath(genModel.getTemplatePath()) + .downloadCodeForm(downloadCodeForm) + .entity(genModel.getEntity()) + .userInfo(genModel.getUserInfo()) + .configValueUtil(genModel.getConfigValueUtil()) + .linkEntity(genModel.getLinkEntity()) + .pKeyName(genModel.getPKeyName()) + .className(className) + .isMainTable(genModel.isMainTable()) + .table(genModel.getTable()) + .build(); + Map columndata = getcolumndata(generateParamModel); + this.javaGenerate(columndata, model, genModel, genModel.isMainTable()); + } + + /** + * 获取传递参数 + * + * @param generateParamModel + * @return + * @throws Exception + */ + private Map getcolumndata(GenerateParamModel generateParamModel) throws Exception { + Map columndata = new HashMap<>(16); + DownloadCodeForm downloadCodeForm = generateParamModel.getDownloadCodeForm(); + VisualdevEntity entity = generateParamModel.getEntity(); + DbLinkEntity linkEntity = generateParamModel.getLinkEntity(); + String className = generateParamModel.getClassName(); + String pKeyName = generateParamModel.getPKeyName(); + //代码生成基础信息 + Template7Model template7Model = GenerateCommon.getTemplate7Model(className); + template7Model.setTableName(downloadCodeForm.getClassName()); + template7Model.setDescription(downloadCodeForm.getDescription()); + generateParamModel.setTemplate7Model(template7Model); + //自定义包名 + String modulePackageName = downloadCodeForm.getModulePackageName(); + //tableJson + List tableModelList = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + //formTempJson + FormDataModel formData = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + //设置乐观锁参数用于其他位置判断 + generateParamModel.setConcurrencyLock(formData.getConcurrencyLock()); + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + //主表 + TableModel mainTable = tableModelList.stream().filter(t -> t.getTypeId().equals("1")).findFirst().orElse(null); + //表别名 + Map tableRenames = tableName(tableModelList, generateParamModel.getDownloadCodeForm()); + String mainModelName = DataControlUtils.captureName(tableRenames.get(mainTable.getTable())); + //赋值主键 + tableModelList.stream().forEach(t -> { + try { + t.setTableKey(VisualUtils.getpKey(linkEntity, t.getTable())); + } catch (SQLException sqlException) { + sqlException.printStackTrace(); + } + }); + + //所有控件 + List formAllModel = new ArrayList<>(); + RecursionForm recursionForm = new RecursionForm(); + recursionForm.setTableModelList(JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class)); + recursionForm.setList(list); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + //主表控件 + List mast = formAllModel.stream().filter(t -> FormEnum.mast.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + //子表控件 + List table = formAllModel.stream().filter(t -> FormEnum.table.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + //副表控件 + List mastTable = formAllModel.stream().filter(t -> FormEnum.mastTable.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + + List subTableName = new ArrayList<>(); + for (FormAllModel allModel : table) { + FormColumnTableModel childList = allModel.getChildList(); + if (childList != null) { + subTableName.add(childList.getTableName()); + } + } + //子表(tableField,tableName)->tablefield1->realname + Map childKeyTableNameMap = new HashMap<>(8); + table.stream().forEach(t -> childKeyTableNameMap.put(t.getChildList().getTableModel(), t.getChildList().getTableName())); + + //子表集合 + List childTableNameList = new ArrayList<>(); + //全部表 + List allTableNameList = new ArrayList<>(); + for (TableModel tableModel : tableModelList) { + TableModel Model = new TableModel(); + Model.setInitName(tableModel.getTable()); + Model.setTable(tableRenames.get(tableModel.getTable())); + Model.setTableField(DataControlUtils.captureName(tableModel.getTableField())); + if (Model.getTable().equals(mainTable.getTable())) { + Model.setTableTag("main"); + } else { + Model.setTableTag(subTableName.contains(Model.getTable()) ? "sub" : "sub-jnpf"); + } + allTableNameList.add(Model); + if ("0".equals(tableModel.getTypeId())) { + childTableNameList.add(Model); + } + } + TableModel mainTableModel = tableModelList.stream().filter(t -> t.getTypeId().equals("1")).findFirst().orElse(null); + //主表的字段 + if (mainTableModel == null || CollectionUtils.isEmpty(mainTableModel.getFields())) { + throw new SQLException(MsgCode.COD001.get()); + } + + //主表的属性 + List mastTableHandle = new ArrayList<>(); + for (int i = 0; i < mast.size(); i++) { + FormAllModel mastModel = mast.get(i); + FieLdsModel fieLdsModel = mastModel.getFormColumnModel().getFieLdsModel(); + //接口templatejson转换 + if (StringUtil.isNotEmpty(fieLdsModel.getVModel())) { + List templateJson = fieLdsModel.getConfig().getTemplateJson(); + String json = templateJson.size() > 0 ? JsonUtil.getObjectToString(templateJson) : fieLdsModel.getTemplateJson(); + fieLdsModel.setTemplateJson(json); + mastTableHandle.add(fieLdsModel); + } + } + //副表模型 + List columnTableHandle = new ArrayList<>(); + //副表数据model + Map> groupColumnDataMap = mastTable.stream().collect(Collectors.groupingBy(m -> m.getFormMastTableModel().getTable())); + for (String key : groupColumnDataMap.keySet()) { + String classNameMast = DataControlUtils.captureName(tableRenames.get(key)); + ColumnListDataModel columnListDataModel = new ColumnListDataModel(); + columnListDataModel.setModelName(classNameMast); + columnListDataModel.setModelUpName(DataControlUtils.captureName(classNameMast)); + columnListDataModel.setModelLowName(DataControlUtils.initialLowercase(classNameMast)); + List allModels = groupColumnDataMap.get(key); + List fields = allModels.stream().map(m -> m.getFormMastTableModel().getField()).collect(Collectors.toList()); + columnListDataModel.setFieldList(fields); + columnListDataModel.setFieLdsModelList(allModels.stream().map(al -> al.getFormMastTableModel()).collect(Collectors.toList())); + columnListDataModel.setTableName(key); + List collect = allModels.stream().map(all -> all.getFormMastTableModel().getMastTable().getFieLdsModel()).collect(Collectors.toList()); + collect.stream().forEach(c -> { + String vmodel = c.getVModel().substring(c.getVModel().lastIndexOf("jnpf_")).replace("jnpf_", ""); + c.setVModel(vmodel); + List templateJson = c.getConfig().getTemplateJson(); + String json = templateJson.size() > 0 ? JsonUtil.getObjectToString(templateJson) : c.getTemplateJson(); + c.setTemplateJson(json); + }); + columnListDataModel.setFieLdsModels(collect); + + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equalsIgnoreCase(columnListDataModel.getTableName())).findFirst().orElse(null); + if (ObjectUtil.isNotEmpty(tableModel)) { + columnListDataModel.setMainKey(tableModel.getRelationField()); + columnListDataModel.setRelationField(tableModel.getTableField()); + columnListDataModel.setMainUpKey(DataControlUtils.captureName(tableModel.getRelationField())); + columnListDataModel.setRelationUpField(DataControlUtils.captureName(tableModel.getTableField())); + String tableKey = tableModel.getTableKey().toLowerCase().replace("f_", ""); + tableKey = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, tableKey); + columnListDataModel.setMainField(DataControlUtils.captureName(tableKey)); + } + columnTableHandle.add(columnListDataModel); + } + //子表的属性 + List> childTableHandle = new ArrayList<>(); + for (int i = 0; i < table.size(); i++) { + FormColumnTableModel childList = table.get(i).getChildList(); + List childListAll = childList.getChildList(); + String classNameChild = DataControlUtils.captureName(tableRenames.get(childList.getTableName())); + //子表别名 + childList.setAliasClassName(classNameChild); + childList.setAliasUpName(DataControlUtils.captureName(classNameChild)); + childList.setAliasLowName(DataControlUtils.initialLowercase(classNameChild)); + for (FormColumnModel columnModel : childListAll) { + FieLdsModel fieLdsModel = columnModel.getFieLdsModel(); + List templateJson = fieLdsModel.getConfig().getTemplateJson(); + String json = templateJson.size() > 0 ? JsonUtil.getObjectToString(templateJson) : fieLdsModel.getTemplateJson(); + fieLdsModel.setTemplateJson(json); + } + Map childs = JsonUtil.entityToMap(childList); + Optional first1 = tableModelList.stream().filter(t -> t.getTable().equals(childList.getTableName())).findFirst(); + if (!first1.isPresent()) { + throw new SQLException(MsgCode.COD001.get()); + } + TableModel tableModel = first1.get(); + //获取主键-外键字段-关联主表字段 + String chidKeyName = VisualUtils.getpKey(linkEntity, tableModel.getTable()); + String chidKeyField = chidKeyName.trim().toLowerCase().replaceAll("f_", ""); + chidKeyField = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, chidKeyField); + childs.put("chidKeyName", chidKeyField); + String tableField = tableModel.getTableField().trim().replaceAll(":\"f_", ":\""); + childs.put("tablefield", tableField); + String relationField = tableModel.getRelationField().trim().replaceAll(":\"f_", ":\""); + childs.put("relationField", relationField); + childTableHandle.add(childs); + } + + //++++++++++++++++++++++++++++主副子通用参数++++++++++++++++++++++++++// + //微服务标识 + columndata.put("isCloud", GenerateCommon.IS_CLOUD); + //是列表,是流程判断 + if (VisualWebTypeEnum.FORM_LIST.getType().equals(entity.getWebType()) && !Objects.equals(entity.getType(), 3)) { + columndata.put("isList", true); + //添加列表参数 + getListColumndata(generateParamModel, columndata); + } + if (Objects.equals(entity.getEnableFlow(), 1)) { + columndata.put("isFlow", true); + } + //后台 + columndata.put("module", downloadCodeForm.getModule()); + columndata.put("genInfo", template7Model); + columndata.put("modelName", template7Model.getClassName()); + //表单非系统控件字段--为了加null可以更新 + columndata.put("tableNotSystemField", GenerateCommon.getNotSystemFields(mast, mastTable, table, generateParamModel)); + //主副子 控件字段(已处理数据) + columndata.put("mastTableHandle", mastTableHandle);//原system + columndata.put("columnTableHandle", columnTableHandle);//原columnChildren + columndata.put("childTableHandle", childTableHandle);//原child + columndata.put("children", childTableHandle);//原child + columndata.put("mainModelName", mainModelName); + //数据源 + if (ObjectUtil.isNotEmpty(linkEntity)) { + columndata.put("DS", linkEntity.getFullName()); + } + // 数据源配置 + DataSourceConfig dsc = SourceUtil.dbConfig(TenantDataSourceUtil.getTenantSchema(), linkEntity); + //数据库类型 + columndata.put("dbType", dsc.getDbType().getDb()); + // 包名 + columndata.put("modulePackageName", modulePackageName); + columndata.put("pKeyName", pKeyName); + columndata.put("VisualDevId", entity.getId()); + //++++++++++++++++++++++++++++仅主表参数++++++++++++++++++++++++++// + if (generateParamModel.isMainTable()) { + //后台 + columndata.put("main", true); + //模板名称 + columndata.put("formModelName", entity.getFullName()); + //乐观锁 + columndata.put("version", formData.getConcurrencyLock()); + //删除标志 + columndata.put("logicalDelete", formData.getLogicalDelete()); + //雪花 + columndata.put("snowflake", formData.getPrimaryKeyPolicy() == 1); + } + return columndata; + } + + + /** + * 获取列表传递参数 + * + * @param generateParamModel + * @return + * @throws Exception + */ + private void getListColumndata(GenerateParamModel generateParamModel, Map listMap) throws Exception { + DownloadCodeForm downloadCodeForm = generateParamModel.getDownloadCodeForm(); + VisualdevEntity entity = generateParamModel.getEntity(); + DbLinkEntity linkEntity = generateParamModel.getLinkEntity(); + String className = generateParamModel.getClassName(); + //代码生成基础信息 + Template7Model template7Model = GenerateCommon.getTemplate7Model(className); + template7Model.setTableName(downloadCodeForm.getClassName()); + template7Model.setDescription(downloadCodeForm.getDescription()); + generateParamModel.setTemplate7Model(template7Model); + //tableJson + List tableModelList = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + //formTempJson + FormDataModel formData = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + //设置乐观锁参数用于其他位置判断 + generateParamModel.setConcurrencyLock(formData.getConcurrencyLock()); + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + //主表 + TableModel mainTable = tableModelList.stream().filter(t -> t.getTypeId().equals("1")).findFirst().orElse(null); + //表别名 + Map tableRenames = tableName(tableModelList, generateParamModel.getDownloadCodeForm()); + //赋值主键 + tableModelList.stream().forEach(t -> { + try { + t.setTableKey(VisualUtils.getpKey(linkEntity, t.getTable())); + } catch (SQLException sqlException) { + sqlException.printStackTrace(); + } + }); + List formAllModel = new ArrayList<>(); + RecursionForm recursionForm = new RecursionForm(); + recursionForm.setTableModelList(JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class)); + recursionForm.setList(list); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + //主表数据 + List mast = formAllModel.stream().filter(t -> FormEnum.mast.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + //子表数据 + List table = formAllModel.stream().filter(t -> FormEnum.table.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + //副表数据 + List mastTable = formAllModel.stream().filter(t -> FormEnum.mastTable.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + List subTableName = new ArrayList<>(); + for (FormAllModel allModel : table) { + FormColumnTableModel childList = allModel.getChildList(); + if (childList != null) { + subTableName.add(childList.getTableName()); + } + } + //子表集合 + List childTableNameList = new ArrayList<>(); + //全部表 + List allTableNameList = new ArrayList<>(); + for (TableModel tableModel : tableModelList) { + TableModel Model = new TableModel(); + Model.setInitName(tableModel.getTable()); + Model.setTable(tableRenames.get(tableModel.getTable())); + Model.setTableField(DataControlUtils.captureName(tableModel.getTableField())); + if (Model.getTable().equals(mainTable.getTable())) { + Model.setTableTag("main"); + } else { + Model.setTableTag(subTableName.contains(Model.getTable()) ? "sub" : "sub-jnpf"); + } + allTableNameList.add(Model); + if ("0".equals(tableModel.getTypeId())) { + childTableNameList.add(Model); + } + } + //子表(tableField,tableName)->tablefield1->realname + Map childKeyTableNameMap = new HashMap<>(8); + table.stream().forEach(t -> childKeyTableNameMap.put(t.getChildList().getTableModel(), t.getChildList().getTableName())); + TableModel mainTableModel = tableModelList.stream().filter(t -> t.getTypeId().equals("1")).findFirst().orElse(null); + //主表的字段 + if (mainTableModel == null || CollectionUtils.isEmpty(mainTableModel.getFields())) { + throw new SQLException(MsgCode.COD001.get()); + } + + //columnTempJson + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(entity.getColumnData(), ColumnDataModel.class); + //app 列表对象 + ColumnDataModel appColumnDataModel = JsonUtil.getJsonToBean(entity.getAppColumnData(), ColumnDataModel.class); + + //按钮 + List btnPcList = JsonUtil.getJsonToList(columnDataModel.getBtnsList(), BtnData.class); + List columnBtnPcList = JsonUtil.getJsonToList(columnDataModel.getColumnBtnsList(), BtnData.class); + List btnAppList = JsonUtil.getJsonToList(appColumnDataModel.getBtnsList(), BtnData.class); + List columnBtnAppList = JsonUtil.getJsonToList(appColumnDataModel.getColumnBtnsList(), BtnData.class); + List btnDataList = new ArrayList<>(btnPcList); + List collect3 = btnPcList.stream().map(BtnData::getValue).collect(Collectors.toList()); + btnDataList.addAll(btnAppList.stream().filter(t -> !collect3.contains(t.getValue())).collect(Collectors.toList())); + List columnBtnDataList = new ArrayList<>(columnBtnPcList); + List collect4 = columnBtnPcList.stream().map(BtnData::getValue).collect(Collectors.toList()); + columnBtnDataList.addAll(columnBtnAppList.stream().filter(t -> !collect4.contains(t.getValue())).collect(Collectors.toList())); + //是否有导入按钮--webtype==2开启列表 + boolean hasUploadBtn = Objects.equals(entity.getWebType(), 2) && btnDataList.stream().anyMatch(btn -> btn.getValue().equals("upload")); + //是否有下载按钮 + boolean hasDownloadBtn = Objects.equals(entity.getWebType(), 2) && btnDataList.stream().anyMatch(btn -> btn.getValue().equals("download")); + //是否有下载按钮 + boolean hasPrintBtn = Objects.equals(entity.getWebType(), 2) && btnDataList.stream().anyMatch(btn -> btn.getValue().equals("batchPrint")); + boolean hasRemoveBtn = Objects.equals(entity.getWebType(), 2) && btnDataList.stream().anyMatch(btn -> btn.getValue().equals("batchRemove")); + //列表和查询 + List columnList = JsonUtil.getJsonToList(columnDataModel.getColumnList(), ColumnListField.class); + List searchList = JsonUtil.getJsonToList(columnDataModel.getSearchList(), SearchTypeModel.class); + List columnAppList = JsonUtil.getJsonToList(appColumnDataModel.getColumnList(), ColumnListField.class); + List searchAppList = JsonUtil.getJsonToList(appColumnDataModel.getSearchList(), SearchTypeModel.class); + //-----------------------------------------------------search start--------------------------------------- + //列表全字段 + List columnListAll = new ArrayList<>(columnList); + List cLaArr = columnListAll.stream().map(ColumnListField::getProp).collect(Collectors.toList()); + columnAppList.stream().forEach(t -> { + if (!cLaArr.contains(t.getProp())) { + columnListAll.add(t); + cLaArr.add(t.getProp()); + } + }); + //查询全字段 + List searchListAll = new ArrayList<>(searchList); + List cSaArr = searchListAll.stream().map(SearchTypeModel::getId).collect(Collectors.toList()); + searchAppList.stream().forEach(t -> { + if (!cSaArr.contains(t.getId())) { + searchListAll.add(t); + cSaArr.add(t.getId()); + } + }); + + //添加左侧树查询字段 + addTreeSearchField(mainTableModel, columnDataModel, searchList); + addTreeSearchField(mainTableModel, columnDataModel, searchAppList); + addTreeSearchField(mainTableModel, columnDataModel, searchListAll); + + //查询字段转换 + List groupModels = getListSearchGroupModels(tableModelList, mainTable, tableRenames, childKeyTableNameMap, mainTableModel, searchList); + List groupAppModels = getListSearchGroupModels(tableModelList, mainTable, tableRenames, childKeyTableNameMap, mainTableModel, searchAppList); + List groupAllModels = getListSearchGroupModels(tableModelList, mainTable, tableRenames, childKeyTableNameMap, mainTableModel, searchListAll); + + //-----------------------------------------------------search enddd--------------------------------------- + //权限 + AuthorityModel authority = new AuthorityModel(); + BeanUtil.copyProperties(columnDataModel, authority); + //导入字段 + List> allUploadTemplates = new ArrayList<>(); + boolean importHasChildren = false; + String importType = "1"; + UploaderTemplateModel uploaderTemplateModel = JsonUtil.getJsonToBean(columnDataModel.getUploaderTemplateJson(), UploaderTemplateModel.class); + if (hasUploadBtn && uploaderTemplateModel != null && uploaderTemplateModel.getSelectKey() != null) { + importType = uploaderTemplateModel.getDataType(); + List selectKey = uploaderTemplateModel.getSelectKey(); + Map> childMap = new HashMap<>(); + //判断是否存在子表的导入导出 + for (String item : selectKey) { + if (item.toLowerCase().contains(JnpfKeyConsts.CHILD_TABLE_PREFIX)) { + importHasChildren = true; + String[] split = item.split("-"); + if (childMap.get(split[0]) == null) { + List keys = new ArrayList<>(); + keys.add(split[1]); + childMap.put(split[0], keys); + } else { + List keys = childMap.get(split[0]); + keys.add(split[1]); + childMap.replace(split[0], keys); + } + } else { + //主表字段 + for (FormAllModel fam : mast) { + FieLdsModel fieLdsModel = fam.getFormColumnModel().getFieLdsModel(); + if (item.equals(fieLdsModel.getVModel())) { + Map map = JsonUtil.entityToMap(fieLdsModel); + map.put("label", fieLdsModel.getConfig().getLabel()); + allUploadTemplates.add(map); + } + } + //副表字段 + for (FormAllModel fam : mastTable) { + FieLdsModel fieLdsModel = fam.getFormMastTableModel().getMastTable().getFieLdsModel(); + if (item.equals(fieLdsModel.getVModel())) { + Map map = JsonUtil.entityToMap(fieLdsModel); + map.put("label", fieLdsModel.getConfig().getLabel()); + allUploadTemplates.add(map); + } + } + } + } + for (FormAllModel fam : table) { + FormColumnTableModel child = fam.getChildList(); + FormColumnTableModel childRes = new FormColumnTableModel(); + BeanUtil.copyProperties(child, childRes); + String childClassName = DataControlUtils.captureName(tableRenames.get(childRes.getTableName())); + //子表别名 + childRes.setAliasClassName(childClassName); + childRes.setAliasUpName(DataControlUtils.captureName(childClassName)); + childRes.setAliasLowName(DataControlUtils.initialLowercase(childClassName)); + String tableModel = child.getTableModel(); + List childList1 = child.getChildList(); + //获取该子表的所有需要导入字段 + List keys = childMap.get(tableModel) != null ? childMap.get(tableModel) : Collections.EMPTY_LIST; + List collect = childList1.stream().filter(t -> keys.contains(t.getFieLdsModel().getVModel())).collect(Collectors.toList()); + childRes.setChildList(collect); + Map childFilesMap = JsonUtil.entityToMap(childRes); + childFilesMap.put("vModel", childRes.getTableModel()); + //添加整个子表 + allUploadTemplates.add(childFilesMap); + } + } + //导入重复字段,需要标记(子表也以label判断重复) + Set set = new HashSet<>(); + List nameAgain = new ArrayList<>(); + for (Map f : allUploadTemplates) { + if (!set.add(String.valueOf(f.get("label")))) { + nameAgain.add(String.valueOf(f.get("vModel"))); + } + } + + //树形列表参数 + if (Objects.equals(columnDataModel.getType(), 5)) { + columnDataModel.setHasPage(false); + } + String parentField = StringUtil.isNotEmpty(columnDataModel.getParentField()) ? columnDataModel.getParentField() : ""; + if (StringUtil.isNotEmpty(parentField)) { + parentField = parentField.substring(0, 1).toUpperCase() + parentField.substring(1); + } + String subField = StringUtil.isNotEmpty(columnDataModel.getSubField()) ? columnDataModel.getSubField() : ""; + if (StringUtil.isNotEmpty(subField)) { + subField = subField.substring(0, 1).toUpperCase() + subField.substring(1); + } + //导出字段属性转换 + List listOptions = GenerateCommon.getExpotColumn(columnList); + //++++++++++++++++++++++++++++主副子通用参数++++++++++++++++++++++++++/ + listMap.put("hasPage", columnDataModel.getHasPage()); + listMap.put("defaultSidx", columnDataModel.getDefaultSidx()); + listMap.put("sort", columnDataModel.getSort()); + listMap.put("authority", authority); + //app pc 数据权限是否开启 + listMap.put("pcDataPermisson", columnDataModel.getUseDataPermission()); + listMap.put("appDataPermisson", appColumnDataModel.getUseDataPermission()); + listMap.put("groupModels", groupModels); + listMap.put("groupAppModels", groupAppModels); + listMap.put("childTableNameList", childTableNameList); + listMap.put("allTableNameList", allTableNameList); + //是否开启高级查询 + listMap.put("superQuery", columnDataModel.getHasSuperQuery()); + listMap.put("ruleQuery", true); + + //++++++++++++++++++++++++++++仅主表参数++++++++++++++++++++++++++// + if (generateParamModel.isMainTable()) { + //列表全属性 + listMap.put("columnDataStr", JSONObject.toJSONString(entity.getColumnData())); + listMap.put("appColumnDataStr", JSONObject.toJSONString(entity.getAppColumnData())); + listMap.put("tableListStr", JSONObject.toJSONString(entity.getVisualTables())); + listMap.put("formDataStr", JSONObject.toJSONString(entity.getFormData())); + listMap.put("columnData", JsonUtil.stringToMap(entity.getColumnData())); + //列表-pc-app-并集 + listMap.put("columnList", columnList); + listMap.put("searchList", searchList); + listMap.put("columnAppList", columnAppList); + listMap.put("searchAppList", searchAppList); + listMap.put("columnListAll", columnListAll); + listMap.put("searchListAll", searchListAll); + //子表样式 + listMap.put("childTableStyle", columnDataModel.getChildTableStyle()); + + //左侧树 + listMap.put("leftTreeTable", columnDataModel.getType() == 2); + //分组 + listMap.put("groupTable", columnDataModel.getType() == 3); + listMap.put("groupField", columnDataModel.getGroupField()); + //行内编辑 + listMap.put("lineEdit", columnDataModel.getType() == 4); + //树形参数 + listMap.put("treeTable", columnDataModel.getType() == 5); + //合计 + boolean configurationTotal = columnDataModel.isShowSummary(); + if (columnDataModel.getType() == 3 || columnDataModel.getType() == 5) { + configurationTotal = false; + } + listMap.put("configurationTotal", configurationTotal); + List summaryList = CollectionUtils.isEmpty(columnDataModel.getSummaryField()) ? Collections.EMPTY_LIST : columnDataModel.getSummaryField(); + listMap.put("fieldsTotal", JsonUtil.getObjectToString(summaryList)); + //按键 + listMap.put("btnsList", btnDataList); + listMap.put("columnBtnsList", columnBtnDataList); + listMap.put("btnPcList", btnPcList); + listMap.put("columnBtnPcList", columnBtnPcList); + + listMap.put("hasDownloadBtn", hasDownloadBtn); + listMap.put("hasUploadBtn", hasUploadBtn); + listMap.put("hasPrintBtn", hasPrintBtn); + listMap.put("hasRemoveBtn", hasRemoveBtn); + + listMap.put("parentField", parentField); + listMap.put("subField", subField); + //导入的字段 + listMap.put("importFields", allUploadTemplates); + //是否有子表-用于判断导入excel表头是否有两行 + listMap.put("importHasChildren", importHasChildren); + listMap.put("importType", importType); + //导入字段名称是否重复 + listMap.put("nameAgain", nameAgain); + listMap.put("listOptions", listOptions); + + // 是否存在列表子表数据 + listMap.put("hasSub", mastTable.size() > 0 ? true : false); + + //复杂表头 + List complexFieldList = new ArrayList<>(); + List> complexHeaderList = new ArrayList<>(); + for (HeaderModel headerModel : columnDataModel.getComplexHeaderList()) { + complexFieldList.addAll(headerModel.getChildColumns()); + Map map = JsonUtil.entityToMap(headerModel); + //复杂表头添加导入字段信息 + List> uploadFieldList = new ArrayList<>(); + for (Map uploadmap : allUploadTemplates) { + if (headerModel.getChildColumns().contains(uploadmap.get("vModel"))) { + uploadFieldList.add(uploadmap); + } + } + map.put("uploadFieldList", uploadFieldList); + complexHeaderList.add(map); + } + listMap.put("complexHeaderList", JsonUtil.getListToJsonArray(complexHeaderList)); + listMap.put("complexFieldList", JsonUtil.getListToJsonArray(complexFieldList)); + + } + } + + /** + * 封装数据 + * + * @param workGenModel + * @param className + * @return + */ + private Template7Model templateModel(FormGenModel workGenModel, String className) { + DownloadCodeForm downloadCodeForm = workGenModel.getDownloadCodeForm(); + Template7Model template7Model = new Template7Model(); + template7Model.setClassName(className); + template7Model.setServiceDirectory(workGenModel.getServiceDirectory()); + template7Model.setCreateDate(DateUtil.daFormat(new Date())); + template7Model.setCreateUser(GenBaseInfo.AUTHOR); + template7Model.setCopyright(GenBaseInfo.COPYRIGHT); + template7Model.setDescription(downloadCodeForm.getDescription()); + return template7Model; + } + + /** + * 添加左侧树查询字段 + * + * @param mainTableModel + * @param columnDataModel + * @param searchListAll + */ + private static void addTreeSearchField(TableModel mainTableModel, ColumnDataModel columnDataModel, List searchListAll) { + List cSaArr = searchListAll.stream().map(SearchTypeModel::getId).collect(Collectors.toList()); + //左侧树-若查询列表内没有需要添加到查询字段内 + if (Objects.equals(columnDataModel.getType(), 2)) { + String treeRelationField = columnDataModel.getTreeRelation(); + if (!cSaArr.contains(treeRelationField)) { + SearchTypeModel searchTypeModel = new SearchTypeModel(); + searchTypeModel.setId(treeRelationField); + searchTypeModel.setSearchType(2); + if (columnDataModel.getTreeDataSource().equals("organize")) { + searchTypeModel.setJnpfKey(JnpfKeyConsts.COMSELECT); + searchTypeModel.setSearchType(1); + } + searchTypeModel.setLabel("tree"); + searchTypeModel.setTableName(mainTableModel.getTable()); + searchListAll.add(searchTypeModel); + cSaArr.add(searchTypeModel.getId()); + } + } + } + + /** + * 查询字段配置调整 + * + * @param tableModelList + * @param mainTable + * @param tableRenames + * @param childKeyTableNameMap + * @param mainTableModel + * @param searchListAll + * @return + */ + private static List getListSearchGroupModels(List tableModelList, TableModel mainTable, Map tableRenames, Map childKeyTableNameMap, TableModel mainTableModel, List searchListAll) { + List groupModels = new ArrayList<>(); + List rangeToLike = new ArrayList() {{ + add(JnpfKeyConsts.COM_INPUT); + add(JnpfKeyConsts.TEXTAREA); + }}; + //查询全字段-转换--pagenation-字段不用替换了 + searchListAll.stream().forEach(t -> { + t.setId(t.getId().replace("-", "_")); + //单行和多行范围查询转模糊 + if (Objects.equals(t.getSearchType(), 3) && rangeToLike.contains(t.getConfig().getJnpfKey())) { + t.setSearchType(2); + } + }); + if (searchListAll.size() > 0) { + //主表 + for (TableFields tableFields : mainTableModel.getFields()) { + searchListAll.stream().forEach(searchTypeModel -> { + if (searchTypeModel.getId().equals(tableFields.getField())) { + searchTypeModel.setDataType(tableFields.getDataType()); + } + }); + } + //鉴别列表子表正则 + String reg = "^[jnpf_]\\S*_jnpf\\S*"; + searchListAll.stream().filter(s -> s.getId().matches(reg)).forEach(cl -> { + String s = cl.getId(); + String s1 = s.substring(s.lastIndexOf("jnpf_")).replace("jnpf_", ""); + String s2 = s.substring(s.indexOf("_") + 1, s.lastIndexOf("_jnpf")); + cl.setAfterVModel(s1); + cl.setTableName(s2); + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equalsIgnoreCase(s2)).findFirst().orElse(null); + cl.setDataType(tableModel.getFields().stream().filter(t -> t.getField().equalsIgnoreCase(s1)).findFirst().orElse(null).getDataType()); + } + ); + //副表 + Map> collect = searchListAll.stream().filter(s -> s.getId().matches(reg)).collect(Collectors.groupingBy(t -> t.getTableName())); + groupModels = collect.entrySet().stream().map(c -> { + ListSearchGroupModel groupModel = new ListSearchGroupModel(); + groupModel.setModelName(tableRenames.get(c.getKey())); + groupModel.setTableName(c.getKey()); + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equalsIgnoreCase(c.getKey())).findFirst().orElse(null); + groupModel.setForeignKey(tableModel.getTableField()); + groupModel.setMainKey(tableModel.getRelationField()); + groupModel.setSearchTypeModelList(c.getValue()); + return groupModel; + } + ).collect(Collectors.toList()); + + //子表 + Map> collect1 = searchListAll.stream().filter(s -> s.getId().toLowerCase().contains(JnpfKeyConsts.CHILD_TABLE_PREFIX)) + .collect(Collectors.groupingBy(t -> t.getId().substring(0, t.getId().lastIndexOf("_")))); + List collect2 = collect1.entrySet().stream().map(c -> { + ListSearchGroupModel groupModel = new ListSearchGroupModel(); + String tableName = childKeyTableNameMap.get(c.getKey()); + groupModel.setModelName(tableRenames.get(tableName)); + groupModel.setTableName(tableName); + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equalsIgnoreCase(tableName)).findFirst().orElse(null); + groupModel.setForeignKey(tableModel.getTableField()); + groupModel.setMainKey(tableModel.getRelationField()); + List value = c.getValue(); + value.stream().forEach(v -> { + String vmodelall = v.getId(); + String substring = vmodelall.substring(vmodelall.lastIndexOf("_") + 1); + v.setAfterVModel(substring); + }); + groupModel.setSearchTypeModelList(value); + return groupModel; + } + ).collect(Collectors.toList()); + groupModels.addAll(collect2); + + ListSearchGroupModel groupModel = new ListSearchGroupModel(); + groupModel.setSearchTypeModelList(searchListAll.stream().filter(s -> !s.getId().matches(reg) + && !s.getId().toLowerCase().contains(JnpfKeyConsts.CHILD_TABLE_PREFIX)).collect(Collectors.toList())); + groupModel.setTableName(mainTable.getTable()); + groupModel.setModelName(tableRenames.get(mainTable.getTable())); + groupModels.add(groupModel); + } + return groupModels; + } + + /** + * 封装数据 + * + * @param formAllModel + */ + private Map forDataMode(FormGenModel workGenModel, List formAllModel) { + VisualdevEntity entity = workGenModel.getEntity(); + //formTempJson + FormDataModel formData = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + List tableModelList = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + RecursionForm recursionForm = new RecursionForm(list, tableModelList); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + Map tableNameAll = tableName(tableModelList, workGenModel.getDownloadCodeForm()); + return tableNameAll; + } + + /** + * 封装数据 + * + * @param columndata + * @param model + * @param workGenModel + * @param isMast + */ + private void javaGenerate(Map columndata, Template7Model model, FormGenModel workGenModel, boolean isMast) { + CustomGenerator mpg = new CustomGenerator(columndata); + // 全局配置 + GlobalConfig gc = new GlobalConfig(); + gc.setFileOverride(true); + // 不需要ActiveRecord特性的请改为false + gc.setActiveRecord(false); + // XML 二级缓存 + gc.setEnableCache(false); + // XML ResultMap + gc.setBaseResultMap(false); + // XML columList + gc.setBaseColumnList(false); + gc.setAuthor(model.getCreateUser()); + gc.setOpen(false); + + // 自定义文件命名,注意 %s 会自动填充表实体属性! + String className = model.getClassName(); + if (isMast) { + gc.setControllerName(className + GenFileNameSuffix.CONTROLLER); + } + gc.setEntityName(className + GenFileNameSuffix.ENTITY); + gc.setMapperName(className + GenFileNameSuffix.MAPPER); + gc.setXmlName(className + GenFileNameSuffix.MAPPER_XML); + gc.setServiceName(className + GenFileNameSuffix.SERVICE); + gc.setServiceImplName(className + GenFileNameSuffix.SERVICEIMPL); + mpg.setGlobalConfig(gc); + + // 数据源配置 + UserInfo userInfo = workGenModel.getUserInfo(); + DbLinkEntity linkEntity = workGenModel.getLinkEntity(); + + mpg.setDataSource(SourceUtil.dbConfig(TenantDataSourceUtil.getTenantSchema(), linkEntity)); + + // 策略配置 + StrategyConfig strategy = new StrategyConfig(); + strategy.setEntityLombokModel(true); + // 表名生成策略 + strategy.setNaming(NamingStrategy.underline_to_camel); + // 需要生成的表 + String table = workGenModel.getTable(); + strategy.setInclude(table); + strategy.setRestControllerStyle(true); + mpg.setStrategy(strategy); + + // 包配置 + PackageConfig pc = new PackageConfig(); + DownloadCodeForm downloadCodeForm = workGenModel.getDownloadCodeForm(); + pc.setParent(downloadCodeForm.getModulePackageName() + "." + downloadCodeForm.getModule()); + mpg.setPackageInfo(pc); + + // 自定义配置 + InjectionConfig cfg = new InjectionConfig() { + @Override + public void initMap() { + // to do nothing + } + }; + List focList = new ArrayList<>(); + String javaPath = model.getServiceDirectory(); + String templatePath = workGenModel.getTemplatePath(); + String fileName = workGenModel.getFileName(); + String path = workGenModel.getTemplateCodePath(); + String flowWorkPath = "jnpf-workflow" + File.separator + "jnpf-workflow-form" + File.separator + "jnpf-workflow-form-%s" + File.separator + "src" + File.separator + "main" + File.separator + "java" + File.separator + "jnpf" + File.separator + "form" + File.separator + "%s"; + if (isMast) { + String controller = String.format(flowWorkPath, "controller", "controller"); + focList.add(new FileOutConfig("java" + File.separator + "Controller.java.vm") { + @Override + public String outputFile(TableInfo tableInfo) { + return javaPath + fileName + File.separator + "java" + File.separator + controller + File.separator + tableInfo.getControllerName() + StringPool.DOT_JAVA; + } + }); + } + String entity = String.format(flowWorkPath, "entity", "entity"); + focList.add(new FileOutConfig("java" + File.separator + "Entity.java.vm") { + @Override + public String outputFile(TableInfo tableInfo) { + List fieldAll = tableInfo.getFields(); + TableField mainTableField = fieldAll.stream().filter(tableField -> tableField.isKeyFlag()).findFirst().orElse(null); + fieldAll = fieldAll.stream().filter(DataControlUtils.distinctByKey(t -> t.getName())).collect(Collectors.toList()); + if (mainTableField != null) { + fieldAll.stream().filter(tableField -> tableField.getName().equals(mainTableField.getName())).forEach(t -> t.setKeyFlag(mainTableField.isKeyFlag())); + } + for (TableField field : fieldAll) { + String name = field.getName().toLowerCase().replaceAll("f_", ""); + field.setPropertyName(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, name)); + } + tableInfo.setFields(fieldAll); + return javaPath + fileName + File.separator + "java" + File.separator + entity + File.separator + tableInfo.getEntityName() + StringPool.DOT_JAVA; + } + }); + String mapper = String.format(flowWorkPath, "biz", "mapper"); + focList.add(new FileOutConfig("java" + File.separator + "Mapper.java.vm") { + @Override + public String outputFile(TableInfo tableInfo) { + return javaPath + fileName + File.separator + "java" + File.separator + mapper + File.separator + tableInfo.getMapperName() + StringPool.DOT_JAVA; + } + }); + String mapperxml = "resources" + File.separator + "mapper"; + focList.add(new FileOutConfig("java" + File.separator + "Mapper.xml.vm") { + @Override + public String outputFile(TableInfo tableInfo) { + return javaPath + fileName + File.separator + mapperxml + File.separator + tableInfo.getMapperName() + StringPool.DOT_XML; + } + }); + String service = String.format(flowWorkPath, "biz", "service"); + focList.add(new FileOutConfig("java" + File.separator + "Service.java.vm") { + @Override + public String outputFile(TableInfo tableInfo) { + return javaPath + fileName + File.separator + "java" + File.separator + service + File.separator + tableInfo.getServiceName() + StringPool.DOT_JAVA; + } + }); + String serviceImpl = String.format(flowWorkPath, "biz", "service" + File.separator + "impl"); + focList.add(new FileOutConfig("java" + File.separator + "ServiceImpl.java.vm") { + @Override + public String outputFile(TableInfo tableInfo) { + return javaPath + fileName + File.separator + "java" + File.separator + serviceImpl + File.separator + tableInfo.getServiceImplName() + StringPool.DOT_JAVA; + } + }); + cfg.setFileOutConfigList(focList); + mpg.setTemplate(new TemplateConfig().setXml(null).setMapper(null).setController(null).setEntity(null).setService(null).setServiceImpl(null)); + mpg.setCfg(cfg); + // 执行生成 + mpg.execute(path); + } + + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-controller/pom.xml b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-controller/pom.xml new file mode 100644 index 0000000..d1898ad --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-controller/pom.xml @@ -0,0 +1,27 @@ + + + + jnpf-visualdev-base + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-visualdev-base-controller + + + + com.jnpf + jnpf-visualdev-base-biz + ${project.version} + + + com.jnpf + jnpf-visualdev-onlinedev-biz + ${project.version} + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-controller/src/main/java/jnpf/base/controller/FilterController.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-controller/src/main/java/jnpf/base/controller/FilterController.java new file mode 100644 index 0000000..0ea67de --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-controller/src/main/java/jnpf/base/controller/FilterController.java @@ -0,0 +1,80 @@ +package jnpf.base.controller; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import jnpf.base.ActionResult; +import jnpf.base.entity.FilterEntity; +import jnpf.base.model.filter.FilterInfo; +import jnpf.base.model.filter.FilterQuery; +import jnpf.base.service.FilterService; +import jnpf.util.RandomUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +@RestController +@RequestMapping("/filter") +public class FilterController { + @Autowired + private FilterService filterService; + /** + * 获取列表 + * @param page + * @return + */ + @PostMapping("list") + public ActionResult list(@RequestBody @Validated FilterQuery page) { + QueryWrapper wrapper = new QueryWrapper<>(); + + + FilterQuery info = filterService.page(page, wrapper); + + return ActionResult.success(info); + } + + /** + * 查询信息 + * @param id + * @return + */ + @GetMapping("/{id}") + public ActionResult info(@PathVariable String id) { + FilterEntity info = filterService.getById(id); + return ActionResult.success(info); + } + /** + * 保存信息 + * @param info + * @return + */ + @PostMapping("save") + public ActionResult save(@RequestBody @Validated FilterInfo info) { + FilterEntity filterEntity = BeanUtil.copyProperties(info, FilterEntity.class); + filterEntity.setId(RandomUtil.uuId()); + filterService.save(filterEntity); + return ActionResult.success("保存成功"); + } + /** + * 更新信息 + * @param info + * @return + */ + @PutMapping("update") + public ActionResult update(@RequestBody @Validated FilterInfo info) { + + FilterEntity filterEntity = BeanUtil.copyProperties(info, FilterEntity.class); + filterService.updateById(filterEntity); + return ActionResult.success("更新成功"); + } + /** + * 删除信息 + * @param id + * @return + */ + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable String id) { + filterService.removeById(id); + return ActionResult.success("删除成功"); + } + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-controller/src/main/java/jnpf/base/controller/VisualdevController.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-controller/src/main/java/jnpf/base/controller/VisualdevController.java new file mode 100644 index 0000000..8f749b1 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-controller/src/main/java/jnpf/base/controller/VisualdevController.java @@ -0,0 +1,626 @@ +package jnpf.base.controller; + + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.annotation.SaMode; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.ObjectUtil; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.UserInfo; +import jnpf.base.entity.*; +import jnpf.base.model.*; +import jnpf.base.model.online.VisualMenuModel; +import jnpf.base.model.Template6.BtnData; +import jnpf.base.service.*; +import jnpf.base.util.VisualFlowFormUtil; +import jnpf.base.util.VisualUtil; +import jnpf.base.util.visualUtil.PubulishUtil; +import jnpf.base.vo.ListVO; +import jnpf.base.vo.PageListVO; +import jnpf.base.vo.PaginationVO; +import jnpf.constant.MsgCode; +import jnpf.engine.model.flowtemplate.FlowTemplateInfoVO; +import jnpf.exception.DataException; +import jnpf.exception.WorkFlowException; +import jnpf.model.visualJson.FieLdsModel; +import jnpf.model.visualJson.FormCloumnUtil; +import jnpf.model.visualJson.FormDataModel; +import jnpf.model.visualJson.TableModel; +import jnpf.model.visualJson.analysis.RecursionForm; +import jnpf.onlinedev.model.OnlineDevData; +import jnpf.onlinedev.model.PaginationModel; +import jnpf.onlinedev.service.VisualdevModelDataService; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.UserService; +import jnpf.util.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 可视化基础模块 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Tag(name = "可视化基础模块" , description = "Base" ) +@RestController +@RequestMapping("/api/visualdev/Base" ) +public class VisualdevController extends SuperController { + + @Autowired + private VisualdevService visualdevService; + @Autowired + private VisualdevReleaseService visualdevReleaseService; + @Autowired + private UserService userService; + @Autowired + private UserProvider userProvider; + @Autowired + private DictionaryDataService dictionaryDataService; + @Autowired + private VisualdevModelDataService visualdevModelDataService; + @Autowired + private PubulishUtil pubulishUtil; + @Autowired + private ModuleService moduleService; + @Autowired + private VisualFlowFormUtil visualFlowFormUtil; + @Autowired + private DataInterfaceService dataInterFaceApi; + @Autowired + private FilterService filterService; + + @Operation(summary = "获取功能列表" ) + @GetMapping + @SaCheckPermission(value = {"onlineDev.webDesign","generator.webForm","generator.flowForm"},mode = SaMode.OR) + public ActionResult> list(PaginationVisualdev paginationVisualdev) { + // 全部功能表单模板 + List data = visualdevService.getList(paginationVisualdev); + List userId = data.stream().map(t -> t.getCreatorUserId()).collect(Collectors.toList()); + List lastUserId = data.stream().map(t -> t.getLastModifyUserId()).collect(Collectors.toList()); + List userEntities = userService.getUserName(userId); + List lastUserIdEntities = userService.getUserName(lastUserId); + // 表单类型 + List dictionList = visualFlowFormUtil.getListByTypeDataCode(paginationVisualdev.getType()); + List modelAll = new LinkedList<>(); + + // 遍历功能表单模板 + for (VisualdevEntity entity : data) { + VisualFunctionModel model = JsonUtil.getJsonToBean(entity, VisualFunctionModel.class); + // 是否在表单类型中存在,若存在进行装配 + DictionaryDataEntity dataEntity = dictionList.stream().filter(t -> t.getId().equals(entity.getCategory())).findFirst().orElse(null); + //避免导入的功能丢失 + model.setCategory(dataEntity != null ? dataEntity.getFullName() : null); + UserEntity creatorUser = userEntities.stream().filter(t -> t.getId().equals(model.getCreatorUserId())).findFirst().orElse(null); + model.setCreatorUser(creatorUser != null ? creatorUser.getRealName() + "/" + creatorUser.getAccount() : "" ); + UserEntity lastmodifyuser = lastUserIdEntities.stream().filter(t -> t.getId().equals(model.getLastModifyUserId())).findFirst().orElse(null); + model.setLastModifyUser(lastmodifyuser != null ? lastmodifyuser.getRealName() + "/" + lastmodifyuser.getAccount() : "" ); + List moduleList = moduleService.getModuleList(entity.getId()); + model.setAppIsRelease(0); + model.setPcIsRelease(0); + if (moduleList.size() > 0) { + ModuleEntity appModuleEntity = moduleList.stream().filter(module -> "app".equalsIgnoreCase(module.getCategory())).findFirst().orElse(null); + ModuleEntity pcModuleEntity = moduleList.stream().filter(module -> "web".equalsIgnoreCase(module.getCategory())).findFirst().orElse(null); + model.setAppIsRelease(Objects.nonNull(appModuleEntity) ? 1 : 0); + model.setPcIsRelease(Objects.nonNull(pcModuleEntity) ? 1 : 0); + } + model.setIsRelease(entity.getState()); + if (Objects.equals(entity.getType(), 4)) { + model.setHasPackage(true); + } + modelAll.add(model); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(paginationVisualdev, PaginationVO.class); + return ActionResult.page(modelAll, paginationVO); + } + + @Operation(summary = "获取功能列表" ) + @GetMapping("/list") + public ActionResult> getList(PaginationVisualdev paginationVisualdev) { + List data = visualdevService.getPageList(paginationVisualdev); + List modelAll = JsonUtil.getJsonToList(data,VisualDevListVO.class); + PaginationVO paginationVO = JsonUtil.getJsonToBean(paginationVisualdev, PaginationVO.class); + return ActionResult.page(modelAll, paginationVO); + } + + + @Operation(summary = "获取功能列表下拉框" ) + @Parameters({ + @Parameter(name = "type", description = "类型(1-应用开发,2-移动开发,3-流程表单,4-Web表单,5-App表单)"), + @Parameter(name = "isRelease", description = "是否发布"), + @Parameter(name = "webType", description = "页面类型(1、纯表单,2、表单加列表,3、表单列表工作流、4、数据视图)"), + @Parameter(name = "enableFlow", description = "是否启用流程") + }) + @GetMapping("/Selector" ) + public ActionResult selectorList(Integer type, Integer isRelease, String webType, Integer enableFlow) { + List allList; + List list = new ArrayList<>(); + if (isRelease != null) { + List releaseEntities = visualdevReleaseService.selectorList(); + allList = JsonUtil.getJsonToList(releaseEntities, VisualdevEntity.class); + } else { + allList = visualdevService.selectorList(); + } + if (webType !=null){ + String[] webTypes = webType.split(","); + for (String wbType : webTypes){ + List collect; + if (enableFlow!=null){ + collect = allList.stream().filter(l -> l.getWebType().equals(Integer.valueOf(wbType)) && l.getEnableFlow().equals(enableFlow)).collect(Collectors.toList()); + } else { + collect = allList.stream().filter(l -> l.getWebType().equals(Integer.valueOf(wbType))).collect(Collectors.toList()); + } + list.addAll(collect); + } + }else { + list = allList; + } + List dataEntityList = new ArrayList<>(); + List voList = new ArrayList<>(); + HashSet cate = new HashSet<>(16); + if (type != null) { + list = list.stream().filter(t -> type.equals(t.getType())).collect(Collectors.toList()); + dataEntityList = visualFlowFormUtil.getListByTypeDataCode(type); + // 遍历数据字典得到外部分类 + for (DictionaryDataEntity dataEntity : dataEntityList) { + List num = list.stream().filter(t -> dataEntity.getId().equals(t.getCategory())).collect(Collectors.toList()); + if (num.size() <= 0) { + continue; + } + int i = cate.size(); + cate.add(dataEntity.getId()); + if (cate.size() == i + 1) { + VisualdevTreeVO visualdevTreeVO = new VisualdevTreeVO(); + visualdevTreeVO.setId(dataEntity.getId()); + visualdevTreeVO.setFullName(dataEntity.getFullName()); + visualdevTreeVO.setHasChildren(true); + voList.add(visualdevTreeVO); + } + } + } else { + // type为空时 + for (VisualdevEntity entity : list) { + DictionaryDataEntity dataEntity = visualFlowFormUtil.getdictionaryDataInfo(entity.getCategory()); + if (dataEntity != null) { + int i = cate.size(); + cate.add(dataEntity.getId()); + if (cate.size() == i + 1) { + VisualdevTreeVO visualdevTreeVO = new VisualdevTreeVO(); + visualdevTreeVO.setId(entity.getCategory()); + visualdevTreeVO.setFullName(dataEntity.getFullName()); + visualdevTreeVO.setHasChildren(true); + voList.add(visualdevTreeVO); + } + } + + } + } + for (VisualdevTreeVO vo : voList) { + List visualdevTreeChildModelList = new ArrayList<>(); + for (VisualdevEntity entity : list) { + if (vo.getId().equals(entity.getCategory())) { + VisualdevTreeChildModel model = JsonUtil.getJsonToBean(entity, VisualdevTreeChildModel.class); + visualdevTreeChildModelList.add(model); + } + } + vo.setChildren(visualdevTreeChildModelList); + } + ListVO listVO = new ListVO(); + listVO.setList(voList); + return ActionResult.success(listVO); + } + + @Operation(summary = "获取功能信息" ) + @Parameters({ + @Parameter(name = "id", description = "主键"), + }) + @GetMapping("/{id}" ) + @SaCheckPermission(value = {"onlineDev.webDesign","generator.webForm","generator.flowForm"},mode = SaMode.OR) + public ActionResult info(@PathVariable("id" ) String id) throws DataException { + UserInfo userInfo = userProvider.get(); + VisualdevEntity entity = visualdevService.getInfo(id); + VisualDevInfoVO vo = JsonUtilEx.getJsonToBeanEx(entity, VisualDevInfoVO.class); + DataInterfaceEntity info = dataInterFaceApi.getInfo(entity.getInterfaceId()); + if(info!=null){ + vo.setInterfaceName(info.getFullName()); + } + return ActionResult.success(vo); + } + + /** + * 获取表单主表属性下拉框 + * + * @param id + * @return + */ + @Operation(summary = "获取表单主表属性下拉框" ) + @Parameters({ + @Parameter(name = "id", description = "主键"), + @Parameter(name = "filterType", description = "过滤类型:1-按键事件选择字段列表过滤"), + }) + @GetMapping("/{id}/FormDataFields" ) + @SaCheckPermission("onlineDev.webDesign") + public ActionResult> getFormData(@PathVariable("id" ) String id,@RequestParam(value = "filterType",required = false)Integer filterType) { + List fieldList = visualdevModelDataService.fieldList(id,filterType); + ListVO listVO = new ListVO(); + listVO.setList(fieldList); + return ActionResult.success(listVO); + } + + /** + * 关联数据分页数据 + * + * @param id + * @param paginationModel + * @return + */ + @Operation(summary = "关联数据分页数据" ) + @Parameters({ + @Parameter(name = "id", description = "主键"), + }) + @GetMapping("/{id}/FieldDataSelect" ) + public ActionResult getFormData(@PathVariable("id" ) String id, PaginationModel paginationModel) { + VisualdevEntity entity = visualdevService.getReleaseInfo(id); + List> realList = visualdevModelDataService.getPageList(entity, paginationModel); + PaginationVO paginationVO = JsonUtil.getJsonToBean(paginationModel, PaginationVO.class); + return ActionResult.page(realList, paginationVO); + } + + + /** + * 复制功能 + * + * @param id + * @return + */ + @Operation(summary = "复制功能" ) + @Parameters({ + @Parameter(name = "id", description = "主键"), + }) + @PostMapping("/{id}/Actions/Copy" ) + @SaCheckPermission(value = {"onlineDev.webDesign","generator.webForm","generator.flowForm"},mode = SaMode.OR) + public ActionResult copyInfo(@PathVariable("id" ) String id) throws WorkFlowException { + VisualdevReleaseEntity releaseEntity = visualdevReleaseService.getById(id); + boolean b = releaseEntity != null; + VisualdevEntity entity; + //已发布取发布版本 + if (b) { + entity = JsonUtil.getJsonToBean(releaseEntity, VisualdevEntity.class); + } else { + entity = visualdevService.getInfo(id); + } + String copyNum = UUID.randomUUID().toString().substring(0, 5); + entity.setFullName(entity.getFullName() + ".副本" + copyNum); + entity.setLastModifyTime(null); + entity.setLastModifyUserId(null); + entity.setCreatorTime(null); + entity.setId(RandomUtil.uuId()); + entity.setEnCode(entity.getEnCode() + copyNum); + VisualdevEntity entity1 = JsonUtil.getJsonToBean(entity, VisualdevEntity.class); + if (entity1.getEnCode().length() > 50 || entity1.getFullName().length() > 50) { + return ActionResult.fail("已到达该模板复制上限,请复制源模板" ); + } + //启用流程,流程先保存如果不成功直接提示。//>3属于代码生成。不自动创建 + if (OnlineDevData.STATE_ENABLE == entity1.getEnableFlow() && entity1.getType() < 3) { + //生成流程 + ActionResult result = visualFlowFormUtil.saveOrUpdateFlowTemp(entity1, OnlineDevData.STATE_DISABLE, true); + if (200 != result.getCode()) { + return ActionResult.fail("同步到流程时," + result.getMsg()); + } + //生成表单 + visualFlowFormUtil.saveOrUpdateForm(entity1, OnlineDevData.STATE_ENABLE, true); + } + visualdevService.create(entity1); + return ActionResult.success("复制功能成功" ); + } + + + /** + * 更新功能状态 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "更新功能状态" ) + @Parameters({ + @Parameter(name = "id", description = "主键"), + }) + @PutMapping("/{id}/Actions/State" ) + @SaCheckPermission(value = {"onlineDev.webDesign","generator.webForm","generator.flowForm"},mode = SaMode.OR) + public ActionResult update(@PathVariable("id" ) String id) throws Exception { + VisualdevEntity entity = visualdevService.getInfo(id); + if (entity != null) { + boolean flag = visualdevService.update(entity.getId(), entity); + if (flag == false) { + return ActionResult.fail("更新失败,任务不存在" ); + } + } + return ActionResult.success(MsgCode.SU004.get()); + } + + + @Operation(summary = "新建功能" ) + @PostMapping + @SaCheckPermission(value = {"onlineDev.webDesign","generator.webForm","generator.flowForm"},mode = SaMode.OR) + public ActionResult create(@RequestBody VisualDevCrForm visualDevCrForm) throws Exception { + VisualdevEntity entity = JsonUtil.getJsonToBean(JsonUtilEx.getObjectToString(visualDevCrForm), VisualdevEntity.class); + if (visualdevService.getObjByEncode(entity.getEnCode(), entity.getType()) > 0) { + return ActionResult.fail("编码重复" ); + } + if (visualdevService.getCountByName(entity.getFullName(), entity.getType()) > 0) { + return ActionResult.fail("名称重复" ); + } + List tableModelList = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + FormDataModel formData = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + + //判断子表是否复用 + RecursionForm recursionForm = new RecursionForm(); + if (ObjectUtil.isNotNull(formData)) { + //判断有表是否满足主键策略 + if (tableModelList.size() > 0) { + boolean isIncre = Objects.equals(formData.getPrimaryKeyPolicy(),2) ; + String strategy = !isIncre ? "[雪花ID]" : "[自增长id]"; + for (TableModel tableModel : tableModelList){ + Boolean isAutoIncre = visualdevService.getPrimaryDbField(entity.getDbLinkId(), tableModel.getTable()); + if(isAutoIncre == null){ + return ActionResult.fail("表["+tableModel.getTable()+"]无主键!"); + } + if (isIncre!=isAutoIncre){ + return ActionResult.fail("主键策略:"+ strategy +",与表["+tableModel.getTable()+"]主键策略不一致!"); + } + } + } + + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + recursionForm.setList(list); + recursionForm.setTableModelList(tableModelList); + if (FormCloumnUtil.repetition(recursionForm, new ArrayList<>())) { + return ActionResult.fail("子表重复" ); + } + } + if (StringUtil.isEmpty(entity.getId())) { + entity.setId(RandomUtil.uuId()); + } + //启用流程,流程先保存如果不成功直接提示。//>3属于代码生成。不自动创建 + if (OnlineDevData.STATE_ENABLE == entity.getEnableFlow() && entity.getType() < 3) { + //生成流程 + ActionResult result = visualFlowFormUtil.saveOrUpdateFlowTemp(entity, OnlineDevData.STATE_DISABLE, true); + if (200 != result.getCode()) { + return ActionResult.fail("同步到流程时," + result.getMsg()); + } + //生成表单 + visualFlowFormUtil.saveOrUpdateForm(entity, OnlineDevData.STATE_ENABLE, true); + } + visualdevService.create(entity); + + return ActionResult.success(MsgCode.SU001.get()); + } + + @Operation(summary = "修改功能" ) + @Parameters({ + @Parameter(name = "id", description = "主键"), + }) + @PutMapping("/{id}" ) + @SaCheckPermission(value = {"onlineDev.webDesign","generator.webForm","generator.flowForm"},mode = SaMode.OR) + public ActionResult update(@PathVariable("id" ) String id, @RequestBody VisualDevUpForm visualDevUpForm) throws Exception { + VisualdevEntity visualdevEntity = visualdevService.getInfo(id); + String enCode = visualdevEntity.getEnCode(); + String fullName = visualdevEntity.getFullName(); + VisualdevEntity entity = JsonUtil.getJsonToBean(JsonUtilEx.getObjectToString(visualDevUpForm), VisualdevEntity.class); + List tableModelList = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + Map tableMap = visualdevService.getTableMap(entity.getFormData()); + // 如果不是在线的,默认更新所有配置 + if(!"1".equals(visualDevUpForm.getType())){ + filterService.updateRuleList(id,entity,1,1,tableMap); + } + if (!enCode.equals(visualDevUpForm.getEnCode())) { + if (visualdevService.getObjByEncode(entity.getEnCode(), entity.getType()) > 0) { + return ActionResult.fail("编码重复" ); + } + } + if (!fullName.equals(visualDevUpForm.getFullName())) { + if (visualdevService.getCountByName(entity.getFullName(), entity.getType()) > 0) { + return ActionResult.fail("名称重复" ); + } + } + VisualdevReleaseEntity releaseEntity = visualdevReleaseService.getById(id); + //是否发布 + if (releaseEntity != null && !VisualWebTypeEnum.DATA_VIEW.getType().equals(releaseEntity.getWebType())) { + if (tableModelList.size() == 0) { + return ActionResult.fail(MsgCode.VS408.get()); + } + } + + //判断子表是否复用 + if (tableModelList.size() > 0) { + RecursionForm recursionForm = new RecursionForm(); + FormDataModel formData = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + if (ObjectUtil.isNotNull(formData)) { + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + recursionForm.setList(list); + recursionForm.setTableModelList(tableModelList); + if (FormCloumnUtil.repetition(recursionForm, new ArrayList<>())) { + return ActionResult.fail("子表重复" ); + } + } + } + + //修改流程表单同步信息 type<3属于功能设计 + if (OnlineDevData.STATE_ENABLE == entity.getEnableFlow() && entity.getType() < 3) { + entity.setId(id); + //生成表单 + visualFlowFormUtil.saveOrUpdateForm(entity, OnlineDevData.STATE_ENABLE, true); + //启用流程,修改流程基础信息 + FlowTemplateInfoVO templateInfo = visualFlowFormUtil.getTemplateInfo(visualdevEntity.getId()); + //编辑时不改变流程基础信息,若没有流程则创建 + if(templateInfo==null){ + ActionResult result = visualFlowFormUtil.saveOrUpdateFlowTemp(entity, OnlineDevData.STATE_DISABLE, true); + if (200 != result.getCode()) { + return ActionResult.fail("同步到流程时," + result.getMsg()); + } + } + visualFlowFormUtil.saveOrUpdateForm(entity, OnlineDevData.STATE_ENABLE, false); + } + //修改状态 + boolean released = Objects.equals(visualdevEntity.getState(),1); +// boolean json = !Objects.equals(visualdevEntity.getColumnData(), visualDevUpForm.getColumnData()) +// || !Objects.equals(visualdevEntity.getVisualTables(), visualDevUpForm.getTables()) +// || !Objects.equals(visualdevEntity.getAppColumnData(), visualDevUpForm.getAppColumnData()) +// || !Objects.equals(visualdevEntity.getFormData(), visualDevUpForm.getFormData()); + if (visualdevEntity != null && released) { + entity.setState(2); + } + boolean flag = visualdevService.update(id, entity); + if (flag == false) { + return ActionResult.fail(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + + @Operation(summary = "删除功能" ) + @Parameters({ + @Parameter(name = "id", description = "主键"), + }) + @DeleteMapping("/{id}" ) + @SaCheckPermission(value = {"onlineDev.webDesign","generator.webForm","generator.flowForm"},mode = SaMode.OR) + public ActionResult delete(@PathVariable("id" ) String id) throws WorkFlowException { + VisualdevEntity entity = visualdevService.getInfo(id); + if (entity != null) { + visualdevService.delete(entity); + visualdevReleaseService.removeById(id); + //启用流程的情况,需要删除流程,删除成功与否不管。 + if (OnlineDevData.STATE_ENABLE == entity.getEnableFlow()) { + visualFlowFormUtil.deleteFlowForm(entity.getId()); + visualFlowFormUtil.deleteTemplateInfo(entity.getId()); + } + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + @Operation(summary = "获取模板按钮和列表字段" ) + @Parameters({ + @Parameter(name = "moduleId", description = "模板id"), + }) + @GetMapping("/ModuleBtn" ) + @SaCheckPermission(value = {"onlineDev.webDesign","generator.webForm","generator.flowForm"},mode = SaMode.OR) + public ActionResult getModuleBtn(String moduleId) { + VisualdevEntity visualdevEntity = visualdevService.getInfo(moduleId); + //去除模板中的F_ + VisualUtil.delfKey(visualdevEntity); + List btnData = new ArrayList<>(); + Map column = JsonUtil.stringToMap(visualdevEntity.getColumnData()); + if (column.get("columnBtnsList" ) != null) { + btnData.addAll(JsonUtil.getJsonToList(JsonUtil.getJsonToListMap(column.get("columnBtnsList" ).toString()), BtnData.class)); + } + if (column.get("btnsList" ) != null) { + btnData.addAll(JsonUtil.getJsonToList(JsonUtil.getJsonToListMap(column.get("btnsList" ).toString()), BtnData.class)); + } + return ActionResult.success(btnData); + } + + @Operation(summary = "发布模板" ) + @Parameters({ + @Parameter(name = "id", description = "主键"), + }) + @PostMapping("/{id}/Actions/Release" ) + @SaCheckPermission(value = {"onlineDev.webDesign","generator.webForm","generator.flowForm"},mode = SaMode.OR) + public ActionResult publish(@PathVariable("id" ) String id, @RequestBody VisualDevPubModel visualDevPubModel) throws Exception { + //草稿 + VisualdevEntity visualdevEntity = visualdevService.getInfo(id); + //启用流程判断流程是否设计完成 + if(OnlineDevData.STATE_ENABLE.equals(visualdevEntity.getEnableFlow())){ + FlowTemplateInfoVO templateInfo = visualFlowFormUtil.getTemplateInfo(id); + if(templateInfo==null||StringUtil.isEmpty(templateInfo.getFlowTemplateJson())||"[]".equals(templateInfo.getFlowTemplateJson())){ + return ActionResult.fail("发布失败,流程未设计!" ); + } + } + + List tableModels = JsonUtil.getJsonToList(visualdevEntity.getVisualTables(), TableModel.class); + //数据视图不判断formdata + if (!VisualWebTypeEnum.DATA_VIEW.getType().equals(visualdevEntity.getWebType())) { + String s = VisualUtil.checkPublishVisualModel(visualdevEntity, "发布" ); + if (s != null) { + return ActionResult.fail(s); + } + if (tableModels.size() == 0) { + try { + visualdevService.createTable(visualdevEntity); + } catch (WorkFlowException e) { + e.printStackTrace(); + return ActionResult.fail("无表生成有表失败" ); + } + } + Map tableMap = visualdevService.getTableMap(visualdevEntity.getFormData()); + filterService.updateRuleList(id,visualdevEntity,visualDevPubModel.getApp(),visualDevPubModel.getPc(),tableMap); + } + //线上 + VisualdevEntity clone = new VisualdevEntity(); + BeanUtil.copyProperties(visualdevEntity,clone); + //更新功能-表写入 菜单创建成功后 + //创表回写 + visualdevService.update(id,visualdevEntity); + + //将线上版本发布 + VisualMenuModel visual = VisualUtil.getVisual(clone, visualDevPubModel); + visual.setApp(visualDevPubModel.getApp()); + visual.setPc(visualDevPubModel.getPc()); + visual.setAppModuleParentId(visualDevPubModel.getAppModuleParentId()); + if (StringUtil.isEmpty(visualDevPubModel.getPcSystemId()) && StringUtil.isNotEmpty(visualDevPubModel.getPcModuleParentId())) { + visual.setPcModuleParentId("-1"); + } else { + visual.setPcModuleParentId(visualDevPubModel.getPcModuleParentId()); + } + visual.setPcSystemId(Optional.ofNullable(visualDevPubModel.getPcSystemId()).orElse(visualDevPubModel.getPcModuleParentId())); + visual.setAppSystemId(Optional.ofNullable(visualDevPubModel.getAppSystemId()).orElse(visualDevPubModel.getAppModuleParentId())); + visual.setType(3); + Integer integer = pubulishUtil.publishMenu(visual); + if (integer == 2) { + return ActionResult.fail("同步失败,检查编码或名称是否重复" ); + } + if (integer == 3) { + return ActionResult.fail("未找到同步路径,请刷新界面" ); + } + //更新状态 + visualdevEntity.setState(1); + visualdevEntity.setEnabledMark(1); + visualdevService.updateById(visualdevEntity); + VisualdevReleaseEntity releaseEntity = JsonUtil.getJsonToBean(clone, VisualdevReleaseEntity.class); + visualdevReleaseService.saveOrUpdate(releaseEntity); + // 启用流程 在表单新增一条 提供给流程使用 + if (OnlineDevData.STATE_ENABLE == visualdevEntity.getEnableFlow()) { + visualFlowFormUtil.saveOrUpdateForm(clone, OnlineDevData.STATE_ENABLE, false); + visualFlowFormUtil.saveOrUpdateFlowTemp(visualdevEntity, OnlineDevData.STATE_ENABLE, false); + } + return ActionResult.success("同步成功" ); + } + + @Operation(summary = "回滚模板" ) + @Parameters({ + @Parameter(name = "id", description = "主键"), + }) + @GetMapping("/{id}/Actions/RollbackTemplate" ) + @SaCheckPermission(value = {"onlineDev.webDesign","generator.webForm","generator.flowForm"},mode = SaMode.OR) + public ActionResult RollbackTemplate(@PathVariable("id" ) String id) { + VisualdevReleaseEntity releaseEntity = visualdevReleaseService.getById(id); + boolean b = releaseEntity == null; + if (b) { + return ActionResult.fail("回滚失败,暂无线上版本" ); + } else { + VisualdevEntity visualdevEntity = JsonUtil.getJsonToBean(releaseEntity, VisualdevEntity.class); + visualdevService.updateById(visualdevEntity); + } + return ActionResult.success("回滚成功" ); + } + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-controller/src/main/java/jnpf/base/controller/VisualdevShortLinkController.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-controller/src/main/java/jnpf/base/controller/VisualdevShortLinkController.java new file mode 100644 index 0000000..04b96d7 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-controller/src/main/java/jnpf/base/controller/VisualdevShortLinkController.java @@ -0,0 +1,399 @@ +package jnpf.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import com.alibaba.fastjson.JSONObject; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.model.ColumnDataModel; +import jnpf.base.model.VisualDevJsonModel; +import jnpf.base.model.VisualWebTypeEnum; +import jnpf.util.NoDataSourceBind; +import jnpf.base.UserInfo; +import jnpf.base.entity.VisualdevEntity; +import jnpf.base.entity.VisualdevReleaseEntity; +import jnpf.base.entity.VisualdevShortLinkEntity; +import jnpf.base.model.shortLink.*; +import jnpf.base.service.DbLinkService; +import jnpf.base.service.VisualdevReleaseService; +import jnpf.base.service.VisualdevService; +import jnpf.base.service.VisualdevShortLinkService; +import jnpf.base.util.VisualUtil; +import jnpf.base.vo.PaginationVO; +import jnpf.config.ConfigValueUtil; +import jnpf.config.JnpfOauthConfig; +import jnpf.constant.MsgCode; +import jnpf.consts.DeviceType; +import jnpf.database.model.entity.DbLinkEntity; +import jnpf.database.util.TenantDataSourceUtil; +import jnpf.exception.DataException; +import jnpf.exception.LoginException; +import jnpf.exception.WorkFlowException; +import jnpf.model.flow.DataModel; +import jnpf.model.visualJson.FormDataModel; +import jnpf.onlinedev.model.OnlineDevData; +import jnpf.model.visualJson.TableModel; +import jnpf.model.visualJson.FieLdsModel; +import jnpf.onlinedev.model.DataInfoVO; +import jnpf.onlinedev.model.PaginationModel; +import jnpf.onlinedev.model.VisualdevModelDataCrForm; +import jnpf.onlinedev.model.VisualdevModelDataInfoVO; +import jnpf.onlinedev.service.VisualDevInfoService; +import jnpf.onlinedev.service.VisualDevListService; +import jnpf.onlinedev.service.VisualdevModelDataService; +import jnpf.onlinedev.util.onlineDevUtil.OnlinePublicUtils; +import jnpf.onlinedev.util.onlineDevUtil.OnlineSwapDataUtils; +import jnpf.service.FormDataService; +import jnpf.util.*; +import jnpf.util.context.RequestContext; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.sql.SQLException; +import java.text.ParseException; +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * 在线开发表单外链Controller + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/12/30 11:33:17 + */ +@Tag(name = "表单外链" , description = "BaseShortLink" ) +@RestController +@RequestMapping("/api/visualdev/ShortLink" ) +public class VisualdevShortLinkController extends SuperController { + + @Autowired + private VisualdevShortLinkService visualdevShortLinkService; + + @Autowired + private UserProvider userProvider; + + @Autowired + private JnpfOauthConfig oauthConfig; + + @Autowired + private ConfigValueUtil configValueUtil; + + @Autowired + protected AuthUtil authUtil; + + @Autowired + private VisualdevService visualdevService; + @Autowired + private VisualdevReleaseService visualdevReleaseService; + @Autowired + private FormDataService formDataService; + + @Autowired + private DbLinkService dblinkService; + @Autowired + private FormCheckUtils formCheckUtils; + @Autowired + private VisualdevModelDataService visualdevModelDataService; + @Autowired + private OnlineSwapDataUtils onlineSwapDataUtils; + @Autowired + private VisualDevListService visualDevListService; + @Autowired + private VisualDevInfoService visualDevInfoService; + + @Operation(summary = "获取外链信息" ) + @Parameters({ + @Parameter(name = "id" , description = "主键" ), + }) + @GetMapping("/{id}" ) + @SaCheckPermission("onlineDev.webDesign" ) + public ActionResult getInfo(@PathVariable("id" ) String id) { + VisualdevShortLinkEntity info = visualdevShortLinkService.getById(id); + VisualdevShortLinkVo vo; + if (info != null) { + vo = JsonUtil.getJsonToBean(info, VisualdevShortLinkVo.class); + } else { + vo = new VisualdevShortLinkVo(); + vo.setId(id); + } + vo.setFormLink(geturl(id, "form" )); + vo.setColumnLink(geturl(id, "list" )); + return ActionResult.success(vo); + } + + /** + * 获取url + * + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2023/3/9 + */ + private String geturl(String id, String type) { + String url = oauthConfig.getJnpfDomain() + "/api/visualdev/ShortLink/trigger/" + id + "?encryption="; + UserInfo userInfo = userProvider.get(); + JSONObject obj = new JSONObject(); + obj.put("type" , type); + if (configValueUtil.isMultiTenancy()) { + obj.put("tenantId" , userInfo.getTenantId()); + } + //参数加密 + String encryption = DesUtil.aesOrDecode(obj.toJSONString(), true,true); + url += encryption; + return url; + } + + + @Operation(summary = "修改外链信息" ) + @PutMapping("" ) + @SaCheckPermission("onlineDev.webDesign" ) + public ActionResult saveOrupdate(@RequestBody VisualdevShortLinkForm data) { + VisualdevShortLinkEntity entity = JsonUtil.getJsonToBean(data, VisualdevShortLinkEntity.class); + if(entity.getFormLink().contains(oauthConfig.getJnpfDomain())){ + entity.setFormLink(entity.getFormLink().replace(oauthConfig.getJnpfDomain(),"")); + } + if(entity.getColumnLink().contains(oauthConfig.getJnpfDomain())){ + entity.setColumnLink(entity.getColumnLink().replace(oauthConfig.getJnpfDomain(),"")); + } + VisualdevShortLinkEntity info = visualdevShortLinkService.getById(data.getId()); + UserInfo userInfo = userProvider.get(); + if (info != null) { + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(userInfo.getUserId()); + } else { + entity.setCreatorTime(new Date()); + entity.setCreatorUserId(userInfo.getUserId()); + } + + String pcLink = "/formShortLink"; + String appLink ="/pages/formShortLink/index"; + entity.setRealPcLink(pcLink); + entity.setRealAppLink(appLink); + entity.setUserId(userInfo.getUserId()); + entity.setTenantId(userInfo.getTenantId()); + visualdevShortLinkService.saveOrUpdate(entity); + return ActionResult.success(MsgCode.SU002.get()); + } + + /** + * 参数解密切换数据源 + * + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2023/3/9 + */ + private VisualdevShortLinkModel aesDecodeMatchDatabase(String encryption) throws LoginException { + //参数解密 + String str = DesUtil.aesOrDecode(encryption, false,true); + if (StringUtil.isEmpty(str)) { + throw new LoginException("参数解析错误!" ); + } + VisualdevShortLinkModel model = JsonUtil.getJsonToBean(str, VisualdevShortLinkModel.class); + if (configValueUtil.isMultiTenancy()) { + if (StringUtil.isNotEmpty(model.getTenantId())) { + //切换成租户库 + TenantDataSourceUtil.switchTenant(model.getTenantId()); + } else { + throw new LoginException("缺少租户信息!" ); + } + } + return model; + } + + @NoDataSourceBind + @Operation(summary = "外链请求入口" ) + @Parameters({ + @Parameter(name = "id" , description = "主键" ), + }) + @GetMapping("/trigger/{id}" ) + public ActionResult getlink(@PathVariable("id" ) String id, + @RequestParam(value = "encryption" ) String encryption, + HttpServletResponse response) throws LoginException, IOException { + VisualdevShortLinkModel model = aesDecodeMatchDatabase(encryption); + String link = ""; + VisualdevShortLinkEntity entity = visualdevShortLinkService.getById(id); + DeviceType deviceType = UserProvider.getDeviceForAgent(); + if (entity != null) { + if (DeviceType.PC.equals(deviceType)) { + link = oauthConfig.getJnpfFrontDomain() + entity.getRealPcLink(); + } else { + link = oauthConfig.getJnpfAppDomain() + entity.getRealAppLink(); + } + } else { + return ActionResult.fail("无效链接" ); + } + JSONObject obj = new JSONObject(); + obj.put("modelId" , id); + obj.put("type" , model.getType()); + if (configValueUtil.isMultiTenancy()) { + obj.put("tenantId" , model.getTenantId()); + } + //新链接参数加密 + String encryptionNew = DesUtil.aesOrDecode(obj.toJSONString(), true,true); + link += "?encryption=" + encryptionNew; +// link += "&modelId=" + id; + response.sendRedirect(link); + return ActionResult.success(MsgCode.SU000.get()); + } + + @NoDataSourceBind + @Operation(summary = "获取外链配置" ) + @Parameters({ + @Parameter(name = "id" , description = "主键" ), + }) + @GetMapping("/getConfig/{id}" ) + public ActionResult getConfig(@PathVariable("id" ) String id, @RequestParam("encryption" ) String encryption) throws LoginException { + aesDecodeMatchDatabase(encryption); + + VisualdevShortLinkEntity info = visualdevShortLinkService.getById(id); + VisualdevShortLinkConfigVo vo = JsonUtil.getJsonToBean(info, VisualdevShortLinkConfigVo.class); + vo.setFormLink(geturl(id, "form" )); + vo.setColumnLink(geturl(id, "list" )); + return ActionResult.success(vo); + } + + @NoDataSourceBind + @Operation(summary = "密码验证" ) + @PostMapping("/checkPwd" ) + public ActionResult checkPwd(@RequestBody VisualdevShortLinkPwd form) throws LoginException { + //参数解密 + VisualdevShortLinkModel model = aesDecodeMatchDatabase(form.getEncryption()); + + VisualdevShortLinkEntity info = visualdevShortLinkService.getById(form.getId()); + boolean flag = false; + if (OnlineDevData.STATE_ENABLE.equals(info.getFormPassUse()) && 0 == form.getType()) { + if (Md5Util.getStringMd5(info.getFormPassword()).equals(form.getPassword())) { + flag = true; + } + } else if (OnlineDevData.STATE_ENABLE.equals(info.getColumnPassUse()) && 1 == form.getType()) { + if (Md5Util.getStringMd5(info.getColumnPassword()).equals(form.getPassword())) { + flag = true; + } + } + if (flag) { + return ActionResult.success(); + } + return ActionResult.fail("密码错误!" ); + } + + @NoDataSourceBind + @Operation(summary = "获取列表表单配置JSON" ) + @GetMapping("/{modelId}/Config" ) + public ActionResult getData(@PathVariable("modelId" ) String modelId, @RequestParam(value = "type" , required = false) String type, + @RequestParam("encryption" ) String encryption) throws WorkFlowException, LoginException { + aesDecodeMatchDatabase(encryption); + VisualdevEntity entity; + //线上版本 + if ("0".equals(type)) { + entity = visualdevService.getInfo(modelId); + } else { + VisualdevReleaseEntity releaseEntity = visualdevReleaseService.getById(modelId); + entity = JsonUtil.getJsonToBean(releaseEntity, VisualdevEntity.class); + } + if (entity == null) { + return ActionResult.fail("未找到该功能表单" ); + } + if (!VisualWebTypeEnum.DATA_VIEW.getType().equals(entity.getWebType())) { + String s = VisualUtil.checkPublishVisualModel(entity, "预览" ); + if (s != null) { + return ActionResult.fail(s); + } + } + DataInfoVO vo = JsonUtil.getJsonToBean(entity, DataInfoVO.class); + return ActionResult.success(vo); + } + + @NoDataSourceBind + @Operation(summary = "外链数据列表" ) + @Parameters({ + @Parameter(name = "modelId" , description = "模板id" ), + }) + @PostMapping("/{modelId}/ListLink" ) + public ActionResult ListLink(@PathVariable("modelId" ) String modelId, @RequestParam("encryption" ) String encryption, + @RequestBody PaginationModel paginationModel) throws WorkFlowException, LoginException { + aesDecodeMatchDatabase(encryption); + + VisualdevReleaseEntity visualdevEntity = visualdevReleaseService.getById(modelId); + VisualDevJsonModel visualJsonModel = OnlinePublicUtils.getVisualJsonModel(visualdevEntity); + //判断请求客户端来源 + if (!RequestContext.isOrignPc()) { + visualJsonModel.setColumnData(visualJsonModel.getAppColumnData()); + } + List> realList; + if (VisualWebTypeEnum.DATA_VIEW.getType().equals(visualdevEntity.getWebType())) {// + //数据视图的接口数据获取、 + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(visualdevEntity.getColumnData(), ColumnDataModel.class); + realList = onlineSwapDataUtils.getInterfaceData(visualdevEntity, paginationModel, columnDataModel); + } else { + realList = visualDevListService.getDataListLink(visualJsonModel, paginationModel); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(paginationModel, PaginationVO.class); + return ActionResult.page(realList, paginationVO); + } + + @NoDataSourceBind + @Operation(summary = "获取数据信息(带转换数据)" ) + @Parameters({ + @Parameter(name = "modelId" , description = "模板id" ), + @Parameter(name = "id" , description = "数据id" ), + }) + @GetMapping("/{modelId}/{id}/DataChange" ) + public ActionResult infoWithDataChange(@PathVariable("modelId" ) String modelId, @PathVariable("id" ) String id, + @RequestParam("encryption" ) String encryption) throws DataException, ParseException, IOException, SQLException, LoginException { + aesDecodeMatchDatabase(encryption); + + modelId = XSSEscape.escape(modelId); + id = XSSEscape.escape(id); + VisualdevEntity visualdevEntity = visualdevService.getReleaseInfo(modelId); + //有表 + if (!StringUtil.isEmpty(visualdevEntity.getVisualTables()) && !OnlineDevData.TABLE_CONST.equals(visualdevEntity.getVisualTables())) { + VisualdevModelDataInfoVO vo = visualDevInfoService.getDetailsDataInfo(id, visualdevEntity); + return ActionResult.success(vo); + } + //无表 + VisualdevModelDataInfoVO vo = visualdevModelDataService.infoDataChange(id, visualdevEntity); + return ActionResult.success(vo); + } + + //**********以下微服务和单体不同 + @NoDataSourceBind + @Operation(summary = "添加数据" ) + @Parameters({ + @Parameter(name = "modelId" , description = "模板id" ), + @Parameter(name = "visualdevModelDataCrForm" , description = "功能数据创建表单" ), + }) + @PostMapping("/{modelId}" ) + public ActionResult create(@PathVariable("modelId" ) String modelId, @RequestParam("encryption" ) String encryption, + @RequestBody VisualdevModelDataCrForm visualdevModelDataCrForm) throws WorkFlowException, LoginException { + VisualdevShortLinkModel visualdevShortLinkModel = aesDecodeMatchDatabase(encryption); + VisualdevShortLinkEntity info = visualdevShortLinkService.getById(modelId); + if (1 != info.getFormUse()) { + return ActionResult.fail("未开启表单外链!" ); + } + visualdevModelDataCrForm.setIsLink(true); + String tenantId=visualdevShortLinkModel.getTenantId(); + try { + if (configValueUtil.isMultiTenancy()) { + if (StringUtil.isNotEmpty(tenantId)) { + //切换成租户库 + TenantDataSourceUtil.switchTenant(tenantId); + } else { + return ActionResult.fail("缺少租户信息" ); + } + } + VisualdevEntity visualdevEntity = visualdevService.getReleaseInfo(modelId); + Map map = JsonUtil.stringToMap(visualdevModelDataCrForm.getData()); + visualdevModelDataService.visualCreate(visualdevEntity, map); + }catch (Exception e){ + throw new WorkFlowException(e.getMessage()); + } + return ActionResult.success(MsgCode.SU001.get()); + } +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/pom.xml b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/pom.xml new file mode 100644 index 0000000..1152e66 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/pom.xml @@ -0,0 +1,22 @@ + + + + jnpf-visualdev-base + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-visualdev-base-entity + + + + com.jnpf + jnpf-common-all + ${project.version} + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/entity/FilterEntity.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/entity/FilterEntity.java new file mode 100644 index 0000000..4e833b2 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/entity/FilterEntity.java @@ -0,0 +1,29 @@ +package jnpf.base.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + + +@Data +@TableName("base_visual_filter") +public class FilterEntity extends SuperExtendEntity { + /** + * 在线和代码生成记录主键 + */ + @TableField("F_MODULE_ID") + private String moduleId; + + /** + * 过滤配置 + */ + @TableField("F_CONFIG") + private String config; + + /** + * 过滤配置app + */ + @TableField("F_CONFIG_APP") + private String configApp; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/entity/VisualdevEntity.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/entity/VisualdevEntity.java new file mode 100644 index 0000000..4836c10 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/entity/VisualdevEntity.java @@ -0,0 +1,110 @@ +package jnpf.base.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; + +import java.util.Date; + +/** + * + * 可视化开发功能表 + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-04-02 + */ +@Data +@TableName("base_visual_dev") +public class VisualdevEntity extends SuperExtendEntity.SuperExtendDEEntity { + /** + * 名称 + */ + @TableField("F_FULL_NAME") + private String fullName; + + /** + * 编码 + */ + @TableField("F_EN_CODE") + private String enCode; + + /** + * 状态(0-暂存(默认),1-发布) + */ + @TableField("F_STATE") + private Integer state; + + /** + * 类型(1-应用开发,2-移动开发,3-流程表单,4-Web表单,5-App表单) + */ + @TableField("F_TYPE") + private Integer type; + + /** + * 关联的表 + */ + @TableField("F_TABLES_DATA") + @JSONField(name = "tables") + private String visualTables; + + /** + * 分类(数据字典) + */ + @TableField("F_CATEGORY") + private String category; + + /** + * 表单配置JSON + */ + @TableField("F_FORM_DATA") + private String formData; + + /** + * 列表配置JSON + */ + @TableField("F_COLUMN_DATA") + private String columnData; + + /** + * 关联数据连接id + */ + @TableField("F_DB_LINK_ID") + private String dbLinkId; + + /** + * 页面类型(1、纯表单,2、表单加列表,3、表单列表工作流,4、数据视图) + */ + @TableField("F_WEB_TYPE") + private Integer webType; + + /** + * 关联工作流连接id + */ + @TableField("F_FLOW_ID") + private String flowId; + + /** + * app列表配置JSON + */ + @TableField("F_APP_COLUMN_DATA") + private String appColumnData; + + /** + * 启用流程 + */ + @TableField("F_ENABLE_FLOW") + private Integer enableFlow; + + /** + * 接口id + */ + @TableField("F_INTERFACE_ID") + private String interfaceId; + + /** + * 接口参数 + */ + @TableField("F_INTERFACE_PARAM") + private String interfaceParam; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/entity/VisualdevReleaseEntity.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/entity/VisualdevReleaseEntity.java new file mode 100644 index 0000000..98f3c1b --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/entity/VisualdevReleaseEntity.java @@ -0,0 +1,111 @@ +package jnpf.base.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; + +import java.util.Date; + +/** + * 可视化功能草稿 + * @version V3.4.5 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @author JNPF开发平台组 + * @date 2021/3/16 + */ +@Data +@TableName("base_visual_release") +public class VisualdevReleaseEntity extends SuperExtendEntity.SuperExtendDEEntity { + + /** + * 名称 + */ + @TableField("F_FULL_NAME") + private String fullName; + + /** + * 编码 + */ + @TableField("F_EN_CODE") + private String enCode; + + /** + * 状态(0-暂存(默认),1-发布) + */ + @TableField("F_STATE") + private Integer state; + + /** + * 类型(1-应用开发,2-移动开发,3-流程表单,4-Web表单,5-App表单) + */ + @TableField("F_TYPE") + private Integer type; + + /** + * 关联的表 + */ + @TableField("F_TABLES_DATA") + @JSONField(name = "tables") + private String visualTables; + + /** + * 分类(数据字典) + */ + @TableField("F_CATEGORY") + private String category; + + /** + * 表单配置JSON + */ + @TableField("F_FORM_DATA") + private String formData; + + /** + * 列表配置JSON + */ + @TableField("F_COLUMN_DATA") + private String columnData; + + /** + * 关联数据连接id + */ + @TableField("F_DB_LINK_ID") + private String dbLinkId; + + /** + * 页面类型(1、纯表单,2、表单加列表,3、表单列表工作流,4、数据视图) + */ + @TableField("F_WEB_TYPE") + private Integer webType; + + /** + * 关联工作流连接id + */ + @TableField("F_FLOW_ID") + private String flowId; + + /** + * app列表配置JSON + */ + @TableField("F_APP_COLUMN_DATA") + private String appColumnData; + + /** + * 启用流程 + */ + @TableField("F_ENABLE_FLOW") + private Integer enableFlow; + + /** + * 接口id + */ + @TableField("F_INTERFACE_ID") + private String interfaceId; + + /** + * 接口参数 + */ + @TableField("F_INTERFACE_PARAM") + private String interfaceParam; +} + diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/entity/VisualdevShortLinkEntity.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/entity/VisualdevShortLinkEntity.java new file mode 100644 index 0000000..2810924 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/entity/VisualdevShortLinkEntity.java @@ -0,0 +1,109 @@ +package jnpf.base.entity; + +import jnpf.base.entity.SuperEntity; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +/** + * 在线开发表单外链实体 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/12/30 11:10:44 + */ +@Data +@TableName("base_visual_link") +public class VisualdevShortLinkEntity extends SuperExtendEntity.SuperExtendEnabledEntity { + + /** + * 短链接 + */ + @TableField("F_SHORT_LINK") + private String shortLink; + + /** + * 外链填单开关 + */ + @TableField("F_FORM_USE") + private Integer formUse; + + /** + * 外链填单 + */ + @TableField("F_FORM_LINK") + private String formLink; + + /** + * 外链密码开关 + */ + @TableField("F_FORM_PASS_USE") + private Integer formPassUse; + + /** + * 外链填单密码 + */ + @TableField("F_FORM_PASSWORD") + private String formPassword; + + /** + * 公开查询开关 + */ + @TableField("F_COLUMN_USE") + private Integer columnUse; + + /** + * 公开查询 + */ + @TableField("F_COLUMN_LINK") + private String columnLink; + + /** + * 查询密码开关 + */ + @TableField("F_COLUMN_PASS_USE") + private Integer columnPassUse; + + /** + * 公开查询密码 + */ + @TableField("F_COLUMN_PASSWORD") + private String columnPassword; + + /** + * 查询条件 + */ + @TableField("F_COLUMN_CONDITION") + private String columnCondition; + + /** + * 显示内容 + */ + @TableField("F_COLUMN_TEXT") + private String columnText; + + /** + * PC端链接 + */ + @TableField("F_REAL_PC_LINK") + private String realPcLink; + + /** + * App端链接 + */ + @TableField("F_REAL_APP_LINK") + private String realAppLink; + + /** + * 用户id + */ + @TableField("F_USER_ID") + private String userId; + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/ColumnDataModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/ColumnDataModel.java new file mode 100644 index 0000000..c1f22e8 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/ColumnDataModel.java @@ -0,0 +1,121 @@ +package jnpf.base.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.base.model.Template6.BtnData; +import jnpf.database.model.superQuery.SuperJsonModel; +import jnpf.model.visualJson.config.HeaderModel; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/16 8:47 + */ +@Data +@Schema(description="") +public class ColumnDataModel { + private String searchList; + private String printIds; + private Boolean hasDefaultValue = false; + private Boolean hasSuperQuery = false; + /** + * 合计配置 + */ + private boolean showSummary; + /** + * 合计字段 + */ + private List summaryField = new ArrayList<>(); + /** + * 子表展示样式 + */ + private Integer childTableStyle =1; + private String columnOptions; + private String columnList; + private String defaultColumnList; + private String sortList; + private Integer type; + private String defaultSidx; + private String sort; + private Boolean hasPage; + private Integer pageSize; + private String treeTitle; + private String treeDataSource; + private String treeDictionary; + private String treeRelation; + private String treePropsUrl; + private String treePropsValue; + private String treePropsChildren; + private String treePropsLabel; + private String isLeaf; + private String groupField; + private List btnsList = new ArrayList<>(); + private List columnBtnsList = new ArrayList<>(); + private String uploaderTemplateJson; + /** + * 自定义按钮区 + */ + private String customBtnsList; + /** + * 列表权限 + */ + private Boolean useColumnPermission; + /** + * 表单权限 + */ + private Boolean useFormPermission; + /** + * 按钮权限 + */ + private Boolean useBtnPermission; + /** + * 数据权限 + */ + private Boolean useDataPermission; + + //以下树形列表属性,type=5的情况 + /** + * 同步异步(0:同步,1:异步) + */ + private Integer treeLazyType=0; + + /** + * 父级字段 + */ + private String parentField; + /** + * 子级字段 + */ + private String subField; + + /** + * 左侧树同步异步 + */ + private Integer treeSynType; + /** + * 左侧树查询 + */ + private Boolean hasTreeQuery; + + private String treeInterfaceId; + private String treeTemplateJson; + + + private SuperJsonModel ruleList = new SuperJsonModel(); + private SuperJsonModel ruleListApp = new SuperJsonModel(); + private List complexHeaderList = new ArrayList<>(); + + /** + * 千分位开关 + */ + private boolean thousands=false; + /** + * 千分位字段列表 + */ + private List thousandsField = new ArrayList<>(); +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/DownloadCodeForm.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/DownloadCodeForm.java new file mode 100644 index 0000000..330406a --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/DownloadCodeForm.java @@ -0,0 +1,49 @@ +package jnpf.base.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +@Schema(description="下载代码表单") +public class DownloadCodeForm { + /** + * 所属模块 + */ + @Schema(description = "所属模块") + private String module; + + /** + * 模块包名 + */ + @Schema(description = "模块包名") + private String modulePackageName; + + /** + * 主功能名称 + */ + @Schema(description = "主功能名称") + private String className; + /** + * 子表名称集合 + */ + @Schema(description = "子表名称集合") + private String subClassName; + /** + * 主功能备注 + */ + @Schema(description = "主功能备注") + private String description; + + /** + * 数据源id + */ + @Schema(description = "数据源id") + private String dataSourceId; + + /** + * 是否vue3 + */ + @Schema(description = "是否vue3") + private boolean vue3 = false; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/ExportSelectedModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/ExportSelectedModel.java new file mode 100644 index 0000000..7aa0283 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/ExportSelectedModel.java @@ -0,0 +1,12 @@ +package jnpf.base.model; +import lombok.Data; + +import java.util.List; + +@Data +public class ExportSelectedModel { + private String tableField; + private String field; + private String label; + private List selectedModelList; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/FormDataField.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/FormDataField.java new file mode 100644 index 0000000..d468a97 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/FormDataField.java @@ -0,0 +1,14 @@ +package jnpf.base.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +@Schema(description="表单字段") +public class FormDataField { + @Schema(description = "key") + private String vModel; + @Schema(description = "名称") + private String label; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/PaginationVisualdev.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/PaginationVisualdev.java new file mode 100644 index 0000000..a2d809e --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/PaginationVisualdev.java @@ -0,0 +1,35 @@ +package jnpf.base.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.base.Pagination; +import lombok.Data; + +/** + * + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @author JNPF开发平台组 + * @date 2021/3/16 + */ +@Data +@Schema(description="列表查询参数") +public class PaginationVisualdev extends Pagination { + @Schema(description = "类型") + private Integer type=1; + @Schema(description = "关键字") + private String keyword=""; + /** + *0-在线开发(无表),1-表单设计(有表) + */ + @Schema(description = "模型分类:0-在线开发(无表),1-表单设计(有表)") + private String model="0"; + + private Integer webType=2; + private Integer enableFlow; + /** + * 分类 + */ + @Schema(description = "类别:字典分类") + private String category; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template6/AuthorityModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template6/AuthorityModel.java new file mode 100644 index 0000000..13e76e2 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template6/AuthorityModel.java @@ -0,0 +1,29 @@ +package jnpf.base.model.Template6; +import lombok.Data; + +/** + * 权限控制字段 + * @author JNPF开发平台组 + * @version V3.2 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/10/6 + */ +@Data +public class AuthorityModel { + /** + * 列表权限 + */ + private Boolean useColumnPermission; + /** + * 表单权限 + */ + private Boolean useFormPermission; + /** + * 按钮权限 + */ + private Boolean useBtnPermission; + /** + * 数据权限 + */ + private Boolean useDataPermission; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template6/BtnData.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template6/BtnData.java new file mode 100644 index 0000000..343c5a2 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template6/BtnData.java @@ -0,0 +1,9 @@ +package jnpf.base.model.Template6; +import lombok.Data; + +@Data +public class BtnData { + private String value; + private String icon; + private String label; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template6/ColumnListField.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template6/ColumnListField.java new file mode 100644 index 0000000..5979241 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template6/ColumnListField.java @@ -0,0 +1,34 @@ +package jnpf.base.model.Template6; + + +import jnpf.model.visualJson.FieLdsModel; +import lombok.Data; + +/** + * 列表字段 + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/3/16 + */ +@Data +public class ColumnListField extends FieLdsModel { + /** + * 字段 + */ + private String prop; + /** + * 列名 + */ + private String label; + /** + * 对齐 + */ + private String align; + + private String jnpfKey; + /** + * 是否勾选 + */ + private Boolean checked; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template6/IndexGridField6Model.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template6/IndexGridField6Model.java new file mode 100644 index 0000000..15a9e0f --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template6/IndexGridField6Model.java @@ -0,0 +1,18 @@ +package jnpf.base.model.Template6; +import lombok.Data; + +/** + * 列表字段 + */ +@Data +public class IndexGridField6Model { + //字段 + private String prop; + //列名 + private String label; + //对齐 + private String align; + //宽度 + private String width; + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template6/Template6Model.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template6/Template6Model.java new file mode 100644 index 0000000..c73bf97 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template6/Template6Model.java @@ -0,0 +1,64 @@ +package jnpf.base.model.Template6; + + +import jnpf.base.model.Template6.ColumnListField; +import jnpf.model.visualJson.TableModel; +import lombok.Data; + +import java.util.List; + +/** + * 多表开发配置 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @author JNPF开发平台组 + * @date 2021/3/16 + */ +@Data +public class Template6Model { + /** + * 版本 + */ + private String version = "V3.0.0"; + /** + * 版权 + */ + private String copyright; + /** + * 创建人员 + */ + private String createUser; + /** + * 创建日期 + */ + private String createDate; + /** + * 功能描述 + */ + private String description; + /** + * 子类功能名称 + */ + private String subClassName; + /** + * 主类功能名称 + */ + private String className; + + /** + * tables + */ + /** + * 列表主表 - 字段集合 + */ + private List columnListFields; + + + private String serviceDirectory; + + + /** + * 数据关联 - 集合 + */ + private List dbTableRelation; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template7/ChildrenModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template7/ChildrenModel.java new file mode 100644 index 0000000..2a1348c --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template7/ChildrenModel.java @@ -0,0 +1,20 @@ +package jnpf.base.model.Template7; + + +import jnpf.model.visualJson.FieLdsModel; +import lombok.Data; + +import java.util.List; + +@Data +public class ChildrenModel { + + //子表的属性 + private List childrenList; + //子表名称 + private String className; + //json原始名称 + private String tableModel; + //子表系统控件 + private List systemList; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template7/HtmlModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template7/HtmlModel.java new file mode 100644 index 0000000..b6e38d6 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template7/HtmlModel.java @@ -0,0 +1,26 @@ +package jnpf.base.model.Template7; + + +import jnpf.model.visualJson.FieLdsModel; +import jnpf.util.treeutil.SumTree; +import lombok.Data; + +import java.util.List; + +@Data +public class HtmlModel extends SumTree { + + //类型 栅格row,卡片card,子表table,主表mast + private String jnpfkey; + //json原始名称 + private String vmodel; + //主表属性 + private FieLdsModel fieLdsModel; + //子表list属性 + private List tablFieLdsModel; + //控件宽度 + private String span; + //结束 + private String end="0"; + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template7/KeyModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template7/KeyModel.java new file mode 100644 index 0000000..178f4bb --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template7/KeyModel.java @@ -0,0 +1,12 @@ +package jnpf.base.model.Template7; +import lombok.Data; + +@Data +public class KeyModel { + //系统自带属性 + private String jnpfKey; + //字段名称 + private String model; + //规则数据 + private String rule; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template7/MastModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template7/MastModel.java new file mode 100644 index 0000000..8a3f041 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template7/MastModel.java @@ -0,0 +1,16 @@ +package jnpf.base.model.Template7; + + +import jnpf.model.visualJson.FieLdsModel; +import lombok.Data; + +import java.util.List; + +@Data +public class MastModel { + + //主表的属性 + private List mastList; + //系统自带的赋值 + private List keyMastList; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template7/Template7DataModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template7/Template7DataModel.java new file mode 100644 index 0000000..692f620 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template7/Template7DataModel.java @@ -0,0 +1,13 @@ +package jnpf.base.model.Template7; + + + +import jnpf.model.visualJson.FieLdsModel; +import lombok.Data; + +import java.util.List; + +@Data +public class Template7DataModel { + private List fields; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template7/Template7Model.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template7/Template7Model.java new file mode 100644 index 0000000..bfa0999 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/Template7/Template7Model.java @@ -0,0 +1,149 @@ +package jnpf.base.model.Template7; + +import jnpf.model.visualJson.TableModel; +import lombok.Data; + +import java.util.List; + +/** + * + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @author JNPF开发平台组 + * @date 2021/3/16 + */ +@Data +public class Template7Model { + /** + * 版本 + */ + private String version = "V3.1.0"; + /** + * 版权 + */ + private String copyright; + /** + * 创建人员 + */ + private String createUser; + /** + * 创建日期 + */ + private String createDate; + /** + * 功能描述 + */ + private String description; + /** + * 子类功能名称 + */ + private String subClassName; + /** + * 主类功能名称 + */ + private String className; + + /** + * 表 + */ + private String tableName; + + + /** + * 表单页名 + */ + private String formPageName; + /** + * 列表页名 + */ + private String indexPageName; + /** + * 后端目录 + */ + private String serviceDirectory; + /** + * 前端目录 + */ + private String webDirectory; + /** + * 表单标题 + */ + private String formTitle; + /** + * 弹窗类型 + */ + private String formDialog; + /** + * 表单宽度 + */ + private int formWidth; + /** + * 表单高度 + */ + private int formHeight; + /** + * 表单Tabs + */ + private String[] formTabs; + /** + * 列表左边树 - 是否显示 + */ + private int treeIsShow; + /** + * 列表左边树 - 树形标题 + */ + private String treeTitle; + /** + * 列表左边树 - 数据来源 + */ + private String treeDataSource; + /** + * 列表左边树 - 数据字典 + */ + private String treeDictionary; + /** + * 列表左边树 - 数据选择 + */ + private String treePropsUrl; + /** + * 列表左边树 - 主键字段 + */ + private String treePropsValue; + /** + * 列表左边树 - 父级字段 + */ + private String treePropsChildren; + /** + * 列表左边树 - 显示字段 + */ + private String treePropsLabel; + /** + * 列表左边树 - 关联字段 + */ + private String treeRelation; + /** + * 按钮 - 新建 + */ + private String indexBtnAddName; + /** + * 按钮 - 编辑 + */ + private String indexBtnEditName; + /** + * 按钮 - 删除 + */ + private String indexBtnRemoveName; + /** + * 列表 - 标题 + */ + private String indexListTitle; + /** + * 列表 - 分页 + */ + private int indexGridIsPage; + + /** + * 数据关联 - 集合 + */ + private List dbTableRelation; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualDevCrForm.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualDevCrForm.java new file mode 100644 index 0000000..d6819ca --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualDevCrForm.java @@ -0,0 +1,53 @@ +package jnpf.base.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @author JNPF开发平台组 + * @date 2021/3/16 + */ +@Data +@Schema(description="功能设计创建表单" ) +public class VisualDevCrForm { + @Schema(description = "名称" ) + private String fullName; + @Schema(description = "编码" ) + private String enCode; + @Schema(description = "类型(1-应用开发,2-移动开发,3-流程表单,4-Web表单,5-App表单)" ) + private String type; + @Schema(description = "描述" ) + private String description; + @Schema(description = "表单配置JSON" ) + private String formData; + @Schema(description = "列表配置JSON" ) + private String columnData; + @Schema(description = "app列表配置JSON" ) + private String appColumnData; + @Schema(description = "关联的表" ) + private String tables; + @Schema(description = "分类(数据字典维护)" ) + private String category; + @Schema(description = "状态" ) + private Integer state = 0; + @Schema(description = "关联数据连接id" ) + private String dbLinkId; + @Schema(description = "页面类型(1、纯表单,2、表单加列表,3、表单列表工作流、4、数据视图)" ) + private String webType; + @Schema(description = "排序" ) + private Long sortCode; + @Schema(description = "启用流程" ) + private Integer enableFlow; + @Schema(description = "流程引擎json" ) + private String flowTemplateJson; + @Schema(description = "接口id" ) + private String interfaceId; + @Schema(description = "接口名称" ) + private String interfaceName; + @Schema(description = "接口参数" ) + private String interfaceParam; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualDevInfoVO.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualDevInfoVO.java new file mode 100644 index 0000000..0381b4d --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualDevInfoVO.java @@ -0,0 +1,55 @@ +package jnpf.base.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @author JNPF开发平台组 + * @date 2021/3/16 + */ +@Data +@Schema(description="功能设计详情模型" ) +public class VisualDevInfoVO { + @Schema(description = "主键" ) + private String id; + @Schema(description = "名称" ) + private String fullName; + @Schema(description = "编码" ) + private String enCode; + @Schema(description = "分类(数据字典维护)" ) + private String category; + @Schema(description = "类型(1-应用开发,2-移动开发,3-流程表单,4-Web表单,5-App表单)" ) + private String type; + @Schema(description = "描述" ) + private String description; + @Schema(description = "表单配置JSON" ) + private String formData; + @Schema(description = "列表配置JSON" ) + private String columnData; + @Schema(description = "app列表配置JSON" ) + private String appColumnData; + @Schema(description = "关联的表" ) + private String tables; + @Schema(description = "状态" ) + private Integer state; + @Schema(description = "关联数据连接id" ) + private String dbLinkId; + @Schema(description = "页面类型(1、纯表单,2、表单加列表,3、表单列表工作流、4、数据视图)" ) + private String webType; + @Schema(description = "排序" ) + private Long sortCode; + @Schema(description = "启用流程" ) + private Integer enableFlow; + @Schema(description = "流程引擎json" ) + private String flowTemplateJson; + @Schema(description = "接口id" ) + private String interfaceId; + @Schema(description = "接口名称" ) + private String interfaceName; + @Schema(description = "接口参数" ) + private String interfaceParam; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualDevJsonModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualDevJsonModel.java new file mode 100644 index 0000000..be2ad21 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualDevJsonModel.java @@ -0,0 +1,67 @@ +package jnpf.base.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.database.model.superQuery.SuperJsonModel; +import jnpf.model.visualJson.FieLdsModel; +import jnpf.model.visualJson.FormDataModel; +import jnpf.model.visualJson.TableModel; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * json格式化对象(在线开发对象) + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2022/6/14 + */ +@Data +@Schema(description="功能设计json模型" ) +public class VisualDevJsonModel { + @Schema(description = "主键" ) + private String id; + @Schema(description = "名称" ) + private String fullName; + @Schema(description = "类型(1-应用开发,2-移动开发,3-流程表单,4-Web表单,5-App表单)" ) + private Integer type; + @Schema(description = "关联的表对象" ) + private List visualTables; + @Schema(description = "表单配置对象" ) + private FormDataModel formData; + @Schema(description = "字段配置对象" ) + private ColumnDataModel columnData; + @Schema(description = "app字段配置对象" ) + private ColumnDataModel appColumnData; + @Schema(description = "关联数据连接id" ) + private String dbLinkId; + @Schema(description = "页面类型(1、纯表单,2、表单加列表,3、表单列表工作流、4、数据视图)" ) + private Integer webType; + @Schema(description = "表单字段列表" ) + private List formListModels; + @Schema(description = "启用流程" ) + private boolean flowEnable; + @Schema(description = "树形子列表查询" ) + private boolean isChildSearch = false;//树形子列表查询 + @Schema(description = "树形子列表查询值" ) + private String childValue;//树形子列表查询值 + @Schema(description = "流程引擎id" ) + private String flowId; + + @Schema(description = "主表主键" ) + private String pkeyId;//切库回传 + + @Schema(description = "数据过滤" ) + private SuperJsonModel ruleQuery = new SuperJsonModel(); + @Schema(description = "高级搜索" ) + private SuperJsonModel superQuery = new SuperJsonModel(); + @Schema(description = "列表搜索" ) + private SuperJsonModel query = new SuperJsonModel(); + @Schema(description = "数据权限" ) + private List authorize = new ArrayList<>(); + private List dataIdList = new ArrayList<>(); + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualDevListVO.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualDevListVO.java new file mode 100644 index 0000000..3d3ebc2 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualDevListVO.java @@ -0,0 +1,23 @@ +package jnpf.base.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * json格式化对象(在线开发对象) + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + */ +@Data +public class VisualDevListVO { + @Schema(description = "主键" ) + private String id; + @Schema(description = "名称" ) + private String fullName; + @Schema(description = "编码" ) + private String enCode; + @Schema(description = "是否启用流程" ) + private Integer enableFlow; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualDevPubModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualDevPubModel.java new file mode 100644 index 0000000..f29e12b --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualDevPubModel.java @@ -0,0 +1,30 @@ +package jnpf.base.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 同步菜单类型 + * + * @author JNPF开发平台组 + * @version V3.4.1 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2022/4/14 + */ +@Data +@Schema(description="发布功能参数" ) +public class VisualDevPubModel { + @Schema(description = "pc" ) + private Integer pc; + @Schema(description = "app" ) + private Integer app; + @Schema(description = "pc菜单父id" ) + private String pcModuleParentId; + @Schema(description = "app菜单父id" ) + private String appModuleParentId; + @Schema(description = "pc系统id" ) + private String pcSystemId; + @Schema(description = "app系统id" ) + private String appSystemId; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualDevUpForm.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualDevUpForm.java new file mode 100644 index 0000000..f14187d --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualDevUpForm.java @@ -0,0 +1,17 @@ +package jnpf.base.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @author JNPF开发平台组 + * @date 2021/3/16 + */ +@Data +@Schema(description="功能设计修改表单" ) +public class VisualDevUpForm extends VisualDevCrForm{ +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualFunctionModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualFunctionModel.java new file mode 100644 index 0000000..bcfa5db --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualFunctionModel.java @@ -0,0 +1,84 @@ +package jnpf.base.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 可视化列表模型 + * + * @author JNPF开发平台组 + * @version V3.2.8 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/11/20 + */ +@Data +@Schema(description="可视化列表模型") +public class VisualFunctionModel { + @Schema(description = "名称" ) + private String fullName; + @Schema(description = "编码" ) + private String enCode; + @Schema(description = "状态" ) + private Integer state; + @Schema(description = "类型(1-应用开发,2-移动开发,3-流程表单,4-Web表单,5-App表单)" ) + private Integer type; + @Schema(description = "关联的表" ) + private String tables; + @Schema(description = "创建时间" ) + private Long creatorTime; + @Schema(description = "创建人" ) + private String creatorUser; + @Schema(description = "创建人id" ) + private String creatorUserId; + @Schema(description = "修改时间" ) + private Long lastModifyTime; + @Schema(description = "修改人" ) + private String lastModifyUser; + @Schema(description = "修改人id" ) + private String lastModifyUserId; + @Schema(description = "排序" ) + private Long sortCode; + @Schema(description = "分类(数据字典维护)" ) + private String category; + @Schema(description = "主键" ) + private String id; + @Schema(description = "页面类型(1、纯表单,2、表单加列表,3、表单列表工作流、4、数据视图)" ) + private Integer webType; + @Schema(description = "pc是否发布" ) + private Integer pcIsRelease; + @Schema(description = "app是否发布" ) + private Integer appIsRelease; + /** + * 是否发布 + */ + @Schema(description = "是否发布" ) + private Integer isRelease; + /** + * 是否启用流程 + */ + @Schema(description = "是否启用流程" ) + private Integer enableFlow; + + /** + * 状态 + */ + @Schema(description = "状态是否启用" ) + private Integer enabledMark; + /** + * 移动锁定0-锁定1-可移动 + */ + @Schema(description = "移动锁定0-未锁定1-锁定" ) + private Integer enabledLock; + + /** + * 是否有包名 + */ + @Schema(description = "是否有包名") + private boolean hasPackage = false; + + @Schema(description = "pc是否发布门户" ) + private Integer pcPortalIsRelease; + @Schema(description = "app是否发布门户" ) + private Integer appPortalIsRelease; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualTreeModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualTreeModel.java new file mode 100644 index 0000000..3892aa3 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualTreeModel.java @@ -0,0 +1,25 @@ +package jnpf.base.model; + +import jnpf.util.treeutil.SumTree; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + */ +@Data +public class VisualTreeModel extends SumTree { + private String fullName; + private Long num; + private String enCode; + private Integer state; + private String type; + private String tables; + private Long creatorTime; + private String creatorUser; + private Long lastModifyTime; + private String lastModifyUser; + private Long sortCode; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualWebTypeEnum.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualWebTypeEnum.java new file mode 100644 index 0000000..f999a91 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualWebTypeEnum.java @@ -0,0 +1,34 @@ +package jnpf.base.model; +/** + * 模板类型 + * + * @author JNPF开发平台组 + * @version V3.2.9 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/12/4 + */ +public enum VisualWebTypeEnum { + /** + * 模板类型 + */ + FORM(1,"表单"), + FORM_LIST(2,"列表"), + DATA_VIEW(4,"视图"); + + VisualWebTypeEnum(Integer type, String modelName) { + this.type = type; + this.modelName = modelName; + } + + public Integer getType() { + return type; + } + + public String getModelName() { + return modelName; + } + + private Integer type; + private String modelName; + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualdevTreeChildModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualdevTreeChildModel.java new file mode 100644 index 0000000..b62fc41 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualdevTreeChildModel.java @@ -0,0 +1,14 @@ +package jnpf.base.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +@Schema(description="功能树形模型" ) +public class VisualdevTreeChildModel { + @Schema(description = "主键" ) + private String id; + @Schema(description = "名称" ) + private String fullName; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualdevTreeVO.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualdevTreeVO.java new file mode 100644 index 0000000..31c0a6d --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/VisualdevTreeVO.java @@ -0,0 +1,29 @@ +package jnpf.base.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @author JNPF开发平台组 + * @date 2021/3/16 + */ +@Data +@Schema(description="功能树形VO" ) +public class VisualdevTreeVO { + @Schema(description = "主键" ) + private String id; + @Schema(description = "名称" ) + private String fullName; + @Schema(description = "是否有子集" ) + private Boolean hasChildren; + @Schema(description = "排序" ) + private Long sortCode; + @Schema(description = "子集对象" ) + private List children; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/filter/FilterInfo.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/filter/FilterInfo.java new file mode 100644 index 0000000..2083909 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/filter/FilterInfo.java @@ -0,0 +1,13 @@ + + +package jnpf.base.model.filter; +import lombok.Data; + +@Data +public class FilterInfo { + private String id; + private String moduleId; + private String config; + private String deleteMark; + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/filter/FilterQuery.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/filter/FilterQuery.java new file mode 100644 index 0000000..2d35087 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/filter/FilterQuery.java @@ -0,0 +1,13 @@ +package jnpf.base.model.filter; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import jnpf.base.entity.FilterEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + + +@Data +@EqualsAndHashCode(callSuper = false) +public class FilterQuery extends Page { + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/filter/RuleInfo.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/filter/RuleInfo.java new file mode 100644 index 0000000..730e290 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/filter/RuleInfo.java @@ -0,0 +1,50 @@ +package jnpf.base.model.filter; + +import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; + +@Data +public class RuleInfo { + /** + * 字段说明 + */ + private String fieldName; + /** + * 运算符 + */ + private String operator; + /** + * 逻辑拼接符号 + */ + private String logic; + /** + * 组件标识 + */ + private String jnpfKey; + /** + * 字段key + * 数据库字段(对于在线) + */ + private String field; + /** + * 自定义的值 + */ + private String fieldValue; + + private String fieldValue2; + + /** + * 显示类型 + */ + private String showLevel; + + /** + * 日期格式 + */ + private String format; + + @JSONField(name = "symbol") + public void setOperator(String operator) { + this.operator = operator; + } +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/read/ReadEnum.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/read/ReadEnum.java new file mode 100644 index 0000000..098a104 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/read/ReadEnum.java @@ -0,0 +1,72 @@ +package jnpf.base.model.read; + + +import jnpf.util.StringUtil; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/8/20 + */ +public enum ReadEnum { + /** + * 模型 + */ + model("model"), + /** + * 控制器 + */ + controller("controller"), + /** + * 业务层 + */ + service("service"), + /** + * 数据层 + */ + mapper("mapper"), + /** + * 实体 + */ + entity("entity"), + /** + * web + */ + web("web"), + /** + * json + */ + json("json"), + /** + * app + */ + app("app"); + + private String message; + + ReadEnum(String message) { + this.message = message; + } + + public String getMessage() { + return message; + } + + /** + * 根据状态code获取枚举名称 + * + * @return + */ + public static ReadEnum getMessage(String path) { + if (StringUtil.isNotEmpty(path)) { + for (ReadEnum status : ReadEnum.values()) { + if (path.contains(status.getMessage())) { + return status; + } + } + } + return null; + } + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/read/ReadListVO.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/read/ReadListVO.java new file mode 100644 index 0000000..c6a611d --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/read/ReadListVO.java @@ -0,0 +1,18 @@ +package jnpf.base.model.read; +import lombok.Data; + +import java.util.List; + +/** + * + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @author JNPF开发平台组 + * @date 2021/8/20 + */ +@Data +public class ReadListVO { + private String fileName; + private String id; + private List children; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/read/ReadModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/read/ReadModel.java new file mode 100644 index 0000000..193a926 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/read/ReadModel.java @@ -0,0 +1,18 @@ +package jnpf.base.model.read; +import lombok.Data; + +/** + * + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @author JNPF开发平台组 + * @date 2021/8/20 + */ +@Data +public class ReadModel { + private String folderName; + private String fileName; + private String fileContent; + private String fileType; + private String id; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/shortLink/VisualdevShortLinkConfigVo.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/shortLink/VisualdevShortLinkConfigVo.java new file mode 100644 index 0000000..984e4ab --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/shortLink/VisualdevShortLinkConfigVo.java @@ -0,0 +1,42 @@ +package jnpf.base.model.shortLink; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 在线表单外链显示类 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/12/30 11:25:16 + */ +@Data +@Schema(description="外链配置对象") +public class VisualdevShortLinkConfigVo { + @Schema(description = "主键") + private String id; + @Schema(description = "表单开关0-关闭,1-开启") + private Integer formUse = 0; + @Schema(description = "表单密码开关0-关闭,1-开启") + private Integer formPassUse = 0; + @Schema(description = "列表开关0-关闭,1-开启") + private Integer columnUse = 0; + @Schema(description = "列表密码开关0-关闭,1-开启") + private Integer columnPassUse = 0; + @Schema(description = "列表查询字段") + private String columnCondition; + @Schema(description = "列表展示字段") + private String columnText; + @Schema(description = "用户id") + private String userId; + @Schema(description = "租户id") + private String tenantId; + @Schema(description = "是否启用0-关闭1-启用") + private Integer enabledMark; + @Schema(description = "表单外链") + private String formLink; + @Schema(description = "列表外链") + private String columnLink; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/shortLink/VisualdevShortLinkForm.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/shortLink/VisualdevShortLinkForm.java new file mode 100644 index 0000000..fbc53f3 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/shortLink/VisualdevShortLinkForm.java @@ -0,0 +1,44 @@ +package jnpf.base.model.shortLink; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 在线表单外链显示类 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/12/30 11:25:16 + */ +@Data +@Schema(description="外链提交表单") +public class VisualdevShortLinkForm { + @Schema(description = "主键") + private String id; + @Schema(description = "短链接key") + private String shortLink; + @Schema(description = "表单开关0-关闭,1-开启") + private Integer formUse; + @Schema(description = "表单外链") + private String formLink; + @Schema(description = "表单密码开关0-关闭,1-开启") + private Integer formPassUse; + @Schema(description = "表单密码") + private String formPassword; + @Schema(description = "列表开关0-关闭,1-开启") + private Integer columnUse; + @Schema(description = "列表外链") + private String columnLink; + @Schema(description = "列表密码开关0-关闭,1-开启") + private Integer columnPassUse; + @Schema(description = "列表密码") + private String columnPassword; + @Schema(description = "列表查询自选") + private String columnCondition; + @Schema(description = "列表展示字段") + private String columnText; + @Schema(description = "是否启用") + private Integer enabledMark; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/shortLink/VisualdevShortLinkModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/shortLink/VisualdevShortLinkModel.java new file mode 100644 index 0000000..6644e10 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/shortLink/VisualdevShortLinkModel.java @@ -0,0 +1,22 @@ +package jnpf.base.model.shortLink; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 外链请求参数 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/12/30 16:28:23 + */ +@Data +@Schema(description="外链入口参数") +public class VisualdevShortLinkModel { + @Schema(description = "类型:form-表单,list-列表") + private String type; + @Schema(description = "租户id") + private String tenantId; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/shortLink/VisualdevShortLinkPwd.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/shortLink/VisualdevShortLinkPwd.java new file mode 100644 index 0000000..4e39bc2 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/shortLink/VisualdevShortLinkPwd.java @@ -0,0 +1,26 @@ +package jnpf.base.model.shortLink; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 在线表单外链显示类 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/12/30 11:25:16 + */ +@Data +@Schema(description="外链密码验证对象") +public class VisualdevShortLinkPwd { + @Schema(description = "主键") + private String id; + @Schema(description = "类型:form-表单,list-列表") + private Integer type; + @Schema(description = "密码") + private String password; + @Schema(description = "加密参数") + private String encryption; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/shortLink/VisualdevShortLinkVo.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/shortLink/VisualdevShortLinkVo.java new file mode 100644 index 0000000..9c2d9d3 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/jnpf-visualdev-base-entity/src/main/java/jnpf/base/model/shortLink/VisualdevShortLinkVo.java @@ -0,0 +1,48 @@ +package jnpf.base.model.shortLink; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 在线表单外链显示类 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司 + * @date 2022/12/30 11:25:16 + */ +@Data +@Schema(description="外链配置详情") +public class VisualdevShortLinkVo { + @Schema(description = "主键") + private String id; + @Schema(description = "短链接key") + private String shortLink; + @Schema(description = "表单开关0-关闭,1-开启") + private Integer formUse = 0; + @Schema(description = "表单外链") + private String formLink; + @Schema(description = "表单密码开关0-关闭,1-开启") + private Integer formPassUse = 0; + @Schema(description = "表单密码") + private String formPassword; + @Schema(description = "列表开关0-关闭,1-开启") + private Integer columnUse = 0; + @Schema(description = "列表外链") + private String columnLink; + @Schema(description = "列表密码开关0-关闭,1-开启") + private Integer columnPassUse = 0; + @Schema(description = "列表密码") + private String columnPassword; + @Schema(description = "列表条件字段") + private String columnCondition; + @Schema(description = "列表展示字段") + private String columnText; + @Schema(description = "用户id") + private String userId; + @Schema(description = "租户id") + private String tenantId; + @Schema(description = "是否启用") + private Integer enabledMark; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/pom.xml b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/pom.xml new file mode 100644 index 0000000..85bdb64 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-base/pom.xml @@ -0,0 +1,21 @@ + + + + jnpf-visualdev + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-visualdev-base + pom + + jnpf-visualdev-base-entity + jnpf-visualdev-base-biz + jnpf-visualdev-base-controller + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-biz/pom.xml b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-biz/pom.xml new file mode 100644 index 0000000..c4b084b --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-biz/pom.xml @@ -0,0 +1,46 @@ + + + + jnpf-visualdev-generater + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-visualdev-generater-biz + + + + com.jnpf + jnpf-visualdev-generater-entity + ${project.version} + + + com.jnpf + jnpf-visualdev-base-biz + ${project.version} + + + com.baomidou + mybatis-plus-generator + + + com.baomidou + mybatis-plus-core + + + + + org.apache.velocity + velocity-engine-core + + + com.jnpf + jnpf-visualdev-onlinedev-entity + ${project.version} + + + + diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-biz/src/main/java/jnpf/generater/factory/CodeGenerateFactory.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-biz/src/main/java/jnpf/generater/factory/CodeGenerateFactory.java new file mode 100644 index 0000000..5f86b18 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-biz/src/main/java/jnpf/generater/factory/CodeGenerateFactory.java @@ -0,0 +1,36 @@ +package jnpf.generater.factory; + +import jnpf.base.util.functionForm.*; +import jnpf.generater.model.FormDesign.TemplateMethodEnum; +import org.springframework.stereotype.Component; + +/** + * 代码生成工厂类 + * + * @author JNPF开发平台组 + * @version V3.2 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/10/8 + */ +@Component +public class CodeGenerateFactory { + + /** + * 根据模板路径对应实体 + * @param templateMethod + * @return + */ + public CodeGenerateUtil getGenerator(String templateMethod){ + if (templateMethod.equals(TemplateMethodEnum.T2.getMethod())){ + return FormListUtil.getFormListUtil(); + }else if (templateMethod.equals(TemplateMethodEnum.T4.getMethod())){ + return FormUtil.getFormUtil(); + }else if (templateMethod.equals(TemplateMethodEnum.T3.getMethod())){ + return FunctionFlowUtil.getFunctionFlowUtil(); + }else if (templateMethod.equals(TemplateMethodEnum.T5.getMethod())){ + return FlowFormUtil.getFormUtil(); + }else { + return null; + } + } +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-biz/src/main/java/jnpf/generater/factory/CodeGenerateFactoryV3.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-biz/src/main/java/jnpf/generater/factory/CodeGenerateFactoryV3.java new file mode 100644 index 0000000..76ea0b5 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-biz/src/main/java/jnpf/generater/factory/CodeGenerateFactoryV3.java @@ -0,0 +1,1296 @@ +package jnpf.generater.factory; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.serializer.SerializerFeature; +import com.baomidou.mybatisplus.generator.InjectionConfig; +import com.baomidou.mybatisplus.generator.config.*; +import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy; +import com.google.common.base.CaseFormat; +import jnpf.base.UserInfo; +import jnpf.base.entity.VisualdevEntity; + +import jnpf.base.model.ColumnDataModel; +import jnpf.base.model.DownloadCodeForm; +import jnpf.base.model.Template6.AuthorityModel; +import jnpf.base.model.Template6.BtnData; +import jnpf.base.model.Template6.ColumnListField; +import jnpf.base.model.Template7.Template7Model; +import jnpf.base.model.VisualWebTypeEnum; +import jnpf.base.util.SourceUtil; +import jnpf.base.util.VisualUtils; +import jnpf.base.util.app.AppGenModel; +import jnpf.base.util.app.AppGenUtil; +import jnpf.base.util.common.DataControlUtils; +import jnpf.base.util.common.FormCommonUtil; +import jnpf.base.util.common.FunctionFormPublicUtil; +import jnpf.base.util.common.SuperQueryUtil; +import jnpf.base.util.custom.CustomGenerator; +import jnpf.base.util.fuctionFormVue3.*; +import jnpf.base.util.fuctionFormVue3.common.GenerateCommon; +import jnpf.base.util.fuctionFormVue3.common.GenerateInterface; +import jnpf.base.util.fuctionFormVue3.common.GenerateParamModel; +import jnpf.config.ConfigValueUtil; +import jnpf.constant.MsgCode; +import jnpf.database.model.entity.DbLinkEntity; +import jnpf.database.util.DataSourceUtil; +import jnpf.database.util.TenantDataSourceUtil; +import jnpf.entity.FlowFormEntity; +import jnpf.generater.model.FormDesign.ColumnListDataModel; +import jnpf.generater.model.FormDesign.ListSearchGroupModel; + +import jnpf.generater.model.FormDesign.SearchTypeModel; +import jnpf.generater.model.FormDesign.TemplateMethodEnum; +import jnpf.generater.model.GenFileNameSuffix; +import jnpf.model.visualJson.*; +import jnpf.model.visualJson.analysis.*; +import jnpf.model.visualJson.config.ConfigModel; +import jnpf.model.visualJson.config.HeaderModel; +import jnpf.util.FileUploadUtils; +import jnpf.util.JsonUtil; +import jnpf.util.StringUtil; +import jnpf.util.XSSEscape; +import jnpf.util.visiual.JnpfKeyConsts; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.velocity.VelocityContext; +import org.springframework.stereotype.Component; + +import java.io.File; +import java.sql.SQLException; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author JNPF开发平台组 + * @version V3.5.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/5/31 + */ +@Component +public class CodeGenerateFactoryV3 { + + /** + * 根据模板路径对应实体 + * + * @param templateMethod + * @return + */ + public void runGenerator(String templateMethod, GenerateParamModel generateParamModel) throws Exception { + GenerateInterface codeGenerateUtil = null; + if (templateMethod.equals(TemplateMethodEnum.T1.getMethod())) { + codeGenerateUtil = new GenerateWorkFlow(); + } else if (templateMethod.equals(TemplateMethodEnum.T2.getMethod())) { + codeGenerateUtil = new GenerateFormList(); + } else if (templateMethod.equals(TemplateMethodEnum.T3.getMethod())) { + codeGenerateUtil = new GenerateFormListFlow(); + } else if (templateMethod.equals(TemplateMethodEnum.T4.getMethod())) { + codeGenerateUtil = new GenerateForm(); + } else if (templateMethod.equals(TemplateMethodEnum.T5.getMethod())) { + codeGenerateUtil = new GenerateFormFlow(); + } else { + codeGenerateUtil = null; + } + //生成后端代码 + GenerateParamModel javaObj = BeanUtil.copyProperties(generateParamModel, GenerateParamModel.class); + this.generateJava(javaObj, codeGenerateUtil); + } + + /** + * 生成java代码 + * + * @param codeUtil 生成重写接口 + * @param generateParamModel + * @throws Exception + */ + private void generateJava(GenerateParamModel generateParamModel, GenerateInterface codeUtil) throws Exception { + List list = JsonUtil.getJsonToList(generateParamModel.getEntity().getVisualTables(), TableModel.class); + //表别名 + Map tableNameAll = tableName(list, generateParamModel.getDownloadCodeForm()); + for (TableModel model : list) { + generateParamModel.setTable(model.getTable()); + generateParamModel.setClassName(tableNameAll.get(model.getTable())); + generateParamModel.setMainTable(false); + if ("1".equals(model.getTypeId())) { + generateParamModel.setMainTable(true); + //生成主表代码 + this.setCode(generateParamModel, codeUtil); + //前端代码 + this.generateHtml(generateParamModel, codeUtil); + //生成app代码 + this.generateApp(generateParamModel, codeUtil); + } else if ("0".equals(model.getTypeId())) { + //生成子表代码 + this.setCode(generateParamModel, codeUtil); + } + } + } + + /** + * 封装表对应的输出名字 + */ + private Map tableName(List tableModelList, DownloadCodeForm downloadCodeForm) { + Map tableClass = new HashMap<>(16); + int i = 0; + for (TableModel tableModel : tableModelList) { + if ("0".equals(tableModel.getTypeId())) { + String[] subClassName = downloadCodeForm.getSubClassName().split(","); + tableClass.put(tableModel.getTable(), subClassName[i]); + i++; + } + if ("1".equals(tableModel.getTypeId())) { + tableClass.put(tableModel.getTable(), downloadCodeForm.getClassName()); + } + } + return tableClass; + } + + /** + * 获取传递参数 + * + * @param generateParamModel + * @return + * @throws Exception + */ + private Map getcolumndata(GenerateParamModel generateParamModel) throws Exception { + Map columndata = new HashMap<>(16); + DownloadCodeForm downloadCodeForm = generateParamModel.getDownloadCodeForm(); + VisualdevEntity entity = generateParamModel.getEntity(); + DbLinkEntity linkEntity = generateParamModel.getLinkEntity(); + String className = generateParamModel.getClassName(); + String pKeyName = generateParamModel.getPKeyName(); + //代码生成基础信息 + Template7Model template7Model = GenerateCommon.getTemplate7Model(className); + template7Model.setTableName(downloadCodeForm.getClassName()); + template7Model.setDescription(downloadCodeForm.getDescription()); + generateParamModel.setTemplate7Model(template7Model); + //自定义包名 + String modulePackageName = downloadCodeForm.getModulePackageName(); + //tableJson + List tableModelList = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + //formTempJson + FormDataModel formData = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + //设置乐观锁参数用于其他位置判断 + generateParamModel.setConcurrencyLock(formData.getConcurrencyLock()); + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + //主表 + TableModel mainTable = tableModelList.stream().filter(t -> t.getTypeId().equals("1")).findFirst().orElse(null); + //表别名 + Map tableRenames = tableName(tableModelList, generateParamModel.getDownloadCodeForm()); + String mainModelName = DataControlUtils.captureName(tableRenames.get(mainTable.getTable())); + //赋值主键 + tableModelList.stream().forEach(t -> { + try { + t.setTableKey(VisualUtils.getpKey(linkEntity, t.getTable())); + } catch (SQLException sqlException) { + sqlException.printStackTrace(); + } + }); + + //所有控件 + List formAllModel = new ArrayList<>(); + RecursionForm recursionForm = new RecursionForm(); + recursionForm.setTableModelList(JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class)); + recursionForm.setList(list); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + //主表控件 + List mast = formAllModel.stream().filter(t -> FormEnum.mast.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + //子表控件 + List table = formAllModel.stream().filter(t -> FormEnum.table.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + //副表控件 + List mastTable = formAllModel.stream().filter(t -> FormEnum.mastTable.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + + List subTableName = new ArrayList<>(); + for (FormAllModel allModel : table) { + FormColumnTableModel childList = allModel.getChildList(); + if (childList != null) { + subTableName.add(childList.getTableName()); + } + } + //子表(tableField,tableName)->tablefield1->realname + Map childKeyTableNameMap = new HashMap<>(8); + table.stream().forEach(t -> childKeyTableNameMap.put(t.getChildList().getTableModel(), t.getChildList().getTableName())); + + //子表集合 + List childTableNameList = new ArrayList<>(); + //全部表 + List allTableNameList = new ArrayList<>(); + for (TableModel tableModel : tableModelList) { + TableModel Model = new TableModel(); + Model.setInitName(tableModel.getTable()); + Model.setTable(tableRenames.get(tableModel.getTable())); + Model.setTableField(DataControlUtils.captureName(tableModel.getTableField())); + if (Model.getTable().equals(mainTable.getTable())) { + Model.setTableTag("main"); + } else { + Model.setTableTag(subTableName.contains(Model.getTable()) ? "sub" : "sub-jnpf"); + } + allTableNameList.add(Model); + if ("0".equals(tableModel.getTypeId())) { + childTableNameList.add(Model); + } + } + TableModel mainTableModel = tableModelList.stream().filter(t -> t.getTypeId().equals("1")).findFirst().orElse(null); + //主表的字段 + if (mainTableModel == null || CollectionUtils.isEmpty(mainTableModel.getFields())) { + throw new SQLException(MsgCode.COD001.get()); + } + + //主表的属性 + List mastTableHandle = new ArrayList<>(); + for (int i = 0; i < mast.size(); i++) { + FormAllModel mastModel = mast.get(i); + FieLdsModel fieLdsModel = mastModel.getFormColumnModel().getFieLdsModel(); + //接口templatejson转换 + if (StringUtil.isNotEmpty(fieLdsModel.getVModel())) { + List templateJson = fieLdsModel.getConfig().getTemplateJson(); + String json = templateJson.size() > 0 ? JsonUtil.getObjectToString(templateJson) : fieLdsModel.getTemplateJson(); + fieLdsModel.setTemplateJson(json); + mastTableHandle.add(fieLdsModel); + } + } + //副表模型 + List columnTableHandle = new ArrayList<>(); + //副表数据model + Map> groupColumnDataMap = mastTable.stream().collect(Collectors.groupingBy(m -> m.getFormMastTableModel().getTable())); + for (String key : groupColumnDataMap.keySet()) { + String classNameMast = DataControlUtils.captureName(tableRenames.get(key)); + ColumnListDataModel columnListDataModel = new ColumnListDataModel(); + columnListDataModel.setModelName(classNameMast); + columnListDataModel.setModelUpName(DataControlUtils.captureName(classNameMast)); + columnListDataModel.setModelLowName(DataControlUtils.initialLowercase(classNameMast)); + List allModels = groupColumnDataMap.get(key); + List fields = allModels.stream().map(m -> m.getFormMastTableModel().getField()).collect(Collectors.toList()); + columnListDataModel.setFieldList(fields); + columnListDataModel.setFieLdsModelList(allModels.stream().map(al -> al.getFormMastTableModel()).collect(Collectors.toList())); + columnListDataModel.setTableName(key); + List collect = allModels.stream().map(all -> all.getFormMastTableModel().getMastTable().getFieLdsModel()).collect(Collectors.toList()); + collect.stream().forEach(c -> { + String vmodel = c.getVModel().substring(c.getVModel().lastIndexOf("jnpf_")).replace("jnpf_", ""); + c.setVModel(vmodel); + List templateJson = c.getConfig().getTemplateJson(); + String json = templateJson.size() > 0 ? JsonUtil.getObjectToString(templateJson) : c.getTemplateJson(); + c.setTemplateJson(json); + }); + columnListDataModel.setFieLdsModels(collect); + + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equalsIgnoreCase(columnListDataModel.getTableName())).findFirst().orElse(null); + if (ObjectUtil.isNotEmpty(tableModel)) { + columnListDataModel.setMainKey(tableModel.getRelationField()); + columnListDataModel.setRelationField(tableModel.getTableField()); + columnListDataModel.setMainUpKey(DataControlUtils.captureName(tableModel.getRelationField())); + columnListDataModel.setRelationUpField(DataControlUtils.captureName(tableModel.getTableField())); + String tableKey = tableModel.getTableKey().toLowerCase().replace("f_", ""); + tableKey = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, tableKey); + columnListDataModel.setMainField(DataControlUtils.captureName(tableKey)); + } + columnTableHandle.add(columnListDataModel); + } + //子表的属性 + List> childTableHandle = new ArrayList<>(); + for (int i = 0; i < table.size(); i++) { + FormColumnTableModel childList = table.get(i).getChildList(); + List childListAll = childList.getChildList(); + String classNameChild = DataControlUtils.captureName(tableRenames.get(childList.getTableName())); + //子表别名 + childList.setAliasClassName(classNameChild); + childList.setAliasUpName(DataControlUtils.captureName(classNameChild)); + childList.setAliasLowName(DataControlUtils.initialLowercase(classNameChild)); + for (FormColumnModel columnModel : childListAll) { + FieLdsModel fieLdsModel = columnModel.getFieLdsModel(); + List templateJson = fieLdsModel.getConfig().getTemplateJson(); + String json = templateJson.size() > 0 ? JsonUtil.getObjectToString(templateJson) : fieLdsModel.getTemplateJson(); + fieLdsModel.setTemplateJson(json); + } + Map childs = JsonUtil.entityToMap(childList); + Optional first1 = tableModelList.stream().filter(t -> t.getTable().equals(childList.getTableName())).findFirst(); + if (!first1.isPresent()) { + throw new SQLException(MsgCode.COD001.get()); + } + TableModel tableModel = first1.get(); + //获取主键-外键字段-关联主表字段 + String chidKeyName = VisualUtils.getpKey(linkEntity, tableModel.getTable()); + String chidKeyField = chidKeyName.trim().toLowerCase().replaceAll("f_", ""); + chidKeyField = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, chidKeyField); + childs.put("chidKeyName", chidKeyField); + String tableField = tableModel.getTableField().trim().replaceAll(":\"f_", ":\""); + childs.put("tablefield", tableField); + String relationField = tableModel.getRelationField().trim().replaceAll(":\"f_", ":\""); + childs.put("relationField", relationField); + childTableHandle.add(childs); + } + + //++++++++++++++++++++++++++++主副子通用参数++++++++++++++++++++++++++// + //微服务标识 + columndata.put("isCloud", GenerateCommon.IS_CLOUD); + //是列表,是流程判断 + if (VisualWebTypeEnum.FORM_LIST.getType().equals(entity.getWebType()) && !Objects.equals(entity.getType(), 3)) { + columndata.put("isList", true); + //添加列表参数 + getListColumndata(generateParamModel, columndata); + } + if (Objects.equals(entity.getEnableFlow(), 1)) { + columndata.put("isFlow", true); + } + //后台 + columndata.put("module", downloadCodeForm.getModule()); + columndata.put("genInfo", template7Model); + columndata.put("modelName", template7Model.getClassName()); + //表单非系统控件字段--为了加null可以更新 + columndata.put("tableNotSystemField", GenerateCommon.getNotSystemFields(mast, mastTable, table, generateParamModel)); + //主副子 控件字段(已处理数据) + columndata.put("mastTableHandle", mastTableHandle);//原system + columndata.put("columnTableHandle", columnTableHandle);//原columnChildren + columndata.put("childTableHandle", childTableHandle);//原child + columndata.put("mainModelName", mainModelName); + //数据源 + if (ObjectUtil.isNotEmpty(linkEntity)) { + columndata.put("DS", linkEntity.getFullName()); + } + // 数据源配置 + DataSourceConfig dsc = SourceUtil.dbConfig(TenantDataSourceUtil.getTenantSchema(), linkEntity); + //数据库类型 + columndata.put("dbType", dsc.getDbType().getDb()); + // 包名 + columndata.put("modulePackageName", modulePackageName); + columndata.put("pKeyName", pKeyName); + columndata.put("VisualDevId", entity.getId()); + //++++++++++++++++++++++++++++仅主表参数++++++++++++++++++++++++++// + if (generateParamModel.isMainTable()) { + //后台 + columndata.put("main", true); + //模板名称 + columndata.put("formModelName", entity.getFullName()); + //乐观锁 + columndata.put("version", formData.getConcurrencyLock()); + //删除标志 + columndata.put("logicalDelete", formData.getLogicalDelete()); + //雪花 + columndata.put("snowflake", formData.getPrimaryKeyPolicy() == 1); + } + return columndata; + } + + /** + * 获取列表传递参数 + * + * @param generateParamModel + * @return + * @throws Exception + */ + private void getListColumndata(GenerateParamModel generateParamModel, Map listMap) throws Exception { + DownloadCodeForm downloadCodeForm = generateParamModel.getDownloadCodeForm(); + VisualdevEntity entity = generateParamModel.getEntity(); + DbLinkEntity linkEntity = generateParamModel.getLinkEntity(); + String className = generateParamModel.getClassName(); + //代码生成基础信息 + Template7Model template7Model = GenerateCommon.getTemplate7Model(className); + template7Model.setTableName(downloadCodeForm.getClassName()); + template7Model.setDescription(downloadCodeForm.getDescription()); + generateParamModel.setTemplate7Model(template7Model); + //tableJson + List tableModelList = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + //formTempJson + FormDataModel formData = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + //设置乐观锁参数用于其他位置判断 + generateParamModel.setConcurrencyLock(formData.getConcurrencyLock()); + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + //主表 + TableModel mainTable = tableModelList.stream().filter(t -> t.getTypeId().equals("1")).findFirst().orElse(null); + //表别名 + Map tableRenames = tableName(tableModelList, generateParamModel.getDownloadCodeForm()); + //赋值主键 + tableModelList.stream().forEach(t -> { + try { + t.setTableKey(VisualUtils.getpKey(linkEntity, t.getTable())); + } catch (SQLException sqlException) { + sqlException.printStackTrace(); + } + }); + List formAllModel = new ArrayList<>(); + RecursionForm recursionForm = new RecursionForm(); + recursionForm.setTableModelList(JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class)); + recursionForm.setList(list); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + //主表数据 + List mast = formAllModel.stream().filter(t -> FormEnum.mast.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + //子表数据 + List table = formAllModel.stream().filter(t -> FormEnum.table.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + //副表数据 + List mastTable = formAllModel.stream().filter(t -> FormEnum.mastTable.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + List subTableName = new ArrayList<>(); + for (FormAllModel allModel : table) { + FormColumnTableModel childList = allModel.getChildList(); + if (childList != null) { + subTableName.add(childList.getTableName()); + } + } + //子表集合 + List childTableNameList = new ArrayList<>(); + //全部表 + List allTableNameList = new ArrayList<>(); + for (TableModel tableModel : tableModelList) { + TableModel Model = new TableModel(); + Model.setInitName(tableModel.getTable()); + Model.setTable(tableRenames.get(tableModel.getTable())); + Model.setTableField(DataControlUtils.captureName(tableModel.getTableField())); + if (Model.getTable().equals(mainTable.getTable())) { + Model.setTableTag("main"); + } else { + Model.setTableTag(subTableName.contains(Model.getTable()) ? "sub" : "sub-jnpf"); + } + allTableNameList.add(Model); + if ("0".equals(tableModel.getTypeId())) { + childTableNameList.add(Model); + } + } + //子表(tableField,tableName)->tablefield1->realname + Map childKeyTableNameMap = new HashMap<>(8); + table.stream().forEach(t -> childKeyTableNameMap.put(t.getChildList().getTableModel(), t.getChildList().getTableName())); + TableModel mainTableModel = tableModelList.stream().filter(t -> t.getTypeId().equals("1")).findFirst().orElse(null); + //主表的字段 + if (mainTableModel == null || CollectionUtils.isEmpty(mainTableModel.getFields())) { + throw new SQLException(MsgCode.COD001.get()); + } + + //columnTempJson + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(entity.getColumnData(), ColumnDataModel.class); + //app 列表对象 + ColumnDataModel appColumnDataModel = JsonUtil.getJsonToBean(entity.getAppColumnData(), ColumnDataModel.class); + + //按钮 + List btnPcList = JsonUtil.getJsonToList(columnDataModel.getBtnsList(), BtnData.class); + List columnBtnPcList = JsonUtil.getJsonToList(columnDataModel.getColumnBtnsList(), BtnData.class); + List btnAppList = JsonUtil.getJsonToList(appColumnDataModel.getBtnsList(), BtnData.class); + List columnBtnAppList = JsonUtil.getJsonToList(appColumnDataModel.getColumnBtnsList(), BtnData.class); + List btnDataList = new ArrayList<>(btnPcList); + List collect3 = btnPcList.stream().map(BtnData::getValue).collect(Collectors.toList()); + btnDataList.addAll(btnAppList.stream().filter(t -> !collect3.contains(t.getValue())).collect(Collectors.toList())); + List columnBtnDataList = new ArrayList<>(columnBtnPcList); + List collect4 = columnBtnPcList.stream().map(BtnData::getValue).collect(Collectors.toList()); + columnBtnDataList.addAll(columnBtnAppList.stream().filter(t -> !collect4.contains(t.getValue())).collect(Collectors.toList())); + //是否有导入按钮--webtype==2开启列表 + boolean hasUploadBtn = Objects.equals(entity.getWebType(), 2) && btnDataList.stream().anyMatch(btn -> btn.getValue().equals("upload")); + //是否有下载按钮 + boolean hasDownloadBtn = Objects.equals(entity.getWebType(), 2) && btnDataList.stream().anyMatch(btn -> btn.getValue().equals("download")); + //是否有下载按钮 + boolean hasPrintBtn = Objects.equals(entity.getWebType(), 2) && btnDataList.stream().anyMatch(btn -> btn.getValue().equals("batchPrint")); + boolean hasRemoveBtn = Objects.equals(entity.getWebType(), 2) && btnDataList.stream().anyMatch(btn -> btn.getValue().equals("batchRemove")); + //列表和查询 + List columnList = JsonUtil.getJsonToList(columnDataModel.getColumnList(), ColumnListField.class); + List searchList = JsonUtil.getJsonToList(columnDataModel.getSearchList(), SearchTypeModel.class); + List columnAppList = JsonUtil.getJsonToList(appColumnDataModel.getColumnList(), ColumnListField.class); + List searchAppList = JsonUtil.getJsonToList(appColumnDataModel.getSearchList(), SearchTypeModel.class); + //-----------------------------------------------------search start--------------------------------------- + //列表全字段 + List columnListAll = new ArrayList<>(columnList); + List cLaArr = columnListAll.stream().map(ColumnListField::getProp).collect(Collectors.toList()); + columnAppList.stream().forEach(t -> { + if (!cLaArr.contains(t.getProp())) { + columnListAll.add(t); + cLaArr.add(t.getProp()); + } + }); + //查询全字段 + List searchListAll = new ArrayList<>(searchList); + List cSaArr = searchListAll.stream().map(SearchTypeModel::getId).collect(Collectors.toList()); + searchAppList.stream().forEach(t -> { + if (!cSaArr.contains(t.getId())) { + searchListAll.add(t); + cSaArr.add(t.getId()); + } + }); + + //添加左侧树查询字段 + addTreeSearchField(mainTableModel, columnDataModel, searchList); + addTreeSearchField(mainTableModel, columnDataModel, searchAppList); + addTreeSearchField(mainTableModel, columnDataModel, searchListAll); + + //查询字段转换 + List groupModels = getListSearchGroupModels(tableModelList, mainTable, tableRenames, childKeyTableNameMap, mainTableModel, searchList); + List groupAppModels = getListSearchGroupModels(tableModelList, mainTable, tableRenames, childKeyTableNameMap, mainTableModel, searchAppList); + List groupAllModels = getListSearchGroupModels(tableModelList, mainTable, tableRenames, childKeyTableNameMap, mainTableModel, searchListAll); + + //-----------------------------------------------------search enddd--------------------------------------- + //权限 + AuthorityModel authority = new AuthorityModel(); + BeanUtil.copyProperties(columnDataModel, authority); + //导入字段 + List> allUploadTemplates = new ArrayList<>(); + boolean importHasChildren = false; + String importType = "1"; + UploaderTemplateModel uploaderTemplateModel = JsonUtil.getJsonToBean(columnDataModel.getUploaderTemplateJson(), UploaderTemplateModel.class); + if (hasUploadBtn && uploaderTemplateModel != null && uploaderTemplateModel.getSelectKey() != null) { + importType = uploaderTemplateModel.getDataType(); + List selectKey = uploaderTemplateModel.getSelectKey(); + Map> childMap = new HashMap<>(); + //判断是否存在子表的导入导出 + for (String item : selectKey) { + if (item.toLowerCase().contains(JnpfKeyConsts.CHILD_TABLE_PREFIX)) { + importHasChildren = true; + String[] split = item.split("-"); + if (childMap.get(split[0]) == null) { + List keys = new ArrayList<>(); + keys.add(split[1]); + childMap.put(split[0], keys); + } else { + List keys = childMap.get(split[0]); + keys.add(split[1]); + childMap.replace(split[0], keys); + } + } else { + //主表字段 + for (FormAllModel fam : mast) { + FieLdsModel fieLdsModel = fam.getFormColumnModel().getFieLdsModel(); + if (item.equals(fieLdsModel.getVModel())) { + Map map = JsonUtil.entityToMap(fieLdsModel); + map.put("label", fieLdsModel.getConfig().getLabel()); + allUploadTemplates.add(map); + } + } + //副表字段 + for (FormAllModel fam : mastTable) { + FieLdsModel fieLdsModel = fam.getFormMastTableModel().getMastTable().getFieLdsModel(); + if (item.equals(fieLdsModel.getVModel())) { + Map map = JsonUtil.entityToMap(fieLdsModel); + map.put("label", fieLdsModel.getConfig().getLabel()); + allUploadTemplates.add(map); + } + } + } + } + for (FormAllModel fam : table) { + FormColumnTableModel child = fam.getChildList(); + FormColumnTableModel childRes = new FormColumnTableModel(); + BeanUtil.copyProperties(child, childRes); + String childClassName = DataControlUtils.captureName(tableRenames.get(childRes.getTableName())); + //子表别名 + childRes.setAliasClassName(childClassName); + childRes.setAliasUpName(DataControlUtils.captureName(childClassName)); + childRes.setAliasLowName(DataControlUtils.initialLowercase(childClassName)); + String tableModel = child.getTableModel(); + List childList1 = child.getChildList(); + //获取该子表的所有需要导入字段 + List keys = childMap.get(tableModel) != null ? childMap.get(tableModel) : Collections.EMPTY_LIST; + List collect = childList1.stream().filter(t -> keys.contains(t.getFieLdsModel().getVModel())).collect(Collectors.toList()); + childRes.setChildList(collect); + Map childFilesMap = JsonUtil.entityToMap(childRes); + childFilesMap.put("vModel", childRes.getTableModel()); + //添加整个子表 + allUploadTemplates.add(childFilesMap); + } + } + //导入重复字段,需要标记(子表也以label判断重复) + Set set = new HashSet<>(); + List nameAgain = new ArrayList<>(); + for (Map f : allUploadTemplates) { + if (!set.add(String.valueOf(f.get("label")))) { + nameAgain.add(String.valueOf(f.get("vModel"))); + } + } + + //树形列表参数 + if (Objects.equals(columnDataModel.getType(), 5)) { + columnDataModel.setHasPage(false); + } + String parentField = StringUtil.isNotEmpty(columnDataModel.getParentField()) ? columnDataModel.getParentField() : ""; + if (StringUtil.isNotEmpty(parentField)) { + parentField = parentField.substring(0, 1).toUpperCase() + parentField.substring(1); + } + String subField = StringUtil.isNotEmpty(columnDataModel.getSubField()) ? columnDataModel.getSubField() : ""; + if (StringUtil.isNotEmpty(subField)) { + subField = subField.substring(0, 1).toUpperCase() + subField.substring(1); + } + //导出字段属性转换 + List listOptions = GenerateCommon.getExpotColumn(columnList); + //++++++++++++++++++++++++++++主副子通用参数++++++++++++++++++++++++++/ + listMap.put("hasPage", columnDataModel.getHasPage()); + listMap.put("defaultSidx", columnDataModel.getDefaultSidx()); + listMap.put("sort", columnDataModel.getSort()); + listMap.put("authority", authority); + //app pc 数据权限是否开启 + listMap.put("pcDataPermisson", columnDataModel.getUseDataPermission()); + listMap.put("appDataPermisson", appColumnDataModel.getUseDataPermission()); + listMap.put("groupModels", groupModels); + listMap.put("groupAppModels", groupAppModels); + listMap.put("childTableNameList", childTableNameList); + listMap.put("allTableNameList", allTableNameList); + //是否开启高级查询 + listMap.put("superQuery", columnDataModel.getHasSuperQuery()); + listMap.put("ruleQuery", true); + + //++++++++++++++++++++++++++++仅主表参数++++++++++++++++++++++++++// + if (generateParamModel.isMainTable()) { + //列表全属性 + listMap.put("columnDataStr", JSONObject.toJSONString(GenerateCommon.objRemoveJson(entity.getColumnData()))); + listMap.put("appColumnDataStr", JSONObject.toJSONString(GenerateCommon.objRemoveJson(entity.getAppColumnData()))); + listMap.put("columnData", JsonUtil.stringToMap(entity.getColumnData())); + //列表-pc-app-并集 + listMap.put("columnList", columnList); + listMap.put("searchList", searchList); + listMap.put("columnAppList", columnAppList); + listMap.put("searchAppList", searchAppList); + listMap.put("columnListAll", columnListAll); + listMap.put("searchListAll", searchListAll); + //子表样式 + listMap.put("childTableStyle", columnDataModel.getChildTableStyle()); + + //左侧树 + listMap.put("leftTreeTable", columnDataModel.getType() == 2); + //分组 + listMap.put("groupTable", columnDataModel.getType() == 3); + listMap.put("groupField", columnDataModel.getGroupField()); + //行内编辑 + listMap.put("lineEdit", columnDataModel.getType() == 4); + //树形参数 + listMap.put("treeTable", columnDataModel.getType() == 5); + //合计 + boolean configurationTotal = columnDataModel.isShowSummary(); + if (columnDataModel.getType() == 3 || columnDataModel.getType() == 5) { + configurationTotal = false; + } + listMap.put("configurationTotal", configurationTotal); + List summaryList = CollectionUtils.isEmpty(columnDataModel.getSummaryField()) ? Collections.EMPTY_LIST : columnDataModel.getSummaryField(); + listMap.put("fieldsTotal", JsonUtil.getObjectToString(summaryList)); + //按键 + listMap.put("btnsList", btnDataList); + listMap.put("columnBtnsList", columnBtnDataList); + listMap.put("btnPcList", btnPcList); + listMap.put("columnBtnPcList", columnBtnPcList); + + listMap.put("hasDownloadBtn", hasDownloadBtn); + listMap.put("hasUploadBtn", hasUploadBtn); + listMap.put("hasPrintBtn", hasPrintBtn); + listMap.put("hasRemoveBtn", hasRemoveBtn); + + listMap.put("parentField", parentField); + listMap.put("subField", subField); + //导入的字段 + listMap.put("importFields", allUploadTemplates); + //是否有子表-用于判断导入excel表头是否有两行 + listMap.put("importHasChildren", importHasChildren); + listMap.put("importType", importType); + //导入字段名称是否重复 + listMap.put("nameAgain", nameAgain); + listMap.put("listOptions", listOptions); + + // 是否存在列表子表数据 + listMap.put("hasSub", mastTable.size() > 0 ? true : false); + + //复杂表头 + List complexFieldList=new ArrayList<>(); + List> complexHeaderList=new ArrayList<>(); + if(!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)){ + for(HeaderModel headerModel:columnDataModel.getComplexHeaderList()){ + complexFieldList.addAll(headerModel.getChildColumns()); + Map map = JsonUtil.entityToMap(headerModel); + //复杂表头添加导入字段信息 + List> uploadFieldList=new ArrayList<>(); + for(Map uploadmap:allUploadTemplates){ + if(headerModel.getChildColumns().contains(uploadmap.get("vModel"))){ + Map objectObjectHashMap = new HashMap<>(); + objectObjectHashMap.put("vModel",uploadmap.get("vModel")); + objectObjectHashMap.put("label",uploadmap.get("label")); + uploadFieldList.add(objectObjectHashMap); + } + } + map.put("uploadFieldList",uploadFieldList); + complexHeaderList.add(map); + } + } + listMap.put("complexHeaderList", JsonUtil.getListToJsonArray(complexHeaderList)); + listMap.put("complexFieldList", JsonUtil.getListToJsonArray(complexFieldList)); + } + } + + /** + * 添加左侧树查询字段 + * + * @param mainTableModel + * @param columnDataModel + * @param searchListAll + */ + private void addTreeSearchField(TableModel mainTableModel, ColumnDataModel columnDataModel, List searchListAll) { + List cSaArr = searchListAll.stream().map(SearchTypeModel::getId).collect(Collectors.toList()); + //左侧树-若查询列表内没有需要添加到查询字段内 + if (Objects.equals(columnDataModel.getType(), 2)) { + String treeRelationField = columnDataModel.getTreeRelation(); + if (!cSaArr.contains(treeRelationField)) { + SearchTypeModel searchTypeModel = new SearchTypeModel(); + searchTypeModel.setId(treeRelationField); + searchTypeModel.setSearchType(2); + if (columnDataModel.getTreeDataSource().equals("organize")) { + searchTypeModel.setJnpfKey(JnpfKeyConsts.COMSELECT); + searchTypeModel.setSearchType(1); + } + searchTypeModel.setLabel("tree"); + searchTypeModel.setTableName(mainTableModel.getTable()); + searchListAll.add(searchTypeModel); + cSaArr.add(searchTypeModel.getId()); + } + } + } + + /** + * 查询字段配置调整 + * + * @param tableModelList + * @param mainTable + * @param tableRenames + * @param childKeyTableNameMap + * @param mainTableModel + * @param searchListAll + * @return + */ + private List getListSearchGroupModels(List tableModelList, TableModel mainTable, Map tableRenames, Map childKeyTableNameMap, TableModel mainTableModel, List searchListAll) { + List groupModels = new ArrayList<>(); + List rangeToLike = new ArrayList() {{ + add(JnpfKeyConsts.COM_INPUT); + add(JnpfKeyConsts.TEXTAREA); + }}; + //查询全字段-转换--pagenation-字段不用替换了 + searchListAll.stream().forEach(t -> { + t.setId(t.getId().replace("-", "_")); + //单行和多行范围查询转模糊 + if (Objects.equals(t.getSearchType(), 3) && rangeToLike.contains(t.getConfig().getJnpfKey())) { + t.setSearchType(2); + } + }); + if (searchListAll.size() > 0) { + //主表 + for (TableFields tableFields : mainTableModel.getFields()) { + searchListAll.stream().forEach(searchTypeModel -> { + if (searchTypeModel.getId().equals(tableFields.getField())) { + searchTypeModel.setDataType(tableFields.getDataType()); + } + }); + } + //鉴别列表子表正则 + String reg = "^[jnpf_]\\S*_jnpf\\S*"; + searchListAll.stream().filter(s -> s.getId().matches(reg)).forEach(cl -> { + String s = cl.getId(); + String s1 = s.substring(s.lastIndexOf("jnpf_")).replace("jnpf_", ""); + String s2 = s.substring(s.indexOf("_") + 1, s.lastIndexOf("_jnpf")); + cl.setAfterVModel(s1); + cl.setTableName(s2); + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equalsIgnoreCase(s2)).findFirst().orElse(null); + cl.setDataType(tableModel.getFields().stream().filter(t -> t.getField().equalsIgnoreCase(s1)).findFirst().orElse(null).getDataType()); + } + ); + //副表 + Map> collect = searchListAll.stream().filter(s -> s.getId().matches(reg)).collect(Collectors.groupingBy(t -> t.getTableName())); + groupModels = collect.entrySet().stream().map(c -> { + ListSearchGroupModel groupModel = new ListSearchGroupModel(); + groupModel.setModelName(tableRenames.get(c.getKey())); + groupModel.setTableName(c.getKey()); + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equalsIgnoreCase(c.getKey())).findFirst().orElse(null); + groupModel.setForeignKey(tableModel.getTableField()); + groupModel.setMainKey(tableModel.getRelationField()); + groupModel.setSearchTypeModelList(c.getValue()); + return groupModel; + } + ).collect(Collectors.toList()); + + //子表 + Map> collect1 = searchListAll.stream().filter(s -> s.getId().toLowerCase().contains(JnpfKeyConsts.CHILD_TABLE_PREFIX)) + .collect(Collectors.groupingBy(t -> t.getId().substring(0, t.getId().lastIndexOf("_")))); + List collect2 = collect1.entrySet().stream().map(c -> { + ListSearchGroupModel groupModel = new ListSearchGroupModel(); + String tableName = childKeyTableNameMap.get(c.getKey()); + groupModel.setModelName(tableRenames.get(tableName)); + groupModel.setTableName(tableName); + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equalsIgnoreCase(tableName)).findFirst().orElse(null); + groupModel.setForeignKey(tableModel.getTableField()); + groupModel.setMainKey(tableModel.getRelationField()); + List value = c.getValue(); + value.stream().forEach(v -> { + String vmodelall = v.getId(); + String substring = vmodelall.substring(vmodelall.lastIndexOf("_") + 1); + v.setAfterVModel(substring); + }); + groupModel.setSearchTypeModelList(value); + return groupModel; + } + ).collect(Collectors.toList()); + groupModels.addAll(collect2); + + ListSearchGroupModel groupModel = new ListSearchGroupModel(); + groupModel.setSearchTypeModelList(searchListAll.stream().filter(s -> !s.getId().matches(reg) + && !s.getId().toLowerCase().contains(JnpfKeyConsts.CHILD_TABLE_PREFIX)).collect(Collectors.toList())); + groupModel.setTableName(mainTable.getTable()); + groupModel.setModelName(tableRenames.get(mainTable.getTable())); + groupModels.add(groupModel); + } + return groupModels; + } + + /** + * 生成java代码 + * + * @param generateParamModel + * @param codeUtil 模板对象 + */ + private void setCode(GenerateParamModel generateParamModel, GenerateInterface codeUtil) throws Exception { + //获取传递参数 + Map columndata = this.getcolumndata(generateParamModel); + String fileName = generateParamModel.getFileName(); + String templatesPath = generateParamModel.getTemplatesPath(); + DownloadCodeForm downloadCodeForm = generateParamModel.getDownloadCodeForm(); + DbLinkEntity linkEntity = generateParamModel.getLinkEntity(); + String className = generateParamModel.getClassName(); + String table = generateParamModel.getTable(); + String path = generateParamModel.getPath(); + Template7Model template7Model = generateParamModel.getTemplate7Model(); + CustomGenerator mpg = new CustomGenerator(columndata); + + // 全局配置 + GlobalConfig gc = new GlobalConfig(); + gc.setFileOverride(true); + // 不需要ActiveRecord特性的请改为false + gc.setActiveRecord(false); + // XML 二级缓存 + gc.setEnableCache(false); + // XML ResultMap + gc.setBaseResultMap(false); + // XML columList + gc.setBaseColumnList(false); + gc.setAuthor(template7Model.getCreateUser()); + gc.setOpen(false); + + // 自定义文件命名,注意 %s 会自动填充表实体属性! + if (generateParamModel.isMainTable()) { + gc.setControllerName(template7Model.getClassName() + GenFileNameSuffix.CONTROLLER); + } + gc.setEntityName(template7Model.getClassName() + GenFileNameSuffix.ENTITY); + gc.setMapperName(template7Model.getClassName() + GenFileNameSuffix.MAPPER); + gc.setServiceName(template7Model.getClassName() + GenFileNameSuffix.SERVICE); + gc.setServiceImplName(template7Model.getClassName() + GenFileNameSuffix.SERVICEIMPL); + mpg.setGlobalConfig(gc); + + // 数据源配置 + mpg.setDataSource(SourceUtil.dbConfig(TenantDataSourceUtil.getTenantSchema(), linkEntity)); + + // 策略配置 + StrategyConfig strategy = new StrategyConfig(); + strategy.setEntityLombokModel(true); + // 表名生成策略 + strategy.setNaming(NamingStrategy.underline_to_camel); + // 需要生成的表 + strategy.setInclude(table); + strategy.setRestControllerStyle(true); + mpg.setStrategy(strategy); + + // 包配置 + PackageConfig pc = new PackageConfig(); + pc.setParent(downloadCodeForm.getModulePackageName()); + mpg.setPackageInfo(pc); + + // 自定义配置 + InjectionConfig cfg = new InjectionConfig() { + @Override + public void initMap() { + // to do nothing + } + }; + //后端代码文件生成 + cfg.setFileOutConfigList(GenerateCommon.getJavaFiles(generateParamModel)); + mpg.setTemplate(new TemplateConfig().setXml(null).setMapper(null).setController(null).setEntity(null).setService(null).setServiceImpl(null)); + mpg.setCfg(cfg); + // 执行生成 + mpg.execute(path); + } + + /** + * 生成前端代码 + * + * @param generateParamModel + * @param codeUtil + * @throws Exception + */ + private void generateHtml(GenerateParamModel generateParamModel, GenerateInterface codeUtil) throws Exception { + String fileName = generateParamModel.getFileName(); + String templatesPath = generateParamModel.getTemplatesPath(); + DownloadCodeForm downloadCodeForm = generateParamModel.getDownloadCodeForm(); + DbLinkEntity linkEntity = generateParamModel.getLinkEntity(); + String className = generateParamModel.getClassName(); + String path = generateParamModel.getPath(); + VisualdevEntity entity = generateParamModel.getEntity(); + ConfigValueUtil configValueUtil = generateParamModel.getConfigValueUtil(); + + Template7Model template7Model = GenerateCommon.getTemplate7Model(className); + template7Model.setTableName(downloadCodeForm.getClassName()); + template7Model.setDescription(downloadCodeForm.getDescription()); + generateParamModel.setTemplate7Model(template7Model); + //自定义包名 + String modulePackageName = downloadCodeForm.getModulePackageName(); + Map map = new HashMap<>(16); + //formTempJson + FormDataModel formData = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + + List formAllModel = new ArrayList<>(); + RecursionForm recursionForm = new RecursionForm(); + recursionForm.setTableModelList(JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class)); + recursionForm.setList(list); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + + //form的属性 + List mast = formAllModel.stream().filter(t -> FormEnum.mast.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + List table = formAllModel.stream().filter(t -> FormEnum.table.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + List mastTable = formAllModel.stream().filter(t -> FormEnum.mastTable.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + + //tableList + List tablesList = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + //取对应表的别名 + Map tableRenames = FunctionFormPublicUtil.tableNameRename(downloadCodeForm, tablesList); + //子表(tableField,tableName)->tablefield1->realname + Map childKeyTableNameMap = new HashMap<>(8); + table.stream().forEach(t -> childKeyTableNameMap.put(t.getChildList().getTableModel(), t.getChildList().getTableName())); + Map childKeyRenameMap = new HashMap<>(8); + for (String key : childKeyTableNameMap.keySet()) { + childKeyRenameMap.put(key, tableRenames.get(childKeyTableNameMap.get(key))); + } + //主表 + TableModel mainTableModel = tablesList.stream().filter(t -> t.getTypeId().equals("1")).findFirst().orElse(null); + + //主表赋值 + for (int i = 0; i < mast.size(); i++) { + FieLdsModel fieLdsModel = mast.get(i).getFormColumnModel().getFieLdsModel(); + ConfigModel configModel = fieLdsModel.getConfig(); + if (configModel.getDefaultValue() instanceof String) { + configModel.setValueType("String"); + } + if (configModel.getDefaultValue() == null) { + configModel.setValueType("undefined"); + } + fieLdsModel.setConfig(configModel); + } + //副表列表字段赋值 + List formChildList = new ArrayList<>(); + Map> groupColumnDataMap = mastTable.stream().collect(Collectors.groupingBy(m -> m.getFormMastTableModel().getTable())); + //副表model + for (String key : groupColumnDataMap.keySet()) { + Map objectMap = new HashMap<>(); + String childClassName = DataControlUtils.captureName(tableRenames.get(key)); + ColumnListDataModel columnListDataModel = new ColumnListDataModel(); + columnListDataModel.setModelName(childClassName); + columnListDataModel.setModelUpName(DataControlUtils.captureName(childClassName)); + columnListDataModel.setModelLowName(DataControlUtils.initialLowercase(childClassName)); + List allModels = groupColumnDataMap.get(key); + allModels.stream().forEach(m -> { + String vModel = m.getFormMastTableModel().getField(); + m.getFormMastTableModel().getMastTable().getFieLdsModel().setVModel(vModel); + }); + List fields = allModels.stream().map(m -> + m.getFormMastTableModel().getField()).collect(Collectors.toList()); + columnListDataModel.setFieldList(fields); + columnListDataModel.setFieLdsModelList(allModels.stream().map(al -> al.getFormMastTableModel()).collect(Collectors.toList())); + columnListDataModel.setTableName(key); + formChildList.add(columnListDataModel); + List children = allModels.stream().map(allModel -> allModel.getFormMastTableModel().getMastTable()).collect(Collectors.toList()); + FormColumnTableModel formColumnTableModel = new FormColumnTableModel(); + formColumnTableModel.setChildList(children); + objectMap.put("children", formColumnTableModel); + objectMap.put("genInfo", generateParamModel.getTemplate7Model()); + objectMap.put("package", modulePackageName); + objectMap.put("module", downloadCodeForm.getModule()); + objectMap.put("className", childClassName); + childrenTemplates(FormCommonUtil.getLocalBasePath() + configValueUtil.getServiceDirectoryPath() + fileName, + objectMap, downloadCodeForm, false, codeUtil); + } + //子表赋值 + List> child = new ArrayList<>(); + //子表model + for (int i = 0; i < table.size(); i++) { + FormColumnTableModel childList = table.get(i).getChildList(); + Map objectMap = JsonUtil.entityToMap(childList); + List tableList = childList.getChildList(); + String childClassName = DataControlUtils.captureName(tableRenames.get(childList.getTableName())); + //导入字段属性设置 + if (VisualWebTypeEnum.FORM_LIST.getType().equals(entity.getWebType()) && !Objects.equals(entity.getType(), 3)) { + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(entity.getColumnData(), ColumnDataModel.class); + if (columnDataModel.getUploaderTemplateJson() != null) { + UploaderTemplateModel uploaderTemplateModel = JsonUtil.getJsonToBean(columnDataModel.getUploaderTemplateJson(), UploaderTemplateModel.class); + List selectKey = uploaderTemplateModel.getSelectKey() != null ? uploaderTemplateModel.getSelectKey() : Collections.EMPTY_LIST; + tableList.stream().forEach(item -> { + String childFieldKey = item.getFieLdsModel().getConfig().getParentVModel() + "-" + item.getFieLdsModel().getVModel(); + if (selectKey.contains(childFieldKey)) { + item.getFieLdsModel().setNeedImport(true); + } + }); + } + } + + //子表别名 + childList.setAliasClassName(childClassName); + childList.setAliasUpName(DataControlUtils.captureName(childClassName)); + childList.setAliasLowName(DataControlUtils.initialLowercase(childClassName)); + //去除复杂表头里面的字段(无用信息) + List complexHeaderList = childList.getComplexHeaderList(); + for (HeaderModel headerModel : complexHeaderList) { + headerModel.setChildList(null); + } + objectMap.put("children", childList); + objectMap.put("genInfo", generateParamModel.getTemplate7Model()); + objectMap.put("package", modulePackageName); + objectMap.put("module", downloadCodeForm.getModule()); + objectMap.put("className", childClassName); + //生成xxxmodel 和 xxxlist + childrenTemplates(FormCommonUtil.getLocalBasePath() + configValueUtil.getServiceDirectoryPath() + fileName, + objectMap, downloadCodeForm, true, codeUtil); + for (FormColumnModel columnModel : tableList) { + FieLdsModel fieLdsModel = columnModel.getFieLdsModel(); + List templateJson = fieLdsModel.getConfig().getTemplateJson(); + String json = templateJson.size() > 0 ? JsonUtil.getObjectToString(templateJson) : fieLdsModel.getTemplateJson(); + fieLdsModel.setTemplateJson(json); + } + childList.setChildList(tableList); + Map childs = JsonUtil.entityToMap(childList); + child.add(childs); + } + + //微服务标识 + map.put("isCloud", GenerateCommon.IS_CLOUD); + //是列表,是流程判断 + if (VisualWebTypeEnum.FORM_LIST.getType().equals(entity.getWebType())) { + map.put("isList", true); + } + if (Objects.equals(entity.getEnableFlow(), 1)) { + map.put("isFlow", true); + } + //界面 + map.put("genInfo", generateParamModel.getTemplate7Model()); + map.put("modelName", downloadCodeForm.getClassName()); + map.put("package", modulePackageName); + map.put("isMain", true); + map.put("moduleId", entity.getId()); + + map.put("module", downloadCodeForm.getModule()); + map.put("className", DataControlUtils.captureName(downloadCodeForm.getClassName())); + map.put("tableRenames", JSONObject.toJSONString(JsonUtil.getObjectToString(tableRenames))); + map.put("childKeyTableNameMap", JSONObject.toJSONString(JsonUtil.getObjectToString(childKeyTableNameMap))); + map.put("templateJsonAll", JSONObject.toJSONString(GenerateCommon.getInterTemplateJson(formAllModel, childKeyRenameMap))); + //乐观锁 + map.put("version", formData.getConcurrencyLock()); + map.put("formRef", formData.getFormRef()); + map.put("formModel", formData.getFormModel()); + map.put("size", formData.getSize()); + map.put("labelPosition", formData.getLabelPosition()); + map.put("generalWidth", formData.getGeneralWidth()); + map.put("drawerWidth", formData.getDrawerWidth()); + map.put("fullScreenWidth", formData.getFullScreenWidth()); + map.put("formStyle", formData.getFormStyle()); + map.put("labelWidth", formData.getLabelWidth()); + map.put("formRules", formData.getFormRules()); + map.put("gutter", formData.getGutter()); + map.put("disabled", formData.getDisabled()); + map.put("span", formData.getSpan()); + map.put("formBtns", formData.getFormBtns()); + map.put("idGlobal", formData.getIdGlobal()); + map.put("popupType", formData.getPopupType()); + //表单按钮 + map.put("HasCancelBtn", formData.getHasCancelBtn()); + map.put("HasConfirmBtn", formData.getHasConfirmBtn()); + map.put("HasPrintBtn", formData.getHasPrintBtn()); + map.put("CancelButton", formData.getCancelButtonText()); + map.put("ConfirmButton", formData.getConfirmButtonText()); + map.put("PrintButton", formData.getPrintButtonText()); + map.put("PrintId", JsonUtil.getObjectToString(formData.getPrintId())); + map.put("form", formAllModel); + + map.put("groupColumnDataMap", groupColumnDataMap); + map.put("formModelName", entity.getFullName()); + map.put("dbLinkId", entity.getDbLinkId()); + //共用 + map.put("children", child); + map.put("fields", mast); + map.put("mastTable", mastTable); + map.put("columnChildren", formChildList); + String pKeyName = generateParamModel.getPKeyName().toLowerCase().trim().replaceAll("f_", ""); + map.put("pKeyName", pKeyName); + String modelPathName = downloadCodeForm.getClassName().toLowerCase(); + map.put("modelPathName", modelPathName); + map.put("formModelName", entity.getFullName()); + map.put("formDataStr", JSONObject.toJSONString(GenerateCommon.objRemoveJson(entity.getFormData()))); + map.put("tableListStr", JSONObject.toJSONString(entity.getVisualTables())); + map.put("ableAll", JsonUtil.getListToJsonArray(formAllModel)); + map.put("hasConfirmAndAddBtn", formData.getHasConfirmAndAddBtn()); + + boolean hasUploadBtn = false; + boolean hasSuperQuery = false; + int columnTtype = 0; + //webType=2 列表生成 高级查询json,列表json,查询json enableflow启用流程 + if (VisualWebTypeEnum.FORM_LIST.getType().equals(entity.getWebType()) && !Objects.equals(entity.getType(), 3)) { + //添加行参数 + generateParamModel.setMainTable(true); + getListColumndata(generateParamModel, map); + Map columnDataModel = JsonUtil.stringToMap(entity.getColumnData()); + //按钮 + List btnDataList = JsonUtil.getJsonToList(columnDataModel.get("btnsList"), BtnData.class); + hasUploadBtn = btnDataList.stream().anyMatch(btn -> btn.getValue().equals("upload")); + //是否开启高级查询 + hasSuperQuery = (boolean) columnDataModel.get("hasSuperQuery"); + columnTtype = (int) columnDataModel.get("type"); + //最外层zip包路径名称 + String zipName = FormCommonUtil.getLocalBasePath() + configValueUtil.getServiceDirectoryPath() + fileName; + //生成文件夹 + String htmlTSPath = XSSEscape.escapePath(zipName + File.separator + "html" + File.separator + "web" + File.separator + modelPathName + File.separator + "helper"); + File htmlJSfile = new File(htmlTSPath); + if (!htmlJSfile.exists() && !"form".equals(downloadCodeForm.getModule())) { + htmlJSfile.mkdirs(); + } + if (hasSuperQuery) { + String superSqJsPath = htmlTSPath + File.separator + "superQueryJson.ts"; + String data = JSONObject.toJSONString(columnDataModel.get("columnOptions"), SerializerFeature.WriteMapNullValue); + SuperQueryUtil.CreateJsFile(data, superSqJsPath, "superQueryJson"); + } + + String colData = JSONObject.toJSONString(columnDataModel.get("columnList"), SerializerFeature.WriteMapNullValue); + String colListJsPath = htmlTSPath + File.separator + "columnList.ts"; + SuperQueryUtil.CreateJsFile(colData, colListJsPath, "columnList"); + + String searchData = JSONObject.toJSONString(columnDataModel.get("searchList"), SerializerFeature.WriteMapNullValue); + String searchListJsPath = htmlTSPath + File.separator + "searchList.ts"; + SuperQueryUtil.CreateJsFile(searchData, searchListJsPath, "searchList"); + + //生成复杂表头对象 + createComplexHeaderExcelVo(zipName, generateParamModel, entity, downloadCodeForm, map); + } + + /** + * 生成前端及后端model文件 + */ + htmlTemplates(FormCommonUtil.getLocalBasePath() + configValueUtil.getServiceDirectoryPath() + fileName, + map, templatesPath, columnTtype, hasUploadBtn, downloadCodeForm, codeUtil); + + /** + * 生成表单设计json文件 + */ + if (Objects.equals(entity.getEnableFlow(), 1) || Objects.equals(entity.getType(), 3)) { + FlowFormEntity flowFormEntity = FunctionFormPublicUtil.exportFlowFormJson(entity, downloadCodeForm); + SuperQueryUtil.CreateFlowFormJsonFile(JsonUtil.getObjectToString(flowFormEntity), + FormCommonUtil.getLocalBasePath() + configValueUtil.getServiceDirectoryPath() + fileName); + } + } + + /** + * 渲染html模板 + * + * @param path 路径 + * @param object 模板数据 + * @param templatePath 模板路径 + */ + private void htmlTemplates(String path, Map object, String templatePath, int type, boolean hasImport, + DownloadCodeForm downloadCodeForm, GenerateInterface codeUtil) throws Exception { + //获取模板列表 + List templates = codeUtil.getTemplates(templatePath, type, hasImport); + //界面模板 + VelocityContext context = new VelocityContext(); + context.put("context", object); + for (String template : templates) { + String className = object.get("className").toString(); + String fileNames = GenerateCommon.getFileName(path, template, className, downloadCodeForm); + GenerateCommon.velocityWriterFile(context, template, fileNames); + } + } + + /** + * 副子表model + * + * @param path 路径 + * @param object 模板数据 + */ + private void childrenTemplates(String path, Map object, DownloadCodeForm downloadCodeForm, + Boolean isChild, GenerateInterface codeUtil) { + //获取模板列表 + List templates = codeUtil.getChildTemps(isChild); + VelocityContext context = new VelocityContext(); + context.put("context", object); + for (String templateName : templates) { + String className = object.get("className").toString(); + String fileNames = GenerateCommon.getFileName(path, templateName, className, downloadCodeForm); + GenerateCommon.velocityWriterFile(context, templateName, fileNames); + } + } + + /** + * 复杂表头 对象生成。 + * @param path + * @param generateParamModel + * @param entity + * @param downloadCodeForm + * @param objectAll + */ + private void createComplexHeaderExcelVo(String path, GenerateParamModel generateParamModel, VisualdevEntity entity, + DownloadCodeForm downloadCodeForm, Map objectAll) { + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(entity.getColumnData(), ColumnDataModel.class); + JsonUtil.getListToJsonArray(columnDataModel.getComplexHeaderList()); + List complexHeaderList = columnDataModel.getComplexHeaderList(); + String templateName = File.separator + "java" + File.separator + "ExcelVO.java.vm" ; + VelocityContext context = new VelocityContext(); + Map object = new HashMap<>(); + object.put("genInfo", generateParamModel.getTemplate7Model()); + object.put("package", generateParamModel.getDownloadCodeForm().getModulePackageName()); + object.put("module", downloadCodeForm.getModule()); + object.put("isMain", true); + object.put("isComplexVo", true); + object.put("importFields", objectAll.get("importFields")); + for (HeaderModel item : complexHeaderList) { + if(item.getChildColumns().size()>0){ + String className = "Complex" + item.getId(); + object.put("complexList", JsonUtil.getListToJsonArray(item.getChildColumns())); + object.put("className", className); + context.put("context", object); + String fileNames = GenerateCommon.getFileName(path, templateName, className, downloadCodeForm); + GenerateCommon.velocityWriterFile(context, templateName, fileNames); + } + } + } + + /** + * app代码生成 + * + * @param generateParamModel 参数 + * @param codeUtil 模板 + */ + private void generateApp(GenerateParamModel generateParamModel, GenerateInterface codeUtil) throws Exception { + VisualdevEntity entity = generateParamModel.getEntity(); + ConfigValueUtil configValueUtil = generateParamModel.getConfigValueUtil(); + DownloadCodeForm downloadCodeForm = generateParamModel.getDownloadCodeForm(); + UserInfo userInfo = generateParamModel.getUserInfo(); + String templatesPath = generateParamModel.getTemplatesPath(); + String fileName = generateParamModel.getFileName(); + DataSourceUtil dataSourceUtil = generateParamModel.getDataSourceUtil(); + DbLinkEntity linkEntity = generateParamModel.getLinkEntity(); + String column = StringUtil.isNotEmpty(entity.getColumnData()) ? entity.getColumnData() : "{}"; + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(column, ColumnDataModel.class); + boolean groupTable = "3".equals(String.valueOf(columnDataModel.getType())); + FormDataModel model = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + model.setModule(downloadCodeForm.getModule()); + model.setClassName(downloadCodeForm.getClassName()); + model.setAreasName(downloadCodeForm.getModule()); + model.setServiceDirectory(configValueUtil.getServiceDirectoryPath()); + List filterFeildList = JsonUtil.getJsonToList(model.getFields(), FieLdsModel.class); + model.setFields(JSON.toJSONString(filterFeildList)); + //app信息调整 + VisualdevEntity entityCopy = BeanUtil.copyProperties(entity, VisualdevEntity.class); + entityCopy.setColumnData(entity.getAppColumnData()); + entityCopy.setEnableFlow(Objects.equals(entity.getType(),3)?1:entity.getEnableFlow()); + AppGenModel appGenModel = new AppGenModel(); + appGenModel.setEntity(entityCopy); + appGenModel.setPKeyName(generateParamModel.getPKeyName()); + appGenModel.setServiceDirectory(FormCommonUtil.getLocalBasePath() + configValueUtil.getServiceDirectoryPath()); + appGenModel.setDownloadCodeForm(downloadCodeForm); + appGenModel.setUserInfo(userInfo); + appGenModel.setTemplatePath(templatesPath); + appGenModel.setFileName(fileName); + appGenModel.setLinkEntity(linkEntity); + appGenModel.setDataSourceUtil(dataSourceUtil); + appGenModel.setGroupTable(groupTable); + appGenModel.setType(String.valueOf(columnDataModel.getType())); + appGenModel.setModel(model); + AppGenUtil appGenUtil = new AppGenUtil(); + appGenUtil.htmlTemplates(appGenModel); + } +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-biz/src/main/java/jnpf/generater/service/VisualdevGenService.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-biz/src/main/java/jnpf/generater/service/VisualdevGenService.java new file mode 100644 index 0000000..180c1ab --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-biz/src/main/java/jnpf/generater/service/VisualdevGenService.java @@ -0,0 +1,29 @@ +package jnpf.generater.service; + + +import jnpf.base.entity.VisualdevEntity; +import jnpf.base.model.DownloadCodeForm; +import jnpf.base.service.SuperService; + +/** + * + * 可视化开发功能表 + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-04-02 + */ +public interface VisualdevGenService extends SuperService { + + String codeGengerate(String id, DownloadCodeForm downloadCodeForm) throws Exception; + + /** + * 代码生成v3 + * @param visualdevEntity 可视化开发功能 + * @param downloadCodeForm 下载相关信息 + * @return 下载文件名 + * @throws Exception ignore + */ + String codeGengerateV3(VisualdevEntity visualdevEntity, DownloadCodeForm downloadCodeForm) throws Exception; +} + diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-biz/src/main/java/jnpf/generater/service/impl/VisualdevGenServiceImpl.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-biz/src/main/java/jnpf/generater/service/impl/VisualdevGenServiceImpl.java new file mode 100644 index 0000000..ff36085 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-biz/src/main/java/jnpf/generater/service/impl/VisualdevGenServiceImpl.java @@ -0,0 +1,332 @@ +package jnpf.generater.service.impl; + +import cn.hutool.core.io.FileUtil; +import com.alibaba.fastjson.JSON; +import com.google.common.base.CaseFormat; +import jnpf.base.UserInfo; +import jnpf.base.entity.VisualdevEntity; +import jnpf.base.mapper.VisualdevMapper; +import jnpf.base.model.ColumnDataModel; +import jnpf.base.model.DownloadCodeForm; +import jnpf.base.service.DbLinkService; +import jnpf.base.service.SuperServiceImpl; +import jnpf.base.service.VisualdevService; +import jnpf.base.util.VisualUtils; +import jnpf.base.util.app.AppGenModel; +import jnpf.base.util.app.AppGenUtil; +import jnpf.base.util.common.FormCommonUtil; +import jnpf.base.util.custom.VelocityEnum; +import jnpf.base.util.form.FormGenModel; +import jnpf.base.util.form.FormGenUtil; +import jnpf.base.util.fuctionFormVue3.common.GenerateParamModel; +import jnpf.base.util.functionForm.CodeGenerateUtil; +import jnpf.base.util.workFlow.WorkGenModel; +import jnpf.base.util.workFlow.WorkGenUtil; +import jnpf.config.ConfigValueUtil; +import jnpf.constant.FileTypeConstant; +import jnpf.constant.MsgCode; +import jnpf.database.model.entity.DbLinkEntity; +import jnpf.database.util.DataSourceUtil; +import jnpf.generater.factory.CodeGenerateFactory; +import jnpf.generater.factory.CodeGenerateFactoryV3; +import jnpf.generater.model.GenBaseInfo; +import jnpf.generater.service.VisualdevGenService; +import jnpf.model.FileListVO; +import jnpf.model.visualJson.FieLdsModel; +import jnpf.model.visualJson.FormDataModel; +import jnpf.model.visualJson.TableModel; +import jnpf.util.FileUploadUtils; +import jnpf.util.JsonUtil; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import org.apache.velocity.app.Velocity; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; + +/** + * 可视化开发功能表 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-04-02 + */ +@Service +public class VisualdevGenServiceImpl extends SuperServiceImpl implements VisualdevGenService { + + @Autowired + private UserProvider userProvider; + @Autowired + private DataSourceUtil dataSourceUtil; + @Autowired + private DbLinkService dataSourceApi; + @Autowired + private VisualdevService visualdevService; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private CodeGenerateFactory CodeGenerateFactory; + @Autowired + private CodeGenerateFactoryV3 GenerateFactoryV3; + + @Override + public String codeGengerate(String id, DownloadCodeForm downloadCodeForm) throws Exception { + UserInfo userInfo = userProvider.get(); + VisualdevEntity entity = visualdevService.getInfo(id); + DbLinkEntity linkEntity = dataSourceApi.getInfo(entity.getDbLinkId()); + if (entity.getDbLinkId() == null) { + linkEntity = null; + } + if (entity != null) { + if (!StringUtil.isEmpty(entity.getVisualTables())) { + entity.setEnableFlow(Objects.equals(entity.getType(),3)?1:entity.getEnableFlow()); + FormDataModel model = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + model.setModule(downloadCodeForm.getModule()); + model.setClassName(downloadCodeForm.getClassName()); + model.setAreasName(downloadCodeForm.getModule()); + model.setServiceDirectory(configValueUtil.getServiceDirectoryPath()); + List filterFeildList = JsonUtil.getJsonToList(model.getFields(), FieLdsModel.class); + model.setFields(JSON.toJSONString(filterFeildList)); + String fileName = entity.getFullName() + System.currentTimeMillis(); + //初始化模板 + Velocity.reset(); + VelocityEnum.init.initVelocity(FileUploadUtils.getLocalBasePath() + configValueUtil.getTemplateCodePath()); + + List list = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + //获取主表 + String mainTable = list.stream().filter(t -> "1".equals(t.getTypeId())).findFirst().get().getTable(); + //获取主键 + String pKeyName = VisualUtils.getpKey(linkEntity, mainTable).toLowerCase().trim().replaceAll("f_", ""); + //自定义包名 + String modulePackageName = StringUtil.isNotEmpty(downloadCodeForm.getModulePackageName()) ? downloadCodeForm.getModulePackageName() : GenBaseInfo.PACKAGE_NAME; + downloadCodeForm.setModulePackageName(modulePackageName); + //获取其他子表的主键 + Map childpKeyMap = new HashMap<>(16); + for (TableModel tableModel : list) { + String childKey = VisualUtils.getpKey(linkEntity, tableModel.getTable()); + if (childKey.length() > 2) { + if ("f_".equals(childKey.substring(0, 2).toLowerCase())) { + childKey = childKey.substring(2); + } + } + childpKeyMap.put(tableModel.getTable(), childKey); + } + //判断子表名称 + List childTb = new ArrayList(); + if (!StringUtil.isEmpty(downloadCodeForm.getSubClassName())) { + childTb = Arrays.asList(downloadCodeForm.getSubClassName().split(",")); + } + + Set set = new HashSet<>(childTb); + boolean result = childTb.size() == set.size() ? true : false; + if (!result) { + return "名称不能重复"; + } + String templatesPath = null; + + //非本地模板需要下载-获取模板如下 + if (!FileUploadUtils.getDefaultPlatform().startsWith("local")) { + List fileList = new ArrayList<>(); + fileList.addAll(FileUploadUtils.getDefaultFileList(configValueUtil.getTemplateCodePath())); +// fileList.addAll(FileUploadUtils.getDefaultFileList(configValueUtil.getTemplateCodePathVue3() + templatesPath + "/")); + for (FileListVO fileListVO : fileList) { + String eachFileName = fileListVO.getFileName(); + int index = eachFileName.lastIndexOf("/"); + //服务器路径 + String floderName = eachFileName.substring(0, index); + //本地路径 + String filePath = FileUploadUtils.getLocalBasePath() + floderName + "/"; + //文件名 + String objectName = eachFileName.substring(index + 1); + FileUploadUtils.downLocal(floderName, filePath, objectName); + } + } + if(entity.getType() == 3){ + templatesPath = "TemplateCode1"; + } + + if (entity.getType() == 4) { + switch (entity.getWebType()) { + case 1: + templatesPath = entity.getEnableFlow() == 1 ? "TemplateCode5" : "TemplateCode4"; + break; + case 2: + templatesPath = entity.getEnableFlow() == 1 ? "TemplateCode3" : "TemplateCode2"; + break; + case 3: + templatesPath = "TemplateCode3"; + default: + break; + } + } + + String column = StringUtil.isNotEmpty(entity.getColumnData()) ? entity.getColumnData() : "{}"; + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(column, ColumnDataModel.class); + boolean groupTable = "3".equals(String.valueOf(columnDataModel.getType())); + FormGenUtil genUtil = new FormGenUtil(); + FormGenModel formGenModel = new FormGenModel(); + formGenModel.setEntity(entity); + String keyName = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, pKeyName); + formGenModel.setPKeyName(keyName); + formGenModel.setServiceDirectory(FileUploadUtils.getLocalBasePath() + configValueUtil.getServiceDirectoryPath()); + formGenModel.setTemplateCodePath(FileUploadUtils.getLocalBasePath() + configValueUtil.getTemplateCodePath()); + formGenModel.setDownloadCodeForm(downloadCodeForm); + formGenModel.setUserInfo(userInfo); + formGenModel.setTemplatePath(templatesPath); + formGenModel.setFileName(fileName); + formGenModel.setLinkEntity(linkEntity); + formGenModel.setDataSourceUtil(dataSourceUtil); + formGenModel.setGroupTable(groupTable); + formGenModel.setType(String.valueOf(columnDataModel.getType())); + formGenModel.setModel(model); + formGenModel.setConfigValueUtil(configValueUtil); + formGenModel.setTable(mainTable); + genUtil.generate(formGenModel); + genUtil.htmlTemplates(formGenModel); + + entity.setColumnData(entity.getAppColumnData()); + AppGenModel appGenModel = new AppGenModel(); + appGenModel.setEntity(entity); + appGenModel.setPKeyName(keyName); + appGenModel.setServiceDirectory(FileUploadUtils.getLocalBasePath() + configValueUtil.getServiceDirectoryPath()); + appGenModel.setTemplateCodePath(FileUploadUtils.getLocalBasePath() + configValueUtil.getTemplateCodePath()); + appGenModel.setDownloadCodeForm(downloadCodeForm); + appGenModel.setUserInfo(userInfo); + appGenModel.setTemplatePath(templatesPath); + appGenModel.setFileName(fileName); + appGenModel.setLinkEntity(linkEntity); + appGenModel.setDataSourceUtil(dataSourceUtil); + appGenModel.setGroupTable(groupTable); + appGenModel.setType(String.valueOf(columnDataModel.getType())); + appGenModel.setModel(model); + AppGenUtil appGenUtil = new AppGenUtil(); + appGenUtil.htmlTemplates(appGenModel); + + return fileName; + } + } + return null; + } + + /** + * vue3代码生成 + * + * @param entity 可视化开发功能 + * @param downloadCodeForm 下载相关信息 + * @return + * @throws Exception + */ + @Override + public String codeGengerateV3(VisualdevEntity entity, DownloadCodeForm downloadCodeForm) throws Exception { + UserInfo userInfo = userProvider.get(); + DbLinkEntity linkEntity = null; + if (entity != null) { + // 是否存在关联数据库 + if (StringUtil.isNotEmpty(entity.getDbLinkId())) { + linkEntity = dataSourceApi.getInfo(entity.getDbLinkId()); + } + // 是否存在关联表 + if (StringUtil.isNotEmpty(entity.getVisualTables())) { + FormDataModel model = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + model.setModule(downloadCodeForm.getModule()); + model.setClassName(downloadCodeForm.getClassName()); + model.setAreasName(downloadCodeForm.getModule()); + model.setServiceDirectory(configValueUtil.getServiceDirectoryPath()); + List filterFeildList = JsonUtil.getJsonToList(model.getFields(), FieLdsModel.class); + model.setFields(JSON.toJSONString(filterFeildList)); + String fileName = entity.getFullName() + System.currentTimeMillis(); + //初始化模板 + Velocity.reset(); + VelocityEnum.init.initVelocity(FormCommonUtil.getLocalBasePath() + configValueUtil.getTemplateCodePathVue3()); + + List list = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + //获取主表 + String mainTable = list.stream().filter(t -> "1".equals(t.getTypeId())).findFirst().orElse(null).getTable(); + //获取主键 + String pKeyName = VisualUtils.getpKey(linkEntity, mainTable).toLowerCase().trim().replaceAll("f_", ""); + //自定义包名 + String modulePackageName = StringUtil.isNotEmpty(downloadCodeForm.getModulePackageName()) ? downloadCodeForm.getModulePackageName() : + GenBaseInfo.PACKAGE_NAME; + downloadCodeForm.setModulePackageName(modulePackageName); + //获取其他子表的主键 + Map childpKeyMap = new HashMap<>(16); + for (TableModel tableModel : list) { + String childKey = VisualUtils.getpKey(linkEntity, tableModel.getTable()); + if (childKey.length() > 2) { + if ("f_".equals(childKey.substring(0, 2).toLowerCase())) { + childKey = childKey.substring(2); + } + } + childpKeyMap.put(tableModel.getTable(), childKey); + } + //判断子表名称 + List childTb = new ArrayList(); + if (!StringUtil.isEmpty(downloadCodeForm.getSubClassName())) { + childTb = Arrays.asList(downloadCodeForm.getSubClassName().split(",")); + } + + Set set = new HashSet<>(childTb); + boolean result = childTb.size() == set.size() ? true : false; + if (!result) { + return MsgCode.EXIST001.get(); + } + String templatesPath = null; + //发起表单 + if (entity.getType() == 3) { + //工作流生成器 + downloadCodeForm.setModule("form"); + downloadCodeForm.setModulePackageName("jnpf.form"); + templatesPath = "TemplateCode1"; + } + //功能表单 + if (entity.getType() == 4) { + switch (entity.getWebType()) { + case 1: + templatesPath = entity.getEnableFlow() == 1 ? "TemplateCode5" : "TemplateCode4"; + break; + case 2: + templatesPath = entity.getEnableFlow() == 1 ? "TemplateCode3" : "TemplateCode2"; + break; + default: + break; + } + } + //非本地模板需要下载-获取模板如下 + if (!FileUploadUtils.getDefaultPlatform().startsWith("local")) { + List fileList = new ArrayList<>(); + fileList.addAll(FileUploadUtils.getDefaultFileList(configValueUtil.getTemplateCodePathVue3())); + for (FileListVO fileListVO : fileList) { + String eachFileName = fileListVO.getFileName(); + int index = eachFileName.lastIndexOf("/"); + //服务器路径 + String floderName = eachFileName.substring(0, index); + //本地路径 + String filePath = FileUploadUtils.getLocalBasePath() + floderName + "/"; + //文件名 + String objectName = eachFileName.substring(index + 1); + FileUploadUtils.downLocal(floderName, filePath, objectName); + } + } + + //执行代码生成器 + GenerateParamModel generateParamModel = new GenerateParamModel().builder() + .dataSourceUtil(dataSourceUtil) + .path(FormCommonUtil.getLocalBasePath() + configValueUtil.getTemplateCodePathVue3()) + .fileName(fileName) + .templatesPath(templatesPath) + .downloadCodeForm(downloadCodeForm) + .entity(entity) + .userInfo(userInfo) + .configValueUtil(configValueUtil) + .linkEntity(linkEntity) + .pKeyName(pKeyName) + .build(); + GenerateFactoryV3.runGenerator(templatesPath, generateParamModel); + return fileName; + } + } + return null; + } +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-controller/pom.xml b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-controller/pom.xml new file mode 100644 index 0000000..42d78ca --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-controller/pom.xml @@ -0,0 +1,22 @@ + + + + jnpf-visualdev-generater + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-visualdev-generater-controller + + + + com.jnpf + jnpf-visualdev-generater-biz + ${project.version} + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-controller/src/main/java/jnpf/generater/controller/VisualdevGenController.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-controller/src/main/java/jnpf/generater/controller/VisualdevGenController.java new file mode 100644 index 0000000..0ee7a19 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-controller/src/main/java/jnpf/generater/controller/VisualdevGenController.java @@ -0,0 +1,212 @@ +package jnpf.generater.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.xuyanwu.spring.file.storage.FileInfo; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.entity.DictionaryDataEntity; +import jnpf.base.service.DictionaryDataService; +import jnpf.constant.FileTypeConstant; +import jnpf.util.NoDataSourceBind; +import jnpf.base.UserInfo; +import jnpf.base.entity.VisualdevEntity; +import jnpf.base.model.read.ReadListVO; +import jnpf.base.service.VisualdevService; +import jnpf.base.util.ReadFile; +import jnpf.base.util.VisualUtil; +import jnpf.base.vo.DownloadVO; +import jnpf.base.vo.ListVO; +import jnpf.config.ConfigValueUtil; +import jnpf.constant.MsgCode; +import jnpf.exception.DataException; +import jnpf.generater.service.VisualdevGenService; +import jnpf.base.model.DownloadCodeForm; +import jnpf.util.*; +import jnpf.util.context.RequestContext; +import org.springframework.beans.factory.annotation.Autowired; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletRequest; +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * 可视化开发功能表 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @author JNPF开发平台组 + * @date 2021/3/16 + */ +@Tag(name = "代码生成器", description = "Generater") +@RestController +@RequestMapping("/api/visualdev/Generater") +public class VisualdevGenController { + + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private RedisUtil redisUtil; + @Autowired + private VisualdevService visualdevService; + @Autowired + private VisualdevGenService visualdevGenService; + @Autowired + private DictionaryDataService dictionaryDataApi; + + + /** + * 下载文件 + * + * @return + */ + @NoDataSourceBind() + @Operation(summary = "下载文件") + @GetMapping("/DownloadVisCode") + public void downloadCode() throws DataException { + HttpServletRequest request = ServletUtil.getRequest(); + String reqJson = request.getParameter("encryption"); + String name = request.getParameter("name"); + String fileNameAll = DesUtil.aesDecode(reqJson); + if (!StringUtil.isEmpty(fileNameAll)) { + String token = fileNameAll.split("#")[0]; + if (TicketUtil.parseTicket(token) != null) { + TicketUtil.deleteTicket(token); + String fileName = fileNameAll.split("#")[1]; + String path = FilePathUtil.getFilePath(FileTypeConstant.CODETEMP); + //下载到本地 + byte[] bytes = FileUploadUtils.downloadFileByte(path, fileName, false); + FileDownloadUtil.downloadFile(bytes, fileName, name); + }else { + throw new DataException("下载链接已失效"); + } + }else { + throw new DataException("下载链接已失效"); + } + } + + @Operation(summary = "获取命名空间") + @GetMapping("/AreasName") + @SaCheckPermission("generator.webForm") + public ActionResult getAreasName() { + String areasName = configValueUtil.getCodeAreasName(); + List areasNameList = new ArrayList(Arrays.asList(areasName.split(","))); + return ActionResult.success(areasNameList); + } + + @Operation(summary = "下载代码") + @Parameters({ + @Parameter(name = "id", description = "主键"), + }) + @PostMapping("/{id}/Actions/DownloadCode") + @SaCheckPermission("generator.webForm") + @Transactional + public ActionResult downloadCode(@PathVariable("id") String id, @RequestBody DownloadCodeForm downloadCodeForm) throws Exception { + if(downloadCodeForm.getModule()!=null){ + DictionaryDataEntity info = dictionaryDataApi.getInfo(downloadCodeForm.getModule()); + if(info!=null){ + downloadCodeForm.setModule(info.getEnCode()); + } + } + DownloadVO vo; + String fileName; + if(RequestContext.isVue3()){ + downloadCodeForm.setVue3(true); + VisualdevEntity visualdevEntity = visualdevService.getInfo(id); + String s = VisualUtil.checkPublishVisualModel(visualdevEntity,"下载"); + if (s!=null) { + return ActionResult.fail(s); + } + fileName = visualdevGenService.codeGengerateV3(visualdevEntity, downloadCodeForm); + }else{ + fileName = visualdevGenService.codeGengerate(id, downloadCodeForm); + } + //上传到minio + String filePath = FileUploadUtils.getLocalBasePath() + configValueUtil.getServiceDirectoryPath() + fileName + ".zip"; + FileUtil.toZip(filePath, true, FileUploadUtils.getLocalBasePath() + configValueUtil.getServiceDirectoryPath() + fileName); + // 删除源文件 + FileUtil.deleteFileAll(new File(FileUploadUtils.getLocalBasePath() + configValueUtil.getServiceDirectoryPath() + fileName)); + MultipartFile multipartFile = FileUtil.createFileItem(new File(XSSEscape.escapePath(filePath))); + FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, configValueUtil.getServiceDirectoryPath(), fileName + ".zip"); + vo = DownloadVO.builder().name(fileInfo.getFilename()).url(UploaderUtil.uploaderVisualFile(fileInfo.getFilename()) + "&name=" + fileName + ".zip").build(); + if (vo == null) { + return ActionResult.fail(MsgCode.FA006.get()); + } + return ActionResult.success(vo); + } + + + /** + * 输出移动开发模板 + * + * @return + */ + @Operation(summary = "预览代码") + @Parameters({ + @Parameter(name = "id", description = "主键"), + }) + @PostMapping("/{id}/Actions/CodePreview") + @SaCheckPermission("generator.webForm") + public ActionResult codePreview(@PathVariable("id") String id, @RequestBody DownloadCodeForm downloadCodeForm) throws Exception { + String fileName; + if(RequestContext.isVue3()){ + downloadCodeForm.setVue3(true); + VisualdevEntity visualdevEntity = visualdevService.getInfo(id); + fileName = visualdevGenService.codeGengerateV3(visualdevEntity, downloadCodeForm); + }else{ + fileName = visualdevGenService.codeGengerate(id, downloadCodeForm); + } + List dataList = ReadFile.priviewCode(FileUploadUtils.getLocalBasePath() + configValueUtil.getServiceDirectoryPath() + fileName); + if (dataList.size() == 0) { + return ActionResult.fail(MsgCode.FA015.get()); + } + ListVO datas = new ListVO<>(); + datas.setList(dataList); + return ActionResult.success(datas); + } + + /** + * App预览(后台APP表单设计) + * + * @return + */ + @Operation(summary = "App预览(后台APP表单设计)") + @Parameters({ + @Parameter(name = "data", description = "数据"), + }) + @PostMapping("/App/Preview") + @SaCheckPermission("generator.webForm") + public ActionResult appPreview(String data) { + String id = RandomUtil.uuId(); + redisUtil.insert(id, data, 300); + return ActionResult.success((Object) id); + } + + /** + * App预览(后台APP表单设计) + * + * @return + */ + @Operation(summary = "App预览查看") + @Parameters({ + @Parameter(name = "id", description = "主键"), + }) + @GetMapping("/App/{id}/Preview") + @SaCheckPermission("generator.webForm") + public ActionResult preview(@PathVariable("id") String id) { + if (redisUtil.exists(id)) { + Object object = redisUtil.getString(id); + return ActionResult.success(object); + } else { + return ActionResult.fail(MsgCode.FA019.get()); + } + } + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-entity/pom.xml b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-entity/pom.xml new file mode 100644 index 0000000..c206ffc --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-entity/pom.xml @@ -0,0 +1,22 @@ + + + + jnpf-visualdev-generater + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-visualdev-generater-entity + + + + com.jnpf + jnpf-common-all + ${project.version} + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-entity/src/main/java/jnpf/generater/model/FormDesign/ColumnChildListModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-entity/src/main/java/jnpf/generater/model/FormDesign/ColumnChildListModel.java new file mode 100644 index 0000000..770250a --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-entity/src/main/java/jnpf/generater/model/FormDesign/ColumnChildListModel.java @@ -0,0 +1,21 @@ +package jnpf.generater.model.FormDesign; + +import lombok.Data; + +import java.util.List; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2022/7/5 + */ +@Data +public class ColumnChildListModel { + private String label; + private String tableField; + private String vModel; + private List fields; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-entity/src/main/java/jnpf/generater/model/FormDesign/ColumnListDataModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-entity/src/main/java/jnpf/generater/model/FormDesign/ColumnListDataModel.java new file mode 100644 index 0000000..661ff23 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-entity/src/main/java/jnpf/generater/model/FormDesign/ColumnListDataModel.java @@ -0,0 +1,78 @@ +package jnpf.generater.model.FormDesign; + +import jnpf.model.visualJson.FieLdsModel; +import jnpf.model.visualJson.analysis.FormMastTableModel; +import lombok.Data; + +import java.util.List; + +/** + * 列表字段 + * + * @author JNPF开发平台组 + * @version V3.2 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/10/20 + */ +@Data +public class ColumnListDataModel { + /** + * model别名 + */ + private String modelName; + + /** + * 外键 + */ + private String relationField; + + /** + * 外键首字母大写 + */ + private String relationUpField; + + /** + * 关联主键 + */ + private String mainKey; + + /** + * 关联主键首字母大写 + */ + private String mainUpKey; + + /** + * 所拥有字段 + */ + private List fieldList; + + /** + * 控件属性 + */ + private List fieLdsModelList; + + /** + * 表名 + */ + private String tableName; + + /** + * 首字母小写 + */ + private String modelLowName; + + /** + * 首字母大写 + */ + private String modelUpName; + + /** + * 当前表主键 + */ + private String mainField; + + /** + * 对应控件(去除jnpf) + */ + private List fieLdsModels; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-entity/src/main/java/jnpf/generater/model/FormDesign/ColumnListModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-entity/src/main/java/jnpf/generater/model/FormDesign/ColumnListModel.java new file mode 100644 index 0000000..991c08e --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-entity/src/main/java/jnpf/generater/model/FormDesign/ColumnListModel.java @@ -0,0 +1,247 @@ +package jnpf.generater.model.FormDesign; + +import jnpf.model.visualJson.config.ConfigModel; +import jnpf.model.visualJson.options.ColumnOptionModel; +import jnpf.model.visualJson.props.PropsModel; +import lombok.Data; + +import java.util.List; + +/** + * 列表 + * + * @author JNPF开发平台组 + * @version V3.2.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/8/17 + */ +@Data +public class ColumnListModel { + + private boolean first = false; + + /** + * 字段 + */ + private String prop; + /** + * 列名 + */ + private String label; + /** + * 对齐 + */ + private String align; + + private String jnpfKey; + + private String dataType; + + private String vModel; + + private Boolean sortable; + + /** + * 列表子表表名 + */ + private String columnTableName; + + /** + * 处理后的prop + */ + private String newProp; + + private Boolean multiple; + + private ConfigModel config; + private String placeholder; + private Object style; + private Boolean clearable; + private String prefixIcon; + private Integer precision; + private String suffixIcon; + private String maxlength; + private Boolean showWordLimit; + private Boolean readonly; + private Boolean disabled; + /** + * 关联表单id + */ + private String modelId=""; + /** + * 关联表单 二维码 条形码 字段 + */ + private String relationField; + private Boolean hasPage; + private String pageSize; + private String type; + private Object autosize; + private Integer step; + private Boolean stepstrictly; + private String controls; + private Object textStyle; + private Integer lineHeight; + private Integer fontSize; + private Boolean showChinese; + private Boolean showPassword; + + /** + * 大小 + */ + private String size; + private Boolean filterable; + /** + * 冻结 + */ + private String fixed = "none"; + /** + * 关联表单属性 + */ + private String showField; + /** + * 待定 + */ + private PropsModel props; + /** + * 待定 + */ + private Boolean showAllLevels; + private String separator; + private Boolean isrange; + private String rangeseparator; + private String startplaceholder; + private String endplaceholder; + private String format; + private String valueformat; + private Object pickeroptions; + private Integer max; + private Boolean allowhalf; + private Boolean showText; + private Boolean showScore; + private Boolean showAlpha; + private String colorformat; + private String activetext; + private String inactivetext; + private String activecolor; + private String inactivecolor; + private String activeValue; + private String inactiveValue; + private Integer min; + private Boolean showStops; + private Boolean range; + private String content; + private String header; + private Boolean accordion; + private String tabPosition; + /** + * 未找到 + */ + private String accept; + private Boolean showTip; + private Integer fileSize; + private String sizeUnit; + private Integer limit; + private String contentposition; + private String buttonText; + private Integer level; + private String options; + private String actionText; + private String shadow; + private String name; + private String title; + + /** + * 查询方式 1.eq 2.like 3.between + */ + private Integer searchType; + private String interfaceId; + private List columnOptions; + private String propsValue; + + /** + * 开关 值 + */ + private String activeTxt = "开"; + private String inactiveTxt = "关"; + + /** + * 条形码 条码颜色 + */ + private String lineColor; + /** + * 条形码 背景色 + */ + private String background; + /** + * 条形码 宽高 + */ + private Integer width; + private Integer height; + /** + * 条形码 二维码 固定值 + */ + private String staticText; + + + /** + * 二维码 条码颜色 + */ + private String colorDark; + + /** + * 二维码 背景色 + */ + private String colorLight; + + /** + * 子表是否合计 + */ + private Boolean showSummary; + + /** + * 子表合计字段 + */ + private String summaryField; + + /** + * 所属部门展示内容 + */ + private String showLevel; + + /** + * 弹窗 样式属性 + */ + private String popupType; + private String popupTitle; + private String popupWidth; + + private String selectType; + + //自定义 + private String ableIds; + private String ableDepIds; + private String ablePosIds; + private String ableUserIds; + private String ableRoleIds; + private String ableGroupIds; + + private ColumnChildListModel columnChildListModel; + + //数字输入-金额大小写等属性 + private String addonAfter; + private String addonBefore; + private Boolean isAmountChinese; + private Boolean thousands; + + //时间控件新增字段 + private String startTime; + private String endTime; + private String startRelationField; + private String endRelationField; + /** + * 下拉补全展示条数 + */ + private Integer total; + private String id; + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-entity/src/main/java/jnpf/generater/model/FormDesign/ListSearchGroupModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-entity/src/main/java/jnpf/generater/model/FormDesign/ListSearchGroupModel.java new file mode 100644 index 0000000..0ac6240 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-entity/src/main/java/jnpf/generater/model/FormDesign/ListSearchGroupModel.java @@ -0,0 +1,37 @@ +package jnpf.generater.model.FormDesign; +import lombok.Data; + +import java.util.List; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.2 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/10/22 + */ +@Data +public class ListSearchGroupModel { + /** + * 模型名 + */ + private String modelName; + /** + * 表名 + */ + private String tableName; + /** + * 外键 + */ + private String ForeignKey; + /** + * 关联主键 + */ + private String mainKey; + + /** + * 该表下的查询字段 + */ + private List searchTypeModelList; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-entity/src/main/java/jnpf/generater/model/FormDesign/SearchTypeModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-entity/src/main/java/jnpf/generater/model/FormDesign/SearchTypeModel.java new file mode 100644 index 0000000..cf442f3 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-entity/src/main/java/jnpf/generater/model/FormDesign/SearchTypeModel.java @@ -0,0 +1,47 @@ +package jnpf.generater.model.FormDesign; + +import jnpf.model.visualJson.config.ConfigModel; +import lombok.Data; + +/** + * 代码生成器查询条件 + * + * @author JNPF开发平台组 + * @version V3.2.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/8/9 + */ +@Data +public class SearchTypeModel { + private String vModel; + private String dataType; + private Integer searchType; + private String label; + private String jnpfKey; + private String format; + private String multiple; + /** + * 搜索框显示 + */ + private String placeholder; + private ConfigModel config; + + private String TableName; + private String afterVModel; + + private String showLevel; + + //新增 拼接之后的vmodel和label + /** + * vmodel 子表副表拼接后得名称 + */ + private String id; + /** + * label 子表副表拼接后得名称 + */ + private String fullName; + /** + * 查询是否多选 + */ + private String searchMultiple; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-entity/src/main/java/jnpf/generater/model/FormDesign/TemplateMethodEnum.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-entity/src/main/java/jnpf/generater/model/FormDesign/TemplateMethodEnum.java new file mode 100644 index 0000000..eea1e6a --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-entity/src/main/java/jnpf/generater/model/FormDesign/TemplateMethodEnum.java @@ -0,0 +1,30 @@ +package jnpf.generater.model.FormDesign; +/** + * + * 模板路径 + * @author JNPF开发平台组 + * @version V3.2 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/10/8 + */ +public enum TemplateMethodEnum { + T1("TemplateCode1"), + T2("TemplateCode2"), + T3("TemplateCode3"), + T4("TemplateCode4"), + T5("TemplateCode5"); + + TemplateMethodEnum(String method) { + this.method = method; + } + + public String getMethod() { + return method; + } + + public void setMethod(String method) { + this.method = method; + } + + private String method; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-entity/src/main/java/jnpf/generater/model/GenBaseInfo.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-entity/src/main/java/jnpf/generater/model/GenBaseInfo.java new file mode 100644 index 0000000..ede6ff4 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-entity/src/main/java/jnpf/generater/model/GenBaseInfo.java @@ -0,0 +1,35 @@ +package jnpf.generater.model; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-03-17 + */ +public class GenBaseInfo { + + /** + * 作者 + */ + public static final String AUTHOR="JNPF开发平台组"; + + /** + * 版本 + */ + public static final String VERSION="V3.2.6"; + + /** + * 版权 + */ + public static final String COPYRIGHT="引迈信息技术有限公司(https://www.jnpfsoft.com)"; + + /** + * 包名 + */ + public static final String PACKAGE_NAME="jnpf"; + + /** + * 描述 + */ + public static final String DESCRIPTION =""; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-entity/src/main/java/jnpf/generater/model/GenFileNameSuffix.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-entity/src/main/java/jnpf/generater/model/GenFileNameSuffix.java new file mode 100644 index 0000000..32e3a8a --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/jnpf-visualdev-generater-entity/src/main/java/jnpf/generater/model/GenFileNameSuffix.java @@ -0,0 +1,50 @@ +package jnpf.generater.model; + +/** + * + * 代码生成文件后缀配置文件 + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021-03-17 + */ +public class GenFileNameSuffix { + + /** + * 实体后缀 + */ + public static final String ENTITY="Entity"; + + /** + * Mapper XML后缀 + */ + public static final String MAPPER_XML="Mapper"; + + /** + * Mapper后缀 + */ + public static final String MAPPER="Mapper"; + + /** + * Service后缀 + */ + public static final String SERVICE="Service"; + + /** + * SERVICEIMPL后缀 + */ + public static final String SERVICEIMPL="ServiceImpl"; + + /** + * controller后缀 + */ + public static final String CONTROLLER="Controller"; + + //============================================================= + //model文件后缀 + + + //============================================================= + //前端文件后缀 + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/pom.xml b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/pom.xml new file mode 100644 index 0000000..602493a --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-generater/pom.xml @@ -0,0 +1,21 @@ + + + + jnpf-visualdev + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-visualdev-generater + pom + + jnpf-visualdev-generater-entity + jnpf-visualdev-generater-biz + jnpf-visualdev-generater-controller + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/pom.xml b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/pom.xml new file mode 100644 index 0000000..465eae2 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/pom.xml @@ -0,0 +1,38 @@ + + + + jnpf-visualdev-integrate + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-visualdev-integrate-biz + + + + com.jnpf + jnpf-visualdev-integrate-entity + ${project.version} + + + com.jnpf + jnpf-visualdev-base-biz + ${project.version} + compile + + + com.jnpf + jnpf-visualdev-onlinedev-biz + ${project.version} + compile + + + com.jnpf + jnpf-provider + ${project.version} + + + diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/config/IntegrateConfig.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/config/IntegrateConfig.java new file mode 100644 index 0000000..7845bb5 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/config/IntegrateConfig.java @@ -0,0 +1,29 @@ +package jnpf.integrate.config; + +import jnpf.integrate.job.IntegrateQueryJobUtil; +import org.quartz.*; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class IntegrateConfig { + + @Bean + public JobDetail testJobDetail() { + JobDetail JobDetail = JobBuilder.newJob(IntegrateQueryJobUtil.class) + .storeDurably() //必须调用该方法,添加任务 + .build(); + return JobDetail; + } + + @Bean + public Trigger testTrigger() { + CronScheduleBuilder cronScheduleBuilder = CronScheduleBuilder.cronSchedule("* * * * * ?"); + Trigger trigger = TriggerBuilder.newTrigger() + .forJob(testJobDetail()) + .withSchedule(cronScheduleBuilder) //对触发器配置任务 + .build(); + return trigger; + } + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/config/IntegrateListener.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/config/IntegrateListener.java new file mode 100644 index 0000000..4162df6 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/config/IntegrateListener.java @@ -0,0 +1,51 @@ +package jnpf.integrate.config; + +import cn.hutool.core.util.ObjectUtil; +import jnpf.base.UserInfo; +import jnpf.integrate.job.Integrate; +import jnpf.integrate.job.IntegrateJobUtil; +import jnpf.integrate.job.QuartzUtil; +import jnpf.integrate.model.nodeJson.IntegrateModel; +import jnpf.util.JsonUtil; +import jnpf.util.RedisUtil; +import jnpf.util.StringUtil; +import org.quartz.JobDataMap; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.ApplicationArguments; +import org.springframework.boot.ApplicationRunner; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.stereotype.Component; + +import java.util.Date; +import java.util.List; +import java.util.Set; + +@Component +public class IntegrateListener implements ApplicationRunner { + + @Autowired + private RedisUtil redisUtil; + @Autowired + private RedisTemplate redisTemplate; + + @Override + public void run(ApplicationArguments args) throws Exception { + Set keysList = redisTemplate.keys(IntegrateJobUtil.WORKTIMEOUT_REDIS_KEY + "_key*"); + for (String id : keysList) { + redisTemplate.delete(id); + } + List hashValues = redisUtil.getHashValues(IntegrateJobUtil.IDGENERATOR_REDIS_KEY); + for (String value : hashValues) { + IntegrateModel integrateModel = JsonUtil.getJsonToBean(value, IntegrateModel.class); + JobDataMap jobDataMap = new JobDataMap(); + jobDataMap.putAll(JsonUtil.entityToMap(integrateModel)); + Date startTime = new Date(integrateModel.getStartTime()); + Date endTime = ObjectUtil.isNotEmpty(integrateModel.getEndTime()) ? new Date(integrateModel.getEndTime()) : null; + boolean isAdd = ObjectUtil.isNotEmpty(endTime) ? endTime.getTime() > System.currentTimeMillis() : true; + if (isAdd) { + QuartzUtil.addJob(integrateModel.getId(), integrateModel.getCron(), Integrate.class, jobDataMap, startTime, endTime); + } + } + } + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/job/Integrate.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/job/Integrate.java new file mode 100644 index 0000000..0988fa4 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/job/Integrate.java @@ -0,0 +1,87 @@ +package jnpf.integrate.job; + +import jnpf.base.UserInfo; +import jnpf.config.ConfigValueUtil; +import jnpf.integrate.entity.IntegrateEntity; +import jnpf.integrate.entity.IntegrateQueueEntity; +import jnpf.integrate.model.nodeJson.IntegrateModel; +import jnpf.integrate.service.IntegrateQueueService; +import jnpf.integrate.service.IntegrateService; +import jnpf.util.JsonUtil; +import jnpf.util.RandomUtil; +import jnpf.util.RedisUtil; +import jnpf.util.StringUtil; +import jnpf.util.context.SpringContext; +import jnpf.util.data.DataSourceContextHolder; +import org.quartz.*; +import org.springframework.scheduling.quartz.QuartzJobBean; + +import java.util.Date; +import java.util.Objects; + + +@DisallowConcurrentExecution +public class Integrate extends QuartzJobBean { + + + private static RedisUtil redisUtil; + private static ConfigValueUtil configValueUtil; + private static IntegrateService integrateService; + private static IntegrateQueueService integrateQueueService; + + static { + redisUtil = SpringContext.getBean(RedisUtil.class); + configValueUtil = SpringContext.getBean(ConfigValueUtil.class); + integrateService = SpringContext.getBean(IntegrateService.class); + integrateQueueService = SpringContext.getBean(IntegrateQueueService.class); + } + + @Override + protected void executeInternal(JobExecutionContext context) throws JobExecutionException { + JobDetail jobDetail = context.getJobDetail(); + String jobName = jobDetail.getKey().getName(); + JobDataMap jobDataMap = jobDetail.getJobDataMap(); + IntegrateModel model = IntegrateJobUtil.getModel(JsonUtil.getJsonToBean(jobDataMap, IntegrateModel.class), redisUtil); + boolean isModel = model == null; + IntegrateModel integrateModel = isModel ? JsonUtil.getJsonToBean(jobDataMap, IntegrateModel.class) : model; + if (integrateModel != null) { + UserInfo userInfo = integrateModel.getUserInfo(); + if (configValueUtil.isMultiTenancy()) { + if (StringUtil.isNotEmpty(userInfo.getTenantDbConnectionString())) { + DataSourceContextHolder.setDatasource(userInfo.getTenantId(), userInfo.getTenantDbConnectionString(), userInfo.isAssignDataSource()); + } + } + IntegrateEntity info = integrateService.getInfo(integrateModel.getId()); + if (info != null) { + integrateModel.setTime(System.currentTimeMillis()); + Integer num = integrateModel.getNum(); + Integer endTimeType = integrateModel.getEndTimeType(); + Integer endLimit = integrateModel.getEndLimit(); + boolean isNext = Objects.equals(endTimeType, 1) ? num + 1 <= endLimit : Objects.equals(endTimeType, 2) ? integrateModel.getTime() <= integrateModel.getEndTime() : true; + integrateModel.setNum(++num); + if (isNext) { + IntegrateJobUtil.insertModel(integrateModel, redisUtil); + IntegrateQueueEntity entity = new IntegrateQueueEntity(); + entity.setState(0); + entity.setId(RandomUtil.uuId()); + entity.setIntegrateId(integrateModel.getId()); + entity.setExecutionTime(new Date()); + entity.setFullName(info.getFullName()); + IntegrateModel integrate = new IntegrateModel(); + integrate.setId(entity.getId()); + integrate.setUserInfo(userInfo); + IntegrateJobUtil.insertIntegrate(integrate,redisUtil); + integrateQueueService.create(entity); + } else { + IntegrateJobUtil.removeModel(integrateModel, redisUtil); + QuartzUtil.deleteJob(jobName); + } + } else { + IntegrateJobUtil.removeModel(integrateModel, redisUtil); + QuartzUtil.deleteJob(jobName); + } + } + } + + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/job/IntegrateJobUtil.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/job/IntegrateJobUtil.java new file mode 100644 index 0000000..4d2f23a --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/job/IntegrateJobUtil.java @@ -0,0 +1,71 @@ +package jnpf.integrate.job; + +import cn.hutool.core.util.ObjectUtil; +import jnpf.base.UserInfo; +import jnpf.integrate.model.nodeJson.IntegrateModel; +import jnpf.util.JsonUtil; +import jnpf.util.RedisUtil; +import jnpf.util.StringUtil; +import lombok.extern.slf4j.Slf4j; + + +/** + * @author JNPF开发平台组 + * @version V3.3.0 flowable + * @copyright 引迈信息技术有限公司 + * @date 2022/6/15 17:37 + */ +@Slf4j +public class IntegrateJobUtil { + /** + * 缓存key + */ + public static final String WORKTIMEOUT_REDIS_KEY = "idgenerator_IntegrateList"; + + /** + * 缓存key + */ + public static final String IDGENERATOR_REDIS_KEY = "idgenerator_IntegrateModel"; + + /** + * 缓存key + */ + public static final String IDGENERATORID_REDIS_KEY = "idgenerator_id"; + + public static IntegrateModel getModel(IntegrateModel model, RedisUtil redisUtil) { + String id = model.getId(); + String hashValues = redisUtil.getHashValues(IDGENERATOR_REDIS_KEY, id); + IntegrateModel integrateModel = StringUtil.isNotEmpty(hashValues) ? JsonUtil.getJsonToBean(hashValues, IntegrateModel.class) : null; + return integrateModel; + } + + public static void insertModel(IntegrateModel model, RedisUtil redisUtil) { + String integrateId = model.getId(); + redisUtil.insertHash(IDGENERATOR_REDIS_KEY, integrateId, JsonUtil.getObjectToString(model)); + insertTenant(model, redisUtil); + } + + public static void removeModel(IntegrateModel model, RedisUtil redisUtil) { + redisUtil.removeHash(IDGENERATOR_REDIS_KEY, model.getId()); + } + + public static void insertTenant(IntegrateModel model, RedisUtil redisUtil) { + String tenantId = StringUtil.isNotEmpty(model.getUserInfo().getTenantId()) ? model.getUserInfo().getTenantId() : "jnpf"; + UserInfo userInfo = model.getUserInfo(); + redisUtil.insertHash(WORKTIMEOUT_REDIS_KEY, tenantId, JsonUtil.getObjectToString(userInfo)); + } + + public static boolean getIntegrate(IntegrateModel model, RedisUtil redisUtil){ + String value = redisUtil.getHashValues(IDGENERATORID_REDIS_KEY, model.getId()); + return ObjectUtil.isNotEmpty(value); + } + + public static void insertIntegrate(IntegrateModel model, RedisUtil redisUtil){ + redisUtil.insertHash(IDGENERATORID_REDIS_KEY, model.getId(), model.getId()); + } + + public static void removeIntegrate(IntegrateModel model, RedisUtil redisUtil){ + redisUtil.removeHash(IDGENERATORID_REDIS_KEY, model.getId()); + } + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/job/IntegrateQueryJobUtil.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/job/IntegrateQueryJobUtil.java new file mode 100644 index 0000000..37712c8 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/job/IntegrateQueryJobUtil.java @@ -0,0 +1,104 @@ +package jnpf.integrate.job; + +import jnpf.base.UserInfo; +import jnpf.config.ConfigValueUtil; +import jnpf.integrate.entity.IntegrateQueueEntity; +import jnpf.integrate.model.nodeJson.IntegrateModel; +import jnpf.integrate.service.IntegrateQueueService; +import jnpf.integrate.util.IntegrateUtil; +import jnpf.util.JsonUtil; +import jnpf.util.RedisUtil; +import jnpf.util.StringUtil; +import jnpf.util.data.DataSourceContextHolder; +import lombok.extern.slf4j.Slf4j; +import org.quartz.DisallowConcurrentExecution; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; +import org.springframework.scheduling.quartz.QuartzJobBean; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.ScheduledThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + +@Slf4j +@DisallowConcurrentExecution +public class IntegrateQueryJobUtil extends QuartzJobBean { + + @Autowired + private RedisUtil redisUtil; + @Autowired + private RedisTemplate redisTemplate; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private IntegrateUtil integrateUtil; + @Autowired + private IntegrateQueueService integrateQueueService; + + public static Map futureList = new HashMap<>(); + + private ScheduledThreadPoolExecutor scheduledThreadPoolExecutor; + + IntegrateQueryJobUtil(ThreadPoolTaskExecutor threadPoolTaskExecutor) { + scheduledThreadPoolExecutor = new ScheduledThreadPoolExecutor(20, threadPoolTaskExecutor.getThreadPoolExecutor().getThreadFactory()); + } + + @Override + protected void executeInternal(JobExecutionContext context) throws JobExecutionException { + List hashValues = redisUtil.getHashValues(IntegrateJobUtil.WORKTIMEOUT_REDIS_KEY); + for (String id : hashValues) { + UserInfo userInfo = JsonUtil.getJsonToBean(id, UserInfo.class); + String tenantId = StringUtil.isNotEmpty(userInfo.getTenantId()) ? userInfo.getTenantId() : "jnpf"; + boolean useSuccess = redisTemplate.opsForValue().setIfAbsent(IntegrateJobUtil.WORKTIMEOUT_REDIS_KEY + "_key:" + tenantId, System.currentTimeMillis(), 3600, TimeUnit.SECONDS); + if (!useSuccess) continue; + if (futureList.get(tenantId) == null) { + ScheduledFuture scheduledFuture = scheduledThreadPoolExecutor.scheduleAtFixedRate(new Task(userInfo), 0, 1, TimeUnit.SECONDS); + futureList.put(tenantId, scheduledFuture); + } + } + } + + class Task implements Runnable { + private UserInfo userInfo; + + public Task(UserInfo userInfo) { + this.userInfo = userInfo; + } + + @Override + public void run() { + String tenantId = StringUtil.isNotEmpty(userInfo.getTenantId()) ? userInfo.getTenantId() : "jnpf"; + if (configValueUtil.isMultiTenancy()) { + if (StringUtil.isNotEmpty(userInfo.getTenantDbConnectionString())) { + DataSourceContextHolder.setDatasource(userInfo.getTenantId(), userInfo.getTenantDbConnectionString(), userInfo.isAssignDataSource()); + } + } + List list = integrateQueueService.getList(); + for (IntegrateQueueEntity entity : list) { + IntegrateModel model = new IntegrateModel(); + model.setUserInfo(userInfo); + model.setId(entity.getId()); + boolean integrate = IntegrateJobUtil.getIntegrate(model, redisUtil); + if (integrate) { + entity.setState(1); + integrateQueueService.update(entity.getId(), entity); + try { + integrateUtil.integrate(entity.getIntegrateId(), userInfo); + } catch (Exception e) { + + } + integrateQueueService.delete(entity); + IntegrateJobUtil.removeIntegrate(model,redisUtil); + } + } + //删除 + redisTemplate.delete(IntegrateJobUtil.WORKTIMEOUT_REDIS_KEY + "_key:" + tenantId); + } + } +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/job/QuartzUtil.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/job/QuartzUtil.java new file mode 100644 index 0000000..9d31ff5 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/job/QuartzUtil.java @@ -0,0 +1,74 @@ +package jnpf.integrate.job; + +import lombok.extern.slf4j.Slf4j; +import org.quartz.*; +import org.quartz.impl.StdSchedulerFactory; + +import java.util.Date; + +@Slf4j +public class QuartzUtil { + + private static final SchedulerFactory schedulerFactory = new StdSchedulerFactory(); + + public static void addJob(String jobName, String cron, Class jobClass, JobDataMap jobDataMap, Date startDate, Date endDate) { + if (jobDataMap == null) { + jobDataMap = new JobDataMap(); + } + JobDetail jobDetail = JobBuilder.newJob(jobClass).withIdentity(jobName).setJobData(jobDataMap).build(); + Trigger trigger = TriggerBuilder.newTrigger() + .forJob(jobDetail) + .withIdentity(jobName) + .withSchedule(CronScheduleBuilder.cronSchedule(cron)) + .startAt(startDate == null ? new Date() : startDate) + .endAt(endDate != null ? endDate : null) + .build(); + try { + //获取实例化的 Scheduler。 + Scheduler scheduler = getScheduler(); + //将任务及其触发器放入调度器 + scheduler.scheduleJob(jobDetail, trigger); + //调度器开始调度任务 + if (!scheduler.isShutdown()) { + scheduler.start(); + } + } catch (SchedulerException e) { + log.error("新增调度失败:"+e.getMessage()); + } + } + + private static Scheduler getScheduler() { + try { + return schedulerFactory.getScheduler(); + } catch (SchedulerException e) { + e.getMessage(); + } + return null; + } + + public static void deleteJob(String jobName) { + try { + TriggerKey triggerKey = TriggerKey.triggerKey(jobName); + Scheduler scheduler = getScheduler(); + scheduler.pauseTrigger(triggerKey); + scheduler.unscheduleJob(triggerKey); + scheduler.deleteJob(JobKey.jobKey(jobName)); + } catch (SchedulerException e) { + log.error("删除调度失败:"+e.getMessage()); + } + } + + private static boolean isTriKey(String jobName) { + boolean flag = false; + try { + Scheduler sched = schedulerFactory.getScheduler(); + TriggerKey triggerKey = TriggerKey.triggerKey(jobName); + CronTrigger trigger = (CronTrigger) sched.getTrigger(triggerKey); + flag = trigger != null; + } catch (Exception e) { + e.getMessage(); + } + return flag; + } + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/mapper/IntegrateMapper.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/mapper/IntegrateMapper.java new file mode 100644 index 0000000..10c621f --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/mapper/IntegrateMapper.java @@ -0,0 +1,8 @@ +package jnpf.integrate.mapper; + +import jnpf.base.mapper.SuperMapper; +import jnpf.integrate.entity.IntegrateEntity; + +public interface IntegrateMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/mapper/IntegrateNodeMapper.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/mapper/IntegrateNodeMapper.java new file mode 100644 index 0000000..9b4bd7e --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/mapper/IntegrateNodeMapper.java @@ -0,0 +1,9 @@ +package jnpf.integrate.mapper; + + +import jnpf.base.mapper.SuperMapper; +import jnpf.integrate.entity.IntegrateNodeEntity; + +public interface IntegrateNodeMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/mapper/IntegrateQueueMapper.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/mapper/IntegrateQueueMapper.java new file mode 100644 index 0000000..fcd1352 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/mapper/IntegrateQueueMapper.java @@ -0,0 +1,9 @@ +package jnpf.integrate.mapper; + +import jnpf.base.mapper.SuperMapper; +import jnpf.integrate.entity.IntegrateEntity; +import jnpf.integrate.entity.IntegrateQueueEntity; + +public interface IntegrateQueueMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/mapper/IntegrateTaskMapper.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/mapper/IntegrateTaskMapper.java new file mode 100644 index 0000000..c1726d4 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/mapper/IntegrateTaskMapper.java @@ -0,0 +1,8 @@ +package jnpf.integrate.mapper; + +import jnpf.base.mapper.SuperMapper; +import jnpf.integrate.entity.IntegrateTaskEntity; + +public interface IntegrateTaskMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/service/IntegrateNodeService.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/service/IntegrateNodeService.java new file mode 100644 index 0000000..872163c --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/service/IntegrateNodeService.java @@ -0,0 +1,25 @@ +package jnpf.integrate.service; + +import jnpf.base.service.SuperService; +import jnpf.integrate.entity.IntegrateNodeEntity; + +import java.util.List; + +public interface IntegrateNodeService extends SuperService { + + List getList(List id,String nodeCode); + + List getList(List id,String nodeCode, Integer isRetry); + + IntegrateNodeEntity getInfo(String id); + + void create(IntegrateNodeEntity entity); + + void update(String id,String nodeCode); + + Boolean update(String id, IntegrateNodeEntity entity); + + void delete(IntegrateNodeEntity entity); + + void delete(String id); +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/service/IntegrateQueueService.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/service/IntegrateQueueService.java new file mode 100644 index 0000000..4a7bff1 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/service/IntegrateQueueService.java @@ -0,0 +1,20 @@ +package jnpf.integrate.service; + +import jnpf.base.service.SuperService; +import jnpf.integrate.entity.IntegrateQueueEntity; + +import java.util.List; + +public interface IntegrateQueueService extends SuperService { + + List getList(); + + void create(IntegrateQueueEntity entity); + + Boolean update(String id, IntegrateQueueEntity entity); + + void delete(IntegrateQueueEntity entity); + + void delete(String integrateId); + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/service/IntegrateService.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/service/IntegrateService.java new file mode 100644 index 0000000..592fb5d --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/service/IntegrateService.java @@ -0,0 +1,31 @@ +package jnpf.integrate.service; + +import jnpf.base.ActionResult; +import jnpf.base.service.SuperService; +import jnpf.exception.WorkFlowException; +import jnpf.integrate.entity.IntegrateEntity; +import jnpf.integrate.model.integrate.IntegratePagination; + +import java.util.List; + +public interface IntegrateService extends SuperService { + + List getList(IntegratePagination pagination); + + List getList(IntegratePagination pagination, boolean isPage); + + IntegrateEntity getInfo(String id); + + Boolean isExistByFullName(String fullName, String id); + + Boolean isExistByEnCode(String encode, String id); + + void create(IntegrateEntity entity); + + ActionResult ImportData(IntegrateEntity entity) throws WorkFlowException; + + Boolean update(String id, IntegrateEntity entity,boolean state); + + void delete(IntegrateEntity entity); + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/service/IntegrateTaskService.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/service/IntegrateTaskService.java new file mode 100644 index 0000000..0ebda99 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/service/IntegrateTaskService.java @@ -0,0 +1,22 @@ +package jnpf.integrate.service; + +import jnpf.base.service.SuperService; +import jnpf.integrate.entity.IntegrateTaskEntity; +import jnpf.integrate.model.integrate.IntegratePageModel; + +import java.util.List; + +public interface IntegrateTaskService extends SuperService { + + List getList(IntegratePageModel pagination); + + List getList(List id); + + IntegrateTaskEntity getInfo(String id); + + void create(IntegrateTaskEntity entity); + + Boolean update(String id, IntegrateTaskEntity entity); + + void delete(IntegrateTaskEntity entity) ; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/service/impl/IntegrateNodeServiceImpl.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/service/impl/IntegrateNodeServiceImpl.java new file mode 100644 index 0000000..5e65275 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/service/impl/IntegrateNodeServiceImpl.java @@ -0,0 +1,98 @@ +package jnpf.integrate.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import jnpf.base.service.SuperServiceImpl; +import jnpf.integrate.entity.IntegrateNodeEntity; +import jnpf.integrate.mapper.IntegrateNodeMapper; +import jnpf.integrate.service.IntegrateNodeService; +import jnpf.util.RandomUtil; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Service +public class IntegrateNodeServiceImpl extends SuperServiceImpl implements IntegrateNodeService { + + @Autowired + private UserProvider userProvider; + + @Override + public List getList(List id, String nodeCode) { + return getList(id,nodeCode,null); + } + + @Override + public List getList(List id, String nodeCode, Integer resultType) { + List list = new ArrayList<>(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (id.size() > 0) { + queryWrapper.lambda().in(IntegrateNodeEntity::getTaskId, id); + if (StringUtil.isNotEmpty(nodeCode)) { + queryWrapper.lambda().eq(IntegrateNodeEntity::getNodeCode, nodeCode); + } + if(ObjectUtil.isNotEmpty(resultType)){ + queryWrapper.lambda().eq(IntegrateNodeEntity::getResultType, resultType); + } + list.addAll(this.list(queryWrapper)); + } + return list; + } + + @Override + public IntegrateNodeEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(IntegrateNodeEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(IntegrateNodeEntity entity) { + if (StringUtil.isEmpty(entity.getId())) { + entity.setId(RandomUtil.uuId()); + } + entity.setIsRetry(1); + entity.setCreatorTime(new Date()); + entity.setCreatorUserId(userProvider.get().getUserId()); + entity.setEnabledMark(1); + this.save(entity); + } + + @Override + public void update(String taskId, String nodeCode) { + UpdateWrapper queryWrapper = new UpdateWrapper<>(); + queryWrapper.lambda().eq(IntegrateNodeEntity::getTaskId,taskId); + queryWrapper.lambda().eq(IntegrateNodeEntity::getNodeCode,nodeCode); + queryWrapper.lambda().set(IntegrateNodeEntity::getIsRetry,0); + this.update(queryWrapper); + } + + @Override + public Boolean update(String id, IntegrateNodeEntity entity) { + entity.setId(id); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(userProvider.get().getUserId()); + return this.updateById(entity); + } + + @Override + public void delete(IntegrateNodeEntity entity) { + if(entity!=null) { + this.removeById(entity.getId()); + } + } + + @Override + public void delete(String taskId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(IntegrateNodeEntity::getTaskId,taskId); + this.remove(queryWrapper); + } + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/service/impl/IntegrateQueueServiceImpl.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/service/impl/IntegrateQueueServiceImpl.java new file mode 100644 index 0000000..7214121 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/service/impl/IntegrateQueueServiceImpl.java @@ -0,0 +1,55 @@ +package jnpf.integrate.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import jnpf.base.service.SuperServiceImpl; +import jnpf.integrate.entity.IntegrateQueueEntity; +import jnpf.integrate.mapper.IntegrateQueueMapper; +import jnpf.integrate.service.IntegrateQueueService; +import jnpf.util.RandomUtil; +import jnpf.util.StringUtil; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +@Service +public class IntegrateQueueServiceImpl extends SuperServiceImpl implements IntegrateQueueService { + + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().orderByAsc(IntegrateQueueEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public void create(IntegrateQueueEntity entity) { + if(StringUtil.isEmpty(entity.getId())){ + entity.setId(RandomUtil.uuId()); + } + entity.setCreatorTime(new Date()); + this.save(entity); + } + + @Override + public Boolean update(String id, IntegrateQueueEntity entity) { + entity.setId(id); + entity.setLastModifyTime(new Date()); + return this.updateById(entity); + } + + @Override + public void delete(IntegrateQueueEntity entity) { + if(entity!=null){ + this.removeById(entity.getId()); + } + } + + @Override + public void delete(String integrateId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(IntegrateQueueEntity::getIntegrateId,integrateId); + this.remove(queryWrapper); + } +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/service/impl/IntegrateServiceImpl.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/service/impl/IntegrateServiceImpl.java new file mode 100644 index 0000000..03e672f --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/service/impl/IntegrateServiceImpl.java @@ -0,0 +1,214 @@ +package jnpf.integrate.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import jnpf.base.ActionResult; +import jnpf.base.service.SuperServiceImpl; +import jnpf.constant.MsgCode; +import jnpf.exception.WorkFlowException; +import jnpf.integrate.entity.IntegrateEntity; +import jnpf.integrate.job.Integrate; +import jnpf.integrate.job.IntegrateJobUtil; +import jnpf.integrate.job.QuartzUtil; +import jnpf.integrate.mapper.IntegrateMapper; +import jnpf.integrate.model.childnode.IntegrateChildNode; +import jnpf.integrate.model.childnode.IntegrateProperties; +import jnpf.integrate.model.integrate.IntegratePagination; +import jnpf.integrate.model.nodeJson.IntegrateModel; +import jnpf.integrate.service.IntegrateQueueService; +import jnpf.integrate.service.IntegrateService; +import jnpf.util.*; +import org.apache.commons.lang3.StringUtils; +import org.quartz.JobDataMap; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; +import java.util.Objects; + +@Service +public class IntegrateServiceImpl extends SuperServiceImpl implements IntegrateService { + + @Autowired + private UserProvider userProvider; + @Autowired + private RedisUtil redisUtil; + @Autowired + private IntegrateQueueService integrateQueueService; + + @Override + public List getList(IntegratePagination pagination) { + return getList(pagination, true); + } + + @Override + public List getList(IntegratePagination pagination, boolean isPage) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(pagination.getKeyword())) { + queryWrapper.lambda().and( + t -> t.like(IntegrateEntity::getFullName, pagination.getKeyword()) + .or().like(IntegrateEntity::getEnCode, pagination.getKeyword()) + ); + } + if (ObjectUtil.isNotEmpty(pagination.getType())) { + queryWrapper.lambda().eq(IntegrateEntity::getType, pagination.getType()); + } + if (ObjectUtil.isNotEmpty(pagination.getFormId())) { + queryWrapper.lambda().eq(IntegrateEntity::getFormId, pagination.getFormId()); + } + if (ObjectUtil.isNotEmpty(pagination.getTrigger())) { + queryWrapper.lambda().eq(IntegrateEntity::getTriggerType, pagination.getTrigger()); + } + if (ObjectUtil.isNotEmpty(pagination.getEnabledMark())) { + queryWrapper.lambda().eq(IntegrateEntity::getEnabledMark, pagination.getEnabledMark()); + } + //排序 + if (StringUtils.isEmpty(pagination.getSidx())) { + queryWrapper.lambda().orderByDesc(IntegrateEntity::getCreatorTime); + } else { + queryWrapper = "asc".equals(pagination.getSort().toLowerCase()) ? queryWrapper.orderByAsc(pagination.getSidx()) : queryWrapper.orderByDesc(pagination.getSidx()); + } + if (isPage) { + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage userPage = page(page, queryWrapper); + return pagination.setData(userPage.getRecords(), page.getTotal()); + } + return this.list(queryWrapper); + } + + @Override + public IntegrateEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(IntegrateEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public Boolean isExistByFullName(String fullName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(IntegrateEntity::getFullName, fullName); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(IntegrateEntity::getId, id); + } + return this.count(queryWrapper) > 0; + } + + @Override + public Boolean isExistByEnCode(String encode, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(IntegrateEntity::getEnCode, encode); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(IntegrateEntity::getId, id); + } + return this.count(queryWrapper) > 0; + } + + @Override + public void create(IntegrateEntity entity) { + if (StringUtil.isEmpty(entity.getId())) { + entity.setId(RandomUtil.uuId()); + } + entity.setCreatorTime(new Date()); + entity.setCreatorUserId(userProvider.get().getUserId()); + formId(entity); + this.save(entity); + } + + @Override + @DSTransactional + public ActionResult ImportData(IntegrateEntity entity) throws WorkFlowException { + if (entity != null) { + if (isExistByFullName(entity.getFullName(), null)) { + return ActionResult.fail("集成助手名称不能重复"); + } + if (isExistByEnCode(entity.getEnCode(), null)) { + return ActionResult.fail("集成助手编码不能重复"); + } + try { + entity.setCreatorTime(new Date()); + entity.setCreatorUserId(UserProvider.getLoginUserId()); + entity.setLastModifyTime(null); + entity.setLastModifyUserId(null); + this.saveOrUpdate(entity); + } catch (Exception e) { + throw new WorkFlowException(MsgCode.IMP003.get()); + } + return ActionResult.success(MsgCode.IMP001.get()); + } + return ActionResult.fail("导入数据格式不正确"); + } + + @Override + public Boolean update(String id, IntegrateEntity entity, boolean state) { + entity.setId(id); + IntegrateEntity info = getInfo(id); + if (Objects.equals(entity.getEnabledMark(), 0) || !Objects.equals(info.getTemplateJson(), entity.getTemplateJson())) { + deleteJob(entity); + } + if (ObjectUtil.isEmpty(entity.getEnabledMark())) { + entity.setEnabledMark(info.getEnabledMark()); + } + if (ObjectUtil.isEmpty(entity.getType())) { + entity.setType(info.getType()); + } + if ((!Objects.equals(info.getTemplateJson(), entity.getTemplateJson()) || state) && Objects.equals(entity.getEnabledMark(), 1)) { + formId(entity); + } + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(userProvider.get().getUserId()); + return this.updateById(entity); + } + + @Override + public void delete(IntegrateEntity entity) { + deleteJob(entity); + this.removeById(entity.getId()); + } + + private void formId(IntegrateEntity entity) { + Integer enabledMark = entity.getEnabledMark(); + String templateJson = entity.getTemplateJson(); + if (StringUtil.isNotEmpty(templateJson)) { + IntegrateChildNode childNode = JsonUtil.getJsonToBean(templateJson, IntegrateChildNode.class); + IntegrateProperties properties = childNode.getProperties(); + String formId = properties.getFormId(); + entity.setFormId(formId); + entity.setTriggerType(properties.getTriggerEvent()); + if (Objects.equals(enabledMark, 1)) { + if (Objects.equals(entity.getType(), 2)) { + IntegrateModel model = new IntegrateModel(); + model.setId(entity.getId()); + IntegrateJobUtil.removeModel(model, redisUtil); + IntegrateModel integrateModel = JsonUtil.getJsonToBean(properties, IntegrateModel.class); + integrateModel.setUserInfo(userProvider.get()); + integrateModel.setId(entity.getId()); + integrateModel.setState(0); + JobDataMap jobDataMap = new JobDataMap(); + Date startTime = ObjectUtil.isNotEmpty(properties.getStartTime()) ? new Date(properties.getStartTime()) : new Date(); + Date endTime = Objects.equals(properties.getEndTimeType(), 2) ? new Date(properties.getEndTime()) : null; + integrateModel.setEndTime(endTime != null ? endTime.getTime() : null); + integrateModel.setStartTime(startTime.getTime()); + jobDataMap.putAll(JsonUtil.entityToMap(integrateModel)); + redisUtil.removeHash(IntegrateJobUtil.IDGENERATOR_REDIS_KEY, entity.getId()); + boolean isAdd = ObjectUtil.isNotEmpty(endTime) ? endTime.getTime() > System.currentTimeMillis() : true; + if (isAdd) { + QuartzUtil.addJob(entity.getId(), properties.getCron(), Integrate.class, jobDataMap, startTime, endTime); + } + } + } + } + } + + private void deleteJob(IntegrateEntity entity) { + QuartzUtil.deleteJob(entity.getId()); + integrateQueueService.delete(entity.getId()); + IntegrateModel model = new IntegrateModel(); + model.setId(entity.getId()); + IntegrateJobUtil.removeModel(model, redisUtil); + } + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/service/impl/IntegrateTaskServiceImpl.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/service/impl/IntegrateTaskServiceImpl.java new file mode 100644 index 0000000..433dda2 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/service/impl/IntegrateTaskServiceImpl.java @@ -0,0 +1,96 @@ +package jnpf.integrate.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import jnpf.base.service.SuperServiceImpl; +import jnpf.integrate.entity.IntegrateTaskEntity; +import jnpf.integrate.mapper.IntegrateTaskMapper; +import jnpf.integrate.model.integrate.IntegratePageModel; +import jnpf.integrate.service.IntegrateNodeService; +import jnpf.integrate.service.IntegrateTaskService; +import jnpf.util.*; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Service +public class IntegrateTaskServiceImpl extends SuperServiceImpl implements IntegrateTaskService { + + @Autowired + private UserProvider userProvider; + @Autowired + private IntegrateNodeService integrateNodeService; + + @Override + public List getList(IntegratePageModel pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(IntegrateTaskEntity::getIntegrateId,pagination.getIntegrateId()); + //日期范围(近7天、近1月、近3月、自定义) + String startTime = pagination.getStartTime() != null ? pagination.getStartTime() : null; + String endTime = pagination.getEndTime() != null ? pagination.getEndTime() : null; + if (!StringUtils.isEmpty(startTime) && !StringUtils.isEmpty(endTime)) { + Date startTimes = DateUtil.stringToDate(DateUtil.daFormat(Long.parseLong(startTime)) + " 00:00:00"); + Date endTimes = DateUtil.stringToDate(DateUtil.daFormat(Long.parseLong(endTime)) + " 23:59:59"); + queryWrapper.lambda().ge(IntegrateTaskEntity::getExecutionTime, startTimes).le(IntegrateTaskEntity::getExecutionTime, endTimes); + } + if (ObjectUtil.isNotEmpty(pagination.getResultType())) { + queryWrapper.lambda().eq(IntegrateTaskEntity::getResultType, pagination.getResultType()); + } + queryWrapper.lambda().orderByDesc(IntegrateTaskEntity::getExecutionTime); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage userPage = page(page, queryWrapper); + return pagination.setData(userPage.getRecords(), page.getTotal()); + } + + @Override + public List getList(List id) { + List list = new ArrayList<>(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (id.size() > 0) { + queryWrapper.lambda().in(IntegrateTaskEntity::getIntegrateId, id); + list.addAll(this.list(queryWrapper)); + } + return list; + } + + @Override + public IntegrateTaskEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(IntegrateTaskEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(IntegrateTaskEntity entity) { + if (StringUtil.isEmpty(entity.getId())) { + entity.setId(RandomUtil.uuId()); + } + entity.setCreatorTime(new Date()); + entity.setCreatorUserId(userProvider.get().getUserId()); + entity.setEnabledMark(0); + this.save(entity); + } + + @Override + public Boolean update(String id, IntegrateTaskEntity entity) { + entity.setId(id); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(userProvider.get().getUserId()); + return this.updateById(entity); + } + + @Override + public void delete(IntegrateTaskEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + integrateNodeService.delete(entity.getId()); + } + } + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/util/IntegrateUtil.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/util/IntegrateUtil.java new file mode 100644 index 0000000..8658635 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-biz/src/main/java/jnpf/integrate/util/IntegrateUtil.java @@ -0,0 +1,867 @@ +package jnpf.integrate.util; + +import cn.hutool.core.util.ObjectUtil; +import jnpf.base.ActionResult; +import jnpf.base.UserInfo; +import jnpf.base.entity.VisualdevEntity; +import jnpf.base.model.VisualDevJsonModel; +import jnpf.base.service.DataInterfaceService; +import jnpf.base.service.VisualdevService; +import jnpf.base.util.SentMessageUtil; +import jnpf.database.model.superQuery.SuperJsonModel; +import jnpf.database.model.superQuery.SuperQueryJsonModel; +import jnpf.engine.entity.FlowTaskEntity; +import jnpf.engine.service.FlowTaskService; +import jnpf.exception.WorkFlowException; +import jnpf.integrate.entity.IntegrateEntity; +import jnpf.integrate.entity.IntegrateNodeEntity; +import jnpf.integrate.entity.IntegrateTaskEntity; +import jnpf.integrate.model.childnode.*; +import jnpf.integrate.model.integrate.IntegratePagination; +import jnpf.integrate.model.nodeJson.IntegrateChildNodeList; +import jnpf.integrate.model.nodeJson.IntegrateChildNodeModel; +import jnpf.integrate.service.IntegrateNodeService; +import jnpf.integrate.service.IntegrateService; +import jnpf.integrate.service.IntegrateTaskService; +import jnpf.message.model.message.SentMessageForm; +import jnpf.model.visualJson.FieLdsModel; +import jnpf.onlinedev.model.PaginationModel; +import jnpf.onlinedev.model.VisualdevModelDataInfoVO; +import jnpf.onlinedev.service.VisualDevInfoService; +import jnpf.onlinedev.service.VisualDevListService; +import jnpf.onlinedev.service.VisualdevModelDataService; +import jnpf.onlinedev.util.onlineDevUtil.OnlinePublicUtils; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.UserService; +import jnpf.util.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Component; + +import java.util.*; +import java.util.stream.Collectors; + +@Slf4j +@Component +public class IntegrateUtil { + + @Autowired + private UserProvider userProvider; + @Autowired + private UserService userService; + @Autowired + private FlowTaskService flowTaskService; + @Autowired + private SentMessageUtil sentMessageUtil; + @Autowired + private DataInterfaceService dataInterfaceService; + @Autowired + private VisualDevListService visualDevListService; + @Autowired + private IntegrateService integrateService; + @Autowired + private VisualdevService visualdevService; + @Autowired + private VisualDevInfoService visualDevInfoService; + @Autowired + private IntegrateTaskService integrateTaskService; + @Autowired + private IntegrateNodeService integrateNodeService; + @Autowired + private VisualdevModelDataService visualdevModelDataService; + + //------------------------------------------事件------------------------------------------------------ + + @Async + public void deleteDataList(List dataInfoVOList, List id, UserInfo userInfo) { + for (VisualdevModelDataInfoVO infoVO : dataInfoVOList) { + String integrateId = infoVO.getIntegrateId(); + List> dataList = JsonUtil.getJsonToListMap(infoVO.getData()).stream().filter(t -> id.contains(String.valueOf(t.get("id")))).collect(Collectors.toList()); + integrate(integrateId, dataList, userInfo); + } + } + + @Async + public void dataAsyncList(String modelId, Integer trigger, List dataId, UserInfo userInfo) { + List resultData = new ArrayList<>(); + List list = integrateList(modelId, trigger); + for (IntegrateEntity entity : list) { + //数据 + IntegrateChildNode childNode = JsonUtil.getJsonToBean(entity.getTemplateJson(), IntegrateChildNode.class); + IntegrateChildNodeList childNodeModel = JsonUtil.getJsonToBean(childNode, IntegrateChildNodeList.class); + List> dataList = dataList(childNodeModel, new HashMap<>(16), dataId); + VisualdevModelDataInfoVO vo = new VisualdevModelDataInfoVO(); + vo.setData(JsonUtil.getObjectToString(dataList)); + vo.setIntegrateId(entity.getId()); + resultData.add(vo); + } + integrates(resultData, userInfo); + } + + public List dataList(String modelId, Integer trigger, List dataId) { + List resultData = new ArrayList<>(); + List list = integrateList(modelId, trigger); + for (IntegrateEntity entity : list) { + //数据 + IntegrateChildNode childNode = JsonUtil.getJsonToBean(entity.getTemplateJson(), IntegrateChildNode.class); + IntegrateChildNodeList childNodeModel = JsonUtil.getJsonToBean(childNode, IntegrateChildNodeList.class); + List> dataList = dataList(childNodeModel, new HashMap<>(16), dataId); + VisualdevModelDataInfoVO vo = new VisualdevModelDataInfoVO(); + vo.setData(JsonUtil.getObjectToString(dataList)); + vo.setIntegrateId(entity.getId()); + resultData.add(vo); + } + return resultData; + } + + public void integrates(List dataInfoVOList, UserInfo userInfo) { + for (VisualdevModelDataInfoVO infoVO : dataInfoVOList) { + String integrateId = infoVO.getIntegrateId(); + List> dataList = JsonUtil.getJsonToListMap(infoVO.getData()); + integrate(integrateId, dataList, userInfo); + } + } + + private List integrateList(String modelId, Integer trigger) { + IntegratePagination pagination = new IntegratePagination(); + pagination.setFormId(modelId); + pagination.setType(1); + pagination.setTrigger(trigger); + pagination.setEnabledMark(1); + List list = integrateService.getList(pagination, false); + return list; + } + + //------------------------------------------定时------------------------------------------------------ + + //重试 + public void integrate(String taskId, String parentId, String taskNodeId) { + IntegrateTaskEntity taskEntity = integrateTaskService.getInfo(taskId); + if (taskEntity != null) { + Date time = new Date(); + IntegrateNodeEntity info = integrateNodeService.getInfo(taskNodeId); + String retryNodeCode = info != null ? info.getNodeCode() : "" ; + Map objectMap = JsonUtil.stringToMap(taskEntity.getData()); + IntegrateEntity entity = integrateService.getInfo(taskEntity.getIntegrateId()); + boolean isParentId = !"0".equals(parentId); + String json = isParentId ? entity.getTemplateJson() : taskEntity.getTemplateJson(); + IntegrateChildNode childNode = JsonUtil.getJsonToBean(json, IntegrateChildNode.class); + List childNodeListAll = new ArrayList<>(); + childList(childNode, childNodeListAll); + if (isParentId) { + IntegrateTaskEntity parentTask = integrateTaskService.getInfo(parentId); + taskEntity.setId(RandomUtil.uuId()); + taskEntity.setParentTime(parentTask.getExecutionTime()); + taskEntity.setParentId(parentTask.getId()); + taskEntity.setExecutionTime(new Date()); + taskEntity.setProcessId(taskEntity.getId()); + integrateTaskService.save(taskEntity); + } + List nodeList = new ArrayList<>(); + List nodeListAll = new ArrayList<>(childNodeListAll); + for (IntegrateChildNodeList childNodeList : nodeListAll) { + childNodeList.setIntegrateType(taskEntity.getType()); + IntegrateProperties childProperties = childNodeList.getProperties(); + IntegrateNodeEntity nodeEntity = new IntegrateNodeEntity(); + nodeEntity.setResultType(0); + nodeEntity.setParentId(StringUtil.isNotEmpty(taskNodeId) ? taskNodeId : "0"); + nodeEntity.setNodeType(childNodeList.getType()); + nodeEntity.setNodeNext(childNodeList.getNextId()); + nodeEntity.setStartTime(time); + nodeEntity.setEndTime(time); + nodeEntity.setTaskId(taskEntity.getId()); + nodeEntity.setNodeCode(childNodeList.getNodeId()); + nodeEntity.setFormId(childProperties.getFormId()); + nodeEntity.setNodeName(childProperties.getTitle()); + nodeEntity.setNodePropertyJson(JsonUtil.getObjectToString(childNodeList)); + nodeEntity.setId(RandomUtil.uuId()); + nodeList.add(nodeEntity); + } + try { + IntegrateChildNodeModel childNodeModel = IntegrateChildNodeModel.builder().data(objectMap).dataListAll(new ArrayList<>()) + .nodeList(nodeList).node(childNode.getNodeId()).entity(entity).retryNodeCode(retryNodeCode).userInfo(userProvider.get()).build(); + childNode(childNodeModel); + } catch (Exception e) { + msg(entity, new HashMap<>(objectMap), nodeList, "end", false, userProvider.get()); + } + boolean failSum = nodeList.stream().filter(t -> t.getResultType() == 0).count() > 0; + taskEntity.setResultType(failSum ? 0 : 1); + integrateTaskService.update(taskEntity.getId(), taskEntity); + } + } + + //定时执行 + public void integrate(String integrateId, UserInfo userInfo) throws WorkFlowException { + List> dataList = new ArrayList<>(); + IntegrateEntity entity = integrateService.getInfo(integrateId); + if (entity != null) { + IntegrateChildNode childNode = JsonUtil.getJsonToBean(entity.getTemplateJson(), IntegrateChildNode.class); + IntegrateChildNode getDataChildNode = childNode.getChildNode(); + IntegrateChildNodeList dataListNodeMode = JsonUtil.getJsonToBean(getDataChildNode, IntegrateChildNodeList.class); + IntegrateProperties properties = dataListNodeMode.getProperties(); + Integer formType = properties.getFormType(); + //远端节点 + if (Objects.equals(formType, 3)) { + dataListNodeMode.getProperties().setTemplateJson(dataListNodeMode.getProperties().getInterfaceTemplateJson()); + ActionResult result = interfaceTemplateJson(dataListNodeMode, new HashMap<>(), userInfo); + if (result.getData() instanceof List) { + dataList.addAll((List) result.getData()); + } + } else { + dataList.addAll(dataList(dataListNodeMode, new HashMap<>(16), new ArrayList<>())); + } + integrate(integrateId, dataList, userInfo); + } + } + + //集成执行逻辑 + private void integrate(String integrateId, List> dataList, UserInfo userInfo) { + IntegrateEntity entity = integrateService.getInfo(integrateId); + if (entity != null) { + Date time = new Date(); + IntegrateChildNode childNode = JsonUtil.getJsonToBean(entity.getTemplateJson(), IntegrateChildNode.class); + IntegrateChildNode getDataChildNode = childNode.getChildNode(); + IntegrateChildNodeList dataListNodeMode = JsonUtil.getJsonToBean(getDataChildNode, IntegrateChildNodeList.class); + dataListNodeMode.setStartTime(time); + List childNodeListAll = new ArrayList<>(); + childList(childNode, childNodeListAll); + IntegrateChildNodeList startNode = childNodeListAll.stream().filter(t -> "start".equals(t.getType())).findFirst().orElse(null); + if (startNode != null) { + for (int i = 0; i < dataList.size(); i++) { + Map objectMap = dataList.get(i); + String id = String.valueOf(objectMap.get("id")); + List nodeList = new ArrayList<>(); + IntegrateTaskEntity taskEntity = new IntegrateTaskEntity(); + taskEntity.setIntegrateId(entity.getId()); + taskEntity.setType(entity.getType()); + taskEntity.setTemplateJson(entity.getTemplateJson()); + taskEntity.setDataId(id); + taskEntity.setParentId("0"); + taskEntity.setResultType(1); + taskEntity.setExecutionTime(new Date()); + taskEntity.setId(RandomUtil.uuId()); + taskEntity.setData(JsonUtil.getObjectToString(objectMap)); + taskEntity.setProcessId(taskEntity.getId()); + integrateTaskService.save(taskEntity); + //节点 + List nodeListAll = new ArrayList<>(childNodeListAll); + for (IntegrateChildNodeList childNodeList : nodeListAll) { + childNodeList.setIntegrateType(taskEntity.getType()); + IntegrateProperties childProperties = childNodeList.getProperties(); + IntegrateNodeEntity nodeEntity = new IntegrateNodeEntity(); + nodeEntity.setResultType(0); + nodeEntity.setParentId("0"); + nodeEntity.setNodeType(childNodeList.getType()); + nodeEntity.setNodeNext(childNodeList.getNextId()); + nodeEntity.setStartTime(time); + nodeEntity.setEndTime(time); + nodeEntity.setTaskId(taskEntity.getId()); + nodeEntity.setNodeCode(childNodeList.getNodeId()); + nodeEntity.setFormId(childProperties.getFormId()); + nodeEntity.setNodeName(childProperties.getTitle()); + nodeEntity.setNodePropertyJson(JsonUtil.getObjectToString(childNodeList)); + nodeList.add(nodeEntity); + } + String msg = "" ; + try { + IntegrateChildNodeModel childNodeModel = IntegrateChildNodeModel.builder().dataListAll(dataList).data(objectMap) + .nodeList(nodeList).node(startNode.getNodeId()).entity(entity).retryNodeCode("").userInfo(userInfo).build(); + childNode(childNodeModel); + } catch (Exception e) { + msg = e.getMessage(); + } + boolean failSum = nodeList.stream().filter(t -> t.getResultType() == 0).count() > 0; + taskEntity.setResultType(failSum ? 0 : 1); + integrateTaskService.update(taskEntity.getId(), taskEntity); + if (StringUtil.isNotEmpty(msg)) { + msg(entity, new HashMap<>(objectMap), nodeList, "end", false, userInfo); +// throw new WorkFlowException(msg); + } + } + } + } + } + + private void childList(IntegrateChildNode childNodeAll, List listAll) { + if (childNodeAll != null) { + IntegrateChildNodeList childNodeList = JsonUtil.getJsonToBean(childNodeAll, IntegrateChildNodeList.class); + boolean isNext = childNodeAll.getChildNode() != null; + String nextId = isNext ? childNodeAll.getChildNode().getNodeId() : "end" ; + childNodeList.setNextId(nextId); + listAll.add(childNodeList); + if (isNext) { + childList(childNodeAll.getChildNode(), listAll); + } + if ("end".equals(nextId)) { + IntegrateChildNodeList endChildNodeList = listAll.stream().filter(t -> "start".equals(t.getType())).findFirst().orElse(null); + IntegrateChildNodeList endNode = JsonUtil.getJsonToBean(endChildNodeList, IntegrateChildNodeList.class); + endNode.setNodeId(nextId); + endNode.setType(nextId); + endNode.setNextId(""); + endNode.getProperties().setTitle("结束"); + listAll.add(endNode); + } + } + } + + private void childNode(IntegrateChildNodeModel childNodeModel) throws WorkFlowException { + Map data = childNodeModel.getData(); + List> dataList = childNodeModel.getDataListAll(); + List nodeList = childNodeModel.getNodeList(); + String node = childNodeModel.getNode(); + IntegrateEntity entity = childNodeModel.getEntity(); + String retryNodeCode = childNodeModel.getRetryNodeCode(); + UserInfo userInfo = childNodeModel.getUserInfo(); + IntegrateNodeEntity nodeEntity = nodeList.stream().filter(t -> t.getNodeCode().equals(node)).findFirst().orElse(null); + if (nodeEntity != null) { + String nodeType = nodeEntity.getNodeType(); + String nodeCode = nodeEntity.getNodeCode(); + String[] nextCodeAll = nodeEntity.getNodeNext().split(","); + switch (nodeType) { + case "addData": + addData(new HashMap<>(data), nodeList, nodeCode, retryNodeCode); + break; + case "updateData": + updateData(new HashMap<>(data), nodeList, nodeCode, retryNodeCode); + break; + case "deleteData": + deleteData(new HashMap<>(data), new ArrayList<>(dataList), nodeList, nodeCode, retryNodeCode); + break; + case "message": + message(new HashMap<>(data), nodeList, nodeCode, userInfo); + break; + case "dataInterface": + dataInterface(new HashMap<>(data), nodeList, nodeCode, userInfo, retryNodeCode); + break; + case "getData": + getData(entity, nodeList, nodeCode); + break; + case "end": + case "start": + msg(entity, new HashMap<>(data), nodeList, nodeCode, true, userInfo); + break; + default: + break; + } + for (String nextCode : nextCodeAll) { + childNodeModel.setNode(nextCode); + childNode(childNodeModel); + } + } + } + + //-----------------------------------事件----------------------------------------------- + + private void getData(IntegrateEntity entity, List nodeList, String node) { + IntegrateNodeEntity nodeEntity = nodeList.stream().filter(t -> t.getNodeCode().equals(node)).findFirst().orElse(null); + if (nodeEntity != null) { + nodeEntity.setResultType(1); + List list = nodeList(nodeEntity); + if (list.size() == 0) { + integrateNodeService.create(nodeEntity); + } + } + } + + private void msg(IntegrateEntity entity, Map data, List nodeList, String node, boolean isAdd, UserInfo userInfo) { + IntegrateNodeEntity nodeEntity = nodeList.stream().filter(t -> t.getNodeCode().equals(node)).findFirst().orElse(null); + if (nodeEntity != null) { + String msg = "" ; + List list = nodeList(nodeEntity); + boolean isEnd = "end".equals(node); + String templeId = isEnd ? "PZXTJC001" : "PZXTJC002" ; + if (list.size() == 0) { + nodeEntity.setStartTime(isEnd ? new Date() : nodeEntity.getStartTime()); + boolean failSum = nodeList.stream().filter(t -> !Objects.equals(t.getNodeCode(), "end") && Objects.equals(t.getResultType(), 0)).count() > 0 || !isEnd; + IntegrateChildNodeList childNodeList = JsonUtil.getJsonToBean(nodeEntity.getNodePropertyJson(), IntegrateChildNodeList.class); + IntegrateProperties properties = childNodeList.getProperties(); + IntegrateMsgModel msgConfig = isEnd ? properties.getFailMsgConfig() : properties.getStartMsgConfig(); + Integer on = msgConfig.getOn(); + boolean acquiesce = on == 3; + String msgId = on == 0 ? "" : acquiesce ? templeId : msgConfig.getMsgId(); + List msgUserType = properties.getMsgUserType(); + List msgUserIds = properties.getMsgUserIds(); + Set userIdList = new HashSet<>(); + for (String type : msgUserType) { + switch (type) { + case "1": + userIdList.add(entity.getCreatorUserId()); + break; + case "2": + List adminList = userService.getAdminList().stream().map(UserEntity::getId).collect(Collectors.toList()); + userIdList.addAll(adminList); + break; + case "3": + List userList = userService.getUserIdList(msgUserIds, null); + userIdList.addAll(userList); + break; + default: + break; + } + } + Map dataMap = new HashMap() {{ + put("@Title", entity.getFullName()); + put("@CreatorUserName", ""); + }}; + List templateJson = msgConfig.getTemplateJson(); + try { + if (StringUtil.isNotEmpty(msgId) && userIdList.size() > 0 && failSum) { + Map parameterMap = acquiesce ? dataMap : templateJson(templateJson, data); + message(msgId, new ArrayList<>(userIdList), parameterMap, userInfo); + } + nodeEntity.setResultType(1); + } catch (Exception e) { + errMsg(nodeEntity, e); + msg = e.getMessage(); + } + nodeEntity.setEndTime(isEnd ? new Date() : nodeEntity.getEndTime()); + if (isAdd) { + integrateNodeService.create(nodeEntity); + } + } + } + } + + private void addData(Map data, List nodeList, String node, String retryNodeCode) throws WorkFlowException { + IntegrateNodeEntity nodeEntity = nodeList.stream().filter(t -> t.getNodeCode().equals(node)).findFirst().orElse(null); + if (nodeEntity != null) { + List list = nodeList(nodeEntity); + boolean isRetry = nodeEntity.getNodeCode().equals(retryNodeCode); + if (list.size() == 0 || isRetry) { + nodeEntity.setStartTime(new Date()); + IntegrateChildNodeList childNodeList = JsonUtil.getJsonToBean(nodeEntity.getNodePropertyJson(), IntegrateChildNodeList.class); + IntegrateProperties properties = childNodeList.getProperties(); + boolean isAdd = Objects.equals(childNodeList.getIntegrateType(), 1); + if (Objects.equals(childNodeList.getIntegrateType(), 2)) { + List> dataList = dataList(childNodeList, data, new ArrayList<>()); + Integer addRule = properties.getAddRule(); + isAdd = (dataList.size() > 0 && addRule == 1) || dataList.size() == 0; + } + String msg = "" ; + try { + if (isAdd) { + String formId = properties.getFormId(); + String flowId = properties.getFlowId(); + VisualdevEntity visualdevEntity = visualdevService.getReleaseInfo(formId); + List transferList = properties.getTransferList(); + Map saveData = formData(data, transferList); + saveData.put(FlowFormConstant.FLOWID, flowId); + visualdevModelDataService.visualCreate(visualdevEntity, saveData); + } + nodeEntity.setResultType(1); + } catch (Exception e) { + errMsg(nodeEntity, e); + msg = e.getMessage(); + } + nodeEntity.setEndTime(new Date()); + if (isRetry) { + integrateNodeService.update(nodeEntity.getTaskId(), nodeEntity.getNodeCode()); + } + integrateNodeService.create(nodeEntity); + if (StringUtil.isNotEmpty(msg)) { + throw new WorkFlowException(msg); + } + } + } + } + + private void updateData(Map data, List nodeList, String node, String retryNodeCode) throws WorkFlowException { + IntegrateNodeEntity nodeEntity = nodeList.stream().filter(t -> t.getNodeCode().equals(node)).findFirst().orElse(null); + if (nodeEntity != null) { + List list = nodeList(nodeEntity); + boolean isRetry = nodeEntity.getNodeCode().equals(retryNodeCode); + if (list.size() == 0 || isRetry) { + nodeEntity.setStartTime(new Date()); + IntegrateChildNodeList childNodeList = JsonUtil.getJsonToBean(nodeEntity.getNodePropertyJson(), IntegrateChildNodeList.class); + IntegrateProperties properties = childNodeList.getProperties(); + String formId = properties.getFormId(); + String flowId = properties.getFlowId(); + VisualdevEntity visualdevEntity = visualdevService.getReleaseInfo(formId); + List transferList = properties.getTransferList(); + List> dataList = dataList(childNodeList, data, new ArrayList<>()); + Integer unFoundRule = properties.getUnFoundRule(); + String msg = "" ; + boolean isAdd = dataList.size() == 0 && unFoundRule == 1; + if (isAdd) { + Map saveData = formData(data, transferList); + saveData.put(FlowFormConstant.FLOWID, flowId); + dataList.add(saveData); + } + try { + for (Map objectMap : dataList) { + if (isAdd) { + visualdevModelDataService.visualCreate(visualdevEntity, objectMap); + } else { + String id = String.valueOf(objectMap.get("id")); + Map saveData = formData(data, transferList); + Map dataObject = new HashMap<>(objectMap); + dataObject.putAll(saveData); + visualdevModelDataService.visualUpdate(visualdevEntity, dataObject, id); + } + } + nodeEntity.setResultType(1); + } catch (Exception e) { + errMsg(nodeEntity, e); + msg = e.getMessage(); + } + nodeEntity.setEndTime(new Date()); + if (isRetry) { + integrateNodeService.update(nodeEntity.getTaskId(), nodeEntity.getNodeCode()); + } + integrateNodeService.create(nodeEntity); + if (StringUtil.isNotEmpty(msg)) { + throw new WorkFlowException(msg); + } + } + } + } + + private void deleteData(Map data, List> dataListAll, List nodeList, String node, String retryNodeCode) throws WorkFlowException { + IntegrateNodeEntity nodeEntity = nodeList.stream().filter(t -> t.getNodeCode().equals(node)).findFirst().orElse(null); + if (nodeEntity != null) { + List list = nodeList(nodeEntity); + boolean isRetry = nodeEntity.getNodeCode().equals(retryNodeCode); + if (list.size() == 0 || isRetry) { + nodeEntity.setStartTime(new Date()); + IntegrateChildNodeList childNodeList = JsonUtil.getJsonToBean(nodeEntity.getNodePropertyJson(), IntegrateChildNodeList.class); + IntegrateProperties properties = childNodeList.getProperties(); + String formId = properties.getFormId(); + //条件的数据 + Integer deleteRule = Objects.equals(childNodeList.getIntegrateType(), 1) ? 1 : properties.getDeleteRule(); + IntegrateChildNodeList dataChildNode = new IntegrateChildNodeList(); + dataChildNode.getProperties().setFormId(formId); + boolean delete = Objects.equals(deleteRule, 1); + List> dataList = dataList(delete ? childNodeList : dataChildNode, data, new ArrayList<>()); + List idList = dataList.stream().map(t -> String.valueOf(t.get("id"))).collect(Collectors.toList()); + List deleteList = new ArrayList<>(); + if (delete) { + deleteList.addAll(idList); + } else { + List addList = new ArrayList<>(); + for (Map objectMap : dataListAll) { + addList.addAll(dataList(childNodeList, objectMap, new ArrayList<>()).stream().map(t -> String.valueOf(t.get("id"))).collect(Collectors.toList())); + } + idList.removeAll(addList); + deleteList.addAll(idList); + } + String msg = "" ; + try { + if (deleteList.size() > 0) { + VisualdevEntity visualdevEntity = visualdevService.getReleaseInfo(formId); + visualdevModelDataService.visualDelete(visualdevEntity, deleteList); + } + nodeEntity.setResultType(1); + } catch (Exception e) { + errMsg(nodeEntity, e); + msg = e.getMessage(); + } + nodeEntity.setEndTime(new Date()); + if (isRetry) { + integrateNodeService.update(nodeEntity.getTaskId(), nodeEntity.getNodeCode()); + } + integrateNodeService.create(nodeEntity); + if (StringUtil.isNotEmpty(msg)) { + throw new WorkFlowException(msg); + } + } + } + } + + private void message(Map data, List nodeList, String node, UserInfo userInfo) throws WorkFlowException { + IntegrateNodeEntity nodeEntity = nodeList.stream().filter(t -> t.getNodeCode().equals(node)).findFirst().orElse(null); + if (nodeEntity != null) { + String msg = "" ; + List list = nodeList(nodeEntity); + if (list.size() == 0) { + nodeEntity.setStartTime(new Date()); + IntegrateChildNodeList childNodeList = JsonUtil.getJsonToBean(nodeEntity.getNodePropertyJson(), IntegrateChildNodeList.class); + IntegrateProperties properties = childNodeList.getProperties(); + List userIdList = userService.getUserIdList(properties.getMsgUserIds(), null); + String msgId = properties.getMsgId(); + List templateJson = properties.getTemplateJson(); + try { + Map parameterMap = templateJson(templateJson, data); + if (userIdList.size() > 0) { + message(msgId, userIdList, parameterMap, userInfo); + } + nodeEntity.setResultType(1); + } catch (Exception e) { + errMsg(nodeEntity, e); + msg = e.getMessage(); + } + nodeEntity.setEndTime(new Date()); + integrateNodeService.create(nodeEntity); + if (StringUtil.isNotEmpty(msg)) { + throw new WorkFlowException(msg); + } + } + } + } + + private void dataInterface(Map data, List nodeList, String node, UserInfo userInfo, String retryNodeCode) throws WorkFlowException { + IntegrateNodeEntity nodeEntity = nodeList.stream().filter(t -> t.getNodeCode().equals(node)).findFirst().orElse(null); + if (nodeEntity != null) { + String msg = "" ; + List list = nodeList(nodeEntity); + boolean isRetry = nodeEntity.getNodeCode().equals(retryNodeCode); + if (list.size() == 0 || isRetry) { + nodeEntity.setStartTime(new Date()); + try { + IntegrateChildNodeList childNodeList = JsonUtil.getJsonToBean(nodeEntity.getNodePropertyJson(), IntegrateChildNodeList.class); + interfaceTemplateJson(childNodeList, data, userInfo); + nodeEntity.setResultType(1); + } catch (Exception e) { + errMsg(nodeEntity, e); + msg = e.getMessage(); + } + nodeEntity.setEndTime(new Date()); + integrateNodeService.create(nodeEntity); + if (StringUtil.isNotEmpty(msg)) { + throw new WorkFlowException(msg); + } + } + } + } + + public Map formData(Map formData, List transferList) throws WorkFlowException { +// Map result = new HashMap<>(formData); + Map result = new HashMap<>(); + Map oldData = new HashMap<>(formData); + Set msg = new HashSet<>(); + for (TransferModel assignMode : transferList) { + //子表处理规则 + Boolean required = assignMode.getRequired(); + String targetFieldLabel = assignMode.getTargetFieldLabel(); + String sourceType = assignMode.getSourceType(); + boolean isData = "2".equals(sourceType); + String parentField = assignMode.getSourceValue(); + String[] parentFieldList = isData ? new String[]{parentField} : parentField.split("-"); + String childField = assignMode.getTargetField(); + String[] childFieldList = childField.split("-"); + Object childData = isData ? parentField : formData.get(parentField); + if (childFieldList.length > 1) { + List> childMapAll = new ArrayList<>(); + if (result.get(childFieldList[0]) instanceof List) { + List> childList = (List>) result.get(childFieldList[0]); + for (Map objectMap : childList) { + Map childMap = new HashMap<>(objectMap); + childMapAll.add(childMap); + } + } + if (parentFieldList.length > 1) { + if (oldData.get(parentFieldList[0]) instanceof List) { + List> parentList = (List>) oldData.get(parentFieldList[0]); + int num = parentList.size() - childMapAll.size(); + for (int i = 0; i < num; i++) { + childMapAll.add(new HashMap<>()); + } + for (int i = 0; i < parentList.size(); i++) { + Map parentMap = parentList.get(i); + Map childMap = childMapAll.get(i); + if (required && ObjectUtil.isEmpty(parentMap.get(parentFieldList[1]))) { + msg.add(targetFieldLabel); + } + childMap.put(childFieldList[1], parentMap.get(parentFieldList[1])); + } + } + } else { + if (1 > childMapAll.size()) { + childMapAll.add(new HashMap<>()); + } + Map childMap = childMapAll.get(0); + if (required && ObjectUtil.isEmpty(childData)) { + msg.add(targetFieldLabel); + } + childMap.put(childFieldList[1], childData); + } + result.put(childFieldList[0], childMapAll); + } else { + if (parentFieldList.length > 1) { + if (oldData.get(parentFieldList[0]) instanceof List) { + List> parentList = (List>) oldData.get(parentFieldList[0]); + for (int i = 0; i < parentList.size(); i++) { + Map parentMap = parentList.get(i); + if (i == 0) { + childData = parentMap.get(parentFieldList[1]); + } + } + } + } + if (required && ObjectUtil.isEmpty(childData)) { + msg.add(targetFieldLabel); + } + result.put(childField, childData); + } + } + errRequiredMsg(msg); + return result; + } + + private List> dataList(IntegrateChildNodeList childNodeList, Map data, List dataId) { + IntegrateProperties properties = childNodeList.getProperties(); + String formId = properties.getFormId(); + Integer formType = properties.getFormType(); + List ruleList = properties.getRuleList(); + for (SuperQueryJsonModel superQueryJsonModel : ruleList) { + List groups = superQueryJsonModel.getGroups(); + for (FieLdsModel fieLdsModel : groups) { + boolean valueType = "1".equals(fieLdsModel.getFieldValueType()); + String fieldValue = data.get(fieLdsModel.getFieldValue()) != null ? String.valueOf(data.get(fieLdsModel.getFieldValue())) : null; + fieLdsModel.setFieldValue(valueType ? fieldValue : fieLdsModel.getFieldValue()); + } + } + String ruleMatchLogic = properties.getRuleMatchLogic(); + SuperJsonModel superJsonModel = new SuperJsonModel(); + superJsonModel.setConditionList(ruleList); + superJsonModel.setMatchLogic(StringUtil.isNotEmpty(ruleMatchLogic) ? ruleMatchLogic : superJsonModel.getMatchLogic()); + PaginationModel paginationModel = new PaginationModel(); + paginationModel.setPageSize(10000L); + paginationModel.setSuperQueryJson(ruleList.size() > 0 ? JsonUtil.getObjectToString(superJsonModel) : ""); + VisualdevEntity visualdevEntity = visualdevService.getReleaseInfo(formId); + VisualDevJsonModel visualJsonModel = OnlinePublicUtils.getVisualJsonModel(visualdevEntity); + List idAll = new ArrayList<>(); + List idList = new ArrayList<>(); + try { + List> dataList = visualDevListService.getDataList(visualJsonModel, paginationModel); + idList.addAll(dataList.stream().map(t -> String.valueOf(t.get("id"))).collect(Collectors.toList())); + } catch (Exception e) { + } + List intersection = idList.stream().filter(item -> dataId.contains(item)).collect(Collectors.toList()); + if (dataId.size() > 0) { + idAll.addAll(intersection); + } else { + idAll.addAll(idList); + } + List> dataList = new ArrayList<>(); + List orderStaList = new ArrayList<>(); + if (Objects.equals(formType, 2)) { + orderStaList.addAll(flowTaskService.getOrderStaList(idAll)); + } + for (String id : idAll) { + VisualdevModelDataInfoVO infoVO = visualDevInfoService.getEditDataInfo(id, visualdevEntity); + boolean taskStatus = orderStaList.stream().filter(t -> Objects.equals(t.getStatus(), 2) && t.getId().equals(id)).count() > 0; + boolean isAdd = Objects.equals(formType, 2) ? taskStatus : true; + if (StringUtil.isNotEmpty(infoVO.getData())) { + Map map = JsonUtil.stringToMap(infoVO.getData()); + map.put("id", infoVO.getId()); + if (isAdd) { + dataList.add(map); + } + } + } + return dataList; + } + + private void message(String msgId, List userIdList, Map parameterMap, UserInfo userInfo) { + SentMessageForm sentMessageForm = new SentMessageForm(); + sentMessageForm.setUserInfo(userInfo); + sentMessageForm.setTemplateId(msgId); + sentMessageForm.setToUserIds(userIdList); + sentMessageForm.setParameterMap(parameterMap); + sentMessageForm.setType(3); + sentMessageForm.setContentMsg(new HashMap<>()); + sentMessageUtil.sendDelegateMsg(sentMessageForm); + } + + private List nodeList(IntegrateNodeEntity nodeEntity) { + List list = integrateNodeService.getList(new ArrayList() {{ + add(nodeEntity.getTaskId()); + }}, nodeEntity.getNodeCode(), 1); + IntegrateNodeEntity integrateNode = list.stream().filter(t -> t.getNodeCode().equals(nodeEntity.getNodeCode()) && t.getResultType() == 1).findFirst().orElse(null); + nodeEntity.setResultType(integrateNode != null ? integrateNode.getResultType() : nodeEntity.getResultType()); + return list; + } + + private Map templateJson(List templateJson, Map data) throws WorkFlowException { + Map parameterMap = new HashMap<>(); + Set msg = new HashSet<>(); + for (IntegrateTemplateModel templateJsonModel : templateJson) { + List paramJson = templateJsonModel.getParamJson(); + for (IntegrateParamModel integrateParamModel : paramJson) { + Boolean required = integrateParamModel.getRequired(); + String fieldId = integrateParamModel.getField(); + String relationField = integrateParamModel.getRelationField(); + String[] model = StringUtil.isNotEmpty(relationField) ? relationField.split("-") : new String[]{}; + String dataValue = data.get(relationField) != null ? String.valueOf(data.get(relationField)) : "" ; + if (model.length > 1) { + Object dataList = data.get(model[0]); + if (dataList instanceof List) { + List> listAll = (List>) dataList; + List dataListAll = new ArrayList<>(); + for (Map objectMap : listAll) { + dataListAll.add(objectMap.get(model[1])); + } + if (required && ObjectUtil.isEmpty(dataListAll)) { + msg.add(fieldId); + } + dataValue = String.valueOf(dataListAll); + } + } + if (required && ObjectUtil.isEmpty(dataValue)) { + msg.add(fieldId); + } + parameterMap.put(integrateParamModel.getMsgTemplateId() + fieldId, dataValue); + } + } + errRequiredMsg(msg); + return parameterMap; + } + + private void errMsg(IntegrateNodeEntity nodeEntity, Exception e) { + ActionResult result = new ActionResult(); + result.setCode(400); + result.setMsg(e.getMessage()); + if (nodeEntity != null) { + nodeEntity.setErrorMsg(JsonUtil.getObjectToString(result)); + } + } + + private ActionResult interfaceTemplateJson(IntegrateChildNodeList childNodeList, Map data, UserInfo userInfo) throws WorkFlowException { + IntegrateProperties properties = childNodeList.getProperties(); + String interId = properties.getFormId(); + Map parameterMap = new HashMap<>(); + List templateJson = properties.getTemplateJson(); + Set msg = new HashSet<>(); + for (IntegrateTemplateModel templateJsonModel : templateJson) { + String fieldId = templateJsonModel.getField(); + Boolean required = templateJsonModel.getRequired(); + String relationField = templateJsonModel.getRelationField(); + String dataValue = data.get(relationField) != null ? String.valueOf(data.get(relationField)) : null; + String dataFieldValue = relationField; + String dataJson = !"2".equals(templateJsonModel.getSourceType()) ? dataValue : dataFieldValue; + String[] model = StringUtil.isNotEmpty(relationField) ? relationField.split("-") : new String[]{}; + if (model.length > 1) { + Object dataList = data.get(model[0]); + if (dataList instanceof List) { + List> listAll = (List>) dataList; + List dataListAll = new ArrayList<>(); + for (Map objectMap : listAll) { + dataListAll.add(objectMap.get(model[1])); + } + if (required && ObjectUtil.isEmpty(dataListAll)) { + msg.add(fieldId); + } + dataJson = String.valueOf(dataListAll); + } + } + if (required && ObjectUtil.isEmpty(dataJson)) { + msg.add(fieldId); + } + parameterMap.put(fieldId, dataJson); + } + errRequiredMsg(msg); + ActionResult dataInterfaceInfo = dataInterfaceService.infoToId(interId, userInfo.getTenantId(), + parameterMap, userInfo.getToken(), + null, null, null, null); + return dataInterfaceInfo; + } + + private void errRequiredMsg(Set msg) throws WorkFlowException { + if (msg.size() > 0) { + throw new WorkFlowException(new ArrayList(msg).get(0) + "字段不能为空"); + } + } + +} + diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-controller/pom.xml b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-controller/pom.xml new file mode 100644 index 0000000..157a914 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-controller/pom.xml @@ -0,0 +1,23 @@ + + + + jnpf-visualdev-integrate + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-visualdev-integrate-controller + + + + + com.jnpf + jnpf-visualdev-integrate-biz + ${project.version} + compile + + + diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-controller/src/main/java/jnpf/integrate/controller/IntegrateController.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-controller/src/main/java/jnpf/integrate/controller/IntegrateController.java new file mode 100644 index 0000000..1958f81 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-controller/src/main/java/jnpf/integrate/controller/IntegrateController.java @@ -0,0 +1,257 @@ +package jnpf.integrate.controller; + + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import jnpf.base.ActionResult; +import jnpf.base.controller.SuperController; +import jnpf.base.vo.DownloadVO; +import jnpf.base.vo.PageListVO; +import jnpf.base.vo.PaginationVO; +import jnpf.config.ConfigValueUtil; +import jnpf.constant.MsgCode; +import jnpf.emnus.ModuleTypeEnum; +import jnpf.exception.WorkFlowException; +import jnpf.integrate.entity.IntegrateEntity; +import jnpf.integrate.model.integrate.*; +import jnpf.integrate.service.IntegrateService; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.UserService; +import jnpf.util.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.UUID; +import java.util.stream.Collectors; + +@Slf4j +@Tag(name = "集成助手", description = "Integrate") +@RestController +@RequestMapping("/api/visualdev/Integrate") +public class IntegrateController extends SuperController { + + @Autowired + private UserService userService; + @Autowired + private UserProvider userProvider; + @Autowired + private DataFileExport fileExport; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private IntegrateService integrateService; + + /** + * 列表 + * + * @return + */ + @Operation(summary = "列表") + @GetMapping + public ActionResult> list(IntegratePagination pagination) { + List data = integrateService.getList(pagination); + List userId = data.stream().map(t -> t.getCreatorUserId()).collect(Collectors.toList()); + List userEntities = userService.getUserName(userId); + List resultList = new ArrayList<>(); + for (IntegrateEntity entity : data) { + IntegrateListVO vo = JsonUtil.getJsonToBean(entity, IntegrateListVO.class); + UserEntity creatorUser = userEntities.stream().filter(t -> t.getId().equals(entity.getCreatorUserId())).findFirst().orElse(null); + vo.setCreatorUser(creatorUser != null ? creatorUser.getRealName() + "/" + creatorUser.getAccount() : ""); + resultList.add(vo); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(resultList, paginationVO); + } + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "获取信息") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) { + IntegrateEntity entity = integrateService.getInfo(id); + IntegrateInfoVO vo = JsonUtil.getJsonToBean(entity, IntegrateInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 新建 + * + * @param integrateCrForm 实体对象 + * @return + */ + @Operation(summary = "添加") + @Parameters({ + @Parameter(name = "integrateCrForm", description = "实体对象", required = true) + }) + @PostMapping + public ActionResult create(@RequestBody @Valid IntegrateCrForm integrateCrForm) { + IntegrateEntity entity = JsonUtil.getJsonToBean(integrateCrForm, IntegrateEntity.class); + if (integrateService.isExistByFullName(entity.getFullName(), entity.getId())) { + return ActionResult.fail("名称不能重复"); + } + if (integrateService.isExistByEnCode(entity.getEnCode(), entity.getId())) { + return ActionResult.fail("编码不能重复"); + } + String id = RandomUtil.uuId(); + entity.setId(id); + integrateService.create(entity); + return ActionResult.success("新建成功", id); + } + + /** + * 更新 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "修改") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true), + @Parameter(name = "integrateUpForm", description = "实体对象", required = true) + }) + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody IntegrateUpForm integrateUpForm) { + IntegrateEntity entity = JsonUtil.getJsonToBean(integrateUpForm, IntegrateEntity.class); + if (integrateService.isExistByFullName(entity.getFullName(), id)) { + return ActionResult.fail("名称不能重复"); + } + if (integrateService.isExistByEnCode(entity.getEnCode(), id)) { + return ActionResult.fail("编码不能重复"); + } + boolean flag = integrateService.update(id, entity,false); + if (flag == false) { + return ActionResult.fail("更新失败,数据不存在"); + } + return ActionResult.success("更新成功", id); + } + + /** + * 删除 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "删除") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + IntegrateEntity entity = integrateService.getInfo(id); + if (entity != null) { + integrateService.delete(entity); + return ActionResult.success("删除成功"); + } + return ActionResult.fail("删除失败,数据不存在"); + } + + /** + * 复制功能 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "复制功能") + @Parameters({ + @Parameter(name = "id", description = "主键"), + }) + @PostMapping("/{id}/Actions/Copy") + public ActionResult copyInfo(@PathVariable("id") String id) throws Exception { + IntegrateEntity entity = integrateService.getInfo(id); + entity.setEnabledMark(0); + String copyNum = UUID.randomUUID().toString().substring(0, 5); + entity.setFullName(entity.getFullName() + ".副本" + copyNum); + entity.setLastModifyTime(null); + entity.setLastModifyUserId(null); + entity.setId(RandomUtil.uuId()); + entity.setEnCode(entity.getEnCode() + copyNum); + entity.setCreatorTime(new Date()); + entity.setEnabledMark(0); + entity.setCreatorUserId(userProvider.get().getUserId()); + integrateService.create(entity); + return ActionResult.success(MsgCode.SU007.get()); + } + + /** + * 更新功能状态 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "更新功能状态") + @Parameters({ + @Parameter(name = "id", description = "主键"), + }) + @PutMapping("/{id}/Actions/State") + public ActionResult update(@PathVariable("id") String id) { + IntegrateEntity entity = integrateService.getInfo(id); + if (entity != null) { + if (entity.getEnabledMark() == null || "1".equals(String.valueOf(entity.getEnabledMark()))) { + entity.setEnabledMark(0); + } else { + entity.setEnabledMark(1); + } + boolean flag = integrateService.update(entity.getId(), entity,true); + if (flag == false) { + return ActionResult.fail("更新失败,任务不存在"); + } + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 导出 + * + * @param id 主键 + * @return + */ + @Operation(summary = "导出") + @PostMapping("/{id}/Actions/ExportData") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult exportData(@PathVariable("id") String id) { + IntegrateEntity entity = integrateService.getInfo(id); + DownloadVO downloadVO = fileExport.exportFile(entity, configValueUtil.getTemporaryFilePath(), entity.getFullName(), ModuleTypeEnum.BASE_INTEGRATE.getTableName()); + return ActionResult.success(downloadVO); + } + + /** + * 导入 + * + * @param file 文件 + * @return + */ + @Operation(summary = "导入") + @PostMapping(value = "/Actions/ImportData", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public ActionResult ImportData(@RequestPart("file") MultipartFile file) throws WorkFlowException { + //判断是否为.json结尾 + if (FileUtil.existsSuffix(file, ModuleTypeEnum.BASE_INTEGRATE.getTableName())) { + return ActionResult.fail(MsgCode.IMP002.get()); + } + try { + String fileContent = FileUtil.getFileContent(file); + IntegrateEntity entity = JsonUtil.getJsonToBean(fileContent, IntegrateEntity.class); + return integrateService.ImportData(entity); + } catch (Exception e) { + throw new WorkFlowException("导入失败,数据有误"); + } + } + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-controller/src/main/java/jnpf/integrate/controller/IntegrateTaskController.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-controller/src/main/java/jnpf/integrate/controller/IntegrateTaskController.java new file mode 100644 index 0000000..e780d72 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-controller/src/main/java/jnpf/integrate/controller/IntegrateTaskController.java @@ -0,0 +1,150 @@ +package jnpf.integrate.controller; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import jnpf.base.ActionResult; +import jnpf.base.controller.SuperController; +import jnpf.base.vo.PageListVO; +import jnpf.base.vo.PaginationVO; +import jnpf.constant.MsgCode; +import jnpf.integrate.entity.IntegrateNodeEntity; +import jnpf.integrate.entity.IntegrateQueueEntity; +import jnpf.integrate.entity.IntegrateTaskEntity; +import jnpf.integrate.model.integratetask.IntegrateQueueListVO; +import jnpf.integrate.model.integratetask.IntegrateTaskInfo; +import jnpf.integrate.model.integratetask.IntegrateTaskListVO; +import jnpf.integrate.model.integrate.IntegratePageModel; +import jnpf.integrate.model.integratetask.IntegrateTaskModel; +import jnpf.integrate.service.IntegrateNodeService; +import jnpf.integrate.service.IntegrateQueueService; +import jnpf.integrate.service.IntegrateTaskService; +import jnpf.integrate.util.IntegrateUtil; +import jnpf.util.JsonUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.List; + +@Tag(name = "集成助手日志", description = "IntegrateTask" ) +@RestController +@RequestMapping("/api/visualdev/IntegrateTask" ) +public class IntegrateTaskController extends SuperController { + + @Autowired + private IntegrateTaskService integrateTaskService; + @Autowired + private IntegrateNodeService integrateNodeService; + @Autowired + private IntegrateUtil integrateUtil; + @Autowired + private IntegrateQueueService integrateQueueService; + + /** + * 列表 + * + * @return + */ + @Operation(summary = "日志列表" ) + @GetMapping + public ActionResult> list(IntegratePageModel pagination) { + List data = integrateTaskService.getList(pagination); + List list = JsonUtil.getJsonToList(data, IntegrateTaskListVO.class); + for (IntegrateTaskListVO taskListVO : list) { + taskListVO.setIsRetry("0".equals(taskListVO.getParentId()) ? 0 : 1); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(list, paginationVO); + } + + /** + * 删除 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "删除" ) + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @DeleteMapping("/{id}" ) + public ActionResult delete(@PathVariable("id" ) String id) { + IntegrateTaskEntity entity = integrateTaskService.getInfo(id); + if (entity != null) { + integrateTaskService.delete(entity); + return ActionResult.success("删除成功" ); + } + return ActionResult.fail("删除失败,数据不存在" ); + } + + /** + * 日志列表 + * + * @return + */ + @Operation(summary = "执行列表" ) + @GetMapping("/queueList" ) + public ActionResult> queueList() { + List list = integrateQueueService.getList(); + List listVO = JsonUtil.getJsonToList(list, IntegrateQueueListVO.class); + return ActionResult.success(listVO); + } + + /** + * 日志列表 + * + * @return + */ + @Operation(summary = "日志详情" ) + @GetMapping("/{id}" ) + public ActionResult list(@PathVariable("id" ) String id) { + IntegrateTaskEntity taskEntity = integrateTaskService.getInfo(id); + List nodeList = integrateNodeService.getList(new ArrayList() {{ + add(id); + }}, null); + List list = JsonUtil.getJsonToList(nodeList, IntegrateTaskModel.class); + for (IntegrateTaskModel taskModel : list) { + boolean isType = "0".equals(taskModel.getParentId()); + taskModel.setType(isType ? 1 : 0); + } + IntegrateTaskInfo info = new IntegrateTaskInfo(); + info.setList(list); + info.setData(taskEntity.getData()); + return ActionResult.success(info); + } + + /** + * 节点重试 + * + * @return + */ + @Operation(summary = "节点重试" ) + @GetMapping(value = "/{id}/nodeRetry" ) + public ActionResult taskNode(@PathVariable("id" ) String id, String nodeId) { + IntegrateTaskEntity taskEntity = integrateTaskService.getInfo(id); + if (taskEntity != null) { + integrateUtil.integrate(id, "0", nodeId); + return ActionResult.success(MsgCode.SU005.get()); + } + return ActionResult.fail(MsgCode.FA007.get()); + } + + /** + * 重试 + * + * @return + */ + @Operation(summary = "重试" ) + @PutMapping(value = "/{id}/retry" ) + public ActionResult ImportData(@PathVariable("id" ) String id) { + IntegrateTaskEntity taskEntity = integrateTaskService.getInfo(id); + if (taskEntity != null) { + integrateUtil.integrate(id, id, "0" ); + return ActionResult.success(MsgCode.SU005.get()); + } + return ActionResult.fail(MsgCode.FA007.get()); + } + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/pom.xml b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/pom.xml new file mode 100644 index 0000000..1eca810 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/pom.xml @@ -0,0 +1,24 @@ + + + + jnpf-visualdev-integrate + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-visualdev-integrate-entity + + + + com.jnpf + jnpf-common-core + + + com.jnpf + jnpf-common-database + + + diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/entity/IntegrateEntity.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/entity/IntegrateEntity.java new file mode 100644 index 0000000..76180e2 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/entity/IntegrateEntity.java @@ -0,0 +1,53 @@ +package jnpf.integrate.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + +/** + * + * @version V3.4.5 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @author JNPF开发平台组 + */ +@Data +@TableName("base_integrate") +public class IntegrateEntity extends SuperExtendEntity.SuperExtendDEEntity { + + /** + * 名称 + */ + @TableField("F_FULL_NAME") + private String fullName; + + /** + * 编码 + */ + @TableField("F_EN_CODE") + private String enCode; + + /** + * 模板 + */ + @TableField("F_TEMPLATE_JSON") + private String templateJson; + + /** + * 类型(1-事件,2-定时 ) + */ + @TableField("F_TYPE") + private Integer type; + + /** + * 开始表单id + */ + @TableField("F_FORM_ID") + private String formId; + + /** + * 类型 (1.新增 2.修改 3.删除) + */ + @TableField("F_TRIGGER_TYPE") + private Integer triggerType; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/entity/IntegrateNodeEntity.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/entity/IntegrateNodeEntity.java new file mode 100644 index 0000000..bd1bbf4 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/entity/IntegrateNodeEntity.java @@ -0,0 +1,97 @@ +package jnpf.integrate.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * + * @version V3.4.5 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @author JNPF开发平台组 + */ +@Data +@TableName("base_integrate_node") +public class IntegrateNodeEntity extends SuperExtendEntity.SuperExtendDEEntity { + + /** + * 任务主键 + */ + @TableField("F_TASK_ID") + private String taskId; + + /** + * 节点编码 + */ + @TableField("F_NODE_CODE") + private String nodeCode; + + /** + * 节点编码 + */ + @TableField("F_FORM_ID") + private String formId; + + /** + * 节点类型 + */ + @TableField("F_NODE_TYPE") + private String nodeType; + + /** + * 节点名称 + */ + @TableField("F_NODE_NAME") + private String nodeName; + + /** + * 父节点id + */ + @TableField("F_PARENT_ID") + private String parentId; + + /** + * 节点属性Json + */ + @TableField("F_NODE_PROPERTY_JSON") + private String nodePropertyJson; + + /** + * 下一节点 + */ + @TableField("F_NODE_NEXT") + private String nodeNext; + + /** + * 运行结果 + */ + @TableField("F_RESULT_TYPE") + private Integer resultType; + + /** + * 异常 + */ + @TableField("F_ERROR_MSG") + private String errorMsg; + + /** + * 开始时间 + */ + @TableField("f_start_time") + private Date startTime; + + /** + * 能否重试 + */ + @TableField("f_is_retry") + private Integer isRetry; + + /** + * 结束时间 + */ + @TableField("F_END_Time") + private Date endTime; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/entity/IntegrateQueueEntity.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/entity/IntegrateQueueEntity.java new file mode 100644 index 0000000..3055acd --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/entity/IntegrateQueueEntity.java @@ -0,0 +1,44 @@ +package jnpf.integrate.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * + * @version V3.4.5 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @author JNPF开发平台组 + */ +@Data +@TableName("base_integrate_queue") +public class IntegrateQueueEntity extends SuperExtendEntity.SuperExtendDEEntity { + + /** + * 状态 + */ + @TableField("f_state") + private Integer state; + + /** + * 集成主键 + */ + @TableField("F_INTEGRATE_ID") + private String integrateId; + + /** + * 执行时间 + */ + @TableField("F_EXECUTION_TIME") + private Date executionTime; + + /** + * 名称 + */ + @TableField("F_FULL_NAME") + private String fullName; + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/entity/IntegrateTaskEntity.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/entity/IntegrateTaskEntity.java new file mode 100644 index 0000000..8e1786b --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/entity/IntegrateTaskEntity.java @@ -0,0 +1,80 @@ +package jnpf.integrate.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * + * @version V3.4.5 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @author JNPF开发平台组 + */ +@Data +@TableName("base_integrate_task") +public class IntegrateTaskEntity extends SuperExtendEntity.SuperExtendDEEntity { + + /** + * 集成主键 + */ + @TableField("F_INTEGRATE_ID") + private String integrateId; + + /** + * 实例进程 + */ + @TableField("F_PROCESS_ID") + private String processId; + + /** + * 集成类型(1-事件,2-定时 ) + */ + @TableField("F_TYPE") + private Integer type; + + /** + * 集成模板 + */ + @TableField("F_TEMPLATE_JSON") + private String templateJson; + + + /** + * 数据主键 + */ + @TableField("F_DATA_ID") + private String dataId; + + /** + * 数据 + */ + @TableField("F_DATA") + private String data; + + /** + * 父节点id + */ + @TableField("F_PARENT_ID") + private String parentId; + + /** + * 父节点时间 + */ + @TableField("F_PARENT_TIME") + private Date parentTime; + + /** + * 执行时间 + */ + @TableField("F_EXECUTION_TIME") + private Date executionTime; + + /** + * 结果 (0.失败 1.成功) + */ + @TableField("F_RESULT_TYPE") + private Integer resultType; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/childnode/IntegrateChildNode.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/childnode/IntegrateChildNode.java new file mode 100644 index 0000000..6326bb4 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/childnode/IntegrateChildNode.java @@ -0,0 +1,19 @@ +package jnpf.integrate.model.childnode; + +import lombok.Data; + +/** + * 版本: V3.0.0 + * 版权: 引迈信息技术有限公司 + * 作者: 管理员/admin + * 日期: 2020-10-21 14:23:30 + */ +@Data +public class IntegrateChildNode { + private String type; + private String content; + private String nodeId; + private String prevId; + private IntegrateChildNode childNode; + private IntegrateProperties properties = new IntegrateProperties(); +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/childnode/IntegrateMsgModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/childnode/IntegrateMsgModel.java new file mode 100644 index 0000000..69355ae --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/childnode/IntegrateMsgModel.java @@ -0,0 +1,20 @@ +package jnpf.integrate.model.childnode; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * 版本: V3.0.0 + * 版权: 引迈信息技术有限公司 + * 作者: 管理员/admin + * 日期: 2020-10-21 14:23:30 + */ +@Data +public class IntegrateMsgModel { + //0.关闭 1.自定义 3.默认 + private Integer on = 0; + private String msgId; + private List templateJson = new ArrayList<>(); +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/childnode/IntegrateParamModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/childnode/IntegrateParamModel.java new file mode 100644 index 0000000..21877ad --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/childnode/IntegrateParamModel.java @@ -0,0 +1,19 @@ +package jnpf.integrate.model.childnode; + +import lombok.Data; + +/** + * 版本: V3.0.0 + * 版权: 引迈信息技术有限公司 + * 作者: 管理员/admin + * 日期: 2020-10-21 14:23:30 + */ +@Data +public class IntegrateParamModel { + private String field; + private String fieldName; + private Boolean required = false; + private String relationField; + private String msgTemplateId; + private Boolean isSubTable = false; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/childnode/IntegrateProperties.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/childnode/IntegrateProperties.java new file mode 100644 index 0000000..b2a7653 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/childnode/IntegrateProperties.java @@ -0,0 +1,58 @@ +package jnpf.integrate.model.childnode; + +import jnpf.database.model.superQuery.SuperQueryJsonModel; +import jnpf.emnus.SearchMethodEnum; +import jnpf.model.visualJson.FieLdsModel; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * 版本: V3.0.0 + * 版权: 引迈信息技术有限公司 + * 作者: 管理员/admin + * 日期: 2020-10-21 14:23:30 + */ +@Data +public class IntegrateProperties { + private String title; + private String formId; + private String flowId; + private Integer formType = 1; + private List formFieldList = new ArrayList<>(); + private List transferList = new ArrayList<>(); + private List ruleList = new ArrayList<>(); + private Integer triggerEvent; + //0.不新增 1.新增 + private Integer addRule = 0; + //0-不更新 1-新增 + private Integer unFoundRule = 0; + //0-删除未找到 1-删除已找到 + private Integer deleteRule = 0; + private String ruleMatchLogic = SearchMethodEnum.And.getSymbol(); + + + private String msgId; + private List msgUserType = new ArrayList<>(); + private List msgUserIds = new ArrayList<>(); + private List templateJson = new ArrayList<>(); + private List interfaceTemplateJson = new ArrayList<>(); + private IntegrateMsgModel startMsgConfig = new IntegrateMsgModel(); + private IntegrateMsgModel failMsgConfig= new IntegrateMsgModel(); + + + + private Long startTime; + private String cron; + private Integer endTimeType = 1; + //次数 + private Integer endLimit = 1; + //结束时间 + private Long endTime; + //类型 + private Integer integrateType = 2; + + + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/childnode/IntegrateTemplateModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/childnode/IntegrateTemplateModel.java new file mode 100644 index 0000000..aca39f2 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/childnode/IntegrateTemplateModel.java @@ -0,0 +1,28 @@ +package jnpf.integrate.model.childnode; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * 版本: V3.0.0 + * 版权: 引迈信息技术有限公司 + * 作者: 管理员/admin + * 日期: 2020-10-21 14:23:30 + */ +@Data +public class IntegrateTemplateModel { + //远端接口 + private String field; + private Boolean required = false; + private String sourceType; + private String relationField; + + + //发送配置 + private String templateId; + private String sendConfigId; + private String msgTemplateName; + private List paramJson = new ArrayList<>(); +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/childnode/TransferModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/childnode/TransferModel.java new file mode 100644 index 0000000..77ba319 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/childnode/TransferModel.java @@ -0,0 +1,18 @@ +package jnpf.integrate.model.childnode; + +import lombok.Data; + +/** + * 版本: V3.0.0 + * 版权: 引迈信息技术有限公司 + * 作者: 管理员/admin + * 日期: 2020-10-21 14:23:30 + */ +@Data +public class TransferModel { + private String targetField; + private String targetFieldLabel; + private String sourceType; + private String sourceValue; + private Boolean required = false; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/integrate/IntegrateCrForm.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/integrate/IntegrateCrForm.java new file mode 100644 index 0000000..13215e4 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/integrate/IntegrateCrForm.java @@ -0,0 +1,28 @@ +package jnpf.integrate.model.integrate; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 版本: V3.0.0 + * 版权: 引迈信息技术有限公司 + * 作者: 管理员/admin + * 日期: 2020-10-21 14:23:30 + */ +@Data +public class IntegrateCrForm { + @Schema(description = "说明") + private String description; + @Schema(description = "名称") + private String fullName; + @Schema(description = "编码") + private String enCode; + @Schema(description = "有效标志") + private Integer enabledMark; + @Schema(description = "json") + private String templateJson; + @Schema(description = "排序码") + private long sortCode; + @Schema(description = "类型") + private Integer type; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/integrate/IntegrateInfoVO.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/integrate/IntegrateInfoVO.java new file mode 100644 index 0000000..d85672b --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/integrate/IntegrateInfoVO.java @@ -0,0 +1,30 @@ +package jnpf.integrate.model.integrate; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 版本: V3.0.0 + * 版权: 引迈信息技术有限公司 + * 作者: 管理员/admin + * 日期: 2020-10-21 14:23:30 + */ +@Data +public class IntegrateInfoVO { + @Schema(description = "主键") + private String id; + @Schema(description = "说明") + private String description; + @Schema(description = "名称") + private String fullName; + @Schema(description = "编码") + private String enCode; + @Schema(description = "有效标志") + private Integer enabledMark; + @Schema(description = "排序码") + private Long sortCode; + @Schema(description = "类型") + private Integer type; + @Schema(description = "json") + private String templateJson; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/integrate/IntegrateListVO.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/integrate/IntegrateListVO.java new file mode 100644 index 0000000..ef9bfc7 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/integrate/IntegrateListVO.java @@ -0,0 +1,37 @@ +package jnpf.integrate.model.integrate; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 版本: V3.0.0 + * 版权: 引迈信息技术有限公司 + * 作者: 管理员/admin + * 日期: 2020-10-21 14:23:30 + */ +@Data +public class IntegrateListVO { + @Schema(description = "主键") + private String id; + + @Schema(description = "类型") + private Integer type; + + @Schema(description = "名称") + private String fullName; + + @Schema(description = "编码") + private String enCode; + + @Schema(description = "有效标志") + private Integer enabledMark; + + @Schema(description = "创建时间" ) + private Long creatorTime; + + @Schema(description = "创建人" ) + private String creatorUser; + + @Schema(description = "修改时间" ) + private Long lastModifyTime; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/integrate/IntegratePageModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/integrate/IntegratePageModel.java new file mode 100644 index 0000000..c925dd3 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/integrate/IntegratePageModel.java @@ -0,0 +1,23 @@ +package jnpf.integrate.model.integrate; + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.base.Pagination; +import lombok.Data; + +/** + * 版本: V3.0.0 + * 版权: 引迈信息技术有限公司 + * 作者: 管理员/admin + * 日期: 2020-10-21 14:23:30 + */ +@Data +public class IntegratePageModel extends Pagination { + @Schema(description = "开始时间") + private String startTime; + @Schema(description = "结束时间") + private String endTime; + @Schema(description = "集成助手主键") + private String integrateId; + @Schema(description = "结果") + private Integer resultType; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/integrate/IntegratePagination.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/integrate/IntegratePagination.java new file mode 100644 index 0000000..2d956c8 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/integrate/IntegratePagination.java @@ -0,0 +1,18 @@ +package jnpf.integrate.model.integrate; + +import jnpf.base.Pagination; +import lombok.Data; + +/** + * 版本: V3.0.0 + * 版权: 引迈信息技术有限公司 + * 作者: 管理员/admin + * 日期: 2020-10-21 14:23:30 + */ +@Data +public class IntegratePagination extends Pagination { + private Integer type; + private String formId; + private Integer trigger; + private Integer enabledMark; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/integrate/IntegrateUpForm.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/integrate/IntegrateUpForm.java new file mode 100644 index 0000000..c43f61f --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/integrate/IntegrateUpForm.java @@ -0,0 +1,14 @@ +package jnpf.integrate.model.integrate; + +import lombok.Data; + +/** + * 版本: V3.0.0 + * 版权: 引迈信息技术有限公司 + * 作者: 管理员/admin + * 日期: 2020-10-21 14:23:30 + */ +@Data +public class IntegrateUpForm extends IntegrateCrForm{ + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/integratetask/IntegrateQueueListVO.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/integratetask/IntegrateQueueListVO.java new file mode 100644 index 0000000..2dd7988 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/integratetask/IntegrateQueueListVO.java @@ -0,0 +1,16 @@ +package jnpf.integrate.model.integratetask; + +import lombok.Data; + +/** + * 版本: V3.0.0 + * 版权: 引迈信息技术有限公司 + * 作者: 管理员/admin + * 日期: 2020-10-21 14:23:30 + */ +@Data +public class IntegrateQueueListVO { + private String fullName; + private Integer state; + private Long executionTime; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/integratetask/IntegrateTaskInfo.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/integratetask/IntegrateTaskInfo.java new file mode 100644 index 0000000..18d0bec --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/integratetask/IntegrateTaskInfo.java @@ -0,0 +1,18 @@ +package jnpf.integrate.model.integratetask; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * 版本: V3.0.0 + * 版权: 引迈信息技术有限公司 + * 作者: 管理员/admin + * 日期: 2020-10-21 14:23:30 + */ +@Data +public class IntegrateTaskInfo { + private List list = new ArrayList<>(); + private String data; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/integratetask/IntegrateTaskListVO.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/integratetask/IntegrateTaskListVO.java new file mode 100644 index 0000000..cd27dfa --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/integratetask/IntegrateTaskListVO.java @@ -0,0 +1,20 @@ +package jnpf.integrate.model.integratetask; + +import lombok.Data; + +/** + * 版本: V3.0.0 + * 版权: 引迈信息技术有限公司 + * 作者: 管理员/admin + * 日期: 2020-10-21 14:23:30 + */ +@Data +public class IntegrateTaskListVO { + private String id; + private String processId; + private String parentId; + private Integer isRetry; + private Long parentTime; + private Long executionTime; + private Integer resultType; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/integratetask/IntegrateTaskModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/integratetask/IntegrateTaskModel.java new file mode 100644 index 0000000..a13940b --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/integratetask/IntegrateTaskModel.java @@ -0,0 +1,25 @@ +package jnpf.integrate.model.integratetask; + +import lombok.Data; + +/** + * 版本: V3.0.0 + * 版权: 引迈信息技术有限公司 + * 作者: 管理员/admin + * 日期: 2020-10-21 14:23:30 + */ +@Data +public class IntegrateTaskModel { + private String taskId; + private String nodeCode; + private String nodeType; + private String nodeName; + private Integer resultType; + private String errorMsg; + private Long startTime; + private Long endTime; + private String parentId; + private Boolean isRetry; + private Integer type; + private String id; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/nodeJson/IntegrateChildNodeList.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/nodeJson/IntegrateChildNodeList.java new file mode 100644 index 0000000..a1667d2 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/nodeJson/IntegrateChildNodeList.java @@ -0,0 +1,24 @@ +package jnpf.integrate.model.nodeJson; + +import jnpf.integrate.model.childnode.IntegrateProperties; +import lombok.Data; + +import java.util.Date; + +/** + * 版本: V3.0.0 + * 版权: 引迈信息技术有限公司 + * 作者: 管理员/admin + * 日期: 2020-10-21 14:23:30 + */ +@Data +public class IntegrateChildNodeList { + private String nodeId; + private String prevId; + private String nextId; + private String type; + private Integer integrateType; + private Date startTime = new Date(); + private Date endTime= new Date(); + private IntegrateProperties properties = new IntegrateProperties(); +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/nodeJson/IntegrateChildNodeModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/nodeJson/IntegrateChildNodeModel.java new file mode 100644 index 0000000..f4cbf01 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/nodeJson/IntegrateChildNodeModel.java @@ -0,0 +1,35 @@ +package jnpf.integrate.model.nodeJson; + +import jnpf.base.UserInfo; +import jnpf.integrate.entity.IntegrateEntity; +import jnpf.integrate.entity.IntegrateNodeEntity; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 版本: V3.0.0 + * 版权: 引迈信息技术有限公司 + * 作者: 管理员/admin + * 日期: 2020-10-21 14:23:30 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class IntegrateChildNodeModel { + private Map data = new HashMap<>(); + private List> dataListAll = new ArrayList<>(); + private List nodeList = new ArrayList<>(); + private String node; + private IntegrateEntity entity; + private String retryNodeCode; + private UserInfo userInfo; + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/nodeJson/IntegrateModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/nodeJson/IntegrateModel.java new file mode 100644 index 0000000..2ced6f9 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/jnpf-visualdev-integrate-entity/src/main/java/jnpf/integrate/model/nodeJson/IntegrateModel.java @@ -0,0 +1,24 @@ +package jnpf.integrate.model.nodeJson; + +import jnpf.base.UserInfo; +import lombok.Data; + +/** + * 版本: V3.0.0 + * 版权: 引迈信息技术有限公司 + * 作者: 管理员/admin + * 日期: 2020-10-21 14:23:30 + */ +@Data +public class IntegrateModel { + private UserInfo userInfo; + private String id; + private String cron; + private Long startTime = System.currentTimeMillis(); + private Long endTime = System.currentTimeMillis(); + private Integer endTimeType = 1; + private Integer endLimit = 1; + private Integer num = 0; + private Integer state = 0; + private Long time = System.currentTimeMillis(); +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/pom.xml b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/pom.xml new file mode 100644 index 0000000..d296bfa --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-integrate/pom.xml @@ -0,0 +1,21 @@ + + + + jnpf-visualdev + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-visualdev-integrate + pom + + jnpf-visualdev-integrate-entity + jnpf-visualdev-integrate-biz + jnpf-visualdev-integrate-controller + + + + diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/pom.xml b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/pom.xml new file mode 100644 index 0000000..7d4e665 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/pom.xml @@ -0,0 +1,42 @@ + + + + jnpf-visualdev-onlinedev + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-visualdev-onlinedev-biz + + + + com.jnpf + jnpf-visualdev-onlinedev-entity + ${project.version} + + + com.jnpf + jnpf-form-biz + ${project.version} + + + com.jnpf + jnpf-visualdev-base-biz + ${project.version} + + + com.jnpf + jnpf-system-biz + ${project.version} + + + com.jnpf + jnpf-workflow-engine-biz + ${project.version} + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/mapper/VisualdevModelDataMapper.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/mapper/VisualdevModelDataMapper.java new file mode 100644 index 0000000..7b87509 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/mapper/VisualdevModelDataMapper.java @@ -0,0 +1,17 @@ +package jnpf.onlinedev.mapper; + + +import jnpf.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import jnpf.onlinedev.entity.VisualdevModelDataEntity; + +/** + * + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @author JNPF开发平台组 + * @date 2021/3/16 + */ +public interface VisualdevModelDataMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/service/VisualDevInfoService.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/service/VisualDevInfoService.java new file mode 100644 index 0000000..d1aeee5 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/service/VisualDevInfoService.java @@ -0,0 +1,31 @@ +package jnpf.onlinedev.service; + +import jnpf.base.entity.VisualdevEntity; +import jnpf.onlinedev.model.VisualdevModelDataInfoVO; + +/** + * + * 功能设计表单数据 + * @author JNPF开发平台组 + * @version V3.2 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/10/26 + */ +public interface VisualDevInfoService { + + /** + * 编辑页数据回显 + * @param id 主键id + * @param visualdevEntity 可视化实体 + * @return + */ + VisualdevModelDataInfoVO getEditDataInfo(String id, VisualdevEntity visualdevEntity); + + /** + * 详情页数据 + * @param id + * @param visualdevEntity + * @return + */ + VisualdevModelDataInfoVO getDetailsDataInfo(String id, VisualdevEntity visualdevEntity); +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/service/VisualDevListService.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/service/VisualDevListService.java new file mode 100644 index 0000000..6c39a4e --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/service/VisualDevListService.java @@ -0,0 +1,79 @@ +package jnpf.onlinedev.service; + +import jnpf.base.UserInfo; +import jnpf.base.model.VisualDevJsonModel; +import jnpf.exception.WorkFlowException; +import jnpf.onlinedev.model.OnlineDevListModel.VisualColumnSearchVO; +import jnpf.onlinedev.model.PaginationModel; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; + +/** + *列表临时接口 + * + * @author JNPF开发平台组 + * @version V3.2.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/7/28 + */ +@Service +public interface VisualDevListService { + + + /** + * 无表数据 + * + * @param modelId + * @return + */ + List> getWithoutTableData(String modelId); + + /** + * 有表查询 + * + * @param visualDevJsonModel + * @param paginationModel + * @return + */ + List> getListWithTable(VisualDevJsonModel visualDevJsonModel, PaginationModel paginationModel, UserInfo userInfo, String moduleId, List columnPropList); + + /** + * 列表数据 + * + * @param visualDevJsonModel + * @param paginationModel + * @return + */ + List> getDataList(VisualDevJsonModel visualDevJsonModel, PaginationModel paginationModel) throws WorkFlowException; + + /** + * 外链列表数据 + * + * @param visualDevJsonModel + * @param paginationModel + * @return + */ + List> getDataListLink(VisualDevJsonModel visualDevJsonModel, PaginationModel paginationModel) throws WorkFlowException; + + + /** + * 无表数据处理 + * + * @param list + * @param searchVOList + * @param paginationModel + * @return + */ + List> getList(List> list, List searchVOList, PaginationModel paginationModel); + + /** + * 关联表单列表数据 + * + * @param visualDevJsonModel + * @param paginationModel + * @return + */ + List> getRelationFormList(VisualDevJsonModel visualDevJsonModel, PaginationModel paginationModel); +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/service/VisualdevModelDataService.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/service/VisualdevModelDataService.java new file mode 100644 index 0000000..46bdbe7 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/service/VisualdevModelDataService.java @@ -0,0 +1,65 @@ +package jnpf.onlinedev.service; + + +import jnpf.base.ActionResult; +import jnpf.base.entity.VisualdevEntity; +import jnpf.base.model.FormDataField; +import jnpf.base.model.VisualDevJsonModel; +import jnpf.base.service.SuperService; +import jnpf.exception.DataException; +import jnpf.model.flow.DataModel; +import jnpf.onlinedev.entity.VisualdevModelDataEntity; +import jnpf.onlinedev.model.PaginationModel; +import jnpf.onlinedev.model.PaginationModelExport; +import jnpf.onlinedev.model.VisualdevModelDataInfoVO; + +import java.io.IOException; +import java.sql.SQLException; +import java.text.ParseException; +import java.util.List; +import java.util.Map; + +/** + * + * 0代码功能数据表 + * 版本: V3.0.0 + * 版权: 引迈信息技术有限公司 + * 作者: 管理员/admin + * 日期: 2020-07-24 11:59 + */ +public interface VisualdevModelDataService extends SuperService { + + /** + * 获取表单主表属性下拉框 + * @return + */ + List fieldList(String id, Integer filterType); + + /** + * 弹窗数据分页 + * @param visualdevEntity + * @param paginationModel + * @return + */ + List> getPageList(VisualdevEntity visualdevEntity, PaginationModel paginationModel); + + List getList(String modelId); + + VisualdevModelDataEntity getInfo(String id); + + VisualdevModelDataInfoVO infoDataChange(String id, VisualdevEntity visualdevEntity) throws IOException, ParseException, DataException, SQLException; + + void delete(VisualdevModelDataEntity entity); + + boolean tableDelete(String id, VisualDevJsonModel visualDevJsonModel) throws Exception; + + ActionResult tableDeleteMore(List id, VisualDevJsonModel visualDevJsonModel) throws Exception; + + List> exportData(String[] keys, PaginationModelExport paginationModelExport, VisualDevJsonModel visualDevJsonModel) throws IOException, ParseException, SQLException, DataException; + + DataModel visualCreate(VisualdevEntity visualdevEntity,Map map) throws Exception; + + DataModel visualUpdate(VisualdevEntity visualdevEntity,Map map,String id) throws Exception; + + void visualDelete(VisualdevEntity visualdevEntity,List id) throws Exception; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/service/impl/VisualDevInfoServiceImpl.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/service/impl/VisualDevInfoServiceImpl.java new file mode 100644 index 0000000..6a4e108 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/service/impl/VisualDevInfoServiceImpl.java @@ -0,0 +1,438 @@ +package jnpf.onlinedev.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import jnpf.base.entity.VisualdevEntity; +import jnpf.base.model.ColumnDataModel; +import jnpf.base.model.VisualDevJsonModel; +import jnpf.base.service.DbLinkService; +import jnpf.database.model.entity.DbLinkEntity; +import jnpf.database.util.ConnUtil; +import jnpf.database.util.DynamicDataSourceUtil; +import jnpf.mapper.FlowFormDataMapper; +import jnpf.model.visualJson.FieLdsModel; +import jnpf.model.visualJson.FormCloumnUtil; +import jnpf.model.visualJson.FormDataModel; +import jnpf.model.visualJson.TableModel; +import jnpf.model.visualJson.analysis.*; +import jnpf.onlinedev.model.VisualdevModelDataInfoVO; +import jnpf.onlinedev.service.VisualDevInfoService; +import jnpf.onlinedev.util.onlineDevUtil.OnlineDevInfoUtils; +import jnpf.onlinedev.util.onlineDevUtil.OnlinePublicUtils; +import jnpf.onlinedev.util.onlineDevUtil.OnlineSwapDataUtils; +import jnpf.util.*; +import jnpf.util.context.RequestContext; +import jnpf.util.visiual.JnpfKeyConsts; +import lombok.Cleanup; +import org.mybatis.dynamic.sql.BasicColumn; +import org.mybatis.dynamic.sql.SqlBuilder; +import org.mybatis.dynamic.sql.SqlTable; +import org.mybatis.dynamic.sql.render.RenderingStrategies; +import org.mybatis.dynamic.sql.select.render.SelectStatementProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.sql.Connection; +import java.util.*; +import java.util.stream.Collectors; + + +/** + * @author JNPF开发平台组 + * @version V3.2 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/10/26 + */ +@Service +public class VisualDevInfoServiceImpl implements VisualDevInfoService { + + @Autowired + private DbLinkService dblinkService; + @Autowired + private OnlineDevInfoUtils onlineDevInfoUtils; + @Autowired + private FlowFormDataMapper flowFormDataMapper; + @Autowired + private OnlineSwapDataUtils onlineSwapDataUtils; + @Autowired + private FlowFormDataUtil flowDataUtil; + + @Override + public VisualdevModelDataInfoVO getEditDataInfo(String id, VisualdevEntity visualdevEntity) { + VisualdevModelDataInfoVO vo = new VisualdevModelDataInfoVO(); + Map allDataMap = new HashMap<>(); + + FormDataModel formData = JsonUtil.getJsonToBean(visualdevEntity.getFormData(), FormDataModel.class); + //是否开启并发锁 + String version = ""; + if (formData.getConcurrencyLock()) { + //查询 + version = TableFeildsEnum.VERSION.getField(); + } + + Integer primaryKeyPolicy = formData.getPrimaryKeyPolicy(); + boolean isSnowFlake = visualdevEntity.getEnableFlow() == 0; + if (primaryKeyPolicy == 2 && isSnowFlake) { + primaryKeyPolicy = 1; + } + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + List tableModelList = JsonUtil.getJsonToList(visualdevEntity.getVisualTables(), TableModel.class); + RecursionForm recursionForm = new RecursionForm(); + recursionForm.setList(list); + recursionForm.setTableModelList(tableModelList); + List formAllModel = new ArrayList<>(); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + //form的属性 + List mast = formAllModel.stream().filter(t -> FormEnum.mast.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + List table = formAllModel.stream().filter(t -> FormEnum.table.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + List mastTable = formAllModel.stream().filter(t -> FormEnum.mastTable.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + + TableModel mainTable = tableModelList.stream().filter(t -> t.getTypeId().equals("1")).findFirst().orElse(null); + + DbLinkEntity linkEntity = dblinkService.getInfo(visualdevEntity.getDbLinkId()); + try { + DynamicDataSourceUtil.switchToDataSource(linkEntity); + @Cleanup Connection conn = ConnUtil.getConnOrDefault(linkEntity); + String databaseProductName = conn.getMetaData().getDatabaseProductName(); + boolean oracle = databaseProductName.equalsIgnoreCase("oracle"); + boolean IS_DM = databaseProductName.equalsIgnoreCase("DM DBMS"); + Object idObj=id; + if(formData.getPrimaryKeyPolicy() == 2){ + idObj=Long.parseLong(id); + } + if (visualdevEntity.getEnableFlow() == 0 && formData.getPrimaryKeyPolicy() == 2) { + primaryKeyPolicy = 1; + } + //获取主键 + String pKeyName = flowDataUtil.getKey(conn, mainTable.getTable(), primaryKeyPolicy); + //主表所有数据 + SqlTable mainSqlTable = SqlTable.of(mainTable.getTable()); + SelectStatementProvider render = SqlBuilder.select(mainSqlTable.allColumns()).from(mainSqlTable).where(mainSqlTable.column(pKeyName), + SqlBuilder.isEqualTo(idObj)).build().render(RenderingStrategies.MYBATIS3); + Map mainAllMap = Optional.ofNullable(flowFormDataMapper.selectOneMappedRow(render)).orElse(new HashMap<>()); + if (mainAllMap.size() == 0) { + return vo; + } + //主表 + List mainTableFields = mast.stream().filter(m -> StringUtil.isNotEmpty(m.getFormColumnModel().getFieLdsModel().getVModel())) + .map(s -> + { + String jnpfKey = s.getFormColumnModel().getFieLdsModel().getConfig().getJnpfKey(); + String modelFiled = s.getFormColumnModel().getFieLdsModel().getVModel(); + if (oracle || IS_DM) { + if (jnpfKey.equals(JnpfKeyConsts.UPLOADFZ) || jnpfKey.equals(JnpfKeyConsts.UPLOADIMG) || jnpfKey.equals(JnpfKeyConsts.EDITOR)) { + modelFiled = "dbms_lob.substr( " + modelFiled + ")"; + } + } + return modelFiled; + } + ).collect(Collectors.toList()); + if (StringUtil.isNotEmpty(version)) { + mainTableFields.add(version); + } + List mainTableBasicColumn = mainTableFields.stream().map(m -> { + if (m.contains("(")) { + String replace = m.replace("dbms_lob.substr(", ""); + String alisaName = replace.replace(")", ""); + return SqlTable.of(mainTable.getTable()).column(m).as(alisaName); + } else { + return SqlTable.of(mainTable.getTable()).column(m); + } + }).collect(Collectors.toList()); + //无字段时查询主键 + mainTableBasicColumn.add(SqlTable.of(mainTable.getTable()).column(pKeyName)); + + SelectStatementProvider mainRender = SqlBuilder.select(mainTableBasicColumn).from(mainSqlTable).where(mainSqlTable.column(pKeyName), + SqlBuilder.isEqualTo(idObj)).build().render(RenderingStrategies.MYBATIS3); + Map mainMap = flowFormDataMapper.selectOneMappedRow(mainRender); + if (ObjectUtil.isNotEmpty(mainMap)) { + //转换主表里的数据 + List mainFieldList = mast.stream().filter(m -> StringUtil.isNotEmpty(m.getFormColumnModel().getFieLdsModel().getVModel())) + .map(t -> t.getFormColumnModel().getFieLdsModel()).collect(Collectors.toList()); + mainMap = onlineDevInfoUtils.swapDataInfoType(mainFieldList, mainMap); + allDataMap.putAll(mainMap); + } + + //列表子表 + Map> groupByTableNames = mastTable.stream().map(mt -> mt.getFormMastTableModel()).collect(Collectors.groupingBy(ma -> ma.getTable())); + Iterator>> entryIterator = groupByTableNames.entrySet().iterator(); + while (entryIterator.hasNext()) { + Map.Entry> next = entryIterator.next(); + String childTableName = next.getKey(); + List childMastTableList = next.getValue(); + TableModel childTableModel = tableModelList.stream().filter(t -> t.getTable().equals(childTableName)).findFirst().orElse(null); + SqlTable mastSqlTable = SqlTable.of(childTableName); + List mastTableBasicColumn = childMastTableList.stream().filter(m -> StringUtil.isNotEmpty(m.getField())) + .map(m -> { + String jnpfKey = m.getMastTable().getFieLdsModel().getConfig().getJnpfKey(); + String modelFiled = m.getField(); + String aliasName = ""; + if (oracle || IS_DM) { + if (jnpfKey.equals(JnpfKeyConsts.UPLOADFZ) || jnpfKey.equals(JnpfKeyConsts.UPLOADIMG) || jnpfKey.equals(JnpfKeyConsts.EDITOR)) { + aliasName = m.getField(); + modelFiled = "dbms_lob.substr( " + modelFiled + ")"; + } + } + return StringUtil.isEmpty(aliasName) ? mastSqlTable.column(modelFiled) : mastSqlTable.column(modelFiled).as(aliasName); + }).collect(Collectors.toList()); + //添加副表关联字段,不然数据会空没有字段名称 + mastTableBasicColumn.add(mastSqlTable.column(childTableModel.getTableField())); + String relation = isSnowFlake ? childTableModel.getRelationField().toLowerCase() : TableFeildsEnum.FLOWTASKID.getField(); + String relationValue = String.valueOf(OnlinePublicUtils.mapKeyToLower(mainAllMap).get(relation)); + SelectStatementProvider mastRender = SqlBuilder.select(mastTableBasicColumn).from(mastSqlTable).where(mastSqlTable.column(childTableModel.getTableField()), + SqlBuilder.isEqualTo(relationValue)).build().render(RenderingStrategies.MYBATIS3); + Map soloDataMap = flowFormDataMapper.selectOneMappedRow(mastRender); + if (ObjectUtil.isNotEmpty(soloDataMap)) { + Map renameKeyMap = new HashMap<>(); + for (Map.Entry entry : soloDataMap.entrySet()) { + FormMastTableModel model = childMastTableList.stream().filter(child -> child.getField().equalsIgnoreCase(String.valueOf(entry.getKey()))).findFirst().orElse(null); + if (model != null) { + renameKeyMap.put(model.getVModel(), entry.getValue()); + } + } + List columnChildFields = childMastTableList.stream().map(cl -> cl.getMastTable().getFieLdsModel()).collect(Collectors.toList()); + renameKeyMap = onlineDevInfoUtils.swapDataInfoType(columnChildFields, renameKeyMap); + allDataMap.putAll(renameKeyMap); + } + } + + //设计子表 + table.stream().map(t -> t.getChildList()).forEach( + t1 -> { + String childTableName = t1.getTableName(); + TableModel tableModel = tableModelList.stream().filter(tm -> tm.getTable().equals(childTableName)).findFirst().orElse(null); + SqlTable childSqlTable = SqlTable.of(childTableName); + List childFields = t1.getChildList().stream().filter(t2 -> StringUtil.isNotEmpty(t2.getFieLdsModel().getVModel())) + .map( + t2 -> { + String jnpfKey = t2.getFieLdsModel().getConfig().getJnpfKey(); + String modelFiled = t2.getFieLdsModel().getVModel(); + String aliasName = ""; + if (oracle || IS_DM) { + if (jnpfKey.equals(JnpfKeyConsts.UPLOADFZ) || jnpfKey.equals(JnpfKeyConsts.UPLOADIMG) + || jnpfKey.equals(JnpfKeyConsts.EDITOR)) { + aliasName = t2.getFieLdsModel().getVModel(); + modelFiled = "dbms_lob.substr( " + modelFiled + ")"; + } + } + return StringUtil.isEmpty(aliasName) ? childSqlTable.column(modelFiled) : childSqlTable.column(modelFiled).as(aliasName); + }).collect(Collectors.toList()); + String relation = Objects.equals(visualdevEntity.getEnableFlow(), 1) && Objects.equals(formData.getPrimaryKeyPolicy(), 2) ? + TableFeildsEnum.FLOWTASKID.getField() : tableModel.getRelationField().toLowerCase(); + String relationValue = String.valueOf(OnlinePublicUtils.mapKeyToLower(mainAllMap).get(relation)); + childFields.add(childSqlTable.column(relation)); + SelectStatementProvider childRender = SqlBuilder.select(childFields).from(childSqlTable).where(childSqlTable.column(tableModel.getTableField()), + SqlBuilder.isEqualTo(relationValue)).build().render(RenderingStrategies.MYBATIS3); + try { + List> childMapList = flowFormDataMapper.selectManyMappedRows(childRender); + Map childMap = new HashMap<>(1); + if (ObjectUtil.isNotEmpty(childMapList)) { + List childFieldModels = t1.getChildList().stream().map(t2 -> t2.getFieLdsModel()).collect(Collectors.toList()); + childMapList = childMapList.stream().map(c1 -> { + try { + return onlineDevInfoUtils.swapDataInfoType(childFieldModels, c1); + } catch (Exception e) { + e.printStackTrace(); + } + return c1; + }).collect(Collectors.toList()); + childMap.put(t1.getTableModel(), childMapList); + } else { + childMap.put(t1.getTableModel(), new ArrayList<>()); + } + allDataMap.putAll(childMap); + } catch (Exception e) { + e.printStackTrace(); + } + } + ); + } catch (Exception e) { + throw new RuntimeException(e); + } finally { + DynamicDataSourceUtil.clearSwitchDataSource(); + } + vo.setId(id); + vo.setData(JsonUtilEx.getObjectToString(allDataMap)); + return vo; + } + + @Override + public VisualdevModelDataInfoVO getDetailsDataInfo(String id, VisualdevEntity visualdevEntity) { + VisualdevModelDataInfoVO vo = new VisualdevModelDataInfoVO(); + Map allDataMap = new HashMap<>(); + Map allDataResMap = new HashMap<>(); + FormDataModel formData = JsonUtil.getJsonToBean(visualdevEntity.getFormData(), FormDataModel.class); + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + List tableModelList = JsonUtil.getJsonToList(visualdevEntity.getVisualTables(), TableModel.class); + RecursionForm recursionForm = new RecursionForm(); + recursionForm.setList(list); + recursionForm.setTableModelList(tableModelList); + List formAllModel = new ArrayList<>(); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + //form的属性 + List mast = formAllModel.stream().filter(t -> FormEnum.mast.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + List table = formAllModel.stream().filter(t -> FormEnum.table.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + List mastTable = formAllModel.stream().filter(t -> FormEnum.mastTable.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + List codeList = formAllModel.stream().filter(t -> t.getJnpfKey().equals(FormEnum.BARCODE.getMessage()) + || t.getJnpfKey().equals(FormEnum.QR_CODE.getMessage())).map(formModel -> formModel.getFormModel()).collect(Collectors.toList()); + + TableModel mainTable = tableModelList.stream().filter(t -> t.getTypeId().equals("1")).findFirst().orElse(null); + boolean isSnowFlake = visualdevEntity.getEnableFlow() == 0; + DbLinkEntity linkEntity = dblinkService.getInfo(visualdevEntity.getDbLinkId()); + try { + DynamicDataSourceUtil.switchToDataSource(linkEntity); + @Cleanup Connection conn = ConnUtil.getConnOrDefault(linkEntity); + String databaseProductName = conn.getMetaData().getDatabaseProductName(); + boolean oracle = databaseProductName.equalsIgnoreCase("oracle"); + boolean IS_DM = databaseProductName.equalsIgnoreCase("DM DBMS"); + Object idObj=id; + if(formData.getPrimaryKeyPolicy() == 2){ + idObj=Long.parseLong(id); + } + //获取主键 + Integer primaryKeyPolicy = formData.getPrimaryKeyPolicy(); + if (primaryKeyPolicy == 2 && isSnowFlake) { + primaryKeyPolicy = 1; + } + String pKeyName = flowDataUtil.getKey(conn, mainTable.getTable(), primaryKeyPolicy); + //主表所有数据 + SqlTable mainSqlTable = SqlTable.of(mainTable.getTable()); + SelectStatementProvider render = SqlBuilder.select(mainSqlTable.allColumns()).from(mainSqlTable).where(mainSqlTable.column(pKeyName), + SqlBuilder.isEqualTo(idObj)).build().render(RenderingStrategies.MYBATIS3); + Map mainAllMap = Optional.ofNullable(flowFormDataMapper.selectOneMappedRow(render)).orElse(new HashMap<>()); + if (mainAllMap.size() == 0) { + return vo; + } + //主表 + List mainTableFields = mast.stream().filter(m -> StringUtil.isNotEmpty(m.getFormColumnModel().getFieLdsModel().getVModel())) + .map(s -> + { + String jnpfKey = s.getFormColumnModel().getFieLdsModel().getConfig().getJnpfKey(); + String modelFiled = s.getFormColumnModel().getFieLdsModel().getVModel(); + if (oracle || IS_DM) { + if (jnpfKey.equals(JnpfKeyConsts.UPLOADFZ) || jnpfKey.equals(JnpfKeyConsts.UPLOADIMG) || jnpfKey.equals(JnpfKeyConsts.EDITOR)) { + modelFiled = "dbms_lob.substr( " + modelFiled + ")"; + } + } + return modelFiled; + } + ).collect(Collectors.toList()); + List mainTableBasicColumn = mainTableFields.stream().map(m -> { + if (m.contains("(")) { + String replace = m.replace("dbms_lob.substr(", ""); + String alisaName = replace.replace(")", ""); + return SqlTable.of(mainTable.getTable()).column(m).as(alisaName); + } else { + return SqlTable.of(mainTable.getTable()).column(m); + } + }).collect(Collectors.toList()); + //无字段时查询主键 + mainTableBasicColumn.add(SqlTable.of(mainTable.getTable()).column(pKeyName)); + + SelectStatementProvider mainRender = SqlBuilder.select(mainTableBasicColumn).from(mainSqlTable).where(mainSqlTable.column(pKeyName), + SqlBuilder.isEqualTo(idObj)).build().render(RenderingStrategies.MYBATIS3); + List> mapList = flowFormDataMapper.selectManyMappedRows(mainRender); + if (ObjectUtil.isNotEmpty(mapList) && mapList.size() > 0) { + allDataMap.putAll(mapList.get(0)); + } + + //列表子表 + Map> groupByTableNames = mastTable.stream().map(mt -> mt.getFormMastTableModel()).collect(Collectors.groupingBy(ma -> ma.getTable())); + Iterator>> entryIterator = groupByTableNames.entrySet().iterator(); + while (entryIterator.hasNext()) { + Map.Entry> next = entryIterator.next(); + String childTableName = next.getKey(); + List childMastTableList = next.getValue(); + TableModel childTableModel = tableModelList.stream().filter(t -> t.getTable().equals(childTableName)).findFirst().orElse(null); + SqlTable mastSqlTable = SqlTable.of(childTableName); + List mastTableBasicColumn = childMastTableList.stream().filter(m -> StringUtil.isNotEmpty(m.getField())) + .map(m -> { + String jnpfKey = m.getMastTable().getFieLdsModel().getConfig().getJnpfKey(); + String modelFiled = m.getField(); + String aliasName = ""; + if (oracle || IS_DM) { + if (jnpfKey.equals(JnpfKeyConsts.UPLOADFZ) || jnpfKey.equals(JnpfKeyConsts.UPLOADIMG) || jnpfKey.equals(JnpfKeyConsts.EDITOR)) { + aliasName = m.getField(); + modelFiled = "dbms_lob.substr( " + modelFiled + ")"; + } + } + return StringUtil.isEmpty(aliasName) ? mastSqlTable.column(modelFiled) : mastSqlTable.column(modelFiled).as(aliasName); + }).collect(Collectors.toList()); + //添加副表关联字段,不然数据会空没有字段名称 + mastTableBasicColumn.add(mastSqlTable.column(childTableModel.getTableField())); + String relation = isSnowFlake ? childTableModel.getRelationField().toLowerCase() : TableFeildsEnum.FLOWTASKID.getField(); + String relationValue = String.valueOf(OnlinePublicUtils.mapKeyToLower(mainAllMap).get(relation)); + SelectStatementProvider mastRender = SqlBuilder.select(mastTableBasicColumn).from(mastSqlTable).where(mastSqlTable.column(childTableModel.getTableField()), + SqlBuilder.isEqualTo(relationValue)).build().render(RenderingStrategies.MYBATIS3); + Map soloDataMap = flowFormDataMapper.selectOneMappedRow(mastRender); + if (ObjectUtil.isNotEmpty(soloDataMap)) { + Map renameKeyMap = new HashMap<>(); + for (Map.Entry entry : soloDataMap.entrySet()) { + FormMastTableModel model = childMastTableList.stream().filter(child -> child.getField().equalsIgnoreCase(String.valueOf(entry.getKey()))).findFirst().orElse(null); + if (model != null) { + renameKeyMap.put(model.getVModel(), entry.getValue()); + } + } + List> mapList1 = new ArrayList<>(); + mapList1.add(renameKeyMap); + allDataMap.putAll(mapList1.get(0)); + } + } + + //设计子表 + table.stream().map(t -> t.getChildList()).forEach( + t1 -> { + String childTableName = t1.getTableName(); + TableModel tableModel = tableModelList.stream().filter(tm -> tm.getTable().equals(childTableName)).findFirst().orElse(null); + SqlTable childSqlTable = SqlTable.of(childTableName); + List childFields = t1.getChildList().stream().filter(t2 -> StringUtil.isNotEmpty(t2.getFieLdsModel().getVModel())) + .map( + t2 -> { + String jnpfKey = t2.getFieLdsModel().getConfig().getJnpfKey(); + String modelFiled = t2.getFieLdsModel().getVModel(); + String aliasName = ""; + if (oracle || IS_DM) { + if (jnpfKey.equals(JnpfKeyConsts.UPLOADFZ) || jnpfKey.equals(JnpfKeyConsts.UPLOADIMG) || jnpfKey.equals(JnpfKeyConsts.EDITOR)) { + aliasName = t2.getFieLdsModel().getVModel(); + modelFiled = "dbms_lob.substr( " + modelFiled + ")"; + } + } + return StringUtil.isEmpty(aliasName) ? childSqlTable.column(modelFiled) : childSqlTable.column(modelFiled).as(aliasName); + }).collect(Collectors.toList()); + String relation = Objects.equals(visualdevEntity.getEnableFlow(), 1) && Objects.equals(formData.getPrimaryKeyPolicy(), 2) ? + TableFeildsEnum.FLOWTASKID.getField() : tableModel.getRelationField().toLowerCase(); + String relationValue = String.valueOf(OnlinePublicUtils.mapKeyToLower(mainAllMap).get(relation)); + + SelectStatementProvider childRender = SqlBuilder.select(childFields).from(childSqlTable).where(childSqlTable.column(tableModel.getTableField()), + SqlBuilder.isEqualTo(relationValue)).build().render(RenderingStrategies.MYBATIS3); + List> childMapList = flowFormDataMapper.selectManyMappedRows(childRender); + if (ObjectUtil.isNotEmpty(childMapList)) { + Map childMap = new HashMap<>(1); + childMap.put(t1.getTableModel(), childMapList); + allDataMap.putAll(childMap); + } + } + ); + //数据转换 + List fields = new ArrayList<>(); + OnlinePublicUtils.recursionFields(fields, list); + + VisualDevJsonModel visualJsonModel = OnlinePublicUtils.getVisualJsonModel(visualdevEntity); + ColumnDataModel columnDataModel = visualJsonModel.getColumnData(); + if (!RequestContext.isOrignPc()) { + columnDataModel=visualJsonModel.getAppColumnData(); + } + //编辑表格(行内编辑) + boolean inlineEdit = columnDataModel.getType() != null && columnDataModel.getType() == 4; + allDataResMap = (Map)onlineSwapDataUtils.getSwapInfo(new ArrayList() {{ + add(allDataMap); + }}, fields, visualdevEntity.getId(), inlineEdit, codeList, null).get(0); + } catch (Exception e) { + throw new RuntimeException(e); + } finally { + DynamicDataSourceUtil.clearSwitchDataSource(); + } + vo.setId(id); + vo.setData(JsonUtilEx.getObjectToString(allDataResMap)); + return vo; + } +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/service/impl/VisualDevListServiceImpl.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/service/impl/VisualDevListServiceImpl.java new file mode 100644 index 0000000..aa1a7a5 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/service/impl/VisualDevListServiceImpl.java @@ -0,0 +1,850 @@ +package jnpf.onlinedev.service.impl; + +import com.google.common.collect.Lists; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import jnpf.base.UserInfo; +import jnpf.base.entity.VisualdevShortLinkEntity; +import jnpf.base.model.ColumnDataModel; +import jnpf.base.model.Template6.ColumnListField; +import jnpf.base.model.VisualDevJsonModel; +import jnpf.base.service.DbLinkService; +import jnpf.base.service.FilterService; +import jnpf.base.service.SuperServiceImpl; +import jnpf.base.service.VisualdevShortLinkService; +import jnpf.database.model.entity.DbLinkEntity; +import jnpf.database.model.superQuery.ConditionJsonModel; +import jnpf.database.model.superQuery.SuperJsonModel; +import jnpf.database.model.superQuery.SuperQueryJsonModel; +import jnpf.database.util.ConnUtil; +import jnpf.database.util.DynamicDataSourceUtil; +import jnpf.engine.entity.FlowTaskEntity; +import jnpf.engine.model.flowtemplate.FlowTemplateInfoVO; +import jnpf.engine.service.FlowTaskService; +import jnpf.engine.service.FlowTemplateJsonService; +import jnpf.engine.service.FlowTemplateService; +import jnpf.exception.WorkFlowException; +import jnpf.mapper.FlowFormDataMapper; +import jnpf.model.visualJson.FormCloumnUtil; +import jnpf.model.visualJson.FormDataModel; +import jnpf.model.visualJson.TableModel; +import jnpf.model.visualJson.analysis.FormAllModel; +import jnpf.model.visualJson.FieLdsModel; +import jnpf.model.visualJson.analysis.RecursionForm; +import jnpf.onlinedev.entity.VisualdevModelDataEntity; +import jnpf.onlinedev.mapper.VisualdevModelDataMapper; +import jnpf.onlinedev.model.OnlineDevData; +import jnpf.onlinedev.model.OnlineDevListModel.VisualColumnSearchVO; +import jnpf.onlinedev.model.PaginationModel; +import jnpf.onlinedev.service.VisualDevListService; +import jnpf.onlinedev.util.OnlineDevDbUtil; +import jnpf.onlinedev.util.onlineDevUtil.*; +import jnpf.permission.model.authorize.OnlineDynamicSqlModel; +import jnpf.permission.service.AuthorizeService; +import jnpf.service.FlowFormService; +import jnpf.util.*; +import jnpf.util.visiual.JnpfKeyConsts; +import lombok.Cleanup; +import org.apache.commons.collections4.CollectionUtils; +import org.mybatis.dynamic.sql.*; +import org.mybatis.dynamic.sql.render.RenderingStrategies; +import org.mybatis.dynamic.sql.select.QueryExpressionDSL; +import org.mybatis.dynamic.sql.select.SelectModel; +import org.mybatis.dynamic.sql.select.aggregate.AbstractCount; +import org.mybatis.dynamic.sql.select.join.EqualTo; +import org.mybatis.dynamic.sql.select.render.SelectStatementProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.sql.Connection; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 在线开发列表 + * + * @author JNPF开发平台组 + * @version V3.2.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/7/28 + */ +@Service +public class VisualDevListServiceImpl extends SuperServiceImpl implements VisualDevListService { + + public static List needAllFieldsDB = new ArrayList() {{ + add("Microsoft SQL Server"); + add("DM DBMS"); + add("PostgreSQL"); + add("Oracle"); + add("KingbaseES"); + }}; + public static List needUpcaseFieldsDB = new ArrayList() {{ + add("DM DBMS"); + add("Oracle"); + }}; + @Autowired + private DbLinkService dblinkService; + @Autowired + private FlowTaskService flowTaskService; + @Autowired + private UserProvider userProvider; + @Autowired + private OnlineSwapDataUtils onlineSwapDataUtils; + @Autowired + private FlowFormDataUtil flowFormDataUtil; + @Autowired + private AuthorizeService authorizeService; + @Autowired + private FlowFormDataMapper flowFormDataMapper; + @Autowired + private FlowFormService flowFormService; + @Autowired + private OnlineDevDbUtil onlineDevDbUtil; + @Autowired + private VisualdevShortLinkService visualdevShortLinkService; + @Autowired + private FlowTemplateService flowTemplateService; + @Autowired + private FlowTemplateJsonService flowTemplateJsonService; + @Autowired + private FilterService filterService; + + @Override + public List> getDataList(VisualDevJsonModel visualDevJsonModel, PaginationModel paginationModel) throws WorkFlowException { + List> realList; + ColumnDataModel columnDataModel = visualDevJsonModel.getColumnData(); + FormDataModel formDataModel = visualDevJsonModel.getFormData(); + List fieLdsModels = JsonUtil.getJsonToList(formDataModel.getFields(), FieLdsModel.class); + List visualTables = visualDevJsonModel.getVisualTables(); + //解析所有控件 + RecursionForm recursionForm = new RecursionForm(fieLdsModels, visualTables); + List formAllModel = new ArrayList<>(); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + List searchVOS = new ArrayList<>(); + //判断有无表 + if (visualTables.size() > 0) { + //当前用户信息 + UserInfo userInfo = userProvider.get(); + //菜单id + String moduleId = paginationModel.getMenuId(); + //封装搜索数据 + OnlineProductSqlUtils.queryList(formAllModel, visualDevJsonModel,paginationModel); + realList = this.getListWithTable(visualDevJsonModel, paginationModel, userInfo, moduleId, null); + } else { + realList = this.getWithoutTableData(visualDevJsonModel.getId()); + realList = this.getList(realList, searchVOS, paginationModel); + } + + if (realList.size() < 1) { + return realList; + } + //编辑表格(行内编辑) + boolean inlineEdit = columnDataModel.getType() != null && columnDataModel.getType() == 4; + + //复制父级字段+_id + realList.forEach(item -> { + item.put(columnDataModel.getParentField() + "_id" , item.get(columnDataModel.getParentField())); + }); + //数据转换 + //递归处理控件 + List fields = new ArrayList<>(); + OnlinePublicUtils.recursionFields(fields, fieLdsModels); + visualDevJsonModel.setFormListModels(fields); + realList = onlineSwapDataUtils.getSwapList(realList, fields, visualDevJsonModel.getId(), inlineEdit, new ArrayList<>()); + + //取回传主键 + String pkeyId = visualDevJsonModel.getPkeyId()!=null ? visualDevJsonModel.getPkeyId():TableFeildsEnum.FID.getField(); + //结果集添加id + for (Map objectMap : realList) { + for(String key : objectMap.keySet()){ + if(pkeyId.equalsIgnoreCase(key)){ + objectMap.put("id",objectMap.get(key)); + } + } + } + //树形子字段key + columnDataModel.setSubField(pkeyId); + + //添加流程状态 + if (visualDevJsonModel.isFlowEnable()) { + FlowTemplateInfoVO templateInfo = flowTemplateService.info(visualDevJsonModel.getId()); + if (templateInfo == null) { + throw new WorkFlowException("该功能未配置流程不可用!" ); + } + List ids = realList.stream().map(i -> i.get("id" ).toString()).collect(Collectors.toList()); + List tasks = flowTaskService.getInfosSubmit(ids.toArray(new String[]{}), FlowTaskEntity::getStatus, FlowTaskEntity::getId, FlowTaskEntity::getProcessId); + realList.stream().forEach(m -> { + String id = m.get("id" ).toString(); + m.put("flowState" , "" ); + tasks.forEach(i -> { + if (i.getId().equals(id) || i.getProcessId().equals(id)) { + m.put("flowState" , i.getStatus()); + } + }); + }); + } + return realList; + } + + @Override + public List> getDataListLink(VisualDevJsonModel visualDevJsonModel, PaginationModel paginationModel) throws WorkFlowException { + List> realList; + VisualdevShortLinkEntity shortLinkEnt = visualdevShortLinkService.getById(visualDevJsonModel.getId()); + List listCondition = StringUtil.isNotEmpty(shortLinkEnt.getColumnCondition()) ? JsonUtil.getJsonToList(shortLinkEnt.getColumnCondition(), VisualColumnSearchVO.class) : new ArrayList<>(); + List listFields = StringUtil.isNotEmpty(shortLinkEnt.getColumnCondition()) ? JsonUtil.getJsonToList(shortLinkEnt.getColumnText(), FieLdsModel.class) : new ArrayList<>(); + visualDevJsonModel.setFormListModels(listFields); + FormDataModel formDataModel = visualDevJsonModel.getFormData(); + List visualTables = visualDevJsonModel.getVisualTables(); + //当前用户信息 + UserInfo userInfo = userProvider.get(); + List isBetween=new ArrayList(){{ + add(JnpfKeyConsts.DATE); + add(JnpfKeyConsts.TIME); + }}; + for (VisualColumnSearchVO searchVO : listCondition) { + String jnpfKey = searchVO.getConfig().getJnpfKey(); + searchVO.setSearchType(isBetween.contains(jnpfKey)?"3":"2"); + } + //菜单id + String moduleId = paginationModel.getMenuId(); + ColumnDataModel columnDataModel = new ColumnDataModel(); + List list = JsonUtil.getJsonToList(shortLinkEnt.getColumnText(), ColumnListField.class); + columnDataModel.setColumnList(JsonUtil.getListToJsonArray(list).toJSONString());//查询字段构造 + columnDataModel.setSearchList(JsonUtil.getListToJsonArray(listCondition).toJSONString()); + columnDataModel.setType(1);//普通列表 + visualDevJsonModel.setColumnData(columnDataModel); + //查询 + List fieLdsModels = JsonUtil.getJsonToList(formDataModel.getFields(), FieLdsModel.class); + RecursionForm recursionForm = new RecursionForm(fieLdsModels, visualTables); + List formAllModel = new ArrayList<>(); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + //封装搜索数据 + OnlineProductSqlUtils.queryList(formAllModel, visualDevJsonModel,paginationModel); + realList = this.getListWithTable(visualDevJsonModel, paginationModel, userInfo, moduleId, null); + if (realList.size() < 1) { + return realList; + } + //数据转换 + List fields = new ArrayList<>(); + OnlinePublicUtils.recursionFields(fields, fieLdsModels); + visualDevJsonModel.setFormListModels(fields); + realList = onlineSwapDataUtils.getSwapList(realList, fields, visualDevJsonModel.getId(), false, new ArrayList<>()); + + //添加流程状态 + if (visualDevJsonModel.isFlowEnable()) { + FlowTemplateInfoVO templateInfo = flowTemplateService.info(visualDevJsonModel.getId()); + if (templateInfo == null) { + throw new WorkFlowException("该功能未配置流程不可用!" ); + } + List ids = realList.stream().map(i -> i.get("id" ).toString()).collect(Collectors.toList()); + List tasks = flowTaskService.getInfosSubmit(ids.toArray(new String[]{}), FlowTaskEntity::getStatus, FlowTaskEntity::getId, FlowTaskEntity::getProcessId); + realList.stream().forEach(m -> { + String id = m.get("id" ).toString(); + m.put("flowState" , "" ); + tasks.forEach(i -> { + if (i.getId().equals(id) || i.getProcessId().equals(id)) { + m.put("flowState" , i.getStatus()); + } + }); + }); + } + return realList; + } + + @Override + public List> getList(List> noSwapDataList, List searchVOList, PaginationModel paginationModel) { + if (searchVOList.size() > 0) { + //条件查询 + noSwapDataList = OnlineDevListUtils.getNoSwapList(noSwapDataList, searchVOList); + } + //排序 + if (noSwapDataList.size() > 0) { + if (StringUtil.isNotEmpty(paginationModel.getSidx())) { + //排序处理 + noSwapDataList.sort((o1, o2) -> { + Map i1 = o1; + Map i2 = o2; + String s1 = String.valueOf(i1.get(paginationModel.getSidx())); + String s2 = String.valueOf(i2.get(paginationModel.getSidx())); + if ("desc".equalsIgnoreCase(paginationModel.getSort())) { + return s2.compareTo(s1); + } else { + return s1.compareTo(s2); + } + }); + } + + long total = noSwapDataList.size(); + + //数据分页 + noSwapDataList = PageUtil.getListPage((int) paginationModel.getCurrentPage(), (int) paginationModel.getPageSize(), noSwapDataList); + noSwapDataList = paginationModel.setData(noSwapDataList, total); + } + return noSwapDataList; + } + + @Override + public List> getWithoutTableData(String modelId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(VisualdevModelDataEntity::getVisualDevId, modelId); + List list = this.list(queryWrapper); + List> dataVoList = list.parallelStream().map(t -> { + Map dataMap = JsonUtil.stringToMap(t.getData()); + dataMap.put("id" , t.getId()); + return dataMap; + }).collect(Collectors.toList()); + return dataVoList; + } + + @Override + public List> getListWithTable(VisualDevJsonModel visualDevJsonModel, PaginationModel paginationModel, UserInfo userInfo, String moduleId, List columnPropList) { + ColumnDataModel columnDataModel = visualDevJsonModel.getColumnData(); + List> dataList = new ArrayList<>(); + //数据过滤 + SuperJsonModel ruleQuery = visualDevJsonModel.getRuleQuery(); + //高级搜索 + SuperJsonModel superQuery = visualDevJsonModel.getSuperQuery(); + //列表搜索 + SuperJsonModel query = visualDevJsonModel.getQuery(); + //数据过滤 + List authorizeListAll = visualDevJsonModel.getAuthorize(); + + //数据源 + DbLinkEntity linkEntity = dblinkService.getInfo(visualDevJsonModel.getDbLinkId()); + try { + DynamicDataSourceUtil.switchToDataSource(linkEntity); + @Cleanup Connection connection = ConnUtil.getConnOrDefault(linkEntity); + String databaseProductName = connection.getMetaData().getDatabaseProductName().trim(); + List tableModelList = visualDevJsonModel.getVisualTables(); + //主表 + TableModel mainTable = tableModelList.stream().filter(t -> t.getTypeId().equals("1" )).findFirst().orElse(null); + + List modelList = JsonUtil.getJsonToList(columnDataModel.getColumnList(), ColumnListField.class); + + FormDataModel formData = visualDevJsonModel.getFormData(); + List jsonToList = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + //递归处理控件 + List allFieLds = new ArrayList<>(); + OnlinePublicUtils.recursionFields(allFieLds, jsonToList); + //列表中区别子表正则 + String reg = "^[jnpf_]\\S*_jnpf\\S*"; + + //所有字段 + List collect = columnPropList != null ? columnPropList : modelList.stream().map(mode -> mode.getProp()).collect(Collectors.toList()); + if (OnlineDevData.TYPE_FIVE_COLUMNDATA.equals(columnDataModel.getType()) && !collect.contains(columnDataModel.getParentField())) { + collect.add(columnDataModel.getParentField()); + } + + Map tableFieldAndTableName = new HashMap<>(8); + Map tableNameAndTableField = new HashMap<>(8); + allFieLds.stream().filter(f -> f.getConfig().getJnpfKey().equals(JnpfKeyConsts.CHILD_TABLE)).forEach(f -> { + tableFieldAndTableName.put(f.getVModel(), f.getConfig().getTableName()); + tableNameAndTableField.put(f.getConfig().getTableName(), f.getVModel()); + }); + + Integer primaryKeyPolicy = formData.getPrimaryKeyPolicy(); + if(primaryKeyPolicy==2 && !visualDevJsonModel.isFlowEnable()){ + primaryKeyPolicy=1; + } + String pkeyId = flowFormDataUtil.getKey(connection, mainTable.getTable(), primaryKeyPolicy); + String childpkeyId = pkeyId; + visualDevJsonModel.setPkeyId(pkeyId); + if(!visualDevJsonModel.isFlowEnable() && primaryKeyPolicy==2){ + childpkeyId = flowFormDataUtil.getKey(connection, mainTable.getTable(), 1); + } + + List sqlModelList = new ArrayList<>(); + //根据表字段创建sqltable + for (TableModel model : tableModelList) { + OnlineDynamicSqlModel sqlModel = new OnlineDynamicSqlModel(); + sqlModel.setSqlTable(SqlTable.of(model.getTable())); + sqlModel.setTableName(model.getTable()); + if (model.getTypeId().equals("1" )) { + sqlModel.setMain(true); + } else { + sqlModel.setForeign(model.getTableField()); + sqlModel.setRelationKey(model.getRelationField()); + sqlModel.setMain(false); + } + sqlModelList.add(sqlModel); + } + + OnlineProductSqlUtils.getColumnListSql(sqlModelList, visualDevJsonModel, collect, linkEntity); + //主表 + OnlineDynamicSqlModel mainSqlModel = sqlModelList.stream().filter(OnlineDynamicSqlModel::isMain).findFirst().orElse(null); + //非主表 + List dycList = sqlModelList.stream().filter(dyc -> !dyc.isMain()).collect(Collectors.toList()); + List sqlColumns = new ArrayList<>(); + Map aliasMap = new HashMap<>(); + boolean isOracle = databaseProductName.equalsIgnoreCase("oracle" ); + boolean isDm = databaseProductName.equalsIgnoreCase("DM DBMS" ); + for (OnlineDynamicSqlModel dynamicSqlModel : sqlModelList) { + List basicColumns = Optional.ofNullable(dynamicSqlModel.getColumns()).orElse(new ArrayList<>()); + //达梦或者oracle 别名太长转换-底下有方法进行还原 + if (isOracle||isDm) { + for (int i = 0; i < basicColumns.size(); i++) { + BasicColumn item = basicColumns.get(i); + String alias = item.alias().orElse(null); + if (StringUtil.isNotEmpty(alias)) { + String aliasNewName = "A" + RandomUtil.uuId(); + aliasMap.put(aliasNewName, alias); + basicColumns.set(i, item.as(aliasNewName)); + } + } + } + sqlColumns.addAll(basicColumns); + } + QueryExpressionDSL from = SqlBuilder.select(sqlColumns).from(mainSqlModel.getSqlTable()); + AbstractCount countDistinct; + if(tableModelList.size()>1){ + countDistinct=SqlBuilder.countDistinct(mainSqlModel.getSqlTable().column(pkeyId)); + }else { + countDistinct = SqlBuilder.count(mainSqlModel.getSqlTable().column(pkeyId)); + } + QueryExpressionDSL fromcount = SqlBuilder.select(countDistinct).from(mainSqlModel.getSqlTable()); + + // 构造table和table下字段的分组 + Map> tableFieldGroup = new HashMap<>(8); + allFieLds.forEach(f->{ + tableFieldGroup.computeIfAbsent(f.getConfig().getTableName(), k -> new ArrayList<>()).add( + "table".equals(f.getConfig().getType()) ? f.getConfig().getTableName() : f.getVModel() + ); + }); + Map subSqlTableMap = new HashMap<>(); + if (dycList.size() > 0) { + for (OnlineDynamicSqlModel sqlModel : dycList) { + String relationKey = primaryKeyPolicy == 2 ? childpkeyId : sqlModel.getRelationKey(); + //postgresql自增 int和varchar无法对比-添加以下判断 + if(Objects.equals(formData.getPrimaryKeyPolicy(),2) && "PostgreSQL".equalsIgnoreCase(databaseProductName)){ + relationKey += "::varchar"; + } + from.leftJoin(sqlModel.getSqlTable()) + .on(sqlModel.getSqlTable().column(sqlModel.getForeign()), new EqualTo(mainSqlModel.getSqlTable().column(relationKey))); + fromcount.leftJoin(sqlModel.getSqlTable()) + .on(sqlModel.getSqlTable().column(sqlModel.getForeign()), new EqualTo(mainSqlModel.getSqlTable().column(relationKey))); + String tableName = sqlModel.getTableName(); + List fieldList = tableFieldGroup.get(tableName); + if(fieldList!=null){ + fieldList.forEach(fieldKey->{ + subSqlTableMap.put(fieldKey, sqlModel.getSqlTable()); + }); + } + } + } + + QueryExpressionDSL.QueryExpressionWhereBuilder where = from.where(); + QueryExpressionDSL.QueryExpressionWhereBuilder whereCount = fromcount.where(); + + //逻辑删除不展示 + if (visualDevJsonModel.getFormData().getLogicalDelete()) { + where.and(mainSqlModel.getSqlTable().column(TableFeildsEnum.DELETEMARK.getField()), SqlBuilder.isNull()); + whereCount.and(mainSqlModel.getSqlTable().column(TableFeildsEnum.DELETEMARK.getField()), SqlBuilder.isNull()); + } + //查询条件sql + OnlineProductSqlUtils.getSuperSql(where, query, sqlModelList, databaseProductName,null,false); + OnlineProductSqlUtils.getSuperSql(whereCount, query, sqlModelList, databaseProductName,null,false); + + //高级查询 + OnlineProductSqlUtils.getSuperSql(where, superQuery, sqlModelList, databaseProductName,null,false); + OnlineProductSqlUtils.getSuperSql(whereCount, superQuery, sqlModelList, databaseProductName,null,false); + + // 数据过滤 + OnlineProductSqlUtils.getSuperSql(where, ruleQuery, sqlModelList, databaseProductName,null,false); + OnlineProductSqlUtils.getSuperSql(whereCount, ruleQuery, sqlModelList, databaseProductName,null,false); + + //数据权限 + if (columnDataModel.getUseDataPermission() != null && columnDataModel.getUseDataPermission()) { + if (!userInfo.getIsAdministrator()) { + if(authorizeListAll.size()==0){ + return new ArrayList<>(); + } + OnlineProductSqlUtils.getSuperSql(where, authorizeListAll, sqlModelList, databaseProductName,null); + OnlineProductSqlUtils.getSuperSql(whereCount, authorizeListAll, sqlModelList, databaseProductName,null); + } + } + + //排序 + String sort = StringUtil.isNotEmpty(paginationModel.getSort()) ? paginationModel.getSort() : "ASC"; + String sidx = StringUtil.isNotEmpty(paginationModel.getSidx()) ? paginationModel.getSidx() : pkeyId; + String sortTableName; + String sortField; + if (sidx.matches(reg)) { + sortField = sidx.substring(sidx.lastIndexOf("jnpf_" )).replace("jnpf_" , "" ); + sortTableName = sidx.substring(sidx.indexOf("_" ) + 1, sidx.lastIndexOf("_jnpf" )); + } else { + sortTableName = mainTable.getTable(); + sortField = sidx; + } + SqlColumn sortCol = SqlTable.of(sortTableName).column(sortField); + SortSpecification sortSpecification = SqlBuilder.sortColumn(sortTableName, sortCol); + if (sort.equalsIgnoreCase("ASC" )) { + where.orderBy(sortSpecification); + } else { + where.orderBy(sortSpecification.descending()); + } + + if(tableModelList.size()>1) { + if (needAllFieldsDB.contains(databaseProductName)) { + List groupBySqlTable = OnlineProductSqlUtils.getGroupBySqlTable(sqlModelList, visualDevJsonModel, collect,needUpcaseFieldsDB.contains(databaseProductName)); + //判断列表有无FLOWTASKID FLOWID字段强拼 + sqlColumns.stream().forEach(t -> { + SqlColumn n = (SqlColumn) t; + getGroupFeild(TableFeildsEnum.FLOWTASKID, n, databaseProductName, groupBySqlTable, mainTable); + getGroupFeild(TableFeildsEnum.FLOWID, n, databaseProductName, groupBySqlTable, mainTable); + }); + groupBySqlTable.add(SqlTable.of(mainTable.getTable()).column(pkeyId)); + where.groupBy(groupBySqlTable); + } else { + where.groupBy(SqlTable.of(mainTable.getTable()).column(pkeyId)); + } + } + + // 1导出全部 0导出当前页 null 列表分页 + long count=0; + if (paginationModel.getDataType() == null) { + SelectStatementProvider renderCount = whereCount.build().render(RenderingStrategies.MYBATIS3); + count= flowFormDataMapper.count(renderCount); + if(count == 0){ + return new ArrayList<>(); + } + //树形和分组不需要分页。有脏数据传添加判断 + if(!Objects.equals(columnDataModel.getType(),5)&& !Objects.equals(columnDataModel.getType(),3)){ + PageHelper.startPage((int) paginationModel.getCurrentPage(), (int) paginationModel.getPageSize(), false); + } + } else if ("0".equals(paginationModel.getDataType()) && !Objects.equals(columnDataModel.getType(),5)&& !Objects.equals(columnDataModel.getType(),3)) { + //where.limit(paginationModel.getPageSize()).offset((paginationModel.getCurrentPage()-1) * paginationModel.getPageSize()); + PageHelper.startPage((int) paginationModel.getCurrentPage(), (int) paginationModel.getPageSize(), false); + } + //分页语句放在最后执行, 后面不允许查询数据库, 否则分页失效 + SelectStatementProvider render = where.build().render(RenderingStrategies.MYBATIS3); + dataList = flowFormDataMapper.selectManyMappedRows(render); + + String finalPkeyId = childpkeyId; + List idStringList = dataList.stream().map(m -> m.get(finalPkeyId).toString()).distinct().collect(Collectors.toList()); + if (idStringList.size() > 0) { + //处理子表 + List tableFields = collect.stream().filter(c -> c.toLowerCase().contains(JnpfKeyConsts.CHILD_TABLE_PREFIX)).collect(Collectors.toList()); + List childTableModels = tableModelList.stream().filter(t -> t.getTypeId().equals("0" )).collect(Collectors.toList()); + Map> tableMap = tableFields.stream().collect(Collectors.groupingBy(t -> t.substring(0, t.lastIndexOf("-" )))); + for (TableModel tableModel : childTableModels) { + String table = tableModel.getTable(); + String tableField = tableNameAndTableField.get(table); + String fogID = tableModel.getTableField(); + List childFields = tableMap.get(tableField); + FieLdsModel fieLdsModel = allFieLds.stream().filter(item -> item.getVModel().equals(tableField)).findFirst().orElse(null); + List childrenFieLdsModel = fieLdsModel != null ? fieLdsModel.getConfig().getChildren() : Collections.EMPTY_LIST; + if (childFields != null) { + OnlineDynamicSqlModel onlineDynamicSqlModel = sqlModelList.stream().filter(s -> s.getTableName().equalsIgnoreCase(table)).findFirst().orElse(null); + SqlTable childSqlTable = onlineDynamicSqlModel.getSqlTable(); + List childSqlColumns = new ArrayList<>(); + for (String c : childFields) { + String childT = c.substring(0, c.lastIndexOf("-" )); + String childF = c.substring(c.lastIndexOf("-" ) + 1); + FieLdsModel thisFieLdsModel = childrenFieLdsModel.stream().filter(item -> item.getVModel().equals(childF)).findFirst().orElse(null); + SqlColumn column = childSqlTable.column(childF); + if ((isDm||isOracle) && thisFieLdsModel != null) { + String jnpfKey = thisFieLdsModel.getConfig().getJnpfKey(); + if (jnpfKey.equals(JnpfKeyConsts.UPLOADFZ) || jnpfKey.equals(JnpfKeyConsts.UPLOADIMG) || jnpfKey.equals(JnpfKeyConsts.EDITOR)) { + column = childSqlTable.column("dbms_lob.substr(" + childF + ")" ).as(childF); + } + } + childSqlColumns.add(column); + } + childSqlColumns.add(childSqlTable.column(fogID)); + QueryExpressionDSL.QueryExpressionWhereBuilder childWhere = SqlBuilder.select(childSqlColumns).from(childSqlTable).where(); + childWhere.and(childSqlTable.column(fogID), SqlBuilder.isIn(idStringList)); + //查询条件sql + OnlineProductSqlUtils.getSuperSql(childWhere, query, sqlModelList, databaseProductName,table,false); + //高级查询 + OnlineProductSqlUtils.getSuperSql(childWhere, superQuery, sqlModelList, databaseProductName,table,false); + // 数据过滤 + OnlineProductSqlUtils.getSuperSql(childWhere, ruleQuery, sqlModelList, databaseProductName,table,false); + //数据权限 + if (columnDataModel.getUseDataPermission() != null && columnDataModel.getUseDataPermission()) { + if (!userInfo.getIsAdministrator()) { + OnlineProductSqlUtils.getSuperSql(childWhere, authorizeListAll, sqlModelList, databaseProductName,table); + } + } + SelectStatementProvider childRender = childWhere.build().render(RenderingStrategies.MYBATIS3); + List> mapList = flowFormDataMapper.selectManyMappedRows(childRender); + Map>> idMap = mapList.stream().collect(Collectors.groupingBy(m -> m.get(fogID).toString())); + + for (Map m : dataList) { + String s = m.get(childpkeyId).toString(); + Map valueMap = new HashMap<>(); + valueMap.put(tableField, idMap.get(s)); + m.putAll(valueMap); + } + } + } + } else { + return new ArrayList<>(); + } + dataList.stream().forEach(data -> { + data.put("id" , String.valueOf(data.get(finalPkeyId))); + if (visualDevJsonModel.isFlowEnable()) {//有开启流程需要查询流程引擎id + String flwoId = null; + if(data.get(TableFeildsEnum.FLOWID.getField())!=null){ + flwoId = String.valueOf(data.get(TableFeildsEnum.FLOWID.getField())); + } + if(data.get(TableFeildsEnum.FLOWID.getField().toUpperCase())!=null){ + flwoId = String.valueOf(data.get(TableFeildsEnum.FLOWID.getField().toUpperCase())); + } + data.put(FlowFormConstant.FLOWID ,flwoId); + } + }); + + //别名key还原 + setAliasKey(dataList, aliasMap); + + PageInfo pageInfo = new PageInfo(dataList); + paginationModel.setTotal(count); + paginationModel.setCurrentPage(pageInfo.getPageNum()); + + } catch (Exception e) { + e.printStackTrace(); + } finally { + DynamicDataSourceUtil.clearSwitchDataSource(); + } + return dataList; + } + + private List superQueryList(List queryJsonModels,Map tableFieldAndTableName,String mainTable){ + List superQueryList = new ArrayList<>(); + for(SuperQueryJsonModel jsonModel : queryJsonModels){ + List conditionList = JsonUtil.getJsonToList(jsonModel.getGroups(), FieLdsModel.class); + for (FieLdsModel fieLdsModel : conditionList) { + ConditionJsonModel sup = JsonUtil.getJsonToBean(fieLdsModel,ConditionJsonModel.class); + sup.setTableName(fieLdsModel.getConfig().getRelationTable()); + String field = sup.getField(); + String mastKey = fieLdsModel.getConfig().getJnpfKey(); + if (field.toLowerCase().contains(JnpfKeyConsts.CHILD_TABLE_PREFIX)) { + String substring = field.substring(field.lastIndexOf("-" ) + 1); + String tableField = field.substring(0, field.indexOf("-" )); + sup.setField(substring); + sup.setTableName(tableFieldAndTableName.get(tableField)); + } else if (StringUtil.isEmpty(sup.getTableName())) { + sup.setTableName(mainTable); + } + if (mastKey.equals(JnpfKeyConsts.CHECKBOX) || mastKey.equals(JnpfKeyConsts.ADDRESS) || mastKey.equals(JnpfKeyConsts.CASCADER) || mastKey.equals(JnpfKeyConsts.COMSELECT)) { + fieLdsModel.setMultiple(true); + } + if (fieLdsModel.getMultiple() && StringUtil.isEmpty(sup.getFieldValue())) { + sup.setFieldValue("[]" ); + } + superQueryList.add(sup); + } + } + return superQueryList; + } + + private void getGroupFeild(TableFeildsEnum flowid, SqlColumn n, String databaseProductName, List groupBySqlTable, TableModel mainTable) { + if (flowid.getField().equalsIgnoreCase(n.name())) { + if (needUpcaseFieldsDB.contains(databaseProductName)) { + groupBySqlTable.add(SqlTable.of(mainTable.getTable()).column(flowid.getField().toUpperCase())); + }else{ + groupBySqlTable.add(SqlTable.of(mainTable.getTable()).column(flowid.getField())); + } + } + } + + @Override + public List> getRelationFormList(VisualDevJsonModel visualDevJsonModel, PaginationModel paginationModel) { + FormDataModel formData = visualDevJsonModel.getFormData(); + List collect = Arrays.asList(paginationModel.getColumnOptions().split("," )); + List fieLdsModels = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + + List mainFieldModelList = new ArrayList<>(); + + + List> noSwapDataList = new ArrayList<>(); + List searchVOList = new ArrayList<>(); + //列表中区别子表正则 + String reg = "^[jnpf_]\\S*_jnpf\\S*"; + //查询的关键字 + String keyword = paginationModel.getKeyword(); + //判断有无表 + if (visualDevJsonModel.getVisualTables().size() > 0) { + try { + List tableModelList = JsonUtil.getJsonToList(visualDevJsonModel.getVisualTables(), TableModel.class); + + + OnlinePublicUtils.recursionFields(mainFieldModelList, fieLdsModels); + + //主表 + TableModel mainTable = tableModelList.stream().filter(t -> t.getTypeId().equals("1" )).findFirst().orElse(null); + + DbLinkEntity linkEntity = dblinkService.getInfo(visualDevJsonModel.getDbLinkId()); + + List sqlModelList = new ArrayList<>(); + //根据表字段创建sqltable + for (TableModel model : tableModelList) { + OnlineDynamicSqlModel sqlModel = new OnlineDynamicSqlModel(); + sqlModel.setSqlTable(SqlTable.of(model.getTable())); + sqlModel.setTableName(model.getTable()); + if (model.getTypeId().equals("1" )) { + sqlModel.setMain(true); + } else { + sqlModel.setForeign(model.getTableField()); + sqlModel.setRelationKey(model.getRelationField()); + sqlModel.setMain(false); + } + sqlModelList.add(sqlModel); + } + + //判断是否分页 + Boolean isPage = paginationModel.getPageSize() > 500 ? false : true; + OnlineProductSqlUtils.getColumnListSql(sqlModelList, visualDevJsonModel, collect, linkEntity); + DynamicDataSourceUtil.switchToDataSource(linkEntity); + @Cleanup Connection connection = ConnUtil.getConnOrDefault(linkEntity); + //主表 + OnlineDynamicSqlModel mainSqlModel = sqlModelList.stream().filter(OnlineDynamicSqlModel::isMain).findFirst().orElse(null); + //非主表 + List dycList = sqlModelList.stream().filter(dyc -> !dyc.isMain()).collect(Collectors.toList()); + List sqlColumns = new ArrayList<>(); + for (OnlineDynamicSqlModel dynamicSqlModel : sqlModelList) { + List basicColumns = Optional.ofNullable(dynamicSqlModel.getColumns()).orElse(new ArrayList<>()); + sqlColumns.addAll(basicColumns); + } + QueryExpressionDSL from = SqlBuilder.select(sqlColumns).from(mainSqlModel.getSqlTable()); + + if (dycList.size() > 0) { + for (OnlineDynamicSqlModel sqlModel : dycList) { + from.leftJoin(sqlModel.getSqlTable()).on(sqlModel.getSqlTable().column(sqlModel.getForeign()), new EqualTo(mainSqlModel.getSqlTable().column(sqlModel.getRelationKey()))); + } + } + QueryExpressionDSL.QueryExpressionWhereBuilder where = from.where(); + + //逻辑删除不展示 + if (visualDevJsonModel.getFormData().getLogicalDelete()) { + where.and(mainSqlModel.getSqlTable().column(TableFeildsEnum.DELETEMARK.getField()), SqlBuilder.isNull()); + } + + Integer primaryKeyPolicy = visualDevJsonModel.getFormData().getPrimaryKeyPolicy(); + if(primaryKeyPolicy==2 && !visualDevJsonModel.isFlowEnable()){ + primaryKeyPolicy=1; + } + String pkeyId = flowFormDataUtil.getKey(connection, mainTable.getTable(), primaryKeyPolicy); + visualDevJsonModel.setPkeyId(pkeyId); + + //排序 + String sort = StringUtil.isNotEmpty(paginationModel.getSort()) ? paginationModel.getSort() : "ASC"; + String sidx = StringUtil.isNotEmpty(paginationModel.getSidx()) ? paginationModel.getSidx() : pkeyId; + String sortTableName; + String sortField; + if (sidx.matches(reg)) { + sortField = sidx.substring(sidx.lastIndexOf("jnpf_" )).replace("jnpf_" , "" ); + sortTableName = sidx.substring(sidx.indexOf("_" ) + 1, sidx.lastIndexOf("_jnpf" )); + } else { + sortTableName = mainTable.getTable(); + sortField = sidx; + } + SqlColumn sortCol = SqlTable.of(sortTableName).column(sortField); + if (sort.equalsIgnoreCase("ASC" )) { + where.orderBy(sortCol); + } else { + where.orderBy(sortCol.descending()); + } + + String databaseProductName = connection.getMetaData().getDatabaseProductName().trim(); + if(tableModelList.size()>1) { + if (needAllFieldsDB.contains(databaseProductName)) { + List groupBySqlTable = OnlineProductSqlUtils.getGroupBySqlTable(sqlModelList, visualDevJsonModel, collect,needUpcaseFieldsDB.contains(databaseProductName)); + //判断列表有无FLOWTASKID FLOWID字段强拼 + sqlColumns.stream().forEach(t -> { + SqlColumn n = (SqlColumn) t; + getGroupFeild(TableFeildsEnum.FLOWTASKID, n, databaseProductName, groupBySqlTable, mainTable); + getGroupFeild(TableFeildsEnum.FLOWID, n, databaseProductName, groupBySqlTable, mainTable); + }); + groupBySqlTable.add(SqlTable.of(mainTable.getTable()).column(pkeyId)); + where.groupBy(groupBySqlTable); + } else { + where.groupBy(SqlTable.of(mainTable.getTable()).column(pkeyId)); + } + } + + //是否导出全部数据(是否分页) +// PageHelper.startPage((int) paginationModel.getCurrentPage(), (int) paginationModel.getPageSize()); +// where.limit(paginationModel.getPageSize()).offset((paginationModel.getCurrentPage()-1) * paginationModel.getPageSize()); + SelectStatementProvider render = where.build().render(RenderingStrategies.MYBATIS3); + List> dataList = flowFormDataMapper.selectManyMappedRows(render); + + noSwapDataList = dataList.stream().map(data -> { + data.put("id" , String.valueOf(data.get(pkeyId))); + return data; + }).collect(Collectors.toList()); + + //第二种 有关键字不分页 + if (StringUtil.isNotEmpty(keyword)) { + for (FieLdsModel fieldsModel : mainFieldModelList) { + if (fieldsModel.getVModel() != null) { + boolean b = collect.stream().anyMatch(c -> fieldsModel.getVModel().equalsIgnoreCase(c)); + //组装为查询条件 + if (b) { + VisualColumnSearchVO vo = new VisualColumnSearchVO(); + vo.setSearchType("2" ); + vo.setVModel(fieldsModel.getVModel()); + vo.setValue(keyword); + vo.setConfig(fieldsModel.getConfig()); + Boolean multiple = fieldsModel.getMultiple(); + vo.setMultiple(multiple); + searchVOList.add(vo); + } + } + } + noSwapDataList = onlineSwapDataUtils.getSwapList(noSwapDataList, mainFieldModelList, visualDevJsonModel.getId(), false, new ArrayList<>()); + + noSwapDataList = RelationFormUtils.getRelationListByKeyword(noSwapDataList, searchVOList); + } else { + noSwapDataList = onlineSwapDataUtils.getSwapList(noSwapDataList, mainFieldModelList, visualDevJsonModel.getId(), false, new ArrayList<>()); + } + //假分页 + if(isPage){ + if (CollectionUtils.isNotEmpty(noSwapDataList)) { + paginationModel.setTotal(noSwapDataList.size()); + List>> partition = Lists.partition(noSwapDataList, (int) paginationModel.getPageSize()); + noSwapDataList = partition.get((int) paginationModel.getCurrentPage() - 1); + } + } + } catch (Exception e) { + e.printStackTrace(); + } finally { + DynamicDataSourceUtil.clearSwitchDataSource(); + } + } + if (noSwapDataList.size() < 1) { + return new ArrayList<>(); + } + return noSwapDataList; + } + + /** + * 达梦或者oracle 别名太长转换-别名还原 + * + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2023/3/16 + */ + private void setAliasKey(List> dataList, Map aliasMap) { + if (dataList.size() > 0 && aliasMap.size() > 0) { + for (int i = 0; i < dataList.size(); i++) { + Map objMap = dataList.get(i); + Set aliasKey = aliasMap.keySet(); + Map newObj = new HashMap<>(); + for (String key : objMap.keySet()) { + Object value = objMap.get(key); + String oldKey = aliasMap.get(key); + if (aliasKey.contains(key)) { + newObj.put(oldKey, value); + } else { + newObj.put(key, value); + } + } + dataList.remove(i); + dataList.add(i, newObj); + } + } + } +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/service/impl/VisualdevModelDataServiceImpl.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/service/impl/VisualdevModelDataServiceImpl.java new file mode 100644 index 0000000..7b9fa01 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/service/impl/VisualdevModelDataServiceImpl.java @@ -0,0 +1,456 @@ +package jnpf.onlinedev.service.impl; + + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import jnpf.base.ActionResult; +import jnpf.base.UserInfo; +import jnpf.base.entity.VisualdevEntity; +import jnpf.base.entity.VisualdevReleaseEntity; +import jnpf.base.model.ColumnDataModel; +import jnpf.base.model.FormDataField; +import jnpf.base.model.VisualDevJsonModel; +import jnpf.base.service.DbLinkService; +import jnpf.base.service.SuperServiceImpl; +import jnpf.base.service.VisualdevReleaseService; +import jnpf.base.service.VisualdevService; +import jnpf.constant.MsgCode; +import jnpf.database.model.entity.DbLinkEntity; +import jnpf.engine.entity.FlowTaskEntity; +import jnpf.engine.service.FlowTaskService; +import jnpf.exception.DataException; +import jnpf.exception.WorkFlowException; +import jnpf.model.flow.DataModel; +import jnpf.model.visualJson.FieLdsModel; +import jnpf.model.visualJson.FormCloumnUtil; +import jnpf.model.visualJson.FormDataModel; +import jnpf.model.visualJson.TableModel; +import jnpf.model.visualJson.analysis.FormAllModel; +import jnpf.model.visualJson.analysis.FormModel; +import jnpf.model.visualJson.analysis.RecursionForm; +import jnpf.onlinedev.entity.VisualdevModelDataEntity; +import jnpf.onlinedev.mapper.VisualdevModelDataMapper; +import jnpf.onlinedev.model.OnlineDevData; +import jnpf.onlinedev.model.OnlineDevListModel.VisualColumnSearchVO; +import jnpf.onlinedev.model.PaginationModel; +import jnpf.onlinedev.model.PaginationModelExport; +import jnpf.onlinedev.model.VisualdevModelDataInfoVO; +import jnpf.onlinedev.service.VisualDevListService; +import jnpf.onlinedev.service.VisualdevModelDataService; +import jnpf.onlinedev.util.OnlineDevDbUtil; +import jnpf.onlinedev.util.onlineDevUtil.OnlineDevInfoUtils; +import jnpf.onlinedev.util.onlineDevUtil.OnlineProductSqlUtils; +import jnpf.onlinedev.util.onlineDevUtil.OnlinePublicUtils; +import jnpf.onlinedev.util.onlineDevUtil.OnlineSwapDataUtils; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.UserService; +import jnpf.util.*; +import jnpf.util.context.RequestContext; +import jnpf.util.visiual.JnpfKeyConsts; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.io.IOException; +import java.sql.SQLException; +import java.text.ParseException; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/3/16 + */ +@Service +public class VisualdevModelDataServiceImpl extends SuperServiceImpl implements VisualdevModelDataService { + + @Autowired + private UserProvider userProvider; + @Autowired + private UserService userApi; + @Autowired + private DbLinkService dblinkService; + @Autowired + private VisualdevService visualdevService; + @Autowired + private VisualdevReleaseService visualdevReleaseService; + @Autowired + private VisualDevListService visualDevListService; + @Autowired + private OnlineSwapDataUtils onlineSwapDataUtils; + @Autowired + private OnlineDevInfoUtils onlineDevInfoUtils; + @Autowired + private OnlineDevDbUtil onlineDevDbUtil; + @Autowired + private FlowFormDataUtil flowFormDataUtil; + @Autowired + private FormCheckUtils formCheckUtils; + @Autowired + private FlowTaskService flowTaskApi; + + + @Override + public List getList(String modelId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(VisualdevModelDataEntity::getVisualDevId, modelId); + return this.list(queryWrapper); + } + + /** + * 表单字段 + * @param id + * @param filterType 过滤类型,0或者不传为默认过滤子表和关联表单,1-弹窗配置需要过滤掉的类型 + * @return + */ + @Override + public List fieldList(String id, Integer filterType) { + VisualdevReleaseEntity entity = visualdevReleaseService.getById(id); + FormDataModel formData = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + + List fieLdsModelList = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + List mainFieldModelList = new ArrayList<>(); + + OnlinePublicUtils.recursionFields(mainFieldModelList,fieLdsModelList); + //过滤掉无法传递的组件 + List notInList=new ArrayList<>(); + notInList.add(JnpfKeyConsts.RELATIONFORM); + notInList.add(JnpfKeyConsts.CHILD_TABLE); + if (Objects.equals(filterType,1)) { + notInList.add("link"); + notInList.add("button"); + notInList.add("JNPFText"); + notInList.add("alert"); + notInList.add(JnpfKeyConsts.POPUPSELECT); + notInList.add(JnpfKeyConsts.QR_CODE); + notInList.add(JnpfKeyConsts.BARCODE); + notInList.add(JnpfKeyConsts.BILLRULE); + notInList.add(JnpfKeyConsts.CREATEUSER); + notInList.add(JnpfKeyConsts.CREATETIME); + notInList.add(JnpfKeyConsts.UPLOADIMG); + notInList.add(JnpfKeyConsts.UPLOADFZ); + notInList.add(JnpfKeyConsts.MODIFYUSER); + notInList.add(JnpfKeyConsts.MODIFYTIME); + } + + List formDataFieldList = mainFieldModelList.stream().filter(fieLdsModel -> + !"".equals(fieLdsModel.getVModel()) + && StringUtil.isNotEmpty(fieLdsModel.getVModel()) + && !notInList.contains(fieLdsModel.getConfig().getJnpfKey()) + ).map(fieLdsModel -> { + FormDataField formDataField = new FormDataField(); + formDataField.setLabel(fieLdsModel.getConfig().getLabel()); + formDataField.setVModel(fieLdsModel.getVModel()); + return formDataField; + }).collect(Collectors.toList()); + + return formDataFieldList; + } + + @Override + public List> getPageList(VisualdevEntity entity, PaginationModel paginationModel) { + String json = null; + if (StringUtil.isNotEmpty(paginationModel.getKeyword())) { + Map map = new HashMap<>(); + map.put(paginationModel.getRelationField(), paginationModel.getKeyword()); + json = JsonUtil.getObjectToString(map); + } + paginationModel.setQueryJson(json); + VisualDevJsonModel visualJsonModel = OnlinePublicUtils.getVisualJsonModel(entity); + + //判断请求客户端来源 + if (!RequestContext.isOrignPc()){ + visualJsonModel.setColumnData(visualJsonModel.getAppColumnData()); + } + List> dataList = visualDevListService.getRelationFormList(visualJsonModel, paginationModel); + return dataList; + } + + @Override + public List> exportData(String[] keys, PaginationModelExport paginationModelExport, VisualDevJsonModel visualDevJsonModel) { + PaginationModel paginationModel =new PaginationModel(); + BeanUtil.copyProperties(paginationModelExport,paginationModel); + List keyList = Arrays.asList(keys); + List> noSwapDataList; + ColumnDataModel columnDataModel = visualDevJsonModel.getColumnData(); + List searchVOList = new ArrayList<>(); + List visualTables = visualDevJsonModel.getVisualTables(); + TableModel mainTable = visualTables.stream().filter(vi -> vi.getTypeId().equals("1")).findFirst().orElse(null); + //解析控件 + FormDataModel formDataModel = visualDevJsonModel.getFormData(); + List fieLdsModels = JsonUtil.getJsonToList(formDataModel.getFields(), FieLdsModel.class); + RecursionForm recursionForm = new RecursionForm(fieLdsModels, visualTables); + List formAllModel = new ArrayList<>(); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + //封装查询条件 + if (StringUtil.isNotEmpty(paginationModel.getQueryJson())){ + Map keyJsonMap = JsonUtil.stringToMap(paginationModel.getQueryJson()); + searchVOList= JsonUtil.getJsonToList(columnDataModel.getSearchList(),VisualColumnSearchVO.class); + searchVOList = searchVOList.stream().map(searchVO->{ + searchVO.setValue(keyJsonMap.get(searchVO.getId())); + return searchVO; + }).filter(vo->vo.getValue()!=null && StringUtil.isNotEmpty(String.valueOf(vo.getValue()))).collect(Collectors.toList()); + //左侧树查询 + boolean b =false; + if (columnDataModel.getTreeRelation()!=null){ + b = keyJsonMap.keySet().stream().anyMatch(t -> t.equalsIgnoreCase(String.valueOf(columnDataModel.getTreeRelation()))); + } + if (b && keyJsonMap.size()>searchVOList.size()){ + String relation =String.valueOf(columnDataModel.getTreeRelation()); + VisualColumnSearchVO vo =new VisualColumnSearchVO(); + vo.setSearchType("1"); + vo.setVModel(relation); + vo.setValue(keyJsonMap.get(relation)); + searchVOList.add(vo); + } + } + //判断有无表 + List searchVOS = new ArrayList<>(); + if (visualDevJsonModel.getVisualTables().size()>0){ + //当前用户信息 + UserInfo userInfo = userProvider.get(); + //菜单id + String moduleId = paginationModel.getMenuId(); + //封装搜索数据 + OnlineProductSqlUtils.queryList(formAllModel,visualDevJsonModel,paginationModel); + noSwapDataList =visualDevListService.getListWithTable(visualDevJsonModel,paginationModel,userInfo,moduleId,keyList); + }else{ + noSwapDataList =visualDevListService.getWithoutTableData(visualDevJsonModel.getId()); + noSwapDataList = visualDevListService.getList(noSwapDataList, searchVOList, paginationModel); + } + + //数据转换 + List fields = new ArrayList<>(); + OnlinePublicUtils.recursionFields(fields, fieLdsModels); + noSwapDataList = onlineSwapDataUtils.getSwapList(noSwapDataList, fields,visualDevJsonModel.getId(),false,new ArrayList<>()); + + return noSwapDataList; + } + + + @Override + public VisualdevModelDataEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(VisualdevModelDataEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public VisualdevModelDataInfoVO infoDataChange(String id, VisualdevEntity visualdevEntity) throws IOException, ParseException, DataException, SQLException { + FormDataModel formDataModel = JsonUtil.getJsonToBean(visualdevEntity.getFormData(), FormDataModel.class); + List modelList = JsonUtil.getJsonToList(formDataModel.getFields(), FieLdsModel.class); + + VisualdevModelDataEntity visualdevModelDataEntity = this.getInfo(id); + + List childFieldModelList = new ArrayList<>(); + List mainFieldModelList = new ArrayList<>(); + //二维码 条形码 + List models = new ArrayList<>(); + OnlinePublicUtils.recurseFiled(modelList, mainFieldModelList,childFieldModelList,models); + + if (visualdevModelDataEntity != null) { + Map DataMap = JsonUtil.stringToMap(visualdevModelDataEntity.getData()); + Map childTableMap = DataMap.entrySet().stream().filter(m -> m.getKey().contains("tableField")) + .collect(Collectors.toMap((e) -> (String) e.getKey(), + (e) -> ObjectUtil.isNotEmpty(e.getValue()) ? e.getValue() : "")); + Map mainTableMap = DataMap.entrySet().stream().filter(m -> !m.getKey().contains("tableField")) + .collect(Collectors.toMap((e) -> (String) e.getKey(), + (e) -> ObjectUtil.isNotEmpty(e.getValue()) ? e.getValue() : "")); + mainTableMap = onlineDevInfoUtils.swapChildTableDataInfo(mainFieldModelList, mainTableMap,models); + + for (Map.Entry entry : childTableMap.entrySet()){ + List> listMap = JsonUtil.getJsonToListMap(String.valueOf(entry.getValue())); + FieLdsModel fieLdsModel = childFieldModelList.stream().filter(child -> child.getVModel().equalsIgnoreCase(entry.getKey())).findFirst().orElse(null); + if (ObjectUtil.isNotEmpty(fieLdsModel)){ + List> tableValueList = new ArrayList<>(); + if (Objects.nonNull(listMap)){ + for (Map map : listMap){ + Map childFieldMap = onlineDevInfoUtils.swapChildTableDataInfo(fieLdsModel.getConfig().getChildren(),map,models); + tableValueList.add(childFieldMap); + } + } + Map childFieldsMap = new HashMap<>(); + childFieldsMap.put(entry.getKey(),tableValueList); + mainTableMap.putAll(childFieldsMap); + } + } + String objectToString = JsonUtilEx.getObjectToString(mainTableMap); + VisualdevModelDataInfoVO vo = new VisualdevModelDataInfoVO(); + vo.setData(objectToString); + vo.setId(id); + return vo; + } + return null; + } + + @Override + public DataModel visualCreate(VisualdevEntity visualdevEntity,Map map) throws Exception { + FormDataModel formData = JsonUtil.getJsonToBean(visualdevEntity.getFormData(), FormDataModel.class); + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + List tableModels = JsonUtil.getJsonToList(visualdevEntity.getVisualTables(), TableModel.class); + DbLinkEntity linkEntity = StringUtil.isNotEmpty(visualdevEntity.getDbLinkId()) ? dblinkService.getInfo(visualdevEntity.getDbLinkId()) : null; + //是否开启并发锁 + Boolean concurrency = false; + Integer primaryKeyPolicy = formData.getPrimaryKeyPolicy(); + if (formData.getConcurrencyLock()) { + //初始化version值 + map.put(TableFeildsEnum.VERSION.getField() , 0); + concurrency = true; + } + //单行唯一校验 + String b = formCheckUtils.checkForm(list, map, linkEntity, tableModels, primaryKeyPolicy, formData.getLogicalDelete(),null); + if (StringUtil.isNotEmpty(b)) { + throw new WorkFlowException(b + "不能重复" ); + } + OnlineSwapDataUtils.swapDatetime(list,map); + String mainId = RandomUtil.uuId(); + UserInfo userInfo = userProvider.get(); + UserEntity info = userApi.getInfo(userInfo.getUserId()); + DataModel dataModel = DataModel.builder().dataNewMap(map).fieLdsModelList(list).tableModelList(tableModels).mainId(mainId).link(linkEntity).userEntity(info).concurrencyLock(concurrency).primaryKeyPolicy(primaryKeyPolicy).flowEnable(true).build(); +// if (!StringUtil.isEmpty(visualdevEntity.getVisualTables()) && !OnlineDevData.TABLE_CONST.equals(visualdevEntity.getVisualTables())) { + flowFormDataUtil.create(dataModel); +// } else { +// VisualdevModelDataEntity entity = new VisualdevModelDataEntity(); +// entity.setData(JsonUtilEx.getObjectToString(dataModel.getDataNewMap())); +// entity.setVisualDevId(visualdevEntity.getId()); +// entity.setId(dataModel.getMainId()); +// entity.setSortcode(RandomUtil.parses()); +// entity.setCreatortime(new Date()); +// entity.setCreatoruserid(userProvider.get().getUserId()); +// entity.setEnabledmark(1); +// this.save(entity); +// } + return dataModel; + } + + @Override + public DataModel visualUpdate(VisualdevEntity visualdevEntity, Map map,String id) throws WorkFlowException { + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(visualdevEntity.getColumnData(), ColumnDataModel.class); + FormDataModel formData = JsonUtil.getJsonToBean(visualdevEntity.getFormData(), FormDataModel.class); + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + boolean inlineEdit = columnDataModel.getType() != null && columnDataModel.getType() == 4; + if (inlineEdit) { + list = JsonUtil.getJsonToList(columnDataModel.getColumnList(), FieLdsModel.class); + list = list.stream().filter(f -> !f.getId().toLowerCase().contains(JnpfKeyConsts.CHILD_TABLE_PREFIX)).collect(Collectors.toList()); + } + List tableModels = JsonUtil.getJsonToList(visualdevEntity.getVisualTables(), TableModel.class); + TableModel mainT = tableModels.stream().filter(t -> t.getTypeId().equals("1" )).findFirst().orElse(null); + DbLinkEntity linkEntity = StringUtil.isNotEmpty(visualdevEntity.getDbLinkId()) ? dblinkService.getInfo(visualdevEntity.getDbLinkId()) : null; + //是否开启并发锁 + Boolean isConcurrencyLock = false; + Integer primaryKeyPolicy = formData.getPrimaryKeyPolicy(); + if (formData.getConcurrencyLock()) { + if (map.get(TableFeildsEnum.VERSION.getField() ) == null) { + map.put(TableFeildsEnum.VERSION.getField() , 0); + } else { + boolean version = true; + try { + version = onlineDevDbUtil.getVersion(mainT.getTable(), linkEntity, map, id, primaryKeyPolicy); + }catch (Exception e){ + throw new WorkFlowException(e.getMessage()); + } + if (!version) { + throw new WorkFlowException(MsgCode.VS405.get()); + } else { + Integer vs = Integer.valueOf(String.valueOf(map.get(TableFeildsEnum.VERSION.getField() ))); + map.put(TableFeildsEnum.VERSION.getField() , vs + 1); + } + } + isConcurrencyLock = true; + } + String b = formCheckUtils.checkForm(list, map, linkEntity, tableModels, primaryKeyPolicy, formData.getLogicalDelete(), id); + if (StringUtil.isNotEmpty(b)) { + throw new WorkFlowException(b + "不能重复" ); + } + OnlineSwapDataUtils.swapDatetime(list,map); + UserInfo userInfo = userProvider.get(); + UserEntity info = userApi.getInfo(userInfo.getUserId()); + DataModel dataModel = DataModel.builder().dataNewMap(map).fieLdsModelList(list).tableModelList(tableModels).mainId(id).link(linkEntity).userEntity(info).concurrencyLock(isConcurrencyLock).primaryKeyPolicy(primaryKeyPolicy).flowEnable(visualdevEntity.getEnableFlow() == 1).build(); +// if (StringUtil.isEmpty(visualdevEntity.getVisualTables()) || OnlineDevData.TABLE_CONST.equals(visualdevEntity.getVisualTables())) { +// VisualdevModelDataEntity entity = new VisualdevModelDataEntity(); +// entity.setData(JsonUtilEx.getObjectToString(dataModel.getDataNewMap())); +// entity.setVisualDevId(visualdevEntity.getId()); +// entity.setId(dataModel.getMainId()); +// entity.setLastmodifytime(new Date()); +// entity.setLastmodifyuserid(userProvider.get().getUserId()); +// this.updateById(entity); +// } else { + flowFormDataUtil.update(dataModel); +// } + return dataModel; + } + + @Override + public void visualDelete(VisualdevEntity visualdevEntity,List idsVoList) throws Exception{ + VisualDevJsonModel visualJsonModel = OnlinePublicUtils.getVisualJsonModel(visualdevEntity); + //判断请求客户端来源 + if (!RequestContext.isOrignPc()) { + visualJsonModel.setColumnData(visualJsonModel.getAppColumnData()); + } + List idsList = new ArrayList<>(); + StringJoiner errMess=new StringJoiner(","); + if (visualdevEntity.getEnableFlow() == 1) { + for (String id : idsVoList) { + FlowTaskEntity taskEntity = flowTaskApi.getInfoSubmit(id); + if (taskEntity != null) { + if (taskEntity.getStatus().equals(0) || taskEntity.getStatus().equals(4)) { + try { + flowTaskApi.delete(taskEntity); + idsList.add(id); + }catch (Exception e){ + errMess.add(e.getMessage()); + } + } + } else { + idsList.add(id); + } + } + } else { + idsList = idsVoList; + } + if (idsList.size() == 0) { + throw new WorkFlowException(errMess.toString()); + } + if (!StringUtil.isEmpty(visualdevEntity.getVisualTables()) && !OnlineDevData.TABLE_CONST.equals(visualdevEntity.getVisualTables())) { + for(String id:idsList){ + try { + tableDelete(id, visualJsonModel); + }catch (Exception e){ + throw new WorkFlowException(e.getMessage()); + } + } + } + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void delete(VisualdevModelDataEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } + + @Override + public boolean tableDelete(String id,VisualDevJsonModel visualDevJsonModel) throws Exception { + DbLinkEntity linkEntity = dblinkService.getInfo(visualDevJsonModel.getDbLinkId()); + VisualDevJsonModel model = BeanUtil.copyProperties(visualDevJsonModel, VisualDevJsonModel.class); + return onlineDevDbUtil.deleteTable(id, model, linkEntity); + } + + @Override + public ActionResult tableDeleteMore(List ids, VisualDevJsonModel visualDevJsonModel) throws Exception { + List dataInfoVOList = new ArrayList<>(); + for (String id : ids) { + boolean isDel = tableDelete(id, visualDevJsonModel); + if(isDel){ + dataInfoVOList.add(id); + } + } + visualDevJsonModel.setDataIdList(dataInfoVOList); + return ActionResult.success(MsgCode.SU003.get()); + } + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/util/AutoFeildsUtil.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/util/AutoFeildsUtil.java new file mode 100644 index 0000000..1b5d2fb --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/util/AutoFeildsUtil.java @@ -0,0 +1,136 @@ +package jnpf.onlinedev.util; + +import cn.hutool.core.util.ObjectUtil; +import jnpf.model.visualJson.FieLdsModel; +import jnpf.permission.entity.OrganizeEntity; +import jnpf.permission.entity.PositionEntity; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.OrganizeService; +import jnpf.permission.service.PositionService; +import jnpf.permission.service.UserService; +import jnpf.permission.util.PermissionUtil; +import jnpf.util.*; +import jnpf.util.context.SpringContext; +import jnpf.util.visiual.JnpfKeyConsts; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 处理自动生成字段 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021-03-15 + */ +public class AutoFeildsUtil { + private static OrganizeService organizeApi; + private static UserService userApi; + private static PositionService positionApi; + + + //初始化 + public static void init() { + userApi = SpringContext.getBean(UserService.class); + organizeApi = SpringContext.getBean(OrganizeService.class); + positionApi=SpringContext.getBean(PositionService.class); + } + + /** + * 列表系统自动生成字段转换 + * + * @return String + */ + public static String autoFeilds(List fieLdsModelList, String data) { + for (FieLdsModel fieLdsModel : fieLdsModelList) { + Map dataMap = JsonUtil.stringToMap(data); + for (Map.Entry entry : dataMap.entrySet()) { + if (Objects.isNull(entry.getValue())){ + continue; + } + if (fieLdsModel.getVModel().equals(entry.getKey())) { + String jnpfKeyType = fieLdsModel.getConfig().getJnpfKey(); + switch (jnpfKeyType) { + case JnpfKeyConsts.CURRORGANIZE: + case JnpfKeyConsts.CURRDEPT: + if("all".equals(fieLdsModel.getShowLevel())){ + List organizeList = new ArrayList<>(); + organizeApi.getOrganizeId(String.valueOf(entry.getValue()),organizeList); + Collections.reverse(organizeList); + String value = organizeList.stream().map(OrganizeEntity::getFullName).collect(Collectors.joining("/")); + entry.setValue(value); + }else { + OrganizeEntity organizeEntity = organizeApi.getInfo(String.valueOf(entry.getValue())); + entry.setValue(organizeEntity != null ? organizeEntity.getFullName() : ""); + } + break; + case JnpfKeyConsts.CREATEUSER: + case JnpfKeyConsts.MODIFYUSER: + UserEntity userCreEntity = userApi.getInfo(String.valueOf(entry.getValue())); + if (userCreEntity != null) { + entry.setValue(userCreEntity.getRealName()); + } + break; + case JnpfKeyConsts.CURRPOSITION: + String[] curPos = String.valueOf(entry.getValue()).split(","); + List curPosList = new ArrayList<>(); + for (String pos : curPos){ + PositionEntity posEntity = positionApi.getInfo(pos); + String posName = Objects.nonNull(posEntity) ? posEntity.getFullName() : ""; + curPosList.add(posName); + } + entry.setValue(curPosList.stream().collect(Collectors.joining(","))); + break; + case JnpfKeyConsts.CREATETIME: + case JnpfKeyConsts.MODIFYTIME: + if (ObjectUtil.isNotEmpty(entry.getValue())){ + String dateStr=String.valueOf(entry.getValue()); + dateStr=dateStr.length()>19?dateStr.substring(0,19):dateStr; + entry.setValue(dateStr); + }else { + entry.setValue(null); + } + break; + default: + } + } + } + data = JsonUtilEx.getObjectToString(dataMap); + } + return data; + } + + public FieLdsModel getTreeRelationSearch(List FieLdsModels, String treeRelationField) { + FieLdsModel fieLdsModel = new FieLdsModel(); + boolean treeIsChild = treeRelationField.toLowerCase().contains(JnpfKeyConsts.CHILD_TABLE_PREFIX); + if (treeIsChild){ + String tableField = treeRelationField.substring(0,treeRelationField.indexOf("-")); + String relationVmodel = treeRelationField.substring(treeRelationField.indexOf("-")+1); + List allFields = new ArrayList<>(); + recursionFields(FieLdsModels,allFields); +// List childFields = FieLdsModels.stream().filter(fieLd -> fieLd.getVModel().equals(tableField)).map(f -> f.getConfig().getChildren()).findFirst().orElse(new ArrayList<>()); + fieLdsModel = allFields.stream().filter(swap->relationVmodel.equalsIgnoreCase(swap.getVModel()) + &&tableField.equals(swap.getConfig().getParentVModel())).findFirst().orElse(null); + } else { + //递归出所有表单控件从中去除左侧树的控件属性 + List allFields = new ArrayList<>(); + this.recursionFields(FieLdsModels,allFields); + fieLdsModel = allFields.stream().filter(swap -> treeRelationField.equalsIgnoreCase(swap.getVModel())).findFirst().orElse(null); + } + return fieLdsModel; + } + + private void recursionFields(List fieLdsModelList,List allFields){ + for (FieLdsModel fieLdsModel : fieLdsModelList){ + if (fieLdsModel.getConfig().getChildren()!=null){ + this.recursionFields(fieLdsModel.getConfig().getChildren(),allFields); + }else { + if (StringUtil.isNotEmpty(fieLdsModel.getVModel())){ + allFields.add(fieLdsModel); + } + } + } + } + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/util/OnlineDevDbUtil.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/util/OnlineDevDbUtil.java new file mode 100644 index 0000000..2ad9100 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/util/OnlineDevDbUtil.java @@ -0,0 +1,219 @@ +package jnpf.onlinedev.util; + +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import jnpf.base.ActionResult; +import jnpf.base.model.VisualDevJsonModel; +import jnpf.constant.MsgCode; +import jnpf.database.model.entity.DbLinkEntity; +import jnpf.database.util.ConnUtil; +import jnpf.database.util.DynamicDataSourceUtil; +import jnpf.mapper.FlowFormDataMapper; +import jnpf.util.FlowFormDataUtil; +import jnpf.exception.DataException; +import jnpf.model.visualJson.TableModel; +import jnpf.util.*; +import lombok.Cleanup; +import lombok.extern.slf4j.Slf4j; +import org.mybatis.dynamic.sql.SqlBuilder; +import org.mybatis.dynamic.sql.SqlTable; +import org.mybatis.dynamic.sql.delete.render.DeleteStatementProvider; +import org.mybatis.dynamic.sql.render.RenderingStrategies; +import org.mybatis.dynamic.sql.select.render.SelectStatementProvider; +import org.mybatis.dynamic.sql.update.UpdateDSL; +import org.mybatis.dynamic.sql.update.UpdateModel; +import org.mybatis.dynamic.sql.update.render.UpdateStatementProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.*; + +/** + * 处理在线开发新增更新操作 + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年3月22日10:58:29 + */ +@Component +@Slf4j +public class OnlineDevDbUtil { + + @Autowired + private FlowFormDataUtil flowDataUtil; + @Autowired + private FlowFormDataMapper flowFormDataMapper; + + + /** + * 删除有表单条数据 + * @param id + * @param visualDevJsonModel + * @return + * @throws SQLException + * @throws DataException + */ + @DSTransactional + public boolean deleteTable(String id, VisualDevJsonModel visualDevJsonModel, DbLinkEntity linkEntity) throws Exception { + Integer primaryKeyPolicy = visualDevJsonModel.getFormData().getPrimaryKeyPolicy(); + Boolean logicalDelete = visualDevJsonModel.getFormData().getLogicalDelete(); + boolean isSnowFlake = primaryKeyPolicy == 1; + List tableModels = visualDevJsonModel.getVisualTables(); + //主表 + TableModel mainTableModel = tableModels.stream().filter(t -> "1".equals(t.getTypeId())).findFirst().orElse(null); + String mainTable = mainTableModel.getTable(); + DynamicDataSourceUtil.switchToDataSource(linkEntity); + try { + @Cleanup Connection conn = ConnUtil.getConnOrDefault(linkEntity); + //获取主键 + if(primaryKeyPolicy==2 && !visualDevJsonModel.isFlowEnable()){ + primaryKeyPolicy =1; + } + String pKeyName = flowDataUtil.getKey(conn, mainTable, primaryKeyPolicy,visualDevJsonModel.isFlowEnable()); + + SelectStatementProvider queryMain = SqlBuilder.select(SqlTable.of(mainTable).allColumns()).from(SqlTable.of(mainTable)) + .where(SqlTable.of(mainTable).column(pKeyName), SqlBuilder.isEqualTo(id)).build().render(RenderingStrategies.MYBATIS3); + List> mainMapList = flowFormDataMapper.selectManyMappedRows(queryMain); + mainMapList = FormPublicUtils.toLowerKeyList(mainMapList); + + DeleteStatementProvider mainDelete = SqlBuilder.deleteFrom(SqlTable.of(mainTable)) + .where(SqlTable.of(mainTable).column(pKeyName), SqlBuilder.isEqualTo(id)).build().render(RenderingStrategies.MYBATIS3); + if(logicalDelete){ + SqlTable sqlt = SqlTable.of(mainTable); + UpdateDSL updateModelUpdateDSL = SqlBuilder.update(sqlt).set(sqlt.column(TableFeildsEnum.DELETEMARK.getField())).equalTo(1); + UpdateStatementProvider mainUpdate= updateModelUpdateDSL.where(SqlTable.of(mainTable).column(pKeyName), SqlBuilder.isEqualTo(id)).build().render(RenderingStrategies.MYBATIS3); + flowFormDataMapper.update(mainUpdate); + return true; + } + flowFormDataMapper.delete(mainDelete); + if (mainMapList.size() > 0) { + if (tableModels.size() > 1) { + //去除主表 + tableModels.remove(mainTableModel); + for (TableModel table : tableModels) { + //主表字段 + String relationField = isSnowFlake ? table.getRelationField() : "f_flowtaskid"; + String relationFieldValue = ""; + for (Map objectMap : mainMapList) { + for(String key : objectMap.keySet()){ + if(relationField.toLowerCase().equals(key.toLowerCase())){ + relationFieldValue = String.valueOf(objectMap.get(key)); + } + } + } + //子表字段 + String tableField = table.getTableField(); + DeleteStatementProvider childDeleteProvider = SqlBuilder.deleteFrom(SqlTable.of(table.getTable())) + .where(SqlTable.of(table.getTable()).column(tableField), SqlBuilder.isEqualTo(relationFieldValue)).build().render(RenderingStrategies.MYBATIS3); + flowFormDataMapper.delete(childDeleteProvider); + } + } + } + }finally { + DynamicDataSourceUtil.clearSwitchDataSource(); + } + return true; + } + + /** + * 删除有表多条数据 + * @param idList + * @param visualDevJsonModel + * @return + * @throws SQLException + * @throws DataException + */ + @DSTransactional + public ActionResult deleteTables(List idList, VisualDevJsonModel visualDevJsonModel, DbLinkEntity linkEntity) throws Exception { + Boolean logicalDelete = visualDevJsonModel.getFormData().getLogicalDelete(); + List tableModels = visualDevJsonModel.getVisualTables(); + + if (idList.size()==0){ + return ActionResult.fail(MsgCode.FA003.get()); + } + + TableModel tableModel = tableModels.stream().filter(t -> "1".equals(t.getTypeId())).findFirst().orElse(null); + //取主表 + String mainTable = Optional.ofNullable(tableModel.getTable()).orElse("") ; + //切换数据源 + try { + DynamicDataSourceUtil.switchToDataSource(linkEntity); + @Cleanup Connection conn = ConnUtil.getConnOrDefault(linkEntity); + //获取主键 + Integer primaryKeyPolicy = visualDevJsonModel.getFormData().getPrimaryKeyPolicy(); + boolean isSnowFlake = primaryKeyPolicy == 1; + if(primaryKeyPolicy==2 && !visualDevJsonModel.isFlowEnable()){ + primaryKeyPolicy=1; + } + String pKeyName = flowDataUtil.getKey(conn, mainTable,primaryKeyPolicy); + + //查询数据是否存在 + for (int i =0;i> mainMapList = flowFormDataMapper.selectManyMappedRows(queryMain); + + DeleteStatementProvider mainDelete = SqlBuilder.deleteFrom(SqlTable.of(mainTable)) + .where(SqlTable.of(mainTable).column(pKeyName), SqlBuilder.isEqualTo(id)).build().render(RenderingStrategies.MYBATIS3); + //假删操作 + if(logicalDelete){ + SqlTable sqlt = SqlTable.of(mainTable); + UpdateDSL updateModelUpdateDSL = SqlBuilder.update(sqlt).set(sqlt.column(TableFeildsEnum.DELETEMARK.getField())).equalTo(1); + UpdateStatementProvider mainUpdate= updateModelUpdateDSL.where(SqlTable.of(mainTable).column(pKeyName), SqlBuilder.isEqualTo(id)).build().render(RenderingStrategies.MYBATIS3); + flowFormDataMapper.update(mainUpdate); + }else{ + flowFormDataMapper.delete(mainDelete); + + if (mainMapList.size()>0){ + //是否存在子表 + if(tableModels.size()>1){ + //去除主表 + tableModels.remove(tableModel); + for (TableModel table : tableModels) { + //主表字段 + String relationField = isSnowFlake ? table.getRelationField() : "f_flowtaskid"; + String relationFieldValue = ""; + for (Map objectMap : mainMapList) { + for(String key : objectMap.keySet()){ + if(relationField.toLowerCase().equals(key.toLowerCase())){ + relationFieldValue = String.valueOf(objectMap.get(key)); + } + } + } + //子表字段 + String tableField = table.getTableField(); + DeleteStatementProvider childDeleteProvider = SqlBuilder.deleteFrom(SqlTable.of(table.getTable())) + .where(SqlTable.of(table.getTable()).column(tableField), SqlBuilder.isEqualTo(relationFieldValue)).build().render(RenderingStrategies.MYBATIS3); + flowFormDataMapper.delete(childDeleteProvider); + } + } + } + } + } + } finally { + DynamicDataSourceUtil.clearSwitchDataSource(); + } + return ActionResult.success(MsgCode.SU003.get()); + } + + public Boolean getVersion(String table, DbLinkEntity linkEntity, Map dataMap,String id,Integer primaryKey) throws SQLException, DataException { + boolean canUpdate = true; + DynamicDataSourceUtil.switchToDataSource(linkEntity); + try { + @Cleanup Connection conn = ConnUtil.getConnOrDefault(linkEntity); + String pKeyName = flowDataUtil.getKey(conn, table, primaryKey); + SqlTable sqlTable = SqlTable.of(table); + SelectStatementProvider render = SqlBuilder.select(sqlTable.column(TableFeildsEnum.VERSION.getField())).from(sqlTable).where(sqlTable.column(pKeyName), SqlBuilder.isEqualTo(id)) + .and(sqlTable.column(TableFeildsEnum.VERSION.getField()), SqlBuilder.isEqualTo(dataMap.get(TableFeildsEnum.VERSION.getField()))).build().render(RenderingStrategies.MYBATIS3); + List> mapList = flowFormDataMapper.selectManyMappedRows(render); + canUpdate = mapList.size() > 0; + }finally { + DynamicDataSourceUtil.clearSwitchDataSource(); + } + return canUpdate; + } + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/util/onlineDevUtil/OnlineDatabaseUtils.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/util/onlineDevUtil/OnlineDatabaseUtils.java new file mode 100644 index 0000000..adc86c2 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/util/onlineDevUtil/OnlineDatabaseUtils.java @@ -0,0 +1,172 @@ +package jnpf.onlinedev.util.onlineDevUtil; + + +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONArray; +import jnpf.database.model.dbfield.JdbcColumnModel; +import jnpf.database.model.dto.PrepSqlDTO; +import jnpf.database.model.entity.DbLinkEntity; +import jnpf.database.util.JdbcUtil; +import jnpf.onlinedev.model.OnlineDevListModel.OnlineColumnFieldModel; +import jnpf.onlinedev.model.OnlineDevListModel.OnlineDevListDataVO; +import jnpf.onlinedev.model.OnlineDevListModel.VisualColumnSearchVO; +import jnpf.util.FormPublicUtils; +import jnpf.util.StringUtil; +import jnpf.util.visiual.JnpfKeyConsts; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.2.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/7/28 + */ +public class OnlineDatabaseUtils { + public static List getTableDataList(DbLinkEntity dbLinkEntity, String sql, String pKeyName, List childFieldList) { + List list = new ArrayList<>(); + try { + List> fieldMods = JdbcUtil.queryJdbcColumns(new PrepSqlDTO(sql).withConn(dbLinkEntity)).setIsValue(true).get(); + List> dataList = new ArrayList<>(); + + for (List dblist : fieldMods){ + Map dataMap =new HashMap<>(); + HashMap collect = dblist.stream().collect(Collectors.toMap(s -> Optional.ofNullable(s.getField()).orElse(""), s -> Optional.ofNullable(s.getValue()).orElse(""), (a, b) -> b, HashMap::new)); + dataMap.putAll(collect); + for (OnlineColumnFieldModel on : childFieldList){ + //需要替换的子表字段 + JdbcColumnModel fieldMod = dblist.stream() + .filter(dbMod -> dbMod.getTable().equalsIgnoreCase(on.getTableName()) + && dbMod.getField().equalsIgnoreCase(on.getField())).findFirst().orElse(null); + //将数据转成map格式 + if (ObjectUtil.isNotEmpty(fieldMod)){ + dataMap.remove(fieldMod.getField()); + dataMap.put(on.getOriginallyField(),fieldMod.getValue()); + } + } + dataList.add(dataMap); + } + + for (Map dataMap : dataList) { + OnlineDevListDataVO dataVo = new OnlineDevListDataVO(); + dataMap = toLowerKey(dataMap); + dataVo.setData(dataMap); + if (dataMap.containsKey(pKeyName.toUpperCase())) { + dataVo.setId(String.valueOf(dataMap.get(pKeyName.toUpperCase()))); + } + list.add(dataVo); + } + } catch (Exception e) { + e.printStackTrace(); + } + return list; + } + + public static Map toLowerKey(Map map) { + Map resultMap = new HashMap<>(16); + Set sets = map.keySet(); + for (String key : sets) { + resultMap.put(key.toLowerCase(), map.get(key)); + } + return resultMap; + } + + public static Boolean existKey(List feilds, String pKeyName) { + if (feilds.size() > 0) { + for (String feild : feilds) { + if (feild.equals(pKeyName)) { + return true; + } + } + } + return false; + } + + public static List setDataId(String keyName, List DevList) { + keyName = keyName.toLowerCase(); + for (OnlineDevListDataVO dataVo : DevList) { + Map dataMap = dataVo.getData(); + if (dataMap.get(keyName) != null) { + dataVo.setId(String.valueOf(dataMap.get(keyName))); + } + } + return DevList; + } + + public static List getValueList(List searchVOList){ + List valueList = new LinkedList<>(); + for (VisualColumnSearchVO vo : searchVOList){ + String jnpfKey = vo.getConfig().getJnpfKey(); + String format; + switch (jnpfKey){ + case JnpfKeyConsts.MODIFYTIME: + case JnpfKeyConsts.CREATETIME: + case JnpfKeyConsts.DATE: + JSONArray timeStampArray = (JSONArray) vo.getValue(); + Long o1 =(Long) timeStampArray.get(0); + Long o2 = (Long) timeStampArray.get(1); + format = StringUtil.isEmpty(vo.getFormat()) ? "yyyy-MM-dd HH:mm:ss" : vo.getFormat(); + //时间戳转string格式 + String startTime = OnlinePublicUtils.getDateByFormat(o1,format); + String endTime = OnlinePublicUtils.getDateByFormat(o2,format); + //处理时间查询条件范围 + endTime=endTime.substring(0,10); + String firstTimeDate = OnlineDatabaseUtils.getTimeFormat(startTime); + String lastTimeDate = OnlineDatabaseUtils.getLastTimeFormat(endTime); + valueList.add(firstTimeDate); + valueList.add(lastTimeDate); + break; + case JnpfKeyConsts.TIME: + JSONArray timeArray =(JSONArray)vo.getValue(); + String start = String.valueOf(timeArray.get(0)); + String end =String.valueOf(timeArray.get(1)); + valueList.add(start); + valueList.add(end); + break; + case JnpfKeyConsts.NUM_INPUT: + case JnpfKeyConsts.CALCULATE: + List searchArray = (List)vo.getValue(); + Integer firstValue = null; + Integer secondValue = null; + for(int i=0;i nullDatamap = new HashMap<>(); + + /** + * 数据转换(不取缓存) + * + * @param modelList + * @param dataMap + * @return + */ + public Map swapChildTableDataInfo(List modelList, Map dataMap, List codeList) { + Map dataCopyMap = new HashMap<>(); + dataCopyMap.putAll(dataMap); + + Map> dataDetailMap = new HashMap<>(); + try { + for (FieLdsModel swapDataVo : modelList) { + String jnpfKey = swapDataVo.getConfig().getJnpfKey(); + String dataType = swapDataVo.getConfig().getDataType(); + String vModel = swapDataVo.getVModel(); + Object val = dataMap.get(vModel); + String modelValue = String.valueOf(val); + if (StringUtil.isEmpty(modelValue) || "null".equals(modelValue)) { + continue; + } + if (dataType != null) { + //数据接口的数据存放 + String label = swapDataVo.getProps() != null ? swapDataVo.getProps().getLabel() : "" ; + String value = swapDataVo.getProps() != null ? swapDataVo.getProps().getValue() : "" ; + String Children = swapDataVo.getProps() != null ? swapDataVo.getProps().getChildren() : "" ; + List> options = new ArrayList<>(); + + if (dataType.equals(OnlineDataTypeEnum.STATIC.getType())) { + if (StringUtil.isNotEmpty(swapDataVo.getOptions())) { + options = JsonUtil.getJsonToListMap(swapDataVo.getOptions()); + + JSONArray data = JsonUtil.getListToJsonArray(options); + OnlineDevListUtils.getOptions(label, value, Children, data, options); + } else { + options = JsonUtil.getJsonToListMap(swapDataVo.getOptions()); + } + } + if (dataType.equals(OnlineDataTypeEnum.DYNAMIC.getType())) { + ActionResult data = dataInterFaceApi.infoToId(swapDataVo.getInterfaceId(),null, nullDatamap); + //api调用 序列化为linkedHashMap + LinkedHashMap>> actionVo = (LinkedHashMap>>) data.getData(); + if (actionVo != null) { + List> dataList = actionVo.get("data" ); + JSONArray dataAll = JsonUtil.getListToJsonArray(dataList); + treeToList(label, value, Children, dataAll, options); + } + } + if (dataType.equals(OnlineDataTypeEnum.DICTIONARY.getType())) { + List list = dictionaryDataApi.getDicList(swapDataVo.getConfig().getDictionaryType()); + options = list.stream().map(dic -> { + Map dictionaryMap = new HashMap<>(16); + dictionaryMap.put("id" , dic.getId()); + dictionaryMap.put("enCode" , dic.getEnCode()); + dictionaryMap.put("fullName" , dic.getFullName()); + return dictionaryMap; + }).collect(Collectors.toList()); + } + + Map dataInterfaceMap = new HashMap<>(16); + options.stream().forEach(o -> { + dataInterfaceMap.put(String.valueOf(o.get(value)), String.valueOf(o.get(label))); + }); + + List valueList = new ArrayList<>(); + if (OnlinePublicUtils.getMultiple(modelValue, MultipleControlEnum.MULTIPLE_JSON_TWO.getMultipleChar())) { + String[][] data = JsonUtil.getJsonToBean(modelValue, String[][].class); + for (String[] casData : data) { + for (String s : casData) { + valueList.add(s); + } + } + } else if (OnlinePublicUtils.getMultiple(modelValue, MultipleControlEnum.MULTIPLE_JSON_ONE.getMultipleChar())) { + valueList = JsonUtil.getJsonToList(modelValue, String.class); + } else { + valueList.add(modelValue); + } + String allValue = valueList.stream().map(va -> dataInterfaceMap.get(va)).collect(Collectors.joining("," )); + dataMap.put(vModel, allValue); + } else { + switch (jnpfKey) { + //公司组件 + case JnpfKeyConsts.COMSELECT: + //部门组件 + case JnpfKeyConsts.DEPSELECT: + //所属部门 + case JnpfKeyConsts.CURRDEPT: + dataMap.put(vModel, getOrgValue(modelValue)); + break; + + //所属组织 + case JnpfKeyConsts.CURRORGANIZE: + boolean isAll = "all".equals(swapDataVo.getShowLevel()); + if (isAll) { + List organizeList = new ArrayList<>(); + organizeApi.getOrganizeId(modelValue,organizeList); + Collections.reverse(organizeList); + String value = organizeList.stream().map(OrganizeEntity::getFullName).collect(Collectors.joining("/" )); + dataMap.put(vModel, value); + } else { + OrganizeEntity organizeEntity = organizeApi.getInfo(modelValue); + dataMap.put(vModel, Objects.nonNull(organizeEntity) ? organizeEntity.getFullName() : modelValue); + } + break; + + //岗位组件 + case JnpfKeyConsts.POSSELECT: + //所属岗位 + case JnpfKeyConsts.CURRPOSITION: + dataMap.put(vModel, getPosValue(modelValue)); + break; + + //用户组件 + case JnpfKeyConsts.USERSELECT: + //创建用户 + case JnpfKeyConsts.CREATEUSER: + //修改用户 + case JnpfKeyConsts.MODIFYUSER: + if ("admin".equals(modelValue)) { + dataMap.put(vModel, "管理员" ); + } else { + dataMap.put(vModel, getUserValue(modelValue)); + } + break; + + //省市区联动 + case JnpfKeyConsts.ADDRESS: + String value = String.valueOf(dataMap.get(vModel)); + if (OnlinePublicUtils.getMultiple(value, MultipleControlEnum.MULTIPLE_JSON_TWO.getMultipleChar())) { + String[][] data = JsonUtil.getJsonToBean(value, String[][].class); + List addList = new ArrayList<>(); + for (String[] AddressData : data) { + List adList = new ArrayList<>(); + for (String s : AddressData) { + adList.add(s); + } + addList.add(String.join("/" , areaApi.getProList(adList).stream().map(pro -> pro.getFullName()).collect(Collectors.toList()))); + } + dataMap.put(vModel, String.join(";" , addList)); + } else { + List proDataS = JsonUtil.getJsonToList(value, String.class); + dataMap.put(vModel, String.join("," , areaApi.getProList(proDataS).stream().map(pro -> pro.getFullName()).collect(Collectors.toList()))); + } + break; + + case JnpfKeyConsts.RELATIONFORM: + VisualdevEntity entity = visualdevService.getInfo(swapDataVo.getModelId()); + VisualdevModelDataInfoVO infoVO; + String keyId = String.valueOf(dataMap.get(vModel)); + Map formDataMap = new HashMap<>(16); + if (!StringUtil.isEmpty(entity.getVisualTables()) && !OnlineDevData.TABLE_CONST.equals(entity.getVisualTables())) { + infoVO = visualDevInfoService.getDetailsDataInfo(keyId, entity); + } else { + infoVO = visualdevModelDataService.infoDataChange(keyId, entity); + } + formDataMap = JsonUtil.stringToMap(infoVO.getData()); + String relationField = swapDataVo.getRelationField(); + if (formDataMap != null && formDataMap.size() > 0) { + dataMap.put(vModel + "_id" , dataMap.get(vModel)); + dataMap.put(vModel, formDataMap.get(relationField)); + dataDetailMap.put(vModel, formDataMap); + } + break; + + case JnpfKeyConsts.POPUPSELECT: + ActionResult data = dataInterFaceApi.infoToId(swapDataVo.getInterfaceId(), null,nullDatamap); + //api调用 序列化为linkedHashMap + LinkedHashMap>> actionVo = (LinkedHashMap>>) data.getData(); + List> mapList = actionVo.get("data" ) != null ? actionVo.get("data" ) : new ArrayList<>(); + Map PopMap = mapList.stream().filter(map -> map.get(swapDataVo.getPropsValue()).equals(dataMap.get(vModel))).findFirst().orElse(null); + if (PopMap.size() > 0) { + dataMap.put(vModel + "_id" , dataMap.get(vModel)); + dataMap.put(vModel, PopMap.get(swapDataVo.getColumnOptions().get(0).getValue())); + dataDetailMap.put(vModel, PopMap); + } + break; + case JnpfKeyConsts.POPUPTABLESELECT: + Object popData = dataInterFaceApi.infoToId(swapDataVo.getInterfaceId(),null,null).getData(); + DataInterfaceActionVo actionPo = (DataInterfaceActionVo) popData; + List> popMapList = new ArrayList<>(); + if (actionPo.getData() instanceof List) { + popMapList = (List>) actionPo.getData(); + } + String popValue = String.valueOf(dataMap.get(vModel)); + List idList = new ArrayList<>(); + if (popValue.contains("[")) { + idList = JsonUtil.getJsonToList(popValue, String.class); + } else { + idList.add(popValue); + } + List swapValue = new ArrayList<>(); + for (String id : idList) { + popMapList.stream().filter(map -> + map.get(swapDataVo.getPropsValue()).equals(id) + ).forEach( + modelMap -> swapValue.add(String.valueOf(modelMap.get(swapDataVo.getRelationField()))) + ); + } + dataMap.put(vModel, swapValue.stream().collect(Collectors.joining(","))); + break; + case JnpfKeyConsts.MODIFYTIME: + case JnpfKeyConsts.CREATETIME: + case JnpfKeyConsts.DATE: + //判断是否为时间戳格式 + String format; + String dateData = String.valueOf(dataMap.get(vModel)); + String dateSwapInfo = swapDataVo.getFormat() != null ? swapDataVo.getFormat() : swapDataVo.getType() != null && swapDataVo.getType().equals(JnpfKeyConsts.DATE) ? "yyyy-MM-dd" : "yyyy-MM-dd HH:mm:ss" ; + if (!dateData.contains("-" ) && !dateData.contains(":" ) && dateData.length() > 10) { + DateTimeFormatter ftf = DateTimeFormatter.ofPattern(dateSwapInfo); + format = ftf.format(LocalDateTime.ofInstant(Instant.ofEpochMilli((Long) dataMap.get(vModel)), ZoneId.of("+8" ))); + } else { + format = dateData; + } + if (format.contains("." )) { + format = format.substring(0, format.lastIndexOf("." )); + } + SimpleDateFormat sdf = new SimpleDateFormat(dateSwapInfo); + try { + Date date = sdf.parse(format); + String outTime = sdf.format(sdf.parse(DateUtil.dateFormat(date))); + dataMap.put(vModel, outTime); + } catch (ParseException e) { + e.printStackTrace(); + } + break; + + //开关 滑块 + case JnpfKeyConsts.SWITCH: + String switchValue = String.valueOf(dataMap.get(vModel)).equals("1" ) ? swapDataVo.getActiveTxt() : swapDataVo.getInactiveTxt(); + dataMap.put(vModel, switchValue); + break; + case JnpfKeyConsts.RATE: + BigDecimal ratevalue=new BigDecimal(0); + if(dataMap.get(vModel)!=null){ + ratevalue= new BigDecimal(dataMap.get(vModel).toString()); + } + dataMap.put(vModel, ratevalue); + break; + case JnpfKeyConsts.SLIDER: + dataMap.put(vModel, dataMap.get(vModel) != null ? Integer.parseInt(String.valueOf(dataMap.get(vModel))) : null); + break; + + case JnpfKeyConsts.UPLOADFZ: + case JnpfKeyConsts.UPLOADIMG: + List> fileList = JsonUtil.getJsonToListMap(String.valueOf(dataMap.get(vModel))); + dataMap.put(vModel, fileList); + break; + + default: + break; + } + } + } + //转换二维码 + swapCodeDataInfo(codeList, dataMap, dataCopyMap); + //关联选择属性 + if (dataDetailMap.size() > 0) { + getDataAttr(modelList, dataMap, dataDetailMap); + } + } catch (Exception e) { + e.printStackTrace(); + } + return dataMap; + } + + + /** + * 转换数据格式(编辑页) + * + * @param modelList 控件 + * @param dataMap 数据 + * @return + */ + public Map swapDataInfoType(List modelList, Map dataMap) { + return formInfoUtils.swapDataInfoType(modelList,dataMap); + } + + + /** + * 转换数据格式(编辑页) + * + * @param modelList 控件 + * @param dataMap 数据 + * @return + */ + public Map getInitLineData(List modelList, Map dataMap) { + for (FieLdsModel swapDataVo : modelList) { + String jnpfKey = swapDataVo.getConfig().getJnpfKey(); + String vModel = swapDataVo.getVModel(); + Object value = dataMap.get(vModel); + if (value == null || ObjectUtil.isEmpty(value)) { + continue; + } + switch (jnpfKey) { + case JnpfKeyConsts.RATE: + BigDecimal ratevalue=new BigDecimal(0); + if(dataMap.get(vModel)!=null){ + ratevalue= new BigDecimal(dataMap.get(vModel).toString()); + } + dataMap.put(vModel, ratevalue); + break; + case JnpfKeyConsts.UPLOADFZ: + case JnpfKeyConsts.UPLOADIMG: + List> fileList = JsonUtil.getJsonToListMap(String.valueOf(value)); + dataMap.put(vModel, fileList); + break; + + case JnpfKeyConsts.DATE: + Long dateTime = DateTimeFormatConstant.getDateObjToLong(dataMap.get(vModel)); + dataMap.put(vModel, dateTime != null ? dateTime : dataMap.get(vModel)); + break; + + case JnpfKeyConsts.SWITCH: + case JnpfKeyConsts.SLIDER: + dataMap.put(vModel, value != null ? Integer.parseInt(String.valueOf(value)) : null); + break; + //系统自动生成控件 + case JnpfKeyConsts.CURRORGANIZE: + case JnpfKeyConsts.CURRDEPT: + if ("all".equals(swapDataVo.getShowLevel())) { + List organizeList = new ArrayList<>(); + organizeApi.getOrganizeId(String.valueOf(value),organizeList); + Collections.reverse(organizeList); + String organizeName = organizeList.stream().map(OrganizeEntity::getFullName).collect(Collectors.joining("/" )); + dataMap.put(vModel, organizeName); + } else { + OrganizeEntity organizeEntity = organizeApi.getInfo(String.valueOf(value)); + dataMap.put(vModel, Objects.nonNull(organizeEntity) ? organizeEntity.getFullName() : value); + } + break; + + case JnpfKeyConsts.CURRPOSITION: + PositionEntity positionEntity = positionApi.getInfo(String.valueOf(value)); + dataMap.put(vModel, Objects.nonNull(positionEntity) ? positionEntity.getFullName() : value); + break; + + case JnpfKeyConsts.CREATEUSER: + case JnpfKeyConsts.MODIFYUSER: + UserEntity userEntity = userApi.getInfo(String.valueOf(value)); + String userValue = Objects.nonNull(userEntity) ? userEntity.getAccount().equalsIgnoreCase("admin" ) + ? "管理员" : userEntity.getRealName() : String.valueOf(value); + dataMap.put(vModel, userValue); + break; + default: + dataMap.put(vModel, FormPublicUtils.getDataConversion(value)); + break; + } + } + return dataMap; + } + + /** + * 二维码 条形码详情数据 + * + * @param codeList 控件集合 + * @param swapDataMap 转换后的数据 + * @param dataMap 转换前 + * @return + */ + public static void swapCodeDataInfo(List codeList, Map swapDataMap, Map dataMap) { + for (FormModel formModel : codeList) { + String jnpfKey = formModel.getConfig().getJnpfKey(); + if (jnpfKey.equals(JnpfKeyConsts.QR_CODE) || jnpfKey.equals(JnpfKeyConsts.BARCODE)) { + String codeDataType = formModel.getDataType(); + if (OnlineDataTypeEnum.RELATION.getType().equals(codeDataType)) { + String relationFiled = formModel.getRelationField(); + if (StringUtil.isNotEmpty(relationFiled)) { + Object relationValue = dataMap.get(relationFiled); + if (ObjectUtil.isNotEmpty(relationValue)) { + swapDataMap.put(relationFiled + "_id" , relationValue); + } + } + } + } + } + } + + private static void treeToList(String value, String label, String children, JSONArray data, List> result) { + for (int i = 0; i < data.size(); i++) { + JSONObject ob = data.getJSONObject(i); + Map tree = new HashMap<>(16); + tree.put(value, String.valueOf(ob.get(value))); + tree.put(label, String.valueOf(ob.get(label))); + result.add(tree); + if (ob.get(children) != null) { + JSONArray childArray = ob.getJSONArray(children); + treeToList(value, label, children, childArray, result); + } + } + } + + /** + * 生成关联属性(弹窗选择属性,关联表单属性) + * + * @param fieLdsModelList + * @param dataMap + * @param dataDetailMap + */ + private static void getDataAttr(List fieLdsModelList, Map dataMap, Map> dataDetailMap) { + for (FieLdsModel fieLdsModel : fieLdsModelList) { + String jnpfKey = fieLdsModel.getConfig().getJnpfKey(); + if (jnpfKey.equals(JnpfKeyConsts.RELATIONFORM_ATTR) || jnpfKey.equals(JnpfKeyConsts.POPUPSELECT_ATTR)) { + String relationField = fieLdsModel.getRelationField(); + String showField = fieLdsModel.getShowField(); + Map formDataMap = dataDetailMap.get(relationField); + dataMap.put(relationField + "_" + showField, formDataMap.get(showField)); + } + } + } + + /** + * 转换组织 + * + * @param modelValue + * @return + */ + private String getOrgValue(String modelValue) { + String orgValue; + List valueList; + if (OnlinePublicUtils.getMultiple(modelValue, MultipleControlEnum.MULTIPLE_JSON_TWO.getMultipleChar())) { + String[][] prgArray = JsonUtil.getJsonToBean(modelValue, String[][].class); + List addList = new ArrayList<>(); + for (String[] prgData : prgArray) { + List adList = new ArrayList<>(); + for (String s : prgData) { + OrganizeEntity info = organizeApi.getInfo(s); + adList.add(Objects.nonNull(info) ? info.getFullName() : "" ); + } + String porData = adList.stream().collect(Collectors.joining("/" )); + addList.add(porData); + } + orgValue = String.join(";" , addList); + } else { + if (OnlinePublicUtils.getMultiple(modelValue, MultipleControlEnum.MULTIPLE_JSON_ONE.getMultipleChar())) { + valueList = JsonUtil.getJsonToList(modelValue, String.class); + } else { + valueList = Stream.of(modelValue.split("," )).collect(Collectors.toList()); + } + String allValue = valueList.stream().map(va -> { + OrganizeEntity organizeEntity = organizeApi.getInfo(va); + return Objects.nonNull(organizeEntity) ? organizeEntity.getFullName() : va; + }).collect(Collectors.joining("," )); + orgValue = allValue; + } + return orgValue; + } + + /** + * 转换岗位 + * + * @param modelValue + * @return + */ + private String getPosValue(String modelValue) { + String posValue; + List valueList; + if (OnlinePublicUtils.getMultiple(modelValue, MultipleControlEnum.MULTIPLE_JSON_TWO.getMultipleChar())) { + String[][] prgArray = JsonUtil.getJsonToBean(modelValue, String[][].class); + List addList = new ArrayList<>(); + for (String[] prgData : prgArray) { + List adList = new ArrayList<>(); + for (String s : prgData) { + PositionEntity info = positionApi.getInfo(s); + adList.add(Objects.nonNull(info) ? info.getFullName() : "" ); + } + String porData = adList.stream().collect(Collectors.joining("/" )); + addList.add(porData); + } + posValue = String.join(";" , addList); + } else { + if (OnlinePublicUtils.getMultiple(modelValue, MultipleControlEnum.MULTIPLE_JSON_ONE.getMultipleChar())) { + valueList = JsonUtil.getJsonToList(modelValue, String.class); + } else { + valueList = Stream.of(modelValue.split("," )).collect(Collectors.toList()); + } + String allValue = valueList.stream().map(va -> { + PositionEntity positionEntity = positionApi.getInfo(va); + return Objects.nonNull(positionEntity) ? positionEntity.getFullName() : va; + }).collect(Collectors.joining("," )); + posValue = allValue; + } + return posValue; + } + + /** + * 转换用户 + * + * @param modelValue + * @return + */ + private String getUserValue(String modelValue) { + String userValue; + List valueList; + if (OnlinePublicUtils.getMultiple(modelValue, MultipleControlEnum.MULTIPLE_JSON_TWO.getMultipleChar())) { + String[][] prgArray = JsonUtil.getJsonToBean(modelValue, String[][].class); + List addList = new ArrayList<>(); + for (String[] prgData : prgArray) { + List adList = new ArrayList<>(); + for (String s : prgData) { + UserEntity info = userApi.getInfo(s); + adList.add(Objects.nonNull(info) ? info.getRealName() + "/" + info.getAccount() : "" ); + } + String porData = adList.stream().collect(Collectors.joining("/" )); + addList.add(porData); + } + userValue = String.join(";" , addList); + } else { + if (OnlinePublicUtils.getMultiple(modelValue, MultipleControlEnum.MULTIPLE_JSON_ONE.getMultipleChar())) { + valueList = JsonUtil.getJsonToList(modelValue, String.class); + } else { + valueList = Stream.of(modelValue.split("," )).collect(Collectors.toList()); + } + String allValue = valueList.stream().map(va -> { + UserEntity userEntity = userApi.getInfo(va); + return Objects.nonNull(userEntity) ? userEntity.getRealName() + "/" + userEntity.getAccount() : va; + }).collect(Collectors.joining("," )); + userValue = allValue; + } + return userValue; + } + + + /** + * 转换角色 + * + * @param modelValue + * @return + */ + private String getRoleValue(String modelValue) { + String value; + List valueList; + if (OnlinePublicUtils.getMultiple(modelValue, MultipleControlEnum.MULTIPLE_JSON_TWO.getMultipleChar())) { + String[][] prgArray = JsonUtil.getJsonToBean(modelValue, String[][].class); + List addList = new ArrayList<>(); + for (String[] prgData : prgArray) { + List adList = new ArrayList<>(); + for (String s : prgData) { + RoleEntity info = roleApi.getInfo(s); + adList.add(Objects.nonNull(info) ? info.getFullName() : ""); + } + String porData = adList.stream().collect(Collectors.joining("/")); + addList.add(porData); + } + value = String.join(";", addList); + } else { + if (OnlinePublicUtils.getMultiple(modelValue, MultipleControlEnum.MULTIPLE_JSON_ONE.getMultipleChar())) { + valueList = JsonUtil.getJsonToList(modelValue, String.class); + } else { + valueList = Stream.of(modelValue.split(",")).collect(Collectors.toList()); + } + String allValue = valueList.stream().map(va -> { + RoleEntity userEntity = roleApi.getInfo(va); + return Objects.nonNull(userEntity) ? userEntity.getFullName() : va; + }).collect(Collectors.joining(",")); + value = allValue; + } + return value; + } + + /** + * 转换分组 + * + * @param modelValue + * @return + */ + private String getGroupValue(String modelValue) { + String value; + List valueList; + if (OnlinePublicUtils.getMultiple(modelValue, MultipleControlEnum.MULTIPLE_JSON_TWO.getMultipleChar())) { + String[][] prgArray = JsonUtil.getJsonToBean(modelValue, String[][].class); + List addList = new ArrayList<>(); + for (String[] prgData : prgArray) { + List adList = new ArrayList<>(); + for (String s : prgData) { + GroupEntity info = groupApi.getInfo(s); + adList.add(Objects.nonNull(info) ? info.getFullName() : ""); + } + String porData = adList.stream().collect(Collectors.joining("/")); + addList.add(porData); + } + value = String.join(";", addList); + } else { + if (OnlinePublicUtils.getMultiple(modelValue, MultipleControlEnum.MULTIPLE_JSON_ONE.getMultipleChar())) { + valueList = JsonUtil.getJsonToList(modelValue, String.class); + } else { + valueList = Stream.of(modelValue.split(",")).collect(Collectors.toList()); + } + String allValue = valueList.stream().map(va -> { + GroupEntity info = groupApi.getInfo(va); + return Objects.nonNull(info) ? info.getFullName() : va; + }).collect(Collectors.joining(",")); + value = allValue; + } + return value; + } + + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/util/onlineDevUtil/OnlineDevListUtils.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/util/onlineDevUtil/OnlineDevListUtils.java new file mode 100644 index 0000000..f58f039 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/util/onlineDevUtil/OnlineDevListUtils.java @@ -0,0 +1,642 @@ +package jnpf.onlinedev.util.onlineDevUtil; + +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import jnpf.base.ActionResult; +import jnpf.base.entity.DictionaryDataEntity; +import jnpf.base.entity.ProvinceEntity; +import jnpf.base.model.ColumnDataModel; +import jnpf.base.model.datainterface.DataInterfaceActionVo; +import jnpf.base.service.DataInterfaceService; +import jnpf.base.service.DictionaryDataService; +import jnpf.base.service.ProvinceService; +import jnpf.base.service.VisualdevService; +import jnpf.model.visualJson.FieLdsModel; +import jnpf.onlinedev.model.OnlineDevEnum.MultipleControlEnum; +import jnpf.onlinedev.model.OnlineDevEnum.OnlineDataTypeEnum; +import jnpf.onlinedev.model.OnlineDevListModel.OnlineDevListDataVO; +import jnpf.onlinedev.model.OnlineDevListModel.VisualColumnSearchVO; +import jnpf.onlinedev.service.VisualDevInfoService; +import jnpf.onlinedev.service.VisualdevModelDataService; +import jnpf.permission.service.*; +import jnpf.util.*; +import jnpf.util.data.DataSourceContextHolder; +import jnpf.util.visiual.JnpfKeyConsts; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/7/28 + */ +@Slf4j +@Component +public class OnlineDevListUtils { + @Autowired + private RedisUtil redisUtil; + @Autowired + private DictionaryDataService dictionaryDataApi; + @Autowired + private UserService userApi; + @Autowired + private PositionService positionApi; + @Autowired + private OrganizeService organizeApi; + @Autowired + private VisualdevService visualdevService; + @Autowired + private VisualdevModelDataService visualdevModelDataService; + @Autowired + private DataInterfaceService dataInterFaceApi; + @Autowired + private VisualDevInfoService visualDevInfoService; + @Autowired + private ProvinceService areaApi; + @Autowired + private OnlineDevInfoUtils onlineDevInfoUtils; + + private Map nullDatamap = new HashMap<>(); + + /** + * 查询条件 + * + * @param list + * @param searchList + * @return + */ + public static List> getNoSwapList(List> list, List searchList) { + List> resultList = new ArrayList<>(); + if (searchList == null) { + return list; + } + for (Map dataVo : list) { + int i = 0; + for (VisualColumnSearchVO vo : searchList) { + Object dataModel = dataVo.get(vo.getVModel()); + if (dataModel == null || ObjectUtil.isEmpty(dataModel)) { + continue; + } + //多选框默认添加多选属性 + if (vo.getConfig().getJnpfKey().equals(JnpfKeyConsts.CHECKBOX) || JnpfKeyConsts.CASCADER.equals(vo.getConfig().getJnpfKey())) { + vo.setMultiple(true); + } + if (vo.getSearchType().equals("1")) { + //多选框筛选 + if (vo.getMultiple() != null && vo.getMultiple() == true) { + List asList; + if (String.valueOf(dataModel).contains("[")) { + asList = JsonUtil.getJsonToList(String.valueOf(dataModel), String.class); + } else { + String[] multipleList = String.valueOf(dataModel).split(","); + asList = Arrays.asList(multipleList); + } + boolean b = asList.stream().anyMatch(t -> vo.getValue().toString().contains(t)); + if (b) { + i++; + } + } else { + if (String.valueOf(vo.getValue()).equals(String.valueOf(dataModel))) { + i++; + } + } + } + if (vo.getSearchType().equals("2")) { + if (String.valueOf(dataModel).contains(String.valueOf(vo.getValue()))) { + i++; + } + } + if (vo.getSearchType().equals("3")) { + String key = vo.getConfig().getJnpfKey(); + switch (key) { + case JnpfKeyConsts.MODIFYTIME: + case JnpfKeyConsts.CREATETIME: + JSONArray timeStampArray = (JSONArray) vo.getValue(); + Long o1 = (Long) timeStampArray.get(0); + Long o2 = (Long) timeStampArray.get(1); + + //时间戳转string格式 + String startTime = DateUtil.daFormat(o1); + String endTime = DateUtil.daFormat(o2); + //处理时间查询条件范围 + endTime = endTime.substring(0, 10); + String firstTimeDate = OnlineDatabaseUtils.getTimeFormat(startTime); + String lastTimeDate = OnlineDatabaseUtils.getLastTimeFormat(endTime); + + String value = String.valueOf(dataModel); + if (value.contains(".")) { + value = value.substring(0, value.lastIndexOf(".")); + } + //只判断到日期 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + try { + boolean b = DateUtil.isEffectiveDate(sdf.parse(value), sdf.parse(firstTimeDate), sdf.parse(lastTimeDate)); + if (b) { + i++; + } + } catch (ParseException e) { + e.printStackTrace(); + } + break; + case JnpfKeyConsts.NUM_INPUT: + case JnpfKeyConsts.CALCULATE: + Float firstValue = null; + Float secondValue = null; + JSONArray objects = (JSONArray) vo.getValue(); + for (int k = 0; k < objects.size(); k++) { + Object n = objects.get(k); + if (ObjectUtil.isNotEmpty(n)) { + if (k == 0) { + firstValue = Float.parseFloat(String.valueOf(n)); + } else { + secondValue = Float.parseFloat(String.valueOf(n)); + } + } + } + //数据 + Float numValue = Float.parseFloat(String.valueOf(dataModel)); + + //条件1,2组合的情况 + if (firstValue != null && secondValue == null) { + if (numValue >= firstValue) { + i++; + } + } + if (firstValue != null && secondValue != null) { + if (numValue >= firstValue && numValue <= secondValue) { + i++; + } + } + if (firstValue == null && secondValue != null) { + if (numValue <= secondValue) { + i++; + } + } + break; + case JnpfKeyConsts.DATE: + String starTimeDates; + String endTimeDates; + if (dataModel == null) { + break; + } + //时间戳 + if (!String.valueOf(vo.getValue()).contains(":") && !String.valueOf(vo.getValue()).contains("-")) { + JSONArray DateTimeStampArray = (JSONArray) vo.getValue(); + Long d1 = (Long) DateTimeStampArray.get(0); + Long d2 = (Long) DateTimeStampArray.get(1); + long d1FirstTime = Long.parseLong(String.valueOf(d1)); + long d2LastTime = Long.parseLong(String.valueOf(d2)); + + //时间戳转string格式 + starTimeDates = DateUtil.daFormat(d1FirstTime); + endTimeDates = DateUtil.daFormat(d2LastTime); + + } else { + //时间字符串 + String[] keyArray = String.valueOf(vo.getValue()).split(","); + starTimeDates = keyArray[0]; + endTimeDates = keyArray[1]; + } + if (vo.getFormat() == null) { + starTimeDates = starTimeDates.substring(0, 10); + endTimeDates = endTimeDates.substring(0, 10); + } + starTimeDates = OnlineDatabaseUtils.getTimeFormat(starTimeDates); + endTimeDates = OnlineDatabaseUtils.getLastTimeFormat(endTimeDates); + + String dateValue = dataModel.toString(); + if (!dateValue.contains(":") && !dateValue.contains("-")) { + //时间戳 + Long timeResult = (Long) dataModel; + dateValue = DateUtil.daFormat(timeResult); + } + if (dateValue.contains(".")) { + dateValue = dateValue.substring(0, dateValue.lastIndexOf(".")); + } + dateValue = OnlineDatabaseUtils.getTimeFormat(dateValue); + //只判断到日期 + SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + try { + Boolean b = DateUtil.isEffectiveDate(sdfDate.parse(dateValue), sdfDate.parse(starTimeDates), sdfDate.parse(endTimeDates)); + if (b) { + i++; + } + } catch (ParseException e) { + e.printStackTrace(); + } + break; + case JnpfKeyConsts.TIME: + JSONArray timeArray = (JSONArray) vo.getValue(); + String start = String.valueOf(timeArray.get(0)); + String end = String.valueOf(timeArray.get(1)); + start = OnlineDatabaseUtils.getTimeFormat(start); + end = OnlineDatabaseUtils.getLastTimeFormat(end); + String timeValue = OnlineDatabaseUtils.getTimeFormat(String.valueOf(dataModel)); + SimpleDateFormat timeSim = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + try { + boolean b = DateUtil.isEffectiveDate(timeSim.parse(timeValue), timeSim.parse(start), timeSim.parse(end)); + if (b) { + i++; + } + } catch (ParseException e) { + e.printStackTrace(); + } + break; + default: + break; + } + } + if (i == searchList.size()) { + resultList.add(dataVo); + } + } + } + return resultList; + } + + /** + * 取出列表所用到的 用户 组织 岗位的id + * + * @param list 数据 + * @param swapDataVoList 控件 + */ + public static void pageIdList(List list, List swapDataVoList, Map localCache) { + Set userList = (Set) localCache.get("__user_list"); + Set orgList = (Set) localCache.get("__org_list"); + Set posList = (Set) localCache.get("__pos_list"); + Set AllOrgList = (Set) localCache.get("__allOrg_list"); + Set roleList = (Set) localCache.get("__role_list"); + for (FieLdsModel swapDataVo : swapDataVoList) { + String jnpfKey = swapDataVo.getConfig().getJnpfKey(); + String vModel = swapDataVo.getVModel(); + for (OnlineDevListDataVO listVo : list) { + Map dataMap = listVo.getData(); + if (StringUtil.isEmpty(String.valueOf(dataMap.get(vModel))) || dataMap.get(vModel) == null) { + continue; + } + if (String.valueOf(dataMap.get(vModel)).equals("[]") || String.valueOf(dataMap.get(vModel)).equals("null")) { + continue; + } else { + switch (jnpfKey) { + //公司组件 + case JnpfKeyConsts.COMSELECT: + //部门组件 + case JnpfKeyConsts.DEPSELECT: + //所属部门 + case JnpfKeyConsts.CURRDEPT: + //所属公司 + case JnpfKeyConsts.CURRORGANIZE: + if ("all".equals(swapDataVo.getShowLevel())) { + getIdInMethod(AllOrgList, dataMap.get(vModel)); + } else { + getIdInMethod(orgList, dataMap.get(vModel)); + } + break; + //角色 + case JnpfKeyConsts.ROLESELECT: + getIdInMethod(roleList, dataMap.get(vModel)); + break; + //岗位组件 + case JnpfKeyConsts.POSSELECT: + //所属岗位 + case JnpfKeyConsts.CURRPOSITION: + getIdInMethod(posList, dataMap.get(vModel)); + break; + + //用户组件 + case JnpfKeyConsts.USERSELECT: + //创建用户 + case JnpfKeyConsts.CREATEUSER: + //修改用户 + case JnpfKeyConsts.MODIFYUSER: + getIdInMethod(userList, dataMap.get(vModel)); + break; + default: + break; + } + } + } + } + } + + /** + * 存取对应id集合 + * + * @param idList + * @param modelData + * @return + */ + public static Collection getIdInMethod(Collection idList, Object modelData) { + if (OnlinePublicUtils.getMultiple(String.valueOf(modelData), MultipleControlEnum.MULTIPLE_JSON_TWO.getMultipleChar())) { + String[][] data = JsonUtil.getJsonToBean(String.valueOf(modelData), String[][].class); + for (String[] AddressData : data) { + for (String s : AddressData) { + idList.add(s); + } + } + } else if (OnlinePublicUtils.getMultiple(String.valueOf(modelData), MultipleControlEnum.MULTIPLE_JSON_ONE.getMultipleChar())) { + idList.addAll(JsonUtil.getJsonToList(String.valueOf(modelData), String.class)); + } else { + String[] modelDatas = String.valueOf(modelData).split(","); + for (int i = 0; i < modelDatas.length; i++) { + idList.add(modelDatas[i]); + } + } + return idList; + } + + /** + * 分组页面 + * + * @param realList + * @param columnDataModel + * @return + */ + public static List> groupData(List> realList, ColumnDataModel columnDataModel) { + List> columnList = JsonUtil.getJsonToListMap(columnDataModel.getColumnList()); + String firstField; + String groupField = columnDataModel.getGroupField(); + Map map = columnList.stream().filter(t -> !String.valueOf(t.get("prop")).equals(columnDataModel.getGroupField())).findFirst().orElse(null); + if (map == null) { + map = columnList.stream().filter(t -> String.valueOf(t.get("prop")).equals(columnDataModel.getGroupField())).findFirst().orElse(null); + } + firstField = String.valueOf(map.get("prop")); + + Map>> twoMap = new LinkedHashMap<>(16); + + for (Map realMap : realList) { + String value = String.valueOf(realMap.get(groupField)); + boolean isKey = twoMap.get(value) != null; + if (isKey) { + List> maps = twoMap.get(value); + maps.add(realMap); + twoMap.put(value, maps); + } else { + List> childrenList = new ArrayList<>(); + childrenList.add(realMap); + twoMap.put(value, childrenList); + } + } + + List> resultList = new ArrayList<>(); + for (String key : twoMap.keySet()) { + Map thirdMap = new HashMap<>(16); + thirdMap.put(firstField, !key.equals("null") ? key : ""); + thirdMap.put("top", true); + thirdMap.put("id", RandomUtil.uuId()); + thirdMap.put("children", twoMap.get(key)); + resultList.add(thirdMap); + } + return resultList; + } + + /** + * 递归查询 + * + * @param label + * @param value + * @param Children + * @param data + * @param options + */ + public static void getOptions(String label, String value, String Children, JSONArray data, List> options) { + for (int i = 0; i < data.size(); i++) { + JSONObject ob = data.getJSONObject(i); + Map tree = new HashMap<>(16); + tree.put(value, String.valueOf(ob.get(value))); + tree.put(label, String.valueOf(ob.get(label))); + options.add(tree); + if (ob.get(Children) != null) { + JSONArray childrenArray = ob.getJSONArray(Children); + getOptions(label, value, Children, childrenArray, options); + } + } + } + + /** + * 树形列表页面 + * + * @param realList + * @param columnDataModel + * @return + */ + public static List> treeListData(List> realList, ColumnDataModel columnDataModel) { + String parentField = columnDataModel.getParentField() + "_id"; + String childField = columnDataModel.getSubField(); + for (int i = 0; i < realList.size(); i++) { + Map item = realList.get(i); + if ((item.get(parentField) != null && !StringUtil.isNotEmpty(item.get(parentField).toString())) || (item.get(parentField) != null && !"[]".equals(item.get(parentField).toString()))) { + if (addChild(item, realList, parentField, childField) && realList.size() > 0) { + realList.remove(item); + i--; + } + } + } + return realList; + } + + /** + * 级联递归 + * + * @param value + * @param label + * @param children + * @param data + * @param result + */ + private static void treeToList(String value, String label, String children, JSONArray data, List> result) { + for (int i = 0; i < data.size(); i++) { + JSONObject ob = data.getJSONObject(i); + Map tree = new HashMap<>(16); + tree.put(value, String.valueOf(ob.get(value))); + tree.put(label, String.valueOf(ob.get(label))); + result.add(tree); + if (ob.get(children) != null) { + JSONArray childArray = ob.getJSONArray(children); + treeToList(value, label, children, childArray, result); + } + } + } + + //递归 + private static boolean addChild(Map node, List> list, String parentField, String childField) { + + for (int i = 0; i < list.size(); i++) { + Map ele = list.get(i); + if (ele.get(childField).equals(node.get(parentField))) { + if (ele.get("children") == null) { + ele.put("children", new ArrayList<>()); + } + List> children = (List>) ele.get("children"); + children.add(node); + ele.put("children", children); + return true; + } + if (ele.get("children") != null) { + List> children = (List>) ele.get("children"); + if (addChild(node, children, parentField, childField)) { + return true; + } + } + } + return false; + } + + /** + * 保存需要转换的数据到redis(系统控件) + * + * @param swapDataVoList + */ + public void sysNeedSwapData(List swapDataVoList, String visualDevId, Map localCache) { + + //公共数据 + String dsName = Optional.ofNullable(DataSourceContextHolder.getDatasourceId()).orElse(""); + + String redisKey; + try { + for (FieLdsModel swapDataVo : swapDataVoList) { + String jnpfKey = swapDataVo.getConfig().getJnpfKey(); + String dataType = swapDataVo.getConfig().getDataType(); + switch (jnpfKey) { + //省市区联动 + case JnpfKeyConsts.ADDRESS: + redisKey = ""; + if (!redisUtil.exists("")) { + List provinceEntityList = new ArrayList<>(); + Map provinceMap = new HashMap<>(16); + provinceEntityList.stream().forEach(p -> provinceMap.put(p.getId(), p.getFullName())); + redisUtil.insert(redisKey, provinceMap, RedisUtil.CAHCEWEEK); + } + if (!localCache.containsKey(redisKey)) { + localCache.put(redisKey, redisUtil.getMap(redisKey)); + } + break; + default: + break; + } + if (dataType != null) { + //数据接口的数据存放 + String label= swapDataVo.getProps().getLabel(); + String value= swapDataVo.getProps().getValue(); + String children = swapDataVo.getProps().getChildren(); + List> options = new ArrayList<>(); + Map dataInterfaceMap = new HashMap<>(16); + + //静态数据 + if (dataType.equals(OnlineDataTypeEnum.STATIC.getType())) { + redisKey = String.format("%s-%s-%s", visualDevId, swapDataVo.getVModel(), OnlineDataTypeEnum.STATIC.getType()); + if (!redisUtil.exists(redisKey)) { + if (swapDataVo.getOptions() != null) { + options = JsonUtil.getJsonToListMap(swapDataVo.getOptions()); + String Children = swapDataVo.getProps().getChildren(); + JSONArray data = JsonUtil.getListToJsonArray(options); + getOptions(label, value, Children, data, options); + } else { + options = JsonUtil.getJsonToListMap(swapDataVo.getOptions()); + } + options.stream().forEach(o -> { + dataInterfaceMap.put(String.valueOf(o.get(value)), String.valueOf(o.get(label))); + }); + String staticData = JsonUtil.getObjectToString(dataInterfaceMap); + redisUtil.insert(redisKey, staticData, 60 * 5); + if (!localCache.containsKey(redisKey)) { + localCache.put(redisKey, dataInterfaceMap); + } + } else { + if (!localCache.containsKey(redisKey)) { + String staticDataString = redisUtil.getString(redisKey).toString(); + localCache.put(redisKey, JsonUtil.stringToMap(staticDataString)); + } + } + } + //远端数据 + if (dataType.equals(OnlineDataTypeEnum.DYNAMIC.getType())) { + redisKey = String.format("%s-%s-%s", dsName, OnlineDataTypeEnum.DYNAMIC.getType(), swapDataVo.getConfig().getPropsUrl()); + String redisKey2 = String.format("%s-%s-%s-%s-%s-%s", dsName, OnlineDataTypeEnum.DYNAMIC.getType(), swapDataVo.getConfig().getPropsUrl(), label, value, children); + if (!redisUtil.exists(redisKey2)) { + ActionResult data = null; + if (!redisUtil.exists(redisKey)) { + data = dataInterFaceApi.infoToId(swapDataVo.getConfig().getPropsUrl(),null,null); + //缓存接口全部数据 + redisUtil.insert(redisKey, JSONObject.toJSONString(data), 60 * 5); + } else { + data = JSONObject.parseObject(String.valueOf(redisUtil.getString(redisKey)), ActionResult.class); + } + if (!localCache.containsKey(redisKey)) { + localCache.put(redisKey, data); + } + if (data != null && data.getData() != null) { + List> dataList = new ArrayList<>(); + if (data.getData() instanceof DataInterfaceActionVo) { + DataInterfaceActionVo actionVo = (DataInterfaceActionVo) data.getData(); + if (actionVo.getData() instanceof List) { + dataList = (List>) actionVo.getData(); + } + } else if (data.getData() instanceof List) { + dataList = (List>) data.getData(); + } + JSONArray dataAll = JsonUtil.getListToJsonArray(dataList); + treeToList(label, value, children, dataAll, options); + options.stream().forEach(o -> { + dataInterfaceMap.put(String.valueOf(o.get(value)), String.valueOf(o.get(label))); + }); + + //缓存接口根据特定字段转换后的全部数据 + String dynamicData = JsonUtil.getObjectToString(dataInterfaceMap); + redisUtil.insert(redisKey2, dynamicData, 60 * 5); + localCache.put(redisKey2, dataInterfaceMap); + } + } else { + if (!localCache.containsKey(redisKey)) { + localCache.put(redisKey, JSONObject.parseObject(String.valueOf(redisUtil.getString(redisKey)), ActionResult.class)); + } + if (!localCache.containsKey(redisKey2)) { + //转成map格式 + String dynamicString = redisUtil.getString(redisKey2).toString(); + localCache.put(redisKey2, JsonUtil.stringToMap(dynamicString)); + } + } + } + //数据字典 + if (dataType.equals(OnlineDataTypeEnum.DICTIONARY.getType())) { + redisKey = String.format("%s-%s-%s", dsName, OnlineDataTypeEnum.DICTIONARY.getType(), swapDataVo.getConfig().getDictionaryType()); + if (!redisUtil.exists(redisKey)) { + List list = dictionaryDataApi.getDicList(swapDataVo.getConfig().getDictionaryType()); + options = list.stream().map(dic -> { + Map dictionaryMap = new HashMap<>(16); + dictionaryMap.put("id", dic.getId()); + dictionaryMap.put("enCode", dic.getEnCode()); + dictionaryMap.put("fullName", dic.getFullName()); + return dictionaryMap; + }).collect(Collectors.toList()); + + String dictionaryData = JsonUtil.getObjectToString(options); + redisUtil.insert(redisKey, dictionaryData, 60 * 5); + localCache.put(redisKey, options); + } else { + if (!localCache.containsKey(redisKey)) { + String dictionaryStringData = redisUtil.getString(redisKey).toString(); + localCache.put(redisKey, JsonUtil.getJsonToListMap(dictionaryStringData)); + } + } + } + } + } + } catch (Exception e) { + log.error("在线开发转换数据异常:" + e.getMessage()); + e.printStackTrace(); + } + + + } + + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/util/onlineDevUtil/OnlineProductSqlUtils.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/util/onlineDevUtil/OnlineProductSqlUtils.java new file mode 100644 index 0000000..298d238 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/util/onlineDevUtil/OnlineProductSqlUtils.java @@ -0,0 +1,926 @@ +package jnpf.onlinedev.util.onlineDevUtil; + +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import jnpf.base.model.ColumnDataModel; +import jnpf.base.model.Template6.ColumnListField; +import jnpf.base.model.VisualDevJsonModel; +import jnpf.constant.PermissionConst; +import jnpf.database.model.entity.DbLinkEntity; +import jnpf.database.model.superQuery.SuperJsonModel; +import jnpf.database.model.superQuery.SuperQueryJsonModel; +import jnpf.database.util.ConnUtil; +import jnpf.database.util.DynamicDataSourceUtil; +import jnpf.emnus.SearchMethodEnum; +import jnpf.exception.DataException; +import jnpf.model.visualJson.FieLdsModel; +import jnpf.model.visualJson.TableModel; +import jnpf.model.visualJson.analysis.FormAllModel; +import jnpf.model.visualJson.analysis.FormColumnModel; +import jnpf.model.visualJson.analysis.FormEnum; +import jnpf.model.visualJson.config.ConfigModel; +import jnpf.onlinedev.model.OnlineDevListModel.OnlineColumnChildFieldModel; +import jnpf.onlinedev.model.OnlineDevListModel.OnlineColumnFieldModel; +import jnpf.onlinedev.model.OnlineDevListModel.VisualColumnSearchVO; +import jnpf.onlinedev.model.PaginationModel; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.entity.UserRelationEntity; +import jnpf.permission.model.authorize.OnlineDynamicSqlModel; +import jnpf.permission.service.AuthorizeService; +import jnpf.permission.service.OrganizeService; +import jnpf.permission.service.UserRelationService; +import jnpf.permission.service.UserService; +import jnpf.util.*; +import jnpf.util.context.RequestContext; +import jnpf.util.context.SpringContext; +import jnpf.util.visiual.JnpfKeyConsts; +import lombok.Cleanup; +import org.apache.commons.lang3.StringUtils; +import org.mybatis.dynamic.sql.*; +import org.mybatis.dynamic.sql.select.QueryExpressionDSL; +import org.mybatis.dynamic.sql.select.SelectModel; + +import java.math.BigDecimal; +import java.sql.Connection; +import java.sql.SQLException; +import java.text.DecimalFormat; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 生成在线sql语句 + * + * @author JNPF开发平台组 + * @version V3.2.8 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/11/8 + */ +public class OnlineProductSqlUtils { + private static FlowFormDataUtil flowDataUtil = SpringContext.getBean(FlowFormDataUtil.class); + private static UserService userApi = SpringContext.getBean(UserService.class); + private static UserRelationService userRelationApi = SpringContext.getBean(UserRelationService.class); + private static OrganizeService organizeApi = SpringContext.getBean(OrganizeService.class); + private static AuthorizeService authorizeUtil = SpringContext.getBean(AuthorizeService.class); + + /** + * 生成列表查询sql + * + * @param sqlModels + * @param visualDevJsonModel + * @param columnFieldList + * @param linkEntity + * @return + */ + public static void getColumnListSql(List sqlModels, VisualDevJsonModel visualDevJsonModel, + List columnFieldList, DbLinkEntity linkEntity) { + List childFieldList; + try { + columnFieldList = columnFieldList.stream().distinct().collect(Collectors.toList()); + ColumnDataModel columnData = visualDevJsonModel.getColumnData(); + List modelList = JsonUtil.getJsonToList(columnData.getColumnList(), ColumnListField.class); + + @Cleanup Connection conn = ConnUtil.getConnOrDefault(linkEntity); + List tableModelList = visualDevJsonModel.getVisualTables(); + String databaseProductName = conn.getMetaData().getDatabaseProductName().trim(); + boolean isClobDbType = databaseProductName.equalsIgnoreCase("oracle") || databaseProductName.equalsIgnoreCase("DM DBMS"); + //主表 + TableModel mainTable = tableModelList.stream().filter(model -> model.getTypeId().equals("1")).findFirst().orElse(null); + //获取主键 + Integer primaryKeyPolicy = visualDevJsonModel.getFormData().getPrimaryKeyPolicy(); + String pKeyName = flowDataUtil.getKey(conn, mainTable.getTable(), primaryKeyPolicy); + //列表中区别子表正则 + String reg = "^[jnpf_]\\S*_jnpf\\S*"; + + //列表主表字段 + List mainTableFields = columnFieldList.stream().filter(s -> !s.matches(reg) && !s.toLowerCase().contains(JnpfKeyConsts.CHILD_TABLE_PREFIX)).collect(Collectors.toList()); + mainTableFields.add(pKeyName); + if (!visualDevJsonModel.isFlowEnable() && primaryKeyPolicy == 2) { + primaryKeyPolicy = 1; + mainTableFields.add(flowDataUtil.getKey(conn, mainTable.getTable(), primaryKeyPolicy)); + } + + if (visualDevJsonModel.getFormData().getConcurrencyLock()) { + mainTableFields.add(TableFeildsEnum.VERSION.getField()); + } + //有开启流程得需要查询流程引擎信息 + if (visualDevJsonModel.isFlowEnable()) { + String s = TableFeildsEnum.FLOWID.getField(); + if (isClobDbType) { + s = TableFeildsEnum.FLOWID.getField().toUpperCase(); + } + mainTableFields.add(s); + } + + if (columnData != null && ObjectUtil.isNotEmpty(columnData.getType()) && columnData.getType() == 3) { + String groupField = visualDevJsonModel.getColumnData().getGroupField(); + boolean contains = columnFieldList.contains(groupField); + if (!contains) { + if (groupField.startsWith("jnpf_")) { + columnFieldList.add(groupField); + } else { + mainTableFields.add(groupField); + } + } + } + + //列表子表字段 + childFieldList = columnFieldList.stream().filter(s -> s.matches(reg)).map(child -> { + OnlineColumnFieldModel fieldModel = new OnlineColumnFieldModel(); + String s1 = child.substring(child.lastIndexOf("jnpf_")).replace("jnpf_", ""); + String s2 = child.substring(child.indexOf("_") + 1, child.lastIndexOf("_jnpf")); + fieldModel.setTableName(s2); + fieldModel.setField(s1); + fieldModel.setOriginallyField(child); + return fieldModel; + }).collect(Collectors.toList()); + + //取列表用到的表 + List ColumnTableNameList = childFieldList.stream().map(t -> t.getTableName().toLowerCase()).collect(Collectors.toList()); + List tableModelList1 = tableModelList.stream().filter(t -> ColumnTableNameList.contains(t.getTable().toLowerCase())).collect(Collectors.toList()); + List classifyFieldList = new ArrayList<>(10); + for (TableModel t : tableModelList1) { + OnlineColumnChildFieldModel childFieldModel = new OnlineColumnChildFieldModel(); + childFieldModel.setTable(t.getTable()); + childFieldModel.setRelationField(t.getRelationField()); + childFieldModel.setTableField(t.getTableField()); + classifyFieldList.add(childFieldModel); + } + + for (OnlineDynamicSqlModel dycModel : sqlModels) { + if (dycModel.isMain()) { + List mainSqlColumns = getBasicColumns(mainTableFields, sqlModels, dycModel, modelList, isClobDbType); + dycModel.setColumns(mainSqlColumns); + } else { + if (classifyFieldList.size() > 0) { + Map> mastTableCols = childFieldList.stream().collect(Collectors.groupingBy(OnlineColumnFieldModel::getTableName)); + List onlineColumnFieldModels = Optional.ofNullable(mastTableCols.get(dycModel.getTableName())).orElse(new ArrayList<>()); + List mastSqlCols = getBasicColumnsChild(modelList, dycModel, onlineColumnFieldModels, isClobDbType); + dycModel.setColumns(mastSqlCols); + } + } + } + } catch (SQLException sqlException) { + sqlException.printStackTrace(); + } catch (DataException e) { + e.printStackTrace(); + } + } + + + public static List getGroupBySqlTable(List sqlModels, VisualDevJsonModel visualDevJsonModel, + List columnFieldList, boolean isClobDbType) { + List childFieldList; + List basicColumns = new ArrayList<>(); + try { + columnFieldList = columnFieldList.stream().distinct().collect(Collectors.toList()); + + List tableModelList = visualDevJsonModel.getVisualTables(); + + //列表中区别子表正则 + String reg = "^[jnpf_]\\S*_jnpf\\S*"; + + //列表主表字段 + List mainTableFields = columnFieldList.stream().filter(s -> !s.matches(reg) + && !s.toLowerCase().contains(JnpfKeyConsts.CHILD_TABLE_PREFIX)).collect(Collectors.toList()); + + if (visualDevJsonModel.getFormData().getConcurrencyLock()) { + mainTableFields.add(TableFeildsEnum.VERSION.getField()); + } + + //有开启流程得需要查询流程引擎信息 + if (visualDevJsonModel.isFlowEnable()) { + String s = TableFeildsEnum.FLOWID.getField(); + if (isClobDbType) { + s = TableFeildsEnum.FLOWID.getField().toUpperCase(); + } + mainTableFields.add(s); + } + + //列表子表字段 + childFieldList = columnFieldList.stream().filter(s -> s.matches(reg)).map(child -> { + OnlineColumnFieldModel fieldModel = new OnlineColumnFieldModel(); + String s1 = child.substring(child.lastIndexOf("jnpf_")).replace("jnpf_", ""); + String s2 = child.substring(child.indexOf("_") + 1, child.lastIndexOf("_jnpf")); + fieldModel.setTableName(s2); + fieldModel.setField(s1); + fieldModel.setOriginallyField(child); + return fieldModel; + }).collect(Collectors.toList()); + + //取列表用到的表 + List ColumnTableNameList = childFieldList.stream().map(t -> t.getTableName().toLowerCase()).collect(Collectors.toList()); + List tableModelList1 = tableModelList.stream().filter(t -> ColumnTableNameList.contains(t.getTable().toLowerCase())).collect(Collectors.toList()); + List classifyFieldList = new ArrayList<>(10); + for (TableModel t : tableModelList1) { + OnlineColumnChildFieldModel childFieldModel = new OnlineColumnChildFieldModel(); + childFieldModel.setTable(t.getTable()); + childFieldModel.setRelationField(t.getRelationField()); + childFieldModel.setTableField(t.getTableField()); + classifyFieldList.add(childFieldModel); + } + + List modelList = JsonUtil.getJsonToList(visualDevJsonModel.getColumnData().getColumnList(), ColumnListField.class); + for (OnlineDynamicSqlModel dycModel : sqlModels) { + if (dycModel.isMain()) { + List mainSqlColumns = getBasicColumns(mainTableFields, sqlModels, dycModel, modelList, isClobDbType); + basicColumns.addAll(mainSqlColumns); + } else { + if (classifyFieldList.size() > 0) { + Map> mastTableCols = childFieldList.stream().collect(Collectors.groupingBy(OnlineColumnFieldModel::getTableName)); + List onlineColumnFieldModels = Optional.ofNullable(mastTableCols.get(dycModel.getTableName())).orElse(new ArrayList<>()); + List mastSqlCols = getBasicColumnsChild(modelList, dycModel, onlineColumnFieldModels, isClobDbType); + basicColumns.addAll(mastSqlCols); + } + } + } + } catch (Exception e) { + e.printStackTrace(); + } + return basicColumns; + } + + /** + * + */ + public static void getConditionSql(QueryExpressionDSL.QueryExpressionWhereBuilder form, String databaseProductName, List searchVOList, + List sqlModelList) throws SQLException { + //成对注释1---进来前有切库。切回主库查询用户相关信息 + DynamicDataSourceUtil.switchToDataSource(null); + try { + boolean isOracle = databaseProductName.equalsIgnoreCase("oracle"); + boolean isPostgre = databaseProductName.equalsIgnoreCase("PostgreSQL"); + boolean isSqlServer = databaseProductName.equalsIgnoreCase("Microsoft SQL Server"); + for (int k = 0; k < searchVOList.size(); k++) { + VisualColumnSearchVO vo = searchVOList.get(k); + String jnpfKey = "jnpfkey"; + if (Objects.nonNull(vo.getConfig())) { + jnpfKey = vo.getConfig().getJnpfKey(); + } + String tableName = vo.getTable(); + OnlineDynamicSqlModel sqlModel = sqlModelList.stream().filter(sql -> sql.getTableName().equals(tableName)).findFirst().orElse(null); + SqlTable sqlTable = sqlModel.getSqlTable(); + String searchType = vo.getSearchType(); + String vModel = vo.getField(); + String format; + + boolean isSearchMultiple = vo.getSearchMultiple() != null && vo.getSearchMultiple(); + //搜索或字段其中一个为多选, 都按照多选处理 + boolean isMultiple = isSearchMultiple || vo.getMultiple() != null && vo.getMultiple(); + + List dataValues = new ArrayList<>(); + SqlColumn sqlColumn = sqlTable.column(vModel); + List groupList = new ArrayList<>(); + if (isMultiple) { + Object tmpValue = vo.getValue(); + boolean isComSelect = JnpfKeyConsts.COMSELECT.equals(jnpfKey); + if (isComSelect) { + //左侧树情况左侧条件为单选查询, 所以组织查询全部转为字符串重新处理 + //组织单独处理, 多选是二维数组, 单选是数组 + tmpValue = JSONArray.toJSONString(vo.getValue()); + } + if (tmpValue instanceof String) { + //多选的情况, 若为字符串则处理成多选的字符串数组 + tmpValue = OnlineSwapDataUtils.convertValueToString((String) tmpValue, true, isComSelect); + dataValues = JSON.parseArray((String) tmpValue, String.class); + } else { + dataValues = JsonUtil.getJsonToList(tmpValue, String.class); + } + } else { + boolean isCurOrg = JnpfKeyConsts.CURRORGANIZE.equals(jnpfKey); + if (isCurOrg) { + //所属组织只保存了当前组织的ID, 没有存储组织数组, 将过滤条件中的组织数组取最后一个ID + vo.setValue(OnlineSwapDataUtils.getLastOrganizeId(vo.getValue())); + } + dataValues.add(vo.getValue().toString()); + } + String value = vo.getValue().toString(); + if (isMultiple || JnpfKeyConsts.CHECKBOX.equals(jnpfKey) || JnpfKeyConsts.CASCADER.equals(jnpfKey) + || JnpfKeyConsts.CURRORGANIZE.equals(jnpfKey) || JnpfKeyConsts.ADDRESS.equals(jnpfKey) || JnpfKeyConsts.CUSTOMUSERSELECT.equals(jnpfKey) + ) { + searchType = "2" ; + } + if (JnpfKeyConsts.COM_INPUT.equals(jnpfKey) || JnpfKeyConsts.TEXTAREA.equals(jnpfKey)) { + if ("3".equals(searchType)) { + searchType = "2" ; + } + } + if ("1".equals(searchType)) { + form.and(sqlColumn, SqlBuilder.isEqualTo(value)); + } else if ("2".equals(searchType)) { + if (JnpfKeyConsts.CUSTOMUSERSELECT.equals(jnpfKey)) { + // 分组 组织 岗位 角色 用户 + for (String userVal : dataValues) { + convertUserSelectData(sqlColumn, groupList, userVal,true); + } + } + if (isMultiple) { + for (String val : dataValues) { + if (isSqlServer) { + val = val.replaceAll("\\[", "[[]"); + } + groupList.add(SqlBuilder.or(sqlColumn, SqlBuilder.isLike("%" + val + "%"))); + } + } + if (isSqlServer) { + value = value.replaceAll("\\[", "[[]"); + } + value = "%" + value + "%" ; + if (groupList.size() > 0) { + form.and(sqlColumn, SqlBuilder.isLike(value), groupList); + } else { + form.and(sqlColumn, SqlBuilder.isLike(value)); + } + } else if ("3".equals(searchType)) { + switch (jnpfKey) { + case JnpfKeyConsts.MODIFYTIME: + case JnpfKeyConsts.CREATETIME: + case JnpfKeyConsts.DATE: + JSONArray timeStampArray = (JSONArray) vo.getValue(); + Long o1 = (Long) timeStampArray.get(0); + Long o2 = (Long) timeStampArray.get(1); + format = StringUtil.isEmpty(vo.getFormat()) ? "yyyy-MM-dd HH:mm:ss" : DateTimeFormatConstant.getFormat(vo.getFormat()); + //时间戳转string格式 + String startTime = OnlinePublicUtils.getDateByFormat(o1, format); + String endTime = OnlinePublicUtils.getDateByFormat(o2, format); + //处理创建和修改时间查询条件范围 + if (JnpfKeyConsts.CREATETIME.equals(jnpfKey) || JnpfKeyConsts.MODIFYTIME.equals(jnpfKey)) { + endTime = endTime.substring(0, 10); + } + String firstTimeDate = OnlineDatabaseUtils.getTimeFormat(startTime); + String lastTimeDate = OnlineDatabaseUtils.getLastTimeFormat(endTime); + if (isOracle || isPostgre) { + form.and(sqlTable.column(vModel), SqlBuilder.isBetween(new Date(o1)).and(new Date(o2))); + } else { + form.and(sqlTable.column(vModel), SqlBuilder.isBetween(firstTimeDate).and(lastTimeDate)); + } + break; + case JnpfKeyConsts.TIME: + List stringList = JsonUtil.getJsonToList(value, String.class); + form.and(sqlTable.column(vModel), SqlBuilder.isBetween(stringList.get(0)).and(stringList.get(1))); + break; + case JnpfKeyConsts.NUM_INPUT: + case JnpfKeyConsts.CALCULATE: + BigDecimal firstValue = null; + BigDecimal secondValue = null; + JSONArray objects = (JSONArray) vo.getValue(); + for (int i = 0; i < objects.size(); i++) { + Object n = objects.get(i); + if (ObjectUtil.isNotEmpty(n)) { + if (i == 0) { + firstValue = new BigDecimal(String.valueOf(n)); + } else { + secondValue = new BigDecimal(String.valueOf(n)); + } + } + } + if (firstValue != null) { + form.and(sqlTable.column(vModel), SqlBuilder.isGreaterThanOrEqualTo(firstValue)); + } + if (secondValue != null) { + form.and(sqlTable.column(vModel), SqlBuilder.isLessThanOrEqualTo(secondValue)); + } + break; + default: + break; + } + } + } + } finally { + //成对注释1---完成后。切回数据库 + DynamicDataSourceUtil.clearSwitchDataSource(); + } + } + + /** + * 封装搜索数据 + */ + public static void queryList(List formAllModel, VisualDevJsonModel visualDevJsonModel, PaginationModel paginationModel) { + String moduleId = paginationModel.getMenuId(); + //数据权限 + List authorizeListAll = authorizeUtil.getConditionSql(moduleId); + for (SuperJsonModel superJsonModel : authorizeListAll) { + List conditionList = superJsonModel.getConditionList(); + for (SuperQueryJsonModel superQueryJsonModel : conditionList) { + List fieLdsModelList = superQueryJsonModel.getGroups(); + for (FieLdsModel fieLdsModel : fieLdsModelList) { + convertUserSelectData(fieLdsModel); + } + } + } + visualDevJsonModel.setAuthorize(authorizeListAll); + + //数据过滤 + boolean isApp = !RequestContext.isOrignPc(); + ColumnDataModel columnData = isApp ? visualDevJsonModel.getAppColumnData() : visualDevJsonModel.getColumnData(); + if(columnData != null){ + SuperJsonModel ruleList = isApp ? columnData.getRuleListApp() : columnData.getRuleList(); + SuperJsonModel ruleJsonModel = ruleList != null ? ruleList : new SuperJsonModel(); + List ruleJsonModelList = ruleJsonModel.getConditionList(); + for (SuperQueryJsonModel ruleQueryModel : ruleJsonModelList) { + List fieLdsModelList = ruleQueryModel.getGroups(); + for (FieLdsModel fieLdsModel : fieLdsModelList) { + fieLdsModel.setVModel(fieLdsModel.getId()); + tabelName(fieLdsModel, formAllModel); + } + } + visualDevJsonModel.setRuleQuery(ruleJsonModel); + } + + //高级搜索 + String superQueryJson = paginationModel.getSuperQueryJson(); + if (StringUtil.isNotEmpty(superQueryJson)) { + SuperJsonModel queryJsonModel = JsonUtil.getJsonToBean(superQueryJson, SuperJsonModel.class); + List superQueryListAll = queryJsonModel.getConditionList(); + for (SuperQueryJsonModel superQueryJsonModel : superQueryListAll) { + List fieLdsModelList = superQueryJsonModel.getGroups(); + for (FieLdsModel fieLdsModel : fieLdsModelList) { + fieLdsModel.setVModel(fieLdsModel.getId()); + tabelName(fieLdsModel, formAllModel); + } + } + visualDevJsonModel.setSuperQuery(queryJsonModel); + } + + //列表搜索 + String queryJson = paginationModel.getQueryJson(); + if (StringUtil.isNotEmpty(queryJson)) { + Map keyJsonMap = JsonUtil.stringToMap(queryJson); + List searchVOListAll = JsonUtil.getJsonToList(columnData.getSearchList(), FieLdsModel.class); + searchVOListAll.addAll(treeRelation(columnData, formAllModel)); + List searchVOList = new ArrayList<>(); + for (String model : keyJsonMap.keySet()) { + FieLdsModel fieLdsModel = searchVOListAll.stream().filter(t -> model.equals(t.getId())).findFirst().orElse(null); + Object object = keyJsonMap.get(model); + if (fieLdsModel != null) { + ConfigModel config = fieLdsModel.getConfig(); + Integer searchType = fieLdsModel.getSearchType(); + String jnpfKey = config.getJnpfKey(); + //模糊搜索 + boolean isMultiple = fieLdsModel.getSearchMultiple() || fieLdsModel.getMultiple(); + List type = JnpfKeyConsts.SelectIgnore; + //文本框搜索 + List base = JnpfKeyConsts.BaseSelect; + if (isMultiple || type.contains(jnpfKey)) { + if(object instanceof String){ + object = new ArrayList(){{add(String.valueOf(keyJsonMap.get(model)));}}; + } + searchType = 4; + } + if (base.contains(jnpfKey) && searchType == 3) { + searchType = 2; + } + String symbol = searchType == 1 ? SearchMethodEnum.Equal.getSymbol() : searchType == 3 ? SearchMethodEnum.Between.getSymbol() : searchType == 2 ? SearchMethodEnum.Like.getSymbol() : SearchMethodEnum.Included.getSymbol(); + fieLdsModel.setSymbol(symbol); + if (object instanceof List) { + fieLdsModel.setFieldValue(JsonUtil.getObjectToString(object)); + } else { + fieLdsModel.setFieldValue(String.valueOf(object)); + } + tabelName(fieLdsModel, formAllModel); + searchVOList.add(fieLdsModel); + } + } + SuperQueryJsonModel queryJsonModel = new SuperQueryJsonModel(); + queryJsonModel.setGroups(searchVOList); + + SuperJsonModel superJsonModel = new SuperJsonModel(); + superJsonModel.setConditionList(new ArrayList() {{ + add(queryJsonModel); + }}); + visualDevJsonModel.setQuery(superJsonModel); + } + } + + /** + * 赋值表名 + * + * @param fieLdsModel + * @param formAllModel + */ + private static void tabelName(FieLdsModel fieLdsModel, List formAllModel) { + //主表数据 + List mast = formAllModel.stream().filter(t -> FormEnum.mast.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + //列表子表数据 + List mastTable = formAllModel.stream().filter(t -> FormEnum.mastTable.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + //子表 + List childTable = formAllModel.stream().filter(t -> FormEnum.table.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + if (fieLdsModel != null) { + String vModel = fieLdsModel.getId().split("-")[0]; + String field = fieLdsModel.getId().split("-").length > 1 ? fieLdsModel.getId().split("-")[1] : ""; + FormAllModel mastModel = mast.stream().filter(t -> vModel.equals(t.getFormColumnModel().getFieLdsModel().getVModel())).findFirst().orElse(null); + if (mastModel != null) { + fieLdsModel.getConfig().setTableName(mastModel.getFormColumnModel().getFieLdsModel().getConfig().getTableName()); + fieLdsModel.getConfig().setJnpfKey(mastModel.getFormColumnModel().getFieLdsModel().getConfig().getJnpfKey()); + } + FormAllModel mastTableModel = mastTable.stream().filter(t -> vModel.equals(t.getFormMastTableModel().getVModel())).findFirst().orElse(null); + if (mastTableModel != null) { + fieLdsModel.getConfig().setTableName(mastTableModel.getFormMastTableModel().getMastTable().getFieLdsModel().getConfig().getTableName()); + fieLdsModel.getConfig().setJnpfKey(mastTableModel.getFormMastTableModel().getMastTable().getFieLdsModel().getConfig().getJnpfKey()); + } + FormAllModel childTableModel = childTable.stream().filter(t -> vModel.equals(t.getChildList().getTableModel())).findFirst().orElse(null); + if (childTableModel != null) { + fieLdsModel.getConfig().setTableName(childTableModel.getChildList().getTableName()); + List childList = childTableModel.getChildList().getChildList(); + for (FormColumnModel formColumnModel : childList) { + FieLdsModel childFieLdsModel = formColumnModel.getFieLdsModel(); + String childModel = childFieLdsModel.getVModel(); + if (childModel.equals(field)) { + fieLdsModel.getConfig().setJnpfKey(childFieLdsModel.getConfig().getJnpfKey()); + } + } + } + convertUserSelectData(fieLdsModel); + } + } + + private static void convertUserSelectData(FieLdsModel fieLdsModel){ + List symbolList = new ArrayList<>(); + symbolList.add(SearchMethodEnum.Equal.getSymbol()); + symbolList.add(SearchMethodEnum.NotEqual.getSymbol()); + String jnpfKey = fieLdsModel.getConfig().getJnpfKey(); + String fieldValue = fieLdsModel.getFieldValue(); + String symbol = fieLdsModel.getSymbol(); + if(StringUtil.isNotEmpty(fieldValue)){ + switch (jnpfKey){ + case JnpfKeyConsts.CUSTOMUSERSELECT: + if(!symbolList.contains(symbol)){ + List dataValues = new ArrayList<>(); + List values = new ArrayList<>(); + try { + values = JsonUtil.getJsonToList(fieldValue,String.class); + }catch (Exception e){ + } + dataValues.addAll(values); + for(String userVal :values){ + String userValue = userVal.substring(0, userVal.indexOf("--")); + UserEntity userEntity = userApi.getInfo(userValue); + if (userEntity != null) { + dataValues.add(userValue); + //在用户关系表中取出 + List groupRel = Optional.ofNullable(userRelationApi.getListByUserId(userValue, PermissionConst.GROUP)).orElse(new ArrayList<>()); + List orgRel = Optional.ofNullable(userRelationApi.getListByUserId(userValue, PermissionConst.ORGANIZE)).orElse(new ArrayList<>()); + List posRel = Optional.ofNullable(userRelationApi.getListByUserId(userValue, PermissionConst.POSITION)).orElse(new ArrayList<>()); + List roleRel = Optional.ofNullable(userRelationApi.getListByUserId(userValue, PermissionConst.ROLE)).orElse(new ArrayList<>()); + if (groupRel.size() > 0) { + for (UserRelationEntity split : groupRel) { + dataValues.add(split.getObjectId()); + } + } + if (StringUtil.isNotEmpty(userEntity.getOrganizeId())) { + //向上递归 查出所有上级组织 + List allUpOrgIDs = new ArrayList<>(); + organizeApi.upWardRecursion(allUpOrgIDs,userEntity.getOrganizeId()); + for (String orgID : allUpOrgIDs) { + dataValues.add(orgID); + } + } + if (posRel.size() > 0) { + for (UserRelationEntity split : posRel) { + dataValues.add(split.getObjectId()); + } + } + if (roleRel.size() > 0) { + for (UserRelationEntity split : roleRel) { + dataValues.add(split.getObjectId()); + } + } + } + } + fieLdsModel.setFieldValue(JsonUtil.getObjectToString(dataValues)); + } + break; + default: + break; + } + } + } + + /** + * 高级搜索 + * @param conditionList + * @param convertUser + */ + public static void superList(List conditionList,boolean convertUser) { + List dateControl = JnpfKeyConsts.DateSelect; + List numControl = JnpfKeyConsts.NumSelect; + for (SuperQueryJsonModel queryJsonModel : conditionList) { + List fieLdsModelList = queryJsonModel.getGroups(); + for (FieLdsModel fieLdsModel : fieLdsModelList) { + List dataList = new ArrayList<>(); + ConfigModel config = fieLdsModel.getConfig(); + String vModel = fieLdsModel.getVModel().trim(); + String jnpfKey = config.getJnpfKey(); + if (vModel.split("_jnpf_").length > 1) { + vModel = vModel.split("_jnpf_")[1]; + } + if (vModel.split("-").length > 1) { + vModel = vModel.split("-")[1]; + } + String value = fieLdsModel.getFieldValue(); + Object fieldValue = fieLdsModel.getFieldValue(); + Object fieldValueTwo = fieLdsModel.getFieldValue(); + if (fieLdsModel.getFieldValue() == null) { + fieldValue = ""; + } + List controlList = new ArrayList() {{ + addAll(numControl); + addAll(dateControl); + add(JnpfKeyConsts.TIME); + }}; + //处理数据 + if (controlList.contains(jnpfKey) && StringUtil.isNotEmpty(value)) { + int num = 0; + List data = new ArrayList<>(); + try { + data.addAll(JsonUtil.getJsonToList(value, String.class)); + } catch (Exception e) { + data.add(value); + data.add(value); + } + String valueOne = data.get(0); + String valueTwo = data.get(1); + //数字 + if (numControl.contains(jnpfKey)) { + fieldValue = new BigDecimal(valueOne); + fieldValueTwo = new BigDecimal(valueTwo); + // 精度处理 + Integer precision = fieLdsModel.getPrecision(); + if (ObjectUtil.isNotEmpty(precision)) { + String zeroNum = "0." + StringUtils.repeat("0", precision); + DecimalFormat numFormat = new DecimalFormat(zeroNum); + fieldValue = new BigDecimal(numFormat.format(new BigDecimal(valueOne))); + if (valueTwo != null) { + fieldValueTwo = new BigDecimal(numFormat.format(new BigDecimal(valueTwo))); + } + } + num++; + } + //日期 + if (dateControl.contains(jnpfKey)) { + fieldValue = new Date(); + fieldValueTwo = new Date(); + if (ObjectUtil.isNotEmpty(valueOne)) { + fieldValue = new Date(Long.valueOf(valueOne)); + } + if (ObjectUtil.isNotEmpty(valueTwo)) { + fieldValueTwo = new Date(Long.valueOf(valueTwo)); + } + num++; + } + if (num == 0) { + fieldValue = valueOne; + fieldValueTwo = valueTwo; + } + } + try { + List> list = JsonUtil.getJsonToBean(value, List.class); + Set dataAll = new HashSet<>(); + for (int i = 0; i < list.size(); i++) { + List list1 = new ArrayList<>(); + for (int k = 0; k < list.get(i).size(); k++) { + list1.add(list.get(i).get(k)); + } + dataAll.add(JSONArray.toJSONString(list1)); + } + dataList = new ArrayList<>(dataAll); + } catch (Exception e) { + try { + Set dataAll = new HashSet<>(); + List list = JsonUtil.getJsonToBean(value, List.class); + List mast = new ArrayList() {{ + add(JnpfKeyConsts.CASCADER); + add(JnpfKeyConsts.ADDRESS); + add(JnpfKeyConsts.COMSELECT); + }}; + if (mast.contains(jnpfKey)) { + dataAll.add(JSONArray.toJSONString(list)); + } else { + for (int k = 0; k < list.size(); k++) { + String data = list.get(k); + dataAll.add(data); + } + } + dataList.addAll( new ArrayList<>(dataAll)); + } catch (Exception e1) { + dataList.addAll(new ArrayList(){{add(value);}}); + } + } + if (dataList.size() == 0) { + dataList.add("jnpfNullList"); + } + fieLdsModel.setVModel(vModel); + fieLdsModel.setFieldValueOne(fieldValue); + fieLdsModel.setFieldValueTwo(fieldValueTwo); + fieLdsModel.setDataList(dataList); + if(convertUser){ + convertUserSelectData(fieLdsModel); + } + } + } + } + + /** + * 树形查询 + * + * @return + */ + private static List treeRelation(ColumnDataModel columnData, List formAllModel) { + //主表数据 + List mast = formAllModel.stream().filter(t -> FormEnum.mast.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + //列表子表数据 + List mastTable = formAllModel.stream().filter(t -> FormEnum.mastTable.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + //子表 + List childTable = formAllModel.stream().filter(t -> FormEnum.table.getMessage().equals(t.getJnpfKey())).collect(Collectors.toList()); + List fieLdsModelList = new ArrayList<>(); + List searchVOListAll = JsonUtil.getJsonToList(columnData.getSearchList(), FieLdsModel.class); + String treeDataSource = columnData.getTreeDataSource(); + String treeRelation = columnData.getTreeRelation(); + boolean isTree = searchVOListAll.stream().filter(t -> t.getVModel().equals(treeRelation)).count() == 0; + if (isTree && StringUtil.isNotEmpty(treeRelation)) { + String vModel = treeRelation.split("-")[0]; + FormAllModel mastModel = mast.stream().filter(t -> vModel.equals(t.getFormColumnModel().getFieLdsModel().getVModel())).findFirst().orElse(null); + if (mastModel != null) { + FieLdsModel fieLdsModel = mastModel.getFormColumnModel().getFieLdsModel(); + fieLdsModel.setId(vModel); + fieLdsModel.setSearchType(1); + Boolean multiple = fieLdsModel.getMultiple(); + fieLdsModel.setSymbol(multiple && !"organize".equals(treeDataSource) ? SearchMethodEnum.Like.getSymbol() : SearchMethodEnum.Equal.getSymbol()); + fieLdsModelList.add(fieLdsModel); + } + FormAllModel mastTableModel = mastTable.stream().filter(t -> vModel.equals(t.getFormMastTableModel().getVModel())).findFirst().orElse(null); + if (mastTableModel != null) { + FieLdsModel fieLdsModel = mastTableModel.getFormMastTableModel().getMastTable().getFieLdsModel(); + fieLdsModel.setId(vModel); + fieLdsModel.setSearchType(1); + Boolean multiple = fieLdsModel.getMultiple(); + fieLdsModel.setSymbol(multiple && !"organize".equals(treeDataSource) ? SearchMethodEnum.Like.getSymbol() : SearchMethodEnum.Equal.getSymbol()); + fieLdsModelList.add(fieLdsModel); + } + FormAllModel childTableModel = childTable.stream().filter(t -> vModel.equals(t.getChildList().getTableModel())).findFirst().orElse(null); + if (childTableModel != null) { + List childList = childTableModel.getChildList().getChildList(); + for (FormColumnModel formColumnModel : childList) { + FieLdsModel fieLdsModel = formColumnModel.getFieLdsModel(); + Boolean multiple = fieLdsModel.getMultiple(); + if (treeRelation.equals(vModel + "-" + fieLdsModel.getVModel())) { + fieLdsModel.setSymbol(multiple && !"organize".equals(treeDataSource) ? SearchMethodEnum.Like.getSymbol() : SearchMethodEnum.Equal.getSymbol()); + fieLdsModel.setId(vModel); + fieLdsModel.setSearchType(1); + fieLdsModelList.add(fieLdsModel); + } + } + } + } + return fieLdsModelList; + } + + /** + * 查询 + * + * @return + */ + public static void getSuperSql(QueryExpressionDSL.QueryExpressionWhereBuilder where, List superJsonModelList, List sqlModelList, String databaseProductName, String tableName) { + List groupQueryList = new ArrayList<>(); + for (SuperJsonModel superJsonModel : superJsonModelList) { + List groupList = getSuperSql(where, superJsonModel, sqlModelList, databaseProductName, tableName, true); + boolean and = superJsonModel.getAuthorizeLogic(); + String matchLogic = superJsonModel.getMatchLogic(); + boolean isAddMatchLogic = SearchMethodEnum.And.getSymbol().equalsIgnoreCase(matchLogic); + if (groupList.size() > 0) { + AndOrCriteriaGroup andGroup = SqlBuilder.and(DerivedColumn.of("1"), SqlBuilder.isEqualTo(isAddMatchLogic ? 1 : 2), groupList.toArray(new AndOrCriteriaGroup[groupList.size()])); + AndOrCriteriaGroup orGroup = SqlBuilder.or(DerivedColumn.of("1"), SqlBuilder.isEqualTo(isAddMatchLogic ? 1 : 2), groupList.toArray(new AndOrCriteriaGroup[groupList.size()])); + groupQueryList.add(and ? andGroup : orGroup); + } + } + if (groupQueryList.size() > 0) { + where.and(DerivedColumn.of("1"), SqlBuilder.isEqualTo(1), groupQueryList); + } + } + + /** + * 查询 + * + * @return + */ + public static List getSuperSql(QueryExpressionDSL.QueryExpressionWhereBuilder where, SuperJsonModel superJsonModel, List sqlModelList, String databaseProductName, String tableName, boolean authorizeLogic) { + List groupList = new ArrayList<>(); + OnlineQuerySqlUtils onlineQuerySqlUtils = new OnlineQuerySqlUtils(); + List conditionList = new ArrayList<>(); + List conditionListAll = superJsonModel.getConditionList(); + String matchLogic = superJsonModel.getMatchLogic(); + for (SuperQueryJsonModel queryJsonModel : conditionListAll) { + List fieLdsModelList = new ArrayList<>(); + List groupsList = queryJsonModel.getGroups(); + for (FieLdsModel fieLdsModel : groupsList) { + String table = StringUtil.isNotEmpty(fieLdsModel.getConfig().getRelationTable()) ? + fieLdsModel.getConfig().getRelationTable():fieLdsModel.getConfig().getTableName(); + if (StringUtil.isEmpty(tableName) || table.equals(tableName)) { + fieLdsModelList.add(fieLdsModel); + } + } + SuperQueryJsonModel queryModel = new SuperQueryJsonModel(); + queryModel.setLogic(queryJsonModel.getLogic()); + queryModel.setGroups(fieLdsModelList); + if (fieLdsModelList.size() > 0) { + conditionList.add(queryModel); + } + } + if (conditionList.size() > 0) { + groupList.addAll(onlineQuerySqlUtils.getSuperSql(conditionList, sqlModelList, databaseProductName, matchLogic)); + } + if (!authorizeLogic && groupList.size() > 0) { + where.and(DerivedColumn.of("1"), SqlBuilder.isEqualTo(SearchMethodEnum.And.getSymbol().equalsIgnoreCase(matchLogic) ? 1 : 2), groupList); + } + return groupList; + } + + /** + * 将用户选择控件的数据转换为Dynamic查询条件 + * + * @param sqlColumn + * @param userGroup + * @param userVal + */ + private static void convertUserSelectData(BindableColumn sqlColumn, List userGroup, String userVal, boolean isLike) { + // 分组 组织 岗位 角色 用户 + String userValue = userVal.substring(0, userVal.indexOf("--")); + UserEntity userEntity = userApi.getInfo(userValue); + if (userEntity != null) { + String idValue; + //在用户关系表中取出 + List groupRel = Optional.ofNullable(userRelationApi.getListByUserId(userValue, PermissionConst.GROUP)).orElse(new ArrayList<>()); + List orgRel = Optional.ofNullable(userRelationApi.getListByUserId(userValue, PermissionConst.ORGANIZE)).orElse(new ArrayList<>()); + List posRel = Optional.ofNullable(userRelationApi.getListByUserId(userValue, PermissionConst.POSITION)).orElse(new ArrayList<>()); + List roleRel = Optional.ofNullable(userRelationApi.getListByUserId(userValue, PermissionConst.ROLE)).orElse(new ArrayList<>()); + if (groupRel.size() > 0) { + for (UserRelationEntity split : groupRel) { + idValue = "%" + split.getObjectId() + "%"; + AndOrCriteriaGroup aog = isLike ? SqlBuilder.or(sqlColumn, SqlBuilder.isLike(idValue)) : SqlBuilder.and(sqlColumn, SqlBuilder.isNotLike(idValue)); + userGroup.add(aog); + } + } + if (StringUtil.isNotEmpty(userEntity.getOrganizeId())) { + //向上递归 查出所有上级组织 + List allUpOrgIDs = new ArrayList<>(); + organizeApi.upWardRecursion(allUpOrgIDs, userEntity.getOrganizeId()); + for (String orgID : allUpOrgIDs) { + idValue = "%" + orgID + "%"; + AndOrCriteriaGroup aog = isLike ? SqlBuilder.or(sqlColumn, SqlBuilder.isLike(idValue)) : SqlBuilder.and(sqlColumn, SqlBuilder.isNotLike(idValue)); + userGroup.add(aog); + } + } + if (posRel.size() > 0) { + for (UserRelationEntity split : posRel) { + idValue = "%" + split.getObjectId() + "%"; + AndOrCriteriaGroup aog = isLike ? SqlBuilder.or(sqlColumn, SqlBuilder.isLike(idValue)) : SqlBuilder.and(sqlColumn, SqlBuilder.isNotLike(idValue)); + userGroup.add(aog); + } + } + if (roleRel.size() > 0) { + for (UserRelationEntity split : roleRel) { + idValue = "%" + split.getObjectId() + "%"; + AndOrCriteriaGroup aog = isLike ? SqlBuilder.or(sqlColumn, SqlBuilder.isLike(idValue)) : SqlBuilder.and(sqlColumn, SqlBuilder.isNotLike(idValue)); + userGroup.add(aog); + } + } + } + } + + public static List getBasicColumns(List mainTableFields, List sqlModels, OnlineDynamicSqlModel dycModel, + List columnFieldListAll, boolean isClobDbType) { + List mainSqlColumns = mainTableFields.stream().map(m -> { + ColumnListField columnListField = columnFieldListAll.stream().filter(item -> item.getProp().equals(m)).findFirst().orElse(null); + if (isClobDbType && columnListField != null) { + String jnpfKey = columnListField.getJnpfKey(); + if (jnpfKey.equals(JnpfKeyConsts.UPLOADFZ) || jnpfKey.equals(JnpfKeyConsts.UPLOADIMG) || jnpfKey.equals(JnpfKeyConsts.EDITOR)) { + if (sqlModels.size() > 1) {//连表会出现《表名.字段》clob处理需要包含表名 + return SqlTable.of("dbms_lob.substr(" + dycModel.getTableName()).column(m + ")").as(m); + } else { + return SqlTable.of(dycModel.getTableName()).column("dbms_lob.substr(" + m + ")").as(m); + } + } + } + return dycModel.getSqlTable().column(m); + }).collect(Collectors.toList()); + return mainSqlColumns; + } + + private static List getBasicColumnsChild(List modelList, OnlineDynamicSqlModel dycModel, + List onlineColumnFieldModels, boolean isClobDbType) { + SqlTable mastSqlTable = dycModel.getSqlTable(); + List mastSqlCols = onlineColumnFieldModels.stream().map(m -> { + ColumnListField columnListField = modelList.stream().filter(item -> item.getProp().equals(m.getOriginallyField())).findFirst().orElse(null); + if (isClobDbType && columnListField != null) { + String jnpfKey = columnListField.getConfig().getJnpfKey(); + if (jnpfKey.equals(JnpfKeyConsts.UPLOADFZ) || jnpfKey.equals(JnpfKeyConsts.UPLOADIMG) || jnpfKey.equals(JnpfKeyConsts.EDITOR)) { + return SqlTable.of("dbms_lob.substr(" + dycModel.getTableName()).column(m.getField() + ")").as(m.getOriginallyField()); + } + } + return mastSqlTable.column(m.getField()).as(m.getOriginallyField()); + }).collect(Collectors.toList()); + return mastSqlCols; + } + + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/util/onlineDevUtil/OnlinePublicUtils.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/util/onlineDevUtil/OnlinePublicUtils.java new file mode 100644 index 0000000..9609cde --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/util/onlineDevUtil/OnlinePublicUtils.java @@ -0,0 +1,520 @@ +package jnpf.onlinedev.util.onlineDevUtil; + + +import jnpf.base.entity.VisualdevEntity; +import jnpf.base.entity.VisualdevReleaseEntity; +import jnpf.base.model.ColumnDataModel; +import jnpf.base.model.VisualDevJsonModel; +import jnpf.base.model.VisualWebTypeEnum; +import jnpf.exception.WorkFlowException; +import jnpf.model.visualJson.FieLdsModel; +import jnpf.model.visualJson.FormDataModel; +import jnpf.model.visualJson.TableModel; +import jnpf.model.visualJson.analysis.FormEnum; +import jnpf.model.visualJson.analysis.FormModel; +import jnpf.model.visualJson.config.ConfigModel; +import jnpf.onlinedev.model.OnlineDevData; +import jnpf.onlinedev.model.OnlineDevEnum.MultipleControlEnum; +import jnpf.util.JsonUtil; +import jnpf.util.StringUtil; +import jnpf.util.visiual.JnpfKeyConsts; + +import java.time.Instant; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 在线开发公用 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/7/28 + */ +public class OnlinePublicUtils { + /** + * 判断有表无表 + * + * @return + */ + public static Boolean isUseTables(String tableJson) { + if (!StringUtil.isEmpty(tableJson) && !OnlineDevData.TABLE_CONST.equals(tableJson)) { + return true; + } + return false; + } + + /** + * map key转小写 + * + * @param requestMap + * @return + */ + public static Map mapKeyToLower(Map requestMap) { + // 非空校验 + if (requestMap.isEmpty()) { + return null; + } + // 初始化放转换后数据的Map + Map responseMap = new HashMap<>(16); + // 使用迭代器进行循环遍历 + Set requestSet = requestMap.keySet(); + Iterator iterator = requestSet.iterator(); + iterator.forEachRemaining(obj -> { + // 判断Key对应的Value是否为Map + if ((requestMap.get(obj) instanceof Map)) { + // 递归调用,将value中的Map的key转小写 + responseMap.put(obj.toLowerCase(), mapKeyToLower((Map) requestMap.get(obj))); + } else { + // 直接将key小写放入responseMap + responseMap.put(obj.toLowerCase(), requestMap.get(obj)); + } + }); + + return responseMap; + } + + + /** + * 获取map中第一个数据值 + * + * @param map 数据源 + * @return + */ + public static Object getFirstOrNull(Map map) { + Object obj = null; + for (Map.Entry entry : map.entrySet()) { + obj = entry.getValue(); + if (obj != null) { + break; + } + } + return obj; + } + + /** + * 去除列表里无用的控件 + * + * @param fieldsModelList + * @return + */ + public static void removeUseless(List fieldsModelList) { + for (int i = 0; i < fieldsModelList.size(); i++) { + if (fieldsModelList.get(i).getConfig().getJnpfKey() == null) { + continue; + } + if (fieldsModelList.get(i).getConfig().getJnpfKey().equals(JnpfKeyConsts.CHILD_TABLE)) { + continue; + } + } + } + + + /** + * 递归控件 + * + * @param allFields + * @param fieLdsModelList + * @return + */ + public static void recursionFields(List allFields, List fieLdsModelList) { + for (FieLdsModel fieLdsModel : fieLdsModelList) { + ConfigModel config = fieLdsModel.getConfig(); + String jnpfKey = config.getJnpfKey(); + if (JnpfKeyConsts.CHILD_TABLE.equals(jnpfKey)) { + allFields.add(fieLdsModel); + continue; + } else { + if (config.getChildren() != null) { + recursionFields(allFields, config.getChildren()); + } else { + if (jnpfKey == null) { + continue; + } + allFields.add(fieLdsModel); + } + } + } + } + + /** + * 判断字符串是否有某个字符存在 + * + * @param var1 完整字符串 + * @param var2 统计字符 + * @return + */ + public static Boolean getMultiple(String var1, String var2) { + if (var1.startsWith(var2)) { + return true; + } + return false; + } + + /** + * 数据字典处理(从缓存中取出) + * + * @param dataList + * @param swapModel + * @return + */ + public static Map getDataMap(List> dataList, FieLdsModel swapModel) { + String label = swapModel.getProps() != null ? swapModel.getProps().getLabel() : "" ; + String value = swapModel.getProps() != null ? swapModel.getProps().getValue() : "" ; + Map dataInterfaceMap = new HashMap<>(); + dataList.stream().forEach(data -> { + dataInterfaceMap.put(String.valueOf(data.get(value)), String.valueOf(data.get(label))); + }); + return dataInterfaceMap; + } + + + /** + * 获取时间(+8) + * + * @param date + * @param format + * @return + */ + public static String getDateByFormat(Long date, String format) { + DateTimeFormatter ftf = DateTimeFormatter.ofPattern(format); + String dateString = ftf.format(LocalDateTime.ofInstant(Instant.ofEpochMilli(date), ZoneId.of("+8" ))); + return dateString; + } + + /** + * 递归表单控件 + * + * @param modelList 所有控件 + * @param mainFields 主表 + * @param childFields 子表 + * @param models 二维码 条形码 + */ + public static void recurseFiled(List modelList, List mainFields, List childFields, List models) { + for (FieLdsModel fieLdsModel : modelList) { + ConfigModel config = fieLdsModel.getConfig(); + String jnpfkey = config.getJnpfKey(); + List childrenList = config.getChildren(); + boolean isJnpfKey = StringUtil.isEmpty(jnpfkey); + List keyList = new ArrayList() { + { + this.add(FormEnum.collapseItem.getMessage()); + this.add(FormEnum.collapseItem.getMessage()); + this.add(FormEnum.row.getMessage()); + this.add(FormEnum.card.getMessage()); + this.add(FormEnum.tab.getMessage()); + this.add(FormEnum.collapse.getMessage()); + this.add(FormEnum.tableGrid.getMessage()); + this.add(FormEnum.tableGridTr.getMessage()); + this.add(FormEnum.tableGridTd.getMessage()); + } + }; + if (keyList.contains(jnpfkey) || isJnpfKey) { + if (childrenList.size() > 0) { + recurseFiled(childrenList, mainFields, childFields, models); + } else { + mainFields.add(fieLdsModel); + } + } else if (FormEnum.table.getMessage().equals(jnpfkey)) { + childFields.add(fieLdsModel); + } else if (FormEnum.groupTitle.getMessage().equals(jnpfkey) || FormEnum.divider.getMessage().equals(jnpfkey) || FormEnum.JNPFText.getMessage().equals(jnpfkey)) { + + } else if (FormEnum.QR_CODE.getMessage().equals(jnpfkey) || FormEnum.BARCODE.getMessage().equals(jnpfkey)) { + FormModel formModel = JsonUtil.getJsonToBean(fieLdsModel, FormModel.class); + models.add(formModel); + } else { + mainFields.add(fieLdsModel); + } + } + } + + /** + * 递归控件 + * + * @return + */ + public static void recursionFormFields(List allFields, List fieLdsModelList) { + for (FieLdsModel fieLdsModel : fieLdsModelList) { + ConfigModel config = fieLdsModel.getConfig(); + String jnpfKey = config.getJnpfKey(); + if (JnpfKeyConsts.CHILD_TABLE.equals(jnpfKey)) { + allFields.add(fieLdsModel); + continue; + } else { + if (config.getChildren() != null) { + recursionFormFields(allFields, config.getChildren()); + } else { + allFields.add(fieLdsModel); + } + } + } + } + + /** + * 递归控件(取出所有子集) + * + * @return + */ + public static void recursionFormChildFields(List allFields, List fieLdsModelList) { + for (FieLdsModel fieLdsModel : fieLdsModelList) { + ConfigModel config = fieLdsModel.getConfig(); + String jnpfKey = config.getJnpfKey(); + if (JnpfKeyConsts.CHILD_TABLE.equals(jnpfKey)) { + String childVmodel = fieLdsModel.getVModel(); + for (FieLdsModel child : Optional.ofNullable(fieLdsModel.getConfig().getChildren()).orElse(new ArrayList<>())) { + if (child.getVModel() != null) { + child.setVModel(childVmodel + "-" + child.getVModel()); + allFields.add(child); + } + } + } else { + if (config.getChildren() != null) { + recursionFormChildFields(allFields, config.getChildren()); + } else { + if (StringUtil.isNotEmpty(fieLdsModel.getVModel())) { + allFields.add(fieLdsModel); + } + } + } + } + } + + public static void recurseOnlineFiled(List modelList, List mainFields, List childFields) { + for (FieLdsModel fieLdsModel : modelList) { + ConfigModel config = fieLdsModel.getConfig(); + String jnpfkey = config.getJnpfKey(); + List childrenList = config.getChildren(); + boolean isJnpfKey = StringUtil.isEmpty(jnpfkey); + if (FormEnum.row.getMessage().equals(jnpfkey) || FormEnum.card.getMessage().equals(jnpfkey) + || FormEnum.tab.getMessage().equals(jnpfkey) || FormEnum.collapse.getMessage().equals(jnpfkey) + || isJnpfKey) { + if (childrenList.size() > 0) { + recurseOnlineFiled(childrenList, mainFields, childFields); + } else { + mainFields.add(fieLdsModel); + } + } else if (FormEnum.table.getMessage().equals(jnpfkey)) { + childFields.add(fieLdsModel); + } else if (FormEnum.groupTitle.getMessage().equals(jnpfkey) || FormEnum.divider.getMessage().equals(jnpfkey) || FormEnum.JNPFText.getMessage().equals(jnpfkey)) { + + } else { + mainFields.add(fieLdsModel); + } + } + } + + /** + * @param redisMap 缓存集合 + * @param modelData 数据 + * @param isMultiple 是否多选 + * @return + */ + public static String getDataInMethod(Map redisMap, Object modelData, Boolean isMultiple) { + if (redisMap == null || redisMap.isEmpty()) { + return modelData.toString(); + } + String Separator = isMultiple ? ";" : "/" ; + String s2; + if (OnlinePublicUtils.getMultiple(String.valueOf(modelData), MultipleControlEnum.MULTIPLE_JSON_TWO.getMultipleChar())) { + String[][] data = JsonUtil.getJsonToBean(String.valueOf(modelData), String[][].class); + List addList = new ArrayList<>(); + for (String[] AddressData : data) { + List adList = new ArrayList<>(); + for (String s : AddressData) { + adList.add(String.valueOf(redisMap.get(s))); + } + addList.add(String.join("/" , adList)); + } + s2 = String.join(";" , addList); + } else if (OnlinePublicUtils.getMultiple(String.valueOf(modelData), MultipleControlEnum.MULTIPLE_JSON_ONE.getMultipleChar())) { + List modelDataList = JsonUtil.getJsonToList(String.valueOf(modelData), String.class); + modelDataList = modelDataList.stream().map(s -> String.valueOf(redisMap.get(s))).collect(Collectors.toList()); + s2 = String.join(Separator, modelDataList); + } else { + String[] modelDatas = String.valueOf(modelData).split("," ); + StringBuilder dynamicData = new StringBuilder(); + for (int i = 0; i < modelDatas.length; i++) { + modelDatas[i] = String.valueOf(redisMap.get(modelDatas[i])); + dynamicData.append(modelDatas[i] + Separator); + } + s2 = dynamicData.deleteCharAt(dynamicData.length() - 1).toString(); + } + return StringUtil.isEmpty(s2) ? modelData.toString() : s2; + } + + public static List getDataNoSwapInMethod(Object modelData) { + List dataValueList = new ArrayList<>(); + if (OnlinePublicUtils.getMultiple(String.valueOf(modelData), MultipleControlEnum.MULTIPLE_JSON_ONE.getMultipleChar())) { + List modelDataList = JsonUtil.getJsonToList(String.valueOf(modelData), String.class); + dataValueList = modelDataList; + } else { + String[] modelDatas = String.valueOf(modelData).split("," ); + for (int i = 0; i < modelDatas.length; i++) { + dataValueList.add(modelDatas[i]); + } + } + return dataValueList; + } + + public static VisualDevJsonModel getVisualJsonModel(VisualdevEntity entity) { + VisualDevJsonModel jsonModel = new VisualDevJsonModel(); + if (entity.getColumnData() != null) { + jsonModel.setColumnData(JsonUtil.getJsonToBean(entity.getColumnData(), ColumnDataModel.class)); + } + if (entity.getAppColumnData() != null) { + jsonModel.setAppColumnData(JsonUtil.getJsonToBean(entity.getAppColumnData(), ColumnDataModel.class)); + } + FormDataModel formDataModel = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + jsonModel.setFormData(formDataModel); + if (!VisualWebTypeEnum.DATA_VIEW.getType().equals(entity.getWebType())) { + jsonModel.setFormListModels(JsonUtil.getJsonToList(formDataModel.getFields(), FieLdsModel.class)); + } + jsonModel.setVisualTables(JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class)); + jsonModel.setId(entity.getId()); + jsonModel.setDbLinkId(entity.getDbLinkId()); + jsonModel.setFullName(entity.getFullName()); + jsonModel.setType(entity.getType()); + jsonModel.setWebType(entity.getWebType()); + jsonModel.setFlowEnable(entity.getEnableFlow() == 1); + return jsonModel; + } + + public static VisualDevJsonModel getVisualJsonModel(VisualdevReleaseEntity entity) throws WorkFlowException { + if(entity==null) throw new WorkFlowException("该表单已删除"); + VisualDevJsonModel jsonModel = new VisualDevJsonModel(); + if (entity.getColumnData() != null) { + jsonModel.setColumnData(JsonUtil.getJsonToBean(entity.getColumnData(), ColumnDataModel.class)); + } + if (entity.getAppColumnData() != null) { + jsonModel.setAppColumnData(JsonUtil.getJsonToBean(entity.getAppColumnData(), ColumnDataModel.class)); + } + FormDataModel formDataModel = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + jsonModel.setFormData(formDataModel); + if (!VisualWebTypeEnum.DATA_VIEW.getType().equals(entity.getWebType())) { + jsonModel.setFormListModels(JsonUtil.getJsonToList(formDataModel.getFields(), FieLdsModel.class)); + } + jsonModel.setVisualTables(JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class)); + jsonModel.setId(entity.getId()); + jsonModel.setDbLinkId(entity.getDbLinkId()); + jsonModel.setFullName(entity.getFullName()); + jsonModel.setType(entity.getType()); + jsonModel.setWebType(entity.getWebType()); + jsonModel.setFlowEnable(entity.getEnableFlow() == 1); + return jsonModel; + } + + /** + * @param mapList + * @return List> + * @Date 21:51 2020/11/11 + * @Description 将map中的所有key转化为小写 + */ + public static List> toLowerKeyList(List> mapList) { + List> newMapList = new ArrayList<>(); + for (Map map : mapList) { + Map resultMap = new HashMap(16); + Set sets = map.keySet(); + for (String key : sets) { + resultMap.put(key.toLowerCase(), map.get(key)); + } + newMapList.add(resultMap); + } + return newMapList; + } + + /** + * 判断两个map有相同key-value + * + * @param conditionConfig 条件配置,true==,false模糊查询 + * @return + * @copyright 引迈信息技术有限公司 + * @date 2023/1/5 + */ + public static boolean mapCompar(Map conditionMap, Map hashMap2, Map conditionConfig) { + boolean isChange = false; + for (String key : conditionMap.keySet()) { + String m1value = conditionMap.get(key) == null ? "" : conditionMap.get(key).toString(); + String m2value = hashMap2.get(key) == null ? "" : (String) hashMap2.get(key); + boolean flag = conditionConfig != null && conditionConfig.get(key) != null ? conditionConfig.get(key) : false; + if (flag && m1value.equals(m2value)) { + isChange = true; + } else if (!flag && m2value.indexOf(m1value) >= 0) { + isChange = true; + } else { + return false;//必须条件全满足才会true + } + } + return isChange; + } + + /** + * 字符串转数组 + * + * @param value 值 + * @return + */ + public static Object getDataConversion(Object value) { + Object dataValue = getDataConversion(null, value,false,"/"); + return dataValue; + } + + /** + * 字符串转数组 + * + * @param redis 转换对象 + * @param value 值 + * @return + */ + public static Object getDataConversion(Map redis, Object value,boolean isMultiple,String separator) { + Object dataValue = value; + boolean iszhuanhuan = redis != null; + try { + List list = JsonUtil.getJsonToList(String.valueOf(value), List.class); + dataValue = list; + if (iszhuanhuan) { + //一级分隔符 + StringJoiner joiner = new StringJoiner(","); + for (List listChild : list) { + StringJoiner aa = new StringJoiner(separator); + for (Object object : listChild) { + String value1 = redis.get(String.valueOf(object)) != null ? String.valueOf(redis.get(String.valueOf(object))) : ""; + if (StringUtil.isNotEmpty(value1)) { + aa.add(value1); + } + } + joiner.add(aa.toString()); + } + dataValue = joiner.toString(); + } + } catch (Exception e) { + try { + List list = JsonUtil.getJsonToList(String.valueOf(value), String.class); + dataValue = list; + if (iszhuanhuan) { + if(isMultiple){//一级分隔符 + separator=","; + } + StringJoiner joiner = new StringJoiner(separator); + for (Object listChild : list) { + String value1 = redis.get(String.valueOf(listChild)) != null ? String.valueOf(redis.get(String.valueOf(listChild))) : ""; + if (StringUtil.isNotEmpty(value1)) { + joiner.add(value1); + } + } + dataValue = joiner.toString(); + } + } catch (Exception e1) { + dataValue = String.valueOf(value); + if (iszhuanhuan) { + dataValue = redis.get(String.valueOf(value)) != null ? String.valueOf(redis.get(String.valueOf(value))) : ""; + } + } + } + return dataValue; + } + +} + diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/util/onlineDevUtil/OnlineQuerySqlUtils.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/util/onlineDevUtil/OnlineQuerySqlUtils.java new file mode 100644 index 0000000..9ad8c0b --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/util/onlineDevUtil/OnlineQuerySqlUtils.java @@ -0,0 +1,187 @@ +package jnpf.onlinedev.util.onlineDevUtil; + +import cn.hutool.core.util.ObjectUtil; +import jnpf.database.model.superQuery.SuperQueryJsonModel; +import jnpf.emnus.SearchMethodEnum; +import jnpf.model.visualJson.FieLdsModel; +import jnpf.model.visualJson.config.ConfigModel; +import jnpf.permission.model.authorize.OnlineDynamicSqlModel; +import jnpf.util.visiual.JnpfKeyConsts; +import lombok.Data; +import org.mybatis.dynamic.sql.*; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class OnlineQuerySqlUtils { + + /** + * 运算符 + */ + private SearchMethodEnum symbol; + /** + * 逻辑拼接符号 + */ + private boolean and; + /** + * 组件标识 + */ + private String jnpfKey; + /** + * 字段key + */ + private String vModel; + /** + * 自定义的值 + */ + private Object fieldValue; + /** + * 自定义的值2 + */ + private Object fieldValueTwo; + + private VisitableCondition sqlCondition = null; + private BindableColumn sqlColumn = null; + private List groupList = new ArrayList<>(); + private boolean isSqlServer = false; + private boolean isOracle = false; + + private List dataList = new ArrayList<>(); + + public List getSuperSql(List conditionList, List sqlModelList, String databaseProductName, String matchLogic) { + isSqlServer = databaseProductName.equalsIgnoreCase("Microsoft SQL Server"); + isOracle = databaseProductName.equalsIgnoreCase("oracle"); + boolean isAddMatchLogic = SearchMethodEnum.And.getSymbol().equalsIgnoreCase(matchLogic); + List groupQueryList = new ArrayList<>(); + OnlineProductSqlUtils.superList(conditionList,false); + for (SuperQueryJsonModel queryJsonModel : conditionList) { + List fieLdsModelList = queryJsonModel.getGroups(); + String logic = queryJsonModel.getLogic(); + and = SearchMethodEnum.And.getSymbol().equalsIgnoreCase(logic); + List groupListAll = new ArrayList<>(); + for (FieLdsModel fieLdsModel : fieLdsModelList) { + ConfigModel config = fieLdsModel.getConfig(); + sqlCondition = null; + sqlColumn = null; + groupList = new ArrayList<>(); + jnpfKey = config.getJnpfKey(); + symbol = SearchMethodEnum.getSearchMethod(fieLdsModel.getSymbol()); + vModel = fieLdsModel.getVModel(); + fieldValue = fieLdsModel.getFieldValueOne(); + fieldValueTwo = fieLdsModel.getFieldValueTwo(); + dataList = fieLdsModel.getDataList(); + String tableName = ObjectUtil.isNotEmpty(config.getRelationTable()) ? config.getRelationTable() : config.getTableName(); + OnlineDynamicSqlModel onlineDynamicSqlModel = sqlModelList.stream().filter(sql -> sql.getTableName().equals(tableName)).findFirst().orElse(null); + if (onlineDynamicSqlModel != null) { + getSymbolWrapper(onlineDynamicSqlModel); + groupListAll.addAll(groupList); + } + } + if (groupListAll.size() > 0) { + if (isAddMatchLogic) { + groupQueryList.add(SqlBuilder.and(sqlColumn, sqlCondition, groupListAll.toArray(new AndOrCriteriaGroup[groupListAll.size()]))); + } else { + groupQueryList.add(SqlBuilder.or(sqlColumn, sqlCondition, groupListAll.toArray(new AndOrCriteriaGroup[groupListAll.size()]))); + } + } + } + return groupQueryList; + } + + private void getSymbolWrapper(OnlineDynamicSqlModel onlineDynamicSqlModel) { + SqlTable sqlTable = onlineDynamicSqlModel.getSqlTable(); + sqlColumn = sqlTable.column(vModel); + List list = new ArrayList<>(); + switch (symbol) { + case IsNull: + sqlCondition = SqlBuilder.isNull(); + list.add(SqlBuilder.and(sqlTable.column(vModel), sqlCondition)); + break; + case IsNotNull: + sqlCondition = SqlBuilder.isNotNull(); + list.add(SqlBuilder.and(sqlTable.column(vModel), sqlCondition)); + break; + case Equal: + sqlCondition = SqlBuilder.isEqualTo(fieldValue); + list.add(SqlBuilder.and(sqlTable.column(vModel), sqlCondition)); + break; + case NotEqual: + sqlCondition = SqlBuilder.isNotEqualTo(fieldValue); + list.add(SqlBuilder.and(sqlTable.column(vModel), sqlCondition)); + break; + case GreaterThan: + sqlCondition = SqlBuilder.isGreaterThan(fieldValue); + list.add(SqlBuilder.and(sqlTable.column(vModel), sqlCondition)); + break; + case LessThan: + sqlCondition = SqlBuilder.isLessThan(fieldValue); + list.add(SqlBuilder.and(sqlTable.column(vModel), sqlCondition)); + break; + case GreaterThanOrEqual: + sqlCondition = SqlBuilder.isGreaterThanOrEqualTo(fieldValue); + list.add(SqlBuilder.and(sqlTable.column(vModel), sqlCondition)); + break; + case LessThanOrEqual: + sqlCondition = SqlBuilder.isLessThanOrEqualTo(fieldValue); + list.add(SqlBuilder.and(sqlTable.column(vModel), sqlCondition)); + break; + case Like: + if (isSqlServer) { + fieldValue = String.valueOf(fieldValue).replaceAll("\\[", "[[]"); + } + sqlCondition = SqlBuilder.isLike("%" + fieldValue + "%"); + list.add(SqlBuilder.and(sqlTable.column(vModel), sqlCondition)); + break; + case NotLike: + if (isSqlServer) { + fieldValue = String.valueOf(fieldValue).replaceAll("\\[", "[[]"); + } + sqlCondition = SqlBuilder.isNotLike("%" + fieldValue + "%"); + list.add(SqlBuilder.and(sqlTable.column(vModel), sqlCondition)); + break; + case Included: + case NotIncluded: + getInWrapper(sqlTable); + break; + case Between: + sqlCondition = SqlBuilder.isBetween(fieldValue).and(fieldValueTwo); + list.add(SqlBuilder.and(sqlTable.column(vModel), SqlBuilder.isBetween(fieldValue).and(fieldValueTwo))); + break; + default: + break; + } + if (list.size() > 0) { + if (and) { + groupList.add(SqlBuilder.and(sqlTable.column(vModel), sqlCondition, list.toArray(new AndOrCriteriaGroup[list.size()]))); + } else { + groupList.add(SqlBuilder.or(sqlTable.column(vModel), sqlCondition, list.toArray(new AndOrCriteriaGroup[list.size()]))); + } + } + } + + private void getInWrapper(SqlTable sqlTable) { + List groupInList = new ArrayList<>(); + for (String value : dataList) { + switch (symbol) { + case Included: + sqlCondition = SqlBuilder.isLike("%" + value + "%"); + groupInList.add(SqlBuilder.or(sqlTable.column(vModel), SqlBuilder.isLike("%" + value + "%"))); + break; + default: + sqlCondition = SqlBuilder.isNotLike("%" + value + "%"); + groupInList.add(SqlBuilder.and(sqlTable.column(vModel), SqlBuilder.isNotLike("%" + value + "%"))); + break; + } + } + if (groupInList.size() > 0) { + if (and) { + groupList.add(SqlBuilder.and(sqlTable.column(vModel), sqlCondition, groupInList.toArray(new AndOrCriteriaGroup[groupInList.size()]))); + } else { + groupList.add(SqlBuilder.or(sqlTable.column(vModel), sqlCondition, groupInList.toArray(new AndOrCriteriaGroup[groupInList.size()]))); + } + } + sqlCondition = SqlBuilder.isNotEqualTo("[]"); + } + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/util/onlineDevUtil/OnlineSwapDataUtils.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/util/onlineDevUtil/OnlineSwapDataUtils.java new file mode 100644 index 0000000..0f82197 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/util/onlineDevUtil/OnlineSwapDataUtils.java @@ -0,0 +1,2358 @@ +package jnpf.onlinedev.util.onlineDevUtil; + +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.date.LocalDateTimeUtil; +import cn.hutool.core.text.StrPool; +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.google.common.collect.Lists; +import jnpf.base.ActionResult; +import jnpf.base.UserInfo; +import jnpf.base.entity.*; +import jnpf.base.model.ColumnDataModel; +import jnpf.base.model.VisualDevJsonModel; +import jnpf.base.model.datainterface.DataInterfaceModel; +import jnpf.base.model.datainterface.DataInterfacePage; +import jnpf.base.service.*; +import jnpf.constant.JnpfConst; +import jnpf.constant.PermissionConst; +import jnpf.database.model.entity.DbLinkEntity; +import jnpf.database.util.DynamicDataSourceUtil; +import jnpf.engine.entity.FlowTaskEntity; +import jnpf.engine.service.FlowTaskService; +import jnpf.exception.WorkFlowException; +import jnpf.mapper.FlowFormDataMapper; +import jnpf.model.flow.DataModel; +import jnpf.model.visualJson.*; +import jnpf.model.visualJson.analysis.FormModel; +import jnpf.model.visualJson.config.ConfigModel; +import jnpf.model.visualJson.config.RegListModel; +import jnpf.onlinedev.model.OnlineDevData; +import jnpf.onlinedev.model.OnlineDevEnum.CacheKeyEnum; +import jnpf.onlinedev.model.OnlineDevEnum.MultipleControlEnum; +import jnpf.onlinedev.model.OnlineDevEnum.OnlineDataTypeEnum; +import jnpf.onlinedev.model.OnlineDevListModel.VisualColumnSearchVO; +import jnpf.onlinedev.model.OnlineImport.ExcelImportModel; +import jnpf.onlinedev.model.OnlineImport.ImportFormCheckUniqueModel; +import jnpf.onlinedev.model.PaginationModel; +import jnpf.onlinedev.model.VisualdevModelDataInfoVO; +import jnpf.onlinedev.service.VisualDevInfoService; +import jnpf.onlinedev.service.VisualdevModelDataService; +import jnpf.permission.entity.*; +import jnpf.permission.model.organize.OrganizeConditionModel; +import jnpf.permission.model.organize.OrganizeModel; +import jnpf.permission.service.*; +import jnpf.util.*; +import jnpf.util.data.DataSourceContextHolder; +import jnpf.util.visiual.JnpfKeyConsts; +import lombok.Cleanup; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.mybatis.dynamic.sql.BasicColumn; +import org.mybatis.dynamic.sql.SqlBuilder; +import org.mybatis.dynamic.sql.SqlTable; +import org.mybatis.dynamic.sql.render.RenderingStrategies; +import org.mybatis.dynamic.sql.select.render.SelectStatementProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.math.BigDecimal; +import java.nio.charset.StandardCharsets; +import java.sql.Connection; +import java.sql.SQLException; +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 数据解析 + * + * @author JNPF开发平台组 + * @version V3.4.2 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2022/7/18 + */ +@Slf4j +@Component +public class OnlineSwapDataUtils { + @Autowired + private RedisUtil redisUtil; + @Autowired + private DictionaryDataService dictionaryDataApi; + @Autowired + private UserService userApi; + @Autowired + private PositionService positionApi; + @Autowired + private ProvinceService areaApi; + @Autowired + private OrganizeService organizeApi; + @Autowired + private VisualdevService visualdevService; + @Autowired + private VisualdevModelDataService visualdevModelDataService; + @Autowired + private DataInterfaceService dataInterFaceApi; + @Autowired + private VisualDevInfoService visualDevInfoService; + @Autowired + private RoleService roleApi; + @Autowired + private GroupService groupApi; + @Autowired + private DbLinkService dataSourceApi; + @Autowired + private OnlineDevInfoUtils onlineDevInfoUtils; + @Autowired + private BillRuleService billRuleApi; + @Autowired + private FlowFormDataMapper flowFormDataMapper; + @Autowired + private UserRelationService userRelationApi; + @Autowired + private OrganizeRelationService organizeRelationApi; + @Autowired + private FlowFormDataUtil flowDataUtil; + @Autowired + private FlowTaskService flowTaskApi; + + private static long DEFAULT_CACHE_TIME = 60 * 5; + + //后期将是否缓存转到前端控件配置 + //缓存系统权限数据, 组织、岗位、分组、角色、用户 + private static boolean NEEDCACHE_SYS = true; + //缓存远端数据, 静态、字典、接口、弹窗选择 + private static boolean NEEDCACHE_REMOTE = true; + //缓存关联数据, 关联表单 + private static boolean NEEDCACHE_RELATION = true; + + public List> getSwapList(List> list, List swapDataVoList, String visualDevId, Boolean inlineEdit, List codeList) { + if (list.isEmpty()) { + return list; + } + return getSwapList(list, swapDataVoList, visualDevId, inlineEdit, codeList, null, true,null); + } + + public List> getSwapInfo(List> list, List swapDataVoList, String visualDevId, Boolean inlineEdit, List codeList,Map mainAndMast) { + if (list.isEmpty()) { + return list; + } + return getSwapList(list, swapDataVoList, visualDevId, inlineEdit, codeList, null, false,mainAndMast); + } + + public List> getSwapList(List> list, List swapDataVoList, String visualDevId, Boolean inlineEdit, + List codeList, Map localCacheParent, boolean isList,Map mainAndMast) { + try { + DynamicDataSourceUtil.switchToDataSource(null); + if (list.isEmpty()) { + return list; + } + //主表的缓存数据继续使用, 不重新初始化 + Map localCache = Optional.ofNullable(localCacheParent).orElse(new HashMap<>()); + //初始化系统缓存 + sysNeedSwapData(swapDataVoList, visualDevId, localCache); + //redis key + String dsName = Optional.ofNullable(DataSourceContextHolder.getDatasourceId()).orElse(""); + writeRedisAndList(localCache, swapDataVoList, dsName, visualDevId, inlineEdit, list, codeList, isList,mainAndMast); + } catch (SQLException e) { + throw new RuntimeException(e); + } finally { + DynamicDataSourceUtil.clearSwitchDataSource(); + } + return list; + } + + private List> writeRedisAndList(Map localCache, List swapDataVoList, String dsName, String visualDevId, Boolean inlineEdit, + List> list, List codeList, boolean isList, Map mainAndMast) { + + Map userMap = (Map) localCache.get("__user_map"); + Map orgMap = (Map) localCache.get("__org_map"); + Map posMap = (Map) localCache.get("__pos_map"); + //Map allOrgMap = (Map) localCache.get("__allOrg_map"); + Map roleMap = (Map) localCache.get("__role_map"); + Map groupMap = (Map) localCache.get("__group_map"); + + List> proMapList = (List>) localCache.get("__pro_maplist"); + for (int x = 0; x < list.size(); x++) { + Map dataMap = list.get(x); + if (dataMap == null) { + dataMap = new HashMap<>(); + list.set(x, dataMap); + } + Map dataCopyMap = new HashMap<>(dataMap); + for (FieLdsModel swapDataVo : swapDataVoList) { + String jnpfKey = swapDataVo.getConfig().getJnpfKey(); + String swapVModel = swapDataVo.getVModel(); + String vModel = inlineEdit && isList ? swapDataVo.getVModel() + "_name" : swapDataVo.getVModel(); + String dataType = swapDataVo.getConfig().getDataType(); + Boolean isMultiple = Objects.nonNull(swapDataVo.getMultiple()) ? swapDataVo.getMultiple() : false; + + try { + Map> dataDetailMap = new HashMap<>(); + if (StringUtil.isEmpty(String.valueOf(dataMap.get(swapVModel))) || String.valueOf(dataMap.get(swapVModel)).equals("[]") + || String.valueOf(dataMap.get(swapVModel)).equals("null")) { + if (jnpfKey.equals(JnpfKeyConsts.CHILD_TABLE)) { + dataMap.put(vModel, new ArrayList<>()); + } else { +// dataCopyMap.putAll(dataMap); + if (inlineEdit) { + dataMap.put(swapVModel, null); + } + dataMap.put(vModel, null); + } + continue; + } else { + //是否联动 + boolean DynamicNeedCache; + String redisKey; + String separator=swapDataVo.getSeparator(); + switch (jnpfKey) { + case JnpfKeyConsts.CALCULATE: + case JnpfKeyConsts.NUM_INPUT: + Object decimalValue = dataCopyMap.get(swapDataVo.getVModel()); + Integer precision = swapDataVo.getPrecision(); + if (decimalValue instanceof BigDecimal) { + BigDecimal bd = (BigDecimal) decimalValue; + String value=bd.toPlainString(); + if(precision !=null && precision>0){ + String formatZ="000000000000000"; + String format = formatZ.substring(0,precision); + DecimalFormat decimalFormat=new DecimalFormat("0."+format); + value= decimalFormat.format(bd); + } else { + value = String.valueOf(bd.stripTrailingZeros().toPlainString()); + } + dataMap.put(vModel, value); + }else{ + dataMap.put(vModel, decimalValue); + } + break; + //公司组件 + case JnpfKeyConsts.COMSELECT: + //部门组件 + case JnpfKeyConsts.DEPSELECT: + //所属部门 + case JnpfKeyConsts.CURRDEPT: + dataMap.put(vModel, OnlinePublicUtils.getDataInMethod(orgMap, dataMap.get(swapVModel), isMultiple)); + break; + //所属组织 + case JnpfKeyConsts.CURRORGANIZE: + //多级组织 + String orgIds = String.valueOf(dataMap.get(swapVModel)); + String orgId = ""; + String orgName = ""; + try{ + List jsonToList = JsonUtil.getJsonToList(orgIds, String.class); + orgId = jsonToList.get(jsonToList.size()-1); + }catch (Exception e){ + orgId = orgIds; + } + OrganizeEntity organizeEntity = StringUtil.isNotEmpty(orgId) ? organizeApi.getInfo(orgId) : null; + if ("all".equals(swapDataVo.getShowLevel())) { + if (organizeEntity != null) { + List organizeList = new ArrayList<>(); + organizeApi.getOrganizeId(orgId, organizeList); + Collections.reverse(organizeList); + orgName = organizeList.stream().map(OrganizeEntity::getFullName).collect(Collectors.joining("/" )); + } + } else { + if (organizeEntity != null) { + orgName = organizeEntity.getFullName(); + } else { + orgName = " "; + } + } + dataMap.put(vModel,orgName); + break; + + //岗位组件 + case JnpfKeyConsts.POSSELECT: + //所属岗位 + case JnpfKeyConsts.CURRPOSITION: + String posData = OnlinePublicUtils.getDataInMethod(posMap, dataMap.get(swapVModel), isMultiple); + if (ObjectUtil.isEmpty(dataMap.get(swapVModel))) { + dataMap.put(vModel, " "); + } else { + dataMap.put(vModel, posData); + } + break; + + //用户组件 + case JnpfKeyConsts.USERSELECT: + //创建用户 + case JnpfKeyConsts.CREATEUSER: + //修改用户 + case JnpfKeyConsts.MODIFYUSER: + String userData = OnlinePublicUtils.getDataInMethod(userMap, dataMap.get(swapVModel), isMultiple); + dataMap.put(vModel, userData); + break; + case JnpfKeyConsts.CUSTOMUSERSELECT: + List dataNoSwapInMethod = OnlinePublicUtils.getDataNoSwapInMethod(dataMap.get(swapVModel)); + StringJoiner valueJoin = new StringJoiner(","); + for (String data : dataNoSwapInMethod) { + String id = data.contains("--") ? data.substring(0, data.lastIndexOf("--")) : data; + String type = data.contains("--") ? data.substring(data.lastIndexOf("--") + 2) : ""; + Map cacheMap; + switch (type) { + case "role": + cacheMap = roleMap; + break; + case "position": + cacheMap = posMap; + break; + case "company": + case "department": + cacheMap = orgMap; + break; + case "group": + cacheMap = groupMap; + break; + case "user": + default: + cacheMap = userMap; + break; + } + valueJoin.add(Optional.ofNullable(cacheMap.get(id)).orElse("").toString()); + } + dataMap.put(vModel, valueJoin.toString()); + break; + //角色选择 + case JnpfKeyConsts.ROLESELECT: + String roleData = OnlinePublicUtils.getDataInMethod(roleMap, dataMap.get(swapVModel), isMultiple); + dataMap.put(vModel, roleData); + break; + + case JnpfKeyConsts.GROUPSELECT: + String groupData = OnlinePublicUtils.getDataInMethod(groupMap, dataMap.get(swapVModel), isMultiple); + dataMap.put(vModel, groupData); + break; + + //省市区联动 + case JnpfKeyConsts.ADDRESS: + String addressValue = String.valueOf(dataMap.get(swapVModel)); + if (OnlinePublicUtils.getMultiple(addressValue, MultipleControlEnum.MULTIPLE_JSON_TWO.getMultipleChar())) { + String[][] data = JsonUtil.getJsonToBean(addressValue, String[][].class); + List addList = new ArrayList<>(); + for (String[] AddressData : data) { + List adList = new ArrayList<>(); + for (int i = 0; i < AddressData.length; i++) { + String addressDatum = AddressData[i]; + String value = String.valueOf(proMapList.get(i).get(addressDatum)); + adList.add(value); + } + addList.add(String.join("/", adList)); + } + dataMap.put(vModel, String.join(";", addList)); + } else if (OnlinePublicUtils.getMultiple(addressValue, MultipleControlEnum.MULTIPLE_JSON_ONE.getMultipleChar())) { + List proDataS = JsonUtil.getJsonToList(String.valueOf(dataMap.get(swapVModel)), String.class); + List adList = new ArrayList<>(); + for (int i = 0; i < proDataS.size(); i++) { + String addressDatum = proDataS.get(i); + String value = String.valueOf(proMapList.get(i).get(addressDatum)); + adList.add(value); + } + dataMap.put(vModel, String.join("/", adList)); + } + break; + //开关 + case JnpfKeyConsts.SWITCH: + String switchValue = String.valueOf(dataMap.get(swapVModel)).equals("1") ? swapDataVo.getActiveTxt() : swapDataVo.getInactiveTxt(); + dataMap.put(vModel, switchValue); + break; + + case JnpfKeyConsts.CASCADER: + case JnpfKeyConsts.RADIO: + case JnpfKeyConsts.CHECKBOX: + case JnpfKeyConsts.SELECT: + case JnpfKeyConsts.TREESELECT: + if(StringUtil.isEmpty(separator)){ + separator="/"; + } + if (JnpfKeyConsts.CHECKBOX.equals(jnpfKey)) { + isMultiple = true; + } + DynamicNeedCache = swapDataVo.getConfig().getTemplateJson().size() == 0; + String interfacelabel = swapDataVo.getProps().getLabel() != null ? swapDataVo.getProps().getLabel() : ""; + String interfaceValue = swapDataVo.getProps().getValue() != null ? swapDataVo.getProps().getValue() : ""; + String interfaceChildren = swapDataVo.getProps().getChildren() != null ? swapDataVo.getProps().getChildren() : ""; + if (DynamicNeedCache) { + if (OnlineDataTypeEnum.STATIC.getType().equals(dataType)) { + redisKey = String.format("%s-%s-%s", visualDevId, swapDataVo.getConfig().getRelationTable()+swapDataVo.getVModel(), OnlineDataTypeEnum.STATIC.getType()); + } else if (dataType.equals(OnlineDataTypeEnum.DYNAMIC.getType())) { + redisKey = String.format("%s-%s-%s-%s-%s-%s", dsName, OnlineDataTypeEnum.DYNAMIC.getType(), swapDataVo.getConfig().getPropsUrl(), interfaceValue, interfacelabel, interfaceChildren); + } else { + redisKey = String.format("%s-%s-%s", dsName, OnlineDataTypeEnum.DICTIONARY.getType(), swapDataVo.getConfig().getDictionaryType()); + } + Map cascaderMap; + if (dataType.equals(OnlineDataTypeEnum.DICTIONARY.getType())) { + List> checkBoxList = (List>) localCache.get(redisKey); + cascaderMap = OnlinePublicUtils.getDataMap(checkBoxList, swapDataVo); + } else { + cascaderMap = (Map) localCache.get(redisKey); + } + dataMap.put(vModel, FormPublicUtils.getDataConversion(cascaderMap, dataMap.get(swapVModel),isMultiple,separator)); + + } else { + List templateJsonModels = JsonUtil.getJsonToList(swapDataVo.getConfig().getTemplateJson(), TemplateJsonModel.class); + Map paramMap = new HashMap<>(); + for (TemplateJsonModel templateJsonModel : templateJsonModels) { + String relationField = templateJsonModel.getRelationField(); + String Field = templateJsonModel.getField(); + String obj = inlineEdit ? "" : Optional.ofNullable(dataCopyMap.get(relationField)).orElse("").toString(); + if (StringUtil.isEmpty(relationField)) { + paramMap.put(Field, templateJsonModel.getDefaultValue()); + continue; + } + if(relationField.toLowerCase().contains(JnpfKeyConsts.CHILD_TABLE_PREFIX)){ + String childField = relationField.split("-")[1] ; + obj = Optional.ofNullable(dataCopyMap.get(childField)).orElse("").toString(); + }else if(mainAndMast!=null){ + obj= Optional.ofNullable(mainAndMast.get(relationField)).orElse("").toString(); + } + paramMap.put(Field, obj); + } + List> dataList = null; + List> options = new ArrayList<>(); + Map dataInterfaceMap = new HashMap(); + //缓存Key 租户-远端数据-id-base64({params}) + redisKey = String.format("%s-%s-%s-%s", dsName, OnlineDataTypeEnum.DYNAMIC.getType(), swapDataVo.getConfig().getPropsUrl(), Base64.getEncoder().encodeToString(JsonUtil.getObjectToString(paramMap).getBytes(StandardCharsets.UTF_8))); + if (localCache.containsKey(redisKey) || redisUtil.exists(redisKey)) { + if(localCache.containsKey(redisKey)){ + dataList = (List>) localCache.get(redisKey); + }else{ + List tmpList = redisUtil.get(redisKey, 0, -1); + List> tmpMapList = new ArrayList<>(); + tmpList.forEach(item-> { + tmpMapList.add(JsonUtil.entityToMap(item)); + }); + dataList = tmpMapList; + localCache.put(redisKey, dataList); + } + }else{ + ActionResult data = dataInterFaceApi.infoToId(swapDataVo.getConfig().getPropsUrl(),null, paramMap); + if (data != null && data.getData() != null) { + if (data.getData() instanceof List) { + dataList = (List>) data.getData(); + if(NEEDCACHE_REMOTE && CollectionUtils.isNotEmpty(dataList) && !JnpfKeyConsts.TREESELECT.equals(jnpfKey)) { + redisUtil.insert(redisKey, dataList, DEFAULT_CACHE_TIME); + } + localCache.put(redisKey, dataList); + } + } + } + if(dataList != null){ + JSONArray dataAll = JsonUtil.getListToJsonArray(dataList); + treeToList(interfacelabel, interfaceValue, interfaceChildren, dataAll, options); + options.stream().forEach(o -> { + dataInterfaceMap.put(String.valueOf(o.get(interfaceValue)), String.valueOf(o.get(interfacelabel))); + }); + } + dataMap.put(vModel, FormPublicUtils.getDataConversion(dataInterfaceMap, dataMap.get(swapVModel),isMultiple,separator)); + } + break; + case JnpfKeyConsts.RELATIONFORM: + //取关联表单数据 按绑定功能加字段区分数据 + redisKey = String.format("%s-%s-%s-%s-%s", dsName, JnpfKeyConsts.RELATIONFORM, swapDataVo.getModelId(), swapDataVo.getRelationField(), dataMap.get(vModel)); + VisualdevModelDataInfoVO infoVO = null; + if(localCache.containsKey(redisKey) || redisUtil.exists(redisKey)){ + infoVO = new VisualdevModelDataInfoVO(); + if(localCache.containsKey(redisKey)){ + infoVO.setData(localCache.get(redisKey).toString()); + }else{ + infoVO.setData(redisUtil.getString(redisKey).toString()); + localCache.put(redisKey, infoVO.getData()); + } + + }else{ + VisualdevEntity entity = visualdevService.getInfo(swapDataVo.getModelId()); + String keyId = String.valueOf(dataMap.get(swapVModel)); + if (!StringUtil.isEmpty(entity.getVisualTables()) && !OnlineDevData.TABLE_CONST.equals(entity.getVisualTables())) { + infoVO = visualDevInfoService.getDetailsDataInfo(keyId, entity); + } else { + infoVO = visualdevModelDataService.infoDataChange(keyId, entity); + } + String data = infoVO == null ? StringUtil.EMPTY : infoVO.getData(); + if(NEEDCACHE_RELATION) { + redisUtil.insert(redisKey, data, DEFAULT_CACHE_TIME); + } + localCache.put(redisKey, data); + } + if (infoVO != null && StringUtil.isNotEmpty(infoVO.getData())) { + Map formDataMap = JsonUtil.stringToMap(infoVO.getData()); + String relationField = swapDataVo.getRelationField(); + if (formDataMap != null && formDataMap.size() > 0) { + dataMap.put(swapDataVo.getVModel() + "_id", dataMap.get(swapVModel)); + dataMap.put(vModel, formDataMap.get(relationField)); + dataDetailMap.put(vModel, formDataMap); + } + } + break; + case JnpfKeyConsts.POPUPSELECT: + case JnpfKeyConsts.POPUPTABLESELECT: + //是否联动 + List templateJsonModels = JsonUtil.getJsonToList(swapDataVo.getTemplateJson(), TemplateJsonModel.class); + //DynamicNeedCache = templateJsonModels.size() == 0; + List> mapList; + Map popMaps = new HashMap<>(); + String value = String.valueOf(dataMap.get(swapVModel)); + + List listParam=new ArrayList<>(); + for (TemplateJsonModel templateJsonModel : templateJsonModels) { + String relationField = templateJsonModel.getRelationField(); + DataInterfaceModel dataInterfaceModel=JsonUtil.getJsonToBean(templateJsonModel,DataInterfaceModel.class); + if (StringUtil.isEmpty(relationField)){ + listParam.add(dataInterfaceModel); + continue; + } + String obj = inlineEdit ? "" : Optional.ofNullable(dataCopyMap.get(relationField)).orElse("").toString(); + if(relationField.toLowerCase().contains(JnpfKeyConsts.CHILD_TABLE_PREFIX)){ + String childField = relationField.split("-")[1] ; + obj = Optional.ofNullable(dataCopyMap.get(childField)).orElse("").toString(); + }else if(mainAndMast!=null){ + obj= Optional.ofNullable(mainAndMast.get(relationField)).orElse("").toString(); + } + dataInterfaceModel.setDefaultValue(obj); + listParam.add(dataInterfaceModel); + } + DataInterfacePage dataInterfacePage=new DataInterfacePage(); + dataInterfacePage.setParamList(listParam); + dataInterfacePage.setInterfaceId(swapDataVo.getInterfaceId()); + List ids = new ArrayList<>(); + if (value.startsWith("[")) { + ids = JsonUtil.getJsonToList(value, String.class); + } else { + ids.add(value); + } + dataInterfacePage.setIds(ids); + //缓存Key 租户-远端数据-base64({id, params, ids}) + redisKey = String.format("%s-%s-%s-%s", dsName, OnlineDataTypeEnum.DYNAMIC.getType(), swapDataVo.getInterfaceId(), Base64.getEncoder().encodeToString(JsonUtil.getObjectToString(dataInterfacePage).getBytes(StandardCharsets.UTF_8))); + if (localCache.containsKey(redisKey) || redisUtil.exists(redisKey)) { + if(localCache.containsKey(redisKey)){ + mapList = (List>) localCache.get(redisKey); + }else{ + List tmpList = redisUtil.get(redisKey, 0, -1); + List> tmpMapList = new ArrayList<>(); + tmpList.forEach(item-> { + tmpMapList.add(JsonUtil.entityToMap(item)); + }); + mapList = tmpMapList; + localCache.put(redisKey, mapList); + } + }else { + dataInterfacePage.setPropsValue(swapDataVo.getPropsValue()); + dataInterfacePage.setRelationField(swapDataVo.getRelationField()); + mapList = dataInterFaceApi.infoToInfo(swapDataVo.getInterfaceId(), dataInterfacePage); + if(NEEDCACHE_REMOTE) { + redisUtil.insert(redisKey, mapList, DEFAULT_CACHE_TIME); + } + localCache.put(redisKey, mapList); + } + + StringJoiner stringJoiner = new StringJoiner(","); + List popList = new ArrayList<>(); + if (value.startsWith("[")) { + popList = JsonUtil.getJsonToList(value, String.class); + } else { + popList.add(value); + } + for (String va : popList) { + if (popMaps.size() > 0) { + stringJoiner.add(String.valueOf(popMaps.get(va))); + } else { + Map PopMap = mapList.stream().filter(map -> Objects.equals(map.get(swapDataVo.getPropsValue()), va)).findFirst().orElse(new HashMap<>()); + if (PopMap.size() > 0) { + dataMap.put(vModel + "_id", dataMap.get(swapVModel)); + stringJoiner.add(String.valueOf(PopMap.get(swapDataVo.getRelationField()))); + dataDetailMap.put(vModel, PopMap); + } + } + } + dataMap.put(vModel, String.valueOf(stringJoiner)); + break; + case JnpfKeyConsts.MODIFYTIME: + case JnpfKeyConsts.CREATETIME: +// case JnpfKeyConsts.TIME: + case JnpfKeyConsts.DATE: + //判断是否为时间戳格式 + Object dateObj = dataMap.get(swapVModel); + LocalDateTime dateTime = LocalDateTimeUtil.of(new Date(DateTimeFormatConstant.getDateObjToLong(dateObj))); + String format = DateTimeFormatConstant.getFormat(swapDataVo.getFormat()); + + if (isList && (JnpfKeyConsts.MODIFYTIME.equals(jnpfKey) || JnpfKeyConsts.CREATETIME.equals(jnpfKey))) { + format = DateTimeFormatConstant.YEAR_MOnTH_DHM; + } + if (StringUtil.isEmpty(format)) { + format = DateTimeFormatConstant.YEAR_MOnTH_DHMS; + } + DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(format); + String date = dateTimeFormatter.format(dateTime); + dataMap.put(vModel, date); + if (JnpfKeyConsts.MODIFYTIME.equals(jnpfKey) || JnpfKeyConsts.CREATETIME.equals(jnpfKey)) { + dataMap.put(swapDataVo.getVModel(), date); + } + break; + case JnpfKeyConsts.RATE: + BigDecimal ratevalue=new BigDecimal(0); + if(dataMap.get(vModel)!=null){ + ratevalue= new BigDecimal(dataMap.get(vModel).toString()); + } + dataMap.put(vModel, ratevalue); + break; + case JnpfKeyConsts.SLIDER: + Object valueRate = null; + if (dataMap.get(vModel) != null) { + if (Objects.nonNull(swapDataVo.getAllowhalf()) && swapDataVo.getAllowhalf()) { + valueRate = Double.parseDouble(String.valueOf(dataMap.get(vModel))); + } else { + valueRate = Integer.parseInt(String.valueOf(dataMap.get(vModel))); + } + } + dataMap.put(vModel, valueRate); + break; + case JnpfKeyConsts.UPLOADFZ: + case JnpfKeyConsts.UPLOADIMG: + List> fileList = JsonUtil.getJsonToListMap(String.valueOf(dataMap.get(vModel))); + dataMap.put(vModel, fileList); + break; + case JnpfKeyConsts.CHILD_TABLE: + List childrens = swapDataVo.getConfig().getChildren(); + List> childList = (List>) dataMap.get(swapDataVo.getVModel()); + List> swapList = getSwapList(childList, childrens, visualDevId, inlineEdit, codeList, localCache, true, dataCopyMap); + dataMap.put(swapDataVo.getVModel(), swapList); + break; + default: + dataMap.put(vModel, dataMap.get(swapVModel)); + break; + } + } + //二维码 条形码最后处理 + swapCodeDataInfo(codeList, dataMap, dataCopyMap); + //关联选择属性 + if (dataDetailMap.size() > 0) { + getDataAttr(swapDataVoList, dataMap, dataDetailMap); + } + } catch (Exception e) { + e.printStackTrace(); + log.error("在线开发转换数据错误:" + e.getMessage()); + } + } + } + if (inlineEdit && isList) { + for (Map map : list) { + //行内编辑过滤子表 + swapDataVoList = swapDataVoList.stream().filter(s -> !s.getVModel().contains("tableField")).collect(Collectors.toList()); + onlineDevInfoUtils.getInitLineData(swapDataVoList, map); + } + } + return list; + } + + /** + * 保存需要转换的数据到redis(系统控件) + * + * @param swapDataVoList + * @param visualDevId + * @param localCache + */ + public void sysNeedSwapData(List swapDataVoList, String visualDevId, Map localCache) { + //公共数据 + String dsName = Optional.ofNullable(DataSourceContextHolder.getDatasourceId()).orElse(""); + + String redisKey; + try { + boolean needUser = false, needOrg = false, needPos = false, needRole = false, needGroup = false, needProvince = false; + for (FieLdsModel swapDataVo : swapDataVoList) { + String jnpfKey = swapDataVo.getConfig().getJnpfKey(); + String dataType = swapDataVo.getConfig().getDataType(); + switch (jnpfKey) { + case JnpfKeyConsts.CHILD_TABLE: + List children = swapDataVo.getConfig().getChildren(); + sysNeedSwapData(children, visualDevId, localCache); + break; + //用户组件 + case JnpfKeyConsts.USERSELECT: + //创建用户 + case JnpfKeyConsts.CREATEUSER: + //修改用户 + case JnpfKeyConsts.MODIFYUSER: + needUser = true; + break; + //公司组件 + case JnpfKeyConsts.COMSELECT: + //部门组件 + case JnpfKeyConsts.DEPSELECT: + //所属部门 + case JnpfKeyConsts.CURRDEPT: + //所属组织 + case JnpfKeyConsts.CURRORGANIZE: + needOrg = true; + break; + //岗位组件 + case JnpfKeyConsts.POSSELECT: + //所属岗位 + case JnpfKeyConsts.CURRPOSITION: + needPos = true; + break; + //角色选择 + case JnpfKeyConsts.ROLESELECT: + needRole = true; + break; + //分组选择 + case JnpfKeyConsts.GROUPSELECT: + needGroup = true; + break; + //用户选择组件 + case JnpfKeyConsts.CUSTOMUSERSELECT: + needUser = needOrg = needPos = needGroup = needRole = true; + break; + //省市区选择组件 + case JnpfKeyConsts.ADDRESS: + needProvince = true; + break; + default: + break; + } + if (dataType != null) { + //数据接口的数据存放 + String label = swapDataVo.getProps().getLabel() != null ? swapDataVo.getProps().getLabel() : ""; + String value = swapDataVo.getProps().getValue() != null ? swapDataVo.getProps().getValue() : ""; + String children = swapDataVo.getProps().getChildren() != null ? swapDataVo.getProps().getChildren() : ""; + List> options = new ArrayList<>(); + if (swapDataVo.getConfig().getJnpfKey().equals(JnpfKeyConsts.POPUPSELECT) || swapDataVo.getConfig().getJnpfKey().equals(JnpfKeyConsts.POPUPTABLESELECT)) { + label = swapDataVo.getRelationField(); + value = swapDataVo.getPropsValue(); + } + Map dataInterfaceMap = new HashMap<>(16); + String finalValue = value; + String finalLabel = label; + //静态数据 + if (dataType.equals(OnlineDataTypeEnum.STATIC.getType())) { + redisKey = String.format("%s-%s-%s", visualDevId, swapDataVo.getConfig().getRelationTable()+swapDataVo.getVModel(), OnlineDataTypeEnum.STATIC.getType()); + if(!localCache.containsKey(redisKey)) { + if (!redisUtil.exists(redisKey)) { + if (swapDataVo.getOptions() != null) { + options = JsonUtil.getJsonToListMap(swapDataVo.getOptions()); + JSONArray data = JsonUtil.getListToJsonArray(options); + getOptions(label, value, children, data, options); + } else { + options = JsonUtil.getJsonToListMap(swapDataVo.getOptions()); + } + + options.stream().forEach(o -> { + dataInterfaceMap.put(String.valueOf(o.get(finalValue)), String.valueOf(o.get(finalLabel))); + }); + if(NEEDCACHE_REMOTE) { + redisUtil.insert(redisKey, dataInterfaceMap, DEFAULT_CACHE_TIME); + } + localCache.put(redisKey, dataInterfaceMap); + } else { + localCache.put(redisKey, redisUtil.getMap(redisKey)); + } + } + } + //远端数据 + if (dataType.equals(OnlineDataTypeEnum.DYNAMIC.getType())) { + //联动状态下不做缓存, 具体查数据时做缓存 + boolean dynamicIsNeedCache = swapDataVo.getConfig().getTemplateJson().size() == 0; + if (dynamicIsNeedCache) { + redisKey = String.format("%s-%s-%s-%s-%s-%s", dsName, OnlineDataTypeEnum.DYNAMIC.getType(), swapDataVo.getConfig().getPropsUrl(), value, label, children); + if(!localCache.containsKey(redisKey)) { + if (!redisUtil.exists(redisKey)) { + ActionResult data = dataInterFaceApi.infoToId(swapDataVo.getConfig().getPropsUrl(),null,null); + if (data != null && data.getData() != null) { + List> dataList = new ArrayList<>(); + if (data.getData() instanceof List) { + dataList = (List>) data.getData(); + } + JSONArray dataAll = JsonUtil.getListToJsonArray(dataList); + treeToList(label, value, children, dataAll, options); + options.stream().forEach(o -> { + dataInterfaceMap.put(String.valueOf(o.get(finalValue)), String.valueOf(o.get(finalLabel))); + }); + if(NEEDCACHE_REMOTE && CollectionUtils.isNotEmpty(dataList) && !JnpfKeyConsts.TREESELECT.equals(jnpfKey)) { + redisUtil.insert(redisKey, dataInterfaceMap, DEFAULT_CACHE_TIME); + } + localCache.put(redisKey, dataInterfaceMap); + } + } else { + localCache.put(redisKey, redisUtil.getMap(redisKey)); + } + } + } + } + //数据字典 + if (dataType.equals(OnlineDataTypeEnum.DICTIONARY.getType())) { + redisKey = String.format("%s-%s-%s", dsName, OnlineDataTypeEnum.DICTIONARY.getType(), swapDataVo.getConfig().getDictionaryType()); + if(!localCache.containsKey(redisKey)) { + if (!redisUtil.exists(redisKey)) { + List list = dictionaryDataApi.getDicList(swapDataVo.getConfig().getDictionaryType()); + options = list.stream().map(dic -> { + Map dictionaryMap = new HashMap<>(16); + dictionaryMap.put("id", dic.getId()); + dictionaryMap.put("enCode", dic.getEnCode()); + dictionaryMap.put("fullName", dic.getFullName()); + return dictionaryMap; + }).collect(Collectors.toList()); + String dictionaryData = JsonUtil.getObjectToString(options); + if(NEEDCACHE_REMOTE) { + redisUtil.insert(redisKey, dictionaryData, DEFAULT_CACHE_TIME); + } + localCache.put(redisKey, options); + } else { + String dictionaryStringData = redisUtil.getString(redisKey).toString(); + localCache.put(redisKey, JsonUtil.getJsonToListMap(dictionaryStringData)); + } + } + } + } + } + //有使用相关组件的情况才初始化数据 + if (needUser && !localCache.containsKey("__user_map")) { + //人员 + redisKey = dsName + CacheKeyEnum.USER.getName(); + Map userMap; + if(redisUtil.exists(redisKey)){ + userMap = redisUtil.getMap(redisKey); + userMap = Optional.ofNullable(userMap).orElse(new HashMap<>(20)); + }else{ + userMap = userApi.getUserMap(); + if(NEEDCACHE_SYS) { + redisUtil.insert(redisKey, userMap, DEFAULT_CACHE_TIME); + } + } + localCache.put("__user_map", userMap); + } + if (needOrg && !localCache.containsKey("__org_map")) { + //组织 + redisKey = dsName + CacheKeyEnum.ORG.getName(); + Map orgMap; + if(redisUtil.exists(redisKey)) { + orgMap = redisUtil.getMap(redisKey); + orgMap = Optional.ofNullable(orgMap).orElse(new HashMap<>(20)); + }else{ + orgMap = organizeApi.getOrgMap(); + if(NEEDCACHE_SYS) { + redisUtil.insert(redisKey, orgMap, DEFAULT_CACHE_TIME); + } + } + localCache.put("__org_map", orgMap); + } + /*if(needOrg && !localCache.containsKey("__allOrg_map")){ + //组织需要递归显示 + Map allOrgMap = redisUtil.getMap(dsName + CacheKeyEnum.AllORG.getName()); + allOrgMap = Optional.ofNullable(allOrgMap).orElse(new HashMap<>(20)); + localCache.put("__allOrg_map", allOrgMap); + }*/ + if (needPos && !localCache.containsKey("__pos_map")) { + //岗位 + redisKey = dsName + CacheKeyEnum.POS.getName(); + Map posMap; + if(redisUtil.exists(redisKey)) { + posMap = redisUtil.getMap(redisKey); + posMap = Optional.ofNullable(posMap).orElse(new HashMap<>(20)); + }else{ + posMap = positionApi.getPosMap(); + if(NEEDCACHE_SYS) { + redisUtil.insert(redisKey, posMap, DEFAULT_CACHE_TIME); + } + } + localCache.put("__pos_map", posMap); + } + if (needRole && !localCache.containsKey("__role_map")) { + //角色 + redisKey = dsName + CacheKeyEnum.ROLE.getName(); + Map roleMap; + if(redisUtil.exists(redisKey)) { + roleMap = redisUtil.getMap(redisKey); + roleMap = Optional.ofNullable(roleMap).orElse(new HashMap<>(20)); + }else{ + roleMap = roleApi.getRoleMap(); + if(NEEDCACHE_SYS) { + redisUtil.insert(redisKey, roleMap, DEFAULT_CACHE_TIME); + } + } + localCache.put("__role_map", roleMap); + } + if (needGroup && !localCache.containsKey("__group_map")) { + //分组 + redisKey = dsName + CacheKeyEnum.GROUP.getName(); + Map groupMap; + if(redisUtil.exists(redisKey)) { + groupMap = redisUtil.getMap(redisKey); + groupMap = Optional.ofNullable(groupMap).orElse(new HashMap<>(20)); + }else{ + groupMap = groupApi.getGroupMap(); + if(NEEDCACHE_SYS) { + redisUtil.insert(redisKey, groupMap, DEFAULT_CACHE_TIME); + } + } + localCache.put("__group_map", groupMap); + } + if (needProvince && !localCache.containsKey("__pro_maplist")) { + //省市区 + Map proMap = redisUtil.getMap(String.format("%s-%s-%d", dsName, "province", 1)); + List> proMapList = new ArrayList<>(); + if (proMap.size() == 0) { + proMapList = fillProMap(dsName); + } else { + for (int i = 1; i <= 4; i++) { + proMapList.add(redisUtil.getMap(String.format("%s-%s-%d", dsName, "province", i))); + } + } + localCache.put("__pro_maplist", proMapList); + } + } catch (Exception e) { + log.error("在线开发转换数据异常:" + e.getMessage(), e); + } + } + + + private List> fillProMap(String dsName) { + List> proMapList = new ArrayList<>(); + //分级存储 + for (int i = 1; i <= 4; i++) { + String redisKey = String.format("%s-%s-%d", dsName, "province", i); + if (!redisUtil.exists(redisKey)) { + List provinceEntityList = areaApi.getProListBytype(String.valueOf(i)); + Map provinceMap = new HashMap<>(16); + if (provinceEntityList != null) { + provinceEntityList.stream().forEach(p -> provinceMap.put(p.getId(), p.getFullName())); + } + proMapList.add(provinceMap); + //区划基本不修改 不做是否缓存判断 + redisUtil.insert(redisKey, provinceMap, RedisUtil.CAHCEWEEK); + } + } + return proMapList; + } + + /** + * 级联递归 + * + * @param value + * @param label + * @param children + * @param data + * @param result + */ + private static void treeToList(String value, String label, String children, JSONArray data, List> result) { + for (int i = 0; i < data.size(); i++) { + JSONObject ob = data.getJSONObject(i); + Map tree = new HashMap<>(16); + tree.put(value, String.valueOf(ob.get(value))); + tree.put(label, String.valueOf(ob.get(label))); + result.add(tree); + if (ob.get(children) != null) { + JSONArray childArray = ob.getJSONArray(children); + treeToList(value, label, children, childArray, result); + } + } + } + + /** + * 递归查询 + * + * @param label + * @param value + * @param Children + * @param data + * @param options + */ + public static void getOptions(String label, String value, String Children, JSONArray data, List> options) { + for (int i = 0; i < data.size(); i++) { + JSONObject ob = data.getJSONObject(i); + Map tree = new HashMap<>(16); + tree.put(value, String.valueOf(ob.get(value))); + tree.put(label, String.valueOf(ob.get(label))); + options.add(tree); + if (ob.get(Children) != null) { + JSONArray childrenArray = ob.getJSONArray(Children); + getOptions(label, value, Children, childrenArray, options); + } + } + } + + /** + * 生成关联属性(弹窗选择属性,关联表单属性) + * + * @param fieLdsModelList + * @param dataMap + * @param dataDetailMap + */ + private static void getDataAttr(List fieLdsModelList, Map dataMap, Map> dataDetailMap) { + for (FieLdsModel fieLdsModel : fieLdsModelList) { + if (ObjectUtil.isEmpty(fieLdsModel)) { + continue; + } + ConfigModel config = fieLdsModel.getConfig(); + String jnpfKey = config.getJnpfKey(); + if (jnpfKey.equals(JnpfKeyConsts.RELATIONFORM_ATTR) || jnpfKey.equals(JnpfKeyConsts.POPUPSELECT_ATTR)) { + //0展示数据 ? 1存储数据 + boolean isShow = fieLdsModel.getIsStorage() == 0; + if (isShow) { + String relationField = fieLdsModel.getRelationField(); + if (relationField.contains("_jnpfTable_")) { + relationField = relationField.split("_jnpfTable_")[0]; + } + String showField = fieLdsModel.getShowField(); + Map formDataMap = dataDetailMap.get(relationField); + if (formDataMap != null) { + dataMap.put(relationField + "_" + showField, formDataMap.get(showField)); + } + } + } + } + } + + + /** + * 二维码 条形码详情数据 + * + * @param codeList 控件集合 + * @param swapDataMap 转换后的数据 + * @param dataMap 转换前 + * @return + */ + public static void swapCodeDataInfo(List codeList, Map swapDataMap, Map dataMap) { + for (FormModel formModel : codeList) { + String jnpfKey = formModel.getConfig().getJnpfKey(); + if (jnpfKey.equals(JnpfKeyConsts.QR_CODE) || jnpfKey.equals(JnpfKeyConsts.BARCODE)) { + String codeDataType = formModel.getDataType(); + if (OnlineDataTypeEnum.RELATION.getType().equals(codeDataType)) { + String relationFiled = formModel.getRelationField(); + if (StringUtil.isNotEmpty(relationFiled)) { + Object relationValue = dataMap.get(relationFiled); + if (ObjectUtil.isNotEmpty(relationValue)) { + swapDataMap.put(relationFiled + "_id", relationValue); + } + } + } + } + } + } + + public ExcelImportModel createExcelData(List> dataList, VisualDevJsonModel visualJsonModel,VisualdevEntity visualdevEntity) throws WorkFlowException { + ExcelImportModel excelImportModel = new ExcelImportModel(); + Integer primaryKeyPolicy = visualJsonModel.getFormData().getPrimaryKeyPolicy(); + //导入功能流程列表数据 + boolean flowEnable = visualJsonModel.isFlowEnable(); + + String uploaderTemplateJson = visualJsonModel.getColumnData().getUploaderTemplateJson(); + UploaderTemplateModel uploaderTemplateModel = JsonUtil.getJsonToBean(uploaderTemplateJson, UploaderTemplateModel.class); + String dataType = uploaderTemplateModel.getDataType(); + ImportFormCheckUniqueModel uniqueModel = new ImportFormCheckUniqueModel(); + uniqueModel.setMain(true); + uniqueModel.setDbLinkId(visualJsonModel.getDbLinkId()); + uniqueModel.setUpdate(dataType.equals("2")); + uniqueModel.setPrimaryKeyPolicy(primaryKeyPolicy); + uniqueModel.setLogicalDelete(visualJsonModel.getFormData().getLogicalDelete()); + uniqueModel.setTableModelList(visualJsonModel.getVisualTables()); + + Map localCache = new HashMap<>(); + + //读取系统控件 所需编码 id + Map depMap = organizeApi.getOrgEncodeAndName("department"); + localCache.put("_dep_map", depMap); + Map comMap = organizeApi.getOrgNameAndId(""); + localCache.put("_com_map", comMap); + Map posMap = positionApi.getPosEncodeAndName(); + localCache.put("_pos_map", posMap); + Map userMap = userApi.getUserNameAndIdMap(); + localCache.put("_user_map", userMap); + Map roleMap = roleApi.getRoleNameAndIdMap(); + localCache.put("_role_map", roleMap); + Map groupMap = groupApi.getGroupEncodeMap(); + localCache.put("_group_map", groupMap); + + List idAll = new ArrayList<>(); + List orgList = orgList(JnpfConst.CURRENT_ORG_TYPE); + localCache.put("_org_list" , orgList); + List orgSubList = orgList(JnpfConst.CURRENT_ORG_SUB_TYPE); + localCache.put("_orgSub_list" , orgSubList); + List gradeList = orgList(JnpfConst.CURRENT_GRADE_TYPE); + localCache.put("_grade_list" , gradeList); + idAll.addAll(orgList); + idAll.addAll(orgSubList); + idAll.addAll(gradeList); + List relationList = organizeRelationApi.getRelationListByOrganizeId(idAll, ""); + List listByObjectIdAll = userRelationApi.getListByObjectIdAll(idAll); + for (UserRelationEntity userRelationEntity : listByObjectIdAll) { + OrganizeRelationEntity model = new OrganizeRelationEntity(); + model.setObjectType(PermissionConst.USER); + model.setOrganizeId(userRelationEntity.getObjectId()); + model.setObjectId(userRelationEntity.getUserId()); + relationList.add(model); + } + localCache.put("_relation_List" , relationList); + List> failResult = new ArrayList<>(); + + List dataInfo = new ArrayList<>(); + try { + for (Map data : dataList) { + Map resultMap = new HashMap<>(data); + StringJoiner errInfo = new StringJoiner(","); + Map errorMap = new HashMap<>(data); + boolean hasError = this.checkExcelData(visualJsonModel.getFormListModels(), + data, localCache, resultMap, errInfo, errorMap, uniqueModel); + if (hasError) { + failResult.add(errorMap); + } else { + VisualdevModelDataInfoVO infoVO = new VisualdevModelDataInfoVO(); + //导入时默认第一个流程 + if (flowEnable) { + resultMap.put(FlowFormConstant.FLOWID, visualJsonModel.getFlowId()); + } + if (StringUtil.isNotEmpty(uniqueModel.getId())) { + visualdevModelDataService.visualUpdate(visualdevEntity,resultMap,uniqueModel.getId()); + infoVO.setId(uniqueModel.getId()); + infoVO.setIntegrateId(uniqueModel.getId()); + infoVO.setData(JsonUtil.getObjectToString(resultMap)); + } else { + DataModel dataModel = visualdevModelDataService.visualCreate(visualdevEntity, resultMap); + infoVO.setId(dataModel.getMainId()); + infoVO.setData(JsonUtil.getObjectToString(resultMap)); + } + dataInfo.add(infoVO); + } + } + } catch (Exception e) { + e.printStackTrace(); + throw new WorkFlowException("导入异常!"); + } finally { + DynamicDataSourceUtil.clearSwitchDataSource(); + } + excelImportModel.setFnum(failResult.size()); + excelImportModel.setSnum(dataList.size() - failResult.size()); + excelImportModel.setResultType(failResult.size() > 0 ? 1 : 0); + excelImportModel.setFailResult(failResult); + excelImportModel.setDataInfoList(dataInfo); + return excelImportModel; + } + + private List orgList(String type) { + List org = new ArrayList() {{ add(type); }}; + OrganizeConditionModel orgType = new OrganizeConditionModel(); + orgType.setDepartIds(org); + List orgList = new ArrayList<>(); + List orgIdsList = organizeRelationApi.getOrgIdsList(orgType); + for (OrganizeModel organizeModel : orgIdsList) { + List treeList = StringUtil.isNotEmpty(organizeModel.getOrganizeIdTree()) ? Arrays.asList(organizeModel.getOrganizeIdTree().split(",")) : new ArrayList<>(); + orgList.addAll(treeList); + } + return orgList; + } + + public boolean checkExcelData(List modelList, Map data, Map localCache, Map insMap, + StringJoiner errInfo, Map errorMap, ImportFormCheckUniqueModel uniqueModel) throws Exception { + try{ + UserInfo userInfo = UserProvider.getUser(); + UserEntity userEntity = userApi.getInfo(userInfo.getUserId()); + + if (uniqueModel.isMain()) { + uniqueModel.setId(null); + } + + //读取系统控件 所需编码 id + Map depMap = (Map) localCache.get("_dep_map"); + Map comMap = (Map) localCache.get("_com_map"); + Map posMap = (Map) localCache.get("_pos_map"); + Map userMap = (Map) localCache.get("_user_map"); + Map roleMap = (Map) localCache.get("_role_map"); + Map groupMap = (Map) localCache.get("_group_map"); + + List orgList = (List) localCache.get("_org_list"); + List orgSubList = (List) localCache.get("_orgSub_list"); + List gradeList = (List) localCache.get("_grade_list"); + List relationListAll = (List) localCache.get("_relation_List"); + + //异常数据 + for (FieLdsModel swapDataVo : modelList) { + try { + String jnpfKey = swapDataVo.getConfig().getJnpfKey(); + String dataType = swapDataVo.getConfig().getDataType(); + Object valueO = data.get(swapDataVo.getVModel()); + String label = swapDataVo.getConfig().getLabel(); + //是否必填 + boolean required = swapDataVo.getConfig().isRequired(); + if (valueO == null || "null".equals(valueO) || StringUtil.isEmpty(String.valueOf(valueO))) { + if (required && !JnpfKeyConsts.getUploadMaybeNull().contains(jnpfKey)) { + errInfo.add(label + "值不能为空"); + } + continue; + } + String value = String.valueOf(valueO); + if (StringUtil.isEmpty(value)) { + continue; + } + Boolean multiple = swapDataVo.getMultiple(); + if (JnpfKeyConsts.CHECKBOX.equals(jnpfKey)) { + multiple = true; + } + if (JnpfKeyConsts.CASCADER.equals(jnpfKey)) { + multiple = swapDataVo.getMultiple(); + } + + boolean valueMul = value.contains(","); + value = value.trim(); + List valueList = valueMul ? Arrays.asList(value.split(",")) : new ArrayList<>(); + if (!valueMul) { + valueList.add(value); + } + String ableIds = swapDataVo.getAbleIds()!=null?swapDataVo.getAbleIds():"[]"; + OnlineCusCheckModel cusCheckModel = AbleUtil.ableModel(ableIds , jnpfKey); + List ableSystemIds = cusCheckModel.getAbleSystemIds(); + List idList = new ArrayList<>(); + for (String systemId : ableSystemIds) { + if(JnpfConst.CURRENT_ORG_TYPE.equals(systemId) || JnpfConst.CURRENT_ORG.equals(systemId)){ + idList.addAll(orgList); + } + if(JnpfConst.CURRENT_GRADE_TYPE.equals(systemId) || JnpfConst.CURRENT_GRADE.equals(systemId)){ + idList.addAll(gradeList); + } + if(JnpfConst.CURRENT_ORG_SUB_TYPE.equals(systemId) || JnpfConst.CURRENT_ORG_SUB.equals(systemId)){ + idList.addAll(orgSubList); + } + } + cusCheckModel.getAbleComIds().addAll(idList); + cusCheckModel.getAbleDepIds().addAll(idList); + List relationList = relationListAll.stream().filter(t -> idList.contains(t.getOrganizeId())).collect(Collectors.toList()); + Map> relationMap = relationList.stream().collect(Collectors.groupingBy(OrganizeRelationEntity::getObjectType)); + for(String key:relationMap.keySet()){ + List list = relationMap.get(key).stream().map(OrganizeRelationEntity::getObjectId).collect(Collectors.toList()); + for(String objectId : list){ + if(PermissionConst.ROLE.equalsIgnoreCase(key)){ + cusCheckModel.getAbleRoleIds().add(objectId); + cusCheckModel.getAbleIds().add(objectId+"--"+PermissionConst.ROLE.toLowerCase()); + } + if(PermissionConst.POSITION.equalsIgnoreCase(key)){ + cusCheckModel.getAblePosIds().add(objectId); + cusCheckModel.getAbleIds().add(objectId+"--"+PermissionConst.POSITION.toLowerCase()); + } + if(PermissionConst.USER.equalsIgnoreCase(key)){ + cusCheckModel.getAbleUserIds().add(objectId); + cusCheckModel.getAbleIds().add(objectId+"--"+PermissionConst.USER.toLowerCase()); + } + if(PermissionConst.GROUP.equalsIgnoreCase(key)){ + cusCheckModel.getAbleGroupIds().add(objectId); + cusCheckModel.getAbleIds().add(objectId+"--"+PermissionConst.GROUP.toLowerCase()); + } + if(PermissionConst.DEPARTMENT.equalsIgnoreCase(key)){ + cusCheckModel.getAbleDepIds().add(objectId); + cusCheckModel.getAbleIds().add(objectId+"--"+PermissionConst.DEPARTMENT.toLowerCase()); + } + if(PermissionConst.ORGANIZE.equalsIgnoreCase(key)){ + cusCheckModel.getAbleComIds().add(objectId); + cusCheckModel.getAbleIds().add(objectId+"--"+PermissionConst.ORGANIZE.toLowerCase()); + } + } + } + cusCheckModel.setControlType(jnpfKey); + List dataList; + switch (jnpfKey) { + case JnpfKeyConsts.NUM_INPUT: + String regNum = "^[0-9]*+(.[0-9]*)?$"; + if (StringUtil.isNotEmpty(value) && !value.matches(regNum)) { + errInfo.add(label + "值不正确"); + } + break; + /** + * 高级控件 + */ + case JnpfKeyConsts.COMSELECT: + boolean comErrorHapen = false; + if (!multiple) { + if (valueList.size() > 1) { + comErrorHapen = true; + errInfo.add(label + "非多选"); + } + } + if (!comErrorHapen) { + boolean comvalueErroHappen = false; + List> comTwoList = new ArrayList<>(); + List comOneList = new ArrayList<>(); + for (String comValue : valueList) { + String[] split = comValue.split("/"); + List comIdList = new ArrayList<>(); + for (String comId : split) { + Object o = comMap.get(comId); + if (o != null) { + comIdList.add(o.toString()); + } else { + comvalueErroHappen = true; + break; + } + } + comOneList.addAll(comIdList); + comTwoList.add(comIdList); + } + + boolean orgListRight = orgListRight(comTwoList,comOneList); + if (comvalueErroHappen || orgListRight) { + errInfo.add(label + "值不正确"); + } else { + insMap.put(swapDataVo.getVModel(), !multiple ? JsonUtil.getObjectToString(comOneList) : JsonUtil.getObjectToString(comTwoList)); + if (swapDataVo.getSelectType().equals("custom")) { + cusCheckModel.setDataList(comOneList); + checkCustomControl(cusCheckModel, errInfo, label); + } + } + } + break; + case JnpfKeyConsts.DEPSELECT: + dataList = checkOptionsControl(multiple, insMap, swapDataVo.getVModel(), label, depMap, valueList, errInfo); + if (dataList.size() == valueList.size() && swapDataVo.getSelectType().equals("custom")) { + cusCheckModel.setDataList(dataList); + checkCustomControl(cusCheckModel, errInfo, label); + } + break; + case JnpfKeyConsts.POSSELECT: + dataList = checkOptionsControl(multiple, insMap, swapDataVo.getVModel(), label, posMap, valueList, errInfo); + if (dataList.size() == valueList.size() && swapDataVo.getSelectType().equals("custom")) { + cusCheckModel.setDataList(dataList); + checkCustomControl(cusCheckModel, errInfo, label); + } + break; + case JnpfKeyConsts.USERSELECT: + dataList = checkOptionsControl(multiple, insMap, swapDataVo.getVModel(), label, userMap, valueList, errInfo); + if (dataList.size() == valueList.size() && swapDataVo.getSelectType().equals("custom")) { + cusCheckModel.setDataList(dataList); + checkCustomControl(cusCheckModel, errInfo, label); + } + break; + case JnpfKeyConsts.CUSTOMUSERSELECT: + boolean cusUserErrorHapen = false; + if (!multiple) { + //非多选填入多选值 + if (valueList.size() > 1) { + cusUserErrorHapen = true; + errInfo.add(label + "非多选"); + } + } + if (!cusUserErrorHapen) { + boolean cusUserErrorHapen1 = false; + List cusUserList = new ArrayList<>(); + for (String va : valueList) { + String type = null; + String id = null; + if (groupMap.get(va) != null) { + type = "group"; + id = groupMap.get(va).toString(); + } else if (roleMap.get(va) != null) { + type = "role"; + id = roleMap.get(va).toString(); + } else if (depMap.get(va) != null) { + type = "department"; + id = depMap.get(va).toString(); + } else if (comMap.get(va) != null) { + type = "company"; + id = comMap.get(va).toString(); + } else if (posMap.get(va) != null) { + type = "position"; + id = posMap.get(va).toString(); + } else if (userMap.get(va) != null) { + type = "user"; + id = userMap.get(va).toString(); + } + if (type == null && id == null) { + cusUserErrorHapen1 = true; + } else { + String lastCusId = id + "--" + type; + cusUserList.add(lastCusId); + } + } + if (cusUserErrorHapen1) { + errInfo.add(label + "值不正确"); + } else { + insMap.put(swapDataVo.getVModel(), !multiple ? cusUserList.get(0) : JsonUtil.getObjectToString(cusUserList)); + if (swapDataVo.getSelectType().equals("custom")) { + cusCheckModel.setDataList(cusUserList); + checkCustomControl(cusCheckModel, errInfo, label); + } + } + } + break; + case JnpfKeyConsts.ROLESELECT: + dataList = checkOptionsControl(multiple, insMap, swapDataVo.getVModel(), label, roleMap, valueList, errInfo); + if (dataList.size() == valueList.size() && swapDataVo.getSelectType().equals("custom")) { + cusCheckModel.setDataList(dataList); + checkCustomControl(cusCheckModel, errInfo, label); + } + break; + case JnpfKeyConsts.GROUPSELECT: + dataList = checkOptionsControl(multiple, insMap, swapDataVo.getVModel(), label, groupMap, valueList, errInfo); + if (dataList.size() == valueList.size() && swapDataVo.getSelectType().equals("custom")) { + cusCheckModel.setDataList(dataList); + checkCustomControl(cusCheckModel, errInfo, label); + } + break; + case JnpfKeyConsts.ADDRESS: + boolean addressErrorHapen = false; + if (!multiple) { + //非多选填入多选值 + if (valueList.size() > 1) { + addressErrorHapen = true; + errInfo.add(label + "非多选"); + } + } + if (!addressErrorHapen) { + boolean addressErrorHapen1 = false; + valueList = Arrays.asList(value.split(",")); + List addresss = new ArrayList<>(); + List addressList1 = new ArrayList<>(); + for (String va : valueList) { + String[] addressSplit = va.split("/"); + if (addressSplit.length != swapDataVo.getLevel() + 1) { + addressErrorHapen1 = true; + } + List addressJoined = new ArrayList<>(); + List addressParentID = new ArrayList<>(); + for (String add : addressSplit) { + ProvinceEntity PRO = areaApi.getInfo(add, addressParentID); + if (PRO == null) { + addressErrorHapen1 = true; + } else { + addressJoined.add(PRO.getId()); + addressParentID.add(PRO.getId()); + } + } + addressList1.addAll(addressJoined); + addresss.add(addressJoined.toArray(new String[addressJoined.size()])); + } + if (addressErrorHapen1) { + errInfo.add(label + "值不正确"); + } else { + insMap.put(swapDataVo.getVModel(), multiple ? JsonUtil.getObjectToString(addresss) : JsonUtil.getObjectToString(addressList1)); + } + } + break; + /** + * 系统控件 + */ + case JnpfKeyConsts.CURRORGANIZE: + List OrgRelations = userRelationApi.getListByUserId(userInfo.getUserId(), PermissionConst.ORGANIZE); + // String currentOrgValue = userEntity.getOrganizeId(); + // if (!"all".equals(swapDataVo.getShowLevel())) { + // OrganizeEntity organizeInfo = organizeService.getInfo(userEntity.getOrganizeId()); + // if ("company".equals(organizeInfo.getCategory())) { + // currentOrgValue = null; + // } + // } + insMap.put(swapDataVo.getVModel(), OrgRelations.size() > 0 ? OrgRelations.get(0).getObjectId() : null); + break; + case JnpfKeyConsts.CURRDEPT: + List depUserRelations = userRelationApi.getListByUserId(userInfo.getUserId(), PermissionConst.DEPARTMENT); + insMap.put(swapDataVo.getVModel(), depUserRelations.size() > 0 ? depUserRelations.get(0).getObjectId() : null); + break; + case JnpfKeyConsts.CREATEUSER: + insMap.put(swapDataVo.getVModel(), userEntity.getId()); + break; + case JnpfKeyConsts.CREATETIME: + insMap.put(swapDataVo.getVModel(), DateUtil.now()); + break; + case JnpfKeyConsts.MODIFYTIME: + break; + case JnpfKeyConsts.MODIFYUSER: + break; + case JnpfKeyConsts.CURRPOSITION: + insMap.put(swapDataVo.getVModel(), userEntity.getPositionId()); + break; + case JnpfKeyConsts.BILLRULE: + String billNo = ""; + try { + String rule = swapDataVo.getConfig().getRule(); + billNo = billRuleApi.getBillNumber(rule,false); + } catch (Exception e) { + log.error("导入excel:获取单据失败"); + } + insMap.put(swapDataVo.getVModel(), billNo); + break; + /** + * 基础控件 + */ + case JnpfKeyConsts.SWITCH: + String activeTxt = swapDataVo.getActiveTxt(); + String inactiveTxt = swapDataVo.getInactiveTxt(); + if (value.equals(activeTxt)) { + insMap.put(swapDataVo.getVModel(), 1); + } else if (value.equals(inactiveTxt)) { + insMap.put(swapDataVo.getVModel(), 0); + } else { + errInfo.add(label + "值不正确"); + } + break; + case JnpfKeyConsts.RATE: + BigDecimal ratevalue=new BigDecimal(value); + if (swapDataVo.getCount() != -1) { + BigDecimal maxvalue=new BigDecimal(swapDataVo.getCount()); + if(ratevalue.compareTo(maxvalue)==1){ + errInfo.add(label + "值不正确" ); + } + } + break; + case JnpfKeyConsts.SLIDER: + Integer Ivalue = Integer.valueOf(value); + boolean errorHapen = false; + if (swapDataVo.getMin() != null) { + errorHapen = Ivalue < swapDataVo.getMin(); + } + if (!errorHapen) { + if (swapDataVo.getMax() != null) { + errorHapen = Ivalue > swapDataVo.getMax(); + } + } + if (errorHapen) { + errInfo.add(label + "值不正确"); + } + break; + case JnpfKeyConsts.COM_INPUT: + try { + DbLinkEntity linkEntity = dataSourceApi.getInfo(uniqueModel.getDbLinkId()); + DynamicDataSourceUtil.switchToDataSource(linkEntity); + @Cleanup Connection connection = DynamicDataSourceUtil.getCurrentConnection(); + Boolean unique = swapDataVo.getConfig().getUnique(); + boolean comInputError = false; + if (unique) { + if(!uniqueModel.isMain()){ + //子表重复只判断同一个表单 + if(insMap.get("child_table_list")!=null){ + List> childList = (List>) insMap.get("child_table_list"); + if(childList.size()>1){ + String finalValue = value; + List> collect = childList.stream().filter(t -> finalValue.equals(t.get(swapDataVo.getVModel()))).collect(Collectors.toList()); + if(collect.size()>1){ + comInputError = true; + errInfo.add(label + "字段数据重复无法进行导入"); + } + } + } + } else { + String tableName = Optional.ofNullable(swapDataVo.getConfig().getRelationTable()).orElse(swapDataVo.getConfig().getTableName()); + //验证唯一 + SqlTable sqlTable = SqlTable.of(tableName); + String key = flowDataUtil.getKey(connection, tableName, uniqueModel.getPrimaryKeyPolicy()); + SelectStatementProvider render; + String vModelThis = swapDataVo.getVModel(); + + String foriegKey=""; + String columnName = "" ; + boolean isMain = uniqueModel.isMain(); + TableModel tableModel = uniqueModel.getTableModelList().stream().filter(t -> { + //子表判断 + if(StringUtil.isNotEmpty(swapDataVo.getConfig().getRelationTable())){ + return swapDataVo.getConfig().getRelationTable().equals(t.getTable()); + } + //主副表判断 + return swapDataVo.getConfig().getTableName().equals(t.getTable()); + }).findFirst().orElse(null); + if (tableModel != null) { + String fieldName = vModelThis; + if (vModelThis.contains("_jnpf_")) { + fieldName = vModelThis.split("_jnpf_")[1]; + isMain = false; + foriegKey = tableModel.getTableField(); + } + String finalFieldName = fieldName; + TableFields tableFields = tableModel.getFields().stream().filter(t -> t.getField().equals(finalFieldName)).findFirst().orElse(null); + if (tableFields != null) { + columnName = StringUtil.isNotEmpty(tableFields.getColumnName()) ? tableFields.getColumnName() : fieldName; + } + } + + List selectKey = new ArrayList<>(); + selectKey.add(sqlTable.column(columnName)); + selectKey.add(sqlTable.column(key)); + if (StringUtil.isNotEmpty(foriegKey)) { + String finalForiegKey = foriegKey; + TableFields tableFields = tableModel.getFields().stream().filter(t -> t.getField().equals(finalForiegKey)).findFirst().orElse(null); + if (tableFields != null) { + foriegKey = StringUtil.isNotEmpty(tableFields.getColumnName()) ? tableFields.getColumnName() : finalForiegKey; + } + selectKey.add(sqlTable.column(foriegKey)); + } + if (uniqueModel.getLogicalDelete()) { + //开启逻辑删除 + render = SqlBuilder.select(selectKey).from(sqlTable) + .where(sqlTable.column(columnName), SqlBuilder.isEqualTo(value)) + .and(sqlTable.column(TableFeildsEnum.DELETEMARK.getField()), SqlBuilder.isNull()) + .build().render(RenderingStrategies.MYBATIS3); + } else { + render = SqlBuilder.select(selectKey).from(sqlTable) + .where(sqlTable.column(columnName), SqlBuilder.isEqualTo(value)) + .build().render(RenderingStrategies.MYBATIS3); + } + List> mapList = flowFormDataMapper.selectManyMappedRows(render); + int count = mapList.size(); + if (count > 0) { + //是否开启支持导入数据更新 + if (uniqueModel.isUpdate()) { + //是否主表 + if (isMain) { + Map map = mapList.get(0); + uniqueModel.setId(map.get(key).toString()); + }else if(StringUtil.isNotEmpty(foriegKey)){ + Map map = mapList.get(0); + if(StringUtil.isEmpty(uniqueModel.getId())){ + uniqueModel.setId(map.get(foriegKey).toString()); + }else if(mapList.size()>0){ + //取到第一个有数据的唯一字段之后,其他唯一字段导入查询有值,不用来做更新,而拿来做判断。 + comInputError = true; + errInfo.add(label + "字段数据重复无法进行导入"); + } + } + } else { + comInputError = true; + errInfo.add(label + "字段数据重复无法进行导入"); + } + } + } + } + //验证正则 + if (StringUtil.isNotEmpty(swapDataVo.getConfig().getRegList())) { + List regList = JsonUtil.getJsonToList(swapDataVo.getConfig().getRegList(), RegListModel.class); + for (RegListModel regListModel : regList) { + //处理正则格式 + String reg = regListModel.getPattern(); + if (reg.startsWith("/") && reg.endsWith("/")) { + reg = reg.substring(1, reg.length() - 1); + } + boolean matches = value.matches(reg); + if (!matches) { + comInputError = true; + errInfo.add(label + regListModel.getMessage()); + } + } + } + if (!comInputError) { + insMap.put(swapDataVo.getVModel(), value); + } + }catch (Exception e){ + errInfo.add(label + "值不正确"); + }finally { + DynamicDataSourceUtil.clearSwitchDataSource(); + } + break; + case JnpfKeyConsts.TIME: + try { + int formatSize = 3; + if ("HH:mm".equals(swapDataVo.getFormat())) { + formatSize = 2; + } + String[] timeSplit = value.split(":"); + boolean timeHasError = false; + if (Integer.parseInt(timeSplit[0]) > 23 || timeSplit.length != formatSize) { + timeHasError = true; + } + if (Integer.parseInt(timeSplit[1]) > 59 || timeSplit.length != formatSize) { + timeHasError = true; + } + if (formatSize == 3) { + if (Integer.parseInt(timeSplit[2]) > 59 || timeSplit.length != formatSize) { + timeHasError = true; + } + } + boolean timeHasRangeError = false; + //判断时间是否在设置范围内 + String dataFomrat = "yyyy-MM-dd " + swapDataVo.getFormat(); + if (swapDataVo.getConfig().getStartTimeRule() && StringUtil.isNotEmpty(swapDataVo.getConfig().getStartTimeValue())) { + String startTimeValue = "2000-01-01 " + swapDataVo.getConfig().getStartTimeValue(); + String valueTime = "2000-01-01 " + value; + long startTimeLong = DateUtil.parse(startTimeValue, dataFomrat).getTime(); + long valueTimeLong = DateUtil.parse(valueTime, dataFomrat).getTime(); + if (valueTimeLong < startTimeLong) { + timeHasRangeError = true; + } + + } + if (swapDataVo.getConfig().getEndTimeRule() && StringUtil.isNotEmpty(swapDataVo.getConfig().getEndTimeValue())) { + String endTimeValue = "2000-01-01 " + swapDataVo.getConfig().getEndTimeValue(); + String valueTime = "2000-01-01 " + value; + long endTimeLong = DateUtil.parse(endTimeValue, dataFomrat).getTime(); + long valueTimeLong = DateUtil.parse(valueTime, dataFomrat).getTime(); + if (valueTimeLong > endTimeLong) { + timeHasRangeError = true; + } + } + if (timeHasError) { + throw new RuntimeException(); + } + if (timeHasRangeError) { + errInfo.add(label + "值不在范围内"); + break; + } + insMap.put(swapDataVo.getVModel(), value); + } catch (Exception e) { + errInfo.add(label + "值不正确"); + } + break; + case JnpfKeyConsts.DATE: + String format = swapDataVo.getFormat(); + if (StringUtil.isNotEmpty(format)) { + format = DateTimeFormatConstant.getFormat(format); + } + SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format); + try { + if (value.length() != format.length()) { + throw new RuntimeException(); + } + simpleDateFormat.parse(String.valueOf(value)); + //判断时间是否在设置范围内 + boolean timeHasRangeError = FormPublicUtils.dateTimeCondition(swapDataVo, format, value, insMap, jnpfKey); + if (timeHasRangeError) { + errInfo.add(label + "值不在范围内"); + break; + } + Date parse = simpleDateFormat.parse(String.valueOf(value)); + insMap.put(swapDataVo.getVModel(), parse != null ? parse.getTime() : null); + } catch (Exception e) { + errInfo.add(label + "值不正确"); + } + break; + /** + * 子表 + */ + case JnpfKeyConsts.CHILD_TABLE: + StringJoiner childJoiner = new StringJoiner(","); + List> childTable = new ArrayList<>(); + for (Map childMap : (List>) data.get(swapDataVo.getVModel())) { + Map childTableMap = new HashMap<>(childMap); + childTableMap.put("mainAndMast", data); + childTableMap.put("child_table_list", data.get(swapDataVo.getVModel())); + Map childerrorMap = new HashMap<>(childMap); + uniqueModel.setMain(false); + StringJoiner childJoiner1 = new StringJoiner(","); + boolean childHasError = this.checkExcelData(swapDataVo.getConfig().getChildren(), childMap, localCache, childTableMap, childJoiner1, childerrorMap, uniqueModel); + if (childHasError) { + childJoiner.add(childJoiner1.toString()); + } else { + childTable.add(childTableMap); + } + } + if (childJoiner.length() == 0) { + insMap.put(swapDataVo.getVModel(), childTable); + } else { + errInfo.add(childJoiner.toString()); + } + uniqueModel.setMain(true); + break; + default: + break; + + } + /** + * 数据接口 + */ + if (dataType != null) { + List> options = new ArrayList<>(); + String dataLabel = swapDataVo.getProps().getLabel() != null ? swapDataVo.getProps().getLabel() : ""; + String dataValue = swapDataVo.getProps().getValue() != null ? swapDataVo.getProps().getValue() : ""; + String children = swapDataVo.getProps().getChildren() != null ? swapDataVo.getProps().getChildren() : ""; + boolean isCascader = JnpfKeyConsts.CASCADER.equals(jnpfKey); + + String localCacheKey; + Map dataInterfaceMap = new HashMap<>(); + //静态数据 + if (dataType.equals(OnlineDataTypeEnum.STATIC.getType())) { + localCacheKey = String.format("%s-%s", swapDataVo.getConfig().getRelationTable()+swapDataVo.getVModel(), OnlineDataTypeEnum.STATIC.getType()); + if (!localCache.containsKey(localCacheKey)) { + if (swapDataVo.getOptions() != null) { + options = JsonUtil.getJsonToListMap(swapDataVo.getOptions()); + String Children = swapDataVo.getProps().getChildren(); + JSONArray staticData = JsonUtil.getListToJsonArray(options); + getOptions(dataLabel, dataValue, Children, staticData, options); + } else { + options = JsonUtil.getJsonToListMap(swapDataVo.getOptions()); + } + Map finalDataInterfaceMap = new HashMap<>(16); + String finalDataLabel = dataLabel; + String finalDataValue = dataValue; + options.stream().forEach(o -> { + finalDataInterfaceMap.put(String.valueOf(o.get(finalDataLabel)), o.get(finalDataValue)); + }); + localCache.put(localCacheKey, finalDataInterfaceMap); + dataInterfaceMap = finalDataInterfaceMap; + } else { + dataInterfaceMap = (Map) localCache.get(localCacheKey); + } + + checkFormDataInteface(multiple, insMap, swapDataVo.getVModel(), label, dataInterfaceMap, valueList, errInfo, isCascader); + //远端数据 + } else if (dataType.equals(OnlineDataTypeEnum.DYNAMIC.getType())) { + localCacheKey = String.format("%s-%s-%s-%s", OnlineDataTypeEnum.DYNAMIC.getType(), swapDataVo.getConfig().getPropsUrl(), dataValue, dataLabel); + if (!localCache.containsKey(localCacheKey)) { + ActionResult actionResult = dataInterFaceApi.infoToId(swapDataVo.getConfig().getPropsUrl(),null,null); + if (actionResult != null && actionResult.getData() != null) { + List> dycDataList = new ArrayList<>(); + if (actionResult.getData() instanceof List) { + dycDataList = (List>) actionResult.getData(); + } + JSONArray dataAll = JsonUtil.getListToJsonArray(dycDataList); + treeToList(dataLabel, dataValue, children, dataAll, options); + Map finalDataInterfaceMap1 = new HashMap<>(16); + String finalDataLabel2 = dataLabel; + String finalDataValue1 = dataValue; + options.stream().forEach(o -> { + finalDataInterfaceMap1.put(String.valueOf(o.get(finalDataLabel2)), String.valueOf(o.get(finalDataValue1))); + }); + dataInterfaceMap = finalDataInterfaceMap1; + localCache.put(localCacheKey, dataInterfaceMap); + } + } else { + dataInterfaceMap = (Map) localCache.get(localCacheKey); + } + checkFormDataInteface(multiple, insMap, swapDataVo.getVModel(), label, dataInterfaceMap, valueList, errInfo, isCascader); + //数据字典 + } else if (dataType.equals(OnlineDataTypeEnum.DICTIONARY.getType())) { + localCacheKey = String.format("%s-%s", OnlineDataTypeEnum.DICTIONARY.getType(), swapDataVo.getConfig().getDictionaryType()); + dataLabel = swapDataVo.getProps().getLabel(); + dataValue = swapDataVo.getProps().getValue(); + if (!localCache.containsKey(localCacheKey)) { + List list = dictionaryDataApi.getDicList(swapDataVo.getConfig().getDictionaryType()); + options = list.stream().map(dic -> { + Map dictionaryMap = new HashMap<>(16); + dictionaryMap.put("id", dic.getId()); + dictionaryMap.put("enCode", dic.getEnCode()); + dictionaryMap.put("fullName", dic.getFullName()); + return dictionaryMap; + }).collect(Collectors.toList()); + localCache.put(localCacheKey, options); + } else { + options = (List>) localCache.get(localCacheKey); + } + Map finalDataInterfaceMap1 = new HashMap<>(16); + String finalDataLabel3 = dataLabel; + String finalDataValue3 = dataValue; + options.stream().forEach(o -> finalDataInterfaceMap1.put(String.valueOf(o.get(finalDataLabel3)), o.get(finalDataValue3))); + + checkFormDataInteface(multiple, insMap, swapDataVo.getVModel(), label, finalDataInterfaceMap1, valueList, errInfo, isCascader); + } + } + } catch (Exception e) { + e.printStackTrace(); + errInfo.add(e.getMessage()); + } + } + }catch (Exception e) { + throw new RuntimeException(e); + } + if(StringUtil.isNotEmpty(uniqueModel.getId()) && uniqueModel.isMain()) { + List flowIdList = new ArrayList() {{ + add(uniqueModel.getId()); + }}; + List flowTaskList = flowTaskApi.getOrderStaList(flowIdList); + if (flowTaskList.size() > 0) { + boolean errorMsg = flowTaskList.stream().filter(t -> Objects.equals(t.getStatus(), 4) || Objects.equals(t.getStatus(), 0)).count() == 0; + String msg = "已发起流程,导入失败"; + boolean isFlowMsg = errInfo.toString().contains(msg); + if (errorMsg && !isFlowMsg) { + errInfo.add(msg); + } + } + } + if (errInfo.length() > 0) { + errorMap.put("errorsInfo", errInfo.toString()); + insMap = errorMap; + return true; + } else { + return false; + } + } + + private List checkOptionsControl(boolean multiple, Map insMap, String vModel, String label, Map cacheMap, List valueList, StringJoiner errInfo) { + boolean error = false; + if (!multiple) { + //非多选填入多选值 + if (valueList.size() > 1) { + error = true; + errInfo.add(label + "非多选"); + } + } + List dataList = new ArrayList<>(); + if (!error) { + boolean errorHapen = false; + for (String va : valueList) { + Object vo = cacheMap.get(va); + if (vo == null) { + errorHapen = true; + } else { + dataList.add(vo.toString()); + } + + } + if (errorHapen) { + errInfo.add(label + "值不正确"); + } else { + insMap.put(vModel, !multiple ? dataList.get(0) : JsonUtil.getObjectToString(dataList)); + } + } + return dataList; + } + + public void checkCustomControl(OnlineCusCheckModel cusCheckModel, StringJoiner errInfo, String label) { + boolean contains; + List ableIdsAll = new ArrayList<>(); + List ableDepIds = cusCheckModel.getAbleDepIds(); + List ableGroupIds = cusCheckModel.getAbleGroupIds(); + List ablePosIds = cusCheckModel.getAblePosIds(); + List ableRoleIds = cusCheckModel.getAbleRoleIds(); + List ableUserIds = cusCheckModel.getAbleUserIds(); + List ableComIds = cusCheckModel.getAbleComIds(); + List dataList = cusCheckModel.getDataList(); + String controlType = cusCheckModel.getControlType(); + switch (controlType) { + case JnpfKeyConsts.GROUPSELECT: + ableIdsAll.addAll(ableGroupIds); + break; + case JnpfKeyConsts.ROLESELECT: + ableIdsAll.addAll(ableRoleIds); + break; + case JnpfKeyConsts.DEPSELECT: + ableIdsAll.addAll(ableDepIds); + break; + case JnpfKeyConsts.COMSELECT: + ableIdsAll.addAll(ableComIds); + break; + case JnpfKeyConsts.CUSTOMUSERSELECT: + for(String id : ableDepIds){ + ableIdsAll.add(id+"--department"); + } + for(String id : ableGroupIds){ + ableIdsAll.add(id+"--group"); + } + for(String id : ablePosIds){ + ableIdsAll.add(id+"--position"); + } + for(String id : ableRoleIds){ + ableIdsAll.add(id+"--role"); + } + for(String id : ableUserIds){ + ableIdsAll.add(id+"--user"); + } + for(String id : ableComIds){ + ableIdsAll.add(id+"--company"); + } + ableIdsAll.addAll(ableDepIds); + ableIdsAll.addAll(ableGroupIds); + ableIdsAll.addAll(ablePosIds); + ableIdsAll.addAll(ableRoleIds); + ableIdsAll.addAll(ableUserIds); + ableIdsAll.addAll(ableComIds); + break; + case JnpfKeyConsts.USERSELECT: + List objIds = new ArrayList<>(); + if (ableDepIds.size() > 0) { + objIds.addAll(ableDepIds); + } + if (ableGroupIds.size() > 0) { + objIds.addAll(ableGroupIds); + } + if (ablePosIds.size() > 0) { + objIds.addAll(ablePosIds); + } + if (ableRoleIds.size() > 0) { + objIds.addAll(ableRoleIds); + } + List UserIds = userRelationApi.getListByObjectIdAll(objIds).stream().map(UserRelationEntity::getUserId).collect(Collectors.toList()); + UserIds.addAll(ableUserIds); + ableIdsAll.addAll(UserIds); + break; + case JnpfKeyConsts.POSSELECT: + List posIds = new ArrayList<>(); + if (ableDepIds.size() > 0) { + List depIds = positionApi.getListByOrganizeId(ableDepIds).stream().map(PositionEntity::getId).collect(Collectors.toList()); + posIds.addAll(depIds); + } + if (ablePosIds.size() > 0) { + posIds.addAll(ablePosIds); + } + ableIdsAll.addAll(posIds); + break; + default: + break; + } + if (ableIdsAll.size() > 0) { + for (String id : dataList) { + contains = ableIdsAll.contains(id); + if (!contains) { + errInfo.add(label + "不在范围内"); + break; + } + } + } + } + + public void checkFormDataInteface(boolean multiple, Map insMap, String vModel, String label, + Map cacheMap, List valueList, StringJoiner errInfo, boolean isCascader) { + List staticStrData = new ArrayList<>(); + List staticStrDataList1 = new ArrayList<>(); + + boolean hasError = false; + boolean takeOne = false; + for (String dicValue : valueList) { + if (isCascader) { + List staticStrDataList2 = new ArrayList<>(); + if(!multiple && valueList.size()>1) hasError = true; + if (dicValue.contains("/")) { + String[] split = dicValue.split("/"); + for (String s : split) { + Object s1 = cacheMap.get(s); + if (s1 != null) { + staticStrDataList2.add(s1.toString()); + staticStrDataList1.add(s1.toString()); + } else { + hasError = true; + } + } + staticStrData.add(staticStrDataList2.toArray(new String[staticStrDataList2.size()])); + } else { + if (cacheMap.get(dicValue) == null) { + hasError = true; + } else { + staticStrDataList1.add(cacheMap.get(dicValue).toString()); + } + } + } else { + takeOne = true; + Object s1 = cacheMap.get(dicValue); + if (s1 != null) { + staticStrDataList1.add(s1.toString()); + } else { + hasError = true; + } + } + } + + if (hasError) { + errInfo.add(label + "值不正确"); + } else { + String v = multiple ? takeOne ? JsonUtil.getObjectToString(staticStrDataList1) : JsonUtil.getObjectToString(staticStrData) + : takeOne ? staticStrDataList1.get(0) : JsonUtil.getObjectToString(staticStrDataList1); + insMap.put(vModel, v); + } + } + + /** + * 获取接口api数据结果 + * + * @param + * @return + * @copyright 引迈信息技术有限公司 + * @date 2023/1/10 + */ + public List> getInterfaceData(VisualdevReleaseEntity visualdevEntity, PaginationModel paginationModel, ColumnDataModel columnDataModel) { + List> realList = new ArrayList<>(); + try { + Map parameterMap = new HashMap<>(); + if (StringUtil.isNotEmpty(visualdevEntity.getInterfaceParam())) { + List jsonToList = JsonUtil.getJsonToList(visualdevEntity.getInterfaceParam(), Map.class); + for (Map map : jsonToList) { + if (!map.isEmpty()) { + Map mapStr = (Map) map; + parameterMap.put(mapStr.get("field"), mapStr.get("defaultValue")); + } + } + } + + List searchVOList = JsonUtil.getJsonToList(columnDataModel.getSearchList(), VisualColumnSearchVO.class); + DataInterfaceEntity info = dataInterFaceApi.getInfo(visualdevEntity.getInterfaceId()); + //封装sql---sql普通查询塞参数到数据接口那边去组装sql + if(Objects.equals(info.getType(),1) && StringUtil.isNotEmpty(paginationModel.getQueryJson())){ + Map keyJsonMap = JsonUtil.stringToMap(paginationModel.getQueryJson()); + String searchSqlStr=""; + for(VisualColumnSearchVO item :searchVOList){ + if(keyJsonMap.get(item.getVModel())!=null && StringUtil.isNotEmpty(keyJsonMap.get(item.getVModel()).toString())){ + if ("1".equals(item.getSearchType())) { + searchSqlStr= "t."+item.getVModel() +" = '"+ XSSEscape.escape(keyJsonMap.get(item.getVModel()).toString())+"'"; + }else if("2".equals(item.getSearchType()) || "3".equals(item.getSearchType())){ + searchSqlStr= "t."+item.getVModel() +" like '%"+ XSSEscape.escape(keyJsonMap.get(item.getVModel()).toString())+"%'"; + } + } + } + parameterMap.put("searchSqlStr",searchSqlStr); + } + //封装sql结束--- + + ActionResult dataInterfaceInfo = dataInterFaceApi.infoToId(visualdevEntity.getInterfaceId(),null, parameterMap); + if (dataInterfaceInfo.getCode() == 200) { + List> dataInterfaceList = new ArrayList<>(); + List> dataRes = (List>) dataInterfaceInfo.getData(); + //假查询条件-不为sql时查询在此过滤 + if (!Objects.equals(info.getType(),1) && StringUtil.isNotEmpty(paginationModel.getQueryJson()) && CollectionUtils.isNotEmpty(dataRes)) { + Map conditionConfig = new HashMap<>(); + for (VisualColumnSearchVO item : searchVOList) { + if ("1".equals(item.getSearchType())) { + conditionConfig.put(item.getVModel(), true); + } else { + conditionConfig.put(item.getVModel(), false); + } + } + Map keyJsonMap = JsonUtil.stringToMap(paginationModel.getQueryJson()); + for (Map map : dataRes) { + if (OnlinePublicUtils.mapCompar(keyJsonMap, map, conditionConfig)) { + dataInterfaceList.add(map); + } + } + } else { + dataInterfaceList = dataRes; + } + //判断是否有id没有则随机 + dataInterfaceList.forEach(item -> { + if (item.get("id") == null) { + item.put("id", RandomUtil.uuId()); + } + if (item.get("f_id") != null) { + item.put("id", item.get("f_id")); + } + if (item.get("children") != null) { + item.remove("children"); + } + }); + + //排序 + String sort = StringUtil.isNotEmpty(paginationModel.getSort()) ? paginationModel.getSort() : + StringUtil.isNotEmpty(columnDataModel.getSort()) ? columnDataModel.getSort() : ""; + String feild = StringUtil.isNotEmpty(paginationModel.getSidx()) ? paginationModel.getSidx() : + StringUtil.isNotEmpty(columnDataModel.getDefaultSidx()) ? columnDataModel.getDefaultSidx() : ""; + if ("desc".equalsIgnoreCase(sort)) { + Collections.sort(dataInterfaceList, (m1, m2) -> String.valueOf(m2.get(feild)).compareTo(String.valueOf(m1.get(feild)))); + } else { + Collections.sort(dataInterfaceList, (m1, m2) -> String.valueOf(m1.get(feild)).compareTo(String.valueOf(m2.get(feild)))); + } + if ("1".equals(paginationModel.getDataType())) {//导出全部数据用 + return dataInterfaceList; + } + //假分页 + if (columnDataModel.getHasPage() && CollectionUtils.isNotEmpty(dataInterfaceList)) { + List>> partition = Lists.partition(dataInterfaceList, (int) paginationModel.getPageSize()); + realList = partition.get((int) paginationModel.getCurrentPage() - 1); + paginationModel.setTotal(dataInterfaceList.size()); + } + } + } catch (Exception e) { + e.printStackTrace(); + log.error("数据视图,接口请求失败!message={}" , e.getMessage()); + } +// dataId(realList); + return realList; + } + + private void dataId(List> data){ + for(Map item : data){ + if (item.get("id") == null) { + item.put("id", RandomUtil.uuId()); + } + if(item.get("children") !=null){ + List> children = new ArrayList<>(); + try { + children.addAll(JsonUtil.getJsonToListMap(String.valueOf(item.get("children")))); + }catch (Exception e){ + + } + if(children.size()>0){ + dataId(children); + item.put("children",children); + } + } + } + } + + public static List convertToList(Object obj) { + if (obj instanceof List) { + List arrayList = (List) obj; + return arrayList; + } else { + List arrayList = new ArrayList(); + arrayList.add(obj); + return arrayList; + } + } + + public static String convertValueToString(String obj, boolean mult, boolean isOrg) { + if (StringUtil.isNotEmpty(obj)) { + String prefix = "["; + if (isOrg) { + prefix = "[["; + } + if (mult) { + if (!obj.startsWith(prefix)) { + JSONArray arr = new JSONArray(); + if (isOrg) { + //组织多选为二维数组 + arr.add(JSONArray.parse(obj)); + } else { + arr.add(obj); + } + return arr.toJSONString(); + } + } else { + if (obj.startsWith(prefix)) { + JSONArray objects = JSONArray.parseArray(obj); + return objects.size() > 0 ? objects.get(0).toString() : ""; + } + } + } + return obj; + } + + /** + * 获取组织数据中的最后一级组织ID + * 单选数据获取数组中最后一个组织本身的ID + * 多选数据获取最后一组组织数据中的最后一个组织本身的ID + * + * @param data + * @return + */ + public static String getLastOrganizeId(Object data) { + if (data instanceof List) { + List listData = (List) data; + data = listData.get(listData.size() - 1); + return getLastOrganizeId(data); + } else if (data instanceof String) { + String strData = (String) data; + if (strData.startsWith(StrPool.BRACKET_START)) { + JSONArray jsonArray = JSONArray.parseArray(strData); + return getLastOrganizeId(jsonArray); + } else { + return strData; + } + } + return data.toString(); + } + + /** + * 输入时表单时间字段根据格式转换去尾巴 + * + * @param list 字段属性 + * @param map 数据 + */ + public static void swapDatetime(List list, Map map) { + List fields = new ArrayList<>(); + FormPublicUtils.recursionFieldsExceptChild(fields, list); + //主副表 + for (FieLdsModel field : fields) { + try { + String vModel = field.getVModel(); + String format = DateTimeFormatConstant.getFormat(field.getFormat()); + ConfigModel config = field.getConfig(); + if (map.get(vModel) != null) { + String s = map.get(vModel).toString(); + if (StringUtil.isBlank(s) || "[]".equals(s) || "[[]]".equals(s)) { + map.replace(vModel, null); + } + } + if (JnpfKeyConsts.DATE.equals(config.getJnpfKey()) && map.get(vModel) != null) { + Date date = new Date(Long.parseLong(String.valueOf(map.get(vModel)))); + String completionStr = ""; + switch (format) { + case "yyyy": + completionStr = "-01-01 00:00:00"; + break; + case "yyyy-MM": + completionStr = "-01 00:00:00"; + break; + case "yyyy-MM-dd": + completionStr = " 00:00:00"; + break; + case "yyyy-MM-dd HH": + completionStr = ":00:00"; + break; + case "yyyy-MM-dd HH:mm": + completionStr = ":00"; + break; + default: + break; + } + String datestr = jnpf.util.DateUtil.dateToString(date, format); + long time = jnpf.util.DateUtil.stringToDate(datestr + completionStr).getTime(); + map.replace(vModel, time); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + //子表 + for (FieLdsModel field : fields) { + if (field.getVModel().toLowerCase().startsWith(JnpfKeyConsts.CHILD_TABLE_PREFIX)) { + List children = field.getConfig().getChildren(); + if (CollectionUtils.isNotEmpty(children)) { + String tableKey=field.getConfig().getTableName()+"List"; + if(map.get(tableKey)!=null){ + List listObj = (List) map.get(tableKey); + if (CollectionUtils.isEmpty(listObj)) continue; + List listObjNew = new ArrayList<>(); + for (Object o : listObj) { + Map stringObjectMap = JsonUtil.entityToMap(o); + swapDatetime(children, stringObjectMap); + listObjNew.add(stringObjectMap); + } + if (CollectionUtils.isNotEmpty(listObjNew)) { + map.replace(tableKey, listObjNew); + } + } + String tableFieldKey=field.getVModel(); + if(map.get(tableFieldKey)!=null){ + List listObj = (List) map.get(tableFieldKey); + if (CollectionUtils.isEmpty(listObj)) continue; + List listObjNew = new ArrayList<>(); + for (Object o : listObj) { + Map stringObjectMap = JsonUtil.entityToMap(o); + swapDatetime(children, stringObjectMap); + listObjNew.add(stringObjectMap); + } + if (CollectionUtils.isNotEmpty(listObjNew)) { + map.replace(tableFieldKey, listObjNew); + } + } + } + } + + } + } + + /** + * 判断组织层级是否正确 + * @param comTwoList + * @param comOneList + * @return + */ + private boolean orgListRight(List> comTwoList, List comOneList) { + if(CollectionUtils.isNotEmpty(comOneList)){ + String one = comOneList.get(comOneList.size() - 1); + List realOrgs=new ArrayList<>(); + OrganizeEntity organizeEntity =organizeApi.getInfo(one); + if (organizeEntity != null) { + if (StringUtil.isNotEmpty(organizeEntity.getOrganizeIdTree())) { + String[] split = organizeEntity.getOrganizeIdTree().split(","); + if(split.length > 0){ + realOrgs=Arrays.asList(split); + } + if(!JsonUtil.getObjectToString(comOneList).equals(JsonUtil.getObjectToString(realOrgs))){ + return true; + } + } + } + } + if(CollectionUtils.isNotEmpty(comTwoList)){ + for(List two: comTwoList){ + String one = two.get(two.size() - 1); + List realOrgs=new ArrayList<>(); + OrganizeEntity organizeEntity =organizeApi.getInfo(one); + if (organizeEntity != null) { + if (StringUtil.isNotEmpty(organizeEntity.getOrganizeIdTree())) { + String[] split = organizeEntity.getOrganizeIdTree().split(","); + if(split.length > 0){ + realOrgs=Arrays.asList(split); + } + if(!JsonUtil.getObjectToString(comOneList).equals(JsonUtil.getObjectToString(realOrgs))){ + return true; + } + } + } + } + } + return false; + } +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/util/onlineDevUtil/RelationFormUtils.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/util/onlineDevUtil/RelationFormUtils.java new file mode 100644 index 0000000..8a906c9 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-biz/src/main/java/jnpf/onlinedev/util/onlineDevUtil/RelationFormUtils.java @@ -0,0 +1,41 @@ +package jnpf.onlinedev.util.onlineDevUtil; + +import jnpf.onlinedev.model.OnlineDevListModel.VisualColumnSearchVO; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * + * 关联表单工具类 + * @author JNPF开发平台组 + * @version V3.2.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2022/1/7 + */ +public class RelationFormUtils { + + /** + * 转后后查询 + * @param dataVOList + * @param searchVOList + * @return + */ + public static List> getRelationListByKeyword(List> dataVOList, List searchVOList){ + List> passDataList = new ArrayList<>(); + for (Map dataMap : dataVOList){ + int i =0; + for (VisualColumnSearchVO searchVO : searchVOList){ + String s = String.valueOf(dataMap.get(searchVO.getVModel())); + if (s.contains(String.valueOf(searchVO.getValue()))){ + i++; + } + } + if (i>0){ + passDataList.add(dataMap); + } + } + return passDataList; + } +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-controller/pom.xml b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-controller/pom.xml new file mode 100644 index 0000000..1dedda7 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-controller/pom.xml @@ -0,0 +1,28 @@ + + + + jnpf-visualdev-onlinedev + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-visualdev-onlinedev-controller + + + + com.jnpf + jnpf-visualdev-onlinedev-biz + ${project.version} + + + com.jnpf + jnpf-visualdev-integrate-biz + 3.5.0-RELEASE + compile + + + + diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-controller/src/main/java/jnpf/onlinedev/controller/VisualdevModelAppController.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-controller/src/main/java/jnpf/onlinedev/controller/VisualdevModelAppController.java new file mode 100644 index 0000000..add190e --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-controller/src/main/java/jnpf/onlinedev/controller/VisualdevModelAppController.java @@ -0,0 +1,80 @@ +package jnpf.onlinedev.controller; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.vo.DownloadVO; +import jnpf.base.service.VisualdevService; +import jnpf.base.entity.VisualdevEntity; +import jnpf.config.ConfigValueUtil; +import jnpf.constant.MsgCode; +import jnpf.emnus.ExportModelTypeEnum; +import jnpf.exception.WorkFlowException; +import jnpf.onlinedev.model.*; +import jnpf.util.*; +import jnpf.emnus.ModuleTypeEnum; +import jnpf.util.FileExport; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +/** + * 0代码app无表开发 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Tag(name = "0代码app无表开发", description = "ModelAppData") +@RestController +@RequestMapping("/api/visualdev/OnlineDev/App") +public class VisualdevModelAppController { + + @Autowired + private VisualdevService visualdevService; + @Autowired + private FileExport fileExport; + @Autowired + private ConfigValueUtil configValueUtil; + + + + @Operation(summary = "功能导出") + @PostMapping("/{modelId}/Actions/ExportData") + public ActionResult exportData(@PathVariable("modelId") String modelId){ + VisualdevEntity visualdevEntity = visualdevService.getInfo(modelId); + BaseDevModelVO vo = JsonUtil.getJsonToBean(visualdevEntity,BaseDevModelVO.class); + vo.setModelType(ExportModelTypeEnum.App.getMessage()); + DownloadVO downloadVO=fileExport.exportFile(vo,configValueUtil.getTemporaryFilePath(), visualdevEntity.getFullName(), ModuleTypeEnum.VISUAL_APP.getTableName()); + return ActionResult.success(downloadVO); + } + + @Operation(summary = "功能导入") + @PostMapping(value = "/Model/Actions/ImportData", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public ActionResult ImportData(@RequestPart("file") MultipartFile multipartFile) throws WorkFlowException { + //判断是否为.json结尾 + if (FileUtil.existsSuffix(multipartFile, ModuleTypeEnum.VISUAL_APP.getTableName())) { + return ActionResult.fail(MsgCode.IMP002.get()); + } + //获取文件内容 + String fileContent = FileUtil.getFileContent(multipartFile); + BaseDevModelVO vo = JsonUtil.getJsonToBean(fileContent, BaseDevModelVO.class); + if (vo.getModelType() == null || !vo.getModelType().equals(ExportModelTypeEnum.App.getMessage())) { + return ActionResult.fail("请导入对应功能的json文件"); + } + VisualdevEntity visualdevEntity = JsonUtil.getJsonToBean(vo, VisualdevEntity.class); + String modelId = visualdevEntity.getId(); + if (StringUtil.isNotEmpty(modelId)) { + VisualdevEntity entity = visualdevService.getInfo(modelId); + if (entity != null) { + return ActionResult.fail("已存在相同功能"); + } + } + visualdevEntity.setCreatorTime(DateUtil.getNowDate()); + visualdevEntity.setLastModifyTime(null); + visualdevService.create(visualdevEntity); + return ActionResult.success(MsgCode.IMP001.get()); + } +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-controller/src/main/java/jnpf/onlinedev/controller/VisualdevModelDataController.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-controller/src/main/java/jnpf/onlinedev/controller/VisualdevModelDataController.java new file mode 100644 index 0000000..41e9d0f --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-controller/src/main/java/jnpf/onlinedev/controller/VisualdevModelDataController.java @@ -0,0 +1,1063 @@ +package jnpf.onlinedev.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.stp.StpUtil; +import cn.xuyanwu.spring.file.storage.FileInfo; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import jnpf.base.ActionResult; +import jnpf.base.UserInfo; +import jnpf.base.controller.SuperController; +import jnpf.base.entity.VisualdevEntity; +import jnpf.base.entity.VisualdevReleaseEntity; +import jnpf.base.model.ColumnDataModel; +import jnpf.base.model.VisualDevJsonModel; +import jnpf.base.model.VisualWebTypeEnum; +import jnpf.base.service.VisualdevReleaseService; +import jnpf.base.service.VisualdevService; +import jnpf.base.util.VisualUtil; +import jnpf.base.util.VisualUtils; +import jnpf.base.vo.DownloadVO; +import jnpf.base.vo.PaginationVO; +import jnpf.config.ConfigValueUtil; +import jnpf.constant.MsgCode; +import jnpf.constant.PermissionConst; +import jnpf.emnus.ExportModelTypeEnum; +import jnpf.emnus.ModuleTypeEnum; +import jnpf.engine.entity.FlowTaskEntity; +import jnpf.engine.model.flowtemplate.FlowTemplateInfoVO; +import jnpf.engine.service.FlowTaskService; +import jnpf.engine.service.FlowTemplateService; +import jnpf.entity.FlowFormEntity; +import jnpf.exception.DataException; +import jnpf.exception.WorkFlowException; +import jnpf.integrate.util.IntegrateUtil; +import jnpf.model.flow.DataModel; +import jnpf.model.visualJson.FieLdsModel; +import jnpf.model.visualJson.FormDataModel; +import jnpf.model.visualJson.UploaderTemplateModel; +import jnpf.model.visualJson.config.HeaderModel; +import jnpf.onlinedev.entity.VisualdevModelDataEntity; +import jnpf.onlinedev.model.*; +import jnpf.onlinedev.model.OnlineImport.ExcelImportModel; +import jnpf.onlinedev.model.OnlineImport.ImportExcelFieldModel; +import jnpf.onlinedev.model.OnlineImport.VisualImportModel; +import jnpf.onlinedev.service.VisualDevInfoService; +import jnpf.onlinedev.service.VisualDevListService; +import jnpf.onlinedev.service.VisualdevModelDataService; +import jnpf.onlinedev.util.AutoFeildsUtil; +import jnpf.onlinedev.util.onlineDevUtil.OnlineDevListUtils; +import jnpf.onlinedev.util.onlineDevUtil.OnlinePublicUtils; +import jnpf.onlinedev.util.onlineDevUtil.OnlineSwapDataUtils; +import jnpf.permission.entity.UserRelationEntity; +import jnpf.permission.service.UserRelationService; +import jnpf.service.FlowFormService; +import jnpf.util.*; +import jnpf.util.context.RequestContext; +import jnpf.util.visiual.JnpfKeyConsts; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.io.File; +import java.io.IOException; +import java.sql.SQLException; +import java.text.ParseException; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 0代码无表开发 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Slf4j +@Tag(name = "0代码无表开发", description = "OnlineDev") +@RestController +@RequestMapping("/api/visualdev/OnlineDev") +public class VisualdevModelDataController extends SuperController { + + @Autowired + private VisualdevModelDataService visualdevModelDataService; + @Autowired + private VisualdevService visualdevService; + @Autowired + private UserProvider userProvider; + @Autowired + private FileExport fileExport; + @Autowired + private FlowTaskService flowTaskService; + @Autowired + private FlowTemplateService flowTemplateService; + @Autowired + private VisualDevListService visualDevListService; + @Autowired + private FlowFormService flowFormApi; + @Autowired + private VisualDevInfoService visualDevInfoService; + @Autowired + private VisualdevReleaseService visualdevReleaseService; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private OnlineSwapDataUtils onlineSwapDataUtils; + @Autowired + private UserRelationService userRelationService; + @Autowired + private IntegrateUtil integrateUtil; + + @Operation(summary = "获取数据列表") + @Parameters({ + @Parameter(name = "modelId", description = "模板id"), + }) + @PostMapping("/{modelId}/List") + public ActionResult list(@PathVariable("modelId") String modelId, @RequestBody PaginationModel paginationModel) throws WorkFlowException { + StpUtil.checkPermission(modelId); + + VisualdevReleaseEntity visualdevEntity = visualdevReleaseService.getById(modelId); + VisualDevJsonModel visualJsonModel = OnlinePublicUtils.getVisualJsonModel(visualdevEntity); + + //判断请求客户端来源 + if (!RequestContext.isOrignPc()) { + visualJsonModel.setColumnData(visualJsonModel.getAppColumnData()); + } + ColumnDataModel columnDataModel = visualJsonModel.getColumnData(); + List> realList; + if (VisualWebTypeEnum.FORM.getType().equals(visualdevEntity.getWebType())) { + realList = new ArrayList<>(); + } else if (VisualWebTypeEnum.DATA_VIEW.getType().equals(visualdevEntity.getWebType())) {// + //数据视图的接口数据获取、 + realList = onlineSwapDataUtils.getInterfaceData(visualdevEntity, paginationModel, columnDataModel); + } else { + realList = visualDevListService.getDataList(visualJsonModel, paginationModel); + } + + //判断数据是否分组 + if (OnlineDevData.TYPE_THREE_COLUMNDATA.equals(columnDataModel.getType())) { + realList = OnlineDevListUtils.groupData(realList, columnDataModel); + } + //树形列表 + if (OnlineDevData.TYPE_FIVE_COLUMNDATA.equals(columnDataModel.getType())) { + realList = OnlineDevListUtils.treeListData(realList, columnDataModel); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(paginationModel, PaginationVO.class); + + return ActionResult.page(realList, paginationVO); + } + + + @Operation(summary = "树形异步查询子列表接口") + @Parameters({ + @Parameter(name = "modelId", description = "模板id"), + @Parameter(name = "id", description = "数据id"), + }) + @PostMapping("/{modelId}/List/{id}") + public ActionResult listTree(@PathVariable("modelId") String modelId, @RequestBody PaginationModel paginationModel, @PathVariable("id") String id) throws WorkFlowException { + StpUtil.checkPermission(modelId); + + VisualdevReleaseEntity visualdevEntity = visualdevReleaseService.getById(modelId); + VisualDevJsonModel visualJsonModel = OnlinePublicUtils.getVisualJsonModel(visualdevEntity); + //判断请求客户端来源 + if (!RequestContext.isOrignPc()) { + visualJsonModel.setColumnData(visualJsonModel.getAppColumnData()); + } + + List> realList = visualDevListService.getDataList(visualJsonModel, paginationModel); + ColumnDataModel columnDataModel = visualJsonModel.getColumnData(); + String parentField = columnDataModel.getParentField() + "_id"; + + List> collect = realList.stream().filter(item -> id.equals(item.get(parentField))).collect(Collectors.toList()); + PaginationVO paginationVO = JsonUtil.getJsonToBean(paginationModel, PaginationVO.class); + return ActionResult.page(collect, paginationVO); + } + + @Operation(summary = "获取列表表单配置JSON") + @Parameters({ + @Parameter(name = "modelId", description = "模板id"), + @Parameter(name = "type", description = "类型0-草稿,1-发布"), + }) + @GetMapping("/{modelId}/Config") + public ActionResult getData(@PathVariable("modelId") String modelId, @RequestParam(value = "type", required = false) String type) throws WorkFlowException { + StpUtil.checkPermissionOr(modelId, "onlineDev.webDesign", "generator.webForm", "generator.flowForm"); + + VisualdevEntity entity; + //线上版本 + if ("0".equals(type)) { + entity = visualdevService.getInfo(modelId); + } else { + VisualdevReleaseEntity releaseEntity = visualdevReleaseService.getById(modelId); + entity = JsonUtil.getJsonToBean(releaseEntity, VisualdevEntity.class); + } + if (entity == null) { + return ActionResult.fail("该表单已删除"); + } + if (!VisualWebTypeEnum.DATA_VIEW.getType().equals(entity.getWebType())) { + String s = VisualUtil.checkPublishVisualModel(entity, "预览"); + if (s != null) { + return ActionResult.fail(s); + } + } + + DataInfoVO vo = JsonUtil.getJsonToBean(entity, DataInfoVO.class); + if (entity.getEnableFlow() == 1) { + FlowFormEntity byId = flowFormApi.getById(entity.getId()); + FlowTemplateInfoVO templateInfo = flowTemplateService.info(byId.getFlowId()); + if (templateInfo == null) { + return ActionResult.fail(MsgCode.VS403.get()); + } + if (OnlineDevData.STATE_DISABLE == templateInfo.getEnabledMark()) { + return ActionResult.fail(MsgCode.VS406.get()); + } + vo.setFlowId(templateInfo.getId()); + } + + //处理默认值 + Map havaDefaultCurrentValue = new HashMap(); + UserInfo userInfo = userProvider.get(); + if (StringUtil.isNotEmpty(vo.getFormData())) { + vo.setFormData(setDefaultCurrentValue(vo.getFormData(), havaDefaultCurrentValue, userInfo)); + } + if (StringUtil.isNotEmpty(vo.getColumnData())) { + vo.setColumnData(setDefaultCurrentValue(vo.getColumnData(), havaDefaultCurrentValue, userInfo)); + } + if (StringUtil.isNotEmpty(vo.getAppColumnData())) { + vo.setAppColumnData(setDefaultCurrentValue(vo.getAppColumnData(), havaDefaultCurrentValue, userInfo)); + } + return ActionResult.success(vo); + } + + //递归处理默认当前配置 + private String setDefaultCurrentValue(String configJson, Map havaDefaultCurrentValue, UserInfo userInfo) { + if (StringUtil.isEmpty(configJson)) { + return configJson; + } + Map configJsonMap = JsonUtil.stringToMap(configJson.trim()); + if (configJsonMap == null && configJsonMap.isEmpty()) { + return configJson; + } + int isChange = 0; + List userId = new ArrayList() {{ + add(userInfo.getUserId()); + }}; + List userRelationList = userRelationService.getListByUserIdAll(userId); + + //处理字段 + Object fieldsObj = configJsonMap.get("fields"); + List> fieldsList = null; + if (fieldsObj != null) { + fieldsList = (List>) fieldsObj; + if (fieldsList != null && !fieldsList.isEmpty()) { + setDefaultCurrentValue(userRelationList, fieldsList, userInfo, "add"); + configJsonMap.put("fields", fieldsList); + isChange = 1; + } + } + //处理查询条件 + Object searchObj = configJsonMap.get("searchList"); + List> searchList = null; + if (searchObj != null) { + searchList = (List>) searchObj; + if (searchList != null && !searchList.isEmpty()) { + setDefaultCurrentValue(userRelationList, searchList, userInfo, "search"); + configJsonMap.put("searchList", searchList); + isChange = 1; + } + } + + //处理查询条件 + Object columnListObj = configJsonMap.get("columnList"); + List> columnList = null; + if (columnListObj != null) { + columnList = (List>) columnListObj; + if (columnList != null && !columnList.isEmpty()) { + setDefaultCurrentValue(userRelationList, columnList, userInfo, "add"); + configJsonMap.put("columnList", columnList); + isChange = 1; + } + } + + if (isChange == 1) { + return JsonUtil.getObjectToString(configJsonMap); + } else { + return configJson; + } + } + + private void setDefaultCurrentValue(List userRelationList, List> itemList, UserInfo userInfo, String parseFlag) { + for (int i = 0, len = itemList.size(); i < len; i++) { + Map itemMap = itemList.get(i); + if (itemMap == null || itemMap.isEmpty()) { + continue; + } + Map configMap = (Map) itemMap.get("__config__"); + if (configMap == null || configMap.isEmpty()) { + continue; + } + List> childrenList = (List>) configMap.get("children"); + if (childrenList != null && !childrenList.isEmpty()) { + setDefaultCurrentValue(userRelationList, childrenList, userInfo, parseFlag); + configMap = (Map) itemMap.get("__config__"); + } + String jnpfKey = (String) configMap.get("jnpfKey"); + String defaultCurrent = String.valueOf(configMap.get("defaultCurrent")); + if ("true".equals(defaultCurrent)) { + Map> relationMap = userRelationList.stream().collect(Collectors.groupingBy(UserRelationEntity::getObjectType)); + Object data = ""; + switch (jnpfKey) { + case JnpfKeyConsts.COMSELECT: + data = new ArrayList() {{ + add(userInfo.getOrganizeId()); + }}; + break; + case JnpfKeyConsts.DEPSELECT: + data = userInfo.getDepartmentId(); + break; + case JnpfKeyConsts.POSSELECT: + data = userInfo.getPositionIds().length > 0 ? userInfo.getPositionIds()[0] : ""; + break; + case JnpfKeyConsts.USERSELECT: + case JnpfKeyConsts.CUSTOMUSERSELECT: + data = JnpfKeyConsts.CUSTOMUSERSELECT.equals(jnpfKey) ? userInfo.getUserId() + "--" + PermissionConst.USER : userInfo.getUserId(); + break; + case JnpfKeyConsts.ROLESELECT: + List roleList = relationMap.get(PermissionConst.ROLE) != null ? relationMap.get(PermissionConst.ROLE) : new ArrayList<>(); + data = roleList.size() > 0 ? roleList.get(0).getObjectId() : ""; + break; + case JnpfKeyConsts.GROUPSELECT: + List groupList = relationMap.get(PermissionConst.GROUP) != null ? relationMap.get(PermissionConst.GROUP) : new ArrayList<>(); + data = groupList.size() > 0 ? groupList.get(0).getObjectId() : ""; + break; + default: + break; + } + List list = new ArrayList<>(); + list.add(data); + if ("search".equals(parseFlag)) { + String searchMultiple = String.valueOf(itemMap.get("searchMultiple")); + if ("true".equals(searchMultiple)) { + configMap.put("defaultValue", list); + } else { + configMap.put("defaultValue", data); + } + } else { + String multiple = String.valueOf(itemMap.get("multiple")); + if ("true".equals(multiple)) { + configMap.put("defaultValue", list); + } else { + configMap.put("defaultValue", data); + } + } + itemMap.put("__config__", configMap); + itemList.set(i, itemMap); + } + } + } + + + @Operation(summary = "获取列表配置JSON") + @Parameters({ + @Parameter(name = "modelId", description = "模板id"), + }) + @GetMapping("/{modelId}/ColumnData") + public ActionResult getColumnData(@PathVariable("modelId") String modelId) { + StpUtil.checkPermission(modelId); + + VisualdevEntity entity = visualdevService.getInfo(modelId); + FormDataInfoVO vo = JsonUtil.getJsonToBean(entity, FormDataInfoVO.class); + return ActionResult.success(vo); + } + + + @Operation(summary = "获取表单配置JSON") + @Parameters({ + @Parameter(name = "modelId", description = "模板id"), + }) + @GetMapping("/{modelId}/FormData") + public ActionResult getFormData(@PathVariable("modelId") String modelId) { + StpUtil.checkPermission(modelId); + + VisualdevEntity entity = visualdevService.getInfo(modelId); + ColumnDataInfoVO vo = JsonUtil.getJsonToBean(entity, ColumnDataInfoVO.class); + return ActionResult.success(vo); + } + + @Operation(summary = "获取数据信息") + @Parameters({ + @Parameter(name = "modelId", description = "模板id"), + }) + @GetMapping("/{modelId}/{id}") + public ActionResult info(@PathVariable("id") String id, @PathVariable("modelId") String modelId) throws DataException { + StpUtil.checkPermission(modelId); + + VisualdevEntity visualdevEntity = visualdevService.getReleaseInfo(modelId); + //有表 + if (!StringUtil.isEmpty(visualdevEntity.getVisualTables()) && !OnlineDevData.TABLE_CONST.equals(visualdevEntity.getVisualTables())) { + VisualdevModelDataInfoVO editDataInfo = visualDevInfoService.getEditDataInfo(id, visualdevEntity); + return ActionResult.success(editDataInfo); + } + //无表 + VisualdevModelDataEntity entity = visualdevModelDataService.getInfo(id); + Map formData = JsonUtil.stringToMap(visualdevEntity.getFormData()); + List modelList = JsonUtil.getJsonToList(formData.get("fields").toString(), FieLdsModel.class); + //去除模板多级控件 + modelList = VisualUtils.deleteMore(modelList); + String data = AutoFeildsUtil.autoFeilds(modelList, entity.getData()); + entity.setData(data); + VisualdevModelDataInfoVO vo = JsonUtilEx.getJsonToBeanEx(entity, VisualdevModelDataInfoVO.class); + return ActionResult.success(vo); + } + + @Operation(summary = "获取数据信息(带转换数据)") + @Parameters({ + @Parameter(name = "modelId", description = "模板id"), + @Parameter(name = "id", description = "数据id"), + }) + @GetMapping("/{modelId}/{id}/DataChange") + public ActionResult infoWithDataChange(@PathVariable("modelId") String modelId, @PathVariable("id") String id) throws DataException, ParseException, IOException, SQLException { + VisualdevEntity visualdevEntity = visualdevService.getReleaseInfo(modelId); + //有表 + if (!StringUtil.isEmpty(visualdevEntity.getVisualTables()) && !OnlineDevData.TABLE_CONST.equals(visualdevEntity.getVisualTables())) { + VisualdevModelDataInfoVO vo = visualDevInfoService.getDetailsDataInfo(id, visualdevEntity); + return ActionResult.success(vo); + } + //无表 + VisualdevModelDataInfoVO vo = visualdevModelDataService.infoDataChange(id, visualdevEntity); + return ActionResult.success(vo); + } + + @Operation(summary = "添加数据") + @Parameters({ + @Parameter(name = "modelId", description = "模板id"), + @Parameter(name = "visualdevModelDataCrForm", description = "功能数据创建表单"), + }) + @PostMapping("/{modelId}") + public ActionResult create(@PathVariable("modelId") String modelId, @RequestBody VisualdevModelDataCrForm visualdevModelDataCrForm) throws Exception { + StpUtil.checkPermission(modelId); + + VisualdevEntity visualdevEntity = visualdevService.getReleaseInfo(modelId); + Map map = JsonUtil.stringToMap(visualdevModelDataCrForm.getData()); + DataModel dataModel = visualdevModelDataService.visualCreate(visualdevEntity, map); + List idList = new ArrayList() {{ + add(dataModel.getMainId()); + }}; + integrateUtil.dataAsyncList(modelId, 1, idList, UserProvider.getUser()); + return ActionResult.success(MsgCode.SU001.get()); + } + + + @Operation(summary = "修改数据") + @Parameters({ + @Parameter(name = "modelId", description = "模板id"), + @Parameter(name = "id", description = "数据id"), + @Parameter(name = "visualdevModelDataUpForm", description = "功能数据修改表单"), + }) + @PutMapping("/{modelId}/{id}") + public ActionResult update(@PathVariable("id") String id, @PathVariable("modelId") String modelId, @RequestBody VisualdevModelDataUpForm visualdevModelDataUpForm) throws Exception { + StpUtil.checkPermission(modelId); + Map data = JsonUtil.stringToMap(visualdevModelDataUpForm.getData()); + VisualdevEntity visualdevEntity = visualdevService.getReleaseInfo(modelId); + visualdevModelDataService.visualUpdate(visualdevEntity, data, id); + //todo 调用 + List idList = new ArrayList() {{ + add(id); + }}; + integrateUtil.dataAsyncList(modelId, 2, idList, UserProvider.getUser()); + return ActionResult.success(MsgCode.SU004.get()); + } + + + @Operation(summary = "删除数据") + @Parameters({ + @Parameter(name = "modelId", description = "模板id"), + @Parameter(name = "id", description = "数据id"), + }) + @DeleteMapping("/{modelId}/{id}") + public ActionResult delete(@PathVariable("id") String id, @PathVariable("modelId") String modelId) throws Exception { + StpUtil.checkPermission(modelId); + + VisualdevEntity visualdevEntity = visualdevService.getReleaseInfo(modelId); + + VisualDevJsonModel visualJsonModel = OnlinePublicUtils.getVisualJsonModel(visualdevEntity); + + //判断请求客户端来源 + if (!RequestContext.isOrignPc()) { + visualJsonModel.setColumnData(visualJsonModel.getAppColumnData()); + } + + if (!StringUtil.isEmpty(visualdevEntity.getVisualTables()) && !OnlineDevData.TABLE_CONST.equals(visualdevEntity.getVisualTables())) { + FlowTaskEntity taskEntity = flowTaskService.getInfoSubmit(id, FlowTaskEntity::getParentId, FlowTaskEntity::getStatus, FlowTaskEntity::getFullName); + if (taskEntity != null && Objects.equals(visualdevEntity.getEnableFlow(), 1)) { + if (!"0".equals(taskEntity.getParentId()) || !(taskEntity.getStatus().equals(0) || taskEntity.getStatus().equals(4))) { + return ActionResult.fail(taskEntity.getFullName() + "不能删除"); + } + if (taskEntity.getStatus().equals(0) || taskEntity.getStatus().equals(4)) { + flowTaskService.delete(taskEntity); + } + } + //树形递归删除 + if (OnlineDevData.TYPE_FIVE_COLUMNDATA.equals(visualJsonModel.getColumnData().getType())) { + try { + ActionResult listTreeAction = listTree(modelId, new PaginationModel(), id); + if (listTreeAction != null && listTreeAction.getCode() == 200 && listTreeAction.getData() instanceof Object) { + Map map = JsonUtil.getJsonToBean(listTreeAction.getData(), Map.class); + List> list = JsonUtil.getJsonToListMap(map.get("list").toString()); + if (list.size() > 0) { + for (Map item : list) { + this.delete(item.get("id").toString(), modelId); + } + } + } + } catch (Exception e) { + e.printStackTrace(); + log.error("子数据删除异常:{}", e.getMessage()); + } + } + //todo 调用 + List dataId = new ArrayList() {{ + add(id); + }}; + List dataInfoVOList = integrateUtil.dataList(modelId, 3, dataId); + boolean result = visualdevModelDataService.tableDelete(id, visualJsonModel); + if (result) { + integrateUtil.deleteDataList(dataInfoVOList, dataId, UserProvider.getUser()); + return ActionResult.success(MsgCode.SU003.get()); + } else { + return ActionResult.fail(MsgCode.FA003.get()); + } + } + VisualdevModelDataEntity entity = visualdevModelDataService.getInfo(id); + if (entity != null) { + visualdevModelDataService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + @Operation(summary = "批量删除数据") + @Parameters({ + @Parameter(name = "modelId", description = "模板id"), + @Parameter(name = "idsVo", description = "批量处理参数"), + }) + @PostMapping("/batchDelete/{modelId}") + public ActionResult batchDelete(@RequestBody BatchRemoveIdsVo idsVo, @PathVariable("modelId") String modelId) throws Exception { + StpUtil.checkPermission(modelId); + + VisualdevEntity visualdevEntity = visualdevService.getReleaseInfo(modelId); + + VisualDevJsonModel visualJsonModel = OnlinePublicUtils.getVisualJsonModel(visualdevEntity); + + //判断请求客户端来源 + if (!RequestContext.isOrignPc()) { + visualJsonModel.setColumnData(visualJsonModel.getAppColumnData()); + } + + List idsList = new ArrayList<>(); + List idsVoList = Arrays.asList(idsVo.getIds()); + String errMess = ""; + if (visualdevEntity.getEnableFlow() == 1) { + for (String id : idsVoList) { + FlowTaskEntity taskEntity = flowTaskService.getInfoSubmit(id, FlowTaskEntity::getId, + FlowTaskEntity::getParentId, FlowTaskEntity::getFullName, FlowTaskEntity::getStatus); + if (taskEntity != null) { + if (taskEntity.getStatus().equals(0) || taskEntity.getStatus().equals(4)) { + try { + flowTaskService.delete(taskEntity); + idsList.add(id); + } catch (Exception e) { + errMess = e.getMessage(); + } + } else { + errMess = "该流程已发起,无法删除"; + } + } else { + idsList.add(id); + } + } + } else { + idsList = idsVoList; + } + if (idsList.size() == 0) { + return ActionResult.fail(errMess); + } + if (!StringUtil.isEmpty(visualdevEntity.getVisualTables()) && !OnlineDevData.TABLE_CONST.equals(visualdevEntity.getVisualTables())) { + //todo 调用 + List dataInfoVOList = integrateUtil.dataList(modelId, 3, idsList); + ActionResult result = visualdevModelDataService.tableDeleteMore(idsList, visualJsonModel); + integrateUtil.deleteDataList(dataInfoVOList, visualJsonModel.getDataIdList(), UserProvider.getUser()); + return result; + } + if (visualdevModelDataService.removeByIds(idsList)) { + return ActionResult.success(MsgCode.SU003.get()); + } else if (visualdevEntity.getEnableFlow() == 1 && idsList.size() > 0) { + //分组页面 + return ActionResult.fail("该流程已发起,无法删除"); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + + @Operation(summary = "导入数据") + @Parameters({ + @Parameter(name = "modelId", description = "模板id"), + @Parameter(name = "visualImportModel", description = "导入参数"), + }) + @PostMapping("{modelId}/ImportData") + public ActionResult imports(@PathVariable("modelId") String modelId, @RequestBody VisualImportModel visualImportModel) throws WorkFlowException { + StpUtil.checkPermission(modelId); + + VisualdevEntity visualdevEntity = visualdevService.getReleaseInfo(modelId); + VisualDevJsonModel visualJsonModel = OnlinePublicUtils.getVisualJsonModel(visualdevEntity); + FormDataModel formData = visualJsonModel.getFormData(); + List fieldsModelList = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + List allFieLds = new ArrayList<>(); + VisualUtils.recursionFields(fieldsModelList, allFieLds); + visualJsonModel.setFormListModels(allFieLds); + visualJsonModel.setFlowId(visualImportModel.getFlowId()); + //复杂表头数据 还原成普通数据 + List> mapList = VisualUtils.complexImportsDataOnline(visualImportModel.getList(), visualdevEntity); + ExcelImportModel excelData = onlineSwapDataUtils.createExcelData(mapList, visualJsonModel, visualdevEntity); + List dataInfoList = excelData.getDataInfoList(); + List addIdList = new ArrayList<>(); + List updateIdList = new ArrayList<>(); + for (VisualdevModelDataInfoVO dataInfoVO : dataInfoList) { + Integer trigger = StringUtil.isEmpty(dataInfoVO.getIntegrateId()) ? 1 : 2; + if (Objects.equals(trigger, 1)) { + addIdList.add(dataInfoVO.getId()); + } else { + updateIdList.add(dataInfoVO.getId()); + } + } + integrateUtil.dataAsyncList(modelId, 1, addIdList, UserProvider.getUser()); + integrateUtil.dataAsyncList(modelId, 2, updateIdList, UserProvider.getUser()); + //复杂表头-表头和数据处理 + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(visualdevEntity.getColumnData(), ColumnDataModel.class); + List complexHeaderList = columnDataModel.getComplexHeaderList(); + if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) { + List> mapList1 = VisualUtils.complexHeaderDataHandel(excelData.getFailResult(), complexHeaderList); + excelData.setFailResult(mapList1); + } + return ActionResult.success(excelData); + } + + @Operation(summary = "导入") + @Parameters({ + @Parameter(name = "modelId", description = "模板id"), + }) + @PostMapping("/Model/{modelId}/Actions/Import") + public ActionResult imports(@PathVariable("modelId") String modelId) { + StpUtil.checkPermission(modelId); + + VisualdevModelDataEntity entity = visualdevModelDataService.getInfo(modelId); + List list = UpUtil.getFileAll(); + MultipartFile file = list.get(0); + if (file.getOriginalFilename().contains(".xlsx")) { + String filePath = configValueUtil.getTemporaryFilePath(); + String fileName = RandomUtil.uuId() + "." + UpUtil.getFileType(file); + //保存文件 + FileUtil.upFile(file, filePath, fileName); + File temporary = new File(XSSEscape.escapePath(filePath + fileName)); + return ActionResult.success(MsgCode.IMP001.get()); + } else { + return ActionResult.fail("选择文件不符合导入"); + } + } + + @Operation(summary = "导出") + @Parameters({ + @Parameter(name = "modelId", description = "模板id"), + @Parameter(name = "paginationModelExport", description = "导出参数"), + }) + @PostMapping("/{modelId}/Actions/Export") + public ActionResult export(@PathVariable("modelId") String modelId, @RequestBody PaginationModelExport paginationModelExport) throws ParseException, IOException, SQLException, DataException { + StpUtil.checkPermission(modelId); + + VisualdevEntity visualdevEntity = visualdevService.getReleaseInfo(modelId); + + VisualDevJsonModel visualJsonModel = OnlinePublicUtils.getVisualJsonModel(visualdevEntity); + //判断请求客户端来源 + if (!RequestContext.isOrignPc()) { + visualJsonModel.setColumnData(visualJsonModel.getAppColumnData()); + } + + String[] keys = paginationModelExport.getSelectKey(); + //关键字过滤 + List> realList; + DownloadVO vo; + if (VisualWebTypeEnum.DATA_VIEW.getType().equals(visualdevEntity.getWebType())) {//视图查询数据 + VisualdevReleaseEntity visualdevREntity = JsonUtil.getJsonToBean(visualdevEntity, VisualdevReleaseEntity.class); + realList = onlineSwapDataUtils.getInterfaceData(visualdevREntity, paginationModelExport, visualJsonModel.getColumnData()); + vo = VisualUtils.createModelExcelApiData(visualdevEntity, realList, Arrays.asList(keys), "表单信息"); + } else { + realList = visualdevModelDataService.exportData(keys, paginationModelExport, visualJsonModel); + vo = VisualUtils.createModelExcel(visualdevEntity, realList, Arrays.asList(keys), "表单信息"); + } + return ActionResult.success(vo); + } + + @Operation(summary = "功能导出") + @Parameters({ + @Parameter(name = "modelId", description = "模板id"), + }) + @PostMapping("/{modelId}/Actions/ExportData") + @SaCheckPermission("onlineDev.webDesign") + public ActionResult exportData(@PathVariable("modelId") String modelId) { + VisualdevEntity visualdevEntity = visualdevService.getReleaseInfo(modelId); + BaseDevModelVO vo = JsonUtil.getJsonToBean(visualdevEntity, BaseDevModelVO.class); + vo.setModelType(ExportModelTypeEnum.Design.getMessage()); + DownloadVO downloadVO = fileExport.exportFile(vo, configValueUtil.getTemporaryFilePath(), visualdevEntity.getFullName(), ModuleTypeEnum.VISUAL_DEV.getTableName()); + return ActionResult.success(downloadVO); + } + + @Operation(summary = "功能导入") + @PostMapping(value = "/Model/Actions/ImportData", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + @SaCheckPermission("onlineDev.webDesign") + public ActionResult ImportData(@RequestPart("file") MultipartFile multipartFile) throws WorkFlowException { + //判断是否为.json结尾 + if (FileUtil.existsSuffix(multipartFile, ModuleTypeEnum.VISUAL_DEV.getTableName())) { + return ActionResult.fail(MsgCode.IMP002.get()); + } + //获取文件内容 + String fileContent = FileUtil.getFileContent(multipartFile); + BaseDevModelVO vo = JsonUtil.getJsonToBean(fileContent, BaseDevModelVO.class); + if (vo.getModelType() == null || !vo.getModelType().equals(ExportModelTypeEnum.Design.getMessage())) { + return ActionResult.fail("请导入对应功能的json文件"); + } + VisualdevEntity visualdevEntity = JsonUtil.getJsonToBean(vo, VisualdevEntity.class); + String modelId = visualdevEntity.getId(); + if (StringUtil.isNotEmpty(modelId)) { + VisualdevEntity entity = visualdevService.getInfo(modelId); + if (entity != null) { + return ActionResult.fail("已存在相同功能"); + } + } + visualdevEntity.setCreatorTime(DateUtil.getNowDate()); + visualdevEntity.setLastModifyTime(null); + visualdevService.create(visualdevEntity); + return ActionResult.success(MsgCode.IMP001.get()); + } + + @Operation(summary = "模板下载") + @Parameters({ + @Parameter(name = "modelId", description = "模板id"), + }) + @GetMapping("/{modelId}/TemplateDownload") + public ActionResult templateDownload(@PathVariable("modelId") String modelId) { + StpUtil.checkPermission(modelId); + + VisualdevEntity visualdevEntity = visualdevService.getReleaseInfo(modelId); + FormDataModel formDataModel = JsonUtil.getJsonToBean(visualdevEntity.getFormData(), FormDataModel.class); + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(visualdevEntity.getColumnData(), ColumnDataModel.class); + UploaderTemplateModel uploaderTemplateModel = JsonUtil.getJsonToBean(columnDataModel.getUploaderTemplateJson(), UploaderTemplateModel.class); + List fieLdsModels = JsonUtil.getJsonToList(formDataModel.getFields(), FieLdsModel.class); + List allFieLds = new ArrayList<>(); + VisualUtils.recursionFields(fieLdsModels, allFieLds); + List selectKey = uploaderTemplateModel.getSelectKey(); + Map dataMap = new HashMap<>(); + //子表 + List childFields = allFieLds.stream().filter(f -> f.getConfig().getJnpfKey().equals(JnpfKeyConsts.CHILD_TABLE)).collect(Collectors.toList()); + for (FieLdsModel child : childFields) { + List childList = selectKey.stream().filter(s -> s.startsWith(child.getVModel())).collect(Collectors.toList()); + childList.stream().forEach(c -> c.replace(child.getVModel() + "-", "")); + List children = child.getConfig().getChildren(); + List> childData = new ArrayList<>(); + Map childMap = new HashMap<>(); + for (String cl : childList) { + String substring = cl.substring(cl.indexOf("-") + 1); + FieLdsModel fieLdsModel = children.stream().filter(c -> c.getVModel().equals(substring)).findFirst().orElse(null); + childMap.put(substring, VisualUtils.exampleExcelMessage(fieLdsModel)); + } + childData.add(childMap); + dataMap.put(child.getVModel(), childData); + } + + for (String s : selectKey.stream().filter(s -> !s.toLowerCase().startsWith(JnpfKeyConsts.CHILD_TABLE_PREFIX)).collect(Collectors.toList())) { + FieLdsModel fieLdsModel = allFieLds.stream().filter(c -> c.getVModel().equals(s)).findFirst().orElse(null); + dataMap.put(s, VisualUtils.exampleExcelMessage(fieLdsModel)); + } + List> dataList = new ArrayList<>(); + dataList.add(dataMap); + DownloadVO vo = VisualUtils.createModelExcel(visualdevEntity, dataList, selectKey, visualdevEntity.getFullName() + "模板"); + return ActionResult.success(vo); + } + + @Operation(summary = "上传文件") + @PostMapping("/Uploader") + public ActionResult Uploader() { + List list = UpUtil.getFileAll(); + MultipartFile file = list.get(0); + if (file.getOriginalFilename().endsWith(".xlsx") || file.getOriginalFilename().endsWith(".xls")) { + String filePath = XSSEscape.escape(configValueUtil.getTemporaryFilePath()); + String fileName = XSSEscape.escape(RandomUtil.uuId() + "." + UpUtil.getFileType(file)); + //上传文件 + FileInfo fileInfo = FileUploadUtils.uploadFile(file, filePath, fileName); + DownloadVO vo = DownloadVO.builder().build(); + vo.setName(fileInfo.getFilename()); + return ActionResult.success(vo); + } else { + return ActionResult.fail("选择文件不符合导入"); + } + } + + @Operation(summary = "导入预览") + @Parameters({ + @Parameter(name = "modelId", description = "模板id"), + @Parameter(name = "fileName", description = "文件名"), + }) + @GetMapping("/{modelId}/ImportPreview") + public ActionResult> ImportPreview(@PathVariable("modelId") String modelId, String fileName) throws Exception { + StpUtil.checkPermission(modelId); + + Map previewMap = null; + try { + VisualdevReleaseEntity entity = visualdevReleaseService.getById(modelId); + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(entity.getColumnData(), ColumnDataModel.class); + FormDataModel formDataModel = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + UploaderTemplateModel uploaderTemplateModel = JsonUtil.getJsonToBean(columnDataModel.getUploaderTemplateJson(), UploaderTemplateModel.class); + List fieLdsModels = JsonUtil.getJsonToList(formDataModel.getFields(), FieLdsModel.class); + List allFields = new ArrayList<>(); + OnlinePublicUtils.recursionFormFields(allFields, fieLdsModels); + + List selectKey = uploaderTemplateModel.getSelectKey(); + + //子表tableField + Set tablefield1 = selectKey.stream().filter(s -> s.toLowerCase().startsWith(JnpfKeyConsts.CHILD_TABLE_PREFIX)).map(s -> s.substring(0, s.indexOf("-"))).collect(Collectors.toSet()); + + String filePath = FileUploadUtils.getLocalBasePath() + configValueUtil.getTemporaryFilePath(); + FileUploadUtils.downLocal(configValueUtil.getTemporaryFilePath(), filePath, fileName); + File temporary = new File(XSSEscape.escapePath(filePath + fileName)); + //判断有无子表 + String tablefield = selectKey.stream().filter(s -> s.toLowerCase().startsWith(JnpfKeyConsts.CHILD_TABLE_PREFIX)).findFirst().orElse(null); + //有子表需要取第二行的表头 + Integer i = tablefield != null ? 2 : 1; + //读取excel中数据 + List excelDataList = ExcelUtil.importExcel(temporary, 0, i, Map.class); + //todo 备用方案,读取不到时间暂用此方法 + ExcelUtil.imoportExcelToMap(temporary, i, excelDataList); + //取出导出选项中的子表字段label + Map valueMap = new HashMap<>(); + for (FieLdsModel fieLdsModel : allFields) { + String jnpfKey = fieLdsModel.getConfig().getJnpfKey(); + //子表 + if (JnpfKeyConsts.CHILD_TABLE.equals(jnpfKey)) { + List children = fieLdsModel.getConfig().getChildren(); + List collect = children.stream().filter(c -> StringUtil.isNotEmpty(c.getVModel())).collect(Collectors.toList()); + valueMap.put(fieLdsModel.getVModel(), collect.stream().collect(Collectors.toMap(FieLdsModel::getVModel, c -> c.getConfig().getLabel()))); + } else { + valueMap.put(fieLdsModel.getVModel(), fieLdsModel.getConfig().getLabel()); + } + } + //列表字段 + List> columns = new ArrayList<>(); + List chiImList = new ArrayList<>(); + List allImList = new ArrayList<>(); + selectKey.stream().forEach(s -> { + ImportExcelFieldModel importExcel = new ImportExcelFieldModel(); + if (s.toLowerCase().startsWith(JnpfKeyConsts.CHILD_TABLE_PREFIX)) { + String table = s.substring(0, s.indexOf("-")); + String field = s.substring(s.indexOf("-") + 1); + importExcel.setField(field); + importExcel.setTableField(table); + Map map = (Map) valueMap.get(table); + importExcel.setFullName(map.get(field).toString()); + chiImList.add(importExcel); + } else { + importExcel.setField(s); + importExcel.setFullName(valueMap.get(s).toString()); + allImList.add(importExcel); + } + }); + Map> groups = chiImList.stream().collect(Collectors.groupingBy(ImportExcelFieldModel::getTableField)); + + for (Map.Entry> entry : groups.entrySet()) { + ImportExcelFieldModel importExcel = new ImportExcelFieldModel(); + + List value = entry.getValue(); + ImportExcelFieldModel im = value.get(0); + FieLdsModel fieLdsModel = allFields.stream().filter(f -> entry.getKey().equals(f.getVModel())).findFirst().orElse(null); + String tableName = fieLdsModel.getConfig().getLabel(); + importExcel.setField(entry.getKey()); + importExcel.setFullName(tableName); + // value.stream().forEach(im1->im1.setFullName(im1.getFullName().replace(tableName+"-",""))); + importExcel.setChildren(value); + allImList.add(importExcel); + } + + for (ImportExcelFieldModel importExcel : allImList) { + Map selectMap = new HashMap<>(16); + selectMap.put("id", importExcel.getField()); + selectMap.put("fullName", importExcel.getFullName()); + if (importExcel.getChildren() != null) { + List children = importExcel.getChildren(); + List> childMapList = new ArrayList<>(); + for (ImportExcelFieldModel childIm : children) { + Map childMap = new HashMap<>(16); + childMap.put("id", childIm.getField()); + childMap.put("fullName", childIm.getFullName()); + childMapList.add(childMap); + } + selectMap.put("children", childMapList); + } + columns.add(selectMap); + } + List> allDataList = new ArrayList<>(); + + for (int z = 0; z < excelDataList.size(); z++) { + Map dataMap = new HashMap<>(16); + Map m = excelDataList.get(z); + List results = new ArrayList<>(m.entrySet()); + //取出的数据最后一行 不带行标签 + int resultsize = z == excelDataList.size() - 1 ? results.size() : m.containsKey("excelRowNum") ? results.size() - 1 : results.size(); + if (resultsize < selectKey.size()) { + throw new WorkFlowException(MsgCode.VS407.get()); + } + for (int e = 0; e < resultsize; e++) { + Map.Entry o = (Map.Entry) results.get(e); + String entryKey = o.getKey().toString(); + String substring = entryKey.substring(entryKey.lastIndexOf("(") + 1, entryKey.lastIndexOf(")")); + boolean contains = selectKey.contains(substring); + if (!contains) { + throw new WorkFlowException(MsgCode.VS407.get()); + } + dataMap.put(substring, o.getValue()); + } + allDataList.add(dataMap); + } + + //存放在主表数据的下标位置 + List>>> IndexMap = new ArrayList<>(); +// Map>>> IndexMap = new TreeMap<>(); + Map>> childrenTabMap = new HashMap<>(); + for (String tab : tablefield1) { + childrenTabMap.put(tab, new ArrayList<>()); + } + + List> results = new ArrayList<>(); + for (int t = 0; t < allDataList.size(); t++) { + boolean isLast = t == allDataList.size() - 1; + //是否是上条数据的子表 + boolean isTogetherWithUp = false; + //是否需要合并 + boolean needTogether = true; + //这条数据是否需要添加 + boolean needAdd = true; + Map dataMap = allDataList.get(t); + //首条数据不合并 + if (t > 0) { + List> tablefield2 = dataMap.entrySet().stream().filter(e -> !e.getKey().toLowerCase().startsWith(JnpfKeyConsts.CHILD_TABLE_PREFIX)).collect(Collectors.toList()); + //如果除子表外都为空 则需要合并 + Map.Entry entry = tablefield2.stream().filter(ta -> ta.getValue() != null).findFirst().orElse(null); + if (entry == null) { + isTogetherWithUp = true; + needTogether = false; + needAdd = false; + if (isLast) { + needTogether = true; + } + } + } + + //合并子表里的字段 + for (String tab : tablefield1) { + Map childObjMap = new HashMap<>(16); + //该条数据下的子表字段 + List> childList = dataMap.entrySet().stream().filter(e -> e.getKey().startsWith(tab)).collect(Collectors.toList()); + for (Map.Entry entry : childList) { + String childFieldName = entry.getKey().replace(tab + "-", ""); + childObjMap.put(childFieldName, entry.getValue()); + } + List> mapList = childrenTabMap.get(tab); + mapList.add(childObjMap); + } + if (needTogether && t != 0) { + Map>> c = new HashMap<>(childrenTabMap); + Map>> b = new HashMap<>(); + + for (String tab : tablefield1) { + //去掉最后一个 放到下条数据里 + List> mapList = c.get(tab); + Map map = mapList.get(mapList.size() - 1); + List> aList = new ArrayList<>(); + aList.add(map); + if (!isLast) { + mapList.remove(mapList.size() - 1); + } + childrenTabMap.put(tab, aList); + b.put(tab, mapList); + } + IndexMap.add(b); + if (isLast) { + IndexMap.add(childrenTabMap); + } + } else { + if (isLast) { + IndexMap.add(childrenTabMap); + } + } + if (needAdd) { + Map m = new HashMap<>(); + for (Map.Entry entry : dataMap.entrySet()) { + if (!entry.getKey().contains("-")) { + m.put(entry.getKey(), entry.getValue()); + } + } + results.add(m); + } + } + + //处理结果 + for (int r = 0; r < results.size(); r++) { + Map>> entry = IndexMap.get(r); + Map map = results.get(r); + for (Map.Entry>> entry1 : entry.entrySet()) { + String tableField = entry1.getKey(); + Object tableField1 = map.get(tableField); + List> value1 = entry1.getValue(); + if (tableField1 != null) { + List> tfMap = (List>) tableField1; + value1.addAll(tfMap); + } + map.put(tableField, value1); + } + results.set(r, map); + } + + previewMap = new HashMap<>(); + //复杂表头-表头和数据处理 + List complexHeaderList = columnDataModel.getComplexHeaderList(); + if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) { + results = VisualUtils.complexHeaderDataHandel(results, complexHeaderList); + columns = VisualUtils.complexHeaderHandelOnline(columns, complexHeaderList); + } + previewMap.put("dataRow", results); + previewMap.put("headerRow", columns); + } catch (Exception e) { + e.printStackTrace(); + return ActionResult.fail(MsgCode.VS407.get()); + } + return ActionResult.success(previewMap); + } + + @Operation(summary = "导出异常报告") + @Parameters({ + @Parameter(name = "modelId", description = "模板id"), + @Parameter(name = "visualImportModel", description = "导出参数"), + }) + @PostMapping("/{modelId}/ImportExceptionData") + public ActionResult ImportExceptionData(@PathVariable("modelId") String modelId, @RequestBody VisualImportModel visualImportModel) { + StpUtil.checkPermission(modelId); + + VisualdevEntity visualdevEntity = visualdevService.getReleaseInfo(modelId); + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(visualdevEntity.getColumnData(), ColumnDataModel.class); + UploaderTemplateModel uploaderTemplateModel = JsonUtil.getJsonToBean(columnDataModel.getUploaderTemplateJson(), UploaderTemplateModel.class); + List selectKey = uploaderTemplateModel.getSelectKey(); + DownloadVO vo = VisualUtils.createModelExcel(visualdevEntity, visualImportModel.getList(), selectKey, "错误报告"); + return ActionResult.success(vo); + } +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/pom.xml b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/pom.xml new file mode 100644 index 0000000..ab8b6a0 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/pom.xml @@ -0,0 +1,27 @@ + + + + jnpf-visualdev-onlinedev + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-visualdev-onlinedev-entity + + + + com.jnpf + jnpf-common-all + ${project.version} + + + com.jnpf + jnpf-workflow-engine-entity + ${project.version} + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/entity/VisualdevModelDataEntity.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/entity/VisualdevModelDataEntity.java new file mode 100644 index 0000000..3c16f42 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/entity/VisualdevModelDataEntity.java @@ -0,0 +1,54 @@ +package jnpf.onlinedev.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * + * 0代码功能数据表 + * 版本: V3.0.0 + * 版权: 引迈信息技术有限公司 + * 作者: 管理员/admin + * 日期: 2020-07-24 11:59 + */ +@Data +//@TableName("base_visualdev_modeldata") +public class VisualdevModelDataEntity extends SuperExtendEntity { + + @TableField("F_VISUALDEVID") + private String visualDevId; + + @TableField("F_SORTCODE") + private Long sortcode; + + @TableField("F_ENABLEDMARK") + private Integer enabledmark; + + @TableField("F_CREATORTIME") + private Date creatortime; + + @TableField("F_CREATORUSERID") + private String creatoruserid; + + @TableField("F_LASTMODIFYTIME") + private Date lastmodifytime; + + @TableField("F_LASTMODIFYUSERID") + private String lastmodifyuserid; + + @TableField("F_DELETEMARK") + private Integer deletemark; + + @TableField("F_DELETETIME") + private Date deletetime; + + @TableField("F_DELETEUSERID") + private String deleteuserid; + @TableField("F_DATA") + private String data; + +} + diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/BaseDevModelVO.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/BaseDevModelVO.java new file mode 100644 index 0000000..aba63e4 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/BaseDevModelVO.java @@ -0,0 +1,62 @@ +package jnpf.onlinedev.model; +import lombok.Data; + +/** + * 功能设计导入导出模型 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/7/15 + */ +@Data +public class BaseDevModelVO { + + private String id; + + private String description; + + private String sortCode; + + private String enabledMark; + + private String creatorTime; + + private String creatorUser; + + private String lastModifyTime; + + private String lastModifyUser; + + private String deleteMark; + + private String deleteTime; + + private String deleteUserId; + + private String fullName; + + private String enCode; + + private String state; + + private String type; + + private String tables; + + private String category; + + private String formData; + + private String columnData; + + private String dbLinkId; + + private String webType; + + private String flowTemplateJson; + + private String modelType; + + private String enableFlow; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/BatchRemoveIdsVo.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/BatchRemoveIdsVo.java new file mode 100644 index 0000000..243a32f --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/BatchRemoveIdsVo.java @@ -0,0 +1,20 @@ +package jnpf.onlinedev.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 批量删除id集合 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/6/17 + */ +@Data +@Schema(description="批量处理参数") +public class BatchRemoveIdsVo { + @Schema(description = "批量处理数据id") + private String[] ids; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/ColumnDataInfoVO.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/ColumnDataInfoVO.java new file mode 100644 index 0000000..4eb6076 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/ColumnDataInfoVO.java @@ -0,0 +1,15 @@ +package jnpf.onlinedev.model; +import lombok.Data; + +/** + * + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @author JNPF开发平台组 + * @date 2021/3/16 + */ +@Data +public class ColumnDataInfoVO { + private String columnData; + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/DataInfoVO.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/DataInfoVO.java new file mode 100644 index 0000000..11e82af --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/DataInfoVO.java @@ -0,0 +1,22 @@ +package jnpf.onlinedev.model; +import lombok.Data; + +/** + * + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @author JNPF开发平台组 + * @date 2021/3/16 + */ +@Data +public class DataInfoVO { + private String formData; + private String columnData; + private String appColumnData; + private String webType; + private String flowTemplateJson; + private String flowEnCode; + private String flowId; + private String fullName; + private Integer enableFlow; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/ExcelImFieldModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/ExcelImFieldModel.java new file mode 100644 index 0000000..737ce53 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/ExcelImFieldModel.java @@ -0,0 +1,29 @@ +package jnpf.onlinedev.model; +import lombok.Data; + +import java.util.List; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.4.3 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2022/9/21 + */ +@Data +public class ExcelImFieldModel { + private String id; + private String fullName; + private List children; + + public ExcelImFieldModel(String id, String fullName, List children) { + this.id = id; + this.fullName = fullName; + this.children = children; + } + public ExcelImFieldModel(String id, String fullName) { + this.id = id; + this.fullName = fullName; + } +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/FormDataInfoVO.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/FormDataInfoVO.java new file mode 100644 index 0000000..e49820f --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/FormDataInfoVO.java @@ -0,0 +1,15 @@ +package jnpf.onlinedev.model; +import lombok.Data; + +/** + * + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @author JNPF开发平台组 + * @date 2021/3/16 + */ +@Data +public class FormDataInfoVO { + private String formData; + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevData.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevData.java new file mode 100644 index 0000000..6482da9 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevData.java @@ -0,0 +1,64 @@ +package jnpf.onlinedev.model; +import lombok.Data; + +/** + * 在线开发常用常量 + */ +@Data +public class OnlineDevData { + + /** + * 用于判断是否是有表数据 + */ + public static final String TABLE_CONST = "[]"; + + /** + * 详情id副本 + */ + public static final String INFO_ID = "_id"; + + + /** + * 列表分组类型3 + */ + public static final Integer TYPE_THREE_COLUMNDATA = 3; + + /** + * 树形列表类型5 + */ + public static final Integer TYPE_FIVE_COLUMNDATA = 5; + + + /** + * 禁用 + */ + public static final Integer STATE_DISABLE = 0; + /** + * 启用 + */ + public static final Integer STATE_ENABLE = 1; + /** + * 系统表单 + */ + public static final Integer FORM_TYPE_SYS = 1; + /** + * 自定义表单 + */ + public static final Integer FORM_TYPE_DEV = 2; + /** + * 发起流程类型 + */ + public static final Integer FLOW_TYPE_FLOW = 0; + /** + * 功能流程类型 + */ + public static final Integer FLOW_TYPE_DEV = 1; + /** + * 默认分类编码encode + */ + public static final String DEFAULT_CATEGATY_ENCODE = "default"; + + + + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevEnum/CacheKeyEnum.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevEnum/CacheKeyEnum.java new file mode 100644 index 0000000..9c71420 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevEnum/CacheKeyEnum.java @@ -0,0 +1,45 @@ +package jnpf.onlinedev.model.OnlineDevEnum; + +/** + * + * 在线开发缓存的key + * @author JNPF开发平台组 + * @version V3.2.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/7/31 + */ +public enum CacheKeyEnum { + /** + * 修改用户,创建用户,用户组件 + */ + USER("_user","用户"), + + POS("_position","岗位"), + + ORG("_organization","组织"), + + AllORG("_organizationAll","组织多级"), + + PRO("_province","省份"), + + ROLE("_role","角色"), + + GROUP("_group","分组"); + private final String name; + private final String message; + + CacheKeyEnum(String name, String message) { + this.name = name; + this.message = message; + } + + public String getName() { + return name; + } + + public String getMessage() { + return message; + } + + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevEnum/MultipleControlEnum.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevEnum/MultipleControlEnum.java new file mode 100644 index 0000000..6c1f229 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevEnum/MultipleControlEnum.java @@ -0,0 +1,43 @@ +package jnpf.onlinedev.model.OnlineDevEnum; + +/** + * 控件多选字符 + * + * @author JNPF开发平台组 + * @version V3.3 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2022/2/14 + */ + +public enum MultipleControlEnum { + /** + * 数组 + */ + MULTIPLE_JSON_ONE("[",1), + /** + * 二维数组 + */ + MULTIPLE_JSON_TWO("[[",2), + /** + * 普通字符 + */ + MULTIPLE_JSON_THREE("",3); + + + MultipleControlEnum(String multipleChar, int dataType) { + MultipleChar = multipleChar; + DataType = dataType; + } + + public String getMultipleChar() { + return MultipleChar; + } + + public int getDataType() { + return DataType; + } + + private String MultipleChar; + private int DataType; + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevEnum/OnlineDataTypeEnum.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevEnum/OnlineDataTypeEnum.java new file mode 100644 index 0000000..2211ec4 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevEnum/OnlineDataTypeEnum.java @@ -0,0 +1,53 @@ +package jnpf.onlinedev.model.OnlineDevEnum; + + + +/** + * + * 数据接口类型 + * @author JNPF开发平台组 + * @version V3.2.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/7/31 + */ + +public enum OnlineDataTypeEnum { + /** + * 静态数据 + */ + STATIC("static","静态数据"), + /** + * 数据字典 + */ + DICTIONARY("dictionary","数据字典"), + /** + * 远端数据 + */ + DYNAMIC("dynamic","远端数据"), + + /** + * 二维码 条形码类型 + */ + STATIC_CODE("static","固定值"), + + RELATION("relation","关联组件") + ; + + private final String type; + private final String message; + + + OnlineDataTypeEnum(String type, String message) { + this.type = type; + this.message = message; + } + + public String getType() { + return type; + } + + public String getMessage() { + return message; + } + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevListModel/OnlineColumnChildFieldModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevListModel/OnlineColumnChildFieldModel.java new file mode 100644 index 0000000..a66fe43 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevListModel/OnlineColumnChildFieldModel.java @@ -0,0 +1,35 @@ +package jnpf.onlinedev.model.OnlineDevListModel; +import lombok.Data; + +import java.util.List; + +/** + * 列表子表 + * + * @author JNPF开发平台组 + * @version V3.2 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/10/16 + */ +@Data +public class OnlineColumnChildFieldModel { + /** + * 子表表名 + */ + private String table; + /** + * 关联外键 + */ + private String tableField; + + /** + * 关联主键 + */ + private String relationField; + + /** + * 子表字段集合 + */ + private List fieldList; + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevListModel/OnlineColumnFieldModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevListModel/OnlineColumnFieldModel.java new file mode 100644 index 0000000..1609d57 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevListModel/OnlineColumnFieldModel.java @@ -0,0 +1,33 @@ +package jnpf.onlinedev.model.OnlineDevListModel; +import lombok.Data; + +/** + * 列表字段 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/10/16 + */ +@Data +public class OnlineColumnFieldModel { + /** + * 表名 + */ + private String tableName; + /** + * 字段 + */ + private String field; + + /** + * 原本字段 + */ + private String OriginallyField; + + /** + * 别名 + */ + private String otherName; + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevListModel/OnlineConfigModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevListModel/OnlineConfigModel.java new file mode 100644 index 0000000..8379a33 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevListModel/OnlineConfigModel.java @@ -0,0 +1,65 @@ +package jnpf.onlinedev.model.OnlineDevListModel; + + +import jnpf.model.visualJson.config.RegListModel; +import lombok.Data; + +import java.util.List; + +/** + * @author JNPF开发平台组 + * @version V3.2.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/8/5 + */ +@Data +public class OnlineConfigModel { + private String label; + private String labelWidth; + private Boolean showLabel; + private Boolean changeTag; + private Boolean border; + private String tag; + private String tagIcon; + private Boolean required; + private String layout; + private String dataType; + private Integer span; + private String jnpfKey; + private String dictionaryType; + private Integer formId; + private Long renderKey; + private Integer columnWidth; + private List regList; + private Object defaultValue; + /** + * app静态数据 + */ + private String options; + /** + * 判断defaultValue类型 + */ + private String valueType; + private String propsUrl; + private String optionType; + /** + * 子表添加字段 + */ + private String showTitle; + private String tableName; + private List children; + /** + * 单据规则使用 + */ + private String rule; + + /** + * 验证规则触发方式 + */ + private String trigger = "blur" ; + /** + * 隐藏 + */ + private Boolean noShow = false; + private String jnpfKeyName; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevListModel/OnlineDevListDataVO.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevListModel/OnlineDevListDataVO.java new file mode 100644 index 0000000..c284f41 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevListModel/OnlineDevListDataVO.java @@ -0,0 +1,18 @@ +package jnpf.onlinedev.model.OnlineDevListModel; +import lombok.Data; + +import java.util.Map; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.2.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/7/28 + */ +@Data +public class OnlineDevListDataVO { + private String id; + private Map data; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevListModel/OnlineFieldsModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevListModel/OnlineFieldsModel.java new file mode 100644 index 0000000..1accf91 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevListModel/OnlineFieldsModel.java @@ -0,0 +1,21 @@ +package jnpf.onlinedev.model.OnlineDevListModel; + + +import lombok.Data; + +import java.util.List; + + +/** + *在线开发formData + * + * @author JNPF开发平台组 + * @version V3.2.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/8/2 + */ +@Data +public class OnlineFieldsModel { + private StringBuilder sql; + private List mastTableList; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevListModel/OnlineListSqlModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevListModel/OnlineListSqlModel.java new file mode 100644 index 0000000..bd3c186 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevListModel/OnlineListSqlModel.java @@ -0,0 +1,25 @@ +package jnpf.onlinedev.model.OnlineDevListModel; +import lombok.Data; + +@Data +public class OnlineListSqlModel { + /** + * 主表 + */ + private String mainTable; + /** + * 用到的字段 + */ + private String fields; + /** + * 主键 + */ + private String pKeyName; + /** + * 数据权限条件 + */ + private String resultSql; + + private String defaultSidx; + private String sort; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevListModel/PropsFatherModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevListModel/PropsFatherModel.java new file mode 100644 index 0000000..507a684 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevListModel/PropsFatherModel.java @@ -0,0 +1,15 @@ +package jnpf.onlinedev.model.OnlineDevListModel; +import lombok.Data; + +/** + * + * props父级 + * @author JNPF开发平台组 + * @version V3.2.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/8/3 + */ +@Data +public class PropsFatherModel { + private PropsModel props; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevListModel/PropsModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevListModel/PropsModel.java new file mode 100644 index 0000000..f208a1f --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevListModel/PropsModel.java @@ -0,0 +1,18 @@ +package jnpf.onlinedev.model.OnlineDevListModel; +import lombok.Data; + +/** + * + * + * @author JNPF开发平台组 + * @version V3.2.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/8/3 + */ +@Data +public class PropsModel { + private String children; + private String value; + private String label; + private boolean multiple; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevListModel/SlotModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevListModel/SlotModel.java new file mode 100644 index 0000000..118b2fb --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevListModel/SlotModel.java @@ -0,0 +1,18 @@ +package jnpf.onlinedev.model.OnlineDevListModel; +import lombok.Data; + +import java.util.List; +import java.util.Map; + +/** + * + * slot + * @author JNPF开发平台组 + * @version V3.2.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/8/2 + */ +@Data +public class SlotModel { + private List> options; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevListModel/VisualColumnSearchVO.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevListModel/VisualColumnSearchVO.java new file mode 100644 index 0000000..3f55a4e --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineDevListModel/VisualColumnSearchVO.java @@ -0,0 +1,74 @@ +package jnpf.onlinedev.model.OnlineDevListModel; + +import jnpf.model.visualJson.TemplateJsonModel; +import jnpf.model.visualJson.config.ConfigModel; +import jnpf.model.visualJson.props.PropsModel; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author JNPF开发平台组 + * @version V3.2.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/8/9 + */ +@Data +public class VisualColumnSearchVO { + /** + * 查询字段全key:如tableField113-datePickerField117 + */ + private String id; + /** + * 查询字段全名:如设计子表-子表年月日 + */ + private String fullName; + /** + * 查询条件类型 1.等于 2.模糊 3.范围 + */ + private String searchType; + private String vModel; + /** + * 查询值 + */ + private Object value; + /** + * 是否多选 + */ + private Boolean multiple; + + private Boolean searchMultiple; + + private ConfigModel config; + /** + * 省市区 + */ + private Integer level; + /** + * 时间类型格式 + */ + private String format; + private String type; + + /** + * 数据库字段 + */ + private String field; + private String table; + + private PropsModel props; + private SlotModel slot; + private String options; + + private List templateJson = new ArrayList(); + private String interfaceId; + + private String selectType; + private String ableDepIds; + private String ableIds; + private String ablePosIds; + private String ableUserIds; + private String ableRoleIds; + private String ableGroupIds; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineImport/ExcelImportModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineImport/ExcelImportModel.java new file mode 100644 index 0000000..4b5ff0a --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineImport/ExcelImportModel.java @@ -0,0 +1,41 @@ +package jnpf.onlinedev.model.OnlineImport; +import jnpf.onlinedev.model.VisualdevModelDataInfoVO; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * + * 在线开发导入数据结果集 + * @author JNPF开发平台组 + * @version V3.4.3 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2022/9/6 + */ +@Data +public class ExcelImportModel { + /** + * 导入成功条数 + */ + private int snum; + /** + * 导入失败条数 + */ + private int fnum; + /** + * 导入结果状态(0,成功 1,失败) + */ + private int resultType; + + /** + * 失败结果 + */ + private List> failResult; + + /** + * 集成调用哦个 + */ + private List dataInfoList = new ArrayList<>(); +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineImport/ImportDataModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineImport/ImportDataModel.java new file mode 100644 index 0000000..9977aef --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineImport/ImportDataModel.java @@ -0,0 +1,12 @@ +package jnpf.onlinedev.model.OnlineImport; + +import lombok.Data; + +import java.util.HashMap; +import java.util.Map; + +@Data +public class ImportDataModel { + private String id; + private Map resultData = new HashMap<>(); +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineImport/ImportExcelFieldModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineImport/ImportExcelFieldModel.java new file mode 100644 index 0000000..a79fe7c --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineImport/ImportExcelFieldModel.java @@ -0,0 +1,19 @@ +package jnpf.onlinedev.model.OnlineImport; +import lombok.Data; + +import java.util.List; + +/** + * + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @author JNPF开发平台组 + * @date 2021/3/16 + */ +@Data +public class ImportExcelFieldModel { + private String tableField; + private String field; + private String fullName; + private List children; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineImport/ImportFormCheckUniqueModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineImport/ImportFormCheckUniqueModel.java new file mode 100644 index 0000000..d0790d8 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineImport/ImportFormCheckUniqueModel.java @@ -0,0 +1,33 @@ +package jnpf.onlinedev.model.OnlineImport; + +import jnpf.model.visualJson.TableModel; +import lombok.Data; + +import java.sql.Connection; +import java.util.ArrayList; +import java.util.List; + +/** + * 导入验证 表单验证 + * + * @author JNPF开发平台组 + * @version V3.4.5 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2022/11/12 + */ +@Data +public class ImportFormCheckUniqueModel { + private boolean isUpdate; + private boolean isMain; + private String id; + private String dbLinkId; + private String flowId; + /** + * 主键 + */ + private Connection connection; + private Integer primaryKeyPolicy; + private Boolean logicalDelete = false; + private List importDataModel = new ArrayList<>(); + private List tableModelList; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineImport/OnlineExportExceptionVO.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineImport/OnlineExportExceptionVO.java new file mode 100644 index 0000000..ee45503 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineImport/OnlineExportExceptionVO.java @@ -0,0 +1,15 @@ +package jnpf.onlinedev.model.OnlineImport; +import lombok.Data; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021年3月15日09:47:19 + */ +@Data +public class OnlineExportExceptionVO { + private String tableField; + private String field; + private String label; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineImport/VisualImportModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineImport/VisualImportModel.java new file mode 100644 index 0000000..61e6fdc --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/OnlineImport/VisualImportModel.java @@ -0,0 +1,26 @@ +package jnpf.onlinedev.model.OnlineImport; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; +import java.util.Map; + +/** + * 导入失败的数据 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2022/9/6 + */ +@Data +@Schema(description="导入参数") +public class VisualImportModel { + @Schema(description = "数据数组") + private List> list; + + @Schema(description = "流程引擎") + private String flowId; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/PaginationModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/PaginationModel.java new file mode 100644 index 0000000..2eba6d7 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/PaginationModel.java @@ -0,0 +1,32 @@ +package jnpf.onlinedev.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.base.Pagination; +import lombok.Data; + +/** + * + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @author JNPF开发平台组 + * @date 2021/3/16 + */ +@Data +@Schema(description="查询条件模型") +public class PaginationModel extends Pagination { + @Schema(description = "查询条件json") + private String queryJson; + @Schema(description = "菜单id") + private String menuId; + @Schema(description = "关联字段") + private String relationField; + @Schema(description = "字段对象") + private String columnOptions; + @Schema(description = "数据类型") + private String dataType; + @Schema(description = "高级查询条件json") + private String superQueryJson; + @Schema(description = "异步查询父id") + private String parentId; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/PaginationModelExport.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/PaginationModelExport.java new file mode 100644 index 0000000..1bf4a04 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/PaginationModelExport.java @@ -0,0 +1,22 @@ +package jnpf.onlinedev.model; + + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @author JNPF开发平台组 + * @date 2021/3/16 + */ +@Data +@Schema(description="导出参数") +public class PaginationModelExport extends PaginationModel { + @Schema(description = "导出selectKey") + private String[] selectKey; + @Schema(description = "导出json") + private String json; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/PortalDefaultDTO.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/PortalDefaultDTO.java new file mode 100644 index 0000000..78ddf77 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/PortalDefaultDTO.java @@ -0,0 +1,28 @@ +package jnpf.onlinedev.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 类功能 + * + * @author JNPF开发平台组 YanYu + * @version v3.4.6 + * @copyrignt 引迈信息技术有限公司 + * @date 2023-03-24 + */ +@Data +public class PortalDefaultDTO { + + @Schema(description = "默认门户ID") + private String defaultPortalId; + + @Schema(description = "系统ID") + private String systemId; + + public PortalDefaultDTO(){ + + } + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/VisualdevModelDataCrForm.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/VisualdevModelDataCrForm.java new file mode 100644 index 0000000..e7550dc --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/VisualdevModelDataCrForm.java @@ -0,0 +1,31 @@ +package jnpf.onlinedev.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.engine.model.flowengine.FlowModel; +import lombok.Data; + +import java.util.List; +import java.util.Map; + +/** + * + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @author JNPF开发平台组 + * @date 2021/3/16 + */ +@Data +@Schema(description="功能数据创建表单") +public class VisualdevModelDataCrForm extends FlowModel { + @Schema(description = "数据内容") + private String data; + @Schema(description = "状态") + private String status; + @Schema(description = "流程候选人列表") + private Map> candidateList; + @Schema(description = "流程紧急度") + private Integer flowUrgent = 1; + @Schema(description = "是否外链") + private Boolean isLink = false; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/VisualdevModelDataInfoVO.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/VisualdevModelDataInfoVO.java new file mode 100644 index 0000000..d8b0392 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/VisualdevModelDataInfoVO.java @@ -0,0 +1,17 @@ +package jnpf.onlinedev.model; +import lombok.Data; + +/** + * + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @author JNPF开发平台组 + * @date 2021/3/16 + */ +@Data +public class VisualdevModelDataInfoVO { + + private String id; + private String data; + private String integrateId; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/VisualdevModelDataListVO.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/VisualdevModelDataListVO.java new file mode 100644 index 0000000..57d45f7 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/VisualdevModelDataListVO.java @@ -0,0 +1,17 @@ +package jnpf.onlinedev.model; +import lombok.Data; + +import java.util.Map; + +/** + * + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @author JNPF开发平台组 + * @date 2021/3/16 + */ +@Data +public class VisualdevModelDataListVO { + + private Map data; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/VisualdevModelDataUpForm.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/VisualdevModelDataUpForm.java new file mode 100644 index 0000000..6ef73a2 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/VisualdevModelDataUpForm.java @@ -0,0 +1,18 @@ +package jnpf.onlinedev.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @author JNPF开发平台组 + * @date 2021/3/16 + */ +@Data +@Schema(description="功能数据修改表单") +public class VisualdevModelDataUpForm extends VisualdevModelDataCrForm { + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/fields/autosize/AutosizeModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/fields/autosize/AutosizeModel.java new file mode 100644 index 0000000..a5451e5 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/fields/autosize/AutosizeModel.java @@ -0,0 +1,8 @@ +package jnpf.onlinedev.model.fields.autosize; +import lombok.Data; + +@Data +public class AutosizeModel { + private Integer minRows; + private Integer maxRows; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/fields/options/ColumnOptionModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/fields/options/ColumnOptionModel.java new file mode 100644 index 0000000..a6b81ac --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/fields/options/ColumnOptionModel.java @@ -0,0 +1,15 @@ +package jnpf.onlinedev.model.fields.options; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/6/29 + */ +@Data +public class ColumnOptionModel { + private String value; + private String label; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/fields/options/OptionsModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/fields/options/OptionsModel.java new file mode 100644 index 0000000..914fcff --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/fields/options/OptionsModel.java @@ -0,0 +1,12 @@ +package jnpf.onlinedev.model.fields.options; +import lombok.Data; + +import java.util.List; + +@Data +public class OptionsModel { + private Integer id; + private Integer value; + private String label; + private List children; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/fields/picker/PickerOptionsModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/fields/picker/PickerOptionsModel.java new file mode 100644 index 0000000..5dbfc4f --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/fields/picker/PickerOptionsModel.java @@ -0,0 +1,7 @@ +package jnpf.onlinedev.model.fields.picker; +import lombok.Data; + +@Data +public class PickerOptionsModel { + private String selectableRange; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/fields/style/StyleModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/fields/style/StyleModel.java new file mode 100644 index 0000000..b94989a --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/fields/style/StyleModel.java @@ -0,0 +1,7 @@ +package jnpf.onlinedev.model.fields.style; +import lombok.Data; + +@Data +public class StyleModel { + private String width; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/fields/style/textStyleModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/fields/style/textStyleModel.java new file mode 100644 index 0000000..2754e66 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/fields/style/textStyleModel.java @@ -0,0 +1,11 @@ +package jnpf.onlinedev.model.fields.style; +import lombok.Data; + +@Data +public class textStyleModel { + private String color; + private String textalign; + private String fontweight; + private String fontstyle; + private String textdecoration; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/visualdevmodelApp/AppDataInfoVO.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/visualdevmodelApp/AppDataInfoVO.java new file mode 100644 index 0000000..cbc4bd4 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/jnpf-visualdev-onlinedev-entity/src/main/java/jnpf/onlinedev/model/visualdevmodelApp/AppDataInfoVO.java @@ -0,0 +1,14 @@ +package jnpf.onlinedev.model.visualdevmodelApp; +import lombok.Data; + +@Data +public class AppDataInfoVO { + private String formData; + private String columnData; + private String tables; + private String webType; + private String flowTemplateJson; + private String flowEnCode; + private String flowId; + private String fullName; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/pom.xml b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/pom.xml new file mode 100644 index 0000000..c0a61c7 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-onlinedev/pom.xml @@ -0,0 +1,21 @@ + + + + jnpf-visualdev + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-visualdev-onlinedev + pom + + jnpf-visualdev-onlinedev-entity + jnpf-visualdev-onlinedev-biz + jnpf-visualdev-onlinedev-controller + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-biz/pom.xml b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-biz/pom.xml new file mode 100644 index 0000000..251ae70 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-biz/pom.xml @@ -0,0 +1,37 @@ + + + + jnpf-visualdev-portal + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-visualdev-portal-biz + + + + com.jnpf + jnpf-visualdev-portal-entity + ${project.version} + + + com.jnpf + jnpf-system-biz + ${project.version} + + + com.jnpf + jnpf-permission-biz + ${project.version} + + + com.jnpf + jnpf-visualdev-base-entity + ${project.version} + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-biz/src/main/java/jnpf/portal/mapper/PortalDataMapper.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-biz/src/main/java/jnpf/portal/mapper/PortalDataMapper.java new file mode 100644 index 0000000..12ddfb3 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-biz/src/main/java/jnpf/portal/mapper/PortalDataMapper.java @@ -0,0 +1,17 @@ +package jnpf.portal.mapper; + + +import jnpf.base.mapper.SuperMapper; +import jnpf.portal.entity.PortalDataEntity; + +/** + *

+ * Mapper 接口 + *

+ * + * @author YanYu + * @since 2023-04-19 + */ +public interface PortalDataMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-biz/src/main/java/jnpf/portal/mapper/PortalMapper.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-biz/src/main/java/jnpf/portal/mapper/PortalMapper.java new file mode 100644 index 0000000..a36c24c --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-biz/src/main/java/jnpf/portal/mapper/PortalMapper.java @@ -0,0 +1,16 @@ +package jnpf.portal.mapper; + +import jnpf.base.mapper.SuperMapper; +import jnpf.portal.entity.PortalEntity; + +/** + * + * base_portal + * 版本: V3.0.0 + * 版权: 引迈信息技术有限公司 + * 作者: 管理员/admin + * 日期: 2020-10-21 14:23:30 + */ +public interface PortalMapper extends SuperMapper { + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-biz/src/main/java/jnpf/portal/service/PortalDataService.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-biz/src/main/java/jnpf/portal/service/PortalDataService.java new file mode 100644 index 0000000..883ce34 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-biz/src/main/java/jnpf/portal/service/PortalDataService.java @@ -0,0 +1,70 @@ +package jnpf.portal.service; + +import jnpf.base.service.SuperService; +import jnpf.exception.WorkFlowException; +import jnpf.portal.entity.PortalDataEntity; +import jnpf.portal.model.*; + +import java.util.List; + +/** + * 门户数据接口 + * + * 后期门户模板数据,将会以platform再做区分, + * 故将formData抽离成单独的表 + * @author YanYu + * @since 2023-04-19 + */ +public interface PortalDataService extends SuperService { + + String getCustomDataForm(PortalCustomPrimary primary) throws Exception; + + String getModelDataForm(PortalModPrimary primary) throws Exception; + + /** + * 发布 + */ + void release(String platform, String portalId, String systemIdListStr,String releasePlatform) throws Exception; + + void releaseModule(ReleaseModel releaseModel,String portalId) throws Exception; + + Boolean isReleaseFlag(PortalReleasePrimary primary); + + Boolean deleteAll(String portalId); + + /** + * 创建或更新门户自定义信息 + */ + void createOrUpdate(PortalCustomPrimary primary, String formData) throws Exception; + + /** + * 创建或更新门户模板信息 + */ + void createOrUpdate(PortalModPrimary primary, String formData) throws Exception; + + /** + * 创建或更新门户发布信息 + */ + void createOrUpdate(PortalReleasePrimary primary, String formData) throws Exception; + + /** + * 获取门户显示信息 + * + * @param portalId 门户ID + * @param platform 平台:app/pc + */ + PortalInfoAuthVO getDataFormView(String portalId, String platform) throws Exception; + + /** + * 设置默认门户 + */ + void setCurrentDefault(String platform, String portalId); + + String getCurrentDefault(String platform) throws Exception; + + /** + * 获取当前带权限的portalIds + */ + List getCurrentAuthPortalIds(PortalViewPrimary primary); + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-biz/src/main/java/jnpf/portal/service/PortalService.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-biz/src/main/java/jnpf/portal/service/PortalService.java new file mode 100644 index 0000000..c673b95 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-biz/src/main/java/jnpf/portal/service/PortalService.java @@ -0,0 +1,68 @@ +package jnpf.portal.service; + +import jnpf.base.model.VisualFunctionModel; +import jnpf.base.service.SuperService; +import jnpf.portal.entity.PortalEntity; +import jnpf.portal.model.PortalPagination; +import jnpf.portal.model.PortalSelectModel; +import jnpf.portal.model.PortalSelectVO; +import jnpf.portal.model.PortalViewPrimary; + +import java.util.List; + + +/** + * base_portal + * 版本: V3.0.0 + * 版权: 引迈信息技术有限公司 + * 作者: 管理员/admin + * 日期: 2020-10-21 14:23:30 + */ + +public interface PortalService extends SuperService { + + PortalEntity getInfo(String id); + + /** + * 是否重名 + */ + Boolean isExistByFullName(String fullName, String id); + + /** + * 是否重码 + */ + Boolean isExistByEnCode(String encode, String id); + + void create(PortalEntity entity); + + Boolean update(String id, PortalEntity entity); + + void delete(PortalEntity entity) throws Exception; + + List getList(PortalPagination pagination); + + String getModListFirstId(PortalViewPrimary primary); + + List getModList(PortalViewPrimary primary); + + List getModSelectList(); + + /** + * 获取门户模型集合 + * + * @param pagination 分页信息 + * @return 模型集合 + */ + List getModelList(PortalPagination pagination); + + + /** + * 获取门户管理下拉 + * + * @param pagination 分页信息 + * @param systemId 系统ID + * @return 分页结婚 + */ + List getManageSelectorPage(PortalPagination pagination, String systemId); + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-biz/src/main/java/jnpf/portal/service/impl/PortalDataServiceImpl.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-biz/src/main/java/jnpf/portal/service/impl/PortalDataServiceImpl.java new file mode 100644 index 0000000..b587030 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-biz/src/main/java/jnpf/portal/service/impl/PortalDataServiceImpl.java @@ -0,0 +1,381 @@ +package jnpf.portal.service.impl; + +import cn.hutool.core.collection.CollectionUtil; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import jnpf.base.MyBatisPrimaryBase; +import jnpf.base.entity.PortalManageEntity; +import jnpf.base.model.online.VisualMenuModel; +import jnpf.base.model.portalManage.PortalManagePrimary; +import jnpf.base.model.portalManage.PortalManageVO; +import jnpf.base.service.ModuleService; +import jnpf.base.service.PortalManageService; +import jnpf.base.service.SuperServiceImpl; +import jnpf.base.util.visualUtil.PubulishUtil; +import jnpf.exception.WorkFlowException; +import jnpf.permission.entity.AuthorizeEntity; +import jnpf.permission.entity.PermissionGroupEntity; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.AuthorizeService; +import jnpf.permission.service.PermissionGroupService; +import jnpf.permission.service.RoleService; +import jnpf.permission.service.UserService; +import jnpf.portal.constant.PortalConst; +import jnpf.portal.entity.PortalDataEntity; +import jnpf.portal.entity.PortalEntity; +import jnpf.portal.mapper.PortalDataMapper; +import jnpf.portal.model.*; +import jnpf.portal.service.PortalDataService; +import jnpf.portal.service.PortalService; +import jnpf.util.JsonUtil; +import jnpf.util.JsonUtilEx; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.function.Supplier; +import java.util.stream.Collectors; + +/** + *

+ * 服务实现类 + *

+ * + * @author YanYu + * @since 2023-04-19 + */ +@Service +public class PortalDataServiceImpl extends SuperServiceImpl implements PortalDataService { + + @Autowired + private UserService userService; + @Autowired + private UserProvider userProvider; + @Autowired + private PortalService portalService; + @Autowired + private RoleService roleService; + @Autowired + private AuthorizeService authorizeService; + @Autowired + private PortalManageService portalManageApi; + @Autowired + private PermissionGroupService permissionGroupApi; + @Autowired + private ModuleService moduleService; + @Autowired + private PubulishUtil pubulishUtil; + + @Override + public String getCustomDataForm(PortalCustomPrimary primary) throws Exception { + PortalDataEntity one = getOne(primary.getQuery()); + if(one != null){ + return one.getFormData(); + }else { + save(primary.getEntity()); + } + return ""; + } + + @Override + public String getModelDataForm(PortalModPrimary primary) throws Exception { + PortalDataEntity one = getOne(primary.getQuery()); + if(one != null){ + return one.getFormData(); + }else { + save(primary.getEntity()); + } + return ""; + } + + @Override + public void release(String platform, String portalId, String systemIdListStr,String releasePlatform) throws Exception { + List systemIdList; + if(StringUtils.isNotEmpty(systemIdListStr)){ + systemIdList = Arrays.asList(systemIdListStr.split(",")); + // 系统管理对应添加绑定 + portalManageApi.createBatch(systemIdList.stream().map(systemId-> + new PortalManagePrimary(releasePlatform, portalId, systemId)).collect(Collectors.toList())); + }else { + List voList = portalManageApi.getList(new PortalManagePrimary(platform, portalId, null)); + if (voList.size() == 0) { + throw new WorkFlowException("未找到同步路径,请刷新界面"); + } + systemIdList = voList.stream().map(PortalManageVO::getSystemId).collect(Collectors.toList()); + } + String formData = ""; + try { + formData = getModelDataForm(new PortalModPrimary(portalId)); + createOrUpdate(new PortalReleasePrimary(portalId, platform), formData); + } catch (Exception e) { + e.printStackTrace(); + } + // 查询所有相关的自定义数据 + for (String systemId : systemIdList) { + List list = list(new PortalCustomPrimary(platform, portalId, systemId, null).getQuery()); + final String finalFormData = formData; + if(list.size() > 0){ + // 把所有数据进行重置formData + list.forEach(entity -> entity.setFormData(finalFormData)); + updateBatchById(list); + } + } + PortalEntity info = portalService.getInfo(portalId); + if(info!=null){ + info.setState(1); + info.setEnabledMark(1); + portalService.update(portalId,info); + } + } + + @Override + public void releaseModule(ReleaseModel releaseModel,String portalId) throws Exception { + PortalEntity info = portalService.getInfo(portalId); + if(info!=null) { + VisualMenuModel visual = new VisualMenuModel(); + visual.setApp(releaseModel.getApp()); + visual.setPc(releaseModel.getPc()); + visual.setAppModuleParentId(releaseModel.getAppModuleParentId()); + if (StringUtil.isNotEmpty(releaseModel.getPcModuleParentId()) && StringUtil.isEmpty(releaseModel.getPcSystemId())) { + visual.setPcModuleParentId("-1"); + } else { + visual.setPcModuleParentId(releaseModel.getPcModuleParentId()); + } + if (releaseModel.getPc() == 1) { + createOrUpdate(new PortalReleasePrimary(portalId, PortalConst.WEB), getModelDataForm(new PortalModPrimary(portalId))); + } else { + createOrUpdate(new PortalReleasePrimary(portalId, PortalConst.APP), getModelDataForm(new PortalModPrimary(portalId))); + } + visual.setPcSystemId(Optional.ofNullable(releaseModel.getPcSystemId()).orElse(releaseModel.getPcModuleParentId())); + visual.setAppSystemId(Optional.ofNullable(releaseModel.getAppSystemId()).orElse(releaseModel.getAppModuleParentId())); + visual.setType(8); + visual.setFullName(info.getFullName()); + visual.setEncode(info.getEnCode()); + visual.setId(info.getId()); + Integer integer = pubulishUtil.publishMenu(visual); + if (integer == 2) { + throw new WorkFlowException("同步失败,检查编码或名称是否重复" ); + } + if (integer == 3) { + throw new WorkFlowException("未找到同步路径,请刷新界面" ); + } + info.setState(1); + info.setEnabledMark(1); + portalService.update(portalId,info); + } + } + + @Override + public Boolean isReleaseFlag(PortalReleasePrimary primary) { + return count(primary.getQuery()) > 0; + } + + @Override + public Boolean deleteAll(String portalId) { + QueryWrapper query = new QueryWrapper<>(); + query.lambda().eq(PortalDataEntity::getPortalId, portalId); + return remove(query); + } + + /** + * 创建或更新 + * + * 门户ID ->(平台、系统ID、用户ID)-> 排版信息 + * 基础:门户ID绑定排版信息(一对多)、 条件:平台、系统ID、用户ID + */ + @Override + public void createOrUpdate(PortalCustomPrimary primary, String formData) throws Exception { + creUpCom(primary, formData); + } + + @Override + public void createOrUpdate(PortalModPrimary primary, String formData) throws Exception { + creUpCom(primary, formData); + } + + @Override + public void createOrUpdate(PortalReleasePrimary primary, String formData) throws Exception { + creUpCom(primary, formData); + } + + private void creUpCom(MyBatisPrimaryBase primary, String formData) throws Exception { + // 自定义数据变量条件:0、门户 1、用户 2、系统 3、平台 + List list = list(primary.getQuery()); + if(list.size() < 1){ + PortalDataEntity creEntity = primary.getEntity(); + creEntity.setFormData(formData); + save(creEntity); + }else if(list.size() == 1){ + PortalDataEntity upEntity = list.get(0); + upEntity.setFormData(formData); + updateById(upEntity); + }else { + throw new Exception("门户数据信息存在重复"); + } + } + + /** + * 根据id返回门户信息 + */ + @Override + public PortalInfoAuthVO getDataFormView(String portalId, String platform) throws Exception{ + PortalEntity entity = portalService.getInfo(portalId); + if (entity == null) throw new Exception("该门户已删除"); +// if (entity.getEnabledMark() == 0) throw new Exception("门户被禁止"); + PortalInfoAuthVO infoVo = JsonUtil.getJsonToBean(JsonUtilEx.getObjectToStringDateFormat + (entity, "yyyy-MM-dd HH:mm:ss"), PortalInfoAuthVO.class); + // 查询自定义设计的门户信息 + infoVo.setFormData(getDataForm(platform, portalId)); + return infoVo; + } + + private String getDataForm(String platform, String portalId) throws Exception { + List dataList = list(new PortalCustomPrimary(platform, portalId).getQuery()); + if(CollectionUtil.isEmpty(dataList)) dataList = list(new PortalReleasePrimary(portalId, platform).getQuery()); + // 当没有自定义的排版信息时,使用已发布模板排版信息 + if(CollectionUtil.isNotEmpty(dataList)){ + PortalDataEntity entity = dataList.get(0); + if (dataList.size() != 1) { + List ids = dataList.stream().map(PortalDataEntity::getId).collect(Collectors.toList()); + removeBatchByIds(ids.stream().filter(id -> !id.equals(entity.getId())).collect(Collectors.toList())); + } + return entity.getFormData(); + } + return null; + } + + /** + * 设置门户默认主页 + * + * 用户ID -> (平台、系统ID) -> 门户ID + * 基础:用户ID绑定门户ID(多对多)、条件:平台、系统ID + * Map格式:Map + * @param portalId 门户ID + * @param platform 平台 + */ + @Override + public void setCurrentDefault(String platform, String portalId) { + UserEntity userEntity = userService.getInfo(userProvider.get().getUserId()); + Map map = new HashMap<>(); + try{ + map = JSONObject.parseObject(userEntity.getPortalId()).getInnerMap(); + }catch (Exception ignore){} + map.put(platform + ":" + userEntity.getSystemId(), portalId); + UserEntity update = new UserEntity(); + update.setId(userEntity.getId()); + update.setPortalId(JSONObject.toJSONString(map)); + userService.updateById(update); + } + + @Override + public String getCurrentDefault(String platform) throws Exception { + UserEntity userEntity = userService.getInfo(userProvider.get().getUserId()); + String systemId = PortalConst.WEB.equals(platform) ? userProvider.get().getSystemId() : userProvider.get().getAppSystemId(); + String portalId = ""; + try{ + Map map = JSONObject.parseObject(userEntity.getPortalId()).getInnerMap(); + portalId = map.get(platform + ":" + systemId).toString(); + }catch (Exception ignore){} + PortalEntity mainPortal = portalService.getById(portalId); + // 校验门户有效性 + if(mainPortal != null && mainPortal.getEnabledMark().equals(1)){ + // 管理员直接设置默认主页 + List authPortalIds; + if(userProvider.get().getIsAdministrator()){ + List currentVoList = portalManageApi.getListByEnable(new PortalManagePrimary(platform, null, systemId)); + authPortalIds = currentVoList.stream().map(PortalManageVO::getPortalId).collect(Collectors.toList()); + }else { + // 获取当前用户的所有权限的门户ID集合 + authPortalIds = getCurrentAuthPortalIds(new PortalViewPrimary(platform, null)); + } + if(CollectionUtil.isNotEmpty(authPortalIds) && authPortalIds.contains(portalId)) { + return portalId; + } + } + // 重新设置默认门户 + String updatePortalId = portalService.getModListFirstId(new PortalViewPrimary(platform, null)); + setCurrentDefault(platform, updatePortalId); + return updatePortalId; + } + + /** + * 获取当下所有带权限PortalId集合 + */ + public List getCurrentAuthPortalIds(PortalViewPrimary primary){ + String userId = userProvider.get().getUserId(); + String systemId = userProvider.get().getSystemId(); + + // 获取用户底下所有权限portalManage + Supplier> authPortalManageIds = ()->{ + List roleIds = permissionGroupApi.getPermissionGroupByUserId(userId, null, false).stream().map(PermissionGroupEntity::getId).collect(Collectors.toList()); + List portalManageIds = new ArrayList<>(); + for (String roleId : roleIds) { + /* authorize存储 portalManage->item、role->object,本质:门户管理条目与角色关系 + 根据用户Id查询出对应所有的门户管理条目(distinct()进行去重) */ + List authorizePortalManage = authorizeService.getListByObjectId(roleId, PortalConst.AUTHORIZE_PORTAL_MANAGE); + portalManageIds.addAll(authorizePortalManage.stream() + .map(AuthorizeEntity::getItemId).distinct().collect(Collectors.toList())); + } + return portalManageIds; + }; + + List portalManageIds = authPortalManageIds.get(); + + Map> map = new HashMap<>(); + // 获取具有权限的所有门户 + if(portalManageIds.size() > 0) { + QueryWrapper query = new QueryWrapper<>(); + query.lambda().eq(PortalManageEntity::getEnabledMark, 1) + .eq(PortalManageEntity::getPlatform, primary.getPlatForm()) + .in(PortalManageEntity::getId, portalManageIds); + List portalManageList = portalManageApi.list(query); + Map> collect = portalManageList.stream().collect(Collectors.groupingBy(PortalManageEntity::getSystemId)); + // key:systemId 、 value:portalIdList + collect.forEach((key, description) -> map.put(key, description.stream().map(PortalManageEntity::getPortalId).collect(Collectors.toList()))); + return map.get(systemId); + }else { + return new ArrayList<>(); + } + } + + /* ============== 目前使用懒加载更新主页,故注释 =============== */ +// /** +// * 校验:当前用户的默认门户首页是否还具备权限 +// * (当权限被删除,默认首页丢失) +// */ +// private void checkDefaultPortal(List originRoleIds, List updateRoleIds, String portalManageId){ +// // 若是新增角色不会对默认门户产生影响 +// List delRoleIds = originRoleIds.stream().filter(o -> !updateRoleIds.contains(o)) +// .collect(Collectors.toList()); +// if(CollectionUtil.isNotEmpty(delRoleIds)){ +// // 授权取消所涉及到用户集合 +// List userList = userService.getListByRoleIds(delRoleIds); +// for (UserEntity userEntity : userList) { +// String userId = userEntity.getId(); +// // 获取各系统下带权限的门户ID(这里跨服务会产生数据不同步的问题) +// Map> authorizeSysPortalIdsMap = getAuthorizePortalIds(userId); +// // 获取原始各系统下默认门户ID +// Map sysDefaultPortalIdMap = portalManageService.getDefault(userEntity.getId()); +// for (Map.Entry defaultMap : sysDefaultPortalIdMap.entrySet()) { +// String systemId = defaultMap.getKey(); +// // 默认门户ID +// String defaultPortalId = defaultMap.getValue(); +// // 带权限门户ID +// List authorizePortalIds = authorizeSysPortalIdsMap.get(systemId); +// if(CollectionUtil.isNotEmpty(authorizePortalIds)){ +// if(!authorizePortalIds.contains(defaultPortalId)){ +// // 丢失默认门户,顺位首个 +// portalManageService.setDefault(userId, systemId, authorizePortalIds.get(0)); +// } +// } +// } +// } +// } +// } + + + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-biz/src/main/java/jnpf/portal/service/impl/PortalServiceImpl.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-biz/src/main/java/jnpf/portal/service/impl/PortalServiceImpl.java new file mode 100644 index 0000000..286c6f8 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-biz/src/main/java/jnpf/portal/service/impl/PortalServiceImpl.java @@ -0,0 +1,315 @@ +package jnpf.portal.service.impl; + + +import cn.hutool.core.collection.CollectionUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import jnpf.base.UserInfo; +import jnpf.base.entity.DictionaryDataEntity; +import jnpf.base.entity.ModuleEntity; +import jnpf.base.entity.PortalManageEntity; +import jnpf.base.model.VisualFunctionModel; +import jnpf.base.model.portalManage.PortalManagePage; +import jnpf.base.model.portalManage.PortalManagePageDO; +import jnpf.base.model.portalManage.PortalManagePrimary; +import jnpf.base.model.portalManage.PortalManageVO; +import jnpf.base.service.*; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.UserService; +import jnpf.portal.constant.PortalConst; +import jnpf.portal.entity.PortalEntity; +import jnpf.portal.mapper.PortalMapper; +import jnpf.portal.model.*; +import jnpf.portal.service.PortalDataService; +import jnpf.portal.service.PortalService; +import jnpf.util.*; +import jnpf.util.enums.DictionaryDataEnum; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/3/16 + */ +@Service +public class PortalServiceImpl extends SuperServiceImpl implements PortalService { + + @Autowired + private PortalService portalService; + @Autowired + private PortalManageService portalManageService; + @Autowired + private UserProvider userProvider; + @Autowired + private UserService userService; + @Autowired + private DictionaryDataService dictionaryDataService; + @Autowired + private DictionaryTypeService dictionaryTypeService; + @Autowired + private PortalDataService portalDataService; + @Autowired + private SystemService systemApi; + @Autowired + private ModuleService moduleApi; + + @Override + public List getList(PortalPagination portalPagination) { + return getList(portalPagination, new QueryWrapper<>()); + } + + public List getList(PortalPagination portalPagination, QueryWrapper queryWrapper) { + // 定义变量判断是否需要使用修改时间倒序 + boolean flag = false; + // 模糊查询 + if (!StringUtil.isEmpty(portalPagination.getKeyword())) { + flag = true; + queryWrapper.lambda().and(q-> q.like(PortalEntity::getFullName, portalPagination.getKeyword()).or() + .like(PortalEntity::getEnCode, portalPagination.getKeyword())); + } + // 分类(数据字典) + if (StringUtil.isNotEmpty(portalPagination.getCategory())) { + flag = true; + queryWrapper.lambda().eq(PortalEntity::getCategory, portalPagination.getCategory()); + } + // 类型(0-页面设计,1-自定义路径) + if (portalPagination.getType() != null) { + flag = true; + queryWrapper.lambda().eq(PortalEntity::getType, portalPagination.getType()); + } + // 锁定 + if (portalPagination.getEnabledLock() != null) { + flag = true; + queryWrapper.lambda().eq(PortalEntity::getEnabledLock, portalPagination.getEnabledLock()); + } + // 排序 + queryWrapper.lambda().orderByAsc(PortalEntity::getSortCode).orderByDesc(PortalEntity::getCreatorTime); + if (flag) { + queryWrapper.lambda().orderByDesc(PortalEntity::getLastModifyTime); + } + // 分页 + Page page = new Page<>(portalPagination.getCurrentPage(), portalPagination.getPageSize()); + IPage userPage = this.page(page, queryWrapper); + return portalPagination.setData(userPage.getRecords(), page.getTotal()); + } + + @Override + public PortalEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(PortalEntity::getId, id); + return this.getOne(queryWrapper); + } + + + @Override + public Boolean isExistByFullName(String fullName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(PortalEntity::getFullName, fullName); + return isExistCommon(queryWrapper, id); + } + + @Override + public Boolean isExistByEnCode(String enCode, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(PortalEntity::getEnCode, enCode); + return isExistCommon(queryWrapper, id); + } + + private Boolean isExistCommon(QueryWrapper queryWrapper, String id){ + if (!StringUtil.isEmpty(id)) queryWrapper.lambda().ne(PortalEntity::getId, id); + return this.count(queryWrapper) > 0; + } + + @Override + public void create(PortalEntity entity) { + if (StringUtil.isEmpty(entity.getId())) { + entity.setId(RandomUtil.uuId()); + } + entity.setState(0); + entity.setEnabledMark(0); + this.saveOrUpdate(entity); + } + + @Override + public Boolean update(String id, PortalEntity entity) { + entity.setId(id); + entity.setLastModifyTime(DateUtil.getNowDate()); + return this.updateById(entity); + } + + @Override + public void delete(PortalEntity entity) throws Exception{ + // 0、门户管理判断(已绑定系统不允许删除) + List portalManageList = portalManageService.getList(new PortalManagePrimary(null, entity.getId(), null)); + if (portalManageList.size() > 0) { + List sysNameList = portalManageList.stream().map(manage -> { + try{ + return systemApi.getInfo(manage.getSystemId()).getFullName(); + }catch (Exception ignore){ return ""; } + }).collect(Collectors.toList()); + String sysName = sysNameList.get(0); + StringBuffer buffer = new StringBuffer(); + buffer.append("此记录被\"【"+sysName+"】应用门户\"关联引用,不允许被删除"); + throw new Exception(buffer.toString()); + } + // 1、删除门户设置数据(数据删除可提示用户确认) + portalDataService.deleteAll(entity.getId()); + portalService.removeById(entity.getId()); + } + + @Override + public List getManageSelectorPage(PortalPagination pagination, String systemId) { + // 根据系统ID、平台获取 + List manageVOList = portalManageService.getList(new PortalManagePrimary(pagination.getPlatform(), null, systemId)); + Set usedPortalIds = manageVOList.stream().map(PortalManageVO::getPortalId).collect(Collectors.toSet()); + QueryWrapper query = new QueryWrapper<>(); + // 已绑定的门户,不再出现在下拉列表 + if(usedPortalIds.size() > 0) query.lambda().notIn(PortalEntity::getId, usedPortalIds); + query.lambda().eq(PortalEntity::getEnabledMark, 1); + List portalList = getList(pagination, query); + List voList = new ArrayList<>(); + portalList.forEach(entity->{ + PortalSelectVO vo = new PortalSelectVO(); + vo.setId(entity.getId()); + vo.setFullName(entity.getFullName()); + vo.setEnCode(entity.getEnCode()); + DictionaryDataEntity dicEntity = dictionaryDataService.getInfo(entity.getCategory()); + if(dicEntity!=null) { + vo.setCategory(dicEntity.getFullName()); + vo.setCategoryName(dicEntity.getFullName()); + vo.setCategoryId(dicEntity.getId()); + } + voList.add(vo); + }); + return voList; + } + + @Override + public String getModListFirstId(PortalViewPrimary primary){ + try{ + List modList = getModList(primary); + PortalSelectModel first = modList.stream().filter(mod -> mod.getParentId().equals("0")).findFirst().get(); + PortalSelectModel firstPortal = modList.stream().filter(mod -> mod.getParentId().equals(first.getId())).findFirst().get(); + return firstPortal.getId(); + }catch (Exception e){ + return ""; + } + } + + @Override + public List getModList(PortalViewPrimary primary) { + UserInfo userInfo = userProvider.get(); + List portalIds; + if(userInfo.getIsAdministrator()){ + portalIds = portalManageService.getListByEnable(new PortalManagePrimary(primary.getPlatForm(), null, primary.getSystemId())) + .stream().map(PortalManageVO::getPortalId).collect(Collectors.toList()); + }else { + portalIds = portalDataService.getCurrentAuthPortalIds(primary); + } + PortalManagePage page =new PortalManagePage(); + page.setEnabledMark(1); + page.setPlatform(primary.getPlatForm()); + page.setSystemId(primary.getSystemId()); + page.setState(0); + List selectList = portalManageService.getSelectList(page); + List resultList = new ArrayList<>(); + for (PortalManagePageDO portalManagePageDO : selectList) { + if(portalIds.contains(portalManagePageDO.getPortalId())){ + PortalEntity entity = new PortalEntity(); + entity.setId(portalManagePageDO.getPortalId()); + entity.setFullName(portalManagePageDO.getPortalName()); + entity.setCategory(portalManagePageDO.getCategoryId()); + resultList.add(entity); + } + } + if(CollectionUtil.isNotEmpty(portalIds)){ + return getModelList(resultList); + }else { + return new ArrayList<>(); + } + } + + @Override + public List getModSelectList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(PortalEntity::getEnabledMark,1); + List list = this.list(queryWrapper); + return getModelList(list); + } + + private List getModelList(List portalList){ + List modelList = JsonUtil.getJsonToList(portalList, PortalSelectModel.class); + // 外层菜单排序取数据字典 + List dictionaryList = dictionaryDataService + .getList(dictionaryTypeService.getInfoByEnCode(DictionaryDataEnum.VISUALDEV_PORTAL.getDictionaryTypeId()).getId()); + for (DictionaryDataEntity dictionary : dictionaryList) { + List models = modelList.stream().filter(model->model.getParentId().equals(dictionary.getId())).collect(Collectors.toList()); + if(models.size() > 0){ + PortalSelectModel model = new PortalSelectModel(); + model.setId(dictionary.getId()); + model.setFullName(dictionary.getFullName()); + model.setParentId("0"); + if (!modelList.contains(model)) { + modelList.add(model); + } + } + } + return modelList; + } + + @Override + public List getModelList(PortalPagination pagination) { + List data = portalService.getList(pagination); + List userId = data.stream().map(t -> t.getCreatorUserId()).collect(Collectors.toList()); + List lastUserId = data.stream().map(t -> t.getLastModifyUserId()).collect(Collectors.toList()); + List userEntities = userService.getUserName(userId); + List lastUserIdEntities = userService.getUserName(lastUserId); + List dictionList = dictionaryDataService.getList(dictionaryTypeService.getInfoByEnCode(DictionaryDataEnum.VISUALDEV_PORTAL.getDictionaryTypeId()).getId()); + List modelAll = new LinkedList<>(); + // 发布判断 + List isReleaseList = portalManageService.list(); + List portalIds = data.stream().map(PortalEntity::getId).collect(Collectors.toList()); + List moduleEntityList = moduleApi.getModuleByPortal(portalIds); +// Map moduleEntityMap = moduleApi.getModuleByPortal(portalIds).stream().collect(Collectors.toMap(ModuleEntity::getId, Function.identity())); + for (PortalEntity entity : data) { + VisualFunctionModel model = JsonUtil.getJsonToBean(entity, VisualFunctionModel.class); + model.setPcPortalIsRelease(isReleaseList.stream().anyMatch(vo-> vo.getPortalId().equalsIgnoreCase(entity.getId()) + && PortalConst.WEB.equalsIgnoreCase(vo.getPlatform())) ? 1 : 0); + model.setAppPortalIsRelease(isReleaseList.stream().anyMatch(vo-> vo.getPortalId().equalsIgnoreCase(entity.getId()) + && PortalConst.APP.equalsIgnoreCase(vo.getPlatform())) ? 1 : 0); + model.setPcIsRelease(moduleEntityList.stream().anyMatch(moduleEntity -> moduleEntity.getModuleId().equals(entity.getId()) && PortalConst.WEB.equals(moduleEntity.getCategory())) ? 1 :0); + model.setAppIsRelease(moduleEntityList.stream().anyMatch(moduleEntity -> moduleEntity.getModuleId().equals(entity.getId()) && PortalConst.APP.equals(moduleEntity.getCategory())) ? 1 :0); + DictionaryDataEntity dataEntity = dictionList.stream().filter(t -> t.getId().equals(entity.getCategory())).findFirst().orElse(null); + if (dataEntity != null) { + model.setCategory(dataEntity.getFullName()); + UserEntity creatorUser = userEntities.stream().filter(t -> t.getId().equals(model.getCreatorUserId())).findFirst().orElse(null); + if (creatorUser != null) { + model.setCreatorUser(creatorUser.getRealName() + "/" + creatorUser.getAccount()); + } else { + model.setCreatorUser(""); + } + UserEntity lastmodifyuser = lastUserIdEntities.stream().filter(t -> t.getId().equals(model.getLastModifyUserId())).findFirst().orElse(null); + if (lastmodifyuser != null) { + model.setLastModifyUser(lastmodifyuser.getRealName() + "/" + lastmodifyuser.getAccount()); + } else { + model.setLastModifyUser(""); + } + if (Objects.isNull(model.getSortCode())) { + model.setSortCode(0L); + } + model.setIsRelease(entity.getState()); + modelAll.add(model); + } + } + return modelAll.stream().sorted(Comparator.comparing(VisualFunctionModel::getSortCode)).collect(Collectors.toList()); + } + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-controller/pom.xml b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-controller/pom.xml new file mode 100644 index 0000000..22bdcff --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-controller/pom.xml @@ -0,0 +1,32 @@ + + + + jnpf-visualdev-portal + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-visualdev-portal-controller + + + + com.jnpf + jnpf-visualdev-portal-biz + ${project.version} + + + com.jnpf + jnpf-workflow-engine-biz + ${project.version} + + + com.jnpf + jnpf-extend-biz + ${project.version} + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-controller/src/main/java/jnpf/portal/controller/DashboardController.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-controller/src/main/java/jnpf/portal/controller/DashboardController.java new file mode 100644 index 0000000..42a9b72 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-controller/src/main/java/jnpf/portal/controller/DashboardController.java @@ -0,0 +1,157 @@ +package jnpf.portal.controller; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jnpf.base.ActionResult; +import jnpf.base.entity.DictionaryDataEntity; +import jnpf.base.entity.DictionaryTypeEntity; +import jnpf.base.service.DictionaryDataService; +import jnpf.base.service.DictionaryTypeService; +import jnpf.base.vo.ListVO; +import jnpf.engine.entity.FlowTaskEntity; +import jnpf.engine.model.flowtask.FlowTaskListModel; +import jnpf.engine.model.flowtask.PaginationFlowTask; +import jnpf.engine.service.FlowDelegateService; +import jnpf.engine.service.FlowTaskService; +import jnpf.message.entity.MessageEntity; +import jnpf.message.model.NoticeModel; +import jnpf.message.model.message.NoticeVO; +import jnpf.message.service.MessageService; +import jnpf.permission.entity.UserEntity; +import jnpf.permission.service.UserService; +import jnpf.portal.model.*; +import jnpf.service.EmailReceiveService; +import jnpf.util.JsonUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 主页控制器 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2019年9月27日 上午9:18 + */ +@Tag(name = "主页控制器", description = "Home") +@RestController +@RequestMapping("api/visualdev/Dashboard") +public class DashboardController { + @Autowired + private FlowTaskService flowTaskService; + @Autowired + private FlowDelegateService flowDelegateService; + @Autowired + private EmailReceiveService emailReceiveService; + @Autowired + private MessageService messageService; + + + + + + /** + * 获取我的待办 + * + * @return + */ + @Operation(summary = "获取我的待办") + @PostMapping("/FlowTodoCount") + public ActionResult getFlowTodoCount(@RequestBody FlowTodo flowTodo) { + FlowTodoCountVO vo = new FlowTodoCountVO(); + PaginationFlowTask pagination = new PaginationFlowTask(); + pagination.setIsPage(false); + List toBeReviewedList = flowTaskService.getWaitList(pagination); + if (flowTodo.getToBeReviewedType().size() > 0) { + toBeReviewedList = toBeReviewedList.stream().filter(t -> flowTodo.getToBeReviewedType().contains(t.getFlowCategory())).collect(Collectors.toList()); + } + vo.setToBeReviewed(toBeReviewedList.size()); + vo.setEntrust(flowDelegateService.getList().size()); + List flowDoneList = flowTaskService.getTrialList(pagination); + if (flowTodo.getFlowDoneType().size() > 0) { + flowDoneList = flowDoneList.stream().filter(t -> flowTodo.getFlowDoneType().contains(t.getFlowCategory())).collect(Collectors.toList()); + } + vo.setFlowDone(flowDoneList.size()); + List flowCirculate = flowTaskService.getCirculateList(pagination); + if (flowTodo.getFlowCirculateType().size() > 0) { + flowCirculate = flowCirculate.stream().filter(t -> flowTodo.getFlowCirculateType().contains(t.getFlowCategory())).collect(Collectors.toList()); + } + vo.setFlowCirculate(flowCirculate.size()); + return ActionResult.success(vo); + } + + /** + * 获取通知公告 + * + * @return + */ + @Operation(summary = "获取通知公告") + @PostMapping("/Notice") + public ActionResult getNotice(@RequestBody NoticeModel noticeModel) { + List list = JsonUtil.getJsonToList(messageService.getNoticeList(noticeModel.getTypeList()), NoticeVO.class); + ListVO voList = new ListVO(); + voList.setList(list); + return ActionResult.success(voList); + } + + /** + * 获取未读邮件 + * + * @return + */ + @Operation(summary = "获取未读邮件") + @GetMapping("/Email") + public ActionResult getEmail() { + List list = JsonUtil.getJsonToList(emailReceiveService.getDashboardReceiveList(), EmailVO.class); + ListVO voList = new ListVO<>(); + voList.setList(list); + return ActionResult.success(voList); + } + + /** + * 获取待办事项 + * + * @return + */ + @Operation(summary = "获取待办事项") + @GetMapping("/FlowTodo") + public ActionResult getFlowTodo() { + PaginationFlowTask pagination = new PaginationFlowTask(); + pagination.setPageSize(20L); + pagination.setCurrentPage(1L); + pagination.setDelegateType(false); + List taskList = flowTaskService.getWaitList(pagination); + List list = new LinkedList<>(); + for (FlowTaskListModel taskEntity : taskList) { + FlowTodoVO vo = JsonUtil.getJsonToBean(taskEntity, FlowTodoVO.class); + vo.setTaskNodeId(taskEntity.getThisStepId()); + vo.setTaskOperatorId(taskEntity.getId()); + vo.setType(2); + list.add(vo); + } + ListVO voList = new ListVO<>(); + voList.setList(list); + return ActionResult.success(voList); + } + + /** + * 获取我的待办事项 + * + * @return + */ + @Operation(summary = "获取我的待办事项") + @GetMapping("/MyFlowTodo") + public ActionResult getMyFlowTodo() { + PaginationFlowTask pagination = new PaginationFlowTask(); + pagination.setIsPage(false); + List list = JsonUtil.getJsonToList(flowTaskService.getWaitList(pagination), MyFlowTodoVO.class); + ListVO voList = new ListVO<>(); + voList.setList(list); + return ActionResult.success(voList); + } +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-controller/src/main/java/jnpf/portal/controller/PortalController.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-controller/src/main/java/jnpf/portal/controller/PortalController.java new file mode 100644 index 0000000..ebb9671 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-controller/src/main/java/jnpf/portal/controller/PortalController.java @@ -0,0 +1,305 @@ +package jnpf.portal.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.stp.StpUtil; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import jnpf.base.ActionResult; +import jnpf.base.controller.SuperController; +import jnpf.base.entity.ModuleEntity; +import jnpf.base.entity.PortalManageEntity; +import jnpf.base.model.VisualFunctionModel; +import jnpf.base.service.ModuleService; +import jnpf.base.service.PortalManageService; +import jnpf.base.vo.DownloadVO; +import jnpf.base.vo.ListVO; +import jnpf.base.vo.PageListVO; +import jnpf.base.vo.PaginationVO; +import jnpf.config.ConfigValueUtil; +import jnpf.constant.MsgCode; +import jnpf.emnus.ExportModelTypeEnum; +import jnpf.emnus.ModuleTypeEnum; +import jnpf.portal.constant.PortalConst; +import jnpf.portal.entity.PortalEntity; +import jnpf.portal.model.*; +import jnpf.portal.service.PortalDataService; +import jnpf.portal.service.PortalService; +import jnpf.util.*; +import jnpf.util.treeutil.SumTree; +import jnpf.util.treeutil.newtreeutil.TreeDotUtils; +import jnpf.util.treeutil.newtreeutil.TreeDotUtils2; +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; +import org.checkerframework.checker.units.qual.A; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import java.util.*; + +/** + * 可视化门户 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月27日 上午9:18 + */ +@Slf4j +@RestController +@Tag(name = "可视化门户" , description = "Portal" ) +@RequestMapping("/api/visualdev/Portal" ) +public class PortalController extends SuperController { + + @Autowired + private UserProvider userProvider; + @Autowired + private PortalService portalService; + @Autowired + private FileExport fileExport; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private PortalDataService portalDataService; + @Autowired + private PortalManageService portalManageService; + @Autowired + private ModuleService moduleApi; + + @Operation(summary = "门户列表" ) + @GetMapping + @SaCheckPermission("onlineDev.visualPortal" ) + public ActionResult list(PortalPagination portalPagination) { + List modelAll = portalService.getModelList(portalPagination); + PaginationVO paginationVO = JsonUtil.getJsonToBean(portalPagination, PaginationVO.class); + return ActionResult.page(modelAll, paginationVO); + } + + @Operation(summary = "门户树形列表" ) + @Parameters({ + @Parameter(name = "type" , description = "类型:0-门户设计,1-配置路径" ), + }) + @GetMapping("/Selector" ) + public ActionResult> listSelect(String platform,String type) { + List modelList = new ArrayList<>(); + if(StringUtil.isNotEmpty(type)){ + modelList.addAll(portalService.getModList(new PortalViewPrimary(platform, null))); + }else { + modelList.addAll(portalService.getModSelectList()); + } + List> sumTrees = TreeDotUtils2.convertListToTreeDot(modelList); + List jsonToList = JsonUtil.getJsonToList(sumTrees, PortalSelectVO.class); + return ActionResult.success(new ListVO<>(jsonToList)); + } + + @Operation(summary = "门户详情" ) + @Parameters({ + @Parameter(name = "id" , description = "主键" ), + }) + @GetMapping("/{id}" ) + public ActionResult info(@PathVariable("id" ) String id, String platform) throws Exception { + StpUtil.checkPermissionOr("onlineDev.visualPortal" , id); + PortalEntity entity = portalService.getInfo(id); + if (entity == null) { + return ActionResult.fail("数据不存在"); + } + PortalInfoVO vo = JsonUtil.getJsonToBean(JsonUtilEx.getObjectToStringDateFormat(entity, "yyyy-MM-dd HH:mm:ss" ), PortalInfoVO.class); + vo.setFormData(portalDataService.getModelDataForm(new PortalModPrimary(id))); + List isReleaseList = portalManageService.list(); + List moduleEntityList = moduleApi.getModuleByPortal(Collections.singletonList(id)); + vo.setPcPortalIsRelease(isReleaseList.stream().anyMatch(t-> t.getPortalId().equalsIgnoreCase(entity.getId()) + && PortalConst.WEB.equalsIgnoreCase(t.getPlatform())) ? 1 : 0); + vo.setAppPortalIsRelease(isReleaseList.stream().anyMatch(t-> t.getPortalId().equalsIgnoreCase(entity.getId()) + && PortalConst.APP.equalsIgnoreCase(t.getPlatform())) ? 1 : 0); + vo.setPcIsRelease(moduleEntityList.stream().anyMatch(moduleEntity -> moduleEntity.getModuleId().equals(entity.getId()) && PortalConst.WEB.equals(moduleEntity.getCategory())) ? 1 :0); + vo.setAppIsRelease(moduleEntityList.stream().anyMatch(moduleEntity -> moduleEntity.getModuleId().equals(entity.getId()) && PortalConst.APP.equals(moduleEntity.getCategory())) ? 1 :0); + return ActionResult.success(vo); + } + + @Operation(summary = "删除门户" ) + @Parameters({ + @Parameter(name = "id" , description = "主键" ), + }) + @DeleteMapping("/{id}" ) + @SaCheckPermission("onlineDev.visualPortal" ) + @DSTransactional + public ActionResult delete(@PathVariable("id" ) String id) { + PortalEntity entity = portalService.getInfo(id); + if (entity != null) { + try { + portalService.delete(entity); + } catch (Exception e) { + return ActionResult.fail(e.getMessage()); + } + } + return ActionResult.success(MsgCode.SU003.get()); + } + + @Operation(summary = "创建门户" ) + @PostMapping() + @SaCheckPermission("onlineDev.visualPortal" ) + @DSTransactional + public ActionResult create(@RequestBody @Valid PortalCrForm portalCrForm) throws Exception { + PortalEntity entity = JsonUtil.getJsonToBean(portalCrForm, PortalEntity.class); + entity.setId(RandomUtil.uuId()); + //判断名称是否重复 + if (portalService.isExistByFullName(entity.getFullName(), entity.getId())) { + return ActionResult.fail("门户" + MsgCode.EXIST001.get()); + } + //判断编码是否重复 + if (portalService.isExistByEnCode(entity.getEnCode(), entity.getId())) { + return ActionResult.fail("门户" + MsgCode.EXIST002.get()); + } + // 修改模板排版数据 + if(Objects.equals(entity.getType(),1)){ + entity.setEnabledLock(null); + } + // 修改模板排版数据 + portalService.create(entity); + portalDataService.createOrUpdate(new PortalModPrimary(entity.getId()), portalCrForm.getFormData()); + return ActionResult.success(MsgCode.SU001.get(), entity.getId()); + } + + @Operation(summary = "复制功能" ) + @Parameters({ + @Parameter(name = "id" , description = "主键" ), + }) + @PostMapping("/{id}/Actions/Copy" ) + @SaCheckPermission("onlineDev.visualPortal" ) + public ActionResult copyInfo(@PathVariable("id" ) String id) throws Exception { + PortalEntity entity = portalService.getInfo(id); + entity.setEnabledMark(0); + String copyNum = UUID.randomUUID().toString().substring(0, 5); + entity.setFullName(entity.getFullName() + ".副本" + copyNum); + entity.setLastModifyTime(null); + entity.setLastModifyUserId(null); + entity.setId(RandomUtil.uuId()); + entity.setEnCode(entity.getEnCode() + copyNum); + entity.setCreatorTime(new Date()); + entity.setCreatorUserId(userProvider.get().getUserId()); + PortalEntity entity1 = JsonUtil.getJsonToBean(entity, PortalEntity.class); + if (entity1.getEnCode().length() > 50 || entity1.getFullName().length() > 50) { + return ActionResult.fail("已到达该模板复制上限,请复制源模板" ); + } + portalService.create(entity1); + portalDataService.createOrUpdate(new PortalModPrimary(entity1.getId()), + portalDataService.getModelDataForm(new PortalModPrimary(id))); + return ActionResult.success(MsgCode.SU007.get()); + } + + @Operation(summary = "修改门户" ) + @Parameters({ + @Parameter(name = "id" , description = "主键" ), + }) + @PutMapping("/{id}" ) + @SaCheckPermission("onlineDev.visualPortal" ) + @DSTransactional + public ActionResult update(@PathVariable("id" ) String id, @RequestBody @Valid PortalUpForm portalUpForm) throws Exception { + PortalEntity originEntity = portalService.getInfo(portalUpForm.getId()); + //判断名称是否重复 + if (!originEntity.getFullName().equals(portalUpForm.getFullName()) && StringUtil.isNotEmpty(portalUpForm.getFullName())) { + if (portalService.isExistByFullName(portalUpForm.getFullName(), portalUpForm.getId())) { + return ActionResult.fail("门户" + MsgCode.EXIST001.get()); + } + } + //判断编码是否重复 + if (!originEntity.getEnCode().equals(portalUpForm.getEnCode()) && StringUtil.isNotEmpty(portalUpForm.getEnCode())) { + if (portalService.isExistByEnCode(portalUpForm.getEnCode(), portalUpForm.getId())) { + return ActionResult.fail("门户" + MsgCode.EXIST002.get()); + } + } + // 修改排版数据 + if(Objects.equals(portalUpForm.getType(),1)){ + portalUpForm.setEnabledLock(null); + } + //修改状态 + if(Objects.equals(originEntity.getState(),1)){ + originEntity.setState(2); + portalUpForm.setState(2); + } + // 修改排版数据 + portalDataService.createOrUpdate(new PortalModPrimary(portalUpForm.getId()), portalUpForm.getFormData()); + if (StringUtil.isNotEmpty(portalUpForm.getFullName()) && StringUtil.isNotEmpty(portalUpForm.getEnCode())) { + portalService.update(id, JsonUtil.getJsonToBean(portalUpForm, PortalEntity.class)); + }else { + portalService.update(id, originEntity); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + @Operation(summary = "门户导出" ) + @Parameters({ + @Parameter(name = "modelId" , description = "模板id" ), + }) + @PostMapping("/{modelId}/Actions/ExportData" ) + @SaCheckPermission("onlineDev.visualPortal" ) + public ActionResult exportFunction(@PathVariable("modelId" ) String modelId) throws Exception { + PortalEntity entity = portalService.getInfo(modelId); + if (entity != null) { + PortalExportDataVo vo = new PortalExportDataVo(); + BeanUtils.copyProperties(entity, vo); + vo.setId(null); + vo.setModelType(ExportModelTypeEnum.Portal.getMessage()); + vo.setFormData(portalDataService.getModelDataForm(new PortalModPrimary(entity.getId()))); + DownloadVO downloadVO = fileExport.exportFile(vo, configValueUtil.getTemporaryFilePath(), entity.getFullName(), ModuleTypeEnum.VISUAL_PORTAL.getTableName()); + return ActionResult.success(downloadVO); + } else { + return ActionResult.success("并无该条数据" ); + } + } + + @SneakyThrows + @Operation(summary = "门户导入" ) + @Parameters({ + @Parameter(name = "file" , description = "导入文件" ), + }) + @PostMapping(value = "/Model/Actions/ImportData" , consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + @SaCheckPermission("onlineDev.visualPortal" ) + public ActionResult importFunction(@RequestPart("file" ) MultipartFile multipartFile) throws Exception { + //判断是否为.json结尾 + if (FileUtil.existsSuffix(multipartFile, ModuleTypeEnum.VISUAL_PORTAL.getTableName())) { + return ActionResult.fail(MsgCode.IMP002.get()); + } + //获取文件内容 + String fileContent = FileUtil.getFileContent(multipartFile); + PortalExportDataVo vo = JsonUtil.getJsonToBean(fileContent, PortalExportDataVo.class); + if (vo.getModelType() == null || !vo.getModelType().equals(ExportModelTypeEnum.Portal.getMessage())) { + return ActionResult.fail("请导入对应功能的json文件" ); + } + //判断名称是否重复 + if (portalService.isExistByFullName(vo.getFullName(), null)) { + return ActionResult.fail("门户" + MsgCode.EXIST001.get()); + } + //判断编码是否重复 + if (portalService.isExistByEnCode(vo.getEnCode(), null)) { + return ActionResult.fail("门户" + MsgCode.EXIST002.get()); + } + PortalEntity entity = JsonUtil.getJsonToBean(fileContent, PortalEntity.class); + entity.setId(null); + entity.setEnabledMark(0); + entity.setSortCode(0l); + entity.setCreatorTime(new Date()); + entity.setCreatorUserId(userProvider.get().getUserId()); + entity.setLastModifyTime(null); + entity.setLastModifyUserId(null); + portalService.create(entity); + portalDataService.createOrUpdate(new PortalModPrimary(entity.getId()), vo.getFormData()); + return ActionResult.success(MsgCode.IMP001.get()); + } + + @Operation(summary = "门户管理下拉列表" ) + @GetMapping("/manage/Selector/{systemId}" ) + public ActionResult> getManageSelectorList(@PathVariable String systemId, PortalPagination portalPagination) { + portalPagination.setType(null); // 门户设计、配置路径。全选 + List voList = portalService.getManageSelectorPage(portalPagination, systemId); + PaginationVO paginationVO = JsonUtil.getJsonToBean(portalPagination, PaginationVO.class); + return ActionResult.page(voList, paginationVO); + } + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-controller/src/main/java/jnpf/portal/controller/PortalDataController.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-controller/src/main/java/jnpf/portal/controller/PortalDataController.java new file mode 100644 index 0000000..31bd729 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-controller/src/main/java/jnpf/portal/controller/PortalDataController.java @@ -0,0 +1,121 @@ +package jnpf.portal.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.stp.StpUtil; +import cn.hutool.core.collection.CollectionUtil; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import jnpf.base.ActionResult; +import jnpf.base.UserInfo; +import jnpf.base.controller.SuperController; +import jnpf.base.entity.PortalManageEntity; +import jnpf.base.model.portalManage.PortalManagePrimary; +import jnpf.base.model.portalManage.PortalManageVO; +import jnpf.base.service.PortalManageService; +import jnpf.base.service.SystemService; +import jnpf.constant.MsgCode; +import jnpf.permission.entity.AuthorizeEntity; +import jnpf.permission.service.AuthorizeService; +import jnpf.permission.service.UserService; +import jnpf.portal.constant.PortalConst; +import jnpf.portal.entity.PortalEntity; +import jnpf.portal.model.*; +import jnpf.portal.service.PortalDataService; +import jnpf.portal.service.PortalService; +import jnpf.util.CacheKeyUtil; +import jnpf.util.RedisUtil; +import jnpf.util.StringUtil; +import jnpf.util.UserProvider; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 可视化门户 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2019年9月27日 上午9:18 + */ +@Slf4j +@RestController +@Tag(name = "门户展示界面" , description = "Portal" ) +@RequestMapping("/api/visualdev/Portal" ) +public class PortalDataController extends SuperController { + @Autowired + private PortalDataService portalDataService; + + @Operation(summary = "设置默认门户" ) + @Parameters({ + @Parameter(name = "id" , description = "主键" ), + }) + @PutMapping("/{id}/Actions/SetDefault" ) + @SaCheckPermission("onlineDev.visualPortal" ) + @Transactional + public ActionResult SetDefault(@PathVariable("id") String id, String platform) { + portalDataService.setCurrentDefault(platform, id); + return ActionResult.success("设置成功" ); + } + + @Operation(summary = "门户自定义保存" ) + @Parameters({ + @Parameter(name = "id" , description = "主键" ), + }) + @PutMapping("/Custom/Save/{id}") + public ActionResult customSave(@PathVariable("id" ) String id, @RequestBody PortalDataForm portalDataForm) throws Exception { + StpUtil.checkPermissionOr("onlineDev.visualPortal" , id); + portalDataForm.setPortalId(id); + portalDataService.createOrUpdate( + new PortalCustomPrimary(portalDataForm.getPlatform(), portalDataForm.getPortalId()), + portalDataForm.getFormData()); + return ActionResult.success(MsgCode.SU002.getMsg()); + } + + @Operation(summary = "门户发布(同步)" ) + @Parameters({ + @Parameter(name = "portalId" , description = "门户主键" ), + }) + @PutMapping("/Actions/release/{portalId}" ) + @Transactional(rollbackFor = Exception.class) + public ActionResult release(@PathVariable("portalId") String portalId, @RequestBody @Valid PortalReleaseForm form) throws Exception { + if (form.getPcPortal() == 1) + portalDataService.release(PortalConst.WEB, portalId, form.getPcPortalSystemId(), PortalConst.WEB); + if (form.getAppPortal() == 1) + portalDataService.release(PortalConst.APP, portalId, form.getAppPortalSystemId(), PortalConst.APP); + + ReleaseModel releaseSystemModel = new ReleaseModel(); + releaseSystemModel.setPc(form.getPc()); + releaseSystemModel.setPcSystemId(form.getPcSystemId()); + releaseSystemModel.setPcModuleParentId(form.getPcModuleParentId()); + releaseSystemModel.setApp(form.getApp()); + releaseSystemModel.setAppSystemId(form.getAppSystemId()); + releaseSystemModel.setAppModuleParentId(form.getAppModuleParentId()); + portalDataService.releaseModule(releaseSystemModel,portalId); + + return ActionResult.success(MsgCode.SU011.get()); + } + + @Operation(summary = "个人门户详情" ) + @Parameters({ + @Parameter(name = "id" , description = "主键" ), + }) + @GetMapping("/{id}/auth" ) + public ActionResult infoAuth(@PathVariable("id" ) String id, String platform, String systemId) { + platform = platform.equalsIgnoreCase("pc") || platform.equalsIgnoreCase(PortalConst.WEB) ? PortalConst.WEB : PortalConst.APP; + try{ + return ActionResult.success(portalDataService.getDataFormView(id, platform)); + }catch (Exception e){ + return ActionResult.fail(e.getMessage()); + } + } + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/pom.xml b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/pom.xml new file mode 100644 index 0000000..65ea0eb --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/pom.xml @@ -0,0 +1,22 @@ + + + + jnpf-visualdev-portal + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-visualdev-portal-entity + + + + com.jnpf + jnpf-common-all + ${project.version} + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/constant/PortalConst.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/constant/PortalConst.java new file mode 100644 index 0000000..c7dc763 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/constant/PortalConst.java @@ -0,0 +1,37 @@ +package jnpf.portal.constant; + +/** + * 类功能 + * + * @author JNPF开发平台组 YanYu + * @version v3.4.6 + * @copyrignt 引迈信息技术有限公司 + * @date 2023-02-23 + */ +public class PortalConst { + + /* ========== platform ======== */ + + /** + * 网页端 + */ + public final static String PC = "pc"; + public final static String WEB = "Web"; + + /** + * 手机端 + */ + public final static String APP = "App"; + + /** + * 模板 + */ + public final static String MODEL = "model"; + public final static String CUSTOM = "custom"; + public final static String RELEASE = "release"; + + public final static String AUTHORIZE_PORTAL_MANAGE = "portalManage"; + + public final static String AUTHORIZE_PORTAL_ROLE = "role"; + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/entity/PortalDataEntity.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/entity/PortalDataEntity.java new file mode 100644 index 0000000..fa29791 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/entity/PortalDataEntity.java @@ -0,0 +1,45 @@ +package jnpf.portal.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.base.entity.SuperEntity; +import lombok.Data; + +import java.io.Serializable; + + +/** + *

+ * + *

+ * + * @author YanYu + * @since 2023-04-19 + */ +@Data +@TableName("base_portal_data") +@Schema(description = "PortalData对象") +public class PortalDataEntity extends SuperEntity implements Serializable { + + @Schema(description = "门户ID") + @TableField("F_PORTAL_ID") + private String portalId; + + @Schema(description = "PC:网页端 APP:手机端") + @TableField("F_PLATFORM") + private String platform; + + @Schema(description = "表单配置JSON") + @TableField("F_FORM_DATA") + private String formData; + + @Schema(description = "系统ID") + @TableField("F_SYSTEM_ID") + private String systemId; + + @Schema(description = "类型(mod:模型、custom:自定义)") + @TableField("F_TYPE") + private String type; + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/entity/PortalEntity.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/entity/PortalEntity.java new file mode 100644 index 0000000..6716860 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/entity/PortalEntity.java @@ -0,0 +1,51 @@ +package jnpf.portal.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.base.entity.SuperExtendEntity; +import lombok.Data; + +/** + * 门户 + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/3/16 + */ +@Data +@TableName("base_portal") +public class PortalEntity extends SuperExtendEntity.SuperExtendDEEntity { + + @Schema(description = "名称") + @TableField("F_FULL_NAME") + private String fullName; + + @Schema(description = "编码") + @TableField("F_EN_CODE") + private String enCode; + + @Schema(description = "分类(数据字典维护)") + @TableField("F_CATEGORY") + private String category; + + @Schema(description = "类型(0-页面设计,1-自定义路径)") + @TableField("F_TYPE") + private Integer type; + + @Schema(description = "静态页面路径") + @TableField("F_CUSTOM_URL") + private String customUrl; + + @Schema(description = "类型(0-页面,1-外链)") + @TableField("F_LINK_TYPE") + private Integer linkType; + + @TableField("F_STATE") + private Integer state; + + @Schema(description = "移动锁定(0-未锁定,1-锁定)") + @TableField("F_ENABLED_LOCK") + private Integer enabledLock; + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/EmailVO.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/EmailVO.java new file mode 100644 index 0000000..bd1fe4c --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/EmailVO.java @@ -0,0 +1,12 @@ +package jnpf.portal.model; + +import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; + +@Data +public class EmailVO { + private String id; + @JSONField(name="subject") + private String fullName; + private Long creatorTime; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/FlowTodo.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/FlowTodo.java new file mode 100644 index 0000000..dc45482 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/FlowTodo.java @@ -0,0 +1,12 @@ +package jnpf.portal.model; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class FlowTodo { + private List toBeReviewedType = new ArrayList<>(); + private List flowDoneType = new ArrayList<>(); + private List flowCirculateType = new ArrayList<>(); +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/FlowTodoCountVO.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/FlowTodoCountVO.java new file mode 100644 index 0000000..ec9e55c --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/FlowTodoCountVO.java @@ -0,0 +1,10 @@ +package jnpf.portal.model; +import lombok.Data; + +@Data +public class FlowTodoCountVO { + private Integer toBeReviewed; + private Integer entrust; + private Integer flowDone; + private Integer flowCirculate; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/FlowTodoVO.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/FlowTodoVO.java new file mode 100644 index 0000000..4ba0980 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/FlowTodoVO.java @@ -0,0 +1,35 @@ +package jnpf.portal.model; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @date 2021/3/16 8:49 + */ +@Data +public class FlowTodoVO { + public String id; + + public String fullName; + + public String enCode; + + public String flowId; + + public Integer formType; + + public Integer status; + + public String processId; + + public String taskNodeId; + + public String taskOperatorId; + + public Long creatorTime; + + public Integer type; + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/MyFlowTodoVO.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/MyFlowTodoVO.java new file mode 100644 index 0000000..8ae99ec --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/MyFlowTodoVO.java @@ -0,0 +1,11 @@ +package jnpf.portal.model; +import lombok.Data; + +@Data +public class MyFlowTodoVO { + private String id; + private Integer enabledMark; + private Long startTime; + private Long endTime; + private String content; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalCrForm.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalCrForm.java new file mode 100644 index 0000000..de41494 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalCrForm.java @@ -0,0 +1,43 @@ +package jnpf.portal.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2020-10-21 14:23:30 + */ +@Data +@Schema(description="门户创建表单") +public class PortalCrForm { + + @Schema(description = "名称") + private String fullName; + @Schema(description = "编码") + private String enCode; + @Schema(description = "是否启用") + private Integer enabledMark; + @Schema(description = "描述") + private String description; + @Schema(description = "表单数据json") + private String formData; + @Schema(description = "分类") + private String category; + @Schema(description = "排序") + private Long sortCode; + @Schema(description = "类型:0-门户设计,1-配置路径") + private Integer type; + @Schema(description = "配置路径") + private String customUrl; + @Schema(description = "链接路径") + private String appCustomUrl; + @Schema(description = "链接类型") + private Integer linkType; + @Schema(description = "锁定开关0-未锁定,1-锁定") + private Integer enabledLock; + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalCustomPrimary.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalCustomPrimary.java new file mode 100644 index 0000000..1df02b0 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalCustomPrimary.java @@ -0,0 +1,58 @@ +package jnpf.portal.model; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import jnpf.base.MyBatisPrimaryBase; +import jnpf.base.UserInfo; +import jnpf.portal.constant.PortalConst; +import jnpf.portal.entity.PortalDataEntity; +import jnpf.util.UserProvider; +import jnpf.util.context.SpringContext; +import lombok.Data; + +/** + * 类功能 + * + * @author JNPF开发平台组 YanYu + * @version v3.4.8 + * @copyrignt 引迈信息技术有限公司 + * @date 2023-04-21 + */ +@Data +public class PortalCustomPrimary extends MyBatisPrimaryBase { + + /** 平台 */ + private String platform = PortalConst.WEB; + /** 门户ID */ + private String portalId; + /** 系统ID */ + private String systemId; + /** 用户ID */ + private String creatorId; + /** 类型(mod:模型、custom:自定义) */ + private String type = PortalConst.CUSTOM; + + public PortalCustomPrimary(String platform, String portalId, String systemId, String userId) { + if(platform != null) this.platform = platform; + this.portalId = portalId; + this.systemId = systemId; + this.creatorId = userId; + } + + public PortalCustomPrimary(String platform, String portalId){ + if(platform != null) this.platform = platform; + this.portalId = portalId; + UserInfo userInfo = SpringContext.getBean(UserProvider.class).get(); + this.systemId = userInfo.getSystemId(); + this.creatorId = userInfo.getUserId(); + } + + public QueryWrapper getQuery(){ + queryWrapper.lambda().eq(PortalDataEntity::getType, type); + if(this.platform != null) queryWrapper.lambda().eq(PortalDataEntity::getPlatform, platform); + if(this.portalId != null) queryWrapper.lambda().eq(PortalDataEntity::getPortalId, portalId); + if(this.systemId != null) queryWrapper.lambda().eq(PortalDataEntity::getSystemId, systemId); + if(this.creatorId != null) queryWrapper.lambda().eq(PortalDataEntity::getCreatorUserId, creatorId); + return queryWrapper; + } + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalDataForm.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalDataForm.java new file mode 100644 index 0000000..af95e15 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalDataForm.java @@ -0,0 +1,26 @@ +package jnpf.portal.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 类功能 + * + * @author JNPF开发平台组 YanYu + * @version v3.4.8 + * @copyrignt 引迈信息技术有限公司 + * @date 2023-04-19 + */ +@Data +public class PortalDataForm { + + @Schema(description = "门户id") + private String portalId; + + @Schema(description = "PC:网页端 APP:手机端 ") + private String platform; + + @Schema(description = "PC:网页端 APP:手机端 ") + private String formData; + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalDefaultDTO.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalDefaultDTO.java new file mode 100644 index 0000000..35e5482 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalDefaultDTO.java @@ -0,0 +1,28 @@ +package jnpf.portal.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 类功能 + * + * @author JNPF开发平台组 YanYu + * @version v3.4.6 + * @copyrignt 引迈信息技术有限公司 + * @date 2023-03-24 + */ +@Data +public class PortalDefaultDTO { + + @Schema(description = "默认门户ID") + private String defaultPortalId; + + @Schema(description = "系统ID") + private String systemId; + + public PortalDefaultDTO(){ + + } + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalExportDataVo.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalExportDataVo.java new file mode 100644 index 0000000..e9dfc62 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalExportDataVo.java @@ -0,0 +1,56 @@ +package jnpf.portal.model; +import lombok.Data; + +import java.util.Date; + +/** + * 门户导入导出 + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/7/15 + */ +@Data +public class PortalExportDataVo { + + private String id; + + private String description; + + private Long sortCode; + + private Integer enabledMark; + + private Date creatorTime; + + private String creatorUser; + + private Date lastModifyTime; + + private String lastModifyUser; + + private Integer deleteMark; + + private Date deleteTime; + + private String deleteUserId; + + private String fullName; + + private String enCode; + + private String category; + + private String formData; + + private Integer type; + + private String customUrl; + + private Integer linkType; + + private String modelType; + + private Integer enabledLock; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalInfoAuthVO.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalInfoAuthVO.java new file mode 100644 index 0000000..a3f0e94 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalInfoAuthVO.java @@ -0,0 +1,29 @@ +package jnpf.portal.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @author JNPF开发平台组 + * @date 2021/3/16 + */ +@Data +@Schema(description="门户信息") +public class PortalInfoAuthVO { + @Schema(description = "表单josn") + private String formData; + @Schema(description = "门户类型0-用户配置1-自定义外链") + private Integer type; + @Schema(description = "链接路径") + private String customUrl; + @Schema(description = "链接路径") + private String appCustomUrl; + @Schema(description = "链接类型") + private Integer linkType; + @Schema(description = "锁定开关0-未锁定1锁定") + private Integer enabledLock; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalInfoVO.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalInfoVO.java new file mode 100644 index 0000000..265cd90 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalInfoVO.java @@ -0,0 +1,28 @@ +package jnpf.portal.model; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @author 管理员/admin + * @date 2020-10-21 14:23:30 + */ +@Data +public class PortalInfoVO extends PortalCrForm { + + private String id; + + @Schema(description = "pc发布标识") + Integer pcIsRelease; + @Schema(description = "app发布标识") + Integer appIsRelease; + + @Schema(description = "pc是否发布门户" ) + private Integer pcPortalIsRelease; + @Schema(description = "app是否发布门户" ) + private Integer appPortalIsRelease; + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalListModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalListModel.java new file mode 100644 index 0000000..266526f --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalListModel.java @@ -0,0 +1,26 @@ +package jnpf.portal.model; + +import lombok.Data; + +/** + * 可视化列表模型 + * + * @author JNPF开发平台组 + * @version V3.2.8 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2021/11/20 + */ +@Data +public class PortalListModel { + private String category; + private Long creatorTime; + private String creatorUser; + private String enCode; + private Integer enabledMark; + private String fullName; + private String id; + private Integer type; + private Long lastModifyTime; + private String lastModifyUser; + private Long sortCode; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalListVO.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalListVO.java new file mode 100644 index 0000000..eb9c74c --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalListVO.java @@ -0,0 +1,28 @@ +package jnpf.portal.model; +import lombok.Data; + +import java.util.List; + +/** + * + * + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + * @author 管理员/admin + * @date 2020-10-21 14:23:30 + */ +@Data +public class PortalListVO{ + private String id; + private Long num; + private String fullName; + private String enCode; + private Integer enabledMark; + private Long creatorTime; + private String creatorUser; + private Long lastModifyTime; + private String lastModifyUser; + private Long sortCode; + private List children; + private Integer enabledLock; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalModPrimary.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalModPrimary.java new file mode 100644 index 0000000..33e0810 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalModPrimary.java @@ -0,0 +1,40 @@ +package jnpf.portal.model; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import jnpf.base.MyBatisPrimaryBase; +import jnpf.portal.constant.PortalConst; +import jnpf.portal.entity.PortalDataEntity; +import lombok.Data; + +/** + * 类功能 + * + * @author JNPF开发平台组 YanYu + * @version v3.4.8 + * @copyrignt 引迈信息技术有限公司 + * @date 2023-04-21 + */ +@Data +public class PortalModPrimary extends MyBatisPrimaryBase { + + /** + * 门户ID + */ + private String portalId; + + /** + * 类型(model:模型、custom:自定义) + */ + private String type = PortalConst.MODEL; + + public PortalModPrimary(String portalId){ + this.portalId = portalId; + } + + public QueryWrapper getQuery(){ + queryWrapper.lambda().eq(PortalDataEntity::getType, type); + if(this.portalId != null) queryWrapper.lambda().eq(PortalDataEntity::getPortalId, portalId); + return queryWrapper; + } + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalPagination.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalPagination.java new file mode 100644 index 0000000..70b85eb --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalPagination.java @@ -0,0 +1,30 @@ +package jnpf.portal.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import jnpf.base.Pagination; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2020-10-21 14:23:30 + */ +@Data +@Schema(description="查询条件") +public class PortalPagination extends Pagination { + + @Schema(description = "分类(字典)") + private String category; + + @Schema(description = "类型(0-门户设计,1-配置路径)") + private Integer type; + + @Schema(description = "锁定(0-禁用,1-启用)") + private Integer enabledLock; + + @Schema(description = "平台") + private String platform = "web"; + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalReleaseForm.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalReleaseForm.java new file mode 100644 index 0000000..e362c32 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalReleaseForm.java @@ -0,0 +1,28 @@ +package jnpf.portal.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 发布(同步)表单 + * + * @author JNPF开发平台组 YanYu + * @version v3.4.6 + * @copyrignt 引迈信息技术有限公司 + * @date 2023-02-23 + */ +@Data +@Schema(description="门户创建表单") +public class PortalReleaseForm extends ReleaseModel { + + @Schema(description = "pc标识") + private Integer pcPortal; + @Schema(description = "pc应用集合") + private String pcPortalSystemId; + @Schema(description = "app标识") + private Integer appPortal; + @Schema(description = "pc应用集合") + private String appPortalSystemId; + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalReleasePrimary.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalReleasePrimary.java new file mode 100644 index 0000000..87368db --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalReleasePrimary.java @@ -0,0 +1,44 @@ +package jnpf.portal.model; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import jnpf.base.MyBatisPrimaryBase; +import jnpf.portal.constant.PortalConst; +import jnpf.portal.entity.PortalDataEntity; +import lombok.Data; + +/** + * 类功能 + * + * @author JNPF开发平台组 YanYu + * @version v3.4.8 + * @copyrignt 引迈信息技术有限公司 + * @date 2023-04-21 + */ +@Data +public class PortalReleasePrimary extends MyBatisPrimaryBase { + + /** + * 门户ID + */ + private String portalId; + + private String platform; + + /** + * 类型(model:模型、custom:自定义、release:发布) + */ + private String type = PortalConst.RELEASE; + + public PortalReleasePrimary(String portalId, String platform){ + this.portalId = portalId; + this.platform = platform; + } + + public QueryWrapper getQuery(){ + queryWrapper.lambda().eq(PortalDataEntity::getType, type); + if(this.portalId != null) queryWrapper.lambda().eq(PortalDataEntity::getPortalId, portalId); + if(this.platform != null) queryWrapper.lambda().eq(PortalDataEntity::getPlatform, platform); + return queryWrapper; + } + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalReleaseVO.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalReleaseVO.java new file mode 100644 index 0000000..0de2b26 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalReleaseVO.java @@ -0,0 +1,22 @@ +package jnpf.portal.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 类功能 + * + * @author JNPF开发平台组 YanYu + * @version v3.4.8 + * @copyrignt 引迈信息技术有限公司 + * @date 2023-04-23 + */ +@Data +public class PortalReleaseVO { + + @Schema(description = "pc发布标识") + Integer pcIsRelease; + @Schema(description = "app发布标识") + Integer appIsRelease; + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalSelectModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalSelectModel.java new file mode 100644 index 0000000..484f6d4 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalSelectModel.java @@ -0,0 +1,20 @@ +package jnpf.portal.model; + +import com.alibaba.fastjson.annotation.JSONField; +import jnpf.util.treeutil.SumTree; +import lombok.Data; + +/** + * + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @author JNPF开发平台组 + * @date 2021/3/16 + */ +@Data +public class PortalSelectModel extends SumTree { + private String fullName; + private Long sortCode; + @JSONField(name="category") + private String parentId; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalSelectVO.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalSelectVO.java new file mode 100644 index 0000000..d5751da --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalSelectVO.java @@ -0,0 +1,34 @@ +package jnpf.portal.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @author JNPF开发平台组 + * @date 2021/3/16 + */ +@Data +public class PortalSelectVO { + private String id; + private List children; + private Boolean hasChildren; + private String parentId; + private Long sortCode; + + @Schema(description = "门户名") + private String fullName; + @Schema(description = "编码") + private String enCode; + @Schema(description = "字典类型") + private String category; + @Schema(description = "分类ID") + private String categoryId; + @Schema(description = "分类名") + private String categoryName; + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalTreeModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalTreeModel.java new file mode 100644 index 0000000..48a2fff --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalTreeModel.java @@ -0,0 +1,23 @@ +package jnpf.portal.model; + +import jnpf.util.treeutil.SumTree; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司 + */ +@Data +public class PortalTreeModel extends SumTree { + private String fullName; + private Long num; + private String enCode; + private Long creatorTime; + private Integer enabledMark; + private String creatorUser; + private Long lastModifyTime; + private String lastModifyUser; + private Long sortCode; +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalUpForm.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalUpForm.java new file mode 100644 index 0000000..d8bbbb2 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalUpForm.java @@ -0,0 +1,28 @@ +package jnpf.portal.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author JNPF开发平台组 + * @version V3.1.0 + * @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com) + * @date 2020-10-21 14:23:30 + */ +@Data +@Schema(description="门户修改表单") +public class PortalUpForm extends PortalCrForm { + + @Schema(description = "门户id") + private String id; + + @Schema(description = "PC:网页端 APP:手机端 ") + String platform; + + @Schema(description = "PC:网页端 APP:手机端 ") + Integer state; + + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalViewPrimary.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalViewPrimary.java new file mode 100644 index 0000000..d701aee --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/PortalViewPrimary.java @@ -0,0 +1,37 @@ +package jnpf.portal.model; + +import jnpf.base.MyBatisPrimaryBase; +import jnpf.base.UserInfo; +import jnpf.portal.constant.PortalConst; +import jnpf.portal.entity.PortalEntity; +import jnpf.util.UserProvider; +import lombok.Data; + +/** + * 类功能 + * + * @author JNPF开发平台组 YanYu + * @version v3.4.8 + * @copyrignt 引迈信息技术有限公司 + * @date 2023-04-21 + */ +@Data +public class PortalViewPrimary extends MyBatisPrimaryBase { + + private String creatorId; + + private String portalId; + + private String platForm = PortalConst.WEB; + + private String systemId; + + public PortalViewPrimary(String platForm, String portalId){ + if(platForm != null) this.platForm = platForm; + this.portalId = portalId; + UserInfo userInfo = UserProvider.getUser(); + this.systemId = PortalConst.WEB.equals(platForm) ? userInfo.getSystemId() : userInfo.getAppSystemId(); + this.creatorId = userInfo.getId(); + } + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/ReleaseModel.java b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/ReleaseModel.java new file mode 100644 index 0000000..4ffe763 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/jnpf-visualdev-portal-entity/src/main/java/jnpf/portal/model/ReleaseModel.java @@ -0,0 +1,23 @@ +package jnpf.portal.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class ReleaseModel { + @Schema(description = "pc标识") + private Integer pc; + @Schema(description = "pc应用集合") + private String pcSystemId; + @Schema(description = "app标识") + private Integer app; + @Schema(description = "pc应用集合") + private String appSystemId; + + + @Schema(description = "app上级菜单") + private String appModuleParentId; + @Schema(description = "pc上级菜单") + private String pcModuleParentId; + +} diff --git a/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/pom.xml b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/pom.xml new file mode 100644 index 0000000..b59961c --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/jnpf-visualdev-portal/pom.xml @@ -0,0 +1,21 @@ + + + + jnpf-visualdev + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-visualdev-portal + pom + + jnpf-visualdev-portal-entity + jnpf-visualdev-portal-biz + jnpf-visualdev-portal-controller + + + + \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-visualdev/pom.xml b/jnpf-java-boot/jnpf-visualdev/pom.xml new file mode 100644 index 0000000..c261004 --- /dev/null +++ b/jnpf-java-boot/jnpf-visualdev/pom.xml @@ -0,0 +1,23 @@ + + + + jnpf-java-boot + com.jnpf + 3.5.0-RELEASE + + 4.0.0 + + jnpf-visualdev + pom + + jnpf-visualdev-base + jnpf-visualdev-onlinedev + jnpf-visualdev-generater + jnpf-visualdev-portal + jnpf-visualdev-integrate + + + + diff --git a/jnpf-java-boot/jnpf-web/.editorconfig b/jnpf-java-boot/jnpf-web/.editorconfig new file mode 100644 index 0000000..3454886 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/.editorconfig @@ -0,0 +1,14 @@ +# https://editorconfig.org +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +insert_final_newline = false +trim_trailing_whitespace = false diff --git a/jnpf-java-boot/jnpf-web/.env.development b/jnpf-java-boot/jnpf-web/.env.development new file mode 100644 index 0000000..fb22a87 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/.env.development @@ -0,0 +1,3 @@ +# 开发 +VUE_APP_BASE_API = '/dev' +VUE_CLI_BABEL_TRANSPILE_MODULES = true diff --git a/jnpf-java-boot/jnpf-web/.env.production b/jnpf-java-boot/jnpf-web/.env.production new file mode 100644 index 0000000..308c1e1 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/.env.production @@ -0,0 +1,5 @@ +# 生产默认配置 +ENV = 'production' + +VUE_APP_BASE_API = '' + diff --git a/jnpf-java-boot/jnpf-web/.eslintignore b/jnpf-java-boot/jnpf-web/.eslintignore new file mode 100644 index 0000000..c20c344 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/.eslintignore @@ -0,0 +1,5 @@ +build/*.js +src/assets +public +dist +src \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/.eslintrc.js b/jnpf-java-boot/jnpf-web/.eslintrc.js new file mode 100644 index 0000000..c977505 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/.eslintrc.js @@ -0,0 +1,198 @@ +module.exports = { + root: true, + parserOptions: { + parser: 'babel-eslint', + sourceType: 'module' + }, + env: { + browser: true, + node: true, + es6: true, + }, + extends: ['plugin:vue/recommended', 'eslint:recommended'], + + // add your custom rules here + //it is base on https://github.com/vuejs/eslint-config-vue + rules: { + "vue/max-attributes-per-line": [2, { + "singleline": 10, + "multiline": { + "max": 1, + "allowFirstLine": false + } + }], + "vue/singleline-html-element-content-newline": "off", + "vue/multiline-html-element-content-newline":"off", + "vue/name-property-casing": ["error", "PascalCase"], + "vue/no-v-html": "off", + 'accessor-pairs': 2, + 'arrow-spacing': [2, { + 'before': true, + 'after': true + }], + 'block-spacing': [2, 'always'], + 'brace-style': [2, '1tbs', { + 'allowSingleLine': true + }], + 'camelcase': [0, { + 'properties': 'always' + }], + 'comma-dangle': [2, 'never'], + 'comma-spacing': [2, { + 'before': false, + 'after': true + }], + 'comma-style': [2, 'last'], + 'constructor-super': 2, + 'curly': [2, 'multi-line'], + 'dot-location': [2, 'property'], + 'eol-last': 2, + 'eqeqeq': ["error", "always", {"null": "ignore"}], + 'generator-star-spacing': [2, { + 'before': true, + 'after': true + }], + 'handle-callback-err': [2, '^(err|error)$'], + 'indent': [2, 2, { + 'SwitchCase': 1 + }], + 'jsx-quotes': [2, 'prefer-single'], + 'key-spacing': [2, { + 'beforeColon': false, + 'afterColon': true + }], + 'keyword-spacing': [2, { + 'before': true, + 'after': true + }], + 'new-cap': [2, { + 'newIsCap': true, + 'capIsNew': false + }], + 'new-parens': 2, + 'no-array-constructor': 2, + 'no-caller': 2, + 'no-console': 'off', + 'no-class-assign': 2, + 'no-cond-assign': 2, + 'no-const-assign': 2, + 'no-control-regex': 0, + 'no-delete-var': 2, + 'no-dupe-args': 2, + 'no-dupe-class-members': 2, + 'no-dupe-keys': 2, + 'no-duplicate-case': 2, + 'no-empty-character-class': 2, + 'no-empty-pattern': 2, + 'no-eval': 2, + 'no-ex-assign': 2, + 'no-extend-native': 2, + 'no-extra-bind': 2, + 'no-extra-boolean-cast': 2, + 'no-extra-parens': [2, 'functions'], + 'no-fallthrough': 2, + 'no-floating-decimal': 2, + 'no-func-assign': 2, + 'no-implied-eval': 2, + 'no-inner-declarations': [2, 'functions'], + 'no-invalid-regexp': 2, + 'no-irregular-whitespace': 2, + 'no-iterator': 2, + 'no-label-var': 2, + 'no-labels': [2, { + 'allowLoop': false, + 'allowSwitch': false + }], + 'no-lone-blocks': 2, + 'no-mixed-spaces-and-tabs': 2, + 'no-multi-spaces': 2, + 'no-multi-str': 2, + 'no-multiple-empty-lines': [2, { + 'max': 1 + }], + 'no-native-reassign': 2, + 'no-negated-in-lhs': 2, + 'no-new-object': 2, + 'no-new-require': 2, + 'no-new-symbol': 2, + 'no-new-wrappers': 2, + 'no-obj-calls': 2, + 'no-octal': 2, + 'no-octal-escape': 2, + 'no-path-concat': 2, + 'no-proto': 2, + 'no-redeclare': 2, + 'no-regex-spaces': 2, + 'no-return-assign': [2, 'except-parens'], + 'no-self-assign': 2, + 'no-self-compare': 2, + 'no-sequences': 2, + 'no-shadow-restricted-names': 2, + 'no-spaced-func': 2, + 'no-sparse-arrays': 2, + 'no-this-before-super': 2, + 'no-throw-literal': 2, + 'no-trailing-spaces': 2, + 'no-undef': 2, + 'no-undef-init': 2, + 'no-unexpected-multiline': 2, + 'no-unmodified-loop-condition': 2, + 'no-unneeded-ternary': [2, { + 'defaultAssignment': false + }], + 'no-unreachable': 2, + 'no-unsafe-finally': 2, + 'no-unused-vars': [2, { + 'vars': 'all', + 'args': 'none' + }], + 'no-useless-call': 2, + 'no-useless-computed-key': 2, + 'no-useless-constructor': 2, + 'no-useless-escape': 0, + 'no-whitespace-before-property': 2, + 'no-with': 2, + 'one-var': [2, { + 'initialized': 'never' + }], + 'operator-linebreak': [2, 'after', { + 'overrides': { + '?': 'before', + ':': 'before' + } + }], + 'padded-blocks': [2, 'never'], + 'quotes': [2, 'single', { + 'avoidEscape': true, + 'allowTemplateLiterals': true + }], + 'semi': [2, 'never'], + 'semi-spacing': [2, { + 'before': false, + 'after': true + }], + 'space-before-blocks': [2, 'always'], + 'space-before-function-paren': [2, 'never'], + 'space-in-parens': [2, 'never'], + 'space-infix-ops': 2, + 'space-unary-ops': [2, { + 'words': true, + 'nonwords': false + }], + 'spaced-comment': [2, 'always', { + 'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ','] + }], + 'template-curly-spacing': [2, 'never'], + 'use-isnan': 2, + 'valid-typeof': 2, + 'wrap-iife': [2, 'any'], + 'yield-star-spacing': [2, 'both'], + 'yoda': [2, 'never'], + 'prefer-const': 2, + 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0, + 'object-curly-spacing': [2, 'always', { + objectsInObjects: false + }], + 'array-bracket-spacing': [2, 'never'] + } +} diff --git a/jnpf-java-boot/jnpf-web/.gitignore b/jnpf-java-boot/jnpf-web/.gitignore new file mode 100644 index 0000000..a975cc1 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/.gitignore @@ -0,0 +1,70 @@ +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# Image snapshot diff +__diff_output__/ +/jest-stare + +*.iml +.idea/ +.ipr +.iws +*~ +~* +*.diff +*.patch +*.bak +.DS_Store +Thumbs.db +.project +.*proj +.svn/ +*.swp +*.swo +*.log +*.log.* +*.json.gzip +node_modules/ +.buildpath +.settings +npm-debug.log +nohup.out +_site +_data +dist +report.html +/lib +/es +elasticsearch-* +config/base.yaml +/coverage +yarn.lock +components/**/*.js +components/**/*.jsx +!components/**/__tests__/**/*.js +!components/**/__tests__/**/*.js.snap +/.history +*.tmp +package-lock.json +package.json diff --git a/jnpf-java-boot/jnpf-web/Dockerfile b/jnpf-java-boot/jnpf-web/Dockerfile new file mode 100644 index 0000000..5464a68 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/Dockerfile @@ -0,0 +1,11 @@ +FROM nginx + +LABEL maintainer=jnpf-team + +ENV WORKDIR /home/jnpfsoft/jnpf-web + +COPY dist ${WORKDIR} + +COPY conf/default.conf /etc/nginx/conf.d/ + +EXPOSE 80 \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/README.md b/jnpf-java-boot/jnpf-web/README.md new file mode 100644 index 0000000..b4c939f --- /dev/null +++ b/jnpf-java-boot/jnpf-web/README.md @@ -0,0 +1,130 @@ +## 一 环境要求 + +### 1.1 开发环境 + +- 操作系统:`Windows 10/11`,`MacOS`; +- `Node.js v12/v4/v16`(v16 版本某些情况下可能需要安装 `Python3` 环境); +- 浏览器推荐使用 `Chrome 90` 及以上版本; +- `Visual Studio Code`(简称 VSCode) + +### 1.2 运行环境 + +`Nginx 1.18.0` 及以上版本或 `TongHttpServer 6.0` (信创环境) + +## 二 关联项目 + +> 需要使用下表中的对应分支 + +| 项目 | 分支 | 分支(Coding) | 说明 | +| ------------------------- | ------ | ------------- | ------------------------------------------ | +| **后端**(任一后端服务) | | | | +| jnpf-java-boot | v3.5.x | v3.5.0-stable | Java 单体项目源码 | +| jnpf-java-cloud | v3.5.x | v3.5.0-stable | Java 微服务项目源码 | +| jnpf-dotnet | v3.5.x | v3.5.0-stable | .NET 单体项目源码 | +| jnpf-dotnet-cloud | v3.5.x | v3.5.0-stable | .NET 微服务项目源码 | +| **前** | | | | +| jnpf-web-datascreen | v3.5.x | v3.5.0-stable | 大屏前端项目源码 | +| jnpf-web-datareport | v3.4.7 | v3.4.7-stable | 报表前端项目源码 | +| jnpf-web-datareport-cloud | v3.4.7 | v3.4.7-stable | 报表前端项目源码(jnpf-java-cloud 项目专用) | + +## 三 使用说明 + +### 3.1 开发环境 + +#### 3.1.1 安装依赖 + +使用如下命令安装项目依赖 + +```bash +npm install --registry http://registry.npmmirror.com +``` + +#### 3.1.2 后端接口配置 + +修改 `src/utils/apiUrl.js` 中的后端接口地址 + +- Java 项目本地开发默认地址:`http://localhost:30000` +- .NET 项目本地开发默认地址:`http://localhost:5000` + +```bash +module.exports = { + // 开发环境接口配置 + APIURl: 'http://localhost:30000' +} +``` + +#### 3.1.3 关联项目配置 + +打开 `src/utils/define.js` 配置文件,默认配置如下所示 + +> 需要特别注意的是,如果用的是 `jnpf-java-cloud` 的后端,需要将第 `13` 行注释,取消注释第 `15` 行代码。 + +```bash +const { APIURl } = require('./apiUrl') + +module.exports = { + APIURl, + timeout: process.env.NODE_ENV === 'development' ? 1000000 : 1000000, + comUploadUrl: process.env.VUE_APP_BASE_API + '/api/file/Uploader', + comUrl: process.env.VUE_APP_BASE_API, + // 本地文件预览 + filePreviewServer: process.env.NODE_ENV === 'development' ? 'http://localhost:30090' : process.env.VUE_APP_BASE_API + '/FileServer', + // 大屏应用前端路径 + dataV: process.env.NODE_ENV === 'development' ? 'http://localhost:8100/DataV' : window.location.origin + '/DataV', + // 数据报表接口-java boot + reportServer: process.env.NODE_ENV === 'development' ? 'http://localhost:30007' : process.env.VUE_APP_BASE_API + '/ReportServer', + // 数据报表接口-java cloud + //reportServer: process.env.NODE_ENV === 'development' ? 'http://localhost:30000' : process.env.VUE_APP_BASE_API, + // 报表前端 + report: process.env.NODE_ENV === 'development' ? 'http://localhost:8200' : process.env.VUE_APP_BASE_API + '/Report' +} +``` + +#### 3.1.4 本地运行 + +完成上述操作后,使用如下命令运行前端项目 + +```bash +npm run dev +``` + +### 3.2 运行环境 + +> 测试或生产环境 + +如果需要测试或生产环境发布,使用如下命令打包项目 + +```bash +npm run build +``` + +然后将项目根目录下 `/dist/` 中所有的文件上传至服务器。 + +## 四 常见问题 + +### 4.1 修改项目基本信息 + +打开项目根目录 `vue.config.js` 文件,可以看到 `本地运行端口号`、`网站标题` 等配置。 + +```bash +# 修改网站标题(第11行) +const name = defaultSettings.title || 'JNPF快速开发平台' + +# 修改本地运行端口(第18行) +const port = process.env.port || process.env.npm_config_port || 3000 +``` + +### 4.2 在运行环境(测试或生产环境)报 ak 设置问题 + +错误信息如下所示 + +```bash +APP Referer校验失败。请检查该ak设置的白名单与访问所有的域名是否一致。详情查看:http://bsyun.baidu.com/apiconsole/key#。 +``` + +若没有使用百度地图的需求,可以注释 `public/index.html` 中第 `12` 行代码, +若有使用百度地图的需求,先去 百度地图开发平台([https://lbsyun.baidu.com/](https://lbsyun.baidu.com/))申请一个账号,然后 修改 `public/index.html` 第 12 行代码中 ak 的值。 + +### 4.3 代码更新后报错 + +在开发或打包时报依赖缺失,可以先删除项目根目录下的 `package-lock.json` 文件,然后重新执行 `npm install --registry http://registry.npmmirror.com` 安装依赖即可解决。 diff --git a/jnpf-java-boot/jnpf-web/babel.config.js b/jnpf-java-boot/jnpf-web/babel.config.js new file mode 100644 index 0000000..f808fa7 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/babel.config.js @@ -0,0 +1,14 @@ +module.exports = { + presets: [ + '@vue/app' + ], + 'env': { + 'development': { + 'plugins': [ + 'dynamic-import-node', + '@babel/plugin-proposal-optional-chaining', + '@babel/plugin-proposal-nullish-coalescing-operator' + ] + } + } +} diff --git a/jnpf-java-boot/jnpf-web/build/index.js b/jnpf-java-boot/jnpf-web/build/index.js new file mode 100644 index 0000000..cd289f9 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/build/index.js @@ -0,0 +1,37 @@ +const { + run +} = require('runjs') +const chalk = require('chalk') +const config = require('../vue.config.js') +const rawArgv = process.argv.slice(2) +const args = rawArgv.join(' ') + +if (process.env.npm_config_preview || rawArgv.includes('--preview')) { + const report = rawArgv.includes('--report') + + run(`vue-cli-service build ${args}`) + + const port = 9526 + const publicPath = config.publicPath + + var connect = require('connect') + var serveStatic = require('serve-static') + const app = connect() + + app.use( + publicPath, + serveStatic('./dist', { + index: ['index.html', '/'] + }) + ) + + app.listen(port, function () { + console.log(chalk.green(`> Preview at http://localhost:${port}${publicPath}`)) + if (report) { + console.log(chalk.green(`> Report at http://localhost:${port}${publicPath}report.html`)) + } + + }) +} else { + run(`vue-cli-service build ${args}`) +} diff --git a/jnpf-java-boot/jnpf-web/conf/default.conf b/jnpf-java-boot/jnpf-web/conf/default.conf new file mode 100644 index 0000000..a03391f --- /dev/null +++ b/jnpf-java-boot/jnpf-web/conf/default.conf @@ -0,0 +1,66 @@ +server { + listen 80; + server_name localhost; + + gzip on; + gzip_static on; + gzip_min_length 1k; + gzip_comp_level 4; + gzip_proxied any; + gzip_types text/plain text/xml text/css; + gzip_vary on; + gzip_http_version 1.0; + gzip_disable "MSIE [1-6]\.(?!.*SV1)"; + + # JNPF-START + #设置上传文件的大小 + client_max_body_size 100m; + + # #添加头部信息 + proxy_set_header Cookie $http_cookie; + proxy_set_header X-Forwarded-Host $host; + proxy_connect_timeout 15s; + proxy_send_timeout 15s; + proxy_read_timeout 15s; + proxy_set_header X-Forwarded-Proto http; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + + # #请求头总长度大于128k时使用large_client_header_buffers设置的缓存区 + client_header_buffer_size 128k; + + # #指令参数4为个数,128k为大小,默认是8k。申请4个128k。 + large_client_header_buffers 4 128k; + + # 前端主项目(jnpf-web)伪静态 + location / { + root /www/jnpfsoft/jnpf-web; + index index.html; + try_files $uri $uri/ /index.html; + } + + # 前端大屏(jnpf-web-datascreen)伪静态 + location /DataV { + try_files $uri $uri/ /DataV/index.html; + } + + # 主项目 + location /api/ { + proxy_pass http://jnpf-java-boot.staging:30000; + } + + # 报表(jnpf-datareport)接口 + location /ReportServer/ { + proxy_pass http://jnpf-datareport.staging:30007/; + } + + # 文件预览(jnpf-file-preview) + location /FileServer { + proxy_pass http://jnpf-file-preview.staging:30090; + } + + location ~ /FileServer/*.*\.(js|css)?$ { + proxy_pass http://jnpf-file-preview.staging:30090; + } + +} diff --git a/jnpf-java-boot/jnpf-web/jest.config.js b/jnpf-java-boot/jnpf-web/jest.config.js new file mode 100644 index 0000000..143cdc8 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/jest.config.js @@ -0,0 +1,24 @@ +module.exports = { + moduleFileExtensions: ['js', 'jsx', 'json', 'vue'], + transform: { + '^.+\\.vue$': 'vue-jest', + '.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': + 'jest-transform-stub', + '^.+\\.jsx?$': 'babel-jest' + }, + moduleNameMapper: { + '^@/(.*)$': '/src/$1' + }, + snapshotSerializers: ['jest-serializer-vue'], + testMatch: [ + '**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)' + ], + collectCoverageFrom: ['src/utils/**/*.{js,vue}', '!src/utils/auth.js', '!src/utils/request.js', 'src/components/**/*.{js,vue}'], + coverageDirectory: '/tests/unit/coverage', + // 'collectCoverage': true, + 'coverageReporters': [ + 'lcov', + 'text-summary' + ], + testURL: 'http://localhost/' +} diff --git a/jnpf-java-boot/jnpf-web/plopfile.js b/jnpf-java-boot/jnpf-web/plopfile.js new file mode 100644 index 0000000..57387bf --- /dev/null +++ b/jnpf-java-boot/jnpf-web/plopfile.js @@ -0,0 +1,9 @@ +const viewGenerator = require('./plop-templates/view/prompt') +const componentGenerator = require('./plop-templates/component/prompt') +const storeGenerator = require('./plop-templates/store/prompt.js') + +module.exports = function(plop) { + plop.setGenerator('view', viewGenerator) + plop.setGenerator('component', componentGenerator) + plop.setGenerator('store', storeGenerator) +} diff --git a/jnpf-java-boot/jnpf-web/postcss.config.js b/jnpf-java-boot/jnpf-web/postcss.config.js new file mode 100644 index 0000000..961986e --- /dev/null +++ b/jnpf-java-boot/jnpf-web/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + autoprefixer: {} + } +} diff --git a/jnpf-java-boot/jnpf-web/public/cdn/echarts/echarts.min.js b/jnpf-java-boot/jnpf-web/public/cdn/echarts/echarts.min.js new file mode 100644 index 0000000..9260d80 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/echarts/echarts.min.js @@ -0,0 +1,45 @@ + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).echarts={})}(this,(function(t){"use strict"; +/*! ***************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** */var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},e(t,n)};function n(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}var i=function(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1},r=new function(){this.browser=new i,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow="undefined"!=typeof window};"object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?(r.wxa=!0,r.touchEventsSupported=!0):"undefined"==typeof document&&"undefined"!=typeof self?r.worker=!0:"undefined"==typeof navigator?(r.node=!0,r.svgSupported=!0):function(t,e){var n=e.browser,i=t.match(/Firefox\/([\d.]+)/),r=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),o=t.match(/Edge?\/([\d.]+)/),a=/micromessenger/i.test(t);i&&(n.firefox=!0,n.version=i[1]);r&&(n.ie=!0,n.version=r[1]);o&&(n.edge=!0,n.version=o[1],n.newEdge=+o[1].split(".")[0]>18);a&&(n.weChat=!0);e.svgSupported="undefined"!=typeof SVGRect,e.touchEventsSupported="ontouchstart"in window&&!n.ie&&!n.edge,e.pointerEventsSupported="onpointerdown"in window&&(n.edge||n.ie&&+n.version>=11),e.domSupported="undefined"!=typeof document;var s=document.documentElement.style;e.transform3dSupported=(n.ie&&"transition"in s||n.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),e.transformSupported=e.transform3dSupported||n.ie&&+n.version>=9}(navigator.userAgent,r);var o="sans-serif",a="12px sans-serif";var s,l,u=function(t){var e={};if("undefined"==typeof JSON)return e;for(var n=0;n=0)o=r*t.length;else for(var c=0;c>1)%2;a.style.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[s]+":0",r[l]+":0",i[1-s]+":auto",r[1-l]+":auto",""].join("!important;"),t.appendChild(a),n.push(a)}return n}(e,a),l=function(t,e,n){for(var i=n?"invTrans":"trans",r=e[i],o=e.srcCoords,a=[],s=[],l=!0,u=0;u<4;u++){var h=t[u].getBoundingClientRect(),c=2*u,p=h.left,d=h.top;a.push(p,d),l=l&&o&&p===o[c]&&d===o[c+1],s.push(t[u].offsetLeft,t[u].offsetTop)}return l&&r?r:(e.srcCoords=a,e[i]=n?qt(s,a):qt(a,s))}(s,a,o);if(l)return l(t,n,i),!0}return!1}function Jt(t){return"CANVAS"===t.nodeName.toUpperCase()}var Qt=/([&<>"'])/g,te={"&":"&","<":"<",">":">",'"':""","'":"'"};function ee(t){return null==t?"":(t+"").replace(Qt,(function(t,e){return te[e]}))}var ne=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ie=[],re=r.browser.firefox&&+r.browser.version.split(".")[0]<39;function oe(t,e,n,i){return n=n||{},i?ae(t,e,n):re&&null!=e.layerX&&e.layerX!==e.offsetX?(n.zrX=e.layerX,n.zrY=e.layerY):null!=e.offsetX?(n.zrX=e.offsetX,n.zrY=e.offsetY):ae(t,e,n),n}function ae(t,e,n){if(r.domSupported&&t.getBoundingClientRect){var i=e.clientX,o=e.clientY;if(Jt(t)){var a=t.getBoundingClientRect();return n.zrX=i-a.left,void(n.zrY=o-a.top)}if($t(ie,t,i,o))return n.zrX=ie[0],void(n.zrY=ie[1])}n.zrX=n.zrY=0}function se(t){return t||window.event}function le(t,e,n){if(null!=(e=se(e)).zrX)return e;var i=e.type;if(i&&i.indexOf("touch")>=0){var r="touchend"!==i?e.targetTouches[0]:e.changedTouches[0];r&&oe(t,r,e,n)}else{oe(t,e,e,n);var o=function(t){var e=t.wheelDelta;if(e)return e;var n=t.deltaX,i=t.deltaY;if(null==n||null==i)return e;return 3*(0!==i?Math.abs(i):Math.abs(n))*(i>0?-1:i<0?1:n>0?-1:1)}(e);e.zrDelta=o?o/120:-(e.detail||0)/3}var a=e.button;return null==e.which&&void 0!==a&&ne.test(e.type)&&(e.which=1&a?1:2&a?3:4&a?2:0),e}function ue(t,e,n,i){t.addEventListener(e,n,i)}var he=function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0};function ce(t){return 2===t.which||3===t.which}var pe=function(){function t(){this._track=[]}return t.prototype.recognize=function(t,e,n){return this._doTrack(t,e,n),this._recognize(t)},t.prototype.clear=function(){return this._track.length=0,this},t.prototype._doTrack=function(t,e,n){var i=t.touches;if(i){for(var r={points:[],touches:[],target:e,event:t},o=0,a=i.length;o1&&r&&r.length>1){var a=de(r)/de(o);!isFinite(a)&&(a=1),e.pinchScale=a;var s=[((i=r)[0][0]+i[1][0])/2,(i[0][1]+i[1][1])/2];return e.pinchX=s[0],e.pinchY=s[1],{type:"pinch",target:t[0].target,event:e}}}}};function ge(){return[1,0,0,1,0,0]}function ye(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function ve(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function me(t,e,n){var i=e[0]*n[0]+e[2]*n[1],r=e[1]*n[0]+e[3]*n[1],o=e[0]*n[2]+e[2]*n[3],a=e[1]*n[2]+e[3]*n[3],s=e[0]*n[4]+e[2]*n[5]+e[4],l=e[1]*n[4]+e[3]*n[5]+e[5];return t[0]=i,t[1]=r,t[2]=o,t[3]=a,t[4]=s,t[5]=l,t}function xe(t,e,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+n[0],t[5]=e[5]+n[1],t}function _e(t,e,n){var i=e[0],r=e[2],o=e[4],a=e[1],s=e[3],l=e[5],u=Math.sin(n),h=Math.cos(n);return t[0]=i*h+a*u,t[1]=-i*u+a*h,t[2]=r*h+s*u,t[3]=-r*u+h*s,t[4]=h*o+u*l,t[5]=h*l-u*o,t}function be(t,e,n){var i=n[0],r=n[1];return t[0]=e[0]*i,t[1]=e[1]*r,t[2]=e[2]*i,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*r,t}function we(t,e){var n=e[0],i=e[2],r=e[4],o=e[1],a=e[3],s=e[5],l=n*a-o*i;return l?(l=1/l,t[0]=a*l,t[1]=-o*l,t[2]=-i*l,t[3]=n*l,t[4]=(i*s-a*r)*l,t[5]=(o*r-n*s)*l,t):null}function Se(t){var e=[1,0,0,1,0,0];return ve(e,t),e}var Me=Object.freeze({__proto__:null,create:ge,identity:ye,copy:ve,mul:me,translate:xe,rotate:_e,scale:be,invert:we,clone:Se}),Ie=function(){function t(t,e){this.x=t||0,this.y=e||0}return t.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this},t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.set=function(t,e){return this.x=t,this.y=e,this},t.prototype.equal=function(t){return t.x===this.x&&t.y===this.y},t.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},t.prototype.scale=function(t){this.x*=t,this.y*=t},t.prototype.scaleAndAdd=function(t,e){this.x+=t.x*e,this.y+=t.y*e},t.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},t.prototype.dot=function(t){return this.x*t.x+this.y*t.y},t.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},t.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},t.prototype.normalize=function(){var t=this.len();return this.x/=t,this.y/=t,this},t.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},t.prototype.distanceSquare=function(t){var e=this.x-t.x,n=this.y-t.y;return e*e+n*n},t.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},t.prototype.transform=function(t){if(t){var e=this.x,n=this.y;return this.x=t[0]*e+t[2]*n+t[4],this.y=t[1]*e+t[3]*n+t[5],this}},t.prototype.toArray=function(t){return t[0]=this.x,t[1]=this.y,t},t.prototype.fromArray=function(t){this.x=t[0],this.y=t[1]},t.set=function(t,e,n){t.x=e,t.y=n},t.copy=function(t,e){t.x=e.x,t.y=e.y},t.len=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},t.lenSquare=function(t){return t.x*t.x+t.y*t.y},t.dot=function(t,e){return t.x*e.x+t.y*e.y},t.add=function(t,e,n){t.x=e.x+n.x,t.y=e.y+n.y},t.sub=function(t,e,n){t.x=e.x-n.x,t.y=e.y-n.y},t.scale=function(t,e,n){t.x=e.x*n,t.y=e.y*n},t.scaleAndAdd=function(t,e,n,i){t.x=e.x+n.x*i,t.y=e.y+n.y*i},t.lerp=function(t,e,n,i){var r=1-i;t.x=r*e.x+i*n.x,t.y=r*e.y+i*n.y},t}(),Te=Math.min,Ce=Math.max,De=new Ie,Ae=new Ie,ke=new Ie,Le=new Ie,Pe=new Ie,Oe=new Ie,Re=function(){function t(t,e,n,i){n<0&&(t+=n,n=-n),i<0&&(e+=i,i=-i),this.x=t,this.y=e,this.width=n,this.height=i}return t.prototype.union=function(t){var e=Te(t.x,this.x),n=Te(t.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=Ce(t.x+t.width,this.x+this.width)-e:this.width=t.width,isFinite(this.y)&&isFinite(this.height)?this.height=Ce(t.y+t.height,this.y+this.height)-n:this.height=t.height,this.x=e,this.y=n},t.prototype.applyTransform=function(e){t.applyTransform(this,this,e)},t.prototype.calculateTransform=function(t){var e=this,n=t.width/e.width,i=t.height/e.height,r=[1,0,0,1,0,0];return xe(r,r,[-e.x,-e.y]),be(r,r,[n,i]),xe(r,r,[t.x,t.y]),r},t.prototype.intersect=function(e,n){if(!e)return!1;e instanceof t||(e=t.create(e));var i=this,r=i.x,o=i.x+i.width,a=i.y,s=i.y+i.height,l=e.x,u=e.x+e.width,h=e.y,c=e.y+e.height,p=!(of&&(f=x,gf&&(f=_,v=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height},t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copy=function(e){t.copy(this,e)},t.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},t.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},t.prototype.isZero=function(){return 0===this.width||0===this.height},t.create=function(e){return new t(e.x,e.y,e.width,e.height)},t.copy=function(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},t.applyTransform=function(e,n,i){if(i){if(i[1]<1e-5&&i[1]>-1e-5&&i[2]<1e-5&&i[2]>-1e-5){var r=i[0],o=i[3],a=i[4],s=i[5];return e.x=n.x*r+a,e.y=n.y*o+s,e.width=n.width*r,e.height=n.height*o,e.width<0&&(e.x+=e.width,e.width=-e.width),void(e.height<0&&(e.y+=e.height,e.height=-e.height))}De.x=ke.x=n.x,De.y=Le.y=n.y,Ae.x=Le.x=n.x+n.width,Ae.y=ke.y=n.y+n.height,De.transform(i),Le.transform(i),Ae.transform(i),ke.transform(i),e.x=Te(De.x,Ae.x,ke.x,Le.x),e.y=Te(De.y,Ae.y,ke.y,Le.y);var l=Ce(De.x,Ae.x,ke.x,Le.x),u=Ce(De.y,Ae.y,ke.y,Le.y);e.width=l-e.x,e.height=u-e.y}else e!==n&&t.copy(e,n)},t}(),Ne="silent";function Ee(){he(this.event)}var ze=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.handler=null,e}return n(e,t),e.prototype.dispose=function(){},e.prototype.setCursor=function(){},e}(Xt),Ve=function(t,e){this.x=t,this.y=e},Be=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],Fe=new Re(0,0,0,0),Ge=function(t){function e(e,n,i,r,o){var a=t.call(this)||this;return a._hovered=new Ve(0,0),a.storage=e,a.painter=n,a.painterRoot=r,a._pointerSize=o,i=i||new ze,a.proxy=null,a.setHandlerProxy(i),a._draggingMgr=new Ut(a),a}return n(e,t),e.prototype.setHandlerProxy=function(t){this.proxy&&this.proxy.dispose(),t&&(E(Be,(function(e){t.on&&t.on(e,this[e],this)}),this),t.handler=this),this.proxy=t},e.prototype.mousemove=function(t){var e=t.zrX,n=t.zrY,i=Ye(this,e,n),r=this._hovered,o=r.target;o&&!o.__zr&&(o=(r=this.findHover(r.x,r.y)).target);var a=this._hovered=i?new Ve(e,n):this.findHover(e,n),s=a.target,l=this.proxy;l.setCursor&&l.setCursor(s?s.cursor:"default"),o&&s!==o&&this.dispatchToElement(r,"mouseout",t),this.dispatchToElement(a,"mousemove",t),s&&s!==o&&this.dispatchToElement(a,"mouseover",t)},e.prototype.mouseout=function(t){var e=t.zrEventControl;"only_globalout"!==e&&this.dispatchToElement(this._hovered,"mouseout",t),"no_globalout"!==e&&this.trigger("globalout",{type:"globalout",event:t})},e.prototype.resize=function(){this._hovered=new Ve(0,0)},e.prototype.dispatch=function(t,e){var n=this[t];n&&n.call(this,e)},e.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},e.prototype.setCursorStyle=function(t){var e=this.proxy;e.setCursor&&e.setCursor(t)},e.prototype.dispatchToElement=function(t,e,n){var i=(t=t||{}).target;if(!i||!i.silent){for(var r="on"+e,o=function(t,e,n){return{type:t,event:n,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:n.zrX,offsetY:n.zrY,gestureEvent:n.gestureEvent,pinchX:n.pinchX,pinchY:n.pinchY,pinchScale:n.pinchScale,wheelDelta:n.zrDelta,zrByTouch:n.zrByTouch,which:n.which,stop:Ee}}(e,t,n);i&&(i[r]&&(o.cancelBubble=!!i[r].call(i,o)),i.trigger(e,o),i=i.__hostTarget?i.__hostTarget:i.parent,!o.cancelBubble););o.cancelBubble||(this.trigger(e,o),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer((function(t){"function"==typeof t[r]&&t[r].call(t,o),t.trigger&&t.trigger(e,o)})))}},e.prototype.findHover=function(t,e,n){var i=this.storage.getDisplayList(),r=new Ve(t,e);if(He(i,r,t,e,n),this._pointerSize&&!r.target){for(var o=[],a=this._pointerSize,s=a/2,l=new Re(t-s,e-s,a,a),u=i.length-1;u>=0;u--){var h=i[u];h===n||h.ignore||h.ignoreCoarsePointer||h.parent&&h.parent.ignoreCoarsePointer||(Fe.copy(h.getBoundingRect()),h.transform&&Fe.applyTransform(h.transform),Fe.intersect(l)&&o.push(h))}if(o.length)for(var c=Math.PI/12,p=2*Math.PI,d=0;d=0;o--){var a=t[o],s=void 0;if(a!==r&&!a.ignore&&(s=We(a,n,i))&&(!e.topTarget&&(e.topTarget=a),s!==Ne)){e.target=a;break}}}function Ye(t,e,n){var i=t.painter;return e<0||e>i.getWidth()||n<0||n>i.getHeight()}E(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],(function(t){Ge.prototype[t]=function(e){var n,i,r=e.zrX,o=e.zrY,a=Ye(this,r,o);if("mouseup"===t&&a||(i=(n=this.findHover(r,o)).target),"mousedown"===t)this._downEl=i,this._downPoint=[e.zrX,e.zrY],this._upEl=i;else if("mouseup"===t)this._upEl=i;else if("click"===t){if(this._downEl!==this._upEl||!this._downPoint||Et(this._downPoint,[e.zrX,e.zrY])>4)return;this._downPoint=null}this.dispatchToElement(n,t,e)}}));function Ue(t,e,n,i){var r=e+1;if(r===n)return 1;if(i(t[r++],t[e])<0){for(;r=0;)r++;return r-e}function Xe(t,e,n,i,r){for(i===e&&i++;i>>1])<0?l=o:s=o+1;var u=i-s;switch(u){case 3:t[s+3]=t[s+2];case 2:t[s+2]=t[s+1];case 1:t[s+1]=t[s];break;default:for(;u>0;)t[s+u]=t[s+u-1],u--}t[s]=a}}function Ze(t,e,n,i,r,o){var a=0,s=0,l=1;if(o(t,e[n+r])>0){for(s=i-r;l0;)a=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),a+=r,l+=r}else{for(s=r+1;ls&&(l=s);var u=a;a=r-l,l=r-u}for(a++;a>>1);o(t,e[n+h])>0?a=h+1:l=h}return l}function je(t,e,n,i,r,o){var a=0,s=0,l=1;if(o(t,e[n+r])<0){for(s=r+1;ls&&(l=s);var u=a;a=r-l,l=r-u}else{for(s=i-r;l=0;)a=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),a+=r,l+=r}for(a++;a>>1);o(t,e[n+h])<0?l=h:a=h+1}return l}function qe(t,e){var n,i,r=7,o=0;t.length;var a=[];function s(s){var l=n[s],u=i[s],h=n[s+1],c=i[s+1];i[s]=u+c,s===o-3&&(n[s+1]=n[s+2],i[s+1]=i[s+2]),o--;var p=je(t[h],t,l,u,0,e);l+=p,0!==(u-=p)&&0!==(c=Ze(t[l+u-1],t,h,c,c-1,e))&&(u<=c?function(n,i,o,s){var l=0;for(l=0;l=7||d>=7);if(f)break;g<0&&(g=0),g+=2}if((r=g)<1&&(r=1),1===i){for(l=0;l=0;l--)t[d+l]=t[p+l];return void(t[c]=a[h])}var f=r;for(;;){var g=0,y=0,v=!1;do{if(e(a[h],t[u])<0){if(t[c--]=t[u--],g++,y=0,0==--i){v=!0;break}}else if(t[c--]=a[h--],y++,g=0,1==--s){v=!0;break}}while((g|y)=0;l--)t[d+l]=t[p+l];if(0===i){v=!0;break}}if(t[c--]=a[h--],1==--s){v=!0;break}if(0!==(y=s-Ze(t[u],a,0,s,s-1,e))){for(s-=y,d=(c-=y)+1,p=(h-=y)+1,l=0;l=7||y>=7);if(v)break;f<0&&(f=0),f+=2}(r=f)<1&&(r=1);if(1===s){for(d=(c-=i)+1,p=(u-=i)+1,l=i-1;l>=0;l--)t[d+l]=t[p+l];t[c]=a[h]}else{if(0===s)throw new Error;for(p=c-(s-1),l=0;l1;){var t=o-2;if(t>=1&&i[t-1]<=i[t]+i[t+1]||t>=2&&i[t-2]<=i[t]+i[t-1])i[t-1]i[t+1])break;s(t)}},forceMergeRuns:function(){for(;o>1;){var t=o-2;t>0&&i[t-1]=32;)e|=1&t,t>>=1;return t+e}(r);do{if((o=Ue(t,n,i,e))s&&(l=s),Xe(t,n,n+l,n+o,e),o=l}a.pushRun(n,o),a.mergeRuns(),r-=o,n+=o}while(0!==r);a.forceMergeRuns()}}}var $e=!1;function Je(){$e||($e=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function Qe(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}var tn=function(){function t(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=Qe}return t.prototype.traverse=function(t,e){for(var n=0;n0&&(u.__clipPaths=[]),isNaN(u.z)&&(Je(),u.z=0),isNaN(u.z2)&&(Je(),u.z2=0),isNaN(u.zlevel)&&(Je(),u.zlevel=0),this._displayList[this._displayListLen++]=u}var h=t.getDecalElement&&t.getDecalElement();h&&this._updateAndAddDisplayable(h,e,n);var c=t.getTextGuideLine();c&&this._updateAndAddDisplayable(c,e,n);var p=t.getTextContent();p&&this._updateAndAddDisplayable(p,e,n)}},t.prototype.addRoot=function(t){t.__zr&&t.__zr.storage===this||this._roots.push(t)},t.prototype.delRoot=function(t){if(t instanceof Array)for(var e=0,n=t.length;e=0&&this._roots.splice(i,1)}},t.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},t.prototype.getRoots=function(){return this._roots},t.prototype.dispose=function(){this._displayList=null,this._roots=null},t}(),en=r.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(t){return setTimeout(t,16)},nn={linear:function(t){return t},quadraticIn:function(t){return t*t},quadraticOut:function(t){return t*(2-t)},quadraticInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},quarticIn:function(t){return t*t*t*t},quarticOut:function(t){return 1- --t*t*t*t},quarticInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quinticIn:function(t){return t*t*t*t*t},quinticOut:function(t){return--t*t*t*t*t+1},quinticInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},sinusoidalIn:function(t){return 1-Math.cos(t*Math.PI/2)},sinusoidalOut:function(t){return Math.sin(t*Math.PI/2)},sinusoidalInOut:function(t){return.5*(1-Math.cos(Math.PI*t))},exponentialIn:function(t){return 0===t?0:Math.pow(1024,t-1)},exponentialOut:function(t){return 1===t?1:1-Math.pow(2,-10*t)},exponentialInOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))},circularIn:function(t){return 1-Math.sqrt(1-t*t)},circularOut:function(t){return Math.sqrt(1- --t*t)},circularInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,n=.1;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=.1):e=.4*Math.asin(1/n)/(2*Math.PI),-n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4))},elasticOut:function(t){var e,n=.1;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=.1):e=.4*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/.4)+1)},elasticInOut:function(t){var e,n=.1,i=.4;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=.1):e=i*Math.asin(1/n)/(2*Math.PI),(t*=2)<1?n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)*-.5:n*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)*.5+1)},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)},bounceIn:function(t){return 1-nn.bounceOut(1-t)},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceInOut:function(t){return t<.5?.5*nn.bounceIn(2*t):.5*nn.bounceOut(2*t-1)+.5}},rn=Math.pow,on=Math.sqrt,an=1e-8,sn=1e-4,ln=on(3),un=1/3,hn=wt(),cn=wt(),pn=wt();function dn(t){return t>-1e-8&&tan||t<-1e-8}function gn(t,e,n,i,r){var o=1-r;return o*o*(o*t+3*r*e)+r*r*(r*i+3*o*n)}function yn(t,e,n,i,r){var o=1-r;return 3*(((e-t)*o+2*(n-e)*r)*o+(i-n)*r*r)}function vn(t,e,n,i,r,o){var a=i+3*(e-n)-t,s=3*(n-2*e+t),l=3*(e-t),u=t-r,h=s*s-3*a*l,c=s*l-9*a*u,p=l*l-3*s*u,d=0;if(dn(h)&&dn(c)){if(dn(s))o[0]=0;else(M=-l/s)>=0&&M<=1&&(o[d++]=M)}else{var f=c*c-4*h*p;if(dn(f)){var g=c/h,y=-g/2;(M=-s/a+g)>=0&&M<=1&&(o[d++]=M),y>=0&&y<=1&&(o[d++]=y)}else if(f>0){var v=on(f),m=h*s+1.5*a*(-c+v),x=h*s+1.5*a*(-c-v);(M=(-s-((m=m<0?-rn(-m,un):rn(m,un))+(x=x<0?-rn(-x,un):rn(x,un))))/(3*a))>=0&&M<=1&&(o[d++]=M)}else{var _=(2*h*s-3*a*c)/(2*on(h*h*h)),b=Math.acos(_)/3,w=on(h),S=Math.cos(b),M=(-s-2*w*S)/(3*a),I=(y=(-s+w*(S+ln*Math.sin(b)))/(3*a),(-s+w*(S-ln*Math.sin(b)))/(3*a));M>=0&&M<=1&&(o[d++]=M),y>=0&&y<=1&&(o[d++]=y),I>=0&&I<=1&&(o[d++]=I)}}return d}function mn(t,e,n,i,r){var o=6*n-12*e+6*t,a=9*e+3*i-3*t-9*n,s=3*e-3*t,l=0;if(dn(a)){if(fn(o))(h=-s/o)>=0&&h<=1&&(r[l++]=h)}else{var u=o*o-4*a*s;if(dn(u))r[0]=-o/(2*a);else if(u>0){var h,c=on(u),p=(-o-c)/(2*a);(h=(-o+c)/(2*a))>=0&&h<=1&&(r[l++]=h),p>=0&&p<=1&&(r[l++]=p)}}return l}function xn(t,e,n,i,r,o){var a=(e-t)*r+t,s=(n-e)*r+e,l=(i-n)*r+n,u=(s-a)*r+a,h=(l-s)*r+s,c=(h-u)*r+u;o[0]=t,o[1]=a,o[2]=u,o[3]=c,o[4]=c,o[5]=h,o[6]=l,o[7]=i}function _n(t,e,n,i,r,o,a,s,l,u,h){var c,p,d,f,g,y=.005,v=1/0;hn[0]=l,hn[1]=u;for(var m=0;m<1;m+=.05)cn[0]=gn(t,n,r,a,m),cn[1]=gn(e,i,o,s,m),(f=Vt(hn,cn))=0&&f=0&&y=1?1:vn(0,i,o,1,t,s)&&gn(0,r,a,1,s[0])}}}var kn=function(){function t(t){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=t.life||1e3,this._delay=t.delay||0,this.loop=t.loop||!1,this.onframe=t.onframe||xt,this.ondestroy=t.ondestroy||xt,this.onrestart=t.onrestart||xt,t.easing&&this.setEasing(t.easing)}return t.prototype.step=function(t,e){if(this._inited||(this._startTime=t+this._delay,this._inited=!0),!this._paused){var n=this._life,i=t-this._startTime-this._pausedTime,r=i/n;r<0&&(r=0),r=Math.min(r,1);var o=this.easingFunc,a=o?o(r):r;if(this.onframe(a),1===r){if(!this.loop)return!0;var s=i%n;this._startTime=t-s,this._pausedTime=0,this.onrestart()}return!1}this._pausedTime+=e},t.prototype.pause=function(){this._paused=!0},t.prototype.resume=function(){this._paused=!1},t.prototype.setEasing=function(t){this.easing=t,this.easingFunc=U(t)?t:nn[t]||An(t)},t}(),Ln=function(t){this.value=t},Pn=function(){function t(){this._len=0}return t.prototype.insert=function(t){var e=new Ln(t);return this.insertEntry(e),e},t.prototype.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t):this.head=this.tail=t,this._len++},t.prototype.remove=function(t){var e=t.prev,n=t.next;e?e.next=n:this.head=n,n?n.prev=e:this.tail=e,t.next=t.prev=null,this._len--},t.prototype.len=function(){return this._len},t.prototype.clear=function(){this.head=this.tail=null,this._len=0},t}(),On=function(){function t(t){this._list=new Pn,this._maxSize=10,this._map={},this._maxSize=t}return t.prototype.put=function(t,e){var n=this._list,i=this._map,r=null;if(null==i[t]){var o=n.len(),a=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var s=n.head;n.remove(s),delete i[s.key],r=s.value,this._lastRemovedEntry=s}a?a.value=e:a=new Ln(e),a.key=t,n.insertEntry(a),i[t]=a}return r},t.prototype.get=function(t){var e=this._map[t],n=this._list;if(null!=e)return e!==n.tail&&(n.remove(e),n.insertEntry(e)),e.value},t.prototype.clear=function(){this._list.clear(),this._map={}},t.prototype.len=function(){return this._list.len()},t}(),Rn={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Nn(t){return(t=Math.round(t))<0?0:t>255?255:t}function En(t){return t<0?0:t>1?1:t}function zn(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?Nn(parseFloat(e)/100*255):Nn(parseInt(e,10))}function Vn(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?En(parseFloat(e)/100):En(parseFloat(e))}function Bn(t,e,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}function Fn(t,e,n){return t+(e-t)*n}function Gn(t,e,n,i,r){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t}function Wn(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var Hn=new On(20),Yn=null;function Un(t,e){Yn&&Wn(Yn,e),Yn=Hn.put(t,Yn||e.slice())}function Xn(t,e){if(t){e=e||[];var n=Hn.get(t);if(n)return Wn(e,n);var i=(t+="").replace(/ /g,"").toLowerCase();if(i in Rn)return Wn(e,Rn[i]),Un(t,e),e;var r,o=i.length;if("#"===i.charAt(0))return 4===o||5===o?(r=parseInt(i.slice(1,4),16))>=0&&r<=4095?(Gn(e,(3840&r)>>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,5===o?parseInt(i.slice(4),16)/15:1),Un(t,e),e):void Gn(e,0,0,0,1):7===o||9===o?(r=parseInt(i.slice(1,7),16))>=0&&r<=16777215?(Gn(e,(16711680&r)>>16,(65280&r)>>8,255&r,9===o?parseInt(i.slice(7),16)/255:1),Un(t,e),e):void Gn(e,0,0,0,1):void 0;var a=i.indexOf("("),s=i.indexOf(")");if(-1!==a&&s+1===o){var l=i.substr(0,a),u=i.substr(a+1,s-(a+1)).split(","),h=1;switch(l){case"rgba":if(4!==u.length)return 3===u.length?Gn(e,+u[0],+u[1],+u[2],1):Gn(e,0,0,0,1);h=Vn(u.pop());case"rgb":return u.length>=3?(Gn(e,zn(u[0]),zn(u[1]),zn(u[2]),3===u.length?h:Vn(u[3])),Un(t,e),e):void Gn(e,0,0,0,1);case"hsla":return 4!==u.length?void Gn(e,0,0,0,1):(u[3]=Vn(u[3]),Zn(u,e),Un(t,e),e);case"hsl":return 3!==u.length?void Gn(e,0,0,0,1):(Zn(u,e),Un(t,e),e);default:return}}Gn(e,0,0,0,1)}}function Zn(t,e){var n=(parseFloat(t[0])%360+360)%360/360,i=Vn(t[1]),r=Vn(t[2]),o=r<=.5?r*(i+1):r+i-r*i,a=2*r-o;return Gn(e=e||[],Nn(255*Bn(a,o,n+1/3)),Nn(255*Bn(a,o,n)),Nn(255*Bn(a,o,n-1/3)),1),4===t.length&&(e[3]=t[3]),e}function jn(t,e){var n=Xn(t);if(n){for(var i=0;i<3;i++)n[i]=e<0?n[i]*(1-e)|0:(255-n[i])*e+n[i]|0,n[i]>255?n[i]=255:n[i]<0&&(n[i]=0);return ei(n,4===n.length?"rgba":"rgb")}}function qn(t,e,n){if(e&&e.length&&t>=0&&t<=1){n=n||[];var i=t*(e.length-1),r=Math.floor(i),o=Math.ceil(i),a=e[r],s=e[o],l=i-r;return n[0]=Nn(Fn(a[0],s[0],l)),n[1]=Nn(Fn(a[1],s[1],l)),n[2]=Nn(Fn(a[2],s[2],l)),n[3]=En(Fn(a[3],s[3],l)),n}}var Kn=qn;function $n(t,e,n){if(e&&e.length&&t>=0&&t<=1){var i=t*(e.length-1),r=Math.floor(i),o=Math.ceil(i),a=Xn(e[r]),s=Xn(e[o]),l=i-r,u=ei([Nn(Fn(a[0],s[0],l)),Nn(Fn(a[1],s[1],l)),Nn(Fn(a[2],s[2],l)),En(Fn(a[3],s[3],l))],"rgba");return n?{color:u,leftIndex:r,rightIndex:o,value:i}:u}}var Jn=$n;function Qn(t,e,n,i){var r=Xn(t);if(t)return r=function(t){if(t){var e,n,i=t[0]/255,r=t[1]/255,o=t[2]/255,a=Math.min(i,r,o),s=Math.max(i,r,o),l=s-a,u=(s+a)/2;if(0===l)e=0,n=0;else{n=u<.5?l/(s+a):l/(2-s-a);var h=((s-i)/6+l/2)/l,c=((s-r)/6+l/2)/l,p=((s-o)/6+l/2)/l;i===s?e=p-c:r===s?e=1/3+h-p:o===s&&(e=2/3+c-h),e<0&&(e+=1),e>1&&(e-=1)}var d=[360*e,n,u];return null!=t[3]&&d.push(t[3]),d}}(r),null!=e&&(r[0]=function(t){return(t=Math.round(t))<0?0:t>360?360:t}(e)),null!=n&&(r[1]=Vn(n)),null!=i&&(r[2]=Vn(i)),ei(Zn(r),"rgba")}function ti(t,e){var n=Xn(t);if(n&&null!=e)return n[3]=En(e),ei(n,"rgba")}function ei(t,e){if(t&&t.length){var n=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(n+=","+t[3]),e+"("+n+")"}}function ni(t,e){var n=Xn(t);return n?(.299*n[0]+.587*n[1]+.114*n[2])*n[3]/255+(1-n[3])*e:0}var ii=Object.freeze({__proto__:null,parse:Xn,lift:jn,toHex:function(t){var e=Xn(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)},fastLerp:qn,fastMapToColor:Kn,lerp:$n,mapToColor:Jn,modifyHSL:Qn,modifyAlpha:ti,stringify:ei,lum:ni,random:function(){return ei([Math.round(255*Math.random()),Math.round(255*Math.random()),Math.round(255*Math.random())],"rgb")}}),ri=Math.round;function oi(t){var e;if(t&&"transparent"!==t){if("string"==typeof t&&t.indexOf("rgba")>-1){var n=Xn(t);n&&(t="rgb("+n[0]+","+n[1]+","+n[2]+")",e=n[3])}}else t="none";return{color:t,opacity:null==e?1:e}}var ai=1e-4;function si(t){return t-1e-4}function li(t){return ri(1e3*t)/1e3}function ui(t){return ri(1e4*t)/1e4}var hi={left:"start",right:"end",center:"middle",middle:"middle"};function ci(t){return t&&!!t.image}function pi(t){return"linear"===t.type}function di(t){return"radial"===t.type}function fi(t){return"url(#"+t+")"}function gi(t){var e=t.getGlobalScale(),n=Math.max(e[0],e[1]);return Math.max(Math.ceil(Math.log(n)/Math.log(10)),1)}function yi(t){var e=t.x||0,n=t.y||0,i=(t.rotation||0)*_t,r=rt(t.scaleX,1),o=rt(t.scaleY,1),a=t.skewX||0,s=t.skewY||0,l=[];return(e||n)&&l.push("translate("+e+"px,"+n+"px)"),i&&l.push("rotate("+i+")"),1===r&&1===o||l.push("scale("+r+","+o+")"),(a||s)&&l.push("skew("+ri(a*_t)+"deg, "+ri(s*_t)+"deg)"),l.join(" ")}var vi=r.hasGlobalWindow&&U(window.btoa)?function(t){return window.btoa(unescape(t))}:"undefined"!=typeof Buffer?function(t){return Buffer.from(t).toString("base64")}:function(t){return null},mi=Array.prototype.slice;function xi(t,e,n){return(e-t)*n+t}function _i(t,e,n,i){for(var r=e.length,o=0;oi?e:t,o=Math.min(n,i),a=r[o-1]||{color:[0,0,0,0],offset:0},s=o;sa)i.length=a;else for(var s=o;s=1},t.prototype.getAdditiveTrack=function(){return this._additiveTrack},t.prototype.addKeyframe=function(t,e,n){this._needsSort=!0;var i=this.keyframes,r=i.length,o=!1,a=6,s=e;if(N(e)){var l=function(t){return N(t&&t[0])?2:1}(e);a=l,(1===l&&!j(e[0])||2===l&&!j(e[0][0]))&&(o=!0)}else if(j(e)&&!nt(e))a=0;else if(X(e))if(isNaN(+e)){var u=Xn(e);u&&(s=u,a=3)}else a=0;else if(Q(e)){var h=A({},s);h.colorStops=z(e.colorStops,(function(t){return{offset:t.offset,color:Xn(t.color)}})),pi(e)?a=4:di(e)&&(a=5),s=h}0===r?this.valType=a:a===this.valType&&6!==a||(o=!0),this.discrete=this.discrete||o;var c={time:t,value:s,rawValue:e,percent:0};return n&&(c.easing=n,c.easingFunc=U(n)?n:nn[n]||An(n)),i.push(c),c},t.prototype.prepare=function(t,e){var n=this.keyframes;this._needsSort&&n.sort((function(t,e){return t.time-e.time}));for(var i=this.valType,r=n.length,o=n[r-1],a=this.discrete,s=Di(i),l=Ci(i),u=0;u=0&&!(l[n].percent<=e);n--);n=d(n,u-2)}else{for(n=p;ne);n++);n=d(n-1,u-2)}r=l[n+1],i=l[n]}if(i&&r){this._lastFr=n,this._lastFrP=e;var f=r.percent-i.percent,g=0===f?1:d((e-i.percent)/f,1);r.easingFunc&&(g=r.easingFunc(g));var y=o?this._additiveValue:c?Ai:t[h];if(!Di(s)&&!c||y||(y=this._additiveValue=[]),this.discrete)t[h]=g<1?i.rawValue:r.rawValue;else if(Di(s))1===s?_i(y,i[a],r[a],g):function(t,e,n,i){for(var r=e.length,o=r&&e[0].length,a=0;a0&&s.addKeyframe(0,Ii(l),i),this._trackKeys.push(a)}s.addKeyframe(t,Ii(e[a]),i)}return this._maxTime=Math.max(this._maxTime,t),this},t.prototype.pause=function(){this._clip.pause(),this._paused=!0},t.prototype.resume=function(){this._clip.resume(),this._paused=!1},t.prototype.isPaused=function(){return!!this._paused},t.prototype.duration=function(t){return this._maxTime=t,this._force=!0,this},t.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var t=this._doneCbs;if(t)for(var e=t.length,n=0;n0)){this._started=1;for(var e=this,n=[],i=this._maxTime||0,r=0;r1){var a=o.pop();r.addKeyframe(a.time,t[i]),r.prepare(this._maxTime,r.getAdditiveTrack())}}}},t}();function Pi(){return(new Date).getTime()}var Oi,Ri,Ni=function(t){function e(e){var n=t.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,e=e||{},n.stage=e.stage||{},n}return n(e,t),e.prototype.addClip=function(t){t.animation&&this.removeClip(t),this._head?(this._tail.next=t,t.prev=this._tail,t.next=null,this._tail=t):this._head=this._tail=t,t.animation=this},e.prototype.addAnimator=function(t){t.animation=this;var e=t.getClip();e&&this.addClip(e)},e.prototype.removeClip=function(t){if(t.animation){var e=t.prev,n=t.next;e?e.next=n:this._head=n,n?n.prev=e:this._tail=e,t.next=t.prev=t.animation=null}},e.prototype.removeAnimator=function(t){var e=t.getClip();e&&this.removeClip(e),t.animation=null},e.prototype.update=function(t){for(var e=Pi()-this._pausedTime,n=e-this._time,i=this._head;i;){var r=i.next;i.step(e,n)?(i.ondestroy(),this.removeClip(i),i=r):i=r}this._time=e,t||(this.trigger("frame",n),this.stage.update&&this.stage.update())},e.prototype._startLoop=function(){var t=this;this._running=!0,en((function e(){t._running&&(en(e),!t._paused&&t.update())}))},e.prototype.start=function(){this._running||(this._time=Pi(),this._pausedTime=0,this._startLoop())},e.prototype.stop=function(){this._running=!1},e.prototype.pause=function(){this._paused||(this._pauseStart=Pi(),this._paused=!0)},e.prototype.resume=function(){this._paused&&(this._pausedTime+=Pi()-this._pauseStart,this._paused=!1)},e.prototype.clear=function(){for(var t=this._head;t;){var e=t.next;t.prev=t.next=t.animation=null,t=e}this._head=this._tail=null},e.prototype.isFinished=function(){return null==this._head},e.prototype.animate=function(t,e){e=e||{},this.start();var n=new Li(t,e.loop);return this.addAnimator(n),n},e}(Xt),Ei=r.domSupported,zi=(Ri={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},{mouse:Oi=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],touch:["touchstart","touchend","touchmove"],pointer:z(Oi,(function(t){var e=t.replace("mouse","pointer");return Ri.hasOwnProperty(e)?e:t}))}),Vi=["mousemove","mouseup"],Bi=["pointermove","pointerup"],Fi=!1;function Gi(t){var e=t.pointerType;return"pen"===e||"touch"===e}function Wi(t){t&&(t.zrByTouch=!0)}function Hi(t,e){for(var n=e,i=!1;n&&9!==n.nodeType&&!(i=n.domBelongToZr||n!==e&&n===t.painterRoot);)n=n.parentNode;return i}var Yi=function(t,e){this.stopPropagation=xt,this.stopImmediatePropagation=xt,this.preventDefault=xt,this.type=e.type,this.target=this.currentTarget=t.dom,this.pointerType=e.pointerType,this.clientX=e.clientX,this.clientY=e.clientY},Ui={mousedown:function(t){t=le(this.dom,t),this.__mayPointerCapture=[t.zrX,t.zrY],this.trigger("mousedown",t)},mousemove:function(t){t=le(this.dom,t);var e=this.__mayPointerCapture;!e||t.zrX===e[0]&&t.zrY===e[1]||this.__togglePointerCapture(!0),this.trigger("mousemove",t)},mouseup:function(t){t=le(this.dom,t),this.__togglePointerCapture(!1),this.trigger("mouseup",t)},mouseout:function(t){Hi(this,(t=le(this.dom,t)).toElement||t.relatedTarget)||(this.__pointerCapturing&&(t.zrEventControl="no_globalout"),this.trigger("mouseout",t))},wheel:function(t){Fi=!0,t=le(this.dom,t),this.trigger("mousewheel",t)},mousewheel:function(t){Fi||(t=le(this.dom,t),this.trigger("mousewheel",t))},touchstart:function(t){Wi(t=le(this.dom,t)),this.__lastTouchMoment=new Date,this.handler.processGesture(t,"start"),Ui.mousemove.call(this,t),Ui.mousedown.call(this,t)},touchmove:function(t){Wi(t=le(this.dom,t)),this.handler.processGesture(t,"change"),Ui.mousemove.call(this,t)},touchend:function(t){Wi(t=le(this.dom,t)),this.handler.processGesture(t,"end"),Ui.mouseup.call(this,t),+new Date-+this.__lastTouchMoment<300&&Ui.click.call(this,t)},pointerdown:function(t){Ui.mousedown.call(this,t)},pointermove:function(t){Gi(t)||Ui.mousemove.call(this,t)},pointerup:function(t){Ui.mouseup.call(this,t)},pointerout:function(t){Gi(t)||Ui.mouseout.call(this,t)}};E(["click","dblclick","contextmenu"],(function(t){Ui[t]=function(e){e=le(this.dom,e),this.trigger(t,e)}}));var Xi={pointermove:function(t){Gi(t)||Xi.mousemove.call(this,t)},pointerup:function(t){Xi.mouseup.call(this,t)},mousemove:function(t){this.trigger("mousemove",t)},mouseup:function(t){var e=this.__pointerCapturing;this.__togglePointerCapture(!1),this.trigger("mouseup",t),e&&(t.zrEventControl="only_globalout",this.trigger("mouseout",t))}};function Zi(t,e){var n=e.domHandlers;r.pointerEventsSupported?E(zi.pointer,(function(i){qi(e,i,(function(e){n[i].call(t,e)}))})):(r.touchEventsSupported&&E(zi.touch,(function(i){qi(e,i,(function(r){n[i].call(t,r),function(t){t.touching=!0,null!=t.touchTimer&&(clearTimeout(t.touchTimer),t.touchTimer=null),t.touchTimer=setTimeout((function(){t.touching=!1,t.touchTimer=null}),700)}(e)}))})),E(zi.mouse,(function(i){qi(e,i,(function(r){r=se(r),e.touching||n[i].call(t,r)}))})))}function ji(t,e){function n(n){qi(e,n,(function(i){i=se(i),Hi(t,i.target)||(i=function(t,e){return le(t.dom,new Yi(t,e),!0)}(t,i),e.domHandlers[n].call(t,i))}),{capture:!0})}r.pointerEventsSupported?E(Bi,n):r.touchEventsSupported||E(Vi,n)}function qi(t,e,n,i){t.mounted[e]=n,t.listenerOpts[e]=i,ue(t.domTarget,e,n,i)}function Ki(t){var e,n,i,r,o=t.mounted;for(var a in o)o.hasOwnProperty(a)&&(e=t.domTarget,n=a,i=o[a],r=t.listenerOpts[a],e.removeEventListener(n,i,r));t.mounted={}}var $i=function(t,e){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=t,this.domHandlers=e},Ji=function(t){function e(e,n){var i=t.call(this)||this;return i.__pointerCapturing=!1,i.dom=e,i.painterRoot=n,i._localHandlerScope=new $i(e,Ui),Ei&&(i._globalHandlerScope=new $i(document,Xi)),Zi(i,i._localHandlerScope),i}return n(e,t),e.prototype.dispose=function(){Ki(this._localHandlerScope),Ei&&Ki(this._globalHandlerScope)},e.prototype.setCursor=function(t){this.dom.style&&(this.dom.style.cursor=t||"default")},e.prototype.__togglePointerCapture=function(t){if(this.__mayPointerCapture=null,Ei&&+this.__pointerCapturing^+t){this.__pointerCapturing=t;var e=this._globalHandlerScope;t?ji(this,e):Ki(e)}},e}(Xt),Qi=1;r.hasGlobalWindow&&(Qi=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var tr=Qi,er="#333",nr="#ccc",ir=ye,rr=5e-5;function or(t){return t>rr||t<-5e-5}var ar=[],sr=[],lr=[1,0,0,1,0,0],ur=Math.abs,hr=function(){function t(){}return t.prototype.getLocalTransform=function(e){return t.getLocalTransform(this,e)},t.prototype.setPosition=function(t){this.x=t[0],this.y=t[1]},t.prototype.setScale=function(t){this.scaleX=t[0],this.scaleY=t[1]},t.prototype.setSkew=function(t){this.skewX=t[0],this.skewY=t[1]},t.prototype.setOrigin=function(t){this.originX=t[0],this.originY=t[1]},t.prototype.needLocalTransform=function(){return or(this.rotation)||or(this.x)||or(this.y)||or(this.scaleX-1)||or(this.scaleY-1)||or(this.skewX)||or(this.skewY)},t.prototype.updateTransform=function(){var t=this.parent&&this.parent.transform,e=this.needLocalTransform(),n=this.transform;e||t?(n=n||[1,0,0,1,0,0],e?this.getLocalTransform(n):ir(n),t&&(e?me(n,t,n):ve(n,t)),this.transform=n,this._resolveGlobalScaleRatio(n)):n&&ir(n)},t.prototype._resolveGlobalScaleRatio=function(t){var e=this.globalScaleRatio;if(null!=e&&1!==e){this.getGlobalScale(ar);var n=ar[0]<0?-1:1,i=ar[1]<0?-1:1,r=((ar[0]-n)*e+n)/ar[0]||0,o=((ar[1]-i)*e+i)/ar[1]||0;t[0]*=r,t[1]*=r,t[2]*=o,t[3]*=o}this.invTransform=this.invTransform||[1,0,0,1,0,0],we(this.invTransform,t)},t.prototype.getComputedTransform=function(){for(var t=this,e=[];t;)e.push(t),t=t.parent;for(;t=e.pop();)t.updateTransform();return this.transform},t.prototype.setLocalTransform=function(t){if(t){var e=t[0]*t[0]+t[1]*t[1],n=t[2]*t[2]+t[3]*t[3],i=Math.atan2(t[1],t[0]),r=Math.PI/2+i-Math.atan2(t[3],t[2]);n=Math.sqrt(n)*Math.cos(r),e=Math.sqrt(e),this.skewX=r,this.skewY=0,this.rotation=-i,this.x=+t[4],this.y=+t[5],this.scaleX=e,this.scaleY=n,this.originX=0,this.originY=0}},t.prototype.decomposeTransform=function(){if(this.transform){var t=this.parent,e=this.transform;t&&t.transform&&(me(sr,t.invTransform,e),e=sr);var n=this.originX,i=this.originY;(n||i)&&(lr[4]=n,lr[5]=i,me(sr,e,lr),sr[4]-=n,sr[5]-=i,e=sr),this.setLocalTransform(e)}},t.prototype.getGlobalScale=function(t){var e=this.transform;return t=t||[],e?(t[0]=Math.sqrt(e[0]*e[0]+e[1]*e[1]),t[1]=Math.sqrt(e[2]*e[2]+e[3]*e[3]),e[0]<0&&(t[0]=-t[0]),e[3]<0&&(t[1]=-t[1]),t):(t[0]=1,t[1]=1,t)},t.prototype.transformCoordToLocal=function(t,e){var n=[t,e],i=this.invTransform;return i&&Ft(n,n,i),n},t.prototype.transformCoordToGlobal=function(t,e){var n=[t,e],i=this.transform;return i&&Ft(n,n,i),n},t.prototype.getLineScale=function(){var t=this.transform;return t&&ur(t[0]-1)>1e-10&&ur(t[3]-1)>1e-10?Math.sqrt(ur(t[0]*t[3]-t[2]*t[1])):1},t.prototype.copyTransform=function(t){pr(this,t)},t.getLocalTransform=function(t,e){e=e||[];var n=t.originX||0,i=t.originY||0,r=t.scaleX,o=t.scaleY,a=t.anchorX,s=t.anchorY,l=t.rotation||0,u=t.x,h=t.y,c=t.skewX?Math.tan(t.skewX):0,p=t.skewY?Math.tan(-t.skewY):0;if(n||i||a||s){var d=n+a,f=i+s;e[4]=-d*r-c*f*o,e[5]=-f*o-p*d*r}else e[4]=e[5]=0;return e[0]=r,e[3]=o,e[1]=p*r,e[2]=c*o,l&&_e(e,e,l),e[4]+=n+u,e[5]+=i+h,e},t.initDefaultProps=function(){var e=t.prototype;e.scaleX=e.scaleY=e.globalScaleRatio=1,e.x=e.y=e.originX=e.originY=e.skewX=e.skewY=e.rotation=e.anchorX=e.anchorY=0}(),t}(),cr=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function pr(t,e){for(var n=0;n=0?parseFloat(t)/100*e:parseFloat(t):t}function br(t,e,n){var i=e.position||"inside",r=null!=e.distance?e.distance:5,o=n.height,a=n.width,s=o/2,l=n.x,u=n.y,h="left",c="top";if(i instanceof Array)l+=_r(i[0],n.width),u+=_r(i[1],n.height),h=null,c=null;else switch(i){case"left":l-=r,u+=s,h="right",c="middle";break;case"right":l+=r+a,u+=s,c="middle";break;case"top":l+=a/2,u-=r,h="center",c="bottom";break;case"bottom":l+=a/2,u+=o+r,h="center";break;case"inside":l+=a/2,u+=s,h="center",c="middle";break;case"insideLeft":l+=r,u+=s,c="middle";break;case"insideRight":l+=a-r,u+=s,h="right",c="middle";break;case"insideTop":l+=a/2,u+=r,h="center";break;case"insideBottom":l+=a/2,u+=o-r,h="center",c="bottom";break;case"insideTopLeft":l+=r,u+=r;break;case"insideTopRight":l+=a-r,u+=r,h="right";break;case"insideBottomLeft":l+=r,u+=o-r,c="bottom";break;case"insideBottomRight":l+=a-r,u+=o-r,h="right",c="bottom"}return(t=t||{}).x=l,t.y=u,t.align=h,t.verticalAlign=c,t}var wr="__zr_normal__",Sr=cr.concat(["ignore"]),Mr=V(cr,(function(t,e){return t[e]=!0,t}),{ignore:!1}),Ir={},Tr=new Re(0,0,0,0),Cr=function(){function t(t){this.id=M(),this.animators=[],this.currentStates=[],this.states={},this._init(t)}return t.prototype._init=function(t){this.attr(t)},t.prototype.drift=function(t,e,n){switch(this.draggable){case"horizontal":e=0;break;case"vertical":t=0}var i=this.transform;i||(i=this.transform=[1,0,0,1,0,0]),i[4]+=t,i[5]+=e,this.decomposeTransform(),this.markRedraw()},t.prototype.beforeUpdate=function(){},t.prototype.afterUpdate=function(){},t.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},t.prototype.updateInnerText=function(t){var e=this._textContent;if(e&&(!e.ignore||t)){this.textConfig||(this.textConfig={});var n=this.textConfig,i=n.local,r=e.innerTransformable,o=void 0,a=void 0,s=!1;r.parent=i?this:null;var l=!1;if(r.copyTransform(e),null!=n.position){var u=Tr;n.layoutRect?u.copy(n.layoutRect):u.copy(this.getBoundingRect()),i||u.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(Ir,n,u):br(Ir,n,u),r.x=Ir.x,r.y=Ir.y,o=Ir.align,a=Ir.verticalAlign;var h=n.origin;if(h&&null!=n.rotation){var c=void 0,p=void 0;"center"===h?(c=.5*u.width,p=.5*u.height):(c=_r(h[0],u.width),p=_r(h[1],u.height)),l=!0,r.originX=-r.x+c+(i?0:u.x),r.originY=-r.y+p+(i?0:u.y)}}null!=n.rotation&&(r.rotation=n.rotation);var d=n.offset;d&&(r.x+=d[0],r.y+=d[1],l||(r.originX=-d[0],r.originY=-d[1]));var f=null==n.inside?"string"==typeof n.position&&n.position.indexOf("inside")>=0:n.inside,g=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),y=void 0,v=void 0,m=void 0;f&&this.canBeInsideText()?(y=n.insideFill,v=n.insideStroke,null!=y&&"auto"!==y||(y=this.getInsideTextFill()),null!=v&&"auto"!==v||(v=this.getInsideTextStroke(y),m=!0)):(y=n.outsideFill,v=n.outsideStroke,null!=y&&"auto"!==y||(y=this.getOutsideFill()),null!=v&&"auto"!==v||(v=this.getOutsideStroke(y),m=!0)),(y=y||"#000")===g.fill&&v===g.stroke&&m===g.autoStroke&&o===g.align&&a===g.verticalAlign||(s=!0,g.fill=y,g.stroke=v,g.autoStroke=m,g.align=o,g.verticalAlign=a,e.setDefaultTextStyle(g)),e.__dirty|=1,s&&e.dirtyStyle(!0)}},t.prototype.canBeInsideText=function(){return!0},t.prototype.getInsideTextFill=function(){return"#fff"},t.prototype.getInsideTextStroke=function(t){return"#000"},t.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?nr:er},t.prototype.getOutsideStroke=function(t){var e=this.__zr&&this.__zr.getBackgroundColor(),n="string"==typeof e&&Xn(e);n||(n=[255,255,255,1]);for(var i=n[3],r=this.__zr.isDarkMode(),o=0;o<3;o++)n[o]=n[o]*i+(r?0:255)*(1-i);return n[3]=1,ei(n,"rgba")},t.prototype.traverse=function(t,e){},t.prototype.attrKV=function(t,e){"textConfig"===t?this.setTextConfig(e):"textContent"===t?this.setTextContent(e):"clipPath"===t?this.setClipPath(e):"extra"===t?(this.extra=this.extra||{},A(this.extra,e)):this[t]=e},t.prototype.hide=function(){this.ignore=!0,this.markRedraw()},t.prototype.show=function(){this.ignore=!1,this.markRedraw()},t.prototype.attr=function(t,e){if("string"==typeof t)this.attrKV(t,e);else if(q(t))for(var n=G(t),i=0;i0},t.prototype.getState=function(t){return this.states[t]},t.prototype.ensureState=function(t){var e=this.states;return e[t]||(e[t]={}),e[t]},t.prototype.clearStates=function(t){this.useState(wr,!1,t)},t.prototype.useState=function(t,e,n,i){var r=t===wr;if(this.hasState()||!r){var o=this.currentStates,a=this.stateTransition;if(!(P(o,t)>=0)||!e&&1!==o.length){var s;if(this.stateProxy&&!r&&(s=this.stateProxy(t)),s||(s=this.states&&this.states[t]),s||r){r||this.saveCurrentToNormalState(s);var l=!!(s&&s.hoverLayer||i);l&&this._toggleHoverLayerFlag(!0),this._applyStateObj(t,s,this._normalState,e,!n&&!this.__inHover&&a&&a.duration>0,a);var u=this._textContent,h=this._textGuide;return u&&u.useState(t,e,n,l),h&&h.useState(t,e,n,l),r?(this.currentStates=[],this._normalState={}):e?this.currentStates.push(t):this.currentStates=[t],this._updateAnimationTargets(),this.markRedraw(),!l&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2),s}I("State "+t+" not exists.")}}},t.prototype.useStates=function(t,e,n){if(t.length){var i=[],r=this.currentStates,o=t.length,a=o===r.length;if(a)for(var s=0;s0,d);var f=this._textContent,g=this._textGuide;f&&f.useStates(t,e,c),g&&g.useStates(t,e,c),this._updateAnimationTargets(),this.currentStates=t.slice(),this.markRedraw(),!c&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2)}else this.clearStates()},t.prototype._updateAnimationTargets=function(){for(var t=0;t=0){var n=this.currentStates.slice();n.splice(e,1),this.useStates(n)}},t.prototype.replaceState=function(t,e,n){var i=this.currentStates.slice(),r=P(i,t),o=P(i,e)>=0;r>=0?o?i.splice(r,1):i[r]=e:n&&!o&&i.push(e),this.useStates(i)},t.prototype.toggleState=function(t,e){e?this.useState(t,!0):this.removeState(t)},t.prototype._mergeStates=function(t){for(var e,n={},i=0;i=0&&e.splice(n,1)})),this.animators.push(t),n&&n.animation.addAnimator(t),n&&n.wakeUp()},t.prototype.updateDuringAnimation=function(t){this.markRedraw()},t.prototype.stopAnimation=function(t,e){for(var n=this.animators,i=n.length,r=[],o=0;o0&&n.during&&o[0].during((function(t,e){n.during(e)}));for(var p=0;p0||r.force&&!a.length){var w,S=void 0,M=void 0,I=void 0;if(s){M={},p&&(S={});for(_=0;_=0&&(n.splice(i,0,t),this._doAdd(t))}return this},e.prototype.replace=function(t,e){var n=P(this._children,t);return n>=0&&this.replaceAt(e,n),this},e.prototype.replaceAt=function(t,e){var n=this._children,i=n[e];if(t&&t!==this&&t.parent!==this&&t!==i){n[e]=t,i.parent=null;var r=this.__zr;r&&i.removeSelfFromZr(r),this._doAdd(t)}return this},e.prototype._doAdd=function(t){t.parent&&t.parent.remove(t),t.parent=this;var e=this.__zr;e&&e!==t.__zr&&t.addSelfToZr(e),e&&e.refresh()},e.prototype.remove=function(t){var e=this.__zr,n=this._children,i=P(n,t);return i<0||(n.splice(i,1),t.parent=null,e&&t.removeSelfFromZr(e),e&&e.refresh()),this},e.prototype.removeAll=function(){for(var t=this._children,e=this.__zr,n=0;n0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},t.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},t.prototype.wakeUp=function(){this.animation.start(),this._stillFrameAccum=0},t.prototype.refreshHover=function(){this._needsRefreshHover=!0},t.prototype.refreshHoverImmediately=function(){this._needsRefreshHover=!1,this.painter.refreshHover&&"canvas"===this.painter.getType()&&this.painter.refreshHover()},t.prototype.resize=function(t){t=t||{},this.painter.resize(t.width,t.height),this.handler.resize()},t.prototype.clearAnimation=function(){this.animation.clear()},t.prototype.getWidth=function(){return this.painter.getWidth()},t.prototype.getHeight=function(){return this.painter.getHeight()},t.prototype.setCursorStyle=function(t){this.handler.setCursorStyle(t)},t.prototype.findHover=function(t,e){return this.handler.findHover(t,e)},t.prototype.on=function(t,e,n){return this.handler.on(t,e,n),this},t.prototype.off=function(t,e){this.handler.off(t,e)},t.prototype.trigger=function(t,e){this.handler.trigger(t,e)},t.prototype.clear=function(){for(var t=this.storage.getRoots(),e=0;e0){if(t<=r)return a;if(t>=o)return s}else{if(t>=r)return a;if(t<=o)return s}else{if(t===r)return a;if(t===o)return s}return(t-r)/l*u+a}function Gr(t,e){switch(t){case"center":case"middle":t="50%";break;case"left":case"top":t="0%";break;case"right":case"bottom":t="100%"}return X(t)?(n=t,n.replace(/^\s+|\s+$/g,"")).match(/%$/)?parseFloat(t)/100*e:parseFloat(t):null==t?NaN:+t;var n}function Wr(t,e,n){return null==e&&(e=10),e=Math.min(Math.max(0,e),20),t=(+t).toFixed(e),n?t:+t}function Hr(t){return t.sort((function(t,e){return t-e})),t}function Yr(t){if(t=+t,isNaN(t))return 0;if(t>1e-14)for(var e=1,n=0;n<15;n++,e*=10)if(Math.round(t*e)/e===t)return n;return Ur(t)}function Ur(t){var e=t.toString().toLowerCase(),n=e.indexOf("e"),i=n>0?+e.slice(n+1):0,r=n>0?n:e.length,o=e.indexOf("."),a=o<0?0:r-1-o;return Math.max(0,a-i)}function Xr(t,e){var n=Math.log,i=Math.LN10,r=Math.floor(n(t[1]-t[0])/i),o=Math.round(n(Math.abs(e[1]-e[0]))/i),a=Math.min(Math.max(-r+o,0),20);return isFinite(a)?a:20}function Zr(t,e){var n=V(t,(function(t,e){return t+(isNaN(e)?0:e)}),0);if(0===n)return[];for(var i=Math.pow(10,e),r=z(t,(function(t){return(isNaN(t)?0:t)/n*i*100})),o=100*i,a=z(r,(function(t){return Math.floor(t)})),s=V(a,(function(t,e){return t+e}),0),l=z(r,(function(t,e){return t-a[e]}));su&&(u=l[c],h=c);++a[h],l[h]=0,++s}return z(a,(function(t){return t/i}))}function jr(t,e){var n=Math.max(Yr(t),Yr(e)),i=t+e;return n>20?i:Wr(i,n)}var qr=9007199254740991;function Kr(t){var e=2*Math.PI;return(t%e+e)%e}function $r(t){return t>-1e-4&&t=10&&e++,e}function no(t,e){var n=eo(t),i=Math.pow(10,n),r=t/i;return t=(e?r<1.5?1:r<2.5?2:r<4?3:r<7?5:10:r<1?1:r<2?2:r<3?3:r<5?5:10)*i,n>=-20?+t.toFixed(n<0?-n:0):t}function io(t,e){var n=(t.length-1)*e+1,i=Math.floor(n),r=+t[i-1],o=n-i;return o?r+o*(t[i]-r):r}function ro(t){t.sort((function(t,e){return s(t,e,0)?-1:1}));for(var e=-1/0,n=1,i=0;i=0||r&&P(r,s)<0)){var l=n.getShallow(s,e);null!=l&&(o[t[a][0]]=l)}}return o}}var jo=Zo([["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]]),qo=function(){function t(){}return t.prototype.getAreaStyle=function(t,e){return jo(this,t,e)},t}(),Ko=new On(50);function $o(t){if("string"==typeof t){var e=Ko.get(t);return e&&e.image}return t}function Jo(t,e,n,i,r){if(t){if("string"==typeof t){if(e&&e.__zrImageSrc===t||!n)return e;var o=Ko.get(t),a={hostEl:n,cb:i,cbPayload:r};return o?!ta(e=o.image)&&o.pending.push(a):((e=h.loadImage(t,Qo,Qo)).__zrImageSrc=t,Ko.put(t,e.__cachedImgObj={image:e,pending:[a]})),e}return t}return e}function Qo(){var t=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e=a;l++)s-=a;var u=fr(n,e);return u>s&&(n="",u=0),s=t-u,r.ellipsis=n,r.ellipsisWidth=u,r.contentWidth=s,r.containerWidth=t,r}function ra(t,e){var n=e.containerWidth,i=e.font,r=e.contentWidth;if(!n)return"";var o=fr(t,i);if(o<=n)return t;for(var a=0;;a++){if(o<=r||a>=e.maxIterations){t+=e.ellipsis;break}var s=0===a?oa(t,r,e.ascCharWidth,e.cnCharWidth):o>0?Math.floor(t.length*r/o):0;o=fr(t=t.substr(0,s),i)}return""===t&&(t=e.placeholder),t}function oa(t,e,n,i){for(var r=0,o=0,a=t.length;o0&&f+i.accumWidth>i.width&&(o=e.split("\n"),c=!0),i.accumWidth=f}else{var g=pa(e,h,i.width,i.breakAll,i.accumWidth);i.accumWidth=g.accumWidth+d,a=g.linesWidths,o=g.lines}}else o=e.split("\n");for(var y=0;y=33&&e<=383}(t)||!!ha[t]}function pa(t,e,n,i,r){for(var o=[],a=[],s="",l="",u=0,h=0,c=0;cn:r+h+d>n)?h?(s||l)&&(f?(s||(s=l,l="",h=u=0),o.push(s),a.push(h-u),l+=p,s="",h=u+=d):(l&&(s+=l,l="",u=0),o.push(s),a.push(h),s=p,h=d)):f?(o.push(l),a.push(u),l=p,u=d):(o.push(p),a.push(d)):(h+=d,f?(l+=p,u+=d):(l&&(s+=l,l="",u=0),s+=p))}else l&&(s+=l,h+=u),o.push(s),a.push(h),s="",l="",u=0,h=0}return o.length||s||(s=t,l="",u=0),l&&(s+=l),s&&(o.push(s),a.push(h)),1===o.length&&(h+=r),{accumWidth:h,lines:o,linesWidths:a}}var da="__zr_style_"+Math.round(10*Math.random()),fa={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},ga={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};fa[da]=!0;var ya=["z","z2","invisible"],va=["invisible"],ma=function(t){function e(e){return t.call(this,e)||this}var i;return n(e,t),e.prototype._init=function(e){for(var n=G(e),i=0;i1e-4)return s[0]=t-n,s[1]=e-i,l[0]=t+n,void(l[1]=e+i);if(Ta[0]=Ma(r)*n+t,Ta[1]=Sa(r)*i+e,Ca[0]=Ma(o)*n+t,Ca[1]=Sa(o)*i+e,u(s,Ta,Ca),h(l,Ta,Ca),(r%=Ia)<0&&(r+=Ia),(o%=Ia)<0&&(o+=Ia),r>o&&!a?o+=Ia:rr&&(Da[0]=Ma(d)*n+t,Da[1]=Sa(d)*i+e,u(s,Da,s),h(l,Da,l))}var Ea={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},za=[],Va=[],Ba=[],Fa=[],Ga=[],Wa=[],Ha=Math.min,Ya=Math.max,Ua=Math.cos,Xa=Math.sin,Za=Math.abs,ja=Math.PI,qa=2*ja,Ka="undefined"!=typeof Float32Array,$a=[];function Ja(t){return Math.round(t/ja*1e8)/1e8%2*ja}function Qa(t,e){var n=Ja(t[0]);n<0&&(n+=qa);var i=n-t[0],r=t[1];r+=i,!e&&r-n>=qa?r=n+qa:e&&n-r>=qa?r=n-qa:!e&&n>r?r=n+(qa-Ja(n-r)):e&&n0&&(this._ux=Za(n/tr/t)||0,this._uy=Za(n/tr/e)||0)},t.prototype.setDPR=function(t){this.dpr=t},t.prototype.setContext=function(t){this._ctx=t},t.prototype.getContext=function(){return this._ctx},t.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},t.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},t.prototype.moveTo=function(t,e){return this._drawPendingPt(),this.addData(Ea.M,t,e),this._ctx&&this._ctx.moveTo(t,e),this._x0=t,this._y0=e,this._xi=t,this._yi=e,this},t.prototype.lineTo=function(t,e){var n=Za(t-this._xi),i=Za(e-this._yi),r=n>this._ux||i>this._uy;if(this.addData(Ea.L,t,e),this._ctx&&r&&this._ctx.lineTo(t,e),r)this._xi=t,this._yi=e,this._pendingPtDist=0;else{var o=n*n+i*i;o>this._pendingPtDist&&(this._pendingPtX=t,this._pendingPtY=e,this._pendingPtDist=o)}return this},t.prototype.bezierCurveTo=function(t,e,n,i,r,o){return this._drawPendingPt(),this.addData(Ea.C,t,e,n,i,r,o),this._ctx&&this._ctx.bezierCurveTo(t,e,n,i,r,o),this._xi=r,this._yi=o,this},t.prototype.quadraticCurveTo=function(t,e,n,i){return this._drawPendingPt(),this.addData(Ea.Q,t,e,n,i),this._ctx&&this._ctx.quadraticCurveTo(t,e,n,i),this._xi=n,this._yi=i,this},t.prototype.arc=function(t,e,n,i,r,o){this._drawPendingPt(),$a[0]=i,$a[1]=r,Qa($a,o),i=$a[0];var a=(r=$a[1])-i;return this.addData(Ea.A,t,e,n,n,i,a,0,o?0:1),this._ctx&&this._ctx.arc(t,e,n,i,r,o),this._xi=Ua(r)*n+t,this._yi=Xa(r)*n+e,this},t.prototype.arcTo=function(t,e,n,i,r){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(t,e,n,i,r),this},t.prototype.rect=function(t,e,n,i){return this._drawPendingPt(),this._ctx&&this._ctx.rect(t,e,n,i),this.addData(Ea.R,t,e,n,i),this},t.prototype.closePath=function(){this._drawPendingPt(),this.addData(Ea.Z);var t=this._ctx,e=this._x0,n=this._y0;return t&&t.closePath(),this._xi=e,this._yi=n,this},t.prototype.fill=function(t){t&&t.fill(),this.toStatic()},t.prototype.stroke=function(t){t&&t.stroke(),this.toStatic()},t.prototype.len=function(){return this._len},t.prototype.setData=function(t){var e=t.length;this.data&&this.data.length===e||!Ka||(this.data=new Float32Array(e));for(var n=0;nu.length&&(this._expandData(),u=this.data);for(var h=0;h0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},t.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var t=[],e=0;e11&&(this.data=new Float32Array(t)))}},t.prototype.getBoundingRect=function(){Ba[0]=Ba[1]=Ga[0]=Ga[1]=Number.MAX_VALUE,Fa[0]=Fa[1]=Wa[0]=Wa[1]=-Number.MAX_VALUE;var t,e=this.data,n=0,i=0,r=0,o=0;for(t=0;tn||Za(y)>i||c===e-1)&&(f=Math.sqrt(A*A+y*y),r=g,o=x);break;case Ea.C:var v=t[c++],m=t[c++],x=(g=t[c++],t[c++]),_=t[c++],b=t[c++];f=bn(r,o,v,m,g,x,_,b,10),r=_,o=b;break;case Ea.Q:f=Cn(r,o,v=t[c++],m=t[c++],g=t[c++],x=t[c++],10),r=g,o=x;break;case Ea.A:var w=t[c++],S=t[c++],M=t[c++],I=t[c++],T=t[c++],C=t[c++],D=C+T;c+=1;t[c++];d&&(a=Ua(T)*M+w,s=Xa(T)*I+S),f=Ya(M,I)*Ha(qa,Math.abs(C)),r=Ua(D)*M+w,o=Xa(D)*I+S;break;case Ea.R:a=r=t[c++],s=o=t[c++],f=2*t[c++]+2*t[c++];break;case Ea.Z:var A=a-r;y=s-o;f=Math.sqrt(A*A+y*y),r=a,o=s}f>=0&&(l[h++]=f,u+=f)}return this._pathLen=u,u},t.prototype.rebuildPath=function(t,e){var n,i,r,o,a,s,l,u,h,c,p=this.data,d=this._ux,f=this._uy,g=this._len,y=e<1,v=0,m=0,x=0;if(!y||(this._pathSegLen||this._calculateLength(),l=this._pathSegLen,u=e*this._pathLen))t:for(var _=0;_0&&(t.lineTo(h,c),x=0),b){case Ea.M:n=r=p[_++],i=o=p[_++],t.moveTo(r,o);break;case Ea.L:a=p[_++],s=p[_++];var S=Za(a-r),M=Za(s-o);if(S>d||M>f){if(y){if(v+(j=l[m++])>u){var I=(u-v)/j;t.lineTo(r*(1-I)+a*I,o*(1-I)+s*I);break t}v+=j}t.lineTo(a,s),r=a,o=s,x=0}else{var T=S*S+M*M;T>x&&(h=a,c=s,x=T)}break;case Ea.C:var C=p[_++],D=p[_++],A=p[_++],k=p[_++],L=p[_++],P=p[_++];if(y){if(v+(j=l[m++])>u){xn(r,C,A,L,I=(u-v)/j,za),xn(o,D,k,P,I,Va),t.bezierCurveTo(za[1],Va[1],za[2],Va[2],za[3],Va[3]);break t}v+=j}t.bezierCurveTo(C,D,A,k,L,P),r=L,o=P;break;case Ea.Q:C=p[_++],D=p[_++],A=p[_++],k=p[_++];if(y){if(v+(j=l[m++])>u){In(r,C,A,I=(u-v)/j,za),In(o,D,k,I,Va),t.quadraticCurveTo(za[1],Va[1],za[2],Va[2]);break t}v+=j}t.quadraticCurveTo(C,D,A,k),r=A,o=k;break;case Ea.A:var O=p[_++],R=p[_++],N=p[_++],E=p[_++],z=p[_++],V=p[_++],B=p[_++],F=!p[_++],G=N>E?N:E,W=Za(N-E)>.001,H=z+V,Y=!1;if(y)v+(j=l[m++])>u&&(H=z+V*(u-v)/j,Y=!0),v+=j;if(W&&t.ellipse?t.ellipse(O,R,N,E,B,z,H,F):t.arc(O,R,G,z,H,F),Y)break t;w&&(n=Ua(z)*N+O,i=Xa(z)*E+R),r=Ua(H)*N+O,o=Xa(H)*E+R;break;case Ea.R:n=r=p[_],i=o=p[_+1],a=p[_++],s=p[_++];var U=p[_++],X=p[_++];if(y){if(v+(j=l[m++])>u){var Z=u-v;t.moveTo(a,s),t.lineTo(a+Ha(Z,U),s),(Z-=U)>0&&t.lineTo(a+U,s+Ha(Z,X)),(Z-=X)>0&&t.lineTo(a+Ya(U-Z,0),s+X),(Z-=U)>0&&t.lineTo(a,s+Ya(X-Z,0));break t}v+=j}t.rect(a,s,U,X);break;case Ea.Z:if(y){var j;if(v+(j=l[m++])>u){I=(u-v)/j;t.lineTo(r*(1-I)+n*I,o*(1-I)+i*I);break t}v+=j}t.closePath(),r=n,o=i}}},t.prototype.clone=function(){var e=new t,n=this.data;return e.data=n.slice?n.slice():Array.prototype.slice.call(n),e._len=this._len,e},t.CMD=Ea,t.initDefaultProps=function(){var e=t.prototype;e._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,e._version=0}(),t}();function es(t,e,n,i,r,o,a){if(0===r)return!1;var s=r,l=0;if(a>e+s&&a>i+s||at+s&&o>n+s||oe+c&&h>i+c&&h>o+c&&h>s+c||ht+c&&u>n+c&&u>r+c&&u>a+c||ue+u&&l>i+u&&l>o+u||lt+u&&s>n+u&&s>r+u||sn||h+ur&&(r+=as);var p=Math.atan2(l,s);return p<0&&(p+=as),p>=i&&p<=r||p+as>=i&&p+as<=r}function ls(t,e,n,i,r,o){if(o>e&&o>i||or?s:0}var us=ts.CMD,hs=2*Math.PI;var cs=[-1,-1,-1],ps=[-1,-1];function ds(t,e,n,i,r,o,a,s,l,u){if(u>e&&u>i&&u>o&&u>s||u1&&(h=void 0,h=ps[0],ps[0]=ps[1],ps[1]=h),f=gn(e,i,o,s,ps[0]),d>1&&(g=gn(e,i,o,s,ps[1]))),2===d?ve&&s>i&&s>o||s=0&&h<=1&&(r[l++]=h);else{var u=a*a-4*o*s;if(dn(u))(h=-a/(2*o))>=0&&h<=1&&(r[l++]=h);else if(u>0){var h,c=on(u),p=(-a-c)/(2*o);(h=(-a+c)/(2*o))>=0&&h<=1&&(r[l++]=h),p>=0&&p<=1&&(r[l++]=p)}}return l}(e,i,o,s,cs);if(0===l)return 0;var u=Mn(e,i,o);if(u>=0&&u<=1){for(var h=0,c=wn(e,i,o,u),p=0;pn||s<-n)return 0;var l=Math.sqrt(n*n-s*s);cs[0]=-l,cs[1]=l;var u=Math.abs(i-r);if(u<1e-4)return 0;if(u>=hs-1e-4){i=0,r=hs;var h=o?1:-1;return a>=cs[0]+t&&a<=cs[1]+t?h:0}if(i>r){var c=i;i=r,r=c}i<0&&(i+=hs,r+=hs);for(var p=0,d=0;d<2;d++){var f=cs[d];if(f+t>a){var g=Math.atan2(s,f);h=o?1:-1;g<0&&(g=hs+g),(g>=i&&g<=r||g+hs>=i&&g+hs<=r)&&(g>Math.PI/2&&g<1.5*Math.PI&&(h=-h),p+=h)}}return p}function ys(t,e,n,i,r){for(var o,a,s,l,u=t.data,h=t.len(),c=0,p=0,d=0,f=0,g=0,y=0;y1&&(n||(c+=ls(p,d,f,g,i,r))),m&&(f=p=u[y],g=d=u[y+1]),v){case us.M:p=f=u[y++],d=g=u[y++];break;case us.L:if(n){if(es(p,d,u[y],u[y+1],e,i,r))return!0}else c+=ls(p,d,u[y],u[y+1],i,r)||0;p=u[y++],d=u[y++];break;case us.C:if(n){if(ns(p,d,u[y++],u[y++],u[y++],u[y++],u[y],u[y+1],e,i,r))return!0}else c+=ds(p,d,u[y++],u[y++],u[y++],u[y++],u[y],u[y+1],i,r)||0;p=u[y++],d=u[y++];break;case us.Q:if(n){if(is(p,d,u[y++],u[y++],u[y],u[y+1],e,i,r))return!0}else c+=fs(p,d,u[y++],u[y++],u[y],u[y+1],i,r)||0;p=u[y++],d=u[y++];break;case us.A:var x=u[y++],_=u[y++],b=u[y++],w=u[y++],S=u[y++],M=u[y++];y+=1;var I=!!(1-u[y++]);o=Math.cos(S)*b+x,a=Math.sin(S)*w+_,m?(f=o,g=a):c+=ls(p,d,o,a,i,r);var T=(i-x)*w/b+x;if(n){if(ss(x,_,w,S,S+M,I,e,T,r))return!0}else c+=gs(x,_,w,S,S+M,I,T,r);p=Math.cos(S+M)*b+x,d=Math.sin(S+M)*w+_;break;case us.R:if(f=p=u[y++],g=d=u[y++],o=f+u[y++],a=g+u[y++],n){if(es(f,g,o,g,e,i,r)||es(o,g,o,a,e,i,r)||es(o,a,f,a,e,i,r)||es(f,a,f,g,e,i,r))return!0}else c+=ls(o,g,o,a,i,r),c+=ls(f,a,f,g,i,r);break;case us.Z:if(n){if(es(p,d,f,g,e,i,r))return!0}else c+=ls(p,d,f,g,i,r);p=f,d=g}}return n||(s=d,l=g,Math.abs(s-l)<1e-4)||(c+=ls(p,d,f,g,i,r)||0),0!==c}var vs=k({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},fa),ms={style:k({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},ga.style)},xs=cr.concat(["invisible","culling","z","z2","zlevel","parent"]),_s=function(t){function e(e){return t.call(this,e)||this}var i;return n(e,t),e.prototype.update=function(){var n=this;t.prototype.update.call(this);var i=this.style;if(i.decal){var r=this._decalEl=this._decalEl||new e;r.buildPath===e.prototype.buildPath&&(r.buildPath=function(t){n.buildPath(t,n.shape)}),r.silent=!0;var o=r.style;for(var a in i)o[a]!==i[a]&&(o[a]=i[a]);o.fill=i.fill?i.decal:null,o.decal=null,o.shadowColor=null,i.strokeFirst&&(o.stroke=null);for(var s=0;s.5?er:e>.2?"#eee":nr}if(t)return nr}return er},e.prototype.getInsideTextStroke=function(t){var e=this.style.fill;if(X(e)){var n=this.__zr;if(!(!n||!n.isDarkMode())===ni(t,0)<.4)return e}},e.prototype.buildPath=function(t,e,n){},e.prototype.pathUpdated=function(){this.__dirty&=-5},e.prototype.getUpdatedPathProxy=function(t){return!this.path&&this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,t),this.path},e.prototype.createPathProxy=function(){this.path=new ts(!1)},e.prototype.hasStroke=function(){var t=this.style,e=t.stroke;return!(null==e||"none"===e||!(t.lineWidth>0))},e.prototype.hasFill=function(){var t=this.style.fill;return null!=t&&"none"!==t},e.prototype.getBoundingRect=function(){var t=this._rect,e=this.style,n=!t;if(n){var i=!1;this.path||(i=!0,this.createPathProxy());var r=this.path;(i||4&this.__dirty)&&(r.beginPath(),this.buildPath(r,this.shape,!1),this.pathUpdated()),t=r.getBoundingRect()}if(this._rect=t,this.hasStroke()&&this.path&&this.path.len()>0){var o=this._rectStroke||(this._rectStroke=t.clone());if(this.__dirty||n){o.copy(t);var a=e.strokeNoScale?this.getLineScale():1,s=e.lineWidth;if(!this.hasFill()){var l=this.strokeContainThreshold;s=Math.max(s,null==l?4:l)}a>1e-10&&(o.width+=s/a,o.height+=s/a,o.x-=s/a/2,o.y-=s/a/2)}return o}return t},e.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e),i=this.getBoundingRect(),r=this.style;if(t=n[0],e=n[1],i.contain(t,e)){var o=this.path;if(this.hasStroke()){var a=r.lineWidth,s=r.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(this.hasFill()||(a=Math.max(a,this.strokeContainThreshold)),function(t,e,n,i){return ys(t,e,!0,n,i)}(o,a/s,t,e)))return!0}if(this.hasFill())return function(t,e,n){return ys(t,0,!1,e,n)}(o,t,e)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=4,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},e.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},e.prototype.animateShape=function(t){return this.animate("shape",t)},e.prototype.updateDuringAnimation=function(t){"style"===t?this.dirtyStyle():"shape"===t?this.dirtyShape():this.markRedraw()},e.prototype.attrKV=function(e,n){"shape"===e?this.setShape(n):t.prototype.attrKV.call(this,e,n)},e.prototype.setShape=function(t,e){var n=this.shape;return n||(n=this.shape={}),"string"==typeof t?n[t]=e:A(n,t),this.dirtyShape(),this},e.prototype.shapeChanged=function(){return!!(4&this.__dirty)},e.prototype.createStyle=function(t){return yt(vs,t)},e.prototype._innerSaveToNormal=function(e){t.prototype._innerSaveToNormal.call(this,e);var n=this._normalState;e.shape&&!n.shape&&(n.shape=A({},this.shape))},e.prototype._applyStateObj=function(e,n,i,r,o,a){t.prototype._applyStateObj.call(this,e,n,i,r,o,a);var s,l=!(n&&r);if(n&&n.shape?o?r?s=n.shape:(s=A({},i.shape),A(s,n.shape)):(s=A({},r?this.shape:i.shape),A(s,n.shape)):l&&(s=i.shape),s)if(o){this.shape=A({},this.shape);for(var u={},h=G(s),c=0;c0},e.prototype.hasFill=function(){var t=this.style.fill;return null!=t&&"none"!==t},e.prototype.createStyle=function(t){return yt(bs,t)},e.prototype.setBoundingRect=function(t){this._rect=t},e.prototype.getBoundingRect=function(){var t=this.style;if(!this._rect){var e=t.text;null!=e?e+="":e="";var n=yr(e,t.font,t.textAlign,t.textBaseline);if(n.x+=t.x||0,n.y+=t.y||0,this.hasStroke()){var i=t.lineWidth;n.x-=i/2,n.y-=i/2,n.width+=i,n.height+=i}this._rect=n}return this._rect},e.initDefaultProps=void(e.prototype.dirtyRectTolerance=10),e}(ma);ws.prototype.type="tspan";var Ss=k({x:0,y:0},fa),Ms={style:k({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},ga.style)};var Is=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.createStyle=function(t){return yt(Ss,t)},e.prototype._getSize=function(t){var e=this.style,n=e[t];if(null!=n)return n;var i,r=(i=e.image)&&"string"!=typeof i&&i.width&&i.height?e.image:this.__image;if(!r)return 0;var o="width"===t?"height":"width",a=e[o];return null==a?r[t]:r[t]/r[o]*a},e.prototype.getWidth=function(){return this._getSize("width")},e.prototype.getHeight=function(){return this._getSize("height")},e.prototype.getAnimationStyleProps=function(){return Ms},e.prototype.getBoundingRect=function(){var t=this.style;return this._rect||(this._rect=new Re(t.x||0,t.y||0,this.getWidth(),this.getHeight())),this._rect},e}(ma);Is.prototype.type="image";var Ts=Math.round;function Cs(t,e,n){if(e){var i=e.x1,r=e.x2,o=e.y1,a=e.y2;t.x1=i,t.x2=r,t.y1=o,t.y2=a;var s=n&&n.lineWidth;return s?(Ts(2*i)===Ts(2*r)&&(t.x1=t.x2=As(i,s,!0)),Ts(2*o)===Ts(2*a)&&(t.y1=t.y2=As(o,s,!0)),t):t}}function Ds(t,e,n){if(e){var i=e.x,r=e.y,o=e.width,a=e.height;t.x=i,t.y=r,t.width=o,t.height=a;var s=n&&n.lineWidth;return s?(t.x=As(i,s,!0),t.y=As(r,s,!0),t.width=Math.max(As(i+o,s,!1)-t.x,0===o?0:1),t.height=Math.max(As(r+a,s,!1)-t.y,0===a?0:1),t):t}}function As(t,e,n){if(!e)return t;var i=Ts(2*t);return(i+Ts(e))%2==0?i/2:(i+(n?1:-1))/2}var ks=function(){this.x=0,this.y=0,this.width=0,this.height=0},Ls={},Ps=function(t){function e(e){return t.call(this,e)||this}return n(e,t),e.prototype.getDefaultShape=function(){return new ks},e.prototype.buildPath=function(t,e){var n,i,r,o;if(this.subPixelOptimize){var a=Ds(Ls,e,this.style);n=a.x,i=a.y,r=a.width,o=a.height,a.r=e.r,e=a}else n=e.x,i=e.y,r=e.width,o=e.height;e.r?function(t,e){var n,i,r,o,a,s=e.x,l=e.y,u=e.width,h=e.height,c=e.r;u<0&&(s+=u,u=-u),h<0&&(l+=h,h=-h),"number"==typeof c?n=i=r=o=c:c instanceof Array?1===c.length?n=i=r=o=c[0]:2===c.length?(n=r=c[0],i=o=c[1]):3===c.length?(n=c[0],i=o=c[1],r=c[2]):(n=c[0],i=c[1],r=c[2],o=c[3]):n=i=r=o=0,n+i>u&&(n*=u/(a=n+i),i*=u/a),r+o>u&&(r*=u/(a=r+o),o*=u/a),i+r>h&&(i*=h/(a=i+r),r*=h/a),n+o>h&&(n*=h/(a=n+o),o*=h/a),t.moveTo(s+n,l),t.lineTo(s+u-i,l),0!==i&&t.arc(s+u-i,l+i,i,-Math.PI/2,0),t.lineTo(s+u,l+h-r),0!==r&&t.arc(s+u-r,l+h-r,r,0,Math.PI/2),t.lineTo(s+o,l+h),0!==o&&t.arc(s+o,l+h-o,o,Math.PI/2,Math.PI),t.lineTo(s,l+n),0!==n&&t.arc(s+n,l+n,n,Math.PI,1.5*Math.PI)}(t,e):t.rect(n,i,r,o)},e.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},e}(_s);Ps.prototype.type="rect";var Os={fill:"#000"},Rs={style:k({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},ga.style)},Ns=function(t){function e(e){var n=t.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=Os,n.attr(e),n}return n(e,t),e.prototype.childrenRef=function(){return this._children},e.prototype.update=function(){t.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var e=0;ed&&h){var f=Math.floor(d/l);n=n.slice(0,f)}if(t&&a&&null!=c)for(var g=ia(c,o,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),y=0;y0,T=null!=t.width&&("truncate"===t.overflow||"break"===t.overflow||"breakAll"===t.overflow),C=i.calculatedLineHeight,D=0;Dl&&ua(n,t.substring(l,u),e,s),ua(n,i[2],e,s,i[1]),l=ea.lastIndex}lo){b>0?(m.tokens=m.tokens.slice(0,b),y(m,_,x),n.lines=n.lines.slice(0,v+1)):n.lines=n.lines.slice(0,v);break t}var C=w.width,D=null==C||"auto"===C;if("string"==typeof C&&"%"===C.charAt(C.length-1))P.percentWidth=C,h.push(P),P.contentWidth=fr(P.text,I);else{if(D){var A=w.backgroundColor,k=A&&A.image;k&&ta(k=$o(k))&&(P.width=Math.max(P.width,k.width*T/k.height))}var L=f&&null!=r?r-_:null;null!=L&&L=0&&"right"===(C=x[T]).align;)this._placeToken(C,t,b,f,I,"right",y),w-=C.width,I-=C.width,T--;for(M+=(n-(M-d)-(g-I)-w)/2;S<=T;)C=x[S],this._placeToken(C,t,b,f,M+C.width/2,"center",y),M+=C.width,S++;f+=b}},e.prototype._placeToken=function(t,e,n,i,r,o,s){var l=e.rich[t.styleName]||{};l.text=t.text;var u=t.verticalAlign,h=i+n/2;"top"===u?h=i+t.height/2:"bottom"===u&&(h=i+n-t.height/2),!t.isLineHolder&&Zs(l)&&this._renderBackground(l,e,"right"===o?r-t.width:"center"===o?r-t.width/2:r,h-t.height/2,t.width,t.height);var c=!!l.backgroundColor,p=t.textPadding;p&&(r=Us(r,o,p),h-=t.height/2-p[0]-t.innerHeight/2);var d=this._getOrCreateChild(ws),f=d.createStyle();d.useStyle(f);var g=this._defaultStyle,y=!1,v=0,m=Ys("fill"in l?l.fill:"fill"in e?e.fill:(y=!0,g.fill)),x=Hs("stroke"in l?l.stroke:"stroke"in e?e.stroke:c||s||g.autoStroke&&!y?null:(v=2,g.stroke)),_=l.textShadowBlur>0||e.textShadowBlur>0;f.text=t.text,f.x=r,f.y=h,_&&(f.shadowBlur=l.textShadowBlur||e.textShadowBlur||0,f.shadowColor=l.textShadowColor||e.textShadowColor||"transparent",f.shadowOffsetX=l.textShadowOffsetX||e.textShadowOffsetX||0,f.shadowOffsetY=l.textShadowOffsetY||e.textShadowOffsetY||0),f.textAlign=o,f.textBaseline="middle",f.font=t.font||a,f.opacity=ot(l.opacity,e.opacity,1),Fs(f,l),x&&(f.lineWidth=ot(l.lineWidth,e.lineWidth,v),f.lineDash=rt(l.lineDash,e.lineDash),f.lineDashOffset=e.lineDashOffset||0,f.stroke=x),m&&(f.fill=m);var b=t.contentWidth,w=t.contentHeight;d.setBoundingRect(new Re(vr(f.x,b,f.textAlign),mr(f.y,w,f.textBaseline),b,w))},e.prototype._renderBackground=function(t,e,n,i,r,o){var a,s,l,u=t.backgroundColor,h=t.borderWidth,c=t.borderColor,p=u&&u.image,d=u&&!p,f=t.borderRadius,g=this;if(d||t.lineHeight||h&&c){(a=this._getOrCreateChild(Ps)).useStyle(a.createStyle()),a.style.fill=null;var y=a.shape;y.x=n,y.y=i,y.width=r,y.height=o,y.r=f,a.dirtyShape()}if(d)(l=a.style).fill=u||null,l.fillOpacity=rt(t.fillOpacity,1);else if(p){(s=this._getOrCreateChild(Is)).onload=function(){g.dirtyStyle()};var v=s.style;v.image=u.image,v.x=n,v.y=i,v.width=r,v.height=o}h&&c&&((l=a.style).lineWidth=h,l.stroke=c,l.strokeOpacity=rt(t.strokeOpacity,1),l.lineDash=t.borderDash,l.lineDashOffset=t.borderDashOffset||0,a.strokeContainThreshold=0,a.hasFill()&&a.hasStroke()&&(l.strokeFirst=!0,l.lineWidth*=2));var m=(a||s).style;m.shadowBlur=t.shadowBlur||0,m.shadowColor=t.shadowColor||"transparent",m.shadowOffsetX=t.shadowOffsetX||0,m.shadowOffsetY=t.shadowOffsetY||0,m.opacity=ot(t.opacity,e.opacity,1)},e.makeFont=function(t){var e="";return Gs(t)&&(e=[t.fontStyle,t.fontWeight,Bs(t.fontSize),t.fontFamily||"sans-serif"].join(" ")),e&&ut(e)||t.textFont||t.font},e}(ma),Es={left:!0,right:1,center:1},zs={top:1,bottom:1,middle:1},Vs=["fontStyle","fontWeight","fontSize","fontFamily"];function Bs(t){return"string"!=typeof t||-1===t.indexOf("px")&&-1===t.indexOf("rem")&&-1===t.indexOf("em")?isNaN(+t)?"12px":t+"px":t}function Fs(t,e){for(var n=0;n=0,o=!1;if(t instanceof _s){var a=Js(t),s=r&&a.selectFill||a.normalFill,l=r&&a.selectStroke||a.normalStroke;if(ll(s)||ll(l)){var u=(i=i||{}).style||{};"inherit"===u.fill?(o=!0,i=A({},i),(u=A({},u)).fill=s):!ll(u.fill)&&ll(s)?(o=!0,i=A({},i),(u=A({},u)).fill=hl(s)):!ll(u.stroke)&&ll(l)&&(o||(i=A({},i),u=A({},u)),u.stroke=hl(l)),i.style=u}}if(i&&null==i.z2){o||(i=A({},i));var h=t.z2EmphasisLift;i.z2=t.z2+(null!=h?h:nl)}return i}(this,0,e,n);if("blur"===t)return function(t,e,n){var i=P(t.currentStates,e)>=0,r=t.style.opacity,o=i?null:function(t,e,n,i){for(var r=t.style,o={},a=0;a0){var o={dataIndex:r,seriesIndex:t.seriesIndex};null!=i&&(o.dataType=i),e.push(o)}}))})),e}function Vl(t,e,n){Yl(t,!0),xl(t,wl),Fl(t,e,n)}function Bl(t,e,n,i){i?function(t){Yl(t,!1)}(t):Vl(t,e,n)}function Fl(t,e,n){var i=js(t);null!=e?(i.focus=e,i.blurScope=n):i.focus&&(i.focus=null)}var Gl=["emphasis","blur","select"],Wl={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function Hl(t,e,n,i){n=n||"itemStyle";for(var r=0;r1&&(a*=Ql(f),s*=Ql(f));var g=(r===o?-1:1)*Ql((a*a*(s*s)-a*a*(d*d)-s*s*(p*p))/(a*a*(d*d)+s*s*(p*p)))||0,y=g*a*d/s,v=g*-s*p/a,m=(t+n)/2+eu(c)*y-tu(c)*v,x=(e+i)/2+tu(c)*y+eu(c)*v,_=ou([1,0],[(p-y)/a,(d-v)/s]),b=[(p-y)/a,(d-v)/s],w=[(-1*p-y)/a,(-1*d-v)/s],S=ou(b,w);if(ru(b,w)<=-1&&(S=nu),ru(b,w)>=1&&(S=0),S<0){var M=Math.round(S/nu*1e6)/1e6;S=2*nu+M%2*nu}h.addData(u,m,x,a,s,_,S,c,o)}var su=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,lu=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;var uu=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.applyTransform=function(t){},e}(_s);function hu(t){return null!=t.setData}function cu(t,e){var n=function(t){var e=new ts;if(!t)return e;var n,i=0,r=0,o=i,a=r,s=ts.CMD,l=t.match(su);if(!l)return e;for(var u=0;uk*k+L*L&&(M=T,I=C),{cx:M,cy:I,x0:-h,y0:-c,x1:M*(r/b-1),y1:I*(r/b-1)}}function ku(t,e){var n,i=Tu(e.r,0),r=Tu(e.r0||0,0),o=i>0;if(o||r>0){if(o||(i=r,r=0),r>i){var a=i;i=r,r=a}var s=e.startAngle,l=e.endAngle;if(!isNaN(s)&&!isNaN(l)){var u=e.cx,h=e.cy,c=!!e.clockwise,p=Mu(l-s),d=p>xu&&p%xu;if(d>Du&&(p=d),i>Du)if(p>xu-Du)t.moveTo(u+i*bu(s),h+i*_u(s)),t.arc(u,h,i,s,l,!c),r>Du&&(t.moveTo(u+r*bu(l),h+r*_u(l)),t.arc(u,h,r,l,s,c));else{var f=void 0,g=void 0,y=void 0,v=void 0,m=void 0,x=void 0,_=void 0,b=void 0,w=void 0,S=void 0,M=void 0,I=void 0,T=void 0,C=void 0,D=void 0,A=void 0,k=i*bu(s),L=i*_u(s),P=r*bu(l),O=r*_u(l),R=p>Du;if(R){var N=e.cornerRadius;N&&(n=function(t){var e;if(Y(t)){var n=t.length;if(!n)return t;e=1===n?[t[0],t[0],0,0]:2===n?[t[0],t[0],t[1],t[1]]:3===n?t.concat(t[2]):t}else e=[t,t,t,t];return e}(N),f=n[0],g=n[1],y=n[2],v=n[3]);var E=Mu(i-r)/2;if(m=Cu(E,y),x=Cu(E,v),_=Cu(E,f),b=Cu(E,g),M=w=Tu(m,x),I=S=Tu(_,b),(w>Du||S>Du)&&(T=i*bu(l),C=i*_u(l),D=r*bu(s),A=r*_u(s),pDu){var U=Cu(y,M),X=Cu(v,M),Z=Au(D,A,k,L,i,U,c),j=Au(T,C,P,O,i,X,c);t.moveTo(u+Z.cx+Z.x0,h+Z.cy+Z.y0),M0&&t.arc(u+Z.cx,h+Z.cy,U,Su(Z.y0,Z.x0),Su(Z.y1,Z.x1),!c),t.arc(u,h,i,Su(Z.cy+Z.y1,Z.cx+Z.x1),Su(j.cy+j.y1,j.cx+j.x1),!c),X>0&&t.arc(u+j.cx,h+j.cy,X,Su(j.y1,j.x1),Su(j.y0,j.x0),!c))}else t.moveTo(u+k,h+L),t.arc(u,h,i,s,l,!c);else t.moveTo(u+k,h+L);if(r>Du&&R)if(I>Du){U=Cu(f,I),Z=Au(P,O,T,C,r,-(X=Cu(g,I)),c),j=Au(k,L,D,A,r,-U,c);t.lineTo(u+Z.cx+Z.x0,h+Z.cy+Z.y0),I0&&t.arc(u+Z.cx,h+Z.cy,X,Su(Z.y0,Z.x0),Su(Z.y1,Z.x1),!c),t.arc(u,h,r,Su(Z.cy+Z.y1,Z.cx+Z.x1),Su(j.cy+j.y1,j.cx+j.x1),c),U>0&&t.arc(u+j.cx,h+j.cy,U,Su(j.y1,j.x1),Su(j.y0,j.x0),!c))}else t.lineTo(u+P,h+O),t.arc(u,h,r,l,s,c);else t.lineTo(u+P,h+O)}else t.moveTo(u,h);t.closePath()}}}var Lu=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0,this.cornerRadius=0},Pu=function(t){function e(e){return t.call(this,e)||this}return n(e,t),e.prototype.getDefaultShape=function(){return new Lu},e.prototype.buildPath=function(t,e){ku(t,e)},e.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},e}(_s);Pu.prototype.type="sector";var Ou=function(){this.cx=0,this.cy=0,this.r=0,this.r0=0},Ru=function(t){function e(e){return t.call(this,e)||this}return n(e,t),e.prototype.getDefaultShape=function(){return new Ou},e.prototype.buildPath=function(t,e){var n=e.cx,i=e.cy,r=2*Math.PI;t.moveTo(n+e.r,i),t.arc(n,i,e.r,0,r,!1),t.moveTo(n+e.r0,i),t.arc(n,i,e.r0,0,r,!0)},e}(_s);function Nu(t,e,n){var i=e.smooth,r=e.points;if(r&&r.length>=2){if(i){var o=function(t,e,n,i){var r,o,a,s,l=[],u=[],h=[],c=[];if(i){a=[1/0,1/0],s=[-1/0,-1/0];for(var p=0,d=t.length;pth[1]){if(a=!1,r)return a;var u=Math.abs(th[0]-Qu[1]),h=Math.abs(Qu[0]-th[1]);Math.min(u,h)>i.len()&&(u0){var c={duration:h.duration,delay:h.delay||0,easing:h.easing,done:o,force:!!o||!!a,setToFinal:!u,scope:t,during:a};l?e.animateFrom(n,c):e.animateTo(n,c)}else e.stopAnimation(),!l&&e.attr(n),a&&a(1),o&&o()}function uh(t,e,n,i,r,o){lh("update",t,e,n,i,r,o)}function hh(t,e,n,i,r,o){lh("enter",t,e,n,i,r,o)}function ch(t){if(!t.__zr)return!0;for(var e=0;eMath.abs(o[1])?o[0]>0?"right":"left":o[1]>0?"bottom":"top"}function Rh(t){return!t.isGroup}function Nh(t,e,n){if(t&&e){var i,r=(i={},t.traverse((function(t){Rh(t)&&t.anid&&(i[t.anid]=t)})),i);e.traverse((function(t){if(Rh(t)&&t.anid){var e=r[t.anid];if(e){var i=o(t);t.attr(o(e)),uh(t,i,n,js(t).dataIndex)}}}))}function o(t){var e={x:t.x,y:t.y,rotation:t.rotation};return function(t){return null!=t.shape}(t)&&(e.shape=A({},t.shape)),e}}function Eh(t,e){return z(t,(function(t){var n=t[0];n=yh(n,e.x),n=vh(n,e.x+e.width);var i=t[1];return i=yh(i,e.y),[n,i=vh(i,e.y+e.height)]}))}function zh(t,e){var n=yh(t.x,e.x),i=vh(t.x+t.width,e.x+e.width),r=yh(t.y,e.y),o=vh(t.y+t.height,e.y+e.height);if(i>=n&&o>=r)return{x:n,y:r,width:i-n,height:o-r}}function Vh(t,e,n){var i=A({rectHover:!0},e),r=i.style={strokeNoScale:!0};if(n=n||{x:-1,y:-1,width:2,height:2},t)return 0===t.indexOf("image://")?(r.image=t.slice(8),k(r,n),new Is(i)):Mh(t.replace("path://",""),i,n,"center")}function Bh(t,e,n,i,r){for(var o=0,a=r[r.length-1];o=-1e-6)return!1;var f=t-r,g=e-o,y=Gh(f,g,u,h)/d;if(y<0||y>1)return!1;var v=Gh(f,g,c,p)/d;return!(v<0||v>1)}function Gh(t,e,n,i){return t*i-n*e}function Wh(t){var e=t.itemTooltipOption,n=t.componentModel,i=t.itemName,r=X(e)?{formatter:e}:e,o=n.mainType,a=n.componentIndex,s={componentType:o,name:i,$vars:["name"]};s[o+"Index"]=a;var l=t.formatterParamsExtra;l&&E(G(l),(function(t){mt(s,t)||(s[t]=l[t],s.$vars.push(t))}));var u=js(t.el);u.componentMainType=o,u.componentIndex=a,u.tooltipConfig={name:i,option:k({content:i,formatterParams:s},r)}}function Hh(t,e){var n;t.isGroup&&(n=e(t)),n||t.traverse(e)}function Yh(t,e){if(t)if(Y(t))for(var n=0;n-1?Sc:Ic;function Ac(t,e){t=t.toUpperCase(),Cc[t]=new xc(e),Tc[t]=e}function kc(t){return Cc[t]}Ac(Mc,{time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}}),Ac(Sc,{time:{month:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthAbbr:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayOfWeekAbbr:["日","一","二","三","四","五","六"]},legend:{selector:{all:"全选",inverse:"反选"}},toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}});var Lc=1e3,Pc=6e4,Oc=36e5,Rc=864e5,Nc=31536e6,Ec={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}",none:"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"},zc="{yyyy}-{MM}-{dd}",Vc={year:"{yyyy}",month:"{yyyy}-{MM}",day:zc,hour:"{yyyy}-{MM}-{dd} "+Ec.hour,minute:"{yyyy}-{MM}-{dd} "+Ec.minute,second:"{yyyy}-{MM}-{dd} "+Ec.second,millisecond:Ec.none},Bc=["year","month","day","hour","minute","second","millisecond"],Fc=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function Gc(t,e){return"0000".substr(0,e-(t+="").length)+t}function Wc(t){switch(t){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return t}}function Hc(t){return t===Wc(t)}function Yc(t,e,n,i){var r=Qr(t),o=r[Zc(n)](),a=r[jc(n)]()+1,s=Math.floor((a-1)/3)+1,l=r[qc(n)](),u=r["get"+(n?"UTC":"")+"Day"](),h=r[Kc(n)](),c=(h-1)%12+1,p=r[$c(n)](),d=r[Jc(n)](),f=r[Qc(n)](),g=(i instanceof xc?i:kc(i||Dc)||Cc.EN).getModel("time"),y=g.get("month"),v=g.get("monthAbbr"),m=g.get("dayOfWeek"),x=g.get("dayOfWeekAbbr");return(e||"").replace(/{yyyy}/g,o+"").replace(/{yy}/g,o%100+"").replace(/{Q}/g,s+"").replace(/{MMMM}/g,y[a-1]).replace(/{MMM}/g,v[a-1]).replace(/{MM}/g,Gc(a,2)).replace(/{M}/g,a+"").replace(/{dd}/g,Gc(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,m[u]).replace(/{ee}/g,x[u]).replace(/{e}/g,u+"").replace(/{HH}/g,Gc(h,2)).replace(/{H}/g,h+"").replace(/{hh}/g,Gc(c+"",2)).replace(/{h}/g,c+"").replace(/{mm}/g,Gc(p,2)).replace(/{m}/g,p+"").replace(/{ss}/g,Gc(d,2)).replace(/{s}/g,d+"").replace(/{SSS}/g,Gc(f,3)).replace(/{S}/g,f+"")}function Uc(t,e){var n=Qr(t),i=n[jc(e)]()+1,r=n[qc(e)](),o=n[Kc(e)](),a=n[$c(e)](),s=n[Jc(e)](),l=0===n[Qc(e)](),u=l&&0===s,h=u&&0===a,c=h&&0===o,p=c&&1===r;return p&&1===i?"year":p?"month":c?"day":h?"hour":u?"minute":l?"second":"millisecond"}function Xc(t,e,n){var i=j(t)?Qr(t):t;switch(e=e||Uc(t,n)){case"year":return i[Zc(n)]();case"half-year":return i[jc(n)]()>=6?1:0;case"quarter":return Math.floor((i[jc(n)]()+1)/4);case"month":return i[jc(n)]();case"day":return i[qc(n)]();case"half-day":return i[Kc(n)]()/24;case"hour":return i[Kc(n)]();case"minute":return i[$c(n)]();case"second":return i[Jc(n)]();case"millisecond":return i[Qc(n)]()}}function Zc(t){return t?"getUTCFullYear":"getFullYear"}function jc(t){return t?"getUTCMonth":"getMonth"}function qc(t){return t?"getUTCDate":"getDate"}function Kc(t){return t?"getUTCHours":"getHours"}function $c(t){return t?"getUTCMinutes":"getMinutes"}function Jc(t){return t?"getUTCSeconds":"getSeconds"}function Qc(t){return t?"getUTCMilliseconds":"getMilliseconds"}function tp(t){return t?"setUTCFullYear":"setFullYear"}function ep(t){return t?"setUTCMonth":"setMonth"}function np(t){return t?"setUTCDate":"setDate"}function ip(t){return t?"setUTCHours":"setHours"}function rp(t){return t?"setUTCMinutes":"setMinutes"}function op(t){return t?"setUTCSeconds":"setSeconds"}function ap(t){return t?"setUTCMilliseconds":"setMilliseconds"}function sp(t){if(!ao(t))return X(t)?t:"-";var e=(t+"").split(".");return e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")}function lp(t,e){return t=(t||"").toLowerCase().replace(/-(.)/g,(function(t,e){return e.toUpperCase()})),e&&t&&(t=t.charAt(0).toUpperCase()+t.slice(1)),t}var up=st;function hp(t,e,n){function i(t){return t&&ut(t)?t:"-"}function r(t){return!(null==t||isNaN(t)||!isFinite(t))}var o="time"===e,a=t instanceof Date;if(o||a){var s=o?Qr(t):t;if(!isNaN(+s))return Yc(s,"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}",n);if(a)return"-"}if("ordinal"===e)return Z(t)?i(t):j(t)&&r(t)?t+"":"-";var l=oo(t);return r(l)?sp(l):Z(t)?i(t):"boolean"==typeof t?t+"":"-"}var cp=["a","b","c","d","e","f","g"],pp=function(t,e){return"{"+t+(null==e?"":e)+"}"};function dp(t,e,n){Y(e)||(e=[e]);var i=e.length;if(!i)return"";for(var r=e[0].$vars||[],o=0;o':'':{renderMode:o,content:"{"+(n.markerId||"markerX")+"|} ",style:"subItem"===r?{width:4,height:4,borderRadius:2,backgroundColor:i}:{width:10,height:10,borderRadius:5,backgroundColor:i}}:""}function gp(t,e){return e=e||"transparent",X(t)?t:q(t)&&t.colorStops&&(t.colorStops[0]||{}).color||e}function yp(t,e){if("_blank"===e||"blank"===e){var n=window.open();n.opener=null,n.location.href=t}else window.open(t,e)}var vp=E,mp=["left","right","top","bottom","width","height"],xp=[["width","left","right"],["height","top","bottom"]];function _p(t,e,n,i,r){var o=0,a=0;null==i&&(i=1/0),null==r&&(r=1/0);var s=0;e.eachChild((function(l,u){var h,c,p=l.getBoundingRect(),d=e.childAt(u+1),f=d&&d.getBoundingRect();if("horizontal"===t){var g=p.width+(f?-f.x+p.x:0);(h=o+g)>i||l.newline?(o=0,h=g,a+=s+n,s=p.height):s=Math.max(s,p.height)}else{var y=p.height+(f?-f.y+p.y:0);(c=a+y)>r||l.newline?(o+=s+n,a=0,c=y,s=p.width):s=Math.max(s,p.width)}l.newline||(l.x=o,l.y=a,l.markRedraw(),"horizontal"===t?o=h+n:a=c+n)}))}var bp=_p;H(_p,"vertical"),H(_p,"horizontal");function wp(t,e,n){n=up(n||0);var i=e.width,r=e.height,o=Gr(t.left,i),a=Gr(t.top,r),s=Gr(t.right,i),l=Gr(t.bottom,r),u=Gr(t.width,i),h=Gr(t.height,r),c=n[2]+n[0],p=n[1]+n[3],d=t.aspect;switch(isNaN(u)&&(u=i-s-p-o),isNaN(h)&&(h=r-l-c-a),null!=d&&(isNaN(u)&&isNaN(h)&&(d>i/r?u=.8*i:h=.8*r),isNaN(u)&&(u=d*h),isNaN(h)&&(h=u/d)),isNaN(o)&&(o=i-s-u-p),isNaN(a)&&(a=r-l-h-c),t.left||t.right){case"center":o=i/2-u/2-n[3];break;case"right":o=i-u-p}switch(t.top||t.bottom){case"middle":case"center":a=r/2-h/2-n[0];break;case"bottom":a=r-h-c}o=o||0,a=a||0,isNaN(u)&&(u=i-p-o-(s||0)),isNaN(h)&&(h=r-c-a-(l||0));var f=new Re(o+n[3],a+n[0],u,h);return f.margin=n,f}function Sp(t,e,n,i,r,o){var a,s=!r||!r.hv||r.hv[0],l=!r||!r.hv||r.hv[1],u=r&&r.boundingMode||"all";if((o=o||t).x=t.x,o.y=t.y,!s&&!l)return!1;if("raw"===u)a="group"===t.type?new Re(0,0,+e.width||0,+e.height||0):t.getBoundingRect();else if(a=t.getBoundingRect(),t.needLocalTransform()){var h=t.getLocalTransform();(a=a.clone()).applyTransform(h)}var c=wp(k({width:a.width,height:a.height},e),n,i),p=s?c.x-a.x:0,d=l?c.y-a.y:0;return"raw"===u?(o.x=p,o.y=d):(o.x+=p,o.y+=d),o===t&&t.markRedraw(),!0}function Mp(t){var e=t.layoutMode||t.constructor.layoutMode;return q(e)?e:e?{type:e}:null}function Ip(t,e,n){var i=n&&n.ignoreSize;!Y(i)&&(i=[i,i]);var r=a(xp[0],0),o=a(xp[1],1);function a(n,r){var o={},a=0,u={},h=0;if(vp(n,(function(e){u[e]=t[e]})),vp(n,(function(t){s(e,t)&&(o[t]=u[t]=e[t]),l(o,t)&&a++,l(u,t)&&h++})),i[r])return l(e,n[1])?u[n[2]]=null:l(e,n[2])&&(u[n[1]]=null),u;if(2!==h&&a){if(a>=2)return o;for(var c=0;c=0;a--)o=C(o,n[a],!0);e.defaultOption=o}return e.defaultOption},e.prototype.getReferringComponents=function(t,e){var n=t+"Index",i=t+"Id";return Ro(this.ecModel,t,{index:this.get(n,!0),id:this.get(i,!0)},e)},e.prototype.getBoxLayoutParams=function(){var t=this;return{left:t.get("left"),top:t.get("top"),right:t.get("right"),bottom:t.get("bottom"),width:t.get("width"),height:t.get("height")}},e.prototype.getZLevelKey=function(){return""},e.prototype.setZLevel=function(t){this.option.zlevel=t},e.protoInitialize=function(){var t=e.prototype;t.type="component",t.id="",t.name="",t.mainType="",t.subType="",t.componentIndex=0}(),e}(xc);Wo(Ap,xc),Xo(Ap),function(t){var e={};t.registerSubTypeDefaulter=function(t,n){var i=Fo(t);e[i.main]=n},t.determineSubType=function(n,i){var r=i.type;if(!r){var o=Fo(n).main;t.hasSubTypes(n)&&e[o]&&(r=e[o](i))}return r}}(Ap),function(t,e){function n(t,e){return t[e]||(t[e]={predecessor:[],successor:[]}),t[e]}t.topologicalTravel=function(t,i,r,o){if(t.length){var a=function(t){var i={},r=[];return E(t,(function(o){var a=n(i,o),s=function(t,e){var n=[];return E(t,(function(t){P(e,t)>=0&&n.push(t)})),n}(a.originalDeps=e(o),t);a.entryCount=s.length,0===a.entryCount&&r.push(o),E(s,(function(t){P(a.predecessor,t)<0&&a.predecessor.push(t);var e=n(i,t);P(e.successor,t)<0&&e.successor.push(o)}))})),{graph:i,noEntryList:r}}(i),s=a.graph,l=a.noEntryList,u={};for(E(t,(function(t){u[t]=!0}));l.length;){var h=l.pop(),c=s[h],p=!!u[h];p&&(r.call(o,h,c.originalDeps.slice()),delete u[h]),E(c.successor,p?f:d)}E(u,(function(){var t="";throw new Error(t)}))}function d(t){s[t].entryCount--,0===s[t].entryCount&&l.push(t)}function f(t){u[t]=!0,d(t)}}}(Ap,(function(t){var e=[];E(Ap.getClassesByMainType(t),(function(t){e=e.concat(t.dependencies||t.prototype.dependencies||[])})),e=z(e,(function(t){return Fo(t).main})),"dataset"!==t&&P(e,"dataset")<=0&&e.unshift("dataset");return e}));var kp="";"undefined"!=typeof navigator&&(kp=navigator.platform||"");var Lp="rgba(0, 0, 0, 0.2)",Pp={darkMode:"auto",colorBy:"series",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:Lp,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:Lp,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:Lp,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:Lp,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:Lp,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:Lp,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:kp.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1},Op=ft(["tooltip","label","itemName","itemId","itemGroupId","seriesName"]),Rp="original",Np="arrayRows",Ep="objectRows",zp="keyedColumns",Vp="typedArray",Bp="unknown",Fp="column",Gp="row",Wp=1,Hp=2,Yp=3,Up=Do();function Xp(t,e,n){var i={},r=jp(e);if(!r||!t)return i;var o,a,s=[],l=[],u=e.ecModel,h=Up(u).datasetMap,c=r.uid+"_"+n.seriesLayoutBy;E(t=t.slice(),(function(e,n){var r=q(e)?e:t[n]={name:e};"ordinal"===r.type&&null==o&&(o=n,a=f(r)),i[r.name]=[]}));var p=h.get(c)||h.set(c,{categoryWayDim:a,valueWayDim:0});function d(t,e,n){for(var i=0;ie)return t[i];return t[n-1]}(i,a):n;if((h=h||n)&&h.length){var c=h[l];return r&&(u[r]=c),s.paletteIdx=(l+1)%h.length,c}}var ad=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.init=function(t,e,n,i,r,o){i=i||{},this.option=null,this._theme=new xc(i),this._locale=new xc(r),this._optionManager=o},e.prototype.setOption=function(t,e,n){var i=ud(e);this._optionManager.setOption(t,n,i),this._resetOption(null,i)},e.prototype.resetOption=function(t,e){return this._resetOption(t,ud(e))},e.prototype._resetOption=function(t,e){var n=!1,i=this._optionManager;if(!t||"recreate"===t){var r=i.mountOption("recreate"===t);0,this.option&&"recreate"!==t?(this.restoreData(),this._mergeOption(r,e)):td(this,r),n=!0}if("timeline"!==t&&"media"!==t||this.restoreData(),!t||"recreate"===t||"timeline"===t){var o=i.getTimelineOption(this);o&&(n=!0,this._mergeOption(o,e))}if(!t||"recreate"===t||"media"===t){var a=i.getMediaOption(this);a.length&&E(a,(function(t){n=!0,this._mergeOption(t,e)}),this)}return n},e.prototype.mergeOption=function(t){this._mergeOption(t,null)},e.prototype._mergeOption=function(t,e){var n=this.option,i=this._componentsMap,r=this._componentsCount,o=[],a=ft(),s=e&&e.replaceMergeMainTypeMap;Up(this).datasetMap=ft(),E(t,(function(t,e){null!=t&&(Ap.hasClass(e)?e&&(o.push(e),a.set(e,!0)):n[e]=null==n[e]?T(t):C(n[e],t,!0))})),s&&s.each((function(t,e){Ap.hasClass(e)&&!a.get(e)&&(o.push(e),a.set(e,!0))})),Ap.topologicalTravel(o,Ap.getAllClassMainTypes(),(function(e){var o=function(t,e,n){var i=$p.get(e);if(!i)return n;var r=i(t);return r?n.concat(r):n}(this,e,yo(t[e])),a=i.get(e),l=a?s&&s.get(e)?"replaceMerge":"normalMerge":"replaceAll",u=bo(a,o,l);(function(t,e,n){E(t,(function(t){var i=t.newOption;q(i)&&(t.keyInfo.mainType=e,t.keyInfo.subType=function(t,e,n,i){return e.type?e.type:n?n.subType:i.determineSubType(t,e)}(e,i,t.existing,n))}))})(u,e,Ap),n[e]=null,i.set(e,null),r.set(e,0);var h,c=[],p=[],d=0;E(u,(function(t,n){var i=t.existing,r=t.newOption;if(r){var o="series"===e,a=Ap.getClass(e,t.keyInfo.subType,!o);if(!a)return;if("tooltip"===e){if(h)return void 0;h=!0}if(i&&i.constructor===a)i.name=t.keyInfo.name,i.mergeOption(r,this),i.optionUpdated(r,!1);else{var s=A({componentIndex:n},t.keyInfo);A(i=new a(r,this,this,s),s),t.brandNew&&(i.__requireNewView=!0),i.init(r,this,this),i.optionUpdated(null,!0)}}else i&&(i.mergeOption({},this),i.optionUpdated({},!1));i?(c.push(i.option),p.push(i),d++):(c.push(void 0),p.push(void 0))}),this),n[e]=c,i.set(e,p),r.set(e,d),"series"===e&&Jp(this)}),this),this._seriesIndices||Jp(this)},e.prototype.getOption=function(){var t=T(this.option);return E(t,(function(e,n){if(Ap.hasClass(n)){for(var i=yo(e),r=i.length,o=!1,a=r-1;a>=0;a--)i[a]&&!To(i[a])?o=!0:(i[a]=null,!o&&r--);i.length=r,t[n]=i}})),delete t["\0_ec_inner"],t},e.prototype.getTheme=function(){return this._theme},e.prototype.getLocaleModel=function(){return this._locale},e.prototype.setUpdatePayload=function(t){this._payload=t},e.prototype.getUpdatePayload=function(){return this._payload},e.prototype.getComponent=function(t,e){var n=this._componentsMap.get(t);if(n){var i=n[e||0];if(i)return i;if(null==e)for(var r=0;r=e:"max"===n?t<=e:t===e})(i[a],t,o)||(r=!1)}})),r}var vd=E,md=q,xd=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function _d(t){var e=t&&t.itemStyle;if(e)for(var n=0,i=xd.length;n=0;g--){var y=t[g];if(s||(p=y.data.rawIndexOf(y.stackedByDimension,c)),p>=0){var v=y.data.getByRawIndex(y.stackResultDimension,p);if("all"===l||"positive"===l&&v>0||"negative"===l&&v<0||"samesign"===l&&d>=0&&v>0||"samesign"===l&&d<=0&&v<0){d=jr(d,v),f=v;break}}}return i[0]=d,i[1]=f,i}))}))}var Vd,Bd,Fd,Gd,Wd,Hd=function(t){this.data=t.data||(t.sourceFormat===zp?{}:[]),this.sourceFormat=t.sourceFormat||Bp,this.seriesLayoutBy=t.seriesLayoutBy||Fp,this.startIndex=t.startIndex||0,this.dimensionsDetectedCount=t.dimensionsDetectedCount,this.metaRawOption=t.metaRawOption;var e=this.dimensionsDefine=t.dimensionsDefine;if(e)for(var n=0;nu&&(u=d)}s[0]=l,s[1]=u}},i=function(){return this._data?this._data.length/this._dimSize:0};function r(t){for(var e=0;e=0&&(s=o.interpolatedValue[l])}return null!=s?s+"":""})):void 0},t.prototype.getRawValue=function(t,e){return uf(this.getData(e),t)},t.prototype.formatTooltip=function(t,e,n){},t}();function pf(t){var e,n;return q(t)?t.type&&(n=t):e=t,{text:e,frag:n}}function df(t){return new ff(t)}var ff=function(){function t(t){t=t||{},this._reset=t.reset,this._plan=t.plan,this._count=t.count,this._onDirty=t.onDirty,this._dirty=!0}return t.prototype.perform=function(t){var e,n=this._upstream,i=t&&t.skip;if(this._dirty&&n){var r=this.context;r.data=r.outputData=n.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this),this._plan&&!i&&(e=this._plan(this.context));var o,a=h(this._modBy),s=this._modDataCount||0,l=h(t&&t.modBy),u=t&&t.modDataCount||0;function h(t){return!(t>=1)&&(t=1),t}a===l&&s===u||(e="reset"),(this._dirty||"reset"===e)&&(this._dirty=!1,o=this._doReset(i)),this._modBy=l,this._modDataCount=u;var c=t&&t.step;if(this._dueEnd=n?n._outputDueEnd:this._count?this._count(this.context):1/0,this._progress){var p=this._dueIndex,d=Math.min(null!=c?this._dueIndex+c:1/0,this._dueEnd);if(!i&&(o||p1&&i>0?s:a}};return o;function a(){return e=t?null:oe},gte:function(t,e){return t>=e}},_f=function(){function t(t,e){if(!j(e)){var n="";0,co(n)}this._opFn=xf[t],this._rvalFloat=oo(e)}return t.prototype.evaluate=function(t){return j(t)?this._opFn(t,this._rvalFloat):this._opFn(oo(t),this._rvalFloat)},t}(),bf=function(){function t(t,e){var n="desc"===t;this._resultLT=n?1:-1,null==e&&(e=n?"min":"max"),this._incomparable="min"===e?-1/0:1/0}return t.prototype.evaluate=function(t,e){var n=j(t)?t:oo(t),i=j(e)?e:oo(e),r=isNaN(n),o=isNaN(i);if(r&&(n=this._incomparable),o&&(i=this._incomparable),r&&o){var a=X(t),s=X(e);a&&(n=s?t:0),s&&(i=a?e:0)}return ni?-this._resultLT:0},t}(),wf=function(){function t(t,e){this._rval=e,this._isEQ=t,this._rvalTypeof=typeof e,this._rvalFloat=oo(e)}return t.prototype.evaluate=function(t){var e=t===this._rval;if(!e){var n=typeof t;n===this._rvalTypeof||"number"!==n&&"number"!==this._rvalTypeof||(e=oo(t)===this._rvalFloat)}return this._isEQ?e:!e},t}();function Sf(t,e){return"eq"===t||"ne"===t?new wf("eq"===t,e):mt(xf,t)?new _f(t,e):null}var Mf=function(){function t(){}return t.prototype.getRawData=function(){throw new Error("not supported")},t.prototype.getRawDataItem=function(t){throw new Error("not supported")},t.prototype.cloneRawData=function(){},t.prototype.getDimensionInfo=function(t){},t.prototype.cloneAllDimensionInfo=function(){},t.prototype.count=function(){},t.prototype.retrieveValue=function(t,e){},t.prototype.retrieveValueFromItem=function(t,e){},t.prototype.convertValue=function(t,e){return yf(t,e)},t}();function If(t){var e=t.sourceFormat;if(!Lf(e)){var n="";0,co(n)}return t.data}function Tf(t){var e=t.sourceFormat,n=t.data;if(!Lf(e)){var i="";0,co(i)}if(e===Np){for(var r=[],o=0,a=n.length;o65535?Rf:Nf}function Ff(t,e,n,i,r){var o=Vf[n||"float"];if(r){var a=t[e],s=a&&a.length;if(s!==i){for(var l=new o(i),u=0;ug[1]&&(g[1]=f)}return this._rawCount=this._count=s,{start:a,end:s}},t.prototype._initDataFromProvider=function(t,e,n){for(var i=this._provider,r=this._chunks,o=this._dimensions,a=o.length,s=this._rawExtent,l=z(o,(function(t){return t.property})),u=0;uy[1]&&(y[1]=g)}}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=e,this._extent=[]},t.prototype.count=function(){return this._count},t.prototype.get=function(t,e){if(!(e>=0&&e=0&&e=this._rawCount||t<0)return-1;if(!this._indices)return t;var e=this._indices,n=e[t];if(null!=n&&nt))return o;r=o-1}}return-1},t.prototype.indicesOfNearest=function(t,e,n){var i=this._chunks[t],r=[];if(!i)return r;null==n&&(n=1/0);for(var o=1/0,a=-1,s=0,l=0,u=this.count();l=0&&a<0)&&(o=c,a=h,s=0),h===a&&(r[s++]=l))}return r.length=s,r},t.prototype.getIndices=function(){var t,e=this._indices;if(e){var n=e.constructor,i=this._count;if(n===Array){t=new n(i);for(var r=0;r=u&&x<=h||isNaN(x))&&(a[s++]=d),d++}p=!0}else if(2===r){f=c[i[0]];var y=c[i[1]],v=t[i[1]][0],m=t[i[1]][1];for(g=0;g=u&&x<=h||isNaN(x))&&(_>=v&&_<=m||isNaN(_))&&(a[s++]=d),d++}p=!0}}if(!p)if(1===r)for(g=0;g=u&&x<=h||isNaN(x))&&(a[s++]=b)}else for(g=0;gt[M][1])&&(w=!1)}w&&(a[s++]=e.getRawIndex(g))}return sy[1]&&(y[1]=g)}}}},t.prototype.lttbDownSample=function(t,e){var n,i,r,o=this.clone([t],!0),a=o._chunks[t],s=this.count(),l=0,u=Math.floor(1/e),h=this.getRawIndex(0),c=new(Bf(this._rawCount))(Math.min(2*(Math.ceil(s/u)+2),s));c[l++]=h;for(var p=1;pn&&(n=i,r=I)}M>0&&M<_-x&&(c[l++]=Math.min(S,r),r=Math.max(S,r)),c[l++]=r,h=r}return c[l++]=this.getRawIndex(s-1),o._count=l,o._indices=c,o.getRawIndex=this._getRawIdx,o},t.prototype.downSample=function(t,e,n,i){for(var r=this.clone([t],!0),o=r._chunks,a=[],s=Math.floor(1/e),l=o[t],u=this.count(),h=r._rawExtent[t]=[1/0,-1/0],c=new(Bf(this._rawCount))(Math.ceil(u/s)),p=0,d=0;du-d&&(s=u-d,a.length=s);for(var f=0;fh[1]&&(h[1]=y),c[p++]=v}return r._count=p,r._indices=c,r._updateGetRawIdx(),r},t.prototype.each=function(t,e){if(this._count)for(var n=t.length,i=this._chunks,r=0,o=this.count();ra&&(a=l)}return i=[o,a],this._extent[t]=i,i},t.prototype.getRawDataItem=function(t){var e=this.getRawIndex(t);if(this._provider.persistent)return this._provider.getItem(e);for(var n=[],i=this._chunks,r=0;r=0?this._indices[t]:-1},t.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},t.internalField=function(){function t(t,e,n,i){return yf(t[i],this._dimensions[i])}Pf={arrayRows:t,objectRows:function(t,e,n,i){return yf(t[e],this._dimensions[i])},keyedColumns:t,original:function(t,e,n,i){var r=t&&(null==t.value?t:t.value);return yf(r instanceof Array?r[i]:r,this._dimensions[i])},typedArray:function(t,e,n,i){return t[i]}}}(),t}(),Wf=function(){function t(t){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=t}return t.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},t.prototype._setLocalSource=function(t,e){this._sourceList=t,this._upstreamSignList=e,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},t.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},t.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},t.prototype._createSource=function(){this._setLocalSource([],[]);var t,e,n=this._sourceHost,i=this._getUpstreamSourceManagers(),r=!!i.length;if(Yf(n)){var o=n,a=void 0,s=void 0,l=void 0;if(r){var u=i[0];u.prepareSource(),a=(l=u.getSource()).data,s=l.sourceFormat,e=[u._getVersionSign()]}else s=$(a=o.get("data",!0))?Vp:Rp,e=[];var h=this._getSourceMetaRawOption()||{},c=l&&l.metaRawOption||{},p=rt(h.seriesLayoutBy,c.seriesLayoutBy)||null,d=rt(h.sourceHeader,c.sourceHeader),f=rt(h.dimensions,c.dimensions);t=p!==c.seriesLayoutBy||!!d!=!!c.sourceHeader||f?[Ud(a,{seriesLayoutBy:p,sourceHeader:d,dimensions:f},s)]:[]}else{var g=n;if(r){var y=this._applyTransform(i);t=y.sourceList,e=y.upstreamSignList}else{t=[Ud(g.get("source",!0),this._getSourceMetaRawOption(),null)],e=[]}}this._setLocalSource(t,e)},t.prototype._applyTransform=function(t){var e,n=this._sourceHost,i=n.get("transform",!0),r=n.get("fromTransformResult",!0);if(null!=r){var o="";1!==t.length&&Uf(o)}var a,s=[],l=[];return E(t,(function(t){t.prepareSource();var e=t.getSource(r||0),n="";null==r||e||Uf(n),s.push(e),l.push(t._getVersionSign())})),i?e=function(t,e,n){var i=yo(t),r=i.length,o="";r||co(o);for(var a=0,s=r;a1||n>0&&!t.noHeader;return E(t.blocks,(function(t){var n=Jf(t);n>=e&&(e=n+ +(i&&(!n||Kf(t)&&!t.noHeader)))})),e}return 0}function Qf(t,e,n,i){var r,o=e.noHeader,a=(r=Jf(e),{html:Zf[r],richText:jf[r]}),s=[],l=e.blocks||[];lt(!l||Y(l)),l=l||[];var u=t.orderMode;if(e.sortBlocks&&u){l=l.slice();var h={valueAsc:"asc",valueDesc:"desc"};if(mt(h,u)){var c=new bf(h[u],null);l.sort((function(t,e){return c.evaluate(t.sortParam,e.sortParam)}))}else"seriesDesc"===u&&l.reverse()}E(l,(function(n,r){var o=e.valueFormatter,l=$f(n)(o?A(A({},t),{valueFormatter:o}):t,n,r>0?a.html:0,i);null!=l&&s.push(l)}));var p="richText"===t.renderMode?s.join(a.richText):ng(s.join(""),o?n:a.html);if(o)return p;var d=hp(e.header,"ordinal",t.useUTC),f=Xf(i,t.renderMode).nameStyle;return"richText"===t.renderMode?ig(t,d,f)+a.richText+p:ng('
'+ee(d)+"
"+p,n)}function tg(t,e,n,i){var r=t.renderMode,o=e.noName,a=e.noValue,s=!e.markerType,l=e.name,u=t.useUTC,h=e.valueFormatter||t.valueFormatter||function(t){return z(t=Y(t)?t:[t],(function(t,e){return hp(t,Y(d)?d[e]:d,u)}))};if(!o||!a){var c=s?"":t.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||"#333",r),p=o?"":hp(l,"ordinal",u),d=e.valueType,f=a?[]:h(e.value),g=!s||!o,y=!s&&o,v=Xf(i,r),m=v.nameStyle,x=v.valueStyle;return"richText"===r?(s?"":c)+(o?"":ig(t,p,m))+(a?"":function(t,e,n,i,r){var o=[r],a=i?10:20;return n&&o.push({padding:[0,0,0,a],align:"right"}),t.markupStyleCreator.wrapRichTextStyle(Y(e)?e.join(" "):e,o)}(t,f,g,y,x)):ng((s?"":c)+(o?"":function(t,e,n){return''+ee(t)+""}(p,!s,m))+(a?"":function(t,e,n,i){var r=n?"10px":"20px",o=e?"float:right;margin-left:"+r:"";return t=Y(t)?t:[t],''+z(t,(function(t){return ee(t)})).join("  ")+""}(f,g,y,x)),n)}}function eg(t,e,n,i,r,o){if(t)return $f(t)({useUTC:r,renderMode:n,orderMode:i,markupStyleCreator:e,valueFormatter:t.valueFormatter},t,0,o)}function ng(t,e){return'
'+t+'
'}function ig(t,e,n){return t.markupStyleCreator.wrapRichTextStyle(e,n)}function rg(t,e){return gp(t.getData().getItemVisual(e,"style")[t.visualDrawType])}function og(t,e){var n=t.get("padding");return null!=n?n:"richText"===e?[8,10]:10}var ag=function(){function t(){this.richTextStyles={},this._nextStyleNameId=so()}return t.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},t.prototype.makeTooltipMarker=function(t,e,n){var i="richText"===n?this._generateStyleName():null,r=fp({color:e,type:t,renderMode:n,markerId:i});return X(r)?r:(this.richTextStyles[i]=r.style,r.content)},t.prototype.wrapRichTextStyle=function(t,e){var n={};Y(e)?E(e,(function(t){return A(n,t)})):A(n,e);var i=this._generateStyleName();return this.richTextStyles[i]=n,"{"+i+"|"+t+"}"},t}();function sg(t){var e,n,i,r,o=t.series,a=t.dataIndex,s=t.multipleSeries,l=o.getData(),u=l.mapDimensionsAll("defaultedTooltip"),h=u.length,c=o.getRawValue(a),p=Y(c),d=rg(o,a);if(h>1||p&&!h){var f=function(t,e,n,i,r){var o=e.getData(),a=V(t,(function(t,e,n){var i=o.getDimensionInfo(n);return t||i&&!1!==i.tooltip&&null!=i.displayName}),!1),s=[],l=[],u=[];function h(t,e){var n=o.getDimensionInfo(e);n&&!1!==n.otherDims.tooltip&&(a?u.push(qf("nameValue",{markerType:"subItem",markerColor:r,name:n.displayName,value:t,valueType:n.type})):(s.push(t),l.push(n.type)))}return i.length?E(i,(function(t){h(uf(o,n,t),t)})):E(t,h),{inlineValues:s,inlineValueTypes:l,blocks:u}}(c,o,a,u,d);e=f.inlineValues,n=f.inlineValueTypes,i=f.blocks,r=f.inlineValues[0]}else if(h){var g=l.getDimensionInfo(u[0]);r=e=uf(l,a,u[0]),n=g.type}else r=e=p?c[0]:c;var y=Io(o),v=y&&o.name||"",m=l.getName(a),x=s?v:m;return qf("section",{header:v,noHeader:s||!y,sortParam:r,blocks:[qf("nameValue",{markerType:"item",markerColor:d,name:x,noName:!ut(x),value:e,valueType:n})].concat(i||[])})}var lg=Do();function ug(t,e){return t.getName(e)||t.getId(e)}var hg=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._selectedDataIndicesMap={},e}return n(e,t),e.prototype.init=function(t,e,n){this.seriesIndex=this.componentIndex,this.dataTask=df({count:pg,reset:dg}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(t,n),(lg(this).sourceManager=new Wf(this)).prepareSource();var i=this.getInitialData(t,n);gg(i,this),this.dataTask.context.data=i,lg(this).dataBeforeProcessed=i,cg(this),this._initSelectedMapFromData(i)},e.prototype.mergeDefaultAndTheme=function(t,e){var n=Mp(this),i=n?Tp(t):{},r=this.subType;Ap.hasClass(r)&&(r+="Series"),C(t,e.getTheme().get(this.subType)),C(t,this.getDefaultOption()),vo(t,"label",["show"]),this.fillDataTextStyle(t.data),n&&Ip(t,i,n)},e.prototype.mergeOption=function(t,e){t=C(this.option,t,!0),this.fillDataTextStyle(t.data);var n=Mp(this);n&&Ip(this.option,t,n);var i=lg(this).sourceManager;i.dirty(),i.prepareSource();var r=this.getInitialData(t,e);gg(r,this),this.dataTask.dirty(),this.dataTask.context.data=r,lg(this).dataBeforeProcessed=r,cg(this),this._initSelectedMapFromData(r)},e.prototype.fillDataTextStyle=function(t){if(t&&!$(t))for(var e=["show"],n=0;nthis.getShallow("animationThreshold")&&(e=!1),!!e},e.prototype.restoreData=function(){this.dataTask.dirty()},e.prototype.getColorFromPalette=function(t,e,n){var i=this.ecModel,r=id.prototype.getColorFromPalette.call(this,t,e,n);return r||(r=i.getColorFromPalette(t,e,n)),r},e.prototype.coordDimToDataDim=function(t){return this.getRawData().mapDimensionsAll(t)},e.prototype.getProgressive=function(){return this.get("progressive")},e.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},e.prototype.select=function(t,e){this._innerSelect(this.getData(e),t)},e.prototype.unselect=function(t,e){var n=this.option.selectedMap;if(n){var i=this.option.selectedMode,r=this.getData(e);if("series"===i||"all"===n)return this.option.selectedMap={},void(this._selectedDataIndicesMap={});for(var o=0;o=0&&n.push(r)}return n},e.prototype.isSelected=function(t,e){var n=this.option.selectedMap;if(!n)return!1;var i=this.getData(e);return("all"===n||n[ug(i,t)])&&!i.getItemModel(t).get(["select","disabled"])},e.prototype.isUniversalTransitionEnabled=function(){if(this.__universalTransitionEnabled)return!0;var t=this.option.universalTransition;return!!t&&(!0===t||t&&t.enabled)},e.prototype._innerSelect=function(t,e){var n,i,r=this.option,o=r.selectedMode,a=e.length;if(o&&a)if("series"===o)r.selectedMap="all";else if("multiple"===o){q(r.selectedMap)||(r.selectedMap={});for(var s=r.selectedMap,l=0;l0&&this._innerSelect(t,e)}},e.registerClass=function(t){return Ap.registerClass(t)},e.protoInitialize=function(){var t=e.prototype;t.type="series.__base__",t.seriesIndex=0,t.ignoreStyleOnData=!1,t.hasSymbolVisual=!1,t.defaultSymbol="circle",t.visualStyleAccessPath="itemStyle",t.visualDrawType="fill"}(),e}(Ap);function cg(t){var e=t.name;Io(t)||(t.name=function(t){var e=t.getRawData(),n=e.mapDimensionsAll("seriesName"),i=[];return E(n,(function(t){var n=e.getDimensionInfo(t);n.displayName&&i.push(n.displayName)})),i.join(" ")}(t)||e)}function pg(t){return t.model.getRawData().count()}function dg(t){var e=t.model;return e.setData(e.getRawData().cloneShallow()),fg}function fg(t,e){e.outputData&&t.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function gg(t,e){E(gt(t.CHANGABLE_METHODS,t.DOWNSAMPLE_METHODS),(function(n){t.wrapMethod(n,H(yg,e))}))}function yg(t,e){var n=vg(t);return n&&n.setOutputEnd((e||this).count()),e}function vg(t){var e=(t.ecModel||{}).scheduler,n=e&&e.getPipeline(t.uid);if(n){var i=n.currentTask;if(i){var r=i.agentStubMap;r&&(i=r.get(t.uid))}return i}}R(hg,cf),R(hg,id),Wo(hg,Ap);var mg=function(){function t(){this.group=new Pr,this.uid=bc("viewComponent")}return t.prototype.init=function(t,e){},t.prototype.render=function(t,e,n,i){},t.prototype.dispose=function(t,e){},t.prototype.updateView=function(t,e,n,i){},t.prototype.updateLayout=function(t,e,n,i){},t.prototype.updateVisual=function(t,e,n,i){},t.prototype.toggleBlurSeries=function(t,e,n){},t.prototype.eachRendered=function(t){var e=this.group;e&&e.traverse(t)},t}();function xg(){var t=Do();return function(e){var n=t(e),i=e.pipelineContext,r=!!n.large,o=!!n.progressiveRender,a=n.large=!(!i||!i.large),s=n.progressiveRender=!(!i||!i.progressiveRender);return!(r===a&&o===s)&&"reset"}}Go(mg),Xo(mg);var _g=Do(),bg=xg(),wg=function(){function t(){this.group=new Pr,this.uid=bc("viewChart"),this.renderTask=df({plan:Ig,reset:Tg}),this.renderTask.context={view:this}}return t.prototype.init=function(t,e){},t.prototype.render=function(t,e,n,i){0},t.prototype.highlight=function(t,e,n,i){var r=t.getData(i&&i.dataType);r&&Mg(r,i,"emphasis")},t.prototype.downplay=function(t,e,n,i){var r=t.getData(i&&i.dataType);r&&Mg(r,i,"normal")},t.prototype.remove=function(t,e){this.group.removeAll()},t.prototype.dispose=function(t,e){},t.prototype.updateView=function(t,e,n,i){this.render(t,e,n,i)},t.prototype.updateLayout=function(t,e,n,i){this.render(t,e,n,i)},t.prototype.updateVisual=function(t,e,n,i){this.render(t,e,n,i)},t.prototype.eachRendered=function(t){Yh(this.group,t)},t.markUpdateMethod=function(t,e){_g(t).updateMethod=e},t.protoInitialize=void(t.prototype.type="chart"),t}();function Sg(t,e,n){t&&Ul(t)&&("emphasis"===e?Il:Tl)(t,n)}function Mg(t,e,n){var i=Co(t,e),r=e&&null!=e.highlightKey?function(t){var e=$s[t];return null==e&&Ks<=32&&(e=$s[t]=Ks++),e}(e.highlightKey):null;null!=i?E(yo(i),(function(e){Sg(t.getItemGraphicEl(e),n,r)})):t.eachItemGraphicEl((function(t){Sg(t,n,r)}))}function Ig(t){return bg(t.model)}function Tg(t){var e=t.model,n=t.ecModel,i=t.api,r=t.payload,o=e.pipelineContext.progressiveRender,a=t.view,s=r&&_g(r).updateMethod,l=o?"incrementalPrepareRender":s&&a[s]?s:"render";return"render"!==l&&a[l](e,n,i,r),Cg[l]}Go(wg),Xo(wg);var Cg={incrementalPrepareRender:{progress:function(t,e){e.view.incrementalRender(t,e.model,e.ecModel,e.api,e.payload)}},render:{forceFirstProgress:!0,progress:function(t,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}},Dg="\0__throttleOriginMethod",Ag="\0__throttleRate",kg="\0__throttleType";function Lg(t,e,n){var i,r,o,a,s,l=0,u=0,h=null;function c(){u=(new Date).getTime(),h=null,t.apply(o,a||[])}e=e||0;var p=function(){for(var t=[],p=0;p=0?c():h=setTimeout(c,-r),l=i};return p.clear=function(){h&&(clearTimeout(h),h=null)},p.debounceNextCall=function(t){s=t},p}function Pg(t,e,n,i){var r=t[e];if(r){var o=r[Dg]||r,a=r[kg];if(r[Ag]!==n||a!==i){if(null==n||!i)return t[e]=o;(r=t[e]=Lg(o,n,"debounce"===i))[Dg]=o,r[kg]=i,r[Ag]=n}return r}}function Og(t,e){var n=t[e];n&&n[Dg]&&(n.clear&&n.clear(),t[e]=n[Dg])}var Rg=Do(),Ng={itemStyle:Zo(yc,!0),lineStyle:Zo(dc,!0)},Eg={lineStyle:"stroke",itemStyle:"fill"};function zg(t,e){var n=t.visualStyleMapper||Ng[e];return n||(console.warn("Unkown style type '"+e+"'."),Ng.itemStyle)}function Vg(t,e){var n=t.visualDrawType||Eg[e];return n||(console.warn("Unkown style type '"+e+"'."),"fill")}var Bg={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var n=t.getData(),i=t.visualStyleAccessPath||"itemStyle",r=t.getModel(i),o=zg(t,i)(r),a=r.getShallow("decal");a&&(n.setVisual("decal",a),a.dirty=!0);var s=Vg(t,i),l=o[s],u=U(l)?l:null,h="auto"===o.fill||"auto"===o.stroke;if(!o[s]||u||h){var c=t.getColorFromPalette(t.name,null,e.getSeriesCount());o[s]||(o[s]=c,n.setVisual("colorFromPalette",!0)),o.fill="auto"===o.fill||U(o.fill)?c:o.fill,o.stroke="auto"===o.stroke||U(o.stroke)?c:o.stroke}if(n.setVisual("style",o),n.setVisual("drawType",s),!e.isSeriesFiltered(t)&&u)return n.setVisual("colorFromPalette",!1),{dataEach:function(e,n){var i=t.getDataParams(n),r=A({},o);r[s]=u(i),e.setItemVisual(n,"style",r)}}}},Fg=new xc,Gg={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){if(!t.ignoreStyleOnData&&!e.isSeriesFiltered(t)){var n=t.getData(),i=t.visualStyleAccessPath||"itemStyle",r=zg(t,i),o=n.getVisual("drawType");return{dataEach:n.hasItemOption?function(t,e){var n=t.getRawDataItem(e);if(n&&n[i]){Fg.option=n[i];var a=r(Fg);A(t.ensureUniqueItemVisual(e,"style"),a),Fg.option.decal&&(t.setItemVisual(e,"decal",Fg.option.decal),Fg.option.decal.dirty=!0),o in a&&t.setItemVisual(e,"colorFromPalette",!1)}}:null}}}},Wg={performRawSeries:!0,overallReset:function(t){var e=ft();t.eachSeries((function(t){var n=t.getColorBy();if(!t.isColorBySeries()){var i=t.type+"-"+n,r=e.get(i);r||(r={},e.set(i,r)),Rg(t).scope=r}})),t.eachSeries((function(e){if(!e.isColorBySeries()&&!t.isSeriesFiltered(e)){var n=e.getRawData(),i={},r=e.getData(),o=Rg(e).scope,a=e.visualStyleAccessPath||"itemStyle",s=Vg(e,a);r.each((function(t){var e=r.getRawIndex(t);i[e]=t})),n.each((function(t){var a=i[t];if(r.getItemVisual(a,"colorFromPalette")){var l=r.ensureUniqueItemVisual(a,"style"),u=n.getName(t)||t+"",h=n.count();l[s]=e.getColorFromPalette(u,o,h)}}))}}))}},Hg=Math.PI;var Yg=function(){function t(t,e,n,i){this._stageTaskMap=ft(),this.ecInstance=t,this.api=e,n=this._dataProcessorHandlers=n.slice(),i=this._visualHandlers=i.slice(),this._allHandlers=n.concat(i)}return t.prototype.restoreData=function(t,e){t.restoreData(e),this._stageTaskMap.each((function(t){var e=t.overallTask;e&&e.dirty()}))},t.prototype.getPerformArgs=function(t,e){if(t.__pipeline){var n=this._pipelineMap.get(t.__pipeline.id),i=n.context,r=!e&&n.progressiveEnabled&&(!i||i.progressiveRender)&&t.__idxInPipeline>n.blockIndex?n.step:null,o=i&&i.modDataCount;return{step:r,modBy:null!=o?Math.ceil(o/r):null,modDataCount:o}}},t.prototype.getPipeline=function(t){return this._pipelineMap.get(t)},t.prototype.updateStreamModes=function(t,e){var n=this._pipelineMap.get(t.uid),i=t.getData().count(),r=n.progressiveEnabled&&e.incrementalPrepareRender&&i>=n.threshold,o=t.get("large")&&i>=t.get("largeThreshold"),a="mod"===t.get("progressiveChunkMode")?i:null;t.pipelineContext=n.context={progressiveRender:r,modDataCount:a,large:o}},t.prototype.restorePipelines=function(t){var e=this,n=e._pipelineMap=ft();t.eachSeries((function(t){var i=t.getProgressive(),r=t.uid;n.set(r,{id:r,head:null,tail:null,threshold:t.getProgressiveThreshold(),progressiveEnabled:i&&!(t.preventIncremental&&t.preventIncremental()),blockIndex:-1,step:Math.round(i||700),count:0}),e._pipe(t,t.dataTask)}))},t.prototype.prepareStageTasks=function(){var t=this._stageTaskMap,e=this.api.getModel(),n=this.api;E(this._allHandlers,(function(i){var r=t.get(i.uid)||t.set(i.uid,{}),o="";lt(!(i.reset&&i.overallReset),o),i.reset&&this._createSeriesStageTask(i,r,e,n),i.overallReset&&this._createOverallStageTask(i,r,e,n)}),this)},t.prototype.prepareView=function(t,e,n,i){var r=t.renderTask,o=r.context;o.model=e,o.ecModel=n,o.api=i,r.__block=!t.incrementalPrepareRender,this._pipe(e,r)},t.prototype.performDataProcessorTasks=function(t,e){this._performStageTasks(this._dataProcessorHandlers,t,e,{block:!0})},t.prototype.performVisualTasks=function(t,e,n){this._performStageTasks(this._visualHandlers,t,e,n)},t.prototype._performStageTasks=function(t,e,n,i){i=i||{};var r=!1,o=this;function a(t,e){return t.setDirty&&(!t.dirtyMap||t.dirtyMap.get(e.__pipeline.id))}E(t,(function(t,s){if(!i.visualType||i.visualType===t.visualType){var l=o._stageTaskMap.get(t.uid),u=l.seriesTaskMap,h=l.overallTask;if(h){var c,p=h.agentStubMap;p.each((function(t){a(i,t)&&(t.dirty(),c=!0)})),c&&h.dirty(),o.updatePayload(h,n);var d=o.getPerformArgs(h,i.block);p.each((function(t){t.perform(d)})),h.perform(d)&&(r=!0)}else u&&u.each((function(s,l){a(i,s)&&s.dirty();var u=o.getPerformArgs(s,i.block);u.skip=!t.performRawSeries&&e.isSeriesFiltered(s.context.model),o.updatePayload(s,n),s.perform(u)&&(r=!0)}))}})),this.unfinished=r||this.unfinished},t.prototype.performSeriesTasks=function(t){var e;t.eachSeries((function(t){e=t.dataTask.perform()||e})),this.unfinished=e||this.unfinished},t.prototype.plan=function(){this._pipelineMap.each((function(t){var e=t.tail;do{if(e.__block){t.blockIndex=e.__idxInPipeline;break}e=e.getUpstream()}while(e)}))},t.prototype.updatePayload=function(t,e){"remain"!==e&&(t.context.payload=e)},t.prototype._createSeriesStageTask=function(t,e,n,i){var r=this,o=e.seriesTaskMap,a=e.seriesTaskMap=ft(),s=t.seriesType,l=t.getTargetSeries;function u(e){var s=e.uid,l=a.set(s,o&&o.get(s)||df({plan:qg,reset:Kg,count:Qg}));l.context={model:e,ecModel:n,api:i,useClearVisual:t.isVisual&&!t.isLayout,plan:t.plan,reset:t.reset,scheduler:r},r._pipe(e,l)}t.createOnAllSeries?n.eachRawSeries(u):s?n.eachRawSeriesByType(s,u):l&&l(n,i).each(u)},t.prototype._createOverallStageTask=function(t,e,n,i){var r=this,o=e.overallTask=e.overallTask||df({reset:Ug});o.context={ecModel:n,api:i,overallReset:t.overallReset,scheduler:r};var a=o.agentStubMap,s=o.agentStubMap=ft(),l=t.seriesType,u=t.getTargetSeries,h=!0,c=!1,p="";function d(t){var e=t.uid,n=s.set(e,a&&a.get(e)||(c=!0,df({reset:Xg,onDirty:jg})));n.context={model:t,overallProgress:h},n.agent=o,n.__block=h,r._pipe(t,n)}lt(!t.createOnAllSeries,p),l?n.eachRawSeriesByType(l,d):u?u(n,i).each(d):(h=!1,E(n.getSeries(),d)),c&&o.dirty()},t.prototype._pipe=function(t,e){var n=t.uid,i=this._pipelineMap.get(n);!i.head&&(i.head=e),i.tail&&i.tail.pipe(e),i.tail=e,e.__idxInPipeline=i.count++,e.__pipeline=i},t.wrapStageHandler=function(t,e){return U(t)&&(t={overallReset:t,seriesType:ty(t)}),t.uid=bc("stageHandler"),e&&(t.visualType=e),t},t}();function Ug(t){t.overallReset(t.ecModel,t.api,t.payload)}function Xg(t){return t.overallProgress&&Zg}function Zg(){this.agent.dirty(),this.getDownstream().dirty()}function jg(){this.agent&&this.agent.dirty()}function qg(t){return t.plan?t.plan(t.model,t.ecModel,t.api,t.payload):null}function Kg(t){t.useClearVisual&&t.data.clearAllVisual();var e=t.resetDefines=yo(t.reset(t.model,t.ecModel,t.api,t.payload));return e.length>1?z(e,(function(t,e){return Jg(e)})):$g}var $g=Jg(0);function Jg(t){return function(e,n){var i=n.data,r=n.resetDefines[t];if(r&&r.dataEach)for(var o=e.start;o0&&h===r.length-u.length){var c=r.slice(0,h);"data"!==c&&(e.mainType=c,e[u.toLowerCase()]=t,s=!0)}}a.hasOwnProperty(r)&&(n[r]=t,s=!0),s||(i[r]=t)}))}return{cptQuery:e,dataQuery:n,otherQuery:i}},t.prototype.filter=function(t,e){var n=this.eventInfo;if(!n)return!0;var i=n.targetEl,r=n.packedEvent,o=n.model,a=n.view;if(!o||!a)return!0;var s=e.cptQuery,l=e.dataQuery;return u(s,o,"mainType")&&u(s,o,"subType")&&u(s,o,"index","componentIndex")&&u(s,o,"name")&&u(s,o,"id")&&u(l,r,"name")&&u(l,r,"dataIndex")&&u(l,r,"dataType")&&(!a.filterForExposedEvent||a.filterForExposedEvent(t,e.otherQuery,i,r));function u(t,e,n,i){return null==t[n]||e[i||n]===t[n]}},t.prototype.afterTrigger=function(){this.eventInfo=null},t}(),dy=["symbol","symbolSize","symbolRotate","symbolOffset"],fy=dy.concat(["symbolKeepAspect"]),gy={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var n=t.getData();if(t.legendIcon&&n.setVisual("legendIcon",t.legendIcon),t.hasSymbolVisual){for(var i={},r={},o=!1,a=0;a=0&&zy(l)?l:.5,t.createRadialGradient(a,s,0,a,s,l)}(t,e,n):function(t,e,n){var i=null==e.x?0:e.x,r=null==e.x2?1:e.x2,o=null==e.y?0:e.y,a=null==e.y2?0:e.y2;return e.global||(i=i*n.width+n.x,r=r*n.width+n.x,o=o*n.height+n.y,a=a*n.height+n.y),i=zy(i)?i:0,r=zy(r)?r:1,o=zy(o)?o:0,a=zy(a)?a:0,t.createLinearGradient(i,o,r,a)}(t,e,n),r=e.colorStops,o=0;o0&&(e=i.lineDash,n=i.lineWidth,e&&"solid"!==e&&n>0?"dashed"===e?[4*n,2*n]:"dotted"===e?[n]:j(e)?[e]:Y(e)?e:null:null),o=i.lineDashOffset;if(r){var a=i.strokeNoScale&&t.getLineScale?t.getLineScale():1;a&&1!==a&&(r=z(r,(function(t){return t/a})),o/=a)}return[r,o]}var Wy=new ts(!0);function Hy(t){var e=t.stroke;return!(null==e||"none"===e||!(t.lineWidth>0))}function Yy(t){return"string"==typeof t&&"none"!==t}function Uy(t){var e=t.fill;return null!=e&&"none"!==e}function Xy(t,e){if(null!=e.fillOpacity&&1!==e.fillOpacity){var n=t.globalAlpha;t.globalAlpha=e.fillOpacity*e.opacity,t.fill(),t.globalAlpha=n}else t.fill()}function Zy(t,e){if(null!=e.strokeOpacity&&1!==e.strokeOpacity){var n=t.globalAlpha;t.globalAlpha=e.strokeOpacity*e.opacity,t.stroke(),t.globalAlpha=n}else t.stroke()}function jy(t,e,n){var i=Jo(e.image,e.__image,n);if(ta(i)){var r=t.createPattern(i,e.repeat||"repeat");if("function"==typeof DOMMatrix&&r&&r.setTransform){var o=new DOMMatrix;o.translateSelf(e.x||0,e.y||0),o.rotateSelf(0,0,(e.rotation||0)*_t),o.scaleSelf(e.scaleX||1,e.scaleY||1),r.setTransform(o)}return r}}var qy=["shadowBlur","shadowOffsetX","shadowOffsetY"],Ky=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function $y(t,e,n,i,r){var o=!1;if(!i&&e===(n=n||{}))return!1;if(i||e.opacity!==n.opacity){tv(t,r),o=!0;var a=Math.max(Math.min(e.opacity,1),0);t.globalAlpha=isNaN(a)?fa.opacity:a}(i||e.blend!==n.blend)&&(o||(tv(t,r),o=!0),t.globalCompositeOperation=e.blend||fa.blend);for(var s=0;s0&&t.unfinished);t.unfinished||this._zr.flush()}}},e.prototype.getDom=function(){return this._dom},e.prototype.getId=function(){return this.id},e.prototype.getZr=function(){return this._zr},e.prototype.isSSR=function(){return this._ssr},e.prototype.setOption=function(t,e,n){if(!this.__flagInMainProcess)if(this._disposed)Xv(this.id);else{var i,r,o;if(q(e)&&(n=e.lazyUpdate,i=e.silent,r=e.replaceMerge,o=e.transition,e=e.notMerge),this.__flagInMainProcess=!0,!this._model||e){var a=new gd(this._api),s=this._theme,l=this._model=new ad;l.scheduler=this._scheduler,l.ssr=this._ssr,l.init(null,null,null,s,this._locale,a)}this._model.setOption(t,{replaceMerge:r},Kv);var u={seriesTransition:o,optionChanged:!0};if(n)this.__pendingUpdate={silent:i,updateParams:u},this.__flagInMainProcess=!1,this.getZr().wakeUp();else{try{Sv(this),Tv.update.call(this,null,u)}catch(t){throw this.__pendingUpdate=null,this.__flagInMainProcess=!1,t}this._ssr||this._zr.flush(),this.__pendingUpdate=null,this.__flagInMainProcess=!1,kv.call(this,i),Lv.call(this,i)}}},e.prototype.setTheme=function(){ho()},e.prototype.getModel=function(){return this._model},e.prototype.getOption=function(){return this._model&&this._model.getOption()},e.prototype.getWidth=function(){return this._zr.getWidth()},e.prototype.getHeight=function(){return this._zr.getHeight()},e.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||fv&&window.devicePixelRatio||1},e.prototype.getRenderedCanvas=function(t){return this.renderToCanvas(t)},e.prototype.renderToCanvas=function(t){t=t||{};var e=this._zr.painter;return e.getRenderedCanvas({backgroundColor:t.backgroundColor||this._model.get("backgroundColor"),pixelRatio:t.pixelRatio||this.getDevicePixelRatio()})},e.prototype.renderToSVGString=function(t){t=t||{};var e=this._zr.painter;return e.renderToString({useViewBox:t.useViewBox})},e.prototype.getSvgDataURL=function(){if(r.svgSupported){var t=this._zr;return E(t.storage.getDisplayList(),(function(t){t.stopAnimation(null,!0)})),t.painter.toDataURL()}},e.prototype.getDataURL=function(t){if(!this._disposed){var e=(t=t||{}).excludeComponents,n=this._model,i=[],r=this;E(e,(function(t){n.eachComponent({mainType:t},(function(t){var e=r._componentsMap[t.__viewId];e.group.ignore||(i.push(e),e.group.ignore=!0)}))}));var o="svg"===this._zr.painter.getType()?this.getSvgDataURL():this.renderToCanvas(t).toDataURL("image/"+(t&&t.type||"png"));return E(i,(function(t){t.group.ignore=!1})),o}Xv(this.id)},e.prototype.getConnectedDataURL=function(t){if(!this._disposed){var e="svg"===t.type,n=this.group,i=Math.min,r=Math.max,o=1/0;if(em[n]){var a=o,s=o,l=-1/0,u=-1/0,c=[],p=t&&t.pixelRatio||this.getDevicePixelRatio();E(tm,(function(o,h){if(o.group===n){var p=e?o.getZr().painter.getSvgDom().innerHTML:o.renderToCanvas(T(t)),d=o.getDom().getBoundingClientRect();a=i(d.left,a),s=i(d.top,s),l=r(d.right,l),u=r(d.bottom,u),c.push({dom:p,left:d.left,top:d.top})}}));var d=(l*=p)-(a*=p),f=(u*=p)-(s*=p),g=h.createCanvas(),y=Er(g,{renderer:e?"svg":"canvas"});if(y.resize({width:d,height:f}),e){var v="";return E(c,(function(t){var e=t.left-a,n=t.top-s;v+=''+t.dom+""})),y.painter.getSvgRoot().innerHTML=v,t.connectedBackgroundColor&&y.painter.setBackgroundColor(t.connectedBackgroundColor),y.refreshImmediately(),y.painter.toDataURL()}return t.connectedBackgroundColor&&y.add(new Ps({shape:{x:0,y:0,width:d,height:f},style:{fill:t.connectedBackgroundColor}})),E(c,(function(t){var e=new Is({style:{x:t.left*p-a,y:t.top*p-s,image:t.dom}});y.add(e)})),y.refreshImmediately(),g.toDataURL("image/"+(t&&t.type||"png"))}return this.getDataURL(t)}Xv(this.id)},e.prototype.convertToPixel=function(t,e){return Cv(this,"convertToPixel",t,e)},e.prototype.convertFromPixel=function(t,e){return Cv(this,"convertFromPixel",t,e)},e.prototype.containPixel=function(t,e){var n;if(!this._disposed)return E(ko(this._model,t),(function(t,i){i.indexOf("Models")>=0&&E(t,(function(t){var r=t.coordinateSystem;if(r&&r.containPoint)n=n||!!r.containPoint(e);else if("seriesModels"===i){var o=this._chartsMap[t.__viewId];o&&o.containPoint&&(n=n||o.containPoint(e,t))}else 0}),this)}),this),!!n;Xv(this.id)},e.prototype.getVisual=function(t,e){var n=ko(this._model,t,{defaultMainType:"series"}),i=n.seriesModel;var r=i.getData(),o=n.hasOwnProperty("dataIndexInside")?n.dataIndexInside:n.hasOwnProperty("dataIndex")?r.indexOfRawIndex(n.dataIndex):null;return null!=o?vy(r,o,e):my(r,e)},e.prototype.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},e.prototype.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]},e.prototype._initEvents=function(){var t,e,n,i=this;E(Uv,(function(t){var e=function(e){var n,r=i.getModel(),o=e.target,a="globalout"===t;if(a?n={}:o&&wy(o,(function(t){var e=js(t);if(e&&null!=e.dataIndex){var i=e.dataModel||r.getSeriesByIndex(e.seriesIndex);return n=i&&i.getDataParams(e.dataIndex,e.dataType)||{},!0}if(e.eventData)return n=A({},e.eventData),!0}),!0),n){var s=n.componentType,l=n.componentIndex;"markLine"!==s&&"markPoint"!==s&&"markArea"!==s||(s="series",l=n.seriesIndex);var u=s&&null!=l&&r.getComponent(s,l),h=u&&i["series"===u.mainType?"_chartsMap":"_componentsMap"][u.__viewId];0,n.event=e,n.type=t,i._$eventProcessor.eventInfo={targetEl:o,packedEvent:n,model:u,view:h},i.trigger(t,n)}};e.zrEventfulCallAtLast=!0,i._zr.on(t,e,i)})),E(jv,(function(t,e){i._messageCenter.on(e,(function(t){this.trigger(e,t)}),i)})),E(["selectchanged"],(function(t){i._messageCenter.on(t,(function(e){this.trigger(t,e)}),i)})),t=this._messageCenter,e=this,n=this._api,t.on("selectchanged",(function(t){var i=n.getModel();t.isFromClick?(by("map","selectchanged",e,i,t),by("pie","selectchanged",e,i,t)):"select"===t.fromAction?(by("map","selected",e,i,t),by("pie","selected",e,i,t)):"unselect"===t.fromAction&&(by("map","unselected",e,i,t),by("pie","unselected",e,i,t))}))},e.prototype.isDisposed=function(){return this._disposed},e.prototype.clear=function(){this._disposed?Xv(this.id):this.setOption({series:[]},!0)},e.prototype.dispose=function(){if(this._disposed)Xv(this.id);else{this._disposed=!0,this.getDom()&&No(this.getDom(),rm,"");var t=this,e=t._api,n=t._model;E(t._componentsViews,(function(t){t.dispose(n,e)})),E(t._chartsViews,(function(t){t.dispose(n,e)})),t._zr.dispose(),t._dom=t._model=t._chartsMap=t._componentsMap=t._chartsViews=t._componentsViews=t._scheduler=t._api=t._zr=t._throttledZrFlush=t._theme=t._coordSysMgr=t._messageCenter=null,delete tm[t.id]}},e.prototype.resize=function(t){if(!this.__flagInMainProcess)if(this._disposed)Xv(this.id);else{this._zr.resize(t);var e=this._model;if(this._loadingFX&&this._loadingFX.resize(),e){var n=e.resetOption("media"),i=t&&t.silent;this.__pendingUpdate&&(null==i&&(i=this.__pendingUpdate.silent),n=!0,this.__pendingUpdate=null),this.__flagInMainProcess=!0;try{n&&Sv(this),Tv.update.call(this,{type:"resize",animation:A({duration:0},t&&t.animation)})}catch(t){throw this.__flagInMainProcess=!1,t}this.__flagInMainProcess=!1,kv.call(this,i),Lv.call(this,i)}}},e.prototype.showLoading=function(t,e){if(this._disposed)Xv(this.id);else if(q(t)&&(e=t,t=""),t=t||"default",this.hideLoading(),Qv[t]){var n=Qv[t](this._api,e),i=this._zr;this._loadingFX=n,i.add(n)}},e.prototype.hideLoading=function(){this._disposed?Xv(this.id):(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},e.prototype.makeActionFromEvent=function(t){var e=A({},t);return e.type=jv[t.type],e},e.prototype.dispatchAction=function(t,e){if(this._disposed)Xv(this.id);else if(q(e)||(e={silent:!!e}),Zv[t.type]&&this._model)if(this.__flagInMainProcess)this._pendingActions.push(t);else{var n=e.silent;Av.call(this,t,n);var i=e.flush;i?this._zr.flush():!1!==i&&r.browser.weChat&&this._throttledZrFlush(),kv.call(this,n),Lv.call(this,n)}},e.prototype.updateLabelLayout=function(){cv.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},e.prototype.appendData=function(t){if(this._disposed)Xv(this.id);else{var e=t.seriesIndex,n=this.getModel().getSeriesByIndex(e);0,n.appendData(t),this._scheduler.unfinished=!0,this.getZr().wakeUp()}},e.internalField=function(){function t(t){t.clearColorPalette(),t.eachSeries((function(t){t.clearColorPalette()}))}function e(t){for(var e=[],n=t.currentStates,i=0;i0?{duration:o,delay:i.get("delay"),easing:i.get("easing")}:null;n.eachRendered((function(t){if(t.states&&t.states.emphasis){if(ch(t))return;if(t instanceof _s&&function(t){var e=Js(t);e.normalFill=t.style.fill,e.normalStroke=t.style.stroke;var n=t.states.select||{};e.selectFill=n.style&&n.style.fill||null,e.selectStroke=n.style&&n.style.stroke||null}(t),t.__dirty){var n=t.prevStates;n&&t.useStates(n)}if(r){t.stateTransition=a;var i=t.getTextContent(),o=t.getTextGuideLine();i&&(i.stateTransition=a),o&&(o.stateTransition=a)}t.__dirty&&e(t)}}))}Sv=function(t){var e=t._scheduler;e.restorePipelines(t._model),e.prepareStageTasks(),Mv(t,!0),Mv(t,!1),e.plan()},Mv=function(t,e){for(var n=t._model,i=t._scheduler,r=e?t._componentsViews:t._chartsViews,o=e?t._componentsMap:t._chartsMap,a=t._zr,s=t._api,l=0;le.get("hoverLayerThreshold")&&!r.node&&!r.worker&&e.eachSeries((function(e){if(!e.preventUsingHoverLayer){var n=t._chartsMap[e.__viewId];n.__alive&&n.eachRendered((function(t){t.states.emphasis&&(t.states.emphasis.hoverLayer=!0)}))}}))}(t,e),cv.trigger("series:afterupdate",e,n,l)},Bv=function(t){t.__needsUpdateStatus=!0,t.getZr().wakeUp()},Fv=function(t){t.__needsUpdateStatus&&(t.getZr().storage.traverse((function(t){ch(t)||e(t)})),t.__needsUpdateStatus=!1)},zv=function(t){return new(function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return n(i,e),i.prototype.getCoordinateSystems=function(){return t._coordSysMgr.getCoordinateSystems()},i.prototype.getComponentByElement=function(e){for(;e;){var n=e.__ecComponentInfo;if(null!=n)return t._model.getComponent(n.mainType,n.index);e=e.parent}},i.prototype.enterEmphasis=function(e,n){Il(e,n),Bv(t)},i.prototype.leaveEmphasis=function(e,n){Tl(e,n),Bv(t)},i.prototype.enterBlur=function(e){Cl(e),Bv(t)},i.prototype.leaveBlur=function(e){Dl(e),Bv(t)},i.prototype.enterSelect=function(e){Al(e),Bv(t)},i.prototype.leaveSelect=function(e){kl(e),Bv(t)},i.prototype.getModel=function(){return t.getModel()},i.prototype.getViewOfComponentModel=function(e){return t.getViewOfComponentModel(e)},i.prototype.getViewOfSeriesModel=function(e){return t.getViewOfSeriesModel(e)},i}(cd))(t)},Vv=function(t){function e(t,e){for(var n=0;n=0)){mm.push(n);var o=Yg.wrapStageHandler(n,r);o.__prio=e,o.__raw=n,t.push(o)}}function _m(t,e){Qv[t]=e}function bm(t,e,n){var i=dv("registerMap");i&&i(t,e,n)}var wm=function(t){var e=(t=T(t)).type,n="";e||co(n);var i=e.split(":");2!==i.length&&co(n);var r=!1;"echarts"===i[0]&&(e=i[1],r=!0),t.__isBuiltIn=r,Af.set(e,t)};vm(gv,Bg),vm(yv,Gg),vm(yv,Wg),vm(gv,gy),vm(yv,yy),vm(7e3,(function(t,e){t.eachRawSeries((function(n){if(!t.isSeriesFiltered(n)){var i=n.getData();i.hasItemVisual()&&i.each((function(t){var n=i.getItemVisual(t,"decal");n&&(i.ensureUniqueItemVisual(t,"style").decal=sv(n,e))}));var r=i.getVisual("decal");if(r)i.getVisual("style").decal=sv(r,e)}}))})),um(Ed),hm(900,(function(t){var e=ft();t.eachSeries((function(t){var n=t.get("stack");if(n){var i=e.get(n)||e.set(n,[]),r=t.getData(),o={stackResultDimension:r.getCalculationInfo("stackResultDimension"),stackedOverDimension:r.getCalculationInfo("stackedOverDimension"),stackedDimension:r.getCalculationInfo("stackedDimension"),stackedByDimension:r.getCalculationInfo("stackedByDimension"),isStackedByIndex:r.getCalculationInfo("isStackedByIndex"),data:r,seriesModel:t};if(!o.stackedDimension||!o.isStackedByIndex&&!o.stackedByDimension)return;i.length&&r.setCalculationInfo("stackedOnSeries",i[i.length-1].seriesModel),i.push(o)}})),e.each(zd)})),_m("default",(function(t,e){k(e=e||{},{text:"loading",textColor:"#000",fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#5470c6",spinnerRadius:10,lineWidth:5,zlevel:0});var n=new Pr,i=new Ps({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4});n.add(i);var r,o=new Ns({style:{text:e.text,fill:e.textColor,fontSize:e.fontSize,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontFamily:e.fontFamily},zlevel:e.zlevel,z:10001}),a=new Ps({style:{fill:"none"},textContent:o,textConfig:{position:"right",distance:10},zlevel:e.zlevel,z:10001});return n.add(a),e.showSpinner&&((r=new ju({shape:{startAngle:-Hg/2,endAngle:-Hg/2+.1,r:e.spinnerRadius},style:{stroke:e.color,lineCap:"round",lineWidth:e.lineWidth},zlevel:e.zlevel,z:10001})).animateShape(!0).when(1e3,{endAngle:3*Hg/2}).start("circularInOut"),r.animateShape(!0).when(1e3,{startAngle:3*Hg/2}).delay(300).start("circularInOut"),n.add(r)),n.resize=function(){var n=o.getBoundingRect().width,s=e.showSpinner?e.spinnerRadius:0,l=(t.getWidth()-2*s-(e.showSpinner&&n?10:0)-n)/2-(e.showSpinner&&n?0:5+n/2)+(e.showSpinner?0:n/2)+(n?0:s),u=t.getHeight()/2;e.showSpinner&&r.setShape({cx:l,cy:u}),a.setShape({x:l-s,y:u-s,width:2*s,height:2*s}),i.setShape({x:0,y:0,width:t.getWidth(),height:t.getHeight()})},n.resize(),n})),fm({type:il,event:il,update:il},xt),fm({type:rl,event:rl,update:rl},xt),fm({type:ol,event:ol,update:ol},xt),fm({type:al,event:al,update:al},xt),fm({type:sl,event:sl,update:sl},xt),lm("light",ay),lm("dark",cy);var Sm=[],Mm={registerPreprocessor:um,registerProcessor:hm,registerPostInit:cm,registerPostUpdate:pm,registerUpdateLifecycle:dm,registerAction:fm,registerCoordinateSystem:gm,registerLayout:ym,registerVisual:vm,registerTransform:wm,registerLoading:_m,registerMap:bm,registerImpl:function(t,e){pv[t]=e},PRIORITY:vv,ComponentModel:Ap,ComponentView:mg,SeriesModel:hg,ChartView:wg,registerComponentModel:function(t){Ap.registerClass(t)},registerComponentView:function(t){mg.registerClass(t)},registerSeriesModel:function(t){hg.registerClass(t)},registerChartView:function(t){wg.registerClass(t)},registerSubTypeDefaulter:function(t,e){Ap.registerSubTypeDefaulter(t,e)},registerPainter:function(t,e){zr(t,e)}};function Im(t){Y(t)?E(t,(function(t){Im(t)})):P(Sm,t)>=0||(Sm.push(t),U(t)&&(t={install:t}),t.install(Mm))}function Tm(t){return null==t?0:t.length||1}function Cm(t){return t}var Dm=function(){function t(t,e,n,i,r,o){this._old=t,this._new=e,this._oldKeyGetter=n||Cm,this._newKeyGetter=i||Cm,this.context=r,this._diffModeMultiple="multiple"===o}return t.prototype.add=function(t){return this._add=t,this},t.prototype.update=function(t){return this._update=t,this},t.prototype.updateManyToOne=function(t){return this._updateManyToOne=t,this},t.prototype.updateOneToMany=function(t){return this._updateOneToMany=t,this},t.prototype.updateManyToMany=function(t){return this._updateManyToMany=t,this},t.prototype.remove=function(t){return this._remove=t,this},t.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},t.prototype._executeOneToOne=function(){var t=this._old,e=this._new,n={},i=new Array(t.length),r=new Array(e.length);this._initIndexMap(t,null,i,"_oldKeyGetter"),this._initIndexMap(e,n,r,"_newKeyGetter");for(var o=0;o1){var u=s.shift();1===s.length&&(n[a]=s[0]),this._update&&this._update(u,o)}else 1===l?(n[a]=null,this._update&&this._update(s,o)):this._remove&&this._remove(o)}this._performRestAdd(r,n)},t.prototype._executeMultiple=function(){var t=this._old,e=this._new,n={},i={},r=[],o=[];this._initIndexMap(t,n,r,"_oldKeyGetter"),this._initIndexMap(e,i,o,"_newKeyGetter");for(var a=0;a1&&1===c)this._updateManyToOne&&this._updateManyToOne(u,l),i[s]=null;else if(1===h&&c>1)this._updateOneToMany&&this._updateOneToMany(u,l),i[s]=null;else if(1===h&&1===c)this._update&&this._update(u,l),i[s]=null;else if(h>1&&c>1)this._updateManyToMany&&this._updateManyToMany(u,l),i[s]=null;else if(h>1)for(var p=0;p1)for(var a=0;a30}var Fm,Gm,Wm,Hm,Ym,Um,Xm,Zm=q,jm=z,qm="undefined"==typeof Int32Array?Array:Int32Array,Km=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],$m=["_approximateExtent"],Jm=function(){function t(t,e){var n;this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","lttbDownSample"];var i=!1;Em(t)?(n=t.dimensions,this._dimOmitted=t.isDimensionOmitted(),this._schema=t):(i=!0,n=t),n=n||["x","y"];for(var r={},o=[],a={},s=!1,l={},u=0;u=e)){var n=this._store.getProvider();this._updateOrdinalMeta();var i=this._nameList,r=this._idList;if(n.getSource().sourceFormat===Rp&&!n.pure)for(var o=[],a=t;a0},t.prototype.ensureUniqueItemVisual=function(t,e){var n=this._itemVisuals,i=n[t];i||(i=n[t]={});var r=i[e];return null==r&&(Y(r=this.getVisual(e))?r=r.slice():Zm(r)&&(r=A({},r)),i[e]=r),r},t.prototype.setItemVisual=function(t,e,n){var i=this._itemVisuals[t]||{};this._itemVisuals[t]=i,Zm(e)?A(i,e):i[e]=n},t.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},t.prototype.setLayout=function(t,e){Zm(t)?A(this._layout,t):this._layout[t]=e},t.prototype.getLayout=function(t){return this._layout[t]},t.prototype.getItemLayout=function(t){return this._itemLayouts[t]},t.prototype.setItemLayout=function(t,e,n){this._itemLayouts[t]=n?A(this._itemLayouts[t]||{},e):e},t.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},t.prototype.setItemGraphicEl=function(t,e){var n=this.hostModel&&this.hostModel.seriesIndex;qs(n,this.dataType,t,e),this._graphicEls[t]=e},t.prototype.getItemGraphicEl=function(t){return this._graphicEls[t]},t.prototype.eachItemGraphicEl=function(t,e){E(this._graphicEls,(function(n,i){n&&t&&t.call(e,n,i)}))},t.prototype.cloneShallow=function(e){return e||(e=new t(this._schema?this._schema:jm(this.dimensions,this._getDimInfo,this),this.hostModel)),Ym(e,this),e._store=this._store,e},t.prototype.wrapMethod=function(t,e){var n=this[t];U(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var t=n.apply(this,arguments);return e.apply(this,[t].concat(at(arguments)))})},t.internalField=(Fm=function(t){var e=t._invertedIndicesMap;E(e,(function(n,i){var r=t._dimInfos[i],o=r.ordinalMeta,a=t._store;if(o){n=e[i]=new qm(o.categories.length);for(var s=0;s1&&(s+="__ec__"+u),i[e]=s}})),t}();function Qm(t,e){Yd(t)||(t=Xd(t));var n=(e=e||{}).coordDimensions||[],i=e.dimensionsDefine||t.dimensionsDefine||[],r=ft(),o=[],a=function(t,e,n,i){var r=Math.max(t.dimensionsDetectedCount||1,e.length,n.length,i||0);return E(e,(function(t){var e;q(t)&&(e=t.dimsDef)&&(r=Math.max(r,e.length))})),r}(t,n,i,e.dimensionsCount),s=e.canOmitUnusedDimensions&&Bm(a),l=i===t.dimensionsDefine,u=l?Vm(t):zm(i),h=e.encodeDefine;!h&&e.encodeDefaulter&&(h=e.encodeDefaulter(t,a));for(var c=ft(h),p=new Ef(a),d=0;d0&&(i.name=r+(o-1)),o++,e.set(r,o)}}(o),new Nm({source:t,dimensions:o,fullDimensionCount:a,dimensionOmitted:s})}function tx(t,e,n){var i=e.data;if(n||i.hasOwnProperty(t)){for(var r=0;i.hasOwnProperty(t+r);)r++;t+=r}return e.set(t,!0),t}var ex=function(t){this.coordSysDims=[],this.axisMap=ft(),this.categoryAxisMap=ft(),this.coordSysName=t};var nx={cartesian2d:function(t,e,n,i){var r=t.getReferringComponents("xAxis",Po).models[0],o=t.getReferringComponents("yAxis",Po).models[0];e.coordSysDims=["x","y"],n.set("x",r),n.set("y",o),ix(r)&&(i.set("x",r),e.firstCategoryDimIndex=0),ix(o)&&(i.set("y",o),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=1))},singleAxis:function(t,e,n,i){var r=t.getReferringComponents("singleAxis",Po).models[0];e.coordSysDims=["single"],n.set("single",r),ix(r)&&(i.set("single",r),e.firstCategoryDimIndex=0)},polar:function(t,e,n,i){var r=t.getReferringComponents("polar",Po).models[0],o=r.findAxisModel("radiusAxis"),a=r.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],n.set("radius",o),n.set("angle",a),ix(o)&&(i.set("radius",o),e.firstCategoryDimIndex=0),ix(a)&&(i.set("angle",a),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=1))},geo:function(t,e,n,i){e.coordSysDims=["lng","lat"]},parallel:function(t,e,n,i){var r=t.ecModel,o=r.getComponent("parallel",t.get("parallelIndex")),a=e.coordSysDims=o.dimensions.slice();E(o.parallelAxisIndex,(function(t,o){var s=r.getComponent("parallelAxis",t),l=a[o];n.set(l,s),ix(s)&&(i.set(l,s),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=o))}))}};function ix(t){return"category"===t.get("type")}function rx(t,e,n){var i,r,o,a=(n=n||{}).byIndex,s=n.stackedCoordDimension;!function(t){return!Em(t.schema)}(e)?(r=e.schema,i=r.dimensions,o=e.store):i=e;var l,u,h,c,p=!(!t||!t.get("stack"));if(E(i,(function(t,e){X(t)&&(i[e]=t={name:t}),p&&!t.isExtraCoord&&(a||l||!t.ordinalMeta||(l=t),u||"ordinal"===t.type||"time"===t.type||s&&s!==t.coordDim||(u=t))})),!u||a||l||(a=!0),u){h="__\0ecstackresult_"+t.id,c="__\0ecstackedover_"+t.id,l&&(l.createInvertedIndices=!0);var d=u.coordDim,f=u.type,g=0;E(i,(function(t){t.coordDim===d&&g++}));var y={name:h,coordDim:d,coordDimIndex:g,type:f,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:i.length},v={name:c,coordDim:c,coordDimIndex:g+1,type:f,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:i.length+1};r?(o&&(y.storeDimIndex=o.ensureCalculationDimension(c,f),v.storeDimIndex=o.ensureCalculationDimension(h,f)),r.appendCalculationDimension(y),r.appendCalculationDimension(v)):(i.push(y),i.push(v))}return{stackedDimension:u&&u.name,stackedByDimension:l&&l.name,isStackedByIndex:a,stackedOverDimension:c,stackResultDimension:h}}function ox(t,e){return!!e&&e===t.getCalculationInfo("stackedDimension")}function ax(t,e){return ox(t,e)?t.getCalculationInfo("stackResultDimension"):e}function sx(t,e,n){n=n||{};var i,r=e.getSourceManager(),o=!1;t?(o=!0,i=Xd(t)):o=(i=r.getSource()).sourceFormat===Rp;var a=function(t){var e=t.get("coordinateSystem"),n=new ex(e),i=nx[e];if(i)return i(t,n,n.axisMap,n.categoryAxisMap),n}(e),s=function(t,e){var n,i=t.get("coordinateSystem"),r=dd.get(i);return e&&e.coordSysDims&&(n=z(e.coordSysDims,(function(t){var n={name:t},i=e.axisMap.get(t);if(i){var r=i.get("type");n.type=Lm(r)}return n}))),n||(n=r&&(r.getDimensionsInfo?r.getDimensionsInfo():r.dimensions.slice())||["x","y"]),n}(e,a),l=n.useEncodeDefaulter,u=U(l)?l:l?H(Xp,s,e):null,h=Qm(i,{coordDimensions:s,generateCoord:n.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!o}),c=function(t,e,n){var i,r;return n&&E(t,(function(t,o){var a=t.coordDim,s=n.categoryAxisMap.get(a);s&&(null==i&&(i=o),t.ordinalMeta=s.getOrdinalMeta(),e&&(t.createInvertedIndices=!0)),null!=t.otherDims.itemName&&(r=!0)})),r||null==i||(t[i].otherDims.itemName=0),i}(h.dimensions,n.createInvertedIndices,a),p=o?null:r.getSharedDataStore(h),d=rx(e,{schema:h,store:p}),f=new Jm(h,e);f.setCalculationInfo(d);var g=null!=c&&function(t){if(t.sourceFormat===Rp){var e=function(t){var e=0;for(;ee[1]&&(e[1]=t[1])},t.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.setExtent=function(t,e){var n=this._extent;isNaN(t)||(n[0]=t),isNaN(e)||(n[1]=e)},t.prototype.isInExtentRange=function(t){return this._extent[0]<=t&&this._extent[1]>=t},t.prototype.isBlank=function(){return this._isBlank},t.prototype.setBlank=function(t){this._isBlank=t},t}();Xo(lx);var ux=0,hx=function(){function t(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication,this.uid=++ux}return t.createByAxisModel=function(e){var n=e.option,i=n.data,r=i&&z(i,cx);return new t({categories:r,needCollect:!r,deduplication:!1!==n.dedplication})},t.prototype.getOrdinal=function(t){return this._getOrCreateMap().get(t)},t.prototype.parseAndCollect=function(t){var e,n=this._needCollect;if(!X(t)&&!n)return t;if(n&&!this._deduplication)return e=this.categories.length,this.categories[e]=t,e;var i=this._getOrCreateMap();return null==(e=i.get(t))&&(n?(e=this.categories.length,this.categories[e]=t,i.set(t,e)):e=NaN),e},t.prototype._getOrCreateMap=function(){return this._map||(this._map=ft(this.categories))},t}();function cx(t){return q(t)&&null!=t.value?t.value:t+""}function px(t){return"interval"===t.type||"log"===t.type}function dx(t,e,n,i){var r={},o=t[1]-t[0],a=r.interval=no(o/e,!0);null!=n&&ai&&(a=r.interval=i);var s=r.intervalPrecision=gx(a);return function(t,e){!isFinite(t[0])&&(t[0]=e[0]),!isFinite(t[1])&&(t[1]=e[1]),yx(t,0,e),yx(t,1,e),t[0]>t[1]&&(t[0]=t[1])}(r.niceTickExtent=[Wr(Math.ceil(t[0]/a)*a,s),Wr(Math.floor(t[1]/a)*a,s)],t),r}function fx(t){var e=Math.pow(10,eo(t)),n=t/e;return n?2===n?n=3:3===n?n=5:n*=2:n=1,Wr(n*e)}function gx(t){return Yr(t)+2}function yx(t,e,n){t[e]=Math.max(Math.min(t[e],n[1]),n[0])}function vx(t,e){return t>=e[0]&&t<=e[1]}function mx(t,e){return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])}function xx(t,e){return t*(e[1]-e[0])+e[0]}var _x=function(t){function e(e){var n=t.call(this,e)||this;n.type="ordinal";var i=n.getSetting("ordinalMeta");return i||(i=new hx({})),Y(i)&&(i=new hx({categories:z(i,(function(t){return q(t)?t.value:t}))})),n._ordinalMeta=i,n._extent=n.getSetting("extent")||[0,i.categories.length-1],n}return n(e,t),e.prototype.parse=function(t){return null==t?NaN:X(t)?this._ordinalMeta.getOrdinal(t):Math.round(t)},e.prototype.contain=function(t){return vx(t=this.parse(t),this._extent)&&null!=this._ordinalMeta.categories[t]},e.prototype.normalize=function(t){return mx(t=this._getTickNumber(this.parse(t)),this._extent)},e.prototype.scale=function(t){return t=Math.round(xx(t,this._extent)),this.getRawOrdinalNumber(t)},e.prototype.getTicks=function(){for(var t=[],e=this._extent,n=e[0];n<=e[1];)t.push({value:n}),n++;return t},e.prototype.getMinorTicks=function(t){},e.prototype.setSortInfo=function(t){if(null!=t){for(var e=t.ordinalNumbers,n=this._ordinalNumbersByTick=[],i=this._ticksByOrdinalNumber=[],r=0,o=this._ordinalMeta.categories.length,a=Math.min(o,e.length);r=0&&t=0&&t=t},e.prototype.getOrdinalMeta=function(){return this._ordinalMeta},e.prototype.calcNiceTicks=function(){},e.prototype.calcNiceExtent=function(){},e.type="ordinal",e}(lx);lx.registerClass(_x);var bx=Wr,Sx=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="interval",e._interval=0,e._intervalPrecision=2,e}return n(e,t),e.prototype.parse=function(t){return t},e.prototype.contain=function(t){return vx(t,this._extent)},e.prototype.normalize=function(t){return mx(t,this._extent)},e.prototype.scale=function(t){return xx(t,this._extent)},e.prototype.setExtent=function(t,e){var n=this._extent;isNaN(t)||(n[0]=parseFloat(t)),isNaN(e)||(n[1]=parseFloat(e))},e.prototype.unionExtent=function(t){var e=this._extent;t[0]e[1]&&(e[1]=t[1]),this.setExtent(e[0],e[1])},e.prototype.getInterval=function(){return this._interval},e.prototype.setInterval=function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=gx(t)},e.prototype.getTicks=function(t){var e=this._interval,n=this._extent,i=this._niceExtent,r=this._intervalPrecision,o=[];if(!e)return o;n[0]1e4)return[];var s=o.length?o[o.length-1].value:i[1];return n[1]>s&&(t?o.push({value:bx(s+e,r)}):o.push({value:n[1]})),o},e.prototype.getMinorTicks=function(t){for(var e=this.getTicks(!0),n=[],i=this.getExtent(),r=1;ri[0]&&h0&&(o=null===o?s:Math.min(o,s))}n[i]=o}}return n}(t),n=[];return E(t,(function(t){var i,r=t.coordinateSystem.getBaseAxis(),o=r.getExtent();if("category"===r.type)i=r.getBandWidth();else if("value"===r.type||"time"===r.type){var a=r.dim+"_"+r.index,s=e[a],l=Math.abs(o[1]-o[0]),u=r.scale.getExtent(),h=Math.abs(u[1]-u[0]);i=s?l/h*s:l}else{var c=t.getData();i=Math.abs(o[1]-o[0])/c.count()}var p=Gr(t.get("barWidth"),i),d=Gr(t.get("barMaxWidth"),i),f=Gr(t.get("barMinWidth")||(Ex(t)?.5:1),i),g=t.get("barGap"),y=t.get("barCategoryGap");n.push({bandWidth:i,barWidth:p,barMaxWidth:d,barMinWidth:f,barGap:g,barCategoryGap:y,axisKey:Ax(r),stackId:Dx(t)})})),Px(n)}function Px(t){var e={};E(t,(function(t,n){var i=t.axisKey,r=t.bandWidth,o=e[i]||{bandWidth:r,remainedWidth:r,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},a=o.stacks;e[i]=o;var s=t.stackId;a[s]||o.autoWidthCount++,a[s]=a[s]||{width:0,maxWidth:0};var l=t.barWidth;l&&!a[s].width&&(a[s].width=l,l=Math.min(o.remainedWidth,l),o.remainedWidth-=l);var u=t.barMaxWidth;u&&(a[s].maxWidth=u);var h=t.barMinWidth;h&&(a[s].minWidth=h);var c=t.barGap;null!=c&&(o.gap=c);var p=t.barCategoryGap;null!=p&&(o.categoryGap=p)}));var n={};return E(e,(function(t,e){n[e]={};var i=t.stacks,r=t.bandWidth,o=t.categoryGap;if(null==o){var a=G(i).length;o=Math.max(35-4*a,15)+"%"}var s=Gr(o,r),l=Gr(t.gap,1),u=t.remainedWidth,h=t.autoWidthCount,c=(u-s)/(h+(h-1)*l);c=Math.max(c,0),E(i,(function(t){var e=t.maxWidth,n=t.minWidth;if(t.width){i=t.width;e&&(i=Math.min(i,e)),n&&(i=Math.max(i,n)),t.width=i,u-=i+l*i,h--}else{var i=c;e&&ei&&(i=n),i!==c&&(t.width=i,u-=i+l*i,h--)}})),c=(u-s)/(h+(h-1)*l),c=Math.max(c,0);var p,d=0;E(i,(function(t,e){t.width||(t.width=c),p=t,d+=t.width*(1+l)})),p&&(d-=p.width*l);var f=-d/2;E(i,(function(t,i){n[e][i]=n[e][i]||{bandWidth:r,offset:f,width:t.width},f+=t.width*(1+l)}))})),n}function Ox(t,e){var n=kx(t,e),i=Lx(n);E(n,(function(t){var e=t.getData(),n=t.coordinateSystem.getBaseAxis(),r=Dx(t),o=i[Ax(n)][r],a=o.offset,s=o.width;e.setLayout({bandWidth:o.bandWidth,offset:a,size:s})}))}function Rx(t){return{seriesType:t,plan:xg(),reset:function(t){if(Nx(t)){var e=t.getData(),n=t.coordinateSystem,i=n.getBaseAxis(),r=n.getOtherAxis(i),o=e.getDimensionIndex(e.mapDimension(r.dim)),a=e.getDimensionIndex(e.mapDimension(i.dim)),s=t.get("showBackground",!0),l=e.mapDimension(r.dim),u=e.getCalculationInfo("stackResultDimension"),h=ox(e,l)&&!!e.getCalculationInfo("stackedOnSeries"),c=r.isHorizontal(),p=function(t,e){return e.toGlobalCoord(e.dataToCoord("log"===e.type?1:0))}(0,r),d=Ex(t),f=t.get("barMinHeight")||0,g=u&&e.getDimensionIndex(u),y=e.getLayout("size"),v=e.getLayout("offset");return{progress:function(t,e){for(var i,r=t.count,l=d&&Tx(3*r),u=d&&s&&Tx(3*r),m=d&&Tx(r),x=n.master.getRect(),_=c?x.width:x.height,b=e.getStore(),w=0;null!=(i=t.next());){var S=b.get(h?g:o,i),M=b.get(a,i),I=p,T=void 0;h&&(T=+S-b.get(o,i));var C=void 0,D=void 0,A=void 0,k=void 0;if(c){var L=n.dataToPoint([S,M]);if(h)I=n.dataToPoint([T,M])[0];C=I,D=L[1]+v,A=L[0]-I,k=y,Math.abs(A)0)for(var s=0;s=0;--s)if(l[u]){o=l[u];break}o=o||a.none}if(Y(o)){var h=null==t.level?0:t.level>=0?t.level:o.length+t.level;o=o[h=Math.min(h,o.length-1)]}}return Yc(new Date(t.value),o,r,i)}(t,e,n,this.getSetting("locale"),i)},e.prototype.getTicks=function(){var t=this._interval,e=this._extent,n=[];if(!t)return n;n.push({value:e[0],level:0});var i=this.getSetting("useUTC"),r=function(t,e,n,i){var r=1e4,o=Fc,a=0;function s(t,e,n,r,o,a,s){for(var l=new Date(e),u=e,h=l[r]();u1&&0===u&&o.unshift({value:o[0].value-p})}}for(u=0;u=i[0]&&v<=i[1]&&c++)}var m=(i[1]-i[0])/e;if(c>1.5*m&&p>m/1.5)break;if(u.push(g),c>m||t===o[d])break}h=[]}}0;var x=B(z(u,(function(t){return B(t,(function(t){return t.value>=i[0]&&t.value<=i[1]&&!t.notAdd}))})),(function(t){return t.length>0})),_=[],b=x.length-1;for(d=0;dn&&(this._approxInterval=n);var o=Vx.length,a=Math.min(function(t,e,n,i){for(;n>>1;t[r][1]16?16:t>7.5?7:t>3.5?4:t>1.5?2:1}function Fx(t){return(t/=2592e6)>6?6:t>3?3:t>2?2:1}function Gx(t){return(t/=Oc)>12?12:t>6?6:t>3.5?4:t>2?2:1}function Wx(t,e){return(t/=e?Pc:Lc)>30?30:t>20?20:t>15?15:t>10?10:t>5?5:t>2?2:1}function Hx(t){return no(t,!0)}function Yx(t,e,n){var i=new Date(t);switch(Wc(e)){case"year":case"month":i[ep(n)](0);case"day":i[np(n)](1);case"hour":i[ip(n)](0);case"minute":i[rp(n)](0);case"second":i[op(n)](0),i[ap(n)](0)}return i.getTime()}lx.registerClass(zx);var Ux=lx.prototype,Xx=Sx.prototype,Zx=Wr,jx=Math.floor,qx=Math.ceil,Kx=Math.pow,$x=Math.log,Jx=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="log",e.base=10,e._originalScale=new Sx,e._interval=0,e}return n(e,t),e.prototype.getTicks=function(t){var e=this._originalScale,n=this._extent,i=e.getExtent();return z(Xx.getTicks.call(this,t),(function(t){var e=t.value,r=Wr(Kx(this.base,e));return r=e===n[0]&&this._fixMin?t_(r,i[0]):r,{value:r=e===n[1]&&this._fixMax?t_(r,i[1]):r}}),this)},e.prototype.setExtent=function(t,e){var n=$x(this.base);t=$x(Math.max(0,t))/n,e=$x(Math.max(0,e))/n,Xx.setExtent.call(this,t,e)},e.prototype.getExtent=function(){var t=this.base,e=Ux.getExtent.call(this);e[0]=Kx(t,e[0]),e[1]=Kx(t,e[1]);var n=this._originalScale.getExtent();return this._fixMin&&(e[0]=t_(e[0],n[0])),this._fixMax&&(e[1]=t_(e[1],n[1])),e},e.prototype.unionExtent=function(t){this._originalScale.unionExtent(t);var e=this.base;t[0]=$x(t[0])/$x(e),t[1]=$x(t[1])/$x(e),Ux.unionExtent.call(this,t)},e.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},e.prototype.calcNiceTicks=function(t){t=t||10;var e=this._extent,n=e[1]-e[0];if(!(n===1/0||n<=0)){var i=to(n);for(t/n*i<=.5&&(i*=10);!isNaN(i)&&Math.abs(i)<1&&Math.abs(i)>0;)i*=10;var r=[Wr(qx(e[0]/i)*i),Wr(jx(e[1]/i)*i)];this._interval=i,this._niceExtent=r}},e.prototype.calcNiceExtent=function(t){Xx.calcNiceExtent.call(this,t),this._fixMin=t.fixMin,this._fixMax=t.fixMax},e.prototype.parse=function(t){return t},e.prototype.contain=function(t){return vx(t=$x(t)/$x(this.base),this._extent)},e.prototype.normalize=function(t){return mx(t=$x(t)/$x(this.base),this._extent)},e.prototype.scale=function(t){return t=xx(t,this._extent),Kx(this.base,t)},e.type="log",e}(lx),Qx=Jx.prototype;function t_(t,e){return Zx(t,Yr(e))}Qx.getMinorTicks=Xx.getMinorTicks,Qx.getLabel=Xx.getLabel,lx.registerClass(Jx);var e_=function(){function t(t,e,n){this._prepareParams(t,e,n)}return t.prototype._prepareParams=function(t,e,n){n[1]0&&s>0&&!l&&(a=0),a<0&&s<0&&!u&&(s=0));var c=this._determinedMin,p=this._determinedMax;return null!=c&&(a=c,l=!0),null!=p&&(s=p,u=!0),{min:a,max:s,minFixed:l,maxFixed:u,isBlank:h}},t.prototype.modifyDataMinMax=function(t,e){this[i_[t]]=e},t.prototype.setDeterminedMinMax=function(t,e){var n=n_[t];this[n]=e},t.prototype.freeze=function(){this.frozen=!0},t}(),n_={min:"_determinedMin",max:"_determinedMax"},i_={min:"_dataMin",max:"_dataMax"};function r_(t,e,n){var i=t.rawExtentInfo;return i||(i=new e_(t,e,n),t.rawExtentInfo=i,i)}function o_(t,e){return null==e?null:nt(e)?NaN:t.parse(e)}function a_(t,e){var n=t.type,i=r_(t,e,t.getExtent()).calculate();t.setBlank(i.isBlank);var r=i.min,o=i.max,a=e.ecModel;if(a&&"time"===n){var s=kx("bar",a),l=!1;if(E(s,(function(t){l=l||t.getBaseAxis()===e.axis})),l){var u=Lx(s),h=function(t,e,n,i){var r=n.axis.getExtent(),o=r[1]-r[0],a=function(t,e,n){if(t&&e){var i=t[Ax(e)];return null!=i&&null!=n?i[Dx(n)]:i}}(i,n.axis);if(void 0===a)return{min:t,max:e};var s=1/0;E(a,(function(t){s=Math.min(t.offset,s)}));var l=-1/0;E(a,(function(t){l=Math.max(t.offset+t.width,l)})),s=Math.abs(s),l=Math.abs(l);var u=s+l,h=e-t,c=h/(1-(s+l)/o)-h;return{min:t-=c*(s/u),max:e+=c*(l/u)}}(r,o,e,u);r=h.min,o=h.max}}return{extent:[r,o],fixMin:i.minFixed,fixMax:i.maxFixed}}function s_(t,e){var n=e,i=a_(t,n),r=i.extent,o=n.get("splitNumber");t instanceof Jx&&(t.base=n.get("logBase"));var a=t.type,s=n.get("interval"),l="interval"===a||"time"===a;t.setExtent(r[0],r[1]),t.calcNiceExtent({splitNumber:o,fixMin:i.fixMin,fixMax:i.fixMax,minInterval:l?n.get("minInterval"):null,maxInterval:l?n.get("maxInterval"):null}),null!=s&&t.setInterval&&t.setInterval(s)}function l_(t,e){if(e=e||t.get("type"))switch(e){case"category":return new _x({ordinalMeta:t.getOrdinalMeta?t.getOrdinalMeta():t.getCategories(),extent:[1/0,-1/0]});case"time":return new zx({locale:t.ecModel.getLocaleModel(),useUTC:t.ecModel.get("useUTC")});default:return new(lx.getClass(e)||Sx)}}function u_(t){var e,n,i=t.getLabelModel().get("formatter"),r="category"===t.type?t.scale.getExtent()[0]:null;return"time"===t.scale.type?(n=i,function(e,i){return t.scale.getFormattedLabel(e,i,n)}):X(i)?function(e){return function(n){var i=t.scale.getLabel(n);return e.replace("{value}",null!=i?i:"")}}(i):U(i)?(e=i,function(n,i){return null!=r&&(i=n.value-r),e(h_(t,n),i,null!=n.level?{level:n.level}:null)}):function(e){return t.scale.getLabel(e)}}function h_(t,e){return"category"===t.type?t.scale.getLabel(e):e.value}function c_(t,e){var n=e*Math.PI/180,i=t.width,r=t.height,o=i*Math.abs(Math.cos(n))+Math.abs(r*Math.sin(n)),a=i*Math.abs(Math.sin(n))+Math.abs(r*Math.cos(n));return new Re(t.x,t.y,o,a)}function p_(t){var e=t.get("interval");return null==e?"auto":e}function d_(t){return"category"===t.type&&0===p_(t.getLabelModel())}function f_(t,e){var n={};return E(t.mapDimensionsAll(e),(function(e){n[ax(t,e)]=!0})),G(n)}var g_=function(){function t(){}return t.prototype.getNeedCrossZero=function(){return!this.option.scale},t.prototype.getCoordSysModel=function(){},t}();var y_={isDimensionStacked:ox,enableDataStack:rx,getStackedDimension:ax};var v_=Object.freeze({__proto__:null,createList:function(t){return sx(null,t)},getLayoutRect:wp,dataStack:y_,createScale:function(t,e){var n=e;e instanceof xc||(n=new xc(e));var i=l_(n);return i.setExtent(t[0],t[1]),s_(i,n),i},mixinAxisModelCommonMethods:function(t){R(t,g_)},getECData:js,createTextStyle:function(t,e){return $h(t,null,null,"normal"!==(e=e||{}).state)},createDimensions:function(t,e){return Qm(t,e).dimensions},createSymbol:Ry,enableHoverEmphasis:Vl});function m_(t,e){return Math.abs(t-e)<1e-8}function x_(t,e,n){var i=0,r=t[0];if(!r)return!1;for(var o=1;on&&(t=r,n=a)}if(t)return function(t){for(var e=0,n=0,i=0,r=t.length,o=t[r-1][0],a=t[r-1][1],s=0;s>1^-(1&s),l=l>>1^-(1&l),r=s+=r,o=l+=o,i.push([s/n,l/n])}return i}function k_(t,e){return z(B((t=function(t){if(!t.UTF8Encoding)return t;var e=t,n=e.UTF8Scale;return null==n&&(n=1024),E(e.features,(function(t){var e=t.geometry,i=e.encodeOffsets,r=e.coordinates;if(i)switch(e.type){case"LineString":e.coordinates=A_(r,i,n);break;case"Polygon":case"MultiLineString":D_(r,i,n);break;case"MultiPolygon":E(r,(function(t,e){return D_(t,i[e],n)}))}})),e.UTF8Encoding=!1,e}(t)).features,(function(t){return t.geometry&&t.properties&&t.geometry.coordinates.length>0})),(function(t){var n=t.properties,i=t.geometry,r=[];switch(i.type){case"Polygon":var o=i.coordinates;r.push(new M_(o[0],o.slice(1)));break;case"MultiPolygon":E(i.coordinates,(function(t){t[0]&&r.push(new M_(t[0],t.slice(1)))}));break;case"LineString":r.push(new I_([i.coordinates]));break;case"MultiLineString":r.push(new I_(i.coordinates))}var a=new T_(n[e||"name"],r,n.cp);return a.properties=n,a}))}var L_=Object.freeze({__proto__:null,linearMap:Fr,round:Wr,asc:Hr,getPrecision:Yr,getPrecisionSafe:Ur,getPixelPrecision:Xr,getPercentWithPrecision:function(t,e,n){return t[e]&&Zr(t,n)[e]||0},MAX_SAFE_INTEGER:qr,remRadian:Kr,isRadianAroundZero:$r,parseDate:Qr,quantity:to,quantityExponent:eo,nice:no,quantile:io,reformIntervals:ro,isNumeric:ao,numericToNumber:oo}),P_=Object.freeze({__proto__:null,parse:Qr,format:Yc}),O_=Object.freeze({__proto__:null,extendShape:xh,extendPath:bh,makePath:Mh,makeImage:Ih,mergePath:Ch,resizePath:Dh,createIcon:Vh,updateProps:uh,initProps:hh,getTransform:Lh,clipPointsByRect:Eh,clipRectByRect:zh,registerShape:wh,getShapeClass:Sh,Group:Pr,Image:Is,Text:Ns,Circle:gu,Ellipse:vu,Sector:Pu,Ring:Ru,Polygon:zu,Polyline:Bu,Rect:Ps,Line:Wu,BezierCurve:Xu,Arc:ju,IncrementalDisplayable:oh,CompoundPath:qu,LinearGradient:$u,RadialGradient:Ju,BoundingRect:Re}),R_=Object.freeze({__proto__:null,addCommas:sp,toCamelCase:lp,normalizeCssArray:up,encodeHTML:ee,formatTpl:dp,getTooltipMarker:fp,formatTime:function(t,e,n){"week"!==t&&"month"!==t&&"quarter"!==t&&"half-year"!==t&&"year"!==t||(t="MM-dd\nyyyy");var i=Qr(e),r=n?"getUTC":"get",o=i[r+"FullYear"](),a=i[r+"Month"]()+1,s=i[r+"Date"](),l=i[r+"Hours"](),u=i[r+"Minutes"](),h=i[r+"Seconds"](),c=i[r+"Milliseconds"]();return t=t.replace("MM",Gc(a,2)).replace("M",a).replace("yyyy",o).replace("yy",Gc(o%100+"",2)).replace("dd",Gc(s,2)).replace("d",s).replace("hh",Gc(l,2)).replace("h",l).replace("mm",Gc(u,2)).replace("m",u).replace("ss",Gc(h,2)).replace("s",h).replace("SSS",Gc(c,3))},capitalFirst:function(t){return t?t.charAt(0).toUpperCase()+t.substr(1):t},truncateText:na,getTextRect:function(t,e,n,i,r,o,a,s){return new Ns({style:{text:t,font:e,align:n,verticalAlign:i,padding:r,rich:o,overflow:a?"truncate":null,lineHeight:s}}).getBoundingRect()}}),N_=Object.freeze({__proto__:null,map:z,each:E,indexOf:P,inherits:O,reduce:V,filter:B,bind:W,curry:H,isArray:Y,isString:X,isObject:q,isFunction:U,extend:A,defaults:k,clone:T,merge:C}),E_=Do();function z_(t){return"category"===t.type?function(t){var e=t.getLabelModel(),n=B_(t,e);return!e.get("show")||t.scale.isBlank()?{labels:[],labelCategoryInterval:n.labelCategoryInterval}:n}(t):function(t){var e=t.scale.getTicks(),n=u_(t);return{labels:z(e,(function(e,i){return{level:e.level,formattedLabel:n(e,i),rawLabel:t.scale.getLabel(e),tickValue:e.value}}))}}(t)}function V_(t,e){return"category"===t.type?function(t,e){var n,i,r=F_(t,"ticks"),o=p_(e),a=G_(r,o);if(a)return a;e.get("show")&&!t.scale.isBlank()||(n=[]);if(U(o))n=Y_(t,o,!0);else if("auto"===o){var s=B_(t,t.getLabelModel());i=s.labelCategoryInterval,n=z(s.labels,(function(t){return t.tickValue}))}else n=H_(t,i=o,!0);return W_(r,o,{ticks:n,tickCategoryInterval:i})}(t,e):{ticks:z(t.scale.getTicks(),(function(t){return t.value}))}}function B_(t,e){var n,i,r=F_(t,"labels"),o=p_(e),a=G_(r,o);return a||(U(o)?n=Y_(t,o):(i="auto"===o?function(t){var e=E_(t).autoInterval;return null!=e?e:E_(t).autoInterval=t.calculateCategoryInterval()}(t):o,n=H_(t,i)),W_(r,o,{labels:n,labelCategoryInterval:i}))}function F_(t,e){return E_(t)[e]||(E_(t)[e]=[])}function G_(t,e){for(var n=0;n1&&h/l>2&&(u=Math.round(Math.ceil(u/l)*l));var c=d_(t),p=a.get("showMinLabel")||c,d=a.get("showMaxLabel")||c;p&&u!==o[0]&&g(o[0]);for(var f=u;f<=o[1];f+=l)g(f);function g(t){var e={value:t};s.push(n?t:{formattedLabel:i(e),rawLabel:r.getLabel(e),tickValue:t})}return d&&f-l!==o[1]&&g(o[1]),s}function Y_(t,e,n){var i=t.scale,r=u_(t),o=[];return E(i.getTicks(),(function(t){var a=i.getLabel(t),s=t.value;e(t.value,a)&&o.push(n?s:{formattedLabel:r(t),rawLabel:a,tickValue:s})})),o}var U_=[0,1],X_=function(){function t(t,e,n){this.onBand=!1,this.inverse=!1,this.dim=t,this.scale=e,this._extent=n||[0,0]}return t.prototype.contain=function(t){var e=this._extent,n=Math.min(e[0],e[1]),i=Math.max(e[0],e[1]);return t>=n&&t<=i},t.prototype.containData=function(t){return this.scale.contain(t)},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.getPixelPrecision=function(t){return Xr(t||this.scale.getExtent(),this._extent)},t.prototype.setExtent=function(t,e){var n=this._extent;n[0]=t,n[1]=e},t.prototype.dataToCoord=function(t,e){var n=this._extent,i=this.scale;return t=i.normalize(t),this.onBand&&"ordinal"===i.type&&Z_(n=n.slice(),i.count()),Fr(t,U_,n,e)},t.prototype.coordToData=function(t,e){var n=this._extent,i=this.scale;this.onBand&&"ordinal"===i.type&&Z_(n=n.slice(),i.count());var r=Fr(t,n,U_,e);return this.scale.scale(r)},t.prototype.pointToData=function(t,e){},t.prototype.getTicksCoords=function(t){var e=(t=t||{}).tickModel||this.getTickModel(),n=z(V_(this,e).ticks,(function(t){return{coord:this.dataToCoord("ordinal"===this.scale.type?this.scale.getRawOrdinalNumber(t):t),tickValue:t}}),this);return function(t,e,n,i){var r=e.length;if(!t.onBand||n||!r)return;var o,a,s=t.getExtent();if(1===r)e[0].coord=s[0],o=e[1]={coord:s[0]};else{var l=e[r-1].tickValue-e[0].tickValue,u=(e[r-1].coord-e[0].coord)/l;E(e,(function(t){t.coord-=u/2})),a=1+t.scale.getExtent()[1]-e[r-1].tickValue,o={coord:e[r-1].coord+u*a},e.push(o)}var h=s[0]>s[1];c(e[0].coord,s[0])&&(i?e[0].coord=s[0]:e.shift());i&&c(s[0],e[0].coord)&&e.unshift({coord:s[0]});c(s[1],o.coord)&&(i?o.coord=s[1]:e.pop());i&&c(o.coord,s[1])&&e.push({coord:s[1]});function c(t,e){return t=Wr(t),e=Wr(e),h?t>e:t0&&t<100||(t=5),z(this.scale.getMinorTicks(t),(function(t){return z(t,(function(t){return{coord:this.dataToCoord(t),tickValue:t}}),this)}),this)},t.prototype.getViewLabels=function(){return z_(this).labels},t.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},t.prototype.getTickModel=function(){return this.model.getModel("axisTick")},t.prototype.getBandWidth=function(){var t=this._extent,e=this.scale.getExtent(),n=e[1]-e[0]+(this.onBand?1:0);0===n&&(n=1);var i=Math.abs(t[1]-t[0]);return Math.abs(i)/n},t.prototype.calculateCategoryInterval=function(){return function(t){var e=function(t){var e=t.getLabelModel();return{axisRotate:t.getRotate?t.getRotate():t.isHorizontal&&!t.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}(t),n=u_(t),i=(e.axisRotate-e.labelRotate)/180*Math.PI,r=t.scale,o=r.getExtent(),a=r.count();if(o[1]-o[0]<1)return 0;var s=1;a>40&&(s=Math.max(1,Math.floor(a/40)));for(var l=o[0],u=t.dataToCoord(l+1)-t.dataToCoord(l),h=Math.abs(u*Math.cos(i)),c=Math.abs(u*Math.sin(i)),p=0,d=0;l<=o[1];l+=s){var f,g,y=yr(n({value:l}),e.font,"center","top");f=1.3*y.width,g=1.3*y.height,p=Math.max(p,f,7),d=Math.max(d,g,7)}var v=p/h,m=d/c;isNaN(v)&&(v=1/0),isNaN(m)&&(m=1/0);var x=Math.max(0,Math.floor(Math.min(v,m))),_=E_(t.model),b=t.getExtent(),w=_.lastAutoInterval,S=_.lastTickCount;return null!=w&&null!=S&&Math.abs(w-x)<=1&&Math.abs(S-a)<=1&&w>x&&_.axisExtent0===b[0]&&_.axisExtent1===b[1]?x=w:(_.lastTickCount=a,_.lastAutoInterval=x,_.axisExtent0=b[0],_.axisExtent1=b[1]),x}(this)},t}();function Z_(t,e){var n=(t[1]-t[0])/e/2;t[0]+=n,t[1]-=n}var j_=2*Math.PI,q_=ts.CMD,K_=["top","right","bottom","left"];function $_(t,e,n,i,r){var o=n.width,a=n.height;switch(t){case"top":i.set(n.x+o/2,n.y-e),r.set(0,-1);break;case"bottom":i.set(n.x+o/2,n.y+a+e),r.set(0,1);break;case"left":i.set(n.x-e,n.y+a/2),r.set(-1,0);break;case"right":i.set(n.x+o+e,n.y+a/2),r.set(1,0)}}function J_(t,e,n,i,r,o,a,s,l){a-=t,s-=e;var u=Math.sqrt(a*a+s*s),h=(a/=u)*n+t,c=(s/=u)*n+e;if(Math.abs(i-r)%j_<1e-4)return l[0]=h,l[1]=c,u-n;if(o){var p=i;i=os(r),r=os(p)}else i=os(i),r=os(r);i>r&&(r+=j_);var d=Math.atan2(s,a);if(d<0&&(d+=j_),d>=i&&d<=r||d+j_>=i&&d+j_<=r)return l[0]=h,l[1]=c,u-n;var f=n*Math.cos(i)+t,g=n*Math.sin(i)+e,y=n*Math.cos(r)+t,v=n*Math.sin(r)+e,m=(f-a)*(f-a)+(g-s)*(g-s),x=(y-a)*(y-a)+(v-s)*(v-s);return m0){e=e/180*Math.PI,rb.fromArray(t[0]),ob.fromArray(t[1]),ab.fromArray(t[2]),Ie.sub(sb,rb,ob),Ie.sub(lb,ab,ob);var n=sb.len(),i=lb.len();if(!(n<.001||i<.001)){sb.scale(1/n),lb.scale(1/i);var r=sb.dot(lb);if(Math.cos(e)1&&Ie.copy(cb,ab),cb.toArray(t[1])}}}}function db(t,e,n){if(n<=180&&n>0){n=n/180*Math.PI,rb.fromArray(t[0]),ob.fromArray(t[1]),ab.fromArray(t[2]),Ie.sub(sb,ob,rb),Ie.sub(lb,ab,ob);var i=sb.len(),r=lb.len();if(!(i<.001||r<.001))if(sb.scale(1/i),lb.scale(1/r),sb.dot(e)=a)Ie.copy(cb,ab);else{cb.scaleAndAdd(lb,o/Math.tan(Math.PI/2-s));var l=ab.x!==ob.x?(cb.x-ob.x)/(ab.x-ob.x):(cb.y-ob.y)/(ab.y-ob.y);if(isNaN(l))return;l<0?Ie.copy(cb,ob):l>1&&Ie.copy(cb,ab)}cb.toArray(t[1])}}}function fb(t,e,n,i){var r="normal"===n,o=r?t:t.ensureState(n);o.ignore=e;var a=i.get("smooth");a&&!0===a&&(a=.3),o.shape=o.shape||{},a>0&&(o.shape.smooth=a);var s=i.getModel("lineStyle").getLineStyle();r?t.useStyle(s):o.style=s}function gb(t,e){var n=e.smooth,i=e.points;if(i)if(t.moveTo(i[0][0],i[0][1]),n>0&&i.length>=3){var r=Et(i[0],i[1]),o=Et(i[1],i[2]);if(!r||!o)return t.lineTo(i[1][0],i[1][1]),void t.lineTo(i[2][0],i[2][1]);var a=Math.min(r,o)*n,s=Bt([],i[1],i[0],a/r),l=Bt([],i[1],i[2],a/o),u=Bt([],s,l,.5);t.bezierCurveTo(s[0],s[1],s[0],s[1],u[0],u[1]),t.bezierCurveTo(l[0],l[1],l[0],l[1],i[2][0],i[2][1])}else for(var h=1;h0&&o&&_(-h/a,0,a);var f,g,y=t[0],v=t[a-1];return m(),f<0&&b(-f,.8),g<0&&b(g,.8),m(),x(f,g,1),x(g,f,-1),m(),f<0&&w(-f),g<0&&w(g),u}function m(){f=y.rect[e]-i,g=r-v.rect[e]-v.rect[n]}function x(t,e,n){if(t<0){var i=Math.min(e,-t);if(i>0){_(i*n,0,a);var r=i+t;r<0&&b(-r*n,1)}else b(-t*n,1)}}function _(n,i,r){0!==n&&(u=!0);for(var o=i;o0)for(l=0;l0;l--){_(-(o[l-1]*c),l,a)}}}function w(t){var e=t<0?-1:1;t=Math.abs(t);for(var n=Math.ceil(t/(a-1)),i=0;i0?_(n,0,i+1):_(-n,a-i-1,a),(t-=n)<=0)return}}function _b(t,e,n,i){return xb(t,"y","height",e,n,i)}function bb(t){var e=[];t.sort((function(t,e){return e.priority-t.priority}));var n=new Re(0,0,0,0);function i(t){if(!t.ignore){var e=t.ensureState("emphasis");null==e.ignore&&(e.ignore=!1)}t.ignore=!0}for(var r=0;r=0&&n.attr(d.oldLayoutSelect),P(u,"emphasis")>=0&&n.attr(d.oldLayoutEmphasis)),uh(n,s,e,a)}else if(n.attr(s),!rc(n).valueAnimation){var h=rt(n.style.opacity,1);n.style.opacity=0,hh(n,{style:{opacity:h}},e,a)}if(d.oldLayout=s,n.states.select){var c=d.oldLayoutSelect={};Db(c,s,Ab),Db(c,n.states.select,Ab)}if(n.states.emphasis){var p=d.oldLayoutEmphasis={};Db(p,s,Ab),Db(p,n.states.emphasis,Ab)}ac(n,a,l,e,e)}if(i&&!i.ignore&&!i.invisible){r=(d=Cb(i)).oldLayout;var d,f={points:i.shape.points};r?(i.attr({shape:r}),uh(i,{shape:f},e)):(i.setShape(f),i.style.strokePercent=0,hh(i,{style:{strokePercent:1}},e)),d.oldLayout=f}},t}(),Lb=Do();var Pb=Math.sin,Ob=Math.cos,Rb=Math.PI,Nb=2*Math.PI,Eb=180/Rb,zb=function(){function t(){}return t.prototype.reset=function(t){this._start=!0,this._d=[],this._str="",this._p=Math.pow(10,t||4)},t.prototype.moveTo=function(t,e){this._add("M",t,e)},t.prototype.lineTo=function(t,e){this._add("L",t,e)},t.prototype.bezierCurveTo=function(t,e,n,i,r,o){this._add("C",t,e,n,i,r,o)},t.prototype.quadraticCurveTo=function(t,e,n,i){this._add("Q",t,e,n,i)},t.prototype.arc=function(t,e,n,i,r,o){this.ellipse(t,e,n,n,0,i,r,o)},t.prototype.ellipse=function(t,e,n,i,r,o,a,s){var l=a-o,u=!s,h=Math.abs(l),c=si(h-Nb)||(u?l>=Nb:-l>=Nb),p=l>0?l%Nb:l%Nb+Nb,d=!1;d=!!c||!si(h)&&p>=Rb==!!u;var f=t+n*Ob(o),g=e+i*Pb(o);this._start&&this._add("M",f,g);var y=Math.round(r*Eb);if(c){var v=1/this._p,m=(u?1:-1)*(Nb-v);this._add("A",n,i,y,1,+u,t+n*Ob(o+m),e+i*Pb(o+m)),v>.01&&this._add("A",n,i,y,0,+u,f,g)}else{var x=t+n*Ob(a),_=e+i*Pb(a);this._add("A",n,i,y,+d,+u,x,_)}},t.prototype.rect=function(t,e,n,i){this._add("M",t,e),this._add("l",n,0),this._add("l",0,i),this._add("l",-n,0),this._add("Z")},t.prototype.closePath=function(){this._d.length>0&&this._add("Z")},t.prototype._add=function(t,e,n,i,r,o,a,s,l){for(var u=[],h=this._p,c=1;c"}(r,e.attrs)+ee(e.text)+(i?""+n+z(i,(function(e){return t(e)})).join(n)+n:"")+("")}(t)}function jb(t){return{zrId:t,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssClassIdx:0,cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function qb(t,e,n,i){return Xb("svg","root",{width:t,height:e,xmlns:Hb,"xmlns:xlink":Yb,version:"1.1",baseProfile:"full",viewBox:!!i&&"0 0 "+t+" "+e},n)}var Kb={cubicIn:"0.32,0,0.67,0",cubicOut:"0.33,1,0.68,1",cubicInOut:"0.65,0,0.35,1",quadraticIn:"0.11,0,0.5,0",quadraticOut:"0.5,1,0.89,1",quadraticInOut:"0.45,0,0.55,1",quarticIn:"0.5,0,0.75,0",quarticOut:"0.25,1,0.5,1",quarticInOut:"0.76,0,0.24,1",quinticIn:"0.64,0,0.78,0",quinticOut:"0.22,1,0.36,1",quinticInOut:"0.83,0,0.17,1",sinusoidalIn:"0.12,0,0.39,0",sinusoidalOut:"0.61,1,0.88,1",sinusoidalInOut:"0.37,0,0.63,1",exponentialIn:"0.7,0,0.84,0",exponentialOut:"0.16,1,0.3,1",exponentialInOut:"0.87,0,0.13,1",circularIn:"0.55,0,1,0.45",circularOut:"0,0.55,0.45,1",circularInOut:"0.85,0,0.15,1"},$b="transform-origin";function Jb(t,e,n){var i=A({},t.shape);A(i,e),t.buildPath(n,i);var r=new zb;return r.reset(gi(t)),n.rebuildPath(r,1),r.generateStr(),r.getStr()}function Qb(t,e){var n=e.originX,i=e.originY;(n||i)&&(t[$b]=n+"px "+i+"px")}var tw={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function ew(t,e){var n=e.zrId+"-ani-"+e.cssAnimIdx++;return e.cssAnims[n]=t,n}function nw(t){return X(t)?Kb[t]?"cubic-bezier("+Kb[t]+")":An(t)?t:"":""}function iw(t,e,n,i){var r=t.animators,o=r.length,a=[];if(t instanceof qu){var s=function(t,e,n){var i,r,o=t.shape.paths,a={};if(E(o,(function(t){var e=jb(n.zrId);e.animation=!0,iw(t,{},e,!0);var o=e.cssAnims,s=e.cssNodes,l=G(o),u=l.length;if(u){var h=o[r=l[u-1]];for(var c in h){var p=h[c];a[c]=a[c]||{d:""},a[c].d+=p.d||""}for(var d in s){var f=s[d].animation;f.indexOf(r)>=0&&(i=f)}}})),i){e.d=!1;var s=ew(a,n);return i.replace(r,s)}}(t,e,n);if(s)a.push(s);else if(!o)return}else if(!o)return;for(var l={},u=0;u0})).length)return ew(h,n)+" "+r[0]+" both"}for(var y in l){(s=g(l[y]))&&a.push(s)}if(a.length){var v=n.zrId+"-cls-"+n.cssClassIdx++;n.cssNodes["."+v]={animation:a.join(",")},e.class=v}}var rw=Math.round;function ow(t){return t&&X(t.src)}function aw(t){return t&&U(t.toDataURL)}function sw(t,e,n,i){Wb((function(r,o){var a="fill"===r||"stroke"===r;a&&function(t){return t&&("linear"===t.type||"radial"===t.type)}(o)?function(t,e,n,i){var r,o=t[n],a={gradientUnits:o.global?"userSpaceOnUse":"objectBoundingBox"};if(pi(o))r="linearGradient",a.x1=o.x,a.y1=o.y,a.x2=o.x2,a.y2=o.y2;else{if(!di(o))return void 0;r="radialGradient",a.cx=rt(o.x,.5),a.cy=rt(o.y,.5),a.r=rt(o.r,.5)}for(var s=o.colorStops,l=[],u=0,h=s.length;ul?Lw(t,null==n[c+1]?null:n[c+1].elm,n,s,c):Pw(t,e,a,l))}(n,i,r):Cw(r)?(Cw(t.text)&&Mw(n,""),Lw(n,null,r,0,r.length-1)):Cw(i)?Pw(n,i,0,i.length-1):Cw(t.text)&&Mw(n,""):t.text!==e.text&&(Cw(i)&&Pw(n,i,0,i.length-1),Mw(n,e.text)))}var Nw=0,Ew=function(){function t(t,e,n){if(this.type="svg",this.refreshHover=zw("refreshHover"),this.configLayer=zw("configLayer"),this.storage=e,this._opts=n=A({},n),this.root=t,this._id="zr"+Nw++,this._oldVNode=qb(n.width,n.height),t&&!n.ssr){var i=this._viewport=document.createElement("div");i.style.cssText="position:relative;overflow:hidden";var r=this._svgDom=this._oldVNode.elm=Ub("svg");Ow(null,this._oldVNode),i.appendChild(r),t.appendChild(i)}this.resize(n.width,n.height)}return t.prototype.getType=function(){return this.type},t.prototype.getViewportRoot=function(){return this._viewport},t.prototype.getViewportRootOffset=function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},t.prototype.getSvgDom=function(){return this._svgDom},t.prototype.refresh=function(){if(this.root){var t=this.renderToVNode({willUpdate:!0});t.attrs.style="position:absolute;left:0;top:0;user-select:none",function(t,e){if(Aw(t,e))Rw(t,e);else{var n=t.elm,i=ww(n);kw(e),null!==i&&(xw(i,e.elm,Sw(n)),Pw(i,[t],0,0))}}(this._oldVNode,t),this._oldVNode=t}},t.prototype.renderOneToVNode=function(t){return yw(t,jb(this._id))},t.prototype.renderToVNode=function(t){t=t||{};var e=this.storage.getDisplayList(!0),n=this._backgroundColor,i=this._width,r=this._height,o=jb(this._id);o.animation=t.animation,o.willUpdate=t.willUpdate,o.compress=t.compress;var a=[];if(n&&"none"!==n){var s=oi(n),l=s.color,u=s.opacity;this._bgVNode=Xb("rect","bg",{width:i,height:r,x:"0",y:"0",id:"0",fill:l,"fill-opacity":u}),a.push(this._bgVNode)}else this._bgVNode=null;var h=t.compress?null:this._mainVNode=Xb("g","main",{},[]);this._paintList(e,o,h?h.children:a),h&&a.push(h);var c=z(G(o.defs),(function(t){return o.defs[t]}));if(c.length&&a.push(Xb("defs","defs",{},c)),t.animation){var p=function(t,e,n){var i=(n=n||{}).newline?"\n":"",r=" {"+i,o=i+"}",a=z(G(t),(function(e){return e+r+z(G(t[e]),(function(n){return n+":"+t[e][n]+";"})).join(i)+o})).join(i),s=z(G(e),(function(t){return"@keyframes "+t+r+z(G(e[t]),(function(n){return n+r+z(G(e[t][n]),(function(i){var r=e[t][n][i];return"d"===i&&(r='path("'+r+'")'),i+":"+r+";"})).join(i)+o})).join(i)+o})).join(i);return a||s?[""].join(i):""}(o.cssNodes,o.cssAnims,{newline:!0});if(p){var d=Xb("style","stl",{},[],p);a.push(d)}}return qb(i,r,a,t.useViewBox)},t.prototype.renderToString=function(t){return t=t||{},Zb(this.renderToVNode({animation:rt(t.cssAnimation,!0),willUpdate:!1,compress:!0,useViewBox:rt(t.useViewBox,!0)}),{newline:!0})},t.prototype.setBackgroundColor=function(t){this._backgroundColor=t;var e=this._bgVNode;if(e&&e.elm){var n=oi(t),i=n.color,r=n.opacity;e.elm.setAttribute("fill",i),r<1&&e.elm.setAttribute("fill-opacity",r)}},t.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},t.prototype._paintList=function(t,e,n){for(var i,r,o=t.length,a=[],s=0,l=0,u=0;u=0&&(!c||!r||c[f]!==r[f]);f--);for(var g=d-1;g>f;g--)i=a[--s-1];for(var y=f+1;y=a)}}for(var h=this.__startIndex;h15)break}n.prevElClipPaths&&u.restore()};if(p)if(0===p.length)s=l.__endIndex;else for(var _=d.dpr,b=0;b0&&t>i[0]){for(s=0;st);s++);a=n[i[s]]}if(i.splice(s+1,0,t),n[t]=e,!e.virtual)if(a){var l=a.dom;l.nextSibling?o.insertBefore(e.dom,l.nextSibling):o.appendChild(e.dom)}else o.firstChild?o.insertBefore(e.dom,o.firstChild):o.appendChild(e.dom);e.__painter=this}},t.prototype.eachLayer=function(t,e){for(var n=this._zlevelList,i=0;i0?Ww:0),this._needsManuallyCompositing),u.__builtin__||I("ZLevel "+l+" has been used by unkown layer "+u.id),u!==o&&(u.__used=!0,u.__startIndex!==r&&(u.__dirty=!0),u.__startIndex=r,u.incremental?u.__drawIndex=-1:u.__drawIndex=r,e(r),o=u),1&s.__dirty&&!s.__inHover&&(u.__dirty=!0,u.incremental&&u.__drawIndex<0&&(u.__drawIndex=r))}e(r),this.eachBuiltinLayer((function(t,e){!t.__used&&t.getElementCount()>0&&(t.__dirty=!0,t.__startIndex=t.__endIndex=t.__drawIndex=0),t.__dirty&&t.__drawIndex<0&&(t.__drawIndex=t.__startIndex)}))},t.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},t.prototype._clearLayer=function(t){t.clear()},t.prototype.setBackgroundColor=function(t){this._backgroundColor=t,E(this._layers,(function(t){t.setUnpainted()}))},t.prototype.configLayer=function(t,e){if(e){var n=this._layerConfig;n[t]?C(n[t],e,!0):n[t]=e;for(var i=0;i-1&&(s.style.stroke=s.style.fill,s.style.fill="#fff",s.style.lineWidth=2),e},e.type="series.line",e.dependencies=["grid","polar"],e.defaultOption={z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1},e}(hg);function Uw(t,e){var n=t.mapDimensionsAll("defaultedLabel"),i=n.length;if(1===i){var r=uf(t,e,n[0]);return null!=r?r+"":null}if(i){for(var o=[],a=0;a=0&&i.push(e[o])}return i.join(" ")}var Zw=function(t){function e(e,n,i,r){var o=t.call(this)||this;return o.updateData(e,n,i,r),o}return n(e,t),e.prototype._createSymbol=function(t,e,n,i,r){this.removeAll();var o=Ry(t,-1,-1,2,2,null,r);o.attr({z2:100,culling:!0,scaleX:i[0]/2,scaleY:i[1]/2}),o.drift=jw,this._symbolType=t,this.add(o)},e.prototype.stopSymbolAnimation=function(t){this.childAt(0).stopAnimation(null,t)},e.prototype.getSymbolType=function(){return this._symbolType},e.prototype.getSymbolPath=function(){return this.childAt(0)},e.prototype.highlight=function(){Il(this.childAt(0))},e.prototype.downplay=function(){Tl(this.childAt(0))},e.prototype.setZ=function(t,e){var n=this.childAt(0);n.zlevel=t,n.z=e},e.prototype.setDraggable=function(t,e){var n=this.childAt(0);n.draggable=t,n.cursor=!e&&t?"move":n.cursor},e.prototype.updateData=function(t,n,i,r){this.silent=!1;var o=t.getItemVisual(n,"symbol")||"circle",a=t.hostModel,s=e.getSymbolSize(t,n),l=o!==this._symbolType,u=r&&r.disableAnimation;if(l){var h=t.getItemVisual(n,"symbolKeepAspect");this._createSymbol(o,t,n,s,h)}else{(p=this.childAt(0)).silent=!1;var c={scaleX:s[0]/2,scaleY:s[1]/2};u?p.attr(c):uh(p,c,a,n),gh(p)}if(this._updateCommon(t,n,s,i,r),l){var p=this.childAt(0);if(!u){c={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:p.style.opacity}};p.scaleX=p.scaleY=0,p.style.opacity=0,hh(p,c,a,n)}}u&&this.childAt(0).stopAnimation("leave")},e.prototype._updateCommon=function(t,e,n,i,r){var o,a,s,l,u,h,c,p,d,f=this.childAt(0),g=t.hostModel;if(i&&(o=i.emphasisItemStyle,a=i.blurItemStyle,s=i.selectItemStyle,l=i.focus,u=i.blurScope,c=i.labelStatesModels,p=i.hoverScale,d=i.cursorStyle,h=i.emphasisDisabled),!i||t.hasItemOption){var y=i&&i.itemModel?i.itemModel:t.getItemModel(e),v=y.getModel("emphasis");o=v.getModel("itemStyle").getItemStyle(),s=y.getModel(["select","itemStyle"]).getItemStyle(),a=y.getModel(["blur","itemStyle"]).getItemStyle(),l=v.get("focus"),u=v.get("blurScope"),h=v.get("disabled"),c=Kh(y),p=v.getShallow("scale"),d=y.getShallow("cursor")}var m=t.getItemVisual(e,"symbolRotate");f.attr("rotation",(m||0)*Math.PI/180||0);var x=Ey(t.getItemVisual(e,"symbolOffset"),n);x&&(f.x=x[0],f.y=x[1]),d&&f.attr("cursor",d);var _=t.getItemVisual(e,"style"),b=_.fill;if(f instanceof Is){var w=f.style;f.useStyle(A({image:w.image,x:w.x,y:w.y,width:w.width,height:w.height},_))}else f.__isEmptyBrush?f.useStyle(A({},_)):f.useStyle(_),f.style.decal=null,f.setColor(b,r&&r.symbolInnerColor),f.style.strokeNoScale=!0;var S=t.getItemVisual(e,"liftZ"),M=this._z2;null!=S?null==M&&(this._z2=f.z2,f.z2+=S):null!=M&&(f.z2=M,this._z2=null);var I=r&&r.useNameLabel;qh(f,c,{labelFetcher:g,labelDataIndex:e,defaultText:function(e){return I?t.getName(e):Uw(t,e)},inheritColor:b,defaultOpacity:_.opacity}),this._sizeX=n[0]/2,this._sizeY=n[1]/2;var T=f.ensureState("emphasis");T.style=o,f.ensureState("select").style=s,f.ensureState("blur").style=a;var C=null==p||!0===p?Math.max(1.1,3/this._sizeY):isFinite(p)&&p>0?+p:1;T.scaleX=this._sizeX*C,T.scaleY=this._sizeY*C,this.setSymbolScale(1),Bl(this,l,u,h)},e.prototype.setSymbolScale=function(t){this.scaleX=this.scaleY=t},e.prototype.fadeOut=function(t,e,n){var i=this.childAt(0),r=js(this).dataIndex,o=n&&n.animation;if(this.silent=i.silent=!0,n&&n.fadeLabel){var a=i.getTextContent();a&&ph(a,{style:{opacity:0}},e,{dataIndex:r,removeOpt:o,cb:function(){i.removeTextContent()}})}else i.removeTextContent();ph(i,{style:{opacity:0},scaleX:0,scaleY:0},e,{dataIndex:r,cb:t,removeOpt:o})},e.getSymbolSize=function(t,e){return Ny(t.getItemVisual(e,"symbolSize"))},e}(Pr);function jw(t,e){this.parent.drift(t,e)}function qw(t,e,n,i){return e&&!isNaN(e[0])&&!isNaN(e[1])&&!(i.isIgnore&&i.isIgnore(n))&&!(i.clipShape&&!i.clipShape.contain(e[0],e[1]))&&"none"!==t.getItemVisual(n,"symbol")}function Kw(t){return null==t||q(t)||(t={isIgnore:t}),t||{}}function $w(t){var e=t.hostModel,n=e.getModel("emphasis");return{emphasisItemStyle:n.getModel("itemStyle").getItemStyle(),blurItemStyle:e.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:e.getModel(["select","itemStyle"]).getItemStyle(),focus:n.get("focus"),blurScope:n.get("blurScope"),emphasisDisabled:n.get("disabled"),hoverScale:n.get("scale"),labelStatesModels:Kh(e),cursorStyle:e.get("cursor")}}var Jw=function(){function t(t){this.group=new Pr,this._SymbolCtor=t||Zw}return t.prototype.updateData=function(t,e){this._progressiveEls=null,e=Kw(e);var n=this.group,i=t.hostModel,r=this._data,o=this._SymbolCtor,a=e.disableAnimation,s=$w(t),l={disableAnimation:a},u=e.getSymbolPoint||function(e){return t.getItemLayout(e)};r||n.removeAll(),t.diff(r).add((function(i){var r=u(i);if(qw(t,r,i,e)){var a=new o(t,i,s,l);a.setPosition(r),t.setItemGraphicEl(i,a),n.add(a)}})).update((function(h,c){var p=r.getItemGraphicEl(c),d=u(h);if(qw(t,d,h,e)){var f=t.getItemVisual(h,"symbol")||"circle",g=p&&p.getSymbolType&&p.getSymbolType();if(!p||g&&g!==f)n.remove(p),(p=new o(t,h,s,l)).setPosition(d);else{p.updateData(t,h,s,l);var y={x:d[0],y:d[1]};a?p.attr(y):uh(p,y,i)}n.add(p),t.setItemGraphicEl(h,p)}else n.remove(p)})).remove((function(t){var e=r.getItemGraphicEl(t);e&&e.fadeOut((function(){n.remove(e)}),i)})).execute(),this._getSymbolPoint=u,this._data=t},t.prototype.updateLayout=function(){var t=this,e=this._data;e&&e.eachItemGraphicEl((function(e,n){var i=t._getSymbolPoint(n);e.setPosition(i),e.markRedraw()}))},t.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=$w(t),this._data=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(t,e,n){function i(t){t.isGroup||(t.incremental=!0,t.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[],n=Kw(n);for(var r=t.start;r0?n=i[0]:i[1]<0&&(n=i[1]);return n}(r,n),a=i.dim,s=r.dim,l=e.mapDimension(s),u=e.mapDimension(a),h="x"===s||"radius"===s?1:0,c=z(t.dimensions,(function(t){return e.mapDimension(t)})),p=!1,d=e.getCalculationInfo("stackResultDimension");return ox(e,c[0])&&(p=!0,c[0]=d),ox(e,c[1])&&(p=!0,c[1]=d),{dataDimsForPoint:c,valueStart:o,valueAxisDim:s,baseAxisDim:a,stacked:!!p,valueDim:l,baseDim:u,baseDataOffset:h,stackedOverDimension:e.getCalculationInfo("stackedOverDimension")}}function tS(t,e,n,i){var r=NaN;t.stacked&&(r=n.get(n.getCalculationInfo("stackedOverDimension"),i)),isNaN(r)&&(r=t.valueStart);var o=t.baseDataOffset,a=[];return a[o]=n.get(t.baseDim,i),a[1-o]=r,e.dataToPoint(a)}var eS=Math.min,nS=Math.max;function iS(t,e){return isNaN(t)||isNaN(e)}function rS(t,e,n,i,r,o,a,s,l){for(var u,h,c,p,d,f,g=n,y=0;y=r||g<0)break;if(iS(v,m)){if(l){g+=o;continue}break}if(g===n)t[o>0?"moveTo":"lineTo"](v,m),c=v,p=m;else{var x=v-u,_=m-h;if(x*x+_*_<.5){g+=o;continue}if(a>0){for(var b=g+o,w=e[2*b],S=e[2*b+1];w===v&&S===m&&y=i||iS(w,S))d=v,f=m;else{T=w-u,C=S-h;var k=v-u,L=w-v,P=m-h,O=S-m,R=void 0,N=void 0;if("x"===s){var E=T>0?1:-1;d=v-E*(R=Math.abs(k))*a,f=m,D=v+E*(N=Math.abs(L))*a,A=m}else if("y"===s){var z=C>0?1:-1;d=v,f=m-z*(R=Math.abs(P))*a,D=v,A=m+z*(N=Math.abs(O))*a}else R=Math.sqrt(k*k+P*P),d=v-T*a*(1-(I=(N=Math.sqrt(L*L+O*O))/(N+R))),f=m-C*a*(1-I),A=m+C*a*I,D=eS(D=v+T*a*I,nS(w,v)),A=eS(A,nS(S,m)),D=nS(D,eS(w,v)),f=m-(C=(A=nS(A,eS(S,m)))-m)*R/N,d=eS(d=v-(T=D-v)*R/N,nS(u,v)),f=eS(f,nS(h,m)),D=v+(T=v-(d=nS(d,eS(u,v))))*N/R,A=m+(C=m-(f=nS(f,eS(h,m))))*N/R}t.bezierCurveTo(c,p,d,f,v,m),c=D,p=A}else t.lineTo(v,m)}u=v,h=m,g+=o}return y}var oS=function(){this.smooth=0,this.smoothConstraint=!0},aS=function(t){function e(e){var n=t.call(this,e)||this;return n.type="ec-polyline",n}return n(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new oS},e.prototype.buildPath=function(t,e){var n=e.points,i=0,r=n.length/2;if(e.connectNulls){for(;r>0&&iS(n[2*r-2],n[2*r-1]);r--);for(;i=0){var y=a?(h-i)*g+i:(u-n)*g+n;return a?[t,y]:[y,t]}n=u,i=h;break;case o.C:u=r[l++],h=r[l++],c=r[l++],p=r[l++],d=r[l++],f=r[l++];var v=a?vn(n,u,c,d,t,s):vn(i,h,p,f,t,s);if(v>0)for(var m=0;m=0){y=a?gn(i,h,p,f,x):gn(n,u,c,d,x);return a?[t,y]:[y,t]}}n=d,i=f}}},e}(_s),sS=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e}(oS),lS=function(t){function e(e){var n=t.call(this,e)||this;return n.type="ec-polygon",n}return n(e,t),e.prototype.getDefaultShape=function(){return new sS},e.prototype.buildPath=function(t,e){var n=e.points,i=e.stackedOnPoints,r=0,o=n.length/2,a=e.smoothMonotone;if(e.connectNulls){for(;o>0&&iS(n[2*o-2],n[2*o-1]);o--);for(;r=0;a--){var s=t.getDimensionInfo(i[a].dimension);if("x"===(r=s&&s.coordDim)||"y"===r){o=i[a];break}}if(o){var l=e.getAxis(r),u=z(o.stops,(function(t){return{coord:l.toGlobalCoord(l.dataToCoord(t.value)),color:t.color}})),h=u.length,c=o.outerColors.slice();h&&u[0].coord>u[h-1].coord&&(u.reverse(),c.reverse());var p=function(t,e){var n,i,r=[],o=t.length;function a(t,e,n){var i=t.coord;return{coord:n,color:$n((n-i)/(e.coord-i),[t.color,e.color])}}for(var s=0;se){i?r.push(a(i,l,e)):n&&r.push(a(n,l,0),a(n,l,e));break}n&&(r.push(a(n,l,0)),n=null),r.push(l),i=l}}return r}(u,"x"===r?n.getWidth():n.getHeight()),d=p.length;if(!d&&h)return u[0].coord<0?c[1]?c[1]:u[h-1].color:c[0]?c[0]:u[0].color;var f=p[0].coord-10,g=p[d-1].coord+10,y=g-f;if(y<.001)return"transparent";E(p,(function(t){t.offset=(t.coord-f)/y})),p.push({offset:d?p[d-1].offset:.5,color:c[1]||"transparent"}),p.unshift({offset:d?p[0].offset:.5,color:c[0]||"transparent"});var v=new $u(0,0,0,0,p,!0);return v[r]=f,v[r+"2"]=g,v}}}function xS(t,e,n){var i=t.get("showAllSymbol"),r="auto"===i;if(!i||r){var o=n.getAxesByScale("ordinal")[0];if(o&&(!r||!function(t,e){var n=t.getExtent(),i=Math.abs(n[1]-n[0])/t.scale.count();isNaN(i)&&(i=0);for(var r=e.count(),o=Math.max(1,Math.round(r/5)),a=0;ai)return!1;return!0}(o,e))){var a=e.mapDimension(o.dim),s={};return E(o.getViewLabels(),(function(t){var e=o.scale.getRawOrdinalNumber(t.tickValue);s[e]=1})),function(t){return!s.hasOwnProperty(e.get(a,t))}}}}function _S(t,e){return[t[2*e],t[2*e+1]]}function bS(t){if(t.get(["endLabel","show"]))return!0;for(var e=0;e0&&"bolder"===t.get(["emphasis","lineStyle","width"]))&&(d.getState("emphasis").style.lineWidth=+d.style.lineWidth+1);js(d).seriesIndex=t.seriesIndex,Bl(d,L,P,O);var R=yS(t.get("smooth")),N=t.get("smoothMonotone");if(d.setShape({smooth:R,smoothMonotone:N,connectNulls:w}),f){var E=a.getCalculationInfo("stackedOnSeries"),z=0;f.useStyle(k(l.getAreaStyle(),{fill:C,opacity:.7,lineJoin:"bevel",decal:a.getVisual("style").decal})),E&&(z=yS(E.get("smooth"))),f.setShape({smooth:R,stackedOnSmooth:z,smoothMonotone:N,connectNulls:w}),Hl(f,t,"areaStyle"),js(f).seriesIndex=t.seriesIndex,Bl(f,L,P,O)}var V=function(t){i._changePolyState(t)};a.eachItemGraphicEl((function(t){t&&(t.onHoverStateChange=V)})),this._polyline.onHoverStateChange=V,this._data=a,this._coordSys=r,this._stackedOnPoints=_,this._points=u,this._step=T,this._valueOrigin=m,t.get("triggerLineEvent")&&(this.packEventData(t,d),f&&this.packEventData(t,f))},e.prototype.packEventData=function(t,e){js(e).eventData={componentType:"series",componentSubType:"line",componentIndex:t.componentIndex,seriesIndex:t.seriesIndex,seriesName:t.name,seriesType:"line"}},e.prototype.highlight=function(t,e,n,i){var r=t.getData(),o=Co(r,i);if(this._changePolyState("emphasis"),!(o instanceof Array)&&null!=o&&o>=0){var a=r.getLayout("points"),s=r.getItemGraphicEl(o);if(!s){var l=a[2*o],u=a[2*o+1];if(isNaN(l)||isNaN(u))return;if(this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(l,u))return;var h=t.get("zlevel")||0,c=t.get("z")||0;(s=new Zw(r,o)).x=l,s.y=u,s.setZ(h,c);var p=s.getSymbolPath().getTextContent();p&&(p.zlevel=h,p.z=c,p.z2=this._polyline.z2+1),s.__temp=!0,r.setItemGraphicEl(o,s),s.stopSymbolAnimation(!0),this.group.add(s)}s.highlight()}else wg.prototype.highlight.call(this,t,e,n,i)},e.prototype.downplay=function(t,e,n,i){var r=t.getData(),o=Co(r,i);if(this._changePolyState("normal"),null!=o&&o>=0){var a=r.getItemGraphicEl(o);a&&(a.__temp?(r.setItemGraphicEl(o,null),this.group.remove(a)):a.downplay())}else wg.prototype.downplay.call(this,t,e,n,i)},e.prototype._changePolyState=function(t){var e=this._polygon;_l(this._polyline,t),e&&_l(e,t)},e.prototype._newPolyline=function(t){var e=this._polyline;return e&&this._lineGroup.remove(e),e=new aS({shape:{points:t},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(e),this._polyline=e,e},e.prototype._newPolygon=function(t,e){var n=this._polygon;return n&&this._lineGroup.remove(n),n=new lS({shape:{points:t,stackedOnPoints:e},segmentIgnoreThreshold:2}),this._lineGroup.add(n),this._polygon=n,n},e.prototype._initSymbolLabelAnimation=function(t,e,n){var i,r,o=e.getBaseAxis(),a=o.inverse;"cartesian2d"===e.type?(i=o.isHorizontal(),r=!1):"polar"===e.type&&(i="angle"===o.dim,r=!0);var s=t.hostModel,l=s.get("animationDuration");U(l)&&(l=l(null));var u=s.get("animationDelay")||0,h=U(u)?u(null):u;t.eachItemGraphicEl((function(t,o){var s=t;if(s){var c=[t.x,t.y],p=void 0,d=void 0,f=void 0;if(n)if(r){var g=n,y=e.pointToCoord(c);i?(p=g.startAngle,d=g.endAngle,f=-y[1]/180*Math.PI):(p=g.r0,d=g.r,f=y[0])}else{var v=n;i?(p=v.x,d=v.x+v.width,f=t.x):(p=v.y+v.height,d=v.y,f=t.y)}var m=d===p?0:(f-p)/(d-p);a&&(m=1-m);var x=U(u)?u(o):l*m+h,_=s.getSymbolPath(),b=_.getTextContent();s.attr({scaleX:0,scaleY:0}),s.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:x}),b&&b.animateFrom({style:{opacity:0}},{duration:300,delay:x}),_.disableLabelAnimation=!0}}))},e.prototype._initOrUpdateEndLabel=function(t,e,n){var i=t.getModel("endLabel");if(bS(t)){var r=t.getData(),o=this._polyline,a=r.getLayout("points");if(!a)return o.removeTextContent(),void(this._endLabel=null);var s=this._endLabel;s||((s=this._endLabel=new Ns({z2:200})).ignoreClip=!0,o.setTextContent(this._endLabel),o.disableLabelAnimation=!0);var l=function(t){for(var e,n,i=t.length/2;i>0&&(e=t[2*i-2],n=t[2*i-1],isNaN(e)||isNaN(n));i--);return i-1}(a);l>=0&&(qh(o,Kh(t,"endLabel"),{inheritColor:n,labelFetcher:t,labelDataIndex:l,defaultText:function(t,e,n){return null!=n?Xw(r,n):Uw(r,t)},enableTextSetter:!0},function(t,e){var n=e.getBaseAxis(),i=n.isHorizontal(),r=n.inverse,o=i?r?"right":"left":"center",a=i?"middle":r?"top":"bottom";return{normal:{align:t.get("align")||o,verticalAlign:t.get("verticalAlign")||a}}}(i,e)),o.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},e.prototype._endLabelOnDuring=function(t,e,n,i,r,o,a){var s=this._endLabel,l=this._polyline;if(s){t<1&&null==i.originalX&&(i.originalX=s.x,i.originalY=s.y);var u=n.getLayout("points"),h=n.hostModel,c=h.get("connectNulls"),p=o.get("precision"),d=o.get("distance")||0,f=a.getBaseAxis(),g=f.isHorizontal(),y=f.inverse,v=e.shape,m=y?g?v.x:v.y+v.height:g?v.x+v.width:v.y,x=(g?d:0)*(y?-1:1),_=(g?0:-d)*(y?-1:1),b=g?"x":"y",w=function(t,e,n){for(var i,r,o=t.length/2,a="x"===n?0:1,s=0,l=-1,u=0;u=e||i>=e&&r<=e){l=u;break}s=u,i=r}else i=r;return{range:[s,l],t:(e-i)/(r-i)}}(u,m,b),S=w.range,M=S[1]-S[0],I=void 0;if(M>=1){if(M>1&&!c){var T=_S(u,S[0]);s.attr({x:T[0]+x,y:T[1]+_}),r&&(I=h.getRawValue(S[0]))}else{(T=l.getPointOn(m,b))&&s.attr({x:T[0]+x,y:T[1]+_});var C=h.getRawValue(S[0]),D=h.getRawValue(S[1]);r&&(I=zo(n,p,C,D,w.t))}i.lastFrameIndex=S[0]}else{var A=1===t||i.lastFrameIndex>0?S[0]:0;T=_S(u,A);r&&(I=h.getRawValue(A)),s.attr({x:T[0]+x,y:T[1]+_})}r&&rc(s).setLabelText(I)}},e.prototype._doUpdateAnimation=function(t,e,n,i,r,o,a){var s=this._polyline,l=this._polygon,u=t.hostModel,h=function(t,e,n,i,r,o,a,s){for(var l=function(t,e){var n=[];return e.diff(t).add((function(t){n.push({cmd:"+",idx:t})})).update((function(t,e){n.push({cmd:"=",idx:e,idx1:t})})).remove((function(t){n.push({cmd:"-",idx:t})})).execute(),n}(t,e),u=[],h=[],c=[],p=[],d=[],f=[],g=[],y=Qw(r,e,a),v=t.getLayout("points")||[],m=e.getLayout("points")||[],x=0;x3e3||l&&gS(p,f)>3e3)return s.stopAnimation(),s.setShape({points:d}),void(l&&(l.stopAnimation(),l.setShape({points:d,stackedOnPoints:f})));s.shape.__points=h.current,s.shape.points=c;var g={shape:{points:d}};h.current!==c&&(g.shape.__points=h.next),s.stopAnimation(),uh(s,g,u),l&&(l.setShape({points:c,stackedOnPoints:p}),l.stopAnimation(),uh(l,{shape:{stackedOnPoints:f}},u),s.shape.points!==l.shape.points&&(l.shape.points=s.shape.points));for(var y=[],v=h.status,m=0;me&&(e=t[n]);return isFinite(e)?e:NaN},min:function(t){for(var e=1/0,n=0;n10&&"cartesian2d"===o.type&&r){var s=o.getBaseAxis(),l=o.getOtherAxis(s),u=s.getExtent(),h=n.getDevicePixelRatio(),c=Math.abs(u[1]-u[0])*(h||1),p=Math.round(a/c);if(isFinite(p)&&p>1){"lttb"===r&&t.setData(i.lttbDownSample(i.mapDimension(l.dim),1/p));var d=void 0;X(r)?d=IS[r]:U(r)&&(d=r),d&&t.setData(i.downSample(i.mapDimension(l.dim),1/p,d,TS))}}}}}var DS=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.getInitialData=function(t,e){return sx(null,this,{useEncodeDefaulter:!0})},e.prototype.getMarkerPosition=function(t){var e=this.coordinateSystem;if(e&&e.clampData){var n=e.dataToPoint(e.clampData(t)),i=this.getData(),r=i.getLayout("offset"),o=i.getLayout("size");return n[e.getBaseAxis().isHorizontal()?0:1]+=r+o/2,n}return[NaN,NaN]},e.type="series.__base_bar__",e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod"},e}(hg);hg.registerClass(DS);var AS=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.getInitialData=function(){return sx(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},e.prototype.getProgressive=function(){return!!this.get("large")&&this.get("progressive")},e.prototype.getProgressiveThreshold=function(){var t=this.get("progressiveThreshold"),e=this.get("largeThreshold");return e>t&&(t=e),t},e.prototype.brushSelector=function(t,e,n){return n.rect(e.getItemLayout(t))},e.type="series.bar",e.dependencies=["grid","polar"],e.defaultOption=wc(DS.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:"#212121"}},realtimeSort:!1}),e}(DS),kS=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},LS=function(t){function e(e){var n=t.call(this,e)||this;return n.type="sausage",n}return n(e,t),e.prototype.getDefaultShape=function(){return new kS},e.prototype.buildPath=function(t,e){var n=e.cx,i=e.cy,r=Math.max(e.r0||0,0),o=Math.max(e.r,0),a=.5*(o-r),s=r+a,l=e.startAngle,u=e.endAngle,h=e.clockwise,c=2*Math.PI,p=h?u-lo)return!0;o=u}return!1},e.prototype._isOrderDifferentInView=function(t,e){for(var n=e.scale,i=n.getExtent(),r=Math.max(0,i[0]),o=Math.min(i[1],n.getOrdinalMeta().categories.length-1);r<=o;++r)if(t.ordinalNumbers[r]!==n.getRawOrdinalNumber(r))return!0},e.prototype._updateSortWithinSameData=function(t,e,n,i){if(this._isOrderChangedWithinSameData(t,e,n)){var r=this._dataSort(t,n,e);this._isOrderDifferentInView(r,n)&&(this._removeOnRenderedListener(i),i.dispatchAction({type:"changeAxisOrder",componentType:n.dim+"Axis",axisId:n.index,sortInfo:r}))}},e.prototype._dispatchInitSort=function(t,e,n){var i=e.baseAxis,r=this._dataSort(t,i,(function(n){return t.get(t.mapDimension(e.otherAxis.dim),n)}));n.dispatchAction({type:"changeAxisOrder",componentType:i.dim+"Axis",isInitSort:!0,axisId:i.index,sortInfo:r})},e.prototype.remove=function(t,e){this._clear(this._model),this._removeOnRenderedListener(e)},e.prototype.dispose=function(t,e){this._removeOnRenderedListener(e)},e.prototype._removeOnRenderedListener=function(t){this._onRendered&&(t.getZr().off("rendered",this._onRendered),this._onRendered=null)},e.prototype._clear=function(t){var e=this.group,n=this._data;t&&t.isAnimationEnabled()&&n&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],n.eachItemGraphicEl((function(e){fh(e,t,js(e).dataIndex)}))):e.removeAll(),this._data=null,this._isFirstFrame=!0},e.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},e.type="bar",e}(wg),zS={cartesian2d:function(t,e){var n=e.width<0?-1:1,i=e.height<0?-1:1;n<0&&(e.x+=e.width,e.width=-e.width),i<0&&(e.y+=e.height,e.height=-e.height);var r=t.x+t.width,o=t.y+t.height,a=RS(e.x,t.x),s=NS(e.x+e.width,r),l=RS(e.y,t.y),u=NS(e.y+e.height,o),h=sr?s:a,e.y=c&&l>o?u:l,e.width=h?0:s-a,e.height=c?0:u-l,n<0&&(e.x+=e.width,e.width=-e.width),i<0&&(e.y+=e.height,e.height=-e.height),h||c},polar:function(t,e){var n=e.r0<=e.r?1:-1;if(n<0){var i=e.r;e.r=e.r0,e.r0=i}var r=NS(e.r,t.r),o=RS(e.r0,t.r0);e.r=r,e.r0=o;var a=r-o<0;if(n<0){i=e.r;e.r=e.r0,e.r0=i}return a}},VS={cartesian2d:function(t,e,n,i,r,o,a,s,l){var u=new Ps({shape:A({},i),z2:1});(u.__dataIndex=n,u.name="item",o)&&(u.shape[r?"height":"width"]=0);return u},polar:function(t,e,n,i,r,o,a,s,l){var u=!r&&l?LS:Pu,h=new u({shape:i,z2:1});h.name="item";var c,p,d=US(r);if(h.calculateTextPosition=(c=d,p=({isRoundCap:u===LS}||{}).isRoundCap,function(t,e,n){var i=e.position;if(!i||i instanceof Array)return br(t,e,n);var r=c(i),o=null!=e.distance?e.distance:5,a=this.shape,s=a.cx,l=a.cy,u=a.r,h=a.r0,d=(u+h)/2,f=a.startAngle,g=a.endAngle,y=(f+g)/2,v=p?Math.abs(u-h)/2:0,m=Math.cos,x=Math.sin,_=s+u*m(f),b=l+u*x(f),w="left",S="top";switch(r){case"startArc":_=s+(h-o)*m(y),b=l+(h-o)*x(y),w="center",S="top";break;case"insideStartArc":_=s+(h+o)*m(y),b=l+(h+o)*x(y),w="center",S="bottom";break;case"startAngle":_=s+d*m(f)+PS(f,o+v,!1),b=l+d*x(f)+OS(f,o+v,!1),w="right",S="middle";break;case"insideStartAngle":_=s+d*m(f)+PS(f,-o+v,!1),b=l+d*x(f)+OS(f,-o+v,!1),w="left",S="middle";break;case"middle":_=s+d*m(y),b=l+d*x(y),w="center",S="middle";break;case"endArc":_=s+(u+o)*m(y),b=l+(u+o)*x(y),w="center",S="bottom";break;case"insideEndArc":_=s+(u-o)*m(y),b=l+(u-o)*x(y),w="center",S="top";break;case"endAngle":_=s+d*m(g)+PS(g,o+v,!0),b=l+d*x(g)+OS(g,o+v,!0),w="left",S="middle";break;case"insideEndAngle":_=s+d*m(g)+PS(g,-o+v,!0),b=l+d*x(g)+OS(g,-o+v,!0),w="right",S="middle";break;default:return br(t,e,n)}return(t=t||{}).x=_,t.y=b,t.align=w,t.verticalAlign=S,t}),o){var f=r?"r":"endAngle",g={};h.shape[f]=r?0:i.startAngle,g[f]=i[f],(s?uh:hh)(h,{shape:g},o)}return h}};function BS(t,e,n,i,r,o,a,s){var l,u;o?(u={x:i.x,width:i.width},l={y:i.y,height:i.height}):(u={y:i.y,height:i.height},l={x:i.x,width:i.width}),s||(a?uh:hh)(n,{shape:l},e,r,null),(a?uh:hh)(n,{shape:u},e?t.baseAxis.model:null,r)}function FS(t,e){for(var n=0;n0?1:-1,a=i.height>0?1:-1;return{x:i.x+o*r/2,y:i.y+a*r/2,width:i.width-o*r,height:i.height-a*r}},polar:function(t,e,n){var i=t.getItemLayout(e);return{cx:i.cx,cy:i.cy,r0:i.r0,r:i.r,startAngle:i.startAngle,endAngle:i.endAngle,clockwise:i.clockwise}}};function US(t){return function(t){var e=t?"Arc":"Angle";return function(t){switch(t){case"start":case"insideStart":case"end":case"insideEnd":return t+e;default:return t}}}(t)}function XS(t,e,n,i,r,o,a,s){var l=e.getItemVisual(n,"style");s||t.setShape("r",i.get(["itemStyle","borderRadius"])||0),t.useStyle(l);var u=i.getShallow("cursor");u&&t.attr("cursor",u);var h=s?a?r.r>=r.r0?"endArc":"startArc":r.endAngle>=r.startAngle?"endAngle":"startAngle":a?r.height>=0?"bottom":"top":r.width>=0?"right":"left",c=Kh(i);qh(t,c,{labelFetcher:o,labelDataIndex:n,defaultText:Uw(o.getData(),n),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:h});var p=t.getTextContent();if(s&&p){var d=i.get(["label","position"]);t.textConfig.inside="middle"===d||null,function(t,e,n,i){if(j(i))t.setTextConfig({rotation:i});else if(Y(e))t.setTextConfig({rotation:0});else{var r,o=t.shape,a=o.clockwise?o.startAngle:o.endAngle,s=o.clockwise?o.endAngle:o.startAngle,l=(a+s)/2,u=n(e);switch(u){case"startArc":case"insideStartArc":case"middle":case"insideEndArc":case"endArc":r=l;break;case"startAngle":case"insideStartAngle":r=a;break;case"endAngle":case"insideEndAngle":r=s;break;default:return void t.setTextConfig({rotation:0})}var h=1.5*Math.PI-r;"middle"===u&&h>Math.PI/2&&h<1.5*Math.PI&&(h-=Math.PI),t.setTextConfig({rotation:h})}}(t,"outside"===d?h:d,US(a),i.get(["label","rotate"]))}oc(p,c,o.getRawValue(n),(function(t){return Xw(e,t)}));var f=i.getModel(["emphasis"]);Bl(t,f.get("focus"),f.get("blurScope"),f.get("disabled")),Hl(t,i),function(t){return null!=t.startAngle&&null!=t.endAngle&&t.startAngle===t.endAngle}(r)&&(t.style.fill="none",t.style.stroke="none",E(t.states,(function(t){t.style&&(t.style.fill=t.style.stroke="none")})))}var ZS=function(){},jS=function(t){function e(e){var n=t.call(this,e)||this;return n.type="largeBar",n}return n(e,t),e.prototype.getDefaultShape=function(){return new ZS},e.prototype.buildPath=function(t,e){for(var n=e.points,i=this.baseDimIdx,r=1-this.baseDimIdx,o=[],a=[],s=this.barWidth,l=0;l=s[0]&&e<=s[0]+l[0]&&n>=s[1]&&n<=s[1]+l[1])return a[h]}return-1}(this,t.offsetX,t.offsetY);js(this).dataIndex=e>=0?e:null}),30,!1);function $S(t,e,n){if(pS(n,"cartesian2d")){var i=e,r=n.getArea();return{x:t?i.x:r.x,y:t?r.y:i.y,width:t?i.width:r.width,height:t?r.height:i.height}}var o=e;return{cx:(r=n.getArea()).cx,cy:r.cy,r0:t?r.r0:o.r0,r:t?r.r:o.r,startAngle:t?o.startAngle:0,endAngle:t?o.endAngle:2*Math.PI}}var JS=2*Math.PI,QS=Math.PI/180;function tM(t,e){return wp(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function eM(t,e){var n=tM(t,e),i=t.get("center"),r=t.get("radius");Y(r)||(r=[0,r]),Y(i)||(i=[i,i]);var o,a,s=Gr(n.width,e.getWidth()),l=Gr(n.height,e.getHeight()),u=Math.min(s,l),h=Gr(r[0],u/2),c=Gr(r[1],u/2),p=t.coordinateSystem;if(p){var d=p.dataToPoint(i);o=d[0]||0,a=d[1]||0}else o=Gr(i[0],s)+n.x,a=Gr(i[1],l)+n.y;return{cx:o,cy:a,r0:h,r:c}}function nM(t,e,n){e.eachSeriesByType(t,(function(t){var e=t.getData(),i=e.mapDimension("value"),r=tM(t,n),o=eM(t,n),a=o.cx,s=o.cy,l=o.r,u=o.r0,h=-t.get("startAngle")*QS,c=t.get("minAngle")*QS,p=0;e.each(i,(function(t){!isNaN(t)&&p++}));var d=e.getSum(i),f=Math.PI/(d||p)*2,g=t.get("clockwise"),y=t.get("roseType"),v=t.get("stillShowZeroSum"),m=e.getDataExtent(i);m[0]=0;var x=JS,_=0,b=h,w=g?1:-1;if(e.setLayout({viewRect:r,r:l}),e.each(i,(function(t,n){var i;if(isNaN(t))e.setItemLayout(n,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:g,cx:a,cy:s,r0:u,r:y?NaN:l});else{(i="area"!==y?0===d&&v?f:t*f:JS/p)n?a:o,h=Math.abs(l.label.y-n);if(h>=u.maxY){var c=l.label.x-e-l.len2*r,p=i+l.len,f=Math.abs(c)t.unconstrainedWidth?null:d:null;i.setStyle("width",f)}var g=i.getBoundingRect();o.width=g.width;var y=(i.style.margin||0)+2.1;o.height=g.height+y,o.y-=(o.height-c)/2}}}function sM(t){return"center"===t.position}function lM(t){var e,n,i=t.getData(),r=[],o=!1,a=(t.get("minShowLabelAngle")||0)*rM,s=i.getLayout("viewRect"),l=i.getLayout("r"),u=s.width,h=s.x,c=s.y,p=s.height;function d(t){t.ignore=!0}i.each((function(t){var s=i.getItemGraphicEl(t),c=s.shape,p=s.getTextContent(),f=s.getTextGuideLine(),g=i.getItemModel(t),y=g.getModel("label"),v=y.get("position")||g.get(["emphasis","label","position"]),m=y.get("distanceToLabelLine"),x=y.get("alignTo"),_=Gr(y.get("edgeDistance"),u),b=y.get("bleedMargin"),w=g.getModel("labelLine"),S=w.get("length");S=Gr(S,u);var M=w.get("length2");if(M=Gr(M,u),Math.abs(c.endAngle-c.startAngle)0?"right":"left":k>0?"left":"right"}var B=Math.PI,F=0,G=y.get("rotate");if(j(G))F=G*(B/180);else if("center"===v)F=0;else if("radial"===G||!0===G){F=k<0?-A+B:-A}else if("tangential"===G&&"outside"!==v&&"outer"!==v){var W=Math.atan2(k,L);W<0&&(W=2*B+W),L>0&&(W=B+W),F=W-B}if(o=!!F,p.x=I,p.y=T,p.rotation=F,p.setStyle({verticalAlign:"middle"}),P){p.setStyle({align:D});var H=p.states.select;H&&(H.x+=p.x,H.y+=p.y)}else{var Y=p.getBoundingRect().clone();Y.applyTransform(p.getComputedTransform());var U=(p.style.margin||0)+2.1;Y.y-=U/2,Y.height+=U,r.push({label:p,labelLine:f,position:v,len:S,len2:M,minTurnAngle:w.get("minTurnAngle"),maxSurfaceAngle:w.get("maxSurfaceAngle"),surfaceNormal:new Ie(k,L),linePoints:C,textAlign:D,labelDistance:m,labelAlignTo:x,edgeDistance:_,bleedMargin:b,rect:Y,unconstrainedWidth:Y.width,labelStyleWidth:p.style.width})}s.setTextConfig({inside:P})}})),!o&&t.get("avoidLabelOverlap")&&function(t,e,n,i,r,o,a,s){for(var l=[],u=[],h=Number.MAX_VALUE,c=-Number.MAX_VALUE,p=0;p0){for(var l=o.getItemLayout(0),u=1;isNaN(l&&l.startAngle)&&u=n.r0}},e.type="pie",e}(wg);function pM(t,e,n){e=Y(e)&&{coordDimensions:e}||A({encodeDefine:t.getEncode()},e);var i=t.getSource(),r=Qm(i,e).dimensions,o=new Jm(r,t);return o.initData(i,n),o}var dM=function(){function t(t,e){this._getDataWithEncodedVisual=t,this._getRawData=e}return t.prototype.getAllNames=function(){var t=this._getRawData();return t.mapArray(t.getName)},t.prototype.containName=function(t){return this._getRawData().indexOfName(t)>=0},t.prototype.indexOfName=function(t){return this._getDataWithEncodedVisual().indexOfName(t)},t.prototype.getItemVisual=function(t,e){return this._getDataWithEncodedVisual().getItemVisual(t,e)},t}(),fM=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.init=function(e){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new dM(W(this.getData,this),W(this.getRawData,this)),this._defaultLabelLine(e)},e.prototype.mergeOption=function(){t.prototype.mergeOption.apply(this,arguments)},e.prototype.getInitialData=function(){var t=pM(this,{coordDimensions:["value"],encodeDefaulter:H(Zp,this)}),e=[];return t.each(t.mapDimension("value"),(function(t){e.push(t)})),this.seats=Zr(e,t.hostModel.get("percentPrecision")),t},e.prototype.getDataParams=function(e){var n=t.prototype.getDataParams.call(this,e);return n.percent=this.seats[e],n.$vars.push("percent"),n},e.prototype._defaultLabelLine=function(t){vo(t,"labelLine",["show"]);var e=t.labelLine,n=t.emphasis.labelLine;e.show=e.show&&t.label.show,n.show=n.show&&t.emphasis.label.show},e.type="series.pie",e.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},e}(hg);var gM=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.hasSymbolVisual=!0,n}return n(e,t),e.prototype.getInitialData=function(t,e){return sx(null,this,{useEncodeDefaulter:!0})},e.prototype.getProgressive=function(){var t=this.option.progressive;return null==t?this.option.large?5e3:this.get("progressive"):t},e.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?1e4:this.get("progressiveThreshold"):t},e.prototype.brushSelector=function(t,e,n){return n.point(e.getItemLayout(t))},e.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:""},e.type="series.scatter",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:"#212121"}},universalTransition:{divideShape:"clone"}},e}(hg),yM=function(){},vM=function(t){function e(e){var n=t.call(this,e)||this;return n._off=0,n.hoverDataIdx=-1,n}return n(e,t),e.prototype.getDefaultShape=function(){return new yM},e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.buildPath=function(t,e){var n,i=e.points,r=e.size,o=this.symbolProxy,a=o.shape,s=t.getContext?t.getContext():t,l=s&&r[0]<4,u=this.softClipShape;if(l)this._ctx=s;else{for(this._ctx=null,n=this._off;n=0;s--){var l=2*s,u=i[l]-o/2,h=i[l+1]-a/2;if(t>=u&&e>=h&&t<=u+o&&e<=h+a)return s}return-1},e.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e),i=this.getBoundingRect();return t=n[0],e=n[1],i.contain(t,e)?(this.hoverDataIdx=this.findDataIndex(t,e))>=0:(this.hoverDataIdx=-1,!1)},e.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var e=this.shape,n=e.points,i=e.size,r=i[0],o=i[1],a=1/0,s=1/0,l=-1/0,u=-1/0,h=0;h=0&&(l.dataIndex=n+(t.startIndex||0))}))},t.prototype.remove=function(){this._clear()},t.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},t}(),xM=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.render=function(t,e,n){var i=t.getData();this._updateSymbolDraw(i,t).updateData(i,{clipShape:this._getClipShape(t)}),this._finished=!0},e.prototype.incrementalPrepareRender=function(t,e,n){var i=t.getData();this._updateSymbolDraw(i,t).incrementalPrepareUpdate(i),this._finished=!1},e.prototype.incrementalRender=function(t,e,n){this._symbolDraw.incrementalUpdate(t,e.getData(),{clipShape:this._getClipShape(e)}),this._finished=t.end===e.getData().count()},e.prototype.updateTransform=function(t,e,n){var i=t.getData();if(this.group.dirty(),!this._finished||i.count()>1e4)return{update:!0};var r=MS("").reset(t,e,n);r.progress&&r.progress({start:0,end:i.count(),count:i.count()},i),this._symbolDraw.updateLayout(i)},e.prototype.eachRendered=function(t){this._symbolDraw&&this._symbolDraw.eachRendered(t)},e.prototype._getClipShape=function(t){var e=t.coordinateSystem,n=e&&e.getArea&&e.getArea();return t.get("clip",!0)?n:null},e.prototype._updateSymbolDraw=function(t,e){var n=this._symbolDraw,i=e.pipelineContext.large;return n&&i===this._isLargeDraw||(n&&n.remove(),n=this._symbolDraw=i?new mM:new Jw,this._isLargeDraw=i,this.group.removeAll()),this.group.add(n.group),n},e.prototype.remove=function(t,e){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},e.prototype.dispose=function(){},e.type="scatter",e}(wg),_M=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.type="grid",e.dependencies=["xAxis","yAxis"],e.layoutMode="box",e.defaultOption={show:!1,z:0,left:"10%",top:60,right:"10%",bottom:70,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},e}(Ap),bM=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",Po).models[0]},e.type="cartesian2dAxis",e}(Ap);R(bM,g_);var wM={show:!0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#6E7079",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,lineStyle:{color:["#E0E6F1"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},SM=C({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},wM),MM=C({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#F4F7FD",width:1}}},wM),IM={category:SM,value:MM,time:C({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},MM),log:k({logBase:10},MM)},TM={value:1,category:1,time:1,log:1};function CM(t,e,i,r){E(TM,(function(o,a){var s=C(C({},IM[a],!0),r,!0),l=function(t){function i(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e+"Axis."+a,n}return n(i,t),i.prototype.mergeDefaultAndTheme=function(t,e){var n=Mp(this),i=n?Tp(t):{};C(t,e.getTheme().get(a+"Axis")),C(t,this.getDefaultOption()),t.type=DM(t),n&&Ip(t,i,n)},i.prototype.optionUpdated=function(){"category"===this.option.type&&(this.__ordinalMeta=hx.createByAxisModel(this))},i.prototype.getCategories=function(t){var e=this.option;if("category"===e.type)return t?e.data:this.__ordinalMeta.categories},i.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},i.type=e+"Axis."+a,i.defaultOption=s,i}(i);t.registerComponentModel(l)})),t.registerSubTypeDefaulter(e+"Axis",DM)}function DM(t){return t.type||(t.data?"category":"value")}var AM=function(){function t(t){this.type="cartesian",this._dimList=[],this._axes={},this.name=t||""}return t.prototype.getAxis=function(t){return this._axes[t]},t.prototype.getAxes=function(){return z(this._dimList,(function(t){return this._axes[t]}),this)},t.prototype.getAxesByScale=function(t){return t=t.toLowerCase(),B(this.getAxes(),(function(e){return e.scale.type===t}))},t.prototype.addAxis=function(t){var e=t.dim;this._axes[e]=t,this._dimList.push(e)},t}(),kM=["x","y"];function LM(t){return"interval"===t.type||"time"===t.type}var PM=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="cartesian2d",e.dimensions=kM,e}return n(e,t),e.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var t=this.getAxis("x").scale,e=this.getAxis("y").scale;if(LM(t)&&LM(e)){var n=t.getExtent(),i=e.getExtent(),r=this.dataToPoint([n[0],i[0]]),o=this.dataToPoint([n[1],i[1]]),a=n[1]-n[0],s=i[1]-i[0];if(a&&s){var l=(o[0]-r[0])/a,u=(o[1]-r[1])/s,h=r[0]-n[0]*l,c=r[1]-i[0]*u,p=this._transform=[l,0,0,u,h,c];this._invTransform=we([],p)}}},e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},e.prototype.containPoint=function(t){var e=this.getAxis("x"),n=this.getAxis("y");return e.contain(e.toLocalCoord(t[0]))&&n.contain(n.toLocalCoord(t[1]))},e.prototype.containData=function(t){return this.getAxis("x").containData(t[0])&&this.getAxis("y").containData(t[1])},e.prototype.containZone=function(t,e){var n=this.dataToPoint(t),i=this.dataToPoint(e),r=this.getArea(),o=new Re(n[0],n[1],i[0]-n[0],i[1]-n[1]);return r.intersect(o)},e.prototype.dataToPoint=function(t,e,n){n=n||[];var i=t[0],r=t[1];if(this._transform&&null!=i&&isFinite(i)&&null!=r&&isFinite(r))return Ft(n,t,this._transform);var o=this.getAxis("x"),a=this.getAxis("y");return n[0]=o.toGlobalCoord(o.dataToCoord(i,e)),n[1]=a.toGlobalCoord(a.dataToCoord(r,e)),n},e.prototype.clampData=function(t,e){var n=this.getAxis("x").scale,i=this.getAxis("y").scale,r=n.getExtent(),o=i.getExtent(),a=n.parse(t[0]),s=i.parse(t[1]);return(e=e||[])[0]=Math.min(Math.max(Math.min(r[0],r[1]),a),Math.max(r[0],r[1])),e[1]=Math.min(Math.max(Math.min(o[0],o[1]),s),Math.max(o[0],o[1])),e},e.prototype.pointToData=function(t,e){var n=[];if(this._invTransform)return Ft(n,t,this._invTransform);var i=this.getAxis("x"),r=this.getAxis("y");return n[0]=i.coordToData(i.toLocalCoord(t[0]),e),n[1]=r.coordToData(r.toLocalCoord(t[1]),e),n},e.prototype.getOtherAxis=function(t){return this.getAxis("x"===t.dim?"y":"x")},e.prototype.getArea=function(){var t=this.getAxis("x").getGlobalExtent(),e=this.getAxis("y").getGlobalExtent(),n=Math.min(t[0],t[1]),i=Math.min(e[0],e[1]),r=Math.max(t[0],t[1])-n,o=Math.max(e[0],e[1])-i;return new Re(n,i,r,o)},e}(AM),OM=function(t){function e(e,n,i,r,o){var a=t.call(this,e,n,i)||this;return a.index=0,a.type=r||"value",a.position=o||"bottom",a}return n(e,t),e.prototype.isHorizontal=function(){var t=this.position;return"top"===t||"bottom"===t},e.prototype.getGlobalExtent=function(t){var e=this.getExtent();return e[0]=this.toGlobalCoord(e[0]),e[1]=this.toGlobalCoord(e[1]),t&&e[0]>e[1]&&e.reverse(),e},e.prototype.pointToData=function(t,e){return this.coordToData(this.toLocalCoord(t["x"===this.dim?0:1]),e)},e.prototype.setCategorySortInfo=function(t){if("category"!==this.type)return!1;this.model.option.categorySortInfo=t,this.scale.setSortInfo(t)},e}(X_);function RM(t,e,n){n=n||{};var i=t.coordinateSystem,r=e.axis,o={},a=r.getAxesOnZeroOf()[0],s=r.position,l=a?"onZero":s,u=r.dim,h=i.getRect(),c=[h.x,h.x+h.width,h.y,h.y+h.height],p={left:0,right:1,top:0,bottom:1,onZero:2},d=e.get("offset")||0,f="x"===u?[c[2]-d,c[3]+d]:[c[0]-d,c[1]+d];if(a){var g=a.toGlobalCoord(a.dataToCoord(0));f[p.onZero]=Math.max(Math.min(g,f[1]),f[0])}o.position=["y"===u?f[p[l]]:c[0],"x"===u?f[p[l]]:c[3]],o.rotation=Math.PI/2*("x"===u?0:1);o.labelDirection=o.tickDirection=o.nameDirection={top:-1,bottom:1,left:-1,right:1}[s],o.labelOffset=a?f[p[s]]-f[p.onZero]:0,e.get(["axisTick","inside"])&&(o.tickDirection=-o.tickDirection),it(n.labelInside,e.get(["axisLabel","inside"]))&&(o.labelDirection=-o.labelDirection);var y=e.get(["axisLabel","rotate"]);return o.labelRotate="top"===l?-y:y,o.z2=1,o}function NM(t){return"cartesian2d"===t.get("coordinateSystem")}function EM(t){var e={xAxisModel:null,yAxisModel:null};return E(e,(function(n,i){var r=i.replace(/Model$/,""),o=t.getReferringComponents(r,Po).models[0];e[i]=o})),e}var zM=Math.log;function VM(t,e,n){var i=Sx.prototype,r=i.getTicks.call(n),o=i.getTicks.call(n,!0),a=r.length-1,s=i.getInterval.call(n),l=a_(t,e),u=l.extent,h=l.fixMin,c=l.fixMax;if("log"===t.type){var p=zM(t.base);u=[zM(u[0])/p,zM(u[1])/p]}t.setExtent(u[0],u[1]),t.calcNiceExtent({splitNumber:a,fixMin:h,fixMax:c});var d=i.getExtent.call(t);h&&(u[0]=d[0]),c&&(u[1]=d[1]);var f=i.getInterval.call(t),g=u[0],y=u[1];if(h&&c)f=(y-g)/a;else if(h)for(y=u[0]+f*a;yu[0]&&isFinite(g)&&isFinite(u[0]);)f=fx(f),g=u[1]-f*a;else{t.getTicks().length-1>a&&(f=fx(f));var v=f*a;(g=Wr((y=Math.ceil(u[1]/f)*f)-v))<0&&u[0]>=0?(g=0,y=Wr(v)):y>0&&u[1]<=0&&(y=0,g=-Wr(v))}var m=(r[0].value-o[0].value)/s,x=(r[a].value-o[a].value)/s;i.setExtent.call(t,g+f*m,y+f*x),i.setInterval.call(t,f),(m||x)&&i.setNiceExtent.call(t,g+f,y-f)}var BM=function(){function t(t,e,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=kM,this._initCartesian(t,e,n),this.model=t}return t.prototype.getRect=function(){return this._rect},t.prototype.update=function(t,e){var n=this._axesMap;function i(t){var e,n=G(t),i=n.length;if(i){for(var r=[],o=i-1;o>=0;o--){var a=t[+n[o]],s=a.model,l=a.scale;px(l)&&s.get("alignTicks")&&null==s.get("interval")?r.push(a):(s_(l,s),px(l)&&(e=a))}r.length&&(e||s_((e=r.pop()).scale,e.model),E(r,(function(t){VM(t.scale,t.model,e.scale)})))}}this._updateScale(t,this.model),i(n.x),i(n.y);var r={};E(n.x,(function(t){GM(n,"y",t,r)})),E(n.y,(function(t){GM(n,"x",t,r)})),this.resize(this.model,e)},t.prototype.resize=function(t,e,n){var i=t.getBoxLayoutParams(),r=!n&&t.get("containLabel"),o=wp(i,{width:e.getWidth(),height:e.getHeight()});this._rect=o;var a=this._axesList;function s(){E(a,(function(t){var e=t.isHorizontal(),n=e?[0,o.width]:[0,o.height],i=t.inverse?1:0;t.setExtent(n[i],n[1-i]),function(t,e){var n=t.getExtent(),i=n[0]+n[1];t.toGlobalCoord="x"===t.dim?function(t){return t+e}:function(t){return i-t+e},t.toLocalCoord="x"===t.dim?function(t){return t-e}:function(t){return i-t+e}}(t,e?o.x:o.y)}))}s(),r&&(E(a,(function(t){if(!t.model.get(["axisLabel","inside"])){var e=function(t){var e=t.model,n=t.scale;if(e.get(["axisLabel","show"])&&!n.isBlank()){var i,r,o=n.getExtent();r=n instanceof _x?n.count():(i=n.getTicks()).length;var a,s=t.getLabelModel(),l=u_(t),u=1;r>40&&(u=Math.ceil(r/40));for(var h=0;h0&&i>0||n<0&&i<0)}(t)}var HM=Math.PI,YM=function(){function t(t,e){this.group=new Pr,this.opt=e,this.axisModel=t,k(e,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:!0,handleAutoShown:function(){return!0}});var n=new Pr({x:e.position[0],y:e.position[1],rotation:e.rotation});n.updateTransform(),this._transformGroup=n}return t.prototype.hasBuilder=function(t){return!!UM[t]},t.prototype.add=function(t){UM[t](this.opt,this.axisModel,this.group,this._transformGroup)},t.prototype.getGroup=function(){return this.group},t.innerTextLayout=function(t,e,n){var i,r,o=Kr(e-t);return $r(o)?(r=n>0?"top":"bottom",i="center"):$r(o-HM)?(r=n>0?"bottom":"top",i="center"):(r="middle",i=o>0&&o0?"right":"left":n>0?"left":"right"),{rotation:o,textAlign:i,textVerticalAlign:r}},t.makeAxisEventDataBase=function(t){var e={componentType:t.mainType,componentIndex:t.componentIndex};return e[t.mainType+"Index"]=t.componentIndex,e},t.isLabelSilent=function(t){var e=t.get("tooltip");return t.get("silent")||!(t.get("triggerEvent")||e&&e.show)},t}(),UM={axisLine:function(t,e,n,i){var r=e.get(["axisLine","show"]);if("auto"===r&&t.handleAutoShown&&(r=t.handleAutoShown("axisLine")),r){var o=e.axis.getExtent(),a=i.transform,s=[o[0],0],l=[o[1],0],u=s[0]>l[0];a&&(Ft(s,s,a),Ft(l,l,a));var h=A({lineCap:"round"},e.getModel(["axisLine","lineStyle"]).getLineStyle()),c=new Wu({shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:h,strokeContainThreshold:t.strokeContainThreshold||5,silent:!0,z2:1});Ah(c.shape,c.style.lineWidth),c.anid="line",n.add(c);var p=e.get(["axisLine","symbol"]);if(null!=p){var d=e.get(["axisLine","symbolSize"]);X(p)&&(p=[p,p]),(X(d)||j(d))&&(d=[d,d]);var f=Ey(e.get(["axisLine","symbolOffset"])||0,d),g=d[0],y=d[1];E([{rotate:t.rotation+Math.PI/2,offset:f[0],r:0},{rotate:t.rotation-Math.PI/2,offset:f[1],r:Math.sqrt((s[0]-l[0])*(s[0]-l[0])+(s[1]-l[1])*(s[1]-l[1]))}],(function(e,i){if("none"!==p[i]&&null!=p[i]){var r=Ry(p[i],-g/2,-y/2,g,y,h.stroke,!0),o=e.r+e.offset,a=u?l:s;r.attr({rotation:e.rotate,x:a[0]+o*Math.cos(t.rotation),y:a[1]-o*Math.sin(t.rotation),silent:!0,z2:11}),n.add(r)}}))}}},axisTickLabel:function(t,e,n,i){var r=function(t,e,n,i){var r=n.axis,o=n.getModel("axisTick"),a=o.get("show");"auto"===a&&i.handleAutoShown&&(a=i.handleAutoShown("axisTick"));if(!a||r.scale.isBlank())return;for(var s=o.getModel("lineStyle"),l=i.tickDirection*o.get("length"),u=qM(r.getTicksCoords(),e.transform,l,k(s.getLineStyle(),{stroke:n.get(["axisLine","lineStyle","color"])}),"ticks"),h=0;hc[1]?-1:1,d=["start"===s?c[0]-p*h:"end"===s?c[1]+p*h:(c[0]+c[1])/2,jM(s)?t.labelOffset+l*h:0],f=e.get("nameRotate");null!=f&&(f=f*HM/180),jM(s)?o=YM.innerTextLayout(t.rotation,null!=f?f:t.rotation,l):(o=function(t,e,n,i){var r,o,a=Kr(n-t),s=i[0]>i[1],l="start"===e&&!s||"start"!==e&&s;$r(a-HM/2)?(o=l?"bottom":"top",r="center"):$r(a-1.5*HM)?(o=l?"top":"bottom",r="center"):(o="middle",r=a<1.5*HM&&a>HM/2?l?"left":"right":l?"right":"left");return{rotation:a,textAlign:r,textVerticalAlign:o}}(t.rotation,s,f||0,c),null!=(a=t.axisNameAvailableWidth)&&(a=Math.abs(a/Math.sin(o.rotation)),!isFinite(a)&&(a=null)));var g=u.getFont(),y=e.get("nameTruncate",!0)||{},v=y.ellipsis,m=it(t.nameTruncateMaxWidth,y.maxWidth,a),x=new Ns({x:d[0],y:d[1],rotation:o.rotation,silent:YM.isLabelSilent(e),style:$h(u,{text:r,font:g,overflow:"truncate",width:m,ellipsis:v,fill:u.getTextColor()||e.get(["axisLine","lineStyle","color"]),align:u.get("align")||o.textAlign,verticalAlign:u.get("verticalAlign")||o.textVerticalAlign}),z2:1});if(Wh({el:x,componentModel:e,itemName:r}),x.__fullText=r,x.anid="name",e.get("triggerEvent")){var _=YM.makeAxisEventDataBase(e);_.targetType="axisName",_.name=r,js(x).eventData=_}i.add(x),x.updateTransform(),n.add(x),x.decomposeTransform()}}};function XM(t){t&&(t.ignore=!0)}function ZM(t,e){var n=t&&t.getBoundingRect().clone(),i=e&&e.getBoundingRect().clone();if(n&&i){var r=ye([]);return _e(r,r,-t.rotation),n.applyTransform(me([],r,t.getLocalTransform())),i.applyTransform(me([],r,e.getLocalTransform())),n.intersect(i)}}function jM(t){return"middle"===t||"center"===t}function qM(t,e,n,i,r){for(var o=[],a=[],s=[],l=0;l=0||t===e}function JM(t){var e=QM(t);if(e){var n=e.axisPointerModel,i=e.axis.scale,r=n.option,o=n.get("status"),a=n.get("value");null!=a&&(a=i.parse(a));var s=tI(n);null==o&&(r.status=s?"show":"hide");var l=i.getExtent().slice();l[0]>l[1]&&l.reverse(),(null==a||a>l[1])&&(a=l[1]),a0&&!c.min?c.min=0:null!=c.min&&c.min<0&&!c.max&&(c.max=0);var p=a;null!=c.color&&(p=k({color:c.color},a));var d=C(T(c),{boundaryGap:t,splitNumber:e,scale:n,axisLine:i,axisTick:r,axisLabel:o,name:c.text,showName:s,nameLocation:"end",nameGap:u,nameTextStyle:p,triggerEvent:h},!1);if(X(l)){var f=d.name;d.name=l.replace("{value}",null!=f?f:"")}else U(l)&&(d.name=l(d.name,d));var g=new xc(d,null,this.ecModel);return R(g,g_.prototype),g.mainType="radar",g.componentIndex=this.componentIndex,g}),this);this._indicatorModels=c},e.prototype.getIndicatorModels=function(){return this._indicatorModels},e.type="radar",e.defaultOption={z:0,center:["50%","50%"],radius:"75%",startAngle:90,axisName:{show:!0},boundaryGap:[0,0],splitNumber:5,axisNameGap:15,scale:!1,shape:"polygon",axisLine:C({lineStyle:{color:"#bbb"}},wI.axisLine),axisLabel:SI(wI.axisLabel,!1),axisTick:SI(wI.axisTick,!1),splitLine:SI(wI.splitLine,!0),splitArea:SI(wI.splitArea,!0),indicator:[]},e}(Ap),II=["axisLine","axisTickLabel","axisName"],TI=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.render=function(t,e,n){this.group.removeAll(),this._buildAxes(t),this._buildSplitLineAndArea(t)},e.prototype._buildAxes=function(t){var e=t.coordinateSystem;E(z(e.getIndicatorAxes(),(function(t){var n=t.model.get("showName")?t.name:"";return new YM(t.model,{axisName:n,position:[e.cx,e.cy],rotation:t.angle,labelDirection:-1,tickDirection:-1,nameDirection:1})})),(function(t){E(II,t.add,t),this.group.add(t.getGroup())}),this)},e.prototype._buildSplitLineAndArea=function(t){var e=t.coordinateSystem,n=e.getIndicatorAxes();if(n.length){var i=t.get("shape"),r=t.getModel("splitLine"),o=t.getModel("splitArea"),a=r.getModel("lineStyle"),s=o.getModel("areaStyle"),l=r.get("show"),u=o.get("show"),h=a.get("color"),c=s.get("color"),p=Y(h)?h:[h],d=Y(c)?c:[c],f=[],g=[];if("circle"===i)for(var y=n[0].getTicksCoords(),v=e.cx,m=e.cy,x=0;x3?1.4:r>1?1.2:1.1;RI(this,"zoom","zoomOnMouseWheel",t,{scale:i>0?s:1/s,originX:o,originY:a,isAvailableBehavior:null})}if(n){var l=Math.abs(i);RI(this,"scrollMove","moveOnMouseWheel",t,{scrollDelta:(i>0?1:-1)*(l>3?.4:l>1?.15:.05),originX:o,originY:a,isAvailableBehavior:null})}}},e.prototype._pinchHandler=function(t){LI(this._zr,"globalPan")||RI(this,"zoom",null,t,{scale:t.pinchScale>1?1.1:1/1.1,originX:t.pinchX,originY:t.pinchY,isAvailableBehavior:null})},e}(Xt);function RI(t,e,n,i,r){t.pointerChecker&&t.pointerChecker(i,r.originX,r.originY)&&(he(i.event),NI(t,e,n,i,r))}function NI(t,e,n,i,r){r.isAvailableBehavior=W(EI,null,n,i),t.trigger(e,r)}function EI(t,e,n){var i=n[t];return!t||i&&(!X(i)||e.event[i+"Key"])}function zI(t,e,n){var i=t.target;i.x+=e,i.y+=n,i.dirty()}function VI(t,e,n,i){var r=t.target,o=t.zoomLimit,a=t.zoom=t.zoom||1;if(a*=e,o){var s=o.min||0,l=o.max||1/0;a=Math.max(Math.min(l,a),s)}var u=a/t.zoom;t.zoom=a,r.x-=(n-r.x)*(u-1),r.y-=(i-r.y)*(u-1),r.scaleX*=u,r.scaleY*=u,r.dirty()}var BI,FI={axisPointer:1,tooltip:1,brush:1};function GI(t,e,n){var i=e.getComponentByElement(t.topTarget),r=i&&i.coordinateSystem;return i&&i!==n&&!FI.hasOwnProperty(i.mainType)&&r&&r.model!==n}function WI(t){X(t)&&(t=(new DOMParser).parseFromString(t,"text/xml"));var e=t;for(9===e.nodeType&&(e=e.firstChild);"svg"!==e.nodeName.toLowerCase()||1!==e.nodeType;)e=e.nextSibling;return e}var HI={fill:"fill",stroke:"stroke","stroke-width":"lineWidth",opacity:"opacity","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-miterlimit":"miterLimit","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-weight":"fontWeight","text-anchor":"textAlign",visibility:"visibility",display:"display"},YI=G(HI),UI={"alignment-baseline":"textBaseline","stop-color":"stopColor"},XI=G(UI),ZI=function(){function t(){this._defs={},this._root=null}return t.prototype.parse=function(t,e){e=e||{};var n=WI(t);this._defsUsePending=[];var i=new Pr;this._root=i;var r=[],o=n.getAttribute("viewBox")||"",a=parseFloat(n.getAttribute("width")||e.width),s=parseFloat(n.getAttribute("height")||e.height);isNaN(a)&&(a=null),isNaN(s)&&(s=null),QI(n,i,null,!0,!1);for(var l,u,h=n.firstChild;h;)this._parseNode(h,i,r,null,!1,!1),h=h.nextSibling;if(function(t,e){for(var n=0;n=4&&(l={x:parseFloat(c[0]||0),y:parseFloat(c[1]||0),width:parseFloat(c[2]),height:parseFloat(c[3])})}if(l&&null!=a&&null!=s&&(u=lT(l,{x:0,y:0,width:a,height:s}),!e.ignoreViewBox)){var p=i;(i=new Pr).add(p),p.scaleX=p.scaleY=u.scale,p.x=u.x,p.y=u.y}return e.ignoreRootClip||null==a||null==s||i.setClipPath(new Ps({shape:{x:0,y:0,width:a,height:s}})),{root:i,width:a,height:s,viewBoxRect:l,viewBoxTransform:u,named:r}},t.prototype._parseNode=function(t,e,n,i,r,o){var a,s=t.nodeName.toLowerCase(),l=i;if("defs"===s&&(r=!0),"text"===s&&(o=!0),"defs"===s||"switch"===s)a=e;else{if(!r){var u=BI[s];if(u&&mt(BI,s)){a=u.call(this,t,e);var h=t.getAttribute("name");if(h){var c={name:h,namedFrom:null,svgNodeTagLower:s,el:a};n.push(c),"g"===s&&(l=c)}else i&&n.push({name:i.name,namedFrom:i,svgNodeTagLower:s,el:a});e.add(a)}}var p=jI[s];if(p&&mt(jI,s)){var d=p.call(this,t),f=t.getAttribute("id");f&&(this._defs[f]=d)}}if(a&&a.isGroup)for(var g=t.firstChild;g;)1===g.nodeType?this._parseNode(g,a,n,l,r,o):3===g.nodeType&&o&&this._parseText(g,a),g=g.nextSibling},t.prototype._parseText=function(t,e){var n=new ws({style:{text:t.textContent},silent:!0,x:this._textX||0,y:this._textY||0});$I(e,n),QI(t,n,this._defsUsePending,!1,!1),function(t,e){var n=e.__selfStyle;if(n){var i=n.textBaseline,r=i;i&&"auto"!==i?"baseline"===i?r="alphabetic":"before-edge"===i||"text-before-edge"===i?r="top":"after-edge"===i||"text-after-edge"===i?r="bottom":"central"!==i&&"mathematical"!==i||(r="middle"):r="alphabetic",t.style.textBaseline=r}var o=e.__inheritedStyle;if(o){var a=o.textAlign,s=a;a&&("middle"===a&&(s="center"),t.style.textAlign=s)}}(n,e);var i=n.style,r=i.fontSize;r&&r<9&&(i.fontSize=9,n.scaleX*=r/9,n.scaleY*=r/9);var o=(i.fontSize||i.fontFamily)&&[i.fontStyle,i.fontWeight,(i.fontSize||12)+"px",i.fontFamily||"sans-serif"].join(" ");i.font=o;var a=n.getBoundingRect();return this._textX+=a.width,e.add(n),n},t.internalField=void(BI={g:function(t,e){var n=new Pr;return $I(e,n),QI(t,n,this._defsUsePending,!1,!1),n},rect:function(t,e){var n=new Ps;return $I(e,n),QI(t,n,this._defsUsePending,!1,!1),n.setShape({x:parseFloat(t.getAttribute("x")||"0"),y:parseFloat(t.getAttribute("y")||"0"),width:parseFloat(t.getAttribute("width")||"0"),height:parseFloat(t.getAttribute("height")||"0")}),n.silent=!0,n},circle:function(t,e){var n=new gu;return $I(e,n),QI(t,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(t.getAttribute("cx")||"0"),cy:parseFloat(t.getAttribute("cy")||"0"),r:parseFloat(t.getAttribute("r")||"0")}),n.silent=!0,n},line:function(t,e){var n=new Wu;return $I(e,n),QI(t,n,this._defsUsePending,!1,!1),n.setShape({x1:parseFloat(t.getAttribute("x1")||"0"),y1:parseFloat(t.getAttribute("y1")||"0"),x2:parseFloat(t.getAttribute("x2")||"0"),y2:parseFloat(t.getAttribute("y2")||"0")}),n.silent=!0,n},ellipse:function(t,e){var n=new vu;return $I(e,n),QI(t,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(t.getAttribute("cx")||"0"),cy:parseFloat(t.getAttribute("cy")||"0"),rx:parseFloat(t.getAttribute("rx")||"0"),ry:parseFloat(t.getAttribute("ry")||"0")}),n.silent=!0,n},polygon:function(t,e){var n,i=t.getAttribute("points");i&&(n=JI(i));var r=new zu({shape:{points:n||[]},silent:!0});return $I(e,r),QI(t,r,this._defsUsePending,!1,!1),r},polyline:function(t,e){var n,i=t.getAttribute("points");i&&(n=JI(i));var r=new Bu({shape:{points:n||[]},silent:!0});return $I(e,r),QI(t,r,this._defsUsePending,!1,!1),r},image:function(t,e){var n=new Is;return $I(e,n),QI(t,n,this._defsUsePending,!1,!1),n.setStyle({image:t.getAttribute("xlink:href")||t.getAttribute("href"),x:+t.getAttribute("x"),y:+t.getAttribute("y"),width:+t.getAttribute("width"),height:+t.getAttribute("height")}),n.silent=!0,n},text:function(t,e){var n=t.getAttribute("x")||"0",i=t.getAttribute("y")||"0",r=t.getAttribute("dx")||"0",o=t.getAttribute("dy")||"0";this._textX=parseFloat(n)+parseFloat(r),this._textY=parseFloat(i)+parseFloat(o);var a=new Pr;return $I(e,a),QI(t,a,this._defsUsePending,!1,!0),a},tspan:function(t,e){var n=t.getAttribute("x"),i=t.getAttribute("y");null!=n&&(this._textX=parseFloat(n)),null!=i&&(this._textY=parseFloat(i));var r=t.getAttribute("dx")||"0",o=t.getAttribute("dy")||"0",a=new Pr;return $I(e,a),QI(t,a,this._defsUsePending,!1,!0),this._textX+=parseFloat(r),this._textY+=parseFloat(o),a},path:function(t,e){var n=pu(t.getAttribute("d")||"");return $I(e,n),QI(t,n,this._defsUsePending,!1,!1),n.silent=!0,n}}),t}(),jI={lineargradient:function(t){var e=parseInt(t.getAttribute("x1")||"0",10),n=parseInt(t.getAttribute("y1")||"0",10),i=parseInt(t.getAttribute("x2")||"10",10),r=parseInt(t.getAttribute("y2")||"0",10),o=new $u(e,n,i,r);return qI(t,o),KI(t,o),o},radialgradient:function(t){var e=parseInt(t.getAttribute("cx")||"0",10),n=parseInt(t.getAttribute("cy")||"0",10),i=parseInt(t.getAttribute("r")||"0",10),r=new Ju(e,n,i);return qI(t,r),KI(t,r),r}};function qI(t,e){"userSpaceOnUse"===t.getAttribute("gradientUnits")&&(e.global=!0)}function KI(t,e){for(var n=t.firstChild;n;){if(1===n.nodeType&&"stop"===n.nodeName.toLocaleLowerCase()){var i=n.getAttribute("offset"),r=void 0;r=i&&i.indexOf("%")>0?parseInt(i,10)/100:i?parseFloat(i):0;var o={};sT(n,o,o);var a=o.stopColor||n.getAttribute("stop-color")||"#000000";e.colorStops.push({offset:r,color:a})}n=n.nextSibling}}function $I(t,e){t&&t.__inheritedStyle&&(e.__inheritedStyle||(e.__inheritedStyle={}),k(e.__inheritedStyle,t.__inheritedStyle))}function JI(t){for(var e=iT(t),n=[],i=0;i0;o-=2){var a=i[o],s=i[o-1],l=iT(a);switch(r=r||[1,0,0,1,0,0],s){case"translate":xe(r,r,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":be(r,r,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":_e(r,r,-parseFloat(l[0])*oT);break;case"skewX":me(r,[1,0,Math.tan(parseFloat(l[0])*oT),1,0,0],r);break;case"skewY":me(r,[1,Math.tan(parseFloat(l[0])*oT),0,1,0,0],r);break;case"matrix":r[0]=parseFloat(l[0]),r[1]=parseFloat(l[1]),r[2]=parseFloat(l[2]),r[3]=parseFloat(l[3]),r[4]=parseFloat(l[4]),r[5]=parseFloat(l[5])}}e.setLocalTransform(r)}}(t,e),sT(t,a,s),i||function(t,e,n){for(var i=0;i0,f={api:n,geo:s,mapOrGeoModel:t,data:a,isVisualEncodedByVisualMap:d,isGeo:o,transformInfoRaw:c};"geoJSON"===s.resourceType?this._buildGeoJSON(f):"geoSVG"===s.resourceType&&this._buildSVG(f),this._updateController(t,e,n),this._updateMapSelectHandler(t,l,n,i)},t.prototype._buildGeoJSON=function(t){var e=this._regionsGroupByName=ft(),n=ft(),i=this._regionsGroup,r=t.transformInfoRaw,o=t.mapOrGeoModel,a=t.data,s=t.geo.projection,l=s&&s.stream;function u(t,e){return e&&(t=e(t)),t&&[t[0]*r.scaleX+r.x,t[1]*r.scaleY+r.y]}function h(t){for(var e=[],n=!l&&s&&s.project,i=0;i=0)&&(p=r);var d=a?{normal:{align:"center",verticalAlign:"middle"}}:null;qh(e,Kh(i),{labelFetcher:p,labelDataIndex:c,defaultText:n},d);var f=e.getTextContent();if(f&&(AT(f).ignore=f.ignore,e.textConfig&&a)){var g=e.getBoundingRect().clone();e.textConfig.layoutRect=g,e.textConfig.position=[(a[0]-g.x)/g.width*100+"%",(a[1]-g.y)/g.height*100+"%"]}e.disableLabelAnimation=!0}else e.removeTextContent(),e.removeTextConfig(),e.disableLabelAnimation=null}function NT(t,e,n,i,r,o){t.data?t.data.setItemGraphicEl(o,e):js(e).eventData={componentType:"geo",componentIndex:r.componentIndex,geoIndex:r.componentIndex,name:n,region:i&&i.option||{}}}function ET(t,e,n,i,r){t.data||Wh({el:e,componentModel:r,itemName:n,itemTooltipOption:i.get("tooltip")})}function zT(t,e,n,i,r){e.highDownSilentOnTouch=!!r.get("selectedMode");var o=i.getModel("emphasis"),a=o.get("focus");return Bl(e,a,o.get("blurScope"),o.get("disabled")),t.isGeo&&function(t,e,n){var i=js(t);i.componentMainType=e.mainType,i.componentIndex=e.componentIndex,i.componentHighDownName=n}(e,r,n),a}function VT(t,e,n){var i,r=[];function o(){i=[]}function a(){i.length&&(r.push(i),i=[])}var s=e({polygonStart:o,polygonEnd:a,lineStart:o,lineEnd:a,point:function(t,e){isFinite(t)&&isFinite(e)&&i.push([t,e])},sphere:function(){}});return!n&&s.polygonStart(),E(t,(function(t){s.lineStart();for(var e=0;e-1&&(n.style.stroke=n.style.fill,n.style.fill="#fff",n.style.lineWidth=2),n},e.type="series.map",e.dependencies=["geo"],e.layoutMode="box",e.defaultOption={z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:null,showLegendSymbol:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,selectedMode:!0,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444",areaColor:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{areaColor:"rgba(255,215,0,0.8)"}},select:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},nameProperty:"name"},e}(hg);function GT(t){var e={};t.eachSeriesByType("map",(function(t){var n=t.getHostGeoModel(),i=n?"o"+n.id:"i"+t.getMapType();(e[i]=e[i]||[]).push(t)})),E(e,(function(t,e){for(var n,i,r,o=(n=z(t,(function(t){return t.getData()})),i=t[0].get("mapValueCalculation"),r={},E(n,(function(t){t.each(t.mapDimension("value"),(function(e,n){var i="ec-"+t.getName(n);r[i]=r[i]||[],isNaN(e)||r[i].push(e)}))})),n[0].map(n[0].mapDimension("value"),(function(t,e){for(var o="ec-"+n[0].getName(e),a=0,s=1/0,l=-1/0,u=r[o].length,h=0;h1?(d.width=p,d.height=p/x):(d.height=p,d.width=p*x),d.y=c[1]-d.height/2,d.x=c[0]-d.width/2;else{var b=t.getBoxLayoutParams();b.aspect=x,d=wp(b,{width:v,height:m})}this.setViewRect(d.x,d.y,d.width,d.height),this.setCenter(t.get("center"),e),this.setZoom(t.get("zoom"))}R(jT,YT);var $T=function(){function t(){this.dimensions=ZT}return t.prototype.create=function(t,e){var n=[];function i(t){return{nameProperty:t.get("nameProperty"),aspectScale:t.get("aspectScale"),projection:t.get("projection")}}t.eachComponent("geo",(function(t,r){var o=t.get("map"),a=new jT(o+r,o,A({nameMap:t.get("nameMap")},i(t)));a.zoomLimit=t.get("scaleLimit"),n.push(a),t.coordinateSystem=a,a.model=t,a.resize=KT,a.resize(t,e)})),t.eachSeries((function(t){if("geo"===t.get("coordinateSystem")){var e=t.get("geoIndex")||0;t.coordinateSystem=n[e]}}));var r={};return t.eachSeriesByType("map",(function(t){if(!t.getHostGeoModel()){var e=t.getMapType();r[e]=r[e]||[],r[e].push(t)}})),E(r,(function(t,r){var o=z(t,(function(t){return t.get("nameMap")})),a=new jT(r,r,A({nameMap:D(o)},i(t[0])));a.zoomLimit=it.apply(null,z(t,(function(t){return t.get("scaleLimit")}))),n.push(a),a.resize=KT,a.resize(t[0],e),E(t,(function(t){t.coordinateSystem=a,function(t,e){E(e.get("geoCoord"),(function(e,n){t.addGeoCoord(n,e)}))}(a,t)}))})),n},t.prototype.getFilledRegions=function(t,e,n,i){for(var r=(t||[]).slice(),o=ft(),a=0;a=0;){var o=e[n];o.hierNode.prelim+=i,o.hierNode.modifier+=i,r+=o.hierNode.change,i+=o.hierNode.shift+r}}(t);var o=(n[0].hierNode.prelim+n[n.length-1].hierNode.prelim)/2;r?(t.hierNode.prelim=r.hierNode.prelim+e(t,r),t.hierNode.modifier=t.hierNode.prelim-o):t.hierNode.prelim=o}else r&&(t.hierNode.prelim=r.hierNode.prelim+e(t,r));t.parentNode.hierNode.defaultAncestor=function(t,e,n,i){if(e){for(var r=t,o=t,a=o.parentNode.children[0],s=e,l=r.hierNode.modifier,u=o.hierNode.modifier,h=a.hierNode.modifier,c=s.hierNode.modifier;s=uC(s),o=hC(o),s&&o;){r=uC(r),a=hC(a),r.hierNode.ancestor=t;var p=s.hierNode.prelim+c-o.hierNode.prelim-u+i(s,o);p>0&&(pC(cC(s,t,n),t,p),u+=p,l+=p),c+=s.hierNode.modifier,u+=o.hierNode.modifier,l+=r.hierNode.modifier,h+=a.hierNode.modifier}s&&!uC(r)&&(r.hierNode.thread=s,r.hierNode.modifier+=c-l),o&&!hC(a)&&(a.hierNode.thread=o,a.hierNode.modifier+=u-h,n=t)}return n}(t,r,t.parentNode.hierNode.defaultAncestor||i[0],e)}function aC(t){var e=t.hierNode.prelim+t.parentNode.hierNode.modifier;t.setLayout({x:e},!0),t.hierNode.modifier+=t.parentNode.hierNode.modifier}function sC(t){return arguments.length?t:dC}function lC(t,e){return t-=Math.PI/2,{x:e*Math.cos(t),y:e*Math.sin(t)}}function uC(t){var e=t.children;return e.length&&t.isExpand?e[e.length-1]:t.hierNode.thread}function hC(t){var e=t.children;return e.length&&t.isExpand?e[0]:t.hierNode.thread}function cC(t,e,n){return t.hierNode.ancestor.parentNode===e.parentNode?t.hierNode.ancestor:n}function pC(t,e,n){var i=n/(e.hierNode.i-t.hierNode.i);e.hierNode.change-=i,e.hierNode.shift+=n,e.hierNode.modifier+=n,e.hierNode.prelim+=n,t.hierNode.change+=i}function dC(t,e){return t.parentNode===e.parentNode?1:2}var fC=function(){this.parentPoint=[],this.childPoints=[]},gC=function(t){function e(e){return t.call(this,e)||this}return n(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new fC},e.prototype.buildPath=function(t,e){var n=e.childPoints,i=n.length,r=e.parentPoint,o=n[0],a=n[i-1];if(1===i)return t.moveTo(r[0],r[1]),void t.lineTo(o[0],o[1]);var s=e.orient,l="TB"===s||"BT"===s?0:1,u=1-l,h=Gr(e.forkPosition,1),c=[];c[l]=r[l],c[u]=r[u]+(a[u]-r[u])*h,t.moveTo(r[0],r[1]),t.lineTo(c[0],c[1]),t.moveTo(o[0],o[1]),c[l]=o[l],t.lineTo(c[0],c[1]),c[l]=a[l],t.lineTo(c[0],c[1]),t.lineTo(a[0],a[1]);for(var p=1;pm.x)||(_-=Math.PI);var S=b?"left":"right",M=s.getModel("label"),I=M.get("rotate"),T=I*(Math.PI/180),C=y.getTextContent();C&&(y.setTextConfig({position:M.get("position")||S,rotation:null==I?-_:T,origin:"center"}),C.setStyle("verticalAlign","middle"))}var D=s.get(["emphasis","focus"]),A="relative"===D?gt(a.getAncestorsIndices(),a.getDescendantIndices()):"ancestor"===D?a.getAncestorsIndices():"descendant"===D?a.getDescendantIndices():null;A&&(js(n).focus=A),function(t,e,n,i,r,o,a,s){var l=e.getModel(),u=t.get("edgeShape"),h=t.get("layout"),c=t.getOrient(),p=t.get(["lineStyle","curveness"]),d=t.get("edgeForkPosition"),f=l.getModel("lineStyle").getLineStyle(),g=i.__edge;if("curve"===u)e.parentNode&&e.parentNode!==n&&(g||(g=i.__edge=new Xu({shape:wC(h,c,p,r,r)})),uh(g,{shape:wC(h,c,p,o,a)},t));else if("polyline"===u)if("orthogonal"===h){if(e!==n&&e.children&&0!==e.children.length&&!0===e.isExpand){for(var y=e.children,v=[],m=0;me&&(e=i.height)}this.height=e+1},t.prototype.getNodeById=function(t){if(this.getId()===t)return this;for(var e=0,n=this.children,i=n.length;e=0&&this.hostTree.data.setItemLayout(this.dataIndex,t,e)},t.prototype.getLayout=function(){return this.hostTree.data.getItemLayout(this.dataIndex)},t.prototype.getModel=function(t){if(!(this.dataIndex<0))return this.hostTree.data.getItemModel(this.dataIndex).getModel(t)},t.prototype.getLevelModel=function(){return(this.hostTree.levelModels||[])[this.depth]},t.prototype.setVisual=function(t,e){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,t,e)},t.prototype.getVisual=function(t){return this.hostTree.data.getItemVisual(this.dataIndex,t)},t.prototype.getRawIndex=function(){return this.hostTree.data.getRawIndex(this.dataIndex)},t.prototype.getId=function(){return this.hostTree.data.getId(this.dataIndex)},t.prototype.getChildIndex=function(){if(this.parentNode){for(var t=this.parentNode.children,e=0;e=0){var i=n.getData().tree.root,r=t.targetNode;if(X(r)&&(r=i.getNodeById(r)),r&&i.contains(r))return{node:r};var o=t.targetNodeId;if(null!=o&&(r=i.getNodeById(o)))return{node:r}}}function NC(t){for(var e=[];t;)(t=t.parentNode)&&e.push(t);return e.reverse()}function EC(t,e){return P(NC(t),e)>=0}function zC(t,e){for(var n=[];t;){var i=t.dataIndex;n.push({name:t.name,dataIndex:i,value:e.getRawValue(i)}),t=t.parentNode}return n.reverse(),n}var VC=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.hasSymbolVisual=!0,e.ignoreStyleOnData=!0,e}return n(e,t),e.prototype.getInitialData=function(t){var e={name:t.name,children:t.data},n=t.leaves||{},i=new xc(n,this,this.ecModel),r=OC.createTree(e,this,(function(t){t.wrapMethod("getItemModel",(function(t,e){var n=r.getNodeByDataIndex(e);return n&&n.children.length&&n.isExpand||(t.parentModel=i),t}))}));var o=0;r.eachNode("preorder",(function(t){t.depth>o&&(o=t.depth)}));var a=t.expandAndCollapse&&t.initialTreeDepth>=0?t.initialTreeDepth:o;return r.root.eachNode("preorder",(function(t){var e=t.hostTree.data.getRawDataItem(t.dataIndex);t.isExpand=e&&null!=e.collapsed?!e.collapsed:t.depth<=a})),r.data},e.prototype.getOrient=function(){var t=this.get("orient");return"horizontal"===t?t="LR":"vertical"===t&&(t="TB"),t},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.formatTooltip=function(t,e,n){for(var i=this.getData().tree,r=i.root.children[0],o=i.getNodeByDataIndex(t),a=o.getValue(),s=o.name;o&&o!==r;)s=o.parentNode.name+"."+s,o=o.parentNode;return qf("nameValue",{name:s,value:a,noValue:isNaN(a)||null==a})},e.prototype.getDataParams=function(e){var n=t.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(e);return n.treeAncestors=zC(i,this),n.collapsed=!i.isExpand,n},e.type="series.tree",e.layoutMode="box",e.defaultOption={z:2,coordinateSystem:"view",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",edgeShape:"curve",edgeForkPosition:"50%",roam:!1,nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:"#ccc",width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500},e}(hg);function BC(t,e){for(var n,i=[t];n=i.pop();)if(e(n),n.isExpand){var r=n.children;if(r.length)for(var o=r.length-1;o>=0;o--)i.push(r[o])}}function FC(t,e){t.eachSeriesByType("tree",(function(t){!function(t,e){var n=function(t,e){return wp(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}(t,e);t.layoutInfo=n;var i=t.get("layout"),r=0,o=0,a=null;"radial"===i?(r=2*Math.PI,o=Math.min(n.height,n.width)/2,a=sC((function(t,e){return(t.parentNode===e.parentNode?1:2)/t.depth}))):(r=n.width,o=n.height,a=sC());var s=t.getData().tree.root,l=s.children[0];if(l){!function(t){var e=t;e.hierNode={defaultAncestor:null,ancestor:e,prelim:0,modifier:0,change:0,shift:0,i:0,thread:null};for(var n,i,r=[e];n=r.pop();)if(i=n.children,n.isExpand&&i.length)for(var o=i.length-1;o>=0;o--){var a=i[o];a.hierNode={defaultAncestor:null,ancestor:a,prelim:0,modifier:0,change:0,shift:0,i:o,thread:null},r.push(a)}}(s),function(t,e,n){for(var i,r=[t],o=[];i=r.pop();)if(o.push(i),i.isExpand){var a=i.children;if(a.length)for(var s=0;sh.getLayout().x&&(h=t),t.depth>c.depth&&(c=t)}));var p=u===h?1:a(u,h)/2,d=p-u.getLayout().x,f=0,g=0,y=0,v=0;if("radial"===i)f=r/(h.getLayout().x+p+d),g=o/(c.depth-1||1),BC(l,(function(t){y=(t.getLayout().x+d)*f,v=(t.depth-1)*g;var e=lC(y,v);t.setLayout({x:e.x,y:e.y,rawX:y,rawY:v},!0)}));else{var m=t.getOrient();"RL"===m||"LR"===m?(g=o/(h.getLayout().x+p+d),f=r/(c.depth-1||1),BC(l,(function(t){v=(t.getLayout().x+d)*g,y="LR"===m?(t.depth-1)*f:r-(t.depth-1)*f,t.setLayout({x:y,y:v},!0)}))):"TB"!==m&&"BT"!==m||(f=r/(h.getLayout().x+p+d),g=o/(c.depth-1||1),BC(l,(function(t){y=(t.getLayout().x+d)*f,v="TB"===m?(t.depth-1)*g:o-(t.depth-1)*g,t.setLayout({x:y,y:v},!0)})))}}}(t,e)}))}function GC(t){t.eachSeriesByType("tree",(function(t){var e=t.getData();e.tree.eachNode((function(t){var n=t.getModel().getModel("itemStyle").getItemStyle();A(e.ensureUniqueItemVisual(t.dataIndex,"style"),n)}))}))}var WC=["treemapZoomToNode","treemapRender","treemapMove"];function HC(t){var e=t.getData().tree,n={};e.eachNode((function(e){for(var i=e;i&&i.depth>1;)i=i.parentNode;var r=rd(t.ecModel,i.name||i.dataIndex+"",n);e.setVisual("decal",r)}))}var YC=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.preventUsingHoverLayer=!0,n}return n(e,t),e.prototype.getInitialData=function(t,e){var n={name:t.name,children:t.data};UC(n);var i=t.levels||[],r=this.designatedVisualItemStyle={},o=new xc({itemStyle:r},this,e);i=t.levels=function(t,e){var n,i,r=yo(e.get("color")),o=yo(e.get(["aria","decal","decals"]));if(!r)return;E(t=t||[],(function(t){var e=new xc(t),r=e.get("color"),o=e.get("decal");(e.get(["itemStyle","color"])||r&&"none"!==r)&&(n=!0),(e.get(["itemStyle","decal"])||o&&"none"!==o)&&(i=!0)}));var a=t[0]||(t[0]={});n||(a.color=r.slice());!i&&o&&(a.decal=o.slice());return t}(i,e);var a=z(i||[],(function(t){return new xc(t,o,e)}),this),s=OC.createTree(n,this,(function(t){t.wrapMethod("getItemModel",(function(t,e){var n=s.getNodeByDataIndex(e),i=n?a[n.depth]:null;return t.parentModel=i||o,t}))}));return s.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},e.prototype.formatTooltip=function(t,e,n){var i=this.getData(),r=this.getRawValue(t);return qf("nameValue",{name:i.getName(t),value:r})},e.prototype.getDataParams=function(e){var n=t.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(e);return n.treeAncestors=zC(i,this),n.treePathInfo=n.treeAncestors,n},e.prototype.setLayoutInfo=function(t){this.layoutInfo=this.layoutInfo||{},A(this.layoutInfo,t)},e.prototype.mapIdToIndex=function(t){var e=this._idIndexMap;e||(e=this._idIndexMap=ft(),this._idIndexMapCount=0);var n=e.get(t);return null==n&&e.set(t,n=this._idIndexMapCount++),n},e.prototype.getViewRoot=function(){return this._viewRoot},e.prototype.resetViewRoot=function(t){t?this._viewRoot=t:t=this._viewRoot;var e=this.getRawData().tree.root;t&&(t===e||e.contains(t))||(this._viewRoot=e)},e.prototype.enableAriaDecal=function(){HC(this)},e.type="series.treemap",e.layoutMode="box",e.defaultOption={progressive:0,left:"center",top:"middle",width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",zoomToNodeRatio:.1024,roam:!0,nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",top:"bottom",emptyItemWidth:25,itemStyle:{color:"rgba(0,0,0,0.7)",textStyle:{color:"#fff"}},emphasis:{itemStyle:{color:"rgba(0,0,0,0.9)"}}},label:{show:!0,distance:0,padding:5,position:"inside",color:"#fff",overflow:"truncate"},upperLabel:{show:!1,position:[0,"50%"],height:20,overflow:"truncate",verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],overflow:"truncate",verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},e}(hg);function UC(t){var e=0;E(t.children,(function(t){UC(t);var n=t.value;Y(n)&&(n=n[0]),e+=n}));var n=t.value;Y(n)&&(n=n[0]),(null==n||isNaN(n))&&(n=e),n<0&&(n=0),Y(t.value)?t.value[0]=n:t.value=n}var XC=function(){function t(t){this.group=new Pr,t.add(this.group)}return t.prototype.render=function(t,e,n,i){var r=t.getModel("breadcrumb"),o=this.group;if(o.removeAll(),r.get("show")&&n){var a=r.getModel("itemStyle"),s=r.getModel("emphasis"),l=a.getModel("textStyle"),u=s.getModel(["itemStyle","textStyle"]),h={pos:{left:r.get("left"),right:r.get("right"),top:r.get("top"),bottom:r.get("bottom")},box:{width:e.getWidth(),height:e.getHeight()},emptyItemWidth:r.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(n,h,l),this._renderContent(t,h,a,s,l,u,i),Sp(o,h.pos,h.box)}},t.prototype._prepare=function(t,e,n){for(var i=t;i;i=i.parentNode){var r=Mo(i.getModel().get("name"),""),o=n.getTextRect(r),a=Math.max(o.width+16,e.emptyItemWidth);e.totalWidth+=a+8,e.renderList.push({node:i,text:r,width:a})}},t.prototype._renderContent=function(t,e,n,i,r,o,a){for(var s,l,u,h,c,p,d,f,g,y=0,v=e.emptyItemWidth,m=t.get(["breadcrumb","height"]),x=(s=e.pos,l=e.box,h=l.width,c=l.height,p=Gr(s.left,h),d=Gr(s.top,c),f=Gr(s.right,h),g=Gr(s.bottom,c),(isNaN(p)||isNaN(parseFloat(s.left)))&&(p=0),(isNaN(f)||isNaN(parseFloat(s.right)))&&(f=h),(isNaN(d)||isNaN(parseFloat(s.top)))&&(d=0),(isNaN(g)||isNaN(parseFloat(s.bottom)))&&(g=c),u=up(u||0),{width:Math.max(f-p-u[1]-u[3],0),height:Math.max(g-d-u[0]-u[2],0)}),_=e.totalWidth,b=e.renderList,w=i.getModel("itemStyle").getItemStyle(),S=b.length-1;S>=0;S--){var M=b[S],I=M.node,T=M.width,C=M.text;_>x.width&&(_-=T-v,T=v,C=null);var D=new zu({shape:{points:ZC(y,0,T,m,S===b.length-1,0===S)},style:k(n.getItemStyle(),{lineJoin:"bevel"}),textContent:new Ns({style:$h(r,{text:C})}),textConfig:{position:"inside"},z2:1e5,onclick:H(a,I)});D.disableLabelAnimation=!0,D.getTextContent().ensureState("emphasis").style=$h(o,{text:C}),D.ensureState("emphasis").style=w,Bl(D,i.get("focus"),i.get("blurScope"),i.get("disabled")),this.group.add(D),jC(D,t,I),y+=T+8}},t.prototype.remove=function(){this.group.removeAll()},t}();function ZC(t,e,n,i,r,o){var a=[[r?t:t-5,e],[t+n,e],[t+n,e+i],[r?t:t-5,e+i]];return!o&&a.splice(2,0,[t+n+5,e+i/2]),!r&&a.push([t,e+i/2]),a}function jC(t,e,n){js(t).eventData={componentType:"series",componentSubType:"treemap",componentIndex:e.componentIndex,seriesIndex:e.seriesIndex,seriesName:e.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:n&&n.dataIndex,name:n&&n.name},treePathInfo:n&&zC(n,e)}}var qC=function(){function t(){this._storage=[],this._elExistsMap={}}return t.prototype.add=function(t,e,n,i,r){return!this._elExistsMap[t.id]&&(this._elExistsMap[t.id]=!0,this._storage.push({el:t,target:e,duration:n,delay:i,easing:r}),!0)},t.prototype.finished=function(t){return this._finishedCallback=t,this},t.prototype.start=function(){for(var t=this,e=this._storage.length,n=function(){--e<=0&&(t._storage.length=0,t._elExistsMap={},t._finishedCallback&&t._finishedCallback())},i=0,r=this._storage.length;i3||Math.abs(t.dy)>3)){var e=this.seriesModel.getData().tree.root;if(!e)return;var n=e.getLayout();if(!n)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:n.x+t.dx,y:n.y+t.dy,width:n.width,height:n.height}})}},e.prototype._onZoom=function(t){var e=t.originX,n=t.originY;if("animating"!==this._state){var i=this.seriesModel.getData().tree.root;if(!i)return;var r=i.getLayout();if(!r)return;var o=new Re(r.x,r.y,r.width,r.height),a=this.seriesModel.layoutInfo,s=[1,0,0,1,0,0];xe(s,s,[-(e-=a.x),-(n-=a.y)]),be(s,s,[t.scale,t.scale]),xe(s,s,[e,n]),o.applyTransform(s),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:o.x,y:o.y,width:o.width,height:o.height}})}},e.prototype._initEvents=function(t){var e=this;t.on("click",(function(t){if("ready"===e._state){var n=e.seriesModel.get("nodeClick",!0);if(n){var i=e.findTarget(t.offsetX,t.offsetY);if(i){var r=i.node;if(r.getLayout().isLeafRoot)e._rootToNode(i);else if("zoomToNode"===n)e._zoomToNode(i);else if("link"===n){var o=r.hostTree.data.getItemModel(r.dataIndex),a=o.get("link",!0),s=o.get("target",!0)||"blank";a&&yp(a,s)}}}}}),this)},e.prototype._renderBreadcrumb=function(t,e,n){var i=this;n||(n=null!=t.get("leafDepth",!0)?{node:t.getViewRoot()}:this.findTarget(e.getWidth()/2,e.getHeight()/2))||(n={node:t.getData().tree.root}),(this._breadcrumb||(this._breadcrumb=new XC(this.group))).render(t,e,n.node,(function(e){"animating"!==i._state&&(EC(t.getViewRoot(),e)?i._rootToNode({node:e}):i._zoomToNode({node:e}))}))},e.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage={nodeGroup:[],background:[],content:[]},this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},e.prototype.dispose=function(){this._clearController()},e.prototype._zoomToNode=function(t){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},e.prototype._rootToNode=function(t){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},e.prototype.findTarget=function(t,e){var n;return this.seriesModel.getViewRoot().eachNode({attr:"viewChildren",order:"preorder"},(function(i){var r=this._storage.background[i.getRawIndex()];if(r){var o=r.transformCoordToLocal(t,e),a=r.shape;if(!(a.x<=o[0]&&o[0]<=a.x+a.width&&a.y<=o[1]&&o[1]<=a.y+a.height))return!1;n={node:i,offsetX:o[0],offsetY:o[1]}}}),this),n},e.type="treemap",e}(wg);var rD=E,oD=q,aD=-1,sD=function(){function t(e){var n=e.mappingMethod,i=e.type,r=this.option=T(e);this.type=i,this.mappingMethod=n,this._normalizeData=vD[n];var o=t.visualHandlers[i];this.applyVisual=o.applyVisual,this.getColorMapper=o.getColorMapper,this._normalizedToVisual=o._normalizedToVisual[n],"piecewise"===n?(lD(r),function(t){var e=t.pieceList;t.hasSpecialVisual=!1,E(e,(function(e,n){e.originIndex=n,null!=e.visual&&(t.hasSpecialVisual=!0)}))}(r)):"category"===n?r.categories?function(t){var e=t.categories,n=t.categoryMap={},i=t.visual;if(rD(e,(function(t,e){n[t]=e})),!Y(i)){var r=[];q(i)?rD(i,(function(t,e){var i=n[e];r[null!=i?i:aD]=t})):r[-1]=i,i=yD(t,r)}for(var o=e.length-1;o>=0;o--)null==i[o]&&(delete n[e[o]],e.pop())}(r):lD(r,!0):(lt("linear"!==n||r.dataExtent),lD(r))}return t.prototype.mapValueToVisual=function(t){var e=this._normalizeData(t);return this._normalizedToVisual(e,t)},t.prototype.getNormalizer=function(){return W(this._normalizeData,this)},t.listVisualTypes=function(){return G(t.visualHandlers)},t.isValidType=function(e){return t.visualHandlers.hasOwnProperty(e)},t.eachVisual=function(t,e,n){q(t)?E(t,e,n):e.call(n,t)},t.mapVisual=function(e,n,i){var r,o=Y(e)?[]:q(e)?{}:(r=!0,null);return t.eachVisual(e,(function(t,e){var a=n.call(i,t,e);r?o=a:o[e]=a})),o},t.retrieveVisuals=function(e){var n,i={};return e&&rD(t.visualHandlers,(function(t,r){e.hasOwnProperty(r)&&(i[r]=e[r],n=!0)})),n?i:null},t.prepareVisualTypes=function(t){if(Y(t))t=t.slice();else{if(!oD(t))return[];var e=[];rD(t,(function(t,n){e.push(n)})),t=e}return t.sort((function(t,e){return"color"===e&&"color"!==t&&0===t.indexOf("color")?1:-1})),t},t.dependsOn=function(t,e){return"color"===e?!(!t||0!==t.indexOf(e)):t===e},t.findPieceIndex=function(t,e,n){for(var i,r=1/0,o=0,a=e.length;ou[1]&&(u[1]=l);var h=e.get("colorMappingBy"),c={type:a.name,dataExtent:u,visual:a.range};"color"!==c.type||"index"!==h&&"id"!==h?c.mappingMethod="linear":(c.mappingMethod="category",c.loop=!0);var p=new sD(c);return xD(p).drColorMappingBy=h,p}(0,r,o,0,u,d);E(d,(function(t,e){if(t.depth>=n.length||t===n[t.depth]){var o=function(t,e,n,i,r,o){var a=A({},e);if(r){var s=r.type,l="color"===s&&xD(r).drColorMappingBy,u="index"===l?i:"id"===l?o.mapIdToIndex(n.getId()):n.getValue(t.get("visualDimension"));a[s]=r.mapValueToVisual(u)}return a}(r,u,t,e,f,i);bD(t,o,n,i)}}))}else s=wD(u),h.fill=s}}function wD(t){var e=SD(t,"color");if(e){var n=SD(t,"colorAlpha"),i=SD(t,"colorSaturation");return i&&(e=Qn(e,null,null,i)),n&&(e=ti(e,n)),e}}function SD(t,e){var n=t[e];if(null!=n&&"none"!==n)return n}function MD(t,e){var n=t.get(e);return Y(n)&&n.length?{name:e,range:n}:null}var ID=Math.max,TD=Math.min,CD=it,DD=E,AD=["itemStyle","borderWidth"],kD=["itemStyle","gapWidth"],LD=["upperLabel","show"],PD=["upperLabel","height"],OD={seriesType:"treemap",reset:function(t,e,n,i){var r=n.getWidth(),o=n.getHeight(),a=t.option,s=wp(t.getBoxLayoutParams(),{width:n.getWidth(),height:n.getHeight()}),l=a.size||[],u=Gr(CD(s.width,l[0]),r),h=Gr(CD(s.height,l[1]),o),c=i&&i.type,p=RC(i,["treemapZoomToNode","treemapRootToNode"],t),d="treemapRender"===c||"treemapMove"===c?i.rootRect:null,f=t.getViewRoot(),g=NC(f);if("treemapMove"!==c){var y="treemapZoomToNode"===c?function(t,e,n,i,r){var o,a=(e||{}).node,s=[i,r];if(!a||a===n)return s;var l=i*r,u=l*t.option.zoomToNodeRatio;for(;o=a.parentNode;){for(var h=0,c=o.children,p=0,d=c.length;pqr&&(u=qr),a=o}ua[1]&&(a[1]=e)}))):a=[NaN,NaN];return{sum:i,dataExtent:a}}(e,a,s);if(0===u.sum)return t.viewChildren=[];if(u.sum=function(t,e,n,i,r){if(!i)return n;for(var o=t.get("visibleMin"),a=r.length,s=a,l=a-1;l>=0;l--){var u=r["asc"===i?a-l-1:l].getValue();u/n*ei&&(i=a));var l=t.area*t.area,u=e*e*n;return l?ID(u*i/l,l/(u*r)):1/0}function ED(t,e,n,i,r){var o=e===n.width?0:1,a=1-o,s=["x","y"],l=["width","height"],u=n[s[o]],h=e?t.area/e:0;(r||h>n[l[a]])&&(h=n[l[a]]);for(var c=0,p=t.length;ci&&(i=e);var o=i%2?i+2:i+3;r=[];for(var a=0;a0&&(m[0]=-m[0],m[1]=-m[1]);var _=v[0]<0?-1:1;if("start"!==i.__position&&"end"!==i.__position){var b=-Math.atan2(v[1],v[0]);u[0].8?"left":h[0]<-.8?"right":"center",p=h[1]>.8?"top":h[1]<-.8?"bottom":"middle";break;case"start":i.x=-h[0]*f+l[0],i.y=-h[1]*g+l[1],c=h[0]>.8?"right":h[0]<-.8?"left":"center",p=h[1]>.8?"bottom":h[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":i.x=f*_+l[0],i.y=l[1]+w,c=v[0]<0?"right":"left",i.originX=-f*_,i.originY=-w;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":i.x=x[0],i.y=x[1]+w,c="center",i.originY=-w;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":i.x=-f*_+u[0],i.y=u[1]+w,c=v[0]>=0?"right":"left",i.originX=f*_,i.originY=-w}i.scaleX=i.scaleY=r,i.setStyle({verticalAlign:i.__verticalAlign||p,align:i.__align||c})}}}function S(t,e){var n=t.__specifiedRotation;if(null==n){var i=a.tangentAt(e);t.attr("rotation",(1===e?-1:1)*Math.PI/2-Math.atan2(i[1],i[0]))}else t.attr("rotation",n)}},e}(Pr),_A=function(){function t(t){this.group=new Pr,this._LineCtor=t||xA}return t.prototype.updateData=function(t){var e=this;this._progressiveEls=null;var n=this,i=n.group,r=n._lineData;n._lineData=t,r||i.removeAll();var o=bA(t);t.diff(r).add((function(n){e._doAdd(t,n,o)})).update((function(n,i){e._doUpdate(r,t,i,n,o)})).remove((function(t){i.remove(r.getItemGraphicEl(t))})).execute()},t.prototype.updateLayout=function(){var t=this._lineData;t&&t.eachItemGraphicEl((function(e,n){e.updateLayout(t,n)}),this)},t.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=bA(t),this._lineData=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(t,e){function n(t){t.isGroup||function(t){return t.animators&&t.animators.length>0}(t)||(t.incremental=!0,t.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[];for(var i=t.start;i=0?i+=u:i-=u:f>=0?i-=u:i+=u}return i}function LA(t,e){var n=[],i=In,r=[[],[],[]],o=[[],[]],a=[];e/=2,t.eachEdge((function(t,s){var l=t.getLayout(),u=t.getVisual("fromSymbol"),h=t.getVisual("toSymbol");l.__original||(l.__original=[Mt(l[0]),Mt(l[1])],l[2]&&l.__original.push(Mt(l[2])));var c=l.__original;if(null!=l[2]){if(St(r[0],c[0]),St(r[1],c[2]),St(r[2],c[1]),u&&"none"!==u){var p=tA(t.node1),d=kA(r,c[0],p*e);i(r[0][0],r[1][0],r[2][0],d,n),r[0][0]=n[3],r[1][0]=n[4],i(r[0][1],r[1][1],r[2][1],d,n),r[0][1]=n[3],r[1][1]=n[4]}if(h&&"none"!==h){p=tA(t.node2),d=kA(r,c[1],p*e);i(r[0][0],r[1][0],r[2][0],d,n),r[1][0]=n[1],r[2][0]=n[2],i(r[0][1],r[1][1],r[2][1],d,n),r[1][1]=n[1],r[2][1]=n[2]}St(l[0],r[0]),St(l[1],r[2]),St(l[2],r[1])}else{if(St(o[0],c[0]),St(o[1],c[1]),Dt(a,o[1],o[0]),Rt(a,a),u&&"none"!==u){p=tA(t.node1);Ct(o[0],o[0],a,p*e)}if(h&&"none"!==h){p=tA(t.node2);Ct(o[1],o[1],a,-p*e)}St(l[0],o[0]),St(l[1],o[1])}}))}function PA(t){return"view"===t.type}var OA=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.init=function(t,e){var n=new Jw,i=new _A,r=this.group;this._controller=new OI(e.getZr()),this._controllerHost={target:r},r.add(n.group),r.add(i.group),this._symbolDraw=n,this._lineDraw=i,this._firstRender=!0},e.prototype.render=function(t,e,n){var i=this,r=t.coordinateSystem;this._model=t;var o=this._symbolDraw,a=this._lineDraw,s=this.group;if(PA(r)){var l={x:r.x,y:r.y,scaleX:r.scaleX,scaleY:r.scaleY};this._firstRender?s.attr(l):uh(s,l,t)}LA(t.getGraph(),QD(t));var u=t.getData();o.updateData(u);var h=t.getEdgeData();a.updateData(h),this._updateNodeAndLinkScale(),this._updateController(t,e,n),clearTimeout(this._layoutTimeout);var c=t.forceLayout,p=t.get(["force","layoutAnimation"]);c&&this._startForceLayoutIteration(c,p);var d=t.get("layout");u.graph.eachNode((function(e){var n=e.dataIndex,r=e.getGraphicEl(),o=e.getModel();if(r){r.off("drag").off("dragend");var a=o.get("draggable");a&&r.on("drag",(function(o){switch(d){case"force":c.warmUp(),!i._layouting&&i._startForceLayoutIteration(c,p),c.setFixed(n),u.setItemLayout(n,[r.x,r.y]);break;case"circular":u.setItemLayout(n,[r.x,r.y]),e.setLayout({fixed:!0},!0),iA(t,"symbolSize",e,[o.offsetX,o.offsetY]),i.updateLayout(t);break;default:u.setItemLayout(n,[r.x,r.y]),$D(t.getGraph(),t),i.updateLayout(t)}})).on("dragend",(function(){c&&c.setUnfixed(n)})),r.setDraggable(a&&!!c,!!o.get("cursor")),"adjacency"===o.get(["emphasis","focus"])&&(js(r).focus=e.getAdjacentDataIndices())}})),u.graph.eachEdge((function(t){var e=t.getGraphicEl(),n=t.getModel().get(["emphasis","focus"]);e&&"adjacency"===n&&(js(e).focus={edge:[t.dataIndex],node:[t.node1.dataIndex,t.node2.dataIndex]})}));var f="circular"===t.get("layout")&&t.get(["circular","rotateLabel"]),g=u.getLayout("cx"),y=u.getLayout("cy");u.graph.eachNode((function(t){oA(t,f,g,y)})),this._firstRender=!1},e.prototype.dispose=function(){this._controller&&this._controller.dispose(),this._controllerHost=null},e.prototype._startForceLayoutIteration=function(t,e){var n=this;!function i(){t.step((function(t){n.updateLayout(n._model),(n._layouting=!t)&&(e?n._layoutTimeout=setTimeout(i,16):i())}))}()},e.prototype._updateController=function(t,e,n){var i=this,r=this._controller,o=this._controllerHost,a=this.group;r.setPointerChecker((function(e,i,r){var o=a.getBoundingRect();return o.applyTransform(a.transform),o.contain(i,r)&&!GI(e,n,t)})),PA(t.coordinateSystem)?(r.enable(t.get("roam")),o.zoomLimit=t.get("scaleLimit"),o.zoom=t.coordinateSystem.getZoom(),r.off("pan").off("zoom").on("pan",(function(e){zI(o,e.dx,e.dy),n.dispatchAction({seriesId:t.id,type:"graphRoam",dx:e.dx,dy:e.dy})})).on("zoom",(function(e){VI(o,e.scale,e.originX,e.originY),n.dispatchAction({seriesId:t.id,type:"graphRoam",zoom:e.scale,originX:e.originX,originY:e.originY}),i._updateNodeAndLinkScale(),LA(t.getGraph(),QD(t)),i._lineDraw.updateLayout(),n.updateLabelLayout()}))):r.disable()},e.prototype._updateNodeAndLinkScale=function(){var t=this._model,e=t.getData(),n=QD(t);e.eachItemGraphicEl((function(t,e){t&&t.setSymbolScale(n)}))},e.prototype.updateLayout=function(t){LA(t.getGraph(),QD(t)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout()},e.prototype.remove=function(t,e){this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove()},e.type="graph",e}(wg);function RA(t){return"_EC_"+t}var NA=function(){function t(t){this.type="graph",this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this._directed=t||!1}return t.prototype.isDirected=function(){return this._directed},t.prototype.addNode=function(t,e){t=null==t?""+e:""+t;var n=this._nodesMap;if(!n[RA(t)]){var i=new EA(t,e);return i.hostGraph=this,this.nodes.push(i),n[RA(t)]=i,i}},t.prototype.getNodeByIndex=function(t){var e=this.data.getRawIndex(t);return this.nodes[e]},t.prototype.getNodeById=function(t){return this._nodesMap[RA(t)]},t.prototype.addEdge=function(t,e,n){var i=this._nodesMap,r=this._edgesMap;if(j(t)&&(t=this.nodes[t]),j(e)&&(e=this.nodes[e]),t instanceof EA||(t=i[RA(t)]),e instanceof EA||(e=i[RA(e)]),t&&e){var o=t.id+"-"+e.id,a=new zA(t,e,n);return a.hostGraph=this,this._directed&&(t.outEdges.push(a),e.inEdges.push(a)),t.edges.push(a),t!==e&&e.edges.push(a),this.edges.push(a),r[o]=a,a}},t.prototype.getEdgeByIndex=function(t){var e=this.edgeData.getRawIndex(t);return this.edges[e]},t.prototype.getEdge=function(t,e){t instanceof EA&&(t=t.id),e instanceof EA&&(e=e.id);var n=this._edgesMap;return this._directed?n[t+"-"+e]:n[t+"-"+e]||n[e+"-"+t]},t.prototype.eachNode=function(t,e){for(var n=this.nodes,i=n.length,r=0;r=0&&t.call(e,n[r],r)},t.prototype.eachEdge=function(t,e){for(var n=this.edges,i=n.length,r=0;r=0&&n[r].node1.dataIndex>=0&&n[r].node2.dataIndex>=0&&t.call(e,n[r],r)},t.prototype.breadthFirstTraverse=function(t,e,n,i){if(e instanceof EA||(e=this._nodesMap[RA(e)]),e){for(var r="out"===n?"outEdges":"in"===n?"inEdges":"edges",o=0;o=0&&n.node2.dataIndex>=0}));for(r=0,o=i.length;r=0&&this[t][e].setItemVisual(this.dataIndex,n,i)},getVisual:function(n){return this[t][e].getItemVisual(this.dataIndex,n)},setLayout:function(n,i){this.dataIndex>=0&&this[t][e].setItemLayout(this.dataIndex,n,i)},getLayout:function(){return this[t][e].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[t][e].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[t][e].getRawIndex(this.dataIndex)}}}function BA(t,e,n,i,r){for(var o=new NA(i),a=0;a "+p)),u++)}var d,f=n.get("coordinateSystem");if("cartesian2d"===f||"polar"===f)d=sx(t,n);else{var g=dd.get(f),y=g&&g.dimensions||[];P(y,"value")<0&&y.concat(["value"]);var v=Qm(t,{coordDimensions:y,encodeDefine:n.getEncode()}).dimensions;(d=new Jm(v,n)).initData(t)}var m=new Jm(["value"],n);return m.initData(l,s),r&&r(d,m),MC({mainData:d,struct:o,structAttr:"graph",datas:{node:d,edge:m},datasAttr:{node:"data",edge:"edgeData"}}),o.update(),o}R(EA,VA("hostGraph","data")),R(zA,VA("hostGraph","edgeData"));var FA=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.hasSymbolVisual=!0,n}return n(e,t),e.prototype.init=function(e){t.prototype.init.apply(this,arguments);var n=this;function i(){return n._categoriesData}this.legendVisualProvider=new dM(i,i),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},e.prototype.mergeOption=function(e){t.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},e.prototype.mergeDefaultAndTheme=function(e){t.prototype.mergeDefaultAndTheme.apply(this,arguments),vo(e,"edgeLabel",["show"])},e.prototype.getInitialData=function(t,e){var n,i=t.edges||t.links||[],r=t.data||t.nodes||[],o=this;if(r&&i){YD(n=this)&&(n.__curvenessList=[],n.__edgeMap={},UD(n));var a=BA(r,i,this,!0,(function(t,e){t.wrapMethod("getItemModel",(function(t){var e=o._categoriesModels[t.getShallow("category")];return e&&(e.parentModel=t.parentModel,t.parentModel=e),t}));var n=xc.prototype.getModel;function i(t,e){var i=n.call(this,t,e);return i.resolveParentPath=r,i}function r(t){if(t&&("label"===t[0]||"label"===t[1])){var e=t.slice();return"label"===t[0]?e[0]="edgeLabel":"label"===t[1]&&(e[1]="edgeLabel"),e}return t}e.wrapMethod("getItemModel",(function(t){return t.resolveParentPath=r,t.getModel=i,t}))}));return E(a.edges,(function(t){!function(t,e,n,i){if(YD(n)){var r=XD(t,e,n),o=n.__edgeMap,a=o[ZD(r)];o[r]&&!a?o[r].isForward=!0:a&&o[r]&&(a.isForward=!0,o[r].isForward=!1),o[r]=o[r]||[],o[r].push(i)}}(t.node1,t.node2,this,t.dataIndex)}),this),a.data}},e.prototype.getGraph=function(){return this.getData().graph},e.prototype.getEdgeData=function(){return this.getGraph().edgeData},e.prototype.getCategoriesData=function(){return this._categoriesData},e.prototype.formatTooltip=function(t,e,n){if("edge"===n){var i=this.getData(),r=this.getDataParams(t,n),o=i.graph.getEdgeByIndex(t),a=i.getName(o.node1.dataIndex),s=i.getName(o.node2.dataIndex),l=[];return null!=a&&l.push(a),null!=s&&l.push(s),qf("nameValue",{name:l.join(" > "),value:r.value,noValue:null==r.value})}return sg({series:this,dataIndex:t,multipleSeries:e})},e.prototype._updateCategoriesData=function(){var t=z(this.option.categories||[],(function(t){return null!=t.value?t:A({value:0},t)})),e=new Jm(["value"],this);e.initData(t),this._categoriesData=e,this._categoriesModels=e.mapArray((function(t){return e.getItemModel(t)}))},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.isAnimationEnabled=function(){return t.prototype.isAnimationEnabled.call(this)&&!("force"===this.get("layout")&&this.get(["force","layoutAnimation"]))},e.type="series.graph",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={z:2,coordinateSystem:"view",legendHoverLink:!0,layout:null,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},e}(hg),GA={type:"graphRoam",event:"graphRoam",update:"none"};var WA=function(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0},HA=function(t){function e(e){var n=t.call(this,e)||this;return n.type="pointer",n}return n(e,t),e.prototype.getDefaultShape=function(){return new WA},e.prototype.buildPath=function(t,e){var n=Math.cos,i=Math.sin,r=e.r,o=e.width,a=e.angle,s=e.x-n(a)*o*(o>=r/3?1:2),l=e.y-i(a)*o*(o>=r/3?1:2);a=e.angle-Math.PI/2,t.moveTo(s,l),t.lineTo(e.x+n(a)*o,e.y+i(a)*o),t.lineTo(e.x+n(e.angle)*r,e.y+i(e.angle)*r),t.lineTo(e.x-n(a)*o,e.y-i(a)*o),t.lineTo(s,l)},e}(_s);function YA(t,e){var n=null==t?"":t+"";return e&&(X(e)?n=e.replace("{value}",n):U(e)&&(n=e(t))),n}var UA=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.render=function(t,e,n){this.group.removeAll();var i=t.get(["axisLine","lineStyle","color"]),r=function(t,e){var n=t.get("center"),i=e.getWidth(),r=e.getHeight(),o=Math.min(i,r);return{cx:Gr(n[0],e.getWidth()),cy:Gr(n[1],e.getHeight()),r:Gr(t.get("radius"),o/2)}}(t,n);this._renderMain(t,e,n,i,r),this._data=t.getData()},e.prototype.dispose=function(){},e.prototype._renderMain=function(t,e,n,i,r){var o=this.group,a=t.get("clockwise"),s=-t.get("startAngle")/180*Math.PI,l=-t.get("endAngle")/180*Math.PI,u=t.getModel("axisLine"),h=u.get("roundCap")?LS:Pu,c=u.get("show"),p=u.getModel("lineStyle"),d=p.get("width"),f=[s,l];Qa(f,!a);for(var g=(l=f[1])-(s=f[0]),y=s,v=0;c&&v=t&&(0===e?0:i[e-1][0])Math.PI/2&&(V+=Math.PI):"tangential"===z?V=-M-Math.PI/2:j(z)&&(V=z*Math.PI/180),0===V?c.add(new Ns({style:$h(x,{text:O,x:N,y:E,verticalAlign:h<-.8?"top":h>.8?"bottom":"middle",align:u<-.4?"left":u>.4?"right":"center"},{inheritColor:R}),silent:!0})):c.add(new Ns({style:$h(x,{text:O,x:N,y:E,verticalAlign:"middle",align:"center"},{inheritColor:R}),silent:!0,originX:N,originY:E,rotation:V}))}if(m.get("show")&&k!==_){P=(P=m.get("distance"))?P+l:l;for(var B=0;B<=b;B++){u=Math.cos(M),h=Math.sin(M);var F=new Wu({shape:{x1:u*(f-P)+p,y1:h*(f-P)+d,x2:u*(f-S-P)+p,y2:h*(f-S-P)+d},silent:!0,style:D});"auto"===D.stroke&&F.setStyle({stroke:i((k+B/b)/_)}),c.add(F),M+=T}M-=T}else M+=I}},e.prototype._renderPointer=function(t,e,n,i,r,o,a,s,l){var u=this.group,h=this._data,c=this._progressEls,p=[],d=t.get(["pointer","show"]),f=t.getModel("progress"),g=f.get("show"),y=t.getData(),v=y.mapDimension("value"),m=+t.get("min"),x=+t.get("max"),_=[m,x],b=[o,a];function w(e,n){var i,o=y.getItemModel(e).getModel("pointer"),a=Gr(o.get("width"),r.r),s=Gr(o.get("length"),r.r),l=t.get(["pointer","icon"]),u=o.get("offsetCenter"),h=Gr(u[0],r.r),c=Gr(u[1],r.r),p=o.get("keepAspect");return(i=l?Ry(l,h-a/2,c-s,a,s,null,p):new HA({shape:{angle:-Math.PI/2,width:a,r:s,x:h,y:c}})).rotation=-(n+Math.PI/2),i.x=r.cx,i.y=r.cy,i}function S(t,e){var n=f.get("roundCap")?LS:Pu,i=f.get("overlap"),a=i?f.get("width"):l/y.count(),u=i?r.r-a:r.r-(t+1)*a,h=i?r.r:r.r-t*a,c=new n({shape:{startAngle:o,endAngle:e,cx:r.cx,cy:r.cy,clockwise:s,r0:u,r:h}});return i&&(c.z2=x-y.get(v,t)%x),c}(g||d)&&(y.diff(h).add((function(e){var n=y.get(v,e);if(d){var i=w(e,o);hh(i,{rotation:-((isNaN(+n)?b[0]:Fr(n,_,b,!0))+Math.PI/2)},t),u.add(i),y.setItemGraphicEl(e,i)}if(g){var r=S(e,o),a=f.get("clip");hh(r,{shape:{endAngle:Fr(n,_,b,a)}},t),u.add(r),qs(t.seriesIndex,y.dataType,e,r),p[e]=r}})).update((function(e,n){var i=y.get(v,e);if(d){var r=h.getItemGraphicEl(n),a=r?r.rotation:o,s=w(e,a);s.rotation=a,uh(s,{rotation:-((isNaN(+i)?b[0]:Fr(i,_,b,!0))+Math.PI/2)},t),u.add(s),y.setItemGraphicEl(e,s)}if(g){var l=c[n],m=S(e,l?l.shape.endAngle:o),x=f.get("clip");uh(m,{shape:{endAngle:Fr(i,_,b,x)}},t),u.add(m),qs(t.seriesIndex,y.dataType,e,m),p[e]=m}})).execute(),y.each((function(t){var e=y.getItemModel(t),n=e.getModel("emphasis"),r=n.get("focus"),o=n.get("blurScope"),a=n.get("disabled");if(d){var s=y.getItemGraphicEl(t),l=y.getItemVisual(t,"style"),u=l.fill;if(s instanceof Is){var h=s.style;s.useStyle(A({image:h.image,x:h.x,y:h.y,width:h.width,height:h.height},l))}else s.useStyle(l),"pointer"!==s.type&&s.setColor(u);s.setStyle(e.getModel(["pointer","itemStyle"]).getItemStyle()),"auto"===s.style.fill&&s.setStyle("fill",i(Fr(y.get(v,t),_,[0,1],!0))),s.z2EmphasisLift=0,Hl(s,e),Bl(s,r,o,a)}if(g){var c=p[t];c.useStyle(y.getItemVisual(t,"style")),c.setStyle(e.getModel(["progress","itemStyle"]).getItemStyle()),c.z2EmphasisLift=0,Hl(c,e),Bl(c,r,o,a)}})),this._progressEls=p)},e.prototype._renderAnchor=function(t,e){var n=t.getModel("anchor");if(n.get("show")){var i=n.get("size"),r=n.get("icon"),o=n.get("offsetCenter"),a=n.get("keepAspect"),s=Ry(r,e.cx-i/2+Gr(o[0],e.r),e.cy-i/2+Gr(o[1],e.r),i,i,null,a);s.z2=n.get("showAbove")?1:0,s.setStyle(n.getModel("itemStyle").getItemStyle()),this.group.add(s)}},e.prototype._renderTitleAndDetail=function(t,e,n,i,r){var o=this,a=t.getData(),s=a.mapDimension("value"),l=+t.get("min"),u=+t.get("max"),h=new Pr,c=[],p=[],d=t.isAnimationEnabled(),f=t.get(["pointer","showAbove"]);a.diff(this._data).add((function(t){c[t]=new Ns({silent:!0}),p[t]=new Ns({silent:!0})})).update((function(t,e){c[t]=o._titleEls[e],p[t]=o._detailEls[e]})).execute(),a.each((function(e){var n=a.getItemModel(e),o=a.get(s,e),g=new Pr,y=i(Fr(o,[l,u],[0,1],!0)),v=n.getModel("title");if(v.get("show")){var m=v.get("offsetCenter"),x=r.cx+Gr(m[0],r.r),_=r.cy+Gr(m[1],r.r);(D=c[e]).attr({z2:f?0:2,style:$h(v,{x:x,y:_,text:a.getName(e),align:"center",verticalAlign:"middle"},{inheritColor:y})}),g.add(D)}var b=n.getModel("detail");if(b.get("show")){var w=b.get("offsetCenter"),S=r.cx+Gr(w[0],r.r),M=r.cy+Gr(w[1],r.r),I=Gr(b.get("width"),r.r),T=Gr(b.get("height"),r.r),C=t.get(["progress","show"])?a.getItemVisual(e,"style").fill:y,D=p[e],A=b.get("formatter");D.attr({z2:f?0:2,style:$h(b,{x:S,y:M,text:YA(o,A),width:isNaN(I)?null:I,height:isNaN(T)?null:T,align:"center",verticalAlign:"middle"},{inheritColor:C})}),oc(D,{normal:b},o,(function(t){return YA(t,A)})),d&&ac(D,e,a,t,{getFormattedLabel:function(t,e,n,i,r,a){return YA(a?a.interpolatedValue:o,A)}}),g.add(D)}h.add(g)})),this.group.add(h),this._titleEls=c,this._detailEls=p},e.type="gauge",e}(wg),XA=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.visualStyleAccessPath="itemStyle",n}return n(e,t),e.prototype.getInitialData=function(t,e){return pM(this,["value"])},e.type="series.gauge",e.defaultOption={z:2,colorBy:"data",center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,roundCap:!1,lineStyle:{color:[[1,"#E6EBF8"]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:"#63677A",width:3,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:"#63677A",width:1,type:"solid"}},axisLabel:{show:!0,distance:15,color:"#464646",fontSize:12,rotate:0},pointer:{icon:null,offsetCenter:[0,0],show:!0,showAbove:!0,length:"60%",width:6,keepAspect:!1},anchor:{show:!1,showAbove:!1,size:6,icon:"circle",offsetCenter:[0,0],keepAspect:!1,itemStyle:{color:"#fff",borderWidth:0,borderColor:"#5470c6"}},title:{show:!0,offsetCenter:[0,"20%"],color:"#464646",fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:"#464646",fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}},e}(hg);var ZA=["itemStyle","opacity"],jA=function(t){function e(e,n){var i=t.call(this)||this,r=i,o=new Bu,a=new Ns;return r.setTextContent(a),i.setTextGuideLine(o),i.updateData(e,n,!0),i}return n(e,t),e.prototype.updateData=function(t,e,n){var i=this,r=t.hostModel,o=t.getItemModel(e),a=t.getItemLayout(e),s=o.getModel("emphasis"),l=o.get(ZA);l=null==l?1:l,n||gh(i),i.useStyle(t.getItemVisual(e,"style")),i.style.lineJoin="round",n?(i.setShape({points:a.points}),i.style.opacity=0,hh(i,{style:{opacity:l}},r,e)):uh(i,{style:{opacity:l},shape:{points:a.points}},r,e),Hl(i,o),this._updateLabel(t,e),Bl(this,s.get("focus"),s.get("blurScope"),s.get("disabled"))},e.prototype._updateLabel=function(t,e){var n=this,i=this.getTextGuideLine(),r=n.getTextContent(),o=t.hostModel,a=t.getItemModel(e),s=t.getItemLayout(e).label,l=t.getItemVisual(e,"style"),u=l.fill;qh(r,Kh(a),{labelFetcher:t.hostModel,labelDataIndex:e,defaultOpacity:l.opacity,defaultText:t.getName(e)},{normal:{align:s.textAlign,verticalAlign:s.verticalAlign}}),n.setTextConfig({local:!0,inside:!!s.inside,insideStroke:u,outsideFill:u});var h=s.linePoints;i.setShape({points:h}),n.textGuideLineConfig={anchor:h?new Ie(h[0][0],h[0][1]):null},uh(r,{style:{x:s.x,y:s.y}},o,e),r.attr({rotation:s.rotation,originX:s.x,originY:s.y,z2:10}),yb(n,vb(a),{stroke:u})},e}(zu),qA=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.ignoreLabelLineUpdate=!0,n}return n(e,t),e.prototype.render=function(t,e,n){var i=t.getData(),r=this._data,o=this.group;i.diff(r).add((function(t){var e=new jA(i,t);i.setItemGraphicEl(t,e),o.add(e)})).update((function(t,e){var n=r.getItemGraphicEl(e);n.updateData(i,t),o.add(n),i.setItemGraphicEl(t,n)})).remove((function(e){fh(r.getItemGraphicEl(e),t,e)})).execute(),this._data=i},e.prototype.remove=function(){this.group.removeAll(),this._data=null},e.prototype.dispose=function(){},e.type="funnel",e}(wg),KA=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.init=function(e){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new dM(W(this.getData,this),W(this.getRawData,this)),this._defaultLabelLine(e)},e.prototype.getInitialData=function(t,e){return pM(this,{coordDimensions:["value"],encodeDefaulter:H(Zp,this)})},e.prototype._defaultLabelLine=function(t){vo(t,"labelLine",["show"]);var e=t.labelLine,n=t.emphasis.labelLine;e.show=e.show&&t.label.show,n.show=n.show&&t.emphasis.label.show},e.prototype.getDataParams=function(e){var n=this.getData(),i=t.prototype.getDataParams.call(this,e),r=n.mapDimension("value"),o=n.getSum(r);return i.percent=o?+(n.get(r,e)/o*100).toFixed(2):0,i.$vars.push("percent"),i},e.type="series.funnel",e.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",left:80,top:60,right:80,bottom:60,minSize:"0%",maxSize:"100%",sort:"descending",orient:"vertical",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1}},itemStyle:{borderColor:"#fff",borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},e}(hg);function $A(t,e){t.eachSeriesByType("funnel",(function(t){var n=t.getData(),i=n.mapDimension("value"),r=t.get("sort"),o=function(t,e){return wp(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}(t,e),a=t.get("orient"),s=o.width,l=o.height,u=function(t,e){for(var n=t.mapDimension("value"),i=t.mapArray(n,(function(t){return t})),r=[],o="ascending"===e,a=0,s=t.count();a5)return;var i=this._model.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX,t.offsetY]);"none"!==i.behavior&&this._dispatchExpand({axisExpandWindow:i.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(t){if(!this._mouseDownPoint&&hk(this,"mousemove")){var e=this._model,n=e.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX,t.offsetY]),i=n.behavior;"jump"===i&&this._throttledDispatchExpand.debounceNextCall(e.get("axisExpandDebounce")),this._throttledDispatchExpand("none"===i?null:{axisExpandWindow:n.axisExpandWindow,animation:"jump"===i?null:{duration:0}})}}};function hk(t,e){var n=t._model;return n.get("axisExpandable")&&n.get("axisExpandTriggerOn")===e}var ck=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.init=function(){t.prototype.init.apply(this,arguments),this.mergeOption({})},e.prototype.mergeOption=function(t){var e=this.option;t&&C(e,t,!0),this._initDimensions()},e.prototype.contains=function(t,e){var n=t.get("parallelIndex");return null!=n&&e.getComponent("parallel",n)===this},e.prototype.setAxisExpand=function(t){E(["axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandWindow"],(function(e){t.hasOwnProperty(e)&&(this.option[e]=t[e])}),this)},e.prototype._initDimensions=function(){var t=this.dimensions=[],e=this.parallelAxisIndex=[];E(B(this.ecModel.queryComponents({mainType:"parallelAxis"}),(function(t){return(t.get("parallelIndex")||0)===this.componentIndex}),this),(function(n){t.push("dim"+n.get("dim")),e.push(n.componentIndex)}))},e.type="parallel",e.dependencies=["parallelAxis"],e.layoutMode="box",e.defaultOption={z:0,left:80,top:60,right:80,bottom:60,layout:"horizontal",axisExpandable:!1,axisExpandCenter:null,axisExpandCount:0,axisExpandWidth:50,axisExpandRate:17,axisExpandDebounce:50,axisExpandSlideTriggerArea:[-.15,.05,.4],axisExpandTriggerOn:"click",parallelAxisDefault:null},e}(Ap),pk=function(t){function e(e,n,i,r,o){var a=t.call(this,e,n,i)||this;return a.type=r||"value",a.axisIndex=o,a}return n(e,t),e.prototype.isHorizontal=function(){return"horizontal"!==this.coordinateSystem.getModel().get("layout")},e}(X_);function dk(t,e,n,i,r,o){t=t||0;var a=n[1]-n[0];if(null!=r&&(r=gk(r,[0,a])),null!=o&&(o=Math.max(o,null!=r?r:0)),"all"===i){var s=Math.abs(e[1]-e[0]);s=gk(s,[0,a]),r=o=gk(s,[r,o]),i=0}e[0]=gk(e[0],n),e[1]=gk(e[1],n);var l=fk(e,i);e[i]+=t;var u,h=r||0,c=n.slice();return l.sign<0?c[0]+=h:c[1]-=h,e[i]=gk(e[i],c),u=fk(e,i),null!=r&&(u.sign!==l.sign||u.spano&&(e[1-i]=e[i]+u.sign*o),e}function fk(t,e){var n=t[e]-t[1-e];return{span:Math.abs(n),sign:n>0?-1:n<0?1:e?-1:1}}function gk(t,e){return Math.min(null!=e[1]?e[1]:1/0,Math.max(null!=e[0]?e[0]:-1/0,t))}var yk=E,vk=Math.min,mk=Math.max,xk=Math.floor,_k=Math.ceil,bk=Wr,wk=Math.PI,Sk=function(){function t(t,e,n){this.type="parallel",this._axesMap=ft(),this._axesLayout={},this.dimensions=t.dimensions,this._model=t,this._init(t,e,n)}return t.prototype._init=function(t,e,n){var i=t.dimensions,r=t.parallelAxisIndex;yk(i,(function(t,n){var i=r[n],o=e.getComponent("parallelAxis",i),a=this._axesMap.set(t,new pk(t,l_(o),[0,0],o.get("type"),i)),s="category"===a.type;a.onBand=s&&o.get("boundaryGap"),a.inverse=o.get("inverse"),o.axis=a,a.model=o,a.coordinateSystem=o.coordinateSystem=this}),this)},t.prototype.update=function(t,e){this._updateAxesFromSeries(this._model,t)},t.prototype.containPoint=function(t){var e=this._makeLayoutInfo(),n=e.axisBase,i=e.layoutBase,r=e.pixelDimIndex,o=t[1-r],a=t[r];return o>=n&&o<=n+e.axisLength&&a>=i&&a<=i+e.layoutLength},t.prototype.getModel=function(){return this._model},t.prototype._updateAxesFromSeries=function(t,e){e.eachSeries((function(n){if(t.contains(n,e)){var i=n.getData();yk(this.dimensions,(function(t){var e=this._axesMap.get(t);e.scale.unionExtentFromData(i,i.mapDimension(t)),s_(e.scale,e.model)}),this)}}),this)},t.prototype.resize=function(t,e){this._rect=wp(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()}),this._layoutAxes()},t.prototype.getRect=function(){return this._rect},t.prototype._makeLayoutInfo=function(){var t,e=this._model,n=this._rect,i=["x","y"],r=["width","height"],o=e.get("layout"),a="horizontal"===o?0:1,s=n[r[a]],l=[0,s],u=this.dimensions.length,h=Mk(e.get("axisExpandWidth"),l),c=Mk(e.get("axisExpandCount")||0,[0,u]),p=e.get("axisExpandable")&&u>3&&u>c&&c>1&&h>0&&s>0,d=e.get("axisExpandWindow");d?(t=Mk(d[1]-d[0],l),d[1]=d[0]+t):(t=Mk(h*(c-1),l),(d=[h*(e.get("axisExpandCenter")||xk(u/2))-t/2])[1]=d[0]+t);var f=(s-t)/(u-c);f<3&&(f=0);var g=[xk(bk(d[0]/h,1))+1,_k(bk(d[1]/h,1))-1],y=f/h*d[0];return{layout:o,pixelDimIndex:a,layoutBase:n[i[a]],layoutLength:s,axisBase:n[i[1-a]],axisLength:n[r[1-a]],axisExpandable:p,axisExpandWidth:h,axisCollapseWidth:f,axisExpandWindow:d,axisCount:u,winInnerIndices:g,axisExpandWindow0Pos:y}},t.prototype._layoutAxes=function(){var t=this._rect,e=this._axesMap,n=this.dimensions,i=this._makeLayoutInfo(),r=i.layout;e.each((function(t){var e=[0,i.axisLength],n=t.inverse?1:0;t.setExtent(e[n],e[1-n])})),yk(n,(function(e,n){var o=(i.axisExpandable?Tk:Ik)(n,i),a={horizontal:{x:o.position,y:i.axisLength},vertical:{x:0,y:o.position}},s={horizontal:wk/2,vertical:0},l=[a[r].x+t.x,a[r].y+t.y],u=s[r],h=[1,0,0,1,0,0];_e(h,h,u),xe(h,h,l),this._axesLayout[e]={position:l,rotation:u,transform:h,axisNameAvailableWidth:o.axisNameAvailableWidth,axisLabelShow:o.axisLabelShow,nameTruncateMaxWidth:o.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}}),this)},t.prototype.getAxis=function(t){return this._axesMap.get(t)},t.prototype.dataToPoint=function(t,e){return this.axisCoordToPoint(this._axesMap.get(e).dataToCoord(t),e)},t.prototype.eachActiveState=function(t,e,n,i){null==n&&(n=0),null==i&&(i=t.count());var r=this._axesMap,o=this.dimensions,a=[],s=[];E(o,(function(e){a.push(t.mapDimension(e)),s.push(r.get(e).model)}));for(var l=this.hasAxisBrushed(),u=n;ur*(1-h[0])?(l="jump",a=s-r*(1-h[2])):(a=s-r*h[1])>=0&&(a=s-r*(1-h[1]))<=0&&(a=0),(a*=e.axisExpandWidth/u)?dk(a,i,o,"all"):l="none";else{var p=i[1]-i[0];(i=[mk(0,o[1]*s/p-p/2)])[1]=vk(o[1],i[0]+p),i[0]=i[1]-p}return{axisExpandWindow:i,behavior:l}},t}();function Mk(t,e){return vk(mk(t,e[0]),e[1])}function Ik(t,e){var n=e.layoutLength/(e.axisCount-1);return{position:n*t,axisNameAvailableWidth:n,axisLabelShow:!0}}function Tk(t,e){var n,i,r=e.layoutLength,o=e.axisExpandWidth,a=e.axisCount,s=e.axisCollapseWidth,l=e.winInnerIndices,u=s,h=!1;return t=0;n--)Hr(e[n])},e.prototype.getActiveState=function(t){var e=this.activeIntervals;if(!e.length)return"normal";if(null==t||isNaN(+t))return"inactive";if(1===e.length){var n=e[0];if(n[0]<=t&&t<=n[1])return"active"}else for(var i=0,r=e.length;i6}(t)||o){if(a&&!o){"single"===s.brushMode&&Zk(t);var l=T(s);l.brushType=hL(l.brushType,a),l.panelId=a===Ak?null:a.panelId,o=t._creatingCover=Bk(t,l),t._covers.push(o)}if(o){var u=dL[hL(t._brushType,a)];o.__brushOption.range=u.getCreatingRange(aL(t,o,t._track)),i&&(Fk(t,o),u.updateCommon(t,o)),Gk(t,o),r={isEnd:i}}}else i&&"single"===s.brushMode&&s.removeOnClick&&Uk(t,e,n)&&Zk(t)&&(r={isEnd:i,removeOnClick:!0});return r}function hL(t,e){return"auto"===t?e.defaultBrushType:t}var cL={mousedown:function(t){if(this._dragging)pL(this,t);else if(!t.target||!t.target.draggable){sL(t);var e=this.group.transformCoordToLocal(t.offsetX,t.offsetY);this._creatingCover=null,(this._creatingPanel=Uk(this,t,e))&&(this._dragging=!0,this._track=[e.slice()])}},mousemove:function(t){var e=t.offsetX,n=t.offsetY,i=this.group.transformCoordToLocal(e,n);if(function(t,e,n){if(t._brushType&&!function(t,e,n){var i=t._zr;return e<0||e>i.getWidth()||n<0||n>i.getHeight()}(t,e.offsetX,e.offsetY)){var i=t._zr,r=t._covers,o=Uk(t,e,n);if(!t._dragging)for(var a=0;a=0&&(o[r[a].depth]=new xc(r[a],this,e));if(i&&n){var s=BA(i,n,this,!0,(function(t,e){t.wrapMethod("getItemModel",(function(t,e){var n=t.parentModel,i=n.getData().getItemLayout(e);if(i){var r=i.depth,o=n.levelModels[r];o&&(t.parentModel=o)}return t})),e.wrapMethod("getItemModel",(function(t,e){var n=t.parentModel,i=n.getGraph().getEdgeByIndex(e).node1.getLayout();if(i){var r=i.depth,o=n.levelModels[r];o&&(t.parentModel=o)}return t}))}));return s.data}},e.prototype.setNodePosition=function(t,e){var n=(this.option.data||this.option.nodes)[t];n.localX=e[0],n.localY=e[1]},e.prototype.getGraph=function(){return this.getData().graph},e.prototype.getEdgeData=function(){return this.getGraph().edgeData},e.prototype.formatTooltip=function(t,e,n){function i(t){return isNaN(t)||null==t}if("edge"===n){var r=this.getDataParams(t,n),o=r.data,a=r.value;return qf("nameValue",{name:o.source+" -- "+o.target,value:a,noValue:i(a)})}var s=this.getGraph().getNodeByIndex(t).getLayout().value,l=this.getDataParams(t,n).data.name;return qf("nameValue",{name:null!=l?l+"":null,value:s,noValue:i(s)})},e.prototype.optionUpdated=function(){},e.prototype.getDataParams=function(e,n){var i=t.prototype.getDataParams.call(this,e,n);if(null==i.value&&"node"===n){var r=this.getGraph().getNodeByIndex(e).getLayout().value;i.value=r}return i},e.type="series.sankey",e.defaultOption={z:2,coordinateSystem:"view",left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,layoutIterations:32,label:{show:!0,position:"right",fontSize:12},levels:[],nodeAlign:"justify",lineStyle:{color:"#314656",opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:"#212121"}},animationEasing:"linear",animationDuration:1e3},e}(hg);function DL(t,e){t.eachSeriesByType("sankey",(function(t){var n=t.get("nodeWidth"),i=t.get("nodeGap"),r=function(t,e){return wp(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}(t,e);t.layoutInfo=r;var o=r.width,a=r.height,s=t.getGraph(),l=s.nodes,u=s.edges;!function(t){E(t,(function(t){var e=VL(t.outEdges,zL),n=VL(t.inEdges,zL),i=t.getValue()||0,r=Math.max(e,n,i);t.setLayout({value:r},!0)}))}(l),function(t,e,n,i,r,o,a,s,l){(function(t,e,n,i,r,o,a){for(var s=[],l=[],u=[],h=[],c=0,p=0;p=0;v&&y.depth>d&&(d=y.depth),g.setLayout({depth:v?y.depth:c},!0),"vertical"===o?g.setLayout({dy:n},!0):g.setLayout({dx:n},!0);for(var m=0;mc-1?d:c-1;a&&"left"!==a&&function(t,e,n,i){if("right"===e){for(var r=[],o=t,a=0;o.length;){for(var s=0;s0;o--)LL(s,l*=.99,a),kL(s,r,n,i,a),BL(s,l,a),kL(s,r,n,i,a)}(t,e,o,r,i,a,s),function(t,e){var n="vertical"===e?"x":"y";E(t,(function(t){t.outEdges.sort((function(t,e){return t.node2.getLayout()[n]-e.node2.getLayout()[n]})),t.inEdges.sort((function(t,e){return t.node1.getLayout()[n]-e.node1.getLayout()[n]}))})),E(t,(function(t){var e=0,n=0;E(t.outEdges,(function(t){t.setLayout({sy:e},!0),e+=t.getLayout().dy})),E(t.inEdges,(function(t){t.setLayout({ty:n},!0),n+=t.getLayout().dy}))}))}(t,s)}(l,u,n,i,o,a,0!==B(l,(function(t){return 0===t.getLayout().value})).length?0:t.get("layoutIterations"),t.get("orient"),t.get("nodeAlign"))}))}function AL(t){var e=t.hostGraph.data.getRawDataItem(t.dataIndex);return null!=e.depth&&e.depth>=0}function kL(t,e,n,i,r){var o="vertical"===r?"x":"y";E(t,(function(t){var a,s,l;t.sort((function(t,e){return t.getLayout()[o]-e.getLayout()[o]}));for(var u=0,h=t.length,c="vertical"===r?"dx":"dy",p=0;p0&&(a=s.getLayout()[o]+l,"vertical"===r?s.setLayout({x:a},!0):s.setLayout({y:a},!0)),u=s.getLayout()[o]+s.getLayout()[c]+e;if((l=u-e-("vertical"===r?i:n))>0){a=s.getLayout()[o]-l,"vertical"===r?s.setLayout({x:a},!0):s.setLayout({y:a},!0),u=a;for(p=h-2;p>=0;--p)(l=(s=t[p]).getLayout()[o]+s.getLayout()[c]+e-u)>0&&(a=s.getLayout()[o]-l,"vertical"===r?s.setLayout({x:a},!0):s.setLayout({y:a},!0)),u=s.getLayout()[o]}}))}function LL(t,e,n){E(t.slice().reverse(),(function(t){E(t,(function(t){if(t.outEdges.length){var i=VL(t.outEdges,PL,n)/VL(t.outEdges,zL);if(isNaN(i)){var r=t.outEdges.length;i=r?VL(t.outEdges,OL,n)/r:0}if("vertical"===n){var o=t.getLayout().x+(i-EL(t,n))*e;t.setLayout({x:o},!0)}else{var a=t.getLayout().y+(i-EL(t,n))*e;t.setLayout({y:a},!0)}}}))}))}function PL(t,e){return EL(t.node2,e)*t.getValue()}function OL(t,e){return EL(t.node2,e)}function RL(t,e){return EL(t.node1,e)*t.getValue()}function NL(t,e){return EL(t.node1,e)}function EL(t,e){return"vertical"===e?t.getLayout().x+t.getLayout().dx/2:t.getLayout().y+t.getLayout().dy/2}function zL(t){return t.getValue()}function VL(t,e,n){for(var i=0,r=t.length,o=-1;++oi&&(i=e)})),E(e,(function(e){var r=new sD({type:"color",mappingMethod:"linear",dataExtent:[n,i],visual:t.get("color")}).mapValueToVisual(e.getLayout().value),o=e.getModel().get(["itemStyle","color"]);null!=o?(e.setVisual("color",o),e.setVisual("style",{fill:o})):(e.setVisual("color",r),e.setVisual("style",{fill:r}))}))}}))}var GL=function(){function t(){}return t.prototype.getInitialData=function(t,e){var n,i,r=e.getComponent("xAxis",this.get("xAxisIndex")),o=e.getComponent("yAxis",this.get("yAxisIndex")),a=r.get("type"),s=o.get("type");"category"===a?(t.layout="horizontal",n=r.getOrdinalMeta(),i=!0):"category"===s?(t.layout="vertical",n=o.getOrdinalMeta(),i=!0):t.layout=t.layout||"horizontal";var l=["x","y"],u="horizontal"===t.layout?0:1,h=this._baseAxisDim=l[u],c=l[1-u],p=[r,o],d=p[u].get("type"),f=p[1-u].get("type"),g=t.data;if(g&&i){var y=[];E(g,(function(t,e){var n;Y(t)?(n=t.slice(),t.unshift(e)):Y(t.value)?((n=A({},t)).value=n.value.slice(),t.value.unshift(e)):n=t,y.push(n)})),t.data=y}var v=this.defaultValueDimensions,m=[{name:h,type:Lm(d),ordinalMeta:n,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:c,type:Lm(f),dimsDef:v.slice()}];return pM(this,{coordDimensions:m,dimensionsCount:v.length+1,encodeDefaulter:H(Xp,m,this)})},t.prototype.getBaseAxis=function(){var t=this._baseAxisDim;return this.ecModel.getComponent(t+"Axis",this.get(t+"AxisIndex")).axis},t}(),WL=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.defaultValueDimensions=[{name:"min",defaultTooltip:!0},{name:"Q1",defaultTooltip:!0},{name:"median",defaultTooltip:!0},{name:"Q3",defaultTooltip:!0},{name:"max",defaultTooltip:!0}],n.visualDrawType="stroke",n}return n(e,t),e.type="series.boxplot",e.dependencies=["xAxis","yAxis","grid"],e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,boxWidth:[7,50],itemStyle:{color:"#fff",borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0,0,0,0.2)"}},animationDuration:800},e}(hg);R(WL,GL,!0);var HL=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.render=function(t,e,n){var i=t.getData(),r=this.group,o=this._data;this._data||r.removeAll();var a="horizontal"===t.get("layout")?1:0;i.diff(o).add((function(t){if(i.hasValue(t)){var e=XL(i.getItemLayout(t),i,t,a,!0);i.setItemGraphicEl(t,e),r.add(e)}})).update((function(t,e){var n=o.getItemGraphicEl(e);if(i.hasValue(t)){var s=i.getItemLayout(t);n?(gh(n),ZL(s,n,i,t)):n=XL(s,i,t,a),r.add(n),i.setItemGraphicEl(t,n)}else r.remove(n)})).remove((function(t){var e=o.getItemGraphicEl(t);e&&r.remove(e)})).execute(),this._data=i},e.prototype.remove=function(t){var e=this.group,n=this._data;this._data=null,n&&n.eachItemGraphicEl((function(t){t&&e.remove(t)}))},e.type="boxplot",e}(wg),YL=function(){},UL=function(t){function e(e){var n=t.call(this,e)||this;return n.type="boxplotBoxPath",n}return n(e,t),e.prototype.getDefaultShape=function(){return new YL},e.prototype.buildPath=function(t,e){var n=e.points,i=0;for(t.moveTo(n[i][0],n[i][1]),i++;i<4;i++)t.lineTo(n[i][0],n[i][1]);for(t.closePath();ig){var _=[v,x];i.push(_)}}}return{boxData:n,outliers:i}}(e.getRawData(),t.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:i.boxData},{data:i.outliers}]}};var QL=["color","borderColor"],tP=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.render=function(t,e,n){this.group.removeClipPath(),this._progressiveEls=null,this._updateDrawMode(t),this._isLargeDraw?this._renderLarge(t):this._renderNormal(t)},e.prototype.incrementalPrepareRender=function(t,e,n){this._clear(),this._updateDrawMode(t)},e.prototype.incrementalRender=function(t,e,n,i){this._progressiveEls=[],this._isLargeDraw?this._incrementalRenderLarge(t,e):this._incrementalRenderNormal(t,e)},e.prototype.eachRendered=function(t){Yh(this._progressiveEls||this.group,t)},e.prototype._updateDrawMode=function(t){var e=t.pipelineContext.large;null!=this._isLargeDraw&&e===this._isLargeDraw||(this._isLargeDraw=e,this._clear())},e.prototype._renderNormal=function(t){var e=t.getData(),n=this._data,i=this.group,r=e.getLayout("isSimpleBox"),o=t.get("clip",!0),a=t.coordinateSystem,s=a.getArea&&a.getArea();this._data||i.removeAll(),e.diff(n).add((function(n){if(e.hasValue(n)){var a=e.getItemLayout(n);if(o&&rP(s,a))return;var l=iP(a,n,!0);hh(l,{shape:{points:a.ends}},t,n),oP(l,e,n,r),i.add(l),e.setItemGraphicEl(n,l)}})).update((function(a,l){var u=n.getItemGraphicEl(l);if(e.hasValue(a)){var h=e.getItemLayout(a);o&&rP(s,h)?i.remove(u):(u?(uh(u,{shape:{points:h.ends}},t,a),gh(u)):u=iP(h),oP(u,e,a,r),i.add(u),e.setItemGraphicEl(a,u))}else i.remove(u)})).remove((function(t){var e=n.getItemGraphicEl(t);e&&i.remove(e)})).execute(),this._data=e},e.prototype._renderLarge=function(t){this._clear(),uP(t,this.group);var e=t.get("clip",!0)?cS(t.coordinateSystem,!1,t):null;e?this.group.setClipPath(e):this.group.removeClipPath()},e.prototype._incrementalRenderNormal=function(t,e){for(var n,i=e.getData(),r=i.getLayout("isSimpleBox");null!=(n=t.next());){var o=iP(i.getItemLayout(n));oP(o,i,n,r),o.incremental=!0,this.group.add(o),this._progressiveEls.push(o)}},e.prototype._incrementalRenderLarge=function(t,e){uP(e,this.group,this._progressiveEls,!0)},e.prototype.remove=function(t){this._clear()},e.prototype._clear=function(){this.group.removeAll(),this._data=null},e.type="candlestick",e}(wg),eP=function(){},nP=function(t){function e(e){var n=t.call(this,e)||this;return n.type="normalCandlestickBox",n}return n(e,t),e.prototype.getDefaultShape=function(){return new eP},e.prototype.buildPath=function(t,e){var n=e.points;this.__simpleBox?(t.moveTo(n[4][0],n[4][1]),t.lineTo(n[6][0],n[6][1])):(t.moveTo(n[0][0],n[0][1]),t.lineTo(n[1][0],n[1][1]),t.lineTo(n[2][0],n[2][1]),t.lineTo(n[3][0],n[3][1]),t.closePath(),t.moveTo(n[4][0],n[4][1]),t.lineTo(n[5][0],n[5][1]),t.moveTo(n[6][0],n[6][1]),t.lineTo(n[7][0],n[7][1]))},e}(_s);function iP(t,e,n){var i=t.ends;return new nP({shape:{points:n?aP(i,t):i},z2:100})}function rP(t,e){for(var n=!0,i=0;i0?"borderColor":"borderColor0"])||n.get(["itemStyle",t>0?"color":"color0"]),o=n.getModel("itemStyle").getItemStyle(QL);e.useStyle(o),e.style.fill=null,e.style.stroke=r}var cP=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.defaultValueDimensions=[{name:"open",defaultTooltip:!0},{name:"close",defaultTooltip:!0},{name:"lowest",defaultTooltip:!0},{name:"highest",defaultTooltip:!0}],n}return n(e,t),e.prototype.getShadowDim=function(){return"open"},e.prototype.brushSelector=function(t,e,n){var i=e.getItemLayout(t);return i&&n.rect(i.brushRect)},e.type="series.candlestick",e.dependencies=["xAxis","yAxis","grid"],e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,clip:!0,itemStyle:{color:"#eb5454",color0:"#47b262",borderColor:"#eb5454",borderColor0:"#47b262",borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2}},barMaxWidth:null,barMinWidth:null,barWidth:null,large:!0,largeThreshold:600,progressive:3e3,progressiveThreshold:1e4,progressiveChunkMode:"mod",animationEasing:"linear",animationDuration:300},e}(hg);function pP(t){t&&Y(t.series)&&E(t.series,(function(t){q(t)&&"k"===t.type&&(t.type="candlestick")}))}R(cP,GL,!0);var dP=["itemStyle","borderColor"],fP=["itemStyle","borderColor0"],gP=["itemStyle","color"],yP=["itemStyle","color0"],vP={seriesType:"candlestick",plan:xg(),performRawSeries:!0,reset:function(t,e){function n(t,e){return e.get(t>0?gP:yP)}function i(t,e){return e.get(t>0?dP:fP)}if(!e.isSeriesFiltered(t))return!t.pipelineContext.large&&{progress:function(t,e){for(var r;null!=(r=t.next());){var o=e.getItemModel(r),a=e.getItemLayout(r).sign,s=o.getItemStyle();s.fill=n(a,o),s.stroke=i(a,o)||s.fill,A(e.ensureUniqueItemVisual(r,"style"),s)}}}}},mP={seriesType:"candlestick",plan:xg(),reset:function(t){var e=t.coordinateSystem,n=t.getData(),i=function(t,e){var n,i=t.getBaseAxis(),r="category"===i.type?i.getBandWidth():(n=i.getExtent(),Math.abs(n[1]-n[0])/e.count()),o=Gr(rt(t.get("barMaxWidth"),r),r),a=Gr(rt(t.get("barMinWidth"),1),r),s=t.get("barWidth");return null!=s?Gr(s,r):Math.max(Math.min(r/2,o),a)}(t,n),r=["x","y"],o=n.getDimensionIndex(n.mapDimension(r[0])),a=z(n.mapDimensionsAll(r[1]),n.getDimensionIndex,n),s=a[0],l=a[1],u=a[2],h=a[3];if(n.setLayout({candleWidth:i,isSimpleBox:i<=1.3}),!(o<0||a.length<4))return{progress:t.pipelineContext.large?function(t,n){var i,r,a=Tx(4*t.count),c=0,p=[],d=[],f=n.getStore();for(;null!=(r=t.next());){var g=f.get(o,r),y=f.get(s,r),v=f.get(l,r),m=f.get(u,r),x=f.get(h,r);isNaN(g)||isNaN(m)||isNaN(x)?(a[c++]=NaN,c+=3):(a[c++]=xP(f,r,y,v,l),p[0]=g,p[1]=m,i=e.dataToPoint(p,null,d),a[c++]=i?i[0]:NaN,a[c++]=i?i[1]:NaN,p[1]=x,i=e.dataToPoint(p,null,d),a[c++]=i?i[1]:NaN)}n.setLayout("largePoints",a)}:function(t,n){var r,a=n.getStore();for(;null!=(r=t.next());){var c=a.get(o,r),p=a.get(s,r),d=a.get(l,r),f=a.get(u,r),g=a.get(h,r),y=Math.min(p,d),v=Math.max(p,d),m=S(y,c),x=S(v,c),_=S(f,c),b=S(g,c),w=[];M(w,x,0),M(w,m,1),w.push(T(b),T(x),T(_),T(m)),n.setItemLayout(r,{sign:xP(a,r,p,d,l),initBaseline:p>d?x[1]:m[1],ends:w,brushRect:I(f,g,c)})}function S(t,n){var i=[];return i[0]=n,i[1]=t,isNaN(n)||isNaN(t)?[NaN,NaN]:e.dataToPoint(i)}function M(t,e,n){var r=e.slice(),o=e.slice();r[0]=kh(r[0]+i/2,1,!1),o[0]=kh(o[0]-i/2,1,!0),n?t.push(r,o):t.push(o,r)}function I(t,e,n){var r=S(t,n),o=S(e,n);return r[0]-=i/2,o[0]-=i/2,{x:r[0],y:r[1],width:i,height:o[1]-r[1]}}function T(t){return t[0]=kh(t[0],1),t}}}}};function xP(t,e,n,i,r){return n>i?-1:n0?t.get(r,e-1)<=i?1:-1:1}function _P(t,e){var n=e.rippleEffectColor||e.color;t.eachChild((function(t){t.attr({z:e.z,zlevel:e.zlevel,style:{stroke:"stroke"===e.brushType?n:null,fill:"fill"===e.brushType?n:null}})}))}var bP=function(t){function e(e,n){var i=t.call(this)||this,r=new Zw(e,n),o=new Pr;return i.add(r),i.add(o),i.updateData(e,n),i}return n(e,t),e.prototype.stopEffectAnimation=function(){this.childAt(1).removeAll()},e.prototype.startEffectAnimation=function(t){for(var e=t.symbolType,n=t.color,i=t.rippleNumber,r=this.childAt(1),o=0;o0&&(o=this._getLineLength(i)/l*1e3),o!==this._period||a!==this._loop||s!==this._roundTrip){i.stopAnimation();var h=void 0;h=U(u)?u(n):u,i.__t>0&&(h=-o*i.__t),this._animateSymbol(i,o,h,a,s)}this._period=o,this._loop=a,this._roundTrip=s}},e.prototype._animateSymbol=function(t,e,n,i,r){if(e>0){t.__t=0;var o=this,a=t.animate("",i).when(r?2*e:e,{__t:r?2:1}).delay(n).during((function(){o._updateSymbolPosition(t)}));i||a.done((function(){o.remove(t)})),a.start()}},e.prototype._getLineLength=function(t){return Et(t.__p1,t.__cp1)+Et(t.__cp1,t.__p2)},e.prototype._updateAnimationPoints=function(t,e){t.__p1=e[0],t.__p2=e[1],t.__cp1=e[2]||[(e[0][0]+e[1][0])/2,(e[0][1]+e[1][1])/2]},e.prototype.updateData=function(t,e,n){this.childAt(0).updateData(t,e,n),this._updateEffectSymbol(t,e)},e.prototype._updateSymbolPosition=function(t){var e=t.__p1,n=t.__p2,i=t.__cp1,r=t.__t<1?t.__t:2-t.__t,o=[t.x,t.y],a=o.slice(),s=wn,l=Sn;o[0]=s(e[0],i[0],n[0],r),o[1]=s(e[1],i[1],n[1],r);var u=t.__t<1?l(e[0],i[0],n[0],r):l(n[0],i[0],e[0],1-r),h=t.__t<1?l(e[1],i[1],n[1],r):l(n[1],i[1],e[1],1-r);t.rotation=-Math.atan2(h,u)-Math.PI/2,"line"!==this._symbolType&&"rect"!==this._symbolType&&"roundRect"!==this._symbolType||(void 0!==t.__lastT&&t.__lastT=0&&!(i[o]<=e);o--);o=Math.min(o,r-2)}else{for(o=a;oe);o++);o=Math.min(o-1,r-2)}var s=(e-i[o])/(i[o+1]-i[o]),l=n[o],u=n[o+1];t.x=l[0]*(1-s)+s*u[0],t.y=l[1]*(1-s)+s*u[1];var h=t.__t<1?u[0]-l[0]:l[0]-u[0],c=t.__t<1?u[1]-l[1]:l[1]-u[1];t.rotation=-Math.atan2(c,h)-Math.PI/2,this._lastFrame=o,this._lastFramePercent=e,t.ignore=!1}},e}(MP),CP=function(){this.polyline=!1,this.curveness=0,this.segs=[]},DP=function(t){function e(e){var n=t.call(this,e)||this;return n._off=0,n.hoverDataIdx=-1,n}return n(e,t),e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new CP},e.prototype.buildPath=function(t,e){var n,i=e.segs,r=e.curveness;if(e.polyline)for(n=this._off;n0){t.moveTo(i[n++],i[n++]);for(var a=1;a0){var c=(s+u)/2-(l-h)*r,p=(l+h)/2-(u-s)*r;t.quadraticCurveTo(c,p,u,h)}else t.lineTo(u,h)}this.incremental&&(this._off=n,this.notClear=!0)},e.prototype.findDataIndex=function(t,e){var n=this.shape,i=n.segs,r=n.curveness,o=this.style.lineWidth;if(n.polyline)for(var a=0,s=0;s0)for(var u=i[s++],h=i[s++],c=1;c0){if(is(u,h,(u+p)/2-(h-d)*r,(h+d)/2-(p-u)*r,p,d,o,t,e))return a}else if(es(u,h,p,d,o,t,e))return a;a++}return-1},e.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e),i=this.getBoundingRect();return t=n[0],e=n[1],i.contain(t,e)?(this.hoverDataIdx=this.findDataIndex(t,e))>=0:(this.hoverDataIdx=-1,!1)},e.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var e=this.shape.segs,n=1/0,i=1/0,r=-1/0,o=-1/0,a=0;a0&&(o.dataIndex=n+t.__startIndex)}))},t.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},t}(),kP={seriesType:"lines",plan:xg(),reset:function(t){var e=t.coordinateSystem;if(e){var n=t.get("polyline"),i=t.pipelineContext.large;return{progress:function(r,o){var a=[];if(i){var s=void 0,l=r.end-r.start;if(n){for(var u=0,h=r.start;h0&&(l||s.configLayer(o,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(a/10+.9,1),0)})),r.updateData(i);var u=t.get("clip",!0)&&cS(t.coordinateSystem,!1,t);u?this.group.setClipPath(u):this.group.removeClipPath(),this._lastZlevel=o,this._finished=!0},e.prototype.incrementalPrepareRender=function(t,e,n){var i=t.getData();this._updateLineDraw(i,t).incrementalPrepareUpdate(i),this._clearLayer(n),this._finished=!1},e.prototype.incrementalRender=function(t,e,n){this._lineDraw.incrementalUpdate(t,e.getData()),this._finished=t.end===e.getData().count()},e.prototype.eachRendered=function(t){this._lineDraw&&this._lineDraw.eachRendered(t)},e.prototype.updateTransform=function(t,e,n){var i=t.getData(),r=t.pipelineContext;if(!this._finished||r.large||r.progressiveRender)return{update:!0};var o=kP.reset(t,e,n);o.progress&&o.progress({start:0,end:i.count(),count:i.count()},i),this._lineDraw.updateLayout(),this._clearLayer(n)},e.prototype._updateLineDraw=function(t,e){var n=this._lineDraw,i=this._showEffect(e),r=!!e.get("polyline"),o=e.pipelineContext.large;return n&&i===this._hasEffet&&r===this._isPolyline&&o===this._isLargeDraw||(n&&n.remove(),n=this._lineDraw=o?new AP:new _A(r?i?TP:IP:i?MP:xA),this._hasEffet=i,this._isPolyline=r,this._isLargeDraw=o),this.group.add(n.group),n},e.prototype._showEffect=function(t){return!!t.get(["effect","show"])},e.prototype._clearLayer=function(t){var e=t.getZr();"svg"===e.painter.getType()||null==this._lastZlevel||e.painter.getLayer(this._lastZlevel).clear(!0)},e.prototype.remove=function(t,e){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,this._clearLayer(e)},e.prototype.dispose=function(t,e){this.remove(t,e)},e.type="lines",e}(wg),PP="undefined"==typeof Uint32Array?Array:Uint32Array,OP="undefined"==typeof Float64Array?Array:Float64Array;function RP(t){var e=t.data;e&&e[0]&&e[0][0]&&e[0][0].coord&&(t.data=z(e,(function(t){var e={coords:[t[0].coord,t[1].coord]};return t[0].name&&(e.fromName=t[0].name),t[1].name&&(e.toName=t[1].name),D([e,t[0],t[1]])})))}var NP=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.visualStyleAccessPath="lineStyle",n.visualDrawType="stroke",n}return n(e,t),e.prototype.init=function(e){e.data=e.data||[],RP(e);var n=this._processFlatCoordsArray(e.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(e.data=new Float32Array(n.count)),t.prototype.init.apply(this,arguments)},e.prototype.mergeOption=function(e){if(RP(e),e.data){var n=this._processFlatCoordsArray(e.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(e.data=new Float32Array(n.count))}t.prototype.mergeOption.apply(this,arguments)},e.prototype.appendData=function(t){var e=this._processFlatCoordsArray(t.data);e.flatCoords&&(this._flatCoords?(this._flatCoords=gt(this._flatCoords,e.flatCoords),this._flatCoordsOffset=gt(this._flatCoordsOffset,e.flatCoordsOffset)):(this._flatCoords=e.flatCoords,this._flatCoordsOffset=e.flatCoordsOffset),t.data=new Float32Array(e.count)),this.getRawData().appendData(t.data)},e.prototype._getCoordsFromItemModel=function(t){var e=this.getData().getItemModel(t),n=e.option instanceof Array?e.option:e.getShallow("coords");return n},e.prototype.getLineCoordsCount=function(t){return this._flatCoordsOffset?this._flatCoordsOffset[2*t+1]:this._getCoordsFromItemModel(t).length},e.prototype.getLineCoords=function(t,e){if(this._flatCoordsOffset){for(var n=this._flatCoordsOffset[2*t],i=this._flatCoordsOffset[2*t+1],r=0;r ")})},e.prototype.preventIncremental=function(){return!!this.get(["effect","show"])},e.prototype.getProgressive=function(){var t=this.option.progressive;return null==t?this.option.large?1e4:this.get("progressive"):t},e.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?2e4:this.get("progressiveThreshold"):t},e.prototype.getZLevelKey=function(){var t=this.getModel("effect"),e=t.get("trailLength");return this.getData().count()>this.getProgressiveThreshold()?this.id:t.get("show")&&e>0?e+"":""},e.type="series.lines",e.dependencies=["grid","polar","geo","calendar"],e.defaultOption={coordinateSystem:"geo",z:2,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,clip:!0,label:{show:!1,position:"end"},lineStyle:{opacity:.5}},e}(hg);function EP(t){return t instanceof Array||(t=[t,t]),t}var zP={seriesType:"lines",reset:function(t){var e=EP(t.get("symbol")),n=EP(t.get("symbolSize")),i=t.getData();return i.setVisual("fromSymbol",e&&e[0]),i.setVisual("toSymbol",e&&e[1]),i.setVisual("fromSymbolSize",n&&n[0]),i.setVisual("toSymbolSize",n&&n[1]),{dataEach:i.hasItemOption?function(t,e){var n=t.getItemModel(e),i=EP(n.getShallow("symbol",!0)),r=EP(n.getShallow("symbolSize",!0));i[0]&&t.setItemVisual(e,"fromSymbol",i[0]),i[1]&&t.setItemVisual(e,"toSymbol",i[1]),r[0]&&t.setItemVisual(e,"fromSymbolSize",r[0]),r[1]&&t.setItemVisual(e,"toSymbolSize",r[1])}:null}}};var VP=function(){function t(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var t=h.createCanvas();this.canvas=t}return t.prototype.update=function(t,e,n,i,r,o){var a=this._getBrush(),s=this._getGradient(r,"inRange"),l=this._getGradient(r,"outOfRange"),u=this.pointSize+this.blurSize,h=this.canvas,c=h.getContext("2d"),p=t.length;h.width=e,h.height=n;for(var d=0;d0){var I=o(v)?s:l;v>0&&(v=v*S+w),x[_++]=I[M],x[_++]=I[M+1],x[_++]=I[M+2],x[_++]=I[M+3]*v*256}else _+=4}return c.putImageData(m,0,0),h},t.prototype._getBrush=function(){var t=this._brushCanvas||(this._brushCanvas=h.createCanvas()),e=this.pointSize+this.blurSize,n=2*e;t.width=n,t.height=n;var i=t.getContext("2d");return i.clearRect(0,0,n,n),i.shadowOffsetX=n,i.shadowBlur=this.blurSize,i.shadowColor="#000",i.beginPath(),i.arc(-e,e,this.pointSize,0,2*Math.PI,!0),i.closePath(),i.fill(),t},t.prototype._getGradient=function(t,e){for(var n=this._gradientPixels,i=n[e]||(n[e]=new Uint8ClampedArray(1024)),r=[0,0,0,0],o=0,a=0;a<256;a++)t[e](a/255,!0,r),i[o++]=r[0],i[o++]=r[1],i[o++]=r[2],i[o++]=r[3];return i},t}();function BP(t){var e=t.dimensions;return"lng"===e[0]&&"lat"===e[1]}var FP=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.render=function(t,e,n){var i;e.eachComponent("visualMap",(function(e){e.eachTargetSeries((function(n){n===t&&(i=e)}))})),this._progressiveEls=null,this.group.removeAll();var r=t.coordinateSystem;"cartesian2d"===r.type||"calendar"===r.type?this._renderOnCartesianAndCalendar(t,n,0,t.getData().count()):BP(r)&&this._renderOnGeo(r,t,i,n)},e.prototype.incrementalPrepareRender=function(t,e,n){this.group.removeAll()},e.prototype.incrementalRender=function(t,e,n,i){var r=e.coordinateSystem;r&&(BP(r)?this.render(e,n,i):(this._progressiveEls=[],this._renderOnCartesianAndCalendar(e,i,t.start,t.end,!0)))},e.prototype.eachRendered=function(t){Yh(this._progressiveEls||this.group,t)},e.prototype._renderOnCartesianAndCalendar=function(t,e,n,i,r){var o,a,s,l,u=t.coordinateSystem,h=pS(u,"cartesian2d");if(h){var c=u.getAxis("x"),p=u.getAxis("y");0,o=c.getBandWidth()+.5,a=p.getBandWidth()+.5,s=c.scale.getExtent(),l=p.scale.getExtent()}for(var d=this.group,f=t.getData(),g=t.getModel(["emphasis","itemStyle"]).getItemStyle(),y=t.getModel(["blur","itemStyle"]).getItemStyle(),v=t.getModel(["select","itemStyle"]).getItemStyle(),m=t.get(["itemStyle","borderRadius"]),x=Kh(t),_=t.getModel("emphasis"),b=_.get("focus"),w=_.get("blurScope"),S=_.get("disabled"),M=h?[f.mapDimension("x"),f.mapDimension("y"),f.mapDimension("value")]:[f.mapDimension("time"),f.mapDimension("value")],I=n;Is[1]||Al[1])continue;var k=u.dataToPoint([D,A]);T=new Ps({shape:{x:k[0]-o/2,y:k[1]-a/2,width:o,height:a},style:C})}else{if(isNaN(f.get(M[1],I)))continue;T=new Ps({z2:1,shape:u.dataToRect([f.get(M[0],I)]).contentShape,style:C})}if(f.hasItemOption){var L=f.getItemModel(I),P=L.getModel("emphasis");g=P.getModel("itemStyle").getItemStyle(),y=L.getModel(["blur","itemStyle"]).getItemStyle(),v=L.getModel(["select","itemStyle"]).getItemStyle(),m=L.get(["itemStyle","borderRadius"]),b=P.get("focus"),w=P.get("blurScope"),S=P.get("disabled"),x=Kh(L)}T.shape.r=m;var O=t.getRawValue(I),R="-";O&&null!=O[2]&&(R=O[2]+""),qh(T,x,{labelFetcher:t,labelDataIndex:I,defaultOpacity:C.opacity,defaultText:R}),T.ensureState("emphasis").style=g,T.ensureState("blur").style=y,T.ensureState("select").style=v,Bl(T,b,w,S),T.incremental=r,r&&(T.states.emphasis.hoverLayer=!0),d.add(T),f.setItemGraphicEl(I,T),this._progressiveEls&&this._progressiveEls.push(T)}},e.prototype._renderOnGeo=function(t,e,n,i){var r=n.targetVisuals.inRange,o=n.targetVisuals.outOfRange,a=e.getData(),s=this._hmLayer||this._hmLayer||new VP;s.blurSize=e.get("blurSize"),s.pointSize=e.get("pointSize"),s.minOpacity=e.get("minOpacity"),s.maxOpacity=e.get("maxOpacity");var l=t.getViewRect().clone(),u=t.getRoamTransform();l.applyTransform(u);var h=Math.max(l.x,0),c=Math.max(l.y,0),p=Math.min(l.width+l.x,i.getWidth()),d=Math.min(l.height+l.y,i.getHeight()),f=p-h,g=d-c,y=[a.mapDimension("lng"),a.mapDimension("lat"),a.mapDimension("value")],v=a.mapArray(y,(function(e,n,i){var r=t.dataToPoint([e,n]);return r[0]-=h,r[1]-=c,r.push(i),r})),m=n.getExtent(),x="visualMap.continuous"===n.type?function(t,e){var n=t[1]-t[0];return e=[(e[0]-t[0])/n,(e[1]-t[0])/n],function(t){return t>=e[0]&&t<=e[1]}}(m,n.option.range):function(t,e,n){var i=t[1]-t[0],r=(e=z(e,(function(e){return{interval:[(e.interval[0]-t[0])/i,(e.interval[1]-t[0])/i]}}))).length,o=0;return function(t){var i;for(i=o;i=0;i--){var a;if((a=e[i].interval)[0]<=t&&t<=a[1]){o=i;break}}return i>=0&&i0?1:-1}(n,o,r,i,c),function(t,e,n,i,r,o,a,s,l,u){var h,c=l.valueDim,p=l.categoryDim,d=Math.abs(n[p.wh]),f=t.getItemVisual(e,"symbolSize");h=Y(f)?f.slice():null==f?["100%","100%"]:[f,f];h[p.index]=Gr(h[p.index],d),h[c.index]=Gr(h[c.index],i?d:Math.abs(o)),u.symbolSize=h,(u.symbolScale=[h[0]/s,h[1]/s])[c.index]*=(l.isHorizontal?-1:1)*a}(t,e,r,o,0,c.boundingLength,c.pxSign,u,i,c),function(t,e,n,i,r){var o=t.get(WP)||0;o&&(YP.attr({scaleX:e[0],scaleY:e[1],rotation:n}),YP.updateTransform(),o/=YP.getLineScale(),o*=e[i.valueDim.index]);r.valueLineWidth=o||0}(n,c.symbolScale,l,i,c);var p=c.symbolSize,d=Ey(n.get("symbolOffset"),p);return function(t,e,n,i,r,o,a,s,l,u,h,c){var p=h.categoryDim,d=h.valueDim,f=c.pxSign,g=Math.max(e[d.index]+s,0),y=g;if(i){var v=Math.abs(l),m=it(t.get("symbolMargin"),"15%")+"",x=!1;m.lastIndexOf("!")===m.length-1&&(x=!0,m=m.slice(0,m.length-1));var _=Gr(m,e[d.index]),b=Math.max(g+2*_,0),w=x?0:2*_,S=ao(i),M=S?i:lO((v+w)/b);b=g+2*(_=(v-M*g)/2/(x?M:Math.max(M-1,1))),w=x?0:2*_,S||"fixed"===i||(M=u?lO((Math.abs(u)+w)/b):0),y=M*b-w,c.repeatTimes=M,c.symbolMargin=_}var I=f*(y/2),T=c.pathPosition=[];T[p.index]=n[p.wh]/2,T[d.index]="start"===a?I:"end"===a?l-I:l/2,o&&(T[0]+=o[0],T[1]+=o[1]);var C=c.bundlePosition=[];C[p.index]=n[p.xy],C[d.index]=n[d.xy];var D=c.barRectShape=A({},n);D[d.wh]=f*Math.max(Math.abs(n[d.wh]),Math.abs(T[d.index]+I)),D[p.wh]=n[p.wh];var k=c.clipShape={};k[p.xy]=-n[p.xy],k[p.wh]=h.ecSize[p.wh],k[d.xy]=0,k[d.wh]=n[d.wh]}(n,p,r,o,0,d,s,c.valueLineWidth,c.boundingLength,c.repeatCutLength,i,c),c}function ZP(t,e){return t.toGlobalCoord(t.dataToCoord(t.scale.parse(e)))}function jP(t){var e=t.symbolPatternSize,n=Ry(t.symbolType,-e/2,-e/2,e,e);return n.attr({culling:!0}),"image"!==n.type&&n.setStyle({strokeNoScale:!0}),n}function qP(t,e,n,i){var r=t.__pictorialBundle,o=n.symbolSize,a=n.valueLineWidth,s=n.pathPosition,l=e.valueDim,u=n.repeatTimes||0,h=0,c=o[e.valueDim.index]+a+2*n.symbolMargin;for(oO(t,(function(t){t.__pictorialAnimationIndex=h,t.__pictorialRepeatTimes=u,h0:i<0)&&(r=u-1-t),e[l.index]=c*(r-u/2+.5)+s[l.index],{x:e[0],y:e[1],scaleX:n.symbolScale[0],scaleY:n.symbolScale[1],rotation:n.rotation}}}function KP(t,e,n,i){var r=t.__pictorialBundle,o=t.__pictorialMainPath;o?aO(o,null,{x:n.pathPosition[0],y:n.pathPosition[1],scaleX:n.symbolScale[0],scaleY:n.symbolScale[1],rotation:n.rotation},n,i):(o=t.__pictorialMainPath=jP(n),r.add(o),aO(o,{x:n.pathPosition[0],y:n.pathPosition[1],scaleX:0,scaleY:0,rotation:n.rotation},{scaleX:n.symbolScale[0],scaleY:n.symbolScale[1]},n,i))}function $P(t,e,n){var i=A({},e.barRectShape),r=t.__pictorialBarRect;r?aO(r,null,{shape:i},e,n):((r=t.__pictorialBarRect=new Ps({z2:2,shape:i,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}})).disableMorphing=!0,t.add(r))}function JP(t,e,n,i){if(n.symbolClip){var r=t.__pictorialClipPath,o=A({},n.clipShape),a=e.valueDim,s=n.animationModel,l=n.dataIndex;if(r)uh(r,{shape:o},s,l);else{o[a.wh]=0,r=new Ps({shape:o}),t.__pictorialBundle.setClipPath(r),t.__pictorialClipPath=r;var u={};u[a.wh]=n.clipShape[a.wh],Uh[i?"updateProps":"initProps"](r,{shape:u},s,l)}}}function QP(t,e){var n=t.getItemModel(e);return n.getAnimationDelayParams=tO,n.isAnimationEnabled=eO,n}function tO(t){return{index:t.__pictorialAnimationIndex,count:t.__pictorialRepeatTimes}}function eO(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function nO(t,e,n,i){var r=new Pr,o=new Pr;return r.add(o),r.__pictorialBundle=o,o.x=n.bundlePosition[0],o.y=n.bundlePosition[1],n.symbolRepeat?qP(r,e,n):KP(r,0,n),$P(r,n,i),JP(r,e,n,i),r.__pictorialShapeStr=rO(t,n),r.__pictorialSymbolMeta=n,r}function iO(t,e,n,i){var r=i.__pictorialBarRect;r&&r.removeTextContent();var o=[];oO(i,(function(t){o.push(t)})),i.__pictorialMainPath&&o.push(i.__pictorialMainPath),i.__pictorialClipPath&&(n=null),E(o,(function(t){ph(t,{scaleX:0,scaleY:0},n,e,(function(){i.parent&&i.parent.remove(i)}))})),t.setItemGraphicEl(e,null)}function rO(t,e){return[t.getItemVisual(e.dataIndex,"symbol")||"none",!!e.symbolRepeat,!!e.symbolClip].join(":")}function oO(t,e,n){E(t.__pictorialBundle.children(),(function(i){i!==t.__pictorialBarRect&&e.call(n,i)}))}function aO(t,e,n,i,r,o){e&&t.attr(e),i.symbolClip&&!r?n&&t.attr(n):n&&Uh[r?"updateProps":"initProps"](t,n,i.animationModel,i.dataIndex,o)}function sO(t,e,n){var i=n.dataIndex,r=n.itemModel,o=r.getModel("emphasis"),a=o.getModel("itemStyle").getItemStyle(),s=r.getModel(["blur","itemStyle"]).getItemStyle(),l=r.getModel(["select","itemStyle"]).getItemStyle(),u=r.getShallow("cursor"),h=o.get("focus"),c=o.get("blurScope"),p=o.get("scale");oO(t,(function(t){if(t instanceof Is){var e=t.style;t.useStyle(A({image:e.image,x:e.x,y:e.y,width:e.width,height:e.height},n.style))}else t.useStyle(n.style);var i=t.ensureState("emphasis");i.style=a,p&&(i.scaleX=1.1*t.scaleX,i.scaleY=1.1*t.scaleY),t.ensureState("blur").style=s,t.ensureState("select").style=l,u&&(t.cursor=u),t.z2=n.z2}));var d=e.valueDim.posDesc[+(n.boundingLength>0)];qh(t.__pictorialBarRect,Kh(r),{labelFetcher:e.seriesModel,labelDataIndex:i,defaultText:Uw(e.seriesModel.getData(),i),inheritColor:n.style.fill,defaultOpacity:n.style.opacity,defaultOutsidePosition:d}),Bl(t,h,c,o.get("disabled"))}function lO(t){var e=Math.round(t);return Math.abs(t-e)<1e-4?e:Math.ceil(t)}var uO=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.hasSymbolVisual=!0,n.defaultSymbol="roundRect",n}return n(e,t),e.prototype.getInitialData=function(e){return e.stack=null,t.prototype.getInitialData.apply(this,arguments)},e.type="series.pictorialBar",e.dependencies=["grid"],e.defaultOption=wc(DS.defaultOption,{symbol:"circle",symbolSize:null,symbolRotate:null,symbolPosition:null,symbolOffset:null,symbolMargin:null,symbolRepeat:!1,symbolRepeatDirection:"end",symbolClip:!1,symbolBoundingData:null,symbolPatternSize:400,barGap:"-100%",progressive:0,emphasis:{scale:!1},select:{itemStyle:{borderColor:"#212121"}}}),e}(DS);var hO=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._layers=[],n}return n(e,t),e.prototype.render=function(t,e,n){var i=t.getData(),r=this,o=this.group,a=t.getLayerSeries(),s=i.getLayout("layoutInfo"),l=s.rect,u=s.boundaryGap;function h(t){return t.name}o.x=0,o.y=l.y+u[0];var c=new Dm(this._layersSeries||[],a,h,h),p=[];function d(e,n,s){var l=r._layers;if("remove"!==e){for(var u,h,c=[],d=[],f=a[n].indices,g=0;go&&(o=s),i.push(s)}for(var u=0;uo&&(o=c)}return{y0:r,max:o}}(l),h=u.y0,c=n/u.max,p=o.length,d=o[0].indices.length,f=0;fMath.PI/2?"right":"left"):S&&"center"!==S?"left"===S?(m=r.r0+w,a>Math.PI/2&&(S="right")):"right"===S&&(m=r.r-w,a>Math.PI/2&&(S="left")):(m=o===2*Math.PI&&0===r.r0?0:(r.r+r.r0)/2,S="center"),g.style.align=S,g.style.verticalAlign=f(p,"verticalAlign")||"middle",g.x=m*s+r.cx,g.y=m*l+r.cy;var M=f(p,"rotate"),I=0;"radial"===M?(I=-a)<-Math.PI/2&&(I+=Math.PI):"tangential"===M?(I=Math.PI/2-a)>Math.PI/2?I-=Math.PI:I<-Math.PI/2&&(I+=Math.PI):j(M)&&(I=M*Math.PI/180),g.rotation=I})),h.dirtyStyle()},e}(Pu),gO="sunburstRootToNode",yO="sunburstHighlight";var vO=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.render=function(t,e,n,i){var r=this;this.seriesModel=t,this.api=n,this.ecModel=e;var o=t.getData(),a=o.tree.root,s=t.getViewRoot(),l=this.group,u=t.get("renderLabelForZeroData"),h=[];s.eachNode((function(t){h.push(t)}));var c=this._oldChildren||[];!function(i,r){if(0===i.length&&0===r.length)return;function s(t){return t.getId()}function h(s,h){!function(i,r){u||!i||i.getValue()||(i=null);if(i!==a&&r!==a)if(r&&r.piece)i?(r.piece.updateData(!1,i,t,e,n),o.setItemGraphicEl(i.dataIndex,r.piece)):function(t){if(!t)return;t.piece&&(l.remove(t.piece),t.piece=null)}(r);else if(i){var s=new fO(i,t,e,n);l.add(s),o.setItemGraphicEl(i.dataIndex,s)}}(null==s?null:i[s],null==h?null:r[h])}new Dm(r,i,s,s).add(h).update(h).remove(H(h,null)).execute()}(h,c),function(i,o){o.depth>0?(r.virtualPiece?r.virtualPiece.updateData(!1,i,t,e,n):(r.virtualPiece=new fO(i,t,e,n),l.add(r.virtualPiece)),o.piece.off("click"),r.virtualPiece.on("click",(function(t){r._rootToNode(o.parentNode)}))):r.virtualPiece&&(l.remove(r.virtualPiece),r.virtualPiece=null)}(a,s),this._initEvents(),this._oldChildren=h},e.prototype._initEvents=function(){var t=this;this.group.off("click"),this.group.on("click",(function(e){var n=!1;t.seriesModel.getViewRoot().eachNode((function(i){if(!n&&i.piece&&i.piece===e.target){var r=i.getModel().get("nodeClick");if("rootToNode"===r)t._rootToNode(i);else if("link"===r){var o=i.getModel(),a=o.get("link");if(a)yp(a,o.get("target",!0)||"_blank")}n=!0}}))}))},e.prototype._rootToNode=function(t){t!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:gO,from:this.uid,seriesId:this.seriesModel.id,targetNode:t})},e.prototype.containPoint=function(t,e){var n=e.getData().getItemLayout(0);if(n){var i=t[0]-n.cx,r=t[1]-n.cy,o=Math.sqrt(i*i+r*r);return o<=n.r&&o>=n.r0}},e.type="sunburst",e}(wg),mO=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.ignoreStyleOnData=!0,n}return n(e,t),e.prototype.getInitialData=function(t,e){var n={name:t.name,children:t.data};xO(n);var i=this._levelModels=z(t.levels||[],(function(t){return new xc(t,this,e)}),this),r=OC.createTree(n,this,(function(t){t.wrapMethod("getItemModel",(function(t,e){var n=r.getNodeByDataIndex(e),o=i[n.depth];return o&&(t.parentModel=o),t}))}));return r.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},e.prototype.getDataParams=function(e){var n=t.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(e);return n.treePathInfo=zC(i,this),n},e.prototype.getLevelModel=function(t){return this._levelModels&&this._levelModels[t.depth]},e.prototype.getViewRoot=function(){return this._viewRoot},e.prototype.resetViewRoot=function(t){t?this._viewRoot=t:t=this._viewRoot;var e=this.getRawData().tree.root;t&&(t===e||e.contains(t))||(this._viewRoot=e)},e.prototype.enableAriaDecal=function(){HC(this)},e.type="series.sunburst",e.defaultOption={z:2,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,stillShowZeroSum:!0,nodeClick:"rootToNode",renderLabelForZeroData:!1,label:{rotate:"radial",show:!0,opacity:1,align:"center",position:"inside",distance:5,silent:!0},itemStyle:{borderWidth:1,borderColor:"white",borderType:"solid",shadowBlur:0,shadowColor:"rgba(0, 0, 0, 0.2)",shadowOffsetX:0,shadowOffsetY:0,opacity:1},emphasis:{focus:"descendant"},blur:{itemStyle:{opacity:.2},label:{opacity:.1}},animationType:"expansion",animationDuration:1e3,animationDurationUpdate:500,data:[],sort:"desc"},e}(hg);function xO(t){var e=0;E(t.children,(function(t){xO(t);var n=t.value;Y(n)&&(n=n[0]),e+=n}));var n=t.value;Y(n)&&(n=n[0]),(null==n||isNaN(n))&&(n=e),n<0&&(n=0),Y(t.value)?t.value[0]=n:t.value=n}var _O=Math.PI/180;function bO(t,e,n){e.eachSeriesByType(t,(function(t){var e=t.get("center"),i=t.get("radius");Y(i)||(i=[0,i]),Y(e)||(e=[e,e]);var r=n.getWidth(),o=n.getHeight(),a=Math.min(r,o),s=Gr(e[0],r),l=Gr(e[1],o),u=Gr(i[0],a/2),h=Gr(i[1],a/2),c=-t.get("startAngle")*_O,p=t.get("minAngle")*_O,d=t.getData().tree.root,f=t.getViewRoot(),g=f.depth,y=t.get("sort");null!=y&&wO(f,y);var v=0;E(f.children,(function(t){!isNaN(t.getValue())&&v++}));var m=f.getValue(),x=Math.PI/(m||v)*2,_=f.depth>0,b=f.height-(_?-1:1),w=(h-u)/(b||1),S=t.get("clockwise"),M=t.get("stillShowZeroSum"),I=S?1:-1,T=function(e,n){if(e){var i=n;if(e!==d){var r=e.getValue(),o=0===m&&M?x:r*x;o1;)r=r.parentNode;var o=n.getColorFromPalette(r.name||r.dataIndex+"",e);return t.depth>1&&X(o)&&(o=jn(o,(t.depth-1)/(i-1)*.5)),o}(r,t,i.root.height)),A(n.ensureUniqueItemVisual(r.dataIndex,"style"),o)}))}))}var MO={color:"fill",borderColor:"stroke"},IO={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},TO=Do(),CO=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.optionUpdated=function(){this.currentZLevel=this.get("zlevel",!0),this.currentZ=this.get("z",!0)},e.prototype.getInitialData=function(t,e){return sx(null,this)},e.prototype.getDataParams=function(e,n,i){var r=t.prototype.getDataParams.call(this,e,n);return i&&(r.info=TO(i).info),r},e.type="series.custom",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,clip:!1},e}(hg);function DO(t,e){return e=e||[0,0],z(["x","y"],(function(n,i){var r=this.getAxis(n),o=e[i],a=t[i]/2;return"category"===r.type?r.getBandWidth():Math.abs(r.dataToCoord(o-a)-r.dataToCoord(o+a))}),this)}function AO(t,e){return e=e||[0,0],z([0,1],(function(n){var i=e[n],r=t[n]/2,o=[],a=[];return o[n]=i-r,a[n]=i+r,o[1-n]=a[1-n]=e[1-n],Math.abs(this.dataToPoint(o)[n]-this.dataToPoint(a)[n])}),this)}function kO(t,e){var n=this.getAxis(),i=e instanceof Array?e[0]:e,r=(t instanceof Array?t[0]:t)/2;return"category"===n.type?n.getBandWidth():Math.abs(n.dataToCoord(i-r)-n.dataToCoord(i+r))}function LO(t,e){return e=e||[0,0],z(["Radius","Angle"],(function(n,i){var r=this["get"+n+"Axis"](),o=e[i],a=t[i]/2,s="category"===r.type?r.getBandWidth():Math.abs(r.dataToCoord(o-a)-r.dataToCoord(o+a));return"Angle"===n&&(s=s*Math.PI/180),s}),this)}function PO(t,e,n,i){return t&&(t.legacy||!1!==t.legacy&&!n&&!i&&"tspan"!==e&&("text"===e||mt(t,"text")))}function OO(t,e,n){var i,r,o,a=t;if("text"===e)o=a;else{o={},mt(a,"text")&&(o.text=a.text),mt(a,"rich")&&(o.rich=a.rich),mt(a,"textFill")&&(o.fill=a.textFill),mt(a,"textStroke")&&(o.stroke=a.textStroke),mt(a,"fontFamily")&&(o.fontFamily=a.fontFamily),mt(a,"fontSize")&&(o.fontSize=a.fontSize),mt(a,"fontStyle")&&(o.fontStyle=a.fontStyle),mt(a,"fontWeight")&&(o.fontWeight=a.fontWeight),r={type:"text",style:o,silent:!0},i={};var s=mt(a,"textPosition");n?i.position=s?a.textPosition:"inside":s&&(i.position=a.textPosition),mt(a,"textPosition")&&(i.position=a.textPosition),mt(a,"textOffset")&&(i.offset=a.textOffset),mt(a,"textRotation")&&(i.rotation=a.textRotation),mt(a,"textDistance")&&(i.distance=a.textDistance)}return RO(o,t),E(o.rich,(function(t){RO(t,t)})),{textConfig:i,textContent:r}}function RO(t,e){e&&(e.font=e.textFont||e.font,mt(e,"textStrokeWidth")&&(t.lineWidth=e.textStrokeWidth),mt(e,"textAlign")&&(t.align=e.textAlign),mt(e,"textVerticalAlign")&&(t.verticalAlign=e.textVerticalAlign),mt(e,"textLineHeight")&&(t.lineHeight=e.textLineHeight),mt(e,"textWidth")&&(t.width=e.textWidth),mt(e,"textHeight")&&(t.height=e.textHeight),mt(e,"textBackgroundColor")&&(t.backgroundColor=e.textBackgroundColor),mt(e,"textPadding")&&(t.padding=e.textPadding),mt(e,"textBorderColor")&&(t.borderColor=e.textBorderColor),mt(e,"textBorderWidth")&&(t.borderWidth=e.textBorderWidth),mt(e,"textBorderRadius")&&(t.borderRadius=e.textBorderRadius),mt(e,"textBoxShadowColor")&&(t.shadowColor=e.textBoxShadowColor),mt(e,"textBoxShadowBlur")&&(t.shadowBlur=e.textBoxShadowBlur),mt(e,"textBoxShadowOffsetX")&&(t.shadowOffsetX=e.textBoxShadowOffsetX),mt(e,"textBoxShadowOffsetY")&&(t.shadowOffsetY=e.textBoxShadowOffsetY))}function NO(t,e,n){var i=t;i.textPosition=i.textPosition||n.position||"inside",null!=n.offset&&(i.textOffset=n.offset),null!=n.rotation&&(i.textRotation=n.rotation),null!=n.distance&&(i.textDistance=n.distance);var r=i.textPosition.indexOf("inside")>=0,o=t.fill||"#000";EO(i,e);var a=null==i.textFill;return r?a&&(i.textFill=n.insideFill||"#fff",!i.textStroke&&n.insideStroke&&(i.textStroke=n.insideStroke),!i.textStroke&&(i.textStroke=o),null==i.textStrokeWidth&&(i.textStrokeWidth=2)):(a&&(i.textFill=t.fill||n.outsideFill||"#000"),!i.textStroke&&n.outsideStroke&&(i.textStroke=n.outsideStroke)),i.text=e.text,i.rich=e.rich,E(e.rich,(function(t){EO(t,t)})),i}function EO(t,e){e&&(mt(e,"fill")&&(t.textFill=e.fill),mt(e,"stroke")&&(t.textStroke=e.fill),mt(e,"lineWidth")&&(t.textStrokeWidth=e.lineWidth),mt(e,"font")&&(t.font=e.font),mt(e,"fontStyle")&&(t.fontStyle=e.fontStyle),mt(e,"fontWeight")&&(t.fontWeight=e.fontWeight),mt(e,"fontSize")&&(t.fontSize=e.fontSize),mt(e,"fontFamily")&&(t.fontFamily=e.fontFamily),mt(e,"align")&&(t.textAlign=e.align),mt(e,"verticalAlign")&&(t.textVerticalAlign=e.verticalAlign),mt(e,"lineHeight")&&(t.textLineHeight=e.lineHeight),mt(e,"width")&&(t.textWidth=e.width),mt(e,"height")&&(t.textHeight=e.height),mt(e,"backgroundColor")&&(t.textBackgroundColor=e.backgroundColor),mt(e,"padding")&&(t.textPadding=e.padding),mt(e,"borderColor")&&(t.textBorderColor=e.borderColor),mt(e,"borderWidth")&&(t.textBorderWidth=e.borderWidth),mt(e,"borderRadius")&&(t.textBorderRadius=e.borderRadius),mt(e,"shadowColor")&&(t.textBoxShadowColor=e.shadowColor),mt(e,"shadowBlur")&&(t.textBoxShadowBlur=e.shadowBlur),mt(e,"shadowOffsetX")&&(t.textBoxShadowOffsetX=e.shadowOffsetX),mt(e,"shadowOffsetY")&&(t.textBoxShadowOffsetY=e.shadowOffsetY),mt(e,"textShadowColor")&&(t.textShadowColor=e.textShadowColor),mt(e,"textShadowBlur")&&(t.textShadowBlur=e.textShadowBlur),mt(e,"textShadowOffsetX")&&(t.textShadowOffsetX=e.textShadowOffsetX),mt(e,"textShadowOffsetY")&&(t.textShadowOffsetY=e.textShadowOffsetY))}var zO={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},VO=G(zO),BO=(V(cr,(function(t,e){return t[e]=1,t}),{}),cr.join(", "),["","style","shape","extra"]),FO=Do();function GO(t,e,n,i,r){var o=t+"Animation",a=sh(t,i,r)||{},s=FO(e).userDuring;return a.duration>0&&(a.during=s?W(jO,{el:e,userDuring:s}):null,a.setToFinal=!0,a.scope=t),A(a,n[o]),a}function WO(t,e,n,i){var r=(i=i||{}).dataIndex,o=i.isInit,a=i.clearStyle,s=n.isAnimationEnabled(),l=FO(t),u=e.style;l.userDuring=e.during;var h={},c={};if(function(t,e,n){for(var i=0;i=0)){var c=t.getAnimationStyleProps(),p=c?c.style:null;if(p){!r&&(r=i.style={});var d=G(n);for(u=0;u0&&t.animateFrom(p,d)}else!function(t,e,n,i,r){if(r){var o=GO("update",t,e,i,n);o.duration>0&&t.animateFrom(r,o)}}(t,e,r||0,n,h);HO(t,e),u?t.dirty():t.markRedraw()}function HO(t,e){for(var n=FO(t).leaveToProps,i=0;i=0){!o&&(o=i[t]={});var p=G(a);for(h=0;hi[1]&&i.reverse(),{coordSys:{type:"polar",cx:t.cx,cy:t.cy,r:i[1],r0:i[0]},api:{coord:function(i){var r=e.dataToRadius(i[0]),o=n.dataToAngle(i[1]),a=t.coordToPoint([r,o]);return a.push(r,o*Math.PI/180),a},size:W(LO,t)}}},calendar:function(t){var e=t.getRect(),n=t.getRangeInfo();return{coordSys:{type:"calendar",x:e.x,y:e.y,width:e.width,height:e.height,cellWidth:t.getCellWidth(),cellHeight:t.getCellHeight(),rangeInfo:{start:n.start,end:n.end,weeks:n.weeks,dayCount:n.allDay}},api:{coord:function(e,n){return t.dataToPoint(e,n)}}}}};function pR(t){return t instanceof _s}function dR(t){return t instanceof ma}var fR=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.render=function(t,e,n,i){this._progressiveEls=null;var r=this._data,o=t.getData(),a=this.group,s=xR(t,o,e,n);r||a.removeAll(),o.diff(r).add((function(e){bR(n,null,e,s(e,i),t,a,o)})).remove((function(e){var n=r.getItemGraphicEl(e);n&&YO(n,TO(n).option,t)})).update((function(e,l){var u=r.getItemGraphicEl(l);bR(n,u,e,s(e,i),t,a,o)})).execute();var l=t.get("clip",!0)?cS(t.coordinateSystem,!1,t):null;l?a.setClipPath(l):a.removeClipPath(),this._data=o},e.prototype.incrementalPrepareRender=function(t,e,n){this.group.removeAll(),this._data=null},e.prototype.incrementalRender=function(t,e,n,i,r){var o=e.getData(),a=xR(e,o,n,i),s=this._progressiveEls=[];function l(t){t.isGroup||(t.incremental=!0,t.ensureState("emphasis").hoverLayer=!0)}for(var u=t.start;u=0?e.getStore().get(r,n):void 0}var o=e.get(i.name,n),a=i&&i.ordinalMeta;return a?a.categories[o]:o},styleEmphasis:function(n,i){0;null==i&&(i=s);var r=m(i,nR).getItemStyle(),o=x(i,nR),a=$h(o,null,null,!0,!0);a.text=o.getShallow("show")?ot(t.getFormattedLabel(i,nR),t.getFormattedLabel(i,iR),Uw(e,i)):null;var l=Jh(o,null,!0);return b(n,r),r=NO(r,a,l),n&&_(r,n),r.legacy=!0,r},visual:function(t,n){if(null==n&&(n=s),mt(MO,t)){var i=e.getItemVisual(n,"style");return i?i[MO[t]]:null}if(mt(IO,t))return e.getItemVisual(n,t)},barLayout:function(t){if("cartesian2d"===o.type){return function(t){var e=[],n=t.axis,i="axis0";if("category"===n.type){for(var r=n.getBandWidth(),o=0;o=c;f--){var g=e.childAt(f);CR(e,g,r)}}(t,c,n,i,r),a>=0?o.replaceAt(c,a):o.add(c),c}function SR(t,e,n){var i,r=TO(t),o=e.type,a=e.shape,s=e.style;return n.isUniversalTransitionEnabled()||null!=o&&o!==r.customGraphicType||"path"===o&&((i=a)&&(mt(i,"pathData")||mt(i,"d")))&&LR(a)!==r.customPathData||"image"===o&&mt(s,"image")&&s.image!==r.customImagePath}function MR(t,e,n){var i=e?IR(t,e):t,r=e?TR(t,i,nR):t.style,o=t.type,a=i?i.textConfig:null,s=t.textContent,l=s?e?IR(s,e):s:null;if(r&&(n.isLegacy||PO(r,o,!!a,!!l))){n.isLegacy=!0;var u=OO(r,o,!e);!a&&u.textConfig&&(a=u.textConfig),!l&&u.textContent&&(l=u.textContent)}if(!e&&l){var h=l;!h.type&&(h.type="text")}var c=e?n[e]:n.normal;c.cfg=a,c.conOpt=l}function IR(t,e){return e?t?t[e]:null:t}function TR(t,e,n){var i=e&&e.style;return null==i&&n===nR&&t&&(i=t.styleEmphasis),i}function CR(t,e,n){e&&YO(e,TO(t).option,n)}function DR(t,e){var n=t&&t.name;return null!=n?n:"e\0\0"+e}function AR(t,e){var n=this.context,i=null!=t?n.newChildren[t]:null,r=null!=e?n.oldChildren[e]:null;wR(n.api,r,n.dataIndex,i,n.seriesModel,n.group)}function kR(t){var e=this.context,n=e.oldChildren[t];n&&YO(n,TO(n).option,e.seriesModel)}function LR(t){return t&&(t.pathData||t.d)}var PR=Do(),OR=T,RR=W,NR=function(){function t(){this._dragging=!1,this.animationThreshold=15}return t.prototype.render=function(t,e,n,i){var r=e.get("value"),o=e.get("status");if(this._axisModel=t,this._axisPointerModel=e,this._api=n,i||this._lastValue!==r||this._lastStatus!==o){this._lastValue=r,this._lastStatus=o;var a=this._group,s=this._handle;if(!o||"hide"===o)return a&&a.hide(),void(s&&s.hide());a&&a.show(),s&&s.show();var l={};this.makeElOption(l,r,t,e,n);var u=l.graphicKey;u!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=u;var h=this._moveAnimation=this.determineAnimation(t,e);if(a){var c=H(ER,e,h);this.updatePointerEl(a,l,c),this.updateLabelEl(a,l,c,e)}else a=this._group=new Pr,this.createPointerEl(a,l,t,e),this.createLabelEl(a,l,t,e),n.getZr().add(a);FR(a,e,!0),this._renderHandle(r)}},t.prototype.remove=function(t){this.clear(t)},t.prototype.dispose=function(t){this.clear(t)},t.prototype.determineAnimation=function(t,e){var n=e.get("animation"),i=t.axis,r="category"===i.type,o=e.get("snap");if(!o&&!r)return!1;if("auto"===n||null==n){var a=this.animationThreshold;if(r&&i.getBandWidth()>a)return!0;if(o){var s=QM(t).seriesDataCount,l=i.getExtent();return Math.abs(l[0]-l[1])/s>a}return!1}return!0===n},t.prototype.makeElOption=function(t,e,n,i,r){},t.prototype.createPointerEl=function(t,e,n,i){var r=e.pointer;if(r){var o=PR(t).pointerEl=new Uh[r.type](OR(e.pointer));t.add(o)}},t.prototype.createLabelEl=function(t,e,n,i){if(e.label){var r=PR(t).labelEl=new Ns(OR(e.label));t.add(r),VR(r,i)}},t.prototype.updatePointerEl=function(t,e,n){var i=PR(t).pointerEl;i&&e.pointer&&(i.setStyle(e.pointer.style),n(i,{shape:e.pointer.shape}))},t.prototype.updateLabelEl=function(t,e,n,i){var r=PR(t).labelEl;r&&(r.setStyle(e.label.style),n(r,{x:e.label.x,y:e.label.y}),VR(r,i))},t.prototype._renderHandle=function(t){if(!this._dragging&&this.updateHandleTransform){var e,n=this._axisPointerModel,i=this._api.getZr(),r=this._handle,o=n.getModel("handle"),a=n.get("status");if(!o.get("show")||!a||"hide"===a)return r&&i.remove(r),void(this._handle=null);this._handle||(e=!0,r=this._handle=Vh(o.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(t){he(t.event)},onmousedown:RR(this._onHandleDragMove,this,0,0),drift:RR(this._onHandleDragMove,this),ondragend:RR(this._onHandleDragEnd,this)}),i.add(r)),FR(r,n,!1),r.setStyle(o.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var s=o.get("size");Y(s)||(s=[s,s]),r.scaleX=s[0]/2,r.scaleY=s[1]/2,Pg(this,"_doDispatchAxisPointer",o.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,e)}},t.prototype._moveHandleToValue=function(t,e){ER(this._axisPointerModel,!e&&this._moveAnimation,this._handle,BR(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},t.prototype._onHandleDragMove=function(t,e){var n=this._handle;if(n){this._dragging=!0;var i=this.updateHandleTransform(BR(n),[t,e],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr(BR(i)),PR(n).lastProp=null,this._doDispatchAxisPointer()}},t.prototype._doDispatchAxisPointer=function(){if(this._handle){var t=this._payloadInfo,e=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:t.cursorPoint[0],y:t.cursorPoint[1],tooltipOption:t.tooltipOption,axesInfo:[{axisDim:e.axis.dim,axisIndex:e.componentIndex}]})}},t.prototype._onHandleDragEnd=function(){if(this._dragging=!1,this._handle){var t=this._axisPointerModel.get("value");this._moveHandleToValue(t),this._api.dispatchAction({type:"hideTip"})}},t.prototype.clear=function(t){this._lastValue=null,this._lastStatus=null;var e=t.getZr(),n=this._group,i=this._handle;e&&n&&(this._lastGraphicKey=null,n&&e.remove(n),i&&e.remove(i),this._group=null,this._handle=null,this._payloadInfo=null),Og(this,"_doDispatchAxisPointer")},t.prototype.doClear=function(){},t.prototype.buildLabel=function(t,e,n){return{x:t[n=n||0],y:t[1-n],width:e[n],height:e[1-n]}},t}();function ER(t,e,n,i){zR(PR(n).lastProp,i)||(PR(n).lastProp=i,e?uh(n,i,t):(n.stopAnimation(),n.attr(i)))}function zR(t,e){if(q(t)&&q(e)){var n=!0;return E(e,(function(e,i){n=n&&zR(t[i],e)})),!!n}return t===e}function VR(t,e){t[e.get(["label","show"])?"show":"hide"]()}function BR(t){return{x:t.x||0,y:t.y||0,rotation:t.rotation||0}}function FR(t,e,n){var i=e.get("z"),r=e.get("zlevel");t&&t.traverse((function(t){"group"!==t.type&&(null!=i&&(t.z=i),null!=r&&(t.zlevel=r),t.silent=n)}))}function GR(t){var e,n=t.get("type"),i=t.getModel(n+"Style");return"line"===n?(e=i.getLineStyle()).fill=null:"shadow"===n&&((e=i.getAreaStyle()).stroke=null),e}function WR(t,e,n,i,r){var o=HR(n.get("value"),e.axis,e.ecModel,n.get("seriesDataIndices"),{precision:n.get(["label","precision"]),formatter:n.get(["label","formatter"])}),a=n.getModel("label"),s=up(a.get("padding")||0),l=a.getFont(),u=yr(o,l),h=r.position,c=u.width+s[1]+s[3],p=u.height+s[0]+s[2],d=r.align;"right"===d&&(h[0]-=c),"center"===d&&(h[0]-=c/2);var f=r.verticalAlign;"bottom"===f&&(h[1]-=p),"middle"===f&&(h[1]-=p/2),function(t,e,n,i){var r=i.getWidth(),o=i.getHeight();t[0]=Math.min(t[0]+e,r)-e,t[1]=Math.min(t[1]+n,o)-n,t[0]=Math.max(t[0],0),t[1]=Math.max(t[1],0)}(h,c,p,i);var g=a.get("backgroundColor");g&&"auto"!==g||(g=e.get(["axisLine","lineStyle","color"])),t.label={x:h[0],y:h[1],style:$h(a,{text:o,font:l,fill:a.getTextColor(),padding:s,backgroundColor:g}),z2:10}}function HR(t,e,n,i,r){t=e.scale.parse(t);var o=e.scale.getLabel({value:t},{precision:r.precision}),a=r.formatter;if(a){var s={value:h_(e,{value:t}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]};E(i,(function(t){var e=n.getSeriesByIndex(t.seriesIndex),i=t.dataIndexInside,r=e&&e.getDataParams(i);r&&s.seriesData.push(r)})),X(a)?o=a.replace("{value}",o):U(a)&&(o=a(s))}return o}function YR(t,e,n){var i=[1,0,0,1,0,0];return _e(i,i,n.rotation),xe(i,i,n.position),Ph([t.dataToCoord(e),(n.labelOffset||0)+(n.labelDirection||1)*(n.labelMargin||0)],i)}function UR(t,e,n,i,r,o){var a=YM.innerTextLayout(n.rotation,0,n.labelDirection);n.labelMargin=r.get(["label","margin"]),WR(e,i,r,o,{position:YR(i.axis,t,n),align:a.textAlign,verticalAlign:a.textVerticalAlign})}function XR(t,e,n){return{x1:t[n=n||0],y1:t[1-n],x2:e[n],y2:e[1-n]}}function ZR(t,e,n){return{x:t[n=n||0],y:t[1-n],width:e[n],height:e[1-n]}}function jR(t,e,n,i,r,o){return{cx:t,cy:e,r0:n,r:i,startAngle:r,endAngle:o,clockwise:!0}}var qR=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.makeElOption=function(t,e,n,i,r){var o=n.axis,a=o.grid,s=i.get("type"),l=KR(a,o).getOtherAxis(o).getGlobalExtent(),u=o.toGlobalCoord(o.dataToCoord(e,!0));if(s&&"none"!==s){var h=GR(i),c=$R[s](o,u,l);c.style=h,t.graphicKey=c.type,t.pointer=c}UR(e,t,RM(a.model,n),n,i,r)},e.prototype.getHandleTransform=function(t,e,n){var i=RM(e.axis.grid.model,e,{labelInside:!1});i.labelMargin=n.get(["handle","margin"]);var r=YR(e.axis,t,i);return{x:r[0],y:r[1],rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(t,e,n,i){var r=n.axis,o=r.grid,a=r.getGlobalExtent(!0),s=KR(o,r).getOtherAxis(r).getGlobalExtent(),l="x"===r.dim?0:1,u=[t.x,t.y];u[l]+=e[l],u[l]=Math.min(a[1],u[l]),u[l]=Math.max(a[0],u[l]);var h=(s[1]+s[0])/2,c=[h,h];c[l]=u[l];return{x:u[0],y:u[1],rotation:t.rotation,cursorPoint:c,tooltipOption:[{verticalAlign:"middle"},{align:"center"}][l]}},e}(NR);function KR(t,e){var n={};return n[e.dim+"AxisIndex"]=e.index,t.getCartesian(n)}var $R={line:function(t,e,n){return{type:"Line",subPixelOptimize:!0,shape:XR([e,n[0]],[e,n[1]],JR(t))}},shadow:function(t,e,n){var i=Math.max(1,t.getBandWidth()),r=n[1]-n[0];return{type:"Rect",shape:ZR([e-i/2,n[0]],[i,r],JR(t))}}};function JR(t){return"x"===t.dim?0:1}var QR=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.type="axisPointer",e.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}},e}(Ap),tN=Do(),eN=E;function nN(t,e,n){if(!r.node){var i=e.getZr();tN(i).records||(tN(i).records={}),function(t,e){if(tN(t).initialized)return;function n(n,i){t.on(n,(function(n){var r=function(t){var e={showTip:[],hideTip:[]},n=function(i){var r=e[i.type];r?r.push(i):(i.dispatchAction=n,t.dispatchAction(i))};return{dispatchAction:n,pendings:e}}(e);eN(tN(t).records,(function(t){t&&i(t,n,r.dispatchAction)})),function(t,e){var n,i=t.showTip.length,r=t.hideTip.length;i?n=t.showTip[i-1]:r&&(n=t.hideTip[r-1]);n&&(n.dispatchAction=null,e.dispatchAction(n))}(r.pendings,e)}))}tN(t).initialized=!0,n("click",H(rN,"click")),n("mousemove",H(rN,"mousemove")),n("globalout",iN)}(i,e),(tN(i).records[t]||(tN(i).records[t]={})).handler=n}}function iN(t,e,n){t.handler("leave",null,n)}function rN(t,e,n,i){e.handler(t,n,i)}function oN(t,e){if(!r.node){var n=e.getZr();(tN(n).records||{})[t]&&(tN(n).records[t]=null)}}var aN=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.render=function(t,e,n){var i=e.getComponent("tooltip"),r=t.get("triggerOn")||i&&i.get("triggerOn")||"mousemove|click";nN("axisPointer",n,(function(t,e,n){"none"!==r&&("leave"===t||r.indexOf(t)>=0)&&n({type:"updateAxisPointer",currTrigger:t,x:e&&e.offsetX,y:e&&e.offsetY})}))},e.prototype.remove=function(t,e){oN("axisPointer",e)},e.prototype.dispose=function(t,e){oN("axisPointer",e)},e.type="axisPointer",e}(mg);function sN(t,e){var n,i=[],r=t.seriesIndex;if(null==r||!(n=e.getSeriesByIndex(r)))return{point:[]};var o=n.getData(),a=Co(o,t);if(null==a||a<0||Y(a))return{point:[]};var s=o.getItemGraphicEl(a),l=n.coordinateSystem;if(n.getTooltipPosition)i=n.getTooltipPosition(a)||[];else if(l&&l.dataToPoint)if(t.isStacked){var u=l.getBaseAxis(),h=l.getOtherAxis(u).dim,c=u.dim,p="x"===h||"radius"===h?1:0,d=o.mapDimension(c),f=[];f[p]=o.get(d,a),f[1-p]=o.get(o.getCalculationInfo("stackResultDimension"),a),i=l.dataToPoint(f)||[]}else i=l.dataToPoint(o.getValues(z(l.dimensions,(function(t){return o.mapDimension(t)})),a))||[];else if(s){var g=s.getBoundingRect().clone();g.applyTransform(s.transform),i=[g.x+g.width/2,g.y+g.height/2]}return{point:i,el:s}}var lN=Do();function uN(t,e,n){var i=t.currTrigger,r=[t.x,t.y],o=t,a=t.dispatchAction||W(n.dispatchAction,n),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){fN(r)&&(r=sN({seriesIndex:o.seriesIndex,dataIndex:o.dataIndex},e).point);var l=fN(r),u=o.axesInfo,h=s.axesInfo,c="leave"===i||fN(r),p={},d={},f={list:[],map:{}},g={showPointer:H(cN,d),showTooltip:H(pN,f)};E(s.coordSysMap,(function(t,e){var n=l||t.containPoint(r);E(s.coordSysAxesInfo[e],(function(t,e){var i=t.axis,o=function(t,e){for(var n=0;n<(t||[]).length;n++){var i=t[n];if(e.axis.dim===i.axisDim&&e.axis.model.componentIndex===i.axisIndex)return i}}(u,t);if(!c&&n&&(!u||o)){var a=o&&o.value;null!=a||l||(a=i.pointToData(r)),null!=a&&hN(t,a,g,!1,p)}}))}));var y={};return E(h,(function(t,e){var n=t.linkGroup;n&&!d[e]&&E(n.axesInfo,(function(e,i){var r=d[i];if(e!==t&&r){var o=r.value;n.mapper&&(o=t.axis.scale.parse(n.mapper(o,dN(e),dN(t)))),y[t.key]=o}}))})),E(y,(function(t,e){hN(h[e],t,g,!0,p)})),function(t,e,n){var i=n.axesInfo=[];E(e,(function(e,n){var r=e.axisPointerModel.option,o=t[n];o?(!e.useHandle&&(r.status="show"),r.value=o.value,r.seriesDataIndices=(o.payloadBatch||[]).slice()):!e.useHandle&&(r.status="hide"),"show"===r.status&&i.push({axisDim:e.axis.dim,axisIndex:e.axis.model.componentIndex,value:r.value})}))}(d,h,p),function(t,e,n,i){if(fN(e)||!t.list.length)return void i({type:"hideTip"});var r=((t.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};i({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:n.tooltipOption,position:n.position,dataIndexInside:r.dataIndexInside,dataIndex:r.dataIndex,seriesIndex:r.seriesIndex,dataByCoordSys:t.list})}(f,r,t,a),function(t,e,n){var i=n.getZr(),r="axisPointerLastHighlights",o=lN(i)[r]||{},a=lN(i)[r]={};E(t,(function(t,e){var n=t.axisPointerModel.option;"show"===n.status&&E(n.seriesDataIndices,(function(t){var e=t.seriesIndex+" | "+t.dataIndex;a[e]=t}))}));var s=[],l=[];E(o,(function(t,e){!a[e]&&l.push(t)})),E(a,(function(t,e){!o[e]&&s.push(t)})),l.length&&n.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&n.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}(h,0,n),p}}function hN(t,e,n,i,r){var o=t.axis;if(!o.scale.isBlank()&&o.containData(e))if(t.involveSeries){var a=function(t,e){var n=e.axis,i=n.dim,r=t,o=[],a=Number.MAX_VALUE,s=-1;return E(e.seriesModels,(function(e,l){var u,h,c=e.getData().mapDimensionsAll(i);if(e.getAxisTooltipData){var p=e.getAxisTooltipData(c,t,n);h=p.dataIndices,u=p.nestestValue}else{if(!(h=e.getData().indicesOfNearest(c[0],t,"category"===n.type?.5:null)).length)return;u=e.getData().get(c[0],h[0])}if(null!=u&&isFinite(u)){var d=t-u,f=Math.abs(d);f<=a&&((f=0&&s<0)&&(a=f,s=d,r=u,o.length=0),E(h,(function(t){o.push({seriesIndex:e.seriesIndex,dataIndexInside:t,dataIndex:e.getData().getRawIndex(t)})})))}})),{payloadBatch:o,snapToValue:r}}(e,t),s=a.payloadBatch,l=a.snapToValue;s[0]&&null==r.seriesIndex&&A(r,s[0]),!i&&t.snap&&o.containData(l)&&null!=l&&(e=l),n.showPointer(t,e,s),n.showTooltip(t,a,l)}else n.showPointer(t,e)}function cN(t,e,n,i){t[e.key]={value:n,payloadBatch:i}}function pN(t,e,n,i){var r=n.payloadBatch,o=e.axis,a=o.model,s=e.axisPointerModel;if(e.triggerTooltip&&r.length){var l=e.coordSys.model,u=eI(l),h=t.map[u];h||(h=t.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},t.list.push(h)),h.dataByAxis.push({axisDim:o.dim,axisIndex:a.componentIndex,axisType:a.type,axisId:a.id,value:i,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:r.slice()})}}function dN(t){var e=t.axis.model,n={},i=n.axisDim=t.axis.dim;return n.axisIndex=n[i+"AxisIndex"]=e.componentIndex,n.axisName=n[i+"AxisName"]=e.name,n.axisId=n[i+"AxisId"]=e.id,n}function fN(t){return!t||null==t[0]||isNaN(t[0])||null==t[1]||isNaN(t[1])}function gN(t){iI.registerAxisPointerClass("CartesianAxisPointer",qR),t.registerComponentModel(QR),t.registerComponentView(aN),t.registerPreprocessor((function(t){if(t){(!t.axisPointer||0===t.axisPointer.length)&&(t.axisPointer={});var e=t.axisPointer.link;e&&!Y(e)&&(t.axisPointer.link=[e])}})),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,(function(t,e){t.getComponent("axisPointer").coordSysAxesInfo=KM(t,e)})),t.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},uN)}var yN=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.makeElOption=function(t,e,n,i,r){var o=n.axis;"angle"===o.dim&&(this.animationThreshold=Math.PI/18);var a=o.polar,s=a.getOtherAxis(o).getExtent(),l=o.dataToCoord(e),u=i.get("type");if(u&&"none"!==u){var h=GR(i),c=vN[u](o,a,l,s);c.style=h,t.graphicKey=c.type,t.pointer=c}var p=function(t,e,n,i,r){var o=e.axis,a=o.dataToCoord(t),s=i.getAngleAxis().getExtent()[0];s=s/180*Math.PI;var l,u,h,c=i.getRadiusAxis().getExtent();if("radius"===o.dim){var p=[1,0,0,1,0,0];_e(p,p,s),xe(p,p,[i.cx,i.cy]),l=Ph([a,-r],p);var d=e.getModel("axisLabel").get("rotate")||0,f=YM.innerTextLayout(s,d*Math.PI/180,-1);u=f.textAlign,h=f.textVerticalAlign}else{var g=c[1];l=i.coordToPoint([g+r,a]);var y=i.cx,v=i.cy;u=Math.abs(l[0]-y)/g<.3?"center":l[0]>y?"left":"right",h=Math.abs(l[1]-v)/g<.3?"middle":l[1]>v?"top":"bottom"}return{position:l,align:u,verticalAlign:h}}(e,n,0,a,i.get(["label","margin"]));WR(t,n,i,r,p)},e}(NR);var vN={line:function(t,e,n,i){return"angle"===t.dim?{type:"Line",shape:XR(e.coordToPoint([i[0],n]),e.coordToPoint([i[1],n]))}:{type:"Circle",shape:{cx:e.cx,cy:e.cy,r:n}}},shadow:function(t,e,n,i){var r=Math.max(1,t.getBandWidth()),o=Math.PI/180;return"angle"===t.dim?{type:"Sector",shape:jR(e.cx,e.cy,i[0],i[1],(-n-r/2)*o,(r/2-n)*o)}:{type:"Sector",shape:jR(e.cx,e.cy,n-r/2,n+r/2,0,2*Math.PI)}}},mN=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.findAxisModel=function(t){var e;return this.ecModel.eachComponent(t,(function(t){t.getCoordSysModel()===this&&(e=t)}),this),e},e.type="polar",e.dependencies=["radiusAxis","angleAxis"],e.defaultOption={z:0,center:["50%","50%"],radius:"80%"},e}(Ap),xN=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.getCoordSysModel=function(){return this.getReferringComponents("polar",Po).models[0]},e.type="polarAxis",e}(Ap);R(xN,g_);var _N=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.type="angleAxis",e}(xN),bN=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.type="radiusAxis",e}(xN),wN=function(t){function e(e,n){return t.call(this,"radius",e,n)||this}return n(e,t),e.prototype.pointToData=function(t,e){return this.polar.pointToData(t,e)["radius"===this.dim?0:1]},e}(X_);wN.prototype.dataToRadius=X_.prototype.dataToCoord,wN.prototype.radiusToData=X_.prototype.coordToData;var SN=Do(),MN=function(t){function e(e,n){return t.call(this,"angle",e,n||[0,360])||this}return n(e,t),e.prototype.pointToData=function(t,e){return this.polar.pointToData(t,e)["radius"===this.dim?0:1]},e.prototype.calculateCategoryInterval=function(){var t=this,e=t.getLabelModel(),n=t.scale,i=n.getExtent(),r=n.count();if(i[1]-i[0]<1)return 0;var o=i[0],a=t.dataToCoord(o+1)-t.dataToCoord(o),s=Math.abs(a),l=yr(null==o?"":o+"",e.getFont(),"center","top"),u=Math.max(l.height,7)/s;isNaN(u)&&(u=1/0);var h=Math.max(0,Math.floor(u)),c=SN(t.model),p=c.lastAutoInterval,d=c.lastTickCount;return null!=p&&null!=d&&Math.abs(p-h)<=1&&Math.abs(d-r)<=1&&p>h?h=p:(c.lastTickCount=r,c.lastAutoInterval=h),h},e}(X_);MN.prototype.dataToAngle=X_.prototype.dataToCoord,MN.prototype.angleToData=X_.prototype.coordToData;var IN=["radius","angle"],TN=function(){function t(t){this.dimensions=IN,this.type="polar",this.cx=0,this.cy=0,this._radiusAxis=new wN,this._angleAxis=new MN,this.axisPointerEnabled=!0,this.name=t||"",this._radiusAxis.polar=this._angleAxis.polar=this}return t.prototype.containPoint=function(t){var e=this.pointToCoord(t);return this._radiusAxis.contain(e[0])&&this._angleAxis.contain(e[1])},t.prototype.containData=function(t){return this._radiusAxis.containData(t[0])&&this._angleAxis.containData(t[1])},t.prototype.getAxis=function(t){return this["_"+t+"Axis"]},t.prototype.getAxes=function(){return[this._radiusAxis,this._angleAxis]},t.prototype.getAxesByScale=function(t){var e=[],n=this._angleAxis,i=this._radiusAxis;return n.scale.type===t&&e.push(n),i.scale.type===t&&e.push(i),e},t.prototype.getAngleAxis=function(){return this._angleAxis},t.prototype.getRadiusAxis=function(){return this._radiusAxis},t.prototype.getOtherAxis=function(t){var e=this._angleAxis;return t===e?this._radiusAxis:e},t.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},t.prototype.getTooltipAxes=function(t){var e=null!=t&&"auto"!==t?this.getAxis(t):this.getBaseAxis();return{baseAxes:[e],otherAxes:[this.getOtherAxis(e)]}},t.prototype.dataToPoint=function(t,e){return this.coordToPoint([this._radiusAxis.dataToRadius(t[0],e),this._angleAxis.dataToAngle(t[1],e)])},t.prototype.pointToData=function(t,e){var n=this.pointToCoord(t);return[this._radiusAxis.radiusToData(n[0],e),this._angleAxis.angleToData(n[1],e)]},t.prototype.pointToCoord=function(t){var e=t[0]-this.cx,n=t[1]-this.cy,i=this.getAngleAxis(),r=i.getExtent(),o=Math.min(r[0],r[1]),a=Math.max(r[0],r[1]);i.inverse?o=a-360:a=o+360;var s=Math.sqrt(e*e+n*n);e/=s,n/=s;for(var l=Math.atan2(-n,e)/Math.PI*180,u=la;)l+=360*u;return[s,l]},t.prototype.coordToPoint=function(t){var e=t[0],n=t[1]/180*Math.PI;return[Math.cos(n)*e+this.cx,-Math.sin(n)*e+this.cy]},t.prototype.getArea=function(){var t=this.getAngleAxis(),e=this.getRadiusAxis().getExtent().slice();e[0]>e[1]&&e.reverse();var n=t.getExtent(),i=Math.PI/180;return{cx:this.cx,cy:this.cy,r0:e[0],r:e[1],startAngle:-n[0]*i,endAngle:-n[1]*i,clockwise:t.inverse,contain:function(t,e){var n=t-this.cx,i=e-this.cy,r=n*n+i*i-1e-4,o=this.r,a=this.r0;return r<=o*o&&r>=a*a}}},t.prototype.convertToPixel=function(t,e,n){return CN(e)===this?this.dataToPoint(n):null},t.prototype.convertFromPixel=function(t,e,n){return CN(e)===this?this.pointToData(n):null},t}();function CN(t){var e=t.seriesModel,n=t.polarModel;return n&&n.coordinateSystem||e&&e.coordinateSystem}function DN(t,e){var n=this,i=n.getAngleAxis(),r=n.getRadiusAxis();if(i.scale.setExtent(1/0,-1/0),r.scale.setExtent(1/0,-1/0),t.eachSeries((function(t){if(t.coordinateSystem===n){var e=t.getData();E(f_(e,"radius"),(function(t){r.scale.unionExtentFromData(e,t)})),E(f_(e,"angle"),(function(t){i.scale.unionExtentFromData(e,t)}))}})),s_(i.scale,i.model),s_(r.scale,r.model),"category"===i.type&&!i.onBand){var o=i.getExtent(),a=360/i.scale.count();i.inverse?o[1]+=a:o[1]-=a,i.setExtent(o[0],o[1])}}function AN(t,e){if(t.type=e.get("type"),t.scale=l_(e),t.onBand=e.get("boundaryGap")&&"category"===t.type,t.inverse=e.get("inverse"),function(t){return"angleAxis"===t.mainType}(e)){t.inverse=t.inverse!==e.get("clockwise");var n=e.get("startAngle");t.setExtent(n,n+(t.inverse?-360:360))}e.axis=t,t.model=e}var kN={dimensions:IN,create:function(t,e){var n=[];return t.eachComponent("polar",(function(t,i){var r=new TN(i+"");r.update=DN;var o=r.getRadiusAxis(),a=r.getAngleAxis(),s=t.findAxisModel("radiusAxis"),l=t.findAxisModel("angleAxis");AN(o,s),AN(a,l),function(t,e,n){var i=e.get("center"),r=n.getWidth(),o=n.getHeight();t.cx=Gr(i[0],r),t.cy=Gr(i[1],o);var a=t.getRadiusAxis(),s=Math.min(r,o)/2,l=e.get("radius");null==l?l=[0,"100%"]:Y(l)||(l=[0,l]);var u=[Gr(l[0],s),Gr(l[1],s)];a.inverse?a.setExtent(u[1],u[0]):a.setExtent(u[0],u[1])}(r,t,e),n.push(r),t.coordinateSystem=r,r.model=t})),t.eachSeries((function(t){if("polar"===t.get("coordinateSystem")){var e=t.getReferringComponents("polar",Po).models[0];0,t.coordinateSystem=e.coordinateSystem}})),n}},LN=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function PN(t,e,n){e[1]>e[0]&&(e=e.slice().reverse());var i=t.coordToPoint([e[0],n]),r=t.coordToPoint([e[1],n]);return{x1:i[0],y1:i[1],x2:r[0],y2:r[1]}}function ON(t){return t.getRadiusAxis().inverse?0:1}function RN(t){var e=t[0],n=t[t.length-1];e&&n&&Math.abs(Math.abs(e.coord-n.coord)-360)<1e-4&&t.pop()}var NN=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.axisPointerClass="PolarAxisPointer",n}return n(e,t),e.prototype.render=function(t,e){if(this.group.removeAll(),t.get("show")){var n=t.axis,i=n.polar,r=i.getRadiusAxis().getExtent(),o=n.getTicksCoords(),a=n.getMinorTicksCoords(),s=z(n.getViewLabels(),(function(t){t=T(t);var e=n.scale,i="ordinal"===e.type?e.getRawOrdinalNumber(t.tickValue):t.tickValue;return t.coord=n.dataToCoord(i),t}));RN(s),RN(o),E(LN,(function(e){!t.get([e,"show"])||n.scale.isBlank()&&"axisLine"!==e||EN[e](this.group,t,i,o,a,r,s)}),this)}},e.type="angleAxis",e}(iI),EN={axisLine:function(t,e,n,i,r,o){var a,s=e.getModel(["axisLine","lineStyle"]),l=ON(n),u=l?0:1;(a=0===o[u]?new gu({shape:{cx:n.cx,cy:n.cy,r:o[l]},style:s.getLineStyle(),z2:1,silent:!0}):new Ru({shape:{cx:n.cx,cy:n.cy,r:o[l],r0:o[u]},style:s.getLineStyle(),z2:1,silent:!0})).style.fill=null,t.add(a)},axisTick:function(t,e,n,i,r,o){var a=e.getModel("axisTick"),s=(a.get("inside")?-1:1)*a.get("length"),l=o[ON(n)],u=z(i,(function(t){return new Wu({shape:PN(n,[l,l+s],t.coord)})}));t.add(Ch(u,{style:k(a.getModel("lineStyle").getLineStyle(),{stroke:e.get(["axisLine","lineStyle","color"])})}))},minorTick:function(t,e,n,i,r,o){if(r.length){for(var a=e.getModel("axisTick"),s=e.getModel("minorTick"),l=(a.get("inside")?-1:1)*s.get("length"),u=o[ON(n)],h=[],c=0;cf?"left":"right",v=Math.abs(d[1]-g)/p<.3?"middle":d[1]>g?"top":"bottom";if(s&&s[c]){var m=s[c];q(m)&&m.textStyle&&(a=new xc(m.textStyle,l,l.ecModel))}var x=new Ns({silent:YM.isLabelSilent(e),style:$h(a,{x:d[0],y:d[1],fill:a.getTextColor()||e.get(["axisLine","lineStyle","color"]),text:i.formattedLabel,align:y,verticalAlign:v})});if(t.add(x),h){var _=YM.makeAxisEventDataBase(e);_.targetType="axisLabel",_.value=i.rawLabel,js(x).eventData=_}}),this)},splitLine:function(t,e,n,i,r,o){var a=e.getModel("splitLine").getModel("lineStyle"),s=a.get("color"),l=0;s=s instanceof Array?s:[s];for(var u=[],h=0;h=0?"p":"n",T=_;m&&(i[s][M]||(i[s][M]={p:_,n:_}),T=i[s][M][I]);var C=void 0,D=void 0,A=void 0,k=void 0;if("radius"===c.dim){var L=c.dataToCoord(S)-_,P=o.dataToCoord(M);Math.abs(L)=k})}}}))}var YN={startAngle:90,clockwise:!0,splitNumber:12,axisLabel:{rotate:0}},UN={splitNumber:5},XN=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.type="polar",e}(mg);function ZN(t,e){e=e||{};var n=t.coordinateSystem,i=t.axis,r={},o=i.position,a=i.orient,s=n.getRect(),l=[s.x,s.x+s.width,s.y,s.y+s.height],u={horizontal:{top:l[2],bottom:l[3]},vertical:{left:l[0],right:l[1]}};r.position=["vertical"===a?u.vertical[o]:l[0],"horizontal"===a?u.horizontal[o]:l[3]];r.rotation=Math.PI/2*{horizontal:0,vertical:1}[a];r.labelDirection=r.tickDirection=r.nameDirection={top:-1,bottom:1,right:1,left:-1}[o],t.get(["axisTick","inside"])&&(r.tickDirection=-r.tickDirection),it(e.labelInside,t.get(["axisLabel","inside"]))&&(r.labelDirection=-r.labelDirection);var h=e.rotate;return null==h&&(h=t.get(["axisLabel","rotate"])),r.labelRotation="top"===o?-h:h,r.z2=1,r}var jN=["axisLine","axisTickLabel","axisName"],qN=["splitArea","splitLine"],KN=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.axisPointerClass="SingleAxisPointer",n}return n(e,t),e.prototype.render=function(e,n,i,r){var o=this.group;o.removeAll();var a=this._axisGroup;this._axisGroup=new Pr;var s=ZN(e),l=new YM(e,s);E(jN,l.add,l),o.add(this._axisGroup),o.add(l.getGroup()),E(qN,(function(t){e.get([t,"show"])&&$N[t](this,this.group,this._axisGroup,e)}),this),Nh(a,this._axisGroup,e),t.prototype.render.call(this,e,n,i,r)},e.prototype.remove=function(){aI(this)},e.type="singleAxis",e}(iI),$N={splitLine:function(t,e,n,i){var r=i.axis;if(!r.scale.isBlank()){var o=i.getModel("splitLine"),a=o.getModel("lineStyle"),s=a.get("color");s=s instanceof Array?s:[s];for(var l=a.get("width"),u=i.coordinateSystem.getRect(),h=r.isHorizontal(),c=[],p=0,d=r.getTicksCoords({tickModel:o}),f=[],g=[],y=0;y=e.y&&t[1]<=e.y+e.height:n.contain(n.toLocalCoord(t[1]))&&t[0]>=e.y&&t[0]<=e.y+e.height},t.prototype.pointToData=function(t){var e=this.getAxis();return[e.coordToData(e.toLocalCoord(t["horizontal"===e.orient?0:1]))]},t.prototype.dataToPoint=function(t){var e=this.getAxis(),n=this.getRect(),i=[],r="horizontal"===e.orient?0:1;return t instanceof Array&&(t=t[0]),i[r]=e.toGlobalCoord(e.dataToCoord(+t)),i[1-r]=0===r?n.y+n.height/2:n.x+n.width/2,i},t.prototype.convertToPixel=function(t,e,n){return nE(e)===this?this.dataToPoint(n):null},t.prototype.convertFromPixel=function(t,e,n){return nE(e)===this?this.pointToData(n):null},t}();function nE(t){var e=t.seriesModel,n=t.singleAxisModel;return n&&n.coordinateSystem||e&&e.coordinateSystem}var iE={create:function(t,e){var n=[];return t.eachComponent("singleAxis",(function(i,r){var o=new eE(i,t,e);o.name="single_"+r,o.resize(i,e),i.coordinateSystem=o,n.push(o)})),t.eachSeries((function(t){if("singleAxis"===t.get("coordinateSystem")){var e=t.getReferringComponents("singleAxis",Po).models[0];t.coordinateSystem=e&&e.coordinateSystem}})),n},dimensions:tE},rE=["x","y"],oE=["width","height"],aE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.makeElOption=function(t,e,n,i,r){var o=n.axis,a=o.coordinateSystem,s=uE(a,1-lE(o)),l=a.dataToPoint(e)[0],u=i.get("type");if(u&&"none"!==u){var h=GR(i),c=sE[u](o,l,s);c.style=h,t.graphicKey=c.type,t.pointer=c}UR(e,t,ZN(n),n,i,r)},e.prototype.getHandleTransform=function(t,e,n){var i=ZN(e,{labelInside:!1});i.labelMargin=n.get(["handle","margin"]);var r=YR(e.axis,t,i);return{x:r[0],y:r[1],rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(t,e,n,i){var r=n.axis,o=r.coordinateSystem,a=lE(r),s=uE(o,a),l=[t.x,t.y];l[a]+=e[a],l[a]=Math.min(s[1],l[a]),l[a]=Math.max(s[0],l[a]);var u=uE(o,1-a),h=(u[1]+u[0])/2,c=[h,h];return c[a]=l[a],{x:l[0],y:l[1],rotation:t.rotation,cursorPoint:c,tooltipOption:{verticalAlign:"middle"}}},e}(NR),sE={line:function(t,e,n){return{type:"Line",subPixelOptimize:!0,shape:XR([e,n[0]],[e,n[1]],lE(t))}},shadow:function(t,e,n){var i=t.getBandWidth(),r=n[1]-n[0];return{type:"Rect",shape:ZR([e-i/2,n[0]],[i,r],lE(t))}}};function lE(t){return t.isHorizontal()?0:1}function uE(t,e){var n=t.getRect();return[n[rE[e]],n[rE[e]]+n[oE[e]]]}var hE=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.type="single",e}(mg);var cE=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.init=function(e,n,i){var r=Tp(e);t.prototype.init.apply(this,arguments),pE(e,r)},e.prototype.mergeOption=function(e){t.prototype.mergeOption.apply(this,arguments),pE(this.option,e)},e.prototype.getCellSize=function(){return this.option.cellSize},e.type="calendar",e.defaultOption={z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:"#000",width:1,type:"solid"}},itemStyle:{color:"#fff",borderWidth:1,borderColor:"#ccc"},dayLabel:{show:!0,firstDay:0,position:"start",margin:"50%",color:"#000"},monthLabel:{show:!0,position:"start",margin:5,align:"center",formatter:null,color:"#000"},yearLabel:{show:!0,position:null,margin:30,formatter:null,color:"#ccc",fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},e}(Ap);function pE(t,e){var n,i=t.cellSize;1===(n=Y(i)?i:t.cellSize=[i,i]).length&&(n[1]=n[0]);var r=z([0,1],(function(t){return function(t,e){return null!=t[xp[e][0]]||null!=t[xp[e][1]]&&null!=t[xp[e][2]]}(e,t)&&(n[t]="auto"),null!=n[t]&&"auto"!==n[t]}));Ip(t,e,{type:"box",ignoreSize:r})}var dE=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.render=function(t,e,n){var i=this.group;i.removeAll();var r=t.coordinateSystem,o=r.getRangeInfo(),a=r.getOrient(),s=e.getLocaleModel();this._renderDayRect(t,o,i),this._renderLines(t,o,a,i),this._renderYearText(t,o,a,i),this._renderMonthText(t,s,a,i),this._renderWeekText(t,s,o,a,i)},e.prototype._renderDayRect=function(t,e,n){for(var i=t.coordinateSystem,r=t.getModel("itemStyle").getItemStyle(),o=i.getCellWidth(),a=i.getCellHeight(),s=e.start.time;s<=e.end.time;s=i.getNextNDay(s,1).time){var l=i.dataToRect([s],!1).tl,u=new Ps({shape:{x:l[0],y:l[1],width:o,height:a},cursor:"default",style:r});n.add(u)}},e.prototype._renderLines=function(t,e,n,i){var r=this,o=t.coordinateSystem,a=t.getModel(["splitLine","lineStyle"]).getLineStyle(),s=t.get(["splitLine","show"]),l=a.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var u=e.start,h=0;u.time<=e.end.time;h++){p(u.formatedDate),0===h&&(u=o.getDateInfo(e.start.y+"-"+e.start.m));var c=u.date;c.setMonth(c.getMonth()+1),u=o.getDateInfo(c)}function p(e){r._firstDayOfMonth.push(o.getDateInfo(e)),r._firstDayPoints.push(o.dataToRect([e],!1).tl);var l=r._getLinePointsOfOneWeek(t,e,n);r._tlpoints.push(l[0]),r._blpoints.push(l[l.length-1]),s&&r._drawSplitline(l,a,i)}p(o.getNextNDay(e.end.time,1).formatedDate),s&&this._drawSplitline(r._getEdgesPoints(r._tlpoints,l,n),a,i),s&&this._drawSplitline(r._getEdgesPoints(r._blpoints,l,n),a,i)},e.prototype._getEdgesPoints=function(t,e,n){var i=[t[0].slice(),t[t.length-1].slice()],r="horizontal"===n?0:1;return i[0][r]=i[0][r]-e/2,i[1][r]=i[1][r]+e/2,i},e.prototype._drawSplitline=function(t,e,n){var i=new Bu({z2:20,shape:{points:t},style:e});n.add(i)},e.prototype._getLinePointsOfOneWeek=function(t,e,n){for(var i=t.coordinateSystem,r=i.getDateInfo(e),o=[],a=0;a<7;a++){var s=i.getNextNDay(r.time,a),l=i.dataToRect([s.time],!1);o[2*s.day]=l.tl,o[2*s.day+1]=l["horizontal"===n?"bl":"tr"]}return o},e.prototype._formatterLabel=function(t,e){return X(t)&&t?(n=t,E(e,(function(t,e){n=n.replace("{"+e+"}",i?ee(t):t)})),n):U(t)?t(e):e.nameMap;var n,i},e.prototype._yearTextPositionControl=function(t,e,n,i,r){var o=e[0],a=e[1],s=["center","bottom"];"bottom"===i?(a+=r,s=["center","top"]):"left"===i?o-=r:"right"===i?(o+=r,s=["center","top"]):a-=r;var l=0;return"left"!==i&&"right"!==i||(l=Math.PI/2),{rotation:l,x:o,y:a,style:{align:s[0],verticalAlign:s[1]}}},e.prototype._renderYearText=function(t,e,n,i){var r=t.getModel("yearLabel");if(r.get("show")){var o=r.get("margin"),a=r.get("position");a||(a="horizontal"!==n?"top":"left");var s=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],l=(s[0][0]+s[1][0])/2,u=(s[0][1]+s[1][1])/2,h="horizontal"===n?0:1,c={top:[l,s[h][1]],bottom:[l,s[1-h][1]],left:[s[1-h][0],u],right:[s[h][0],u]},p=e.start.y;+e.end.y>+e.start.y&&(p=p+"-"+e.end.y);var d=r.get("formatter"),f={start:e.start.y,end:e.end.y,nameMap:p},g=this._formatterLabel(d,f),y=new Ns({z2:30,style:$h(r,{text:g})});y.attr(this._yearTextPositionControl(y,c[a],n,a,o)),i.add(y)}},e.prototype._monthTextPositionControl=function(t,e,n,i,r){var o="left",a="top",s=t[0],l=t[1];return"horizontal"===n?(l+=r,e&&(o="center"),"start"===i&&(a="bottom")):(s+=r,e&&(a="middle"),"start"===i&&(o="right")),{x:s,y:l,align:o,verticalAlign:a}},e.prototype._renderMonthText=function(t,e,n,i){var r=t.getModel("monthLabel");if(r.get("show")){var o=r.get("nameMap"),a=r.get("margin"),s=r.get("position"),l=r.get("align"),u=[this._tlpoints,this._blpoints];o&&!X(o)||(o&&(e=kc(o)||e),o=e.get(["time","monthAbbr"])||[]);var h="start"===s?0:1,c="horizontal"===n?0:1;a="start"===s?-a:a;for(var p="center"===l,d=0;d=i.start.time&&n.timea.end.time&&t.reverse(),t},t.prototype._getRangeInfo=function(t){var e,n=[this.getDateInfo(t[0]),this.getDateInfo(t[1])];n[0].time>n[1].time&&(e=!0,n.reverse());var i=Math.floor(n[1].time/fE)-Math.floor(n[0].time/fE)+1,r=new Date(n[0].time),o=r.getDate(),a=n[1].date.getDate();r.setDate(o+i-1);var s=r.getDate();if(s!==a)for(var l=r.getTime()-n[1].time>0?1:-1;(s=r.getDate())!==a&&(r.getTime()-n[1].time)*l>0;)i-=l,r.setDate(s-l);var u=Math.floor((i+n[0].day+6)/7),h=e?1-u:u-1;return e&&n.reverse(),{range:[n[0].formatedDate,n[1].formatedDate],start:n[0],end:n[1],allDay:i,weeks:u,nthWeek:h,fweek:n[0].day,lweek:n[1].day}},t.prototype._getDateByWeeksAndDay=function(t,e,n){var i=this._getRangeInfo(n);if(t>i.weeks||0===t&&ei.lweek)return null;var r=7*(t-1)-i.fweek+e,o=new Date(i.start.time);return o.setDate(+i.start.d+r),this.getDateInfo(o)},t.create=function(e,n){var i=[];return e.eachComponent("calendar",(function(r){var o=new t(r,e,n);i.push(o),r.coordinateSystem=o})),e.eachSeries((function(t){"calendar"===t.get("coordinateSystem")&&(t.coordinateSystem=i[t.get("calendarIndex")||0])})),i},t.dimensions=["time","value"],t}();function yE(t){var e=t.calendarModel,n=t.seriesModel;return e?e.coordinateSystem:n?n.coordinateSystem:null}function vE(t,e){var n;return E(e,(function(e){null!=t[e]&&"auto"!==t[e]&&(n=!0)})),n}var mE=["transition","enterFrom","leaveTo"],xE=mE.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function _E(t,e,n){if(n&&(!t[n]&&e[n]&&(t[n]={}),t=t[n],e=e[n]),t&&e)for(var i=n?mE:xE,r=0;r=0;l--){var p,d,f;if(f=null!=(d=Mo((p=n[l]).id,null))?r.get(d):null){var g=f.parent,y=(c=SE(g),{}),v=Sp(f,p,g===i?{width:o,height:a}:{width:c.width,height:c.height},null,{hv:p.hv,boundingMode:p.bounding},y);if(!SE(f).isNew&&v){for(var m=p.transition,x={},_=0;_=0)?x[b]=w:f[b]=w}uh(f,x,t,0)}else f.attr(y)}}},e.prototype._clear=function(){var t=this,e=this._elMap;e.each((function(n){CE(n,SE(n).option,e,t._lastGraphicModel)})),this._elMap=ft()},e.prototype.dispose=function(){this._clear()},e.type="graphic",e}(mg);function IE(t){var e=mt(wE,t)?wE[t]:Sh(t);var n=new e({});return SE(n).type=t,n}function TE(t,e,n,i){var r=IE(n);return e.add(r),i.set(t,r),SE(r).id=t,SE(r).isNew=!0,r}function CE(t,e,n,i){t&&t.parent&&("group"===t.type&&t.traverse((function(t){CE(t,e,n,i)})),YO(t,e,i),n.removeKey(SE(t).id))}function DE(t,e,n,i){t.isGroup||E([["cursor",ma.prototype.cursor],["zlevel",i||0],["z",n||0],["z2",0]],(function(n){var i=n[0];mt(e,i)?t[i]=rt(e[i],n[1]):null==t[i]&&(t[i]=n[1])})),E(G(e),(function(n){if(0===n.indexOf("on")){var i=e[n];t[n]=U(i)?i:null}})),mt(e,"draggable")&&(t.draggable=e.draggable),null!=e.name&&(t.name=e.name),null!=e.id&&(t.id=e.id)}var AE=["x","y","radius","angle","single"],kE=["cartesian2d","polar","singleAxis"];function LE(t){return t+"Axis"}function PE(t,e){var n,i=ft(),r=[],o=ft();t.eachComponent({mainType:"dataZoom",query:e},(function(t){o.get(t.uid)||s(t)}));do{n=!1,t.eachComponent("dataZoom",a)}while(n);function a(t){!o.get(t.uid)&&function(t){var e=!1;return t.eachTargetAxis((function(t,n){var r=i.get(t);r&&r[n]&&(e=!0)})),e}(t)&&(s(t),n=!0)}function s(t){o.set(t.uid,!0),r.push(t),t.eachTargetAxis((function(t,e){(i.get(t)||i.set(t,[]))[e]=!0}))}return r}function OE(t){var e=t.ecModel,n={infoList:[],infoMap:ft()};return t.eachTargetAxis((function(t,i){var r=e.getComponent(LE(t),i);if(r){var o=r.getCoordSysModel();if(o){var a=o.uid,s=n.infoMap.get(a);s||(s={model:o,axisModels:[]},n.infoList.push(s),n.infoMap.set(a,s)),s.axisModels.push(r)}}})),n}var RE=function(){function t(){this.indexList=[],this.indexMap=[]}return t.prototype.add=function(t){this.indexMap[t]||(this.indexList.push(t),this.indexMap[t]=!0)},t}(),NE=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._autoThrottle=!0,n._noTarget=!0,n._rangePropMode=["percent","percent"],n}return n(e,t),e.prototype.init=function(t,e,n){var i=EE(t);this.settledOption=i,this.mergeDefaultAndTheme(t,n),this._doInit(i)},e.prototype.mergeOption=function(t){var e=EE(t);C(this.option,t,!0),C(this.settledOption,e,!0),this._doInit(e)},e.prototype._doInit=function(t){var e=this.option;this._setDefaultThrottle(t),this._updateRangeUse(t);var n=this.settledOption;E([["start","startValue"],["end","endValue"]],(function(t,i){"value"===this._rangePropMode[i]&&(e[t[0]]=n[t[0]]=null)}),this),this._resetTarget()},e.prototype._resetTarget=function(){var t=this.get("orient",!0),e=this._targetAxisInfoMap=ft();this._fillSpecifiedTargetAxis(e)?this._orient=t||this._makeAutoOrientByTargetAxis():(this._orient=t||"horizontal",this._fillAutoTargetAxisByOrient(e,this._orient)),this._noTarget=!0,e.each((function(t){t.indexList.length&&(this._noTarget=!1)}),this)},e.prototype._fillSpecifiedTargetAxis=function(t){var e=!1;return E(AE,(function(n){var i=this.getReferringComponents(LE(n),Oo);if(i.specified){e=!0;var r=new RE;E(i.models,(function(t){r.add(t.componentIndex)})),t.set(n,r)}}),this),e},e.prototype._fillAutoTargetAxisByOrient=function(t,e){var n=this.ecModel,i=!0;if(i){var r="vertical"===e?"y":"x";o(n.findComponents({mainType:r+"Axis"}),r)}i&&o(n.findComponents({mainType:"singleAxis",filter:function(t){return t.get("orient",!0)===e}}),"single");function o(e,n){var r=e[0];if(r){var o=new RE;if(o.add(r.componentIndex),t.set(n,o),i=!1,"x"===n||"y"===n){var a=r.getReferringComponents("grid",Po).models[0];a&&E(e,(function(t){r.componentIndex!==t.componentIndex&&a===t.getReferringComponents("grid",Po).models[0]&&o.add(t.componentIndex)}))}}}i&&E(AE,(function(e){if(i){var r=n.findComponents({mainType:LE(e),filter:function(t){return"category"===t.get("type",!0)}});if(r[0]){var o=new RE;o.add(r[0].componentIndex),t.set(e,o),i=!1}}}),this)},e.prototype._makeAutoOrientByTargetAxis=function(){var t;return this.eachTargetAxis((function(e){!t&&(t=e)}),this),"y"===t?"vertical":"horizontal"},e.prototype._setDefaultThrottle=function(t){if(t.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var e=this.ecModel.option;this.option.throttle=e.animation&&e.animationDurationUpdate>0?100:20}},e.prototype._updateRangeUse=function(t){var e=this._rangePropMode,n=this.get("rangeMode");E([["start","startValue"],["end","endValue"]],(function(i,r){var o=null!=t[i[0]],a=null!=t[i[1]];o&&!a?e[r]="percent":!o&&a?e[r]="value":n?e[r]=n[r]:o&&(e[r]="percent")}))},e.prototype.noTarget=function(){return this._noTarget},e.prototype.getFirstTargetAxisModel=function(){var t;return this.eachTargetAxis((function(e,n){null==t&&(t=this.ecModel.getComponent(LE(e),n))}),this),t},e.prototype.eachTargetAxis=function(t,e){this._targetAxisInfoMap.each((function(n,i){E(n.indexList,(function(n){t.call(e,i,n)}))}))},e.prototype.getAxisProxy=function(t,e){var n=this.getAxisModel(t,e);if(n)return n.__dzAxisProxy},e.prototype.getAxisModel=function(t,e){var n=this._targetAxisInfoMap.get(t);if(n&&n.indexMap[e])return this.ecModel.getComponent(LE(t),e)},e.prototype.setRawRange=function(t){var e=this.option,n=this.settledOption;E([["start","startValue"],["end","endValue"]],(function(i){null==t[i[0]]&&null==t[i[1]]||(e[i[0]]=n[i[0]]=t[i[0]],e[i[1]]=n[i[1]]=t[i[1]])}),this),this._updateRangeUse(t)},e.prototype.setCalculatedRange=function(t){var e=this.option;E(["start","startValue","end","endValue"],(function(n){e[n]=t[n]}))},e.prototype.getPercentRange=function(){var t=this.findRepresentativeAxisProxy();if(t)return t.getDataPercentWindow()},e.prototype.getValueRange=function(t,e){if(null!=t||null!=e)return this.getAxisProxy(t,e).getDataValueWindow();var n=this.findRepresentativeAxisProxy();return n?n.getDataValueWindow():void 0},e.prototype.findRepresentativeAxisProxy=function(t){if(t)return t.__dzAxisProxy;for(var e,n=this._targetAxisInfoMap.keys(),i=0;i=0}(e)){var n=LE(this._dimName),i=e.getReferringComponents(n,Po).models[0];i&&this._axisIndex===i.componentIndex&&t.push(e)}}),this),t},t.prototype.getAxisModel=function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},t.prototype.getMinMaxSpan=function(){return T(this._minMaxSpan)},t.prototype.calculateDataWindow=function(t){var e,n=this._dataExtent,i=this.getAxisModel().axis.scale,r=this._dataZoomModel.getRangePropMode(),o=[0,100],a=[],s=[];FE(["start","end"],(function(l,u){var h=t[l],c=t[l+"Value"];"percent"===r[u]?(null==h&&(h=o[u]),c=i.parse(Fr(h,o,n))):(e=!0,h=Fr(c=null==c?n[u]:i.parse(c),n,o)),s[u]=c,a[u]=h})),GE(s),GE(a);var l=this._minMaxSpan;function u(t,e,n,r,o){var a=o?"Span":"ValueSpan";dk(0,t,n,"all",l["min"+a],l["max"+a]);for(var s=0;s<2;s++)e[s]=Fr(t[s],n,r,!0),o&&(e[s]=i.parse(e[s]))}return e?u(s,a,n,o,!1):u(a,s,o,n,!0),{valueWindow:s,percentWindow:a}},t.prototype.reset=function(t){if(t===this._dataZoomModel){var e=this.getTargetSeriesModels();this._dataExtent=function(t,e,n){var i=[1/0,-1/0];FE(n,(function(t){!function(t,e,n){e&&E(f_(e,n),(function(n){var i=e.getApproximateExtent(n);i[0]t[1]&&(t[1]=i[1])}))}(i,t.getData(),e)}));var r=t.getAxisModel(),o=r_(r.axis.scale,r,i).calculate();return[o.min,o.max]}(this,this._dimName,e),this._updateMinMaxSpan();var n=this.calculateDataWindow(t.settledOption);this._valueWindow=n.valueWindow,this._percentWindow=n.percentWindow,this._setAxisModel()}},t.prototype.filterData=function(t,e){if(t===this._dataZoomModel){var n=this._dimName,i=this.getTargetSeriesModels(),r=t.get("filterMode"),o=this._valueWindow;"none"!==r&&FE(i,(function(t){var e=t.getData(),i=e.mapDimensionsAll(n);if(i.length){if("weakFilter"===r){var a=e.getStore(),s=z(i,(function(t){return e.getDimensionIndex(t)}),e);e.filterSelf((function(t){for(var e,n,r,l=0;lo[1];if(h&&!c&&!p)return!0;h&&(r=!0),c&&(e=!0),p&&(n=!0)}return r&&e&&n}))}else FE(i,(function(n){if("empty"===r)t.setData(e=e.map(n,(function(t){return function(t){return t>=o[0]&&t<=o[1]}(t)?t:NaN})));else{var i={};i[n]=o,e.selectRange(i)}}));FE(i,(function(t){e.setApproximateExtent(o,t)}))}}))}},t.prototype._updateMinMaxSpan=function(){var t=this._minMaxSpan={},e=this._dataZoomModel,n=this._dataExtent;FE(["min","max"],(function(i){var r=e.get(i+"Span"),o=e.get(i+"ValueSpan");null!=o&&(o=this.getAxisModel().axis.scale.parse(o)),null!=o?r=Fr(n[0]+o,n,[0,100],!0):null!=r&&(o=Fr(r,[0,100],n,!0)-n[0]),t[i+"Span"]=r,t[i+"ValueSpan"]=o}),this)},t.prototype._setAxisModel=function(){var t=this.getAxisModel(),e=this._percentWindow,n=this._valueWindow;if(e){var i=Xr(n,[0,500]);i=Math.min(i,20);var r=t.axis.scale.rawExtentInfo;0!==e[0]&&r.setDeterminedMinMax("min",+n[0].toFixed(i)),100!==e[1]&&r.setDeterminedMinMax("max",+n[1].toFixed(i)),r.freeze()}},t}();var HE={getTargetSeries:function(t){function e(e){t.eachComponent("dataZoom",(function(n){n.eachTargetAxis((function(i,r){var o=t.getComponent(LE(i),r);e(i,r,o,n)}))}))}e((function(t,e,n,i){n.__dzAxisProxy=null}));var n=[];e((function(e,i,r,o){r.__dzAxisProxy||(r.__dzAxisProxy=new WE(e,i,o,t),n.push(r.__dzAxisProxy))}));var i=ft();return E(n,(function(t){E(t.getTargetSeriesModels(),(function(t){i.set(t.uid,t)}))})),i},overallReset:function(t,e){t.eachComponent("dataZoom",(function(t){t.eachTargetAxis((function(e,n){t.getAxisProxy(e,n).reset(t)})),t.eachTargetAxis((function(n,i){t.getAxisProxy(n,i).filterData(t,e)}))})),t.eachComponent("dataZoom",(function(t){var e=t.findRepresentativeAxisProxy();if(e){var n=e.getDataPercentWindow(),i=e.getDataValueWindow();t.setCalculatedRange({start:n[0],end:n[1],startValue:i[0],endValue:i[1]})}}))}};var YE=!1;function UE(t){YE||(YE=!0,t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,HE),function(t){t.registerAction("dataZoom",(function(t,e){E(PE(e,t),(function(e){e.setRawRange({start:t.start,end:t.end,startValue:t.startValue,endValue:t.endValue})}))}))}(t),t.registerSubTypeDefaulter("dataZoom",(function(){return"slider"})))}function XE(t){t.registerComponentModel(zE),t.registerComponentView(BE),UE(t)}var ZE=function(){},jE={};function qE(t,e){jE[t]=e}function KE(t){return jE[t]}var $E=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.optionUpdated=function(){t.prototype.optionUpdated.apply(this,arguments);var e=this.ecModel;E(this.option.feature,(function(t,n){var i=KE(n);i&&(i.getDefaultOption&&(i.defaultOption=i.getDefaultOption(e)),C(t,i.defaultOption))}))},e.type="toolbox",e.layoutMode={type:"box",ignoreSize:!0},e.defaultOption={show:!0,z:6,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemSize:15,itemGap:8,showTitle:!0,iconStyle:{borderColor:"#666",color:"none"},emphasis:{iconStyle:{borderColor:"#3E98C5"}},tooltip:{show:!1,position:"bottom"}},e}(Ap);function JE(t,e){var n=up(e.get("padding")),i=e.getItemStyle(["color","opacity"]);return i.fill=e.get("backgroundColor"),t=new Ps({shape:{x:t.x-n[3],y:t.y-n[0],width:t.width+n[1]+n[3],height:t.height+n[0]+n[2],r:e.get("borderRadius")},style:i,silent:!0,z2:-1})}var QE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.render=function(t,e,n,i){var r=this.group;if(r.removeAll(),t.get("show")){var o=+t.get("itemSize"),a="vertical"===t.get("orient"),s=t.get("feature")||{},l=this._features||(this._features={}),u=[];E(s,(function(t,e){u.push(e)})),new Dm(this._featureNames||[],u).add(h).update(h).remove(H(h,null)).execute(),this._featureNames=u,function(t,e,n){var i=e.getBoxLayoutParams(),r=e.get("padding"),o={width:n.getWidth(),height:n.getHeight()},a=wp(i,o,r);bp(e.get("orient"),t,e.get("itemGap"),a.width,a.height),Sp(t,i,o,r)}(r,t,n),r.add(JE(r.getBoundingRect(),t)),a||r.eachChild((function(t){var e=t.__title,i=t.ensureState("emphasis"),a=i.textConfig||(i.textConfig={}),s=t.getTextContent(),l=s&&s.ensureState("emphasis");if(l&&!U(l)&&e){var u=l.style||(l.style={}),h=yr(e,Ns.makeFont(u)),c=t.x+r.x,p=!1;t.y+r.y+o+h.height>n.getHeight()&&(a.position="top",p=!0);var d=p?-5-h.height:o+10;c+h.width/2>n.getWidth()?(a.position=["100%",d],u.align="right"):c-h.width/2<0&&(a.position=[0,d],u.align="left")}}))}function h(h,c){var p,d=u[h],f=u[c],g=s[d],y=new xc(g,t,t.ecModel);if(i&&null!=i.newTitle&&i.featureName===d&&(g.title=i.newTitle),d&&!f){if(function(t){return 0===t.indexOf("my")}(d))p={onclick:y.option.onclick,featureName:d};else{var v=KE(d);if(!v)return;p=new v}l[d]=p}else if(!(p=l[f]))return;p.uid=bc("toolbox-feature"),p.model=y,p.ecModel=e,p.api=n;var m=p instanceof ZE;d||!f?!y.get("show")||m&&p.unusable?m&&p.remove&&p.remove(e,n):(!function(i,s,l){var u,h,c=i.getModel("iconStyle"),p=i.getModel(["emphasis","iconStyle"]),d=s instanceof ZE&&s.getIcons?s.getIcons():i.get("icon"),f=i.get("title")||{};X(d)?(u={})[l]=d:u=d;X(f)?(h={})[l]=f:h=f;var g=i.iconPaths={};E(u,(function(l,u){var d=Vh(l,{},{x:-o/2,y:-o/2,width:o,height:o});d.setStyle(c.getItemStyle()),d.ensureState("emphasis").style=p.getItemStyle();var f=new Ns({style:{text:h[u],align:p.get("textAlign"),borderRadius:p.get("textBorderRadius"),padding:p.get("textPadding"),fill:null},ignore:!0});d.setTextContent(f),Wh({el:d,componentModel:t,itemName:u,formatterParamsExtra:{title:h[u]}}),d.__title=h[u],d.on("mouseover",(function(){var e=p.getItemStyle(),i=a?null==t.get("right")&&"right"!==t.get("left")?"right":"left":null==t.get("bottom")&&"bottom"!==t.get("top")?"bottom":"top";f.setStyle({fill:p.get("textFill")||e.fill||e.stroke||"#000",backgroundColor:p.get("textBackgroundColor")}),d.setTextConfig({position:p.get("textPosition")||i}),f.ignore=!t.get("showTitle"),n.enterEmphasis(this)})).on("mouseout",(function(){"emphasis"!==i.get(["iconStatus",u])&&n.leaveEmphasis(this),f.hide()})),("emphasis"===i.get(["iconStatus",u])?Il:Tl)(d),r.add(d),d.on("click",W(s.onclick,s,e,n,u)),g[u]=d}))}(y,p,d),y.setIconStatus=function(t,e){var n=this.option,i=this.iconPaths;n.iconStatus=n.iconStatus||{},n.iconStatus[t]=e,i[t]&&("emphasis"===e?Il:Tl)(i[t])},p instanceof ZE&&p.render&&p.render(y,e,n,i)):m&&p.dispose&&p.dispose(e,n)}},e.prototype.updateView=function(t,e,n,i){E(this._features,(function(t){t instanceof ZE&&t.updateView&&t.updateView(t.model,e,n,i)}))},e.prototype.remove=function(t,e){E(this._features,(function(n){n instanceof ZE&&n.remove&&n.remove(t,e)})),this.group.removeAll()},e.prototype.dispose=function(t,e){E(this._features,(function(n){n instanceof ZE&&n.dispose&&n.dispose(t,e)}))},e.type="toolbox",e}(mg);var tz=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.onclick=function(t,e){var n=this.model,i=n.get("name")||t.get("title.0.text")||"echarts",o="svg"===e.getZr().painter.getType(),a=o?"svg":n.get("type",!0)||"png",s=e.getConnectedDataURL({type:a,backgroundColor:n.get("backgroundColor",!0)||t.get("backgroundColor")||"#fff",connectedBackgroundColor:n.get("connectedBackgroundColor"),excludeComponents:n.get("excludeComponents"),pixelRatio:n.get("pixelRatio")}),l=r.browser;if(U(MouseEvent)&&(l.newEdge||!l.ie&&!l.edge)){var u=document.createElement("a");u.download=i+"."+a,u.target="_blank",u.href=s;var h=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});u.dispatchEvent(h)}else if(window.navigator.msSaveOrOpenBlob||o){var c=s.split(","),p=c[0].indexOf("base64")>-1,d=o?decodeURIComponent(c[1]):c[1];p&&(d=window.atob(d));var f=i+"."+a;if(window.navigator.msSaveOrOpenBlob){for(var g=d.length,y=new Uint8Array(g);g--;)y[g]=d.charCodeAt(g);var v=new Blob([y]);window.navigator.msSaveOrOpenBlob(v,f)}else{var m=document.createElement("iframe");document.body.appendChild(m);var x=m.contentWindow,_=x.document;_.open("image/svg+xml","replace"),_.write(d),_.close(),x.focus(),_.execCommand("SaveAs",!0,f),document.body.removeChild(m)}}else{var b=n.get("lang"),w='',S=window.open();S.document.write(w),S.document.title=i}},e.getDefaultOption=function(t){return{show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:t.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],lang:t.getLocaleModel().get(["toolbox","saveAsImage","lang"])}},e}(ZE),ez="__ec_magicType_stack__",nz=[["line","bar"],["stack"]],iz=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.getIcons=function(){var t=this.model,e=t.get("icon"),n={};return E(t.get("type"),(function(t){e[t]&&(n[t]=e[t])})),n},e.getDefaultOption=function(t){return{show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:t.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}}},e.prototype.onclick=function(t,e,n){var i=this.model,r=i.get(["seriesIndex",n]);if(rz[n]){var o,a={series:[]};E(nz,(function(t){P(t,n)>=0&&E(t,(function(t){i.setIconStatus(t,"normal")}))})),i.setIconStatus(n,"emphasis"),t.eachComponent({mainType:"series",query:null==r?null:{seriesIndex:r}},(function(t){var e=t.subType,r=t.id,o=rz[n](e,r,t,i);o&&(k(o,t.option),a.series.push(o));var s=t.coordinateSystem;if(s&&"cartesian2d"===s.type&&("line"===n||"bar"===n)){var l=s.getAxesByScale("ordinal")[0];if(l){var u=l.dim+"Axis",h=t.getReferringComponents(u,Po).models[0].componentIndex;a[u]=a[u]||[];for(var c=0;c<=h;c++)a[u][h]=a[u][h]||{};a[u][h].boundaryGap="bar"===n}}}));var s=n;"stack"===n&&(o=C({stack:i.option.title.tiled,tiled:i.option.title.stack},i.option.title),"emphasis"!==i.get(["iconStatus",n])&&(s="tiled")),e.dispatchAction({type:"changeMagicType",currentType:s,newOption:a,newTitle:o,featureName:"magicType"})}},e}(ZE),rz={line:function(t,e,n,i){if("bar"===t)return C({id:e,type:"line",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","line"])||{},!0)},bar:function(t,e,n,i){if("line"===t)return C({id:e,type:"bar",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","bar"])||{},!0)},stack:function(t,e,n,i){var r=n.get("stack")===ez;if("line"===t||"bar"===t)return i.setIconStatus("stack",r?"normal":"emphasis"),C({id:e,stack:r?"":ez},i.get(["option","stack"])||{},!0)}};fm({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},(function(t,e){e.mergeOption(t.newOption)}));var oz=new Array(60).join("-"),az="\t";function sz(t){return t.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}var lz=new RegExp("[\t]+","g");function uz(t,e){var n=t.split(new RegExp("\n*"+oz+"\n*","g")),i={series:[]};return E(n,(function(t,n){if(function(t){if(t.slice(0,t.indexOf("\n")).indexOf(az)>=0)return!0}(t)){var r=function(t){for(var e=t.split(/\n+/g),n=[],i=z(sz(e.shift()).split(lz),(function(t){return{name:t,data:[]}})),r=0;r=0)&&t(r,i._targetInfoList)}))}return t.prototype.setOutputRanges=function(t,e){return this.matchOutputRanges(t,e,(function(t,e,n){if((t.coordRanges||(t.coordRanges=[])).push(e),!t.coordRange){t.coordRange=e;var i=Sz[t.brushType](0,n,e);t.__rangeOffset={offset:Iz[t.brushType](i.values,t.range,[1,1]),xyMinMax:i.xyMinMax}}})),t},t.prototype.matchOutputRanges=function(t,e,n){E(t,(function(t){var i=this.findTargetInfo(t,e);i&&!0!==i&&E(i.coordSyses,(function(i){var r=Sz[t.brushType](1,i,t.range,!0);n(t,r.values,i,e)}))}),this)},t.prototype.setInputRanges=function(t,e){E(t,(function(t){var n,i,r,o,a,s=this.findTargetInfo(t,e);if(t.range=t.range||[],s&&!0!==s){t.panelId=s.panelId;var l=Sz[t.brushType](0,s.coordSys,t.coordRange),u=t.__rangeOffset;t.range=u?Iz[t.brushType](l.values,u.offset,(n=l.xyMinMax,i=u.xyMinMax,r=Cz(n),o=Cz(i),a=[r[0]/o[0],r[1]/o[1]],isNaN(a[0])&&(a[0]=1),isNaN(a[1])&&(a[1]=1),a)):l.values}}),this)},t.prototype.makePanelOpts=function(t,e){return z(this._targetInfoList,(function(n){var i=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:e?e(n):null,clipPath:gL(i),isTargetByCursor:vL(i,t,n.coordSysModel),getLinearBrushOtherExtent:yL(i)}}))},t.prototype.controlSeries=function(t,e,n){var i=this.findTargetInfo(t,n);return!0===i||i&&P(i.coordSyses,e.coordinateSystem)>=0},t.prototype.findTargetInfo=function(t,e){for(var n=this._targetInfoList,i=xz(e,t),r=0;rt[1]&&t.reverse(),t}function xz(t,e){return ko(t,e,{includeMainTypes:yz})}var _z={grid:function(t,e){var n=t.xAxisModels,i=t.yAxisModels,r=t.gridModels,o=ft(),a={},s={};(n||i||r)&&(E(n,(function(t){var e=t.axis.grid.model;o.set(e.id,e),a[e.id]=!0})),E(i,(function(t){var e=t.axis.grid.model;o.set(e.id,e),s[e.id]=!0})),E(r,(function(t){o.set(t.id,t),a[t.id]=!0,s[t.id]=!0})),o.each((function(t){var r=t.coordinateSystem,o=[];E(r.getCartesians(),(function(t,e){(P(n,t.getAxis("x").model)>=0||P(i,t.getAxis("y").model)>=0)&&o.push(t)})),e.push({panelId:"grid--"+t.id,gridModel:t,coordSysModel:t,coordSys:o[0],coordSyses:o,getPanelRect:wz.grid,xAxisDeclared:a[t.id],yAxisDeclared:s[t.id]})})))},geo:function(t,e){E(t.geoModels,(function(t){var n=t.coordinateSystem;e.push({panelId:"geo--"+t.id,geoModel:t,coordSysModel:t,coordSys:n,coordSyses:[n],getPanelRect:wz.geo})}))}},bz=[function(t,e){var n=t.xAxisModel,i=t.yAxisModel,r=t.gridModel;return!r&&n&&(r=n.axis.grid.model),!r&&i&&(r=i.axis.grid.model),r&&r===e.gridModel},function(t,e){var n=t.geoModel;return n&&n===e.geoModel}],wz={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var t=this.coordSys,e=t.getBoundingRect().clone();return e.applyTransform(Lh(t)),e}},Sz={lineX:H(Mz,0),lineY:H(Mz,1),rect:function(t,e,n,i){var r=t?e.pointToData([n[0][0],n[1][0]],i):e.dataToPoint([n[0][0],n[1][0]],i),o=t?e.pointToData([n[0][1],n[1][1]],i):e.dataToPoint([n[0][1],n[1][1]],i),a=[mz([r[0],o[0]]),mz([r[1],o[1]])];return{values:a,xyMinMax:a}},polygon:function(t,e,n,i){var r=[[1/0,-1/0],[1/0,-1/0]];return{values:z(n,(function(n){var o=t?e.pointToData(n,i):e.dataToPoint(n,i);return r[0][0]=Math.min(r[0][0],o[0]),r[1][0]=Math.min(r[1][0],o[1]),r[0][1]=Math.max(r[0][1],o[0]),r[1][1]=Math.max(r[1][1],o[1]),o})),xyMinMax:r}}};function Mz(t,e,n,i){var r=n.getAxis(["x","y"][t]),o=mz(z([0,1],(function(t){return e?r.coordToData(r.toLocalCoord(i[t]),!0):r.toGlobalCoord(r.dataToCoord(i[t]))}))),a=[];return a[t]=o,a[1-t]=[NaN,NaN],{values:o,xyMinMax:a}}var Iz={lineX:H(Tz,0),lineY:H(Tz,1),rect:function(t,e,n){return[[t[0][0]-n[0]*e[0][0],t[0][1]-n[0]*e[0][1]],[t[1][0]-n[1]*e[1][0],t[1][1]-n[1]*e[1][1]]]},polygon:function(t,e,n){return z(t,(function(t,i){return[t[0]-n[0]*e[i][0],t[1]-n[1]*e[i][1]]}))}};function Tz(t,e,n,i){return[e[0]-i[t]*n[0],e[1]-i[t]*n[1]]}function Cz(t){return t?[t[0][1]-t[0][0],t[1][1]-t[1][0]]:[NaN,NaN]}var Dz,Az,kz=E,Lz=go+"toolbox-dataZoom_",Pz=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.render=function(t,e,n,i){this._brushController||(this._brushController=new Vk(n.getZr()),this._brushController.on("brush",W(this._onBrush,this)).mount()),function(t,e,n,i,r){var o=n._isZoomActive;i&&"takeGlobalCursor"===i.type&&(o="dataZoomSelect"===i.key&&i.dataZoomSelectActive);n._isZoomActive=o,t.setIconStatus("zoom",o?"emphasis":"normal");var a=new vz(Rz(t),e,{include:["grid"]}).makePanelOpts(r,(function(t){return t.xAxisDeclared&&!t.yAxisDeclared?"lineX":!t.xAxisDeclared&&t.yAxisDeclared?"lineY":"rect"}));n._brushController.setPanels(a).enableBrush(!(!o||!a.length)&&{brushType:"auto",brushStyle:t.getModel("brushStyle").getItemStyle()})}(t,e,this,i,n),function(t,e){t.setIconStatus("back",function(t){return fz(t).length}(e)>1?"emphasis":"normal")}(t,e)},e.prototype.onclick=function(t,e,n){Oz[n].call(this)},e.prototype.remove=function(t,e){this._brushController&&this._brushController.unmount()},e.prototype.dispose=function(t,e){this._brushController&&this._brushController.dispose()},e.prototype._onBrush=function(t){var e=t.areas;if(t.isEnd&&e.length){var n={},i=this.ecModel;this._brushController.updateCovers([]),new vz(Rz(this.model),i,{include:["grid"]}).matchOutputRanges(e,i,(function(t,e,n){if("cartesian2d"===n.type){var i=t.brushType;"rect"===i?(r("x",n,e[0]),r("y",n,e[1])):r({lineX:"x",lineY:"y"}[i],n,e)}})),function(t,e){var n=fz(t);pz(e,(function(e,i){for(var r=n.length-1;r>=0&&!n[r][i];r--);if(r<0){var o=t.queryComponents({mainType:"dataZoom",subType:"select",id:i})[0];if(o){var a=o.getPercentRange();n[0][i]={dataZoomId:i,start:a[0],end:a[1]}}}})),n.push(e)}(i,n),this._dispatchZoomAction(n)}function r(t,e,r){var o=e.getAxis(t),a=o.model,s=function(t,e,n){var i;return n.eachComponent({mainType:"dataZoom",subType:"select"},(function(n){n.getAxisModel(t,e.componentIndex)&&(i=n)})),i}(t,a,i),l=s.findRepresentativeAxisProxy(a).getMinMaxSpan();null==l.minValueSpan&&null==l.maxValueSpan||(r=dk(0,r.slice(),o.scale.getExtent(),0,l.minValueSpan,l.maxValueSpan)),s&&(n[s.id]={dataZoomId:s.id,startValue:r[0],endValue:r[1]})}},e.prototype._dispatchZoomAction=function(t){var e=[];kz(t,(function(t,n){e.push(T(t))})),e.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:e})},e.getDefaultOption=function(t){return{show:!0,filterMode:"filter",icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:t.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:"rgba(210,219,238,0.2)"}}},e}(ZE),Oz={zoom:function(){var t=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:t})},back:function(){this._dispatchZoomAction(function(t){var e=fz(t),n=e[e.length-1];e.length>1&&e.pop();var i={};return pz(n,(function(t,n){for(var r=e.length-1;r>=0;r--)if(t=e[r][n]){i[n]=t;break}})),i}(this.ecModel))}};function Rz(t){var e={xAxisIndex:t.get("xAxisIndex",!0),yAxisIndex:t.get("yAxisIndex",!0),xAxisId:t.get("xAxisId",!0),yAxisId:t.get("yAxisId",!0)};return null==e.xAxisIndex&&null==e.xAxisId&&(e.xAxisIndex="all"),null==e.yAxisIndex&&null==e.yAxisId&&(e.yAxisIndex="all"),e}Dz="dataZoom",Az=function(t){var e=t.getComponent("toolbox",0),n=["feature","dataZoom"];if(e&&null!=e.get(n)){var i=e.getModel(n),r=[],o=ko(t,Rz(i));return kz(o.xAxisModels,(function(t){return a(t,"xAxis","xAxisIndex")})),kz(o.yAxisModels,(function(t){return a(t,"yAxis","yAxisIndex")})),r}function a(t,e,n){var o=t.componentIndex,a={type:"select",$fromToolbox:!0,filterMode:i.get("filterMode",!0)||"filter",id:Lz+e+o};a[n]=o,r.push(a)}},lt(null==$p.get(Dz)&&Az),$p.set(Dz,Az);var Nz=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.type="tooltip",e.dependencies=["axisPointer"],e.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"#fff",shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#666",fontSize:14}},e}(Ap);function Ez(t){var e=t.get("confine");return null!=e?!!e:"richText"===t.get("renderMode")}function zz(t){if(r.domSupported)for(var e=document.documentElement.style,n=0,i=t.length;n-1?(u+="top:50%",h+="translateY(-50%) rotate("+(a="left"===s?-225:-45)+"deg)"):(u+="left:50%",h+="translateX(-50%) rotate("+(a="top"===s?225:45)+"deg)");var c=a*Math.PI/180,p=l+r,d=p*Math.abs(Math.cos(c))+p*Math.abs(Math.sin(c)),f=e+" solid "+r+"px;";return'
'}(n,i,r)),X(t))o.innerHTML=t+a;else if(t){o.innerHTML="",Y(t)||(t=[t]);for(var s=0;s=0?this._tryShow(n,i):"leave"===e&&this._hide(i))}),this))},e.prototype._keepShow=function(){var t=this._tooltipModel,e=this._ecModel,n=this._api,i=t.get("triggerOn");if(null!=this._lastX&&null!=this._lastY&&"none"!==i&&"click"!==i){var r=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout((function(){!n.isDisposed()&&r.manuallyShowTip(t,e,n,{x:r._lastX,y:r._lastY,dataByCoordSys:r._lastDataByCoordSys})}))}},e.prototype.manuallyShowTip=function(t,e,n,i){if(i.from!==this.uid&&!r.node&&n.getDom()){var o=tV(i,n);this._ticket="";var a=i.dataByCoordSys,s=function(t,e,n){var i=Lo(t).queryOptionMap,r=i.keys()[0];if(!r||"series"===r)return;var o,a=Ro(e,r,i.get(r),{useDefault:!1,enableAll:!1,enableNone:!1}).models[0];if(!a)return;if(n.getViewOfComponentModel(a).group.traverse((function(e){var n=js(e).tooltipConfig;if(n&&n.name===t.name)return o=e,!0})),o)return{componentMainType:r,componentIndex:a.componentIndex,el:o}}(i,e,n);if(s){var l=s.el.getBoundingRect().clone();l.applyTransform(s.el.transform),this._tryShow({offsetX:l.x+l.width/2,offsetY:l.y+l.height/2,target:s.el,position:i.position,positionDefault:"bottom"},o)}else if(i.tooltip&&null!=i.x&&null!=i.y){var u=$z;u.x=i.x,u.y=i.y,u.update(),js(u).tooltipConfig={name:null,option:i.tooltip},this._tryShow({offsetX:i.x,offsetY:i.y,target:u},o)}else if(a)this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,dataByCoordSys:a,tooltipOption:i.tooltipOption},o);else if(null!=i.seriesIndex){if(this._manuallyAxisShowTip(t,e,n,i))return;var h=sN(i,e),c=h.point[0],p=h.point[1];null!=c&&null!=p&&this._tryShow({offsetX:c,offsetY:p,target:h.el,position:i.position,positionDefault:"bottom"},o)}else null!=i.x&&null!=i.y&&(n.dispatchAction({type:"updateAxisPointer",x:i.x,y:i.y}),this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,target:n.getZr().findHover(i.x,i.y).target},o))}},e.prototype.manuallyHideTip=function(t,e,n,i){var r=this._tooltipContent;!this._alwaysShowContent&&this._tooltipModel&&r.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,i.from!==this.uid&&this._hide(tV(i,n))},e.prototype._manuallyAxisShowTip=function(t,e,n,i){var r=i.seriesIndex,o=i.dataIndex,a=e.getComponent("axisPointer").coordSysAxesInfo;if(null!=r&&null!=o&&null!=a){var s=e.getSeriesByIndex(r);if(s)if("axis"===Qz([s.getData().getItemModel(o),s,(s.coordinateSystem||{}).model],this._tooltipModel).get("trigger"))return n.dispatchAction({type:"updateAxisPointer",seriesIndex:r,dataIndex:o,position:i.position}),!0}},e.prototype._tryShow=function(t,e){var n=t.target;if(this._tooltipModel){this._lastX=t.offsetX,this._lastY=t.offsetY;var i=t.dataByCoordSys;if(i&&i.length)this._showAxisTooltip(i,t);else if(n){var r,o;this._lastDataByCoordSys=null,wy(n,(function(t){return null!=js(t).dataIndex?(r=t,!0):null!=js(t).tooltipConfig?(o=t,!0):void 0}),!0),r?this._showSeriesItemTooltip(t,r,e):o?this._showComponentItemTooltip(t,o,e):this._hide(e)}else this._lastDataByCoordSys=null,this._hide(e)}},e.prototype._showOrMove=function(t,e){var n=t.get("showDelay");e=W(e,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(e,n):e()},e.prototype._showAxisTooltip=function(t,e){var n=this._ecModel,i=this._tooltipModel,r=[e.offsetX,e.offsetY],o=Qz([e.tooltipOption],i),a=this._renderMode,s=[],l=qf("section",{blocks:[],noHeader:!0}),u=[],h=new ag;E(t,(function(t){E(t.dataByAxis,(function(t){var e=n.getComponent(t.axisDim+"Axis",t.axisIndex),r=t.value;if(e&&null!=r){var o=HR(r,e.axis,n,t.seriesDataIndices,t.valueLabelOpt),c=qf("section",{header:o,noHeader:!ut(o),sortBlocks:!0,blocks:[]});l.blocks.push(c),E(t.seriesDataIndices,(function(l){var p=n.getSeriesByIndex(l.seriesIndex),d=l.dataIndexInside,f=p.getDataParams(d);if(!(f.dataIndex<0)){f.axisDim=t.axisDim,f.axisIndex=t.axisIndex,f.axisType=t.axisType,f.axisId=t.axisId,f.axisValue=h_(e.axis,{value:r}),f.axisValueLabel=o,f.marker=h.makeTooltipMarker("item",gp(f.color),a);var g=pf(p.formatTooltip(d,!0,null)),y=g.frag;if(y){var v=Qz([p],i).get("valueFormatter");c.blocks.push(v?A({valueFormatter:v},y):y)}g.text&&u.push(g.text),s.push(f)}}))}}))})),l.blocks.reverse(),u.reverse();var c=e.position,p=o.get("order"),d=eg(l,h,a,p,n.get("useUTC"),o.get("textStyle"));d&&u.unshift(d);var f="richText"===a?"\n\n":"
",g=u.join(f);this._showOrMove(o,(function(){this._updateContentNotChangedOnAxis(t,s)?this._updatePosition(o,c,r[0],r[1],this._tooltipContent,s):this._showTooltipContent(o,g,s,Math.random()+"",r[0],r[1],c,null,h)}))},e.prototype._showSeriesItemTooltip=function(t,e,n){var i=this._ecModel,r=js(e),o=r.seriesIndex,a=i.getSeriesByIndex(o),s=r.dataModel||a,l=r.dataIndex,u=r.dataType,h=s.getData(u),c=this._renderMode,p=t.positionDefault,d=Qz([h.getItemModel(l),s,a&&(a.coordinateSystem||{}).model],this._tooltipModel,p?{position:p}:null),f=d.get("trigger");if(null==f||"item"===f){var g=s.getDataParams(l,u),y=new ag;g.marker=y.makeTooltipMarker("item",gp(g.color),c);var v=pf(s.formatTooltip(l,!1,u)),m=d.get("order"),x=d.get("valueFormatter"),_=v.frag,b=_?eg(x?A({valueFormatter:x},_):_,y,c,m,i.get("useUTC"),d.get("textStyle")):v.text,w="item_"+s.name+"_"+l;this._showOrMove(d,(function(){this._showTooltipContent(d,b,g,w,t.offsetX,t.offsetY,t.position,t.target,y)})),n({type:"showTip",dataIndexInside:l,dataIndex:h.getRawIndex(l),seriesIndex:o,from:this.uid})}},e.prototype._showComponentItemTooltip=function(t,e,n){var i=js(e),r=i.tooltipConfig.option||{};if(X(r)){r={content:r,formatter:r}}var o=[r],a=this._ecModel.getComponent(i.componentMainType,i.componentIndex);a&&o.push(a),o.push({formatter:r.content});var s=t.positionDefault,l=Qz(o,this._tooltipModel,s?{position:s}:null),u=l.get("content"),h=Math.random()+"",c=new ag;this._showOrMove(l,(function(){var n=T(l.get("formatterParams")||{});this._showTooltipContent(l,u,n,h,t.offsetX,t.offsetY,t.position,e,c)})),n({type:"showTip",from:this.uid})},e.prototype._showTooltipContent=function(t,e,n,i,r,o,a,s,l){if(this._ticket="",t.get("showContent")&&t.get("show")){var u=this._tooltipContent;u.setEnterable(t.get("enterable"));var h=t.get("formatter");a=a||t.get("position");var c=e,p=this._getNearestPoint([r,o],n,t.get("trigger"),t.get("borderColor")).color;if(h)if(X(h)){var d=t.ecModel.get("useUTC"),f=Y(n)?n[0]:n;c=h,f&&f.axisType&&f.axisType.indexOf("time")>=0&&(c=Yc(f.axisValue,c,d)),c=dp(c,n,!0)}else if(U(h)){var g=W((function(e,i){e===this._ticket&&(u.setContent(i,l,t,p,a),this._updatePosition(t,a,r,o,u,n,s))}),this);this._ticket=i,c=h(n,i,g)}else c=h;u.setContent(c,l,t,p,a),u.show(t,p),this._updatePosition(t,a,r,o,u,n,s)}},e.prototype._getNearestPoint=function(t,e,n,i){return"axis"===n||Y(e)?{color:i||("html"===this._renderMode?"#fff":"none")}:Y(e)?void 0:{color:i||e.color||e.borderColor}},e.prototype._updatePosition=function(t,e,n,i,r,o,a){var s=this._api.getWidth(),l=this._api.getHeight();e=e||t.get("position");var u=r.getSize(),h=t.get("align"),c=t.get("verticalAlign"),p=a&&a.getBoundingRect().clone();if(a&&p.applyTransform(a.transform),U(e)&&(e=e([n,i],o,r.el,p,{viewSize:[s,l],contentSize:u.slice()})),Y(e))n=Gr(e[0],s),i=Gr(e[1],l);else if(q(e)){var d=e;d.width=u[0],d.height=u[1];var f=wp(d,{width:s,height:l});n=f.x,i=f.y,h=null,c=null}else if(X(e)&&a){var g=function(t,e,n,i){var r=n[0],o=n[1],a=Math.ceil(Math.SQRT2*i)+8,s=0,l=0,u=e.width,h=e.height;switch(t){case"inside":s=e.x+u/2-r/2,l=e.y+h/2-o/2;break;case"top":s=e.x+u/2-r/2,l=e.y-o-a;break;case"bottom":s=e.x+u/2-r/2,l=e.y+h+a;break;case"left":s=e.x-r-a,l=e.y+h/2-o/2;break;case"right":s=e.x+u+a,l=e.y+h/2-o/2}return[s,l]}(e,p,u,t.get("borderWidth"));n=g[0],i=g[1]}else{g=function(t,e,n,i,r,o,a){var s=n.getSize(),l=s[0],u=s[1];null!=o&&(t+l+o+2>i?t-=l+o:t+=o);null!=a&&(e+u+a>r?e-=u+a:e+=a);return[t,e]}(n,i,r,s,l,h?null:20,c?null:20);n=g[0],i=g[1]}if(h&&(n-=eV(h)?u[0]/2:"right"===h?u[0]:0),c&&(i-=eV(c)?u[1]/2:"bottom"===c?u[1]:0),Ez(t)){g=function(t,e,n,i,r){var o=n.getSize(),a=o[0],s=o[1];return t=Math.min(t+a,i)-a,e=Math.min(e+s,r)-s,t=Math.max(t,0),e=Math.max(e,0),[t,e]}(n,i,r,s,l);n=g[0],i=g[1]}r.moveTo(n,i)},e.prototype._updateContentNotChangedOnAxis=function(t,e){var n=this._lastDataByCoordSys,i=this._cbParamsList,r=!!n&&n.length===t.length;return r&&E(n,(function(n,o){var a=n.dataByAxis||[],s=(t[o]||{}).dataByAxis||[];(r=r&&a.length===s.length)&&E(a,(function(t,n){var o=s[n]||{},a=t.seriesDataIndices||[],l=o.seriesDataIndices||[];(r=r&&t.value===o.value&&t.axisType===o.axisType&&t.axisId===o.axisId&&a.length===l.length)&&E(a,(function(t,e){var n=l[e];r=r&&t.seriesIndex===n.seriesIndex&&t.dataIndex===n.dataIndex})),i&&E(t.seriesDataIndices,(function(t){var n=t.seriesIndex,o=e[n],a=i[n];o&&a&&a.data!==o.data&&(r=!1)}))}))})),this._lastDataByCoordSys=t,this._cbParamsList=e,!!r},e.prototype._hide=function(t){this._lastDataByCoordSys=null,t({type:"hideTip",from:this.uid})},e.prototype.dispose=function(t,e){!r.node&&e.getDom()&&(Og(this,"_updatePosition"),this._tooltipContent.dispose(),oN("itemTooltip",e))},e.type="tooltip",e}(mg);function Qz(t,e,n){var i,r=e.ecModel;n?(i=new xc(n,r,r),i=new xc(e.option,i,r)):i=e;for(var o=t.length-1;o>=0;o--){var a=t[o];a&&(a instanceof xc&&(a=a.get("tooltip",!0)),X(a)&&(a={formatter:a}),a&&(i=new xc(a,i,r)))}return i}function tV(t,e){return t.dispatchAction||W(e.dispatchAction,e)}function eV(t){return"center"===t||"middle"===t}var nV=["rect","polygon","keep","clear"];function iV(t,e){var n=yo(t?t.brush:[]);if(n.length){var i=[];E(n,(function(t){var e=t.hasOwnProperty("toolbox")?t.toolbox:[];e instanceof Array&&(i=i.concat(e))}));var r=t&&t.toolbox;Y(r)&&(r=r[0]),r||(r={feature:{}},t.toolbox=[r]);var o=r.feature||(r.feature={}),a=o.brush||(o.brush={}),s=a.type||(a.type=[]);s.push.apply(s,i),function(t){var e={};E(t,(function(t){e[t]=1})),t.length=0,E(e,(function(e,n){t.push(n)}))}(s),e&&!s.length&&s.push.apply(s,nV)}}var rV=E;function oV(t){if(t)for(var e in t)if(t.hasOwnProperty(e))return!0}function aV(t,e,n){var i={};return rV(e,(function(e){var r,o=i[e]=((r=function(){}).prototype.__hidden=r.prototype,new r);rV(t[e],(function(t,i){if(sD.isValidType(i)){var r={type:i,visual:t};n&&n(r,e),o[i]=new sD(r),"opacity"===i&&((r=T(r)).type="colorAlpha",o.__hidden.__alphaForOpacity=new sD(r))}}))})),i}function sV(t,e,n){var i;E(n,(function(t){e.hasOwnProperty(t)&&oV(e[t])&&(i=!0)})),i&&E(n,(function(n){e.hasOwnProperty(n)&&oV(e[n])?t[n]=T(e[n]):delete t[n]}))}var lV={lineX:uV(0),lineY:uV(1),rect:{point:function(t,e,n){return t&&n.boundingRect.contain(t[0],t[1])},rect:function(t,e,n){return t&&n.boundingRect.intersect(t)}},polygon:{point:function(t,e,n){return t&&n.boundingRect.contain(t[0],t[1])&&x_(n.range,t[0],t[1])},rect:function(t,e,n){var i=n.range;if(!t||i.length<=1)return!1;var r=t.x,o=t.y,a=t.width,s=t.height,l=i[0];return!!(x_(i,r,o)||x_(i,r+a,o)||x_(i,r,o+s)||x_(i,r+a,o+s)||Re.create(t).contain(l[0],l[1])||Bh(r,o,r+a,o,i)||Bh(r,o,r,o+s,i)||Bh(r+a,o,r+a,o+s,i)||Bh(r,o+s,r+a,o+s,i))||void 0}}};function uV(t){var e=["x","y"],n=["width","height"];return{point:function(e,n,i){if(e){var r=i.range;return hV(e[t],r)}},rect:function(i,r,o){if(i){var a=o.range,s=[i[e[t]],i[e[t]]+i[n[t]]];return s[1]e[0][1]&&(e[0][1]=o[0]),o[1]e[1][1]&&(e[1][1]=o[1])}return e&&xV(e)}};function xV(t){return new Re(t[0][0],t[1][0],t[0][1]-t[0][0],t[1][1]-t[1][0])}var _V=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.init=function(t,e){this.ecModel=t,this.api=e,this.model,(this._brushController=new Vk(e.getZr())).on("brush",W(this._onBrush,this)).mount()},e.prototype.render=function(t,e,n,i){this.model=t,this._updateController(t,e,n,i)},e.prototype.updateTransform=function(t,e,n,i){fV(e),this._updateController(t,e,n,i)},e.prototype.updateVisual=function(t,e,n,i){this.updateTransform(t,e,n,i)},e.prototype.updateView=function(t,e,n,i){this._updateController(t,e,n,i)},e.prototype._updateController=function(t,e,n,i){(!i||i.$from!==t.id)&&this._brushController.setPanels(t.brushTargetManager.makePanelOpts(n)).enableBrush(t.brushOption).updateCovers(t.areas.slice())},e.prototype.dispose=function(){this._brushController.dispose()},e.prototype._onBrush=function(t){var e=this.model.id,n=this.model.brushTargetManager.setOutputRanges(t.areas,this.ecModel);(!t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:e,areas:T(n),$from:e}),t.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:e,areas:T(n),$from:e})},e.type="brush",e}(mg),bV=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.areas=[],n.brushOption={},n}return n(e,t),e.prototype.optionUpdated=function(t,e){var n=this.option;!e&&sV(n,t,["inBrush","outOfBrush"]);var i=n.inBrush=n.inBrush||{};n.outOfBrush=n.outOfBrush||{color:"#ddd"},i.hasOwnProperty("liftZ")||(i.liftZ=5)},e.prototype.setAreas=function(t){t&&(this.areas=z(t,(function(t){return wV(this.option,t)}),this))},e.prototype.setBrushOption=function(t){this.brushOption=wV(this.option,t),this.brushType=this.brushOption.brushType},e.type="brush",e.dependencies=["geo","grid","xAxis","yAxis","parallel","series"],e.defaultOption={seriesIndex:"all",brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:"rgba(210,219,238,0.3)",borderColor:"#D2DBEE"},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4},e}(Ap);function wV(t,e){return C({brushType:t.brushType,brushMode:t.brushMode,transformable:t.transformable,brushStyle:new xc(t.brushStyle).getItemStyle(),removeOnClick:t.removeOnClick,z:t.z},e,!0)}var SV=["rect","polygon","lineX","lineY","keep","clear"],MV=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.render=function(t,e,n){var i,r,o;e.eachComponent({mainType:"brush"},(function(t){i=t.brushType,r=t.brushOption.brushMode||"single",o=o||!!t.areas.length})),this._brushType=i,this._brushMode=r,E(t.get("type",!0),(function(e){t.setIconStatus(e,("keep"===e?"multiple"===r:"clear"===e?o:e===i)?"emphasis":"normal")}))},e.prototype.updateView=function(t,e,n){this.render(t,e,n)},e.prototype.getIcons=function(){var t=this.model,e=t.get("icon",!0),n={};return E(t.get("type",!0),(function(t){e[t]&&(n[t]=e[t])})),n},e.prototype.onclick=function(t,e,n){var i=this._brushType,r=this._brushMode;"clear"===n?(e.dispatchAction({type:"axisAreaSelect",intervals:[]}),e.dispatchAction({type:"brush",command:"clear",areas:[]})):e.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:"keep"===n?i:i!==n&&n,brushMode:"keep"===n?"multiple"===r?"single":"multiple":r}})},e.getDefaultOption=function(t){return{show:!0,type:SV.slice(),icon:{rect:"M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",polygon:"M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",lineX:"M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",lineY:"M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",keep:"M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",clear:"M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"},title:t.getLocaleModel().get(["toolbox","brush","title"])}},e}(ZE);var IV=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.layoutMode={type:"box",ignoreSize:!0},n}return n(e,t),e.type="title",e.defaultOption={z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:"#464646"},subtextStyle:{fontSize:12,color:"#6E7079"}},e}(Ap),TV=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.render=function(t,e,n){if(this.group.removeAll(),t.get("show")){var i=this.group,r=t.getModel("textStyle"),o=t.getModel("subtextStyle"),a=t.get("textAlign"),s=rt(t.get("textBaseline"),t.get("textVerticalAlign")),l=new Ns({style:$h(r,{text:t.get("text"),fill:r.getTextColor()},{disableBox:!0}),z2:10}),u=l.getBoundingRect(),h=t.get("subtext"),c=new Ns({style:$h(o,{text:h,fill:o.getTextColor(),y:u.height+t.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),p=t.get("link"),d=t.get("sublink"),f=t.get("triggerEvent",!0);l.silent=!p&&!f,c.silent=!d&&!f,p&&l.on("click",(function(){yp(p,"_"+t.get("target"))})),d&&c.on("click",(function(){yp(d,"_"+t.get("subtarget"))})),js(l).eventData=js(c).eventData=f?{componentType:"title",componentIndex:t.componentIndex}:null,i.add(l),h&&i.add(c);var g=i.getBoundingRect(),y=t.getBoxLayoutParams();y.width=g.width,y.height=g.height;var v=wp(y,{width:n.getWidth(),height:n.getHeight()},t.get("padding"));a||("middle"===(a=t.get("left")||t.get("right"))&&(a="center"),"right"===a?v.x+=v.width:"center"===a&&(v.x+=v.width/2)),s||("center"===(s=t.get("top")||t.get("bottom"))&&(s="middle"),"bottom"===s?v.y+=v.height:"middle"===s&&(v.y+=v.height/2),s=s||"top"),i.x=v.x,i.y=v.y,i.markRedraw();var m={align:a,verticalAlign:s};l.setStyle(m),c.setStyle(m),g=i.getBoundingRect();var x=v.margin,_=t.getItemStyle(["color","opacity"]);_.fill=t.get("backgroundColor");var b=new Ps({shape:{x:g.x-x[3],y:g.y-x[0],width:g.width+x[1]+x[3],height:g.height+x[0]+x[2],r:t.get("borderRadius")},style:_,subPixelOptimize:!0,silent:!0});i.add(b)}},e.type="title",e}(mg);var CV=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.layoutMode="box",n}return n(e,t),e.prototype.init=function(t,e,n){this.mergeDefaultAndTheme(t,n),this._initData()},e.prototype.mergeOption=function(e){t.prototype.mergeOption.apply(this,arguments),this._initData()},e.prototype.setCurrentIndex=function(t){null==t&&(t=this.option.currentIndex);var e=this._data.count();this.option.loop?t=(t%e+e)%e:(t>=e&&(t=e-1),t<0&&(t=0)),this.option.currentIndex=t},e.prototype.getCurrentIndex=function(){return this.option.currentIndex},e.prototype.isIndexMax=function(){return this.getCurrentIndex()>=this._data.count()-1},e.prototype.setPlayState=function(t){this.option.autoPlay=!!t},e.prototype.getPlayState=function(){return!!this.option.autoPlay},e.prototype._initData=function(){var t,e=this.option,n=e.data||[],i=e.axisType,r=this._names=[];"category"===i?(t=[],E(n,(function(e,n){var i,o=Mo(xo(e),"");q(e)?(i=T(e)).value=n:i=n,t.push(i),r.push(o)}))):t=n;var o={category:"ordinal",time:"time",value:"number"}[i]||"number";(this._data=new Jm([{name:"value",type:o}],this)).initData(t,r)},e.prototype.getData=function(){return this._data},e.prototype.getCategories=function(){if("category"===this.get("axisType"))return this._names.slice()},e.type="timeline",e.defaultOption={z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:5,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:"#000"},data:[]},e}(Ap),DV=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.type="timeline.slider",e.defaultOption=wc(CV.defaultOption,{backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"circle",symbolSize:12,lineStyle:{show:!0,width:2,color:"#DAE1F5"},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:"#A4B1D7"},itemStyle:{color:"#A4B1D7",borderWidth:1},checkpointStyle:{symbol:"circle",symbolSize:15,color:"#316bf3",borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0, 0, 0, 0.3)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:24,itemGap:12,position:"left",playIcon:"path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",stopIcon:"path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",nextIcon:"M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z",prevIcon:"M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z",prevBtnSize:18,nextBtnSize:18,color:"#A4B1D7",borderColor:"#A4B1D7",borderWidth:1},emphasis:{label:{show:!0,color:"#6f778d"},itemStyle:{color:"#316BF3"},controlStyle:{color:"#316BF3",borderColor:"#316BF3",borderWidth:2}},progress:{lineStyle:{color:"#316BF3"},itemStyle:{color:"#316BF3"},label:{color:"#6f778d"}},data:[]}),e}(CV);R(DV,cf.prototype);var AV=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.type="timeline",e}(mg),kV=function(t){function e(e,n,i,r){var o=t.call(this,e,n,i)||this;return o.type=r||"value",o}return n(e,t),e.prototype.getLabelModel=function(){return this.model.getModel("label")},e.prototype.isHorizontal=function(){return"horizontal"===this.model.get("orient")},e}(X_),LV=Math.PI,PV=Do(),OV=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.init=function(t,e){this.api=e},e.prototype.render=function(t,e,n){if(this.model=t,this.api=n,this.ecModel=e,this.group.removeAll(),t.get("show",!0)){var i=this._layout(t,n),r=this._createGroup("_mainGroup"),o=this._createGroup("_labelGroup"),a=this._axis=this._createAxis(i,t);t.formatTooltip=function(t){return qf("nameValue",{noName:!0,value:a.scale.getLabel({value:t})})},E(["AxisLine","AxisTick","Control","CurrentPointer"],(function(e){this["_render"+e](i,r,a,t)}),this),this._renderAxisLabel(i,o,a,t),this._position(i,t)}this._doPlayStop(),this._updateTicksStatus()},e.prototype.remove=function(){this._clearTimer(),this.group.removeAll()},e.prototype.dispose=function(){this._clearTimer()},e.prototype._layout=function(t,e){var n,i,r,o,a=t.get(["label","position"]),s=t.get("orient"),l=function(t,e){return wp(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()},t.get("padding"))}(t,e),u={horizontal:"center",vertical:(n=null==a||"auto"===a?"horizontal"===s?l.y+l.height/2=0||"+"===n?"left":"right"},h={horizontal:n>=0||"+"===n?"top":"bottom",vertical:"middle"},c={horizontal:0,vertical:LV/2},p="vertical"===s?l.height:l.width,d=t.getModel("controlStyle"),f=d.get("show",!0),g=f?d.get("itemSize"):0,y=f?d.get("itemGap"):0,v=g+y,m=t.get(["label","rotate"])||0;m=m*LV/180;var x=d.get("position",!0),_=f&&d.get("showPlayBtn",!0),b=f&&d.get("showPrevBtn",!0),w=f&&d.get("showNextBtn",!0),S=0,M=p;"left"===x||"bottom"===x?(_&&(i=[0,0],S+=v),b&&(r=[S,0],S+=v),w&&(o=[M-g,0],M-=v)):(_&&(i=[M-g,0],M-=v),b&&(r=[0,0],S+=v),w&&(o=[M-g,0],M-=v));var I=[S,M];return t.get("inverse")&&I.reverse(),{viewRect:l,mainLength:p,orient:s,rotation:c[s],labelRotation:m,labelPosOpt:n,labelAlign:t.get(["label","align"])||u[s],labelBaseline:t.get(["label","verticalAlign"])||t.get(["label","baseline"])||h[s],playPosition:i,prevBtnPosition:r,nextBtnPosition:o,axisExtent:I,controlSize:g,controlGap:y}},e.prototype._position=function(t,e){var n=this._mainGroup,i=this._labelGroup,r=t.viewRect;if("vertical"===t.orient){var o=[1,0,0,1,0,0],a=r.x,s=r.y+r.height;xe(o,o,[-a,-s]),_e(o,o,-LV/2),xe(o,o,[a,s]),(r=r.clone()).applyTransform(o)}var l=y(r),u=y(n.getBoundingRect()),h=y(i.getBoundingRect()),c=[n.x,n.y],p=[i.x,i.y];p[0]=c[0]=l[0][0];var d,f=t.labelPosOpt;null==f||X(f)?(v(c,u,l,1,d="+"===f?0:1),v(p,h,l,1,1-d)):(v(c,u,l,1,d=f>=0?0:1),p[1]=c[1]+f);function g(t){t.originX=l[0][0]-t.x,t.originY=l[1][0]-t.y}function y(t){return[[t.x,t.x+t.width],[t.y,t.y+t.height]]}function v(t,e,n,i,r){t[i]+=n[i][r]-e[i][r]}n.setPosition(c),i.setPosition(p),n.rotation=i.rotation=t.rotation,g(n),g(i)},e.prototype._createAxis=function(t,e){var n=e.getData(),i=e.get("axisType"),r=function(t,e){if(e=e||t.get("type"))switch(e){case"category":return new _x({ordinalMeta:t.getCategories(),extent:[1/0,-1/0]});case"time":return new zx({locale:t.ecModel.getLocaleModel(),useUTC:t.ecModel.get("useUTC")});default:return new Sx}}(e,i);r.getTicks=function(){return n.mapArray(["value"],(function(t){return{value:t}}))};var o=n.getDataExtent("value");r.setExtent(o[0],o[1]),r.calcNiceTicks();var a=new kV("value",r,t.axisExtent,i);return a.model=e,a},e.prototype._createGroup=function(t){var e=this[t]=new Pr;return this.group.add(e),e},e.prototype._renderAxisLine=function(t,e,n,i){var r=n.getExtent();if(i.get(["lineStyle","show"])){var o=new Wu({shape:{x1:r[0],y1:0,x2:r[1],y2:0},style:A({lineCap:"round"},i.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});e.add(o);var a=this._progressLine=new Wu({shape:{x1:r[0],x2:this._currentPointer?this._currentPointer.x:r[0],y1:0,y2:0},style:k({lineCap:"round",lineWidth:o.style.lineWidth},i.getModel(["progress","lineStyle"]).getLineStyle()),silent:!0,z2:1});e.add(a)}},e.prototype._renderAxisTick=function(t,e,n,i){var r=this,o=i.getData(),a=n.scale.getTicks();this._tickSymbols=[],E(a,(function(t){var a=n.dataToCoord(t.value),s=o.getItemModel(t.value),l=s.getModel("itemStyle"),u=s.getModel(["emphasis","itemStyle"]),h=s.getModel(["progress","itemStyle"]),c={x:a,y:0,onclick:W(r._changeTimeline,r,t.value)},p=RV(s,l,e,c);p.ensureState("emphasis").style=u.getItemStyle(),p.ensureState("progress").style=h.getItemStyle(),Vl(p);var d=js(p);s.get("tooltip")?(d.dataIndex=t.value,d.dataModel=i):d.dataIndex=d.dataModel=null,r._tickSymbols.push(p)}))},e.prototype._renderAxisLabel=function(t,e,n,i){var r=this;if(n.getLabelModel().get("show")){var o=i.getData(),a=n.getViewLabels();this._tickLabels=[],E(a,(function(i){var a=i.tickValue,s=o.getItemModel(a),l=s.getModel("label"),u=s.getModel(["emphasis","label"]),h=s.getModel(["progress","label"]),c=n.dataToCoord(i.tickValue),p=new Ns({x:c,y:0,rotation:t.labelRotation-t.rotation,onclick:W(r._changeTimeline,r,a),silent:!1,style:$h(l,{text:i.formattedLabel,align:t.labelAlign,verticalAlign:t.labelBaseline})});p.ensureState("emphasis").style=$h(u),p.ensureState("progress").style=$h(h),e.add(p),Vl(p),PV(p).dataIndex=a,r._tickLabels.push(p)}))}},e.prototype._renderControl=function(t,e,n,i){var r=t.controlSize,o=t.rotation,a=i.getModel("controlStyle").getItemStyle(),s=i.getModel(["emphasis","controlStyle"]).getItemStyle(),l=i.getPlayState(),u=i.get("inverse",!0);function h(t,n,l,u){if(t){var h=_r(rt(i.get(["controlStyle",n+"BtnSize"]),r),r),c=function(t,e,n,i){var r=i.style,o=Vh(t.get(["controlStyle",e]),i||{},new Re(n[0],n[1],n[2],n[3]));r&&o.setStyle(r);return o}(i,n+"Icon",[0,-h/2,h,h],{x:t[0],y:t[1],originX:r/2,originY:0,rotation:u?-o:0,rectHover:!0,style:a,onclick:l});c.ensureState("emphasis").style=s,e.add(c),Vl(c)}}h(t.nextBtnPosition,"next",W(this._changeTimeline,this,u?"-":"+")),h(t.prevBtnPosition,"prev",W(this._changeTimeline,this,u?"+":"-")),h(t.playPosition,l?"stop":"play",W(this._handlePlayClick,this,!l),!0)},e.prototype._renderCurrentPointer=function(t,e,n,i){var r=i.getData(),o=i.getCurrentIndex(),a=r.getItemModel(o).getModel("checkpointStyle"),s=this,l={onCreate:function(t){t.draggable=!0,t.drift=W(s._handlePointerDrag,s),t.ondragend=W(s._handlePointerDragend,s),NV(t,s._progressLine,o,n,i,!0)},onUpdate:function(t){NV(t,s._progressLine,o,n,i)}};this._currentPointer=RV(a,a,this._mainGroup,{},this._currentPointer,l)},e.prototype._handlePlayClick=function(t){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:t,from:this.uid})},e.prototype._handlePointerDrag=function(t,e,n){this._clearTimer(),this._pointerChangeTimeline([n.offsetX,n.offsetY])},e.prototype._handlePointerDragend=function(t){this._pointerChangeTimeline([t.offsetX,t.offsetY],!0)},e.prototype._pointerChangeTimeline=function(t,e){var n=this._toAxisCoord(t)[0],i=Hr(this._axis.getExtent().slice());n>i[1]&&(n=i[1]),n=0&&(a[o]=+a[o].toFixed(c)),[a,h]}var XV={min:H(UV,"min"),max:H(UV,"max"),average:H(UV,"average"),median:H(UV,"median")};function ZV(t,e){var n=t.getData(),i=t.coordinateSystem;if(e&&!function(t){return!isNaN(parseFloat(t.x))&&!isNaN(parseFloat(t.y))}(e)&&!Y(e.coord)&&i){var r=i.dimensions,o=jV(e,n,i,t);if((e=T(e)).type&&XV[e.type]&&o.baseAxis&&o.valueAxis){var a=P(r,o.baseAxis.dim),s=P(r,o.valueAxis.dim),l=XV[e.type](n,o.baseDataDim,o.valueDataDim,a,s);e.coord=l[0],e.value=l[1]}else{for(var u=[null!=e.xAxis?e.xAxis:e.radiusAxis,null!=e.yAxis?e.yAxis:e.angleAxis],h=0;h<2;h++)XV[u[h]]&&(u[h]=$V(n,n.mapDimension(r[h]),u[h]));e.coord=u}}return e}function jV(t,e,n,i){var r={};return null!=t.valueIndex||null!=t.valueDim?(r.valueDataDim=null!=t.valueIndex?e.getDimension(t.valueIndex):t.valueDim,r.valueAxis=n.getAxis(function(t,e){var n=t.getData().getDimensionInfo(e);return n&&n.coordDim}(i,r.valueDataDim)),r.baseAxis=n.getOtherAxis(r.valueAxis),r.baseDataDim=e.mapDimension(r.baseAxis.dim)):(r.baseAxis=i.getBaseAxis(),r.valueAxis=n.getOtherAxis(r.baseAxis),r.baseDataDim=e.mapDimension(r.baseAxis.dim),r.valueDataDim=e.mapDimension(r.valueAxis.dim)),r}function qV(t,e){return!(t&&t.containData&&e.coord&&!YV(e))||t.containData(e.coord)}function KV(t,e){return t?function(t,n,i,r){return yf(r<2?t.coord&&t.coord[r]:t.value,e[r])}:function(t,n,i,r){return yf(t.value,e[r])}}function $V(t,e,n){if("average"===n){var i=0,r=0;return t.each(e,(function(t,e){isNaN(t)||(i+=t,r++)})),i/r}return"median"===n?t.getMedian(e):t.getDataExtent(e)["max"===n?1:0]}var JV=Do(),QV=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.init=function(){this.markerGroupMap=ft()},e.prototype.render=function(t,e,n){var i=this,r=this.markerGroupMap;r.each((function(t){JV(t).keep=!1})),e.eachSeries((function(t){var r=WV.getMarkerModelFromSeries(t,i.type);r&&i.renderSeries(t,r,e,n)})),r.each((function(t){!JV(t).keep&&i.group.remove(t.group)}))},e.prototype.markKeep=function(t){JV(t).keep=!0},e.prototype.toggleBlurSeries=function(t,e){var n=this;E(t,(function(t){var i=WV.getMarkerModelFromSeries(t,n.type);i&&i.getData().eachItemGraphicEl((function(t){t&&(e?Cl(t):Dl(t))}))}))},e.type="marker",e}(mg);function tB(t,e,n){var i=e.coordinateSystem;t.each((function(r){var o,a=t.getItemModel(r),s=Gr(a.get("x"),n.getWidth()),l=Gr(a.get("y"),n.getHeight());if(isNaN(s)||isNaN(l)){if(e.getMarkerPosition)o=e.getMarkerPosition(t.getValues(t.dimensions,r));else if(i){var u=t.get(i.dimensions[0],r),h=t.get(i.dimensions[1],r);o=i.dataToPoint([u,h])}}else o=[s,l];isNaN(s)||(o[0]=s),isNaN(l)||(o[1]=l),t.setItemLayout(r,o)}))}var eB=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.updateTransform=function(t,e,n){e.eachSeries((function(t){var e=WV.getMarkerModelFromSeries(t,"markPoint");e&&(tB(e.getData(),t,n),this.markerGroupMap.get(t.id).updateLayout())}),this)},e.prototype.renderSeries=function(t,e,n,i){var r=t.coordinateSystem,o=t.id,a=t.getData(),s=this.markerGroupMap,l=s.get(o)||s.set(o,new Jw),u=function(t,e,n){var i;i=t?z(t&&t.dimensions,(function(t){return A(A({},e.getData().getDimensionInfo(e.getData().mapDimension(t))||{}),{name:t,ordinalMeta:null})})):[{name:"value",type:"float"}];var r=new Jm(i,n),o=z(n.get("data"),H(ZV,e));t&&(o=B(o,H(qV,t)));var a=KV(!!t,i);return r.initData(o,null,a),r}(r,t,e);e.setData(u),tB(e.getData(),t,i),u.each((function(t){var n=u.getItemModel(t),i=n.getShallow("symbol"),r=n.getShallow("symbolSize"),o=n.getShallow("symbolRotate"),s=n.getShallow("symbolOffset"),l=n.getShallow("symbolKeepAspect");if(U(i)||U(r)||U(o)||U(s)){var h=e.getRawValue(t),c=e.getDataParams(t);U(i)&&(i=i(h,c)),U(r)&&(r=r(h,c)),U(o)&&(o=o(h,c)),U(s)&&(s=s(h,c))}var p=n.getModel("itemStyle").getItemStyle(),d=my(a,"color");p.fill||(p.fill=d),u.setItemVisual(t,{symbol:i,symbolSize:r,symbolRotate:o,symbolOffset:s,symbolKeepAspect:l,style:p})})),l.updateData(u),this.group.add(l.group),u.eachItemGraphicEl((function(t){t.traverse((function(t){js(t).dataModel=e}))})),this.markKeep(l),l.group.silent=e.get("silent")||t.get("silent")},e.type="markPoint",e}(QV);var nB=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.createMarkerModelFromSeries=function(t,n,i){return new e(t,n,i)},e.type="markLine",e.defaultOption={z:5,symbol:["circle","arrow"],symbolSize:[8,16],symbolOffset:0,precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end",distance:5},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"},e}(WV),iB=Do(),rB=function(t,e,n,i){var r,o=t.getData();if(Y(i))r=i;else{var a=i.type;if("min"===a||"max"===a||"average"===a||"median"===a||null!=i.xAxis||null!=i.yAxis){var s=void 0,l=void 0;if(null!=i.yAxis||null!=i.xAxis)s=e.getAxis(null!=i.yAxis?"y":"x"),l=it(i.yAxis,i.xAxis);else{var u=jV(i,o,e,t);s=u.valueAxis,l=$V(o,ax(o,u.valueDataDim),a)}var h="x"===s.dim?0:1,c=1-h,p=T(i),d={coord:[]};p.type=null,p.coord=[],p.coord[c]=-1/0,d.coord[c]=1/0;var f=n.get("precision");f>=0&&j(l)&&(l=+l.toFixed(Math.min(f,20))),p.coord[h]=d.coord[h]=l,r=[p,d,{type:a,valueIndex:i.valueIndex,value:l}]}else r=[]}var g=[ZV(t,r[0]),ZV(t,r[1]),A({},r[2])];return g[2].type=g[2].type||null,C(g[2],g[0]),C(g[2],g[1]),g};function oB(t){return!isNaN(t)&&!isFinite(t)}function aB(t,e,n,i){var r=1-t,o=i.dimensions[t];return oB(e[r])&&oB(n[r])&&e[t]===n[t]&&i.getAxis(o).containData(e[t])}function sB(t,e){if("cartesian2d"===t.type){var n=e[0].coord,i=e[1].coord;if(n&&i&&(aB(1,n,i,t)||aB(0,n,i,t)))return!0}return qV(t,e[0])&&qV(t,e[1])}function lB(t,e,n,i,r){var o,a=i.coordinateSystem,s=t.getItemModel(e),l=Gr(s.get("x"),r.getWidth()),u=Gr(s.get("y"),r.getHeight());if(isNaN(l)||isNaN(u)){if(i.getMarkerPosition)o=i.getMarkerPosition(t.getValues(t.dimensions,e));else{var h=a.dimensions,c=t.get(h[0],e),p=t.get(h[1],e);o=a.dataToPoint([c,p])}if(pS(a,"cartesian2d")){var d=a.getAxis("x"),f=a.getAxis("y");h=a.dimensions;oB(t.get(h[0],e))?o[0]=d.toGlobalCoord(d.getExtent()[n?0:1]):oB(t.get(h[1],e))&&(o[1]=f.toGlobalCoord(f.getExtent()[n?0:1]))}isNaN(l)||(o[0]=l),isNaN(u)||(o[1]=u)}else o=[l,u];t.setItemLayout(e,o)}var uB=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.updateTransform=function(t,e,n){e.eachSeries((function(t){var e=WV.getMarkerModelFromSeries(t,"markLine");if(e){var i=e.getData(),r=iB(e).from,o=iB(e).to;r.each((function(e){lB(r,e,!0,t,n),lB(o,e,!1,t,n)})),i.each((function(t){i.setItemLayout(t,[r.getItemLayout(t),o.getItemLayout(t)])})),this.markerGroupMap.get(t.id).updateLayout()}}),this)},e.prototype.renderSeries=function(t,e,n,i){var r=t.coordinateSystem,o=t.id,a=t.getData(),s=this.markerGroupMap,l=s.get(o)||s.set(o,new _A);this.group.add(l.group);var u=function(t,e,n){var i;i=t?z(t&&t.dimensions,(function(t){return A(A({},e.getData().getDimensionInfo(e.getData().mapDimension(t))||{}),{name:t,ordinalMeta:null})})):[{name:"value",type:"float"}];var r=new Jm(i,n),o=new Jm(i,n),a=new Jm([],n),s=z(n.get("data"),H(rB,e,t,n));t&&(s=B(s,H(sB,t)));var l=KV(!!t,i);return r.initData(z(s,(function(t){return t[0]})),null,l),o.initData(z(s,(function(t){return t[1]})),null,l),a.initData(z(s,(function(t){return t[2]}))),a.hasItemOption=!0,{from:r,to:o,line:a}}(r,t,e),h=u.from,c=u.to,p=u.line;iB(e).from=h,iB(e).to=c,e.setData(p);var d=e.get("symbol"),f=e.get("symbolSize"),g=e.get("symbolRotate"),y=e.get("symbolOffset");function v(e,n,r){var o=e.getItemModel(n);lB(e,n,r,t,i);var s=o.getModel("itemStyle").getItemStyle();null==s.fill&&(s.fill=my(a,"color")),e.setItemVisual(n,{symbolKeepAspect:o.get("symbolKeepAspect"),symbolOffset:rt(o.get("symbolOffset",!0),y[r?0:1]),symbolRotate:rt(o.get("symbolRotate",!0),g[r?0:1]),symbolSize:rt(o.get("symbolSize"),f[r?0:1]),symbol:rt(o.get("symbol",!0),d[r?0:1]),style:s})}Y(d)||(d=[d,d]),Y(f)||(f=[f,f]),Y(g)||(g=[g,g]),Y(y)||(y=[y,y]),u.from.each((function(t){v(h,t,!0),v(c,t,!1)})),p.each((function(t){var e=p.getItemModel(t).getModel("lineStyle").getLineStyle();p.setItemLayout(t,[h.getItemLayout(t),c.getItemLayout(t)]),null==e.stroke&&(e.stroke=h.getItemVisual(t,"style").fill),p.setItemVisual(t,{fromSymbolKeepAspect:h.getItemVisual(t,"symbolKeepAspect"),fromSymbolOffset:h.getItemVisual(t,"symbolOffset"),fromSymbolRotate:h.getItemVisual(t,"symbolRotate"),fromSymbolSize:h.getItemVisual(t,"symbolSize"),fromSymbol:h.getItemVisual(t,"symbol"),toSymbolKeepAspect:c.getItemVisual(t,"symbolKeepAspect"),toSymbolOffset:c.getItemVisual(t,"symbolOffset"),toSymbolRotate:c.getItemVisual(t,"symbolRotate"),toSymbolSize:c.getItemVisual(t,"symbolSize"),toSymbol:c.getItemVisual(t,"symbol"),style:e})})),l.updateData(p),u.line.eachItemGraphicEl((function(t){js(t).dataModel=e,t.traverse((function(t){js(t).dataModel=e}))})),this.markKeep(l),l.group.silent=e.get("silent")||t.get("silent")},e.type="markLine",e}(QV);var hB=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.createMarkerModelFromSeries=function(t,n,i){return new e(t,n,i)},e.type="markArea",e.defaultOption={z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}},e}(WV),cB=Do(),pB=function(t,e,n,i){var r=ZV(t,i[0]),o=ZV(t,i[1]),a=r.coord,s=o.coord;a[0]=it(a[0],-1/0),a[1]=it(a[1],-1/0),s[0]=it(s[0],1/0),s[1]=it(s[1],1/0);var l=D([{},r,o]);return l.coord=[r.coord,o.coord],l.x0=r.x,l.y0=r.y,l.x1=o.x,l.y1=o.y,l};function dB(t){return!isNaN(t)&&!isFinite(t)}function fB(t,e,n,i){var r=1-t;return dB(e[r])&&dB(n[r])}function gB(t,e){var n=e.coord[0],i=e.coord[1],r={coord:n,x:e.x0,y:e.y0},o={coord:i,x:e.x1,y:e.y1};return pS(t,"cartesian2d")?!(!n||!i||!fB(1,n,i)&&!fB(0,n,i))||function(t,e,n){return!(t&&t.containZone&&e.coord&&n.coord&&!YV(e)&&!YV(n))||t.containZone(e.coord,n.coord)}(t,r,o):qV(t,r)||qV(t,o)}function yB(t,e,n,i,r){var o,a=i.coordinateSystem,s=t.getItemModel(e),l=Gr(s.get(n[0]),r.getWidth()),u=Gr(s.get(n[1]),r.getHeight());if(isNaN(l)||isNaN(u)){if(i.getMarkerPosition)o=i.getMarkerPosition(t.getValues(n,e));else{var h=[d=t.get(n[0],e),f=t.get(n[1],e)];a.clampData&&a.clampData(h,h),o=a.dataToPoint(h,!0)}if(pS(a,"cartesian2d")){var c=a.getAxis("x"),p=a.getAxis("y"),d=t.get(n[0],e),f=t.get(n[1],e);dB(d)?o[0]=c.toGlobalCoord(c.getExtent()["x0"===n[0]?0:1]):dB(f)&&(o[1]=p.toGlobalCoord(p.getExtent()["y0"===n[1]?0:1]))}isNaN(l)||(o[0]=l),isNaN(u)||(o[1]=u)}else o=[l,u];return o}var vB=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],mB=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.updateTransform=function(t,e,n){e.eachSeries((function(t){var e=WV.getMarkerModelFromSeries(t,"markArea");if(e){var i=e.getData();i.each((function(e){var r=z(vB,(function(r){return yB(i,e,r,t,n)}));i.setItemLayout(e,r),i.getItemGraphicEl(e).setShape("points",r)}))}}),this)},e.prototype.renderSeries=function(t,e,n,i){var r=t.coordinateSystem,o=t.id,a=t.getData(),s=this.markerGroupMap,l=s.get(o)||s.set(o,{group:new Pr});this.group.add(l.group),this.markKeep(l);var u=function(t,e,n){var i,r,o=["x0","y0","x1","y1"];if(t){var a=z(t&&t.dimensions,(function(t){var n=e.getData();return A(A({},n.getDimensionInfo(n.mapDimension(t))||{}),{name:t,ordinalMeta:null})}));r=z(o,(function(t,e){return{name:t,type:a[e%2].type}})),i=new Jm(r,n)}else i=new Jm(r=[{name:"value",type:"float"}],n);var s=z(n.get("data"),H(pB,e,t,n));t&&(s=B(s,H(gB,t)));var l=t?function(t,e,n,i){return yf(t.coord[Math.floor(i/2)][i%2],r[i])}:function(t,e,n,i){return yf(t.value,r[i])};return i.initData(s,null,l),i.hasItemOption=!0,i}(r,t,e);e.setData(u),u.each((function(e){var n=z(vB,(function(n){return yB(u,e,n,t,i)})),o=r.getAxis("x").scale,s=r.getAxis("y").scale,l=o.getExtent(),h=s.getExtent(),c=[o.parse(u.get("x0",e)),o.parse(u.get("x1",e))],p=[s.parse(u.get("y0",e)),s.parse(u.get("y1",e))];Hr(c),Hr(p);var d=!!(l[0]>c[1]||l[1]p[1]||h[1]=0},e.prototype.getOrient=function(){return"vertical"===this.get("orient")?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},e.type="legend.plain",e.dependencies=["series"],e.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},e}(Ap),_B=H,bB=E,wB=Pr,SB=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.newlineDisabled=!1,n}return n(e,t),e.prototype.init=function(){this.group.add(this._contentGroup=new wB),this.group.add(this._selectorGroup=new wB),this._isFirstRender=!0},e.prototype.getContentGroup=function(){return this._contentGroup},e.prototype.getSelectorGroup=function(){return this._selectorGroup},e.prototype.render=function(t,e,n){var i=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),t.get("show",!0)){var r=t.get("align"),o=t.get("orient");r&&"auto"!==r||(r="right"===t.get("left")&&"vertical"===o?"right":"left");var a=t.get("selector",!0),s=t.get("selectorPosition",!0);!a||s&&"auto"!==s||(s="horizontal"===o?"end":"start"),this.renderInner(r,t,e,n,a,o,s);var l=t.getBoxLayoutParams(),u={width:n.getWidth(),height:n.getHeight()},h=t.get("padding"),c=wp(l,u,h),p=this.layoutInner(t,r,c,i,a,s),d=wp(k({width:p.width,height:p.height},l),u,h);this.group.x=d.x-p.x,this.group.y=d.y-p.y,this.group.markRedraw(),this.group.add(this._backgroundEl=JE(p,t))}},e.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},e.prototype.renderInner=function(t,e,n,i,r,o,a){var s=this.getContentGroup(),l=ft(),u=e.get("selectedMode"),h=[];n.eachRawSeries((function(t){!t.get("legendHoverLink")&&h.push(t.id)})),bB(e.getData(),(function(r,o){var a=r.get("name");if(!this.newlineDisabled&&(""===a||"\n"===a)){var c=new wB;return c.newline=!0,void s.add(c)}var p=n.getSeriesByName(a)[0];if(!l.get(a)){if(p){var d=p.getData(),f=d.getVisual("legendLineStyle")||{},g=d.getVisual("legendIcon"),y=d.getVisual("style");this._createItem(p,a,o,r,e,t,f,y,g,u,i).on("click",_B(MB,a,null,i,h)).on("mouseover",_B(TB,p.name,null,i,h)).on("mouseout",_B(CB,p.name,null,i,h)),l.set(a,!0)}else n.eachRawSeries((function(n){if(!l.get(a)&&n.legendVisualProvider){var s=n.legendVisualProvider;if(!s.containName(a))return;var c=s.indexOfName(a),p=s.getItemVisual(c,"style"),d=s.getItemVisual(c,"legendIcon"),f=Xn(p.fill);f&&0===f[3]&&(f[3]=.2,p=A(A({},p),{fill:ei(f,"rgba")})),this._createItem(n,a,o,r,e,t,{},p,d,u,i).on("click",_B(MB,null,a,i,h)).on("mouseover",_B(TB,null,a,i,h)).on("mouseout",_B(CB,null,a,i,h)),l.set(a,!0)}}),this);0}}),this),r&&this._createSelector(r,e,i,o,a)},e.prototype._createSelector=function(t,e,n,i,r){var o=this.getSelectorGroup();bB(t,(function(t){var i=t.type,r=new Ns({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:"all"===i?"legendAllSelect":"legendInverseSelect"})}});o.add(r),qh(r,{normal:e.getModel("selectorLabel"),emphasis:e.getModel(["emphasis","selectorLabel"])},{defaultText:t.title}),Vl(r)}))},e.prototype._createItem=function(t,e,n,i,r,o,a,s,l,u,h){var c=t.visualDrawType,p=r.get("itemWidth"),d=r.get("itemHeight"),f=r.isSelected(e),g=i.get("symbolRotate"),y=i.get("symbolKeepAspect"),v=i.get("icon"),m=function(t,e,n,i,r,o,a){function s(t,e){"auto"===t.lineWidth&&(t.lineWidth=e.lineWidth>0?2:0),bB(t,(function(n,i){"inherit"===t[i]&&(t[i]=e[i])}))}var l=e.getModel("itemStyle"),u=l.getItemStyle(),h=0===t.lastIndexOf("empty",0)?"fill":"stroke",c=l.getShallow("decal");u.decal=c&&"inherit"!==c?sv(c,a):i.decal,"inherit"===u.fill&&(u.fill=i[r]);"inherit"===u.stroke&&(u.stroke=i[h]);"inherit"===u.opacity&&(u.opacity=("fill"===r?i:n).opacity);s(u,i);var p=e.getModel("lineStyle"),d=p.getLineStyle();if(s(d,n),"auto"===u.fill&&(u.fill=i.fill),"auto"===u.stroke&&(u.stroke=i.fill),"auto"===d.stroke&&(d.stroke=i.fill),!o){var f=e.get("inactiveBorderWidth"),g=u[h];u.lineWidth="auto"===f?i.lineWidth>0&&g?2:0:u.lineWidth,u.fill=e.get("inactiveColor"),u.stroke=e.get("inactiveBorderColor"),d.stroke=p.get("inactiveColor"),d.lineWidth=p.get("inactiveWidth")}return{itemStyle:u,lineStyle:d}}(l=v||l||"roundRect",i,a,s,c,f,h),x=new wB,_=i.getModel("textStyle");if(!U(t.getLegendIcon)||v&&"inherit"!==v){var b="inherit"===v&&t.getData().getVisual("symbol")?"inherit"===g?t.getData().getVisual("symbolRotate"):g:0;x.add(function(t){var e=t.icon||"roundRect",n=Ry(e,0,0,t.itemWidth,t.itemHeight,t.itemStyle.fill,t.symbolKeepAspect);n.setStyle(t.itemStyle),n.rotation=(t.iconRotate||0)*Math.PI/180,n.setOrigin([t.itemWidth/2,t.itemHeight/2]),e.indexOf("empty")>-1&&(n.style.stroke=n.style.fill,n.style.fill="#fff",n.style.lineWidth=2);return n}({itemWidth:p,itemHeight:d,icon:l,iconRotate:b,itemStyle:m.itemStyle,lineStyle:m.lineStyle,symbolKeepAspect:y}))}else x.add(t.getLegendIcon({itemWidth:p,itemHeight:d,icon:l,iconRotate:g,itemStyle:m.itemStyle,lineStyle:m.lineStyle,symbolKeepAspect:y}));var w="left"===o?p+5:-5,S=o,M=r.get("formatter"),I=e;X(M)&&M?I=M.replace("{name}",null!=e?e:""):U(M)&&(I=M(e));var T=i.get("inactiveColor");x.add(new Ns({style:$h(_,{text:I,x:w,y:d/2,fill:f?_.getTextColor():T,align:S,verticalAlign:"middle"})}));var C=new Ps({shape:x.getBoundingRect(),invisible:!0}),D=i.getModel("tooltip");return D.get("show")&&Wh({el:C,componentModel:r,itemName:e,itemTooltipOption:D.option}),x.add(C),x.eachChild((function(t){t.silent=!0})),C.silent=!u,this.getContentGroup().add(x),Vl(x),x.__legendDataIndex=n,x},e.prototype.layoutInner=function(t,e,n,i,r,o){var a=this.getContentGroup(),s=this.getSelectorGroup();bp(t.get("orient"),a,t.get("itemGap"),n.width,n.height);var l=a.getBoundingRect(),u=[-l.x,-l.y];if(s.markRedraw(),a.markRedraw(),r){bp("horizontal",s,t.get("selectorItemGap",!0));var h=s.getBoundingRect(),c=[-h.x,-h.y],p=t.get("selectorButtonGap",!0),d=t.getOrient().index,f=0===d?"width":"height",g=0===d?"height":"width",y=0===d?"y":"x";"end"===o?c[d]+=l[f]+p:u[d]+=h[f]+p,c[1-d]+=l[g]/2-h[g]/2,s.x=c[0],s.y=c[1],a.x=u[0],a.y=u[1];var v={x:0,y:0};return v[f]=l[f]+p+h[f],v[g]=Math.max(l[g],h[g]),v[y]=Math.min(0,h[y]+c[1-d]),v}return a.x=u[0],a.y=u[1],this.group.getBoundingRect()},e.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},e.type="legend.plain",e}(mg);function MB(t,e,n,i){CB(t,e,n,i),n.dispatchAction({type:"legendToggleSelect",name:null!=t?t:e}),TB(t,e,n,i)}function IB(t){for(var e,n=t.getZr().storage.getDisplayList(),i=0,r=n.length;in[r],f=[-c.x,-c.y];e||(f[i]=l[s]);var g=[0,0],y=[-p.x,-p.y],v=rt(t.get("pageButtonGap",!0),t.get("itemGap",!0));d&&("end"===t.get("pageButtonPosition",!0)?y[i]+=n[r]-p[r]:g[i]+=p[r]+v);y[1-i]+=c[o]/2-p[o]/2,l.setPosition(f),u.setPosition(g),h.setPosition(y);var m={x:0,y:0};if(m[r]=d?n[r]:c[r],m[o]=Math.max(c[o],p[o]),m[a]=Math.min(0,p[a]+y[1-i]),u.__rectSize=n[r],d){var x={x:0,y:0};x[r]=Math.max(n[r]-p[r]-v,0),x[o]=m[o],u.setClipPath(new Ps({shape:x})),u.__rectSize=x[r]}else h.eachChild((function(t){t.attr({invisible:!0,silent:!0})}));var _=this._getPageInfo(t);return null!=_.pageIndex&&uh(l,{x:_.contentPosition[0],y:_.contentPosition[1]},d?t:null),this._updatePageInfoView(t,_),m},e.prototype._pageGo=function(t,e,n){var i=this._getPageInfo(e)[t];null!=i&&n.dispatchAction({type:"legendScroll",scrollDataIndex:i,legendId:e.id})},e.prototype._updatePageInfoView=function(t,e){var n=this._controllerGroup;E(["pagePrev","pageNext"],(function(i){var r=null!=e[i+"DataIndex"],o=n.childOfName(i);o&&(o.setStyle("fill",r?t.get("pageIconColor",!0):t.get("pageIconInactiveColor",!0)),o.cursor=r?"pointer":"default")}));var i=n.childOfName("pageText"),r=t.get("pageFormatter"),o=e.pageIndex,a=null!=o?o+1:0,s=e.pageCount;i&&r&&i.setStyle("text",X(r)?r.replace("{current}",null==a?"":a+"").replace("{total}",null==s?"":s+""):r({current:a,total:s}))},e.prototype._getPageInfo=function(t){var e=t.get("scrollDataIndex",!0),n=this.getContentGroup(),i=this._containerGroup.__rectSize,r=t.getOrient().index,o=RB[r],a=NB[r],s=this._findTargetItemIndex(e),l=n.children(),u=l[s],h=l.length,c=h?1:0,p={contentPosition:[n.x,n.y],pageCount:c,pageIndex:c-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!u)return p;var d=m(u);p.contentPosition[r]=-d.s;for(var f=s+1,g=d,y=d,v=null;f<=h;++f)(!(v=m(l[f]))&&y.e>g.s+i||v&&!x(v,g.s))&&(g=y.i>g.i?y:v)&&(null==p.pageNextDataIndex&&(p.pageNextDataIndex=g.i),++p.pageCount),y=v;for(f=s-1,g=d,y=d,v=null;f>=-1;--f)(v=m(l[f]))&&x(y,v.s)||!(g.i=e&&t.s<=e+i}},e.prototype._findTargetItemIndex=function(t){return this._showController?(this.getContentGroup().eachChild((function(i,r){var o=i.__legendDataIndex;null==n&&null!=o&&(n=r),o===t&&(e=r)})),null!=e?e:n):0;var e,n},e.type="legend.scroll",e}(SB);function zB(t){Im(kB),t.registerComponentModel(LB),t.registerComponentView(EB),function(t){t.registerAction("legendScroll","legendscroll",(function(t,e){var n=t.scrollDataIndex;null!=n&&e.eachComponent({mainType:"legend",subType:"scroll",query:t},(function(t){t.setScrollDataIndex(n)}))}))}(t)}var VB=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.type="dataZoom.inside",e.defaultOption=wc(NE.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),e}(NE),BB=Do();function FB(t,e,n){BB(t).coordSysRecordMap.each((function(t){var i=t.dataZoomInfoMap.get(e.uid);i&&(i.getRange=n)}))}function GB(t,e){if(e){t.removeKey(e.model.uid);var n=e.controller;n&&n.dispose()}}function WB(t,e){t.isDisposed()||t.dispatchAction({type:"dataZoom",animation:{easing:"cubicOut",duration:100},batch:e})}function HB(t,e,n,i){return t.coordinateSystem.containPoint([n,i])}function YB(t){t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,(function(t,e){var n=BB(e),i=n.coordSysRecordMap||(n.coordSysRecordMap=ft());i.each((function(t){t.dataZoomInfoMap=null})),t.eachComponent({mainType:"dataZoom",subType:"inside"},(function(t){E(OE(t).infoList,(function(n){var r=n.model.uid,o=i.get(r)||i.set(r,function(t,e){var n={model:e,containsPoint:H(HB,e),dispatchAction:H(WB,t),dataZoomInfoMap:null,controller:null},i=n.controller=new OI(t.getZr());return E(["pan","zoom","scrollMove"],(function(t){i.on(t,(function(e){var i=[];n.dataZoomInfoMap.each((function(r){if(e.isAvailableBehavior(r.model.option)){var o=(r.getRange||{})[t],a=o&&o(r.dzReferCoordSysInfo,n.model.mainType,n.controller,e);!r.model.get("disabled",!0)&&a&&i.push({dataZoomId:r.model.id,start:a[0],end:a[1]})}})),i.length&&n.dispatchAction(i)}))})),n}(e,n.model));(o.dataZoomInfoMap||(o.dataZoomInfoMap=ft())).set(t.uid,{dzReferCoordSysInfo:n,model:t,getRange:null})}))})),i.each((function(t){var e,n=t.controller,r=t.dataZoomInfoMap;if(r){var o=r.keys()[0];null!=o&&(e=r.get(o))}if(e){var a=function(t){var e,n="type_",i={type_true:2,type_move:1,type_false:0,type_undefined:-1},r=!0;return t.each((function(t){var o=t.model,a=!o.get("disabled",!0)&&(!o.get("zoomLock",!0)||"move");i[n+a]>i[n+e]&&(e=a),r=r&&o.get("preventDefaultMouseMove",!0)})),{controlType:e,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!r}}}(r);n.enable(a.controlType,a.opt),n.setPointerChecker(t.containsPoint),Pg(t,"dispatchAction",e.model.get("throttle",!0),"fixRate")}else GB(i,t)}))}))}var UB=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="dataZoom.inside",e}return n(e,t),e.prototype.render=function(e,n,i){t.prototype.render.apply(this,arguments),e.noTarget()?this._clear():(this.range=e.getPercentRange(),FB(i,e,{pan:W(XB.pan,this),zoom:W(XB.zoom,this),scrollMove:W(XB.scrollMove,this)}))},e.prototype.dispose=function(){this._clear(),t.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){!function(t,e){for(var n=BB(t).coordSysRecordMap,i=n.keys(),r=0;r0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(o[1]-o[0])+o[0],u=Math.max(1/i.scale,0);o[0]=(o[0]-l)*u+l,o[1]=(o[1]-l)*u+l;var h=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();return dk(0,o,[0,100],0,h.minSpan,h.maxSpan),this.range=o,r[0]!==o[0]||r[1]!==o[1]?o:void 0}},pan:ZB((function(t,e,n,i,r,o){var a=jB[i]([o.oldX,o.oldY],[o.newX,o.newY],e,r,n);return a.signal*(t[1]-t[0])*a.pixel/a.pixelLength})),scrollMove:ZB((function(t,e,n,i,r,o){return jB[i]([0,0],[o.scrollDelta,o.scrollDelta],e,r,n).signal*(t[1]-t[0])*o.scrollDelta}))};function ZB(t){return function(e,n,i,r){var o=this.range,a=o.slice(),s=e.axisModels[0];if(s)return dk(t(a,s,e,n,i,r),a,[0,100],"all"),this.range=a,o[0]!==a[0]||o[1]!==a[1]?a:void 0}}var jB={grid:function(t,e,n,i,r){var o=n.axis,a={},s=r.model.coordinateSystem.getRect();return t=t||[0,0],"x"===o.dim?(a.pixel=e[0]-t[0],a.pixelLength=s.width,a.pixelStart=s.x,a.signal=o.inverse?1:-1):(a.pixel=e[1]-t[1],a.pixelLength=s.height,a.pixelStart=s.y,a.signal=o.inverse?-1:1),a},polar:function(t,e,n,i,r){var o=n.axis,a={},s=r.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return t=t?s.pointToCoord(t):[0,0],e=s.pointToCoord(e),"radiusAxis"===n.mainType?(a.pixel=e[0]-t[0],a.pixelLength=l[1]-l[0],a.pixelStart=l[0],a.signal=o.inverse?1:-1):(a.pixel=e[1]-t[1],a.pixelLength=u[1]-u[0],a.pixelStart=u[0],a.signal=o.inverse?-1:1),a},singleAxis:function(t,e,n,i,r){var o=n.axis,a=r.model.coordinateSystem.getRect(),s={};return t=t||[0,0],"horizontal"===o.orient?(s.pixel=e[0]-t[0],s.pixelLength=a.width,s.pixelStart=a.x,s.signal=o.inverse?1:-1):(s.pixel=e[1]-t[1],s.pixelLength=a.height,s.pixelStart=a.y,s.signal=o.inverse?-1:1),s}};function qB(t){UE(t),t.registerComponentModel(VB),t.registerComponentView(UB),YB(t)}var KB=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.type="dataZoom.slider",e.layoutMode="box",e.defaultOption=wc(NE.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:"#d2dbee",borderRadius:3,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#d2dbee",width:.5},areaStyle:{color:"#d2dbee",opacity:.2}},selectedDataBackground:{lineStyle:{color:"#8fb0f7",width:.5},areaStyle:{color:"#8fb0f7",opacity:.2}},fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",handleSize:"100%",handleStyle:{color:"#fff",borderColor:"#ACB8D1"},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:"#D2DBEE",opacity:.7},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#6E7079"},brushSelect:!0,brushStyle:{color:"rgba(135,175,274,0.15)"},emphasis:{handleStyle:{borderColor:"#8FB0F7"},moveHandleStyle:{color:"#8FB0F7"}}}),e}(NE),$B=Ps,JB="horizontal",QB="vertical",tF=["line","bar","candlestick","scatter"],eF={easing:"cubicOut",duration:100,delay:0},nF=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._displayables={},n}return n(e,t),e.prototype.init=function(t,e){this.api=e,this._onBrush=W(this._onBrush,this),this._onBrushEnd=W(this._onBrushEnd,this)},e.prototype.render=function(e,n,i,r){if(t.prototype.render.apply(this,arguments),Pg(this,"_dispatchZoomAction",e.get("throttle"),"fixRate"),this._orient=e.getOrient(),!1!==e.get("show")){if(e.noTarget())return this._clear(),void this.group.removeAll();r&&"dataZoom"===r.type&&r.from===this.uid||this._buildView(),this._updateView()}else this.group.removeAll()},e.prototype.dispose=function(){this._clear(),t.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){Og(this,"_dispatchZoomAction");var t=this.api.getZr();t.off("mousemove",this._onBrush),t.off("mouseup",this._onBrushEnd)},e.prototype._buildView=function(){var t=this.group;t.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var e=this._displayables.sliderGroup=new Pr;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),t.add(e),this._positionGroup()},e.prototype._resetLocation=function(){var t=this.dataZoomModel,e=this.api,n=t.get("brushSelect")?7:0,i=this._findCoordRect(),r={width:e.getWidth(),height:e.getHeight()},o=this._orient===JB?{right:r.width-i.x-i.width,top:r.height-30-7-n,width:i.width,height:30}:{right:7,top:i.y,width:30,height:i.height},a=Tp(t.option);E(["right","top","width","height"],(function(t){"ph"===a[t]&&(a[t]=o[t])}));var s=wp(a,r);this._location={x:s.x,y:s.y},this._size=[s.width,s.height],this._orient===QB&&this._size.reverse()},e.prototype._positionGroup=function(){var t=this.group,e=this._location,n=this._orient,i=this.dataZoomModel.getFirstTargetAxisModel(),r=i&&i.get("inverse"),o=this._displayables.sliderGroup,a=(this._dataShadowInfo||{}).otherAxisInverse;o.attr(n!==JB||r?n===JB&&r?{scaleY:a?1:-1,scaleX:-1}:n!==QB||r?{scaleY:a?-1:1,scaleX:-1,rotation:Math.PI/2}:{scaleY:a?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:a?1:-1,scaleX:1});var s=t.getBoundingRect([o]);t.x=e.x-s.x,t.y=e.y-s.y,t.markRedraw()},e.prototype._getViewExtent=function(){return[0,this._size[0]]},e.prototype._renderBackground=function(){var t=this.dataZoomModel,e=this._size,n=this._displayables.sliderGroup,i=t.get("brushSelect");n.add(new $B({silent:!0,shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:t.get("backgroundColor")},z2:-40}));var r=new $B({shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:"transparent"},z2:0,onclick:W(this._onClickPanel,this)}),o=this.api.getZr();i?(r.on("mousedown",this._onBrushStart,this),r.cursor="crosshair",o.on("mousemove",this._onBrush),o.on("mouseup",this._onBrushEnd)):(o.off("mousemove",this._onBrush),o.off("mouseup",this._onBrushEnd)),n.add(r)},e.prototype._renderDataShadow=function(){var t=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],t){var e=this._size,n=this._shadowSize||[],i=t.series,r=i.getRawData(),o=i.getShadowDim&&i.getShadowDim(),a=o&&r.getDimensionInfo(o)?i.getShadowDim():t.otherDim;if(null!=a){var s=this._shadowPolygonPts,l=this._shadowPolylinePts;if(r!==this._shadowData||a!==this._shadowDim||e[0]!==n[0]||e[1]!==n[1]){var u=r.getDataExtent(a),h=.3*(u[1]-u[0]);u=[u[0]-h,u[1]+h];var c,p=[0,e[1]],d=[0,e[0]],f=[[e[0],0],[0,0]],g=[],y=d[1]/(r.count()-1),v=0,m=Math.round(r.count()/e[0]);r.each([a],(function(t,e){if(m>0&&e%m)v+=y;else{var n=null==t||isNaN(t)||""===t,i=n?0:Fr(t,u,p,!0);n&&!c&&e?(f.push([f[f.length-1][0],0]),g.push([g[g.length-1][0],0])):!n&&c&&(f.push([v,0]),g.push([v,0])),f.push([v,i]),g.push([v,i]),v+=y,c=n}})),s=this._shadowPolygonPts=f,l=this._shadowPolylinePts=g}this._shadowData=r,this._shadowDim=a,this._shadowSize=[e[0],e[1]];for(var x=this.dataZoomModel,_=0;_<3;_++){var b=w(1===_);this._displayables.sliderGroup.add(b),this._displayables.dataShadowSegs.push(b)}}}function w(t){var e=x.getModel(t?"selectedDataBackground":"dataBackground"),n=new Pr,i=new zu({shape:{points:s},segmentIgnoreThreshold:1,style:e.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),r=new Bu({shape:{points:l},segmentIgnoreThreshold:1,style:e.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return n.add(i),n.add(r),n}},e.prototype._prepareDataShadowInfo=function(){var t=this.dataZoomModel,e=t.get("showDataShadow");if(!1!==e){var n,i=this.ecModel;return t.eachTargetAxis((function(r,o){E(t.getAxisProxy(r,o).getTargetSeriesModels(),(function(t){if(!(n||!0!==e&&P(tF,t.get("type"))<0)){var a,s=i.getComponent(LE(r),o).axis,l={x:"y",y:"x",radius:"angle",angle:"radius"}[r],u=t.coordinateSystem;null!=l&&u.getOtherAxis&&(a=u.getOtherAxis(s).inverse),l=t.getData().mapDimension(l),n={thisAxis:s,series:t,thisDim:r,otherDim:l,otherAxisInverse:a}}}),this)}),this),n}},e.prototype._renderHandle=function(){var t=this.group,e=this._displayables,n=e.handles=[null,null],i=e.handleLabels=[null,null],r=this._displayables.sliderGroup,o=this._size,a=this.dataZoomModel,s=this.api,l=a.get("borderRadius")||0,u=a.get("brushSelect"),h=e.filler=new $B({silent:u,style:{fill:a.get("fillerColor")},textConfig:{position:"inside"}});r.add(h),r.add(new $B({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:o[0],height:o[1],r:l},style:{stroke:a.get("dataBackgroundColor")||a.get("borderColor"),lineWidth:1,fill:"rgba(0,0,0,0)"}})),E([0,1],(function(e){var o=a.get("handleIcon");!Ly[o]&&o.indexOf("path://")<0&&o.indexOf("image://")<0&&(o="path://"+o);var s=Ry(o,-1,0,2,2,null,!0);s.attr({cursor:iF(this._orient),draggable:!0,drift:W(this._onDragMove,this,e),ondragend:W(this._onDragEnd,this),onmouseover:W(this._showDataInfo,this,!0),onmouseout:W(this._showDataInfo,this,!1),z2:5});var l=s.getBoundingRect(),u=a.get("handleSize");this._handleHeight=Gr(u,this._size[1]),this._handleWidth=l.width/l.height*this._handleHeight,s.setStyle(a.getModel("handleStyle").getItemStyle()),s.style.strokeNoScale=!0,s.rectHover=!0,s.ensureState("emphasis").style=a.getModel(["emphasis","handleStyle"]).getItemStyle(),Vl(s);var h=a.get("handleColor");null!=h&&(s.style.fill=h),r.add(n[e]=s);var c=a.getModel("textStyle");t.add(i[e]=new Ns({silent:!0,invisible:!0,style:$h(c,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:c.getTextColor(),font:c.getFont()}),z2:10}))}),this);var c=h;if(u){var p=Gr(a.get("moveHandleSize"),o[1]),d=e.moveHandle=new Ps({style:a.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:o[1]-.5,height:p}}),f=.8*p,g=e.moveHandleIcon=Ry(a.get("moveHandleIcon"),-f/2,-f/2,f,f,"#fff",!0);g.silent=!0,g.y=o[1]+p/2-.5,d.ensureState("emphasis").style=a.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var y=Math.min(o[1]/2,Math.max(p,10));(c=e.moveZone=new Ps({invisible:!0,shape:{y:o[1]-y,height:p+y}})).on("mouseover",(function(){s.enterEmphasis(d)})).on("mouseout",(function(){s.leaveEmphasis(d)})),r.add(d),r.add(g),r.add(c)}c.attr({draggable:!0,cursor:iF(this._orient),drift:W(this._onDragMove,this,"all"),ondragstart:W(this._showDataInfo,this,!0),ondragend:W(this._onDragEnd,this),onmouseover:W(this._showDataInfo,this,!0),onmouseout:W(this._showDataInfo,this,!1)})},e.prototype._resetInterval=function(){var t=this._range=this.dataZoomModel.getPercentRange(),e=this._getViewExtent();this._handleEnds=[Fr(t[0],[0,100],e,!0),Fr(t[1],[0,100],e,!0)]},e.prototype._updateInterval=function(t,e){var n=this.dataZoomModel,i=this._handleEnds,r=this._getViewExtent(),o=n.findRepresentativeAxisProxy().getMinMaxSpan(),a=[0,100];dk(e,i,r,n.get("zoomLock")?"all":t,null!=o.minSpan?Fr(o.minSpan,a,r,!0):null,null!=o.maxSpan?Fr(o.maxSpan,a,r,!0):null);var s=this._range,l=this._range=Hr([Fr(i[0],r,a,!0),Fr(i[1],r,a,!0)]);return!s||s[0]!==l[0]||s[1]!==l[1]},e.prototype._updateView=function(t){var e=this._displayables,n=this._handleEnds,i=Hr(n.slice()),r=this._size;E([0,1],(function(t){var i=e.handles[t],o=this._handleHeight;i.attr({scaleX:o/2,scaleY:o/2,x:n[t]+(t?-1:1),y:r[1]/2-o/2})}),this),e.filler.setShape({x:i[0],y:0,width:i[1]-i[0],height:r[1]});var o={x:i[0],width:i[1]-i[0]};e.moveHandle&&(e.moveHandle.setShape(o),e.moveZone.setShape(o),e.moveZone.getBoundingRect(),e.moveHandleIcon&&e.moveHandleIcon.attr("x",o.x+o.width/2));for(var a=e.dataShadowSegs,s=[0,i[0],i[1],r[0]],l=0;le[0]||n[1]<0||n[1]>e[1])){var i=this._handleEnds,r=(i[0]+i[1])/2,o=this._updateInterval("all",n[0]-r);this._updateView(),o&&this._dispatchZoomAction(!1)}},e.prototype._onBrushStart=function(t){var e=t.offsetX,n=t.offsetY;this._brushStart=new Ie(e,n),this._brushing=!0,this._brushStartTime=+new Date},e.prototype._onBrushEnd=function(t){if(this._brushing){var e=this._displayables.brushRect;if(this._brushing=!1,e){e.attr("ignore",!0);var n=e.shape;if(!(+new Date-this._brushStartTime<200&&Math.abs(n.width)<5)){var i=this._getViewExtent(),r=[0,100];this._range=Hr([Fr(n.x,i,r,!0),Fr(n.x+n.width,i,r,!0)]),this._handleEnds=[n.x,n.x+n.width],this._updateView(),this._dispatchZoomAction(!1)}}}},e.prototype._onBrush=function(t){this._brushing&&(he(t.event),this._updateBrushRect(t.offsetX,t.offsetY))},e.prototype._updateBrushRect=function(t,e){var n=this._displayables,i=this.dataZoomModel,r=n.brushRect;r||(r=n.brushRect=new $B({silent:!0,style:i.getModel("brushStyle").getItemStyle()}),n.sliderGroup.add(r)),r.attr("ignore",!1);var o=this._brushStart,a=this._displayables.sliderGroup,s=a.transformCoordToLocal(t,e),l=a.transformCoordToLocal(o.x,o.y),u=this._size;s[0]=Math.max(Math.min(u[0],s[0]),0),r.setShape({x:l[0],y:0,width:s[0]-l[0],height:u[1]})},e.prototype._dispatchZoomAction=function(t){var e=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:t?eF:null,start:e[0],end:e[1]})},e.prototype._findCoordRect=function(){var t,e=OE(this.dataZoomModel).infoList;if(!t&&e.length){var n=e[0].model.coordinateSystem;t=n.getRect&&n.getRect()}if(!t){var i=this.api.getWidth(),r=this.api.getHeight();t={x:.2*i,y:.2*r,width:.6*i,height:.6*r}}return t},e.type="dataZoom.slider",e}(VE);function iF(t){return"vertical"===t?"ns-resize":"ew-resize"}function rF(t){t.registerComponentModel(KB),t.registerComponentView(nF),UE(t)}var oF=function(t,e,n){var i=T((aF[t]||{})[e]);return n&&Y(i)?i[i.length-1]:i},aF={color:{active:["#006edd","#e0ffff"],inactive:["rgba(0,0,0,0)"]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}},sF=sD.mapVisual,lF=sD.eachVisual,uF=Y,hF=E,cF=Hr,pF=Fr,dF=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.stateList=["inRange","outOfRange"],n.replacableOptionKeys=["inRange","outOfRange","target","controller","color"],n.layoutMode={type:"box",ignoreSize:!0},n.dataBound=[-1/0,1/0],n.targetVisuals={},n.controllerVisuals={},n}return n(e,t),e.prototype.init=function(t,e,n){this.mergeDefaultAndTheme(t,n)},e.prototype.optionUpdated=function(t,e){var n=this.option;!e&&sV(n,t,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},e.prototype.resetVisual=function(t){var e=this.stateList;t=W(t,this),this.controllerVisuals=aV(this.option.controller,e,t),this.targetVisuals=aV(this.option.target,e,t)},e.prototype.getItemSymbol=function(){return null},e.prototype.getTargetSeriesIndices=function(){var t=this.option.seriesIndex,e=[];return null==t||"all"===t?this.ecModel.eachSeries((function(t,n){e.push(n)})):e=yo(t),e},e.prototype.eachTargetSeries=function(t,e){E(this.getTargetSeriesIndices(),(function(n){var i=this.ecModel.getSeriesByIndex(n);i&&t.call(e,i)}),this)},e.prototype.isTargetSeries=function(t){var e=!1;return this.eachTargetSeries((function(n){n===t&&(e=!0)})),e},e.prototype.formatValueText=function(t,e,n){var i,r=this.option,o=r.precision,a=this.dataBound,s=r.formatter;n=n||["<",">"],Y(t)&&(t=t.slice(),i=!0);var l=e?t:i?[u(t[0]),u(t[1])]:u(t);return X(s)?s.replace("{value}",i?l[0]:l).replace("{value2}",i?l[1]:l):U(s)?i?s(t[0],t[1]):s(t):i?t[0]===a[0]?n[0]+" "+l[1]:t[1]===a[1]?n[1]+" "+l[0]:l[0]+" - "+l[1]:l;function u(t){return t===a[0]?"min":t===a[1]?"max":(+t).toFixed(Math.min(o,20))}},e.prototype.resetExtent=function(){var t=this.option,e=cF([t.min,t.max]);this._dataExtent=e},e.prototype.getDataDimensionIndex=function(t){var e=this.option.dimension;if(null!=e)return t.getDimensionIndex(e);for(var n=t.dimensions,i=n.length-1;i>=0;i--){var r=n[i],o=t.getDimensionInfo(r);if(!o.isCalculationCoord)return o.storeDimIndex}},e.prototype.getExtent=function(){return this._dataExtent.slice()},e.prototype.completeVisualOption=function(){var t=this.ecModel,e=this.option,n={inRange:e.inRange,outOfRange:e.outOfRange},i=e.target||(e.target={}),r=e.controller||(e.controller={});C(i,n),C(r,n);var o=this.isCategory();function a(n){uF(e.color)&&!n.inRange&&(n.inRange={color:e.color.slice().reverse()}),n.inRange=n.inRange||{color:t.get("gradientColor")}}a.call(this,i),a.call(this,r),function(t,e,n){var i=t[e],r=t[n];i&&!r&&(r=t[n]={},hF(i,(function(t,e){if(sD.isValidType(e)){var n=oF(e,"inactive",o);null!=n&&(r[e]=n,"color"!==e||r.hasOwnProperty("opacity")||r.hasOwnProperty("colorAlpha")||(r.opacity=[0,0]))}})))}.call(this,i,"inRange","outOfRange"),function(t){var e=(t.inRange||{}).symbol||(t.outOfRange||{}).symbol,n=(t.inRange||{}).symbolSize||(t.outOfRange||{}).symbolSize,i=this.get("inactiveColor"),r=this.getItemSymbol()||"roundRect";hF(this.stateList,(function(a){var s=this.itemSize,l=t[a];l||(l=t[a]={color:o?i:[i]}),null==l.symbol&&(l.symbol=e&&T(e)||(o?r:[r])),null==l.symbolSize&&(l.symbolSize=n&&T(n)||(o?s[0]:[s[0],s[0]])),l.symbol=sF(l.symbol,(function(t){return"none"===t?r:t}));var u=l.symbolSize;if(null!=u){var h=-1/0;lF(u,(function(t){t>h&&(h=t)})),l.symbolSize=sF(u,(function(t){return pF(t,[0,h],[0,s[0]],!0)}))}}),this)}.call(this,r)},e.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},e.prototype.isCategory=function(){return!!this.option.categories},e.prototype.setSelected=function(t){},e.prototype.getSelected=function(){return null},e.prototype.getValueState=function(t){return null},e.prototype.getVisualMeta=function(t){return null},e.type="visualMap",e.dependencies=["series"],e.defaultOption={show:!0,z:4,seriesIndex:"all",min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",contentColor:"#5793f3",inactiveColor:"#aaa",borderWidth:0,padding:5,textGap:10,precision:0,textStyle:{color:"#333"}},e}(Ap),fF=[20,140],gF=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.optionUpdated=function(e,n){t.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual((function(t){t.mappingMethod="linear",t.dataExtent=this.getExtent()})),this._resetRange()},e.prototype.resetItemSize=function(){t.prototype.resetItemSize.apply(this,arguments);var e=this.itemSize;(null==e[0]||isNaN(e[0]))&&(e[0]=fF[0]),(null==e[1]||isNaN(e[1]))&&(e[1]=fF[1])},e.prototype._resetRange=function(){var t=this.getExtent(),e=this.option.range;!e||e.auto?(t.auto=1,this.option.range=t):Y(e)&&(e[0]>e[1]&&e.reverse(),e[0]=Math.max(e[0],t[0]),e[1]=Math.min(e[1],t[1]))},e.prototype.completeVisualOption=function(){t.prototype.completeVisualOption.apply(this,arguments),E(this.stateList,(function(t){var e=this.option.controller[t].symbolSize;e&&e[0]!==e[1]&&(e[0]=e[1]/3)}),this)},e.prototype.setSelected=function(t){this.option.range=t.slice(),this._resetRange()},e.prototype.getSelected=function(){var t=this.getExtent(),e=Hr((this.get("range")||[]).slice());return e[0]>t[1]&&(e[0]=t[1]),e[1]>t[1]&&(e[1]=t[1]),e[0]=n[1]||t<=e[1])?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(t){var e=[];return this.eachTargetSeries((function(n){var i=[],r=n.getData();r.each(this.getDataDimensionIndex(r),(function(e,n){t[0]<=e&&e<=t[1]&&i.push(n)}),this),e.push({seriesId:n.id,dataIndex:i})}),this),e},e.prototype.getVisualMeta=function(t){var e=yF(this,"outOfRange",this.getExtent()),n=yF(this,"inRange",this.option.range.slice()),i=[];function r(e,n){i.push({value:e,color:t(e,n)})}for(var o=0,a=0,s=n.length,l=e.length;at[1])break;n.push({color:this.getControllerVisual(o,"color",e),offset:r/100})}return n.push({color:this.getControllerVisual(t[1],"color",e),offset:1}),n},e.prototype._createBarPoints=function(t,e){var n=this.visualMapModel.itemSize;return[[n[0]-e[0],t[0]],[n[0],t[0]],[n[0],t[1]],[n[0]-e[1],t[1]]]},e.prototype._createBarGroup=function(t){var e=this._orient,n=this.visualMapModel.get("inverse");return new Pr("horizontal"!==e||n?"horizontal"===e&&n?{scaleX:"bottom"===t?-1:1,rotation:-Math.PI/2}:"vertical"!==e||n?{scaleX:"left"===t?1:-1}:{scaleX:"left"===t?1:-1,scaleY:-1}:{scaleX:"bottom"===t?1:-1,rotation:Math.PI/2})},e.prototype._updateHandle=function(t,e){if(this._useHandle){var n=this._shapes,i=this.visualMapModel,r=n.handleThumbs,o=n.handleLabels,a=i.itemSize,s=i.getExtent();wF([0,1],(function(l){var u=r[l];u.setStyle("fill",e.handlesColor[l]),u.y=t[l];var h=bF(t[l],[0,a[1]],s,!0),c=this.getControllerVisual(h,"symbolSize");u.scaleX=u.scaleY=c/a[0],u.x=a[0]-c/2;var p=Ph(n.handleLabelPoints[l],Lh(u,this.group));o[l].setStyle({x:p[0],y:p[1],text:i.formatValueText(this._dataInterval[l]),verticalAlign:"middle",align:"vertical"===this._orient?this._applyTransform("left",n.mainGroup):"center"})}),this)}},e.prototype._showIndicator=function(t,e,n,i){var r=this.visualMapModel,o=r.getExtent(),a=r.itemSize,s=[0,a[1]],l=this._shapes,u=l.indicator;if(u){u.attr("invisible",!1);var h=this.getControllerVisual(t,"color",{convertOpacityToAlpha:!0}),c=this.getControllerVisual(t,"symbolSize"),p=bF(t,o,s,!0),d=a[0]-c/2,f={x:u.x,y:u.y};u.y=p,u.x=d;var g=Ph(l.indicatorLabelPoint,Lh(u,this.group)),y=l.indicatorLabel;y.attr("invisible",!1);var v=this._applyTransform("left",l.mainGroup),m="horizontal"===this._orient;y.setStyle({text:(n||"")+r.formatValueText(e),verticalAlign:m?v:"middle",align:m?"center":v});var x={x:d,y:p,style:{fill:h}},_={style:{x:g[0],y:g[1]}};if(r.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var b={duration:100,easing:"cubicInOut",additive:!0};u.x=f.x,u.y=f.y,u.animateTo(x,b),y.animateTo(_,b)}else u.attr(x),y.attr(_);this._firstShowIndicator=!1;var w=this._shapes.handleLabels;if(w)for(var S=0;Sr[1]&&(u[1]=1/0),e&&(u[0]===-1/0?this._showIndicator(l,u[1],"< ",a):u[1]===1/0?this._showIndicator(l,u[0],"> ",a):this._showIndicator(l,l,"≈ ",a));var h=this._hoverLinkDataIndices,c=[];(e||CF(n))&&(c=this._hoverLinkDataIndices=n.findTargetDataIndices(u));var p=function(t,e){var n={},i={};return r(t||[],n),r(e||[],i,n),[o(n),o(i)];function r(t,e,n){for(var i=0,r=t.length;i=0&&(r.dimension=o,i.push(r))}})),t.getData().setVisual("visualMeta",i)}}];function PF(t,e,n,i){for(var r=e.targetVisuals[i],o=sD.prepareVisualTypes(r),a={color:my(t.getData(),"color")},s=0,l=o.length;s0:t.splitNumber>0)&&!t.calculable?"piecewise":"continuous"})),t.registerAction(AF,kF),E(LF,(function(e){t.registerVisual(t.PRIORITY.VISUAL.COMPONENT,e)})),t.registerPreprocessor(RF))}function VF(t){t.registerComponentModel(gF),t.registerComponentView(IF),zF(t)}var BF=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._pieceList=[],n}return n(e,t),e.prototype.optionUpdated=function(e,n){t.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var i=this._mode=this._determineMode();this._pieceList=[],FF[this._mode].call(this,this._pieceList),this._resetSelected(e,n);var r=this.option.categories;this.resetVisual((function(t,e){"categories"===i?(t.mappingMethod="category",t.categories=T(r)):(t.dataExtent=this.getExtent(),t.mappingMethod="piecewise",t.pieceList=z(this._pieceList,(function(t){return t=T(t),"inRange"!==e&&(t.visual=null),t})))}))},e.prototype.completeVisualOption=function(){var e=this.option,n={},i=sD.listVisualTypes(),r=this.isCategory();function o(t,e,n){return t&&t[e]&&t[e].hasOwnProperty(n)}E(e.pieces,(function(t){E(i,(function(e){t.hasOwnProperty(e)&&(n[e]=1)}))})),E(n,(function(t,n){var i=!1;E(this.stateList,(function(t){i=i||o(e,t,n)||o(e.target,t,n)}),this),!i&&E(this.stateList,(function(t){(e[t]||(e[t]={}))[n]=oF(n,"inRange"===t?"active":"inactive",r)}))}),this),t.prototype.completeVisualOption.apply(this,arguments)},e.prototype._resetSelected=function(t,e){var n=this.option,i=this._pieceList,r=(e?n:t).selected||{};if(n.selected=r,E(i,(function(t,e){var n=this.getSelectedMapKey(t);r.hasOwnProperty(n)||(r[n]=!0)}),this),"single"===n.selectedMode){var o=!1;E(i,(function(t,e){var n=this.getSelectedMapKey(t);r[n]&&(o?r[n]=!1:o=!0)}),this)}},e.prototype.getItemSymbol=function(){return this.get("itemSymbol")},e.prototype.getSelectedMapKey=function(t){return"categories"===this._mode?t.value+"":t.index+""},e.prototype.getPieceList=function(){return this._pieceList},e.prototype._determineMode=function(){var t=this.option;return t.pieces&&t.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},e.prototype.setSelected=function(t){this.option.selected=T(t)},e.prototype.getValueState=function(t){var e=sD.findPieceIndex(t,this._pieceList);return null!=e&&this.option.selected[this.getSelectedMapKey(this._pieceList[e])]?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(t){var e=[],n=this._pieceList;return this.eachTargetSeries((function(i){var r=[],o=i.getData();o.each(this.getDataDimensionIndex(o),(function(e,i){sD.findPieceIndex(e,n)===t&&r.push(i)}),this),e.push({seriesId:i.id,dataIndex:r})}),this),e},e.prototype.getRepresentValue=function(t){var e;if(this.isCategory())e=t.value;else if(null!=t.value)e=t.value;else{var n=t.interval||[];e=n[0]===-1/0&&n[1]===1/0?0:(n[0]+n[1])/2}return e},e.prototype.getVisualMeta=function(t){if(!this.isCategory()){var e=[],n=["",""],i=this,r=this._pieceList.slice();if(r.length){var o=r[0].interval[0];o!==-1/0&&r.unshift({interval:[-1/0,o]}),(o=r[r.length-1].interval[1])!==1/0&&r.push({interval:[o,1/0]})}else r.push({interval:[-1/0,1/0]});var a=-1/0;return E(r,(function(t){var e=t.interval;e&&(e[0]>a&&s([a,e[0]],"outOfRange"),s(e.slice()),a=e[1])}),this),{stops:e,outerColors:n}}function s(r,o){var a=i.getRepresentValue({interval:r});o||(o=i.getValueState(a));var s=t(a,o);r[0]===-1/0?n[0]=s:r[1]===1/0?n[1]=s:e.push({value:r[0],color:s},{value:r[1],color:s})}},e.type="visualMap.piecewise",e.defaultOption=wc(dF.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieces:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0}),e}(dF),FF={splitNumber:function(t){var e=this.option,n=Math.min(e.precision,20),i=this.getExtent(),r=e.splitNumber;r=Math.max(parseInt(r,10),1),e.splitNumber=r;for(var o=(i[1]-i[0])/r;+o.toFixed(n)!==o&&n<5;)n++;e.precision=n,o=+o.toFixed(n),e.minOpen&&t.push({interval:[-1/0,i[0]],close:[0,0]});for(var a=0,s=i[0];a","≥"][e[0]]];t.text=t.text||this.formatValueText(null!=t.value?t.value:t.interval,!1,n)}),this)}};function GF(t,e){var n=t.inverse;("vertical"===t.orient?!n:n)&&e.reverse()}var WF=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.doRender=function(){var t=this.group;t.removeAll();var e=this.visualMapModel,n=e.get("textGap"),i=e.textStyleModel,r=i.getFont(),o=i.getTextColor(),a=this._getItemAlign(),s=e.itemSize,l=this._getViewData(),u=l.endsText,h=it(e.get("showLabel",!0),!u);u&&this._renderEndsText(t,u[0],s,h,a),E(l.viewPieceList,(function(i){var l=i.piece,u=new Pr;u.onclick=W(this._onItemClick,this,l),this._enableHoverLink(u,i.indexInModelPieceList);var c=e.getRepresentValue(l);if(this._createItemSymbol(u,c,[0,0,s[0],s[1]]),h){var p=this.visualMapModel.getValueState(c);u.add(new Ns({style:{x:"right"===a?-n:s[0]+n,y:s[1]/2,text:l.text,verticalAlign:"middle",align:a,font:r,fill:o,opacity:"outOfRange"===p?.5:1}}))}t.add(u)}),this),u&&this._renderEndsText(t,u[1],s,h,a),bp(e.get("orient"),t,e.get("itemGap")),this.renderBackground(t),this.positionGroup(t)},e.prototype._enableHoverLink=function(t,e){var n=this;t.on("mouseover",(function(){return i("highlight")})).on("mouseout",(function(){return i("downplay")}));var i=function(t){var i=n.visualMapModel;i.option.hoverLink&&n.api.dispatchAction({type:t,batch:_F(i.findTargetDataIndices(e),i)})}},e.prototype._getItemAlign=function(){var t=this.visualMapModel,e=t.option;if("vertical"===e.orient)return xF(t,this.api,t.itemSize);var n=e.align;return n&&"auto"!==n||(n="left"),n},e.prototype._renderEndsText=function(t,e,n,i,r){if(e){var o=new Pr,a=this.visualMapModel.textStyleModel;o.add(new Ns({style:$h(a,{x:i?"right"===r?n[0]:0:n[0]/2,y:n[1]/2,verticalAlign:"middle",align:i?r:"center",text:e})})),t.add(o)}},e.prototype._getViewData=function(){var t=this.visualMapModel,e=z(t.getPieceList(),(function(t,e){return{piece:t,indexInModelPieceList:e}})),n=t.get("text"),i=t.get("orient"),r=t.get("inverse");return("horizontal"===i?r:!r)?e.reverse():n&&(n=n.slice().reverse()),{viewPieceList:e,endsText:n}},e.prototype._createItemSymbol=function(t,e,n){t.add(Ry(this.getControllerVisual(e,"symbol"),n[0],n[1],n[2],n[3],this.getControllerVisual(e,"color")))},e.prototype._onItemClick=function(t){var e=this.visualMapModel,n=e.option,i=n.selectedMode;if(i){var r=T(n.selected),o=e.getSelectedMapKey(t);"single"===i||!0===i?(r[o]=!0,E(r,(function(t,e){r[e]=e===o}))):r[o]=!r[o],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:r})}},e.type="visualMap.piecewise",e}(vF);function HF(t){t.registerComponentModel(BF),t.registerComponentView(WF),zF(t)}var YF={label:{enabled:!0},decal:{show:!1}},UF=Do(),XF={};function ZF(t,e){var n=t.getModel("aria");if(n.get("enabled")){var i=T(YF);C(i.label,t.getLocaleModel().get("aria"),!1),C(n.option,i,!1),function(){if(n.getModel("decal").get("show")){var e=ft();t.eachSeries((function(t){if(!t.isColorBySeries()){var n=e.get(t.type);n||(n={},e.set(t.type,n)),UF(t).scope=n}})),t.eachRawSeries((function(e){if(!t.isSeriesFiltered(e))if(U(e.enableAriaDecal))e.enableAriaDecal();else{var n=e.getData();if(e.isColorBySeries()){var i=rd(e.ecModel,e.name,XF,t.getSeriesCount()),r=n.getVisual("decal");n.setVisual("decal",u(r,i))}else{var o=e.getRawData(),a={},s=UF(e).scope;n.each((function(t){var e=n.getRawIndex(t);a[e]=t}));var l=o.count();o.each((function(t){var i=a[t],r=o.getName(t)||t+"",h=rd(e.ecModel,r,s,l),c=n.getItemVisual(i,"decal");n.setItemVisual(i,"decal",u(c,h))}))}}function u(t,e){var n=t?A(A({},e),t):e;return n.dirty=!0,n}}))}}(),function(){var i=t.getLocaleModel().get("aria"),o=n.getModel("label");if(o.option=k(o.option,i),!o.get("enabled"))return;var a=e.getZr().dom;if(o.get("description"))return void a.setAttribute("aria-label",o.get("description"));var s,l=t.getSeriesCount(),u=o.get(["data","maxCount"])||10,h=o.get(["series","maxCount"])||10,c=Math.min(l,h);if(l<1)return;var p=function(){var e=t.get("title");e&&e.length&&(e=e[0]);return e&&e.text}();if(p){var d=o.get(["general","withTitle"]);s=r(d,{title:p})}else s=o.get(["general","withoutTitle"]);var f=[],g=l>1?o.get(["series","multiple","prefix"]):o.get(["series","single","prefix"]);s+=r(g,{seriesCount:l}),t.eachSeries((function(e,n){if(n1?o.get(["series","multiple",a]):o.get(["series","single",a]),{seriesId:e.seriesIndex,seriesName:e.get("name"),seriesType:(x=e.subType,t.getLocaleModel().get(["series","typeNames"])[x]||"自定义图")});var s=e.getData();if(s.count()>u)i+=r(o.get(["data","partialData"]),{displayCnt:u});else i+=o.get(["data","allData"]);for(var h=o.get(["data","separator","middle"]),p=o.get(["data","separator","end"]),d=[],g=0;g":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},KF=function(){function t(t){if(null==(this._condVal=X(t)?new RegExp(t):et(t)?t:null)){var e="";0,co(e)}}return t.prototype.evaluate=function(t){var e=typeof t;return X(e)?this._condVal.test(t):!!j(e)&&this._condVal.test(t+"")},t}(),$F=function(){function t(){}return t.prototype.evaluate=function(){return this.value},t}(),JF=function(){function t(){}return t.prototype.evaluate=function(){for(var t=this.children,e=0;e2&&l.push(e),e=[t,n]}function f(t,n,i,r){cG(t,i)&&cG(n,r)||e.push(t,n,i,r,i,r)}function g(t,n,i,r,o,a){var s=Math.abs(n-t),l=4*Math.tan(s/4)/3,u=nM:C2&&l.push(e),l}function dG(t,e,n,i,r,o,a,s,l,u){if(cG(t,n)&&cG(e,i)&&cG(r,a)&&cG(o,s))l.push(a,s);else{var h=2/u,c=h*h,p=a-t,d=s-e,f=Math.sqrt(p*p+d*d);p/=f,d/=f;var g=n-t,y=i-e,v=r-a,m=o-s,x=g*g+y*y,_=v*v+m*m;if(x=0&&_-w*w=0)l.push(a,s);else{var S=[],M=[];xn(t,n,r,a,.5,S),xn(e,i,o,s,.5,M),dG(S[0],M[0],S[1],M[1],S[2],M[2],S[3],M[3],l,u),dG(S[4],M[4],S[5],M[5],S[6],M[6],S[7],M[7],l,u)}}}}function fG(t,e,n){var i=t[e],r=t[1-e],o=Math.abs(i/r),a=Math.ceil(Math.sqrt(o*n)),s=Math.floor(n/a);0===s&&(s=1,a=n);for(var l=[],u=0;u0)for(u=0;uMath.abs(u),c=fG([l,u],h?0:1,e),p=(h?s:u)/c.length,d=0;d1?null:new Ie(d*l+t,d*u+e)}function mG(t,e,n){var i=new Ie;Ie.sub(i,n,e),i.normalize();var r=new Ie;return Ie.sub(r,t,e),r.dot(i)}function xG(t,e){var n=t[t.length-1];n&&n[0]===e[0]&&n[1]===e[1]||t.push(e)}function _G(t){var e=t.points,n=[],i=[];Aa(e,n,i);var r=new Re(n[0],n[1],i[0]-n[0],i[1]-n[1]),o=r.width,a=r.height,s=r.x,l=r.y,u=new Ie,h=new Ie;return o>a?(u.x=h.x=s+o/2,u.y=l,h.y=l+a):(u.y=h.y=l+a/2,u.x=s,h.x=s+o),function(t,e,n){for(var i=t.length,r=[],o=0;or,a=fG([i,r],o?0:1,e),s=o?"width":"height",l=o?"height":"width",u=o?"x":"y",h=o?"y":"x",c=t[s]/a.length,p=0;p0)for(var b=i/n,w=-i/2;w<=i/2;w+=b){var S=Math.sin(w),M=Math.cos(w),I=0;for(x=0;x0;l/=2){var u=0,h=0;(t&l)>0&&(u=1),(e&l)>0&&(h=1),s+=l*l*(3*u^h),0===h&&(1===u&&(t=l-1-t,e=l-1-e),a=t,t=e,e=a)}return s}function zG(t){var e=1/0,n=1/0,i=-1/0,r=-1/0,o=z(t,(function(t){var o=t.getBoundingRect(),a=t.getComputedTransform(),s=o.x+o.width/2+(a?a[4]:0),l=o.y+o.height/2+(a?a[5]:0);return e=Math.min(s,e),n=Math.min(l,n),i=Math.max(s,i),r=Math.max(l,r),[s,l]}));return z(o,(function(o,a){return{cp:o,z:EG(o[0],o[1],e,n,i,r),path:t[a]}})).sort((function(t,e){return t.z-e.z})).map((function(t){return t.path}))}function VG(t){return SG(t.path,t.count)}function BG(t){return Y(t[0])}function FG(t,e){for(var n=[],i=t.length,r=0;r=0;r--)if(!n[r].many.length){var l=n[s].many;if(l.length<=1){if(!s)return n;s=0}o=l.length;var u=Math.ceil(o/2);n[r].many=l.slice(u,o),n[s].many=l.slice(0,u),s++}return n}var GG={clone:function(t){for(var e=[],n=1-Math.pow(1-t.path.style.opacity,1/t.count),i=0;i0){var s,l,u=i.getModel("universalTransition").get("delay"),h=Object.assign({setToFinal:!0},a);BG(t)&&(s=t,l=e),BG(e)&&(s=e,l=t);for(var c=s?s===t:t.length>e.length,p=s?FG(l,s):FG(c?e:t,[c?t:e]),d=0,f=0;f1e4))for(var i=n.getIndices(),r=function(t){for(var e=t.dimensions,n=0;n0&&i.group.traverse((function(t){t instanceof _s&&!t.animators.length&&t.animateFrom({style:{opacity:0}},r)}))}))}function $G(t){var e=t.getModel("universalTransition").get("seriesKey");return e||t.id}function JG(t){return Y(t)?t.sort().join(","):t}function QG(t){if(t.hostModel)return t.hostModel.getModel("universalTransition").get("divideShape")}function tW(t,e){for(var n=0;n=0&&r.push({data:e.oldData[n],divide:QG(e.oldData[n]),dim:t.dimension})})),E(yo(t.to),(function(t){var e=tW(n.updatedSeries,t);if(e>=0){var i=n.updatedSeries[e].getData();o.push({data:i,divide:QG(i),dim:t.dimension})}})),r.length>0&&o.length>0&&KG(r,o,i)}(t,i,n,e)}));else{var o=function(t,e){var n=ft(),i=ft(),r=ft();return E(t.oldSeries,(function(e,n){var o=t.oldData[n],a=$G(e),s=JG(a);i.set(s,o),Y(a)&&E(a,(function(t){r.set(t,{data:o,key:s})}))})),E(e.updatedSeries,(function(t){if(t.isUniversalTransitionEnabled()&&t.isAnimationEnabled()){var e=t.getData(),o=$G(t),a=JG(o),s=i.get(a);if(s)n.set(a,{oldSeries:[{divide:QG(s),data:s}],newSeries:[{divide:QG(e),data:e}]});else if(Y(o)){var l=[];E(o,(function(t){var e=i.get(t);e&&l.push({divide:QG(e),data:e})})),l.length&&n.set(a,{oldSeries:l,newSeries:[{data:e,divide:QG(e)}]})}else{var u=r.get(o);if(u){var h=n.get(u.key);h||(h={oldSeries:[{data:u.data,divide:QG(u.data)}],newSeries:[]},n.set(u.key,h)),h.newSeries.push({data:e,divide:QG(e)})}}}})),n}(i,n);E(o.keys(),(function(t){var n=o.get(t);KG(n.oldSeries,n.newSeries,e)}))}E(n.updatedSeries,(function(t){t.__universalTransitionEnabled&&(t.__universalTransitionEnabled=!1)}))}for(var a=t.getSeries(),s=i.oldSeries=[],l=i.oldData=[],u=0;u)zIFy>9DXunpK?uqiU##ty`^ zI1~d(=nesg0GHrR!X@M&1uhpLm&73rE+JBIxWuIFd57QUop;w>bGh%Y{QJALKAO>J z=GDCIc|K2h$Al6>4CHzul9riEmi2``6}y@c+K!`37cOZ|_uex5N_@TzpNBSHynfe* z2k#yyMDsU79D`eTUbSV*6L0>Mkeas$`Np-|Hm~30z4@^bock*vw+#oh|E{jb{wPqp z?czQA{_}I#BlJB&)XtrkZe0IV_fPSAzFC9_w_Ut`-!5St`4@a&jgvx`tiO13_^D|( z5OQh|-|Kf>dikE6?!F=+@2n=oCKBAc_&zI-y?^{);s@-=)IU01IfA3hY+pLC*3$hE zG4Lx+b+^oAXY%dGW8w$m@A0vU2ou-i8eIJnu_>R~Q9b_QXU>0*&n=`tgn=3JmJ;*M z^?NQMKBAiP{nUNB^P;WmQ9g=Qpi<7HI6{eL@~HS9^bVrNCyT&Z>^8oozap&^cOVe8 zh@=1DZ*a@>O{BNHuJT2tb}Lbr$ucL-X2<^*|Jw%tI|lxD4E*mHP=q3rvrL{Q0Z3|< zifa!+#!)7tlh{Jy(2IOa6;&CvoxySx-Jg zzC=NQi_<{NHb|AX_6srBuDb3opg{HWG0zK=8%PC5m`)@kfmf9Sx$z@3bK-{ zBCE+7)PF5mhc?(mwvcV)BC?ZQOfDgpl3ipsxr|&+t{_*Ey<{J`id;>uA=i@qeme3g6+n*8hJ8|0hhW%6zE3VD@$k9?o}fV@urmHd$W z8+zzX@)r4b@)Pn?@-uRZ{G7Z)egPKqYw|96kNlSWj=WEPPs*f1{y?%=4m_aq+PT?i?o+cqkXiW4vUMUYs=d>7>g`l#6e!fb~^{80V(g`AX#j8azH|m^2HpG6{LI#2c!lmU&;abLCU*0 zAW2AhHwR=2DPP6`=|akvb3o3J@*WOI98$i51G0yd!TA|T3fsLLkVmAvj{}m4l&|7| zj3Z@mcm_x-Qoe=*a*LF&<$weuo_3aNcnmWW-pX);DF2{q$_F_J>mPO=KqYJsb5Jd|pW>iyY;WVBPHc~G z&?;=%Zv)hW?VTJni0xe*)Qj!i9FWAMd=Cd=pnN|EWAx<*I3U?c`4|VYDasFWK-!b?LmW(Zl^^DS1|a3naX=T4^5;3A6-fCD z9MBJ>{0IlLddiP-KxdHhV;s;Pr2IGs^av?G!2yjz%1?4Yw~+Ev9MCePe4GRNhLpd^ z0nJ0oPjf&Akun=|0JIS)Kf?jNM9R-{Ktqx82@dEgQvNarv=%8p#{vCC%3tAtCL`tN zIiS->`2`MWH&T9)gM_gCCk|*lQvNCjbRQ{yjRRVclwab2J|tx}MgeF>Qf6ZmfQ}^P zuX8|KlJYk=pf^eRn;g)fr2H}mbSWwSGY8`ym1P6r2Ga4G&d>#D+hEqDgTfI+MJaCjRSg} zlz+ql4NuB%azNLU@>?9x`lS3e2lPKF|Cj?zfRz881Dt@Af5HKFK*~Sm08b$0pK*XO zkn$-Ga0gQUIR{t-DZj%3K0(UA-~h8A;qt7q&&_6K1Rwi2bdWt zf6M`n23o`cwni$H1H6q?1P(AbQV}`85+<-1DuaksyM*@ zNJYm19!M&B4lqJeF>rtzl8TW7ERj@99N>$jV&(vIBozw>I3%f9Ilv}K#l`_%Nh)>@ zFicW$aFEYo>*N6IBo!A2_$R5jIlx3o#lrzkN-EVHV5g+w=06!!vTwgROWKP zHX)UH9I#SIWj+V&6;fHi0n3F{2038Ekjf$sSTm%um;-hVsVw1ug+nS!IbiFM$}$cj zV>`rwX-_K4IVe6`Zwt$L{H#i}=|KGbP+PF=fhi|!uXFZ8SRcj^CNNE&7so;KQzml*FczGfn(Ueh+y z{iY|)IrF0yjb*3hQOox%?^*t0t+KkUP1b^Sll2cajqO_7UAAA@tLq2`jBdum>*DF^lijs;#0{3h5Qye#;n6p?-ystsKd8VlbQ zDMW6Jc1GW-y+4+WT^2hK`(f;F@k0E`csWs%*q-=dou+Q2?xlKj{p$KV>fdiT-teo& z#f>i~Rmm;MK$Z@stmOu9C` zJ$)kmr%W=lA#+dWdu{f%zP2A`>vGB5&fJsv>imuQ-?rDaZ)*QR`>#6O9qT$i*D>1h zhfZtfJ)J-4+S&D!?!N95J+(cXdT#6aL&03ADSTMmS-hvWrgv9wdD`%_=laZjeSQ1; ze$zj%|M~vY1Jwha16L2cHt?tE4b!(x|IrNhjMXzv&m5Wg^I3JXo|*OG?DXu1W|!w| zpY!QCC+2=@9+_7&Z`Qoy^WK=Rn!jLyYC+S2T?@Xt;8zQs3%eIyJ=i4hhkm}id-&kmqmRE&VZCdrpYU}C^t8ZQX^y)vX39b3UnpZ}SjeNMaz%1yG zKNjDIpF09eXD(x_v@H=wz*R^xJd+!A%Sy4fa3)43u|XLI=+jo_4AK3h;_()bSl z%v6lG6=*(}4hl}Q5NV>cEt_bf%6YgV(bgnH%mOP=`KQsEDaywWW!v)jKFyB0oEq`{ zf&Sflz99{CC(Zcf?irm;K3__HlTxvHanNnmo8A8Ww3g+)vDmcbE#W}e>+zZOR!?wI zvmo{?7#!ZqewO|ImCGMy9t}9WpB9h9Mu()JZZu6iQ4pI1z9ZywK|!mIupUv`FU?v^ z=_T>FFm2CFYRs?7()M+iZ|>CuL%PAMXS8oy*ht5pojV2$*|05R z6L-jm3i2Vkw;*JSY+Iyznmn02Z~$+kNeKSQ>o>3?h)p?4F&`+EvCgfL>@@q*d z7Qo>quZb`pQw)x4Ek&KFN6652`Lz@k$M*=g%V(1}^_cPF#5IEPaWL%9*X;= z;)cn_C{pngb!MJpjFX)hCoXuTLTDc`o5@DAYFEZ3YJx&0oGu77Z_8ucX!Bu@xarTu zqWoIn&sBo0#wP5x;!WX3@%+SUpscNNhKw(JHe}5mo`})M_j=oQOBm zbS6h}bJ?gfC{U-FHbHTxgH%lEEivhoBbI9Q_)HGRDJgDLS9whio3CL;bJplJX^qC_ zdPhX(s8X4{!m!t16g&p2{FdHp*Ozp5FMT;Pv}Gtm)5`m3v2jOZbyKZFr?=aisvCEt zz4hV4bJLRF<85?09BDz&>FUi%PjmKAyt$@*`tac2M@@h>ap3S(mF{M3n`2zI>MVutjusBdn z>la+q)nD3>rPZmv{BgQu_PkQp zt`+TCZNrMI`VP;VbxA{YQ`CV=s~d(KF`v(|W5(j4!`b!G+OS5Gn!TcB|MEqkdP<)O ze-u;jox7P&GG>Fyfuhg`Dc+-^E0fM;+oB0&6K|xn<44=JXHsoFyS5&_t!w)JPha2O zUnuS$6?QLMoa}d)7v`6)qqV>8%I@yVHMKRfA%PjD$g3Uj>w3^O5wuPNe2i)4AEaRm z0#9Kr#-JyYhx}rnY?xg*Zp(+&Q4Cfff%h1;TIG`~Djt@fa@W_pMG&H>$^b3$^X z!3mMl*i7${Uvuk{v{5#mx~q~a}|p$C^xCYd=V2-tt~8?#@~=~2(tT`8B!ISMr3)iEhXf^?XjZ&Dvj-g6wmo|%1T?tH1Oi-H#(mbEVPaXbQ zNPbN^B}rm3H2(V77(Fv4oeYi97fbT1W74QJCY&CTq!CFrq8-kR6bmi4NuiK*BsE$n zjL~UF+>+${wEV3Joxx;5Jv^%$nP&}=z03qHfF8`UfmjflM6(#A9+%VYaWx4!s)=G0 zB%+!{Oi)!rQS|J*0ymIeQ zAeyoVRMR$ZDr}*(Z7~LMyA;Z#mkw`U_~{)!QS`@kp^L7+Vdo4_&76y`yLNL(=cqM_ zwU58~&*N|D9yHmhN~JSBXgBWn#bUnwMjdTQHw2>^Y00Xk;bb^8y!Xm_b!{-YeTfuV zo~1Y`gY%}!Gc7bT(}Q7;4NB1FfohFGtdF2m(C1PCI@QjAAuw)-Iz9a}sL?Y8n66wV zK8AMB!+KnTR?oII(TJG_Xf&bqFbXJ9HpZE#^yEF91bXt2ltl_*oyX*BruhU^I_Mun zU;v?Z%ulVt0U5h1QsK$gW$TxbG6CrCzl+cCC=I(pzt& zG$d?{ZIh2id#3k9*9tXm*X&j6SIu_0YXsq6Yg?DK;#G@6#GzGoyVxcS&lInTU7>1j zOE;+z{JZ8|{wbRht#(ES=royEdI(+uJ{T=^RuTo)2ZdA4i)x zFyq;%k0LhFh*&}f?a+l-Og~29T;{*WT!^~Dz{G42G5NDh?N3a054H}>5VmEL-+`^? zfA}ooxOjL?Q8pGZDbP7Z-Yw{wBZY~-Qt|v>Y4RYp=Z=dz*a;HvN6@8Ap(ww~Btn6< z^UVv&2A}y34o~(o(|rT5d|}Tco~|{kpvo|B&`oi4Cj>tul}$o4g6`95JkFpRv>d`8 z3^d;)D(8wCc0N0eaeKzzSpYuA?Ep+Iw}qNTR}iBhh^tU2CUH=O0l^qQh!*H$#zjS| zJ!Ug|oi?Yp>R=*fGU%vD?=m=yHFk@=KIN?o_+owyxKjI~wL329$mK(lFInfUp@QCB zZT1@t=K5-13*`6qWsP%cd{&D_?Y7kFEgG*$@)@kO%BpiaOw?lfy}34K4LBV-yFu%z zk*Y0vhs_*$Q2xd1AQGS{pVv~Y*6y*J1>KGDdW*%RF<1=_gD2>y3)md4n7_ssPx+)! z+ohN6ShuLtW~Ef4@yES^I%~MbZ}J!nX8C;$>;h(H9)~McQ@Ji-t zjiJh+xBDcUGiv_5*+Q#K9+%E!^+*Aa*353kBm6~v2YvTCi-1qzC^~pv;5z}A0@sda zX~F|xh*lLnXi4-=f{~WVZorPxNjVQp1sGCpv&y5G3e0RPi20ldwa(`1xhtX(a2ZTe zi~vSn(1nRMr8JC-2)<#~87l$8RFwJsLo)DB@R}39S(=rY_kXJ!ag-ar({49t zOcqOh{6?K%M)zyA@>>SCAm3JJm-m z5r@~?+?s94tW7TK^jV>Rx!v;sxQZ4`BEvjYpj2X1%;X&qqD3)7U72iK9McPyoYtjG z4Z)=~i=bWLFZl%Kiwkr#8fg;RKtJhQ?E~NI{q8{a3UTp^iv>{>=-;~g`|Qq0*r4|o zBesCcusfWRES6v@5btu_Z1b+R)Fj+CpF^+J8|ZU)3+C}Z-AzNfU;a|3v&$EE{&`@w zN@G@QdtB9ePp!|Ya)uh4Fw&#pi#4Jt?ny{Cz0KqI>R_!*aQXw{G!{?S(S(?HQ1QU{ zAJhMqd5Qj2tR6oi(uP|3uL9iQRfu& zNob*Bly5x~pUTN;$>eZywPNQnTW<>fn!FTWB`@ZuJitE*KkRF47*5)YB}m9pfv&hD zIoz0(r==Q)lk(fRpfNd7j|Sl;UJnnZeV+cAS`+fm6Y@K8dO6#D2l{TZ&caRTL#57I zSZtp2C(yshe@xI?_Bwa&39*6Y7=U=eB1}->O63$3jeMplKVqG1&lK!5<@^M!PA#P$ z$sbM>DStTi;>q)8i?f;Ct)m|N1bRV-i@q+un}?(2a_oXHaF3H5F$Kwj zUv(%(w=E1h3@rpsm>NF40@TNZT-t$lVdX%BPL>qQ zF!AKdurkvHc@C`MLk0R`5yrZ3V*GU>gP(b!Sdixyh0Nq{2&aWVGM_O`E8+!Y0n#R- zXcRW=p;73WNT_#>U8l2+^o9nMUAr~hQPV4&*4fweO4Iqb*bNQz*0e{g_Q`uh*{6}W z!7{x_EM1_S%{YTJ4>JvJDb7+7^vuBJ{r#8U%HDpLoI5->sk}WhHgODJj3p-yCg)y1 zQGcdCU9eO!s&Vg-i%hNI&LM~un=wPdOQBiKq8h?f5xw*b^YwIfP57FW9XLsv8U<_q z)+0A>$O@;M8pl86`{MCQpVavadov`~vzG=&aCwI7yMjYeZ zgj|0ReP4}imS&a_5`zm2vOEED$Ojl}Uzkf78|(|X?V5x<)xuc<`IgDkNzX}wzBo$H z6hmu@kq%U`Z>1!if^iUa3HDHJz%0;{{l)&&RjGaQhU8Vrfx*2lnF>)CvljAQf``pt516gsPp%kF4&${Vxq{7OMm#ZhAzH_ZC3()6JeR&e|Cn5X zulafOvjxn0Mo-adMHqgg@?88rWt}9dMKzOM^jxoKJ@m|b$@eB-^tH)79GZ|-C&V_z z79k*xjD9fQ7|j+0v~wZ~athj#fC^=YgGm2$MI(&1FxRuEfFo4#lX>7V6DneSz+db2 z*7^tH;e05R4|iy*=4@T%a%OCHsT0jtyP!pqnukJ(>iEjerl!DkcWjftwYV^tI+%p_ zFyO0QzpmC7DAGvBw2lba@f>qoOS3^;?GCRQZY##4$vwLk7^)2Yvz%MyeT(T*`I$j@ z8Cli2++}s?U>RIf>e7hG_kUL#Fm9zXqT+B%!1Z=PWv;#Uf2_{2W2jDxsn$DxwNjlC z)Fyc#dGP;9ZL&uSbvYZa&8v&$FVRJV$%6-{)}@9;xTe%4nstRg(fncNKl+D#mARk} za_ST9K1^R^9-(k&lgpio@7= z@=UQOX#BCqk|$5n-z3>~{8&3}Zx=rG*kh^DCjyKAP*ClMtn(uNV5|8X8= znC}?g$bUS6UM#XN{=u}F7&lDMI5BGpRjA@8o&L7-y5|$>MTsfwRs0#5^s?puNS~a2 zOE}HG`vG%$Ownt0c)k+Q>v?$4;R%Ir%LB6m)|y9+#>(Vva0%Hwc^rbIb0x-#v$8N^ zh0{`Dd~igfhxV|K%*`|QGy1}aG>gWID`vWn!Rr$W$-jf(2>oo28z;8o<7-l3Y)nee znjBll6*=WZec5khTps3V6X9WlgoP(di4YvieuX|6D$3j42SUe$)8YKYZU+1;ax6 z<aWwZPH(qcF4dw`v)bjmt2t5MooVX5cVNCH z49SE2?A80$whGYB6Jw3}D}B(S187K)q&R#Ha27;uO7o<_{fdahgI9ipjmrpxVi&1}?;zwM3{Y<9b?5OWKS+SM@6T@m;+tX7N18F6{c zw(-lV;1@7kEM}L(Rz=?qhXf%Mo{$fZVI0ShshVY3z7+igHO0JWU+)D2l^BD;88z&D5HxyNkM+DWxXqnQHaS^cq@hlRupEE4p01 z(y6D9O{^^y{w(}iu>}GwYZ)8?)J%Za7!wbkWbC{1tYZLrQTu_b=IFY2-@JEjRmZ0I znk8+Th6Sq@Wi*L*nPXmfC9dn*g;T1!cHO*Be$}U~Td-zHT2(i1)#5kdd*fq!!uGJT zJZs~Euz_Y0 z%wvD~Z!d=kdqKYMdlTjGa|m^?Yh|NwS{|IdUQABdfW)B_vf$cZhvA!-zx&KH&(M!p zOjG{up=X|b7N<{ez?5=6!HhgZJLFg8*TfWiM}C!}pM^gOe?lMeHiOJ#f>6jM&?lG- zF5#6JYxjL~tGagIyzhnu_+wqQZ;pO<8h4V#OGk21>t#_&vK?|J}e0~ zivZtr0t&zu*J40w;qiiz;87!B4Bm_0*DzWD<1h|_oR35KVQR873J4H*Agj%A+q8+8 zu~GOnJvkcF2=g_qqS&gD|J6f#$G;s43-lXTsCD*{&qkh>e~H^8_}2e?Nk%W#Kx7+nl04Z&-n;MkDQY%hT=%k*HLe{OK0 zkzo5O5-!j3L|_&(Csq-vOd~GQIhG}sc?03;p{RcyHLv%Z%|f5S(fQAvj&wd9bIY%- zNvzqkCb2rP-XCx{md2NPJEg=7|N7^>?X7W_OF2{cTfmEA96EzwHv8Ahe_H2{hNcgC zl`mcHSUN91yDqW*iuLjJC}u`n>hdm&FLO9)jeq^H-WA6$Il8{p>0o1%&xL=T9Lp4~ zqa*-$M@Hz2BNJ{BxJKBylVdA|7SbucEm&BNY*?d3dxTwRBfP=ZWCnE;>=leDHg=gc zViwSVL8!FpI&ncDF6ZcoRVSZhhNo~}$FQ^G;+-{p*Z8uHhi{%`-*o%6fmX*tpl_|$v>HpU%Sz9#!vjt1qDwjVqz?a?EYBqGEb)x?wz4VQ2Pn_YNIg|9fJp~ktXH0&?o`A=bJBoi;q3=TJajRMI9SSY^*2& z6!0L(8)n{u=O9#)IPbASlU+QLdwAuBFJ|*qbcAXLd#BAEoZc7zvix7&^x*j>5pEcJ zxOdL*yoGD6=7C+|a4gm{(jy1Xx9Y_2>oL#uV910rN37zjkS^#LwDXz1$3`COJ98}D z33mlbfSGmAnf^!VO>*hc{xd&?*){Rae=9QzNq__pFdfI#&OTq}@cA;u;~(`sBJZa+ zKGOHmxNSwOxPsoaQ!J#O!pQa;%xRLd+8tR1U8?eCy zvPb6mpAO~ zZeM%Z+79`C+E6#JXnGyJPZ&QdglKhjWBt}$TN@gxz4V7-=(@&(H#b~&T?5|fyA3E; z+_>H461&8$i&S?s98zUFyK`z3tXi~5=oVeB9cxu6yPu**E z6XsF~t3VYG36I0)Gl-ERQ^Xc+rcn!xdLkO9JDqEbtI?h3rbT`#QxqQjKndAPA7tI5 zZrLTAKIP7SA?rRhVzS$Pb~`nmAH0#wP+G|o$_$CA$=lBAbmRBZGrC+(S8(70pMyIa zmHA&}$wmAc+&h=c%pRM_AD|QY0}j?2&|+98&y07Y1mB)K7YTS%+_y^1da?|b8_3Fl zG?~mnU}YdVhVknRGj&GbDPTeC0-^$g$QT?Q#p_%?!gyMEwsf+1@+8Y^;rGRSAgoLl zYnXChYDABt*$Xlo=ow@SUU+XMb_7LzqO9ukWw9KI3na#rBIQF!o0@2CE)HhG8GXP-+F?ZD`M zRVuPCeAsaQU8PQm9crnWEG42m(7UnLBIN+tp4s{#Nh?i*$+lmBA?izVt02IZ=N{2##}UCA6k$ao5@JvZidBHmSn@_lF<7FA)< z6*as&2(v(zJ2iY~jOFrVVlcmI+iF?%Q2WGzGf4AkLz)kBN3o=$b35nd=5dTV_*K|U zg>A|D5=;z^e4e0^Rl0dhnP-KQNC9FQwZKs(Uxd@j1U&mZ9fptVMY!)nj1>+2jYbw0EH`eOIA^p0AmDEK>eweL3_O&*9>{PB<4lXZCJFg19_F;MFw;;2j}1#JV_UfF&bb#n5Cg)z6TurwL!bTZQ0a!? zjp1syT@bV_rM9Kcd+u>AZ7a0|<^=F@i6dsvudMaoJ5;)UZ(^D$=u^j=!lK_}H#VfK zGfJr|E}ds@T(f)U97nu{wu{Hvi4rf`A6;qC#~e$h6n4)&%15mr*xl9P8>Q<@L!VF8 z8topx7;cKIeL?Gjm7UKfT=lE3xOBFye&uC5Hx`Q%oMn>VOyuG+?>1wF|7Q<(saW`* zecUBx?;}6yA33_YpOmdT;Ch4SU@?nbQJpNh%+f0%rIpVVpP6}(0Z=0CK%uYVr#sFL z6=^$r6~`B`>~r`P7;prRhU1fGF=sr2+ zIJ0!a_GiOe4G$f5;k-j$3>>$L8xKKw4U#nwdr(8zH8Y`yY$v$C&fLB=z3k%6!*H<| zyE`^+8GmzAOIsn;cqrC7)E4Wl9&H@A)6fg?7_>Q(YVb)ID?7W+;K|>-FQVg?5KZa8q4pL;GL6|g& zAiFG+8uZvKBoIsD>qc0bwJi#37Pb=fSl9)3X_o$^ac0J!r}614H?ACrqG=ItR`Qz`H{bqWZt$ptDl;7XFav%|# zz9QrIr-=;95pn$zQ16fa(w8?b25P4zY+c)pW-n+ zcjwxS;y{C6Lxi#D@)Qv=hKQVUXXa4^eudqqq`zL4y!F=PzT}}p$;+nP$k<7Y_%qTe zx&E@$q2#T}_kdfIm$9*dyc7&x#`kRSoYuhmTn`?N+-pY|q{5ZSHVaBvD2r7EQ8g#+ zHiV!cw=pCjnxkQ?{(#r1EzSsbiSCt774@&X&Z0w8HI;$gA zYvkul%Mqb-lNy}-usTv4_W@? zw4b1Q$9xE+7K0&cvl3lAhIpT3Z9)j}8f){(mgbX9*5c?G?Z6H4`}-p9Pmlbw8f7gN zzb&RoXx4#%BGgJaj~jz_%X^^Q*(i>hMNbrBCy!N_PllwkZ{m(R-1O^IzB22Ue@B;t z6U*B@S@{e#W*=MDeE3Lmc&NHDY^OzE>$F;CdmT|aL^r;2gbwF)EEd?K&yMCk8fyGh z@^ES?b%q-~(P^2W;?CgyL^gK#cn`5>o+wfR-EG4hLxdG~j5#Mx40e`u%w#0H*=$Cc zb*Dy8VT__B-^I)uk>}!`UqB18#aPA1QjcHqwTZb`V3Tf)dP8F;<<~;|Jb63aJ92W@ z4h{So&>vN-7eE~)e7E0vgVJ6C? z()bbjsjP>3j!76n$Hwir1lQmlLyEu6%2A{I5jt%fJvylmxlFcTL`=*}HW68avIv7m zTrrwNR2K`_3I#BP4)A5+=O-OV%x1@szjk^IR_Wx}`V9CAdpewlSv-hUPb7sa(Q!`{ zg~EWqA`w=$@KY3vMGo|@-QUiSZroUsjiU&9!=un~QhXoZjNjJX{f%z=*Nq!tSnie& zbQdAoC;VNEi)gt;sd%NcicNxXAs&a30oJm&MB9uf-7>0kerG zV92o|T=*)E%Y?3QjUgI{Yn!UHc0(xIcTu}Y)fyy1OG!KOZEY^K+LoL?>~nfdISTJe zEVOS zSM^(*u3#`8t&iC~)sb*rZ9}BK^|nVBxogzOZNGZuz_6Zv#oM?z7+9A!x5qoKYzqd| zjVu3U&Yr_n{qyQVwCkeKoH;8mV#A#K6ZfHQH0ViKek`3b6XP3kAI5@wC`oT;ugP7p zlw#8=C138I+?g!r=E-s#EIAWqDc=+u!7ukFFUjn$B)#M8-zWDb%c&NZ zPTUVn5t>0+9#)!A`P<(U)QH#kZ$6e2@@c%pC4c){oJpc_JVG%+?eb|R_dXuSQ+anl zdj`2&X5tubL`C3*-5$lI2B~~b@}09)94vr?tSlz^0ulMj920oG8j}o(1|gWZK=e(G zk$(L%=^GX&kPwRG4!30m6MEqw(@MJM6w&wd3j(I6UyXffTFcPnoctl~)uiO55oCHe zkVcnaGFfYLFiqmZZNpurh7SsgV?=m1_*ihJBp=1SA#sEnb8c9zzjbFn2o{9B<9Ba+ z&z+^)OCI`S;#erln38a3PFK=p-7kNhw(D{ey!gCcz|2*COc4Z3C*fBTtf{i>*WvFU zh6H&PGAAYVg0y(uIeHihz|9o^)>VoruJg=$XL6_?py_$KlazhyRx` z-2^IwHnvcgvW7;Ys21E7MVeJs&Llj{SavDSVXV1V!Exv95-BV6(6Su%v`ZoymVn8VD0hFj~$ZWA*{$ zlZU0>VkuyhT`bPq1XIXp(mTx>EVOiBv3EyfvK?DfO^wN=(`r;|QBZ9{ubr0Uxy&RS z#RY;|P-#>;wMnJZcr|)m$c`18g(|ht9zwpqS7WegRR)y?`6Mbq{Q|RSX@_vy<}!NY zSgN8H)JBvcR#~S_vuZ?@Lv6Qc%~dwN*XXjb1SKUq37J7Aqe*KQt)fP((&G1!t3p)< zzujQ7T5Sfq-=G}Psqs^8jZJGZB6E_hcAjWk#*H0_oz*MrlL&O|#FQ4Wf*za;X|4$u zg4q~FVT_*1h=D7i31E>Hf(BS^5YCQ{spVf|TEFXlUFVH4`T&h{ssIl!xNcF2$2{dI zVI3osOQ}Q67AWc7@H`xId!Rx%#nqI@$n9AVIH*Q?}UY!ApgTgZk4H`k9 z)yd96hf5LjOfHUzUlzXzzkCuI0jroUoS=LNP9q15Wm@4r*ch@o-5Jqc5Mal{rvtAS z)E~>mVs~z1+#E3)w#FRxz2Fij*A(I``o>_xEw>~WUM_Vet5f}s*n$>3CZL+m$mbJZ zuIX>qI;?H&bq2TaU{e@(>R-MF=OnzrTw>3{B)f2r)RC-qd+S^(lQo;KHyDiB(ZR-B zlDDK5Rwp|ox=P=-W;jbxv#wD4kU@SDc9+VbZSJqBb{Xp0+vF{}a2=Yf*51Enx!z z0H&BtgJwWL89oj)O(LuK_gH+niK?*=Bb{ZViEx4-XB7c&xL{f5qmMoC1d9cBXLgM^ z?c#wdiz(U0Y7uT;hICb1lUY0c;%S1$zOXsmiLsJJ8|&nM*4S8M zvn1b8ur{qdIz1t265YY7HW@6S~?a3}*0k zjH9P9j>53%i)b%6kr@}#A_a{two(QPq}G%HC9)``nY96HPtl!0ZU7U8=f;+j==a|T z7n5`jScB|Lb}?P+OX{3b#^$3Y`{25TXt5LqS?$6WsVh}YXB$&KSKO~xX)qA1X7TRo z8eh^YSd<~>5*}&_yQ?Y94zp&c^9J*Y%O}QM^Fq5Z>e1S5tloyISW`-PKH(76@~fJt zFVP$hCbP5+m+5F>a`>e>LoMT{JwAJ=-c^GE?QypWW~)EdhP}yg=e;#EKvu0K}36EgsAe&BM$WJq|3dr1>bg zLPiUG^5P+7dHVe5vO(;n;Nk-(v7Beu>J z9fNMSK#(Cu4<3w;=T9_|FzT@=S-C>PM4Yl#lI@`PnfikBm~HaecpeAYLS)9iGwdKl zA>4*JoFVS)nBTSCVe#6qKGHEW*%_?OYW0H7`2YF*sP-6 zYwt|f2JJr4R%J4&RBAzV8aytOOXIS5kVL1h-rhafq0^WhTB}!TX#LdTmWGhmrga2F z)4-~u^SkWf+yhvPXL_Kz$(GhRyy>oWv%4gJXN^i{4vLY8m<@D!CI5`*+Rn7kscW@2 zdLBj~(zM)Y)cdUw(OG2_)l~+)(Fn3{@M;4lho;J4Nj11T7u>aKpl(sbqM`<~6pe;0 zMyj$bhWMFi@83iIY{Licl5{e4?q+MemFAmhK(r#7hChCWwO($b@z`Q-Jc@?3sN$wo zIw<48+Eeya07a7FD|De7ne>cPB;xeXx9-6sUQ!JYthec^;vv5q(_Ev{oApLr0FPyG zJ1hoWuvLnv{9CfK+O$-}dOx$Hx+a{S*VPvaR6EQDofmA-9}VOir&)A*n{Ctm%LMkg z8a%Y7Z}*;CcWfBBJtF9|h9R9wH0sR;qu%GhkKkDk)T}p~(rVFC=QpOhZ(7jd^fWe5 zQDrc>Ef%-Qpb}}JPpp{{TiM>?wO1M4-q2x#RSX~b=62<_C+wDQVvIV;t&^?x$-HnZ zg~;X+jbS1OaTyFqrsIA)YpYuO=gw8#%!QIdzIO!6+}U!(rS!mtF8v=QvIk*pucZ;<=5xU zZN%T)d0$^S+}9sqPjZ1F!#J4}e$qJnU_FSG&4VUg&YrN!$K@whhN+kNQq$ck(=px8MAd()sO24Pm8V^FICRE#_cVJ$VWU)SG95FC zzI$r-&+opjC-k+@DXC{csa8CGL22)x{QTcLm%A4Zk6JA)O||}FK?NSbeaj*^@wEqh^uAf#=X50~f2Nm^X_uM~^KL#Tp3~ zs5*CiM4Wf_%|b~kAy;Gst2`!lV7T%lr6NN1&zGj=RS1g|_u+0l4d4wSJ^l<51Q;V% zLRh#H{0S!}@)TK?0efNr!8&?4;y9G}@5DasC@Ftqd?TimEgq-D{#a4m*Uo)nE?D3J z#n;YaMJNFa1fhG`6F#`-8Q}>0%H(5BCJ!<$>~C^V5^<1?kkGhQp6NvVTA|_ol}ly#+bnU;D-Dw)%*7wA#39+z-7+_@@mkmLJ*nqD7;~S$hkM1l;a^6606bg? zj9T_nc()+|4Os#(5@9de5`qDqt|A_@RRW4|d%ah}Q(H=7;$8C5WQV*B5fnV!g?<)~ z#o8{Pk{9B`Df;DiC;S{K`7?bb`W9Tq%usXw34;%nFW(zO{#E#}QZ1Ed9 z45@D#1b4#pu1w|;yy%9GL8H;9*HFFP;PmMY_qVN*boy=EToxDA=;pIH2Xm=C@`!xs zkw+fYAk)k0w1>Ppn?{rmJ&;vhP0bF!)##GHh~Vvc|2kW(*-d(twI-~-u#Z_IC<~mJ z*$hh=FWe%_)nze7Wc9N3M+o^RG}^2N8R1HXT>{g9IkpA+m=u=q`u4HhF)1WTq41c+ zPL&J|yZPs`@mOe=`?*`9>H0;1WN6u{rJ;|J)L$&Z<8YnSgNA+DeYEZ?*t^v|vnpU? zxg9=hO_luhQTfiQL)YmasMXV|>R>7qjfRfHwLK|EnXb`c<_DQ9g7+GkYa)BX3lbCH zyvi^K6H75egoEV@Jrj_VfoJiIAN#}2ej2E0{5<`Nzwz(Q{x3gDpG3BgkN(2#l3V2; zhhAD>vCc18=P$4b^o5B&eF|%rm<`{`{#ONN0kZy5rXo7BNi2YgGj^d63+7l*tVCpd zKq7e1{X+GegKY~W$>p5UyL#ou%`5vhcW4_|l=-aCX=QXtm-NtBi)|^+?ubVS(u0fy6pV+*9#mcT^)2AN3XKQ_E!>1R~n--_u z9!g!Dl>dg7?FxtRwTTJwvU&yAx3N*H)ZNvB*S@YuiUwV9#T9v5350@;V zuds*RU|=eOt^z+Y=0r>zX5Ef|4z`w#MiD$yoQ$H9t081G^6OPimTH5;af8iT)1ajx zO)VaC;k?mil8!o^f<|xk_0ezT117iL>8#Q>OqUAOBp?m9mRIEv*f_C93r%@3dKwU^Uq9j{|F^OGET?)lbBiJI!W1y3%H|;wf-C=Zf0L ztL1e;`Z?+HnOcq2=&dnZs*M)&%*!RT3D>DRpi^hFr@k|yg`NVhY}GK@i5=P&Iyg!PDr2HzhxLq1MDN%+>h3 z{svs=jj#*r6Uv45#KeW@10@efXhR0rE;XX$ zB&jJeTBiDuB$F?QOmJtIYY$&*JX-WB*MN|h$Vq_`#Oiu5E}9d*Gk=fUWic<>)7Owl zS9gcjfE^$zg}cpfy!y^ST@^J*gFEu+g(*rc8u^tH!uSjF(Rh7)rpF*!;Gt0NSbWsF zectpL)3$U_W0zrs#rp4b(|lvHclTgGPFMHF@;euXjfTRCOk-U{{>~OL=ecKe3 z9D>!t+Jtjp#olU0R!9e|tzKnq5=3Gcq$Z39Z$a89lMzZN0l|rk`Y`hMAcv-WgXGJ2 z0t@=0dG;+*Njz}Z;DC77=7N$7R@hvvvn<}U*s2R``*x|iR4ruiR{Hj~fX=#T^CGKm z{Ftk`!F0^1#)D=K&zI-Ur-uuri(D=Breg+XkRS{_R&43)Y$+nnYkV-Bevsvl^CN2w zwA$%ha#U``3ZvJLju@+5$U>i}+fO0KSRNeX_RJ3kYe}&v5)KwoMzqL*2$JZ?i?J!k zk+sWg3aL;$=(wV;V!yKPvA4T^JbvTkQE?s;M36Nk+{x&ZyROkOel^~N{o^mVgt>K7 zznsc5*cu%sV414Kq=z_lB((Vi)+}VSOgG_yd+siHvoM{Nr|l^^mW?hrvLF@?_4Xd{aaLFQuk-(Ay2_*?3 zY%tkuHk&|}EJ-#A3Br2!d(M4lBoo;EXW8HHQ<-^tx#iq*&w0*saC&HQM`v3-I$1&X z)k0S)=ROG8Bu8>*?m;2D3J=O1NBmtHnwx~5`pcQuZMOE6)t37!<6*cSSBKXvSrUq{ z_ygDIHGLXA`@U~uw6Ca2r}}T6qVEnoq&}Y)mA6+aOF}UbVQzxYacLe2+5t=`yO;;@ zpJ_rIfznOd8DsZJPrgBmf#88cv7CJZBJ5>vD>%fdLjx`7C-di-QP#jngm7jEXIk-(7@he5f8jksfX<+grpZDuCs*b< ztCEx@#?B!uAe@!W1jJQ^06v*J4bke5kld+8`UW%r%spWch9oVg)=zuY1PK+0jWXe+ z5ilwDA~IZaJR`TC5%v*nQOMJ0qthJqMB{E4DL5e$IxPQQEGTpejoaumxin%zgtt-! zE0sc2rl(pXFftvNO2h$16Mz z@{!rIK3cDZ`J2o&CEGj}P+On~sKP%4V>yq!dX#fcai%b+k@0jIpc_oN2zmpoKD84K zeV{*{dA&kx1lO@;=0<`x(WJCMP)6TpFff7<0?2}o{o{@@^%w#*<%PW7{9V{;$@bOE zQS=}OQ(^`lmKzA%2PB6uA58)?6{bdm)&xaMJqOG{)5^!F3kw&r4bo!^i`G}R*TPZI zz8GHaEtlQ9CA#)M-aWYS*0vSCrOVn^H=OfUW%u@GRs5{3EzPRRjYVyZ0Y!0rYa%EX ziT9LBAGFPu=9ofdcSdX0Il--d({Qu!(}~BwF{Ws3UDKTolxo%Qm#C}H>eKtolAVx%k(O(hE)RQAFakz4uy#+u6hWHI>+Dub&eU@A4zxAYtT~3|apjK zs@rCULtAYMSjsH<1@UVtgAa7lE`!Qg%D<fo^+h@*i1Uoa zA?d4@5|vh~(CC8}ht=xPH_~k?y=jZv9dsA578ygz7UM4F^1@xp>AqCPe9k5OLA(~W zn;>kDNt7)KcCNA66LubL;Z9MS`Bho{*SYnp?*3e*qAU=*S1A8@4sz4-8c7 zz?@t;0;ytvhK+lHkr;N7kP>EOT%B7*1VupFMHmL0vuEq)u$na4fjR25|GELXZV}zySVYY7eA6Q!ACkVf)$uE+t@=eM~BEdK*1_*_!6MI zCqqiBa!M4dtEJ1d4J%hR+H{u`|3qLFO*Ig``f@OzZ zQfs_bnv&w1rrGyi%tu#YvJd!#q$}wT5t=>O%wa#m_0gV&w&Bf{3bB6Ah08k^Ev^U`6>V-E`O8%{Jk3&FIvXLK*x^S-J1;3Us@}YCf^o+vD^D^0E8$iH;uF|zqqHl zv^3eav7HG8Seket8mu|1e$Q}aM;iBz2t<6#$uPy^|=h83f zbwy^Cr7Bi!wP|%b+~FeOJ4cShmoF}1c6&w0QPEo5;7N8wlgU`LBIrxh)HeFdDteYl z@97O?VOvqWCgBTKgzJ;ZXh#bo-16`G5OiZJbW+5mVQxq{83?ip6C#jk821n|M#>Z5 zN}RTQdy09SS6$@4pAF?a0Ay@|K(=Nkrf-q_km?kI`vCGVL;Gj8NYhsrz15W=zpupMo1MxfVi1kTV z_r~rx7Te1%5Kqh$%|2H=GgB<2i)LoO{WJFGQ;$FKGs*DJ$XpRU7Q?}P_&65bJNK?M z-a8Qog9v*Tf`Gt83ML6RFnEC9!6%$l1N+_Bgvx*?2TsjMoGAgX-QtqArfz_!wEeaC zeH*KL?X5RYu_D(!?z@4c_^EV)ZDrepBlq7gO|aJ16N(jy|Kqf-gsjqe$PE@GyjT@yusEEzwyR!?B09XZ({P2^ylI9aO|Gg zy|-aAzK09;aIzs2&kAvu1@IJHwm~O_P6nqN6zzP70ud&1o%aBz?m9k2^ndKB(|?4( z{1f6tqhR1%OzD|?d%I7(3wCQO*+A@=K*IL`2ZWu# z+X%lrHKF6b5 z1=V0e$fPC*O~Eyh0q zk1|TLd*gTA70*B~XclfLDIA7_owi{6($X0JoVvhh?~mVAaaSyp3{TCsAK6Bc_dpin zlqrsSPGd$RJ~LSPC@0sXpi}%Km>868^rGhh7>OZ1O*G|r-NO5di-27w4%6KzUkn&< z0&;B``XSA_@D&NeF^<7gW~O$5bsE2ovaOYmL(rh1F2V;eH&8+5iiN2AL}5Yf(F=+q zz1i-?R6kT(K2Tm8idXu*fPfS!1pUgE#{O;0wY|Twl}T&Hnm2^wrCtZ9rQP*yi(2d5 z6&|0XB_7_8{EIgNkVW_}-f$Q$eBlajdHW(Lol3LK4@3vh9e$gcu%3(B%e|dLS8iDC z_j>)SH(WU+Wi`f7^=5xtkzK7;;76^tH>5X3L*V|mwVu^F_m?l5ck_KW1pFtD#sIZe zkhe7ovxgG~es%aapcm4lfh_T4n4g>2tLVvydlas!EEBw8liqf7 z>}LP!m5okAJXqlg0-Xh8Y7=l|&Pv!Jq^C>(*w1cXkrpsVL)_ujg2U37PJ3^Pf5xfx zG_PC@cg}}m9^dG8*2hccun`Y&e0Md+1CJu-_dUp!{WR*8AeH3kP^s~N^w2J7u1Tm5 z^q^|E11OX>i8^eC_Na1@pPP&~WV}d;?fgw)_edZJK~{?qL1|?c3Mv|uv@>K%94(T##o!0$8i_JQ8VLn+r_oa}W3Yx0N~mrUirL<(BIy$8 z5_g#O8)nLWGTlD=ICU2Iom(zUi}5|B(oWytppV^Gx+k47wlvtK>{hmS^JeMxt*pQ7 z9?M;HU)kny1F)iHut6@zT_a7bsYX;0wCT2Wy&vc@V=g{%T4PL%|91D#Q=x1^RRR0h3D z`L8-1GXq;6^qaJ%-!s+o3f8dRURF%T`|wLAOV*YA(x^6@)wswtrc$>_Fcy^xTU163 zOg~n``te$N)-ucECWp0DWAX=ek6~Jqe?Q^}P~i!WavhkP8 zY`n_fLleNRim}p|^ufUx3w#=q0JfxX`l(OL5Kw3^$1 zpw#iut4g(6`6}K+_WivGz1Lpgd&XD*@<2D@T8LNEjcKA1b2oL92>6T=8zSPjn$P*r zx~b7GO2?M4kQhjuWtr(}I?pTpsz_7rRy5c>4B^qpw(_cbS5G4n%A8EA3TXzNb{MkGJOXHb@Q?#Dpif_cm7X5>GBa3&9_8C0iggp?tQxXCT- zZT(68aP)C$=G-@q*OnWK?z+0@QSTE9qeeaTj|-E*KbTI6C)`Kwa2v|v4@)1uaa+}3 z-K$BR@!tc*Z6#CRFnASTE?)JO{5Vz-25K0uXl$iUN6*Qm2(iDuQe_}_ZKM3%A%jJ#ySSMf+;Cd;M^U_ol z!Zjr%OGT`ZSm%p_S0<*8x-<6trzG`d`&@EOXo|r~(@$d@GGtX#N z45v={5zu`}r7PCeIz1hNAe++zF<++GL_bGefC(K_;Br`|(BsQt3CBbWjHWcI5)^kn zK^N3+_*oju1?RGsUo@%Mc ztkTI}*lcd&FJ2O?OPk|Mje=@<^RlzqPamp}ulwaU8spFt=WM%Y>ZW-viGqg8nTRmH zM4+H^lnQhT0`$<73;qE(11Q#$`~;7Z@hMHDPbX()fLFsOe#9X@9LW}WP;{n2gPxiK zo{f}OxxJf2lWgHW(_(Z=o-Y{?vi3BQ0Pzs?*Jmfx$MYdPcAf(W&xmL=(zFe@d>&&>b6^`*#Bx0YzW@bd+Y??SC211=^}N)? z>V>Nxf6-sFa`EIY-@m~3c0lT8P0}Az?gyoRWM7rua;NkCO3u+&jr>qBlR*i?FYjFQ zi73_9d79pNi>)0hJAfF1nus%Cx&|!3fi^-`K`3Fs=|HZAiHDiJ&QYzv>6`&;9ql3_ zW1<~Cxp93>ZEel^jS8!?q^;N;FbnIfCan%JUK*3mWpEhRnze2NlHMI#y;?l+(aR8? zwS~>vYj8d;bjB40vsJ4%Xe**_vj-7g3WHT^^%=c}VxP6jZz?u;O@VNArSx5dK+E;K zU%Uh(1mjdrKYIDaJ98i3l5g)1qTNuAix5y+%Yi%Ix?m@tBPL;! zgZD29)DtQQUnq8LB77TEUd#?0DmxHu=$&rbLM#JnyBcV+h`k0=E=)231&4IzU9|=- za&^Lu?tPLq*2h7)(i*RC>|oK#cpw<`$11DYKhshm9*IV4;`L2U{Gbm+yGHv)Yn^mo zed`+zy|aks1>IVMLS@k!Z91FM+B|i3%acjr+GQ8k$67yo&u3d>br&vc*&B(Mp0)KX zUo5iszZS&&8|B6Ez3ka|-Gx_OSjP{2tE@z$l1e?p!yfia(5PCVd{>Er(TX5Cqt2|p z>=1HNQ2UqlPqKOFA*bpv9srb#(HVV!)K0{t&$VJ7nhSn0g#x+__^LvnrJE>TNDH8X z1vQy*b_DZd|; z3&}$QZYA@}@UESOXZ8q>a-1T~0O41YBkl1GK}NxlPlIX=j(SA%V;i8oX;gq1=cMUi zuVPQZBLcGqP4%Y<35m~XKJh0fZhrnR>&!HE8(^(lhI*1crex^wG5e<)#z8d687t{y z)u&P|56nl*3W-mxUCOZnzkqGZ1Ak5kUbAK}1g2nFUjbVOY=K~Okl&M1S;**SvH;ri zEQkP=1^KXmxhrS|0P)P%4)<2(Ym(Sz%h{_(Yq!4Ot?}Y76pF2iMpwmN*jjt^*U~uh zuiOxn#@RaQiQljr%F6CPB0b)*^o9IS2fmjsz4qGGV)fD5ZQk0ZT5pF?vv%9s8Ud%D zzCS29%gScoEn`2zRc7A}E@eM@;WyHTj-^XGmI}v~zOeMW$ZIdl$4TfbL2hv+^hkn+ z2k3kl1PJboVE}${^f2;-11ieS**F@l7&^9X*I64Hn@dVdQcJekRt?s=w_nk@^ze>K z^RlEGBo`@hZN=sHKXg@Rb>*tnPi{Rsy||>kXy0|W99jk}(j}MY!fgOe=kGs?`^)T( zpb6sUMU{)dBE;obhrPWd;E7x2qG1Sp6_Yt?r!OMKL0JfO5Ap`{P>M{ z1Llr|Z*C-BN2&;Jc?m+u0@1;#DnCN>O>vO2p9`Q1GHj~d5wgofTEz81U-{`jvgN^m zbozPej$lyu(#nG?Rvf&JK2|jCY--xMZ%0$pj^xgrUZ50UX4$z@JQ|Sha9Nmt_UXn< z^^zq);o6{dD1Q!4lvBus zg9zskn3kk4aR{)Rz%(HJi8lJcG{9{5E9em5u|p3f1E(A@febbU&JdEXX88N!m@}&T^Vip_GtCs*#i4I-47C zC}26s1|YMYE>*dT##V46)ys=%)>x*-yeom@n({|BH@O>3LU55Zb469Et0Do;KbxTo_k4J$Qz@#e?WHPBqsPa5?FO@( zA^V&-J6()bPoqZVb5yIeon;6MNAf`Cw64>|jjW`ulo@L^P4UWl1X##?XcV3f3p`ff zD8-K)KSJ{Z3)*o5IPW%6mMA-#q#9K~AWniwMU)Bn?x=oH3z#xk!Hv>b&~GqfgoY!^ zc#7?i7vJo&pkJsWXsqjvj#)4aCsOc;V@~~G-icPudrw> zj^?78rX?%dEA6flUqzX(*n?DzoJCIdD+tnc*GAKQMhAi~BYhpmOVf>Y$%@OQmv%Yb zr5d#fxfC_p63Jj7>$=f$26;~&OeEb;EU|A5PN$*$f@{JwAH`JSk~ z6E_uM;};_0Ys-Qi+*%DUT2qi*^iG74yI~t3Xe`7Yg?p0X3&9P(AyVk&VHQdV5`~h~ zj>y6tU4)cKE1(h3O?cs=`2)+?R1PlkmuIB+VLsGoD*O(Y#iG;L)PVH}YMVwUECsiZ zpBVP!AFK7Gb=@h@{REDu(v;DpH4vbH&914b6nL->pz|_oz-f2PemR&lYElY~RjUmk z&zeSYVTwWni02bioV6!UcEPcYIHXhx!*~mZ@vBoHlVvIH4#~?GiX#dW?!GWYHSuAJ zvg4ko!{uT6r9OGlCvo`1!@MjaG5lCDz{Q^}9RToBa}olfswZ|LyG4cj*v)_0{+ zUF!{-wis%?%k)dDIXft;n0*Helnt2uIgbs->vAB8_yyEWHRdXHJTjsKcyM5-D4|af zBoQ=raRnIYKr-C%JX%yw1o}<{5#5HCT2KmsVuz}TnuCv!H(G!<$Sg}~eP*9QVo9|q zswr2Wl^d-!YCmeFXLcOQApc>1MYSAYM=y*%Hv3ekZQ6z$xGBkS3bo0^x%MaKYtvzO z2CTEsvmcmcJuwhFn7#-NKx*p(5tBSFQ@ab{?P}2W7UI2v2yaE#lQHZn>ULbRk;_kh zjigms=Ja4f11_~f3q0amT=L!w(r9u;&77}Qar~Jr%2pCy}H^Rqa5K`g^D;nnP zm+3vzj5k8LJx-;;Dzc7Ab?k?hwDhw=GkmO(Yy?~ebABy3ib9qi3m7x&np5!Ho$1>+F!{SQ)6=lhO4hjMVgvE0uwU4&@joY}y#IFn?ez@$nxQ%KvN zXhPDbTi7kLw&Q^#E_w*+yGQ+xBN-HoD31{EFEDl)inC+)H#QA!m_jAI_>PKH`0Ar(U-+-GK zlE7ULv_KM_qPdAB;Ie|-H0k6tpAhT3|G<~uRPJPmm>{XqEM9Z$*aiEg(|#@HL#~s7 zk@ULLKmKB8x|sD9@7(ytPnuU|58eGaU0>(y3&8^a(Rf({3uhg(H*3=@8s38ALWsjTWVr(KCO9PVH~+UH*h z`lWY^Y$rY=-G*$+HY>#GLDLiejyIC&{iIuqY^W+}KP&dRTyy+Z!BXP8 zYW|xr-;p zAFgefNk^+zu09)lto4lrUk%v+<*X$OkbavZeUOWp;2$Ay)2G>8ady`aTvE6DRgk=2 z|0uisQR(^z&Xe92BCrPD6@OKydlkYv``BaWohSWA-v4t2>V@pm!1QXF)vjgsCSxfq{C=Su1vQ=>o?& z(g5k`@t13y%qW1CI~b1O5Rg80M#;Wu*k|4`7nLrAv?=)VftCt9Ps18UUFd2rSVx zuqE~4X9wbrK;z)d3^_FccKi!etElvV#;xqCKB>mB+okrDZ%;kzfd52pCnS@!u-qbg z0MEr8{dx9SdOWgViA#6uxb;_f6>s?7+Hn}Ar^LH=yJqW&ERkoH|NL68!b6VB;}3BP z63)$p_E$nJka!AdV8?Wv)HH%<$pV(fm>{;mtbjbhdFSgiX4%si_)os+PY2!vnJZ1r zL5Ge&Oe|oZJfdSDnY*7n_jF)>NSu;{$|0vOAs=CY7V#1&T?Fr7A%X}#DsQCibS6$6 zhh&8KxpO)_b?0ouRLU>ddGZB{rl*`)*c_O;)1RLGGLB459rt$utOL^e-LU-0a^n%i zL(#0Avf>ivfJ{j6zrqX=fl)Lik{uc{gfnB=p~t~CA*Thyl!npd(N1`O1QM1pWWf-N zy$vdd_CIR=qao_pc;U@Aji(h}|GA&L|I*}Y4Q%PRktDanDnD! z$VpXwdw4lhNHg^daTUlyc`pAZ_)=_Cjqi&O9u0@j zIOO(@bQoQ<(2kx!+m!K=r6^;>xRZV&2Yfog&I@ILbp0UN`mG5i+8BIL)Th*l~%TpEWi)L21Hf(PX-WO2n-?p zKyyQ$m1#fzFnxfYMn6Cq@?*dgoB!c9ez~s`hrAp0zl<|4sYB5e|sS}6~a+xm24U*S00t6k1knQM?L5li>cCO5S%XVY13q!(&klO-o9RQ** z(4qI90xWFm1&`+ikMs!tdXpD3Y>@1|?|MAn^&IEbAPz|{l%+}o@C~Oy7|33qLTDBy zO8$1gzg@5c;y0Baza9dIKzPAASVtCw2nD?e{*x3)|B@(M{Q5*Z7_z=A5Q3`WuxV_> z%u}%lSU#CC%3fG81Q?iHkPK> zZ0$|9FM1)MFn~DAXw#}}TD`?-Py}9B)Sm3yx;kAdeDy?Q@3wH|GM~ro_V|{q+uqxF z0?}8dkXCI1s6uD67aK+CKS3c^UER@c{Cr_7|1#>xjS-i$oF*iXAU(&5?1N3H1X_gV zBSKbz`qY_+MGKFm{Fov^!nahuYqXP^lJ1SMp{fAb9NR_R67 zgv%d`38%YLx%r1UFMY#D9%3ln7ri}x48GF5zV)Q|1h+v(VLPKynGd^wL2fCs)VOiy1DT%fyUtUo zqOtGDo-~9@b9>9F#vPvK;Nk1``&){3iF-P%1K)c0wae7%M1o&q_H!+!9ru6l$#Er4 zeUL7~QU&Wu{`&*g9QUPGh@EL~U0dGHLSqo|X3Km*W!yUqume!kFml7L3at`d4jI-c zLL~yDC|HBQag>LE13C3Hy4h3423RdIwt+%t-WE!({?_!G*hR665h|O(#35F@e#gpyxxL!5uzad)i6_iS z6*nx4YJBbC@WOzqvSY)FT2oPTm=0LjZ4al)XE%Fd4N*^WUGgOU@yE7d&V(i5#`xMw zb zELrf~2VI~dm01KKH7VX2zhsBtfhFiR_=N%siZ{-60uVUCTq%i01lK4dTRpl7PJ|CG z&CqYK=H_!t;v(b+;%WrE<-dR>!paY!TSHuM@YQgfBJO|;#NAs`&D-!N!E}+MdMfHm%R(@T&p;Fe=mm7}#4^FAO{3^ofV+ik-Sp zGn>7wp|q}8S5zVR;~ip)8crjXyI7-x8)AjpU$$a5Al{ok>4Psxe`H^4x#gCwTXyfhmF~@XRCwGDG>Z9q{_Pz;dMTVI>t6Ca z)eN~#C?hYP(H^2dH@w=wy$0D0eSK_`^j^R8zVv=SLgSvogMFrkbxXhd=oNpv`_|pJ zJScsT?=OS}5TVbIH4XywQ$heR-}wBeas3PDA!+BQ_V^d(YcwtpXVU^ZnKGfmCy=Uy z%YIl(yZrv+$T5Ed+%zy$!kW9$Po@EQIG_&`+>Gi*p7)XcMvbzVi$(;D50t3fr3LGV zJX|NCtIq`|ilDClughXz`&#UBw%|{f)52wcWCsdyih})3?8NUCEQOu;z3k0=eclF{ z8Q?KfgmIF!MC4ZC$|B;GFoa?1&Q~G-$ip51qdBaiNw@Ir*!^cmv(k4br{XhHv6aYV zx;cK|=GX)rlB#Dar}(cF*!c1$cJ=+Sv$Gp=@u`{k)GFx~e{l1C@y!!6zUw1Xk&`%% z-LUCpN;jP!Umq5~gn8y_$j@C1`ru*Sk0*naQ}y=@B@w)OTO5a4KIqTX2Mc9(fNR(5#wKC{-q5-`<$pA2$jv+G|Zdwd#0 zCuLudwARBNIPBFt@VBsEe6ZvEd$xJwZkI9W7nkfVFFz+(p`aVR*Wc5&@br%?dV7Vj zY}c+bu-kYH1`!ma?*8p(HzX1bXK#OL8*V5}a5kBcR40EkzpM|Xxb&&TL>;>{1otUnC zK&X-yjM*pn=wv(#R3tL>2a_VM9wHzM_sWol^fX-90777nfoscQz~tIxuX@Og080=B z3dmmXX`nLm3K0$HX-^0-Y1mb0L-I3FEQNkJ1(= z{z?2`-ot~CXP|UlJ@X3>08bQ?%pV4-13eAdHn@V8f1Z@bbEbmEr@nu}lL&0IE1N>%mC_5X(%SNJ)`Dd3<+Hy* zT&Kq`{fynsDx9DixkY&O_^G7y>z3oET9A3U798oH&=avHyf;1FEM47n@+25*W`FSjTYCE&k3W9z&mUl$ zZl``Kx4B1gFAXe~R>&c^x$sslil0m(4kH*!!_@x~V>EREgvdeW2H?&}9a%}z_rP#@ z`Ox+C`}cLIn|gBtOVst7%gsBP@o zzi+WB(UTjH{=G;QT5)z~jiO@3<~4bF^nc@v%aeT4%rQ>~06rY}68}$pap*mNCtq9< z+TZ`3F3xKRB2B^nuXJ%?uMw0*g)xD2X}R6gxWoVR=Gi7_kND?qABY#>Q5tcG#|S_4 zf#CSLHOk?O6j20Woa54 z?hraNOdBY12uAQaz?w%>P{>1`>4CyG2}=AVSWFx?m#3lukxA~LNoz1UT?S@yotB=6 zvUSXsy7SJ|@#E4Rv9Yn(*l2ugEI#_YE}Dqyw2Go|G+ZPmRR*0yqYxDevqPs+suk>~ zc)`yb0|1wV4W@?j;;7DezQXFV0lALk6ghrjDMgn}T@W9YuZfGZ$)b{yB1g2`=`4?W z4JvSxD^xm%S%GV79A6;;Ap6=LKs<{VnhAL_5G)E@7%*IfhoNB6CM)LBi0Xp#QC75J z9wXITcrujdtk)qYWuijBLBzi0oy% z;@Q|(eAo8)7}6ffy8T0(Cm5`KNel~|s+5lm7>1x%yOStYn&(4%#TO@TH_;B-1``2b z`lvX#B*`v-Q(zi^dn^2itIF)t6d!oqD%dPd<*i3jkta8N)#_xGVW+3*!uDV8D`nqX z+~}~@xV#$Ej&lc_bqbTlsk0b*-Z$Cnhhq+_&#$=mt~(uzZPt>_Wm7+_?X8KVond{k z^{X46jMNYJhMneev+LJAUa_v+XsNll-EP`;?qI7WWCQ?8cg|nUT9?LWwD>x!9gaKi zx|igv{JwIoaW5nv*ZGhPlM`;p?VH*-{X<9trN+Z>Bm<;7n55Cf^NJ<_V3hcchlWxe z7RC?KOXSS%#Hh-nO>qy3#0SYSL*Ky+i6h?&-{kHfRr5F|UXOrwr%h zR{-AxZUsrYF|xc8IQ`jz??L{?y=9yg>6T<4qKt^`;3eEO|8`J|tp6`$t6PT0*2{3& zNLd8dAGA9eDEo0#YXUA1S?z}V>EAvPtNO)INQSwhT;T7a*Pd=z;~{>gd&GL?fJ8eM>NIy?GF5R*k3tJUO+fLDe}zbSa; z%9-zjsRRvJs9hvEr)YtbsP2=bSIavviql3gC*;59?u|Z7b8R_?2#u_0N@!yEB*>+# z zIxk(X6Ar~^*VN?u-LJ$6c>Sqd=I%-MK=OKrI1@<(sUcwZb5m&kRQ`s_j*%-b9}Xs} zuDJW2i`NPdt>aI&MqEAhxx0=;6Xj!9Trrqpzs%or`GK=ae47@9R_zId`)?fEPoBj<^i#f45p>n(p$VFi; zO!x)avJd18tQ;U^4g!XO=1l)TXMNSuljqjvguhDc1~x{V7KMLdIcutu{v{W^W?+h_ z_zU{q0LFNV^z)*J&>WO_JwX!8{}6Rb>BbSH%Ufm=Y@ce;UQX^Au{^0LXJqj#8|S-n5CfB8P~gjxE2#SU}vIr^dw^FXMh zxMELnh4l62)~3$eH{P~E`mZ!wkdiKyUU_DQbx0rnX}(?xHgj0>3KE*jF!+4&_Gflg zDSGNu^qccy`Sfe#4!=M4X85i6w{XFH8S+?B%Es!!6-5YOcS2Mr-9XLqK* zVy-RC^FN|3@!)5edVu4K#?eF&QE-Sn zfcmMTPQiy;v_LMkFi`_UB+2vi0xTb7TfA5B9m&6eIK*Fo zIV#~CgTuy>Qs1CtfV8u3`&vQv&^%oNmp6gTrZsV*4hn*=E3^qZ7mxd zP}VCokyvG!+bf7#RiLijkDP=aM9jqFZf7*Ov;=L^sS7V|DDim>fdIILK_)Hh9kPwi z&M}P?`vwDJ#0jVq5spQWE*&9Yg#QQr0|-kZ--0^8;eu7 z-In@@ZhmI28F+Qa9HZQSk%AViXiYWt3;PA|oMm-hZ&}1%N6kWJ8YFRP7 z=p)8!3d)jgL9*}63Z0c$l0Jza4Pp&$TRCuBT~2H8Z$RQ9dkSB2{S9l{jfuKA`0K;5 zx&*r*=!@gW7n}l{y}qVI`1n22@iu5JwTN}<#(0UL8#&*bB5(_#6#+*CiAyrK92hGYIYBaj zkqq#8m`Dk21uqM5E=?F(MM}2mASOhbQa7d)k;X_pWO;qKOhxEW_Vf7AErH=7|7}C@ zfjffx_66_IU8z2IxAsc+IeT1}>(A}hUS8C7&Qhg{wFm}<+2yx-!*0F7=Cr6(NrTmC zHGl$HuhBYf4awxjVgIeev7y`j`}PHH8;T9z>Q7zaI=9PpMBCM+J>u#**L8*V+;iCh zjYB7hz9OC70;r)4c22+7QzA{U(+wCqg>2z8n$h@Q%lZ8H3D39j z&Q~?Yev5=7vA^$C27XI{YzSqhV*GZq1^MFM#u@xzRJ zCIts&S86&cdMTtKDIgF|AAiC}mgSam%39FUHf&2Iwq>>^ zKy$Cz=|!mS-4w0sB_!wHKJWwibFRuQg*`g4tq-Se?cdtKe!im^Cmv6E5w}}tSM$%$ zBW*rbj{p6$|J~2~zj{Wwem~^7#qH?-nC*Wg2D(tD$cYOrjnI0~urRZQa+ZQJ?T$D< z;kn9?+1=tX8Z~9{l4zzbFu&IJ947mpP=vPN-yWGiuk3>hVCj_QHtF-+Zz-dFV7`Qj z2et+)p>^a?A+~)Q)GllrN5{WMZug^ps4 X1|Ou=Q(*tda06I>Ma-t5~M?57D~u< zu*W&sPm}C6@9CGl2$(n~yeK`73`QqrSxpU0MLie^(1G$}G3i_?cpV9~O~$QqCngj` z&kt#dxI&ujLV^-Oe_5d+0#(_S>RNsF*{hLiIse6OnQugJiylA8YN~I1;Ku4J{r)TE z1$5kf^X(Jw!F2)QJ>0**$J~S2i454306SzD&PE5%w; z(_IMQ!Cx2YcSGrRitT|D1hz8i1snMdLy?$x#cy{T$Bf@$=GpDG{oB;rRI2a zb{uiyn3EQ4XeVHaP9U=Q+yz%G_$*2h1%mS7-o_MzBa-@<3T22n9V}^$2pHnj=;(By z9YD#2YQVC9Gi2u_A(>^fiWl;BwXR#=e_*A3P>R1M9 zovX;M)wH(hZCXQ7g-4}oR~xK$i$O(SR-Ib)xW!fLX7z zYt>3Yqca*bf`YAfhTP1g)*h42x0;ortFp*j;wf?k96F{oJM}?i+C|uEiS#UJd^MJp z3XC<8gwI=B=0L8Y7L^VL2#vyFv>>!p!iaaZ|C0DqF+5A5&L0vVhi#*ZGD9&Ja-ynf zZVE6ZN*EQS<~DiMAXSKp$Jr*i5P(S%l_&gOQ59wSnDqXlTW`B)l{z(f%dv|(rN>(K zR*F@zaA5mZ5E!B;++1j=M>TN{uj@;nW$j?H;;$$fqIT*!FS}DAwJ2P&S)d# zxf;LnvK+A_FDtOsncq&aXC?V%6}Ct6%Q{#&Yx2uvi{60}U;1Ua7?4;2aM;lG=;&em zj$z9<-?tB2da=C*8J_8^am3!&;M z!aAT84a|rhXJ!^=WuQ4_4p;+Ru;>;s52y^htOV>L#K|526tN5pdf-D~VVH7}*%%u~iqb60u?etd><571AUnhkv-8;nY>HjTE@BtMrhO^9j9t#IU`N=M z>?(FOyM|rM{()V`u4hMKe!h|2#BOGvVV^}n>#giIc00R+9b?DYo$Pb$E+BmFVfV7n zvoEkOvisQm>;d*5JHZ}eUt$llFSAG3qwF#EID3LU$({lY+*jCF+1J?D*-19do?+i$ z-(=6S=h#28=h?T|x7l~tci9U7AbpR0pS{FhX0NbU*$>zc!4C8q`!Rc+{e->2{)zpR zy~$3ox7g3vKeL~+e__8s@a-?zzp-DjU$eK_JM1^?-`TtDx9mUId+c}Y_v{bsKiMDI zpV*(-`|L05uj~Uh!#-rE*({UTe+dhaVn(3EHv*_h1+}0Nw1Q613kJc6xw%=e2yk`^ zcEKSy1()C!iUf~PEO>*jkHaI$w6TAER)DQ#%gZneO?re7KK)h#cVj#cRH+En&zc`%fpU}$(WC!;S zOjzXQ+(CO&md$NO>{@(6f21{ezeOQ`MW9dLHlNEa=_iB2(hclyn-B}|RhU0^y5JH2a zd*!vU$%(yq<-I04Kc35s<_1w58D;N4rguooKZgf%69z2p&%)VH?=-hU?_(_N;qRg= ztWA#ND2T*Nymxpkmoev8M!F9Ujtm~2UmqOh>!$qvY$i7`mdzM@2eZAynRx%;@NlNj zlwZTM4iAoI4EfdEaCdHiA2~TVf%@sr_GxiacQ%gKRP_!Ij*lP02Hc%CDEX2JpObz3 zErwB426=UIoL1yJZ>>IJls7lpQ*#jST;U_?KTwMNM>{*-Zz-*oy^g=pw4g7 z_hvJFc#d8?hN2Horlk-5RGPl-iS8bhuemRS`oPmn#CZ$R&aFq}rTHcp$8dzp;RfBq z@yXHsne1TyV5YC+e>yJkv7L0|GtPE?;sF&O+uA=licW#rp1-l@zdgwRu|30Md(Sx2 z@k#qX{vMN~xykYIu`GsFqkINRAU8IgG0m+_4317_Eb=N6R_edsxwfr_$;Ruu{su$PbS9Qyqaa!*XKP%3~LMH$4XKY7D%s;~X#{47j zo962{H<1~S_uy)0u0ynpWKq?K6=LU0z%*gn}q4i7~KXs}zu7svbhO?)9Y*@M@Z9L~7p)k7l?6GP~uSu~Ha>>=w%Hq(lHfy0C23R+Xr zM^1&$iA+}6Ka985_Cw6_B3JXJNgRnSM*7G=z|feHDXfi+Lm})_$@>(0A%PTo2Qe<} zh2Vrpg?`QmtYHlw9wRO8-^g_g!AA)m9E^Cr=Ljo2_S*~4!&HcIF7 zwc!bKesPe50(y%|URUlN9_z{I_Kw9T#z<~v)O)ktJw13Ke2))c4e~IPweHQ1O`>HU z!hQPV6Nkn#$^ks^gn9rEi?UJ-KxUf<#ut107ds4}(R69b=Y63e|BZJf%3?mS47@qi`prD>+ z8JQfO7#v4ymwQc4F)}%k(Trve@G8{t1>WRzqd?hZ4$%0g7#+hgV`$p_-MtwDm3n+U z3jvThU>M8p?H(OG%%5C^&N)6gp&mz<>fW2tjCVu+^mdOb#=CPl71{!-L>wO+RpB4) zS3i#a9GAyd1uf%aa<36rh8}_9Aq7F5zmH`+i(#AkKsTR?)lT%|6cOFn?GkY@!%_Nwh zqCt#cD9&VYJgxJu{kVPx&kKKq0EXo4F4 zjdr5SQDZ%1&f#sTG4*Eps2WVUu}La08YZ)2!!~J@CqkK~{y6eQDB7?=u^Xeg`-GfTJmS0n`E-ow{-apXrhHD z!{Pz7T4R3CNM>SSZ0;f>7$gf9p|LZEu7@&|Ul30QC9b#d|l4#a0Zte?TzQh ze+8|G6Wx0?6WzHXl9XE5E;3N7#xoi`2j&Rf!`O5XV;D4c-NXQzDO8$l4vUi`JvkD9 z8hLSYTseU%%PA+aq?6-m&`%)M=#cp}nl6~;_VM|Ger|PgTs?7MZ~`}0O=5%@?z2yh zer&A5E)vK1A~~s>S5Gx)f?SWG1+H9Z_mAX=0)||"undefined"!=typeof process&&"win32"===process.platform},t}();e.Environment=t}(t||(t={})),function(e){var t=function(e,t,n){this.type=e,this.detail=t,this.timestamp=n};e.LoaderEvent=t;var n=function(){function n(e){this._events=[new t(1,"",e)]}return n.prototype.record=function(n,r){this._events.push(new t(n,r,e.Utilities.getHighPerformanceTimestamp()))},n.prototype.getEvents=function(){return this._events},n}();e.LoaderEventRecorder=n;var r=function(){function e(){}return e.prototype.record=function(e,t){},e.prototype.getEvents=function(){return[]},e.INSTANCE=new e,e}();e.NullLoaderEventRecorder=r}(t||(t={})),function(e){var t=function(){function t(){} +return t.fileUriToFilePath=function(e,t){if(t=decodeURI(t).replace(/%23/g,"#"),e){if(/^file:\/\/\//.test(t))return t.substr(8);if(/^file:\/\//.test(t))return t.substr(5)}else if(/^file:\/\//.test(t))return t.substr(7);return t},t.startsWith=function(e,t){return e.length>=t.length&&e.substr(0,t.length)===t},t.endsWith=function(e,t){return e.length>=t.length&&e.substr(e.length-t.length)===t},t.containsQueryString=function(e){return/^[^\#]*\?/gi.test(e)},t.isAbsolutePath=function(e){return/^((http:\/\/)|(https:\/\/)|(file:\/\/)|(\/))/.test(e)},t.forEachProperty=function(e,t){if(e){var n=void 0;for(n in e)e.hasOwnProperty(n)&&t(n,e[n])}},t.isEmpty=function(e){var n=!0;return t.forEachProperty(e,(function(){n=!1})),n},t.recursiveClone=function(e){if(!e||"object"!=typeof e||e instanceof RegExp)return e;var n=Array.isArray(e)?[]:{};return t.forEachProperty(e,(function(e,r){n[e]=r&&"object"==typeof r?t.recursiveClone(r):r})),n},t.generateAnonymousModule=function(){return"===anonymous"+t.NEXT_ANONYMOUS_ID+++"==="}, +t.isAnonymousModule=function(e){return t.startsWith(e,"===anonymous")},t.getHighPerformanceTimestamp=function(){return this.PERFORMANCE_NOW_PROBED||(this.PERFORMANCE_NOW_PROBED=!0,this.HAS_PERFORMANCE_NOW=e.global.performance&&"function"==typeof e.global.performance.now),this.HAS_PERFORMANCE_NOW?e.global.performance.now():Date.now()},t.NEXT_ANONYMOUS_ID=1,t.PERFORMANCE_NOW_PROBED=!1,t.HAS_PERFORMANCE_NOW=!1,t}();e.Utilities=t}(t||(t={})),function(e){function t(e){if(e instanceof Error)return e;var t=new Error(e.message||String(e)||"Unknown Error");return e.stack&&(t.stack=e.stack),t}e.ensureError=t;var n=function(){function n(){}return n.validateConfigurationOptions=function(n){if("string"!=typeof(n=n||{}).baseUrl&&(n.baseUrl=""),"boolean"!=typeof n.isBuild&&(n.isBuild=!1),"object"!=typeof n.paths&&(n.paths={}),"object"!=typeof n.config&&(n.config={}),void 0===n.catchError&&(n.catchError=!1),void 0===n.recordStats&&(n.recordStats=!1),"string"!=typeof n.urlArgs&&(n.urlArgs=""), +"function"!=typeof n.onError&&(n.onError=function(e){return"loading"===e.phase?(console.error('Loading "'+e.moduleId+'" failed'),console.error(e),console.error("Here are the modules that depend on it:"),void console.error(e.neededBy)):"factory"===e.phase?(console.error('The factory method of "'+e.moduleId+'" has thrown an exception'),void console.error(e)):void 0}),Array.isArray(n.ignoreDuplicateModules)||(n.ignoreDuplicateModules=[]),n.baseUrl.length>0&&(e.Utilities.endsWith(n.baseUrl,"/")||(n.baseUrl+="/")),"string"!=typeof n.cspNonce&&(n.cspNonce=""),void 0===n.preferScriptTags&&(n.preferScriptTags=!1),Array.isArray(n.nodeModules)||(n.nodeModules=[]),n.nodeCachedData&&"object"==typeof n.nodeCachedData&&("string"!=typeof n.nodeCachedData.seed&&(n.nodeCachedData.seed="seed"),("number"!=typeof n.nodeCachedData.writeDelay||n.nodeCachedData.writeDelay<0)&&(n.nodeCachedData.writeDelay=7e3),!n.nodeCachedData.path||"string"!=typeof n.nodeCachedData.path)){ +var r=t(new Error("INVALID cached data configuration, 'path' MUST be set"));r.phase="configuration",n.onError(r),n.nodeCachedData=void 0}return n},n.mergeConfigurationOptions=function(t,r){void 0===t&&(t=null),void 0===r&&(r=null);var i=e.Utilities.recursiveClone(r||{});return e.Utilities.forEachProperty(t,(function(t,n){"ignoreDuplicateModules"===t&&void 0!==i.ignoreDuplicateModules?i.ignoreDuplicateModules=i.ignoreDuplicateModules.concat(n):"paths"===t&&void 0!==i.paths?e.Utilities.forEachProperty(n,(function(e,t){return i.paths[e]=t})):"config"===t&&void 0!==i.config?e.Utilities.forEachProperty(n,(function(e,t){return i.config[e]=t})):i[t]=e.Utilities.recursiveClone(n)})),n.validateConfigurationOptions(i)},n}();e.ConfigurationOptionsUtil=n;var r=function(){function t(e,t){if(this._env=e,this.options=n.mergeConfigurationOptions(t),this._createIgnoreDuplicateModulesMap(),this._createNodeModulesMap(),this._createSortedPathsRules(),""===this.options.baseUrl){ +if(this.options.nodeRequire&&this.options.nodeRequire.main&&this.options.nodeRequire.main.filename&&this._env.isNode){var r=this.options.nodeRequire.main.filename,i=Math.max(r.lastIndexOf("/"),r.lastIndexOf("\\"));this.options.baseUrl=r.substring(0,i+1)}if(this.options.nodeMain&&this._env.isNode){r=this.options.nodeMain,i=Math.max(r.lastIndexOf("/"),r.lastIndexOf("\\"));this.options.baseUrl=r.substring(0,i+1)}}}return t.prototype._createIgnoreDuplicateModulesMap=function(){this.ignoreDuplicateModulesMap={};for(var e=0;e=5||(o.length0?(s=r.slice(0,16),o=r.slice(16),n.record(60,t)):n.record(61,t),l()}))}else this._fs.readFile(e,{encoding:"utf8"},r)},t.prototype._verifyCachedData=function(e,t,n,r,i){var o=this;r&&(e.cachedDataRejected||setTimeout((function(){var e=o._crypto.createHash("md5").update(t,"utf8").digest();r.equals(e)||(i.getConfig().onError(new Error("FAILED TO VERIFY CACHED DATA, deleting stale '"+n+"' now, but a RESTART IS REQUIRED")),o._fs.unlink(n,(function(e){e&&i.getConfig().onError(e)})))}),Math.ceil(5e3*(1+Math.random()))))},t._BOM=65279,t._PREFIX="(function (require, define, __filename, __dirname) { ",t._SUFFIX="\n});",t}();e.createScriptLoader=function(e){return new t(e)} +}(t||(t={})),function(e){var t=function(){function t(e){var t=e.lastIndexOf("/");this.fromModulePath=-1!==t?e.substr(0,t+1):""}return t._normalizeModuleId=function(e){var t,n=e;for(t=/\/\.\//;t.test(n);)n=n.replace(t,"/");for(n=n.replace(/^\.\//g,""),t=/\/(([^\/])|([^\/][^\/\.])|([^\/\.][^\/])|([^\/][^\/][^\/]+))\/\.\.\//;t.test(n);)n=n.replace(t,"/");return n=n.replace(/^(([^\/])|([^\/][^\/\.])|([^\/\.][^\/])|([^\/][^\/][^\/]+))\/\.\.\//,"")},t.prototype.resolveModule=function(n){var r=n;return e.Utilities.isAbsolutePath(r)||(e.Utilities.startsWith(r,"./")||e.Utilities.startsWith(r,"../"))&&(r=t._normalizeModuleId(this.fromModulePath+r)),r},t.ROOT=new t(""),t}();e.ModuleIdResolver=t;var n=function(){function t(e,t,n,r,i,o){this.id=e,this.strId=t,this.dependencies=n,this._callback=r,this._errorback=i,this.moduleIdResolver=o,this.exports={},this.error=null,this.exportsPassedIn=!1,this.unresolvedDependenciesCount=this.dependencies.length,this._isComplete=!1}return t._safeInvokeFunction=function(t,n){try{return{ +returnedValue:t.apply(e.global,n),producedError:null}}catch(e){return{returnedValue:null,producedError:e}}},t._invokeFactory=function(t,n,r,i){return t.isBuild()&&!e.Utilities.isAnonymousModule(n)?{returnedValue:null,producedError:null}:t.shouldCatchError()?this._safeInvokeFunction(r,i):{returnedValue:r.apply(e.global,i),producedError:null}},t.prototype.complete=function(n,r,i){this._isComplete=!0;var o=null;if(this._callback)if("function"==typeof this._callback){n.record(21,this.strId);var s=t._invokeFactory(r,this.strId,this._callback,i);o=s.producedError,n.record(22,this.strId),o||void 0===s.returnedValue||this.exportsPassedIn&&!e.Utilities.isEmpty(this.exports)||(this.exports=s.returnedValue)}else this.exports=this._callback;if(o){var a=e.ensureError(o);a.phase="factory",a.moduleId=this.strId,this.error=a,r.onError(a)}this.dependencies=null,this._callback=null,this._errorback=null,this.moduleIdResolver=null},t.prototype.onDependencyError=function(e){return this._isComplete=!0,this.error=e, +!!this._errorback&&(this._errorback(e),!0)},t.prototype.isComplete=function(){return this._isComplete},t}();e.Module=n;var r=function(){function e(){this._nextId=0,this._strModuleIdToIntModuleId=new Map,this._intModuleIdToStrModuleId=[],this.getModuleId("exports"),this.getModuleId("module"),this.getModuleId("require")}return e.prototype.getMaxModuleId=function(){return this._nextId},e.prototype.getModuleId=function(e){var t=this._strModuleIdToIntModuleId.get(e);return void 0===t&&(t=this._nextId++,this._strModuleIdToIntModuleId.set(e,t),this._intModuleIdToStrModuleId[t]=e),t},e.prototype.getStrModuleId=function(e){return this._intModuleIdToStrModuleId[e]},e}(),i=function(){function e(e){this.id=e}return e.EXPORTS=new e(0),e.MODULE=new e(1),e.REQUIRE=new e(2),e}();e.RegularDependency=i;var o=function(e,t,n){this.id=e,this.pluginId=t,this.pluginParam=n};e.PluginDependency=o;var s=function(){function s(t,n,i,o,s){void 0===s&&(s=0),this._env=t,this._scriptLoader=n,this._loaderAvailableTimestamp=s, +this._defineFunc=i,this._requireFunc=o,this._moduleIdProvider=new r,this._config=new e.Configuration(this._env),this._modules2=[],this._knownModules2=[],this._inverseDependencies2=[],this._inversePluginDependencies2=new Map,this._currentAnnonymousDefineCall=null,this._recorder=null,this._buildInfoPath=[],this._buildInfoDefineStack=[],this._buildInfoDependencies=[]}return s.prototype.reset=function(){return new s(this._env,this._scriptLoader,this._defineFunc,this._requireFunc,this._loaderAvailableTimestamp)},s.prototype.getGlobalAMDDefineFunc=function(){return this._defineFunc},s.prototype.getGlobalAMDRequireFunc=function(){return this._requireFunc},s._findRelevantLocationInStack=function(e,t){for(var n=function(e){return e.replace(/\\/g,"/")},r=n(e),i=t.split(/\n/),o=0;o=0){ +var r=t.resolveModule(e.substr(0,n)),s=t.resolveModule(e.substr(n+1)),a=this._moduleIdProvider.getModuleId(r+"!"+s),l=this._moduleIdProvider.getModuleId(r);return new o(a,l,s)}return new i(this._moduleIdProvider.getModuleId(t.resolveModule(e)))},s.prototype._normalizeDependencies=function(e,t){for(var n=[],r=0,i=0,o=e.length;i0;){var u=l.shift(),c=this._modules2[u];c&&(a=c.onDependencyError(r)||a);var d=this._inverseDependencies2[u];if(d)for(o=0,s=d.length;o0;){var a=s.shift().dependencies;if(a)for(i=0,o=a.length;i=r.length)t._onLoadError(e,n);else{var s=r[i],a=t.getRecorder();if(t._config.isBuild()&&"empty:"===s)return t._buildInfoPath[e]=s,t.defineModule(t._moduleIdProvider.getStrModuleId(e),[],null,null,null),void t._onLoad(e);a.record(10,s),t._scriptLoader.load(t,s,(function(){t._config.isBuild()&&(t._buildInfoPath[e]=s),a.record(11,s),t._onLoad(e)}),(function(e){a.record(12,s),o(e)}))}};o(null)}}, +s.prototype._loadPluginDependency=function(e,n){var r=this;if(!this._modules2[n.id]&&!this._knownModules2[n.id]){this._knownModules2[n.id]=!0;var i=function(e){r.defineModule(r._moduleIdProvider.getStrModuleId(n.id),[],e,null,null)};i.error=function(e){r._config.onError(r._createLoadError(n.id,e))},e.load(n.pluginParam,this._createRequire(t.ROOT),i,this._config.getOptionsLiteral())}},s.prototype._resolve=function(e){var t=this,n=e.dependencies;if(n)for(var r=0,s=n.length;r \n")),e.unresolvedDependenciesCount--}else if(this._inverseDependencies2[a.id]=this._inverseDependencies2[a.id]||[],this._inverseDependencies2[a.id].push(e.id),a instanceof o){var c=this._modules2[a.pluginId];if(c&&c.isComplete()){this._loadPluginDependency(c.exports,a);continue}var d=this._inversePluginDependencies2.get(a.pluginId);d||(d=[],this._inversePluginDependencies2.set(a.pluginId,d)),d.push(a),this._loadModule(a.pluginId)}else this._loadModule(a.id)}else e.unresolvedDependenciesCount--;else e.unresolvedDependenciesCount--;else e.exportsPassedIn=!0,e.unresolvedDependenciesCount--}0===e.unresolvedDependenciesCount&&this._onModuleComplete(e)},s.prototype._onModuleComplete=function(e){var t=this,n=this.getRecorder();if(!e.isComplete()){var r=e.dependencies,o=[];if(r)for(var s=0,a=r.length;sr?e[l]=o[a++]:a>i?e[l]=o[s++]:t(o[a],o[s])<0?e[l]=o[a++]:e[l]=o[s++]}(t,n,r,s,i,o)}(e,t,0,e.length-1,[]),e}function r(e,t){for(let n=0;ne===t)){if(e===t)return!0;if(!e||!t)return!1;if(e.length!==t.length)return!1;for(let r=0,i=e.length;r0))return o;i=o-1}}return-(r+1)},t.findFirstInSorted=function(e,t){let n=0,r=e.length;if(0===r)return 0;for(;n!!e)},t.isFalsyOrEmpty=function(e){return!Array.isArray(e)||0===e.length},t.isNonEmptyArray=function(e){return Array.isArray(e)&&e.length>0},t.distinct=function(e,t){if(!t)return e.filter((t,n)=>e.indexOf(t)===n);const n=Object.create(null);return e.filter(e=>{const r=t(e);return!n[r]&&(n[r]=!0,!0)})},t.distinctES6=function(e){const t=new Set;return e.filter(e=>!t.has(e)&&(t.add(e),!0))},t.firstIndex=r,t.first=function(e,t,n){const i=r(e,t);return i<0?n:e[i]},t.firstOrDefault=function(e,t){return e.length>0?e[0]:t},t.flatten=function(e){return[].concat(...e)},t.range=function(e,t){let n="number"==typeof t?e:0;"number"==typeof t?n=e:(n=0,t=e);const r=[];if(n<=t)for(let e=n;et;e--)r.push(e);return r},t.arrayInsert=function(e,t,n){const r=e.slice(0,t),i=e.slice(t);return r.concat(n,i)},t.pushToStart=function(e,t){const n=e.indexOf(t) +;n>-1&&(e.splice(n,1),e.unshift(t))},t.pushToEnd=function(e,t){const n=e.indexOf(t);n>-1&&(e.splice(n,1),e.push(t))},t.asArray=function(e){return Array.isArray(e)?e:[e]}})),e(n[14],r([0,1]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DiffChange=void 0;t.DiffChange=class{constructor(e,t,n,r){this.originalStart=e,this.originalLength=t,this.modifiedStart=n,this.modifiedLength=r}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}})),e(n[4],r([0,1]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.illegalState=t.illegalArgument=t.canceled=t.isPromiseCanceledError=t.transformErrorForSerialization=t.onUnexpectedExternalError=t.onUnexpectedError=t.errorHandler=t.ErrorHandler=void 0;class n{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{if(e.stack)throw new Error(e.message+"\n\n"+e.stack);throw e},0)}}emit(e){this.listeners.forEach(t=>{ +t(e)})}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}}t.ErrorHandler=n,t.errorHandler=new n,t.onUnexpectedError=function(e){i(e)||t.errorHandler.onUnexpectedError(e)},t.onUnexpectedExternalError=function(e){i(e)||t.errorHandler.onUnexpectedExternalError(e)},t.transformErrorForSerialization=function(e){if(e instanceof Error){let{name:t,message:n}=e;return{$isError:!0,name:t,message:n,stack:e.stacktrace||e.stack}}return e};const r="Canceled";function i(e){return e instanceof Error&&e.name===r&&e.message===r}t.isPromiseCanceledError=i,t.canceled=function(){const e=new Error(r);return e.name=e.message,e},t.illegalArgument=function(e){return e?new Error(`Illegal argument: ${e}`):new Error("Illegal argument")},t.illegalState=function(e){return e?new Error(`Illegal state: ${e}`):new Error("Illegal state")}})),e(n[15],r([0,1]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Iterable=void 0,function(e){ +e.is=function(e){return e&&"object"==typeof e&&"function"==typeof e[Symbol.iterator]};const t=Object.freeze([]);e.empty=function(){return t},e.single=function*(e){yield e},e.from=function(e){return e||t},e.first=function(e){return e[Symbol.iterator]().next().value},e.some=function(e,t){for(const n of e)if(t(n))return!0;return!1},e.filter=function*(e,t){for(const n of e)t(n)&&(yield n)},e.map=function*(e,t){for(const n of e)yield t(n)},e.concat=function*(...e){for(const t of e)for(const e of t)yield e},e.consume=function(t,n=Number.POSITIVE_INFINITY){const r=[];if(0===n)return[r,t];const i=t[Symbol.iterator]();for(let t=0;ti}]}}(t.Iterable||(t.Iterable={}))})),e(n[16],r([0,1,4]),(function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}), +t.ResolvedKeybinding=t.ResolvedKeybindingPart=t.ChordKeybinding=t.SimpleKeybinding=t.createSimpleKeybinding=t.createKeybinding=t.KeyChord=t.KeyCodeUtils=void 0;class r{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}}const i=new r,o=new r,s=new r;function a(e,t){const n=!!(2048&e),r=!!(256&e);return new l(2===t?r:n,!!(1024&e),!!(512&e),2===t?n:r,255&e)}!function(){function e(e,t,n=t,r=n){i.define(e,t),o.define(e,n),s.define(e,r)}e(0,"unknown"),e(1,"Backspace"),e(2,"Tab"),e(3,"Enter"),e(4,"Shift"),e(5,"Ctrl"),e(6,"Alt"),e(7,"PauseBreak"),e(8,"CapsLock"),e(9,"Escape"),e(10,"Space"),e(11,"PageUp"),e(12,"PageDown"),e(13,"End"),e(14,"Home"),e(15,"LeftArrow","Left"),e(16,"UpArrow","Up"),e(17,"RightArrow","Right"),e(18,"DownArrow","Down"),e(19,"Insert"),e(20,"Delete"),e(21,"0"),e(22,"1"),e(23,"2"),e(24,"3"), +e(25,"4"),e(26,"5"),e(27,"6"),e(28,"7"),e(29,"8"),e(30,"9"),e(31,"A"),e(32,"B"),e(33,"C"),e(34,"D"),e(35,"E"),e(36,"F"),e(37,"G"),e(38,"H"),e(39,"I"),e(40,"J"),e(41,"K"),e(42,"L"),e(43,"M"),e(44,"N"),e(45,"O"),e(46,"P"),e(47,"Q"),e(48,"R"),e(49,"S"),e(50,"T"),e(51,"U"),e(52,"V"),e(53,"W"),e(54,"X"),e(55,"Y"),e(56,"Z"),e(57,"Meta"),e(58,"ContextMenu"),e(59,"F1"),e(60,"F2"),e(61,"F3"),e(62,"F4"),e(63,"F5"),e(64,"F6"),e(65,"F7"),e(66,"F8"),e(67,"F9"),e(68,"F10"),e(69,"F11"),e(70,"F12"),e(71,"F13"),e(72,"F14"),e(73,"F15"),e(74,"F16"),e(75,"F17"),e(76,"F18"),e(77,"F19"),e(78,"NumLock"),e(79,"ScrollLock"),e(80,";",";","OEM_1"),e(81,"=","=","OEM_PLUS"),e(82,",",",","OEM_COMMA"),e(83,"-","-","OEM_MINUS"),e(84,".",".","OEM_PERIOD"),e(85,"/","/","OEM_2"),e(86,"`","`","OEM_3"),e(110,"ABNT_C1"),e(111,"ABNT_C2"),e(87,"[","[","OEM_4"),e(88,"\\","\\","OEM_5"),e(89,"]","]","OEM_6"),e(90,"'","'","OEM_7"),e(91,"OEM_8"),e(92,"OEM_102"),e(93,"NumPad0"),e(94,"NumPad1"),e(95,"NumPad2"),e(96,"NumPad3"),e(97,"NumPad4"), +e(98,"NumPad5"),e(99,"NumPad6"),e(100,"NumPad7"),e(101,"NumPad8"),e(102,"NumPad9"),e(103,"NumPad_Multiply"),e(104,"NumPad_Add"),e(105,"NumPad_Separator"),e(106,"NumPad_Subtract"),e(107,"NumPad_Decimal"),e(108,"NumPad_Divide")}(),function(e){e.toString=function(e){return i.keyCodeToStr(e)},e.fromString=function(e){return i.strToKeyCode(e)},e.toUserSettingsUS=function(e){return o.keyCodeToStr(e)},e.toUserSettingsGeneral=function(e){return s.keyCodeToStr(e)},e.fromUserSettings=function(e){return o.strToKeyCode(e)||s.strToKeyCode(e)}}(t.KeyCodeUtils||(t.KeyCodeUtils={})),t.KeyChord=function(e,t){return(e|(65535&t)<<16>>>0)>>>0},t.createKeybinding=function(e,t){if(0===e)return null;const n=(65535&e)>>>0,r=(4294901760&e)>>>16;return new u(0!==r?[a(n,t),a(r,t)]:[a(n,t)])},t.createSimpleKeybinding=a;class l{constructor(e,t,n,r,i){this.ctrlKey=e,this.shiftKey=t,this.altKey=n,this.metaKey=r,this.keyCode=i}equals(e){ +return this.ctrlKey===e.ctrlKey&&this.shiftKey===e.shiftKey&&this.altKey===e.altKey&&this.metaKey===e.metaKey&&this.keyCode===e.keyCode}isModifierKey(){return 0===this.keyCode||5===this.keyCode||57===this.keyCode||6===this.keyCode||4===this.keyCode}toChord(){return new u([this])}isDuplicateModifierCase(){return this.ctrlKey&&5===this.keyCode||this.shiftKey&&4===this.keyCode||this.altKey&&6===this.keyCode||this.metaKey&&57===this.keyCode}}t.SimpleKeybinding=l;class u{constructor(e){if(0===e.length)throw n.illegalArgument("parts");this.parts=e}}t.ChordKeybinding=u;t.ResolvedKeybindingPart=class{constructor(e,t,n,r,i,o){this.ctrlKey=e,this.shiftKey=t,this.altKey=n,this.metaKey=r,this.keyLabel=i,this.keyAriaLabel=o}};t.ResolvedKeybinding=class{}})),e(n[6],r([0,1,15]),(function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ImmortalReference=t.MutableDisposable=t.Disposable=t.DisposableStore=t.toDisposable=t.combinedDisposable=t.dispose=t.isDisposable=t.MultiDisposeError=void 0 +;const r=!1,i="__is_disposable_tracked__";function o(e){if(r&&e&&e!==c.None)try{e[i]=!0}catch(e){}}function s(e){if(!r)return e;const t=new Error("Potentially leaked disposable").stack;return setTimeout(()=>{e[i]||console.log(t)},3e3),e}class a extends Error{constructor(e){super(`Encounter errors while disposing of store. Errors: [${e.join(", ")}]`),this.errors=e}}function l(e){if(n.Iterable.is(e)){let t=[];for(const n of e)if(n){o(n);try{n.dispose()}catch(e){t.push(e)}}if(1===t.length)throw t[0];if(t.length>1)throw new a(t);return Array.isArray(e)?[]:e}if(e)return o(e),e.dispose(),e}t.MultiDisposeError=a,t.isDisposable=function(e){return"function"==typeof e.dispose&&0===e.dispose.length},t.dispose=l,t.combinedDisposable=function(...e){return e.forEach(o),s({dispose:()=>l(e)})},t.toDisposable=function(e){const t=s({dispose:()=>{o(t),e()}});return t};class u{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(o(this),this._isDisposed=!0,this.clear())}clear(){try{ +l(this._toDispose.values())}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return o(e),this._isDisposed?u.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}}t.DisposableStore=u,u.DISABLE_DISPOSED_WARNING=!1;class c{constructor(){this._store=new u,s(this)}dispose(){o(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}}t.Disposable=c,c.None=Object.freeze({dispose(){}});t.MutableDisposable=class{constructor(){this._isDisposed=!1,s(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value&&this._value.dispose(),e&&o(e),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,o(this),this._value&&this._value.dispose(), +this._value=void 0}};t.ImmortalReference=class{constructor(e){this.object=e}dispose(){}}})),e(n[17],r([0,1]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LinkedList=void 0;class n{constructor(e){this.element=e,this.next=n.Undefined,this.prev=n.Undefined}}n.Undefined=new n(void 0);t.LinkedList=class{constructor(){this._first=n.Undefined,this._last=n.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===n.Undefined}clear(){this._first=n.Undefined,this._last=n.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const r=new n(e);if(this._first===n.Undefined)this._first=r,this._last=r;else if(t){const e=this._last;this._last=r,r.prev=e,e.next=r}else{const e=this._first;this._first=r,r.next=e,e.prev=r}this._size+=1;let i=!1;return()=>{i||(i=!0,this._remove(r))}}shift(){if(this._first!==n.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==n.Undefined){ +const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==n.Undefined&&e.next!==n.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===n.Undefined&&e.next===n.Undefined?(this._first=n.Undefined,this._last=n.Undefined):e.next===n.Undefined?(this._last=this._last.prev,this._last.next=n.Undefined):e.prev===n.Undefined&&(this._first=this._first.next,this._first.prev=n.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==n.Undefined;)yield e.element,e=e.next}toArray(){const e=[];for(let t=this._first;t!==n.Undefined;t=t.next)e.push(t.element);return e}}})),e(n[7],r([0,1,4,6,17]),(function(e,t,n,r,i){"use strict";var o;Object.defineProperty(t,"__esModule",{value:!0}),t.Relay=t.EventBufferer=t.PauseableEmitter=t.Emitter=t.Event=void 0,function(e){function t(e){return(t,n=null,r)=>{let i,o=!1;return i=e(e=>{if(!o)return i?i.dispose():o=!0,t.call(n,e)},null,r),o&&i.dispose(),i}}function n(e,t){return a((n,r=null,i)=>e(e=>n.call(r,t(e)),null,i))} +function i(e,t){return a((n,r=null,i)=>e(e=>{t(e),n.call(r,e)},null,i))}function o(e,t){return a((n,r=null,i)=>e(e=>t(e)&&n.call(r,e),null,i))}function s(e,t,r){let i=r;return n(e,e=>i=t(i,e))}function a(e){let t;const n=new l({onFirstListenerAdd(){t=e(n.fire,n)},onLastListenerRemove(){t.dispose()}});return n.event}function u(e,t,n=100,r=!1,i){let o,s=void 0,a=void 0,u=0;const c=new l({leakWarningThreshold:i,onFirstListenerAdd(){o=e(e=>{u++,s=t(s,e),r&&!a&&(c.fire(s),s=void 0),clearTimeout(a),a=setTimeout(()=>{const e=s;s=void 0,a=void 0,(!r||u>1)&&c.fire(e),u=0},n)})},onLastListenerRemove(){o.dispose()}});return c.event}function c(e){let t,n=!0;return o(e,e=>{const r=n||e!==t;return n=!1,t=e,r})}e.None=()=>r.Disposable.None,e.once=t,e.map=n,e.forEach=i,e.filter=o,e.signal=function(e){return e},e.any=function(...e){return(t,n=null,i)=>r.combinedDisposable(...e.map(e=>e(e=>t.call(n,e),null,i)))},e.reduce=s,e.snapshot=a,e.debounce=u,e.stopwatch=function(e){const r=(new Date).getTime() +;return n(t(e),e=>(new Date).getTime()-r)},e.latch=c,e.buffer=function(e,t=!1,n=[]){let r=n.slice(),i=e(e=>{r?r.push(e):s.fire(e)});const o=()=>{r&&r.forEach(e=>s.fire(e)),r=null},s=new l({onFirstListenerAdd(){i||(i=e(e=>s.fire(e)))},onFirstListenerDidAdd(){r&&(t?setTimeout(o):o())},onLastListenerRemove(){i&&i.dispose(),i=null}});return s.event};class d{constructor(e){this.event=e}map(e){return new d(n(this.event,e))}forEach(e){return new d(i(this.event,e))}filter(e){return new d(o(this.event,e))}reduce(e,t){return new d(s(this.event,e,t))}latch(){return new d(c(this.event))}debounce(e,t=100,n=!1,r){return new d(u(this.event,e,t,n,r))}on(e,t,n){return this.event(e,t,n)}once(e,n,r){return t(this.event)(e,n,r)}}e.chain=function(e){return new d(e)},e.fromNodeEventEmitter=function(e,t,n=(e=>e)){const r=(...e)=>i.fire(n(...e)),i=new l({onFirstListenerAdd:()=>e.on(t,r),onLastListenerRemove:()=>e.removeListener(t,r)});return i.event},e.fromDOMEventEmitter=function(e,t,n=(e=>e)){ +const r=(...e)=>i.fire(n(...e)),i=new l({onFirstListenerAdd:()=>e.addEventListener(t,r),onLastListenerRemove:()=>e.removeEventListener(t,r)});return i.event},e.fromPromise=function(e){const t=new l;let n=!1;return e.then(void 0,()=>null).then(()=>{n?t.fire(void 0):setTimeout(()=>t.fire(void 0),0)}),n=!0,t.event},e.toPromise=function(e){return new Promise(n=>t(e)(n))}}(o=t.Event||(t.Event={}));let s=-1;class a{constructor(e,t=Math.random().toString(18).slice(2,5)){this.customThreshold=e,this.name=t,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(e){let t=s;if("number"==typeof this.customThreshold&&(t=this.customThreshold),t<=0||e{const e=this._stacks.get(n)||0;this._stacks.set(n,e-1)}}}class l{constructor(e){this._disposed=!1,this._options=e,this._leakageMon=s>0?new a(this._options&&this._options.leakWarningThreshold):void 0}get event(){return this._event||(this._event=(e,t,n)=>{this._listeners||(this._listeners=new i.LinkedList);const o=this._listeners.isEmpty();o&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const s=this._listeners.push(t?[e,t]:e);let a,u;return o&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,e,t),this._leakageMon&&(a=this._leakageMon.check(this._listeners.size)),u={dispose:()=>{if(a&&a(),u.dispose=l._noop,!this._disposed&&(s(),this._options&&this._options.onLastListenerRemove)){ +this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)}}},n instanceof r.DisposableStore?n.add(u):Array.isArray(n)&&n.push(u),u}),this._event}fire(e){if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new i.LinkedList);for(let t of this._listeners)this._deliveryQueue.push([t,e]);for(;this._deliveryQueue.size>0;){const[e,t]=this._deliveryQueue.shift();try{"function"==typeof e?e.call(void 0,t):e[0].call(e[1],t)}catch(e){n.onUnexpectedError(e)}}}}dispose(){this._listeners&&this._listeners.clear(),this._deliveryQueue&&this._deliveryQueue.clear(),this._leakageMon&&this._leakageMon.dispose(),this._disposed=!0}}t.Emitter=l,l._noop=function(){};t.PauseableEmitter=class extends l{constructor(e){super(e),this._isPaused=0,this._eventQueue=new i.LinkedList,this._mergeFn=e&&e.merge}pause(){this._isPaused++}resume(){if(0!==this._isPaused&&0==--this._isPaused)if(this._mergeFn){const e=this._eventQueue.toArray();this._eventQueue.clear(),super.fire(this._mergeFn(e)) +}else for(;!this._isPaused&&0!==this._eventQueue.size;)super.fire(this._eventQueue.shift())}fire(e){this._listeners&&(0!==this._isPaused?this._eventQueue.push(e):super.fire(e))}};t.EventBufferer=class{constructor(){this.buffers=[]}wrapEvent(e){return(t,n,r)=>e(e=>{const r=this.buffers[this.buffers.length-1];r?r.push(()=>t.call(n,e)):t.call(n,e)},void 0,r)}bufferEvents(e){const t=[];this.buffers.push(t);const n=e();return this.buffers.pop(),t.forEach(e=>e()),n}};t.Relay=class{constructor(){this.listening=!1,this.inputEvent=o.None,this.inputEventListener=r.Disposable.None,this.emitter=new l({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(), +this.emitter.dispose()}}})),e(n[18],r([0,1,7]),(function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationTokenSource=t.CancellationToken=void 0;const r=Object.freeze((function(e,t){const n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}));var i;!function(e){e.isCancellationToken=function(t){return t===e.None||t===e.Cancelled||(t instanceof o||!(!t||"object"!=typeof t)&&("boolean"==typeof t.isCancellationRequested&&"function"==typeof t.onCancellationRequested))},e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:n.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:r})}(i=t.CancellationToken||(t.CancellationToken={}));class o{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){ +return this._isCancelled?r:(this._emitter||(this._emitter=new n.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}t.CancellationTokenSource=class{constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new o),this._token}cancel(){this._token?this._token instanceof o&&this._token.cancel():this._token=i.Cancelled}dispose(e=!1){e&&this.cancel(),this._parentListener&&this._parentListener.dispose(),this._token?this._token instanceof o&&this._token.dispose():this._token=i.None}}})),e(n[3],r([0,1]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isLittleEndian=t.OS=t.setImmediate=t.globals=t.isIOS=t.isWeb=t.isNative=t.isLinux=t.isMacintosh=t.isWindows=void 0;let n=!1,r=!1,i=!1,o=!1,s=!1,a=!1,l=void 0,u="en",c=void 0,d=void 0 +;const h="undefined"!=typeof process&&void 0!==process.versions&&void 0!==process.versions.electron&&"renderer"===process.type;if("object"!=typeof navigator||h){if("object"==typeof process){n="win32"===process.platform,r="darwin"===process.platform,i="linux"===process.platform,l="en",u="en";const e=process.env.VSCODE_NLS_CONFIG;if(e)try{const t=JSON.parse(e),n=t.availableLanguages["*"];l=t.locale,u=n||"en",c=t._translationsConfigFile}catch(e){}o=!0}}else n=(d=navigator.userAgent).indexOf("Windows")>=0,r=d.indexOf("Macintosh")>=0,a=(d.indexOf("Macintosh")>=0||d.indexOf("iPad")>=0||d.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,i=d.indexOf("Linux")>=0,s=!0,u=l=navigator.language;let f=0;r?f=1:n?f=3:i&&(f=2),t.isWindows=n,t.isMacintosh=r,t.isLinux=i,t.isNative=o,t.isWeb=s,t.isIOS=a;const g="object"==typeof self?self:"object"==typeof global?global:{};t.globals=g,t.setImmediate=function(){if(t.globals.setImmediate)return t.globals.setImmediate.bind(t.globals) +;if("function"==typeof t.globals.postMessage&&!t.globals.importScripts){let e=[];t.globals.addEventListener("message",t=>{if(t.data&&t.data.vscodeSetImmediateId)for(let n=0,r=e.length;n{const i=++n;e.push({id:i,callback:r}),t.globals.postMessage({vscodeSetImmediateId:i},"*")}}if("undefined"!=typeof process&&"function"==typeof process.nextTick)return process.nextTick.bind(process);const e=Promise.resolve();return t=>e.then(t)}(),t.OS=r||a?2:n?1:3;let m=!0,p=!1;t.isLittleEndian=function(){if(!p){p=!0;const e=new Uint8Array(2);e[0]=1,e[1]=2;const t=new Uint16Array(e.buffer);m=513===t[0]}return m}})),e(n[19],r([0,1,3]),(function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.platform=t.env=t.cwd=void 0;const r="undefined"==typeof process?{cwd:()=>"/",env:Object.create(null),get platform(){return n.isWindows?"win32":n.isMacintosh?"darwin":"linux"}, +nextTick:e=>n.setImmediate(e)}:process;t.cwd=r.cwd,t.env=r.env,t.platform=r.platform})),e(n[20],r([0,1,19]),(function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sep=t.extname=t.basename=t.dirname=t.relative=t.resolve=t.normalize=t.posix=t.win32=void 0;const r=65,i=97,o=90,s=122,a=46,l=47,u=92;class c extends Error{constructor(e,t,n){let r;"string"==typeof t&&0===t.indexOf("not ")?(r="must not be",t=t.replace(/^not /,"")):r="must be";const i=-1!==e.indexOf(".")?"property":"argument";let o=`The "${e}" ${i} ${r} of type ${t}`;super(o+=`. Received type ${typeof n}`),this.code="ERR_INVALID_ARG_TYPE"}}function d(e,t){if("string"!=typeof e)throw new c(t,"string",e)}function h(e){return e===l||e===u}function f(e){return e===l}function g(e){return e>=r&&e<=o||e>=i&&e<=s}function m(e,t,n,r){let i="",o=0,s=-1,u=0,c=0;for(let d=0;d<=e.length;++d){if(d2){const e=i.lastIndexOf(n);-1===e?(i="",o=0):o=(i=i.slice(0,e)).length-1-i.lastIndexOf(n),s=d,u=0;continue}if(0!==i.length){i="",o=0,s=d,u=0;continue}}t&&(i+=i.length>0?`${n}..`:"..",o=2)}else i.length>0?i+=`${n}${e.slice(s+1,d)}`:i=e.slice(s+1,d),o=d-s-1;s=d,u=0}else c===a&&-1!==u?++u:u=-1}return i}function p(e,t){if(null===t||"object"!=typeof t)throw new c("pathObject","Object",t);const n=t.dir||t.root,r=t.base||`${t.name||""}${t.ext||""}`;return n?n===t.root?`${n}${r}`:`${n}${e}${r}`:r}t.win32={resolve(...e){let t="",r="",i=!1;for(let o=e.length-1;o>=-1;o--){let s;if(o>=0){if(d(s=e[o],"path"),0===s.length)continue}else 0===t.length?s=n.cwd():(void 0===(s=n.env[`=${t}`]||n.cwd())||s.slice(0,2).toLowerCase()!==t.toLowerCase()&&s.charCodeAt(2)===u)&&(s=`${t}\\`);const a=s.length;let l=0,c="",f=!1;const m=s.charCodeAt(0);if(1===a)h(m)&&(l=1,f=!0);else if(h(m))if(f=!0,h(s.charCodeAt(1))){let e=2,t=e +;for(;e2&&h(s.charCodeAt(2))&&(f=!0,l=3));if(c.length>0)if(t.length>0){if(c.toLowerCase()!==t.toLowerCase())continue}else t=c;if(i){if(t.length>0)break}else if(r=`${s.slice(l)}\\${r}`,i=f,f&&t.length>0)break}return r=m(r,!i,"\\",h),i?`${t}\\${r}`:`${t}${r}`||"."},normalize(e){d(e,"path");const t=e.length;if(0===t)return".";let n,r=0,i=!1;const o=e.charCodeAt(0);if(1===t)return f(o)?"\\":e;if(h(o))if(i=!0,h(e.charCodeAt(1))){let i=2,o=i;for(;i2&&h(e.charCodeAt(2))&&(i=!0,r=3));let s=r0&&h(e.charCodeAt(t-1))&&(s+="\\"),void 0===n?i?`\\${s}`:s:i?`${n}\\${s}`:`${n}${s}`},isAbsolute(e){d(e,"path");const t=e.length;if(0===t)return!1;const n=e.charCodeAt(0);return h(n)||t>2&&g(n)&&58===e.charCodeAt(1)&&h(e.charCodeAt(2))},join(...e){if(0===e.length)return".";let n,r;for(let t=0;t0&&(void 0===n?n=r=i:n+=`\\${i}`)}if(void 0===n)return".";let i=!0,o=0;if("string"==typeof r&&h(r.charCodeAt(0))){++o;const e=r.length;e>1&&h(r.charCodeAt(1))&&(++o,e>2&&(h(r.charCodeAt(2))?++o:i=!1))}if(i){for(;o=2&&(n=`\\${n.slice(o)}`)}return t.win32.normalize(n)},relative(e,n){if(d(e,"from"),d(n,"to"),e===n)return"";const r=t.win32.resolve(e),i=t.win32.resolve(n);if(r===i)return"";if((e=r.toLowerCase())===(n=i.toLowerCase()))return"";let o=0;for(;oo&&e.charCodeAt(s-1)===u;)s--;const a=s-o;let l=0;for(;ll&&n.charCodeAt(c-1)===u;)c--;const h=c-l,f=af){if(n.charCodeAt(l+m)===u)return i.slice(l+m+1);if(2===m)return i.slice(l+m)}a>f&&(e.charCodeAt(o+m)===u?g=m:2===m&&(g=3)),-1===g&&(g=0)}let p="";for(m=o+g+1;m<=s;++m)m!==s&&e.charCodeAt(m)!==u||(p+=0===p.length?"..":"\\..");return l+=g,p.length>0?`${p}${i.slice(l,c)}`:(i.charCodeAt(l)===u&&++l,i.slice(l,c))},toNamespacedPath(e){if("string"!=typeof e)return e;if(0===e.length)return"";const n=t.win32.resolve(e);if(n.length<=2)return e;if(n.charCodeAt(0)===u){if(n.charCodeAt(1)===u){const e=n.charCodeAt(2);if(63!==e&&e!==a)return`\\\\?\\UNC\\${n.slice(2)}`}}else if(g(n.charCodeAt(0))&&58===n.charCodeAt(1)&&n.charCodeAt(2)===u)return`\\\\?\\${n}`;return e},dirname(e){d(e,"path");const t=e.length +;if(0===t)return".";let n=-1,r=0;const i=e.charCodeAt(0);if(1===t)return h(i)?e:".";if(h(i)){if(n=r=1,h(e.charCodeAt(1))){let i=2,o=i;for(;i2&&h(e.charCodeAt(2))?3:2);let o=-1,s=!0;for(let n=t-1;n>=r;--n)if(h(e.charCodeAt(n))){if(!s){o=n;break}}else s=!1;if(-1===o){if(-1===n)return".";o=n}return e.slice(0,o)},basename(e,t){void 0!==t&&d(t,"ext"),d(e,"path");let n,r=0,i=-1,o=!0;if(e.length>=2&&g(e.charCodeAt(0))&&58===e.charCodeAt(1)&&(r=2),void 0!==t&&t.length>0&&t.length<=e.length){if(t===e)return"";let s=t.length-1,a=-1;for(n=e.length-1;n>=r;--n){const l=e.charCodeAt(n);if(h(l)){if(!o){r=n+1;break}}else-1===a&&(o=!1,a=n+1),s>=0&&(l===t.charCodeAt(s)?-1==--s&&(i=n):(s=-1,i=a))}return r===i?i=a:-1===i&&(i=e.length),e.slice(r,i)}for(n=e.length-1;n>=r;--n)if(h(e.charCodeAt(n))){if(!o){r=n+1;break} +}else-1===i&&(o=!1,i=n+1);return-1===i?"":e.slice(r,i)},extname(e){d(e,"path");let t=0,n=-1,r=0,i=-1,o=!0,s=0;e.length>=2&&58===e.charCodeAt(1)&&g(e.charCodeAt(0))&&(t=r=2);for(let l=e.length-1;l>=t;--l){const t=e.charCodeAt(l);if(h(t)){if(!o){r=l+1;break}}else-1===i&&(o=!1,i=l+1),t===a?-1===n?n=l:1!==s&&(s=1):-1!==n&&(s=-1)}return-1===n||-1===i||0===s||1===s&&n===i-1&&n===r+1?"":e.slice(n,i)},format:p.bind(null,"\\"),parse(e){d(e,"path");const t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;const n=e.length;let r=0,i=e.charCodeAt(0);if(1===n)return h(i)?(t.root=t.dir=e,t):(t.base=t.name=e,t);if(h(i)){if(r=1,h(e.charCodeAt(1))){let t=2,i=t;for(;t0&&(t.root=e.slice(0,r)) +;let o=-1,s=r,l=-1,u=!0,c=e.length-1,f=0;for(;c>=r;--c)if(h(i=e.charCodeAt(c))){if(!u){s=c+1;break}}else-1===l&&(u=!1,l=c+1),i===a?-1===o?o=c:1!==f&&(f=1):-1!==o&&(f=-1);return-1!==l&&(-1===o||0===f||1===f&&o===l-1&&o===s+1?t.base=t.name=e.slice(s,l):(t.name=e.slice(s,o),t.base=e.slice(s,l),t.ext=e.slice(o,l))),t.dir=s>0&&s!==r?e.slice(0,s-1):t.root,t},sep:"\\",delimiter:";",win32:null,posix:null},t.posix={resolve(...e){let t="",r=!1;for(let i=e.length-1;i>=-1&&!r;i--){const o=i>=0?e[i]:n.cwd();d(o,"path"),0!==o.length&&(t=`${o}/${t}`,r=o.charCodeAt(0)===l)}return t=m(t,!r,"/",f),r?`/${t}`:t.length>0?t:"."},normalize(e){if(d(e,"path"),0===e.length)return".";const t=e.charCodeAt(0)===l,n=e.charCodeAt(e.length-1)===l;return 0===(e=m(e,!t,"/",f)).length?t?"/":n?"./":".":(n&&(e+="/"),t?`/${e}`:e)},isAbsolute:e=>(d(e,"path"),e.length>0&&e.charCodeAt(0)===l),join(...e){if(0===e.length)return".";let n;for(let t=0;t0&&(void 0===n?n=r:n+=`/${r}`)} +return void 0===n?".":t.posix.normalize(n)},relative(e,n){if(d(e,"from"),d(n,"to"),e===n)return"";if((e=t.posix.resolve(e))===(n=t.posix.resolve(n)))return"";const r=e.length,i=r-1,o=n.length-1,s=is){if(n.charCodeAt(1+u)===l)return n.slice(1+u+1);if(0===u)return n.slice(1+u)}else i>s&&(e.charCodeAt(1+u)===l?a=u:0===u&&(a=0));let c="";for(u=1+a+1;u<=r;++u)u!==r&&e.charCodeAt(u)!==l||(c+=0===c.length?"..":"/..");return`${c}${n.slice(1+a)}`},toNamespacedPath:e=>e,dirname(e){if(d(e,"path"),0===e.length)return".";const t=e.charCodeAt(0)===l;let n=-1,r=!0;for(let t=e.length-1;t>=1;--t)if(e.charCodeAt(t)===l){if(!r){n=t;break}}else r=!1;return-1===n?t?"/":".":t&&1===n?"//":e.slice(0,n)},basename(e,t){void 0!==t&&d(t,"ext"),d(e,"path");let n,r=0,i=-1,o=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t===e)return"";let s=t.length-1,a=-1;for(n=e.length-1;n>=0;--n){const u=e.charCodeAt(n);if(u===l){ +if(!o){r=n+1;break}}else-1===a&&(o=!1,a=n+1),s>=0&&(u===t.charCodeAt(s)?-1==--s&&(i=n):(s=-1,i=a))}return r===i?i=a:-1===i&&(i=e.length),e.slice(r,i)}for(n=e.length-1;n>=0;--n)if(e.charCodeAt(n)===l){if(!o){r=n+1;break}}else-1===i&&(o=!1,i=n+1);return-1===i?"":e.slice(r,i)},extname(e){d(e,"path");let t=-1,n=0,r=-1,i=!0,o=0;for(let s=e.length-1;s>=0;--s){const u=e.charCodeAt(s);if(u!==l)-1===r&&(i=!1,r=s+1),u===a?-1===t?t=s:1!==o&&(o=1):-1!==t&&(o=-1);else if(!i){n=s+1;break}}return-1===t||-1===r||0===o||1===o&&t===r-1&&t===n+1?"":e.slice(t,r)},format:p.bind(null,"/"),parse(e){d(e,"path");const t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;const n=e.charCodeAt(0)===l;let r;n?(t.root="/",r=1):r=0;let i=-1,o=0,s=-1,u=!0,c=e.length-1,h=0;for(;c>=r;--c){const t=e.charCodeAt(c);if(t!==l)-1===s&&(u=!1,s=c+1),t===a?-1===i?i=c:1!==h&&(h=1):-1!==i&&(h=-1);else if(!u){o=c+1;break}}if(-1!==s){const r=0===o&&n?1:o;-1===i||0===h||1===h&&i===s-1&&i===o+1?t.base=t.name=e.slice(r,s):(t.name=e.slice(r,i), +t.base=e.slice(r,s),t.ext=e.slice(i,s))}return o>0?t.dir=e.slice(0,o-1):n&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null},t.posix.win32=t.win32.win32=t.win32,t.posix.posix=t.win32.posix=t.posix,t.normalize="win32"===n.platform?t.win32.normalize:t.posix.normalize,t.resolve="win32"===n.platform?t.win32.resolve:t.posix.resolve,t.relative="win32"===n.platform?t.win32.relative:t.posix.relative,t.dirname="win32"===n.platform?t.win32.dirname:t.posix.dirname,t.basename="win32"===n.platform?t.win32.basename:t.posix.basename,t.extname="win32"===n.platform?t.win32.extname:t.posix.extname,t.sep="win32"===n.platform?t.win32.sep:t.posix.sep})),e(n[8],r([0,1]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}), +t.breakBetweenGraphemeBreakType=t.getGraphemeBreakType=t.singleLetterHash=t.containsUppercaseCharacter=t.startsWithUTF8BOM=t.UTF8_BOM_CHARACTER=t.isEmojiImprecise=t.isFullWidthCharacter=t.containsFullWidthCharacter=t.containsUnusualLineTerminators=t.UNUSUAL_LINE_TERMINATORS=t.isBasicASCII=t.containsEmoji=t.containsRTL=t.decodeUTF8=t.prevCharLength=t.nextCharLength=t.getNextCodePoint=t.computeCodePoint=t.isLowSurrogate=t.isHighSurrogate=t.commonSuffixLength=t.commonPrefixLength=t.startsWithIgnoreCase=t.equalsIgnoreCase=t.isUpperAsciiLetter=t.isLowerAsciiLetter=t.compareSubstringIgnoreCase=t.compareIgnoreCase=t.compareSubstring=t.compare=t.lastNonWhitespaceIndex=t.getLeadingWhitespace=t.firstNonWhitespaceIndex=t.regExpFlags=t.regExpLeadsToEndlessLoop=t.createRegExp=t.endsWith=t.startsWith=t.stripWildcards=t.convertSimple2RegExpPattern=t.rtrim=t.ltrim=t.trim=t.escapeRegExpCharacters=t.escape=t.format=t.pad=t.isFalsyOrWhitespace=void 0,t.isFalsyOrWhitespace=function(e){ +return!e||"string"!=typeof e||0===e.trim().length},t.pad=function(e,t,n="0"){const r=""+e,i=[r];for(let e=r.length;eo)return 1}const s=r-n,a=o-i;return sa?1:0}function a(e,t,n=0,r=e.length,i=0,o=t.length){for(;nc?1:0}function l(e){return e>=97&&e<=122}function u(e){return e>=65&&e<=90}function c(e){return l(e)||u(e)}function d(e,t,n=e.length){for(let r=0;r1){const r=e.charCodeAt(t-2);if(h(r))return g(r,n)}return n}t.format=function(e,...t){return 0===t.length?e:e.replace(n,(function(e,n){const r=parseInt(n,10);return isNaN(r)||r<0||r>=t.length?e:t[r]}))},t.escape=function(e){return e.replace(/[<>&]/g,(function(e){switch(e){case"<":return"<";case">":return">" +;case"&":return"&";default:return e}}))},t.escapeRegExpCharacters=r,t.trim=function(e,t=" "){return o(i(e,t),t)},t.ltrim=i,t.rtrim=o,t.convertSimple2RegExpPattern=function(e){return e.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")},t.stripWildcards=function(e){return e.replace(/\*/g,"")},t.startsWith=function(e,t){if(e.length0?e.indexOf(t,n)===n:0===n&&e===t},t.createRegExp=function(e,t,n={}){if(!e)throw new Error("Cannot create regex from empty string");t||(e=r(e)),n.wholeWord&&(/\B/.test(e.charAt(0))||(e="\\b"+e),/\B/.test(e.charAt(e.length-1))||(e+="\\b"));let i="";return n.global&&(i+="g"),n.matchCase||(i+="i"),n.multiline&&(i+="m"),n.unicode&&(i+="u"),new RegExp(e,i)},t.regExpLeadsToEndlessLoop=function(e){return"^"!==e.source&&"^$"!==e.source&&"$"!==e.source&&"^\\s*$"!==e.source&&!(!e.exec("")||0!==e.lastIndex)}, +t.regExpFlags=function(e){return(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")},t.firstNonWhitespaceIndex=function(e){for(let t=0,n=e.length;t=0;n--){const t=e.charCodeAt(n);if(32!==t&&9!==t)return n}return-1},t.compare=function(e,t){return et?1:0},t.compareSubstring=s,t.compareIgnoreCase=function(e,t){return a(e,t,0,e.length,0,t.length)},t.compareSubstringIgnoreCase=a,t.isLowerAsciiLetter=l,t.isUpperAsciiLetter=u,t.equalsIgnoreCase=function(e,t){return e.length===t.length&&d(e,t)},t.startsWithIgnoreCase=function(e,t){const n=t.length;return!(t.length>e.length)&&d(e,t,n)},t.commonPrefixLength=function(e,t){let n,r=Math.min(e.length,t.length) +;for(n=0;n=65536?2:1;let s=n.getGraphemeBreakType(o);for(;t=65536?2:1,s=o}return t-r},t.prevCharLength=function(e,t){const n=E.getInstance(),r=t,i=p(e,t);t-=i>=65536?2:1;let o=n.getGraphemeBreakType(i);for(;t>0;){const r=p(e,t),i=n.getGraphemeBreakType(r);if(v(i,o))break;t-=r>=65536?2:1,o=i}return r-t},t.decodeUTF8=function(e){const t=e.byteLength,n=[];let r=0;for(;r=240&&r+3>>0|(63&e[r++])<<12>>>0|(63&e[r++])<<6>>>0|(63&e[r++])<<0>>>0:i>=224&&r+2>>0|(63&e[r++])<<6>>>0|(63&e[r++])<<0>>>0:i>=192&&r+1>>0|(63&e[r++])<<0>>>0:e[r++])>=0&&o<=55295||o>=57344&&o<=65535)n.push(String.fromCharCode(o));else if(o>=65536&&o<=1114111){const e=o-65536,t=55296+((1047552&e)>>>10),r=56320+((1023&e)>>>0);n.push(String.fromCharCode(t)),n.push(String.fromCharCode(r))}else n.push(String.fromCharCode(65533))}return n.join("")};const _=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/ +;t.containsRTL=function(e){return _.test(e)};const C=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDE73\uDE78-\uDE82\uDE90-\uDE95])/;t.containsEmoji=function(e){return C.test(e)};const b=/^[\t\n\r\x20-\x7E]*$/;function y(e){return(e=+e)>=11904&&e<=55215||e>=63744&&e<=64255||e>=65281&&e<=65374}function v(e,t){return 0===e?5!==t&&7!==t:(2!==e||3!==t)&&(4===e||2===e||3===e||(4===t||2===t||3===t||(8!==e||8!==t&&9!==t&&11!==t&&12!==t)&&((11!==e&&9!==e||9!==t&&10!==t)&&((12!==e&&10!==e||10!==t)&&(5!==t&&13!==t&&(7!==t&&(1!==e&&((13!==e||14!==t)&&(6!==e||6!==t)))))))))}t.isBasicASCII=function(e){return b.test(e)},t.UNUSUAL_LINE_TERMINATORS=/[\u2028\u2029]/,t.containsUnusualLineTerminators=function(e){return t.UNUSUAL_LINE_TERMINATORS.test(e)},t.containsFullWidthCharacter=function(e){for(let t=0,n=e.length;t=127462&&e<=127487||e>=9728&&e<=10175||e>=127744&&e<=128591||e>=128640&&e<=128764||e>=128992&&e<=129003||e>=129280&&e<=129535||e>=129648&&e<=129651||e>=129656&&e<=129666||e>=129680&&e<=129685},t.UTF8_BOM_CHARACTER=String.fromCharCode(65279),t.startsWithUTF8BOM=function(e){return!!(e&&e.length>0&&65279===e.charCodeAt(0))},t.containsUppercaseCharacter=function(e,t=!1){return!!e&&(t&&(e=e.replace(/\\./g,"")),e.toLowerCase()!==e)},t.singleLetterHash=function(e){return(e%=52)<26?String.fromCharCode(97+e):String.fromCharCode(65+e-26)},t.getGraphemeBreakType=function(e){return E.getInstance().getGraphemeBreakType(e)},t.breakBetweenGraphemeBreakType=v;class E{constructor(){ +this._data=JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]") +}static getInstance(){return E._INSTANCE||(E._INSTANCE=new E),E._INSTANCE}getGraphemeBreakType(e){if(e<32)return 10===e?3:13===e?2:4;if(e<127)return 0;const t=this._data,n=t.length/3;let r=1;for(;r<=n;)if(et[3*r+1]))return t[3*r+2];r=2*r+1}return 0}}E._INSTANCE=null})),e(n[21],r([0,1,8]),(function(e,t,n){"use strict";function r(e,t){switch(typeof e){case"object":return null===e?i(349,t):Array.isArray(e)?(n=e,s=i(104579,s=t),n.reduce((e,t)=>r(t,e),s)):function(e,t){return t=i(181387,t),Object.keys(e).sort().reduce((t,n)=>(t=o(n,t),r(e[n],t)),t)}(e,t);case"string":return o(e,t);case"boolean":return function(e,t){return i(e?433:863,t)}(e,t);case"number":return i(e,t);case"undefined":return i(937,t);default:return i(617,t)}var n,s}function i(e,t){return(t<<5)-t+e|0}function o(e,t){t=i(149417,t);for(let n=0,r=e.length;n>>r)>>>0}function a(e,t=0,n=e.byteLength,r=0){ +for(let i=0;i>>0).toString(16),t/4)}Object.defineProperty(t,"__esModule",{value:!0}),t.StringSHA1=t.stringHash=t.doHash=t.hash=void 0,t.hash=function(e){return r(e,0)},t.doHash=r,t.stringHash=o;class u{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){const t=e.length;if(0===t)return;const r=this._buff;let i,o,s=this._buffLen,a=this._leftoverHighSurrogate;for(0!==a?(i=a,o=-1,a=0):(i=e.charCodeAt(0),o=0);;){let l=i;if(n.isHighSurrogate(i)){if(!(o+1>>6,e[t++]=128|(63&n)>>>0):n<65536?(e[t++]=224|(61440&n)>>>12,e[t++]=128|(4032&n)>>>6,e[t++]=128|(63&n)>>>0):(e[t++]=240|(1835008&n)>>>18,e[t++]=128|(258048&n)>>>12,e[t++]=128|(4032&n)>>>6,e[t++]=128|(63&n)>>>0),t>=64&&(this._step(),t-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),l(this._h0)+l(this._h1)+l(this._h2)+l(this._h3)+l(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,a(this._buff,this._buffLen),this._buffLen>56&&(this._step(),a(this._buff));const e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){const e=u._bigBlock32,t=this._buffDV;for(let n=0;n<64;n+=4)e.setUint32(n,t.getUint32(n,!1),!1) +;for(let t=64;t<320;t+=4)e.setUint32(t,s(e.getUint32(t-12,!1)^e.getUint32(t-32,!1)^e.getUint32(t-56,!1)^e.getUint32(t-64,!1),1),!1);let n,r,i,o=this._h0,a=this._h1,l=this._h2,c=this._h3,d=this._h4;for(let t=0;t<80;t++)t<20?(n=a&l|~a&c,r=1518500249):t<40?(n=a^l^c,r=1859775393):t<60?(n=a&l|a&c|l&c,r=2400959708):(n=a^l^c,r=3395469782),i=s(o,5)+n+d+r+e.getUint32(4*t,!1)&4294967295,d=c,c=l,l=s(a,30),a=o,o=i;this._h0=this._h0+o&4294967295,this._h1=this._h1+a&4294967295,this._h2=this._h2+l&4294967295,this._h3=this._h3+c&4294967295,this._h4=this._h4+d&4294967295}}t.StringSHA1=u,u._bigBlock32=new DataView(new ArrayBuffer(320))})),e(n[9],r([0,1,14,21]),(function(e,t,n,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LcsDiff=t.MyArray=t.Debug=t.stringDiff=t.StringDiffSequence=void 0;class i{constructor(e){this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let n=0,r=e.length;n0||this.m_modifiedCount>0)&&this.m_changes.push(new n.DiffChange(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=1073741824,this.m_modifiedStart=1073741824}AddOriginalElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_originalCount++}AddModifiedElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_modifiedCount++} +getChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes}getReverseChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes}}class l{constructor(e,t,n=null){this.ContinueProcessingPredicate=n;const[r,i,o]=l._getElements(e),[s,a,u]=l._getElements(t);this._hasStrings=o&&u,this._originalStringElements=r,this._originalElementsOrHash=i,this._modifiedStringElements=s,this._modifiedElementsOrHash=a,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(e){return e.length>0&&"string"==typeof e[0]}static _getElements(e){const t=e.getElements();if(l._isStringArray(t)){const e=new Int32Array(t.length);for(let n=0,i=t.length;n=e&&i>=r&&this.ElementsAreEqual(t,i);)t--,i--;if(e>t||r>i){let s +;return r<=i?(o.Assert(e===t+1,"originalStart should only be one more than originalEnd"),s=[new n.DiffChange(e,0,r,i-r+1)]):e<=t?(o.Assert(r===i+1,"modifiedStart should only be one more than modifiedEnd"),s=[new n.DiffChange(e,t-e+1,r,0)]):(o.Assert(e===t+1,"originalStart should only be one more than originalEnd"),o.Assert(r===i+1,"modifiedStart should only be one more than modifiedEnd"),s=[]),s}const a=[0],l=[0],u=this.ComputeRecursionPoint(e,t,r,i,a,l,s),c=a[0],d=l[0];if(null!==u)return u;if(!s[0]){const o=this.ComputeDiffRecursive(e,c,r,d,s);let a=[];return a=s[0]?[new n.DiffChange(c+1,t-(c+1)+1,d+1,i-(d+1)+1)]:this.ComputeDiffRecursive(c+1,t,d+1,i,s),this.ConcatenateChanges(o,a)}return[new n.DiffChange(e,t-e+1,r,i-r+1)]}WALKTRACE(e,t,r,i,o,s,l,u,c,d,h,f,g,m,p,_,C,b){let y=null,v=null,E=new a,S=t,L=r,A=g[0]-_[0]-i,N=-1073741824,w=this.m_forwardHistory.length-1;do{const t=A+e;t===S||t=0&&(e=(c=this.m_forwardHistory[w])[0],S=1,L=c.length-1)}while(--w>=-1);if(y=E.getReverseChanges(),b[0]){let e=g[0]+1,t=_[0]+1;if(null!==y&&y.length>0){const n=y[y.length-1];e=Math.max(e,n.getOriginalEnd()),t=Math.max(t,n.getModifiedEnd())}v=[new n.DiffChange(e,f-e+1,t,p-t+1)]}else{E=new a,S=s,L=l,A=g[0]-_[0]-u,N=1073741824,w=C?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const e=A+o;e===S||e=d[e+1]?(m=(h=d[e+1]-1)-A-u,h>N&&E.MarkNextChange(),N=h+1,E.AddOriginalElement(h+1,m+1),A=e+1-o):(m=(h=d[e-1])-A-u,h>N&&E.MarkNextChange(),N=h,E.AddModifiedElement(h+1,m+1),A=e-1-o),w>=0&&(o=(d=this.m_reverseHistory[w])[0],S=1,L=d.length-1)}while(--w>=-1);v=E.getChanges()}return this.ConcatenateChanges(y,v)}ComputeRecursionPoint(e,t,r,i,o,a,l){let u=0,c=0,d=0,h=0,f=0,g=0;e--,r--,o[0]=0,a[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[] +;const m=t-e+(i-r),p=m+1,_=new Int32Array(p),C=new Int32Array(p),b=i-r,y=t-e,v=e-r,E=t-i,S=(y-b)%2==0;_[b]=e,C[y]=t,l[0]=!1;for(let L=1;L<=m/2+1;L++){let m=0,A=0;d=this.ClipDiagonalBound(b-L,L,b,p),h=this.ClipDiagonalBound(b+L,L,b,p);for(let e=d;e<=h;e+=2){c=(u=e===d||em+A&&(m=u,A=c),!S&&Math.abs(e-y)<=L-1&&u>=C[e])return o[0]=u,a[0]=c,n<=C[e]&&L<=1448?this.WALKTRACE(b,d,h,v,y,f,g,E,_,C,u,t,o,c,i,a,S,l):null}const N=(m-e+(A-r)-L)/2;if(null!==this.ContinueProcessingPredicate&&!this.ContinueProcessingPredicate(m,N))return l[0]=!0,o[0]=m,a[0]=A,N>0&&L<=1448?this.WALKTRACE(b,d,h,v,y,f,g,E,_,C,u,t,o,c,i,a,S,l):(e++,r++,[new n.DiffChange(e,t-e+1,r,i-r+1)]);f=this.ClipDiagonalBound(y-L,L,y,p),g=this.ClipDiagonalBound(y+L,L,y,p);for(let n=f;n<=g;n+=2){c=(u=n===f||n=C[n+1]?C[n+1]-1:C[n-1])-(n-y)-E;const s=u;for(;u>e&&c>r&&this.ElementsAreEqual(u,c);)u--,c--;if(C[n]=u, +S&&Math.abs(n-b)<=L&&u<=_[n])return o[0]=u,a[0]=c,s>=_[n]&&L<=1448?this.WALKTRACE(b,d,h,v,y,f,g,E,_,C,u,t,o,c,i,a,S,l):null}if(L<=1447){let e=new Int32Array(h-d+2);e[0]=b-d+1,s.Copy2(_,d,e,1,h-d+1),this.m_forwardHistory.push(e),(e=new Int32Array(g-f+2))[0]=y-f+1,s.Copy2(C,f,e,1,g-f+1),this.m_reverseHistory.push(e)}}return this.WALKTRACE(b,d,h,v,y,f,g,E,_,C,u,t,o,c,i,a,S,l)}PrettifyChanges(e){for(let t=0;t0,s=n.modifiedLength>0;for(;n.originalStart+n.originalLength=0;t--){const n=e[t];let r=0,i=0;if(t>0){const n=e[t-1];n.originalLength>0&&(r=n.originalStart+n.originalLength),n.modifiedLength>0&&(i=n.modifiedStart+n.modifiedLength)}const o=n.originalLength>0,s=n.modifiedLength>0;let a=0,l=this._boundaryScore(n.originalStart,n.originalLength,n.modifiedStart,n.modifiedLength);for(let e=1;;e++){const t=n.originalStart-e,u=n.modifiedStart-e;if(tl&&(l=c,a=e)}n.originalStart-=a,n.modifiedStart-=a}return e}_OriginalIsBoundary(e){return e<=0||e>=this._originalElementsOrHash.length-1||this._hasStrings&&/^\s*$/.test(this._originalStringElements[e])}_OriginalRegionIsBoundary(e,t){if(this._OriginalIsBoundary(e)||this._OriginalIsBoundary(e-1))return!0;if(t>0){const n=e+t;if(this._OriginalIsBoundary(n-1)||this._OriginalIsBoundary(n))return!0}return!1} +_ModifiedIsBoundary(e){return e<=0||e>=this._modifiedElementsOrHash.length-1||this._hasStrings&&/^\s*$/.test(this._modifiedStringElements[e])}_ModifiedRegionIsBoundary(e,t){if(this._ModifiedIsBoundary(e)||this._ModifiedIsBoundary(e-1))return!0;if(t>0){const n=e+t;if(this._ModifiedIsBoundary(n-1)||this._ModifiedIsBoundary(n))return!0}return!1}_boundaryScore(e,t,n,r){return(this._OriginalRegionIsBoundary(e,t)?1:0)+(this._ModifiedRegionIsBoundary(n,r)?1:0)}ConcatenateChanges(e,t){let n=[];if(0===e.length||0===t.length)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],n)){const r=new Array(e.length+t.length-1);return s.Copy(e,0,r,0,e.length-1),r[e.length-1]=n[0],s.Copy(t,1,r,e.length,t.length-1),r}{const n=new Array(e.length+t.length);return s.Copy(e,0,n,0,e.length),s.Copy(t,0,n,e.length,t.length),n}}ChangesOverlap(e,t,r){if(o.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"), +o.Assert(e.modifiedStart<=t.modifiedStart,"Left change is not less than or equal to right change"),e.originalStart+e.originalLength>=t.originalStart||e.modifiedStart+e.modifiedLength>=t.modifiedStart){const i=e.originalStart;let o=e.originalLength;const s=e.modifiedStart;let a=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(o=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(a=t.modifiedStart+t.modifiedLength-e.modifiedStart),r[0]=new n.DiffChange(i,o,s,a),!0}return r[0]=null,!1}ClipDiagonalBound(e,t,n,r){if(e>=0&&e(function(){const n=Array.prototype.slice.call(arguments,0);return t(e,n)});let r={};for(const t of e)r[t]=n(t);return r},t.withNullAsUndefined=function(e){return null===e?void 0:e}})),e(n[11],r([0,1]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toUint32=t.toUint8=void 0,t.toUint8=function(e){return e<0?0:e>255?255:0|e},t.toUint32=function(e){ +return e<0?0:e>4294967295?4294967295:0|e}})),e(n[12],r([0,1,3,20]),(function(e,t,n,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uriToFsPath=t.URI=void 0;const i=/^\w[\w\d+.-]*$/,o=/^\//,s=/^\/\//;const a="",l="/",u=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class c{constructor(e,t,n,r,u,c=!1){"object"==typeof e?(this.scheme=e.scheme||a,this.authority=e.authority||a,this.path=e.path||a,this.query=e.query||a,this.fragment=e.fragment||a):(this.scheme=function(e,t){return e||t?e:"file"}(e,c),this.authority=t||a,this.path=function(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==l&&(t=l+t):t=l}return t}(this.scheme,n||a),this.query=r||a,this.fragment=u||a,function(e,t){if(!e.scheme&&t)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${e.authority}", path: "${e.path}", query: "${e.query}", fragment: "${e.fragment}"}`);if(e.scheme&&!i.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){ +if(!o.test(e.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(s.test(e.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}(this,c))}static isUri(e){return e instanceof c||!!e&&("string"==typeof e.authority&&"string"==typeof e.fragment&&"string"==typeof e.path&&"string"==typeof e.query&&"string"==typeof e.scheme&&"function"==typeof e.fsPath&&"function"==typeof e.with&&"function"==typeof e.toString)}get fsPath(){return p(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:n,path:r,query:i,fragment:o}=e;return void 0===t?t=this.scheme:null===t&&(t=a),void 0===n?n=this.authority:null===n&&(n=a),void 0===r?r=this.path:null===r&&(r=a),void 0===i?i=this.query:null===i&&(i=a),void 0===o?o=this.fragment:null===o&&(o=a), +t===this.scheme&&n===this.authority&&r===this.path&&i===this.query&&o===this.fragment?this:new h(t,n,r,i,o)}static parse(e,t=!1){const n=u.exec(e);return n?new h(n[2]||a,b(n[4]||a),b(n[5]||a),b(n[7]||a),b(n[9]||a),t):new h(a,a,a,a,a)}static file(e){let t=a;if(n.isWindows&&(e=e.replace(/\\/g,l)),e[0]===l&&e[1]===l){const n=e.indexOf(l,2);-1===n?(t=e.substring(2),e=l):(t=e.substring(2,n),e=e.substring(n)||l)}return new h("file",t,e,a,a)}static from(e){return new h(e.scheme,e.authority,e.path,e.query,e.fragment)}static joinPath(e,...t){if(!e.path)throw new Error("[UriError]: cannot call joinPaths on URI without path");let i;return i=n.isWindows&&"file"===e.scheme?c.file(r.win32.join(p(e,!0),...t)).path:r.posix.join(e.path,...t),e.with({path:i})}toString(e=!1){return _(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof c)return e;{const t=new h(e);return t._formatted=e.external,t._fsPath=e._sep===d?e.fsPath:null,t}}return e}}t.URI=c;const d=n.isWindows?1:void 0;class h extends c{constructor(){ +super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=p(this,!1)),this._fsPath}toString(e=!1){return e?_(this,!0):(this._formatted||(this._formatted=_(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=d),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}}const f={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function g(e,t){let n=void 0,r=-1;for(let i=0;i=97&&o<=122||o>=65&&o<=90||o>=48&&o<=57||45===o||46===o||95===o||126===o||t&&47===o)-1!==r&&(n+=encodeURIComponent(e.substring(r,i)),r=-1),void 0!==n&&(n+=e.charAt(i));else{void 0===n&&(n=e.substr(0,i)) +;const t=f[o];void 0!==t?(-1!==r&&(n+=encodeURIComponent(e.substring(r,i)),r=-1),n+=t):-1===r&&(r=i)}}return-1!==r&&(n+=encodeURIComponent(e.substring(r))),void 0!==n?n:e}function m(e){let t=void 0;for(let n=0;n1&&"file"===e.scheme?`//${e.authority}${e.path}`:47===e.path.charCodeAt(0)&&(e.path.charCodeAt(1)>=65&&e.path.charCodeAt(1)<=90||e.path.charCodeAt(1)>=97&&e.path.charCodeAt(1)<=122)&&58===e.path.charCodeAt(2)?t?e.path.substr(1):e.path[1].toLowerCase()+e.path.substr(2):e.path,n.isWindows&&(r=r.replace(/\//g,"\\")),r}function _(e,t){const n=t?m:g;let r="",{scheme:i,authority:o,path:s,query:a,fragment:u}=e;if(i&&(r+=i,r+=":"),(o||"file"===i)&&(r+=l,r+=l),o){let e=o.indexOf("@");if(-1!==e){const t=o.substr(0,e);o=o.substr(e+1),-1===(e=t.indexOf(":"))?r+=n(t,!1):(r+=n(t.substr(0,e),!1),r+=":", +r+=n(t.substr(e+1),!1)),r+="@"}-1===(e=(o=o.toLowerCase()).indexOf(":"))?r+=n(o,!1):(r+=n(o.substr(0,e),!1),r+=o.substr(e))}if(s){if(s.length>=3&&47===s.charCodeAt(0)&&58===s.charCodeAt(2)){const e=s.charCodeAt(1);e>=65&&e<=90&&(s=`/${String.fromCharCode(e+32)}:${s.substr(3)}`)}else if(s.length>=2&&58===s.charCodeAt(1)){const e=s.charCodeAt(0);e>=65&&e<=90&&(s=`${String.fromCharCode(e+32)}:${s.substr(2)}`)}r+=n(s,!0)}return a&&(r+="?",r+=n(a,!1)),u&&(r+="#",r+=t?u:g(u,!1)),r}t.uriToFsPath=p;const C=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function b(e){return e.match(C)?e.replace(C,e=>(function e(t){try{return decodeURIComponent(t)}catch(n){return t.length>3?t.substr(0,3)+e(t.substr(3)):t}})(e)):e}})),e(n[33],r([0,1,4,6,3,10]),(function(e,t,n,r,i,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.create=t.SimpleWorkerServer=t.SimpleWorkerClient=t.logOnceWebWorkerWarning=void 0;const s="$initialize";let a=!1;t.logOnceWebWorkerWarning=function(e){i.isWeb&&(a||(a=!0, +console.warn("Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/Microsoft/monaco-editor#faq")),console.warn(e.message))};class l{constructor(e){this._workerId=-1,this._handler=e,this._lastSentReq=0,this._pendingReplies=Object.create(null)}setWorkerId(e){this._workerId=e}sendMessage(e,t){let n=String(++this._lastSentReq);return new Promise((r,i)=>{this._pendingReplies[n]={resolve:r,reject:i},this._send({vsWorker:this._workerId,req:n,method:e,args:t})})}handleMessage(e){e&&e.vsWorker&&(-1!==this._workerId&&e.vsWorker!==this._workerId||this._handleMessage(e))}_handleMessage(e){if(e.seq){let t=e;if(!this._pendingReplies[t.seq])return void console.warn("Got reply to unknown seq");let n=this._pendingReplies[t.seq];if(delete this._pendingReplies[t.seq],t.err){let e=t.err;return t.err.$isError&&((e=new Error).name=t.err.name,e.message=t.err.message,e.stack=t.err.stack),void n.reject(e)}return void n.resolve(t.res)} +let t=e,r=t.req;this._handler.handleMessage(t.method,t.args).then(e=>{this._send({vsWorker:this._workerId,seq:r,res:e,err:void 0})},e=>{e.detail instanceof Error&&(e.detail=n.transformErrorForSerialization(e.detail)),this._send({vsWorker:this._workerId,seq:r,res:void 0,err:n.transformErrorForSerialization(e)})})}_send(e){let t=[];if(e.req){const n=e;for(let e=0;e{this._protocol.handleMessage(e)},e=>{r&&r(e)})),this._protocol=new l({sendMessage:(e,t)=>{this._worker.postMessage(e,t)},handleMessage:(e,t)=>{if("function"!=typeof n[e])return Promise.reject(new Error("Missing method "+e+" on main thread host."));try{return Promise.resolve(n[e].apply(n,t))}catch(e){return Promise.reject(e)}}}), +this._protocol.setWorkerId(this._worker.getId());let i=null;void 0!==self.require&&"function"==typeof self.require.getConfig?i=self.require.getConfig():void 0!==self.requirejs&&(i=self.requirejs.s.contexts._.config);const a=o.getAllMethodNames(n);this._onModuleLoaded=this._protocol.sendMessage(s,[this._worker.getId(),JSON.parse(JSON.stringify(i)),t,a]);const u=(e,t)=>this._request(e,t);this._lazyProxy=new Promise((e,n)=>{r=n,this._onModuleLoaded.then(t=>{e(o.createProxyObject(t,u))},e=>{n(e),this._onError("Worker failed to load "+t,e)})})}getProxyObject(){return this._lazyProxy}_request(e,t){return new Promise((n,r)=>{this._onModuleLoaded.then(()=>{this._protocol.sendMessage(e,t).then(n,r)},r)})}_onError(e,t){console.error(e),console.info(t)}}t.SimpleWorkerClient=u;class c{constructor(e,t){this._requestHandlerFactory=t,this._requestHandler=null,this._protocol=new l({sendMessage:(t,n)=>{e(t,n)},handleMessage:(e,t)=>this._handleMessage(e,t)})}onmessage(e){this._protocol.handleMessage(e)}_handleMessage(e,t){ +if(e===s)return this.initialize(t[0],t[1],t[2],t[3]);if(!this._requestHandler||"function"!=typeof this._requestHandler[e])return Promise.reject(new Error("Missing requestHandler or method: "+e));try{return Promise.resolve(this._requestHandler[e].apply(this._requestHandler,t))}catch(e){return Promise.reject(e)}}initialize(e,t,n,r){this._protocol.setWorkerId(e);const i=o.createProxyObject(r,(e,t)=>this._protocol.sendMessage(e,t));return this._requestHandlerFactory?(this._requestHandler=this._requestHandlerFactory(i),Promise.resolve(o.getAllMethodNames(this._requestHandler))):(t&&(void 0!==t.baseUrl&&delete t.baseUrl,void 0!==t.paths&&void 0!==t.paths.vs&&delete t.paths.vs,t.catchError=!0,self.require.config(t)),new Promise((e,t)=>{self.require([n],n=>{this._requestHandler=n.create(i),this._requestHandler?e(o.getAllMethodNames(this._requestHandler)):t(new Error("No RequestHandler!"))},t)}))}}t.SimpleWorkerServer=c,t.create=function(e){return new c(e,null)}})),e(n[22],r([0,1,11]),(function(e,t,n){"use strict" +;Object.defineProperty(t,"__esModule",{value:!0}),t.CharacterSet=t.CharacterClassifier=void 0;class r{constructor(e){let t=n.toUint8(e);this._defaultValue=t,this._asciiMap=r._createAsciiMap(t),this._map=new Map}static _createAsciiMap(e){let t=new Uint8Array(256);for(let n=0;n<256;n++)t[n]=e;return t}set(e,t){let r=n.toUint8(t);e>=0&&e<256?this._asciiMap[e]=r:this._map.set(e,r)}get(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue}}t.CharacterClassifier=r;t.CharacterSet=class{constructor(){this._actual=new r(0)}add(e){this._actual.set(e,1)}has(e){return 1===this._actual.get(e)}}})),e(n[2],r([0,1]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Position=void 0;class n{constructor(e,t){this.lineNumber=e,this.column=t}with(e=this.lineNumber,t=this.column){return e===this.lineNumber&&t===this.column?this:new n(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return n.equals(this,e)}static equals(e,t){ +return!e&&!t||!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return n.isBefore(this,e)}static isBefore(e,t){return e.lineNumbern||e===n&&t>r?(this.startLineNumber=n,this.startColumn=r,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e, +this.startColumn=t,this.endLineNumber=n,this.endColumn=r)}isEmpty(){return r.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return r.containsPosition(this,e)}static containsPosition(e,t){return!(t.lineNumbere.endLineNumber)&&(!(t.lineNumber===e.startLineNumber&&t.columne.endColumn))}containsRange(e){return r.containsRange(this,e)}static containsRange(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber)&&(!(t.startLineNumber===e.startLineNumber&&t.startColumne.endColumn)))}strictContainsRange(e){return r.strictContainsRange(this,e)}static strictContainsRange(e,t){ +return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber)&&(!(t.startLineNumber===e.startLineNumber&&t.startColumn<=e.startColumn)&&!(t.endLineNumber===e.endLineNumber&&t.endColumn>=e.endColumn)))}plusRange(e){return r.plusRange(this,e)}static plusRange(e,t){let n,i,o,s;return t.startLineNumbere.endLineNumber?(o=t.endLineNumber,s=t.endColumn):t.endLineNumber===e.endLineNumber?(o=t.endLineNumber,s=Math.max(t.endColumn,e.endColumn)):(o=e.endLineNumber,s=e.endColumn),new r(n,i,o,s)}intersectRanges(e){return r.intersectRanges(this,e)}static intersectRanges(e,t){let n=e.startLineNumber,i=e.startColumn,o=e.endLineNumber,s=e.endColumn,a=t.startLineNumber,l=t.startColumn,u=t.endLineNumber,c=t.endColumn +;return nu?(o=u,s=c):o===u&&(s=Math.min(s,c)),n>o?null:n===o&&i>s?null:new r(n,i,o,s)}equalsRange(e){return r.equalsRange(this,e)}static equalsRange(e,t){return!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn}getEndPosition(){return r.getEndPosition(this)}static getEndPosition(e){return new n.Position(e.endLineNumber,e.endColumn)}getStartPosition(){return r.getStartPosition(this)}static getStartPosition(e){return new n.Position(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new r(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new r(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return r.collapseToStart(this)}static collapseToStart(e){return new r(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)} +static fromPositions(e,t=e){return new r(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new r(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return e&&"number"==typeof e.startLineNumber&&"number"==typeof e.startColumn&&"number"==typeof e.endLineNumber&&"number"==typeof e.endColumn}static areIntersectingOrTouching(e,t){return!(e.endLineNumbere.startLineNumber}}t.Range=r})),e(n[23],r([0,1,2,5]),(function(e,t,n,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Selection=void 0;class i extends r.Range{constructor(e,t,n,r){super(e,t,n,r),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=n,this.positionColumn=r}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(e){return i.selectionsEqual(this,e)}static selectionsEqual(e,t){ +return e.selectionStartLineNumber===t.selectionStartLineNumber&&e.selectionStartColumn===t.selectionStartColumn&&e.positionLineNumber===t.positionLineNumber&&e.positionColumn===t.positionColumn}getDirection(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?0:1}setEndPosition(e,t){return 0===this.getDirection()?new i(this.startLineNumber,this.startColumn,e,t):new i(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new n.Position(this.positionLineNumber,this.positionColumn)}setStartPosition(e,t){return 0===this.getDirection()?new i(e,t,this.endLineNumber,this.endColumn):new i(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new i(e.lineNumber,e.column,t.lineNumber,t.column)}static liftSelection(e){return new i(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn)}static selectionsArrEqual(e,t){if(e&&!t||!e&&t)return!1;if(!e&&!t)return!0;if(e.length!==t.length)return!1 +;for(let n=0,r=e.length;n0&&t.originalLength<20&&t.modifiedLength>0&&t.modifiedLength<20&&s()){const a=n.createCharSequence(e,t.originalStart,t.originalStart+t.originalLength-1),u=r.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);let d=o(a,u,s,!0).changes;c&&(d=function(e){if(e.length<=1)return e;const t=[e[0]];let n=t[0];for(let r=1,o=e.length;r!0;const t=Date.now();return()=>Date.now()-t1&&o>1;){if(e.charCodeAt(n-2)!==t.charCodeAt(o-2))break;n--,o--}(n>1||o>1)&&this._pushTrimWhitespaceCharChange(r,i+1,1,n,s+1,1,o)}{let n=d(e,1),o=d(t,1);const a=e.length+1,l=t.length+1;for(;n/?",t.DEFAULT_WORD_REGEXP=function(e=""){let n="(-?\\d*\\.\\d\\w*)|([^";for(const r of t.USUAL_WORD_SEPARATORS)e.indexOf(r)>=0||(n+="\\"+r);return n+="\\s]+)",new RegExp(n,"g")}(),t.ensureValidWordDefinition=function(e){let n=t.DEFAULT_WORD_REGEXP;if(e&&e instanceof RegExp)if(e.global)n=e;else{let t="g" +;e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),n=new RegExp(e.source,t)}return n.lastIndex=0,n};const n={maxLen:1e3,windowSize:15,timeBudget:150};function r(e,t,n,r){let i;for(;i=e.exec(t);){const t=i.index||0;if(t<=n&&e.lastIndex>=n)return i;if(r>0&&t>r)return null}return null}t.getWordAtText=function e(t,i,o,s,a=n){if(o.length>a.maxLen){let n=t-a.maxLen/2;return n<0?(s+=t,n=0):s+=n,e(t,i,o=o.substring(n,t+a.maxLen/2),s,a)}Date.now();const l=t-1-s;let u=-1,c=null;for(let e=1;;e++){Date.now(),a.timeBudget;const t=l-a.windowSize*e;i.lastIndex=Math.max(0,t);const n=r(i,o,l,u);if(!n&&c)break;if(c=n,t<=0)break;u=t}if(c){let e={word:c[0],startColumn:s+1+c.index,endColumn:s+1+c.index+c[0].length};return i.lastIndex=0,e}return null}})),e(n[27],r([0,1,22]),(function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.computeLinks=t.LinkComputer=t.StateMachine=t.Uint8Matrix=void 0;class r{constructor(e,t,n){const r=new Uint8Array(e*t);for(let i=0,o=e*t;it&&(t=o),i>n&&(n=i),s>n&&(n=s)}let i=new r(++n,++t,0);for(let t=0,n=e.length;t=this._maxCharCode?0:this._states.get(e,t)}}t.StateMachine=i;let o=null;let s=null;class a{static _createLink(e,t,n,r,i){let o=i-1;do{const n=t.charCodeAt(o);if(2!==e.get(n))break;o--}while(o>r);if(r>0){const e=t.charCodeAt(r-1),n=t.charCodeAt(o);(40===e&&41===n||91===e&&93===n||123===e&&125===n)&&o--}return{range:{startLineNumber:n,startColumn:r+1,endLineNumber:n,endColumn:o+2},url:t.substring(r,o+1)}} +static computeLinks(e,t=(null===o&&(o=new i([[1,104,2],[1,72,2],[1,102,6],[1,70,6],[2,116,3],[2,84,3],[3,116,4],[3,84,4],[4,112,5],[4,80,5],[5,115,9],[5,83,9],[5,58,10],[6,105,7],[6,73,7],[7,108,8],[7,76,8],[8,101,9],[8,69,9],[9,58,10],[10,47,11],[11,47,12]])),o)){const r=function(){if(null===s){s=new n.CharacterClassifier(0);const e=" \t<>'\"、。。、,.:;‘“〈《「『【〔([{「」}])〕】』」》〉”’`~…";for(let t=0;t=0?((r+=n?1:-1)<0?r=e.length-1:r%=e.length,e[r]):null}}t.BasicInplaceReplace=n,n.INSTANCE=new n})),e(n[29],r([0,1]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}), +t.WrappingIndent=t.TrackedRangeStickiness=t.TextEditorCursorStyle=t.TextEditorCursorBlinkingStyle=t.SymbolTag=t.SymbolKind=t.SignatureHelpTriggerKind=t.SelectionDirection=t.ScrollbarVisibility=t.ScrollType=t.RenderMinimap=t.RenderLineNumbersType=t.OverviewRulerLane=t.OverlayWidgetPositionPreference=t.MouseTargetType=t.MinimapPosition=t.MarkerTag=t.MarkerSeverity=t.KeyCode=t.IndentAction=t.EndOfLineSequence=t.EndOfLinePreference=t.EditorOption=t.EditorAutoIndentStrategy=t.DocumentHighlightKind=t.DefaultEndOfLine=t.CursorChangeReason=t.ContentWidgetPositionPreference=t.CompletionTriggerKind=t.CompletionItemTag=t.CompletionItemKind=t.CompletionItemInsertTextRule=t.AccessibilitySupport=void 0,function(e){e[e.Unknown=0]="Unknown",e[e.Disabled=1]="Disabled",e[e.Enabled=2]="Enabled"}(t.AccessibilitySupport||(t.AccessibilitySupport={})),function(e){e[e.KeepWhitespace=1]="KeepWhitespace",e[e.InsertAsSnippet=4]="InsertAsSnippet"}(t.CompletionItemInsertTextRule||(t.CompletionItemInsertTextRule={})),function(e){ +e[e.Method=0]="Method",e[e.Function=1]="Function",e[e.Constructor=2]="Constructor",e[e.Field=3]="Field",e[e.Variable=4]="Variable",e[e.Class=5]="Class",e[e.Struct=6]="Struct",e[e.Interface=7]="Interface",e[e.Module=8]="Module",e[e.Property=9]="Property",e[e.Event=10]="Event",e[e.Operator=11]="Operator",e[e.Unit=12]="Unit",e[e.Value=13]="Value",e[e.Constant=14]="Constant",e[e.Enum=15]="Enum",e[e.EnumMember=16]="EnumMember",e[e.Keyword=17]="Keyword",e[e.Text=18]="Text",e[e.Color=19]="Color",e[e.File=20]="File",e[e.Reference=21]="Reference",e[e.Customcolor=22]="Customcolor",e[e.Folder=23]="Folder",e[e.TypeParameter=24]="TypeParameter",e[e.User=25]="User",e[e.Issue=26]="Issue",e[e.Snippet=27]="Snippet"}(t.CompletionItemKind||(t.CompletionItemKind={})),function(e){e[e.Deprecated=1]="Deprecated"}(t.CompletionItemTag||(t.CompletionItemTag={})),function(e){e[e.Invoke=0]="Invoke",e[e.TriggerCharacter=1]="TriggerCharacter",e[e.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions" +}(t.CompletionTriggerKind||(t.CompletionTriggerKind={})),function(e){e[e.EXACT=0]="EXACT",e[e.ABOVE=1]="ABOVE",e[e.BELOW=2]="BELOW"}(t.ContentWidgetPositionPreference||(t.ContentWidgetPositionPreference={})),function(e){e[e.NotSet=0]="NotSet",e[e.ContentFlush=1]="ContentFlush",e[e.RecoverFromMarkers=2]="RecoverFromMarkers",e[e.Explicit=3]="Explicit",e[e.Paste=4]="Paste",e[e.Undo=5]="Undo",e[e.Redo=6]="Redo"}(t.CursorChangeReason||(t.CursorChangeReason={})),function(e){e[e.LF=1]="LF",e[e.CRLF=2]="CRLF"}(t.DefaultEndOfLine||(t.DefaultEndOfLine={})),function(e){e[e.Text=0]="Text",e[e.Read=1]="Read",e[e.Write=2]="Write"}(t.DocumentHighlightKind||(t.DocumentHighlightKind={})),function(e){e[e.None=0]="None",e[e.Keep=1]="Keep",e[e.Brackets=2]="Brackets",e[e.Advanced=3]="Advanced",e[e.Full=4]="Full"}(t.EditorAutoIndentStrategy||(t.EditorAutoIndentStrategy={})),function(e){e[e.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",e[e.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter", +e[e.accessibilitySupport=2]="accessibilitySupport",e[e.accessibilityPageSize=3]="accessibilityPageSize",e[e.ariaLabel=4]="ariaLabel",e[e.autoClosingBrackets=5]="autoClosingBrackets",e[e.autoClosingOvertype=6]="autoClosingOvertype",e[e.autoClosingQuotes=7]="autoClosingQuotes",e[e.autoIndent=8]="autoIndent",e[e.automaticLayout=9]="automaticLayout",e[e.autoSurround=10]="autoSurround",e[e.codeLens=11]="codeLens",e[e.colorDecorators=12]="colorDecorators",e[e.columnSelection=13]="columnSelection",e[e.comments=14]="comments",e[e.contextmenu=15]="contextmenu",e[e.copyWithSyntaxHighlighting=16]="copyWithSyntaxHighlighting",e[e.cursorBlinking=17]="cursorBlinking",e[e.cursorSmoothCaretAnimation=18]="cursorSmoothCaretAnimation",e[e.cursorStyle=19]="cursorStyle",e[e.cursorSurroundingLines=20]="cursorSurroundingLines",e[e.cursorSurroundingLinesStyle=21]="cursorSurroundingLinesStyle",e[e.cursorWidth=22]="cursorWidth",e[e.disableLayerHinting=23]="disableLayerHinting", +e[e.disableMonospaceOptimizations=24]="disableMonospaceOptimizations",e[e.dragAndDrop=25]="dragAndDrop",e[e.emptySelectionClipboard=26]="emptySelectionClipboard",e[e.extraEditorClassName=27]="extraEditorClassName",e[e.fastScrollSensitivity=28]="fastScrollSensitivity",e[e.find=29]="find",e[e.fixedOverflowWidgets=30]="fixedOverflowWidgets",e[e.folding=31]="folding",e[e.foldingStrategy=32]="foldingStrategy",e[e.foldingHighlight=33]="foldingHighlight",e[e.unfoldOnClickAfterEndOfLine=34]="unfoldOnClickAfterEndOfLine",e[e.fontFamily=35]="fontFamily",e[e.fontInfo=36]="fontInfo",e[e.fontLigatures=37]="fontLigatures",e[e.fontSize=38]="fontSize",e[e.fontWeight=39]="fontWeight",e[e.formatOnPaste=40]="formatOnPaste",e[e.formatOnType=41]="formatOnType",e[e.glyphMargin=42]="glyphMargin",e[e.gotoLocation=43]="gotoLocation",e[e.hideCursorInOverviewRuler=44]="hideCursorInOverviewRuler",e[e.highlightActiveIndentGuide=45]="highlightActiveIndentGuide",e[e.hover=46]="hover",e[e.inDiffEditor=47]="inDiffEditor", +e[e.letterSpacing=48]="letterSpacing",e[e.lightbulb=49]="lightbulb",e[e.lineDecorationsWidth=50]="lineDecorationsWidth",e[e.lineHeight=51]="lineHeight",e[e.lineNumbers=52]="lineNumbers",e[e.lineNumbersMinChars=53]="lineNumbersMinChars",e[e.links=54]="links",e[e.matchBrackets=55]="matchBrackets",e[e.minimap=56]="minimap",e[e.mouseStyle=57]="mouseStyle",e[e.mouseWheelScrollSensitivity=58]="mouseWheelScrollSensitivity",e[e.mouseWheelZoom=59]="mouseWheelZoom",e[e.multiCursorMergeOverlapping=60]="multiCursorMergeOverlapping",e[e.multiCursorModifier=61]="multiCursorModifier",e[e.multiCursorPaste=62]="multiCursorPaste",e[e.occurrencesHighlight=63]="occurrencesHighlight",e[e.overviewRulerBorder=64]="overviewRulerBorder",e[e.overviewRulerLanes=65]="overviewRulerLanes",e[e.padding=66]="padding",e[e.parameterHints=67]="parameterHints",e[e.peekWidgetDefaultFocus=68]="peekWidgetDefaultFocus",e[e.definitionLinkOpensInPeek=69]="definitionLinkOpensInPeek",e[e.quickSuggestions=70]="quickSuggestions", +e[e.quickSuggestionsDelay=71]="quickSuggestionsDelay",e[e.readOnly=72]="readOnly",e[e.renameOnType=73]="renameOnType",e[e.renderControlCharacters=74]="renderControlCharacters",e[e.renderIndentGuides=75]="renderIndentGuides",e[e.renderFinalNewline=76]="renderFinalNewline",e[e.renderLineHighlight=77]="renderLineHighlight",e[e.renderLineHighlightOnlyWhenFocus=78]="renderLineHighlightOnlyWhenFocus",e[e.renderValidationDecorations=79]="renderValidationDecorations",e[e.renderWhitespace=80]="renderWhitespace",e[e.revealHorizontalRightPadding=81]="revealHorizontalRightPadding",e[e.roundedSelection=82]="roundedSelection",e[e.rulers=83]="rulers",e[e.scrollbar=84]="scrollbar",e[e.scrollBeyondLastColumn=85]="scrollBeyondLastColumn",e[e.scrollBeyondLastLine=86]="scrollBeyondLastLine",e[e.scrollPredominantAxis=87]="scrollPredominantAxis",e[e.selectionClipboard=88]="selectionClipboard",e[e.selectionHighlight=89]="selectionHighlight",e[e.selectOnLineNumbers=90]="selectOnLineNumbers", +e[e.showFoldingControls=91]="showFoldingControls",e[e.showUnused=92]="showUnused",e[e.snippetSuggestions=93]="snippetSuggestions",e[e.smoothScrolling=94]="smoothScrolling",e[e.stopRenderingLineAfter=95]="stopRenderingLineAfter",e[e.suggest=96]="suggest",e[e.suggestFontSize=97]="suggestFontSize",e[e.suggestLineHeight=98]="suggestLineHeight",e[e.suggestOnTriggerCharacters=99]="suggestOnTriggerCharacters",e[e.suggestSelection=100]="suggestSelection",e[e.tabCompletion=101]="tabCompletion",e[e.tabIndex=102]="tabIndex",e[e.unusualLineTerminators=103]="unusualLineTerminators",e[e.useTabStops=104]="useTabStops",e[e.wordSeparators=105]="wordSeparators",e[e.wordWrap=106]="wordWrap",e[e.wordWrapBreakAfterCharacters=107]="wordWrapBreakAfterCharacters",e[e.wordWrapBreakBeforeCharacters=108]="wordWrapBreakBeforeCharacters",e[e.wordWrapColumn=109]="wordWrapColumn",e[e.wordWrapMinified=110]="wordWrapMinified",e[e.wrappingIndent=111]="wrappingIndent",e[e.wrappingStrategy=112]="wrappingStrategy", +e[e.showDeprecated=113]="showDeprecated",e[e.editorClassName=114]="editorClassName",e[e.pixelRatio=115]="pixelRatio",e[e.tabFocusMode=116]="tabFocusMode",e[e.layoutInfo=117]="layoutInfo",e[e.wrappingInfo=118]="wrappingInfo"}(t.EditorOption||(t.EditorOption={})),function(e){e[e.TextDefined=0]="TextDefined",e[e.LF=1]="LF",e[e.CRLF=2]="CRLF"}(t.EndOfLinePreference||(t.EndOfLinePreference={})),function(e){e[e.LF=0]="LF",e[e.CRLF=1]="CRLF"}(t.EndOfLineSequence||(t.EndOfLineSequence={})),function(e){e[e.None=0]="None",e[e.Indent=1]="Indent",e[e.IndentOutdent=2]="IndentOutdent",e[e.Outdent=3]="Outdent"}(t.IndentAction||(t.IndentAction={})),function(e){e[e.Unknown=0]="Unknown",e[e.Backspace=1]="Backspace",e[e.Tab=2]="Tab",e[e.Enter=3]="Enter",e[e.Shift=4]="Shift",e[e.Ctrl=5]="Ctrl",e[e.Alt=6]="Alt",e[e.PauseBreak=7]="PauseBreak",e[e.CapsLock=8]="CapsLock",e[e.Escape=9]="Escape",e[e.Space=10]="Space",e[e.PageUp=11]="PageUp",e[e.PageDown=12]="PageDown",e[e.End=13]="End",e[e.Home=14]="Home", +e[e.LeftArrow=15]="LeftArrow",e[e.UpArrow=16]="UpArrow",e[e.RightArrow=17]="RightArrow",e[e.DownArrow=18]="DownArrow",e[e.Insert=19]="Insert",e[e.Delete=20]="Delete",e[e.KEY_0=21]="KEY_0",e[e.KEY_1=22]="KEY_1",e[e.KEY_2=23]="KEY_2",e[e.KEY_3=24]="KEY_3",e[e.KEY_4=25]="KEY_4",e[e.KEY_5=26]="KEY_5",e[e.KEY_6=27]="KEY_6",e[e.KEY_7=28]="KEY_7",e[e.KEY_8=29]="KEY_8",e[e.KEY_9=30]="KEY_9",e[e.KEY_A=31]="KEY_A",e[e.KEY_B=32]="KEY_B",e[e.KEY_C=33]="KEY_C",e[e.KEY_D=34]="KEY_D",e[e.KEY_E=35]="KEY_E",e[e.KEY_F=36]="KEY_F",e[e.KEY_G=37]="KEY_G",e[e.KEY_H=38]="KEY_H",e[e.KEY_I=39]="KEY_I",e[e.KEY_J=40]="KEY_J",e[e.KEY_K=41]="KEY_K",e[e.KEY_L=42]="KEY_L",e[e.KEY_M=43]="KEY_M",e[e.KEY_N=44]="KEY_N",e[e.KEY_O=45]="KEY_O",e[e.KEY_P=46]="KEY_P",e[e.KEY_Q=47]="KEY_Q",e[e.KEY_R=48]="KEY_R",e[e.KEY_S=49]="KEY_S",e[e.KEY_T=50]="KEY_T",e[e.KEY_U=51]="KEY_U",e[e.KEY_V=52]="KEY_V",e[e.KEY_W=53]="KEY_W",e[e.KEY_X=54]="KEY_X",e[e.KEY_Y=55]="KEY_Y",e[e.KEY_Z=56]="KEY_Z",e[e.Meta=57]="Meta",e[e.ContextMenu=58]="ContextMenu", +e[e.F1=59]="F1",e[e.F2=60]="F2",e[e.F3=61]="F3",e[e.F4=62]="F4",e[e.F5=63]="F5",e[e.F6=64]="F6",e[e.F7=65]="F7",e[e.F8=66]="F8",e[e.F9=67]="F9",e[e.F10=68]="F10",e[e.F11=69]="F11",e[e.F12=70]="F12",e[e.F13=71]="F13",e[e.F14=72]="F14",e[e.F15=73]="F15",e[e.F16=74]="F16",e[e.F17=75]="F17",e[e.F18=76]="F18",e[e.F19=77]="F19",e[e.NumLock=78]="NumLock",e[e.ScrollLock=79]="ScrollLock",e[e.US_SEMICOLON=80]="US_SEMICOLON",e[e.US_EQUAL=81]="US_EQUAL",e[e.US_COMMA=82]="US_COMMA",e[e.US_MINUS=83]="US_MINUS",e[e.US_DOT=84]="US_DOT",e[e.US_SLASH=85]="US_SLASH",e[e.US_BACKTICK=86]="US_BACKTICK",e[e.US_OPEN_SQUARE_BRACKET=87]="US_OPEN_SQUARE_BRACKET",e[e.US_BACKSLASH=88]="US_BACKSLASH",e[e.US_CLOSE_SQUARE_BRACKET=89]="US_CLOSE_SQUARE_BRACKET",e[e.US_QUOTE=90]="US_QUOTE",e[e.OEM_8=91]="OEM_8",e[e.OEM_102=92]="OEM_102",e[e.NUMPAD_0=93]="NUMPAD_0",e[e.NUMPAD_1=94]="NUMPAD_1",e[e.NUMPAD_2=95]="NUMPAD_2",e[e.NUMPAD_3=96]="NUMPAD_3",e[e.NUMPAD_4=97]="NUMPAD_4",e[e.NUMPAD_5=98]="NUMPAD_5",e[e.NUMPAD_6=99]="NUMPAD_6", +e[e.NUMPAD_7=100]="NUMPAD_7",e[e.NUMPAD_8=101]="NUMPAD_8",e[e.NUMPAD_9=102]="NUMPAD_9",e[e.NUMPAD_MULTIPLY=103]="NUMPAD_MULTIPLY",e[e.NUMPAD_ADD=104]="NUMPAD_ADD",e[e.NUMPAD_SEPARATOR=105]="NUMPAD_SEPARATOR",e[e.NUMPAD_SUBTRACT=106]="NUMPAD_SUBTRACT",e[e.NUMPAD_DECIMAL=107]="NUMPAD_DECIMAL",e[e.NUMPAD_DIVIDE=108]="NUMPAD_DIVIDE",e[e.KEY_IN_COMPOSITION=109]="KEY_IN_COMPOSITION",e[e.ABNT_C1=110]="ABNT_C1",e[e.ABNT_C2=111]="ABNT_C2",e[e.MAX_VALUE=112]="MAX_VALUE"}(t.KeyCode||(t.KeyCode={})),function(e){e[e.Hint=1]="Hint",e[e.Info=2]="Info",e[e.Warning=4]="Warning",e[e.Error=8]="Error"}(t.MarkerSeverity||(t.MarkerSeverity={})),function(e){e[e.Unnecessary=1]="Unnecessary",e[e.Deprecated=2]="Deprecated"}(t.MarkerTag||(t.MarkerTag={})),function(e){e[e.Inline=1]="Inline",e[e.Gutter=2]="Gutter"}(t.MinimapPosition||(t.MinimapPosition={})),function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.TEXTAREA=1]="TEXTAREA",e[e.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",e[e.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS", +e[e.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",e[e.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",e[e.CONTENT_TEXT=6]="CONTENT_TEXT",e[e.CONTENT_EMPTY=7]="CONTENT_EMPTY",e[e.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",e[e.CONTENT_WIDGET=9]="CONTENT_WIDGET",e[e.OVERVIEW_RULER=10]="OVERVIEW_RULER",e[e.SCROLLBAR=11]="SCROLLBAR",e[e.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",e[e.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"}(t.MouseTargetType||(t.MouseTargetType={})),function(e){e[e.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",e[e.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",e[e.TOP_CENTER=2]="TOP_CENTER"}(t.OverlayWidgetPositionPreference||(t.OverlayWidgetPositionPreference={})),function(e){e[e.Left=1]="Left",e[e.Center=2]="Center",e[e.Right=4]="Right",e[e.Full=7]="Full"}(t.OverviewRulerLane||(t.OverviewRulerLane={})),function(e){e[e.Off=0]="Off",e[e.On=1]="On",e[e.Relative=2]="Relative",e[e.Interval=3]="Interval",e[e.Custom=4]="Custom"}(t.RenderLineNumbersType||(t.RenderLineNumbersType={})),function(e){e[e.None=0]="None", +e[e.Text=1]="Text",e[e.Blocks=2]="Blocks"}(t.RenderMinimap||(t.RenderMinimap={})),function(e){e[e.Smooth=0]="Smooth",e[e.Immediate=1]="Immediate"}(t.ScrollType||(t.ScrollType={})),function(e){e[e.Auto=1]="Auto",e[e.Hidden=2]="Hidden",e[e.Visible=3]="Visible"}(t.ScrollbarVisibility||(t.ScrollbarVisibility={})),function(e){e[e.LTR=0]="LTR",e[e.RTL=1]="RTL"}(t.SelectionDirection||(t.SelectionDirection={})),function(e){e[e.Invoke=1]="Invoke",e[e.TriggerCharacter=2]="TriggerCharacter",e[e.ContentChange=3]="ContentChange"}(t.SignatureHelpTriggerKind||(t.SignatureHelpTriggerKind={})),function(e){e[e.File=0]="File",e[e.Module=1]="Module",e[e.Namespace=2]="Namespace",e[e.Package=3]="Package",e[e.Class=4]="Class",e[e.Method=5]="Method",e[e.Property=6]="Property",e[e.Field=7]="Field",e[e.Constructor=8]="Constructor",e[e.Enum=9]="Enum",e[e.Interface=10]="Interface",e[e.Function=11]="Function",e[e.Variable=12]="Variable",e[e.Constant=13]="Constant",e[e.String=14]="String",e[e.Number=15]="Number",e[e.Boolean=16]="Boolean", +e[e.Array=17]="Array",e[e.Object=18]="Object",e[e.Key=19]="Key",e[e.Null=20]="Null",e[e.EnumMember=21]="EnumMember",e[e.Struct=22]="Struct",e[e.Event=23]="Event",e[e.Operator=24]="Operator",e[e.TypeParameter=25]="TypeParameter"}(t.SymbolKind||(t.SymbolKind={})),function(e){e[e.Deprecated=1]="Deprecated"}(t.SymbolTag||(t.SymbolTag={})),function(e){e[e.Hidden=0]="Hidden",e[e.Blink=1]="Blink",e[e.Smooth=2]="Smooth",e[e.Phase=3]="Phase",e[e.Expand=4]="Expand",e[e.Solid=5]="Solid"}(t.TextEditorCursorBlinkingStyle||(t.TextEditorCursorBlinkingStyle={})),function(e){e[e.Line=1]="Line",e[e.Block=2]="Block",e[e.Underline=3]="Underline",e[e.LineThin=4]="LineThin",e[e.BlockOutline=5]="BlockOutline",e[e.UnderlineThin=6]="UnderlineThin"}(t.TextEditorCursorStyle||(t.TextEditorCursorStyle={})),function(e){e[e.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",e[e.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",e[e.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore", +e[e.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"}(t.TrackedRangeStickiness||(t.TrackedRangeStickiness={})),function(e){e[e.None=0]="None",e[e.Same=1]="Same",e[e.Indent=2]="Indent",e[e.DeepIndent=3]="DeepIndent"}(t.WrappingIndent||(t.WrappingIndent={}))})),e(n[30],r([0,1,18,7,16,12,2,5,23,24,29]),(function(e,t,n,r,i,o,s,a,l,u,c){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMonacoBaseAPI=t.KeyMod=void 0;class d{static chord(e,t){return i.KeyChord(e,t)}}t.KeyMod=d,d.CtrlCmd=2048,d.Shift=1024,d.Alt=512,d.WinCtrl=256,t.createMonacoBaseAPI=function(){return{editor:void 0,languages:void 0,CancellationTokenSource:n.CancellationTokenSource,Emitter:r.Emitter,KeyCode:c.KeyCode,KeyMod:d,Position:s.Position,Range:a.Range,Selection:l.Selection,SelectionDirection:c.SelectionDirection,MarkerSeverity:c.MarkerSeverity,MarkerTag:c.MarkerTag,Uri:o.URI,Token:u.Token}}})),e(n[31],r([0,1,11]),(function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}), +t.PrefixSumComputer=t.PrefixSumIndexOfResult=void 0;class r{constructor(e,t){this.index=e,this.remainder=t}}t.PrefixSumIndexOfResult=r;t.PrefixSumComputer=class{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,t){e=n.toUint32(e);const r=this.values,i=this.prefixSum,o=t.length;return 0!==o&&(this.values=new Uint32Array(r.length+o),this.values.set(r.subarray(0,e),0),this.values.set(r.subarray(e),e+o),this.values.set(t,e),e-1=0&&this.prefixSum.set(i.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}changeValue(e,t){return e=n.toUint32(e),t=n.toUint32(t),this.values[e]!==t&&(this.values[e]=t,e-1=r.length)return!1;let o=r.length-e;return t>=o&&(t=o),0!==t&&(this.values=new Uint32Array(r.length-t),this.values.set(r.subarray(0,e),0),this.values.set(r.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1=0&&this.prefixSum.set(i.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalValue(){return 0===this.values.length?0:this._getAccumulatedValue(this.values.length-1)}getAccumulatedValue(e){return e<0?0:(e=n.toUint32(e),this._getAccumulatedValue(e))}_getAccumulatedValue(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let t=this.prefixSumValidIndex[0]+1;0===t&&(this.prefixSum[0]=this.values[0],t++),e>=this.values.length&&(e=this.values.length-1);for(let n=t;n<=e;n++)this.prefixSum[n]=this.prefixSum[n-1]+this.values[n];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalValue() +;let t=0,n=this.values.length-1,i=0,o=0,s=0;for(;t<=n;)if(i=t+(n-t)/2|0,e<(s=(o=this.prefixSum[i])-this.values[i]))n=i-1;else{if(!(e>=o))break;t=i+1}return new r(i,e-s)}}})),e(n[32],r([0,1,2,31]),(function(e,t,n,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MirrorTextModel=void 0;t.MirrorTextModel=class{constructor(e,t,n,r){this._uri=e,this._lines=t,this._eol=n,this._versionId=r,this._lineStarts=null,this._cachedTextValue=null}dispose(){this._lines.length=0}getText(){return null===this._cachedTextValue&&(this._cachedTextValue=this._lines.join(this._eol)),this._cachedTextValue}onEvents(e){e.eol&&e.eol!==this._eol&&(this._eol=e.eol,this._lineStarts=null);const t=e.changes;for(const e of t)this._acceptDeleteRange(e.range),this._acceptInsertText(new n.Position(e.range.startLineNumber,e.range.startColumn),e.text);this._versionId=e.versionId,this._cachedTextValue=null}_ensureLineStarts(){if(!this._lineStarts){const e=this._eol.length,t=this._lines.length,n=new Uint32Array(t) +;for(let r=0;rthis._lines.length)t=this._lines.length,n=this._lines[t-1].length+1,r=!0;else{let e=this._lines[t-1].length+1;n<1?(n=1,r=!0):n>e&&(n=e,r=!0)}return r?{lineNumber:t,column:n}:e}}class _{constructor(e,t){this._host=e,this._models=Object.create(null),this._foreignModuleFactory=t,this._foreignModule=null}dispose(){this._models=Object.create(null)}_getModel(e){return this._models[e]}_getModels(){let e=[];return Object.keys(this._models).forEach(t=>e.push(this._models[t])),e}acceptNewModel(e){this._models[e.url]=new p(o.URI.parse(e.url),e.lines,e.EOL,e.versionId)}acceptModelChanged(e,t){if(!this._models[e])return;this._models[e].onEvents(t)} +acceptRemovedModel(e){this._models[e]&&delete this._models[e]}computeDiff(e,t,n,r){return s(this,void 0,void 0,(function*(){const i=this._getModel(e),o=this._getModel(t);if(!i||!o)return null;const s=i.getLinesContent(),a=o.getLinesContent(),l=new u.DiffComputer(s,a,{shouldComputeCharChanges:!0,shouldPostProcessCharChanges:!0,shouldIgnoreTrimWhitespace:n,shouldMakePrettyDiff:!0,maxComputationTime:r}).computeDiff(),c=!(l.changes.length>0)&&this._modelsAreIdentical(i,o);return{quitEarly:l.quitEarly,identical:c,changes:l.changes}}))}_modelsAreIdentical(e,t){const n=e.getLineCount();if(n!==t.getLineCount())return!1;for(let r=1;r<=n;r++){if(e.getLineContent(r)!==t.getLineContent(r))return!1}return!0}computeMoreMinimalEdits(e,t){return s(this,void 0,void 0,(function*(){const i=this._getModel(e);if(!i)return t;const o=[];let s=void 0;t=n.mergeSort(t,(e,t)=>{if(e.range&&t.range)return l.Range.compareRangesUsingStarts(e.range,t.range);return(e.range?0:1)-(t.range?0:1)});for(let{range:e,text:n,eol:a}of t){ +if("number"==typeof a&&(s=a),l.Range.isEmpty(e)&&!n)continue;const t=i.getValueInRange(e);if(t===(n=n.replace(/\r\n|\n|\r/g,i.eol)))continue;if(Math.max(n.length,t.length)>_._diffLimit){o.push({range:e,text:n});continue}const u=r.stringDiff(t,n,!1),c=i.offsetAt(l.Range.lift(e).getStartPosition());for(const e of u){const t=i.positionAt(c+e.originalStart),r=i.positionAt(c+e.originalStart+e.originalLength),s={text:n.substr(e.modifiedStart,e.modifiedLength),range:{startLineNumber:t.lineNumber,startColumn:t.column,endLineNumber:r.lineNumber,endColumn:r.column}};i.getValueInRange(s.range)!==s.text&&o.push(s)}}return"number"==typeof s&&o.push({eol:s,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),o}))}computeLinks(e){return s(this,void 0,void 0,(function*(){let t=this._getModel(e);return t?h.computeLinks(t):null}))}textualSuggest(e,t,n,r){return s(this,void 0,void 0,(function*(){const i=this._getModel(e);if(!i)return null;const o=[],s=new Set,a=new RegExp(n,r),l=i.getWordAtPosition(t,a) +;l&&s.add(i.getValueInRange(l));for(let e of i.words(a))if(!s.has(e)&&(s.add(e),isNaN(Number(e))&&(o.push(e),s.size>_._suggestionsLimit)))break;return o}))}computeWordRanges(e,t,n,r){return s(this,void 0,void 0,(function*(){let i=this._getModel(e);if(!i)return Object.create(null);const o=new RegExp(n,r),s=Object.create(null);for(let e=t.startLineNumber;ethis._host.fhr(e,t)),getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(i,n),Promise.resolve(m.getAllMethodNames(this._foreignModule))):new Promise((r,o)=>{e([t],e=>{this._foreignModule=e.create(i,n),r(m.getAllMethodNames(this._foreignModule))},o)})}fmr(e,t){if(!this._foreignModule||"function"!=typeof this._foreignModule[e])return Promise.reject(new Error("Missing requestHandler or method: "+e));try{return Promise.resolve(this._foreignModule[e].apply(this._foreignModule,t))}catch(e){return Promise.reject(e)}}}t.EditorSimpleWorker=_,_._diffLimit=1e5,_._suggestionsLimit=1e4,t.create=function(e){return new _(e,null)},"function"==typeof importScripts&&(i.globals.monaco=g.createMonacoBaseAPI())})),function(){let e=self.MonacoEnvironment,t=e&&e.baseUrl?e.baseUrl:"../../../" +;"function"==typeof self.define&&self.define.amd||importScripts(t+"vs/loader.js"),require.config({baseUrl:t,catchError:!0});let n=!0,r=[];self.onmessage=e=>{n?(n=!1,function(e){require([e],(function(e){setTimeout((function(){let t=e.create((e,t)=>{self.postMessage(e,t)},null);for(self.onmessage=e=>t.onmessage(e.data);r.length>0;)self.onmessage(r.shift())}),0)}))}(e.data)):r.push(e)}}()}).call(this); +//# sourceMappingURL=../../../../min-maps/vs/base/worker/workerMain.js.map \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/abap/abap.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/abap/abap.js new file mode 100644 index 0000000..6dee81b --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/abap/abap.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/abap/abap",["require","exports"],(function(e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.language=n.conf=void 0,n.conf={comments:{lineComment:"*"},brackets:[["[","]"],["(",")"]]};n.language={defaultToken:"invalid",ignoreCase:!0,tokenPostfix:".abap",keywords:["abap-source","abbreviated","abstract","accept","accepting","according","activation","actual","add","add-corresponding","adjacent","after","alias","aliases","align","all","allocate","alpha","analysis","analyzer","append","appendage","appending","application","archive","area","arithmetic","as","ascending","aspect","assert","assign","assigned","assigning","association","asynchronous","at","attributes","authority","authority-check","avg","back","background","backup","backward","badi","base","before","begin","big","binary","bintohex","bit","black","blank","blanks","blob","block","blocks","blue","bound","boundaries","bounds","boxed","break-point","buffer","by","bypassing","byte","byte-order","call","calling","case","cast","casting","catch","center","centered","chain","chain-input","chain-request","change","changing","channels","character","char-to-hex","check","checkbox","ci_","circular","class","class-coding","class-data","class-events","class-methods","class-pool","cleanup","clear","client","clob","clock","close","coalesce","code","coding","col_background","col_group","col_heading","col_key","col_negative","col_normal","col_positive","col_total","collect","color","column","columns","comment","comments","commit","common","communication","comparing","component","components","compression","compute","concat","concat_with_space","concatenate","cond","condition","connect","connection","constants","context","contexts","continue","control","controls","conv","conversion","convert","copies","copy","corresponding","country","cover","cpi","create","creating","critical","currency","currency_conversion","current","cursor","cursor-selection","customer","customer-function","dangerous","data","database","datainfo","dataset","date","dats_add_days","dats_add_months","dats_days_between","dats_is_valid","daylight","dd/mm/yy","dd/mm/yyyy","ddmmyy","deallocate","decimal_shift","decimals","declarations","deep","default","deferred","define","defining","definition","delete","deleting","demand","department","descending","describe","destination","detail","dialog","directory","disconnect","display","display-mode","distinct","divide","divide-corresponding","division","do","dummy","duplicate","duplicates","duration","during","dynamic","dynpro","edit","editor-call","else","elseif","empty","enabled","enabling","encoding","end","endat","endcase","endcatch","endchain","endclass","enddo","endenhancement","end-enhancement-section","endexec","endform","endfunction","endian","endif","ending","endinterface","end-lines","endloop","endmethod","endmodule","end-of-definition","end-of-editing","end-of-file","end-of-page","end-of-selection","endon","endprovide","endselect","end-test-injection","end-test-seam","endtry","endwhile","endwith","engineering","enhancement","enhancement-point","enhancements","enhancement-section","entries","entry","enum","environment","errormessage","errors","escaping","event","events","exact","except","exception","exceptions","exception-table","exclude","excluding","exec","execute","exists","exit","exit-command","expand","expanding","expiration","explicit","exponent","export","exporting","extend","extended","extension","extract","fail","fetch","field","field-groups","fields","field-symbol","field-symbols","file","filter","filters","filter-table","final","first","first-line","fixed-point","fkeq","fkge","flush","font","for","form","format","forward","found","frame","frames","free","friends","from","function","functionality","function-pool","further","gaps","generate","get","giving","gkeq","gkge","global","grant","green","group","groups","handle","handler","harmless","hashed","having","hdb","header","headers","heading","head-lines","help-id","help-request","hextobin","hide","high","hint","hold","hotspot","icon","id","identification","identifier","ids","if","ignore","ignoring","immediately","implementation","implementations","implemented","implicit","import","importing","inactive","incl","include","includes","including","increment","index","index-line","infotypes","inheriting","init","initial","initialization","inner","inout","input","instance","instances","instr","intensified","interface","interface-pool","interfaces","internal","intervals","into","inverse","inverted-date","is","iso","job","join","keep","keeping","kernel","key","keys","keywords","kind","language","last","late","layout","leading","leave","left","left-justified","leftplus","leftspace","legacy","length","let","level","levels","like","line","line-count","linefeed","line-selection","line-size","list","listbox","list-processing","little","llang","load","load-of-program","lob","local","locale","locator","logfile","logical","log-point","long","loop","low","lower","lpad","lpi","ltrim","mail","main","major-id","mapping","margin","mark","mask","matchcode","max","maximum","medium","members","memory","mesh","message","message-id","messages","messaging","method","methods","min","minimum","minor-id","mm/dd/yy","mm/dd/yyyy","mmddyy","mode","modif","modifier","modify","module","move","move-corresponding","multiply","multiply-corresponding","name","nametab","native","nested","nesting","new","new-line","new-page","new-section","next","no","node","nodes","no-display","no-extension","no-gap","no-gaps","no-grouping","no-heading","non-unicode","non-unique","no-scrolling","no-sign","no-title","no-topofpage","no-zero","null","number","object","objects","obligatory","occurrence","occurrences","occurs","of","off","offset","ole","on","only","open","option","optional","options","order","other","others","out","outer","output","output-length","overflow","overlay","pack","package","pad","padding","page","pages","parameter","parameters","parameter-table","part","partially","pattern","percentage","perform","performing","person","pf1","pf10","pf11","pf12","pf13","pf14","pf15","pf2","pf3","pf4","pf5","pf6","pf7","pf8","pf9","pf-status","pink","places","pool","pos_high","pos_low","position","pragmas","precompiled","preferred","preserving","primary","print","print-control","priority","private","procedure","process","program","property","protected","provide","public","push","pushbutton","put","queue-only","quickinfo","radiobutton","raise","raising","range","ranges","read","reader","read-only","receive","received","receiver","receiving","red","redefinition","reduce","reduced","ref","reference","refresh","regex","reject","remote","renaming","replacement","replacing","report","request","requested","reserve","reset","resolution","respecting","responsible","result","results","resumable","resume","retry","return","returncode","returning","returns","right","right-justified","rightplus","rightspace","risk","rmc_communication_failure","rmc_invalid_status","rmc_system_failure","role","rollback","rows","rpad","rtrim","run","sap","sap-spool","saving","scale_preserving","scale_preserving_scientific","scan","scientific","scientific_with_leading_zero","scroll","scroll-boundary","scrolling","search","secondary","seconds","section","select","selection","selections","selection-screen","selection-set","selection-sets","selection-table","select-options","send","separate","separated","set","shared","shift","short","shortdump-id","sign_as_postfix","single","size","skip","skipping","smart","some","sort","sortable","sorted","source","specified","split","spool","spots","sql","sqlscript","stable","stamp","standard","starting","start-of-editing","start-of-selection","state","statement","statements","static","statics","statusinfo","step-loop","stop","structure","structures","style","subkey","submatches","submit","subroutine","subscreen","subtract","subtract-corresponding","suffix","sum","summary","summing","supplied","supply","suppress","switch","switchstates","symbol","syncpoints","syntax","syntax-check","syntax-trace","system-call","system-exceptions","system-exit","tab","tabbed","tables","tableview","tabstrip","target","task","tasks","test","testing","test-injection","test-seam","text","textpool","then","throw","time","times","timestamp","timezone","tims_is_valid","title","titlebar","title-lines","to","tokenization","tokens","top-lines","top-of-page","trace-file","trace-table","trailing","transaction","transfer","transformation","transporting","trmac","truncate","truncation","try","tstmp_add_seconds","tstmp_current_utctimestamp","tstmp_is_valid","tstmp_seconds_between","type","type-pool","type-pools","types","uline","unassign","under","unicode","union","unique","unit_conversion","unix","unpack","until","unwind","up","update","upper","user","user-command","using","utf-8","valid","value","value-request","values","vary","varying","verification-message","version","via","view","visible","wait","warning","when","whenever","where","while","width","window","windows","with","with-heading","without","with-title","word","work","write","writer","xml","xsd","yellow","yes","yymmdd","zero","zone","abs","acos","asin","atan","bit-set","boolc","boolx","ceil","char_off","charlen","cmax","cmin","concat_lines_of","condense","contains","contains_any_not_of","contains_any_of","cos","cosh","count","count_any_not_of","count_any_of","dbmaxlen","distance","escape","exp","find","find_any_not_of","find_any_of","find_end","floor","frac","from_mixed","insert","ipow","line_exists","line_index","lines","log","log10","match","matches","nmax","nmin","numofchar","repeat","replace","rescale","reverse","round","segment","shift_left","shift_right","sign","sin","sinh","sqrt","strlen","substring","substring_after","substring_before","substring_from","substring_to","tan","tanh","to_lower","to_mixed","to_upper","translate","trunc","utclong_add","utclong_current","utclong_diff","xsdbool","xstrlen"],typeKeywords:["b","c","d","decfloat16","decfloat34","f","i","int8","n","p","s","string","t","utclong","x","xstring","any","clike","csequence","decfloat","numeric","simple","xsequence","table","hashed","index","sorted","standard","accp","char","clnt","cuky","curr","dats","dec","df16_dec","df16_raw","df34_dec","df34_raw","fltp","int1","int2","int4","lang","lchr","lraw","numc","quan","raw","rawstring","sstring","tims","unit","df16_scl","df34_scl","prec","varc","abap_bool","space","me","syst","sy","screen"],operators:[" +"," -","/","*","**","div","mod","=","#","@","&","&&","bit-and","bit-not","bit-or","bit-xor","m","o","z","and","equiv","not","or"," < "," > ","<=",">=","<>","><","=<","=>","between","bt","byte-ca","byte-cn","byte-co","byte-cs","byte-na","byte-ns","ca","cn","co","cp","cs","eq","ge","gt","in","le","lt","na","nb","ne","np","ns"],symbols:/[=>/,"identifier"],{include:"@whitespace"},[/[:,.]/,"delimiter"],[/[{}()\[\]]/,"@brackets"],[/@symbols/,{cases:{"@operators":"operator","@default":""}}],[/'/,{token:"string",bracket:"@open",next:"@stringquote"}],[/`/,{token:"string",bracket:"@open",next:"@stringping"}],[/\|/,{token:"string",bracket:"@open",next:"@stringtemplate"}],[/\d+/,"number"]],stringtemplate:[[/[^\\\|]+/,"string"],[/\\\|/,"string"],[/\|/,{token:"string",bracket:"@close",next:"@pop"}]],stringping:[[/[^\\`]+/,"string"],[/`/,{token:"string",bracket:"@close",next:"@pop"}]],stringquote:[[/[^\\']+/,"string"],[/'/,{token:"string",bracket:"@close",next:"@pop"}]],whitespace:[[/[ \t\r\n]+/,""],[/^\*.*$/,"comment"],[/\".*$/,"comment"]]}}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/apex/apex.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/apex/apex.js new file mode 100644 index 0000000..4bfac9d --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/apex/apex.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/apex/apex",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.language=t.conf=void 0,t.conf={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"<",close:">"}],folding:{markers:{start:new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:))")}}};var s=[];["abstract","activate","and","any","array","as","asc","assert","autonomous","begin","bigdecimal","blob","boolean","break","bulk","by","case","cast","catch","char","class","collect","commit","const","continue","convertcurrency","decimal","default","delete","desc","do","double","else","end","enum","exception","exit","export","extends","false","final","finally","float","for","from","future","get","global","goto","group","having","hint","if","implements","import","in","inner","insert","instanceof","int","interface","into","join","last_90_days","last_month","last_n_days","last_week","like","limit","list","long","loop","map","merge","native","new","next_90_days","next_month","next_n_days","next_week","not","null","nulls","number","object","of","on","or","outer","override","package","parallel","pragma","private","protected","public","retrieve","return","returning","rollback","savepoint","search","select","set","short","sort","stat","static","strictfp","super","switch","synchronized","system","testmethod","then","this","this_month","this_week","throw","throws","today","tolabel","tomorrow","transaction","transient","trigger","true","try","type","undelete","update","upsert","using","virtual","void","volatile","webservice","when","where","while","yesterday"].forEach((function(e){s.push(e),s.push(e.toUpperCase()),s.push(function(e){return e.charAt(0).toUpperCase()+e.substr(1)}(e))})),t.language={defaultToken:"",tokenPostfix:".apex",keywords:s,operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],symbols:/[=>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/@\s*[a-zA-Z_\$][\w\$]*/,"annotation"],[/(@digits)[eE]([\-+]?(@digits))?[fFdD]?/,"number.float"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?[fFdD]?/,"number.float"],[/(@digits)[fFdD]/,"number.float"],[/(@digits)[lL]?/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string",'@string."'],[/'/,"string","@string.'"],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@apexdoc"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],apexdoc:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],string:[[/[^\\"']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/["']/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}]]}}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/azcli/azcli.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/azcli/azcli.js new file mode 100644 index 0000000..81fe406 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/azcli/azcli.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/azcli/azcli",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.language=t.conf=void 0,t.conf={comments:{lineComment:"#"}},t.language={defaultToken:"keyword",ignoreCase:!0,tokenPostfix:".azcli",str:/[^#\s]/,tokenizer:{root:[{include:"@comment"},[/\s-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":{token:"key.identifier",next:"@type"}}}],[/^-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":{token:"key.identifier",next:"@type"}}}]],type:[{include:"@comment"},[/-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":"key.identifier"}}],[/@str+\s*/,{cases:{"@eos":{token:"string",next:"@popall"},"@default":"string"}}]],comment:[[/#.*$/,{cases:{"@eos":{token:"comment",next:"@popall"}}}]]}}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/bat/bat.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/bat/bat.js new file mode 100644 index 0000000..3092ee4 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/bat/bat.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/bat/bat",["require","exports"],(function(e,s){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.language=s.conf=void 0,s.conf={comments:{lineComment:"REM"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}],surroundingPairs:[{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}],folding:{markers:{start:new RegExp("^\\s*(::\\s*|REM\\s+)#region"),end:new RegExp("^\\s*(::\\s*|REM\\s+)#endregion")}}},s.language={defaultToken:"",ignoreCase:!0,tokenPostfix:".bat",brackets:[{token:"delimiter.bracket",open:"{",close:"}"},{token:"delimiter.parenthesis",open:"(",close:")"},{token:"delimiter.square",open:"[",close:"]"}],keywords:/call|defined|echo|errorlevel|exist|for|goto|if|pause|set|shift|start|title|not|pushd|popd/,symbols:/[=>"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"}]},o.language={defaultToken:"",tokenPostfix:".cameligo",ignoreCase:!0,brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],keywords:["abs","begin","Bytes","Crypto","Current","else","end","failwith","false","fun","if","in","let","let%entry","let%init","List","list","Map","map","match","match%nat","mod","not","operation","Operation","of","Set","set","sender","source","String","then","true","type","with"],typeKeywords:["int","unit","string","tz"],operators:["=",">","<","<=",">=","<>",":",":=","and","mod","or","+","-","*","/","@","&","^","%","->","<-"],symbols:/[=><:@\^&|+\-*\/\^%]+/,tokenizer:{root:[[/[a-zA-Z_][\w]*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"identifier"}}],{include:"@whitespace"},[/[{}()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/\$[0-9a-fA-F]{1,16}/,"number.hex"],[/\d+/,"number"],[/[;,.]/,"delimiter"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/'/,"string","@string"],[/'[^\\']'/,"string"],[/'/,"string.invalid"],[/\#\d+/,"string"]],comment:[[/[^\(\*]+/,"comment"],[/\*\)/,"comment","@pop"],[/\(\*/,"comment"]],string:[[/[^\\']+/,"string"],[/\\./,"string.escape.invalid"],[/'/,{token:"string.quote",bracket:"@close",next:"@pop"}]],whitespace:[[/[ \t\r\n]+/,"white"],[/\(\*/,"comment","@comment"],[/\/\/.*$/,"comment"]]}}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/clojure/clojure.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/clojure/clojure.js new file mode 100644 index 0000000..3b66c81 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/clojure/clojure.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/clojure/clojure",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.language=t.conf=void 0,t.conf={comments:{lineComment:";;"},brackets:[["[","]"],["(",")"],["{","}"]],autoClosingPairs:[{open:"[",close:"]"},{open:'"',close:'"'},{open:"(",close:")"},{open:"{",close:"}"}],surroundingPairs:[{open:"[",close:"]"},{open:'"',close:'"'},{open:"(",close:")"},{open:"{",close:"}"}]},t.language={defaultToken:"",ignoreCase:!0,tokenPostfix:".clj",brackets:[{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"{",close:"}",token:"delimiter.curly"}],constants:["true","false","nil"],numbers:/^(?:[+\-]?\d+(?:(?:N|(?:[eE][+\-]?\d+))|(?:\.?\d*(?:M|(?:[eE][+\-]?\d+))?)|\/\d+|[xX][0-9a-fA-F]+|r[0-9a-zA-Z]+)?(?=[\\\[\]\s"#'(),;@^`{}~]|$))/,characters:/^(?:\\(?:backspace|formfeed|newline|return|space|tab|o[0-7]{3}|u[0-9A-Fa-f]{4}|x[0-9A-Fa-f]{4}|.)?(?=[\\\[\]\s"(),;@^`{}~]|$))/,escapes:/^\\(?:["'\\bfnrt]|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,qualifiedSymbols:/^(?:(?:[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*(?:\.[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*\/)?(?:\/|[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*(?=[\\\[\]\s"(),;@^`{}~]|$))/,specialForms:[".","catch","def","do","if","monitor-enter","monitor-exit","new","quote","recur","set!","throw","try","var"],coreSymbols:["*","*'","*1","*2","*3","*agent*","*allow-unresolved-vars*","*assert*","*clojure-version*","*command-line-args*","*compile-files*","*compile-path*","*compiler-options*","*data-readers*","*default-data-reader-fn*","*e","*err*","*file*","*flush-on-newline*","*fn-loader*","*in*","*math-context*","*ns*","*out*","*print-dup*","*print-length*","*print-level*","*print-meta*","*print-namespace-maps*","*print-readably*","*read-eval*","*reader-resolver*","*source-path*","*suppress-read*","*unchecked-math*","*use-context-classloader*","*verbose-defrecords*","*warn-on-reflection*","+","+'","-","-'","->","->>","->ArrayChunk","->Eduction","->Vec","->VecNode","->VecSeq","-cache-protocol-fn","-reset-methods","..","/","<","<=","=","==",">",">=","EMPTY-NODE","Inst","StackTraceElement->vec","Throwable->map","accessor","aclone","add-classpath","add-watch","agent","agent-error","agent-errors","aget","alength","alias","all-ns","alter","alter-meta!","alter-var-root","amap","ancestors","and","any?","apply","areduce","array-map","as->","aset","aset-boolean","aset-byte","aset-char","aset-double","aset-float","aset-int","aset-long","aset-short","assert","assoc","assoc!","assoc-in","associative?","atom","await","await-for","await1","bases","bean","bigdec","bigint","biginteger","binding","bit-and","bit-and-not","bit-clear","bit-flip","bit-not","bit-or","bit-set","bit-shift-left","bit-shift-right","bit-test","bit-xor","boolean","boolean-array","boolean?","booleans","bound-fn","bound-fn*","bound?","bounded-count","butlast","byte","byte-array","bytes","bytes?","case","cast","cat","char","char-array","char-escape-string","char-name-string","char?","chars","chunk","chunk-append","chunk-buffer","chunk-cons","chunk-first","chunk-next","chunk-rest","chunked-seq?","class","class?","clear-agent-errors","clojure-version","coll?","comment","commute","comp","comparator","compare","compare-and-set!","compile","complement","completing","concat","cond","cond->","cond->>","condp","conj","conj!","cons","constantly","construct-proxy","contains?","count","counted?","create-ns","create-struct","cycle","dec","dec'","decimal?","declare","dedupe","default-data-readers","definline","definterface","defmacro","defmethod","defmulti","defn","defn-","defonce","defprotocol","defrecord","defstruct","deftype","delay","delay?","deliver","denominator","deref","derive","descendants","destructure","disj","disj!","dissoc","dissoc!","distinct","distinct?","doall","dorun","doseq","dosync","dotimes","doto","double","double-array","double?","doubles","drop","drop-last","drop-while","eduction","empty","empty?","ensure","ensure-reduced","enumeration-seq","error-handler","error-mode","eval","even?","every-pred","every?","ex-data","ex-info","extend","extend-protocol","extend-type","extenders","extends?","false?","ffirst","file-seq","filter","filterv","find","find-keyword","find-ns","find-protocol-impl","find-protocol-method","find-var","first","flatten","float","float-array","float?","floats","flush","fn","fn?","fnext","fnil","for","force","format","frequencies","future","future-call","future-cancel","future-cancelled?","future-done?","future?","gen-class","gen-interface","gensym","get","get-in","get-method","get-proxy-class","get-thread-bindings","get-validator","group-by","halt-when","hash","hash-combine","hash-map","hash-ordered-coll","hash-set","hash-unordered-coll","ident?","identical?","identity","if-let","if-not","if-some","ifn?","import","in-ns","inc","inc'","indexed?","init-proxy","inst-ms","inst-ms*","inst?","instance?","int","int-array","int?","integer?","interleave","intern","interpose","into","into-array","ints","io!","isa?","iterate","iterator-seq","juxt","keep","keep-indexed","key","keys","keyword","keyword?","last","lazy-cat","lazy-seq","let","letfn","line-seq","list","list*","list?","load","load-file","load-reader","load-string","loaded-libs","locking","long","long-array","longs","loop","macroexpand","macroexpand-1","make-array","make-hierarchy","map","map-entry?","map-indexed","map?","mapcat","mapv","max","max-key","memfn","memoize","merge","merge-with","meta","method-sig","methods","min","min-key","mix-collection-hash","mod","munge","name","namespace","namespace-munge","nat-int?","neg-int?","neg?","newline","next","nfirst","nil?","nnext","not","not-any?","not-empty","not-every?","not=","ns","ns-aliases","ns-imports","ns-interns","ns-map","ns-name","ns-publics","ns-refers","ns-resolve","ns-unalias","ns-unmap","nth","nthnext","nthrest","num","number?","numerator","object-array","odd?","or","parents","partial","partition","partition-all","partition-by","pcalls","peek","persistent!","pmap","pop","pop!","pop-thread-bindings","pos-int?","pos?","pr","pr-str","prefer-method","prefers","primitives-classnames","print","print-ctor","print-dup","print-method","print-simple","print-str","printf","println","println-str","prn","prn-str","promise","proxy","proxy-call-with-super","proxy-mappings","proxy-name","proxy-super","push-thread-bindings","pvalues","qualified-ident?","qualified-keyword?","qualified-symbol?","quot","rand","rand-int","rand-nth","random-sample","range","ratio?","rational?","rationalize","re-find","re-groups","re-matcher","re-matches","re-pattern","re-seq","read","read-line","read-string","reader-conditional","reader-conditional?","realized?","record?","reduce","reduce-kv","reduced","reduced?","reductions","ref","ref-history-count","ref-max-history","ref-min-history","ref-set","refer","refer-clojure","reify","release-pending-sends","rem","remove","remove-all-methods","remove-method","remove-ns","remove-watch","repeat","repeatedly","replace","replicate","require","reset!","reset-meta!","reset-vals!","resolve","rest","restart-agent","resultset-seq","reverse","reversible?","rseq","rsubseq","run!","satisfies?","second","select-keys","send","send-off","send-via","seq","seq?","seqable?","seque","sequence","sequential?","set","set-agent-send-executor!","set-agent-send-off-executor!","set-error-handler!","set-error-mode!","set-validator!","set?","short","short-array","shorts","shuffle","shutdown-agents","simple-ident?","simple-keyword?","simple-symbol?","slurp","some","some->","some->>","some-fn","some?","sort","sort-by","sorted-map","sorted-map-by","sorted-set","sorted-set-by","sorted?","special-symbol?","spit","split-at","split-with","str","string?","struct","struct-map","subs","subseq","subvec","supers","swap!","swap-vals!","symbol","symbol?","sync","tagged-literal","tagged-literal?","take","take-last","take-nth","take-while","test","the-ns","thread-bound?","time","to-array","to-array-2d","trampoline","transduce","transient","tree-seq","true?","type","unchecked-add","unchecked-add-int","unchecked-byte","unchecked-char","unchecked-dec","unchecked-dec-int","unchecked-divide-int","unchecked-double","unchecked-float","unchecked-inc","unchecked-inc-int","unchecked-int","unchecked-long","unchecked-multiply","unchecked-multiply-int","unchecked-negate","unchecked-negate-int","unchecked-remainder-int","unchecked-short","unchecked-subtract","unchecked-subtract-int","underive","unquote","unquote-splicing","unreduced","unsigned-bit-shift-right","update","update-in","update-proxy","uri?","use","uuid?","val","vals","var-get","var-set","var?","vary-meta","vec","vector","vector-of","vector?","volatile!","volatile?","vreset!","vswap!","when","when-first","when-let","when-not","when-some","while","with-bindings","with-bindings*","with-in-str","with-loading-context","with-local-vars","with-meta","with-open","with-out-str","with-precision","with-redefs","with-redefs-fn","xml-seq","zero?","zipmap"],tokenizer:{root:[{include:"@whitespace"},[/@numbers/,"number"],[/@characters/,"string"],{include:"@string"},[/[()\[\]{}]/,"@brackets"],[/\/#"(?:\.|(?:")|[^"\n])*"\/g/,"regexp"],[/[#'@^`~]/,"meta"],[/@qualifiedSymbols/,{cases:{"^:.+$":"constant","@specialForms":"keyword","@coreSymbols":"keyword","@constants":"constant","@default":"identifier"}}]],whitespace:[[/[\s,]+/,"white"],[/;.*$/,"comment"],[/\(comment\b/,"comment","@comment"]],comment:[[/\(/,"comment","@push"],[/\)/,"comment","@pop"],[/[^()]/,"comment"]],string:[[/"/,"string","@multiLineString"]],multiLineString:[[/"/,"string","@popall"],[/@escapes/,"string.escape"],[/./,"string"]]}}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/coffee/coffee.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/coffee/coffee.js new file mode 100644 index 0000000..a161e8d --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/coffee/coffee.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/coffee/coffee",["require","exports"],(function(e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.language=n.conf=void 0,n.conf={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\$\-\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{blockComment:["###","###"],lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*#region\\b"),end:new RegExp("^\\s*#endregion\\b")}}},n.language={defaultToken:"",ignoreCase:!0,tokenPostfix:".coffee",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],regEx:/\/(?!\/\/)(?:[^\/\\]|\\.)*\/[igm]*/,keywords:["and","or","is","isnt","not","on","yes","@","no","off","true","false","null","this","new","delete","typeof","in","instanceof","return","throw","break","continue","debugger","if","else","switch","for","while","do","try","catch","finally","class","extends","super","undefined","then","unless","until","loop","of","by","when"],symbols:/[=>"}],keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","for","friend","gcnew","generic","goto","if","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],symbols:/[=>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/\d*\d+[eE]([\-+]?\d+)?(@floatsuffix)/,"number.float"],[/\d*\.\d+([eE][\-+]?\d+)?(@floatsuffix)/,"number.float"],[/0[xX][0-9a-fA-F']*[0-9a-fA-F](@integersuffix)/,"number.hex"],[/0[0-7']*[0-7](@integersuffix)/,"number.octal"],[/0[bB][0-1']*[0-1](@integersuffix)/,"number.binary"],[/\d[\d']*\d(@integersuffix)/,"number"],[/\d(@integersuffix)/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string"],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@doccomment"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],doccomment:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],raw:[[/(.*)(\))(?:([^ ()\\\t"]*))(\")/,{cases:{"$3==$S2":["string.raw","string.raw.end","string.raw.end",{token:"string.raw.end",next:"@pop"}],"@default":["string.raw","string.raw","string.raw","string.raw"]}}],[/.*/,"string.raw"]],include:[[/(\s*)(<)([^<>]*)(>)/,["","keyword.directive.include.begin","string.include.identifier",{token:"keyword.directive.include.end",next:"@pop"}]],[/(\s*)(")([^"]*)(")/,["","keyword.directive.include.begin","string.include.identifier",{token:"keyword.directive.include.end",next:"@pop"}]]]}}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/csharp/csharp.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/csharp/csharp.js new file mode 100644 index 0000000..7de9c41 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/csharp/csharp.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/csharp/csharp",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.language=t.conf=void 0,t.conf={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\#\$\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'}],folding:{markers:{start:new RegExp("^\\s*#region\\b"),end:new RegExp("^\\s*#endregion\\b")}}},t.language={defaultToken:"",tokenPostfix:".cs",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],keywords:["extern","alias","using","bool","decimal","sbyte","byte","short","ushort","int","uint","long","ulong","char","float","double","object","dynamic","string","assembly","is","as","ref","out","this","base","new","typeof","void","checked","unchecked","default","delegate","var","const","if","else","switch","case","while","do","for","foreach","in","break","continue","goto","return","throw","try","catch","finally","lock","yield","from","let","where","join","on","equals","into","orderby","ascending","descending","select","group","by","namespace","partial","class","field","event","method","param","property","public","protected","internal","private","abstract","sealed","static","struct","readonly","volatile","virtual","override","params","get","set","add","remove","operator","true","false","implicit","explicit","interface","enum","null","async","await","fixed","sizeof","stackalloc","unsafe","nameof","when"],namespaceFollows:["namespace","using"],parenFollows:["if","for","while","switch","foreach","using","catch","when"],operators:["=","??","||","&&","|","^","&","==","!=","<=",">=","<<","+","-","*","/","%","!","~","++","--","+=","-=","*=","/=","%=","&=","|=","^=","<<=",">>=",">>","=>"],symbols:/[=>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/[0-9_]*\.[0-9_]+([eE][\-+]?\d+)?[fFdD]?/,"number.float"],[/0[xX][0-9a-fA-F_]+/,"number.hex"],[/0[bB][01_]+/,"number.hex"],[/[0-9_]+/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,{token:"string.quote",next:"@string"}],[/\$\@"/,{token:"string.quote",next:"@litinterpstring"}],[/\@"/,{token:"string.quote",next:"@litstring"}],[/\$"/,{token:"string.quote",next:"@interpolatedstring"}],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],qualified:[[/[a-zA-Z_][\w]*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"identifier"}}],[/\./,"delimiter"],["","","@pop"]],namespace:[{include:"@whitespace"},[/[A-Z]\w*/,"namespace"],[/[\.=]/,"delimiter"],["","","@pop"]],comment:[[/[^\/*]+/,"comment"],["\\*/","comment","@pop"],[/[\/*]/,"comment"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,{token:"string.quote",next:"@pop"}]],litstring:[[/[^"]+/,"string"],[/""/,"string.escape"],[/"/,{token:"string.quote",next:"@pop"}]],litinterpstring:[[/[^"{]+/,"string"],[/""/,"string.escape"],[/{{/,"string.escape"],[/}}/,"string.escape"],[/{/,{token:"string.quote",next:"root.litinterpstring"}],[/"/,{token:"string.quote",next:"@pop"}]],interpolatedstring:[[/[^\\"{]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/{{/,"string.escape"],[/}}/,"string.escape"],[/{/,{token:"string.quote",next:"root.interpolatedstring"}],[/"/,{token:"string.quote",next:"@pop"}]],whitespace:[[/^[ \t\v\f]*#((r)|(load))(?=\s)/,"directive.csx"],[/^[ \t\v\f]*#\w.*$/,"namespace.cpp"],[/[ \t\v\f\r\n]+/,""],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]]}}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/csp/csp.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/csp/csp.js new file mode 100644 index 0000000..0f4d3db --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/csp/csp.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/csp/csp",["require","exports"],(function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.language=e.conf=void 0,e.conf={brackets:[],autoClosingPairs:[],surroundingPairs:[]},e.language={keywords:[],typeKeywords:[],tokenPostfix:".csp",operators:[],symbols:/[=>",token:"delimiter.angle"}],tokenizer:{root:[{include:"@selector"}],selector:[{include:"@comments"},{include:"@import"},{include:"@strings"},["[@](keyframes|-webkit-keyframes|-moz-keyframes|-o-keyframes)",{token:"keyword",next:"@keyframedeclaration"}],["[@](page|content|font-face|-moz-document)",{token:"keyword"}],["[@](charset|namespace)",{token:"keyword",next:"@declarationbody"}],["(url-prefix)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],["(url)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],{include:"@selectorname"},["[\\*]","tag"],["[>\\+,]","delimiter"],["\\[",{token:"delimiter.bracket",next:"@selectorattribute"}],["{",{token:"delimiter.bracket",next:"@selectorbody"}]],selectorbody:[{include:"@comments"},["[*_]?@identifier@ws:(?=(\\s|\\d|[^{;}]*[;}]))","attribute.name","@rulevalue"],["}",{token:"delimiter.bracket",next:"@pop"}]],selectorname:[["(\\.|#(?=[^{])|%|(@identifier)|:)+","tag"]],selectorattribute:[{include:"@term"},["]",{token:"delimiter.bracket",next:"@pop"}]],term:[{include:"@comments"},["(url-prefix)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],["(url)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],{include:"@functioninvocation"},{include:"@numbers"},{include:"@name"},["([<>=\\+\\-\\*\\/\\^\\|\\~,])","delimiter"],[",","delimiter"]],rulevalue:[{include:"@comments"},{include:"@strings"},{include:"@term"},["!important","keyword"],[";","delimiter","@pop"],["(?=})",{token:"",next:"@pop"}]],warndebug:[["[@](warn|debug)",{token:"keyword",next:"@declarationbody"}]],import:[["[@](import)",{token:"keyword",next:"@declarationbody"}]],urldeclaration:[{include:"@strings"},["[^)\r\n]+","string"],["\\)",{token:"delimiter.parenthesis",next:"@pop"}]],parenthizedterm:[{include:"@term"},["\\)",{token:"delimiter.parenthesis",next:"@pop"}]],declarationbody:[{include:"@term"},[";","delimiter","@pop"],["(?=})",{token:"",next:"@pop"}]],comments:[["\\/\\*","comment","@comment"],["\\/\\/+.*","comment"]],comment:[["\\*\\/","comment","@pop"],[/[^*/]+/,"comment"],[/./,"comment"]],name:[["@identifier","attribute.value"]],numbers:[["-?(\\d*\\.)?\\d+([eE][\\-+]?\\d+)?",{token:"attribute.value.number",next:"@units"}],["#[0-9a-fA-F_]+(?!\\w)","attribute.value.hex"]],units:[["(em|ex|ch|rem|vmin|vmax|vw|vh|vm|cm|mm|in|px|pt|pc|deg|grad|rad|turn|s|ms|Hz|kHz|%)?","attribute.value.unit","@pop"]],keyframedeclaration:[["@identifier","attribute.value"],["{",{token:"delimiter.bracket",switchTo:"@keyframebody"}]],keyframebody:[{include:"@term"},["{",{token:"delimiter.bracket",next:"@selectorbody"}],["}",{token:"delimiter.bracket",next:"@pop"}]],functioninvocation:[["@identifier\\(",{token:"attribute.value",next:"@functionarguments"}]],functionarguments:[["\\$@identifier@ws:","attribute.name"],["[,]","delimiter"],{include:"@term"},["\\)",{token:"attribute.value",next:"@pop"}]],strings:[['~?"',{token:"string",next:"@stringenddoublequote"}],["~?'",{token:"string",next:"@stringendquote"}]],stringenddoublequote:[["\\\\.","string"],['"',{token:"string",next:"@pop"}],[/[^\\"]+/,"string"],[".","string"]],stringendquote:[["\\\\.","string"],["'",{token:"string",next:"@pop"}],[/[^\\']+/,"string"],[".","string"]]}}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/dart/dart.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/dart/dart.js new file mode 100644 index 0000000..3dc6c28 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/dart/dart.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/dart/dart",["require","exports"],(function(e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.language=n.conf=void 0,n.conf={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string"]},{open:"`",close:"`",notIn:["string","comment"]},{open:"/**",close:" */",notIn:["string"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"},{open:"(",close:")"},{open:'"',close:'"'},{open:"`",close:"`"}],folding:{markers:{start:/^\s*\s*#?region\b/,end:/^\s*\s*#?endregion\b/}}},n.language={defaultToken:"invalid",tokenPostfix:".dart",keywords:["abstract","dynamic","implements","show","as","else","import","static","assert","enum","in","super","async","export","interface","switch","await","extends","is","sync","break","external","library","this","case","factory","mixin","throw","catch","false","new","true","class","final","null","try","const","finally","on","typedef","continue","for","operator","var","covariant","Function","part","void","default","get","rethrow","while","deferred","hide","return","with","do","if","set","yield"],typeKeywords:["int","double","String","bool"],operators:["+","-","*","/","~/","%","++","--","==","!=",">","<",">=","<=","=","-=","/=","%=",">>=","^=","+=","*=","~/=","<<=","&=","!=","||","&&","&","|","^","~","<<",">>","!",">>>","??","?",":","|="],symbols:/[=>](?!@symbols)/,"@brackets"],[/!(?=([^=]|$))/,"delimiter"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/(@digits)[eE]([\-+]?(@digits))?/,"number.float"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?/,"number.float"],[/0[xX](@hexdigits)n?/,"number.hex"],[/0[oO]?(@octaldigits)n?/,"number.octal"],[/0[bB](@binarydigits)n?/,"number.binary"],[/(@digits)n?/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string_double"],[/'/,"string","@string_single"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@jsdoc"],[/\/\*/,"comment","@comment"],[/\/\/\/.*$/,"comment.doc"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],jsdoc:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],regexp:[[/(\{)(\d+(?:,\d*)?)(\})/,["regexp.escape.control","regexp.escape.control","regexp.escape.control"]],[/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/,["regexp.escape.control",{token:"regexp.escape.control",next:"@regexrange"}]],[/(\()(\?:|\?=|\?!)/,["regexp.escape.control","regexp.escape.control"]],[/[()]/,"regexp.escape.control"],[/@regexpctl/,"regexp.escape.control"],[/[^\\\/]/,"regexp"],[/@regexpesc/,"regexp.escape"],[/\\\./,"regexp.invalid"],[/(\/)([gimsuy]*)/,[{token:"regexp",bracket:"@close",next:"@pop"},"keyword.other"]]],regexrange:[[/-/,"regexp.escape.control"],[/\^/,"regexp.invalid"],[/@regexpesc/,"regexp.escape"],[/[^\]]/,"regexp"],[/\]/,{token:"regexp.escape.control",next:"@pop",bracket:"@close"}]],string_double:[[/[^\\"\$]+/,"string"],[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"],[/\$\w+/,"identifier"]],string_single:[[/[^\\'\$]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/'/,"string","@pop"],[/\$\w+/,"identifier"]]}}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/dockerfile/dockerfile.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/dockerfile/dockerfile.js new file mode 100644 index 0000000..c5827f2 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/dockerfile/dockerfile.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/dockerfile/dockerfile",["require","exports"],(function(e,o){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.language=o.conf=void 0,o.conf={brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},o.language={defaultToken:"",tokenPostfix:".dockerfile",variable:/\${?[\w]+}?/,tokenizer:{root:[{include:"@whitespace"},{include:"@comment"},[/(ONBUILD)(\s+)/,["keyword",""]],[/(ENV)(\s+)([\w]+)/,["keyword","",{token:"variable",next:"@arguments"}]],[/(FROM|MAINTAINER|RUN|EXPOSE|ENV|ADD|ARG|VOLUME|LABEL|USER|WORKDIR|COPY|CMD|STOPSIGNAL|SHELL|HEALTHCHECK|ENTRYPOINT)/,{token:"keyword",next:"@arguments"}]],arguments:[{include:"@whitespace"},{include:"@strings"},[/(@variable)/,{cases:{"@eos":{token:"variable",next:"@popall"},"@default":"variable"}}],[/\\/,{cases:{"@eos":"","@default":""}}],[/./,{cases:{"@eos":{token:"",next:"@popall"},"@default":""}}]],whitespace:[[/\s+/,{cases:{"@eos":{token:"",next:"@popall"},"@default":""}}]],comment:[[/(^#.*$)/,"comment","@popall"]],strings:[[/\\'$/,"","@popall"],[/\\'/,""],[/'$/,"string","@popall"],[/'/,"string","@stringBody"],[/"$/,"string","@popall"],[/"/,"string","@dblStringBody"]],stringBody:[[/[^\\\$']/,{cases:{"@eos":{token:"string",next:"@popall"},"@default":"string"}}],[/\\./,"string.escape"],[/'$/,"string","@popall"],[/'/,"string","@pop"],[/(@variable)/,"variable"],[/\\$/,"string"],[/$/,"string","@popall"]],dblStringBody:[[/[^\\\$"]/,{cases:{"@eos":{token:"string",next:"@popall"},"@default":"string"}}],[/\\./,"string.escape"],[/"$/,"string","@popall"],[/"/,"string","@pop"],[/(@variable)/,"variable"],[/\\$/,"string"],[/$/,"string","@popall"]]}}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/fsharp/fsharp.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/fsharp/fsharp.js new file mode 100644 index 0000000..f6f5696 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/fsharp/fsharp.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/fsharp/fsharp",["require","exports"],(function(e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.language=n.conf=void 0,n.conf={comments:{lineComment:"//",blockComment:["(*","*)"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*//\\s*#region\\b|^\\s*\\(\\*\\s*#region(.*)\\*\\)"),end:new RegExp("^\\s*//\\s*#endregion\\b|^\\s*\\(\\*\\s*#endregion\\s*\\*\\)")}}},n.language={defaultToken:"",tokenPostfix:".fs",keywords:["abstract","and","atomic","as","assert","asr","base","begin","break","checked","component","const","constraint","constructor","continue","class","default","delegate","do","done","downcast","downto","elif","else","end","exception","eager","event","external","extern","false","finally","for","fun","function","fixed","functor","global","if","in","include","inherit","inline","interface","internal","land","lor","lsl","lsr","lxor","lazy","let","match","member","mod","module","mutable","namespace","method","mixin","new","not","null","of","open","or","object","override","private","parallel","process","protected","pure","public","rec","return","static","sealed","struct","sig","then","to","true","tailcall","trait","try","type","upcast","use","val","void","virtual","volatile","when","while","with","yield"],symbols:/[=>\]/,"annotation"],[/^#(if|else|endif)/,"keyword"],[/[{}()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,"delimiter"],[/\d*\d+[eE]([\-+]?\d+)?(@floatsuffix)/,"number.float"],[/\d*\.\d+([eE][\-+]?\d+)?(@floatsuffix)/,"number.float"],[/0x[0-9a-fA-F]+LF/,"number.float"],[/0x[0-9a-fA-F]+(@integersuffix)/,"number.hex"],[/0b[0-1]+(@integersuffix)/,"number.bin"],[/\d+(@integersuffix)/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"""/,"string",'@string."""'],[/"/,"string",'@string."'],[/\@"/,{token:"string.quote",next:"@litstring"}],[/'[^\\']'B?/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\(\*(?!\))/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^*(]+/,"comment"],[/\*\)/,"comment","@pop"],[/\*/,"comment"],[/\(\*\)/,"comment"],[/\(/,"comment"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/("""|"B?)/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}]],litstring:[[/[^"]+/,"string"],[/""/,"string.escape"],[/"/,{token:"string.quote",next:"@pop"}]]}}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/go/go.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/go/go.js new file mode 100644 index 0000000..4d58596 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/go/go.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/go/go",["require","exports"],(function(e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.language=n.conf=void 0,n.conf={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"`",close:"`",notIn:["string"]},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"`",close:"`"},{open:'"',close:'"'},{open:"'",close:"'"}]},n.language={defaultToken:"",tokenPostfix:".go",keywords:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var","bool","true","false","uint8","uint16","uint32","uint64","int8","int16","int32","int64","float32","float64","complex64","complex128","byte","rune","uint","int","uintptr","string","nil"],operators:["+","-","*","/","%","&","|","^","<<",">>","&^","+=","-=","*=","/=","%=","&=","|=","^=","<<=",">>=","&^=","&&","||","<-","++","--","==","<",">","=","!","!=","<=",">=",":=","...","(",")","","]","{","}",",",";",".",":"],symbols:/[=>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/\d*\d+[eE]([\-+]?\d+)?/,"number.float"],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F']*[0-9a-fA-F]/,"number.hex"],[/0[0-7']*[0-7]/,"number.octal"],[/0[bB][0-1']*[0-1]/,"number.binary"],[/\d[\d']*/,"number"],[/\d/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string"],[/`/,"string","@rawstring"],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@doccomment"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],doccomment:[[/[^\/*]+/,"comment.doc"],[/\/\*/,"comment.doc.invalid"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],rawstring:[[/[^\`]/,"string"],[/`/,"string","@pop"]]}}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/graphql/graphql.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/graphql/graphql.js new file mode 100644 index 0000000..5d36db3 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/graphql/graphql.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/graphql/graphql",["require","exports"],(function(e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.language=n.conf=void 0,n.conf={comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"""',close:'"""',notIn:["string","comment"]},{open:'"',close:'"',notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"""',close:'"""'},{open:'"',close:'"'}],folding:{offSide:!0}},n.language={defaultToken:"invalid",tokenPostfix:".gql",keywords:["null","true","false","query","mutation","subscription","extend","schema","directive","scalar","type","interface","union","enum","input","implements","fragment","on"],typeKeywords:["Int","Float","String","Boolean","ID"],directiveLocations:["SCHEMA","SCALAR","OBJECT","FIELD_DEFINITION","ARGUMENT_DEFINITION","INTERFACE","UNION","ENUM","ENUM_VALUE","INPUT_OBJECT","INPUT_FIELD_DEFINITION","QUERY","MUTATION","SUBSCRIPTION","FIELD","FRAGMENT_DEFINITION","FRAGMENT_SPREAD","INLINE_FRAGMENT","VARIABLE_DEFINITION"],operators:["=","!","?",":","&","|"],symbols:/[=!?:&|]+/,escapes:/\\(?:["\\\/bfnrt]|u[0-9A-Fa-f]{4})/,tokenizer:{root:[[/[a-z_][\w$]*/,{cases:{"@keywords":"keyword","@default":"key.identifier"}}],[/[$][\w$]*/,{cases:{"@keywords":"keyword","@default":"argument.identifier"}}],[/[A-Z][\w\$]*/,{cases:{"@typeKeywords":"keyword","@default":"type.identifier"}}],{include:"@whitespace"},[/[{}()\[\]]/,"@brackets"],[/@symbols/,{cases:{"@operators":"operator","@default":""}}],[/@\s*[a-zA-Z_\$][\w\$]*/,{token:"annotation",log:"annotation token: $0"}],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F]+/,"number.hex"],[/\d+/,"number"],[/[;,.]/,"delimiter"],[/"""/,{token:"string",next:"@mlstring",nextEmbedded:"markdown"}],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,{token:"string.quote",bracket:"@open",next:"@string"}]],mlstring:[[/[^"]+/,"string"],['"""',{token:"string",next:"@pop",nextEmbedded:"@pop"}]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,{token:"string.quote",bracket:"@close",next:"@pop"}]],whitespace:[[/[ \t\r\n]+/,""],[/#.*$/,"comment"]]}}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/handlebars/handlebars.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/handlebars/handlebars.js new file mode 100644 index 0000000..4c6b148 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/handlebars/handlebars.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/handlebars/handlebars",["require","exports","../fillers/monaco-editor-core"],(function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.language=t.conf=void 0;var a=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"];t.conf={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:["{{!--","--}}"]},brackets:[["\x3c!--","--\x3e"],["<",">"],["{{","}}"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"}],onEnterRules:[{beforeText:new RegExp("<(?!(?:"+a.join("|")+"))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$","i"),afterText:/^<\/(\w[\w\d]*)\s*>$/i,action:{indentAction:n.languages.IndentAction.IndentOutdent}},{beforeText:new RegExp("<(?!(?:"+a.join("|")+"))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$","i"),action:{indentAction:n.languages.IndentAction.Indent}}]},t.language={defaultToken:"",tokenPostfix:"",tokenizer:{root:[[/\{\{!--/,"comment.block.start.handlebars","@commentBlock"],[/\{\{!/,"comment.start.handlebars","@comment"],[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.root"}],[/)/,["delimiter.html","tag.html","delimiter.html"]],[/(<)(script)/,["delimiter.html",{token:"tag.html",next:"@script"}]],[/(<)(style)/,["delimiter.html",{token:"tag.html",next:"@style"}]],[/(<)([:\w]+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/(<\/)(\w+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/]+/,"metatag.content.html"],[/>/,"metatag.html","@pop"]],comment:[[/\}\}/,"comment.end.handlebars","@pop"],[/./,"comment.content.handlebars"]],commentBlock:[[/--\}\}/,"comment.block.end.handlebars","@pop"],[/./,"comment.content.handlebars"]],commentHtml:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.comment"}],[/-->/,"comment.html","@pop"],[/[^-]+/,"comment.content.html"],[/./,"comment.content.html"]],otherTag:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.otherTag"}],[/\/?>/,"delimiter.html","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.script"}],[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],scriptAfterType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptAfterType"}],[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInEmbeddedState.scriptEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],style:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.style"}],[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],styleAfterType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleAfterType"}],[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInEmbeddedState.styleEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],handlebarsInSimpleState:[[/\{\{\{?/,"delimiter.handlebars"],[/\}\}\}?/,{token:"delimiter.handlebars",switchTo:"@$S2.$S3"}],{include:"handlebarsRoot"}],handlebarsInEmbeddedState:[[/\{\{\{?/,"delimiter.handlebars"],[/\}\}\}?/,{token:"delimiter.handlebars",switchTo:"@$S2.$S3",nextEmbedded:"$S3"}],{include:"handlebarsRoot"}],handlebarsRoot:[[/"[^"]*"/,"string.handlebars"],[/[#/][^\s}]+/,"keyword.helper.handlebars"],[/else\b/,"keyword.helper.handlebars"],[/[\s]+/],[/[^}]/,"variable.parameter.handlebars"]]}}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/hcl/hcl.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/hcl/hcl.js new file mode 100644 index 0000000..73b42dc --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/hcl/hcl.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/hcl/hcl",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.language=t.conf=void 0,t.conf={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}]},t.language={defaultToken:"",tokenPostfix:".hcl",keywords:["var","local","path","for_each","any","string","number","bool","true","false","null","if ","else ","endif ","for ","in","endfor"],operators:["=",">=","<=","==","!=","+","-","*","/","%","&&","||","!","<",">","?","...",":"],symbols:/[=>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"operator","@default":""}}],[/\d*\d+[eE]([\-+]?\d+)?/,"number.float"],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/\d[\d']*/,"number"],[/\d/,"number"],[/[;,.]/,"delimiter"],[/"/,"string","@string"],[/'/,"invalid"]],heredoc:[[/<<[-]*\s*["]?([\w\-]+)["]?/,{token:"string.heredoc.delimiter",next:"@heredocBody.$1"}]],heredocBody:[[/^([\w\-]+)$/,{cases:{"$1==$S2":[{token:"string.heredoc.delimiter",next:"@popall"}],"@default":"string.heredoc"}}],[/./,"string.heredoc"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"],[/#.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],string:[[/\$\{/,{token:"delimiter",next:"@stringExpression"}],[/[^\\"\$]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@popall"]],stringInsideExpression:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],stringExpression:[[/\}/,{token:"delimiter",next:"@pop"}],[/"/,"string","@stringInsideExpression"],{include:"@terraform"}]}}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/html/html.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/html/html.js new file mode 100644 index 0000000..c33003d --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/html/html.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/html/html",["require","exports","../fillers/monaco-editor-core"],(function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.language=t.conf=void 0;var i=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"];t.conf={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:["\x3c!--","--\x3e"]},brackets:[["\x3c!--","--\x3e"],["<",">"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:'"',close:'"'},{open:"'",close:"'"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"}],onEnterRules:[{beforeText:new RegExp("<(?!(?:"+i.join("|")+"))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$","i"),afterText:/^<\/([_:\w][_:\w-.\d]*)\s*>$/i,action:{indentAction:n.languages.IndentAction.IndentOutdent}},{beforeText:new RegExp("<(?!(?:"+i.join("|")+"))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$","i"),action:{indentAction:n.languages.IndentAction.Indent}}],folding:{markers:{start:new RegExp("^\\s*\x3c!--\\s*#region\\b.*--\x3e"),end:new RegExp("^\\s*\x3c!--\\s*#endregion\\b.*--\x3e")}}},t.language={defaultToken:"",tokenPostfix:".html",ignoreCase:!0,tokenizer:{root:[[/)/,["delimiter","tag","","delimiter"]],[/(<)(script)/,["delimiter",{token:"tag",next:"@script"}]],[/(<)(style)/,["delimiter",{token:"tag",next:"@style"}]],[/(<)((?:[\w\-]+:)?[\w\-]+)/,["delimiter",{token:"tag",next:"@otherTag"}]],[/(<\/)((?:[\w\-]+:)?[\w\-]+)/,["delimiter",{token:"tag",next:"@otherTag"}]],[/]+/,"metatag.content"],[/>/,"metatag","@pop"]],comment:[[/-->/,"comment","@pop"],[/[^-]+/,"comment.content"],[/./,"comment.content"]],otherTag:[[/\/?>/,"delimiter","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter","tag",{token:"delimiter",next:"@pop"}]]],scriptAfterType:[[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/>/,{token:"delimiter",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]],style:[[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter","tag",{token:"delimiter",next:"@pop"}]]],styleAfterType:[[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/>/,{token:"delimiter",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]]}}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/ini/ini.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/ini/ini.js new file mode 100644 index 0000000..ff3c856 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/ini/ini.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/ini/ini",["require","exports"],(function(e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.language=n.conf=void 0,n.conf={comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},n.language={defaultToken:"",tokenPostfix:".ini",escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[[/^\[[^\]]*\]/,"metatag"],[/(^\w+)(\s*)(\=)/,["key","","delimiter"]],{include:"@whitespace"},[/\d+/,"number"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string",'@string."'],[/'/,"string","@string.'"]],whitespace:[[/[ \t\r\n]+/,""],[/^\s*[#;].*$/,"comment"]],string:[[/[^\\"']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/["']/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}]]}}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/java/java.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/java/java.js new file mode 100644 index 0000000..7d8e49d --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/java/java.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/java/java",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.language=t.conf=void 0,t.conf={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"<",close:">"}],folding:{markers:{start:new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:))")}}},t.language={defaultToken:"",tokenPostfix:".java",keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],symbols:/[=>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/@\s*[a-zA-Z_\$][\w\$]*/,"annotation"],[/(@digits)[eE]([\-+]?(@digits))?[fFdD]?/,"number.float"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?[fFdD]?/,"number.float"],[/0[xX](@hexdigits)[Ll]?/,"number.hex"],[/0(@octaldigits)[Ll]?/,"number.octal"],[/0[bB](@binarydigits)[Ll]?/,"number.binary"],[/(@digits)[fFdD]/,"number.float"],[/(@digits)[lL]?/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string"],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@javadoc"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],javadoc:[[/[^\/*]+/,"comment.doc"],[/\/\*/,"comment.doc.invalid"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]]}}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/javascript/javascript.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/javascript/javascript.js new file mode 100644 index 0000000..a5b72d5 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/javascript/javascript.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/typescript/typescript",["require","exports","../fillers/monaco-editor-core"],(function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.language=t.conf=void 0,t.conf={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],onEnterRules:[{beforeText:/^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,afterText:/^\s*\*\/$/,action:{indentAction:n.languages.IndentAction.IndentOutdent,appendText:" * "}},{beforeText:/^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,action:{indentAction:n.languages.IndentAction.None,appendText:" * "}},{beforeText:/^(\t|(\ \ ))*\ \*(\ ([^\*]|\*(?!\/))*)?$/,action:{indentAction:n.languages.IndentAction.None,appendText:"* "}},{beforeText:/^(\t|(\ \ ))*\ \*\/\s*$/,action:{indentAction:n.languages.IndentAction.None,removeText:1}}],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]},{open:"`",close:"`",notIn:["string","comment"]},{open:"/**",close:" */",notIn:["string"]}],folding:{markers:{start:new RegExp("^\\s*//\\s*#?region\\b"),end:new RegExp("^\\s*//\\s*#?endregion\\b")}}},t.language={defaultToken:"invalid",tokenPostfix:".ts",keywords:["abstract","any","as","asserts","bigint","boolean","break","case","catch","class","continue","const","constructor","debugger","declare","default","delete","do","else","enum","export","extends","false","finally","for","from","function","get","if","implements","import","in","infer","instanceof","interface","is","keyof","let","module","namespace","never","new","null","number","object","package","private","protected","public","readonly","require","global","return","set","static","string","super","switch","symbol","this","throw","true","try","type","typeof","undefined","unique","unknown","var","void","while","with","yield","async","await","of"],operators:["<=",">=","==","!=","===","!==","=>","+","-","**","*","/","%","++","--","<<",">",">>>","&","|","^","!","~","&&","||","??","?",":","=","+=","-=","*=","**=","/=","%=","<<=",">>=",">>>=","&=","|=","^=","@"],symbols:/[=>](?!@symbols)/,"@brackets"],[/!(?=([^=]|$))/,"delimiter"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/(@digits)[eE]([\-+]?(@digits))?/,"number.float"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?/,"number.float"],[/0[xX](@hexdigits)n?/,"number.hex"],[/0[oO]?(@octaldigits)n?/,"number.octal"],[/0[bB](@binarydigits)n?/,"number.binary"],[/(@digits)n?/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string_double"],[/'/,"string","@string_single"],[/`/,"string","@string_backtick"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@jsdoc"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],jsdoc:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],regexp:[[/(\{)(\d+(?:,\d*)?)(\})/,["regexp.escape.control","regexp.escape.control","regexp.escape.control"]],[/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/,["regexp.escape.control",{token:"regexp.escape.control",next:"@regexrange"}]],[/(\()(\?:|\?=|\?!)/,["regexp.escape.control","regexp.escape.control"]],[/[()]/,"regexp.escape.control"],[/@regexpctl/,"regexp.escape.control"],[/[^\\\/]/,"regexp"],[/@regexpesc/,"regexp.escape"],[/\\\./,"regexp.invalid"],[/(\/)([gimsuy]*)/,[{token:"regexp",bracket:"@close",next:"@pop"},"keyword.other"]]],regexrange:[[/-/,"regexp.escape.control"],[/\^/,"regexp.invalid"],[/@regexpesc/,"regexp.escape"],[/[^\]]/,"regexp"],[/\]/,{token:"regexp.escape.control",next:"@pop",bracket:"@close"}]],string_double:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],string_single:[[/[^\\']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/'/,"string","@pop"]],string_backtick:[[/\$\{/,{token:"delimiter.bracket",next:"@bracketCounting"}],[/[^\\`$]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/`/,"string","@pop"]],bracketCounting:[[/\{/,"delimiter.bracket","@bracketCounting"],[/\}/,"delimiter.bracket","@pop"],{include:"common"}]}}})),define("vs/basic-languages/javascript/javascript",["require","exports","../typescript/typescript"],(function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.language=t.conf=void 0,t.conf=n.conf,t.language={defaultToken:"invalid",tokenPostfix:".js",keywords:["break","case","catch","class","continue","const","constructor","debugger","default","delete","do","else","export","extends","false","finally","for","from","function","get","if","import","in","instanceof","let","new","null","return","set","super","switch","symbol","this","throw","true","try","typeof","undefined","var","void","while","with","yield","async","await","of"],typeKeywords:[],operators:n.language.operators,symbols:n.language.symbols,escapes:n.language.escapes,digits:n.language.digits,octaldigits:n.language.octaldigits,binarydigits:n.language.binarydigits,hexdigits:n.language.hexdigits,regexpctl:n.language.regexpctl,regexpesc:n.language.regexpesc,tokenizer:n.language.tokenizer}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/julia/julia.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/julia/julia.js new file mode 100644 index 0000000..f94dfc0 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/julia/julia.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/julia/julia",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.language=t.conf=void 0,t.conf={brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},t.language={tokenPostfix:".julia",keywords:["begin","while","if","for","try","return","break","continue","function","macro","quote","let","local","global","const","do","struct","module","baremodule","using","import","export","end","else","elseif","catch","finally","mutable","primitive","abstract","type","in","isa","where","new"],types:["LinRange","LineNumberNode","LinearIndices","LoadError","MIME","Matrix","Method","MethodError","Missing","MissingException","Module","NTuple","NamedTuple","Nothing","Number","OrdinalRange","OutOfMemoryError","OverflowError","Pair","PartialQuickSort","PermutedDimsArray","Pipe","Ptr","QuoteNode","Rational","RawFD","ReadOnlyMemoryError","Real","ReentrantLock","Ref","Regex","RegexMatch","RoundingMode","SegmentationFault","Set","Signed","Some","StackOverflowError","StepRange","StepRangeLen","StridedArray","StridedMatrix","StridedVecOrMat","StridedVector","String","StringIndexError","SubArray","SubString","SubstitutionString","Symbol","SystemError","Task","Text","TextDisplay","Timer","Tuple","Type","TypeError","TypeVar","UInt","UInt128","UInt16","UInt32","UInt64","UInt8","UndefInitializer","AbstractArray","UndefKeywordError","AbstractChannel","UndefRefError","AbstractChar","UndefVarError","AbstractDict","Union","AbstractDisplay","UnionAll","AbstractFloat","UnitRange","AbstractIrrational","Unsigned","AbstractMatrix","AbstractRange","Val","AbstractSet","Vararg","AbstractString","VecElement","AbstractUnitRange","VecOrMat","AbstractVecOrMat","Vector","AbstractVector","VersionNumber","Any","WeakKeyDict","ArgumentError","WeakRef","Array","AssertionError","BigFloat","BigInt","BitArray","BitMatrix","BitSet","BitVector","Bool","BoundsError","CapturedException","CartesianIndex","CartesianIndices","Cchar","Cdouble","Cfloat","Channel","Char","Cint","Cintmax_t","Clong","Clonglong","Cmd","Colon","Complex","ComplexF16","ComplexF32","ComplexF64","CompositeException","Condition","Cptrdiff_t","Cshort","Csize_t","Cssize_t","Cstring","Cuchar","Cuint","Cuintmax_t","Culong","Culonglong","Cushort","Cvoid","Cwchar_t","Cwstring","DataType","DenseArray","DenseMatrix","DenseVecOrMat","DenseVector","Dict","DimensionMismatch","Dims","DivideError","DomainError","EOFError","Enum","ErrorException","Exception","ExponentialBackOff","Expr","Float16","Float32","Float64","Function","GlobalRef","HTML","IO","IOBuffer","IOContext","IOStream","IdDict","IndexCartesian","IndexLinear","IndexStyle","InexactError","InitError","Int","Int128","Int16","Int32","Int64","Int8","Integer","InterruptException","InvalidStateException","Irrational","KeyError"],keywordops:["<:",">:",":","=>","...",".","->","?"],allops:/[^\w\d\s()\[\]{}"'#]+/,constants:["true","false","nothing","missing","undef","Inf","pi","NaN","π","ℯ","ans","PROGRAM_FILE","ARGS","C_NULL","VERSION","DEPOT_PATH","LOAD_PATH"],operators:["!","!=","!==","%","&","*","+","-","/","//","<","<<","<=","==","===","=>",">",">=",">>",">>>","\\","^","|","|>","~","÷","∈","∉","∋","∌","∘","√","∛","∩","∪","≈","≉","≠","≡","≢","≤","≥","⊆","⊇","⊈","⊉","⊊","⊋","⊻"],brackets:[{open:"(",close:")",token:"delimiter.parenthesis"},{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"}],ident:/π|ℯ|\b(?!\d)\w+\b/,escape:/(?:[abefnrstv\\"'\n\r]|[0-7]{1,3}|x[0-9A-Fa-f]{1,2}|u[0-9A-Fa-f]{4})/,escapes:/\\(?:C\-(@escape|.)|c(@escape|.)|@escape)/,tokenizer:{root:[[/(::)\s*|\b(isa)\s+/,"keyword","@typeanno"],[/\b(isa)(\s*\(@ident\s*,\s*)/,["keyword",{token:"",next:"@typeanno"}]],[/\b(type|struct)[ \t]+/,"keyword","@typeanno"],[/^\s*:@ident[!?]?/,"metatag"],[/(return)(\s*:@ident[!?]?)/,["keyword","metatag"]],[/(\(|\[|\{|@allops)(\s*:@ident[!?]?)/,["","metatag"]],[/:\(/,"metatag","@quote"],[/r"""/,"regexp.delim","@tregexp"],[/r"/,"regexp.delim","@sregexp"],[/raw"""/,"string.delim","@rtstring"],[/[bv]?"""/,"string.delim","@dtstring"],[/raw"/,"string.delim","@rsstring"],[/[bv]?"/,"string.delim","@dsstring"],[/(@ident)\{/,{cases:{"$1@types":{token:"type",next:"@gen"},"@default":{token:"type",next:"@gen"}}}],[/@ident[!?'']?(?=\.?\()/,{cases:{"@types":"type","@keywords":"keyword","@constants":"variable","@default":"keyword.flow"}}],[/@ident[!?']?/,{cases:{"@types":"type","@keywords":"keyword","@constants":"variable","@default":"identifier"}}],[/\$\w+/,"key"],[/\$\(/,"key","@paste"],[/@@ident/,"annotation"],{include:"@whitespace"},[/'(?:@escapes|.)'/,"string.character"],[/[()\[\]{}]/,"@brackets"],[/@allops/,{cases:{"@keywordops":"keyword","@operators":"operator"}}],[/[;,]/,"delimiter"],[/0[xX][0-9a-fA-F](_?[0-9a-fA-F])*/,"number.hex"],[/0[_oO][0-7](_?[0-7])*/,"number.octal"],[/0[bB][01](_?[01])*/,"number.binary"],[/[+\-]?\d+(\.\d+)?(im?|[eE][+\-]?\d+(\.\d+)?)?/,"number"]],typeanno:[[/[a-zA-Z_]\w*(?:\.[a-zA-Z_]\w*)*\{/,"type","@gen"],[/([a-zA-Z_]\w*(?:\.[a-zA-Z_]\w*)*)(\s*<:\s*)/,["type","keyword"]],[/[a-zA-Z_]\w*(?:\.[a-zA-Z_]\w*)*/,"type","@pop"],["","","@pop"]],gen:[[/[a-zA-Z_]\w*(?:\.[a-zA-Z_]\w*)*\{/,"type","@push"],[/[a-zA-Z_]\w*(?:\.[a-zA-Z_]\w*)*/,"type"],[/<:/,"keyword"],[/(\})(\s*<:\s*)/,["type",{token:"keyword",next:"@pop"}]],[/\}/,"type","@pop"],{include:"@root"}],quote:[[/\$\(/,"key","@paste"],[/\(/,"@brackets","@paren"],[/\)/,"metatag","@pop"],{include:"@root"}],paste:[[/:\(/,"metatag","@quote"],[/\(/,"@brackets","@paren"],[/\)/,"key","@pop"],{include:"@root"}],paren:[[/\$\(/,"key","@paste"],[/:\(/,"metatag","@quote"],[/\(/,"@brackets","@push"],[/\)/,"@brackets","@pop"],{include:"@root"}],sregexp:[[/^.*/,"invalid"],[/[^\\"()\[\]{}]/,"regexp"],[/[()\[\]{}]/,"@brackets"],[/\\./,"operator.scss"],[/"[imsx]*/,"regexp.delim","@pop"]],tregexp:[[/[^\\"()\[\]{}]/,"regexp"],[/[()\[\]{}]/,"@brackets"],[/\\./,"operator.scss"],[/"(?!"")/,"string"],[/"""[imsx]*/,"regexp.delim","@pop"]],rsstring:[[/^.*/,"invalid"],[/[^\\"]/,"string"],[/\\./,"string.escape"],[/"/,"string.delim","@pop"]],rtstring:[[/[^\\"]/,"string"],[/\\./,"string.escape"],[/"(?!"")/,"string"],[/"""/,"string.delim","@pop"]],dsstring:[[/^.*/,"invalid"],[/[^\\"\$]/,"string"],[/\$/,"","@interpolated"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string.delim","@pop"]],dtstring:[[/[^\\"\$]/,"string"],[/\$/,"","@interpolated"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"(?!"")/,"string"],[/"""/,"string.delim","@pop"]],interpolated:[[/\(/,{token:"",switchTo:"@interpolated_compound"}],[/[a-zA-Z_]\w*/,"identifier"],["","","@pop"]],interpolated_compound:[[/\)/,"","@pop"],{include:"@root"}],whitespace:[[/[ \t\r\n]+/,""],[/#=/,"comment","@multi_comment"],[/#.*$/,"comment"]],multi_comment:[[/#=/,"comment","@push"],[/=#/,"comment","@pop"],[/=(?!#)|#(?!=)/,"comment"],[/[^#=]+/,"comment"]]}}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/kotlin/kotlin.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/kotlin/kotlin.js new file mode 100644 index 0000000..fd2312b --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/kotlin/kotlin.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/kotlin/kotlin",["require","exports"],(function(e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.language=i.conf=void 0,i.conf={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"<",close:">"}],folding:{markers:{start:new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:))")}}},i.language={defaultToken:"",tokenPostfix:".kt",keywords:["as","as?","break","class","continue","do","else","false","for","fun","if","in","!in","interface","is","!is","null","object","package","return","super","this","throw","true","try","typealias","val","var","when","while","by","catch","constructor","delegate","dynamic","field","file","finally","get","import","init","param","property","receiver","set","setparam","where","actual","abstract","annotation","companion","const","crossinline","data","enum","expect","external","final","infix","inline","inner","internal","lateinit","noinline","open","operator","out","override","private","protected","public","reified","sealed","suspend","tailrec","vararg","field","it"],operators:["+","-","*","/","%","=","+=","-=","*=","/=","%=","++","--","&&","||","!","==","!=","===","!==",">","<","<=",">=","[","]","!!","?.","?:","::","..",":","?","->","@",";","$","_"],symbols:/[=>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/@\s*[a-zA-Z_\$][\w\$]*/,"annotation"],[/(@digits)[eE]([\-+]?(@digits))?[fFdD]?/,"number.float"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?[fFdD]?/,"number.float"],[/0[xX](@hexdigits)[Ll]?/,"number.hex"],[/0(@octaldigits)[Ll]?/,"number.octal"],[/0[bB](@binarydigits)[Ll]?/,"number.binary"],[/(@digits)[fFdD]/,"number.float"],[/(@digits)[lL]?/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"""/,"string","@multistring"],[/"/,"string","@string"],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@javadoc"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\/\*/,"comment","@comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],javadoc:[[/[^\/*]+/,"comment.doc"],[/\/\*/,"comment.doc","@push"],[/\/\*/,"comment.doc.invalid"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],multistring:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"""/,"string","@pop"],[/./,"string"]]}}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/less/less.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/less/less.js new file mode 100644 index 0000000..0453902 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/less/less.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/less/less",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.language=t.conf=void 0,t.conf={wordPattern:/(#?-?\d*\.\d\w*%?)|([@#!.:]?[\w-?]+%?)|[@#!.]/g,comments:{blockComment:["/*","*/"],lineComment:"//"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}",notIn:["string","comment"]},{open:"[",close:"]",notIn:["string","comment"]},{open:"(",close:")",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string","comment"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/"),end:new RegExp("^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/")}}},t.language={defaultToken:"",tokenPostfix:".less",identifier:"-?-?([a-zA-Z]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))([\\w\\-]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))*",identifierPlus:"-?-?([a-zA-Z:.]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))([\\w\\-:.]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))*",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.bracket"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],tokenizer:{root:[{include:"@nestedJSBegin"},["[ \\t\\r\\n]+",""],{include:"@comments"},{include:"@keyword"},{include:"@strings"},{include:"@numbers"},["[*_]?[a-zA-Z\\-\\s]+(?=:.*(;|(\\\\$)))","attribute.name","@attribute"],["url(\\-prefix)?\\(",{token:"tag",next:"@urldeclaration"}],["[{}()\\[\\]]","@brackets"],["[,:;]","delimiter"],["#@identifierPlus","tag.id"],["&","tag"],["\\.@identifierPlus(?=\\()","tag.class","@attribute"],["\\.@identifierPlus","tag.class"],["@identifierPlus","tag"],{include:"@operators"},["@(@identifier(?=[:,\\)]))","variable","@attribute"],["@(@identifier)","variable"],["@","key","@atRules"]],nestedJSBegin:[["``","delimiter.backtick"],["`",{token:"delimiter.backtick",next:"@nestedJSEnd",nextEmbedded:"text/javascript"}]],nestedJSEnd:[["`",{token:"delimiter.backtick",next:"@pop",nextEmbedded:"@pop"}]],operators:[["[<>=\\+\\-\\*\\/\\^\\|\\~]","operator"]],keyword:[["(@[\\s]*import|![\\s]*important|true|false|when|iscolor|isnumber|isstring|iskeyword|isurl|ispixel|ispercentage|isem|hue|saturation|lightness|alpha|lighten|darken|saturate|desaturate|fadein|fadeout|fade|spin|mix|round|ceil|floor|percentage)\\b","keyword"]],urldeclaration:[{include:"@strings"},["[^)\r\n]+","string"],["\\)",{token:"tag",next:"@pop"}]],attribute:[{include:"@nestedJSBegin"},{include:"@comments"},{include:"@strings"},{include:"@numbers"},{include:"@keyword"},["[a-zA-Z\\-]+(?=\\()","attribute.value","@attribute"],[">","operator","@pop"],["@identifier","attribute.value"],{include:"@operators"},["@(@identifier)","variable"],["[)\\}]","@brackets","@pop"],["[{}()\\[\\]>]","@brackets"],["[;]","delimiter","@pop"],["[,=:]","delimiter"],["\\s",""],[".","attribute.value"]],comments:[["\\/\\*","comment","@comment"],["\\/\\/+.*","comment"]],comment:[["\\*\\/","comment","@pop"],[".","comment"]],numbers:[["(\\d*\\.)?\\d+([eE][\\-+]?\\d+)?",{token:"attribute.value.number",next:"@units"}],["#[0-9a-fA-F_]+(?!\\w)","attribute.value.hex"]],units:[["(em|ex|ch|rem|vmin|vmax|vw|vh|vm|cm|mm|in|px|pt|pc|deg|grad|rad|turn|s|ms|Hz|kHz|%)?","attribute.value.unit","@pop"]],strings:[['~?"',{token:"string.delimiter",next:"@stringsEndDoubleQuote"}],["~?'",{token:"string.delimiter",next:"@stringsEndQuote"}]],stringsEndDoubleQuote:[['\\\\"',"string"],['"',{token:"string.delimiter",next:"@popall"}],[".","string"]],stringsEndQuote:[["\\\\'","string"],["'",{token:"string.delimiter",next:"@popall"}],[".","string"]],atRules:[{include:"@comments"},{include:"@strings"},["[()]","delimiter"],["[\\{;]","delimiter","@pop"],[".","key"]]}}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/lexon/lexon.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/lexon/lexon.js new file mode 100644 index 0000000..d6c3550 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/lexon/lexon.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/lexon/lexon",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.language=t.conf=void 0,t.conf={comments:{lineComment:"COMMENT"},brackets:[["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:":",close:"."}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"`",close:"`"},{open:'"',close:'"'},{open:"'",close:"'"},{open:":",close:"."}],folding:{markers:{start:new RegExp("^\\s*(::\\s*|COMMENT\\s+)#region"),end:new RegExp("^\\s*(::\\s*|COMMENT\\s+)#endregion")}}},t.language={tokenPostfix:".lexon",ignoreCase:!0,keywords:["lexon","lex","clause","terms","contracts","may","pay","pays","appoints","into","to"],typeKeywords:["amount","person","key","time","date","asset","text"],operators:["less","greater","equal","le","gt","or","and","add","added","subtract","subtracted","multiply","multiplied","times","divide","divided","is","be","certified"],symbols:/[=>](?!@symbols)/,"@brackets"],[/@symbols/,"delimiter"],[/\d*\.\d*\.\d*/,"number.semver"],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F]+/,"number.hex"],[/\d+/,"number"],[/[;,.]/,"delimiter"]],quoted_identifier:[[/[^\\"]+/,"identifier"],[/"/,{token:"identifier.quote",bracket:"@close",next:"@pop"}]],space_identifier_until_period:[[":","delimiter"],[" ",{token:"white",next:"@identifier_rest"}]],identifier_until_period:[{include:"@whitespace"},[":",{token:"delimiter",next:"@identifier_rest"}],[/[^\\.]+/,"identifier"],[/\./,{token:"delimiter",bracket:"@close",next:"@pop"}]],identifier_rest:[[/[^\\.]+/,"identifier"],[/\./,{token:"delimiter",bracket:"@close",next:"@pop"}]],semver:[{include:"@whitespace"},[":","delimiter"],[/\d*\.\d*\.\d*/,{token:"number.semver",bracket:"@close",next:"@pop"}]],whitespace:[[/[ \t\r\n]+/,"white"]]}}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/lua/lua.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/lua/lua.js new file mode 100644 index 0000000..fccc448 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/lua/lua.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/lua/lua",["require","exports"],(function(e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.language=n.conf=void 0,n.conf={comments:{lineComment:"--",blockComment:["--[[","]]"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},n.language={defaultToken:"",tokenPostfix:".lua",keywords:["and","break","do","else","elseif","end","false","for","function","goto","if","in","local","nil","not","or","repeat","return","then","true","until","while"],brackets:[{token:"delimiter.bracket",open:"{",close:"}"},{token:"delimiter.array",open:"[",close:"]"},{token:"delimiter.parenthesis",open:"(",close:")"}],operators:["+","-","*","/","%","^","#","==","~=","<=",">=","<",">","=",";",":",",",".","..","..."],symbols:/[=>",notIn:["string"]}],surroundingPairs:[{open:"(",close:")"},{open:"[",close:"]"},{open:"`",close:"`"}],folding:{markers:{start:new RegExp("^\\s*\x3c!--\\s*#?region\\b.*--\x3e"),end:new RegExp("^\\s*\x3c!--\\s*#?endregion\\b.*--\x3e")}}},t.language={defaultToken:"",tokenPostfix:".md",control:/[\\`*_\[\]{}()#+\-\.!]/,noncontrol:/[^\\`*_\[\]{}()#+\-\.!]/,escapes:/\\(?:@control)/,jsescapes:/\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/,empty:["area","base","basefont","br","col","frame","hr","img","input","isindex","link","meta","param"],tokenizer:{root:[[/^\s*\|/,"@rematch","@table_header"],[/^(\s{0,3})(#+)((?:[^\\#]|@escapes)+)((?:#+)?)/,["white","keyword","keyword","keyword"]],[/^\s*(=+|\-+)\s*$/,"keyword"],[/^\s*((\*[ ]?)+)\s*$/,"meta.separator"],[/^\s*>+/,"comment"],[/^\s*([\*\-+:]|\d+\.)\s/,"keyword"],[/^(\t|[ ]{4})[^ ].*$/,"string"],[/^\s*~~~\s*((?:\w|[\/\-#])+)?\s*$/,{token:"string",next:"@codeblock"}],[/^\s*```\s*((?:\w|[\/\-#])+).*$/,{token:"string",next:"@codeblockgh",nextEmbedded:"$1"}],[/^\s*```\s*$/,{token:"string",next:"@codeblock"}],{include:"@linecontent"}],table_header:[{include:"@table_common"},[/[^\|]+/,"keyword.table.header"]],table_body:[{include:"@table_common"},{include:"@linecontent"}],table_common:[[/\s*[\-:]+\s*/,{token:"keyword",switchTo:"table_body"}],[/^\s*\|/,"keyword.table.left"],[/^\s*[^\|]/,"@rematch","@pop"],[/^\s*$/,"@rematch","@pop"],[/\|/,{cases:{"@eos":"keyword.table.right","@default":"keyword.table.middle"}}]],codeblock:[[/^\s*~~~\s*$/,{token:"string",next:"@pop"}],[/^\s*```\s*$/,{token:"string",next:"@pop"}],[/.*$/,"variable.source"]],codeblockgh:[[/```\s*$/,{token:"variable.source",next:"@pop",nextEmbedded:"@pop"}],[/[^`]+/,"variable.source"]],linecontent:[[/&\w+;/,"string.escape"],[/@escapes/,"escape"],[/\b__([^\\_]|@escapes|_(?!_))+__\b/,"strong"],[/\*\*([^\\*]|@escapes|\*(?!\*))+\*\*/,"strong"],[/\b_[^_]+_\b/,"emphasis"],[/\*([^\\*]|@escapes)+\*/,"emphasis"],[/`([^\\`]|@escapes)+`/,"variable"],[/\{+[^}]+\}+/,"string.target"],[/(!?\[)((?:[^\]\\]|@escapes)*)(\]\([^\)]+\))/,["string.link","","string.link"]],[/(!?\[)((?:[^\]\\]|@escapes)*)(\])/,"string.link"],{include:"html"}],html:[[/<(\w+)\/>/,"tag"],[/<(\w+)/,{cases:{"@empty":{token:"tag",next:"@tag.$1"},"@default":{token:"tag",next:"@tag.$1"}}}],[/<\/(\w+)\s*>/,{token:"tag"}],[//,"comment","@pop"],[//,"comment.html","@pop"],[/[^-]+/,"comment.content.html"],[/./,"comment.content.html"]],otherTag:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInSimpleState.otherTag"}],[/\/?>/,"delimiter.html","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInSimpleState.script"}],[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],scriptAfterType:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInSimpleState.scriptAfterType"}],[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInSimpleState.scriptAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInSimpleState.scriptWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInEmbeddedState.scriptEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],style:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInSimpleState.style"}],[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],styleAfterType:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInSimpleState.styleAfterType"}],[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInSimpleState.styleAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInSimpleState.styleWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInEmbeddedState.styleEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],phpInSimpleState:[[/<\?((php)|=)?/,"metatag.php"],[/\?>/,{token:"metatag.php",switchTo:"@$S2.$S3"}],{include:"phpRoot"}],phpInEmbeddedState:[[/<\?((php)|=)?/,"metatag.php"],[/\?>/,{token:"metatag.php",switchTo:"@$S2.$S3",nextEmbedded:"$S3"}],{include:"phpRoot"}],phpRoot:[[/[a-zA-Z_]\w*/,{cases:{"@phpKeywords":{token:"keyword.php"},"@phpCompileTimeConstants":{token:"constant.php"},"@default":"identifier.php"}}],[/[$a-zA-Z_]\w*/,{cases:{"@phpPreDefinedVariables":{token:"variable.predefined.php"},"@default":"variable.php"}}],[/[{}]/,"delimiter.bracket.php"],[/[\[\]]/,"delimiter.array.php"],[/[()]/,"delimiter.parenthesis.php"],[/[ \t\r\n]+/],[/(#|\/\/)$/,"comment.php"],[/(#|\/\/)/,"comment.php","@phpLineComment"],[/\/\*/,"comment.php","@phpComment"],[/"/,"string.php","@phpDoubleQuoteString"],[/'/,"string.php","@phpSingleQuoteString"],[/[\+\-\*\%\&\|\^\~\!\=\<\>\/\?\;\:\.\,\@]/,"delimiter.php"],[/\d*\d+[eE]([\-+]?\d+)?/,"number.float.php"],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float.php"],[/0[xX][0-9a-fA-F']*[0-9a-fA-F]/,"number.hex.php"],[/0[0-7']*[0-7]/,"number.octal.php"],[/0[bB][0-1']*[0-1]/,"number.binary.php"],[/\d[\d']*/,"number.php"],[/\d/,"number.php"]],phpComment:[[/\*\//,"comment.php","@pop"],[/[^*]+/,"comment.php"],[/./,"comment.php"]],phpLineComment:[[/\?>/,{token:"@rematch",next:"@pop"}],[/.$/,"comment.php","@pop"],[/[^?]+$/,"comment.php","@pop"],[/[^?]+/,"comment.php"],[/./,"comment.php"]],phpDoubleQuoteString:[[/[^\\"]+/,"string.php"],[/@escapes/,"string.escape.php"],[/\\./,"string.escape.invalid.php"],[/"/,"string.php","@pop"]],phpSingleQuoteString:[[/[^\\']+/,"string.php"],[/@escapes/,"string.escape.php"],[/\\./,"string.escape.invalid.php"],[/'/,"string.php","@pop"]]},phpKeywords:["abstract","and","array","as","break","callable","case","catch","cfunction","class","clone","const","continue","declare","default","do","else","elseif","enddeclare","endfor","endforeach","endif","endswitch","endwhile","extends","false","final","for","foreach","function","global","goto","if","implements","interface","instanceof","insteadof","namespace","new","null","object","old_function","or","private","protected","public","resource","static","switch","throw","trait","try","true","use","var","while","xor","die","echo","empty","exit","eval","include","include_once","isset","list","require","require_once","return","print","unset","yield","__construct"],phpCompileTimeConstants:["__CLASS__","__DIR__","__FILE__","__LINE__","__NAMESPACE__","__METHOD__","__FUNCTION__","__TRAIT__"],phpPreDefinedVariables:["$GLOBALS","$_SERVER","$_GET","$_POST","$_FILES","$_REQUEST","$_SESSION","$_ENV","$_COOKIE","$php_errormsg","$HTTP_RAW_POST_DATA","$http_response_header","$argc","$argv"],escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/postiats/postiats.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/postiats/postiats.js new file mode 100644 index 0000000..b8fe268 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/postiats/postiats.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/postiats/postiats",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.language=t.conf=void 0,t.conf={comments:{lineComment:"//",blockComment:["(*","*)"]},brackets:[["{","}"],["[","]"],["(",")"],["<",">"]],autoClosingPairs:[{open:'"',close:'"',notIn:["string","comment"]},{open:"{",close:"}",notIn:["string","comment"]},{open:"[",close:"]",notIn:["string","comment"]},{open:"(",close:")",notIn:["string","comment"]}]},t.language={tokenPostfix:".pats",defaultToken:"invalid",keywords:["abstype","abst0ype","absprop","absview","absvtype","absviewtype","absvt0ype","absviewt0ype","as","and","assume","begin","classdec","datasort","datatype","dataprop","dataview","datavtype","dataviewtype","do","end","extern","extype","extvar","exception","fn","fnx","fun","prfn","prfun","praxi","castfn","if","then","else","ifcase","in","infix","infixl","infixr","prefix","postfix","implmnt","implement","primplmnt","primplement","import","let","local","macdef","macrodef","nonfix","symelim","symintr","overload","of","op","rec","sif","scase","sortdef","sta","stacst","stadef","static","staload","dynload","try","tkindef","typedef","propdef","viewdef","vtypedef","viewtypedef","prval","var","prvar","when","where","with","withtype","withprop","withview","withvtype","withviewtype"],keywords_dlr:["$delay","$ldelay","$arrpsz","$arrptrsize","$d2ctype","$effmask","$effmask_ntm","$effmask_exn","$effmask_ref","$effmask_wrt","$effmask_all","$extern","$extkind","$extype","$extype_struct","$extval","$extfcall","$extmcall","$literal","$myfilename","$mylocation","$myfunction","$lst","$lst_t","$lst_vt","$list","$list_t","$list_vt","$rec","$rec_t","$rec_vt","$record","$record_t","$record_vt","$tup","$tup_t","$tup_vt","$tuple","$tuple_t","$tuple_vt","$break","$continue","$raise","$showtype","$vcopyenv_v","$vcopyenv_vt","$tempenver","$solver_assert","$solver_verify"],keywords_srp:["#if","#ifdef","#ifndef","#then","#elif","#elifdef","#elifndef","#else","#endif","#error","#prerr","#print","#assert","#undef","#define","#include","#require","#pragma","#codegen2","#codegen3"],irregular_keyword_list:["val+","val-","val","case+","case-","case","addr@","addr","fold@","free@","fix@","fix","lam@","lam","llam@","llam","viewt@ype+","viewt@ype-","viewt@ype","viewtype+","viewtype-","viewtype","view+","view-","view@","view","type+","type-","type","vtype+","vtype-","vtype","vt@ype+","vt@ype-","vt@ype","viewt@ype+","viewt@ype-","viewt@ype","viewtype+","viewtype-","viewtype","prop+","prop-","prop","type+","type-","type","t@ype","t@ype+","t@ype-","abst@ype","abstype","absviewt@ype","absvt@ype","for*","for","while*","while"],keywords_types:["bool","double","byte","int","short","char","void","unit","long","float","string","strptr"],keywords_effects:["0","fun","clo","prf","funclo","cloptr","cloref","ref","ntm","1"],operators:["@","!","|","`",":","$",".","=","#","~","..","...","=>","=<>","=/=>","=>>","=/=>>","<",">","><",".<",">.",".<>.","->","-<>"],brackets:[{open:",(",close:")",token:"delimiter.parenthesis"},{open:"`(",close:")",token:"delimiter.parenthesis"},{open:"%(",close:")",token:"delimiter.parenthesis"},{open:"'(",close:")",token:"delimiter.parenthesis"},{open:"'{",close:"}",token:"delimiter.parenthesis"},{open:"@(",close:")",token:"delimiter.parenthesis"},{open:"@{",close:"}",token:"delimiter.brace"},{open:"@[",close:"]",token:"delimiter.square"},{open:"#[",close:"]",token:"delimiter.square"},{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],symbols:/[=>]/,digit:/[0-9]/,digitseq0:/@digit*/,xdigit:/[0-9A-Za-z]/,xdigitseq0:/@xdigit*/,INTSP:/[lLuU]/,FLOATSP:/[fFlL]/,fexponent:/[eE][+-]?[0-9]+/,fexponent_bin:/[pP][+-]?[0-9]+/,deciexp:/\.[0-9]*@fexponent?/,hexiexp:/\.[0-9a-zA-Z]*@fexponent_bin?/,irregular_keywords:/val[+-]?|case[+-]?|addr\@?|fold\@|free\@|fix\@?|lam\@?|llam\@?|prop[+-]?|type[+-]?|view[+-@]?|viewt@?ype[+-]?|t@?ype[+-]?|v(iew)?t@?ype[+-]?|abst@?ype|absv(iew)?t@?ype|for\*?|while\*?/,ESCHAR:/[ntvbrfa\\\?'"\(\[\{]/,start:"root",tokenizer:{root:[{regex:/[ \t\r\n]+/,action:{token:""}},{regex:/\(\*\)/,action:{token:"invalid"}},{regex:/\(\*/,action:{token:"comment",next:"lexing_COMMENT_block_ml"}},{regex:/\(/,action:"@brackets"},{regex:/\)/,action:"@brackets"},{regex:/\[/,action:"@brackets"},{regex:/\]/,action:"@brackets"},{regex:/\{/,action:"@brackets"},{regex:/\}/,action:"@brackets"},{regex:/,\(/,action:"@brackets"},{regex:/,/,action:{token:"delimiter.comma"}},{regex:/;/,action:{token:"delimiter.semicolon"}},{regex:/@\(/,action:"@brackets"},{regex:/@\[/,action:"@brackets"},{regex:/@\{/,action:"@brackets"},{regex:/:/,action:{token:"@rematch",next:"@pop"}}],lexing_EXTCODE:[{regex:/^%}/,action:{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}},{regex:/[^%]+/,action:""}],lexing_DQUOTE:[{regex:/"/,action:{token:"string.quote",next:"@pop"}},{regex:/(\{\$)(@IDENTFST@IDENTRST*)(\})/,action:[{token:"string.escape"},{token:"identifier"},{token:"string.escape"}]},{regex:/\\$/,action:{token:"string.escape"}},{regex:/\\(@ESCHAR|[xX]@xdigit+|@digit+)/,action:{token:"string.escape"}},{regex:/[^\\"]+/,action:{token:"string"}}]}}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/powerquery/powerquery.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/powerquery/powerquery.js new file mode 100644 index 0000000..faa8996 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/powerquery/powerquery.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/powerquery/powerquery",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.language=t.conf=void 0,t.conf={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["[","]"],["(",")"],["{","}"]],autoClosingPairs:[{open:'"',close:'"',notIn:["string","comment","identifier"]},{open:"[",close:"]",notIn:["string","comment","identifier"]},{open:"(",close:")",notIn:["string","comment","identifier"]},{open:"{",close:"}",notIn:["string","comment","identifier"]}]},t.language={defaultToken:"",tokenPostfix:".pq",ignoreCase:!1,brackets:[{open:"[",close:"]",token:"delimiter.square"},{open:"{",close:"}",token:"delimiter.brackets"},{open:"(",close:")",token:"delimiter.parenthesis"}],operatorKeywords:["and","not","or"],keywords:["as","each","else","error","false","if","in","is","let","meta","otherwise","section","shared","then","true","try","type"],constructors:["#binary","#date","#datetime","#datetimezone","#duration","#table","#time"],constants:["#infinity","#nan","#sections","#shared"],typeKeywords:["action","any","anynonnull","none","null","logical","number","time","date","datetime","datetimezone","duration","text","binary","list","record","table","function"],builtinFunctions:["Access.Database","Action.Return","Action.Sequence","Action.Try","ActiveDirectory.Domains","AdoDotNet.DataSource","AdoDotNet.Query","AdobeAnalytics.Cubes","AnalysisServices.Database","AnalysisServices.Databases","AzureStorage.BlobContents","AzureStorage.Blobs","AzureStorage.Tables","Binary.Buffer","Binary.Combine","Binary.Compress","Binary.Decompress","Binary.End","Binary.From","Binary.FromList","Binary.FromText","Binary.InferContentType","Binary.Length","Binary.ToList","Binary.ToText","BinaryFormat.7BitEncodedSignedInteger","BinaryFormat.7BitEncodedUnsignedInteger","BinaryFormat.Binary","BinaryFormat.Byte","BinaryFormat.ByteOrder","BinaryFormat.Choice","BinaryFormat.Decimal","BinaryFormat.Double","BinaryFormat.Group","BinaryFormat.Length","BinaryFormat.List","BinaryFormat.Null","BinaryFormat.Record","BinaryFormat.SignedInteger16","BinaryFormat.SignedInteger32","BinaryFormat.SignedInteger64","BinaryFormat.Single","BinaryFormat.Text","BinaryFormat.Transform","BinaryFormat.UnsignedInteger16","BinaryFormat.UnsignedInteger32","BinaryFormat.UnsignedInteger64","Byte.From","Character.FromNumber","Character.ToNumber","Combiner.CombineTextByDelimiter","Combiner.CombineTextByEachDelimiter","Combiner.CombineTextByLengths","Combiner.CombineTextByPositions","Combiner.CombineTextByRanges","Comparer.Equals","Comparer.FromCulture","Comparer.Ordinal","Comparer.OrdinalIgnoreCase","Csv.Document","Cube.AddAndExpandDimensionColumn","Cube.AddMeasureColumn","Cube.ApplyParameter","Cube.AttributeMemberId","Cube.AttributeMemberProperty","Cube.CollapseAndRemoveColumns","Cube.Dimensions","Cube.DisplayFolders","Cube.Measures","Cube.Parameters","Cube.Properties","Cube.PropertyKey","Cube.ReplaceDimensions","Cube.Transform","Currency.From","DB2.Database","Date.AddDays","Date.AddMonths","Date.AddQuarters","Date.AddWeeks","Date.AddYears","Date.Day","Date.DayOfWeek","Date.DayOfWeekName","Date.DayOfYear","Date.DaysInMonth","Date.EndOfDay","Date.EndOfMonth","Date.EndOfQuarter","Date.EndOfWeek","Date.EndOfYear","Date.From","Date.FromText","Date.IsInCurrentDay","Date.IsInCurrentMonth","Date.IsInCurrentQuarter","Date.IsInCurrentWeek","Date.IsInCurrentYear","Date.IsInNextDay","Date.IsInNextMonth","Date.IsInNextNDays","Date.IsInNextNMonths","Date.IsInNextNQuarters","Date.IsInNextNWeeks","Date.IsInNextNYears","Date.IsInNextQuarter","Date.IsInNextWeek","Date.IsInNextYear","Date.IsInPreviousDay","Date.IsInPreviousMonth","Date.IsInPreviousNDays","Date.IsInPreviousNMonths","Date.IsInPreviousNQuarters","Date.IsInPreviousNWeeks","Date.IsInPreviousNYears","Date.IsInPreviousQuarter","Date.IsInPreviousWeek","Date.IsInPreviousYear","Date.IsInYearToDate","Date.IsLeapYear","Date.Month","Date.MonthName","Date.QuarterOfYear","Date.StartOfDay","Date.StartOfMonth","Date.StartOfQuarter","Date.StartOfWeek","Date.StartOfYear","Date.ToRecord","Date.ToText","Date.WeekOfMonth","Date.WeekOfYear","Date.Year","DateTime.AddZone","DateTime.Date","DateTime.FixedLocalNow","DateTime.From","DateTime.FromFileTime","DateTime.FromText","DateTime.IsInCurrentHour","DateTime.IsInCurrentMinute","DateTime.IsInCurrentSecond","DateTime.IsInNextHour","DateTime.IsInNextMinute","DateTime.IsInNextNHours","DateTime.IsInNextNMinutes","DateTime.IsInNextNSeconds","DateTime.IsInNextSecond","DateTime.IsInPreviousHour","DateTime.IsInPreviousMinute","DateTime.IsInPreviousNHours","DateTime.IsInPreviousNMinutes","DateTime.IsInPreviousNSeconds","DateTime.IsInPreviousSecond","DateTime.LocalNow","DateTime.Time","DateTime.ToRecord","DateTime.ToText","DateTimeZone.FixedLocalNow","DateTimeZone.FixedUtcNow","DateTimeZone.From","DateTimeZone.FromFileTime","DateTimeZone.FromText","DateTimeZone.LocalNow","DateTimeZone.RemoveZone","DateTimeZone.SwitchZone","DateTimeZone.ToLocal","DateTimeZone.ToRecord","DateTimeZone.ToText","DateTimeZone.ToUtc","DateTimeZone.UtcNow","DateTimeZone.ZoneHours","DateTimeZone.ZoneMinutes","Decimal.From","Diagnostics.ActivityId","Diagnostics.Trace","DirectQueryCapabilities.From","Double.From","Duration.Days","Duration.From","Duration.FromText","Duration.Hours","Duration.Minutes","Duration.Seconds","Duration.ToRecord","Duration.ToText","Duration.TotalDays","Duration.TotalHours","Duration.TotalMinutes","Duration.TotalSeconds","Embedded.Value","Error.Record","Excel.CurrentWorkbook","Excel.Workbook","Exchange.Contents","Expression.Constant","Expression.Evaluate","Expression.Identifier","Facebook.Graph","File.Contents","Folder.Contents","Folder.Files","Function.From","Function.Invoke","Function.InvokeAfter","Function.IsDataSource","GoogleAnalytics.Accounts","Guid.From","HdInsight.Containers","HdInsight.Contents","HdInsight.Files","Hdfs.Contents","Hdfs.Files","Informix.Database","Int16.From","Int32.From","Int64.From","Int8.From","ItemExpression.From","Json.Document","Json.FromValue","Lines.FromBinary","Lines.FromText","Lines.ToBinary","Lines.ToText","List.Accumulate","List.AllTrue","List.Alternate","List.AnyTrue","List.Average","List.Buffer","List.Combine","List.Contains","List.ContainsAll","List.ContainsAny","List.Count","List.Covariance","List.DateTimeZones","List.DateTimes","List.Dates","List.Difference","List.Distinct","List.Durations","List.FindText","List.First","List.FirstN","List.Generate","List.InsertRange","List.Intersect","List.IsDistinct","List.IsEmpty","List.Last","List.LastN","List.MatchesAll","List.MatchesAny","List.Max","List.MaxN","List.Median","List.Min","List.MinN","List.Mode","List.Modes","List.NonNullCount","List.Numbers","List.PositionOf","List.PositionOfAny","List.Positions","List.Product","List.Random","List.Range","List.RemoveFirstN","List.RemoveItems","List.RemoveLastN","List.RemoveMatchingItems","List.RemoveNulls","List.RemoveRange","List.Repeat","List.ReplaceMatchingItems","List.ReplaceRange","List.ReplaceValue","List.Reverse","List.Select","List.Single","List.SingleOrDefault","List.Skip","List.Sort","List.StandardDeviation","List.Sum","List.Times","List.Transform","List.TransformMany","List.Union","List.Zip","Logical.From","Logical.FromText","Logical.ToText","MQ.Queue","MySQL.Database","Number.Abs","Number.Acos","Number.Asin","Number.Atan","Number.Atan2","Number.BitwiseAnd","Number.BitwiseNot","Number.BitwiseOr","Number.BitwiseShiftLeft","Number.BitwiseShiftRight","Number.BitwiseXor","Number.Combinations","Number.Cos","Number.Cosh","Number.Exp","Number.Factorial","Number.From","Number.FromText","Number.IntegerDivide","Number.IsEven","Number.IsNaN","Number.IsOdd","Number.Ln","Number.Log","Number.Log10","Number.Mod","Number.Permutations","Number.Power","Number.Random","Number.RandomBetween","Number.Round","Number.RoundAwayFromZero","Number.RoundDown","Number.RoundTowardZero","Number.RoundUp","Number.Sign","Number.Sin","Number.Sinh","Number.Sqrt","Number.Tan","Number.Tanh","Number.ToText","OData.Feed","Odbc.DataSource","Odbc.Query","OleDb.DataSource","OleDb.Query","Oracle.Database","Percentage.From","PostgreSQL.Database","RData.FromBinary","Record.AddField","Record.Combine","Record.Field","Record.FieldCount","Record.FieldNames","Record.FieldOrDefault","Record.FieldValues","Record.FromList","Record.FromTable","Record.HasFields","Record.RemoveFields","Record.RenameFields","Record.ReorderFields","Record.SelectFields","Record.ToList","Record.ToTable","Record.TransformFields","Replacer.ReplaceText","Replacer.ReplaceValue","RowExpression.Column","RowExpression.From","Salesforce.Data","Salesforce.Reports","SapBusinessWarehouse.Cubes","SapHana.Database","SharePoint.Contents","SharePoint.Files","SharePoint.Tables","Single.From","Soda.Feed","Splitter.SplitByNothing","Splitter.SplitTextByAnyDelimiter","Splitter.SplitTextByDelimiter","Splitter.SplitTextByEachDelimiter","Splitter.SplitTextByLengths","Splitter.SplitTextByPositions","Splitter.SplitTextByRanges","Splitter.SplitTextByRepeatedLengths","Splitter.SplitTextByWhitespace","Sql.Database","Sql.Databases","SqlExpression.SchemaFrom","SqlExpression.ToExpression","Sybase.Database","Table.AddColumn","Table.AddIndexColumn","Table.AddJoinColumn","Table.AddKey","Table.AggregateTableColumn","Table.AlternateRows","Table.Buffer","Table.Column","Table.ColumnCount","Table.ColumnNames","Table.ColumnsOfType","Table.Combine","Table.CombineColumns","Table.Contains","Table.ContainsAll","Table.ContainsAny","Table.DemoteHeaders","Table.Distinct","Table.DuplicateColumn","Table.ExpandListColumn","Table.ExpandRecordColumn","Table.ExpandTableColumn","Table.FillDown","Table.FillUp","Table.FilterWithDataTable","Table.FindText","Table.First","Table.FirstN","Table.FirstValue","Table.FromColumns","Table.FromList","Table.FromPartitions","Table.FromRecords","Table.FromRows","Table.FromValue","Table.Group","Table.HasColumns","Table.InsertRows","Table.IsDistinct","Table.IsEmpty","Table.Join","Table.Keys","Table.Last","Table.LastN","Table.MatchesAllRows","Table.MatchesAnyRows","Table.Max","Table.MaxN","Table.Min","Table.MinN","Table.NestedJoin","Table.Partition","Table.PartitionValues","Table.Pivot","Table.PositionOf","Table.PositionOfAny","Table.PrefixColumns","Table.Profile","Table.PromoteHeaders","Table.Range","Table.RemoveColumns","Table.RemoveFirstN","Table.RemoveLastN","Table.RemoveMatchingRows","Table.RemoveRows","Table.RemoveRowsWithErrors","Table.RenameColumns","Table.ReorderColumns","Table.Repeat","Table.ReplaceErrorValues","Table.ReplaceKeys","Table.ReplaceMatchingRows","Table.ReplaceRelationshipIdentity","Table.ReplaceRows","Table.ReplaceValue","Table.ReverseRows","Table.RowCount","Table.Schema","Table.SelectColumns","Table.SelectRows","Table.SelectRowsWithErrors","Table.SingleRow","Table.Skip","Table.Sort","Table.SplitColumn","Table.ToColumns","Table.ToList","Table.ToRecords","Table.ToRows","Table.TransformColumnNames","Table.TransformColumnTypes","Table.TransformColumns","Table.TransformRows","Table.Transpose","Table.Unpivot","Table.UnpivotOtherColumns","Table.View","Table.ViewFunction","TableAction.DeleteRows","TableAction.InsertRows","TableAction.UpdateRows","Tables.GetRelationships","Teradata.Database","Text.AfterDelimiter","Text.At","Text.BeforeDelimiter","Text.BetweenDelimiters","Text.Clean","Text.Combine","Text.Contains","Text.End","Text.EndsWith","Text.Format","Text.From","Text.FromBinary","Text.Insert","Text.Length","Text.Lower","Text.Middle","Text.NewGuid","Text.PadEnd","Text.PadStart","Text.PositionOf","Text.PositionOfAny","Text.Proper","Text.Range","Text.Remove","Text.RemoveRange","Text.Repeat","Text.Replace","Text.ReplaceRange","Text.Select","Text.Split","Text.SplitAny","Text.Start","Text.StartsWith","Text.ToBinary","Text.ToList","Text.Trim","Text.TrimEnd","Text.TrimStart","Text.Upper","Time.EndOfHour","Time.From","Time.FromText","Time.Hour","Time.Minute","Time.Second","Time.StartOfHour","Time.ToRecord","Time.ToText","Type.AddTableKey","Type.ClosedRecord","Type.Facets","Type.ForFunction","Type.ForRecord","Type.FunctionParameters","Type.FunctionRequiredParameters","Type.FunctionReturn","Type.Is","Type.IsNullable","Type.IsOpenRecord","Type.ListItem","Type.NonNullable","Type.OpenRecord","Type.RecordFields","Type.ReplaceFacets","Type.ReplaceTableKeys","Type.TableColumn","Type.TableKeys","Type.TableRow","Type.TableSchema","Type.Union","Uri.BuildQueryString","Uri.Combine","Uri.EscapeDataString","Uri.Parts","Value.Add","Value.As","Value.Compare","Value.Divide","Value.Equals","Value.Firewall","Value.FromText","Value.Is","Value.Metadata","Value.Multiply","Value.NativeQuery","Value.NullableEquals","Value.RemoveMetadata","Value.ReplaceMetadata","Value.ReplaceType","Value.Subtract","Value.Type","ValueAction.NativeStatement","ValueAction.Replace","Variable.Value","Web.Contents","Web.Page","WebAction.Request","Xml.Document","Xml.Tables"],builtinConstants:["BinaryEncoding.Base64","BinaryEncoding.Hex","BinaryOccurrence.Optional","BinaryOccurrence.Repeating","BinaryOccurrence.Required","ByteOrder.BigEndian","ByteOrder.LittleEndian","Compression.Deflate","Compression.GZip","CsvStyle.QuoteAfterDelimiter","CsvStyle.QuoteAlways","Culture.Current","Day.Friday","Day.Monday","Day.Saturday","Day.Sunday","Day.Thursday","Day.Tuesday","Day.Wednesday","ExtraValues.Error","ExtraValues.Ignore","ExtraValues.List","GroupKind.Global","GroupKind.Local","JoinAlgorithm.Dynamic","JoinAlgorithm.LeftHash","JoinAlgorithm.LeftIndex","JoinAlgorithm.PairwiseHash","JoinAlgorithm.RightHash","JoinAlgorithm.RightIndex","JoinAlgorithm.SortMerge","JoinKind.FullOuter","JoinKind.Inner","JoinKind.LeftAnti","JoinKind.LeftOuter","JoinKind.RightAnti","JoinKind.RightOuter","JoinSide.Left","JoinSide.Right","MissingField.Error","MissingField.Ignore","MissingField.UseNull","Number.E","Number.Epsilon","Number.NaN","Number.NegativeInfinity","Number.PI","Number.PositiveInfinity","Occurrence.All","Occurrence.First","Occurrence.Last","Occurrence.Optional","Occurrence.Repeating","Occurrence.Required","Order.Ascending","Order.Descending","Precision.Decimal","Precision.Double","QuoteStyle.Csv","QuoteStyle.None","RelativePosition.FromEnd","RelativePosition.FromStart","RoundingMode.AwayFromZero","RoundingMode.Down","RoundingMode.ToEven","RoundingMode.TowardZero","RoundingMode.Up","SapHanaDistribution.All","SapHanaDistribution.Connection","SapHanaDistribution.Off","SapHanaDistribution.Statement","SapHanaRangeOperator.Equals","SapHanaRangeOperator.GreaterThan","SapHanaRangeOperator.GreaterThanOrEquals","SapHanaRangeOperator.LessThan","SapHanaRangeOperator.LessThanOrEquals","SapHanaRangeOperator.NotEquals","TextEncoding.Ascii","TextEncoding.BigEndianUnicode","TextEncoding.Unicode","TextEncoding.Utf16","TextEncoding.Utf8","TextEncoding.Windows","TraceLevel.Critical","TraceLevel.Error","TraceLevel.Information","TraceLevel.Verbose","TraceLevel.Warning","WebMethod.Delete","WebMethod.Get","WebMethod.Head","WebMethod.Patch","WebMethod.Post","WebMethod.Put"],builtinTypes:["Action.Type","Any.Type","Binary.Type","BinaryEncoding.Type","BinaryOccurrence.Type","Byte.Type","ByteOrder.Type","Character.Type","Compression.Type","CsvStyle.Type","Currency.Type","Date.Type","DateTime.Type","DateTimeZone.Type","Day.Type","Decimal.Type","Double.Type","Duration.Type","ExtraValues.Type","Function.Type","GroupKind.Type","Guid.Type","Int16.Type","Int32.Type","Int64.Type","Int8.Type","JoinAlgorithm.Type","JoinKind.Type","JoinSide.Type","List.Type","Logical.Type","MissingField.Type","None.Type","Null.Type","Number.Type","Occurrence.Type","Order.Type","Password.Type","Percentage.Type","Precision.Type","QuoteStyle.Type","Record.Type","RelativePosition.Type","RoundingMode.Type","SapHanaDistribution.Type","SapHanaRangeOperator.Type","Single.Type","Table.Type","Text.Type","TextEncoding.Type","Time.Type","TraceLevel.Type","Type.Type","Uri.Type","WebMethod.Type"],tokenizer:{root:[[/#"[\w \.]+"/,"identifier.quote"],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F]+/,"number.hex"],[/\d+([eE][\-+]?\d+)?/,"number"],[/(#?[a-z]+)\b/,{cases:{"@typeKeywords":"type","@keywords":"keyword","@constants":"constant","@constructors":"constructor","@operatorKeywords":"operators","@default":"identifier"}}],[/\b([A-Z][a-zA-Z0-9]+\.Type)\b/,{cases:{"@builtinTypes":"type","@default":"identifier"}}],[/\b([A-Z][a-zA-Z0-9]+\.[A-Z][a-zA-Z0-9]+)\b/,{cases:{"@builtinFunctions":"keyword.function","@builtinConstants":"constant","@default":"identifier"}}],[/\b([a-zA-Z_][\w\.]*)\b/,"identifier"],{include:"@whitespace"},{include:"@comments"},{include:"@strings"},[/[{}()\[\]]/,"@brackets"],[/([=\+<>\-\*&@\?\/!])|([<>]=)|(<>)|(=>)|(\.\.\.)|(\.\.)/,"operators"],[/[,;]/,"delimiter"]],whitespace:[[/\s+/,"white"]],comments:[["\\/\\*","comment","@comment"],["\\/\\/+.*","comment"]],comment:[["\\*\\/","comment","@pop"],[".","comment"]],strings:[['"',"string","@string"]],string:[['""',"string.escape"],['"',"string","@pop"],[".","string"]]}}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/powershell/powershell.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/powershell/powershell.js new file mode 100644 index 0000000..a18ffd6 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/powershell/powershell.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/powershell/powershell",["require","exports"],(function(e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.language=n.conf=void 0,n.conf={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"#",blockComment:["<#","#>"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*#region\\b"),end:new RegExp("^\\s*#endregion\\b")}}},n.language={defaultToken:"",ignoreCase:!0,tokenPostfix:".ps1",brackets:[{token:"delimiter.curly",open:"{",close:"}"},{token:"delimiter.square",open:"[",close:"]"},{token:"delimiter.parenthesis",open:"(",close:")"}],keywords:["begin","break","catch","class","continue","data","define","do","dynamicparam","else","elseif","end","exit","filter","finally","for","foreach","from","function","if","in","param","process","return","switch","throw","trap","try","until","using","var","while","workflow","parallel","sequence","inlinescript","configuration"],helpKeywords:/SYNOPSIS|DESCRIPTION|PARAMETER|EXAMPLE|INPUTS|OUTPUTS|NOTES|LINK|COMPONENT|ROLE|FUNCTIONALITY|FORWARDHELPTARGETNAME|FORWARDHELPCATEGORY|REMOTEHELPRUNSPACE|EXTERNALHELP/,symbols:/[=>/,"comment","@pop"],[/(\.)(@helpKeywords)(?!\w)/,{token:"comment.keyword.$2"}],[/[\.#]/,"comment"]]}}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/pug/pug.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/pug/pug.js new file mode 100644 index 0000000..eac3767 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/pug/pug.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/pug/pug",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.language=t.conf=void 0,t.conf={comments:{lineComment:"//"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:'"',close:'"',notIn:["string","comment"]},{open:"'",close:"'",notIn:["string","comment"]},{open:"{",close:"}",notIn:["string","comment"]},{open:"[",close:"]",notIn:["string","comment"]},{open:"(",close:")",notIn:["string","comment"]}],folding:{offSide:!0}},t.language={defaultToken:"",tokenPostfix:".pug",ignoreCase:!0,brackets:[{token:"delimiter.curly",open:"{",close:"}"},{token:"delimiter.array",open:"[",close:"]"},{token:"delimiter.parenthesis",open:"(",close:")"}],keywords:["append","block","case","default","doctype","each","else","extends","for","if","in","include","mixin","typeof","unless","var","when"],tags:["a","abbr","acronym","address","area","article","aside","audio","b","base","basefont","bdi","bdo","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","command","datalist","dd","del","details","dfn","div","dl","dt","em","embed","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","keygen","kbd","label","li","link","map","mark","menu","meta","meter","nav","noframes","noscript","object","ol","optgroup","option","output","p","param","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strike","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","tracks","tt","u","ul","video","wbr"],symbols:/[\+\-\*\%\&\|\!\=\/\.\,\:]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[[/^(\s*)([a-zA-Z_-][\w-]*)/,{cases:{"$2@tags":{cases:{"@eos":["","tag"],"@default":["",{token:"tag",next:"@tag.$1"}]}},"$2@keywords":["",{token:"keyword.$2"}],"@default":["",""]}}],[/^(\s*)(#[a-zA-Z_-][\w-]*)/,{cases:{"@eos":["","tag.id"],"@default":["",{token:"tag.id",next:"@tag.$1"}]}}],[/^(\s*)(\.[a-zA-Z_-][\w-]*)/,{cases:{"@eos":["","tag.class"],"@default":["",{token:"tag.class",next:"@tag.$1"}]}}],[/^(\s*)(\|.*)$/,""],{include:"@whitespace"},[/[a-zA-Z_$][\w$]*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":""}}],[/[{}()\[\]]/,"@brackets"],[/@symbols/,"delimiter"],[/\d+\.\d+([eE][\-+]?\d+)?/,"number.float"],[/\d+/,"number"],[/"/,"string",'@string."'],[/'/,"string","@string.'"]],tag:[[/(\.)(\s*$)/,[{token:"delimiter",next:"@blockText.$S2."},""]],[/\s+/,{token:"",next:"@simpleText"}],[/#[a-zA-Z_-][\w-]*/,{cases:{"@eos":{token:"tag.id",next:"@pop"},"@default":"tag.id"}}],[/\.[a-zA-Z_-][\w-]*/,{cases:{"@eos":{token:"tag.class",next:"@pop"},"@default":"tag.class"}}],[/\(/,{token:"delimiter.parenthesis",next:"@attributeList"}]],simpleText:[[/[^#]+$/,{token:"",next:"@popall"}],[/[^#]+/,{token:""}],[/(#{)([^}]*)(})/,{cases:{"@eos":["interpolation.delimiter","interpolation",{token:"interpolation.delimiter",next:"@popall"}],"@default":["interpolation.delimiter","interpolation","interpolation.delimiter"]}}],[/#$/,{token:"",next:"@popall"}],[/#/,""]],attributeList:[[/\s+/,""],[/(\w+)(\s*=\s*)("|')/,["attribute.name","delimiter",{token:"attribute.value",next:"@value.$3"}]],[/\w+/,"attribute.name"],[/,/,{cases:{"@eos":{token:"attribute.delimiter",next:"@popall"},"@default":"attribute.delimiter"}}],[/\)$/,{token:"delimiter.parenthesis",next:"@popall"}],[/\)/,{token:"delimiter.parenthesis",next:"@pop"}]],whitespace:[[/^(\s*)(\/\/.*)$/,{token:"comment",next:"@blockText.$1.comment"}],[/[ \t\r\n]+/,""],[//,{token:"comment",next:"@pop"}],[//,"comment.html","@pop"],[/[^-]+/,"comment.content.html"],[/./,"comment.content.html"]],otherTag:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.otherTag"}],[/\/?>/,"delimiter.html","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.script"}],[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],scriptAfterType:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.scriptAfterType"}],[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.scriptAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.scriptWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInEmbeddedState.scriptEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],style:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.style"}],[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],styleAfterType:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.styleAfterType"}],[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.styleAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.styleWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInEmbeddedState.styleEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],razorInSimpleState:[[/@\*/,"comment.cs","@razorBlockCommentTopLevel"],[/@[{(]/,"metatag.cs","@razorRootTopLevel"],[/(@)(\s*[\w]+)/,["metatag.cs",{token:"identifier.cs",switchTo:"@$S2.$S3"}]],[/[})]/,{token:"metatag.cs",switchTo:"@$S2.$S3"}],[/\*@/,{token:"comment.cs",switchTo:"@$S2.$S3"}]],razorInEmbeddedState:[[/@\*/,"comment.cs","@razorBlockCommentTopLevel"],[/@[{(]/,"metatag.cs","@razorRootTopLevel"],[/(@)(\s*[\w]+)/,["metatag.cs",{token:"identifier.cs",switchTo:"@$S2.$S3",nextEmbedded:"$S3"}]],[/[})]/,{token:"metatag.cs",switchTo:"@$S2.$S3",nextEmbedded:"$S3"}],[/\*@/,{token:"comment.cs",switchTo:"@$S2.$S3",nextEmbedded:"$S3"}]],razorBlockCommentTopLevel:[[/\*@/,"@rematch","@pop"],[/[^*]+/,"comment.cs"],[/./,"comment.cs"]],razorBlockComment:[[/\*@/,"comment.cs","@pop"],[/[^*]+/,"comment.cs"],[/./,"comment.cs"]],razorRootTopLevel:[[/\{/,"delimiter.bracket.cs","@razorRoot"],[/\(/,"delimiter.parenthesis.cs","@razorRoot"],[/[})]/,"@rematch","@pop"],{include:"razorCommon"}],razorRoot:[[/\{/,"delimiter.bracket.cs","@razorRoot"],[/\(/,"delimiter.parenthesis.cs","@razorRoot"],[/\}/,"delimiter.bracket.cs","@pop"],[/\)/,"delimiter.parenthesis.cs","@pop"],{include:"razorCommon"}],razorCommon:[[/[a-zA-Z_]\w*/,{cases:{"@razorKeywords":{token:"keyword.cs"},"@default":"identifier.cs"}}],[/[\[\]]/,"delimiter.array.cs"],[/[ \t\r\n]+/],[/\/\/.*$/,"comment.cs"],[/@\*/,"comment.cs","@razorBlockComment"],[/"([^"]*)"/,"string.cs"],[/'([^']*)'/,"string.cs"],[/(<)(\w+)(\/>)/,["delimiter.html","tag.html","delimiter.html"]],[/(<)(\w+)(>)/,["delimiter.html","tag.html","delimiter.html"]],[/(<\/)(\w+)(>)/,["delimiter.html","tag.html","delimiter.html"]],[/[\+\-\*\%\&\|\^\~\!\=\<\>\/\?\;\:\.\,]/,"delimiter.cs"],[/\d*\d+[eE]([\-+]?\d+)?/,"number.float.cs"],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float.cs"],[/0[xX][0-9a-fA-F']*[0-9a-fA-F]/,"number.hex.cs"],[/0[0-7']*[0-7]/,"number.octal.cs"],[/0[bB][0-1']*[0-1]/,"number.binary.cs"],[/\d[\d']*/,"number.cs"],[/\d/,"number.cs"]]},razorKeywords:["abstract","as","async","await","base","bool","break","by","byte","case","catch","char","checked","class","const","continue","decimal","default","delegate","do","double","descending","explicit","event","extern","else","enum","false","finally","fixed","float","for","foreach","from","goto","group","if","implicit","in","int","interface","internal","into","is","lock","long","nameof","new","null","namespace","object","operator","out","override","orderby","params","private","protected","public","readonly","ref","return","switch","struct","sbyte","sealed","short","sizeof","stackalloc","static","string","select","this","throw","true","try","typeof","uint","ulong","unchecked","unsafe","ushort","using","var","virtual","volatile","void","when","while","where","yield","model","inject"],escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/redis/redis.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/redis/redis.js new file mode 100644 index 0000000..281c212 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/redis/redis.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/redis/redis",["require","exports"],(function(E,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.language=e.conf=void 0,e.conf={brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},e.language={defaultToken:"",tokenPostfix:".redis",ignoreCase:!0,brackets:[{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],keywords:["APPEND","AUTH","BGREWRITEAOF","BGSAVE","BITCOUNT","BITFIELD","BITOP","BITPOS","BLPOP","BRPOP","BRPOPLPUSH","CLIENT","KILL","LIST","GETNAME","PAUSE","REPLY","SETNAME","CLUSTER","ADDSLOTS","COUNT-FAILURE-REPORTS","COUNTKEYSINSLOT","DELSLOTS","FAILOVER","FORGET","GETKEYSINSLOT","INFO","KEYSLOT","MEET","NODES","REPLICATE","RESET","SAVECONFIG","SET-CONFIG-EPOCH","SETSLOT","SLAVES","SLOTS","COMMAND","COUNT","GETKEYS","CONFIG","GET","REWRITE","SET","RESETSTAT","DBSIZE","DEBUG","OBJECT","SEGFAULT","DECR","DECRBY","DEL","DISCARD","DUMP","ECHO","EVAL","EVALSHA","EXEC","EXISTS","EXPIRE","EXPIREAT","FLUSHALL","FLUSHDB","GEOADD","GEOHASH","GEOPOS","GEODIST","GEORADIUS","GEORADIUSBYMEMBER","GETBIT","GETRANGE","GETSET","HDEL","HEXISTS","HGET","HGETALL","HINCRBY","HINCRBYFLOAT","HKEYS","HLEN","HMGET","HMSET","HSET","HSETNX","HSTRLEN","HVALS","INCR","INCRBY","INCRBYFLOAT","KEYS","LASTSAVE","LINDEX","LINSERT","LLEN","LPOP","LPUSH","LPUSHX","LRANGE","LREM","LSET","LTRIM","MGET","MIGRATE","MONITOR","MOVE","MSET","MSETNX","MULTI","PERSIST","PEXPIRE","PEXPIREAT","PFADD","PFCOUNT","PFMERGE","PING","PSETEX","PSUBSCRIBE","PUBSUB","PTTL","PUBLISH","PUNSUBSCRIBE","QUIT","RANDOMKEY","READONLY","READWRITE","RENAME","RENAMENX","RESTORE","ROLE","RPOP","RPOPLPUSH","RPUSH","RPUSHX","SADD","SAVE","SCARD","SCRIPT","FLUSH","LOAD","SDIFF","SDIFFSTORE","SELECT","SETBIT","SETEX","SETNX","SETRANGE","SHUTDOWN","SINTER","SINTERSTORE","SISMEMBER","SLAVEOF","SLOWLOG","SMEMBERS","SMOVE","SORT","SPOP","SRANDMEMBER","SREM","STRLEN","SUBSCRIBE","SUNION","SUNIONSTORE","SWAPDB","SYNC","TIME","TOUCH","TTL","TYPE","UNSUBSCRIBE","UNLINK","UNWATCH","WAIT","WATCH","ZADD","ZCARD","ZCOUNT","ZINCRBY","ZINTERSTORE","ZLEXCOUNT","ZRANGE","ZRANGEBYLEX","ZREVRANGEBYLEX","ZRANGEBYSCORE","ZRANK","ZREM","ZREMRANGEBYLEX","ZREMRANGEBYRANK","ZREMRANGEBYSCORE","ZREVRANGE","ZREVRANGEBYSCORE","ZREVRANK","ZSCORE","ZUNIONSTORE","SCAN","SSCAN","HSCAN","ZSCAN"],operators:[],builtinFunctions:[],builtinVariables:[],pseudoColumns:[],tokenizer:{root:[{include:"@whitespace"},{include:"@pseudoColumns"},{include:"@numbers"},{include:"@strings"},{include:"@scopes"},[/[;,.]/,"delimiter"],[/[()]/,"@brackets"],[/[\w@#$]+/,{cases:{"@keywords":"keyword","@operators":"operator","@builtinVariables":"predefined","@builtinFunctions":"predefined","@default":"identifier"}}],[/[<>=!%&+\-*/|~^]/,"operator"]],whitespace:[[/\s+/,"white"]],pseudoColumns:[[/[$][A-Za-z_][\w@#$]*/,{cases:{"@pseudoColumns":"predefined","@default":"identifier"}}]],numbers:[[/0[xX][0-9a-fA-F]*/,"number"],[/[$][+-]*\d*(\.\d*)?/,"number"],[/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/,"number"]],strings:[[/'/,{token:"string",next:"@string"}],[/"/,{token:"string.double",next:"@stringDouble"}]],string:[[/[^']+/,"string"],[/''/,"string"],[/'/,{token:"string",next:"@pop"}]],stringDouble:[[/[^"]+/,"string.double"],[/""/,"string.double"],[/"/,{token:"string.double",next:"@pop"}]],scopes:[]}}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/redshift/redshift.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/redshift/redshift.js new file mode 100644 index 0000000..7014a4c --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/redshift/redshift.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/redshift/redshift",["require","exports"],(function(e,_){"use strict";Object.defineProperty(_,"__esModule",{value:!0}),_.language=_.conf=void 0,_.conf={comments:{lineComment:"--",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},_.language={defaultToken:"",tokenPostfix:".sql",ignoreCase:!0,brackets:[{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],keywords:["AES128","AES256","ALL","ALLOWOVERWRITE","ANALYSE","ANALYZE","AND","ANY","ARRAY","AS","ASC","AUTHORIZATION","BACKUP","BETWEEN","BINARY","BLANKSASNULL","BOTH","BYTEDICT","BZIP2","CASE","CAST","CHECK","COLLATE","COLUMN","CONSTRAINT","CREATE","CREDENTIALS","CROSS","CURRENT_DATE","CURRENT_TIME","CURRENT_TIMESTAMP","CURRENT_USER","CURRENT_USER_ID","DEFAULT","DEFERRABLE","DEFLATE","DEFRAG","DELTA","DELTA32K","DESC","DISABLE","DISTINCT","DO","ELSE","EMPTYASNULL","ENABLE","ENCODE","ENCRYPT","ENCRYPTION","END","EXCEPT","EXPLICIT","FALSE","FOR","FOREIGN","FREEZE","FROM","FULL","GLOBALDICT256","GLOBALDICT64K","GRANT","GROUP","GZIP","HAVING","IDENTITY","IGNORE","ILIKE","IN","INITIALLY","INNER","INTERSECT","INTO","IS","ISNULL","JOIN","LEADING","LEFT","LIKE","LIMIT","LOCALTIME","LOCALTIMESTAMP","LUN","LUNS","LZO","LZOP","MINUS","MOSTLY13","MOSTLY32","MOSTLY8","NATURAL","NEW","NOT","NOTNULL","NULL","NULLS","OFF","OFFLINE","OFFSET","OID","OLD","ON","ONLY","OPEN","OR","ORDER","OUTER","OVERLAPS","PARALLEL","PARTITION","PERCENT","PERMISSIONS","PLACING","PRIMARY","RAW","READRATIO","RECOVER","REFERENCES","RESPECT","REJECTLOG","RESORT","RESTORE","RIGHT","SELECT","SESSION_USER","SIMILAR","SNAPSHOT","SOME","SYSDATE","SYSTEM","TABLE","TAG","TDES","TEXT255","TEXT32K","THEN","TIMESTAMP","TO","TOP","TRAILING","TRUE","TRUNCATECOLUMNS","UNION","UNIQUE","USER","USING","VERBOSE","WALLET","WHEN","WHERE","WITH","WITHOUT"],operators:["AND","BETWEEN","IN","LIKE","NOT","OR","IS","NULL","INTERSECT","UNION","INNER","JOIN","LEFT","OUTER","RIGHT"],builtinFunctions:["current_schema","current_schemas","has_database_privilege","has_schema_privilege","has_table_privilege","age","current_time","current_timestamp","localtime","isfinite","now","ascii","get_bit","get_byte","set_bit","set_byte","to_ascii","approximate percentile_disc","avg","count","listagg","max","median","min","percentile_cont","stddev_samp","stddev_pop","sum","var_samp","var_pop","bit_and","bit_or","bool_and","bool_or","cume_dist","first_value","lag","last_value","lead","nth_value","ratio_to_report","dense_rank","ntile","percent_rank","rank","row_number","case","coalesce","decode","greatest","least","nvl","nvl2","nullif","add_months","at time zone","convert_timezone","current_date","date_cmp","date_cmp_timestamp","date_cmp_timestamptz","date_part_year","dateadd","datediff","date_part","date_trunc","extract","getdate","interval_cmp","last_day","months_between","next_day","sysdate","timeofday","timestamp_cmp","timestamp_cmp_date","timestamp_cmp_timestamptz","timestamptz_cmp","timestamptz_cmp_date","timestamptz_cmp_timestamp","timezone","to_timestamp","trunc","abs","acos","asin","atan","atan2","cbrt","ceil","ceiling","checksum","cos","cot","degrees","dexp","dlog1","dlog10","exp","floor","ln","log","mod","pi","power","radians","random","round","sin","sign","sqrt","tan","to_hex","bpcharcmp","btrim","bttext_pattern_cmp","char_length","character_length","charindex","chr","concat","crc32","func_sha1","initcap","left and rights","len","length","lower","lpad and rpads","ltrim","md5","octet_length","position","quote_ident","quote_literal","regexp_count","regexp_instr","regexp_replace","regexp_substr","repeat","replace","replicate","reverse","rtrim","split_part","strpos","strtol","substring","textlen","translate","trim","upper","cast","convert","to_char","to_date","to_number","json_array_length","json_extract_array_element_text","json_extract_path_text","current_setting","pg_cancel_backend","pg_terminate_backend","set_config","current_database","current_user","current_user_id","pg_backend_pid","pg_last_copy_count","pg_last_copy_id","pg_last_query_id","pg_last_unload_count","session_user","slice_num","user","version","abbrev","acosd","any","area","array_agg","array_append","array_cat","array_dims","array_fill","array_length","array_lower","array_ndims","array_position","array_positions","array_prepend","array_remove","array_replace","array_to_json","array_to_string","array_to_tsvector","array_upper","asind","atan2d","atand","bit","bit_length","bound_box","box","brin_summarize_new_values","broadcast","cardinality","center","circle","clock_timestamp","col_description","concat_ws","convert_from","convert_to","corr","cosd","cotd","covar_pop","covar_samp","current_catalog","current_query","current_role","currval","cursor_to_xml","diameter","div","encode","enum_first","enum_last","enum_range","every","family","format","format_type","generate_series","generate_subscripts","get_current_ts_config","gin_clean_pending_list","grouping","has_any_column_privilege","has_column_privilege","has_foreign_data_wrapper_privilege","has_function_privilege","has_language_privilege","has_sequence_privilege","has_server_privilege","has_tablespace_privilege","has_type_privilege","height","host","hostmask","inet_client_addr","inet_client_port","inet_merge","inet_same_family","inet_server_addr","inet_server_port","isclosed","isempty","isopen","json_agg","json_object","json_object_agg","json_populate_record","json_populate_recordset","json_to_record","json_to_recordset","jsonb_agg","jsonb_object_agg","justify_days","justify_hours","justify_interval","lastval","left","line","localtimestamp","lower_inc","lower_inf","lpad","lseg","make_date","make_interval","make_time","make_timestamp","make_timestamptz","masklen","mode","netmask","network","nextval","npoints","num_nonnulls","num_nulls","numnode","obj_description","overlay","parse_ident","path","pclose","percentile_disc","pg_advisory_lock","pg_advisory_lock_shared","pg_advisory_unlock","pg_advisory_unlock_all","pg_advisory_unlock_shared","pg_advisory_xact_lock","pg_advisory_xact_lock_shared","pg_backup_start_time","pg_blocking_pids","pg_client_encoding","pg_collation_is_visible","pg_column_size","pg_conf_load_time","pg_control_checkpoint","pg_control_init","pg_control_recovery","pg_control_system","pg_conversion_is_visible","pg_create_logical_replication_slot","pg_create_physical_replication_slot","pg_create_restore_point","pg_current_xlog_flush_location","pg_current_xlog_insert_location","pg_current_xlog_location","pg_database_size","pg_describe_object","pg_drop_replication_slot","pg_export_snapshot","pg_filenode_relation","pg_function_is_visible","pg_get_constraintdef","pg_get_expr","pg_get_function_arguments","pg_get_function_identity_arguments","pg_get_function_result","pg_get_functiondef","pg_get_indexdef","pg_get_keywords","pg_get_object_address","pg_get_owned_sequence","pg_get_ruledef","pg_get_serial_sequence","pg_get_triggerdef","pg_get_userbyid","pg_get_viewdef","pg_has_role","pg_identify_object","pg_identify_object_as_address","pg_index_column_has_property","pg_index_has_property","pg_indexam_has_property","pg_indexes_size","pg_is_in_backup","pg_is_in_recovery","pg_is_other_temp_schema","pg_is_xlog_replay_paused","pg_last_committed_xact","pg_last_xact_replay_timestamp","pg_last_xlog_receive_location","pg_last_xlog_replay_location","pg_listening_channels","pg_logical_emit_message","pg_logical_slot_get_binary_changes","pg_logical_slot_get_changes","pg_logical_slot_peek_binary_changes","pg_logical_slot_peek_changes","pg_ls_dir","pg_my_temp_schema","pg_notification_queue_usage","pg_opclass_is_visible","pg_operator_is_visible","pg_opfamily_is_visible","pg_options_to_table","pg_postmaster_start_time","pg_read_binary_file","pg_read_file","pg_relation_filenode","pg_relation_filepath","pg_relation_size","pg_reload_conf","pg_replication_origin_create","pg_replication_origin_drop","pg_replication_origin_oid","pg_replication_origin_progress","pg_replication_origin_session_is_setup","pg_replication_origin_session_progress","pg_replication_origin_session_reset","pg_replication_origin_session_setup","pg_replication_origin_xact_reset","pg_replication_origin_xact_setup","pg_rotate_logfile","pg_size_bytes","pg_size_pretty","pg_sleep","pg_sleep_for","pg_sleep_until","pg_start_backup","pg_stat_file","pg_stop_backup","pg_switch_xlog","pg_table_is_visible","pg_table_size","pg_tablespace_databases","pg_tablespace_location","pg_tablespace_size","pg_total_relation_size","pg_trigger_depth","pg_try_advisory_lock","pg_try_advisory_lock_shared","pg_try_advisory_xact_lock","pg_try_advisory_xact_lock_shared","pg_ts_config_is_visible","pg_ts_dict_is_visible","pg_ts_parser_is_visible","pg_ts_template_is_visible","pg_type_is_visible","pg_typeof","pg_xact_commit_timestamp","pg_xlog_location_diff","pg_xlog_replay_pause","pg_xlog_replay_resume","pg_xlogfile_name","pg_xlogfile_name_offset","phraseto_tsquery","plainto_tsquery","point","polygon","popen","pqserverversion","query_to_xml","querytree","quote_nullable","radius","range_merge","regexp_matches","regexp_split_to_array","regexp_split_to_table","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","right","row_security_active","row_to_json","rpad","scale","set_masklen","setseed","setval","setweight","shobj_description","sind","sprintf","statement_timestamp","stddev","string_agg","string_to_array","strip","substr","table_to_xml","table_to_xml_and_xmlschema","tand","text","to_json","to_regclass","to_regnamespace","to_regoper","to_regoperator","to_regproc","to_regprocedure","to_regrole","to_regtype","to_tsquery","to_tsvector","transaction_timestamp","ts_debug","ts_delete","ts_filter","ts_headline","ts_lexize","ts_parse","ts_rank","ts_rank_cd","ts_rewrite","ts_stat","ts_token_type","tsquery_phrase","tsvector_to_array","tsvector_update_trigger","tsvector_update_trigger_column","txid_current","txid_current_snapshot","txid_snapshot_xip","txid_snapshot_xmax","txid_snapshot_xmin","txid_visible_in_snapshot","unnest","upper_inc","upper_inf","variance","width","width_bucket","xml_is_well_formed","xml_is_well_formed_content","xml_is_well_formed_document","xmlagg","xmlcomment","xmlconcat","xmlelement","xmlexists","xmlforest","xmlparse","xmlpi","xmlroot","xmlserialize","xpath","xpath_exists"],builtinVariables:[],pseudoColumns:[],tokenizer:{root:[{include:"@comments"},{include:"@whitespace"},{include:"@pseudoColumns"},{include:"@numbers"},{include:"@strings"},{include:"@complexIdentifiers"},{include:"@scopes"},[/[;,.]/,"delimiter"],[/[()]/,"@brackets"],[/[\w@#$]+/,{cases:{"@keywords":"keyword","@operators":"operator","@builtinVariables":"predefined","@builtinFunctions":"predefined","@default":"identifier"}}],[/[<>=!%&+\-*/|~^]/,"operator"]],whitespace:[[/\s+/,"white"]],comments:[[/--+.*/,"comment"],[/\/\*/,{token:"comment.quote",next:"@comment"}]],comment:[[/[^*/]+/,"comment"],[/\*\//,{token:"comment.quote",next:"@pop"}],[/./,"comment"]],pseudoColumns:[[/[$][A-Za-z_][\w@#$]*/,{cases:{"@pseudoColumns":"predefined","@default":"identifier"}}]],numbers:[[/0[xX][0-9a-fA-F]*/,"number"],[/[$][+-]*\d*(\.\d*)?/,"number"],[/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/,"number"]],strings:[[/'/,{token:"string",next:"@string"}]],string:[[/[^']+/,"string"],[/''/,"string"],[/'/,{token:"string",next:"@pop"}]],complexIdentifiers:[[/"/,{token:"identifier.quote",next:"@quotedIdentifier"}]],quotedIdentifier:[[/[^"]+/,"identifier"],[/""/,"identifier"],[/"/,{token:"identifier.quote",next:"@pop"}]],scopes:[]}}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/restructuredtext/restructuredtext.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/restructuredtext/restructuredtext.js new file mode 100644 index 0000000..7d1a068 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/restructuredtext/restructuredtext.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/restructuredtext/restructuredtext",["require","exports"],(function(e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.language=n.conf=void 0,n.conf={brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">",notIn:["string"]}],surroundingPairs:[{open:"(",close:")"},{open:"[",close:"]"},{open:"`",close:"`"}],folding:{markers:{start:new RegExp("^\\s*\x3c!--\\s*#?region\\b.*--\x3e"),end:new RegExp("^\\s*\x3c!--\\s*#?endregion\\b.*--\x3e")}}},n.language={defaultToken:"",tokenPostfix:".rst",control:/[\\`*_\[\]{}()#+\-\.!]/,escapes:/\\(?:@control)/,empty:["area","base","basefont","br","col","frame","hr","img","input","isindex","link","meta","param"],alphanumerics:/[A-Za-z0-9]/,alphanumericsplus:/[A-Za-z0-9-_+:.]/,simpleRefNameWithoutBq:/(?:@alphanumerics@alphanumericsplus*@alphanumerics)+|(?:@alphanumerics+)/,simpleRefName:/(?:`@simpleRefNameWithoutBq`|@simpleRefNameWithoutBq)/,phrase:/@simpleRefName(?:\s@simpleRefName)*/,citationName:/[A-Za-z][A-Za-z0-9-_.]*/,blockLiteralStart:/(?:[!"#$%&'()*+,-./:;<=>?@\[\]^_`{|}~]|[\s])/,precedingChars:/(?:[ -:/'"<([{])/,followingChars:/(?:[ -.,:;!?/'")\]}>]|$)/,punctuation:/(=|-|~|`|#|"|\^|\+|\*|:|\.|'|_|\+)/,tokenizer:{root:[[/^(@punctuation{3,}$){1,1}?/,"keyword"],[/^\s*([\*\-+‣•]|[a-zA-Z0-9]+\.|\([a-zA-Z0-9]+\)|[a-zA-Z0-9]+\))\s/,"keyword"],[/([ ]::)\s*$/,"keyword","@blankLineOfLiteralBlocks"],[/(::)\s*$/,"keyword","@blankLineOfLiteralBlocks"],{include:"@tables"},{include:"@explicitMarkupBlocks"},{include:"@inlineMarkup"}],explicitMarkupBlocks:[{include:"@citations"},{include:"@footnotes"},[/^(\.\.\s)(@simpleRefName)(::\s)(.*)$/,[{token:"",next:"subsequentLines"},"keyword","",""]],[/^(\.\.)(\s+)(_)(@simpleRefName)(:)(\s+)(.*)/,[{token:"",next:"hyperlinks"},"","","string.link","","","string.link"]],[/^((?:(?:\.\.)(?:\s+))?)(__)(:)(\s+)(.*)/,[{token:"",next:"subsequentLines"},"","","","string.link"]],[/^(__\s+)(.+)/,["","string.link"]],[/^(\.\.)( \|)([^| ]+[^|]*[^| ]*)(\| )(@simpleRefName)(:: .*)/,[{token:"",next:"subsequentLines"},"","string.link","","keyword",""],"@rawBlocks"],[/(\|)([^| ]+[^|]*[^| ]*)(\|_{0,2})/,["","string.link",""]],[/^(\.\.)([ ].*)$/,[{token:"",next:"@comments"},"comment"]]],inlineMarkup:[{include:"@citationsReference"},{include:"@footnotesReference"},[/(@simpleRefName)(_{1,2})/,["string.link",""]],[/(`)([^<`]+\s+)(<)(.*)(>)(`)(_)/,["","string.link","","string.link","","",""]],[/\*\*([^\\*]|\*(?!\*))+\*\*/,"strong"],[/\*[^*]+\*/,"emphasis"],[/(``)((?:[^`]|\`(?!`))+)(``)/,["","keyword",""]],[/(__\s+)(.+)/,["","keyword"]],[/(:)((?:@simpleRefNameWithoutBq)?)(:`)([^`]+)(`)/,["","keyword","","",""]],[/(`)([^`]+)(`:)((?:@simpleRefNameWithoutBq)?)(:)/,["","","","keyword",""]],[/(`)([^`]+)(`)/,""],[/(_`)(@phrase)(`)/,["","string.link",""]]],citations:[[/^(\.\.\s+\[)((?:@citationName))(\]\s+)(.*)/,[{token:"",next:"@subsequentLines"},"string.link","",""]]],citationsReference:[[/(\[)(@citationName)(\]_)/,["","string.link",""]]],footnotes:[[/^(\.\.\s+\[)((?:[0-9]+))(\]\s+.*)/,[{token:"",next:"@subsequentLines"},"string.link",""]],[/^(\.\.\s+\[)((?:#@simpleRefName?))(\]\s+)(.*)/,[{token:"",next:"@subsequentLines"},"string.link","",""]],[/^(\.\.\s+\[)((?:\*))(\]\s+)(.*)/,[{token:"",next:"@subsequentLines"},"string.link","",""]]],footnotesReference:[[/(\[)([0-9]+)(\])(_)/,["","string.link","",""]],[/(\[)(#@simpleRefName?)(\])(_)/,["","string.link","",""]],[/(\[)(\*)(\])(_)/,["","string.link","",""]]],blankLineOfLiteralBlocks:[[/^$/,"","@subsequentLinesOfLiteralBlocks"],[/^.*$/,"","@pop"]],subsequentLinesOfLiteralBlocks:[[/(@blockLiteralStart+)(.*)/,["keyword",""]],[/^(?!blockLiteralStart)/,"","@popall"]],subsequentLines:[[/^[\s]+.*/,""],[/^(?!\s)/,"","@pop"]],hyperlinks:[[/^[\s]+.*/,"string.link"],[/^(?!\s)/,"","@pop"]],comments:[[/^[\s]+.*/,"comment"],[/^(?!\s)/,"","@pop"]],tables:[[/\+-[+-]+/,"keyword"],[/\+=[+=]+/,"keyword"]]}}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/ruby/ruby.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/ruby/ruby.js new file mode 100644 index 0000000..9bea1c3 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/ruby/ruby.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/ruby/ruby",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.language=t.conf=void 0,t.conf={comments:{lineComment:"#",blockComment:["=begin","=end"]},brackets:[["(",")"],["{","}"],["[","]"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],indentationRules:{increaseIndentPattern:new RegExp("^\\s*((begin|class|(private|protected)\\s+def|def|else|elsif|ensure|for|if|module|rescue|unless|until|when|while|case)|([^#]*\\sdo\\b)|([^#]*=\\s*(case|if|unless)))\\b([^#\\{;]|(\"|'|/).*\\4)*(#.*)?$"),decreaseIndentPattern:new RegExp("^\\s*([}\\]]([,)]?\\s*(#|$)|\\.[a-zA-Z_]\\w*\\b)|(end|rescue|ensure|else|elsif|when)\\b)")}},t.language={tokenPostfix:".ruby",keywords:["__LINE__","__ENCODING__","__FILE__","BEGIN","END","alias","and","begin","break","case","class","def","defined?","do","else","elsif","end","ensure","for","false","if","in","module","next","nil","not","or","redo","rescue","retry","return","self","super","then","true","undef","unless","until","when","while","yield"],keywordops:["::","..","...","?",":","=>"],builtins:["require","public","private","include","extend","attr_reader","protected","private_class_method","protected_class_method","new"],declarations:["module","class","def","case","do","begin","for","if","while","until","unless"],linedecls:["def","case","do","begin","for","if","while","until","unless"],operators:["^","&","|","<=>","==","===","!~","=~",">",">=","<","<=","<<",">>","+","-","*","/","%","**","~","+@","-@","[]","[]=","`","+=","-=","*=","**=","/=","^=","%=","<<=",">>=","&=","&&=","||=","|="],brackets:[{open:"(",close:")",token:"delimiter.parenthesis"},{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"}],symbols:/[=>"}],[/%([qws])(@delim)/,{token:"string.$1.delim",switchTo:"@qstring.$1.$2.$2"}],[/%r\(/,{token:"regexp.delim",switchTo:"@pregexp.(.)"}],[/%r\[/,{token:"regexp.delim",switchTo:"@pregexp.[.]"}],[/%r\{/,{token:"regexp.delim",switchTo:"@pregexp.{.}"}],[/%r"}],[/%r(@delim)/,{token:"regexp.delim",switchTo:"@pregexp.$1.$1"}],[/%(x|W|Q?)\(/,{token:"string.$1.delim",switchTo:"@qqstring.$1.(.)"}],[/%(x|W|Q?)\[/,{token:"string.$1.delim",switchTo:"@qqstring.$1.[.]"}],[/%(x|W|Q?)\{/,{token:"string.$1.delim",switchTo:"@qqstring.$1.{.}"}],[/%(x|W|Q?)"}],[/%(x|W|Q?)(@delim)/,{token:"string.$1.delim",switchTo:"@qqstring.$1.$2.$2"}],[/%([rqwsxW]|Q?)./,{token:"invalid",next:"@pop"}],[/./,{token:"invalid",next:"@pop"}]],qstring:[[/\\$/,"string.$S2.escape"],[/\\./,"string.$S2.escape"],[/./,{cases:{"$#==$S4":{token:"string.$S2.delim",next:"@pop"},"$#==$S3":{token:"string.$S2.delim",next:"@push"},"@default":"string.$S2"}}]],qqstring:[[/#/,"string.$S2.escape","@interpolated"],{include:"@qstring"}],whitespace:[[/[ \t\r\n]+/,""],[/^\s*=begin\b/,"comment","@comment"],[/#.*$/,"comment"]],comment:[[/[^=]+/,"comment"],[/^\s*=begin\b/,"comment.invalid"],[/^\s*=end\b.*/,"comment","@pop"],[/[=]/,"comment"]]}}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/rust/rust.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/rust/rust.js new file mode 100644 index 0000000..6fb3866 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/rust/rust.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/rust/rust",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.language=t.conf=void 0,t.conf={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"[",close:"]"},{open:"{",close:"}"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*#pragma\\s+region\\b"),end:new RegExp("^\\s*#pragma\\s+endregion\\b")}}},t.language={tokenPostfix:".rust",defaultToken:"invalid",keywords:["as","box","break","const","continue","crate","else","enum","extern","false","fn","for","if","impl","in","let","loop","match","mod","move","mut","pub","ref","return","self","static","struct","super","trait","true","type","unsafe","use","where","while","catch","default","union","static","abstract","alignof","become","do","final","macro","offsetof","override","priv","proc","pure","sizeof","typeof","unsized","virtual","yield"],typeKeywords:["Self","m32","m64","m128","f80","f16","f128","int","uint","float","char","bool","u8","u16","u32","u64","f32","f64","i8","i16","i32","i64","str","Option","Either","c_float","c_double","c_void","FILE","fpos_t","DIR","dirent","c_char","c_schar","c_uchar","c_short","c_ushort","c_int","c_uint","c_long","c_ulong","size_t","ptrdiff_t","clock_t","time_t","c_longlong","c_ulonglong","intptr_t","uintptr_t","off_t","dev_t","ino_t","pid_t","mode_t","ssize_t"],constants:["true","false","Some","None","Left","Right","Ok","Err"],supportConstants:["EXIT_FAILURE","EXIT_SUCCESS","RAND_MAX","EOF","SEEK_SET","SEEK_CUR","SEEK_END","_IOFBF","_IONBF","_IOLBF","BUFSIZ","FOPEN_MAX","FILENAME_MAX","L_tmpnam","TMP_MAX","O_RDONLY","O_WRONLY","O_RDWR","O_APPEND","O_CREAT","O_EXCL","O_TRUNC","S_IFIFO","S_IFCHR","S_IFBLK","S_IFDIR","S_IFREG","S_IFMT","S_IEXEC","S_IWRITE","S_IREAD","S_IRWXU","S_IXUSR","S_IWUSR","S_IRUSR","F_OK","R_OK","W_OK","X_OK","STDIN_FILENO","STDOUT_FILENO","STDERR_FILENO"],supportMacros:["format!","print!","println!","panic!","format_args!","unreachable!","write!","writeln!"],operators:["!","!=","%","%=","&","&=","&&","*","*=","+","+=","-","-=","->",".","..","...","/","/=",":",";","<<","<<=","<","<=","=","==","=>",">",">=",">>",">>=","@","^","^=","|","|=","||","_","?","#"],escapes:/\\([nrt0\"''\\]|x\h{2}|u\{\h{1,6}\})/,delimiters:/[,]/,symbols:/[\#\!\%\&\*\+\-\.\/\:\;\<\=\>\@\^\|_\?]+/,intSuffixes:/[iu](8|16|32|64|128|size)/,floatSuffixes:/f(32|64)/,tokenizer:{root:[[/[a-zA-Z][a-zA-Z0-9_]*!?|_[a-zA-Z0-9_]+/,{cases:{"@typeKeywords":"keyword.type","@keywords":"keyword","@supportConstants":"keyword","@supportMacros":"keyword","@constants":"keyword","@default":"identifier"}}],[/\$/,"identifier"],[/'[a-zA-Z_][a-zA-Z0-9_]*(?=[^\'])/,"identifier"],[/'\S'/,"string.byteliteral"],[/"/,{token:"string.quote",bracket:"@open",next:"@string"}],{include:"@numbers"},{include:"@whitespace"},[/@delimiters/,{cases:{"@keywords":"keyword","@default":"delimiter"}}],[/[{}()\[\]<>]/,"@brackets"],[/@symbols/,{cases:{"@operators":"operator","@default":""}}]],whitespace:[[/[ \t\r\n]+/,"white"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\/\*/,"comment","@push"],["\\*/","comment","@pop"],[/[\/*]/,"comment"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,{token:"string.quote",bracket:"@close",next:"@pop"}]],numbers:[[/(0o[0-7_]+)(@intSuffixes)?/,{token:"number"}],[/(0b[0-1_]+)(@intSuffixes)?/,{token:"number"}],[/[\d][\d_]*(\.[\d][\d_]*)?[eE][+-][\d_]+(@floatSuffixes)?/,{token:"number"}],[/\b(\d\.?[\d_]*)(@floatSuffixes)?\b/,{token:"number"}],[/(0x[\da-fA-F]+)_?(@intSuffixes)?/,{token:"number"}],[/[\d][\d_]*(@intSuffixes?)?/,{token:"number"}]]}}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/sb/sb.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/sb/sb.js new file mode 100644 index 0000000..1efdfcb --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/sb/sb.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/sb/sb",["require","exports"],(function(e,o){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.language=o.conf=void 0,o.conf={comments:{lineComment:"'"},brackets:[["(",")"],["[","]"],["If","EndIf"],["While","EndWhile"],["For","EndFor"],["Sub","EndSub"]],autoClosingPairs:[{open:'"',close:'"',notIn:["string","comment"]},{open:"(",close:")",notIn:["string","comment"]},{open:"[",close:"]",notIn:["string","comment"]}]},o.language={defaultToken:"",tokenPostfix:".sb",ignoreCase:!0,brackets:[{token:"delimiter.array",open:"[",close:"]"},{token:"delimiter.parenthesis",open:"(",close:")"},{token:"keyword.tag-if",open:"If",close:"EndIf"},{token:"keyword.tag-while",open:"While",close:"EndWhile"},{token:"keyword.tag-for",open:"For",close:"EndFor"},{token:"keyword.tag-sub",open:"Sub",close:"EndSub"}],keywords:["Else","ElseIf","EndFor","EndIf","EndSub","EndWhile","For","Goto","If","Step","Sub","Then","To","While"],tagwords:["If","Sub","While","For"],operators:[">","<","<>","<=",">=","And","Or","+","-","*","/","="],identifier:/[a-zA-Z_][\w]*/,symbols:/[=><:+\-*\/%\.,]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[{include:"@whitespace"},[/(@identifier)(?=[.])/,"type"],[/@identifier/,{cases:{"@keywords":{token:"keyword.$0"},"@operators":"operator","@default":"variable.name"}}],[/([.])(@identifier)/,{cases:{$2:["delimiter","type.member"],"@default":""}}],[/\d*\.\d+/,"number.float"],[/\d+/,"number"],[/[()\[\]]/,"@brackets"],[/@symbols/,{cases:{"@operators":"operator","@default":"delimiter"}}],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string"]],whitespace:[[/[ \t\r\n]+/,""],[/(\').*$/,"comment"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"C?/,"string","@pop"]]}}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/scala/scala.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/scala/scala.js new file mode 100644 index 0000000..5566b66 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/scala/scala.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/scala/scala",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.language=t.conf=void 0,t.conf={wordPattern:/(unary_[@~!#%^&*()\-=+\\|:<>\/?]+)|([a-zA-Z_$][\w$]*?_=)|(`[^`]+`)|([a-zA-Z_$][\w$]*)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:))")}}},t.language={tokenPostfix:".scala",keywords:["asInstanceOf","catch","class","classOf","def","do","else","extends","finally","for","foreach","forSome","if","import","isInstanceOf","macro","match","new","object","package","return","throw","trait","try","type","until","val","var","while","with","yield","given","enum","then"],softKeywords:["as","export","extension","end","derives","on"],constants:["true","false","null","this","super"],modifiers:["abstract","final","implicit","lazy","override","private","protected","sealed"],softModifiers:["inline","opaque","open","transparent","using"],name:/(?:[a-z_$][\w$]*|`[^`]+`)/,type:/(?:[A-Z][\w$]*)/,symbols:/[=>))/,["@brackets","white","variable"]],[/@name/,{cases:{"@keywords":"keyword","@softKeywords":"keyword","@modifiers":"keyword.modifier","@softModifiers":"keyword.modifier","@constants":{token:"constant",next:"@allowMethod"},"@default":{token:"identifier",next:"@allowMethod"}}}],[/@type/,"type","@allowMethod"],{include:"@whitespace"},[/@[a-zA-Z_$][\w$]*(?:\.[a-zA-Z_$][\w$]*)*/,"annotation"],[/[{(]/,"@brackets"],[/[})]/,"@brackets","@allowMethod"],[/\[/,"operator.square"],[/](?!\s*(?:va[rl]|def|type)\b)/,"operator.square","@allowMethod"],[/]/,"operator.square"],[/([=-]>|<-|>:|<:|:>|<%)(?=[\s\w()[\]{},\."'`])/,"keyword"],[/@symbols/,"operator"],[/[;,\.]/,"delimiter"],[/'[a-zA-Z$][\w$]*(?!')/,"attribute.name"],[/'[^\\']'/,"string","@allowMethod"],[/(')(@escapes)(')/,["string","string.escape",{token:"string",next:"@allowMethod"}]],[/'/,"string.invalid"]],import:[[/;/,"delimiter","@pop"],[/^|$/,"","@pop"],[/[ \t]+/,"white"],[/[\n\r]+/,"white","@pop"],[/\/\*/,"comment","@comment"],[/@name|@type/,"type"],[/[(){}]/,"@brackets"],[/[[\]]/,"operator.square"],[/[\.,]/,"delimiter"]],allowMethod:[[/^|$/,"","@pop"],[/[ \t]+/,"white"],[/[\n\r]+/,"white","@pop"],[/\/\*/,"comment","@comment"],[/(?==>[\s\w([{])/,"keyword","@pop"],[/(@name|@symbols)(?=[ \t]*[[({"'`]|[ \t]+(?:[+-]?\.?\d|\w))/,{cases:{"@keywords":{token:"keyword",next:"@pop"},"->|<-|>:|<:|<%":{token:"keyword",next:"@pop"},"@default":{token:"@rematch",next:"@pop"}}}],["","","@pop"]],comment:[[/[^\/*]+/,"comment"],[/\/\*/,"comment","@push"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],case:[[/\b_\*/,"key"],[/\b(_|true|false|null|this|super)\b/,"keyword","@allowMethod"],[/\bif\b|=>/,"keyword","@pop"],[/`[^`]+`/,"identifier","@allowMethod"],[/@name/,"variable","@allowMethod"],[/:::?|\||@(?![a-z_$])/,"keyword"],{include:"@root"}],vardef:[[/\b_\*/,"key"],[/\b(_|true|false|null|this|super)\b/,"keyword"],[/@name/,"variable"],[/:::?|\||@(?![a-z_$])/,"keyword"],[/=|:(?!:)/,"operator","@pop"],[/$/,"white","@pop"],{include:"@root"}],string:[[/[^\\"\n\r]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}]],stringt:[[/[^\\"\n\r]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"(?=""")/,"string"],[/"""/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/"/,"string"]],fstring:[[/@escapes/,"string.escape"],[/"/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/\$\$/,"string"],[/(\$)([a-z_]\w*)/,["operator","identifier"]],[/\$\{/,"operator","@interp"],[/%%/,"string"],[/(%)([\-#+ 0,(])(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/,["metatag","keyword.modifier","number","metatag"]],[/(%)(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/,["metatag","number","metatag"]],[/(%)([\-#+ 0,(])(@fstring_conv)/,["metatag","keyword.modifier","metatag"]],[/(%)(@fstring_conv)/,["metatag","metatag"]],[/./,"string"]],fstringt:[[/@escapes/,"string.escape"],[/"(?=""")/,"string"],[/"""/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/\$\$/,"string"],[/(\$)([a-z_]\w*)/,["operator","identifier"]],[/\$\{/,"operator","@interp"],[/%%/,"string"],[/(%)([\-#+ 0,(])(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/,["metatag","keyword.modifier","number","metatag"]],[/(%)(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/,["metatag","number","metatag"]],[/(%)([\-#+ 0,(])(@fstring_conv)/,["metatag","keyword.modifier","metatag"]],[/(%)(@fstring_conv)/,["metatag","metatag"]],[/./,"string"]],sstring:[[/@escapes/,"string.escape"],[/"/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/\$\$/,"string"],[/(\$)([a-z_]\w*)/,["operator","identifier"]],[/\$\{/,"operator","@interp"],[/./,"string"]],sstringt:[[/@escapes/,"string.escape"],[/"(?=""")/,"string"],[/"""/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/\$\$/,"string"],[/(\$)([a-z_]\w*)/,["operator","identifier"]],[/\$\{/,"operator","@interp"],[/./,"string"]],interp:[[/{/,"operator","@push"],[/}/,"operator","@pop"],{include:"@root"}],rawstring:[[/[^"]/,"string"],[/"/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}]],rawstringt:[[/[^"]/,"string"],[/"(?=""")/,"string"],[/"""/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/"/,"string"]],whitespace:[[/[ \t\r\n]+/,"white"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]]}}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/scheme/scheme.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/scheme/scheme.js new file mode 100644 index 0000000..d40f413 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/scheme/scheme.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/scheme/scheme",["require","exports"],(function(e,o){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.language=o.conf=void 0,o.conf={comments:{lineComment:";",blockComment:["#|","|#"]},brackets:[["(",")"],["{","}"],["[","]"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}]},o.language={defaultToken:"",ignoreCase:!0,tokenPostfix:".scheme",brackets:[{open:"(",close:")",token:"delimiter.parenthesis"},{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"}],keywords:["case","do","let","loop","if","else","when","cons","car","cdr","cond","lambda","lambda*","syntax-rules","format","set!","quote","eval","append","list","list?","member?","load"],constants:["#t","#f"],operators:["eq?","eqv?","equal?","and","or","not","null?"],tokenizer:{root:[[/#[xXoObB][0-9a-fA-F]+/,"number.hex"],[/[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?/,"number.float"],[/(?:\b(?:(define|define-syntax|define-macro))\b)(\s+)((?:\w|\-|\!|\?)*)/,["keyword","white","variable"]],{include:"@whitespace"},{include:"@strings"},[/[a-zA-Z_#][a-zA-Z0-9_\-\?\!\*]*/,{cases:{"@keywords":"keyword","@constants":"constant","@operators":"operators","@default":"identifier"}}]],comment:[[/[^\|#]+/,"comment"],[/#\|/,"comment","@push"],[/\|#/,"comment","@pop"],[/[\|#]/,"comment"]],whitespace:[[/[ \t\r\n]+/,"white"],[/#\|/,"comment","@comment"],[/;.*$/,"comment"]],strings:[[/"$/,"string","@popall"],[/"(?=.)/,"string","@multiLineString"]],multiLineString:[[/[^\\"]+$/,"string","@popall"],[/[^\\"]+/,"string"],[/\\./,"string.escape"],[/"/,"string","@popall"],[/\\$/,"string"]]}}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/scss/scss.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/scss/scss.js new file mode 100644 index 0000000..c06d4d7 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/scss/scss.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/scss/scss",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.language=t.conf=void 0,t.conf={wordPattern:/(#?-?\d*\.\d\w*%?)|([@$#!.:]?[\w-?]+%?)|[@#!.]/g,comments:{blockComment:["/*","*/"],lineComment:"//"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}",notIn:["string","comment"]},{open:"[",close:"]",notIn:["string","comment"]},{open:"(",close:")",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string","comment"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/"),end:new RegExp("^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/")}}},t.language={defaultToken:"",tokenPostfix:".scss",ws:"[ \t\n\r\f]*",identifier:"-?-?([a-zA-Z]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))([\\w\\-]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))*",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.bracket"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],tokenizer:{root:[{include:"@selector"}],selector:[{include:"@comments"},{include:"@import"},{include:"@variabledeclaration"},{include:"@warndebug"},["[@](include)",{token:"keyword",next:"@includedeclaration"}],["[@](keyframes|-webkit-keyframes|-moz-keyframes|-o-keyframes)",{token:"keyword",next:"@keyframedeclaration"}],["[@](page|content|font-face|-moz-document)",{token:"keyword"}],["[@](charset|namespace)",{token:"keyword",next:"@declarationbody"}],["[@](function)",{token:"keyword",next:"@functiondeclaration"}],["[@](mixin)",{token:"keyword",next:"@mixindeclaration"}],["url(\\-prefix)?\\(",{token:"meta",next:"@urldeclaration"}],{include:"@controlstatement"},{include:"@selectorname"},["[&\\*]","tag"],["[>\\+,]","delimiter"],["\\[",{token:"delimiter.bracket",next:"@selectorattribute"}],["{",{token:"delimiter.curly",next:"@selectorbody"}]],selectorbody:[["[*_]?@identifier@ws:(?=(\\s|\\d|[^{;}]*[;}]))","attribute.name","@rulevalue"],{include:"@selector"},["[@](extend)",{token:"keyword",next:"@extendbody"}],["[@](return)",{token:"keyword",next:"@declarationbody"}],["}",{token:"delimiter.curly",next:"@pop"}]],selectorname:[["#{",{token:"meta",next:"@variableinterpolation"}],["(\\.|#(?=[^{])|%|(@identifier)|:)+","tag"]],selectorattribute:[{include:"@term"},["]",{token:"delimiter.bracket",next:"@pop"}]],term:[{include:"@comments"},["url(\\-prefix)?\\(",{token:"meta",next:"@urldeclaration"}],{include:"@functioninvocation"},{include:"@numbers"},{include:"@strings"},{include:"@variablereference"},["(and\\b|or\\b|not\\b)","operator"],{include:"@name"},["([<>=\\+\\-\\*\\/\\^\\|\\~,])","operator"],[",","delimiter"],["!default","literal"],["\\(",{token:"delimiter.parenthesis",next:"@parenthizedterm"}]],rulevalue:[{include:"@term"},["!important","literal"],[";","delimiter","@pop"],["{",{token:"delimiter.curly",switchTo:"@nestedproperty"}],["(?=})",{token:"",next:"@pop"}]],nestedproperty:[["[*_]?@identifier@ws:","attribute.name","@rulevalue"],{include:"@comments"},["}",{token:"delimiter.curly",next:"@pop"}]],warndebug:[["[@](warn|debug)",{token:"keyword",next:"@declarationbody"}]],import:[["[@](import)",{token:"keyword",next:"@declarationbody"}]],variabledeclaration:[["\\$@identifier@ws:","variable.decl","@declarationbody"]],urldeclaration:[{include:"@strings"},["[^)\r\n]+","string"],["\\)",{token:"meta",next:"@pop"}]],parenthizedterm:[{include:"@term"},["\\)",{token:"delimiter.parenthesis",next:"@pop"}]],declarationbody:[{include:"@term"},[";","delimiter","@pop"],["(?=})",{token:"",next:"@pop"}]],extendbody:[{include:"@selectorname"},["!optional","literal"],[";","delimiter","@pop"],["(?=})",{token:"",next:"@pop"}]],variablereference:[["\\$@identifier","variable.ref"],["\\.\\.\\.","operator"],["#{",{token:"meta",next:"@variableinterpolation"}]],variableinterpolation:[{include:"@variablereference"},["}",{token:"meta",next:"@pop"}]],comments:[["\\/\\*","comment","@comment"],["\\/\\/+.*","comment"]],comment:[["\\*\\/","comment","@pop"],[".","comment"]],name:[["@identifier","attribute.value"]],numbers:[["(\\d*\\.)?\\d+([eE][\\-+]?\\d+)?",{token:"number",next:"@units"}],["#[0-9a-fA-F_]+(?!\\w)","number.hex"]],units:[["(em|ex|ch|rem|vmin|vmax|vw|vh|vm|cm|mm|in|px|pt|pc|deg|grad|rad|turn|s|ms|Hz|kHz|%)?","number","@pop"]],functiondeclaration:[["@identifier@ws\\(",{token:"meta",next:"@parameterdeclaration"}],["{",{token:"delimiter.curly",switchTo:"@functionbody"}]],mixindeclaration:[["@identifier@ws\\(",{token:"meta",next:"@parameterdeclaration"}],["@identifier","meta"],["{",{token:"delimiter.curly",switchTo:"@selectorbody"}]],parameterdeclaration:[["\\$@identifier@ws:","variable.decl"],["\\.\\.\\.","operator"],[",","delimiter"],{include:"@term"},["\\)",{token:"meta",next:"@pop"}]],includedeclaration:[{include:"@functioninvocation"},["@identifier","meta"],[";","delimiter","@pop"],["(?=})",{token:"",next:"@pop"}],["{",{token:"delimiter.curly",switchTo:"@selectorbody"}]],keyframedeclaration:[["@identifier","meta"],["{",{token:"delimiter.curly",switchTo:"@keyframebody"}]],keyframebody:[{include:"@term"},["{",{token:"delimiter.curly",next:"@selectorbody"}],["}",{token:"delimiter.curly",next:"@pop"}]],controlstatement:[["[@](if|else|for|while|each|media)",{token:"keyword.flow",next:"@controlstatementdeclaration"}]],controlstatementdeclaration:[["(in|from|through|if|to)\\b",{token:"keyword.flow"}],{include:"@term"},["{",{token:"delimiter.curly",switchTo:"@selectorbody"}]],functionbody:[["[@](return)",{token:"keyword"}],{include:"@variabledeclaration"},{include:"@term"},{include:"@controlstatement"},[";","delimiter"],["}",{token:"delimiter.curly",next:"@pop"}]],functioninvocation:[["@identifier\\(",{token:"meta",next:"@functionarguments"}]],functionarguments:[["\\$@identifier@ws:","attribute.name"],["[,]","delimiter"],{include:"@term"},["\\)",{token:"meta",next:"@pop"}]],strings:[['~?"',{token:"string.delimiter",next:"@stringenddoublequote"}],["~?'",{token:"string.delimiter",next:"@stringendquote"}]],stringenddoublequote:[["\\\\.","string"],['"',{token:"string.delimiter",next:"@pop"}],[".","string"]],stringendquote:[["\\\\.","string"],["'",{token:"string.delimiter",next:"@pop"}],[".","string"]]}}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/shell/shell.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/shell/shell.js new file mode 100644 index 0000000..6d13467 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/shell/shell.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/shell/shell",["require","exports"],(function(e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.language=r.conf=void 0,r.conf={comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}]},r.language={defaultToken:"",ignoreCase:!0,tokenPostfix:".shell",brackets:[{token:"delimiter.bracket",open:"{",close:"}"},{token:"delimiter.parenthesis",open:"(",close:")"},{token:"delimiter.square",open:"[",close:"]"}],keywords:["if","then","do","else","elif","while","until","for","in","esac","fi","fin","fil","done","exit","set","unset","export","function"],builtins:["ab","awk","bash","beep","cat","cc","cd","chown","chmod","chroot","clear","cp","curl","cut","diff","echo","find","gawk","gcc","get","git","grep","hg","kill","killall","ln","ls","make","mkdir","openssl","mv","nc","node","npm","ping","ps","restart","rm","rmdir","sed","service","sh","shopt","shred","source","sort","sleep","ssh","start","stop","su","sudo","svn","tee","telnet","top","touch","vi","vim","wall","wc","wget","who","write","yes","zsh"],symbols:/[=>"]],autoClosingPairs:[{open:'"',close:'"',notIn:["string","comment"]},{open:"{",close:"}",notIn:["string","comment"]},{open:"[",close:"]",notIn:["string","comment"]},{open:"(",close:")",notIn:["string","comment"]}]},e.language={defaultToken:"",tokenPostfix:".sol",brackets:[{token:"delimiter.curly",open:"{",close:"}"},{token:"delimiter.parenthesis",open:"(",close:")"},{token:"delimiter.square",open:"[",close:"]"},{token:"delimiter.angle",open:"<",close:">"}],keywords:["pragma","solidity","contract","library","using","struct","function","modifier","constructor","address","string","bool","Int","Uint","Byte","Fixed","Ufixed","int","int8","int16","int24","int32","int40","int48","int56","int64","int72","int80","int88","int96","int104","int112","int120","int128","int136","int144","int152","int160","int168","int176","int184","int192","int200","int208","int216","int224","int232","int240","int248","int256","uint","uint8","uint16","uint24","uint32","uint40","uint48","uint56","uint64","uint72","uint80","uint88","uint96","uint104","uint112","uint120","uint128","uint136","uint144","uint152","uint160","uint168","uint176","uint184","uint192","uint200","uint208","uint216","uint224","uint232","uint240","uint248","uint256","byte","bytes","bytes1","bytes2","bytes3","bytes4","bytes5","bytes6","bytes7","bytes8","bytes9","bytes10","bytes11","bytes12","bytes13","bytes14","bytes15","bytes16","bytes17","bytes18","bytes19","bytes20","bytes21","bytes22","bytes23","bytes24","bytes25","bytes26","bytes27","bytes28","bytes29","bytes30","bytes31","bytes32","fixed","fixed0x8","fixed0x16","fixed0x24","fixed0x32","fixed0x40","fixed0x48","fixed0x56","fixed0x64","fixed0x72","fixed0x80","fixed0x88","fixed0x96","fixed0x104","fixed0x112","fixed0x120","fixed0x128","fixed0x136","fixed0x144","fixed0x152","fixed0x160","fixed0x168","fixed0x176","fixed0x184","fixed0x192","fixed0x200","fixed0x208","fixed0x216","fixed0x224","fixed0x232","fixed0x240","fixed0x248","fixed0x256","fixed8x8","fixed8x16","fixed8x24","fixed8x32","fixed8x40","fixed8x48","fixed8x56","fixed8x64","fixed8x72","fixed8x80","fixed8x88","fixed8x96","fixed8x104","fixed8x112","fixed8x120","fixed8x128","fixed8x136","fixed8x144","fixed8x152","fixed8x160","fixed8x168","fixed8x176","fixed8x184","fixed8x192","fixed8x200","fixed8x208","fixed8x216","fixed8x224","fixed8x232","fixed8x240","fixed8x248","fixed16x8","fixed16x16","fixed16x24","fixed16x32","fixed16x40","fixed16x48","fixed16x56","fixed16x64","fixed16x72","fixed16x80","fixed16x88","fixed16x96","fixed16x104","fixed16x112","fixed16x120","fixed16x128","fixed16x136","fixed16x144","fixed16x152","fixed16x160","fixed16x168","fixed16x176","fixed16x184","fixed16x192","fixed16x200","fixed16x208","fixed16x216","fixed16x224","fixed16x232","fixed16x240","fixed24x8","fixed24x16","fixed24x24","fixed24x32","fixed24x40","fixed24x48","fixed24x56","fixed24x64","fixed24x72","fixed24x80","fixed24x88","fixed24x96","fixed24x104","fixed24x112","fixed24x120","fixed24x128","fixed24x136","fixed24x144","fixed24x152","fixed24x160","fixed24x168","fixed24x176","fixed24x184","fixed24x192","fixed24x200","fixed24x208","fixed24x216","fixed24x224","fixed24x232","fixed32x8","fixed32x16","fixed32x24","fixed32x32","fixed32x40","fixed32x48","fixed32x56","fixed32x64","fixed32x72","fixed32x80","fixed32x88","fixed32x96","fixed32x104","fixed32x112","fixed32x120","fixed32x128","fixed32x136","fixed32x144","fixed32x152","fixed32x160","fixed32x168","fixed32x176","fixed32x184","fixed32x192","fixed32x200","fixed32x208","fixed32x216","fixed32x224","fixed40x8","fixed40x16","fixed40x24","fixed40x32","fixed40x40","fixed40x48","fixed40x56","fixed40x64","fixed40x72","fixed40x80","fixed40x88","fixed40x96","fixed40x104","fixed40x112","fixed40x120","fixed40x128","fixed40x136","fixed40x144","fixed40x152","fixed40x160","fixed40x168","fixed40x176","fixed40x184","fixed40x192","fixed40x200","fixed40x208","fixed40x216","fixed48x8","fixed48x16","fixed48x24","fixed48x32","fixed48x40","fixed48x48","fixed48x56","fixed48x64","fixed48x72","fixed48x80","fixed48x88","fixed48x96","fixed48x104","fixed48x112","fixed48x120","fixed48x128","fixed48x136","fixed48x144","fixed48x152","fixed48x160","fixed48x168","fixed48x176","fixed48x184","fixed48x192","fixed48x200","fixed48x208","fixed56x8","fixed56x16","fixed56x24","fixed56x32","fixed56x40","fixed56x48","fixed56x56","fixed56x64","fixed56x72","fixed56x80","fixed56x88","fixed56x96","fixed56x104","fixed56x112","fixed56x120","fixed56x128","fixed56x136","fixed56x144","fixed56x152","fixed56x160","fixed56x168","fixed56x176","fixed56x184","fixed56x192","fixed56x200","fixed64x8","fixed64x16","fixed64x24","fixed64x32","fixed64x40","fixed64x48","fixed64x56","fixed64x64","fixed64x72","fixed64x80","fixed64x88","fixed64x96","fixed64x104","fixed64x112","fixed64x120","fixed64x128","fixed64x136","fixed64x144","fixed64x152","fixed64x160","fixed64x168","fixed64x176","fixed64x184","fixed64x192","fixed72x8","fixed72x16","fixed72x24","fixed72x32","fixed72x40","fixed72x48","fixed72x56","fixed72x64","fixed72x72","fixed72x80","fixed72x88","fixed72x96","fixed72x104","fixed72x112","fixed72x120","fixed72x128","fixed72x136","fixed72x144","fixed72x152","fixed72x160","fixed72x168","fixed72x176","fixed72x184","fixed80x8","fixed80x16","fixed80x24","fixed80x32","fixed80x40","fixed80x48","fixed80x56","fixed80x64","fixed80x72","fixed80x80","fixed80x88","fixed80x96","fixed80x104","fixed80x112","fixed80x120","fixed80x128","fixed80x136","fixed80x144","fixed80x152","fixed80x160","fixed80x168","fixed80x176","fixed88x8","fixed88x16","fixed88x24","fixed88x32","fixed88x40","fixed88x48","fixed88x56","fixed88x64","fixed88x72","fixed88x80","fixed88x88","fixed88x96","fixed88x104","fixed88x112","fixed88x120","fixed88x128","fixed88x136","fixed88x144","fixed88x152","fixed88x160","fixed88x168","fixed96x8","fixed96x16","fixed96x24","fixed96x32","fixed96x40","fixed96x48","fixed96x56","fixed96x64","fixed96x72","fixed96x80","fixed96x88","fixed96x96","fixed96x104","fixed96x112","fixed96x120","fixed96x128","fixed96x136","fixed96x144","fixed96x152","fixed96x160","fixed104x8","fixed104x16","fixed104x24","fixed104x32","fixed104x40","fixed104x48","fixed104x56","fixed104x64","fixed104x72","fixed104x80","fixed104x88","fixed104x96","fixed104x104","fixed104x112","fixed104x120","fixed104x128","fixed104x136","fixed104x144","fixed104x152","fixed112x8","fixed112x16","fixed112x24","fixed112x32","fixed112x40","fixed112x48","fixed112x56","fixed112x64","fixed112x72","fixed112x80","fixed112x88","fixed112x96","fixed112x104","fixed112x112","fixed112x120","fixed112x128","fixed112x136","fixed112x144","fixed120x8","fixed120x16","fixed120x24","fixed120x32","fixed120x40","fixed120x48","fixed120x56","fixed120x64","fixed120x72","fixed120x80","fixed120x88","fixed120x96","fixed120x104","fixed120x112","fixed120x120","fixed120x128","fixed120x136","fixed128x8","fixed128x16","fixed128x24","fixed128x32","fixed128x40","fixed128x48","fixed128x56","fixed128x64","fixed128x72","fixed128x80","fixed128x88","fixed128x96","fixed128x104","fixed128x112","fixed128x120","fixed128x128","fixed136x8","fixed136x16","fixed136x24","fixed136x32","fixed136x40","fixed136x48","fixed136x56","fixed136x64","fixed136x72","fixed136x80","fixed136x88","fixed136x96","fixed136x104","fixed136x112","fixed136x120","fixed144x8","fixed144x16","fixed144x24","fixed144x32","fixed144x40","fixed144x48","fixed144x56","fixed144x64","fixed144x72","fixed144x80","fixed144x88","fixed144x96","fixed144x104","fixed144x112","fixed152x8","fixed152x16","fixed152x24","fixed152x32","fixed152x40","fixed152x48","fixed152x56","fixed152x64","fixed152x72","fixed152x80","fixed152x88","fixed152x96","fixed152x104","fixed160x8","fixed160x16","fixed160x24","fixed160x32","fixed160x40","fixed160x48","fixed160x56","fixed160x64","fixed160x72","fixed160x80","fixed160x88","fixed160x96","fixed168x8","fixed168x16","fixed168x24","fixed168x32","fixed168x40","fixed168x48","fixed168x56","fixed168x64","fixed168x72","fixed168x80","fixed168x88","fixed176x8","fixed176x16","fixed176x24","fixed176x32","fixed176x40","fixed176x48","fixed176x56","fixed176x64","fixed176x72","fixed176x80","fixed184x8","fixed184x16","fixed184x24","fixed184x32","fixed184x40","fixed184x48","fixed184x56","fixed184x64","fixed184x72","fixed192x8","fixed192x16","fixed192x24","fixed192x32","fixed192x40","fixed192x48","fixed192x56","fixed192x64","fixed200x8","fixed200x16","fixed200x24","fixed200x32","fixed200x40","fixed200x48","fixed200x56","fixed208x8","fixed208x16","fixed208x24","fixed208x32","fixed208x40","fixed208x48","fixed216x8","fixed216x16","fixed216x24","fixed216x32","fixed216x40","fixed224x8","fixed224x16","fixed224x24","fixed224x32","fixed232x8","fixed232x16","fixed232x24","fixed240x8","fixed240x16","fixed248x8","ufixed","ufixed0x8","ufixed0x16","ufixed0x24","ufixed0x32","ufixed0x40","ufixed0x48","ufixed0x56","ufixed0x64","ufixed0x72","ufixed0x80","ufixed0x88","ufixed0x96","ufixed0x104","ufixed0x112","ufixed0x120","ufixed0x128","ufixed0x136","ufixed0x144","ufixed0x152","ufixed0x160","ufixed0x168","ufixed0x176","ufixed0x184","ufixed0x192","ufixed0x200","ufixed0x208","ufixed0x216","ufixed0x224","ufixed0x232","ufixed0x240","ufixed0x248","ufixed0x256","ufixed8x8","ufixed8x16","ufixed8x24","ufixed8x32","ufixed8x40","ufixed8x48","ufixed8x56","ufixed8x64","ufixed8x72","ufixed8x80","ufixed8x88","ufixed8x96","ufixed8x104","ufixed8x112","ufixed8x120","ufixed8x128","ufixed8x136","ufixed8x144","ufixed8x152","ufixed8x160","ufixed8x168","ufixed8x176","ufixed8x184","ufixed8x192","ufixed8x200","ufixed8x208","ufixed8x216","ufixed8x224","ufixed8x232","ufixed8x240","ufixed8x248","ufixed16x8","ufixed16x16","ufixed16x24","ufixed16x32","ufixed16x40","ufixed16x48","ufixed16x56","ufixed16x64","ufixed16x72","ufixed16x80","ufixed16x88","ufixed16x96","ufixed16x104","ufixed16x112","ufixed16x120","ufixed16x128","ufixed16x136","ufixed16x144","ufixed16x152","ufixed16x160","ufixed16x168","ufixed16x176","ufixed16x184","ufixed16x192","ufixed16x200","ufixed16x208","ufixed16x216","ufixed16x224","ufixed16x232","ufixed16x240","ufixed24x8","ufixed24x16","ufixed24x24","ufixed24x32","ufixed24x40","ufixed24x48","ufixed24x56","ufixed24x64","ufixed24x72","ufixed24x80","ufixed24x88","ufixed24x96","ufixed24x104","ufixed24x112","ufixed24x120","ufixed24x128","ufixed24x136","ufixed24x144","ufixed24x152","ufixed24x160","ufixed24x168","ufixed24x176","ufixed24x184","ufixed24x192","ufixed24x200","ufixed24x208","ufixed24x216","ufixed24x224","ufixed24x232","ufixed32x8","ufixed32x16","ufixed32x24","ufixed32x32","ufixed32x40","ufixed32x48","ufixed32x56","ufixed32x64","ufixed32x72","ufixed32x80","ufixed32x88","ufixed32x96","ufixed32x104","ufixed32x112","ufixed32x120","ufixed32x128","ufixed32x136","ufixed32x144","ufixed32x152","ufixed32x160","ufixed32x168","ufixed32x176","ufixed32x184","ufixed32x192","ufixed32x200","ufixed32x208","ufixed32x216","ufixed32x224","ufixed40x8","ufixed40x16","ufixed40x24","ufixed40x32","ufixed40x40","ufixed40x48","ufixed40x56","ufixed40x64","ufixed40x72","ufixed40x80","ufixed40x88","ufixed40x96","ufixed40x104","ufixed40x112","ufixed40x120","ufixed40x128","ufixed40x136","ufixed40x144","ufixed40x152","ufixed40x160","ufixed40x168","ufixed40x176","ufixed40x184","ufixed40x192","ufixed40x200","ufixed40x208","ufixed40x216","ufixed48x8","ufixed48x16","ufixed48x24","ufixed48x32","ufixed48x40","ufixed48x48","ufixed48x56","ufixed48x64","ufixed48x72","ufixed48x80","ufixed48x88","ufixed48x96","ufixed48x104","ufixed48x112","ufixed48x120","ufixed48x128","ufixed48x136","ufixed48x144","ufixed48x152","ufixed48x160","ufixed48x168","ufixed48x176","ufixed48x184","ufixed48x192","ufixed48x200","ufixed48x208","ufixed56x8","ufixed56x16","ufixed56x24","ufixed56x32","ufixed56x40","ufixed56x48","ufixed56x56","ufixed56x64","ufixed56x72","ufixed56x80","ufixed56x88","ufixed56x96","ufixed56x104","ufixed56x112","ufixed56x120","ufixed56x128","ufixed56x136","ufixed56x144","ufixed56x152","ufixed56x160","ufixed56x168","ufixed56x176","ufixed56x184","ufixed56x192","ufixed56x200","ufixed64x8","ufixed64x16","ufixed64x24","ufixed64x32","ufixed64x40","ufixed64x48","ufixed64x56","ufixed64x64","ufixed64x72","ufixed64x80","ufixed64x88","ufixed64x96","ufixed64x104","ufixed64x112","ufixed64x120","ufixed64x128","ufixed64x136","ufixed64x144","ufixed64x152","ufixed64x160","ufixed64x168","ufixed64x176","ufixed64x184","ufixed64x192","ufixed72x8","ufixed72x16","ufixed72x24","ufixed72x32","ufixed72x40","ufixed72x48","ufixed72x56","ufixed72x64","ufixed72x72","ufixed72x80","ufixed72x88","ufixed72x96","ufixed72x104","ufixed72x112","ufixed72x120","ufixed72x128","ufixed72x136","ufixed72x144","ufixed72x152","ufixed72x160","ufixed72x168","ufixed72x176","ufixed72x184","ufixed80x8","ufixed80x16","ufixed80x24","ufixed80x32","ufixed80x40","ufixed80x48","ufixed80x56","ufixed80x64","ufixed80x72","ufixed80x80","ufixed80x88","ufixed80x96","ufixed80x104","ufixed80x112","ufixed80x120","ufixed80x128","ufixed80x136","ufixed80x144","ufixed80x152","ufixed80x160","ufixed80x168","ufixed80x176","ufixed88x8","ufixed88x16","ufixed88x24","ufixed88x32","ufixed88x40","ufixed88x48","ufixed88x56","ufixed88x64","ufixed88x72","ufixed88x80","ufixed88x88","ufixed88x96","ufixed88x104","ufixed88x112","ufixed88x120","ufixed88x128","ufixed88x136","ufixed88x144","ufixed88x152","ufixed88x160","ufixed88x168","ufixed96x8","ufixed96x16","ufixed96x24","ufixed96x32","ufixed96x40","ufixed96x48","ufixed96x56","ufixed96x64","ufixed96x72","ufixed96x80","ufixed96x88","ufixed96x96","ufixed96x104","ufixed96x112","ufixed96x120","ufixed96x128","ufixed96x136","ufixed96x144","ufixed96x152","ufixed96x160","ufixed104x8","ufixed104x16","ufixed104x24","ufixed104x32","ufixed104x40","ufixed104x48","ufixed104x56","ufixed104x64","ufixed104x72","ufixed104x80","ufixed104x88","ufixed104x96","ufixed104x104","ufixed104x112","ufixed104x120","ufixed104x128","ufixed104x136","ufixed104x144","ufixed104x152","ufixed112x8","ufixed112x16","ufixed112x24","ufixed112x32","ufixed112x40","ufixed112x48","ufixed112x56","ufixed112x64","ufixed112x72","ufixed112x80","ufixed112x88","ufixed112x96","ufixed112x104","ufixed112x112","ufixed112x120","ufixed112x128","ufixed112x136","ufixed112x144","ufixed120x8","ufixed120x16","ufixed120x24","ufixed120x32","ufixed120x40","ufixed120x48","ufixed120x56","ufixed120x64","ufixed120x72","ufixed120x80","ufixed120x88","ufixed120x96","ufixed120x104","ufixed120x112","ufixed120x120","ufixed120x128","ufixed120x136","ufixed128x8","ufixed128x16","ufixed128x24","ufixed128x32","ufixed128x40","ufixed128x48","ufixed128x56","ufixed128x64","ufixed128x72","ufixed128x80","ufixed128x88","ufixed128x96","ufixed128x104","ufixed128x112","ufixed128x120","ufixed128x128","ufixed136x8","ufixed136x16","ufixed136x24","ufixed136x32","ufixed136x40","ufixed136x48","ufixed136x56","ufixed136x64","ufixed136x72","ufixed136x80","ufixed136x88","ufixed136x96","ufixed136x104","ufixed136x112","ufixed136x120","ufixed144x8","ufixed144x16","ufixed144x24","ufixed144x32","ufixed144x40","ufixed144x48","ufixed144x56","ufixed144x64","ufixed144x72","ufixed144x80","ufixed144x88","ufixed144x96","ufixed144x104","ufixed144x112","ufixed152x8","ufixed152x16","ufixed152x24","ufixed152x32","ufixed152x40","ufixed152x48","ufixed152x56","ufixed152x64","ufixed152x72","ufixed152x80","ufixed152x88","ufixed152x96","ufixed152x104","ufixed160x8","ufixed160x16","ufixed160x24","ufixed160x32","ufixed160x40","ufixed160x48","ufixed160x56","ufixed160x64","ufixed160x72","ufixed160x80","ufixed160x88","ufixed160x96","ufixed168x8","ufixed168x16","ufixed168x24","ufixed168x32","ufixed168x40","ufixed168x48","ufixed168x56","ufixed168x64","ufixed168x72","ufixed168x80","ufixed168x88","ufixed176x8","ufixed176x16","ufixed176x24","ufixed176x32","ufixed176x40","ufixed176x48","ufixed176x56","ufixed176x64","ufixed176x72","ufixed176x80","ufixed184x8","ufixed184x16","ufixed184x24","ufixed184x32","ufixed184x40","ufixed184x48","ufixed184x56","ufixed184x64","ufixed184x72","ufixed192x8","ufixed192x16","ufixed192x24","ufixed192x32","ufixed192x40","ufixed192x48","ufixed192x56","ufixed192x64","ufixed200x8","ufixed200x16","ufixed200x24","ufixed200x32","ufixed200x40","ufixed200x48","ufixed200x56","ufixed208x8","ufixed208x16","ufixed208x24","ufixed208x32","ufixed208x40","ufixed208x48","ufixed216x8","ufixed216x16","ufixed216x24","ufixed216x32","ufixed216x40","ufixed224x8","ufixed224x16","ufixed224x24","ufixed224x32","ufixed232x8","ufixed232x16","ufixed232x24","ufixed240x8","ufixed240x16","ufixed248x8","event","enum","let","mapping","private","public","external","inherited","payable","true","false","var","import","constant","if","else","for","else","for","while","do","break","continue","throw","returns","return","suicide","new","is","this","super"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],symbols:/[=>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/\d*\d+[eE]([\-+]?\d+)?(@floatsuffix)/,"number.float"],[/\d*\.\d+([eE][\-+]?\d+)?(@floatsuffix)/,"number.float"],[/0[xX][0-9a-fA-F']*[0-9a-fA-F](@integersuffix)/,"number.hex"],[/0[0-7']*[0-7](@integersuffix)/,"number.octal"],[/0[bB][0-1']*[0-1](@integersuffix)/,"number.binary"],[/\d[\d']*\d(@integersuffix)/,"number"],[/\d(@integersuffix)/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string"],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@doccomment"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],doccomment:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]]}}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/sophia/sophia.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/sophia/sophia.js new file mode 100644 index 0000000..ffaa88a --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/sophia/sophia.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/sophia/sophia",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.language=t.conf=void 0,t.conf={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"],["<",">"]],autoClosingPairs:[{open:'"',close:'"',notIn:["string","comment"]},{open:"{",close:"}",notIn:["string","comment"]},{open:"[",close:"]",notIn:["string","comment"]},{open:"(",close:")",notIn:["string","comment"]}]},t.language={defaultToken:"",tokenPostfix:".aes",brackets:[{token:"delimiter.curly",open:"{",close:"}"},{token:"delimiter.parenthesis",open:"(",close:")"},{token:"delimiter.square",open:"[",close:"]"},{token:"delimiter.angle",open:"<",close:">"}],keywords:["contract","library","entrypoint","function","stateful","state","hash","signature","tuple","list","address","string","bool","int","record","datatype","type","option","oracle","oracle_query","Call","Bits","Bytes","Oracle","String","Crypto","Address","Auth","Chain","None","Some","bits","bytes","event","let","map","private","public","true","false","var","if","else","throw"],operators:["=",">","<","!","~","?","::",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],symbols:/[=>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/\d*\d+[eE]([\-+]?\d+)?(@floatsuffix)/,"number.float"],[/\d*\.\d+([eE][\-+]?\d+)?(@floatsuffix)/,"number.float"],[/0[xX][0-9a-fA-F']*[0-9a-fA-F](@integersuffix)/,"number.hex"],[/0[0-7']*[0-7](@integersuffix)/,"number.octal"],[/0[bB][0-1']*[0-1](@integersuffix)/,"number.binary"],[/\d[\d']*\d(@integersuffix)/,"number"],[/\d(@integersuffix)/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string"],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@doccomment"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],doccomment:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]]}}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/sql/sql.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/sql/sql.js new file mode 100644 index 0000000..c386679 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/sql/sql.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/sql/sql",["require","exports"],(function(E,T){"use strict";Object.defineProperty(T,"__esModule",{value:!0}),T.language=T.conf=void 0,T.conf={comments:{lineComment:"--",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},T.language={defaultToken:"",tokenPostfix:".sql",ignoreCase:!0,brackets:[{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],keywords:["ABORT_AFTER_WAIT","ABSENT","ABSOLUTE","ACCENT_SENSITIVITY","ACTION","ACTIVATION","ACTIVE","ADD","ADDRESS","ADMIN","AES","AES_128","AES_192","AES_256","AFFINITY","AFTER","AGGREGATE","ALGORITHM","ALL_CONSTRAINTS","ALL_ERRORMSGS","ALL_INDEXES","ALL_LEVELS","ALL_SPARSE_COLUMNS","ALLOW_CONNECTIONS","ALLOW_MULTIPLE_EVENT_LOSS","ALLOW_PAGE_LOCKS","ALLOW_ROW_LOCKS","ALLOW_SINGLE_EVENT_LOSS","ALLOW_SNAPSHOT_ISOLATION","ALLOWED","ALTER","ANONYMOUS","ANSI_DEFAULTS","ANSI_NULL_DEFAULT","ANSI_NULL_DFLT_OFF","ANSI_NULL_DFLT_ON","ANSI_NULLS","ANSI_PADDING","ANSI_WARNINGS","APPEND","APPLICATION","APPLICATION_LOG","ARITHABORT","ARITHIGNORE","AS","ASC","ASSEMBLY","ASYMMETRIC","ASYNCHRONOUS_COMMIT","AT","ATOMIC","ATTACH","ATTACH_REBUILD_LOG","AUDIT","AUDIT_GUID","AUTHENTICATION","AUTHORIZATION","AUTO","AUTO_CLEANUP","AUTO_CLOSE","AUTO_CREATE_STATISTICS","AUTO_SHRINK","AUTO_UPDATE_STATISTICS","AUTO_UPDATE_STATISTICS_ASYNC","AUTOMATED_BACKUP_PREFERENCE","AUTOMATIC","AVAILABILITY","AVAILABILITY_MODE","BACKUP","BACKUP_PRIORITY","BASE64","BATCHSIZE","BEGIN","BEGIN_DIALOG","BIGINT","BINARY","BINDING","BIT","BLOCKERS","BLOCKSIZE","BOUNDING_BOX","BREAK","BROKER","BROKER_INSTANCE","BROWSE","BUCKET_COUNT","BUFFER","BUFFERCOUNT","BULK","BULK_LOGGED","BY","CACHE","CALL","CALLED","CALLER","CAP_CPU_PERCENT","CASCADE","CASE","CATALOG","CATCH","CELLS_PER_OBJECT","CERTIFICATE","CHANGE_RETENTION","CHANGE_TRACKING","CHANGES","CHAR","CHARACTER","CHECK","CHECK_CONSTRAINTS","CHECK_EXPIRATION","CHECK_POLICY","CHECKALLOC","CHECKCATALOG","CHECKCONSTRAINTS","CHECKDB","CHECKFILEGROUP","CHECKIDENT","CHECKPOINT","CHECKTABLE","CLASSIFIER_FUNCTION","CLEANTABLE","CLEANUP","CLEAR","CLOSE","CLUSTER","CLUSTERED","CODEPAGE","COLLATE","COLLECTION","COLUMN","COLUMN_SET","COLUMNS","COLUMNSTORE","COLUMNSTORE_ARCHIVE","COMMIT","COMMITTED","COMPATIBILITY_LEVEL","COMPRESSION","COMPUTE","CONCAT","CONCAT_NULL_YIELDS_NULL","CONFIGURATION","CONNECT","CONSTRAINT","CONTAINMENT","CONTENT","CONTEXT","CONTINUE","CONTINUE_AFTER_ERROR","CONTRACT","CONTRACT_NAME","CONTROL","CONVERSATION","COOKIE","COPY_ONLY","COUNTER","CPU","CREATE","CREATE_NEW","CREATION_DISPOSITION","CREDENTIAL","CRYPTOGRAPHIC","CUBE","CURRENT","CURRENT_DATE","CURSOR","CURSOR_CLOSE_ON_COMMIT","CURSOR_DEFAULT","CYCLE","DATA","DATA_COMPRESSION","DATA_PURITY","DATABASE","DATABASE_DEFAULT","DATABASE_MIRRORING","DATABASE_SNAPSHOT","DATAFILETYPE","DATE","DATE_CORRELATION_OPTIMIZATION","DATEFIRST","DATEFORMAT","DATETIME","DATETIME2","DATETIMEOFFSET","DAY","DAYOFYEAR","DAYS","DB_CHAINING","DBCC","DBREINDEX","DDL_DATABASE_LEVEL_EVENTS","DEADLOCK_PRIORITY","DEALLOCATE","DEC","DECIMAL","DECLARE","DECRYPTION","DEFAULT","DEFAULT_DATABASE","DEFAULT_FULLTEXT_LANGUAGE","DEFAULT_LANGUAGE","DEFAULT_SCHEMA","DEFINITION","DELAY","DELAYED_DURABILITY","DELETE","DELETED","DENSITY_VECTOR","DENY","DEPENDENTS","DES","DESC","DESCRIPTION","DESX","DHCP","DIAGNOSTICS","DIALOG","DIFFERENTIAL","DIRECTORY_NAME","DISABLE","DISABLE_BROKER","DISABLED","DISK","DISTINCT","DISTRIBUTED","DOCUMENT","DOUBLE","DROP","DROP_EXISTING","DROPCLEANBUFFERS","DUMP","DURABILITY","DYNAMIC","EDITION","ELEMENTS","ELSE","EMERGENCY","EMPTY","EMPTYFILE","ENABLE","ENABLE_BROKER","ENABLED","ENCRYPTION","END","ENDPOINT","ENDPOINT_URL","ERRLVL","ERROR","ERROR_BROKER_CONVERSATIONS","ERRORFILE","ESCAPE","ESTIMATEONLY","EVENT","EVENT_RETENTION_MODE","EXEC","EXECUTABLE","EXECUTE","EXIT","EXPAND","EXPIREDATE","EXPIRY_DATE","EXPLICIT","EXTENDED_LOGICAL_CHECKS","EXTENSION","EXTERNAL","EXTERNAL_ACCESS","FAIL_OPERATION","FAILOVER","FAILOVER_MODE","FAILURE_CONDITION_LEVEL","FALSE","FAN_IN","FAST","FAST_FORWARD","FETCH","FIELDTERMINATOR","FILE","FILEGROUP","FILEGROWTH","FILELISTONLY","FILENAME","FILEPATH","FILESTREAM","FILESTREAM_ON","FILETABLE_COLLATE_FILENAME","FILETABLE_DIRECTORY","FILETABLE_FULLPATH_UNIQUE_CONSTRAINT_NAME","FILETABLE_NAMESPACE","FILETABLE_PRIMARY_KEY_CONSTRAINT_NAME","FILETABLE_STREAMID_UNIQUE_CONSTRAINT_NAME","FILLFACTOR","FILTERING","FIRE_TRIGGERS","FIRST","FIRSTROW","FLOAT","FMTONLY","FOLLOWING","FOR","FORCE","FORCE_FAILOVER_ALLOW_DATA_LOSS","FORCE_SERVICE_ALLOW_DATA_LOSS","FORCED","FORCEPLAN","FORCESCAN","FORCESEEK","FOREIGN","FORMATFILE","FORMSOF","FORWARD_ONLY","FREE","FREEPROCCACHE","FREESESSIONCACHE","FREESYSTEMCACHE","FROM","FULL","FULLSCAN","FULLTEXT","FUNCTION","GB","GEOGRAPHY_AUTO_GRID","GEOGRAPHY_GRID","GEOMETRY_AUTO_GRID","GEOMETRY_GRID","GET","GLOBAL","GO","GOTO","GOVERNOR","GRANT","GRIDS","GROUP","GROUP_MAX_REQUESTS","HADR","HASH","HASHED","HAVING","HEADERONLY","HEALTH_CHECK_TIMEOUT","HELP","HIERARCHYID","HIGH","HINT","HISTOGRAM","HOLDLOCK","HONOR_BROKER_PRIORITY","HOUR","HOURS","IDENTITY","IDENTITY_INSERT","IDENTITY_VALUE","IDENTITYCOL","IF","IGNORE_CONSTRAINTS","IGNORE_DUP_KEY","IGNORE_NONCLUSTERED_COLUMNSTORE_INDEX","IGNORE_TRIGGERS","IMAGE","IMMEDIATE","IMPERSONATE","IMPLICIT_TRANSACTIONS","IMPORTANCE","INCLUDE","INCREMENT","INCREMENTAL","INDEX","INDEXDEFRAG","INFINITE","INFLECTIONAL","INIT","INITIATOR","INPUT","INPUTBUFFER","INSENSITIVE","INSERT","INSERTED","INSTEAD","INT","INTEGER","INTO","IO","IP","ISABOUT","ISOLATION","JOB","KB","KEEP","KEEP_CDC","KEEP_NULLS","KEEP_REPLICATION","KEEPDEFAULTS","KEEPFIXED","KEEPIDENTITY","KEEPNULLS","KERBEROS","KEY","KEY_SOURCE","KEYS","KEYSET","KILL","KILOBYTES_PER_BATCH","LABELONLY","LANGUAGE","LAST","LASTROW","LEVEL","LEVEL_1","LEVEL_2","LEVEL_3","LEVEL_4","LIFETIME","LIMIT","LINENO","LIST","LISTENER","LISTENER_IP","LISTENER_PORT","LOAD","LOADHISTORY","LOB_COMPACTION","LOCAL","LOCAL_SERVICE_NAME","LOCK_ESCALATION","LOCK_TIMEOUT","LOGIN","LOGSPACE","LOOP","LOW","MANUAL","MARK","MARK_IN_USE_FOR_REMOVAL","MASTER","MAX_CPU_PERCENT","MAX_DISPATCH_LATENCY","MAX_DOP","MAX_DURATION","MAX_EVENT_SIZE","MAX_FILES","MAX_IOPS_PER_VOLUME","MAX_MEMORY","MAX_MEMORY_PERCENT","MAX_QUEUE_READERS","MAX_ROLLOVER_FILES","MAX_SIZE","MAXDOP","MAXERRORS","MAXLENGTH","MAXRECURSION","MAXSIZE","MAXTRANSFERSIZE","MAXVALUE","MB","MEDIADESCRIPTION","MEDIANAME","MEDIAPASSWORD","MEDIUM","MEMBER","MEMORY_OPTIMIZED","MEMORY_OPTIMIZED_DATA","MEMORY_OPTIMIZED_ELEVATE_TO_SNAPSHOT","MEMORY_PARTITION_MODE","MERGE","MESSAGE","MESSAGE_FORWARD_SIZE","MESSAGE_FORWARDING","MICROSECOND","MILLISECOND","MIN_CPU_PERCENT","MIN_IOPS_PER_VOLUME","MIN_MEMORY_PERCENT","MINUTE","MINUTES","MINVALUE","MIRROR","MIRROR_ADDRESS","MODIFY","MONEY","MONTH","MOVE","MULTI_USER","MUST_CHANGE","NAME","NANOSECOND","NATIONAL","NATIVE_COMPILATION","NCHAR","NEGOTIATE","NESTED_TRIGGERS","NEW_ACCOUNT","NEW_BROKER","NEW_PASSWORD","NEWNAME","NEXT","NO","NO_BROWSETABLE","NO_CHECKSUM","NO_COMPRESSION","NO_EVENT_LOSS","NO_INFOMSGS","NO_TRUNCATE","NO_WAIT","NOCHECK","NOCOUNT","NOEXEC","NOEXPAND","NOFORMAT","NOINDEX","NOINIT","NOLOCK","NON","NON_TRANSACTED_ACCESS","NONCLUSTERED","NONE","NORECOMPUTE","NORECOVERY","NORESEED","NORESET","NOREWIND","NORMAL","NOSKIP","NOTIFICATION","NOTRUNCATE","NOUNLOAD","NOWAIT","NTEXT","NTLM","NUMANODE","NUMERIC","NUMERIC_ROUNDABORT","NVARCHAR","OBJECT","OF","OFF","OFFLINE","OFFSET","OFFSETS","OLD_ACCOUNT","OLD_PASSWORD","ON","ON_FAILURE","ONLINE","ONLY","OPEN","OPEN_EXISTING","OPENTRAN","OPTIMISTIC","OPTIMIZE","OPTION","ORDER","OUT","OUTPUT","OUTPUTBUFFER","OVER","OVERRIDE","OWNER","OWNERSHIP","PAD_INDEX","PAGE","PAGE_VERIFY","PAGECOUNT","PAGLOCK","PARAMETERIZATION","PARSEONLY","PARTIAL","PARTITION","PARTITIONS","PARTNER","PASSWORD","PATH","PER_CPU","PER_NODE","PERCENT","PERMISSION_SET","PERSISTED","PHYSICAL_ONLY","PLAN","POISON_MESSAGE_HANDLING","POOL","POPULATION","PORT","PRECEDING","PRECISION","PRIMARY","PRIMARY_ROLE","PRINT","PRIOR","PRIORITY","PRIORITY_LEVEL","PRIVATE","PRIVILEGES","PROC","PROCCACHE","PROCEDURE","PROCEDURE_NAME","PROCESS","PROFILE","PROPERTY","PROPERTY_DESCRIPTION","PROPERTY_INT_ID","PROPERTY_SET_GUID","PROVIDER","PROVIDER_KEY_NAME","PUBLIC","PUT","QUARTER","QUERY","QUERY_GOVERNOR_COST_LIMIT","QUEUE","QUEUE_DELAY","QUOTED_IDENTIFIER","RAISERROR","RANGE","RAW","RC2","RC4","RC4_128","READ","READ_COMMITTED_SNAPSHOT","READ_ONLY","READ_ONLY_ROUTING_LIST","READ_ONLY_ROUTING_URL","READ_WRITE","READ_WRITE_FILEGROUPS","READCOMMITTED","READCOMMITTEDLOCK","READONLY","READPAST","READTEXT","READUNCOMMITTED","READWRITE","REAL","REBUILD","RECEIVE","RECOMPILE","RECONFIGURE","RECOVERY","RECURSIVE","RECURSIVE_TRIGGERS","REFERENCES","REGENERATE","RELATED_CONVERSATION","RELATED_CONVERSATION_GROUP","RELATIVE","REMOTE","REMOTE_PROC_TRANSACTIONS","REMOTE_SERVICE_NAME","REMOVE","REORGANIZE","REPAIR_ALLOW_DATA_LOSS","REPAIR_FAST","REPAIR_REBUILD","REPEATABLE","REPEATABLEREAD","REPLICA","REPLICATION","REQUEST_MAX_CPU_TIME_SEC","REQUEST_MAX_MEMORY_GRANT_PERCENT","REQUEST_MEMORY_GRANT_TIMEOUT_SEC","REQUIRED","RESAMPLE","RESEED","RESERVE_DISK_SPACE","RESET","RESOURCE","RESTART","RESTORE","RESTRICT","RESTRICTED_USER","RESULT","RESUME","RETAINDAYS","RETENTION","RETURN","RETURNS","REVERT","REVOKE","REWIND","REWINDONLY","ROBUST","ROLE","ROLLBACK","ROLLUP","ROOT","ROUTE","ROW","ROWCOUNT","ROWGUIDCOL","ROWLOCK","ROWS","ROWS_PER_BATCH","ROWTERMINATOR","ROWVERSION","RSA_1024","RSA_2048","RSA_512","RULE","SAFE","SAFETY","SAMPLE","SAVE","SCHEDULER","SCHEMA","SCHEMA_AND_DATA","SCHEMA_ONLY","SCHEMABINDING","SCHEME","SCROLL","SCROLL_LOCKS","SEARCH","SECOND","SECONDARY","SECONDARY_ONLY","SECONDARY_ROLE","SECONDS","SECRET","SECURITY_LOG","SECURITYAUDIT","SELECT","SELECTIVE","SELF","SEND","SENT","SEQUENCE","SERIALIZABLE","SERVER","SERVICE","SERVICE_BROKER","SERVICE_NAME","SESSION","SESSION_TIMEOUT","SET","SETS","SETUSER","SHOW_STATISTICS","SHOWCONTIG","SHOWPLAN","SHOWPLAN_ALL","SHOWPLAN_TEXT","SHOWPLAN_XML","SHRINKDATABASE","SHRINKFILE","SHUTDOWN","SID","SIGNATURE","SIMPLE","SINGLE_BLOB","SINGLE_CLOB","SINGLE_NCLOB","SINGLE_USER","SINGLETON","SIZE","SKIP","SMALLDATETIME","SMALLINT","SMALLMONEY","SNAPSHOT","SORT_IN_TEMPDB","SOURCE","SPARSE","SPATIAL","SPATIAL_WINDOW_MAX_CELLS","SPECIFICATION","SPLIT","SQL","SQL_VARIANT","SQLPERF","STANDBY","START","START_DATE","STARTED","STARTUP_STATE","STAT_HEADER","STATE","STATEMENT","STATIC","STATISTICAL_SEMANTICS","STATISTICS","STATISTICS_INCREMENTAL","STATISTICS_NORECOMPUTE","STATS","STATS_STREAM","STATUS","STATUSONLY","STOP","STOP_ON_ERROR","STOPAT","STOPATMARK","STOPBEFOREMARK","STOPLIST","STOPPED","SUBJECT","SUBSCRIPTION","SUPPORTED","SUSPEND","SWITCH","SYMMETRIC","SYNCHRONOUS_COMMIT","SYNONYM","SYSNAME","SYSTEM","TABLE","TABLERESULTS","TABLESAMPLE","TABLOCK","TABLOCKX","TAKE","TAPE","TARGET","TARGET_RECOVERY_TIME","TB","TCP","TEXT","TEXTIMAGE_ON","TEXTSIZE","THEN","THESAURUS","THROW","TIES","TIME","TIMEOUT","TIMER","TIMESTAMP","TINYINT","TO","TOP","TORN_PAGE_DETECTION","TRACEOFF","TRACEON","TRACESTATUS","TRACK_CAUSALITY","TRACK_COLUMNS_UPDATED","TRAN","TRANSACTION","TRANSFER","TRANSFORM_NOISE_WORDS","TRIGGER","TRIPLE_DES","TRIPLE_DES_3KEY","TRUE","TRUNCATE","TRUNCATEONLY","TRUSTWORTHY","TRY","TSQL","TWO_DIGIT_YEAR_CUTOFF","TYPE","TYPE_WARNING","UNBOUNDED","UNCHECKED","UNCOMMITTED","UNDEFINED","UNIQUE","UNIQUEIDENTIFIER","UNKNOWN","UNLIMITED","UNLOAD","UNSAFE","UPDATE","UPDATETEXT","UPDATEUSAGE","UPDLOCK","URL","USE","USED","USER","USEROPTIONS","USING","VALID_XML","VALIDATION","VALUE","VALUES","VARBINARY","VARCHAR","VARYING","VERIFYONLY","VERSION","VIEW","VIEW_METADATA","VIEWS","VISIBILITY","WAIT_AT_LOW_PRIORITY","WAITFOR","WEEK","WEIGHT","WELL_FORMED_XML","WHEN","WHERE","WHILE","WINDOWS","WITH","WITHIN","WITHOUT","WITNESS","WORK","WORKLOAD","WRITETEXT","XACT_ABORT","XLOCK","XMAX","XMIN","XML","XMLDATA","XMLNAMESPACES","XMLSCHEMA","XQUERY","XSINIL","YEAR","YMAX","YMIN"],operators:["ALL","AND","ANY","BETWEEN","EXISTS","IN","LIKE","NOT","OR","SOME","EXCEPT","INTERSECT","UNION","APPLY","CROSS","FULL","INNER","JOIN","LEFT","OUTER","RIGHT","CONTAINS","FREETEXT","IS","NULL","PIVOT","UNPIVOT","MATCHED"],builtinFunctions:["AVG","CHECKSUM_AGG","COUNT","COUNT_BIG","GROUPING","GROUPING_ID","MAX","MIN","SUM","STDEV","STDEVP","VAR","VARP","CUME_DIST","FIRST_VALUE","LAG","LAST_VALUE","LEAD","PERCENTILE_CONT","PERCENTILE_DISC","PERCENT_RANK","COLLATE","COLLATIONPROPERTY","TERTIARY_WEIGHTS","FEDERATION_FILTERING_VALUE","CAST","CONVERT","PARSE","TRY_CAST","TRY_CONVERT","TRY_PARSE","ASYMKEY_ID","ASYMKEYPROPERTY","CERTPROPERTY","CERT_ID","CRYPT_GEN_RANDOM","DECRYPTBYASYMKEY","DECRYPTBYCERT","DECRYPTBYKEY","DECRYPTBYKEYAUTOASYMKEY","DECRYPTBYKEYAUTOCERT","DECRYPTBYPASSPHRASE","ENCRYPTBYASYMKEY","ENCRYPTBYCERT","ENCRYPTBYKEY","ENCRYPTBYPASSPHRASE","HASHBYTES","IS_OBJECTSIGNED","KEY_GUID","KEY_ID","KEY_NAME","SIGNBYASYMKEY","SIGNBYCERT","SYMKEYPROPERTY","VERIFYSIGNEDBYCERT","VERIFYSIGNEDBYASYMKEY","CURSOR_STATUS","DATALENGTH","IDENT_CURRENT","IDENT_INCR","IDENT_SEED","IDENTITY","SQL_VARIANT_PROPERTY","CURRENT_TIMESTAMP","DATEADD","DATEDIFF","DATEFROMPARTS","DATENAME","DATEPART","DATETIME2FROMPARTS","DATETIMEFROMPARTS","DATETIMEOFFSETFROMPARTS","DAY","EOMONTH","GETDATE","GETUTCDATE","ISDATE","MONTH","SMALLDATETIMEFROMPARTS","SWITCHOFFSET","SYSDATETIME","SYSDATETIMEOFFSET","SYSUTCDATETIME","TIMEFROMPARTS","TODATETIMEOFFSET","YEAR","CHOOSE","COALESCE","IIF","NULLIF","ABS","ACOS","ASIN","ATAN","ATN2","CEILING","COS","COT","DEGREES","EXP","FLOOR","LOG","LOG10","PI","POWER","RADIANS","RAND","ROUND","SIGN","SIN","SQRT","SQUARE","TAN","APP_NAME","APPLOCK_MODE","APPLOCK_TEST","ASSEMBLYPROPERTY","COL_LENGTH","COL_NAME","COLUMNPROPERTY","DATABASE_PRINCIPAL_ID","DATABASEPROPERTYEX","DB_ID","DB_NAME","FILE_ID","FILE_IDEX","FILE_NAME","FILEGROUP_ID","FILEGROUP_NAME","FILEGROUPPROPERTY","FILEPROPERTY","FULLTEXTCATALOGPROPERTY","FULLTEXTSERVICEPROPERTY","INDEX_COL","INDEXKEY_PROPERTY","INDEXPROPERTY","OBJECT_DEFINITION","OBJECT_ID","OBJECT_NAME","OBJECT_SCHEMA_NAME","OBJECTPROPERTY","OBJECTPROPERTYEX","ORIGINAL_DB_NAME","PARSENAME","SCHEMA_ID","SCHEMA_NAME","SCOPE_IDENTITY","SERVERPROPERTY","STATS_DATE","TYPE_ID","TYPE_NAME","TYPEPROPERTY","DENSE_RANK","NTILE","RANK","ROW_NUMBER","PUBLISHINGSERVERNAME","OPENDATASOURCE","OPENQUERY","OPENROWSET","OPENXML","CERTENCODED","CERTPRIVATEKEY","CURRENT_USER","HAS_DBACCESS","HAS_PERMS_BY_NAME","IS_MEMBER","IS_ROLEMEMBER","IS_SRVROLEMEMBER","LOGINPROPERTY","ORIGINAL_LOGIN","PERMISSIONS","PWDENCRYPT","PWDCOMPARE","SESSION_USER","SESSIONPROPERTY","SUSER_ID","SUSER_NAME","SUSER_SID","SUSER_SNAME","SYSTEM_USER","USER","USER_ID","USER_NAME","ASCII","CHAR","CHARINDEX","CONCAT","DIFFERENCE","FORMAT","LEFT","LEN","LOWER","LTRIM","NCHAR","PATINDEX","QUOTENAME","REPLACE","REPLICATE","REVERSE","RIGHT","RTRIM","SOUNDEX","SPACE","STR","STUFF","SUBSTRING","UNICODE","UPPER","BINARY_CHECKSUM","CHECKSUM","CONNECTIONPROPERTY","CONTEXT_INFO","CURRENT_REQUEST_ID","ERROR_LINE","ERROR_NUMBER","ERROR_MESSAGE","ERROR_PROCEDURE","ERROR_SEVERITY","ERROR_STATE","FORMATMESSAGE","GETANSINULL","GET_FILESTREAM_TRANSACTION_CONTEXT","HOST_ID","HOST_NAME","ISNULL","ISNUMERIC","MIN_ACTIVE_ROWVERSION","NEWID","NEWSEQUENTIALID","ROWCOUNT_BIG","XACT_STATE","TEXTPTR","TEXTVALID","COLUMNS_UPDATED","EVENTDATA","TRIGGER_NESTLEVEL","UPDATE","CHANGETABLE","CHANGE_TRACKING_CONTEXT","CHANGE_TRACKING_CURRENT_VERSION","CHANGE_TRACKING_IS_COLUMN_IN_MASK","CHANGE_TRACKING_MIN_VALID_VERSION","CONTAINSTABLE","FREETEXTTABLE","SEMANTICKEYPHRASETABLE","SEMANTICSIMILARITYDETAILSTABLE","SEMANTICSIMILARITYTABLE","FILETABLEROOTPATH","GETFILENAMESPACEPATH","GETPATHLOCATOR","PATHNAME","GET_TRANSMISSION_STATUS"],builtinVariables:["@@DATEFIRST","@@DBTS","@@LANGID","@@LANGUAGE","@@LOCK_TIMEOUT","@@MAX_CONNECTIONS","@@MAX_PRECISION","@@NESTLEVEL","@@OPTIONS","@@REMSERVER","@@SERVERNAME","@@SERVICENAME","@@SPID","@@TEXTSIZE","@@VERSION","@@CURSOR_ROWS","@@FETCH_STATUS","@@DATEFIRST","@@PROCID","@@ERROR","@@IDENTITY","@@ROWCOUNT","@@TRANCOUNT","@@CONNECTIONS","@@CPU_BUSY","@@IDLE","@@IO_BUSY","@@PACKET_ERRORS","@@PACK_RECEIVED","@@PACK_SENT","@@TIMETICKS","@@TOTAL_ERRORS","@@TOTAL_READ","@@TOTAL_WRITE"],pseudoColumns:["$ACTION","$IDENTITY","$ROWGUID","$PARTITION"],tokenizer:{root:[{include:"@comments"},{include:"@whitespace"},{include:"@pseudoColumns"},{include:"@numbers"},{include:"@strings"},{include:"@complexIdentifiers"},{include:"@scopes"},[/[;,.]/,"delimiter"],[/[()]/,"@brackets"],[/[\w@#$]+/,{cases:{"@keywords":"keyword","@operators":"operator","@builtinVariables":"predefined","@builtinFunctions":"predefined","@default":"identifier"}}],[/[<>=!%&+\-*/|~^]/,"operator"]],whitespace:[[/\s+/,"white"]],comments:[[/--+.*/,"comment"],[/\/\*/,{token:"comment.quote",next:"@comment"}]],comment:[[/[^*/]+/,"comment"],[/\*\//,{token:"comment.quote",next:"@pop"}],[/./,"comment"]],pseudoColumns:[[/[$][A-Za-z_][\w@#$]*/,{cases:{"@pseudoColumns":"predefined","@default":"identifier"}}]],numbers:[[/0[xX][0-9a-fA-F]*/,"number"],[/[$][+-]*\d*(\.\d*)?/,"number"],[/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/,"number"]],strings:[[/N'/,{token:"string",next:"@string"}],[/'/,{token:"string",next:"@string"}]],string:[[/[^']+/,"string"],[/''/,"string"],[/'/,{token:"string",next:"@pop"}]],complexIdentifiers:[[/\[/,{token:"identifier.quote",next:"@bracketedIdentifier"}],[/"/,{token:"identifier.quote",next:"@quotedIdentifier"}]],bracketedIdentifier:[[/[^\]]+/,"identifier"],[/]]/,"identifier"],[/]/,{token:"identifier.quote",next:"@pop"}]],quotedIdentifier:[[/[^"]+/,"identifier"],[/""/,"identifier"],[/"/,{token:"identifier.quote",next:"@pop"}]],scopes:[[/BEGIN\s+(DISTRIBUTED\s+)?TRAN(SACTION)?\b/i,"keyword"],[/BEGIN\s+TRY\b/i,{token:"keyword.try"}],[/END\s+TRY\b/i,{token:"keyword.try"}],[/BEGIN\s+CATCH\b/i,{token:"keyword.catch"}],[/END\s+CATCH\b/i,{token:"keyword.catch"}],[/(BEGIN|CASE)\b/i,{token:"keyword.block"}],[/END\b/i,{token:"keyword.block"}],[/WHEN\b/i,{token:"keyword.choice"}],[/THEN\b/i,{token:"keyword.choice"}]]}}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/st/st.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/st/st.js new file mode 100644 index 0000000..b90dddf --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/st/st.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/st/st",["require","exports"],(function(e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.language=n.conf=void 0,n.conf={comments:{lineComment:"//",blockComment:["(*","*)"]},brackets:[["{","}"],["[","]"],["(",")"],["var","end_var"],["var_input","end_var"],["var_output","end_var"],["var_in_out","end_var"],["var_temp","end_var"],["var_global","end_var"],["var_access","end_var"],["var_external","end_var"],["type","end_type"],["struct","end_struct"],["program","end_program"],["function","end_function"],["function_block","end_function_block"],["action","end_action"],["step","end_step"],["initial_step","end_step"],["transaction","end_transaction"],["configuration","end_configuration"],["tcp","end_tcp"],["recource","end_recource"],["channel","end_channel"],["library","end_library"],["folder","end_folder"],["binaries","end_binaries"],["includes","end_includes"],["sources","end_sources"]],autoClosingPairs:[{open:"[",close:"]"},{open:"{",close:"}"},{open:"(",close:")"},{open:"/*",close:"*/"},{open:"'",close:"'",notIn:["string_sq"]},{open:'"',close:'"',notIn:["string_dq"]},{open:"var_input",close:"end_var"},{open:"var_output",close:"end_var"},{open:"var_in_out",close:"end_var"},{open:"var_temp",close:"end_var"},{open:"var_global",close:"end_var"},{open:"var_access",close:"end_var"},{open:"var_external",close:"end_var"},{open:"type",close:"end_type"},{open:"struct",close:"end_struct"},{open:"program",close:"end_program"},{open:"function",close:"end_function"},{open:"function_block",close:"end_function_block"},{open:"action",close:"end_action"},{open:"step",close:"end_step"},{open:"initial_step",close:"end_step"},{open:"transaction",close:"end_transaction"},{open:"configuration",close:"end_configuration"},{open:"tcp",close:"end_tcp"},{open:"recource",close:"end_recource"},{open:"channel",close:"end_channel"},{open:"library",close:"end_library"},{open:"folder",close:"end_folder"},{open:"binaries",close:"end_binaries"},{open:"includes",close:"end_includes"},{open:"sources",close:"end_sources"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"var",close:"end_var"},{open:"var_input",close:"end_var"},{open:"var_output",close:"end_var"},{open:"var_in_out",close:"end_var"},{open:"var_temp",close:"end_var"},{open:"var_global",close:"end_var"},{open:"var_access",close:"end_var"},{open:"var_external",close:"end_var"},{open:"type",close:"end_type"},{open:"struct",close:"end_struct"},{open:"program",close:"end_program"},{open:"function",close:"end_function"},{open:"function_block",close:"end_function_block"},{open:"action",close:"end_action"},{open:"step",close:"end_step"},{open:"initial_step",close:"end_step"},{open:"transaction",close:"end_transaction"},{open:"configuration",close:"end_configuration"},{open:"tcp",close:"end_tcp"},{open:"recource",close:"end_recource"},{open:"channel",close:"end_channel"},{open:"library",close:"end_library"},{open:"folder",close:"end_folder"},{open:"binaries",close:"end_binaries"},{open:"includes",close:"end_includes"},{open:"sources",close:"end_sources"}],folding:{markers:{start:new RegExp("^\\s*#pragma\\s+region\\b"),end:new RegExp("^\\s*#pragma\\s+endregion\\b")}}},n.language={defaultToken:"",tokenPostfix:".st",ignoreCase:!0,brackets:[{token:"delimiter.curly",open:"{",close:"}"},{token:"delimiter.parenthesis",open:"(",close:")"},{token:"delimiter.square",open:"[",close:"]"}],keywords:["if","end_if","elsif","else","case","of","to","__try","__catch","__finally","do","with","by","while","repeat","end_while","end_repeat","end_case","for","end_for","task","retain","non_retain","constant","with","at","exit","return","interval","priority","address","port","on_channel","then","iec","file","uses","version","packagetype","displayname","copyright","summary","vendor","common_source","from","extends"],constant:["false","true","null"],defineKeywords:["var","var_input","var_output","var_in_out","var_temp","var_global","var_access","var_external","end_var","type","end_type","struct","end_struct","program","end_program","function","end_function","function_block","end_function_block","interface","end_interface","method","end_method","property","end_property","namespace","end_namespace","configuration","end_configuration","tcp","end_tcp","resource","end_resource","channel","end_channel","library","end_library","folder","end_folder","binaries","end_binaries","includes","end_includes","sources","end_sources","action","end_action","step","initial_step","end_step","transaction","end_transaction"],typeKeywords:["int","sint","dint","lint","usint","uint","udint","ulint","real","lreal","time","date","time_of_day","date_and_time","string","bool","byte","word","dword","array","pointer","lword"],operators:["=",">","<",":",":=","<=",">=","<>","&","+","-","*","**","MOD","^","or","and","not","xor","abs","acos","asin","atan","cos","exp","expt","ln","log","sin","sqrt","tan","sel","max","min","limit","mux","shl","shr","rol","ror","indexof","sizeof","adr","adrinst","bitadr","is_valid","ref","ref_to"],builtinVariables:[],builtinFunctions:["sr","rs","tp","ton","tof","eq","ge","le","lt","ne","round","trunc","ctd","сtu","ctud","r_trig","f_trig","move","concat","delete","find","insert","left","len","replace","right","rtc"],symbols:/[=>`?!+*\\\/]/,operatorstart:/[\/=\-+!*%<>&|^~?\u00A1-\u00A7\u00A9\u00AB\u00AC\u00AE\u00B0-\u00B1\u00B6\u00BB\u00BF\u00D7\u00F7\u2016-\u2017\u2020-\u2027\u2030-\u203E\u2041-\u2053\u2055-\u205E\u2190-\u23FF\u2500-\u2775\u2794-\u2BFF\u2E00-\u2E7F\u3001-\u3003\u3008-\u3030]/,operatorend:/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE00-\uFE0F\uFE20-\uFE2F\uE0100-\uE01EF]/,operators:/(@operatorstart)((@operatorstart)|(@operatorend))*/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[{include:"@whitespace"},{include:"@comment"},{include:"@attribute"},{include:"@literal"},{include:"@keyword"},{include:"@invokedmethod"},{include:"@symbol"}],whitespace:[[/\s+/,"white"],[/"""/,"string.quote","@endDblDocString"]],endDblDocString:[[/[^"]+/,"string"],[/\\"/,"string"],[/"""/,"string.quote","@popall"],[/"/,"string"]],symbol:[[/[{}()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/[.]/,"delimiter"],[/@operators/,"operator"],[/@symbols/,"operator"]],comment:[[/\/\/\/.*$/,"comment.doc"],[/\/\*\*/,"comment.doc","@commentdocbody"],[/\/\/.*$/,"comment"],[/\/\*/,"comment","@commentbody"]],commentdocbody:[[/\/\*/,"comment","@commentbody"],[/\*\//,"comment.doc","@pop"],[/\:[a-zA-Z]+\:/,"comment.doc.param"],[/./,"comment.doc"]],commentbody:[[/\/\*/,"comment","@commentbody"],[/\*\//,"comment","@pop"],[/./,"comment"]],attribute:[[/\@@identifier/,{cases:{"@attributes":"keyword.control","@default":""}}]],literal:[[/"/,{token:"string.quote",next:"@stringlit"}],[/0[b]([01]_?)+/,"number.binary"],[/0[o]([0-7]_?)+/,"number.octal"],[/0[x]([0-9a-fA-F]_?)+([pP][\-+](\d_?)+)?/,"number.hex"],[/(\d_?)*\.(\d_?)+([eE][\-+]?(\d_?)+)?/,"number.float"],[/(\d_?)+/,"number"]],stringlit:[[/\\\(/,{token:"operator",next:"@interpolatedexpression"}],[/@escapes/,"string"],[/\\./,"string.escape.invalid"],[/"/,{token:"string.quote",next:"@pop"}],[/./,"string"]],interpolatedexpression:[[/\(/,{token:"operator",next:"@interpolatedexpression"}],[/\)/,{token:"operator",next:"@pop"}],{include:"@literal"},{include:"@keyword"},{include:"@symbol"}],keyword:[[/`/,{token:"operator",next:"@escapedkeyword"}],[/@identifier/,{cases:{"@keywords":"keyword","[A-Z][a-zA-Z0-9$]*":"type.identifier","@default":"identifier"}}]],escapedkeyword:[[/`/,{token:"operator",next:"@pop"}],[/./,"identifier"]],invokedmethod:[[/([.])(@identifier)/,{cases:{$2:["delimeter","type.identifier"],"@default":""}}]]}}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/systemverilog/systemverilog.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/systemverilog/systemverilog.js new file mode 100644 index 0000000..f2e11d7 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/systemverilog/systemverilog.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/systemverilog/systemverilog",["require","exports"],(function(e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.language=n.conf=void 0,n.conf={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"],["begin","end"],["case","endcase"],["casex","endcase"],["casez","endcase"],["checker","endchecker"],["class","endclass"],["clocking","endclocking"],["config","endconfig"],["function","endfunction"],["generate","endgenerate"],["group","endgroup"],["interface","endinterface"],["module","endmodule"],["package","endpackage"],["primitive","endprimitive"],["program","endprogram"],["property","endproperty"],["specify","endspecify"],["sequence","endsequence"],["table","endtable"],["task","endtask"]],autoClosingPairs:[{open:"[",close:"]"},{open:"{",close:"}"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{offSide:!1,markers:{start:new RegExp("^(?:\\s*|.*(?!\\/[\\/\\*])[^\\w])(?:begin|case(x|z)?|class|clocking|config|covergroup|function|generate|interface|module|package|primitive|property|program|sequence|specify|table|task)\\b"),end:new RegExp("^(?:\\s*|.*(?!\\/[\\/\\*])[^\\w])(?:end|endcase|endclass|endclocking|endconfig|endgroup|endfunction|endgenerate|endinterface|endmodule|endpackage|endprimitive|endproperty|endprogram|endsequence|endspecify|endtable|endtask)\\b")}}},n.language={defaultToken:"",tokenPostfix:".sv",brackets:[{token:"delimiter.curly",open:"{",close:"}"},{token:"delimiter.parenthesis",open:"(",close:")"},{token:"delimiter.square",open:"[",close:"]"},{token:"delimiter.angle",open:"<",close:">"}],keywords:["accept_on","alias","always","always_comb","always_ff","always_latch","and","assert","assign","assume","automatic","before","begin","bind","bins","binsof","bit","break","buf","bufif0","bufif1","byte","case","casex","casez","cell","chandle","checker","class","clocking","cmos","config","const","constraint","context","continue","cover","covergroup","coverpoint","cross","deassign","default","defparam","design","disable","dist","do","edge","else","end","endcase","endchecker","endclass","endclocking","endconfig","endfunction","endgenerate","endgroup","endinterface","endmodule","endpackage","endprimitive","endprogram","endproperty","endspecify","endsequence","endtable","endtask","enum","event","eventually","expect","export","extends","extern","final","first_match","for","force","foreach","forever","fork","forkjoin","function","generate","genvar","global","highz0","highz1","if","iff","ifnone","ignore_bins","illegal_bins","implements","implies","import","incdir","include","initial","inout","input","inside","instance","int","integer","interconnect","interface","intersect","join","join_any","join_none","large","let","liblist","library","local","localparam","logic","longint","macromodule","matches","medium","modport","module","nand","negedge","nettype","new","nexttime","nmos","nor","noshowcancelled","not","notif0","notif1","null","or","output","package","packed","parameter","pmos","posedge","primitive","priority","program","property","protected","pull0","pull1","pulldown","pullup","pulsestyle_ondetect","pulsestyle_onevent","pure","rand","randc","randcase","randsequence","rcmos","real","realtime","ref","reg","reject_on","release","repeat","restrict","return","rnmos","rpmos","rtran","rtranif0","rtranif1","s_always","s_eventually","s_nexttime","s_until","s_until_with","scalared","sequence","shortint","shortreal","showcancelled","signed","small","soft","solve","specify","specparam","static","string","strong","strong0","strong1","struct","super","supply0","supply1","sync_accept_on","sync_reject_on","table","tagged","task","this","throughout","time","timeprecision","timeunit","tran","tranif0","tranif1","tri","tri0","tri1","triand","trior","trireg","type","typedef","union","unique","unique0","unsigned","until","until_with","untyped","use","uwire","var","vectored","virtual","void","wait","wait_order","wand","weak","weak0","weak1","while","wildcard","wire","with","within","wor","xnor","xor"],builtin_gates:["and","nand","nor","or","xor","xnor","buf","not","bufif0","bufif1","notif1","notif0","cmos","nmos","pmos","rcmos","rnmos","rpmos","tran","tranif1","tranif0","rtran","rtranif1","rtranif0"],operators:["=","+=","-=","*=","/=","%=","&=","|=","^=","<<=",">>+","<<<=",">>>=","?",":","+","-","!","~","&","~&","|","~|","^","~^","^~","+","-","*","/","%","==","!=","===","!==","==?","!=?","&&","||","**","<","<=",">",">=","&","|","^",">>","<<",">>>","<<<","++","--","->","<->","inside","dist","::","+:","-:","*>","&&&","|->","|=>","#=#"],symbols:/[=>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],{include:"@numbers"},[/[;,.]/,"delimiter"],{include:"@strings"}],identifier_or_keyword:[[/@identifier/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"identifier"}}]],numbers:[[/\d+?[\d_]*(?:\.[\d_]+)?[eE][\-+]?\d+/,"number.float"],[/\d+?[\d_]*\.[\d_]+(?:\s*@timeunits)?/,"number.float"],[/(?:\d+?[\d_]*\s*)?'[sS]?[dD]\s*[0-9xXzZ?]+?[0-9xXzZ?_]*/,"number"],[/(?:\d+?[\d_]*\s*)?'[sS]?[bB]\s*[0-1xXzZ?]+?[0-1xXzZ?_]*/,"number.binary"],[/(?:\d+?[\d_]*\s*)?'[sS]?[oO]\s*[0-7xXzZ?]+?[0-7xXzZ?_]*/,"number.octal"],[/(?:\d+?[\d_]*\s*)?'[sS]?[hH]\s*[0-9a-fA-FxXzZ?]+?[0-9a-fA-FxXzZ?_]*/,"number.hex"],[/1step/,"number"],[/[\dxXzZ]+?[\dxXzZ_]*(?:\s*@timeunits)?/,"number"],[/'[01xXzZ]+/,"number"]],module_instance:[{include:"@whitespace"},[/(#?)(\()/,["",{token:"@brackets",next:"@port_connection"}]],[/@identifier\s*[;={}\[\],]/,{token:"@rematch",next:"@pop"}],[/@symbols|[;={}\[\],]/,{token:"@rematch",next:"@pop"}],[/@identifier/,"type"],[/;/,"delimiter","@pop"]],port_connection:[{include:"@identifier_or_keyword"},{include:"@whitespace"},[/@systemcall/,"variable.predefined"],{include:"@numbers"},{include:"@strings"},[/[,]/,"delimiter"],[/\(/,"@brackets","@port_connection"],[/\)/,"@brackets","@pop"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],strings:[[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],include:[[/(\s*)(")([\w*\/*]*)(.\w*)(")/,["","string.include.identifier","string.include.identifier","string.include.identifier",{token:"string.include.identifier",next:"@pop"}]],[/(\s*)(<)([\w*\/*]*)(.\w*)(>)/,["","string.include.identifier","string.include.identifier","string.include.identifier",{token:"string.include.identifier",next:"@pop"}]]]}}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/tcl/tcl.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/tcl/tcl.js new file mode 100644 index 0000000..5f8322f --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/tcl/tcl.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/tcl/tcl",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.language=t.conf=void 0,t.conf={brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},t.language={tokenPostfix:".tcl",specialFunctions:["set","unset","rename","variable","proc","coroutine","foreach","incr","append","lappend","linsert","lreplace"],mainFunctions:["if","then","elseif","else","case","switch","while","for","break","continue","return","package","namespace","catch","exit","eval","expr","uplevel","upvar"],builtinFunctions:["file","info","concat","join","lindex","list","llength","lrange","lsearch","lsort","split","array","parray","binary","format","regexp","regsub","scan","string","subst","dict","cd","clock","exec","glob","pid","pwd","close","eof","fblocked","fconfigure","fcopy","fileevent","flush","gets","open","puts","read","seek","socket","tell","interp","after","auto_execok","auto_load","auto_mkindex","auto_reset","bgerror","error","global","history","load","source","time","trace","unknown","unset","update","vwait","winfo","wm","bind","event","pack","place","grid","font","bell","clipboard","destroy","focus","grab","lower","option","raise","selection","send","tk","tkwait","tk_bisque","tk_focusNext","tk_focusPrev","tk_focusFollowsMouse","tk_popup","tk_setPalette"],symbols:/[=>\/\s]+)/g,comments:{blockComment:["{#","#}"]},brackets:[["{#","#}"],["{%","%}"],["{{","}}"],["(",")"],["[","]"],["\x3c!--","--\x3e"],["<",">"]],autoClosingPairs:[{open:"{# ",close:" #}"},{open:"{% ",close:" %}"},{open:"{{ ",close:" }}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:'"',close:'"'},{open:"'",close:"'"},{open:"<",close:">"}]},e.language={defaultToken:"",tokenPostfix:"",ignoreCase:!0,keywords:["apply","autoescape","block","deprecated","do","embed","extends","flush","for","from","if","import","include","macro","sandbox","set","use","verbatim","with","endapply","endautoescape","endblock","endembed","endfor","endif","endmacro","endsandbox","endset","endwith","true","false"],tokenizer:{root:[[/\s+/],[/{#/,"comment.twig","@commentState"],[/{%[-~]?/,"delimiter.twig","@blockState"],[/{{[-~]?/,"delimiter.twig","@variableState"],[/)/,["delimiter.html","tag.html","","delimiter.html"]],[/(<)(script)/,["delimiter.html",{token:"tag.html",next:"@script"}]],[/(<)(style)/,["delimiter.html",{token:"tag.html",next:"@style"}]],[/(<)((?:[\w\-]+:)?[\w\-]+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/(<\/)((?:[\w\-]+:)?[\w\-]+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/|>=|<=/,"operators.twig"],[/(starts with|ends with|matches)(\s+)/,["operators.twig",""]],[/(in)(\s+)/,["operators.twig",""]],[/(is)(\s+)/,["operators.twig",""]],[/\||~|:|\.{1,2}|\?{1,2}/,"operators.twig"],[/[^\W\d][\w]*/,{cases:{"@keywords":"keyword.twig","@default":"variable.twig"}}],[/\d+(\.\d+)?/,"number.twig"],[/\(|\)|\[|\]|{|}|,/,"delimiter.twig"],[/"([^#"\\]*(?:\\.[^#"\\]*)*)"|\'([^\'\\]*(?:\\.[^\'\\]*)*)\'/,"string.twig"],[/"/,"string.twig","@stringState"],[/=>/,"operators.twig"],[/=/,"operators.twig"]],doctype:[[/[^>]+/,"metatag.content.html"],[/>/,"metatag.html","@pop"]],comment:[[/-->/,"comment.html","@pop"],[/[^-]+/,"comment.content.html"],[/./,"comment.content.html"]],otherTag:[[/\/?>/,"delimiter.html","@pop"],[/"([^"]*)"/,"attribute.value.html"],[/'([^']*)'/,"attribute.value.html"],[/[\w\-]+/,"attribute.name.html"],[/=/,"delimiter.html"],[/[ \t\r\n]+/]],script:[[/type/,"attribute.name.html","@scriptAfterType"],[/"([^"]*)"/,"attribute.value.html"],[/'([^']*)'/,"attribute.value.html"],[/[\w\-]+/,"attribute.name.html"],[/=/,"delimiter.html"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],scriptAfterType:[[/=/,"delimiter.html","@scriptAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/"([^"]*)"/,{token:"attribute.value.html",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value.html",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/>/,{token:"delimiter.html",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value.html"],[/'([^']*)'/,"attribute.value.html"],[/[\w\-]+/,"attribute.name.html"],[/=/,"delimiter.html"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]],style:[[/type/,"attribute.name.html","@styleAfterType"],[/"([^"]*)"/,"attribute.value.html"],[/'([^']*)'/,"attribute.value.html"],[/[\w\-]+/,"attribute.name.html"],[/=/,"delimiter.html"],[/>/,{token:"delimiter.html",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],styleAfterType:[[/=/,"delimiter.html","@styleAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/"([^"]*)"/,{token:"attribute.value.html",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value.html",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/>/,{token:"delimiter.html",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value.html"],[/'([^']*)'/,"attribute.value.html"],[/[\w\-]+/,"attribute.name.html"],[/=/,"delimiter.html"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]]}}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/typescript/typescript.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/typescript/typescript.js new file mode 100644 index 0000000..5104e74 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/typescript/typescript.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/typescript/typescript",["require","exports","../fillers/monaco-editor-core"],(function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.language=t.conf=void 0,t.conf={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],onEnterRules:[{beforeText:/^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,afterText:/^\s*\*\/$/,action:{indentAction:n.languages.IndentAction.IndentOutdent,appendText:" * "}},{beforeText:/^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,action:{indentAction:n.languages.IndentAction.None,appendText:" * "}},{beforeText:/^(\t|(\ \ ))*\ \*(\ ([^\*]|\*(?!\/))*)?$/,action:{indentAction:n.languages.IndentAction.None,appendText:"* "}},{beforeText:/^(\t|(\ \ ))*\ \*\/\s*$/,action:{indentAction:n.languages.IndentAction.None,removeText:1}}],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]},{open:"`",close:"`",notIn:["string","comment"]},{open:"/**",close:" */",notIn:["string"]}],folding:{markers:{start:new RegExp("^\\s*//\\s*#?region\\b"),end:new RegExp("^\\s*//\\s*#?endregion\\b")}}},t.language={defaultToken:"invalid",tokenPostfix:".ts",keywords:["abstract","any","as","asserts","bigint","boolean","break","case","catch","class","continue","const","constructor","debugger","declare","default","delete","do","else","enum","export","extends","false","finally","for","from","function","get","if","implements","import","in","infer","instanceof","interface","is","keyof","let","module","namespace","never","new","null","number","object","package","private","protected","public","readonly","require","global","return","set","static","string","super","switch","symbol","this","throw","true","try","type","typeof","undefined","unique","unknown","var","void","while","with","yield","async","await","of"],operators:["<=",">=","==","!=","===","!==","=>","+","-","**","*","/","%","++","--","<<",">",">>>","&","|","^","!","~","&&","||","??","?",":","=","+=","-=","*=","**=","/=","%=","<<=",">>=",">>>=","&=","|=","^=","@"],symbols:/[=>](?!@symbols)/,"@brackets"],[/!(?=([^=]|$))/,"delimiter"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/(@digits)[eE]([\-+]?(@digits))?/,"number.float"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?/,"number.float"],[/0[xX](@hexdigits)n?/,"number.hex"],[/0[oO]?(@octaldigits)n?/,"number.octal"],[/0[bB](@binarydigits)n?/,"number.binary"],[/(@digits)n?/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string_double"],[/'/,"string","@string_single"],[/`/,"string","@string_backtick"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@jsdoc"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],jsdoc:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],regexp:[[/(\{)(\d+(?:,\d*)?)(\})/,["regexp.escape.control","regexp.escape.control","regexp.escape.control"]],[/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/,["regexp.escape.control",{token:"regexp.escape.control",next:"@regexrange"}]],[/(\()(\?:|\?=|\?!)/,["regexp.escape.control","regexp.escape.control"]],[/[()]/,"regexp.escape.control"],[/@regexpctl/,"regexp.escape.control"],[/[^\\\/]/,"regexp"],[/@regexpesc/,"regexp.escape"],[/\\\./,"regexp.invalid"],[/(\/)([gimsuy]*)/,[{token:"regexp",bracket:"@close",next:"@pop"},"keyword.other"]]],regexrange:[[/-/,"regexp.escape.control"],[/\^/,"regexp.invalid"],[/@regexpesc/,"regexp.escape"],[/[^\]]/,"regexp"],[/\]/,{token:"regexp.escape.control",next:"@pop",bracket:"@close"}]],string_double:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],string_single:[[/[^\\']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/'/,"string","@pop"]],string_backtick:[[/\$\{/,{token:"delimiter.bracket",next:"@bracketCounting"}],[/[^\\`$]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/`/,"string","@pop"]],bracketCounting:[[/\{/,"delimiter.bracket","@bracketCounting"],[/\}/,"delimiter.bracket","@pop"],{include:"common"}]}}})); \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/vb/vb.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/vb/vb.js new file mode 100644 index 0000000..25363d6 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/basic-languages/vb/vb.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-languages version: 2.1.1(425b0e3c9ea2067410b8f90e0f30de383188c418) + * Released under the MIT license + * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/basic-languages/vb/vb",["require","exports"],(function(e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.language=n.conf=void 0,n.conf={comments:{lineComment:"'",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"],["<",">"],["addhandler","end addhandler"],["class","end class"],["enum","end enum"],["event","end event"],["function","end function"],["get","end get"],["if","end if"],["interface","end interface"],["module","end module"],["namespace","end namespace"],["operator","end operator"],["property","end property"],["raiseevent","end raiseevent"],["removehandler","end removehandler"],["select","end select"],["set","end set"],["structure","end structure"],["sub","end sub"],["synclock","end synclock"],["try","end try"],["while","end while"],["with","end with"],["using","end using"],["do","loop"],["for","next"]],autoClosingPairs:[{open:"{",close:"}",notIn:["string","comment"]},{open:"[",close:"]",notIn:["string","comment"]},{open:"(",close:")",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string","comment"]},{open:"<",close:">",notIn:["string","comment"]}],folding:{markers:{start:new RegExp("^\\s*#Region\\b"),end:new RegExp("^\\s*#End Region\\b")}}},n.language={defaultToken:"",tokenPostfix:".vb",ignoreCase:!0,brackets:[{token:"delimiter.bracket",open:"{",close:"}"},{token:"delimiter.array",open:"[",close:"]"},{token:"delimiter.parenthesis",open:"(",close:")"},{token:"delimiter.angle",open:"<",close:">"},{token:"keyword.tag-addhandler",open:"addhandler",close:"end addhandler"},{token:"keyword.tag-class",open:"class",close:"end class"},{token:"keyword.tag-enum",open:"enum",close:"end enum"},{token:"keyword.tag-event",open:"event",close:"end event"},{token:"keyword.tag-function",open:"function",close:"end function"},{token:"keyword.tag-get",open:"get",close:"end get"},{token:"keyword.tag-if",open:"if",close:"end if"},{token:"keyword.tag-interface",open:"interface",close:"end interface"},{token:"keyword.tag-module",open:"module",close:"end module"},{token:"keyword.tag-namespace",open:"namespace",close:"end namespace"},{token:"keyword.tag-operator",open:"operator",close:"end operator"},{token:"keyword.tag-property",open:"property",close:"end property"},{token:"keyword.tag-raiseevent",open:"raiseevent",close:"end raiseevent"},{token:"keyword.tag-removehandler",open:"removehandler",close:"end removehandler"},{token:"keyword.tag-select",open:"select",close:"end select"},{token:"keyword.tag-set",open:"set",close:"end set"},{token:"keyword.tag-structure",open:"structure",close:"end structure"},{token:"keyword.tag-sub",open:"sub",close:"end sub"},{token:"keyword.tag-synclock",open:"synclock",close:"end synclock"},{token:"keyword.tag-try",open:"try",close:"end try"},{token:"keyword.tag-while",open:"while",close:"end while"},{token:"keyword.tag-with",open:"with",close:"end with"},{token:"keyword.tag-using",open:"using",close:"end using"},{token:"keyword.tag-do",open:"do",close:"loop"},{token:"keyword.tag-for",open:"for",close:"next"}],keywords:["AddHandler","AddressOf","Alias","And","AndAlso","As","Async","Boolean","ByRef","Byte","ByVal","Call","Case","Catch","CBool","CByte","CChar","CDate","CDbl","CDec","Char","CInt","Class","CLng","CObj","Const","Continue","CSByte","CShort","CSng","CStr","CType","CUInt","CULng","CUShort","Date","Decimal","Declare","Default","Delegate","Dim","DirectCast","Do","Double","Each","Else","ElseIf","End","EndIf","Enum","Erase","Error","Event","Exit","False","Finally","For","Friend","Function","Get","GetType","GetXMLNamespace","Global","GoSub","GoTo","Handles","If","Implements","Imports","In","Inherits","Integer","Interface","Is","IsNot","Let","Lib","Like","Long","Loop","Me","Mod","Module","MustInherit","MustOverride","MyBase","MyClass","NameOf","Namespace","Narrowing","New","Next","Not","Nothing","NotInheritable","NotOverridable","Object","Of","On","Operator","Option","Optional","Or","OrElse","Out","Overloads","Overridable","Overrides","ParamArray","Partial","Private","Property","Protected","Public","RaiseEvent","ReadOnly","ReDim","RemoveHandler","Resume","Return","SByte","Select","Set","Shadows","Shared","Short","Single","Static","Step","Stop","String","Structure","Sub","SyncLock","Then","Throw","To","True","Try","TryCast","TypeOf","UInteger","ULong","UShort","Using","Variant","Wend","When","While","Widening","With","WithEvents","WriteOnly","Xor"],tagwords:["If","Sub","Select","Try","Class","Enum","Function","Get","Interface","Module","Namespace","Operator","Set","Structure","Using","While","With","Do","Loop","For","Next","Property","Continue","AddHandler","RemoveHandler","Event","RaiseEvent","SyncLock"],symbols:/[=>"]],autoClosingPairs:[{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'}],surroundingPairs:[{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'}]},t.language={defaultToken:"",tokenPostfix:".xml",ignoreCase:!0,qualifiedName:/(?:[\w\.\-]+:)?[\w\.\-]+/,tokenizer:{root:[[/[^<&]+/,""],{include:"@whitespace"},[/(<)(@qualifiedName)/,[{token:"delimiter"},{token:"tag",next:"@tag"}]],[/(<\/)(@qualifiedName)(\s*)(>)/,[{token:"delimiter"},{token:"tag"},"",{token:"delimiter"}]],[/(<\?)(@qualifiedName)/,[{token:"delimiter"},{token:"metatag",next:"@tag"}]],[/(<\!)(@qualifiedName)/,[{token:"delimiter"},{token:"metatag",next:"@tag"}]],[/<\!\[CDATA\[/,{token:"delimiter.cdata",next:"@cdata"}],[/&\w+;/,"string.escape"]],cdata:[[/[^\]]+/,""],[/\]\]>/,{token:"delimiter.cdata",next:"@pop"}],[/\]/,""]],tag:[[/[ \t\r\n]+/,""],[/(@qualifiedName)(\s*=\s*)("[^"]*"|'[^']*')/,["attribute.name","","attribute.value"]],[/(@qualifiedName)(\s*=\s*)("[^">?\/]*|'[^'>?\/]*)(?=[\?\/]\>)/,["attribute.name","","attribute.value"]],[/(@qualifiedName)(\s*=\s*)("[^">]*|'[^'>]*)/,["attribute.name","","attribute.value"]],[/@qualifiedName/,"attribute.name"],[/\?>/,{token:"delimiter",next:"@pop"}],[/(\/)(>)/,[{token:"tag"},{token:"delimiter",next:"@pop"}]],[/>/,{token:"delimiter",next:"@pop"}]],whitespace:[[/[ \t\r\n]+/,""],[//,{token:"comment",next:"@pop"}],[/|$)/, +z.html=B(z.html,"i").replace("comment",z._comment).replace("tag",z._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),z.paragraph=B(z._paragraph).replace("hr",z.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",z._tag).getRegex(),z.blockquote=B(z.blockquote).replace("paragraph",z.paragraph).getRegex(),z.normal=V({},z),z.gfm=V({},z.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}), +z.gfm.nptable=B(z.gfm.nptable).replace("hr",z.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",z._tag).getRegex(),z.gfm.table=B(z.gfm.table).replace("hr",z.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",z._tag).getRegex(),z.pedantic=V({},z.normal,{ +html:B("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",z._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:W,paragraph:B(z.normal._paragraph).replace("hr",z.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",z.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var H={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:W,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^", +link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/, +endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:W,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};H.punctuation=B(H.punctuation).replace(/punctuation/g,H._punctuation).getRegex(),H._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",H._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",H._comment=B(z._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),H.em.start=B(H.em.start).replace(/punctuation/g,H._punctuation).getRegex(),H.em.middle=B(H.em.middle).replace(/punctuation/g,H._punctuation).replace(/overlapSkip/g,H._overlapSkip).getRegex(),H.em.endAst=B(H.em.endAst,"g").replace(/punctuation/g,H._punctuation).getRegex(),H.em.endUnd=B(H.em.endUnd,"g").replace(/punctuation/g,H._punctuation).getRegex(),H.strong.start=B(H.strong.start).replace(/punctuation/g,H._punctuation).getRegex(), +H.strong.middle=B(H.strong.middle).replace(/punctuation/g,H._punctuation).replace(/blockSkip/g,H._blockSkip).getRegex(),H.strong.endAst=B(H.strong.endAst,"g").replace(/punctuation/g,H._punctuation).getRegex(),H.strong.endUnd=B(H.strong.endUnd,"g").replace(/punctuation/g,H._punctuation).getRegex(),H.blockSkip=B(H._blockSkip,"g").getRegex(),H.overlapSkip=B(H._overlapSkip,"g").getRegex(),H._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,H._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,H._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,H.autolink=B(H.autolink).replace("scheme",H._scheme).replace("email",H._email).getRegex(),H._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,H.tag=B(H.tag).replace("comment",H._comment).replace("attribute",H._attribute).getRegex(),H._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,H._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/, +H._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,H.link=B(H.link).replace("label",H._label).replace("href",H._href).replace("title",H._title).getRegex(),H.reflink=B(H.reflink).replace("label",H._label).getRegex(),H.reflinkSearch=B(H.reflinkSearch,"g").replace("reflink",H.reflink).replace("nolink",H.nolink).getRegex(),H.normal=V({},H),H.pedantic=V({},H.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:B(/^!?\[(label)\]\((.*?)\)/).replace("label",H._label).getRegex(),reflink:B(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",H._label).getRegex()}),H.gfm=V({},H.normal,{escape:B(H.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/, +url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\.5&&(i="x"+i.toString(16)),n+="&#"+i+";" +;return n}var Y=function(){function t(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||U,this.options.tokenizer=this.options.tokenizer||new F,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var t={block:$.normal,inline:j.normal};this.options.pedantic?(t.block=$.pedantic,t.inline=j.pedantic):this.options.gfm&&(t.block=$.gfm,this.options.breaks?t.inline=j.breaks:t.inline=j.gfm),this.tokenizer.rules=t}t.lex=function(e,i){return new t(i).lex(e)};var i,n,o,s=t.prototype;return s.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(e,this.tokens,!0),this.inline(this.tokens),this.tokens},s.blockTokens=function(e,t,i){var n,o,s,r;for(void 0===t&&(t=[]),void 0===i&&(i=!0),e=e.replace(/^ +$/gm,"");e;)if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),n.type&&t.push(n);else if(n=this.tokenizer.code(e,t))e=e.substring(n.raw.length),n.type?t.push(n):((r=t[t.length-1]).raw+="\n"+n.raw, +r.text+="\n"+n.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.nptable(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),n.tokens=this.blockTokens(n.text,[],i),t.push(n);else if(n=this.tokenizer.list(e)){for(e=e.substring(n.raw.length),s=n.items.length,o=0;o0)for(;null!=(r=this.tokenizer.rules.inline.reflinkSearch.exec(a));)l.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(r=this.tokenizer.rules.inline.blockSkip.exec(a));)a=a.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;e;)if(s=this.tokenizer.escape(e))e=e.substring(s.raw.length),t.push(s);else if(s=this.tokenizer.tag(e,i,n))e=e.substring(s.raw.length),i=s.inLink,n=s.inRawBlock,t.push(s);else if(s=this.tokenizer.link(e))e=e.substring(s.raw.length),"link"===s.type&&(s.tokens=this.inlineTokens(s.text,[],!0,n)),t.push(s);else if(s=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(s.raw.length), +"link"===s.type&&(s.tokens=this.inlineTokens(s.text,[],!0,n)),t.push(s);else if(s=this.tokenizer.strong(e,a,o))e=e.substring(s.raw.length),s.tokens=this.inlineTokens(s.text,[],i,n),t.push(s);else if(s=this.tokenizer.em(e,a,o))e=e.substring(s.raw.length),s.tokens=this.inlineTokens(s.text,[],i,n),t.push(s);else if(s=this.tokenizer.codespan(e))e=e.substring(s.raw.length),t.push(s);else if(s=this.tokenizer.br(e))e=e.substring(s.raw.length),t.push(s);else if(s=this.tokenizer.del(e))e=e.substring(s.raw.length),s.tokens=this.inlineTokens(s.text,[],i,n),t.push(s);else if(s=this.tokenizer.autolink(e,G))e=e.substring(s.raw.length),t.push(s);else if(i||!(s=this.tokenizer.url(e,G))){if(s=this.tokenizer.inlineText(e,n,q))e=e.substring(s.raw.length),o=s.raw.slice(-1),t.push(s);else if(e){var d="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(d);break}throw new Error(d)}}else e=e.substring(s.raw.length),t.push(s);return t},i=t,o=[{key:"rules",get:function(){return{block:$,inline:j}}}], +(n=null)&&e(i.prototype,n),o&&e(i,o),t}(),Z=n.defaults,X=E,Q=S,J=function(){function e(e){this.options=e||Z}var t=e.prototype;return t.code=function(e,t,i){var n=(t||"").match(/\S*/)[0];if(this.options.highlight){var o=this.options.highlight(e,n);null!=o&&o!==e&&(i=!0,e=o)}return n?'
'+(i?e:Q(e,!0))+"
\n":"
"+(i?e:Q(e,!0))+"
\n"},t.blockquote=function(e){return"
\n"+e+"
\n"},t.html=function(e){return e},t.heading=function(e,t,i,n){return this.options.headerIds?"'+e+"\n":""+e+"\n"},t.hr=function(){return this.options.xhtml?"
\n":"
\n"},t.list=function(e,t,i){var n=t?"ol":"ul";return"<"+n+(t&&1!==i?' start="'+i+'"':"")+">\n"+e+"\n"},t.listitem=function(e){return"
  • "+e+"
  • \n"},t.checkbox=function(e){return" "}, +t.paragraph=function(e){return"

    "+e+"

    \n"},t.table=function(e,t){return t&&(t=""+t+""),"\n\n"+e+"\n"+t+"
    \n"},t.tablerow=function(e){return"\n"+e+"\n"},t.tablecell=function(e,t){var i=t.header?"th":"td";return(t.align?"<"+i+' align="'+t.align+'">':"<"+i+">")+e+"\n"},t.strong=function(e){return""+e+""},t.em=function(e){return""+e+""},t.codespan=function(e){return""+e+""},t.br=function(){return this.options.xhtml?"
    ":"
    "},t.del=function(e){return""+e+""},t.link=function(e,t,i){if(null===(e=X(this.options.sanitize,this.options.baseUrl,e)))return i;var n='"},t.image=function(e,t,i){if(null===(e=X(this.options.sanitize,this.options.baseUrl,e)))return i;var n=''+i+'":">"},t.text=function(e){return e},e}(),ee=function(){function e(){} +var t=e.prototype;return t.strong=function(e){return e},t.em=function(e){return e},t.codespan=function(e){return e},t.del=function(e){return e},t.html=function(e){return e},t.text=function(e){return e},t.link=function(e,t,i){return""+i},t.image=function(e,t,i){return""+i},t.br=function(){return""},e}(),te=function(){function e(){this.seen={}}var t=e.prototype;return t.serialize=function(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},t.getNextSafeSlug=function(e,t){var i=e,n=0;if(this.seen.hasOwnProperty(i)){n=this.seen[e];do{i=e+"-"+ ++n}while(this.seen.hasOwnProperty(i))}return t||(this.seen[e]=n,this.seen[i]=0),i},t.slug=function(e,t){void 0===t&&(t={});var i=this.serialize(e);return this.getNextSafeSlug(i,t.dryrun)},e}(),ie=n.defaults,ne=w,oe=function(){function e(e){this.options=e||ie,this.options.renderer=this.options.renderer||new J,this.renderer=this.options.renderer, +this.renderer.options=this.options,this.textRenderer=new ee,this.slugger=new te}e.parse=function(t,i){return new e(i).parse(t)};var t=e.prototype;return t.parse=function(e,t){void 0===t&&(t=!0);var i,n,o,s,r,a,l,d,c,h,u,g,p,m,f,_,v,C,b="",S=e.length;for(i=0;i0&&"text"===f.tokens[0].type?(f.tokens[0].text=C+" "+f.tokens[0].text,f.tokens[0].tokens&&f.tokens[0].tokens.length>0&&"text"===f.tokens[0].tokens[0].type&&(f.tokens[0].tokens[0].text=C+" "+f.tokens[0].tokens[0].text)):f.tokens.unshift({type:"text",text:C}):m+=C),m+=this.parse(f.tokens,p),c+=this.renderer.listitem(m,v,_);b+=this.renderer.list(c,u,g);continue;case"html":b+=this.renderer.html(h.text);continue;case"paragraph":b+=this.renderer.paragraph(this.parseInline(h.tokens));continue;case"text":for(c=h.tokens?this.parseInline(h.tokens):h.text;i+1An error occurred:

    "+ae(e.message+"",!0)+"
    ";throw e}}return he.options=he.setOptions=function(e){return se(he.defaults,e),de(he.defaults),he}, +he.getDefaults=le,he.defaults=ce,he.use=function(e){var t=se({},e);if(e.renderer&&function(){var i=he.defaults.renderer||new J,n=function(t){var n=i[t];i[t]=function(){for(var o=arguments.length,s=new Array(o),r=0;rthis._limit&&this._initialize(e.slice(e.length-this._limit))}_currentPosition(){const e=this._navigator.current();return e?this._elements.indexOf(e):-1}_initialize(e){this._history=new Set;for(const t of e)this._history.add(t)}get _elements(){const e=[];return this._history.forEach(t=>e.push(t)),e}}})),define(t[109],i([0,1]),(function(e,t){"use strict" +;Object.defineProperty(t,"__esModule",{value:!0}),t.MovingAverage=t.clamp=void 0,t.clamp=function(e,t,i){return Math.min(Math.max(e,t),i)};t.MovingAverage=class{constructor(){this._n=1,this._val=0}update(e){return this._val=this._val+(e-this._val)/this._n,this._n+=1,this}}})),define(t[16],i([0,1]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isLittleEndian=t.OS=t.setImmediate=t.globals=t.isIOS=t.isWeb=t.isNative=t.isLinux=t.isMacintosh=t.isWindows=void 0;let i=!1,n=!1,o=!1,s=!1,r=!1,a=!1,l=void 0,d="en",c=void 0,h=void 0;const u="undefined"!=typeof process&&void 0!==process.versions&&void 0!==process.versions.electron&&"renderer"===process.type;if("object"!=typeof navigator||u){if("object"==typeof process){i="win32"===process.platform,n="darwin"===process.platform,o="linux"===process.platform,l="en",d="en";const e=process.env.VSCODE_NLS_CONFIG;if(e)try{const t=JSON.parse(e),i=t.availableLanguages["*"];l=t.locale,d=i||"en",c=t._translationsConfigFile}catch(e){}s=!0} +}else i=(h=navigator.userAgent).indexOf("Windows")>=0,n=h.indexOf("Macintosh")>=0,a=(h.indexOf("Macintosh")>=0||h.indexOf("iPad")>=0||h.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,o=h.indexOf("Linux")>=0,r=!0,d=l=navigator.language;let g=0;n?g=1:i?g=3:o&&(g=2),t.isWindows=i,t.isMacintosh=n,t.isLinux=o,t.isNative=s,t.isWeb=r,t.isIOS=a;const p="object"==typeof self?self:"object"==typeof global?global:{};t.globals=p,t.setImmediate=function(){if(t.globals.setImmediate)return t.globals.setImmediate.bind(t.globals);if("function"==typeof t.globals.postMessage&&!t.globals.importScripts){let e=[];t.globals.addEventListener("message",t=>{if(t.data&&t.data.vscodeSetImmediateId)for(let i=0,n=e.length;i{const o=++i;e.push({id:o,callback:n}),t.globals.postMessage({vscodeSetImmediateId:o},"*")}} +if("undefined"!=typeof process&&"function"==typeof process.nextTick)return process.nextTick.bind(process);const e=Promise.resolve();return t=>e.then(t)}(),t.OS=n||a?2:i?1:3;let m=!0,f=!1;t.isLittleEndian=function(){if(!f){f=!0;const e=new Uint8Array(2);e[0]=1,e[1]=2;const t=new Uint16Array(e.buffer);m=513===t[0]}return m}})),define(t[98],i([0,1,36,16]),(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserFeatures=void 0,t.BrowserFeatures={clipboard:{writeText:n.isNative||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(navigator&&navigator.clipboard&&navigator.clipboard.writeText),readText:n.isNative||!!(navigator&&navigator.clipboard&&navigator.clipboard.readText),richText:(()=>{if(i.isEdge){let e=navigator.userAgent.indexOf("Edge/"),t=parseInt(navigator.userAgent.substring(e+5,navigator.userAgent.indexOf(".",e)),10);if(!t||t>=12&&t<=16)return!1}return!0})()},keyboard:(()=>n.isNative||i.isStandalone?0:navigator.keyboard||i.isSafari?1:2)(), +touch:"ontouchstart"in window||navigator.maxTouchPoints>0||window.navigator.msMaxTouchPoints>0,pointerEvents:window.PointerEvent&&("ontouchstart"in window||window.navigator.maxTouchPoints>0||navigator.maxTouchPoints>0||window.navigator.msMaxTouchPoints>0)}})),define(t[53],i([0,1,36,39,16]),(function(e,t,i,n,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StandardKeyboardEvent=void 0;let s=new Array(230),r=new Array(112);!function(){for(let e=0;e"/",env:Object.create(null),get platform(){return i.isWindows?"win32":i.isMacintosh?"darwin":"linux"},nextTick:e=>i.setImmediate(e)}:process;t.cwd=n.cwd,t.env=n.env,t.platform=n.platform})),define(t[63],i([0,1,271]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sep=t.extname=t.basename=t.dirname=t.relative=t.resolve=t.normalize=t.posix=t.win32=void 0;const n=65,o=97,s=90,r=122,a=46,l=47,d=92;class c extends Error{constructor(e,t,i){let n +;"string"==typeof t&&0===t.indexOf("not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";const o=-1!==e.indexOf(".")?"property":"argument";let s=`The "${e}" ${o} ${n} of type ${t}`;super(s+=`. Received type ${typeof i}`),this.code="ERR_INVALID_ARG_TYPE"}}function h(e,t){if("string"!=typeof e)throw new c(t,"string",e)}function u(e){return e===l||e===d}function g(e){return e===l}function p(e){return e>=n&&e<=s||e>=o&&e<=r}function m(e,t,i,n){let o="",s=0,r=-1,d=0,c=0;for(let h=0;h<=e.length;++h){if(h2){const e=o.lastIndexOf(i);-1===e?(o="",s=0):s=(o=o.slice(0,e)).length-1-o.lastIndexOf(i),r=h,d=0;continue}if(0!==o.length){o="",s=0,r=h,d=0;continue}}t&&(o+=o.length>0?`${i}..`:"..",s=2)}else o.length>0?o+=`${i}${e.slice(r+1,h)}`:o=e.slice(r+1,h),s=h-r-1;r=h,d=0}else c===a&&-1!==d?++d:d=-1}return o}function f(e,t){ +if(null===t||"object"!=typeof t)throw new c("pathObject","Object",t);const i=t.dir||t.root,n=t.base||`${t.name||""}${t.ext||""}`;return i?i===t.root?`${i}${n}`:`${i}${e}${n}`:n}t.win32={resolve(...e){let t="",n="",o=!1;for(let s=e.length-1;s>=-1;s--){let r;if(s>=0){if(h(r=e[s],"path"),0===r.length)continue}else 0===t.length?r=i.cwd():(void 0===(r=i.env[`=${t}`]||i.cwd())||r.slice(0,2).toLowerCase()!==t.toLowerCase()&&r.charCodeAt(2)===d)&&(r=`${t}\\`);const a=r.length;let l=0,c="",g=!1;const m=r.charCodeAt(0);if(1===a)u(m)&&(l=1,g=!0);else if(u(m))if(g=!0,u(r.charCodeAt(1))){let e=2,t=e;for(;e2&&u(r.charCodeAt(2))&&(g=!0,l=3));if(c.length>0)if(t.length>0){if(c.toLowerCase()!==t.toLowerCase())continue}else t=c;if(o){if(t.length>0)break +}else if(n=`${r.slice(l)}\\${n}`,o=g,g&&t.length>0)break}return n=m(n,!o,"\\",u),o?`${t}\\${n}`:`${t}${n}`||"."},normalize(e){h(e,"path");const t=e.length;if(0===t)return".";let i,n=0,o=!1;const s=e.charCodeAt(0);if(1===t)return g(s)?"\\":e;if(u(s))if(o=!0,u(e.charCodeAt(1))){let o=2,s=o;for(;o2&&u(e.charCodeAt(2))&&(o=!0,n=3));let r=n0&&u(e.charCodeAt(t-1))&&(r+="\\"),void 0===i?o?`\\${r}`:r:o?`${i}\\${r}`:`${i}${r}`},isAbsolute(e){h(e,"path");const t=e.length;if(0===t)return!1;const i=e.charCodeAt(0);return u(i)||t>2&&p(i)&&58===e.charCodeAt(1)&&u(e.charCodeAt(2))},join(...e){if(0===e.length)return".";let i,n +;for(let t=0;t0&&(void 0===i?i=n=o:i+=`\\${o}`)}if(void 0===i)return".";let o=!0,s=0;if("string"==typeof n&&u(n.charCodeAt(0))){++s;const e=n.length;e>1&&u(n.charCodeAt(1))&&(++s,e>2&&(u(n.charCodeAt(2))?++s:o=!1))}if(o){for(;s=2&&(i=`\\${i.slice(s)}`)}return t.win32.normalize(i)},relative(e,i){if(h(e,"from"),h(i,"to"),e===i)return"";const n=t.win32.resolve(e),o=t.win32.resolve(i);if(n===o)return"";if((e=n.toLowerCase())===(i=o.toLowerCase()))return"";let s=0;for(;ss&&e.charCodeAt(r-1)===d;)r--;const a=r-s;let l=0;for(;ll&&i.charCodeAt(c-1)===d;)c--;const u=c-l,g=ag){if(i.charCodeAt(l+m)===d)return o.slice(l+m+1);if(2===m)return o.slice(l+m)} +a>g&&(e.charCodeAt(s+m)===d?p=m:2===m&&(p=3)),-1===p&&(p=0)}let f="";for(m=s+p+1;m<=r;++m)m!==r&&e.charCodeAt(m)!==d||(f+=0===f.length?"..":"\\..");return l+=p,f.length>0?`${f}${o.slice(l,c)}`:(o.charCodeAt(l)===d&&++l,o.slice(l,c))},toNamespacedPath(e){if("string"!=typeof e)return e;if(0===e.length)return"";const i=t.win32.resolve(e);if(i.length<=2)return e;if(i.charCodeAt(0)===d){if(i.charCodeAt(1)===d){const e=i.charCodeAt(2);if(63!==e&&e!==a)return`\\\\?\\UNC\\${i.slice(2)}`}}else if(p(i.charCodeAt(0))&&58===i.charCodeAt(1)&&i.charCodeAt(2)===d)return`\\\\?\\${i}`;return e},dirname(e){h(e,"path");const t=e.length;if(0===t)return".";let i=-1,n=0;const o=e.charCodeAt(0);if(1===t)return u(o)?e:".";if(u(o)){if(i=n=1,u(e.charCodeAt(1))){let o=2,s=o;for(;o2&&u(e.charCodeAt(2))?3:2);let s=-1,r=!0 +;for(let i=t-1;i>=n;--i)if(u(e.charCodeAt(i))){if(!r){s=i;break}}else r=!1;if(-1===s){if(-1===i)return".";s=i}return e.slice(0,s)},basename(e,t){void 0!==t&&h(t,"ext"),h(e,"path");let i,n=0,o=-1,s=!0;if(e.length>=2&&p(e.charCodeAt(0))&&58===e.charCodeAt(1)&&(n=2),void 0!==t&&t.length>0&&t.length<=e.length){if(t===e)return"";let r=t.length-1,a=-1;for(i=e.length-1;i>=n;--i){const l=e.charCodeAt(i);if(u(l)){if(!s){n=i+1;break}}else-1===a&&(s=!1,a=i+1),r>=0&&(l===t.charCodeAt(r)?-1==--r&&(o=i):(r=-1,o=a))}return n===o?o=a:-1===o&&(o=e.length),e.slice(n,o)}for(i=e.length-1;i>=n;--i)if(u(e.charCodeAt(i))){if(!s){n=i+1;break}}else-1===o&&(s=!1,o=i+1);return-1===o?"":e.slice(n,o)},extname(e){h(e,"path");let t=0,i=-1,n=0,o=-1,s=!0,r=0;e.length>=2&&58===e.charCodeAt(1)&&p(e.charCodeAt(0))&&(t=n=2);for(let l=e.length-1;l>=t;--l){const t=e.charCodeAt(l);if(u(t)){if(!s){n=l+1;break}}else-1===o&&(s=!1,o=l+1),t===a?-1===i?i=l:1!==r&&(r=1):-1!==i&&(r=-1)}return-1===i||-1===o||0===r||1===r&&i===o-1&&i===n+1?"":e.slice(i,o)}, +format:f.bind(null,"\\"),parse(e){h(e,"path");const t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;const i=e.length;let n=0,o=e.charCodeAt(0);if(1===i)return u(o)?(t.root=t.dir=e,t):(t.base=t.name=e,t);if(u(o)){if(n=1,u(e.charCodeAt(1))){let t=2,o=t;for(;t0&&(t.root=e.slice(0,n));let s=-1,r=n,l=-1,d=!0,c=e.length-1,g=0;for(;c>=n;--c)if(u(o=e.charCodeAt(c))){if(!d){r=c+1;break}}else-1===l&&(d=!1,l=c+1),o===a?-1===s?s=c:1!==g&&(g=1):-1!==s&&(g=-1);return-1!==l&&(-1===s||0===g||1===g&&s===l-1&&s===r+1?t.base=t.name=e.slice(r,l):(t.name=e.slice(r,s),t.base=e.slice(r,l),t.ext=e.slice(s,l))),t.dir=r>0&&r!==n?e.slice(0,r-1):t.root,t},sep:"\\",delimiter:";",win32:null,posix:null},t.posix={resolve(...e){ +let t="",n=!1;for(let o=e.length-1;o>=-1&&!n;o--){const s=o>=0?e[o]:i.cwd();h(s,"path"),0!==s.length&&(t=`${s}/${t}`,n=s.charCodeAt(0)===l)}return t=m(t,!n,"/",g),n?`/${t}`:t.length>0?t:"."},normalize(e){if(h(e,"path"),0===e.length)return".";const t=e.charCodeAt(0)===l,i=e.charCodeAt(e.length-1)===l;return 0===(e=m(e,!t,"/",g)).length?t?"/":i?"./":".":(i&&(e+="/"),t?`/${e}`:e)},isAbsolute:e=>(h(e,"path"),e.length>0&&e.charCodeAt(0)===l),join(...e){if(0===e.length)return".";let i;for(let t=0;t0&&(void 0===i?i=n:i+=`/${n}`)}return void 0===i?".":t.posix.normalize(i)},relative(e,i){if(h(e,"from"),h(i,"to"),e===i)return"";if((e=t.posix.resolve(e))===(i=t.posix.resolve(i)))return"";const n=e.length,o=n-1,s=i.length-1,r=or){if(i.charCodeAt(1+d)===l)return i.slice(1+d+1);if(0===d)return i.slice(1+d)}else o>r&&(e.charCodeAt(1+d)===l?a=d:0===d&&(a=0)) +;let c="";for(d=1+a+1;d<=n;++d)d!==n&&e.charCodeAt(d)!==l||(c+=0===c.length?"..":"/..");return`${c}${i.slice(1+a)}`},toNamespacedPath:e=>e,dirname(e){if(h(e,"path"),0===e.length)return".";const t=e.charCodeAt(0)===l;let i=-1,n=!0;for(let t=e.length-1;t>=1;--t)if(e.charCodeAt(t)===l){if(!n){i=t;break}}else n=!1;return-1===i?t?"/":".":t&&1===i?"//":e.slice(0,i)},basename(e,t){void 0!==t&&h(t,"ext"),h(e,"path");let i,n=0,o=-1,s=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t===e)return"";let r=t.length-1,a=-1;for(i=e.length-1;i>=0;--i){const d=e.charCodeAt(i);if(d===l){if(!s){n=i+1;break}}else-1===a&&(s=!1,a=i+1),r>=0&&(d===t.charCodeAt(r)?-1==--r&&(o=i):(r=-1,o=a))}return n===o?o=a:-1===o&&(o=e.length),e.slice(n,o)}for(i=e.length-1;i>=0;--i)if(e.charCodeAt(i)===l){if(!s){n=i+1;break}}else-1===o&&(s=!1,o=i+1);return-1===o?"":e.slice(n,o)},extname(e){h(e,"path");let t=-1,i=0,n=-1,o=!0,s=0;for(let r=e.length-1;r>=0;--r){const d=e.charCodeAt(r);if(d!==l)-1===n&&(o=!1,n=r+1), +d===a?-1===t?t=r:1!==s&&(s=1):-1!==t&&(s=-1);else if(!o){i=r+1;break}}return-1===t||-1===n||0===s||1===s&&t===n-1&&t===i+1?"":e.slice(t,n)},format:f.bind(null,"/"),parse(e){h(e,"path");const t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;const i=e.charCodeAt(0)===l;let n;i?(t.root="/",n=1):n=0;let o=-1,s=0,r=-1,d=!0,c=e.length-1,u=0;for(;c>=n;--c){const t=e.charCodeAt(c);if(t!==l)-1===r&&(d=!1,r=c+1),t===a?-1===o?o=c:1!==u&&(u=1):-1!==o&&(u=-1);else if(!d){s=c+1;break}}if(-1!==r){const n=0===s&&i?1:s;-1===o||0===u||1===u&&o===r-1&&o===s+1?t.base=t.name=e.slice(n,r):(t.name=e.slice(n,o),t.base=e.slice(n,r),t.ext=e.slice(o,r))}return s>0?t.dir=e.slice(0,s-1):i&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null},t.posix.win32=t.win32.win32=t.win32,t.posix.posix=t.win32.posix=t.posix,t.normalize="win32"===i.platform?t.win32.normalize:t.posix.normalize,t.resolve="win32"===i.platform?t.win32.resolve:t.posix.resolve,t.relative="win32"===i.platform?t.win32.relative:t.posix.relative, +t.dirname="win32"===i.platform?t.win32.dirname:t.posix.dirname,t.basename="win32"===i.platform?t.win32.basename:t.posix.basename,t.extname="win32"===i.platform?t.win32.extname:t.posix.extname,t.sep="win32"===i.platform?t.win32.sep:t.posix.sep})),define(t[110],i([0,1]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Range=void 0,function(e){function t(e,t){if(e.start>=t.end||t.start>=e.end)return{start:0,end:0};const i=Math.max(e.start,t.start),n=Math.min(e.end,t.end);return n-i<=0?{start:0,end:0}:{start:i,end:n}}function i(e){return e.end-e.start<=0}e.intersect=t,e.isEmpty=i,e.intersects=function(e,n){return!i(t(e,n))},e.relativeComplement=function(e,t){const n=[],o={start:e.start,end:Math.min(t.start,e.end)},s={start:Math.max(t.end,e.start),end:e.end};return i(o)||n.push(o),i(s)||n.push(s),n}}(t.Range||(t.Range={}))})),define(t[272],i([0,1,110]),(function(e,t,i){"use strict";function n(e,t){const n=[];for(let o of t){if(e.start>=o.range.end)continue;if(e.end({range:o(e.range,r),size:e.size})),d=i.map((t,i)=>({range:{start:e+i,end:e+i+1},size:t.size}));this.groups=function(...e){return s(e.reduce((e,t)=>e.concat(t),[]))}(a,d,l),this._size=this.groups.reduce((e,t)=>e+t.size*(t.range.end-t.range.start),0)}get count(){const e=this.groups.length;return e?this.groups[e-1].range.end:0}get size(){ +return this._size}indexAt(e){if(e<0)return-1;let t=0,i=0;for(let n of this.groups){const o=n.range.end-n.range.start,s=i+o*n.size;if(et&&(i=t-e),i<0&&(i=0),n<0&&(n=0),s+n>o&&(s=o-n),s<0&&(s=0),this.width=e,this.scrollWidth=t,this.scrollLeft=i,this.height=n,this.scrollHeight=o,this.scrollTop=s}equals(e){ +return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(e,t){return new o(void 0!==e.width?e.width:this.width,void 0!==e.scrollWidth?e.scrollWidth:this.scrollWidth,t?this.rawScrollLeft:this.scrollLeft,void 0!==e.height?e.height:this.height,void 0!==e.scrollHeight?e.scrollHeight:this.scrollHeight,t?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new o(this.width,this.scrollWidth,void 0!==e.scrollLeft?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,void 0!==e.scrollTop?e.scrollTop:this.rawScrollTop)}createScrollEvent(e){const t=this.width!==e.width,i=this.scrollWidth!==e.scrollWidth,n=this.scrollLeft!==e.scrollLeft,o=this.height!==e.height,s=this.scrollHeight!==e.scrollHeight,r=this.scrollTop!==e.scrollTop;return{oldWidth:e.width,oldScrollWidth:e.scrollWidth, +oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:t,scrollWidthChanged:i,scrollLeftChanged:n,heightChanged:o,scrollHeightChanged:s,scrollTopChanged:r}}}t.ScrollState=o;class s extends n.Disposable{constructor(e,t){super(),this._onScroll=this._register(new i.Emitter),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e,this._scheduleAtNextAnimationFrame=t,this._state=new o(0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){const i=this._state.withScrollDimensions(e,t);this._setState(i), +this._smoothScrolling&&this._smoothScrolling.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){const t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t)}setScrollPositionSmooth(e){if(0===this._smoothScrollDuration)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:void 0===e.scrollLeft?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:void 0===e.scrollTop?this._smoothScrolling.to.scrollTop:e.scrollTop};const t=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===t.scrollLeft&&this._smoothScrolling.to.scrollTop===t.scrollTop)return;const i=this._smoothScrolling.combine(this._state,t,this._smoothScrollDuration);this._smoothScrolling.dispose(),this._smoothScrolling=i}else{const t=this._state.withScrollPosition(e) +;this._smoothScrolling=l.start(this._state,t,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}_performSmoothScrolling(){if(!this._smoothScrolling)return;const e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);return this._setState(t),this._smoothScrolling?e.isDone?(this._smoothScrolling.dispose(),void(this._smoothScrolling=null)):void(this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})):void 0}_setState(e){const t=this._state;t.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(t)))}}t.Scrollable=s;class r{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}}function a(e,t){const i=t-e;return function(t){return e+i*(1-function(e){ +return Math.pow(e,3)}(1-t))}}t.SmoothScrollingUpdate=r;class l{constructor(e,t,i,n){this.from=e,this.to=t,this.duration=n,this._startTime=i,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(e,t,i){if(Math.abs(e-t)>2.5*i){let r,l;return es)return 1}const r=n-i,a=s-o;return ra?1:0}function a(e,t,i=0,n=e.length,o=0,s=t.length){for(;ic?1:0}function l(e){return e>=97&&e<=122}function d(e){return e>=65&&e<=90}function c(e){return l(e)||d(e)}function h(e,t,i=e.length){for(let n=0;n1){const n=e.charCodeAt(t-2);if(u(n))return p(n,i)}return i}t.format=function(e,...t){return 0===t.length?e:e.replace(i,(function(e,i){const n=parseInt(i,10);return isNaN(n)||n<0||n>=t.length?e:t[n]}))},t.escape=function(e){return e.replace(/[<>&]/g,(function(e){switch(e){case"<":return"<";case">":return">" +;case"&":return"&";default:return e}}))},t.escapeRegExpCharacters=n,t.trim=function(e,t=" "){return s(o(e,t),t)},t.ltrim=o,t.rtrim=s,t.convertSimple2RegExpPattern=function(e){return e.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")},t.stripWildcards=function(e){return e.replace(/\*/g,"")},t.startsWith=function(e,t){if(e.length0?e.indexOf(t,i)===i:0===i&&e===t},t.createRegExp=function(e,t,i={}){if(!e)throw new Error("Cannot create regex from empty string");t||(e=n(e)),i.wholeWord&&(/\B/.test(e.charAt(0))||(e="\\b"+e),/\B/.test(e.charAt(e.length-1))||(e+="\\b"));let o="";return i.global&&(o+="g"),i.matchCase||(o+="i"),i.multiline&&(o+="m"),i.unicode&&(o+="u"),new RegExp(e,o)},t.regExpLeadsToEndlessLoop=function(e){return"^"!==e.source&&"^$"!==e.source&&"$"!==e.source&&"^\\s*$"!==e.source&&!(!e.exec("")||0!==e.lastIndex)}, +t.regExpFlags=function(e){return(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")},t.firstNonWhitespaceIndex=function(e){for(let t=0,i=e.length;t=0;i--){const t=e.charCodeAt(i);if(32!==t&&9!==t)return i}return-1},t.compare=function(e,t){return et?1:0},t.compareSubstring=r,t.compareIgnoreCase=function(e,t){return a(e,t,0,e.length,0,t.length)},t.compareSubstringIgnoreCase=a,t.isLowerAsciiLetter=l,t.isUpperAsciiLetter=d,t.equalsIgnoreCase=function(e,t){return e.length===t.length&&h(e,t)},t.startsWithIgnoreCase=function(e,t){const i=t.length;return!(t.length>e.length)&&h(e,t,i)},t.commonPrefixLength=function(e,t){let i,n=Math.min(e.length,t.length) +;for(i=0;i=65536?2:1;let r=i.getGraphemeBreakType(s);for(;t=65536?2:1,r=s}return t-n},t.prevCharLength=function(e,t){const i=w.getInstance(),n=t,o=f(e,t);t-=o>=65536?2:1;let s=i.getGraphemeBreakType(o);for(;t>0;){const n=f(e,t),o=i.getGraphemeBreakType(n);if(S(o,s))break;t-=n>=65536?2:1,s=o}return n-t},t.decodeUTF8=function(e){const t=e.byteLength,i=[];let n=0;for(;n=240&&n+3>>0|(63&e[n++])<<12>>>0|(63&e[n++])<<6>>>0|(63&e[n++])<<0>>>0:o>=224&&n+2>>0|(63&e[n++])<<6>>>0|(63&e[n++])<<0>>>0:o>=192&&n+1>>0|(63&e[n++])<<0>>>0:e[n++])>=0&&s<=55295||s>=57344&&s<=65535)i.push(String.fromCharCode(s));else if(s>=65536&&s<=1114111){const e=s-65536,t=55296+((1047552&e)>>>10),n=56320+((1023&e)>>>0);i.push(String.fromCharCode(t)),i.push(String.fromCharCode(n))}else i.push(String.fromCharCode(65533))}return i.join("")};const _=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/ +;t.containsRTL=function(e){return _.test(e)};const v=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDE73\uDE78-\uDE82\uDE90-\uDE95])/;t.containsEmoji=function(e){return v.test(e)};const C=/^[\t\n\r\x20-\x7E]*$/;function b(e){return(e=+e)>=11904&&e<=55215||e>=63744&&e<=64255||e>=65281&&e<=65374}function S(e,t){return 0===e?5!==t&&7!==t:(2!==e||3!==t)&&(4===e||2===e||3===e||(4===t||2===t||3===t||(8!==e||8!==t&&9!==t&&11!==t&&12!==t)&&((11!==e&&9!==e||9!==t&&10!==t)&&((12!==e&&10!==e||10!==t)&&(5!==t&&13!==t&&(7!==t&&(1!==e&&((13!==e||14!==t)&&(6!==e||6!==t)))))))))}t.isBasicASCII=function(e){return C.test(e)},t.UNUSUAL_LINE_TERMINATORS=/[\u2028\u2029]/,t.containsUnusualLineTerminators=function(e){return t.UNUSUAL_LINE_TERMINATORS.test(e)},t.containsFullWidthCharacter=function(e){for(let t=0,i=e.length;t=127462&&e<=127487||e>=9728&&e<=10175||e>=127744&&e<=128591||e>=128640&&e<=128764||e>=128992&&e<=129003||e>=129280&&e<=129535||e>=129648&&e<=129651||e>=129656&&e<=129666||e>=129680&&e<=129685},t.UTF8_BOM_CHARACTER=String.fromCharCode(65279),t.startsWithUTF8BOM=function(e){return!!(e&&e.length>0&&65279===e.charCodeAt(0))},t.containsUppercaseCharacter=function(e,t=!1){return!!e&&(t&&(e=e.replace(/\\./g,"")),e.toLowerCase()!==e)},t.singleLetterHash=function(e){return(e%=52)<26?String.fromCharCode(97+e):String.fromCharCode(65+e-26)},t.getGraphemeBreakType=function(e){return w.getInstance().getGraphemeBreakType(e)},t.breakBetweenGraphemeBreakType=S;class w{constructor(){ +this._data=JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]") +}static getInstance(){return w._INSTANCE||(w._INSTANCE=new w),w._INSTANCE}getGraphemeBreakType(e){if(e<32)return 10===e?3:13===e?2:4;if(e<127)return 0;const t=this._data,i=t.length/3;let n=1;for(;n<=i;)if(et[3*n+1]))return t[3*n+2];n=2*n+1}return 0}}w._INSTANCE=null})),define(t[112],i([0,1,8]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.writeUInt8=t.readUInt8=t.writeUInt32BE=t.readUInt32BE=t.writeUInt16LE=t.readUInt16LE=t.VSBuffer=void 0;const n="undefined"!=typeof Buffer,o="undefined"!=typeof TextDecoder;let s;t.VSBuffer=class{constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}toString(){return n?this.buffer.toString():o?(s||(s=new TextDecoder),s.decode(this.buffer)):i.decodeUTF8(this.buffer)}},t.readUInt16LE=function(e,t){return e[t+0]<<0>>>0|e[t+1]<<8>>>0},t.writeUInt16LE=function(e,t,i){e[i+0]=255&t,t>>>=8,e[i+1]=255&t},t.readUInt32BE=function(e,t){return e[t]*Math.pow(2,24)+e[t+1]*Math.pow(2,16)+e[t+2]*Math.pow(2,8)+e[t+3]}, +t.writeUInt32BE=function(e,t,i){e[i+3]=t,t>>>=8,e[i+2]=t,t>>>=8,e[i+1]=t,t>>>=8,e[i]=t},t.readUInt8=function(e,t){return e[t]},t.writeUInt8=function(e,t,i){e[i]=t}})),define(t[187],i([0,1,8,63]),(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEqualOrParent=t.toSlashes=void 0,t.toSlashes=function(e){return e.replace(/[\\/]/g,n.posix.sep)},t.isEqualOrParent=function(e,t,o,s=n.sep){if(e===t)return!0;if(!e||!t)return!1;if(t.length>e.length)return!1;if(o){if(!i.startsWithIgnoreCase(e,t))return!1;if(t.length===e.length)return!0;let n=t.length;return t.charAt(t.length-1)===s&&n--,e.charAt(n)===s}return t.charAt(t.length-1)!==s&&(t+=s),0===e.indexOf(t)}})),define(t[113],i([0,1,8]),(function(e,t,i){"use strict";function n(e,t){switch(typeof e){case"object":return null===e?o(349,t):Array.isArray(e)?(i=e,r=o(104579,r=t),i.reduce((e,t)=>n(t,e),r)):function(e,t){return t=o(181387,t),Object.keys(e).sort().reduce((t,i)=>(t=s(i,t),n(e[i],t)),t)}(e,t);case"string":return s(e,t) +;case"boolean":return function(e,t){return o(e?433:863,t)}(e,t);case"number":return o(e,t);case"undefined":return o(937,t);default:return o(617,t)}var i,r}function o(e,t){return(t<<5)-t+e|0}function s(e,t){t=o(149417,t);for(let i=0,n=e.length;i>>n)>>>0}function a(e,t=0,i=e.byteLength,n=0){for(let o=0;o>>0).toString(16),t/4)}Object.defineProperty(t,"__esModule",{value:!0}),t.StringSHA1=t.stringHash=t.doHash=t.hash=void 0,t.hash=function(e){return n(e,0)},t.doHash=n,t.stringHash=s;class d{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){const t=e.length;if(0===t)return;const n=this._buff +;let o,s,r=this._buffLen,a=this._leftoverHighSurrogate;for(0!==a?(o=a,s=-1,a=0):(o=e.charCodeAt(0),s=0);;){let l=o;if(i.isHighSurrogate(o)){if(!(s+1>>6,e[t++]=128|(63&i)>>>0):i<65536?(e[t++]=224|(61440&i)>>>12,e[t++]=128|(4032&i)>>>6,e[t++]=128|(63&i)>>>0):(e[t++]=240|(1835008&i)>>>18,e[t++]=128|(258048&i)>>>12,e[t++]=128|(4032&i)>>>6,e[t++]=128|(63&i)>>>0),t>=64&&(this._step(),t-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),l(this._h0)+l(this._h1)+l(this._h2)+l(this._h3)+l(this._h4)} +_wrapUp(){this._buff[this._buffLen++]=128,a(this._buff,this._buffLen),this._buffLen>56&&(this._step(),a(this._buff));const e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){const e=d._bigBlock32,t=this._buffDV;for(let i=0;i<64;i+=4)e.setUint32(i,t.getUint32(i,!1),!1);for(let t=64;t<320;t+=4)e.setUint32(t,r(e.getUint32(t-12,!1)^e.getUint32(t-32,!1)^e.getUint32(t-56,!1)^e.getUint32(t-64,!1),1),!1);let i,n,o,s=this._h0,a=this._h1,l=this._h2,c=this._h3,h=this._h4;for(let t=0;t<80;t++)t<20?(i=a&l|~a&c,n=1518500249):t<40?(i=a^l^c,n=1859775393):t<60?(i=a&l|a&c|l&c,n=2400959708):(i=a^l^c,n=3395469782),o=r(s,5)+i+h+n+e.getUint32(4*t,!1)&4294967295,h=c,c=l,l=r(a,30),a=s,s=o;this._h0=this._h0+s&4294967295,this._h1=this._h1+a&4294967295,this._h2=this._h2+l&4294967295,this._h3=this._h3+c&4294967295,this._h4=this._h4+h&4294967295}}t.StringSHA1=d,d._bigBlock32=new DataView(new ArrayBuffer(320))})), +define(t[188],i([0,1,265,113]),(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LcsDiff=t.MyArray=t.Debug=t.stringDiff=t.StringDiffSequence=void 0;class o{constructor(e){this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let i=0,n=e.length;i0||this.m_modifiedCount>0)&&this.m_changes.push(new i.DiffChange(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0, +this.m_modifiedCount=0,this.m_originalStart=1073741824,this.m_modifiedStart=1073741824}AddOriginalElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_originalCount++}AddModifiedElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_modifiedCount++}getChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes}getReverseChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes}}class l{constructor(e,t,i=null){this.ContinueProcessingPredicate=i;const[n,o,s]=l._getElements(e),[r,a,d]=l._getElements(t);this._hasStrings=s&&d,this._originalStringElements=n,this._originalElementsOrHash=o,this._modifiedStringElements=r,this._modifiedElementsOrHash=a,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(e){ +return e.length>0&&"string"==typeof e[0]}static _getElements(e){const t=e.getElements();if(l._isStringArray(t)){const e=new Int32Array(t.length);for(let i=0,o=t.length;i=e&&o>=n&&this.ElementsAreEqual(t,o);)t--,o--;if(e>t||n>o){let r;return n<=o?(s.Assert(e===t+1,"originalStart should only be one more than originalEnd"),r=[new i.DiffChange(e,0,n,o-n+1)]):e<=t?(s.Assert(n===o+1,"modifiedStart should only be one more than modifiedEnd"),r=[new i.DiffChange(e,t-e+1,n,0)]):(s.Assert(e===t+1,"originalStart should only be one more than originalEnd"),s.Assert(n===o+1,"modifiedStart should only be one more than modifiedEnd"),r=[]),r}const a=[0],l=[0],d=this.ComputeRecursionPoint(e,t,n,o,a,l,r),c=a[0],h=l[0];if(null!==d)return d;if(!r[0]){const s=this.ComputeDiffRecursive(e,c,n,h,r);let a=[];return a=r[0]?[new i.DiffChange(c+1,t-(c+1)+1,h+1,o-(h+1)+1)]:this.ComputeDiffRecursive(c+1,t,h+1,o,r),this.ConcatenateChanges(s,a)}return[new i.DiffChange(e,t-e+1,n,o-n+1)]} +WALKTRACE(e,t,n,o,s,r,l,d,c,h,u,g,p,m,f,_,v,C){let b=null,S=null,w=new a,y=t,E=n,L=p[0]-_[0]-o,x=-1073741824,D=this.m_forwardHistory.length-1;do{const t=L+e;t===y||t=0&&(e=(c=this.m_forwardHistory[D])[0],y=1,E=c.length-1)}while(--D>=-1);if(b=w.getReverseChanges(),C[0]){let e=p[0]+1,t=_[0]+1;if(null!==b&&b.length>0){const i=b[b.length-1];e=Math.max(e,i.getOriginalEnd()),t=Math.max(t,i.getModifiedEnd())}S=[new i.DiffChange(e,g-e+1,t,f-t+1)]}else{w=new a,y=r,E=l,L=p[0]-_[0]-d,x=1073741824,D=v?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const e=L+s;e===y||e=h[e+1]?(m=(u=h[e+1]-1)-L-d,u>x&&w.MarkNextChange(),x=u+1,w.AddOriginalElement(u+1,m+1),L=e+1-s):(m=(u=h[e-1])-L-d,u>x&&w.MarkNextChange(),x=u,w.AddModifiedElement(u+1,m+1),L=e-1-s),D>=0&&(s=(h=this.m_reverseHistory[D])[0],y=1,E=h.length-1) +}while(--D>=-1);S=w.getChanges()}return this.ConcatenateChanges(b,S)}ComputeRecursionPoint(e,t,n,o,s,a,l){let d=0,c=0,h=0,u=0,g=0,p=0;e--,n--,s[0]=0,a[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const m=t-e+(o-n),f=m+1,_=new Int32Array(f),v=new Int32Array(f),C=o-n,b=t-e,S=e-n,w=t-o,y=(b-C)%2==0;_[C]=e,v[b]=t,l[0]=!1;for(let E=1;E<=m/2+1;E++){let m=0,L=0;h=this.ClipDiagonalBound(C-E,E,C,f),u=this.ClipDiagonalBound(C+E,E,C,f);for(let e=h;e<=u;e+=2){c=(d=e===h||em+L&&(m=d,L=c),!y&&Math.abs(e-b)<=E-1&&d>=v[e])return s[0]=d,a[0]=c,i<=v[e]&&E<=1448?this.WALKTRACE(C,h,u,S,b,g,p,w,_,v,d,t,s,c,o,a,y,l):null}const x=(m-e+(L-n)-E)/2;if(null!==this.ContinueProcessingPredicate&&!this.ContinueProcessingPredicate(m,x))return l[0]=!0,s[0]=m,a[0]=L,x>0&&E<=1448?this.WALKTRACE(C,h,u,S,b,g,p,w,_,v,d,t,s,c,o,a,y,l):(e++,n++,[new i.DiffChange(e,t-e+1,n,o-n+1)]);g=this.ClipDiagonalBound(b-E,E,b,f), +p=this.ClipDiagonalBound(b+E,E,b,f);for(let i=g;i<=p;i+=2){c=(d=i===g||i=v[i+1]?v[i+1]-1:v[i-1])-(i-b)-w;const r=d;for(;d>e&&c>n&&this.ElementsAreEqual(d,c);)d--,c--;if(v[i]=d,y&&Math.abs(i-C)<=E&&d<=_[i])return s[0]=d,a[0]=c,r>=_[i]&&E<=1448?this.WALKTRACE(C,h,u,S,b,g,p,w,_,v,d,t,s,c,o,a,y,l):null}if(E<=1447){let e=new Int32Array(u-h+2);e[0]=C-h+1,r.Copy2(_,h,e,1,u-h+1),this.m_forwardHistory.push(e),(e=new Int32Array(p-g+2))[0]=b-g+1,r.Copy2(v,g,e,1,p-g+1),this.m_reverseHistory.push(e)}}return this.WALKTRACE(C,h,u,S,b,g,p,w,_,v,d,t,s,c,o,a,y,l)}PrettifyChanges(e){for(let t=0;t0,r=i.modifiedLength>0 +;for(;i.originalStart+i.originalLength=0;t--){const i=e[t];let n=0,o=0;if(t>0){const i=e[t-1];i.originalLength>0&&(n=i.originalStart+i.originalLength),i.modifiedLength>0&&(o=i.modifiedStart+i.modifiedLength)}const s=i.originalLength>0,r=i.modifiedLength>0;let a=0,l=this._boundaryScore(i.originalStart,i.originalLength,i.modifiedStart,i.modifiedLength);for(let e=1;;e++){const t=i.originalStart-e,d=i.modifiedStart-e;if(tl&&(l=c,a=e)} +i.originalStart-=a,i.modifiedStart-=a}return e}_OriginalIsBoundary(e){return e<=0||e>=this._originalElementsOrHash.length-1||this._hasStrings&&/^\s*$/.test(this._originalStringElements[e])}_OriginalRegionIsBoundary(e,t){if(this._OriginalIsBoundary(e)||this._OriginalIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._OriginalIsBoundary(i-1)||this._OriginalIsBoundary(i))return!0}return!1}_ModifiedIsBoundary(e){return e<=0||e>=this._modifiedElementsOrHash.length-1||this._hasStrings&&/^\s*$/.test(this._modifiedStringElements[e])}_ModifiedRegionIsBoundary(e,t){if(this._ModifiedIsBoundary(e)||this._ModifiedIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._ModifiedIsBoundary(i-1)||this._ModifiedIsBoundary(i))return!0}return!1}_boundaryScore(e,t,i,n){return(this._OriginalRegionIsBoundary(e,t)?1:0)+(this._ModifiedRegionIsBoundary(i,n)?1:0)}ConcatenateChanges(e,t){let i=[];if(0===e.length||0===t.length)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],i)){const n=new Array(e.length+t.length-1) +;return r.Copy(e,0,n,0,e.length-1),n[e.length-1]=i[0],r.Copy(t,1,n,e.length,t.length-1),n}{const i=new Array(e.length+t.length);return r.Copy(e,0,i,0,e.length),r.Copy(t,0,i,e.length,t.length),i}}ChangesOverlap(e,t,n){if(s.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),s.Assert(e.modifiedStart<=t.modifiedStart,"Left change is not less than or equal to right change"),e.originalStart+e.originalLength>=t.originalStart||e.modifiedStart+e.modifiedLength>=t.modifiedStart){const o=e.originalStart;let s=e.originalLength;const r=e.modifiedStart;let a=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(s=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(a=t.modifiedStart+t.modifiedLength-e.modifiedStart),n[0]=new i.DiffChange(o,s,r,a),!0}return n[0]=null,!1}ClipDiagonalBound(e,t,i,n){if(e>=0&&e0?t[0].toUpperCase()+t.substr(1):t}return t}function o(e,t,i){return-1!==e[0].indexOf(i)&&-1!==t.indexOf(i)&&e[0].split(i).length===t.split(i).length}function s(e,t,i){const o=t.split(i),s=e[0].split(i);let r="";return o.forEach((e,t)=>{r+=n([s[t]],e)+i}),r.slice(0,-1)}Object.defineProperty(t,"__esModule",{value:!0}),t.buildReplaceStringWithCasePreserved=void 0,t.buildReplaceStringWithCasePreserved=n})),define(t[77],i([0,1,8]),(function(e,t,i){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.Ignore=0]="Ignore",e[e.Info=1]="Info",e[e.Warning=2]="Warning",e[e.Error=3]="Error"}(n||(n={})),function(e){const t="error",n="warning",o="warn",s="info";e.fromValue=function(r){ +return r?i.equalsIgnoreCase(t,r)?e.Error:i.equalsIgnoreCase(n,r)||i.equalsIgnoreCase(o,r)?e.Warning:i.equalsIgnoreCase(s,r)?e.Info:e.Ignore:e.Ignore}}(n||(n={})),t.default=n})),define(t[23],i([0,1]),(function(e,t){"use strict";function i(e){return"string"==typeof e}function n(e){return void 0===e}function o(e){return n(e)||null===e}function s(e){return"function"==typeof e}function r(e,t){if(i(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(s(t)){try{if(e instanceof t)return}catch(e){}if(!o(e)&&e.constructor===t)return;if(1===t.length&&!0===t.call(void 0,e))return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function a(e){let t=[],i=Object.getPrototypeOf(e);for(;Object.prototype!==i;)t=t.concat(Object.getOwnPropertyNames(i)),i=Object.getPrototypeOf(i);return t}Object.defineProperty(t,"__esModule",{value:!0}), +t.withNullAsUndefined=t.createProxyObject=t.getAllMethodNames=t.getAllPropertyNames=t.validateConstraint=t.validateConstraints=t.isFunction=t.assertIsDefined=t.assertType=t.isUndefinedOrNull=t.isUndefined=t.isBoolean=t.isNumber=t.isObject=t.isString=t.isArray=void 0,t.isArray=function(e){return Array.isArray(e)},t.isString=i,t.isObject=function(e){return!("object"!=typeof e||null===e||Array.isArray(e)||e instanceof RegExp||e instanceof Date)},t.isNumber=function(e){return"number"==typeof e&&!isNaN(e)},t.isBoolean=function(e){return!0===e||!1===e},t.isUndefined=n,t.isUndefinedOrNull=o,t.assertType=function(e,t){if(!e)throw new Error(t?`Unexpected type, expected '${t}'`:"Unexpected type")},t.assertIsDefined=function(e){if(o(e))throw new Error("Assertion Failed: argument is undefined or null");return e},t.isFunction=s,t.validateConstraints=function(e,t){const i=Math.min(e.length,t.length);for(let n=0;n(function(){const i=Array.prototype.slice.call(arguments,0);return t(e,i)});let n={};for(const t of e)n[t]=i(t);return n},t.withNullAsUndefined=function(e){return null===e?void 0:e}})),define(t[37],i([0,1,23]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getOrDefault=t.equals=t.assign=t.mixin=t.cloneAndChange=t.deepFreeze=t.deepClone=void 0,t.deepClone=function e(t){if(!t||"object"!=typeof t)return t;if(t instanceof RegExp)return t;const i=Array.isArray(t)?[]:{};return Object.keys(t).forEach(n=>{t[n]&&"object"==typeof t[n]?i[n]=e(t[n]):i[n]=t[n]}),i},t.deepFreeze=function(e){if(!e||"object"!=typeof e)return e;const t=[e];for(;t.length>0;){const e=t.shift();Object.freeze(e);for(const i in e)if(n.call(e,i)){const n=e[i];"object"!=typeof n||Object.isFrozen(n)||t.push(n)}}return e};const n=Object.prototype.hasOwnProperty;t.cloneAndChange=function(e,t){ +return function e(t,o,s){if(i.isUndefinedOrNull(t))return t;const r=o(t);if(void 0!==r)return r;if(i.isArray(t)){const i=[];for(const n of t)i.push(e(n,o,s));return i}if(i.isObject(t)){if(s.has(t))throw new Error("Cannot clone recursive data-structure");s.add(t);const i={};for(let r in t)n.call(t,r)&&(i[r]=e(t[r],o,s));return s.delete(t),i}return t}(e,t,new Set)},t.mixin=function e(t,n,o=!0){return i.isObject(t)?(i.isObject(n)&&Object.keys(n).forEach(s=>{s in t?o&&(i.isObject(t[s])&&i.isObject(n[s])?e(t[s],n[s],o):t[s]=n[s]):t[s]=n[s]}),t):n},t.assign=function(e,...t){return t.forEach(t=>Object.keys(t).forEach(i=>e[i]=t[i])),e},t.equals=function e(t,i){if(t===i)return!0;if(null==t||null==i)return!1;if(typeof t!=typeof i)return!1;if("object"!=typeof t)return!1;if(Array.isArray(t)!==Array.isArray(i))return!1;let n,o;if(Array.isArray(t)){if(t.length!==i.length)return!1;for(n=0;n255?255:0|e},t.toUint32=function(e){return e<0?0:e>4294967295?4294967295:0|e}})),define(t[24],i([0,1,16,63]),(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uriToFsPath=t.URI=void 0;const o=/^\w[\w\d+.-]*$/,s=/^\//,r=/^\/\//;const a="",l="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class c{constructor(e,t,i,n,d,c=!1){"object"==typeof e?(this.scheme=e.scheme||a,this.authority=e.authority||a,this.path=e.path||a,this.query=e.query||a,this.fragment=e.fragment||a):(this.scheme=function(e,t){return e||t?e:"file"}(e,c),this.authority=t||a,this.path=function(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==l&&(t=l+t):t=l}return t +}(this.scheme,i||a),this.query=n||a,this.fragment=d||a,function(e,t){if(!e.scheme&&t)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${e.authority}", path: "${e.path}", query: "${e.query}", fragment: "${e.fragment}"}`);if(e.scheme&&!o.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){if(!s.test(e.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(r.test(e.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}(this,c))}static isUri(e){return e instanceof c||!!e&&("string"==typeof e.authority&&"string"==typeof e.fragment&&"string"==typeof e.path&&"string"==typeof e.query&&"string"==typeof e.scheme&&"function"==typeof e.fsPath&&"function"==typeof e.with&&"function"==typeof e.toString)}get fsPath(){return f(this,!1)} +with(e){if(!e)return this;let{scheme:t,authority:i,path:n,query:o,fragment:s}=e;return void 0===t?t=this.scheme:null===t&&(t=a),void 0===i?i=this.authority:null===i&&(i=a),void 0===n?n=this.path:null===n&&(n=a),void 0===o?o=this.query:null===o&&(o=a),void 0===s?s=this.fragment:null===s&&(s=a),t===this.scheme&&i===this.authority&&n===this.path&&o===this.query&&s===this.fragment?this:new u(t,i,n,o,s)}static parse(e,t=!1){const i=d.exec(e);return i?new u(i[2]||a,C(i[4]||a),C(i[5]||a),C(i[7]||a),C(i[9]||a),t):new u(a,a,a,a,a)}static file(e){let t=a;if(i.isWindows&&(e=e.replace(/\\/g,l)),e[0]===l&&e[1]===l){const i=e.indexOf(l,2);-1===i?(t=e.substring(2),e=l):(t=e.substring(2,i),e=e.substring(i)||l)}return new u("file",t,e,a,a)}static from(e){return new u(e.scheme,e.authority,e.path,e.query,e.fragment)}static joinPath(e,...t){if(!e.path)throw new Error("[UriError]: cannot call joinPaths on URI without path");let o +;return o=i.isWindows&&"file"===e.scheme?c.file(n.win32.join(f(e,!0),...t)).path:n.posix.join(e.path,...t),e.with({path:o})}toString(e=!1){return _(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof c)return e;{const t=new u(e);return t._formatted=e.external,t._fsPath=e._sep===h?e.fsPath:null,t}}return e}}t.URI=c;const h=i.isWindows?1:void 0;class u extends c{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=f(this,!1)),this._fsPath}toString(e=!1){return e?_(this,!0):(this._formatted||(this._formatted=_(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=h),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}}const g={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21", +36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function p(e,t){let i=void 0,n=-1;for(let o=0;o=97&&s<=122||s>=65&&s<=90||s>=48&&s<=57||45===s||46===s||95===s||126===s||t&&47===s)-1!==n&&(i+=encodeURIComponent(e.substring(n,o)),n=-1),void 0!==i&&(i+=e.charAt(o));else{void 0===i&&(i=e.substr(0,o));const t=g[s];void 0!==t?(-1!==n&&(i+=encodeURIComponent(e.substring(n,o)),n=-1),i+=t):-1===n&&(n=o)}}return-1!==n&&(i+=encodeURIComponent(e.substring(n))),void 0!==i?i:e}function m(e){let t=void 0;for(let i=0;i1&&"file"===e.scheme?`//${e.authority}${e.path}`:47===e.path.charCodeAt(0)&&(e.path.charCodeAt(1)>=65&&e.path.charCodeAt(1)<=90||e.path.charCodeAt(1)>=97&&e.path.charCodeAt(1)<=122)&&58===e.path.charCodeAt(2)?t?e.path.substr(1):e.path[1].toLowerCase()+e.path.substr(2):e.path,i.isWindows&&(n=n.replace(/\//g,"\\")),n}function _(e,t){const i=t?m:p;let n="",{scheme:o,authority:s,path:r,query:a,fragment:d}=e;if(o&&(n+=o,n+=":"),(s||"file"===o)&&(n+=l,n+=l),s){let e=s.indexOf("@");if(-1!==e){const t=s.substr(0,e);s=s.substr(e+1),-1===(e=t.indexOf(":"))?n+=i(t,!1):(n+=i(t.substr(0,e),!1),n+=":",n+=i(t.substr(e+1),!1)),n+="@"}-1===(e=(s=s.toLowerCase()).indexOf(":"))?n+=i(s,!1):(n+=i(s.substr(0,e),!1),n+=s.substr(e))}if(r){if(r.length>=3&&47===r.charCodeAt(0)&&58===r.charCodeAt(2)){const e=r.charCodeAt(1);e>=65&&e<=90&&(r=`/${String.fromCharCode(e+32)}:${r.substr(3)}`)}else if(r.length>=2&&58===r.charCodeAt(1)){const e=r.charCodeAt(0) +;e>=65&&e<=90&&(r=`${String.fromCharCode(e+32)}:${r.substr(2)}`)}n+=i(r,!0)}return a&&(n+="?",n+=i(a,!1)),d&&(n+="#",n+=t?d:p(d,!1)),n}t.uriToFsPath=f;const v=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function C(e){return e.match(v)?e.replace(v,e=>(function e(t){try{return decodeURIComponent(t)}catch(i){return t.length>3?t.substr(0,3)+e(t.substr(3)):t}})(e)):e}})),define(t[189],i([0,1,112,24]),(function(e,t,i,n){"use strict";function o(e,t=0){if(!e||t>200)return e;if("object"==typeof e){switch(e.$mid){case 1:return n.URI.revive(e);case 2:return new RegExp(e.source,e.flags)}if(e instanceof i.VSBuffer||e instanceof Uint8Array)return e;if(Array.isArray(e))for(let i=0;it.split(" ").forEach(t=>this.addClass(e,t)))}addClass(e,t){t&&e.classList&&e.classList.add(t)}removeClass(e,t){t&&e.classList&&e.classList.remove(t)}removeClasses(e,...t){t.forEach(t=>t.split(" ").forEach(t=>this.removeClass(e,t)))}toggleClass(e,t,i){e.classList&&e.classList.toggle(t,i)}};t.hasClass=p.hasClass.bind(p),t.addClass=p.addClass.bind(p),t.addClasses=p.addClasses.bind(p),t.removeClass=p.removeClass.bind(p),t.removeClasses=p.removeClasses.bind(p),t.toggleClass=p.toggleClass.bind(p);class m{constructor(e,t,i,n){this._node=e,this._type=t,this._handler=i,this._options=n||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){ +this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}}function f(e,t,i,n){return new m(e,t,i,n)}function _(e){return function(t){return e(new s.StandardMouseEvent(t))}}t.addDisposableListener=f;t.addStandardDisposableListener=function(e,t,i,n){let s=i;return"click"===t||"mousedown"===t?s=_(i):"keydown"!==t&&"keypress"!==t&&"keyup"!==t||(s=function(e){return function(t){return e(new o.StandardKeyboardEvent(t))}}(i)),f(e,t,s,n)};function v(e,i,n){return f(e,c.isIOS&&g.BrowserFeatures.pointerEvents?t.EventType.POINTER_DOWN:t.EventType.MOUSE_DOWN,i,n)}t.addStandardDisposableGenericMouseDownListner=function(e,t,i){return v(e,_(t),i)},t.addDisposableGenericMouseDownListner=v,t.addDisposableGenericMouseUpListner=function(e,i,n){return f(e,c.isIOS&&g.BrowserFeatures.pointerEvents?t.EventType.POINTER_UP:t.EventType.MOUSE_UP,i,n)},t.addDisposableNonBubblingMouseOutListener=function(e,t){return f(e,"mouseout",i=>{let n=i.relatedTarget +;for(;n&&n!==e;)n=n.parentNode;n!==e&&t(i)})},t.addDisposableNonBubblingPointerOutListener=function(e,t){return f(e,"pointerout",i=>{let n=i.relatedTarget;for(;n&&n!==e;)n=n.parentNode;n!==e&&t(i)})};let C=null;class b{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){a.onUnexpectedError(e)}}static sort(e,t){return t.priority-e.priority}}!function(){let e=[],i=null,n=!1,o=!1,s=()=>{for(n=!1,i=e,e=[],o=!0;i.length>0;){i.sort(b.sort),i.shift().execute()}o=!1};t.scheduleAtNextAnimationFrame=(t,i=0)=>{let o=new b(t,i);return e.push(o),n||(n=!0,function(e){if(!C){const e=e=>setTimeout(()=>e((new Date).getTime()),0);C=self.requestAnimationFrame||self.msRequestAnimationFrame||self.webkitRequestAnimationFrame||self.mozRequestAnimationFrame||self.oRequestAnimationFrame||e}C.call(self,e)}(s)),o},t.runAtThisOrScheduleAtNextAnimationFrame=(e,n)=>{if(o){let t=new b(e,n);return i.push(t),t} +return t.scheduleAtNextAnimationFrame(e,n)}}();const S=16,w=function(e,t){return t};class y extends d.Disposable{constructor(e,t,i,n=w,o=S){super();let s=null,a=0,l=this._register(new r.TimeoutTimer),d=()=>{a=(new Date).getTime(),i(s),s=null};this._register(f(e,t,e=>{s=n(s,e);let t=(new Date).getTime()-a;t>=o?(l.cancel(),d()):l.setIfNotSet(d,o-t)}))}}function E(e){return document.defaultView.getComputedStyle(e,null)}t.addDisposableThrottledListener=function(e,t,i,n,o){return new y(e,t,i,n,o)},t.getComputedStyle=E,t.getClientArea=function(e){if(e!==document.body)return new x(e.clientWidth,e.clientHeight);if(c.isIOS&&window.visualViewport){const e=window.visualViewport.width,t=window.visualViewport.height-(i.isStandalone?24:0);return new x(e,t)}if(window.innerWidth&&window.innerHeight)return new x(window.innerWidth,window.innerHeight);if(document.body&&document.body.clientWidth&&document.body.clientHeight)return new x(document.body.clientWidth,document.body.clientHeight) +;if(document.documentElement&&document.documentElement.clientWidth&&document.documentElement.clientHeight)return new x(document.documentElement.clientWidth,document.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")};class L{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,i){let n=E(e),o="0";return n&&(o=n.getPropertyValue?n.getPropertyValue(t):n.getAttribute(i)),L.convertToPixels(e,o)}static getBorderLeftWidth(e){return L.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return L.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return L.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return L.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return L.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return L.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){ +return L.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return L.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return L.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return L.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return L.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return L.getDimension(e,"margin-bottom","marginBottom")}}class x{constructor(e,t){this.width=e,this.height=t}}function D(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function k(e,i,n){for(;e&&e.nodeType===e.ELEMENT_NODE;){if(t.hasClass(e,i))return e;if(n)if("string"==typeof n){if(t.hasClass(e,n))return null}else if(e===n)return null;e=e.parentNode}return null}function N(e){return e&&!!e.host&&!!e.mode}function I(e){for(;e.parentNode;){if(e===document.body)return null;e=e.parentNode}return N(e)?e:null}function M(e=document.getElementsByTagName("head")[0]){let t=document.createElement("style") +;return t.type="text/css",t.media="screen",e.appendChild(t),t}t.Dimension=x,t.getTopLeftOffset=function(e){let t=e.offsetParent,i=e.offsetTop,n=e.offsetLeft;for(;null!==(e=e.parentNode)&&e!==document.body&&e!==document.documentElement;){i-=e.scrollTop;const o=N(e)?null:E(e);o&&(n-="rtl"!==o.direction?e.scrollLeft:-e.scrollLeft),e===t&&(n+=L.getBorderLeftWidth(e),i+=L.getBorderTopWidth(e),i+=e.offsetTop,n+=e.offsetLeft,t=e.offsetParent)}return{left:n,top:i}},t.getDomNodePagePosition=function(e){let i=e.getBoundingClientRect();return{left:i.left+t.StandardWindow.scrollX,top:i.top+t.StandardWindow.scrollY,width:i.width,height:i.height}},t.StandardWindow=new class{get scrollX(){return"number"==typeof window.scrollX?window.scrollX:document.body.scrollLeft+document.documentElement.scrollLeft}get scrollY(){return"number"==typeof window.scrollY?window.scrollY:document.body.scrollTop+document.documentElement.scrollTop}},t.getTotalWidth=function(e){let t=L.getMarginLeft(e)+L.getMarginRight(e);return e.offsetWidth+t}, +t.getContentWidth=function(e){let t=L.getBorderLeftWidth(e)+L.getBorderRightWidth(e),i=L.getPaddingLeft(e)+L.getPaddingRight(e);return e.offsetWidth-t-i},t.getContentHeight=function(e){let t=L.getBorderTopWidth(e)+L.getBorderBottomWidth(e),i=L.getPaddingTop(e)+L.getPaddingBottom(e);return e.offsetHeight-t-i},t.getTotalHeight=function(e){let t=L.getMarginTop(e)+L.getMarginBottom(e);return e.offsetHeight+t},t.isAncestor=D,t.findParentWithClass=k,t.hasParentWithClass=function(e,t,i){return!!k(e,t,i)},t.isShadowRoot=N,t.isInShadowDOM=function(e){return!!I(e)},t.getShadowRoot=I,t.getActiveElement=function(){let e=document.activeElement;for(;null==e?void 0:e.shadowRoot;)e=e.shadowRoot.activeElement;return e},t.createStyleSheet=M;let R=null;function T(){return R||(R=M()),R}t.createCSSRule=function(e,t,i=T()){i&&t&&i.sheet.insertRule(e+"{"+t+"}",0)},t.removeCSSRulesContainingSelector=function(e,t=T()){if(!t)return;let i=function(e){ +return e&&e.sheet&&e.sheet.rules?e.sheet.rules:e&&e.sheet&&e.sheet.cssRules?e.sheet.cssRules:[]}(t),n=[];for(let t=0;t=0;e--)t.sheet.deleteRule(n[e])},t.isHTMLElement=function(e){return"object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&1===e.nodeType&&"string"==typeof e.nodeName},t.EventType={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:i.isEdge?"mousewheel":"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange", +WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:i.isWebKit?"webkitAnimationStart":"animationstart",ANIMATION_END:i.isWebKit?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:i.isWebKit?"webkitAnimationIteration":"animationiteration"},t.EventHelper={stop:function(e,t){e.preventDefault?e.preventDefault():e.returnValue=!1,t&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)}},t.saveParentsScrollTop=function(e){let t=[];for(let i=0;e&&e.nodeType===e.ELEMENT_NODE;i++)t[i]=e.scrollTop,e=e.parentNode;return t},t.restoreParentsScrollTop=function(e,t){for(let i=0;e&&e.nodeType===e.ELEMENT_NODE;i++)e.scrollTop!==t[i]&&(e.scrollTop=t[i]),e=e.parentNode};class O extends d.Disposable{constructor(e){super(), +this._onDidFocus=this._register(new l.Emitter),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new l.Emitter),this.onDidBlur=this._onDidBlur.event;let i=D(document.activeElement,e),o=!1;const s=()=>{o=!1,i||(i=!0,this._onDidFocus.fire())},r=()=>{i&&(o=!0,window.setTimeout(()=>{o&&(o=!1,i=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{D(document.activeElement,e)!==i&&(i?r():s())},this._register(n.domEvent(e,t.EventType.FOCUS,!0)(s)),this._register(n.domEvent(e,t.EventType.BLUR,!0)(r))}}t.trackFocus=function(e){return new O(e)},t.append=function(e,...t){return t.forEach(t=>e.appendChild(t)),t[t.length-1]};const A=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var P;function F(e,t,i,...n){let o=A.exec(t);if(!o)throw new Error("Bad use of emmet");i=Object.assign({},i||{});let s,r=o[1]||"div";return s=e!==P.HTML?document.createElementNS(e,r):document.createElement(r),o[3]&&(s.id=o[3]),o[4]&&(s.className=o[4].replace(/\./g," ").trim()),Object.keys(i).forEach(e=>{const t=i[e] +;void 0!==t&&(/^on\w+$/.test(e)?s[e]=t:"selected"===e?t&&s.setAttribute(e,"true"):s.setAttribute(e,t))}),h.coalesce(n).forEach(e=>{e instanceof Node?s.appendChild(e):s.appendChild(document.createTextNode(e))}),s}function W(e,t,...i){return F(P.HTML,e,t,...i)}function B(e){return e&&u.Schemas.vscodeRemote===e.scheme?u.RemoteAuthorities.rewrite(e):e}t.reset=function(e,...t){e.innerText="",h.coalesce(t).forEach(t=>{t instanceof Node?e.appendChild(t):e.appendChild(document.createTextNode(t))})},function(e){e.HTML="http://www.w3.org/1999/xhtml",e.SVG="http://www.w3.org/2000/svg"}(P=t.Namespace||(t.Namespace={})),t.$=W,W.SVG=function(e,t,...i){return F(P.SVG,e,t,...i)},t.show=function(...e){for(let t of e)t.style.display="",t.removeAttribute("aria-hidden")},t.hide=function(...e){for(let t of e)t.style.display="none",t.setAttribute("aria-hidden","true")},t.removeTabIndexAndUpdateFocus=function(e){if(e&&e.hasAttribute("tabIndex")){if(document.activeElement===e){let t=function(e,t){ +for(;e&&e.nodeType===e.ELEMENT_NODE;){if(e instanceof HTMLElement&&e.hasAttribute(t))return e;e=e.parentNode}return null}(e.parentElement,"tabIndex");t&&t.focus()}e.removeAttribute("tabindex")}},t.getElementsByTagName=function(e){return Array.prototype.slice.call(document.getElementsByTagName(e),0)},t.computeScreenAwareSize=function(e){const t=window.devicePixelRatio*e;return Math.max(1,Math.floor(t))/window.devicePixelRatio},t.windowOpenNoOpener=function(e){if(c.isNative||i.isEdgeWebView)window.open(e);else{let t=window.open();t&&(t.opener=null,t.location.href=e)}},t.animate=function(e){const i=()=>{e(),n=t.scheduleAtNextAnimationFrame(i)};let n=t.scheduleAtNextAnimationFrame(i);return d.toDisposable(()=>n.dispose())},u.RemoteAuthorities.setPreferredWebSchema(/^https:/.test(window.location.href)?"https":"http"),t.asDomUri=B,t.asCSSUrl=function(e){return e?`url('${B(e).toString(!0).replace(/'/g,"%27")}')`:"url('')"}})),define(t[30],i([0,1,7]),(function(e,t,i){"use strict" +;Object.defineProperty(t,"__esModule",{value:!0}),t.createFastDomNode=t.FastDomNode=void 0;class n{constructor(e){this.domNode=e,this._maxWidth=-1,this._width=-1,this._height=-1,this._top=-1,this._left=-1,this._bottom=-1,this._right=-1,this._fontFamily="",this._fontWeight="",this._fontSize=-1,this._fontFeatureSettings="",this._lineHeight=-1,this._letterSpacing=-100,this._className="",this._display="",this._position="",this._visibility="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){this._maxWidth!==e&&(this._maxWidth=e,this.domNode.style.maxWidth=this._maxWidth+"px")}setWidth(e){this._width!==e&&(this._width=e,this.domNode.style.width=this._width+"px")}setHeight(e){this._height!==e&&(this._height=e,this.domNode.style.height=this._height+"px")}setTop(e){this._top!==e&&(this._top=e,this.domNode.style.top=this._top+"px")}unsetTop(){-1!==this._top&&(this._top=-1,this.domNode.style.top="")}setLeft(e){this._left!==e&&(this._left=e, +this.domNode.style.left=this._left+"px")}setBottom(e){this._bottom!==e&&(this._bottom=e,this.domNode.style.bottom=this._bottom+"px")}setRight(e){this._right!==e&&(this._right=e,this.domNode.style.right=this._right+"px")}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){this._fontSize!==e&&(this._fontSize=e,this.domNode.style.fontSize=this._fontSize+"px")}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setLineHeight(e){this._lineHeight!==e&&(this._lineHeight=e,this.domNode.style.lineHeight=this._lineHeight+"px")}setLetterSpacing(e){this._letterSpacing!==e&&(this._letterSpacing=e,this.domNode.style.letterSpacing=this._letterSpacing+"px")}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)} +toggleClassName(e,t){i.toggleClass(this.domNode,e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){ +this.domNode.removeChild(e.domNode)}}t.FastDomNode=n,t.createFastDomNode=function(e){return new n(e)}})),define(t[148],i([0,1,7]),(function(e,t,i){"use strict";function n(e){const t=e.inline?"span":"div",i=document.createElement(t);return e.className&&(i.className=e.className),i}Object.defineProperty(t,"__esModule",{value:!0}),t.createElement=t.renderFormattedText=t.renderText=void 0,t.renderText=function(e,t={}){const i=n(t);return i.textContent=e,i},t.renderFormattedText=function(e,t={}){const r=n(t);return function e(t,n,o){let s;if(2===n.type)s=document.createTextNode(n.content||"");else if(3===n.type)s=document.createElement("b");else if(4===n.type)s=document.createElement("i");else if(5===n.type&&o){const e=document.createElement("a");e.href="#",o.disposeables.add(i.addStandardDisposableListener(e,"click",e=>{o.callback(String(n.index),e)})),s=e}else 7===n.type?s=document.createElement("br"):1===n.type&&(s=t);s&&t!==s&&t.appendChild(s);s&&Array.isArray(n.children)&&n.children.forEach(t=>{e(s,t,o)}) +}(r,function(e){const t={type:1,children:[]};let i=0,n=t;const r=[],a=new o(e);for(;!a.eos();){let e=a.next();const t="\\"===e&&0!==s(a.peek());if(t&&(e=a.next()),t||0===s(e)||e!==a.peek())if("\n"===e)2===n.type&&(n=r.pop()),n.children.push({type:7});else if(2!==n.type){const t={type:2,content:e};n.children.push(t),r.push(n),n=t}else n.content+=e;else{a.advance(),2===n.type&&(n=r.pop());const t=s(e);if(n.type===t||5===n.type&&6===t)n=r.pop();else{const e={type:t,children:[]};5===t&&(e.index=i,i++),n.children.push(e),r.push(n),n=e}}}2===n.type&&(n=r.pop());r.length;return t}(e),t.actionHandler),r},t.createElement=n;class o{constructor(e){this.source=e,this.index=0}eos(){return this.index>=this.source.length}next(){const e=this.peek();return this.advance(),e}peek(){return this.source[this.index]}advance(){this.index++}}function s(e){switch(e){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;default:return 0}}})),define(t[86],i([0,1,7,16,183,51,2,98]),(function(e,t,i,n,o,s,r,a){"use strict" +;Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalMouseMoveMonitor=t.standardMouseMoveMerger=void 0,t.standardMouseMoveMerger=function(e,t){let i=new s.StandardMouseEvent(t);return i.preventDefault(),{leftButton:i.leftButton,buttons:i.buttons,posx:i.posx,posy:i.posy}};t.GlobalMouseMoveMonitor=class{constructor(){this._hooks=new r.DisposableStore,this._mouseMoveEventMerger=null,this._mouseMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e){if(!this.isMonitoring())return;this._hooks.clear(),this._mouseMoveEventMerger=null,this._mouseMoveCallback=null;const t=this._onStopCallback;this._onStopCallback=null,e&&t&&t()}isMonitoring(){return!!this._mouseMoveEventMerger}startMonitoring(e,t,r,l,d){if(this.isMonitoring())return;this._mouseMoveEventMerger=r,this._mouseMoveCallback=l,this._onStopCallback=d +;const c=o.IframeUtils.getSameOriginWindowChain(),h=n.isIOS&&a.BrowserFeatures.pointerEvents?"pointermove":"mousemove",u=n.isIOS&&a.BrowserFeatures.pointerEvents?"pointerup":"mouseup",g=c.map(e=>e.window.document),p=i.getShadowRoot(e);p&&g.unshift(p);for(const e of g)this._hooks.add(i.addDisposableThrottledListener(e,h,e=>{e.buttons===t?this._mouseMoveCallback(e):this.stopMonitoring(!0)},(e,t)=>this._mouseMoveEventMerger(e,t))),this._hooks.add(i.addDisposableListener(e,u,e=>this.stopMonitoring(!0)));if(o.IframeUtils.hasDifferentOriginAncestor()){let e=c[c.length-1];this._hooks.add(i.addDisposableListener(e.window.document,"mouseout",e=>{"html"===new s.StandardMouseEvent(e).target.tagName.toLowerCase()&&this.stopMonitoring(!0)})),this._hooks.add(i.addDisposableListener(e.window.document,"mouseover",e=>{"html"===new s.StandardMouseEvent(e).target.tagName.toLowerCase()&&this.stopMonitoring(!0)})),this._hooks.add(i.addDisposableListener(e.window.document.body,"mouseleave",e=>{this.stopMonitoring(!0)}))}}}})) +;var a=this&&this.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r};define(t[58],i([0,1,19,2,7,96]),(function(e,t,i,n,o,s){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.Gesture=t.EventType=void 0,function(e){e.Tap="-monaco-gesturetap",e.Change="-monaco-gesturechange",e.Start="-monaco-gesturestart",e.End="-monaco-gesturesend",e.Contextmenu="-monaco-gesturecontextmenu"}(r=t.EventType||(t.EventType={}));class l extends n.Disposable{constructor(){super(),this.dispatched=!1,this.activeTouches={},this.handle=null,this.targets=[],this.ignoreTargets=[],this._lastSetTapCountTime=0,this._register(o.addDisposableListener(document,"touchstart",e=>this.onTouchStart(e),{passive:!1})), +this._register(o.addDisposableListener(document,"touchend",e=>this.onTouchEnd(e))),this._register(o.addDisposableListener(document,"touchmove",e=>this.onTouchMove(e),{passive:!1}))}static addTarget(e){return l.isTouchDevice()?(l.INSTANCE||(l.INSTANCE=new l),l.INSTANCE.targets.push(e),{dispose:()=>{l.INSTANCE.targets=l.INSTANCE.targets.filter(t=>t!==e)}}):n.Disposable.None}static ignoreTarget(e){return l.isTouchDevice()?(l.INSTANCE||(l.INSTANCE=new l),l.INSTANCE.ignoreTargets.push(e),{dispose:()=>{l.INSTANCE.ignoreTargets=l.INSTANCE.ignoreTargets.filter(t=>t!==e)}}):n.Disposable.None}static isTouchDevice(){return"ontouchstart"in window||navigator.maxTouchPoints>0||window.navigator.msMaxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){let t=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let i=0,n=e.targetTouches.length;i=l.HOLD_DELAY&&Math.abs(a.initialPageX-i.tail(a.rollingPageX))<30&&Math.abs(a.initialPageY-i.tail(a.rollingPageY))<30){let e=this.newGestureEvent(r.Contextmenu,a.initialTarget);e.pageX=i.tail(a.rollingPageX),e.pageY=i.tail(a.rollingPageY),this.dispatchEvent(e)}else if(1===n){let e=i.tail(a.rollingPageX),n=i.tail(a.rollingPageY),o=i.tail(a.rollingTimestamps)-a.rollingTimestamps[0],s=e-a.rollingPageX[0],r=n-a.rollingPageY[0];const l=this.targets.filter(e=>a.initialTarget instanceof Node&&e.contains(a.initialTarget));this.inertia(l,t,Math.abs(s)/o,s>0?1:-1,e,Math.abs(r)/o,r>0?1:-1,n)}this.dispatchEvent(this.newGestureEvent(r.End,a.initialTarget)),delete this.activeTouches[s.identifier]}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,t){let i=document.createEvent("CustomEvent");return i.initEvent(e,!1,!0),i.initialTarget=t,i.tapCount=0,i}dispatchEvent(e){if(e.type===r.Tap){const t=(new Date).getTime();let i=0 +;i=t-this._lastSetTapCountTime>l.CLEAR_TAP_COUNT_TIME?1:2,this._lastSetTapCountTime=t,e.tapCount=i}else e.type!==r.Change&&e.type!==r.Contextmenu||(this._lastSetTapCountTime=0);for(let t=0;t{e.initialTarget instanceof Node&&t.contains(e.initialTarget)&&(t.dispatchEvent(e),this.dispatched=!0)})}inertia(e,t,i,n,s,a,d,c){this.handle=o.scheduleAtNextAnimationFrame(()=>{let o=Date.now(),h=o-t,u=0,g=0,p=!0;i+=l.SCROLL_FRICTION*h,a+=l.SCROLL_FRICTION*h,i>0&&(p=!1,u=n*i*h),a>0&&(p=!1,g=d*a*h);let m=this.newGestureEvent(r.Change);m.translationX=u,m.translationY=g,e.forEach(e=>e.dispatchEvent(m)),p||this.inertia(e,o,i,n,s+u,a,d,c+g)})}onTouchMove(e){let t=Date.now();for(let n=0,o=e.changedTouches.length;n3&&(s.rollingPageX.shift(),s.rollingPageY.shift(),s.rollingTimestamps.shift()),s.rollingPageX.push(o.pageX),s.rollingPageY.push(o.pageY),s.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}}l.SCROLL_FRICTION=-.005,l.HOLD_DELAY=700,l.CLEAR_TAP_COUNT_TIME=400,a([s.memoize],l,"isTouchDevice",null),t.Gesture=l})),define(t[274],i([0,1,7]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RowCache=void 0;t.RowCache=class{constructor(e){this.renderers=e,this.cache=new Map}alloc(e){let t=this.getTemplateCache(e).pop();if(!t){const n=i.$(".monaco-list-row");t={domNode:n,templateId:e,templateData:this.getRenderer(e).renderTemplate(n)}}return t}release(e){e&&this.releaseRow(e)} +releaseRow(e){const{domNode:t,templateId:n}=e;t&&(i.removeClass(t,"scrolling"),function(e){try{e.parentElement&&e.parentElement.removeChild(e)}catch(e){}}(t)),this.getTemplateCache(n).push(e)}getTemplateCache(e){let t=this.cache.get(e);return t||(t=[],this.cache.set(e,t)),t}dispose(){this.cache.forEach((e,t)=>{for(const i of e){this.getRenderer(t).disposeTemplate(i.templateData),i.domNode=null,i.templateData=null}}),this.cache.clear()}getRenderer(e){const t=this.renderers.get(e);if(!t)throw new Error(`No renderer found for ${e}`);return t}}})),define(t[54],i([0,1,7,53,51,2,58]),(function(e,t,i,n,o,s,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=void 0;class a extends s.Disposable{onclick(e,t){this._register(i.addDisposableListener(e,i.EventType.CLICK,e=>t(new o.StandardMouseEvent(e))))}onmousedown(e,t){this._register(i.addDisposableListener(e,i.EventType.MOUSE_DOWN,e=>t(new o.StandardMouseEvent(e))))}onmouseover(e,t){ +this._register(i.addDisposableListener(e,i.EventType.MOUSE_OVER,e=>t(new o.StandardMouseEvent(e))))}onnonbubblingmouseout(e,t){this._register(i.addDisposableNonBubblingMouseOutListener(e,e=>t(new o.StandardMouseEvent(e))))}onkeydown(e,t){this._register(i.addDisposableListener(e,i.EventType.KEY_DOWN,e=>t(new n.StandardKeyboardEvent(e))))}onkeyup(e,t){this._register(i.addDisposableListener(e,i.EventType.KEY_UP,e=>t(new n.StandardKeyboardEvent(e))))}oninput(e,t){this._register(i.addDisposableListener(e,i.EventType.INPUT,t))}onblur(e,t){this._register(i.addDisposableListener(e,i.EventType.BLUR,t))}onfocus(e,t){this._register(i.addDisposableListener(e,i.EventType.FOCUS,t))}ignoreGesture(e){r.Gesture.ignoreTarget(e)}}t.Widget=a})),define(t[149],i([0,1,86,54,15,7]),(function(e,t,i,n,o,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ScrollbarArrow=t.ARROW_IMG_SIZE=void 0,t.ARROW_IMG_SIZE=11;class r extends n.Widget{constructor(e){super(),this._onActivate=e.onActivate, +this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",void 0!==e.top&&(this.bgDomNode.style.top="0px"),void 0!==e.left&&(this.bgDomNode.style.left="0px"),void 0!==e.bottom&&(this.bgDomNode.style.bottom="0px"),void 0!==e.right&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,s.addClasses(this.domNode,e.icon.classNames),this.domNode.style.position="absolute",this.domNode.style.width=t.ARROW_IMG_SIZE+"px",this.domNode.style.height=t.ARROW_IMG_SIZE+"px",void 0!==e.top&&(this.domNode.style.top=e.top+"px"),void 0!==e.left&&(this.domNode.style.left=e.left+"px"),void 0!==e.bottom&&(this.domNode.style.bottom=e.bottom+"px"),void 0!==e.right&&(this.domNode.style.right=e.right+"px"),this._mouseMoveMonitor=this._register(new i.GlobalMouseMoveMonitor), +this.onmousedown(this.bgDomNode,e=>this._arrowMouseDown(e)),this.onmousedown(this.domNode,e=>this._arrowMouseDown(e)),this._mousedownRepeatTimer=this._register(new o.IntervalTimer),this._mousedownScheduleRepeatTimer=this._register(new o.TimeoutTimer)}_arrowMouseDown(e){this._onActivate(),this._mousedownRepeatTimer.cancel(),this._mousedownScheduleRepeatTimer.cancelAndSet(()=>{this._mousedownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24)},200),this._mouseMoveMonitor.startMonitoring(e.target,e.buttons,i.standardMouseMoveMerger,e=>{},()=>{this._mousedownRepeatTimer.cancel(),this._mousedownScheduleRepeatTimer.cancel()}),e.preventDefault()}}t.ScrollbarArrow=r})),define(t[190],i([0,1,7,30,86,149,267,54,16]),(function(e,t,i,n,o,s,r,a,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractScrollbar=void 0;const d=140;class c extends a.Widget{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollbarState=e.scrollbarState, +this._visibilityController=this._register(new r.ScrollbarVisibilityController(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._mouseMoveMonitor=this._register(new o.GlobalMouseMoveMonitor),this._shouldRender=!0,this.domNode=n.createFastDomNode(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this.onmousedown(this.domNode.domNode,e=>this._domNodeMouseDown(e))}_createArrow(e){let t=this._register(new s.ScrollbarArrow(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,o){this.slider=n.createFastDomNode(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t), +"number"==typeof i&&this.slider.setWidth(i),"number"==typeof o&&this.slider.setHeight(o),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this.onmousedown(this.slider.domNode,e=>{e.leftButton&&(e.preventDefault(),this._sliderMouseDown(e,()=>{}))}),this.onclick(this.slider.domNode,e=>{e.leftButton&&e.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0, +this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodeMouseDown(e){e.target===this.domNode.domNode&&this._onMouseDown(e)}delegateMouseDown(e){let t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),n=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderMousePosition(e);i<=o&&o<=n?e.leftButton&&(e.preventDefault(),this._sliderMouseDown(e,()=>{})):this._onMouseDown(e)}_onMouseDown(e){let t,n +;if(e.target===this.domNode.domNode&&"number"==typeof e.browserEvent.offsetX&&"number"==typeof e.browserEvent.offsetY)t=e.browserEvent.offsetX,n=e.browserEvent.offsetY;else{const o=i.getDomNodePagePosition(this.domNode.domNode);t=e.posx-o.left,n=e.posy-o.top}this._setDesiredScrollPositionNow(this._scrollbarState.getDesiredScrollPositionFromOffset(this._mouseDownRelativePosition(t,n))),e.leftButton&&(e.preventDefault(),this._sliderMouseDown(e,()=>{}))}_sliderMouseDown(e,t){const i=this._sliderMousePosition(e),n=this._sliderOrthogonalMousePosition(e),s=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._mouseMoveMonitor.startMonitoring(e.target,e.buttons,o.standardMouseMoveMerger,e=>{const t=this._sliderOrthogonalMousePosition(e),o=Math.abs(t-n);if(l.isWindows&&o>d)return void this._setDesiredScrollPositionNow(s.getScrollPosition());const r=this._sliderMousePosition(e)-i;this._setDesiredScrollPositionNow(s.getDesiredScrollPositionFromDelta(r))},()=>{ +this.slider.toggleClassName("active",!1),this._host.onDragEnd(),t()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}}t.AbstractScrollbar=c})),define(t[59],i([0,1,24,8,40,16]),(function(e,t,i,n,o,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LRUCache=t.LinkedMap=t.ResourceMap=t.TernarySearchTree=t.UriIterator=t.PathIterator=t.StringIterator=void 0;class r{constructor(){this._value="",this._pos=0}reset(e){return this._value=e,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos0)n.left||(n.left=new d,n.left.segment=i.value()),n=n.left;else if(e<0)n.right||(n.right=new d,n.right.segment=i.value()),n=n.right;else{if(!i.hasNext())break;i.next(),n.mid||(n.mid=new d,n.mid.segment=i.value()),n=n.mid}}const o=n.value;return n.value=t,n.key=e,o}get(e){const t=this._iter.reset(e);let i=this._root;for(;i;){const e=t.cmp(i.segment);if(e>0)i=i.left;else if(e<0)i=i.right;else{if(!t.hasNext())break;t.next(),i=i.mid}}return i?i.value:void 0}findSubstr(e){const t=this._iter.reset(e);let i=this._root,n=void 0;for(;i;){const e=t.cmp(i.segment);if(e>0)i=i.left;else if(e<0)i=i.right;else{if(!t.hasNext())break +;t.next(),n=i.value||n,i=i.mid}}return i&&i.value||n}forEach(e){this._forEach(this._root,e)}_forEach(e,t){e&&(this._forEach(e.left,t),e.value&&t(e.value,e.key),this._forEach(e.mid,t),this._forEach(e.right,t))}}t.TernarySearchTree=c;class h{constructor(e,t){this[Symbol.toStringTag]="ResourceMap",e instanceof h?(this.map=new Map(e.map),this.toKey=null!=t?t:h.defaultToKey):(this.map=new Map,this.toKey=null!=e?e:h.defaultToKey)}set(e,t){return this.map.set(this.toKey(e),t),this}get(e){return this.map.get(this.toKey(e))}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,t){void 0!==t&&(e=e.bind(t));for(let[t,n]of this.map)e(n,i.URI.parse(t),this)}values(){return this.map.values()}*keys(){for(let e of this.map.keys())yield i.URI.parse(e)}*entries(){for(let e of this.map.entries())yield[i.URI.parse(e[0]),e[1]]}*[Symbol.iterator](){for(let e of this.map)yield[i.URI.parse(e[0]),e[1]]}}t.ResourceMap=h, +h.defaultToKey=e=>e.toString();class u{constructor(){this[Symbol.toStringTag]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var e;return null===(e=this._head)||void 0===e?void 0:e.value}get last(){var e;return null===(e=this._tail)||void 0===e?void 0:e.value}has(e){return this._map.has(e)}get(e,t=0){const i=this._map.get(e);if(i)return 0!==t&&this.touch(i,t),i.value}set(e,t,i=0){let n=this._map.get(e);if(n)n.value=t,0!==i&&this.touch(n,i);else{switch(n={key:e,value:t,next:void 0,previous:void 0},i){case 0:this.addItemLast(n);break;case 1:this.addItemFirst(n);break;case 2:default:this.addItemLast(n)}this._map.set(e,n),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){const t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){ +if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){const i=this._state;let n=this._head;for(;n;){if(t?e.bind(t)(n.value,n.key,this):e(n.value,n.key,this),this._state!==i)throw new Error("LinkedMap got modified during iteration.");n=n.next}}keys(){const e=this,t=this._state;let i=this._head;const n={[Symbol.iterator]:()=>n,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const e={value:i.key,done:!1};return i=i.next,e}return{value:void 0,done:!0}}};return n}values(){const e=this,t=this._state;let i=this._head;const n={[Symbol.iterator]:()=>n,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const e={value:i.value,done:!1};return i=i.next,e}return{value:void 0,done:!0}}};return n}entries(){const e=this,t=this._state;let i=this._head;const n={[Symbol.iterator]:()=>n,next(){ +if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const e={value:[i.key,i.value],done:!1};return i=i.next,e}return{value:void 0,done:!0}}};return n}[Symbol.iterator](){return this.entries()}trimOld(e){if(e>=this.size)return;if(0===e)return void this.clear();let t=this._head,i=this.size;for(;t&&i>e;)this._map.delete(t.key),t=t.next,i--;this._head=t,this._size=i,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(this._head||this._tail){if(!this._head)throw new Error("Invalid list");e.next=this._head,this._head.previous=e}else this._tail=e;this._head=e,this._state++}addItemLast(e){if(this._head||this._tail){if(!this._tail)throw new Error("Invalid list");e.previous=this._tail,this._tail.next=e}else this._head=e;this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){ +if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{const t=e.next,i=e.previous;if(!t||!i)throw new Error("Invalid list");t.previous=i,i.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(1===t||2===t)if(1===t){if(e===this._head)return;const t=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(t.previous=i,i.next=t),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(2===t){if(e===this._tail)return;const t=e.next,i=e.previous;e===this._head?(t.previous=void 0,this._head=t):(t.previous=i,i.next=t),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}toJSON(){const e=[];return this.forEach((t,i)=>{e.push([i,t])}),e}fromJSON(e){this.clear();for(const[t,i]of e)this.set(t,i)}}t.LinkedMap=u;t.LRUCache=class extends u{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){ +return this._limit}set limit(e){this._limit=e,this.checkTrim()}get(e,t=2){return super.get(e,t)}peek(e){return super.get(e,0)}set(e,t){return super.set(e,t,2),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}})),define(t[64],i([0,1,59,8]),(function(e,t,i,n){"use strict";function o(...e){return function(t,i){for(let n=0,o=e.length;n0?[{start:0,end:t.length}]:[]}.bind(void 0,!0),t.matchesContiguousSubString=s,t.matchesSubString=r,t.isUpper=l;const h=new Set;function u(e){return c(e)||h.has(e)}function g(e){return a(e)||l(e)||d(e)}function p(e,t){return 0===t.length?t=[e]:e.end===t[0].start?t[0].start=e.start:t.unshift(e),t}function m(e,t){for(let i=t;i0&&!g(e.charCodeAt(i-1)))return i}return e.length}function f(e,t,i,n){if(i===e.length)return[];if(n===t.length)return null;if(e[i]!==t[n].toLowerCase())return null;{let o=null,s=n+1 +;for(o=f(e,t,i+1,n+1);!o&&(s=m(t,s))60)return null;const i=function(e){let t=0,i=0,n=0,o=0,s=0;for(let r=0;r.2&&t<.8&&n>.6&&o<.2}(i)){if(!function(e){const{upperPercent:t,lowerPercent:i}=e;return 0===i&&t>.6}(i))return null;t=t.toLowerCase()}let n=null,o=0;for(e=e.toLowerCase();o0&&u(e.charCodeAt(i-1)))return i;return e.length}"`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?".split("").forEach(e=>h.add(e.charCodeAt(0))),t.matchesCamelCase=_,t.matchesWords=function(e,t,i=!1){if(!t||0===t.length)return null;let n=null,o=0;for(e=e.toLowerCase(),t=t.toLowerCase();o=0)l+=1,a+=Math.pow(2,i),d=i+1;else if(0!==a)break}return[l,a,s]},t.createMatches=function(e){if(void 0===e)return[];const t=e[1].toString(2),i=[];for(let n=e[2];ns(e,3)).join("|")}\n`;for(let n=0;n<=i;n++)r+=0===n?" |":`${t[n-1]}|`,r+=e[n].slice(0,o+1).map(e=>s(e.toString(),3)).join("|")+"\n";return r}function I(e,t){if(t<0||t>=e.length)return!1;switch(e.charCodeAt(t)){case 95:case 45:case 46:case 32:case 47:case 92:case 39:case 34:case 58:case 36:return!0;default:return!1}}function M(e,t,i){return t[e]!==i[e]} +function R(e,t,i,n,o,s){for(;ty?y:e.length,l=n.length>y?y:n.length;if(i>=a||s>=l||a-i>l-s)return;if(!R(t,i,a,o,s,l))return;let d=1,c=1,h=i,u=s,g=!1;for(d=1,h=i;h1&&(g=!0),x[d][c]=s;const r=L[d-1][c-1]+(s>1?1:s),a=L[d-1][c]+-1,l=L[d][c-1]+-1;l>=a?l>r?(L[d][c]=l,D[d][c]=4):l===r?(L[d][c]=l,D[d][c]=6):(L[d][c]=r,D[d][c]=2):a>r?(L[d][c]=a,D[d][c]=1):a===r?(L[d][c]=a,D[d][c]=3):(L[d][c]=r,D[d][c]=2)}return k&&function(e,t,i,n){e=e.substr(t),i=i.substr(n),console.log(N(L,e,e.length,i,i.length)),console.log(N(D,e,e.length,i,i.length)),console.log(N(x,e,e.length,i,i.length))}(e,i,n,s),(g||r)&&(A=0,F=-100,W=s,B=r,function e(t,i,n,o,s){if(A>=10||n<-25)return;let r=0;for(;t>0&&i>0;){const a=x[t][i],l=D[t][i];if(4===l)i-=1,s?n-=5:0!==o&&(n-=1),s=!1,r=0;else{if(!(2&l))return;if(4&l&&e(t,i-1,0!==o?n-1:n,o,s),n+=a,t-=1,i-=1,s=!0,o+=Math.pow(2,i+W),1===a){if(r+=1, +0===t&&!B)return}else n+=1+r*(a-1),r=0}}n-=i>=3?9:3*i;A+=1;n>F&&(F=n,P=o)}(d-1,c-1,a===l?1:0,0,!1),0!==A)?[F,P,s]:void 0}function O(e,t,i,n,o,s,r){return t[i]!==s[r]?-1:r===i-n?e[i]===o[r]?7:5:!M(r,o,s)||0!==r&&M(r-1,o,s)?!I(s,r)||0!==r&&I(s,r-1)?I(s,r-1)||function(e,t){if(t<0||t>=e.length)return!1;switch(e.charCodeAt(t)){case 32:case 9:return!0;default:return!1}}(s,r-1)?5:1:5:e[i]===o[r]?7:5}t.isPatternInWord=R,function(e){e.Default=Object.freeze([-100,0,0]),e.isDefault=function(e){return!e||-100===e[0]&&0===e[1]&&0===e[2]}}(t.FuzzyScore||(t.FuzzyScore={})),t.fuzzyScore=T;let A=0,P=0,F=0,W=0,B=!1;function V(e,t){if(t+1>=e.length)return;const i=e[t],n=e[t+1];return i!==n?e.slice(0,t)+n+i+e.slice(t+2):void 0}t.fuzzyScoreGracefulAggressive=function(e,t,i,n,o,s,r){return function(e,t,i,n,o,s,r,a){let l=T(e,t,i,n,o,s,a);if(l&&!r)return l;if(e.length>=3){const t=Math.min(7,e.length-1);for(let r=i+1;rl[0])&&(l=e))}}}return l +}(e,t,i,n,o,s,!0,r)}})),define(t[191],i([0,1,64,8]),(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.matchesFuzzyCodiconAware=t.parseCodicons=t.codiconStartMarker=void 0,t.codiconStartMarker="$(",t.parseCodicons=function(e){const i=e.indexOf(t.codiconStartMarker);return-1===i?{text:e}:function(e,i){const n=[];let o="";function s(e){if(e){o+=e;for(const t of e)n.push(c)}}let r,a,l=-1,d="",c=0,h=i;const u=e.length;s(e.substr(0,i));for(;ht?e:`\\${e}`)};const a=/\\\$\([a-z0-9\-]+?(?:~[a-z0-9\-]*?)?\)/gi;t.markdownEscapeEscapedCodicons=function(e){return e.replace(a,e=>`\\${e}`)},t.renderCodiconsRegex=/(\\)?\$\((([a-z0-9\-]+?)(?:~([a-z0-9\-]*?))?)\)/gi,t.renderCodicons=function(e){return e.replace(t.renderCodiconsRegex,(e,t,i,n,o)=>t?`$(${i})`:``)};const l=/(\s)?(\\)?\$\([a-z0-9\-]+?(?:~[a-z0-9\-]*?)?\)(\s)?/gi;t.stripCodicons=function(e){return-1===e.indexOf(i.codiconStartMarker)?e:e.replace(l,(e,t,i,n)=>i?e:t||n||"")}})),define(t[275],i([0,1,7,26]),(function(e,t,i,n){"use strict" +;Object.defineProperty(t,"__esModule",{value:!0}),t.renderCodiconsAsElement=void 0,t.renderCodiconsAsElement=function(e){const t=new Array;let o,s=0,r=0;for(;null!==(o=n.renderCodiconsRegex.exec(e));){r=o.index||0,t.push(e.substring(s,r)),s=(o.index||0)+o[0].length;const[,n,a,l,d]=o;t.push(n?`$(${a})`:i.$(`span.codicon.codicon-${l}${d?`.codicon-animation-${d}`:""}`))}return s";const s=this.text.substring(t,i.start);e+=this.supportCodicons?n.renderCodicons(o.escape(s)):o.escape(s),e+="",t=i.end}i.extraClasses?e+=``:e+='';const s=this.text.substring(i.start,i.end);e+=this.supportCodicons?n.renderCodicons(o.escape(s)):o.escape(s),e+="",t=i.end}if(t";const i=this.text.substring(t);e+=this.supportCodicons?n.renderCodicons(o.escape(i)):o.escape(i),e+=""}this.domNode.innerHTML=e,this.title?this.domNode.title=this.title:this.domNode.removeAttribute("title"),this.didEverRender=!0}static escapeNewLines(e,t){let i=0,n=0;return e.replace(/\r\n|\r|\n/g,(e,o)=>{n="\r\n"===e?-1:0,o+=i;for(const e of t)e.end<=o||(e.start>=o&&(e.start+=n),e.end>=o&&(e.end+=n));return i+=n,"⏎"})}}t.HighlightedLabel=s})), +define(t[276],i([0,1,51,190,149,184,26]),(function(e,t,i,n,o,s,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HorizontalScrollbar=void 0;const a=r.registerIcon("scrollbar-button-left",r.Codicon.triangleLeft),l=r.registerIcon("scrollbar-button-right",r.Codicon.triangleRight);class d extends n.AbstractScrollbar{constructor(e,t,n){const r=e.getScrollDimensions(),d=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new s.ScrollbarState(t.horizontalHasArrows?t.arrowSize:0,2===t.horizontal?0:t.horizontalScrollbarSize,2===t.vertical?0:t.verticalScrollbarSize,r.width,r.scrollWidth,d.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e}),t.horizontalHasArrows){let e=(t.arrowSize-o.ARROW_IMG_SIZE)/2,n=(t.horizontalScrollbarSize-o.ARROW_IMG_SIZE)/2;this._createArrow({className:"scra",icon:a,top:n,left:e,bottom:void 0,right:void 0,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize, +onActivate:()=>this._host.onMouseWheel(new i.StandardWheelEvent(null,1,0))}),this._createArrow({className:"scra",icon:l,top:n,left:void 0,bottom:void 0,right:e,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new i.StandardWheelEvent(null,-1,0))})}this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_mouseDownRelativePosition(e,t){return e}_sliderMousePosition(e){return e.posx}_sliderOrthogonalMousePosition(e){return e.posy}_updateScrollbarSize(e){ +this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}}t.HorizontalScrollbar=d})),define(t[277],i([0,1,51,190,149,184,26]),(function(e,t,i,n,o,s,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VerticalScrollbar=void 0;const a=r.registerIcon("scrollbar-button-up",r.Codicon.triangleUp),l=r.registerIcon("scrollbar-button-down",r.Codicon.triangleDown);class d extends n.AbstractScrollbar{constructor(e,t,n){const r=e.getScrollDimensions(),d=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new s.ScrollbarState(t.verticalHasArrows?t.arrowSize:0,2===t.vertical?0:t.verticalScrollbarSize,0,r.height,r.scrollHeight,d.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e}),t.verticalHasArrows){let e=(t.arrowSize-o.ARROW_IMG_SIZE)/2,n=(t.verticalScrollbarSize-o.ARROW_IMG_SIZE)/2;this._createArrow({className:"scra",icon:a,top:e,left:n,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize, +onActivate:()=>this._host.onMouseWheel(new i.StandardWheelEvent(null,0,1))}),this._createArrow({className:"scra",icon:l,top:void 0,left:n,bottom:e,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new i.StandardWheelEvent(null,0,-1))})}this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_mouseDownRelativePosition(e,t){return t}_sliderMousePosition(e){return e.posy}_sliderOrthogonalMousePosition(e){return e.posx}_updateScrollbarSize(e){ +this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}}t.VerticalScrollbar=d})),define(t[192],i([0,1,26]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.treeItemLoadingIcon=t.treeFilterClearIcon=t.treeFilterOnTypeOffIcon=t.treeFilterOnTypeOnIcon=t.treeItemExpandedIcon=void 0,t.treeItemExpandedIcon=i.registerIcon("tree-item-expanded",i.Codicon.chevronDown),t.treeFilterOnTypeOnIcon=i.registerIcon("tree-filter-on-type-on",i.Codicon.listFilter),t.treeFilterOnTypeOffIcon=i.registerIcon("tree-filter-on-type-off",i.Codicon.listSelection),t.treeFilterClearIcon=i.registerIcon("tree-filter-clear",i.Codicon.close),t.treeItemLoadingIcon=i.registerIcon("tree-item-loading",i.Codicon.loading)})),define(t[278],i([0,1,64,63,16,8]),(function(e,t,i,n,o,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pieceToQuery=t.prepareQuery=t.scoreFuzzy2=void 0;const r=[void 0,[]];function a(e,t,n,o){const s=i.fuzzyScore(t.original,t.originalLowercase,n,e,e.toLowerCase(),o,!0) +;return s?[s[0],i.createMatches(s)]:r}function l(e){const t=e.sort((e,t)=>e.start-t.start),i=[];let n=void 0;for(const e of t)n&&d(n,e)?(n.start=Math.min(n.start,e.start),n.end=Math.max(n.end,e.end)):(n=e,i.push(e));return i}function d(e,t){return!(e.end1?function(e,t,i,n){let o=0;const s=[];for(const l of t){const[t,d]=a(e,l,i,n);if("number"!=typeof t)return r;o+=t,s.push(...d)}return[o,l(s)]}(e,o.values,i,n):a(e,t,i,n)};const c=" ";function h(e){"string"!=typeof e&&(e="");const t=e.toLowerCase(),{pathNormalized:i,normalized:o,normalizedLowercase:s}=u(e),r=i.indexOf(n.sep)>=0;let a=void 0;const l=e.split(c);if(l.length>1)for(const e of l){const{pathNormalized:t,normalized:i,normalizedLowercase:n}=u(e);i&&(a||(a=[]),a.push({original:e,originalLowercase:e.toLowerCase(),pathNormalized:t,normalized:i,normalizedLowercase:n}))}return{original:e,originalLowercase:t,pathNormalized:i,normalized:o, +normalizedLowercase:s,values:a,containsPathSeparator:r}}function u(e){let t;t=o.isWindows?e.replace(/\//g,n.sep):e.replace(/\\/g,n.sep);const i=s.stripWildcards(t).replace(/\s/g,"");return{pathNormalized:t,normalized:i,normalizedLowercase:i.toLowerCase()}}t.prepareQuery=h,t.pieceToQuery=function(e){return Array.isArray(e)?h(e.map(e=>e.original).join(c)):h(e.original)}})),define(t[193],i([0,1,19,8,187,63,59,15]),(function(e,t,i,n,o,s,r,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isRelativePattern=t.parse=t.match=t.splitGlobAware=void 0;const l="**",d="/",c="[/\\\\]",h="[^/\\\\]",u=/\//g;function g(e){switch(e){case 0:return"";case 1:return`${h}*?`;default:return`(?:${c}|${h}+${c}|${c}${h}+)*?`}}function p(e,t){if(!e)return[];const i=[];let n=!1,o=!1,s="";for(const r of e){switch(r){case t:if(!n&&!o){i.push(s),s="";continue}break;case"{":n=!0;break;case"}":n=!1;break;case"[":o=!0;break;case"]":o=!1}s+=r}return s&&i.push(s),i}t.splitGlobAware=p +;const m=/^\*\*\/\*\.[\w\.-]+$/,f=/^\*\*\/([\w\.-]+)\/?$/,_=/^{\*\*\/[\*\.]?[\w\.-]+\/?(,\*\*\/[\*\.]?[\w\.-]+\/?)*}$/,v=/^{\*\*\/[\*\.]?[\w\.-]+(\/(\*\*)?)?(,\*\*\/[\*\.]?[\w\.-]+(\/(\*\*)?)?)*}$/,C=/^\*\*((\/[\w\.-]+)+)\/?$/,b=/^([\w\.-]+(\/[\w\.-]+)*)\/?$/,S=new r.LRUCache(1e4),w=function(){return!1},y=function(){return null};function E(e,t){if(!e)return y;let o;const s=`${o=(o="string"!=typeof e?e.pattern:e).trim()}_${!!t.trimForExclusions}`;let r,a=S.get(s);if(a)return L(a,e);if(m.test(o)){const e=o.substr(4);a=function(t,i){return"string"==typeof t&&t.endsWith(e)?o:null}}else a=(r=f.exec(x(o,t)))?function(e,t){const i=`/${e}`,n=`\\${e}`,o=function(o,s){return"string"!=typeof o?null:s?s===e?t:null:o===e||o.endsWith(i)||o.endsWith(n)?t:null},s=[e];return o.basenames=s,o.patterns=[t],o.allBasenames=s,o}(r[1],o):(t.trimForExclusions?v:_).test(o)?function(e,t){const n=I(e.slice(1,-1).split(",").map(e=>E(e,t)).filter(e=>e!==y),e),o=n.length;if(!o)return y;if(1===o)return n[0];const s=function(t,i){ +for(let o=0,s=n.length;o!!e.allBasenames);r&&(s.allBasenames=r.allBasenames);const a=n.reduce((e,t)=>t.allPaths?e.concat(t.allPaths):e,[]);a.length&&(s.allPaths=a);return s}(o,t):(r=C.exec(x(o,t)))?D(r[1].substr(1),o,!0):(r=b.exec(x(o,t)))?D(r[1],o,!1):function(e){try{const t=new RegExp(`^${function e(t){if(!t)return"";let i="";const o=p(t,d);if(o.every(e=>e===l))i=".*";else{let t=!1;o.forEach((s,r)=>{if(s===l)return void(t||(i+=g(2),t=!0));let a=!1,u="",m=!1,f="";for(const t of s)if("}"!==t&&a)u+=t;else if(!m||"]"===t&&f)switch(t){case"{":a=!0;continue;case"[":m=!0;continue;case"}":const o=`(?:${p(u,",").map(t=>e(t)).join("|")})`;i+=o,a=!1,u="";break;case"]":i+="["+f+"]",m=!1,f="";break;case"?":i+=h;continue;case"*":i+=g(1);continue;default:i+=n.escapeRegExpCharacters(t)}else{let e;f+=e="-"===t?t:"^"!==t&&"!"!==t||f?t===d?"":n.escapeRegExpCharacters(t):"^"}r(function(e,t,i){if(!1===t)return y;const n=E(e,i);if(n===y)return y;if("boolean"==typeof t)return n;if(t){const i=t.when;if("string"==typeof i){const t=(t,o,s,r)=>{ +if(!r||!n(t,o))return null;const l=r(i.replace("$(basename)",s));return a.isThenable(l)?l.then(t=>t?e:null):l?e:null};return t.requiresSiblings=!0,t}}return n})(i,e[i],t)).filter(e=>e!==y)),o=n.length;if(!o)return y;if(!n.some(e=>!!e.requiresSiblings)){if(1===o)return n[0];const e=function(e,t){for(let i=0,o=n.length;i!!e.allBasenames);t&&(e.allBasenames=t.allBasenames);const s=n.reduce((e,t)=>t.allPaths?e.concat(t.allPaths):e,[]);return s.length&&(e.allPaths=s),e}const r=function(e,t,i){let o=void 0;for(let r=0,a=n.length;r!!e.allBasenames);l&&(r.allBasenames=l.allBasenames);const d=n.reduce((e,t)=>t.allPaths?e.concat(t.allPaths):e,[]);d.length&&(r.allPaths=d);return r}(e,t)}function N(e){const t=e;return t&&"string"==typeof t.base&&"string"==typeof t.pattern} +function I(e,t){const i=e.filter(e=>!!e.basenames);if(i.length<2)return e;const n=i.reduce((e,t)=>{const i=t.basenames;return i?e.concat(i):e},[]);let o;if(t){o=[];for(let e=0,i=n.length;e{const i=t.patterns;return i?e.concat(i):e},[]);const s=function(e,t){if("string"!=typeof e)return null;if(!t){let i;for(i=e.length;i>0;i--){const t=e.charCodeAt(i-1);if(47===t||92===t)break}t=e.substr(i)}const i=n.indexOf(t);return-1!==i?o[i]:null};s.basenames=n,s.patterns=o,s.allBasenames=n;const r=e.filter(e=>!e.basenames);return r.push(s),r}t.match=function(e,t,i){return!(!e||"string"!=typeof t)&&k(e)(t,void 0,i)},t.parse=k,t.isRelativePattern=N})),define(t[78],i([0,1,19,26,12]),(function(e,t,i,n,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseHrefAndDimensions=t.removeMarkdownEscapes=t.markedStringsEquals=t.isMarkdownString=t.isEmptyMarkdownString=t.MarkdownString=void 0;class s{constructor(e="",t=!1){var i,n;if(this._value=e, +"string"!=typeof this._value)throw o.illegalArgument("value");"boolean"==typeof t?(this._isTrusted=t,this._supportThemeIcons=!1):(this._isTrusted=null!==(i=t.isTrusted)&&void 0!==i&&i,this._supportThemeIcons=null!==(n=t.supportThemeIcons)&&void 0!==n&&n)}get value(){return this._value}get isTrusted(){return this._isTrusted}get supportThemeIcons(){return this._supportThemeIcons}appendText(e){return this._value+=(this._supportThemeIcons?n.escapeCodicons(e):e).replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&").replace(/\n/g,"\n\n"),this}appendMarkdown(e){return this._value+=e,this}appendCodeblock(e,t){return this._value+="\n```",this._value+=e,this._value+="\n",this._value+=t,this._value+="\n```\n",this}}function r(e){return e instanceof s||!(!e||"object"!=typeof e)&&!("string"!=typeof e.value||"boolean"!=typeof e.isTrusted&&void 0!==e.isTrusted||"boolean"!=typeof e.supportThemeIcons&&void 0!==e.supportThemeIcons)}function a(e,t){ +return e===t||!(!e||!t)&&(e.value===t.value&&e.isTrusted===t.isTrusted&&e.supportThemeIcons===t.supportThemeIcons)}t.MarkdownString=s,t.isEmptyMarkdownString=function e(t){return r(t)?!t.value:!Array.isArray(t)||t.every(e)},t.isMarkdownString=r,t.markedStringsEquals=function(e,t){return!e&&!t||!(!e||!t)&&(Array.isArray(e)&&Array.isArray(t)?i.equals(e,t,a):!(!r(e)||!r(t))&&a(e,t))},t.removeMarkdownEscapes=function(e){return e?e.replace(/\\([\\`*_{}[\]()#+\-.!])/g,"$1"):e},t.parseHrefAndDimensions=function(e){const t=[],i=e.split("|").map(e=>e.trim());e=i[0];const n=i[1];if(n){const e=/height=(\d+)/.exec(n),i=/width=(\d+)/.exec(n),o=e?e[1]:"",s=i?i[1]:"",r=isFinite(parseInt(s)),a=isFinite(parseInt(o));r&&t.push(`width="${s}"`),a&&t.push(`height="${o}"`)}return{href:e,dimensions:t}}})),define(t[41],i([0,1,187,63,24,8,40,16]),(function(e,t,i,n,o,s,r,a){"use strict";function l(e){return o.uriToFsPath(e,!0)}Object.defineProperty(t,"__esModule",{value:!0}), +t.DataUri=t.isEqualAuthority=t.resolvePath=t.relativePath=t.normalizePath=t.joinPath=t.dirname=t.basename=t.basenameOrAuthority=t.isEqual=t.extUri=t.ExtUri=t.originalFSPath=void 0,t.originalFSPath=l;class d{constructor(e){this._ignorePathCasing=e}compare(e,t,i=!1){return e===t?0:s.compare(this.getComparisonKey(e,i),this.getComparisonKey(t,i))}isEqual(e,t,i=!1){return e===t||!(!e||!t)&&this.getComparisonKey(e,i)===this.getComparisonKey(t,i)}getComparisonKey(e,t=!1){return e.with({path:this._ignorePathCasing(e)?e.path.toLowerCase():void 0,fragment:t?null:void 0}).toString()}joinPath(e,...t){return o.URI.joinPath(e,...t)}basenameOrAuthority(e){return t.basename(e)||e.authority}basename(e){return n.posix.basename(e.path)}dirname(e){if(0===e.path.length)return e;let t;return e.scheme===r.Schemas.file?t=o.URI.file(n.dirname(l(e))).path:(t=n.posix.dirname(e.path),e.authority&&t.length&&47!==t.charCodeAt(0)&&(console.error(`dirname("${e.toString})) resulted in a relative path`),t="/")),e.with({path:t})} +normalizePath(e){if(!e.path.length)return e;let t;return t=e.scheme===r.Schemas.file?o.URI.file(n.normalize(l(e))).path:n.posix.normalize(e.path),e.with({path:t})}relativePath(e,o){if(e.scheme!==o.scheme||!t.isEqualAuthority(e.authority,o.authority))return;if(e.scheme===r.Schemas.file){const t=n.relative(l(e),l(o));return a.isWindows?i.toSlashes(t):t}let s=e.path||"/",d=o.path||"/";if(this._ignorePathCasing(e)){let e=0;for(const t=Math.min(s.length,d.length);e!1),t.isEqual=t.extUri.isEqual.bind(t.extUri), +t.basenameOrAuthority=t.extUri.basenameOrAuthority.bind(t.extUri),t.basename=t.extUri.basename.bind(t.extUri),t.dirname=t.extUri.dirname.bind(t.extUri),t.joinPath=t.extUri.joinPath.bind(t.extUri),t.normalizePath=t.extUri.normalizePath.bind(t.extUri),t.relativePath=t.extUri.relativePath.bind(t.extUri),t.resolvePath=t.extUri.resolvePath.bind(t.extUri),t.isEqualAuthority=t.extUri.isEqualAuthority.bind(t.extUri),function(e){e.META_DATA_LABEL="label",e.META_DATA_DESCRIPTION="description",e.META_DATA_SIZE="size",e.META_DATA_MIME="mime",e.parseMetaData=function(t){const i=new Map;t.path.substring(t.path.indexOf(";")+1,t.path.lastIndexOf(";")).split(";").forEach(e=>{const[t,n]=e.split(":");t&&n&&i.set(t,n)});const n=t.path.substring(0,t.path.indexOf(";"));return n&&i.set(e.META_DATA_MIME,n),i}}(t.DataUri||(t.DataUri={}))})),define(t[279],i([0,1,7,148,12,78,97,657,658,189,37,8,24,40,26,41,51]),(function(e,t,i,n,o,s,r,a,l,d,c,h,u,g,p,m,f){"use strict";Object.defineProperty(t,"__esModule",{value:!0}), +t.renderMarkdown=void 0,t.renderMarkdown=function(e,t={},_={}){var v;const C=n.createElement(t),b=function(t){let i;try{i=d.parse(decodeURIComponent(t))}catch(e){}return i?(i=c.cloneAndChange(i,t=>e.uris&&e.uris[t]?u.URI.revive(e.uris[t]):void 0),encodeURIComponent(JSON.stringify(i))):t},S=function(t,n){const o=e.uris&&e.uris[t];if(!o)return t;let s=u.URI.revive(o);return u.URI.parse(t).toString()===s.toString()?t:n?i.asDomUri(s).toString(!0):(s.query&&(s=s.with({query:b(s.query)})),s.toString())};let w;const y=new Promise(e=>w=e),E=new a.Renderer;E.image=(e,i,n)=>{let o=[],r=[];if(e){({href:e,dimensions:o}=s.parseHrefAndDimensions(e)),e=S(e,!0);try{const i=u.URI.parse(e);t.baseUrl&&i.scheme===g.Schemas.file&&(e=m.resolvePath(t.baseUrl,e).toString())}catch(e){}r.push(`src="${e}"`)}return n&&r.push(`alt="${n}"`),i&&r.push(`title="${i}"`),o.length&&(r=r.concat(o)),""},E.link=(i,n,o)=>{if(i===o&&(o=s.removeMarkdownEscapes(o)),i=S(i,!1),t.baseUrl){ +/^\w[\w\d+.-]*:/.test(i)||(i=m.resolvePath(t.baseUrl,i).toString())}return n=s.removeMarkdownEscapes(n),!(i=s.removeMarkdownEscapes(i))||i.match(/^data:|javascript:/i)||i.match(/^command:/i)&&!e.isTrusted||i.match(/^command:(\/\/\/)?_workbench\.downloadResource/i)?o:`
    /g,">").replace(/"/g,""").replace(/'/g,"'")}" title="${n||i}">${o}`},E.paragraph=t=>`

    ${e.supportThemeIcons?p.renderCodicons(t):t}

    `,t.codeBlockRenderer&&(E.code=(e,i)=>{const n=t.codeBlockRenderer(i,e),o=r.defaultGenerator.nextId(),s=Promise.all([n,y]).then(e=>{const t=e[0],i=C.querySelector(`div[data-code="${o}"]`);i&&(i.innerHTML=t)}).catch(e=>{});return t.codeBlockRenderCallback&&s.then(t.codeBlockRenderCallback),`
    ${h.escape(e)}
    `});const L=t.actionHandler;L&&[i.EventType.CLICK,i.EventType.AUXCLICK].forEach(e=>{L.disposeables.add(i.addDisposableListener(C,e,e=>{const t=new f.StandardMouseEvent(e) +;if(!t.leftButton&&!t.middleButton)return;let i=t.target;if("A"===i.tagName||(i=i.parentElement)&&"A"===i.tagName)try{const e=i.dataset.href;e&&L.callback(e,t)}catch(e){o.onUnexpectedError(e)}finally{t.preventDefault()}}))}),_.sanitizer=t=>{return(e.isTrusted?t.match(/^()|(<\/\s*span>)$/):void 0)?t:""},_.sanitize=!0,_.renderer=E;const x=[g.Schemas.http,g.Schemas.https,g.Schemas.mailto,g.Schemas.data,g.Schemas.file,g.Schemas.vscodeRemote,g.Schemas.vscodeRemoteResource];e.isTrusted&&x.push(g.Schemas.command);let D=null!==(v=e.value)&&void 0!==v?v:"";D.length>1e5&&(D=`${D.substr(0,1e5)}…`);const k=a.parse(e.supportThemeIcons?p.markdownEscapeEscapedCodicons(D):D,_);return C.innerHTML=l.insane(k,{allowedSchemes:x,allowedTags:["ul","li","p","code","blockquote","ol","h1","h2","h3","h4","h5","h6","hr","em","pre","table","thead","tbody","tr","th","td","div","del","a","strong","br","img","span"],allowedAttributes:{a:["href","name","target","data-href"],img:["src","title","alt","width","height"], +div:["class","data-code"],span:["class","style"],th:["align"],td:["align"]},filter:function(t){return"span"!==t.tag||!e.isTrusted||1!==Object.keys(t.attrs).length||(t.attrs.style?!!t.attrs.style.match(/^(color\:#[0-9a-fA-F]+;)?(background-color\:#[0-9a-fA-F]+;)?$/):!!t.attrs.class&&!!t.attrs.class.match(/^codicon codicon-[a-z\-]+( codicon-animation-[a-z\-]+)?$/))}}),w(),C}})),define(t[151],i([0,1,24,63,8,40,16,41]),(function(e,t,i,n,o,s,r,a){"use strict";function l(e){return!(!r.isWindows||!e||":"!==e[1])}function d(e){return l(e)?e.charAt(0).toUpperCase()+e.slice(1):e}Object.defineProperty(t,"__esModule",{value:!0}),t.tildify=t.normalizeDriveLetter=t.getBaseLabel=t.getPathLabel=void 0,t.getPathLabel=function(e,t,o){if("string"==typeof e&&(e=i.URI.file(e)),o){const t=o.getWorkspaceFolder(e);if(t){const i=o.getWorkspace().folders.length>1;let n;if(n=a.isEqual(t.uri,e)?"":a.relativePath(t.uri,e),i){const e=t.name?t.name:a.basename(t.uri);n=n?e+" • "+n:e}return n}} +if(e.scheme!==s.Schemas.file&&e.scheme!==s.Schemas.untitled)return e.with({query:null,fragment:null}).toString(!0);if(l(e.fsPath))return n.normalize(d(e.fsPath));let c=n.normalize(e.fsPath);return!r.isWindows&&(null==t?void 0:t.userHome)&&(c=h(c,t.userHome.fsPath)),c},t.getBaseLabel=function(e){if(!e)return;"string"==typeof e&&(e=i.URI.file(e));const t=a.basename(e)||(e.scheme===s.Schemas.file?e.fsPath:e.path);return l(t)?d(t):t},t.normalizeDriveLetter=d;let c=Object.create(null);function h(e,t){if(r.isWindows||!e||!t)return e;let i=c.original===t?c.normalized:void 0;return i||(i=`${o.rtrim(t,n.posix.sep)}${n.posix.sep}`,c={original:t,normalized:i}),(r.isLinux?e.startsWith(i):o.startsWithIgnoreCase(e,i))&&(e=`~/${e.substr(i.length)}`),e}t.tildify=h})),define(t[280],i([0,1,63,8,193,40,41]),(function(e,t,i,n,o,s,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.guessMimeTypes=t.registerTextMime=t.MIME_UNKNOWN=t.MIME_TEXT=void 0,t.MIME_TEXT="text/plain",t.MIME_UNKNOWN="application/unknown" +;let a=[],l=[],d=[];function c(e,t,i){let n=null,s=null,r=null;for(let a=i.length-1;a>=0;a--){const l=i[a];if(t===l.filenameLowercase){n=l;break}if(l.filepattern&&(!s||l.filepattern.length>s.filepattern.length)){const i=l.filepatternOnPath?e:t;o.match(l.filepatternLowercase,i)&&(s=l)}l.extension&&(!r||l.extension.length>r.extension.length)&&t.endsWith(l.extensionLowercase)&&(r=l)}return n?n.mime:s?s.mime:r?r.mime:null}t.registerTextMime=function(e,t=!1){const n=function(e){return{id:e.id,mime:e.mime,filename:e.filename,extension:e.extension,filepattern:e.filepattern,firstline:e.firstline,userConfigured:e.userConfigured,filenameLowercase:e.filename?e.filename.toLowerCase():void 0,extensionLowercase:e.extension?e.extension.toLowerCase():void 0,filepatternLowercase:e.filepattern?e.filepattern.toLowerCase():void 0,filepatternOnPath:!!e.filepattern&&e.filepattern.indexOf(i.posix.sep)>=0}}(e);a.push(n),n.userConfigured?d.push(n):l.push(n),t&&!n.userConfigured&&a.forEach(e=>{ +e.mime===n.mime||e.userConfigured||(n.extension&&e.extension===n.extension&&console.warn(`Overwriting extension <<${n.extension}>> to now point to mime <<${n.mime}>>`),n.filename&&e.filename===n.filename&&console.warn(`Overwriting filename <<${n.filename}>> to now point to mime <<${n.mime}>>`),n.filepattern&&e.filepattern===n.filepattern&&console.warn(`Overwriting filepattern <<${n.filepattern}>> to now point to mime <<${n.mime}>>`),n.firstline&&e.firstline===n.firstline&&console.warn(`Overwriting firstline <<${n.firstline}>> to now point to mime <<${n.mime}>>`))})},t.guessMimeTypes=function(e,o){let h;if(e)switch(e.scheme){case s.Schemas.file:h=e.fsPath;break;case s.Schemas.data:h=r.DataUri.parseMetaData(e).get(r.DataUri.META_DATA_LABEL);break;default:h=e.path}if(!h)return[t.MIME_UNKNOWN];h=h.toLowerCase();const u=i.basename(h),g=c(h,u,d);if(g)return[g,t.MIME_TEXT];const p=c(h,u,l);if(p)return[p,t.MIME_TEXT];if(o){const e=function(e){n.startsWithUTF8BOM(e)&&(e=e.substr(1)) +;if(e.length>0)for(let t=a.length-1;t>=0;t--){const i=a[t];if(!i.firstline)continue;const n=e.match(i.firstline);if(n&&n.length>0)return i.mime}return null}(o);if(e)return[e,t.MIME_TEXT]}return[t.MIME_UNKNOWN]}})),define(t[194],i([0,1,12,2,16,23]),(function(e,t,i,n,o,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.create=t.SimpleWorkerServer=t.SimpleWorkerClient=t.logOnceWebWorkerWarning=void 0;const r="$initialize";let a=!1;t.logOnceWebWorkerWarning=function(e){o.isWeb&&(a||(a=!0,console.warn("Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/Microsoft/monaco-editor#faq")),console.warn(e.message))};class l{constructor(e){this._workerId=-1,this._handler=e,this._lastSentReq=0,this._pendingReplies=Object.create(null)}setWorkerId(e){this._workerId=e}sendMessage(e,t){let i=String(++this._lastSentReq);return new Promise((n,o)=>{this._pendingReplies[i]={resolve:n,reject:o},this._send({ +vsWorker:this._workerId,req:i,method:e,args:t})})}handleMessage(e){e&&e.vsWorker&&(-1!==this._workerId&&e.vsWorker!==this._workerId||this._handleMessage(e))}_handleMessage(e){if(e.seq){let t=e;if(!this._pendingReplies[t.seq])return void console.warn("Got reply to unknown seq");let i=this._pendingReplies[t.seq];if(delete this._pendingReplies[t.seq],t.err){let e=t.err;return t.err.$isError&&((e=new Error).name=t.err.name,e.message=t.err.message,e.stack=t.err.stack),void i.reject(e)}return void i.resolve(t.res)}let t=e,n=t.req;this._handler.handleMessage(t.method,t.args).then(e=>{this._send({vsWorker:this._workerId,seq:n,res:e,err:void 0})},e=>{e.detail instanceof Error&&(e.detail=i.transformErrorForSerialization(e.detail)),this._send({vsWorker:this._workerId,seq:n,res:void 0,err:i.transformErrorForSerialization(e)})})}_send(e){let t=[];if(e.req){const i=e;for(let e=0;e{this._protocol.handleMessage(e)},e=>{n&&n(e)})),this._protocol=new l({sendMessage:(e,t)=>{this._worker.postMessage(e,t)},handleMessage:(e,t)=>{if("function"!=typeof i[e])return Promise.reject(new Error("Missing method "+e+" on main thread host."));try{return Promise.resolve(i[e].apply(i,t))}catch(e){return Promise.reject(e)}}}),this._protocol.setWorkerId(this._worker.getId());let o=null;void 0!==self.require&&"function"==typeof self.require.getConfig?o=self.require.getConfig():void 0!==self.requirejs&&(o=self.requirejs.s.contexts._.config);const a=s.getAllMethodNames(i);this._onModuleLoaded=this._protocol.sendMessage(r,[this._worker.getId(),JSON.parse(JSON.stringify(o)),t,a]);const d=(e,t)=>this._request(e,t);this._lazyProxy=new Promise((e,i)=>{n=i,this._onModuleLoaded.then(t=>{e(s.createProxyObject(t,d))},e=>{i(e), +this._onError("Worker failed to load "+t,e)})})}getProxyObject(){return this._lazyProxy}_request(e,t){return new Promise((i,n)=>{this._onModuleLoaded.then(()=>{this._protocol.sendMessage(e,t).then(i,n)},n)})}_onError(e,t){console.error(e),console.info(t)}}t.SimpleWorkerClient=d;class c{constructor(e,t){this._requestHandlerFactory=t,this._requestHandler=null,this._protocol=new l({sendMessage:(t,i)=>{e(t,i)},handleMessage:(e,t)=>this._handleMessage(e,t)})}onmessage(e){this._protocol.handleMessage(e)}_handleMessage(e,t){if(e===r)return this.initialize(t[0],t[1],t[2],t[3]);if(!this._requestHandler||"function"!=typeof this._requestHandler[e])return Promise.reject(new Error("Missing requestHandler or method: "+e));try{return Promise.resolve(this._requestHandler[e].apply(this._requestHandler,t))}catch(e){return Promise.reject(e)}}initialize(e,t,i,n){this._protocol.setWorkerId(e);const o=s.createProxyObject(n,(e,t)=>this._protocol.sendMessage(e,t)) +;return this._requestHandlerFactory?(this._requestHandler=this._requestHandlerFactory(o),Promise.resolve(s.getAllMethodNames(this._requestHandler))):(t&&(void 0!==t.baseUrl&&delete t.baseUrl,void 0!==t.paths&&void 0!==t.paths.vs&&delete t.paths.vs,t.catchError=!0,self.require.config(t)),new Promise((e,t)=>{self.require([i],i=>{this._requestHandler=i.create(o),this._requestHandler?e(s.getAllMethodNames(this._requestHandler)):t(new Error("No RequestHandler!"))},t)}))}}t.SimpleWorkerServer=c,t.create=function(e){return new c(e,null)}})),define(t[195],i([0,1]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ItemActivation=t.NO_KEY_MODS=void 0,t.NO_KEY_MODS={ctrlCmd:!1,alt:!1},function(e){e[e.NONE=0]="NONE",e[e.FIRST=1]="FIRST",e[e.SECOND=2]="SECOND",e[e.LAST=3]="LAST"}(t.ItemActivation||(t.ItemActivation={}))})),define(t[281],i([0,1,16,194]),(function(e,t,i,n){"use strict";function o(t,i,n=!1){if(n||/^((http:)|(https:)|(file:))/.test(t)){ +const o=String(window.location),s=o.substr(0,o.length-window.location.hash.length-window.location.search.length-window.location.pathname.length);if(n||t.substring(0,s.length)!==s){const o="vs/base/worker/defaultWorkerFactory.js",s=`/*${i}*/self.MonacoEnvironment={baseUrl: '${e.toUrl(o).slice(0,-o.length)}'};importScripts('${t}');/*${i}*/`;if(n){return`data:text/javascript;charset=utf-8,${encodeURIComponent(s)}`}const r=new Blob([s],{type:"application/javascript"});return URL.createObjectURL(r)}}return t+"#"+i}Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultWorkerFactory=t.getWorkerBootstrapUrl=void 0,t.getWorkerBootstrapUrl=o;class s{constructor(t,n,s,r,a){this.id=n;const l=function(t,n){if(i.globals.MonacoEnvironment){if("function"==typeof i.globals.MonacoEnvironment.getWorker)return i.globals.MonacoEnvironment.getWorker(t,n);if("function"==typeof i.globals.MonacoEnvironment.getWorkerUrl)return new Worker(i.globals.MonacoEnvironment.getWorkerUrl(t,n))}if("function"==typeof e){ +const i=o(e.toUrl("./"+t),n);return new Worker(i,{name:n})}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}("workerMain.js",s);"function"==typeof l.then?this.worker=l:this.worker=Promise.resolve(l),this.postMessage(t,[]),this.worker.then(e=>{e.onmessage=function(e){r(e.data)},e.onmessageerror=a,"function"==typeof e.addEventListener&&e.addEventListener("error",a)})}getId(){return this.id}postMessage(e,t){this.worker&&this.worker.then(i=>i.postMessage(e,t))}dispose(){this.worker&&this.worker.then(e=>e.terminate()),this.worker=null}}class r{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,i){let o=++r.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new s(e,o,this._label||"anonymous"+o,t,e=>{n.logOnceWebWorkerWarning(e),this._webWorkerFailedBeforeError=e,i(e)})}}t.DefaultWorkerFactory=r,r.LAST_WORKER_ID=0})),define(t[196],i([9]),{}),define(t[282],i([9]),{}), +define(t[48],i([0,1,16,7,282]),(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.status=t.alert=t.setARIAContainer=void 0;const o=2e4;let s,r,a,l,d;function c(e){s&&(r.textContent!==e?(n.clearNode(a),h(r,e)):(n.clearNode(r),h(a,e)))}function h(e,t){n.clearNode(e),t.length>o&&(t=t.substr(0,o)),e.textContent=t,e.style.visibility="hidden",e.style.visibility="visible"}t.setARIAContainer=function(e){(s=document.createElement("div")).className="monaco-aria-container";const t=()=>{const e=document.createElement("div");return e.className="monaco-alert",e.setAttribute("role","alert"),e.setAttribute("aria-atomic","true"),s.appendChild(e),e};r=t(),a=t();const i=()=>{const e=document.createElement("div");return e.className="monaco-status",e.setAttribute("role","complementary"),e.setAttribute("aria-live","polite"),e.setAttribute("aria-atomic","true"),s.appendChild(e),e};l=i(),d=i(),e.appendChild(s)},t.alert=c,t.status=function(e){s&&(i.isMacintosh?c(e):l.textContent!==e?(n.clearNode(d), +h(l,e)):(n.clearNode(l),h(d,e)))}})),define(t[283],i([9]),{}),define(t[284],i([0,1,7,53,29,37,4,2,58,275,283]),(function(e,t,i,n,o,s,r,a,l,d){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Button=void 0;const c={buttonBackground:o.Color.fromHex("#0E639C"),buttonHoverBackground:o.Color.fromHex("#006BB3"),buttonForeground:o.Color.white};class h extends a.Disposable{constructor(e,t){super(),this._onDidClick=this._register(new r.Emitter),this.options=t||Object.create(null),s.mixin(this.options,c,!1),this.buttonForeground=this.options.buttonForeground,this.buttonBackground=this.options.buttonBackground,this.buttonHoverBackground=this.options.buttonHoverBackground,this.buttonSecondaryForeground=this.options.buttonSecondaryForeground,this.buttonSecondaryBackground=this.options.buttonSecondaryBackground,this.buttonSecondaryHoverBackground=this.options.buttonSecondaryHoverBackground,this.buttonBorder=this.options.buttonBorder,this._element=document.createElement("a"), +i.addClass(this._element,"monaco-button"),this._element.tabIndex=0,this._element.setAttribute("role","button"),e.appendChild(this._element),this._register(l.Gesture.addTarget(this._element)),[i.EventType.CLICK,l.EventType.Tap].forEach(e=>{this._register(i.addDisposableListener(this._element,e,e=>{this.enabled?this._onDidClick.fire(e):i.EventHelper.stop(e)}))}),this._register(i.addDisposableListener(this._element,i.EventType.KEY_DOWN,e=>{const t=new n.StandardKeyboardEvent(e);let o=!1;this.enabled&&(t.equals(3)||t.equals(10))?(this._onDidClick.fire(e),o=!0):t.equals(9)&&(this._element.blur(),o=!0),o&&i.EventHelper.stop(t,!0)})),this._register(i.addDisposableListener(this._element,i.EventType.MOUSE_OVER,e=>{i.hasClass(this._element,"disabled")||this.setHoverBackground()})),this._register(i.addDisposableListener(this._element,i.EventType.MOUSE_OUT,e=>{this.applyStyles()})),this.focusTracker=this._register(i.trackFocus(this._element)),this._register(this.focusTracker.onDidFocus(()=>this.setHoverBackground())), +this._register(this.focusTracker.onDidBlur(()=>this.applyStyles())),this.applyStyles()}get onDidClick(){return this._onDidClick.event}setHoverBackground(){let e;(e=this.options.secondary?this.buttonSecondaryHoverBackground?this.buttonSecondaryHoverBackground.toString():null:this.buttonHoverBackground?this.buttonHoverBackground.toString():null)&&(this._element.style.backgroundColor=e)}style(e){this.buttonForeground=e.buttonForeground,this.buttonBackground=e.buttonBackground,this.buttonHoverBackground=e.buttonHoverBackground,this.buttonSecondaryForeground=e.buttonSecondaryForeground,this.buttonSecondaryBackground=e.buttonSecondaryBackground,this.buttonSecondaryHoverBackground=e.buttonSecondaryHoverBackground,this.buttonBorder=e.buttonBorder,this.applyStyles()}applyStyles(){if(this._element){let e,t;this.options.secondary?(t=this.buttonSecondaryForeground?this.buttonSecondaryForeground.toString():"", +e=this.buttonSecondaryBackground?this.buttonSecondaryBackground.toString():""):(t=this.buttonForeground?this.buttonForeground.toString():"",e=this.buttonBackground?this.buttonBackground.toString():"");const i=this.buttonBorder?this.buttonBorder.toString():"";this._element.style.color=t,this._element.style.backgroundColor=e,this._element.style.borderWidth=i?"1px":"",this._element.style.borderStyle=i?"solid":"",this._element.style.borderColor=i}}get element(){return this._element}set label(e){i.hasClass(this._element,"monaco-text-button")||i.addClass(this._element,"monaco-text-button"),this.options.supportCodicons?i.reset(this._element,...d.renderCodiconsAsElement(e)):this._element.textContent=e,"string"==typeof this.options.title?this._element.title=this.options.title:this.options.title&&(this._element.title=e)}set enabled(e){e?(i.removeClass(this._element,"disabled"),this._element.setAttribute("aria-disabled",String(!1)),this._element.tabIndex=0):(i.addClass(this._element,"disabled"), +this._element.setAttribute("aria-disabled",String(!0)),i.removeTabIndexAndUpdateFocus(this._element))}get enabled(){return!i.hasClass(this._element,"disabled")}}t.Button=h})),define(t[285],i([9]),{}),define(t[152],i([0,1,7,54,29,4,285]),(function(e,t,i,n,o,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Checkbox=void 0;const r={inputActiveOptionBorder:o.Color.fromHex("#007ACC00"),inputActiveOptionForeground:o.Color.fromHex("#FFFFFF"),inputActiveOptionBackground:o.Color.fromHex("#0E639C50")};class a extends n.Widget{constructor(e){super(),this._onChange=this._register(new s.Emitter),this.onChange=this._onChange.event,this._onKeyDown=this._register(new s.Emitter),this.onKeyDown=this._onKeyDown.event,this._opts=Object.assign(Object.assign({},r),e),this._checked=this._opts.isChecked;const t=["monaco-custom-checkbox"];this._opts.icon?t.push(this._opts.icon.classNames):t.push("codicon"),this._opts.actionClassName&&t.push(this._opts.actionClassName),t.push(this._checked?"checked":"unchecked"), +this.domNode=document.createElement("div"),this.domNode.title=this._opts.title,this.domNode.className=t.join(" "),this.domNode.tabIndex=0,this.domNode.setAttribute("role","checkbox"),this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.setAttribute("aria-label",this._opts.title),this.applyStyles(),this.onclick(this.domNode,e=>{this.checked=!this._checked,this._onChange.fire(!1),e.preventDefault()}),this.ignoreGesture(this.domNode),this.onkeydown(this.domNode,e=>{if(10===e.keyCode||3===e.keyCode)return this.checked=!this._checked,this._onChange.fire(!0),void e.preventDefault();this._onKeyDown.fire(e)})}get enabled(){return"true"!==this.domNode.getAttribute("aria-disabled")}focus(){this.domNode.focus()}get checked(){return this._checked}set checked(e){this._checked=e,this.domNode.setAttribute("aria-checked",String(this._checked)),this._checked?this.domNode.classList.add("checked"):this.domNode.classList.remove("checked"),this.applyStyles()}width(){return 22}style(e){ +e.inputActiveOptionBorder&&(this._opts.inputActiveOptionBorder=e.inputActiveOptionBorder),e.inputActiveOptionForeground&&(this._opts.inputActiveOptionForeground=e.inputActiveOptionForeground),e.inputActiveOptionBackground&&(this._opts.inputActiveOptionBackground=e.inputActiveOptionBackground),this.applyStyles()}applyStyles(){this.domNode&&(this.domNode.style.borderColor=this._checked&&this._opts.inputActiveOptionBorder?this._opts.inputActiveOptionBorder.toString():"transparent",this.domNode.style.color=this._checked&&this._opts.inputActiveOptionForeground?this._opts.inputActiveOptionForeground.toString():"inherit",this.domNode.style.backgroundColor=this._checked&&this._opts.inputActiveOptionBackground?this._opts.inputActiveOptionBackground.toString():"transparent")}enable(){this.domNode.tabIndex=0,this.domNode.setAttribute("aria-disabled",String(!1))}disable(){i.removeTabIndexAndUpdateFocus(this.domNode),this.domNode.setAttribute("aria-disabled",String(!0))}}t.Checkbox=a})),define(t[286],i([9]),{}), +define(t[287],i([9]),{}),define(t[288],i([9]),{}),define(t[115],i([0,1,26,286,288,287]),(function(e,t,i){"use strict";function n(e){let t=e.definition;for(;t instanceof i.Codicon;)t=t.definition;return`.codicon-${e.id}:before { content: '${t.character}'; }`}Object.defineProperty(t,"__esModule",{value:!0}),t.formatRule=t.CodiconStyles=void 0,t.CodiconStyles=new class{constructor(){this.onDidChange=i.iconRegistry.onDidRegister}getCSS(){const e=[];for(let t of i.iconRegistry.all)e.push(n(t));return e.join("\n")}},t.formatRule=n})),define(t[289],i([9]),{}),define(t[197],i([0,1,7,16,2,110,98,289]),(function(e,t,i,n,o,s,r){"use strict";function a(e,t,i){const n=i.offset+i.size;return 0===i.position?t<=e-n?n:t<=i.offset?i.offset-t:Math.max(e-t,0):t<=i.offset?i.offset-t:t<=e-n?n:0}Object.defineProperty(t,"__esModule",{value:!0}),t.ContextView=t.layout=void 0,t.layout=a;class l extends o.Disposable{constructor(e,t){super(),this.container=null,this.delegate=null,this.toDisposeOnClean=o.Disposable.None, +this.toDisposeOnSetContainer=o.Disposable.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=i.$(".context-view"),this.useFixedPosition=!1,this.useShadowDOM=!1,i.hide(this.view),this.setContainer(e,t),this._register(o.toDisposable(()=>this.setContainer(null,1)))}setContainer(e,t){if(this.container&&(this.toDisposeOnSetContainer.dispose(),this.shadowRoot?(this.shadowRoot.removeChild(this.view),this.shadowRoot=null,i.removeNode(this.shadowRootHostElement),this.shadowRootHostElement=null):this.container.removeChild(this.view),this.container=null),e){this.container=e,this.useFixedPosition=1!==t,this.useShadowDOM=3===t,this.useShadowDOM?(this.shadowRootHostElement=i.$(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=`\n\t\t\t\t\t\n\t\t\t\t`,this.shadowRoot.appendChild(this.view), +this.shadowRoot.appendChild(i.$("slot"))):this.container.appendChild(this.view);const n=new o.DisposableStore;l.BUBBLE_UP_EVENTS.forEach(e=>{n.add(i.addStandardDisposableListener(this.container,e,e=>{this.onDOMEvent(e,!1)}))}),l.BUBBLE_DOWN_EVENTS.forEach(e=>{n.add(i.addStandardDisposableListener(this.container,e,e=>{this.onDOMEvent(e,!0)},!0))}),this.toDisposeOnSetContainer=n}}show(e){this.isVisible()&&this.hide(),i.clearNode(this.view),this.view.className="context-view",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex="2500",this.view.style.position=this.useFixedPosition?"fixed":"absolute",i.show(this.view),this.toDisposeOnClean=e.render(this.view)||o.Disposable.None,this.delegate=e,this.doLayout(),this.delegate.focus&&this.delegate.focus()}getViewElement(){return this.view}layout(){this.isVisible()&&(!1!==this.delegate.canRelayout||n.isIOS&&r.BrowserFeatures.pointerEvents?(this.delegate.layout&&this.delegate.layout(),this.doLayout()):this.hide())}doLayout(){ +if(!this.isVisible())return;let e,t=this.delegate.getAnchor();if(i.isHTMLElement(t)){let n=i.getDomNodePagePosition(t);e={top:n.top,left:n.left,width:n.width,height:n.height}}else e={top:t.y,left:t.x,width:t.width||1,height:t.height||2};const n=i.getTotalWidth(this.view),o=i.getTotalHeight(this.view),r=this.delegate.anchorPosition||0,l=this.delegate.anchorAlignment||0,d={offset:e.top-window.pageYOffset,size:e.height,position:0===r?0:1};let c;c=0===l?{offset:e.left,size:0,position:0}:{offset:e.left+e.width,size:0,position:1};const h=a(window.innerHeight,o,d)+window.pageYOffset;s.Range.intersects({start:h,end:h+o},{start:d.offset,end:d.offset+d.size})&&(c.size=e.width,1===l&&(c.offset=e.left));const u=a(window.innerWidth,n,c);i.removeClasses(this.view,"top","bottom","left","right"),i.addClass(this.view,0===r?"bottom":"top"),i.addClass(this.view,0===l?"left":"right"),i.toggleClass(this.view,"fixed",this.useFixedPosition);const g=i.getDomNodePagePosition(this.container) +;this.view.style.top=`${h-(this.useFixedPosition?i.getDomNodePagePosition(this.view).top:g.top)}px`,this.view.style.left=`${u-(this.useFixedPosition?i.getDomNodePagePosition(this.view).left:g.left)}px`,this.view.style.width="initial"}hide(e){const t=this.delegate;this.delegate=null,(null==t?void 0:t.onHide)&&t.onHide(e),this.toDisposeOnClean.dispose(),i.hide(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,document.activeElement):t&&!i.isAncestor(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}}t.ContextView=l,l.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"],l.BUBBLE_DOWN_EVENTS=["click"] +;let d='\n\t:host {\n\t\tall: initial; /* 1st rule so subsequent properties are reset. */\n\t}\n\n\t@font-face {\n\t\tfont-family: "codicon";\n\t\tsrc: url("./codicon.ttf?5d4d76ab2ce5108968ad644d591a16a6") format("truetype");\n\t}\n\n\t.codicon[class*=\'codicon-\'] {\n\t\tfont: normal normal normal 16px/1 codicon;\n\t\tdisplay: inline-block;\n\t\ttext-decoration: none;\n\t\ttext-rendering: auto;\n\t\ttext-align: center;\n\t\t-webkit-font-smoothing: antialiased;\n\t\t-moz-osx-font-smoothing: grayscale;\n\t\tuser-select: none;\n\t\t-webkit-user-select: none;\n\t\t-ms-user-select: none;\n\t}\n\n\t:host {\n\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif;\n\t}\n\n\t:host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }\n\t:host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; }\n\t:host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; }\n\t:host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; }\n\t:host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, "Nanum Gothic", "Apple SD Gothic Neo", "AppleGothic", sans-serif; }\n\n\t:host-context(.windows) { font-family: "Segoe WPC", "Segoe UI", sans-serif; }\n\t:host-context(.windows:lang(zh-Hans)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; }\n\t:host-context(.windows:lang(zh-Hant)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; }\n\t:host-context(.windows:lang(ja)) { font-family: "Segoe WPC", "Segoe UI", "Yu Gothic UI", "Meiryo UI", sans-serif; }\n\t:host-context(.windows:lang(ko)) { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; }\n\n\t:host-context(.linux) { font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif; }\n\t:host-context(.linux:lang(zh-Hans)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif; }\n\t:host-context(.linux:lang(zh-Hant)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans TC", "Source Han Sans TW", "Source Han Sans", sans-serif; }\n\t:host-context(.linux:lang(ja)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", sans-serif; }\n\t:host-context(.linux:lang(ko)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; }\n' +})),define(t[290],i([9]),{}),define(t[198],i([0,1,7,8,29,37,290]),(function(e,t,i,n,o,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CountBadge=void 0;const r={badgeBackground:o.Color.fromHex("#4D4D4D"),badgeForeground:o.Color.fromHex("#FFFFFF")};t.CountBadge=class{constructor(e,t){this.count=0,this.options=t||Object.create(null),s.mixin(this.options,r,!1),this.badgeBackground=this.options.badgeBackground,this.badgeForeground=this.options.badgeForeground,this.badgeBorder=this.options.badgeBorder,this.element=i.append(e,i.$(".monaco-count-badge")),this.countFormat=this.options.countFormat||"{0}",this.titleFormat=this.options.titleFormat||"",this.setCount(this.options.count||0)}setCount(e){this.count=e,this.render()}setTitleFormat(e){this.titleFormat=e,this.render()}render(){this.element.textContent=n.format(this.countFormat,this.count),this.element.title=n.format(this.titleFormat,this.count),this.applyStyles()}style(e){this.badgeBackground=e.badgeBackground, +this.badgeForeground=e.badgeForeground,this.badgeBorder=e.badgeBorder,this.applyStyles()}applyStyles(){if(this.element){const e=this.badgeBackground?this.badgeBackground.toString():"",t=this.badgeForeground?this.badgeForeground.toString():"",i=this.badgeBorder?this.badgeBorder.toString():"";this.element.style.backgroundColor=e,this.element.style.color=t,this.element.style.borderWidth=i?"1px":"",this.element.style.borderStyle=i?"solid":"",this.element.style.borderColor=i}}}})),define(t[199],i([9]),{}),define(t[291],i([0,1,58,47,7,53,4,199]),(function(e,t,i,n,o,s,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DropdownMenu=t.BaseDropdown=void 0;class a extends n.ActionRunner{constructor(e,t){super(),this._onDidChangeVisibility=new r.Emitter,this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=o.append(e,o.$(".monaco-dropdown")),this._label=o.append(this._element,o.$(".dropdown-label"));let n=t.labelRenderer;n||(n=e=>(e.textContent=t.label||"",null)) +;for(const e of[o.EventType.CLICK,o.EventType.MOUSE_DOWN,i.EventType.Tap])this._register(o.addDisposableListener(this.element,e,e=>o.EventHelper.stop(e,!0)));for(const e of[o.EventType.MOUSE_DOWN,i.EventType.Tap])this._register(o.addDisposableListener(this._label,e,e=>{e instanceof MouseEvent&&e.detail>1||(this.visible?this.hide():this.show())}));this._register(o.addDisposableListener(this._label,o.EventType.KEY_UP,e=>{const t=new s.StandardKeyboardEvent(e);(t.equals(3)||t.equals(10))&&(o.EventHelper.stop(e,!0),this.visible?this.hide():this.show())}));const a=n(this._label);a&&this._register(a),this._register(i.Gesture.addTarget(this._label))}get element(){return this._element}show(){this.visible||(this.visible=!0,this._onDidChangeVisibility.fire(!0))}hide(){this.visible&&(this.visible=!1,this._onDidChangeVisibility.fire(!1))}dispose(){super.dispose(),this.hide(),this.boxContainer&&(this.boxContainer.remove(),this.boxContainer=void 0),this.contents&&(this.contents.remove(),this.contents=void 0), +this._label&&(this._label.remove(),this._label=void 0)}}t.BaseDropdown=a;t.DropdownMenu=class extends a{constructor(e,t){super(e,t),this._actions=[],this._contextMenuProvider=t.contextMenuProvider,this.actions=t.actions||[],this.actionProvider=t.actionProvider,this.menuClassName=t.menuClassName||"",this.menuAsChild=!!t.menuAsChild}set menuOptions(e){this._menuOptions=e}get menuOptions(){return this._menuOptions}get actions(){return this.actionProvider?this.actionProvider.getActions():this._actions}set actions(e){this._actions=e}show(){super.show(),o.addClass(this.element,"active"),this._contextMenuProvider.showContextMenu({getAnchor:()=>this.element,getActions:()=>this.actions,getActionsContext:()=>this.menuOptions?this.menuOptions.context:null,getActionViewItem:e=>this.menuOptions&&this.menuOptions.actionViewItemProvider?this.menuOptions.actionViewItemProvider(e):void 0,getKeyBinding:e=>this.menuOptions&&this.menuOptions.getKeyBinding?this.menuOptions.getKeyBinding(e):void 0, +getMenuClassName:()=>this.menuClassName,onHide:()=>this.onHide(),actionRunner:this.menuOptions?this.menuOptions.actionRunner:void 0,anchorAlignment:this.menuOptions?this.menuOptions.anchorAlignment:0,domForShadowRoot:this.menuAsChild?this.element:void 0})}hide(){super.hide()}onHide(){this.hide(),o.removeClass(this.element,"active")}}})),define(t[200],i([9]),{}),define(t[292],i([9]),{}),define(t[293],i([9]),{}),define(t[153],i([0,1,7,150,2,110,37,293]),(function(e,t,i,n,o,s,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IconLabel=void 0;class a{constructor(e){this._element=e}get element(){return this._element}set textContent(e){this.disposed||e===this._textContent||(this._textContent=e,this._element.textContent=e)}set className(e){this.disposed||e===this._className||(this._className=e,this._element.className=e)}set title(e){this.disposed||e===this._title||(this._title=e,this._title?this._element.title=e:this._element.removeAttribute("title"))}set empty(e){ +this.disposed||e===this._empty||(this._empty=e,this._element.style.marginLeft=e?"0":"")}dispose(){this.disposed=!0}}class l extends o.Disposable{constructor(e,t){super(),this.domNode=this._register(new a(i.append(e,i.$(".monaco-icon-label"))));const o=i.append(this.domNode.element,i.$(".monaco-icon-label-container")),s=i.append(o,i.$("span.monaco-icon-name-container"));this.descriptionContainer=this._register(new a(i.append(o,i.$("span.monaco-icon-description-container")))),(null==t?void 0:t.supportHighlights)?this.nameNode=new c(s,!!t.supportCodicons):this.nameNode=new d(s),(null==t?void 0:t.supportDescriptionHighlights)?this.descriptionNodeFactory=()=>new n.HighlightedLabel(i.append(this.descriptionContainer.element,i.$("span.label-description")),!!t.supportCodicons):this.descriptionNodeFactory=()=>this._register(new a(i.append(this.descriptionContainer.element,i.$("span.label-description"))))}setLabel(e,t,i){const o=["monaco-icon-label"];i&&(i.extraClasses&&o.push(...i.extraClasses), +i.italic&&o.push("italic"),i.strikethrough&&o.push("strikethrough")),this.domNode.className=o.join(" "),this.domNode.title=(null==i?void 0:i.title)||"",this.nameNode.setLabel(e,i),(t||this.descriptionNode)&&(this.descriptionNode||(this.descriptionNode=this.descriptionNodeFactory()),this.descriptionNode instanceof n.HighlightedLabel?(this.descriptionNode.set(t||"",i?i.descriptionMatches:void 0),(null==i?void 0:i.descriptionTitle)?this.descriptionNode.element.title=i.descriptionTitle:this.descriptionNode.element.removeAttribute("title")):(this.descriptionNode.textContent=t||"",this.descriptionNode.title=(null==i?void 0:i.descriptionTitle)||"",this.descriptionNode.empty=!t))}}t.IconLabel=l;class d{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(this.label!==e||!r.equals(this.options,t))if(this.label=e,this.options=t,"string"==typeof e)this.singleLabel||(this.container.innerText="",i.removeClass(this.container,"multiple"), +this.singleLabel=i.append(this.container,i.$("a.label-name",{id:null==t?void 0:t.domId}))),this.singleLabel.textContent=e;else{this.container.innerText="",i.addClass(this.container,"multiple"),this.singleLabel=void 0;for(let n=0;n{const o={start:n,end:n+e.length},r=i.map(e=>s.Range.intersect(o,e)).filter(e=>!s.Range.isEmpty(e)).map(({start:e,end:t})=>({start:e-n,end:t-n}));return n=o.end+t.length,r})}(e,o,null==t?void 0:t.matches);for(let s=0;ss.show(this.element),0)),this.create(e)}create(e){this.element=document.createElement("div"),s.addClass(this.element,h),e.appendChild(this.element),this.bit=document.createElement("div"), +s.addClass(this.bit,u),this.element.appendChild(this.bit),this.applyStyles()}off(){this.bit.style.width="inherit",this.bit.style.opacity="1",s.removeClasses(this.element,l,d,c),this.workedVal=0,this.totalWork=void 0}stop(){return this.doDone(!1)}doDone(e){return s.addClass(this.element,a),s.hasClass(this.element,d)?(this.bit.style.opacity="0",e?setTimeout(()=>this.off(),200):this.off()):(this.bit.style.width="inherit",e?setTimeout(()=>this.off(),200):this.off()),this}infinite(){return this.bit.style.width="2%",this.bit.style.opacity="1",s.removeClasses(this.element,c,a),s.addClasses(this.element,l,d),this}getContainer(){return this.element}style(e){this.progressBarBackground=e.progressBarBackground,this.applyStyles()}applyStyles(){if(this.bit){const e=this.progressBarBackground?this.progressBarBackground.toString():"";this.bit.style.backgroundColor=e}}}t.ProgressBar=p})),define(t[299],i([9]),{}),define(t[117],i([0,1,2,16,23,58,51,4,7,57,299]),(function(e,t,i,n,o,s,r,a,l,d){"use strict" +;Object.defineProperty(t,"__esModule",{value:!0}),t.Sash=void 0;const c=!1;let h=4;const u=new a.Emitter;class g extends i.Disposable{constructor(e,t,o){super(),this._state=3,this._onDidEnablementChange=this._register(new a.Emitter),this.onDidEnablementChange=this._onDidEnablementChange.event,this._onDidStart=this._register(new a.Emitter),this.onDidStart=this._onDidStart.event,this._onDidChange=this._register(new a.Emitter),this.onDidChange=this._onDidChange.event,this._onDidReset=this._register(new a.Emitter),this.onDidReset=this._onDidReset.event,this._onDidEnd=this._register(new a.Emitter),this.onDidEnd=this._onDidEnd.event,this.linkedSash=void 0,this.orthogonalStartSashDisposables=this._register(new i.DisposableStore),this.orthogonalEndSashDisposables=this._register(new i.DisposableStore),this.el=l.append(e,l.$(".monaco-sash")),n.isMacintosh&&l.addClass(this.el,"mac"),this._register(d.domEvent(this.el,"mousedown")(this.onMouseDown,this)), +this._register(d.domEvent(this.el,"dblclick")(this.onMouseDoubleClick,this)),this._register(s.Gesture.addTarget(this.el)),this._register(d.domEvent(this.el,s.EventType.Start)(this.onTouchStart,this)),"number"==typeof o.size?(this.size=o.size,0===o.orientation?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=h,this._register(u.event(e=>{this.size=e,this.layout()}))),this.hidden=!1,this.layoutProvider=t,this.orthogonalStartSash=o.orthogonalStartSash,this.orthogonalEndSash=o.orthogonalEndSash,this.orientation=o.orientation||0,1===this.orientation?(l.addClass(this.el,"horizontal"),l.removeClass(this.el,"vertical")):(l.removeClass(this.el,"horizontal"),l.addClass(this.el,"vertical")),l.toggleClass(this.el,"debug",c),this.layout()}get state(){return this._state}set state(e){this._state!==e&&(l.toggleClass(this.el,"disabled",0===e),l.toggleClass(this.el,"minimum",1===e),l.toggleClass(this.el,"maximum",2===e),this._state=e,this._onDidEnablementChange.fire(e))} +get orthogonalStartSash(){return this._orthogonalStartSash}set orthogonalStartSash(e){this.orthogonalStartSashDisposables.clear(),e?(this.orthogonalStartSashDisposables.add(e.onDidEnablementChange(this.onOrthogonalStartSashEnablementChange,this)),this.onOrthogonalStartSashEnablementChange(e.state)):this.onOrthogonalStartSashEnablementChange(0),this._orthogonalStartSash=e}get orthogonalEndSash(){return this._orthogonalEndSash}set orthogonalEndSash(e){this.orthogonalEndSashDisposables.clear(),e?(this.orthogonalEndSashDisposables.add(e.onDidEnablementChange(this.onOrthogonalEndSashEnablementChange,this)),this.onOrthogonalEndSashEnablementChange(e.state)):this.onOrthogonalEndSashEnablementChange(0),this._orthogonalEndSash=e}onMouseDown(e){l.EventHelper.stop(e,!1);let t=!1;if(!e.__orthogonalSashEvent){const i=this.getOrthogonalSash(e);i&&(t=!0,e.__orthogonalSashEvent=!0,i.onMouseDown(e))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onMouseDown(e)),!this.state)return +;const o=[...l.getElementsByTagName("iframe"),...l.getElementsByTagName("webview")];for(const e of o)e.style.pointerEvents="none";const s=new r.StandardMouseEvent(e),a=s.posx,c=s.posy,h=s.altKey,u={startX:a,currentX:a,startY:c,currentY:c,altKey:h};l.addClass(this.el,"active"),this._onDidStart.fire(u);const g=l.createStyleSheet(this.el),p=()=>{let e="";e=t?"all-scroll":1===this.orientation?1===this.state?"s-resize":2===this.state?"n-resize":n.isMacintosh?"row-resize":"ns-resize":1===this.state?"e-resize":2===this.state?"w-resize":n.isMacintosh?"col-resize":"ew-resize",g.innerHTML=`* { cursor: ${e} !important; }`},m=new i.DisposableStore;p(),t||this.onDidEnablementChange(p,null,m);d.domEvent(window,"mousemove")(e=>{l.EventHelper.stop(e,!1);const t=new r.StandardMouseEvent(e),i={startX:a,currentX:t.posx,startY:c,currentY:t.posy,altKey:h};this._onDidChange.fire(i)},null,m),d.domEvent(window,"mouseup")(e=>{l.EventHelper.stop(e,!1),this.el.removeChild(g),l.removeClass(this.el,"active"),this._onDidEnd.fire(), +m.dispose();for(const e of o)e.style.pointerEvents="auto"},null,m)}onMouseDoubleClick(e){const t=this.getOrthogonalSash(e);t&&t._onDidReset.fire(),this.linkedSash&&this.linkedSash._onDidReset.fire(),this._onDidReset.fire()}onTouchStart(e){l.EventHelper.stop(e);const t=[],n=e.pageX,r=e.pageY,a=e.altKey;this._onDidStart.fire({startX:n,currentX:n,startY:r,currentY:r,altKey:a}),t.push(l.addDisposableListener(this.el,s.EventType.Change,e=>{o.isNumber(e.pageX)&&o.isNumber(e.pageY)&&this._onDidChange.fire({startX:n,currentX:e.pageX,startY:r,currentY:e.pageY,altKey:a})})),t.push(l.addDisposableListener(this.el,s.EventType.End,e=>{this._onDidEnd.fire(),i.dispose(t)}))}layout(){if(0===this.orientation){const e=this.layoutProvider;this.el.style.left=e.getVerticalSashLeft(this)-this.size/2+"px",e.getVerticalSashTop&&(this.el.style.top=e.getVerticalSashTop(this)+"px"),e.getVerticalSashHeight&&(this.el.style.height=e.getVerticalSashHeight(this)+"px")}else{const e=this.layoutProvider +;this.el.style.top=e.getHorizontalSashTop(this)-this.size/2+"px",e.getHorizontalSashLeft&&(this.el.style.left=e.getHorizontalSashLeft(this)+"px"),e.getHorizontalSashWidth&&(this.el.style.width=e.getHorizontalSashWidth(this)+"px")}}hide(){this.hidden=!0,this.el.style.display="none",this.el.setAttribute("aria-hidden","true")}onOrthogonalStartSashEnablementChange(e){l.toggleClass(this.el,"orthogonal-start",0!==e)}onOrthogonalEndSashEnablementChange(e){l.toggleClass(this.el,"orthogonal-end",0!==e)}getOrthogonalSash(e){if(0===this.orientation){if(e.offsetY<=this.size)return this.orthogonalStartSash;if(e.offsetY>=this.el.clientHeight-this.size)return this.orthogonalEndSash}else{if(e.offsetX<=this.size)return this.orthogonalStartSash;if(e.offsetX>=this.el.clientWidth-this.size)return this.orthogonalEndSash}}dispose(){super.dispose(),this.el.remove()}}t.Sash=g})),define(t[300],i([9]),{}),define(t[65],i([0,1,7,30,51,276,277,54,15,4,2,16,147,36,300]),(function(e,t,i,n,o,s,r,a,l,d,c,h,u,g){"use strict" +;Object.defineProperty(t,"__esModule",{value:!0}),t.DomScrollableElement=t.SmoothScrollableElement=t.ScrollableElement=t.AbstractScrollableElement=t.MouseWheelClassifier=void 0;const p=500,m=50,f=!0;class _{constructor(e,t,i){this.timestamp=e,this.deltaX=t,this.deltaY=i,this.score=0}}class v{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(-1===this._front&&-1===this._rear)return!1;let e=1,t=0,i=1,n=this._rear;for(;;){const o=n===this._front?e:Math.pow(2,-i);if(e-=o,t+=this._memory[n].score*o,n===this._front)break;n=(this._capacity+n-1)%this._capacity,i++}return t<=.5}accept(e,t,i){const n=new _(e,t,i);n.score=this._computeScore(n),-1===this._front&&-1===this._rear?(this._memory[0]=n,this._front=0,this._rear=0):(this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=n)}_computeScore(e){if(Math.abs(e.deltaX)>0&&Math.abs(e.deltaY)>0)return 1;let t=.5 +;-1===this._front&&-1===this._rear||this._memory[this._rear];return this._isAlmostInt(e.deltaX)&&this._isAlmostInt(e.deltaY)||(t+=.25),Math.min(Math.max(t,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}}t.MouseWheelClassifier=v,v.INSTANCE=new v;class C extends a.Widget{constructor(e,t,i){super(),this._onScroll=this._register(new d.Emitter),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new d.Emitter),e.style.overflow="hidden",this._options=function(e){let t={lazyRender:void 0!==e.lazyRender&&e.lazyRender,className:void 0!==e.className?e.className:"",useShadows:void 0===e.useShadows||e.useShadows,handleMouseWheel:void 0===e.handleMouseWheel||e.handleMouseWheel,flipAxes:void 0!==e.flipAxes&&e.flipAxes,alwaysConsumeMouseWheel:void 0!==e.alwaysConsumeMouseWheel&&e.alwaysConsumeMouseWheel,scrollYToX:void 0!==e.scrollYToX&&e.scrollYToX,mouseWheelScrollSensitivity:void 0!==e.mouseWheelScrollSensitivity?e.mouseWheelScrollSensitivity:1, +fastScrollSensitivity:void 0!==e.fastScrollSensitivity?e.fastScrollSensitivity:5,scrollPredominantAxis:void 0===e.scrollPredominantAxis||e.scrollPredominantAxis,mouseWheelSmoothScroll:void 0===e.mouseWheelSmoothScroll||e.mouseWheelSmoothScroll,arrowSize:void 0!==e.arrowSize?e.arrowSize:11,listenOnDomNode:void 0!==e.listenOnDomNode?e.listenOnDomNode:null,horizontal:void 0!==e.horizontal?e.horizontal:1,horizontalScrollbarSize:void 0!==e.horizontalScrollbarSize?e.horizontalScrollbarSize:10,horizontalSliderSize:void 0!==e.horizontalSliderSize?e.horizontalSliderSize:0,horizontalHasArrows:void 0!==e.horizontalHasArrows&&e.horizontalHasArrows,vertical:void 0!==e.vertical?e.vertical:1,verticalScrollbarSize:void 0!==e.verticalScrollbarSize?e.verticalScrollbarSize:10,verticalHasArrows:void 0!==e.verticalHasArrows&&e.verticalHasArrows,verticalSliderSize:void 0!==e.verticalSliderSize?e.verticalSliderSize:0};t.horizontalSliderSize=void 0!==e.horizontalSliderSize?e.horizontalSliderSize:t.horizontalScrollbarSize, +t.verticalSliderSize=void 0!==e.verticalSliderSize?e.verticalSliderSize:t.verticalScrollbarSize,h.isMacintosh&&(t.className+=" mac");return t}(t),this._scrollable=i,this._register(this._scrollable.onScroll(e=>{this._onWillScroll.fire(e),this._onDidScroll(e),this._onScroll.fire(e)}));let o={onMouseWheel:e=>this._onMouseWheel(e),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new r.VerticalScrollbar(this._scrollable,this._options,o)),this._horizontalScrollbar=this._register(new s.HorizontalScrollbar(this._scrollable,this._options,o)),this._domNode=document.createElement("div"),this._domNode.className="monaco-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.style.overflow="hidden",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode), +this._options.useShadows?(this._leftShadowDomNode=n.createFastDomNode(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=n.createFastDomNode(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=n.createFastDomNode(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow top-left-corner"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,e=>this._onMouseOver(e)),this.onnonbubblingmouseout(this._listenOnDomNode,e=>this._onMouseOut(e)), +this._hideTimeout=this._register(new l.TimeoutTimer),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=c.dispose(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarMouseDown(e){this._verticalScrollbar.delegateMouseDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,h.isMacintosh&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className}updateOptions(e){void 0!==e.handleMouseWheel&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)), +void 0!==e.mouseWheelScrollSensitivity&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),void 0!==e.fastScrollSensitivity&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),void 0!==e.scrollPredominantAxis&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),void 0!==e.horizontalScrollbarSize&&this._horizontalScrollbar.updateScrollbarSize(e.horizontalScrollbarSize),this._options.lazyRender||this._render()}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=c.dispose(this._mouseWheelToDispose),e)){let e=e=>{this._onMouseWheel(new o.StandardWheelEvent(e))};this._mouseWheelToDispose.push(i.addDisposableListener(this._listenOnDomNode,i.EventType.MOUSE_WHEEL,e,{passive:!1}))}}_onMouseWheel(e){const t=v.INSTANCE;if(f){const i=window.devicePixelRatio/g.getZoomFactor();h.isWindows||h.isLinux?t.accept(Date.now(),e.deltaX/i,e.deltaY/i):t.accept(Date.now(),e.deltaX,e.deltaY)}if(e.deltaY||e.deltaX){ +let i=e.deltaY*this._options.mouseWheelScrollSensitivity,n=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(Math.abs(i)>=Math.abs(n)?n=0:i=0),this._options.flipAxes&&([i,n]=[n,i]);const o=!h.isMacintosh&&e.browserEvent&&e.browserEvent.shiftKey;!this._options.scrollYToX&&!o||n||(n=i,i=0),e.browserEvent&&e.browserEvent.altKey&&(n*=this._options.fastScrollSensitivity,i*=this._options.fastScrollSensitivity);const s=this._scrollable.getFutureScrollPosition();let r={};if(i){const e=s.scrollTop-m*i;this._verticalScrollbar.writeScrollPosition(r,e)}if(n){const e=s.scrollLeft-m*n;this._horizontalScrollbar.writeScrollPosition(r,e)}if(r=this._scrollable.validateScrollPosition(r),s.scrollLeft!==r.scrollLeft||s.scrollTop!==r.scrollTop){f&&this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(r):this._scrollable.setScrollPositionNow(r),this._shouldRender=!0}} +(this._options.alwaysConsumeMouseWheel||this._shouldRender)&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){const e=this._scrollable.getCurrentScrollPosition();let t=e.scrollTop>0,i=e.scrollLeft>0;this._leftShadowDomNode.setClassName("shadow"+(i?" left":"")),this._topShadowDomNode.setClassName("shadow"+(t?" top":"")),this._topLeftShadowDomNode.setClassName("shadow top-left-corner"+(t?" top":"")+(i?" left":""))}}_onDragStart(){this._isDragging=!0, +this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseOut(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){this._mouseIsOver||this._isDragging||(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){this._mouseIsOver||this._isDragging||this._hideTimeout.cancelAndSet(()=>this._hide(),p)}}t.AbstractScrollableElement=C;class b extends C{constructor(e,t){(t=t||{}).mouseWheelSmoothScroll=!1;const n=new u.Scrollable(0,e=>i.scheduleAtNextAnimationFrame(e));super(e,t,n),this._register(n)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}}t.ScrollableElement=b;t.SmoothScrollableElement=class extends C{constructor(e,t,i){super(e,t,i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}} +;t.DomScrollableElement=class extends b{constructor(e,t){super(e,t),this._element=e,this.onScroll(e=>{e.scrollTopChanged&&(this._element.scrollTop=e.scrollTop),e.scrollLeftChanged&&(this._element.scrollLeft=e.scrollLeft)}),this.scanDomNode()}scanDomNode(){this.setScrollDimensions({width:this._element.clientWidth,scrollWidth:this._element.scrollWidth,height:this._element.clientHeight,scrollHeight:this._element.scrollHeight}),this.setScrollPosition({scrollLeft:this._element.scrollLeft,scrollTop:this._element.scrollTop})}}})),define(t[301],i([0,1,7,2,65,292]),(function(e,t,i,n,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.renderHoverAction=t.HoverWidget=void 0;const s=i.$;class r extends n.Disposable{constructor(){super(),this.containerDomNode=document.createElement("div"),this.containerDomNode.className="monaco-hover",this.containerDomNode.tabIndex=0,this.containerDomNode.setAttribute("role","tooltip"),this.contentsDomNode=document.createElement("div"), +this.contentsDomNode.className="monaco-hover-content",this._scrollbar=this._register(new o.DomScrollableElement(this.contentsDomNode,{})),this.containerDomNode.appendChild(this._scrollbar.getDomNode())}onContentsChanged(){this._scrollbar.scanDomNode()}}t.HoverWidget=r,t.renderHoverAction=function(e,t,n){const o=i.append(e,s("div.action-container")),r=i.append(o,s("a.action"));return r.setAttribute("href","#"),r.setAttribute("role","button"),t.iconClass&&i.append(r,s(`span.icon.${t.iconClass}`)),i.append(r,s("span")).textContent=n?`${t.label} (${n})`:t.label,i.addDisposableListener(o,i.EventType.CLICK,e=>{e.stopPropagation(),e.preventDefault(),t.run(o)})}})),define(t[154],i([0,1,37,2,58,7,4,57,65,147,272,274,96,110,19,143,15,36]),(function(e,t,i,n,o,s,r,l,d,c,h,u,g,p,m,f,_,v){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ListView=t.NativeDragAndDropData=t.ExternalElementsDragAndDropData=t.ElementsDragAndDropData=void 0;const C={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0, +setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements:e=>[e],getDragURI:()=>null,onDragStart(){},onDragOver:()=>!1,drop(){}},horizontalScrolling:!1,transformOptimization:!0};class b{constructor(e){this.elements=e}update(){}getData(){return this.elements}}t.ElementsDragAndDropData=b;class S{constructor(e){this.elements=e}update(){}getData(){return this.elements}}t.ExternalElementsDragAndDropData=S;class w{constructor(){this.types=[],this.files=[]}update(e){if(e.types&&this.types.splice(0,this.types.length,...e.types),e.files){this.files.splice(0,this.files.length);for(let t=0;ti,(null==e?void 0:e.getPosInSet)?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(e,t)=>t+1, +(null==e?void 0:e.getRole)?this.getRole=e.getRole.bind(e):this.getRole=e=>"listitem",(null==e?void 0:e.isChecked)?this.isChecked=e.isChecked.bind(e):this.isChecked=e=>void 0}}class E{constructor(e,t,a,g=C){if(this.virtualDelegate=t,this.domId=`list_id_${++E.InstanceCount}`,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new _.Delayer(50),this.splicing=!1,this.dragOverAnimationStopDisposable=n.Disposable.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=n.Disposable.None,this.onDragLeaveTimeout=n.Disposable.None,this.disposables=new n.DisposableStore,this._onDidChangeContentHeight=new r.Emitter,this._horizontalScrolling=!1,g.horizontalScrolling&&g.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");this.items=[],this.itemId=0,this.rangeMap=new h.RangeMap;for(const e of a)this.renderers.set(e.templateId,e) +;this.cache=this.disposables.add(new u.RowCache(this.renderers)),this.lastRenderTop=0,this.lastRenderHeight=0,this.domNode=document.createElement("div"),this.domNode.className="monaco-list",s.addClass(this.domNode,this.domId),this.domNode.tabIndex=0,s.toggleClass(this.domNode,"mouse-support","boolean"!=typeof g.mouseSupport||g.mouseSupport),this._horizontalScrolling=i.getOrDefault(g,e=>e.horizontalScrolling,C.horizontalScrolling),s.toggleClass(this.domNode,"horizontal-scrolling",this._horizontalScrolling),this.additionalScrollHeight=void 0===g.additionalScrollHeight?0:g.additionalScrollHeight,this.accessibilityProvider=new y(g.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",i.getOrDefault(g,e=>e.transformOptimization,C.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)"),this.disposables.add(o.Gesture.addTarget(this.rowsContainer)), +this.scrollable=new c.Scrollable(i.getOrDefault(g,e=>e.smoothScrolling,!1)?125:0,e=>s.scheduleAtNextAnimationFrame(e)),this.scrollableElement=this.disposables.add(new d.SmoothScrollableElement(this.rowsContainer,{alwaysConsumeMouseWheel:!0,horizontal:1,vertical:i.getOrDefault(g,e=>e.verticalScrollMode,C.verticalScrollMode),useShadows:i.getOrDefault(g,e=>e.useShadows,C.useShadows)},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),l.domEvent(this.rowsContainer,o.EventType.Change)(this.onTouchChange,this,this.disposables),l.domEvent(this.scrollableElement.getDomNode(),"scroll")(e=>e.target.scrollTop=0,null,this.disposables),r.Event.map(l.domEvent(this.domNode,"dragover"),e=>this.toDragEvent(e))(this.onDragOver,this,this.disposables),r.Event.map(l.domEvent(this.domNode,"drop"),e=>this.toDragEvent(e))(this.onDrop,this,this.disposables), +l.domEvent(this.domNode,"dragleave")(this.onDragLeave,this,this.disposables),l.domEvent(window,"dragend")(this.onDragEnd,this,this.disposables),this.setRowLineHeight=i.getOrDefault(g,e=>e.setRowLineHeight,C.setRowLineHeight),this.setRowHeight=i.getOrDefault(g,e=>e.setRowHeight,C.setRowHeight),this.supportDynamicHeights=i.getOrDefault(g,e=>e.supportDynamicHeights,C.supportDynamicHeights),this.dnd=i.getOrDefault(g,e=>e.dnd,C.dnd),this.layout()}get contentHeight(){return this.rangeMap.size}get horizontalScrolling(){return this._horizontalScrolling}set horizontalScrolling(e){if(e!==this._horizontalScrolling){if(e&&this.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");if(this._horizontalScrolling=e,s.toggleClass(this.domNode,"horizontal-scrolling",this._horizontalScrolling),this._horizontalScrolling){for(const e of this.items)this.measureItemWidth(e);this.updateScrollWidth(),this.scrollableElement.setScrollDimensions({ +width:s.getContentWidth(this.domNode)}),this.rowsContainer.style.width=`${Math.max(this.scrollWidth||0,this.renderWidth)}px`}else this.scrollableElementWidthDelayer.cancel(),this.scrollableElement.setScrollDimensions({width:this.renderWidth,scrollWidth:this.renderWidth}),this.rowsContainer.style.width=""}}updateOptions(e){void 0!==e.additionalScrollHeight&&(this.additionalScrollHeight=e.additionalScrollHeight),void 0!==e.smoothScrolling&&this.scrollable.setSmoothScrollDuration(e.smoothScrolling?125:0),void 0!==e.horizontalScrolling&&(this.horizontalScrolling=e.horizontalScrolling)}splice(e,t,i=[]){if(this.splicing)throw new Error("Can't run recursive splices.");this.splicing=!0;try{return this._splice(e,t,i)}finally{this.splicing=!1,this._onDidChangeContentHeight.fire(this.contentHeight)}}_splice(e,t,i=[]){const o=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),s={start:e,end:e+t},r=p.Range.intersect(o,s);for(let e=r.start;e({id:String(this.itemId++),element:e,templateId:this.virtualDelegate.getTemplateId(e),size:this.virtualDelegate.getHeight(e),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(e),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:n.Disposable.None}));let u;0===e&&t>=this.items.length?(this.rangeMap=new h.RangeMap,this.rangeMap.splice(0,0,c),this.items=c,u=[]):(this.rangeMap.splice(e,t,c),u=this.items.splice(e,t,...c));const g=i.length-t,m=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),f=h.shift(l,g),_=p.Range.intersect(m,f);for(let e=_.start;e<_.end;e++)this.updateItemInDOM(this.items[e],e);const v=p.Range.relativeComplement(f,m);for(const e of v)for(let t=e.start;th.shift(e,g)),b=[{start:e,end:e+i.length +},...C].map(e=>p.Range.intersect(m,e)),S=this.getNextToLastElement(b);for(const e of b)for(let t=e.start;te.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=s.scheduleAtNextAnimationFrame(()=>{this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight}),this.updateScrollWidth(),this.scrollableElementUpdateDisposable=null}))}eventuallyUpdateScrollWidth(){this.horizontalScrolling?this.scrollableElementWidthDelayer.trigger(()=>this.updateScrollWidth()):this.scrollableElementWidthDelayer.cancel()}updateScrollWidth(){if(!this.horizontalScrolling)return;let e=0;for(const t of this.items)void 0!==t.width&&(e=Math.max(e,t.width));this.scrollWidth=e, +this.scrollableElement.setScrollDimensions({scrollWidth:0===e?0:e+10})}rerender(){if(this.supportDynamicHeights){for(const e of this.items)e.lastDynamicHeightWidth=void 0;this._rerender(this.lastRenderTop,this.lastRenderHeight)}}get length(){return this.items.length}get renderHeight(){return this.scrollableElement.getScrollDimensions().height}element(e){return this.items[e].element}domElement(e){const t=this.items[e].row;return t&&t.domNode}elementHeight(e){return this.items[e].size}elementTop(e){return this.rangeMap.positionAt(e)}indexAt(e){return this.rangeMap.indexAt(e)}indexAfter(e){return this.rangeMap.indexAfter(e)}layout(e,t){let i={height:"number"==typeof e?e:s.getContentHeight(this.domNode)};this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,i.scrollHeight=this.scrollHeight),this.scrollableElement.setScrollDimensions(i),void 0!==t&&(this.renderWidth=t, +this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight),this.horizontalScrolling&&this.scrollableElement.setScrollDimensions({width:"number"==typeof t?t:s.getContentWidth(this.domNode)}))}render(e,t,i,n,o,s=!1){const r=this.getRenderRange(t,i),a=p.Range.relativeComplement(r,e),l=p.Range.relativeComplement(e,r),d=this.getNextToLastElement(a);if(s){const t=p.Range.intersect(e,r);for(let e=t.start;ethis.onDragStart(i.element,o,e))}this.horizontalScrolling&&(this.measureItemWidth(i),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width=v.isFirefox?"-moz-fit-content":"fit-content",e.width=s.getContentWidth(e.row.domNode);const t=window.getComputedStyle(e.row.domNode) +;t.paddingLeft&&(e.width+=parseFloat(t.paddingLeft)),t.paddingRight&&(e.width+=parseFloat(t.paddingRight)),e.row.domNode.style.width=""}updateItemInDOM(e,t){e.row.domNode.style.top=`${this.elementTop(t)}px`,this.setRowHeight&&(e.row.domNode.style.height=`${e.size}px`),this.setRowLineHeight&&(e.row.domNode.style.lineHeight=`${e.size}px`),e.row.domNode.setAttribute("data-index",`${t}`),e.row.domNode.setAttribute("data-last-element",t===this.length-1?"true":"false"),e.row.domNode.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(e.element,t,this.length))),e.row.domNode.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(e.element,t))),e.row.domNode.setAttribute("id",this.getElementDomId(t)),s.toggleClass(e.row.domNode,"drop-target",e.dropTarget)}removeItemFromDOM(e){const t=this.items[e];t.dragStartDisposable.dispose();const i=this.renderers.get(t.templateId);t.row&&i&&i.disposeElement&&i.disposeElement(t.element,e,t.row.templateData,t.size), +this.cache.release(t.row),t.row=null,this.horizontalScrolling&&this.eventuallyUpdateScrollWidth()}getScrollTop(){return this.scrollableElement.getScrollPosition().scrollTop}setScrollTop(e){this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),this.scrollableElement.setScrollPosition({scrollTop:e})}get scrollTop(){return this.getScrollTop()}set scrollTop(e){this.setScrollTop(e)}get scrollHeight(){return this._scrollHeight+(this.horizontalScrolling?10:0)+this.additionalScrollHeight}get onMouseClick(){return r.Event.map(l.domEvent(this.domNode,"click"),e=>this.toMouseEvent(e))}get onMouseDblClick(){return r.Event.map(l.domEvent(this.domNode,"dblclick"),e=>this.toMouseEvent(e))}get onMouseMiddleClick(){return r.Event.filter(r.Event.map(l.domEvent(this.domNode,"auxclick"),e=>this.toMouseEvent(e)),e=>1===e.browserEvent.button)}get onMouseDown(){ +return r.Event.map(l.domEvent(this.domNode,"mousedown"),e=>this.toMouseEvent(e))}get onContextMenu(){return r.Event.map(l.domEvent(this.domNode,"contextmenu"),e=>this.toMouseEvent(e))}get onTouchStart(){return r.Event.map(l.domEvent(this.domNode,"touchstart"),e=>this.toTouchEvent(e))}get onTap(){return r.Event.map(l.domEvent(this.rowsContainer,o.EventType.Tap),e=>this.toGestureEvent(e))}toMouseEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t, +element:i&&i.element}}onScroll(e){try{const t=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.render(t,e.scrollTop,e.height,e.scrollLeft,e.scrollWidth),this.supportDynamicHeights&&this._rerender(e.scrollTop,e.height)}catch(t){throw console.error("Got bad scroll event:",e),t}}onTouchChange(e){e.preventDefault(),e.stopPropagation(),this.scrollTop-=e.translationY}onDragStart(e,t,i){if(!i.dataTransfer)return;const n=this.dnd.getDragElements(e);if(i.dataTransfer.effectAllowed="copyMove",i.dataTransfer.setData(f.DataTransfers.RESOURCES,JSON.stringify([t])),i.dataTransfer.setDragImage){let e;this.dnd.getDragLabel&&(e=this.dnd.getDragLabel(n,i)),void 0===e&&(e=String(n.length));const t=s.$(".monaco-drag-image");t.textContent=e,document.body.appendChild(t),i.dataTransfer.setDragImage(t,-10,-10),setTimeout(()=>document.body.removeChild(t),0)}this.currentDragData=new b(n),f.StaticDND.CurrentDragAndDropData=new S(n),this.dnd.onDragStart&&this.dnd.onDragStart(this.currentDragData,i)}onDragOver(e){ +if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),f.StaticDND.CurrentDragAndDropData&&"vscode-ui"===f.StaticDND.CurrentDragAndDropData.getData())return!1;if(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer)return!1;if(!this.currentDragData)if(f.StaticDND.CurrentDragAndDropData)this.currentDragData=f.StaticDND.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new w}const t=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.browserEvent);if(this.canDrop="boolean"==typeof t?t:t.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;let i;if(e.browserEvent.dataTransfer.dropEffect="boolean"!=typeof t&&0===t.effect?"copy":"move",i="boolean"!=typeof t&&t.feedback?t.feedback:void 0===e.index?[-1]:[e.index],i=-1===(i=m.distinct(i).filter(e=>e>=-1&&ee-t))[0]?[-1]:i,o=this.currentDragFeedback,r=i, +Array.isArray(o)&&Array.isArray(r)?m.equals(o,r):o===r)return!0;var o,r;if(this.currentDragFeedback=i,this.currentDragFeedbackDisposable.dispose(),-1===i[0])s.addClass(this.domNode,"drop-target"),s.addClass(this.rowsContainer,"drop-target"),this.currentDragFeedbackDisposable=n.toDisposable(()=>{s.removeClass(this.domNode,"drop-target"),s.removeClass(this.rowsContainer,"drop-target")});else{for(const e of i){const t=this.items[e];t.dropTarget=!0,t.row&&t.row.domNode&&s.addClass(t.row.domNode,"drop-target")}this.currentDragFeedbackDisposable=n.toDisposable(()=>{for(const e of i){const t=this.items[e];t.dropTarget=!1,t.row&&t.row.domNode&&s.removeClass(t.row.domNode,"drop-target")}})}return!0}onDragLeave(){this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=_.disposableTimeout(()=>this.clearDragOverFeedback(),100)}onDrop(e){if(!this.canDrop)return;const t=this.currentDragData;this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.currentDragData=void 0, +f.StaticDND.CurrentDragAndDropData=void 0,t&&e.browserEvent.dataTransfer&&(e.browserEvent.preventDefault(),t.update(e.browserEvent.dataTransfer),this.dnd.drop(t,e.element,e.index,e.browserEvent))}onDragEnd(e){this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.currentDragData=void 0,f.StaticDND.CurrentDragAndDropData=void 0,this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=n.Disposable.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const e=s.getTopLeftOffset(this.domNode).top;this.dragOverAnimationDisposable=s.animate(this.animateDragAndDropScrollTop.bind(this,e))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=_.disposableTimeout(()=>{this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)},1e3), +this.dragOverMouseY=e.pageY}animateDragAndDropScrollTop(e){if(void 0===this.dragOverMouseY)return;const t=this.dragOverMouseY-e,i=this.renderHeight-35;t<35?this.scrollTop+=Math.max(-14,Math.floor(.3*(t-35))):t>i&&(this.scrollTop+=Math.min(14,Math.floor(.3*(t-i))))}teardownDragAndDropScrollTopAnimation(){this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let i=e;for(;i instanceof HTMLElement&&i!==this.rowsContainer&&t.contains(i);){const e=i.getAttribute("data-index");if(e){const t=Number(e);if(!isNaN(t))return t}i=i.parentElement}}getRenderRange(e,t){return{start:this.rangeMap.indexAt(e),end:this.rangeMap.indexAfter(e+t-1)}}_rerender(e,t){const i=this.getRenderRange(e,t);let n,o;e===this.elementTop(i.start)?(n=i.start,o=0):i.end-i.start>1&&(n=i.start+1,o=this.elementTop(n)-e);let s=0;for(;;){ +const r=this.getRenderRange(e,t);let a=!1;for(let e=r.start;ee.templateData===i);if(n>=0){const e=this.renderedElements[n];this.trait.unrender(i),e.index=t}else{const e={index:t,templateData:i};this.renderedElements.push(e)}this.trait.renderIndex(t,i)}splice(e,t,i){const n=[];for(const o of this.renderedElements)o.index=e+t&&n.push({index:o.index+i-t,templateData:o.templateData});this.renderedElements=n}renderIndexes(e){for(const{index:t,templateData:i}of this.renderedElements)e.indexOf(t)>-1&&this.trait.renderIndex(t,i)}disposeTemplate(e){const t=o.firstIndex(this.renderedElements,t=>t.templateData===e);t<0||this.renderedElements.splice(t,1)}}class w{constructor(e){this._trait=e,this.indexes=[],this.sortedIndexes=[],this._onChange=new h.Emitter,this.onChange=this._onChange.event}get trait(){return this._trait}get renderer(){return new S(this)}splice(e,t,i){ +const n=i.length-t,o=e+t,s=[...this.sortedIndexes.filter(t=>tt?i+e:-1).filter(e=>-1!==e),...this.sortedIndexes.filter(e=>e>=o).map(e=>e+n)];this.renderer.splice(e,t,i.length),this._set(s,s)}renderIndex(e,t){r.toggleClass(t,this._trait,this.contains(e))}unrender(e){r.removeClass(e,this._trait)}set(e,t){return this._set(e,[...e].sort(B),t)}_set(e,t,i){const n=this.indexes,o=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const s=W(o,e);return this.renderer.renderIndexes(s),this._onChange.fire({indexes:e,browserEvent:i}),n}get(){return this.indexes}contains(e){return o.binarySearch(this.sortedIndexes,e,B)>=0}dispose(){i.dispose(this._onChange)}}a([s.memoize],w.prototype,"renderer",null);class y extends w{constructor(e){super("selected"),this.setAriaSelected=e}renderIndex(e,t){super.renderIndex(e,t),this.setAriaSelected&&(this.contains(e)?t.setAttribute("aria-selected","true"):t.setAttribute("aria-selected","false"))}}class E{constructor(e,t,i){this.trait=e,this.view=t, +this.identityProvider=i}splice(e,t,i){if(!this.identityProvider)return this.trait.splice(e,t,i.map(()=>!1));const n=this.trait.get().map(e=>this.identityProvider.getId(this.view.element(e)).toString()),o=i.map(e=>n.indexOf(this.identityProvider.getId(e).toString())>-1);this.trait.splice(e,t,o)}}function L(e){return"INPUT"===e.tagName||"TEXTAREA"===e.tagName}function x(e){return!!r.hasClass(e,"monaco-editor")||!r.hasClass(e,"monaco-list")&&(!!e.parentElement&&x(e.parentElement))}t.isInputElement=L,t.isMonacoEditor=x;class D{constructor(e,t,n){this.list=e,this.view=t,this.disposables=new i.DisposableStore;const o=!1!==n.multipleSelectionSupport,s=h.Event.chain(u.domEvent(t.domNode,"keydown")).filter(e=>!L(e.target)).map(e=>new c.StandardKeyboardEvent(e));s.filter(e=>3===e.keyCode).on(this.onEnter,this,this.disposables),s.filter(e=>16===e.keyCode).on(this.onUpArrow,this,this.disposables),s.filter(e=>18===e.keyCode).on(this.onDownArrow,this,this.disposables), +s.filter(e=>11===e.keyCode).on(this.onPageUpArrow,this,this.disposables),s.filter(e=>12===e.keyCode).on(this.onPageDownArrow,this,this.disposables),s.filter(e=>9===e.keyCode).on(this.onEscape,this,this.disposables),o&&s.filter(e=>(l.isMacintosh?e.metaKey:e.ctrlKey)&&31===e.keyCode).on(this.onCtrlA,this,this.disposables)}onEnter(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(this.list.getFocus(),e.browserEvent)}onUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPrevious(1,!1,e.browserEvent),this.list.reveal(this.list.getFocus()[0]),this.view.domNode.focus()}onDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNext(1,!1,e.browserEvent),this.list.reveal(this.list.getFocus()[0]),this.view.domNode.focus()}onPageUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPreviousPage(e.browserEvent),this.list.reveal(this.list.getFocus()[0]),this.view.domNode.focus()}onPageDownArrow(e){e.preventDefault(),e.stopPropagation(), +this.list.focusNextPage(e.browserEvent),this.list.reveal(this.list.getFocus()[0]),this.view.domNode.focus()}onCtrlA(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(o.range(this.list.length),e.browserEvent),this.view.domNode.focus()}onEscape(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection([],e.browserEvent),this.view.domNode.focus()}dispose(){this.disposables.dispose()}}var k;!function(e){e[e.Idle=0]="Idle",e[e.Typing=1]="Typing"}(k||(k={})),t.DefaultKeyboardNavigationDelegate=new class{mightProducePrintableCharacter(e){return!(e.ctrlKey||e.metaKey||e.altKey)&&(e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30||e.keyCode>=93&&e.keyCode<=102||e.keyCode>=80&&e.keyCode<=90)}};class N{constructor(e,t,n,o){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=n,this.delegate=o,this.enabled=!1,this.state=k.Idle,this.automaticKeyboardNavigation=!0,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new i.DisposableStore, +this.disposables=new i.DisposableStore,this.updateOptions(e.options)}updateOptions(e){void 0===e.enableKeyboardNavigation||!!e.enableKeyboardNavigation?this.enable():this.disable(),void 0!==e.automaticKeyboardNavigation&&(this.automaticKeyboardNavigation=e.automaticKeyboardNavigation)}enable(){if(this.enabled)return;const e=h.Event.chain(u.domEvent(this.view.domNode,"keydown")).filter(e=>!L(e.target)).filter(()=>this.automaticKeyboardNavigation||this.triggered).map(e=>new c.StandardKeyboardEvent(e)).filter(e=>this.delegate.mightProducePrintableCharacter(e)).forEach(e=>{e.stopPropagation(),e.preventDefault()}).map(e=>e.browserEvent.key).event,t=h.Event.debounce(e,()=>null,800);h.Event.reduce(h.Event.any(e,t),(e,t)=>null===t?null:(e||"")+t)(this.onInput,this,this.enabledDisposables),t(this.onClear,this,this.enabledDisposables),this.enabled=!0,this.triggered=!1}disable(){this.enabled&&(this.enabledDisposables.clear(),this.enabled=!1,this.triggered=!1)}onClear(){var e;const t=this.list.getFocus() +;if(t.length>0&&t[0]===this.previouslyFocused){const i=null===(e=this.list.options.accessibilityProvider)||void 0===e?void 0:e.getAriaLabel(this.list.element(t[0]));i&&b.alert(i)}this.previouslyFocused=-1}onInput(e){if(!e)return this.state=k.Idle,void(this.triggered=!1);const t=this.list.getFocus(),i=t.length>0?t[0]:0,n=this.state===k.Idle?1:0;this.state=k.Typing;for(let t=0;t!L(e.target)).map(e=>new c.StandardKeyboardEvent(e)).filter(e=>!(2!==e.keyCode||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey)).on(this.onTab,this,this.disposables)}onTab(e){if(e.target!==this.view.domNode)return;const t=this.list.getFocus();if(0===t.length)return;const i=this.view.domElement(t[0]);if(!i)return;const n=i.querySelector("[tabIndex]");if(!(n&&n instanceof HTMLElement&&-1!==n.tabIndex))return;const o=window.getComputedStyle(n);"hidden"!==o.visibility&&"none"!==o.display&&(e.preventDefault(),e.stopPropagation(),n.focus())}dispose(){this.disposables.dispose()}}function M(e){return l.isMacintosh?e.browserEvent.metaKey:e.browserEvent.ctrlKey}function R(e){return e.browserEvent.shiftKey}t.isSelectionSingleChangeEvent=M,t.isSelectionRangeChangeEvent=R;const T={isSelectionSingleChangeEvent:M,isSelectionRangeChangeEvent:R};class O{constructor(e){this.list=e,this.disposables=new i.DisposableStore,this._onPointer=new h.Emitter, +this.onPointer=this._onPointer.event,this.multipleSelectionSupport=!(!1===e.options.multipleSelectionSupport),this.multipleSelectionSupport&&(this.multipleSelectionController=e.options.multipleSelectionController||T),this.mouseSupport=void 0===e.options.mouseSupport||!!e.options.mouseSupport,this.mouseSupport&&(e.onMouseDown(this.onMouseDown,this,this.disposables),e.onContextMenu(this.onContextMenu,this,this.disposables),e.onMouseDblClick(this.onDoubleClick,this,this.disposables),e.onTouchStart(this.onMouseDown,this,this.disposables),this.disposables.add(d.Gesture.addTarget(e.getHTMLElement()))),h.Event.any(e.onMouseClick,e.onMouseMiddleClick,e.onTap)(this.onViewPointer,this,this.disposables)}isSelectionSingleChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionSingleChangeEvent(e):l.isMacintosh?e.browserEvent.metaKey:e.browserEvent.ctrlKey}isSelectionRangeChangeEvent(e){ +return this.multipleSelectionController?this.multipleSelectionController.isSelectionRangeChangeEvent(e):e.browserEvent.shiftKey}isSelectionChangeEvent(e){return this.isSelectionSingleChangeEvent(e)||this.isSelectionRangeChangeEvent(e)}onMouseDown(e){x(e.browserEvent.target)||document.activeElement!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(x(e.browserEvent.target))return;const t=void 0===e.index?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport)return;if(L(e.browserEvent.target)||x(e.browserEvent.target))return;let t=this.list.getFocus()[0];const i=this.list.getSelection();t=void 0===t?i[0]:t;const n=e.index;return void 0===n?(this.list.setFocus([],e.browserEvent),void this.list.setSelection([],e.browserEvent)):this.multipleSelectionSupport&&this.isSelectionRangeChangeEvent(e)?this.changeSelection(e,t):this.multipleSelectionSupport&&this.isSelectionChangeEvent(e)?this.changeSelection(e,t):(this.list.setFocus([n],e.browserEvent), +(o=e.browserEvent)instanceof MouseEvent&&2===o.button||this.list.setSelection([n],e.browserEvent),void this._onPointer.fire(e));var o}onDoubleClick(e){if(L(e.browserEvent.target)||x(e.browserEvent.target))return;if(this.multipleSelectionSupport&&this.isSelectionChangeEvent(e))return;const t=this.list.getFocus();this.list.setSelection(t,e.browserEvent)}changeSelection(e,t){const i=e.index;if(this.isSelectionRangeChangeEvent(e)&&void 0!==t){const n=Math.min(t,i),s=Math.max(t,i),r=o.range(n,s+1),a=this.list.getSelection(),l=function(e,t){const i=e.indexOf(t);if(-1===i)return[];const n=[];let o=i-1;for(;o>=0&&e[o]===t-(i-o);)n.push(e[o--]);n.reverse(),o=i;for(;o=e.length)i.push(t[o++]);else if(o>=t.length)i.push(e[n++]);else{if(e[n]===t[o]){n++,o++;continue}e[n]e!==i);this.list.setFocus([i]),t.length===n.length?this.list.setSelection([...n,i],e.browserEvent):this.list.setSelection(n,e.browserEvent)}}dispose(){this.disposables.dispose()}}t.MouseController=O;class A{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){const t=this.selectorSuffix&&`.${this.selectorSuffix}`,i=[];e.listBackground&&(e.listBackground.isOpaque()?i.push(`.monaco-list${t} .monaco-list-rows { background: ${e.listBackground}; }`):l.isMacintosh||console.warn(`List with id '${this.selectorSuffix}' was styled with a non-opaque background color. This will break sub-pixel antialiasing.`)),e.listFocusBackground&&(i.push(`.monaco-list${t}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),i.push(`.monaco-list${t}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)), +e.listFocusForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(i.push(`.monaco-list${t}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),i.push(`.monaco-list${t}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listFocusAndSelectionBackground&&i.push(`\n\t\t\t\t.monaco-drag-image,\n\t\t\t\t.monaco-list${t}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; }\n\t\t\t`),e.listFocusAndSelectionForeground&&i.push(`\n\t\t\t\t.monaco-drag-image,\n\t\t\t\t.monaco-list${t}:focus .monaco-list-row.selected.focused { color: ${e.listFocusAndSelectionForeground}; }\n\t\t\t`), +e.listInactiveFocusBackground&&(i.push(`.monaco-list${t} .monaco-list-row.focused { background-color: ${e.listInactiveFocusBackground}; }`),i.push(`.monaco-list${t} .monaco-list-row.focused:hover { background-color: ${e.listInactiveFocusBackground}; }`)),e.listInactiveSelectionBackground&&(i.push(`.monaco-list${t} .monaco-list-row.selected { background-color: ${e.listInactiveSelectionBackground}; }`),i.push(`.monaco-list${t} .monaco-list-row.selected:hover { background-color: ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&i.push(`.monaco-list${t} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&i.push(`.monaco-list${t}:not(.drop-target) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&i.push(`.monaco-list${t} .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`), +e.listSelectionOutline&&i.push(`.monaco-list${t} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listFocusOutline&&i.push(`\n\t\t\t\t.monaco-drag-image,\n\t\t\t\t.monaco-list${t}:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }\n\t\t\t`),e.listInactiveFocusOutline&&i.push(`.monaco-list${t} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&i.push(`.monaco-list${t} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropBackground&&i.push(`\n\t\t\t\t.monaco-list${t}.drop-target,\n\t\t\t\t.monaco-list${t} .monaco-list-rows.drop-target,\n\t\t\t\t.monaco-list${t} .monaco-list-row.drop-target { background-color: ${e.listDropBackground} !important; color: inherit !important; }\n\t\t\t`), +e.listFilterWidgetBackground&&i.push(`.monaco-list-type-filter { background-color: ${e.listFilterWidgetBackground} }`),e.listFilterWidgetOutline&&i.push(`.monaco-list-type-filter { border: 1px solid ${e.listFilterWidgetOutline}; }`),e.listFilterWidgetNoMatchesOutline&&i.push(`.monaco-list-type-filter.no-matches { border: 1px solid ${e.listFilterWidgetNoMatchesOutline}; }`),e.listMatchesShadow&&i.push(`.monaco-list-type-filter { box-shadow: 1px 1px 1px ${e.listMatchesShadow}; }`);const n=i.join("\n");n!==this.styleElement.innerHTML&&(this.styleElement.innerHTML=n)}}t.DefaultStyleController=A;const P={listFocusBackground:m.Color.fromHex("#7FB0D0"),listActiveSelectionBackground:m.Color.fromHex("#0E639C"),listActiveSelectionForeground:m.Color.fromHex("#FFFFFF"),listFocusAndSelectionBackground:m.Color.fromHex("#094771"),listFocusAndSelectionForeground:m.Color.fromHex("#FFFFFF"),listInactiveSelectionBackground:m.Color.fromHex("#3F3F46"),listHoverBackground:m.Color.fromHex("#2A2D2E"), +listDropBackground:m.Color.fromHex("#383B3D"),treeIndentGuidesStroke:m.Color.fromHex("#a9a9a9")},F={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI:()=>null,onDragStart(){},onDragOver:()=>!1,drop(){}}};function W(e,t){const i=[];let n=0,o=0;for(;n=e.length)i.push(t[o++]);else if(o>=t.length)i.push(e[n++]);else{if(e[n]===t[o]){i.push(e[n]),n++,o++;continue}e[n]e-t;class V{constructor(e,t){this._templateId=e,this.renderers=t}get templateId(){return this._templateId}renderTemplate(e){return this.renderers.map(t=>t.renderTemplate(e))}renderElement(e,t,i,n){let o=0;for(const s of this.renderers)s.renderElement(e,t,i[o++],n)}disposeElement(e,t,i,n){let o=0;for(const s of this.renderers)s.disposeElement&&s.disposeElement(e,t,i[o],n),o+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}}class z{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"} +renderTemplate(e){return e}renderElement(e,t,i){const n=this.accessibilityProvider.getAriaLabel(e);n?i.setAttribute("aria-label",n):i.removeAttribute("aria-label");const o=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);"number"==typeof o?i.setAttribute("aria-level",`${o}`):i.removeAttribute("aria-level")}disposeTemplate(e){}}class H{constructor(e,t){this.list=e,this.dnd=t}getDragElements(e){const t=this.list.getSelectedElements();return t.indexOf(e)>-1?t:[e]}getDragURI(e){return this.dnd.getDragURI(e)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e,t)}onDragStart(e,t){this.dnd.onDragStart&&this.dnd.onDragStart(e,t)}onDragOver(e,t,i,n){return this.dnd.onDragOver(e,t,i,n)}onDragEnd(e){this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}drop(e,t,i,n){this.dnd.drop(e,t,i,n)}}class K{constructor(e,n,o,s,a=F){var l;this.user=e,this._options=a,this.eventBufferer=new h.EventBufferer,this._ariaLabel="",this.disposables=new i.DisposableStore, +this.didJustPressContextMenuKey=!1,this._onDidDispose=new h.Emitter,this.onDidDispose=this._onDidDispose.event;const d=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?null===(l=this._options.accessibilityProvider)||void 0===l?void 0:l.getWidgetRole():"list";this.selection=new y("listbox"!==d),this.focus=new w("focused"),f.mixin(a,P,!1);const c=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=a.accessibilityProvider,this.accessibilityProvider&&(c.push(new z(this.accessibilityProvider)),this.accessibilityProvider.onDidChangeActiveDescendant&&this.accessibilityProvider.onDidChangeActiveDescendant(this.onDidChangeActiveDescendant,this,this.disposables)),s=s.map(e=>new V(e.templateId,[...c,e]));const g=Object.assign(Object.assign({},a),{dnd:a.dnd&&new H(this,a.dnd)});if(this.view=new p.ListView(n,o,s,g),this.view.domNode.setAttribute("role",d),a.styleController)this.styleController=a.styleController(this.view.domId);else{ +const e=r.createStyleSheet(this.view.domNode);this.styleController=new A(e,this.view.domId)}if(this.spliceable=new _.CombinedSpliceable([new E(this.focus,this.view,a.identityProvider),new E(this.selection,this.view,a.identityProvider),this.view]),this.disposables.add(this.focus),this.disposables.add(this.selection),this.disposables.add(this.view),this.disposables.add(this._onDidDispose),this.onDidFocus=h.Event.map(u.domEvent(this.view.domNode,"focus",!0),()=>null),this.onDidBlur=h.Event.map(u.domEvent(this.view.domNode,"blur",!0),()=>null),this.disposables.add(new I(this,this.view)),"boolean"!=typeof a.keyboardSupport||a.keyboardSupport){const e=new D(this,this.view,a);this.disposables.add(e)}if(a.keyboardNavigationLabelProvider){const e=a.keyboardNavigationDelegate||t.DefaultKeyboardNavigationDelegate;this.typeLabelController=new N(this,this.view,a.keyboardNavigationLabelProvider,e),this.disposables.add(this.typeLabelController)}this.mouseController=this.createMouseController(a), +this.disposables.add(this.mouseController),this.onDidChangeFocus(this._onFocusChange,this,this.disposables),this.onDidChangeSelection(this._onSelectionChange,this,this.disposables),this.accessibilityProvider&&(this.ariaLabel=this.accessibilityProvider.getWidgetAriaLabel()),a.multipleSelectionSupport&&this.view.domNode.setAttribute("aria-multiselectable","true")}get onDidChangeFocus(){return h.Event.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e))}get onDidChangeSelection(){return h.Event.map(this.eventBufferer.wrapEvent(this.selection.onChange),e=>this.toListEvent(e))}get domId(){return this.view.domId}get onMouseClick(){return this.view.onMouseClick}get onMouseDblClick(){return this.view.onMouseDblClick}get onMouseMiddleClick(){return this.view.onMouseMiddleClick}get onPointer(){return this.mouseController.onPointer}get onMouseDown(){return this.view.onMouseDown}get onTouchStart(){return this.view.onTouchStart}get onTap(){return this.view.onTap}get onContextMenu(){ +const e=h.Event.chain(u.domEvent(this.view.domNode,"keydown")).map(e=>new c.StandardKeyboardEvent(e)).filter(e=>this.didJustPressContextMenuKey=58===e.keyCode||e.shiftKey&&68===e.keyCode).filter(e=>(e.preventDefault(),e.stopPropagation(),!1)).event,t=h.Event.chain(u.domEvent(this.view.domNode,"keyup")).filter(()=>{const e=this.didJustPressContextMenuKey;return this.didJustPressContextMenuKey=!1,e}).filter(()=>this.getFocus().length>0&&!!this.view.domElement(this.getFocus()[0])).map(e=>{const t=this.getFocus()[0];return{index:t,element:this.view.element(t),anchor:this.view.domElement(t),browserEvent:e}}).event,i=h.Event.chain(this.view.onContextMenu).filter(()=>!this.didJustPressContextMenuKey).map(({element:e,index:t,browserEvent:i})=>({element:e,index:t,anchor:{x:i.clientX+1,y:i.clientY},browserEvent:i})).event;return h.Event.any(e,t,i)}get onKeyDown(){return u.domEvent(this.view.domNode,"keydown")}createMouseController(e){return new O(this)}updateOptions(e={}){ +this._options=Object.assign(Object.assign({},this._options),e),this.typeLabelController&&this.typeLabelController.updateOptions(this._options),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,i=[]){if(e<0||e>this.view.length)throw new g.ListError(this.user,`Invalid start index: ${e}`);if(t<0)throw new g.ListError(this.user,`Invalid delete count: ${t}`);0===t&&0===i.length||this.eventBufferer.bufferEvents(()=>this.spliceable.splice(e,t,i))}rerender(){this.view.rerender()}element(e){return this.view.element(e)}get length(){return this.view.length}get contentHeight(){return this.view.contentHeight}get scrollTop(){return this.view.getScrollTop()}set scrollTop(e){this.view.setScrollTop(e)}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){this._ariaLabel=e,this.view.domNode.setAttribute("aria-label",e)}domFocus(){this.view.domNode.focus()}layout(e,t){this.view.layout(e,t)}setSelection(e,t){for(const t of e)if(t<0||t>=this.length)throw new g.ListError(this.user,`Invalid index ${t}`) +;this.selection.set(e,t)}getSelection(){return this.selection.get()}getSelectedElements(){return this.getSelection().map(e=>this.view.element(e))}setFocus(e,t){for(const t of e)if(t<0||t>=this.length)throw new g.ListError(this.user,`Invalid index ${t}`);this.focus.set(e,t)}focusNext(e=1,t=!1,i,n){if(0===this.length)return;const o=this.focus.get(),s=this.findNextIndex(o.length>0?o[0]+e:0,t,n);s>-1&&this.setFocus([s],i)}focusPrevious(e=1,t=!1,i,n){if(0===this.length)return;const o=this.focus.get(),s=this.findPreviousIndex(o.length>0?o[0]-e:0,t,n);s>-1&&this.setFocus([s],i)}focusNextPage(e,t){let i=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);i=0===i?0:i-1;const n=this.view.element(i),o=this.getFocusedElements()[0];if(o!==n){const n=this.findPreviousIndex(i,!1,t);n>-1&&o!==this.view.element(n)?this.setFocus([n],e):this.setFocus([i],e)}else{const n=this.view.getScrollTop();this.view.setScrollTop(n+this.view.renderHeight-this.view.elementHeight(i)), +this.view.getScrollTop()!==n&&setTimeout(()=>this.focusNextPage(e,t),0)}}focusPreviousPage(e,t){let i;const n=this.view.getScrollTop();i=0===n?this.view.indexAt(n):this.view.indexAfter(n-1);const o=this.view.element(i),s=this.getFocusedElements()[0];if(s!==o){const n=this.findNextIndex(i,!1,t);n>-1&&s!==this.view.element(n)?this.setFocus([n],e):this.setFocus([i],e)}else{const i=n;this.view.setScrollTop(n-this.view.renderHeight),this.view.getScrollTop()!==i&&setTimeout(()=>this.focusPreviousPage(e,t),0)}}focusLast(e,t){if(0===this.length)return;const i=this.findPreviousIndex(this.length-1,!1,t);i>-1&&this.setFocus([i],e)}focusFirst(e,t){this.focusNth(0,e,t)}focusNth(e,t,i){if(0===this.length)return;const n=this.findNextIndex(e,!1,i);n>-1&&this.setFocus([n],t)}findNextIndex(e,t=!1,i){for(let n=0;n=this.length&&!t)return-1;if(e%=this.length,!i||i(this.element(e)))return e;e++}return-1}findPreviousIndex(e,t=!1,i){for(let n=0;nthis.view.element(e))}reveal(e,t){if(e<0||e>=this.length)throw new g.ListError(this.user,`Invalid index ${e}`);const i=this.view.getScrollTop(),o=this.view.elementTop(e),s=this.view.elementHeight(e);if(n.isNumber(t)){const e=s-this.view.renderHeight;this.view.setScrollTop(e*v.clamp(t,0,1)+o)}else{const e=o+s,t=i+this.view.renderHeight;o=t||(o=t&&this.view.setScrollTop(e-this.view.renderHeight))}}getRelativeTop(e){if(e<0||e>=this.length)throw new g.ListError(this.user,`Invalid index ${e}`);const t=this.view.getScrollTop(),i=this.view.elementTop(e),n=this.view.elementHeight(e);if(it+this.view.renderHeight)return null;const o=n-this.view.renderHeight;return Math.abs((t-i)/o)}getHTMLElement(){return this.view.domNode}style(e){this.styleController.style(e)}toListEvent({indexes:e,browserEvent:t}){ +return{indexes:e,elements:e.map(e=>this.view.element(e)),browserEvent:t}}_onFocusChange(){const e=this.focus.get();r.toggleClass(this.view.domNode,"element-focused",e.length>0),this.onDidChangeActiveDescendant()}onDidChangeActiveDescendant(){var e;const t=this.focus.get();if(t.length>0){let i;(null===(e=this.accessibilityProvider)||void 0===e?void 0:e.getActiveDescendantId)&&(i=this.accessibilityProvider.getActiveDescendantId(this.view.element(t[0]))),this.view.domNode.setAttribute("aria-activedescendant",i||this.view.getElementDomId(t[0]))}else this.view.domNode.removeAttribute("aria-activedescendant")}_onSelectionChange(){const e=this.selection.get();r.toggleClass(this.view.domNode,"selection-none",0===e.length),r.toggleClass(this.view.domNode,"selection-single",1===e.length),r.toggleClass(this.view.domNode,"selection-multiple",e.length>1)}dispose(){this._onDidDispose.fire(),this.disposables.dispose(),this._onDidDispose.dispose()}}a([s.memoize],K.prototype,"onDidChangeFocus",null), +a([s.memoize],K.prototype,"onDidChangeSelection",null),a([s.memoize],K.prototype,"onContextMenu",null),t.List=K})),define(t[302],i([0,1,2,19,118,4,25,201]),(function(e,t,i,n,o,s,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PagedList=void 0;class a{constructor(e,t){this.renderer=e,this.modelProvider=t}get templateId(){return this.renderer.templateId}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:i.Disposable.None}}renderElement(e,t,i,n){if(i.disposable&&i.disposable.dispose(),!i.data)return;const o=this.modelProvider();if(o.isResolved(e))return this.renderer.renderElement(o.get(e),e,i.data,n);const s=new r.CancellationTokenSource,a=o.resolve(e,s.token);i.disposable={dispose:()=>s.cancel()},this.renderer.renderPlaceholder(e,i.data),a.then(t=>this.renderer.renderElement(t,e,i.data,n))}disposeTemplate(e){e.disposable&&(e.disposable.dispose(),e.disposable=void 0),e.data&&(this.renderer.disposeTemplate(e.data),e.data=void 0)}}class l{constructor(e,t){ +this.modelProvider=e,this.accessibilityProvider=t}getWidgetAriaLabel(){return this.accessibilityProvider.getWidgetAriaLabel()}getAriaLabel(e){const t=this.modelProvider();return t.isResolved(e)?this.accessibilityProvider.getAriaLabel(t.get(e)):null}}t.PagedList=class{constructor(e,t,i,n,s={}){const r=()=>this.model,d=n.map(e=>new a(e,r));this.list=new o.List(e,t,i,d,function(e,t){return Object.assign(Object.assign({},t),{accessibilityProvider:t.accessibilityProvider&&new l(e,t.accessibilityProvider)})}(r,s))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}get onDidFocus(){return this.list.onDidFocus}get onDidDispose(){return this.list.onDidDispose}get onMouseDblClick(){return s.Event.map(this.list.onMouseDblClick,({element:e,index:t,browserEvent:i})=>({element:void 0===e?void 0:this._model.get(e),index:t,browserEvent:i}))}get onPointer(){return s.Event.map(this.list.onPointer,({element:e,index:t,browserEvent:i})=>({element:void 0===e?void 0:this._model.get(e), +index:t,browserEvent:i}))}get onDidChangeFocus(){return s.Event.map(this.list.onDidChangeFocus,({elements:e,indexes:t,browserEvent:i})=>({elements:e.map(e=>this._model.get(e)),indexes:t,browserEvent:i}))}get onDidChangeSelection(){return s.Event.map(this.list.onDidChangeSelection,({elements:e,indexes:t,browserEvent:i})=>({elements:e.map(e=>this._model.get(e)),indexes:t,browserEvent:i}))}get model(){return this._model}set model(e){this._model=e,this.list.splice(0,this.list.length,n.range(e.length))}getFocus(){return this.list.getFocus()}setSelection(e,t){this.list.setSelection(e,t)}getSelection(){return this.list.getSelection()}style(e){this.list.style(e)}dispose(){this.list.dispose()}}})),define(t[303],i([9]),{}),define(t[304],i([0,1,2,4,23,7,109,19,117,29,57,303]),(function(e,t,i,n,o,s,r,a,l,d,c){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SplitView=t.Sizing=void 0;const h={separatorBorder:d.Color.transparent};class u{constructor(e,t,i,n){this.container=e,this.view=t,this.disposable=n, +this._cachedVisibleSize=void 0,"number"==typeof i?(this._size=i,this._cachedVisibleSize=void 0,s.addClass(e,"visible")):(this._size=0,this._cachedVisibleSize=i.cachedVisibleSize)}set size(e){this._size=e}get size(){return this._size}get visible(){return void 0===this._cachedVisibleSize}setVisible(e,t){e!==this.visible&&(e?(this.size=r.clamp(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize="number"==typeof t?t:this.size,this.size=0),s.toggleClass(this.container,"visible",e),this.view.setVisible&&this.view.setVisible(e))}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}get priority(){return this.view.priority}get snap(){return!!this.view.snap}set enabled(e){this.container.style.pointerEvents=e?"":"none"}layout(e,t){this.layoutContainer(e), +this.view.layout(this.size,e,t)}dispose(){return this.disposable.dispose(),this.view}}class g extends u{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class p extends u{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var m;!function(e){e[e.Idle=0]="Idle",e[e.Busy=1]="Busy"}(m||(m={})),function(e){e.Distribute={type:"distribute"},e.Split=function(e){return{type:"split",index:e}},e.Invisible=function(e){return{type:"invisible",cachedVisibleSize:e}}}(t.Sizing||(t.Sizing={}));class f extends i.Disposable{constructor(e,t={}){super(),this.size=0,this.contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=m.Idle,this._onDidSashChange=this._register(new n.Emitter),this.onDidSashChange=this._onDidSashChange.event,this._onDidSashReset=this._register(new n.Emitter),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.orientation=o.isUndefined(t.orientation)?0:t.orientation, +this.inverseAltBehavior=!!t.inverseAltBehavior,this.proportionalLayout=!!o.isUndefined(t.proportionalLayout)||!!t.proportionalLayout,this.el=document.createElement("div"),s.addClass(this.el,"monaco-split-view2"),s.addClass(this.el,0===this.orientation?"vertical":"horizontal"),e.appendChild(this.el),this.sashContainer=s.append(this.el,s.$(".sash-container")),this.viewContainer=s.append(this.el,s.$(".split-view-container")),this.style(t.styles||h),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((e,t)=>{const i=o.isUndefined(e.visible)||e.visible?e.size:{type:"invisible",cachedVisibleSize:e.size},n=e.view;this.doAddView(n,i,t,!0)}),this.contentSize=this.viewItems.reduce((e,t)=>e+t.size,0),this.saveProportions())}get orthogonalStartSash(){return this._orthogonalStartSash}set orthogonalStartSash(e){for(const t of this.sashItems)t.sash.orthogonalStartSash=e;this._orthogonalStartSash=e}get orthogonalEndSash(){return this._orthogonalEndSash}set orthogonalEndSash(e){ +for(const t of this.sashItems)t.sash.orthogonalEndSash=e;this._orthogonalEndSash=e}get startSnappingEnabled(){return this._startSnappingEnabled}set startSnappingEnabled(e){this._startSnappingEnabled!==e&&(this._startSnappingEnabled=e,this.updateSashEnablement())}get endSnappingEnabled(){return this._endSnappingEnabled}set endSnappingEnabled(e){this._endSnappingEnabled!==e&&(this._endSnappingEnabled=e,this.updateSashEnablement())}style(e){e.separatorBorder.isTransparent()?(s.removeClass(this.el,"separator-border"),this.el.style.removeProperty("--separator-border")):(s.addClass(this.el,"separator-border"),this.el.style.setProperty("--separator-border",e.separatorBorder.toString()))}addView(e,t,i=this.viewItems.length,n){this.doAddView(e,t,i,n)}layout(e,t){const i=Math.max(this.size,this.contentSize);if(this.size=e,this.layoutContext=t,this.proportions)for(let t=0;t1===this.viewItems[e].priority),o=t.filter(e=>2===this.viewItems[e].priority);this.resize(this.viewItems.length-1,e-i,void 0,n,o)}this.distributeEmptySpace(),this.layoutViews()}saveProportions(){this.proportionalLayout&&this.contentSize>0&&(this.proportions=this.viewItems.map(e=>e.size/this.contentSize))}onSashStart({sash:e,start:t,alt:n}){for(const e of this.viewItems)e.enabled=!1;const o=a.firstIndex(this.sashItems,t=>t.sash===e),s=i.combinedDisposable(c.domEvent(document.body,"keydown")(e=>r(this.sashDragState.current,e.altKey)),c.domEvent(document.body,"keyup")(()=>r(this.sashDragState.current,!1))),r=(e,t)=>{const i=this.viewItems.map(e=>e.size);let n,r,l=Number.NEGATIVE_INFINITY,d=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(t=!t),t){if(o===this.sashItems.length-1){const e=this.viewItems[o];l=(e.minimumSize-e.size)/2,d=(e.maximumSize-e.size)/2}else{const e=this.viewItems[o+1];l=(e.size-e.maximumSize)/2,d=(e.size-e.minimumSize)/2}}if(!t){ +const e=a.range(o,-1),t=a.range(o+1,this.viewItems.length),s=e.reduce((e,t)=>e+(this.viewItems[t].minimumSize-i[t]),0),l=e.reduce((e,t)=>e+(this.viewItems[t].viewMaximumSize-i[t]),0),d=0===t.length?Number.POSITIVE_INFINITY:t.reduce((e,t)=>e+(i[t]-this.viewItems[t].minimumSize),0),c=0===t.length?Number.NEGATIVE_INFINITY:t.reduce((e,t)=>e+(i[t]-this.viewItems[t].viewMaximumSize),0),h=Math.max(s,c),u=Math.min(d,l),g=this.findFirstSnapIndex(e),p=this.findFirstSnapIndex(t);if("number"==typeof g){const e=this.viewItems[g],t=Math.floor(e.viewMinimumSize/2);n={index:g,limitDelta:e.visible?h-t:h+t,size:e.size}}if("number"==typeof p){const e=this.viewItems[p],t=Math.floor(e.viewMinimumSize/2);r={index:p,limitDelta:e.visible?u+t:u-t,size:e.size}}}this.sashDragState={start:e,current:e,index:o,sizes:i,minDelta:l,maxDelta:d,alt:t,snapBefore:n,snapAfter:r,disposable:s}};r(t,n)}onSashChange({current:e}){const{index:t,start:i,sizes:n,alt:o,minDelta:s,maxDelta:r,snapBefore:a,snapAfter:l}=this.sashDragState +;this.sashDragState.current=e;const d=e-i,c=this.resize(t,d,n,void 0,void 0,s,r,a,l);if(o){const e=t===this.sashItems.length-1,i=this.viewItems.map(e=>e.size),n=e?t:t+1,o=this.viewItems[n],s=o.size-o.maximumSize,r=o.size-o.minimumSize,a=e?t-1:t+1;this.resize(a,-c,i,void 0,void 0,s,r)}this.distributeEmptySpace(),this.layoutViews()}onSashEnd(e){this._onDidSashChange.fire(e),this.sashDragState.disposable.dispose(),this.saveProportions();for(const e of this.viewItems)e.enabled=!0}onViewChange(e,t){const i=this.viewItems.indexOf(e);i<0||i>=this.viewItems.length||(t="number"==typeof t?t:e.size,t=r.clamp(t,e.minimumSize,e.maximumSize),this.inverseAltBehavior&&i>0?(this.resize(i-1,Math.floor((e.size-t)/2)),this.distributeEmptySpace(),this.layoutViews()):(e.size=t,this.relayout([i],void 0)))}resizeView(e,t){if(this.state!==m.Idle)throw new Error("Cant modify splitview");if(this.state=m.Busy,e<0||e>=this.viewItems.length)return +;const i=a.range(this.viewItems.length).filter(t=>t!==e),n=[...i.filter(e=>1===this.viewItems[e].priority),e],o=i.filter(e=>2===this.viewItems[e].priority),s=this.viewItems[e];t=Math.round(t),t=r.clamp(t,s.minimumSize,Math.min(s.maximumSize,this.size)),s.size=t,this.relayout(n,o),this.state=m.Idle}distributeViewSizes(){const e=[];let t=0;for(const i of this.viewItems)i.maximumSize-i.minimumSize>0&&(e.push(i),t+=i.size);const i=Math.floor(t/e.length);for(const t of e)t.size=r.clamp(i,t.minimumSize,t.maximumSize);const n=a.range(this.viewItems.length),o=n.filter(e=>1===this.viewItems[e].priority),s=n.filter(e=>2===this.viewItems[e].priority);this.relayout(o,s)}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}doAddView(e,t,o=this.viewItems.length,r){if(this.state!==m.Idle)throw new Error("Cant modify splitview");this.state=m.Busy;const d=s.$(".split-view-view") +;o===this.viewItems.length?this.viewContainer.appendChild(d):this.viewContainer.insertBefore(d,this.viewContainer.children.item(o));const c=e.onDidChange(e=>this.onViewChange(_,e)),h=i.toDisposable(()=>this.viewContainer.removeChild(d)),u=i.combinedDisposable(c,h);let f;f="number"==typeof t?t:"split"===t.type?this.getViewSize(t.index)/2:"invisible"===t.type?{cachedVisibleSize:t.cachedVisibleSize}:e.minimumSize;const _=0===this.orientation?new g(d,e,f,u):new p(d,e,f,u);if(this.viewItems.splice(o,0,_),this.viewItems.length>1){const e=0===this.orientation?new l.Sash(this.sashContainer,{getHorizontalSashTop:e=>this.getSashPosition(e)},{orientation:1,orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash}):new l.Sash(this.sashContainer,{getVerticalSashLeft:e=>this.getSashPosition(e)},{orientation:0,orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash}),t=0===this.orientation?t=>({sash:e,start:t.startY,current:t.currentY,alt:t.altKey}):t=>({sash:e, +start:t.startX,current:t.currentX,alt:t.altKey}),s=n.Event.map(e.onDidStart,t)(this.onSashStart,this),r=n.Event.map(e.onDidChange,t)(this.onSashChange,this),d=n.Event.map(e.onDidEnd,()=>a.firstIndex(this.sashItems,t=>t.sash===e))(this.onSashEnd,this),c=e.onDidReset(()=>{const t=a.firstIndex(this.sashItems,t=>t.sash===e),i=a.range(t,-1),n=a.range(t+1,this.viewItems.length),o=this.findFirstSnapIndex(i),s=this.findFirstSnapIndex(n);("number"!=typeof o||this.viewItems[o].visible)&&("number"!=typeof s||this.viewItems[s].visible)&&this._onDidSashReset.fire(t)}),h=i.combinedDisposable(s,r,d,c,e),u={sash:e,disposable:h};this.sashItems.splice(o-1,0,u)}let v;d.appendChild(e.element),"number"!=typeof t&&"split"===t.type&&(v=[t.index]),r||this.relayout([o],v),this.state=m.Idle,r||"number"==typeof t||"distribute"!==t.type||this.distributeViewSizes()}relayout(e,t){const i=this.viewItems.reduce((e,t)=>e+t.size,0);this.resize(this.viewItems.length-1,this.size-i,void 0,e,t),this.distributeEmptySpace(),this.layoutViews(), +this.saveProportions()}resize(e,t,i=this.viewItems.map(e=>e.size),n,o,s=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY,d,c){if(e<0||e>=this.viewItems.length)return 0;const h=a.range(e,-1),u=a.range(e+1,this.viewItems.length);if(o)for(const e of o)a.pushToStart(h,e),a.pushToStart(u,e);if(n)for(const e of n)a.pushToEnd(h,e),a.pushToEnd(u,e);const g=h.map(e=>this.viewItems[e]),p=h.map(e=>i[e]),m=u.map(e=>this.viewItems[e]),f=u.map(e=>i[e]),_=h.reduce((e,t)=>e+(this.viewItems[t].minimumSize-i[t]),0),v=h.reduce((e,t)=>e+(this.viewItems[t].maximumSize-i[t]),0),C=0===u.length?Number.POSITIVE_INFINITY:u.reduce((e,t)=>e+(i[t]-this.viewItems[t].minimumSize),0),b=0===u.length?Number.NEGATIVE_INFINITY:u.reduce((e,t)=>e+(i[t]-this.viewItems[t].maximumSize),0),S=Math.max(_,b,s),w=Math.min(C,v,l);let y=!1;if(d){const e=this.viewItems[d.index],i=t>=d.limitDelta;y=i!==e.visible,e.setVisible(i,d.size)}if(!y&&c){const e=this.viewItems[c.index],i=te+t.size,0);let i=this.size-t;const n=a.range(this.viewItems.length-1,-1),o=n.filter(e=>1===this.viewItems[e].priority),s=n.filter(e=>2===this.viewItems[e].priority);for(const e of s)a.pushToStart(n,e);for(const e of o)a.pushToEnd(n,e);"number"==typeof e&&a.pushToEnd(n,e);for(let e=0;0!==i&&ee+t.size,0);let e=0;for(const t of this.viewItems)t.layout(e,this.layoutContext),e+=t.size;this.sashItems.forEach(e=>e.sash.layout()),this.updateSashEnablement()}updateSashEnablement(){let e=!1 +;const t=this.viewItems.map(t=>e=t.size-t.minimumSize>0||e);e=!1;const i=this.viewItems.map(t=>e=t.maximumSize-t.size>0||e),n=[...this.viewItems].reverse();e=!1;const o=n.map(t=>e=t.size-t.minimumSize>0||e).reverse();e=!1;const s=n.map(t=>e=t.maximumSize-t.size>0||e).reverse();let r=0;for(let e=0;e0||this.startSnappingEnabled)?n.state=1:h&&t[e]&&(r0)return;if(!e.visible&&e.snap)return t}}dispose(){super.dispose(),this.viewItems.forEach(e=>e.dispose()),this.viewItems=[],this.sashItems.forEach(e=>e.disposable.dispose()),this.sashItems=[]}}t.SplitView=f})),define(t[305],i([9]),{}),define(t[119],i([9]),{}),define(t[202],i([0,1,7,97,119]),(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getIconClass=void 0;const o={},s=new n.IdGenerator("quick-input-button-icon-");t.getIconClass=function(e){if(!e)return;let t;const n=e.dark.toString();return o[n]?t=o[n]:(t=s.nextId(),i.createCSSRule(`.${t}`,`background-image: ${i.asCSSUrl(e.light||e.dark)}`),i.createCSSRule(`.vs-dark .${t}, .hc-black .${t}`,`background-image: ${i.asCSSUrl(e.dark)}`),o[n]=t),t}})),define(t[306],i([9]),{}),define(t[307],i([9]),{}),define(t[308],i([9]),{}),define(t[309],i([9]),{}),define(t[310],i([9]),{}),define(t[311],i([9]),{}), +define(t[312],i([9]),{}),define(t[313],i([9]),{}),define(t[314],i([9]),{}),define(t[315],i([9]),{}),define(t[316],i([9]),{}),define(t[317],i([9]),{}),define(t[318],i([9]),{}),define(t[319],i([9]),{}),define(t[320],i([9]),{}),define(t[321],i([9]),{}),define(t[322],i([9]),{}),define(t[323],i([9]),{}),define(t[324],i([9]),{}),define(t[325],i([9]),{}),define(t[326],i([9]),{}),define(t[327],i([9]),{}),define(t[328],i([9]),{}),define(t[329],i([9]),{}),define(t[330],i([9]),{}),define(t[331],i([9]),{}),define(t[332],i([9]),{}),define(t[333],i([9]),{}),define(t[334],i([9]),{}),define(t[335],i([9]),{}),define(t[336],i([9]),{}),define(t[337],i([9]),{}),define(t[338],i([9]),{}),define(t[339],i([9]),{}),define(t[340],i([9]),{}),define(t[341],i([9]),{}),define(t[342],i([9]),{}),define(t[343],i([9]),{}),define(t[344],i([9]),{}),define(t[345],i([9]),{}),define(t[346],i([9]),{}),define(t[347],i([9]),{}),define(t[348],i([9]),{}),define(t[349],i([9]),{}),define(t[350],i([9]),{}),define(t[351],i([9]),{}), +define(t[352],i([9]),{}),define(t[353],i([0,1]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.readCharWidths=t.CharWidthRequest=void 0;t.CharWidthRequest=class{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}};class i{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(){this._createDomElements(),document.body.appendChild(this._container),this._readFromDomElements(),document.body.removeChild(this._container),this._container=null,this._testElements=null}_createDomElements(){const e=document.createElement("div");e.style.position="absolute",e.style.top="-50000px",e.style.width="50000px";const t=document.createElement("div");t.style.fontFamily=this._bareFontInfo.getMassagedFontFamily(),t.style.fontWeight=this._bareFontInfo.fontWeight,t.style.fontSize=this._bareFontInfo.fontSize+"px",t.style.fontFeatureSettings=this._bareFontInfo.fontFeatureSettings, +t.style.lineHeight=this._bareFontInfo.lineHeight+"px",t.style.letterSpacing=this._bareFontInfo.letterSpacing+"px",e.appendChild(t);const n=document.createElement("div");n.style.fontFamily=this._bareFontInfo.getMassagedFontFamily(),n.style.fontWeight="bold",n.style.fontSize=this._bareFontInfo.fontSize+"px",n.style.fontFeatureSettings=this._bareFontInfo.fontFeatureSettings,n.style.lineHeight=this._bareFontInfo.lineHeight+"px",n.style.letterSpacing=this._bareFontInfo.letterSpacing+"px",e.appendChild(n);const o=document.createElement("div");o.style.fontFamily=this._bareFontInfo.getMassagedFontFamily(),o.style.fontWeight=this._bareFontInfo.fontWeight,o.style.fontSize=this._bareFontInfo.fontSize+"px",o.style.fontFeatureSettings=this._bareFontInfo.fontFeatureSettings,o.style.lineHeight=this._bareFontInfo.lineHeight+"px",o.style.letterSpacing=this._bareFontInfo.letterSpacing+"px",o.style.fontStyle="italic",e.appendChild(o);const s=[];for(const e of this._requests){let r;0===e.type&&(r=t),2===e.type&&(r=n), +1===e.type&&(r=o),r.appendChild(document.createElement("br"));const a=document.createElement("span");i._render(a,e),r.appendChild(a),s.push(a)}this._container=e,this._testElements=s}static _render(e,t){if(" "===t.chr){let t=" ";for(let e=0;e<8;e++)t+=t;e.innerText=t}else{let i=t.chr;for(let e=0;e<8;e++)i+=i;e.textContent=i}}_readFromDomElements(){for(let e=0,t=this._requests.length;e{e&&e[0]&&e[0].contentRect?this.observe({width:e[0].contentRect.width,height:e[0].contentRect.height}):this.observe()}),this.resizeObserver.observe(this.referenceDomElement)):-1===this.measureReferenceDomElementToken&&(this.measureReferenceDomElementToken=setInterval(()=>this.observe(),100))}stopObserving(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),-1!==this.measureReferenceDomElementToken&&(clearInterval(this.measureReferenceDomElementToken),this.measureReferenceDomElementToken=-1)}observe(e){this.measureReferenceDomElement(!0,e)}measureReferenceDomElement(e,t){let i=0,n=0;t?(i=t.width,n=t.height):this.referenceDomElement&&(i=this.referenceDomElement.clientWidth,n=this.referenceDomElement.clientHeight),i=Math.max(5,i),n=Math.max(5,n),this.width===i&&this.height===n||(this.width=i,this.height=n,e&&this.changeCallback())}}t.ElementSizeObserver=n +})),define(t[155],i([0,1,7,86,51,2]),(function(e,t,i,n,o,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalEditorMouseMoveMonitor=t.EditorPointerEventFactory=t.EditorMouseEventFactory=t.EditorMouseEvent=t.createEditorPagePosition=t.EditorPagePosition=t.ClientCoordinates=t.PageCoordinates=void 0;class r{constructor(e,t){this.x=e,this.y=t}toClientCoordinates(){return new a(this.x-i.StandardWindow.scrollX,this.y-i.StandardWindow.scrollY)}}t.PageCoordinates=r;class a{constructor(e,t){this.clientX=e,this.clientY=t}toPageCoordinates(){return new r(this.clientX+i.StandardWindow.scrollX,this.clientY+i.StandardWindow.scrollY)}}t.ClientCoordinates=a;class l{constructor(e,t,i,n){this.x=e,this.y=t,this.width=i,this.height=n}}function d(e){const t=i.getDomNodePagePosition(e);return new l(t.left,t.top,t.width,t.height)}t.EditorPagePosition=l,t.createEditorPagePosition=d;class c extends o.StandardMouseEvent{constructor(e,t){super(e),this.pos=new r(this.posx,this.posy),this.editorPos=d(t)}} +t.EditorMouseEvent=c;t.EditorMouseEventFactory=class{constructor(e){this._editorViewDomNode=e}_create(e){return new c(e,this._editorViewDomNode)}onContextMenu(e,t){return i.addDisposableListener(e,"contextmenu",e=>{t(this._create(e))})}onMouseUp(e,t){return i.addDisposableListener(e,"mouseup",e=>{t(this._create(e))})}onMouseDown(e,t){return i.addDisposableListener(e,"mousedown",e=>{t(this._create(e))})}onMouseLeave(e,t){return i.addDisposableNonBubblingMouseOutListener(e,e=>{t(this._create(e))})}onMouseMoveThrottled(e,t,n,o){return i.addDisposableThrottledListener(e,"mousemove",t,(e,t)=>n(e,this._create(t)),o)}};t.EditorPointerEventFactory=class{constructor(e){this._editorViewDomNode=e}_create(e){return new c(e,this._editorViewDomNode)}onPointerUp(e,t){return i.addDisposableListener(e,"pointerup",e=>{t(this._create(e))})}onPointerDown(e,t){return i.addDisposableListener(e,"pointerdown",e=>{t(this._create(e))})}onPointerLeave(e,t){return i.addDisposableNonBubblingPointerOutListener(e,e=>{t(this._create(e))})} +onPointerMoveThrottled(e,t,n,o){return i.addDisposableThrottledListener(e,"pointermove",t,(e,t)=>n(e,this._create(t)),o)}};class h extends s.Disposable{constructor(e){super(),this._editorViewDomNode=e,this._globalMouseMoveMonitor=this._register(new n.GlobalMouseMoveMonitor),this._keydownListener=null}startMonitoring(e,t,n,o,s){this._keydownListener=i.addStandardDisposableListener(document,"keydown",e=>{e.toKeybinding().isModifierKey()||this._globalMouseMoveMonitor.stopMonitoring(!0)},!0);this._globalMouseMoveMonitor.startMonitoring(e,t,(e,t)=>n(e,new c(t,this._editorViewDomNode)),o,()=>{this._keydownListener.dispose(),s()})}}t.GlobalEditorMouseMoveMonitor=h})),define(t[354],i([0,1,4,2]),(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractCodeEditorService=void 0;class o extends n.Disposable{constructor(){super(),this._onCodeEditorAdd=this._register(new i.Emitter),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new i.Emitter), +this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onDiffEditorAdd=this._register(new i.Emitter),this._onDiffEditorRemove=this._register(new i.Emitter),this._modelProperties=new Map,this._codeEditors=Object.create(null),this._diffEditors=Object.create(null)}addCodeEditor(e){this._codeEditors[e.getId()]=e,this._onCodeEditorAdd.fire(e)}removeCodeEditor(e){delete this._codeEditors[e.getId()]&&this._onCodeEditorRemove.fire(e)}listCodeEditors(){return Object.keys(this._codeEditors).map(e=>this._codeEditors[e])}addDiffEditor(e){this._diffEditors[e.getId()]=e,this._onDiffEditorAdd.fire(e)}removeDiffEditor(e){delete this._diffEditors[e.getId()]&&this._onDiffEditorRemove.fire(e)}listDiffEditors(){return Object.keys(this._diffEditors).map(e=>this._diffEditors[e])}getFocusedCodeEditor(){let e=null;const t=this.listCodeEditors();for(const i of t){if(i.hasTextFocus())return i;i.hasWidgetFocus()&&(e=i)}return e}setModelProperty(e,t,i){const n=e.toString();let o +;this._modelProperties.has(n)?o=this._modelProperties.get(n):(o=new Map,this._modelProperties.set(n,o)),o.set(t,i)}getModelProperty(e,t){const i=e.toString();if(this._modelProperties.has(i)){return this._modelProperties.get(i).get(t)}}}t.AbstractCodeEditorService=o})),define(t[204],i([0,1]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCharIndex=t.allCharCodes=void 0,t.allCharCodes=(()=>{const e=[];for(let t=32;t<=126;t++)e.push(t);return e.push(65533),e})();t.getCharIndex=(e,t)=>(e-=32)<0||e>96?t<=2?(e+96)%96:95:e})),define(t[355],i([0,1,204,114]),(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MinimapCharRenderer=void 0;class o{constructor(e,t){this.scale=t,this.charDataNormal=o.soften(e,.8),this.charDataLight=o.soften(e,50/60)}static soften(e,t){let i=new Uint8ClampedArray(e.length);for(let o=0,s=e.length;oe.width||n+u>e.height)return void console.warn("bad render request outside image data");const g=l?this.charDataLight:this.charDataNormal,p=i.getCharIndex(o,a),m=4*e.width,f=r.r,_=r.g,v=r.b,C=s.r-f,b=s.g-_,S=s.b-v,w=e.data;let y=p*c*h,E=n*m+4*t;for(let e=0;ee.width||i+d>e.height)return void console.warn("bad render request outside image data");const c=4*e.width,h=o.r,u=o.g,g=o.b,p=h+.5*(n.r-h),m=u+.5*(n.g-u),f=g+.5*(n.b-g),_=e.data;let v=i*c+4*t;for(let e=0;e{const t=new Uint8ClampedArray(e.length/2) +;for(let i=0;i>1]=n[e[i]]<<4|15&n[e[i+1]];return t};t.prebakedMiniMaps={1:i.once(()=>o("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")), +2:i.once(()=>o("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126")) +}})),define(t[357],i([0,1,355,204,356,114]),(function(e,t,i,n,o,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MinimapCharRendererFactory=void 0;class r{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let n;return n=o.prebakedMiniMaps[e]?new i.MinimapCharRenderer(o.prebakedMiniMaps[e](),e):r.createFromSampleData(r.createSampleData(t).data,e),this.lastFontFamily=t,this.lastCreated=n,n}static createSampleData(e){const t=document.createElement("canvas"),i=t.getContext("2d");t.style.height="16px",t.height=16,t.width=960,t.style.width="960px",i.fillStyle="#ffffff",i.font=`bold 16px ${e}`,i.textBaseline="middle";let o=0;for(const e of n.allCharCodes)i.fillText(String.fromCharCode(e),o,8),o+=10;return i.getImageData(0,0,960,16)}static createFromSampleData(e,t){if(61440!==e.length)throw new Error("Unexpected source in MinimapCharRenderer");let n=r._downsample(e,t);return new i.MinimapCharRenderer(n,t)} +static _downsampleChar(e,t,i,n,o){const r=1*o,a=2*o;let l=n,d=0;for(let n=0;n0){const e=255/a;for(let t=0;t=0&&e<256?this._asciiMap[e]=n:this._map.set(e,n)}get(e){ +return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue}}t.CharacterClassifier=n;t.CharacterSet=class{constructor(){this._actual=new n(0)}add(e){this._actual.set(e,1)}has(e){return 1===this._actual.get(e)}}})),define(t[99],i([0,1,87]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMapForWordSeparators=t.WordCharacterClassifier=void 0;class n extends i.CharacterClassifier{constructor(e){super(0);for(let t=0,i=e.length;t(t.hasOwnProperty(i)||(t[i]=e(i)),t[i])}(e=>new n(e))})),define(t[13],i([0,1]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Position=void 0;class i{constructor(e,t){this.lineNumber=e,this.column=t}with(e=this.lineNumber,t=this.column){return e===this.lineNumber&&t===this.column?this:new i(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)} +equals(e){return i.equals(this,e)}static equals(e,t){return!e&&!t||!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return i.isBefore(this,e)}static isBefore(e,t){return e.lineNumberi||e===i&&t>n?(this.startLineNumber=i,this.startColumn=n, +this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=i,this.endColumn=n)}isEmpty(){return n.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return n.containsPosition(this,e)}static containsPosition(e,t){return!(t.lineNumbere.endLineNumber)&&(!(t.lineNumber===e.startLineNumber&&t.columne.endColumn))}containsRange(e){return n.containsRange(this,e)}static containsRange(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber)&&(!(t.startLineNumber===e.startLineNumber&&t.startColumne.endColumn)))}strictContainsRange(e){return n.strictContainsRange(this,e)}static strictContainsRange(e,t){ +return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber)&&(!(t.startLineNumber===e.startLineNumber&&t.startColumn<=e.startColumn)&&!(t.endLineNumber===e.endLineNumber&&t.endColumn>=e.endColumn)))}plusRange(e){return n.plusRange(this,e)}static plusRange(e,t){let i,o,s,r;return t.startLineNumbere.endLineNumber?(s=t.endLineNumber,r=t.endColumn):t.endLineNumber===e.endLineNumber?(s=t.endLineNumber,r=Math.max(t.endColumn,e.endColumn)):(s=e.endLineNumber,r=e.endColumn),new n(i,o,s,r)}intersectRanges(e){return n.intersectRanges(this,e)}static intersectRanges(e,t){let i=e.startLineNumber,o=e.startColumn,s=e.endLineNumber,r=e.endColumn,a=t.startLineNumber,l=t.startColumn,d=t.endLineNumber,c=t.endColumn +;return id?(s=d,r=c):s===d&&(r=Math.min(r,c)),i>s?null:i===s&&o>r?null:new n(i,o,s,r)}equalsRange(e){return n.equalsRange(this,e)}static equalsRange(e,t){return!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn}getEndPosition(){return n.getEndPosition(this)}static getEndPosition(e){return new i.Position(e.endLineNumber,e.endColumn)}getStartPosition(){return n.getStartPosition(this)}static getStartPosition(e){return new i.Position(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new n(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new n(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return n.collapseToStart(this)}static collapseToStart(e){return new n(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)} +static fromPositions(e,t=e){return new n(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new n(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return e&&"number"==typeof e.startLineNumber&&"number"==typeof e.startColumn&&"number"==typeof e.endLineNumber&&"number"==typeof e.endColumn}static areIntersectingOrTouching(e,t){return!(e.endLineNumbere.startLineNumber}}t.Range=n})),define(t[205],i([0,1,8,13,3]),(function(e,t,i,n,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PagedScreenReaderStrategy=t.TextAreaState=void 0;class s{constructor(e,t,i,n,o){this.value=e,this.selectionStart=t,this.selectionEnd=i,this.selectionStartPosition=n,this.selectionEndPosition=o}toString(){return"[ <"+this.value+">, selectionStart: "+this.selectionStart+", selectionEnd: "+this.selectionEnd+"]"}static readFromTextArea(e){return new s(e.getValue(),e.getSelectionStart(),e.getSelectionEnd(),null,null)} +collapseSelection(){return new s(this.value,this.value.length,this.value.length,null,null)}writeToTextArea(e,t,i){t.setValue(e,this.value),i&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){if(e<=this.selectionStart){const t=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition(this.selectionStartPosition,t,-1)}if(e>=this.selectionEnd){const t=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition(this.selectionEndPosition,t,1)}const t=this.value.substring(this.selectionStart,e);if(-1===t.indexOf(String.fromCharCode(8230)))return this._finishDeduceEditorPosition(this.selectionStartPosition,t,1);const i=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition(this.selectionEndPosition,i,-1)}_finishDeduceEditorPosition(e,t,i){let n=0,o=-1;for(;-1!==(o=t.indexOf("\n",o+1));)n++;return[e,i*t.length,n]}static selectedText(e){return new s(e,0,e.length,null,null)}static deduceInput(e,t,n){ +if(!e)return{text:"",replaceCharCnt:0};let o=e.value,s=e.selectionStart,r=e.selectionEnd,a=t.value,l=t.selectionStart,d=t.selectionEnd;const c=o.substring(r),h=a.substring(d),u=i.commonSuffixLength(c,h);a=a.substring(0,a.length-u);const g=(o=o.substring(0,o.length-u)).substring(0,s),p=a.substring(0,l),m=i.commonPrefixLength(g,p);if(a=a.substring(m),o=o.substring(m),l-=m,s-=m,d-=m,r-=m,n&&l===d&&o.length>0){let e=null;if(l===a.length?i.startsWith(a,o)&&(e=a.substring(o.length)):i.endsWith(a,o)&&(e=a.substring(0,a.length-o.length)),null!==e&&e.length>0&&(/\uFE0F/.test(e)||i.containsEmoji(e)))return{text:e,replaceCharCnt:0}}if(l===d){if(o===a&&0===s&&r===o.length&&l===a.length&&-1===a.indexOf("\n")&&i.containsFullWidthCharacter(a))return{text:"",replaceCharCnt:0};return{text:a,replaceCharCnt:g.length-m}}return{text:a,replaceCharCnt:r-s}}}t.TextAreaState=s,s.EMPTY=new s("",0,0,null,null);class r{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const i=e*t,n=i+1,s=i+t +;return new o.Range(n,1,s+1,1)}static fromEditorSelection(e,t,i,a,l){const d=r._getPageOfLine(i.startLineNumber,a),c=r._getRangeForPage(d,a),h=r._getPageOfLine(i.endLineNumber,a),u=r._getRangeForPage(h,a),g=c.intersectRanges(new o.Range(1,1,i.startLineNumber,i.startColumn));let p=t.getValueInRange(g,1);const m=t.getLineCount(),f=t.getLineMaxColumn(m),_=u.intersectRanges(new o.Range(i.endLineNumber,i.endColumn,m,f));let v,C=t.getValueInRange(_,1);if(d===h||d+1===h)v=t.getValueInRange(i,1);else{const e=c.intersectRanges(i),n=u.intersectRanges(i);v=t.getValueInRange(e,1)+String.fromCharCode(8230)+t.getValueInRange(n,1)}if(l){const e=500;p.length>e&&(p=p.substring(p.length-e,p.length)),C.length>e&&(C=C.substring(0,e)),v.length>2*e&&(v=v.substring(0,e)+String.fromCharCode(8230)+v.substring(v.length-e,v.length))}return new s(p+v+C,p.length,p.length+v.length,new n.Position(i.startLineNumber,i.startColumn),new n.Position(i.endLineNumber,i.endColumn))}}t.PagedScreenReaderStrategy=r})), +define(t[206],i([0,1,185,4,2,37,3]),(function(e,t,i,n,o,s,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DiffNavigator=void 0;const a={followsCaret:!0,ignoreCharChanges:!0,alwaysRevealFirst:!0};class l extends o.Disposable{constructor(e,t={}){super(),this._onDidUpdate=this._register(new n.Emitter),this._editor=e,this._options=s.mixin(t,a,!1),this.disposed=!1,this.nextIdx=-1,this.ranges=[],this.ignoreSelectionChange=!1,this.revealFirst=Boolean(this._options.alwaysRevealFirst),this._register(this._editor.onDidDispose(()=>this.dispose())),this._register(this._editor.onDidUpdateDiff(()=>this._onDiffUpdated())),this._options.followsCaret&&this._register(this._editor.getModifiedEditor().onDidChangeCursorPosition(e=>{this.ignoreSelectionChange||(this.nextIdx=-1)})),this._options.alwaysRevealFirst&&this._register(this._editor.getModifiedEditor().onDidChangeModel(e=>{this.revealFirst=!0})),this._init()}_init(){this._editor.getLineChanges()}_onDiffUpdated(){this._init(), +this._compute(this._editor.getLineChanges()),this.revealFirst&&null!==this._editor.getLineChanges()&&(this.revealFirst=!1,this.nextIdx=-1,this.next(1))}_compute(e){this.ranges=[],e&&e.forEach(e=>{!this._options.ignoreCharChanges&&e.charChanges?e.charChanges.forEach(e=>{this.ranges.push({rhs:!0,range:new r.Range(e.modifiedStartLineNumber,e.modifiedStartColumn,e.modifiedEndLineNumber,e.modifiedEndColumn)})}):this.ranges.push({rhs:!0,range:new r.Range(e.modifiedStartLineNumber,1,e.modifiedStartLineNumber,1)})}),this.ranges.sort((e,t)=>e.range.getStartPosition().isBeforeOrEqual(t.range.getStartPosition())?-1:t.range.getStartPosition().isBeforeOrEqual(e.range.getStartPosition())?1:0),this._onDidUpdate.fire(this)}_initIdx(e){let t=!1,i=this._editor.getPosition();if(i){for(let n=0,o=this.ranges.length;n=this.ranges.length&&(this.nextIdx=0)):(this.nextIdx-=1,this.nextIdx<0&&(this.nextIdx=this.ranges.length-1));let n=this.ranges[this.nextIdx];this.ignoreSelectionChange=!0;try{let e=n.range.getStartPosition();this._editor.setPosition(e),this._editor.revealPositionInCenter(e,t)}finally{this.ignoreSelectionChange=!1}}canNavigate(){return this.ranges&&this.ranges.length>0}next(e=0){this._move(!0,e)}previous(e=0){this._move(!1,e)}dispose(){super.dispose(),this.ranges=[],this.disposed=!0}}t.DiffNavigator=l})),define(t[60],i([0,1,3]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditOperation=void 0;t.EditOperation=class{static insert(e,t){return{range:new i.Range(e.lineNumber,e.column,e.lineNumber,e.column),text:t,forceMoveMarkers:!0}}static delete(e){return{range:e,text:null}} +static replace(e,t){return{range:e,text:t}}static replaceMove(e,t){return{range:e,text:t,forceMoveMarkers:!0}}}})),define(t[358],i([0,1,8,60,3]),(function(e,t,i,n,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.trimTrailingWhitespace=t.TrimTrailingWhitespaceCommand=void 0;function s(e,t){t.sort((e,t)=>e.lineNumber===t.lineNumber?e.column-t.column:e.lineNumber-t.lineNumber);for(let e=t.length-2;e>=0;e--)t[e].lineNumber===t[e+1].lineNumber&&t.splice(e,1);let s=[],r=0,a=0,l=t.length;for(let d=1,c=e.getLineCount();d<=c;d++){let c=e.getLineContent(d),h=c.length+1,u=0;if(a255?255:0|e}}t.RGBA8=i,i.Empty=new i(0,0,0,0)})),define(t[20],i([0,1,13,3]),(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Selection=void 0;class o extends n.Range{constructor(e,t,i,n){super(e,t,i,n),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=i,this.positionColumn=n}toString(){ +return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(e){return o.selectionsEqual(this,e)}static selectionsEqual(e,t){return e.selectionStartLineNumber===t.selectionStartLineNumber&&e.selectionStartColumn===t.selectionStartColumn&&e.positionLineNumber===t.positionLineNumber&&e.positionColumn===t.positionColumn}getDirection(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?0:1}setEndPosition(e,t){return 0===this.getDirection()?new o(this.startLineNumber,this.startColumn,e,t):new o(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new i.Position(this.positionLineNumber,this.positionColumn)}setStartPosition(e,t){return 0===this.getDirection()?new o(e,t,this.endLineNumber,this.endColumn):new o(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new o(e.lineNumber,e.column,t.lineNumber,t.column)}static liftSelection(e){ +return new o(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn)}static selectionsArrEqual(e,t){if(e&&!t||!e&&t)return!1;if(!e&&!t)return!0;if(e.length!==t.length)return!1;for(let i=0,n=e.length;ithis._onCut.fire(),0)),this._textAreaState=d.TextAreaState.EMPTY,this._selectionChangeListener=null,this.writeScreenReaderContent("ctor"),this._hasFocus=!1,this._isDoingComposition=!1,this._nextCommand=0;let r=null;this._register(n.addStandardDisposableListener(t.domNode,"keydown",e=>{(109===e.keyCode||this._isDoingComposition&&1===e.keyCode)&&e.stopPropagation(),e.equals(9)&&e.preventDefault(),r=e,this._onKeyDown.fire(e)})),this._register(n.addStandardDisposableListener(t.domNode,"keyup",e=>{this._onKeyUp.fire(e)})),this._register(n.addDisposableListener(t.domNode,"compositionstart",e=>{if(this._isDoingComposition)return;this._isDoingComposition=!0;let t=!1 +;a.isMacintosh&&r&&r.equals(109)&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===e.data&&("ArrowRight"!==r.code&&"ArrowLeft"!==r.code||(t=!0)),t?this._textAreaState=new d.TextAreaState(this._textAreaState.value,this._textAreaState.selectionStart-1,this._textAreaState.selectionEnd,this._textAreaState.selectionStartPosition?new c.Position(this._textAreaState.selectionStartPosition.lineNumber,this._textAreaState.selectionStartPosition.column-1):null,this._textAreaState.selectionEndPosition):i.isEdge||this._setAndWriteTextAreaState("compositionstart",d.TextAreaState.EMPTY),this._onCompositionStart.fire({moveOneCharacterLeft:t})}));const h=e=>{const t=this._textAreaState,i=d.TextAreaState.readFromTextArea(this._textArea);return[i,d.TextAreaState.deduceInput(t,i,e)]},u=e=>{const t=this._textAreaState,i=d.TextAreaState.selectedText(e);return[i,{text:i.value, +replaceCharCnt:t.selectionEnd-t.selectionStart}]},g=e=>!(!i.isEdge||"ja"!==e);this._register(n.addDisposableListener(t.domNode,"compositionupdate",e=>{if(g(e.locale)){const[t,i]=h(!1);return this._textAreaState=t,this._onType.fire(i),void this._onCompositionUpdate.fire(e)}const[t,i]=u(e.data||"");this._textAreaState=t,this._onType.fire(i),this._onCompositionUpdate.fire(e)})),this._register(n.addDisposableListener(t.domNode,"compositionend",e=>{if(this._isDoingComposition){if(g(e.locale)){const[e,t]=h(!1);this._textAreaState=e,this._onType.fire(t)}else{const[t,i]=u(e.data||"");this._textAreaState=t,this._onType.fire(i)}(i.isEdge||i.isChrome)&&(this._textAreaState=d.TextAreaState.readFromTextArea(this._textArea)),this._isDoingComposition&&(this._isDoingComposition=!1,this._onCompositionEnd.fire())}})),this._register(n.addDisposableListener(t.domNode,"input",()=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._isDoingComposition)return;const[e,t]=h(a.isMacintosh) +;0===t.replaceCharCnt&&1===t.text.length&&l.isHighSurrogate(t.text.charCodeAt(0))||(this._textAreaState=e,0===this._nextCommand?""!==t.text&&this._onType.fire(t):(""===t.text&&0===t.replaceCharCnt||this._firePaste(t.text,null),this._nextCommand=0))})),this._register(n.addDisposableListener(t.domNode,"cut",e=>{this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(e),this._asyncTriggerCut.schedule()})),this._register(n.addDisposableListener(t.domNode,"copy",e=>{this._ensureClipboardGetsEditorSelection(e)})),this._register(n.addDisposableListener(t.domNode,"paste",e=>{if(this._textArea.setIgnoreSelectionChangeTime("received paste event"),m.canUseTextData(e)){const[t,i]=m.getTextData(e);""!==t&&this._firePaste(t,i)}else this._textArea.getSelectionStart()!==this._textArea.getSelectionEnd()&&this._setAndWriteTextAreaState("paste",d.TextAreaState.EMPTY),this._nextCommand=1})),this._register(n.addDisposableListener(t.domNode,"focus",()=>{this._setHasFocus(!0)})), +this._register(n.addDisposableListener(t.domNode,"blur",()=>{this._setHasFocus(!1)}))}_installSelectionChangeListener(){let e=0;return n.addDisposableListener(document,"selectionchange",t=>{if(!this._hasFocus)return;if(this._isDoingComposition)return;if(!i.isChrome)return;const n=Date.now(),o=n-e;if(e=n,o<5)return;const s=n-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),s<100)return;if(!this._textAreaState.selectionStartPosition||!this._textAreaState.selectionEndPosition)return;const r=this._textArea.getValue();if(this._textAreaState.value!==r)return;const a=this._textArea.getSelectionStart(),l=this._textArea.getSelectionEnd();if(this._textAreaState.selectionStart===a&&this._textAreaState.selectionEnd===l)return;const d=this._textAreaState.deduceEditorPosition(a),c=this._host.deduceModelPosition(d[0],d[1],d[2]),u=this._textAreaState.deduceEditorPosition(l),g=this._host.deduceModelPosition(u[0],u[1],u[2]),p=new h.Selection(c.lineNumber,c.column,g.lineNumber,g.column) +;this._onSelectionChangeRequest.fire(p)})}dispose(){super.dispose(),this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null)}focusTextArea(){this._setHasFocus(!0),this.refreshFocusState()}isFocused(){return this._hasFocus}refreshFocusState(){const e=n.getShadowRoot(this.textArea.domNode);e?this._setHasFocus(e.activeElement===this.textArea.domNode):n.isInDOM(this.textArea.domNode)?this._setHasFocus(document.activeElement===this.textArea.domNode):this._setHasFocus(!1)}_setHasFocus(e){this._hasFocus!==e&&(this._hasFocus=e,this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null),this._hasFocus&&(this._selectionChangeListener=this._installSelectionChangeListener()),this._hasFocus&&(i.isEdge?this._setAndWriteTextAreaState("focusgain",d.TextAreaState.EMPTY):this.writeScreenReaderContent("focusgain")),this._hasFocus?this._onFocus.fire():this._onBlur.fire())}_setAndWriteTextAreaState(e,t){ +this._hasFocus||(t=t.collapseSelection()),t.writeToTextArea(e,this._textArea,this._hasFocus),this._textAreaState=t}writeScreenReaderContent(e){this._isDoingComposition||this._setAndWriteTextAreaState(e,this._host.getScreenReaderContent(this._textAreaState))}_ensureClipboardGetsEditorSelection(e){const t=this._host.getDataToCopy(m.canUseTextData(e)&&u.BrowserFeatures.clipboard.richText),n={version:1,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};g.INSTANCE.set(i.isFirefox?t.text.replace(/\r\n/g,"\n"):t.text,n),m.canUseTextData(e)?m.setTextData(e,t.text,t.html,n):this._setAndWriteTextAreaState("copy or cut",d.TextAreaState.selectedText(t.text))}_firePaste(e,t){t||(t=g.INSTANCE.get(e)),this._onPaste.fire({text:e,metadata:t})}}t.TextAreaInput=p;class m{static canUseTextData(e){return!!e.clipboardData||!!window.clipboardData}static getTextData(e){if(e.clipboardData){e.preventDefault();const t=e.clipboardData.getData("text/plain");let i=null +;const n=e.clipboardData.getData("vscode-editor-data");if("string"==typeof n)try{1!==(i=JSON.parse(n)).version&&(i=null)}catch(e){}return[t,i]}if(window.clipboardData){return e.preventDefault(),[window.clipboardData.getData("Text"),null]}throw new Error("ClipboardEventUtils.getTextData: Cannot use text data!")}static setTextData(e,t,i,n){if(e.clipboardData)return e.clipboardData.setData("text/plain",t),"string"==typeof i&&e.clipboardData.setData("text/html",i),e.clipboardData.setData("vscode-editor-data",JSON.stringify(n)),void e.preventDefault();if(window.clipboardData)return window.clipboardData.setData("Text",t),void e.preventDefault();throw new Error("ClipboardEventUtils.setTextData: Cannot use text data!")}}class f extends r.Disposable{constructor(e){super(),this._actual=e,this._ignoreSelectionChangeTime=0}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){ +this._ignoreSelectionChangeTime=0}getValue(){return this._actual.domNode.value}setValue(e,t){const i=this._actual.domNode;i.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),i.value=t)}getSelectionStart(){return this._actual.domNode.selectionStart}getSelectionEnd(){return this._actual.domNode.selectionEnd}setSelectionRange(e,t,o){const s=this._actual.domNode;let r=null;const a=n.getShadowRoot(s),l=(r=a?a.activeElement:document.activeElement)===s,d=s.selectionStart,c=s.selectionEnd;if(l&&d===t&&c===o)i.isFirefox&&window.parent!==window&&s.focus();else{if(l)return this.setIgnoreSelectionChangeTime("setSelectionRange"),s.setSelectionRange(t,o),void(i.isFirefox&&window.parent!==window&&s.focus());try{const e=n.saveParentsScrollTop(s);this.setIgnoreSelectionChangeTime("setSelectionRange"),s.focus(),s.setSelectionRange(t,o),n.restoreParentsScrollTop(s,e)}catch(e){}}}}})),define(t[88],i([0,1,20]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}), +t.ReplaceCommandThatPreservesSelection=t.ReplaceCommandWithOffsetCursorState=t.ReplaceCommandWithoutChangingPosition=t.ReplaceCommandThatSelectsText=t.ReplaceCommand=void 0;t.ReplaceCommand=class{constructor(e,t,i=!1){this._range=e,this._text=t,this.insertsAutoWhitespace=i}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){let n=t.getInverseEditOperations()[0].range;return new i.Selection(n.endLineNumber,n.endColumn,n.endLineNumber,n.endColumn)}};t.ReplaceCommandThatSelectsText=class{constructor(e,t){this._range=e,this._text=t}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const n=t.getInverseEditOperations()[0].range;return new i.Selection(n.startLineNumber,n.startColumn,n.endLineNumber,n.endColumn)}};t.ReplaceCommandWithoutChangingPosition=class{constructor(e,t,i=!1){this._range=e,this._text=t,this.insertsAutoWhitespace=i}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)} +computeCursorState(e,t){let n=t.getInverseEditOperations()[0].range;return new i.Selection(n.startLineNumber,n.startColumn,n.startLineNumber,n.startColumn)}};t.ReplaceCommandWithOffsetCursorState=class{constructor(e,t,i,n,o=!1){this._range=e,this._text=t,this._columnDeltaOffset=n,this._lineNumberDeltaOffset=i,this.insertsAutoWhitespace=o}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){let n=t.getInverseEditOperations()[0].range;return new i.Selection(n.endLineNumber+this._lineNumberDeltaOffset,n.endColumn+this._columnDeltaOffset,n.endLineNumber+this._lineNumberDeltaOffset,n.endColumn+this._columnDeltaOffset)}};t.ReplaceCommandThatPreservesSelection=class{constructor(e,t,i,n=!1){this._range=e,this._text=t,this._initialSelection=i,this._forceMoveMarkers=n,this._selectionId=null}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text,this._forceMoveMarkers),this._selectionId=t.trackSelection(this._initialSelection)}computeCursorState(e,t){ +return t.getTrackedSelection(this._selectionId)}}})),define(t[359],i([0,1,3,20]),(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SurroundSelectionCommand=void 0;t.SurroundSelectionCommand=class{constructor(e,t,i){this._range=e,this._charBeforeSelection=t,this._charAfterSelection=i}getEditOperations(e,t){t.addTrackedEditOperation(new i.Range(this._range.startLineNumber,this._range.startColumn,this._range.startLineNumber,this._range.startColumn),this._charBeforeSelection),t.addTrackedEditOperation(new i.Range(this._range.endLineNumber,this._range.endColumn,this._range.endLineNumber,this._range.endColumn),this._charAfterSelection)}computeCursorState(e,t){let i=t.getInverseEditOperations(),o=i[0].range,s=i[1].range;return new n.Selection(o.endLineNumber,o.endColumn,s.endLineNumber,s.endColumn-this._charAfterSelection.length)}}})),define(t[89],i([0,1,8,16,112]),(function(e,t,i,n,o){"use strict";let s;function r(){ +return s||(s=new TextDecoder(n.isLittleEndian()?"UTF-16LE":"UTF-16BE")),s}Object.defineProperty(t,"__esModule",{value:!0}),t.decodeUTF16LE=t.createStringBuilder=t.hasTextDecoder=t.getPlatformTextDecoder=void 0,t.getPlatformTextDecoder=r,t.hasTextDecoder="undefined"!=typeof TextDecoder,t.hasTextDecoder?(t.createStringBuilder=e=>new a(e),t.decodeUTF16LE=function(e,t,i){const n=new Uint16Array(e.buffer,t,i);return r().decode(n)}):(t.createStringBuilder=e=>new l,t.decodeUTF16LE=function(e,t,i){let n=[],s=0;for(let r=0;r=this._capacity)return this._flushBuffer(),void(this._completedStrings[this._completedStrings.length]=e);for(let i=0;i=this._lines.length)throw new Error("Illegal value for lineNumber");return this._lines[t]}onLinesDeleted(e,t){if(0===this.getCount())return null;const i=this.getStartLineNumber(),n=this.getEndLineNumber();if(tn)return null;let o=0,s=0 +;for(let r=i;r<=n;r++){const i=r-this._rendLineNumberStart;e<=r&&r<=t&&(0===s?(o=i,s=1):s++)}if(e=i&&s<=n&&(this._lines[s-this._rendLineNumberStart].onContentChanged(),o=!0);return o}onLinesInserted(e,t){if(0===this.getCount())return null;const i=t-e+1,n=this.getStartLineNumber(),o=this.getEndLineNumber();if(e<=n)return this._rendLineNumberStart+=i,null;if(e>o)return null;if(i+e>o){return this._lines.splice(e-this._rendLineNumberStart,o-e+1)}const s=[];for(let e=0;ei)continue;const r=Math.max(t,s.fromLineNumber),a=Math.min(i,s.toLineNumber);for(let e=r;e<=a;e++){const t=e-this._rendLineNumberStart;this._lines[t].onTokensChanged(),n=!0}}return n}}t.RenderedLinesCollection=o;t.VisibleLinesCollection=class{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new o(()=>this._host.createVisibleLine())}_createDomNode(){const e=i.createFastDomNode(document.createElement("div"));return e.setClassName("view-layer"),e.setPosition("absolute"),e.domNode.setAttribute("role","presentation"),e.domNode.setAttribute("aria-hidden","true"),e}onConfigurationChanged(e){return!!e.hasChanged(117)}onFlushed(e){return this._linesCollection.flush(),!0}onLinesChanged(e){return this._linesCollection.onLinesChanged(e.fromLineNumber,e.toLineNumber)}onLinesDeleted(e){ +const t=this._linesCollection.onLinesDeleted(e.fromLineNumber,e.toLineNumber);if(t)for(let e=0,i=t.length;et){const e=t,s=Math.min(i,o.rendLineNumberStart-1);e<=s&&(this._insertLinesBefore(o,e,s,n,t),o.linesLength+=s-e+1)}else if(o.rendLineNumberStart0&&(this._removeLinesBefore(o,e),o.linesLength-=e)}if(o.rendLineNumberStart=t,o.rendLineNumberStart+o.linesLength-1i){const e=Math.max(0,i-o.rendLineNumberStart+1),t=o.linesLength-1-e+1;t>0&&(this._removeLinesAfter(o,t),o.linesLength-=t)}return this._finishRendering(o,!1,n),o}_renderUntouchedLines(e,t,i,n,o){const s=e.rendLineNumberStart,r=e.lines;for(let e=t;e<=i;e++){const t=s+e;r[e].layoutLine(t,n[t-o])}}_insertLinesBefore(e,t,i,n,o){const s=[];let r=0;for(let e=t;e<=i;e++)s[r++]=this.host.createVisibleLine();e.lines=s.concat(e.lines)}_removeLinesBefore(e,t){for(let i=0;i=0;t--){const i=e.lines[t];n[t]&&(i.setDomNode(s),s=s.previousSibling)}}_finishRenderingInvalidLines(e,t,i){const n=document.createElement("div");n.innerHTML=t;for(let t=0;t0&&t.originalLength<20&&t.modifiedLength>0&&t.modifiedLength<20&&r()){ +const a=i.createCharSequence(e,t.originalStart,t.originalStart+t.originalLength-1),d=n.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);let h=s(a,d,r,!0).changes;c&&(h=function(e){if(e.length<=1)return e;const t=[e[0]];let i=t[0];for(let n=1,s=e.length;n!0;const t=Date.now();return()=>Date.now()-t1&&s>1;){if(e.charCodeAt(i-2)!==t.charCodeAt(s-2))break;i--,s--} +(i>1||s>1)&&this._pushTrimWhitespaceCharChange(n,o+1,1,i,r+1,1,s)}{let i=h(e,1),s=h(t,1);const a=e.length+1,l=t.length+1;for(;i0&&a>0)return;if(l>0&&d>0)return;let c=Math.abs(a-d),h=Math.abs(r-l);if(0===c)return o.spacesDiff=h,void(h>0&&0<=l-1&&l-10?r++:f>1&&a++,n(l,d,c,m,u),u.looksLikeAlignment&&(!o||t!==u.spacesDiff))continue;let v=u.spacesDiff;v<=8&&h[v]++,l=c,d=m}let g=o +;r!==a&&(g=r{let i=h[t];i>e&&(e=i,p=t)}),4===p&&h[4]>0&&h[2]>0&&h[2]>=h[4]/2&&(p=2)}return{insertSpaces:g,tabSize:p}}})),define(t[362],i([0,1]),(function(e,t){"use strict";function i(e){return(1&e.metadata)>>>0}function n(e,t){e.metadata=254&e.metadata|t<<0}function o(e){return(2&e.metadata)>>>1==1}function s(e,t){e.metadata=253&e.metadata|(t?1:0)<<1}function r(e){return(4&e.metadata)>>>2==1}function a(e,t){e.metadata=251&e.metadata|(t?1:0)<<2}function l(e,t){e.metadata=247&e.metadata|(t?1:0)<<3}function d(e,t){e.metadata=207&e.metadata|t<<4}function c(e,t){e.metadata=191&e.metadata|(t?1:0)<<6}Object.defineProperty(t,"__esModule",{value:!0}),t.intervalCompare=t.recomputeMaxEnd=t.nodeAcceptEdit=t.IntervalTree=t.SENTINEL=t.IntervalNode=t.getNodeIsInOverviewRuler=t.getNodeColor=void 0,t.getNodeColor=i,t.getNodeIsInOverviewRuler=function(e){return(8&e.metadata)>>>3==1};class h{constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this, +n(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,a(this,!1),d(this,1),l(this,!1),c(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,s(this,!1)}reset(e,t,i,n){this.start=t,this.end=i,this.maxEnd=i,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=n}setOptions(e){this.options=e;let t=this.options.className;a(this,"squiggly-error"===t||"squiggly-warning"===t||"squiggly-info"===t),d(this,this.options.stickiness),l(this,!(!this.options.overviewRuler||!this.options.overviewRuler.color)),c(this,this.options.collapseOnReplaceEdit)}setCachedOffsets(e,t,i){this.cachedVersionId!==i&&(this.range=null),this.cachedVersionId=i,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t}detach(){this.parent=null,this.left=null,this.right=null}}t.IntervalNode=h,t.SENTINEL=new h(null,0,0),t.SENTINEL.parent=t.SENTINEL,t.SENTINEL.left=t.SENTINEL,t.SENTINEL.right=t.SENTINEL,n(t.SENTINEL,0) +;function u(e,t,i,n){return ei)&&(1!==n&&(2===n||t))}function g(e,t,i,n,o){const s=function(e){return(48&e.metadata)>>>4}(e),r=0===s||2===s,a=1===s||2===s,l=i-t,d=n,c=Math.min(l,d),h=e.start;let g=!1;const p=e.end;let m=!1;t<=h&&p<=i&&function(e){return(64&e.metadata)>>>6==1}(e)&&(e.start=t,g=!0,e.end=t,m=!0);{const e=o?1:l>0?2:0;!g&&u(h,r,t,e)&&(g=!0),!m&&u(p,a,t,e)&&(m=!0)}if(c>0&&!o){const e=l>d?2:0;!g&&u(h,r,t+c,e)&&(g=!0),!m&&u(p,a,t+c,e)&&(m=!0)}{const n=o?1:0;!g&&u(h,r,i,n)&&(e.start=t+d,g=!0),!m&&u(p,a,i,n)&&(e.end=t+d,m=!0)}const f=d-l;g||(e.start=Math.max(0,h+f)),m||(e.end=Math.max(0,p+f)),e.start>e.end&&(e.end=e.start)}function p(e,o){if(e.root===t.SENTINEL)return o.parent=t.SENTINEL,o.left=t.SENTINEL,o.right=t.SENTINEL,n(o,0),e.root=o,e.root;!function(e,i){let o=0,s=e.root;const r=i.start,a=i.end;for(;;){if(w(r,a,s.start+o,s.end+o)<0){if(s.left===t.SENTINEL){i.start-=o,i.end-=o,i.maxEnd-=o,s.left=i;break}s=s.left}else{if(s.right===t.SENTINEL){i.start-=o+s.delta,i.end-=o+s.delta, +i.maxEnd-=o+s.delta,s.right=i;break}o+=s.delta,s=s.right}}i.parent=s,i.left=t.SENTINEL,i.right=t.SENTINEL,n(i,1)}(e,o),S(o.parent);let s=o;for(;s!==e.root&&1===i(s.parent);)if(s.parent===s.parent.parent.left){const t=s.parent.parent.right;1===i(t)?(n(s.parent,0),n(t,0),n(s.parent.parent,1),s=s.parent.parent):(s===s.parent.right&&_(e,s=s.parent),n(s.parent,0),n(s.parent.parent,1),v(e,s.parent.parent))}else{const t=s.parent.parent.left;1===i(t)?(n(s.parent,0),n(t,0),n(s.parent.parent,1),s=s.parent.parent):(s===s.parent.left&&v(e,s=s.parent),n(s.parent,0),n(s.parent.parent,1),_(e,s.parent.parent))}return n(e.root,0),o}function m(e,o){let s,r;if(o.left===t.SENTINEL?(r=o,(s=o.right).delta+=o.delta,(s.delta<-1073741824||s.delta>1073741824)&&(e.requestNormalizeDelta=!0),s.start+=o.delta,s.end+=o.delta):o.right===t.SENTINEL?(s=o.left,r=o):((s=(r=function(e){for(;e.left!==t.SENTINEL;)e=e.left;return e}(o.right)).right).start+=r.delta,s.end+=r.delta,s.delta+=r.delta, +(s.delta<-1073741824||s.delta>1073741824)&&(e.requestNormalizeDelta=!0),r.start+=o.delta,r.end+=o.delta,r.delta=o.delta,(r.delta<-1073741824||r.delta>1073741824)&&(e.requestNormalizeDelta=!0)),r===e.root)return e.root=s,n(s,0),o.detach(),f(),b(s),void(e.root.parent=t.SENTINEL);let a,l=1===i(r);if(r===r.parent.left?r.parent.left=s:r.parent.right=s,r===o?s.parent=r.parent:(r.parent===o?s.parent=r:s.parent=r.parent,r.left=o.left,r.right=o.right,r.parent=o.parent,n(r,i(o)),o===e.root?e.root=r:o===o.parent.left?o.parent.left=r:o.parent.right=r,r.left!==t.SENTINEL&&(r.left.parent=r),r.right!==t.SENTINEL&&(r.right.parent=r)),o.detach(),l)return S(s.parent),r!==o&&(S(r),S(r.parent)),void f();for(S(s),S(s.parent),r!==o&&(S(r),S(r.parent));s!==e.root&&0===i(s);)s===s.parent.left?(1===i(a=s.parent.right)&&(n(a,0),n(s.parent,1),_(e,s.parent),a=s.parent.right),0===i(a.left)&&0===i(a.right)?(n(a,1),s=s.parent):(0===i(a.right)&&(n(a.left,0),n(a,1),v(e,a),a=s.parent.right),n(a,i(s.parent)),n(s.parent,0),n(a.right,0), +_(e,s.parent),s=e.root)):(1===i(a=s.parent.left)&&(n(a,0),n(s.parent,1),v(e,s.parent),a=s.parent.left),0===i(a.left)&&0===i(a.right)?(n(a,1),s=s.parent):(0===i(a.left)&&(n(a.right,0),n(a,1),_(e,a),a=s.parent.left),n(a,i(s.parent)),n(s.parent,0),n(a.left,0),v(e,s.parent),s=e.root));n(s,0),f()}function f(){t.SENTINEL.parent=t.SENTINEL,t.SENTINEL.delta=0,t.SENTINEL.start=0,t.SENTINEL.end=0}function _(e,i){const n=i.right;n.delta+=i.delta,(n.delta<-1073741824||n.delta>1073741824)&&(e.requestNormalizeDelta=!0),n.start+=i.delta,n.end+=i.delta,i.right=n.left,n.left!==t.SENTINEL&&(n.left.parent=i),n.parent=i.parent,i.parent===t.SENTINEL?e.root=n:i===i.parent.left?i.parent.left=n:i.parent.right=n,n.left=i,i.parent=n,b(i),b(n)}function v(e,i){const n=i.left;i.delta-=n.delta,(i.delta<-1073741824||i.delta>1073741824)&&(e.requestNormalizeDelta=!0),i.start-=n.delta,i.end-=n.delta,i.left=n.right,n.right!==t.SENTINEL&&(n.right.parent=i),n.parent=i.parent, +i.parent===t.SENTINEL?e.root=n:i===i.parent.right?i.parent.right=n:i.parent.left=n,n.right=i,i.parent=n,b(i),b(n)}function C(e){let i=e.end;if(e.left!==t.SENTINEL){const t=e.left.maxEnd;t>i&&(i=t)}if(e.right!==t.SENTINEL){const t=e.right.maxEnd+e.delta;t>i&&(i=t)}return i}function b(e){e.maxEnd=C(e)}function S(e){for(;e!==t.SENTINEL;){const t=C(e);if(e.maxEnd===t)return;e.maxEnd=t,e=e.parent}}function w(e,t,i,n){return e===i?t-n:e-i}t.IntervalTree=class{constructor(){this.root=t.SENTINEL,this.requestNormalizeDelta=!1}intervalSearch(e,i,n,a,l){return this.root===t.SENTINEL?[]:function(e,i,n,a,l,d){let c=e.root,h=0,u=0,g=0,p=0,m=[],f=0;for(;c!==t.SENTINEL;)if(o(c))s(c.left,!1),s(c.right,!1),c===c.parent.right&&(h-=c.parent.delta),c=c.parent;else{if(!o(c.left)){if((u=h+c.maxEnd)n)s(c,!0);else{if((p=h+c.end)>=i){c.setCachedOffsets(g,p,d);let e=!0;a&&c.ownerId&&c.ownerId!==a&&(e=!1),l&&r(c)&&(e=!1),e&&(m[f++]=c)}s(c,!0), +c.right===t.SENTINEL||o(c.right)||(h+=c.delta,c=c.right)}}return s(e.root,!1),m}(this,e,i,n,a,l)}search(e,i,n){return this.root===t.SENTINEL?[]:function(e,i,n,a){let l=e.root,d=0,c=0,h=0,u=[],g=0;for(;l!==t.SENTINEL;){if(o(l)){s(l.left,!1),s(l.right,!1),l===l.parent.right&&(d-=l.parent.delta),l=l.parent;continue}if(l.left!==t.SENTINEL&&!o(l.left)){l=l.left;continue}c=d+l.start,h=d+l.end,l.setCachedOffsets(c,h,a);let e=!0;i&&l.ownerId&&l.ownerId!==i&&(e=!1),n&&r(l)&&(e=!1),e&&(u[g++]=l),s(l,!0),l.right===t.SENTINEL||o(l.right)||(d+=l.delta,l=l.right)}return s(e.root,!1),u}(this,e,i,n)}collectNodesFromOwner(e){return function(e,i){let n=e.root,r=[],a=0;for(;n!==t.SENTINEL;)o(n)?(s(n.left,!1),s(n.right,!1),n=n.parent):n.left===t.SENTINEL||o(n.left)?(n.ownerId===i&&(r[a++]=n),s(n,!0),n.right===t.SENTINEL||o(n.right)||(n=n.right)):n=n.left;return s(e.root,!1),r}(this,e)}collectNodesPostOrder(){return function(e){let i=e.root,n=[],r=0;for(;i!==t.SENTINEL;)o(i)?(s(i.left,!1),s(i.right,!1), +i=i.parent):i.left===t.SENTINEL||o(i.left)?i.right===t.SENTINEL||o(i.right)?(n[r++]=i,s(i,!0)):i=i.right:i=i.left;return s(e.root,!1),n}(this)}insert(e){p(this,e),this._normalizeDeltaIfNecessary()}delete(e){m(this,e),this._normalizeDeltaIfNecessary()}resolveNode(e,t){const i=e;let n=0;for(;e!==this.root;)e===e.parent.right&&(n+=e.parent.delta),e=e.parent;const o=i.start+n,s=i.end+n;i.setCachedOffsets(o,s,t)}acceptReplace(e,i,n,r){const a=function(e,i,n){let r=e.root,a=0,l=0,d=0,c=0,h=[],u=0;for(;r!==t.SENTINEL;)if(o(r))s(r.left,!1),s(r.right,!1),r===r.parent.right&&(a-=r.parent.delta),r=r.parent;else{if(!o(r.left)){if((l=a+r.maxEnd)n?s(r,!0):((c=a+r.end)>=i&&(r.setCachedOffsets(d,c,0),h[u++]=r),s(r,!0),r.right===t.SENTINEL||o(r.right)||(a+=r.delta,r=r.right))}return s(e.root,!1),h}(this,e,e+i);for(let e=0,t=a.length;en?(a.start+=h,a.end+=h,a.delta+=h,(a.delta<-1073741824||a.delta>1073741824)&&(e.requestNormalizeDelta=!0),s(a,!0)):(s(a,!0),a.right===t.SENTINEL||o(a.right)||(l+=a.delta,a=a.right))}s(e.root,!1)}(this,e,e+i,n),this._normalizeDeltaIfNecessary();for(let t=0,o=a.length;t=i)break;const n=e.charCodeAt(t);if(110===n||114===n||87===n||119===n)return!0}}return!1}t.SearchParams=class{ +constructor(e,t,i,n){this.searchString=e,this.isRegex=t,this.matchCase=i,this.wordSeparators=n}parseSearchRequest(){if(""===this.searchString)return null;let e;e=this.isRegex?l(this.searchString):this.searchString.indexOf("\n")>=0;let t=null;try{t=i.createRegExp(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch(e){return null}if(!t)return null;let o=!this.isRegex&&!e;return o&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(o=this.matchCase),new d(t,this.wordSeparators?n.getMapForWordSeparators(this.wordSeparators):null,o?this.searchString:null)}},t.isMultilineRegexSource=l;class d{constructor(e,t,i){this.regex=e,this.wordSeparators=t,this.simpleSearch=i}}function c(e,t,i){if(!i)return new r.FindMatch(e,null);let n=[];for(let e=0,i=t.length;e>0);t[o]>=e?n=o-1:t[o+1]>=e?(i=o,n=o):i=o+1}return i+1}}function u(e,t,i,n,o){return function(e,t,i,n,o){if(0===n)return!0;const s=t.charCodeAt(n-1);if(0!==e.get(s))return!0;if(13===s||10===s)return!0;if(o>0){const i=t.charCodeAt(n);if(0!==e.get(i))return!0}return!1}(e,t,0,n,o)&&function(e,t,i,n,o){if(n+o===i)return!0;const s=t.charCodeAt(n+o);if(0!==e.get(s))return!0;if(13===s||10===s)return!0;if(o>0){const i=t.charCodeAt(n+o-1);if(0!==e.get(i))return!0}return!1}(e,t,i,n,o)}t.TextModelSearch=class{static findMatches(e,t,i,n,o){const s=t.parseSearchRequest();return s?s.regex.multiline?this._doFindMatchesMultiline(e,i,new g(s.wordSeparators,s.regex),n,o):this._doFindMatchesLineByLine(e,i,s,n,o):[]}static _getMultilineMatchRange(e,t,i,n,o,r){let a,l,d=0;if(a=n?t+o+(d=n.findLineFeedCountBeforeOffset(o)):t+o,n){ +let e=n.findLineFeedCountBeforeOffset(o+r.length)-d;l=a+r.length+e}else l=a+r.length;const c=e.getPositionAt(a),h=e.getPositionAt(l);return new s.Range(c.lineNumber,c.column,h.lineNumber,h.column)}static _doFindMatchesMultiline(e,t,i,n,o){const s=e.getOffsetAt(t.getStartPosition()),r=e.getValueInRange(t,1),a="\r\n"===e.getEOL()?new h(r):null,l=[];let d,u=0;for(i.reset(0);d=i.next(r);)if(l[u++]=c(this._getMultilineMatchRange(e,s,r,a,d.index,d[0]),d,n),u>=o)return l;return l}static _doFindMatchesLineByLine(e,t,i,n,o){const s=[];let r=0;if(t.startLineNumber===t.endLineNumber){const a=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return r=this._findMatchesInLine(i,a,t.startLineNumber,t.startColumn-1,r,s,n,o),s}const a=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);r=this._findMatchesInLine(i,a,t.startLineNumber,t.startColumn-1,r,s,n,o);for(let a=t.startLineNumber+1;a=d))return o;return o}const p=new g(e.wordSeparators,e.regex);let m;p.reset(0);do{if((m=p.next(t))&&(a[o++]=c(new s.Range(i,m.index+1+n,i,m.index+1+m[0].length+n),m,l),o>=d))return o}while(m);return o}static findNextMatch(e,t,i,n){const o=t.parseSearchRequest();if(!o)return null;const s=new g(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindNextMatchMultiline(e,i,s,n):this._doFindNextMatchLineByLine(e,i,s,n)}static _doFindNextMatchMultiline(e,t,i,n){ +const r=new o.Position(t.lineNumber,1),a=e.getOffsetAt(r),l=e.getLineCount(),d=e.getValueInRange(new s.Range(r.lineNumber,r.column,l,e.getLineMaxColumn(l)),1),u="\r\n"===e.getEOL()?new h(d):null;i.reset(t.column-1);let g=i.next(d);return g?c(this._getMultilineMatchRange(e,a,d,u,g.index,g[0]),g,n):1!==t.lineNumber||1!==t.column?this._doFindNextMatchMultiline(e,new o.Position(1,1),i,n):null}static _doFindNextMatchLineByLine(e,t,i,n){const o=e.getLineCount(),s=t.lineNumber,r=e.getLineContent(s),a=this._findFirstMatchInLine(i,r,s,t.column,n);if(a)return a;for(let t=1;t<=o;t++){const r=(s+t-1)%o,a=e.getLineContent(r+1),l=this._findFirstMatchInLine(i,a,r+1,1,n);if(l)return l}return null}static _findFirstMatchInLine(e,t,i,n,o){e.reset(n-1);const r=e.next(t);return r?c(new s.Range(i,r.index+1,i,r.index+1+r[0].length),r,o):null}static findPreviousMatch(e,t,i,n){const o=t.parseSearchRequest();if(!o)return null;const s=new g(o.wordSeparators,o.regex) +;return o.regex.multiline?this._doFindPreviousMatchMultiline(e,i,s,n):this._doFindPreviousMatchLineByLine(e,i,s,n)}static _doFindPreviousMatchMultiline(e,t,i,n){const r=this._doFindMatchesMultiline(e,new s.Range(1,1,t.lineNumber,t.column),i,n,10*a);if(r.length>0)return r[r.length-1];const l=e.getLineCount();return t.lineNumber!==l||t.column!==e.getLineMaxColumn(l)?this._doFindPreviousMatchMultiline(e,new o.Position(l,e.getLineMaxColumn(l)),i,n):null}static _doFindPreviousMatchLineByLine(e,t,i,n){const o=e.getLineCount(),s=t.lineNumber,r=e.getLineContent(s).substring(0,t.column-1),a=this._findLastMatchInLine(i,r,s,n);if(a)return a;for(let t=1;t<=o;t++){const r=(o+s-t-1)%o,a=e.getLineContent(r+1),l=this._findLastMatchInLine(i,a,r+1,n);if(l)return l}return null}static _findLastMatchInLine(e,t,i,n){let o,r=null;for(e.reset(0);o=e.next(t);)r=c(new s.Range(i,o.index+1,i,o.index+1+o[0].length),o,n);return r}},t.isValidMatch=u;class g{constructor(e,t){this._wordSeparators=e,this._searchRegex=t, +this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(e){this._searchRegex.lastIndex=e,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(e){const t=e.length;let n;do{if(this._prevMatchStartIndex+this._prevMatchLength===t)return null;if(!(n=this._searchRegex.exec(e)))return null;const o=n.index,s=n[0].length;if(o===this._prevMatchStartIndex&&s===this._prevMatchLength){if(0===s){i.getNextCodePoint(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=o,this._prevMatchLength=s,!this._wordSeparators||u(this._wordSeparators,e,t,o,s))return n}while(n);return null}}t.Searcher=g})),define(t[211],i([0,1,13,3,52,363,158]),(function(e,t,i,n,o,s,r){"use strict";function a(e){let t;return(t=e[e.length-1]<65536?new Uint16Array(e.length):new Uint32Array(e.length)).set(e,0),t}Object.defineProperty(t,"__esModule",{value:!0}), +t.PieceTreeBase=t.StringBuffer=t.Piece=t.createLineStarts=t.createLineStartsFast=t.LineStarts=t.createUintArray=t.AverageBufferSize=void 0,t.AverageBufferSize=65535,t.createUintArray=a;class l{constructor(e,t,i,n,o){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=n,this.isBasicASCII=o}}function d(e,t=!0){let i=[0],n=1;for(let t=0,o=e.length;t126)&&(r=!1)}const d=new l(a(e),n,o,s,r);return e.length=0,d};class c{constructor(e,t,i,n,o){this.bufferIndex=e,this.start=t,this.end=i,this.lineFeedCnt=n,this.length=o}}t.Piece=c;class h{constructor(e,t){this.buffer=e,this.lineStarts=t}}t.StringBuffer=h +;class u{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==s.SENTINEL&&e.iterate(e.root,e=>(e!==s.SENTINEL&&this._pieces.push(e.piece),!0))}read(){return 0===this._pieces.length?0===this._index?(this._index++,this._BOM):null:this._index>this._pieces.length-1?null:0===this._index?this._BOM+this._tree.getPieceContent(this._pieces[this._index++]):this._tree.getPieceContent(this._pieces[this._index++])}}class g{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){let i=this._cache[t];if(i.nodeStartOffset<=e&&i.nodeStartOffset+i.node.piece.length>=e)return i}return null}get2(e){for(let t=this._cache.length-1;t>=0;t--){let i=this._cache[t];if(i.nodeStartLineNumber&&i.nodeStartLineNumber=e)return i}return null}set(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)}validate(e){let t=!1,i=this._cache;for(let n=0;n=e)&&(i[n]=null,t=!0)}if(t){let e=[];for(const t of i)null!==t&&e.push(t);this._cache=e}}}t.PieceTreeBase=class{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new h("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=s.SENTINEL,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=i;let n=null;for(let t=0,i=e.length;t0){e[t].lineStarts||(e[t].lineStarts=d(e[t].buffer));let i=new c(t+1,{line:0,column:0},{line:e[t].lineStarts.length-1,column:e[t].buffer.length-e[t].lineStarts[e[t].lineStarts.length-1]},e[t].lineStarts.length-1,e[t].buffer.length);this._buffers.push(e[t]),n=this.rbInsertRight(n,i)}this._searchCache=new g(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){let i=t.AverageBufferSize,n=i-Math.floor(i/3),o=2*n,s="",r=0,a=[];if(this.iterate(this.root,t=>{let i=this.getNodeContent(t),l=i.length;if(r<=n||r+l0){let t=s.replace(/\r\n|\r|\n/g,e);a.push(new h(t,d(t)))}this.create(a,e,!0)}getEOL(){return this._EOL}setEOL(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)}createSnapshot(e){return new u(this,e)}getOffsetAt(e,t){let i=0,n=this.root;for(;n!==s.SENTINEL;)if(n.left!==s.SENTINEL&&n.lf_left+1>=e)n=n.left;else{if(n.lf_left+n.piece.lineFeedCnt+1>=e){return(i+=n.size_left)+(this.getAccumulatedValue(n,e-n.lf_left-2)+t-1)}e-=n.lf_left+n.piece.lineFeedCnt,i+=n.size_left+n.piece.length,n=n.right}return i}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,n=0,o=e;for(;t!==s.SENTINEL;)if(0!==t.size_left&&t.size_left>=e)t=t.left;else{if(t.size_left+t.piece.length>=e){let s=this.getIndexOf(t,e-t.size_left);if(n+=t.lf_left+s.index,0===s.index){let e=o-this.getOffsetAt(n+1,1);return new i.Position(n+1,e+1)}return new i.Position(n+1,s.remainder+1)}if(e-=t.size_left+t.piece.length, +n+=t.lf_left+t.piece.lineFeedCnt,t.right===s.SENTINEL){let t=o-e-this.getOffsetAt(n+1,1);return new i.Position(n+1,t+1)}t=t.right}return new i.Position(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";let i=this.nodeAt2(e.startLineNumber,e.startColumn),n=this.nodeAt2(e.endLineNumber,e.endColumn),o=this.getValueInRange2(i,n);return t?t===this._EOL&&this._EOLNormalized&&t===this.getEOL()&&this._EOLNormalized?o:o.replace(/\r\n|\r|\n/g,t):o}getValueInRange2(e,t){if(e.node===t.node){let i=e.node,n=this._buffers[i.piece.bufferIndex].buffer,o=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return n.substring(o+e.remainder,o+t.remainder)}let i=e.node,n=this._buffers[i.piece.bufferIndex].buffer,o=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start),r=n.substring(o+e.remainder,o+i.piece.length);for(i=i.next();i!==s.SENTINEL;){let e=this._buffers[i.piece.bufferIndex].buffer,n=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(i===t.node){ +r+=e.substring(n,n+t.remainder);break}r+=e.substr(n,i.piece.length),i=i.next()}return r}getLinesContent(){let e=[],t=0,i="",n=!1;return this.iterate(this.root,o=>{if(o===s.SENTINEL)return!0;const r=o.piece;let a=r.length;if(0===a)return!0;const l=this._buffers[r.bufferIndex].buffer,d=this._buffers[r.bufferIndex].lineStarts,c=r.start.line,h=r.end.line;let u=d[c]+r.start.column;if(n&&(10===l.charCodeAt(u)&&(u++,a--),e[t++]=i,i="",n=!1,0===a))return!0;if(c===h)return this._EOLNormalized||13!==l.charCodeAt(u+a-1)?i+=l.substr(u,a):(n=!0,i+=l.substr(u,a-1)),!0;i+=this._EOLNormalized?l.substring(u,Math.max(u,d[c+1]-this._EOLLength)):l.substring(u,d[c+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;for(let n=c+1;ne+v,t.reset(0)):(p=f.buffer,m=e=>e,t.reset(v));do{if(g=t.next(p)){if(m(g.index)>=C)return h;this.positionInBuffer(e,m(g.index)-_,b);let t=this.getLineFeedCnt(e.piece.bufferIndex,s,b),a=b.line===s.line?b.column-s.column+o:b.column+1,l=a+g[0].length;if(u[h++]=r.createFindMatch(new n.Range(i+t,a,i+t,l),g,d),m(g.index)+g[0].length>=C)return h;if(h>=c)return h}}while(g);return h}findMatchesLineByLine(e,t,i,n){const o=[];let s=0;const a=new r.Searcher(t.wordSeparators,t.regex);let l=this.nodeAt2(e.startLineNumber,e.startColumn);if(null===l)return[];let d=this.nodeAt2(e.endLineNumber,e.endColumn);if(null===d)return[] +;let c=this.positionInBuffer(l.node,l.remainder),h=this.positionInBuffer(d.node,d.remainder);if(l.node===d.node)return this.findMatchesInNode(l.node,a,e.startLineNumber,e.startColumn,c,h,t,i,n,s,o),o;let u=e.startLineNumber,g=l.node;for(;g!==d.node;){let r=this.getLineFeedCnt(g.piece.bufferIndex,c,g.piece.end);if(r>=1){let l=this._buffers[g.piece.bufferIndex].lineStarts,d=this.offsetInBuffer(g.piece.bufferIndex,g.piece.start),h=l[c.line+r],p=u===e.startLineNumber?e.startColumn:1;if((s=this.findMatchesInNode(g,a,u,p,c,this.positionInBuffer(g,h-d),t,i,n,s,o))>=n)return o;u+=r}let d=u===e.startLineNumber?e.startColumn-1:0;if(u===e.endLineNumber){const r=this.getLineContent(u).substring(d,e.endColumn-1);return s=this._findMatchesInLine(t,a,r,e.endLineNumber,d,s,o,i,n),o}if((s=this._findMatchesInLine(t,a,this.getLineContent(u).substr(d),u,d,s,o,i,n))>=n)return o;u++,g=(l=this.nodeAt2(u,1)).node,c=this.positionInBuffer(l.node,l.remainder)}if(u===e.endLineNumber){let r=u===e.startLineNumber?e.startColumn-1:0 +;const l=this.getLineContent(u).substring(r,e.endColumn-1);return s=this._findMatchesInLine(t,a,l,e.endLineNumber,r,s,o,i,n),o}let p=u===e.startLineNumber?e.startColumn:1;return s=this.findMatchesInNode(d.node,a,u,p,c,h,t,i,n,s,o),o}_findMatchesInLine(e,t,i,s,a,l,d,c,h){const u=e.wordSeparators;if(!c&&e.simpleSearch){const t=e.simpleSearch,c=t.length,g=i.length;let p=-c;for(;-1!==(p=i.indexOf(t,p+c));)if((!u||r.isValidMatch(u,i,g,p,c))&&(d[l++]=new o.FindMatch(new n.Range(s,p+1+a,s,p+1+c+a),null),l>=h))return l;return l}let g;t.reset(0);do{if((g=t.next(i))&&(d[l++]=r.createFindMatch(new n.Range(s,g.index+1+a,s,g.index+1+g[0].length+a),g,c),l>=h))return l}while(g);return l}insert(e,i,n=!1){if(this._EOLNormalized=this._EOLNormalized&&n,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==s.SENTINEL){let{node:n,remainder:o,nodeStartOffset:s}=this.nodeAt(e),r=n.piece,a=r.bufferIndex,l=this.positionInBuffer(n,o) +;if(0===n.piece.bufferIndex&&r.end.line===this._lastChangeBufferPos.line&&r.end.column===this._lastChangeBufferPos.column&&s+r.length===e&&i.lengthe){let e=[],t=new c(r.bufferIndex,l,r.end,this.getLineFeedCnt(r.bufferIndex,l,r.end),this.offsetInBuffer(a,r.end)-this.offsetInBuffer(a,l));if(this.shouldCheckCRLF()&&this.endWithCR(i)){if(10===this.nodeCharCodeAt(n,o)){let e={line:t.start.line+1,column:0};t=new c(t.bufferIndex,e,t.end,this.getLineFeedCnt(t.bufferIndex,e,t.end),t.length-1),i+="\n"}}if(this.shouldCheckCRLF()&&this.startWithLF(i)){if(13===this.nodeCharCodeAt(n,o-1)){let t=this.positionInBuffer(n,o-1);this.deleteNodeTail(n,t),i="\r"+i,0===n.piece.length&&e.push(n)}else this.deleteNodeTail(n,l)}else this.deleteNodeTail(n,l);let s=this.createNewPieces(i);t.length>0&&this.rbInsertRight(n,t);let d=n +;for(let e=0;e=0;e--)o=this.rbInsertLeft(o,n[e]);this.validateCRLFWithPrevNode(o),this.deleteNodes(i)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+="\n") +;let i=this.createNewPieces(e),n=this.rbInsertRight(t,i[0]),o=n;for(let e=1;e=c))break;a=d+1}return i?(i.line=d,i.column=r-h,null):{line:d,column:r-h}}getLineFeedCnt(e,t,i){if(0===i.column)return i.line-t.line;let n=this._buffers[e].lineStarts;if(i.line===n.length-1)return i.line-t.line;let o=n[i.line+1],s=n[i.line]+i.column;if(o>s+1)return i.line-t.line;let r=s-1;return 13===this._buffers[e].buffer.charCodeAt(r)?i.line-t.line+1:i.line-t.line}offsetInBuffer(e,t){return this._buffers[e].lineStarts[t.line]+t.column}deleteNodes(e){for(let t=0;tt.AverageBufferSize){let i=[];for(;e.length>t.AverageBufferSize;){ +const n=e.charCodeAt(t.AverageBufferSize-1);let o;13===n||n>=55296&&n<=56319?(o=e.substring(0,t.AverageBufferSize-1),e=e.substring(t.AverageBufferSize-1)):(o=e.substring(0,t.AverageBufferSize),e=e.substring(t.AverageBufferSize));let s=d(o);i.push(new c(this._buffers.length,{line:0,column:0},{line:s.length-1,column:o.length-s[s.length-1]},s.length-1,o.length)),this._buffers.push(new h(o,s))}let n=d(e);return i.push(new c(this._buffers.length,{line:0,column:0},{line:n.length-1,column:e.length-n[n.length-1]},n.length-1,e.length)),this._buffers.push(new h(e,n)),i}let i=this._buffers[0].buffer.length;const n=d(e,!1);let o=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===i&&0!==i&&this.startWithLF(e)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},o=this._lastChangeBufferPos;for(let e=0;e=e-1)i=i.left;else{ +if(i.lf_left+i.piece.lineFeedCnt>e-1){let n=this.getAccumulatedValue(i,e-i.lf_left-2),s=this.getAccumulatedValue(i,e-i.lf_left-1),a=this._buffers[i.piece.bufferIndex].buffer,l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return o+=i.size_left,this._searchCache.set({node:i,nodeStartOffset:o,nodeStartLineNumber:r-(e-1-i.lf_left)}),a.substring(l+n,l+s-t)}if(i.lf_left+i.piece.lineFeedCnt===e-1){let t=this.getAccumulatedValue(i,e-i.lf_left-2),o=this._buffers[i.piece.bufferIndex].buffer,s=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n=o.substring(s+t,s+i.piece.length);break}e-=i.lf_left+i.piece.lineFeedCnt,o+=i.size_left+i.piece.length,i=i.right}}for(i=i.next();i!==s.SENTINEL;){let e=this._buffers[i.piece.bufferIndex].buffer;if(i.piece.lineFeedCnt>0){let o=this.getAccumulatedValue(i,0),s=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return n+=e.substring(s,s+o-t)}{let t=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n+=e.substr(t,i.piece.length)}i=i.next()}return n} +computeBufferMetadata(){let e=this.root,t=1,i=0;for(;e!==s.SENTINEL;)t+=e.lf_left+e.piece.lineFeedCnt,i+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=i,this._searchCache.validate(this._length)}getIndexOf(e,t){let i=e.piece,n=this.positionInBuffer(e,t),o=n.line-i.start.line;if(this.offsetInBuffer(i.bufferIndex,i.end)-this.offsetInBuffer(i.bufferIndex,i.start)===t){let t=this.getLineFeedCnt(e.piece.bufferIndex,i.start,n);if(t!==o)return{index:t,remainder:0}}return{index:o,remainder:n.column}}getAccumulatedValue(e,t){if(t<0)return 0;let i=e.piece,n=this._buffers[i.bufferIndex].lineStarts,o=i.start.line+t+1;return o>i.end.line?n[i.end.line]+i.end.column-n[i.start.line]-i.start.column:n[o]-n[i.start.line]-i.start.column}deleteNodeTail(e,t){const i=e.piece,n=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.end),r=t,a=this.offsetInBuffer(i.bufferIndex,r),l=this.getLineFeedCnt(i.bufferIndex,i.start,r),d=l-n,h=a-o,u=i.length+h;e.piece=new c(i.bufferIndex,i.start,r,l,u), +s.updateTreeMetadata(this,e,h,d)}deleteNodeHead(e,t){const i=e.piece,n=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.start),r=t,a=this.getLineFeedCnt(i.bufferIndex,r,i.end),l=a-n,d=o-this.offsetInBuffer(i.bufferIndex,r),h=i.length+d;e.piece=new c(i.bufferIndex,r,i.end,a,h),s.updateTreeMetadata(this,e,d,l)}shrinkNode(e,t,i){const n=e.piece,o=n.start,r=n.end,a=n.length,l=n.lineFeedCnt,d=t,h=this.getLineFeedCnt(n.bufferIndex,n.start,d),u=this.offsetInBuffer(n.bufferIndex,t)-this.offsetInBuffer(n.bufferIndex,o);e.piece=new c(n.bufferIndex,n.start,d,h,u),s.updateTreeMetadata(this,e,u-a,h-l);let g=new c(n.bufferIndex,i,r,this.getLineFeedCnt(n.bufferIndex,i,r),this.offsetInBuffer(n.bufferIndex,r)-this.offsetInBuffer(n.bufferIndex,i)),p=this.rbInsertRight(e,g);this.validateCRLFWithPrevNode(p)}appendToNode(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+="\n");const i=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),n=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const o=d(t,!1) +;for(let e=0;ee)t=t.left;else{if(t.size_left+t.piece.length>=e){n+=t.size_left;let i={node:t,remainder:e-t.size_left,nodeStartOffset:n};return this._searchCache.set(i),i}e-=t.size_left+t.piece.length, +n+=t.size_left+t.piece.length,t=t.right}return null}nodeAt2(e,t){let i=this.root,n=0;for(;i!==s.SENTINEL;)if(i.left!==s.SENTINEL&&i.lf_left>=e-1)i=i.left;else{if(i.lf_left+i.piece.lineFeedCnt>e-1){let o=this.getAccumulatedValue(i,e-i.lf_left-2),s=this.getAccumulatedValue(i,e-i.lf_left-1);return n+=i.size_left,{node:i,remainder:Math.min(o+t-1,s),nodeStartOffset:n}}if(i.lf_left+i.piece.lineFeedCnt===e-1){let o=this.getAccumulatedValue(i,e-i.lf_left-2);if(o+t-1<=i.piece.length)return{node:i,remainder:o+t-1,nodeStartOffset:n};t-=i.piece.length-o;break}e-=i.lf_left+i.piece.lineFeedCnt,n+=i.size_left+i.piece.length,i=i.right}for(i=i.next();i!==s.SENTINEL;){if(i.piece.lineFeedCnt>0){let e=this.getAccumulatedValue(i,0),n=this.offsetOfNode(i);return{node:i,remainder:Math.min(t-1,e),nodeStartOffset:n}}if(i.piece.length>=t-1){return{node:i,remainder:t-1,nodeStartOffset:this.offsetOfNode(i)}}t-=i.piece.length,i=i.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1 +;let i=this._buffers[e.piece.bufferIndex],n=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return i.buffer.charCodeAt(n)}offsetOfNode(e){if(!e)return 0;let t=e.size_left;for(;e!==this.root;)e.parent.right===e&&(t+=e.parent.size_left+e.parent.piece.length),e=e.parent;return t}shouldCheckCRLF(){return!(this._EOLNormalized&&"\n"===this._EOL)}startWithLF(e){if("string"==typeof e)return 10===e.charCodeAt(0);if(e===s.SENTINEL||0===e.piece.lineFeedCnt)return!1;let t=e.piece,i=this._buffers[t.bufferIndex].lineStarts,n=t.start.line,o=i[n]+t.start.column;return n!==i.length-1&&(!(i[n+1]>o+1)&&10===this._buffers[t.bufferIndex].buffer.charCodeAt(o))}endWithCR(e){return"string"==typeof e?13===e.charCodeAt(e.length-1):e!==s.SENTINEL&&0!==e.piece.lineFeedCnt&&13===this.nodeCharCodeAt(e,e.piece.length-1)}validateCRLFWithPrevNode(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){let t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}}validateCRLFWithNextNode(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){ +let t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}}fixCRLF(e,t){let i,n=[],o=this._buffers[e.piece.bufferIndex].lineStarts;i=0===e.piece.end.column?{line:e.piece.end.line-1,column:o[e.piece.end.line]-o[e.piece.end.line-1]-1}:{line:e.piece.end.line,column:e.piece.end.column-1};const r=e.piece.length-1,a=e.piece.lineFeedCnt-1;e.piece=new c(e.piece.bufferIndex,e.piece.start,i,a,r),s.updateTreeMetadata(this,e,-1,-1),0===e.piece.length&&n.push(e);let l={line:t.piece.start.line+1,column:0};const d=t.piece.length-1,h=this.getLineFeedCnt(t.piece.bufferIndex,l,t.piece.end);t.piece=new c(t.piece.bufferIndex,l,t.piece.end,h,d),s.updateTreeMetadata(this,t,-1,-1),0===t.piece.length&&n.push(t);let u=this.createNewPieces("\r\n");this.rbInsertRight(e,u[0]);for(let e=0;e/?",t.DEFAULT_WORD_REGEXP=function(e=""){let i="(-?\\d*\\.\\d\\w*)|([^";for(const n of t.USUAL_WORD_SEPARATORS)e.indexOf(n)>=0||(i+="\\"+n);return i+="\\s]+)",new RegExp(i,"g")}(),t.ensureValidWordDefinition=function(e){let i=t.DEFAULT_WORD_REGEXP;if(e&&e instanceof RegExp)if(e.global)i=e;else{let t="g";e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),i=new RegExp(e.source,t)}return i.lastIndex=0,i};const i={maxLen:1e3,windowSize:15,timeBudget:150};function n(e,t,i,n){let o +;for(;o=e.exec(t);){const t=o.index||0;if(t<=i&&e.lastIndex>=i)return o;if(n>0&&t>n)return null}return null}t.getWordAtText=function e(t,o,s,r,a=i){if(s.length>a.maxLen){let i=t-a.maxLen/2;return i<0?(r+=t,i=0):r+=i,e(t,o,s=s.substring(i,t+a.maxLen/2),r,a)}Date.now();const l=t-1-r;let d=-1,c=null;for(let e=1;;e++){Date.now(),a.timeBudget;const t=l-a.windowSize*e;o.lastIndex=Math.max(0,t);const i=n(o,s,l,d);if(!i&&c)break;if(c=i,t<=0)break;d=t}if(c){let e={word:c[0],startColumn:r+1+c.index,endColumn:r+1+c.index+c[0].length};return o.lastIndex=0,e}return null}})),define(t[365],i([0,1]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FrankensteinMode=void 0;t.FrankensteinMode=class{constructor(e){this._languageIdentifier=e}getId(){return this._languageIdentifier.language}}})),define(t[102],i([0,1]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StandardAutoClosingPairConditional=t.IndentAction=void 0,function(e){e[e.None=0]="None", +e[e.Indent=1]="Indent",e[e.IndentOutdent=2]="IndentOutdent",e[e.Outdent=3]="Outdent"}(t.IndentAction||(t.IndentAction={}));t.StandardAutoClosingPairConditional=class{constructor(e){if(this.open=e.open,this.close=e.close,this._standardTokenMask=0,Array.isArray(e.notIn))for(let t=0,i=e.notIn.length;ti&&(i=t)}return i}if("string"==typeof t)return r?"*"===t?5:t===s?10:0:0;if(t){const{language:e,pattern:a,scheme:l,hasAccessToAllModels:d}=t;if(!r&&!d)return 0;let c=0;if(l)if(l===o.scheme)c=10;else{if("*"!==l)return 0;c=5}if(e)if(e===s)c=10;else{if("*"!==e)return 0 +;c=Math.max(c,5)}if(a){let e;if((e="string"==typeof a?a:Object.assign(Object.assign({},a),{base:n.normalize(a.base)}))!==o.fsPath&&!i.match(e,o.fsPath))return 0;c=10}return c}return 0}})),define(t[367],i([0,1,87]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.computeLinks=t.LinkComputer=t.StateMachine=t.Uint8Matrix=void 0;class n{constructor(e,t,i){const n=new Uint8Array(e*t);for(let o=0,s=e*t;ot&&(t=s),o>i&&(i=o),r>i&&(i=r)}let o=new n(++i,++t,0);for(let t=0,i=e.length;t=this._maxCharCode?0:this._states.get(e,t)}}t.StateMachine=o;let s=null;let r=null;class a{static _createLink(e,t,i,n,o){let s=o-1;do{const i=t.charCodeAt(s) +;if(2!==e.get(i))break;s--}while(s>n);if(n>0){const e=t.charCodeAt(n-1),i=t.charCodeAt(s);(40===e&&41===i||91===e&&93===i||123===e&&125===i)&&s--}return{range:{startLineNumber:i,startColumn:n+1,endLineNumber:i,endColumn:s+2},url:t.substring(n,s+1)}}static computeLinks(e,t=(null===s&&(s=new o([[1,104,2],[1,72,2],[1,102,6],[1,70,6],[2,116,3],[2,84,3],[3,116,4],[3,84,4],[4,112,5],[4,80,5],[5,115,9],[5,83,9],[5,58,10],[6,105,7],[6,73,7],[7,108,8],[7,76,8],[8,101,9],[8,69,9],[9,58,10],[10,47,11],[11,47,12]])),s)){const n=function(){if(null===r){r=new i.CharacterClassifier(0);const e=" \t<>'\"、。。、,.:;‘“〈《「『【〔([{「」}])〕】』」》〉”’`~…";for(let t=0;t0&&e.getLanguageId(a-1)===s;)a--;return new i(e,s,a,r+1,e.getStartOffset(a),e.getEndOffset(r))};class i{constructor(e,t,i,n,o,s){this._actual=e,this.languageId=t,this._firstTokenIndex=i,this._lastTokenIndex=n,this.firstCharOffset=o,this._lastCharOffset=s}getLineContent(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)}getActualLineContentBefore(e){return this._actual.getLineContent().substring(0,this.firstCharOffset+e)}getTokenCount(){return this._lastTokenIndex-this._firstTokenIndex}findTokenIndexAtOffset(e){return this._actual.findTokenIndexAtOffset(e+this.firstCharOffset)-this._firstTokenIndex}getStandardTokenType(e){return this._actual.getStandardTokenType(e+this._firstTokenIndex)}}t.ScopedLineTokens=i,t.ignoreBracketsInToken=function(e){return 0!=(7&e)}})),define(t[368],i([0,1,102]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CharacterPairSupport=void 0;class n{constructor(e){ +if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map(e=>new i.StandardAutoClosingPairConditional(e)):e.brackets?this._autoClosingPairs=e.brackets.map(e=>new i.StandardAutoClosingPairConditional({open:e[0],close:e[1]})):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new i.StandardAutoClosingPairConditional({open:t.open,close:t.close||""}))}this._autoCloseBefore="string"==typeof e.autoCloseBefore?e.autoCloseBefore:n.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED,this._surroundingPairs=e.surroundingPairs||this._autoClosingPairs}getAutoClosingPairs(){return this._autoClosingPairs}getAutoCloseBeforeSet(){return this._autoCloseBefore}static shouldAutoClosePair(e,t,i){if(0===t.getTokenCount())return!0;const n=t.findTokenIndexAtOffset(i-2),o=t.getStandardTokenType(n);return e.isOK(o)}getSurroundingPairs(){return this._surroundingPairs}}t.CharacterPairSupport=n, +n.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED=";:.,=}])> \n\t"})),define(t[369],i([0,1]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IndentRulesSupport=void 0;t.IndentRulesSupport=class{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&this._indentationRules.unIndentedLinePattern.test(e))}getIndentMetadata(e){let t=0;return this.shouldIncrease(e)&&(t+=1),this.shouldDecrease(e)&&(t+=2),this.shouldIndentNextLine(e)&&(t+=4), +this.shouldIgnore(e)&&(t+=8),t}}})),define(t[370],i([0,1]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BasicInplaceReplace=void 0;class i{constructor(){this._defaultValueSet=[["true","false"],["True","False"],["Private","Public","Friend","ReadOnly","Partial","Protected","WriteOnly"],["public","protected","private"]]}navigateValueSet(e,t,i,n,o){if(e&&t){let i=this.doNavigateValueSet(t,o);if(i)return{range:e,value:i}}if(i&&n){let e=this.doNavigateValueSet(n,o);if(e)return{range:i,value:e}}return null}doNavigateValueSet(e,t){let i=this.numberReplace(e,t);return null!==i?i:this.textReplace(e,t)}numberReplace(e,t){let i=Math.pow(10,e.length-(e.lastIndexOf(".")+1)),n=Number(e),o=parseFloat(e);return isNaN(n)||isNaN(o)||n!==o?null:0!==n||t?(n=Math.floor(n*i),n+=t?i:-i,String(n/i)):null}textReplace(e,t){return this.valueSetsReplace(this._defaultValueSet,e,t)}valueSetsReplace(e,t,i){let n=null;for(let o=0,s=e.length;null===n&&o=0?((n+=i?1:-1)<0?n=e.length-1:n%=e.length,e[n]):null}}t.BasicInplaceReplace=i,i.INSTANCE=new i})),define(t[371],i([0,1,12,8,102]),(function(e,t,i,n,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OnEnterSupport=void 0;class s{constructor(e){(e=e||{}).brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(e=>{const t=s._createOpenBracketRegExp(e[0]),i=s._createCloseBracketRegExp(e[1]);t&&i&&this._brackets.push({open:e[0],openRegExp:t,close:e[1],closeRegExp:i})}),this._regExpRules=e.onEnterRules||[]}onEnter(e,t,i,n){if(e>=3)for(let e=0,o=this._regExpRules.length;e!e.reg||e.reg.test(e.text)))return o.action}if(e>=2&&i.length>0&&n.length>0)for(let e=0,t=this._brackets.length;e=2&&i.length>0)for(let e=0,t=this._brackets.length;e=0&&n.push(t);for(const t of s.close)t.indexOf(e)>=0&&n.push(t)}}function a(e,t){return e.length-t.length}function l(e){if(e.length<=1)return e;const t=[],i=new Set;for(const n of e)i.has(n)||(t.push(n),i.add(n));return t}function d(e){const t=/^[\w ]+$/.test(e);return e=i.escapeRegExpCharacters(e),t?`\\b${e}\\b`:e}function c(e){let t=`(${e.map(d).join(")|(")})`;return i.createRegExp(t,!0)}t.RichEditBrackets=class{constructor(e,t){const i=function(e){const t=e.length;e=e.map(e=>[e[0].toLowerCase(),e[1].toLowerCase()]);const i=[];for(let e=0;e{const[i,n]=e,[o,s]=t;return i===o||i===s||n===o||n===s},o=(e,n)=>{const o=Math.min(e,n),s=Math.max(e,n);for(let e=0;e0&&s.push({open:o,close:r})}return s}(t);this.brackets=i.map((t,n)=>new s(e,n,t.open,t.close,function(e,t,i,n){let o=[];o=(o=o.concat(e)).concat(t);for(let e=0,t=o.length;e=0;n--)t[i++]=e.charCodeAt(n);return n.getPlatformTextDecoder().decode(t)}{let t=[],i=0;for(let n=e.length-1;n>=0;n--)t[i++]=e.charAt(n);return t.join("")}}(e=i)),t}}();t.BracketsUtils=class{static _findPrevBracketInText(e,t,i,n){let s=i.match(e);if(!s)return null;let r=i.length-(s.index||0),a=s[0].length,l=n+r;return new o.Range(t,l-a+1,t,l+1)}static findPrevBracketInRange(e,t,i,n,o){const s=h(i).substring(i.length-o,i.length-n);return this._findPrevBracketInText(e,t,s,n)}static findNextBracketInText(e,t,i,n){let s=i.match(e);if(!s)return null +;let r=s.index||0,a=s[0].length;if(0===a)return null;let l=n+r;return new o.Range(t,l+1,t,l+1+a)}static findNextBracketInRange(e,t,i,n,o){const s=i.substring(n,o);return this.findNextBracketInText(e,t,s,n)}}})),define(t[372],i([0,1,159,160]),(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BracketElectricCharacterSupport=void 0;t.BracketElectricCharacterSupport=class{constructor(e){this._richEditBrackets=e}getElectricCharacters(){let e=[];if(this._richEditBrackets)for(const t of this._richEditBrackets.brackets)for(const i of t.close){const t=i.charAt(i.length-1);e.push(t)}return e=e.filter((e,t,i)=>i.indexOf(e)===t)}onElectricCharacter(e,t,o){if(!this._richEditBrackets||0===this._richEditBrackets.brackets.length)return null;const s=t.findTokenIndexAtOffset(o-1);if(i.ignoreBracketsInToken(t.getStandardTokenType(s)))return null;const r=this._richEditBrackets.reversedRegex,a=t.getLineContent().substring(0,o-1)+e,l=n.BracketsUtils.findPrevBracketInRange(r,1,a,0,a.length) +;if(!l)return null;const d=a.substring(l.startColumn-1,l.endColumn-1).toLowerCase();if(this._richEditBrackets.textIsOpenBracket[d])return null;const c=t.getActualLineContentBefore(l.startColumn-1);return/^\s*$/.test(c)?{matchOpenBracket:d}:null}}})),define(t[42],i([0,1,4,2,8,122,102,159,368,372,369,371,160]),(function(e,t,i,n,o,s,r,a,l,d,c,h,u){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LanguageConfigurationRegistry=t.LanguageConfigurationRegistryImpl=t.LanguageConfigurationChangeEvent=t.RichEditSupport=void 0;class g{constructor(e,t,i){this._languageIdentifier=e,this._brackets=null,this._electricCharacter=null;let n=null;t&&(n=t._conf),this._conf=g._mergeConf(n,i),this._onEnterSupport=this._conf.brackets||this._conf.indentationRules||this._conf.onEnterRules?new h.OnEnterSupport(this._conf):null,this.comments=g._handleComments(this._conf),this.characterPair=new l.CharacterPairSupport(this._conf),this.wordDefinition=this._conf.wordPattern||s.DEFAULT_WORD_REGEXP, +this.indentationRules=this._conf.indentationRules,this._conf.indentationRules?this.indentRulesSupport=new c.IndentRulesSupport(this._conf.indentationRules):this.indentRulesSupport=null,this.foldingRules=this._conf.folding||{}}get brackets(){return!this._brackets&&this._conf.brackets&&(this._brackets=new u.RichEditBrackets(this._languageIdentifier,this._conf.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new d.BracketElectricCharacterSupport(this.brackets)),this._electricCharacter}onEnter(e,t,i,n){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,i,n):null}static _mergeConf(e,t){return{comments:e?t.comments||e.comments:t.comments,brackets:e?t.brackets||e.brackets:t.brackets,wordPattern:e?t.wordPattern||e.wordPattern:t.wordPattern,indentationRules:e?t.indentationRules||e.indentationRules:t.indentationRules,onEnterRules:e?t.onEnterRules||e.onEnterRules:t.onEnterRules, +autoClosingPairs:e?t.autoClosingPairs||e.autoClosingPairs:t.autoClosingPairs,surroundingPairs:e?t.surroundingPairs||e.surroundingPairs:t.surroundingPairs,autoCloseBefore:e?t.autoCloseBefore||e.autoCloseBefore:t.autoCloseBefore,folding:e?t.folding||e.folding:t.folding,__electricCharacterSupport:e?t.__electricCharacterSupport||e.__electricCharacterSupport:t.__electricCharacterSupport}}static _handleComments(e){let t=e.comments;if(!t)return null;let i={};if(t.lineComment&&(i.lineCommentToken=t.lineComment),t.blockComment){let[e,n]=t.blockComment;i.blockCommentStartToken=e,i.blockCommentEndToken=n}return i}}t.RichEditSupport=g;class p{constructor(e){this.languageIdentifier=e}}t.LanguageConfigurationChangeEvent=p;class m{constructor(){this._entries=new Map,this._onDidChange=new i.Emitter,this.onDidChange=this._onDidChange.event}register(e,t){let i=this._getRichEditSupport(e.id),o=new g(e,i,t);return this._entries.set(e.id,o),this._onDidChange.fire(new p(e)),n.toDisposable(()=>{ +this._entries.get(e.id)===o&&(this._entries.set(e.id,i),this._onDidChange.fire(new p(e)))})}_getRichEditSupport(e){return this._entries.get(e)}getIndentationRules(e){const t=this._entries.get(e);return t&&t.indentationRules||null}_getElectricCharacterSupport(e){let t=this._getRichEditSupport(e);return t&&t.electricCharacter||null}getElectricCharacters(e){let t=this._getElectricCharacterSupport(e);return t?t.getElectricCharacters():[]}onElectricCharacter(e,t,i){let n=a.createScopedLineTokens(t,i-1),o=this._getElectricCharacterSupport(n.languageId);return o?o.onElectricCharacter(e,n,i-n.firstCharOffset):null}getComments(e){let t=this._getRichEditSupport(e);return t&&t.comments||null}_getCharacterPairSupport(e){let t=this._getRichEditSupport(e);return t&&t.characterPair||null}getAutoClosingPairs(e){let t=this._getCharacterPairSupport(e);return t?t.getAutoClosingPairs():[]}getAutoCloseBeforeSet(e){let t=this._getCharacterPairSupport(e) +;return t?t.getAutoCloseBeforeSet():l.CharacterPairSupport.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED}getSurroundingPairs(e){let t=this._getCharacterPairSupport(e);return t?t.getSurroundingPairs():[]}shouldAutoClosePair(e,t,i){const n=a.createScopedLineTokens(t,i-1);return l.CharacterPairSupport.shouldAutoClosePair(e,n,i-n.firstCharOffset)}getWordDefinition(e){let t=this._getRichEditSupport(e);return t?s.ensureValidWordDefinition(t.wordDefinition||null):s.ensureValidWordDefinition(null)}getFoldingRules(e){let t=this._getRichEditSupport(e);return t?t.foldingRules:{}}getIndentRulesSupport(e){let t=this._getRichEditSupport(e);return t&&t.indentRulesSupport||null}getPrecedingValidLine(e,t,i){let n=e.getLanguageIdAtPosition(t,0);if(t>1){let o,s=-1;for(o=t-1;o>=1;o--){if(e.getLanguageIdAtPosition(o,0)!==n)return s;let t=e.getLineContent(o);if(!i.shouldIgnore(t)&&!/^\s+$/.test(t)&&""!==t)return o;s=o}}return-1}getInheritIndentForLine(e,t,i,n=!0){if(e<4)return null +;const s=this.getIndentRulesSupport(t.getLanguageIdentifier().id);if(!s)return null;if(i<=1)return{indentation:"",action:null};const a=this.getPrecedingValidLine(t,i,s);if(a<0)return null;if(a<1)return{indentation:"",action:null};const l=t.getLineContent(a);if(s.shouldIncrease(l)||s.shouldIndentNextLine(l))return{indentation:o.getLeadingWhitespace(l),action:r.IndentAction.Indent,line:a};if(s.shouldDecrease(l))return{indentation:o.getLeadingWhitespace(l),action:null,line:a};{if(1===a)return{indentation:o.getLeadingWhitespace(t.getLineContent(a)),action:null,line:a};const e=a-1,i=s.getIndentMetadata(t.getLineContent(e));if(!(3&i)&&4&i){let i=0;for(let n=e-1;n>0;n--)if(!s.shouldIndentNextLine(t.getLineContent(n))){i=n;break}return{indentation:o.getLeadingWhitespace(t.getLineContent(i+1)),action:null,line:i+1}}if(n)return{indentation:o.getLeadingWhitespace(t.getLineContent(a)),action:null,line:a};for(let e=a;e>0;e--){const i=t.getLineContent(e);if(s.shouldIncrease(i))return{indentation:o.getLeadingWhitespace(i), +action:r.IndentAction.Indent,line:e};if(s.shouldIndentNextLine(i)){let i=0;for(let n=e-1;n>0;n--)if(!s.shouldIndentNextLine(t.getLineContent(e))){i=n;break}return{indentation:o.getLeadingWhitespace(t.getLineContent(i+1)),action:null,line:i+1}}if(s.shouldDecrease(i))return{indentation:o.getLeadingWhitespace(i),action:null,line:e}}return{indentation:o.getLeadingWhitespace(t.getLineContent(1)),action:null,line:1}}}getGoodIndentForLine(e,t,i,n,s){if(e<4)return null;const a=this._getRichEditSupport(i);if(!a)return null;const l=this.getIndentRulesSupport(i);if(!l)return null;const d=this.getInheritIndentForLine(e,t,n),c=t.getLineContent(n);if(d){const i=d.line;if(void 0!==i){const n=a.onEnter(e,"",t.getLineContent(i),"");if(n){let e=o.getLeadingWhitespace(t.getLineContent(i));return n.removeText&&(e=e.substring(0,e.length-n.removeText)),n.indentAction===r.IndentAction.Indent||n.indentAction===r.IndentAction.IndentOutdent?e=s.shiftIndent(e):n.indentAction===r.IndentAction.Outdent&&(e=s.unshiftIndent(e)), +l.shouldDecrease(c)&&(e=s.unshiftIndent(e)),n.appendText&&(e+=n.appendText),o.getLeadingWhitespace(e)}}return l.shouldDecrease(c)?d.action===r.IndentAction.Indent?d.indentation:s.unshiftIndent(d.indentation):d.action===r.IndentAction.Indent?s.shiftIndent(d.indentation):d.indentation}return null}getIndentForEnter(e,t,i,n){if(e<4)return null;t.forceTokenization(i.startLineNumber);const s=t.getLineTokens(i.startLineNumber),l=a.createScopedLineTokens(s,i.startColumn-1),d=l.getLineContent();let c,h,u=!1;if(l.firstCharOffset>0&&s.getLanguageId(0)!==l.languageId?(u=!0,c=d.substr(0,i.startColumn-1-l.firstCharOffset)):c=s.getLineContent().substring(0,i.startColumn-1),i.isEmpty())h=d.substr(i.startColumn-1-l.firstCharOffset);else{h=this.getScopedLineTokens(t,i.endLineNumber,i.endColumn).getLineContent().substr(i.endColumn-1-l.firstCharOffset)}const g=this.getIndentRulesSupport(l.languageId);if(!g)return null;const p=c,m=o.getLeadingWhitespace(c),f={getLineTokens:e=>t.getLineTokens(e), +getLanguageIdentifier:()=>t.getLanguageIdentifier(),getLanguageIdAtPosition:(e,i)=>t.getLanguageIdAtPosition(e,i),getLineContent:e=>e===i.startLineNumber?p:t.getLineContent(e)},_=o.getLeadingWhitespace(s.getLineContent()),v=this.getInheritIndentForLine(e,f,i.startLineNumber+1);if(!v){const e=u?_:m;return{beforeEnter:e,afterEnter:e}}let C=u?_:v.indentation;return v.action===r.IndentAction.Indent&&(C=n.shiftIndent(C)),g.shouldDecrease(h)&&(C=n.unshiftIndent(C)),{beforeEnter:u?_:m,afterEnter:C}}getIndentActionForType(e,t,i,n,o){if(e<4)return null;const s=this.getScopedLineTokens(t,i.startLineNumber,i.startColumn),a=this.getIndentRulesSupport(s.languageId);if(!a)return null;const l=s.getLineContent(),d=l.substr(0,i.startColumn-1-s.firstCharOffset);let c;if(i.isEmpty())c=l.substr(i.startColumn-1-s.firstCharOffset);else{c=this.getScopedLineTokens(t,i.endLineNumber,i.endColumn).getLineContent().substr(i.endColumn-1-s.firstCharOffset)}if(!a.shouldDecrease(d+c)&&a.shouldDecrease(d+n+c)){ +const n=this.getInheritIndentForLine(e,t,i.startLineNumber,!1);if(!n)return null;let s=n.indentation;return n.action!==r.IndentAction.Indent&&(s=o.unshiftIndent(s)),s}return null}getIndentMetadata(e,t){const i=this.getIndentRulesSupport(e.getLanguageIdentifier().id);return i?t<1||t>e.getLineCount()?null:i.getIndentMetadata(e.getLineContent(t)):null}getEnterAction(e,t,i){const n=this.getScopedLineTokens(t,i.startLineNumber,i.startColumn),o=this._getRichEditSupport(n.languageId);if(!o)return null;const s=n.getLineContent(),a=s.substr(0,i.startColumn-1-n.firstCharOffset);let l;if(i.isEmpty())l=s.substr(i.startColumn-1-n.firstCharOffset);else{l=this.getScopedLineTokens(t,i.endLineNumber,i.endColumn).getLineContent().substr(i.endColumn-1-n.firstCharOffset)}let d="";if(i.startLineNumber>1&&0===n.firstCharOffset){const e=this.getScopedLineTokens(t,i.startLineNumber-1);e.languageId===n.languageId&&(d=e.getLineContent())}const c=o.onEnter(e,d,a,l);if(!c)return null;const h=c.indentAction;let u=c.appendText +;const g=c.removeText||0;u||(u=h===r.IndentAction.Indent||h===r.IndentAction.IndentOutdent?"\t":"");let p=this.getIndentationAtPosition(t,i.startLineNumber,i.startColumn);return g&&(p=p.substring(0,p.length-g)),{indentAction:h,appendText:u,removeText:g,indentation:p}}getIndentationAtPosition(e,t,i){const n=e.getLineContent(t);let s=o.getLeadingWhitespace(n);return s.length>i-1&&(s=s.substring(0,i-1)),s}getScopedLineTokens(e,t,i){e.forceTokenization(t);const n=e.getLineTokens(t),o=void 0===i?e.getLineMaxColumn(t)-1:i-1;return a.createScopedLineTokens(n,o)}getBracketsSupport(e){const t=this._getRichEditSupport(e);return t&&t.brackets||null}}t.LanguageConfigurationRegistryImpl=m,t.LanguageConfigurationRegistry=new m})),define(t[373],i([0,1,29]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateTokensCSSForColorMap=t.ThemeTrieElement=t.ThemeTrieElementRule=t.strcmp=t.toStandardTokenType=t.TokenTheme=t.ColorMap=t.parseTokenTheme=t.ParsedTokenThemeRule=void 0;class n{ +constructor(e,t,i,n,o){this.token=e,this.index=t,this.fontStyle=i,this.foreground=n,this.background=o}}function o(e){if(!e||!Array.isArray(e))return[];let t=[],i=0;for(let o=0,s=e.length;o{let i=c(e.token,t.token);return 0!==i?i:e.index-t.index});let i=0,n="000000",o="ffffff";for(;e.length>=1&&""===e[0].token;){let t=e.shift();-1!==t.fontStyle&&(i=t.fontStyle),null!==t.foreground&&(n=t.foreground),null!==t.background&&(o=t.background)}let s=new r;for(let e of t)s.getId(e);let l=s.getId(n),d=s.getId(o),g=new h(i,l,d),p=new u(g);for(let t=0,i=e.length;t>>0,this._cache.set(t,i)}return(i|e<<0)>>>0}}t.TokenTheme=a +;const l=/\b(comment|string|regex|regexp)\b/;function d(e){let t=e.match(l);if(!t)return 0;switch(t[1]){case"comment":return 1;case"string":return 2;case"regex":case"regexp":return 4}throw new Error("Unexpected match for standard token type!")}function c(e,t){return et?1:0}t.toStandardTokenType=d,t.strcmp=c;class h{constructor(e,t,i){this._fontStyle=e,this._foreground=t,this._background=i,this.metadata=(this._fontStyle<<11|this._foreground<<14|this._background<<23)>>>0}clone(){return new h(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,i){-1!==e&&(this._fontStyle=e),0!==t&&(this._foreground=t),0!==i&&(this._background=i),this.metadata=(this._fontStyle<<11|this._foreground<<14|this._background<<23)>>>0}}t.ThemeTrieElementRule=h;class u{constructor(e){this._mainRule=e,this._children=new Map}match(e){if(""===e)return this._mainRule;let t,i,n=e.indexOf(".");-1===n?(t=e,i=""):(t=e.substring(0,n),i=e.substring(n+1));let o=this._children.get(t) +;return void 0!==o?o.match(i):this._mainRule}insert(e,t,i,n){if(""===e)return void this._mainRule.acceptOverwrite(t,i,n);let o,s,r=e.indexOf(".");-1===r?(o=e,s=""):(o=e.substring(0,r),s=e.substring(r+1));let a=this._children.get(o);void 0===a&&(a=new u(this._mainRule.clone()),this._children.set(o,a)),a.insert(s,t,i,n)}}t.ThemeTrieElement=u,t.generateTokensCSSForColorMap=function(e){let t=[];for(let i=1,n=e.length;i{this._map.get(e)===t&&(this._map.delete(e),this.fire([e]))})}registerPromise(e,t){let i=null,o=!1;return this._promises.set(e,t.then(t=>{this._promises.delete(e),!o&&t&&(i=this.register(e,t))})),n.toDisposable(()=>{o=!0,i&&i.dispose()})}getPromise(e){const t=this.get(e);if(t)return Promise.resolve(t);const i=this._promises.get(e);return i?i.then(t=>this.get(e)):null}get(e){return this._map.get(e)||null}setColorMap(e){this._colorMap=e,this._onDidChange.fire({changedLanguages:Array.from(this._map.keys()),changedColorMap:!0})}getColorMap(){return this._colorMap}getDefaultBackground(){return this._colorMap&&this._colorMap.length>2?this._colorMap[2]:null}}})),define(t[161],i([0,1]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}), +t.WrappingIndent=t.TrackedRangeStickiness=t.TextEditorCursorStyle=t.TextEditorCursorBlinkingStyle=t.SymbolTag=t.SymbolKind=t.SignatureHelpTriggerKind=t.SelectionDirection=t.ScrollbarVisibility=t.ScrollType=t.RenderMinimap=t.RenderLineNumbersType=t.OverviewRulerLane=t.OverlayWidgetPositionPreference=t.MouseTargetType=t.MinimapPosition=t.MarkerTag=t.MarkerSeverity=t.KeyCode=t.IndentAction=t.EndOfLineSequence=t.EndOfLinePreference=t.EditorOption=t.EditorAutoIndentStrategy=t.DocumentHighlightKind=t.DefaultEndOfLine=t.CursorChangeReason=t.ContentWidgetPositionPreference=t.CompletionTriggerKind=t.CompletionItemTag=t.CompletionItemKind=t.CompletionItemInsertTextRule=t.AccessibilitySupport=void 0,function(e){e[e.Unknown=0]="Unknown",e[e.Disabled=1]="Disabled",e[e.Enabled=2]="Enabled"}(t.AccessibilitySupport||(t.AccessibilitySupport={})),function(e){e[e.KeepWhitespace=1]="KeepWhitespace",e[e.InsertAsSnippet=4]="InsertAsSnippet"}(t.CompletionItemInsertTextRule||(t.CompletionItemInsertTextRule={})),function(e){ +e[e.Method=0]="Method",e[e.Function=1]="Function",e[e.Constructor=2]="Constructor",e[e.Field=3]="Field",e[e.Variable=4]="Variable",e[e.Class=5]="Class",e[e.Struct=6]="Struct",e[e.Interface=7]="Interface",e[e.Module=8]="Module",e[e.Property=9]="Property",e[e.Event=10]="Event",e[e.Operator=11]="Operator",e[e.Unit=12]="Unit",e[e.Value=13]="Value",e[e.Constant=14]="Constant",e[e.Enum=15]="Enum",e[e.EnumMember=16]="EnumMember",e[e.Keyword=17]="Keyword",e[e.Text=18]="Text",e[e.Color=19]="Color",e[e.File=20]="File",e[e.Reference=21]="Reference",e[e.Customcolor=22]="Customcolor",e[e.Folder=23]="Folder",e[e.TypeParameter=24]="TypeParameter",e[e.User=25]="User",e[e.Issue=26]="Issue",e[e.Snippet=27]="Snippet"}(t.CompletionItemKind||(t.CompletionItemKind={})),function(e){e[e.Deprecated=1]="Deprecated"}(t.CompletionItemTag||(t.CompletionItemTag={})),function(e){e[e.Invoke=0]="Invoke",e[e.TriggerCharacter=1]="TriggerCharacter",e[e.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions" +}(t.CompletionTriggerKind||(t.CompletionTriggerKind={})),function(e){e[e.EXACT=0]="EXACT",e[e.ABOVE=1]="ABOVE",e[e.BELOW=2]="BELOW"}(t.ContentWidgetPositionPreference||(t.ContentWidgetPositionPreference={})),function(e){e[e.NotSet=0]="NotSet",e[e.ContentFlush=1]="ContentFlush",e[e.RecoverFromMarkers=2]="RecoverFromMarkers",e[e.Explicit=3]="Explicit",e[e.Paste=4]="Paste",e[e.Undo=5]="Undo",e[e.Redo=6]="Redo"}(t.CursorChangeReason||(t.CursorChangeReason={})),function(e){e[e.LF=1]="LF",e[e.CRLF=2]="CRLF"}(t.DefaultEndOfLine||(t.DefaultEndOfLine={})),function(e){e[e.Text=0]="Text",e[e.Read=1]="Read",e[e.Write=2]="Write"}(t.DocumentHighlightKind||(t.DocumentHighlightKind={})),function(e){e[e.None=0]="None",e[e.Keep=1]="Keep",e[e.Brackets=2]="Brackets",e[e.Advanced=3]="Advanced",e[e.Full=4]="Full"}(t.EditorAutoIndentStrategy||(t.EditorAutoIndentStrategy={})),function(e){e[e.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",e[e.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter", +e[e.accessibilitySupport=2]="accessibilitySupport",e[e.accessibilityPageSize=3]="accessibilityPageSize",e[e.ariaLabel=4]="ariaLabel",e[e.autoClosingBrackets=5]="autoClosingBrackets",e[e.autoClosingOvertype=6]="autoClosingOvertype",e[e.autoClosingQuotes=7]="autoClosingQuotes",e[e.autoIndent=8]="autoIndent",e[e.automaticLayout=9]="automaticLayout",e[e.autoSurround=10]="autoSurround",e[e.codeLens=11]="codeLens",e[e.colorDecorators=12]="colorDecorators",e[e.columnSelection=13]="columnSelection",e[e.comments=14]="comments",e[e.contextmenu=15]="contextmenu",e[e.copyWithSyntaxHighlighting=16]="copyWithSyntaxHighlighting",e[e.cursorBlinking=17]="cursorBlinking",e[e.cursorSmoothCaretAnimation=18]="cursorSmoothCaretAnimation",e[e.cursorStyle=19]="cursorStyle",e[e.cursorSurroundingLines=20]="cursorSurroundingLines",e[e.cursorSurroundingLinesStyle=21]="cursorSurroundingLinesStyle",e[e.cursorWidth=22]="cursorWidth",e[e.disableLayerHinting=23]="disableLayerHinting", +e[e.disableMonospaceOptimizations=24]="disableMonospaceOptimizations",e[e.dragAndDrop=25]="dragAndDrop",e[e.emptySelectionClipboard=26]="emptySelectionClipboard",e[e.extraEditorClassName=27]="extraEditorClassName",e[e.fastScrollSensitivity=28]="fastScrollSensitivity",e[e.find=29]="find",e[e.fixedOverflowWidgets=30]="fixedOverflowWidgets",e[e.folding=31]="folding",e[e.foldingStrategy=32]="foldingStrategy",e[e.foldingHighlight=33]="foldingHighlight",e[e.unfoldOnClickAfterEndOfLine=34]="unfoldOnClickAfterEndOfLine",e[e.fontFamily=35]="fontFamily",e[e.fontInfo=36]="fontInfo",e[e.fontLigatures=37]="fontLigatures",e[e.fontSize=38]="fontSize",e[e.fontWeight=39]="fontWeight",e[e.formatOnPaste=40]="formatOnPaste",e[e.formatOnType=41]="formatOnType",e[e.glyphMargin=42]="glyphMargin",e[e.gotoLocation=43]="gotoLocation",e[e.hideCursorInOverviewRuler=44]="hideCursorInOverviewRuler",e[e.highlightActiveIndentGuide=45]="highlightActiveIndentGuide",e[e.hover=46]="hover",e[e.inDiffEditor=47]="inDiffEditor", +e[e.letterSpacing=48]="letterSpacing",e[e.lightbulb=49]="lightbulb",e[e.lineDecorationsWidth=50]="lineDecorationsWidth",e[e.lineHeight=51]="lineHeight",e[e.lineNumbers=52]="lineNumbers",e[e.lineNumbersMinChars=53]="lineNumbersMinChars",e[e.links=54]="links",e[e.matchBrackets=55]="matchBrackets",e[e.minimap=56]="minimap",e[e.mouseStyle=57]="mouseStyle",e[e.mouseWheelScrollSensitivity=58]="mouseWheelScrollSensitivity",e[e.mouseWheelZoom=59]="mouseWheelZoom",e[e.multiCursorMergeOverlapping=60]="multiCursorMergeOverlapping",e[e.multiCursorModifier=61]="multiCursorModifier",e[e.multiCursorPaste=62]="multiCursorPaste",e[e.occurrencesHighlight=63]="occurrencesHighlight",e[e.overviewRulerBorder=64]="overviewRulerBorder",e[e.overviewRulerLanes=65]="overviewRulerLanes",e[e.padding=66]="padding",e[e.parameterHints=67]="parameterHints",e[e.peekWidgetDefaultFocus=68]="peekWidgetDefaultFocus",e[e.definitionLinkOpensInPeek=69]="definitionLinkOpensInPeek",e[e.quickSuggestions=70]="quickSuggestions", +e[e.quickSuggestionsDelay=71]="quickSuggestionsDelay",e[e.readOnly=72]="readOnly",e[e.renameOnType=73]="renameOnType",e[e.renderControlCharacters=74]="renderControlCharacters",e[e.renderIndentGuides=75]="renderIndentGuides",e[e.renderFinalNewline=76]="renderFinalNewline",e[e.renderLineHighlight=77]="renderLineHighlight",e[e.renderLineHighlightOnlyWhenFocus=78]="renderLineHighlightOnlyWhenFocus",e[e.renderValidationDecorations=79]="renderValidationDecorations",e[e.renderWhitespace=80]="renderWhitespace",e[e.revealHorizontalRightPadding=81]="revealHorizontalRightPadding",e[e.roundedSelection=82]="roundedSelection",e[e.rulers=83]="rulers",e[e.scrollbar=84]="scrollbar",e[e.scrollBeyondLastColumn=85]="scrollBeyondLastColumn",e[e.scrollBeyondLastLine=86]="scrollBeyondLastLine",e[e.scrollPredominantAxis=87]="scrollPredominantAxis",e[e.selectionClipboard=88]="selectionClipboard",e[e.selectionHighlight=89]="selectionHighlight",e[e.selectOnLineNumbers=90]="selectOnLineNumbers", +e[e.showFoldingControls=91]="showFoldingControls",e[e.showUnused=92]="showUnused",e[e.snippetSuggestions=93]="snippetSuggestions",e[e.smoothScrolling=94]="smoothScrolling",e[e.stopRenderingLineAfter=95]="stopRenderingLineAfter",e[e.suggest=96]="suggest",e[e.suggestFontSize=97]="suggestFontSize",e[e.suggestLineHeight=98]="suggestLineHeight",e[e.suggestOnTriggerCharacters=99]="suggestOnTriggerCharacters",e[e.suggestSelection=100]="suggestSelection",e[e.tabCompletion=101]="tabCompletion",e[e.tabIndex=102]="tabIndex",e[e.unusualLineTerminators=103]="unusualLineTerminators",e[e.useTabStops=104]="useTabStops",e[e.wordSeparators=105]="wordSeparators",e[e.wordWrap=106]="wordWrap",e[e.wordWrapBreakAfterCharacters=107]="wordWrapBreakAfterCharacters",e[e.wordWrapBreakBeforeCharacters=108]="wordWrapBreakBeforeCharacters",e[e.wordWrapColumn=109]="wordWrapColumn",e[e.wordWrapMinified=110]="wordWrapMinified",e[e.wrappingIndent=111]="wrappingIndent",e[e.wrappingStrategy=112]="wrappingStrategy", +e[e.showDeprecated=113]="showDeprecated",e[e.editorClassName=114]="editorClassName",e[e.pixelRatio=115]="pixelRatio",e[e.tabFocusMode=116]="tabFocusMode",e[e.layoutInfo=117]="layoutInfo",e[e.wrappingInfo=118]="wrappingInfo"}(t.EditorOption||(t.EditorOption={})),function(e){e[e.TextDefined=0]="TextDefined",e[e.LF=1]="LF",e[e.CRLF=2]="CRLF"}(t.EndOfLinePreference||(t.EndOfLinePreference={})),function(e){e[e.LF=0]="LF",e[e.CRLF=1]="CRLF"}(t.EndOfLineSequence||(t.EndOfLineSequence={})),function(e){e[e.None=0]="None",e[e.Indent=1]="Indent",e[e.IndentOutdent=2]="IndentOutdent",e[e.Outdent=3]="Outdent"}(t.IndentAction||(t.IndentAction={})),function(e){e[e.Unknown=0]="Unknown",e[e.Backspace=1]="Backspace",e[e.Tab=2]="Tab",e[e.Enter=3]="Enter",e[e.Shift=4]="Shift",e[e.Ctrl=5]="Ctrl",e[e.Alt=6]="Alt",e[e.PauseBreak=7]="PauseBreak",e[e.CapsLock=8]="CapsLock",e[e.Escape=9]="Escape",e[e.Space=10]="Space",e[e.PageUp=11]="PageUp",e[e.PageDown=12]="PageDown",e[e.End=13]="End",e[e.Home=14]="Home", +e[e.LeftArrow=15]="LeftArrow",e[e.UpArrow=16]="UpArrow",e[e.RightArrow=17]="RightArrow",e[e.DownArrow=18]="DownArrow",e[e.Insert=19]="Insert",e[e.Delete=20]="Delete",e[e.KEY_0=21]="KEY_0",e[e.KEY_1=22]="KEY_1",e[e.KEY_2=23]="KEY_2",e[e.KEY_3=24]="KEY_3",e[e.KEY_4=25]="KEY_4",e[e.KEY_5=26]="KEY_5",e[e.KEY_6=27]="KEY_6",e[e.KEY_7=28]="KEY_7",e[e.KEY_8=29]="KEY_8",e[e.KEY_9=30]="KEY_9",e[e.KEY_A=31]="KEY_A",e[e.KEY_B=32]="KEY_B",e[e.KEY_C=33]="KEY_C",e[e.KEY_D=34]="KEY_D",e[e.KEY_E=35]="KEY_E",e[e.KEY_F=36]="KEY_F",e[e.KEY_G=37]="KEY_G",e[e.KEY_H=38]="KEY_H",e[e.KEY_I=39]="KEY_I",e[e.KEY_J=40]="KEY_J",e[e.KEY_K=41]="KEY_K",e[e.KEY_L=42]="KEY_L",e[e.KEY_M=43]="KEY_M",e[e.KEY_N=44]="KEY_N",e[e.KEY_O=45]="KEY_O",e[e.KEY_P=46]="KEY_P",e[e.KEY_Q=47]="KEY_Q",e[e.KEY_R=48]="KEY_R",e[e.KEY_S=49]="KEY_S",e[e.KEY_T=50]="KEY_T",e[e.KEY_U=51]="KEY_U",e[e.KEY_V=52]="KEY_V",e[e.KEY_W=53]="KEY_W",e[e.KEY_X=54]="KEY_X",e[e.KEY_Y=55]="KEY_Y",e[e.KEY_Z=56]="KEY_Z",e[e.Meta=57]="Meta",e[e.ContextMenu=58]="ContextMenu", +e[e.F1=59]="F1",e[e.F2=60]="F2",e[e.F3=61]="F3",e[e.F4=62]="F4",e[e.F5=63]="F5",e[e.F6=64]="F6",e[e.F7=65]="F7",e[e.F8=66]="F8",e[e.F9=67]="F9",e[e.F10=68]="F10",e[e.F11=69]="F11",e[e.F12=70]="F12",e[e.F13=71]="F13",e[e.F14=72]="F14",e[e.F15=73]="F15",e[e.F16=74]="F16",e[e.F17=75]="F17",e[e.F18=76]="F18",e[e.F19=77]="F19",e[e.NumLock=78]="NumLock",e[e.ScrollLock=79]="ScrollLock",e[e.US_SEMICOLON=80]="US_SEMICOLON",e[e.US_EQUAL=81]="US_EQUAL",e[e.US_COMMA=82]="US_COMMA",e[e.US_MINUS=83]="US_MINUS",e[e.US_DOT=84]="US_DOT",e[e.US_SLASH=85]="US_SLASH",e[e.US_BACKTICK=86]="US_BACKTICK",e[e.US_OPEN_SQUARE_BRACKET=87]="US_OPEN_SQUARE_BRACKET",e[e.US_BACKSLASH=88]="US_BACKSLASH",e[e.US_CLOSE_SQUARE_BRACKET=89]="US_CLOSE_SQUARE_BRACKET",e[e.US_QUOTE=90]="US_QUOTE",e[e.OEM_8=91]="OEM_8",e[e.OEM_102=92]="OEM_102",e[e.NUMPAD_0=93]="NUMPAD_0",e[e.NUMPAD_1=94]="NUMPAD_1",e[e.NUMPAD_2=95]="NUMPAD_2",e[e.NUMPAD_3=96]="NUMPAD_3",e[e.NUMPAD_4=97]="NUMPAD_4",e[e.NUMPAD_5=98]="NUMPAD_5",e[e.NUMPAD_6=99]="NUMPAD_6", +e[e.NUMPAD_7=100]="NUMPAD_7",e[e.NUMPAD_8=101]="NUMPAD_8",e[e.NUMPAD_9=102]="NUMPAD_9",e[e.NUMPAD_MULTIPLY=103]="NUMPAD_MULTIPLY",e[e.NUMPAD_ADD=104]="NUMPAD_ADD",e[e.NUMPAD_SEPARATOR=105]="NUMPAD_SEPARATOR",e[e.NUMPAD_SUBTRACT=106]="NUMPAD_SUBTRACT",e[e.NUMPAD_DECIMAL=107]="NUMPAD_DECIMAL",e[e.NUMPAD_DIVIDE=108]="NUMPAD_DIVIDE",e[e.KEY_IN_COMPOSITION=109]="KEY_IN_COMPOSITION",e[e.ABNT_C1=110]="ABNT_C1",e[e.ABNT_C2=111]="ABNT_C2",e[e.MAX_VALUE=112]="MAX_VALUE"}(t.KeyCode||(t.KeyCode={})),function(e){e[e.Hint=1]="Hint",e[e.Info=2]="Info",e[e.Warning=4]="Warning",e[e.Error=8]="Error"}(t.MarkerSeverity||(t.MarkerSeverity={})),function(e){e[e.Unnecessary=1]="Unnecessary",e[e.Deprecated=2]="Deprecated"}(t.MarkerTag||(t.MarkerTag={})),function(e){e[e.Inline=1]="Inline",e[e.Gutter=2]="Gutter"}(t.MinimapPosition||(t.MinimapPosition={})),function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.TEXTAREA=1]="TEXTAREA",e[e.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",e[e.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS", +e[e.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",e[e.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",e[e.CONTENT_TEXT=6]="CONTENT_TEXT",e[e.CONTENT_EMPTY=7]="CONTENT_EMPTY",e[e.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",e[e.CONTENT_WIDGET=9]="CONTENT_WIDGET",e[e.OVERVIEW_RULER=10]="OVERVIEW_RULER",e[e.SCROLLBAR=11]="SCROLLBAR",e[e.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",e[e.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"}(t.MouseTargetType||(t.MouseTargetType={})),function(e){e[e.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",e[e.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",e[e.TOP_CENTER=2]="TOP_CENTER"}(t.OverlayWidgetPositionPreference||(t.OverlayWidgetPositionPreference={})),function(e){e[e.Left=1]="Left",e[e.Center=2]="Center",e[e.Right=4]="Right",e[e.Full=7]="Full"}(t.OverviewRulerLane||(t.OverviewRulerLane={})),function(e){e[e.Off=0]="Off",e[e.On=1]="On",e[e.Relative=2]="Relative",e[e.Interval=3]="Interval",e[e.Custom=4]="Custom"}(t.RenderLineNumbersType||(t.RenderLineNumbersType={})),function(e){e[e.None=0]="None", +e[e.Text=1]="Text",e[e.Blocks=2]="Blocks"}(t.RenderMinimap||(t.RenderMinimap={})),function(e){e[e.Smooth=0]="Smooth",e[e.Immediate=1]="Immediate"}(t.ScrollType||(t.ScrollType={})),function(e){e[e.Auto=1]="Auto",e[e.Hidden=2]="Hidden",e[e.Visible=3]="Visible"}(t.ScrollbarVisibility||(t.ScrollbarVisibility={})),function(e){e[e.LTR=0]="LTR",e[e.RTL=1]="RTL"}(t.SelectionDirection||(t.SelectionDirection={})),function(e){e[e.Invoke=1]="Invoke",e[e.TriggerCharacter=2]="TriggerCharacter",e[e.ContentChange=3]="ContentChange"}(t.SignatureHelpTriggerKind||(t.SignatureHelpTriggerKind={})),function(e){e[e.File=0]="File",e[e.Module=1]="Module",e[e.Namespace=2]="Namespace",e[e.Package=3]="Package",e[e.Class=4]="Class",e[e.Method=5]="Method",e[e.Property=6]="Property",e[e.Field=7]="Field",e[e.Constructor=8]="Constructor",e[e.Enum=9]="Enum",e[e.Interface=10]="Interface",e[e.Function=11]="Function",e[e.Variable=12]="Variable",e[e.Constant=13]="Constant",e[e.String=14]="String",e[e.Number=15]="Number",e[e.Boolean=16]="Boolean", +e[e.Array=17]="Array",e[e.Object=18]="Object",e[e.Key=19]="Key",e[e.Null=20]="Null",e[e.EnumMember=21]="EnumMember",e[e.Struct=22]="Struct",e[e.Event=23]="Event",e[e.Operator=24]="Operator",e[e.TypeParameter=25]="TypeParameter"}(t.SymbolKind||(t.SymbolKind={})),function(e){e[e.Deprecated=1]="Deprecated"}(t.SymbolTag||(t.SymbolTag={})),function(e){e[e.Hidden=0]="Hidden",e[e.Blink=1]="Blink",e[e.Smooth=2]="Smooth",e[e.Phase=3]="Phase",e[e.Expand=4]="Expand",e[e.Solid=5]="Solid"}(t.TextEditorCursorBlinkingStyle||(t.TextEditorCursorBlinkingStyle={})),function(e){e[e.Line=1]="Line",e[e.Block=2]="Block",e[e.Underline=3]="Underline",e[e.LineThin=4]="LineThin",e[e.BlockOutline=5]="BlockOutline",e[e.UnderlineThin=6]="UnderlineThin"}(t.TextEditorCursorStyle||(t.TextEditorCursorStyle={})),function(e){e[e.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",e[e.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",e[e.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore", +e[e.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"}(t.TrackedRangeStickiness||(t.TrackedRangeStickiness={})),function(e){e[e.None=0]="None",e[e.Same=1]="Same",e[e.Indent=2]="Indent",e[e.DeepIndent=3]="DeepIndent"}(t.WrappingIndent||(t.WrappingIndent={}))})),define(t[212],i([0,1,25,4,39,24,13,3,20,121,161]),(function(e,t,i,n,o,s,r,a,l,d,c){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMonacoBaseAPI=t.KeyMod=void 0;class h{static chord(e,t){return o.KeyChord(e,t)}}t.KeyMod=h,h.CtrlCmd=2048,h.Shift=1024,h.Alt=512,h.WinCtrl=256,t.createMonacoBaseAPI=function(){return{editor:void 0,languages:void 0,CancellationTokenSource:i.CancellationTokenSource,Emitter:n.Emitter,KeyCode:c.KeyCode,KeyMod:h,Position:r.Position,Range:a.Range,Selection:l.Selection,SelectionDirection:c.SelectionDirection,MarkerSeverity:c.MarkerSeverity,MarkerTag:c.MarkerTag,Uri:s.URI,Token:d.Token}}})),define(t[213],i([0,1]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}), +t.OverviewZoneManager=t.OverviewRulerZone=t.ColorZone=void 0;class i{constructor(e,t,i){this.from=0|e,this.to=0|t,this.colorId=0|i}static compare(e,t){return e.colorId===t.colorId?e.from===t.from?e.to-t.to:e.from-t.from:e.colorId-t.colorId}}t.ColorZone=i;class n{constructor(e,t,i){this.startLineNumber=e,this.endLineNumber=t,this.color=i,this._colorZone=null}static compare(e,t){return e.color===t.color?e.startLineNumber===t.startLineNumber?e.endLineNumber-t.endLineNumber:e.startLineNumber-t.startLineNumber:e.colorn&&(h=n-u);const g=l.color;let p=this._color2Id[g];p||(p=++this._lastAssignedId,this._color2Id[g]=p,this._id2Color[p]=g);const m=new i(h-u,h+u,p);l.setColorZone(m),r.push(m)}return this._colorZonesInvalid=!1,r.sort(i.compare),r}}})),define(t[103],i([0,1]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VisibleRanges=t.HorizontalPosition=t.HorizontalRange=t.LineVisibleRanges=t.RenderingContext=t.RestrictedRenderingContext=void 0;class i{constructor(e,t){this._viewLayout=e,this.viewportData=t,this.scrollWidth=this._viewLayout.getScrollWidth(),this.scrollHeight=this._viewLayout.getScrollHeight(),this.visibleRange=this.viewportData.visibleRange,this.bigNumbersDelta=this.viewportData.bigNumbersDelta;const i=this._viewLayout.getCurrentViewport();this.scrollTop=i.top, +this.scrollLeft=i.left,this.viewportWidth=i.width,this.viewportHeight=i.height}getScrolledTopFromAbsoluteTop(e){return e-this.scrollTop}getVerticalOffsetForLineNumber(e){return this._viewLayout.getVerticalOffsetForLineNumber(e)}getDecorationsInViewport(){return this.viewportData.getDecorationsInViewport()}}t.RestrictedRenderingContext=i;t.RenderingContext=class extends i{constructor(e,t,i){super(e,t),this._viewLines=i}linesVisibleRangesForRange(e,t){return this._viewLines.linesVisibleRangesForRange(e,t)}visibleRangeForPosition(e){return this._viewLines.visibleRangeForPosition(e)}};t.LineVisibleRanges=class{constructor(e,t,i){this.outsideRenderedLine=e,this.lineNumber=t,this.ranges=i}};t.HorizontalRange=class{constructor(e,t){this.left=Math.round(e),this.width=Math.round(t)}toString(){return`[${this.left},${this.width}]`}};t.HorizontalPosition=class{constructor(e,t){this.outsideRenderedLine=e,this.left=Math.round(t)}};t.VisibleRanges=class{constructor(e,t){this.outsideRenderedLine=e,this.ranges=t}}})), +define(t[375],i([0,1,103]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RangeUtil=void 0;class n{constructor(e,t){this.left=e,this.width=t}toString(){return`[${this.left},${this.width}]`}static compare(e,t){return e.left-t.left}}t.RangeUtil=class{static _createRange(){return this._handyReadyRange||(this._handyReadyRange=document.createRange()),this._handyReadyRange}static _detachRange(e,t){e.selectNodeContents(t)}static _readClientRects(e,t,i,n,o){const s=this._createRange();try{return s.setStart(e,t),s.setEnd(i,n),s.getClientRects()}catch(e){return null}finally{this._detachRange(s,o)}}static _mergeAdjacentRanges(e){if(1===e.length)return[new i.HorizontalRange(e[0].left,e[0].width)];e.sort(n.compare);let t=[],o=0,s=e[0].left,r=e[0].width;for(let n=1,a=e.length;n=l?r=Math.max(r,l+d-s):(t[o++]=new i.HorizontalRange(s,r),s=l,r=d)}return t[o++]=new i.HorizontalRange(s,r),t}static _createHorizontalRangesFromClientRects(e,t){ +if(!e||0===e.length)return null;const i=[];for(let o=0,s=e.length;oa)return null;if((t=Math.min(a,Math.max(0,t)))===(n=Math.min(a,Math.max(0,n)))&&i===o&&0===i){const i=e.children[t].getClientRects();return this._createHorizontalRangesFromClientRects(i,s)}t!==n&&n>0&&0===o&&(n--,o=1073741824);let l=e.children[t].firstChild,d=e.children[n].firstChild;if(l&&d||(!l&&0===i&&t>0&&(l=e.children[t-1].firstChild,i=1073741824),!d&&0===o&&n>0&&(d=e.children[n-1].firstChild,o=1073741824)),!l||!d)return null;i=Math.min(l.textContent.length,Math.max(0,i)),o=Math.min(d.textContent.length,Math.max(0,o));const c=this._readClientRects(l,i,d,o,r);return this._createHorizontalRangesFromClientRects(c,s)}}})),define(t[376],i([0,1]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ViewContext=t.EditorTheme=void 0;class i{ +constructor(e){this._theme=e}get type(){return this._theme.type}update(e){this._theme=e}getColor(e){return this._theme.getColor(e)}}t.EditorTheme=i;t.ViewContext=class{constructor(e,t,n){this.configuration=e,this.theme=new i(t),this.model=n,this.viewLayout=n.viewLayout}addEventHandler(e){this.model.addViewEventHandler(e)}removeEventHandler(e){this.model.removeViewEventHandler(e)}}})),define(t[162],i([0,1]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ViewZonesChangedEvent=t.ViewTokensColorsChangedEvent=t.ViewTokensChangedEvent=t.ViewThemeChangedEvent=t.ViewScrollChangedEvent=t.ViewRevealRangeRequestEvent=t.ViewLinesInsertedEvent=t.ViewLinesDeletedEvent=t.ViewLinesChangedEvent=t.ViewLineMappingChangedEvent=t.ViewLanguageConfigurationEvent=t.ViewFocusChangedEvent=t.ViewFlushedEvent=t.ViewDecorationsChangedEvent=t.ViewCursorStateChangedEvent=t.ViewConfigurationChangedEvent=void 0;t.ViewConfigurationChangedEvent=class{constructor(e){this.type=0,this._source=e}hasChanged(e){ +return this._source.hasChanged(e)}};t.ViewCursorStateChangedEvent=class{constructor(e,t){this.type=1,this.selections=e,this.modelSelections=t}};t.ViewDecorationsChangedEvent=class{constructor(e){this.type=2,e?(this.affectsMinimap=e.affectsMinimap,this.affectsOverviewRuler=e.affectsOverviewRuler):(this.affectsMinimap=!0,this.affectsOverviewRuler=!0)}};t.ViewFlushedEvent=class{constructor(){this.type=3}};t.ViewFocusChangedEvent=class{constructor(e){this.type=4,this.isFocused=e}};t.ViewLanguageConfigurationEvent=class{constructor(){this.type=5}};t.ViewLineMappingChangedEvent=class{constructor(){this.type=6}};t.ViewLinesChangedEvent=class{constructor(e,t){this.type=7,this.fromLineNumber=e,this.toLineNumber=t}};t.ViewLinesDeletedEvent=class{constructor(e,t){this.type=8,this.fromLineNumber=e,this.toLineNumber=t}};t.ViewLinesInsertedEvent=class{constructor(e,t){this.type=9,this.fromLineNumber=e,this.toLineNumber=t}};t.ViewRevealRangeRequestEvent=class{constructor(e,t,i,n,o,s){this.type=10,this.source=e,this.range=t, +this.selections=i,this.verticalType=n,this.revealHorizontal=o,this.scrollType=s}};t.ViewScrollChangedEvent=class{constructor(e){this.type=11,this.scrollWidth=e.scrollWidth,this.scrollLeft=e.scrollLeft,this.scrollHeight=e.scrollHeight,this.scrollTop=e.scrollTop,this.scrollWidthChanged=e.scrollWidthChanged,this.scrollLeftChanged=e.scrollLeftChanged,this.scrollHeightChanged=e.scrollHeightChanged,this.scrollTopChanged=e.scrollTopChanged}};t.ViewThemeChangedEvent=class{constructor(){this.type=12}};t.ViewTokensChangedEvent=class{constructor(e){this.type=13,this.ranges=e}};t.ViewTokensColorsChangedEvent=class{constructor(){this.type=14}};t.ViewZonesChangedEvent=class{constructor(){this.type=15}}})),define(t[163],i([0,1,8]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LineDecorationsNormalizer=t.DecorationSegment=t.LineDecoration=void 0;class n{constructor(e,t,i,n){this.startColumn=e,this.endColumn=t,this.className=i,this.type=n}static _equals(e,t){ +return e.startColumn===t.startColumn&&e.endColumn===t.endColumn&&e.className===t.className&&e.type===t.type}static equalsArr(e,t){const i=e.length;if(i!==t.length)return!1;for(let o=0;ot)continue;if(d.isEmpty()&&(0===l.type||3===l.type))continue;const c=d.startLineNumber===t?d.startColumn:i,h=d.endLineNumber===t?d.endColumn:o;s[r++]=new n(c,h,l.inlineClassName,l.type)}return s}static _typeCompare(e,t){const i=[2,0,1,3];return i[e]-i[t]}static compare(e,t){if(e.startColumn===t.startColumn){if(e.endColumn===t.endColumn){const i=n._typeCompare(e.type,t.type);return 0===i?e.classNamet.className?1:0:i}return e.endColumn-t.endColumn}return e.startColumn-t.startColumn}}t.LineDecoration=n;class o{constructor(e,t,i,n){this.startOffset=e,this.endOffset=t,this.className=i,this.metadata=n}} +t.DecorationSegment=o;class s{constructor(){this.stopOffsets=[],this.classNames=[],this.metadata=[],this.count=0}static _metadata(e){let t=0;for(let i=0,n=e.length;i0&&this.stopOffsets[0]0&&t=e){this.stopOffsets.splice(n,0,e),this.classNames.splice(n,0,t),this.metadata.splice(n,0,i);break}this.count++}}t.LineDecorationsNormalizer=class{ +static normalize(e,t){if(0===t.length)return[];let n=[];const o=new s;let r=0;for(let s=0,a=t.length;s1){const t=e.charCodeAt(l-2);i.isHighSurrogate(t)&&l--}if(d>1){const t=e.charCodeAt(d-2);i.isHighSurrogate(t)&&d--}const u=l-1,g=d-2;r=o.consumeLowerThan(u,r,n),0===o.count&&(r=u),o.insert(g,c,h)}return o.consumeLowerThan(1073741824,r,n),n}}})),define(t[377],i([0,1,8]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LinesLayout=t.EditorWhitespace=void 0;class n{constructor(){this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[]}insert(e){this._hasPending=!0,this._inserts.push(e)}change(e){this._hasPending=!0,this._changes.push(e)}remove(e){this._hasPending=!0,this._removes.push(e)}mustCommit(){return this._hasPending}commit(e){if(!this._hasPending)return;const t=this._inserts,i=this._changes,n=this._removes;this._hasPending=!1,this._inserts=[], +this._changes=[],this._removes=[],e._commitPendingChanges(t,i,n)}}class o{constructor(e,t,i,n,o){this.id=e,this.afterLineNumber=t,this.ordinal=i,this.height=n,this.minWidth=o,this.prefixSum=0}}t.EditorWhitespace=o;class s{constructor(e,t,o,r){this._instanceId=i.singleLetterHash(++s.INSTANCE_COUNT),this._pendingChanges=new n,this._lastWhitespaceId=0,this._arr=[],this._prefixSumValidIndex=-1,this._minWidth=-1,this._lineCount=e,this._lineHeight=t,this._paddingTop=o,this._paddingBottom=r}static findInsertionIndex(e,t,i){let n=0,o=e.length;for(;n>>1;t===e[s].afterLineNumber?i{t=!0,e|=0,i|=0,n|=0,s|=0;const r=this._instanceId+ ++this._lastWhitespaceId +;return this._pendingChanges.insert(new o(r,e,i,n,s)),r},changeOneWhitespace:(e,i,n)=>{t=!0,i|=0,n|=0,this._pendingChanges.change({id:e,newAfterLineNumber:i,newHeight:n})},removeWhitespace:e=>{t=!0,this._pendingChanges.remove({id:e})}})}finally{this._pendingChanges.commit(this)}return t}_commitPendingChanges(e,t,i){if((e.length>0||i.length>0)&&(this._minWidth=-1),e.length+t.length+i.length<=1){for(const t of e)this._insertWhitespace(t);for(const e of t)this._changeOneWhitespace(e.id,e.newAfterLineNumber,e.newHeight);for(const e of i){const t=this._findWhitespaceIndex(e.id);-1!==t&&this._removeWhitespace(t)}return}const n=new Set;for(const e of i)n.add(e.id);const o=new Map;for(const e of t)o.set(e.id,e);const s=e=>{let t=[];for(const i of e)if(!n.has(i.id)){if(o.has(i.id)){const e=o.get(i.id);i.afterLineNumber=e.newAfterLineNumber,i.height=e.newHeight}t.push(i)}return t},r=s(this._arr).concat(s(e));r.sort((e,t)=>e.afterLineNumber===t.afterLineNumber?e.ordinal-t.ordinal:e.afterLineNumber-t.afterLineNumber), +this._arr=r,this._prefixSumValidIndex=-1}_checkPendingChanges(){this._pendingChanges.mustCommit()&&this._pendingChanges.commit(this)}_insertWhitespace(e){const t=s.findInsertionIndex(this._arr,e.afterLineNumber,e.ordinal);this._arr.splice(t,0,e),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,t-1)}_findWhitespaceIndex(e){const t=this._arr;for(let i=0,n=t.length;it&&(this._arr[i].afterLineNumber-=t-e+1)}}onLinesInserted(e,t){this._checkPendingChanges(),e|=0,t|=0,this._lineCount+=t-e+1;for(let i=0,n=this._arr.length;i=t.length||t[o+1].afterLineNumber>=e)return o;i=o+1|0}else n=o-1|0}return-1}_findFirstWhitespaceAfterLineNumber(e){e|=0;const t=this._findLastWhitespaceBeforeLineNumber(e)+1;return t1?this._lineHeight*(e-1):0)+this.getWhitespaceAccumulatedHeightBeforeLineNumber(e)+this._paddingTop}getWhitespaceMinWidth(){if(this._checkPendingChanges(),-1===this._minWidth){let e=0;for(let t=0,i=this._arr.length;tthis.getLinesTotalHeight()}getLineNumberAtOrAfterVerticalOffset(e){if(this._checkPendingChanges(),(e|=0)<0)return 1;const t=0|this._lineCount,i=this._lineHeight;let n=1,o=t;for(;n=s+i)n=t+1;else{if(e>=s)return t;o=t}}return n>t?t:n}getLinesViewportData(e,t){this._checkPendingChanges(),e|=0,t|=0;const i=this._lineHeight,n=0|this.getLineNumberAtOrAfterVerticalOffset(e),o=0|this.getVerticalOffsetForLineNumber(n);let s=0|this._lineCount,r=0|this.getFirstWhitespaceIndexAfterLineNumber(n);const a=0|this.getWhitespacesCount();let l,d;-1===r?(r=a,d=s+1,l=0):(d=0|this.getAfterLineNumberForWhitespaceIndex(r),l=0|this.getHeightForWhitespaceIndex(r));let c=o,h=c;let u=0;o>=5e5&&(u=5e5*Math.floor(o/5e5),h-=u=Math.floor(u/i)*i);const g=[],p=e+(t-e)/2;let m=-1;for(let e=n;e<=s;e++){if(-1===m){const t=c,n=c+i;(t<=p&&pp)&&(m=e)}for(c+=i,g[e-n]=h,h+=i;d===e;)h+=l,c+=l, +++r>=a?d=s+1:(d=0|this.getAfterLineNumberForWhitespaceIndex(r),l=0|this.getHeightForWhitespaceIndex(r));if(c>=t){s=e;break}}-1===m&&(m=s);const f=0|this.getVerticalOffsetForLineNumber(s);let _=n,v=s;return _t&&v--,{bigNumbersDelta:u,startLineNumber:n,endLineNumber:s,relativeVerticalOffset:g,centeredLineNumber:m,completelyVisibleStartLineNumber:_,completelyVisibleEndLineNumber:v}}getVerticalOffsetForWhitespaceIndex(e){this._checkPendingChanges(),e|=0;const t=this.getAfterLineNumberForWhitespaceIndex(e);let i,n;return(i=t>=1?this._lineHeight*t:0)+(n=e>0?this.getWhitespacesAccumulatedHeight(e-1):0)+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){this._checkPendingChanges(),e|=0;let t=0,i=this.getWhitespacesCount()-1;if(i<0)return-1;if(e>=this.getVerticalOffsetForWhitespaceIndex(i)+this.getHeightForWhitespaceIndex(i))return-1;for(;t=o+this.getHeightForWhitespaceIndex(n))t=n+1;else{ +if(e>=o)return n;i=n}}return t}getWhitespaceAtVerticalOffset(e){this._checkPendingChanges(),e|=0;const t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0)return null;if(t>=this.getWhitespacesCount())return null;const i=this.getVerticalOffsetForWhitespaceIndex(t);if(i>e)return null;const n=this.getHeightForWhitespaceIndex(t);return{id:this.getIdForWhitespaceIndex(t),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(t),verticalOffset:i,height:n}}getWhitespaceViewportData(e,t){this._checkPendingChanges(),e|=0,t|=0;const i=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),n=this.getWhitespacesCount()-1;if(i<0)return[];let o=[];for(let e=i;e<=n;e++){const i=this.getVerticalOffsetForWhitespaceIndex(e),n=this.getHeightForWhitespaceIndex(e);if(i>=t)break;o.push({id:this.getIdForWhitespaceIndex(e),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(e),verticalOffset:i,height:n})}return o}getWhitespaces(){return this._checkPendingChanges(),this._arr.slice(0)}getWhitespacesCount(){ +return this._checkPendingChanges(),this._arr.length}getIdForWhitespaceIndex(e){return this._checkPendingChanges(),e|=0,this._arr[e].id}getAfterLineNumberForWhitespaceIndex(e){return this._checkPendingChanges(),e|=0,this._arr[e].afterLineNumber}getHeightForWhitespaceIndex(e){return this._checkPendingChanges(),e|=0,this._arr[e].height}}t.LinesLayout=s,s.INSTANCE_COUNT=0})),define(t[123],i([0,1,8,89,163]),(function(e,t,i,n,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.renderViewLine2=t.RenderLineOutput2=t.renderViewLine=t.RenderLineOutput=t.CharacterMapping=t.RenderLineInput=t.LineRange=void 0;class s{constructor(e,t,i){this.endIndex=e,this.type=t,this.metadata=i}isWhitespace(){return!!(1&this.metadata)}}t.LineRange=class{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}};t.RenderLineInput=class{constructor(e,t,i,n,o,s,r,a,l,d,c,h,u,g,p,m,f,_,v){this.useMonospaceOptimizations=e, +this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.continuesWithWrappedLine=n,this.isBasicASCII=o,this.containsRTL=s,this.fauxIndentLength=r,this.lineTokens=a,this.lineDecorations=l,this.tabSize=d,this.startVisibleColumn=c,this.spaceWidth=h,this.stopRenderingLineAfter=p,this.renderWhitespace="all"===m?4:"boundary"===m?1:"selection"===m?2:"trailing"===m?3:0,this.renderControlCharacters=f,this.fontLigatures=_,this.selectionsOnLine=v&&v.sort((e,t)=>e.startOffset>>16}static getCharIndex(e){return(65535&e)>>>0}setPartData(e,t,i,n){let o=(t<<16|i<<0)>>>0;this._data[e]=o,this._absoluteOffsets[e]=n+i}getAbsoluteOffsets(){return this._absoluteOffsets}charOffsetToPartData(e){return 0===this.length?0:e<0?this._data[0]:e>=this.length?this._data[this.length-1]:this._data[e]}partDataToCharOffset(e,t,i){if(0===this.length)return 0;let n=(e<<16|i<<0)>>>0,o=0,s=this.length-1;for(;o+1>>1,t=this._data[e];if(t===n)return e;t>n?s=e:o=e}if(o===s)return o;let a=this._data[o],l=this._data[s];if(a===n)return o;if(l===n)return s;let d,c=r.getPartIndex(a);return i-r.getCharIndex(a)<=(d=c!==r.getPartIndex(l)?t:r.getCharIndex(l))-i?o:s}}t.CharacterMapping=r;class a{constructor(e,t,i){this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=i}}function l(e,t){if(0===e.lineContent.length){let i=0,n="";if(e.lineDecorations.length>0){const t=[],o=[];for(let n=0,s=e.lineDecorations.length;n${t.length>0?``:""}${o.length>0?``:""}`}}return t.appendASCIIString(n),new a(new r(0,0),!1,i)}return function(e,t){const n=e.fontIsMonospace,o=e.canUseHalfwidthRightwardsArrow,s=e.containsForeignElements,l=e.lineContent,d=e.len,c=e.isOverflowing,h=e.parts,u=e.fauxIndentLength,g=e.tabSize,p=e.startVisibleColumn,m=e.containsRTL,f=e.spaceWidth,_=e.renderSpaceCharCode,v=e.renderWhitespace,C=e.renderControlCharacters,b=new r(d+1,h.length);let S=0,w=p,y=0,E=0,L=0,x=0;m?t.appendASCIIString(''):t.appendASCIIString("");for(let e=0,r=h.length;e=u&&(t+=n)}}for(p&&(t.appendASCIIString(' style="width:'),t.appendASCIIString(String(f*i)),t.appendASCIIString('px"')),t.appendASCII(62);S1?t.write1(8594):t.write1(65515);for(let e=2;e<=i;e++)t.write1(160)}else i=1,t.write1(_);y+=i,S>=u&&(w+=i)}L=i}else{let n=0;for(t.appendASCII(62);S=u&&(w+=r)}L=n}m?E++:E=0,t.appendASCIIString("")} +b.setPartData(d,h.length-1,y,x),c&&t.appendASCIIString("");return t.appendASCIIString(""),new a(b,m,s)}(function(e){const t=e.lineContent;let n,r;-1!==e.stopRenderingLineAfter&&e.stopRenderingLineAfter0&&(n[o++]=new s(t,"",0));for(let r=0,a=e.getCount();r=i){n[o++]=new s(i,l,0);break}n[o++]=new s(a,l,0)}return n}(e.lineTokens,e.fauxIndentLength,r);(4===e.renderWhitespace||1===e.renderWhitespace||2===e.renderWhitespace&&e.selectionsOnLine||3===e.renderWhitespace)&&(a=function(e,t,n,o){const r=e.continuesWithWrappedLine,a=e.fauxIndentLength,l=e.tabSize,d=e.startVisibleColumn,c=e.useMonospaceOptimizations,h=e.selectionsOnLine,u=1===e.renderWhitespace,g=3===e.renderWhitespace,p=e.renderSpaceWidth!==e.spaceWidth;let m=[],f=0,_=0,v=o[_].type,C=o[_].endIndex;const b=o.length +;let S,w=!1,y=i.firstNonWhitespaceIndex(t);-1===y?(w=!0,y=n,S=n):S=i.lastNonWhitespaceIndex(t);let E=!1,L=0,x=h&&h[L],D=d%l;for(let e=a;e=x.endOffset&&(L++,x=h&&h[L]),eS)d=!0;else if(9===r)d=!0;else if(32===r)if(u)if(E)d=!0;else{const i=e+1e),d&&g&&(d=w||e>S),E){if(!d||!c&&D>=l){if(p){for(let t=(f>0?m[f-1].endIndex:a)+1;t<=e;t++)m[f++]=new s(t,"mtkw",1)}else m[f++]=new s(e,"mtkw",1);D%=l}}else(e===C||d&&e>a)&&(m[f++]=new s(e,v,0),D%=l);for(9===r?D=l:i.isFullWidthCharacter(r)?D+=2:D++,E=d;e===C;)++_0?t.charCodeAt(n-1):0,i=n>1?t.charCodeAt(n-2):0;32===e&&32!==i&&9!==i||(k=!0)}else k=!0;if(k)if(p){for(let e=(f>0?m[f-1].endIndex:a)+1;e<=n;e++)m[f++]=new s(e,"mtkw",1)}else m[f++]=new s(n,"mtkw",1);else m[f++]=new s(n,v,0);return m}(e,t,r,a));let l=0;if(e.lineDecorations.length>0){ +for(let t=0,i=e.lineDecorations.length;th&&(h=e.startOffset,d[c++]=new s(h,o,u)),!(e.endOffset+1<=n)){h=n,d[c++]=new s(h,o+" "+e.className,u|e.metadata);break}h=e.endOffset+1,d[c++]=new s(h,o+" "+e.className,u|e.metadata),l++}n>h&&(h=n,d[c++]=new s(h,o,u))}const u=i[i.length-1].endIndex;if(l=50&&(o[r++]=new s(d+1,t,i),c=d+1,d=-1);c!==l&&(o[r++]=new s(l,t,i))}else o[r++]=a;n=l}else for(let e=0,i=t.length;e50){const e=i.type,t=i.metadata,d=Math.ceil(l/50);for(let i=1;i=0&&this.prefixSum.set(o.subarray(0,this.prefixSumValidIndex[0]+1)),!0)} +changeValue(e,t){return e=i.toUint32(e),t=i.toUint32(t),this.values[e]!==t&&(this.values[e]=t,e-1=n.length)return!1;let s=n.length-e;return t>=s&&(t=s),0!==t&&(this.values=new Uint32Array(n.length-t),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1=0&&this.prefixSum.set(o.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalValue(){return 0===this.values.length?0:this._getAccumulatedValue(this.values.length-1)}getAccumulatedValue(e){return e<0?0:(e=i.toUint32(e),this._getAccumulatedValue(e))}_getAccumulatedValue(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let t=this.prefixSumValidIndex[0]+1;0===t&&(this.prefixSum[0]=this.values[0],t++), +e>=this.values.length&&(e=this.values.length-1);for(let i=t;i<=e;i++)this.prefixSum[i]=this.prefixSum[i-1]+this.values[i];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalValue();let t=0,i=this.values.length-1,o=0,s=0,r=0;for(;t<=i;)if(o=t+(i-t)/2|0,e<(r=(s=this.prefixSum[o])-this.values[o]))i=o-1;else{if(!(e>=s))break;t=o+1}return new n(o,e-r)}}})),define(t[379],i([0,1,13,214]),(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MirrorTextModel=void 0;t.MirrorTextModel=class{constructor(e,t,i,n){this._uri=e,this._lines=t,this._eol=i,this._versionId=n,this._lineStarts=null,this._cachedTextValue=null}dispose(){this._lines.length=0}getText(){return null===this._cachedTextValue&&(this._cachedTextValue=this._lines.join(this._eol)),this._cachedTextValue}onEvents(e){e.eol&&e.eol!==this._eol&&(this._eol=e.eol,this._lineStarts=null);const t=e.changes;for(const e of t)this._acceptDeleteRange(e.range), +this._acceptInsertText(new i.Position(e.range.startLineNumber,e.range.startColumn),e.text);this._versionId=e.versionId,this._cachedTextValue=null}_ensureLineStarts(){if(!this._lineStarts){const e=this._eol.length,t=this._lines.length,i=new Uint32Array(t);for(let n=0;nthis._lines.length)t=this._lines.length,i=this._lines[t-1].length+1,n=!0;else{let e=this._lines[t-1].length+1;i<1?(i=1,n=!0):i>e&&(i=e,n=!0)}return n?{lineNumber:t,column:i}:e}}class _{constructor(e,t){this._host=e,this._models=Object.create(null),this._foreignModuleFactory=t,this._foreignModule=null}dispose(){this._models=Object.create(null)}_getModel(e){return this._models[e]}_getModels(){let e=[];return Object.keys(this._models).forEach(t=>e.push(this._models[t])),e}acceptNewModel(e){this._models[e.url]=new f(s.URI.parse(e.url),e.lines,e.EOL,e.versionId)}acceptModelChanged(e,t){if(!this._models[e])return;this._models[e].onEvents(t)}acceptRemovedModel(e){this._models[e]&&delete this._models[e]}computeDiff(e,t,i,n){return r(this,void 0,void 0,(function*(){ +const o=this._getModel(e),s=this._getModel(t);if(!o||!s)return null;const r=o.getLinesContent(),a=s.getLinesContent(),l=new d.DiffComputer(r,a,{shouldComputeCharChanges:!0,shouldPostProcessCharChanges:!0,shouldIgnoreTrimWhitespace:i,shouldMakePrettyDiff:!0,maxComputationTime:n}).computeDiff(),c=!(l.changes.length>0)&&this._modelsAreIdentical(o,s);return{quitEarly:l.quitEarly,identical:c,changes:l.changes}}))}_modelsAreIdentical(e,t){const i=e.getLineCount();if(i!==t.getLineCount())return!1;for(let n=1;n<=i;n++){if(e.getLineContent(n)!==t.getLineContent(n))return!1}return!0}computeMoreMinimalEdits(e,t){return r(this,void 0,void 0,(function*(){const o=this._getModel(e);if(!o)return t;const s=[];let r=void 0;t=i.mergeSort(t,(e,t)=>{if(e.range&&t.range)return l.Range.compareRangesUsingStarts(e.range,t.range);return(e.range?0:1)-(t.range?0:1)});for(let{range:e,text:i,eol:a}of t){if("number"==typeof a&&(r=a),l.Range.isEmpty(e)&&!i)continue;const t=o.getValueInRange(e) +;if(t===(i=i.replace(/\r\n|\n|\r/g,o.eol)))continue;if(Math.max(i.length,t.length)>_._diffLimit){s.push({range:e,text:i});continue}const d=n.stringDiff(t,i,!1),c=o.offsetAt(l.Range.lift(e).getStartPosition());for(const e of d){const t=o.positionAt(c+e.originalStart),n=o.positionAt(c+e.originalStart+e.originalLength),r={text:i.substr(e.modifiedStart,e.modifiedLength),range:{startLineNumber:t.lineNumber,startColumn:t.column,endLineNumber:n.lineNumber,endColumn:n.column}};o.getValueInRange(r.range)!==r.text&&s.push(r)}}return"number"==typeof r&&s.push({eol:r,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),s}))}computeLinks(e){return r(this,void 0,void 0,(function*(){let t=this._getModel(e);return t?u.computeLinks(t):null}))}textualSuggest(e,t,i,n){return r(this,void 0,void 0,(function*(){const o=this._getModel(e);if(!o)return null;const s=[],r=new Set,a=new RegExp(i,n),l=o.getWordAtPosition(t,a);l&&r.add(o.getValueInRange(l));for(let e of o.words(a))if(!r.has(e)&&(r.add(e), +isNaN(Number(e))&&(s.push(e),r.size>_._suggestionsLimit)))break;return s}))}computeWordRanges(e,t,i,n){return r(this,void 0,void 0,(function*(){let o=this._getModel(e);if(!o)return Object.create(null);const s=new RegExp(i,n),r=Object.create(null);for(let e=t.startLineNumber;ethis._host.fhr(e,t)),getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(o,i),Promise.resolve(m.getAllMethodNames(this._foreignModule))):new Promise((n,s)=>{e([t],e=>{this._foreignModule=e.create(o,i),n(m.getAllMethodNames(this._foreignModule))},s)})}fmr(e,t){if(!this._foreignModule||"function"!=typeof this._foreignModule[e])return Promise.reject(new Error("Missing requestHandler or method: "+e));try{return Promise.resolve(this._foreignModule[e].apply(this._foreignModule,t))}catch(e){return Promise.reject(e)}}}t.EditorSimpleWorker=_,_._diffLimit=1e5,_._suggestionsLimit=1e4,t.create=function(e){return new _(e,null)},"function"==typeof importScripts&&(o.globals.monaco=p.createMonacoBaseAPI())})),define(t[104],i([0,1,2]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ViewEventHandler=void 0;class n extends i.Disposable{constructor(){super(), +this._shouldRender=!0}shouldRender(){return this._shouldRender}forceShouldRender(){this._shouldRender=!0}setShouldRender(){this._shouldRender=!0}onDidRender(){this._shouldRender=!1}onConfigurationChanged(e){return!1}onCursorStateChanged(e){return!1}onDecorationsChanged(e){return!1}onFlushed(e){return!1}onFocusChanged(e){return!1}onLanguageConfigurationChanged(e){return!1}onLineMappingChanged(e){return!1}onLinesChanged(e){return!1}onLinesDeleted(e){return!1}onLinesInserted(e){return!1}onRevealRangeRequest(e){return!1}onScrollChanged(e){return!1}onThemeChanged(e){return!1}onTokensChanged(e){return!1}onTokensColorsChanged(e){return!1}onZonesChanged(e){return!1}handleEvents(e){let t=!1;for(let i=0,n=e.length;i=n,c=a,h=o.viewportHeight-a>=n;let u=e.left,g=t.left;return u+i>o.scrollLeft+o.viewportWidth&&(u=o.scrollLeft+o.viewportWidth-i),g+i>o.scrollLeft+o.viewportWidth&&(g=o.scrollLeft+o.viewportWidth-i),ur){const e=a-(r-o);a-=e,n-=e}if(a=22,_=c+o<=h.height-22;return this._fixedOverflowWidgets?{fitsAbove:f,aboveTop:Math.max(d,22),aboveLeft:g,fitsBelow:_,belowTop:c,belowLeft:m}:{fitsAbove:f,aboveTop:r,aboveLeft:u,fitsBelow:_,belowTop:a,belowLeft:p}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new s(e.top,e.left+this._contentLeft)}_getTopAndBottomLeft(e){if(!this._viewRange)return[null,null] +;const t=e.linesVisibleRangesForRange(this._viewRange,!1);if(!t||0===t.length)return[null,null];let i=t[0],n=t[0];for(const e of t)e.lineNumbern.lineNumber&&(n=e);let o=1073741824;for(const e of i.ranges)e.lefte.endLineNumber||this.domNode.setMaxWidth(this._maxWidth))}prepareRender(e){this._renderData=this._prepareRenderWidget(e)}render(e){this._renderData?(this.allowEditorOverflow?(this.domNode.setTop(this._renderData.top),this.domNode.setLeft(this._renderData.left)):(this.domNode.setTop(this._renderData.top+e.scrollTop-e.bigNumbersDelta),this.domNode.setLeft(this._renderData.left)),this._isVisible||(this.domNode.setVisibility("inherit"),this.domNode.setAttribute("monaco-visible-content-widget","true"), +this._isVisible=!0)):this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,this.domNode.setVisibility("hidden"))}}})),define(t[382],i([0,1,90,3,103,308]),(function(e,t,i,n,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DecorationsOverlay=void 0;class s extends i.DynamicViewOverlay{constructor(e){super(),this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(51),this._typicalHalfwidthCharacterWidth=t.get(36).typicalHalfwidthCharacterWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._lineHeight=t.get(51),this._typicalHalfwidthCharacterWidth=t.get(36).typicalHalfwidthCharacterWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0} +onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}prepareRender(e){const t=e.getDecorationsInViewport();let i=[],o=0;for(let e=0,n=t.length;e{if(e.options.zIndext.options.zIndex)return 1;const i=e.options.className,o=t.options.className;return io?1:n.Range.compareRangesUsingStarts(e.range,t.range)});const s=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,a=[];for(let e=s;e<=r;e++){a[e-s]=""}this._renderWholeLineDecorations(e,i,a),this._renderNormalDecorations(e,i,a),this._renderResult=a}_renderWholeLineDecorations(e,t,i){const n=String(this._lineHeight),o=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber;for(let e=0,r=t.length;e',l=Math.max(r.range.startLineNumber,o),d=Math.min(r.range.endLineNumber,s);for(let e=l;e<=d;e++){i[e-o]+=a}}}_renderNormalDecorations(e,t,i){const o=String(this._lineHeight),s=e.visibleRange.startLineNumber;let r=null,a=!1,l=null;for(let d=0,c=t.length;d';a[d]+=o}}}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}t.DecorationsOverlay=s})),define(t[164],i([0,1,90,309]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlyphMarginOverlay=t.DedupOverlay=t.DecorationToRender=void 0;class n{constructor(e,t,i){this.startLineNumber=+e,this.endLineNumber=+t,this.className=String(i)}}t.DecorationToRender=n;class o extends i.DynamicViewOverlay{_render(e,t,i){const n=[];for(let i=e;i<=t;i++){n[i-e]=[]}if(0===i.length)return n +;i.sort((e,t)=>e.className===t.className?e.startLineNumber===t.startLineNumber?e.endLineNumber-t.endLineNumber:e.startLineNumber-t.startLineNumber:e.className',r=[];for(let e=t;e<=i;e++){const i=e-t,o=n[i];0===o.length?r[i]="":r[i]='
    =this._renderResult.length?"":this._renderResult[i]}}})),define(t[383],i([0,1,164,313]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LinesDecorationsOverlay=void 0;class n extends i.DedupOverlay{constructor(e){super(),this._context=e;const t=this._context.configuration.options.get(117);this._decorationsLeft=t.decorationsLeft,this._decorationsWidth=t.decorationsWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options.get(117);return this._decorationsLeft=t.decorationsLeft,this._decorationsWidth=t.decorationsWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){ +const t=e.getDecorationsInViewport();let n=[],o=0;for(let e=0,s=t.length;e
    ',s=[];for(let e=t;e<=i;e++){const i=e-t,r=n[i];let a="";for(let e=0,t=r.length;e';o[i]=r}this._renderResult=o}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}t.MarginViewLineDecorationsOverlay=n})),define(t[385],i([0,1,30,43,316]),(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ViewOverlayWidgets=void 0;class o extends n.ViewPart{constructor(e){super(e) +;const t=this._context.configuration.options.get(117);this._widgets={},this._verticalScrollbarWidth=t.verticalScrollbarWidth,this._minimapWidth=t.minimap.minimapWidth,this._horizontalScrollbarHeight=t.horizontalScrollbarHeight,this._editorHeight=t.height,this._editorWidth=t.width,this._domNode=i.createFastDomNode(document.createElement("div")),n.PartFingerprints.write(this._domNode,4),this._domNode.setClassName("overlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options.get(117);return this._verticalScrollbarWidth=t.verticalScrollbarWidth,this._minimapWidth=t.minimap.minimapWidth,this._horizontalScrollbarHeight=t.horizontalScrollbarHeight,this._editorHeight=t.height,this._editorWidth=t.width,!0}addWidget(e){const t=i.createFastDomNode(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition("absolute"),t.setAttribute("widgetId",e.getId()),this._domNode.appendChild(t), +this.setShouldRender()}setWidgetPosition(e,t){const i=this._widgets[e.getId()];return i.preference!==t&&(i.preference=t,this.setShouldRender(),!0)}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const e=this._widgets[t].domNode.domNode;delete this._widgets[t],e.parentNode.removeChild(e),this.setShouldRender()}}_renderWidget(e){const t=e.domNode;if(null!==e.preference)if(0===e.preference)t.setTop(0),t.setRight(2*this._verticalScrollbarWidth+this._minimapWidth);else if(1===e.preference){const e=t.domNode.clientHeight;t.setTop(this._editorHeight-e-2*this._horizontalScrollbarHeight),t.setRight(2*this._verticalScrollbarWidth+this._minimapWidth)}else 2===e.preference&&(t.setTop(0),t.domNode.style.right="50%");else t.unsetTop()}prepareRender(e){}render(e){this._domNode.setWidth(this._editorWidth);const t=Object.keys(this._widgets);for(let e=0,i=t.length;ethis._context.viewLayout.getVerticalOffsetForLineNumber(e)),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(o.get(51)),this._zoneManager.setPixelRatio(o.get(115)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return e.hasChanged(51)&&(this._zoneManager.setLineHeight(t.get(51)),this._render()), +e.hasChanged(115)&&(this._zoneManager.setPixelRatio(t.get(115)),this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render()),!0}onFlushed(e){return this._render(),!0}onScrollChanged(e){return e.scrollHeightChanged&&(this._zoneManager.setOuterHeight(e.scrollHeight),this._render()),!0}onZonesChanged(e){return this._render(),!0}getDomNode(){return this._domNode.domNode}setLayout(e){this._domNode.setTop(e.top),this._domNode.setRight(e.right);let t=!1;t=this._zoneManager.setDOMWidth(e.width)||t,(t=this._zoneManager.setDOMHeight(e.height)||t)&&(this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render())}setZones(e){ +this._zoneManager.setZones(e),this._render()}_render(){if(0===this._zoneManager.getOuterHeight())return!1;const e=this._zoneManager.getCanvasWidth(),t=this._zoneManager.getCanvasHeight(),i=this._zoneManager.resolveColorZones(),n=this._zoneManager.getId2Color(),o=this._domNode.domNode.getContext("2d");return o.clearRect(0,0,e,t),i.length>0&&this._renderOneLane(o,i,n,e),!0}_renderOneLane(e,t,i,n){let o=0,s=0,r=0;for(const a of t){const t=a.colorId,l=a.from,d=a.to;t!==o?(e.fillRect(0,s,n,r-s),o=t,e.fillStyle=i[o],s=l,r=d):r>=l?r=Math.max(r,d):(e.fillRect(0,s,n,r-s),s=l,r=d)}e.fillRect(0,s,n,r-s)}}t.OverviewRuler=s})),define(t[387],i([0,1,30,12,43,13]),(function(e,t,i,n,o,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ViewZones=void 0;const r=()=>{throw new Error("Invalid change accessor")};class a extends o.ViewPart{constructor(e){super(e);const t=this._context.configuration.options,n=t.get(117);this._lineHeight=t.get(51),this._contentWidth=n.contentWidth,this._contentLeft=n.contentLeft, +this.domNode=i.createFastDomNode(document.createElement("div")),this.domNode.setClassName("view-zones"),this.domNode.setPosition("absolute"),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.marginDomNode=i.createFastDomNode(document.createElement("div")),this.marginDomNode.setClassName("margin-view-zones"),this.marginDomNode.setPosition("absolute"),this.marginDomNode.setAttribute("role","presentation"),this.marginDomNode.setAttribute("aria-hidden","true"),this._zones={}}dispose(){super.dispose(),this._zones={}}_recomputeWhitespacesProps(){const e=this._context.viewLayout.getWhitespaces(),t=new Map;for(const i of e)t.set(i.id,i);let i=!1;return this._context.model.changeWhitespace(e=>{const n=Object.keys(this._zones);for(let o=0,s=n.length;o{const o={addZone:e=>(t=!0,this._addZone(i,e)),removeZone:e=>{e&&(t=this._removeZone(i,e)||t)},layoutZone:e=>{e&&(t=this._layoutZone(i,e)||t)}};!function(e,t){try{e(t)}catch(e){n.onUnexpectedError(e)}}(e,o),o.addZone=r,o.removeZone=r,o.layoutZone=r}),t}_addZone(e,t){ +const n=this._computeWhitespaceProps(t),o={whitespaceId:e.insertWhitespace(n.afterViewLineNumber,this._getZoneOrdinal(t),n.heightInPx,n.minWidthInPx),delegate:t,isVisible:!1,domNode:i.createFastDomNode(t.domNode),marginDomNode:t.marginDomNode?i.createFastDomNode(t.marginDomNode):null};return this._safeCallOnComputedHeight(o.delegate,n.heightInPx),o.domNode.setPosition("absolute"),o.domNode.domNode.style.width="100%",o.domNode.setDisplay("none"),o.domNode.setAttribute("monaco-view-zone",o.whitespaceId),this.domNode.appendChild(o.domNode),o.marginDomNode&&(o.marginDomNode.setPosition("absolute"),o.marginDomNode.domNode.style.width="100%",o.marginDomNode.setDisplay("none"),o.marginDomNode.setAttribute("monaco-view-zone",o.whitespaceId),this.marginDomNode.appendChild(o.marginDomNode)),this._zones[o.whitespaceId]=o,this.setShouldRender(),o.whitespaceId}_removeZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t];return delete this._zones[t],e.removeWhitespace(i.whitespaceId), +i.domNode.removeAttribute("monaco-visible-view-zone"),i.domNode.removeAttribute("monaco-view-zone"),i.domNode.domNode.parentNode.removeChild(i.domNode.domNode),i.marginDomNode&&(i.marginDomNode.removeAttribute("monaco-visible-view-zone"),i.marginDomNode.removeAttribute("monaco-view-zone"),i.marginDomNode.domNode.parentNode.removeChild(i.marginDomNode.domNode)),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t],n=this._computeWhitespaceProps(i.delegate);return e.changeOneWhitespace(i.whitespaceId,n.afterViewLineNumber,n.heightInPx),this._safeCallOnComputedHeight(i.delegate,n.heightInPx),this.setShouldRender(),!0}return!1}shouldSuppressMouseDownOnViewZone(e){if(this._zones.hasOwnProperty(e)){const t=this._zones[e];return Boolean(t.delegate.suppressMouseDown)}return!1}_heightInPixels(e){return"number"==typeof e.heightInPx?e.heightInPx:"number"==typeof e.heightInLines?this._lineHeight*e.heightInLines:this._lineHeight}_minWidthInPixels(e){ +return"number"==typeof e.minWidthInPx?e.minWidthInPx:0}_safeCallOnComputedHeight(e,t){if("function"==typeof e.onComputedHeight)try{e.onComputedHeight(t)}catch(e){n.onUnexpectedError(e)}}_safeCallOnDomNodeTop(e,t){if("function"==typeof e.onDomNodeTop)try{e.onDomNodeTop(t)}catch(e){n.onUnexpectedError(e)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,i={};let n=!1;for(let e=0,o=t.length;e0;){if(this._collector||this._isConsumingViewEventQueue)return;const e=this._outgoingEvents.shift();e.isNoOp()||this._onEvent.fire(e)}}addViewEventHandler(e){for(let t=0,i=this._eventHandlers.length;t0&&this._emitMany(t)}this._emitOugoingEvents()}emitSingleViewEvent(e){try{this.beginEmitViewEvents().emitViewEvent(e)}finally{this.endEmitViewEvents()}}_emitMany(e){this._viewEventQueue?this._viewEventQueue=this._viewEventQueue.concat(e):this._viewEventQueue=e,this._isConsumingViewEventQueue||this._consumeViewEventQueue()}_consumeViewEventQueue(){try{this._isConsumingViewEventQueue=!0,this._doConsumeQueue()}finally{this._isConsumingViewEventQueue=!1}}_doConsumeQueue(){for(;this._viewEventQueue;){const e=this._viewEventQueue;this._viewEventQueue=null;const t=this._eventHandlers.slice(0);for(const i of t)i.handleEvents(e)}}}t.ViewModelEventDispatcher=o;class s{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}t.ViewModelEventsCollector=s;class r{constructor(e,t,i,n){ +this.kind=0,this._oldContentWidth=e,this._oldContentHeight=t,this.contentWidth=i,this.contentHeight=n,this.contentWidthChanged=this._oldContentWidth!==this.contentWidth,this.contentHeightChanged=this._oldContentHeight!==this.contentHeight}isNoOp(){return!this.contentWidthChanged&&!this.contentHeightChanged}merge(e){return 0!==e.kind?this:new r(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}t.ContentSizeChangedEvent=r;class a{constructor(e,t){this.kind=1,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}merge(e){return 1!==e.kind?this:new a(this.oldHasFocus,e.hasFocus)}}t.FocusChangedEvent=a;class l{constructor(e,t,i,n,o,s,r,a){this.kind=2,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=i,this._oldScrollTop=n,this.scrollWidth=o,this.scrollLeft=s,this.scrollHeight=r,this.scrollTop=a,this.scrollWidthChanged=this._oldScrollWidth!==this.scrollWidth,this.scrollLeftChanged=this._oldScrollLeft!==this.scrollLeft, +this.scrollHeightChanged=this._oldScrollHeight!==this.scrollHeight,this.scrollTopChanged=this._oldScrollTop!==this.scrollTop}isNoOp(){return!(this.scrollWidthChanged||this.scrollLeftChanged||this.scrollHeightChanged||this.scrollTopChanged)}merge(e){return 2!==e.kind?this:new l(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}t.ScrollChangedEvent=l;t.ViewZonesChangedEvent=class{constructor(){this.kind=3}isNoOp(){return!1}merge(e){return this}};class d{constructor(e,t,i,n,o,s,r){this.kind=5,this.oldSelections=e,this.selections=t,this.oldModelVersionId=i,this.modelVersionId=n,this.source=o,this.reason=s,this.reachedMaxCursorCount=r}static _selectionsAreEqual(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const i=e.length;if(i!==t.length)return!1;for(let n=0;n=t?0:i.horizontalScrollbarSize}_getContentHeight(e,t,i){const n=this._configuration.options;let o=this._linesLayout.getLinesTotalHeight();return n.get(86)?o+=t-n.get(51):o+=this._getHorizontalScrollbarHeight(e,i),o}_updateHeight(){ +const e=this._scrollable.getScrollDimensions(),t=e.width,i=e.height,n=e.contentWidth;this._scrollable.setScrollDimensions(new d(t,e.contentWidth,i,this._getContentHeight(t,i,n)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new r.Viewport(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new r.Viewport(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(e){const t=this._configuration.options,i=t.get(118),n=t.get(36);if(i.isViewportWrapping){const i=t.get(117),o=t.get(56);return e>i.contentWidth+n.typicalHalfwidthCharacterWidth&&o.enabled&&"right"===o.side?e+i.verticalScrollbarWidth:e}{const i=t.get(85)*n.typicalHalfwidthCharacterWidth,o=this._linesLayout.getWhitespaceMinWidth();return Math.max(e+i,o)}}setMaxLineWidth(e){const t=this._scrollable.getScrollDimensions() +;this._scrollable.setScrollDimensions(new d(t.width,this._computeContentWidth(e),t.height,t.contentHeight)),this._updateHeight()}saveState(){const e=this._scrollable.getFutureScrollPosition();let t=e.scrollTop,i=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t);return{scrollTop:t,scrollTopWithoutViewZones:t-this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(i),scrollLeft:e.scrollLeft}}changeWhitespace(e){const t=this._linesLayout.changeWhitespace(e);return t&&this.onHeightMaybeChanged(),t}getVerticalOffsetForLineNumber(e){return this._linesLayout.getVerticalOffsetForLineNumber(e)}isAfterLines(e){return this._linesLayout.isAfterLines(e)}getLineNumberAtVerticalOffset(e){return this._linesLayout.getLineNumberAtOrAfterVerticalOffset(e)}getWhitespaceAtVerticalOffset(e){return this._linesLayout.getWhitespaceAtVerticalOffset(e)}getLinesViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getLinesViewportData(e.top,e.top+e.height)}getLinesViewportDataAtScrollTop(e){ +const t=this._scrollable.getScrollDimensions();return e+t.height>t.scrollHeight&&(e=t.scrollHeight-t.height),e<0&&(e=0),this._linesLayout.getLinesViewportData(e,e+t.height)}getWhitespaceViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getWhitespaceViewportData(e.top,e.top+e.height)}getWhitespaces(){return this._linesLayout.getWhitespaces()}getContentWidth(){return this._scrollable.getScrollDimensions().contentWidth}getScrollWidth(){return this._scrollable.getScrollDimensions().scrollWidth}getContentHeight(){return this._scrollable.getScrollDimensions().contentHeight}getScrollHeight(){return this._scrollable.getScrollDimensions().scrollHeight}getCurrentScrollLeft(){return this._scrollable.getCurrentScrollPosition().scrollLeft}getCurrentScrollTop(){return this._scrollable.getCurrentScrollPosition().scrollTop}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}setScrollPosition(e,t){ +1===t?this._scrollable.setScrollPositionNow(e):this._scrollable.setScrollPositionSmooth(e)}deltaScrollNow(e,t){const i=this._scrollable.getCurrentScrollPosition();this._scrollable.setScrollPositionNow({scrollLeft:i.scrollLeft+e,scrollTop:i.scrollTop+t})}}t.ViewLayout=h})),define(t[389],i([0,1,3,20]),(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MoveCaretCommand=void 0;t.MoveCaretCommand=class{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;const n=this._selection.startLineNumber,o=this._selection.startColumn,s=this._selection.endColumn;if((!this._isMovingLeft||1!==o)&&(this._isMovingLeft||s!==e.getLineMaxColumn(n)))if(this._isMovingLeft){const r=new i.Range(n,o-1,n,o),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new i.Range(n,s,n,s),a)}else{const r=new i.Range(n,s,n,s+1),a=e.getValueInRange(r) +;t.addEditOperation(r,null),t.addEditOperation(new i.Range(n,o,n,o),a)}}computeCursorState(e,t){return this._isMovingLeft?new n.Selection(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new n.Selection(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}})),define(t[124],i([0,1,8]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeActionCommandArgs=t.filtersAction=t.mayIncludeActionsOfKind=t.CodeActionKind=void 0;class n{constructor(e){this.value=e}equals(e){return this.value===e.value}contains(e){return this.equals(e)||""===this.value||i.startsWith(e.value,this.value+n.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new n(this.value+n.sep+e)}}function o(e,t,i){return!!t.contains(e)&&(!i||!t.contains(i))}t.CodeActionKind=n,n.sep=".",n.None=new n("@@none@@"),n.Empty=new n(""),n.QuickFix=new n("quickfix"), +n.Refactor=new n("refactor"),n.Source=new n("source"),n.SourceOrganizeImports=n.Source.append("organizeImports"),n.SourceFixAll=n.Source.append("fixAll"),t.mayIncludeActionsOfKind=function(e,t){return!(e.include&&!e.include.intersects(t))&&((!e.excludes||!e.excludes.some(i=>o(t,i,e.include)))&&!(!e.includeSourceActions&&n.Source.contains(t)))},t.filtersAction=function(e,t){const i=t.kind?new n(t.kind):void 0;return!!(!e.include||i&&e.include.contains(i))&&(!(e.excludes&&i&&e.excludes.some(t=>o(i,t,e.include)))&&(!(!e.includeSourceActions&&i&&n.Source.contains(i))&&!(e.onlyIncludePreferredActions&&!t.isPreferred)))};class s{constructor(e,t,i){this.kind=e,this.apply=t,this.preferred=i}static fromUser(e,t){return e&&"object"==typeof e?new s(s.getKindFromUser(e,t.kind),s.getApplyFromUser(e,t.apply),s.getPreferredUser(e)):new s(t.kind,t.apply,!1)}static getApplyFromUser(e,t){switch("string"==typeof e.apply?e.apply.toLowerCase():""){case"first":return"first";case"never":return"never";case"ifsingle":return"ifSingle" +;default:return t}}static getKindFromUser(e,t){return"string"==typeof e.kind?new n(e.kind):t}static getPreferredUser(e){return"boolean"==typeof e.preferred&&e.preferred}}t.CodeActionCommandArgs=s})),define(t[390],i([0,1,4]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ColorPickerModel=void 0;t.ColorPickerModel=class{constructor(e,t,n){this.presentationIndex=n,this._onColorFlushed=new i.Emitter,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new i.Emitter,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new i.Emitter,this.onDidChangePresentation=this._onDidChangePresentation.event,this.originalColor=e,this._color=e,this._colorPresentations=t}get color(){return this._color}set color(e){this._color.equals(e)||(this._color=e,this._onDidChangeColor.fire(e))}get presentation(){return this.colorPresentations[this.presentationIndex]}get colorPresentations(){return this._colorPresentations}set colorPresentations(e){ +this._colorPresentations=e,this.presentationIndex>e.length-1&&(this.presentationIndex=0),this._onDidChangePresentation.fire(this.presentation)}selectNextColorPresentation(){this.presentationIndex=(this.presentationIndex+1)%this.colorPresentations.length,this.flushColor(),this._onDidChangePresentation.fire(this.presentation)}guessColorPresentation(e,t){for(let e=0;ee.length)return!1;for(let o=0;o=65&&n<=90&&n+32===s||s>=65&&s<=90&&s+32===n))return!1}return!0}_createOperationsForBlockComment(e,t,i,n,s,r){const l=e.startLineNumber,d=e.startColumn,c=e.endLineNumber,h=e.endColumn,u=s.getLineContent(l),g=s.getLineContent(c);let p,m=u.lastIndexOf(t,d-1+t.length),f=g.indexOf(i,h-1-i.length);if(-1!==m&&-1!==f)if(l===c){u.substring(m+t.length,f).indexOf(i)>=0&&(m=-1,f=-1)}else{const e=u.substring(m+t.length),n=g.substring(0,f);(e.indexOf(i)>=0||n.indexOf(i)>=0)&&(m=-1,f=-1)}-1!==m&&-1!==f?(n&&m+t.length0&&32===g.charCodeAt(f-1)&&(i=" "+i,f-=1),p=a._createRemoveBlockCommentOperations(new o.Range(l,m+t.length+1,c,f+1),t,i)):(p=a._createAddBlockCommentOperations(e,t,i,this._insertSpace),this._usedEndToken=1===p.length?i:null);for(const e of p)r.addTrackedEditOperation(e.range,e.text)}static _createRemoveBlockCommentOperations(e,t,n){let s=[] +;return o.Range.isEmpty(e)?s.push(i.EditOperation.delete(new o.Range(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+n.length))):(s.push(i.EditOperation.delete(new o.Range(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),s.push(i.EditOperation.delete(new o.Range(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+n.length)))),s}static _createAddBlockCommentOperations(e,t,s,r){let a=[];return o.Range.isEmpty(e)?a.push(i.EditOperation.replace(new o.Range(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+s)):(a.push(i.EditOperation.insert(new n.Position(e.startLineNumber,e.startColumn),t+(r?" ":""))),a.push(i.EditOperation.insert(new n.Position(e.endLineNumber,e.endColumn),(r?" ":"")+s))),a}getEditOperations(e,t){const i=this._selection.startLineNumber,n=this._selection.startColumn;e.tokenizeIfCheap(i);const o=e.getLanguageIdAtPosition(i,n),s=r.LanguageConfigurationRegistry.getComments(o) +;s&&s.blockCommentStartToken&&s.blockCommentEndToken&&this._createOperationsForBlockComment(this._selection,s.blockCommentStartToken,s.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const i=t.getInverseEditOperations();if(2===i.length){const e=i[0],t=i[1];return new s.Selection(e.range.endLineNumber,e.range.endColumn,t.range.startLineNumber,t.range.startColumn)}{const e=i[0].range,t=this._usedEndToken?-this._usedEndToken.length-1:0;return new s.Selection(e.endLineNumber,e.endColumn+t,e.endLineNumber,e.endColumn+t)}}}t.BlockCommentCommand=a})),define(t[391],i([0,1,8,60,13,3,20,42,216]),(function(e,t,i,n,o,s,r,a,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LineCommentCommand=void 0;class d{constructor(e,t,i,n,o){this._selection=e,this._tabSize=t,this._type=i,this._insertSpace=n,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=o}static _gatherPreflightCommentStrings(e,t,i){e.tokenizeIfCheap(t) +;const n=e.getLanguageIdAtPosition(t,1),o=a.LanguageConfigurationRegistry.getComments(n),s=o?o.lineCommentToken:null;if(!s)return null;let r=[];for(let e=0,n=i-t+1;er?o-1:o}}}t.LineCommentCommand=d})),define(t[392],i([0,1,20,3]),(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DragAndDropCommand=void 0;t.DragAndDropCommand=class{constructor(e,t,i){this.selection=e,this.targetPosition=t,this.copy=i,this.targetSelection=null}getEditOperations(e,t){let o=e.getValueInRange(this.selection);this.copy||t.addEditOperation(this.selection,null),t.addEditOperation(new n.Range(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column),o), +!this.selection.containsPosition(this.targetPosition)||this.copy&&(this.selection.getEndPosition().equals(this.targetPosition)||this.selection.getStartPosition().equals(this.targetPosition))?this.copy?this.targetSelection=new i.Selection(this.targetPosition.lineNumber,this.targetPosition.column,this.selection.endLineNumber-this.selection.startLineNumber+this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn):this.targetPosition.lineNumber>this.selection.endLineNumber?this.targetSelection=new i.Selection(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn):this.targetPosition.lineNumber0){let e=[];for(let t=0;ti.Range.compareRangesUsingStarts(e.range,t.range));let n=[],o=e[0];for(let t=1;t0){let e=[],t=i.caseOps.length,n=0;for(let s=0,r=o.length;s=t){e.push(o.slice(s));break}switch(i.caseOps[n]){case"U":e.push(o[s].toUpperCase());break;case"u":e.push(o[s].toUpperCase()),n++;break;case"L":e.push(o[s].toLowerCase());break;case"l":e.push(o[s].toLowerCase()),n++;break;default:e.push(o[s])}}o=e.join("")}n+=o}return n}static _substitute(e,t){if(null===t)return"";if(0===e)return t[0];let i="";for(;e>0;){if(e=o)break;let s=e.charCodeAt(n);if(36===s){i.emitUnchanged(n-1),i.emitStatic("$",n+1);continue}if(48===s||38===s){i.emitUnchanged(n-1),i.emitMatchIndex(0,n+1,t),t.length=0;continue}if(49<=s&&s<=57){let r=s-48;if(n+1=o)break;let s=e.charCodeAt(n);switch(s){case 92:i.emitUnchanged(n-1),i.emitStatic("\\",n+1);break;case 110:i.emitUnchanged(n-1),i.emitStatic("\n",n+1);break;case 116:i.emitUnchanged(n-1),i.emitStatic("\t",n+1);break;case 117:case 85:case 108:case 76:i.emitUnchanged(n-1),i.emitStatic("",n+1),t.push(String.fromCharCode(s))}}}return i.finalize()}})),define(t[166],i([0,1]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}), +t.FoldingRegion=t.FoldingRegions=t.MAX_LINE_NUMBER=t.MAX_FOLDING_REGIONS=void 0,t.MAX_FOLDING_REGIONS=65535,t.MAX_LINE_NUMBER=16777215;const i=4278190080;t.FoldingRegions=class{constructor(e,i,n){if(e.length!==i.length||e.length>t.MAX_FOLDING_REGIONS)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=i,this._collapseStates=new Uint32Array(Math.ceil(e.length/32)),this._types=n,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;let e=[],i=(t,i)=>{let n=e[e.length-1];return this.getStartLineNumber(n)<=t&&this.getEndLineNumber(n)>=i};for(let n=0,o=this._startIndexes.length;nt.MAX_LINE_NUMBER||s>t.MAX_LINE_NUMBER)throw new Error("startLineNumber or endLineNumber must not exceed "+t.MAX_LINE_NUMBER);for(;e.length>0&&!i(o,s);)e.pop();let r=e.length>0?e[e.length-1]:-1;e.push(n),this._startIndexes[n]=o+((255&r)<<24),this._endIndexes[n]=s+((65280&r)<<16)}}} +get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&t.MAX_LINE_NUMBER}getEndLineNumber(e){return this._endIndexes[e]&t.MAX_LINE_NUMBER}getType(e){return this._types?this._types[e]:void 0}hasTypes(){return!!this._types}isCollapsed(e){let t=e/32|0,i=e%32;return 0!=(this._collapseStates[t]&1<>>24)+((this._endIndexes[e]&i)>>>16);return n===t.MAX_FOLDING_REGIONS?-1:n}contains(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t}findIndex(e){let t=0,i=this._startIndexes.length;if(0===i)return-1;for(;t=0){if(this.getEndLineNumber(t)>=e)return t;for(t=this.getParentIndex(t);-1!==t;){if(this.contains(t,e))return t +;t=this.getParentIndex(t)}}return-1}toString(){let e=[];for(let t=0;t=this.endLineNumber}containsLine(e){return this.startLineNumber<=e&&e<=this.endLineNumber}}t.FoldingRegion=n})),define(t[395],i([0,1,4,166]),(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}), +t.setCollapseStateForType=t.setCollapseStateForMatchingLines=t.setCollapseStateAtLevel=t.setCollapseStateUp=t.setCollapseStateLevelsUp=t.setCollapseStateLevelsDown=t.toggleCollapseState=t.FoldingModel=void 0;t.FoldingModel=class{constructor(e,t){this._updateEventEmitter=new i.Emitter,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new n.FoldingRegions(new Uint32Array(0),new Uint32Array(0)),this._editorDecorationIds=[],this._isInitialized=!1}get regions(){return this._regions}get textModel(){return this._textModel}get isInitialized(){return this._isInitialized}toggleCollapseState(e){if(!e.length)return;e=e.sort((e,t)=>e.regionIndex-t.regionIndex);const t={};this._decorationProvider.changeDecorations(i=>{let n=0,o=-1,s=-1;const r=e=>{for(;ns&&(s=e),n++}} +;for(let i of e){let e=i.regionIndex,n=this._editorDecorationIds[e];if(n&&!t[n]){t[n]=!0,r(e);let i=!this._regions.isCollapsed(e);this._regions.setCollapsed(e,i),o=Math.max(o,this._regions.getEndLineNumber(e))}}r(this._regions.length)}),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}update(e,t=[]){let i=[],n=-1,o=(o,s)=>{const r=e.getStartLineNumber(o),a=e.getEndLineNumber(o);s&&((e,i)=>{for(let n of t)if(en&&(n=a)},s=0,r=()=>{for(;s=t))break;o(a,i===t),a++}}l=r()}for(;a0)return e}applyMemento(e){if(!Array.isArray(e))return;let t=[];for(let i of e){let e=this.getRegionAtLine(i.startLineNumber);e&&!e.isCollapsed&&t.push(e)}this.toggleCollapseState(t)}dispose(){this._decorationProvider.deltaDecorations(this._editorDecorationIds,[])}getAllRegionsAtLine(e,t){let i=[];if(this._regions){let n=this._regions.findRange(e),o=1;for(;n>=0;){let e=this._regions.toRegion(n) +;t&&!t(e,o)||i.push(e),o++,n=e.parentIndex}}return i}getRegionAtLine(e){if(this._regions){let t=this._regions.findRange(e);if(t>=0)return this._regions.toRegion(t)}return null}getRegionsInside(e,t){let i=[],n=e?e.regionIndex+1:0,o=e?e.endLineNumber:Number.MAX_VALUE;if(t&&2===t.length){const e=[];for(let s=n,r=this._regions.length;s0&&!n.containedBy(e[e.length-1]);)e.pop();e.push(n),t(n,e.length)&&i.push(n)}}else for(let e=n,s=this._regions.length;e1){let s=e.getRegionsInside(i,(e,i)=>e.isCollapsed!==o&&i0)for(let s of n){ +let n=e.getRegionAtLine(s);if(n&&(n.isCollapsed!==t&&o.push(n),i>1)){let s=e.getRegionsInside(n,(e,n)=>e.isCollapsed!==t&&ne.isCollapsed!==t&&ne.isCollapsed!==t&&n<=i);o.push(...n)}e.toggleCollapseState(o)},t.setCollapseStateUp=function(e,t,i){let n=[];for(let o of i){let i=e.getAllRegionsAtLine(o,e=>e.isCollapsed!==t);i.length>0&&n.push(i[0])}e.toggleCollapseState(n)},t.setCollapseStateAtLevel=function(e,t,i,n){let o=e.getRegionsInside(null,(e,o)=>o===t&&e.isCollapsed!==i&&!n.some(t=>e.containsLine(t)));e.toggleCollapseState(o)},t.setCollapseStateForMatchingLines=function(e,t,i){let n=e.textModel,o=e.regions,s=[];for(let e=o.length-1;e>=0;e--)if(i!==o.isCollapsed(e)){let i=o.getStartLineNumber(e);t.test(n.getLineContent(i))&&s.push(o.toRegion(e))}e.toggleCollapseState(s)}, +t.setCollapseStateForType=function(e,t,i){let n=e.regions,o=[];for(let e=n.length-1;e>=0;e--)i!==n.isCollapsed(e)&&t===n.getType(e)&&o.push(n.toRegion(e));e.toggleCollapseState(o)}})),define(t[396],i([0,1,4,3,19]),(function(e,t,i,n,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HiddenRangeModel=void 0;function s(e,t){let i=o.findFirstInSorted(e,e=>t=0&&e[i].endLineNumber>=t?e[i]:null}t.HiddenRangeModel=class{constructor(e){this._updateEventEmitter=new i.Emitter,this._foldingModel=e,this._foldingModelListener=e.onDidChange(e=>this.updateHiddenRanges()),this._hiddenRanges=[],e.regions.length&&this.updateHiddenRanges()}get onDidChange(){return this._updateEventEmitter.event}get hiddenRanges(){return this._hiddenRanges}updateHiddenRanges(){let e=!1,t=[],i=0,o=0,s=Number.MAX_VALUE,r=-1,a=this._foldingModel.regions;for(;i({startLineNumber:e.startLineNumber-1,endLineNumber:e.endLineNumber}))}applyHiddenRanges(e){this._hiddenRanges=e,this._updateEventEmitter.fire(e)}hasRanges(){return this._hiddenRanges.length>0}isHidden(e){return null!==s(this._hiddenRanges,e)}adjustSelections(e){let t=!1,i=this._foldingModel.textModel,n=null,o=e=>(n&&function(e,t){return e>=t.startLineNumber&&e<=t.endLineNumber}(e,n)||(n=s(this._hiddenRanges,e)),n?n.startLineNumber-1:null);for(let n=0,s=e.length;n0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}})),define(t[217],i([0,1,12,166]),(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sanitizeRanges=t.RangesCollector=t.SyntaxRangeProvider=t.ID_SYNTAX_PROVIDER=void 0;const o=5e3,s={};t.ID_SYNTAX_PROVIDER="syntax";t.SyntaxRangeProvider=class{constructor(e,i,n=o){this.editorModel=e,this.providers=i,this.limit=n,this.id=t.ID_SYNTAX_PROVIDER}compute(e){return function(e,t,n){let o=null,r=e.map((e,r)=>Promise.resolve(e.provideFoldingRanges(t,s,n)).then(e=>{if(!n.isCancellationRequested&&Array.isArray(e)){Array.isArray(o)||(o=[]);let i=t.getLineCount() +;for(let t of e)t.start>0&&t.end>t.start&&t.end<=i&&o.push({start:t.start,end:t.end,rank:r,kind:t.kind})}},i.onUnexpectedExternalError));return Promise.all(r).then(e=>o)}(this.providers,this.editorModel,e).then(e=>{if(e){return a(e,this.limit)}return null})}dispose(){}};class r{constructor(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,i,o){if(e>n.MAX_LINE_NUMBER||t>n.MAX_LINE_NUMBER)return;let s=this._length;this._startIndexes[s]=e,this._endIndexes[s]=t,this._nestingLevels[s]=o,this._types[s]=i,this._length++,o<30&&(this._nestingLevelCounts[o]=(this._nestingLevelCounts[o]||0)+1)}toIndentRanges(){if(this._length<=this._foldingRangesLimit){let e=new Uint32Array(this._length),t=new Uint32Array(this._length);for(let i=0;ithis._foldingRangesLimit){t=i;break}e+=n}}let i=new Uint32Array(this._foldingRangesLimit),o=new Uint32Array(this._foldingRangesLimit),s=[];for(let n=0,r=0;n{let i=e.start-t.start;return 0===i&&(i=e.rank-t.rank),i}),n=new r(t),o=void 0,s=[];for(let e of i)if(o){if(e.start>o.start)if(e.end<=o.end)s.push(o),o=e,n.add(e.start,e.end,e.kind&&e.kind.value,s.length);else{if(e.start>o.end){do{o=s.pop()}while(o&&e.start>o.end);o&&s.push(o),o=e}n.add(e.start,e.end,e.kind&&e.kind.value,s.length)}}else o=e,n.add(e.start,e.end,e.kind&&e.kind.value,s.length);return n.toIndentRanges()}t.RangesCollector=r,t.sanitizeRanges=a})),define(t[397],i([0,1,217]),(function(e,t,i){"use strict" +;Object.defineProperty(t,"__esModule",{value:!0}),t.InitializingRangeProvider=t.ID_INIT_PROVIDER=void 0,t.ID_INIT_PROVIDER="init";t.InitializingRangeProvider=class{constructor(e,i,n,o){if(this.editorModel=e,this.id=t.ID_INIT_PROVIDER,i.length){let t=t=>({range:{startLineNumber:t.startLineNumber,startColumn:0,endLineNumber:t.endLineNumber,endColumn:e.getLineLength(t.endLineNumber)},options:{stickiness:1}});this.decorationIds=e.deltaDecorations([],i.map(t)),this.timeout=setTimeout(n,o)}}dispose(){this.decorationIds&&(this.editorModel.deltaDecorations(this.decorationIds,[]),this.decorationIds=void 0),"number"==typeof this.timeout&&(clearTimeout(this.timeout),this.timeout=void 0)}compute(e){let t=[];if(this.decorationIds)for(let e of this.decorationIds){let i=this.editorModel.getDecorationRange(e);i&&t.push({start:i.startLineNumber,end:i.endLineNumber,rank:1})}return Promise.resolve(i.sanitizeRanges(t,Number.MAX_VALUE))}}})),define(t[218],i([0,1,60,3]),(function(e,t,i,n){"use strict" +;Object.defineProperty(t,"__esModule",{value:!0}),t.FormattingEdit=void 0;class o{static _handleEolEdits(e,t){let i=void 0,n=[];for(let e of t)"number"==typeof e.eol&&(i=e.eol),e.range&&"string"==typeof e.text&&n.push(e);return"number"==typeof i&&e.hasModel()&&e.getModel().pushEOL(i),n}static _isFullModelReplaceEdit(e,t){if(!e.hasModel())return!1;const i=e.getModel(),n=i.validateRange(t.range);return i.getFullModelRange().equalsRange(n)}static execute(e,t,s){s&&e.pushUndoStop();const r=o._handleEolEdits(e,t);1===r.length&&o._isFullModelReplaceEdit(e,r[0])?e.executeEdits("formatEditsCommand",r.map(e=>i.EditOperation.replace(n.Range.lift(e.range),e.text))):e.executeEdits("formatEditsCommand",r.map(e=>i.EditOperation.replaceMove(n.Range.lift(e.range),e.text))),s&&e.pushUndoStop()}}t.FormattingEdit=o})),define(t[219],i([0,1,2,4,16]),(function(e,t,i,n,o){"use strict";function s(e,t){return!!e[t]}Object.defineProperty(t,"__esModule",{value:!0}), +t.ClickLinkGesture=t.ClickLinkOptions=t.ClickLinkKeyboardEvent=t.ClickLinkMouseEvent=void 0;class r{constructor(e,t){this.target=e.target,this.hasTriggerModifier=s(e.event,t.triggerModifier),this.hasSideBySideModifier=s(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}t.ClickLinkMouseEvent=r;class a{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=s(e,t.triggerModifier)}}t.ClickLinkKeyboardEvent=a;class l{constructor(e,t,i,n){this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=i,this.triggerSideBySideModifier=n}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier}}function d(e){ +return"altKey"===e?o.isMacintosh?new l(57,"metaKey",6,"altKey"):new l(5,"ctrlKey",6,"altKey"):o.isMacintosh?new l(6,"altKey",57,"metaKey"):new l(6,"altKey",5,"ctrlKey")}t.ClickLinkOptions=l;class c extends i.Disposable{constructor(e){super(),this._onMouseMoveOrRelevantKeyDown=this._register(new n.Emitter),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new n.Emitter),this.onExecute=this._onExecute.event,this._onCancel=this._register(new n.Emitter),this.onCancel=this._onCancel.event,this._editor=e,this._opts=d(this._editor.getOption(61)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(e=>{if(e.hasChanged(61)){const e=d(this._editor.getOption(61));if(this._opts.equals(e))return;this._opts=e,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})), +this._register(this._editor.onMouseMove(e=>this._onEditorMouseMove(new r(e,this._opts)))),this._register(this._editor.onMouseDown(e=>this._onEditorMouseDown(new r(e,this._opts)))),this._register(this._editor.onMouseUp(e=>this._onEditorMouseUp(new r(e,this._opts)))),this._register(this._editor.onKeyDown(e=>this._onEditorKeyDown(new a(e,this._opts)))),this._register(this._editor.onKeyUp(e=>this._onEditorKeyUp(new a(e,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(e=>this._onDidChangeCursorSelection(e))),this._register(this._editor.onDidChangeModel(e=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(e=>{(e.scrollTopChanged||e.scrollLeftChanged)&&this._resetHandler()}))}_onDidChangeCursorSelection(e){e.selection&&e.selection.startColumn!==e.selection.endColumn&&this._resetHandler()}_onEditorMouseMove(e){ +this._lastMouseMoveEvent=e,this._onMouseMoveOrRelevantKeyDown.fire([e,null])}_onEditorMouseDown(e){this._hasTriggerKeyOnMouseDown=e.hasTriggerModifier,this._lineNumberOnMouseDown=e.target.position?e.target.position.lineNumber:0}_onEditorMouseUp(e){const t=e.target.position?e.target.position.lineNumber:0;this._hasTriggerKeyOnMouseDown&&this._lineNumberOnMouseDown&&this._lineNumberOnMouseDown===t&&this._onExecute.fire(e)}_onEditorKeyDown(e){this._lastMouseMoveEvent&&(e.keyCodeIsTriggerKey||e.keyCodeIsSideBySideKey&&e.hasTriggerModifier)?this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent,e]):e.hasTriggerModifier&&this._onCancel.fire()}_onEditorKeyUp(e){e.keyCodeIsTriggerKey&&this._onCancel.fire()}_resetHandler(){this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._onCancel.fire()}}t.ClickLinkGesture=c})),define(t[220],i([0,1,15,12]),(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HoverOperation=void 0;t.HoverOperation=class{ +constructor(e,t,n,o,s){this._computer=e,this._state=0,this._hoverTime=s,this._firstWaitScheduler=new i.RunOnceScheduler(()=>this._triggerAsyncComputation(),0),this._secondWaitScheduler=new i.RunOnceScheduler(()=>this._triggerSyncComputation(),0),this._loadingMessageScheduler=new i.RunOnceScheduler(()=>this._showLoadingMessage(),0),this._asyncComputationPromise=null,this._asyncComputationPromiseDone=!1,this._completeCallback=t,this._errorCallback=n,this._progressCallback=o}setHoverTime(e){this._hoverTime=e}_firstWaitTime(){return this._hoverTime/2}_secondWaitTime(){return this._hoverTime/2}_loadingMessageTime(){return 3*this._hoverTime}_triggerAsyncComputation(){this._state=2,this._secondWaitScheduler.schedule(this._secondWaitTime()),this._computer.computeAsync?(this._asyncComputationPromiseDone=!1,this._asyncComputationPromise=i.createCancelablePromise(e=>this._computer.computeAsync(e)),this._asyncComputationPromise.then(e=>{this._asyncComputationPromiseDone=!0,this._withAsyncResult(e) +},e=>this._onError(e))):this._asyncComputationPromiseDone=!0}_triggerSyncComputation(){this._computer.computeSync&&this._computer.onResult(this._computer.computeSync(),!0),this._asyncComputationPromiseDone?(this._state=0,this._onComplete(this._computer.getResult())):(this._state=3,this._onProgress(this._computer.getResult()))}_showLoadingMessage(){3===this._state&&this._onProgress(this._computer.getResultWithLoadingMessage())}_withAsyncResult(e){e&&this._computer.onResult(e,!1),3===this._state&&(this._state=0,this._onComplete(this._computer.getResult()))}_onComplete(e){this._completeCallback(e)}_onError(e){this._errorCallback?this._errorCallback(e):n.onUnexpectedError(e)}_onProgress(e){this._progressCallback(e)}start(e){if(0===e)0===this._state&&(this._state=1,this._firstWaitScheduler.schedule(this._firstWaitTime()),this._loadingMessageScheduler.schedule(this._loadingMessageTime()));else switch(this._state){case 0:this._triggerAsyncComputation(),this._secondWaitScheduler.cancel(), +this._triggerSyncComputation();break;case 2:this._secondWaitScheduler.cancel(),this._triggerSyncComputation()}}cancel(){this._loadingMessageScheduler.cancel(),1===this._state&&this._firstWaitScheduler.cancel(),2===this._state&&(this._secondWaitScheduler.cancel(),this._asyncComputationPromise&&(this._asyncComputationPromise.cancel(),this._asyncComputationPromise=null)),3===this._state&&this._asyncComputationPromise&&(this._asyncComputationPromise.cancel(),this._asyncComputationPromise=null),this._state=0}}})),define(t[221],i([0,1,7,54,301]),(function(e,t,i,n,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlyphHoverWidget=t.ContentHoverWidget=void 0;class s extends n.Widget{constructor(e,t,i,n){super(),this._hoverVisibleKey=i,this._keybindingService=n,this.allowEditorOverflow=!0,this._hover=this._register(new o.HoverWidget),this._id=e,this._editor=t,this._isVisible=!1,this._stoleFocus=!1,this.onkeydown(this._hover.containerDomNode,e=>{e.equals(9)&&this.hide()}), +this._register(this._editor.onDidChangeConfiguration(e=>{e.hasChanged(36)&&this.updateFont()})),this._editor.onDidLayoutChange(e=>this.layout()),this.layout(),this._editor.addContentWidget(this),this._showAtPosition=null,this._showAtRange=null,this._stoleFocus=!1}get isVisible(){return this._isVisible}set isVisible(e){this._isVisible=e,i.toggleClass(this._hover.containerDomNode,"hidden",!this._isVisible)}getId(){return this._id}getDomNode(){return this._hover.containerDomNode}showAt(e,t,i){this._showAtPosition=e,this._showAtRange=t,this._hoverVisibleKey.set(!0),this.isVisible=!0,this._editor.layoutContentWidget(this),this._editor.render(),this._stoleFocus=i,i&&this._hover.containerDomNode.focus()}hide(){this.isVisible&&(setTimeout(()=>{this.isVisible||this._hoverVisibleKey.set(!1)},0),this.isVisible=!1,this._editor.layoutContentWidget(this),this._stoleFocus&&this._editor.focus())}getPosition(){return this.isVisible?{position:this._showAtPosition,range:this._showAtRange,preference:[1,2]}:null}dispose(){ +this._editor.removeContentWidget(this),super.dispose()}updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(e=>this._editor.applyFontInfo(e))}updateContents(e){this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this.updateFont(),this._editor.layoutContentWidget(this),this._hover.onContentsChanged()}_renderAction(e,t){const i=this._keybindingService.lookupKeybinding(t.commandId),n=i?i.getLabel():null;return o.renderHoverAction(e,t,n)}layout(){const e=Math.max(this._editor.getLayoutInfo().height/4,250),{fontSize:t,lineHeight:i}=this._editor.getOption(36);this._hover.contentsDomNode.style.fontSize=`${t}px`,this._hover.contentsDomNode.style.lineHeight=`${i}px`,this._hover.contentsDomNode.style.maxHeight=`${e}px`,this._hover.contentsDomNode.style.maxWidth=`${Math.max(.66*this._editor.getLayoutInfo().width,500)}px`}}t.ContentHoverWidget=s;class r extends n.Widget{constructor(e,t){super(),this._id=e,this._editor=t, +this._isVisible=!1,this._domNode=document.createElement("div"),this._domNode.className="monaco-hover hidden",this._domNode.setAttribute("aria-hidden","true"),this._domNode.setAttribute("role","tooltip"),this._showAtLineNumber=-1,this._register(this._editor.onDidChangeConfiguration(e=>{e.hasChanged(36)&&this.updateFont()})),this._editor.addOverlayWidget(this)}get isVisible(){return this._isVisible}set isVisible(e){this._isVisible=e,i.toggleClass(this._domNode,"hidden",!this._isVisible)}getId(){return this._id}getDomNode(){return this._domNode}showAt(e){this._showAtLineNumber=e,this.isVisible||(this.isVisible=!0);const t=this._editor.getLayoutInfo(),i=this._editor.getTopForLineNumber(this._showAtLineNumber),n=this._editor.getScrollTop(),o=this._editor.getOption(51),s=i-n-(this._domNode.clientHeight-o)/2;this._domNode.style.left=`${t.glyphMarginLeft+t.glyphMarginWidth}px`,this._domNode.style.top=`${Math.max(Math.round(s),0)}px`}hide(){this.isVisible&&(this.isVisible=!1)}getPosition(){return null}dispose(){ +this._editor.removeOverlayWidget(this),super.dispose()}updateFont(){[...Array.prototype.slice.call(this._domNode.getElementsByTagName("code")),...Array.prototype.slice.call(this._domNode.getElementsByClassName("code"))].forEach(e=>this._editor.applyFontInfo(e))}updateContents(e){this._domNode.textContent="",this._domNode.appendChild(e),this.updateFont()}}t.GlyphHoverWidget=r})),define(t[398],i([0,1,20]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InPlaceReplaceCommand=void 0;t.InPlaceReplaceCommand=class{constructor(e,t,i){this._editRange=e,this._originalSelection=t,this._text=i}getEditOperations(e,t){t.addTrackedEditOperation(this._editRange,this._text)}computeCursorState(e,t){const n=t.getInverseEditOperations()[0].range +;return this._originalSelection.isEmpty()?new i.Selection(n.endLineNumber,Math.min(this._originalSelection.positionColumn,n.endColumn),n.endLineNumber,Math.min(this._originalSelection.positionColumn,n.endColumn)):new i.Selection(n.endLineNumber,n.endColumn-this._text.length,n.endLineNumber,n.endColumn)}}})),define(t[222],i([0,1]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateIndent=t.getSpaceCnt=void 0,t.getSpaceCnt=function(e,t){let i=0;for(let n=0;n=s)return null;let r=[];for(let t=n;t<=s;t++)r.push(e.getLineContent(t));let a=r.slice(0);return a.sort(o.getCollator().compare),!0===i&&(a=a.reverse()),{startLineNumber:n,endLineNumber:s,before:r,after:a}}t.SortLinesCommand=o,o._COLLATOR=null})),define(t[223],i([0,1,13,3,69]),(function(e,t,i,n,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BracketSelectionRangeProvider=void 0;class s{provideSelectionRanges(e,t){return r(this,void 0,void 0,(function*(){const i=[];for(const n of t){const t=[];i.push(t);const o=new Map;yield new Promise(t=>s._bracketsRightYield(t,0,e,n,o)),yield new Promise(i=>s._bracketsLeftYield(i,0,e,n,o,t))}return i}))}static _bracketsRightYield(e,t,i,n,r){const a=new Map,l=Date.now();for(;;){if(t>=s._maxRounds){e();break}if(!n){e();break}let d=i.findNextBracket(n);if(!d){e();break} +if(Date.now()-l>s._maxDuration){setTimeout(()=>s._bracketsRightYield(e,t+1,i,n,r));break}const c=d.close[0];if(d.isOpen){let e=a.has(c)?a.get(c):0;a.set(c,e+1)}else{let e=a.has(c)?a.get(c):0;if(e-=1,a.set(c,Math.max(0,e)),e<0){let e=r.get(c);e||(e=new o.LinkedList,r.set(c,e)),e.push(d.range)}}n=d.range.getEndPosition()}}static _bracketsLeftYield(e,t,i,o,r,a){const l=new Map,d=Date.now();for(;;){if(t>=s._maxRounds&&0===r.size){e();break}if(!o){e();break}let c=i.findPrevBracket(o);if(!c){e();break}if(Date.now()-d>s._maxDuration){setTimeout(()=>s._bracketsLeftYield(e,t+1,i,o,r,a));break}const h=c.close[0];if(c.isOpen){let e=l.has(h)?l.get(h):0;if(e-=1,l.set(h,Math.max(0,e)),e<0){let e=r.get(h);if(e){let t=e.shift();0===e.size&&r.delete(h);const o=n.Range.fromPositions(c.range.getEndPosition(),t.getStartPosition()),l=n.Range.fromPositions(c.range.getStartPosition(),t.getEndPosition());a.push({range:o}),a.push({range:l}),s._addBracketLeading(i,l,a)}}}else{let e=l.has(h)?l.get(h):0;l.set(h,e+1)} +o=c.range.getStartPosition()}}static _addBracketLeading(e,t,o){if(t.startLineNumber===t.endLineNumber)return;const s=t.startLineNumber,r=e.getLineFirstNonWhitespaceColumn(s);0!==r&&r!==t.startColumn&&(o.push({range:n.Range.fromPositions(new i.Position(s,r),t.getEndPosition())}),o.push({range:n.Range.fromPositions(new i.Position(s,1),t.getEndPosition())}));const a=s-1;if(a>0){const s=e.getLineFirstNonWhitespaceColumn(a);s===t.startColumn&&s!==e.getLineLastNonWhitespaceColumn(a)&&(o.push({range:n.Range.fromPositions(new i.Position(a,s),t.getEndPosition())}),o.push({range:n.Range.fromPositions(new i.Position(a,1),t.getEndPosition())}))}}}t.BracketSelectionRangeProvider=s,s._maxDuration=30,s._maxRounds=2})),define(t[401],i([0,1,3,8]),(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WordSelectionRangeProvider=void 0;t.WordSelectionRangeProvider=class{provideSelectionRanges(e,t){const i=[];for(const n of t){const t=[];i.push(t),this._addInWordRanges(t,e,n), +this._addWordRanges(t,e,n),this._addWhitespaceLine(t,e,n),t.push({range:e.getFullModelRange()})}return i}_addInWordRanges(e,t,o){const s=t.getWordAtPosition(o);if(!s)return;let{word:r,startColumn:a}=s,l=o.column-a,d=l,c=l,h=0;for(;d>=0;d--){let e=r.charCodeAt(d);if(d!==l&&(95===e||45===e))break;if(n.isLowerAsciiLetter(e)&&n.isUpperAsciiLetter(h))break;h=e}for(d+=1;c0&&0===t.getLineFirstNonWhitespaceColumn(n.lineNumber)&&0===t.getLineLastNonWhitespaceColumn(n.lineNumber)&&e.push({range:new i.Range(n.lineNumber,1,n.lineNumber,t.getLineMaxColumn(n.lineNumber))})}}})),define(t[125],i([0,1]),(function(e,t){"use strict" +;Object.defineProperty(t,"__esModule",{value:!0}),t.SnippetParser=t.TextmateSnippet=t.Variable=t.FormatString=t.Transform=t.Choice=t.Placeholder=t.TransformableMarker=t.Text=t.Marker=t.Scanner=void 0;class i{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return 95===e||e>=97&&e<=122||e>=65&&e<=90}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};let e,t=this.pos,n=0,o=this.value.charCodeAt(t);if("number"==typeof(e=i._table[o]))return this.pos+=1,{type:e,pos:t,len:1};if(i.isDigitCharacter(o)){e=8;do{n+=1,o=this.value.charCodeAt(t+n)}while(i.isDigitCharacter(o));return this.pos+=n,{type:e,pos:t,len:n}}if(i.isVariableCharacter(o)){e=9;do{o=this.value.charCodeAt(t+ ++n)}while(i.isVariableCharacter(o)||i.isDigitCharacter(o));return this.pos+=n,{type:e,pos:t,len:n}}e=10;do{n+=1,o=this.value.charCodeAt(t+n) +}while(!isNaN(o)&&void 0===i._table[o]&&!i.isDigitCharacter(o)&&!i.isVariableCharacter(o));return this.pos+=n,{type:e,pos:t,len:n}}}t.Scanner=i,i._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};class n{constructor(){this._children=[]}appendChild(e){return e instanceof o&&this._children[this._children.length-1]instanceof o?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:i}=e,n=i.children.indexOf(e),o=i.children.slice(0);o.splice(n,1,...t),i._children=o,function e(t,i){for(const n of t)n.parent=i,e(n.children,n)}(t,i)}get children(){return this._children}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof u)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}t.Marker=n;class o extends n{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new o(this.value)}}t.Text=o;class s extends n{} +t.TransformableMarker=s;class r extends s{constructor(e){super(),this.index=e}static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop?-1:e.indext.index?1:0}get isFinalTabstop(){return 0===this.index}get choice(){return 1===this._children.length&&this._children[0]instanceof a?this._children[0]:void 0}clone(){let e=new r(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(e=>e.clone()),e}}t.Placeholder=r;class a extends n{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof o&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){let e=new a;return this.options.forEach(e.appendChild,e),e}}t.Choice=a;class l extends n{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let i=!1,n=e.replace(this.regexp,(function(){return i=!0, +t._replace(Array.prototype.slice.call(arguments,0,-2))}));return!i&&this._children.some(e=>e instanceof d&&Boolean(e.elseValue))&&(n=this._replace([])),n}_replace(e){let t="";for(const i of this._children)if(i instanceof d){let n=e[i.index]||"";t+=n=i.resolve(n)}else t+=i.toString();return t}toString(){return""}clone(){let e=new l;return e.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map(e=>e.clone()),e}}t.Transform=l;class d extends n{constructor(e,t,i,n){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=n}resolve(e){return"upcase"===this.shorthandName?e?e.toLocaleUpperCase():"":"downcase"===this.shorthandName?e?e.toLocaleLowerCase():"":"capitalize"===this.shorthandName?e?e[0].toLocaleUpperCase()+e.substr(1):"":"pascalcase"===this.shorthandName?e?this._toPascalCase(e):"":Boolean(e)&&"string"==typeof this.ifValue?this.ifValue:Boolean(e)||"string"!=typeof this.elseValue?e||"":this.elseValue}_toPascalCase(e){ +const t=e.match(/[a-z]+/gi);return t?t.map((function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()})).join(""):e}clone(){return new d(this.index,this.shorthandName,this.ifValue,this.elseValue)}}t.FormatString=d;class c extends s{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||"")),void 0!==t&&(this._children=[new o(t)],!0)}clone(){const e=new c(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(e=>e.clone()),e}}function h(e,t){const i=[...e];for(;i.length>0;){const e=i.shift();if(!t(e))break;i.unshift(...e.children)}}t.Variable=c;class u extends n{get placeholderInfo(){if(!this._placeholders){let e,t=[];this.walk((function(i){return i instanceof r&&(t.push(i),e=!e||e.indexn===e?(i=!0, +!1):(t+=n.len(),!0)),i?t:-1}fullLen(e){let t=0;return h([e],e=>(t+=e.len(),!0)),t}enclosingPlaceholders(e){let t=[],{parent:i}=e;for(;i;)i instanceof r&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof c&&t.resolve(e)&&(this._placeholders=void 0),!0)),this}appendChild(e){return this._placeholders=void 0,super.appendChild(e)}replace(e,t){return this._placeholders=void 0,super.replace(e,t)}clone(){let e=new u;return this._children=this.children.map(e=>e.clone()),e}walk(e){h(this.children,e)}}t.TextmateSnippet=u;t.SnippetParser=class{constructor(){this._scanner=new i,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,i){this._scanner.text(e),this._token=this._scanner.next();const n=new u;for(;this._parse(n););const o=new Map,s=[];let a=0;n.walk(e=>(e instanceof r&&(a+=1, +e.isFinalTabstop?o.set(0,void 0):!o.has(e.index)&&e.children.length>0?o.set(e.index,e.children):s.push(e)),!0));for(const e of s){const t=o.get(e.index);if(t){const i=new r(e.index);i.transform=e.transform;for(const e of t)i.appendChild(e.clone());n.replace(e,[i])}}return i||(i=a>0&&t),!o.has(0)&&i&&n.appendChild(new r(0)),n}_accept(e,t){if(void 0===e||this._token.type===e){let e=!t||this._scanner.tokenText(this._token);return this._token=this._scanner.next(),e}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){const t=this._token;for(;this._token.type!==e;){if(14===this._token.type)return!1;if(5===this._token.type){const e=this._scanner.next();if(0!==e.type&&4!==e.type&&5!==e.type)return!1}this._token=this._scanner.next()}const i=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),i}_parse(e){ +return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return!!(t=this._accept(5,!0))&&(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new o(t)),!0)}_parseTabstopOrVariableName(e){let t;const i=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new r(Number(t)):new c(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(i);const n=new r(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(n),!0;if(!this._parse(n))return e.appendChild(new o("${"+t+":")),n.children.forEach(e.appendChild,e),!0}else{if(!(n.index>0&&this._accept(7)))return this._accept(6)?this._parseTransform(n)?(e.appendChild(n),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(n),!0):this._backTo(i);{ +const t=new a;for(;;){if(this._parseChoiceElement(t)){if(this._accept(2))continue;if(this._accept(7)&&(n.appendChild(t),this._accept(4)))return e.appendChild(n),!0}return this._backTo(i),!1}}}}_parseChoiceElement(e){const t=this._token,i=[];for(;2!==this._token.type&&7!==this._token.type;){let e;if(!(e=(e=this._accept(5,!0))?this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||e:this._accept(void 0,!0)))return this._backTo(t),!1;i.push(e)}return 0===i.length?(this._backTo(t),!1):(e.appendChild(new o(i.join(""))),!0)}_parseComplexVariable(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(i);const n=new c(t);if(!this._accept(1))return this._accept(6)?this._parseTransform(n)?(e.appendChild(n),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(n),!0):this._backTo(i);for(;;){if(this._accept(4))return e.appendChild(n),!0;if(!this._parse(n))return e.appendChild(new o("${"+t+":")),n.children.forEach(e.appendChild,e),!0}}_parseTransform(e){ +let t=new l,i="",n="";for(;!this._accept(6);){let e;if(e=this._accept(5,!0))i+=e=this._accept(6,!0)||e;else{if(14===this._token.type)return!1;i+=this._accept(void 0,!0)}}for(;!this._accept(6);){let e;if(e=this._accept(5,!0))e=this._accept(5,!0)||this._accept(6,!0)||e,t.appendChild(new o(e));else if(!this._parseFormatString(t)&&!this._parseAnything(t))return!1}for(;!this._accept(4);){if(14===this._token.type)return!1;n+=this._accept(void 0,!0)}try{t.regexp=new RegExp(i,n)}catch(e){return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let i=!1;this._accept(3)&&(i=!0);let n=this._accept(8,!0);if(!n)return this._backTo(t),!1;if(!i)return e.appendChild(new d(Number(n))),!0;if(this._accept(4))return e.appendChild(new d(Number(n))),!0;if(!this._accept(1))return this._backTo(t),!1;if(this._accept(6)){let i=this._accept(9,!0);return i&&this._accept(4)?(e.appendChild(new d(Number(n),i)),!0):(this._backTo(t),!1)}if(this._accept(11)){let t=this._until(4) +;if(t)return e.appendChild(new d(Number(n),void 0,t,void 0)),!0}else if(this._accept(12)){let t=this._until(4);if(t)return e.appendChild(new d(Number(n),void 0,void 0,t)),!0}else if(this._accept(13)){let t=this._until(1);if(t){let i=this._until(4);if(i)return e.appendChild(new d(Number(n),void 0,t,i)),!0}}else{let t=this._until(4);if(t)return e.appendChild(new d(Number(n),void 0,void 0,t)),!0}return this._backTo(t),!1}_parseAnything(e){return 14!==this._token.type&&(e.appendChild(new o(this._scanner.tokenText(this._token))),this._accept(void 0),!0)}}})),define(t[402],i([0,1,64,8]),(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CompletionModel=t.LineContext=void 0;t.LineContext=class{constructor(e,t){this.leadingLineContent=e,this.characterCountDelta=t}};class o{constructor(e,t,i,n,s,r,a){this.clipboardText=a,this._snippetCompareFn=o._compareCompletionItems,this._items=e,this._column=t,this._wordDistance=n,this._options=s,this._refilterKind=1,this._lineContext=i, +"top"===r?this._snippetCompareFn=o._compareCompletionItemsSnippetsUp:"bottom"===r&&(this._snippetCompareFn=o._compareCompletionItemsSnippetsDown)}get lineContext(){return this._lineContext}set lineContext(e){this._lineContext.leadingLineContent===e.leadingLineContent&&this._lineContext.characterCountDelta===e.characterCountDelta||(this._refilterKind=this._lineContext.characterCountDelta2e3?i.fuzzyScore:i.fuzzyScoreGracefulAggressive;for(let d=0;d=u)c.score=i.FuzzyScore.Default;else if("string"==typeof c.completion.filterText){let r=l(o,s,e,c.completion.filterText,c.filterTextLow,0,!1);if(!r)continue +;0===n.compareIgnoreCase(c.completion.filterText,t)?c.score=r:(c.score=i.anyScore(o,s,e,t,c.labelLow,0),c.score[0]=r[0])}else{let i=l(o,s,e,t,c.labelLow,0,!1);if(!i)continue;c.score=i}}switch(c.idx=d,c.distance=this._wordDistance.distance(c.position,c.completion),a.push(c),this._stats.suggestionCount++,c.completion.kind){case 27:this._stats.snippetCount++;break;case 18:this._stats.textCount++}}this._filteredItems=a.sort(this._snippetCompareFn),this._refilterKind=0}static _compareCompletionItems(e,t){return e.score[0]>t.score[0]?-1:e.score[0]t.distance?1:e.idxt.idx?1:0}static _compareCompletionItemsSnippetsDown(e,t){if(e.completion.kind!==t.completion.kind){if(27===e.completion.kind)return 1;if(27===t.completion.kind)return-1}return o._compareCompletionItems(e,t)}static _compareCompletionItemsSnippetsUp(e,t){if(e.completion.kind!==t.completion.kind){if(27===e.completion.kind)return-1;if(27===t.completion.kind)return 1} +return o._compareCompletionItems(e,t)}}t.CompletionModel=o})),define(t[403],i([0,1,19,2,87]),(function(e,t,i,n,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommitCharacterController=void 0;t.CommitCharacterController=class{constructor(e,t,i){this._disposables=new n.DisposableStore,this._disposables.add(t.onDidShow(()=>this._onItem(t.getFocusedItem()))),this._disposables.add(t.onDidFocus(this._onItem,this)),this._disposables.add(t.onDidHide(this.reset,this)),this._disposables.add(e.onWillType(n=>{if(this._active&&!t.isFrozen()){const t=n.charCodeAt(n.length-1);this._active.acceptCharacters.has(t)&&e.getOption(0)&&i(this._active.item)}}))}_onItem(e){if(!e||!i.isNonEmptyArray(e.item.completion.commitCharacters))return void this.reset();if(this._active&&this._active.item.item===e.item)return;const t=new o.CharacterSet;for(const i of e.item.completion.commitCharacters)i.length>0&&t.add(i.charCodeAt(0));this._active={acceptCharacters:t,item:e}}reset(){this._active=void 0}dispose(){ +this._disposables.dispose()}}})),define(t[404],i([0,1,2]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OvertypingCapturer=void 0;class n{constructor(e,t){this._disposables=new i.DisposableStore,this._lastOvertyped=[],this._empty=!0,this._disposables.add(e.onWillType(()=>{if(!this._empty)return;if(!e.hasModel())return;const t=e.getSelections(),i=t.length;let o=!1;for(let e=0;en._maxSelectionLength)return;this._lastOvertyped[e]={value:s.getValueInRange(i),multiline:i.startLineNumber!==i.endLineNumber}}this._empty=!1})),this._disposables.add(t.onDidCancel(e=>{this._empty||(this._empty=!0)}))}getLastOvertypedInfo(e){if(!this._empty&&e>=0&&e=0?r[c]:r[Math.max(0,~c-1)],u=l.length;for(const e of l){if(!n.Range.containsRange(e.range,h))break;u-=1}return u}}}))}} +t.WordDistance=s,s.None=new class extends s{distance(){return 0}}})),define(t[224],i([0,1]),(function(e,t){"use strict";function i(e){return Array.isArray(e)}function n(e){return"string"==typeof e}function o(e){return!e}function s(e,t){return e.ignoreCase&&t?t.toLowerCase():t}Object.defineProperty(t,"__esModule",{value:!0}),t.stateExists=t.findRules=t.substituteMatches=t.createError=t.log=t.sanitize=t.fixCase=t.empty=t.isIAction=t.isString=t.isFuzzyAction=t.isFuzzyActionArr=void 0,t.isFuzzyActionArr=i,t.isFuzzyAction=function(e){return!i(e)},t.isString=n,t.isIAction=function(e){return!n(e)},t.empty=o,t.fixCase=s,t.sanitize=function(e){return e.replace(/[&<>'"_]/g,"-")},t.log=function(e,t){console.log(`${e.languageId}: ${t}`)},t.createError=function(e,t){return new Error(`${e.languageId}: ${t}`)},t.substituteMatches=function(e,t,i,n,r){let a=null;return t.replace(/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g,(function(t,l,d,c,h,u,g,p,m){ +return o(d)?o(c)?!o(h)&&h0;){const t=e.tokenizer[i];if(t)return t;const n=i.lastIndexOf(".");i=n<0?null:i.substr(0,n)}return null},t.stateExists=function(e,t){let i=t;for(;i&&i.length>0;){if(e.stateNames[i])return!0;const t=i.lastIndexOf(".");i=t<0?null:i.substr(0,t)}return!1}})),define(t[406],i([0,1,224]),(function(e,t,i){"use strict";function n(e,t){return"boolean"==typeof e?e:t}function o(e,t){return"string"==typeof e?e:t}function s(e,t=!1){t&&(e=e.map((function(e){return e.toLowerCase()})));const i=function(e){const t={};for(const i of e)t[i]=!0;return t}(e);return t?function(e){return void 0!==i[e.toLowerCase()]&&i.hasOwnProperty(e.toLowerCase())}:function(e){return void 0!==i[e]&&i.hasOwnProperty(e)}}function r(e,t){let n=0;for(;t.indexOf("@")>=0&&n<5;)n++,t=t.replace(/@(\w+)/g,(function(n,o){let s="" +;if("string"==typeof e[o])s=e[o];else{if(!(e[o]&&e[o]instanceof RegExp))throw void 0===e[o]?i.createError(e,"language definition does not contain attribute '"+o+"', used at: "+t):i.createError(e,"attribute reference '"+o+"' must be a string, used at: "+t);s=e[o].source}return i.empty(s)?"":"(?:"+s+")"}));let o=(e.ignoreCase?"i":"")+(e.unicode?"u":"");return new RegExp(t,o)}function a(e,t,n,o){let a=-1,l=n,d=n.match(/^\$(([sS]?)(\d\d?)|#)(.*)$/);d&&(d[3]&&(a=parseInt(d[3]),d[2]&&(a+=100)),l=d[4]);let c,h="~",u=l;if(l&&0!==l.length?/^\w*$/.test(u)?h="==":(d=l.match(/^(@|!@|~|!~|==|!=)(.*)$/))&&(h=d[1],u=d[2]):(h="!=",u=""),"~"!==h&&"!~"!==h||!/^(\w|\|)*$/.test(u))if("@"===h||"!@"===h){let n=e[u];if(!n)throw i.createError(e,"the @ match target '"+u+"' is not defined, in rule: "+t);if(!function(e,t){if(!t)return!1;if(!Array.isArray(t))return!1;for(const i of t)if(!e(i))return!1;return!0}((function(e){return"string"==typeof e +}),n))throw i.createError(e,"the @ match target '"+u+"' must be an array of strings, in rule: "+t);let o=s(n,e.ignoreCase);c=function(e){return"@"===h?o(e):!o(e)}}else if("~"===h||"!~"===h)if(u.indexOf("$")<0){let t=r(e,"^"+u+"$");c=function(e){return"~"===h?t.test(e):!t.test(e)}}else c=function(t,n,o,s){return r(e,"^"+i.substituteMatches(e,u,n,o,s)+"$").test(t)};else if(u.indexOf("$")<0){let t=i.fixCase(e,u);c=function(e){return"=="===h?e===t:e!==t}}else{let t=i.fixCase(e,u);c=function(n,o,s,r,a){let l=i.substituteMatches(e,t,o,s,r);return"=="===h?n===l:n!==l}}else{let t=s(u.split("|"),e.ignoreCase);c=function(e){return"~"===h?t(e):!t(e)}}return-1===a?{name:n,value:o,test:function(e,t,i,n){return c(e,e,t,i,n)}}:{name:n,value:o,test:function(e,t,i,n){let o=function(e,t,i,n){if(n<0)return e;if(n=100){n-=100;let e=i.split(".");if(e.unshift(i),n0&&"^"===n[0],this.name=this.name+": "+n,this.regex=r(e,"^(?:"+(this.matchOnlyAtLineStart?n.substr(1):n)+")")}setAction(e,t){this.action=function e(t,n,o){if(o){if("string"==typeof o)return o;if(o.token||""===o.token){if("string"!=typeof o.token)throw i.createError(t,"a 'token' attribute must be of type string, in rule: "+n);{let e={token:o.token};if(o.token.indexOf("$")>=0&&(e.tokenSubst=!0),"string"==typeof o.bracket)if("@open"===o.bracket)e.bracket=1;else{if("@close"!==o.bracket)throw i.createError(t,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+n);e.bracket=-1}if(o.next){ +if("string"!=typeof o.next)throw i.createError(t,"the next state must be a string value in rule: "+n);{let s=o.next;if(!/^(@pop|@push|@popall)$/.test(s)&&("@"===s[0]&&(s=s.substr(1)),s.indexOf("$")<0&&!i.stateExists(t,i.substituteMatches(t,s,"",[],""))))throw i.createError(t,"the next state '"+o.next+"' is not defined in rule: "+n);e.next=s}}return"number"==typeof o.goBack&&(e.goBack=o.goBack),"string"==typeof o.switchTo&&(e.switchTo=o.switchTo),"string"==typeof o.log&&(e.log=o.log),"string"==typeof o.nextEmbedded&&(e.nextEmbedded=o.nextEmbedded,t.usesEmbedded=!0),e}}if(Array.isArray(o)){let i=[];for(let s=0,r=o.length;s=1&&c.length<=3)if(t.setRegex(r,c[0]), +c.length>=3)if("string"==typeof c[1])t.setAction(r,{token:c[1],next:c[2]});else{if("object"!=typeof c[1])throw i.createError(s,"a next state as the last element of a rule can only be given if the action is either an object or a string, at: "+e);{const e=c[1];e.next=c[2],t.setAction(r,e)}}else t.setAction(r,c[1]);else{if(!c.regex)throw i.createError(s,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+e);c.name&&"string"==typeof c.name&&(t.name=c.name),c.matchOnlyAtStart&&(t.matchOnlyAtLineStart=n(c.matchOnlyAtLineStart,!1)),t.setRegex(r,c.regex),t.setAction(r,c.action)}o.push(t)}}}if(r.languageId=e,r.ignoreCase=s.ignoreCase,r.unicode=s.unicode,r.noThrow=s.noThrow,r.usesEmbedded=s.usesEmbedded,r.stateNames=t.tokenizer,r.defaultToken=s.defaultToken,!t.tokenizer||"object"!=typeof t.tokenizer)throw i.createError(s,"a language definition must define the 'tokenizer' attribute as an object");s.tokenizer=[];for(let e in t.tokenizer)if(t.tokenizer.hasOwnProperty(e)){ +s.start||(s.start=e);const i=t.tokenizer[e];s.tokenizer[e]=new Array,a("tokenizer."+e,s.tokenizer[e],i)}if(s.usesEmbedded=r.usesEmbedded,t.brackets){if(!Array.isArray(t.brackets))throw i.createError(s,"the 'brackets' attribute must be defined as an array")}else t.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];let d=[];for(let e of t.brackets){let t=e;if(t&&Array.isArray(t)&&3===t.length&&(t={token:t[2],open:t[0],close:t[1]}),t.open===t.close)throw i.createError(s,"open and close brackets in a 'brackets' attribute must be different: "+t.open+"\n hint: use the 'bracket' attribute if matching on equal brackets is required.");if("string"!=typeof t.open||"string"!=typeof t.token||"string"!=typeof t.close)throw i.createError(s,"every element in the 'brackets' array must be a '{open,close,token}' object or array");d.push({token:t.token+s.tokenPostfix, +open:i.fixCase(s,t.open),close:i.fixCase(s,t.close)})}return s.brackets=d,s.noThrow=!0,s}})),define(t[407],i([5,6]),(function(e,t){return e.create("vs/base/browser/ui/actionbar/actionViewItems",t)})),define(t[91],i([0,1,16,407,2,47,7,23,58,143,36,196]),(function(e,t,i,n,o,s,r,a,l,d,c){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActionViewItem=t.BaseActionViewItem=void 0;class h extends o.Disposable{constructor(e,t,i={}){super(),this.options=i,this._context=e||this,this._action=t,t instanceof s.Action&&this._register(t.onDidChange(e=>{this.element&&this.handleActionChangeEvent(e)}))}handleActionChangeEvent(e){void 0!==e.enabled&&this.updateEnabled(),void 0!==e.checked&&this.updateChecked(),void 0!==e.class&&this.updateClass(),void 0!==e.label&&(this.updateLabel(),this.updateTooltip()),void 0!==e.tooltip&&this.updateTooltip()}get actionRunner(){return this._actionRunner||(this._actionRunner=this._register(new s.ActionRunner)),this._actionRunner}set actionRunner(e){this._actionRunner=e} +getAction(){return this._action}isEnabled(){return this._action.enabled}setActionContext(e){this._context=e}render(e){const t=this.element=e;this._register(l.Gesture.addTarget(e));const n=this.options&&this.options.draggable;n&&(e.draggable=!0,c.isFirefox&&this._register(r.addDisposableListener(e,r.EventType.DRAG_START,e=>{var t;return null===(t=e.dataTransfer)||void 0===t?void 0:t.setData(d.DataTransfers.TEXT,this._action.label)}))),this._register(r.addDisposableListener(t,l.EventType.Tap,e=>this.onClick(e))),this._register(r.addDisposableListener(t,r.EventType.MOUSE_DOWN,e=>{n||r.EventHelper.stop(e,!0),this._action.enabled&&0===e.button&&r.addClass(t,"active")})),i.isMacintosh&&this._register(r.addDisposableListener(t,r.EventType.CONTEXT_MENU,e=>{0===e.button&&!0===e.ctrlKey&&this.onClick(e)})),this._register(r.addDisposableListener(t,r.EventType.CLICK,e=>{r.EventHelper.stop(e,!0),this.options&&this.options.isMenu||i.setImmediate(()=>this.onClick(e))})), +this._register(r.addDisposableListener(t,r.EventType.DBLCLICK,e=>{r.EventHelper.stop(e,!0)})),[r.EventType.MOUSE_UP,r.EventType.MOUSE_OUT].forEach(e=>{this._register(r.addDisposableListener(t,e,e=>{r.EventHelper.stop(e),r.removeClass(t,"active")}))})}onClick(e){var t;r.EventHelper.stop(e,!0);const i=a.isUndefinedOrNull(this._context)?(null===(t=this.options)||void 0===t?void 0:t.useEventAsContext)?e:void 0:this._context;this.actionRunner.run(this._action,i)}focus(){this.element&&(this.element.focus(),r.addClass(this.element,"focused"))}blur(){this.element&&(this.element.blur(),r.removeClass(this.element,"focused"))}updateEnabled(){}updateLabel(){}updateTooltip(){}updateClass(){}updateChecked(){}dispose(){this.element&&(r.removeNode(this.element),this.element=void 0),super.dispose()}}t.BaseActionViewItem=h;t.ActionViewItem=class extends h{constructor(e,t,i={}){super(e,t,i),this.options=i,this.options.icon=void 0!==i.icon&&i.icon,this.options.label=void 0===i.label||i.label,this.cssClass=""}render(e){ +super.render(e),this.element&&(this.label=r.append(this.element,r.$("a.action-label"))),this.label&&(this._action.id===s.Separator.ID?this.label.setAttribute("role","presentation"):this.options.isMenu?this.label.setAttribute("role","menuitem"):this.label.setAttribute("role","button")),this.options.label&&this.options.keybinding&&this.element&&(r.append(this.element,r.$("span.keybinding")).textContent=this.options.keybinding),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}focus(){super.focus(),this.label&&this.label.focus()}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this.getAction().label)}updateTooltip(){let e=null;this.getAction().tooltip?e=this.getAction().tooltip:!this.options.label&&this.getAction().label&&this.options.icon&&(e=this.getAction().label,this.options.keybinding&&(e=n.localize(0,null,e,this.options.keybinding))),e&&this.label&&(this.label.title=e)}updateClass(){ +this.cssClass&&this.label&&r.removeClasses(this.label,this.cssClass),this.options.icon?(this.cssClass=this.getAction().class,this.label&&(r.addClass(this.label,"codicon"),this.cssClass&&r.addClasses(this.label,this.cssClass)),this.updateEnabled()):this.label&&r.removeClass(this.label,"codicon")}updateEnabled(){this.getAction().enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),r.removeClass(this.label,"disabled"),this.label.tabIndex=0),this.element&&r.removeClass(this.element,"disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),r.addClass(this.label,"disabled"),r.removeTabIndexAndUpdateFocus(this.label)),this.element&&r.addClass(this.element,"disabled"))}updateChecked(){this.label&&(this.getAction().checked?r.addClass(this.label,"checked"):r.removeClass(this.label,"checked"))}}})),define(t[79],i([0,1,2,47,7,23,53,4,91,196]),(function(e,t,i,n,o,s,r,a,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActionBar=void 0;class d extends i.Disposable{ +constructor(e,t={}){var i,s,l;let d,c;switch(super(),this._onDidBlur=this._register(new a.Emitter),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new a.Emitter),this.onDidCancel=this._onDidCancel.event,this._onDidRun=this._register(new a.Emitter),this.onDidRun=this._onDidRun.event,this._onDidBeforeRun=this._register(new a.Emitter),this.onDidBeforeRun=this._onDidBeforeRun.event,this.options=t,this._context=null!==(i=t.context)&&void 0!==i?i:null,this._orientation=null!==(s=this.options.orientation)&&void 0!==s?s:0,this._triggerKeys=null!==(l=this.options.triggerKeys)&&void 0!==l?l:{keys:[3,10],keyDown:!1},this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new n.ActionRunner,this._register(this._actionRunner)),this._register(this._actionRunner.onDidRun(e=>this._onDidRun.fire(e))),this._register(this._actionRunner.onDidBeforeRun(e=>this._onDidBeforeRun.fire(e))),this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"), +this.domNode.className="monaco-action-bar",!1!==t.animated&&o.addClass(this.domNode,"animated"),this._orientation){case 0:d=15,c=17;break;case 1:d=17,c=15,this.domNode.className+=" reverse";break;case 2:d=16,c=18,this.domNode.className+=" vertical";break;case 3:d=18,c=16,this.domNode.className+=" vertical reverse"}this._register(o.addDisposableListener(this.domNode,o.EventType.KEY_DOWN,e=>{const t=new r.StandardKeyboardEvent(e);let i=!0;t.equals(d)?i=this.focusPrevious():t.equals(c)?i=this.focusNext():t.equals(9)?this._onDidCancel.fire():this.isTriggerKeyEvent(t)?this._triggerKeys.keyDown&&this.doTrigger(t):i=!1,i&&(t.preventDefault(),t.stopPropagation())})),this._register(o.addDisposableListener(this.domNode,o.EventType.KEY_UP,e=>{const t=new r.StandardKeyboardEvent(e);this.isTriggerKeyEvent(t)?(this._triggerKeys.keyDown||this.doTrigger(t),t.preventDefault(),t.stopPropagation()):(t.equals(2)||t.equals(1026))&&this.updateFocusedItem()})),this.focusTracker=this._register(o.trackFocus(this.domNode)), +this._register(this.focusTracker.onDidBlur(()=>{o.getActiveElement()!==this.domNode&&o.isAncestor(o.getActiveElement(),this.domNode)||(this._onDidBlur.fire(),this.focusedItem=void 0)})),this._register(this.focusTracker.onDidFocus(()=>this.updateFocusedItem())),this.actionsList=document.createElement("ul"),this.actionsList.className="actions-container",this.actionsList.setAttribute("role","toolbar"),this.options.ariaLabel&&this.actionsList.setAttribute("aria-label",this.options.ariaLabel),this.domNode.appendChild(this.actionsList),e.appendChild(this.domNode)}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach(i=>{t=t||e.equals(i)}),t}updateFocusedItem(){for(let e=0;et.setActionContext(e))}get actionRunner(){return this._actionRunner}set actionRunner(e){ +e&&(this._actionRunner=e,this.viewItems.forEach(t=>t.actionRunner=e))}getContainer(){return this.domNode}push(e,t={}){const i=Array.isArray(e)?e:[e];let n=s.isNumber(t.index)?t.index:null;i.forEach(e=>{const i=document.createElement("li");let s;i.className="action-item",i.setAttribute("role","presentation"),this.options.allowContextMenu||this._register(o.addDisposableListener(i,o.EventType.CONTEXT_MENU,e=>{o.EventHelper.stop(e,!0)})),this.options.actionViewItemProvider&&(s=this.options.actionViewItemProvider(e)),s||(s=new l.ActionViewItem(this.context,e,t)),s.actionRunner=this._actionRunner,s.setActionContext(this.context),s.render(i),null===n||n<0||n>=this.actionsList.children.length?(this.actionsList.appendChild(i),this.viewItems.push(s)):(this.actionsList.insertBefore(i,this.actionsList.children[n]),this.viewItems.splice(n,0,s),n++)}),this.focusedItem&&this.focus(this.focusedItem)}clear(){i.dispose(this.viewItems),this.viewItems=[],o.clearNode(this.actionsList)}focus(e){let t=!1,i=void 0 +;void 0===e?t=!0:"number"==typeof e?i=e:"boolean"==typeof e&&(t=e),t&&void 0===this.focusedItem?(this.focusedItem=-1,this.focusNext()):(void 0!==i&&(this.focusedItem=i),this.updateFocus())}focusNext(){void 0===this.focusedItem&&(this.focusedItem=this.viewItems.length-1);const e=this.focusedItem;let t;do{if(this.options.preventLoopNavigation&&this.focusedItem+1>=this.viewItems.length)return this.focusedItem=e,!1;this.focusedItem=(this.focusedItem+1)%this.viewItems.length,t=this.viewItems[this.focusedItem]}while(this.focusedItem!==e&&!t.isEnabled());return this.focusedItem!==e||t.isEnabled()||(this.focusedItem=void 0),this.updateFocus(),!0}focusPrevious(){void 0===this.focusedItem&&(this.focusedItem=0);const e=this.focusedItem;let t;do{if(this.focusedItem=this.focusedItem-1,this.focusedItem<0){if(this.options.preventLoopNavigation)return this.focusedItem=e,!1;this.focusedItem=this.viewItems.length-1}t=this.viewItems[this.focusedItem]}while(this.focusedItem!==e&&!t.isEnabled()) +;return this.focusedItem!==e||t.isEnabled()||(this.focusedItem=void 0),this.updateFocus(!0),!0}updateFocus(e,t){void 0===this.focusedItem&&this.actionsList.focus({preventScroll:t});for(let i=0;i{this.element=i.append(e,i.$("a.action-label"));const t=this.options.classNames?r.asArray(this.options.classNames):[];return t.find(e=>"icon"===e)||t.push("codicon"),i.addClasses(this.element,...t),this.element.tabIndex=0,this.element.setAttribute("role","button"),this.element.setAttribute("aria-haspopup","true"),this.element.setAttribute("aria-expanded","false"),this.element.title=this._action.label||"",null},menuAsChild:this.options.menuAsChild};if(Array.isArray(this.menuActionsOrProvider)?t.actions=this.menuActionsOrProvider:t.actionProvider=this.menuActionsOrProvider,this.dropdownMenu=this._register(new s.DropdownMenu(e,t)),this._register(this.dropdownMenu.onDidChangeVisibility(e=>{var t +;null===(t=this.element)||void 0===t||t.setAttribute("aria-expanded",`${e}`),this._onDidChangeVisibility.fire(e)})),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){const e=this;this.dropdownMenu.menuOptions=Object.assign(Object.assign({},this.dropdownMenu.menuOptions),{get anchorAlignment(){return e.options.anchorAlignmentProvider()}})}}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}}t.DropdownMenuActionViewItem=a})),define(t[409],i([5,6]),(function(e,t){return e.create("vs/base/browser/ui/findinput/findInput",t)})),define(t[410],i([5,6]),(function(e,t){return e.create("vs/base/browser/ui/findinput/findInputCheckboxes",t)})),define(t[225],i([0,1,152,410,26]),(function(e,t,i,n,o){"use strict" +;Object.defineProperty(t,"__esModule",{value:!0}),t.RegexCheckbox=t.WholeWordsCheckbox=t.CaseSensitiveCheckbox=void 0;const s=n.localize(0,null),r=n.localize(1,null),a=n.localize(2,null);class l extends i.Checkbox{constructor(e){super({icon:o.Codicon.caseSensitive,title:s+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}t.CaseSensitiveCheckbox=l;class d extends i.Checkbox{constructor(e){super({icon:o.Codicon.wholeWord,title:r+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}t.WholeWordsCheckbox=d;class c extends i.Checkbox{constructor(e){super({icon:o.Codicon.regex,title:a+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder, +inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}t.RegexCheckbox=c})),define(t[411],i([5,6]),(function(e,t){return e.create("vs/base/browser/ui/findinput/replaceInput",t)})),define(t[412],i([5,6]),(function(e,t){return e.create("vs/base/browser/ui/inputbox/inputBox",t)})),define(t[167],i([0,1,412,7,148,48,79,4,54,29,37,270,65,57,294]),(function(e,t,i,n,o,s,r,a,l,d,c,h,u,g){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HistoryInputBox=t.InputBox=void 0;const p=n.$,m={inputBackground:d.Color.fromHex("#3C3C3C"),inputForeground:d.Color.fromHex("#CCCCCC"),inputValidationInfoBorder:d.Color.fromHex("#55AAFF"),inputValidationInfoBackground:d.Color.fromHex("#063B49"),inputValidationWarningBorder:d.Color.fromHex("#B89500"),inputValidationWarningBackground:d.Color.fromHex("#352A05"),inputValidationErrorBorder:d.Color.fromHex("#BE1100"),inputValidationErrorBackground:d.Color.fromHex("#5A1D1D")};class f extends l.Widget{ +constructor(e,t,i){super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new a.Emitter),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new a.Emitter),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=t,this.options=i||Object.create(null),c.mixin(this.options,m,!1),this.message=null,this.placeholder=this.options.placeholder||"",this.ariaLabel=this.options.ariaLabel||"",this.inputBackground=this.options.inputBackground,this.inputForeground=this.options.inputForeground,this.inputBorder=this.options.inputBorder,this.inputValidationInfoBorder=this.options.inputValidationInfoBorder,this.inputValidationInfoBackground=this.options.inputValidationInfoBackground,this.inputValidationInfoForeground=this.options.inputValidationInfoForeground,this.inputValidationWarningBorder=this.options.inputValidationWarningBorder,this.inputValidationWarningBackground=this.options.inputValidationWarningBackground, +this.inputValidationWarningForeground=this.options.inputValidationWarningForeground,this.inputValidationErrorBorder=this.options.inputValidationErrorBorder,this.inputValidationErrorBackground=this.options.inputValidationErrorBackground,this.inputValidationErrorForeground=this.options.inputValidationErrorForeground,this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=n.append(e,p(".monaco-inputbox.idle"));let o=this.options.flexibleHeight?"textarea":"input",s=n.append(this.element,p(".wrapper"));if(this.input=n.append(s,p(o+".input.empty")),this.input.setAttribute("autocorrect","off"),this.input.setAttribute("autocapitalize","off"),this.input.setAttribute("spellcheck","false"),this.onfocus(this.input,()=>this.element.classList.add("synthetic-focus")),this.onblur(this.input,()=>this.element.classList.remove("synthetic-focus")),this.options.flexibleHeight){ +this.maxHeight="number"==typeof this.options.flexibleMaxHeight?this.options.flexibleMaxHeight:Number.POSITIVE_INFINITY,this.mirror=n.append(s,p("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new u.ScrollableElement(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),n.append(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(e=>this.input.scrollTop=e.scrollTop));const t=a.Event.filter(g.domEvent(document,"selectionchange"),()=>{const e=document.getSelection();return(null==e?void 0:e.anchorNode)===s});this._register(t(this.updateScrollDimensions,this)),this._register(this.onDidHeightChange(this.updateScrollDimensions,this))}else this.input.type=this.options.type||"text",this.input.setAttribute("wrap","off");this.ariaLabel&&this.input.setAttribute("aria-label",this.ariaLabel), +this.placeholder&&this.setPlaceHolder(this.placeholder),this.oninput(this.input,()=>this.onValueChange()),this.onblur(this.input,()=>this.onBlur()),this.onfocus(this.input,()=>this.onFocus()),this.ignoreGesture(this.input),setTimeout(()=>this.updateMirror(),0),this.options.actions&&(this.actionbar=this._register(new r.ActionBar(this.element)),this.actionbar.push(this.options.actions,{icon:!0,label:!1})),this.applyStyles()}onBlur(){this._hideMessage()}onFocus(){this._showMessage()}setPlaceHolder(e){this.placeholder=e,this.input.setAttribute("placeholder",e),this.input.title=e}setAriaLabel(e){this.ariaLabel=e,e?this.input.setAttribute("aria-label",this.ariaLabel):this.input.removeAttribute("aria-label")}getAriaLabel(){return this.ariaLabel}get inputElement(){return this.input}get value(){return this.input.value}set value(e){this.input.value!==e&&(this.input.value=e,this.onValueChange())}get height(){return"number"==typeof this.cachedHeight?this.cachedHeight:n.getTotalHeight(this.element)}focus(){ +this.input.focus()}blur(){this.input.blur()}hasFocus(){return document.activeElement===this.input}select(e=null){this.input.select(),e&&this.input.setSelectionRange(e.start,e.end)}isSelectionAtEnd(){return this.input.selectionEnd===this.input.value.length&&this.input.selectionStart===this.input.selectionEnd}enable(){this.input.removeAttribute("disabled")}disable(){this.blur(),this.input.disabled=!0,this._hideMessage()}get width(){return n.getTotalWidth(this.input)}set width(e){if(this.options.flexibleHeight&&this.options.flexibleWidth){let t=0;if(this.mirror){t=(parseFloat(this.mirror.style.paddingLeft||"")||0)+(parseFloat(this.mirror.style.paddingRight||"")||0)}this.input.style.width=e-t+"px"}else this.input.style.width=e+"px";this.mirror&&(this.mirror.style.width=e+"px")}set paddingRight(e){this.options.flexibleHeight&&this.options.flexibleWidth?this.input.style.width=`calc(100% - ${e}px)`:this.input.style.paddingRight=e+"px",this.mirror&&(this.mirror.style.paddingRight=e+"px")}updateScrollDimensions(){ +if("number"!=typeof this.cachedContentHeight||"number"!=typeof this.cachedHeight||!this.scrollableElement)return;const e=this.cachedContentHeight,t=this.cachedHeight,i=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:e,height:t}),this.scrollableElement.setScrollPosition({scrollTop:i})}showMessage(e,t){this.message=e,this.element.classList.remove("idle"),this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add(this.classForType(e.type));const i=this.stylesForType(this.message.type);this.element.style.border=i.border?`1px solid ${i.border}`:"",(this.hasFocus()||t)&&this._showMessage()}hideMessage(){this.message=null,this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add("idle"),this._hideMessage(),this.applyStyles()}validate(){let e=null +;return this.validation&&((e=this.validation(this.value))?(this.inputElement.setAttribute("aria-invalid","true"),this.showMessage(e)):this.inputElement.hasAttribute("aria-invalid")&&(this.inputElement.removeAttribute("aria-invalid"),this.hideMessage())),!e}stylesForType(e){switch(e){case 1:return{border:this.inputValidationInfoBorder,background:this.inputValidationInfoBackground,foreground:this.inputValidationInfoForeground};case 2:return{border:this.inputValidationWarningBorder,background:this.inputValidationWarningBackground,foreground:this.inputValidationWarningForeground};default:return{border:this.inputValidationErrorBorder,background:this.inputValidationErrorBackground,foreground:this.inputValidationErrorForeground}}}classForType(e){switch(e){case 1:return"info";case 2:return"warning";default:return"error"}}_showMessage(){if(!this.contextViewProvider||!this.message)return;let e,t,r=()=>e.style.width=n.getTotalWidth(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element, +anchorAlignment:1,render:t=>{if(!this.message)return null;e=n.append(t,p(".monaco-inputbox-container")),r();const i={inline:!0,className:"monaco-inputbox-message"},s=this.message.formatContent?o.renderFormattedText(this.message.content,i):o.renderText(this.message.content,i);s.classList.add(this.classForType(this.message.type));const a=this.stylesForType(this.message.type);return s.style.backgroundColor=a.background?a.background.toString():"",s.style.color=a.foreground?a.foreground.toString():"",s.style.border=a.border?`1px solid ${a.border}`:"",n.append(e,s),null},onHide:()=>{this.state="closed"},layout:r}),t=3===this.message.type?i.localize(0,null,this.message.content):2===this.message.type?i.localize(1,null,this.message.content):i.localize(2,null,this.message.content),s.alert(t),this.state="open"}_hideMessage(){this.contextViewProvider&&("open"===this.state&&this.contextViewProvider.hideContextView(),this.state="idle")}onValueChange(){this._onDidChange.fire(this.value),this.validate(),this.updateMirror(), +this.input.classList.toggle("empty",!this.value),"open"===this.state&&this.contextViewProvider&&this.contextViewProvider.layout()}updateMirror(){if(!this.mirror)return;const e=this.value,t=10===e.charCodeAt(e.length-1)?" ":"";e+t?this.mirror.textContent=e+t:this.mirror.innerText=" ",this.layout()}style(e){this.inputBackground=e.inputBackground,this.inputForeground=e.inputForeground,this.inputBorder=e.inputBorder,this.inputValidationInfoBackground=e.inputValidationInfoBackground,this.inputValidationInfoForeground=e.inputValidationInfoForeground,this.inputValidationInfoBorder=e.inputValidationInfoBorder,this.inputValidationWarningBackground=e.inputValidationWarningBackground,this.inputValidationWarningForeground=e.inputValidationWarningForeground,this.inputValidationWarningBorder=e.inputValidationWarningBorder,this.inputValidationErrorBackground=e.inputValidationErrorBackground,this.inputValidationErrorForeground=e.inputValidationErrorForeground,this.inputValidationErrorBorder=e.inputValidationErrorBorder, +this.applyStyles()}applyStyles(){const e=this.inputBackground?this.inputBackground.toString():"",t=this.inputForeground?this.inputForeground.toString():"",i=this.inputBorder?this.inputBorder.toString():"";this.element.style.backgroundColor=e,this.element.style.color=t,this.input.style.backgroundColor="inherit",this.input.style.color=t,this.element.style.borderWidth=i?"1px":"",this.element.style.borderStyle=i?"solid":"",this.element.style.borderColor=i}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=n.getTotalHeight(this.mirror),e!==this.cachedContentHeight&&(this.cachedHeight=Math.min(this.cachedContentHeight,this.maxHeight),this.input.style.height=this.cachedHeight+"px",this._onDidHeightChange.fire(this.cachedContentHeight))}insertAtCursor(e){const t=this.inputElement,i=t.selectionStart,n=t.selectionEnd,o=t.value;null!==i&&null!==n&&(this.value=o.substr(0,i)+e+o.substr(n),t.setSelectionRange(i+1,i+1),this.layout())}dispose(){this._hideMessage(),this.message=null, +this.actionbar&&this.actionbar.dispose(),super.dispose()}}t.InputBox=f;t.HistoryInputBox=class extends f{constructor(e,t,i){super(e,t,i),this.history=new h.HistoryNavigator(i.history,100)}addToHistory(){this.value&&this.value!==this.getCurrentValue()&&this.history.add(this.value)}showNextValue(){this.history.has(this.value)||this.addToHistory();let e=this.getNextValue();e&&(e=e===this.value?this.getNextValue():e),e&&(this.value=e,s.status(this.value))}showPreviousValue(){this.history.has(this.value)||this.addToHistory();let e=this.getPreviousValue();e&&(e=e===this.value?this.getPreviousValue():e),e&&(this.value=e,s.status(this.value))}getCurrentValue(){let e=this.history.current();return e||(e=this.history.last(),this.history.next()),e}getPreviousValue(){return this.history.previous()||this.history.first()}getNextValue(){return this.history.next()||this.history.last()}}})),define(t[413],i([0,1,409,7,167,54,4,225,200]),(function(e,t,i,n,o,s,r,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}), +t.FindInput=void 0;const l=i.localize(0,null);class d extends s.Widget{constructor(e,t,i,s){super(),this._showOptionButtons=i,this.fixFocusOnOptionClickEnabled=!0,this._onDidOptionChange=this._register(new r.Emitter),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new r.Emitter),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new r.Emitter),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new r.Emitter),this._onKeyUp=this._register(new r.Emitter),this._onCaseSensitiveKeyDown=this._register(new r.Emitter),this.onCaseSensitiveKeyDown=this._onCaseSensitiveKeyDown.event,this._onRegexKeyDown=this._register(new r.Emitter),this.onRegexKeyDown=this._onRegexKeyDown.event,this._lastHighlightFindOptions=0,this.contextViewProvider=t,this.placeholder=s.placeholder||"",this.validation=s.validation,this.label=s.label||l,this.inputActiveOptionBorder=s.inputActiveOptionBorder,this.inputActiveOptionForeground=s.inputActiveOptionForeground, +this.inputActiveOptionBackground=s.inputActiveOptionBackground,this.inputBackground=s.inputBackground,this.inputForeground=s.inputForeground,this.inputBorder=s.inputBorder,this.inputValidationInfoBorder=s.inputValidationInfoBorder,this.inputValidationInfoBackground=s.inputValidationInfoBackground,this.inputValidationInfoForeground=s.inputValidationInfoForeground,this.inputValidationWarningBorder=s.inputValidationWarningBorder,this.inputValidationWarningBackground=s.inputValidationWarningBackground,this.inputValidationWarningForeground=s.inputValidationWarningForeground,this.inputValidationErrorBorder=s.inputValidationErrorBorder,this.inputValidationErrorBackground=s.inputValidationErrorBackground,this.inputValidationErrorForeground=s.inputValidationErrorForeground;const d=s.appendCaseSensitiveLabel||"",c=s.appendWholeWordsLabel||"",h=s.appendRegexLabel||"",u=s.history||[],g=!!s.flexibleHeight,p=!!s.flexibleWidth,m=s.flexibleMaxHeight;this.domNode=document.createElement("div"), +n.addClass(this.domNode,"monaco-findInput"),this.inputBox=this._register(new o.HistoryInputBox(this.domNode,this.contextViewProvider,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation},inputBackground:this.inputBackground,inputForeground:this.inputForeground,inputBorder:this.inputBorder,inputValidationInfoBackground:this.inputValidationInfoBackground,inputValidationInfoForeground:this.inputValidationInfoForeground,inputValidationInfoBorder:this.inputValidationInfoBorder,inputValidationWarningBackground:this.inputValidationWarningBackground,inputValidationWarningForeground:this.inputValidationWarningForeground,inputValidationWarningBorder:this.inputValidationWarningBorder,inputValidationErrorBackground:this.inputValidationErrorBackground,inputValidationErrorForeground:this.inputValidationErrorForeground,inputValidationErrorBorder:this.inputValidationErrorBorder,history:u,flexibleHeight:g,flexibleWidth:p,flexibleMaxHeight:m})), +this.regex=this._register(new a.RegexCheckbox({appendTitle:h,isChecked:!1,inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground})),this._register(this.regex.onChange(e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.regex.onKeyDown(e=>{this._onRegexKeyDown.fire(e)})),this.wholeWords=this._register(new a.WholeWordsCheckbox({appendTitle:c,isChecked:!1,inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground})),this._register(this.wholeWords.onChange(e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this.caseSensitive=this._register(new a.CaseSensitiveCheckbox({appendTitle:d,isChecked:!1, +inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground})),this._register(this.caseSensitive.onChange(e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.caseSensitive.onKeyDown(e=>{this._onCaseSensitiveKeyDown.fire(e)})),this._showOptionButtons&&(this.inputBox.paddingRight=this.caseSensitive.width()+this.wholeWords.width()+this.regex.width());let f=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,e=>{if(e.equals(15)||e.equals(17)||e.equals(9)){let t=f.indexOf(document.activeElement);if(t>=0){let i=-1;e.equals(17)?i=(t+1)%f.length:e.equals(15)&&(i=0===t?f.length-1:t-1),e.equals(9)?f[t].blur():i>=0&&f[i].focus(),n.EventHelper.stop(e,!0)}}});let _=document.createElement("div");_.className="controls",_.style.display=this._showOptionButtons?"block":"none", +_.appendChild(this.caseSensitive.domNode),_.appendChild(this.wholeWords.domNode),_.appendChild(this.regex.domNode),this.domNode.appendChild(_),e&&e.appendChild(this.domNode),this.onkeydown(this.inputBox.inputElement,e=>this._onKeyDown.fire(e)),this.onkeyup(this.inputBox.inputElement,e=>this._onKeyUp.fire(e)),this.oninput(this.inputBox.inputElement,e=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,e=>this._onMouseDown.fire(e))}enable(){n.removeClass(this.domNode,"disabled"),this.inputBox.enable(),this.regex.enable(),this.wholeWords.enable(),this.caseSensitive.enable()}disable(){n.addClass(this.domNode,"disabled"),this.inputBox.disable(),this.regex.disable(),this.wholeWords.disable(),this.caseSensitive.disable()}setFocusInputOnOptionClick(e){this.fixFocusOnOptionClickEnabled=e}setEnabled(e){e?this.enable():this.disable()}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}style(e){this.inputActiveOptionBorder=e.inputActiveOptionBorder, +this.inputActiveOptionForeground=e.inputActiveOptionForeground,this.inputActiveOptionBackground=e.inputActiveOptionBackground,this.inputBackground=e.inputBackground,this.inputForeground=e.inputForeground,this.inputBorder=e.inputBorder,this.inputValidationInfoBackground=e.inputValidationInfoBackground,this.inputValidationInfoForeground=e.inputValidationInfoForeground,this.inputValidationInfoBorder=e.inputValidationInfoBorder,this.inputValidationWarningBackground=e.inputValidationWarningBackground,this.inputValidationWarningForeground=e.inputValidationWarningForeground,this.inputValidationWarningBorder=e.inputValidationWarningBorder,this.inputValidationErrorBackground=e.inputValidationErrorBackground,this.inputValidationErrorForeground=e.inputValidationErrorForeground,this.inputValidationErrorBorder=e.inputValidationErrorBorder,this.applyStyles()}applyStyles(){if(this.domNode){const e={inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground, +inputActiveOptionBackground:this.inputActiveOptionBackground};this.regex.style(e),this.wholeWords.style(e),this.caseSensitive.style(e);const t={inputBackground:this.inputBackground,inputForeground:this.inputForeground,inputBorder:this.inputBorder,inputValidationInfoBackground:this.inputValidationInfoBackground,inputValidationInfoForeground:this.inputValidationInfoForeground,inputValidationInfoBorder:this.inputValidationInfoBorder,inputValidationWarningBackground:this.inputValidationWarningBackground,inputValidationWarningForeground:this.inputValidationWarningForeground,inputValidationWarningBorder:this.inputValidationWarningBorder,inputValidationErrorBackground:this.inputValidationErrorBackground,inputValidationErrorForeground:this.inputValidationErrorForeground,inputValidationErrorBorder:this.inputValidationErrorBorder};this.inputBox.style(t)}}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getCaseSensitive(){return this.caseSensitive.checked}setCaseSensitive(e){this.caseSensitive.checked=e} +getWholeWords(){return this.wholeWords.checked}setWholeWords(e){this.wholeWords.checked=e}getRegex(){return this.regex.checked}setRegex(e){this.regex.checked=e,this.validate()}focusOnCaseSensitive(){this.caseSensitive.focus()}highlightFindOptions(){n.removeClass(this.domNode,"highlight-"+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,n.addClass(this.domNode,"highlight-"+this._lastHighlightFindOptions)}validate(){this.inputBox.validate()}clearMessage(){this.inputBox.hideMessage()}}t.FindInput=d})),define(t[414],i([0,1,411,7,167,54,4,152,26,200]),(function(e,t,i,n,o,s,r,a,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ReplaceInput=t.PreserveCaseCheckbox=void 0;const d=i.localize(0,null),c=i.localize(1,null);class h extends a.Checkbox{constructor(e){super({icon:l.Codicon.preserveCase,title:c+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground, +inputActiveOptionBackground:e.inputActiveOptionBackground})}}t.PreserveCaseCheckbox=h;class u extends s.Widget{constructor(e,t,i,s){super(),this._showOptionButtons=i,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,this._onDidOptionChange=this._register(new r.Emitter),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new r.Emitter),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new r.Emitter),this._onInput=this._register(new r.Emitter),this._onKeyUp=this._register(new r.Emitter),this._onPreserveCaseKeyDown=this._register(new r.Emitter),this.onPreserveCaseKeyDown=this._onPreserveCaseKeyDown.event,this.contextViewProvider=t,this.placeholder=s.placeholder||"",this.validation=s.validation,this.label=s.label||d,this.inputActiveOptionBorder=s.inputActiveOptionBorder,this.inputActiveOptionForeground=s.inputActiveOptionForeground,this.inputActiveOptionBackground=s.inputActiveOptionBackground,this.inputBackground=s.inputBackground, +this.inputForeground=s.inputForeground,this.inputBorder=s.inputBorder,this.inputValidationInfoBorder=s.inputValidationInfoBorder,this.inputValidationInfoBackground=s.inputValidationInfoBackground,this.inputValidationInfoForeground=s.inputValidationInfoForeground,this.inputValidationWarningBorder=s.inputValidationWarningBorder,this.inputValidationWarningBackground=s.inputValidationWarningBackground,this.inputValidationWarningForeground=s.inputValidationWarningForeground,this.inputValidationErrorBorder=s.inputValidationErrorBorder,this.inputValidationErrorBackground=s.inputValidationErrorBackground,this.inputValidationErrorForeground=s.inputValidationErrorForeground;const a=s.history||[],l=!!s.flexibleHeight,c=!!s.flexibleWidth,u=s.flexibleMaxHeight;this.domNode=document.createElement("div"),n.addClass(this.domNode,"monaco-findInput"),this.inputBox=this._register(new o.HistoryInputBox(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{ +validation:this.validation},inputBackground:this.inputBackground,inputForeground:this.inputForeground,inputBorder:this.inputBorder,inputValidationInfoBackground:this.inputValidationInfoBackground,inputValidationInfoForeground:this.inputValidationInfoForeground,inputValidationInfoBorder:this.inputValidationInfoBorder,inputValidationWarningBackground:this.inputValidationWarningBackground,inputValidationWarningForeground:this.inputValidationWarningForeground,inputValidationWarningBorder:this.inputValidationWarningBorder,inputValidationErrorBackground:this.inputValidationErrorBackground,inputValidationErrorForeground:this.inputValidationErrorForeground,inputValidationErrorBorder:this.inputValidationErrorBorder,history:a,flexibleHeight:l,flexibleWidth:c,flexibleMaxHeight:u})),this.preserveCase=this._register(new h({appendTitle:"",isChecked:!1,inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground +})),this._register(this.preserveCase.onChange(e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.preserveCase.onKeyDown(e=>{this._onPreserveCaseKeyDown.fire(e)})),this._showOptionButtons?this.cachedOptionsWidth=this.preserveCase.width():this.cachedOptionsWidth=0;let g=[this.preserveCase.domNode];this.onkeydown(this.domNode,e=>{if(e.equals(15)||e.equals(17)||e.equals(9)){let t=g.indexOf(document.activeElement);if(t>=0){let i=-1;e.equals(17)?i=(t+1)%g.length:e.equals(15)&&(i=0===t?g.length-1:t-1),e.equals(9)?g[t].blur():i>=0&&g[i].focus(),n.EventHelper.stop(e,!0)}}});let p=document.createElement("div");p.className="controls",p.style.display=this._showOptionButtons?"block":"none",p.appendChild(this.preserveCase.domNode),this.domNode.appendChild(p),e&&e.appendChild(this.domNode),this.onkeydown(this.inputBox.inputElement,e=>this._onKeyDown.fire(e)),this.onkeyup(this.inputBox.inputElement,e=>this._onKeyUp.fire(e)), +this.oninput(this.inputBox.inputElement,e=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,e=>this._onMouseDown.fire(e))}enable(){n.removeClass(this.domNode,"disabled"),this.inputBox.enable(),this.preserveCase.enable()}disable(){n.addClass(this.domNode,"disabled"),this.inputBox.disable(),this.preserveCase.disable()}setEnabled(e){e?this.enable():this.disable()}style(e){this.inputActiveOptionBorder=e.inputActiveOptionBorder,this.inputActiveOptionForeground=e.inputActiveOptionForeground,this.inputActiveOptionBackground=e.inputActiveOptionBackground,this.inputBackground=e.inputBackground,this.inputForeground=e.inputForeground,this.inputBorder=e.inputBorder,this.inputValidationInfoBackground=e.inputValidationInfoBackground,this.inputValidationInfoForeground=e.inputValidationInfoForeground,this.inputValidationInfoBorder=e.inputValidationInfoBorder,this.inputValidationWarningBackground=e.inputValidationWarningBackground,this.inputValidationWarningForeground=e.inputValidationWarningForeground, +this.inputValidationWarningBorder=e.inputValidationWarningBorder,this.inputValidationErrorBackground=e.inputValidationErrorBackground,this.inputValidationErrorForeground=e.inputValidationErrorForeground,this.inputValidationErrorBorder=e.inputValidationErrorBorder,this.applyStyles()}applyStyles(){if(this.domNode){const e={inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground};this.preserveCase.style(e);const t={inputBackground:this.inputBackground,inputForeground:this.inputForeground,inputBorder:this.inputBorder,inputValidationInfoBackground:this.inputValidationInfoBackground,inputValidationInfoForeground:this.inputValidationInfoForeground,inputValidationInfoBorder:this.inputValidationInfoBorder,inputValidationWarningBackground:this.inputValidationWarningBackground,inputValidationWarningForeground:this.inputValidationWarningForeground, +inputValidationWarningBorder:this.inputValidationWarningBorder,inputValidationErrorBackground:this.inputValidationErrorBackground,inputValidationErrorForeground:this.inputValidationErrorForeground,inputValidationErrorBorder:this.inputValidationErrorBorder};this.inputBox.style(t)}}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getPreserveCase(){return this.preserveCase.checked}setPreserveCase(e){this.preserveCase.checked=e}focusOnPreserve(){this.preserveCase.focus()}validate(){this.inputBox&&this.inputBox.validate()}set width(e){this.inputBox.paddingRight=this.cachedOptionsWidth,this.inputBox.width=e,this.domNode.style.width=e+"px"}dispose(){super.dispose()}}t.ReplaceInput=u})),define(t[415],i([0,1,7,167,2,53,77,51,119]),(function(e,t,i,n,o,s,r,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QuickInputBox=void 0;const l=i.$;class d extends o.Disposable{constructor(e){super(),this.parent=e, +this.onKeyDown=e=>i.addDisposableListener(this.inputBox.inputElement,i.EventType.KEY_DOWN,t=>{e(new s.StandardKeyboardEvent(t))}),this.onMouseDown=e=>i.addDisposableListener(this.inputBox.inputElement,i.EventType.MOUSE_DOWN,t=>{e(new a.StandardMouseEvent(t))}),this.onDidChange=e=>this.inputBox.onDidChange(e),this.container=i.append(this.parent,l(".quick-input-box")),this.inputBox=this._register(new n.InputBox(this.container,void 0))}get value(){return this.inputBox.value}set value(e){this.inputBox.value=e}select(e=null){this.inputBox.select(e)}isSelectionAtEnd(){return this.inputBox.isSelectionAtEnd()}get placeholder(){return this.inputBox.inputElement.getAttribute("placeholder")||""}set placeholder(e){this.inputBox.setPlaceHolder(e)}get ariaLabel(){return this.inputBox.getAriaLabel()}set ariaLabel(e){this.inputBox.setAriaLabel(e)}get password(){return"password"===this.inputBox.inputElement.type}set password(e){this.inputBox.inputElement.type=e?"password":"text"}setAttribute(e,t){ +this.inputBox.inputElement.setAttribute(e,t)}removeAttribute(e){this.inputBox.inputElement.removeAttribute(e)}showDecoration(e){e===r.default.Ignore?this.inputBox.hideMessage():this.inputBox.showMessage({type:e===r.default.Info?1:e===r.default.Warning?2:3,content:""})}stylesForType(e){return this.inputBox.stylesForType(e===r.default.Info?1:e===r.default.Warning?2:3)}setFocus(){this.inputBox.focus()}layout(){this.inputBox.layout()}style(e){this.inputBox.style(e)}}t.QuickInputBox=d})),define(t[416],i([5,6]),(function(e,t){return e.create("vs/base/browser/ui/keybindingLabel/keybindingLabel",t)})),define(t[417],i([5,6]),(function(e,t){return e.create("vs/base/browser/ui/menu/menu",t)})),define(t[418],i([0,1,417,8,47,79,7,53,15,2,65,197,16,26,91,115,36,51]),(function(e,t,i,n,o,s,r,a,l,d,c,h,u,g,p,m,f,_){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cleanMnemonic=t.Menu=t.Direction=t.MENU_ESCAPED_MNEMONIC_REGEX=t.MENU_MNEMONIC_REGEX=void 0,t.MENU_MNEMONIC_REGEX=/\(&([^\s&])\)|(^|[^&])&([^\s&])/, +t.MENU_ESCAPED_MNEMONIC_REGEX=/(&)?(&)([^\s&])/g;const v=g.registerIcon("menu-selection",g.Codicon.check),C=g.registerIcon("menu-submenu",g.Codicon.chevronRight);var b;!function(e){e[e.Right=0]="Right",e[e.Left=1]="Left"}(b=t.Direction||(t.Direction={}));class S extends s.ActionBar{constructor(e,t,i={}){r.addClass(e,"monaco-menu-container"),e.setAttribute("role","presentation");const n=document.createElement("div");r.addClass(n,"monaco-menu"),n.setAttribute("role","presentation"),super(n,{orientation:2,actionViewItemProvider:e=>this.doGetActionViewItem(e,i,o),context:i.context,actionRunner:i.actionRunner,ariaLabel:i.ariaLabel,triggerKeys:{keys:[3,...u.isMacintosh||u.isLinux?[10]:[]],keyDown:!0}}),this.menuElement=n,this.actionsList.setAttribute("role","menu"),this.actionsList.tabIndex=0,this.menuDisposables=this._register(new d.DisposableStore),this.initializeStyleSheet(e),r.addDisposableListener(n,r.EventType.KEY_DOWN,e=>{new a.StandardKeyboardEvent(e).equals(2)&&e.preventDefault()}), +i.enableMnemonics&&this.menuDisposables.add(r.addDisposableListener(n,r.EventType.KEY_DOWN,e=>{const t=e.key.toLocaleLowerCase();if(this.mnemonics.has(t)){r.EventHelper.stop(e,!0);const i=this.mnemonics.get(t);if(1===i.length&&(i[0]instanceof y&&i[0].container&&this.focusItemByElement(i[0].container),i[0].onClick(e)),i.length>1){const e=i.shift();e&&e.container&&(this.focusItemByElement(e.container),i.push(e)),this.mnemonics.set(t,i)}}})),u.isLinux&&this._register(r.addDisposableListener(n,r.EventType.KEY_DOWN,e=>{const t=new a.StandardKeyboardEvent(e);t.equals(14)||t.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),r.EventHelper.stop(e,!0)):(t.equals(13)||t.equals(12))&&(this.focusedItem=0,this.focusPrevious(),r.EventHelper.stop(e,!0))})),this._register(r.addDisposableListener(this.domNode,r.EventType.MOUSE_OUT,e=>{let t=e.relatedTarget;r.isAncestor(t,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),e.stopPropagation())})), +this._register(r.addDisposableListener(this.actionsList,r.EventType.MOUSE_OVER,e=>{let t=e.target;if(t&&r.isAncestor(t,this.actionsList)&&t!==this.actionsList){for(;t.parentElement!==this.actionsList&&null!==t.parentElement;)t=t.parentElement;if(r.hasClass(t,"action-item")){const e=this.focusedItem;this.setFocusedItem(t),e!==this.focusedItem&&this.updateFocus()}}}));let o={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new c.DomScrollableElement(n,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const s=this.scrollableElement.getDomNode();s.style.position="",this._register(r.addDisposableListener(s,r.EventType.MOUSE_UP,e=>{e.preventDefault()})),n.style.maxHeight=`${Math.max(10,window.innerHeight-e.getBoundingClientRect().top-35)}px`,t=t.filter(e=>{var t;return null===(t=i.submenuIds)||void 0===t||!t.has(e.id)||(console.warn(`Found submenu cycle: ${e.id}`),!1)}),this.push(t,{icon:!0,label:!0,isMenu:!0}), +e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter(e=>!(e instanceof E)).forEach((e,t,i)=>{e.updatePositionInSet(t+1,i.length)})}initializeStyleSheet(e){r.isInShadowDOM(e)?(this.styleSheet=r.createStyleSheet(e),this.styleSheet.innerHTML=x):(S.globalStyleSheet||(S.globalStyleSheet=r.createStyleSheet(),S.globalStyleSheet.innerHTML=x),this.styleSheet=S.globalStyleSheet)}style(e){const t=this.getContainer(),i=e.foregroundColor?`${e.foregroundColor}`:"",n=e.backgroundColor?`${e.backgroundColor}`:"",o=e.borderColor?`1px solid ${e.borderColor}`:"",s=e.shadowColor?`0 2px 4px ${e.shadowColor}`:"";t.style.border=o,this.domNode.style.color=i,this.domNode.style.backgroundColor=n,t.style.boxShadow=s,this.viewItems&&this.viewItems.forEach(t=>{(t instanceof w||t instanceof E)&&t.style(e)})}getContainer(){return this.scrollableElement.getDomNode()}get onScroll(){return this.scrollableElement.onScroll}focusItemByElement(e){const t=this.focusedItem +;this.setFocusedItem(e),t!==this.focusedItem&&this.updateFocus()}setFocusedItem(e){for(let t=0;t{this.element&&(this._register(r.addDisposableListener(this.element,r.EventType.MOUSE_UP,e=>{if(r.EventHelper.stop(e,!0),f.isFirefox){if(new _.StandardMouseEvent(e).rightButton)return;this.onClick(e)}setTimeout(()=>{this.onClick(e)},0)})),this._register(r.addDisposableListener(this.element,r.EventType.CONTEXT_MENU,e=>{r.EventHelper.stop(e,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e, +this.item=r.append(this.element,r.$("a.action-menu-item")),this._action.id===o.Separator.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=r.append(this.item,r.$("span.menu-item-check"+v.cssSelector)),this.check.setAttribute("role","none"),this.label=r.append(this.item,r.$("span.action-label")),this.options.label&&this.options.keybinding&&(r.append(this.item,r.$("span.keybinding")).textContent=this.options.keybinding),this.runOnceToEnableMouseUp.schedule(),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked())}blur(){super.blur(),this.applyStyle()}focus(){super.focus(),this.item&&this.item.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",`${e}`),this.item.setAttribute("aria-setsize",`${t}`))}updateLabel(){if(this.label&&this.options.label){r.clearNode(this.label) +;let e=g.stripCodicons(this.getAction().label);if(e){const i=L(e);this.options.enableMnemonics||(e=i),this.label.setAttribute("aria-label",i.replace(/&&/g,"&"));const o=t.MENU_MNEMONIC_REGEX.exec(e);if(o){e=n.escape(e),t.MENU_ESCAPED_MNEMONIC_REGEX.lastIndex=0;let i=t.MENU_ESCAPED_MNEMONIC_REGEX.exec(e);for(;i&&i[1];)i=t.MENU_ESCAPED_MNEMONIC_REGEX.exec(e);const s=e=>e.replace(/&&/g,"&");i?this.label.append(n.ltrim(s(e.substr(0,i.index))," "),r.$("u",{"aria-hidden":"true"},i[3]),n.rtrim(s(e.substr(i.index+i[0].length))," ")):this.label.innerText=s(e).trim(),this.item&&this.item.setAttribute("aria-keyshortcuts",(o[1]?o[1]:o[3]).toLocaleLowerCase())}else this.label.innerText=e.replace(/&&/g,"&").trim()}}}updateTooltip(){let e=null;this.getAction().tooltip?e=this.getAction().tooltip:!this.options.label&&this.getAction().label&&this.options.icon&&(e=this.getAction().label,this.options.keybinding&&(e=i.localize(0,null,e,this.options.keybinding))),e&&this.item&&(this.item.title=e)}updateClass(){ +this.cssClass&&this.item&&r.removeClasses(this.item,this.cssClass),this.options.icon&&this.label?(this.cssClass=this.getAction().class||"",r.addClass(this.label,"icon"),this.cssClass&&r.addClasses(this.label,this.cssClass),this.updateEnabled()):this.label&&r.removeClass(this.label,"icon")}updateEnabled(){this.getAction().enabled?(this.element&&r.removeClass(this.element,"disabled"),this.item&&(r.removeClass(this.item,"disabled"),this.item.tabIndex=0)):(this.element&&r.addClass(this.element,"disabled"),this.item&&(r.addClass(this.item,"disabled"),r.removeTabIndexAndUpdateFocus(this.item)))}updateChecked(){this.item&&(this.getAction().checked?(r.addClass(this.item,"checked"),this.item.setAttribute("role","menuitemcheckbox"),this.item.setAttribute("aria-checked","true")):(r.removeClass(this.item,"checked"),this.item.setAttribute("role","menuitem"),this.item.setAttribute("aria-checked","false")))}getMnemonic(){return this.mnemonic}applyStyle(){if(!this.menuStyle)return +;const e=this.element&&r.hasClass(this.element,"focused"),t=e&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor,i=e&&this.menuStyle.selectionBackgroundColor?this.menuStyle.selectionBackgroundColor:void 0,n=e&&this.menuStyle.selectionBorderColor?`thin solid ${this.menuStyle.selectionBorderColor}`:"";this.item&&(this.item.style.color=t?t.toString():"",this.item.style.backgroundColor=i?i.toString():""),this.check&&(this.check.style.color=t?t.toString():""),this.container&&(this.container.style.border=n)}style(e){this.menuStyle=e,this.applyStyle()}}class y extends w{constructor(e,t,i,n){super(e,e,n),this.submenuActions=t,this.parentData=i,this.submenuOptions=n,this.mysubmenu=null,this.submenuDisposables=this._register(new d.DisposableStore),this.mouseOver=!1,this.expandDirection=n&&void 0!==n.expandDirection?n.expandDirection:b.Right,this.showScheduler=new l.RunOnceScheduler(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1)) +},250),this.hideScheduler=new l.RunOnceScheduler(()=>{this.element&&!r.isAncestor(r.getActiveElement(),this.element)&&this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))},750)}render(e){super.render(e),this.element&&(this.item&&(r.addClass(this.item,"monaco-submenu-item"),this.item.setAttribute("aria-haspopup","true"),this.updateAriaExpanded("false"),this.submenuIndicator=r.append(this.item,r.$("span.submenu-indicator"+C.cssSelector)),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(r.addDisposableListener(this.element,r.EventType.KEY_UP,e=>{let t=new a.StandardKeyboardEvent(e);(t.equals(17)||t.equals(3))&&(r.EventHelper.stop(e,!0),this.createSubmenu(!0))})),this._register(r.addDisposableListener(this.element,r.EventType.KEY_DOWN,e=>{let t=new a.StandardKeyboardEvent(e);r.getActiveElement()===this.item&&(t.equals(17)||t.equals(3))&&r.EventHelper.stop(e,!0)})), +this._register(r.addDisposableListener(this.element,r.EventType.MOUSE_OVER,e=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(r.addDisposableListener(this.element,r.EventType.MOUSE_LEAVE,e=>{this.mouseOver=!1})),this._register(r.addDisposableListener(this.element,r.EventType.FOCUS_OUT,e=>{this.element&&!r.isAncestor(r.getActiveElement(),this.element)&&this.hideScheduler.schedule()})),this._register(this.parentData.parent.onScroll(()=>{this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!1)})))}onClick(e){r.EventHelper.stop(e,!0),this.cleanupExistingSubmenu(!1),this.createSubmenu(!0)}cleanupExistingSubmenu(e){if(this.parentData.submenu&&(e||this.parentData.submenu!==this.mysubmenu)){try{this.parentData.submenu.dispose()}catch(e){}this.parentData.submenu=void 0,this.updateAriaExpanded("false"),this.submenuContainer&&(this.submenuDisposables.clear(),this.submenuContainer=void 0)}}calculateSubmenuMenuLayout(e,t,i,n){const o={top:0,left:0} +;return o.left=h.layout(e.width,t.width,{position:n===b.Right?0:1,offset:i.left,size:i.width}),o.left>=i.left&&o.left{new a.StandardKeyboardEvent(e).equals(15)&&(r.EventHelper.stop(e,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(r.addDisposableListener(this.submenuContainer,r.EventType.KEY_DOWN,e=>{new a.StandardKeyboardEvent(e).equals(15)&&r.EventHelper.stop(e,!0)})),this.submenuDisposables.add(this.parentData.submenu.onDidCancel(()=>{this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0)})),this.parentData.submenu.focus(e), +this.mysubmenu=this.parentData.submenu}}updateAriaExpanded(e){var t;this.item&&(null===(t=this.item)||void 0===t||t.setAttribute("aria-expanded",e))}applyStyle(){if(super.applyStyle(),!this.menuStyle)return;const e=this.element&&r.hasClass(this.element,"focused")&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor;this.submenuIndicator&&(this.submenuIndicator.style.color=e?`${e}`:""),this.parentData.submenu&&this.parentData.submenu.style(this.menuStyle)}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}}class E extends p.ActionViewItem{style(e){this.label&&(this.label.style.borderBottomColor=e.separatorColor?`${e.separatorColor}`:"")}}function L(e){const i=t.MENU_MNEMONIC_REGEX,n=i.exec(e);if(!n)return e;const o=!n[1];return e.replace(i,o?"$2$3":"").trim()}t.cleanMnemonic=L +;let x=`\n.monaco-menu {\n\tfont-size: 13px;\n\n}\n\n${m.formatRule(v)}\n${m.formatRule(C)}\n\n.monaco-menu .monaco-action-bar {\n\ttext-align: right;\n\toverflow: hidden;\n\twhite-space: nowrap;\n}\n\n.monaco-menu .monaco-action-bar .actions-container {\n\tdisplay: flex;\n\tmargin: 0 auto;\n\tpadding: 0;\n\twidth: 100%;\n\tjustify-content: flex-end;\n}\n\n.monaco-menu .monaco-action-bar.vertical .actions-container {\n\tdisplay: inline-block;\n}\n\n.monaco-menu .monaco-action-bar.reverse .actions-container {\n\tflex-direction: row-reverse;\n}\n\n.monaco-menu .monaco-action-bar .action-item {\n\tcursor: pointer;\n\tdisplay: inline-block;\n\ttransition: transform 50ms ease;\n\tposition: relative; /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */\n}\n\n.monaco-menu .monaco-action-bar .action-item.disabled {\n\tcursor: default;\n}\n\n.monaco-menu .monaco-action-bar.animated .action-item.active {\n\ttransform: scale(1.272019649, 1.272019649); /* 1.272019649 = √φ */\n}\n\n.monaco-menu .monaco-action-bar .action-item .icon,\n.monaco-menu .monaco-action-bar .action-item .codicon {\n\tdisplay: inline-block;\n}\n\n.monaco-menu .monaco-action-bar .action-item .codicon {\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.monaco-menu .monaco-action-bar .action-label {\n\tfont-size: 11px;\n\tmargin-right: 4px;\n}\n\n.monaco-menu .monaco-action-bar .action-item.disabled .action-label,\n.monaco-menu .monaco-action-bar .action-item.disabled .action-label:hover {\n\topacity: 0.4;\n}\n\n/* Vertical actions */\n\n.monaco-menu .monaco-action-bar.vertical {\n\ttext-align: left;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tdisplay: block;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tdisplay: block;\n\tborder-bottom: 1px solid #bbb;\n\tpadding-top: 1px;\n\tmargin-left: .8em;\n\tmargin-right: .8em;\n}\n\n.monaco-menu .secondary-actions .monaco-action-bar .action-label {\n\tmargin-left: 6px;\n}\n\n/* Action Items */\n.monaco-menu .monaco-action-bar .action-item.select-container {\n\toverflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */\n\tflex: 1;\n\tmax-width: 170px;\n\tmin-width: 60px;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tmargin-right: 10px;\n}\n\n.monaco-menu .monaco-action-bar.vertical {\n\tmargin-left: 0;\n\toverflow: visible;\n}\n\n.monaco-menu .monaco-action-bar.vertical .actions-container {\n\tdisplay: block;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tpadding: 0;\n\ttransform: none;\n\tdisplay: flex;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item.active {\n\ttransform: none;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item {\n\tflex: 1 1 auto;\n\tdisplay: flex;\n\theight: 2em;\n\talign-items: center;\n\tposition: relative;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label {\n\tflex: 1 1 auto;\n\ttext-decoration: none;\n\tpadding: 0 1em;\n\tbackground: none;\n\tfont-size: 12px;\n\tline-height: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .keybinding,\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\tdisplay: inline-block;\n\tflex: 2 1 auto;\n\tpadding: 0 1em;\n\ttext-align: right;\n\tfont-size: 12px;\n\tline-height: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\theight: 100%;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon {\n\tfont-size: 16px !important;\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon::before {\n\tmargin-left: auto;\n\tmargin-right: -20px;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item.disabled .keybinding,\n.monaco-menu .monaco-action-bar.vertical .action-item.disabled .submenu-indicator {\n\topacity: 0.4;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator) {\n\tdisplay: inline-block;\n\tbox-sizing: border-box;\n\tmargin: 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tposition: static;\n\toverflow: visible;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item .monaco-submenu {\n\tposition: absolute;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tpadding: 0.5em 0 0 0;\n\tmargin-bottom: 0.5em;\n\twidth: 100%;\n\theight: 0px !important;\n\tmargin-left: .8em !important;\n\tmargin-right: .8em !important;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator.text {\n\tpadding: 0.7em 1em 0.1em 1em;\n\tfont-weight: bold;\n\topacity: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:hover {\n\tcolor: inherit;\n}\n\n.monaco-menu .monaco-action-bar.vertical .menu-item-check {\n\tposition: absolute;\n\tvisibility: hidden;\n\twidth: 1em;\n\theight: 100%;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item.checked .menu-item-check {\n\tvisibility: visible;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n/* Context Menu */\n\n.context-view.monaco-menu-container {\n\toutline: 0;\n\tborder: none;\n\tanimation: fadeIn 0.083s linear;\n}\n\n.context-view.monaco-menu-container :focus,\n.context-view.monaco-menu-container .monaco-action-bar.vertical:focus,\n.context-view.monaco-menu-container .monaco-action-bar.vertical :focus {\n\toutline: 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tborder: thin solid transparent; /* prevents jumping behaviour on hover or focus */\n}\n\n\n/* High Contrast Theming */\n:host-context(.hc-black) .context-view.monaco-menu-container {\n\tbox-shadow: none;\n}\n\n:host-context(.hc-black) .monaco-menu .monaco-action-bar.vertical .action-item.focused {\n\tbackground: none;\n}\n\n/* Vertical Action Bar Styles */\n\n.monaco-menu .monaco-action-bar.vertical {\n\tpadding: .5em 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item {\n\theight: 1.8em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator),\n.monaco-menu .monaco-action-bar.vertical .keybinding {\n\tfont-size: inherit;\n\tpadding: 0 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .menu-item-check {\n\tfont-size: inherit;\n\twidth: 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tfont-size: inherit;\n\tpadding: 0.2em 0 0 0;\n\tmargin-bottom: 0.2em;\n}\n\n:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tmargin-left: 0;\n\tmargin-right: 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\tfont-size: 60%;\n\tpadding: 0 1.8em;\n}\n\n:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\theight: 100%;\n\tmask-size: 10px 10px;\n\t-webkit-mask-size: 10px 10px;\n}\n\n.monaco-menu .action-item {\n\tcursor: default;\n}\n\n/* Arrows */\n.monaco-scrollable-element > .scrollbar > .scra {\n\tcursor: pointer;\n\tfont-size: 11px !important;\n}\n\n.monaco-scrollable-element > .visible {\n\topacity: 1;\n\n\t/* Background rule added for IE9 - to allow clicks on dom node */\n\tbackground:rgba(0,0,0,0);\n\n\ttransition: opacity 100ms linear;\n}\n.monaco-scrollable-element > .invisible {\n\topacity: 0;\n\tpointer-events: none;\n}\n.monaco-scrollable-element > .invisible.fade {\n\ttransition: opacity 800ms linear;\n}\n\n/* Scrollable Content Inset Shadow */\n.monaco-scrollable-element > .shadow {\n\tposition: absolute;\n\tdisplay: none;\n}\n.monaco-scrollable-element > .shadow.top {\n\tdisplay: block;\n\ttop: 0;\n\tleft: 3px;\n\theight: 3px;\n\twidth: 100%;\n\tbox-shadow: #DDD 0 6px 6px -6px inset;\n}\n.monaco-scrollable-element > .shadow.left {\n\tdisplay: block;\n\ttop: 3px;\n\tleft: 0;\n\theight: 100%;\n\twidth: 3px;\n\tbox-shadow: #DDD 6px 0 6px -6px inset;\n}\n.monaco-scrollable-element > .shadow.top-left-corner {\n\tdisplay: block;\n\ttop: 0;\n\tleft: 0;\n\theight: 3px;\n\twidth: 3px;\n}\n.monaco-scrollable-element > .shadow.top.left {\n\tbox-shadow: #DDD 6px 6px 6px -6px inset;\n}\n\n/* ---------- Default Style ---------- */\n\n:host-context(.vs) .monaco-scrollable-element > .scrollbar > .slider {\n\tbackground: rgba(100, 100, 100, .4);\n}\n:host-context(.vs-dark) .monaco-scrollable-element > .scrollbar > .slider {\n\tbackground: rgba(121, 121, 121, .4);\n}\n:host-context(.hc-black) .monaco-scrollable-element > .scrollbar > .slider {\n\tbackground: rgba(111, 195, 223, .6);\n}\n\n.monaco-scrollable-element > .scrollbar > .slider:hover {\n\tbackground: rgba(100, 100, 100, .7);\n}\n:host-context(.hc-black) .monaco-scrollable-element > .scrollbar > .slider:hover {\n\tbackground: rgba(111, 195, 223, .8);\n}\n\n.monaco-scrollable-element > .scrollbar > .slider.active {\n\tbackground: rgba(0, 0, 0, .6);\n}\n:host-context(.vs-dark) .monaco-scrollable-element > .scrollbar > .slider.active {\n\tbackground: rgba(191, 191, 191, .4);\n}\n:host-context(.hc-black) .monaco-scrollable-element > .scrollbar > .slider.active {\n\tbackground: rgba(111, 195, 223, 1);\n}\n\n:host-context(.vs-dark) .monaco-scrollable-element .shadow.top {\n\tbox-shadow: none;\n}\n\n:host-context(.vs-dark) .monaco-scrollable-element .shadow.left {\n\tbox-shadow: #000 6px 0 6px -6px inset;\n}\n\n:host-context(.vs-dark) .monaco-scrollable-element .shadow.top.left {\n\tbox-shadow: #000 6px 6px 6px -6px inset;\n}\n\n:host-context(.hc-black) .monaco-scrollable-element .shadow.top {\n\tbox-shadow: none;\n}\n\n:host-context(.hc-black) .monaco-scrollable-element .shadow.left {\n\tbox-shadow: none;\n}\n\n:host-context(.hc-black) .monaco-scrollable-element .shadow.top.left {\n\tbox-shadow: none;\n}\n` +})),define(t[419],i([5,6]),(function(e,t){return e.create("vs/base/browser/ui/tree/abstractTree",t)})),define(t[168],i([0,1,2,118,7,4,53,95,143,19,154,57,64,145,419,15,16,109,186,192,305]),(function(e,t,i,n,o,s,r,a,l,d,c,h,u,g,p,m,f,_,v,C){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractTree=t.RenderIndentGuides=t.ComposedTreeDelegate=void 0;class b extends c.ElementsDragAndDropData{constructor(e){super(e.elements.map(e=>e.element)),this.data=e}}function S(e){return e instanceof c.ElementsDragAndDropData?new b(e):e}class w{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=i.Disposable.None}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(e=>e.element),t)}onDragStart(e,t){this.dnd.onDragStart&&this.dnd.onDragStart(S(e),t)}onDragOver(e,t,i,n,o=!0){const s=this.dnd.onDragOver(S(e),t&&t.element,i,n),r=this.autoExpandNode!==t;if(r&&(this.autoExpandDisposable.dispose(), +this.autoExpandNode=t),void 0===t)return s;if(r&&"boolean"!=typeof s&&s.autoExpand&&(this.autoExpandDisposable=m.disposableTimeout(()=>{const e=this.modelProvider(),i=e.getNodeLocation(t);e.isCollapsed(i)&&e.setCollapsed(i,!1),this.autoExpandNode=void 0},500)),"boolean"==typeof s||!s.accept||void 0===s.bubble||s.feedback){if(!o){return{accept:"boolean"==typeof s?s:s.accept,effect:"boolean"==typeof s?void 0:s.effect,feedback:[i]}}return s}if(1===s.bubble){const i=this.modelProvider(),o=i.getNodeLocation(t),s=i.getParentNodeLocation(o),r=i.getNode(s),a=s&&i.getListIndex(s);return this.onDragOver(e,r,a,n,!1)}const a=this.modelProvider(),l=a.getNodeLocation(t),c=a.getListIndex(l),h=a.getListRenderCount(l);return Object.assign(Object.assign({},s),{feedback:d.range(c,c+h)})}drop(e,t,i,n){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(S(e),t&&t.element,i,n)}onDragEnd(e){this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}}class y{constructor(e){this.delegate=e}getHeight(e){ +return this.delegate.getHeight(e.element)}getTemplateId(e){return this.delegate.getTemplateId(e.element)}hasDynamicHeight(e){return!!this.delegate.hasDynamicHeight&&this.delegate.hasDynamicHeight(e.element)}setDynamicHeight(e,t){this.delegate.setDynamicHeight&&this.delegate.setDynamicHeight(e.element,t)}}var E;t.ComposedTreeDelegate=y,function(e){e.None="none",e.OnHover="onHover",e.Always="always"}(E=t.RenderIndentGuides||(t.RenderIndentGuides={}));class L{constructor(e,t=[]){this._elements=t,this.onDidChange=s.Event.forEach(e,e=>this._elements=e)}get elements(){return this._elements}}class x{constructor(e,t,n,o,r={}){this.renderer=e,this.modelProvider=t,this.activeNodes=o,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=x.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.renderedIndentGuides=new v.SetMap,this.activeIndentNodes=new Set,this.indentGuidesDisposable=i.Disposable.None,this.disposables=new i.DisposableStore,this.templateId=e.templateId, +this.updateOptions(r),s.Event.map(n,e=>e.node)(this.onDidChangeNodeTwistieState,this,this.disposables),e.onDidChangeTwistieState&&e.onDidChangeTwistieState(this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if(void 0!==e.indent&&(this.indent=_.clamp(e.indent,0,40)),void 0!==e.renderIndentGuides){const t=e.renderIndentGuides!==E.None;if(t!==this.shouldRenderIndentGuides&&(this.shouldRenderIndentGuides=t,this.indentGuidesDisposable.dispose(),t)){const e=new i.DisposableStore;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,e),this.indentGuidesDisposable=e,this._onDidChangeActiveNodes(this.activeNodes.elements)}}void 0!==e.hideTwistiesOfChildlessElements&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){const t=o.append(e,o.$(".monaco-tl-row")),n=o.append(t,o.$(".monaco-tl-indent")),s=o.append(t,o.$(".monaco-tl-twistie")),r=o.append(t,o.$(".monaco-tl-contents")),a=this.renderer.renderTemplate(r);return{container:e,indent:n,twistie:s, +indentGuidesDisposable:i.Disposable.None,templateData:a}}renderElement(e,t,i,n){"number"==typeof n&&(this.renderedNodes.set(e,{templateData:i,height:n}),this.renderedElements.set(e.element,e));const o=x.DefaultIndent+(e.depth-1)*this.indent;i.twistie.style.paddingLeft=`${o}px`,i.indent.style.width=`${o+this.indent-16}px`,this.renderTwistie(e,i),"number"==typeof n&&this.renderIndentGuides(e,i),this.renderer.renderElement(e,t,i.templateData,n)}disposeElement(e,t,i,n){i.indentGuidesDisposable.dispose(),this.renderer.disposeElement&&this.renderer.disposeElement(e,t,i.templateData,n),"number"==typeof n&&(this.renderedNodes.delete(e),this.renderedElements.delete(e.element))}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}onDidChangeTwistieState(e){const t=this.renderedElements.get(e);t&&this.onDidChangeNodeTwistieState(t)}onDidChangeNodeTwistieState(e){const t=this.renderedNodes.get(e);t&&(this.renderTwistie(e,t.templateData),this._onDidChangeActiveNodes(this.activeNodes.elements), +this.renderIndentGuides(e,t.templateData))}renderTwistie(e,t){this.renderer.renderTwistie&&this.renderer.renderTwistie(e.element,t.twistie),e.collapsible&&(!this.hideTwistiesOfChildlessElements||e.visibleChildrenCount>0)?(o.addClasses(t.twistie,C.treeItemExpandedIcon.classNames,"collapsible"),o.toggleClass(t.twistie,"collapsed",e.collapsed)):o.removeClasses(t.twistie,C.treeItemExpandedIcon.classNames,"collapsible","collapsed"),e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded")}renderIndentGuides(e,t){if(o.clearNode(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const n=new i.DisposableStore,s=this.modelProvider();let r=e;for(;;){const e=s.getNodeLocation(r),a=s.getParentNodeLocation(e);if(!a)break;const l=s.getNode(a),d=o.$(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(l)&&o.addClass(d,"active"), +0===t.indent.childElementCount?t.indent.appendChild(d):t.indent.insertBefore(d,t.indent.firstElementChild),this.renderedIndentGuides.add(l,d),n.add(i.toDisposable(()=>this.renderedIndentGuides.delete(l,d))),r=l}t.indentGuidesDisposable=n}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;const t=new Set,i=this.modelProvider();e.forEach(e=>{const n=i.getNodeLocation(e);try{const o=i.getParentNodeLocation(n);e.collapsible&&e.children.length>0&&!e.collapsed?t.add(e):o&&t.add(i.getNode(o))}catch(e){}}),this.activeIndentNodes.forEach(e=>{t.has(e)||this.renderedIndentGuides.forEach(e,e=>o.removeClass(e,"active"))}),t.forEach(e=>{this.activeIndentNodes.has(e)||this.renderedIndentGuides.forEach(e,e=>o.addClass(e,"active"))}),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),i.dispose(this.disposables)}}x.DefaultIndent=8;class D{constructor(e,t,n){this.tree=e,this.keyboardNavigationLabelProvider=t,this._filter=n, +this._totalCount=0,this._matchCount=0,this._pattern="",this._lowercasePattern="",this.disposables=new i.DisposableStore,e.onWillRefilter(this.reset,this,this.disposables)}get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}set pattern(e){this._pattern=e,this._lowercasePattern=e.toLowerCase()}filter(e,t){if(this._filter){const i=this._filter.filter(e,t);if(this.tree.options.simpleKeyboardNavigation)return i;let n;if(0===(n="boolean"==typeof i?i?1:0:g.isFilterResult(i)?g.getVisibleState(i.visibility):i))return!1}if(this._totalCount++,this.tree.options.simpleKeyboardNavigation||!this._pattern)return this._matchCount++,{data:u.FuzzyScore.Default,visibility:!0};const i=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),n=i&&i.toString();if(void 0===n)return{data:u.FuzzyScore.Default,visibility:!0};const o=u.fuzzyScore(this._pattern,this._lowercasePattern,0,n,n.toLowerCase(),0,!0);return o?(this._matchCount++,{data:o,visibility:!0}):this.tree.options.filterOnType?2:{ +data:u.FuzzyScore.Default,visibility:!0}}reset(){this._totalCount=0,this._matchCount=0}dispose(){i.dispose(this.disposables)}}class k{constructor(e,t,n,r,a){this.tree=e,this.view=n,this.filter=r,this.keyboardNavigationDelegate=a,this._enabled=!1,this._pattern="",this._empty=!1,this._onDidChangeEmptyState=new s.Emitter,this.positionClassName="ne",this.automaticKeyboardNavigation=!0,this.triggered=!1,this._onDidChangePattern=new s.Emitter,this.enabledDisposables=new i.DisposableStore,this.disposables=new i.DisposableStore,this.domNode=o.$(`.monaco-list-type-filter.${this.positionClassName}`),this.domNode.draggable=!0,h.domEvent(this.domNode,"dragstart")(this.onDragStart,this,this.disposables),this.messageDomNode=o.append(n.getHTMLElement(),o.$(".monaco-list-type-filter-message")),this.labelDomNode=o.append(this.domNode,o.$("span.label"));const l=o.append(this.domNode,o.$(".controls"));this._filterOnType=!!e.options.filterOnType,this.filterOnTypeDomNode=o.append(l,o.$("input.filter")), +this.filterOnTypeDomNode.type="checkbox",this.filterOnTypeDomNode.checked=this._filterOnType,this.filterOnTypeDomNode.tabIndex=-1,this.updateFilterOnTypeTitleAndIcon(),h.domEvent(this.filterOnTypeDomNode,"input")(this.onDidChangeFilterOnType,this,this.disposables),this.clearDomNode=o.append(l,o.$("button.clear"+C.treeFilterClearIcon.cssSelector)),this.clearDomNode.tabIndex=-1,this.clearDomNode.title=p.localize(0,null),this.keyboardNavigationEventFilter=e.options.keyboardNavigationEventFilter,t.onDidSplice(this.onDidSpliceModel,this,this.disposables),this.updateOptions(e.options)}get enabled(){return this._enabled}get pattern(){return this._pattern}get filterOnType(){return this._filterOnType}updateOptions(e){e.simpleKeyboardNavigation?this.disable():this.enable(),void 0!==e.filterOnType&&(this._filterOnType=!!e.filterOnType,this.filterOnTypeDomNode.checked=this._filterOnType),void 0!==e.automaticKeyboardNavigation&&(this.automaticKeyboardNavigation=e.automaticKeyboardNavigation),this.tree.refilter(), +this.render(),this.automaticKeyboardNavigation||this.onEventOrInput("")}enable(){if(this._enabled)return;const e=s.Event.chain(h.domEvent(this.view.getHTMLElement(),"keydown")).filter(e=>!n.isInputElement(e.target)||e.target===this.filterOnTypeDomNode).filter(e=>"Dead"!==e.key&&!/^Media/.test(e.key)).map(e=>new r.StandardKeyboardEvent(e)).filter(this.keyboardNavigationEventFilter||(()=>!0)).filter(()=>this.automaticKeyboardNavigation||this.triggered).filter(e=>this.keyboardNavigationDelegate.mightProducePrintableCharacter(e)&&!(18===e.keyCode||16===e.keyCode||15===e.keyCode||17===e.keyCode)||(this.pattern.length>0||this.triggered)&&(9===e.keyCode||1===e.keyCode)&&!e.altKey&&!e.ctrlKey&&!e.metaKey||1===e.keyCode&&(f.isMacintosh?e.altKey&&!e.metaKey:e.ctrlKey)&&!e.shiftKey).forEach(e=>{e.stopPropagation(),e.preventDefault()}).event,t=h.domEvent(this.clearDomNode,"click");s.Event.chain(s.Event.any(e,t)).event(this.onEventOrInput,this,this.enabledDisposables),this.filter.pattern="",this.tree.refilter(), +this.render(),this._enabled=!0,this.triggered=!1}disable(){this._enabled&&(this.domNode.remove(),this.enabledDisposables.clear(),this.tree.refilter(),this.render(),this._enabled=!1,this.triggered=!1)}onEventOrInput(e){"string"==typeof e?this.onInput(e):e instanceof MouseEvent||9===e.keyCode||1===e.keyCode&&(f.isMacintosh?e.altKey:e.ctrlKey)?this.onInput(""):1===e.keyCode?this.onInput(0===this.pattern.length?"":this.pattern.substr(0,this.pattern.length-1)):this.onInput(this.pattern+e.browserEvent.key)}onInput(e){const t=this.view.getHTMLElement();e&&!this.domNode.parentElement?t.append(this.domNode):!e&&this.domNode.parentElement&&(this.domNode.remove(),this.tree.domFocus()),this._pattern=e,this._onDidChangePattern.fire(e),this.filter.pattern=e,this.tree.refilter(),e&&this.tree.focusNext(0,!0,void 0,e=>!u.FuzzyScore.isDefault(e.filterData));const i=this.tree.getFocus();if(i.length>0){const e=i[0];null===this.tree.getRelativeTop(e)&&this.tree.reveal(e,.5)}this.render(),e||(this.triggered=!1)}onDragStart(){ +const e=this.view.getHTMLElement(),{left:t}=o.getDomNodePagePosition(e),n=e.clientWidth,s=n/2,r=this.domNode.clientWidth,a=new i.DisposableStore;let d=this.positionClassName;const c=()=>{switch(d){case"nw":this.domNode.style.top="4px",this.domNode.style.left="4px";break;case"ne":this.domNode.style.top="4px",this.domNode.style.left=`${n-r-6}px`}};c(),o.removeClass(this.domNode,d),o.addClass(this.domNode,"dragging"),a.add(i.toDisposable(()=>o.removeClass(this.domNode,"dragging"))),h.domEvent(document,"dragover")(e=>{e.preventDefault();const i=e.screenX-t;e.dataTransfer&&(e.dataTransfer.dropEffect="none"),d=i{this.positionClassName=d,this.domNode.className=`monaco-list-type-filter ${this.positionClassName}`,this.domNode.style.top="",this.domNode.style.left="",i.dispose(a)},null,a),l.StaticDND.CurrentDragAndDropData=new l.DragAndDropData("vscode-ui"),a.add(i.toDisposable(()=>l.StaticDND.CurrentDragAndDropData=void 0))}onDidSpliceModel(){ +this._enabled&&0!==this.pattern.length&&(this.tree.refilter(),this.render())}onDidChangeFilterOnType(){this.tree.updateOptions({filterOnType:this.filterOnTypeDomNode.checked}),this.tree.refilter(),this.tree.domFocus(),this.render(),this.updateFilterOnTypeTitleAndIcon()}updateFilterOnTypeTitleAndIcon(){this.filterOnType?(o.removeClasses(this.filterOnTypeDomNode,C.treeFilterOnTypeOffIcon.classNames),o.addClasses(this.filterOnTypeDomNode,C.treeFilterOnTypeOnIcon.classNames),this.filterOnTypeDomNode.title=p.localize(1,null)):(o.removeClasses(this.filterOnTypeDomNode,C.treeFilterOnTypeOnIcon.classNames),o.addClasses(this.filterOnTypeDomNode,C.treeFilterOnTypeOffIcon.classNames),this.filterOnTypeDomNode.title=p.localize(2,null))}render(){const e=this.filter.totalCount>0&&0===this.filter.matchCount;this.pattern&&this.tree.options.filterOnType&&e?(this.messageDomNode.textContent=p.localize(3,null),this._empty=!0):(this.messageDomNode.innerText="",this._empty=!1),o.toggleClass(this.domNode,"no-matches",e), +this.domNode.title=p.localize(4,null,this.filter.matchCount,this.filter.totalCount),this.labelDomNode.textContent=this.pattern.length>16?"…"+this.pattern.substr(this.pattern.length-16):this.pattern,this._onDidChangeEmptyState.fire(this._empty)}shouldAllowFocus(e){return!(this.enabled&&this.pattern&&!this.filterOnType)||(this.filter.totalCount>0&&this.filter.matchCount<=1||!u.FuzzyScore.isDefault(e.filterData))}dispose(){this._enabled&&(this.domNode.remove(),this.enabledDisposables.dispose(),this._enabled=!1,this.triggered=!1),this._onDidChangePattern.dispose(),i.dispose(this.disposables)}}function N(e){let t=a.TreeMouseEventTarget.Unknown;return o.hasParentWithClass(e.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?t=a.TreeMouseEventTarget.Twistie:o.hasParentWithClass(e.browserEvent.target,"monaco-tl-contents","monaco-tl-row")&&(t=a.TreeMouseEventTarget.Element),{browserEvent:e.browserEvent,element:e.element?e.element.element:null,target:t}}function I(e,t){t(e),e.children.forEach(e=>I(e,t))}class M{ +constructor(e){this.identityProvider=e,this.nodes=[],this._onDidChange=new s.Emitter,this.onDidChange=this._onDidChange.event}get nodeSet(){return this._nodeSet||(this._nodeSet=this.createNodeSet()),this._nodeSet}set(e,t){d.equals(this.nodes,e)||this._set(e,!1,t)}_set(e,t,i){if(this.nodes=[...e],this.elements=void 0,this._nodeSet=void 0,!t){const e=this;this._onDidChange.fire({get elements(){return e.get()},browserEvent:i})}}get(){return this.elements||(this.elements=this.nodes.map(e=>e.element)),[...this.elements]}getNodes(){return this.nodes}has(e){return this.nodeSet.has(e)}onDidModelSplice({insertedNodes:e,deletedNodes:t}){if(!this.identityProvider){const e=this.createNodeSet(),i=t=>e.delete(t);return t.forEach(e=>I(e,i)),void this.set([...e.values()])}const i=new Set,n=e=>i.add(this.identityProvider.getId(e.element).toString());t.forEach(e=>I(e,n));const o=new Map,s=e=>o.set(this.identityProvider.getId(e.element).toString(),e);e.forEach(e=>I(e,s));const r=[];for(const e of this.nodes){ +const t=this.identityProvider.getId(e.element).toString();if(i.has(t)){const e=o.get(t);e&&r.push(e)}else r.push(e)}this._set(r,!0)}createNodeSet(){const e=new Set;for(const t of this.nodes)e.add(t);return e}}class R extends n.MouseController{constructor(e,t){super(e),this.tree=t}onViewPointer(e){if(n.isInputElement(e.browserEvent.target)||n.isMonacoEditor(e.browserEvent.target))return;const t=e.element;if(!t)return super.onViewPointer(e);if(this.isSelectionRangeChangeEvent(e)||this.isSelectionSingleChangeEvent(e))return super.onViewPointer(e);const i=e.browserEvent.target,s=o.hasClass(i,"monaco-tl-twistie")||o.hasClass(i,"monaco-icon-label")&&o.hasClass(i,"folder-icon")&&e.browserEvent.offsetX<16;let r=!1;if((r="function"==typeof this.tree.expandOnlyOnTwistieClick?this.tree.expandOnlyOnTwistieClick(t.element):!!this.tree.expandOnlyOnTwistieClick)&&!s)return super.onViewPointer(e);if(this.tree.expandOnlyOnDoubleClick&&2!==e.browserEvent.detail&&!s)return super.onViewPointer(e);if(t.collapsible){ +const i=this.tree.model,n=i.getNodeLocation(t),o=e.browserEvent.altKey;if(i.setCollapsed(n,void 0,o),r&&s)return}super.onViewPointer(e)}onDoubleClick(e){o.hasClass(e.browserEvent.target,"monaco-tl-twistie")||super.onDoubleClick(e)}}class T extends n.List{constructor(e,t,i,n,o,s,r){super(e,t,i,n,r),this.focusTrait=o,this.selectionTrait=s}createMouseController(e){return new R(this,e.tree)}splice(e,t,i=[]){if(super.splice(e,t,i),0===i.length)return;const n=[],o=[];i.forEach((t,i)=>{this.focusTrait.has(t)&&n.push(e+i),this.selectionTrait.has(t)&&o.push(e+i)}),n.length>0&&super.setFocus(d.distinctES6([...super.getFocus(),...n])),o.length>0&&super.setSelection(d.distinctES6([...super.getSelection(),...o]))}setFocus(e,t,i=!1){super.setFocus(e,t),i||this.focusTrait.set(e.map(e=>this.element(e)),t)}setSelection(e,t,i=!1){super.setSelection(e,t),i||this.selectionTrait.set(e.map(e=>this.element(e)),t)}}t.AbstractTree=class{constructor(e,t,a,l,d={}){this._options=d,this.eventBufferer=new s.EventBufferer, +this.disposables=new i.DisposableStore,this._onWillRefilter=new s.Emitter,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new s.Emitter;const c=new y(a),h=new s.Relay,u=new s.Relay,g=new L(u.event);this.renderers=l.map(e=>new x(e,()=>this.model,h.event,g,d));for(let e of this.renderers)this.disposables.add(e);let p;var m,f;d.keyboardNavigationLabelProvider&&(p=new D(this,d.keyboardNavigationLabelProvider,d.filter),d=Object.assign(Object.assign({},d),{filter:p}),this.disposables.add(p)),this.focus=new M(d.identityProvider),this.selection=new M(d.identityProvider),this.view=new T(e,t,c,this.renderers,this.focus,this.selection,Object.assign(Object.assign({},(m=()=>this.model,(f=d)&&Object.assign(Object.assign({},f),{identityProvider:f.identityProvider&&{getId:e=>f.identityProvider.getId(e.element)},dnd:f.dnd&&new w(m,f.dnd),multipleSelectionController:f.multipleSelectionController&&{ +isSelectionSingleChangeEvent:e=>f.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},e),{element:e.element})),isSelectionRangeChangeEvent:e=>f.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},e),{element:e.element}))},accessibilityProvider:f.accessibilityProvider&&Object.assign(Object.assign({},f.accessibilityProvider),{getSetSize(e){const t=m(),i=t.getNodeLocation(e),n=t.getParentNodeLocation(i);return t.getNode(n).visibleChildrenCount},getPosInSet:e=>e.visibleChildIndex+1,isChecked:f.accessibilityProvider&&f.accessibilityProvider.isChecked?e=>f.accessibilityProvider.isChecked(e.element):void 0,getRole:f.accessibilityProvider&&f.accessibilityProvider.getRole?e=>f.accessibilityProvider.getRole(e.element):()=>"treeitem",getAriaLabel:e=>f.accessibilityProvider.getAriaLabel(e.element),getWidgetAriaLabel:()=>f.accessibilityProvider.getWidgetAriaLabel(), +getWidgetRole:f.accessibilityProvider&&f.accessibilityProvider.getWidgetRole?()=>f.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:e=>e.depth,getActiveDescendantId:f.accessibilityProvider.getActiveDescendantId&&(e=>f.accessibilityProvider.getActiveDescendantId(e.element))}),keyboardNavigationLabelProvider:f.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},f.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel:e=>f.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}),enableKeyboardNavigation:f.simpleKeyboardNavigation}))),{tree:this})),this.model=this.createModel(e,this.view,d),h.input=this.model.onDidChangeCollapseState;const _=s.Event.forEach(this.model.onDidSplice,e=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(e),this.selection.onDidModelSplice(e)})});if(_(()=>null,null,this.disposables),u.input=s.Event.chain(s.Event.any(_,this.focus.onDidChange,this.selection.onDidChange)).debounce(()=>null,0).map(()=>{const e=new Set +;for(const t of this.focus.getNodes())e.add(t);for(const t of this.selection.getNodes())e.add(t);return[...e.values()]}).event,!1!==d.keyboardSupport){const e=s.Event.chain(this.view.onKeyDown).filter(e=>!n.isInputElement(e.target)).map(e=>new r.StandardKeyboardEvent(e));e.filter(e=>15===e.keyCode).on(this.onLeftArrow,this,this.disposables),e.filter(e=>17===e.keyCode).on(this.onRightArrow,this,this.disposables),e.filter(e=>10===e.keyCode).on(this.onSpace,this,this.disposables)}if(d.keyboardNavigationLabelProvider){const e=d.keyboardNavigationDelegate||n.DefaultKeyboardNavigationDelegate;this.typeFilterController=new k(this,this.model,this.view,p,e),this.focusNavigationFilter=e=>this.typeFilterController.shouldAllowFocus(e),this.disposables.add(this.typeFilterController)}this.styleElement=o.createStyleSheet(this.view.getHTMLElement()),o.toggleClass(this.getHTMLElement(),"always",this._options.renderIndentGuides===E.Always)}get onDidChangeFocus(){return this.eventBufferer.wrapEvent(this.focus.onDidChange)} +get onDidChangeSelection(){return this.eventBufferer.wrapEvent(this.selection.onDidChange)}get onMouseDblClick(){return s.Event.map(this.view.onMouseDblClick,N)}get onPointer(){return s.Event.map(this.view.onPointer,N)}get onDidFocus(){return this.view.onDidFocus}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get expandOnlyOnDoubleClick(){var e;return null!==(e=this._options.expandOnlyOnDoubleClick)&&void 0!==e&&e}get expandOnlyOnTwistieClick(){return void 0!==this._options.expandOnlyOnTwistieClick&&this._options.expandOnlyOnTwistieClick}get onDidDispose(){return this.view.onDidDispose}updateOptions(e={}){this._options=Object.assign(Object.assign({},this._options),e);for(const t of this.renderers)t.updateOptions(e);this.view.updateOptions({enableKeyboardNavigation:this._options.simpleKeyboardNavigation,automaticKeyboardNavigation:this._options.automaticKeyboardNavigation,smoothScrolling:this._options.smoothScrolling,horizontalScrolling:this._options.horizontalScrolling}), +this.typeFilterController&&this.typeFilterController.updateOptions(this._options),this._onDidUpdateOptions.fire(this._options),o.toggleClass(this.getHTMLElement(),"always",this._options.renderIndentGuides===E.Always)}get options(){return this._options}getHTMLElement(){return this.view.getHTMLElement()}get scrollTop(){return this.view.scrollTop}set scrollTop(e){this.view.scrollTop=e}domFocus(){this.view.domFocus()}layout(e,t){this.view.layout(e,t)}style(e){const t=`.${this.view.domId}`,i=[];e.treeIndentGuidesStroke&&(i.push(`.monaco-list${t}:hover .monaco-tl-indent > .indent-guide, .monaco-list${t}.always .monaco-tl-indent > .indent-guide { border-color: ${e.treeIndentGuidesStroke.transparent(.4)}; }`),i.push(`.monaco-list${t} .monaco-tl-indent > .indent-guide.active { border-color: ${e.treeIndentGuidesStroke}; }`));const n=i.join("\n");n!==this.styleElement.innerHTML&&(this.styleElement.innerHTML=n),this.view.style(e)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){ +return this.model.setCollapsed(e,!1,t)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setSelection(e,t){const i=e.map(e=>this.model.getNode(e));this.selection.set(i,t);const n=e.map(e=>this.model.getListIndex(e)).filter(e=>e>-1);this.view.setSelection(n,t,!0)}getSelection(){return this.selection.get()}setFocus(e,t){const i=e.map(e=>this.model.getNode(e));this.focus.set(i,t);const n=e.map(e=>this.model.getListIndex(e)).filter(e=>e>-1);this.view.setFocus(n,t,!0)}focusNext(e=1,t=!1,i,n=this.focusNavigationFilter){this.view.focusNext(e,t,i,n)}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const i=this.model.getListIndex(e);-1!==i&&this.view.reveal(i,t)}getRelativeTop(e){const t=this.model.getListIndex(e);return-1===t?null:this.view.getRelativeTop(t)}onLeftArrow(e){e.preventDefault(),e.stopPropagation() +;const t=this.view.getFocusedElements();if(0===t.length)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!0)){const e=this.model.getParentNodeLocation(n);if(!e)return;const t=this.model.getListIndex(e);this.view.reveal(t),this.view.setFocus([t])}}onRightArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(0===t.length)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!1)){if(!i.children.some(e=>e.visible))return;const[e]=this.view.getFocus(),t=e+1;this.view.reveal(t),this.view.setFocus([t])}}onSpace(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(0===t.length)return;const i=t[0],n=this.model.getNodeLocation(i),o=e.browserEvent.altKey;this.model.setCollapsed(n,void 0,o)}dispose(){i.dispose(this.disposables),this.view.dispose()}}})),define(t[420],i([0,1,168,146]),(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DataTree=void 0 +;class o extends i.AbstractTree{constructor(e,t,i,n,o,s={}){super(e,t,i,n,s),this.user=e,this.dataSource=o,this.identityProvider=s.identityProvider}createModel(e,t,i){return new n.ObjectTreeModel(e,t,i)}}t.DataTree=o})),define(t[226],i([0,1,50,168,146,266,96]),(function(e,t,i,n,o,s,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CompressibleObjectTree=t.ObjectTree=void 0;class l extends n.AbstractTree{constructor(e,t,i,n,o={}){super(e,t,i,n,o)}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}setChildren(e,t=i.Iterable.empty()){this.model.setChildren(e,t)}rerender(e){void 0!==e?this.model.rerender(e):this.view.rerender()}hasElement(e){return this.model.has(e)}createModel(e,t,i){return new o.ObjectTreeModel(e,t,i)}}t.ObjectTree=l;class d{constructor(e,t){this._compressedTreeNodeProvider=e,this.renderer=t,this.templateId=t.templateId,t.onDidChangeTwistieState&&(this.onDidChangeTwistieState=t.onDidChangeTwistieState)}get compressedTreeNodeProvider(){ +return this._compressedTreeNodeProvider()}renderTemplate(e){return{compressedTreeNode:void 0,data:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){const o=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element);1===o.element.elements.length?(i.compressedTreeNode=void 0,this.renderer.renderElement(e,t,i.data,n)):(i.compressedTreeNode=o,this.renderer.renderCompressedElements(o,t,i.data,n))}disposeElement(e,t,i,n){i.compressedTreeNode?this.renderer.disposeCompressedElements&&this.renderer.disposeCompressedElements(i.compressedTreeNode,t,i.data,n):this.renderer.disposeElement&&this.renderer.disposeElement(e,t,i.data,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){this.renderer.renderTwistie&&this.renderer.renderTwistie(e,t)}}a([r.memoize],d.prototype,"compressedTreeNodeProvider",null);t.CompressibleObjectTree=class extends l{constructor(e,t,i,n,o={}){const s=()=>this;super(e,t,i,n.map(e=>new d(s,e)),function(e,t){return t&&Object.assign(Object.assign({},t),{ +keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&{getKeyboardNavigationLabel(i){let n;try{n=e().getCompressedTreeNode(i)}catch(e){return t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(i)}return 1===n.element.elements.length?t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(i):t.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(n.element.elements)}}})}(s,o))}setChildren(e,t=i.Iterable.empty()){this.model.setChildren(e,t)}createModel(e,t,i){return new s.CompressibleObjectTreeModel(e,t,i)}updateOptions(e={}){super.updateOptions(e),void 0!==e.compressionEnabled&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}}})),define(t[421],i([0,1,168,226,95,2,4,15,50,154,12,7,145,192]),(function(e,t,i,n,o,s,a,l,d,c,h,u,g,p){"use strict";function m(e){return Object.assign(Object.assign({},e),{children:[],refreshPromise:void 0,stale:!0,slow:!1,collapsedByDefault:void 0})} +function f(e,t){return!!t.parent&&(t.parent===e||f(e,t.parent))}Object.defineProperty(t,"__esModule",{value:!0}),t.CompressibleAsyncDataTree=t.AsyncDataTree=void 0;class _{constructor(e){this.node=e}get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new _(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}}class v{constructor(e,t,i){this.renderer=e,this.nodeMapper=t,this.onDidChangeTwistieState=i,this.renderedNodes=new Map,this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,n)}renderTwistie(e,t){ +return e.slow?u.addClasses(t,p.treeItemLoadingIcon.classNames):u.removeClasses(t,p.treeItemLoadingIcon.classNames),!1}disposeElement(e,t,i,n){this.renderer.disposeElement&&this.renderer.disposeElement(this.nodeMapper.map(e),t,i.templateData,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function C(e){return{browserEvent:e.browserEvent,elements:e.elements.map(e=>e.element)}}function b(e){return{browserEvent:e.browserEvent,element:e.element&&e.element.element,target:e.target}}class S extends c.ElementsDragAndDropData{constructor(e){super(e.elements.map(e=>e.element)),this.data=e}}function w(e){return e instanceof c.ElementsDragAndDropData?new S(e):e}class y{constructor(e){this.dnd=e}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(e=>e.element),t)}onDragStart(e,t){this.dnd.onDragStart&&this.dnd.onDragStart(w(e),t)}onDragOver(e,t,i,n,o=!0){ +return this.dnd.onDragOver(w(e),t&&t.element,i,n)}drop(e,t,i,n){this.dnd.drop(w(e),t&&t.element,i,n)}onDragEnd(e){this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}}function E(e){return e&&Object.assign(Object.assign({},e),{collapseByDefault:!0,identityProvider:e.identityProvider&&{getId:t=>e.identityProvider.getId(t.element)},dnd:e.dnd&&new y(e.dnd),multipleSelectionController:e.multipleSelectionController&&{isSelectionSingleChangeEvent:t=>e.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},t),{element:t.element})),isSelectionRangeChangeEvent:t=>e.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},t),{element:t.element}))},accessibilityProvider:e.accessibilityProvider&&Object.assign(Object.assign({},e.accessibilityProvider),{getPosInSet:void 0,getSetSize:void 0,getRole:e.accessibilityProvider.getRole?t=>e.accessibilityProvider.getRole(t.element):()=>"treeitem",isChecked:e.accessibilityProvider.isChecked?t=>{var i +;return!!(null===(i=e.accessibilityProvider)||void 0===i?void 0:i.isChecked(t.element))}:void 0,getAriaLabel:t=>e.accessibilityProvider.getAriaLabel(t.element),getWidgetAriaLabel:()=>e.accessibilityProvider.getWidgetAriaLabel(),getWidgetRole:e.accessibilityProvider.getWidgetRole?()=>e.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:e.accessibilityProvider.getAriaLevel&&(t=>e.accessibilityProvider.getAriaLevel(t.element)),getActiveDescendantId:e.accessibilityProvider.getActiveDescendantId&&(t=>e.accessibilityProvider.getActiveDescendantId(t.element))}),filter:e.filter&&{filter:(t,i)=>e.filter.filter(t.element,i)},keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},e.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel:t=>e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element)}),sorter:void 0, +expandOnlyOnTwistieClick:void 0===e.expandOnlyOnTwistieClick?void 0:"function"!=typeof e.expandOnlyOnTwistieClick?e.expandOnlyOnTwistieClick:t=>e.expandOnlyOnTwistieClick(t.element),additionalScrollHeight:e.additionalScrollHeight})}function L(e,t){t(e),e.children.forEach(e=>L(e,t))}class x{constructor(e,t,i,n,r,l={}){this.user=e,this.dataSource=r,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new a.Emitter,this._onDidChangeNodeSlowState=new a.Emitter,this.nodeMapper=new o.WeakMapper(e=>new _(e)),this.disposables=new s.DisposableStore,this.identityProvider=l.identityProvider,this.autoExpandSingleChildren=void 0!==l.autoExpandSingleChildren&&l.autoExpandSingleChildren,this.sorter=l.sorter,this.collapseByDefault=l.collapseByDefault,this.tree=this.createTree(e,t,i,n,l),this.root=m({element:void 0,parent:null,hasChildren:!0}),this.identityProvider&&(this.root=Object.assign(Object.assign({},this.root),{id:null})),this.nodes.set(null,this.root), +this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState,this,this.disposables)}get onDidChangeFocus(){return a.Event.map(this.tree.onDidChangeFocus,C)}get onDidChangeSelection(){return a.Event.map(this.tree.onDidChangeSelection,C)}get onMouseDblClick(){return a.Event.map(this.tree.onMouseDblClick,b)}get onPointer(){return a.Event.map(this.tree.onPointer,b)}get onDidFocus(){return this.tree.onDidFocus}get onDidDispose(){return this.tree.onDidDispose}createTree(e,t,o,s,r){const a=new i.ComposedTreeDelegate(o),l=s.map(e=>new v(e,this.nodeMapper,this._onDidChangeNodeSlowState.event)),d=E(r)||{};return new n.ObjectTree(e,t,a,l,d)}updateOptions(e={}){this.tree.updateOptions(e)}getHTMLElement(){return this.tree.getHTMLElement()}get scrollTop(){return this.tree.scrollTop}set scrollTop(e){this.tree.scrollTop=e}domFocus(){this.tree.domFocus()}layout(e,t){this.tree.layout(e,t)}style(e){this.tree.style(e)}getInput(){return this.root.element}setInput(e,t){return r(this,void 0,void 0,(function*(){ +this.refreshPromises.forEach(e=>e.cancel()),this.refreshPromises.clear(),this.root.element=e;const i=t&&{viewState:t,focus:[],selection:[]};yield this._updateChildren(e,!0,!1,i),i&&(this.tree.setFocus(i.focus),this.tree.setSelection(i.selection)),t&&"number"==typeof t.scrollTop&&(this.scrollTop=t.scrollTop)}))}_updateChildren(e=this.root.element,t=!0,i=!1,n){return r(this,void 0,void 0,(function*(){if(void 0===this.root.element)throw new o.TreeError(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield a.Event.toPromise(this._onDidRender.event));const s=this.getDataNode(e);if(yield this.refreshAndRenderNode(s,t,n),i)try{this.tree.rerender(s)}catch(e){}}))}rerender(e){if(void 0===e||e===this.root.element)return void this.tree.rerender();const t=this.getDataNode(e);this.tree.rerender(t)}collapse(e,t=!1){const i=this.getDataNode(e);return this.tree.collapse(i===this.root?null:i,t)}expand(e,t=!1){return r(this,void 0,void 0,(function*(){ +if(void 0===this.root.element)throw new o.TreeError(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield a.Event.toPromise(this._onDidRender.event));const i=this.getDataNode(e);if(this.tree.hasElement(i)&&!this.tree.isCollapsible(i))return!1;if(i.refreshPromise&&(yield this.root.refreshPromise,yield a.Event.toPromise(this._onDidRender.event)),i!==this.root&&!i.refreshPromise&&!this.tree.isCollapsed(i))return!1;const n=this.tree.expand(i===this.root?null:i,t);return i.refreshPromise&&(yield this.root.refreshPromise,yield a.Event.toPromise(this._onDidRender.event)),n}))}setSelection(e,t){const i=e.map(e=>this.getDataNode(e));this.tree.setSelection(i,t)}getSelection(){return this.tree.getSelection().map(e=>e.element)}setFocus(e,t){const i=e.map(e=>this.getDataNode(e));this.tree.setFocus(i,t)}getFocus(){return this.tree.getFocus().map(e=>e.element)}reveal(e,t){this.tree.reveal(this.getDataNode(e),t)}getDataNode(e){const t=this.nodes.get(e===this.root.element?null:e) +;if(!t)throw new o.TreeError(this.user,`Data tree node not found: ${e}`);return t}refreshAndRenderNode(e,t,i){return r(this,void 0,void 0,(function*(){yield this.refreshNode(e,t,i),this.render(e,i)}))}refreshNode(e,t,i){return r(this,void 0,void 0,(function*(){let n;return this.subTreeRefreshPromises.forEach((o,s)=>{!n&&function(e,t){return e===t||f(e,t)||f(t,e)}(s,e)&&(n=o.then(()=>this.refreshNode(e,t,i)))}),n||this.doRefreshSubTree(e,t,i)}))}doRefreshSubTree(e,t,i){return r(this,void 0,void 0,(function*(){let n;e.refreshPromise=new Promise(e=>n=e),this.subTreeRefreshPromises.set(e,e.refreshPromise),e.refreshPromise.finally(()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)});try{const o=yield this.doRefreshNode(e,t,i);e.stale=!1,yield Promise.all(o.map(e=>this.doRefreshSubTree(e,t,i)))}finally{n()}}))}doRefreshNode(e,t,i){return r(this,void 0,void 0,(function*(){let n;if(e.hasChildren=!!this.dataSource.hasChildren(e.element),e.hasChildren){const t=l.timeout(800);t.then(()=>{e.slow=!0, +this._onDidChangeNodeSlowState.fire(e)},e=>null),n=this.doGetChildren(e).finally(()=>t.cancel())}else n=Promise.resolve(d.Iterable.empty());try{const o=yield n;return this.setChildren(e,o,t,i)}catch(t){if(e!==this.root&&this.tree.collapse(e===this.root?null:e),h.isPromiseCanceledError(t))return[];throw t}finally{e.slow&&(e.slow=!1,this._onDidChangeNodeSlowState.fire(e))}}))}doGetChildren(e){let t=this.refreshPromises.get(e);return t||(t=l.createCancelablePromise(()=>r(this,void 0,void 0,(function*(){const t=yield this.dataSource.getChildren(e.element);return this.processChildren(t)}))),this.refreshPromises.set(e,t),t.finally(()=>{this.refreshPromises.delete(e)}))}_onDidChangeCollapseState({node:e,deep:t}){null!==e.element&&!e.collapsed&&e.element.stale&&(t?this.collapse(e.element.element):this.refreshAndRenderNode(e.element,!1).catch(h.onUnexpectedError))}setChildren(e,t,i,n){const o=[...t];if(0===e.children.length&&0===o.length)return[];const s=new Map,r=new Map +;for(const t of e.children)if(s.set(t.element,t),this.identityProvider){const e=this.tree.isCollapsed(t);r.set(t.id,{node:t,collapsed:e})}const a=[],l=o.map(t=>{const o=!!this.dataSource.hasChildren(t);if(!this.identityProvider){const i=m({element:t,parent:e,hasChildren:o});return o&&this.collapseByDefault&&!this.collapseByDefault(t)&&(i.collapsedByDefault=!1,a.push(i)),i}const l=this.identityProvider.getId(t).toString(),d=r.get(l);if(d){const e=d.node;return s.delete(e.element),this.nodes.delete(e.element),this.nodes.set(t,e),e.element=t,e.hasChildren=o,i?d.collapsed?(e.children.forEach(e=>L(e,e=>this.nodes.delete(e.element))),e.children.splice(0,e.children.length),e.stale=!0):a.push(e):o&&this.collapseByDefault&&!this.collapseByDefault(t)&&(e.collapsedByDefault=!1,a.push(e)),e}const c=m({element:t,parent:e,id:l,hasChildren:o});return n&&n.viewState.focus&&n.viewState.focus.indexOf(l)>-1&&n.focus.push(c),n&&n.viewState.selection&&n.viewState.selection.indexOf(l)>-1&&n.selection.push(c), +n&&n.viewState.expanded&&n.viewState.expanded.indexOf(l)>-1?a.push(c):o&&this.collapseByDefault&&!this.collapseByDefault(t)&&(c.collapsedByDefault=!1,a.push(c)),c});for(const e of s.values())L(e,e=>this.nodes.delete(e.element));for(const e of l)this.nodes.set(e.element,e);return e.children.splice(0,e.children.length,...l),e!==this.root&&this.autoExpandSingleChildren&&1===l.length&&0===a.length&&(l[0].collapsedByDefault=!1,a.push(l[0])),a}render(e,t){const i=e.children.map(e=>this.asTreeElement(e,t));this.tree.setChildren(e===this.root?null:e,i),e!==this.root&&this.tree.setCollapsible(e,e.hasChildren),this._onDidRender.fire()}asTreeElement(e,t){if(e.stale)return{element:e,collapsible:e.hasChildren,collapsed:!0};let i;return i=!(t&&t.viewState.expanded&&e.id&&t.viewState.expanded.indexOf(e.id)>-1)&&e.collapsedByDefault,e.collapsedByDefault=void 0,{element:e,children:e.hasChildren?d.Iterable.map(e.children,e=>this.asTreeElement(e,t)):[],collapsible:e.hasChildren,collapsed:i}}processChildren(e){ +return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),e}dispose(){this.disposables.dispose()}}t.AsyncDataTree=x;class D{constructor(e){this.node=e}get element(){return{elements:this.node.element.elements.map(e=>e.element),incompressible:this.node.element.incompressible}}get children(){return this.node.children.map(e=>new D(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}}class k{constructor(e,t,i,n){this.renderer=e,this.nodeMapper=t,this.compressibleNodeMapperProvider=i,this.onDidChangeTwistieState=n,this.renderedNodes=new Map,this.disposables=[],this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){ +this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,n)}renderCompressedElements(e,t,i,n){this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e),t,i.templateData,n)}renderTwistie(e,t){return e.slow?u.addClasses(t,p.treeItemLoadingIcon.classNames):u.removeClasses(t,p.treeItemLoadingIcon.classNames),!1}disposeElement(e,t,i,n){this.renderer.disposeElement&&this.renderer.disposeElement(this.nodeMapper.map(e),t,i.templateData,n)}disposeCompressedElements(e,t,i,n){this.renderer.disposeCompressedElements&&this.renderer.disposeCompressedElements(this.compressibleNodeMapperProvider().map(e),t,i.templateData,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=s.dispose(this.disposables)}}t.CompressibleAsyncDataTree=class extends x{constructor(e,t,i,n,s,r,a={}){super(e,t,i,s,r,a),this.compressionDelegate=n,this.compressibleNodeMapper=new o.WeakMapper(e=>new D(e)),this.filter=a.filter}createTree(e,t,o,s,r){ +const a=new i.ComposedTreeDelegate(o),l=s.map(e=>new k(e,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),d=function(e){const t=e&&E(e);return t&&Object.assign(Object.assign({},t),{keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},t.keyboardNavigationLabelProvider),{getCompressedNodeKeyboardNavigationLabel:t=>e.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map(e=>e.element))})})}(r)||{};return new n.CompressibleObjectTree(e,t,a,l,d)}asTreeElement(e,t){return Object.assign({incompressible:this.compressionDelegate.isIncompressible(e.element)},super.asTreeElement(e,t))}updateOptions(e={}){this.tree.updateOptions(e)}render(e,t){if(!this.identityProvider)return super.render(e,t);const i=e=>this.identityProvider.getId(e).toString(),n=e=>{const t=new Set;for(const n of e){const e=this.tree.getCompressedTreeNode(n===this.root?null:n);if(e.element)for(const n of e.element.elements)t.add(i(n.element))} +return t},o=n(this.tree.getSelection()),s=n(this.tree.getFocus());super.render(e,t);const r=this.getSelection();let a=!1;const l=this.getFocus();let d=!1;const c=e=>{const t=e.element;if(t)for(let e=0;e{const t=function(e){return"boolean"==typeof e?e?1:0:g.isFilterResult(e)?g.getVisibleState(e.visibility):g.getVisibleState(e)}(this.filter.filter(e,1));if(2===t)throw new Error("Recursive tree visibility not supported in async data compressed trees");return 1===t})),super.processChildren(e)}}})),define(t[422],i([5,6]),(function(e,t){return e.create("vs/base/common/errorMessage",t)})),define(t[423],i([0,1,422,23,19]),(function(e,t,i,n,o){ +"use strict";function s(e,t){return t&&(e.stack||e.stacktrace)?i.localize(0,null,a(e),r(e.stack)||r(e.stacktrace)):a(e)}function r(e){return Array.isArray(e)?e.join("\n"):e}function a(e){return"string"==typeof e.code&&"number"==typeof e.errno&&"string"==typeof e.syscall?i.localize(1,null,e.message):e.message||i.localize(2,null)}Object.defineProperty(t,"__esModule",{value:!0}),t.toErrorMessage=void 0,t.toErrorMessage=function e(t=null,r=!1){if(!t)return i.localize(3,null);if(Array.isArray(t)){const n=o.coalesce(t),s=e(n[0],r);return n.length>1?i.localize(4,null,s,n.length):s}if(n.isString(t))return t;if(t.detail){const e=t.detail;if(e.error)return s(e.error,r);if(e.exception)return s(e.exception,r)}return t.stack?s(t,r):t.message?t.message:i.localize(5,null)}})),define(t[424],i([5,6]),(function(e,t){return e.create("vs/base/common/keybindingLabels",t)})),define(t[227],i([0,1,424]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}), +t.AriaLabelProvider=t.UILabelProvider=t.ModifierLabelProvider=void 0;class n{constructor(e,t,i=t){this.modifierLabels=[null],this.modifierLabels[2]=e,this.modifierLabels[1]=t,this.modifierLabels[3]=i}toLabel(e,t,i){if(0===t.length)return null;const n=[];for(let s=0,r=t.length;s{t.checkbox.offsetParent||e.preventDefault()})),t.checkbox=i.append(n,S("input.quick-input-list-checkbox")),t.checkbox.type="checkbox",t.toDisposeTemplate.push(i.addStandardDisposableListener(t.checkbox,i.EventType.CHANGE,e=>{t.element.checked=t.checkbox.checked}));const o=i.append(n,S(".quick-input-list-rows")),s=i.append(o,S(".quick-input-list-row")),r=i.append(o,S(".quick-input-list-row"));t.label=new c.IconLabel(s,{supportHighlights:!0,supportDescriptionHighlights:!0,supportCodicons:!0});const a=i.append(s,S(".quick-input-list-entry-keybinding"));t.keybinding=new C.KeybindingLabel(a,p.OS);const l=i.append(r,S(".quick-input-list-label-meta"));return t.detail=new h.HighlightedLabel(l,!0),t.separator=i.append(t.entry,S(".quick-input-list-separator")), +t.actionBar=new m.ActionBar(t.entry),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.push(t.actionBar),t}renderElement(e,t,o){o.toDisposeElement=n.dispose(o.toDisposeElement),o.element=e,o.checkbox.checked=e.checked,o.toDisposeElement.push(e.onChecked(e=>o.checkbox.checked=e));const{labelHighlights:s,descriptionHighlights:r,detailHighlights:a}=e,l=Object.create(null);l.matches=s||[],l.descriptionTitle=e.saneDescription,l.descriptionMatches=r||[],l.extraClasses=e.item.iconClasses,l.italic=e.item.italic,l.strikethrough=e.item.strikethrough,o.label.setLabel(e.saneLabel,e.saneDescription,l),o.keybinding.set(e.item.keybinding),o.detail.set(e.saneDetail,a),e.separator&&e.separator.label?(o.separator.textContent=e.separator.label,o.separator.style.display=""):o.separator.style.display="none",e.separator?i.addClass(o.entry,"quick-input-list-separator-border"):i.removeClass(o.entry,"quick-input-list-separator-border"),o.actionBar.clear();const d=e.item.buttons +;d&&d.length?(o.actionBar.push(d.map((t,i)=>{let n=t.iconClass||(t.iconPath?_.getIconClass(t.iconPath):void 0);t.alwaysVisible&&(n=n?`${n} always-visible`:"always-visible");const o=new f.Action(`id-${i}`,"",n,!0,()=>(e.fireButtonTriggered({button:t,item:e.item}),Promise.resolve()));return o.tooltip=t.tooltip||"",o}),{icon:!0,label:!1}),i.addClass(o.entry,"has-actions")):i.removeClass(o.entry,"has-actions")}disposeElement(e,t,i){i.toDisposeElement=n.dispose(i.toDisposeElement)}disposeTemplate(e){e.toDisposeElement=n.dispose(e.toDisposeElement),e.toDisposeTemplate=n.dispose(e.toDisposeTemplate)}}y.ID="listelement";class E{getHeight(e){return e.saneDetail?44:22}getTemplateId(e){return y.ID}}var L;!function(e){e[e.First=1]="First",e[e.Second=2]="Second",e[e.Last=3]="Last",e[e.Next=4]="Next",e[e.Previous=5]="Previous",e[e.NextPage=6]="NextPage",e[e.PreviousPage=7]="PreviousPage"}(L=t.QuickInputListFocus||(t.QuickInputListFocus={}));class x{constructor(e,t,n){this.parent=e,this.inputElements=[],this.elements=[], +this.elementsToIndexes=new Map,this.matchOnDescription=!1,this.matchOnDetail=!1,this.matchOnLabel=!0,this.sortByLabel=!0,this._onChangedAllVisibleChecked=new r.Emitter,this.onChangedAllVisibleChecked=this._onChangedAllVisibleChecked.event,this._onChangedCheckedCount=new r.Emitter,this.onChangedCheckedCount=this._onChangedCheckedCount.event,this._onChangedVisibleCount=new r.Emitter,this.onChangedVisibleCount=this._onChangedVisibleCount.event,this._onChangedCheckedElements=new r.Emitter,this.onChangedCheckedElements=this._onChangedCheckedElements.event,this._onButtonTriggered=new r.Emitter,this.onButtonTriggered=this._onButtonTriggered.event,this._onKeyDown=new r.Emitter,this.onKeyDown=this._onKeyDown.event,this._onLeave=new r.Emitter,this.onLeave=this._onLeave.event,this._fireCheckedEvents=!0,this.elementDisposables=[],this.disposables=[],this.id=t,this.container=i.append(this.parent,S(".quick-input-list"));const o=new E,s=new D;this.list=n.createList("QuickInput",this.container,o,[new y],{identityProvider:{ +getId:e=>e.saneLabel},setRowLineHeight:!1,multipleSelectionSupport:!1,horizontalScrolling:!1,accessibilityProvider:s}),this.list.getHTMLElement().id=t,this.disposables.push(this.list),this.disposables.push(this.list.onKeyDown(e=>{const t=new d.StandardKeyboardEvent(e);switch(t.keyCode){case 10:this.toggleCheckbox();break;case 31:(p.isMacintosh?e.metaKey:e.ctrlKey)&&this.list.setFocus(g.range(this.list.length));break;case 16:const t=this.list.getFocus();1===t.length&&0===t[0]&&this._onLeave.fire();break;case 18:const i=this.list.getFocus();1===i.length&&i[0]===this.list.length-1&&this._onLeave.fire()}this._onKeyDown.fire(t)})),this.disposables.push(this.list.onMouseDown(e=>{2!==e.browserEvent.button&&e.browserEvent.preventDefault()})),this.disposables.push(i.addDisposableListener(this.container,i.EventType.CLICK,e=>{(e.x||e.y)&&this._onLeave.fire()})),this.disposables.push(this.list.onMouseMiddleClick(e=>{this._onLeave.fire()})),this.disposables.push(this.list.onContextMenu(e=>{ +"number"==typeof e.index&&(e.browserEvent.preventDefault(),this.list.setSelection([e.index]))})),this.disposables.push(this._onChangedAllVisibleChecked,this._onChangedCheckedCount,this._onChangedVisibleCount,this._onChangedCheckedElements,this._onButtonTriggered,this._onLeave,this._onKeyDown)}get onDidChangeFocus(){return r.Event.map(this.list.onDidChangeFocus,e=>e.elements.map(e=>e.item))}get onDidChangeSelection(){return r.Event.map(this.list.onDidChangeSelection,e=>({items:e.elements.map(e=>e.item),event:e.browserEvent}))}getAllVisibleChecked(){return this.allVisibleChecked(this.elements,!1)}allVisibleChecked(e,t=!0){for(let i=0,n=e.length;i{ +t.hidden||(t.checked=e)})}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}setElements(e){this.elementDisposables=n.dispose(this.elementDisposables);const t=e=>this.fireButtonTriggered(e);this.inputElements=e,this.elements=e.reduce((i,n,s)=>{var r,a,l;if("separator"!==n.type){const d=s&&e[s-1],c=n.label&&n.label.replace(/\r?\n/g," "),h=n.description&&n.description.replace(/\r?\n/g," "),u=n.detail&&n.detail.replace(/\r?\n/g," "),g=n.ariaLabel||[c,h,u].map(e=>e&&o.parseCodicons(e).text).filter(e=>!!e).join(", ");i.push(new w({index:s,item:n,saneLabel:c,saneAriaLabel:g,saneDescription:h,saneDetail:u,labelHighlights:null===(r=n.highlights)||void 0===r?void 0:r.label,descriptionHighlights:null===(a=n.highlights)||void 0===a?void 0:a.description,detailHighlights:null===(l=n.highlights)||void 0===l?void 0:l.detail,checked:!1,separator:d&&"separator"===d.type?d:void 0,fireButtonTriggered:t}))}return i},[]),this.elementDisposables.push(...this.elements), +this.elementDisposables.push(...this.elements.map(e=>e.onChecked(()=>this.fireCheckedEvents()))),this.elementsToIndexes=this.elements.reduce((e,t,i)=>(e.set(t.item,i),e),new Map),this.list.splice(0,this.list.length),this.list.splice(0,this.list.length,this.elements),this._onChangedVisibleCount.fire(this.elements.length)}getFocusedElements(){return this.list.getFocusedElements().map(e=>e.item)}setFocusedElements(e){if(this.list.setFocus(e.filter(e=>this.elementsToIndexes.has(e)).map(e=>this.elementsToIndexes.get(e))),e.length>0){const e=this.list.getFocus()[0];"number"==typeof e&&this.list.reveal(e)}}getActiveDescendant(){return this.list.getHTMLElement().getAttribute("aria-activedescendant")}setSelectedElements(e){this.list.setSelection(e.filter(e=>this.elementsToIndexes.has(e)).map(e=>this.elementsToIndexes.get(e)))}getCheckedElements(){return this.elements.filter(e=>e.checked).map(e=>e.item)}setCheckedElements(e){try{this._fireCheckedEvents=!1;const t=new Set;for(const i of e)t.add(i) +;for(const e of this.elements)e.checked=t.has(e.item)}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}set enabled(e){this.list.getHTMLElement().style.pointerEvents=e?"":"none"}focus(e){if(!this.list.length)return;switch(e===L.Next&&this.list.getFocus()[0]===this.list.length-1&&(e=L.First),e===L.Previous&&0===this.list.getFocus()[0]&&(e=L.Last),e===L.Second&&this.list.length<2&&(e=L.First),e){case L.First:this.list.focusFirst();break;case L.Second:this.list.focusNth(1);break;case L.Last:this.list.focusLast();break;case L.Next:this.list.focusNext();break;case L.Previous:this.list.focusPrevious();break;case L.NextPage:this.list.focusNextPage();break;case L.PreviousPage:this.list.focusPreviousPage()}const t=this.list.getFocus()[0];"number"==typeof t&&this.list.reveal(t)}clearFocus(){this.list.setFocus([])}domFocus(){this.list.domFocus()}layout(e){this.list.getHTMLElement().style.maxHeight=e?`calc(${44*Math.floor(e/44)}px)`:"",this.list.layout()}filter(e){ +if(!(this.sortByLabel||this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))return this.list.layout(),!1;(e=e.trim())&&(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail)?this.elements.forEach(t=>{const i=this.matchOnLabel?v.withNullAsUndefined(o.matchesFuzzyCodiconAware(e,o.parseCodicons(t.saneLabel))):void 0,n=this.matchOnDescription?v.withNullAsUndefined(o.matchesFuzzyCodiconAware(e,o.parseCodicons(t.saneDescription||""))):void 0,s=this.matchOnDetail?v.withNullAsUndefined(o.matchesFuzzyCodiconAware(e,o.parseCodicons(t.saneDetail||""))):void 0;i||n||s?(t.labelHighlights=i,t.descriptionHighlights=n,t.detailHighlights=s,t.hidden=!1):(t.labelHighlights=void 0,t.descriptionHighlights=void 0,t.detailHighlights=void 0,t.hidden=!t.item.alwaysShow),t.separator=void 0}):this.elements.forEach(e=>{e.labelHighlights=void 0,e.descriptionHighlights=void 0,e.detailHighlights=void 0,e.hidden=!1;const t=e.index&&this.inputElements[e.index-1];e.separator=t&&"separator"===t.type?t:void 0}) +;const t=this.elements.filter(e=>!e.hidden);if(this.sortByLabel&&e){const i=e.toLowerCase();t.sort((e,t)=>(function(e,t,i){const n=e.labelHighlights||[],o=t.labelHighlights||[];if(n.length&&!o.length)return-1;if(!n.length&&o.length)return 1;if(0===n.length&&0===o.length)return 0;return s.compareAnything(e.saneLabel,t.saneLabel,i)})(e,t,i))}return this.elementsToIndexes=t.reduce((e,t,i)=>(e.set(t.item,i),e),new Map),this.list.splice(0,this.list.length,t),this.list.setFocus([]),this.list.layout(),this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedVisibleCount.fire(t.length),!0}toggleCheckbox(){try{this._fireCheckedEvents=!1;const e=this.list.getFocusedElements(),t=this.allVisibleChecked(e);for(const i of e)i.checked=!t}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}display(e){this.container.style.display=e?"":"none"}isDisplayed(){return"none"!==this.container.style.display}dispose(){this.elementDisposables=n.dispose(this.elementDisposables), +this.disposables=n.dispose(this.disposables)}fireCheckedEvents(){this._fireCheckedEvents&&(this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedCheckedCount.fire(this.getCheckedCount()),this._onChangedCheckedElements.fire(this.getCheckedElements()))}fireButtonTriggered(e){this._onButtonTriggered.fire(e)}style(e){this.list.style(e)}}a([u.memoize],x.prototype,"onDidChangeFocus",null),a([u.memoize],x.prototype,"onDidChangeSelection",null),t.QuickInputList=x;class D{getWidgetAriaLabel(){return b.localize(0,null)}getAriaLabel(e){return e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(){return"option"}}})),define(t[429],i([0,1,195,7,25,428,415,53,426,198,298,4,284,2,77,79,47,19,15,202,26,119]),(function(e,t,i,n,o,s,a,l,d,c,h,u,g,p,m,f,_,v,C,b,S){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QuickInputController=void 0;const w=n.$,y={iconClass:S.registerIcon("quick-input-back",S.Codicon.arrowLeft).classNames,tooltip:d.localize(0,null),handle:-1} +;class E extends p.Disposable{constructor(e){super(),this.ui=e,this.visible=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._buttons=[],this.buttonsUpdated=!1,this.onDidTriggerButtonEmitter=this._register(new u.Emitter),this.onDidHideEmitter=this._register(new u.Emitter),this.onDisposeEmitter=this._register(new u.Emitter),this.visibleDisposables=this._register(new p.DisposableStore),this.onDidHide=this.onDidHideEmitter.event}get title(){return this._title}set title(e){this._title=e,this.update()}get description(){return this._description}set description(e){this._description=e,this.update()}get step(){return this._steps}set step(e){this._steps=e,this.update()}get totalSteps(){return this._totalSteps}set totalSteps(e){this._totalSteps=e,this.update()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this.update()}get contextKey(){return this._contextKey}set contextKey(e){this._contextKey=e,this.update()}get busy(){return this._busy}set busy(e){this._busy=e,this.update()} +get ignoreFocusOut(){return this._ignoreFocusOut}set ignoreFocusOut(e){this._ignoreFocusOut=e,this.update()}get buttons(){return this._buttons}set buttons(e){this._buttons=e,this.buttonsUpdated=!0,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.onDidTriggerButton(e=>{-1!==this.buttons.indexOf(e)&&this.onDidTriggerButtonEmitter.fire(e)})),this.ui.show(this),this.visible=!0,this.update())}hide(){this.visible&&this.ui.hide()}didHide(){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire()}update(){if(!this.visible)return;const e=this.getTitle();e&&this.ui.title.textContent!==e?this.ui.title.textContent=e:e||" "===this.ui.title.innerHTML||(this.ui.title.innerText=" ;");const t=this.getDescription();if(this.ui.description.textContent!==t&&(this.ui.description.textContent=t),this.busy&&!this.busyDelay&&(this.busyDelay=new C.TimeoutTimer,this.busyDelay.setIfNotSet(()=>{this.visible&&this.ui.progressBar.infinite()},800)), +!this.busy&&this.busyDelay&&(this.ui.progressBar.stop(),this.busyDelay.cancel(),this.busyDelay=void 0),this.buttonsUpdated){this.buttonsUpdated=!1,this.ui.leftActionBar.clear();const e=this.buttons.filter(e=>e===y);this.ui.leftActionBar.push(e.map((e,t)=>{const i=new _.Action(`id-${t}`,"",e.iconClass||b.getIconClass(e.iconPath),!0,()=>r(this,void 0,void 0,(function*(){this.onDidTriggerButtonEmitter.fire(e)})));return i.tooltip=e.tooltip||"",i}),{icon:!0,label:!1}),this.ui.rightActionBar.clear();const t=this.buttons.filter(e=>e!==y);this.ui.rightActionBar.push(t.map((e,t)=>{const i=new _.Action(`id-${t}`,"",e.iconClass||b.getIconClass(e.iconPath),!0,()=>r(this,void 0,void 0,(function*(){this.onDidTriggerButtonEmitter.fire(e)})));return i.tooltip=e.tooltip||"",i}),{icon:!0,label:!1})}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey)}getTitle(){ +return this.title&&this.step?`${this.title} (${this.getSteps()})`:this.title?this.title:this.step?this.getSteps():""}getDescription(){return this.description||""}getSteps(){return this.step&&this.totalSteps?d.localize(1,null,this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e===m.default.Error){const t=this.ui.inputBox.stylesForType(e);this.ui.message.style.color=t.foreground?`${t.foreground}`:"",this.ui.message.style.backgroundColor=t.background?`${t.background}`:"",this.ui.message.style.border=t.border?`1px solid ${t.border}`:"",this.ui.message.style.paddingBottom="4px"}else this.ui.message.style.color="",this.ui.message.style.backgroundColor="",this.ui.message.style.border="",this.ui.message.style.paddingBottom=""}dispose(){this.hide(),this.onDisposeEmitter.fire(),super.dispose()}}class L extends E{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new u.Emitter), +this.onDidAcceptEmitter=this._register(new u.Emitter),this.onDidCustomEmitter=this._register(new u.Emitter),this._items=[],this.itemsUpdated=!1,this._canSelectMany=!1,this._canAcceptInBackground=!1,this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._sortByLabel=!0,this._autoFocusOnList=!0,this._itemActivation=this.ui.isScreenReaderOptimized()?i.ItemActivation.NONE:i.ItemActivation.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new u.Emitter),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new u.Emitter),this.onDidTriggerItemButtonEmitter=this._register(new u.Emitter),this.valueSelectionUpdated=!0,this._ok="default",this._customButton=!1,this.filterValue=e=>e,this.onDidChangeValue=this.onDidChangeValueEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event,this.onDidChangeActive=this.onDidChangeActiveEmitter.event, +this.onDidChangeSelection=this.onDidChangeSelectionEmitter.event,this.onDidTriggerItemButton=this.onDidTriggerItemButtonEmitter.event}get quickNavigate(){return this._quickNavigate}set quickNavigate(e){this._quickNavigate=e,this.update()}get value(){return this._value}set value(e){this._value=e||"",this.update()}set ariaLabel(e){this._ariaLabel=e,this.update()}get ariaLabel(){return this._ariaLabel}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get items(){return this._items}set items(e){this._items=e,this.itemsUpdated=!0,this.update()}get canSelectMany(){return this._canSelectMany}set canSelectMany(e){this._canSelectMany=e,this.update()}get canAcceptInBackground(){return this._canAcceptInBackground}set canAcceptInBackground(e){this._canAcceptInBackground=e}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e,this.update()}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){ +this._matchOnDetail=e,this.update()}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e,this.update()}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e,this.update()}get autoFocusOnList(){return this._autoFocusOnList}set autoFocusOnList(e){this._autoFocusOnList=e,this.update()}get itemActivation(){return this._itemActivation}set itemActivation(e){this._itemActivation=e}get activeItems(){return this._activeItems}set activeItems(e){this._activeItems=e,this.activeItemsUpdated=!0,this.update()}get selectedItems(){return this._selectedItems}set selectedItems(e){this._selectedItems=e,this.selectedItemsUpdated=!0,this.update()}get keyMods(){return this._quickNavigate?i.NO_KEY_MODS:this.ui.keyMods}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get validationMessage(){return this._validationMessage}set validationMessage(e){this._validationMessage=e,this.update()}get customButton(){return this._customButton} +set customButton(e){this._customButton=e,this.update()}get customLabel(){return this._customButtonLabel}set customLabel(e){this._customButtonLabel=e,this.update()}get customHover(){return this._customButtonHover}set customHover(e){this._customButtonHover=e,this.update()}get ok(){return this._ok}set ok(e){this._ok=e,this.update()}get hideInput(){return!!this._hideInput}set hideInput(e){this._hideInput=e,this.update()}trySelectFirst(){this.autoFocusOnList&&(this.canSelectMany||this.ui.list.focus(s.QuickInputListFocus.First))}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{if(e===this.value)return;this._value=e,this.ui.list.filter(this.filterValue(this.ui.inputBox.value))&&this.trySelectFirst(),this.onDidChangeValueEmitter.fire(e)})),this.visibleDisposables.add(this.ui.inputBox.onMouseDown(e=>{this.autoFocusOnList||this.ui.list.clearFocus()})),this.visibleDisposables.add((this._hideInput?this.ui.list:this.ui.inputBox).onKeyDown(e=>{switch(e.keyCode){case 18: +this.ui.list.focus(s.QuickInputListFocus.Next),this.canSelectMany&&this.ui.list.domFocus(),n.EventHelper.stop(e,!0);break;case 16:this.ui.list.getFocusedElements().length?this.ui.list.focus(s.QuickInputListFocus.Previous):this.ui.list.focus(s.QuickInputListFocus.Last),this.canSelectMany&&this.ui.list.domFocus(),n.EventHelper.stop(e,!0);break;case 12:this.ui.list.focus(s.QuickInputListFocus.NextPage),this.canSelectMany&&this.ui.list.domFocus(),n.EventHelper.stop(e,!0);break;case 11:this.ui.list.focus(s.QuickInputListFocus.PreviousPage),this.canSelectMany&&this.ui.list.domFocus(),n.EventHelper.stop(e,!0);break;case 17:if(!this._canAcceptInBackground)return;if(!this.ui.inputBox.isSelectionAtEnd())return;this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.onDidAcceptEmitter.fire({inBackground:!0}));break;case 14:!e.ctrlKey&&!e.metaKey||e.shiftKey||e.altKey||(this.ui.list.focus(s.QuickInputListFocus.First),n.EventHelper.stop(e,!0));break +;case 13:!e.ctrlKey&&!e.metaKey||e.shiftKey||e.altKey||(this.ui.list.focus(s.QuickInputListFocus.Last),n.EventHelper.stop(e,!0))}})),this.visibleDisposables.add(this.ui.onDidAccept(()=>{!this.canSelectMany&&this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.onDidAcceptEmitter.fire({inBackground:!1})})),this.visibleDisposables.add(this.ui.onDidCustom(()=>{this.onDidCustomEmitter.fire()})),this.visibleDisposables.add(this.ui.list.onDidChangeFocus(e=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&v.equals(e,this._activeItems,(e,t)=>e===t)||(this._activeItems=e,this.onDidChangeActiveEmitter.fire(e))})),this.visibleDisposables.add(this.ui.list.onDidChangeSelection(({items:e,event:t})=>{this.canSelectMany?e.length&&this.ui.list.setSelectedElements([]):this.selectedItemsToConfirm!==this._selectedItems&&v.equals(e,this._selectedItems,(e,t)=>e===t)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e), +e.length&&this.onDidAcceptEmitter.fire({inBackground:t instanceof MouseEvent&&1===t.button}))})),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(e=>{this.canSelectMany&&(this.selectedItemsToConfirm!==this._selectedItems&&v.equals(e,this._selectedItems,(e,t)=>e===t)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e)))})),this.visibleDisposables.add(this.ui.list.onButtonTriggered(e=>this.onDidTriggerItemButtonEmitter.fire(e))),this.visibleDisposables.add(this.registerQuickNavigation()),this.valueSelectionUpdated=!0),super.show()}registerQuickNavigation(){return n.addDisposableListener(this.ui.container,n.EventType.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new l.StandardKeyboardEvent(e),i=t.keyCode;this._quickNavigate.keybindings.some(e=>{const[n,o]=e.getParts();return!o&&(n.shiftKey&&4===i?!(t.ctrlKey||t.altKey||t.metaKey):!(!n.altKey||6!==i)||(!(!n.ctrlKey||5!==i)||!(!n.metaKey||57!==i))) +})&&(this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.onDidAcceptEmitter.fire({inBackground:!1})),this._quickNavigate=void 0)})}update(){if(!this.visible)return;let e=!1,t=!1;this._hideInput&&this._items.length>0&&(this.ui.isScreenReaderOptimized()?t=!0:e=!0),n.toggleClass(this.ui.container,"hidden-input",e);const o={title:!!this.title||!!this.step||!!this.buttons.length,description:!!this.description,checkAll:this.canSelectMany,inputBox:!e,progressBar:!e,visibleCount:!0,count:this.canSelectMany,ok:"default"===this.ok?this.canSelectMany:this.ok,list:!0,message:!!this.validationMessage,customButton:this.customButton};if(this.ui.setVisibilities(o),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})), +this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||""),t)this.ui.inputBox.ariaLabel="";else{const e=this.ariaLabel||this.placeholder||L.DEFAULT_ARIA_LABEL;this.ui.inputBox.ariaLabel!==e&&(this.ui.inputBox.ariaLabel=e)}if(this.ui.list.matchOnDescription=this.matchOnDescription,this.ui.list.matchOnDetail=this.matchOnDetail,this.ui.list.matchOnLabel=this.matchOnLabel,this.ui.list.sortByLabel=this.sortByLabel,this.itemsUpdated)switch(this.itemsUpdated=!1,this.ui.list.setElements(this.items),this.ui.list.filter(this.filterValue(this.ui.inputBox.value)),this.ui.checkAll.checked=this.ui.list.getAllVisibleChecked(),this.ui.visibleCount.setCount(this.ui.list.getVisibleCount()),this.ui.count.setCount(this.ui.list.getCheckedCount()),this._itemActivation){case i.ItemActivation.NONE:this._itemActivation=i.ItemActivation.FIRST;break;case i.ItemActivation.SECOND:this.ui.list.focus(s.QuickInputListFocus.Second),this._itemActivation=i.ItemActivation.FIRST;break +;case i.ItemActivation.LAST:this.ui.list.focus(s.QuickInputListFocus.Last),this._itemActivation=i.ItemActivation.FIRST;break;default:this.trySelectFirst()}this.ui.container.classList.contains("show-checkboxes")!==!!this.canSelectMany&&(this.canSelectMany?this.ui.list.clearFocus():this.trySelectFirst()),this.activeItemsUpdated&&(this.activeItemsUpdated=!1,this.activeItemsToConfirm=this._activeItems,this.ui.list.setFocusedElements(this.activeItems),this.activeItemsToConfirm===this._activeItems&&(this.activeItemsToConfirm=null)),this.selectedItemsUpdated&&(this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=this._selectedItems,this.canSelectMany?this.ui.list.setCheckedElements(this.selectedItems):this.ui.list.setSelectedElements(this.selectedItems),this.selectedItemsToConfirm===this._selectedItems&&(this.selectedItemsToConfirm=null)),this.validationMessage?(this.ui.message.textContent=this.validationMessage,this.showMessageDecoration(m.default.Error)):(this.ui.message.textContent=null, +this.showMessageDecoration(m.default.Ignore)),this.ui.customButton.label=this.customLabel||"",this.ui.customButton.element.title=this.customHover||"",this.ui.setComboboxAccessibility(!0),o.inputBox||this.ui.list.domFocus()}}L.DEFAULT_ARIA_LABEL=d.localize(2,null);class x extends p.Disposable{constructor(e){super(),this.options=e,this.comboboxAccessibility=!1,this.enabled=!0,this.onDidAcceptEmitter=this._register(new u.Emitter),this.onDidCustomEmitter=this._register(new u.Emitter),this.onDidTriggerButtonEmitter=this._register(new u.Emitter),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new u.Emitter),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new u.Emitter),this.onHide=this.onHideEmitter.event,this.idPrefix=e.idPrefix,this.parentElement=e.container,this.styles=e.styles,this.registerKeyModsListeners()}registerKeyModsListeners(){const e=e=>{this.keyMods.ctrlCmd=e.ctrlKey||e.metaKey,this.keyMods.alt=e.altKey} +;this._register(n.addDisposableListener(window,n.EventType.KEY_DOWN,e,!0)),this._register(n.addDisposableListener(window,n.EventType.KEY_UP,e,!0)),this._register(n.addDisposableListener(window,n.EventType.MOUSE_DOWN,e,!0))}getUI(){if(this.ui)return this.ui;const e=n.append(this.parentElement,w(".quick-input-widget.show-file-icons"));e.tabIndex=-1,e.style.display="none";const t=n.createStyleSheet(e),i=n.append(e,w(".quick-input-titlebar")),o=this._register(new f.ActionBar(i));o.domNode.classList.add("quick-input-left-action-bar");const r=n.append(i,w(".quick-input-title")),u=this._register(new f.ActionBar(i));u.domNode.classList.add("quick-input-right-action-bar");const p=n.append(e,w(".quick-input-description")),m=n.append(e,w(".quick-input-header")),_=n.append(m,w("input.quick-input-check-all"));_.type="checkbox",this._register(n.addStandardDisposableListener(_,n.EventType.CHANGE,e=>{const t=_.checked;T.setAllVisibleChecked(t)})),this._register(n.addDisposableListener(_,n.EventType.CLICK,e=>{ +(e.x||e.y)&&b.setFocus()}));const v=n.append(m,w(".quick-input-and-message")),C=n.append(v,w(".quick-input-filter")),b=this._register(new a.QuickInputBox(C));b.setAttribute("aria-describedby",`${this.idPrefix}message`);const S=n.append(C,w(".quick-input-visible-count"));S.setAttribute("aria-live","polite"),S.setAttribute("aria-atomic","true");const y=new c.CountBadge(S,{countFormat:d.localize(3,null)}),E=n.append(C,w(".quick-input-count"));E.setAttribute("aria-live","polite");const x=new c.CountBadge(E,{countFormat:d.localize(4,null)}),D=n.append(m,w(".quick-input-action")),k=new g.Button(D);k.label=d.localize(5,null),this._register(k.onDidClick(e=>{this.onDidAcceptEmitter.fire()}));const N=n.append(m,w(".quick-input-action")),I=new g.Button(N);I.label=d.localize(6,null),this._register(I.onDidClick(e=>{this.onDidCustomEmitter.fire()}));const M=n.append(v,w(`#${this.idPrefix}message.quick-input-message`)),R=new h.ProgressBar(e);n.addClass(R.getContainer(),"quick-input-progress") +;const T=this._register(new s.QuickInputList(e,this.idPrefix+"list",this.options));this._register(T.onChangedAllVisibleChecked(e=>{_.checked=e})),this._register(T.onChangedVisibleCount(e=>{y.setCount(e)})),this._register(T.onChangedCheckedCount(e=>{x.setCount(e)})),this._register(T.onLeave(()=>{setTimeout(()=>{b.setFocus(),this.controller instanceof L&&this.controller.canSelectMany&&T.clearFocus()},0)})),this._register(T.onDidChangeFocus(()=>{this.comboboxAccessibility&&this.getUI().inputBox.setAttribute("aria-activedescendant",this.getUI().list.getActiveDescendant()||"")}));const O=n.trackFocus(e);return this._register(O),this._register(n.addDisposableListener(e,n.EventType.FOCUS,e=>{this.previousFocusElement=e.relatedTarget instanceof HTMLElement?e.relatedTarget:void 0},!0)),this._register(O.onDidBlur(()=>{this.getUI().ignoreFocusOut||this.options.ignoreFocusOut()||this.hide(),this.previousFocusElement=void 0})),this._register(n.addDisposableListener(e,n.EventType.FOCUS,e=>{b.setFocus()})), +this._register(n.addDisposableListener(e,n.EventType.KEY_DOWN,t=>{const i=new l.StandardKeyboardEvent(t);switch(i.keyCode){case 3:n.EventHelper.stop(t,!0),this.onDidAcceptEmitter.fire();break;case 9:n.EventHelper.stop(t,!0),this.hide();break;case 2:if(!i.altKey&&!i.ctrlKey&&!i.metaKey){const o=[".action-label.codicon"];e.classList.contains("show-checkboxes")?o.push("input"):o.push("input[type=text]"),this.getUI().list.isDisplayed()&&o.push(".monaco-list");const s=e.querySelectorAll(o.join(", "));i.shiftKey&&i.target===s[0]?(n.EventHelper.stop(t,!0),s[s.length-1].focus()):i.shiftKey||i.target!==s[s.length-1]||(n.EventHelper.stop(t,!0),s[0].focus())}}})),this.ui={container:e,styleSheet:t,leftActionBar:o,titleBar:i,title:r,description:p,rightActionBar:u,checkAll:_,filterContainer:C,inputBox:b,visibleCountContainer:S,visibleCount:y,countContainer:E,count:x,okContainer:D,ok:k,message:M,customButtonContainer:N,customButton:I,progressBar:R,list:T,onDidAccept:this.onDidAcceptEmitter.event, +onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,isScreenReaderOptimized:()=>this.options.isScreenReaderOptimized(),show:e=>this.show(e),hide:()=>this.hide(),setVisibilities:e=>this.setVisibilities(e),setComboboxAccessibility:e=>this.setComboboxAccessibility(e),setEnabled:e=>this.setEnabled(e),setContextKey:e=>this.options.setContextKey(e)},this.updateStyles(),this.ui}pick(e,t={},i=o.CancellationToken.None){return new Promise((n,o)=>{let s=e=>{s=n,t.onKeyMods&&t.onKeyMods(r.keyMods),n(e)};if(i.isCancellationRequested)return void s(void 0);const r=this.createQuickPick();let a;const l=[r,r.onDidAccept(()=>{if(r.canSelectMany)s(r.selectedItems.slice()),r.hide();else{const e=r.activeItems[0];e&&(s(e),r.hide())}}),r.onDidChangeActive(e=>{const i=e[0];i&&t.onDidFocus&&t.onDidFocus(i)}),r.onDidChangeSelection(e=>{if(!r.canSelectMany){const t=e[0];t&&(s(t),r.hide())} +}),r.onDidTriggerItemButton(e=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton(Object.assign(Object.assign({},e),{removeItem:()=>{const t=r.items.indexOf(e.item);if(-1!==t){const e=r.items.slice();e.splice(t,1),r.items=e}}}))),r.onDidChangeValue(e=>{!a||e||1===r.activeItems.length&&r.activeItems[0]===a||(r.activeItems=[a])}),i.onCancellationRequested(()=>{r.hide()}),r.onDidHide(()=>{p.dispose(l),s(void 0)})];r.canSelectMany=!!t.canPickMany,r.placeholder=t.placeHolder,r.ignoreFocusOut=!!t.ignoreFocusLost,r.matchOnDescription=!!t.matchOnDescription,r.matchOnDetail=!!t.matchOnDetail,r.matchOnLabel=void 0===t.matchOnLabel||t.matchOnLabel,r.autoFocusOnList=void 0===t.autoFocusOnList||t.autoFocusOnList,r.quickNavigate=t.quickNavigate,r.contextKey=t.contextKey,r.busy=!0,Promise.all([e,t.activeItem]).then(([e,t])=>{a=t,r.busy=!1,r.items=e,r.canSelectMany&&(r.selectedItems=e.filter(e=>"separator"!==e.type&&e.picked)),a&&(r.activeItems=[a])}),r.show(),Promise.resolve(e).then(void 0,e=>{o(e),r.hide()})})} +createQuickPick(){const e=this.getUI();return new L(e)}show(e){const t=this.getUI();this.onShowEmitter.fire();const i=this.controller;this.controller=e,i&&i.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description.textContent="",t.rightActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(m.default.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),t.message.textContent="",t.progressBar.stop(),t.list.setElements([]),t.list.matchOnDescription=!1,t.list.matchOnDetail=!1,t.list.matchOnLabel=!0,t.list.sortByLabel=!0,t.ignoreFocusOut=!1,this.setComboboxAccessibility(!1),t.inputBox.ariaLabel="";const n=this.options.backKeybindingLabel();y.tooltip=n?d.localize(7,null,n):d.localize(8,null),t.container.style.display="",this.updateLayout(),t.inputBox.setFocus()}setVisibilities(e){const t=this.getUI();t.title.style.display=e.title?"":"none",t.description.style.display=e.description?"":"none", +t.checkAll.style.display=e.checkAll?"":"none",t.filterContainer.style.display=e.inputBox?"":"none",t.visibleCountContainer.style.display=e.visibleCount?"":"none",t.countContainer.style.display=e.count?"":"none",t.okContainer.style.display=e.ok?"":"none",t.customButtonContainer.style.display=e.customButton?"":"none",t.message.style.display=e.message?"":"none",t.progressBar.getContainer().style.display=e.progressBar?"":"none",t.list.display(!!e.list),t.container.classList[e.checkAll?"add":"remove"]("show-checkboxes"),this.updateLayout()}setComboboxAccessibility(e){if(e!==this.comboboxAccessibility){const t=this.getUI();this.comboboxAccessibility=e,this.comboboxAccessibility?(t.inputBox.setAttribute("role","combobox"),t.inputBox.setAttribute("aria-haspopup","true"),t.inputBox.setAttribute("aria-autocomplete","list"),t.inputBox.setAttribute("aria-activedescendant",t.list.getActiveDescendant()||"")):(t.inputBox.removeAttribute("role"),t.inputBox.removeAttribute("aria-haspopup"), +t.inputBox.removeAttribute("aria-autocomplete"),t.inputBox.removeAttribute("aria-activedescendant"))}}setEnabled(e){if(e!==this.enabled){this.enabled=e;for(const t of this.getUI().leftActionBar.viewItems)t.getAction().enabled=e;for(const t of this.getUI().rightActionBar.viewItems)t.getAction().enabled=e;this.getUI().checkAll.disabled=!e,this.getUI().ok.enabled=e,this.getUI().list.enabled=e}}hide(){var e;const t=this.controller;if(t){const i=!(null===(e=this.ui)||void 0===e?void 0:e.container.contains(document.activeElement));this.controller=null,this.onHideEmitter.fire(),this.getUI().container.style.display="none",i||(this.previousFocusElement&&this.previousFocusElement.offsetParent?(this.previousFocusElement.focus(),this.previousFocusElement=void 0):this.options.returnFocus()),t.didHide()}}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){if(this.ui){this.ui.container.style.top=`${this.titleBarOffset}px` +;const e=this.ui.container.style,t=Math.min(.62*this.dimension.width,x.MAX_WIDTH);e.width=t+"px",e.marginLeft="-"+t/2+"px",this.ui.inputBox.layout(),this.ui.list.layout(this.dimension&&.4*this.dimension.height)}}applyStyles(e){this.styles=e,this.updateStyles()}updateStyles(){if(this.ui){const{quickInputTitleBackground:e,quickInputBackground:t,quickInputForeground:i,contrastBorder:n,widgetShadow:o}=this.styles.widget;this.ui.titleBar.style.backgroundColor=e?e.toString():"",this.ui.container.style.backgroundColor=t?t.toString():"",this.ui.container.style.color=i?i.toString():"",this.ui.container.style.border=n?`1px solid ${n}`:"",this.ui.container.style.boxShadow=o?`0 5px 8px ${o}`:"",this.ui.inputBox.style(this.styles.inputBox),this.ui.count.style(this.styles.countBadge),this.ui.ok.style(this.styles.button),this.ui.customButton.style(this.styles.button),this.ui.progressBar.style(this.styles.progressBar),this.ui.list.style(this.styles.list);const s=[] +;this.styles.list.listInactiveFocusForeground&&(s.push(`.monaco-list .monaco-list-row.focused { color: ${this.styles.list.listInactiveFocusForeground}; }`),s.push(`.monaco-list .monaco-list-row.focused:hover { color: ${this.styles.list.listInactiveFocusForeground}; }`)),this.styles.list.pickerGroupBorder&&s.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.list.pickerGroupBorder}; }`),this.styles.list.pickerGroupForeground&&s.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.list.pickerGroupForeground}; }`);const r=s.join("\n");r!==this.ui.styleSheet.innerHTML&&(this.ui.styleSheet.innerHTML=r)}}}t.QuickInputController=x,x.MAX_WIDTH=600})),define(t[430],i([5,6]),(function(e,t){return e.create("vs/editor/browser/controller/coreCommands",t)})),define(t[431],i([5,6]),(function(e,t){return e.create("vs/editor/browser/controller/textAreaHandler",t)})),define(t[432],i([5,6]),(function(e,t){return e.create("vs/editor/browser/editorExtensions",t)})), +define(t[433],i([5,6]),(function(e,t){return e.create("vs/editor/browser/widget/codeEditorWidget",t)})),define(t[434],i([5,6]),(function(e,t){return e.create("vs/editor/browser/widget/diffEditorWidget",t)})),define(t[435],i([5,6]),(function(e,t){return e.create("vs/editor/browser/widget/diffReview",t)})),define(t[436],i([5,6]),(function(e,t){return e.create("vs/editor/browser/widget/inlineDiffMargin",t)})),define(t[437],i([0,1,436,7,47,2,3,26]),(function(e,t,i,n,o,s,a,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InlineDiffMargin=void 0;class d extends s.Disposable{constructor(e,t,s,d,c,h){super(),this._viewZoneId=e,this._marginDomNode=t,this.editor=s,this.diff=d,this._contextMenuService=c,this._clipboardService=h,this._visibility=!1,this._marginDomNode.style.zIndex="10",this._diffActions=document.createElement("div"),this._diffActions.className=l.Codicon.lightBulb.classNames+" lightbulb-glyph",this._diffActions.style.position="absolute";const u=s.getOption(51),g=s.getModel().getEOL() +;this._diffActions.style.right="0px",this._diffActions.style.visibility="hidden",this._diffActions.style.height=`${u}px`,this._diffActions.style.lineHeight=`${u}px`,this._marginDomNode.appendChild(this._diffActions);const p=[];p.push(new o.Action("diff.clipboard.copyDeletedContent",d.originalEndLineNumber>d.modifiedStartLineNumber?i.localize(0,null):i.localize(1,null),void 0,!0,()=>r(this,void 0,void 0,(function*(){yield this._clipboardService.writeText(d.originalContent.join(g)+g)}))));let m=0,f=void 0;d.originalEndLineNumber>d.modifiedStartLineNumber&&(f=new o.Action("diff.clipboard.copyDeletedLineContent",i.localize(2,null,d.originalStartLineNumber),void 0,!0,()=>r(this,void 0,void 0,(function*(){yield this._clipboardService.writeText(d.originalContent[m])}))),p.push(f)),s.getOption(72)||p.push(new o.Action("diff.inline.revertChange",i.localize(3,null),void 0,!0,()=>r(this,void 0,void 0,(function*(){if(0===d.modifiedEndLineNumber){const e=s.getModel().getLineMaxColumn(d.modifiedStartLineNumber) +;s.executeEdits("diffEditor",[{range:new a.Range(d.modifiedStartLineNumber,e,d.modifiedStartLineNumber,e),text:g+d.originalContent.join(g)}])}else{const e=s.getModel().getLineMaxColumn(d.modifiedEndLineNumber);s.executeEdits("diffEditor",[{range:new a.Range(d.modifiedStartLineNumber,1,d.modifiedEndLineNumber,e),text:d.originalContent.join(g)}])}}))));const _=(e,t)=>{this._contextMenuService.showContextMenu({getAnchor:()=>({x:e,y:t}),getActions:()=>(f&&(f.label=i.localize(4,null,d.originalStartLineNumber+m)),p),autoSelectFirstItem:!0})};this._register(n.addStandardDisposableListener(this._diffActions,"mousedown",e=>{const{top:t,height:i}=n.getDomNodePagePosition(this._diffActions);let o=Math.floor(u/3);e.preventDefault(),_(e.posx,t+i+o)})),this._register(s.onMouseMove(e=>{if(8===e.target.type||5===e.target.type){e.target.detail.viewZoneId===this._viewZoneId?(this.visibility=!0,m=this._updateLightBulbPosition(this._marginDomNode,e.event.browserEvent.y,u)):this.visibility=!1}else this.visibility=!1})), +this._register(s.onMouseDown(e=>{if(e.event.rightButton&&(8===e.target.type||5===e.target.type)){e.target.detail.viewZoneId===this._viewZoneId&&(e.event.preventDefault(),m=this._updateLightBulbPosition(this._marginDomNode,e.event.browserEvent.y,u),_(e.event.posx,e.event.posy+u))}}))}get visibility(){return this._visibility}set visibility(e){this._visibility!==e&&(this._visibility=e,this._diffActions.style.visibility=e?"visible":"hidden")}_updateLightBulbPosition(e,t,i){const{top:o}=n.getDomNodePagePosition(e),s=t-o,r=Math.floor(s/i),a=r*i;return this._diffActions.style.top=`${a}px`,r}}t.InlineDiffMargin=d})),define(t[438],i([5,6]),(function(e,t){return e.create("vs/editor/common/config/commonEditorConfig",t)})),define(t[439],i([5,6]),(function(e,t){return e.create("vs/editor/common/config/editorOptions",t)})),define(t[38],i([0,1,439,16,122]),(function(e,t,i,n,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}), +t.EditorOptions=t.editorOptionsRegistry=t.EDITOR_MODEL_DEFAULTS=t.EDITOR_FONT_DEFAULTS=t.filterValidationDecorations=t.EditorLayoutInfoComputer=t.EditorFontLigatures=t.TextEditorCursorStyle=t.ComputeOptionsMemory=t.ValidatedEditorOptions=t.ConfigurationChangedEvent=t.MINIMAP_GUTTER_WIDTH=void 0,t.MINIMAP_GUTTER_WIDTH=8;t.ConfigurationChangedEvent=class{constructor(e){this._values=e}hasChanged(e){return this._values[e]}};t.ValidatedEditorOptions=class{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}};class s{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}t.ComputeOptionsMemory=s;class r{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}compute(e,t,i){return i}}class a{constructor(e,t=null){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0,this.deps=t}validate(e){return this.defaultValue}}class l{constructor(e,t,i,n){ +this.id=e,this.name=t,this.defaultValue=i,this.schema=n}validate(e){return void 0===e?this.defaultValue:e}compute(e,t,i){return i}}class d extends l{static boolean(e,t){return void 0===e?t:"false"!==e&&Boolean(e)}constructor(e,t,i,n){void 0!==n&&(n.type="boolean",n.default=i),super(e,t,i,n)}validate(e){return d.boolean(e,this.defaultValue)}}class c extends l{constructor(e,t,i,n,o,s){void 0!==s&&(s.type="integer",s.default=i,s.minimum=n,s.maximum=o),super(e,t,i,s),this.minimum=n,this.maximum=o}static clampedInt(e,t,i,n){if(void 0===e)return t;let o=parseInt(e,10);return isNaN(o)?t:(o=Math.max(i,o),0|(o=Math.min(n,o)))}validate(e){return c.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}class h extends l{constructor(e,t,i,n,o){void 0!==o&&(o.type="number",o.default=i),super(e,t,i,o),this.validationFn=n}static clamp(e,t,i){return ei?i:e}static float(e,t){if("number"==typeof e)return e;if(void 0===e)return t;const i=parseFloat(e);return isNaN(i)?t:i}validate(e){ +return this.validationFn(h.float(e,this.defaultValue))}}class u extends l{static string(e,t){return"string"!=typeof e?t:e}constructor(e,t,i,n){void 0!==n&&(n.type="string",n.default=i),super(e,t,i,n)}validate(e){return u.string(e,this.defaultValue)}}class g extends l{constructor(e,t,i,n,o){void 0!==o&&(o.type="string",o.enum=n,o.default=i),super(e,t,i,o),this._allowedValues=n}static stringSet(e,t,i){return"string"!=typeof e?t:-1===i.indexOf(e)?t:e}validate(e){return g.stringSet(e,this.defaultValue,this._allowedValues)}}class p extends r{constructor(e,t,i,n,o,s,r){void 0!==r&&(r.type="string",r.enum=o,r.default=n),super(e,t,i,r),this._allowedValues=o,this._convert=s}validate(e){return"string"!=typeof e?this.defaultValue:-1===this._allowedValues.indexOf(e)?this.defaultValue:this._convert(e)}}var m;!function(e){e[e.Line=1]="Line",e[e.Block=2]="Block",e[e.Underline=3]="Underline",e[e.LineThin=4]="LineThin",e[e.BlockOutline=5]="BlockOutline",e[e.UnderlineThin=6]="UnderlineThin" +}(m=t.TextEditorCursorStyle||(t.TextEditorCursorStyle={}));class f extends r{constructor(){super(37,"fontLigatures",f.OFF,{anyOf:[{type:"boolean",description:i.localize(16,null)},{type:"string",description:i.localize(17,null)}],description:i.localize(18,null),default:!1})}validate(e){return void 0===e?this.defaultValue:"string"==typeof e?"false"===e?f.OFF:"true"===e?f.ON:e:Boolean(e)?f.ON:f.OFF}}t.EditorFontLigatures=f,f.OFF='"liga" off, "calt" off',f.ON='"liga" on, "calt" on';class _ extends r{constructor(){super(39,"fontWeight",t.EDITOR_FONT_DEFAULTS.fontWeight,{anyOf:[{type:"number",minimum:_.MINIMUM_VALUE,maximum:_.MAXIMUM_VALUE,errorMessage:i.localize(20,null)},{type:"string",pattern:"^(normal|bold|1000|[1-9][0-9]{0,2})$"},{enum:_.SUGGESTION_VALUES}],default:t.EDITOR_FONT_DEFAULTS.fontWeight,description:i.localize(21,null)})}validate(e){return"normal"===e||"bold"===e?e:String(c.clampedInt(e,t.EDITOR_FONT_DEFAULTS.fontWeight,_.MINIMUM_VALUE,_.MAXIMUM_VALUE))}} +_.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"],_.MINIMUM_VALUE=1,_.MAXIMUM_VALUE=1e3;class v extends a{constructor(){super(117,[42,50,31,56,84,52,53,86,106,109,110,2])}compute(e,t,i){return v.computeLayout(t,{memory:e.memory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,isDominatedByLongLines:e.isDominatedByLongLines,lineHeight:e.fontInfo.lineHeight,viewLineCount:e.viewLineCount,lineNumbersDigitCount:e.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:e.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:e.fontInfo.maxDigitWidth,pixelRatio:e.pixelRatio})}static computeContainedMinimapLineCount(e){const t=e.height/e.lineHeight,i=e.scrollBeyondLastLine?t-1:0,n=(e.viewLineCount+i)/(e.pixelRatio*e.height);return{typicalViewportLineCount:t,extraLinesBeyondLastLine:i,desiredRatio:n,minimapLineCount:Math.floor(e.viewLineCount/n)}}static _computeMinimapLayout(e,i){const n=e.outerWidth,o=e.outerHeight,s=e.pixelRatio;if(!e.minimap.enabled)return{renderMinimap:0, +minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(s*o),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:o};const r=i.stableMinimapLayoutInput,a=r&&e.outerHeight===r.outerHeight&&e.lineHeight===r.lineHeight&&e.typicalHalfwidthCharacterWidth===r.typicalHalfwidthCharacterWidth&&e.pixelRatio===r.pixelRatio&&e.scrollBeyondLastLine===r.scrollBeyondLastLine&&e.minimap.enabled===r.minimap.enabled&&e.minimap.side===r.minimap.side&&e.minimap.size===r.minimap.size&&e.minimap.showSlider===r.minimap.showSlider&&e.minimap.renderCharacters===r.minimap.renderCharacters&&e.minimap.maxColumn===r.minimap.maxColumn&&e.minimap.scale===r.minimap.scale&&e.verticalScrollbarWidth===r.verticalScrollbarWidth&&e.isViewportWrapping===r.isViewportWrapping,l=e.lineHeight,d=e.typicalHalfwidthCharacterWidth,c=e.scrollBeyondLastLine,h=e.minimap.renderCharacters +;let u=s>=2?Math.round(2*e.minimap.scale):e.minimap.scale;const g=e.minimap.maxColumn,p=e.minimap.size,m=e.minimap.side,f=e.verticalScrollbarWidth,_=e.viewLineCount,C=e.remainingWidth,b=e.isViewportWrapping,S=h?2:3;let w=Math.floor(s*o);const y=w/s;let E=!1,L=!1,x=S*u,D=u/s,k=1;if("fill"===p||"fit"===p){const{typicalViewportLineCount:t,extraLinesBeyondLastLine:n,desiredRatio:r,minimapLineCount:d}=v.computeContainedMinimapLineCount({viewLineCount:_,scrollBeyondLastLine:c,height:o,lineHeight:l,pixelRatio:s});if(_/d>1)E=!0,L=!0,x=1,D=(u=1)/s;else{let o=!1,d=u+1;if("fit"===p){const t=Math.ceil((_+n)*x);b&&a&&C<=i.stableFitRemainingWidth?(o=!0,d=i.stableFitMaxMinimapScale):(o=t>w,b&&o?(i.stableMinimapLayoutInput=e,i.stableFitRemainingWidth=C):(i.stableMinimapLayoutInput=null,i.stableFitRemainingWidth=0))}if("fill"===p||o){E=!0;const e=u;x=Math.min(l*s,Math.max(1,Math.floor(1/r))),(u=Math.min(d,Math.max(1,Math.floor(x/S))))>e&&(k=Math.min(2,u/e)),D=u/s/k,w=Math.ceil(Math.max(t,_+n)*x), +b&&o&&(i.stableFitMaxMinimapScale=u)}}}const N=Math.floor(g*D),I=Math.min(N,Math.max(0,Math.floor((C-f-2)*D/(d+D)))+t.MINIMAP_GUTTER_WIDTH);let M=Math.floor(s*I);const R=M/s;return{renderMinimap:h?1:2,minimapLeft:"left"===m?0:n-I-f,minimapWidth:I,minimapHeightIsEditorHeight:E,minimapIsSampling:L,minimapScale:u,minimapLineHeight:x,minimapCanvasInnerWidth:M=Math.floor(M*k),minimapCanvasInnerHeight:w,minimapCanvasOuterWidth:R,minimapCanvasOuterHeight:y}}static computeLayout(e,t){const i=0|t.outerWidth,n=0|t.outerHeight,o=0|t.lineHeight,r=0|t.lineNumbersDigitCount,a=t.typicalHalfwidthCharacterWidth,l=t.maxDigitWidth,d=t.pixelRatio,h=t.viewLineCount,u=e.get(106),g=e.get(109),p=e.get(110),m=e.get(2),f=t.isDominatedByLongLines,_=e.get(42),C=0!==e.get(52).renderType,b=e.get(53),S=e.get(86),w=e.get(56),y=e.get(84),E=y.verticalScrollbarSize,L=y.verticalHasArrows,x=y.arrowSize,D=y.horizontalScrollbarSize,k=e.get(50),N=e.get(31);let I;if("string"==typeof k&&/^\d+(\.\d+)?ch$/.test(k)){ +const e=parseFloat(k.substr(0,k.length-2));I=c.clampedInt(e*a,0,0,1e3)}else I=c.clampedInt(k,0,0,1e3);N&&(I+=16);let M=0;if(C){const e=Math.max(r,b);M=Math.round(e*l)}let R=0;_&&(R=o);let T=0,O=T+R,A=O+M,P=A+I;const F=i-R-M-I;let W=!1,B=!1,V=-1;2!==m&&(p&&f?(W=!0,B=!0):"on"===u||"bounded"===u?B=!0:"wordWrapColumn"===u&&(V=g));const z=v._computeMinimapLayout({outerWidth:i,outerHeight:n,lineHeight:o,typicalHalfwidthCharacterWidth:a,pixelRatio:d,scrollBeyondLastLine:S,minimap:w,verticalScrollbarWidth:E,viewLineCount:h,remainingWidth:F,isViewportWrapping:B},t.memory||new s);0!==z.renderMinimap&&0===z.minimapLeft&&(T+=z.minimapWidth,O+=z.minimapWidth,A+=z.minimapWidth,P+=z.minimapWidth);const H=F-z.minimapWidth,K=Math.max(1,Math.floor((H-E-2)/a)),U=L?x:0;return B&&(V=Math.max(1,K),"bounded"===u&&(V=Math.min(V,g))),{width:i,height:n,glyphMarginLeft:T,glyphMarginWidth:R,lineNumbersLeft:O,lineNumbersWidth:M,decorationsLeft:A,decorationsWidth:I,contentLeft:P,contentWidth:H,minimap:z,viewportColumn:K, +isWordWrapMinified:W,isViewportWrapping:B,wrappingColumn:V,verticalScrollbarWidth:E,horizontalScrollbarHeight:D,overviewRuler:{top:U,width:E,height:n-2*U,right:0}}}}t.EditorLayoutInfoComputer=v;t.filterValidationDecorations=function(e){const t=e.get(79);return"editable"===t?e.get(72):"on"!==t};function C(e,t){if("string"!=typeof e)return t;switch(e){case"hidden":return 2;case"visible":return 3;default:return 1}}function b(e){return t.editorOptionsRegistry[e.id]=e,e}t.EDITOR_FONT_DEFAULTS={fontFamily:n.isMacintosh?"Menlo, Monaco, 'Courier New', monospace":n.isLinux?"'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'":"Consolas, 'Courier New', monospace",fontWeight:"normal",fontSize:n.isMacintosh?12:14,lineHeight:0,letterSpacing:0},t.EDITOR_MODEL_DEFAULTS={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0},t.editorOptionsRegistry=[],t.EditorOptions={acceptSuggestionOnCommitCharacter:b(new d(0,"acceptSuggestionOnCommitCharacter",!0,{ +markdownDescription:i.localize(106,null)})),acceptSuggestionOnEnter:b(new g(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",i.localize(107,null),""],markdownDescription:i.localize(108,null)})),accessibilitySupport:b(new class extends r{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[i.localize(0,null),i.localize(1,null),i.localize(2,null)],default:"auto",description:i.localize(3,null)})}validate(e){switch(e){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(e,t,i){return 0===i?e.accessibilitySupport:i}}),accessibilityPageSize:b(new c(3,"accessibilityPageSize",10,1,1073741824,{description:i.localize(109,null)})),ariaLabel:b(new u(4,"ariaLabel",i.localize(110,null))),autoClosingBrackets:b(new g(5,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",i.localize(111,null),i.localize(112,null),""], +description:i.localize(113,null)})),autoClosingOvertype:b(new g(6,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",i.localize(114,null),""],description:i.localize(115,null)})),autoClosingQuotes:b(new g(7,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",i.localize(116,null),i.localize(117,null),""],description:i.localize(118,null)})),autoIndent:b(new p(8,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],(function(e){switch(e){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}),{enumDescriptions:[i.localize(119,null),i.localize(120,null),i.localize(121,null),i.localize(122,null),i.localize(123,null)],description:i.localize(124,null)})),automaticLayout:b(new d(9,"automaticLayout",!1)),autoSurround:b(new g(10,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{ +enumDescriptions:[i.localize(125,null),i.localize(126,null),i.localize(127,null),""],description:i.localize(128,null)})),codeLens:b(new d(11,"codeLens",!0,{description:i.localize(129,null)})),colorDecorators:b(new d(12,"colorDecorators",!0,{description:i.localize(130,null)})),columnSelection:b(new d(13,"columnSelection",!1,{description:i.localize(131,null)})),comments:b(new class extends r{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(14,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:i.localize(4,null)},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:i.localize(5,null)}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{insertSpace:d.boolean(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:d.boolean(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}),contextmenu:b(new d(15,"contextmenu",!0)), +copyWithSyntaxHighlighting:b(new d(16,"copyWithSyntaxHighlighting",!0,{description:i.localize(132,null)})),cursorBlinking:b(new p(17,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],(function(e){switch(e){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}),{description:i.localize(133,null)})),cursorSmoothCaretAnimation:b(new d(18,"cursorSmoothCaretAnimation",!1,{description:i.localize(134,null)})),cursorStyle:b(new p(19,"cursorStyle",m.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],(function(e){switch(e){case"line":return m.Line;case"block":return m.Block;case"underline":return m.Underline;case"line-thin":return m.LineThin;case"block-outline":return m.BlockOutline;case"underline-thin":return m.UnderlineThin}}),{description:i.localize(135,null)})),cursorSurroundingLines:b(new c(20,"cursorSurroundingLines",0,0,1073741824,{description:i.localize(136,null)})), +cursorSurroundingLinesStyle:b(new g(21,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[i.localize(137,null),i.localize(138,null)],description:i.localize(139,null)})),cursorWidth:b(new c(22,"cursorWidth",0,0,1073741824,{markdownDescription:i.localize(140,null)})),disableLayerHinting:b(new d(23,"disableLayerHinting",!1)),disableMonospaceOptimizations:b(new d(24,"disableMonospaceOptimizations",!1)),dragAndDrop:b(new d(25,"dragAndDrop",!0,{description:i.localize(141,null)})),emptySelectionClipboard:b(new class extends d{constructor(){super(26,"emptySelectionClipboard",!0,{description:i.localize(6,null)})}compute(e,t,i){return i&&e.emptySelectionClipboard}}),extraEditorClassName:b(new u(27,"extraEditorClassName","")),fastScrollSensitivity:b(new h(28,"fastScrollSensitivity",5,e=>e<=0?5:e,{markdownDescription:i.localize(142,null)})),find:b(new class extends r{constructor(){const e={cursorMoveOnType:!0,seedSearchStringFromSelection:!0,autoFindInSelection:"never",globalFindClipboard:!1, +addExtraSpaceOnTop:!0,loop:!0};super(29,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:i.localize(7,null)},"editor.find.seedSearchStringFromSelection":{type:"boolean",default:e.seedSearchStringFromSelection,description:i.localize(8,null)},"editor.find.autoFindInSelection":{type:"string",enum:["never","always","multiline"],default:e.autoFindInSelection,enumDescriptions:[i.localize(9,null),i.localize(10,null),i.localize(11,null)],description:i.localize(12,null)},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:i.localize(13,null),included:n.isMacintosh},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:i.localize(14,null)},"editor.find.loop":{type:"boolean",default:e.loop,description:i.localize(15,null)}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{cursorMoveOnType:d.boolean(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType), +seedSearchStringFromSelection:d.boolean(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection),autoFindInSelection:"boolean"==typeof e.autoFindInSelection?e.autoFindInSelection?"always":"never":g.stringSet(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:d.boolean(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:d.boolean(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:d.boolean(t.loop,this.defaultValue.loop)}}}),fixedOverflowWidgets:b(new d(30,"fixedOverflowWidgets",!1)),folding:b(new d(31,"folding",!0,{description:i.localize(143,null)})),foldingStrategy:b(new g(32,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[i.localize(144,null),i.localize(145,null)],description:i.localize(146,null)})),foldingHighlight:b(new d(33,"foldingHighlight",!0,{description:i.localize(147,null)})),unfoldOnClickAfterEndOfLine:b(new d(34,"unfoldOnClickAfterEndOfLine",!1,{ +description:i.localize(148,null)})),fontFamily:b(new u(35,"fontFamily",t.EDITOR_FONT_DEFAULTS.fontFamily,{description:i.localize(149,null)})),fontInfo:b(new class extends a{constructor(){super(36)}compute(e,t,i){return e.fontInfo}}),fontLigatures2:b(new f),fontSize:b(new class extends l{constructor(){super(38,"fontSize",t.EDITOR_FONT_DEFAULTS.fontSize,{type:"number",minimum:6,maximum:100,default:t.EDITOR_FONT_DEFAULTS.fontSize,description:i.localize(19,null)})}validate(e){let i=h.float(e,this.defaultValue);return 0===i?t.EDITOR_FONT_DEFAULTS.fontSize:h.clamp(i,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}),fontWeight:b(new _),formatOnPaste:b(new d(40,"formatOnPaste",!1,{description:i.localize(150,null)})),formatOnType:b(new d(41,"formatOnType",!1,{description:i.localize(151,null)})),glyphMargin:b(new d(42,"glyphMargin",!0,{description:i.localize(152,null)})),gotoLocation:b(new class extends r{constructor(){const e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek", +multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:""},t={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[i.localize(22,null),i.localize(23,null),i.localize(24,null)]};super(43,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:i.localize(25,null)},"editor.gotoLocation.multipleDefinitions":Object.assign({description:i.localize(26,null)},t),"editor.gotoLocation.multipleTypeDefinitions":Object.assign({description:i.localize(27,null)},t),"editor.gotoLocation.multipleDeclarations":Object.assign({description:i.localize(28,null)},t),"editor.gotoLocation.multipleImplementations":Object.assign({description:i.localize(29,null)},t), +"editor.gotoLocation.multipleReferences":Object.assign({description:i.localize(30,null)},t),"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:e.alternativeDefinitionCommand,description:i.localize(31,null)},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:"string",default:e.alternativeTypeDefinitionCommand,description:i.localize(32,null)},"editor.gotoLocation.alternativeDeclarationCommand":{type:"string",default:e.alternativeDeclarationCommand,description:i.localize(33,null)},"editor.gotoLocation.alternativeImplementationCommand":{type:"string",default:e.alternativeImplementationCommand,description:i.localize(34,null)},"editor.gotoLocation.alternativeReferenceCommand":{type:"string",default:e.alternativeReferenceCommand,description:i.localize(35,null)}})}validate(e){var t,i,n,o,s;if(!e||"object"!=typeof e)return this.defaultValue;const r=e;return{multiple:g.stringSet(r.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]), +multipleDefinitions:null!==(t=r.multipleDefinitions)&&void 0!==t?t:g.stringSet(r.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:null!==(i=r.multipleTypeDefinitions)&&void 0!==i?i:g.stringSet(r.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:null!==(n=r.multipleDeclarations)&&void 0!==n?n:g.stringSet(r.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:null!==(o=r.multipleImplementations)&&void 0!==o?o:g.stringSet(r.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:null!==(s=r.multipleReferences)&&void 0!==s?s:g.stringSet(r.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:u.string(r.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:u.string(r.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand), +alternativeDeclarationCommand:u.string(r.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:u.string(r.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:u.string(r.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}}),hideCursorInOverviewRuler:b(new d(44,"hideCursorInOverviewRuler",!1,{description:i.localize(153,null)})),highlightActiveIndentGuide:b(new d(45,"highlightActiveIndentGuide",!0,{description:i.localize(154,null)})),hover:b(new class extends r{constructor(){const e={enabled:!0,delay:300,sticky:!0};super(46,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:i.localize(36,null)},"editor.hover.delay":{type:"number",default:e.delay,description:i.localize(37,null)},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:i.localize(38,null)}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e +;return{enabled:d.boolean(t.enabled,this.defaultValue.enabled),delay:c.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:d.boolean(t.sticky,this.defaultValue.sticky)}}}),inDiffEditor:b(new d(47,"inDiffEditor",!1)),letterSpacing:b(new h(48,"letterSpacing",t.EDITOR_FONT_DEFAULTS.letterSpacing,e=>h.clamp(e,-5,20),{description:i.localize(155,null)})),lightbulb:b(new class extends r{constructor(){const e={enabled:!0};super(49,"lightbulb",e,{"editor.lightbulb.enabled":{type:"boolean",default:e.enabled,description:i.localize(39,null)}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:d.boolean(t.enabled,this.defaultValue.enabled)}}}),lineDecorationsWidth:b(new l(50,"lineDecorationsWidth",10)),lineHeight:b(new class extends c{constructor(){super(51,"lineHeight",t.EDITOR_FONT_DEFAULTS.lineHeight,0,150,{description:i.localize(40,null)})}compute(e,t,i){return e.fontInfo.lineHeight}}),lineNumbers:b(new class extends r{constructor(){super(52,"lineNumbers",{renderType:1, +renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[i.localize(59,null),i.localize(60,null),i.localize(61,null),i.localize(62,null)],default:"on",description:i.localize(63,null)})}validate(e){let t=this.defaultValue.renderType,i=this.defaultValue.renderFn;return void 0!==e&&("function"==typeof e?(t=4,i=e):t="interval"===e?3:"relative"===e?2:"on"===e?1:0),{renderType:t,renderFn:i}}}),lineNumbersMinChars:b(new c(53,"lineNumbersMinChars",5,1,300)),links:b(new d(54,"links",!0,{description:i.localize(156,null)})),matchBrackets:b(new g(55,"matchBrackets","always",["always","near","never"],{description:i.localize(157,null)})),minimap:b(new class extends r{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",renderCharacters:!0,maxColumn:120,scale:1};super(56,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:i.localize(41,null)},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"], +enumDescriptions:[i.localize(42,null),i.localize(43,null),i.localize(44,null)],default:e.size,description:i.localize(45,null)},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:i.localize(46,null)},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:i.localize(47,null)},"editor.minimap.scale":{type:"number",default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:i.localize(48,null)},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:i.localize(49,null)},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:i.localize(50,null)}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:d.boolean(t.enabled,this.defaultValue.enabled),size:g.stringSet(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:g.stringSet(t.side,this.defaultValue.side,["right","left"]), +showSlider:g.stringSet(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:d.boolean(t.renderCharacters,this.defaultValue.renderCharacters),scale:c.clampedInt(t.scale,1,1,3),maxColumn:c.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4)}}}),mouseStyle:b(new g(57,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:b(new h(58,"mouseWheelScrollSensitivity",1,e=>0===e?1:e,{markdownDescription:i.localize(158,null)})),mouseWheelZoom:b(new d(59,"mouseWheelZoom",!1,{markdownDescription:i.localize(159,null)})),multiCursorMergeOverlapping:b(new d(60,"multiCursorMergeOverlapping",!0,{description:i.localize(160,null)})),multiCursorModifier:b(new p(61,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],(function(e){return"ctrlCmd"===e?n.isMacintosh?"metaKey":"ctrlKey":"altKey"}),{markdownEnumDescriptions:[i.localize(161,null),i.localize(162,null)],markdownDescription:i.localize(163,null)})), +multiCursorPaste:b(new g(62,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[i.localize(164,null),i.localize(165,null)],markdownDescription:i.localize(166,null)})),occurrencesHighlight:b(new d(63,"occurrencesHighlight",!0,{description:i.localize(167,null)})),overviewRulerBorder:b(new d(64,"overviewRulerBorder",!0,{description:i.localize(168,null)})),overviewRulerLanes:b(new c(65,"overviewRulerLanes",3,0,3)),padding:b(new class extends r{constructor(){super(66,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:i.localize(51,null)},"editor.padding.bottom":{type:"number",default:0,minimum:0,maximum:1e3,description:i.localize(52,null)}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{top:c.clampedInt(t.top,0,0,1e3),bottom:c.clampedInt(t.bottom,0,0,1e3)}}}),parameterHints:b(new class extends r{constructor(){const e={enabled:!0,cycle:!1};super(67,"parameterHints",e,{"editor.parameterHints.enabled":{ +type:"boolean",default:e.enabled,description:i.localize(53,null)},"editor.parameterHints.cycle":{type:"boolean",default:e.cycle,description:i.localize(54,null)}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:d.boolean(t.enabled,this.defaultValue.enabled),cycle:d.boolean(t.cycle,this.defaultValue.cycle)}}}),peekWidgetDefaultFocus:b(new g(68,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[i.localize(169,null),i.localize(170,null)],description:i.localize(171,null)})),definitionLinkOpensInPeek:b(new d(69,"definitionLinkOpensInPeek",!1,{description:i.localize(172,null)})),quickSuggestions:b(new class extends r{constructor(){const e={other:!0,comments:!1,strings:!1};super(70,"quickSuggestions",e,{anyOf:[{type:"boolean"},{type:"object",properties:{strings:{type:"boolean",default:e.strings,description:i.localize(55,null)},comments:{type:"boolean",default:e.comments,description:i.localize(56,null)},other:{type:"boolean",default:e.other, +description:i.localize(57,null)}}}],default:e,description:i.localize(58,null)}),this.defaultValue=e}validate(e){if("boolean"==typeof e)return e;if(e&&"object"==typeof e){const t=e,i={other:d.boolean(t.other,this.defaultValue.other),comments:d.boolean(t.comments,this.defaultValue.comments),strings:d.boolean(t.strings,this.defaultValue.strings)};return!!(i.other&&i.comments&&i.strings)||!!(i.other||i.comments||i.strings)&&i}return this.defaultValue}}),quickSuggestionsDelay:b(new c(71,"quickSuggestionsDelay",10,0,1073741824,{description:i.localize(173,null)})),readOnly:b(new d(72,"readOnly",!1)),renameOnType:b(new d(73,"renameOnType",!1,{description:i.localize(174,null)})),renderControlCharacters:b(new d(74,"renderControlCharacters",!1,{description:i.localize(175,null)})),renderIndentGuides:b(new d(75,"renderIndentGuides",!0,{description:i.localize(176,null)})),renderFinalNewline:b(new d(76,"renderFinalNewline",!0,{description:i.localize(177,null)})), +renderLineHighlight:b(new g(77,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",i.localize(178,null)],description:i.localize(179,null)})),renderLineHighlightOnlyWhenFocus:b(new d(78,"renderLineHighlightOnlyWhenFocus",!1,{description:i.localize(180,null)})),renderValidationDecorations:b(new g(79,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:b(new g(80,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",i.localize(181,null),i.localize(182,null),i.localize(183,null),""],description:i.localize(184,null)})),revealHorizontalRightPadding:b(new c(81,"revealHorizontalRightPadding",30,0,1e3)),roundedSelection:b(new d(82,"roundedSelection",!0,{description:i.localize(185,null)})),rulers:b(new class extends r{constructor(){const e=[],t={type:"number",description:i.localize(64,null)};super(83,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string", +description:i.localize(65,null),format:"color-hex"}}}]},default:e,description:i.localize(66,null)})}validate(e){if(Array.isArray(e)){let t=[];for(let i of e)if("number"==typeof i)t.push({column:c.clampedInt(i,0,0,1e4),color:null});else if(i&&"object"==typeof i){const e=i;t.push({column:c.clampedInt(e.column,0,0,1e4),color:e.color})}return t.sort((e,t)=>e.column-t.column),t}return this.defaultValue}}),scrollbar:b(new class extends r{constructor(){super(84,"scrollbar",{vertical:1,horizontal:1,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:12,horizontalSliderSize:12,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,alwaysConsumeMouseWheel:!0})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e,i=c.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),n=c.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{ +arrowSize:c.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:C(t.vertical,this.defaultValue.vertical),horizontal:C(t.horizontal,this.defaultValue.horizontal),useShadows:d.boolean(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:d.boolean(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:d.boolean(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:d.boolean(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:d.boolean(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:i,horizontalSliderSize:c.clampedInt(t.horizontalSliderSize,i,0,1e3),verticalScrollbarSize:n,verticalSliderSize:c.clampedInt(t.verticalSliderSize,n,0,1e3)}}}),scrollBeyondLastColumn:b(new c(85,"scrollBeyondLastColumn",5,0,1073741824,{description:i.localize(186,null)})),scrollBeyondLastLine:b(new d(86,"scrollBeyondLastLine",!0,{description:i.localize(187,null)})), +scrollPredominantAxis:b(new d(87,"scrollPredominantAxis",!0,{description:i.localize(188,null)})),selectionClipboard:b(new d(88,"selectionClipboard",!0,{description:i.localize(189,null),included:n.isLinux})),selectionHighlight:b(new d(89,"selectionHighlight",!0,{description:i.localize(190,null)})),selectOnLineNumbers:b(new d(90,"selectOnLineNumbers",!0)),showFoldingControls:b(new g(91,"showFoldingControls","mouseover",["always","mouseover"],{enumDescriptions:[i.localize(191,null),i.localize(192,null)],description:i.localize(193,null)})),showUnused:b(new d(92,"showUnused",!0,{description:i.localize(194,null)})),showDeprecated:b(new d(113,"showDeprecated",!0,{description:i.localize(195,null)})),snippetSuggestions:b(new g(93,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[i.localize(196,null),i.localize(197,null),i.localize(198,null),i.localize(199,null)],description:i.localize(200,null)})),smoothScrolling:b(new d(94,"smoothScrolling",!1,{description:i.localize(201,null)})), +stopRenderingLineAfter:b(new c(95,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:b(new class extends r{constructor(){const e={insertMode:"insert",filterGraceful:!0,snippetsPreventQuickSuggestions:!0,localityBonus:!1,shareSuggestSelections:!1,showIcons:!0,maxVisibleSuggestions:12,showMethods:!0,showFunctions:!0,showConstructors:!0,showFields:!0,showVariables:!0,showClasses:!0,showStructs:!0,showInterfaces:!0,showModules:!0,showProperties:!0,showEvents:!0,showOperators:!0,showUnits:!0,showValues:!0,showConstants:!0,showEnums:!0,showEnumMembers:!0,showKeywords:!0,showWords:!0,showColors:!0,showFiles:!0,showReferences:!0,showFolders:!0,showTypeParameters:!0,showSnippets:!0,showUsers:!0,showIssues:!0,statusBar:{visible:!1}};super(96,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[i.localize(67,null),i.localize(68,null)],default:e.insertMode,description:i.localize(69,null)},"editor.suggest.filterGraceful":{type:"boolean",default:e.filterGraceful, +description:i.localize(70,null)},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:i.localize(71,null)},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:i.localize(72,null)},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:i.localize(73,null)},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:i.localize(74,null)},"editor.suggest.maxVisibleSuggestions":{type:"number",default:e.maxVisibleSuggestions,minimum:1,maximum:15,description:i.localize(75,null)},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:i.localize(76,null)},"editor.suggest.showMethods":{type:"boolean",default:!0,markdownDescription:i.localize(77,null)},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:i.localize(78,null)},"editor.suggest.showConstructors":{type:"boolean",default:!0, +markdownDescription:i.localize(79,null)},"editor.suggest.showFields":{type:"boolean",default:!0,markdownDescription:i.localize(80,null)},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:i.localize(81,null)},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:i.localize(82,null)},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:i.localize(83,null)},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:i.localize(84,null)},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:i.localize(85,null)},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:i.localize(86,null)},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:i.localize(87,null)},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:i.localize(88,null)},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:i.localize(89,null)}, +"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:i.localize(90,null)},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:i.localize(91,null)},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:i.localize(92,null)},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:i.localize(93,null)},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:i.localize(94,null)},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:i.localize(95,null)},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:i.localize(96,null)},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:i.localize(97,null)},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:i.localize(98,null)},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:i.localize(99,null)},"editor.suggest.showFolders":{type:"boolean", +default:!0,markdownDescription:i.localize(100,null)},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:i.localize(101,null)},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:i.localize(102,null)},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:i.localize(103,null)},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:i.localize(104,null)},"editor.suggest.statusBar.visible":{type:"boolean",default:!1,markdownDescription:i.localize(105,null)}})}validate(e){var t;if(!e||"object"!=typeof e)return this.defaultValue;const i=e;return{insertMode:g.stringSet(i.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:d.boolean(i.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:d.boolean(i.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:d.boolean(i.localityBonus,this.defaultValue.localityBonus), +shareSuggestSelections:d.boolean(i.shareSuggestSelections,this.defaultValue.shareSuggestSelections),showIcons:d.boolean(i.showIcons,this.defaultValue.showIcons),maxVisibleSuggestions:c.clampedInt(i.maxVisibleSuggestions,this.defaultValue.maxVisibleSuggestions,1,15),showMethods:d.boolean(i.showMethods,this.defaultValue.showMethods),showFunctions:d.boolean(i.showFunctions,this.defaultValue.showFunctions),showConstructors:d.boolean(i.showConstructors,this.defaultValue.showConstructors),showFields:d.boolean(i.showFields,this.defaultValue.showFields),showVariables:d.boolean(i.showVariables,this.defaultValue.showVariables),showClasses:d.boolean(i.showClasses,this.defaultValue.showClasses),showStructs:d.boolean(i.showStructs,this.defaultValue.showStructs),showInterfaces:d.boolean(i.showInterfaces,this.defaultValue.showInterfaces),showModules:d.boolean(i.showModules,this.defaultValue.showModules),showProperties:d.boolean(i.showProperties,this.defaultValue.showProperties), +showEvents:d.boolean(i.showEvents,this.defaultValue.showEvents),showOperators:d.boolean(i.showOperators,this.defaultValue.showOperators),showUnits:d.boolean(i.showUnits,this.defaultValue.showUnits),showValues:d.boolean(i.showValues,this.defaultValue.showValues),showConstants:d.boolean(i.showConstants,this.defaultValue.showConstants),showEnums:d.boolean(i.showEnums,this.defaultValue.showEnums),showEnumMembers:d.boolean(i.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:d.boolean(i.showKeywords,this.defaultValue.showKeywords),showWords:d.boolean(i.showWords,this.defaultValue.showWords),showColors:d.boolean(i.showColors,this.defaultValue.showColors),showFiles:d.boolean(i.showFiles,this.defaultValue.showFiles),showReferences:d.boolean(i.showReferences,this.defaultValue.showReferences),showFolders:d.boolean(i.showFolders,this.defaultValue.showFolders),showTypeParameters:d.boolean(i.showTypeParameters,this.defaultValue.showTypeParameters), +showSnippets:d.boolean(i.showSnippets,this.defaultValue.showSnippets),showUsers:d.boolean(i.showUsers,this.defaultValue.showUsers),showIssues:d.boolean(i.showIssues,this.defaultValue.showIssues),statusBar:{visible:d.boolean(null===(t=i.statusBar)||void 0===t?void 0:t.visible,!!this.defaultValue.statusBar.visible)}}}}),suggestFontSize:b(new c(97,"suggestFontSize",0,0,1e3,{markdownDescription:i.localize(202,null)})),suggestLineHeight:b(new c(98,"suggestLineHeight",0,0,1e3,{markdownDescription:i.localize(203,null)})),suggestOnTriggerCharacters:b(new d(99,"suggestOnTriggerCharacters",!0,{description:i.localize(204,null)})),suggestSelection:b(new g(100,"suggestSelection","recentlyUsed",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[i.localize(205,null),i.localize(206,null),i.localize(207,null)],description:i.localize(208,null)})),tabCompletion:b(new g(101,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[i.localize(209,null),i.localize(210,null),i.localize(211,null)], +description:i.localize(212,null)})),tabIndex:b(new c(102,"tabIndex",0,-1,1073741824)),unusualLineTerminators:b(new g(103,"unusualLineTerminators","prompt",["off","prompt","auto"],{enumDescriptions:[i.localize(213,null),i.localize(214,null),i.localize(215,null)],description:i.localize(216,null)})),useTabStops:b(new d(104,"useTabStops",!0,{description:i.localize(217,null)})),wordSeparators:b(new u(105,"wordSeparators",o.USUAL_WORD_SEPARATORS,{description:i.localize(218,null)})),wordWrap:b(new g(106,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[i.localize(219,null),i.localize(220,null),i.localize(221,null),i.localize(222,null)],description:i.localize(223,null)})),wordWrapBreakAfterCharacters:b(new u(107,"wordWrapBreakAfterCharacters"," \t})]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:b(new u(108,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥++")), +wordWrapColumn:b(new c(109,"wordWrapColumn",80,1,1073741824,{markdownDescription:i.localize(224,null)})),wordWrapMinified:b(new d(110,"wordWrapMinified",!0)),wrappingIndent:b(new p(111,"wrappingIndent",1,"same",["none","same","indent","deepIndent"],(function(e){switch(e){case"none":return 0;case"same":return 1;case"indent":return 2;case"deepIndent":return 3}}),{enumDescriptions:[i.localize(225,null),i.localize(226,null),i.localize(227,null),i.localize(228,null)],description:i.localize(229,null)})),wrappingStrategy:b(new g(112,"wrappingStrategy","simple",["simple","advanced"],{enumDescriptions:[i.localize(230,null),i.localize(231,null)],description:i.localize(232,null)})),editorClassName:b(new class extends a{constructor(){super(114,[57,27])}compute(e,t,i){const n=["monaco-editor"];return t.get(27)&&n.push(t.get(27)),e.extraEditorClassName&&n.push(e.extraEditorClassName),"default"===t.get(57)?n.push("mouse-default"):"copy"===t.get(57)&&n.push("mouse-copy"),t.get(92)&&n.push("showUnused"), +t.get(113)&&n.push("showDeprecated"),n.join(" ")}}),pixelRatio:b(new class extends a{constructor(){super(115)}compute(e,t,i){return e.pixelRatio}}),tabFocusMode:b(new class extends a{constructor(){super(116,[72])}compute(e,t,i){return!!t.get(72)||e.tabFocusMode}}),layoutInfo:b(new v),wrappingInfo:b(new class extends a{constructor(){super(118,[117])}compute(e,t,i){const n=t.get(117);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:n.isWordWrapMinified,isViewportWrapping:n.isViewportWrapping,wrappingColumn:n.wrappingColumn}}})}})),define(t[440],i([0,1,13,3,70,38]),(function(e,t,i,n,o,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ViewModelDecorations=void 0;t.ViewModelDecorations=class{constructor(e,t,i,n,o){this.editorId=e,this.model=t,this.configuration=i,this._linesCollection=n,this._coordinatesConverter=o,this._decorationsCache=Object.create(null),this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null} +_clearCachedModelDecorationsResolver(){this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}dispose(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}reset(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onModelDecorationsChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onLineMappingChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}_getOrCreateViewModelDecoration(e){const t=e.id;let s=this._decorationsCache[t];if(!s){const r=e.range,a=e.options;let l;if(a.isWholeLine){const e=this._coordinatesConverter.convertModelPositionToViewPosition(new i.Position(r.startLineNumber,1)),t=this._coordinatesConverter.convertModelPositionToViewPosition(new i.Position(r.endLineNumber,this.model.getLineMaxColumn(r.endLineNumber)));l=new n.Range(e.lineNumber,e.column,t.lineNumber,t.column) +}else l=this._coordinatesConverter.convertModelRangeToViewRange(r);s=new o.ViewModelDecoration(l,a),this._decorationsCache[t]=s}return s}getDecorationsViewportData(e){let t=null!==this._cachedModelDecorationsResolver;return(t=t&&e.equalsRange(this._cachedModelDecorationsResolverViewRange))||(this._cachedModelDecorationsResolver=this._getDecorationsViewportData(e),this._cachedModelDecorationsResolverViewRange=e),this._cachedModelDecorationsResolver}_getDecorationsViewportData(e){const t=this._linesCollection.getDecorationsInRange(e,this.editorId,s.filterValidationDecorations(this.configuration.options)),i=e.startLineNumber,r=e.endLineNumber;let a=[],l=0,d=[];for(let e=i;e<=r;e++)d[e-i]=[];for(let e=0,s=t.length;e0&&(this.changes=r.compressConsecutiveTextChanges(this.changes,t)),this.afterEOL=i,this.afterVersionId=n,this.afterCursorState=o}static _writeSelectionsSize(e){return 4+16*(e?e.length:0)}static _writeSelections(e,t,i){if(a.writeUInt32BE(e,t?t.length:0,i),i+=4,t)for(const n of t)a.writeUInt32BE(e,n.selectionStartLineNumber,i),i+=4,a.writeUInt32BE(e,n.selectionStartColumn,i),i+=4,a.writeUInt32BE(e,n.positionLineNumber,i),i+=4,a.writeUInt32BE(e,n.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const n=a.readUInt32BE(e,t);t+=4;for(let s=0;se.toString()).join(", ")}matchesResource(e){return(s.URI.isUri(this.model)?this.model:this.model.uri).toString()===e.toString()}setModel(e){this.model=e}canAppend(e){return this.model===e&&this._data instanceof d}append(e,t,i,n,o){this._data instanceof d&&this._data.append(e,t,i,n,o)}close(){this._data instanceof d&&(this._data=this._data.serialize())}undo(){if(s.URI.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof d&&(this._data=this._data.serialize());const e=d.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(s.URI.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof d&&(this._data=this._data.serialize());const e=d.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}}t.SingleModelEditStackElement=c;class h{ +constructor(e,t){this.type=1,this.label=e,this._isOpen=!0,this._editStackElementsArr=t.slice(0),this._editStackElementsMap=new Map;for(const e of this._editStackElementsArr){const t=l(e.resource);this._editStackElementsMap.set(t,e)}this._delegate=null}get resources(){return this._editStackElementsArr.map(e=>e.resource)}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=l(e);return this._editStackElementsMap.has(t)}setModel(e){const t=l(s.URI.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=l(e.uri);if(this._editStackElementsMap.has(t)){return this._editStackElementsMap.get(t).canAppend(e)}return!1}append(e,t,i,n,o){const s=l(e.uri);this._editStackElementsMap.get(s).append(e,t,i,n,o)}close(){this._isOpen=!1}undo(){this._isOpen=!1;for(const e of this._editStackElementsArr)e.undo()}redo(){for(const e of this._editStackElementsArr)e.redo()}split(){ +return this._editStackElementsArr}}function u(e){return"\n"===e.getEOL()?0:1}function g(e){return!!e&&(e instanceof c||e instanceof h)}t.MultiModelEditStackElement=h,t.isEditStackElement=g;class p{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);g(e)&&e.close()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e){const t=this._undoRedoService.getLastElement(this._model.uri);if(g(t)&&t.canAppend(this._model))return t;const i=new c(this._model,e);return this._undoRedoService.pushElement(i),i}pushEOL(e){const t=this._getOrCreateEditStackElement(null);this._model.setEOL(e),t.append(this._model,[],u(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i){const n=this._getOrCreateEditStackElement(e),o=this._model.applyEdits(t,!0),s=p._computeCursorState(i,o),r=o.map((e,t)=>({index:t,textChange:e.textChange})) +;return r.sort((e,t)=>e.textChange.oldPosition===t.textChange.oldPosition?e.index-t.index:e.textChange.oldPosition-t.textChange.oldPosition),n.append(this._model,r.map(e=>e.textChange),u(this._model),this._model.getAlternativeVersionId(),s),s}static _computeCursorState(e,t){try{return e?e(t):null}catch(e){return n.onUnexpectedError(e),null}}}t.EditStack=p})),define(t[442],i([5,6]),(function(e,t){return e.create("vs/editor/common/modes/modesRegistry",t)})),define(t[443],i([5,6]),(function(e,t){return e.create("vs/editor/common/standaloneStrings",t)})),define(t[61],i([0,1,443]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SimpleServicesNLS=t.ToggleHighContrastNLS=t.StandaloneCodeEditorNLS=t.QuickOutlineNLS=t.QuickCommandNLS=t.QuickHelpNLS=t.GoToLineNLS=t.InspectTokensNLS=t.AccessibilityHelpNLS=void 0,function(e){e.noSelection=i.localize(0,null),e.singleSelectionRange=i.localize(1,null),e.singleSelection=i.localize(2,null),e.multiSelectionRange=i.localize(3,null), +e.multiSelection=i.localize(4,null),e.emergencyConfOn=i.localize(5,null),e.openingDocs=i.localize(6,null),e.readonlyDiffEditor=i.localize(7,null),e.editableDiffEditor=i.localize(8,null),e.readonlyEditor=i.localize(9,null),e.editableEditor=i.localize(10,null),e.changeConfigToOnMac=i.localize(11,null),e.changeConfigToOnWinLinux=i.localize(12,null),e.auto_on=i.localize(13,null),e.auto_off=i.localize(14,null),e.tabFocusModeOnMsg=i.localize(15,null),e.tabFocusModeOnMsgNoKb=i.localize(16,null),e.tabFocusModeOffMsg=i.localize(17,null),e.tabFocusModeOffMsgNoKb=i.localize(18,null),e.openDocMac=i.localize(19,null),e.openDocWinLinux=i.localize(20,null),e.outroMsg=i.localize(21,null),e.showAccessibilityHelpAction=i.localize(22,null)}(t.AccessibilityHelpNLS||(t.AccessibilityHelpNLS={})),function(e){e.inspectTokensAction=i.localize(23,null)}(t.InspectTokensNLS||(t.InspectTokensNLS={})),function(e){e.gotoLineActionLabel=i.localize(24,null)}(t.GoToLineNLS||(t.GoToLineNLS={})),function(e){ +e.helpQuickAccessActionLabel=i.localize(25,null)}(t.QuickHelpNLS||(t.QuickHelpNLS={})),function(e){e.quickCommandActionLabel=i.localize(26,null),e.quickCommandHelp=i.localize(27,null)}(t.QuickCommandNLS||(t.QuickCommandNLS={})),function(e){e.quickOutlineActionLabel=i.localize(28,null),e.quickOutlineByCategoryActionLabel=i.localize(29,null)}(t.QuickOutlineNLS||(t.QuickOutlineNLS={})),function(e){e.editorViewAccessibleLabel=i.localize(30,null),e.accessibilityHelpMessage=i.localize(31,null)}(t.StandaloneCodeEditorNLS||(t.StandaloneCodeEditorNLS={})),function(e){e.toggleHighContrast=i.localize(32,null)}(t.ToggleHighContrastNLS||(t.ToggleHighContrastNLS={})),function(e){e.bulkEditServiceSummary=i.localize(33,null)}(t.SimpleServicesNLS||(t.SimpleServicesNLS={}))})),define(t[444],i([5,6]),(function(e,t){return e.create("vs/editor/common/view/editorColorRegistry",t)})),define(t[445],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/anchorSelect/anchorSelect",t)})),define(t[446],i([5,6]),(function(e,t){ +return e.create("vs/editor/contrib/bracketMatching/bracketMatching",t)})),define(t[447],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/caretOperations/caretOperations",t)})),define(t[448],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/caretOperations/transpose",t)})),define(t[449],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/clipboard/clipboard",t)})),define(t[450],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/codeAction/codeActionCommands",t)})),define(t[451],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/codeAction/lightBulbWidget",t)})),define(t[452],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/codelens/codelensController",t)})),define(t[453],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/comment/comment",t)})),define(t[454],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/contextmenu/contextmenu",t)})),define(t[455],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/cursorUndo/cursorUndo",t)})), +define(t[456],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/documentSymbols/outlineTree",t)})),define(t[457],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/find/findController",t)})),define(t[458],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/find/findWidget",t)})),define(t[459],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/folding/folding",t)})),define(t[460],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/fontZoom/fontZoom",t)})),define(t[461],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/format/format",t)})),define(t[462],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/format/formatActions",t)})),define(t[463],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/gotoError/gotoError",t)})),define(t[464],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/gotoError/gotoErrorWidget",t)})),define(t[465],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/gotoSymbol/goToCommands",t)})), +define(t[466],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/gotoSymbol/link/goToDefinitionAtPosition",t)})),define(t[467],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/gotoSymbol/peek/referencesController",t)})),define(t[468],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/gotoSymbol/peek/referencesTree",t)})),define(t[469],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/gotoSymbol/peek/referencesWidget",t)})),define(t[470],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/gotoSymbol/referencesModel",t)})),define(t[126],i([0,1,470,4,41,2,8,97,3,59,12]),(function(e,t,i,n,o,s,a,l,d,c,h){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ReferencesModel=t.FileReferences=t.FilePreview=t.OneReference=void 0;class u{constructor(e,t,i,n,o){this.isProviderFirst=e,this.parent=t,this.uri=i,this._range=n,this._rangeCallback=o,this.id=l.defaultGenerator.nextId()}get range(){return this._range}set range(e){this._range=e,this._rangeCallback(this)} +get ariaMessage(){return i.localize(0,null,o.basename(this.uri),this.range.startLineNumber,this.range.startColumn)}}t.OneReference=u;class g{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const i=this._modelReference.object.textEditorModel;if(!i)return;const{startLineNumber:n,startColumn:o,endLineNumber:s,endColumn:r}=e,a=i.getWordUntilPosition({lineNumber:n,column:o-t}),l=new d.Range(n,a.startColumn,n,o),c=new d.Range(s,r,s,1073741824),h=i.getValueInRange(l).replace(/^\s+/,""),u=i.getValueInRange(e);return{value:h+u+i.getValueInRange(c).replace(/\s+$/,""),highlight:{start:h.length,end:h.length+u.length}}}}t.FilePreview=g;class p{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new c.ResourceMap}dispose(){s.dispose(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length +;return 1===e?i.localize(1,null,o.basename(this.uri),this.uri.fsPath):i.localize(2,null,e,o.basename(this.uri),this.uri.fsPath)}resolve(e){return r(this,void 0,void 0,(function*(){if(0!==this._previews.size)return this;for(let t of this.children)if(!this._previews.has(t.uri))try{const i=yield e.createModelReference(t.uri);this._previews.set(t.uri,new g(i))}catch(e){h.onUnexpectedError(e)}return this}))}}t.FileReferences=p;class m{constructor(e,t){this._disposables=new s.DisposableStore,this.groups=[],this.references=[],this._onDidChangeReferenceRange=new n.Emitter,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[i]=e;let r;e.sort(m._compareReferences);for(let t of e)if(r&&o.extUri.isEqual(r.uri,t.uri,!0)||(r=new p(this,t.uri),this.groups.push(r)),0===r.children.length||0!==m._compareReferences(t,r.children[r.children.length-1])){const e=new u(i===t,r,t.uri,t.targetSelectionRange||t.range,e=>this._onDidChangeReferenceRange.fire(e));this.references.push(e), +r.children.push(e)}}dispose(){s.dispose(this.groups),this._disposables.dispose(),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new m(this._links,this._title)}get title(){return this._title}get isEmpty(){return 0===this.groups.length}get ariaMessage(){return this.isEmpty?i.localize(3,null):1===this.references.length?i.localize(4,null,this.references[0].uri.fsPath):1===this.groups.length?i.localize(5,null,this.references.length,this.groups[0].uri.fsPath):i.localize(6,null,this.references.length,this.groups.length)}nextOrPreviousReference(e,t){let{parent:i}=e,n=i.children.indexOf(e),o=i.children.length,s=i.parent.groups.length;return 1===s||t&&n+10?(n=t?(n+1)%o:(n+o-1)%o,i.children[n]):(n=i.parent.groups.indexOf(i),t?(n=(n+1)%s,i.parent.groups[n].children[0]):(n=(n+s-1)%s,i.parent.groups[n].children[i.parent.groups[n].children.length-1]))}nearestReference(e,t){const i=this.references.map((i,n)=>({idx:n,prefixLen:a.commonPrefixLength(i.uri.toString(),e.toString()), +offsetDist:100*Math.abs(i.range.startLineNumber-t.lineNumber)+Math.abs(i.range.startColumn-t.column)})).sort((e,t)=>e.prefixLen>t.prefixLen?-1:e.prefixLent.offsetDist?1:0)[0];if(i)return this.references[i.idx]}referenceAt(e,t){for(const i of this.references)if(i.uri.toString()===e.toString()&&d.Range.containsPosition(i.range,t))return i}firstReference(){for(const e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return o.extUri.compare(e.uri,t.uri)||d.Range.compareRangesUsingStarts(e.range,t.range)}}t.ReferencesModel=m})),define(t[471],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/gotoSymbol/symbolNavigation",t)})),define(t[472],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/hover/hover",t)})),define(t[473],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/hover/modesContentHover",t)})),define(t[474],i([5,6]),(function(e,t){ +return e.create("vs/editor/contrib/inPlaceReplace/inPlaceReplace",t)})),define(t[475],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/indentation/indentation",t)})),define(t[476],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/linesOperations/linesOperations",t)})),define(t[477],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/links/links",t)})),define(t[478],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/message/messageController",t)})),define(t[479],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/multicursor/multicursor",t)})),define(t[480],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/parameterHints/parameterHints",t)})),define(t[481],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/parameterHints/parameterHintsWidget",t)})),define(t[482],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/peekView/peekView",t)})),define(t[483],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/quickAccess/gotoLineQuickAccess",t) +})),define(t[484],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/quickAccess/gotoSymbolQuickAccess",t)})),define(t[485],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/rename/onTypeRename",t)})),define(t[486],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/rename/rename",t)})),define(t[487],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/rename/renameInputField",t)})),define(t[488],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/smartSelect/smartSelect",t)})),define(t[489],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/snippet/snippetVariables",t)})),define(t[490],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/suggest/suggestController",t)})),define(t[491],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/suggest/suggestWidget",t)})),define(t[492],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/toggleTabFocusMode/toggleTabFocusMode",t)})),define(t[493],i([5,6]),(function(e,t){ +return e.create("vs/editor/contrib/tokenization/tokenization",t)})),define(t[494],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/unusualLineTerminators/unusualLineTerminators",t)})),define(t[495],i([5,6]),(function(e,t){return e.create("vs/editor/contrib/wordHighlighter/wordHighlighter",t)})),define(t[496],i([5,6]),(function(e,t){return e.create("vs/platform/actions/browser/menuEntryActionViewItem",t)})),define(t[497],i([5,6]),(function(e,t){return e.create("vs/platform/configuration/common/configurationRegistry",t)})),define(t[498],i([5,6]),(function(e,t){return e.create("vs/platform/keybinding/common/abstractKeybindingService",t)})),define(t[499],i([5,6]),(function(e,t){return e.create("vs/platform/list/browser/listService",t)})),define(t[500],i([5,6]),(function(e,t){return e.create("vs/platform/markers/common/markers",t)})),define(t[501],i([5,6]),(function(e,t){return e.create("vs/platform/quickinput/browser/commandsQuickAccess",t)})),define(t[502],i([5,6]),(function(e,t){ +return e.create("vs/platform/quickinput/browser/helpQuickAccess",t)})),define(t[503],i([5,6]),(function(e,t){return e.create("vs/platform/theme/common/colorRegistry",t)})),define(t[504],i([5,6]),(function(e,t){return e.create("vs/platform/undoRedo/common/undoRedoService",t)})),define(t[505],i([0,1,7]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserClipboardService=void 0;t.BrowserClipboardService=class{constructor(){this.mapTextToType=new Map,this.findText=""}writeText(e,t){return r(this,void 0,void 0,(function*(){if(t)return void this.mapTextToType.set(t,e);try{return yield navigator.clipboard.writeText(e)}catch(e){console.error(e)}const n=document.activeElement,o=document.body.appendChild(i.$("textarea",{"aria-hidden":!0}));o.style.height="1px",o.style.width="1px",o.style.position="absolute",o.value=e,o.focus(),o.select(),document.execCommand("copy"),n instanceof HTMLElement&&n.focus(),document.body.removeChild(o)}))}readText(e){ +return r(this,void 0,void 0,(function*(){if(e)return this.mapTextToType.get(e)||"";try{return yield navigator.clipboard.readText()}catch(e){return console.error(e),""}}))}readFindText(){return r(this,void 0,void 0,(function*(){return this.findText}))}writeFindText(e){return r(this,void 0,void 0,(function*(){this.findText=e}))}}})),define(t[506],i([0,1]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InputFocusedContextKey=void 0,t.InputFocusedContextKey="inputFocus"})),define(t[507],i([0,1]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditorOpenContext=void 0,function(e){e[e.API=0]="API",e[e.USER=1]="USER"}(t.EditorOpenContext||(t.EditorOpenContext={}))})),define(t[508],i([0,1]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionIdentifier=void 0;t.ExtensionIdentifier=class{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return"string"==typeof e?e.toLowerCase():e._lower}}})), +define(t[229],i([0,1]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileKind=void 0,function(e){e[e.FILE=0]="FILE",e[e.FOLDER=1]="FOLDER",e[e.ROOT_FOLDER=2]="ROOT_FOLDER"}(t.FileKind||(t.FileKind={}))})),define(t[230],i([0,1]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SyncDescriptor=void 0;t.SyncDescriptor=class{constructor(e,t=[],i=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=i}}})),define(t[71],i([0,1,230]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSingletonServiceDescriptors=t.registerSingleton=void 0;const n=[];t.registerSingleton=function(e,t,o){n.push([e,new i.SyncDescriptor(t,[],o)])},t.getSingletonServiceDescriptors=function(){return n}})),define(t[509],i([0,1]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Graph=t.Node=void 0;class i{constructor(e){this.incoming=new Map,this.outgoing=new Map,this.data=e}}t.Node=i;t.Graph=class{ +constructor(e){this._hashFn=e,this._nodes=new Map}roots(){const e=[];for(let t of this._nodes.values())0===t.outgoing.size&&e.push(t);return e}insertEdge(e,t){const i=this.lookupOrInsertNode(e),n=this.lookupOrInsertNode(t);i.outgoing.set(this._hashFn(t),n),n.incoming.set(this._hashFn(e),i)}removeNode(e){const t=this._hashFn(e);this._nodes.delete(t);for(let e of this._nodes.values())e.outgoing.delete(t),e.incoming.delete(t)}lookupOrInsertNode(e){const t=this._hashFn(e);let n=this._nodes.get(t);return n||(n=new i(e),this._nodes.set(t,n)),n}isEmpty(){return 0===this._nodes.size}toString(){let e=[];for(let[t,i]of this._nodes)e.push(`${t}, (incoming)[${[...i.incoming.keys()].join(", ")}], (outgoing)[${[...i.outgoing.keys()].join(",")}]`);return e.join("\n")}}})),define(t[10],i([0,1]),(function(e,t){"use strict";var i;function n(e,t,n,o){t[i.DI_TARGET]===t?t[i.DI_DEPENDENCIES].push({id:e,index:n,optional:o}):(t[i.DI_DEPENDENCIES]=[{id:e,index:n,optional:o}],t[i.DI_TARGET]=t)}function o(e){ +if(i.serviceIds.has(e))return i.serviceIds.get(e);const t=function(e,i,o){if(3!==arguments.length)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");n(t,e,o,!1)};return t.toString=()=>e,i.serviceIds.set(e,t),t}Object.defineProperty(t,"__esModule",{value:!0}),t.optional=t.createDecorator=t.IInstantiationService=t._util=void 0,function(e){e.serviceIds=new Map,e.DI_TARGET="$di$target",e.DI_DEPENDENCIES="$di$dependencies",e.getServiceDependencies=function(t){return t[e.DI_DEPENDENCIES]||[]}}(i=t._util||(t._util={})),t.IInstantiationService=o("instantiationService"),t.createDecorator=o,t.optional=function(e){return function(t,i,o){if(3!==arguments.length)throw new Error("@optional-decorator can only be used to decorate a parameter");n(e,t,o,!0)}}})),define(t[127],i([0,1,10,24,23]),(function(e,t,i,n,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceFileEdit=t.ResourceTextEdit=t.ResourceEdit=t.IBulkEditService=void 0, +t.IBulkEditService=i.createDecorator("IWorkspaceEditService");class s{constructor(e){this.metadata=e}static convert(e){return e.edits.map(e=>{if(function(e){return o.isObject(e)&&n.URI.isUri(e.resource)&&o.isObject(e.edit)}(e))return new r(e.resource,e.edit,e.modelVersionId,e.metadata);if(function(e){return o.isObject(e)&&(Boolean(e.newUri)||Boolean(e.oldUri))}(e))return new a(e.oldUri,e.newUri,e.options,e.metadata);throw new Error("Unsupported edit")})}}t.ResourceEdit=s;class r extends s{constructor(e,t,i,n){super(n),this.resource=e,this.textEdit=t,this.versionId=i,this.metadata=n}}t.ResourceTextEdit=r;class a extends s{constructor(e,t,i,n){super(n),this.oldResource=e,this.newResource=t,this.options=i,this.metadata=n}}t.ResourceFileEdit=a})),define(t[27],i([0,1,10]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ICodeEditorService=void 0,t.ICodeEditorService=i.createDecorator("codeEditorService")})),define(t[72],i([0,1,10]),(function(e,t,i){"use strict" +;Object.defineProperty(t,"__esModule",{value:!0}),t.IEditorWorkerService=t.ID_EDITOR_WORKER_SERVICE=void 0,t.ID_EDITOR_WORKER_SERVICE="editorWorkerService",t.IEditorWorkerService=i.createDecorator(t.ID_EDITOR_WORKER_SERVICE)})),define(t[231],i([0,1,10]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IMarkerDecorationsService=void 0,t.IMarkerDecorationsService=i.createDecorator("markerDecorationsService")})),define(t[73],i([0,1,10]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IModeService=void 0,t.IModeService=i.createDecorator("modeService")})),define(t[44],i([0,1,10]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shouldSynchronizeModel=t.IModelService=void 0,t.IModelService=i.createDecorator("modelService"),t.shouldSynchronizeModel=function(e){return!e.isTooLargeForSyncing()&&!e.isForSimpleWidget}})),define(t[510],i([0,1,4,2,366,44]),(function(e,t,i,n,o,s){"use strict";function r(e){ +return"string"!=typeof e&&(Array.isArray(e)?e.every(r):!!e.exclusive)}Object.defineProperty(t,"__esModule",{value:!0}),t.LanguageFeatureRegistry=void 0;class a{constructor(){this._clock=0,this._entries=[],this._onDidChange=new i.Emitter}get onDidChange(){return this._onDidChange.event}register(e,t){let i={selector:e,provider:t,_score:-1,_time:this._clock++};return this._entries.push(i),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),n.toDisposable(()=>{if(i){let e=this._entries.indexOf(i);e>=0&&(this._entries.splice(e,1),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),i=void 0)}})}has(e){return this.all(e).length>0}all(e){if(!e)return[];this._updateScores(e);const t=[];for(let e of this._entries)e._score>0&&t.push(e.provider);return t}ordered(e){const t=[];return this._orderedForEach(e,e=>t.push(e.provider)),t}orderedGroups(e){const t=[];let i,n;return this._orderedForEach(e,e=>{i&&n===e._score?i.push(e.provider):(n=e._score,i=[e.provider],t.push(i))}),t} +_orderedForEach(e,t){if(e){this._updateScores(e);for(const e of this._entries)e._score>0&&t(e)}}_updateScores(e){let t={uri:e.uri.toString(),language:e.getLanguageIdentifier().language};if(!this._lastCandidate||this._lastCandidate.language!==t.language||this._lastCandidate.uri!==t.uri){this._lastCandidate=t;for(let t of this._entries)if(t._score=o.score(t.selector,e.uri,e.getLanguageIdentifier().language,s.shouldSynchronizeModel(e)),r(t.selector)&&t._score>0){for(let e of this._entries)e._score=0;t._score=1e3;break}this._entries.sort(a._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._scoret._score?-1:e._timet._time?-1:0}}t.LanguageFeatureRegistry=a})),define(t[18],i([0,1,24,3,510,374,26]),(function(e,t,i,n,o,s,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}), +t.TokenizationRegistry=t.DocumentRangeSemanticTokensProviderRegistry=t.DocumentSemanticTokensProviderRegistry=t.FoldingRangeProviderRegistry=t.SelectionRangeRegistry=t.ColorProviderRegistry=t.LinkProviderRegistry=t.OnTypeFormattingEditProviderRegistry=t.DocumentRangeFormattingEditProviderRegistry=t.DocumentFormattingEditProviderRegistry=t.CodeActionProviderRegistry=t.CodeLensProviderRegistry=t.TypeDefinitionProviderRegistry=t.ImplementationProviderRegistry=t.DeclarationProviderRegistry=t.DefinitionProviderRegistry=t.OnTypeRenameProviderRegistry=t.DocumentHighlightProviderRegistry=t.DocumentSymbolProviderRegistry=t.HoverProviderRegistry=t.SignatureHelpProviderRegistry=t.CompletionProviderRegistry=t.RenameProviderRegistry=t.ReferenceProviderRegistry=t.FoldingRangeKind=t.SymbolKinds=t.isLocationLink=t.DocumentHighlightKind=t.SignatureHelpTriggerKind=t.completionKindFromString=t.completionKindToCssClass=t.TokenMetadata=t.LanguageIdentifier=void 0;t.LanguageIdentifier=class{constructor(e,t){this.language=e, +this.id=t}};t.TokenMetadata=class{static getLanguageId(e){return(255&e)>>>0}static getTokenType(e){return(1792&e)>>>8}static getFontStyle(e){return(14336&e)>>>11}static getForeground(e){return(8372224&e)>>>14}static getBackground(e){return(4286578688&e)>>>23}static getClassNameFromMetadata(e){let t="mtk"+this.getForeground(e),i=this.getFontStyle(e);return 1&i&&(t+=" mtki"),2&i&&(t+=" mtkb"),4&i&&(t+=" mtku"),t}static getInlineStyleFromMetadata(e,t){const i=this.getForeground(e),n=this.getFontStyle(e);let o=`color: ${t[i]};`;return 1&n&&(o+="font-style: italic;"),2&n&&(o+="font-weight: bold;"),4&n&&(o+="text-decoration: underline;"),o}},t.completionKindToCssClass=function(){let e=Object.create(null);return e[0]="symbol-method",e[1]="symbol-function",e[2]="symbol-constructor",e[3]="symbol-field",e[4]="symbol-variable",e[5]="symbol-class",e[6]="symbol-struct",e[7]="symbol-interface",e[8]="symbol-module",e[9]="symbol-property",e[10]="symbol-event",e[11]="symbol-operator",e[12]="symbol-unit",e[13]="symbol-value", +e[14]="symbol-constant",e[15]="symbol-enum",e[16]="symbol-enum-member",e[17]="symbol-keyword",e[27]="symbol-snippet",e[18]="symbol-text",e[19]="symbol-color",e[20]="symbol-file",e[21]="symbol-reference",e[22]="symbol-customcolor",e[23]="symbol-folder",e[24]="symbol-type-parameter",e[25]="account",e[26]="issues",function(t){const i=e[t];let n=i&&r.iconRegistry.get(i);return n||(console.info("No codicon found for CompletionItemKind "+t),n=r.Codicon.symbolProperty),n.classNames}}(),t.completionKindFromString=function(){let e=Object.create(null);return e.method=0,e.function=1,e.constructor=2,e.field=3,e.variable=4,e.class=5,e.struct=6,e.interface=7,e.module=8,e.property=9,e.event=10,e.operator=11,e.unit=12,e.value=13,e.constant=14,e.enum=15,e["enum-member"]=16,e.enumMember=16,e.keyword=17,e.snippet=27,e.text=18,e.color=19,e.file=20,e.reference=21,e.customcolor=22,e.folder=23,e["type-parameter"]=24,e.typeParameter=24,e.account=25,e.issue=26,function(t,i){let n=e[t];return void 0!==n||i||(n=9),n}}(),function(e){ +e[e.Invoke=1]="Invoke",e[e.TriggerCharacter=2]="TriggerCharacter",e[e.ContentChange=3]="ContentChange"}(t.SignatureHelpTriggerKind||(t.SignatureHelpTriggerKind={})),function(e){e[e.Text=0]="Text",e[e.Read=1]="Read",e[e.Write=2]="Write"}(t.DocumentHighlightKind||(t.DocumentHighlightKind={})),t.isLocationLink=function(e){return e&&i.URI.isUri(e.uri)&&n.Range.isIRange(e.range)&&(n.Range.isIRange(e.originSelectionRange)||n.Range.isIRange(e.targetSelectionRange))},function(e){const t=new Map;t.set("file",0),t.set("module",1),t.set("namespace",2),t.set("package",3),t.set("class",4),t.set("method",5),t.set("property",6),t.set("field",7),t.set("constructor",8),t.set("enum",9),t.set("interface",10),t.set("function",11),t.set("variable",12),t.set("constant",13),t.set("string",14),t.set("number",15),t.set("boolean",16),t.set("array",17),t.set("object",18),t.set("key",19),t.set("null",20),t.set("enum-member",21),t.set("struct",22),t.set("event",23),t.set("operator",24),t.set("type-parameter",25);const i=new Map +;i.set(0,"file"),i.set(1,"module"),i.set(2,"namespace"),i.set(3,"package"),i.set(4,"class"),i.set(5,"method"),i.set(6,"property"),i.set(7,"field"),i.set(8,"constructor"),i.set(9,"enum"),i.set(10,"interface"),i.set(11,"function"),i.set(12,"variable"),i.set(13,"constant"),i.set(14,"string"),i.set(15,"number"),i.set(16,"boolean"),i.set(17,"array"),i.set(18,"object"),i.set(19,"key"),i.set(20,"null"),i.set(21,"enum-member"),i.set(22,"struct"),i.set(23,"event"),i.set(24,"operator"),i.set(25,"type-parameter"),e.fromString=function(e){return t.get(e)},e.toString=function(e){return i.get(e)},e.toCssClassName=function(e,t){const n=i.get(e);let o=n&&r.iconRegistry.get("symbol-"+n);return o||(console.info("No codicon found for SymbolKind "+e),o=r.Codicon.symbolProperty),`${t?"inline":"block"} ${o.classNames}`}}(t.SymbolKinds||(t.SymbolKinds={}));class a{constructor(e){this.value=e}}t.FoldingRangeKind=a,a.Comment=new a("comment"),a.Imports=new a("imports"),a.Region=new a("region"), +t.ReferenceProviderRegistry=new o.LanguageFeatureRegistry,t.RenameProviderRegistry=new o.LanguageFeatureRegistry,t.CompletionProviderRegistry=new o.LanguageFeatureRegistry,t.SignatureHelpProviderRegistry=new o.LanguageFeatureRegistry,t.HoverProviderRegistry=new o.LanguageFeatureRegistry,t.DocumentSymbolProviderRegistry=new o.LanguageFeatureRegistry,t.DocumentHighlightProviderRegistry=new o.LanguageFeatureRegistry,t.OnTypeRenameProviderRegistry=new o.LanguageFeatureRegistry,t.DefinitionProviderRegistry=new o.LanguageFeatureRegistry,t.DeclarationProviderRegistry=new o.LanguageFeatureRegistry,t.ImplementationProviderRegistry=new o.LanguageFeatureRegistry,t.TypeDefinitionProviderRegistry=new o.LanguageFeatureRegistry,t.CodeLensProviderRegistry=new o.LanguageFeatureRegistry,t.CodeActionProviderRegistry=new o.LanguageFeatureRegistry,t.DocumentFormattingEditProviderRegistry=new o.LanguageFeatureRegistry,t.DocumentRangeFormattingEditProviderRegistry=new o.LanguageFeatureRegistry, +t.OnTypeFormattingEditProviderRegistry=new o.LanguageFeatureRegistry,t.LinkProviderRegistry=new o.LanguageFeatureRegistry,t.ColorProviderRegistry=new o.LanguageFeatureRegistry,t.SelectionRangeRegistry=new o.LanguageFeatureRegistry,t.FoldingRangeProviderRegistry=new o.LanguageFeatureRegistry,t.DocumentSemanticTokensProviderRegistry=new o.LanguageFeatureRegistry,t.DocumentRangeSemanticTokensProviderRegistry=new o.LanguageFeatureRegistry,t.TokenizationRegistry=new s.TokenizationRegistryImpl})),define(t[105],i([0,1,18]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SlicedLineTokens=t.LineTokens=void 0;class n{constructor(e,t){this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t}equals(e){return e instanceof n&&this.slicedEquals(e,0,this._tokensCount)}slicedEquals(e,t,i){if(this._text!==e._text)return!1;if(this._tokensCount!==e._tokensCount)return!1;const n=t<<1,o=n+(i<<1);for(let t=n;t0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[1+(e<<1)]}getLanguageId(e){const t=this._tokens[1+(e<<1)];return i.TokenMetadata.getLanguageId(t)}getStandardTokenType(e){const t=this._tokens[1+(e<<1)];return i.TokenMetadata.getTokenType(t)}getForeground(e){const t=this._tokens[1+(e<<1)];return i.TokenMetadata.getForeground(t)}getClassName(e){const t=this._tokens[1+(e<<1)];return i.TokenMetadata.getClassNameFromMetadata(t)}getInlineStyle(e,t){const n=this._tokens[1+(e<<1)];return i.TokenMetadata.getInlineStyleFromMetadata(n,t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return n.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new o(this,e,t,i)}static convertToEndOffset(e,t){const i=(e.length>>>1)-1;for(let t=0;t>>1)-1;for(;it&&(n=o)}return i}}t.LineTokens=n;class o{constructor(e,t,i,n){this._source=e,this._startOffset=t,this._endOffset=i,this._deltaOffset=n,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this._tokensCount=0;for(let t=this._firstTokenIndex,n=e.getCount();t=i)break;this._tokensCount++}}equals(e){return e instanceof o&&(this._startOffset===e._startOffset&&this._endOffset===e._endOffset&&this._deltaOffset===e._deltaOffset&&this._source.slicedEquals(e._source,this._firstTokenIndex,this._tokensCount))}getCount(){return this._tokensCount}getForeground(e){return this._source.getForeground(this._firstTokenIndex+e)}getEndOffset(e){const t=this._source.getEndOffset(this._firstTokenIndex+e);return Math.min(this._endOffset,t)-this._startOffset+this._deltaOffset}getClassName(e){return this._source.getClassName(this._firstTokenIndex+e)}getInlineStyle(e,t){return this._source.getInlineStyle(this._firstTokenIndex+e,t)} +findTokenIndexAtOffset(e){return this._source.findTokenIndexAtOffset(e+this._startOffset-this._deltaOffset)-this._firstTokenIndex}}t.SlicedLineTokens=o})),define(t[128],i([0,1,19,105,13,3,18]),(function(e,t,i,n,o,s,r){"use strict";function a(e){let t=0,i=0,n=0,o=0;for(let s=0,r=e.length;s>>0}Object.defineProperty(t,"__esModule",{value:!0}),t.TokensStore=t.TokensStore2=t.MultilineTokens=t.MultilineTokens2=t.LineTokens2=t.SparseEncodedTokens=t.MultilineTokensBuilder=t.countEOL=void 0,t.countEOL=a;const d=new Uint32Array(0).buffer;t.MultilineTokensBuilder=class{constructor(){this.tokens=[]}add(e,t){if(this.tokens.length>0){const i=this.tokens[this.tokens.length-1];if(i.startLineNumber+i.tokens.length-1+1===e)return void i.tokens.push(t)}this.tokens.push(new g(e,[t]))}};class c{ +constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){let t=[];for(let i=0;ie)){let o=n;for(;o>t&&this._getDeltaLine(o-1)===e;)o--;let s=n;for(;se||c===e&&u>=t)&&(ce||c===e&&g>=t){if(co?p-=o-i:p=i;else if(u===t&&g===i){if(!(u===n&&p>o)){d=!0;continue}p-=o-i +}else if(uo)){d=!0;continue}p=u===t?(g=i)+(p-o):(g=0)+(p-o)}else if(u>n){if(0===a&&!d){l=r;break}u-=a}else{if(!(u===n&&g>=o))throw new Error("Not possible!");e&&0===u&&(g+=e,p+=e),u-=a,g-=o-i,p-=o-i}const f=4*l;s[f]=u,s[f+1]=g,s[f+2]=p,s[f+3]=m,l++}this._tokenCount=l}acceptInsertText(e,t,i,n,o,s){const r=0===i&&1===n&&(s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122),a=this._tokens,l=this._tokenCount;for(let s=0;s0?t.charCodeAt(0):0)}acceptEdit(e,t,i,n,s){this._acceptDeleteRange(e),this._acceptInsertText(new o.Position(e.startLineNumber,e.startColumn),t,i,n,s),this._updateEndLineNumber()}_acceptDeleteRange(e){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return;const t=e.startLineNumber-this.startLineNumber,i=e.endLineNumber-this.startLineNumber;if(i<0){const e=i-t;return void(this.startLineNumber-=e)}const n=this.tokens.getMaxDeltaLine();if(!(t>=n+1)){if(t<0&&i>=n+1)return this.startLineNumber=0,void this.tokens.clear();if(t<0){const n=-t;this.startLineNumber-=n,this.tokens.acceptDeleteRange(e.startColumn-1,0,0,i,e.endColumn-1)}else this.tokens.acceptDeleteRange(0,t,e.startColumn-1,i,e.endColumn-1)}}_acceptInsertText(e,t,i,n,o){if(0===t&&0===i)return;const s=e.lineNumber-this.startLineNumber +;s<0?this.startLineNumber+=t:s>=this.tokens.getMaxDeltaLine()+1||this.tokens.acceptInsertText(s,e.column-1,t,i,n,o)}}t.MultilineTokens2=u;class g{constructor(e,t){this.startLineNumber=e,this.tokens=t}}function p(e){return e instanceof Uint32Array?e:new Uint32Array(e)}t.MultilineTokens=g;class m{constructor(){this._pieces=[],this._isComplete=!1}flush(){this._pieces=[],this._isComplete=!1}set(e,t){this._pieces=e||[],this._isComplete=t}setPartial(e,t){let n=e;if(t.length>0){const i=t[0].getRange(),o=t[t.length-1].getRange();if(!i||!o)return e;n=e.plusRange(i).plusRange(o)}let o=null;for(let e=0,t=this._pieces.length;en.endLineNumber){o=o||{index:e};break}if(i.removeTokens(n),i.isEmpty()){this._pieces.splice(e,1),e--,t--;continue}if(i.endLineNumbern.endLineNumber){o=o||{index:e};continue}const[s,r]=i.split(n);s.isEmpty()?o=o||{index:e +}:r.isEmpty()||(this._pieces.splice(e,1,s,r),e++,t++,o=o||{index:e})}return o=o||{index:this._pieces.length},t.length>0&&(this._pieces=i.arrayInsert(this._pieces,o.index,t)),n}isComplete(){return this._isComplete}addSemanticTokens(e,t){const i=this._pieces;if(0===i.length)return t;const o=i[m._findFirstPieceWithLine(i,e)].getLineTokens(e);if(!o)return t;const s=t.getCount(),r=o.getCount();let a=0,l=[],d=0,c=0;const h=(e,t)=>{e!==c&&(c=e,l[d++]=e,l[d++]=t)};for(let e=0;e>>0,d=~l>>>0;for(;at)){for(;o>i&&e[o-1].startLineNumber<=t&&t<=e[o-1].endLineNumber;)o--;return o}n=o-1}}return i}acceptEdit(e,t,i,n,o){for(const s of this._pieces)s.acceptEdit(e,t,i,n,o)}}t.TokensStore2=m;class f{constructor(){this._lineTokens=[],this._len=0}flush(){this._lineTokens=[],this._len=0}getTokens(e,t,i){let o=null;if(t1&&(t=r.TokenMetadata.getLanguageId(n[1])!==e),!t)return d}if(!n||0===n.length){const i=new Uint32Array(2);return i[0]=t,i[1]=l(e),i.buffer}return n[n.length-2]=t, +0===n.byteOffset&&n.byteLength===n.buffer.byteLength?n.buffer:n}_ensureLine(e){for(;e>=this._len;)this._lineTokens[this._len]=null,this._len++}_deleteLines(e,t){0!==t&&(e+t>this._len&&(t=this._len-e),this._lineTokens.splice(e,t),this._len-=t)}_insertLines(e,t){if(0===t)return;let n=[];for(let e=0;e=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return +;return void(this._lineTokens[t]=f._delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1))}this._lineTokens[t]=f._deleteEnding(this._lineTokens[t],e.startColumn-1);const i=e.endLineNumber-1;let n=null;i=this._len||(0!==t?(this._lineTokens[n]=f._deleteEnding(this._lineTokens[n],e.column-1),this._lineTokens[n]=f._insert(this._lineTokens[n],e.column-1,i),this._insertLines(e.lineNumber,t)):this._lineTokens[n]=f._insert(this._lineTokens[n],e.column-1,i))}static _deleteBeginning(e,t){return null===e||e===d?e:f._delete(e,0,t)}static _deleteEnding(e,t){if(null===e||e===d)return e;const i=p(e),n=i[i.length-2];return f._delete(e,t,n)}static _delete(e,t,i){if(null===e||e===d||t===i)return e;const o=p(e),s=o.length>>>1;if(0===t&&o[o.length-2]===i)return d +;const r=n.LineTokens.findIndexInTokensArray(o,t),a=r>0?o[r-1<<1]:0;if(ic&&(o[l++]=t,o[l++]=o[1+(e<<1)],c=t)}if(l===o.length)return e;let u=new Uint32Array(l);return u.set(o.subarray(0,l),0),u.buffer}static _append(e,t){if(t===d)return e;if(e===d)return t;if(null===e)return e;if(null===t)return null;const i=p(e),n=p(t),o=n.length>>>1;let s=new Uint32Array(i.length+n.length);s.set(i,0);let r=i.length;const a=i[i.length-2];for(let e=0;e>>1;let r=n.LineTokens.findIndexInTokensArray(o,t);if(r>0){o[r-1<<1]===t&&r--}for(let e=r;ee.sortIndex-t.sortIndex)}this._mightContainRTL=o,this._mightContainUnusualLineTerminators=r,this._mightContainNonBasicASCII=c;const _=this._doApplyEdits(u);let v=null;if(t&&m.length>0){m.sort((e,t)=>t.lineNumber-e.lineNumber),v=[];for(let e=0,t=m.length;e0&&m[e-1].lineNumber===t)continue;let i=m[e].oldContent,o=this.getLineContent(t);0!==o.length&&o!==i&&-1===n.firstNonWhitespaceIndex(o)&&v.push(t)}}return this._onDidChangeContent.fire(),new s.ApplyEditsResult(f,_,v)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1;const i=e[0].range,n=e[e.length-1].range,s=new o.Range(i.startLineNumber,i.startColumn,n.endLineNumber,n.endColumn);let r=i.startLineNumber,l=i.startColumn;const d=[];for(let i=0,n=e.length;i0&&d.push(n.text),r=s.endLineNumber,l=s.endColumn}const c=d.join(""),[h,u,g]=a.countEOL(c);return{sortIndex:0,identifier:e[0].identifier,range:s,rangeOffset:this.getOffsetAt(s.startLineNumber,s.startColumn),rangeLength:this.getValueLengthInRange(s,0),text:c,eolCount:h,firstLineLength:u,lastLineLength:g,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(d._sortOpsDescending);let t=[];for(let i=0;i0){const e=c.eolCount+1;d=1===e?new o.Range(a,l,a,l+c.firstLineLength):new o.Range(a,l,a+e-1,c.lastLineLength+1)}else d=new o.Range(a,l,a,l);i=d.endLineNumber,n=d.endColumn,t.push(d),s=c}return t}static _sortOpsAscending(e,t){let i=o.Range.compareRangesUsingEnds(e.range,t.range);return 0===i?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){let i=o.Range.compareRangesUsingEnds(e.range,t.range);return 0===i?t.sortIndex-e.sortIndex:-i}}t.PieceTreeTextBuffer=d})),define(t[512],i([0,1,8,211,511]),(function(e,t,i,n,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}), +t.PieceTreeTextBufferBuilder=t.PieceTreeTextBufferFactory=void 0;class s{constructor(e,t,i,n,o,s,r,a,l){this._chunks=e,this._bom=t,this._cr=i,this._lf=n,this._crlf=o,this._containsRTL=s,this._containsUnusualLineTerminators=r,this._isBasicASCII=a,this._normalizeEOL=l}_getEOL(e){const t=this._cr+this._lf+this._crlf,i=this._cr+this._crlf;return 0===t?1===e?"\n":"\r\n":i>t/2?"\r\n":"\n"}create(e){const t=this._getEOL(e);let i=this._chunks;if(this._normalizeEOL&&("\r\n"===t&&(this._cr>0||this._lf>0)||"\n"===t&&(this._cr>0||this._crlf>0)))for(let e=0,o=i.length;e=55296&&t<=56319?(this._acceptChunk1(e.substr(0,e.length-1),!1),this._hasPreviousChar=!0,this._previousChar=t):(this._acceptChunk1(e,!1),this._hasPreviousChar=!1,this._previousChar=t)}_acceptChunk1(e,t){(t||0!==e.length)&&(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))}_acceptChunk2(e){const t=n.createLineStarts(this._tmpLineStarts,e);this.chunks.push(new n.StringBuffer(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,this.isBasicASCII&&(this.isBasicASCII=t.isBasicASCII),this.isBasicASCII||this.containsRTL||(this.containsRTL=i.containsRTL(e)),this.isBasicASCII||this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=i.containsUnusualLineTerminators(e))}finish(e=!0){ +return this._finish(),new s(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.containsUnusualLineTerminators,this.isBasicASCII,e)}_finish(){if(0===this.chunks.length&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;let e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);let t=n.createLineStartsFast(e.buffer);e.lineStarts=t,13===this._previousChar&&this.cr++}}}})),define(t[74],i([0,1,121,18]),(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nullTokenize2=t.nullTokenize=t.NULL_LANGUAGE_IDENTIFIER=t.NULL_MODE_ID=t.NULL_STATE=void 0;t.NULL_STATE=new class{clone(){return this}equals(e){return this===e}},t.NULL_MODE_ID="vs.editor.nullMode",t.NULL_LANGUAGE_IDENTIFIER=new n.LanguageIdentifier(t.NULL_MODE_ID,0),t.nullTokenize=function(e,t,n,o){return new i.TokenizationResult([new i.Token(o,"",e)],n)},t.nullTokenize2=function(e,n,o,s){let r=new Uint32Array(2);return r[0]=s,r[1]=(16384|e<<0|2<<23)>>>0, +new i.TokenizationResult2(r,null===o?t.NULL_STATE:o)}})),define(t[513],i([0,1,19,12,105,13,18,74,2,111,128,16]),(function(e,t,i,n,o,s,r,a,l,d,c,h){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TextModelTokenization=t.TokenizationStateStore=void 0;class u{constructor(){this._beginState=[],this._valid=[],this._len=0,this._invalidLineStartIndex=0}_reset(e){this._beginState=[],this._valid=[],this._len=0,this._invalidLineStartIndex=0,e&&this._setBeginState(0,e)}flush(e){this._reset(e)}get invalidLineStartIndex(){return this._invalidLineStartIndex}_invalidateLine(e){e=this._len;)this._beginState[this._len]=null,this._valid[this._len]=!1,this._len++}_deleteLines(e,t){0!==t&&(e+t>this._len&&(t=this._len-e),this._beginState.splice(e,t),this._valid.splice(e,t),this._len-=t)} +_insertLines(e,t){if(0===t)return;let n=[],o=[];for(let e=0;e=0;t--)this._invalidateLine(e.startLineNumber+t-1);this._acceptDeleteRange(e),this._acceptInsertText(new s.Position(e.startLineNumber,e.startColumn),t)}_acceptDeleteRange(e){e.startLineNumber-1>=this._len||this._deleteLines(e.startLineNumber,e.endLineNumber-e.startLineNumber)}_acceptInsertText(e,t){ +e.lineNumber-1>=this._len||this._insertLines(e.lineNumber,t)}}t.TokenizationStateStore=u;class g extends l.Disposable{constructor(e){super(),this._isDisposed=!1,this._textModel=e,this._tokenizationStateStore=new u,this._tokenizationSupport=null,this._register(r.TokenizationRegistry.onDidChange(e=>{const t=this._textModel.getLanguageIdentifier();-1!==e.changedLanguages.indexOf(t.language)&&(this._resetTokenizationState(),this._textModel.clearTokens())})),this._register(this._textModel.onDidChangeRawContentFast(e=>{e.containsEvent(1)&&this._resetTokenizationState()})),this._register(this._textModel.onDidChangeContentFast(e=>{for(let t=0,i=e.changes.length;t{this._beginBackgroundTokenization()})),this._register(this._textModel.onDidChangeLanguage(()=>{this._resetTokenizationState(),this._textModel.clearTokens()})), +this._resetTokenizationState()}dispose(){this._isDisposed=!0,super.dispose()}_resetTokenizationState(){const[e,t]=function(e){const t=e.getLanguageIdentifier();let i=e.isTooLargeForTokenization()?null:r.TokenizationRegistry.get(t.language),o=null;if(i)try{o=i.getInitialState()}catch(e){n.onUnexpectedError(e),i=null}return[i,o]}(this._textModel);this._tokenizationSupport=e,this._tokenizationStateStore.flush(t),this._beginBackgroundTokenization()}_beginBackgroundTokenization(){this._textModel.isAttachedToEditor()&&this._hasLinesToTokenize()&&h.setImmediate(()=>{this._isDisposed||this._revalidateTokensNow()})}_revalidateTokensNow(e=this._textModel.getLineCount()){const t=new c.MultilineTokensBuilder,i=d.StopWatch.create(!1);for(;this._hasLinesToTokenize()&&!(i.elapsed()>1);){if(this._tokenizeOneInvalidLine(t)>=e)break}this._beginBackgroundTokenization(),this._textModel.setTokens(t.tokens)}tokenizeViewport(e,t){const i=new c.MultilineTokensBuilder;this._tokenizeViewport(i,e,t),this._textModel.setTokens(i.tokens)} +reset(){this._resetTokenizationState(),this._textModel.clearTokens()}forceTokenization(e){const t=new c.MultilineTokensBuilder;this._updateTokensUntilLine(t,e),this._textModel.setTokens(t.tokens)}isCheapToTokenize(e){if(!this._tokenizationSupport)return!0;const t=this._tokenizationStateStore.invalidLineStartIndex+1;return!(e>t)&&(e0&&e>=1;e--){let t=this._textModel.getLineFirstNonWhitespaceColumn(e);if(0!==t&&t=0;e--){a=p(r,this._tokenizationSupport,o[e],a).endState}for(let n=t;n<=i;n++){ +let t=this._textModel.getLineContent(n),i=p(r,this._tokenizationSupport,t,a);e.add(n,i.tokens),this._tokenizationStateStore.setFakeTokens(n-1),a=i.endState}}}function p(e,t,i,s){let r=null;if(t)try{r=t.tokenize2(i,s.clone(),0)}catch(e){n.onUnexpectedError(e)}return r||(r=a.nullTokenize2(e.id,i,s,0)),o.LineTokens.convertToEndOffset(r.tokens,i.length),r}t.TextModelTokenization=g})),define(t[31],i([0,1,12,4,2,8,24,38,13,3,20,52,228,361,362,512,364,158,513,122,42,74,159,160,128,29]),(function(e,t,i,n,o,s,r,a,l,d,c,h,u,g,p,m,f,_,v,C,b,S,w,y,E,L){"use strict";function x(e){const t=new m.PieceTreeTextBufferBuilder;return t.acceptChunk(e),t.finish()}function D(e,t){return("string"==typeof e?x(e):e).create(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.DidChangeContentEmitter=t.DidChangeDecorationsEmitter=t.ModelDecorationOptions=t.ModelDecorationMinimapOptions=t.ModelDecorationOverviewRulerOptions=t.TextModel=t.LONG_LINE_BOUNDARY=t.createTextBuffer=t.createTextBufferFactory=void 0,t.createTextBufferFactory=x, +t.createTextBuffer=D;let k=0;const N=999;t.LONG_LINE_BOUNDARY=1e4;class I{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;let e=[],t=0,i=0;for(;;){let n=this._source.read();if(null===n)return this._eos=!0,0===t?null:e.join("");if(n.length>0&&(e[t++]=n,i+=n.length),i>=65536)return e.join("")}}}const M=()=>{throw new Error("Invalid change accessor")};class R{constructor(){this._searchCanceledBrand=void 0}}function T(e){return e instanceof R?null:e}R.INSTANCE=new R;class O extends o.Disposable{constructor(e,t,i,o=null,a){super(),this._onWillDispose=this._register(new n.Emitter),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new K),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeLanguage=this._register(new n.Emitter),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new n.Emitter), +this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new n.Emitter),this.onDidChangeTokens=this._onDidChangeTokens.event,this._onDidChangeOptions=this._register(new n.Emitter),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new n.Emitter),this.onDidChangeAttached=this._onDidChangeAttached.event,this._eventEmitter=this._register(new U),k++,this.id="$model"+k,this.isForSimpleWidget=t.isForSimpleWidget,this._associatedResource=null==o?r.URI.parse("inmemory://model/"+k):o,this._undoRedoService=a,this._attachedEditorCount=0,this._buffer=D(e,t.defaultEOL),this._options=O.resolveOptions(this._buffer,t);const l=this._buffer.getLineCount(),c=this._buffer.getValueLengthInRange(new d.Range(1,1,l,this._buffer.getLineLength(l)+1),0);t.largeFileOptimizations?this._isTooLargeForTokenization=c>O.LARGE_FILE_SIZE_THRESHOLD||l>O.LARGE_FILE_LINE_COUNT_THRESHOLD:this._isTooLargeForTokenization=!1, +this._isTooLargeForSyncing=c>O.MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this._isDisposing=!1,this._languageIdentifier=i||S.NULL_LANGUAGE_IDENTIFIER,this._languageRegistryListener=b.LanguageConfigurationRegistry.onDidChange(e=>{e.languageIdentifier.id===this._languageIdentifier.id&&this._onDidChangeLanguageConfiguration.fire({})}),this._instanceId=s.singleLetterHash(k),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new A,this._commandManager=new u.EditStack(this,a),this._isUndoing=!1,this._isRedoing=!1,this._trimAutoWhitespaceLines=null,this._tokens=new E.TokensStore,this._tokens2=new E.TokensStore2,this._tokenization=new v.TextModelTokenization(this)}static resolveOptions(e,t){if(t.detectIndentation){const i=g.guessIndentation(e,t.tabSize,t.insertSpaces);return new h.TextModelResolvedOptions({tabSize:i.tabSize,indentSize:i.tabSize,insertSpaces:i.insertSpaces, +trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL})}return new h.TextModelResolvedOptions({tabSize:t.tabSize,indentSize:t.indentSize,insertSpaces:t.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL})}onDidChangeRawContentFast(e){return this._eventEmitter.fastEvent(t=>e(t.rawContentChangedEvent))}onDidChangeContentFast(e){return this._eventEmitter.fastEvent(t=>e(t.contentChangedEvent))}onDidChangeContent(e){return this._eventEmitter.slowEvent(t=>e(t.contentChangedEvent))}dispose(){this._isDisposing=!0,this._onWillDispose.fire(),this._languageRegistryListener.dispose(),this._tokenization.dispose(),this._isDisposed=!0,super.dispose(),this._isDisposing=!1}_assertNotDisposed(){if(this._isDisposed)throw new Error("Model is disposed!")}_emitContentChangedEvent(e,t){this._isDisposing||this._eventEmitter.fire(new f.InternalModelContentChangeEvent(e,t))}setValue(e){if(this._assertNotDisposed(),null===e)return;const t=D(e,this._options.defaultEOL);this.setValueFromTextBuffer(t)} +_createContentChanged2(e,t,i,n,o,s,r){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:n}],eol:this._buffer.getEOL(),versionId:this.getVersionId(),isUndoing:o,isRedoing:s,isFlush:r}}setValueFromTextBuffer(e){if(this._assertNotDisposed(),null===e)return;const t=this.getFullModelRange(),i=this.getValueLengthInRange(t),n=this.getLineCount(),o=this.getLineMaxColumn(n);this._buffer=e,this._increaseVersionId(),this._tokens.flush(),this._tokens2.flush(),this._decorations=Object.create(null),this._decorationsTree=new A,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new f.ModelRawContentChangedEvent([new f.ModelRawFlush],this._versionId,!1,!1),this._createContentChanged2(new d.Range(1,1,n,o),0,i,this.getValue(),!1,!1,!0))}setEOL(e){this._assertNotDisposed();const t=1===e?"\r\n":"\n";if(this._buffer.getEOL()===t)return;const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),o=this.getLineCount(),s=this.getLineMaxColumn(o);this._onBeforeEOLChange(), +this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new f.ModelRawContentChangedEvent([new f.ModelRawEOLChanged],this._versionId,!1,!1),this._createContentChanged2(new d.Range(1,1,o,s),0,n,this.getValue(),!1,!1,!1))}_onBeforeEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.search(0,!1,!1,e);this._ensureNodesHaveRanges(t)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let i=0,n=t.length;i0}getAttachedEditorCount(){return this._attachedEditorCount}isTooLargeForSyncing(){return this._isTooLargeForSyncing}isTooLargeForTokenization(){return this._isTooLargeForTokenization}isDisposed(){return this._isDisposed}isDominatedByLongLines(){if(this._assertNotDisposed(),this.isTooLargeForTokenization())return!1;let e=0,i=0;const n=this._buffer.getLineCount();for(let o=1;o<=n;o++){const n=this._buffer.getLineLength(o);n>=t.LONG_LINE_BOUNDARY?i+=n:e+=n}return i>e}get uri(){return this._associatedResource}getOptions(){return this._assertNotDisposed(),this._options}getFormattingOptions(){return{tabSize:this._options.indentSize,insertSpaces:this._options.insertSpaces}}updateOptions(e){this._assertNotDisposed() +;let t=void 0!==e.tabSize?e.tabSize:this._options.tabSize,i=void 0!==e.indentSize?e.indentSize:this._options.indentSize,n=void 0!==e.insertSpaces?e.insertSpaces:this._options.insertSpaces,o=void 0!==e.trimAutoWhitespace?e.trimAutoWhitespace:this._options.trimAutoWhitespace,s=new h.TextModelResolvedOptions({tabSize:t,indentSize:i,insertSpaces:n,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:o});if(this._options.equals(s))return;let r=this._options.createChangeEvent(s);this._options=s,this._onDidChangeOptions.fire(r)}detectIndentation(e,t){this._assertNotDisposed();let i=g.guessIndentation(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}static _normalizeIndentationFromWhitespace(e,t,i){let n=0;for(let i=0;i({range:e.range,text:null})),()=>null)}mightContainNonBasicASCII(){return this._buffer.mightContainNonBasicASCII()}getAlternativeVersionId(){return this._assertNotDisposed(),this._alternativeVersionId}getOffsetAt(e){this._assertNotDisposed();let t=this._validatePosition(e.lineNumber,e.column,0);return this._buffer.getOffsetAt(t.lineNumber,t.column)} +getPositionAt(e){this._assertNotDisposed();let t=Math.min(this._buffer.getLength(),Math.max(0,e));return this._buffer.getPositionAt(t)}_increaseVersionId(){this._versionId=this._versionId+1,this._alternativeVersionId=this._versionId}_overwriteVersionId(e){this._versionId=e}_overwriteAlternativeVersionId(e){this._alternativeVersionId=e}_overwriteInitialUndoRedoSnapshot(e){this._initialUndoRedoSnapshot=e}getValue(e,t=!1){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueInRange(i,e);return t?this._buffer.getBOM()+n:n}createSnapshot(e=!1){return new I(this._buffer.createSnapshot(e))}getValueLength(e,t=!1){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueLengthInRange(i,e);return t?this._buffer.getBOM().length+n:n}getValueInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueInRange(this.validateRange(e),t)}getValueLengthInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueLengthInRange(this.validateRange(e),t)} +getCharacterCountInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getCharacterCountInRange(this.validateRange(e),t)}getLineCount(){return this._assertNotDisposed(),this._buffer.getLineCount()}getLineContent(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){return this._assertNotDisposed(),this._buffer.getLinesContent()}getEOL(){return this._assertNotDisposed(),this._buffer.getEOL()}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber") +;return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),i=e.startLineNumber,n=e.startColumn;let o,s;if(i<1)o=1,s=1;else if(i>t)o=t,s=this.getLineMaxColumn(o);else if(o=0|i,n<=1)s=1;else{const e=this.getLineMaxColumn(o);s=n>=e?e:0|n}const r=e.endLineNumber,a=e.endColumn;let l,h;if(r<1)l=1,h=1;else if(r>t)l=t,h=this.getLineMaxColumn(l);else if(l=0|r,a<=1)h=1;else{const e=this.getLineMaxColumn(l);h=a>=e?e:0|a}return i===o&&n===s&&r===l&&a===h&&e instanceof d.Range&&!(e instanceof c.Selection)?e:new d.Range(o,s,l,h)}_isValidPosition(e,t,i){if("number"!=typeof e||"number"!=typeof t)return!1;if(isNaN(e)||isNaN(t))return!1;if(e<1||t<1)return!1;if((0|e)!==e||(0|t)!==t)return!1;if(e>this._buffer.getLineCount())return!1;if(1===t)return!0 +;if(t>this.getLineMaxColumn(e))return!1;if(1===i){const i=this._buffer.getLineCharCode(e,t-2);if(s.isHighSurrogate(i))return!1}return!0}_validatePosition(e,t,i){const n=Math.floor("number"!=typeof e||isNaN(e)?1:e),o=Math.floor("number"!=typeof t||isNaN(t)?1:t),r=this._buffer.getLineCount();if(n<1)return new l.Position(1,1);if(n>r)return new l.Position(r,this.getLineMaxColumn(r));if(o<=1)return new l.Position(n,1);const a=this.getLineMaxColumn(n);if(o>=a)return new l.Position(n,a);if(1===i){const e=this._buffer.getLineCharCode(n,o-2);if(s.isHighSurrogate(e))return new l.Position(n,o-1)}return new l.Position(n,o)}validatePosition(e){return this._assertNotDisposed(),e instanceof l.Position&&this._isValidPosition(e.lineNumber,e.column,1)?e:this._validatePosition(e.lineNumber,e.column,1)}_isValidRange(e,t){const i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,r=e.endColumn;if(!this._isValidPosition(i,n,0))return!1;if(!this._isValidPosition(o,r,0))return!1;if(1===t){ +const e=n>1?this._buffer.getLineCharCode(i,n-2):0,t=r>1&&r<=this._buffer.getLineLength(o)?this._buffer.getLineCharCode(o,r-2):0,a=s.isHighSurrogate(e),l=s.isHighSurrogate(t);return!a&&!l}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof d.Range&&!(e instanceof c.Selection)&&this._isValidRange(e,1))return e;const t=this._validatePosition(e.startLineNumber,e.startColumn,0),i=this._validatePosition(e.endLineNumber,e.endColumn,0),n=t.lineNumber,o=t.column,r=i.lineNumber,a=i.column;{const e=o>1?this._buffer.getLineCharCode(n,o-2):0,t=a>1&&a<=this._buffer.getLineLength(r)?this._buffer.getLineCharCode(r,a-2):0,i=s.isHighSurrogate(e),l=s.isHighSurrogate(t);return i||l?n===r&&o===a?new d.Range(n,o-1,r,a-1):i&&l?new d.Range(n,o-1,r,a+1):i?new d.Range(n,o-1,r,a):new d.Range(n,o,r,a+1):new d.Range(n,o,r,a)}}modifyPosition(e,t){this._assertNotDisposed();let i=this.getOffsetAt(e)+t;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,i)))}getFullModelRange(){this._assertNotDisposed() +;const e=this.getLineCount();return new d.Range(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,i,n){return this._buffer.findMatchesLineByLine(e,t,i,n)}findMatches(e,t,i,n,o,s,r=N){this._assertNotDisposed();let a=null;null!==t&&(Array.isArray(t)||(t=[t]),t.every(e=>d.Range.isIRange(e))&&(a=t.map(e=>this.validateRange(e)))),null===a&&(a=[this.getFullModelRange()]),a=a.sort((e,t)=>e.startLineNumber-t.startLineNumber||e.startColumn-t.startColumn);const l=[];let c;if(l.push(a.reduce((e,t)=>d.Range.areIntersecting(e,t)?e.plusRange(t):(l.push(e),t))),!i&&e.indexOf("\n")<0){const t=new _.SearchParams(e,i,n,o).parseSearchRequest();if(!t)return[];c=e=>this.findMatchesLineByLine(e,t,s,r)}else c=t=>_.TextModelSearch.findMatches(this,new _.SearchParams(e,i,n,o),t,s,r);return l.map(c).reduce((e,t)=>e.concat(t),[])}findNextMatch(e,t,i,n,o,s){this._assertNotDisposed();const r=this.validatePosition(t);if(!i&&e.indexOf("\n")<0){const t=new _.SearchParams(e,i,n,o).parseSearchRequest();if(!t)return null +;const a=this.getLineCount();let l=new d.Range(r.lineNumber,r.column,a,this.getLineMaxColumn(a)),c=this.findMatchesLineByLine(l,t,s,1);return _.TextModelSearch.findNextMatch(this,new _.SearchParams(e,i,n,o),r,s),c.length>0?c[0]:(l=new d.Range(1,1,r.lineNumber,this.getLineMaxColumn(r.lineNumber)),(c=this.findMatchesLineByLine(l,t,s,1)).length>0?c[0]:null)}return _.TextModelSearch.findNextMatch(this,new _.SearchParams(e,i,n,o),r,s)}findPreviousMatch(e,t,i,n,o,s){this._assertNotDisposed();const r=this.validatePosition(t);return _.TextModelSearch.findPreviousMatch(this,new _.SearchParams(e,i,n,o),r,s)}pushStackElement(){this._commandManager.pushStackElement()}pushEOL(e){if(("\n"===this.getEOL()?0:1)!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),null===this._initialUndoRedoSnapshot&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(), +this._onDidChangeDecorations.endDeferredEmit()}}_validateEditOperation(e){return e instanceof h.ValidAnnotatedEditOperation?e:new h.ValidAnnotatedEditOperation(e.identifier||null,this.validateRange(e.range),e.text,e.forceMoveMarkers||!1,e.isAutoWhitespaceEdit||!1,e._isTracked||!1)}_validateEditOperations(e){const t=[];for(let i=0,n=e.length;i({range:this.validateRange(e.range),text:e.text})),n=!0;if(e)for(let t=0,o=e.length;to.endLineNumber,r=o.startLineNumber>t.endLineNumber +;if(!n&&!r){s=!0;break}}if(!s){n=!1;break}}if(n)for(let e=0,n=this._trimAutoWhitespaceLines.length;et.endLineNumber)&&!(n===t.startLineNumber&&t.startColumn===o&&t.isEmpty()&&r&&r.length>0&&"\n"===r.charAt(0)||n===t.startLineNumber&&1===t.startColumn&&t.isEmpty()&&r&&r.length>0&&"\n"===r.charAt(r.length-1))){s=!1;break}}if(s){const e=new d.Range(n,1,n,o);t.push(new h.ValidAnnotatedEditOperation(null,e,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return null===this._initialUndoRedoSnapshot&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,i)}_applyUndo(e,t,i,n){const o=e.map(e=>{const t=this.getPositionAt(e.newPosition),i=this.getPositionAt(e.newEnd);return{range:new d.Range(t.lineNumber,t.column,i.lineNumber,i.column),text:e.oldText}}) +;this._applyUndoRedoEdits(o,t,!0,!1,i,n)}_applyRedo(e,t,i,n){const o=e.map(e=>{const t=this.getPositionAt(e.oldPosition),i=this.getPositionAt(e.oldEnd);return{range:new d.Range(t.lineNumber,t.column,i.lineNumber,i.column),text:e.newText}});this._applyUndoRedoEdits(o,t,!1,!0,i,n)}_applyUndoRedoEdits(e,t,i,n,o,s){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=n,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(o)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(s),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,t=!1){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit();const i=this._validateEditOperations(e);return this._doApplyEdits(i,t)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,t){ +const i=this._buffer.getLineCount(),n=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),o=this._buffer.getLineCount(),s=n.changes;if(this._trimAutoWhitespaceLines=n.trimAutoWhitespaceLineNumbers,0!==s.length){let e=[],t=i;for(let i=0,n=s.length;i0?n.text.charCodeAt(0):0),this._onDidChangeDecorations.fire(),this._decorationsTree.acceptReplace(n.rangeOffset,n.rangeLength,n.text.length,n.forceMoveMarkers);const d=n.range.startLineNumber,c=n.range.endLineNumber,h=c-d,u=r,g=Math.min(h,u),p=u-h;for(let i=g;i>=0;i--){const n=d+i,s=o-t-p+n;e.push(new f.ModelRawLineChanged(n,this.getLineContent(s)))}if(gthis._deltaDecorationsImpl(e,[],[{range:t,options:i}])[0],changeDecoration:(e,t)=>{this._changeDecorationImpl(e,t)},changeDecorationOptions:(e,t)=>{this._changeDecorationOptionsImpl(e,H(t))},removeDecoration:t=>{this._deltaDecorationsImpl(e,[t],[])}, +deltaDecorations:(t,i)=>0===t.length&&0===i.length?[]:this._deltaDecorationsImpl(e,t,i)},o=null;try{o=t(n)}catch(e){i.onUnexpectedError(e)}return n.addDecoration=M,n.changeDecoration=M,n.changeDecorationOptions=M,n.removeDecoration=M,n.deltaDecorations=M,o}deltaDecorations(e,t,i=0){if(this._assertNotDisposed(),e||(e=[]),0===e.length&&0===t.length)return[];try{return this._onDidChangeDecorations.beginDeferredEmit(),this._deltaDecorationsImpl(i,e,t)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_getTrackedRange(e){return this.getDecorationRange(e)}_setTrackedRange(e,t,i){const n=e?this._decorations[e]:null;if(!n)return t?this._deltaDecorationsImpl(0,[],[{range:t,options:z[i]}])[0]:null;if(!t)return this._decorationsTree.delete(n),delete this._decorations[n.id],null;const o=this._validateRangeRelaxedNoAllocations(t),s=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),r=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);return this._decorationsTree.delete(n), +n.reset(this.getVersionId(),s,r,o),n.setOptions(z[i]),this._decorationsTree.insert(n),n.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;const t=this._decorationsTree.collectNodesFromOwner(e);for(let e=0,i=t.length;ethis.getLineCount()?[]:this.getLinesDecorations(e,e,t,i)}getLinesDecorations(e,t,i=0,n=!1){let o=this.getLineCount(),s=Math.min(o,Math.max(1,e)),r=Math.min(o,Math.max(1,t)),a=this.getLineMaxColumn(r);return this._getDecorationsInRange(new d.Range(s,1,r,a),i,n)}getDecorationsInRange(e,t=0,i=!1){let n=this.validateRange(e) +;return this._getDecorationsInRange(n,t,i)}getOverviewRulerDecorations(e=0,t=!1){const i=this.getVersionId(),n=this._decorationsTree.search(e,t,!0,i);return this._ensureNodesHaveRanges(n)}getAllDecorations(e=0,t=!1){const i=this.getVersionId(),n=this._decorationsTree.search(e,t,!1,i);return this._ensureNodesHaveRanges(n)}_getDecorationsInRange(e,t,i){const n=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),o=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn),s=this.getVersionId(),r=this._decorationsTree.intervalSearch(n,o,t,i,s);return this._ensureNodesHaveRanges(r)}_ensureNodesHaveRanges(e){for(let t=0,i=e.length;t0&&this._emitModelTokensChangedEvent({tokenizationSupportChanged:!1,semanticTokensApplied:!1,ranges:t})}setSemanticTokens(e,t){this._tokens2.set(e,t),this._emitModelTokensChangedEvent({tokenizationSupportChanged:!1,semanticTokensApplied:null!==e,ranges:[{fromLineNumber:1,toLineNumber:this.getLineCount()}]})}hasSemanticTokens(){return this._tokens2.isComplete()}setPartialSemanticTokens(e,t){if(this.hasSemanticTokens())return;const i=this._tokens2.setPartial(e,t);this._emitModelTokensChangedEvent({tokenizationSupportChanged:!1,semanticTokensApplied:!0,ranges:[{fromLineNumber:i.startLineNumber,toLineNumber:i.endLineNumber}]})}tokenizeViewport(e,t){e=Math.max(1,e),t=Math.min(this._buffer.getLineCount(),t),this._tokenization.tokenizeViewport(e,t)}clearTokens(){this._tokens.flush(),this._emitModelTokensChangedEvent({tokenizationSupportChanged:!0,semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._buffer.getLineCount()}]})}_emitModelTokensChangedEvent(e){ +this._isDisposing||this._onDidChangeTokens.fire(e)}resetTokenization(){this._tokenization.reset()}forceTokenization(e){if(e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");this._tokenization.forceTokenization(e)}isCheapToTokenize(e){return this._tokenization.isCheapToTokenize(e)}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}getLineTokens(e){if(e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._getLineTokens(e)}_getLineTokens(e){const t=this.getLineContent(e),i=this._tokens.getTokens(this._languageIdentifier.id,e-1,t);return this._tokens2.addSemanticTokens(e,i)}getLanguageIdentifier(){return this._languageIdentifier}getModeId(){return this._languageIdentifier.language}setMode(e){if(this._languageIdentifier.id===e.id)return;let t={oldLanguage:this._languageIdentifier.language,newLanguage:e.language};this._languageIdentifier=e,this._onDidChangeLanguage.fire(t),this._onDidChangeLanguageConfiguration.fire({})} +getLanguageIdAtPosition(e,t){const i=this.validatePosition(new l.Position(e,t)),n=this.getLineTokens(i.lineNumber);return n.getLanguageId(n.findTokenIndexAtOffset(i.column-1))}getWordAtPosition(e){this._assertNotDisposed();const t=this.validatePosition(e),i=this.getLineContent(t.lineNumber),n=this._getLineTokens(t.lineNumber),o=n.findTokenIndexAtOffset(t.column-1),[s,r]=O._findLanguageBoundaries(n,o),a=C.getWordAtText(t.column,b.LanguageConfigurationRegistry.getWordDefinition(n.getLanguageId(o)),i.substring(s,r),s);if(a&&a.startColumn<=e.column&&e.column<=a.endColumn)return a;if(o>0&&s===t.column-1){const[s,r]=O._findLanguageBoundaries(n,o-1),a=C.getWordAtText(t.column,b.LanguageConfigurationRegistry.getWordDefinition(n.getLanguageId(o-1)),i.substring(s,r),s);if(a&&a.startColumn<=e.column&&e.column<=a.endColumn)return a}return null}static _findLanguageBoundaries(e,t){const i=e.getLanguageId(t);let n=0;for(let o=t;o>=0&&e.getLanguageId(o)===i;o--)n=e.getStartOffset(o);let o=e.getLineContent().length +;for(let n=t,s=e.getCount();n=0;e--){const t=i.getEndOffset(e);if(t<=n)break;w.ignoreBracketsInToken(i.getStandardTokenType(e))&&(n=t)}const a=Math.min(o.length,e.column-1+r.maxBracketLength);let l=null;for(;;){const i=y.BracketsUtils.findNextBracketInRange(r.forwardRegex,t,o,n,a);if(!i)break;if(i.startColumn<=e.column&&e.column<=i.endColumn){const e=o.substring(i.startColumn-1,i.endColumn-1).toLowerCase(),t=this._matchFoundBracket(i,r.textIsBracket[e],r.textIsOpenBracket[e],null);if(t){if(t instanceof R)return null;l=t}}n=i.endColumn-1}if(l)return l}if(s>0&&i.getStartOffset(s)===e.column-1){const r=s-1,a=b.LanguageConfigurationRegistry.getBracketsSupport(i.getLanguageId(r));if(a&&!w.ignoreBracketsInToken(i.getStandardTokenType(r))){const s=Math.max(0,e.column-1-a.maxBracketLength);let l=Math.min(o.length,e.column-1+a.maxBracketLength);for(let e=r+1;e=l)break;w.ignoreBracketsInToken(i.getStandardTokenType(e))&&(l=t)} +const d=y.BracketsUtils.findPrevBracketInRange(a.reversedRegex,t,o,s,l);if(d&&d.startColumn<=e.column&&e.column<=d.endColumn){const e=o.substring(d.startColumn-1,d.endColumn-1).toLowerCase(),t=this._matchFoundBracket(d,a.textIsBracket[e],a.textIsOpenBracket[e],null);if(t)return t instanceof R?null:t}}}return null}_matchFoundBracket(e,t,i,n){if(!t)return null;const o=i?this._findMatchingBracketDown(t,e.getEndPosition(),n):this._findMatchingBracketUp(t,e.getStartPosition(),n);return o?o instanceof R?o:[e,o]:null}_findMatchingBracketUp(e,t,i){const n=e.languageIdentifier.id,o=e.reversedRegex;let s=-1,r=0;const a=(t,n,a,l)=>{for(;;){if(i&&++r%100==0&&!i())return R.INSTANCE;const d=y.BracketsUtils.findPrevBracketInRange(o,t,n,a,l);if(!d)break;const c=n.substring(d.startColumn-1,d.endColumn-1).toLowerCase();if(e.isOpen(c)?s++:e.isClose(c)&&s--,0===s)return d;l=d.startColumn-1}return null};for(let e=t.lineNumber;e>=1;e--){const i=this._getLineTokens(e),o=i.getCount(),s=this._buffer.getLineContent(e) +;let r=o-1,l=s.length,d=s.length;e===t.lineNumber&&(r=i.findTokenIndexAtOffset(t.column-1),l=t.column-1,d=t.column-1);let c=!0;for(;r>=0;r--){const t=i.getLanguageId(r)===n&&!w.ignoreBracketsInToken(i.getStandardTokenType(r));if(t)c?l=i.getStartOffset(r):(l=i.getStartOffset(r),d=i.getEndOffset(r));else if(c&&l!==d){const t=a(e,s,l,d);if(t)return t}c=t}if(c&&l!==d){const t=a(e,s,l,d);if(t)return t}}return null}_findMatchingBracketDown(e,t,i){const n=e.languageIdentifier.id,o=e.forwardRegex;let s=1,r=0;const a=(t,n,a,l)=>{for(;;){if(i&&++r%100==0&&!i())return R.INSTANCE;const d=y.BracketsUtils.findNextBracketInRange(o,t,n,a,l);if(!d)break;const c=n.substring(d.startColumn-1,d.endColumn-1).toLowerCase();if(e.isOpen(c)?s++:e.isClose(c)&&s--,0===s)return d;a=d.endColumn-1}return null},l=this.getLineCount();for(let e=t.lineNumber;e<=l;e++){const i=this._getLineTokens(e),o=i.getCount(),s=this._buffer.getLineContent(e);let r=0,l=0,d=0;e===t.lineNumber&&(r=i.findTokenIndexAtOffset(t.column-1),l=t.column-1, +d=t.column-1);let c=!0;for(;r=1;e--){const o=this._getLineTokens(e),s=o.getCount(),r=this._buffer.getLineContent(e);let a=s-1,l=r.length,d=r.length;if(e===t.lineNumber){a=o.findTokenIndexAtOffset(t.column-1),l=t.column-1,d=t.column-1;const e=o.getLanguageId(a);i!==e&&(i=e,n=b.LanguageConfigurationRegistry.getBracketsSupport(i))}let c=!0;for(;a>=0;a--){const t=o.getLanguageId(a);if(i!==t){if(n&&c&&l!==d){const t=y.BracketsUtils.findPrevBracketInRange(n.reversedRegex,e,r,l,d);if(t)return this._toFoundBracket(n,t);c=!1}i=t,n=b.LanguageConfigurationRegistry.getBracketsSupport(i)}const s=!!n&&!w.ignoreBracketsInToken(o.getStandardTokenType(a)) +;if(s)c?l=o.getStartOffset(a):(l=o.getStartOffset(a),d=o.getEndOffset(a));else if(n&&c&&l!==d){const t=y.BracketsUtils.findPrevBracketInRange(n.reversedRegex,e,r,l,d);if(t)return this._toFoundBracket(n,t)}c=s}if(n&&c&&l!==d){const t=y.BracketsUtils.findPrevBracketInRange(n.reversedRegex,e,r,l,d);if(t)return this._toFoundBracket(n,t)}}return null}findNextBracket(e){const t=this.validatePosition(e),i=this.getLineCount();let n=-1,o=null;for(let e=t.lineNumber;e<=i;e++){const i=this._getLineTokens(e),s=i.getCount(),r=this._buffer.getLineContent(e);let a=0,l=0,d=0;if(e===t.lineNumber){a=i.findTokenIndexAtOffset(t.column-1),l=t.column-1,d=t.column-1;const e=i.getLanguageId(a);n!==e&&(n=e,o=b.LanguageConfigurationRegistry.getBracketsSupport(n))}let c=!0;for(;aDate.now()-e<=t}const n=this.validatePosition(e),o=this.getLineCount(),s=new Map;let r=[];const a=(e,t)=>{if(!s.has(e)){let i=[];for(let e=0,n=t?t.brackets.length:0;e{for(;;){if(i&&++l%100==0&&!i())return R.INSTANCE;const a=y.BracketsUtils.findNextBracketInRange(e.forwardRegex,t,n,o,s);if(!a)break;const d=n.substring(a.startColumn-1,a.endColumn-1).toLowerCase(),c=e.textIsBracket[d];if(c&&(c.isOpen(d)?r[c.index]++:c.isClose(d)&&r[c.index]--, +-1===r[c.index]))return this._matchFoundBracket(a,c,!1,i);o=a.endColumn-1}return null};let c=-1,h=null;for(let e=n.lineNumber;e<=o;e++){const t=this._getLineTokens(e),i=t.getCount(),o=this._buffer.getLineContent(e);let s=0,r=0,l=0;if(e===n.lineNumber){s=t.findTokenIndexAtOffset(n.column-1),r=n.column-1,l=n.column-1;const e=t.getLanguageId(s);c!==e&&a(c=e,h=b.LanguageConfigurationRegistry.getBracketsSupport(c))}let u=!0;for(;sn)throw new Error("Illegal value for lineNumber");const o=b.LanguageConfigurationRegistry.getFoldingRules(this._languageIdentifier.id),s=Boolean(o&&o.offSide);let r=-2,a=-1,l=-2,d=-1;const c=e=>{if(-1!==r&&(-2===r||r>e-1)){r=-1,a=-1;for(let t=e-2;t>=0;t--){let e=this._computeIndentLevel(t);if(e>=0){r=t,a=e;break}}}if(-2===l){l=-1,d=-1;for(let t=e;t=0){l=t,d=e;break}}}};let h=-2,u=-1,g=-2,p=-1;const m=e=>{if(-2===h){h=-1,u=-1;for(let t=e-2;t>=0;t--){let e=this._computeIndentLevel(t);if(e>=0){h=t,u=e;break}}}if(-1!==g&&(-2===g||g=0){g=t,p=e;break}}}};let f=0,_=!0,v=0,C=!0,S=0,w=0;for(let o=0;_||C;o++){const r=e-o,g=e+o;o>1&&(r<1||r1&&(g>n||g>i)&&(C=!1),o>5e4&&(_=!1,C=!1);let b=-1;if(_){const e=this._computeIndentLevel(r-1);e>=0?(l=r-1,d=e,b=Math.ceil(e/this._options.indentSize)):(c(r),b=this._getIndentLevelForWhitespaceLine(s,a,d))}let y=-1;if(C){const e=this._computeIndentLevel(g-1);e>=0?(h=g-1,u=e,y=Math.ceil(e/this._options.indentSize)):(m(g),y=this._getIndentLevelForWhitespaceLine(s,u,p))}if(0!==o){if(1===o){if(g<=n&&y>=0&&w+1===y){_=!1,f=g,v=g,S=y;continue}if(r>=1&&b>=0&&b-1===w){C=!1,f=r,v=r,S=b;continue}if(f=e,v=e,0===(S=w))return{startLineNumber:f,endLineNumber:v,indent:S}}_&&(b>=S?f=r:_=!1),C&&(y>=S?v=g:C=!1)}else w=b}return{startLineNumber:f,endLineNumber:v,indent:S}}getLinesIndentGuides(e,t){this._assertNotDisposed();const i=this.getLineCount();if(e<1||e>i)throw new Error("Illegal value for startLineNumber");if(t<1||t>i)throw new Error("Illegal value for endLineNumber") +;const n=b.LanguageConfigurationRegistry.getFoldingRules(this._languageIdentifier.id),o=Boolean(n&&n.offSide);let s=new Array(t-e+1),r=-2,a=-1,l=-2,d=-1;for(let n=e;n<=t;n++){let t=n-e;const c=this._computeIndentLevel(n-1);if(c>=0)r=n-1,a=c,s[t]=Math.ceil(c/this._options.indentSize);else{if(-2===r){r=-1,a=-1;for(let e=n-2;e>=0;e--){let t=this._computeIndentLevel(e);if(t>=0){r=e,a=t;break}}}if(-1!==l&&(-2===l||l=0){l=e,d=t;break}}}s[t]=this._getIndentLevelForWhitespaceLine(o,a,d)}}return s}_getIndentLevelForWhitespaceLine(e,t,i){return-1===t||-1===i?0:t0?this._deferredEvent?this._deferredEvent=this._deferredEvent.merge(e):this._deferredEvent=e:(this._fastEmitter.fire(e),this._slowEmitter.fire(e))}}t.DidChangeContentEmitter=U})),define(t[45],i([0,1,12,8,13,3,20,31,42]),(function(e,t,i,n,o,s,r,a,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isQuote=t.CursorColumns=t.EditOperationResult=t.CursorState=t.PartialViewCursorState=t.PartialModelCursorState=t.CursorContext=t.SingleCursorState=t.CursorConfiguration=void 0;const d=()=>!0,c=()=>!1,h=e=>" "===e||"\t"===e;function u(e,t,i){ +e.has(t)?e.get(t).push(i):e.set(t,[i])}class g{constructor(e,t,i){this._languageIdentifier=e;const n=i.options,o=n.get(117);this.readOnly=n.get(72),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.lineHeight=n.get(51),this.pageSize=Math.max(1,Math.floor(o.height/this.lineHeight)-2),this.useTabStops=n.get(104),this.wordSeparators=n.get(105),this.emptySelectionClipboard=n.get(26),this.copyWithSyntaxHighlighting=n.get(16),this.multiCursorMergeOverlapping=n.get(60),this.multiCursorPaste=n.get(62),this.autoClosingBrackets=n.get(5),this.autoClosingQuotes=n.get(7),this.autoClosingOvertype=n.get(6),this.autoSurround=n.get(10),this.autoIndent=n.get(8),this.autoClosingPairsOpen2=new Map,this.autoClosingPairsClose2=new Map,this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:g._getShouldAutoClose(e,this.autoClosingQuotes),bracket:g._getShouldAutoClose(e,this.autoClosingBrackets)};let s=g._getAutoClosingPairs(e) +;if(s)for(const e of s)u(this.autoClosingPairsOpen2,e.open.charAt(e.open.length-1),e),1===e.close.length&&u(this.autoClosingPairsClose2,e.close,e);let r=g._getSurroundingPairs(e);if(r)for(const e of r)this.surroundingPairs[e.open]=e.close}static shouldRecreate(e){return e.hasChanged(117)||e.hasChanged(105)||e.hasChanged(26)||e.hasChanged(60)||e.hasChanged(62)||e.hasChanged(5)||e.hasChanged(7)||e.hasChanged(6)||e.hasChanged(10)||e.hasChanged(104)||e.hasChanged(51)||e.hasChanged(72)}get electricChars(){if(!this._electricChars){this._electricChars={};let e=g._getElectricCharacters(this._languageIdentifier);if(e)for(const t of e)this._electricChars[t]=!0}return this._electricChars}normalizeIndentation(e){return a.TextModel.normalizeIndentation(e,this.indentSize,this.insertSpaces)}static _getElectricCharacters(e){try{return l.LanguageConfigurationRegistry.getElectricCharacters(e.id)}catch(e){return i.onUnexpectedError(e),null}}static _getAutoClosingPairs(e){try{ +return l.LanguageConfigurationRegistry.getAutoClosingPairs(e.id)}catch(e){return i.onUnexpectedError(e),null}}static _getShouldAutoClose(e,t){switch(t){case"beforeWhitespace":return h;case"languageDefined":return g._getLanguageDefinedShouldAutoClose(e);case"always":return d;case"never":return c}}static _getLanguageDefinedShouldAutoClose(e){try{const t=l.LanguageConfigurationRegistry.getAutoCloseBeforeSet(e.id);return e=>-1!==t.indexOf(e)}catch(e){return i.onUnexpectedError(e),c}}static _getSurroundingPairs(e){try{return l.LanguageConfigurationRegistry.getSurroundingPairs(e.id)}catch(e){return i.onUnexpectedError(e),null}}}t.CursorConfiguration=g;class p{constructor(e,t,i,n){this.selectionStart=e,this.selectionStartLeftoverVisibleColumns=t,this.position=i,this.leftoverVisibleColumns=n,this.selection=p._computeSelection(this.selectionStart,this.position)}equals(e){ +return this.selectionStartLeftoverVisibleColumns===e.selectionStartLeftoverVisibleColumns&&this.leftoverVisibleColumns===e.leftoverVisibleColumns&&this.position.equals(e.position)&&this.selectionStart.equalsRange(e.selectionStart)}hasSelection(){return!this.selection.isEmpty()||!this.selectionStart.isEmpty()}move(e,t,i,n){return e?new p(this.selectionStart,this.selectionStartLeftoverVisibleColumns,new o.Position(t,i),n):new p(new s.Range(t,i,t,i),n,new o.Position(t,i),n)}static _computeSelection(e,t){let i,n,o,s;return e.isEmpty()?(i=e.startLineNumber,n=e.startColumn,o=t.lineNumber,s=t.column):t.isBeforeOrEqual(e.getStartPosition())?(i=e.endLineNumber,n=e.endColumn,o=t.lineNumber,s=t.column):(i=e.startLineNumber,n=e.startColumn,o=t.lineNumber,s=t.column),new r.Selection(i,n,o,s)}}t.SingleCursorState=p;t.CursorContext=class{constructor(e,t,i){this.model=e,this.coordinatesConverter=t,this.cursorConfig=i}};class m{constructor(e){this.modelState=e,this.viewState=null}}t.PartialModelCursorState=m;class f{ +constructor(e){this.modelState=null,this.viewState=e}}t.PartialViewCursorState=f;class _{constructor(e,t){this.modelState=e,this.viewState=t}static fromModelState(e){return new m(e)}static fromViewState(e){return new f(e)}static fromModelSelection(e){const t=e.selectionStartLineNumber,i=e.selectionStartColumn,n=e.positionLineNumber,r=e.positionColumn,a=new p(new s.Range(t,i,t,i),0,new o.Position(n,r),0);return _.fromModelState(a)}static fromModelSelections(e){let t=[];for(let i=0,n=e.length;i=65536?2:1, +9===t)r=v.nextRenderTabStop(r,i);else{let i=n.getGraphemeBreakType(t);for(;a=65536?2:1,i=o}n.isFullWidthCharacter(t)||n.isEmojiImprecise(t)?r+=2:r+=1}}return r}static visibleColumnFromColumn2(e,t,i){return this.visibleColumnFromColumn(t.getLineContent(i.lineNumber),i.column,e.tabSize)}static columnFromVisibleColumn(e,t,i){if(t<=0)return 1;const o=e.length;let s=0,r=1,a=0;for(;a=65536?2:1,9===l)d=v.nextRenderTabStop(s,i);else{let t=n.getGraphemeBreakType(l);for(;a=65536?2:1,t=s}d=n.isFullWidthCharacter(l)||n.isEmojiImprecise(l)?s+2:s+1}const c=a+1;if(d>=t){return d-tr?r:o}static nextRenderTabStop(e,t){return e+t-e%t}static nextIndentTabStop(e,t){return e+t-e%t}static prevRenderTabStop(e,t){return e-1-(e-1)%t}static prevIndentTabStop(e,t){return e-1-(e-1)%t}}t.CursorColumns=v,t.isQuote=function(e){return"'"===e||'"'===e||"`"===e}})),define(t[169],i([0,1,8,45,3,20,42]),(function(e,t,i,n,o,s,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ShiftCommand=t.cachedStringRepeat=void 0;const a=Object.create(null);function l(e,t){a[e]||(a[e]=["",e]);const i=a[e];for(let n=i.length;n<=t;n++)i[n]=i[n-1]+e;return i[t]}t.cachedStringRepeat=l;class d{constructor(e,t){this._opts=t,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}static unshiftIndent(e,t,i,o,s){const r=n.CursorColumns.visibleColumnFromColumn(e,t,i);if(s){const e=l(" ",o);return l(e,n.CursorColumns.prevIndentTabStop(r,o)/o)} +return l("\t",n.CursorColumns.prevRenderTabStop(r,i)/i)}static shiftIndent(e,t,i,o,s){const r=n.CursorColumns.visibleColumnFromColumn(e,t,i);if(s){const e=l(" ",o);return l(e,n.CursorColumns.nextIndentTabStop(r,o)/o)}return l("\t",n.CursorColumns.nextRenderTabStop(r,i)/i)}_addEditOperation(e,t,i){this._useLastEditRangeForCursorEndPosition?e.addTrackedEditOperation(t,i):e.addEditOperation(t,i)}getEditOperations(e,t){const s=this._selection.startLineNumber;let a=this._selection.endLineNumber;1===this._selection.endColumn&&s!==a&&(a-=1);const{tabSize:c,indentSize:h,insertSpaces:u}=this._opts,g=s===a;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(e.getLineContent(s))&&(this._useLastEditRangeForCursorEndPosition=!0);let l=0,p=0;for(let m=s;m<=a;m++,l=p){p=0;let a,f=e.getLineContent(m),_=i.firstNonWhitespaceIndex(f);if((!this._opts.isUnshift||0!==f.length&&0!==_)&&(g||this._opts.isUnshift||0!==f.length)){if(-1===_&&(_=f.length),m>1){ +if(n.CursorColumns.visibleColumnFromColumn(f,_+1,c)%h!=0&&e.isCheapToTokenize(m-1)){let t=r.LanguageConfigurationRegistry.getEnterAction(this._opts.autoIndent,e,new o.Range(m-1,e.getLineMaxColumn(m-1),m-1,e.getLineMaxColumn(m-1)));if(t){if(p=l,t.appendText)for(let e=0,i=t.appendText.length;ea,h=r>l,u=rl)continue;if(_r)continue;if(f1&&n--, +s.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,n)}static columnSelectRight(e,t,o){let s=0;const r=Math.min(o.fromViewLineNumber,o.toViewLineNumber),a=Math.max(o.fromViewLineNumber,o.toViewLineNumber);for(let o=r;o<=a;o++){const r=t.getLineMaxColumn(o),a=i.CursorColumns.visibleColumnFromColumn2(e,t,new n.Position(o,r));s=Math.max(s,a)}let l=o.toViewVisualColumn;return le.getLineMinColumn(t)?i-=s.prevCharLength(e.getLineContent(t),i-1):t>1&&(t-=1,i=e.getLineMaxColumn(t)),new n.Position(t,i)}static left(e,t,i,n){const o=a.leftPosition(t,i,n);return new r(o.lineNumber,o.column,0)}static moveLeft(e,t,i,n,o){let s,r;if(i.hasSelection()&&!n)s=i.selection.startLineNumber,r=i.selection.startColumn;else{let n=a.left(e,t,i.position.lineNumber,i.position.column-(o-1));s=n.lineNumber,r=n.column}return i.move(n,s,r,0)}static rightPosition(e,t,i){return ic?(n=c,o=l?t.getLineMaxColumn(n):Math.min(t.getLineMaxColumn(n),o)):o=i.CursorColumns.columnFromVisibleColumn2(e,t,n,d),s=h?0:d-i.CursorColumns.visibleColumnFromColumn(t.getLineContent(n),o,e.tabSize),new r(n,o,s)}static moveDown(e,t,i,n,o){let s,r;i.hasSelection()&&!n?(s=i.selection.endLineNumber,r=i.selection.endColumn):(s=i.position.lineNumber,r=i.position.column);let l=a.down(e,t,s,r,i.leftoverVisibleColumns,o,!0);return i.move(n,l.lineNumber,l.column,l.leftoverVisibleColumns)}static translateDown(e,t,s){ +let r=s.selection,l=a.down(e,t,r.selectionStartLineNumber,r.selectionStartColumn,s.selectionStartLeftoverVisibleColumns,1,!1),d=a.down(e,t,r.positionLineNumber,r.positionColumn,s.leftoverVisibleColumns,1,!1);return new i.SingleCursorState(new o.Range(l.lineNumber,l.column,l.lineNumber,l.column),l.leftoverVisibleColumns,new n.Position(d.lineNumber,d.column),d.leftoverVisibleColumns)}static up(e,t,n,o,s,a,l){const d=i.CursorColumns.visibleColumnFromColumn(t.getLineContent(n),o,e.tabSize)+s,c=1===n&&1===o;return(n-=a)<1?(n=1,o=l?t.getLineMinColumn(n):Math.min(t.getLineMaxColumn(n),o)):o=i.CursorColumns.columnFromVisibleColumn2(e,t,n,d),s=c?0:d-i.CursorColumns.visibleColumnFromColumn(t.getLineContent(n),o,e.tabSize),new r(n,o,s)}static moveUp(e,t,i,n,o){let s,r;i.hasSelection()&&!n?(s=i.selection.startLineNumber,r=i.selection.startColumn):(s=i.position.lineNumber,r=i.position.column);let l=a.up(e,t,s,r,i.leftoverVisibleColumns,o,!0);return i.move(n,l.lineNumber,l.column,l.leftoverVisibleColumns)} +static translateUp(e,t,s){let r=s.selection,l=a.up(e,t,r.selectionStartLineNumber,r.selectionStartColumn,s.selectionStartLeftoverVisibleColumns,1,!1),d=a.up(e,t,r.positionLineNumber,r.positionColumn,s.leftoverVisibleColumns,1,!1);return new i.SingleCursorState(new o.Range(l.lineNumber,l.column,l.lineNumber,l.column),l.leftoverVisibleColumns,new n.Position(d.lineNumber,d.column),d.leftoverVisibleColumns)}static moveToBeginningOfLine(e,t,i,n){let o,s=i.position.lineNumber,r=t.getLineMinColumn(s),a=t.getLineFirstNonWhitespaceColumn(s)||r;return o=i.position.column===a?r:a,i.move(n,s,o,0)}static moveToEndOfLine(e,t,i,n,o){let s=i.position.lineNumber,r=t.getLineMaxColumn(s);return i.move(n,s,r,o?1073741824-r:0)}static moveToBeginningOfBuffer(e,t,i,n){return i.move(n,1,1,0)}static moveToEndOfBuffer(e,t,i,n){let o=t.getLineCount(),s=t.getLineMaxColumn(o);return i.move(n,o,s,0)}}t.MoveOperations=a})),define(t[232],i([0,1,8,88,45,170,3]),(function(e,t,i,n,o,s,r){"use strict";Object.defineProperty(t,"__esModule",{ +value:!0}),t.DeleteOperations=void 0;t.DeleteOperations=class{static deleteRight(e,t,i,o){let a=[],l=3!==e;for(let e=0,d=o.length;e1){let n=a.getLineContent(e.lineNumber),s=i.firstNonWhitespaceIndex(n),l=-1===s?n.length+1:s+1;if(e.column<=l){let i=o.CursorColumns.visibleColumnFromColumn2(t,a,e),n=o.CursorColumns.prevIndentTabStop(i,t.indentSize),s=o.CursorColumns.columnFromVisibleColumn2(t,a,e.lineNumber,n);u=new r.Range(e.lineNumber,s,e.lineNumber,e.column)}else u=new r.Range(e.lineNumber,e.column-1,e.lineNumber,e.column)}else{let i=s.MoveOperations.left(t,a,e.lineNumber,e.column);u=new r.Range(i.lineNumber,i.column,e.lineNumber,e.column)}}u.isEmpty()?d[e]=null:(u.startLineNumber!==u.endLineNumber&&(c=!0),d[e]=new n.ReplaceCommand(u,""))}return[c,d]} +static cut(e,t,i){let s=[];for(let o=0,a=i.length;o1?(e=c.lineNumber-1,i=t.getLineMaxColumn(c.lineNumber-1),l=c.lineNumber,d=t.getLineMaxColumn(c.lineNumber)):(e=c.lineNumber,i=1,l=c.lineNumber,d=t.getLineMaxColumn(c.lineNumber));let h=new r.Range(e,i,l,d);h.isEmpty()?s[o]=null:s[o]=new n.ReplaceCommand(h,"")}else s[o]=null;else s[o]=new n.ReplaceCommand(a,"")}return new o.EditOperationResult(0,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}})),define(t[171],i([0,1,12,8,88,169,359,45,99,3,20,102,42]),(function(e,t,i,n,o,s,r,a,l,d,c,h,u){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeWithAutoClosingCommand=t.TypeOperations=void 0;class g{static indent(e,t,i){if(null===t||null===i)return[];let n=[];for(let t=0,o=i.length;t1){let o;for(o=i-1;o>=1;o--){const e=t.getLineContent(o) +;if(n.lastNonWhitespaceIndex(e)>=0)break}if(o<1)return null;const r=t.getLineMaxColumn(o),a=u.LanguageConfigurationRegistry.getEnterAction(e.autoIndent,t,new d.Range(o,r,o,r));a&&(s=a.indentation+a.appendText)}return o&&(o===h.IndentAction.Indent&&(s=g.shiftIndent(e,s)),o===h.IndentAction.Outdent&&(s=g.unshiftIndent(e,s)),s=e.normalizeIndentation(s)),s||null}static _replaceJumpToNextIndent(e,t,i,n){let s="",r=i.getStartPosition();if(e.insertSpaces){let i=a.CursorColumns.visibleColumnFromColumn2(e,t,r),n=e.indentSize,o=n-i%n;for(let e=0;e=4){const r=u.LanguageConfigurationRegistry.getIndentForEnter(e.autoIndent,t,s,{unshiftIndent:t=>g.unshiftIndent(e,t),shiftIndent:t=>g.shiftIndent(e,t),normalizeIndentation:t=>e.normalizeIndentation(t)});if(r){let h=a.CursorColumns.visibleColumnFromColumn2(e,t,s.getEndPosition());const u=s.endColumn;let g="\n";c!==e.normalizeIndentation(r.beforeEnter)&&(g=e.normalizeIndentation(r.beforeEnter)+l.substring(c.length,s.startColumn-1)+"\n",s=new d.Range(s.startLineNumber,1,s.endLineNumber,s.endColumn));const p=t.getLineContent(s.endLineNumber),m=n.firstNonWhitespaceIndex(p);if(s=m>=0?s.setEndPosition(s.endLineNumber,Math.max(s.endColumn,m+1)):s.setEndPosition(s.endLineNumber,t.getLineMaxColumn(s.endLineNumber)),i)return new o.ReplaceCommandWithoutChangingPosition(s,g+e.normalizeIndentation(r.afterEnter),!0);{let t=0;return u<=m+1&&(e.insertSpaces||(h=Math.ceil(h/e.indentSize)), +t=Math.min(h+1-e.normalizeIndentation(r.afterEnter).length-1,0)),new o.ReplaceCommandWithOffsetCursorState(s,g+e.normalizeIndentation(r.afterEnter),0,t,!0)}}}return g._typeCommand(s,"\n"+e.normalizeIndentation(c),i)}static _isAutoIndentType(e,t,i){if(e.autoIndent<4)return!1;for(let e=0,n=i.length;eg.shiftIndent(e,t),unshiftIndent:t=>g.unshiftIndent(e,t)});if(null===s)return null;if(s!==e.normalizeIndentation(o)){const o=t.getLineFirstNonWhitespaceColumn(i.startLineNumber) +;return 0===o?g._typeCommand(new d.Range(i.startLineNumber,0,i.endLineNumber,i.endColumn),e.normalizeIndentation(s)+n,!1):g._typeCommand(new d.Range(i.startLineNumber,0,i.endLineNumber,i.endColumn),e.normalizeIndentation(s)+t.getLineContent(i.startLineNumber).substring(o-1,i.startColumn-1)+n,!1)}return null}static _isAutoClosingOvertype(e,t,i,n,o){if("never"===e.autoClosingOvertype)return!1;if(!e.autoClosingPairsClose2.has(o))return!1;for(let s=0,r=i.length;s2?d.charCodeAt(l.column-2):0)&&c)return!1;if("auto"===e.autoClosingOvertype){let e=!1;for(let t=0,i=n.length;t=0||i.indexOf(t)>=0}static _isBeforeClosingBrace(e,t,i){const n=e.autoClosingPairsClose2.get(i);if(!n)return!1;const o=g._autoClosingPairIsSymmetric(t);for(const e of n){const t=g._autoClosingPairIsSymmetric(e);if(o||!t)return!0}return!1}static _findAutoClosingPairOpen(e,t,i,n){const o=e.autoClosingPairsOpen2.get(n);if(!o)return null;let s=null;for(const e of o)if(null===s||e.open.length>s.open.length){let o=!0;for(const s of i){if(t.getValueInRange(new d.Range(s.lineNumber,s.column-e.open.length+1,s.lineNumber,s.column))+n!==e.open){o=!1;break}}o&&(s=e)}return s}static _isAutoClosingOpenCharType(e,t,n,o,s){const r=a.isQuote(o),d=r?e.autoClosingQuotes:e.autoClosingBrackets;if("never"===d)return null +;const c=this._findAutoClosingPairOpen(e,t,n.map(e=>e.getPosition()),o);if(!c)return null;const h=r?e.shouldAutoCloseBefore.quote:e.shouldAutoCloseBefore.bracket;for(let o=0,a=n.length;op.column-1){const t=m.charAt(p.column-1);if(!g._isBeforeClosingBrace(e,c,t)&&!h(t))return null}if(!t.isCheapToTokenize(p.lineNumber))return null;if(1===c.open.length&&r&&"always"!==d){const t=l.getMapForWordSeparators(e.wordSeparators);if(s&&p.column>1&&0===t.get(m.charCodeAt(p.column-2)))return null;if(!s&&p.column>2&&0===t.get(m.charCodeAt(p.column-3)))return null}t.forceTokenization(p.lineNumber);const f=t.getLineTokens(p.lineNumber);let _=!1;try{_=u.LanguageConfigurationRegistry.shouldAutoClosePair(c,f,s?p.column:p.column-1)}catch(e){i.onUnexpectedError(e)}if(!_)return null}return c}static _runAutoClosingOpenCharType(e,t,i,n,o,s,r){let l=[];for(let e=0,t=n.length;enew o.ReplaceCommand(new d.Range(e.positionLineNumber,e.positionColumn,e.positionLineNumber,e.positionColumn+1),"",!1));return new a.EditOperationResult(1,e,{shouldPushStackElementBefore:!0, +shouldPushStackElementAfter:!1})}const h=this._isAutoClosingOpenCharType(t,i,s,l,!1);return h?this._runAutoClosingOpenCharType(e,t,i,s,l,!1,h):null}static typeWithInterceptors(e,t,i,n,s,r,l){if(!e&&"\n"===l){let e=[];for(let t=0,o=s.length;t=0;o--){let i=e.charCodeAt(o),s=t.get(i);if(0===s){if(2===n)return this._createWord(e,n,s,o+1,this._findEndOfWord(e,t,n,o+1));n=1}else if(2===s){if(1===n)return this._createWord(e,n,s,o+1,this._findEndOfWord(e,t,n,o+1));n=2}else if(1===s&&0!==n)return this._createWord(e,n,s,o+1,this._findEndOfWord(e,t,n,o+1))}return 0!==n?this._createWord(e,n,1,0,this._findEndOfWord(e,t,n,0)):null}static _findEndOfWord(e,t,i,n){let o=e.length;for(let s=n;s=0;o--){let n=e.charCodeAt(o),s=t.get(n);if(1===s)return o+1;if(1===i&&2===s)return o+1;if(2===i&&0===s)return o+1}return 0}static moveWordLeft(e,t,i,n){let o=i.lineNumber,r=i.column;1===r&&o>1&&(o-=1,r=t.getLineMaxColumn(o));let l=a._findPreviousWordOnLine(e,t,new s.Position(o,r));if(0===n)return new s.Position(o,l?l.start+1:1);if(1===n)return l&&2===l.wordType&&l.end-l.start==1&&0===l.nextCharClass&&(l=a._findPreviousWordOnLine(e,t,new s.Position(o,l.start+1))),new s.Position(o,l?l.start+1:1);if(3===n){for(;l&&2===l.wordType;)l=a._findPreviousWordOnLine(e,t,new s.Position(o,l.start+1));return new s.Position(o,l?l.start+1:1)} +return l&&r<=l.end+1&&(l=a._findPreviousWordOnLine(e,t,new s.Position(o,l.start+1))),new s.Position(o,l?l.end+1:1)}static _moveWordPartLeft(e,t){const n=t.lineNumber,o=e.getLineMaxColumn(n);if(1===t.column)return n>1?new s.Position(n-1,e.getLineMaxColumn(n-1)):t;const r=e.getLineContent(n);for(let e=t.column-1;e>1;e--){const t=r.charCodeAt(e-2),a=r.charCodeAt(e-1);if(95===t&&95!==a)return new s.Position(n,e);if(i.isLowerAsciiLetter(t)&&i.isUpperAsciiLetter(a))return new s.Position(n,e);if(i.isUpperAsciiLetter(t)&&i.isUpperAsciiLetter(a)&&e+1=d.start+1&&(d=a._findNextWordOnLine(e,t,new s.Position(o,d.end+1))),r=d?d.start+1:t.getLineMaxColumn(o);return new s.Position(o,r)}static _moveWordPartRight(e,t){const n=t.lineNumber,o=e.getLineMaxColumn(n);if(t.column===o)return n1?c=1:(d--,c=t.getLineMaxColumn(d)):(h&&c<=h.end+1&&(h=a._findPreviousWordOnLine(e,t,new s.Position(d,h.start+1))),h?c=h.end+1:c>1?c=1:(d--,c=t.getLineMaxColumn(d))),new r.Range(d,c,l.lineNumber,l.column)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),n=a._moveWordPartLeft(e,i);return new r.Range(i.lineNumber,i.column,n.lineNumber,n.column)}static _findFirstNonWhitespaceChar(e,t){let i=e.length;for(let n=t;n=g.start+1&&(g=a._findNextWordOnLine(e,t,new s.Position(d,g.end+1))),g?c=g.start+1:cBoolean(e))}t.WordPartOperations=class extends a{static deleteWordPartLeft(e,t,i,n){const o=l([a.deleteWordLeft(e,t,i,n,0),a.deleteWordLeft(e,t,i,n,2),a._deleteWordPartLeft(t,i)]);return o.sort(r.Range.compareRangesUsingEnds),o[2]}static deleteWordPartRight(e,t,i,n){const o=l([a.deleteWordRight(e,t,i,n,0),a.deleteWordRight(e,t,i,n,2),a._deleteWordPartRight(t,i)]);return o.sort(r.Range.compareRangesUsingStarts),o[0]}static moveWordPartLeft(e,t,i){ +const n=l([a.moveWordLeft(e,t,i,0),a.moveWordLeft(e,t,i,2),a._moveWordPartLeft(t,i)]);return n.sort(s.Position.compare),n[2]}static moveWordPartRight(e,t,i){const n=l([a.moveWordRight(e,t,i,0),a.moveWordRight(e,t,i,2),a._moveWordPartRight(t,i)]);return n.sort(s.Position.compare),n[0]}}})),define(t[233],i([0,1,23,45,170,129,13,3]),(function(e,t,i,n,o,s,r,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CursorMove=t.CursorMoveCommands=void 0;t.CursorMoveCommands=class{static addCursorDown(e,t,i){let s=[],r=0;for(let a=0,l=t.length;at&&(i=t,o=e.model.getLineMaxColumn(i)),n.CursorState.fromModelState(new n.SingleCursorState(new a.Range(l.lineNumber,1,i,o),0,new r.Position(i,o),0))} +const c=t.modelState.selectionStart.getStartPosition().lineNumber;if(l.lineNumberc){const i=e.getLineCount();let o=d.lineNumber+1,s=1;return o>i&&(o=i,s=e.getLineMaxColumn(o)),n.CursorState.fromViewState(t.viewState.move(t.modelState.hasSelection(),o,s,0))}{const e=t.modelState.selectionStart.getEndPosition();return n.CursorState.fromModelState(t.modelState.move(t.modelState.hasSelection(),e.lineNumber,e.column,0))}}static word(e,t,i,o){const r=e.model.validatePosition(o);return n.CursorState.fromModelState(s.WordOperations.word(e.cursorConfig,e.model,t.modelState,i,r))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new n.CursorState(t.modelState,t.viewState);const i=t.viewState.position.lineNumber,o=t.viewState.position.column;return n.CursorState.fromViewState(new n.SingleCursorState(new a.Range(i,o,i,o),0,new r.Position(i,o),0))}static moveTo(e,t,i,o,s){ +const a=e.model.validatePosition(o),l=s?e.coordinatesConverter.validateViewPosition(new r.Position(s.lineNumber,s.column),a):e.coordinatesConverter.convertModelPositionToViewPosition(a);return n.CursorState.fromViewState(t.viewState.move(i,l.lineNumber,l.column,0))}static simpleMove(e,t,i,n,o,s){switch(i){case 0:return 4===s?this._moveHalfLineLeft(e,t,n):this._moveLeft(e,t,n,o);case 1:return 4===s?this._moveHalfLineRight(e,t,n):this._moveRight(e,t,n,o);case 2:return 2===s?this._moveUpByViewLines(e,t,n,o):this._moveUpByModelLines(e,t,n,o);case 3:return 2===s?this._moveDownByViewLines(e,t,n,o):this._moveDownByModelLines(e,t,n,o);case 4:return this._moveToViewMinColumn(e,t,n);case 5:return this._moveToViewFirstNonWhitespaceColumn(e,t,n);case 6:return this._moveToViewCenterColumn(e,t,n);case 7:return this._moveToViewMaxColumn(e,t,n);case 8:return this._moveToViewLastNonWhitespaceColumn(e,t,n);default:return null}}static viewportMove(e,t,i,n,o){ +const s=e.getCompletelyVisibleViewRange(),r=e.coordinatesConverter.convertViewRangeToModelRange(s);switch(i){case 9:{const i=this._firstLineNumberInRange(e.model,r,o),s=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,s)]}case 11:{const i=this._lastLineNumberInRange(e.model,r,o),s=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,s)]}case 10:{const i=Math.round((r.startLineNumber+r.endLineNumber)/2),o=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,o)]}case 12:{let i=[];for(let o=0,r=t.length;oi.endLineNumber-1&&(s=i.endLineNumber-1),s1;let a=[];for(let l=0,d=t.length;l1;let a=[];for(let l=0,d=t.length;li){let e=t-i;for(let t=0;t=e+1&&this.lastAddedCursorIndex--,this.secondaryCursors[e].dispose(this.context),this.secondaryCursors.splice(e,1)}_getAll(){let e=[];e[0]=this.primaryCursor;for(let t=0,i=this.secondaryCursors.length;te.selection.startLineNumber===t.selection.startLineNumber?e.selection.startColumn-t.selection.startColumn:e.selection.startLineNumber-t.selection.startLineNumber);for(let n=0;nd&&e.index--;e.splice(d,1),t.splice(l,1),this._removeSecondaryCursor(d-1),n--}}}}})), +define(t[234],i([0,1,12,8,516,45,232,171,3,20,162,2,165]),(function(e,t,i,n,o,s,r,a,l,d,c,h,u){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Cursor=t.CursorModelState=void 0;class g{constructor(e,t){this.modelVersionId=e.getVersionId(),this.cursorState=t.getCursorStates()}equals(e){if(!e)return!1;if(this.modelVersionId!==e.modelVersionId)return!1;if(this.cursorState.length!==e.cursorState.length)return!1;for(let t=0,i=this.cursorState.length;t=t.length)return!1;if(!t[i].strictContainsRange(e[i]))return!1}return!0}}class m extends h.Disposable{constructor(e,t,i,n){super(),this._model=e,this._knownModelVersionId=this._model.getVersionId(),this._viewModel=t,this._coordinatesConverter=i,this.context=new s.CursorContext(this._model,this._coordinatesConverter,n),this._cursors=new o.CursorCollection(this.context),this._hasFocus=!1,this._isHandling=!1,this._isDoingComposition=!1, +this._selectionsWhenCompositionStarted=null,this._columnSelectData=null,this._autoClosedActions=[],this._prevEditOperationType=0}dispose(){this._cursors.dispose(),this._autoClosedActions=h.dispose(this._autoClosedActions),super.dispose()}updateConfiguration(e){this.context=new s.CursorContext(this._model,this._coordinatesConverter,e),this._cursors.updateContext(this.context)}onLineMappingChanged(e){this._knownModelVersionId===this._model.getVersionId()&&this.setStates(e,"viewModel",0,this.getCursorStates())}setHasFocus(e){this._hasFocus=e}_validateAutoClosedActions(){if(this._autoClosedActions.length>0){let e=this._cursors.getSelections();for(let t=0;tm.MAX_CURSOR_COUNT&&(n=n.slice(0,m.MAX_CURSOR_COUNT),o=!0);const s=new g(this._model,this);return this._cursors.setStates(n),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,i,s,o)}setCursorColumnSelectData(e){this._columnSelectData=e}revealPrimary(e,t,i,n){const o=this._cursors.getViewPositions();if(o.length>1)this._emitCursorRevealRange(e,t,null,this._cursors.getViewSelections(),0,i,n);else{const s=o[0],r=new l.Range(s.lineNumber,s.column,s.lineNumber,s.column);this._emitCursorRevealRange(e,t,r,null,0,i,n)}}_revealPrimaryCursor(e,t,i,n,o){const s=this._cursors.getViewPositions();if(s.length>1)this._emitCursorRevealRange(e,t,null,this._cursors.getViewSelections(),i,n,o);else{const r=s[0],a=new l.Range(r.lineNumber,r.column,r.lineNumber,r.column);this._emitCursorRevealRange(e,t,a,null,i,n,o)}}_emitCursorRevealRange(e,t,i,n,o,s,r){e.emitViewEvent(new c.ViewRevealRangeRequestEvent(t,i,n,o,s,r))}saveState(){let e=[] +;const t=this._cursors.getSelections();for(let i=0,n=t.length;i0){const i=s.CursorState.fromModelSelections(t.resultingSelection);this.setStates(e,"modelChange",t.isUndoing?5:t.isRedoing?6:2,i)&&this._revealPrimaryCursor(e,"modelChange",0,!0,0)}else{const t=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",2,s.CursorState.fromModelSelections(t))}}getSelection(){return this._cursors.getPrimaryCursor().modelState.selection}getTopMostViewPosition(){return this._cursors.getTopMostViewPosition()}getBottomMostViewPosition(){return this._cursors.getBottomMostViewPosition()}getCursorColumnSelectData(){if(this._columnSelectData)return this._columnSelectData;const e=this._cursors.getPrimaryCursor(),t=e.viewState.selectionStart.getStartPosition(),i=e.viewState.position;return{isReal:!1,fromViewLineNumber:t.lineNumber, +fromViewVisualColumn:s.CursorColumns.visibleColumnFromColumn2(this.context.cursorConfig,this._viewModel,t),toViewLineNumber:i.lineNumber,toViewVisualColumn:s.CursorColumns.visibleColumnFromColumn2(this.context.cursorConfig,this._viewModel,i)}}getSelections(){return this._cursors.getSelections()}setSelections(e,t,i){this.setStates(e,t,0,s.CursorState.fromModelSelections(i))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){let i=[],n=[];for(let o=0,s=e.length;o0&&this._pushAutoClosedAction(i,n),this._prevEditOperationType=e.type}e.shouldPushStackElementAfter&&this._model.pushStackElement()}_interpretCommandResult(e){e&&0!==e.length||(e=this._cursors.readSelectionFromMarkers()),this._columnSelectData=null,this._cursors.setSelections(e),this._cursors.normalize()}_emitStateChangedIfNecessary(e,t,i,n,o){const s=new g(this._model,this);if(s.equals(n))return!1;const r=this._cursors.getSelections(),a=this._cursors.getViewSelections();if(e.emitViewEvent(new c.ViewCursorStateChangedEvent(a,r)),!n||n.cursorState.length!==s.cursorState.length||s.cursorState.some((e,t)=>!e.modelState.equals(n.cursorState[t].modelState))){const a=n?n.cursorState.map(e=>e.modelState.selection):null,l=n?n.modelVersionId:0 +;e.emitOutgoingEvent(new u.CursorStateChangedEvent(a,r,l,s.modelVersionId,t||"keyboard",i,o))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;let t=[];for(let i=0,n=e.length;i=0)return null;const o=n.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!o)return null;const s=o[1],r=this.context.cursorConfig.autoClosingPairsClose2.get(s);if(!r||1!==r.length)return null;const a=r[0].open,l=n.text.length-o[2].length-1,d=n.text.lastIndexOf(a,l-1);if(-1===d)return null;t.push([d,l])}return t}executeEdits(e,t,i,n){let o=null;"snippet"===t&&(o=this._findAutoClosingPairs(i)),o&&(i[0]._isTracked=!0);let s=[],r=[];const a=this._model.pushEditOperations(this.getSelections(),i,e=>{if(o)for(let t=0,i=o.length;t0&&this._pushAutoClosedAction(s,r)}_executeEdit(e,t,n,o=0){if(this.context.cursorConfig.readOnly)return;const s=new g(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(e){i.onUnexpectedError(e)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,n,o,s,!1)&&this._revealPrimaryCursor(t,n,0,!0,0)}setIsDoingComposition(e){this._isDoingComposition=e}startComposition(e){this._selectionsWhenCompositionStarted=this.getSelections().slice(0)}endComposition(e,t){this._executeEdit(()=>{if("keyboard"===t){const e=p.getAllAutoClosedCharacters(this._autoClosedActions);this._executeEditOperation(a.TypeOperations.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,this._selectionsWhenCompositionStarted,this.getSelections(),e)),this._selectionsWhenCompositionStarted=null}},e,t)}type(e,t,i){ +this._executeEdit(()=>{if("keyboard"===i){const e=t.length;let i=0;for(;i{this._executeEditOperation(a.TypeOperations.replacePreviousChar(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i))},e,n)}paste(e,t,i,n,o){this._executeEdit(()=>{this._executeEditOperation(a.TypeOperations.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,n||[]))},e,o,4)}cut(e,t){this._executeEdit(()=>{ +this._executeEditOperation(r.DeleteOperations.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,i){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new s.EditOperationResult(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}executeCommands(e,t,i){this._executeEdit(()=>{this._executeEditOperation(new s.EditOperationResult(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}}t.Cursor=m,m.MAX_CURSOR_COUNT=1e4;class f{static executeCommands(e,t,i){const n={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},o=this._innerExecuteCommands(n,i);for(let e=0,t=n.trackedRanges.length;e0&&(s[0]._isTracked=!0);let r=e.model.pushEditOperations(e.selectionsBefore,s,i=>{let n=[];for(let t=0;te.identifier.minor-t.identifier.minor;let s=[];for(let i=0;i0?(n[i].sort(o),s[i]=t[i].computeCursorState(e.model,{getInverseEditOperations:()=>n[i],getTrackedSelection:t=>{const i=parseInt(t,10),n=e.model._getTrackedRange(e.trackedRanges[i]);return 0===e.trackedRangesDirection[i]?new d.Selection(n.startLineNumber,n.startColumn,n.endLineNumber,n.endColumn):new d.Selection(n.endLineNumber,n.endColumn,n.startLineNumber,n.startColumn)}})):s[i]=e.selectionsBefore[i];return s});r||(r=e.selectionsBefore);let a=[] +;for(let e in o)o.hasOwnProperty(e)&&a.push(parseInt(e,10));a.sort((e,t)=>t-e);for(const e of a)r.splice(e,1);return r}static _arrayIsEmpty(e){for(let t=0,i=e.length;t{l.Range.isEmpty(e)&&""===i||o.push({identifier:{major:t,minor:s++},range:e,text:i,forceMoveMarkers:r,isAutoWhitespaceEdit:n.insertsAutoWhitespace})};let a=!1;const c={addEditOperation:r,addTrackedEditOperation:(e,t,i)=>{a=!0,r(e,t,i)},trackSelection:(t,i)=>{const n=d.Selection.liftSelection(t);let o;if(n.isEmpty())if("boolean"==typeof i)o=i?2:3;else{const t=e.model.getLineMaxColumn(n.startLineNumber);o=n.startColumn===t?2:3}else o=1 +;const s=e.trackedRanges.length,r=e.model._setTrackedRange(null,n,o);return e.trackedRanges[s]=r,e.trackedRangesDirection[s]=n.getDirection(),s.toString()}};try{n.getEditOperations(e.model,c)}catch(e){return i.onUnexpectedError(e),{operations:[],hadTrackedEditOperation:!1}}return{operations:o,hadTrackedEditOperation:a}}static _getLoserCursorMap(e){(e=e.slice(0)).sort((e,t)=>-l.Range.compareRangesUsingEnds(e.range,t.range));let t={};for(let i=1;io.identifier.major?n.identifier.major:o.identifier.major).toString()]=!0;for(let t=0;t0&&i--}}return t}}})),define(t[235],i([0,1,8,105,74]),(function(e,t,i,n,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tokenizeLineToHTML=t.tokenizeToString=void 0;const s={getInitialState:()=>o.NULL_STATE,tokenize2:(e,t,i)=>o.nullTokenize2(0,e,t,i)} +;t.tokenizeToString=function(e,t=s){return function(e,t){let o='
    ',s=e.split(/\r\n|\r|\n/),r=t.getInitialState();for(let e=0,a=s.length;e0&&(o+="
    ");let l=t.tokenize2(a,r,0);n.LineTokens.convertToEndOffset(l.tokens,a.length);let d=new n.LineTokens(l.tokens,a).inflate(),c=0;for(let e=0,t=d.getCount();e${i.escape(a.substring(c,n))}`,c=n}r=l.endState}return o+="
    "}(e,t||s)},t.tokenizeLineToHTML=function(e,t,i,n,o,s,r){let a="
    ",l=n,d=0;for(let c=0,h=t.getCount();c0;)u+=r?" ":" ",e--;break;case 60:u+="<";break;case 62:u+=">";break;case 38:u+="&";break;case 0:u+="�";break;case 65279:case 8232:case 8233:case 133:u+="�";break;case 13:u+="​";break;case 32:u+=r?" ":" ";break;default: +u+=String.fromCharCode(t)}}if(a+=`${u}`,h>o||l>=o)break}return a+="
    "}})),define(t[92],i([0,1,10]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ITextModelService=void 0,t.ITextModelService=i.createDecorator("textModelService")})),define(t[130],i([0,1,10]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ITextResourcePropertiesService=t.ITextResourceConfigurationService=void 0,t.ITextResourceConfigurationService=i.createDecorator("textResourceConfigurationService"),t.ITextResourcePropertiesService=i.createDecorator("textResourcePropertiesService")})),define(t[236],i([0,1,4,207,18]),(function(e,t,i,n,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MinimapTokensColorTracker=void 0;class s{constructor(){this._onDidChange=new i.Emitter,this.onDidChange=this._onDidChange.event,this._updateColorMap(),o.TokenizationRegistry.onDidChange(e=>{e.changedColorMap&&this._updateColorMap() +})}static getInstance(){return this._INSTANCE||(this._INSTANCE=new s),this._INSTANCE}_updateColorMap(){const e=o.TokenizationRegistry.getColorMap();if(!e)return this._colors=[n.RGBA8.Empty],void(this._backgroundIsLight=!0);this._colors=[n.RGBA8.Empty];for(let t=1;t=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=2),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}}t.MinimapTokensColorTracker=s,s._INSTANCE=null})),define(t[172],i([0,1,19,13,3,31,162,214,70]),(function(e,t,i,n,o,s,r,a,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IdentityLinesCollection=t.IdentityCoordinatesConverter=t.SplitLine=t.SplitLinesCollection=t.CoordinatesConverter=t.LineBreakData=t.OutputPosition=void 0;class d{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}}t.OutputPosition=d;class c{ +constructor(e,t,i){this.breakOffsets=e,this.breakOffsetsVisibleColumn=t,this.wrappedTextIndentLength=i}static getInputOffsetOfOutputPosition(e,t,i){return 0===t?i:e[t-1]+i}static getOutputPositionOfInputOffset(e,t){let i=0,n=e.length-1,o=0,s=0;for(;i<=n;){const r=e[o=i+(n-i)/2|0];if(t<(s=o>0?e[o-1]:0))n=o-1;else{if(!(t>=r))break;i=o+1}}return new d(o,t-s)}}t.LineBreakData=c;class h{constructor(e){this._lines=e}convertViewPositionToModelPosition(e){return this._lines.convertViewPositionToModelPosition(e.lineNumber,e.column)}convertViewRangeToModelRange(e){return this._lines.convertViewRangeToModelRange(e)}validateViewPosition(e,t){return this._lines.validateViewPosition(e.lineNumber,e.column,t)}validateViewRange(e,t){return this._lines.validateViewRange(e,t)}convertModelPositionToViewPosition(e){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column)}convertModelRangeToViewRange(e){return this._lines.convertModelRangeToViewRange(e)}modelPositionIsVisible(e){ +return this._lines.modelPositionIsVisible(e.lineNumber,e.column)}}t.CoordinatesConverter=h;class u{constructor(e){this._counts=e,this._isValid=!1,this._validEndIndex=-1,this._modelToView=[],this._viewToModel=[]}_invalidate(e){this._isValid=!1,this._validEndIndex=Math.min(this._validEndIndex,e-1)}_ensureValid(){if(!this._isValid){for(let e=this._validEndIndex+1,t=this._counts.length;e0?this._modelToView[e-1]:0;this._modelToView[e]=i+t;for(let n=0;n0?this._modelToView[t-1]:0;return new a.PrefixSumIndexOfResult(t,e-i)}}t.SplitLinesCollection=class{constructor(e,t,i,n,o,s,r,a){this.model=e,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=t,this._monospaceLineBreaksComputerFactory=i,this.fontInfo=n,this.tabSize=o,this.wrappingStrategy=s,this.wrappingColumn=r,this.wrappingIndent=a,this._constructLines(!0,null)}dispose(){this.hiddenAreasIds=this.model.deltaDecorations(this.hiddenAreasIds,[])}createCoordinatesConverter(){return new h(this)}_constructLines(e,t){this.lines=[],e&&(this.hiddenAreasIds=[]);let i=this.model.getLinesContent();const n=i.length,s=this.createLineBreaksComputer();for(let e=0;ethis.model.getDecorationRange(e)).sort(o.Range.compareRangesUsingStarts),d=1,c=0,h=-1,g=h+1=d&&t<=c,o=C(r[e],!i);a[e]=o.getViewLineCount(),this.lines[e]=o}this._validModelVersionId=this.model.getVersionId(),this.prefixSumComputer=new u(a)}getHiddenAreas(){return this.hiddenAreasIds.map(e=>this.model.getDecorationRange(e))}_reduceRanges(e){if(0===e.length)return[];let t=e.map(e=>this.model.validateRange(e)).sort(o.Range.compareRangesUsingStarts),i=[],n=t[0].startLineNumber,s=t[0].endLineNumber;for(let e=1,r=t.length;es+1?(i.push(new o.Range(n,1,s,1)),n=r.startLineNumber,s=r.endLineNumber):r.endLineNumber>s&&(s=r.endLineNumber)}return i.push(new o.Range(n,1,s,1)),i}setHiddenAreas(e){let t=this._reduceRanges(e),i=this.hiddenAreasIds.map(e=>this.model.getDecorationRange(e)).sort(o.Range.compareRangesUsingStarts);if(t.length===i.length){let e=!1;for(let n=0;n=a&&t<=l?this.lines[e].isVisible()&&(this.lines[e]=this.lines[e].setVisible(!1),i=!0):(h=!0,this.lines[e].isVisible()||(this.lines[e]=this.lines[e].setVisible(!0),i=!0)),i){let t=this.lines[e].getViewLineCount();this.prefixSumComputer.changeValue(e,t)}}return h||this.setHiddenAreas([]),!0}modelPositionIsVisible(e,t){return!(e<1||e>this.lines.length)&&this.lines[e-1].isVisible()}setTabSize(e){return this.tabSize!==e&&(this.tabSize=e,this._constructLines(!1,null),!0)}setWrappingSettings(e,t,i,n){const o=this.fontInfo.equals(e),s=this.wrappingStrategy===t,r=this.wrappingColumn===i,a=this.wrappingIndent===n;if(o&&s&&r&&a)return!1;const l=o&&s&&!r&&a;this.fontInfo=e, +this.wrappingStrategy=t,this.wrappingColumn=i,this.wrappingIndent=n;let d=null;if(l){d=[];for(let e=0,t=this.lines.length;ea?(p=(g=(c=(d=1===t?1:this.prefixSumComputer.getAccumulatedValue(t-2)+1)+a-1)+1)+(o-a)-1,l=!0):ot?t:0|e}getActiveIndentGuide(e,t,i){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),i=this._toValidViewLineNumber(i);const n=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),o=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),s=this.convertViewPositionToModelPosition(i,this.getViewLineMinColumn(i)),r=this.model.getActiveIndentGuide(n.lineNumber,o.lineNumber,s.lineNumber),a=this.convertModelPositionToViewPosition(r.startLineNumber,1),l=this.convertModelPositionToViewPosition(r.endLineNumber,this.model.getLineMaxColumn(r.endLineNumber));return{ +startLineNumber:a.lineNumber,endLineNumber:l.lineNumber,indent:r.indent}}getViewLinesIndentGuides(e,t){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);const i=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),o=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t));let s=[],r=[],a=[];const l=i.lineNumber-1,d=o.lineNumber-1;let c=null;for(let e=l;e<=d;e++){const t=this.lines[e];if(t.isVisible()){let o=t.getViewLineNumberOfModelPosition(0,e===l?i.column:1),s=t.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(e+1)),d=s-o+1,h=0;d>1&&1===t.getViewLineMinColumn(this.model,e+1,s)&&(h=0===o?1:2),r.push(d),a.push(h),null===c&&(c=new n.Position(e+1,0))}else null!==c&&(s=s.concat(this.model.getLinesIndentGuides(c.lineNumber,e)),c=null)}null!==c&&(s=s.concat(this.model.getLinesIndentGuides(c.lineNumber,o.lineNumber)),c=null);const h=t-e+1;let u=new Array(h),g=0;for(let e=0,t=s.length;et&&(h=!0,c=t-o+1);let u=d+c;if(l.getViewLinesData(this.model,n+1,d,u,o-e,i,a),o+=c,h)break}return a}validateViewPosition(e,t,i){e=this._toValidViewLineNumber(e);let o=this.prefixSumComputer.getIndexOf(e-1),s=o.index,r=o.remainder,a=this.lines[s],l=a.getViewLineMinColumn(this.model,s+1,r),d=a.getViewLineMaxColumn(this.model,s+1,r);td&&(t=d);let c=a.getModelColumnOfViewPosition(r,t);return this.model.validatePosition(new n.Position(s+1,c)).equals(i)?new n.Position(e,t):this.convertModelPositionToViewPosition(i.lineNumber,i.column)}validateViewRange(e,t){const i=this.validateViewPosition(e.startLineNumber,e.startColumn,t.getStartPosition()),n=this.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition()) +;return new o.Range(i.lineNumber,i.column,n.lineNumber,n.column)}convertViewPositionToModelPosition(e,t){e=this._toValidViewLineNumber(e);let i=this.prefixSumComputer.getIndexOf(e-1),o=i.index,s=i.remainder,r=this.lines[o].getModelColumnOfViewPosition(s,t);return this.model.validatePosition(new n.Position(o+1,r))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),i=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new o.Range(t.lineNumber,t.column,i.lineNumber,i.column)}convertModelPositionToViewPosition(e,t){const i=this.model.validatePosition(new n.Position(e,t)),o=i.lineNumber,s=i.column;let r=o-1,a=!1;for(;r>0&&!this.lines[r].isVisible();)r--,a=!0;if(0===r&&!this.lines[r].isVisible())return new n.Position(1,1);const l=1+(0===r?0:this.prefixSumComputer.getAccumulatedValue(r-1));let d +;return d=a?this.lines[r].getViewPositionOfModelPosition(l,this.model.getLineMaxColumn(r+1)):this.lines[o-1].getViewPositionOfModelPosition(l,s)}convertModelRangeToViewRange(e){let t=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn),i=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn);return e.startLineNumber===e.endLineNumber&&t.lineNumber!==i.lineNumber&&i.column===this.getViewLineMinColumn(i.lineNumber)?new o.Range(t.lineNumber,t.column,i.lineNumber-1,this.getViewLineMaxColumn(i.lineNumber-1)):new o.Range(t.lineNumber,t.column,i.lineNumber,i.column)}_getViewLineNumberForModelPosition(e,t){let i=e-1;if(this.lines[i].isVisible()){const e=1+(0===i?0:this.prefixSumComputer.getAccumulatedValue(i-1));return this.lines[i].getViewLineNumberOfModelPosition(e,t)}for(;i>0&&!this.lines[i].isVisible();)i--;if(0===i&&!this.lines[i].isVisible())return 1;const n=1+(0===i?0:this.prefixSumComputer.getAccumulatedValue(i-1)) +;return this.lines[i].getViewLineNumberOfModelPosition(n,this.model.getLineMaxColumn(i+1))}getAllOverviewRulerDecorations(e,t,i){const n=this.model.getOverviewRulerDecorations(e,t),o=new S;for(const e of n){const t=e.options.overviewRuler,n=t?t.position:0;if(0===n)continue;const s=t.getColor(i),r=this._getViewLineNumberForModelPosition(e.range.startLineNumber,e.range.startColumn),a=this._getViewLineNumberForModelPosition(e.range.endLineNumber,e.range.endColumn);o.accept(s,r,a,n)}return o.result}getDecorationsInRange(e,t,i){const s=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),r=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(r.lineNumber-s.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new o.Range(s.lineNumber,1,r.lineNumber,r.column),t,i);let a=[];const l=s.lineNumber-1,d=r.lineNumber-1;let c=null;for(let e=l;e<=d;e++){if(this.lines[e].isVisible())null===c&&(c=new n.Position(e+1,e===l?s.column:1));else if(null!==c){ +const n=this.model.getLineMaxColumn(e);a=a.concat(this.model.getDecorationsInRange(new o.Range(c.lineNumber,c.column,e,n),t,i)),c=null}}null!==c&&(a=a.concat(this.model.getDecorationsInRange(new o.Range(c.lineNumber,c.column,r.lineNumber,r.column),t,i)),c=null),a.sort((e,t)=>{const i=o.Range.compareRangesUsingStarts(e.range,t.range);return 0===i?e.idt.id?1:0:i});let h=[],u=0,g=null;for(const e of a){const t=e.id;g!==t&&(g=t,h[u++]=e)}return h}};class g{constructor(){}isVisible(){return!0}setVisible(e){return e?this:p.INSTANCE}getLineBreakData(){return null}getViewLineCount(){return 1}getViewLineContent(e,t,i){return e.getLineContent(t)}getViewLineLength(e,t,i){return e.getLineLength(t)}getViewLineMinColumn(e,t,i){return e.getLineMinColumn(t)}getViewLineMaxColumn(e,t,i){return e.getLineMaxColumn(t)}getViewLineData(e,t,i){let n=e.getLineTokens(t),o=n.getLineContent();return new l.ViewLineData(o,!1,1,o.length+1,0,n.inflate())}getViewLinesData(e,t,i,n,o,s,r){ +s[o]?r[o]=this.getViewLineData(e,t,0):r[o]=null}getModelColumnOfViewPosition(e,t){return t}getViewPositionOfModelPosition(e,t){return new n.Position(e,t)}getViewLineNumberOfModelPosition(e,t){return e}}g.INSTANCE=new g;class p{constructor(){}isVisible(){return!1}setVisible(e){return e?g.INSTANCE:this}getLineBreakData(){return null}getViewLineCount(){return 0}getViewLineContent(e,t,i){throw new Error("Not supported")}getViewLineLength(e,t,i){throw new Error("Not supported")}getViewLineMinColumn(e,t,i){throw new Error("Not supported")}getViewLineMaxColumn(e,t,i){throw new Error("Not supported")}getViewLineData(e,t,i){throw new Error("Not supported")}getViewLinesData(e,t,i,n,o,s,r){throw new Error("Not supported")}getModelColumnOfViewPosition(e,t){throw new Error("Not supported")}getViewPositionOfModelPosition(e,t){throw new Error("Not supported")}getViewLineNumberOfModelPosition(e,t){throw new Error("Not supported")}}p.INSTANCE=new p;class m{constructor(e,t){this._lineBreakData=e,this._isVisible=t}isVisible(){ +return this._isVisible}setVisible(e){return this._isVisible=e,this}getLineBreakData(){return this._lineBreakData}getViewLineCount(){return this._isVisible?this._lineBreakData.breakOffsets.length:0}getInputStartOffsetOfOutputLineIndex(e){return c.getInputOffsetOfOutputPosition(this._lineBreakData.breakOffsets,e,0)}getInputEndOffsetOfOutputLineIndex(e,t,i){return i+1===this._lineBreakData.breakOffsets.length?e.getLineMaxColumn(t)-1:c.getInputOffsetOfOutputPosition(this._lineBreakData.breakOffsets,i+1,0)}getViewLineContent(e,t,i){if(!this._isVisible)throw new Error("Not supported");let n=this.getInputStartOffsetOfOutputLineIndex(i),o=this.getInputEndOffsetOfOutputLineIndex(e,t,i),s=e.getValueInRange({startLineNumber:t,startColumn:n+1,endLineNumber:t,endColumn:o+1});return i>0&&(s=_(this._lineBreakData.wrappedTextIndentLength)+s),s}getViewLineLength(e,t,i){if(!this._isVisible)throw new Error("Not supported");let n=this.getInputStartOffsetOfOutputLineIndex(i),o=this.getInputEndOffsetOfOutputLineIndex(e,t,i)-n +;return i>0&&(o=this._lineBreakData.wrappedTextIndentLength+o),o}getViewLineMinColumn(e,t,i){if(!this._isVisible)throw new Error("Not supported");return i>0?this._lineBreakData.wrappedTextIndentLength+1:1}getViewLineMaxColumn(e,t,i){if(!this._isVisible)throw new Error("Not supported");return this.getViewLineContent(e,t,i).length+1}getViewLineData(e,t,i){if(!this._isVisible)throw new Error("Not supported");let n=this.getInputStartOffsetOfOutputLineIndex(i),o=this.getInputEndOffsetOfOutputLineIndex(e,t,i),s=e.getValueInRange({startLineNumber:t,startColumn:n+1,endLineNumber:t,endColumn:o+1});i>0&&(s=_(this._lineBreakData.wrappedTextIndentLength)+s);let r=i>0?this._lineBreakData.wrappedTextIndentLength+1:1,a=s.length+1,d=i+10&&(c=this._lineBreakData.wrappedTextIndentLength);let h=e.getLineTokens(t);const u=0===i?0:this._lineBreakData.breakOffsetsVisibleColumn[i-1];return new l.ViewLineData(s,d,r,a,u,h.sliceAndInflate(n,o,c))}getViewLinesData(e,t,i,n,o,s,r){ +if(!this._isVisible)throw new Error("Not supported");for(let a=i;a0&&(i0&&(s+=this._lineBreakData.wrappedTextIndentLength),new n.Position(e+o,s)}getViewLineNumberOfModelPosition(e,t){if(!this._isVisible)throw new Error("Not supported");return e+c.getOutputPositionOfInputOffset(this._lineBreakData.breakOffsets,t-1).outputLineIndex}}t.SplitLine=m;let f=[""];function _(e){if(e>=f.length)for(let t=1;t<=e;t++)f[t]=v(t);return f[e]}function v(e){ +return new Array(e+1).join(" ")}function C(e,t){return null===e?t?g.INSTANCE:p.INSTANCE:new m(e,t)}class b{constructor(e){this._lines=e}_validPosition(e){return this._lines.model.validatePosition(e)}_validRange(e){return this._lines.model.validateRange(e)}convertViewPositionToModelPosition(e){return this._validPosition(e)}convertViewRangeToModelRange(e){return this._validRange(e)}validateViewPosition(e,t){return this._validPosition(t)}validateViewRange(e,t){return this._validRange(t)}convertModelPositionToViewPosition(e){return this._validPosition(e)}convertModelRangeToViewRange(e){return this._validRange(e)}modelPositionIsVisible(e){const t=this._lines.model.getLineCount();return!(e.lineNumber<1||e.lineNumber>t)}}t.IdentityCoordinatesConverter=b;t.IdentityLinesCollection=class{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new b(this)}getHiddenAreas(){return[]}setHiddenAreas(e){return!1}setTabSize(e){return!1}setWrappingSettings(e,t,i,n){return!1}createLineBreaksComputer(){ +let e=[];return{addRequest:(t,i)=>{e.push(null)},finalize:()=>e}}onModelFlushed(){}onModelLinesDeleted(e,t,i){return new r.ViewLinesDeletedEvent(t,i)}onModelLinesInserted(e,t,i,n){return new r.ViewLinesInsertedEvent(t,i)}onModelLineChanged(e,t,i){return[!1,new r.ViewLinesChangedEvent(t,t),null,null]}acceptVersionId(e){}getViewLineCount(){return this.model.getLineCount()}getActiveIndentGuide(e,t,i){return{startLineNumber:e,endLineNumber:e,indent:0}}getViewLinesIndentGuides(e,t){const i=t-e+1;let n=new Array(i);for(let e=0;e=t)return void(i>s&&(o[o.length-1]=i));o.push(n,t,i)}else this.result[e]=[n,t,i]}}})),define(t[517],i([0,1,8,87,172]),(function(e,t,i,n,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MonospaceLineBreaksComputerFactory=void 0;class s extends n.CharacterClassifier{constructor(e,t){super(0);for(let t=0;t=0&&e<256?this._asciiMap[e]:e>=12352&&e<=12543||e>=13312&&e<=19903||e>=19968&&e<=40959?3:this._map.get(e)||this._defaultValue}}let r=[],a=[];class l{constructor(e,t){this.classifier=new s(e,t)}static create(e){return new l(e.get(108),e.get(107))}createLineBreaksComputer(e,t,i,n){t|=0,i=+i;let o=[],s=[];return{addRequest:(e,t)=>{o.push(e),s.push(t)},finalize:()=>{const l=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth;let h=[];for(let e=0,r=o.length;e=0){let e=Math.abs(m[L]-y);for(;L+1=e)break;e=t,L++}}for(;Lt&&(t=S,s=w);let r=0,a=0,d=0,p=0;if(s<=y){let f=s,w=0===t?0:n.charCodeAt(t-1),E=0===t?0:e.get(w),L=!0;for(let s=t;sS&&g(w,E,c,u)&&(r=t,a=f),(f+=m)>y){t>S?(d=t,p=f-m):(d=s+1,p=f),f-a>_&&(r=0),L=!1;break}w=c,E=u}if(L){b>0&&(v[b]=u[u.length-1],C[b]=m[u.length-1],b++);break}}if(0===r){let c=s,u=n.charCodeAt(t),m=e.get(u),f=!1;for(let o=t-1;o>=S;o--){const t=o+1,s=n.charCodeAt(o);if(9===s){f=!0;break}let h,v;if(i.isLowSurrogate(s)?(o--,h=0,v=2):(h=e.get(s),v=i.isFullWidthCharacter(s)?l:1),c<=y){if(0===d&&(d=t,p=c),c<=y-_)break;if(g(s,h,u,m)){r=t,a=c;break}}c-=v,u=s,m=h}if(0!==r){const e=_-(p-a);if(e<=o){const t=n.charCodeAt(d);let s;e-(s=i.isHighSurrogate(t)?2:h(t,p,o,l))<0&&(r=0)}}if(f){L--;continue}}for(0===r&&(r=d,a=p),S=r,v[b]=r,w=a,C[b]=a,b++,y=a+_;L<0||L=f)break;f=e,L++}}return 0===b?null:(v.length=b,C.length=b, +r=t.breakOffsets,a=t.breakOffsetsVisibleColumn,t.breakOffsets=v,t.breakOffsetsVisibleColumn=C,t.wrappedTextIndentLength=f,t)}function c(e,t,n,s,r,a){if(-1===s)return null;const l=t.length;if(l<=1)return null;const d=p(t,n,s,r,a),c=s-d;let u=[],m=[],f=0,_=0,v=0,C=s,b=t.charCodeAt(0),S=e.get(b),w=h(b,0,n,r),y=1;i.isHighSurrogate(b)&&(w+=1,b=t.charCodeAt(1),S=e.get(b),y++);for(let o=y;oC&&((0===_||w-v>c)&&(_=s,v=w-d),u[f]=_,m[f]=v,f++,C=v+c,_=0),b=a,S=l}return 0===f?null:(u[f]=l,m[f]=w,new o.LineBreakData(u,m,d))}function h(e,t,n,o){return 9===e?n-t%n:i.isFullWidthCharacter(e)?o:1}function u(e,t){return t-e%t}function g(e,t,i,n){return 32!==i&&(2===t||3===t&&2!==n||1===n||3===n&&1!==t)}function p(e,t,n,o,s){let r=0;if(0!==s){const a=i.firstNonWhitespaceIndex(e);if(-1!==a){for(let i=0;in&&(r=0)}}return r}t.MonospaceLineBreaksComputerFactory=l})),define(t[518],i([0,1,29,2,8,38,13,3,18,235,236,162,388,172,70,440,15,16,234,45,165]),(function(e,t,i,n,o,s,r,a,l,d,c,h,u,g,p,m,f,_,v,C,b){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ViewModel=void 0;const S=!0;class w extends n.Disposable{constructor(e,t,i,n,o,s){if(super(),this._editorId=e,this._configuration=t,this.model=i,this._eventDispatcher=new b.ViewModelEventDispatcher,this.onEvent=this._eventDispatcher.onEvent,this.cursorConfig=new C.CursorConfiguration(this.model.getLanguageIdentifier(),this.model.getOptions(),this._configuration),this._tokenizeViewportSoon=this._register(new f.RunOnceScheduler(()=>this.tokenizeViewport(),50)),this._updateConfigurationViewLineCount=this._register(new f.RunOnceScheduler(()=>this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStartLine=-1,this._viewportStartLineTrackedRange=null,this._viewportStartLineDelta=0, +S&&this.model.isTooLargeForTokenization())this._lines=new g.IdentityLinesCollection(this.model);else{const e=this._configuration.options,t=e.get(36),i=e.get(112),s=e.get(118),r=e.get(111);this._lines=new g.SplitLinesCollection(this.model,n,o,t,this.model.getOptions().tabSize,i,s.wrappingColumn,r)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new v.Cursor(i,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new u.ViewLayout(this._configuration,this.getLineCount(),s)),this._register(this.viewLayout.onDidScroll(e=>{e.scrollTopChanged&&this._tokenizeViewportSoon.schedule(),this._eventDispatcher.emitSingleViewEvent(new h.ViewScrollChangedEvent(e)),this._eventDispatcher.emitOutgoingEvent(new b.ScrollChangedEvent(e.oldScrollWidth,e.oldScrollLeft,e.oldScrollHeight,e.oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop))})),this._register(this.viewLayout.onDidContentSizeChange(e=>{this._eventDispatcher.emitOutgoingEvent(e) +})),this._decorations=new m.ViewModelDecorations(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast(e=>{try{const t=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(t,e)}finally{this._eventDispatcher.endEmitViewEvents()}})),this._register(c.MinimapTokensColorTracker.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new h.ViewTokensColorsChangedEvent)})),this._updateConfigurationViewLineCountNow()}dispose(){super.dispose(),this._decorations.dispose(),this._lines.dispose(),this.invalidateMinimapColorCache(),this._viewportStartLineTrackedRange=this.model._setTrackedRange(this._viewportStartLineTrackedRange,null,1),this._eventDispatcher.dispose()}addViewEventHandler(e){this._eventDispatcher.addViewEventHandler(e)}removeViewEventHandler(e){this._eventDispatcher.removeViewEventHandler(e)}_updateConfigurationViewLineCountNow(){ +this._configuration.setViewLineCount(this._lines.getViewLineCount())}tokenizeViewport(){const e=this.viewLayout.getLinesViewportData(),t=this.coordinatesConverter.convertViewPositionToModelPosition(new r.Position(e.startLineNumber,1)),i=this.coordinatesConverter.convertViewPositionToModelPosition(new r.Position(e.endLineNumber,1));this.model.tokenizeViewport(t.lineNumber,i.lineNumber)}setHasFocus(e){this._hasFocus=e,this._cursor.setHasFocus(e),this._eventDispatcher.emitSingleViewEvent(new h.ViewFocusChangedEvent(e)),this._eventDispatcher.emitOutgoingEvent(new b.FocusChangedEvent(!e,e))}onDidColorThemeChange(){this._eventDispatcher.emitSingleViewEvent(new h.ViewThemeChangedEvent)}_onConfigurationChanged(e,t){let i=null;if(-1!==this._viewportStartLine){let e=new r.Position(this._viewportStartLine,this.getLineMinColumn(this._viewportStartLine));i=this.coordinatesConverter.convertViewPositionToModelPosition(e)}let n=!1;const o=this._configuration.options,s=o.get(36),a=o.get(112),l=o.get(118),d=o.get(111) +;if(this._lines.setWrappingSettings(s,a,l.wrappingColumn,d)&&(e.emitViewEvent(new h.ViewFlushedEvent),e.emitViewEvent(new h.ViewLineMappingChangedEvent),e.emitViewEvent(new h.ViewDecorationsChangedEvent(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),0!==this.viewLayout.getCurrentScrollTop()&&(n=!0),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(72)&&(this._decorations.reset(),e.emitViewEvent(new h.ViewDecorationsChangedEvent(null))),e.emitViewEvent(new h.ViewConfigurationChangedEvent(t)),this.viewLayout.onConfigurationChanged(t),n&&i){const e=this.coordinatesConverter.convertModelPositionToViewPosition(i),t=this.viewLayout.getVerticalOffsetForLineNumber(e.lineNumber);this.viewLayout.setScrollPosition({scrollTop:t+this._viewportStartLineDelta},1)}C.CursorConfiguration.shouldRecreate(t)&&(this.cursorConfig=new C.CursorConfiguration(this.model.getLanguageIdentifier(),this.model.getOptions(),this._configuration), +this._cursor.updateConfiguration(this.cursorConfig))}_registerModelEvents(){this._register(this.model.onDidChangeRawContentFast(e=>{try{const t=this._eventDispatcher.beginEmitViewEvents();let i=!1,n=!1;const o=e.changes,s=e.versionId,r=this._lines.createLineBreaksComputer();for(const e of o)switch(e.changeType){case 4:for(const t of e.detail)r.addRequest(t,null);break;case 2:r.addRequest(e.detail,null)}const a=r.finalize();let l=0;for(const e of o)switch(e.changeType){case 1:this._lines.onModelFlushed(),t.emitViewEvent(new h.ViewFlushedEvent),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount()),i=!0;break;case 3:{const n=this._lines.onModelLinesDeleted(s,e.fromLineNumber,e.toLineNumber);null!==n&&(t.emitViewEvent(n),this.viewLayout.onLinesDeleted(n.fromLineNumber,n.toLineNumber)),i=!0;break}case 4:{const n=a.slice(l,l+e.detail.length);l+=e.detail.length;const o=this._lines.onModelLinesInserted(s,e.fromLineNumber,e.toLineNumber,n);null!==o&&(t.emitViewEvent(o), +this.viewLayout.onLinesInserted(o.fromLineNumber,o.toLineNumber)),i=!0;break}case 2:{const i=a[l];l++;const[o,r,d,c]=this._lines.onModelLineChanged(s,e.lineNumber,i);n=o,r&&t.emitViewEvent(r),d&&(t.emitViewEvent(d),this.viewLayout.onLinesInserted(d.fromLineNumber,d.toLineNumber)),c&&(t.emitViewEvent(c),this.viewLayout.onLinesDeleted(c.fromLineNumber,c.toLineNumber));break}}this._lines.acceptVersionId(s),this.viewLayout.onHeightMaybeChanged(),!i&&n&&(t.emitViewEvent(new h.ViewLineMappingChangedEvent),t.emitViewEvent(new h.ViewDecorationsChangedEvent(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged())}finally{this._eventDispatcher.endEmitViewEvents()}if(this._viewportStartLine=-1,this._configuration.setMaxLineNumber(this.model.getLineCount()),this._updateConfigurationViewLineCountNow(),!this._hasFocus&&this.model.getAttachedEditorCount()>=2&&this._viewportStartLineTrackedRange){const e=this.model._getTrackedRange(this._viewportStartLineTrackedRange);if(e){ +const t=this.coordinatesConverter.convertModelPositionToViewPosition(e.getStartPosition()),i=this.viewLayout.getVerticalOffsetForLineNumber(t.lineNumber);this.viewLayout.setScrollPosition({scrollTop:i+this._viewportStartLineDelta},1)}}try{const t=this._eventDispatcher.beginEmitViewEvents();this._cursor.onModelContentChanged(t,e)}finally{this._eventDispatcher.endEmitViewEvents()}})),this._register(this.model.onDidChangeTokens(e=>{let t=[];for(let i=0,n=e.ranges.length;i{ +this._eventDispatcher.emitSingleViewEvent(new h.ViewLanguageConfigurationEvent),this.cursorConfig=new C.CursorConfiguration(this.model.getLanguageIdentifier(),this.model.getOptions(),this._configuration),this._cursor.updateConfiguration(this.cursorConfig)})),this._register(this.model.onDidChangeLanguage(e=>{this.cursorConfig=new C.CursorConfiguration(this.model.getLanguageIdentifier(),this.model.getOptions(),this._configuration),this._cursor.updateConfiguration(this.cursorConfig)})),this._register(this.model.onDidChangeOptions(e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const e=this._eventDispatcher.beginEmitViewEvents();e.emitViewEvent(new h.ViewFlushedEvent),e.emitViewEvent(new h.ViewLineMappingChangedEvent),e.emitViewEvent(new h.ViewDecorationsChangedEvent(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()} +this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new C.CursorConfiguration(this.model.getLanguageIdentifier(),this.model.getOptions(),this._configuration),this._cursor.updateConfiguration(this.cursorConfig)})),this._register(this.model.onDidChangeDecorations(e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new h.ViewDecorationsChangedEvent(e))}))}setHiddenAreas(e){try{const t=this._eventDispatcher.beginEmitViewEvents();this._lines.setHiddenAreas(e)&&(t.emitViewEvent(new h.ViewFlushedEvent),t.emitViewEvent(new h.ViewLineMappingChangedEvent),t.emitViewEvent(new h.ViewDecorationsChangedEvent(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.onHeightMaybeChanged())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}getVisibleRangesPlusViewportAboveBelow(){ +const e=this._configuration.options.get(117),t=this._configuration.options.get(51),i=Math.max(20,Math.round(e.height/t)),n=this.viewLayout.getLinesViewportData(),o=Math.max(1,n.completelyVisibleStartLineNumber-i),s=Math.min(this.getLineCount(),n.completelyVisibleEndLineNumber+i);return this._toModelVisibleRanges(new a.Range(o,this.getLineMinColumn(o),s,this.getLineMaxColumn(s)))}getVisibleRanges(){const e=this.getCompletelyVisibleViewRange();return this._toModelVisibleRanges(e)}_toModelVisibleRanges(e){const t=this.coordinatesConverter.convertViewRangeToModelRange(e),i=this._lines.getHiddenAreas();if(0===i.length)return[t];let n=[],o=0,s=t.startLineNumber,r=t.startColumn,l=t.endLineNumber,d=t.endColumn;for(let e=0,t=i.length;el||(se.startLineNumber);let o="";for(let e=0;e0&&i[e-1]===i[e]||(o+=this.model.getLineContent(i[e])+n);return o}if(o&&t){let t=[],n=0;for(const o of e){const e=o.startLineNumber;o.isEmpty()?e!==n&&t.push(this.model.getLineContent(e)):t.push(this.model.getValueInRange(o,i?2:0)),n=e}return 1===t.length?t[0]:t}let r=[];for(const t of e)t.isEmpty()||r.push(this.model.getValueInRange(t,i?2:0));return 1===r.length?r[0]:r} +getRichTextToCopy(e,t){const i=this.model.getLanguageIdentifier();if(1===i.id)return null;if(1!==e.length)return null;let n=e[0];if(n.isEmpty()){if(!t)return null;const e=n.startLineNumber;n=new a.Range(e,this.model.getLineMinColumn(e),e,this.model.getLineMaxColumn(e))}const o=this._configuration.options.get(36),r=this._getColorMap(),l=o.fontFamily===s.EDITOR_FONT_DEFAULTS.fontFamily?o.fontFamily:`'${o.fontFamily}', ${s.EDITOR_FONT_DEFAULTS.fontFamily}`;return{mode:i.language,html:'
    '+this._getHTMLToCopy(n,r)+"
    "}}_getHTMLToCopy(e,t){const i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,s=e.endColumn,r=this.getTabSize();let a="";for(let e=i;e<=o;e++){const l=this.model.getLineTokens(e),c=l.getLineContent(),h=e===i?n-1:0,u=e===o?s-1:c.length +;a+=""===c?"
    ":d.tokenizeLineToHTML(c,l.inflate(),t,h,u,r,_.isWindows)}return a}_getColorMap(){let e=l.TokenizationRegistry.getColorMap(),t=["#000000"];if(e)for(let n=1,o=e.length;nthis._cursor.setStates(n,e,t,i))}getCursorColumnSelectData(){return this._cursor.getCursorColumnSelectData()}setCursorColumnSelectData(e){this._cursor.setCursorColumnSelectData(e)}getPrevEditOperationType(){return this._cursor.getPrevEditOperationType()}setPrevEditOperationType(e){this._cursor.setPrevEditOperationType(e)}getSelection(){return this._cursor.getSelection()}getSelections(){return this._cursor.getSelections()}getPosition(){ +return this._cursor.getPrimaryCursorState().modelState.position}setSelections(e,t){this._withViewEventsCollector(i=>this._cursor.setSelections(i,e,t))}saveCursorState(){return this._cursor.saveState()}restoreCursorState(e){this._withViewEventsCollector(t=>this._cursor.restoreState(t,e))}_executeCursorEdit(e){this._cursor.context.cursorConfig.readOnly?this._eventDispatcher.emitOutgoingEvent(new b.ReadOnlyEditAttemptEvent):this._withViewEventsCollector(e)}executeEdits(e,t,i){this._executeCursorEdit(n=>this._cursor.executeEdits(n,e,t,i))}startComposition(){this._cursor.setIsDoingComposition(!0),this._executeCursorEdit(e=>this._cursor.startComposition(e))}endComposition(e){this._cursor.setIsDoingComposition(!1),this._executeCursorEdit(t=>this._cursor.endComposition(t,e))}type(e,t){this._executeCursorEdit(i=>this._cursor.type(i,e,t))}replacePreviousChar(e,t,i){this._executeCursorEdit(n=>this._cursor.replacePreviousChar(n,e,t,i))}paste(e,t,i,n){this._executeCursorEdit(o=>this._cursor.paste(o,e,t,i,n))}cut(e){ +this._executeCursorEdit(t=>this._cursor.cut(t,e))}executeCommand(e,t){this._executeCursorEdit(i=>this._cursor.executeCommand(i,e,t))}executeCommands(e,t){this._executeCursorEdit(i=>this._cursor.executeCommands(i,e,t))}revealPrimaryCursor(e,t){this._withViewEventsCollector(i=>this._cursor.revealPrimary(i,e,t,0))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),i=new a.Range(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(t=>t.emitViewEvent(new h.ViewRevealRangeRequestEvent(e,i,null,0,!0,0)))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),i=new a.Range(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(t=>t.emitViewEvent(new h.ViewRevealRangeRequestEvent(e,i,null,0,!0,0)))}revealRange(e,t,i,n,o){this._withViewEventsCollector(s=>s.emitViewEvent(new h.ViewRevealRangeRequestEvent(e,i,null,n,t,o)))}getVerticalOffsetForLineNumber(e){return this.viewLayout.getVerticalOffsetForLineNumber(e)}getScrollTop(){ +return this.viewLayout.getCurrentScrollTop()}setScrollTop(e,t){this.viewLayout.setScrollPosition({scrollTop:e},t)}setScrollPosition(e,t){this.viewLayout.setScrollPosition(e,t)}deltaScrollNow(e,t){this.viewLayout.deltaScrollNow(e,t)}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new h.ViewZonesChangedEvent),this._eventDispatcher.emitOutgoingEvent(new b.ViewZonesChangedEvent))}setMaxLineWidth(e){this.viewLayout.setMaxLineWidth(e)}_withViewEventsCollector(e){try{e(this._eventDispatcher.beginEmitViewEvents())}finally{this._eventDispatcher.endEmitViewEvents()}}}t.ViewModel=w})),define(t[237],i([0,1,19,25,12,59,18,50,109]),(function(e,t,i,n,o,s,r,a,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OutlineModel=t.OutlineGroup=t.OutlineElement=t.TreeElement=void 0;class d{remove(){this.parent&&this.parent.children.delete(this.id)}static findId(e,t){let i;"string"==typeof e?i=`${t.id}/${e}`:(i=`${t.id}/${e.name}`, +void 0!==t.children.get(i)&&(i=`${t.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));let n=i;for(let e=0;void 0!==t.children.get(n);e++)n=`${i}_${e}`;return n}static empty(e){return 0===e.children.size}}t.TreeElement=d;class c extends d{constructor(e,t,i){super(),this.id=e,this.parent=t,this.symbol=i,this.children=new Map}}t.OutlineElement=c;class h extends d{constructor(e,t,i,n){super(),this.id=e,this.parent=t,this.label=i,this.order=n,this.children=new Map}}t.OutlineGroup=h;class u extends d{constructor(e){super(),this.uri=e,this.id="root",this.parent=void 0,this._groups=new Map,this.children=new Map,this.id="root",this.parent=void 0}static create(e,t){let i=this._keys.for(e,!0),o=u._requests.get(i);if(!o){let t=new n.CancellationTokenSource;o={promiseCnt:0,source:t,promise:u._create(e,t.token),model:void 0},u._requests.set(i,o);const s=Date.now();o.promise.then(()=>{let t=this._keys.for(e,!1),i=this._requestDurations.get(t);i||(i=new l.MovingAverage,this._requestDurations.set(t,i)), +i.update(Date.now()-s)})}return o.model?Promise.resolve(o.model):(o.promiseCnt+=1,t.onCancellationRequested(()=>{0==--o.promiseCnt&&(o.source.cancel(),u._requests.delete(i))}),new Promise((e,t)=>{o.promise.then(t=>{o.model=t,e(t)},e=>{u._requests.delete(i),t(e)})}))}static _create(e,t){const s=new n.CancellationTokenSource(t),a=new u(e.uri),l=r.DocumentSymbolProviderRegistry.ordered(e),c=l.map((t,i)=>{var n;let r=d.findId(`provider_${i}`,a),l=new h(r,a,null!==(n=t.displayName)&&void 0!==n?n:"Unknown Outline Provider",i);return Promise.resolve(t.provideDocumentSymbols(e,s.token)).then(e=>{for(const t of e||[])u._makeOutlineElement(t,l);return l},e=>(o.onUnexpectedExternalError(e),l)).then(e=>{d.empty(e)?e.remove():a._groups.set(r,e)})}),g=r.DocumentSymbolProviderRegistry.onDidChange(()=>{const t=r.DocumentSymbolProviderRegistry.ordered(e);i.equals(t,l)||s.cancel()});return Promise.all(c).then(()=>s.token.isCancellationRequested&&!t.isCancellationRequested?u._create(e,t):a._compact()).finally(()=>{g.dispose()}) +}static _makeOutlineElement(e,t){let i=d.findId(e,t),n=new c(i,t,e);if(e.children)for(const t of e.children)u._makeOutlineElement(t,n);t.children.set(n.id,n)}_compact(){let e=0;for(const[t,i]of this._groups)0===i.children.size?this._groups.delete(t):e+=1;if(1!==e)this.children=this._groups;else{let e=a.Iterable.first(this._groups.values());for(let[,t]of e.children)t.parent=this,this.children.set(t.id,t)}return this}}t.OutlineModel=u,u._requestDurations=new s.LRUCache(50,.7),u._requests=new s.LRUCache(9,.75),u._keys=new class{constructor(){this._counter=1,this._data=new WeakMap}for(e,t){return`${e.id}/${t?e.getVersionId():""}/${this._hash(r.DocumentSymbolProviderRegistry.all(e))}`}_hash(e){let t="";for(const i of e){let e=this._data.get(i);void 0===e&&(e=this._counter++,this._data.set(i,e)),t+=e}return t}}})),define(t[519],i([0,1,31,26]),(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FoldingDecorationProvider=t.foldingCollapsedIcon=t.foldingExpandedIcon=void 0, +t.foldingExpandedIcon=n.registerIcon("folding-expanded",n.Codicon.chevronDown),t.foldingCollapsedIcon=n.registerIcon("folding-collapsed",n.Codicon.chevronRight);class o{constructor(e){this.editor=e,this.autoHideFoldingControls=!0,this.showFoldingHighlights=!0}getDecorationOption(e,t){return t?o.HIDDEN_RANGE_DECORATION:e?this.showFoldingHighlights?o.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:o.COLLAPSED_VISUAL_DECORATION:this.autoHideFoldingControls?o.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:o.EXPANDED_VISUAL_DECORATION}deltaDecorations(e,t){return this.editor.deltaDecorations(e,t)}changeDecorations(e){return this.editor.changeDecorations(e)}}t.FoldingDecorationProvider=o,o.COLLAPSED_VISUAL_DECORATION=i.ModelDecorationOptions.register({stickiness:1,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:t.foldingCollapsedIcon.classNames}),o.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=i.ModelDecorationOptions.register({stickiness:1,afterContentClassName:"inline-folded", +className:"folded-background",isWholeLine:!0,firstLineDecorationClassName:t.foldingCollapsedIcon.classNames}),o.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=i.ModelDecorationOptions.register({stickiness:1,isWholeLine:!0,firstLineDecorationClassName:t.foldingExpandedIcon.classNames}),o.EXPANDED_VISUAL_DECORATION=i.ModelDecorationOptions.register({stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+t.foldingExpandedIcon.classNames}),o.HIDDEN_RANGE_DECORATION=i.ModelDecorationOptions.register({stickiness:1})})),define(t[520],i([0,1,166,31,42]),(function(e,t,i,n,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.computeRanges=t.RangesCollector=t.IndentRangeProvider=t.ID_INDENT_PROVIDER=void 0;const s=5e3;t.ID_INDENT_PROVIDER="indent";t.IndentRangeProvider=class{constructor(e){this.editorModel=e,this.id=t.ID_INDENT_PROVIDER}dispose(){}compute(e){let t=o.LanguageConfigurationRegistry.getFoldingRules(this.editorModel.getLanguageIdentifier().id),i=t&&!!t.offSide,n=t&&t.markers +;return Promise.resolve(a(this.editorModel,i,n))}};class r{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,n){if(e>i.MAX_LINE_NUMBER||t>i.MAX_LINE_NUMBER)return;let o=this._length;this._startIndexes[o]=e,this._endIndexes[o]=t,this._length++,n<1e3&&(this._indentOccurrences[n]=(this._indentOccurrences[n]||0)+1)}toIndentRanges(e){if(this._length<=this._foldingRangesLimit){let e=new Uint32Array(this._length),t=new Uint32Array(this._length);for(let i=this._length-1,n=0;i>=0;i--,n++)e[n]=this._startIndexes[i],t[n]=this._endIndexes[i];return new i.FoldingRegions(e,t)}{let t=0,o=this._indentOccurrences.length;for(let e=0;ethis._foldingRangesLimit){o=e;break}t+=i}}const s=e.getOptions().tabSize;let r=new Uint32Array(this._foldingRangesLimit),a=new Uint32Array(this._foldingRangesLimit);for(let i=this._length-1,l=0;i>=0;i--){ +let d=this._startIndexes[i],c=e.getLineContent(d),h=n.TextModel.computeIndentLevel(c,s);(h0;i--){let o,s=e.getLineContent(i),r=n.TextModel.computeIndentLevel(s,a),h=c[c.length-1];if(-1!==r){if(d&&(o=s.match(d))){if(!o[1]){c.push({indent:-2,endAbove:i,line:i});continue}{let e=c.length-1;for(;e>0&&-2!==c[e].indent;)e--;if(e>0){c.length=e+1,h=c[e],l.insertFirst(i,h.line,r),h.line=i,h.indent=r,h.endAbove=i;continue}}}if(h.indent>r){do{c.pop(),h=c[c.length-1]}while(h.indent>r);let e=h.endAbove-1;e-i>=1&&l.insertFirst(i,e,r)}h.indent===r?h.endAbove=i:c.push({indent:r,endAbove:i,line:i})}else t&&(h.endAbove=i)}return l.toIndentRanges(e)}t.RangesCollector=r, +t.computeRanges=a})),define(t[521],i([0,1,8,169,3,20,102,42,222]),(function(e,t,i,n,o,s,r,a,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MoveLinesCommand=void 0;t.MoveLinesCommand=class{constructor(e,t,i){this._selection=e,this._isMovingDown=t,this._autoIndent=i,this._selectionId=null,this._moveEndLineSelectionShrink=!1}getEditOperations(e,t){let n=e.getLineCount();if(this._isMovingDown&&this._selection.endLineNumber===n)return void(this._selectionId=t.trackSelection(this._selection));if(!this._isMovingDown&&1===this._selection.startLineNumber)return void(this._selectionId=t.trackSelection(this._selection));this._moveEndPositionDown=!1;let r=this._selection;r.startLineNumbere.getLineTokens(t), +getLanguageIdentifier:()=>e.getLanguageIdentifier(),getLanguageIdAtPosition:(t,i)=>e.getLanguageIdAtPosition(t,i),getLineContent:null};if(r.startLineNumber===r.endLineNumber&&1===e.getLineMaxColumn(r.startLineNumber)){let i=r.startLineNumber,n=this._isMovingDown?i+1:i-1;1===e.getLineMaxColumn(n)?t.addEditOperation(new o.Range(1,1,1,1),null):(t.addEditOperation(new o.Range(i,1,i,1),e.getLineContent(n)),t.addEditOperation(new o.Range(n,1,n,e.getLineMaxColumn(n)),null)),r=new s.Selection(n,1,n,1)}else{let n,s;if(this._isMovingDown){n=r.endLineNumber+1,s=e.getLineContent(n),t.addEditOperation(new o.Range(n-1,e.getLineMaxColumn(n-1),n,e.getLineMaxColumn(n)),null);let c=s;if(this.shouldAutoIndent(e,r)){let p=this.matchEnterRule(e,u,d,n,r.startLineNumber-1);if(null!==p){let t=i.getLeadingWhitespace(e.getLineContent(n)),o=p+l.getSpaceCnt(t,d),r=l.generateIndent(o,d,h);c=r+this.trimLeft(s)}else{g.getLineContent=t=>t===r.startLineNumber?e.getLineContent(n):e.getLineContent(t) +;let t=a.LanguageConfigurationRegistry.getGoodIndentForLine(this._autoIndent,g,e.getLanguageIdAtPosition(n,1),r.startLineNumber,u);if(null!==t){let o=i.getLeadingWhitespace(e.getLineContent(n)),r=l.getSpaceCnt(t,d);if(r!==l.getSpaceCnt(o,d)){let e=l.generateIndent(r,d,h);c=e+this.trimLeft(s)}}}t.addEditOperation(new o.Range(r.startLineNumber,1,r.startLineNumber,1),c+"\n");let m=this.matchEnterRule(e,u,d,r.startLineNumber,r.startLineNumber,c);if(null!==m)0!==m&&this.getIndentEditsOfMovingBlock(e,t,r,d,h,m);else{g.getLineContent=t=>t===r.startLineNumber?c:t>=r.startLineNumber+1&&t<=r.endLineNumber+1?e.getLineContent(t-1):e.getLineContent(t);let o=a.LanguageConfigurationRegistry.getGoodIndentForLine(this._autoIndent,g,e.getLanguageIdAtPosition(n,1),r.startLineNumber+1,u);if(null!==o){const n=i.getLeadingWhitespace(e.getLineContent(r.startLineNumber)),s=l.getSpaceCnt(o,d),a=l.getSpaceCnt(n,d);if(s!==a){const i=s-a;this.getIndentEditsOfMovingBlock(e,t,r,d,h,i)}}} +}else t.addEditOperation(new o.Range(r.startLineNumber,1,r.startLineNumber,1),c+"\n")}else if(n=r.startLineNumber-1,s=e.getLineContent(n),t.addEditOperation(new o.Range(n,1,n+1,1),null),t.addEditOperation(new o.Range(r.endLineNumber,e.getLineMaxColumn(r.endLineNumber),r.endLineNumber,e.getLineMaxColumn(r.endLineNumber)),"\n"+s),this.shouldAutoIndent(e,r)){g.getLineContent=t=>t===n?e.getLineContent(r.startLineNumber):e.getLineContent(t);let o=this.matchEnterRule(e,u,d,r.startLineNumber,r.startLineNumber-2);if(null!==o)0!==o&&this.getIndentEditsOfMovingBlock(e,t,r,d,h,o);else{let o=a.LanguageConfigurationRegistry.getGoodIndentForLine(this._autoIndent,g,e.getLanguageIdAtPosition(r.startLineNumber,1),n,u);if(null!==o){let n=i.getLeadingWhitespace(e.getLineContent(r.startLineNumber)),s=l.getSpaceCnt(o,d),a=l.getSpaceCnt(n,d);if(s!==a){let i=s-a;this.getIndentEditsOfMovingBlock(e,t,r,d,h,i)}}}}}this._selectionId=t.trackSelection(r)}buildIndentConverter(e,t,i){return{ +shiftIndent:o=>n.ShiftCommand.shiftIndent(o,o.length+1,e,t,i),unshiftIndent:o=>n.ShiftCommand.unshiftIndent(o,o.length+1,e,t,i)}}matchEnterRule(e,t,n,s,d,c){let h=d;for(;h>=1;){let t;if(t=h===d&&void 0!==c?c:e.getLineContent(h),i.lastNonWhitespaceIndex(t)>=0)break;h--}if(h<1||s>e.getLineCount())return null;let u=e.getLineMaxColumn(h),g=a.LanguageConfigurationRegistry.getEnterAction(this._autoIndent,e,new o.Range(h,u,h,u));if(g){let o=g.indentation;g.indentAction===r.IndentAction.None?o=g.indentation+g.appendText:g.indentAction===r.IndentAction.Indent?o=g.indentation+g.appendText:g.indentAction===r.IndentAction.IndentOutdent?o=g.indentation:g.indentAction===r.IndentAction.Outdent&&(o=t.unshiftIndent(g.indentation)+g.appendText);let d=e.getLineContent(s);if(this.trimLeft(d).indexOf(this.trimLeft(o))>=0){let r=i.getLeadingWhitespace(e.getLineContent(s)),d=i.getLeadingWhitespace(o),c=a.LanguageConfigurationRegistry.getIndentMetadata(e,s);return null!==c&&2&c&&(d=t.unshiftIndent(d)), +l.getSpaceCnt(d,n)-l.getSpaceCnt(r,n)}}return null}trimLeft(e){return e.replace(/^\s+/,"")}shouldAutoIndent(e,t){if(this._autoIndent<4)return!1;if(!e.isCheapToTokenize(t.startLineNumber))return!1;let i=e.getLanguageIdAtPosition(t.startLineNumber,1);return i===e.getLanguageIdAtPosition(t.endLineNumber,1)&&null!==a.LanguageConfigurationRegistry.getIndentRulesSupport(i)}getIndentEditsOfMovingBlock(e,t,n,s,r,a){for(let d=n.startLineNumber;d<=n.endLineNumber;d++){let c=e.getLineContent(d),h=i.getLeadingWhitespace(c),u=l.getSpaceCnt(h,s)+a,g=l.generateIndent(u,s,r);g!==h&&(t.addEditOperation(new o.Range(d,1,d,h.length+1),g),d===n.endLineNumber&&n.endColumn<=h.length+1&&""===g&&(this._moveEndLineSelectionShrink=!0))}}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(i=i.setEndPosition(i.endLineNumber+1,1)),this._moveEndLineSelectionShrink&&i.startLineNumber{const t=this._getWidth(e);this.domNode.style.width=t+"px",this.domNode.style.left=this._getLeft(e)+"px",this._onWidth(t)}))}dispose(){this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._viewZone&&this.editor.changeViewZones(e=>{this._viewZone&&e.removeZone(this._viewZone.id),this._viewZone=null}),this.editor.deltaDecorations(this._positionMarkerId,[]),this._positionMarkerId=[],this._disposables.dispose()}create(){this.domNode.classList.add("zone-widget"),this.options.className&&this.domNode.classList.add(this.options.className),this.container=document.createElement("div"),this.container.classList.add("zone-widget-container"),this.domNode.appendChild(this.container),this.options.showArrow&&(this._arrow=new m(this.editor), +this._disposables.add(this._arrow)),this._fillContainer(this.container),this._initSash(),this._applyStyles()}style(e){e.frameColor&&(this.options.frameColor=e.frameColor),e.arrowColor&&(this.options.arrowColor=e.arrowColor),this._applyStyles()}_applyStyles(){if(this.container&&this.options.frameColor){let e=this.options.frameColor.toString();this.container.style.borderTopColor=e,this.container.style.borderBottomColor=e}if(this._arrow&&this.options.arrowColor){let e=this.options.arrowColor.toString();this._arrow.color=e}}_getWidth(e){return e.width-e.minimap.minimapWidth-e.verticalScrollbarWidth}_getLeft(e){return e.minimap.minimapWidth>0&&0===e.minimap.minimapLeft?e.minimap.minimapWidth:0}_onViewZoneTop(e){this.domNode.style.top=e+"px"}_onViewZoneHeight(e){if(this.domNode.style.height=`${e}px`,this.container){let t=e-this._decoratingElementsHeight();this.container.style.height=`${t}px`;const i=this.editor.getLayoutInfo();this._doLayout(t,this._getWidth(i))}this._resizeSash&&this._resizeSash.layout()} +get position(){const[e]=this._positionMarkerId;if(!e)return;const t=this.editor.getModel();if(!t)return;const i=t.getDecorationRange(e);return i?i.getStartPosition():void 0}show(e,t){const i=l.Range.isIRange(e)?l.Range.lift(e):l.Range.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId=this.editor.deltaDecorations(this._positionMarkerId,[{range:i,options:d.ModelDecorationOptions.EMPTY}])}hide(){this._viewZone&&(this.editor.changeViewZones(e=>{this._viewZone&&e.removeZone(this._viewZone.id)}),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._arrow&&this._arrow.hide()}_decoratingElementsHeight(){let e=this.editor.getOption(51),t=0;if(this.options.showArrow){t+=2*Math.round(e/3)}if(this.options.showFrame){t+=2*Math.round(e/9)}return t}_showImpl(e,t){const i=e.getStartPosition(),n=this.editor.getLayoutInfo(),o=this._getWidth(n);this.domNode.style.width=`${o}px`, +this.domNode.style.left=this._getLeft(n)+"px";const s=document.createElement("div");s.style.overflow="hidden";const r=this.editor.getOption(51),a=Math.max(12,this.editor.getLayoutInfo().height/r*.8);t=Math.min(t,a);let l=0,d=0;if(this._arrow&&this.options.showArrow&&(l=Math.round(r/3),this._arrow.height=l,this._arrow.show(i)),this.options.showFrame&&(d=Math.round(r/9)),this.editor.changeViewZones(e=>{this._viewZone&&e.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new g(s,i.lineNumber,i.column,t,e=>this._onViewZoneTop(e),e=>this._onViewZoneHeight(e)),this._viewZone.id=e.addZone(this._viewZone),this._overlayWidget=new p(u+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this.container&&this.options.showFrame){const e=this.options.frameWidth?this.options.frameWidth:d;this.container.style.borderTopWidth=e+"px", +this.container.style.borderBottomWidth=e+"px"}let c=t*r-this._decoratingElementsHeight();this.container&&(this.container.style.top=l+"px",this.container.style.height=c+"px",this.container.style.overflow="hidden"),this._doLayout(c,o),this.options.keepEditorSelection||this.editor.setSelection(e);const h=this.editor.getModel();if(h){const t=e.endLineNumber+1;t<=h.getLineCount()?this.revealLine(t,!1):this.revealLine(h.getLineCount(),!0)}}revealLine(e,t){t?this.editor.revealLineInCenter(e,0):this.editor.revealLine(e,0)}setCssClass(e,t){this.container&&(t&&this.container.classList.remove(t),i.addClass(this.container,e))}_onWidth(e){}_doLayout(e,t){}_relayout(e){this._viewZone&&this._viewZone.heightInLines!==e&&this.editor.changeViewZones(t=>{this._viewZone&&(this._viewZone.heightInLines=e,t.layoutZone(this._viewZone.id))})}_initSash(){if(this._resizeSash)return;let e;this._resizeSash=this._disposables.add(new n.Sash(this.domNode,this,{orientation:1})),this.options.isResizeable||(this._resizeSash.hide(), +this._resizeSash.state=0),this._disposables.add(this._resizeSash.onDidStart(t=>{this._viewZone&&(e={startY:t.startY,heightInLines:this._viewZone.heightInLines})})),this._disposables.add(this._resizeSash.onDidEnd(()=>{e=void 0})),this._disposables.add(this._resizeSash.onDidChange(t=>{if(e){let i=(t.currentY-e.startY)/this.editor.getOption(51),n=i<0?Math.ceil(i):Math.floor(i),o=e.heightInLines+n;o>5&&o<35&&this._relayout(o)}}))}getHorizontalSashLeft(){return 0}getHorizontalSashTop(){return(null===this.domNode.style.height?0:parseInt(this.domNode.style.height))-this._decoratingElementsHeight()/2}getHorizontalSashWidth(){const e=this.editor.getLayoutInfo();return e.width-e.minimap.minimapWidth}}})),define(t[238],i([0,1,121,18,74,224]),(function(e,t,i,n,o,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createTokenizationSupport=t.MonarchTokenizer=void 0;class r{constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}static create(e,t){return this._INSTANCE.create(e,t)}create(e,t){ +if(null!==e&&e.depth>=this._maxCacheDepth)return new a(e,t);let i=a.getStackElementId(e);i.length>0&&(i+="|"),i+=t;let n=this._entries[i];return n||(n=new a(e,t),this._entries[i]=n,n)}}r._INSTANCE=new r(5);class a{constructor(e,t){this.parent=e,this.state=t,this.depth=(this.parent?this.parent.depth:0)+1}static getStackElementId(e){let t="";for(;null!==e;)t.length>0&&(t+="|"),t+=e.state,e=e.parent;return t}static _equals(e,t){for(;null!==e&&null!==t;){if(e===t)return!0;if(e.state!==t.state)return!1;e=e.parent,t=t.parent}return null===e&&null===t}equals(e){return a._equals(this,e)}push(e){return r.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return r.create(this.parent,e)}}class l{constructor(e,t){this.modeId=e,this.state=t}equals(e){return this.modeId===e.modeId&&this.state.equals(e.state)}clone(){return this.state.clone()===this.state?this:new l(this.modeId,this.state)}}class d{constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)} +static create(e,t){return this._INSTANCE.create(e,t)}create(e,t){if(null!==t)return new c(e,t);if(null!==e&&e.depth>=this._maxCacheDepth)return new c(e,t);let i=a.getStackElementId(e),n=this._entries[i];return n||(n=new c(e,null),this._entries[i]=n,n)}}d._INSTANCE=new d(5);class c{constructor(e,t){this.stack=e,this.embeddedModeData=t}clone(){return(this.embeddedModeData?this.embeddedModeData.clone():null)===this.embeddedModeData?this:d.create(this.stack,this.embeddedModeData)}equals(e){return e instanceof c&&(!!this.stack.equals(e.stack)&&(null===this.embeddedModeData&&null===e.embeddedModeData||null!==this.embeddedModeData&&null!==e.embeddedModeData&&this.embeddedModeData.equals(e.embeddedModeData)))}}class h{constructor(){this._tokens=[],this._language=null,this._lastTokenType=null,this._lastTokenLanguage=null}enterMode(e,t){this._language=t}emit(e,t){this._lastTokenType===t&&this._lastTokenLanguage===this._language||(this._lastTokenType=t,this._lastTokenLanguage=this._language, +this._tokens.push(new i.Token(e,t,this._language)))}nestedModeTokenize(e,t,i){const o=t.modeId,s=t.state,r=n.TokenizationRegistry.get(o);if(!r)return this.enterMode(i,o),this.emit(i,""),s;let a=r.tokenize(e,s,i);return this._tokens=this._tokens.concat(a.tokens),this._lastTokenType=null,this._lastTokenLanguage=null,this._language=null,a.endState}finalize(e){return new i.TokenizationResult(this._tokens,e)}}class u{constructor(e,t){this._modeService=e,this._theme=t,this._prependTokens=null,this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0}enterMode(e,t){this._currentLanguageId=this._modeService.getLanguageIdentifier(t).id}emit(e,t){let i=this._theme.match(this._currentLanguageId,t);this._lastTokenMetadata!==i&&(this._lastTokenMetadata=i,this._tokens.push(e),this._tokens.push(i))}static _merge(e,t,i){let n=null!==e?e.length:0,o=t.length,s=null!==i?i.length:0;if(0===n&&0===o&&0===s)return new Uint32Array(0);if(0===n&&0===o)return i;if(0===o&&0===s)return e;let r=new Uint32Array(n+o+s) +;null!==e&&r.set(e);for(let e=0;e{if(s)return;let t=!1;for(let i=0,n=e.changedLanguages.length;ivoid 0)}}getInitialState(){let e=r.create(null,this._lexer.start);return d.create(e,null)}tokenize(e,t,i){let n=new h,o=this._tokenize(e,t,i,n);return n.finalize(o)}tokenize2(e,t,i){let n=new u(this._modeService,this._standaloneThemeService.getColorTheme().tokenTheme),o=this._tokenize(e,t,i,n);return n.finalize(o)}_tokenize(e,t,i,n){return t.embeddedModeData?this._nestedTokenize(e,t,i,n):this._myTokenize(e,t,i,n)}_findLeavingNestedModeOffset(e,t){let i=this._lexer.tokenizer[t.stack.state];if(!i&&!(i=s.findRules(this._lexer,t.stack.state)))throw s.createError(this._lexer,"tokenizer state is not defined: "+t.stack.state);let n=-1,o=!1 +;for(const t of i){if(!s.isIAction(t.action)||"@pop"!==t.action.nextEmbedded)continue;o=!0;let i=t.regex,r=t.regex.source;if("^(?:"===r.substr(0,4)&&")"===r.substr(r.length-1,1)){let e=(i.ignoreCase?"i":"")+(i.unicode?"u":"");i=new RegExp(r.substr(4,r.length-5),e)}let a=e.search(i);-1===a||0!==a&&t.matchOnlyAtLineStart||(-1===n||a0&&n.nestedModeTokenize(s,t.embeddedModeData,i);let r=e.substring(o);return this._myTokenize(r,t,i+o,n)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,i,n){n.enterMode(i,this._modeId);const o=e.length;let r=t.embeddedModeData,a=t.stack,l=0,c=null,h=!0;for(;h||l=o)break;h=!1;let t=this._lexer.tokenizer[m];if(!t&&!(t=s.findRules(this._lexer,m)))throw s.createError(this._lexer,"tokenizer state is not defined: "+m);let i=e.substr(l);for(const e of t)if((0===l||!e.matchOnlyAtLineStart)&&(f=i.match(e.regex))){_=f[0],v=e.action;break}}if(f||(f=[""],_=""),v||(l=this._lexer.maxStack)throw s.createError(this._lexer,"maximum tokenizer stack size reached: ["+a.state+","+a.parent.state+",...]");a=a.push(m)}else if("@pop"===v.next){if(a.depth<=1)throw s.createError(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(C));a=a.pop()}else if("@popall"===v.next)a=a.popall();else{ +let e=s.substituteMatches(this._lexer,v.next,_,f,m);if("@"===e[0]&&(e=e.substr(1)),!s.findRules(this._lexer,e))throw s.createError(this._lexer,"trying to set a next state '"+e+"' that is undefined in rule: "+this._safeRuleName(C));a=a.push(e)}}v.log&&"string"==typeof v.log&&s.log(this._lexer,this._lexer.languageId+": "+s.substituteMatches(this._lexer,v.log,_,f,m))}if(null===S)throw s.createError(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(C));const w=t=>{let s=this._modeService.getModeIdForLanguageName(t);s&&(t=s);const r=this._getNestedEmbeddedModeData(t);if(l0)throw s.createError(this._lexer,"groups cannot be nested: "+this._safeRuleName(C));if(f.length!==S.length+1)throw s.createError(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(C));let e=0 +;for(let t=1;t{const d=()=>{const c=function(e,t,i){let n=[],s=i.getInitialState();for(let l=0,d=e.length;l"),s=c.endState}return n.join("")}(e,t,i);if(i instanceof l.MonarchTokenizer){const e=i.getLoadStatus();if(!1===e.loaded)return void e.promise.then(d,s)}n(c)};d()})}function c(e,t){let i=[];const n=new Uint32Array(2);n[0]=0,n[1]=16793600;for(let s=0,l=e.length;s")}return i.join("")}t.Colorizer=class{static colorizeElement(e,t,i,n){let o=(n=n||{}).theme||"vs",s=n.mimeType||i.getAttribute("lang")||i.getAttribute("data-lang");if(!s)return console.error("Mode not detected"),Promise.resolve() +;e.setTheme(o);let r=i.firstChild?i.firstChild.nodeValue:"";i.className+=" "+o;return this.colorize(t,r||"",s,n).then(e=>{i.innerHTML=e},e=>console.error(e))}static colorize(e,t,o,r){let a=4;r&&"number"==typeof r.tabSize&&(a=r.tabSize),n.startsWithUTF8BOM(t)&&(t=t.substr(1));let l=t.split(/\r\n|\r|\n/),h=e.getModeId(o);if(!h)return Promise.resolve(c(l,a));e.triggerMode(h);const u=s.TokenizationRegistry.get(h);if(u)return d(l,a,u);const g=s.TokenizationRegistry.getPromise(h);return g?new Promise((e,t)=>{g.then(i=>{d(l,a,i).then(e,t)},t)}):new Promise((e,t)=>{let n=null,o=null;const r=()=>{n&&(n.dispose(),n=null),o&&(o.dispose(),o=null);const i=s.TokenizationRegistry.get(h);i?d(l,a,i).then(e,t):e(c(l,a))};(o=new i.TimeoutTimer).cancelAndSet(r,500),n=s.TokenizationRegistry.onDidChange(e=>{e.changedLanguages.indexOf(h)>=0&&r()})})}static colorizeLine(e,t,i,n,o=4){const s=a.ViewLineRenderingData.isBasicASCII(e,t),l=a.ViewLineRenderingData.containsRTL(e,s,i) +;return r.renderViewLine2(new r.RenderLineInput(!1,!0,e,!1,s,l,0,n,[],o,0,0,0,0,-1,"none",!1,!1,null)).html}static colorizeModelLine(e,t,i=4){let n=e.getLineContent(t);e.forceTokenization(t);let o=e.getLineTokens(t).inflate();return this.colorizeLine(n,e.mightContainNonBasicASCII(),e.mightContainRTL(),o,i)}}})),define(t[106],i([0,1,10]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IStandaloneThemeService=void 0,t.IStandaloneThemeService=i.createDecorator("themeService")})),define(t[80],i([0,1,10]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IClipboardService=void 0,t.IClipboardService=i.createDecorator("clipboardService")})),define(t[28],i([0,1,2,23,10,4,69,50]),(function(e,t,i,n,o,s,r,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommandsRegistry=t.ICommandService=void 0,t.ICommandService=o.createDecorator("commandService"),t.CommandsRegistry=new class{constructor(){this._commands=new Map, +this._onDidRegisterCommand=new s.Emitter,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(e,t){if(!e)throw new Error("invalid command");if("string"==typeof e){if(!t)throw new Error("invalid command");return this.registerCommand({id:e,handler:t})}if(e.description){const t=[];for(let i of e.description.args)t.push(i.constraint);const i=e.handler;e.handler=function(e,...o){return n.validateConstraints(o,t),i(e,...o)}}const{id:o}=e;let s=this._commands.get(o);s||(s=new r.LinkedList,this._commands.set(o,s));let a=s.unshift(e),l=i.toDisposable(()=>{a();const e=this._commands.get(o);(null==e?void 0:e.isEmpty())&&this._commands.delete(o)});return this._onDidRegisterCommand.fire(o),l}registerCommandAlias(e,i){return t.CommandsRegistry.registerCommand(e,(e,...n)=>e.get(t.ICommandService).executeCommand(i,...n))}getCommand(e){const t=this._commands.get(e);if(t&&!t.isEmpty())return a.Iterable.first(t)}getCommands(){const e=new Map;for(const t of this._commands.keys()){const i=this.getCommand(t) +;i&&e.set(t,i)}return e}}})),define(t[524],i([0,1,24,3,44,25,92,237,28,23,50]),(function(e,t,i,n,o,s,a,l,d,c,h){"use strict";function u(e,t,i){return r(this,void 0,void 0,(function*(){const n=yield l.OutlineModel.create(e,i),o=[];for(const e of n.children.values())e instanceof l.OutlineElement?o.push(e.symbol):o.push(...h.Iterable.map(e.children.values(),e=>e.symbol));let s=[];return i.isCancellationRequested?s:(t?function e(t,i,n){for(let o of i)t.push({kind:o.kind,tags:o.tags,name:o.name,detail:o.detail,containerName:o.containerName||n,range:o.range,selectionRange:o.selectionRange,children:void 0}),o.children&&e(t,o.children,o.name)}(s,o,""):s=o,s.sort(g))}))}function g(e,t){return n.Range.compareRangesUsingStarts(e.range,t.range)}Object.defineProperty(t,"__esModule",{value:!0}),t.getDocumentSymbols=void 0,t.getDocumentSymbols=u,d.CommandsRegistry.registerCommand("_executeDocumentSymbolProvider",(function(e,...t){return r(this,void 0,void 0,(function*(){const[n]=t;c.assertType(i.URI.isUri(n)) +;const r=e.get(o.IModelService).getModel(n);if(r)return u(r,!1,s.CancellationToken.None);const l=yield e.get(a.ITextModelService).createModelReference(n);try{return yield u(l.object.textEditorModel,!1,s.CancellationToken.None)}finally{l.dispose()}}))}))})),define(t[525],i([0,1,25,12,24,3,18,44,28,2,19]),(function(e,t,i,n,o,s,a,l,d,c,h){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getLinks=t.LinksList=t.Link=void 0;class u{constructor(e,t){this._link=e,this._provider=t}toJSON(){return{range:this.range,url:this.url,tooltip:this.tooltip}}get range(){return this._link.range}get url(){return this._link.url}get tooltip(){return this._link.tooltip}resolve(e){return r(this,void 0,void 0,(function*(){return this._link.url?this._link.url:"function"==typeof this._provider.resolveLink?Promise.resolve(this._provider.resolveLink(this._link,e)).then(t=>(this._link=t||this._link,this._link.url?this.resolve(e):Promise.reject(new Error("missing")))):Promise.reject(new Error("missing"))}))}}t.Link=u +;class g extends c.Disposable{constructor(e){super();let t=[];for(const[i,n]of e){const e=i.links.map(e=>new u(e,n));t=g._union(t,e),c.isDisposable(i)&&this._register(i)}this.links=t}static _union(e,t){let i,n,o,r,a=[];for(i=0,o=0,n=e.length,r=t.length;iPromise.resolve(o.provideLinks(e,t)).then(e=>{e&&(i[s]=[e,o])},n.onUnexpectedExternalError));return Promise.all(o).then(()=>{const e=new g(h.coalesce(i));return t.isCancellationRequested?(e.dispose(),new g([])):e})}t.LinksList=g,t.getLinks=p,d.CommandsRegistry.registerCommand("_executeLinkProvider",(e,...t)=>r(void 0,void 0,void 0,(function*(){const[n]=t;if(!(n instanceof o.URI))return[];const s=e.get(l.IModelService).getModel(n);if(!s)return[] +;const r=yield p(s,i.CancellationToken.None);if(!r)return[];const a=r.links.slice(0);return r.dispose(),a})))})),define(t[17],i([0,1,8,10,16]),(function(e,t,i,n,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SET_CONTEXT_COMMAND_ID=t.IContextKeyService=t.RawContextKey=t.ContextKeyOrExpr=t.ContextKeyAndExpr=t.ContextKeyNotRegexExpr=t.ContextKeyRegexExpr=t.ContextKeyNotExpr=t.ContextKeyNotEqualsExpr=t.ContextKeyNotInExpr=t.ContextKeyInExpr=t.ContextKeyEqualsExpr=t.ContextKeyDefinedExpr=t.ContextKeyTrueExpr=t.ContextKeyFalseExpr=t.ContextKeyExpr=void 0;const s=new Map;s.set("false",!1),s.set("true",!0),s.set("isMac",o.isMacintosh),s.set("isLinux",o.isLinux),s.set("isWindows",o.isWindows),s.set("isWeb",o.isWeb),s.set("isMacNative",o.isMacintosh&&!o.isWeb);const r=Object.prototype.hasOwnProperty;class a{static has(e){return h.create(e)}static equals(e,t){return u.create(e,t)}static regex(e,t){return _.create(e,t)}static not(e){return f.create(e)}static and(...e){return C.create(e)} +static or(...e){return b.create(e)}static deserialize(e,t=!1){if(e)return this._deserializeOrExpression(e,t)}static _deserializeOrExpression(e,t){let i=e.split("||");return b.create(i.map(e=>this._deserializeAndExpression(e,t)))}static _deserializeAndExpression(e,t){let i=e.split("&&");return C.create(i.map(e=>this._deserializeOne(e,t)))}static _deserializeOne(e,t){if((e=e.trim()).indexOf("!=")>=0){let i=e.split("!=");return m.create(i[0].trim(),this._deserializeValue(i[1],t))}if(e.indexOf("==")>=0){let i=e.split("==");return u.create(i[0].trim(),this._deserializeValue(i[1],t))}if(e.indexOf("=~")>=0){let i=e.split("=~");return _.create(i[0].trim(),this._deserializeRegexValue(i[1],t))}if(e.indexOf(" in ")>=0){let t=e.split(" in ");return g.create(t[0].trim(),t[1].trim())}return/^\!\s*/.test(e)?f.create(e.substr(1).trim()):h.create(e)}static _deserializeValue(e,t){if("true"===(e=e.trim()))return!0;if("false"===e)return!1;let i=/^'([^']*)'$/.exec(e);return i?i[1].trim():e}static _deserializeRegexValue(e,t){ +if(i.isFalsyOrWhitespace(e)){if(t)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let n=e.indexOf("/"),o=e.lastIndexOf("/");if(n===o||n<0){if(t)throw new Error(`bad regexp-value '${e}', missing /-enclosure`);return console.warn(`bad regexp-value '${e}', missing /-enclosure`),null}let s=e.slice(n+1,o),r="i"===e[o+1]?"i":"";try{return new RegExp(s,r)}catch(i){if(t)throw new Error(`bad regexp-value '${e}', parse error: ${i}`);return console.warn(`bad regexp-value '${e}', parse error: ${i}`),null}}}function l(e,t){return e.cmp(t)}t.ContextKeyExpr=a;class d{constructor(){this.type=0}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}evaluate(e){return!1}serialize(){return"false"}keys(){return[]}negate(){return c.INSTANCE}}t.ContextKeyFalseExpr=d,d.INSTANCE=new d;class c{constructor(){this.type=1}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}evaluate(e){return!0}serialize(){return"true"}keys(){return[]} +negate(){return d.INSTANCE}}t.ContextKeyTrueExpr=c,c.INSTANCE=new c;class h{constructor(e){this.key=e,this.type=2}static create(e){const t=s.get(e);return"boolean"==typeof t?t?c.INSTANCE:d.INSTANCE:new h(e)}cmp(e){return e.type!==this.type?this.type-e.type:this.keye.key?1:0}equals(e){return e.type===this.type&&this.key===e.key}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return f.create(this.key)}}t.ContextKeyDefinedExpr=h;class u{constructor(e,t){this.key=e,this.value=t,this.type=4}static create(e,t){if("boolean"==typeof t)return t?h.create(e):f.create(e);const i=s.get(e);if("boolean"==typeof i){return t===(i?"true":"false")?c.INSTANCE:d.INSTANCE}return new u(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:this.keye.key?1:this.valuee.value?1:0}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}evaluate(e){return e.getValue(this.key)==this.value}serialize(){ +return this.key+" == '"+this.value+"'"}keys(){return[this.key]}negate(){return m.create(this.key,this.value)}}t.ContextKeyEqualsExpr=u;class g{constructor(e,t){this.key=e,this.valueKey=t,this.type=10}static create(e,t){return new g(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:this.keye.key?1:this.valueKeye.valueKey?1:0}equals(e){return e.type===this.type&&(this.key===e.key&&this.valueKey===e.valueKey)}evaluate(e){const t=e.getValue(this.valueKey),i=e.getValue(this.key);return Array.isArray(t)?t.indexOf(i)>=0:"string"==typeof i&&"object"==typeof t&&null!==t&&r.call(t,i)}serialize(){return this.key+" in '"+this.valueKey+"'"}keys(){return[this.key,this.valueKey]}negate(){return p.create(this)}}t.ContextKeyInExpr=g;class p{constructor(e){this._actual=e,this.type=11}static create(e){return new p(e)}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type&&this._actual.equals(e._actual)}evaluate(e){ +return!this._actual.evaluate(e)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}t.ContextKeyNotInExpr=p;class m{constructor(e,t){this.key=e,this.value=t,this.type=5}static create(e,t){if("boolean"==typeof t)return t?f.create(e):h.create(e);const i=s.get(e);if("boolean"==typeof i){return t===(i?"true":"false")?d.INSTANCE:c.INSTANCE}return new m(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:this.keye.key?1:this.valuee.value?1:0}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}evaluate(e){return e.getValue(this.key)!=this.value}serialize(){return this.key+" != '"+this.value+"'"}keys(){return[this.key]}negate(){return u.create(this.key,this.value)}}t.ContextKeyNotEqualsExpr=m;class f{constructor(e){this.key=e,this.type=3}static create(e){const t=s.get(e);return"boolean"==typeof t?t?d.INSTANCE:c.INSTANCE:new f(e)}cmp(e){ +return e.type!==this.type?this.type-e.type:this.keye.key?1:0}equals(e){return e.type===this.type&&this.key===e.key}evaluate(e){return!e.getValue(this.key)}serialize(){return"!"+this.key}keys(){return[this.key]}negate(){return h.create(this.key)}}t.ContextKeyNotExpr=f;class _{constructor(e,t){this.key=e,this.regexp=t,this.type=7}static create(e,t){return new _(e,t)}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.keye.key)return 1;const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return ti?1:0}equals(e){if(e.type===this.type){const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return this.key===e.key&&t===i}return!1}evaluate(e){let t=e.getValue(this.key);return!!this.regexp&&this.regexp.test(t)}serialize(){const e=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${e}`}keys(){return[this.key]}negate(){return v.create(this)}}t.ContextKeyRegexExpr=_ +;class v{constructor(e){this._actual=e,this.type=8}static create(e){return new v(e)}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type&&this._actual.equals(e._actual)}evaluate(e){return!this._actual.evaluate(e)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}t.ContextKeyNotRegexExpr=v;class C{constructor(e){this.expr=e,this.type=6}static create(e){return C._normalizeArr(e)}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.lengthe.expr.length)return 1;for(let t=0,i=this.expr.length;t1;){const e=t[t.length-1];if(9!==e.type)break;t.pop();const i=t.pop(),n=b.create(e.expr.map(e=>C.create([e,i])));n&&(t.push(n),t.sort(l))}return new C(t)}}serialize(){return this.expr.map(e=>e.serialize()).join(" && ")}keys(){const e=[];for(let t of this.expr)e.push(...t.keys());return e}negate(){let e=[];for(let t of this.expr)e.push(t.negate());return b.create(e)}}t.ContextKeyAndExpr=C;class b{constructor(e){this.expr=e,this.type=9}static create(e){const t=b._normalizeArr(e);if(0!==t.length)return 1===t.length?t[0]:new b(t)}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.lengthe.expr.length)return 1;for(let t=0,i=this.expr.length;te.serialize()).join(" || ")}keys(){const e=[];for(let t of this.expr)e.push(...t.keys());return e}negate(){let e=[];for(let t of this.expr)e.push(t.negate());const t=e=>9===e.type?e.expr:[e];for(;e.length>1;){const i=e.shift(),n=e.shift(),o=[];for(const e of t(i))for(const i of t(n))o.push(a.and(e,i));e.unshift(a.or(...o))}return e[0]}}t.ContextKeyOrExpr=b;t.RawContextKey=class extends h{constructor(e,t){super(e), +this._defaultValue=t}bindTo(e){return e.createKey(this.key,this._defaultValue)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return a.not(this.key)}},t.IContextKeyService=n.createDecorator("contextKeyService"),t.SET_CONTEXT_COMMAND_ID="setContext"})),define(t[22],i([0,1,17]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditorContextKeys=void 0,function(e){e.editorSimpleInput=new i.RawContextKey("editorSimpleInput",!1),e.editorTextFocus=new i.RawContextKey("editorTextFocus",!1),e.focus=new i.RawContextKey("editorFocus",!1),e.textInputFocus=new i.RawContextKey("textInputFocus",!1),e.readOnly=new i.RawContextKey("editorReadonly",!1),e.columnSelection=new i.RawContextKey("editorColumnSelection",!1),e.writable=e.readOnly.toNegated(),e.hasNonEmptySelection=new i.RawContextKey("editorHasSelection",!1),e.hasOnlyEmptySelection=e.hasNonEmptySelection.toNegated(),e.hasMultipleSelections=new i.RawContextKey("editorHasMultipleSelections",!1), +e.hasSingleSelection=e.hasMultipleSelections.toNegated(),e.tabMovesFocus=new i.RawContextKey("editorTabMovesFocus",!1),e.tabDoesNotMoveFocus=e.tabMovesFocus.toNegated(),e.isInWalkThroughSnippet=new i.RawContextKey("isInEmbeddedEditor",!1),e.canUndo=new i.RawContextKey("canUndo",!1),e.canRedo=new i.RawContextKey("canRedo",!1),e.hoverVisible=new i.RawContextKey("editorHoverVisible",!1),e.inCompositeEditor=new i.RawContextKey("inCompositeEditor",void 0),e.notInCompositeEditor=e.inCompositeEditor.toNegated(),e.languageId=new i.RawContextKey("editorLangId",""),e.hasCompletionItemProvider=new i.RawContextKey("editorHasCompletionItemProvider",!1),e.hasCodeActionsProvider=new i.RawContextKey("editorHasCodeActionsProvider",!1),e.hasCodeLensProvider=new i.RawContextKey("editorHasCodeLensProvider",!1),e.hasDefinitionProvider=new i.RawContextKey("editorHasDefinitionProvider",!1),e.hasDeclarationProvider=new i.RawContextKey("editorHasDeclarationProvider",!1), +e.hasImplementationProvider=new i.RawContextKey("editorHasImplementationProvider",!1),e.hasTypeDefinitionProvider=new i.RawContextKey("editorHasTypeDefinitionProvider",!1),e.hasHoverProvider=new i.RawContextKey("editorHasHoverProvider",!1),e.hasDocumentHighlightProvider=new i.RawContextKey("editorHasDocumentHighlightProvider",!1),e.hasDocumentSymbolProvider=new i.RawContextKey("editorHasDocumentSymbolProvider",!1),e.hasReferenceProvider=new i.RawContextKey("editorHasReferenceProvider",!1),e.hasRenameProvider=new i.RawContextKey("editorHasRenameProvider",!1),e.hasSignatureHelpProvider=new i.RawContextKey("editorHasSignatureHelpProvider",!1),e.hasDocumentFormattingProvider=new i.RawContextKey("editorHasDocumentFormattingProvider",!1),e.hasDocumentSelectionFormattingProvider=new i.RawContextKey("editorHasDocumentSelectionFormattingProvider",!1),e.hasMultipleDocumentFormattingProvider=new i.RawContextKey("editorHasMultipleDocumentFormattingProvider",!1), +e.hasMultipleDocumentSelectionFormattingProvider=new i.RawContextKey("editorHasMultipleDocumentSelectionFormattingProvider",!1)}(t.EditorContextKeys||(t.EditorContextKeys={}))}));var l=this&&this.__param||function(e,t){return function(i,n){t(i,n,e)}};define(t[526],i([0,1,2,17]),(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SuggestAlternatives=void 0;let o=class e{constructor(t,i){this._editor=t,this._index=0,this._ckOtherSuggestions=e.OtherSuggestions.bindTo(i)}dispose(){this.reset()}reset(){this._ckOtherSuggestions.reset(),i.dispose(this._listener),this._model=void 0,this._acceptNext=void 0,this._ignore=!1}set({model:t,index:i},n){if(0===t.items.length)return void this.reset();e._moveIndex(!0,t,i)!==i?(this._acceptNext=n,this._model=t,this._index=i,this._listener=this._editor.onDidChangeCursorPosition(()=>{this._ignore||this.reset()}),this._ckOtherSuggestions.set(!0)):this.reset()}static _moveIndex(e,t,i){let n=i +;for(;(n=(n+t.items.length+(e?1:-1))%t.items.length)!==i&&t.items[n].completion.additionalTextEdits;);return n}next(){this._move(!0)}prev(){this._move(!1)}_move(t){if(this._model)try{this._ignore=!0,this._index=e._moveIndex(t,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}};o.OtherSuggestions=new n.RawContextKey("hasOtherSuggestions",!1),o=a([l(1,n.IContextKeyService)],o),t.SuggestAlternatives=o})),define(t[527],i([0,1,17,2]),(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WordContextKey=void 0;let o=class e extends n.Disposable{constructor(t,i){super(),this._editor=t,this._enabled=!1,this._ckAtEnd=e.AtEnd.bindTo(i),this._register(this._editor.onDidChangeConfiguration(e=>e.hasChanged(101)&&this._update())),this._update()}dispose(){super.dispose(),n.dispose(this._selectionListener),this._ckAtEnd.reset()}_update(){const e="on"===this._editor.getOption(101) +;if(this._enabled!==e)if(this._enabled=e,this._enabled){const e=()=>{if(!this._editor.hasModel())return void this._ckAtEnd.set(!1);const e=this._editor.getModel(),t=this._editor.getSelection(),i=e.getWordAtPosition(t.getStartPosition());i?this._ckAtEnd.set(i.endColumn===t.getStartPosition().column):this._ckAtEnd.set(!1)};this._selectionListener=this._editor.onDidChangeCursorSelection(e),e()}else this._selectionListener&&(this._ckAtEnd.reset(),this._selectionListener.dispose(),this._selectionListener=void 0)}};o.AtEnd=new i.RawContextKey("atEndOfWord",!1),o=a([l(1,i.IContextKeyService)],o),t.WordContextKey=o})),define(t[62],i([0,1,10,17]),(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CONTEXT_ACCESSIBILITY_MODE_ENABLED=t.IAccessibilityService=void 0,t.IAccessibilityService=i.createDecorator("accessibilityService"),t.CONTEXT_ACCESSIBILITY_MODE_ENABLED=new n.RawContextKey("accessibilityModeEnabled",!1)})), +define(t[33],i([0,1,47,10,17,28,2,4,50,69]),(function(e,t,i,n,o,s,r,d,c,h){"use strict";function u(e){return void 0!==e.command}Object.defineProperty(t,"__esModule",{value:!0}),t.MenuItemAction=t.SubmenuItemAction=t.ExecuteCommandAction=t.MenuRegistry=t.IMenuService=t.MenuId=t.isIMenuItem=void 0,t.isIMenuItem=u;class g{constructor(e){this.id=g._idPool++,this._debugName=e}}t.MenuId=g,g._idPool=0,g.CommandPalette=new g("CommandPalette"),g.EditorContext=new g("EditorContext"),g.EditorContextPeek=new g("EditorContextPeek"),g.MenubarEditMenu=new g("MenubarEditMenu"),g.MenubarGoMenu=new g("MenubarGoMenu"),g.MenubarSelectionMenu=new g("MenubarSelectionMenu"),t.IMenuService=n.createDecorator("menuService"),t.MenuRegistry=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new d.Emitter,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:e=>e===g.CommandPalette}}addCommand(e){return this.addCommands(c.Iterable.single(e))}addCommands(e){ +for(const t of e)this._commands.set(t.id,t);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),r.toDisposable(()=>{let t=!1;for(const i of e)t=this._commands.delete(i.id)||t;t&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(e){return this._commands.get(e)}getCommands(){const e=new Map;return this._commands.forEach((t,i)=>e.set(i,t)),e}appendMenuItem(e,t){return this.appendMenuItems(c.Iterable.single({id:e,item:t}))}appendMenuItems(e){const t=new Set,i=new h.LinkedList;for(const{id:n,item:o}of e){let e=this._menuItems.get(n);e||(e=new h.LinkedList,this._menuItems.set(n,e)),i.push(e.push(o)),t.add(n)}return this._onDidChangeMenu.fire(t),r.toDisposable(()=>{if(i.size>0){for(let e of i)e();this._onDidChangeMenu.fire(t),i.clear()}})}getMenuItems(e){let t;return t=this._menuItems.has(e)?[...this._menuItems.get(e)]:[],e===g.CommandPalette&&this._appendImplicitItems(t),t}_appendImplicitItems(e){const t=new Set;for(const i of e)u(i)&&(t.add(i.command.id), +i.alt&&t.add(i.alt.id));this._commands.forEach((i,n)=>{t.has(n)||e.push({command:i})})}};let p=class extends i.Action{constructor(e,t,i){super(e,t),this._commandService=i}run(...e){return this._commandService.executeCommand(this.id,...e)}};p=a([l(2,s.ICommandService)],p),t.ExecuteCommandAction=p;class m extends i.SubmenuAction{constructor(e,t,n,o){super(`submenuitem.${e.submenu.id}`,"string"==typeof e.title?e.title:e.title.value,()=>{const s=[],r=t.createMenu(e.submenu,n),a=r.getActions(o);r.dispose();for(let e of a){const[,t]=e;t.length>0&&(s.push(...t),s.push(new i.Separator))}return s.length&&s.pop(),s},"submenu"),this.item=e}}t.SubmenuItemAction=m;let f=class e extends p{constructor(t,i,n,o,s){if("string"==typeof t.title?super(t.id,t.title,s):super(t.id,t.title.value,s),this._cssClass=void 0,this._enabled=!t.precondition||o.contextMatchesRules(t.precondition),this._tooltip=t.tooltip?"string"==typeof t.tooltip?t.tooltip:t.tooltip.value:void 0,t.toggled){const e=t.toggled.condition?t.toggled:{ +condition:t.toggled};this._checked=o.contextMatchesRules(e.condition),this._checked&&e.tooltip&&(this._tooltip="string"==typeof e.tooltip?e.tooltip:e.tooltip.value)}this._options=n||{},this.item=t,this.alt=i?new e(i,void 0,this._options,o,s):void 0}dispose(){this.alt&&this.alt.dispose(),super.dispose()}run(...e){let t=[];return this._options.arg&&(t=[...t,this._options.arg]),this._options.shouldForwardArgs&&(t=[...t,...e]),super.run(...t)}};f=a([l(3,o.IContextKeyService),l(4,s.ICommandService)],f),t.MenuItemAction=f})),define(t[528],i([0,1,4,2,33,28,17]),(function(e,t,i,n,o,s,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MenuService=void 0;let d=class{constructor(e){this._commandService=e}createMenu(e,t){return new c(e,this._commandService,t,this)}};d=a([l(0,s.ICommandService)],d),t.MenuService=d;let c=class e{constructor(e,t,s,r){this._id=e,this._commandService=t,this._contextKeyService=s,this._menuService=r,this._onDidChange=new i.Emitter,this._dispoables=new n.DisposableStore, +this._menuGroups=[],this._contextKeys=new Set,this._build(),this._dispoables.add(i.Event.debounce(i.Event.filter(o.MenuRegistry.onDidChangeMenu,e=>e.has(this._id)),()=>{},50)(this._build,this)),this._dispoables.add(i.Event.debounce(this._contextKeyService.onDidChangeContext,(e,t)=>e||t.affectsSome(this._contextKeys),50)(e=>e&&this._onDidChange.fire(void 0),this))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}_build(){this._menuGroups.length=0,this._contextKeys.clear();const t=o.MenuRegistry.getMenuItems(this._id);let i;t.sort(e._compareMenuItems);for(let n of t){const t=n.group||"";if(i&&i[0]===t||(i=[t,[]],this._menuGroups.push(i)),i[1].push(n),e._fillInKbExprKeys(n.when,this._contextKeys),o.isIMenuItem(n)&&n.command.precondition&&e._fillInKbExprKeys(n.command.precondition,this._contextKeys),o.isIMenuItem(n)&&n.command.toggled){const t=n.command.toggled.condition||n.command.toggled;e._fillInKbExprKeys(t,this._contextKeys)}}this._onDidChange.fire(this)}get onDidChange(){ +return this._onDidChange.event}getActions(e){const t=[];for(let i of this._menuGroups){const[n,s]=i,r=[];for(const t of s)if(this._contextKeyService.contextMatchesRules(t.when)){const i=o.isIMenuItem(t)?new o.MenuItemAction(t.command,t.alt,e,this._contextKeyService,this._commandService):new o.SubmenuItemAction(t,this._menuService,this._contextKeyService,e);r.push(i)}r.length>0&&t.push([n,r])}return t}static _fillInKbExprKeys(e,t){if(e)for(let i of e.keys())t.add(i)}static _compareMenuItems(t,i){let n=t.group,s=i.group;if(n!==s){if(!n)return 1;if(!s)return-1;if("navigation"===n)return-1;if("navigation"===s)return 1;let e=n.localeCompare(s);if(0!==e)return e}let r=t.order||0,a=i.order||0;return ra?1:e._compareTitles(o.isIMenuItem(t)?t.command.title:t.title,o.isIMenuItem(i)?i.command.title:i.title)}static _compareTitles(e,t){const i="string"==typeof e?e:e.value,n="string"==typeof t?t:t.value;return i.localeCompare(n)}};c=a([l(1,s.ICommandService),l(2,r.IContextKeyService),l(3,o.IMenuService)],c)})), +define(t[66],i([0,1,10]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IContextMenuService=t.IContextViewService=void 0,t.IContextViewService=i.createDecorator("contextViewService"),t.IContextMenuService=i.createDecorator("contextMenuService")})),define(t[173],i([0,1,10]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IDialogService=void 0,t.IDialogService=i.createDecorator("dialogService")})),define(t[131],i([0,1]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ServiceCollection=void 0;t.ServiceCollection=class{constructor(...e){this._entries=new Map;for(let[t,i]of e)this.set(t,i)}set(e,t){const i=this._entries.get(e);return this._entries.set(e,t),i}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}}})),define(t[529],i([0,1,12,509,230,10,131,15]),(function(e,t,i,n,o,s,r,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InstantiationService=void 0;const l=!1 +;class d extends Error{constructor(e){super("cyclic dependency between services"),this.message=e.toString()}}class c{constructor(e=new r.ServiceCollection,t=!1,i){this._services=e,this._strict=t,this._parent=i,this._services.set(s.IInstantiationService,this)}createChild(e){return new c(e,this._strict,this)}invokeFunction(e,...t){let n=h.traceInvocation(e),o=!1;try{return e({get:(e,t)=>{if(o)throw i.illegalState("service accessor is only valid during the invocation of its target method");const r=this._getOrCreateServiceInstance(e,n);if(!r&&t!==s.optional)throw new Error(`[invokeFunction] unknown service '${e}'`);return r}},...t)}finally{o=!0,n.stop()}}createInstance(e,...t){let i,n;return e instanceof o.SyncDescriptor?(i=h.traceCreation(e.ctor),n=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=h.traceCreation(e),n=this._createInstance(e,t,i)),i.stop(),n}_createInstance(e,t=[],i){let n=s._util.getServiceDependencies(e).sort((e,t)=>e.index-t.index),o=[];for(const t of n){ +let n=this._getOrCreateServiceInstance(t.id,i);if(!n&&this._strict&&!t.optional)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${t.id}.`);o.push(n)}let r=n.length>0?n[0].index:t.length;if(t.length!==r){console.warn(`[createInstance] First service dependency of ${e.name} at position ${r+1} conflicts with ${t.length} static arguments`);let i=r-t.length;t=i>0?t.concat(new Array(i)):t.slice(0,r)}return new e(...[...t,...o])}_setServiceInstance(e,t){if(this._services.get(e)instanceof o.SyncDescriptor)this._services.set(e,t);else{if(!this._parent)throw new Error("illegalState - setting UNKNOWN service instance");this._parent._setServiceInstance(e,t)}}_getServiceInstanceOrDescriptor(e){let t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){let i=this._getServiceInstanceOrDescriptor(e);return i instanceof o.SyncDescriptor?this._createAndCacheServiceInstance(e,i,t.branch(e,!0)):(t.branch(e,!1),i)} +_createAndCacheServiceInstance(e,t,i){const r=new n.Graph(e=>e.id.toString());let a=0;const l=[{id:e,desc:t,_trace:i}];for(;l.length;){const t=l.pop();if(r.lookupOrInsertNode(t),a++>1e3)throw new d(r);for(let i of s._util.getServiceDependencies(t.desc.ctor)){let n=this._getServiceInstanceOrDescriptor(i.id);if(n||i.optional||console.warn(`[createInstance] ${e} depends on ${i.id} which is NOT registered.`),n instanceof o.SyncDescriptor){const e={id:i.id,desc:n,_trace:t._trace.branch(i.id,!0)};r.insertEdge(t,e),l.push(e)}}}for(;;){const e=r.roots();if(0===e.length){if(!r.isEmpty())throw new d(r);break}for(const{data:t}of e){const e=this._createServiceInstanceWithOwner(t.id,t.desc.ctor,t.desc.staticArguments,t.desc.supportsDelayedInstantiation,t._trace);this._setServiceInstance(t.id,e),r.removeNode(t)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],n,s){if(this._services.get(e)instanceof o.SyncDescriptor)return this._createServiceInstance(t,i,n,s) +;if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,i,n,s);throw new Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(e,t=[],i,n){if(i){const i=new a.IdleValue(()=>this._createInstance(e,t,n));return new Proxy(Object.create(null),{get(e,t){if(t in e)return e[t];let n=i.value,o=n[t];return"function"!=typeof o?o:(o=o.bind(n),e[t]=o,o)},set:(e,t,n)=>(i.value[t]=n,!0)})}return this._createInstance(e,t,n)}}t.InstantiationService=c;class h{constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}static traceInvocation(e){return l?new h(1,e.name||e.toString().substring(0,42).replace(/\n/g,"")):h._None}static traceCreation(e){return l?new h(0,e.name):h._None}branch(e,t){let i=new h(2,e.toString());return this._dep.push([e,t,i]),i}stop(){let e=Date.now()-this._start;h._totals+=e;let t=!1;let i=[`${0===this.type?"CREATE":"CALL"} ${this.name}`,`${function e(i,n){let o=[],s=new Array(i+1).join("\t");for(const[r,a,l]of n._dep)if(a&&l){t=!0, +o.push(`${s}CREATES -> ${r}`);let n=e(i+1,l);n&&o.push(n)}else o.push(`${s}uses -> ${r}`);return o.join("\n")}(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${h._totals.toFixed(2)}ms)`];(e>2||t)&&console.log(i.join("\n"))}}h._None=new class extends h{constructor(){super(-1,null)}stop(){}branch(){return this}},h._totals=0})),define(t[530],i([0,1,498,19,15,4,2]),(function(e,t,i,n,o,s,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractKeybindingService=void 0;class a extends r.Disposable{constructor(e,t,i,n,r){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=i,this._notificationService=n,this._logService=r,this._onDidUpdateKeybindings=this._register(new s.Emitter),this._currentChord=null,this._currentChordChecker=new o.IntervalTimer,this._currentChordStatusMessage=null,this._logging=!1}get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:s.Event.None}dispose(){super.dispose()}_log(e){ +this._logging&&this._logService.info(`[KeybindingService]: ${e}`)}getKeybindings(){return this._getResolver().getKeybindings()}lookupKeybindings(e){return n.coalesce(this._getResolver().lookupKeybindings(e).map(e=>e.resolvedKeybinding))}lookupKeybinding(e){const t=this._getResolver().lookupPrimaryKeybinding(e);if(t)return t.resolvedKeybinding}dispatchEvent(e,t){return this._dispatch(e,t)}softDispatch(e,t){const i=this.resolveKeyboardEvent(e);if(i.isChord())return console.warn("Unexpected keyboard event mapped to a chord"),null;const[n]=i.getDispatchParts();if(null===n)return null;const o=this._contextKeyService.getContext(t),s=this._currentChord?this._currentChord.keypress:null;return this._getResolver().resolve(o,s,n)}_enterChordMode(e,t){this._currentChord={keypress:e,label:t},this._currentChordStatusMessage=this._notificationService.status(i.localize(0,null,t));const n=Date.now();this._currentChordChecker.cancelAndSet(()=>{ +this._documentHasFocus()?Date.now()-n>5e3&&this._leaveChordMode():this._leaveChordMode()},500)}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChord=null}_dispatch(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t)}_doDispatch(e,t){let n=!1;if(e.isChord())return console.warn("Unexpected keyboard event mapped to a chord"),!1;const[o]=e.getDispatchParts();if(null===o)return this._log("\\ Keyboard event cannot be dispatched."),n;const s=this._contextKeyService.getContext(t),r=this._currentChord?this._currentChord.keypress:null,a=e.getLabel(),l=this._getResolver().resolve(s,r,o);return this._logService.trace("KeybindingService#dispatch",a,null==l?void 0:l.commandId),l&&l.enterChord?(n=!0,this._enterChordMode(o,a),n):(this._currentChord&&(l&&l.commandId||(this._notificationService.status(i.localize(1,null,this._currentChord.label,a),{hideAfter:1e4}),n=!0)), +this._leaveChordMode(),l&&l.commandId&&(l.bubble||(n=!0),void 0===l.commandArgs?this._commandService.executeCommand(l.commandId).then(void 0,e=>this._notificationService.warn(e)):this._commandService.executeCommand(l.commandId,l.commandArgs).then(void 0,e=>this._notificationService.warn(e)),this._telemetryService.publicLog2("workbenchActionExecuted",{id:l.commandId,from:"keybinding"})),n)}mightProducePrintableCharacter(e){return!e.ctrlKey&&!e.metaKey&&(e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30)}}t.AbstractKeybindingService=a})),define(t[531],i([0,1,12,227,39]),(function(e,t,i,n,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseResolvedKeybinding=void 0;class s extends o.ResolvedKeybinding{constructor(e,t){if(super(),0===t.length)throw i.illegalArgument("parts");this._os=e,this._parts=t}getLabel(){return n.UILabelProvider.toLabel(this._os,this._parts,e=>this._getLabel(e))}getAriaLabel(){return n.AriaLabelProvider.toLabel(this._os,this._parts,e=>this._getAriaLabel(e))} +isChord(){return this._parts.length>1}getParts(){return this._parts.map(e=>this._getPart(e))}_getPart(e){return new o.ResolvedKeybindingPart(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getLabel(e),this._getAriaLabel(e))}getDispatchParts(){return this._parts.map(e=>this._getDispatchPart(e))}}t.BaseResolvedKeybinding=s})),define(t[35],i([0,1,10]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IKeybindingService=void 0,t.IKeybindingService=i.createDecorator("keybindingService")})),define(t[239],i([0,1]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeybindingResolver=void 0;class i{constructor(e,t,n){this._log=n,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(let t=0,i=e.length;t=0;i--)this._isTargetedForRemoval(e[i],o,s,t,r)&&e.splice(i,1)}return e.concat(i)}_addKeyPress(e,t){const n=this._map.get(e);if(void 0===n)return this._map.set(e,[t]),void this._addToLookupMap(t);for(let e=n.length-1;e>=0;e--){let o=n[e];if(o.command===t.command)continue;const s=o.keypressParts.length>1,r=t.keypressParts.length>1;s&&r&&o.keypressParts[1]!==t.keypressParts[1]||i.whenIsEntirelyIncluded(o.when,t.when)&&this._removeFromLookupMap(o)}n.push(t), +this._addToLookupMap(t)}_addToLookupMap(e){if(!e.command)return;let t=this._lookupMap.get(e.command);void 0===t?(t=[e],this._lookupMap.set(e.command,t)):t.push(e)}_removeFromLookupMap(e){if(!e.command)return;let t=this._lookupMap.get(e.command);if(void 0!==t)for(let i=0,n=t.length;i9===e.type?e.expr:[e];let n=i(e.negate()).concat(i(t));for(let e=0;e=0;e--)i[n++]=t[e];return i}lookupPrimaryKeybinding(e){let t=this._lookupMap.get(e);return void 0===t||0===t.length?null:t[t.length-1]}resolve(e,t,i){this._log(`| Resolving ${i}${t?` chorded from ${t}`:""}`);let s=null;if(null!==t){ +const e=this._map.get(t);if(void 0===e)return this._log("\\ No keybinding entries."),null;s=[];for(let t=0,n=e.length;t1&&null!==r.keypressParts[1]?(this._log(`\\ From ${s.length} keybinding entries, matched chord, when: ${n(r.when)}, source: ${o(r)}.`),{enterChord:!0,leaveChord:!1,commandId:null,commandArgs:null,bubble:!1}):(this._log(`\\ From ${s.length} keybinding entries, matched ${r.command}, when: ${n(r.when)}, source: ${o(r)}.`),{enterChord:!1,leaveChord:r.keypressParts.length>1,commandId:r.command,commandArgs:r.commandArgs,bubble:r.bubble}):(this._log(`\\ From ${s.length} keybinding entries, no when clauses matched the context.`),null)}_findCommand(e,t){for(let n=t.length-1;n>=0;n--){let o=t[n];if(i.contextMatchesRules(e,o.when))return o}return null}static contextMatchesRules(e,t){ +return!t||t.evaluate(e)}}function n(e){return e?`${e.serialize()}`:"no when condition"}function o(e){return e.isDefault?e.extensionId?`built-in extension ${e.extensionId}`:"built-in":e.extensionId?`user extension ${e.extensionId}`:"user"}t.KeybindingResolver=i})),define(t[532],i([0,1]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeElementsAfterNulls=t.ResolvedKeybindingItem=void 0;function i(e){let t=[];for(let i=0,n=e.length;ithis.layout()))}setContainer(e,t){this.contextView.setContainer(e,t||1)}showContextView(e,t,i){t?t!==this.container&&(this.container=t,this.setContainer(t,i?3:2)):this.container!==this.layoutService.container&&(this.container=this.layoutService.container,this.setContainer(this.container,1)),this.contextView.show(e);const o=n.toDisposable(()=>{this.currentViewDisposable===o&&this.hideContextView()});return this.currentViewDisposable=o,o}getContextViewElement(){return this.contextView.getViewElement()}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e)}};s=a([l(0,o.ILayoutService)],s), +t.ContextViewService=s})),define(t[81],i([0,1,10,2,4]),(function(e,t,i,n,o){"use strict";var s;Object.defineProperty(t,"__esModule",{value:!0}),t.ConsoleLogService=t.AbstractLogService=t.DEFAULT_LOG_LEVEL=t.LogLevel=t.ILogService=void 0,t.ILogService=i.createDecorator("logService"),function(e){e[e.Trace=0]="Trace",e[e.Debug=1]="Debug",e[e.Info=2]="Info",e[e.Warning=3]="Warning",e[e.Error=4]="Error",e[e.Critical=5]="Critical",e[e.Off=6]="Off"}(s=t.LogLevel||(t.LogLevel={})),t.DEFAULT_LOG_LEVEL=s.Info;class r extends n.Disposable{constructor(){super(...arguments),this.level=t.DEFAULT_LOG_LEVEL,this._onDidChangeLogLevel=this._register(new o.Emitter)}setLevel(e){this.level!==e&&(this.level=e,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}}t.AbstractLogService=r;t.ConsoleLogService=class extends r{constructor(e=t.DEFAULT_LOG_LEVEL){super(),this.setLevel(e)}trace(e,...t){this.getLevel()<=s.Trace&&console.log("%cTRACE","color: #888",e,...t)}info(e,...t){ +this.getLevel()<=s.Info&&console.log("%c INFO","color: #33f",e,...t)}error(e,...t){this.getLevel()<=s.Error&&console.log("%c ERR","color: #f33",e,...t)}dispose(){}}})),define(t[240],i([0,1,15,2,194,281,3,18,42,380,44,130,8,19,81,111,12]),(function(e,t,i,n,o,s,d,c,h,u,g,p,m,f,_,v,C){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditorWorkerClient=t.EditorWorkerHost=t.EditorWorkerServiceImpl=void 0;const b=6e4,S=3e5;function w(e,t){let i=e.getModel(t);return!!i&&!i.isTooLargeForSyncing()}let y=class extends n.Disposable{constructor(e,t,i){super(),this._modelService=e,this._workerManager=this._register(new L(this._modelService)),this._logService=i,this._register(c.LinkProviderRegistry.register("*",{provideLinks:(e,t)=>w(this._modelService,e.uri)?this._workerManager.withWorker().then(t=>t.computeLinks(e.uri)).then(e=>e&&{links:e}):Promise.resolve({links:[]})})),this._register(c.CompletionProviderRegistry.register("*",new E(this._workerManager,t,this._modelService)))}dispose(){super.dispose()} +canComputeDiff(e,t){return w(this._modelService,e)&&w(this._modelService,t)}computeDiff(e,t,i,n){return this._workerManager.withWorker().then(o=>o.computeDiff(e,t,i,n))}computeMoreMinimalEdits(e,t){if(f.isNonEmptyArray(t)){if(!w(this._modelService,e))return Promise.resolve(t);const i=v.StopWatch.create(!0),n=this._workerManager.withWorker().then(i=>i.computeMoreMinimalEdits(e,t));return n.finally(()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),i.elapsed())),n}return Promise.resolve(void 0)}canNavigateValueSet(e){return w(this._modelService,e)}navigateValueSet(e,t,i){return this._workerManager.withWorker().then(n=>n.navigateValueSet(e,t,i))}canComputeWordRanges(e){return w(this._modelService,e)}computeWordRanges(e,t){return this._workerManager.withWorker().then(i=>i.computeWordRanges(e,t))}};y=a([l(0,g.IModelService),l(1,p.ITextResourceConfigurationService),l(2,_.ILogService)],y),t.EditorWorkerServiceImpl=y;class E{constructor(e,t,i){this._debugDisplayName="wordbasedCompletions", +this._workerManager=e,this._configurationService=t,this._modelService=i}provideCompletionItems(e,t){return r(this,void 0,void 0,(function*(){const{wordBasedSuggestions:i}=this._configurationService.getValue(e.uri,t,"editor");if(!i)return;if(!w(this._modelService,e.uri))return;const n=e.getWordAtPosition(t),o=n?new d.Range(t.lineNumber,n.startColumn,t.lineNumber,n.endColumn):d.Range.fromPositions(t),s=o.setEndPosition(t.lineNumber,t.column),r=yield this._workerManager.withWorker(),a=yield r.textualSuggest(e.uri,t);return a?{suggestions:a.map(e=>({kind:18,label:e,insertText:e,range:{insert:s,replace:o}}))}:void 0}))}}class L extends n.Disposable{constructor(e){super(),this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=(new Date).getTime(),this._register(new i.IntervalTimer).cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(S/2)),this._register(this._modelService.onModelRemoved(e=>this._checkStopEmptyWorker()))}dispose(){ +this._editorWorkerClient&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null),super.dispose()}_checkStopEmptyWorker(){if(!this._editorWorkerClient)return;0===this._modelService.getModels().length&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}_checkStopIdleWorker(){if(!this._editorWorkerClient)return;(new Date).getTime()-this._lastWorkerUsedTime>S&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=(new Date).getTime(),this._editorWorkerClient||(this._editorWorkerClient=new N(this._modelService,!1,"editorWorkerService")),Promise.resolve(this._editorWorkerClient)}}class x extends n.Disposable{constructor(e,t,n){if(super(),this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),this._proxy=e,this._modelService=t,!n){let e=new i.IntervalTimer;e.cancelAndSet(()=>this._checkStopModelSync(),Math.round(b/2)),this._register(e)}}dispose(){ +for(let e in this._syncedModels)n.dispose(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e){for(const t of e){let e=t.toString();this._syncedModels[e]||this._beginModelSync(t),this._syncedModels[e]&&(this._syncedModelsLastUsedTime[e]=(new Date).getTime())}}_checkStopModelSync(){let e=(new Date).getTime(),t=[];for(let i in this._syncedModelsLastUsedTime){e-this._syncedModelsLastUsedTime[i]>b&&t.push(i)}for(const e of t)this._stopModelSync(e)}_beginModelSync(e){let t=this._modelService.getModel(e);if(!t)return;if(t.isTooLargeForSyncing())return;let i=e.toString();this._proxy.acceptNewModel({url:t.uri.toString(),lines:t.getLinesContent(),EOL:t.getEOL(),versionId:t.getVersionId()});const o=new n.DisposableStore;o.add(t.onDidChangeContent(e=>{this._proxy.acceptModelChanged(i.toString(),e)})),o.add(t.onWillDispose(()=>{this._stopModelSync(i)})),o.add(n.toDisposable(()=>{this._proxy.acceptRemovedModel(i)})), +this._syncedModels[i]=o}_stopModelSync(e){let t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],n.dispose(t)}}class D{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class k{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}}t.EditorWorkerHost=k;class N extends n.Disposable{constructor(e,t,i){super(),this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new s.DefaultWorkerFactory(i),this._worker=null,this._modelManager=null}fhr(e,t){throw new Error("Not implemented!")}_getOrCreateWorker(){if(!this._worker)try{this._worker=this._register(new o.SimpleWorkerClient(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new k(this)))}catch(e){o.logOnceWebWorkerWarning(e),this._worker=new D(new u.EditorSimpleWorker(new k(this),null))}return this._worker}_getProxy(){ +return this._getOrCreateWorker().getProxyObject().then(void 0,e=>(o.logOnceWebWorkerWarning(e),this._worker=new D(new u.EditorSimpleWorker(new k(this),null)),this._getOrCreateWorker().getProxyObject()))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new x(e,this._modelService,this._keepIdleModels))),this._modelManager}_withSyncedResources(e){return this._disposed?Promise.reject(C.canceled()):this._getProxy().then(t=>(this._getOrCreateModelManager(t).ensureSyncedResources(e),t))}computeDiff(e,t,i,n){return this._withSyncedResources([e,t]).then(o=>o.computeDiff(e.toString(),t.toString(),i,n))}computeMoreMinimalEdits(e,t){return this._withSyncedResources([e]).then(i=>i.computeMoreMinimalEdits(e.toString(),t))}computeLinks(e){return this._withSyncedResources([e]).then(t=>t.computeLinks(e.toString()))}textualSuggest(e,t){return this._withSyncedResources([e]).then(i=>{let n=this._modelService.getModel(e);if(!n)return null +;let o=h.LanguageConfigurationRegistry.getWordDefinition(n.getLanguageIdentifier().id),s=o.source,r=m.regExpFlags(o);return i.textualSuggest(e.toString(),t,s,r)})}computeWordRanges(e,t){return this._withSyncedResources([e]).then(i=>{let n=this._modelService.getModel(e);if(!n)return Promise.resolve(null);let o=h.LanguageConfigurationRegistry.getWordDefinition(n.getLanguageIdentifier().id),s=o.source,r=m.regExpFlags(o);return i.computeWordRanges(e.toString(),t,s,r)})}navigateValueSet(e,t,i){return this._withSyncedResources([e]).then(n=>{let o=this._modelService.getModel(e);if(!o)return null;let s=h.LanguageConfigurationRegistry.getWordDefinition(o.getLanguageIdentifier().id),r=s.source,a=m.regExpFlags(s);return n.navigateValueSet(e.toString(),t,i,r,a)})}dispose(){super.dispose(),this._disposed=!0}}t.EditorWorkerClient=N})),define(t[241],i([0,1,18,81,128]),(function(e,t,i,n,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toMultilineTokens2=t.SemanticTokensProviderStyling=void 0 +;t.SemanticTokensProviderStyling=class{constructor(e,t,i){this._legend=e,this._themeService=t,this._logService=i,this._hashTable=new r}getMetadata(e,t,o){const s=this._hashTable.get(e,t,o.id);let r;if(s)r=s.metadata,this._logService.getLevel()===n.LogLevel.Trace&&this._logService.trace(`SemanticTokensProviderStyling [CACHED] ${e} / ${t}: foreground ${i.TokenMetadata.getForeground(r)}, fontStyle ${i.TokenMetadata.getFontStyle(r).toString(2)}`);else{let s=this._legend.tokenTypes[e];const a=[];if(s){let e=t;for(let t=0;e>0&&t>=1;e>0&&this._logService.getLevel()===n.LogLevel.Trace&&(this._logService.trace(`SemanticTokensProviderStyling: unknown token modifier index: ${t.toString(2)} for legend: ${JSON.stringify(this._legend.tokenModifiers)}`),a.push("not-in-legend"));const i=this._themeService.getColorTheme().getTokenStyleMetadata(s,a,o.language);if(void 0===i)r=2147483647;else{if(r=0,void 0!==i.italic){r|=1|(i.italic?1:0)<<11} +if(void 0!==i.bold){r|=2|(i.bold?2:0)<<11}if(void 0!==i.underline){r|=4|(i.underline?4:0)<<11}if(i.foreground){r|=8|i.foreground<<14}0===r&&(r=2147483647)}}else this._logService.getLevel()===n.LogLevel.Trace&&this._logService.trace(`SemanticTokensProviderStyling: unknown token type index: ${e} for legend: ${JSON.stringify(this._legend.tokenTypes)}`),r=2147483647,s="not-in-legend";this._hashTable.add(e,t,o.id,r),this._logService.getLevel()===n.LogLevel.Trace&&this._logService.trace(`SemanticTokensProviderStyling ${e} (${s}) / ${t} (${a.join(" ")}): foreground ${i.TokenMetadata.getForeground(r)}, fontStyle ${i.TokenMetadata.getFontStyle(r).toString(2)}`)}return r}},t.toMultilineTokens2=function(e,t,i){const n=e.data,s=e.data.length/5|0,r=Math.max(Math.ceil(s/1024),400),a=[];let l=0,d=1,c=0;for(;le&&0===n[5*t];)t--;if(t-1===e){let e=h;for(;e+1=this._growCount){const e=this._elements;this._currentLengthIndex++,this._currentLength=r._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1{const t=this._foreignModuleHost?n.getAllMethodNames(this._foreignModuleHost):[];return e.loadForeignModule(this._foreignModuleId,this._foreignModuleCreateData,t).then(t=>{this._foreignModuleCreateData=null;const i=(t,i)=>e.fmr(t,i),n=(e,t)=>(function(){const i=Array.prototype.slice.call(arguments,0);return t(e,i)});let o={};for(const e of t)o[e]=n(e,i);return o})})),this._foreignProxy} +getProxy(){return this._getForeignProxy()}withSyncedResources(e){return this._withSyncedResources(e).then(e=>this.getProxy())}}})),define(t[82],i([0,1,10,500,77]),(function(e,t,i,n,o){"use strict";var s;Object.defineProperty(t,"__esModule",{value:!0}),t.IMarkerService=t.IMarkerData=t.MarkerSeverity=void 0,function(e){e[e.Hint=1]="Hint",e[e.Info=2]="Info",e[e.Warning=4]="Warning",e[e.Error=8]="Error"}(s=t.MarkerSeverity||(t.MarkerSeverity={})),function(e){e.compare=function(e,t){return t-e};const t=Object.create(null);t[e.Error]=n.localize(0,null),t[e.Warning]=n.localize(1,null),t[e.Info]=n.localize(2,null),e.toString=function(e){return t[e]||""},e.fromSeverity=function(t){switch(t){case o.default.Error:return e.Error;case o.default.Warning:return e.Warning;case o.default.Info:return e.Info;case o.default.Ignore:return e.Hint}},e.toSeverity=function(t){switch(t){case e.Error:return o.default.Error;case e.Warning:return o.default.Warning;case e.Info:return o.default.Info;case e.Hint:return o.default.Ignore}} +}(s=t.MarkerSeverity||(t.MarkerSeverity={})),function(e){const t="";function i(e,i){let n=[t];return e.source?n.push(e.source.replace("¦","\\¦")):n.push(t),e.code?"string"==typeof e.code?n.push(e.code.replace("¦","\\¦")):n.push(e.code.value.replace("¦","\\¦")):n.push(t),void 0!==e.severity&&null!==e.severity?n.push(s.toString(e.severity)):n.push(t),e.message&&i?n.push(e.message.replace("¦","\\¦")):n.push(t),void 0!==e.startLineNumber&&null!==e.startLineNumber?n.push(e.startLineNumber.toString()):n.push(t),void 0!==e.startColumn&&null!==e.startColumn?n.push(e.startColumn.toString()):n.push(t),void 0!==e.endLineNumber&&null!==e.endLineNumber?n.push(e.endLineNumber.toString()):n.push(t),void 0!==e.endColumn&&null!==e.endColumn?n.push(e.endColumn.toString()):n.push(t),n.push(t),n.join("¦")}e.makeKey=function(e){return i(e,!0)},e.makeKeyOptionalMessage=i}(t.IMarkerData||(t.IMarkerData={})),t.IMarkerService=i.createDecorator("markerService")})), +define(t[536],i([0,1,82,24,4,2,3,8,19,10,71,69]),(function(e,t,i,n,o,s,r,d,c,h,u,g){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IMarkerNavigationService=t.MarkerList=t.MarkerCoordinate=void 0;class p{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}t.MarkerCoordinate=p;let m=class e{constructor(t,r){this._markerService=r,this._onDidChange=new o.Emitter,this.onDidChange=this._onDidChange.event,this._dispoables=new s.DisposableStore,this._markers=[],this._nextIdx=-1,n.URI.isUri(t)?this._resourceFilter=e=>e.toString()===t.toString():t&&(this._resourceFilter=t);const a=()=>{this._markers=this._markerService.read({resource:n.URI.isUri(t)?t:void 0,severities:i.MarkerSeverity.Error|i.MarkerSeverity.Warning|i.MarkerSeverity.Info}),"function"==typeof t&&(this._markers=this._markers.filter(e=>this._resourceFilter(e.resource))),this._markers.sort(e._compareMarker)};a(),this._dispoables.add(r.onMarkerChanged(e=>{this._resourceFilter&&!e.some(e=>this._resourceFilter(e))||(a(), +this._nextIdx=-1,this._onDidChange.fire())}))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}matches(e){return!this._resourceFilter&&!e||!(!this._resourceFilter||!e)&&this._resourceFilter(e)}get selected(){const e=this._markers[this._nextIdx];return e&&new p(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,i){let n=!1,o=this._markers.findIndex(t=>t.resource.toString()===e.uri.toString());o<0&&(o=c.binarySearch(this._markers,{resource:e.uri},(e,t)=>d.compare(e.resource.toString(),t.resource.toString())))<0&&(o=~o);for(let i=o;it.resource.toString()===e.toString());if(!(i<0))for(;ie[1])}}class c{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new a.ResourceMap,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(const t of e){const e=this._data.get(t);e&&this._substract(e);const i=this._resourceStats(t);this._add(i),this._data.set(t,i)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if(e.scheme===n.Schemas.inMemory||e.scheme===n.Schemas.walkThrough||e.scheme===n.Schemas.walkThroughSnippet)return t;for(const{severity:i}of this._service.read({resource:e +}))i===r.MarkerSeverity.Error?t.errors+=1:i===r.MarkerSeverity.Warning?t.warnings+=1:i===r.MarkerSeverity.Info?t.infos+=1:t.unknowns+=1;return t}_substract(e){this.errors-=e.errors,this.warnings-=e.warnings,this.infos-=e.infos,this.unknowns-=e.unknowns}_add(e){this.errors+=e.errors,this.warnings+=e.warnings,this.infos+=e.infos,this.unknowns+=e.unknowns}}class h{constructor(){this._onMarkerChanged=new s.Emitter,this.onMarkerChanged=s.Event.debounce(this._onMarkerChanged.event,h._debouncer,0),this._data=new d,this._stats=new c(this)}dispose(){this._stats.dispose()}remove(e,t){for(const i of t||[])this.changeOne(e,i,[])}changeOne(e,t,n){if(i.isFalsyOrEmpty(n)){this._data.delete(t,e)&&this._onMarkerChanged.fire([t])}else{const i=[];for(const o of n){const n=h._toMarker(e,t,o);n&&i.push(n)}this._data.set(t,e,i),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,i){let{code:n,severity:o,message:s,source:r,startLineNumber:a,startColumn:l,endLineNumber:d,endColumn:c,relatedInformation:h,tags:u}=i;if(s)return{ +resource:t,owner:e,code:n,severity:o,message:s,source:r,startLineNumber:a=a>0?a:1,startColumn:l=l>0?l:1,endLineNumber:d=d>=a?d:a,endColumn:c=c>0?c:l,relatedInformation:h,tags:u}}read(e=Object.create(null)){let{owner:t,resource:i,severities:n,take:o}=e;if((!o||o<0)&&(o=-1),t&&i){const e=this._data.get(i,t);if(e){const t=[];for(const i of e)if(h._accept(i,n)){const e=t.push(i);if(o>0&&e===o)break}return t}return[]}if(t||i){const e=this._data.values(null!=i?i:t),s=[];for(const t of e)for(const e of t)if(h._accept(e,n)){const t=s.push(e);if(o>0&&t===o)return s}return s}{const e=[];for(let t of this._data.values())for(let i of t)if(h._accept(i,n)){const t=e.push(i);if(o>0&&t===o)return e}return e}}static _accept(e,t){return void 0===t||(t&e.severity)===e.severity}static _debouncer(e,t){e||(h._dedupeMap=new a.ResourceMap,e=[]);for(const i of t)h._dedupeMap.has(i)||(h._dedupeMap.set(i,!0),e.push(i));return e}}t.MarkerService=h})),define(t[32],i([0,1,77,10]),(function(e,t,i,n){"use strict" +;Object.defineProperty(t,"__esModule",{value:!0}),t.NoOpNotification=t.INotificationService=t.Severity=void 0,t.Severity=i.default,t.INotificationService=n.createDecorator("notificationService");t.NoOpNotification=class{}})),define(t[55],i([0,1,24,10,2,8]),(function(e,t,i,n,o,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.matchesScheme=t.NullOpenerService=t.IOpenerService=void 0,t.IOpenerService=n.createDecorator("openerService"),t.NullOpenerService=Object.freeze({_serviceBrand:void 0,registerOpener:()=>o.Disposable.None,registerValidator:()=>o.Disposable.None,registerExternalUriResolver:()=>o.Disposable.None,setExternalOpener(){},open(){return r(this,void 0,void 0,(function*(){return!1}))},resolveExternalUri(e){return r(this,void 0,void 0,(function*(){return{resolved:e,dispose(){}}}))}}),t.matchesScheme=function(e,t){return i.URI.isUri(e)?s.equalsIgnoreCase(e.scheme,t):s.startsWithIgnoreCase(e,t+":")}})), +define(t[538],i([0,1,7,69,189,40,41,24,27,28,55,507]),(function(e,t,i,n,o,s,d,c,h,u,g,p){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OpenerService=void 0;let m=class{constructor(e){this._commandService=e}open(e){return r(this,void 0,void 0,(function*(){if(!g.matchesScheme(e,s.Schemas.command))return!1;"string"==typeof e&&(e=c.URI.parse(e));let t=[];try{t=o.parse(decodeURIComponent(e.query))}catch(i){try{t=o.parse(e.query)}catch(e){}}return Array.isArray(t)||(t=[t]),yield this._commandService.executeCommand(e.path,...t),!0}))}};m=a([l(0,u.ICommandService)],m);let f=class{constructor(e){this._editorService=e}open(e,t){return r(this,void 0,void 0,(function*(){"string"==typeof e&&(e=c.URI.parse(e));let i=void 0;const n=/^L?(\d+)(?:,(\d+))?/.exec(e.fragment);return n&&(i={startLineNumber:parseInt(n[1]),startColumn:n[2]?parseInt(n[2]):1},e=e.with({fragment:""})),e.scheme===s.Schemas.file&&(e=d.normalizePath(e)),yield this._editorService.openCodeEditor({resource:e,options:{selection:i, +context:(null==t?void 0:t.fromUserGesture)?p.EditorOpenContext.USER:p.EditorOpenContext.API}},this._editorService.getFocusedCodeEditor(),null==t?void 0:t.openToSide),!0}))}};f=a([l(0,h.ICodeEditorService)],f);let _=class{constructor(e,t){this._openers=new n.LinkedList,this._validators=new n.LinkedList,this._resolvers=new n.LinkedList,this._externalOpener={openExternal:e=>(g.matchesScheme(e,s.Schemas.http)||g.matchesScheme(e,s.Schemas.https)?i.windowOpenNoOpener(e):window.location.href=e,Promise.resolve(!0))},this._openers.push({open:(e,t)=>r(this,void 0,void 0,(function*(){return!!((null==t?void 0:t.openExternal)||g.matchesScheme(e,s.Schemas.mailto)||g.matchesScheme(e,s.Schemas.http)||g.matchesScheme(e,s.Schemas.https))&&(yield this._doOpenExternal(e,t),!0)}))}),this._openers.push(new m(t)),this._openers.push(new f(e))}open(e,t){return r(this,void 0,void 0,(function*(){for(const t of this._validators.toArray())if(!(yield t.shouldOpen(e)))return!1;for(const i of this._openers.toArray()){ +if(yield i.open(e,t))return!0}return!1}))}resolveExternalUri(e,t){return r(this,void 0,void 0,(function*(){for(const i of this._resolvers.toArray()){const n=yield i.resolveExternalUri(e,t);if(n)return n}return{resolved:e,dispose:()=>{}}}))}_doOpenExternal(e,t){return r(this,void 0,void 0,(function*(){const i="string"==typeof e?c.URI.parse(e):e,{resolved:n}=yield this.resolveExternalUri(i,t);return"string"==typeof e&&i.toString()===n.toString()?this._externalOpener.openExternal(e):this._externalOpener.openExternal(encodeURI(n.toString(!0)))}))}dispose(){this._validators.clear()}};_=a([l(0,h.ICodeEditorService),l(1,u.ICommandService)],_),t.OpenerService=_})),define(t[134],i([0,1,279,55,73,12,235,10,4,2,18]),(function(e,t,i,n,o,s,r,d,c,h,u){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MarkdownRenderer=void 0;let g=class extends h.Disposable{constructor(e,t,i=n.NullOpenerService){super(),this._editor=e,this._modeService=t,this._openerService=i, +this._onDidRenderCodeBlock=this._register(new c.Emitter),this.onDidRenderCodeBlock=this._onDidRenderCodeBlock.event}getOptions(e){return{codeBlockRenderer:(e,t)=>{let i=null;if(e)i=this._modeService.getModeIdForLanguageName(e);else{const e=this._editor.getModel();e&&(i=e.getLanguageIdentifier().language)}return this._modeService.triggerMode(i||""),Promise.resolve(!0).then(e=>{const n=u.TokenizationRegistry.getPromise(i||"");return n?n.then(e=>r.tokenizeToString(t,e)):r.tokenizeToString(t,void 0)}).then(e=>`${e}`)},codeBlockRenderCallback:()=>this._onDidRenderCodeBlock.fire(),actionHandler:{callback:e=>{this._openerService.open(e,{fromUserGesture:!0}).catch(s.onUnexpectedError)},disposeables:e}}}render(e){const t=new h.DisposableStore;let n;return{element:n=e?i.renderMarkdown(e,this.getOptions(t)):document.createElement("span"),dispose:()=>t.dispose()}}};g=a([l(1,o.IModeService),l(2,d.optional(n.IOpenerService))],g),t.MarkdownRenderer=g +})),define(t[539],i([0,1,7,78,2,220,221,134,55,19]),(function(e,t,i,n,o,s,r,a,l,d){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ModesGlyphHoverWidget=void 0;class c{constructor(e){this._editor=e,this._lineNumber=-1,this._result=[]}setLineNumber(e){this._lineNumber=e,this._result=[]}clearResult(){this._result=[]}computeSync(){const e=e=>({value:e}),t=this._editor.getLineDecorations(this._lineNumber),i=[];if(!t)return i;for(const o of t){if(!o.options.glyphMarginClassName)continue;const t=o.options.glyphMarginHoverMessage;t&&!n.isEmptyMarkdownString(t)&&i.push(...d.asArray(t).map(e))}return i}onResult(e,t){this._result=this._result.concat(e)}getResult(){return this._result}getResultWithLoadingMessage(){return this.getResult()}}class h extends r.GlyphHoverWidget{constructor(e,t,i=l.NullOpenerService){super(h.ID,e),this._renderDisposeables=this._register(new o.DisposableStore),this._messages=[],this._lastLineNumber=-1, +this._markdownRenderer=this._register(new a.MarkdownRenderer(this._editor,t,i)),this._computer=new c(this._editor),this._hoverOperation=new s.HoverOperation(this._computer,e=>this._withResult(e),void 0,e=>this._withResult(e),300)}dispose(){this._hoverOperation.cancel(),super.dispose()}onModelDecorationsChanged(){this.isVisible&&(this._hoverOperation.cancel(),this._computer.clearResult(),this._hoverOperation.start(0))}startShowingAt(e){this._lastLineNumber!==e&&(this._hoverOperation.cancel(),this.hide(),this._lastLineNumber=e,this._computer.setLineNumber(e),this._hoverOperation.start(0))}hide(){this._lastLineNumber=-1,this._hoverOperation.cancel(),super.hide()}_withResult(e){this._messages=e,this._messages.length>0?this._renderMessages(this._lastLineNumber,this._messages):this.hide()}_renderMessages(e,t){this._renderDisposeables.clear();const n=document.createDocumentFragment();for(const e of t){const t=this._markdownRenderer.render(e.value);this._renderDisposeables.add(t), +n.appendChild(i.$("div.hover-row",void 0,t.element))}this.updateContents(n),this.showAt(e)}}t.ModesGlyphHoverWidget=h,h.ID="editor.contrib.modesGlyphHoverWidget"})),define(t[56],i([0,1,10]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IEditorProgressService=t.Progress=void 0;class n{constructor(e){this.callback=e}report(e){this._value=e,this.callback(this._value)}}t.Progress=n,n.None=Object.freeze({report(){}}),t.IEditorProgressService=i.createDecorator("editorProgressService")})),define(t[540],i([0,1,25,2,15]),(function(e,t,i,n,o){"use strict";var s;function a(e){const t=e;return Array.isArray(t.items)}Object.defineProperty(t,"__esModule",{value:!0}),t.PickerQuickAccessProvider=t.TriggerAction=void 0,function(e){e[e.NO_ACTION=0]="NO_ACTION",e[e.CLOSE_PICKER=1]="CLOSE_PICKER",e[e.REFRESH_PICKER=2]="REFRESH_PICKER",e[e.REMOVE_ITEM=3]="REMOVE_ITEM"}(s=t.TriggerAction||(t.TriggerAction={}));class l extends n.Disposable{constructor(e,t){super(),this.prefix=e,this.options=t} +provide(e,t){var d;const c=new n.DisposableStore;e.canAcceptInBackground=!!(null===(d=this.options)||void 0===d?void 0:d.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let h=void 0;const u=c.add(new n.MutableDisposable),g=()=>r(this,void 0,void 0,(function*(){const s=u.value=new n.DisposableStore;null==h||h.dispose(!0),e.busy=!1;const d=(h=new i.CancellationTokenSource(t)).token,c=e.value.substr(this.prefix.length).trim(),g=this.getPicks(c,s,d),p=(t,i)=>{var n;let o,s=void 0;if(a(t)?(o=t.items,s=t.active):o=t,0===o.length){if(i)return!1;c.length>0&&(null===(n=this.options)||void 0===n?void 0:n.noResultsPick)&&(o=[this.options.noResultsPick])}return e.items=o,s&&(e.activeItems=[s]),!0};if(null===g);else if(function(e){const t=e;return!!t.picks&&t.additionalPicks instanceof Promise}(g)){let t=!1,i=!1;yield Promise.all([(()=>r(this,void 0,void 0,(function*(){yield o.timeout(l.FAST_PICKS_RACE_DELAY),d.isCancellationRequested||i||(t=p(g.picks,!0)) +})))(),(()=>r(this,void 0,void 0,(function*(){e.busy=!0;try{const n=yield g.additionalPicks;if(d.isCancellationRequested)return;let o,s,r=void 0;a(g.picks)?(o=g.picks.items,r=g.picks.active):o=g.picks;let l=void 0;if(a(n)?(s=n.items,l=n.active):s=n,s.length>0||!t){let t=void 0;if(!r&&!l){const i=e.activeItems[0];i&&-1!==o.indexOf(i)&&(t=i)}p({items:[...o,...s],active:r||l||t})}}finally{d.isCancellationRequested||(e.busy=!1),i=!0}})))()])}else if(g instanceof Promise){e.busy=!0;try{const t=yield g;if(d.isCancellationRequested)return;p(t)}finally{d.isCancellationRequested||(e.busy=!1)}}else p(g)}));return c.add(e.onDidChangeValue(()=>g())),g(),c.add(e.onDidAccept(t=>{const[i]=e.selectedItems;"function"==typeof(null==i?void 0:i.accept)&&(t.inBackground||e.hide(),i.accept(e.keyMods,t))})),c.add(e.onDidTriggerItemButton(({button:i,item:n})=>r(this,void 0,void 0,(function*(){var o,r;if("function"==typeof n.trigger){const a=null!==(r=null===(o=n.buttons)||void 0===o?void 0:o.indexOf(i))&&void 0!==r?r:-1;if(a>=0){ +const i=n.trigger(a,e.keyMods),o="number"==typeof i?i:yield i;if(t.isCancellationRequested)return;switch(o){case s.NO_ACTION:break;case s.CLOSE_PICKER:e.hide();break;case s.REFRESH_PICKER:g();break;case s.REMOVE_ITEM:const t=e.items.indexOf(n);if(-1!==t){const i=e.items.slice();i.splice(t,1),e.items=i}}}}})))),c}}t.PickerQuickAccessProvider=l,l.FAST_PICKS_RACE_DELAY=200}));var d=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[i]}})}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),c=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||d(t,e,i)};define(t[75],i([0,1,10,195]),(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IQuickInputService=void 0,c(n,t),t.IQuickInputService=i.createDecorator("quickInputService")})),define(t[34],i([0,1,23,185]),(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}), +t.Registry=void 0;t.Registry=new class{constructor(){this.data=new Map}add(e,t){n.ok(i.isString(e)),n.ok(i.isObject(t)),n.ok(!this.data.has(e),"There is already an extension with this id"),this.data.set(e,t)}as(e){return this.data.get(e)||null}}})),define(t[135],i([0,1,442,4,18,42,34]),(function(e,t,i,n,o,s,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PLAINTEXT_LANGUAGE_IDENTIFIER=t.PLAINTEXT_MODE_ID=t.ModesRegistry=t.EditorModesRegistry=t.Extensions=void 0,t.Extensions={ModesRegistry:"editor.modesRegistry"};class a{constructor(){this._onDidChangeLanguages=new n.Emitter,this.onDidChangeLanguages=this._onDidChangeLanguages.event,this._languages=[],this._dynamicLanguages=[]}registerLanguage(e){return this._languages.push(e),this._onDidChangeLanguages.fire(void 0),{dispose:()=>{for(let t=0,i=this._languages.length;t"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],folding:{offSide:!0}})})),define(t[541],i([0,1,40,41,135,229]),(function(e,t,i,n,o,s){"use strict";function r(e,t,s){if(!s)return null;let r=null;if(s.scheme===i.Schemas.data){const e=n.DataUri.parseMetaData(s).get(n.DataUri.META_DATA_MIME);e&&(r=t.getModeId(e))}else{const t=e.getModel(s);t&&(r=t.getModeId())}return r&&r!==o.PLAINTEXT_MODE_ID?r:t.getModeIdByFilepathOrFirstLine(s)} +function a(e){return e.replace(/\s/g,"\\$&")}Object.defineProperty(t,"__esModule",{value:!0}),t.cssEscape=t.detectModeId=t.getIconClasses=void 0,t.getIconClasses=function(e,t,o,l){const d=l===s.FileKind.ROOT_FOLDER?["rootfolder-icon"]:l===s.FileKind.FOLDER?["folder-icon"]:["file-icon"];if(o){let c;if(o.scheme===i.Schemas.data){c=n.DataUri.parseMetaData(o).get(n.DataUri.META_DATA_LABEL)}else c=a(n.basenameOrAuthority(o).toLowerCase());if(l===s.FileKind.FOLDER)d.push(`${c}-name-folder-icon`);else{if(c){d.push(`${c}-name-file-icon`);const e=c.split(".");for(let t=1;t0&&"#"===i.charAt(i.length-1)?i.substring(0,i.length-1):i)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}};i.Registry.add(t.Extensions.JSONContribution,o)})),define(t[93],i([0,1,497,4,34,23,242]),(function(e,t,i,n,o,s,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateProperty=t.getDefaultValue=t.overrideIdentifierFromKey=t.OVERRIDE_PROPERTY_PATTERN=t.resourceLanguageSettingsSchemaId=t.resourceSettings=t.windowSettings=t.machineOverridableSettings=t.machineSettings=t.applicationSettings=t.allSettings=t.Extensions=void 0,t.Extensions={Configuration:"base.contributions.configuration"},t.allSettings={properties:{},patternProperties:{}},t.applicationSettings={properties:{},patternProperties:{}},t.machineSettings={properties:{},patternProperties:{}},t.machineOverridableSettings={properties:{},patternProperties:{}},t.windowSettings={properties:{},patternProperties:{}}, +t.resourceSettings={properties:{},patternProperties:{}},t.resourceLanguageSettingsSchemaId="vscode://schemas/settings/resourceLanguage";const a=o.Registry.as(r.Extensions.JSONContribution);function l(e){switch(Array.isArray(e)?e[0]:e){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}t.OVERRIDE_PROPERTY_PATTERN=new RegExp("\\[.*\\]$"),t.overrideIdentifierFromKey=function(e){return e.substring(1,e.length-1)},t.getDefaultValue=l;const d=new class{constructor(){this.overrideIdentifiers=new Set,this._onDidSchemaChange=new n.Emitter,this._onDidUpdateConfiguration=new n.Emitter,this.defaultValues={},this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:i.localize(0,null),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!1, +errorMessage:"Unknown editor configuration setting",allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.excludedConfigurationProperties={},a.registerSchema(t.resourceLanguageSettingsSchemaId,this.resourceLanguageSettingsSchema)}registerConfiguration(e,t=!0){this.registerConfigurations([e],t)}registerConfigurations(e,i=!0){const n=[];e.forEach(e=>{n.push(...this.validateAndRegisterProperties(e,i)),this.configurationContributors.push(e),this.registerJSONConfiguration(e)}),a.registerSchema(t.resourceLanguageSettingsSchemaId,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire(n)}registerOverrideIdentifiers(e){for(const t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}validateAndRegisterProperties(e,i=!0,n=3){n=s.isUndefinedOrNull(e.scope)?n:e.scope;let o=[],r=e.properties;if(r)for(let e in r){if(i&&c(e)){delete r[e];continue}const a=r[e];this.updatePropertyDefaultValue(e,a), +t.OVERRIDE_PROPERTY_PATTERN.test(e)?a.scope=void 0:a.scope=s.isUndefinedOrNull(a.scope)?n:a.scope,!r[e].hasOwnProperty("included")||r[e].included?(this.configurationProperties[e]=r[e],!r[e].deprecationMessage&&r[e].markdownDeprecationMessage&&(r[e].deprecationMessage=r[e].markdownDeprecationMessage),o.push(e)):(this.excludedConfigurationProperties[e]=r[e],delete r[e])}let a=e.allOf;if(a)for(let e of a)o.push(...this.validateAndRegisterProperties(e,i,n));return o}getConfigurationProperties(){return this.configurationProperties}registerJSONConfiguration(e){const t=e=>{let i=e.properties;if(i)for(const e in i)this.updateSchema(e,i[e]);let n=e.allOf;n&&n.forEach(t)};t(e)}updateSchema(e,i){switch(t.allSettings.properties[e]=i,i.scope){case 1:t.applicationSettings.properties[e]=i;break;case 2:t.machineSettings.properties[e]=i;break;case 6:t.machineOverridableSettings.properties[e]=i;break;case 3:t.windowSettings.properties[e]=i;break;case 4:t.resourceSettings.properties[e]=i;break;case 5: +t.resourceSettings.properties[e]=i,this.resourceLanguageSettingsSchema.properties[e]=i}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const n=`[${e}]`,o={type:"object",description:i.localize(1,null),errorMessage:i.localize(2,null),$ref:t.resourceLanguageSettingsSchemaId};this.updatePropertyDefaultValue(n,o),t.allSettings.properties[n]=o,t.applicationSettings.properties[n]=o,t.machineSettings.properties[n]=o,t.machineOverridableSettings.properties[n]=o,t.windowSettings.properties[n]=o,t.resourceSettings.properties[n]=o}this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){let i=this.defaultValues[e];s.isUndefined(i)&&(i=t.default),s.isUndefined(i)&&(i=l(t.type)),t.default=i}};function c(e){return t.OVERRIDE_PROPERTY_PATTERN.test(e)?i.localize(3,null,e):void 0!==d.getConfigurationProperties()[e]?i.localize(4,null,e):null}o.Registry.add(t.Extensions.Configuration,d),t.validateProperty=c})), +define(t[174],i([0,1,438,4,2,37,19,38,120,156,93,34,186]),(function(e,t,i,n,o,s,r,a,l,d,c,h,u){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isDiffEditorConfigurationKey=t.isEditorConfigurationKey=t.editorConfigurationBaseNode=t.CommonEditorConfiguration=t.ComputedEditorOptions=t.TabFocus=void 0,t.TabFocus=new class{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new n.Emitter,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus!==e&&(this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus))}};const g=Object.hasOwnProperty;class p{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}t.ComputedEditorOptions=p;class m{constructor(){this._values=[]}_read(e){return this._values[e]}_write(e,t){this._values[e]=t}}class f{static readOptions(e){const t=e,i=new m;for(const e of a.editorOptionsRegistry){ +const n="_never_"===e.name?void 0:t[e.name];i._write(e.id,n)}return i}static validateOptions(e){const t=new a.ValidatedEditorOptions;for(const i of a.editorOptionsRegistry)t._write(i.id,i.validate(e._read(i.id)));return t}static computeOptions(e,t){const i=new p;for(const n of a.editorOptionsRegistry)i._write(n.id,n.compute(t,i,e._read(n.id)));return i}static _deepEquals(e,t){if("object"!=typeof e||"object"!=typeof t)return e===t;if(Array.isArray(e)||Array.isArray(t))return!(!Array.isArray(e)||!Array.isArray(t))&&r.equals(e,t);for(let i in e)if(!f._deepEquals(e[i],t[i]))return!1;return!0}static checkEquals(e,t){const i=[];let n=!1;for(const o of a.editorOptionsRegistry){const s=!f._deepEquals(e._read(o.id),t._read(o.id));i[o.id]=s,s&&(n=!0)}return n?new a.ConfigurationChangedEvent(i):null}}function _(e){const t=s.deepClone(e);return function(e){const t=e.wordWrap;!0===t?e.wordWrap="on":!1===t&&(e.wordWrap="off");const i=e.lineNumbers;!0===i?e.lineNumbers="on":!1===i&&(e.lineNumbers="off"), +!1===e.autoClosingBrackets&&(e.autoClosingBrackets="never",e.autoClosingQuotes="never",e.autoSurround="never"),"visible"===e.cursorBlinking&&(e.cursorBlinking="solid");const n=e.renderWhitespace;!0===n?e.renderWhitespace="boundary":!1===n&&(e.renderWhitespace="none");const o=e.renderLineHighlight;!0===o?e.renderLineHighlight="line":!1===o&&(e.renderLineHighlight="none");const s=e.acceptSuggestionOnEnter;!0===s?e.acceptSuggestionOnEnter="on":!1===s&&(e.acceptSuggestionOnEnter="off");const r=e.tabCompletion;!1===r?e.tabCompletion="off":!0===r&&(e.tabCompletion="onlySnippets");const a=e.suggest;if(a&&"object"==typeof a.filteredTypes&&a.filteredTypes){const e={method:"showMethods",function:"showFunctions",constructor:"showConstructors",field:"showFields",variable:"showVariables",class:"showClasses",struct:"showStructs",interface:"showInterfaces",module:"showModules",property:"showProperties",event:"showEvents",operator:"showOperators",unit:"showUnits",value:"showValues",constant:"showConstants",enum:"showEnums", +enumMember:"showEnumMembers",keyword:"showKeywords",text:"showWords",color:"showColors",file:"showFiles",reference:"showReferences",folder:"showFolders",typeParameter:"showTypeParameters",snippet:"showSnippets"};u.forEach(e,e=>{const t=a.filteredTypes[e.key];!1===t&&(a[e.value]=t)})}const l=e.hover;!0===l?e.hover={enabled:!0}:!1===l&&(e.hover={enabled:!1});const d=e.parameterHints;!0===d?e.parameterHints={enabled:!0}:!1===d&&(e.parameterHints={enabled:!1});const c=e.autoIndent;!0===c?e.autoIndent="full":!1===c&&(e.autoIndent="advanced");const h=e.matchBrackets;!0===h?e.matchBrackets="always":!1===h&&(e.matchBrackets="never")}(t),t}class v extends o.Disposable{constructor(e,i){super(),this._onDidChange=this._register(new n.Emitter),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new n.Emitter),this.onDidChangeFast=this._onDidChangeFast.event,this.isSimpleWidget=e,this._isDominatedByLongLines=!1,this._computeOptionsMemory=new a.ComputeOptionsMemory,this._viewLineCount=1, +this._lineNumbersDigitCount=1,this._rawOptions=_(i),this._readOptions=f.readOptions(this._rawOptions),this._validatedOptions=f.validateOptions(this._readOptions),this._register(l.EditorZoom.onDidChangeZoomLevel(e=>this._recomputeOptions())),this._register(t.TabFocus.onDidChangeTabFocus(e=>this._recomputeOptions()))}observeReferenceElement(e){}dispose(){super.dispose()}_recomputeOptions(){const e=this.options,t=this._computeInternalOptions();if(e){const i=f.checkEquals(e,t);if(null===i)return;this.options=t,this._onDidChangeFast.fire(i),this._onDidChange.fire(i)}else this.options=t}getRawOptions(){return this._rawOptions}_computeInternalOptions(){const e=this._getEnvConfiguration(),i=d.BareFontInfo.createFromValidatedSettings(this._validatedOptions,e.zoomLevel,this.isSimpleWidget),n={memory:this._computeOptionsMemory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,fontInfo:this.readConfiguration(i),extraEditorClassName:e.extraEditorClassName,isDominatedByLongLines:this._isDominatedByLongLines, +viewLineCount:this._viewLineCount,lineNumbersDigitCount:this._lineNumbersDigitCount,emptySelectionClipboard:e.emptySelectionClipboard,pixelRatio:e.pixelRatio,tabFocusMode:t.TabFocus.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport};return f.computeOptions(this._validatedOptions,n)}static _subsetEquals(e,t){for(const i in t)if(g.call(t,i)){const n=t[i],o=e[i];if(o===n)continue;if(Array.isArray(o)&&Array.isArray(n)){if(!r.equals(o,n))return!1;continue}if(o&&"object"==typeof o&&n&&"object"==typeof n){if(!this._subsetEquals(o,n))return!1;continue}return!1}return!0}updateOptions(e){if(void 0===e)return;const t=_(e);v._subsetEquals(this._rawOptions,t)||(this._rawOptions=s.mixin(this._rawOptions,t||{}),this._readOptions=f.readOptions(this._rawOptions),this._validatedOptions=f.validateOptions(this._readOptions),this._recomputeOptions())}setIsDominatedByLongLines(e){this._isDominatedByLongLines=e,this._recomputeOptions()}setMaxLineNumber(e){const t=v._digitCount(e) +;this._lineNumbersDigitCount!==t&&(this._lineNumbersDigitCount=t,this._recomputeOptions())}setViewLineCount(e){this._viewLineCount!==e&&(this._viewLineCount=e,this._recomputeOptions())}static _digitCount(e){let t=0;for(;e;)e=Math.floor(e/10),t++;return t||1}}t.CommonEditorConfiguration=v,t.editorConfigurationBaseNode=Object.freeze({id:"editor",order:5,type:"object",title:i.localize(0,null),scope:5});const C=h.Registry.as(c.Extensions.Configuration),b=Object.assign(Object.assign({},t.editorConfigurationBaseNode),{properties:{"editor.tabSize":{type:"number",default:a.EDITOR_MODEL_DEFAULTS.tabSize,minimum:1,markdownDescription:i.localize(1,null)},"editor.insertSpaces":{type:"boolean",default:a.EDITOR_MODEL_DEFAULTS.insertSpaces,markdownDescription:i.localize(2,null)},"editor.detectIndentation":{type:"boolean",default:a.EDITOR_MODEL_DEFAULTS.detectIndentation,markdownDescription:i.localize(3,null)},"editor.trimAutoWhitespace":{type:"boolean",default:a.EDITOR_MODEL_DEFAULTS.trimAutoWhitespace, +description:i.localize(4,null)},"editor.largeFileOptimizations":{type:"boolean",default:a.EDITOR_MODEL_DEFAULTS.largeFileOptimizations,description:i.localize(5,null)},"editor.wordBasedSuggestions":{type:"boolean",default:!0,description:i.localize(6,null)},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[i.localize(7,null),i.localize(8,null),i.localize(9,null)],default:"configuredByTheme",description:i.localize(10,null)},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:i.localize(11,null)},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:i.localize(12,null)},"diffEditor.maxComputationTime":{type:"number",default:5e3,description:i.localize(13,null)},"diffEditor.renderSideBySide":{type:"boolean",default:!0,description:i.localize(14,null)},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:!0,description:i.localize(15,null)},"diffEditor.renderIndicators":{type:"boolean",default:!0,description:i.localize(16,null)}, +"diffEditor.codeLens":{type:"boolean",default:!1,description:i.localize(17,null)}}});for(const e of a.editorOptionsRegistry){const t=e.schema;if(void 0!==t)if(void 0!==(S=t).type||void 0!==S.anyOf)b.properties[`editor.${e.name}`]=t;else for(let e in t)g.call(t,e)&&(b.properties[e]=t[e])}var S;let w=null;function y(){return null===w&&(w=Object.create(null),Object.keys(b.properties).forEach(e=>{w[e]=!0})),w}t.isEditorConfigurationKey=function(e){return y()[`editor.${e}`]||!1},t.isDiffEditorConfigurationKey=function(e){return y()[`diffEditor.${e}`]||!1},C.registerConfiguration(b)})),define(t[67],i([0,1,36,4,2,16,353,203,174,38,156]),(function(e,t,i,n,o,s,r,a,l,d,c){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Configuration=t.clearAllFontInfos=void 0;class h{constructor(){this._keys=Object.create(null),this._values=Object.create(null)}has(e){const t=e.getId();return!!this._values[t]}get(e){const t=e.getId();return this._values[t]}put(e,t){const i=e.getId();this._keys[i]=e,this._values[i]=t} +remove(e){const t=e.getId();delete this._keys[t],delete this._values[t]}getValues(){return Object.keys(this._keys).map(e=>this._values[e])}}t.clearAllFontInfos=function(){u.INSTANCE.clearCache()};class u extends o.Disposable{constructor(){super(),this._onDidChange=this._register(new n.Emitter),this.onDidChange=this._onDidChange.event,this._cache=new h,this._evictUntrustedReadingsTimeout=-1}dispose(){-1!==this._evictUntrustedReadingsTimeout&&(clearTimeout(this._evictUntrustedReadingsTimeout),this._evictUntrustedReadingsTimeout=-1),super.dispose()}clearCache(){this._cache=new h,this._onDidChange.fire()}_writeToCache(e,t){this._cache.put(e,t),t.isTrusted||-1!==this._evictUntrustedReadingsTimeout||(this._evictUntrustedReadingsTimeout=setTimeout(()=>{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings()},5e3))}_evictUntrustedReadings(){const e=this._cache.getValues();let t=!1;for(let i=0,n=e.length;i.001){L=!1;break}}let D=!0;L&&S.width!==x&&(D=!1),S.width>b.width&&(D=!1);const k=i.getTimeSinceLastZoomLevelChanged()>2e3;return new c.FontInfo({zoomLevel:i.getZoomLevel(),fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontSize:e.fontSize,fontFeatureSettings:e.fontFeatureSettings,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing,isMonospace:L,typicalHalfwidthCharacterWidth:o.width,typicalFullwidthCharacterWidth:s.width,canUseHalfwidthRightwardsArrow:D,spaceWidth:a.width,middotWidth:w.width,wsmiddotWidth:y.width,maxDigitWidth:E},k)}}u.INSTANCE=new u;class g extends l.CommonEditorConfiguration{ +constructor(e,t,n=null,o){super(e,t),this.accessibilityService=o,this._elementSizeObserver=this._register(new a.ElementSizeObserver(n,t.dimension,()=>this._onReferenceDomElementSizeChanged())),this._register(u.INSTANCE.onDidChange(()=>this._onCSSBasedConfigurationChanged())),this._validatedOptions.get(9)&&this._elementSizeObserver.startObserving(),this._register(i.onDidChangeZoomLevel(e=>this._recomputeOptions())),this._register(this.accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions())),this._recomputeOptions()}static applyFontInfoSlow(e,t){e.style.fontFamily=t.getMassagedFontFamily(),e.style.fontWeight=t.fontWeight,e.style.fontSize=t.fontSize+"px",e.style.fontFeatureSettings=t.fontFeatureSettings,e.style.lineHeight=t.lineHeight+"px",e.style.letterSpacing=t.letterSpacing+"px"}static applyFontInfo(e,t){e.setFontFamily(t.getMassagedFontFamily()),e.setFontWeight(t.fontWeight),e.setFontSize(t.fontSize),e.setFontFeatureSettings(t.fontFeatureSettings),e.setLineHeight(t.lineHeight), +e.setLetterSpacing(t.letterSpacing)}_onReferenceDomElementSizeChanged(){this._recomputeOptions()}_onCSSBasedConfigurationChanged(){this._recomputeOptions()}observeReferenceElement(e){this._elementSizeObserver.observe(e)}dispose(){super.dispose()}_getExtraEditorClassName(){let e="";return i.isSafari||i.isWebkitWebView||(e+="no-user-select "),s.isMacintosh&&(e+="mac "),e}_getEnvConfiguration(){return{extraEditorClassName:this._getExtraEditorClassName(),outerWidth:this._elementSizeObserver.getWidth(),outerHeight:this._elementSizeObserver.getHeight(),emptySelectionClipboard:i.isWebKit||i.isFirefox,pixelRatio:i.getPixelRatio(),zoomLevel:i.getZoomLevel(),accessibilitySupport:this.accessibilityService.isScreenReaderOptimized()?2:this.accessibilityService.getAccessibilitySupport()}}readConfiguration(e){return u.INSTANCE.readConfiguration(e)}}t.Configuration=g})),define(t[542],i([0,1,172,89,8,67]),(function(e,t,i,n,o,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DOMLineBreaksComputerFactory=void 0 +;class r{static create(){return new r}constructor(){}createLineBreaksComputer(e,t,r,d){t|=0,r=+r;let c=[];return{addRequest:(e,t)=>{c.push(e)},finalize:()=>(function(e,t,r,d,c){if(-1===d){const t=[];for(let i=0,n=e.length;ih?(s=0,l=0):d=h-e}const u=n.substr(s),C=a(u,l,r,d,g);p[i]=s,m[i]=l,f[i]=u,_[i]=C[0],v[i]=C[1]}u.innerHTML=g.build(),u.style.position="absolute",u.style.top="10000",u.style.wordWrap="break-word",document.body.appendChild(u);let C=document.createRange();const b=Array.prototype.slice.call(u.children,0);let S=[] +;for(let t=0;t');const r=e.length;let a=t,l=0,d=[],c=[],h=0");for(let t=0;t"),d[t]=l,c[t]=a;const n=h;h=t+1"),d[e.length]=l,c[e.length]=a,s.appendASCIIString(""),[d,c]}function l(e,t,i,n){if(i.length<=1)return null;const o=Array.prototype.slice.call(t.children,0),s=[];try{!function e(t,i,n,o,s,r,a,l){if(o===r)return;s=s||d(t,i,n[o],n[o+1]);a=a||d(t,i,n[r],n[r+1]);if(Math.abs(s[0].top-a[0].top)<=.1)return;if(o+1===r)return void l.push(r);const c=o+(r-o)/2|0;const h=d(t,i,n[c],n[c+1]);e(t,i,n,o,s,c,h,l);e(t,i,n,c,h,r,a,l)}(e,o,n,0,null,i.length-1,null,s)}catch(e){return console.log(e),null}return 0===s.length?null:(s.push(i.length),s)}function d(e,t,i,n){return e.setStart(t[i/16384|0].firstChild,i%16384),e.setEnd(t[n/16384|0].firstChild,n%16384),e.getClientRects()}t.DOMLineBreaksComputerFactory=r})),define(t[543],i([0,1,30,67,157,43]),(function(e,t,i,n,o,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}), +t.MarginViewOverlays=t.ContentViewOverlays=t.ViewOverlayLine=t.ViewOverlays=void 0;class r extends s.ViewPart{constructor(e){super(e),this._visibleLines=new o.VisibleLinesCollection(this),this.domNode=this._visibleLines.domNode,this._dynamicOverlays=[],this._isFocused=!1,this.domNode.setClassName("view-overlays")}shouldRender(){if(super.shouldRender())return!0;for(let e=0,t=this._dynamicOverlays.length;ee.shouldRender());for(let i=0,n=t.length;i'),n.appendASCIIString(o),n.appendASCIIString(""),!0)}layoutLine(e,t){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(this._lineHeight))}}t.ViewOverlayLine=a;t.ContentViewOverlays=class extends r{constructor(e){super(e);const t=this._context.configuration.options.get(117);this._contentWidth=t.contentWidth, +this.domNode.setHeight(0)}onConfigurationChanged(e){const t=this._context.configuration.options.get(117);return this._contentWidth=t.contentWidth,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollWidthChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e),this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth))}};t.MarginViewOverlays=class extends r{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(117);this._contentLeft=i.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),n.Configuration.applyFontInfo(this.domNode,t.get(36))}onConfigurationChanged(e){const t=this._context.configuration.options;n.Configuration.applyFontInfo(this.domNode,t.get(36));const i=t.get(117);return this._contentLeft=i.contentLeft,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollHeightChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e) +;const t=Math.min(e.scrollHeight,1e6);this.domNode.setHeight(t),this.domNode.setWidth(this._contentLeft)}}})),define(t[544],i([0,1,7,30,8,67,38,13,3,116]),(function(e,t,i,n,o,s,r,a,l,d){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ViewCursor=void 0;class c{constructor(e,t,i,n,o,s){this.top=e,this.left=t,this.width=i,this.height=n,this.textContent=o,this.textContentClassName=s}}t.ViewCursor=class{constructor(e){this._context=e;const t=this._context.configuration.options,i=t.get(36);this._cursorStyle=t.get(19),this._lineHeight=t.get(51),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(22),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=n.createFastDomNode(document.createElement("div")),this._domNode.setClassName(`cursor ${d.MOUSE_CURSOR_TEXT_CSS_CLASS_NAME}`),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),s.Configuration.applyFontInfo(this._domNode,i), +this._domNode.setDisplay("none"),this._position=new a.Position(1,1),this._lastRenderedContent="",this._renderData=null}getDomNode(){return this._domNode}getPosition(){return this._position}show(){this._isVisible||(this._domNode.setVisibility("inherit"),this._isVisible=!0)}hide(){this._isVisible&&(this._domNode.setVisibility("hidden"),this._isVisible=!1)}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(36);return this._cursorStyle=t.get(19),this._lineHeight=t.get(51),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(22),this._typicalHalfwidthCharacterWidth),s.Configuration.applyFontInfo(this._domNode,i),!0}onCursorPositionChanged(e){return this._position=e,!0}_prepareRender(e){let t="";if(this._cursorStyle===r.TextEditorCursorStyle.Line||this._cursorStyle===r.TextEditorCursorStyle.LineThin){const n=e.visibleRangeForPosition(this._position);if(!n||n.outsideRenderedLine)return null;let s +;if(this._cursorStyle===r.TextEditorCursorStyle.Line){if((s=i.computeScreenAwareSize(this._lineCursorWidth>0?this._lineCursorWidth:2))>2){const e=this._context.model.getLineContent(this._position.lineNumber),i=o.nextCharLength(e,this._position.column-1);t=e.substr(this._position.column-1,i)}}else s=i.computeScreenAwareSize(1);let a=n.left;s>=2&&a>=1&&(a-=1);const l=e.getVerticalOffsetForLineNumber(this._position.lineNumber)-e.bigNumbersDelta;return new c(l,a,s,this._lineHeight,t,"")}const n=this._context.model.getLineContent(this._position.lineNumber),s=o.nextCharLength(n,this._position.column-1),a=e.linesVisibleRangesForRange(new l.Range(this._position.lineNumber,this._position.column,this._position.lineNumber,this._position.column+s),!1);if(!a||0===a.length)return null;const d=a[0];if(d.outsideRenderedLine||0===d.ranges.length)return null;const h=d.ranges[0],u=h.width<1?this._typicalHalfwidthCharacterWidth:h.width;let g="";if(this._cursorStyle===r.TextEditorCursorStyle.Block){ +const e=this._context.model.getViewLineData(this._position.lineNumber);t=n.substr(this._position.column-1,s);const i=e.tokens.findTokenIndexAtOffset(this._position.column-1);g=e.tokens.getClassName(i)}let p=e.getVerticalOffsetForLineNumber(this._position.lineNumber)-e.bigNumbersDelta,m=this._lineHeight;return this._cursorStyle!==r.TextEditorCursorStyle.Underline&&this._cursorStyle!==r.TextEditorCursorStyle.UnderlineThin||(p+=this._lineHeight-2,m=2),new c(p,h.left,u,m,t,g)}prepareRender(e){this._renderData=this._prepareRender(e)}render(e){return this._renderData?(this._lastRenderedContent!==this._renderData.textContent&&(this._lastRenderedContent=this._renderData.textContent,this._domNode.domNode.textContent=this._lastRenderedContent),this._domNode.setClassName(`cursor ${d.MOUSE_CURSOR_TEXT_CSS_CLASS_NAME} ${this._renderData.textContentClassName}`),this._domNode.setDisplay("block"),this._domNode.setTop(this._renderData.top),this._domNode.setLeft(this._renderData.left), +this._domNode.setWidth(this._renderData.width),this._domNode.setLineHeight(this._renderData.height),this._domNode.setHeight(this._renderData.height),{domNode:this._domNode.domNode,position:this._position,contentLeft:this._renderData.left,height:this._renderData.height,width:2}):(this._domNode.setDisplay("none"),null)}}})),define(t[545],i([0,1,12,4,2,280,8,18,135,74,93,34]),(function(e,t,i,n,o,s,r,a,l,d,c,h){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LanguagesRegistry=void 0;const u=Object.prototype.hasOwnProperty;class g extends o.Disposable{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new n.Emitter),this.onDidChange=this._onDidChange.event,this._warnOnOverwrite=t,this._nextLanguageId2=1,this._languageIdToLanguage=[],this._languageToLanguageId=Object.create(null),this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(l.ModesRegistry.onDidChangeLanguages(e=>this._initializeFromRegistry())))} +_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={};const e=l.ModesRegistry.getLanguages();this._registerLanguages(e)}_registerLanguages(e){for(const t of e)this._registerLanguage(t);this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Object.keys(this._languages).forEach(e=>{let t=this._languages[e];t.name&&(this._nameMap[t.name]=t.identifier),t.aliases.forEach(e=>{this._lowercaseNameMap[e.toLowerCase()]=t.identifier}),t.mimetypes.forEach(e=>{this._mimeTypesMap[e]=t.identifier})}),h.Registry.as(c.Extensions.Configuration).registerOverrideIdentifiers(l.ModesRegistry.getLanguages().map(e=>e.id)),this._onDidChange.fire()}_getLanguageId(e){if(this._languageToLanguageId[e])return this._languageToLanguageId[e];const t=this._nextLanguageId2++;return this._languageIdToLanguage[t]=e,this._languageToLanguageId[e]=t,t}_registerLanguage(e){const t=e.id;let i;if(u.call(this._languages,t))i=this._languages[t];else{const e=this._getLanguageId(t);i={ +identifier:new a.LanguageIdentifier(t,e),name:null,mimetypes:[],aliases:[],extensions:[],filenames:[],configurationFiles:[]},this._languages[t]=i}this._mergeLanguage(i,e)}_mergeLanguage(e,t){const n=t.id;let o=null;if(Array.isArray(t.mimetypes)&&t.mimetypes.length>0&&(e.mimetypes.push(...t.mimetypes),o=t.mimetypes[0]),o||(o=`text/x-${n}`,e.mimetypes.push(o)),Array.isArray(t.extensions)){t.configuration?e.extensions=t.extensions.concat(e.extensions):e.extensions=e.extensions.concat(t.extensions);for(let e of t.extensions)s.registerTextMime({id:n,mime:o,extension:e},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(let i of t.filenames)s.registerTextMime({id:n,mime:o,filename:i},this._warnOnOverwrite),e.filenames.push(i);if(Array.isArray(t.filenamePatterns))for(let e of t.filenamePatterns)s.registerTextMime({id:n,mime:o,filepattern:e},this._warnOnOverwrite);if("string"==typeof t.firstLine&&t.firstLine.length>0){let e=t.firstLine;"^"!==e.charAt(0)&&(e="^"+e);try{let t=new RegExp(e) +;r.regExpLeadsToEndlessLoop(t)||s.registerTextMime({id:n,mime:o,firstline:t},this._warnOnOverwrite)}catch(e){i.onUnexpectedError(e)}}e.aliases.push(n);let a=null;if(void 0!==t.aliases&&Array.isArray(t.aliases)&&(a=0===t.aliases.length?[null]:t.aliases),null!==a)for(const t of a)t&&0!==t.length&&e.aliases.push(t);let l=null!==a&&a.length>0;if(l&&null===a[0]);else{let t=(l?a[0]:null)||n;!l&&e.name||(e.name=t)}t.configuration&&e.configurationFiles.push(t.configuration)}isRegisteredMode(e){return!!u.call(this._mimeTypesMap,e)||u.call(this._languages,e)}getModeIdForLanguageNameLowercase(e){return u.call(this._lowercaseNameMap,e)?this._lowercaseNameMap[e].language:null}extractModeIds(e){return e?e.split(",").map(e=>e.trim()).map(e=>u.call(this._mimeTypesMap,e)?this._mimeTypesMap[e].language:e).filter(e=>u.call(this._languages,e)):[]}getLanguageIdentifier(e){if(e===d.NULL_MODE_ID||0===e)return d.NULL_LANGUAGE_IDENTIFIER;let t;if("string"==typeof e)t=e;else if(!(t=this._languageIdToLanguage[e]))return null +;return u.call(this._languages,t)?this._languages[t].identifier:null}getModeIdsFromFilepathOrFirstLine(e,t){if(!e&&!t)return[];let i=s.guessMimeTypes(e,t);return this.extractModeIds(i.join(","))}}t.LanguagesRegistry=g})),define(t[546],i([0,1,4,2,365,74,545,19]),(function(e,t,i,n,o,s,r,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ModeServiceImpl=void 0;class l extends n.Disposable{constructor(e,t){super(),this._onDidChange=this._register(new i.Emitter),this.onDidChange=this._onDidChange.event,this._selector=t,this.languageIdentifier=this._selector(),this._register(e(()=>this._evaluate()))}_evaluate(){let e=this._selector();e.id!==this.languageIdentifier.id&&(this.languageIdentifier=e,this._onDidChange.fire(this.languageIdentifier))}}t.ModeServiceImpl=class{constructor(e=!1){this._onDidCreateMode=new i.Emitter,this.onDidCreateMode=this._onDidCreateMode.event,this._onLanguagesMaybeChanged=new i.Emitter,this.onLanguagesMaybeChanged=this._onLanguagesMaybeChanged.event, +this._instantiatedModes={},this._registry=new r.LanguagesRegistry(!0,e),this._registry.onDidChange(()=>this._onLanguagesMaybeChanged.fire())}isRegisteredMode(e){return this._registry.isRegisteredMode(e)}getModeIdForLanguageName(e){return this._registry.getModeIdForLanguageNameLowercase(e)}getModeIdByFilepathOrFirstLine(e,t){const i=this._registry.getModeIdsFromFilepathOrFirstLine(e,t);return a.firstOrDefault(i,null)}getModeId(e){const t=this._registry.extractModeIds(e);return a.firstOrDefault(t,null)}getLanguageIdentifier(e){return this._registry.getLanguageIdentifier(e)}create(e){return new l(this.onLanguagesMaybeChanged,()=>{const t=this.getModeId(e);return this._createModeAndGetLanguageIdentifier(t)})}createByFilepathOrFirstLine(e,t){return new l(this.onLanguagesMaybeChanged,()=>{const i=this.getModeIdByFilepathOrFirstLine(e,t);return this._createModeAndGetLanguageIdentifier(i)})}_createModeAndGetLanguageIdentifier(e){const t=this.getLanguageIdentifier(e||"plaintext")||s.NULL_LANGUAGE_IDENTIFIER +;return this._getOrCreateMode(t.language),t}triggerMode(e){const t=this.getModeId(e);this._getOrCreateMode(t||"plaintext")}_getOrCreateMode(e){if(!this._instantiatedModes.hasOwnProperty(e)){let t=this.getLanguageIdentifier(e)||s.NULL_LANGUAGE_IDENTIFIER;this._instantiatedModes[e]=new o.FrankensteinMode(t),this._onDidCreateMode.fire(this._instantiatedModes[e])}return this._instantiatedModes[e]}}})),define(t[46],i([0,1,34,10,93]),(function(e,t,i,n,o){"use strict";function s(e,t,i,n){const o=t.split("."),s=o.pop();let r=e;for(let e=0;econsole.error(`Conflict in default settings: ${e}`))}return e}})),define(t[547],i([0,1,2,62,4,17,46]),(function(e,t,i,n,o,s,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AccessibilityService=void 0;let d=class extends i.Disposable{constructor(e,t){super(),this._contextKeyService=e,this._configurationService=t,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new o.Emitter,this._accessibilityModeEnabledContext=n.CONTEXT_ACCESSIBILITY_MODE_ENABLED.bindTo(this._contextKeyService);const i=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration("editor.accessibilitySupport")&&(i(),this._onDidChangeScreenReaderOptimized.fire())})),i(),this.onDidChangeScreenReaderOptimized(()=>i())}get onDidChangeScreenReaderOptimized(){ +return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return"on"===e||"auto"===e&&2===this._accessibilitySupport}getAccessibilitySupport(){return this._accessibilitySupport}};d=a([l(0,s.IContextKeyService),l(1,r.IConfigurationService)],d),t.AccessibilityService=d})),define(t[548],i([0,1,59,19,23,37,24,93,46]),(function(e,t,i,n,o,s,r,a,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationChangeEvent=t.Configuration=t.DefaultConfigurationModel=t.ConfigurationModel=void 0;class d{constructor(e={},t=[],i=[]){this._contents=e,this._keys=t,this._overrides=i,this.isFrozen=!1}get contents(){return this.checkAndFreeze(this._contents)}get overrides(){return this.checkAndFreeze(this._overrides)}get keys(){return this.checkAndFreeze(this._keys)}isEmpty(){return 0===this._keys.length&&0===Object.keys(this._contents).length&&0===this._overrides.length}getValue(e){ +return e?l.getConfigurationValue(this.contents,e):this.contents}override(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||"object"!=typeof t||!Object.keys(t).length)return this;let i={};for(const e of n.distinct([...Object.keys(this.contents),...Object.keys(t)])){let n=this.contents[e],o=t[e];o&&("object"==typeof n&&"object"==typeof o?(n=s.deepClone(n),this.mergeContents(n,o)):n=o),i[e]=n}return new d(i,this.keys,this.overrides)}merge(...e){const t=s.deepClone(this.contents),i=s.deepClone(this.overrides),o=[...this.keys];for(const r of e){this.mergeContents(t,r.contents);for(const e of r.overrides){const[t]=i.filter(t=>n.equals(t.identifiers,e.identifiers));t?this.mergeContents(t.contents,e.contents):i.push(s.deepClone(e))}for(const e of r.keys)-1===o.indexOf(e)&&o.push(e)}return new d(t,o,i)}freeze(){return this.isFrozen=!0,this}mergeContents(e,t){for(const i of Object.keys(t))i in e&&o.isObject(e[i])&&o.isObject(t[i])?this.mergeContents(e[i],t[i]):e[i]=s.deepClone(t[i])}checkAndFreeze(e){ +return this.isFrozen&&!Object.isFrozen(e)?s.deepFreeze(e):e}getContentsForOverrideIdentifer(e){for(const t of this.overrides)if(-1!==t.identifiers.indexOf(e))return t.contents;return null}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}setValue(e,t){this.addKey(e),l.addToValueTree(this.contents,e,t,e=>{throw new Error(e)})}removeValue(e){this.removeKey(e)&&l.removeFromValueTree(this.contents,e)}addKey(e){let t=this.keys.length;for(let i=0;iconsole.error(`Conflict in default settings file: ${e}`))});super(e,t,i)}} +;class c{constructor(e,t,n=new d,o=new d,s=new i.ResourceMap,r=new d,a=new i.ResourceMap,l=!0){this._defaultConfiguration=e,this._localUserConfiguration=t,this._remoteUserConfiguration=n,this._workspaceConfiguration=o,this._folderConfigurations=s,this._memoryConfiguration=r,this._memoryConfigurationByResource=a,this._freeze=l,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new i.ResourceMap,this._userConfiguration=null}getValue(e,t,i){return this.getConsolidateConfigurationModel(t,i).getValue(e)}updateValue(e,t,i={}){let n;i.resource?(n=this._memoryConfigurationByResource.get(i.resource))||(n=new d,this._memoryConfigurationByResource.set(i.resource,n)):n=this._memoryConfiguration,void 0===t?n.removeValue(e):n.setValue(e,t),i.resource||(this._workspaceConsolidatedConfiguration=null)}get userConfiguration(){ +return this._userConfiguration||(this._userConfiguration=this._remoteUserConfiguration.isEmpty()?this._localUserConfiguration:this._localUserConfiguration.merge(this._remoteUserConfiguration),this._freeze&&this._userConfiguration.freeze()),this._userConfiguration}getConsolidateConfigurationModel(e,t){let i=this.getConsolidatedConfigurationModelForResource(e,t);return e.overrideIdentifier?i.override(e.overrideIdentifier):i}getConsolidatedConfigurationModelForResource({resource:e},t){let i=this.getWorkspaceConsolidatedConfiguration();if(t&&e){const n=t.getFolder(e);n&&(i=this.getFolderConsolidatedConfiguration(n.uri)||i);const o=this._memoryConfigurationByResource.get(e);o&&(i=i.merge(o))}return i}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration), +this._freeze&&(this._workspaceConfiguration=this._workspaceConfiguration.freeze())),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(e){let t=this._foldersConsolidatedConfigurations.get(e);if(!t){const i=this.getWorkspaceConsolidatedConfiguration(),n=this._folderConfigurations.get(e);n?(t=i.merge(n),this._freeze&&(t=t.freeze()),this._foldersConsolidatedConfigurations.set(e,t)):t=i}return t}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},user:{contents:this.userConfiguration.contents,overrides:this.userConfiguration.overrides,keys:this.userConfiguration.keys},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:[...this._folderConfigurations.keys()].reduce((e,t)=>{const{contents:i,overrides:n,keys:o}=this._folderConfigurations.get(t);return e.push([t,{contents:i,overrides:n, +keys:o}]),e},[])}}static parse(e){const t=this.parseConfigurationModel(e.defaults),n=this.parseConfigurationModel(e.user),o=this.parseConfigurationModel(e.workspace),s=e.folders.reduce((e,t)=>(e.set(r.URI.revive(t[0]),this.parseConfigurationModel(t[1])),e),new i.ResourceMap);return new c(t,n,new d,o,s,new d,new i.ResourceMap,!1)}static parseConfigurationModel(e){return new d(e.contents,e.keys,e.overrides).freeze()}}t.Configuration=c;t.ConfigurationChangeEvent=class{constructor(e,t,i,n){this.change=e,this.previous=t,this.currentConfiguraiton=i,this.currentWorkspace=n,this._previousConfiguration=void 0;const o=new Set;e.keys.forEach(e=>o.add(e)),e.overrides.forEach(([,e])=>e.forEach(e=>o.add(e))),this.affectedKeys=[...o.values()];const s=new d;this.affectedKeys.forEach(e=>s.setValue(e,{})),this.affectedKeysTree=s.contents}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=c.parse(this.previous.data)),this._previousConfiguration}affectsConfiguration(e,t){ +var i;if(this.doesAffectedKeysTreeContains(this.affectedKeysTree,e)){if(t){const n=this.previousConfiguration?this.previousConfiguration.getValue(e,t,null===(i=this.previous)||void 0===i?void 0:i.workspace):void 0,o=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!s.equals(n,o)}return!0}return!1}doesAffectedKeysTreeContains(e,t){let i,n=l.toValuesTree({[t]:!0},()=>{});for(;"object"==typeof n&&(i=Object.keys(n)[0]);){if(!(e=e[i]))return!1;n=n[i]}return!0}}})),define(t[549],i([0,1,4,2,28,46,17,239]),(function(e,t,i,n,o,s,r,d){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContextKeyService=t.AbstractContextKeyService=t.Context=void 0;const c="data-keybinding-context";class h{constructor(e,t){this._id=e,this._parent=t,this._value=Object.create(null),this._value._contextId=e}setValue(e,t){return this._value[e]!==t&&(this._value[e]=t,!0)}removeValue(e){return e in this._value&&(delete this._value[e],!0)}getValue(e){const t=this._value[e] +;return void 0===t&&this._parent?this._parent.getValue(e):t}}t.Context=h;class u extends h{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}}u.INSTANCE=new u;class g extends h{constructor(e,t,i){super(e,null),this._configurationService=t,this._values=new Map,this._listener=this._configurationService.onDidChangeConfiguration(e=>{if(6===e.source){const e=Array.from(this._values.keys());this._values.clear(),i.fire(new f(e))}else{const t=[];for(const i of e.affectedKeys){const e=`config.${i}`;this._values.has(e)&&(this._values.delete(e),t.push(e))}i.fire(new f(t))}})}dispose(){this._listener.dispose()}getValue(e){if(0!==e.indexOf(g._keyPrefix))return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(g._keyPrefix.length),i=this._configurationService.getValue(t);let n=void 0;switch(typeof i){case"number":case"boolean":case"string":n=i;break;default:Array.isArray(i)&&(n=JSON.stringify(i))}return this._values.set(e,n),n}setValue(e,t){ +return super.setValue(e,t)}removeValue(e){return super.removeValue(e)}}g._keyPrefix="config.";class p{constructor(e,t,i){this._service=e,this._key=t,this._defaultValue=i,this.reset()}set(e){this._service.setContext(this._key,e)}reset(){void 0===this._defaultValue?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}}class m{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}}class f{constructor(e){this.keys=e}affectsSome(e){for(const t of this.keys)if(e.has(t))return!0;return!1}}class _{constructor(e){this.events=e}affectsSome(e){for(const t of this.events)if(t.affectsSome(e))return!0;return!1}}class v{constructor(e){this._onDidChangeContext=new i.PauseableEmitter({merge:e=>new _(e)}),this._isDisposed=!1,this._myContextId=e}createKey(e,t){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new p(this,e,t)}get onDidChangeContext(){ +return this._onDidChangeContext.event}bufferChangeEvents(e){this._onDidChangeContext.pause();try{e()}finally{this._onDidChangeContext.resume()}}createScoped(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new b(this,e)}contextMatchesRules(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");const t=this.getContextValuesContainer(this._myContextId);return d.KeybindingResolver.contextMatchesRules(t,e)}getContextKeyValue(e){if(!this._isDisposed)return this.getContextValuesContainer(this._myContextId).getValue(e)}setContext(e,t){if(this._isDisposed)return;const i=this.getContextValuesContainer(this._myContextId);i&&i.setValue(e,t)&&this._onDidChangeContext.fire(new m(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new m(e))}getContext(e){return this._isDisposed?u.INSTANCE:this.getContextValuesContainer(function(e){for(;e;){if(e.hasAttribute(c)){ +const t=e.getAttribute(c);return t?parseInt(t,10):NaN}e=e.parentElement}return 0}(e))}}t.AbstractContextKeyService=v;let C=class extends v{constructor(e){super(0),this._contexts=new Map,this._toDispose=new n.DisposableStore,this._lastContextId=0;const t=new g(this._myContextId,e,this._onDidChangeContext);this._contexts.set(this._myContextId,t),this._toDispose.add(t)}dispose(){this._isDisposed=!0,this._toDispose.dispose()}getContextValuesContainer(e){return this._isDisposed?u.INSTANCE:this._contexts.get(e)||u.INSTANCE}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ContextKeyService has been disposed");let t=++this._lastContextId;return this._contexts.set(t,new h(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};C=a([l(0,s.IConfigurationService)],C),t.ContextKeyService=C;class b extends v{constructor(e,t){super(e.createChildContext()),this._parent=e,t&&(this._domNode=t,this._domNode.setAttribute(c,String(this._myContextId)))} +dispose(){this._isDisposed=!0,this._parent.disposeContext(this._myContextId),this._domNode&&(this._domNode.removeAttribute(c),this._domNode=void 0)}get onDidChangeContext(){return i.Event.any(this._parent.onDidChangeContext,this._onDidChangeContext.event)}getContextValuesContainer(e){return this._isDisposed?u.INSTANCE:this._parent.getContextValuesContainer(e)}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ScopedContextKeyService has been disposed");return this._parent.createChildContext(e)}disposeContext(e){this._isDisposed||this._parent.disposeContext(e)}}o.CommandsRegistry.registerCommand(r.SET_CONTEXT_COMMAND_ID,(function(e,t,i){e.get(r.IContextKeyService).createKey(String(t),i)}))})),define(t[83],i([0,1,39,16,28,34]),(function(e,t,i,n,o,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Extensions=t.KeybindingsRegistry=void 0;class r{constructor(){this._coreKeybindings=[],this._extensionKeybindings=[],this._cachedMergedKeybindings=null} +static bindToCurrentPlatform(e){if(1===n.OS){if(e&&e.win)return e.win}else if(2===n.OS){if(e&&e.mac)return e.mac}else if(e&&e.linux)return e.linux;return e}registerKeybindingRule(e){const t=r.bindToCurrentPlatform(e);if(t&&t.primary){const o=i.createKeybinding(t.primary,n.OS);o&&this._registerDefaultKeybinding(o,e.id,e.args,e.weight,0,e.when)}if(t&&Array.isArray(t.secondary))for(let o=0,s=t.secondary.length;o=21&&e<=30||(e>=31&&e<=56||(80===e||81===e||82===e||83===e||84===e||85===e||86===e||110===e||111===e||87===e||88===e||89===e||90===e||91===e||92===e))}_assertNoCtrlAlt(e,t){ +e.ctrlKey&&e.altKey&&!e.metaKey&&r._mightProduceChar(e.keyCode)&&console.warn("Ctrl+Alt+ keybindings should not be used by default under Windows. Offender: ",e," for ",t)}_registerDefaultKeybinding(e,t,i,o,s,r){1===n.OS&&this._assertNoCtrlAlt(e.parts[0],t),this._coreKeybindings.push({keybinding:e,command:t,commandArgs:i,when:r,weight1:o,weight2:s,extensionId:null}),this._cachedMergedKeybindings=null}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=[].concat(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(a)),this._cachedMergedKeybindings.slice(0)}}function a(e,t){return e.weight1!==t.weight1?e.weight1-t.weight1:e.commandt.command?1:e.weight2-t.weight2}t.KeybindingsRegistry=new r,t.Extensions={EditorModes:"platform.keybindingsRegistry"},s.Registry.add(t.Extensions.EditorModes,t.KeybindingsRegistry)})),define(t[550],i([0,1,17,413,83,414]),(function(e,t,i,n,o,s){"use strict";function r(e,t){ +return e.getContext(document.activeElement).getValue(t)}function d(e,n){const o=function(e,t){return e.createScoped(t.target)}(e,n);return function(e,t,n){new i.RawContextKey(n,t).bindTo(e)}(o,n,t.HistoryNavigationWidgetContext),{scopedContextKeyService:o,historyNavigationEnablement:new i.RawContextKey(t.HistoryNavigationEnablementContext,!0).bindTo(o)}}Object.defineProperty(t,"__esModule",{value:!0}),t.ContextScopedReplaceInput=t.ContextScopedFindInput=t.createAndBindHistoryNavigationWidgetScopedContextKeyService=t.HistoryNavigationEnablementContext=t.HistoryNavigationWidgetContext=void 0,t.HistoryNavigationWidgetContext="historyNavigationWidget",t.HistoryNavigationEnablementContext="historyNavigationEnabled",t.createAndBindHistoryNavigationWidgetScopedContextKeyService=d;let c=class extends n.FindInput{constructor(e,t,i,n,o=!1){super(e,t,o,i),this._register(d(n,{target:this.inputBox.element,historyNavigator:this.inputBox}).scopedContextKeyService)}};c=a([l(3,i.IContextKeyService)],c), +t.ContextScopedFindInput=c;let h=class extends s.ReplaceInput{constructor(e,t,i,n,o=!1){super(e,t,o,i),this._register(d(n,{target:this.inputBox.element,historyNavigator:this.inputBox}).scopedContextKeyService)}};h=a([l(3,i.IContextKeyService)],h),t.ContextScopedReplaceInput=h,o.KeybindingsRegistry.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:i.ContextKeyExpr.and(i.ContextKeyExpr.has(t.HistoryNavigationWidgetContext),i.ContextKeyExpr.equals(t.HistoryNavigationEnablementContext,!0)),primary:16,secondary:[528],handler:(e,n)=>{const o=r(e.get(i.IContextKeyService),t.HistoryNavigationWidgetContext);if(o){o.historyNavigator.showPreviousValue()}}}),o.KeybindingsRegistry.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:i.ContextKeyExpr.and(i.ContextKeyExpr.has(t.HistoryNavigationWidgetContext),i.ContextKeyExpr.equals(t.HistoryNavigationEnablementContext,!0)),primary:18,secondary:[530],handler:(e,n)=>{ +const o=r(e.get(i.IContextKeyService),t.HistoryNavigationWidgetContext);if(o){o.historyNavigator.showNextValue()}}})})),define(t[94],i([0,1,34,19,2]),(function(e,t,i,n,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QuickAccessRegistry=t.Extensions=t.DefaultQuickAccessFilterValue=void 0,function(e){e[e.PRESERVE=0]="PRESERVE",e[e.LAST=1]="LAST"}(t.DefaultQuickAccessFilterValue||(t.DefaultQuickAccessFilterValue={})),t.Extensions={Quickaccess:"workbench.contributions.quickaccess"};class s{constructor(){this.providers=[],this.defaultProvider=void 0}registerQuickAccessProvider(e){return 0===e.prefix.length?this.defaultProvider=e:this.providers.push(e),this.providers.sort((e,t)=>t.prefix.length-e.prefix.length),o.toDisposable(()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)})}getQuickAccessProviders(){return n.coalesce([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){ +return e&&this.providers.find(t=>e.startsWith(t.prefix))||void 0||this.defaultProvider}}t.QuickAccessRegistry=s,i.Registry.add(t.Extensions.Quickaccess,new s)})),define(t[551],i([0,1,75,94,34,502,2]),(function(e,t,i,n,o,s,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HelpQuickAccessProvider=void 0;let d=class e{constructor(e){this.quickInputService=e,this.registry=o.Registry.as(n.Extensions.Quickaccess)}provide(t){const i=new r.DisposableStore;i.add(t.onDidAccept(()=>{const[e]=t.selectedItems;e&&this.quickInputService.quickAccess.show(e.prefix,{preserveValue:!0})})),i.add(t.onDidChangeValue(t=>{const i=this.registry.getQuickAccessProvider(t.substr(e.PREFIX.length));i&&i.prefix&&i.prefix!==e.PREFIX&&this.quickInputService.quickAccess.show(i.prefix,{preserveValue:!0})}));const{editorProviders:n,globalProviders:o}=this.getQuickAccessProviders();return t.items=0===n.length||0===o.length?[...0===n.length?o:n]:[{label:s.localize(0,null),type:"separator"},...o,{label:s.localize(1,null), +type:"separator"},...n],i}getQuickAccessProviders(){const t=[],i=[];for(const n of this.registry.getQuickAccessProviders().sort((e,t)=>e.prefix.localeCompare(t.prefix)))if(n.prefix!==e.PREFIX)for(const e of n.helpEntries){const o=e.prefix||n.prefix,r=o||"…";(e.needsEditor?i:t).push({prefix:o,label:r,ariaLabel:s.localize(2,null,r,e.description),description:e.description})}return{editorProviders:i,globalProviders:t}}};d.PREFIX="?",d=a([l(0,i.IQuickInputService)],d),t.HelpQuickAccessProvider=d})),define(t[552],i([0,1,34,94,61,551]),(function(e,t,i,n,o,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),i.Registry.as(n.Extensions.Quickaccess).registerQuickAccessProvider({ctor:s.HelpQuickAccessProvider,prefix:"",helpEntries:[{description:o.QuickHelpNLS.helpQuickAccessActionLabel,needsEditor:!0}]})})),define(t[553],i([0,1,75,2,94,34,25,10,85]),(function(e,t,i,n,o,s,r,d,c){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QuickAccessController=void 0;let h=class extends n.Disposable{ +constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=s.Registry.as(o.Extensions.Quickaccess),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0}show(e="",t){var s;const[r,a]=this.getOrInstantiateProvider(e),l=this.visibleQuickAccess,d=null==l?void 0:l.descriptor;if(l&&a&&d===a)return e===a.prefix||(null==t?void 0:t.preserveValue)||(l.picker.value=e),void this.adjustValueSelection(l.picker,a,t);if(a&&!(null==t?void 0:t.preserveValue)){let t=void 0;if(l&&d&&d!==a){const e=l.value.substr(d.prefix.length);e&&(t=`${a.prefix}${e}`)}if(!t){const e=null==r?void 0:r.defaultFilterValue;e===o.DefaultQuickAccessFilterValue.LAST?t=this.lastAcceptedPickerValues.get(a):"string"==typeof e&&(t=`${a.prefix}${e}`)}"string"==typeof t&&(e=t)}const c=new n.DisposableStore,h=c.add(this.quickInputService.createQuickPick());h.value=e,this.adjustValueSelection(h,a,t),h.placeholder=null==a?void 0:a.placeholder, +h.quickNavigate=null==t?void 0:t.quickNavigateConfiguration,h.hideInput=!!h.quickNavigate&&!l,("number"==typeof(null==t?void 0:t.itemActivation)||(null==t?void 0:t.quickNavigateConfiguration))&&(h.itemActivation=null!==(s=null==t?void 0:t.itemActivation)&&void 0!==s?s:i.ItemActivation.SECOND),h.contextKey=null==a?void 0:a.contextKey,h.filterValue=e=>e.substring(a?a.prefix.length:0),(null==a?void 0:a.placeholder)&&(h.ariaLabel=null==a?void 0:a.placeholder);const u=this.registerPickerListeners(h,r,a,e,c);r&&c.add(r.provide(h,u)),h.show()}adjustValueSelection(e,t,i){var n;let o;o=(null==i?void 0:i.preserveValue)?[e.value.length,e.value.length]:[null!==(n=null==t?void 0:t.prefix.length)&&void 0!==n?n:0,e.value.length],e.valueSelection=o}registerPickerListeners(e,t,i,o,s){const a=this.visibleQuickAccess={picker:e,descriptor:i,value:o};s.add(n.toDisposable(()=>{a===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)})),s.add(e.onDidChangeValue(e=>{const[i]=this.getOrInstantiateProvider(e);i!==t?this.show(e,{ +preserveValue:!0}):a.value=e})),i&&s.add(e.onDidAccept(()=>{this.lastAcceptedPickerValues.set(i,e.value)}));const l=s.add(new r.CancellationTokenSource);return c.once(e.onDidHide)(()=>{0===e.selectedItems.length&&l.cancel(),s.dispose()}),l.token}getOrInstantiateProvider(e){const t=this.registry.getQuickAccessProvider(e);if(!t)return[void 0,void 0];let i=this.mapProviderToDescriptor.get(t);return i||(i=this.instantiationService.createInstance(t.ctor),this.mapProviderToDescriptor.set(t,i)),[i,t]}};h=a([l(0,i.IQuickInputService),l(1,d.IInstantiationService)],h),t.QuickAccessController=h})),define(t[76],i([0,1,10,4,2,23]),(function(e,t,i,n,o,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InMemoryStorageService=t.WillSaveStateReason=t.IStorageService=void 0,t.IStorageService=i.createDecorator("storageService"),function(e){e[e.NONE=0]="NONE",e[e.SHUTDOWN=1]="SHUTDOWN"}(t.WillSaveStateReason||(t.WillSaveStateReason={}));class r extends o.Disposable{constructor(){super(...arguments), +this._onDidChangeStorage=this._register(new n.Emitter),this._onWillSaveState=this._register(new n.Emitter),this.onWillSaveState=this._onWillSaveState.event,this.globalCache=new Map,this.workspaceCache=new Map}getCache(e){return 0===e?this.globalCache:this.workspaceCache}get(e,t,i){const n=this.getCache(t).get(e);return s.isUndefinedOrNull(n)?i:n}getBoolean(e,t,i){const n=this.getCache(t).get(e);return s.isUndefinedOrNull(n)?i:"true"===n}getNumber(e,t,i){const n=this.getCache(t).get(e);return s.isUndefinedOrNull(n)?i:parseInt(n,10)}store(e,t,i){if(s.isUndefinedOrNull(t))return this.remove(e,i);const n=String(t);return this.getCache(i).get(e)===n?Promise.resolve():(this.getCache(i).set(e,n),this._onDidChangeStorage.fire({scope:i,key:e}),Promise.resolve())}remove(e,t){return this.getCache(t).delete(e)?(this._onDidChangeStorage.fire({scope:t,key:e}),Promise.resolve()):Promise.resolve()}}t.InMemoryStorageService=r})),define(t[554],i([0,1,59,76,18,2,15,10,46,71,73]),(function(e,t,i,n,o,s,r,d,c,h,u){"use strict" +;Object.defineProperty(t,"__esModule",{value:!0}),t.ISuggestMemoryService=t.SuggestMemoryService=t.PrefixMemory=t.LRUMemory=t.NoMemory=t.Memory=void 0;class g{constructor(e){this.name=e}select(e,t,i){if(0===i.length)return 0;let n=i[0].score[0];for(let e=0;ea&&o.type===i[t].completion.kind&&o.insertText===i[t].completion.insertText&&(a=o.touch,r=t),i[t].completion.preselect&&-1===s)return t}return-1!==r?r:-1!==s?s:0}toJSON(){return this._cache.toJSON()}fromJSON(e){this._cache.clear();for(const[t,i]of e)i.touch=0,i.type="number"==typeof i.type?i.type:o.completionKindFromString(i.type),this._cache.set(t,i);this._seq=this._cache.size}}t.LRUMemory=m;class f extends g{constructor(){super("recentlyUsedByPrefix"),this._trie=i.TernarySearchTree.forStrings(),this._seq=0}memorize(e,t,i){const{word:n}=e.getWordUntilPosition(t),o=`${e.getLanguageIdentifier().language}/${n}`;this._trie.set(o,{type:i.completion.kind,insertText:i.completion.insertText,touch:this._seq++})}select(e,t,i){let{word:n}=e.getWordUntilPosition(t);if(!n)return super.select(e,t,i);let o=`${e.getLanguageIdentifier().language}/${n}`,s=this._trie.get(o);if(s||(s=this._trie.findSubstr(o)), +s)for(let e=0;ee.push([i,t])),e.sort((e,t)=>-(e[1].touch-t[1].touch)).forEach((e,t)=>e[1].touch=t),e.slice(0,200)}fromJSON(e){if(this._trie.clear(),e.length>0){this._seq=e[0][1].touch+1;for(const[t,i]of e)i.type="number"==typeof i.type?i.type:o.completionKindFromString(i.type),this._trie.set(t,i)}}}t.PrefixMemory=f;let _=class e{constructor(e,t,i){this._storageService=e,this._modeService=t,this._configService=i,this._disposables=new s.DisposableStore,this._persistSoon=new r.RunOnceScheduler(()=>this._saveState(),500),this._disposables.add(e.onWillSaveState(e=>{e.reason===n.WillSaveStateReason.SHUTDOWN&&this._saveState()}))}dispose(){this._disposables.dispose(),this._persistSoon.dispose()}memorize(e,t,i){this._withStrategy(e,t).memorize(e,t,i),this._persistSoon.schedule()}select(e,t,i){return this._withStrategy(e,t).select(e,t,i)} +_withStrategy(t,i){var n,o;const s=this._configService.getValue("editor.suggestSelection",{overrideIdentifier:null===(n=this._modeService.getLanguageIdentifier(t.getLanguageIdAtPosition(i.lineNumber,i.column)))||void 0===n?void 0:n.language,resource:t.uri});if((null===(o=this._strategy)||void 0===o?void 0:o.name)!==s){this._saveState();const t=e._strategyCtors.get(s)||p;this._strategy=new t;try{const t=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,i=this._storageService.get(`${e._storagePrefix}/${s}`,t);i&&this._strategy.fromJSON(JSON.parse(i))}catch(e){}}return this._strategy}_saveState(){if(this._strategy){const t=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,i=JSON.stringify(this._strategy);this._storageService.store(`${e._storagePrefix}/${this._strategy.name}`,i,t)}}};_._strategyCtors=new Map([["recentlyUsedByPrefix",f],["recentlyUsed",m],["first",p]]),_._storagePrefix="suggest/memories", +_=a([l(0,n.IStorageService),l(1,u.IModeService),l(2,c.IConfigurationService)],_),t.SuggestMemoryService=_,t.ISuggestMemoryService=d.createDecorator("ISuggestMemories"),h.registerSingleton(t.ISuggestMemoryService,_,!0)})),define(t[84],i([0,1,10]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ITelemetryService=void 0,t.ITelemetryService=i.createDecorator("telemetryService")})),define(t[11],i([0,1,432,12,24,27,13,44,92,33,28,17,83,34,84,23]),(function(e,t,i,n,o,s,r,a,l,d,c,h,u,g,p,m){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelectAllCommand=t.RedoCommand=t.UndoCommand=t.EditorExtensionsRegistry=t.registerEditorContribution=t.registerInstantiatedEditorAction=t.registerMultiEditorAction=t.registerEditorAction=t.registerEditorCommand=t.registerModelCommand=t.registerModelAndPositionCommand=t.registerDefaultLanguageCommand=t.registerLanguageCommand=t.MultiEditorAction=t.EditorAction=t.EditorCommand=t.ProxyCommand=t.MultiCommand=t.Command=void 0;class f{ +constructor(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menuOpts=e.menuOpts,this._description=e.description}register(){if(Array.isArray(this._menuOpts)?this._menuOpts.forEach(this._registerMenuItem,this):this._menuOpts&&this._registerMenuItem(this._menuOpts),this._kbOpts){let e=this._kbOpts.kbExpr;this.precondition&&(e=e?h.ContextKeyExpr.and(e,this.precondition):this.precondition),u.KeybindingsRegistry.registerCommandAndKeybindingRule({id:this.id,handler:(e,t)=>this.runCommand(e,t),weight:this._kbOpts.weight,args:this._kbOpts.args,when:e,primary:this._kbOpts.primary,secondary:this._kbOpts.secondary,win:this._kbOpts.win,linux:this._kbOpts.linux,mac:this._kbOpts.mac,description:this._description})}else c.CommandsRegistry.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),description:this._description})}_registerMenuItem(e){d.MenuRegistry.appendMenuItem(e.menuId,{group:e.group,command:{id:this.id,title:e.title,icon:e.icon},when:e.when,order:e.order})}}t.Command=f +;class _ extends f{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t){return this._implementations.push([e,t]),this._implementations.sort((e,t)=>t[0]-e[0]),{dispose:()=>{for(let e=0;e{if(e.get(h.IContextKeyService).contextMatchesRules(m.withNullAsUndefined(this.precondition)))return this.runEditorCommand(e,n,t)})}}t.EditorCommand=C +;class b extends C{constructor(e){super(b.convertOptions(e)),this.label=e.label,this.alias=e.alias}static convertOptions(e){let t;function i(t){return t.menuId||(t.menuId=d.MenuId.EditorContext),t.title||(t.title=e.label),t.when=h.ContextKeyExpr.and(e.precondition,t.when),t}return t=Array.isArray(e.menuOpts)?e.menuOpts:e.menuOpts?[e.menuOpts]:[],Array.isArray(e.contextMenuOpts)?t.push(...e.contextMenuOpts.map(i)):e.contextMenuOpts&&t.push(i(e.contextMenuOpts)),e.menuOpts=t,e}runEditorCommand(e,t,i){return this.reportTelemetry(e,t),this.run(e,t,i||{})}reportTelemetry(e,t){e.get(p.ITelemetryService).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}t.EditorAction=b;function S(e,t){c.CommandsRegistry.registerCommand(e,(e,i)=>t(e,i||{}))}t.MultiEditorAction=class extends b{constructor(e){super(e),this._implementations=[]}runEditorCommand(e,t,i){this.reportTelemetry(e,t);for(const t of this._implementations)if(t[1](e,i))return;return this.run(e,t,i||{})}},t.registerLanguageCommand=S, +t.registerDefaultLanguageCommand=function(e,t){S(e,(function(e,i){const{resource:s,position:d}=i;if(!(s instanceof o.URI))throw n.illegalArgument("resource");if(!r.Position.isIPosition(d))throw n.illegalArgument("position");const c=e.get(a.IModelService).getModel(s);if(c){const e=r.Position.lift(d);return t(c,e,i)}return e.get(l.ITextModelService).createModelReference(s).then(e=>new Promise((n,o)=>{try{n(t(e.object.textEditorModel,r.Position.lift(d),i))}catch(e){o(e)}}).finally(()=>{e.dispose()}))}))},t.registerModelAndPositionCommand=function(e,t){c.CommandsRegistry.registerCommand(e,(function(e,...i){const[n,s]=i;m.assertType(o.URI.isUri(n)),m.assertType(r.Position.isIPosition(s));const d=e.get(a.IModelService).getModel(n);if(d){const e=r.Position.lift(s);return t(d,e,...i.slice(2))}return e.get(l.ITextModelService).createModelReference(n).then(e=>new Promise((n,o)=>{try{n(t(e.object.textEditorModel,r.Position.lift(s),i.slice(2)))}catch(e){o(e)}}).finally(()=>{e.dispose()}))}))}, +t.registerModelCommand=function(e,t){c.CommandsRegistry.registerCommand(e,(function(e,...i){const[n]=i;m.assertType(o.URI.isUri(n));const s=e.get(a.IModelService).getModel(n);return s?t(s,...i.slice(1)):e.get(l.ITextModelService).createModelReference(n).then(e=>new Promise((n,o)=>{try{n(t(e.object.textEditorModel,i.slice(1)))}catch(e){o(e)}}).finally(()=>{e.dispose()}))}))},t.registerEditorCommand=function(e){return w.INSTANCE.registerEditorCommand(e),e},t.registerEditorAction=function(e){const t=new e;return w.INSTANCE.registerEditorAction(t),t},t.registerMultiEditorAction=function(e){return w.INSTANCE.registerEditorAction(e),e},t.registerInstantiatedEditorAction=function(e){w.INSTANCE.registerEditorAction(e)},t.registerEditorContribution=function(e,t){w.INSTANCE.registerEditorContribution(e,t)},function(e){e.getEditorCommand=function(e){return w.INSTANCE.getEditorCommand(e)},e.getEditorActions=function(){return w.INSTANCE.getEditorActions()},e.getEditorContributions=function(){ +return w.INSTANCE.getEditorContributions()},e.getSomeEditorContributions=function(e){return w.INSTANCE.getEditorContributions().filter(t=>e.indexOf(t.id)>=0)},e.getDiffEditorContributions=function(){return w.INSTANCE.getDiffEditorContributions()}}(t.EditorExtensionsRegistry||(t.EditorExtensionsRegistry={}));class w{constructor(){this.editorContributions=[],this.diffEditorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}registerEditorContribution(e,t){this.editorContributions.push({id:e,ctor:t})}getEditorContributions(){return this.editorContributions.slice(0)}getDiffEditorContributions(){return this.diffEditorContributions.slice(0)}registerEditorAction(e){e.register(),this.editorActions.push(e)}getEditorActions(){return this.editorActions.slice(0)}registerEditorCommand(e){e.register(),this.editorCommands[e.id]=e}getEditorCommand(e){return this.editorCommands[e]||null}}function y(e){return e.register(),e}w.INSTANCE=new w,g.Registry.add("editor.contributions",w.INSTANCE), +t.UndoCommand=y(new _({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:d.MenuId.MenubarEditMenu,group:"1_do",title:i.localize(0,null),order:1},{menuId:d.MenuId.CommandPalette,group:"",title:i.localize(1,null),order:1}]})),y(new v(t.UndoCommand,{id:"default:undo",precondition:void 0})),t.RedoCommand=y(new _({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:d.MenuId.MenubarEditMenu,group:"1_do",title:i.localize(2,null),order:2},{menuId:d.MenuId.CommandPalette,group:"",title:i.localize(3,null),order:1}]})),y(new v(t.RedoCommand,{id:"default:redo",precondition:void 0})),t.SelectAllCommand=y(new _({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:d.MenuId.MenubarSelectionMenu,group:"1_basic",title:i.localize(4,null),order:1},{menuId:d.MenuId.CommandPalette,group:"",title:i.localize(5,null),order:1}]}))})), +define(t[175],i([0,1,430,23,11,27,514,45,232,233,171,13,3,22,17,83]),(function(e,t,i,n,o,s,r,a,l,d,c,h,u,g,p,m){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CoreEditingCommands=t.CoreNavigationCommands=t.RevealLine_=t.EditorScroll_=t.CoreEditorCommand=void 0;const f=0;class _ extends o.EditorCommand{runEditorCommand(e,t,i){const n=t._getViewModel();n&&this.runCoreEditorCommand(n,i||{})}}var v,C,b;t.CoreEditorCommand=_,function(e){e.description={description:"Scroll editor in the given direction",args:[{name:"Editor scroll argument object", +description:"Property-value pairs that can be passed through this argument:\n\t\t\t\t\t* 'to': A mandatory direction value.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'up', 'down'\n\t\t\t\t\t\t```\n\t\t\t\t\t* 'by': Unit to move. Default is computed based on 'to' value.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'line', 'wrappedLine', 'page', 'halfPage'\n\t\t\t\t\t\t```\n\t\t\t\t\t* 'value': Number of units to move. Default is '1'.\n\t\t\t\t\t* 'revealCursor': If 'true' reveals the cursor if it is outside view port.\n\t\t\t\t",constraint:function(e){if(!n.isObject(e))return!1;const t=e;return!!n.isString(t.to)&&(!(!n.isUndefined(t.by)&&!n.isString(t.by))&&(!(!n.isUndefined(t.value)&&!n.isNumber(t.value))&&!(!n.isUndefined(t.revealCursor)&&!n.isBoolean(t.revealCursor))))},schema:{type:"object",required:["to"],properties:{to:{type:"string",enum:["up","down"]},by:{type:"string",enum:["line","wrappedLine","page","halfPage"]},value:{type:"number",default:1},revealCursor:{type:"boolean"}}}}]},e.RawDirection={Up:"up",Down:"down"},e.RawUnit={ +Line:"line",WrappedLine:"wrappedLine",Page:"page",HalfPage:"halfPage"},e.parse=function(t){let i,n;switch(t.to){case e.RawDirection.Up:i=1;break;case e.RawDirection.Down:i=2;break;default:return null}switch(t.by){case e.RawUnit.Line:n=1;break;case e.RawUnit.WrappedLine:n=2;break;case e.RawUnit.Page:n=3;break;case e.RawUnit.HalfPage:n=4;break;default:n=2}return{direction:i,unit:n,value:Math.floor(t.value||1),revealCursor:!!t.revealCursor,select:!!t.select}}}(v=t.EditorScroll_||(t.EditorScroll_={})),function(e){e.description={description:"Reveal the given line at the given logical position",args:[{name:"Reveal line argument object",description:"Property-value pairs that can be passed through this argument:\n\t\t\t\t\t* 'lineNumber': A mandatory line number value.\n\t\t\t\t\t* 'at': Logical position at which line has to be revealed .\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'top', 'center', 'bottom'\n\t\t\t\t\t\t```\n\t\t\t\t",constraint:function(e){if(!n.isObject(e))return!1;const t=e +;return!!n.isNumber(t.lineNumber)&&!(!n.isUndefined(t.at)&&!n.isString(t.at))},schema:{type:"object",required:["lineNumber"],properties:{lineNumber:{type:"number"},at:{type:"string",enum:["top","center","bottom"]}}}}]},e.RawAtArgument={Top:"top",Center:"center",Bottom:"bottom"}}(C=t.RevealLine_||(t.RevealLine_={}));class S{constructor(e){e.addImplementation(1e4,(e,t)=>{const i=e.get(s.ICodeEditorService).getFocusedCodeEditor();return!(!i||!i.hasTextFocus())&&(this.runEditorCommand(e,i,t),!0)}),e.addImplementation(1e3,(e,t)=>{const i=document.activeElement;return!!(i&&["input","textarea"].indexOf(i.tagName.toLowerCase())>=0)&&(this.runDOMCommand(),!0)}),e.addImplementation(0,(e,t)=>{const i=e.get(s.ICodeEditorService).getActiveCodeEditor();return!!i&&(i.focus(),this.runEditorCommand(e,i,t),!0)})}}!function(e){class t extends _{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(), +e.setCursorStates(t.source,3,[d.CursorMoveCommands.moveTo(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position,t.viewPosition)]),e.revealPrimaryCursor(t.source,!0)}}e.MoveTo=o.registerEditorCommand(new t({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),e.MoveToSelect=o.registerEditorCommand(new t({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class n extends _{runCoreEditorCommand(e,t){e.model.pushStackElement();const i=this._getColumnSelectResult(e,e.getPrimaryCursorState(),e.getCursorColumnSelectData(),t);e.setCursorStates(t.source,3,i.viewStates.map(e=>a.CursorState.fromViewState(e))),e.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:i.fromLineNumber,fromViewVisualColumn:i.fromVisualColumn,toViewLineNumber:i.toLineNumber,toViewVisualColumn:i.toVisualColumn}),i.reversed?e.revealTopMostCursor(t.source):e.revealBottomMostCursor(t.source)}}e.ColumnSelect=o.registerEditorCommand(new class extends n{constructor(){super({id:"columnSelect",precondition:void 0})} +_getColumnSelectResult(e,t,i,n){const o=e.model.validatePosition(n.position),s=e.coordinatesConverter.validateViewPosition(new h.Position(n.viewPosition.lineNumber,n.viewPosition.column),o);let a=n.doColumnSelect?i.fromViewLineNumber:s.lineNumber,l=n.doColumnSelect?i.fromViewVisualColumn:n.mouseColumn-1;return r.ColumnSelection.columnSelect(e.cursorConfig,e,a,l,s.lineNumber,n.mouseColumn-1)}}),e.CursorColumnSelectLeft=o.registerEditorCommand(new class extends n{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:f,kbExpr:g.EditorContextKeys.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(e,t,i,n){return r.ColumnSelection.columnSelectLeft(e.cursorConfig,e,i)}}),e.CursorColumnSelectRight=o.registerEditorCommand(new class extends n{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:f,kbExpr:g.EditorContextKeys.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(e,t,i,n){ +return r.ColumnSelection.columnSelectRight(e.cursorConfig,e,i)}});class s extends n{constructor(e){super(e),this._isPaged=e.isPaged}_getColumnSelectResult(e,t,i,n){return r.ColumnSelection.columnSelectUp(e.cursorConfig,e,i,this._isPaged)}}e.CursorColumnSelectUp=o.registerEditorCommand(new s({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:f,kbExpr:g.EditorContextKeys.textInputFocus,primary:3600,linux:{primary:0}}})),e.CursorColumnSelectPageUp=o.registerEditorCommand(new s({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:f,kbExpr:g.EditorContextKeys.textInputFocus,primary:3595,linux:{primary:0}}}));class l extends n{constructor(e){super(e),this._isPaged=e.isPaged}_getColumnSelectResult(e,t,i,n){return r.ColumnSelection.columnSelectDown(e.cursorConfig,e,i,this._isPaged)}}e.CursorColumnSelectDown=o.registerEditorCommand(new l({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:f,kbExpr:g.EditorContextKeys.textInputFocus,primary:3602, +linux:{primary:0}}})),e.CursorColumnSelectPageDown=o.registerEditorCommand(new l({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:f,kbExpr:g.EditorContextKeys.textInputFocus,primary:3596,linux:{primary:0}}}));class c extends _{constructor(){super({id:"cursorMove",precondition:void 0,description:d.CursorMove.description})}runCoreEditorCommand(e,t){const i=d.CursorMove.parse(t);i&&this._runCursorMove(e,t.source,i)}_runCursorMove(e,t,i){e.model.pushStackElement(),e.setCursorStates(t,3,c._move(e,e.getCursorStates(),i)),e.revealPrimaryCursor(t,!0)}static _move(e,t,i){const n=i.select,o=i.value;switch(i.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:return d.CursorMoveCommands.simpleMove(e,t,i.direction,n,o,i.unit);case 9:case 11:case 10:case 12:return d.CursorMoveCommands.viewportMove(e,t,i.direction,n,o);default:return null}}}e.CursorMoveImpl=c,e.CursorMove=o.registerEditorCommand(new c);class p extends _{constructor(e){super(e),this._staticArgs=e.args} +runCoreEditorCommand(e,t){let i=this._staticArgs;-1===this._staticArgs.value&&(i={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:e.cursorConfig.pageSize}),e.model.pushStackElement(),e.setCursorStates(t.source,3,d.CursorMoveCommands.simpleMove(e,e.getCursorStates(),i.direction,i.select,i.value,i.unit)),e.revealPrimaryCursor(t.source,!0)}}e.CursorLeft=o.registerEditorCommand(new p({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:f,kbExpr:g.EditorContextKeys.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),e.CursorLeftSelect=o.registerEditorCommand(new p({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:f,kbExpr:g.EditorContextKeys.textInputFocus,primary:1039}})),e.CursorRight=o.registerEditorCommand(new p({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:f,kbExpr:g.EditorContextKeys.textInputFocus, +primary:17,mac:{primary:17,secondary:[292]}}})),e.CursorRightSelect=o.registerEditorCommand(new p({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:f,kbExpr:g.EditorContextKeys.textInputFocus,primary:1041}})),e.CursorUp=o.registerEditorCommand(new p({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:f,kbExpr:g.EditorContextKeys.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),e.CursorUpSelect=o.registerEditorCommand(new p({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:f,kbExpr:g.EditorContextKeys.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),e.CursorPageUp=o.registerEditorCommand(new p({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:f,kbExpr:g.EditorContextKeys.textInputFocus,primary:11}})),e.CursorPageUpSelect=o.registerEditorCommand(new p({args:{ +direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:f,kbExpr:g.EditorContextKeys.textInputFocus,primary:1035}})),e.CursorDown=o.registerEditorCommand(new p({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:f,kbExpr:g.EditorContextKeys.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),e.CursorDownSelect=o.registerEditorCommand(new p({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:f,kbExpr:g.EditorContextKeys.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),e.CursorPageDown=o.registerEditorCommand(new p({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:f,kbExpr:g.EditorContextKeys.textInputFocus,primary:12}})),e.CursorPageDownSelect=o.registerEditorCommand(new p({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{ +weight:f,kbExpr:g.EditorContextKeys.textInputFocus,primary:1036}})),e.CreateCursor=o.registerEditorCommand(new class extends _{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(e,t){let i;i=t.wholeLine?d.CursorMoveCommands.line(e,e.getPrimaryCursorState(),!1,t.position,t.viewPosition):d.CursorMoveCommands.moveTo(e,e.getPrimaryCursorState(),!1,t.position,t.viewPosition);const n=e.getCursorStates();if(n.length>1){const o=i.modelState?i.modelState.position:null,s=i.viewState?i.viewState.position:null;for(let i=0,r=n.length;io&&(n=o) +;const s=new u.Range(n,1,n,e.model.getLineMaxColumn(n));let r=0;if(i.at)switch(i.at){case C.RawAtArgument.Top:r=3;break;case C.RawAtArgument.Center:r=1;break;case C.RawAtArgument.Bottom:r=4}const a=e.coordinatesConverter.convertModelRangeToViewRange(s);e.revealRange(t.source,!1,a,r,0)}}),e.SelectAll=new class extends S{constructor(){super(o.SelectAllCommand)}runDOMCommand(){document.execCommand("selectAll")}runEditorCommand(e,t,i){const n=t._getViewModel();n&&this.runCoreEditorCommand(n,i)}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates("keyboard",3,[d.CursorMoveCommands.selectAll(e,e.getPrimaryCursorState())])}},e.SetSelection=o.registerEditorCommand(new class extends _{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[a.CursorState.fromModelSelection(t.selection)])}})}(b=t.CoreNavigationCommands||(t.CoreNavigationCommands={})) +;const w=p.ContextKeyExpr.and(g.EditorContextKeys.textInputFocus,g.EditorContextKeys.columnSelection);function y(e,t){m.KeybindingsRegistry.registerKeybindingRule({id:e,primary:t,when:w,weight:f+1})}function E(e){return e.register(),e}y(b.CursorColumnSelectLeft.id,1039),y(b.CursorColumnSelectRight.id,1041),y(b.CursorColumnSelectUp.id,1040),y(b.CursorColumnSelectPageUp.id,1035),y(b.CursorColumnSelectDown.id,1042),y(b.CursorColumnSelectPageDown.id,1036),function(e){class t extends o.EditorCommand{runEditorCommand(e,t,i){const n=t._getViewModel();n&&this.runCoreEditingCommand(t,n,i||{})}}e.CoreEditingCommand=t,e.LineBreakInsert=o.registerEditorCommand(new class extends t{constructor(){super({id:"lineBreakInsert",precondition:g.EditorContextKeys.writable,kbOpts:{weight:f,kbExpr:g.EditorContextKeys.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(), +e.executeCommands(this.id,c.TypeOperations.lineBreakInsert(t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection)))}}),e.Outdent=o.registerEditorCommand(new class extends t{constructor(){super({id:"outdent",precondition:g.EditorContextKeys.writable,kbOpts:{weight:f,kbExpr:p.ContextKeyExpr.and(g.EditorContextKeys.editorTextFocus,g.EditorContextKeys.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,c.TypeOperations.outdent(t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection))),e.pushUndoStop()}}),e.Tab=o.registerEditorCommand(new class extends t{constructor(){super({id:"tab",precondition:g.EditorContextKeys.writable,kbOpts:{weight:f,kbExpr:p.ContextKeyExpr.and(g.EditorContextKeys.editorTextFocus,g.EditorContextKeys.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(), +e.executeCommands(this.id,c.TypeOperations.tab(t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection))),e.pushUndoStop()}}),e.DeleteLeft=o.registerEditorCommand(new class extends t{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:f,kbExpr:g.EditorContextKeys.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(e,t,i){const[n,o]=l.DeleteOperations.deleteLeft(t.getPrevEditOperationType(),t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection));n&&e.pushUndoStop(),e.executeCommands(this.id,o),t.setPrevEditOperationType(2)}}),e.DeleteRight=o.registerEditorCommand(new class extends t{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:f,kbExpr:g.EditorContextKeys.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(e,t,i){ +const[n,o]=l.DeleteOperations.deleteRight(t.getPrevEditOperationType(),t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection));n&&e.pushUndoStop(),e.executeCommands(this.id,o),t.setPrevEditOperationType(3)}}),e.Undo=new class extends S{constructor(){super(o.UndoCommand)}runDOMCommand(){document.execCommand("undo")}runEditorCommand(e,t,i){t.hasModel()&&!0!==t.getOption(72)&&t.getModel().undo()}},e.Redo=new class extends S{constructor(){super(o.RedoCommand)}runDOMCommand(){document.execCommand("redo")}runEditorCommand(e,t,i){t.hasModel()&&!0!==t.getOption(72)&&t.getModel().redo()}}}(t.CoreEditingCommands||(t.CoreEditingCommands={}));class L extends o.Command{constructor(e,t,i){super({id:e,precondition:void 0,description:i}),this._handlerId=t}runCommand(e,t){const i=e.get(s.ICodeEditorService).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}}function x(e,t){E(new L("default:"+e,e)),E(new L(e,e,t))}x("type",{description:"Type",args:[{name:"args",schema:{type:"object", +required:["text"],properties:{text:{type:"string"}}}}]}),x("replacePreviousChar"),x("compositionStart"),x("compositionEnd"),x("paste"),x("cut")})),define(t[555],i([0,1,11,17,25,69,10,71]),(function(e,t,i,n,o,s,r,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditorKeybindingCancellationTokenSource=void 0;const l=r.createDecorator("IEditorCancelService"),d=new n.RawContextKey("cancellableOperation",!1);a.registerSingleton(l,class{constructor(){this._tokens=new WeakMap}add(e,t){let i,o=this._tokens.get(e);return o||(o=e.invokeWithinContext(e=>{return{key:d.bindTo(e.get(n.IContextKeyService)),tokens:new s.LinkedList}}),this._tokens.set(e,o)),o.key.set(!0),i=o.tokens.push(t),()=>{i&&(i(),o.key.set(!o.tokens.isEmpty()),i=void 0)}}cancel(e){const t=this._tokens.get(e);if(!t)return;const i=t.tokens.pop();i&&(i.cancel(),t.key.set(!t.tokens.isEmpty()))}},!0);class c extends o.CancellationTokenSource{constructor(e,t){super(t),this.editor=e, +this._unregister=e.invokeWithinContext(t=>t.get(l).add(e,this))}dispose(){this._unregister(),super.dispose()}}t.EditorKeybindingCancellationTokenSource=c,i.registerEditorCommand(new class extends i.EditorCommand{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:d})}runEditorCommand(e,t){e.get(l).cancel(t)}})})),define(t[68],i([0,1,8,3,25,2,555]),(function(e,t,i,n,o,s,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StableEditorScrollState=t.TextModelCancellationTokenSource=t.EditorStateCancellationTokenSource=t.EditorState=void 0;class a{constructor(e,t){if(this.flags=t,0!=(1&this.flags)){const t=e.getModel();this.modelVersionId=t?i.format("{0}#{1}",t.uri.toString(),t.getVersionId()):null}else this.modelVersionId=null;0!=(4&this.flags)?this.position=e.getPosition():this.position=null,0!=(2&this.flags)?this.selection=e.getSelection():this.selection=null,0!=(8&this.flags)?(this.scrollLeft=e.getScrollLeft(), +this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof a))return!1;const t=e;return this.modelVersionId===t.modelVersionId&&(this.scrollLeft===t.scrollLeft&&this.scrollTop===t.scrollTop&&(!(!this.position&&t.position||this.position&&!t.position||this.position&&t.position&&!this.position.equals(t.position))&&!(!this.selection&&t.selection||this.selection&&!t.selection||this.selection&&t.selection&&!this.selection.equalsRange(t.selection))))}validate(e){return this._equals(new a(e,this.flags))}}t.EditorState=a;class l extends r.EditorKeybindingCancellationTokenSource{constructor(e,t,i,o){super(e,o),this.editor=e,this._listener=new s.DisposableStore,4&t&&this._listener.add(e.onDidChangeCursorPosition(e=>{i&&n.Range.containsPosition(i,e.position)||this.cancel()})),2&t&&this._listener.add(e.onDidChangeCursorSelection(e=>{i&&n.Range.containsRange(i,e.selection)||this.cancel()})),8&t&&this._listener.add(e.onDidScrollChange(e=>this.cancel())), +1&t&&(this._listener.add(e.onDidChangeModel(e=>this.cancel())),this._listener.add(e.onDidChangeModelContent(e=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}}t.EditorStateCancellationTokenSource=l;class d extends o.CancellationTokenSource{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}t.TextModelCancellationTokenSource=d;class c{constructor(e,t,i){this._visiblePosition=e,this._visiblePositionScrollDelta=t,this._cursorPosition=i}static capture(e){let t=null,i=0;if(0!==e.getScrollTop()){const n=e.getVisibleRanges();if(n.length>0){t=n[0].getStartPosition();const o=e.getTopForPosition(t.lineNumber,t.column);i=e.getScrollTop()-o}}return new c(t,i,e.getPosition())}restore(e){if(this._visiblePosition){const t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor(e){const t=e.getPosition() +;if(!this._cursorPosition||!t)return;const i=e.getTopForLineNumber(t.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+i)}}t.StableEditorScrollState=c})),define(t[556],i([0,1,175,13,16]),(function(e,t,i,n,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ViewController=void 0;t.ViewController=class{constructor(e,t,i,n){this.configuration=e,this.viewModel=t,this.userInputEvents=i,this.commandDelegate=n}paste(e,t,i,n){this.commandDelegate.paste(e,t,i,n)}type(e){this.commandDelegate.type(e)}replacePreviousChar(e,t){this.commandDelegate.replacePreviousChar(e,t)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){i.CoreNavigationCommands.SetSelection.runCoreEditorCommand(this.viewModel,{source:"keyboard",selection:e})}_validateViewColumn(e){const t=this.viewModel.getLineMinColumn(e.lineNumber) +;return e.column=4?this._selectAll():3===e.mouseDownCount?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelectDrag(e.position):this._lastCursorLineSelect(e.position):e.inSelectionMode?this._lineSelectDrag(e.position):this._lineSelect(e.position):2===e.mouseDownCount?this._hasMulticursorModifier(e)?this._lastCursorWordSelect(e.position):e.inSelectionMode?this._wordSelectDrag(e.position):this._wordSelect(e.position):this._hasMulticursorModifier(e)?this._hasNonMulticursorModifier(e)||(e.shiftKey?this._columnSelect(e.position,e.mouseColumn,!0):e.inSelectionMode?this._lastCursorMoveToSelect(e.position):this._createCursor(e.position,!1)):e.inSelectionMode?e.altKey?this._columnSelect(e.position,e.mouseColumn,!0):n?this._columnSelect(e.position,e.mouseColumn,!0):this._moveToSelect(e.position):this.moveTo(e.position) +}_usualArgs(e){return e=this._validateViewColumn(e),{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e}}moveTo(e){i.CoreNavigationCommands.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_moveToSelect(e){i.CoreNavigationCommands.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_columnSelect(e,t,n){e=this._validateViewColumn(e),i.CoreNavigationCommands.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:n})}_createCursor(e,t){e=this._validateViewColumn(e),i.CoreNavigationCommands.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e){i.CoreNavigationCommands.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_wordSelect(e){i.CoreNavigationCommands.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))} +_wordSelectDrag(e){i.CoreNavigationCommands.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lastCursorWordSelect(e){i.CoreNavigationCommands.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lineSelect(e){i.CoreNavigationCommands.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lineSelectDrag(e){i.CoreNavigationCommands.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lastCursorLineSelect(e){i.CoreNavigationCommands.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lastCursorLineSelectDrag(e){i.CoreNavigationCommands.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_selectAll(){i.CoreNavigationCommands.SelectAll.runCoreEditorCommand(this.viewModel,{source:"mouse"})}_convertViewToModelPosition(e){return this.viewModel.coordinatesConverter.convertViewPositionToModelPosition(e)}emitKeyDown(e){this.userInputEvents.emitKeyDown(e)}emitKeyUp(e){ +this.userInputEvents.emitKeyUp(e)}emitContextMenu(e){this.userInputEvents.emitContextMenu(e)}emitMouseMove(e){this.userInputEvents.emitMouseMove(e)}emitMouseLeave(e){this.userInputEvents.emitMouseLeave(e)}emitMouseUp(e){this.userInputEvents.emitMouseUp(e)}emitMouseDown(e){this.userInputEvents.emitMouseDown(e)}emitMouseDrag(e){this.userInputEvents.emitMouseDrag(e)}emitMouseDrop(e){this.userInputEvents.emitMouseDrop(e)}emitMouseWheel(e){this.userInputEvents.emitMouseWheel(e)}}})),define(t[557],i([0,1,11,445,22,20,39,17,78,48,324]),(function(e,t,i,n,o,s,d,c,h,u){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionAnchorSet=void 0,t.SelectionAnchorSet=new c.RawContextKey("selectionAnchorSet",!1);let g=class e{constructor(e,i){this.editor=e,this.selectionAnchorSetContextKey=t.SelectionAnchorSet.bindTo(i),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}static get(t){return t.getContribution(e.ID)}setSelectionAnchor(){if(this.editor.hasModel()){ +const e=this.editor.getPosition(),t=this.decorationId?[this.decorationId]:[],i=this.editor.deltaDecorations(t,[{range:s.Selection.fromPositions(e,e),options:{stickiness:1,hoverMessage:(new h.MarkdownString).appendText(n.localize(0,null)),className:"selection-anchor"}}]);this.decorationId=i[0],this.selectionAnchorSetContextKey.set(!!this.decorationId),u.alert(n.localize(1,null,e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){const t=this.editor.getPosition();this.editor.setSelection(s.Selection.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){this.decorationId&&(this.editor.deltaDecorations([this.decorationId],[]),this.decorationId=void 0, +this.selectionAnchorSetContextKey.set(!1))}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}};g.ID="editor.contrib.selectionAnchorController",g=a([l(1,c.IContextKeyService)],g);class p extends i.EditorAction{constructor(){super({id:"editor.action.setSelectionAnchor",label:n.localize(2,null),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:o.EditorContextKeys.editorTextFocus,primary:d.KeyChord(2089,2080),weight:100}})}run(e,t){return r(this,void 0,void 0,(function*(){g.get(t).setSelectionAnchor()}))}}class m extends i.EditorAction{constructor(){super({id:"editor.action.goToSelectionAnchor",label:n.localize(3,null),alias:"Go to Selection Anchor",precondition:t.SelectionAnchorSet})}run(e,t){return r(this,void 0,void 0,(function*(){g.get(t).goToSelectionAnchor()}))}}class f extends i.EditorAction{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:n.localize(4,null),alias:"Select from Anchor to Cursor",precondition:t.SelectionAnchorSet,kbOpts:{ +kbExpr:o.EditorContextKeys.editorTextFocus,primary:d.KeyChord(2089,2089),weight:100}})}run(e,t){return r(this,void 0,void 0,(function*(){g.get(t).selectFromAnchorToCursor()}))}}class _ extends i.EditorAction{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:n.localize(5,null),alias:"Cancel Selection Anchor",precondition:t.SelectionAnchorSet,kbOpts:{kbExpr:o.EditorContextKeys.editorTextFocus,primary:9,weight:100}})}run(e,t){return r(this,void 0,void 0,(function*(){g.get(t).cancelSelectionAnchor()}))}}i.registerEditorContribution(g.ID,g),i.registerEditorAction(p),i.registerEditorAction(m),i.registerEditorAction(f),i.registerEditorAction(_)})),define(t[558],i([0,1,447,11,22,389]),(function(e,t,i,n,o,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r extends n.EditorAction{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;let i=[],n=t.getSelections();for(const e of n)i.push(new s.MoveCaretCommand(e,this.left));t.pushUndoStop(), +t.executeCommands(this.id,i),t.pushUndoStop()}}n.registerEditorAction(class extends r{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:i.localize(0,null),alias:"Move Selected Text Left",precondition:o.EditorContextKeys.writable})}}),n.registerEditorAction(class extends r{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:i.localize(1,null),alias:"Move Selected Text Right",precondition:o.EditorContextKeys.writable})}})})),define(t[559],i([0,1,448,11,88,3,22,170]),(function(e,t,i,n,o,s,r,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class l extends n.EditorAction{constructor(){super({id:"editor.action.transposeLetters",label:i.localize(0,null),alias:"Transpose Letters",precondition:r.EditorContextKeys.writable,kbOpts:{kbExpr:r.EditorContextKeys.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;let i=t.getModel(),n=[],r=t.getSelections();for(let e of r){if(!e.isEmpty())continue +;let t=e.startLineNumber,r=e.startColumn,l=i.getLineMaxColumn(t);if(1===t&&(1===r||2===r&&2===l))continue;let d=r===l?e.getPosition():a.MoveOperations.rightPosition(i,e.getPosition().lineNumber,e.getPosition().column),c=a.MoveOperations.leftPosition(i,d.lineNumber,d.column),h=a.MoveOperations.leftPosition(i,c.lineNumber,c.column),u=i.getValueInRange(s.Range.fromPositions(h,c)),g=i.getValueInRange(s.Range.fromPositions(c,d)),p=s.Range.fromPositions(h,d);n.push(new o.ReplaceCommand(p,g+u))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}n.registerEditorAction(l)})),define(t[560],i([0,1,449,36,16,208,11,27,22,33,80]),(function(e,t,i,n,o,s,a,l,d,c,h){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PasteAction=t.CopyAction=t.CutAction=void 0;const u=o.isNative||document.queryCommandSupported("cut"),g=o.isNative||document.queryCommandSupported("copy"),p=g&&!n.isEdge,m=!n.isFirefox||document.queryCommandSupported("paste");function f(e){return e.register(),e} +t.CutAction=u?f(new a.MultiCommand({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:o.isNative?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:c.MenuId.MenubarEditMenu,group:"2_ccp",title:i.localize(0,null),order:1},{menuId:c.MenuId.EditorContext,group:"9_cutcopypaste",title:i.localize(1,null),when:d.EditorContextKeys.writable,order:1},{menuId:c.MenuId.CommandPalette,group:"",title:i.localize(2,null),order:1}]})):void 0,t.CopyAction=g?f(new a.MultiCommand({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:o.isNative?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:c.MenuId.MenubarEditMenu,group:"2_ccp",title:i.localize(3,null),order:2},{menuId:c.MenuId.EditorContext,group:"9_cutcopypaste",title:i.localize(4,null),order:2},{menuId:c.MenuId.CommandPalette,group:"",title:i.localize(5,null),order:1}]})):void 0,t.PasteAction=m?f(new a.MultiCommand({id:"editor.action.clipboardPasteAction", +precondition:void 0,kbOpts:o.isNative?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:c.MenuId.MenubarEditMenu,group:"2_ccp",title:i.localize(6,null),order:3},{menuId:c.MenuId.EditorContext,group:"9_cutcopypaste",title:i.localize(7,null),when:d.EditorContextKeys.writable,order:3},{menuId:c.MenuId.CommandPalette,group:"",title:i.localize(8,null),order:1}]})):void 0;class _ extends a.EditorAction{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:i.localize(9,null),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:d.EditorContextKeys.textInputFocus,primary:0,weight:100}})}run(e,t){if(!t.hasModel())return;!t.getOption(26)&&t.getSelection().isEmpty()||(s.CopyOptions.forceCopyWithSyntaxHighlighting=!0,t.focus(),document.execCommand("copy"),s.CopyOptions.forceCopyWithSyntaxHighlighting=!1)}}function v(e,t){e&&(e.addImplementation(1e4,(e,i)=>{ +const n=e.get(l.ICodeEditorService).getFocusedCodeEditor();if(n&&n.hasTextFocus()){const e=n.getOption(26),i=n.getSelection();return!(!i||!i.isEmpty()||e)||(document.execCommand(t),!0)}return!1}),e.addImplementation(0,(e,i)=>(document.execCommand(t),!0)))}v(t.CutAction,"cut"),v(t.CopyAction,"copy"),t.PasteAction&&(t.PasteAction.addImplementation(1e4,(e,t)=>{const i=e.get(l.ICodeEditorService),n=e.get(h.IClipboardService),a=i.getFocusedCodeEditor();if(a&&a.hasTextFocus()){return!(!document.execCommand("paste")&&o.isWeb)||((()=>r(void 0,void 0,void 0,(function*(){const e=yield n.readText();if(""!==e){const t=s.InMemoryClipboardMetadataManager.INSTANCE.get(e);let i=!1,n=null,o=null;t&&(i=a.getOption(26)&&!!t.isFromEmptySelection,n=void 0!==t.multicursorText?t.multicursorText:null,o=t.mode),a.trigger("keyboard","paste",{text:e,pasteOnNewLine:i,multicursorText:n,mode:o})}})))(),!0)}return!1}),t.PasteAction.addImplementation(0,(e,t)=>(document.execCommand("paste"),!0))),p&&a.registerEditorAction(_)})), +define(t[136],i([0,1,19,25,12,2,24,68,11,3,20,18,44,124,56]),(function(e,t,i,n,o,s,a,l,d,c,h,u,g,p,m){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCodeActions=t.fixAllCommandId=t.organizeImportsCommandId=t.sourceActionCommandId=t.refactorCommandId=t.codeActionCommandId=void 0,t.codeActionCommandId="editor.action.codeAction",t.refactorCommandId="editor.action.refactor",t.sourceActionCommandId="editor.action.sourceAction",t.organizeImportsCommandId="editor.action.organizeImports",t.fixAllCommandId="editor.action.fixAll";class f extends s.Disposable{constructor(e,t,n){super(),this.documentation=t,this._register(n),this.allActions=i.mergeSort([...e],f.codeActionsComparator),this.validActions=this.allActions.filter(e=>!e.disabled)}static codeActionsComparator(e,t){ +return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:i.isNonEmptyArray(e.diagnostics)?i.isNonEmptyArray(t.diagnostics)?e.diagnostics[0].message.localeCompare(t.diagnostics[0].message):-1:i.isNonEmptyArray(t.diagnostics)?1:0}get hasAutoFix(){return this.validActions.some(e=>!!e.kind&&p.CodeActionKind.QuickFix.contains(new p.CodeActionKind(e.kind))&&!!e.isPreferred)}}const _={actions:[],documentation:void 0};function v(e,t,n,a,d){var c;const h=n.filter||{},g={only:null===(c=h.include)||void 0===c?void 0:c.value,trigger:n.type},m=new l.TextModelCancellationTokenSource(e,d),v=function(e,t){return u.CodeActionProviderRegistry.all(e).filter(e=>!e.providedCodeActionKinds||e.providedCodeActionKinds.some(e=>p.mayIncludeActionsOfKind(t,new p.CodeActionKind(e))))}(e,h),C=new s.DisposableStore,b=v.map(i=>r(this,void 0,void 0,(function*(){try{a.report(i);const n=yield i.provideCodeActions(e,t,g,m.token);if(n&&C.add(n),m.token.isCancellationRequested)return _ +;const o=((null==n?void 0:n.actions)||[]).filter(e=>e&&p.filtersAction(h,e));return{actions:o,documentation:function(e,t,i){if(!e.documentation)return;const n=e.documentation.map(e=>({kind:new p.CodeActionKind(e.kind),command:e.command}));if(i){let e;for(const t of n)t.kind.contains(i)&&(e?e.kind.contains(t.kind)&&(e=t):e=t);if(e)return null==e?void 0:e.command}for(const e of t)if(e.kind)for(const t of n)if(t.kind.contains(new p.CodeActionKind(e.kind)))return t.command;return}(i,o,h.include)}}catch(e){if(o.isPromiseCanceledError(e))throw e;return o.onUnexpectedExternalError(e),_}}))),S=u.CodeActionProviderRegistry.onDidChange(()=>{const t=u.CodeActionProviderRegistry.all(e);i.equals(t,v)||m.cancel()});return Promise.all(b).then(e=>{const t=i.flatten(e.map(e=>e.actions)),n=i.coalesce(e.map(e=>e.documentation));return new f(t,n,C)}).finally(()=>{S.dispose(),m.dispose()})}t.getCodeActions=v,d.registerLanguageCommand("_executeCodeActionProvider",(function(e,t){return r(this,void 0,void 0,(function*(){ +const{resource:i,rangeOrSelection:s,kind:r}=t;if(!(i instanceof a.URI))throw o.illegalArgument();const l=e.get(g.IModelService).getModel(i);if(!l)throw o.illegalArgument();const d=h.Selection.isISelection(s)?h.Selection.liftSelection(s):c.Range.isIRange(s)?l.validateRange(s):void 0;if(!d)throw o.illegalArgument();const u=yield v(l,d,{type:2,filter:{includeSourceActions:!0,include:r&&r.value?new p.CodeActionKind(r.value):void 0}},m.Progress.None,n.CancellationToken.None);return setTimeout(()=>u.dispose(),100),u.validActions}))}))})),define(t[561],i([0,1,7,47,12,144,2,13,18,136,124,66,35]),(function(e,t,i,n,o,s,d,c,h,u,g,p,m){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeActionKeybindingResolver=t.CodeActionMenu=void 0;class f extends n.Action{constructor(e,t){super(e.command?e.command.id:e.title,e.title,void 0,!e.disabled,t),this.action=e}}let _=class extends d.Disposable{constructor(e,t,i,n){super(),this._editor=e,this._delegate=t,this._contextMenuService=i,this._visible=!1, +this._showingActions=this._register(new d.MutableDisposable),this._keybindingResolver=new v({getKeybindings:()=>n.getKeybindings()})}get isVisible(){return this._visible}show(e,t,i,n){return r(this,void 0,void 0,(function*(){const s=n.includeDisabledActions?t.allActions:t.validActions;if(!s.length)return void(this._visible=!1);if(!this._editor.getDomNode())throw this._visible=!1,o.canceled();this._visible=!0,this._showingActions.value=t;const r=this.getMenuActions(e,s,t.documentation),a=c.Position.isIPosition(i)?this._toCoords(i):i||{x:0,y:0},l=this._keybindingResolver.getResolver();this._contextMenuService.showContextMenu({domForShadowRoot:this._editor.getDomNode(),getAnchor:()=>a,getActions:()=>r,onHide:()=>{this._visible=!1,this._editor.focus()},autoSelectFirstItem:!0,getKeyBinding:e=>e instanceof f?l(e.action):void 0})}))}getMenuActions(e,t,i){var o,s;const r=e=>new f(e,()=>this._delegate.onSelectCodeAction(e)),a=t.map(r),l=[...i],d=this._editor.getModel() +;if(d&&a.length)for(const i of h.CodeActionProviderRegistry.all(d))i._getAdditionalMenuItems&&l.push(...i._getAdditionalMenuItems({trigger:e.type,only:null===(s=null===(o=e.filter)||void 0===o?void 0:o.include)||void 0===s?void 0:s.value},t));return l.length&&a.push(new n.Separator,...l.map(e=>r({title:e.title,command:e}))),a}_toCoords(e){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(e,1),this._editor.render();const t=this._editor.getScrolledVisiblePosition(e),n=i.getDomNodePagePosition(this._editor.getDomNode());return{x:n.left+t.left,y:n.top+t.top+t.height}}};_=a([l(2,p.IContextMenuService),l(3,m.IKeybindingService)],_),t.CodeActionMenu=_;class v{constructor(e){this._keybindingProvider=e}getResolver(){const e=new s.Lazy(()=>this._keybindingProvider.getKeybindings().filter(e=>v.codeActionCommands.indexOf(e.command)>=0).filter(e=>e.resolvedKeybinding).map(e=>{let t=e.commandArgs;return e.command===u.organizeImportsCommandId?t={kind:g.CodeActionKind.SourceOrganizeImports.value +}:e.command===u.fixAllCommandId&&(t={kind:g.CodeActionKind.SourceFixAll.value}),Object.assign({resolvedKeybinding:e.resolvedKeybinding},g.CodeActionCommandArgs.fromUser(t,{kind:g.CodeActionKind.None,apply:"never"}))}));return t=>{if(t.kind){const i=this.bestKeybindingForCodeAction(t,e.getValue());return null==i?void 0:i.resolvedKeybinding}}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const i=new g.CodeActionKind(e.kind);return t.filter(e=>e.kind.contains(i)).filter(t=>!t.preferred||e.isPreferred).reduceRight((e,t)=>e?e.kind.contains(t.kind)?t:e:t,void 0)}}t.CodeActionKeybindingResolver=v,v.codeActionCommands=[u.refactorCommandId,u.codeActionCommandId,u.sourceActionCommandId,u.organizeImportsCommandId,u.fixAllCommandId]})),define(t[562],i([0,1,15,4,2,3,18,17,56,136,41]),(function(e,t,i,n,o,s,r,a,l,d,c){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeActionModel=t.CodeActionsState=t.SUPPORTED_CODE_ACTIONS=void 0,t.SUPPORTED_CODE_ACTIONS=new a.RawContextKey("supportedCodeAction","") +;class h extends o.Disposable{constructor(e,t,n,o=250){super(),this._editor=e,this._markerService=t,this._signalChange=n,this._delay=o,this._autoTriggerTimer=this._register(new i.TimeoutTimer),this._register(this._markerService.onMarkerChanged(e=>this._onMarkerChanges(e))),this._register(this._editor.onDidChangeCursorPosition(()=>this._onCursorChange()))}trigger(e){const t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);return this._createEventAndSignalChange(e,t)}_onMarkerChanges(e){const t=this._editor.getModel();t&&e.some(e=>c.isEqual(e,t.uri))&&this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:1})},this._delay)}_onCursorChange(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:1})},this._delay)}_getRangeOfMarker(e){const t=this._editor.getModel();if(t)for(const i of this._markerService.read({resource:t.uri})){const n=t.validateRange(i);if(s.Range.intersectRanges(n,e))return s.Range.lift(n)}}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return +;const t=this._editor.getModel(),i=this._editor.getSelection();if(i.isEmpty()&&1===e.type){const{lineNumber:e,column:n}=i.getPosition(),o=t.getLineContent(e);if(0===o.length)return;if(1===n){if(/\s/.test(o[0]))return}else if(n===t.getLineMaxColumn(e)){if(/\s/.test(o[o.length-1]))return}else if(/\s/.test(o[n-2])&&/\s/.test(o[n-1]))return}return i}_createEventAndSignalChange(e,t){const i=this._editor.getModel();if(!t||!i)return void this._signalChange(void 0);const n=this._getRangeOfMarker(t),o=n?n.getStartPosition():t.getStartPosition(),s={trigger:e,selection:t,position:o};return this._signalChange(s),s}}var u;!function(e){e.Empty={type:0};e.Triggered=class{constructor(e,t,i,n){this.trigger=e,this.rangeOrSelection=t,this.position=i,this.actions=n,this.type=1}}}(u=t.CodeActionsState||(t.CodeActionsState={}));class g extends o.Disposable{constructor(e,i,s,a){super(),this._editor=e,this._markerService=i,this._progressService=a,this._codeActionOracle=this._register(new o.MutableDisposable),this._state=u.Empty, +this._onDidChangeState=this._register(new n.Emitter),this.onDidChangeState=this._onDidChangeState.event,this._supportedCodeActions=t.SUPPORTED_CODE_ACTIONS.bindTo(s),this._register(this._editor.onDidChangeModel(()=>this._update())),this._register(this._editor.onDidChangeModelLanguage(()=>this._update())),this._register(r.CodeActionProviderRegistry.onDidChange(()=>this._update())),this._update()}dispose(){super.dispose(),this.setState(u.Empty,!0)}_update(){this._codeActionOracle.value=void 0,this.setState(u.Empty);const e=this._editor.getModel();if(e&&r.CodeActionProviderRegistry.has(e)&&!this._editor.getOption(72)){const t=[];for(const i of r.CodeActionProviderRegistry.all(e))Array.isArray(i.providedCodeActionKinds)&&t.push(...i.providedCodeActionKinds);this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new h(this._editor,this._markerService,t=>{var n;if(!t)return void this.setState(u.Empty);const o=i.createCancelablePromise(i=>d.getCodeActions(e,t.selection,t.trigger,l.Progress.None,i)) +;2===t.trigger.type&&(null===(n=this._progressService)||void 0===n||n.showWhile(o,250)),this.setState(new u.Triggered(t.trigger,t.selection,t.position,o))},void 0),this._codeActionOracle.value.trigger({type:1})}else this._supportedCodeActions.reset()}trigger(e){this._codeActionOracle.value&&this._codeActionOracle.value.trigger(e)}setState(e,t){e!==this._state&&(1===this._state.type&&this._state.actions.cancel(),this._state=e,t||this._onDidChangeState.fire(e))}}t.CodeActionModel=g})),define(t[243],i([0,1,19,25,12,24,11,18,44,2]),(function(e,t,i,n,o,s,r,a,l,d){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCodeLensData=t.CodeLensModel=void 0;class c{constructor(){this.lenses=[],this._disposables=new d.DisposableStore}dispose(){this._disposables.dispose()}add(e,t){this._disposables.add(e);for(const i of e.lenses)this.lenses.push({symbol:i,provider:t})}}function h(e,t){const n=a.CodeLensProviderRegistry.ordered(e),s=new Map,r=new c,l=n.map((i,n)=>(s.set(i,n), +Promise.resolve(i.provideCodeLenses(e,t)).then(e=>e&&r.add(e,i)).catch(o.onUnexpectedExternalError)));return Promise.all(l).then(()=>(r.lenses=i.mergeSort(r.lenses,(e,t)=>e.symbol.range.startLineNumbert.symbol.range.startLineNumber?1:s.get(e.provider)s.get(t.provider)?1:e.symbol.range.startColumnt.symbol.range.startColumn?1:0),r))}t.CodeLensModel=c,t.getCodeLensData=h,r.registerLanguageCommand("_executeCodeLensProvider",(function(e,t){let{resource:i,itemResolveCount:r}=t;if(!(i instanceof s.URI))throw o.illegalArgument();const a=e.get(l.IModelService).getModel(i);if(!a)throw o.illegalArgument();const c=[],u=new d.DisposableStore;return h(a,n.CancellationToken.None).then(e=>{u.add(e);let t=[] +;for(const i of e.lenses)void 0===r||Boolean(i.symbol.command)?c.push(i.symbol):r-- >0&&i.provider.resolveCodeLens&&t.push(Promise.resolve(i.provider.resolveCodeLens(a,i.symbol,n.CancellationToken.None)).then(e=>c.push(e||i.symbol)));return Promise.all(t)}).then(()=>c).finally(()=>{setTimeout(()=>u.dispose(),100)})}))})),define(t[563],i([0,1,10,71,243,59,76,3,15,85]),(function(e,t,i,n,o,s,r,d,c,h){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeLensCache=t.ICodeLensCache=void 0,t.ICodeLensCache=i.createDecorator("ICodeLensCache");class u{constructor(e,t){this.lineCount=e,this.data=t}}let g=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new s.LRUCache(20,.75);c.runWhenIdle(()=>e.remove("codelens/cache",1));const t="codelens/cache2",i=e.get(t,1,"{}");this._deserialize(i),h.once(e.onWillSaveState)(i=>{i.reason===r.WillSaveStateReason.SHUTDOWN&&e.store(t,this._serialize(),1)})}put(e,t){const i=t.lenses.map(e=>{var t;return{ +range:e.symbol.range,command:e.symbol.command&&{id:"",title:null===(t=e.symbol.command)||void 0===t?void 0:t.title}}}),n=new o.CodeLensModel;n.add({lenses:i,dispose:()=>{}},this._fakeProvider);const s=new u(e.getLineCount(),n);this._cache.set(e.uri.toString(),s)}get(e){const t=this._cache.get(e.uri.toString());return t&&t.lineCount===e.getLineCount()?t.data:void 0}delete(e){this._cache.delete(e.uri.toString())}_serialize(){const e=Object.create(null);for(const[t,i]of this._cache){const n=new Set;for(const e of i.data.lenses)n.add(e.symbol.range.startLineNumber);e[t]={lineCount:i.lineCount,lines:[...n.values()]}}return JSON.stringify(e)}_deserialize(e){try{const t=JSON.parse(e);for(const e in t){const i=t[e],n=[];for(const e of i.lines)n.push({range:new d.Range(e,1,e,11)});const s=new o.CodeLensModel;s.add({lenses:n,dispose(){}},this._fakeProvider),this._cache.set(e,new u(i.lineCount,s))}}catch(e){}}};g=a([l(0,r.IStorageService)],g),t.CodeLensCache=g,n.registerSingleton(t.ICodeLensCache,g)})), +define(t[244],i([0,1,25,12,24,11,3,18,44]),(function(e,t,i,n,o,s,r,a,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getColorPresentations=t.getColors=void 0,t.getColors=function(e,t){const i=[],n=a.ColorProviderRegistry.ordered(e).reverse().map(n=>Promise.resolve(n.provideDocumentColors(e,t)).then(e=>{if(Array.isArray(e))for(let t of e)i.push({colorInfo:t,provider:n})}));return Promise.all(n).then(()=>i)},t.getColorPresentations=function(e,t,i,n){return Promise.resolve(i.provideColorPresentations(e,t,n))},s.registerLanguageCommand("_executeDocumentColorProvider",(function(e,t){const{resource:s}=t;if(!(s instanceof o.URI))throw n.illegalArgument();const r=e.get(l.IModelService).getModel(s);if(!r)throw n.illegalArgument();const d=[],c=a.ColorProviderRegistry.ordered(r).reverse().map(e=>Promise.resolve(e.provideDocumentColors(r,i.CancellationToken.None)).then(e=>{if(Array.isArray(e))for(let t of e)d.push({range:t.range,color:[t.color.red,t.color.green,t.color.blue,t.color.alpha]})})) +;return Promise.all(c).then(()=>d)})),s.registerLanguageCommand("_executeColorPresentationProvider",(function(e,t){const{resource:s,color:d,range:c}=t;if(!(s instanceof o.URI&&Array.isArray(d)&&4===d.length&&r.Range.isIRange(c)))throw n.illegalArgument();const[h,u,g,p]=d,m=e.get(l.IModelService).getModel(s);if(!m)throw n.illegalArgument();const f={range:c,color:{red:h,green:u,blue:g,alpha:p}},_=[],v=a.ColorProviderRegistry.ordered(m).reverse().map(e=>Promise.resolve(e.provideColorPresentations(m,f,i.CancellationToken.None)).then(e=>{Array.isArray(e)&&_.push(...e)}));return Promise.all(v).then(()=>_)}))})),define(t[245],i([0,1,15,29,12,113,2,11,27,3,31,18,244,46]),(function(e,t,i,n,o,s,r,d,c,h,u,g,p,m){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ColorDetector=void 0;let f=class e extends r.Disposable{constructor(e,t,i){super(),this._editor=e,this._codeEditorService=t,this._configurationService=i,this._localToDispose=this._register(new r.DisposableStore),this._decorationsIds=[], +this._colorDatas=new Map,this._colorDecoratorIds=[],this._decorationsTypes=new Set,this._register(e.onDidChangeModel(e=>{this._isEnabled=this.isEnabled(),this.onModelChanged()})),this._register(e.onDidChangeModelLanguage(e=>this.onModelChanged())),this._register(g.ColorProviderRegistry.onDidChange(e=>this.onModelChanged())),this._register(e.onDidChangeConfiguration(e=>{let t=this._isEnabled;this._isEnabled=this.isEnabled(),t!==this._isEnabled&&(this._isEnabled?this.onModelChanged():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isEnabled=this.isEnabled(),this.onModelChanged()}isEnabled(){const e=this._editor.getModel();if(!e)return!1;const t=e.getLanguageIdentifier(),i=this._configurationService.getValue(t.language);if(i){const e=i.colorDecorators;if(e&&void 0!==e.enable&&!e.enable)return e.enable}return this._editor.getOption(12)}static get(e){return e.getContribution(this.ID)}dispose(){this.stop(),this.removeAllDecorations(),super.dispose()}onModelChanged(){ +if(this.stop(),!this._isEnabled)return;const t=this._editor.getModel();t&&g.ColorProviderRegistry.has(t)&&(this._localToDispose.add(this._editor.onDidChangeModelContent(t=>{this._timeoutTimer||(this._timeoutTimer=new i.TimeoutTimer,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},e.RECOMPUTE_TIME))})),this.beginCompute())}beginCompute(){this._computePromise=i.createCancelablePromise(e=>{const t=this._editor.getModel();return t?p.getColors(t,e):Promise.resolve([])}),this._computePromise.then(e=>{this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null},o.onUnexpectedError)}stop(){this._timeoutTimer&&(this._timeoutTimer.cancel(),this._timeoutTimer=null),this._computePromise&&(this._computePromise.cancel(),this._computePromise=null),this._localToDispose.clear()}updateDecorations(e){const t=e.map(e=>({range:{startLineNumber:e.colorInfo.range.startLineNumber,startColumn:e.colorInfo.range.startColumn,endLineNumber:e.colorInfo.range.endLineNumber, +endColumn:e.colorInfo.range.endColumn},options:u.ModelDecorationOptions.EMPTY}));this._decorationsIds=this._editor.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((t,i)=>this._colorDatas.set(t,e[i]))}updateColorDecorators(e){let t=[],i={};for(let o=0;o{i[e]||this._codeEditorService.removeDecorationType(e)}),this._colorDecoratorIds=this._editor.deltaDecorations(this._colorDecoratorIds,t)}removeAllDecorations(){this._decorationsIds=this._editor.deltaDecorations(this._decorationsIds,[]),this._colorDecoratorIds=this._editor.deltaDecorations(this._colorDecoratorIds,[]),this._decorationsTypes.forEach(e=>{this._codeEditorService.removeDecorationType(e)})}getColorData(e){const t=this._editor.getModel();if(!t)return null;const i=t.getDecorationsInRange(h.Range.fromPositions(e,e)).filter(e=>this._colorDatas.has(e.id));return 0===i.length?null:this._colorDatas.get(i[0].id)}};f.ID="editor.contrib.colorDetector",f.RECOMPUTE_TIME=1e3,f=a([l(1,c.ICodeEditorService),l(2,m.IConfigurationService)],f),t.ColorDetector=f,d.registerEditorContribution(f.ID,f)})),define(t[564],i([0,1,453,39,11,22,216,391,33]),(function(e,t,i,n,o,s,r,a,l){ +"use strict";Object.defineProperty(t,"__esModule",{value:!0});class d extends o.EditorAction{constructor(e,t){super(t),this._type=e}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=[],o=t.getSelections(),s=i.getOptions(),r=t.getOption(14);for(const e of o)n.push(new a.LineCommentCommand(e,s.tabSize,this._type,r.insertSpace,r.ignoreEmptyLines));t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}}class c extends o.EditorAction{constructor(){super({id:"editor.action.blockComment",label:i.localize(4,null),alias:"Toggle Block Comment",precondition:s.EditorContextKeys.writable,kbOpts:{kbExpr:s.EditorContextKeys.editorTextFocus,primary:1567,linux:{primary:3103},weight:100},menuOpts:{menuId:l.MenuId.MenubarEditMenu,group:"5_insert",title:i.localize(5,null),order:2}})}run(e,t){if(!t.hasModel())return;const i=t.getOption(14),n=[],o=t.getSelections();for(const e of o)n.push(new r.BlockCommentCommand(e,i.insertSpace));t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}} +o.registerEditorAction(class extends d{constructor(){super(0,{id:"editor.action.commentLine",label:i.localize(0,null),alias:"Toggle Line Comment",precondition:s.EditorContextKeys.writable,kbOpts:{kbExpr:s.EditorContextKeys.editorTextFocus,primary:2133,weight:100},menuOpts:{menuId:l.MenuId.MenubarEditMenu,group:"5_insert",title:i.localize(1,null),order:1}})}}),o.registerEditorAction(class extends d{constructor(){super(1,{id:"editor.action.addCommentLine",label:i.localize(2,null),alias:"Add Line Comment",precondition:s.EditorContextKeys.writable,kbOpts:{kbExpr:s.EditorContextKeys.editorTextFocus,primary:n.KeyChord(2089,2081),weight:100}})}}),o.registerEditorAction(class extends d{constructor(){super(2,{id:"editor.action.removeCommentLine",label:i.localize(3,null),alias:"Remove Line Comment",precondition:s.EditorContextKeys.writable,kbOpts:{kbExpr:s.EditorContextKeys.editorTextFocus,primary:n.KeyChord(2089,2099),weight:100}})}}),o.registerEditorAction(c)})), +define(t[565],i([0,1,454,7,47,2,11,22,33,17,66,35,91]),(function(e,t,i,n,o,s,r,d,c,h,u,g,p){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContextMenuController=void 0;let m=class e{constructor(e,t,i,o,r,a){this._contextMenuService=t,this._contextViewService=i,this._contextKeyService=o,this._keybindingService=r,this._menuService=a,this._toDispose=new s.DisposableStore,this._contextMenuIsBeingShownCount=0,this._editor=e,this._toDispose.add(this._editor.onContextMenu(e=>this._onContextMenu(e))),this._toDispose.add(this._editor.onMouseWheel(e=>{if(this._contextMenuIsBeingShownCount>0){const t=this._contextViewService.getContextViewElement(),i=e.srcElement;i.shadowRoot&&n.getShadowRoot(t)===i.shadowRoot||this._contextViewService.hideContextView()}})),this._toDispose.add(this._editor.onKeyDown(e=>{58===e.keyCode&&(e.preventDefault(),e.stopPropagation(),this.showContextMenu())}))}static get(t){return t.getContribution(e.ID)}_onContextMenu(e){if(!this._editor.hasModel())return +;if(!this._editor.getOption(15))return this._editor.focus(),void(e.target.position&&!this._editor.getSelection().containsPosition(e.target.position)&&this._editor.setPosition(e.target.position));if(12===e.target.type)return;if(e.event.preventDefault(),6!==e.target.type&&7!==e.target.type&&1!==e.target.type)return;if(this._editor.focus(),e.target.position){let t=!1;for(const i of this._editor.getSelections())if(i.containsPosition(e.target.position)){t=!0;break}t||this._editor.setPosition(e.target.position)}let t=null;1!==e.target.type&&(t={x:e.event.posx-1,width:2,y:e.event.posy-1,height:2}),this.showContextMenu(t)}showContextMenu(e){if(!this._editor.getOption(15))return;if(!this._editor.hasModel())return;if(!this._contextMenuService)return void this._editor.focus();const t=this._getMenuActions(this._editor.getModel(),c.MenuId.EditorContext);t.length>0&&this._doShowContextMenu(t,e)}_getMenuActions(e,t){const i=[],n=this._menuService.createMenu(t,this._contextKeyService),s=n.getActions({arg:e.uri});n.dispose() +;for(let t of s){const[,n]=t;let s=0;for(const t of n)if(t instanceof c.SubmenuItemAction){const n=this._getMenuActions(e,t.item.submenu);n.length>0&&(i.push(new o.SubmenuAction(t.id,t.label,n)),s++)}else i.push(t),s++;s&&i.push(new o.Separator)}return i.length&&i.pop(),i}_doShowContextMenu(e,t=null){if(!this._editor.hasModel())return;const i=this._editor.getOption(46);if(this._editor.updateOptions({hover:{enabled:!1}}),!t){this._editor.revealPosition(this._editor.getPosition(),1),this._editor.render();const e=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),i=n.getDomNodePagePosition(this._editor.getDomNode()),o=i.left+e.left,s=i.top+e.top+e.height;t={x:o,y:s}}this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:this._editor.getDomNode(),getAnchor:()=>t,getActions:()=>e,getActionViewItem:e=>{const t=this._keybindingFor(e);if(t)return new p.ActionViewItem(e,e,{label:!0,keybinding:t.getLabel(),isMenu:!0});const i=e +;return"function"==typeof i.getActionViewItem?i.getActionViewItem():new p.ActionViewItem(e,e,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:e=>this._keybindingFor(e),onHide:e=>{this._contextMenuIsBeingShownCount--,this._editor.focus(),this._editor.updateOptions({hover:i})}})}_keybindingFor(e){return this._keybindingService.lookupKeybinding(e.id)}dispose(){this._contextMenuIsBeingShownCount>0&&this._contextViewService.hideContextView(),this._toDispose.dispose()}};m.ID="editor.contrib.contextmenu",m=a([l(1,u.IContextMenuService),l(2,u.IContextViewService),l(3,h.IContextKeyService),l(4,g.IKeybindingService),l(5,c.IMenuService)],m),t.ContextMenuController=m;class f extends r.EditorAction{constructor(){super({id:"editor.action.showContextMenu",label:i.localize(0,null),alias:"Show Editor Context Menu",precondition:void 0,kbOpts:{kbExpr:d.EditorContextKeys.textInputFocus,primary:1092,weight:100}})}run(e,t){m.get(t).showContextMenu()}}r.registerEditorContribution(m.ID,m),r.registerEditorAction(f)})), +define(t[566],i([0,1,455,2,11,22]),(function(e,t,i,n,o,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CursorRedo=t.CursorUndo=t.CursorUndoRedoController=void 0;class r{constructor(e){this.selections=e}equals(e){const t=this.selections.length;if(t!==e.selections.length)return!1;for(let i=0;i{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeModelContent(e=>{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeCursorSelection(t=>{if(this._isCursorUndoRedo)return;if(!t.oldSelections)return;if(t.oldModelVersionId!==t.modelVersionId)return;const i=new r(t.oldSelections) +;this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(i)||(this._undoStack.push(new a(i,e.getScrollTop(),e.getScrollLeft())),this._redoStack=[],this._undoStack.length>50&&this._undoStack.shift())}))}static get(e){return e.getContribution(l.ID)}cursorUndo(){this._editor.hasModel()&&0!==this._undoStack.length&&(this._redoStack.push(new a(new r(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._undoStack.pop()))}cursorRedo(){this._editor.hasModel()&&0!==this._redoStack.length&&(this._undoStack.push(new a(new r(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._redoStack.pop()))}_applyState(e){this._isCursorUndoRedo=!0,this._editor.setSelections(e.cursorState.selections),this._editor.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft}),this._isCursorUndoRedo=!1}}t.CursorUndoRedoController=l,l.ID="editor.contrib.cursorUndoRedoController" +;class d extends o.EditorAction{constructor(){super({id:"cursorUndo",label:i.localize(0,null),alias:"Cursor Undo",precondition:void 0,kbOpts:{kbExpr:s.EditorContextKeys.textInputFocus,primary:2099,weight:100}})}run(e,t,i){l.get(t).cursorUndo()}}t.CursorUndo=d;class c extends o.EditorAction{constructor(){super({id:"cursorRedo",label:i.localize(1,null),alias:"Cursor Redo",precondition:void 0})}run(e,t,i){l.get(t).cursorRedo()}}t.CursorRedo=c,o.registerEditorContribution(l.ID,l),o.registerEditorAction(d),o.registerEditorAction(c)})),define(t[567],i([0,1,2,16,11,13,3,20,392,31,329]),(function(e,t,i,n,o,s,r,a,l,d){"use strict";function c(e){return n.isMacintosh?e.altKey:e.ctrlKey}Object.defineProperty(t,"__esModule",{value:!0}),t.DragAndDropController=void 0;class h extends i.Disposable{constructor(e){super(),this._editor=e,this._register(this._editor.onMouseDown(e=>this._onEditorMouseDown(e))),this._register(this._editor.onMouseUp(e=>this._onEditorMouseUp(e))), +this._register(this._editor.onMouseDrag(e=>this._onEditorMouseDrag(e))),this._register(this._editor.onMouseDrop(e=>this._onEditorMouseDrop(e))),this._register(this._editor.onKeyDown(e=>this.onEditorKeyDown(e))),this._register(this._editor.onKeyUp(e=>this.onEditorKeyUp(e))),this._register(this._editor.onDidBlurEditorWidget(()=>this.onEditorBlur())),this._register(this._editor.onDidBlurEditorText(()=>this.onEditorBlur())),this._dndDecorationIds=[],this._mouseDown=!1,this._modifierPressed=!1,this._dragSelection=null}onEditorBlur(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1}onEditorKeyDown(e){this._editor.getOption(25)&&!this._editor.getOption(13)&&(c(e)&&(this._modifierPressed=!0),this._mouseDown&&c(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){this._editor.getOption(25)&&!this._editor.getOption(13)&&(c(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===h.TRIGGER_KEY_VALUE&&this._editor.updateOptions({mouseStyle:"default"}))} +_onEditorMouseDown(e){this._mouseDown=!0}_onEditorMouseUp(e){this._mouseDown=!1,this._editor.updateOptions({mouseStyle:"text"})}_onEditorMouseDrag(e){let t=e.target;if(null===this._dragSelection){let e=(this._editor.getSelections()||[]).filter(e=>t.position&&e.containsPosition(t.position));if(1!==e.length)return;this._dragSelection=e[0]}c(e.event)?this._editor.updateOptions({mouseStyle:"copy"}):this._editor.updateOptions({mouseStyle:"default"}),t.position&&(this._dragSelection.containsPosition(t.position)?this._removeDecoration():this.showAt(t.position))}_onEditorMouseDrop(e){if(e.target&&(this._hitContent(e.target)||this._hitMargin(e.target))&&e.target.position){let t=new s.Position(e.target.position.lineNumber,e.target.position.column);if(null===this._dragSelection){let i=null;if(e.event.shiftKey){let e=this._editor.getSelection();if(e){const{selectionStartLineNumber:n,selectionStartColumn:o}=e;i=[new a.Selection(n,o,t.lineNumber,t.column)]} +}else i=(this._editor.getSelections()||[]).map(e=>e.containsPosition(t)?new a.Selection(t.lineNumber,t.column,t.lineNumber,t.column):e);this._editor.setSelections(i||[],"mouse")}else(!this._dragSelection.containsPosition(t)||(c(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(h.ID,new l.DragAndDropCommand(this._dragSelection,t,c(e.event)||this._modifierPressed)),this._editor.pushUndoStop())}this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}showAt(e){let t=[{range:new r.Range(e.lineNumber,e.column,e.lineNumber,e.column),options:h._DECORATION_OPTIONS}];this._dndDecorationIds=this._editor.deltaDecorations(this._dndDecorationIds,t),this._editor.revealPosition(e,1)}_removeDecoration(){this._dndDecorationIds=this._editor.deltaDecorations(this._dndDecorationIds,[])}_hitContent(e){return 6===e.type||7===e.type} +_hitMargin(e){return 2===e.type||3===e.type||4===e.type}dispose(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1,super.dispose()}}t.DragAndDropController=h,h.ID="editor.contrib.dragAndDrop",h.TRIGGER_KEY_VALUE=n.isMacintosh?6:5,h._DECORATION_OPTIONS=d.ModelDecorationOptions.register({className:"dnd-target"}),o.registerEditorContribution(h.ID,h)})),define(t[568],i([0,1,460,11,120]),(function(e,t,i,n,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class s extends n.EditorAction{constructor(){super({id:"editor.action.fontZoomIn",label:i.localize(0,null),alias:"Editor Font Zoom In",precondition:void 0})}run(e,t){o.EditorZoom.setZoomLevel(o.EditorZoom.getZoomLevel()+1)}}class r extends n.EditorAction{constructor(){super({id:"editor.action.fontZoomOut",label:i.localize(1,null),alias:"Editor Font Zoom Out",precondition:void 0})}run(e,t){o.EditorZoom.setZoomLevel(o.EditorZoom.getZoomLevel()-1)}}class a extends n.EditorAction{constructor(){super({ +id:"editor.action.fontZoomReset",label:i.localize(2,null),alias:"Editor Font Zoom Reset",precondition:void 0})}run(e,t){o.EditorZoom.setZoomLevel(0)}}n.registerEditorAction(s),n.registerEditorAction(r),n.registerEditorAction(a)})),define(t[569],i([0,1,48,19,25,12,24,68,101,13,3,20,18,72,44,218,461,508,10,69,28,23,50]),(function(e,t,i,n,o,s,a,l,d,c,h,u,g,p,m,f,_,v,C,b,S,w,y){"use strict";function E(e){if(!(e=e.filter(e=>e.range)).length)return;let{range:t}=e[0];for(let i=1;ie.provideDocumentRangeFormattingEdits(t,t.getFullModelRange(),i,n)})}return t}Object.defineProperty(t,"__esModule",{value:!0}),t.getOnTypeFormattingEdits=t.getDocumentFormattingEditsUntilResult=t.getDocumentRangeFormattingEditsUntilResult=t.formatDocumentWithProvider=t.formatDocumentWithSelectedProvider=t.formatDocumentRangesWithProvider=t.formatDocumentRangesWithSelectedProvider=t.FormattingConflicts=t.getRealAndSyntheticDocumentFormattersOrdered=t.alertFormattingEdits=void 0,t.alertFormattingEdits=E,t.getRealAndSyntheticDocumentFormattersOrdered=L;class x{static select(e,t,i){return r(this,void 0,void 0,(function*(){if(0===e.length)return;const n=y.Iterable.first(x._selectors);return n?yield n(e,t,i):e[0]}))}}function D(e,t,i,o,s){return r(this,void 0,void 0,(function*(){ +const r=e.get(p.IEditorWorkerService);let a,c;d.isCodeEditor(i)?(a=i.getModel(),c=new l.EditorStateCancellationTokenSource(i,5,void 0,s)):(a=i,c=new l.TextModelCancellationTokenSource(i,s));let g=[],m=0;for(let e of n.asArray(o).sort(h.Range.compareRangesUsingStarts))m>0&&h.Range.areIntersectingOrTouching(g[m-1],e)?g[m-1]=h.Range.fromPositions(g[m-1].getStartPosition(),e.getEndPosition()):m=g.push(e);const _=[];for(let e of g)try{const i=yield t.provideDocumentRangeFormattingEdits(a,e,a.getFormattingOptions(),c.token),n=yield r.computeMoreMinimalEdits(a.uri,i);if(n&&_.push(...n),c.token.isCancellationRequested)return!0}finally{c.dispose()}if(0===_.length)return!1;if(d.isCodeEditor(i))f.FormattingEdit.execute(i,_,!0),E(_),i.revealPositionInCenterIfOutsideViewport(i.getPosition(),1);else{const[{range:e}]=_,t=new u.Selection(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn);a.pushEditOperations([t],_.map(e=>({text:e.text,range:h.Range.lift(e.range),forceMoveMarkers:!0})),e=>{ +for(const{range:i}of e)if(h.Range.areIntersectingOrTouching(i,t))return[new u.Selection(i.startLineNumber,i.startColumn,i.endLineNumber,i.endColumn)];return null})}return!0}))}function k(e,t,i,n,o){return r(this,void 0,void 0,(function*(){const s=e.get(p.IEditorWorkerService);let r,a,c;d.isCodeEditor(i)?(r=i.getModel(),a=new l.EditorStateCancellationTokenSource(i,5,void 0,o)):(r=i,a=new l.TextModelCancellationTokenSource(i,o));try{const e=yield t.provideDocumentFormattingEdits(r,r.getFormattingOptions(),a.token);if(c=yield s.computeMoreMinimalEdits(r.uri,e),a.token.isCancellationRequested)return!0}finally{a.dispose()}if(!c||0===c.length)return!1;if(d.isCodeEditor(i))f.FormattingEdit.execute(i,c,2!==n),2!==n&&(E(c),i.revealPositionInCenterIfOutsideViewport(i.getPosition(),1));else{const[{range:e}]=c,t=new u.Selection(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn);r.pushEditOperations([t],c.map(e=>({text:e.text,range:h.Range.lift(e.range),forceMoveMarkers:!0})),e=>{ +for(const{range:i}of e)if(h.Range.areIntersectingOrTouching(i,t))return[new u.Selection(i.startLineNumber,i.startColumn,i.endLineNumber,i.endColumn)];return null})}return!0}))}function N(e,t,i,o,a){return r(this,void 0,void 0,(function*(){const r=g.DocumentRangeFormattingEditProviderRegistry.ordered(t);for(const l of r){let r=yield Promise.resolve(l.provideDocumentRangeFormattingEdits(t,i,o,a)).catch(s.onUnexpectedExternalError);if(n.isNonEmptyArray(r))return yield e.computeMoreMinimalEdits(t.uri,r)}}))}function I(e,t,i,o){return r(this,void 0,void 0,(function*(){const r=L(t);for(const a of r){let r=yield Promise.resolve(a.provideDocumentFormattingEdits(t,i,o)).catch(s.onUnexpectedExternalError);if(n.isNonEmptyArray(r))return yield e.computeMoreMinimalEdits(t.uri,r)}}))}function M(e,t,i,n,r){const a=g.OnTypeFormattingEditProviderRegistry.ordered(t) +;return 0===a.length?Promise.resolve(void 0):a[0].autoFormatTriggerCharacters.indexOf(n)<0?Promise.resolve(void 0):Promise.resolve(a[0].provideOnTypeFormattingEdits(t,i,n,r,o.CancellationToken.None)).catch(s.onUnexpectedExternalError).then(i=>e.computeMoreMinimalEdits(t.uri,i))}t.FormattingConflicts=x,x._selectors=new b.LinkedList,t.formatDocumentRangesWithSelectedProvider=function(e,t,i,n,o,s){return r(this,void 0,void 0,(function*(){const r=e.get(C.IInstantiationService),a=d.isCodeEditor(t)?t.getModel():t,l=g.DocumentRangeFormattingEditProviderRegistry.ordered(a),c=yield x.select(l,a,n);c&&(o.report(c),yield r.invokeFunction(D,c,t,i,s))}))},t.formatDocumentRangesWithProvider=D,t.formatDocumentWithSelectedProvider=function(e,t,i,n,o){return r(this,void 0,void 0,(function*(){const s=e.get(C.IInstantiationService),r=d.isCodeEditor(t)?t.getModel():t,a=L(r),l=yield x.select(a,r,i);l&&(n.report(l),yield s.invokeFunction(k,l,t,i,o))}))},t.formatDocumentWithProvider=k,t.getDocumentRangeFormattingEditsUntilResult=N, +t.getDocumentFormattingEditsUntilResult=I,t.getOnTypeFormattingEdits=M,S.CommandsRegistry.registerCommand("_executeFormatRangeProvider",(function(e,...t){const[i,n,r]=t;w.assertType(a.URI.isUri(i)),w.assertType(h.Range.isIRange(n));const l=e.get(m.IModelService).getModel(i);if(!l)throw s.illegalArgument("resource");return N(e.get(p.IEditorWorkerService),l,h.Range.lift(n),r,o.CancellationToken.None)})),S.CommandsRegistry.registerCommand("_executeFormatDocumentProvider",(function(e,...t){const[i,n]=t;w.assertType(a.URI.isUri(i));const r=e.get(m.IModelService).getModel(i);if(!r)throw s.illegalArgument("resource");return I(e.get(p.IEditorWorkerService),r,n,o.CancellationToken.None)})),S.CommandsRegistry.registerCommand("_executeFormatOnTypeProvider",(function(e,...t){const[i,n,o,r]=t;w.assertType(a.URI.isUri(i)),w.assertType(c.Position.isIPosition(n)),w.assertType("string"==typeof o);const l=e.get(m.IModelService).getModel(i);if(!l)throw s.illegalArgument("resource") +;return M(e.get(p.IEditorWorkerService),l,c.Position.lift(n),o,r)}))})),define(t[570],i([0,1,19,25,39,2,11,27,87,3,22,18,72,569,218,462,28,17,10,12,56]),(function(e,t,i,n,o,s,d,c,h,u,g,p,m,f,_,v,C,b,S,w,y){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let E=class{constructor(e,t){this._workerService=t,this._callOnDispose=new s.DisposableStore,this._callOnModel=new s.DisposableStore,this._editor=e,this._callOnDispose.add(e.onDidChangeConfiguration(()=>this._update())),this._callOnDispose.add(e.onDidChangeModel(()=>this._update())),this._callOnDispose.add(e.onDidChangeModelLanguage(()=>this._update())),this._callOnDispose.add(p.OnTypeFormattingEditProviderRegistry.onDidChange(this._update,this))}dispose(){this._callOnDispose.dispose(),this._callOnModel.dispose()}_update(){if(this._callOnModel.clear(),!this._editor.getOption(41))return;if(!this._editor.hasModel())return;const e=this._editor.getModel(),[t]=p.OnTypeFormattingEditProviderRegistry.ordered(e) +;if(!t||!t.autoFormatTriggerCharacters)return;let i=new h.CharacterSet;for(let e of t.autoFormatTriggerCharacters)i.add(e.charCodeAt(0));this._callOnModel.add(this._editor.onDidType(e=>{let t=e.charCodeAt(e.length-1);i.has(t)&&this._trigger(String.fromCharCode(t))}))}_trigger(e){if(!this._editor.hasModel())return;if(this._editor.getSelections().length>1)return;const t=this._editor.getModel(),n=this._editor.getPosition();let o=!1;const s=this._editor.onDidChangeModelContent(e=>{if(e.isFlush)return o=!0,void s.dispose();for(let t=0,i=e.changes.length;t{s.dispose(),o||i.isNonEmptyArray(e)&&(_.FormattingEdit.execute(this._editor,e,!0),f.alertFormattingEdits(e))},e=>{throw s.dispose(),e})}};E.ID="editor.contrib.autoFormat",E=a([l(1,m.IEditorWorkerService)],E);let L=class{constructor(e,t){this.editor=e,this._instantiationService=t, +this._callOnDispose=new s.DisposableStore,this._callOnModel=new s.DisposableStore,this._callOnDispose.add(e.onDidChangeConfiguration(()=>this._update())),this._callOnDispose.add(e.onDidChangeModel(()=>this._update())),this._callOnDispose.add(e.onDidChangeModelLanguage(()=>this._update())),this._callOnDispose.add(p.DocumentRangeFormattingEditProviderRegistry.onDidChange(this._update,this))}dispose(){this._callOnDispose.dispose(),this._callOnModel.dispose()}_update(){this._callOnModel.clear(),this.editor.getOption(40)&&this.editor.hasModel()&&p.DocumentRangeFormattingEditProviderRegistry.has(this.editor.getModel())&&this._callOnModel.add(this.editor.onDidPaste(({range:e})=>this._trigger(e)))}_trigger(e){this.editor.hasModel()&&(this.editor.getSelections().length>1||this._instantiationService.invokeFunction(f.formatDocumentRangesWithSelectedProvider,this.editor,e,2,y.Progress.None,n.CancellationToken.None).catch(w.onUnexpectedError))}};L.ID="editor.contrib.formatOnPaste",L=a([l(1,S.IInstantiationService)],L) +;class x extends d.EditorAction{constructor(){super({id:"editor.action.formatDocument",label:v.localize(0,null),alias:"Format Document",precondition:b.ContextKeyExpr.and(g.EditorContextKeys.notInCompositeEditor,g.EditorContextKeys.writable,g.EditorContextKeys.hasDocumentFormattingProvider),kbOpts:{kbExpr:b.ContextKeyExpr.and(g.EditorContextKeys.editorTextFocus,g.EditorContextKeys.hasDocumentFormattingProvider),primary:1572,linux:{primary:3111},weight:100},contextMenuOpts:{when:g.EditorContextKeys.hasDocumentFormattingProvider,group:"1_modification",order:1.3}})}run(e,t){return r(this,void 0,void 0,(function*(){if(t.hasModel()){const i=e.get(S.IInstantiationService),o=e.get(y.IEditorProgressService);yield o.showWhile(i.invokeFunction(f.formatDocumentWithSelectedProvider,t,1,y.Progress.None,n.CancellationToken.None),250)}}))}}class D extends d.EditorAction{constructor(){super({id:"editor.action.formatSelection",label:v.localize(1,null),alias:"Format Selection", +precondition:b.ContextKeyExpr.and(g.EditorContextKeys.writable,g.EditorContextKeys.hasDocumentSelectionFormattingProvider),kbOpts:{kbExpr:b.ContextKeyExpr.and(g.EditorContextKeys.editorTextFocus,g.EditorContextKeys.hasDocumentSelectionFormattingProvider),primary:o.KeyChord(2089,2084),weight:100},contextMenuOpts:{when:b.ContextKeyExpr.and(g.EditorContextKeys.hasDocumentSelectionFormattingProvider,g.EditorContextKeys.hasNonEmptySelection),group:"1_modification",order:1.31}})}run(e,t){return r(this,void 0,void 0,(function*(){if(!t.hasModel())return;const i=e.get(S.IInstantiationService),o=t.getModel(),s=t.getSelections().map(e=>e.isEmpty()?new u.Range(e.startLineNumber,1,e.startLineNumber,o.getLineMaxColumn(e.startLineNumber)):e),r=e.get(y.IEditorProgressService);yield r.showWhile(i.invokeFunction(f.formatDocumentRangesWithSelectedProvider,t,s,1,y.Progress.None,n.CancellationToken.None),250)}))}}d.registerEditorContribution(E.ID,E),d.registerEditorContribution(L.ID,L),d.registerEditorAction(x), +d.registerEditorAction(D),C.CommandsRegistry.registerCommand("editor.action.format",e=>r(void 0,void 0,void 0,(function*(){const t=e.get(c.ICodeEditorService).getFocusedCodeEditor();if(!t||!t.hasModel())return;const i=e.get(C.ICommandService);t.getSelection().isEmpty()?yield i.executeCommand("editor.action.formatDocument"):yield i.executeCommand("editor.action.formatSelection")})))})),define(t[246],i([0,1,25,12,11,18]),(function(e,t,i,n,o,s){"use strict";function a(e,t,i,o){const s=i.ordered(e).map(i=>Promise.resolve(o(i,e,t)).then(void 0,e=>{n.onUnexpectedExternalError(e)}));return Promise.all(s).then(e=>{const t=[];for(let i of e)Array.isArray(i)?t.push(...i):i&&t.push(i);return t})}function l(e,t,i){return a(e,t,s.DefinitionProviderRegistry,(e,t,n)=>e.provideDefinition(t,n,i))}function d(e,t,i){return a(e,t,s.DeclarationProviderRegistry,(e,t,n)=>e.provideDeclaration(t,n,i))}function c(e,t,i){return a(e,t,s.ImplementationProviderRegistry,(e,t,n)=>e.provideImplementation(t,n,i))}function h(e,t,i){ +return a(e,t,s.TypeDefinitionProviderRegistry,(e,t,n)=>e.provideTypeDefinition(t,n,i))}function u(e,t,i,n){return a(e,t,s.ReferenceProviderRegistry,(e,t,o)=>r(this,void 0,void 0,(function*(){const s=yield e.provideReferences(t,o,{includeDeclaration:!0},n);if(!i||!s||2!==s.length)return s;const r=yield e.provideReferences(t,o,{includeDeclaration:!1},n);return r&&1===r.length?r:s})))}Object.defineProperty(t,"__esModule",{value:!0}),t.getReferencesAtPosition=t.getTypeDefinitionsAtPosition=t.getImplementationsAtPosition=t.getDeclarationsAtPosition=t.getDefinitionsAtPosition=void 0,t.getDefinitionsAtPosition=l,t.getDeclarationsAtPosition=d,t.getImplementationsAtPosition=c,t.getTypeDefinitionsAtPosition=h,t.getReferencesAtPosition=u,o.registerModelAndPositionCommand("_executeDefinitionProvider",(e,t)=>l(e,t,i.CancellationToken.None)),o.registerModelAndPositionCommand("_executeDeclarationProvider",(e,t)=>d(e,t,i.CancellationToken.None)), +o.registerModelAndPositionCommand("_executeImplementationProvider",(e,t)=>c(e,t,i.CancellationToken.None)),o.registerModelAndPositionCommand("_executeTypeDefinitionProvider",(e,t)=>h(e,t,i.CancellationToken.None)),o.registerModelAndPositionCommand("_executeReferenceProvider",(e,t)=>u(e,t,!1,i.CancellationToken.None))})),define(t[571],i([0,1,17,10,71,83,11,27,3,2,4,471,35,32,41]),(function(e,t,i,n,o,s,r,d,c,h,u,g,p,m,f){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ISymbolNavigationService=t.ctxHasSymbols=void 0,t.ctxHasSymbols=new i.RawContextKey("hasSymbols",!1),t.ISymbolNavigationService=n.createDecorator("ISymbolNavigationService");let _=class{constructor(e,i,n,o){this._editorService=i,this._notificationService=n,this._keybindingService=o,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=t.ctxHasSymbols.bindTo(e)}reset(){this._ctxHasSymbols.reset(),h.dispose(this._currentState),h.dispose(this._currentMessage),this._currentModel=void 0, +this._currentIdx=-1}put(e){const t=e.parent.parent;if(t.references.length<=1)return void this.reset();this._currentModel=t,this._currentIdx=t.references.indexOf(e),this._ctxHasSymbols.set(!0),this._showMessage();const i=new v(this._editorService),n=i.onDidChange(e=>{if(this._ignoreEditorChange)return;const i=this._editorService.getActiveCodeEditor();if(!i)return;const n=i.getModel(),o=i.getPosition();if(!n||!o)return;let s=!1,r=!1;for(const e of t.references)if(f.isEqual(e.uri,n.uri))s=!0,r=r||c.Range.containsPosition(e.range,o);else if(s)break;s&&r||this.reset()});this._currentState=h.combinedDisposable(i,n)}revealNext(e){if(!this._currentModel)return Promise.resolve();this._currentIdx+=1,this._currentIdx%=this._currentModel.references.length;const t=this._currentModel.references[this._currentIdx];return this._showMessage(),this._ignoreEditorChange=!0,this._editorService.openCodeEditor({resource:t.uri,options:{selection:c.Range.collapseToStart(t.range),selectionRevealType:3}},e).finally(()=>{ +this._ignoreEditorChange=!1})}_showMessage(){h.dispose(this._currentMessage);const e=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),t=e?g.localize(0,null,this._currentIdx+1,this._currentModel.references.length,e.getLabel()):g.localize(1,null,this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(t)}};_=a([l(0,i.IContextKeyService),l(1,d.ICodeEditorService),l(2,m.INotificationService),l(3,p.IKeybindingService)],_),o.registerSingleton(t.ISymbolNavigationService,_,!0),r.registerEditorCommand(new class extends r.EditorCommand{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:t.ctxHasSymbols,kbOpts:{weight:100,primary:70}})}runEditorCommand(e,i){return e.get(t.ISymbolNavigationService).revealNext(i)}}),s.KeybindingsRegistry.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:t.ctxHasSymbols,primary:9,handler(e){e.get(t.ISymbolNavigationService).reset()}});let v=class{ +constructor(e){this._listener=new Map,this._disposables=new h.DisposableStore,this._onDidChange=new u.Emitter,this.onDidChange=this._onDidChange.event,this._disposables.add(e.onCodeEditorRemove(this._onDidRemoveEditor,this)),this._disposables.add(e.onCodeEditorAdd(this._onDidAddEditor,this)),e.listCodeEditors().forEach(this._onDidAddEditor,this)}dispose(){this._disposables.dispose(),this._onDidChange.dispose(),h.dispose(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,h.combinedDisposable(e.onDidChangeCursorPosition(t=>this._onDidChange.fire({editor:e})),e.onDidChangeModelContent(t=>this._onDidChange.fire({editor:e}))))}_onDidRemoveEditor(e){h.dispose(this._listener.get(e)),this._listener.delete(e)}};v=a([l(0,d.ICodeEditorService)],v)})),define(t[572],i([0,1,19,25,12,11,18]),(function(e,t,i,n,o,s,r){"use strict";function a(e,t,n){const s=r.HoverProviderRegistry.ordered(e).map(i=>Promise.resolve(i.provideHover(e,t,n)).then(e=>e&&function(e){ +const t=void 0!==e.range,i=void 0!==e.contents&&e.contents&&e.contents.length>0;return t&&i}(e)?e:void 0,e=>{o.onUnexpectedExternalError(e)}));return Promise.all(s).then(i.coalesce)}Object.defineProperty(t,"__esModule",{value:!0}),t.getHover=void 0,t.getHover=a,s.registerModelAndPositionCommand("_executeHoverProvider",(e,t)=>a(e,t,n.CancellationToken.None))})),define(t[573],i([0,1,475,2,8,11,169,60,3,20,22,31,42,44,222,75]),(function(e,t,i,n,o,s,r,a,l,d,c,h,u,g,p,m){"use strict";function f(e,t,i,n){if(1===e.getLineCount()&&1===e.getLineMaxColumn(1))return[];let s=u.LanguageConfigurationRegistry.getIndentationRules(e.getLanguageIdentifier().id);if(!s)return[];for(i=Math.min(i,e.getLineCount());t<=i&&s.unIndentedLinePattern;){let i=e.getLineContent(t);if(!s.unIndentedLinePattern.test(i))break;t++}if(t>i-1)return[];const{tabSize:l,indentSize:c,insertSpaces:g}=e.getOptions(),p=(e,t)=>(t=t||1,r.ShiftCommand.shiftIndent(e,e.length+t,l,c,g)),m=(e,t)=>(t=t||1,r.ShiftCommand.unshiftIndent(e,e.length+t,l,c,g)) +;let f,_=[],v=e.getLineContent(t),C=v;if(null!=n){f=n;let e=o.getLeadingWhitespace(v);C=f+v.substring(e.length),s.decreaseIndentPattern&&s.decreaseIndentPattern.test(C)&&(C=(f=m(f))+v.substring(e.length)),v!==C&&_.push(a.EditOperation.replace(new d.Selection(t,1,t,e.length+1),h.TextModel.normalizeIndentation(f,c,g)))}else f=o.getLeadingWhitespace(v);let b=f;s.increaseIndentPattern&&s.increaseIndentPattern.test(C)?(b=p(b),f=p(f)):s.indentNextLinePattern&&s.indentNextLinePattern.test(C)&&(b=p(b));for(let n=++t;n<=i;n++){let t=e.getLineContent(n),i=o.getLeadingWhitespace(t),r=b+t.substring(i.length);s.decreaseIndentPattern&&s.decreaseIndentPattern.test(r)&&(b=m(b),f=m(f)),i!==b&&_.push(a.EditOperation.replace(new d.Selection(n,1,n,i.length+1),h.TextModel.normalizeIndentation(b,c,g))),s.unIndentedLinePattern&&s.unIndentedLinePattern.test(t)||(b=s.increaseIndentPattern&&s.increaseIndentPattern.test(r)?f=p(f):s.indentNextLinePattern&&s.indentNextLinePattern.test(r)?p(b):f)}return _} +Object.defineProperty(t,"__esModule",{value:!0}),t.IndentationToTabsCommand=t.IndentationToSpacesCommand=t.AutoIndentOnPaste=t.AutoIndentOnPasteCommand=t.ReindentSelectedLinesAction=t.ReindentLinesAction=t.DetectIndentation=t.IndentUsingSpaces=t.IndentUsingTabs=t.ChangeIndentationSizeAction=t.IndentationToTabsAction=t.IndentationToSpacesAction=t.getReindentEditOperations=void 0,t.getReindentEditOperations=f;class _ extends s.EditorAction{constructor(){super({id:_.ID,label:i.localize(0,null),alias:"Convert Indentation to Spaces",precondition:c.EditorContextKeys.writable})}run(e,t){let i=t.getModel();if(!i)return;let n=i.getOptions(),o=t.getSelection();if(!o)return;const s=new k(o,n.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop(),i.updateOptions({insertSpaces:!0})}}t.IndentationToSpacesAction=_,_.ID="editor.action.indentationToSpaces";class v extends s.EditorAction{constructor(){super({id:v.ID,label:i.localize(1,null),alias:"Convert Indentation to Tabs", +precondition:c.EditorContextKeys.writable})}run(e,t){let i=t.getModel();if(!i)return;let n=i.getOptions(),o=t.getSelection();if(!o)return;const s=new N(o,n.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop(),i.updateOptions({insertSpaces:!1})}}t.IndentationToTabsAction=v,v.ID="editor.action.indentationToTabs";class C extends s.EditorAction{constructor(e,t){super(t),this.insertSpaces=e}run(e,t){const n=e.get(m.IQuickInputService),o=e.get(g.IModelService);let s=t.getModel();if(!s)return;let r=o.getCreationOptions(s.getLanguageIdentifier().language,s.uri,s.isForSimpleWidget);const a=[1,2,3,4,5,6,7,8].map(e=>({id:e.toString(),label:e.toString(),description:e===r.tabSize?i.localize(2,null):void 0})),l=Math.min(s.getOptions().tabSize-1,7);setTimeout(()=>{n.pick(a,{placeHolder:i.localize(3,null),activeItem:a[l]}).then(e=>{e&&s&&!s.isDisposed()&&s.updateOptions({tabSize:parseInt(e.label,10),insertSpaces:this.insertSpaces})})},50)}}t.ChangeIndentationSizeAction=C;class b extends C{constructor(){ +super(!1,{id:b.ID,label:i.localize(4,null),alias:"Indent Using Tabs",precondition:void 0})}}t.IndentUsingTabs=b,b.ID="editor.action.indentUsingTabs";class S extends C{constructor(){super(!0,{id:S.ID,label:i.localize(5,null),alias:"Indent Using Spaces",precondition:void 0})}}t.IndentUsingSpaces=S,S.ID="editor.action.indentUsingSpaces";class w extends s.EditorAction{constructor(){super({id:w.ID,label:i.localize(6,null),alias:"Detect Indentation from Content",precondition:void 0})}run(e,t){const i=e.get(g.IModelService);let n=t.getModel();if(!n)return;let o=i.getCreationOptions(n.getLanguageIdentifier().language,n.uri,n.isForSimpleWidget);n.detectIndentation(o.insertSpaces,o.tabSize)}}t.DetectIndentation=w,w.ID="editor.action.detectIndentation";class y extends s.EditorAction{constructor(){super({id:"editor.action.reindentlines",label:i.localize(7,null),alias:"Reindent Lines",precondition:c.EditorContextKeys.writable})}run(e,t){let i=t.getModel();if(!i)return;let n=f(i,1,i.getLineCount()) +;n.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,n),t.pushUndoStop())}}t.ReindentLinesAction=y;class E extends s.EditorAction{constructor(){super({id:"editor.action.reindentselectedlines",label:i.localize(8,null),alias:"Reindent Selected Lines",precondition:c.EditorContextKeys.writable})}run(e,t){let i=t.getModel();if(!i)return;let n=t.getSelections();if(null===n)return;let o=[];for(let e of n){let t=e.startLineNumber,n=e.endLineNumber;if(t!==n&&1===e.endColumn&&n--,1===t){if(t===n)continue}else t--;let s=f(i,t,n);o.push(...s)}o.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,o),t.pushUndoStop())}}t.ReindentSelectedLinesAction=E;class L{constructor(e,t){this._initialSelection=t,this._edits=[],this._selectionId=null;for(let t of e)t.range&&"string"==typeof t.text&&this._edits.push(t)}getEditOperations(e,t){for(let e of this._edits)t.addEditOperation(l.Range.lift(e.range),e.text);let i=!1 +;Array.isArray(this._edits)&&1===this._edits.length&&this._initialSelection.isEmpty()&&(this._edits[0].range.startColumn===this._initialSelection.endColumn&&this._edits[0].range.startLineNumber===this._initialSelection.endLineNumber?(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!0)):this._edits[0].range.endColumn===this._initialSelection.startColumn&&this._edits[0].range.endLineNumber===this._initialSelection.startLineNumber&&(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!1))),i||(this._selectionId=t.trackSelection(this._initialSelection))}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}t.AutoIndentOnPasteCommand=L;class x{constructor(e){this.callOnDispose=new n.DisposableStore,this.callOnModel=new n.DisposableStore,this.editor=e,this.callOnDispose.add(e.onDidChangeConfiguration(()=>this.update())),this.callOnDispose.add(e.onDidChangeModel(()=>this.update())),this.callOnDispose.add(e.onDidChangeModelLanguage(()=>this.update()))}update(){ +this.callOnModel.clear(),this.editor.getOption(8)<4||this.editor.getOption(40)||this.editor.hasModel()&&this.callOnModel.add(this.editor.onDidPaste(({range:e})=>{this.trigger(e)}))}trigger(e){let t=this.editor.getSelections();if(null===t||t.length>1)return;const i=this.editor.getModel();if(!i)return;if(!i.isCheapToTokenize(e.getStartPosition().lineNumber))return;const n=this.editor.getOption(8),{tabSize:s,indentSize:a,insertSpaces:d}=i.getOptions();this.editor.pushUndoStop();let c=[],h={shiftIndent:e=>r.ShiftCommand.shiftIndent(e,e.length+1,s,a,d),unshiftIndent:e=>r.ShiftCommand.unshiftIndent(e,e.length+1,s,a,d)},g=e.startLineNumber;for(;g<=e.endLineNumber&&this.shouldIgnoreLine(i,g);)g++;if(g>e.endLineNumber)return;let m=i.getLineContent(g);if(!/\S/.test(m.substring(0,e.startColumn-1))){let e=u.LanguageConfigurationRegistry.getGoodIndentForLine(n,i,i.getLanguageIdentifier().id,g,h);if(null!==e){let t=o.getLeadingWhitespace(m),n=p.getSpaceCnt(e,s);if(n!==p.getSpaceCnt(t,s)){let e=p.generateIndent(n,s,d) +;c.push({range:new l.Range(g,1,g,t.length+1),text:e}),m=e+m.substr(t.length)}else{let e=u.LanguageConfigurationRegistry.getIndentMetadata(i,g);if(0===e||8===e)return}}}const f=g;for(;gi.getLineTokens(e),getLanguageIdentifier:()=>i.getLanguageIdentifier(),getLanguageIdAtPosition:(e,t)=>i.getLanguageIdAtPosition(e,t),getLineContent:e=>e===f?m:i.getLineContent(e)},r=u.LanguageConfigurationRegistry.getGoodIndentForLine(n,t,i.getLanguageIdentifier().id,g+1,h);if(null!==r){let t=p.getSpaceCnt(r,s),n=p.getSpaceCnt(o.getLeadingWhitespace(i.getLineContent(g+1)),s);if(t!==n){let r=t-n;for(let t=g+1;t<=e.endLineNumber;t++){let e=i.getLineContent(t),n=o.getLeadingWhitespace(e),a=p.getSpaceCnt(n,s)+r,h=p.generateIndent(a,s,d);h!==n&&c.push({range:new l.Range(t,1,t,n.length+1),text:h})}}}}let _=new L(c,this.editor.getSelection());this.editor.executeCommand("autoIndentOnPaste",_),this.editor.pushUndoStop()} +shouldIgnoreLine(e,t){e.forceTokenization(t);let i=e.getLineFirstNonWhitespaceColumn(t);if(0===i)return!0;let n=e.getLineTokens(t);if(n.getCount()>0){let e=n.findTokenIndexAtOffset(i);if(e>=0&&1===n.getStandardTokenType(e))return!0}return!1}dispose(){this.callOnDispose.dispose(),this.callOnModel.dispose()}}function D(e,t,i,n){if(1===e.getLineCount()&&1===e.getLineMaxColumn(1))return;let o="";for(let e=0;e({selection:e,index:t,ignore:!1}));i.sort((e,t)=>h.Range.compareRangesUsingStarts(e.selection,t.selection));let n=i[0];for(let e=1;enew c.Position(e.positionLineNumber,e.positionColumn)));let o=t.getSelection();if(null===o)return;let s=new a.TrimTrailingWhitespaceCommand(o,n);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop()}}t.TrimTrailingWhitespaceAction=E,E.ID="editor.action.trimTrailingWhitespace";class L extends s.EditorAction{constructor(){super({id:"editor.action.deleteLines",label:i.localize(13,null),alias:"Delete Line",precondition:g.EditorContextKeys.writable,kbOpts:{kbExpr:g.EditorContextKeys.textInputFocus,primary:3113,weight:100}})}run(e,t){if(!t.hasModel())return;let i=this._getLinesToRemove(t),n=t.getModel();if(1===n.getLineCount()&&1===n.getLineMaxColumn(1))return;let o=0,s=[],r=[];for(let e=0,t=i.length;e1&&(a-=1,c=n.getLineMaxColumn(a)),s.push(d.EditOperation.replace(new u.Selection(a,c,l,h),"")), +r.push(new u.Selection(a-o,t.positionColumn,a-o,t.positionColumn)),o+=t.endLineNumber-t.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,s,r),t.pushUndoStop()}_getLinesToRemove(e){let t=e.getSelections().map(e=>{let t=e.endLineNumber;return e.startLineNumbere.startLineNumber===t.startLineNumber?e.endLineNumber-t.endLineNumber:e.startLineNumber-t.startLineNumber);let i=[],n=t[0];for(let e=1;e=t[e].startLineNumber?n.endLineNumber=t[e].endLineNumber:(i.push(n),n=t[e]);return i.push(n),i}}t.DeleteLinesAction=L;class x extends s.EditorAction{constructor(){super({id:"editor.action.indentLines",label:i.localize(14,null),alias:"Indent Line",precondition:g.EditorContextKeys.writable,kbOpts:{kbExpr:g.EditorContextKeys.editorTextFocus,primary:2137,weight:100}})}run(e,t){const i=t._getViewModel() +;i&&(t.pushUndoStop(),t.executeCommands(this.id,l.TypeOperations.indent(i.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}t.IndentLinesAction=x;class D extends s.EditorAction{constructor(){super({id:"editor.action.outdentLines",label:i.localize(15,null),alias:"Outdent Line",precondition:g.EditorContextKeys.writable,kbOpts:{kbExpr:g.EditorContextKeys.editorTextFocus,primary:2135,weight:100}})}run(e,t){o.CoreEditingCommands.Outdent.runEditorCommand(e,t,null)}}class k extends s.EditorAction{constructor(){super({id:"editor.action.insertLineBefore",label:i.localize(16,null),alias:"Insert Line Above",precondition:g.EditorContextKeys.writable,kbOpts:{kbExpr:g.EditorContextKeys.editorTextFocus,primary:3075,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,l.TypeOperations.lineInsertBefore(i.cursorConfig,t.getModel(),t.getSelections())))}}t.InsertLineBeforeAction=k;class N extends s.EditorAction{constructor(){super({id:"editor.action.insertLineAfter", +label:i.localize(17,null),alias:"Insert Line Below",precondition:g.EditorContextKeys.writable,kbOpts:{kbExpr:g.EditorContextKeys.editorTextFocus,primary:2051,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,l.TypeOperations.lineInsertAfter(i.cursorConfig,t.getModel(),t.getSelections())))}}t.InsertLineAfterAction=N;class I extends s.EditorAction{run(e,t){if(!t.hasModel())return;const i=t.getSelection();let n=this._getRangesToDelete(t),o=[];for(let e=0,t=n.length-1;ed.EditOperation.replace(e,""));t.pushUndoStop(),t.executeEdits(this.id,r,s),t.pushUndoStop()}}t.AbstractDeleteAllToBoundaryAction=I;class M extends I{constructor(){super({id:"deleteAllLeft",label:i.localize(18,null),alias:"Delete All Left",precondition:g.EditorContextKeys.writable,kbOpts:{kbExpr:g.EditorContextKeys.textInputFocus, +primary:0,mac:{primary:2049},weight:100}})}_getEndCursorState(e,t){let i=null,n=[],o=0;return t.forEach(t=>{let s;if(1===t.endColumn&&o>0){let e=t.startLineNumber-o;s=new u.Selection(e,t.startColumn,e,t.startColumn)}else s=new u.Selection(t.startLineNumber,t.startColumn,t.startLineNumber,t.startColumn);o+=t.endLineNumber-t.startLineNumber,t.intersectRanges(e)?i=s:n.push(s)}),i&&n.unshift(i),n}_getRangesToDelete(e){let t=e.getSelections();if(null===t)return[];let i=t,n=e.getModel();return null===n?[]:(i.sort(h.Range.compareRangesUsingStarts),i=i.map(e=>{if(e.isEmpty()){if(1===e.startColumn){let t=Math.max(1,e.startLineNumber-1),i=1===e.startLineNumber?1:n.getLineContent(t).length+1;return new h.Range(t,i,e.startLineNumber,1)}return new h.Range(e.startLineNumber,1,e.startLineNumber,e.startColumn)}return new h.Range(e.startLineNumber,1,e.endLineNumber,e.endColumn)}))}}t.DeleteAllLeftAction=M;class R extends I{constructor(){super({id:"deleteAllRight",label:i.localize(19,null),alias:"Delete All Right", +precondition:g.EditorContextKeys.writable,kbOpts:{kbExpr:g.EditorContextKeys.textInputFocus,primary:0,mac:{primary:297,secondary:[2068]},weight:100}})}_getEndCursorState(e,t){let i=null,n=[];for(let o=0,s=t.length,r=0;o{if(e.isEmpty()){const i=t.getLineMaxColumn(e.startLineNumber);return e.startColumn===i?new h.Range(e.startLineNumber,e.startColumn,e.startLineNumber+1,1):new h.Range(e.startLineNumber,e.startColumn,e.startLineNumber,i)}return e});return n.sort(h.Range.compareRangesUsingStarts),n}}t.DeleteAllRightAction=R;class T extends s.EditorAction{constructor(){super({id:"editor.action.joinLines",label:i.localize(20,null),alias:"Join Lines",precondition:g.EditorContextKeys.writable,kbOpts:{ +kbExpr:g.EditorContextKeys.editorTextFocus,primary:0,mac:{primary:296},weight:100}})}run(e,t){let i=t.getSelections();if(null===i)return;let n=t.getSelection();if(null===n)return;i.sort(h.Range.compareRangesUsingStarts);let o=[],s=i.reduce((e,t)=>e.isEmpty()?e.endLineNumber===t.startLineNumber?(n.equalsSelection(e)&&(n=t),t):t.startLineNumber>e.endLineNumber+1?(o.push(e),t):new u.Selection(e.startLineNumber,e.startColumn,t.endLineNumber,t.endColumn):t.startLineNumber>e.endLineNumber?(o.push(e),t):new u.Selection(e.startLineNumber,e.startColumn,t.endLineNumber,t.endColumn));o.push(s);let r=t.getModel();if(null===r)return;let a=[],l=[],c=n,g=0;for(let e=0,t=o.length;e=1){let e=!0;""===v&&(e=!1),!e||" "!==v.charAt(v.length-1)&&"\t"!==v.charAt(v.length-1)||(e=!1,v=v.replace(/[\s\uFEFF\xA0]+$/g," "));let n=t.substr(i-1);v+=(e?" ":"")+n,f=e?n.length+1:n.length}else f=0}let C=new h.Range(p,m,t,i);if(!C.isEmpty()){let e;s.isEmpty()?(a.push(d.EditOperation.replace(C,v)),e=new u.Selection(C.startLineNumber-g,v.length-f+1,p-g,v.length-f+1)):s.startLineNumber===s.endLineNumber?(a.push(d.EditOperation.replace(C,v)),e=new u.Selection(s.startLineNumber-g,s.startColumn,s.endLineNumber-g,s.endColumn)):(a.push(d.EditOperation.replace(C,v)),e=new u.Selection(s.startLineNumber-g,s.startColumn,s.startLineNumber-g,v.length-_)),null!==h.Range.intersectRanges(C,n)?c=e:l.push(e)}g+=C.endLineNumber-C.startLineNumber}l.unshift(c),t.pushUndoStop(),t.executeEdits(this.id,a,l),t.pushUndoStop()}}t.JoinLinesAction=T;class O extends s.EditorAction{constructor(){super({ +id:"editor.action.transpose",label:i.localize(21,null),alias:"Transpose characters around the cursor",precondition:g.EditorContextKeys.writable})}run(e,t){let i=t.getSelections();if(null===i)return;let n=t.getModel();if(null===n)return;let o=[];for(let e=0,t=i.length;e=a){if(s.lineNumber===n.getLineCount())continue;let e=new h.Range(s.lineNumber,Math.max(1,s.column-1),s.lineNumber+1,1),t=n.getValueInRange(e).split("").reverse().join("");o.push(new r.ReplaceCommand(new u.Selection(s.lineNumber,Math.max(1,s.column-1),s.lineNumber+1,1),t))}else{let e=new h.Range(s.lineNumber,Math.max(1,s.column-1),s.lineNumber,s.column+1),t=n.getValueInRange(e).split("").reverse().join("");o.push(new r.ReplaceCommandThatPreservesSelection(e,t,new u.Selection(s.lineNumber,s.column+1,s.lineNumber,s.column+1)))}}t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}t.TransposeAction=O +;class A extends s.EditorAction{run(e,t){let i=t.getSelections();if(null===i)return;let n=t.getModel();if(null===n)return;let o=t.getOption(105),s=[];for(let e=0,a=i.length;e=0?(o=!0,n+=s):o?(o=!1,n+=s.toLocaleUpperCase()):n+=s.toLocaleLowerCase()}return n}}t.TitleCaseAction=W,s.registerEditorAction(class extends v{constructor(){super(!1,{id:"editor.action.copyLinesUpAction",label:i.localize(0,null),alias:"Copy Line Up",precondition:g.EditorContextKeys.writable,kbOpts:{kbExpr:g.EditorContextKeys.editorTextFocus,primary:1552,linux:{primary:3600},weight:100},menuOpts:{menuId:_.MenuId.MenubarSelectionMenu,group:"2_line",title:i.localize(1,null),order:1}})}}), +s.registerEditorAction(class extends v{constructor(){super(!0,{id:"editor.action.copyLinesDownAction",label:i.localize(2,null),alias:"Copy Line Down",precondition:g.EditorContextKeys.writable,kbOpts:{kbExpr:g.EditorContextKeys.editorTextFocus,primary:1554,linux:{primary:3602},weight:100},menuOpts:{menuId:_.MenuId.MenubarSelectionMenu,group:"2_line",title:i.localize(3,null),order:2}})}}),s.registerEditorAction(C),s.registerEditorAction(class extends b{constructor(){super(!1,{id:"editor.action.moveLinesUpAction",label:i.localize(6,null),alias:"Move Line Up",precondition:g.EditorContextKeys.writable,kbOpts:{kbExpr:g.EditorContextKeys.editorTextFocus,primary:528,linux:{primary:528},weight:100},menuOpts:{menuId:_.MenuId.MenubarSelectionMenu,group:"2_line",title:i.localize(7,null),order:3}})}}),s.registerEditorAction(class extends b{constructor(){super(!0,{id:"editor.action.moveLinesDownAction",label:i.localize(8,null),alias:"Move Line Down",precondition:g.EditorContextKeys.writable,kbOpts:{ +kbExpr:g.EditorContextKeys.editorTextFocus,primary:530,linux:{primary:530},weight:100},menuOpts:{menuId:_.MenuId.MenubarSelectionMenu,group:"2_line",title:i.localize(9,null),order:4}})}}),s.registerEditorAction(w),s.registerEditorAction(y),s.registerEditorAction(E),s.registerEditorAction(L),s.registerEditorAction(x),s.registerEditorAction(D),s.registerEditorAction(k),s.registerEditorAction(N),s.registerEditorAction(M),s.registerEditorAction(R),s.registerEditorAction(T),s.registerEditorAction(O),s.registerEditorAction(P),s.registerEditorAction(F),s.registerEditorAction(W)})),define(t[176],i([0,1,15,12,11,18,17,25]),(function(e,t,i,n,o,s,a,l){"use strict";function d(e,t,o,r){const a=s.SignatureHelpProviderRegistry.ordered(e);return i.first(a.map(i=>()=>Promise.resolve(i.provideSignatureHelp(e,t,r,o)).catch(e=>n.onUnexpectedExternalError(e))))}Object.defineProperty(t,"__esModule",{value:!0}),t.provideSignatureHelp=t.Context=void 0,t.Context={Visible:new a.RawContextKey("parameterHintsVisible",!1), +MultipleSignatures:new a.RawContextKey("parameterHintsMultipleSignatures",!1)},t.provideSignatureHelp=d,o.registerDefaultLanguageCommand("_executeSignatureHelpProvider",(e,t,i)=>r(void 0,void 0,void 0,(function*(){const n=yield d(e,t,{triggerKind:s.SignatureHelpTriggerKind.Invoke,isRetrigger:!1,triggerCharacter:i.triggerCharacter},l.CancellationToken.None);if(n)return setTimeout(()=>n.dispose(),0),n.value})))})),define(t[575],i([0,1,15,12,4,2,87,18,176]),(function(e,t,i,n,o,s,a,l,d){"use strict";var c;Object.defineProperty(t,"__esModule",{value:!0}),t.ParameterHintsModel=void 0,function(e){e.Default={type:0};e.Pending=class{constructor(e){this.request=e,this.type=2}};e.Active=class{constructor(e){this.hints=e,this.type=1}}}(c||(c={}));class h extends s.Disposable{constructor(e,t=h.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new o.Emitter),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=c.Default,this._pendingTriggers=[], +this._lastSignatureHelpResult=this._register(new s.MutableDisposable),this.triggerChars=new a.CharacterSet,this.retriggerChars=new a.CharacterSet,this.triggerId=0,this.editor=e,this.throttledDelayer=new i.Delayer(t),this._register(this.editor.onDidChangeConfiguration(()=>this.onEditorConfigurationChange())),this._register(this.editor.onDidChangeModel(e=>this.onModelChanged())),this._register(this.editor.onDidChangeModelLanguage(e=>this.onModelChanged())),this._register(this.editor.onDidChangeCursorSelection(e=>this.onCursorChange(e))),this._register(this.editor.onDidChangeModelContent(e=>this.onModelContentChange())),this._register(l.SignatureHelpProviderRegistry.onDidChange(this.onModelChanged,this)),this._register(this.editor.onDidType(e=>this.onDidType(e))),this.onEditorConfigurationChange(),this.onModelChanged()}get state(){return this._state}set state(e){2===this._state.type&&this._state.request.cancel(),this._state=e}cancel(e=!1){this.state=c.Default,this.throttledDelayer.cancel(), +e||this._onChangedHints.fire(void 0)}trigger(e,t){const i=this.editor.getModel();if(!i||!l.SignatureHelpProviderRegistry.has(i))return;const o=++this.triggerId;this._pendingTriggers.push(e),this.throttledDelayer.trigger(()=>this.doTrigger(o),t).catch(n.onUnexpectedError)}next(){if(1!==this.state.type)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t%e==e-1,n=this.editor.getOption(67).cycle;!(e<2||i)||n?this.updateActiveSignature(i&&n?0:t+1):this.cancel()}previous(){if(1!==this.state.type)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=0===t,n=this.editor.getOption(67).cycle;!(e<2||i)||n?this.updateActiveSignature(i&&n?e-1:t-1):this.cancel()}updateActiveSignature(e){1===this.state.type&&(this.state=new c.Active(Object.assign(Object.assign({},this.state.hints),{activeSignature:e})),this._onChangedHints.fire(this.state.hints))}doTrigger(e){return r(this,void 0,void 0,(function*(){ +const t=1===this.state.type||2===this.state.type,o=1===this.state.type?this.state.hints:void 0;if(this.cancel(!0),0===this._pendingTriggers.length)return!1;const s=this._pendingTriggers.reduce(u);this._pendingTriggers=[];const r={triggerKind:s.triggerKind,triggerCharacter:s.triggerCharacter,isRetrigger:t,activeSignatureHelp:o};if(!this.editor.hasModel())return!1;const a=this.editor.getModel(),l=this.editor.getPosition();this.state=new c.Pending(i.createCancelablePromise(e=>d.provideSignatureHelp(a,l,r,e)));try{const t=yield this.state.request;return e!==this.triggerId?(null==t||t.dispose(),!1):t&&t.value.signatures&&0!==t.value.signatures.length?(this.state=new c.Active(t.value),this._lastSignatureHelpResult.value=t,this._onChangedHints.fire(this.state.hints),!0):(null==t||t.dispose(),this._lastSignatureHelpResult.clear(),this.cancel(),!1)}catch(t){return e===this.triggerId&&(this.state=c.Default),n.onUnexpectedError(t),!1}}))}get isTriggered(){ +return 1===this.state.type||2===this.state.type||this.throttledDelayer.isTriggered()}onModelChanged(){this.cancel(),this.triggerChars=new a.CharacterSet,this.retriggerChars=new a.CharacterSet;const e=this.editor.getModel();if(e)for(const t of l.SignatureHelpProviderRegistry.ordered(e)){for(const e of t.signatureHelpTriggerCharacters||[])this.triggerChars.add(e.charCodeAt(0)),this.retriggerChars.add(e.charCodeAt(0));for(const e of t.signatureHelpRetriggerCharacters||[])this.retriggerChars.add(e.charCodeAt(0))}}onDidType(e){if(!this.triggerOnType)return;const t=e.length-1,i=e.charCodeAt(t);(this.triggerChars.has(i)||this.isTriggered&&this.retriggerChars.has(i))&&this.trigger({triggerKind:l.SignatureHelpTriggerKind.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){"mouse"===e.source?this.cancel():this.isTriggered&&this.trigger({triggerKind:l.SignatureHelpTriggerKind.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:l.SignatureHelpTriggerKind.ContentChange})} +onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(67).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}}function u(e,t){switch(t.triggerKind){case l.SignatureHelpTriggerKind.Invoke:return t;case l.SignatureHelpTriggerKind.ContentChange:return e;case l.SignatureHelpTriggerKind.TriggerCharacter:default:return t}}t.ParameterHintsModel=h,h.DEFAULT_DELAY=120})),define(t[576],i([0,1,19,25,11,13,3,20,22,18,488,33,2,401,223,28,12]),(function(e,t,i,n,o,s,a,l,d,c,h,u,g,p,m,f,_){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.provideSelectionRanges=void 0;class v{constructor(e,t){this.index=e,this.ranges=t}mov(e){let t=this.index+(e?1:-1);if(t<0||t>=this.ranges.length)return this;const i=new v(t,this.ranges);return i.ranges[t].equalsRange(this.ranges[this.index])?i.mov(e):i}}class C{constructor(e){this._ignoreSelection=!1,this._editor=e}static get(e){return e.getContribution(C.ID)}dispose(){g.dispose(this._selectionListener)}run(e){ +if(!this._editor.hasModel())return;const t=this._editor.getSelections(),o=this._editor.getModel();if(!c.SelectionRangeRegistry.has(o))return;let s=Promise.resolve(void 0);return this._state||(s=S(o,t.map(e=>e.getPosition()),n.CancellationToken.None).then(e=>{if(i.isNonEmptyArray(e)&&e.length===t.length&&this._editor.hasModel()&&i.equals(this._editor.getSelections(),t,(e,t)=>e.equalsSelection(t))){for(let i=0;ie.containsPosition(t[i].getStartPosition())&&e.containsPosition(t[i].getEndPosition())),e[i].unshift(t[i]);this._state=e.map(e=>new v(0,e)),g.dispose(this._selectionListener),this._selectionListener=this._editor.onDidChangeCursorPosition(()=>{this._ignoreSelection||(g.dispose(this._selectionListener),this._state=void 0)})}})),s.then(()=>{if(!this._state)return;this._state=this._state.map(t=>t.mov(e));const t=this._state.map(e=>l.Selection.fromPositions(e.ranges[e.index].getStartPosition(),e.ranges[e.index].getEndPosition()));this._ignoreSelection=!0;try{ +this._editor.setSelections(t)}finally{this._ignoreSelection=!1}})}}C.ID="editor.contrib.smartSelectController";class b extends o.EditorAction{constructor(e,t){super(t),this._forward=e}run(e,t){return r(this,void 0,void 0,(function*(){let e=C.get(t);e&&(yield e.run(this._forward))}))}}f.CommandsRegistry.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");function S(e,t,n){const o=c.SelectionRangeRegistry.all(e);1===o.length&&o.unshift(new m.BracketSelectionRangeProvider);let r=[],l=[];for(const s of o)r.push(Promise.resolve(s.provideSelectionRanges(e,t,n)).then(e=>{if(i.isNonEmptyArray(e)&&e.length===t.length)for(let i=0;il.map(t=>{if(0===t.length)return[] +;t.sort((e,t)=>s.Position.isBefore(e.getStartPosition(),t.getStartPosition())?1:s.Position.isBefore(t.getStartPosition(),e.getStartPosition())?-1:s.Position.isBefore(e.getEndPosition(),t.getEndPosition())?-1:s.Position.isBefore(t.getEndPosition(),e.getEndPosition())?1:0);let i,n=[];for(const e of t)(!i||a.Range.containsRange(e,i)&&!a.Range.equalsRange(e,i))&&(n.push(e),i=e);let o=[n[0]];for(let t=1;t{this._resolveCache=void 0,this._isResolved=!1});this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then(e=>{Object.assign(this.completion,e),this._isResolved=!0,t.dispose()},e=>{i.isPromiseCanceledError(e)&&(this._resolveCache=void 0,this._isResolved=!1)})}return this._resolveCache}))}}t.CompletionItem=p;class m{constructor(e=2,t=new Set,i=new Set){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=i}}let f;t.CompletionOptions=m, +m.default=new m,t.getSnippetSuggestSupport=function(){return f};class _{constructor(e,t,i){this.items=e,this.needsClipboard=t,this.dispoables=i}}function v(e,t,n=m.default,s={triggerKind:0},a=l.CancellationToken.None){return r(this,void 0,void 0,(function*(){t=t.clone();const l=e.getWordAtPosition(t),c=l?new d.Range(t.lineNumber,l.startColumn,t.lineNumber,l.endColumn):d.Range.fromPositions(t),u={replace:c,insert:c.setEndPosition(t.lineNumber,t.column)},m=[],v=new h.DisposableStore;let C=!1;const b=(e,i)=>{if(i){for(let o of i.suggestions)n.kindFilter.has(o.kind)||(o.range||(o.range=u),o.sortText||(o.sortText="string"==typeof o.label?o.label:o.label.name),!C&&o.insertTextRules&&4&o.insertTextRules&&(C=g.SnippetParser.guessNeedsClipboard(o.insertText)),m.push(new p(t,o,i,e)));h.isDisposable(i)&&v.add(i)}},w=(()=>r(this,void 0,void 0,(function*(){if(!f||n.kindFilter.has(27))return;if(n.providerFilter.size>0&&!n.providerFilter.has(f))return;const i=yield f.provideCompletionItems(e,t,s,a);b(f,i)})))() +;for(let l of o.CompletionProviderRegistry.orderedGroups(e)){let o=m.length;if(yield Promise.all(l.map(o=>r(this,void 0,void 0,(function*(){if(!(n.providerFilter.size>0)||n.providerFilter.has(o))try{const i=yield o.provideCompletionItems(e,t,s,a);b(o,i)}catch(e){i.onUnexpectedExternalError(e)}})))),o!==m.length||a.isCancellationRequested)break}return yield w,a.isCancellationRequested?(v.dispose(),Promise.reject(i.canceled())):new _(m.sort(S(n.snippetSortOrder)),C,v)}))}function C(e,t){if(e.sortTextLow&&t.sortTextLow){if(e.sortTextLowt.sortTextLow)return 1}return e.completion.labelt.completion.label?1:e.completion.kind-t.completion.kind}t.provideSuggestionItems=v;const b=new Map;function S(e){return b.get(e)}b.set(0,(function(e,t){if(e.completion.kind!==t.completion.kind){if(27===e.completion.kind)return-1;if(27===t.completion.kind)return 1}return C(e,t)})),b.set(2,(function(e,t){if(e.completion.kind!==t.completion.kind){ +if(27===e.completion.kind)return 1;if(27===t.completion.kind)return-1}return C(e,t)})),b.set(1,C),t.getSuggestionComparator=S,n.registerDefaultLanguageCommand("_executeCompletionItemProvider",(e,t,i)=>r(void 0,void 0,void 0,(function*(){const n={incomplete:!1,suggestions:[]},o=[],s=i.maxItemsToResolve||0,r=yield v(e,t);for(const e of r.items)o.lengthr.dispoables.dispose(),100)}})));const w=new class{constructor(){this.onlyOnceSuggestions=[]}provideCompletionItems(){let e={suggestions:this.onlyOnceSuggestions.slice(0)};return this.onlyOnceSuggestions.length=0,e}};o.CompletionProviderRegistry.register("*",w),t.showSimpleSuggestions=function(e,t){setTimeout(()=>{w.onlyOnceSuggestions.push(...t),e.getContribution("editor.contrib.suggestController").triggerSuggest((new Set).add(w))},0)}})), +define(t[247],i([0,1,492,48,11,174]),(function(e,t,i,n,o,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ToggleTabFocusModeAction=void 0;class r extends o.EditorAction{constructor(){super({id:r.ID,label:i.localize(0,null),alias:"Toggle Tab Key Moves Focus",precondition:void 0,kbOpts:{kbExpr:null,primary:2091,mac:{primary:1323},weight:100}})}run(e,t){const o=!s.TabFocus.getTabFocusMode();s.TabFocus.setTabFocusMode(o),o?n.alert(i.localize(1,null)):n.alert(i.localize(2,null))}}t.ToggleTabFocusModeAction=r,r.ID="editor.action.toggleTabFocusMode",o.registerEditorAction(r)})),define(t[577],i([0,1,493,11,111]),(function(e,t,i,n,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class s extends n.EditorAction{constructor(){super({id:"editor.action.forceRetokenize",label:i.localize(0,null),alias:"Developer: Force Retokenize",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getModel();i.resetTokenization();const n=new o.StopWatch(!0) +;i.forceTokenization(i.getLineCount()),n.stop(),console.log(`tokenization took ${n.elapsed()}`)}}n.registerEditorAction(s)})),define(t[578],i([0,1,494,2,11,27,173]),(function(e,t,i,n,o,s,d){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const c="ignoreUnusualLineTerminators";let h=class extends n.Disposable{constructor(e,t,i){super(),this._editor=e,this._dialogService=t,this._codeEditorService=i,this._config=this._editor.getOption(103),this._register(this._editor.onDidChangeConfiguration(e=>{e.hasChanged(103)&&(this._config=this._editor.getOption(103),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(e=>{e.isUndoing||this._checkForUnusualLineTerminators()}))}_checkForUnusualLineTerminators(){return r(this,void 0,void 0,(function*(){if("off"===this._config)return;if(!this._editor.hasModel())return;const e=this._editor.getModel() +;e.mightContainUnusualLineTerminators()&&!0!==function(e,t){return e.getModelProperty(t.uri,c)}(this._codeEditorService,e)&&(this._editor.getOption(72)||("auto"!==this._config?(yield this._dialogService.confirm({title:i.localize(0,null),message:i.localize(1,null),detail:i.localize(2,null),primaryButton:i.localize(3,null),secondaryButton:i.localize(4,null)})).confirmed?e.removeUnusualLineTerminators(this._editor.getSelections()):function(e,t,i){e.setModelProperty(t.uri,c,i)}(this._codeEditorService,e,!0):e.removeUnusualLineTerminators(this._editor.getSelections())))}))}};h.ID="editor.contrib.unusualLineTerminatorsDetector",h=a([l(1,d.IDialogService),l(2,s.ICodeEditorService)],h),o.registerEditorContribution(h.ID,h)})),define(t[248],i([0,1,11,88,45,129,99,13,3,20,22,62,17,38]),(function(e,t,i,n,o,s,r,a,l,d,c,h,u,g){"use strict";Object.defineProperty(t,"__esModule",{value:!0}), +t.DeleteWordRight=t.DeleteWordEndRight=t.DeleteWordStartRight=t.DeleteWordLeft=t.DeleteWordEndLeft=t.DeleteWordStartLeft=t.DeleteWordRightCommand=t.DeleteWordLeftCommand=t.DeleteWordCommand=t.CursorWordAccessibilityRightSelect=t.CursorWordAccessibilityRight=t.CursorWordRightSelect=t.CursorWordEndRightSelect=t.CursorWordStartRightSelect=t.CursorWordRight=t.CursorWordEndRight=t.CursorWordStartRight=t.CursorWordAccessibilityLeftSelect=t.CursorWordAccessibilityLeft=t.CursorWordLeftSelect=t.CursorWordEndLeftSelect=t.CursorWordStartLeftSelect=t.CursorWordLeft=t.CursorWordEndLeft=t.CursorWordStartLeft=t.WordRightCommand=t.WordLeftCommand=t.MoveWordCommand=void 0;class p extends i.EditorCommand{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const n=r.getMapForWordSeparators(t.getOption(105)),s=t.getModel(),l=t.getSelections().map(e=>{ +const t=new a.Position(e.positionLineNumber,e.positionColumn),i=this._move(n,s,t,this._wordNavigationType);return this._moveTo(e,i,this._inSelectionMode)});if(s.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",0,l.map(e=>o.CursorState.fromModelSelection(e))),1===l.length){const e=new a.Position(l[0].positionLineNumber,l[0].positionColumn);t.revealPosition(e,0)}}_moveTo(e,t,i){return i?new d.Selection(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new d.Selection(t.lineNumber,t.column,t.lineNumber,t.column)}}t.MoveWordCommand=p;class m extends p{_move(e,t,i,n){return s.WordOperations.moveWordLeft(e,t,i,n)}}t.WordLeftCommand=m;class f extends p{_move(e,t,i,n){return s.WordOperations.moveWordRight(e,t,i,n)}}t.WordRightCommand=f;class _ extends m{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}t.CursorWordStartLeft=_;class v extends m{constructor(){super({inSelectionMode:!1,wordNavigationType:2, +id:"cursorWordEndLeft",precondition:void 0})}}t.CursorWordEndLeft=v;class C extends m{constructor(){super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:c.EditorContextKeys.textInputFocus,primary:2063,mac:{primary:527},weight:100}})}}t.CursorWordLeft=C;class b extends m{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}t.CursorWordStartLeftSelect=b;class S extends m{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}t.CursorWordEndLeftSelect=S;class w extends m{constructor(){super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:c.EditorContextKeys.textInputFocus,primary:3087,mac:{primary:1551},weight:100}})}}t.CursorWordLeftSelect=w;class y extends m{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0,kbOpts:{ +kbExpr:u.ContextKeyExpr.and(c.EditorContextKeys.textInputFocus,h.CONTEXT_ACCESSIBILITY_MODE_ENABLED),win:{primary:2063},weight:101}})}_move(e,t,i,n){return super._move(r.getMapForWordSeparators(g.EditorOptions.wordSeparators.defaultValue),t,i,n)}}t.CursorWordAccessibilityLeft=y;class E extends m{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0,kbOpts:{kbExpr:u.ContextKeyExpr.and(c.EditorContextKeys.textInputFocus,h.CONTEXT_ACCESSIBILITY_MODE_ENABLED),win:{primary:3087},weight:101}})}_move(e,t,i,n){return super._move(r.getMapForWordSeparators(g.EditorOptions.wordSeparators.defaultValue),t,i,n)}}t.CursorWordAccessibilityLeftSelect=E;class L extends f{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}t.CursorWordStartRight=L;class x extends f{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{ +kbExpr:c.EditorContextKeys.textInputFocus,primary:2065,mac:{primary:529},weight:100}})}}t.CursorWordEndRight=x;class D extends f{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}t.CursorWordRight=D;class k extends f{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}t.CursorWordStartRightSelect=k;class N extends f{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:c.EditorContextKeys.textInputFocus,primary:3089,mac:{primary:1553},weight:100}})}}t.CursorWordEndRightSelect=N;class I extends f{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}t.CursorWordRightSelect=I;class M extends f{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0,kbOpts:{ +kbExpr:u.ContextKeyExpr.and(c.EditorContextKeys.textInputFocus,h.CONTEXT_ACCESSIBILITY_MODE_ENABLED),win:{primary:2065},weight:101}})}_move(e,t,i,n){return super._move(r.getMapForWordSeparators(g.EditorOptions.wordSeparators.defaultValue),t,i,n)}}t.CursorWordAccessibilityRight=M;class R extends f{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0,kbOpts:{kbExpr:u.ContextKeyExpr.and(c.EditorContextKeys.textInputFocus,h.CONTEXT_ACCESSIBILITY_MODE_ENABLED),win:{primary:3089},weight:101}})}_move(e,t,i,n){return super._move(r.getMapForWordSeparators(g.EditorOptions.wordSeparators.defaultValue),t,i,n)}}t.CursorWordAccessibilityRightSelect=R;class T extends i.EditorCommand{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const o=r.getMapForWordSeparators(t.getOption(105)),s=t.getModel(),a=t.getSelections().map(e=>{ +const t=this._delete(o,s,e,this._whitespaceHeuristics,this._wordNavigationType);return new n.ReplaceCommand(t,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}t.DeleteWordCommand=T;class O extends T{_delete(e,t,i,n,o){let r=s.WordOperations.deleteWordLeft(e,t,i,n,o);return r||new l.Range(1,1,1,1)}}t.DeleteWordLeftCommand=O;class A extends T{_delete(e,t,i,n,o){let r=s.WordOperations.deleteWordRight(e,t,i,n,o);if(r)return r;const a=t.getLineCount(),d=t.getLineMaxColumn(a);return new l.Range(a,d,a,d)}}t.DeleteWordRightCommand=A;class P extends O{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:c.EditorContextKeys.writable})}}t.DeleteWordStartLeft=P;class F extends O{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:c.EditorContextKeys.writable})}}t.DeleteWordEndLeft=F;class W extends O{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft", +precondition:c.EditorContextKeys.writable,kbOpts:{kbExpr:c.EditorContextKeys.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}t.DeleteWordLeft=W;class B extends A{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:c.EditorContextKeys.writable})}}t.DeleteWordStartRight=B;class V extends A{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:c.EditorContextKeys.writable})}}t.DeleteWordEndRight=V;class z extends A{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:c.EditorContextKeys.writable,kbOpts:{kbExpr:c.EditorContextKeys.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}t.DeleteWordRight=z,i.registerEditorCommand(new _),i.registerEditorCommand(new v),i.registerEditorCommand(new C),i.registerEditorCommand(new b),i.registerEditorCommand(new S),i.registerEditorCommand(new w),i.registerEditorCommand(new L),i.registerEditorCommand(new x), +i.registerEditorCommand(new D),i.registerEditorCommand(new k),i.registerEditorCommand(new N),i.registerEditorCommand(new I),i.registerEditorCommand(new y),i.registerEditorCommand(new E),i.registerEditorCommand(new M),i.registerEditorCommand(new R),i.registerEditorCommand(new P),i.registerEditorCommand(new F),i.registerEditorCommand(new W),i.registerEditorCommand(new B),i.registerEditorCommand(new V),i.registerEditorCommand(new z)})),define(t[579],i([0,1,11,129,3,22,248,28]),(function(e,t,i,n,o,s,r,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CursorWordPartRightSelect=t.CursorWordPartRight=t.WordPartRightCommand=t.CursorWordPartLeftSelect=t.CursorWordPartLeft=t.WordPartLeftCommand=t.DeleteWordPartRight=t.DeleteWordPartLeft=void 0;class l extends r.DeleteWordCommand{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:s.EditorContextKeys.writable,kbOpts:{kbExpr:s.EditorContextKeys.textInputFocus,primary:0,mac:{primary:769},weight:100}})} +_delete(e,t,i,s,r){let a=n.WordPartOperations.deleteWordPartLeft(e,t,i,s);return a||new o.Range(1,1,1,1)}}t.DeleteWordPartLeft=l;class d extends r.DeleteWordCommand{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:s.EditorContextKeys.writable,kbOpts:{kbExpr:s.EditorContextKeys.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t,i,s,r){let a=n.WordPartOperations.deleteWordPartRight(e,t,i,s);if(a)return a;const l=t.getLineCount(),d=t.getLineMaxColumn(l);return new o.Range(l,d,l,d)}}t.DeleteWordPartRight=d;class c extends r.MoveWordCommand{_move(e,t,i,o){return n.WordPartOperations.moveWordPartLeft(e,t,i)}}t.WordPartLeftCommand=c;class h extends c{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:s.EditorContextKeys.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}t.CursorWordPartLeft=h, +a.CommandsRegistry.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class u extends c{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:s.EditorContextKeys.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}t.CursorWordPartLeftSelect=u,a.CommandsRegistry.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class g extends r.MoveWordCommand{_move(e,t,i,o){return n.WordPartOperations.moveWordPartRight(e,t,i)}}t.WordPartRightCommand=g;class p extends g{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:s.EditorContextKeys.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}t.CursorWordPartRight=p;class m extends g{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:s.EditorContextKeys.textInputFocus,primary:0,mac:{primary:1809}, +weight:100}})}}t.CursorWordPartRightSelect=m,i.registerEditorCommand(new l),i.registerEditorCommand(new d),i.registerEditorCommand(new h),i.registerEditorCommand(new u),i.registerEditorCommand(new p),i.registerEditorCommand(new m)})),define(t[580],i([0,1,36,7,2,11,348]),(function(e,t,i,n,o,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IPadShowKeyboard=void 0;class r extends o.Disposable{constructor(e){super(),this.editor=e,this.widget=null,i.isIPad&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(72);!this.widget&&e?this.widget=new a(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}}t.IPadShowKeyboard=r,r.ID="editor.contrib.iPadShowKeyboard";class a extends o.Disposable{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard", +this._register(n.addDisposableListener(this._domNode,"touchstart",e=>{this.editor.focus()})),this._register(n.addDisposableListener(this._domNode,"focus",e=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return a.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}}a.ID="editor.contrib.ShowKeyboardWidget",s.registerEditorContribution(r.ID,r)})),define(t[581],i([0,1,11,106,61]),(function(e,t,i,n,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class s extends i.EditorAction{constructor(){super({id:"editor.action.toggleHighContrast",label:o.ToggleHighContrastNLS.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const i=e.get(n.IStandaloneThemeService);this._originalThemeName?(i.setTheme(this._originalThemeName),this._originalThemeName=null):(this._originalThemeName=i.getColorTheme().themeName,i.setTheme("hc-black"))}} +i.registerEditorAction(s)})),define(t[21],i([0,1,34,29,4,503,242,15]),(function(e,t,i,n,o,s,r,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}), +t.workbenchColorsSchemaId=t.resolveColorValue=t.oneOf=t.transparent=t.lighten=t.darken=t.problemsInfoIconForeground=t.problemsWarningIconForeground=t.problemsErrorIconForeground=t.minimapSliderActiveBackground=t.minimapSliderHoverBackground=t.minimapSliderBackground=t.minimapBackground=t.minimapWarning=t.minimapError=t.minimapSelection=t.minimapFindMatch=t.overviewRulerSelectionHighlightForeground=t.overviewRulerFindMatchForeground=t.snippetFinalTabstopHighlightBorder=t.snippetFinalTabstopHighlightBackground=t.snippetTabstopHighlightBorder=t.snippetTabstopHighlightBackground=t.menuSeparatorBackground=t.menuSelectionBorder=t.menuSelectionBackground=t.menuSelectionForeground=t.menuBackground=t.menuForeground=t.menuBorder=t.treeIndentGuidesStroke=t.listFilterWidgetNoMatchesOutline=t.listFilterWidgetOutline=t.listFilterWidgetBackground=t.listHighlightForeground=t.listDropBackground=t.listHoverForeground=t.listHoverBackground=t.listInactiveFocusBackground=t.listInactiveSelectionForeground=t.listInactiveSelectionBackground=t.listActiveSelectionForeground=t.listActiveSelectionBackground=t.listFocusForeground=t.listFocusBackground=t.diffDiagonalFill=t.diffBorder=t.diffRemovedOutline=t.diffInsertedOutline=t.diffRemoved=t.diffInserted=t.defaultRemoveColor=t.defaultInsertColor=t.editorLightBulbAutoFixForeground=t.editorLightBulbForeground=t.editorActiveLinkForeground=t.editorHoverStatusBarBackground=t.editorHoverBorder=t.editorHoverForeground=t.editorHoverBackground=t.editorHoverHighlight=t.editorFindRangeHighlightBorder=t.editorFindMatchHighlightBorder=t.editorFindMatchBorder=t.editorFindRangeHighlight=t.editorFindMatchHighlight=t.editorFindMatch=t.editorSelectionHighlightBorder=t.editorSelectionHighlight=t.editorInactiveSelection=t.editorSelectionForeground=t.editorSelectionBackground=t.pickerGroupBorder=t.pickerGroupForeground=t.quickInputTitleBackground=t.quickInputForeground=t.quickInputBackground=t.editorWidgetResizeBorder=t.editorWidgetBorder=t.editorWidgetForeground=t.editorWidgetBackground=t.editorForeground=t.editorBackground=t.editorHintBorder=t.editorHintForeground=t.editorInfoBorder=t.editorInfoForeground=t.editorWarningBorder=t.editorWarningForeground=t.editorErrorBorder=t.editorErrorForeground=t.progressBarBackground=t.scrollbarSliderActiveBackground=t.scrollbarSliderHoverBackground=t.scrollbarSliderBackground=t.scrollbarShadow=t.badgeForeground=t.badgeBackground=t.buttonHoverBackground=t.buttonBackground=t.buttonForeground=t.selectForeground=t.selectBackground=t.inputValidationErrorBorder=t.inputValidationErrorForeground=t.inputValidationErrorBackground=t.inputValidationWarningBorder=t.inputValidationWarningForeground=t.inputValidationWarningBackground=t.inputValidationInfoBorder=t.inputValidationInfoForeground=t.inputValidationInfoBackground=t.inputActiveOptionForeground=t.inputActiveOptionBackground=t.inputActiveOptionBorder=t.inputBorder=t.inputForeground=t.inputBackground=t.widgetShadow=t.textCodeBlockBackground=t.textLinkForeground=t.activeContrastBorder=t.contrastBorder=t.focusBorder=t.iconForeground=t.errorForeground=t.foreground=t.registerColor=t.Extensions=void 0, +t.Extensions={ColorContribution:"base.contributions.colors"};const l=new class{constructor(){this._onDidChangeSchema=new o.Emitter,this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,t,i,n=!1,o){let s={id:e,description:i,defaults:t,needsTransparency:n,deprecationMessage:o};this.colorsById[e]=s;let r={type:"string",description:i,format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return o&&(r.deprecationMessage=o),this.colorSchema.properties[e]=r,this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(i),this._onDidChangeSchema.fire(),e}resolveDefaultColor(e,t){const i=this.colorsById[e];if(i&&i.defaults){return p(i.defaults[t.type],t)}}getColorSchema(){return this.colorSchema}toString(){return Object.keys(this.colorsById).sort((e,t)=>{let i=-1===e.indexOf(".")?0:1,n=-1===t.indexOf(".")?0:1 +;return i!==n?i-n:e.localeCompare(t)}).map(e=>`- \`${e}\`: ${this.colorsById[e].description}`).join("\n")}};function d(e,t,i,n,o){return l.registerColor(e,t,i,n,o)}function c(e,t){return i=>{let n=p(e,i);if(n)return n.darken(t)}}function h(e,t){return i=>{let n=p(e,i);if(n)return n.lighten(t)}}function u(e,t){return i=>{let n=p(e,i);if(n)return n.transparent(t)}}function g(e,t,i,o){return s=>{let r=p(e,s);if(r){let e=p(t,s);return e?r.isDarkerThan(e)?n.Color.getLighterColor(r,e,i).transparent(o):n.Color.getDarkerColor(r,e,i).transparent(o):r.transparent(i*o)}}}function p(e,t){if(null!==e)return"string"==typeof e?"#"===e[0]?n.Color.fromHex(e):t.getColor(e):e instanceof n.Color?e:"function"==typeof e?e(t):void 0}i.Registry.add(t.Extensions.ColorContribution,l),t.registerColor=d,t.foreground=d("foreground",{dark:"#CCCCCC",light:"#616161",hc:"#FFFFFF"},s.localize(0,null)),t.errorForeground=d("errorForeground",{dark:"#F48771",light:"#A1260D",hc:"#F48771"},s.localize(1,null)),t.iconForeground=d("icon.foreground",{ +dark:"#C5C5C5",light:"#424242",hc:"#FFFFFF"},s.localize(2,null)),t.focusBorder=d("focusBorder",{dark:"#007FD4",light:"#0090F1",hc:"#F38518"},s.localize(3,null)),t.contrastBorder=d("contrastBorder",{light:null,dark:null,hc:"#6FC3DF"},s.localize(4,null)),t.activeContrastBorder=d("contrastActiveBorder",{light:null,dark:null,hc:t.focusBorder},s.localize(5,null)),t.textLinkForeground=d("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hc:"#3794FF"},s.localize(6,null)),t.textCodeBlockBackground=d("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hc:n.Color.black},s.localize(7,null)),t.widgetShadow=d("widget.shadow",{dark:"#000000",light:"#A8A8A8",hc:null},s.localize(8,null)),t.inputBackground=d("input.background",{dark:"#3C3C3C",light:n.Color.white,hc:n.Color.black},s.localize(9,null)),t.inputForeground=d("input.foreground",{dark:t.foreground,light:t.foreground,hc:t.foreground},s.localize(10,null)),t.inputBorder=d("input.border",{dark:null,light:null,hc:t.contrastBorder},s.localize(11,null)), +t.inputActiveOptionBorder=d("inputOption.activeBorder",{dark:"#007ACC00",light:"#007ACC00",hc:t.contrastBorder},s.localize(12,null)),t.inputActiveOptionBackground=d("inputOption.activeBackground",{dark:u(t.focusBorder,.4),light:u(t.focusBorder,.2),hc:n.Color.transparent},s.localize(13,null)),t.inputActiveOptionForeground=d("inputOption.activeForeground",{dark:n.Color.white,light:n.Color.black,hc:null},s.localize(14,null)),t.inputValidationInfoBackground=d("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hc:n.Color.black},s.localize(15,null)),t.inputValidationInfoForeground=d("inputValidation.infoForeground",{dark:null,light:null,hc:null},s.localize(16,null)),t.inputValidationInfoBorder=d("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hc:t.contrastBorder},s.localize(17,null)),t.inputValidationWarningBackground=d("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hc:n.Color.black},s.localize(18,null)), +t.inputValidationWarningForeground=d("inputValidation.warningForeground",{dark:null,light:null,hc:null},s.localize(19,null)),t.inputValidationWarningBorder=d("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hc:t.contrastBorder},s.localize(20,null)),t.inputValidationErrorBackground=d("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hc:n.Color.black},s.localize(21,null)),t.inputValidationErrorForeground=d("inputValidation.errorForeground",{dark:null,light:null,hc:null},s.localize(22,null)),t.inputValidationErrorBorder=d("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hc:t.contrastBorder},s.localize(23,null)),t.selectBackground=d("dropdown.background",{dark:"#3C3C3C",light:n.Color.white,hc:n.Color.black},s.localize(24,null)),t.selectForeground=d("dropdown.foreground",{dark:"#F0F0F0",light:null,hc:n.Color.white},s.localize(25,null)),t.buttonForeground=d("button.foreground",{dark:n.Color.white,light:n.Color.white,hc:n.Color.white},s.localize(26,null)), +t.buttonBackground=d("button.background",{dark:"#0E639C",light:"#007ACC",hc:null},s.localize(27,null)),t.buttonHoverBackground=d("button.hoverBackground",{dark:h(t.buttonBackground,.2),light:c(t.buttonBackground,.2),hc:null},s.localize(28,null)),t.badgeBackground=d("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hc:n.Color.black},s.localize(29,null)),t.badgeForeground=d("badge.foreground",{dark:n.Color.white,light:"#333",hc:n.Color.white},s.localize(30,null)),t.scrollbarShadow=d("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hc:null},s.localize(31,null)),t.scrollbarSliderBackground=d("scrollbarSlider.background",{dark:n.Color.fromHex("#797979").transparent(.4),light:n.Color.fromHex("#646464").transparent(.4),hc:u(t.contrastBorder,.6)},s.localize(32,null)),t.scrollbarSliderHoverBackground=d("scrollbarSlider.hoverBackground",{dark:n.Color.fromHex("#646464").transparent(.7),light:n.Color.fromHex("#646464").transparent(.7),hc:u(t.contrastBorder,.8)},s.localize(33,null)), +t.scrollbarSliderActiveBackground=d("scrollbarSlider.activeBackground",{dark:n.Color.fromHex("#BFBFBF").transparent(.4),light:n.Color.fromHex("#000000").transparent(.6),hc:t.contrastBorder},s.localize(34,null)),t.progressBarBackground=d("progressBar.background",{dark:n.Color.fromHex("#0E70C0"),light:n.Color.fromHex("#0E70C0"),hc:t.contrastBorder},s.localize(35,null)),t.editorErrorForeground=d("editorError.foreground",{dark:"#F48771",light:"#E51400",hc:null},s.localize(36,null)),t.editorErrorBorder=d("editorError.border",{dark:null,light:null,hc:n.Color.fromHex("#E47777").transparent(.8)},s.localize(37,null)),t.editorWarningForeground=d("editorWarning.foreground",{dark:"#CCA700",light:"#E9A700",hc:null},s.localize(38,null)),t.editorWarningBorder=d("editorWarning.border",{dark:null,light:null,hc:n.Color.fromHex("#FFCC00").transparent(.8)},s.localize(39,null)),t.editorInfoForeground=d("editorInfo.foreground",{dark:"#75BEFF",light:"#75BEFF",hc:null},s.localize(40,null)),t.editorInfoBorder=d("editorInfo.border",{ +dark:null,light:null,hc:n.Color.fromHex("#75BEFF").transparent(.8)},s.localize(41,null)),t.editorHintForeground=d("editorHint.foreground",{dark:n.Color.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hc:null},s.localize(42,null)),t.editorHintBorder=d("editorHint.border",{dark:null,light:null,hc:n.Color.fromHex("#eeeeee").transparent(.8)},s.localize(43,null)),t.editorBackground=d("editor.background",{light:"#fffffe",dark:"#1E1E1E",hc:n.Color.black},s.localize(44,null)),t.editorForeground=d("editor.foreground",{light:"#333333",dark:"#BBBBBB",hc:n.Color.white},s.localize(45,null)),t.editorWidgetBackground=d("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hc:"#0C141F"},s.localize(46,null)),t.editorWidgetForeground=d("editorWidget.foreground",{dark:t.foreground,light:t.foreground,hc:t.foreground},s.localize(47,null)),t.editorWidgetBorder=d("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hc:t.contrastBorder},s.localize(48,null)),t.editorWidgetResizeBorder=d("editorWidget.resizeBorder",{ +light:null,dark:null,hc:null},s.localize(49,null)),t.quickInputBackground=d("quickInput.background",{dark:t.editorWidgetBackground,light:t.editorWidgetBackground,hc:t.editorWidgetBackground},s.localize(50,null)),t.quickInputForeground=d("quickInput.foreground",{dark:t.editorWidgetForeground,light:t.editorWidgetForeground,hc:t.editorWidgetForeground},s.localize(51,null)),t.quickInputTitleBackground=d("quickInputTitle.background",{dark:new n.Color(new n.RGBA(255,255,255,.105)),light:new n.Color(new n.RGBA(0,0,0,.06)),hc:"#000000"},s.localize(52,null)),t.pickerGroupForeground=d("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hc:n.Color.white},s.localize(53,null)),t.pickerGroupBorder=d("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hc:n.Color.white},s.localize(54,null)),t.editorSelectionBackground=d("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hc:"#f3f518"},s.localize(55,null)),t.editorSelectionForeground=d("editor.selectionForeground",{light:null,dark:null,hc:"#000000" +},s.localize(56,null)),t.editorInactiveSelection=d("editor.inactiveSelectionBackground",{light:u(t.editorSelectionBackground,.5),dark:u(t.editorSelectionBackground,.5),hc:u(t.editorSelectionBackground,.5)},s.localize(57,null),!0),t.editorSelectionHighlight=d("editor.selectionHighlightBackground",{light:g(t.editorSelectionBackground,t.editorBackground,.3,.6),dark:g(t.editorSelectionBackground,t.editorBackground,.3,.6),hc:null},s.localize(58,null),!0),t.editorSelectionHighlightBorder=d("editor.selectionHighlightBorder",{light:null,dark:null,hc:t.activeContrastBorder},s.localize(59,null)),t.editorFindMatch=d("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hc:null},s.localize(60,null)),t.editorFindMatchHighlight=d("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hc:null},s.localize(61,null),!0),t.editorFindRangeHighlight=d("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hc:null},s.localize(62,null),!0), +t.editorFindMatchBorder=d("editor.findMatchBorder",{light:null,dark:null,hc:t.activeContrastBorder},s.localize(63,null)),t.editorFindMatchHighlightBorder=d("editor.findMatchHighlightBorder",{light:null,dark:null,hc:t.activeContrastBorder},s.localize(64,null)),t.editorFindRangeHighlightBorder=d("editor.findRangeHighlightBorder",{dark:null,light:null,hc:u(t.activeContrastBorder,.4)},s.localize(65,null),!0),t.editorHoverHighlight=d("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hc:"#ADD6FF26"},s.localize(66,null),!0),t.editorHoverBackground=d("editorHoverWidget.background",{light:t.editorWidgetBackground,dark:t.editorWidgetBackground,hc:t.editorWidgetBackground},s.localize(67,null)),t.editorHoverForeground=d("editorHoverWidget.foreground",{light:t.editorWidgetForeground,dark:t.editorWidgetForeground,hc:t.editorWidgetForeground},s.localize(68,null)),t.editorHoverBorder=d("editorHoverWidget.border",{light:t.editorWidgetBorder,dark:t.editorWidgetBorder,hc:t.editorWidgetBorder +},s.localize(69,null)),t.editorHoverStatusBarBackground=d("editorHoverWidget.statusBarBackground",{dark:h(t.editorHoverBackground,.2),light:c(t.editorHoverBackground,.05),hc:t.editorWidgetBackground},s.localize(70,null)),t.editorActiveLinkForeground=d("editorLink.activeForeground",{dark:"#4E94CE",light:n.Color.blue,hc:n.Color.cyan},s.localize(71,null)),t.editorLightBulbForeground=d("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hc:"#FFCC00"},s.localize(72,null)),t.editorLightBulbAutoFixForeground=d("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hc:"#75BEFF"},s.localize(73,null)),t.defaultInsertColor=new n.Color(new n.RGBA(155,185,85,.2)),t.defaultRemoveColor=new n.Color(new n.RGBA(255,0,0,.2)),t.diffInserted=d("diffEditor.insertedTextBackground",{dark:t.defaultInsertColor,light:t.defaultInsertColor,hc:null},s.localize(74,null),!0),t.diffRemoved=d("diffEditor.removedTextBackground",{dark:t.defaultRemoveColor,light:t.defaultRemoveColor,hc:null},s.localize(75,null),!0), +t.diffInsertedOutline=d("diffEditor.insertedTextBorder",{dark:null,light:null,hc:"#33ff2eff"},s.localize(76,null)),t.diffRemovedOutline=d("diffEditor.removedTextBorder",{dark:null,light:null,hc:"#FF008F"},s.localize(77,null)),t.diffBorder=d("diffEditor.border",{dark:null,light:null,hc:t.contrastBorder},s.localize(78,null)),t.diffDiagonalFill=d("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hc:null},s.localize(79,null)),t.listFocusBackground=d("list.focusBackground",{dark:"#062F4A",light:"#D6EBFF",hc:null},s.localize(80,null)),t.listFocusForeground=d("list.focusForeground",{dark:null,light:null,hc:null},s.localize(81,null)),t.listActiveSelectionBackground=d("list.activeSelectionBackground",{dark:"#094771",light:"#0074E8",hc:null},s.localize(82,null)),t.listActiveSelectionForeground=d("list.activeSelectionForeground",{dark:n.Color.white,light:n.Color.white,hc:null},s.localize(83,null)),t.listInactiveSelectionBackground=d("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hc:null +},s.localize(84,null)),t.listInactiveSelectionForeground=d("list.inactiveSelectionForeground",{dark:null,light:null,hc:null},s.localize(85,null)),t.listInactiveFocusBackground=d("list.inactiveFocusBackground",{dark:null,light:null,hc:null},s.localize(86,null)),t.listHoverBackground=d("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hc:null},s.localize(87,null)),t.listHoverForeground=d("list.hoverForeground",{dark:null,light:null,hc:null},s.localize(88,null)),t.listDropBackground=d("list.dropBackground",{dark:t.listFocusBackground,light:t.listFocusBackground,hc:null},s.localize(89,null)),t.listHighlightForeground=d("list.highlightForeground",{dark:"#0097fb",light:"#0066BF",hc:t.focusBorder},s.localize(90,null)),t.listFilterWidgetBackground=d("listFilterWidget.background",{light:"#efc1ad",dark:"#653723",hc:n.Color.black},s.localize(91,null)),t.listFilterWidgetOutline=d("listFilterWidget.outline",{dark:n.Color.transparent,light:n.Color.transparent,hc:"#f38518"},s.localize(92,null)), +t.listFilterWidgetNoMatchesOutline=d("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hc:t.contrastBorder},s.localize(93,null)),t.treeIndentGuidesStroke=d("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hc:"#a9a9a9"},s.localize(94,null)),t.menuBorder=d("menu.border",{dark:null,light:null,hc:t.contrastBorder},s.localize(95,null)),t.menuForeground=d("menu.foreground",{dark:t.selectForeground,light:t.foreground,hc:t.selectForeground},s.localize(96,null)),t.menuBackground=d("menu.background",{dark:t.selectBackground,light:t.selectBackground,hc:t.selectBackground},s.localize(97,null)),t.menuSelectionForeground=d("menu.selectionForeground",{dark:t.listActiveSelectionForeground,light:t.listActiveSelectionForeground,hc:t.listActiveSelectionForeground},s.localize(98,null)),t.menuSelectionBackground=d("menu.selectionBackground",{dark:t.listActiveSelectionBackground,light:t.listActiveSelectionBackground,hc:t.listActiveSelectionBackground},s.localize(99,null)), +t.menuSelectionBorder=d("menu.selectionBorder",{dark:null,light:null,hc:t.activeContrastBorder},s.localize(100,null)),t.menuSeparatorBackground=d("menu.separatorBackground",{dark:"#BBBBBB",light:"#888888",hc:t.contrastBorder},s.localize(101,null)),t.snippetTabstopHighlightBackground=d("editor.snippetTabstopHighlightBackground",{dark:new n.Color(new n.RGBA(124,124,124,.3)),light:new n.Color(new n.RGBA(10,50,100,.2)),hc:new n.Color(new n.RGBA(124,124,124,.3))},s.localize(102,null)),t.snippetTabstopHighlightBorder=d("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hc:null},s.localize(103,null)),t.snippetFinalTabstopHighlightBackground=d("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hc:null},s.localize(104,null)),t.snippetFinalTabstopHighlightBorder=d("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new n.Color(new n.RGBA(10,50,100,.5)),hc:"#525252"},s.localize(105,null)),t.overviewRulerFindMatchForeground=d("editorOverviewRuler.findMatchForeground",{ +dark:"#d186167e",light:"#d186167e",hc:"#AB5A00"},s.localize(106,null),!0),t.overviewRulerSelectionHighlightForeground=d("editorOverviewRuler.selectionHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hc:"#A0A0A0CC"},s.localize(107,null),!0),t.minimapFindMatch=d("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hc:"#AB5A00"},s.localize(108,null),!0),t.minimapSelection=d("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hc:"#ffffff"},s.localize(109,null),!0),t.minimapError=d("minimap.errorHighlight",{dark:new n.Color(new n.RGBA(255,18,18,.7)),light:new n.Color(new n.RGBA(255,18,18,.7)),hc:new n.Color(new n.RGBA(255,50,50,1))},s.localize(110,null)),t.minimapWarning=d("minimap.warningHighlight",{dark:t.editorWarningForeground,light:t.editorWarningForeground,hc:t.editorWarningBorder},s.localize(111,null)),t.minimapBackground=d("minimap.background",{dark:null,light:null,hc:null},s.localize(112,null)),t.minimapSliderBackground=d("minimapSlider.background",{ +light:u(t.scrollbarSliderBackground,.5),dark:u(t.scrollbarSliderBackground,.5),hc:u(t.scrollbarSliderBackground,.5)},s.localize(113,null)),t.minimapSliderHoverBackground=d("minimapSlider.hoverBackground",{light:u(t.scrollbarSliderHoverBackground,.5),dark:u(t.scrollbarSliderHoverBackground,.5),hc:u(t.scrollbarSliderHoverBackground,.5)},s.localize(114,null)),t.minimapSliderActiveBackground=d("minimapSlider.activeBackground",{light:u(t.scrollbarSliderActiveBackground,.5),dark:u(t.scrollbarSliderActiveBackground,.5),hc:u(t.scrollbarSliderActiveBackground,.5)},s.localize(115,null)),t.problemsErrorIconForeground=d("problemsErrorIcon.foreground",{dark:t.editorErrorForeground,light:t.editorErrorForeground,hc:t.editorErrorForeground},s.localize(116,null)),t.problemsWarningIconForeground=d("problemsWarningIcon.foreground",{dark:t.editorWarningForeground,light:t.editorWarningForeground,hc:t.editorWarningForeground},s.localize(117,null)),t.problemsInfoIconForeground=d("problemsInfoIcon.foreground",{ +dark:t.editorInfoForeground,light:t.editorInfoForeground,hc:t.editorInfoForeground},s.localize(118,null)),t.darken=c,t.lighten=h,t.transparent=u,t.oneOf=function(...e){return t=>{for(let i of e){let e=p(i,t);if(e)return e}}},t.resolveColorValue=p,t.workbenchColorsSchemaId="vscode://schemas/workbench-colors";let m=i.Registry.as(r.Extensions.JSONContribution);m.registerSchema(t.workbenchColorsSchemaId,l.getColorSchema());const f=new a.RunOnceScheduler(()=>m.notifySchemaChanged(t.workbenchColorsSchemaId),200);l.onDidChangeSchema(()=>{f.isScheduled()||f.schedule()})})),define(t[107],i([0,1,21]),(function(e,t,i){"use strict";function n(e,t){const n=Object.create(null);for(let o in t){const s=t[o];s&&(n[o]=i.resolveColorValue(s,e))}return n}function o(e,t,i){function o(o){const s=n(e.getColorTheme(),t);"function"==typeof i?i(s):i.style(s)}return o(e.getColorTheme()),e.onDidColorThemeChange(o)}Object.defineProperty(t,"__esModule",{value:!0}), +t.attachMenuStyler=t.defaultMenuStyles=t.defaultListStyles=t.attachListStyler=t.attachBadgeStyler=t.attachStyler=t.computeStyles=void 0,t.computeStyles=n,t.attachStyler=o,t.attachBadgeStyler=function(e,t,n){return o(t,{badgeBackground:n&&n.badgeBackground||i.badgeBackground,badgeForeground:n&&n.badgeForeground||i.badgeForeground,badgeBorder:i.contrastBorder},e)},t.attachListStyler=function(e,i,n){return o(i,Object.assign(Object.assign({},t.defaultListStyles),n||{}),e)},t.defaultListStyles={listFocusBackground:i.listFocusBackground,listFocusForeground:i.listFocusForeground,listActiveSelectionBackground:i.darken(i.listActiveSelectionBackground,.1),listActiveSelectionForeground:i.listActiveSelectionForeground,listFocusAndSelectionBackground:i.listActiveSelectionBackground,listFocusAndSelectionForeground:i.listActiveSelectionForeground,listInactiveSelectionBackground:i.listInactiveSelectionBackground,listInactiveSelectionForeground:i.listInactiveSelectionForeground, +listInactiveFocusBackground:i.listInactiveFocusBackground,listHoverBackground:i.listHoverBackground,listHoverForeground:i.listHoverForeground,listDropBackground:i.listDropBackground,listFocusOutline:i.activeContrastBorder,listSelectionOutline:i.activeContrastBorder,listHoverOutline:i.activeContrastBorder,listFilterWidgetBackground:i.listFilterWidgetBackground,listFilterWidgetOutline:i.listFilterWidgetOutline,listFilterWidgetNoMatchesOutline:i.listFilterWidgetNoMatchesOutline,listMatchesShadow:i.widgetShadow,treeIndentGuidesStroke:i.treeIndentGuidesStroke},t.defaultMenuStyles={shadowColor:i.widgetShadow,borderColor:i.menuBorder,foregroundColor:i.menuForeground,backgroundColor:i.menuBackground,selectionForegroundColor:i.menuSelectionForeground,selectionBackgroundColor:i.menuSelectionBackground,selectionBorderColor:i.menuSelectionBorder,separatorColor:i.menuSeparatorBackground},t.attachMenuStyler=function(e,i,n){return o(i,Object.assign(Object.assign({},t.defaultMenuStyles),n),e)}})), +define(t[582],i([0,1,47,2,418,7,107,57,51,352]),(function(e,t,i,n,o,s,r,a,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContextMenuHandler=void 0;t.ContextMenuHandler=class{constructor(e,t,i,n,o){this.contextViewService=e,this.telemetryService=t,this.notificationService=i,this.keybindingService=n,this.themeService=o,this.focusToReturn=null,this.block=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){const t=e.getActions();if(!t.length)return;let d;this.focusToReturn=document.activeElement;let c=s.isHTMLElement(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,render:c=>{let h=e.getMenuClassName?e.getMenuClassName():"";h&&(c.className+=" "+h),this.options.blockMouse&&(this.block=c.appendChild(s.$(".context-view-block")),this.block.style.position="fixed",this.block.style.cursor="initial",this.block.style.left="0",this.block.style.top="0", +this.block.style.width="100%",this.block.style.height="100%",this.block.style.zIndex="-1",a.domEvent(this.block,s.EventType.MOUSE_DOWN)(e=>e.stopPropagation()));const u=new n.DisposableStore,g=e.actionRunner||new i.ActionRunner;return g.onDidBeforeRun(this.onActionRun,this,u),g.onDidRun(this.onDidActionRun,this,u),d=new o.Menu(c,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:g,getKeyBinding:e.getKeyBinding?e.getKeyBinding:e=>this.keybindingService.lookupKeybinding(e.id)}),u.add(r.attachMenuStyler(d,this.themeService)),d.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,u),d.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,u),a.domEvent(window,s.EventType.BLUR)(()=>{this.contextViewService.hideContextView(!0)},null,u),a.domEvent(window,s.EventType.MOUSE_DOWN)(e=>{if(e.defaultPrevented)return;let t=new l.StandardMouseEvent(e),i=t.target;if(!t.rightButton){for(;i;){if(i===c)return;i=i.parentElement} +this.contextViewService.hideContextView(!0)}},null,u),n.combinedDisposable(u,d)},focus:()=>{d&&d.focus(!!e.autoSelectFirstItem)},onHide:t=>{e.onHide&&e.onHide(!!t),this.block&&(s.removeNode(this.block),this.block=null),this.focusToReturn&&this.focusToReturn.focus()}},c,!!c)}onActionRun(e){this.telemetryService&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1),this.focusToReturn&&this.focusToReturn.focus()}onDidActionRun(e){e.error&&this.notificationService&&this.notificationService.error(e.error)}}})),define(t[14],i([0,1,10,2,34,4]),(function(e,t,i,n,o,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Themable=t.registerThemingParticipant=t.Extensions=t.getThemeTypeSelector=t.HIGH_CONTRAST=t.DARK=t.ThemeIcon=t.themeColorFromId=t.IThemeService=void 0,t.IThemeService=i.createDecorator("themeService"),t.themeColorFromId=function(e){return{id:e}},function(e){e.isThemeIcon=function(e){ +return e&&"object"==typeof e&&"string"==typeof e.id};const t=/^\$\(([a-z.]+\/)?([a-z-~]+)\)$/i;e.fromString=function(e){const i=t.exec(e);if(!i)return;let[,n,o]=i;return n||(n="codicon/"),{id:n+o}};const i=/^(codicon\/)?([a-z-]+)(~[a-z]+)?$/i;e.asClassName=function(e){const t=i.exec(e.id);if(!t)return;let[,,n,o]=t,s=`codicon codicon-${n}`;return o&&(s+=` ${o.substr(1)}`),s}}(t.ThemeIcon||(t.ThemeIcon={})),t.DARK="dark",t.HIGH_CONTRAST="hc",t.getThemeTypeSelector=function(e){switch(e){case t.DARK:return"vs-dark";case t.HIGH_CONTRAST:return"hc-black";default:return"vs"}},t.Extensions={ThemingContribution:"base.contributions.theming"};let r=new class{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new s.Emitter}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),n.toDisposable(()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)})}getThemingParticipants(){ +return this.themingParticipants}};o.Registry.add(t.Extensions.ThemingContribution,r),t.registerThemingParticipant=function(e){return r.onColorThemeChange(e)};class a extends n.Disposable{constructor(e){super(),this.themeService=e,this.theme=e.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(e=>this.onThemeChange(e)))}onThemeChange(e){this.theme=e,this.updateStyles()}updateStyles(){}}t.Themable=a})),define(t[583],i([0,1,7,2,8,24,354,100,52,14]),(function(e,t,i,n,o,s,r,d,c,h){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeEditorServiceImpl=t.GlobalStyleSheet=t.RefCountedStyleSheet=void 0;class u{constructor(e,t,i){this._parent=e,this._editorId=t,this._styleSheet=i,this._refCount=0}ref(){this._refCount++}unref(){var e;this._refCount--,0===this._refCount&&(null===(e=this._styleSheet.parentNode)||void 0===e||e.removeChild(this._styleSheet),this._parent._removeEditorStyleSheets(this._editorId))}insertRule(e,t){this._styleSheet.sheet.insertRule(e,t)} +removeRulesContainingSelector(e){i.removeCSSRulesContainingSelector(e,this._styleSheet)}}t.RefCountedStyleSheet=u;class g{constructor(e){this._styleSheet=e}ref(){}unref(){}insertRule(e,t){this._styleSheet.sheet.insertRule(e,t)}removeRulesContainingSelector(e){i.removeCSSRulesContainingSelector(e,this._styleSheet)}}t.GlobalStyleSheet=g;let p=class extends r.AbstractCodeEditorService{constructor(e,t=null){super(),this._decorationOptionProviders=new Map,this._editorStyleSheets=new Map,this._globalStyleSheet=t||null,this._themeService=e}_getOrCreateGlobalStyleSheet(){return this._globalStyleSheet||(this._globalStyleSheet=new g(i.createStyleSheet())),this._globalStyleSheet}_getOrCreateStyleSheet(e){if(!e)return this._getOrCreateGlobalStyleSheet();const t=e.getContainerDomNode();if(!i.isInShadowDOM(t))return this._getOrCreateGlobalStyleSheet();const n=e.getId();if(!this._editorStyleSheets.has(n)){const e=new u(this,n,i.createStyleSheet(t));this._editorStyleSheets.set(n,e)}return this._editorStyleSheets.get(n)} +_removeEditorStyleSheets(e){this._editorStyleSheets.delete(e)}registerDecorationType(e,t,i,n){let o=this._decorationOptionProviders.get(e);if(!o){const s=this._getOrCreateStyleSheet(n),r={styleSheet:s,key:e,parentTypeKey:i,options:t||Object.create(null)};o=i?new m(this._themeService,s,r):new f(this._themeService,s,r),this._decorationOptionProviders.set(e,o)}o.refCount++}removeDecorationType(e){const t=this._decorationOptionProviders.get(e);t&&(t.refCount--,t.refCount<=0&&(this._decorationOptionProviders.delete(e),t.dispose(),this.listCodeEditors().forEach(t=>t.removeDecorations(e))))}resolveDecorationOptions(e,t){const i=this._decorationOptionProviders.get(e);if(!i)throw new Error("Unknown decoration type key: "+e);return i.getOptions(this,t)}};p=a([l(0,h.IThemeService)],p),t.CodeEditorServiceImpl=p;class m{constructor(e,t,i){this._styleSheet=t,this._styleSheet.ref(),this._parentTypeKey=i.parentTypeKey,this.refCount=0,this._beforeContentRules=new v(3,i,e),this._afterContentRules=new v(4,i,e)}getOptions(e,t){ +const i=e.resolveDecorationOptions(this._parentTypeKey,!0);return this._beforeContentRules&&(i.beforeContentClassName=this._beforeContentRules.className),this._afterContentRules&&(i.afterContentClassName=this._afterContentRules.className),i}dispose(){this._beforeContentRules&&(this._beforeContentRules.dispose(),this._beforeContentRules=null),this._afterContentRules&&(this._afterContentRules.dispose(),this._afterContentRules=null),this._styleSheet.unref()}}class f{constructor(e,t,i){this._disposables=new n.DisposableStore,this._styleSheet=t,this._styleSheet.ref(),this.refCount=0;const o=t=>{const n=new v(t,i,e);if(this._disposables.add(n),n.hasContent)return n.className};this.className=o(0);const s=(t=>{const n=new v(t,i,e);return this._disposables.add(n),n.hasContent?{className:n.className,hasLetterSpacing:n.hasLetterSpacing}:null})(1);s&&(this.inlineClassName=s.className,this.inlineClassNameAffectsLetterSpacing=s.hasLetterSpacing),this.beforeContentClassName=o(3),this.afterContentClassName=o(4), +this.glyphMarginClassName=o(2);const r=i.options;this.isWholeLine=Boolean(r.isWholeLine),this.stickiness=r.rangeBehavior;const a=r.light&&r.light.overviewRulerColor||r.overviewRulerColor,l=r.dark&&r.dark.overviewRulerColor||r.overviewRulerColor;void 0===a&&void 0===l||(this.overviewRuler={color:a||l,darkColor:l||a,position:r.overviewRulerLane||c.OverviewRulerLane.Center})}getOptions(e,t){return t?{inlineClassName:this.inlineClassName,beforeContentClassName:this.beforeContentClassName,afterContentClassName:this.afterContentClassName,className:this.className,glyphMarginClassName:this.glyphMarginClassName,isWholeLine:this.isWholeLine,overviewRuler:this.overviewRuler,stickiness:this.stickiness}:this}dispose(){this._disposables.dispose(),this._styleSheet.unref()}}const _={color:"color:{0} !important;",opacity:"opacity:{0};",backgroundColor:"background-color:{0};",outline:"outline:{0};",outlineColor:"outline-color:{0};",outlineStyle:"outline-style:{0};",outlineWidth:"outline-width:{0};",border:"border:{0};", +borderColor:"border-color:{0};",borderRadius:"border-radius:{0};",borderSpacing:"border-spacing:{0};",borderStyle:"border-style:{0};",borderWidth:"border-width:{0};",fontStyle:"font-style:{0};",fontWeight:"font-weight:{0};",textDecoration:"text-decoration:{0};",cursor:"cursor:{0};",letterSpacing:"letter-spacing:{0};",gutterIconPath:"background:{0} center center no-repeat;",gutterIconSize:"background-size:{0};",contentText:"content:'{0}';",contentIconPath:"content:{0};",margin:"margin:{0};",width:"width:{0};",height:"height:{0};"};class v{constructor(e,t,i){this._theme=i.getColorTheme(),this._ruleType=e,this._providerArgs=t,this._usesThemeColors=!1,this._hasContent=!1,this._hasLetterSpacing=!1;let n=C.getClassName(this._providerArgs.key,e);this._providerArgs.parentTypeKey&&(n=n+" "+C.getClassName(this._providerArgs.parentTypeKey,e)),this._className=n,this._unThemedSelector=C.getSelector(this._providerArgs.key,this._providerArgs.parentTypeKey,e),this._buildCSS(), +this._usesThemeColors?this._themeListener=i.onDidColorThemeChange(e=>{this._theme=i.getColorTheme(),this._removeCSS(),this._buildCSS()}):this._themeListener=null}dispose(){this._hasContent&&(this._removeCSS(),this._hasContent=!1),this._themeListener&&(this._themeListener.dispose(),this._themeListener=null)}get hasContent(){return this._hasContent}get hasLetterSpacing(){return this._hasLetterSpacing}get className(){return this._className}_buildCSS(){const e=this._providerArgs.options;let t,i,n;switch(this._ruleType){case 0:t=this.getCSSTextForModelDecorationClassName(e),i=this.getCSSTextForModelDecorationClassName(e.light),n=this.getCSSTextForModelDecorationClassName(e.dark);break;case 1:t=this.getCSSTextForModelDecorationInlineClassName(e),i=this.getCSSTextForModelDecorationInlineClassName(e.light),n=this.getCSSTextForModelDecorationInlineClassName(e.dark);break;case 2:t=this.getCSSTextForModelDecorationGlyphMarginClassName(e),i=this.getCSSTextForModelDecorationGlyphMarginClassName(e.light), +n=this.getCSSTextForModelDecorationGlyphMarginClassName(e.dark);break;case 3:t=this.getCSSTextForModelDecorationContentClassName(e.before),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.before),n=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.before);break;case 4:t=this.getCSSTextForModelDecorationContentClassName(e.after),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.after),n=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.after);break;default:throw new Error("Unknown rule type: "+this._ruleType)}const o=this._providerArgs.styleSheet;let s=!1;t.length>0&&(o.insertRule(`${this._unThemedSelector} {${t}}`,0),s=!0),i.length>0&&(o.insertRule(`.vs${this._unThemedSelector} {${i}}`,0),s=!0),n.length>0&&(o.insertRule(`.vs-dark${this._unThemedSelector}, .hc-black${this._unThemedSelector} {${n}}`,0),s=!0),this._hasContent=s}_removeCSS(){this._providerArgs.styleSheet.removeRulesContainingSelector(this._unThemedSelector)} +getCSSTextForModelDecorationClassName(e){if(!e)return"";const t=[];return this.collectCSSText(e,["backgroundColor"],t),this.collectCSSText(e,["outline","outlineColor","outlineStyle","outlineWidth"],t),this.collectBorderSettingsCSSText(e,t),t.join("")}getCSSTextForModelDecorationInlineClassName(e){if(!e)return"";const t=[];return this.collectCSSText(e,["fontStyle","fontWeight","textDecoration","cursor","color","opacity","letterSpacing"],t),e.letterSpacing&&(this._hasLetterSpacing=!0),t.join("")}getCSSTextForModelDecorationContentClassName(e){if(!e)return"";const t=[];if(void 0!==e){if(this.collectBorderSettingsCSSText(e,t),void 0!==e.contentIconPath&&t.push(o.format(_.contentIconPath,i.asCSSUrl(s.URI.revive(e.contentIconPath)))),"string"==typeof e.contentText){const i=e.contentText.match(/^.*$/m)[0].replace(/['\\]/g,"\\$&");t.push(o.format(_.contentText,i))}this.collectCSSText(e,["fontStyle","fontWeight","textDecoration","color","opacity","backgroundColor","margin"],t), +this.collectCSSText(e,["width","height"],t)&&t.push("display:inline-block;")}return t.join("")}getCSSTextForModelDecorationGlyphMarginClassName(e){if(!e)return"";const t=[];return void 0!==e.gutterIconPath&&(t.push(o.format(_.gutterIconPath,i.asCSSUrl(s.URI.revive(e.gutterIconPath)))),void 0!==e.gutterIconSize&&t.push(o.format(_.gutterIconSize,e.gutterIconSize))),t.join("")}collectBorderSettingsCSSText(e,t){return!!this.collectCSSText(e,["border","borderColor","borderRadius","borderSpacing","borderStyle","borderWidth"],t)&&(t.push(o.format("box-sizing: border-box;")),!0)}collectCSSText(e,t,i){const n=i.length;for(let n of t){const t=this.resolveValue(e[n]);"string"==typeof t&&i.push(o.format(_[n],t))}return i.length!==n}resolveValue(e){if(d.isThemeColor(e)){this._usesThemeColors=!0;const t=this._theme.getColor(e.id);return t?t.toString():"transparent"}return e}}class C{static getClassName(e,t){return"ced-"+e+"-"+t}static getSelector(e,t,i){let n=".monaco-editor ."+this.getClassName(e,i) +;return t&&(n=n+"."+this.getClassName(t,i)),3===i?n+="::before":4===i&&(n+="::after"),n}}})),define(t[584],i([0,1,7,30,65,43,14]),(function(e,t,i,n,o,s,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditorScrollbar=void 0;class a extends s.ViewPart{constructor(e,t,a,l){super(e);const d=this._context.configuration.options,c=d.get(84),h=d.get(58),u=d.get(28),g=d.get(87),p={listenOnDomNode:a.domNode,className:"editor-scrollable "+r.getThemeTypeSelector(e.theme.type),useShadows:!1,lazyRender:!0,vertical:c.vertical,horizontal:c.horizontal,verticalHasArrows:c.verticalHasArrows,horizontalHasArrows:c.horizontalHasArrows,verticalScrollbarSize:c.verticalScrollbarSize,verticalSliderSize:c.verticalSliderSize,horizontalScrollbarSize:c.horizontalScrollbarSize,horizontalSliderSize:c.horizontalSliderSize,handleMouseWheel:c.handleMouseWheel,alwaysConsumeMouseWheel:c.alwaysConsumeMouseWheel,arrowSize:c.arrowSize,mouseWheelScrollSensitivity:h,fastScrollSensitivity:u,scrollPredominantAxis:g} +;this.scrollbar=this._register(new o.SmoothScrollableElement(t.domNode,p,this._context.viewLayout.getScrollable())),s.PartFingerprints.write(this.scrollbar.getDomNode(),5),this.scrollbarDomNode=n.createFastDomNode(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const m=(e,t,i)=>{const n={};if(t){const t=e.scrollTop;t&&(n.scrollTop=this._context.viewLayout.getCurrentScrollTop()+t,e.scrollTop=0)}if(i){const t=e.scrollLeft;t&&(n.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+t,e.scrollLeft=0)}this._context.model.setScrollPosition(n,1)};this._register(i.addDisposableListener(a.domNode,"scroll",e=>m(a.domNode,!0,!0))),this._register(i.addDisposableListener(t.domNode,"scroll",e=>m(t.domNode,!0,!1))),this._register(i.addDisposableListener(l.domNode,"scroll",e=>m(l.domNode,!0,!1))),this._register(i.addDisposableListener(this.scrollbarDomNode.domNode,"scroll",e=>m(this.scrollbarDomNode.domNode,!0,!1)))}dispose(){super.dispose()}_setLayout(){ +const e=this._context.configuration.options,t=e.get(117);this.scrollbarDomNode.setLeft(t.contentLeft),"right"===e.get(56).side?this.scrollbarDomNode.setWidth(t.contentWidth+t.minimap.minimapWidth):this.scrollbarDomNode.setWidth(t.contentWidth),this.scrollbarDomNode.setHeight(t.height)}getOverviewRulerLayoutInfo(){return this.scrollbar.getOverviewRulerLayoutInfo()}getDomNode(){return this.scrollbarDomNode}delegateVerticalScrollbarMouseDown(e){this.scrollbar.delegateVerticalScrollbarMouseDown(e)}onConfigurationChanged(e){if(e.hasChanged(84)||e.hasChanged(58)||e.hasChanged(28)){const e=this._context.configuration.options,t=e.get(84),i=e.get(58),n=e.get(28),o=e.get(87),s={handleMouseWheel:t.handleMouseWheel,mouseWheelScrollSensitivity:i,fastScrollSensitivity:n,scrollPredominantAxis:o};this.scrollbar.updateOptions(s)}return e.hasChanged(117)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){ +return this.scrollbar.updateClassName("editor-scrollable "+r.getThemeTypeSelector(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}t.EditorScrollbar=a})),define(t[249],i([0,1,36,30,16,375,103,163,123,14,38]),(function(e,t,i,n,o,s,r,a,l,d,c){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ViewLine=t.ViewLineOptions=t.DomReadingContext=void 0;const h=!!o.isNative||!(o.isLinux||i.isFirefox||i.isSafari);let u=!0;const g=i.isEdge;t.DomReadingContext=class{constructor(e,t){this._domNode=e,this._clientRectDeltaLeft=0,this._clientRectDeltaLeftRead=!1,this.endNode=t}get clientRectDeltaLeft(){return this._clientRectDeltaLeftRead||(this._clientRectDeltaLeftRead=!0,this._clientRectDeltaLeft=this._domNode.getBoundingClientRect().left),this._clientRectDeltaLeft}};t.ViewLineOptions=class{constructor(e,t){this.themeType=t;const i=e.options,n=i.get(36);this.renderWhitespace=i.get(80),this.renderControlCharacters=i.get(74),this.spaceWidth=n.spaceWidth, +this.middotWidth=n.middotWidth,this.wsmiddotWidth=n.wsmiddotWidth,this.useMonospaceOptimizations=n.isMonospace&&!i.get(24),this.canUseHalfwidthRightwardsArrow=n.canUseHalfwidthRightwardsArrow,this.lineHeight=i.get(51),this.stopRenderingLineAfter=i.get(95),this.fontLigatures=i.get(37)}equals(e){return this.themeType===e.themeType&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.fontLigatures===e.fontLigatures}};class p{constructor(e){this._options=e,this._isMaybeInvalid=!0,this._renderedViewLine=null}getDomNode(){return this._renderedViewLine&&this._renderedViewLine.domNode?this._renderedViewLine.domNode.domNode:null}setDomNode(e){ +if(!this._renderedViewLine)throw new Error("I have no rendered view line to set the dom node to...");this._renderedViewLine.domNode=n.createFastDomNode(e)}onContentChanged(){this._isMaybeInvalid=!0}onTokensChanged(){this._isMaybeInvalid=!0}onDecorationsChanged(){this._isMaybeInvalid=!0}onOptionsChanged(e){this._isMaybeInvalid=!0,this._options=e}onSelectionChanged(){return!(!g&&this._options.themeType!==d.HIGH_CONTRAST&&"selection"!==this._options.renderWhitespace)&&(this._isMaybeInvalid=!0,!0)}renderLine(e,t,i,n){if(!1===this._isMaybeInvalid)return!1;this._isMaybeInvalid=!1;const o=i.getViewLineRenderingData(e),s=this._options,r=a.LineDecoration.filter(o.inlineDecorations,e,o.minColumn,o.maxColumn);let f=null;if(g||s.themeType===d.HIGH_CONTRAST||"selection"===this._options.renderWhitespace){const t=i.selections;for(const i of t){if(i.endLineNumbere)continue;const t=i.startLineNumber===e?i.startColumn:o.minColumn,n=i.endLineNumber===e?i.endColumn:o.maxColumn +;t');const C=l.renderViewLine(_,n);n.appendASCIIString("");let b=null +;return u&&h&&o.isBasicASCII&&s.useMonospaceOptimizations&&0===C.containsForeignElements&&o.content.length<300&&_.lineTokens.getCount()<100&&(b=new m(this._renderedViewLine?this._renderedViewLine.domNode:null,_,C.characterMapping)),b||(b=v(this._renderedViewLine?this._renderedViewLine.domNode:null,_,C.characterMapping,C.containsRTL,C.containsForeignElements)),this._renderedViewLine=b,!0}layoutLine(e,t){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(this._options.lineHeight))}getWidth(){return this._renderedViewLine?this._renderedViewLine.getWidth():0}getWidthIsFast(){return!this._renderedViewLine||this._renderedViewLine.getWidthIsFast()}needsMonospaceFontCheck(){return!!this._renderedViewLine&&this._renderedViewLine instanceof m}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof m?this._renderedViewLine.monospaceAssumptionsAreValid():u}onMonospaceAssumptionsInvalidated(){ +this._renderedViewLine&&this._renderedViewLine instanceof m&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,i){if(!this._renderedViewLine)return null;e|=0,t|=0,e=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,e)),t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t));const n=0|this._renderedViewLine.input.stopRenderingLineAfter;let o=!1;-1!==n&&e>n+1&&t>n+1&&(o=!0),-1!==n&&e>n+1&&(e=n+1),-1!==n&&t>n+1&&(t=n+1);const s=this._renderedViewLine.getVisibleRangesForRange(e,t,i);return s&&s.length>0?new r.VisibleRanges(o,s):null}getColumnOfNodeOffset(e,t,i){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t,i):1}}t.ViewLine=p,p.CLASS_NAME="view-line";class m{constructor(e,t,i){this.domNode=e,this.input=t,this._characterMapping=i,this._charWidth=t.spaceWidth}getWidth(){return this._getCharPosition(this._characterMapping.length)}getWidthIsFast(){return!0}monospaceAssumptionsAreValid(){ +if(!this.domNode)return u;const e=this.getWidth(),t=this.domNode.domNode.firstChild.offsetWidth;return Math.abs(e-t)>=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),u=!1),u}toSlowRenderedLine(){return v(this.domNode,this.input,this._characterMapping,!1,0)}getVisibleRangesForRange(e,t,i){const n=this._getCharPosition(e),o=this._getCharPosition(t);return[new r.HorizontalRange(n,o-n)]}_getCharPosition(e){const t=this._characterMapping.getAbsoluteOffsets();return 0===t.length?0:Math.round(this._charWidth*t[e-1])}getColumnOfNodeOffset(e,t,i){const n=t.textContent.length;let o=-1;for(;t;)t=t.previousSibling,o++;return this._characterMapping.partDataToCharOffset(o,n,i)+1}}class f{constructor(e,t,i,n,o){if(this.domNode=e,this.input=t,this._characterMapping=i,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=o,this._cachedWidth=-1,this._pixelOffsetCache=null,!n||0===this._characterMapping.length){ +this._pixelOffsetCache=new Int32Array(Math.max(2,this._characterMapping.length+1));for(let e=0,t=this._characterMapping.length;e<=t;e++)this._pixelOffsetCache[e]=-1}}_getReadingTarget(e){return e.domNode.firstChild}getWidth(){return this.domNode?(-1===this._cachedWidth&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth),this._cachedWidth):0}getWidthIsFast(){return-1!==this._cachedWidth}getVisibleRangesForRange(e,t,i){if(!this.domNode)return null;if(null!==this._pixelOffsetCache){const n=this._readPixelOffset(this.domNode,e,i);if(-1===n)return null;const o=this._readPixelOffset(this.domNode,t,i);return-1===o?null:[new r.HorizontalRange(n,o-n)]}return this._readVisibleRangesForRange(this.domNode,e,t,i)}_readVisibleRangesForRange(e,t,i,n){if(t===i){const i=this._readPixelOffset(e,t,n);return-1===i?null:[new r.HorizontalRange(i,0)]}return this._readRawVisibleRangesForRange(e,t,i,n)}_readPixelOffset(e,t,i){if(0===this._characterMapping.length){if(0===this._containsForeignElements)return 0 +;if(2===this._containsForeignElements)return 0;if(1===this._containsForeignElements)return this.getWidth();const t=this._getReadingTarget(e);return t.firstChild?t.firstChild.offsetWidth:0}if(null!==this._pixelOffsetCache){const n=this._pixelOffsetCache[t];if(-1!==n)return n;const o=this._actualReadPixelOffset(e,t,i);return this._pixelOffsetCache[t]=o,o}return this._actualReadPixelOffset(e,t,i)}_actualReadPixelOffset(e,t,i){if(0===this._characterMapping.length){const t=s.RangeUtil.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,i.clientRectDeltaLeft,i.endNode);return t&&0!==t.length?t[0].left:-1}if(t===this._characterMapping.length&&this._isWhitespaceOnly&&0===this._containsForeignElements)return this.getWidth();const n=this._characterMapping.charOffsetToPartData(t-1),o=l.CharacterMapping.getPartIndex(n),r=l.CharacterMapping.getCharIndex(n),a=s.RangeUtil.readHorizontalRanges(this._getReadingTarget(e),o,r,o,r,i.clientRectDeltaLeft,i.endNode);if(!a||0===a.length)return-1;const d=a[0].left +;if(this.input.isBasicASCII){const e=this._characterMapping.getAbsoluteOffsets(),i=Math.round(this.input.spaceWidth*e[t-1]);if(Math.abs(i-d)<=1)return i}return d}_readRawVisibleRangesForRange(e,t,i,n){if(1===t&&i===this._characterMapping.length)return[new r.HorizontalRange(0,this.getWidth())];const o=this._characterMapping.charOffsetToPartData(t-1),a=l.CharacterMapping.getPartIndex(o),d=l.CharacterMapping.getCharIndex(o),c=this._characterMapping.charOffsetToPartData(i-1),h=l.CharacterMapping.getPartIndex(c),u=l.CharacterMapping.getCharIndex(c);return s.RangeUtil.readHorizontalRanges(this._getReadingTarget(e),a,d,h,u,n.clientRectDeltaLeft,n.endNode)}getColumnOfNodeOffset(e,t,i){const n=t.textContent.length;let o=-1;for(;t;)t=t.previousSibling,o++;return this._characterMapping.partDataToCharOffset(o,n,i)+1}}class _ extends f{_readVisibleRangesForRange(e,t,i,n){const o=super._readVisibleRangesForRange(e,t,i,n);if(!o||0===o.length||t===i||1===t&&i===this._characterMapping.length)return o +;if(!this.input.containsRTL){const t=this._readPixelOffset(e,i,n);if(-1!==t){const e=o[o.length-1];e.left=4&&3===e[0]&&7===e[3]}static isStrictChildOfViewLines(e){return e.length>4&&3===e[0]&&7===e[3]}static isChildOfScrollableElement(e){return e.length>=2&&3===e[0]&&5===e[1]}static isChildOfMinimap(e){return e.length>=2&&3===e[0]&&8===e[1]}static isChildOfContentWidgets(e){return e.length>=4&&3===e[0]&&1===e[3]}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&2===e[0]}static isChildOfOverlayWidgets(e){ +return e.length>=2&&3===e[0]&&4===e[1]}}class u{constructor(e,t,i){this.model=e.model;const n=e.configuration.options;this.layoutInfo=n.get(117),this.viewDomNode=t.viewDomNode,this.lineHeight=n.get(51),this.typicalHalfwidthCharacterWidth=n.get(36).typicalHalfwidthCharacterWidth,this.lastRenderData=i,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return u.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){const i=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(i){let n,o=i.verticalOffset+i.height/2,s=e.model.getLineCount(),a=null,l=null;return i.afterLineNumber!==s&&(l=new r.Position(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(a=new r.Position(i.afterLineNumber,e.model.getLineMaxColumn(i.afterLineNumber))),n=null===l?a:null===a?l:t=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,_._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class p extends g{constructor(e,t,i,n){super(e,t,i),this._ctx=e,n?(this.target=n,this.targetPath=o.PartFingerprints.collect(n,e.viewDomNode)):(this.target=null,this.targetPath=new Uint8Array(0))}toString(){ +return`pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset}\n\ttarget: ${this.target?this.target.outerHTML:null}`}fulfill(e,t=null,i=null,n=null){let o=this.mouseColumn;return t&&t.columns.contentLeft+s.width)continue;const i=e.getVerticalOffsetForLineNumber(s.position.lineNumber);if(i<=o&&o<=i+s.height)return t.fulfill(6,s.position)}}return null}static _hitTestViewZone(e,t){const i=e.getZoneAtCoord(t.mouseVerticalOffset);if(i){const e=t.isInContentArea?8:5;return t.fulfill(e,i.position,null,i)}return null}static _hitTestTextArea(e,t){ +return h.isTextArea(t.targetPath)?e.lastRenderData.lastTextareaPosition?t.fulfill(6,e.lastRenderData.lastTextareaPosition):t.fulfill(1,e.lastRenderData.lastTextareaPosition):null}static _hitTestMargin(e,t){if(t.isInMarginArea){const i=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),n=i.range.getStartPosition();let o=Math.abs(t.pos.x-t.editorPos.x);const s={isAfterLines:i.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:o};return(o-=e.layoutInfo.glyphMarginLeft)<=e.layoutInfo.glyphMarginWidth?t.fulfill(2,n,i.range,s):(o-=e.layoutInfo.glyphMarginWidth)<=e.layoutInfo.lineNumbersWidth?t.fulfill(3,n,i.range,s):(o-=e.layoutInfo.lineNumbersWidth,t.fulfill(4,n,i.range,s))}return null}static _hitTestViewLines(e,t,i){if(!h.isChildOfViewLines(t.targetPath))return null;if(e.isAfterLines(t.mouseVerticalOffset)){const i=e.model.getLineCount(),n=e.model.getLineMaxColumn(i) +;return t.fulfill(7,new r.Position(i,n),void 0,m)}if(i){if(h.isStrictChildOfViewLines(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(0===e.model.getLineLength(i)){const n=e.getLineWidth(i),o=f(t.mouseContentHorizontalOffset-n);return t.fulfill(7,new r.Position(i,1),void 0,o)}const n=e.getLineWidth(i);if(t.mouseContentHorizontalOffset>=n){const o=f(t.mouseContentHorizontalOffset-n),s=new r.Position(i,e.model.getLineMaxColumn(i));return t.fulfill(7,s,void 0,o)}}return t.fulfill(0)}const n=_._doHitTest(e,t);return n.position?_.createMouseTargetFromHitTestPosition(e,t,n.position.lineNumber,n.position.column):this._createMouseTarget(e,t.withTarget(n.hitTarget),!0)}static _hitTestMinimap(e,t){if(h.isChildOfMinimap(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.model.getLineMaxColumn(i);return t.fulfill(11,new r.Position(i,n))}return null}static _hitTestScrollbarSlider(e,t){ +if(h.isChildOfScrollableElement(t.targetPath)&&t.target&&1===t.target.nodeType){const i=t.target.className;if(i&&/\b(slider|scrollbar)\b/.test(i)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.model.getLineMaxColumn(i);return t.fulfill(11,new r.Position(i,n))}}return null}static _hitTestScrollbar(e,t){if(h.isChildOfScrollableElement(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.model.getLineMaxColumn(i);return t.fulfill(11,new r.Position(i,n))}return null}getMouseColumn(e,t){const i=this._context.configuration.options,n=i.get(117),o=this._context.viewLayout.getCurrentScrollLeft()+t.x-e.x-n.contentLeft;return _._getMouseColumn(o,i.get(36).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){if(e<0)return 1;return Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,n,o){const s=new r.Position(n,o),l=e.getLineWidth(n);if(t.mouseContentHorizontalOffset>l){if(i.isEdge&&1===s.column){const i=f(t.mouseContentHorizontalOffset-l) +;return t.fulfill(7,new r.Position(n,e.model.getLineMaxColumn(n)),void 0,i)}const o=f(t.mouseContentHorizontalOffset-l);return t.fulfill(7,s,void 0,o)}const d=e.visibleRangeForPosition(n,o);if(!d)return t.fulfill(0,s);const c=d.left;if(t.mouseContentHorizontalOffset===c)return t.fulfill(6,s);const h=[];if(h.push({offset:d.left,column:o}),o>1){const t=e.visibleRangeForPosition(n,o-1);t&&h.push({offset:t.left,column:o-1})}if(oe.offset-t.offset);for(let e=1;e=t.editorPos.y+e.layoutInfo.height&&(s=t.editorPos.y+e.layoutInfo.height-1);const r=new n.PageCoordinates(t.pos.x,s),a=this._actualDoHitTestWithCaretRangeFromPoint(e,r.toClientCoordinates());return a.position?a:this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates())}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const i=d.getShadowRoot(e.viewDomNode);let n;if(!(n=i?void 0===i.caretRangeFromPoint?v(i,t.clientX,t.clientY):i.caretRangeFromPoint(t.clientX,t.clientY):document.caretRangeFromPoint(t.clientX,t.clientY))||!n.startContainer)return{position:null,hitTarget:null};const o=n.startContainer;let r=null;if(o.nodeType===o.TEXT_NODE){const t=o.parentNode,i=t?t.parentNode:null,a=i?i.parentNode:null;if((a&&a.nodeType===a.ELEMENT_NODE?a.className:null)===s.ViewLine.CLASS_NAME){return{position:e.getPositionFromDOMInfo(t,n.startOffset),hitTarget:null}}r=o.parentNode}else if(o.nodeType===o.ELEMENT_NODE){const t=o.parentNode,i=t?t.parentNode:null +;if((i&&i.nodeType===i.ELEMENT_NODE?i.className:null)===s.ViewLine.CLASS_NAME){return{position:e.getPositionFromDOMInfo(o,o.textContent.length),hitTarget:null}}r=o}return{position:null,hitTarget:r}}static _doHitTestWithCaretPositionFromPoint(e,t){const i=document.caretPositionFromPoint(t.clientX,t.clientY);if(i.offsetNode.nodeType===i.offsetNode.TEXT_NODE){const t=i.offsetNode.parentNode,n=t?t.parentNode:null,o=n?n.parentNode:null;if((o&&o.nodeType===o.ELEMENT_NODE?o.className:null)===s.ViewLine.CLASS_NAME){return{position:e.getPositionFromDOMInfo(i.offsetNode.parentNode,i.offset),hitTarget:null}}return{position:null,hitTarget:i.offsetNode.parentNode}}if(i.offsetNode.nodeType===i.offsetNode.ELEMENT_NODE){const t=i.offsetNode.parentNode;if((t&&t.nodeType===t.ELEMENT_NODE?t.className:null)===s.ViewLine.CLASS_NAME){const t=i.offsetNode.childNodes[Math.min(i.offset,i.offsetNode.childNodes.length-1)];if(t){return{position:e.getPositionFromDOMInfo(t,0),hitTarget:null}}}}return{position:null,hitTarget:i.offsetNode}} +static _doHitTestWithMoveToPoint(e,t){let i=null,n=null;const o=document.body.createTextRange();try{o.moveToPoint(t.clientX,t.clientY)}catch(e){return{position:null,hitTarget:null}}o.collapse(!0);const r=o?o.parentElement():null,a=r?r.parentNode:null,l=a?a.parentNode:null;if((l&&l.nodeType===l.ELEMENT_NODE?l.className:"")===s.ViewLine.CLASS_NAME){const t=o.duplicate();t.moveToElementText(r),t.setEndPoint("EndToStart",o),i=e.getPositionFromDOMInfo(r,t.text.length),t.moveToElementText(e.viewDomNode)}else n=r;return o.moveToElementText(e.viewDomNode),{position:i,hitTarget:n}}static _doHitTest(e,t){return"function"==typeof document.caretRangeFromPoint?this._doHitTestWithCaretRangeFromPoint(e,t):document.caretPositionFromPoint?this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates()):document.body.createTextRange?this._doHitTestWithMoveToPoint(e,t.pos.toClientCoordinates()):{position:null,hitTarget:null}}}function v(e,t,i){const n=document.createRange();let o=e.elementFromPoint(t,i);if(null!==o){ +for(;o&&o.firstChild&&o.firstChild.nodeType!==o.firstChild.TEXT_NODE;)o=o.lastChild;const e=o.getBoundingClientRect(),i=window.getComputedStyle(o,null).getPropertyValue("font"),s=o.innerText;let r,a=e.left,l=0;if(t>e.left+e.width)l=s.length;else{const e=C.getInstance();for(let n=0;nthis._createMouseTarget(e,t),e=>this._getMouseColumn(e))),this.lastMouseLeaveTime=-1;const s=new l.EditorMouseEventFactory(this.viewHelper.viewDomNode);this._register(s.onContextMenu(this.viewHelper.viewDomNode,e=>this._onContextMenu(e,!0))),this._register(s.onMouseMoveThrottled(this.viewHelper.viewDomNode,e=>this._onMouseMove(e),g(this.mouseTargetFactory),p.MOUSE_MOVE_MINIMUM_TIME)),this._register(s.onMouseUp(this.viewHelper.viewDomNode,e=>this._onMouseUp(e))),this._register(s.onMouseLeave(this.viewHelper.viewDomNode,e=>this._onMouseLeave(e))), +this._register(s.onMouseDown(this.viewHelper.viewDomNode,e=>this._onMouseDown(e)));this._register(i.addDisposableListener(this.viewHelper.viewDomNode,i.EventType.MOUSE_WHEEL,e=>{if(this.viewController.emitMouseWheel(e),!this._context.configuration.options.get(59))return;const t=new n.StandardWheelEvent(e);if(t.browserEvent.ctrlKey||t.browserEvent.metaKey){const e=d.EditorZoom.getZoomLevel(),i=t.deltaY>0?1:-1;d.EditorZoom.setZoomLevel(e+i),t.preventDefault(),t.stopPropagation()}},{capture:!0,passive:!1})),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onCursorStateChanged(e){return this._mouseDownOperation.onCursorStateChanged(e),!1}onFocusChanged(e){return!1}onScrollChanged(e){return this._mouseDownOperation.onScrollChanged(),!1}getTargetAtClientPoint(e,t){const i=new l.ClientCoordinates(e,t).toPageCoordinates(),n=l.createEditorPagePosition(this.viewHelper.viewDomNode) +;return i.yn.y+n.height||i.xn.x+n.width?null:this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),n,i,null)}_createMouseTarget(e,t){return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,t?e.target:null)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.editorPos,e.pos)}_onContextMenu(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})}_onMouseMove(e){if(this._mouseDownOperation.isActive())return;e.timestamp{e.preventDefault(),this.viewHelper.focusTextArea()};if(d&&(i||o&&s))c(),this._mouseDownOperation.start(t.type,e);else if(n)e.preventDefault();else if(a){const i=t.detail;this.viewHelper.shouldSuppressMouseDownOnViewZone(i.viewZoneId)&&(c(),this._mouseDownOperation.start(t.type,e),e.preventDefault())}else l&&this.viewHelper.shouldSuppressMouseDownOnWidget(t.detail)&&(c(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:t})}}t.MouseHandler=p,p.MOUSE_MOVE_MINIMUM_TIME=100;class m extends s.Disposable{constructor(e,t,i,n,s){super(),this._context=e,this._viewController=t,this._viewHelper=i,this._createMouseTarget=n,this._getMouseColumn=s, +this._mouseMoveMonitor=this._register(new l.GlobalEditorMouseMoveMonitor(this._viewHelper.viewDomNode)),this._onScrollTimeout=this._register(new o.TimeoutTimer),this._mouseState=new f,this._currentSelection=new h.Selection(1,1,1,1),this._isActive=!1,this._lastMouseEvent=null}dispose(){super.dispose()}isActive(){return this._isActive}_onMouseDownThenMove(e){this._lastMouseEvent=e,this._mouseState.setModifiers(e);const t=this._findMousePosition(e,!0);t&&(this._mouseState.isDragAndDrop?this._viewController.emitMouseDrag({event:e,target:t}):this._dispatchMouse(t,!0))}start(e,t){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(3===e),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);const i=this._findMousePosition(t,!0);if(!i||!i.position)return;this._mouseState.trySetCount(t.detail,i.position),t.detail=this._mouseState.count;const n=this._context.configuration.options +;if(!n.get(72)&&n.get(25)&&!n.get(13)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&6===i.type&&i.position&&this._currentSelection.containsPosition(i.position))return this._mouseState.isDragAndDrop=!0,this._isActive=!0,void this._mouseMoveMonitor.startMonitoring(t.target,t.buttons,g(null),e=>this._onMouseDownThenMove(e),()=>{const e=this._findMousePosition(this._lastMouseEvent,!0);this._viewController.emitMouseDrop({event:this._lastMouseEvent,target:e?this._createMouseTarget(this._lastMouseEvent,!0):null}),this._stop()});this._mouseState.isDragAndDrop=!1,this._dispatchMouse(i,t.shiftKey),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(t.target,t.buttons,g(null),e=>this._onMouseDownThenMove(e),()=>this._stop()))}_stop(){this._isActive=!1,this._onScrollTimeout.cancel()}onScrollChanged(){this._isActive&&this._onScrollTimeout.setIfNotSet(()=>{if(!this._lastMouseEvent)return;const e=this._findMousePosition(this._lastMouseEvent,!1) +;e&&(this._mouseState.isDragAndDrop||this._dispatchMouse(e,!0))},10)}onCursorStateChanged(e){this._currentSelection=e.selections[0]}_getPositionOutsideEditor(e){const t=e.editorPos,i=this._context.model,n=this._context.viewLayout,o=this._getMouseColumn(e);if(e.posyt.y+t.height){const s=n.getCurrentScrollTop()+(e.posy-t.y),r=a.HitTestContext.getZoneAtCoord(this._context,s);if(r){const e=this._helpPositionJumpOverViewZone(r);if(e)return new a.MouseTarget(null,13,o,e)}const l=n.getLineNumberAtVerticalOffset(s);return new a.MouseTarget(null,13,o,new c.Position(l,i.getLineMaxColumn(l)))}const s=n.getLineNumberAtVerticalOffset(n.getCurrentScrollTop()+(e.posy-t.y)) +;return e.posxt.x+t.width?new a.MouseTarget(null,13,o,new c.Position(s,i.getLineMaxColumn(s))):null}_findMousePosition(e,t){const i=this._getPositionOutsideEditor(e);if(i)return i;const n=this._createMouseTarget(e,t);if(!n.position)return null;if(8===n.type||5===n.type){const e=this._helpPositionJumpOverViewZone(n.detail);if(e)return new a.MouseTarget(n.element,n.type,n.mouseColumn,e,null,n.detail)}return n}_helpPositionJumpOverViewZone(e){const t=new c.Position(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),i=e.positionBefore,n=e.positionAfter;return i&&n?i.isBefore(t)?i:n:null}_dispatchMouse(e,t){e.position&&this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,inSelectionMode:t,mouseDownCount:this._mouseState.count,altKey:this._mouseState.altKey,ctrlKey:this._mouseState.ctrlKey,metaKey:this._mouseState.metaKey, +shiftKey:this._mouseState.shiftKey,leftButton:this._mouseState.leftButton,middleButton:this._mouseState.middleButton})}}class f{constructor(){this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._leftButton=!1,this._middleButton=!1,this._startedOnLineNumbers=!1,this._lastMouseDownPosition=null,this._lastMouseDownPositionEqualCount=0,this._lastMouseDownCount=0,this._lastSetMouseDownCountTime=0,this.isDragAndDrop=!1}get altKey(){return this._altKey}get ctrlKey(){return this._ctrlKey}get metaKey(){return this._metaKey}get shiftKey(){return this._shiftKey}get leftButton(){return this._leftButton}get middleButton(){return this._middleButton}get startedOnLineNumbers(){return this._startedOnLineNumbers}get count(){return this._lastMouseDownCount}setModifiers(e){this._altKey=e.altKey,this._ctrlKey=e.ctrlKey,this._metaKey=e.metaKey,this._shiftKey=e.shiftKey}setStartButtons(e){this._leftButton=e.leftButton,this._middleButton=e.middleButton}setStartedOnLineNumbers(e){this._startedOnLineNumbers=e} +trySetCount(e,t){const i=(new Date).getTime();i-this._lastSetMouseDownCountTime>f.CLEAR_MOUSE_DOWN_COUNT_TIME&&(e=1),this._lastSetMouseDownCountTime=i,e>this._lastMouseDownCount+1&&(e=this._lastMouseDownCount+1),this._lastMouseDownPosition&&this._lastMouseDownPosition.equals(t)?this._lastMouseDownPositionEqualCount++:this._lastMouseDownPositionEqualCount=1,this._lastMouseDownPosition=t,this._lastMouseDownCount=Math.min(e,this._lastMouseDownPositionEqualCount)}}f.CLEAR_MOUSE_DOWN_COUNT_TIME=400})),define(t[586],i([0,1,7,16,58,2,585,155,98]),(function(e,t,i,n,o,s,r,a,l){"use strict";function d(e,t){const i={translationY:t.translationY,translationX:t.translationX};return e&&(i.translationY+=e.translationY,i.translationX+=e.translationX),i}Object.defineProperty(t,"__esModule",{value:!0}),t.PointerHandler=t.PointerEventHandler=void 0;class c extends r.MouseHandler{constructor(e,t,n){super(e,t,n),this.viewHelper.linesContentDomNode.style.touchAction="none",this._installGestureHandlerTimeout=window.setTimeout(()=>{ +if(this._installGestureHandlerTimeout=-1,window.MSGesture){const e=new MSGesture,t=new MSGesture;e.target=this.viewHelper.linesContentDomNode,t.target=this.viewHelper.linesContentDomNode,this.viewHelper.linesContentDomNode.addEventListener("pointerdown",i=>{const n=i.pointerType;"mouse"!==n?"touch"===n?(this._lastPointerType="touch",e.addPointer(i.pointerId)):(this._lastPointerType="pen",t.addPointer(i.pointerId)):this._lastPointerType="mouse"}),this._register(i.addDisposableThrottledListener(this.viewHelper.linesContentDomNode,"MSGestureChange",e=>this._onGestureChange(e),d)),this._register(i.addDisposableListener(this.viewHelper.linesContentDomNode,"MSGestureTap",e=>this._onCaptureGestureTap(e),!0))}},100),this._lastPointerType="mouse"}_onMouseDown(e){"mouse"===this._lastPointerType&&super._onMouseDown(e)}_onCaptureGestureTap(e){const t=new a.EditorMouseEvent(e,this.viewHelper.viewDomNode),i=this._createMouseTarget(t,!1);i.position&&this.viewController.moveTo(i.position), +t.browserEvent.fromElement?(t.preventDefault(),this.viewHelper.focusTextArea()):setTimeout(()=>{this.viewHelper.focusTextArea()})}_onGestureChange(e){this._context.model.deltaScrollNow(-e.translationX,-e.translationY)}dispose(){window.clearTimeout(this._installGestureHandlerTimeout),super.dispose()}}class h extends r.MouseHandler{constructor(e,t,n){super(e,t,n),this._register(o.Gesture.addTarget(this.viewHelper.linesContentDomNode)),this._register(i.addDisposableListener(this.viewHelper.linesContentDomNode,o.EventType.Tap,e=>this.onTap(e))),this._register(i.addDisposableListener(this.viewHelper.linesContentDomNode,o.EventType.Change,e=>this.onChange(e))),this._register(i.addDisposableListener(this.viewHelper.linesContentDomNode,o.EventType.Contextmenu,e=>this._onContextMenu(new a.EditorMouseEvent(e,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(i.addDisposableListener(this.viewHelper.linesContentDomNode,"pointerdown",e=>{const t=e.pointerType +;this._lastPointerType="mouse"!==t?"touch"===t?"touch":"pen":"mouse"}));const s=new a.EditorPointerEventFactory(this.viewHelper.viewDomNode);this._register(s.onPointerMoveThrottled(this.viewHelper.viewDomNode,e=>this._onMouseMove(e),r.createMouseMoveEventMerger(this.mouseTargetFactory),r.MouseHandler.MOUSE_MOVE_MINIMUM_TIME)),this._register(s.onPointerUp(this.viewHelper.viewDomNode,e=>this._onMouseUp(e))),this._register(s.onPointerLeave(this.viewHelper.viewDomNode,e=>this._onMouseLeave(e))),this._register(s.onPointerDown(this.viewHelper.viewDomNode,e=>this._onMouseDown(e)))}onTap(e){if(!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget))return;e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new a.EditorMouseEvent(e,this.viewHelper.viewDomNode),!1);t.position&&this.viewController.dispatchMouse({position:t.position,mouseColumn:t.position.column,startedOnLineNumbers:!1,mouseDownCount:e.tapCount,inSelectionMode:!1,altKey:!1,ctrlKey:!1,metaKey:!1, +shiftKey:!1,leftButton:!1,middleButton:!1})}onChange(e){"touch"===this._lastPointerType&&this._context.model.deltaScrollNow(-e.translationX,-e.translationY)}_onMouseDown(e){e.target&&this.viewHelper.linesContentDomNode.contains(e.target)&&"touch"===this._lastPointerType||super._onMouseDown(e)}}t.PointerEventHandler=h;class u extends r.MouseHandler{constructor(e,t,n){super(e,t,n),this._register(o.Gesture.addTarget(this.viewHelper.linesContentDomNode)),this._register(i.addDisposableListener(this.viewHelper.linesContentDomNode,o.EventType.Tap,e=>this.onTap(e))),this._register(i.addDisposableListener(this.viewHelper.linesContentDomNode,o.EventType.Change,e=>this.onChange(e))),this._register(i.addDisposableListener(this.viewHelper.linesContentDomNode,o.EventType.Contextmenu,e=>this._onContextMenu(new a.EditorMouseEvent(e,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new a.EditorMouseEvent(e,this.viewHelper.viewDomNode),!1) +;t.position&&this.viewController.moveTo(t.position)}onChange(e){this._context.model.deltaScrollNow(-e.translationX,-e.translationY)}}class g extends s.Disposable{constructor(e,t,i){super(),n.isIOS&&l.BrowserFeatures.pointerEvents?this.handler=this._register(new h(e,t,i)):window.TouchEvent?this.handler=this._register(new u(e,t,i)):window.navigator.pointerEnabled||window.PointerEvent?this.handler=this._register(new c(e,t,i)):this.handler=this._register(new r.MouseHandler(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}t.PointerHandler=g})),define(t[250],i([0,1,177]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ViewUserInputEvents=void 0;class n{constructor(e){this.onKeyDown=null,this.onKeyUp=null,this.onContextMenu=null,this.onMouseMove=null,this.onMouseLeave=null,this.onMouseDown=null,this.onMouseUp=null,this.onMouseDrag=null,this.onMouseDrop=null,this.onMouseWheel=null,this._coordinatesConverter=e}emitKeyDown(e){ +this.onKeyDown&&this.onKeyDown(e)}emitKeyUp(e){this.onKeyUp&&this.onKeyUp(e)}emitContextMenu(e){this.onContextMenu&&this.onContextMenu(this._convertViewToModelMouseEvent(e))}emitMouseMove(e){this.onMouseMove&&this.onMouseMove(this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){this.onMouseLeave&&this.onMouseLeave(this._convertViewToModelMouseEvent(e))}emitMouseDown(e){this.onMouseDown&&this.onMouseDown(this._convertViewToModelMouseEvent(e))}emitMouseUp(e){this.onMouseUp&&this.onMouseUp(this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){this.onMouseDrag&&this.onMouseDrag(this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){this.onMouseDrop&&this.onMouseDrop(this._convertViewToModelMouseEvent(e))}emitMouseWheel(e){this.onMouseWheel&&this.onMouseWheel(e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(e){return n.convertViewToModelMouseTarget(e,this._coordinatesConverter)} +static convertViewToModelMouseTarget(e,t){return new o(e.element,e.type,e.mouseColumn,e.position?t.convertViewPositionToModelPosition(e.position):null,e.range?t.convertViewRangeToModelRange(e.range):null,e.detail)}}t.ViewUserInputEvents=n;class o{constructor(e,t,i,n,o,s){this.element=e,this.type=t,this.mouseColumn=i,this.position=n,this.range=o,this.detail=s}toString(){return i.MouseTarget.toString(this)}}})),define(t[587],i([0,1,16,15,67,157,43,249,13,3,103,116,312]),(function(e,t,i,n,o,s,r,a,l,d,c,h){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ViewLines=void 0;class u{constructor(){this._currentVisibleRange=new d.Range(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class g{constructor(e,t,i,n,o,s){this.lineNumber=e,this.startColumn=t,this.endColumn=i,this.startScrollTop=n,this.stopScrollTop=o,this.scrollType=s,this.type="range",this.minLineNumber=e,this.maxLineNumber=e}}class p{constructor(e,t,i,n){ +this.selections=e,this.startScrollTop=t,this.stopScrollTop=i,this.scrollType=n,this.type="selections";let o=e[0].startLineNumber,s=e[0].endLineNumber;for(let t=1,i=e.length;t{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new n.RunOnceScheduler(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new u,this._horizontalRevealRequest=null}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}createVisibleLine(){return new a.ViewLine(this._viewLineOptions)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(118)&&(this._maxLineWidth=0);const t=this._context.configuration.options,i=t.get(36),n=t.get(118);return this._lineHeight=t.get(51),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._isViewportWrapping=n.isViewportWrapping, +this._revealHorizontalRightPadding=t.get(81),this._cursorSurroundingLines=t.get(20),this._cursorSurroundingLinesStyle=t.get(21),this._canUseLayerHinting=!t.get(23),o.Configuration.applyFontInfo(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(117)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new a.ViewLineOptions(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const e=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let t=e;t<=i;t++){this._visibleLines.getVisibleLine(t).onOptionsChanged(this._viewLineOptions)}return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let n=!1;for(let e=t;e<=i;e++)n=this._visibleLines.getVisibleLine(e).onSelectionChanged()||n;return n}onDecorationsChanged(e){{const e=this._visibleLines.getStartLineNumber(),t=this._visibleLines.getEndLineNumber() +;for(let i=e;i<=t;i++)this._visibleLines.getVisibleLine(i).onDecorationsChanged()}return!0}onFlushed(e){const t=this._visibleLines.onFlushed(e);return this._maxLineWidth=0,t}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onRevealRangeRequest(e){const t=this._computeScrollTopToRevealRange(this._context.viewLayout.getFutureViewport(),e.source,e.range,e.selections,e.verticalType);if(-1===t)return!1;let i=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range&&e.range.startLineNumber!==e.range.endLineNumber?i={scrollTop:i.scrollTop,scrollLeft:0 +}:e.range?this._horizontalRevealRequest=new g(e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType):e.selections&&e.selections.length>0&&(this._horizontalRevealRequest=new p(e.selections,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const n=Math.abs(this._context.viewLayout.getCurrentScrollTop()-i.scrollTop)<=this._lineHeight?1:e.scrollType;return this._context.model.setScrollPosition(i,n),!0}onScrollChanged(e){if(this._horizontalRevealRequest&&e.scrollLeftChanged&&(this._horizontalRevealRequest=null),this._horizontalRevealRequest&&e.scrollTopChanged){const t=Math.min(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop),i=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTopi)&&(this._horizontalRevealRequest=null)}return this.domNode.setWidth(e.scrollWidth), +this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._context.model.setMaxLineWidth(this._maxLineWidth),this._visibleLines.onZonesChanged(e)}onThemeChanged(e){return this._onOptionsMaybeChanged()}getPositionFromDOMInfo(e,t){const i=this._getViewLineDomNode(e);if(null===i)return null;const n=this._getLineNumberFor(i);if(-1===n)return null;if(n<1||n>this._context.model.getLineCount())return null;if(1===this._context.model.getLineMaxColumn(n))return new l.Position(n,1);const o=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();if(ns)return null;let r=this._visibleLines.getVisibleLine(n).getColumnOfNodeOffset(n,e,t);const a=this._context.model.getLineMinColumn(n);return ri?-1:this._visibleLines.getVisibleLine(e).getWidth()}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const i=e.endLineNumber,n=d.Range.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!n)return null;let o=[],s=0;const r=new a.DomReadingContext(this.domNode.domNode,this._textRangeRestingSpot);let h=0;t&&(h=this._context.model.coordinatesConverter.convertViewPositionToModelPosition(new l.Position(n.startLineNumber,1)).lineNumber);const u=this._visibleLines.getStartLineNumber(),g=this._visibleLines.getEndLineNumber();for(let e=n.startLineNumber;e<=n.endLineNumber;e++){if(eg)continue +;const a=e===n.startLineNumber?n.startColumn:1,d=e===n.endLineNumber?n.endColumn:this._context.model.getLineMaxColumn(e),p=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(a,d,r);if(p){if(t&&ethis._visibleLines.getEndLineNumber()?null:this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(t,i,new a.DomReadingContext(this.domNode.domNode,this._textRangeRestingSpot))}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new c.HorizontalPosition(t.outsideRenderedLine,t.ranges[0].left):null}updateLineWidths(){this._updateLineWidths(!1)} +_updateLineWidthsFast(){return this._updateLineWidths(!0)}_updateLineWidthsSlow(){this._updateLineWidths(!1)}_updateLineWidths(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let n=1,o=!0;for(let s=t;s<=i;s++){const t=this._visibleLines.getVisibleLine(s);!e||t.getWidthIsFast()?n=Math.max(n,t.getWidth()):o=!1}return o&&1===t&&i===this._context.model.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(n),o}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let o=i;o<=n;o++){const i=this._visibleLines.getVisibleLine(o);if(i.needsMonospaceFontCheck()){const n=i.getWidth();n>t&&(t=n,e=o)}}if(-1!==e&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let e=i;e<=n;e++){this._visibleLines.getVisibleLine(e).onMonospaceAssumptionsInvalidated()}}prepareRender(){throw new Error("Not supported")}render(){throw new Error("Not supported")}renderText(e){ +if(this._visibleLines.renderLines(e),this._lastRenderedData.setCurrentVisibleRange(e.visibleRange),this.domNode.setWidth(this._context.viewLayout.getScrollWidth()),this.domNode.setHeight(Math.min(this._context.viewLayout.getScrollHeight(),1e6)),this._horizontalRevealRequest){const t=this._horizontalRevealRequest;if(e.startLineNumber<=t.minLineNumber&&t.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();const e=this._computeScrollLeftToReveal(t);e&&(this._isViewportWrapping||this._ensureMaxLineWidth(e.maxHorizontalOffset),this._context.model.setScrollPosition({scrollLeft:e.scrollLeft},t.scrollType))}}if(this._updateLineWidthsFast()||this._asyncUpdateLineWidths.schedule(),i.isLinux&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const e=this._visibleLines.getStartLineNumber(),t=this._visibleLines.getEndLineNumber();for(let i=e;i<=t;i++){if(this._visibleLines.getVisibleLine(i).needsMonospaceFontCheck()){this._asyncCheckMonospaceFontAssumptions.schedule();break}}} +this._linesContent.setLayerHinting(this._canUseLayerHinting),this._linesContent.setContain("strict");const t=this._context.viewLayout.getCurrentScrollTop()-e.bigNumbersDelta;this._linesContent.setTop(-t),this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft())}_ensureMaxLineWidth(e){const t=Math.ceil(e);this._maxLineWidth0){let e=n[0].startLineNumber,t=n[0].endLineNumber;for(let i=1,o=n.length;ir){if(!l)return-1;h=d}else if(5===o||6===o)if(6===o&&s<=d&&c<=a)h=s;else{const e=d-Math.max(5*this._lineHeight,.2*r),t=c-r;h=Math.max(t,e)}else if(1===o||2===o)if(2===o&&s<=d&&c<=a)h=s;else{const e=(d+c)/2;h=Math.max(0,e-r/2)}else h=this._computeMinimumScrolling(s,a,d,c,3===o,4===o);return h}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),i=t.left,n=i+t.width;let o=1073741824,s=0;if("range"===e.type){const t=this._visibleRangesForLineRange(e.lineNumber,e.startColumn,e.endColumn);if(!t)return null;for(const e of t.ranges)o=Math.min(o,e.left),s=Math.max(s,e.left+e.width)}else for(const t of e.selections){if(t.startLineNumber!==t.endLineNumber)return null;const e=this._visibleRangesForLineRange(t.startLineNumber,t.startColumn,t.endColumn) +;if(!e)return null;for(const t of e.ranges)o=Math.min(o,t.left),s=Math.max(s,t.left+t.width)}if(o=Math.max(0,o-m.HORIZONTAL_EXTRA_PX),s+=this._revealHorizontalRightPadding,"selections"===e.type&&s-o>t.width)return null;return{scrollLeft:this._computeMinimumScrolling(i,n,o,s),maxHorizontalOffset:s}}_computeMinimumScrolling(e,t,i,n,o,s){o=!!o,s=!!s;const r=(t|=0)-(e|=0);return(n|=0)-(i|=0)t?Math.max(0,n-r):e:i}}t.ViewLines=m,m.HORIZONTAL_EXTRA_PX=30})),define(t[588],i([0,1,7,30,86,2,16,8,157,43,38,3,207,236,70,21,14,20,58,357,52,85,315]),(function(e,t,i,n,o,s,r,a,l,d,c,h,u,g,p,m,f,_,v,C,b,S){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Minimap=void 0;const w=140,y=2;class E{constructor(e,t,i){const n=e.options,o=n.get(115),s=n.get(117),r=s.minimap,a=n.get(36),l=n.get(56);this.renderMinimap=r.renderMinimap,this.size=l.size,this.minimapHeightIsEditorHeight=r.minimapHeightIsEditorHeight,this.scrollBeyondLastLine=n.get(86),this.showSlider=l.showSlider, +this.pixelRatio=o,this.typicalHalfwidthCharacterWidth=a.typicalHalfwidthCharacterWidth,this.lineHeight=n.get(51),this.minimapLeft=r.minimapLeft,this.minimapWidth=r.minimapWidth,this.minimapHeight=s.height,this.canvasInnerWidth=r.minimapCanvasInnerWidth,this.canvasInnerHeight=r.minimapCanvasInnerHeight,this.canvasOuterWidth=r.minimapCanvasOuterWidth,this.canvasOuterHeight=r.minimapCanvasOuterHeight,this.isSampling=r.minimapIsSampling,this.editorHeight=s.height,this.fontScale=r.minimapScale,this.minimapLineHeight=r.minimapLineHeight,this.minimapCharWidth=1*this.fontScale,this.charRenderer=S.once(()=>C.MinimapCharRendererFactory.create(this.fontScale,a.fontFamily)),this.backgroundColor=E._getMinimapBackground(t,i)}static _getMinimapBackground(e,t){const i=e.getColor(m.minimapBackground);return i?new u.RGBA8(i.rgba.r,i.rgba.g,i.rgba.b,i.rgba.a):t.getColor(2)}equals(e){ +return this.renderMinimap===e.renderMinimap&&this.size===e.size&&this.minimapHeightIsEditorHeight===e.minimapHeightIsEditorHeight&&this.scrollBeyondLastLine===e.scrollBeyondLastLine&&this.showSlider===e.showSlider&&this.pixelRatio===e.pixelRatio&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.lineHeight===e.lineHeight&&this.minimapLeft===e.minimapLeft&&this.minimapWidth===e.minimapWidth&&this.minimapHeight===e.minimapHeight&&this.canvasInnerWidth===e.canvasInnerWidth&&this.canvasInnerHeight===e.canvasInnerHeight&&this.canvasOuterWidth===e.canvasOuterWidth&&this.canvasOuterHeight===e.canvasOuterHeight&&this.isSampling===e.isSampling&&this.editorHeight===e.editorHeight&&this.fontScale===e.fontScale&&this.minimapLineHeight===e.minimapLineHeight&&this.minimapCharWidth===e.minimapCharWidth&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)}}class L{constructor(e,t,i,n,o,s,r,a){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=i,this._computedSliderRatio=n, +this.sliderTop=o,this.sliderHeight=s,this.startLineNumber=r,this.endLineNumber=a}getDesiredScrollTopFromDelta(e){const t=this.sliderTop+e;return Math.round(t/this._computedSliderRatio)}getDesiredScrollTopFromTouchLocation(e){return Math.round((e-this.sliderHeight/2)/this._computedSliderRatio)}static create(e,t,i,n,o,s,r,a,l,d){const c=e.pixelRatio,h=e.minimapLineHeight,u=Math.floor(e.canvasInnerHeight/h),g=e.lineHeight;if(e.minimapHeightIsEditorHeight){const t=r*e.lineHeight+(e.scrollBeyondLastLine?n-e.lineHeight:0),i=Math.max(1,Math.floor(n*n/t)),o=Math.max(0,e.minimapHeight-i),d=o/(l-n),c=a*d,h=o>0,u=Math.floor(e.canvasInnerHeight/e.minimapLineHeight);return new L(a,l,h,d,c,i,1,Math.min(s,u))}let p,m;if(o&&i!==s){const e=i-t+1;p=Math.floor(e*h/c)}else{const e=n/g;p=Math.floor(e*h/c)}m=e.scrollBeyondLastLine?(s-1)*h/c:Math.max(0,s*h/c-p);const f=(m=Math.min(e.minimapHeight-p,m))/(l-n),_=a*f;let v=0;if(e.scrollBeyondLastLine){v=n/g-1}if(u>=s+v){return new L(a,l,m>0,f,_,p,1,s)}{ +let e=Math.max(1,Math.floor(t-_*c/h));d&&d.scrollHeight===l&&(d.scrollTop>a&&(e=Math.min(e,d.startLineNumber)),d.scrollTopx.INVALID),this._renderedLines._set(e.startLineNumber,i)}linesEquals(e){if(!this.scrollEquals(e))return!1;const t=this._renderedLines._get().lines;for(let e=0,i=t.length;e1){for(let t=0,i=r-1;t0&&this.minimapLines[i-1]>=e;)i--;let n=this.modelLineToMinimapLine(t)-1;for(;n+1t)return null}return[i+1,n+1]}decorationLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e),n=this.modelLineToMinimapLine(t);return e!==t&&n===i&&(n===this.minimapLines.length?i>1&&i--:n++),[i,n]}onLinesDeleted(e){const t=e.toLineNumber-e.fromLineNumber+1;let i=this.minimapLines.length,n=0;for(let o=this.minimapLines.length-1;o>=0&&!(this.minimapLines[o]=0&&!(this.minimapLines[i]0,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight, +viewportStartLineNumber:t,viewportEndLineNumber:i,scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,viewportWidth:e.viewportWidth,viewportHeight:e.viewportHeight};this._actual.render(n)}_recreateLineSampling(){this._minimapSelections=null;const e=Boolean(this._samplingState),[t,i]=N.compute(this.options,this._context.model.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(const e of i)switch(e.type){case"deleted":this._actual.onLinesDeleted(e.deleteFromLineNumber,e.deleteToLineNumber);break;case"inserted":this._actual.onLinesInserted(e.insertFromLineNumber,e.insertToLineNumber);break;case"flush":this._actual.onFlushed()}}getLineCount(){return this._samplingState?this._samplingState.minimapLines.length:this._context.model.getLineCount()}getRealLineCount(){return this._context.model.getLineCount()}getLineContent(e){return this._samplingState?this._context.model.getLineContent(this._samplingState.minimapLines[e-1]):this._context.model.getLineContent(e)} +getMinimapLinesRenderingData(e,t,i){if(this._samplingState){let n=[];for(let o=0,s=t-e+1;o{if(e.preventDefault(),0===this._model.options.renderMinimap)return;if(!this._lastRenderData)return;if("proportional"!==this._model.options.size){if(e.leftButton&&this._lastRenderData){const t=i.getDomNodePagePosition(this._slider.domNode),n=t.top+t.height/2;this._startSliderDragging(e.buttons,e.posx,n,e.posy,this._lastRenderData.renderedLayout)}return}const t=this._model.options.minimapLineHeight,n=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*e.browserEvent.offsetY;let o=Math.floor(n/t)+this._lastRenderData.renderedLayout.startLineNumber;o=Math.min(o,this._model.getLineCount()),this._model.revealLineNumber(o)}), +this._sliderMouseMoveMonitor=new o.GlobalMouseMoveMonitor,this._sliderMouseDownListener=i.addStandardDisposableListener(this._slider.domNode,"mousedown",e=>{e.preventDefault(),e.stopPropagation(),e.leftButton&&this._lastRenderData&&this._startSliderDragging(e.buttons,e.posx,e.posy,e.posy,this._lastRenderData.renderedLayout)}),this._gestureDisposable=v.Gesture.addTarget(this._domNode.domNode),this._sliderTouchStartListener=i.addDisposableListener(this._domNode.domNode,v.EventType.Start,e=>{e.preventDefault(),e.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(e))},{passive:!1}),this._sliderTouchMoveListener=i.addDisposableListener(this._domNode.domNode,v.EventType.Change,e=>{e.preventDefault(),e.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(e)},{passive:!1}),this._sliderTouchEndListener=i.addStandardDisposableListener(this._domNode.domNode,v.EventType.End,e=>{e.preventDefault(), +e.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName("active",!1)})}_startSliderDragging(e,t,i,n,s){this._slider.toggleClassName("active",!0);const a=(e,n)=>{const o=Math.abs(n-t);if(r.isWindows&&o>w)return void this._model.setScrollTop(s.scrollTop);const a=e-i;this._model.setScrollTop(s.getDesiredScrollTopFromDelta(a))};n!==i&&a(n,t),this._sliderMouseMoveMonitor.startMonitoring(this._slider.domNode,e,o.standardMouseMoveMerger,e=>a(e.posy,e.posx),()=>{this._slider.toggleClassName("active",!1)})}scrollDueToTouchEvent(e){const t=this._domNode.domNode.getBoundingClientRect().top,i=this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY-t);this._model.setScrollTop(i)}dispose(){this._mouseDownListener.dispose(),this._sliderMouseMoveMonitor.dispose(),this._sliderMouseDownListener.dispose(),this._gestureDisposable.dispose(),this._sliderTouchStartListener.dispose(),this._sliderTouchMoveListener.dispose(),this._sliderTouchEndListener.dispose(),super.dispose()} +_getMinimapDomNodeClassName(){return"always"===this._model.options.showSlider?"minimap slider-always":"minimap slider-mouseover"}getDomNode(){return this._domNode}_applyLayout(){this._domNode.setLeft(this._model.options.minimapLeft),this._domNode.setWidth(this._model.options.minimapWidth),this._domNode.setHeight(this._model.options.minimapHeight),this._shadow.setHeight(this._model.options.minimapHeight),this._canvas.setWidth(this._model.options.canvasOuterWidth),this._canvas.setHeight(this._model.options.canvasOuterHeight),this._canvas.domNode.width=this._model.options.canvasInnerWidth,this._canvas.domNode.height=this._model.options.canvasInnerHeight,this._decorationsCanvas.setWidth(this._model.options.canvasOuterWidth),this._decorationsCanvas.setHeight(this._model.options.canvasOuterHeight),this._decorationsCanvas.domNode.width=this._model.options.canvasInnerWidth,this._decorationsCanvas.domNode.height=this._model.options.canvasInnerHeight,this._slider.setWidth(this._model.options.minimapWidth)}_getBuffer(){ +return this._buffers||this._model.options.canvasInnerWidth>0&&this._model.options.canvasInnerHeight>0&&(this._buffers=new k(this._canvas.domNode.getContext("2d"),this._model.options.canvasInnerWidth,this._model.options.canvasInnerHeight,this._model.options.backgroundColor)),this._buffers?this._buffers.getBuffer():null}onDidChangeOptions(){this._lastRenderData=null,this._buffers=null,this._applyLayout(),this._domNode.setClassName(this._getMinimapDomNodeClassName())}onSelectionChanged(){return this._renderDecorations=!0,!0}onDecorationsChanged(){return this._renderDecorations=!0,!0}onFlushed(){return this._lastRenderData=null,!0}onLinesChanged(e,t){return!!this._lastRenderData&&this._lastRenderData.onLinesChanged(e,t)}onLinesDeleted(e,t){return this._lastRenderData&&this._lastRenderData.onLinesDeleted(e,t),!0}onLinesInserted(e,t){return this._lastRenderData&&this._lastRenderData.onLinesInserted(e,t),!0}onScrollChanged(){return this._renderDecorations=!0,!0}onThemeChanged(){ +return this._selectionColor=this._theme.getColor(m.minimapSelection),this._renderDecorations=!0,!0}onTokensChanged(e){return!!this._lastRenderData&&this._lastRenderData.onTokensChanged(e)}onTokensColorsChanged(){return this._lastRenderData=null,this._buffers=null,!0}onZonesChanged(){return this._lastRenderData=null,!0}render(e){if(0===this._model.options.renderMinimap)return this._shadow.setClassName("minimap-shadow-hidden"),this._sliderHorizontal.setWidth(0),void this._sliderHorizontal.setHeight(0);e.scrollLeft+e.viewportWidth>=e.scrollWidth?this._shadow.setClassName("minimap-shadow-hidden"):this._shadow.setClassName("minimap-shadow-visible");const t=L.create(this._model.options,e.viewportStartLineNumber,e.viewportEndLineNumber,e.viewportHeight,e.viewportContainsWhitespaceGaps,this._model.getLineCount(),this._model.getRealLineCount(),e.scrollTop,e.scrollHeight,this._lastRenderData?this._lastRenderData.renderedLayout:null);this._slider.setDisplay(t.sliderNeeded?"block":"none"), +this._slider.setTop(t.sliderTop),this._slider.setHeight(t.sliderHeight);const i=e.scrollLeft/this._model.options.typicalHalfwidthCharacterWidth,n=Math.min(this._model.options.minimapWidth,Math.round(i*this._model.options.minimapCharWidth/this._model.options.pixelRatio));this._sliderHorizontal.setLeft(n),this._sliderHorizontal.setWidth(this._model.options.minimapWidth-n),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(t.sliderHeight),this.renderDecorations(t),this._lastRenderData=this.renderLines(t)}renderDecorations(e){if(this._renderDecorations){this._renderDecorations=!1;const t=this._model.getSelections(),i=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber),{canvasInnerWidth:n,canvasInnerHeight:o}=this._model.options,s=this._model.options.minimapLineHeight,r=this._model.options.minimapCharWidth,a=this._model.getOptions().tabSize,l=this._decorationsCanvas.domNode.getContext("2d");l.clearRect(0,0,n,o);const d=new Map;for(let i=0;ithis._model.options.canvasInnerHeight)return;let g=t.get(s);const p=!g;if(!g){const e=this._model.getLineContent(s);g=[c.MINIMAP_GUTTER_WIDTH];for(let t=1;ts?g.length-1:f-1;if(b>0){const t=g[b]-C||2;this.renderDecoration(e,n,C,u,t,r)}p&&this.renderLineHighlight(e,n,u,r)}renderLineHighlight(e,t,i,n){e.fillStyle=t&&t.transparent(.5).toString()||"",e.fillRect(c.MINIMAP_GUTTER_WIDTH,i,e.canvas.width,n)}renderDecoration(e,t,i,n,o,s){e.fillStyle=t&&t.toString()||"",e.fillRect(i,n,o,s)}renderLines(e){const t=e.startLineNumber,i=e.endLineNumber,n=this._model.options.minimapLineHeight;if(this._lastRenderData&&this._lastRenderData.linesEquals(e)){const t=this._lastRenderData._get();return new D(e,t.imageData,t.lines)}const o=this._getBuffer();if(!o)return null;let[s,r,a]=M._renderUntouchedLines(o,t,i,n,this._lastRenderData) +;const l=this._model.getMinimapLinesRenderingData(t,i,a),d=this._model.getOptions().tabSize,c=this._model.options.backgroundColor,h=this._model.tokensColorTracker,u=h.backgroundIsLight(),g=this._model.options.renderMinimap,p=this._model.options.charRenderer(),m=this._model.options.fontScale,f=this._model.options.minimapCharWidth,_=(1===g?2:3)*m,v=n>_?Math.floor((n-_)/2):0;let C=0;const b=[];for(let e=0,s=i-t+1;e=0&&o_)return;const s=m.charCodeAt(b);if(9===s){const e=h-(b+S)%h;S+=e-1,C+=e*o}else if(32===s)C+=o;else{const c=a.isFullWidthCharacter(s)?2:1;for(let a=0;a_)return}}}}}f.registerThemingParticipant((e,t)=>{const i=e.getColor(m.minimapBackground);i&&t.addRule(`.monaco-editor .minimap > canvas { opacity: ${i.rgba.a}; will-change: opacity; }`) +;const n=e.getColor(m.minimapSliderBackground);n&&t.addRule(`.monaco-editor .minimap-slider .minimap-slider-horizontal { background: ${n}; }`);const o=e.getColor(m.minimapSliderHoverBackground);o&&t.addRule(`.monaco-editor .minimap-slider:hover .minimap-slider-horizontal { background: ${o}; }`);const s=e.getColor(m.minimapSliderActiveBackground);s&&t.addRule(`.monaco-editor .minimap-slider.active .minimap-slider-horizontal { background: ${s}; }`);const r=e.getColor(m.scrollbarShadow);r&&t.addRule(`.monaco-editor .minimap-shadow-visible { box-shadow: ${r} -6px 0 6px -6px inset; }`)})})),define(t[589],i([0,1,30,43,21,14,318]),(function(e,t,i,n,o,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ScrollDecorationViewPart=void 0;class r extends n.ViewPart{constructor(e){super(e),this._scrollTop=0,this._width=0,this._updateWidth(),this._shouldShow=!1;const t=this._context.configuration.options.get(84);this._useShadows=t.useShadows,this._domNode=i.createFastDomNode(document.createElement("div")), +this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true")}dispose(){super.dispose()}_updateShouldShow(){const e=this._useShadows&&this._scrollTop>0;return this._shouldShow!==e&&(this._shouldShow=e,!0)}getDomNode(){return this._domNode}_updateWidth(){const e=this._context.configuration.options.get(117);0===e.minimap.renderMinimap||e.minimap.minimapWidth>0&&0===e.minimap.minimapLeft?this._width=e.width:this._width=e.width-e.minimap.minimapWidth-e.verticalScrollbarWidth}onConfigurationChanged(e){const t=this._context.configuration.options.get(84);return this._useShadows=t.useShadows,this._updateWidth(),this._updateShouldShow(),!0}onScrollChanged(e){return this._scrollTop=e.scrollTop,this._updateShouldShow()}prepareRender(e){}render(e){this._domNode.setWidth(this._width),this._domNode.setClassName(this._shouldShow?"scroll-decoration":"")}}t.ScrollDecorationViewPart=r,s.registerThemingParticipant((e,t)=>{const i=e.getColor(o.scrollbarShadow) +;i&&t.addRule(`.monaco-editor .scroll-decoration { box-shadow: ${i} 0 6px 6px -6px inset; }`)})})),define(t[590],i([0,1,36,90,21,14,319]),(function(e,t,i,n,o,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionsOverlay=void 0;class r{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class a{constructor(e,t){this.lineNumber=e,this.ranges=t}}function l(e){return new r(e)}function d(e){return new a(e.lineNumber,e.ranges.map(l))}const c=i.isEdge;class h extends n.DynamicViewOverlay{constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(51),this._roundedSelection=t.get(82),this._typicalHalfwidthCharacterWidth=t.get(36).typicalHalfwidthCharacterWidth,this._selections=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){ +const t=this._context.configuration.options;return this._lineHeight=t.get(51),this._roundedSelection=t.get(82),this._typicalHalfwidthCharacterWidth=t.get(36).typicalHalfwidthCharacterWidth,!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_visibleRangesHaveGaps(e){for(let t=0,i=e.length;t1)return!0}return!1}_enrichVisibleRangesWithStyle(e,t,i){const n=this._typicalHalfwidthCharacterWidth/4;let o=null,s=null;if(i&&i.length>0&&t.length>0){const n=t[0].lineNumber;if(n===e.startLineNumber)for(let e=0;!o&&e=0;e--)i[e].lineNumber===r&&(s=i[e].ranges[0]);o&&!o.startStyle&&(o=null),s&&!s.startStyle&&(s=null)} +for(let e=0,i=t.length;e0){const i=t[e-1].ranges[0].left,o=t[e-1].ranges[0].left+t[e-1].ranges[0].width;u(a-i)i&&(d.top=1),u(l-o)'}_actualRenderOneSelection(e,t,i,n){ +if(0===n.length)return;const o=!!n[0].ranges[0].startStyle,s=this._lineHeight.toString(),r=(this._lineHeight-1).toString(),a=n[0].lineNumber,l=n[n.length-1].lineNumber;for(let d=0,c=n.length;d1,r)}this._previousFrameVisibleRangesWithStyle=o,this._renderResult=t.map(([e,t])=>e+t)}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}} +function u(e){return e<0?-e:e}t.SelectionsOverlay=h,h.SELECTION_CLASS_NAME="selected-text",h.SELECTION_TOP_LEFT="top-left-radius",h.SELECTION_BOTTOM_LEFT="bottom-left-radius",h.SELECTION_TOP_RIGHT="top-right-radius",h.SELECTION_BOTTOM_RIGHT="bottom-right-radius",h.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background",h.ROUNDED_PIECE_WIDTH=10,s.registerThemingParticipant((e,t)=>{const i=e.getColor(o.editorSelectionBackground);i&&t.addRule(`.monaco-editor .focused .selected-text { background-color: ${i}; }`);const n=e.getColor(o.editorInactiveSelection);n&&t.addRule(`.monaco-editor .selected-text { background-color: ${n}; }`);const s=e.getColor(o.editorSelectionForeground);s&&!s.isTransparent()&&t.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${s}; }`)})})),define(t[49],i([0,1,444,29,21,14]),(function(e,t,i,n,o,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}), +t.overviewRulerInfo=t.overviewRulerWarning=t.overviewRulerError=t.overviewRulerRangeHighlight=t.editorUnnecessaryCodeOpacity=t.editorUnnecessaryCodeBorder=t.editorGutter=t.editorOverviewRulerBackground=t.editorOverviewRulerBorder=t.editorBracketMatchBorder=t.editorBracketMatchBackground=t.editorCodeLensForeground=t.editorRuler=t.editorActiveLineNumber=t.editorLineNumbers=t.editorActiveIndentGuides=t.editorIndentGuides=t.editorWhitespaces=t.editorCursorBackground=t.editorCursorForeground=t.editorSymbolHighlightBorder=t.editorSymbolHighlight=t.editorRangeHighlightBorder=t.editorRangeHighlight=t.editorLineHighlightBorder=t.editorLineHighlight=void 0,t.editorLineHighlight=o.registerColor("editor.lineHighlightBackground",{dark:null,light:null,hc:null},i.localize(0,null)),t.editorLineHighlightBorder=o.registerColor("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hc:"#f38518"},i.localize(1,null)),t.editorRangeHighlight=o.registerColor("editor.rangeHighlightBackground",{dark:"#ffffff0b", +light:"#fdff0033",hc:null},i.localize(2,null),!0),t.editorRangeHighlightBorder=o.registerColor("editor.rangeHighlightBorder",{dark:null,light:null,hc:o.activeContrastBorder},i.localize(3,null),!0),t.editorSymbolHighlight=o.registerColor("editor.symbolHighlightBackground",{dark:o.editorFindMatchHighlight,light:o.editorFindMatchHighlight,hc:null},i.localize(4,null),!0),t.editorSymbolHighlightBorder=o.registerColor("editor.symbolHighlightBorder",{dark:null,light:null,hc:o.activeContrastBorder},i.localize(5,null),!0),t.editorCursorForeground=o.registerColor("editorCursor.foreground",{dark:"#AEAFAD",light:n.Color.black,hc:n.Color.white},i.localize(6,null)),t.editorCursorBackground=o.registerColor("editorCursor.background",null,i.localize(7,null)),t.editorWhitespaces=o.registerColor("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hc:"#e3e4e229"},i.localize(8,null)),t.editorIndentGuides=o.registerColor("editorIndentGuide.background",{dark:t.editorWhitespaces,light:t.editorWhitespaces, +hc:t.editorWhitespaces},i.localize(9,null)),t.editorActiveIndentGuides=o.registerColor("editorIndentGuide.activeBackground",{dark:t.editorWhitespaces,light:t.editorWhitespaces,hc:t.editorWhitespaces},i.localize(10,null)),t.editorLineNumbers=o.registerColor("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hc:n.Color.white},i.localize(11,null));const r=o.registerColor("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hc:o.activeContrastBorder},i.localize(12,null),!1,i.localize(13,null));t.editorActiveLineNumber=o.registerColor("editorLineNumber.activeForeground",{dark:r,light:r,hc:r},i.localize(14,null)),t.editorRuler=o.registerColor("editorRuler.foreground",{dark:"#5A5A5A",light:n.Color.lightgrey,hc:n.Color.white},i.localize(15,null)),t.editorCodeLensForeground=o.registerColor("editorCodeLens.foreground",{dark:"#999999",light:"#999999",hc:"#999999"},i.localize(16,null)),t.editorBracketMatchBackground=o.registerColor("editorBracketMatch.background",{dark:"#0064001a", +light:"#0064001a",hc:"#0064001a"},i.localize(17,null)),t.editorBracketMatchBorder=o.registerColor("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hc:o.contrastBorder},i.localize(18,null)),t.editorOverviewRulerBorder=o.registerColor("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hc:"#7f7f7f4d"},i.localize(19,null)),t.editorOverviewRulerBackground=o.registerColor("editorOverviewRuler.background",null,i.localize(20,null)),t.editorGutter=o.registerColor("editorGutter.background",{dark:o.editorBackground,light:o.editorBackground,hc:o.editorBackground},i.localize(21,null)),t.editorUnnecessaryCodeBorder=o.registerColor("editorUnnecessaryCode.border",{dark:null,light:null,hc:n.Color.fromHex("#fff").transparent(.8)},i.localize(22,null)),t.editorUnnecessaryCodeOpacity=o.registerColor("editorUnnecessaryCode.opacity",{dark:n.Color.fromHex("#000a"),light:n.Color.fromHex("#0007"),hc:null},i.localize(23,null));const a=new n.Color(new n.RGBA(0,122,204,.6)) +;t.overviewRulerRangeHighlight=o.registerColor("editorOverviewRuler.rangeHighlightForeground",{dark:a,light:a,hc:a},i.localize(24,null),!0),t.overviewRulerError=o.registerColor("editorOverviewRuler.errorForeground",{dark:new n.Color(new n.RGBA(255,18,18,.7)),light:new n.Color(new n.RGBA(255,18,18,.7)),hc:new n.Color(new n.RGBA(255,50,50,1))},i.localize(25,null)),t.overviewRulerWarning=o.registerColor("editorOverviewRuler.warningForeground",{dark:o.editorWarningForeground,light:o.editorWarningForeground,hc:o.editorWarningBorder},i.localize(26,null)),t.overviewRulerInfo=o.registerColor("editorOverviewRuler.infoForeground",{dark:o.editorInfoForeground,light:o.editorInfoForeground,hc:o.editorInfoBorder},i.localize(27,null)),s.registerThemingParticipant((e,i)=>{const n=e.getColor(o.editorBackground);n&&i.addRule(`.monaco-editor, .monaco-editor-background, .monaco-editor .inputarea.ime-input { background-color: ${n}; }`);const s=e.getColor(o.editorForeground) +;s&&i.addRule(`.monaco-editor, .monaco-editor .inputarea.ime-input { color: ${s}; }`);const r=e.getColor(t.editorGutter);r&&i.addRule(`.monaco-editor .margin { background-color: ${r}; }`);const a=e.getColor(t.editorRangeHighlight);a&&i.addRule(`.monaco-editor .rangeHighlight { background-color: ${a}; }`);const l=e.getColor(t.editorRangeHighlightBorder);l&&i.addRule(`.monaco-editor .rangeHighlight { border: 1px ${"hc"===e.type?"dotted":"solid"} ${l}; }`);const d=e.getColor(t.editorSymbolHighlight);d&&i.addRule(`.monaco-editor .symbolHighlight { background-color: ${d}; }`);const c=e.getColor(t.editorSymbolHighlightBorder);c&&i.addRule(`.monaco-editor .symbolHighlight { border: 1px ${"hc"===e.type?"dotted":"solid"} ${c}; }`);const h=e.getColor(t.editorWhitespaces);h&&(i.addRule(`.monaco-editor .mtkw { color: ${h} !important; }`),i.addRule(`.monaco-editor .mtkz { color: ${h} !important; }`))})})),define(t[591],i([0,1,90,49,19,14,307]),(function(e,t,i,n,o,s){"use strict";Object.defineProperty(t,"__esModule",{ +value:!0}),t.CurrentLineMarginHighlightOverlay=t.CurrentLineHighlightOverlay=t.AbstractLineHighlightOverlay=void 0;let r=!0;class a extends i.DynamicViewOverlay{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(117);this._lineHeight=t.get(51),this._renderLineHighlight=t.get(77),this._renderLineHightlightOnlyWhenFocus=t.get(78),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[],this._selections=[],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1;const t=r?this._selections.slice(0,1):this._selections,i=t.map(e=>e.positionLineNumber);i.sort((e,t)=>e-t),o.equals(this._cursorLineNumbers,i)||(this._cursorLineNumbers=i,e=!0);const n=t.every(e=>e.isEmpty());return this._selectionIsEmpty!==n&&(this._selectionIsEmpty=n,e=!0),e}onThemeChanged(e){return this._readFromSelections()} +onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(117);return this._lineHeight=t.get(51),this._renderLineHighlight=t.get(77),this._renderLineHightlightOnlyWhenFocus=t.get(78),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,!0}onCursorStateChanged(e){return this._selections=e.selections,this._readFromSelections()}onFlushed(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollWidthChanged||e.scrollTopChanged}onZonesChanged(e){return!0}onFocusChanged(e){return!!this._renderLineHightlightOnlyWhenFocus&&(this._focused=e.isFocused,!0)}prepareRender(e){if(!this._shouldRenderThis())return void(this._renderData=null);const t=this._renderOne(e),i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,o=this._cursorLineNumbers.length;let s=0;const r=[];for(let e=i;e<=n;e++){const n=e-i;for(;s=this._renderData.length?"":this._renderData[i]}}t.AbstractLineHighlightOverlay=a;t.CurrentLineHighlightOverlay=class extends a{_renderOne(e){return`
    `}_shouldRenderThis(){return("line"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&this._selectionIsEmpty&&(!this._renderLineHightlightOnlyWhenFocus||this._focused)}_shouldRenderOther(){return("gutter"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&(!this._renderLineHightlightOnlyWhenFocus||this._focused)}};t.CurrentLineMarginHighlightOverlay=class extends a{_renderOne(e){return`
    `}_shouldRenderThis(){ +return("gutter"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&(!this._renderLineHightlightOnlyWhenFocus||this._focused)}_shouldRenderOther(){return("line"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&this._selectionIsEmpty&&(!this._renderLineHightlightOnlyWhenFocus||this._focused)}},s.registerThemingParticipant((e,t)=>{r=!1;const i=e.getColor(n.editorLineHighlight);if(i&&(t.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${i}; }`),t.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${i}; border: none; }`)),!i||i.isTransparent()||e.defines(n.editorLineHighlightBorder)){const i=e.getColor(n.editorLineHighlightBorder);i&&(r=!0,t.addRule(`.monaco-editor .view-overlays .current-line { border: 2px solid ${i}; }`),t.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { border: 2px solid ${i}; }`),"hc"===e.type&&(t.addRule(".monaco-editor .view-overlays .current-line { border-width: 1px; }"), +t.addRule(".monaco-editor .margin-view-overlays .current-line-margin { border-width: 1px; }")))}})})),define(t[592],i([0,1,90,13,49,14,310]),(function(e,t,i,n,o,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IndentGuidesOverlay=void 0;class r extends i.DynamicViewOverlay{constructor(e){super(),this._context=e,this._primaryLineNumber=0;const t=this._context.configuration.options,i=t.get(118),n=t.get(36);this._lineHeight=t.get(51),this._spaceWidth=n.spaceWidth,this._enabled=t.get(75),this._activeIndentEnabled=t.get(45),this._maxIndentLeft=-1===i.wrappingColumn?-1:i.wrappingColumn*n.typicalHalfwidthCharacterWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(118),n=t.get(36);return this._lineHeight=t.get(51),this._spaceWidth=n.spaceWidth,this._enabled=t.get(75),this._activeIndentEnabled=t.get(45), +this._maxIndentLeft=-1===i.wrappingColumn?-1:i.wrappingColumn*n.typicalHalfwidthCharacterWidth,!0}onCursorStateChanged(e){const t=e.selections[0],i=t.isEmpty()?t.positionLineNumber:0;return this._primaryLineNumber!==i&&(this._primaryLineNumber=i,!0)}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onLanguageConfigurationChanged(e){return!0}prepareRender(e){if(!this._enabled)return void(this._renderResult=null);const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,{indentSize:o}=this._context.model.getTextModelOptions(),s=o*this._spaceWidth,r=e.scrollWidth,a=this._lineHeight,l=this._context.model.getLinesIndentGuides(t,i);let d=0,c=0,h=0;if(this._activeIndentEnabled&&this._primaryLineNumber){const e=this._context.model.getActiveIndentGuide(this._primaryLineNumber,t,i);d=e.startLineNumber,c=e.endLineNumber,h=e.indent}const u=[] +;for(let o=t;o<=i;o++){const i=d<=o&&o<=c,g=o-t,p=l[g];let m="";if(p>=1){const t=e.visibleRangeForPosition(new n.Position(o,1));let l=t?t.left:0;for(let e=1;e<=p;e++){if(m+=`
    `,(l+=s)>r||this._maxIndentLeft>0&&l>this._maxIndentLeft)break}}u[g]=m}this._renderResult=u}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}t.IndentGuidesOverlay=r,s.registerThemingParticipant((e,t)=>{const i=e.getColor(o.editorIndentGuides);i&&t.addRule(`.monaco-editor .lines-content .cigr { box-shadow: 1px 0 0 0 ${i} inset; }`);const n=e.getColor(o.editorActiveIndentGuides)||i;n&&t.addRule(`.monaco-editor .lines-content .cigra { box-shadow: 1px 0 0 0 ${n} inset; }`)})})),define(t[251],i([0,1,16,90,13,49,14,311]),(function(e,t,i,n,o,s,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LineNumbersOverlay=void 0;class a extends n.DynamicViewOverlay{ +constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new o.Position(1,1),this._renderResult=null,this._context.addEventHandler(this)}_readConfig(){const e=this._context.configuration.options;this._lineHeight=e.get(51);const t=e.get(52);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(76);const i=e.get(117);this._lineNumbersLeft=i.lineNumbersLeft,this._lineNumbersWidth=i.lineNumbersWidth}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return this._readConfig(),!0}onCursorStateChanged(e){const t=e.selections[0].getPosition();return this._lastCursorModelPosition=this._context.model.coordinatesConverter.convertViewPositionToModelPosition(t),2===this._renderLineNumbers||3===this._renderLineNumbers}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged} +onZonesChanged(e){return!0}_getLineRenderLineNumber(e){const t=this._context.model.coordinatesConverter.convertViewPositionToModelPosition(new o.Position(e,1));if(1!==t.column)return"";const i=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(i);if(2===this._renderLineNumbers){const e=Math.abs(this._lastCursorModelPosition.lineNumber-i);return 0===e?''+i+"":String(e)}return 3===this._renderLineNumbers?this._lastCursorModelPosition.lineNumber===i?String(i):i%10==0?String(i):"":String(i)}prepareRender(e){if(0===this._renderLineNumbers)return void(this._renderResult=null);const t=i.isLinux?this._lineHeight%2==0?" lh-even":" lh-odd":"",n=e.visibleRange.startLineNumber,o=e.visibleRange.endLineNumber,s='
    ',r=this._context.model.getLineCount(),l=[];for(let e=n;e<=o;e++){const t=e-n +;if(!this._renderFinalNewline&&e===r&&0===this._context.model.getLineLength(e)){l[t]="";continue}const i=this._getLineRenderLineNumber(e);l[t]=i?s+i+"
    ":""}this._renderResult=l}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}t.LineNumbersOverlay=a,a.CLASS_NAME="line-numbers",r.registerThemingParticipant((e,t)=>{const i=e.getColor(s.editorLineNumbers);i&&t.addRule(`.monaco-editor .line-numbers { color: ${i}; }`);const n=e.getColor(s.editorActiveLineNumber);n&&t.addRule(`.monaco-editor .current-line ~ .line-numbers { color: ${n}; }`)})})),define(t[593],i([0,1,431,36,30,16,8,67,208,205,43,251,215,38,99,13,3,20,116,306]),(function(e,t,i,n,o,s,r,a,l,d,c,h,u,g,p,m,f,_,v){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TextAreaHandler=void 0;class C{constructor(e,t,i){this.top=e,this.left=t,this.width=i}setWidth(e){return new C(this.top,this.left,e)}}const b=n.isEdge||n.isFirefox;class S extends c.ViewPart{ +constructor(e,t,r){super(e),this._primaryCursorPosition=new m.Position(1,1),this._primaryCursorVisibleRange=null,this._viewController=t,this._viewHelper=r,this._scrollLeft=0,this._scrollTop=0;const a=this._context.configuration.options,h=a.get(117);this._setAccessibilityOptions(a),this._contentLeft=h.contentLeft,this._contentWidth=h.contentWidth,this._contentHeight=h.height,this._fontInfo=a.get(36),this._lineHeight=a.get(51),this._emptySelectionClipboard=a.get(26),this._copyWithSyntaxHighlighting=a.get(16),this._visibleTextArea=null,this._selections=[new _.Selection(1,1,1,1)],this._modelSelections=[new _.Selection(1,1,1,1)],this._lastRenderPosition=null,this.textArea=o.createFastDomNode(document.createElement("textarea")),c.PartFingerprints.write(this.textArea,6),this.textArea.setClassName(`inputarea ${v.MOUSE_CURSOR_TEXT_CSS_CLASS_NAME}`),this.textArea.setAttribute("wrap","off"),this.textArea.setAttribute("autocorrect","off"),this.textArea.setAttribute("autocapitalize","off"), +this.textArea.setAttribute("autocomplete","off"),this.textArea.setAttribute("spellcheck","false"),this.textArea.setAttribute("aria-label",this._getAriaLabel(a)),this.textArea.setAttribute("tabindex",String(a.get(102))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",i.localize(0,null)),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-haspopup","false"),this.textArea.setAttribute("aria-autocomplete","both"),s.isWeb&&a.get(72)&&this.textArea.setAttribute("readonly","true"),this.textAreaCover=o.createFastDomNode(document.createElement("div")),this.textAreaCover.setPosition("absolute");const u={getLineCount:()=>this._context.model.getLineCount(),getLineMaxColumn:e=>this._context.model.getLineMaxColumn(e),getValueInRange:(e,t)=>this._context.model.getValueInRange(e,t)},g={getDataToCopy:e=>{ +const t=this._context.model.getPlainTextToCopy(this._modelSelections,this._emptySelectionClipboard,s.isWindows),i=this._context.model.getEOL(),n=this._emptySelectionClipboard&&1===this._modelSelections.length&&this._modelSelections[0].isEmpty(),o=Array.isArray(t)?t:null,r=Array.isArray(t)?t.join(i):t;let a=void 0,d=null;if(e&&(l.CopyOptions.forceCopyWithSyntaxHighlighting||this._copyWithSyntaxHighlighting&&r.length<65536)){const e=this._context.model.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);e&&(a=e.html,d=e.mode)}return{isFromEmptySelection:n,multicursorText:o,text:r,html:a,mode:d}},getScreenReaderContent:e=>{if(1===this._accessibilitySupport){if(s.isMacintosh){const e=this._selections[0];if(e.isEmpty()){const t=e.getStartPosition();let i=this._getWordBeforePosition(t);if(0===i.length&&(i=this._getCharacterBeforePosition(t)),i.length>0)return new d.TextAreaState(i,i.length,i.length,t,t)}}return d.TextAreaState.EMPTY} +return d.PagedScreenReaderStrategy.fromEditorSelection(e,u,this._selections[0],this._accessibilityPageSize,0===this._accessibilitySupport)},deduceModelPosition:(e,t,i)=>this._context.model.deduceModelPositionRelativeToViewPosition(e,t,i)};this._textAreaInput=this._register(new l.TextAreaInput(g,this.textArea)),this._register(this._textAreaInput.onKeyDown(e=>{this._viewController.emitKeyDown(e)})),this._register(this._textAreaInput.onKeyUp(e=>{this._viewController.emitKeyUp(e)})),this._register(this._textAreaInput.onPaste(e=>{let t=!1,i=null,n=null;e.metadata&&(t=this._emptySelectionClipboard&&!!e.metadata.isFromEmptySelection,i=void 0!==e.metadata.multicursorText?e.metadata.multicursorText:null,n=e.metadata.mode),this._viewController.paste(e.text,t,i,n)})),this._register(this._textAreaInput.onCut(()=>{this._viewController.cut()})),this._register(this._textAreaInput.onType(e=>{e.replaceCharCnt?this._viewController.replacePreviousChar(e.text,e.replaceCharCnt):this._viewController.type(e.text)})), +this._register(this._textAreaInput.onSelectionChangeRequest(e=>{this._viewController.setSelection(e)})),this._register(this._textAreaInput.onCompositionStart(e=>{const t=this._selections[0].startLineNumber,i=this._selections[0].startColumn-(e.moveOneCharacterLeft?1:0);this._context.model.revealRange("keyboard",!0,new f.Range(t,i,t,i),0,1);const n=this._viewHelper.visibleRangeForPositionRelativeToEditor(t,i);n&&(this._visibleTextArea=new C(this._context.viewLayout.getVerticalOffsetForLineNumber(t),n.left,b?0:1),this._render()),this.textArea.setClassName(`inputarea ${v.MOUSE_CURSOR_TEXT_CSS_CLASS_NAME} ime-input`),this._viewController.compositionStart()})),this._register(this._textAreaInput.onCompositionUpdate(e=>{n.isEdge?this._visibleTextArea=this._visibleTextArea.setWidth(0):this._visibleTextArea=this._visibleTextArea.setWidth(function(e,t){const i=document.createElement("canvas").getContext("2d");i.font=(o=t,s="normal",r=o.fontWeight,a=o.fontSize,l=o.lineHeight,d=o.fontFamily, +`${s} normal ${r} ${a}px / ${l}px ${d}`);var o,s,r,a,l,d;const c=i.measureText(e);return n.isFirefox?c.width+2:c.width}(e.data,this._fontInfo)),this._render()})),this._register(this._textAreaInput.onCompositionEnd(()=>{this._visibleTextArea=null,this._render(),this.textArea.setClassName(`inputarea ${v.MOUSE_CURSOR_TEXT_CSS_CLASS_NAME}`),this._viewController.compositionEnd()})),this._register(this._textAreaInput.onFocus(()=>{this._context.model.setHasFocus(!0)})),this._register(this._textAreaInput.onBlur(()=>{this._context.model.setHasFocus(!1)}))}dispose(){super.dispose()}_getWordBeforePosition(e){const t=this._context.model.getLineContent(e.lineNumber),i=p.getMapForWordSeparators(this._context.configuration.options.get(105));let n=e.column,o=0;for(;n>1;){const s=t.charCodeAt(n-2);if(0!==i.get(s)||o>50)return t.substring(n-1,e.column-1);o++,n--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){const t=this._context.model.getLineContent(e.lineNumber).charAt(e.column-2) +;if(!r.isHighSurrogate(t.charCodeAt(0)))return t}return""}_getAriaLabel(e){return 1===e.get(2)?i.localize(1,null,s.isLinux?"Shift+Alt+F1":"Alt+F1"):e.get(4)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);const t=e.get(3);2===this._accessibilitySupport&&t===g.EditorOptions.accessibilityPageSize.defaultValue?this._accessibilityPageSize=100:this._accessibilityPageSize=t}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(117);return this._setAccessibilityOptions(t),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._contentHeight=i.height,this._fontInfo=t.get(36),this._lineHeight=t.get(51),this._emptySelectionClipboard=t.get(26),this._copyWithSyntaxHighlighting=t.get(16),this.textArea.setAttribute("aria-label",this._getAriaLabel(t)),this.textArea.setAttribute("tabindex",String(t.get(102))),s.isWeb&&e.hasChanged(72)&&(t.get(72)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")), +e.hasChanged(2)&&this._textAreaInput.writeScreenReaderContent("strategy changed"),!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),this._modelSelections=e.modelSelections.slice(0),this._textAreaInput.writeScreenReaderContent("selection changed"),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0}onZonesChanged(e){return!0}isFocused(){return this._textAreaInput.isFocused()}focusTextArea(){this._textAreaInput.focusTextArea()}getLastRenderData(){return this._lastRenderPosition}setAriaOptions(e){e.activeDescendant?(this.textArea.setAttribute("aria-haspopup","true"),this.textArea.setAttribute("aria-autocomplete","list"),this.textArea.setAttribute("aria-activedescendant",e.activeDescendant)):(this.textArea.setAttribute("aria-haspopup","false"),this.textArea.setAttribute("aria-autocomplete","both"), +this.textArea.removeAttribute("aria-activedescendant")),e.role&&this.textArea.setAttribute("role",e.role)}prepareRender(e){this._primaryCursorPosition=new m.Position(this._selections[0].positionLineNumber,this._selections[0].positionColumn),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primaryCursorPosition)}render(e){this._textAreaInput.writeScreenReaderContent("render"),this._render()}_render(){if(this._visibleTextArea)return void this._renderInsideEditor(null,this._visibleTextArea.top-this._scrollTop,this._contentLeft+this._visibleTextArea.left-this._scrollLeft,this._visibleTextArea.width,this._lineHeight);if(!this._primaryCursorVisibleRange)return void this._renderAtTopLeft();const e=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(ethis._contentLeft+this._contentWidth)return void this._renderAtTopLeft();const t=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop +;t<0||t>this._contentHeight?this._renderAtTopLeft():s.isMacintosh?this._renderInsideEditor(this._primaryCursorPosition,t,e,b?0:1,this._lineHeight):this._renderInsideEditor(this._primaryCursorPosition,t,e,b?0:1,b?0:1)}_renderInsideEditor(e,t,i,n,o){this._lastRenderPosition=e;const s=this.textArea,r=this.textAreaCover;a.Configuration.applyFontInfo(s,this._fontInfo),s.setTop(t),s.setLeft(i),s.setWidth(n),s.setHeight(o),r.setTop(0),r.setLeft(0),r.setWidth(0),r.setHeight(0)}_renderAtTopLeft(){this._lastRenderPosition=null;const e=this.textArea,t=this.textAreaCover;if(a.Configuration.applyFontInfo(e,this._fontInfo),e.setTop(0),e.setLeft(0),t.setTop(0),t.setLeft(0),b)return e.setWidth(0),e.setHeight(0),t.setWidth(0),void t.setHeight(0);e.setWidth(1),e.setHeight(1),t.setWidth(1),t.setHeight(1);const i=this._context.configuration.options +;i.get(42)?t.setClassName("monaco-editor-background textAreaCover "+u.Margin.OUTER_CLASS_NAME):0!==i.get(52).renderType?t.setClassName("monaco-editor-background textAreaCover "+h.LineNumbersOverlay.CLASS_NAME):t.setClassName("monaco-editor-background textAreaCover")}}t.TextAreaHandler=S})),define(t[594],i([0,1,30,29,43,13,18,49]),(function(e,t,i,n,o,s,r,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DecorationsOverviewRuler=void 0;class l{constructor(e,t){const i=e.options;this.lineHeight=i.get(51),this.pixelRatio=i.get(115),this.overviewRulerLanes=i.get(65),this.renderBorder=i.get(64);const o=t.getColor(a.editorOverviewRulerBorder);this.borderColor=o?o.toString():null,this.hideCursor=i.get(44);const s=t.getColor(a.editorCursorForeground);this.cursorColor=s?s.transparent(.7).toString():null,this.themeType=t.type;const l=i.get(56),d=l.enabled,c=l.side,h=d?t.getColor(a.editorOverviewRulerBackground)||r.TokenizationRegistry.getDefaultBackground():null +;this.backgroundColor=null===h||"left"===c?null:n.Color.Format.CSS.formatHex(h);const u=i.get(117).overviewRuler;this.top=u.top,this.right=u.right,this.domWidth=u.width,this.domHeight=u.height,0===this.overviewRulerLanes?(this.canvasWidth=0,this.canvasHeight=0):(this.canvasWidth=this.domWidth*this.pixelRatio|0,this.canvasHeight=this.domHeight*this.pixelRatio|0);const[g,p]=this._initLanes(1,this.canvasWidth,this.overviewRulerLanes);this.x=g,this.w=p}_initLanes(e,t,i){const n=t-e;if(i>=3){const t=Math.floor(n/3),i=Math.floor(n/3),o=n-t-i,s=e+t;return[[0,e,s,e,e+t+o,e,s,e],[0,t,o,t+o,i,t+o+i,o+i,t+o+i]]}if(2===i){const t=Math.floor(n/2),i=n-t;return[[0,e,e,e,e+t,e,e,e],[0,t,t,t,i,t+i,t+i,t+i]]}return[[0,e,e,e,e,e,e,e],[0,n,n,n,n,n,n,n]]}equals(e){ +return this.lineHeight===e.lineHeight&&this.pixelRatio===e.pixelRatio&&this.overviewRulerLanes===e.overviewRulerLanes&&this.renderBorder===e.renderBorder&&this.borderColor===e.borderColor&&this.hideCursor===e.hideCursor&&this.cursorColor===e.cursorColor&&this.themeType===e.themeType&&this.backgroundColor===e.backgroundColor&&this.top===e.top&&this.right===e.right&&this.domWidth===e.domWidth&&this.domHeight===e.domHeight&&this.canvasWidth===e.canvasWidth&&this.canvasHeight===e.canvasHeight}}class d extends o.ViewPart{constructor(e){super(e),this._domNode=i.createFastDomNode(document.createElement("canvas")),this._domNode.setClassName("decorationsOverviewRuler"),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._domNode.setAttribute("aria-hidden","true"),this._updateSettings(!1),this._tokensColorTrackerListener=r.TokenizationRegistry.onDidChange(e=>{e.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[]}dispose(){super.dispose(), +this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new l(this._context.configuration,this._context.theme);return(!this._settings||!this._settings.equals(t))&&(this._settings=t,this._domNode.setTop(this._settings.top),this._domNode.setRight(this._settings.right),this._domNode.setWidth(this._settings.domWidth),this._domNode.setHeight(this._settings.domHeight),this._domNode.domNode.width=this._settings.canvasWidth,this._domNode.domNode.height=this._settings.canvasHeight,e&&this._render(),!0)}onConfigurationChanged(e){return this._updateSettings(!1)}onCursorStateChanged(e){this._cursorPositions=[];for(let t=0,i=e.selections.length;tt&&(e=t-a),_=e-a,v=e+a}_>f+1||s!==p?(0!==e&&l.fillRect(d[p],m,c[p],f-m),p=s,m=_,f=v):v>f&&(f=v)}l.fillRect(d[p],m,c[p],f-m)}if(!this._settings.hideCursor&&this._settings.cursorColor){const e=2*this._settings.pixelRatio|0,i=e/2|0,s=this._settings.x[7],r=this._settings.w[7];l.fillStyle=this._settings.cursorColor;let a=-100,d=-100;for(let c=0,h=this._cursorPositions.length;ct&&(u=t-i);const g=u-i,p=g+e;g>d+1?(0!==c&&l.fillRect(s,a,r,d-a),a=g,d=p):p>d&&(d=p)}l.fillRect(s,a,r,d-a)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(l.beginPath(),l.lineWidth=1,l.strokeStyle=this._settings.borderColor,l.moveTo(0,0),l.lineTo(0,t),l.stroke(),l.moveTo(0,0),l.lineTo(e,0),l.stroke())}}t.DecorationsOverviewRuler=d})), +define(t[595],i([0,1,30,43,49,14,317]),(function(e,t,i,n,o,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Rulers=void 0;class r extends n.ViewPart{constructor(e){super(e),this.domNode=i.createFastDomNode(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("view-rulers"),this._renderedRulers=[];const t=this._context.configuration.options;this._rulers=t.get(83),this._typicalHalfwidthCharacterWidth=t.get(36).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._rulers=t.get(83),this._typicalHalfwidthCharacterWidth=t.get(36).typicalHalfwidthCharacterWidth,!0}onScrollChanged(e){return e.scrollHeightChanged}prepareRender(e){}_ensureRulersCount(){const e=this._renderedRulers.length,t=this._rulers.length;if(e===t)return;if(e0;){ +const e=i.createFastDomNode(document.createElement("div"));e.setClassName("view-ruler"),e.setWidth(o),this.domNode.appendChild(e),this._renderedRulers.push(e),s--}return}let n=e-t;for(;n>0;){const e=this._renderedRulers.pop();this.domNode.removeChild(e),n--}}render(e){this._ensureRulersCount();for(let t=0,i=this._rulers.length;t{const i=e.getColor(o.editorRuler);i&&t.addRule(`.monaco-editor .view-ruler { box-shadow: 1px 0 0 0 ${i} inset; }`)})})),define(t[596],i([0,1,30,15,43,544,38,49,14,320]),(function(e,t,i,n,o,s,r,a,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ViewCursors=void 0;class d extends o.ViewPart{constructor(e){super(e);const t=this._context.configuration.options;this._readOnly=t.get(72), +this._cursorBlinking=t.get(17),this._cursorStyle=t.get(19),this._cursorSmoothCaretAnimation=t.get(18),this._selectionIsEmpty=!0,this._isVisible=!1,this._primaryCursor=new s.ViewCursor(this._context),this._secondaryCursors=[],this._renderData=[],this._domNode=i.createFastDomNode(document.createElement("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._updateDomClassName(),this._domNode.appendChild(this._primaryCursor.getDomNode()),this._startCursorBlinkAnimation=new n.TimeoutTimer,this._cursorFlatBlinkInterval=new n.IntervalTimer,this._blinkingEnabled=!1,this._editorHasFocus=!1,this._updateBlinking()}dispose(){super.dispose(),this._startCursorBlinkAnimation.dispose(),this._cursorFlatBlinkInterval.dispose()}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options;this._readOnly=t.get(72),this._cursorBlinking=t.get(17),this._cursorStyle=t.get(19),this._cursorSmoothCaretAnimation=t.get(18), +this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let t=0,i=this._secondaryCursors.length;tt.length){const e=this._secondaryCursors.length-t.length;for(let t=0;t{for(let i=0,n=e.ranges.length;i{this._isVisible?this._hide():this._show()},d.BLINK_INTERVAL):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},d.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case r.TextEditorCursorStyle.Line:e+=" cursor-line-style";break;case r.TextEditorCursorStyle.Block:e+=" cursor-block-style";break;case r.TextEditorCursorStyle.Underline:e+=" cursor-underline-style";break;case r.TextEditorCursorStyle.LineThin:e+=" cursor-line-thin-style";break;case r.TextEditorCursorStyle.BlockOutline:e+=" cursor-block-outline-style";break;case r.TextEditorCursorStyle.UnderlineThin:e+=" cursor-underline-thin-style";break;default:e+=" cursor-line-style"}if(this._blinkingEnabled)switch(this._getCursorBlinking()){case 1: +e+=" cursor-blink";break;case 2:e+=" cursor-smooth";break;case 3:e+=" cursor-phase";break;case 4:e+=" cursor-expand";break;case 5:e+=" cursor-solid";break;default:e+=" cursor-solid"}else e+=" cursor-solid";return this._cursorSmoothCaretAnimation&&(e+=" cursor-smooth-caret-animation"),e}_show(){this._primaryCursor.show();for(let e=0,t=this._secondaryCursors.length;e{const i=e.getColor(a.editorCursorForeground);if(i){let n=e.getColor(a.editorCursorBackground);n||(n=i.opposite()),t.addRule(`.monaco-editor .cursors-layer .cursor { background-color: ${i}; border-color: ${i}; color: ${n}; }`),"hc"===e.type&&t.addRule(`.monaco-editor .cursors-layer.has-selection .cursor { border-left: 1px solid ${n}; border-right: 1px solid ${n}; }`)}})})),define(t[597],i([0,1,7,20,30,12,586,593,556,250,543,43,381,591,382,584,164,592,251,587,383,215,384,588,385,594,386,595,589,590,596,387,13,3,103,376,378,104,14,177]),(function(e,t,i,n,o,s,r,a,l,d,c,h,u,g,p,m,f,_,v,C,b,S,w,y,E,L,x,D,k,N,I,M,R,T,O,A,P,F,W,B){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.View=void 0;class V extends F.ViewEventHandler{constructor(e,t,i,s,d,x){super(),this._selections=[new n.Selection(1,1,1,1)],this._renderAnimationFrame=null;const R=new l.ViewController(t,s,d,e);this._context=new A.ViewContext(t,i.getColorTheme(),s),this._context.addEventHandler(this), +this._register(i.onDidColorThemeChange(e=>{this._context.theme.update(e),this._context.model.onDidColorThemeChange(),this.render(!0,!1)})),this._viewParts=[],this._textAreaHandler=new a.TextAreaHandler(this._context,R,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=o.createFastDomNode(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=o.createFastDomNode(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=o.createFastDomNode(document.createElement("div")),h.PartFingerprints.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new m.EditorScrollbar(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar), +this._viewLines=new C.ViewLines(this._context,this._linesContent),this._viewZones=new M.ViewZones(this._context),this._viewParts.push(this._viewZones);const T=new L.DecorationsOverviewRuler(this._context);this._viewParts.push(T);const O=new k.ScrollDecorationViewPart(this._context);this._viewParts.push(O);const P=new c.ContentViewOverlays(this._context);this._viewParts.push(P),P.addDynamicOverlay(new g.CurrentLineHighlightOverlay(this._context)),P.addDynamicOverlay(new N.SelectionsOverlay(this._context)),P.addDynamicOverlay(new _.IndentGuidesOverlay(this._context)),P.addDynamicOverlay(new p.DecorationsOverlay(this._context));const F=new c.MarginViewOverlays(this._context);this._viewParts.push(F),F.addDynamicOverlay(new g.CurrentLineMarginHighlightOverlay(this._context)),F.addDynamicOverlay(new f.GlyphMarginOverlay(this._context)),F.addDynamicOverlay(new w.MarginViewLineDecorationsOverlay(this._context)),F.addDynamicOverlay(new b.LinesDecorationsOverlay(this._context)), +F.addDynamicOverlay(new v.LineNumbersOverlay(this._context));const W=new S.Margin(this._context);W.getDomNode().appendChild(this._viewZones.marginDomNode),W.getDomNode().appendChild(F.getDomNode()),this._viewParts.push(W),this._contentWidgets=new u.ViewContentWidgets(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new I.ViewCursors(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new E.ViewOverlayWidgets(this._context),this._viewParts.push(this._overlayWidgets);const B=new D.Rulers(this._context);this._viewParts.push(B);const V=new y.Minimap(this._context);if(this._viewParts.push(V),T){const e=this._scrollbar.getOverviewRulerLayoutInfo();e.parent.insertBefore(T.getDomNode(),e.insertBefore)}this._linesContent.appendChild(P.getDomNode()),this._linesContent.appendChild(B.domNode),this._linesContent.appendChild(this._viewZones.domNode),this._linesContent.appendChild(this._viewLines.getDomNode()), +this._linesContent.appendChild(this._contentWidgets.domNode),this._linesContent.appendChild(this._viewCursors.getDomNode()),this._overflowGuardContainer.appendChild(W.getDomNode()),this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()),this._overflowGuardContainer.appendChild(O.getDomNode()),this._overflowGuardContainer.appendChild(this._textAreaHandler.textArea),this._overflowGuardContainer.appendChild(this._textAreaHandler.textAreaCover),this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()),this._overflowGuardContainer.appendChild(V.getDomNode()),this.domNode.appendChild(this._overflowGuardContainer),x?x.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode):this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this._applyLayout(),this._pointerHandler=this._register(new r.PointerHandler(this._context,R,this._createPointerHandlerHelper()))}_flushAccumulatedAndRenderNow(){this._renderNow()}_createPointerHandlerHelper(){return{ +viewDomNode:this.domNode.domNode,linesContentDomNode:this._linesContent.domNode,focusTextArea:()=>{this.focus()},getLastRenderData:()=>{const e=this._viewCursors.getLastRenderData()||[],t=this._textAreaHandler.getLastRenderData();return new B.PointerHandlerLastRenderData(e,t)},shouldSuppressMouseDownOnViewZone:e=>this._viewZones.shouldSuppressMouseDownOnViewZone(e),shouldSuppressMouseDownOnWidget:e=>this._contentWidgets.shouldSuppressMouseDownOnWidget(e),getPositionFromDOMInfo:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getPositionFromDOMInfo(e,t)),visibleRangeForPosition:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(new R.Position(e,t))),getLineWidth:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getLineWidth(e))}}_createTextAreaHandlerHelper(){return{visibleRangeForPositionRelativeToEditor:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(new R.Position(e,t)))}}_applyLayout(){ +const e=this._context.configuration.options.get(117);this.domNode.setWidth(e.width),this.domNode.setHeight(e.height),this._overflowGuardContainer.setWidth(e.width),this._overflowGuardContainer.setHeight(e.height),this._linesContent.setWidth(1e6),this._linesContent.setHeight(1e6)}_getEditorClassName(){const e=this._textAreaHandler.isFocused()?" focused":"";return this._context.configuration.options.get(114)+" "+W.getThemeTypeSelector(this._context.theme.type)+e}handleEvents(e){super.handleEvents(e),this._scheduleRender()}onConfigurationChanged(e){return this.domNode.setClassName(this._getEditorClassName()),this._applyLayout(),!1}onCursorStateChanged(e){return this._selections=e.selections,!1}onFocusChanged(e){return this.domNode.setClassName(this._getEditorClassName()),!1}onThemeChanged(e){return this.domNode.setClassName(this._getEditorClassName()),!1}dispose(){null!==this._renderAnimationFrame&&(this._renderAnimationFrame.dispose(),this._renderAnimationFrame=null), +this._contentWidgets.overflowingContentWidgetsDomNode.domNode.remove(),this._context.removeEventHandler(this),this._viewLines.dispose();for(let e=0,t=this._viewParts.length;ethis._actualRender())}_getViewPartsToRender(){let e=[],t=0;for(let i=0,n=this._viewParts.length;i{this._onDidChangeConfiguration.fire(e);const t=this._configuration.options;if(e.hasChanged(117)){const e=t.get(117);this._onDidLayoutChange.fire(e)}})),this._contextKeyService=this._register(l.createScoped(this._domElement)),this._notificationService=c,this._codeEditorService=r,this._commandService=a,this._themeService=d,this._register(new K(this,this._contextKeyService)),this._register(new U(this,this._contextKeyService)),this._instantiationService=n.createChild(new M.ServiceCollection([N.IContextKeyService,this._contextKeyService])),this._modelData=null,this._contributions={},this._actions={}, +this._focusTracker=new $(e),this._focusTracker.onChange(()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())}),this._contentWidgets={},this._overlayWidgets={},g=Array.isArray(i.contributions)?i.contributions:h.EditorExtensionsRegistry.getEditorContributions();for(const e of g)try{const t=this._instantiationService.createInstance(e.ctor,this);this._contributions[e.id]=t}catch(e){o.onUnexpectedError(e)}h.EditorExtensionsRegistry.getEditorActions().forEach(e=>{const t=new S.InternalEditorAction(e.id,e.label,e.alias,A.withNullAsUndefined(e.precondition),()=>this._instantiationService.invokeFunction(t=>Promise.resolve(e.runEditorCommand(t,this,null))),this._contextKeyService);this._actions[t.id]=t}),this._codeEditorService.addCodeEditor(this)}_createConfiguration(e,t){return new c.Configuration(this.isSimpleWidget,e,this._domElement,t)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return w.EditorType.ICodeEditor}dispose(){this._codeEditorService.removeCodeEditor(this), +this._focusTracker.dispose();const e=Object.keys(this._contributions);for(let t=0,i=e.length;tC.Range.lift(e)))}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return _.CursorColumns.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,i)+1}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e){ +if(this._modelData){if(!v.Position.isIPosition(e))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections("api",[{selectionStartLineNumber:e.lineNumber,selectionStartColumn:e.column,positionLineNumber:e.lineNumber,positionColumn:e.column}])}}_sendRevealRange(e,t,i,n){if(!this._modelData)return;if(!C.Range.isIRange(e))throw new Error("Invalid arguments");const o=this._modelData.model.validateRange(e),s=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(o);this._modelData.viewModel.revealRange("api",i,s,t,n)}revealLine(e,t=0){this._revealLine(e,0,t)}revealLineInCenter(e,t=0){this._revealLine(e,1,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._revealLine(e,2,t)}revealLineNearTop(e,t=0){this._revealLine(e,5,t)}_revealLine(e,t,i){if("number"!=typeof e)throw new Error("Invalid arguments");this._sendRevealRange(new C.Range(e,1,e,1),t,!1,i)}revealPosition(e,t=0){this._revealPosition(e,0,!0,t)}revealPositionInCenter(e,t=0){this._revealPosition(e,1,!0,t)} +revealPositionInCenterIfOutsideViewport(e,t=0){this._revealPosition(e,2,!0,t)}revealPositionNearTop(e,t=0){this._revealPosition(e,5,!0,t)}_revealPosition(e,t,i,n){if(!v.Position.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new C.Range(e.lineNumber,e.column,e.lineNumber,e.column),t,i,n)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e){const t=b.Selection.isISelection(e),i=C.Range.isIRange(e);if(!t&&!i)throw new Error("Invalid arguments");if(t)this._setSelectionImpl(e);else if(i){const t={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(t)}}_setSelectionImpl(e){if(!this._modelData)return;const t=new b.Selection(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn) +;this._modelData.viewModel.setSelections("api",[t])}revealLines(e,t,i=0){this._revealLines(e,t,0,i)}revealLinesInCenter(e,t,i=0){this._revealLines(e,t,1,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._revealLines(e,t,2,i)}revealLinesNearTop(e,t,i=0){this._revealLines(e,t,5,i)}_revealLines(e,t,i,n){if("number"!=typeof e||"number"!=typeof t)throw new Error("Invalid arguments");this._sendRevealRange(new C.Range(e,1,t,1),i,!1,n)}revealRange(e,t=0,i=!1,n=!0){this._revealRange(e,i?1:0,n,t)}revealRangeInCenter(e,t=0){this._revealRange(e,1,!0,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._revealRange(e,2,!0,t)}revealRangeNearTop(e,t=0){this._revealRange(e,5,!0,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._revealRange(e,6,!0,t)}revealRangeAtTop(e,t=0){this._revealRange(e,3,!0,t)}_revealRange(e,t,i,n){if(!C.Range.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(C.Range.lift(e),t,i,n)}setSelections(e,t="api"){if(this._modelData){ +if(!e||0===e.length)throw new Error("Invalid arguments");for(let t=0,i=e.length;te.isSupported())}getAction(e){return this._actions[e]||null}trigger(e,t,i){switch(i=i||{},t){case"compositionStart":return void this._startComposition();case"compositionEnd":return void this._endComposition(e);case"type":{const t=i;return void this._type(e,t.text||"")}case"replacePreviousChar":{const t=i;return void this._replacePreviousChar(e,t.text||"",t.replaceCharCnt||0)}case"paste":{const t=i;return void this._paste(e,t.text||"",t.pasteOnNewLine||!1,t.multicursorText||null,t.mode||null)}case"cut":return void this._cut(e)}const n=this.getAction(t) +;n?Promise.resolve(n.run()).then(void 0,o.onUnexpectedError):this._modelData&&this._triggerEditorCommand(e,t,i)}_startComposition(){this._modelData&&(this._modelData.viewModel.startComposition(),this._onDidCompositionStart.fire())}_endComposition(e){this._modelData&&(this._modelData.viewModel.endComposition(e),this._onDidCompositionEnd.fire())}_type(e,t){this._modelData&&0!==t.length&&("keyboard"===e&&this._onWillType.fire(t),this._modelData.viewModel.type(t,e),"keyboard"===e&&this._onDidType.fire(t))}_replacePreviousChar(e,t,i){this._modelData&&this._modelData.viewModel.replacePreviousChar(t,i,e)}_paste(e,t,i,n,o){if(!this._modelData||0===t.length)return;const s=this._modelData.viewModel.getSelection().getStartPosition();this._modelData.viewModel.paste(t,i,n,e);const r=this._modelData.viewModel.getSelection().getStartPosition();"keyboard"===e&&this._onDidPaste.fire({range:new C.Range(s.lineNumber,s.column,r.lineNumber,r.column),mode:o})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)} +_triggerEditorCommand(e,t,i){const n=h.EditorExtensionsRegistry.getEditorCommand(t);return!!n&&((i=i||{}).source=e,this._instantiationService.invokeFunction(e=>{Promise.resolve(n.runEditorCommand(e,this,i)).then(void 0,o.onUnexpectedError)}),!0)}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!!this._modelData&&(!this._configuration.options.get(72)&&(this._modelData.model.pushStackElement(),!0))}executeEdits(e,t,i){if(!this._modelData)return!1;if(this._configuration.options.get(72))return!1;let n;return n=i?Array.isArray(i)?()=>i:i:()=>null,this._modelData.viewModel.executeEdits(e,t,n),!0}executeCommand(e,t){this._modelData&&this._modelData.viewModel.executeCommand(t,e)}executeCommands(e,t){this._modelData&&this._modelData.viewModel.executeCommands(t,e)}changeDecorations(e){return this._modelData?this._modelData.model.changeDecorations(e,this._id):null}getLineDecorations(e){ +return this._modelData?this._modelData.model.getLineDecorations(e,this._id,m.filterValidationDecorations(this._configuration.options)):null}deltaDecorations(e,t){return this._modelData?0===e.length&&0===t.length?e:this._modelData.model.deltaDecorations(e,t,this._id):[]}removeDecorations(e){const t=this._decorationTypeKeysToIds[e];t&&this.deltaDecorations(t,[]),this._decorationTypeKeysToIds.hasOwnProperty(e)&&delete this._decorationTypeKeysToIds[e],this._decorationTypeSubtypes.hasOwnProperty(e)&&delete this._decorationTypeSubtypes[e]}getLayoutInfo(){return this._configuration.options.get(117)}createOverviewRuler(e){return this._modelData&&this._modelData.hasRealView?this._modelData.view.createOverviewRuler(e):null}getContainerDomNode(){return this._domElement}getDomNode(){return this._modelData&&this._modelData.hasRealView?this._modelData.view.domNode.domNode:null}delegateVerticalScrollbarMouseDown(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.delegateVerticalScrollbarMouseDown(e)} +layout(e){this._configuration.observeReferenceElement(e),this.render()}focus(){this._modelData&&this._modelData.hasRealView&&this._modelData.view.focus()}hasTextFocus(){return!(!this._modelData||!this._modelData.hasRealView)&&this._modelData.view.isFocused()}hasWidgetFocus(){return this._focusTracker&&this._focusTracker.hasFocus()}addContentWidget(e){const t={widget:e,position:e.getPosition()};this._contentWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a content widget with the same id."),this._contentWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addContentWidget(t)}layoutContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const i=this._contentWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutContentWidget(i)}}removeContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const e=this._contentWidgets[t];delete this._contentWidgets[t], +this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeContentWidget(e)}}addOverlayWidget(e){const t={widget:e,position:e.getPosition()};this._overlayWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting an overlay widget with the same id."),this._overlayWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addOverlayWidget(t)}layoutOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const i=this._overlayWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutOverlayWidget(i)}}removeOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const e=this._overlayWidgets[t];delete this._overlayWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeOverlayWidget(e)}}changeViewZones(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.change(e)}getTargetAtClientPoint(e,t){ +return this._modelData&&this._modelData.hasRealView?this._modelData.view.getTargetAtClientPoint(e,t):null}getScrolledVisiblePosition(t){if(!this._modelData||!this._modelData.hasRealView)return null;const i=this._modelData.model.validatePosition(t),n=this._configuration.options,o=n.get(117);return{top:e._getVerticalOffsetForPosition(this._modelData,i.lineNumber,i.column)-this.getScrollTop(),left:this._modelData.view.getOffsetForColumn(i.lineNumber,i.column)+o.glyphMarginWidth+o.lineNumbersWidth+o.decorationsWidth-this.getScrollLeft(),height:n.get(51)}}getOffsetForColumn(e,t){return this._modelData&&this._modelData.hasRealView?this._modelData.view.getOffsetForColumn(e,t):-1}render(e=!1){this._modelData&&this._modelData.hasRealView&&this._modelData.view.render(!0,e)}setAriaOptions(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.setAriaOptions(e)}applyFontInfo(e){c.Configuration.applyFontInfoSlow(e,this._configuration.options.get(36))}_attachModel(e){if(!e)return void(this._modelData=null) +;const t=[];this._domElement.setAttribute("data-mode-id",e.getLanguageIdentifier().language),this._configuration.setIsDominatedByLongLines(e.isDominatedByLongLines()),this._configuration.setMaxLineNumber(e.getLineCount()),e.onBeforeAttached();const o=new D.ViewModel(this._id,this._configuration,e,F.DOMLineBreaksComputerFactory.create(),P.MonospaceLineBreaksComputerFactory.create(this._configuration.options),e=>n.scheduleAtNextAnimationFrame(e));t.push(e.onDidChangeDecorations(e=>this._onDidChangeModelDecorations.fire(e))),t.push(e.onDidChangeLanguage(t=>{this._domElement.setAttribute("data-mode-id",e.getLanguageIdentifier().language),this._onDidChangeModelLanguage.fire(t)})),t.push(e.onDidChangeLanguageConfiguration(e=>this._onDidChangeModelLanguageConfiguration.fire(e))),t.push(e.onDidChangeContent(e=>this._onDidChangeModelContent.fire(e))),t.push(e.onDidChangeOptions(e=>this._onDidChangeModelOptions.fire(e))),t.push(e.onWillDispose(()=>this.setModel(null))),t.push(o.onEvent(e=>{switch(e.kind){case 0: +this._onDidContentSizeChange.fire(e);break;case 1:this._editorTextFocus.setValue(e.hasFocus);break;case 2:this._onDidScrollChange.fire(e);break;case 3:this._onDidChangeViewZones.fire();break;case 4:this._onDidAttemptReadOnlyEdit.fire();break;case 5:{e.reachedMaxCursorCount&&this._notificationService.warn(i.localize(0,null,f.Cursor.MAX_CURSOR_COUNT));const t=[];for(let i=0,n=e.selections.length;i{this._paste("keyboard",e,t,i,n)},type:e=>{this._type("keyboard",e)},replacePreviousChar:(e,t)=>{this._replacePreviousChar("keyboard",e,t)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:{paste:(e,t,i,n)=>{const o={text:e,pasteOnNewLine:t,multicursorText:i,mode:n};this._commandService.executeCommand("paste",o)},type:e=>{const t={text:e};this._commandService.executeCommand("type",t)},replacePreviousChar:(e,t)=>{const i={text:e,replaceCharCnt:t};this._commandService.executeCommand("replacePreviousChar",i)},startComposition:()=>{this._commandService.executeCommand("compositionStart",{})}, +endComposition:()=>{this._commandService.executeCommand("compositionEnd",{})},cut:()=>{this._commandService.executeCommand("cut",{})}};const i=new p.ViewUserInputEvents(e.coordinatesConverter);return i.onKeyDown=e=>this._onKeyDown.fire(e),i.onKeyUp=e=>this._onKeyUp.fire(e),i.onContextMenu=e=>this._onContextMenu.fire(e),i.onMouseMove=e=>this._onMouseMove.fire(e),i.onMouseLeave=e=>this._onMouseLeave.fire(e),i.onMouseDown=e=>this._onMouseDown.fire(e),i.onMouseUp=e=>this._onMouseUp.fire(e),i.onMouseDrag=e=>this._onMouseDrag.fire(e),i.onMouseDrop=e=>this._onMouseDrop.fire(e),i.onMouseWheel=e=>this._onMouseWheel.fire(e),[new g.View(t,this._configuration,this._themeService,e,i,this._overflowWidgetsDomNode),!0]}_postDetachModelCleanup(e){e&&e.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){if(!this._modelData)return null;const e=this._modelData.model,t=this._modelData.hasRealView?this._modelData.view.domNode.domNode:null;return this._modelData.dispose(),this._modelData=null, +this._domElement.removeAttribute("data-mode-id"),t&&this._domElement.contains(t)&&this._domElement.removeChild(t),e}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}hasModel(){return null!==this._modelData}};z=a([l(3,I.IInstantiationService),l(4,u.ICodeEditorService),l(5,k.ICommandService),l(6,N.IContextKeyService),l(7,T.IThemeService),l(8,R.INotificationService),l(9,O.IAccessibilityService)],z),t.CodeEditorWidget=z;class H extends r.Disposable{constructor(){super(),this._onDidChangeToTrue=this._register(new s.Emitter),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new s.Emitter),this.onDidChangeToFalse=this._onDidChangeToFalse.event,this._value=0}setValue(e){const t=e?2:1;this._value!==t&&(this._value=t,2===this._value?this._onDidChangeToTrue.fire():1===this._value&&this._onDidChangeToFalse.fire())}}t.BooleanEventEmitter=H;class K extends r.Disposable{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()), +this._editorSimpleInput=y.EditorContextKeys.editorSimpleInput.bindTo(t),this._editorFocus=y.EditorContextKeys.focus.bindTo(t),this._textInputFocus=y.EditorContextKeys.textInputFocus.bindTo(t),this._editorTextFocus=y.EditorContextKeys.editorTextFocus.bindTo(t),this._editorTabMovesFocus=y.EditorContextKeys.tabMovesFocus.bindTo(t),this._editorReadonly=y.EditorContextKeys.readOnly.bindTo(t),this._editorColumnSelection=y.EditorContextKeys.columnSelection.bindTo(t),this._hasMultipleSelections=y.EditorContextKeys.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=y.EditorContextKeys.hasNonEmptySelection.bindTo(t),this._canUndo=y.EditorContextKeys.canUndo.bindTo(t),this._canRedo=y.EditorContextKeys.canRedo.bindTo(t),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromConfig())),this._register(this._editor.onDidChangeCursorSelection(()=>this._updateFromSelection())),this._register(this._editor.onDidFocusEditorWidget(()=>this._updateFromFocus())), +this._register(this._editor.onDidBlurEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidFocusEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidChangeModel(()=>this._updateFromModel())),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromModel())),this._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){const e=this._editor.getOptions();this._editorTabMovesFocus.set(e.get(116)),this._editorReadonly.set(e.get(72)),this._editorColumnSelection.set(e.get(13))}_updateFromSelection(){const e=this._editor.getSelections();e?(this._hasMultipleSelections.set(e.length>1),this._hasNonEmptySelection.set(e.some(e=>!e.isEmpty()))):(this._hasMultipleSelections.reset(),this._hasNonEmptySelection.reset())}_updateFromFocus(){ +this._editorFocus.set(this._editor.hasWidgetFocus()&&!this._editor.isSimpleWidget),this._editorTextFocus.set(this._editor.hasTextFocus()&&!this._editor.isSimpleWidget),this._textInputFocus.set(this._editor.hasTextFocus())}_updateFromModel(){const e=this._editor.getModel();this._canUndo.set(Boolean(e&&e.canUndo())),this._canRedo.set(Boolean(e&&e.canRedo()))}}class U extends r.Disposable{constructor(e,t){super(),this._editor=e,this._contextKeyService=t,this._langId=y.EditorContextKeys.languageId.bindTo(t),this._hasCompletionItemProvider=y.EditorContextKeys.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=y.EditorContextKeys.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=y.EditorContextKeys.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=y.EditorContextKeys.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=y.EditorContextKeys.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=y.EditorContextKeys.hasImplementationProvider.bindTo(t), +this._hasTypeDefinitionProvider=y.EditorContextKeys.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=y.EditorContextKeys.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=y.EditorContextKeys.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=y.EditorContextKeys.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=y.EditorContextKeys.hasReferenceProvider.bindTo(t),this._hasRenameProvider=y.EditorContextKeys.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=y.EditorContextKeys.hasSignatureHelpProvider.bindTo(t),this._hasDocumentFormattingProvider=y.EditorContextKeys.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=y.EditorContextKeys.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=y.EditorContextKeys.hasMultipleDocumentFormattingProvider.bindTo(t), +this._hasMultipleDocumentSelectionFormattingProvider=y.EditorContextKeys.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInWalkThrough=y.EditorContextKeys.isInWalkThroughSnippet.bindTo(t);const i=()=>this._update();this._register(e.onDidChangeModel(i)),this._register(e.onDidChangeModelLanguage(i)),this._register(E.CompletionProviderRegistry.onDidChange(i)),this._register(E.CodeActionProviderRegistry.onDidChange(i)),this._register(E.CodeLensProviderRegistry.onDidChange(i)),this._register(E.DefinitionProviderRegistry.onDidChange(i)),this._register(E.DeclarationProviderRegistry.onDidChange(i)),this._register(E.ImplementationProviderRegistry.onDidChange(i)),this._register(E.TypeDefinitionProviderRegistry.onDidChange(i)),this._register(E.HoverProviderRegistry.onDidChange(i)),this._register(E.DocumentHighlightProviderRegistry.onDidChange(i)),this._register(E.DocumentSymbolProviderRegistry.onDidChange(i)),this._register(E.ReferenceProviderRegistry.onDidChange(i)), +this._register(E.RenameProviderRegistry.onDidChange(i)),this._register(E.DocumentFormattingEditProviderRegistry.onDidChange(i)),this._register(E.DocumentRangeFormattingEditProviderRegistry.onDidChange(i)),this._register(E.SignatureHelpProviderRegistry.onDidChange(i)),i()}dispose(){super.dispose()}reset(){this._contextKeyService.bufferChangeEvents(()=>{this._langId.reset(),this._hasCompletionItemProvider.reset(),this._hasCodeActionsProvider.reset(),this._hasCodeLensProvider.reset(),this._hasDefinitionProvider.reset(),this._hasDeclarationProvider.reset(),this._hasImplementationProvider.reset(),this._hasTypeDefinitionProvider.reset(),this._hasHoverProvider.reset(),this._hasDocumentHighlightProvider.reset(),this._hasDocumentSymbolProvider.reset(),this._hasReferenceProvider.reset(),this._hasRenameProvider.reset(),this._hasDocumentFormattingProvider.reset(),this._hasDocumentSelectionFormattingProvider.reset(),this._hasSignatureHelpProvider.reset(),this._isInWalkThrough.reset()})}_update(){ +const e=this._editor.getModel();e?this._contextKeyService.bufferChangeEvents(()=>{this._langId.set(e.getLanguageIdentifier().language),this._hasCompletionItemProvider.set(E.CompletionProviderRegistry.has(e)),this._hasCodeActionsProvider.set(E.CodeActionProviderRegistry.has(e)),this._hasCodeLensProvider.set(E.CodeLensProviderRegistry.has(e)),this._hasDefinitionProvider.set(E.DefinitionProviderRegistry.has(e)),this._hasDeclarationProvider.set(E.DeclarationProviderRegistry.has(e)),this._hasImplementationProvider.set(E.ImplementationProviderRegistry.has(e)),this._hasTypeDefinitionProvider.set(E.TypeDefinitionProviderRegistry.has(e)),this._hasHoverProvider.set(E.HoverProviderRegistry.has(e)),this._hasDocumentHighlightProvider.set(E.DocumentHighlightProviderRegistry.has(e)),this._hasDocumentSymbolProvider.set(E.DocumentSymbolProviderRegistry.has(e)),this._hasReferenceProvider.set(E.ReferenceProviderRegistry.has(e)),this._hasRenameProvider.set(E.RenameProviderRegistry.has(e)), +this._hasSignatureHelpProvider.set(E.SignatureHelpProviderRegistry.has(e)),this._hasDocumentFormattingProvider.set(E.DocumentFormattingEditProviderRegistry.has(e)||E.DocumentRangeFormattingEditProviderRegistry.has(e)),this._hasDocumentSelectionFormattingProvider.set(E.DocumentRangeFormattingEditProviderRegistry.has(e)),this._hasMultipleDocumentFormattingProvider.set(E.DocumentFormattingEditProviderRegistry.all(e).length+E.DocumentRangeFormattingEditProviderRegistry.all(e).length>1),this._hasMultipleDocumentSelectionFormattingProvider.set(E.DocumentRangeFormattingEditProviderRegistry.all(e).length>1),this._isInWalkThrough.set(e.uri.scheme===d.Schemas.walkThroughSnippet)}):this.reset()}}t.EditorModeContext=U;class $ extends r.Disposable{constructor(e){super(),this._onChange=this._register(new s.Emitter),this.onChange=this._onChange.event,this._hasFocus=!1,this._domFocusTracker=this._register(n.trackFocus(e)),this._register(this._domFocusTracker.onDidFocus(()=>{this._hasFocus=!0,this._onChange.fire(void 0)})), +this._register(this._domFocusTracker.onDidBlur(()=>{this._hasFocus=!1,this._onChange.fire(void 0)}))}hasFocus(){return this._hasFocus}}const j=encodeURIComponent("");function G(e){return j+encodeURIComponent(e.toString())+q}const Y=encodeURIComponent('');T.registerThemingParticipant((e,t)=>{const i=e.getColor(x.editorErrorBorder);i&&t.addRule(`.monaco-editor .squiggly-error { border-bottom: 4px double ${i}; }`);const n=e.getColor(x.editorErrorForeground) +;n&&t.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${G(n)}") repeat-x bottom left; }`);const o=e.getColor(x.editorWarningBorder);o&&t.addRule(`.monaco-editor .squiggly-warning { border-bottom: 4px double ${o}; }`);const s=e.getColor(x.editorWarningForeground);s&&t.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${G(s)}") repeat-x bottom left; }`);const r=e.getColor(x.editorInfoBorder);r&&t.addRule(`.monaco-editor .squiggly-info { border-bottom: 4px double ${r}; }`);const a=e.getColor(x.editorInfoForeground);a&&t.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${G(a)}") repeat-x bottom left; }`);const l=e.getColor(x.editorHintBorder);l&&t.addRule(`.monaco-editor .squiggly-hint { border-bottom: 2px dotted ${l}; }`);const d=e.getColor(x.editorHintForeground);d&&t.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${function(e){return Y+encodeURIComponent(e.toString())+Z +}(d)}") no-repeat bottom left; }`);const c=e.getColor(L.editorUnnecessaryCodeOpacity);c&&t.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${c.rgba.a}; }`);const h=e.getColor(L.editorUnnecessaryCodeBorder);h&&t.addRule(`.monaco-editor.showUnused .squiggly-unnecessary { border-bottom: 2px dashed ${h}; }`);const u=e.getColor(x.editorForeground)||"inherit";t.addRule(`.monaco-editor.showDeprecated .squiggly-inline-deprecated { text-decoration: line-through; text-decoration-color: ${u}}`)})})),define(t[598],i([0,1,435,7,30,79,65,47,2,67,11,27,38,105,13,49,123,70,17,21,14,26,322]),(function(e,t,i,n,o,s,r,a,l,d,c,h,u,g,p,m,f,_,v,C,b,S){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DiffReview=void 0;const w=3;class y{constructor(e,t,i,n){this.originalLineStart=e,this.originalLineEnd=t,this.modifiedLineStart=i,this.modifiedLineEnd=n}getType(){return 0===this.originalLineStart?1:0===this.modifiedLineStart?2:0}}class E{constructor(e){this.entries=e}} +const L=S.registerIcon("diff-review-insert",S.Codicon.add),x=S.registerIcon("diff-review-remove",S.Codicon.remove),D=S.registerIcon("diff-review-close",S.Codicon.close);class k extends l.Disposable{constructor(e){super(),this._width=0,this._diffEditor=e,this._isVisible=!1,this.shadow=o.createFastDomNode(document.createElement("div")),this.shadow.setClassName("diff-review-shadow"),this.actionBarContainer=o.createFastDomNode(document.createElement("div")),this.actionBarContainer.setClassName("diff-review-actions"),this._actionBar=this._register(new s.ActionBar(this.actionBarContainer.domNode)),this._actionBar.push(new a.Action("diffreview.close",i.localize(0,null),"close-diff-review "+D.classNames,!0,()=>(this.hide(),Promise.resolve(null))),{label:!1,icon:!0}),this.domNode=o.createFastDomNode(document.createElement("div")),this.domNode.setClassName("diff-review monaco-editor-background"),this._content=o.createFastDomNode(document.createElement("div")),this._content.setClassName("diff-review-content"), +this._content.setAttribute("role","code"),this.scrollbar=this._register(new r.DomScrollableElement(this._content.domNode,{})),this.domNode.domNode.appendChild(this.scrollbar.getDomNode()),this._register(e.onDidUpdateDiff(()=>{this._isVisible&&(this._diffs=this._compute(),this._render())})),this._register(e.getModifiedEditor().onDidChangeCursorPosition(()=>{this._isVisible&&this._render()})),this._register(n.addStandardDisposableListener(this.domNode.domNode,"click",e=>{e.preventDefault();let t=n.findParentWithClass(e.target,"diff-review-row");t&&this._goToRow(t)})),this._register(n.addStandardDisposableListener(this.domNode.domNode,"keydown",e=>{(e.equals(18)||e.equals(2066)||e.equals(530))&&(e.preventDefault(),this._goToRow(this._getNextRow())),(e.equals(16)||e.equals(2064)||e.equals(528))&&(e.preventDefault(),this._goToRow(this._getPrevRow())),(e.equals(9)||e.equals(2057)||e.equals(521)||e.equals(1033))&&(e.preventDefault(),this.hide()),(e.equals(10)||e.equals(3))&&(e.preventDefault(),this.accept())})), +this._diffs=[],this._currentDiff=null}prev(){let e=0;if(this._isVisible||(this._diffs=this._compute()),this._isVisible){let t=-1;for(let e=0,i=this._diffs.length;e0){const t=e[s-1];n=0===t.originalEndLineNumber?t.originalStartLineNumber+1:t.originalEndLineNumber+1,o=0===t.modifiedEndLineNumber?t.modifiedStartLineNumber+1:t.modifiedEndLineNumber+1}let r=t-w+1,a=i-w+1;if(ra){const e=a-m;m+=e,f+=e}if(f>p){const e=p-f +;m+=e,f+=e}u[g++]=new y(n,m,o,f)}n[o++]=new E(u)}let s=n[0].entries,r=[],a=0;for(let e=1,t=n.length;eg)&&(g=n),0!==o&&(0===p||om)&&(m=s)}let f=document.createElement("div");f.className="diff-review-row";let _=document.createElement("div");_.className="diff-review-cell diff-review-summary";const v=g-u+1,C=m-p+1;_.appendChild(document.createTextNode(`${l+1}/${this._diffs.length}: @@ -${u},${v} +${p},${C} @@`)),f.setAttribute("data-line",String(p)) +;const b=e=>0===e?i.localize(1,null):1===e?i.localize(2,null):i.localize(3,null,e),S=b(v),w=b(C);f.setAttribute("aria-label",i.localize(4,null,l+1,this._diffs.length,u,S,p,w)),f.appendChild(_),f.setAttribute("role","listitem"),h.appendChild(f);const y=t.get(51);let E=p;for(let i=0,n=c.length;i{ +const i=e.getColor(m.editorLineNumbers);i&&t.addRule(`.monaco-diff-editor .diff-review-line-number { color: ${i}; }`);const n=e.getColor(C.scrollbarShadow);n&&t.addRule(`.monaco-diff-editor .diff-review-shadow { box-shadow: ${n} 0 -6px 6px -6px inset; }`)});class N extends c.EditorAction{constructor(){super({id:"editor.action.diffReview.next",label:i.localize(10,null),alias:"Go to Next Difference",precondition:v.ContextKeyExpr.has("isInDiffEditor"),kbOpts:{kbExpr:null,primary:65,weight:100}})}run(e,t){const i=M(e);i&&i.diffReviewNext()}}class I extends c.EditorAction{constructor(){super({id:"editor.action.diffReview.prev",label:i.localize(11,null),alias:"Go to Previous Difference",precondition:v.ContextKeyExpr.has("isInDiffEditor"),kbOpts:{kbExpr:null,primary:1089,weight:100}})}run(e,t){const i=M(e);i&&i.diffReviewPrev()}}function M(e){const t=e.get(h.ICodeEditorService),i=t.listDiffEditors(),n=t.getActiveCodeEditor();if(!n)return null;for(let e=0,t=i.length;e!this._zonesMap[String(e.id)])}clean(e){this._zones.length>0&&e.changeViewZones(e=>{for(let t=0,i=this._zones.length;t{for(let e=0,i=this._zones.length;ethis._updateDecorations(),0)),this._containerDomElement=document.createElement("div"),this._containerDomElement.className=e._getClassName(this._themeService.getColorTheme(),this._renderSideBySide),this._containerDomElement.style.position="relative",this._containerDomElement.style.height="100%",this._domElement.appendChild(this._containerDomElement),this._overviewViewportDomElement=o.createFastDomNode(document.createElement("div")),this._overviewViewportDomElement.setClassName("diffViewport"), +this._overviewViewportDomElement.setPosition("absolute"),this._overviewDomElement=document.createElement("div"),this._overviewDomElement.className="diffOverview",this._overviewDomElement.style.position="absolute",this._overviewDomElement.appendChild(this._overviewViewportDomElement.domNode),this._register(n.addStandardDisposableListener(this._overviewDomElement,"mousedown",e=>{this.modifiedEditor.delegateVerticalScrollbarMouseDown(e)})),this._containerDomElement.appendChild(this._overviewDomElement),this._originalDomNode=document.createElement("div"),this._originalDomNode.className="editor original",this._originalDomNode.style.position="absolute",this._originalDomNode.style.height="100%",this._containerDomElement.appendChild(this._originalDomNode),this._modifiedDomNode=document.createElement("div"),this._modifiedDomNode.className="editor modified",this._modifiedDomNode.style.position="absolute",this._modifiedDomNode.style.height="100%",this._containerDomElement.appendChild(this._modifiedDomNode), +this._beginUpdateDecorationsTimeout=-1,this._currentlyChangingViewZones=!1,this._diffComputationToken=0,this._originalEditorState=new H(p,s),this._modifiedEditorState=new H(p,s),this._isVisible=!0,this._isHandlingScrollEvent=!1,this._elementSizeObserver=this._register(new B.ElementSizeObserver(this._containerDomElement,void 0,()=>this._onDidContainerSizeChanged())),i.automaticLayout&&this._elementSizeObserver.startObserving(),this._diffComputationResult=null;const _=this._contextKeyService.createScoped(),v=new N.ServiceCollection;v.set(D.IContextKeyService,_);const C=c.createChild(v),b=this._contextKeyService.createScoped(),S=new N.ServiceCollection;S.set(D.IContextKeyService,b);const w=c.createChild(S);this.originalEditor=this._createLeftHandSideEditor(i,C,_),this.modifiedEditor=this._createRightHandSideEditor(i,w,b),this._originalOverviewRuler=null,this._modifiedOverviewRuler=null,this._reviewPane=new f.DiffReview(this),this._containerDomElement.appendChild(this._reviewPane.domNode.domNode), +this._containerDomElement.appendChild(this._reviewPane.shadow.domNode),this._containerDomElement.appendChild(this._reviewPane.actionBarContainer.domNode),this._enableSplitViewResizing=!0,void 0!==i.enableSplitViewResizing&&(this._enableSplitViewResizing=i.enableSplitViewResizing),this._renderSideBySide?this._setStrategy(new X(this._createDataSource(),this._enableSplitViewResizing)):this._setStrategy(new J(this._createDataSource(),this._enableSplitViewResizing)),this._register(u.onDidColorThemeChange(t=>{this._strategy&&this._strategy.applyColors(t)&&this._updateDecorationsRunner.schedule(),this._containerDomElement.className=e._getClassName(this._themeService.getColorTheme(),this._renderSideBySide)}));const y=P.EditorExtensionsRegistry.getDiffEditorContributions();for(const e of y)try{this._register(c.createInstance(e.ctor,this))}catch(e){F.onUnexpectedError(e)}this._codeEditorService.addDiffEditor(this)}_setState(e){this._state!==e&&(this._state=e, +this._updatingDiffProgress&&(this._updatingDiffProgress.done(),this._updatingDiffProgress=null),1===this._state&&(this._updatingDiffProgress=this._editorProgressService.show(!0,1e3)))}diffReviewNext(){this._reviewPane.next()}diffReviewPrev(){this._reviewPane.prev()}static _getClassName(e,t){let i="monaco-diff-editor monaco-editor-background ";return t&&(i+="side-by-side "),i+=R.getThemeTypeSelector(e.type)}_recreateOverviewRulers(){this._originalOverviewRuler&&(this._overviewDomElement.removeChild(this._originalOverviewRuler.getDomNode()),this._originalOverviewRuler.dispose()),this.originalEditor.hasModel()&&(this._originalOverviewRuler=this.originalEditor.createOverviewRuler("original diffOverviewRuler"),this._overviewDomElement.appendChild(this._originalOverviewRuler.getDomNode())),this._modifiedOverviewRuler&&(this._overviewDomElement.removeChild(this._modifiedOverviewRuler.getDomNode()),this._modifiedOverviewRuler.dispose()), +this.modifiedEditor.hasModel()&&(this._modifiedOverviewRuler=this.modifiedEditor.createOverviewRuler("modified diffOverviewRuler"),this._overviewDomElement.appendChild(this._modifiedOverviewRuler.getDomNode())),this._layoutOverviewRulers()}_createLeftHandSideEditor(t,i,n){const o=this._createInnerEditor(i,this._originalDomNode,this._adjustOptionsForLeftHandSide(t,this._originalIsEditable,this._originalCodeLens));this._register(o.onDidScrollChange(e=>{this._isHandlingScrollEvent||(e.scrollTopChanged||e.scrollLeftChanged||e.scrollHeightChanged)&&(this._isHandlingScrollEvent=!0,this.modifiedEditor.setScrollPosition({scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}),this._isHandlingScrollEvent=!1,this._layoutOverviewViewport())})),this._register(o.onDidChangeViewZones(()=>{this._onViewZonesChanged()})),this._register(o.onDidChangeModelContent(()=>{this._isVisible&&this._beginUpdateDecorationsSoon()}));const s=n.createKey("isInDiffLeftEditor",void 0);return this._register(o.onDidFocusEditorWidget(()=>s.set(!0))), +this._register(o.onDidBlurEditorWidget(()=>s.set(!1))),this._register(o.onDidContentSizeChange(t=>{const i=this.originalEditor.getContentWidth()+this.modifiedEditor.getContentWidth()+e.ONE_OVERVIEW_WIDTH,n=Math.max(this.modifiedEditor.getContentHeight(),this.originalEditor.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:n,contentWidth:i,contentHeightChanged:t.contentHeightChanged,contentWidthChanged:t.contentWidthChanged})})),o}_createRightHandSideEditor(t,i,n){const o=this._createInnerEditor(i,this._modifiedDomNode,this._adjustOptionsForRightHandSide(t,this._modifiedCodeLens));this._register(o.onDidScrollChange(e=>{this._isHandlingScrollEvent||(e.scrollTopChanged||e.scrollLeftChanged||e.scrollHeightChanged)&&(this._isHandlingScrollEvent=!0,this.originalEditor.setScrollPosition({scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}),this._isHandlingScrollEvent=!1,this._layoutOverviewViewport())})),this._register(o.onDidChangeViewZones(()=>{this._onViewZonesChanged()})), +this._register(o.onDidChangeConfiguration(e=>{e.hasChanged(36)&&o.getModel()&&this._onViewZonesChanged()})),this._register(o.onDidChangeModelContent(()=>{this._isVisible&&this._beginUpdateDecorationsSoon()})),this._register(o.onDidChangeModelOptions(e=>{e.tabSize&&this._updateDecorationsRunner.schedule()}));const s=n.createKey("isInDiffRightEditor",void 0);return this._register(o.onDidFocusEditorWidget(()=>s.set(!0))),this._register(o.onDidBlurEditorWidget(()=>s.set(!1))),this._register(o.onDidContentSizeChange(t=>{const i=this.originalEditor.getContentWidth()+this.modifiedEditor.getContentWidth()+e.ONE_OVERVIEW_WIDTH,n=Math.max(this.modifiedEditor.getContentHeight(),this.originalEditor.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:n,contentWidth:i,contentHeightChanged:t.contentHeightChanged,contentWidthChanged:t.contentWidthChanged})})),o}_createInnerEditor(e,t,i){return e.createInstance(m.CodeEditorWidget,t,i,{})}dispose(){this._codeEditorService.removeDiffEditor(this), +-1!==this._beginUpdateDecorationsTimeout&&(window.clearTimeout(this._beginUpdateDecorationsTimeout),this._beginUpdateDecorationsTimeout=-1),this._cleanViewZonesAndDecorations(),this._originalOverviewRuler&&(this._overviewDomElement.removeChild(this._originalOverviewRuler.getDomNode()),this._originalOverviewRuler.dispose()),this._modifiedOverviewRuler&&(this._overviewDomElement.removeChild(this._modifiedOverviewRuler.getDomNode()),this._modifiedOverviewRuler.dispose()),this._overviewDomElement.removeChild(this._overviewViewportDomElement.domNode),this._containerDomElement.removeChild(this._overviewDomElement),this._containerDomElement.removeChild(this._originalDomNode),this.originalEditor.dispose(),this._containerDomElement.removeChild(this._modifiedDomNode),this.modifiedEditor.dispose(),this._strategy.dispose(),this._containerDomElement.removeChild(this._reviewPane.domNode.domNode),this._containerDomElement.removeChild(this._reviewPane.shadow.domNode), +this._containerDomElement.removeChild(this._reviewPane.actionBarContainer.domNode),this._reviewPane.dispose(),this._domElement.removeChild(this._containerDomElement),this._onDidDispose.fire(),super.dispose()}getId(){return this.getEditorType()+":"+this.id}getEditorType(){return b.EditorType.IDiffEditor}getLineChanges(){return this._diffComputationResult?this._diffComputationResult.changes:null}getOriginalEditor(){return this.originalEditor}getModifiedEditor(){return this.modifiedEditor}updateOptions(t){let i=!1;void 0!==t.renderSideBySide&&this._renderSideBySide!==t.renderSideBySide&&(this._renderSideBySide=t.renderSideBySide,i=!0),void 0!==t.maxComputationTime&&(this._maxComputationTime=t.maxComputationTime,this._isVisible&&this._beginUpdateDecorationsSoon());let n=!1;void 0!==t.ignoreTrimWhitespace&&this._ignoreTrimWhitespace!==t.ignoreTrimWhitespace&&(this._ignoreTrimWhitespace=t.ignoreTrimWhitespace,n=!0), +void 0!==t.renderIndicators&&this._renderIndicators!==t.renderIndicators&&(this._renderIndicators=t.renderIndicators,n=!0),n&&this._beginUpdateDecorations(),void 0!==t.originalEditable&&(this._originalIsEditable=Boolean(t.originalEditable)),void 0!==t.originalCodeLens&&(this._originalCodeLens=Boolean(t.originalCodeLens)),void 0!==t.modifiedCodeLens&&(this._modifiedCodeLens=Boolean(t.modifiedCodeLens)),this.modifiedEditor.updateOptions(this._adjustOptionsForRightHandSide(t,this._modifiedCodeLens)),this.originalEditor.updateOptions(this._adjustOptionsForLeftHandSide(t,this._originalIsEditable,this._originalCodeLens)),void 0!==t.enableSplitViewResizing&&(this._enableSplitViewResizing=t.enableSplitViewResizing),this._strategy.setEnableSplitViewResizing(this._enableSplitViewResizing),i&&(this._renderSideBySide?this._setStrategy(new X(this._createDataSource(),this._enableSplitViewResizing)):this._setStrategy(new J(this._createDataSource(),this._enableSplitViewResizing)), +this._containerDomElement.className=e._getClassName(this._themeService.getColorTheme(),this._renderSideBySide))}getModel(){return{original:this.originalEditor.getModel(),modified:this.modifiedEditor.getModel()}}setModel(e){if(e&&(!e.original||!e.modified))throw new Error(e.original?"DiffEditorWidget.setModel: Modified model is null":"DiffEditorWidget.setModel: Original model is null");this._cleanViewZonesAndDecorations(),this.originalEditor.setModel(e?e.original:null),this.modifiedEditor.setModel(e?e.modified:null),this._updateDecorationsRunner.cancel(),e&&(this.originalEditor.setScrollTop(0),this.modifiedEditor.setScrollTop(0)),this._diffComputationResult=null,this._diffComputationToken++,this._setState(0),e&&(this._recreateOverviewRulers(),this._beginUpdateDecorations()),this._layoutOverviewViewport()}getDomNode(){return this._domElement}getVisibleColumnFromPosition(e){return this.modifiedEditor.getVisibleColumnFromPosition(e)}getPosition(){return this.modifiedEditor.getPosition()}setPosition(e){ +this.modifiedEditor.setPosition(e)}revealLine(e,t=0){this.modifiedEditor.revealLine(e,t)}revealLineInCenter(e,t=0){this.modifiedEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=0){this.modifiedEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=0){this.modifiedEditor.revealLineNearTop(e,t)}revealPosition(e,t=0){this.modifiedEditor.revealPosition(e,t)}revealPositionInCenter(e,t=0){this.modifiedEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this.modifiedEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=0){this.modifiedEditor.revealPositionNearTop(e,t)}getSelection(){return this.modifiedEditor.getSelection()}getSelections(){return this.modifiedEditor.getSelections()}setSelection(e){this.modifiedEditor.setSelection(e)}setSelections(e){this.modifiedEditor.setSelections(e)}revealLines(e,t,i=0){this.modifiedEditor.revealLines(e,t,i)}revealLinesInCenter(e,t,i=0){this.modifiedEditor.revealLinesInCenter(e,t,i)} +revealLinesInCenterIfOutsideViewport(e,t,i=0){this.modifiedEditor.revealLinesInCenterIfOutsideViewport(e,t,i)}revealLinesNearTop(e,t,i=0){this.modifiedEditor.revealLinesNearTop(e,t,i)}revealRange(e,t=0,i=!1,n=!0){this.modifiedEditor.revealRange(e,t,i,n)}revealRangeInCenter(e,t=0){this.modifiedEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this.modifiedEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=0){this.modifiedEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this.modifiedEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=0){this.modifiedEditor.revealRangeAtTop(e,t)}getSupportedActions(){return this.modifiedEditor.getSupportedActions()}saveViewState(){return{original:this.originalEditor.saveViewState(),modified:this.modifiedEditor.saveViewState()}}restoreViewState(e){if(e.original&&e.modified){let t=e;this.originalEditor.restoreViewState(t.original),this.modifiedEditor.restoreViewState(t.modified)}}layout(e){ +this._elementSizeObserver.observe(e)}focus(){this.modifiedEditor.focus()}hasTextFocus(){return this.originalEditor.hasTextFocus()||this.modifiedEditor.hasTextFocus()}trigger(e,t,i){this.modifiedEditor.trigger(e,t,i)}changeDecorations(e){return this.modifiedEditor.changeDecorations(e)}_onDidContainerSizeChanged(){this._doLayout()}_getReviewHeight(){return this._reviewPane.isVisible()?this._elementSizeObserver.getHeight():0}_layoutOverviewRulers(){if(!this._originalOverviewRuler||!this._modifiedOverviewRuler)return;const t=this._elementSizeObserver.getHeight(),i=this._getReviewHeight();let n=e.ENTIRE_DIFF_OVERVIEW_WIDTH-2*e.ONE_OVERVIEW_WIDTH;this.modifiedEditor.getLayoutInfo()&&(this._originalOverviewRuler.setLayout({top:0,width:e.ONE_OVERVIEW_WIDTH,right:n+e.ONE_OVERVIEW_WIDTH,height:t-i}),this._modifiedOverviewRuler.setLayout({top:0,right:0,width:e.ONE_OVERVIEW_WIDTH,height:t-i}))}_onViewZonesChanged(){this._currentlyChangingViewZones||this._updateDecorationsRunner.schedule()}_beginUpdateDecorationsSoon(){ +-1!==this._beginUpdateDecorationsTimeout&&(window.clearTimeout(this._beginUpdateDecorationsTimeout),this._beginUpdateDecorationsTimeout=-1),this._beginUpdateDecorationsTimeout=window.setTimeout(()=>this._beginUpdateDecorations(),e.UPDATE_DIFF_DECORATIONS_DELAY)}static _equals(e,t){return!e&&!t||!(!e||!t)&&e.toString()===t.toString()}_beginUpdateDecorations(){this._beginUpdateDecorationsTimeout=-1;const t=this.originalEditor.getModel(),n=this.modifiedEditor.getModel();if(!t||!n)return;this._diffComputationToken++;let o=this._diffComputationToken;this._setState(1),this._editorWorkerService.canComputeDiff(t.uri,n.uri)?this._editorWorkerService.computeDiff(t.uri,n.uri,this._ignoreTrimWhitespace,this._maxComputationTime).then(e=>{o===this._diffComputationToken&&t===this.originalEditor.getModel()&&n===this.modifiedEditor.getModel()&&(this._setState(2),this._diffComputationResult=e,this._updateDecorationsRunner.schedule(),this._onDidUpdateDiff.fire())},e=>{ +o===this._diffComputationToken&&t===this.originalEditor.getModel()&&n===this.modifiedEditor.getModel()&&(this._setState(2),this._diffComputationResult=null,this._updateDecorationsRunner.schedule())}):e._equals(t.uri,this._lastOriginalWarning)&&e._equals(n.uri,this._lastModifiedWarning)||(this._lastOriginalWarning=t.uri,this._lastModifiedWarning=n.uri,this._notificationService.warn(i.localize(0,null)))}_cleanViewZonesAndDecorations(){this._originalEditorState.clean(this.originalEditor),this._modifiedEditorState.clean(this.modifiedEditor)}_updateDecorations(){if(!(this.originalEditor.getModel()&&this.modifiedEditor.getModel()&&this._originalOverviewRuler&&this._modifiedOverviewRuler))return;const e=this._diffComputationResult?this._diffComputationResult.changes:[] +;let t=this._originalEditorState.getForeignViewZones(this.originalEditor.getWhitespaces()),i=this._modifiedEditorState.getForeignViewZones(this.modifiedEditor.getWhitespaces()),n=this._strategy.getEditorsDiffDecorations(e,this._ignoreTrimWhitespace,this._renderIndicators,t,i,this.originalEditor,this.modifiedEditor);try{this._currentlyChangingViewZones=!0,this._originalEditorState.apply(this.originalEditor,this._originalOverviewRuler,n.original,!1),this._modifiedEditorState.apply(this.modifiedEditor,this._modifiedOverviewRuler,n.modified,!0)}finally{this._currentlyChangingViewZones=!1}}_adjustOptionsForSubEditor(e){let t=h.deepClone(e||{});return t.inDiffEditor=!0,t.wordWrap="off",t.wordWrapMinified=!1,t.automaticLayout=!1,t.scrollbar=t.scrollbar||{},t.scrollbar.vertical="visible",t.folding=!1,t.codeLens=!1,t.fixedOverflowWidgets=!0,t.overflowWidgetsDomNode=e.overflowWidgetsDomNode,t.minimap||(t.minimap={}),t.minimap.enabled=!1,t}_adjustOptionsForLeftHandSide(e,t,i){let n=this._adjustOptionsForSubEditor(e) +;return i&&(n.codeLens=!0),n.readOnly=!t,n.extraEditorClassName="original-in-monaco-diff-editor",n}_adjustOptionsForRightHandSide(t,i){let n=this._adjustOptionsForSubEditor(t);return i&&(n.codeLens=!0),n.revealHorizontalRightPadding=_.EditorOptions.revealHorizontalRightPadding.defaultValue+e.ENTIRE_DIFF_OVERVIEW_WIDTH,n.scrollbar.verticalHasArrows=!1,n.extraEditorClassName="modified-in-monaco-diff-editor",n}doLayout(){this._elementSizeObserver.observe(),this._doLayout()}_doLayout(){const t=this._elementSizeObserver.getWidth(),i=this._elementSizeObserver.getHeight(),n=this._getReviewHeight();let o=this._strategy.layout();this._originalDomNode.style.width=o+"px",this._originalDomNode.style.left="0px",this._modifiedDomNode.style.width=t-o+"px",this._modifiedDomNode.style.left=o+"px",this._overviewDomElement.style.top="0px",this._overviewDomElement.style.height=i-n+"px",this._overviewDomElement.style.width=e.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",this._overviewDomElement.style.left=t-e.ENTIRE_DIFF_OVERVIEW_WIDTH+"px", +this._overviewViewportDomElement.setWidth(e.ENTIRE_DIFF_OVERVIEW_WIDTH),this._overviewViewportDomElement.setHeight(30),this.originalEditor.layout({width:o,height:i-n}),this.modifiedEditor.layout({width:t-o-e.ENTIRE_DIFF_OVERVIEW_WIDTH,height:i-n}),(this._originalOverviewRuler||this._modifiedOverviewRuler)&&this._layoutOverviewRulers(),this._reviewPane.layout(i-n,t,n),this._layoutOverviewViewport()}_layoutOverviewViewport(){let e=this._computeOverviewViewport();e?(this._overviewViewportDomElement.setTop(e.top),this._overviewViewportDomElement.setHeight(e.height)):(this._overviewViewportDomElement.setTop(0),this._overviewViewportDomElement.setHeight(0))}_computeOverviewViewport(){let e=this.modifiedEditor.getLayoutInfo();if(!e)return null;let t=this.modifiedEditor.getScrollTop(),i=this.modifiedEditor.getScrollHeight(),n=Math.max(0,e.height),o=Math.max(0,n-0),s=i>0?o/i:0;return{height:Math.max(0,Math.floor(e.height*s)),top:Math.floor(t*s)}}_createDataSource(){return{ +getWidth:()=>this._elementSizeObserver.getWidth(),getHeight:()=>this._elementSizeObserver.getHeight()-this._getReviewHeight(),getContainerDomNode:()=>this._containerDomElement,relayoutEditors:()=>{this._doLayout()},getOriginalEditor:()=>this.originalEditor,getModifiedEditor:()=>this.modifiedEditor}}_setStrategy(e){this._strategy&&this._strategy.dispose(),this._strategy=e,e.applyColors(this._themeService.getColorTheme()),this._diffComputationResult&&this._updateDecorations(),this._doLayout()}_getLineChangeAtOrBeforeLineNumber(e,t){const i=this._diffComputationResult?this._diffComputationResult.changes:[];if(0===i.length||e=a?n=s+1:(n=s,o=s)}return i[n]}_getEquivalentLineForOriginalLineNumber(e){let t=this._getLineChangeAtOrBeforeLineNumber(e,e=>e.originalStartLineNumber);if(!t)return e +;let i=t.originalStartLineNumber+(t.originalEndLineNumber>0?-1:0),n=t.modifiedStartLineNumber+(t.modifiedEndLineNumber>0?-1:0),o=t.originalEndLineNumber>0?t.originalEndLineNumber-t.originalStartLineNumber+1:0,s=t.modifiedEndLineNumber>0?t.modifiedEndLineNumber-t.modifiedStartLineNumber+1:0,r=e-i;return r<=o?n+Math.min(r,s):n+s-o+r}_getEquivalentLineForModifiedLineNumber(e){let t=this._getLineChangeAtOrBeforeLineNumber(e,e=>e.modifiedStartLineNumber);if(!t)return e;let i=t.originalStartLineNumber+(t.originalEndLineNumber>0?-1:0),n=t.modifiedStartLineNumber+(t.modifiedEndLineNumber>0?-1:0),o=t.originalEndLineNumber>0?t.originalEndLineNumber-t.originalStartLineNumber+1:0,s=t.modifiedEndLineNumber>0?t.modifiedEndLineNumber-t.modifiedStartLineNumber+1:0,r=e-n;return r<=s?i+Math.min(r,o):i+o-s+r}getDiffLineInformationForOriginal(e){return this._diffComputationResult?{equivalentLineNumber:this._getEquivalentLineForOriginalLineNumber(e)}:null}getDiffLineInformationForModified(e){return this._diffComputationResult?{ +equivalentLineNumber:this._getEquivalentLineForModifiedLineNumber(e)}:null}};j.ONE_OVERVIEW_WIDTH=15,j.ENTIRE_DIFF_OVERVIEW_WIDTH=30,j.UPDATE_DIFF_DECORATIONS_DELAY=200,j=a([l(2,A.IClipboardService),l(3,w.IEditorWorkerService),l(4,D.IContextKeyService),l(5,k.IInstantiationService),l(6,p.ICodeEditorService),l(7,R.IThemeService),l(8,I.INotificationService),l(9,T.IContextMenuService),l(10,W.IEditorProgressService)],j),t.DiffEditorWidget=j;class q extends c.Disposable{constructor(e){super(),this._dataSource=e,this._insertColor=null,this._removeColor=null}applyColors(e){let t=(e.getColor(M.diffInserted)||M.defaultInsertColor).transparent(2),i=(e.getColor(M.diffRemoved)||M.defaultRemoveColor).transparent(2),n=!t.equals(this._insertColor)||!i.equals(this._removeColor);return this._insertColor=t,this._removeColor=i,n}getEditorsDiffDecorations(e,t,i,n,o,s,r){o=o.sort((e,t)=>e.afterLineNumber-t.afterLineNumber),n=n.sort((e,t)=>e.afterLineNumber-t.afterLineNumber) +;let a=this._getViewZones(e,n,o,s,r,i),l=this._getOriginalEditorDecorations(e,t,i,s,r),d=this._getModifiedEditorDecorations(e,t,i,s,r);return{original:{decorations:l.decorations,overviewZones:l.overviewZones,zones:a.original},modified:{decorations:d.decorations,overviewZones:d.overviewZones,zones:a.modified}}}}class G{constructor(e){this._source=e,this._index=-1,this.current=null,this.advance()}advance(){this._index++,this._indexe.afterLineNumber-t.afterLineNumber,d=(e,t)=>{if(null===t.domNode&&e.length>0){let i=e[e.length-1];if(i.afterLineNumber===t.afterLineNumber&&null===i.domNode)return void(i.heightInLines+=t.heightInLines)}e.push(t)},c=new G(this.modifiedForeignVZ),h=new G(this.originalForeignVZ) +;for(let u=0,g=this.lineChanges.length;u<=g;u++){let p=u0?-1:0),s=p.modifiedStartLineNumber+(p.modifiedEndLineNumber>0?-1:0),n=p.originalEndLineNumber>0?p.originalEndLineNumber-p.originalStartLineNumber+1:0,i=p.modifiedEndLineNumber>0?p.modifiedEndLineNumber-p.modifiedStartLineNumber+1:0,r=Math.max(p.originalStartLineNumber,p.originalEndLineNumber),a=Math.max(p.modifiedStartLineNumber,p.modifiedEndLineNumber)):(r=o+=1e7+n,a=s+=1e7+i);let m=[],f=[];for(;c.current&&c.current.afterLineNumber<=a;){let e;e=c.current.afterLineNumber<=s?o-s+c.current.afterLineNumber:r;let t=null;p&&p.modifiedStartLineNumber<=c.current.afterLineNumber&&c.current.afterLineNumber<=p.modifiedEndLineNumber&&(t=this._createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion()),m.push({afterLineNumber:e,heightInLines:c.current.height/this.modifiedLineHeight,domNode:null,marginDomNode:t}),c.advance()} +for(;h.current&&h.current.afterLineNumber<=r;){let e;e=h.current.afterLineNumber<=o?s-o+h.current.afterLineNumber:a,f.push({afterLineNumber:e,heightInLines:h.current.height/this.originalLineHeight,domNode:null}),h.advance()}if(null!==p&&te(p)){let e=this._produceOriginalFromDiff(p,n,i);e&&m.push(e)}if(null!==p&&ie(p)){let e=this._produceModifiedFromDiff(p,n,i);e&&f.push(e)}let _=0,v=0;for(m=m.sort(l),f=f.sort(l);_=n.heightInLines?(i.heightInLines-=n.heightInLines,v++):(n.heightInLines-=i.heightInLines,_++)}for(;_(e.domNode||(e.domNode=function(){let e=document.createElement("div");return e.className="diagonal-fill",e}()),e))}}function Z(e,t,i,n,o){ +return{range:new v.Range(e,t,i,n),options:o}}t.createDecoration=Z,t.DECORATIONS={charDelete:S.ModelDecorationOptions.register({className:"char-delete"}),charDeleteWholeLine:S.ModelDecorationOptions.register({className:"char-delete",isWholeLine:!0}),charInsert:S.ModelDecorationOptions.register({className:"char-insert"}),charInsertWholeLine:S.ModelDecorationOptions.register({className:"char-insert",isWholeLine:!0}),lineInsert:S.ModelDecorationOptions.register({className:"line-insert",marginClassName:"line-insert",isWholeLine:!0}),lineInsertWithSign:S.ModelDecorationOptions.register({className:"line-insert",linesDecorationsClassName:"insert-sign "+U.classNames,marginClassName:"line-insert",isWholeLine:!0}),lineDelete:S.ModelDecorationOptions.register({className:"line-delete",marginClassName:"line-delete",isWholeLine:!0}),lineDeleteWithSign:S.ModelDecorationOptions.register({className:"line-delete",linesDecorationsClassName:"delete-sign "+$.classNames,marginClassName:"line-delete",isWholeLine:!0}), +lineDeleteMargin:S.ModelDecorationOptions.register({marginClassName:"line-delete"})};class X extends q{constructor(e,t){super(e),this._disableSash=!1===t,this._sashRatio=null,this._sashPosition=null,this._startSashPosition=null,this._sash=this._register(new s.Sash(this._dataSource.getContainerDomNode(),this,{orientation:0})),this._disableSash&&(this._sash.state=0),this._sash.onDidStart(()=>this.onSashDragStart()),this._sash.onDidChange(e=>this.onSashDrag(e)),this._sash.onDidEnd(()=>this.onSashDragEnd()),this._sash.onDidReset(()=>this.onSashReset())}setEnableSplitViewResizing(e){let t=!1===e;this._disableSash!==t&&(this._disableSash=t,this._sash.state=this._disableSash?0:3)}layout(e=this._sashRatio){let t=this._dataSource.getWidth()-j.ENTIRE_DIFF_OVERVIEW_WIDTH,i=Math.floor((e||.5)*t),n=Math.floor(.5*t);return i=this._disableSash?n:i||n,t>2*X.MINIMUM_EDITOR_WIDTH?(it-X.MINIMUM_EDITOR_WIDTH&&(i=t-X.MINIMUM_EDITOR_WIDTH)):i=n, +this._sashPosition!==i&&(this._sashPosition=i,this._sash.layout()),this._sashPosition}onSashDragStart(){this._startSashPosition=this._sashPosition}onSashDrag(e){let t=this._dataSource.getWidth()-j.ENTIRE_DIFF_OVERVIEW_WIDTH,i=this.layout((this._startSashPosition+(e.currentX-e.startX))/t);this._sashRatio=i/t,this._dataSource.relayoutEditors()}onSashDragEnd(){this._sash.layout()}onSashReset(){this._sashRatio=.5,this._dataSource.relayoutEditors(),this._sash.layout()}getVerticalSashTop(e){return 0}getVerticalSashLeft(e){return this._sashPosition}getVerticalSashHeight(e){return this._dataSource.getHeight()}_getViewZones(e,t,i,n,o){return new Q(e,t,n.getOption(51),i,o.getOption(51)).getViewZones()}_getOriginalEditorDecorations(e,i,n,o,s){const r=String(this._removeColor);let a={decorations:[],overviewZones:[]},l=o.getModel();for(let o=0,s=e.length;ot?{afterLineNumber:Math.max(e.originalStartLineNumber,e.originalEndLineNumber),heightInLines:i-t,domNode:null}:null}_produceModifiedFromDiff(e,t,i){return t>i?{afterLineNumber:Math.max(e.modifiedStartLineNumber,e.modifiedEndLineNumber),heightInLines:t-i,domNode:null}:null}}class J extends q{constructor(e,t){super(e),this.decorationsLeft=e.getOriginalEditor().getLayoutInfo().decorationsLeft,this._register(e.getOriginalEditor().onDidLayoutChange(t=>{this.decorationsLeft!==t.decorationsLeft&&(this.decorationsLeft=t.decorationsLeft,e.relayoutEditors())}))}setEnableSplitViewResizing(e){}_getViewZones(e,t,i,n,o,s){return new ee(e,t,i,n,o,s).getViewZones()}_getOriginalEditorDecorations(e,i,n,o,s){const r=String(this._removeColor);let a={decorations:[],overviewZones:[]} +;for(let i=0,n=e.length;i`])}h+=this.modifiedEditorOptions.get(85);let p=document.createElement("div");p.className=`view-lines line-delete ${z.MOUSE_CURSOR_TEXT_CSS_CLASS_NAME}`,p.innerHTML=o.build(),u.Configuration.applyFontInfoSlow(p,a);let m=document.createElement("div");return m.className="inline-deleted-margin-view-zone",m.innerHTML=s.join(""),u.Configuration.applyFontInfoSlow(m,a),{shouldNotShrink:!0,afterLineNumber:0===e.modifiedEndLineNumber?e.modifiedStartLineNumber:e.modifiedStartLineNumber-1,heightInLines:t,minWidthInPx:h*c,domNode:p,marginDomNode:m,diff:{originalStartLineNumber:e.originalStartLineNumber,originalEndLineNumber:e.originalEndLineNumber,modifiedStartLineNumber:e.modifiedStartLineNumber,modifiedEndLineNumber:e.modifiedEndLineNumber,originalContent:g}}}_renderOriginalLine(e,t,i,n,o,s,r){ +const a=t.getLineTokens(o),l=a.getLineContent(),d=i.get(36),c=E.LineDecoration.filter(s,o,1,l.length+1);r.appendASCIIString('
    ');const h=x.ViewLineRenderingData.isBasicASCII(l,t.mightContainNonBasicASCII()),u=x.ViewLineRenderingData.containsRTL(l,h,t.mightContainRTL()),g=L.renderViewLine(new L.RenderLineInput(d.isMonospace&&!i.get(24),d.canUseHalfwidthRightwardsArrow,l,!1,h,u,0,a,c,n,0,d.spaceWidth,d.middotWidth,d.wsmiddotWidth,i.get(95),i.get(80),i.get(74),i.get(37)!==_.EditorFontLigatures.OFF,null),r);r.appendASCIIString("
    ");const p=g.characterMapping.getAbsoluteOffsets();return p.length>0?p[p.length-1]:0}}function te(e){return e.modifiedEndLineNumber>0}function ie(e){return e.originalEndLineNumber>0}t.isChangeOrInsert=te,t.isChangeOrDelete=ie,R.registerThemingParticipant((e,t)=>{ +const i=e.getColor(M.diffInserted);i&&(t.addRule(`.monaco-editor .line-insert, .monaco-editor .char-insert { background-color: ${i}; }`),t.addRule(`.monaco-diff-editor .line-insert, .monaco-diff-editor .char-insert { background-color: ${i}; }`),t.addRule(`.monaco-editor .inline-added-margin-view-zone { background-color: ${i}; }`));const n=e.getColor(M.diffRemoved);n&&(t.addRule(`.monaco-editor .line-delete, .monaco-editor .char-delete { background-color: ${n}; }`),t.addRule(`.monaco-diff-editor .line-delete, .monaco-diff-editor .char-delete { background-color: ${n}; }`),t.addRule(`.monaco-editor .inline-deleted-margin-view-zone { background-color: ${n}; }`));const o=e.getColor(M.diffInsertedOutline);o&&t.addRule(`.monaco-editor .line-insert, .monaco-editor .char-insert { border: 1px ${"hc"===e.type?"dashed":"solid"} ${o}; }`);const s=e.getColor(M.diffRemovedOutline);s&&t.addRule(`.monaco-editor .line-delete, .monaco-editor .char-delete { border: 1px ${"hc"===e.type?"dashed":"solid"} ${s}; }`) +;const r=e.getColor(M.scrollbarShadow);r&&t.addRule(`.monaco-diff-editor.side-by-side .editor.modified { box-shadow: -6px 0 5px -5px ${r}; }`);const a=e.getColor(M.diffBorder);a&&t.addRule(`.monaco-diff-editor.side-by-side .editor.modified { border-left: 1px solid ${a}; }`);const l=e.getColor(M.scrollbarSliderBackground);l&&t.addRule(`\n\t\t\t.monaco-diff-editor .diffViewport {\n\t\t\t\tbackground: ${l};\n\t\t\t}\n\t\t`);const d=e.getColor(M.scrollbarSliderHoverBackground);d&&t.addRule(`\n\t\t\t.monaco-diff-editor .diffViewport:hover {\n\t\t\t\tbackground: ${d};\n\t\t\t}\n\t\t`);const c=e.getColor(M.scrollbarSliderActiveBackground);c&&t.addRule(`\n\t\t\t.monaco-diff-editor .diffViewport:active {\n\t\t\t\tbackground: ${c};\n\t\t\t}\n\t\t`);const h=e.getColor(M.diffDiagonalFill) +;t.addRule(`\n\t.monaco-editor .diagonal-fill {\n\t\tbackground-image: linear-gradient(\n\t\t\t-45deg,\n\t\t\t${h} 12.5%,\n\t\t\t#0000 12.5%, #0000 50%,\n\t\t\t${h} 50%, ${h} 62.5%,\n\t\t\t#0000 62.5%, #0000 100%\n\t\t);\n\t\tbackground-size: 8px 8px;\n\t}\n\t`)})})),define(t[178],i([0,1,37,27,138,28,17,10,32,14,62]),(function(e,t,i,n,o,s,r,d,c,h,u){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EmbeddedCodeEditorWidget=void 0;let g=class extends o.CodeEditorWidget{constructor(e,t,i,n,o,s,r,a,l,d){super(e,Object.assign(Object.assign({},i.getRawOptions()),{overflowWidgetsDomNode:i.getOverflowWidgetsDomNode()}),{},n,o,s,r,a,l,d),this._parentEditor=i,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(i.onDidChangeConfiguration(e=>this._onParentConfigurationChanged(e)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){ +i.mixin(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};g=a([l(3,d.IInstantiationService),l(4,n.ICodeEditorService),l(5,s.ICommandService),l(6,r.IContextKeyService),l(7,h.IThemeService),l(8,c.INotificationService),l(9,u.IAccessibilityService)],g),t.EmbeddedCodeEditorWidget=g})),define(t[599],i([0,1,82,2,52,14,49,44,3,40,4,21]),(function(e,t,i,n,o,s,r,d,c,h,u,g){"use strict";function p(e){return e.toString()}Object.defineProperty(t,"__esModule",{value:!0}),t.MarkerDecorationsService=void 0;class m extends n.Disposable{constructor(e){super(),this.model=e,this._markersData=new Map,this._register(n.toDisposable(()=>{this.model.deltaDecorations([...this._markersData.keys()],[]),this._markersData.clear()}))}update(e,t){const i=[...this._markersData.keys()];this._markersData.clear();const n=this.model.deltaDecorations(i,t);for(let t=0;tthis._onModelAdded(e)),this._register(e.onModelAdded(this._onModelAdded,this)),this._register(e.onModelRemoved(this._onModelRemoved,this)),this._register(this._markerService.onMarkerChanged(this._handleMarkerChange,this))}dispose(){super.dispose(),this._markerDecorations.forEach(e=>e.dispose()),this._markerDecorations.clear()}getMarker(e,t){const i=this._markerDecorations.get(p(e.uri));return i&&i.getMarker(t)||null}_handleMarkerChange(e){e.forEach(e=>{const t=this._markerDecorations.get(p(e));t&&this._updateDecorations(t)})}_onModelAdded(e){const t=new m(e);this._markerDecorations.set(p(e.uri),t),this._updateDecorations(t)}_onModelRemoved(e){const t=this._markerDecorations.get(p(e.uri));t&&(t.dispose(),this._markerDecorations.delete(p(e.uri))), +e.uri.scheme!==h.Schemas.inMemory&&e.uri.scheme!==h.Schemas.internal&&e.uri.scheme!==h.Schemas.vscode||this._markerService&&this._markerService.read({resource:e.uri}).map(e=>e.owner).forEach(t=>this._markerService.remove(t,[e.uri]))}_updateDecorations(e){const t=this._markerService.read({resource:e.model.uri,take:500});let i=t.map(t=>({range:this._createDecorationRange(e.model,t),options:this._createDecorationOption(t)}));e.update(t,i)&&this._onDidChangeMarker.fire(e.model)}_createDecorationRange(e,t){let n=c.Range.lift(t);if(t.severity!==i.MarkerSeverity.Hint||this._hasMarkerTag(t,1)||this._hasMarkerTag(t,2)||(n=n.setEndPosition(n.startLineNumber,n.startColumn+2)),(n=e.validateRange(n)).isEmpty()){let t=e.getWordAtPosition(n.getStartPosition());if(t)n=new c.Range(n.startLineNumber,t.startColumn,n.endLineNumber,t.endColumn);else{let t=e.getLineLastNonWhitespaceColumn(n.startLineNumber)||e.getLineMaxColumn(n.startLineNumber) +;1===t||(n=n.endColumn>=t?new c.Range(n.startLineNumber,t-1,n.endLineNumber,t):new c.Range(n.startLineNumber,n.startColumn,n.endLineNumber,n.endColumn+1))}}else if(t.endColumn===Number.MAX_VALUE&&1===t.startColumn&&n.startLineNumber===n.endLineNumber){let i=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);i=0}};f=a([l(0,d.IModelService),l(1,i.IMarkerService)],f),t.MarkerDecorationsService=f})),define(t[600],i([0,1,446,15,2,11,13,3,20,22,52,31,49,21,14,33,325]),(function(e,t,i,n,o,s,r,a,l,d,c,h,u,g,p,m){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BracketMatchingController=void 0;const f=g.registerColor("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hc:"#A0A0A0"},i.localize(0,null));class _ extends s.EditorAction{constructor(){super({id:"editor.action.jumpToBracket",label:i.localize(1,null),alias:"Go to Bracket",precondition:void 0,kbOpts:{ +kbExpr:d.EditorContextKeys.editorTextFocus,primary:3160,weight:100}})}run(e,t){let i=b.get(t);i&&i.jumpToBracket()}}class v extends s.EditorAction{constructor(){super({id:"editor.action.selectToBracket",label:i.localize(2,null),alias:"Select to Bracket",precondition:void 0,description:{description:"Select to Bracket",args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){const n=b.get(t);if(!n)return;let o=!0;i&&!1===i.selectBrackets&&(o=!1),n.selectToBracket(o)}}class C{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}class b extends o.Disposable{constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=[],this._updateBracketsSoon=this._register(new n.RunOnceScheduler(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(55),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(e=>{ +"never"!==this._matchBrackets&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(e=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(e=>{this._lastBracketsData=[],this._decorations=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(e=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(e=>{e.hasChanged(55)&&(this._matchBrackets=this._editor.getOption(55),this._decorations=this._editor.deltaDecorations(this._decorations,[]),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())}))}static get(e){return e.getContribution(b.ID)}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(t=>{const i=t.getStartPosition(),n=e.matchBracket(i);let o=null;if(n)n[0].containsPosition(i)?o=n[1].getStartPosition():n[1].containsPosition(i)&&(o=n[0].getStartPosition());else{ +const t=e.findEnclosingBrackets(i);if(t)o=t[0].getStartPosition();else{const t=e.findNextBracket(i);t&&t.range&&(o=t.range.getStartPosition())}}return o?new l.Selection(o.lineNumber,o.column,o.lineNumber,o.column):new l.Selection(i.lineNumber,i.column,i.lineNumber,i.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(n=>{const o=n.getStartPosition();let s=t.matchBracket(o);if(!s&&!(s=t.findEnclosingBrackets(o))){const e=t.findNextBracket(o);e&&e.range&&(s=t.matchBracket(e.range.getStartPosition()))}let r=null,d=null;if(s){s.sort(a.Range.compareRangesUsingStarts);const[t,i]=s;r=e?t.getStartPosition():t.getEndPosition(),d=e?i.getEndPosition():i.getStartPosition()}r&&d&&i.push(new l.Selection(r.lineNumber,r.column,d.lineNumber,d.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}_updateBrackets(){ +if("never"===this._matchBrackets)return;this._recomputeBrackets();let e=[],t=0;for(const i of this._lastBracketsData){let n=i.brackets;n&&(e[t++]={range:n[0],options:i.options},e[t++]={range:n[1],options:i.options})}this._decorations=this._editor.deltaDecorations(this._decorations,e)}_recomputeBrackets(){if(!this._editor.hasModel())return this._lastBracketsData=[],void(this._lastVersionId=0);const e=this._editor.getSelections();if(e.length>100)return this._lastBracketsData=[],void(this._lastVersionId=0);const t=this._editor.getModel(),i=t.getVersionId();let n=[];this._lastVersionId===i&&(n=this._lastBracketsData);let o=[],s=0;for(let t=0,i=e.length;t1&&o.sort(r.Position.compare);let a=[],l=0,d=0,c=n.length;for(let e=0,i=o.length;e{const i=e.getColor(u.editorBracketMatchBackground);i&&t.addRule(`.monaco-editor .bracket-match { background-color: ${i}; }`);const n=e.getColor(u.editorBracketMatchBorder);n&&t.addRule(`.monaco-editor .bracket-match { border: 1px solid ${n}; }`)}),m.MenuRegistry.appendMenuItem(m.MenuId.MenubarGoMenu,{ +group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:i.localize(3,null)},order:2})})),define(t[601],i([0,1,7,86,4,2,31,451,35,14,21,58,26,326]),(function(e,t,i,n,o,s,r,d,c,h,u,g,p){"use strict";var m;Object.defineProperty(t,"__esModule",{value:!0}),t.LightBulbWidget=void 0,function(e){e.Hidden={type:0};e.Showing=class{constructor(e,t,i,n){this.actions=e,this.trigger=t,this.editorPosition=i,this.widgetPosition=n,this.type=1}}}(m||(m={}));let f=class e extends s.Disposable{constructor(e,t,s,r){super(),this._editor=e,this._quickFixActionId=t,this._preferredFixActionId=s,this._keybindingService=r,this._onClick=this._register(new o.Emitter),this.onClick=this._onClick.event,this._state=m.Hidden,this._domNode=document.createElement("div"),this._domNode.className=p.Codicon.lightBulb.classNames,this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(e=>{const t=this._editor.getModel() +;(1!==this.state.type||!t||this.state.editorPosition.lineNumber>=t.getLineCount())&&this.hide()})),g.Gesture.ignoreTarget(this._domNode),this._register(i.addStandardDisposableGenericMouseDownListner(this._domNode,e=>{if(1!==this.state.type)return;this._editor.focus(),e.preventDefault();const{top:t,height:n}=i.getDomNodePagePosition(this._domNode),o=this._editor.getOption(51);let s=Math.floor(o/3);null!==this.state.widgetPosition.position&&this.state.widgetPosition.position.lineNumber{if(1!=(1&e.buttons))return;this.hide();const t=new n.GlobalMouseMoveMonitor;t.startMonitoring(e.target,e.buttons,n.standardMouseMoveMerger,()=>{},()=>{t.dispose()})})),this._register(this._editor.onDidChangeConfiguration(e=>{e.hasChanged(49)&&!this._editor.getOption(49).enabled&&this.hide()})), +this._updateLightBulbTitleAndIcon(),this._register(this._keybindingService.onDidUpdateKeybindings(this._updateLightBulbTitleAndIcon,this))}dispose(){super.dispose(),this._editor.removeContentWidget(this)}getId(){return"LightBulbWidget"}getDomNode(){return this._domNode}getPosition(){return 1===this._state.type?this._state.widgetPosition:null}update(t,i,n){if(t.validActions.length<=0)return this.hide();const o=this._editor.getOptions();if(!o.get(49).enabled)return this.hide();const s=this._editor.getModel();if(!s)return this.hide();const{lineNumber:a,column:l}=s.validatePosition(n),d=s.getOptions().tabSize,c=o.get(36),h=s.getLineContent(a),u=r.TextModel.computeIndentLevel(h,d),g=e=>e>2&&this._editor.getTopForLineNumber(e)===this._editor.getTopForLineNumber(e-1);let p=a;if(!(c.spaceWidth*u>22))if(a>1&&!g(a-1))p-=1;else if(g(a+1)){if(l*c.spaceWidth<22)return this.hide()}else p+=1;this.state=new m.Showing(t,i,n,{position:{lineNumber:p,column:1},preference:e._posPref}),this._editor.layoutContentWidget(this)} +hide(){this.state=m.Hidden,this._editor.layoutContentWidget(this)}get state(){return this._state}set state(e){this._state=e,this._updateLightBulbTitleAndIcon()}_updateLightBulbTitleAndIcon(){if(1===this.state.type&&this.state.actions.hasAutoFix){i.removeClasses(this._domNode,p.Codicon.lightBulb.classNames),i.addClasses(this._domNode,p.Codicon.lightbulbAutofix.classNames);const e=this._keybindingService.lookupKeybinding(this._preferredFixActionId);if(e)return void(this.title=d.localize(0,null,e.getLabel()))}i.removeClasses(this._domNode,p.Codicon.lightbulbAutofix.classNames),i.addClasses(this._domNode,p.Codicon.lightBulb.classNames);const e=this._keybindingService.lookupKeybinding(this._quickFixActionId);this.title=e?d.localize(1,null,e.getLabel()):d.localize(2,null)}set title(e){this._domNode.title=e}};f._posPref=[0],f=a([l(3,c.IKeybindingService)],f),t.LightBulbWidget=f,h.registerThemingParticipant((e,t)=>{const i=e.getColor(u.editorLightBulbForeground) +;i&&t.addRule(`\n\t\t.monaco-editor .contentWidgets ${p.Codicon.lightBulb.cssSelector} {\n\t\t\tcolor: ${i};\n\t\t}`);const n=e.getColor(u.editorLightBulbAutoFixForeground);n&&t.addRule(`\n\t\t.monaco-editor .contentWidgets ${p.Codicon.lightbulbAutofix.cssSelector} {\n\t\t\tcolor: ${n};\n\t\t}`)})})),define(t[602],i([0,1,26,8,3,31,49,21,14,327]),(function(e,t,i,n,o,s,r,a,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeLensWidget=t.CodeLensHelper=void 0;class d{constructor(e,t){this.afterLineNumber=e,this._onHeight=t,this.heightInLines=1,this.suppressMouseDown=!0,this.domNode=document.createElement("div")}onComputedHeight(e){void 0===this._lastHeight?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}}class c{constructor(e,t,i){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${c._idPool++}`,this.updatePosition(i),this._domNode=document.createElement("span"), +this._domNode.className=`codelens-decoration ${t}`}withCommands(e,t){this._commands.clear();let o="",s=!1;for(let t=0;t${s}`,this._commands.set(String(t),r.command)):o+=`${s}`,t+1 | 
    ")}}s?(o||(o=" "),this._domNode.innerHTML=o,this._isEmpty&&t&&this._domNode.classList.add("fadein"),this._isEmpty=!1):this._domNode.innerHTML="no commands"}getCommand(e){return e.parentElement===this._domNode?this._commands.get(e.id):void 0}getId(){return this._id}getDomNode(){return this._domNode}updatePosition(e){const t=this._editor.getModel().getLineFirstNonWhitespaceColumn(e);this._widgetPosition={position:{lineNumber:e,column:t},preference:[1]}}getPosition(){return this._widgetPosition||null}}c._idPool=0;t.CodeLensHelper=class{constructor(){this._removeDecorations=[],this._addDecorations=[],this._addDecorationsCallbacks=[]} +addDecoration(e,t){this._addDecorations.push(e),this._addDecorationsCallbacks.push(t)}removeDecoration(e){this._removeDecorations.push(e)}commit(e){let t=e.deltaDecorations(this._removeDecorations,this._addDecorations);for(let e=0,i=t.length;e{e.symbol.command&&c.push(e.symbol),n.addDecoration({range:e.symbol.range,options:s.ModelDecorationOptions.EMPTY},e=>this._decorationIds[t]=e),l=l?o.Range.plusRange(l,e.symbol.range):o.Range.lift(e.symbol.range)}),this._viewZone=new d(l.startLineNumber-1,a),this._viewZoneId=r.addZone(this._viewZone),c.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(c,!1))}_createContentWidgetIfNecessary(){this._contentWidget||(this._contentWidget=new c(this._editor,this._className,this._viewZone.afterLineNumber+1), +this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],t&&t.removeZone(this._viewZoneId),this._contentWidget&&(this._editor.removeContentWidget(this._contentWidget),this._contentWidget=void 0),this._isDisposed=!0}isDisposed(){return this._isDisposed}isValid(){return this._decorationIds.some((e,t)=>{const i=this._editor.getModel().getDecorationRange(e),n=this._data[t].symbol;return!(!i||o.Range.isEmpty(n.range)!==i.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((e,i)=>{t.addDecoration({range:e.symbol.range,options:s.ModelDecorationOptions.EMPTY},e=>this._decorationIds[i]=e)})}computeIfNecessary(e){if(!this._viewZone.domNode.hasAttribute("monaco-visible-view-zone"))return null;for(let t=0;t{const i=e.getColor(r.editorCodeLensForeground);i&&(t.addRule(`.monaco-editor .codelens-decoration { color: ${i}; }`),t.addRule(`.monaco-editor .codelens-decoration .codicon { color: ${i}; }`)) +;const n=e.getColor(a.editorActiveLinkForeground);n&&(t.addRule(`.monaco-editor .codelens-decoration > a:hover { color: ${n} !important; }`),t.addRule(`.monaco-editor .codelens-decoration > a:hover .codicon { color: ${n} !important; }`))})})),define(t[603],i([0,1,15,12,2,68,11,18,243,602,28,32,563,7,113,75,452,22]),(function(e,t,i,n,o,s,d,c,h,u,g,p,m,f,_,v,C,b){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeLensContribution=void 0;let S=class{constructor(e,t,i,n){this._editor=e,this._commandService=t,this._notificationService=i,this._codeLensCache=n,this._globalToDispose=new o.DisposableStore,this._localToDispose=new o.DisposableStore,this._lenses=[],this._oldCodeLensModels=new o.DisposableStore,this._modelChangeCounter=0,this._isEnabled=this._editor.getOption(11),this._globalToDispose.add(this._editor.onDidChangeModel(()=>this._onModelChange())),this._globalToDispose.add(this._editor.onDidChangeModelLanguage(()=>this._onModelChange())), +this._globalToDispose.add(this._editor.onDidChangeConfiguration(()=>{const e=this._isEnabled;this._isEnabled=this._editor.getOption(11),e!==this._isEnabled&&this._onModelChange()})),this._globalToDispose.add(c.CodeLensProviderRegistry.onDidChange(this._onModelChange,this)),this._globalToDispose.add(this._editor.onDidChangeConfiguration(e=>{e.hasChanged(36)&&this._updateLensStyle()})),this._onModelChange(),this._styleClassName="_"+_.hash(this._editor.getId()).toString(16),this._styleElement=f.createStyleSheet(f.isInShadowDOM(this._editor.getContainerDomNode())?this._editor.getContainerDomNode():void 0),this._updateLensStyle()}dispose(){this._localDispose(),this._globalToDispose.dispose(),this._oldCodeLensModels.dispose(),o.dispose(this._currentCodeLensModel)}_updateLensStyle(){ +const e=this._editor.getOptions(),t=e.get(36),i=e.get(51),n=Math.round(1.1*i),o=Math.round(.9*t.fontSize),s=`\n\t\t.monaco-editor .codelens-decoration.${this._styleClassName} { height: ${n}px; line-height: ${i}px; font-size: ${o}px; padding-right: ${Math.round(.45*t.fontSize)}px;}\n\t\t.monaco-editor .codelens-decoration.${this._styleClassName} > a > .codicon { line-height: ${i}px; font-size: ${o}px; }\n\t\t`;this._styleElement.textContent=s}_localDispose(){this._currentFindCodeLensSymbolsPromise&&(this._currentFindCodeLensSymbolsPromise.cancel(),this._currentFindCodeLensSymbolsPromise=void 0,this._modelChangeCounter++),this._currentResolveCodeLensSymbolsPromise&&(this._currentResolveCodeLensSymbolsPromise.cancel(),this._currentResolveCodeLensSymbolsPromise=void 0),this._localToDispose.clear(),this._oldCodeLensModels.clear(),o.dispose(this._currentCodeLensModel)}_onModelChange(){this._localDispose();const e=this._editor.getModel();if(!e)return;if(!this._isEnabled)return;const t=this._codeLensCache.get(e) +;if(t&&this._renderCodeLensSymbols(t),!c.CodeLensProviderRegistry.has(e))return void(t&&this._localToDispose.add(i.disposableTimeout(()=>{const i=this._codeLensCache.get(e);t===i&&(this._codeLensCache.delete(e),this._onModelChange())},3e4)));for(const t of c.CodeLensProviderRegistry.all(e))if("function"==typeof t.onDidChange){let e=t.onDidChange(()=>a.schedule());this._localToDispose.add(e)}const r=this._detectVisibleLenses=new i.RunOnceScheduler(()=>this._onViewportChanged(),250),a=new i.RunOnceScheduler(()=>{const t=++this._modelChangeCounter;this._currentFindCodeLensSymbolsPromise&&this._currentFindCodeLensSymbolsPromise.cancel(),this._currentFindCodeLensSymbolsPromise=i.createCancelablePromise(t=>h.getCodeLensData(e,t)),this._currentFindCodeLensSymbolsPromise.then(i=>{t===this._modelChangeCounter&&(this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=i,this._codeLensCache.put(e,i),this._renderCodeLensSymbols(i),r.schedule())},n.onUnexpectedError) +},250);this._localToDispose.add(a),this._localToDispose.add(r),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._editor.changeDecorations(e=>{this._editor.changeViewZones(t=>{let i=[],n=-1;this._lenses.forEach(e=>{e.isValid()&&n!==e.getLineNumber()?(e.update(t),n=e.getLineNumber()):i.push(e)});let o=new u.CodeLensHelper;i.forEach(e=>{e.dispose(o,t),this._lenses.splice(this._lenses.indexOf(e),1)}),o.commit(e)})}),r.schedule(),a.schedule()})),this._localToDispose.add(this._editor.onDidScrollChange(e=>{e.scrollTopChanged&&this._lenses.length>0&&r.schedule()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{r.schedule()})),this._localToDispose.add(o.toDisposable(()=>{if(this._editor.getModel()){const e=s.StableEditorScrollState.capture(this._editor);this._editor.changeDecorations(e=>{this._editor.changeViewZones(t=>{this._disposeAllLenses(e,t)})}),e.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseUp(e=>{ +if(9!==e.target.type)return;let t=e.target.element;if("SPAN"===(null==t?void 0:t.tagName)&&(t=t.parentElement),"A"===(null==t?void 0:t.tagName))for(const e of this._lenses){let i=e.getCommand(t);if(i){this._commandService.executeCommand(i.id,...i.arguments||[]).catch(e=>this._notificationService.error(e));break}}})),a.schedule()}_disposeAllLenses(e,t){const i=new u.CodeLensHelper;for(const e of this._lenses)e.dispose(i,t);e&&i.commit(e),this._lenses=[]}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;let t,i=this._editor.getModel().getLineCount(),n=[];for(let o of e.lenses){let e=o.symbol.range.startLineNumber;e<1||e>i||(t&&t[t.length-1].symbol.range.startLineNumber===e?t.push(o):(t=[o],n.push(t)))}const o=s.StableEditorScrollState.capture(this._editor);this._editor.changeDecorations(e=>{this._editor.changeViewZones(t=>{const i=new u.CodeLensHelper;let o=0,s=0;for(;sthis._detectVisibleLenses&&this._detectVisibleLenses.schedule())),o++,s++)}for(;othis._detectVisibleLenses&&this._detectVisibleLenses.schedule())),s++;i.commit(e)})}),o.restore(this._editor)}_onViewportChanged(){this._currentResolveCodeLensSymbolsPromise&&(this._currentResolveCodeLensSymbolsPromise.cancel(),this._currentResolveCodeLensSymbolsPromise=void 0);const e=this._editor.getModel();if(!e)return;const t=[],o=[];if(this._lenses.forEach(i=>{const n=i.computeIfNecessary(e);n&&(t.push(n),o.push(i))}),0===t.length)return;const s=i.createCancelablePromise(i=>{const s=t.map((t,s)=>{ +const r=new Array(t.length),a=t.map((t,o)=>t.symbol.command||"function"!=typeof t.provider.resolveCodeLens?(r[o]=t.symbol,Promise.resolve(void 0)):Promise.resolve(t.provider.resolveCodeLens(e,t.symbol,i)).then(e=>{r[o]=e},n.onUnexpectedExternalError));return Promise.all(a).then(()=>{i.isCancellationRequested||o[s].isDisposed()||o[s].updateCommands(r)})});return Promise.all(s)});this._currentResolveCodeLensSymbolsPromise=s,this._currentResolveCodeLensSymbolsPromise.then(()=>{this._currentCodeLensModel&&this._codeLensCache.put(e,this._currentCodeLensModel),this._oldCodeLensModels.clear(),s===this._currentResolveCodeLensSymbolsPromise&&(this._currentResolveCodeLensSymbolsPromise=void 0)},e=>{n.onUnexpectedError(e),s===this._currentResolveCodeLensSymbolsPromise&&(this._currentResolveCodeLensSymbolsPromise=void 0)})}getLenses(){return this._lenses}};S.ID="css.editor.codeLens",S=a([l(1,g.ICommandService),l(2,p.INotificationService),l(3,m.ICodeLensCache)],S),t.CodeLensContribution=S, +d.registerEditorContribution(S.ID,S),d.registerEditorAction(class extends d.EditorAction{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:b.EditorContextKeys.hasCodeLensProvider,label:C.localize(0,null),alias:"Show CodeLens Commands For Current Line"})}run(e,t){return r(this,void 0,void 0,(function*(){if(!t.hasModel())return;const i=e.get(v.IQuickInputService),n=e.get(g.ICommandService),o=e.get(p.INotificationService),s=t.getSelection().positionLineNumber,r=t.getContribution(S.ID),a=[];for(let e of r.getLenses())if(e.getLineNumber()===s)for(let t of e.getItems()){const{command:e}=t.symbol;e&&a.push({label:e.title,command:e})}if(0===a.length)return;const l=yield i.pick(a,{canPickMany:!1});if(l)try{yield n.executeCommand(l.command.id,...l.command.arguments||[])}catch(e){o.error(e)}}))}})})),define(t[604],i([0,1,36,7,86,54,29,4,2,21,14,328]),(function(e,t,i,n,o,s,r,a,l,d,c){"use strict";Object.defineProperty(t,"__esModule",{value:!0}), +t.ColorPickerWidget=t.ColorPickerBody=t.ColorPickerHeader=void 0;const h=n.$;class u extends l.Disposable{constructor(e,t,i){super(),this.model=t,this.domNode=h(".colorpicker-header"),n.append(e,this.domNode),this.pickedColorNode=n.append(this.domNode,h(".picked-color"));const o=n.append(this.domNode,h(".original-color"));o.style.backgroundColor=r.Color.Format.CSS.format(this.model.originalColor)||"",this.backgroundColor=i.getColorTheme().getColor(d.editorHoverBackground)||r.Color.white,this._register(c.registerThemingParticipant((e,t)=>{this.backgroundColor=e.getColor(d.editorHoverBackground)||r.Color.white})),this._register(n.addDisposableListener(this.pickedColorNode,n.EventType.CLICK,()=>this.model.selectNextColorPresentation())),this._register(n.addDisposableListener(o,n.EventType.CLICK,()=>{this.model.color=this.model.originalColor,this.model.flushColor()})),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this._register(t.onDidChangePresentation(this.onDidChangePresentation,this)), +this.pickedColorNode.style.backgroundColor=r.Color.Format.CSS.format(t.color)||"",n.toggleClass(this.pickedColorNode,"light",t.color.rgba.a<.5?this.backgroundColor.isLighter():t.color.isLighter())}onDidChangeColor(e){this.pickedColorNode.style.backgroundColor=r.Color.Format.CSS.format(e)||"",n.toggleClass(this.pickedColorNode,"light",e.rgba.a<.5?this.backgroundColor.isLighter():e.isLighter()),this.onDidChangePresentation()}onDidChangePresentation(){this.pickedColorNode.textContent=this.model.presentation?this.model.presentation.label:""}}t.ColorPickerHeader=u;class g extends l.Disposable{constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this.domNode=h(".colorpicker-body"),n.append(e,this.domNode),this.saturationBox=new p(this.domNode,this.model,this.pixelRatio),this._register(this.saturationBox),this._register(this.saturationBox.onDidChange(this.onDidSaturationValueChange,this)),this._register(this.saturationBox.onColorFlushed(this.flushColor,this)),this.opacityStrip=new f(this.domNode,this.model), +this._register(this.opacityStrip),this._register(this.opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this.opacityStrip.onColorFlushed(this.flushColor,this)),this.hueStrip=new _(this.domNode,this.model),this._register(this.hueStrip),this._register(this.hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this.hueStrip.onColorFlushed(this.flushColor,this))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:t}){const i=this.model.color.hsva;this.model.color=new r.Color(new r.HSVA(i.h,e,t,i.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new r.Color(new r.HSVA(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,i=360*(1-e);this.model.color=new r.Color(new r.HSVA(360===i?0:i,t.s,t.v,t.a))}layout(){this.saturationBox.layout(),this.opacityStrip.layout(),this.hueStrip.layout()}}t.ColorPickerBody=g;class p extends l.Disposable{constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this._onDidChange=new a.Emitter, +this.onDidChange=this._onDidChange.event,this._onColorFlushed=new a.Emitter,this.onColorFlushed=this._onColorFlushed.event,this.domNode=h(".saturation-wrap"),n.append(e,this.domNode),this.canvas=document.createElement("canvas"),this.canvas.className="saturation-box",n.append(this.domNode,this.canvas),this.selection=h(".saturation-selection"),n.append(this.domNode,this.selection),this.layout(),this._register(n.addDisposableGenericMouseDownListner(this.domNode,e=>this.onMouseDown(e))),this._register(this.model.onDidChangeColor(this.onDidChangeColor,this)),this.monitor=null}onMouseDown(e){this.monitor=this._register(new o.GlobalMouseMoveMonitor);const t=n.getDomNodePagePosition(this.domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.buttons,o.standardMouseMoveMerger,e=>this.onDidChangePosition(e.posx-t.left,e.posy-t.top),()=>null);const i=n.addDisposableGenericMouseUpListner(document,()=>{this._onColorFlushed.fire(),i.dispose(), +this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)},!0)}onDidChangePosition(e,t){const i=Math.max(0,Math.min(1,e/this.width)),n=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(i,n),this._onDidChange.fire({s:i,v:n})}layout(){this.width=this.domNode.offsetWidth,this.height=this.domNode.offsetHeight,this.canvas.width=this.width*this.pixelRatio,this.canvas.height=this.height*this.pixelRatio,this.paint();const e=this.model.color.hsva;this.paintSelection(e.s,e.v)}paint(){const e=this.model.color.hsva,t=new r.Color(new r.HSVA(e.h,1,1,1)),i=this.canvas.getContext("2d"),n=i.createLinearGradient(0,0,this.canvas.width,0);n.addColorStop(0,"rgba(255, 255, 255, 1)"),n.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),n.addColorStop(1,"rgba(255, 255, 255, 0)");const o=i.createLinearGradient(0,0,0,this.canvas.height);o.addColorStop(0,"rgba(0, 0, 0, 0)"),o.addColorStop(1,"rgba(0, 0, 0, 1)"),i.rect(0,0,this.canvas.width,this.canvas.height),i.fillStyle=r.Color.Format.CSS.format(t),i.fill(),i.fillStyle=n, +i.fill(),i.fillStyle=o,i.fill()}paintSelection(e,t){this.selection.style.left=`${e*this.width}px`,this.selection.style.top=`${this.height-t*this.height}px`}onDidChangeColor(){this.monitor&&this.monitor.isMonitoring()||this.paint()}}class m extends l.Disposable{constructor(e,t){super(),this.model=t,this._onDidChange=new a.Emitter,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new a.Emitter,this.onColorFlushed=this._onColorFlushed.event,this.domNode=n.append(e,h(".strip")),this.overlay=n.append(this.domNode,h(".overlay")),this.slider=n.append(this.domNode,h(".slider")),this.slider.style.top="0px",this._register(n.addDisposableGenericMouseDownListner(this.domNode,e=>this.onMouseDown(e))),this.layout()}layout(){this.height=this.domNode.offsetHeight-this.slider.offsetHeight;const e=this.getValue(this.model.color);this.updateSliderPosition(e)}onMouseDown(e){const t=this._register(new o.GlobalMouseMoveMonitor),i=n.getDomNodePagePosition(this.domNode);n.addClass(this.domNode,"grabbing"), +e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.buttons,o.standardMouseMoveMerger,e=>this.onDidChangeTop(e.posy-i.top),()=>null);const s=n.addDisposableGenericMouseUpListner(document,()=>{this._onColorFlushed.fire(),s.dispose(),t.stopMonitoring(!0),n.removeClass(this.domNode,"grabbing")},!0)}onDidChangeTop(e){const t=Math.max(0,Math.min(1,1-e/this.height));this.updateSliderPosition(t),this._onDidChange.fire(t)}updateSliderPosition(e){this.slider.style.top=`${(1-e)*this.height}px`}}class f extends m{constructor(e,t){super(e,t),n.addClass(this.domNode,"opacity-strip"),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){const{r:t,g:i,b:n}=e.rgba,o=new r.Color(new r.RGBA(t,i,n,1)),s=new r.Color(new r.RGBA(t,i,n,0));this.overlay.style.background=`linear-gradient(to bottom, ${o} 0%, ${s} 100%)`}getValue(e){return e.hsva.a}}class _ extends m{constructor(e,t){super(e,t),n.addClass(this.domNode,"hue-strip")} +getValue(e){return 1-e.hsva.h/360}}class v extends s.Widget{constructor(e,t,n,o){super(),this.model=t,this.pixelRatio=n,this._register(i.onDidChangeZoomLevel(()=>this.layout()));const s=h(".colorpicker-widget");e.appendChild(s);const r=new u(s,this.model,o);this.body=new g(s,this.model,this.pixelRatio),this._register(r),this._register(this.body)}layout(){this.body.layout()}}t.ColorPickerWidget=v})),define(t[605],i([0,1,456,14,21,26,330,331]),(function(e,t,i,n,o,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}), +t.SYMBOL_ICON_VARIABLE_FOREGROUND=t.SYMBOL_ICON_UNIT_FOREGROUND=t.SYMBOL_ICON_TYPEPARAMETER_FOREGROUND=t.SYMBOL_ICON_TEXT_FOREGROUND=t.SYMBOL_ICON_STRUCT_FOREGROUND=t.SYMBOL_ICON_STRING_FOREGROUND=t.SYMBOL_ICON_SNIPPET_FOREGROUND=t.SYMBOL_ICON_REFERENCE_FOREGROUND=t.SYMBOL_ICON_PROPERTY_FOREGROUND=t.SYMBOL_ICON_PACKAGE_FOREGROUND=t.SYMBOL_ICON_OPERATOR_FOREGROUND=t.SYMBOL_ICON_OBJECT_FOREGROUND=t.SYMBOL_ICON_NUMBER_FOREGROUND=t.SYMBOL_ICON_NULL_FOREGROUND=t.SYMBOL_ICON_NAMESPACE_FOREGROUND=t.SYMBOL_ICON_MODULE_FOREGROUND=t.SYMBOL_ICON_METHOD_FOREGROUND=t.SYMBOL_ICON_KEYWORD_FOREGROUND=t.SYMBOL_ICON_KEY_FOREGROUND=t.SYMBOL_ICON_INTERFACE_FOREGROUND=t.SYMBOL_ICON_FUNCTION_FOREGROUND=t.SYMBOL_ICON_FOLDER_FOREGROUND=t.SYMBOL_ICON_FILE_FOREGROUND=t.SYMBOL_ICON_FIELD_FOREGROUND=t.SYMBOL_ICON_EVENT_FOREGROUND=t.SYMBOL_ICON_ENUMERATOR_MEMBER_FOREGROUND=t.SYMBOL_ICON_ENUMERATOR_FOREGROUND=t.SYMBOL_ICON_CONSTRUCTOR_FOREGROUND=t.SYMBOL_ICON_CONSTANT_FOREGROUND=t.SYMBOL_ICON_COLOR_FOREGROUND=t.SYMBOL_ICON_CLASS_FOREGROUND=t.SYMBOL_ICON_BOOLEAN_FOREGROUND=t.SYMBOL_ICON_ARRAY_FOREGROUND=void 0, +t.SYMBOL_ICON_ARRAY_FOREGROUND=o.registerColor("symbolIcon.arrayForeground",{dark:o.foreground,light:o.foreground,hc:o.foreground},i.localize(0,null)),t.SYMBOL_ICON_BOOLEAN_FOREGROUND=o.registerColor("symbolIcon.booleanForeground",{dark:o.foreground,light:o.foreground,hc:o.foreground},i.localize(1,null)),t.SYMBOL_ICON_CLASS_FOREGROUND=o.registerColor("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hc:"#EE9D28"},i.localize(2,null)),t.SYMBOL_ICON_COLOR_FOREGROUND=o.registerColor("symbolIcon.colorForeground",{dark:o.foreground,light:o.foreground,hc:o.foreground},i.localize(3,null)),t.SYMBOL_ICON_CONSTANT_FOREGROUND=o.registerColor("symbolIcon.constantForeground",{dark:o.foreground,light:o.foreground,hc:o.foreground},i.localize(4,null)),t.SYMBOL_ICON_CONSTRUCTOR_FOREGROUND=o.registerColor("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hc:"#B180D7"},i.localize(5,null)),t.SYMBOL_ICON_ENUMERATOR_FOREGROUND=o.registerColor("symbolIcon.enumeratorForeground",{dark:"#EE9D28", +light:"#D67E00",hc:"#EE9D28"},i.localize(6,null)),t.SYMBOL_ICON_ENUMERATOR_MEMBER_FOREGROUND=o.registerColor("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hc:"#75BEFF"},i.localize(7,null)),t.SYMBOL_ICON_EVENT_FOREGROUND=o.registerColor("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hc:"#EE9D28"},i.localize(8,null)),t.SYMBOL_ICON_FIELD_FOREGROUND=o.registerColor("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hc:"#75BEFF"},i.localize(9,null)),t.SYMBOL_ICON_FILE_FOREGROUND=o.registerColor("symbolIcon.fileForeground",{dark:o.foreground,light:o.foreground,hc:o.foreground},i.localize(10,null)),t.SYMBOL_ICON_FOLDER_FOREGROUND=o.registerColor("symbolIcon.folderForeground",{dark:o.foreground,light:o.foreground,hc:o.foreground},i.localize(11,null)),t.SYMBOL_ICON_FUNCTION_FOREGROUND=o.registerColor("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hc:"#B180D7"},i.localize(12,null)), +t.SYMBOL_ICON_INTERFACE_FOREGROUND=o.registerColor("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hc:"#75BEFF"},i.localize(13,null)),t.SYMBOL_ICON_KEY_FOREGROUND=o.registerColor("symbolIcon.keyForeground",{dark:o.foreground,light:o.foreground,hc:o.foreground},i.localize(14,null)),t.SYMBOL_ICON_KEYWORD_FOREGROUND=o.registerColor("symbolIcon.keywordForeground",{dark:o.foreground,light:o.foreground,hc:o.foreground},i.localize(15,null)),t.SYMBOL_ICON_METHOD_FOREGROUND=o.registerColor("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hc:"#B180D7"},i.localize(16,null)),t.SYMBOL_ICON_MODULE_FOREGROUND=o.registerColor("symbolIcon.moduleForeground",{dark:o.foreground,light:o.foreground,hc:o.foreground},i.localize(17,null)),t.SYMBOL_ICON_NAMESPACE_FOREGROUND=o.registerColor("symbolIcon.namespaceForeground",{dark:o.foreground,light:o.foreground,hc:o.foreground},i.localize(18,null)),t.SYMBOL_ICON_NULL_FOREGROUND=o.registerColor("symbolIcon.nullForeground",{dark:o.foreground, +light:o.foreground,hc:o.foreground},i.localize(19,null)),t.SYMBOL_ICON_NUMBER_FOREGROUND=o.registerColor("symbolIcon.numberForeground",{dark:o.foreground,light:o.foreground,hc:o.foreground},i.localize(20,null)),t.SYMBOL_ICON_OBJECT_FOREGROUND=o.registerColor("symbolIcon.objectForeground",{dark:o.foreground,light:o.foreground,hc:o.foreground},i.localize(21,null)),t.SYMBOL_ICON_OPERATOR_FOREGROUND=o.registerColor("symbolIcon.operatorForeground",{dark:o.foreground,light:o.foreground,hc:o.foreground},i.localize(22,null)),t.SYMBOL_ICON_PACKAGE_FOREGROUND=o.registerColor("symbolIcon.packageForeground",{dark:o.foreground,light:o.foreground,hc:o.foreground},i.localize(23,null)),t.SYMBOL_ICON_PROPERTY_FOREGROUND=o.registerColor("symbolIcon.propertyForeground",{dark:o.foreground,light:o.foreground,hc:o.foreground},i.localize(24,null)),t.SYMBOL_ICON_REFERENCE_FOREGROUND=o.registerColor("symbolIcon.referenceForeground",{dark:o.foreground,light:o.foreground,hc:o.foreground},i.localize(25,null)), +t.SYMBOL_ICON_SNIPPET_FOREGROUND=o.registerColor("symbolIcon.snippetForeground",{dark:o.foreground,light:o.foreground,hc:o.foreground},i.localize(26,null)),t.SYMBOL_ICON_STRING_FOREGROUND=o.registerColor("symbolIcon.stringForeground",{dark:o.foreground,light:o.foreground,hc:o.foreground},i.localize(27,null)),t.SYMBOL_ICON_STRUCT_FOREGROUND=o.registerColor("symbolIcon.structForeground",{dark:o.foreground,light:o.foreground,hc:o.foreground},i.localize(28,null)),t.SYMBOL_ICON_TEXT_FOREGROUND=o.registerColor("symbolIcon.textForeground",{dark:o.foreground,light:o.foreground,hc:o.foreground},i.localize(29,null)),t.SYMBOL_ICON_TYPEPARAMETER_FOREGROUND=o.registerColor("symbolIcon.typeParameterForeground",{dark:o.foreground,light:o.foreground,hc:o.foreground},i.localize(30,null)),t.SYMBOL_ICON_UNIT_FOREGROUND=o.registerColor("symbolIcon.unitForeground",{dark:o.foreground,light:o.foreground,hc:o.foreground},i.localize(31,null)),t.SYMBOL_ICON_VARIABLE_FOREGROUND=o.registerColor("symbolIcon.variableForeground",{ +dark:"#75BEFF",light:"#007ACC",hc:"#75BEFF"},i.localize(32,null)),n.registerThemingParticipant((e,i)=>{const n=e.getColor(t.SYMBOL_ICON_ARRAY_FOREGROUND);n&&i.addRule(`${s.Codicon.symbolArray.cssSelector} { color: ${n}; }`);const o=e.getColor(t.SYMBOL_ICON_BOOLEAN_FOREGROUND);o&&i.addRule(`${s.Codicon.symbolBoolean.cssSelector} { color: ${o}; }`);const r=e.getColor(t.SYMBOL_ICON_CLASS_FOREGROUND);r&&i.addRule(`${s.Codicon.symbolClass.cssSelector} { color: ${r}; }`);const a=e.getColor(t.SYMBOL_ICON_METHOD_FOREGROUND);a&&i.addRule(`${s.Codicon.symbolMethod.cssSelector} { color: ${a}; }`);const l=e.getColor(t.SYMBOL_ICON_COLOR_FOREGROUND);l&&i.addRule(`${s.Codicon.symbolColor.cssSelector} { color: ${l}; }`);const d=e.getColor(t.SYMBOL_ICON_CONSTANT_FOREGROUND);d&&i.addRule(`${s.Codicon.symbolConstant.cssSelector} { color: ${d}; }`);const c=e.getColor(t.SYMBOL_ICON_CONSTRUCTOR_FOREGROUND);c&&i.addRule(`${s.Codicon.symbolConstructor.cssSelector} { color: ${c}; }`) +;const h=e.getColor(t.SYMBOL_ICON_ENUMERATOR_FOREGROUND);h&&i.addRule(`\n\t\t\t${s.Codicon.symbolValue.cssSelector},${s.Codicon.symbolEnum.cssSelector} { color: ${h}; }`);const u=e.getColor(t.SYMBOL_ICON_ENUMERATOR_MEMBER_FOREGROUND);u&&i.addRule(`${s.Codicon.symbolEnumMember.cssSelector} { color: ${u}; }`);const g=e.getColor(t.SYMBOL_ICON_EVENT_FOREGROUND);g&&i.addRule(`${s.Codicon.symbolEvent.cssSelector} { color: ${g}; }`);const p=e.getColor(t.SYMBOL_ICON_FIELD_FOREGROUND);p&&i.addRule(`${s.Codicon.symbolField.cssSelector} { color: ${p}; }`);const m=e.getColor(t.SYMBOL_ICON_FILE_FOREGROUND);m&&i.addRule(`${s.Codicon.symbolFile.cssSelector} { color: ${m}; }`);const f=e.getColor(t.SYMBOL_ICON_FOLDER_FOREGROUND);f&&i.addRule(`${s.Codicon.symbolFolder.cssSelector} { color: ${f}; }`);const _=e.getColor(t.SYMBOL_ICON_FUNCTION_FOREGROUND);_&&i.addRule(`${s.Codicon.symbolFunction.cssSelector} { color: ${_}; }`);const v=e.getColor(t.SYMBOL_ICON_INTERFACE_FOREGROUND) +;v&&i.addRule(`${s.Codicon.symbolInterface.cssSelector} { color: ${v}; }`);const C=e.getColor(t.SYMBOL_ICON_KEY_FOREGROUND);C&&i.addRule(`${s.Codicon.symbolKey.cssSelector} { color: ${C}; }`);const b=e.getColor(t.SYMBOL_ICON_KEYWORD_FOREGROUND);b&&i.addRule(`${s.Codicon.symbolKeyword.cssSelector} { color: ${b}; }`);const S=e.getColor(t.SYMBOL_ICON_MODULE_FOREGROUND);S&&i.addRule(`${s.Codicon.symbolModule.cssSelector} { color: ${S}; }`);const w=e.getColor(t.SYMBOL_ICON_NAMESPACE_FOREGROUND);w&&i.addRule(`${s.Codicon.symbolNamespace.cssSelector} { color: ${w}; }`);const y=e.getColor(t.SYMBOL_ICON_NULL_FOREGROUND);y&&i.addRule(`${s.Codicon.symbolNull.cssSelector} { color: ${y}; }`);const E=e.getColor(t.SYMBOL_ICON_NUMBER_FOREGROUND);E&&i.addRule(`${s.Codicon.symbolNumber.cssSelector} { color: ${E}; }`);const L=e.getColor(t.SYMBOL_ICON_OBJECT_FOREGROUND);L&&i.addRule(`${s.Codicon.symbolObject.cssSelector} { color: ${L}; }`);const x=e.getColor(t.SYMBOL_ICON_OPERATOR_FOREGROUND) +;x&&i.addRule(`${s.Codicon.symbolOperator.cssSelector} { color: ${x}; }`);const D=e.getColor(t.SYMBOL_ICON_PACKAGE_FOREGROUND);D&&i.addRule(`${s.Codicon.symbolPackage.cssSelector} { color: ${D}; }`);const k=e.getColor(t.SYMBOL_ICON_PROPERTY_FOREGROUND);k&&i.addRule(`${s.Codicon.symbolProperty.cssSelector} { color: ${k}; }`);const N=e.getColor(t.SYMBOL_ICON_REFERENCE_FOREGROUND);N&&i.addRule(`${s.Codicon.symbolReference.cssSelector} { color: ${N}; }`);const I=e.getColor(t.SYMBOL_ICON_SNIPPET_FOREGROUND);I&&i.addRule(`${s.Codicon.symbolSnippet.cssSelector} { color: ${I}; }`);const M=e.getColor(t.SYMBOL_ICON_STRING_FOREGROUND);M&&i.addRule(`${s.Codicon.symbolString.cssSelector} { color: ${M}; }`);const R=e.getColor(t.SYMBOL_ICON_STRUCT_FOREGROUND);R&&i.addRule(`${s.Codicon.symbolStruct.cssSelector} { color: ${R}; }`);const T=e.getColor(t.SYMBOL_ICON_TEXT_FOREGROUND);T&&i.addRule(`${s.Codicon.symbolText.cssSelector} { color: ${T}; }`);const O=e.getColor(t.SYMBOL_ICON_TYPEPARAMETER_FOREGROUND) +;O&&i.addRule(`${s.Codicon.symbolTypeParameter.cssSelector} { color: ${O}; }`);const A=e.getColor(t.SYMBOL_ICON_UNIT_FOREGROUND);A&&i.addRule(`${s.Codicon.symbolUnit.cssSelector} { color: ${A}; }`);const P=e.getColor(t.SYMBOL_ICON_VARIABLE_FOREGROUND);P&&i.addRule(`${s.Codicon.symbolVariable.cssSelector} { color: ${P}; }`)})})),define(t[606],i([0,1,3,52,31,21,14]),(function(e,t,i,n,o,s,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FindDecorations=void 0;class a{constructor(e){this._editor=e,this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null,this._startPosition=this._editor.getPosition()}dispose(){this._editor.deltaDecorations(this._allDecorations(),[]),this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}reset(){this._decorations=[], +this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}getCount(){return this._decorations.length}getFindScope(){return this._findScopeDecorationIds[0]?this._editor.getModel().getDecorationRange(this._findScopeDecorationIds[0]):null}getFindScopes(){if(this._findScopeDecorationIds.length){const e=this._findScopeDecorationIds.map(e=>this._editor.getModel().getDecorationRange(e)).filter(e=>!!e);if(e.length)return e}return null}getStartPosition(){return this._startPosition}setStartPosition(e){this._startPosition=e,this.setCurrentFindMatch(null)}_getDecorationIndex(e){const t=this._decorations.indexOf(e);return t>=0?t+1:1}getCurrentMatchesPosition(e){let t=this._editor.getModel().getDecorationsInRange(e);for(const e of t){const t=e.options;if(t===a._FIND_MATCH_DECORATION||t===a._CURRENT_FIND_MATCH_DECORATION)return this._getDecorationIndex(e.id)}return 0}setCurrentFindMatch(e){let t=null,n=0 +;if(e)for(let i=0,o=this._decorations.length;i{if(null!==this._highlightedDecorationId&&(e.changeDecorationOptions(this._highlightedDecorationId,a._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),null!==t&&(this._highlightedDecorationId=t,e.changeDecorationOptions(this._highlightedDecorationId,a._CURRENT_FIND_MATCH_DECORATION)),null!==this._rangeHighlightDecorationId&&(e.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),null!==t){let n=this._editor.getModel().getDecorationRange(t);if(n.startLineNumber!==n.endLineNumber&&1===n.endColumn){let e=n.endLineNumber-1,t=this._editor.getModel().getLineMaxColumn(e);n=new i.Range(n.startLineNumber,n.startColumn,e,t)}this._rangeHighlightDecorationId=e.addDecoration(n,a._RANGE_HIGHLIGHT_DECORATION)} +}),n}set(e,t){this._editor.changeDecorations(n=>{let o=a._FIND_MATCH_DECORATION,s=[];if(e.length>1e3){o=a._FIND_MATCH_NO_OVERVIEW_DECORATION;const t=this._editor.getModel().getLineCount(),n=this._editor.getLayoutInfo().height/t,r=Math.max(2,Math.ceil(3/n));let l=e[0].range.startLineNumber,d=e[0].range.endLineNumber;for(let t=1,n=e.length;t=n.startLineNumber?n.endLineNumber>d&&(d=n.endLineNumber):(s.push({range:new i.Range(l,1,d,1),options:a._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),l=n.startLineNumber,d=n.endLineNumber)}s.push({range:new i.Range(l,1,d,1),options:a._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}let r=new Array(e.length);for(let t=0,i=e.length;tn.removeDecoration(e)),this._findScopeDecorationIds=[]),(null==t?void 0:t.length)&&(this._findScopeDecorationIds=t.map(e=>n.addDecoration(e,a._FIND_SCOPE_DECORATION)))})}matchBeforePosition(e){if(0===this._decorations.length)return null;for(let t=this._decorations.length-1;t>=0;t--){let i=this._decorations[t],n=this._editor.getModel().getDecorationRange(i);if(n&&!(n.endLineNumber>e.lineNumber)){if(n.endLineNumbere.column))return n}}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(0===this._decorations.length)return null;for(let t=0,i=this._decorations.length;te.lineNumber)return n;if(!(n.startColumnthis.research(!1),100),this._toDispose.add(this._updateDecorationsScheduler),this._toDispose.add(this._editor.onDidChangeCursorPosition(e=>{3!==e.reason&&5!==e.reason&&6!==e.reason||this._decorations.setStartPosition(this._editor.getPosition())})),this._ignoreModelContentChanged=!1,this._toDispose.add(this._editor.onDidChangeModelContent(e=>{ +this._ignoreModelContentChanged||(e.isFlush&&this._decorations.reset(),this._decorations.setStartPosition(this._editor.getPosition()),this._updateDecorationsScheduler.schedule())})),this._toDispose.add(this._state.onFindReplaceStateChange(e=>this._onStateChanged(e))),this.research(!1,this._state.searchScope)}dispose(){this._isDisposed=!0,n.dispose(this._startSearchingTimer),this._toDispose.dispose()}_onStateChanged(e){if(!this._isDisposed&&this._editor.hasModel()&&(e.searchString||e.isReplaceRevealed||e.isRegex||e.wholeWord||e.matchCase||e.searchScope)){this._editor.getModel().isTooLargeForSyncing()?(this._startSearchingTimer.cancel(),this._startSearchingTimer.setIfNotSet(()=>{e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor)},p)):e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor)}}static _getSearchRange(e,t){return t||e.getFullModelRange()}research(e,i){let n=null +;void 0!==i?null!==i&&(n=Array.isArray(i)?i:[i]):n=this._decorations.getFindScopes(),null!==n&&(n=n.map(e=>{if(e.startLineNumber!==e.endLineNumber){let t=e.endLineNumber;return 1===e.endColumn&&(t-=1),new r.Range(e.startLineNumber,1,t,this._editor.getModel().getLineMaxColumn(t))}return e}));let o=this._findMatches(n,!1,t.MATCHES_LIMIT);this._decorations.set(o,n);const s=this._editor.getSelection();let a=this._decorations.getCurrentMatchesPosition(s);if(0===a&&o.length>0){const e=g.findFirstInSorted(o.map(e=>e.range),e=>r.Range.compareRangesUsingStarts(e,s)>=0);a=e>0?e-1+1:a}this._state.changeMatchInfo(a,this._decorations.getCount(),void 0),e&&this._editor.getOption(29).cursorMoveOnType&&this._moveToNextMatch(this._decorations.getStartPosition())}_hasMatches(){return this._state.matchesCount>0}_cannotFind(){if(!this._hasMatches()){let e=this._decorations.getFindScope();return e&&this._editor.revealRangeInCenterIfOutsideViewport(e,0),!0}return!1}_setCurrentFindMatch(e){ +let t=this._decorations.setCurrentFindMatch(e);this._state.changeMatchInfo(t,this._decorations.getCount(),e),this._editor.setSelection(e),this._editor.revealRangeInCenterIfOutsideViewport(e,0)}_prevSearchPosition(e){let t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0),{lineNumber:i,column:n}=e,o=this._editor.getModel();return t||1===n?(1===i?i=o.getLineCount():i--,n=o.getLineMaxColumn(i)):n--,new s.Position(i,n)}_moveToPrevMatch(e,i=!1){if(!this._state.canNavigateBack()){const t=this._decorations.matchAfterPosition(e);return void(t&&this._setCurrentFindMatch(t))}if(this._decorations.getCount()=0||this._state.searchString.indexOf("$")>=0),{lineNumber:i,column:n}=e,o=this._editor.getModel() +;return t||n===o.getLineMaxColumn(i)?(i===o.getLineCount()?i=1:i++,n=1):n++,new s.Position(i,n)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const t=this._decorations.matchBeforePosition(e);return void(t&&this._setCurrentFindMatch(t))}if(this._decorations.getCount()m._getSearchRange(this._editor.getModel(),e));return this._editor.getModel().findMatches(this._state.searchString,n,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(105):null,t,i)}replaceAll(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();null===e&&this._state.matchesCount>=t.MATCHES_LIMIT?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const e=new l.SearchParams(this._state.searchString,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(105):null).parseSearchRequest();if(!e)return +;let t=e.regex;if(!t.multiline){let e="mu";t.ignoreCase&&(e+="i"),t.global&&(e+="g"),t=new RegExp(t.source,e)}const i=this._editor.getModel(),n=i.getValue(1),s=i.getFullModelRange(),r=this._getReplacePattern();let a;const d=this._state.preserveCase;a=r.hasReplacementPatterns||d?n.replace(t,(function(){return r.buildReplaceString(arguments,d)})):n.replace(t,r.buildReplaceString(null,d));let c=new o.ReplaceCommandThatPreservesSelection(s,a,this._editor.getSelection());this._executeEditorCommand("replaceAll",c)}_regularReplaceAll(e){const t=this._getReplacePattern();let i=this._findMatches(e,t.hasReplacementPatterns||this._state.preserveCase,1073741824),n=[];for(let e=0,o=i.length;ee.range),n);this._executeEditorCommand("replaceAll",o)}selectAllMatches(){if(!this._hasMatches())return +;let e=this._decorations.getFindScopes(),t=this._findMatches(e,!1,1073741824).map(e=>new a.Selection(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn)),i=this._editor.getSelection();for(let e=0,n=t.length;ethis._hide(),2e3)),this._isVisible=!1,this._editor=e,this._state=t,this._keybindingService=o,this._domNode=document.createElement("div"), +this._domNode.className="findOptionsWidget",this._domNode.style.display="none",this._domNode.style.top="10px",this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true");const d=l.getColorTheme().getColor(a.inputActiveOptionBorder),c=l.getColorTheme().getColor(a.inputActiveOptionForeground),h=l.getColorTheme().getColor(a.inputActiveOptionBackground);this.caseSensitive=this._register(new n.CaseSensitiveCheckbox({appendTitle:this._keybindingLabelFor(r.FIND_IDS.ToggleCaseSensitiveCommand),isChecked:this._state.matchCase,inputActiveOptionBorder:d,inputActiveOptionForeground:c,inputActiveOptionBackground:h})),this._domNode.appendChild(this.caseSensitive.domNode),this._register(this.caseSensitive.onChange(()=>{this._state.change({matchCase:this.caseSensitive.checked},!1)})),this.wholeWords=this._register(new n.WholeWordsCheckbox({appendTitle:this._keybindingLabelFor(r.FIND_IDS.ToggleWholeWordCommand),isChecked:this._state.wholeWord,inputActiveOptionBorder:d, +inputActiveOptionForeground:c,inputActiveOptionBackground:h})),this._domNode.appendChild(this.wholeWords.domNode),this._register(this.wholeWords.onChange(()=>{this._state.change({wholeWord:this.wholeWords.checked},!1)})),this.regex=this._register(new n.RegexCheckbox({appendTitle:this._keybindingLabelFor(r.FIND_IDS.ToggleRegexCommand),isChecked:this._state.isRegex,inputActiveOptionBorder:d,inputActiveOptionForeground:c,inputActiveOptionBackground:h})),this._domNode.appendChild(this.regex.domNode),this._register(this.regex.onChange(()=>{this._state.change({isRegex:this.regex.checked},!1)})),this._editor.addOverlayWidget(this),this._register(this._state.onFindReplaceStateChange(e=>{let t=!1;e.isRegex&&(this.regex.checked=this._state.isRegex,t=!0),e.wholeWord&&(this.wholeWords.checked=this._state.wholeWord,t=!0),e.matchCase&&(this.caseSensitive.checked=this._state.matchCase,t=!0),!this._state.isRevealed&&t&&this._revealTemporarily()})), +this._register(i.addDisposableNonBubblingMouseOutListener(this._domNode,e=>this._onMouseOut())),this._register(i.addDisposableListener(this._domNode,"mouseover",e=>this._onMouseOver())),this._applyTheme(l.getColorTheme()),this._register(l.onDidColorThemeChange(this._applyTheme.bind(this)))}_keybindingLabelFor(e){let t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return d.ID}getDomNode(){return this._domNode}getPosition(){return{preference:0}}highlightFindOptions(){this._revealTemporarily()}_revealTemporarily(){this._show(),this._hideSoon.schedule()}_onMouseOut(){this._hideSoon.schedule()}_onMouseOver(){this._hideSoon.cancel()}_show(){this._isVisible||(this._isVisible=!0,this._domNode.style.display="block")}_hide(){this._isVisible&&(this._isVisible=!1,this._domNode.style.display="none")}_applyTheme(e){let t={inputActiveOptionBorder:e.getColor(a.inputActiveOptionBorder), +inputActiveOptionForeground:e.getColor(a.inputActiveOptionForeground),inputActiveOptionBackground:e.getColor(a.inputActiveOptionBackground)};this.caseSensitive.style(t),this.wholeWords.style(t),this.regex.style(t)}}t.FindOptionsWidget=d,d.ID="editor.contrib.findOptionsWidget",l.registerThemingParticipant((e,t)=>{const i=e.getColor(a.editorWidgetBackground);i&&t.addRule(`.monaco-editor .findOptionsWidget { background-color: ${i}; }`);const n=e.getColor(a.editorWidgetForeground);n&&t.addRule(`.monaco-editor .findOptionsWidget { color: ${n}; }`);const o=e.getColor(a.widgetShadow);o&&t.addRule(`.monaco-editor .findOptionsWidget { box-shadow: 0 2px 8px ${o}; }`);const s=e.getColor(a.contrastBorder);s&&t.addRule(`.monaco-editor .findOptionsWidget { border: 2px solid ${s}; }`)})})),define(t[608],i([0,1,4,2,3,139]),(function(e,t,i,n,o,s){"use strict";function r(e,t){return 1===e||2!==e&&t}Object.defineProperty(t,"__esModule",{value:!0}),t.FindReplaceState=void 0;class a extends n.Disposable{constructor(){super(), +this._onFindReplaceStateChange=this._register(new i.Emitter),this.onFindReplaceStateChange=this._onFindReplaceStateChange.event,this._searchString="",this._replaceString="",this._isRevealed=!1,this._isReplaceRevealed=!1,this._isRegex=!1,this._isRegexOverride=0,this._wholeWord=!1,this._wholeWordOverride=0,this._matchCase=!1,this._matchCaseOverride=0,this._preserveCase=!1,this._preserveCaseOverride=0,this._searchScope=null,this._matchesPosition=0,this._matchesCount=0,this._currentMatch=null,this._loop=!0}get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return r(this._isRegexOverride,this._isRegex)}get wholeWord(){return r(this._wholeWordOverride,this._wholeWord)}get matchCase(){return r(this._matchCaseOverride,this._matchCase)}get preserveCase(){return r(this._preserveCaseOverride,this._preserveCase)}get actualIsRegex(){return this._isRegex} +get actualWholeWord(){return this._wholeWord}get actualMatchCase(){return this._matchCase}get actualPreserveCase(){return this._preserveCase}get searchScope(){return this._searchScope}get matchesPosition(){return this._matchesPosition}get matchesCount(){return this._matchesCount}get currentMatch(){return this._currentMatch}changeMatchInfo(e,t,i){let n={moveCursor:!1,updateHistory:!1,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1},s=!1;0===t&&(e=0),e>t&&(e=t),this._matchesPosition!==e&&(this._matchesPosition=e,n.matchesPosition=!0,s=!0),this._matchesCount!==t&&(this._matchesCount=t,n.matchesCount=!0,s=!0),void 0!==i&&(o.Range.equalsRange(this._currentMatch,i)||(this._currentMatch=i,n.currentMatch=!0,s=!0)),s&&this._onFindReplaceStateChange.fire(n)}change(e,t,i=!0){var n;let s={moveCursor:t,updateHistory:i,searchString:!1,replaceString:!1,isRevealed:!1, +isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1},r=!1;const a=this.isRegex,l=this.wholeWord,d=this.matchCase,c=this.preserveCase;void 0!==e.searchString&&this._searchString!==e.searchString&&(this._searchString=e.searchString,s.searchString=!0,r=!0),void 0!==e.replaceString&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,s.replaceString=!0,r=!0),void 0!==e.isRevealed&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,s.isRevealed=!0,r=!0),void 0!==e.isReplaceRevealed&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,s.isReplaceRevealed=!0,r=!0),void 0!==e.isRegex&&(this._isRegex=e.isRegex),void 0!==e.wholeWord&&(this._wholeWord=e.wholeWord),void 0!==e.matchCase&&(this._matchCase=e.matchCase),void 0!==e.preserveCase&&(this._preserveCase=e.preserveCase), +void 0!==e.searchScope&&((null===(n=e.searchScope)||void 0===n?void 0:n.every(e=>{var t;return null===(t=this._searchScope)||void 0===t?void 0:t.some(t=>!o.Range.equalsRange(t,e))}))||(this._searchScope=e.searchScope,s.searchScope=!0,r=!0)),void 0!==e.loop&&this._loop!==e.loop&&(this._loop=e.loop,s.loop=!0,r=!0),this._isRegexOverride=void 0!==e.isRegexOverride?e.isRegexOverride:0,this._wholeWordOverride=void 0!==e.wholeWordOverride?e.wholeWordOverride:0,this._matchCaseOverride=void 0!==e.matchCaseOverride?e.matchCaseOverride:0,this._preserveCaseOverride=void 0!==e.preserveCaseOverride?e.preserveCaseOverride:0,a!==this.isRegex&&(r=!0,s.isRegex=!0),l!==this.wholeWord&&(r=!0,s.wholeWord=!0),d!==this.matchCase&&(r=!0,s.matchCase=!0),c!==this.preserveCase&&(r=!0,s.preserveCase=!0),r&&this._onFindReplaceStateChange.fire(s)}canNavigateBack(){return this.canNavigateInLoop()||1!==this.matchesPosition}canNavigateForward(){return this.canNavigateInLoop()||this.matchesPosition=s.MATCHES_LIMIT}}t.FindReplaceState=a})),define(t[609],i([0,1,458,7,48,152,117,54,15,12,2,16,8,3,139,21,14,550,26,332]),(function(e,t,i,n,o,s,a,l,d,c,h,u,g,p,m,f,_,v,C){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SimpleButton=t.FindWidget=t.FindWidgetViewZone=t.findNextMatchIcon=t.findPreviousMatchIcon=t.findReplaceAllIcon=t.findReplaceIcon=t.findCloseIcon=void 0;const b=C.registerIcon("find-selection",C.Codicon.selection),S=C.registerIcon("find-collapsed",C.Codicon.chevronRight),w=C.registerIcon("find-expanded",C.Codicon.chevronDown);t.findCloseIcon=C.registerIcon("find-close",C.Codicon.close),t.findReplaceIcon=C.registerIcon("find-replace",C.Codicon.replace),t.findReplaceAllIcon=C.registerIcon("find-replace-all",C.Codicon.replaceAll),t.findPreviousMatchIcon=C.registerIcon("find-previous-match",C.Codicon.arrowUp),t.findNextMatchIcon=C.registerIcon("find-next-match",C.Codicon.arrowDown) +;const y=i.localize(0,null),E=i.localize(1,null),L=i.localize(2,null),x=i.localize(3,null),D=i.localize(4,null),k=i.localize(5,null),N=i.localize(6,null),I=i.localize(7,null),M=i.localize(8,null),R=i.localize(9,null),T=i.localize(10,null),O=i.localize(11,null,m.MATCHES_LIMIT),A=i.localize(12,null),P=i.localize(13,null),F=419,W=221;let B=69;const V=33,z="ctrlEnterReplaceAll.windows.donotask",H=u.isMacintosh?256:2048;class K{constructor(e){this.afterLineNumber=e,this.heightInPx=V,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function U(e,t,i){const n=!!t.match(/\n/);i&&n&&i.selectionStart>0&&e.stopPropagation()}function $(e,t,i){const n=!!t.match(/\n/);i&&n&&i.selectionEndthis._updateHistoryDelayer.cancel())),this._register(this._state.onFindReplaceStateChange(e=>this._onStateChanged(e))),this._buildDomNode(),this._updateButtons(),this._tryUpdateWidgetWidth(),this._findInput.inputBox.layout(),this._register(this._codeEditor.onDidChangeConfiguration(e=>{if(e.hasChanged(72)&&(this._codeEditor.getOption(72)&&this._state.change({isReplaceRevealed:!1},!1),this._updateButtons()),e.hasChanged(117)&&this._tryUpdateWidgetWidth(),e.hasChanged(2)&&this.updateAccessibilitySupport(),e.hasChanged(29)){const e=this._codeEditor.getOption(29).addExtraSpaceOnTop;e&&!this._viewZone&&(this._viewZone=new K(0),this._showViewZone()),!e&&this._viewZone&&this._removeViewZone()} +})),this.updateAccessibilitySupport(),this._register(this._codeEditor.onDidChangeCursorSelection(()=>{this._isVisible&&this._updateToggleSelectionFindButton()})),this._register(this._codeEditor.onDidFocusEditorWidget(()=>r(this,void 0,void 0,(function*(){if(this._isVisible){let e=yield this._controller.getGlobalBufferTerm();e&&e!==this._state.searchString&&(this._state.change({searchString:e},!0),this._findInput.select())}})))),this._findInputFocused=m.CONTEXT_FIND_INPUT_FOCUSED.bindTo(a),this._findFocusTracker=this._register(n.trackFocus(this._findInput.inputBox.inputElement)),this._register(this._findFocusTracker.onDidFocus(()=>{this._findInputFocused.set(!0),this._updateSearchScope()})),this._register(this._findFocusTracker.onDidBlur(()=>{this._findInputFocused.set(!1)})),this._replaceInputFocused=m.CONTEXT_REPLACE_INPUT_FOCUSED.bindTo(a),this._replaceFocusTracker=this._register(n.trackFocus(this._replaceInput.inputBox.inputElement)),this._register(this._replaceFocusTracker.onDidFocus(()=>{ +this._replaceInputFocused.set(!0),this._updateSearchScope()})),this._register(this._replaceFocusTracker.onDidBlur(()=>{this._replaceInputFocused.set(!1)})),this._codeEditor.addOverlayWidget(this),this._codeEditor.getOption(29).addExtraSpaceOnTop&&(this._viewZone=new K(0)),this._applyTheme(l.getColorTheme()),this._register(l.onDidColorThemeChange(this._applyTheme.bind(this))),this._register(this._codeEditor.onDidChangeModel(()=>{this._isVisible&&(this._viewZoneId=void 0)})),this._register(this._codeEditor.onDidScrollChange(e=>{e.scrollTopChanged?this._layoutViewZone():setTimeout(()=>{this._layoutViewZone()},0)}))}getId(){return j.ID}getDomNode(){return this._domNode}getPosition(){return this._isVisible?{preference:0}:null}_onStateChanged(e){if(e.searchString){try{this._ignoreChangeEvent=!0,this._findInput.setValue(this._state.searchString)}finally{this._ignoreChangeEvent=!1}this._updateButtons()}if(e.replaceString&&(this._replaceInput.inputBox.value=this._state.replaceString), +e.isRevealed&&(this._state.isRevealed?this._reveal():this._hide(!0)),e.isReplaceRevealed&&(this._state.isReplaceRevealed?this._codeEditor.getOption(72)||this._isReplaceVisible||(this._isReplaceVisible=!0,this._replaceInput.width=n.getTotalWidth(this._findInput.domNode),this._updateButtons(),this._replaceInput.inputBox.layout()):this._isReplaceVisible&&(this._isReplaceVisible=!1,this._updateButtons())),(e.isRevealed||e.isReplaceRevealed)&&(this._state.isRevealed||this._state.isReplaceRevealed)&&this._tryUpdateHeight()&&this._showViewZone(),e.isRegex&&this._findInput.setRegex(this._state.isRegex),e.wholeWord&&this._findInput.setWholeWords(this._state.wholeWord),e.matchCase&&this._findInput.setCaseSensitive(this._state.matchCase),e.searchScope&&(this._state.searchScope?this._toggleSelectionFind.checked=!0:this._toggleSelectionFind.checked=!1,this._updateToggleSelectionFindButton()),e.searchString||e.matchesCount||e.matchesPosition){let e=this._state.searchString.length>0&&0===this._state.matchesCount +;n.toggleClass(this._domNode,"no-results",e),this._updateMatchesCount(),this._updateButtons()}(e.searchString||e.currentMatch)&&this._layoutViewZone(),e.updateHistory&&this._delayedUpdateHistory(),e.loop&&this._updateButtons()}_delayedUpdateHistory(){this._updateHistoryDelayer.trigger(this._updateHistory.bind(this))}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){let e;if(this._matchesCount.style.minWidth=B+"px",this._state.matchesCount>=m.MATCHES_LIMIT?this._matchesCount.title=O:this._matchesCount.title="",this._matchesCount.firstChild&&this._matchesCount.removeChild(this._matchesCount.firstChild),this._state.matchesCount>0){let t=String(this._state.matchesCount);this._state.matchesCount>=m.MATCHES_LIMIT&&(t+="+");let i=String(this._state.matchesPosition);"0"===i&&(i="?"),e=g.format(A,i,t)}else e=P;this._matchesCount.appendChild(document.createTextNode(e)), +o.alert(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),B=Math.max(B,this._matchesCount.clientWidth)}_getAriaLabel(e,t,n){if(e===P)return""===n?i.localize(14,null,e):i.localize(15,null,e,n);if(t){const o=i.localize(16,null,e,n,t.startLineNumber+":"+t.startColumn),s=this._codeEditor.getModel();if(s&&t.startLineNumber<=s.getLineCount()&&t.startLineNumber>=1){return`${s.getLineContent(t.startLineNumber)}, ${o}`}return o}return i.localize(17,null,e,n)}_updateToggleSelectionFindButton(){let e=this._codeEditor.getSelection(),t=!!e&&(e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn),i=this._toggleSelectionFind.checked;this._isVisible&&(i||t)?this._toggleSelectionFind.enable():this._toggleSelectionFind.disable()}_updateButtons(){this._findInput.setEnabled(this._isVisible),this._replaceInput.setEnabled(this._isVisible&&this._isReplaceVisible),this._updateToggleSelectionFindButton(),this._closeBtn.setEnabled(this._isVisible) +;let e=this._state.searchString.length>0,t=!!this._state.matchesCount;this._prevBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateBack()),this._nextBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateForward()),this._replaceBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._replaceAllBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),n.toggleClass(this._domNode,"replaceToggled",this._isReplaceVisible),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible);let i=!this._codeEditor.getOption(72);this._toggleReplaceBtn.setEnabled(this._isVisible&&i)}_reveal(){if(!this._isVisible){this._isVisible=!0;const e=this._codeEditor.getSelection();switch(this._codeEditor.getOption(29).autoFindInSelection){case"always":this._toggleSelectionFind.checked=!0;break;case"never":this._toggleSelectionFind.checked=!1;break;case"multiline":const t=!!e&&e.startLineNumber!==e.endLineNumber;this._toggleSelectionFind.checked=t}this._tryUpdateWidgetWidth(),this._updateButtons(), +setTimeout(()=>{n.addClass(this._domNode,"visible"),this._domNode.setAttribute("aria-hidden","false")},0),setTimeout(()=>{this._findInput.validate()},200),this._codeEditor.layoutOverlayWidget(this);let t=!0;if(this._codeEditor.getOption(29).seedSearchStringFromSelection&&e){const i=this._codeEditor.getDomNode();if(i){const o=n.getDomNodePagePosition(i),s=this._codeEditor.getScrolledVisiblePosition(e.getStartPosition()),r=o.left+(s?s.left:0),a=s?s.top:0;if(this._viewZone&&ae.startLineNumber&&(t=!1);const i=n.getTopLeftOffset(this._domNode).left;r>i&&(t=!1);const s=this._codeEditor.getScrolledVisiblePosition(e.getEndPosition());o.left+(s?s.left:0)>i&&(t=!1)}}}this._showViewZone(t)}}_hide(e){this._isVisible&&(this._isVisible=!1,this._updateButtons(),n.removeClass(this._domNode,"visible"),this._domNode.setAttribute("aria-hidden","true"),this._findInput.clearMessage(),e&&this._codeEditor.focus(),this._codeEditor.layoutOverlayWidget(this),this._removeViewZone())} +_layoutViewZone(){if(!this._codeEditor.getOption(29).addExtraSpaceOnTop)return void this._removeViewZone();if(!this._isVisible)return;const e=this._viewZone;void 0===this._viewZoneId&&e&&this._codeEditor.changeViewZones(t=>{e.heightInPx=this._getHeight(),this._viewZoneId=t.addZone(e),this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+e.heightInPx)})}_showViewZone(e=!0){if(!this._isVisible)return;if(!this._codeEditor.getOption(29).addExtraSpaceOnTop)return;void 0===this._viewZone&&(this._viewZone=new K(0));const t=this._viewZone;this._codeEditor.changeViewZones(i=>{if(void 0!==this._viewZoneId){const n=this._getHeight();if(n===t.heightInPx)return;let o=n-t.heightInPx;return t.heightInPx=n,i.layoutZone(this._viewZoneId),void(e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+o))}{let n=this._getHeight();if((n-=this._codeEditor.getOption(66).top)<=0)return;t.heightInPx=n,this._viewZoneId=i.addZone(t),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+n)}})} +_removeViewZone(){this._codeEditor.changeViewZones(e=>{void 0!==this._viewZoneId&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0,this._viewZone&&(this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()-this._viewZone.heightInPx),this._viewZone=void 0))})}_applyTheme(e){let t={inputActiveOptionBorder:e.getColor(f.inputActiveOptionBorder),inputActiveOptionBackground:e.getColor(f.inputActiveOptionBackground),inputActiveOptionForeground:e.getColor(f.inputActiveOptionForeground),inputBackground:e.getColor(f.inputBackground),inputForeground:e.getColor(f.inputForeground),inputBorder:e.getColor(f.inputBorder),inputValidationInfoBackground:e.getColor(f.inputValidationInfoBackground),inputValidationInfoForeground:e.getColor(f.inputValidationInfoForeground),inputValidationInfoBorder:e.getColor(f.inputValidationInfoBorder),inputValidationWarningBackground:e.getColor(f.inputValidationWarningBackground),inputValidationWarningForeground:e.getColor(f.inputValidationWarningForeground), +inputValidationWarningBorder:e.getColor(f.inputValidationWarningBorder),inputValidationErrorBackground:e.getColor(f.inputValidationErrorBackground),inputValidationErrorForeground:e.getColor(f.inputValidationErrorForeground),inputValidationErrorBorder:e.getColor(f.inputValidationErrorBorder)};this._findInput.style(t),this._replaceInput.style(t),this._toggleSelectionFind.style(t)}_tryUpdateWidgetWidth(){if(!this._isVisible)return;if(!n.isInDOM(this._domNode))return;const e=this._codeEditor.getLayoutInfo();if(e.contentWidth<=0)return void n.addClass(this._domNode,"hiddenEditor");n.hasClass(this._domNode,"hiddenEditor")&&n.removeClass(this._domNode,"hiddenEditor");const t=e.width,i=e.minimap.minimapWidth;let o=!1,s=!1,r=!1;if(this._resized){if(n.getTotalWidth(this._domNode)>F)return this._domNode.style.maxWidth=`${t-28-i-15}px`,void(this._replaceInput.width=n.getTotalWidth(this._findInput.domNode))}if(F+28+i>=t&&(s=!0),F+28+i-B>=t&&(r=!0),F+28+i-B>=t+50&&(o=!0), +n.toggleClass(this._domNode,"collapsed-find-widget",o),n.toggleClass(this._domNode,"narrow-find-widget",r),n.toggleClass(this._domNode,"reduced-find-widget",s),r||o||(this._domNode.style.maxWidth=`${t-28-i-15}px`),this._resized){this._findInput.inputBox.layout();let e=this._findInput.inputBox.element.clientWidth;e>0&&(this._replaceInput.width=e)}else this._isReplaceVisible&&(this._replaceInput.width=n.getTotalWidth(this._findInput.domNode))}_getHeight(){let e=0;return e+=4,e+=this._findInput.inputBox.height+2,this._isReplaceVisible&&(e+=4,e+=this._replaceInput.inputBox.height+2),e+=4}_tryUpdateHeight(){const e=this._getHeight();return(null===this._cachedHeight||this._cachedHeight!==e)&&(this._cachedHeight=e,this._domNode.style.height=`${e}px`,!0)}focusFindInput(){this._findInput.select(),this._findInput.focus()}focusReplaceInput(){this._replaceInput.select(),this._replaceInput.focus()}highlightFindOptions(){this._findInput.highlightFindOptions()}_updateSearchScope(){ +if(this._codeEditor.hasModel()&&this._toggleSelectionFind.checked){let e=this._codeEditor.getSelections();e.map(e=>{1===e.endColumn&&e.endLineNumber>e.startLineNumber&&(e=e.setEndPosition(e.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(e.endLineNumber-1)));const t=this._state.currentMatch;return e.startLineNumber===e.endLineNumber||p.Range.equalsRange(e,t)?null:e}).filter(e=>!!e),e.length&&this._state.change({searchScope:e},!0)}}_onFindInputMouseDown(e){e.middleButton&&e.stopPropagation()}_onFindInputKeyDown(e){return e.equals(3|H)?(this._findInput.inputBox.insertAtCursor("\n"),void e.preventDefault()):e.equals(2)?(this._isReplaceVisible?this._replaceInput.focus():this._findInput.focusOnCaseSensitive(),void e.preventDefault()):e.equals(2066)?(this._codeEditor.focus(),void e.preventDefault()):e.equals(16)?U(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea")):e.equals(18)?$(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea")):void 0} +_onReplaceInputKeyDown(e){return e.equals(3|H)?(u.isWindows&&u.isNative&&!this._ctrlEnterReplaceAllWarningPrompted&&(this._notificationService.info(i.localize(18,null)),this._ctrlEnterReplaceAllWarningPrompted=!0,this._storageService.store(z,!0,0)),this._replaceInput.inputBox.insertAtCursor("\n"),void e.preventDefault()):e.equals(2)?(this._findInput.focusOnCaseSensitive(),void e.preventDefault()):e.equals(1026)?(this._findInput.focus(),void e.preventDefault()):e.equals(2066)?(this._codeEditor.focus(),void e.preventDefault()):e.equals(16)?U(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea")):e.equals(18)?$(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea")):void 0}getVerticalSashLeft(e){return 0}_keybindingLabelFor(e){let t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}_buildDomNode(){this._findInput=this._register(new v.ContextScopedFindInput(null,this._contextViewProvider,{width:W, +label:y,placeholder:E,appendCaseSensitiveLabel:this._keybindingLabelFor(m.FIND_IDS.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(m.FIND_IDS.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(m.FIND_IDS.ToggleRegexCommand),validation:e=>{if(0===e.length||!this._findInput.getRegex())return null;try{return new RegExp(e,"gu"),null}catch(e){return{content:e.message}}},flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118},this._contextKeyService,!0)),this._findInput.setRegex(!!this._state.isRegex),this._findInput.setCaseSensitive(!!this._state.matchCase),this._findInput.setWholeWords(!!this._state.wholeWord),this._register(this._findInput.onKeyDown(e=>this._onFindInputKeyDown(e))),this._register(this._findInput.inputBox.onDidChange(()=>{this._ignoreChangeEvent||this._state.change({searchString:this._findInput.getValue()},!0)})),this._register(this._findInput.onDidOptionChange(()=>{this._state.change({isRegex:this._findInput.getRegex(), +wholeWord:this._findInput.getWholeWords(),matchCase:this._findInput.getCaseSensitive()},!0)})),this._register(this._findInput.onCaseSensitiveKeyDown(e=>{e.equals(1026)&&this._isReplaceVisible&&(this._replaceInput.focus(),e.preventDefault())})),this._register(this._findInput.onRegexKeyDown(e=>{e.equals(2)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),e.preventDefault())})),this._register(this._findInput.inputBox.onDidHeightChange(e=>{this._tryUpdateHeight()&&this._showViewZone()})),u.isLinux&&this._register(this._findInput.onMouseDown(e=>this._onFindInputMouseDown(e))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount(),this._prevBtn=this._register(new q({label:L+this._keybindingLabelFor(m.FIND_IDS.PreviousMatchFindAction),className:t.findPreviousMatchIcon.classNames,onTrigger:()=>{this._codeEditor.getAction(m.FIND_IDS.PreviousMatchFindAction).run().then(void 0,c.onUnexpectedError)}})),this._nextBtn=this._register(new q({ +label:x+this._keybindingLabelFor(m.FIND_IDS.NextMatchFindAction),className:t.findNextMatchIcon.classNames,onTrigger:()=>{this._codeEditor.getAction(m.FIND_IDS.NextMatchFindAction).run().then(void 0,c.onUnexpectedError)}}));let e=document.createElement("div");e.className="find-part",e.appendChild(this._findInput.domNode);const i=document.createElement("div");i.className="find-actions",e.appendChild(i),i.appendChild(this._matchesCount),i.appendChild(this._prevBtn.domNode),i.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new s.Checkbox({icon:b,title:D+this._keybindingLabelFor(m.FIND_IDS.ToggleSearchScopeCommand),isChecked:!1})),this._register(this._toggleSelectionFind.onChange(()=>{if(this._toggleSelectionFind.checked){if(this._codeEditor.hasModel()){let e=this._codeEditor.getSelections();e.map(e=>(1===e.endColumn&&e.endLineNumber>e.startLineNumber&&(e=e.setEndPosition(e.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(e.endLineNumber-1))), +e.isEmpty()?null:e)).filter(e=>!!e),e.length&&this._state.change({searchScope:e},!0)}}else this._state.change({searchScope:null},!0)})),i.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new q({label:k+this._keybindingLabelFor(m.FIND_IDS.CloseFindWidgetCommand),className:t.findCloseIcon.classNames,onTrigger:()=>{this._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:e=>{e.equals(2)&&this._isReplaceVisible&&(this._replaceBtn.isEnabled()?this._replaceBtn.focus():this._codeEditor.focus(),e.preventDefault())}})),i.appendChild(this._closeBtn.domNode),this._replaceInput=this._register(new v.ContextScopedReplaceInput(null,void 0,{label:N,placeholder:I,history:[],flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118},this._contextKeyService,!0)),this._replaceInput.setPreserveCase(!!this._state.preserveCase),this._register(this._replaceInput.onKeyDown(e=>this._onReplaceInputKeyDown(e))),this._register(this._replaceInput.inputBox.onDidChange(()=>{this._state.change({ +replaceString:this._replaceInput.inputBox.value},!1)})),this._register(this._replaceInput.inputBox.onDidHeightChange(e=>{this._isReplaceVisible&&this._tryUpdateHeight()&&this._showViewZone()})),this._register(this._replaceInput.onDidOptionChange(()=>{this._state.change({preserveCase:this._replaceInput.getPreserveCase()},!0)})),this._register(this._replaceInput.onPreserveCaseKeyDown(e=>{e.equals(2)&&(this._prevBtn.isEnabled()?this._prevBtn.focus():this._nextBtn.isEnabled()?this._nextBtn.focus():this._toggleSelectionFind.enabled?this._toggleSelectionFind.focus():this._closeBtn.isEnabled()&&this._closeBtn.focus(),e.preventDefault())})),this._replaceBtn=this._register(new q({label:M+this._keybindingLabelFor(m.FIND_IDS.ReplaceOneAction),className:t.findReplaceIcon.classNames,onTrigger:()=>{this._controller.replace()},onKeyDown:e=>{e.equals(1026)&&(this._closeBtn.focus(),e.preventDefault())}})),this._replaceAllBtn=this._register(new q({label:R+this._keybindingLabelFor(m.FIND_IDS.ReplaceAllAction), +className:t.findReplaceAllIcon.classNames,onTrigger:()=>{this._controller.replaceAll()}}));let o=document.createElement("div");o.className="replace-part",o.appendChild(this._replaceInput.domNode);const r=document.createElement("div");r.className="replace-actions",o.appendChild(r),r.appendChild(this._replaceBtn.domNode),r.appendChild(this._replaceAllBtn.domNode),this._toggleReplaceBtn=this._register(new q({label:T,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=n.getTotalWidth(this._findInput.domNode),this._replaceInput.inputBox.layout()),this._showViewZone()}})),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible),this._domNode=document.createElement("div"),this._domNode.className="editor-widget find-widget",this._domNode.setAttribute("aria-hidden","true"),this._domNode.style.width=`${F}px`,this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(e), +this._domNode.appendChild(o),this._resizeSash=new a.Sash(this._domNode,this,{orientation:0,size:2}),this._resized=!1;let l=F;this._register(this._resizeSash.onDidStart(()=>{l=n.getTotalWidth(this._domNode)})),this._register(this._resizeSash.onDidChange(e=>{this._resized=!0;let t=l+e.startX-e.currentX;if(t(parseFloat(n.getComputedStyle(this._domNode).maxWidth)||0)||(this._domNode.style.width=`${t}px`,this._isReplaceVisible&&(this._replaceInput.width=n.getTotalWidth(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())})),this._register(this._resizeSash.onDidReset(()=>{const e=n.getTotalWidth(this._domNode);if(e{this._opts.onTrigger(),e.preventDefault()}),this.onkeydown(this._domNode,e=>{if(e.equals(10)||e.equals(3))return this._opts.onTrigger(),void e.preventDefault();this._opts.onKeyDown&&this._opts.onKeyDown(e)})}get domNode(){return this._domNode}isEnabled(){return this._domNode.tabIndex>=0}focus(){this._domNode.focus()}setEnabled(e){n.toggleClass(this._domNode,"disabled",!e),this._domNode.setAttribute("aria-disabled",String(!e)),this._domNode.tabIndex=e?0:-1}setExpanded(e){this._domNode.setAttribute("aria-expanded",String(!!e)), +e?(n.removeClasses(this._domNode,S.classNames),n.addClasses(this._domNode,w.classNames)):(n.removeClasses(this._domNode,w.classNames),n.addClasses(this._domNode,S.classNames))}}t.SimpleButton=q,_.registerThemingParticipant((e,t)=>{const i=(e,i)=>{i&&t.addRule(`.monaco-editor ${e} { background-color: ${i}; }`)};i(".findMatch",e.getColor(f.editorFindMatchHighlight)),i(".currentFindMatch",e.getColor(f.editorFindMatch)),i(".findScope",e.getColor(f.editorFindRangeHighlight)),i(".find-widget",e.getColor(f.editorWidgetBackground));const n=e.getColor(f.widgetShadow);n&&t.addRule(`.monaco-editor .find-widget { box-shadow: 0 2px 8px ${n}; }`);const o=e.getColor(f.editorFindMatchHighlightBorder);o&&t.addRule(`.monaco-editor .findMatch { border: 1px ${"hc"===e.type?"dotted":"solid"} ${o}; box-sizing: border-box; }`);const s=e.getColor(f.editorFindMatchBorder);s&&t.addRule(`.monaco-editor .currentFindMatch { border: 2px solid ${s}; padding: 1px; box-sizing: border-box; }`) +;const r=e.getColor(f.editorFindRangeHighlightBorder);r&&t.addRule(`.monaco-editor .findScope { border: 1px ${"hc"===e.type?"dashed":"solid"} ${r}; }`);const a=e.getColor(f.contrastBorder);a&&t.addRule(`.monaco-editor .find-widget { border: 1px solid ${a}; }`);const l=e.getColor(f.editorWidgetForeground);l&&t.addRule(`.monaco-editor .find-widget { color: ${l}; }`);const d=e.getColor(f.errorForeground);d&&t.addRule(`.monaco-editor .find-widget.no-results .matchesCount { color: ${d}; }`);const c=e.getColor(f.editorWidgetResizeBorder);if(c)t.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${c}; }`);else{const i=e.getColor(f.editorWidgetBorder);i&&t.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${i}; }`)}const h=e.getColor(f.focusBorder);h&&t.addRule(`.monaco-editor .find-widget .monaco-inputbox.synthetic-focus { outline-color: ${h}; }`)})})), +define(t[610],i([0,1,459,23,8,15,39,2,11,395,519,22,396,42,520,18,217,397,12,17,14,21,333]),(function(e,t,i,n,o,s,r,d,c,h,u,g,p,m,f,_,v,C,b,S,w,y){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.editorFoldForeground=t.foldBackgroundBackground=t.FoldingController=void 0;const E=new S.RawContextKey("foldingEnabled",!1);let L=class e extends d.Disposable{constructor(e,t){super(),this.contextKeyService=t,this.localToDispose=this._register(new d.DisposableStore),this.editor=e;const i=this.editor.getOptions();this._isEnabled=i.get(31),this._useFoldingProviders="indentation"!==i.get(32),this._unfoldOnClickAfterEndOfLine=i.get(34),this.foldingModel=null,this.hiddenRangeModel=null,this.rangeProvider=null,this.foldingRegionPromise=null,this.foldingStateMemento=null,this.foldingModelPromise=null,this.updateScheduler=null,this.cursorChangedScheduler=null,this.mouseDownInfo=null,this.foldingDecorationProvider=new u.FoldingDecorationProvider(e), +this.foldingDecorationProvider.autoHideFoldingControls="mouseover"===i.get(91),this.foldingDecorationProvider.showFoldingHighlights=i.get(33),this.foldingEnabled=E.bindTo(this.contextKeyService),this.foldingEnabled.set(this._isEnabled),this._register(this.editor.onDidChangeModel(()=>this.onModelChanged())),this._register(this.editor.onDidChangeConfiguration(e=>{if(e.hasChanged(31)&&(this._isEnabled=this.editor.getOptions().get(31),this.foldingEnabled.set(this._isEnabled),this.onModelChanged()),e.hasChanged(91)||e.hasChanged(33)){const e=this.editor.getOptions();this.foldingDecorationProvider.autoHideFoldingControls="mouseover"===e.get(91),this.foldingDecorationProvider.showFoldingHighlights=e.get(33),this.onModelContentChanged()}e.hasChanged(32)&&(this._useFoldingProviders="indentation"!==this.editor.getOptions().get(32),this.onFoldingStrategyChanged()),e.hasChanged(34)&&(this._unfoldOnClickAfterEndOfLine=this.editor.getOptions().get(34))})),this.onModelChanged()}static get(t){return t.getContribution(e.ID)} +saveViewState(){let e=this.editor.getModel();if(!e||!this._isEnabled||e.isTooLargeForTokenization())return{};if(this.foldingModel){let t=this.foldingModel.isInitialized?this.foldingModel.getMemento():this.hiddenRangeModel.getMemento(),i=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:t,lineCount:e.getLineCount(),provider:i}}}restoreViewState(e){let t=this.editor.getModel();if(!t||!this._isEnabled||t.isTooLargeForTokenization()||!this.hiddenRangeModel)return;if(!e||!e.collapsedRegions||e.lineCount!==t.getLineCount())return;e.provider!==v.ID_SYNTAX_PROVIDER&&e.provider!==C.ID_INIT_PROVIDER||(this.foldingStateMemento=e);const i=e.collapsedRegions;if(this.hiddenRangeModel.applyMemento(i)){const e=this.getFoldingModel();e&&e.then(e=>{e&&e.applyMemento(i)}).then(void 0,b.onUnexpectedError)}}onModelChanged(){this.localToDispose.clear();let e=this.editor.getModel();this._isEnabled&&e&&!e.isTooLargeForTokenization()&&(this.foldingModel=new h.FoldingModel(e,this.foldingDecorationProvider), +this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new p.HiddenRangeModel(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(e=>this.onHiddenRangesChanges(e))),this.updateScheduler=new s.Delayer(200),this.cursorChangedScheduler=new s.RunOnceScheduler(()=>this.revealCursor(),200),this.localToDispose.add(this.cursorChangedScheduler),this.localToDispose.add(_.FoldingRangeProviderRegistry.onDidChange(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelLanguageConfiguration(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelContent(()=>this.onModelContentChanged())),this.localToDispose.add(this.editor.onDidChangeCursorPosition(()=>this.onCursorPositionChanged())),this.localToDispose.add(this.editor.onMouseDown(e=>this.onEditorMouseDown(e))),this.localToDispose.add(this.editor.onMouseUp(e=>this.onEditorMouseUp(e))),this.localToDispose.add({dispose:()=>{ +this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.updateScheduler&&this.updateScheduler.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,this.foldingStateMemento=null,this.rangeProvider&&this.rangeProvider.dispose(),this.rangeProvider=null}}),this.onModelContentChanged())}onFoldingStrategyChanged(){this.rangeProvider&&this.rangeProvider.dispose(),this.rangeProvider=null,this.onModelContentChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;if(this.rangeProvider=new f.IndentRangeProvider(e),this._useFoldingProviders&&this.foldingModel){let t=_.FoldingRangeProviderRegistry.ordered(this.foldingModel.textModel);if(0===t.length&&this.foldingStateMemento&&this.foldingStateMemento.collapsedRegions){return this.rangeProvider=new C.InitializingRangeProvider(e,this.foldingStateMemento.collapsedRegions,()=>{this.foldingStateMemento=null, +this.onFoldingStrategyChanged()},3e4)}t.length>0&&(this.rangeProvider=new v.SyntaxRangeProvider(e,t))}return this.foldingStateMemento=null,this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onModelContentChanged(){this.updateScheduler&&(this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.foldingModelPromise=this.updateScheduler.trigger(()=>{const e=this.foldingModel;if(!e)return null;let t=this.foldingRegionPromise=s.createCancelablePromise(t=>this.getRangeProvider(e.textModel).compute(t));return t.then(i=>{if(i&&t===this.foldingRegionPromise){let t=this.editor.getSelections(),n=t?t.map(e=>e.startLineNumber):[];e.update(i,n)}return e})}).then(void 0,e=>(b.onUnexpectedError(e),null)))}onHiddenRangesChanges(e){if(this.hiddenRangeModel&&e.length){let e=this.editor.getSelections();e&&this.hiddenRangeModel.adjustSelections(e)&&this.editor.setSelections(e)}this.editor.setHiddenAreas(e)}onCursorPositionChanged(){ +this.hiddenRangeModel&&this.hiddenRangeModel.hasRanges()&&this.cursorChangedScheduler.schedule()}revealCursor(){const e=this.getFoldingModel();e&&e.then(e=>{if(e){let t=this.editor.getSelections();if(t&&t.length>0){let i=[];for(let n of t){let t=n.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(t)&&i.push(...e.getAllRegionsAtLine(t,e=>e.isCollapsed&&t>e.startLineNumber))}i.length&&(e.toggleCollapseState(i),this.reveal(t[0].getPosition()))}}}).then(void 0,b.onUnexpectedError)}onEditorMouseDown(e){if(this.mouseDownInfo=null,!this.hiddenRangeModel||!e.target||!e.target.range)return;if(!e.event.leftButton&&!e.event.middleButton)return;const t=e.target.range;let i=!1;switch(e.target.type){case 4:const n=e.target.detail,o=e.target.element.offsetLeft;if(n.offsetX-o<5)return;i=!0;break;case 7:if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()){if(!e.target.detail.isAfterLines)break}return;case 6:if(this.hiddenRangeModel.hasRanges()){let e=this.editor.getModel() +;if(e&&t.startColumn===e.getLineMaxColumn(t.startLineNumber))break}return;default:return}this.mouseDownInfo={lineNumber:t.startLineNumber,iconClicked:i}}onEditorMouseUp(e){const t=this.getFoldingModel();if(!t||!this.mouseDownInfo||!e.target)return;let i=this.mouseDownInfo.lineNumber,n=this.mouseDownInfo.iconClicked,o=e.target.range;if(o&&o.startLineNumber===i){if(n){if(4!==e.target.type)return}else{let e=this.editor.getModel();if(!e||o.startColumn!==e.getLineMaxColumn(i))return}t.then(t=>{if(t){let o=t.getRegionAtLine(i);if(o&&o.startLineNumber===i){let s=o.isCollapsed;if(n||s){let n=[],r=e.event.middleButton||e.event.shiftKey;if(r)for(const e of t.getRegionsInside(o))e.isCollapsed===s&&n.push(e);!s&&r&&0!==n.length||n.push(o),t.toggleCollapseState(n),this.reveal({lineNumber:i,column:1})}}}}).then(void 0,b.onUnexpectedError)}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,0)}};L.ID="editor.contrib.folding",L=a([l(1,S.IContextKeyService)],L),t.FoldingController=L +;class x extends c.EditorAction{runEditorCommand(e,t,i){let n=L.get(t);if(!n)return;let o=n.getFoldingModel();return o?(this.reportTelemetry(e,t),o.then(e=>{if(e){this.invoke(n,e,t,i);const o=t.getSelection();o&&n.reveal(o.getStartPosition())}})):void 0}getSelectedLines(e){let t=e.getSelections();return t?t.map(e=>e.startLineNumber):[]}getLineNumbers(e,t){return e&&e.selectionLines?e.selectionLines.map(e=>e+1):this.getSelectedLines(t)}run(e,t){}}function D(e){if(!n.isUndefined(e)){if(!n.isObject(e))return!1;const t=e;if(!n.isUndefined(t.levels)&&!n.isNumber(t.levels))return!1;if(!n.isUndefined(t.direction)&&!n.isString(t.direction))return!1;if(!(n.isUndefined(t.selectionLines)||n.isArray(t.selectionLines)&&t.selectionLines.every(n.isNumber)))return!1}return!0}class k extends x{getFoldingLevel(){return parseInt(this.id.substr(k.ID_PREFIX.length))}invoke(e,t,i){h.setCollapseStateAtLevel(t,this.getFoldingLevel(),!0,this.getSelectedLines(i))}}k.ID_PREFIX="editor.foldLevel",k.ID=e=>k.ID_PREFIX+e, +c.registerEditorContribution(L.ID,L),c.registerEditorAction(class extends x{constructor(){super({id:"editor.unfold",label:i.localize(0,null),alias:"Unfold",precondition:E,kbOpts:{kbExpr:g.EditorContextKeys.editorTextFocus,primary:3161,mac:{primary:2649},weight:100},description:{description:"Unfold the content in the editor",args:[{name:"Unfold editor argument",description:"Property-value pairs that can be passed through this argument:\n\t\t\t\t\t\t* 'levels': Number of levels to unfold. If not set, defaults to 1.\n\t\t\t\t\t\t* 'direction': If 'up', unfold given number of levels up otherwise unfolds down.\n\t\t\t\t\t\t* 'selectionLines': The start lines (0-based) of the editor selections to apply the unfold action to. If not set, the active selection(s) will be used.\n\t\t\t\t\t\t",constraint:D,schema:{type:"object",properties:{levels:{type:"number",default:1},direction:{type:"string",enum:["up","down"],default:"down"},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,n){ +let o=n&&n.levels||1,s=this.getLineNumbers(n,i);n&&"up"===n.direction?h.setCollapseStateLevelsUp(t,!1,o,s):h.setCollapseStateLevelsDown(t,!1,o,s)}}),c.registerEditorAction(class extends x{constructor(){super({id:"editor.unfoldRecursively",label:i.localize(1,null),alias:"Unfold Recursively",precondition:E,kbOpts:{kbExpr:g.EditorContextKeys.editorTextFocus,primary:r.KeyChord(2089,2137),weight:100}})}invoke(e,t,i,n){h.setCollapseStateLevelsDown(t,!1,Number.MAX_VALUE,this.getSelectedLines(i))}}),c.registerEditorAction(class extends x{constructor(){super({id:"editor.fold",label:i.localize(2,null),alias:"Fold",precondition:E,kbOpts:{kbExpr:g.EditorContextKeys.editorTextFocus,primary:3159,mac:{primary:2647},weight:100},description:{description:"Fold the content in the editor",args:[{name:"Fold editor argument", +description:"Property-value pairs that can be passed through this argument:\n\t\t\t\t\t\t\t* 'levels': Number of levels to fold.\n\t\t\t\t\t\t\t* 'direction': If 'up', folds given number of levels up otherwise folds down.\n\t\t\t\t\t\t\t* 'selectionLines': The start lines (0-based) of the editor selections to apply the fold action to. If not set, the active selection(s) will be used.\n\t\t\t\t\t\t\tIf no levels or direction is set, folds the region at the locations or if already collapsed, the first uncollapsed parent instead.\n\t\t\t\t\t\t",constraint:D,schema:{type:"object",properties:{levels:{type:"number"},direction:{type:"string",enum:["up","down"]},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,n){let o=this.getLineNumbers(n,i);const s=n&&n.levels,r=n&&n.direction;"number"!=typeof s&&"string"!=typeof r?h.setCollapseStateUp(t,!0,o):"up"===r?h.setCollapseStateLevelsUp(t,!0,s||1,o):h.setCollapseStateLevelsDown(t,!0,s||1,o)}}),c.registerEditorAction(class extends x{constructor(){ +super({id:"editor.foldRecursively",label:i.localize(4,null),alias:"Fold Recursively",precondition:E,kbOpts:{kbExpr:g.EditorContextKeys.editorTextFocus,primary:r.KeyChord(2089,2135),weight:100}})}invoke(e,t,i){let n=this.getSelectedLines(i);h.setCollapseStateLevelsDown(t,!0,Number.MAX_VALUE,n)}}),c.registerEditorAction(class extends x{constructor(){super({id:"editor.foldAll",label:i.localize(8,null),alias:"Fold All",precondition:E,kbOpts:{kbExpr:g.EditorContextKeys.editorTextFocus,primary:r.KeyChord(2089,2069),weight:100}})}invoke(e,t,i){h.setCollapseStateLevelsDown(t,!0)}}),c.registerEditorAction(class extends x{constructor(){super({id:"editor.unfoldAll",label:i.localize(9,null),alias:"Unfold All",precondition:E,kbOpts:{kbExpr:g.EditorContextKeys.editorTextFocus,primary:r.KeyChord(2089,2088),weight:100}})}invoke(e,t,i){h.setCollapseStateLevelsDown(t,!1)}}),c.registerEditorAction(class extends x{constructor(){super({id:"editor.foldAllBlockComments",label:i.localize(5,null),alias:"Fold All Block Comments", +precondition:E,kbOpts:{kbExpr:g.EditorContextKeys.editorTextFocus,primary:r.KeyChord(2089,2133),weight:100}})}invoke(e,t,i){if(t.regions.hasTypes())h.setCollapseStateForType(t,_.FoldingRangeKind.Comment.value,!0);else{const e=i.getModel();if(!e)return;let n=m.LanguageConfigurationRegistry.getComments(e.getLanguageIdentifier().id);if(n&&n.blockCommentStartToken){let e=new RegExp("^\\s*"+o.escapeRegExpCharacters(n.blockCommentStartToken));h.setCollapseStateForMatchingLines(t,e,!0)}}}}),c.registerEditorAction(class extends x{constructor(){super({id:"editor.foldAllMarkerRegions",label:i.localize(6,null),alias:"Fold All Regions",precondition:E,kbOpts:{kbExpr:g.EditorContextKeys.editorTextFocus,primary:r.KeyChord(2089,2077),weight:100}})}invoke(e,t,i){if(t.regions.hasTypes())h.setCollapseStateForType(t,_.FoldingRangeKind.Region.value,!0);else{const e=i.getModel();if(!e)return;let n=m.LanguageConfigurationRegistry.getFoldingRules(e.getLanguageIdentifier().id);if(n&&n.markers&&n.markers.start){ +let e=new RegExp(n.markers.start);h.setCollapseStateForMatchingLines(t,e,!0)}}}}),c.registerEditorAction(class extends x{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:i.localize(7,null),alias:"Unfold All Regions",precondition:E,kbOpts:{kbExpr:g.EditorContextKeys.editorTextFocus,primary:r.KeyChord(2089,2078),weight:100}})}invoke(e,t,i){if(t.regions.hasTypes())h.setCollapseStateForType(t,_.FoldingRangeKind.Region.value,!1);else{const e=i.getModel();if(!e)return;let n=m.LanguageConfigurationRegistry.getFoldingRules(e.getLanguageIdentifier().id);if(n&&n.markers&&n.markers.start){let e=new RegExp(n.markers.start);h.setCollapseStateForMatchingLines(t,e,!1)}}}}),c.registerEditorAction(class extends x{constructor(){super({id:"editor.toggleFold",label:i.localize(3,null),alias:"Toggle Fold",precondition:E,kbOpts:{kbExpr:g.EditorContextKeys.editorTextFocus,primary:r.KeyChord(2089,2090),weight:100}})}invoke(e,t,i){let n=this.getSelectedLines(i);h.toggleCollapseState(t,1,n)}}) +;for(let e=1;e<=7;e++)c.registerInstantiatedEditorAction(new k({id:k.ID(e),label:i.localize(10,null,e),alias:`Fold Level ${e}`,precondition:E,kbOpts:{kbExpr:g.EditorContextKeys.editorTextFocus,primary:r.KeyChord(2089,2048|21+e),weight:100}}));t.foldBackgroundBackground=y.registerColor("editor.foldBackground",{light:y.transparent(y.editorSelectionBackground,.3),dark:y.transparent(y.editorSelectionBackground,.3),hc:null},i.localize(11,null),!0),t.editorFoldForeground=y.registerColor("editorGutter.foldingControlForeground",{dark:y.iconForeground,light:y.iconForeground,hc:y.iconForeground},i.localize(12,null)),w.registerThemingParticipant((e,i)=>{const n=e.getColor(t.foldBackgroundBackground);n&&i.addRule(`.monaco-editor .folded-background { background-color: ${n}; }`);const o=e.getColor(t.editorFoldForeground);o&&i.addRule(`\n\t\t.monaco-editor .cldr${u.foldingExpandedIcon.cssSelector},\n\t\t.monaco-editor .cldr${u.foldingCollapsedIcon.cssSelector} {\n\t\t\tcolor: ${o} !important;\n\t\t}\n\t\t`)})})), +define(t[611],i([0,1,126,92,153,198,132,14,107,7,468,151,41,2,10,35,64,150]),(function(e,t,i,n,o,s,r,d,c,h,u,g,p,m,f,_,v,C){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AccessibilityProvider=t.OneReferenceRenderer=t.FileReferencesRenderer=t.IdentityProvider=t.StringRepresentationProvider=t.Delegate=t.DataSource=void 0;let b=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof i.ReferencesModel||e instanceof i.FileReferences}getChildren(e){if(e instanceof i.ReferencesModel)return e.groups;if(e instanceof i.FileReferences)return e.resolve(this._resolverService).then(e=>e.children);throw new Error("bad tree")}};b=a([l(0,n.ITextModelService)],b),t.DataSource=b;t.Delegate=class{getHeight(){return 23}getTemplateId(e){return e instanceof i.FileReferences?y.id:L.id}};let S=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof i.OneReference){const i=null===(t=e.parent.getPreview(e))||void 0===t?void 0:t.preview(e.range) +;if(i)return i.value}return p.basename(e.uri)}};S=a([l(0,_.IKeybindingService)],S),t.StringRepresentationProvider=S;t.IdentityProvider=class{getId(e){return e instanceof i.OneReference?e.id:e.uri}};let w=class extends m.Disposable{constructor(e,t,i){super(),this._uriLabel=t;const n=document.createElement("div");n.classList.add("reference-file"),this.file=this._register(new o.IconLabel(n,{supportHighlights:!0})),this.badge=new s.CountBadge(h.append(n,h.$(".count"))),this._register(c.attachBadgeStyler(this.badge,i)),e.appendChild(n)}set(e,t){let i=p.dirname(e.uri);this.file.setLabel(g.getBaseLabel(e.uri),this._uriLabel.getUriLabel(i,{relative:!0}),{title:this._uriLabel.getUriLabel(e.uri),matches:t});const n=e.children.length;this.badge.setCount(n),n>1?this.badge.setTitleFormat(u.localize(0,null,n)):this.badge.setTitleFormat(u.localize(1,null,n))}};w=a([l(1,r.ILabelService),l(2,d.IThemeService)],w);let y=class e{constructor(t){this._instantiationService=t,this.templateId=e.id}renderTemplate(e){ +return this._instantiationService.createInstance(w,e)}renderElement(e,t,i){i.set(e.element,v.createMatches(e.filterData))}disposeTemplate(e){e.dispose()}};y.id="FileReferencesRenderer",y=a([l(0,f.IInstantiationService)],y),t.FileReferencesRenderer=y;class E{constructor(e){this.label=new C.HighlightedLabel(e,!1)}set(e,t){var i;const n=null===(i=e.parent.getPreview(e))||void 0===i?void 0:i.preview(e.range);if(n&&n.value){const{value:e,highlight:i}=n;t&&!v.FuzzyScore.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(e,v.createMatches(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(e,[i]))}else this.label.set(`${p.basename(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`)}}class L{constructor(){this.templateId=L.id}renderTemplate(e){return new E(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(){}}t.OneReferenceRenderer=L,L.id="OneReferenceRenderer";t.AccessibilityProvider=class{getWidgetAriaLabel(){ +return u.localize(2,null)}getAriaLabel(e){return e.ariaMessage}}})),define(t[612],i([0,1,474,3,20,22,11,72,398,68,14,49,31,15,12]),(function(e,t,i,n,o,s,r,d,c,h,u,g,p,m,f){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let _=class e{constructor(e,t){this.decorationIds=[],this.editor=e,this.editorWorkerService=t}static get(t){return t.getContribution(e.ID)}dispose(){}run(t,i){this.currentRequest&&this.currentRequest.cancel();const s=this.editor.getSelection(),r=this.editor.getModel();if(!r||!s)return;let a=s;if(a.startLineNumber!==a.endLineNumber)return;const l=new h.EditorState(this.editor,5),d=r.uri;return this.editorWorkerService.canNavigateValueSet(d)?(this.currentRequest=m.createCancelablePromise(e=>this.editorWorkerService.navigateValueSet(d,a,i)),this.currentRequest.then(i=>{if(!i||!i.range||!i.value)return;if(!l.validate(this.editor))return;let s=n.Range.lift(i.range),r=i.range,d=i.value.length-(a.endColumn-a.startColumn);r={startLineNumber:r.startLineNumber,startColumn:r.startColumn, +endLineNumber:r.endLineNumber,endColumn:r.startColumn+i.value.length},d>1&&(a=new o.Selection(a.startLineNumber,a.startColumn,a.endLineNumber,a.endColumn+d-1));const h=new c.InPlaceReplaceCommand(s,a,i.value);this.editor.pushUndoStop(),this.editor.executeCommand(t,h),this.editor.pushUndoStop(),this.decorationIds=this.editor.deltaDecorations(this.decorationIds,[{range:r,options:e.DECORATION}]),this.decorationRemover&&this.decorationRemover.cancel(),this.decorationRemover=m.timeout(350),this.decorationRemover.then(()=>this.decorationIds=this.editor.deltaDecorations(this.decorationIds,[])).catch(f.onUnexpectedError)}).catch(f.onUnexpectedError)):Promise.resolve(void 0)}};_.ID="editor.contrib.inPlaceReplaceController",_.DECORATION=p.ModelDecorationOptions.register({className:"valueSetReplacement"}),_=a([l(1,d.IEditorWorkerService)],_);class v extends r.EditorAction{constructor(){super({id:"editor.action.inPlaceReplace.up",label:i.localize(0,null),alias:"Replace with Previous Value", +precondition:s.EditorContextKeys.writable,kbOpts:{kbExpr:s.EditorContextKeys.editorTextFocus,primary:3154,weight:100}})}run(e,t){const i=_.get(t);return i?i.run(this.id,!0):Promise.resolve(void 0)}}class C extends r.EditorAction{constructor(){super({id:"editor.action.inPlaceReplace.down",label:i.localize(1,null),alias:"Replace with Next Value",precondition:s.EditorContextKeys.writable,kbOpts:{kbExpr:s.EditorContextKeys.editorTextFocus,primary:3156,weight:100}})}run(e,t){const i=_.get(t);return i?i.run(this.id,!1):Promise.resolve(void 0)}}r.registerEditorContribution(_.ID,_),r.registerEditorAction(v),r.registerEditorAction(C),u.registerThemingParticipant((e,t)=>{const i=e.getColor(g.editorBracketMatchBorder);i&&t.addRule(`.monaco-editor.vs .valueSetReplacement { outline: solid 2px ${i}; }`)})})),define(t[613],i([0,1,477,15,25,12,78,2,16,11,31,18,219,525,32,55,21,14,24,40,41,8,337]),(function(e,t,i,n,o,s,d,c,h,u,g,p,m,f,_,v,C,b,S,w,y,E){"use strict";Object.defineProperty(t,"__esModule",{value:!0}), +t.LinkDetector=void 0;const L={general:g.ModelDecorationOptions.register({stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link"}),active:g.ModelDecorationOptions.register({stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link-active"})};class x{constructor(e,t){this.link=e,this.decorationId=t}static decoration(e,t){return{range:e.range,options:x._getOptions(e,t,!1)}}static _getOptions(e,t,n){const o=Object.assign({},n?L.active:L.general);return o.hoverMessage=function(e,t){const n=e.url&&/^command:/i.test(e.url.toString()),o=e.tooltip?e.tooltip:n?i.localize(0,null):i.localize(1,null),s=t?h.isMacintosh?i.localize(2,null):i.localize(3,null):h.isMacintosh?i.localize(4,null):i.localize(5,null);if(e.url){return new d.MarkdownString("",!0).appendMarkdown(`[${o}](${e.url.toString()}) (${s})`)}return(new d.MarkdownString).appendText(`${o} (${s})`)}(e,t),o}activate(e,t){e.changeDecorationOptions(this.decorationId,x._getOptions(this.link,t,!0))}deactivate(e,t){ +e.changeDecorationOptions(this.decorationId,x._getOptions(this.link,t,!1))}}let D=class e{constructor(e,t,i){this.listenersToRemove=new c.DisposableStore,this.editor=e,this.openerService=t,this.notificationService=i;let o=new m.ClickLinkGesture(e);this.listenersToRemove.add(o),this.listenersToRemove.add(o.onMouseMoveOrRelevantKeyDown(([e,t])=>{this._onEditorMouseMove(e,t)})),this.listenersToRemove.add(o.onExecute(e=>{this.onEditorMouseUp(e)})),this.listenersToRemove.add(o.onCancel(e=>{this.cleanUpActiveLinkDecoration()})),this.enabled=e.getOption(54),this.listenersToRemove.add(e.onDidChangeConfiguration(t=>{const i=e.getOption(54);this.enabled!==i&&(this.enabled=i,this.updateDecorations([]),this.stop(),this.beginCompute())})),this.listenersToRemove.add(e.onDidChangeModelContent(e=>this.onChange())),this.listenersToRemove.add(e.onDidChangeModel(e=>this.onModelChanged())),this.listenersToRemove.add(e.onDidChangeModelLanguage(e=>this.onModelModeChanged())), +this.listenersToRemove.add(p.LinkProviderRegistry.onDidChange(e=>this.onModelModeChanged())),this.timeout=new n.TimeoutTimer,this.computePromise=null,this.activeLinksList=null,this.currentOccurrences={},this.activeLinkDecorationId=null,this.beginCompute()}static get(t){return t.getContribution(e.ID)}onModelChanged(){this.currentOccurrences={},this.activeLinkDecorationId=null,this.stop(),this.beginCompute()}onModelModeChanged(){this.stop(),this.beginCompute()}onChange(){this.timeout.setIfNotSet(()=>this.beginCompute(),e.RECOMPUTE_TIME)}beginCompute(){return r(this,void 0,void 0,(function*(){if(!this.editor.hasModel()||!this.enabled)return;const e=this.editor.getModel();if(p.LinkProviderRegistry.has(e)){this.activeLinksList&&(this.activeLinksList.dispose(),this.activeLinksList=null),this.computePromise=n.createCancelablePromise(t=>f.getLinks(e,t));try{this.activeLinksList=yield this.computePromise,this.updateDecorations(this.activeLinksList.links)}catch(e){s.onUnexpectedError(e)}finally{this.computePromise=null +}}}))}updateDecorations(e){const t="altKey"===this.editor.getOption(61);let i=[],n=Object.keys(this.currentOccurrences);for(let e=0,t=n.length;e{t.activate(e,i),this.activeLinkDecorationId=t.decorationId})}else this.cleanUpActiveLinkDecoration()}cleanUpActiveLinkDecoration(){const e="altKey"===this.editor.getOption(61);if(this.activeLinkDecorationId){const t=this.currentOccurrences[this.activeLinkDecorationId];t&&this.editor.changeDecorations(i=>{t.deactivate(i,e)}), +this.activeLinkDecorationId=null}}onEditorMouseUp(e){if(!this.isEnabled(e))return;const t=this.getLinkOccurrence(e.target.position);t&&this.openLinkOccurrence(t,e.hasSideBySideModifier,!0)}openLinkOccurrence(e,t,n=!1){if(!this.openerService)return;const{link:r}=e;r.resolve(o.CancellationToken.None).then(e=>{if("string"==typeof e&&this.editor.hasModel()){const t=this.editor.getModel().uri;if(t.scheme===w.Schemas.file&&E.startsWith(e,"file:")){const i=S.URI.parse(e);if(i.scheme===w.Schemas.file){const n=y.originalFSPath(i);let o=null;E.startsWith(n,"/./")?o=`.${n.substr(1)}`:E.startsWith(n,"//./")&&(o=`.${n.substr(2)}`),o&&(e=y.joinPath(t,o))}}}return this.openerService.open(e,{openToSide:t,fromUserGesture:n})},e=>{const t=e instanceof Error?e.message:e;"invalid"===t?this.notificationService.warn(i.localize(6,null,r.url.toString())):"missing"===t?this.notificationService.warn(i.localize(7,null)):s.onUnexpectedError(e)})}getLinkOccurrence(e){if(!this.editor.hasModel()||!e)return null +;const t=this.editor.getModel().getDecorationsInRange({startLineNumber:e.lineNumber,startColumn:e.column,endLineNumber:e.lineNumber,endColumn:e.column},0,!0);for(const e of t){const t=this.currentOccurrences[e.id];if(t)return t}return null}isEnabled(e,t){return Boolean(6===e.target.type&&(e.hasTriggerModifier||t&&t.keyCodeIsTriggerKey))}stop(){this.timeout.cancel(),this.activeLinksList&&this.activeLinksList.dispose(),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){this.listenersToRemove.dispose(),this.stop(),this.timeout.dispose()}};D.ID="editor.linkDetector",D.RECOMPUTE_TIME=1e3,D=a([l(1,v.IOpenerService),l(2,_.INotificationService)],D),t.LinkDetector=D;class k extends u.EditorAction{constructor(){super({id:"editor.action.openLink",label:i.localize(8,null),alias:"Open Link",precondition:void 0})}run(e,t){let i=D.get(t);if(!i)return;if(!t.hasModel())return;let n=t.getSelections();for(let e of n){let t=i.getLinkOccurrence(e.getEndPosition());t&&i.openLinkOccurrence(t,!1)} +}}u.registerEditorContribution(D.ID,D),u.registerEditorAction(k),b.registerThemingParticipant((e,t)=>{const i=e.getColor(C.editorActiveLinkForeground);i&&t.addRule(`.monaco-editor .detected-link-active { color: ${i} !important; }`)})})),define(t[140],i([0,1,478,15,2,48,3,11,17,14,21,338]),(function(e,t,i,n,o,s,r,d,c,h,u){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessageController=void 0;let g=class e extends o.Disposable{constructor(t,i){super(),this._messageWidget=this._register(new o.MutableDisposable),this._messageListeners=this._register(new o.DisposableStore),this._editor=t,this._visible=e.MESSAGE_VISIBLE.bindTo(i),this._register(this._editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}static get(t){return t.getContribution(e.ID)}dispose(){super.dispose(),this._visible.reset()}showMessage(e,t){let i;s.alert(e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._messageWidget.value=new m(this._editor,t,e), +this._messageListeners.add(this._editor.onDidBlurEditorText(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidChangeCursorPosition(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidDispose(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidChangeModel(()=>this.closeMessage())),this._messageListeners.add(new n.TimeoutTimer(()=>this.closeMessage(),3e3)),this._messageListeners.add(this._editor.onMouseMove(e=>{e.target.position&&(i?i.containsPosition(e.target.position)||this.closeMessage():i=new r.Range(t.lineNumber-3,1,e.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(m.fadeOut(this._messageWidget.value))}_onDidAttemptReadOnlyEdit(){this._editor.hasModel()&&this.showMessage(i.localize(0,null),this._editor.getPosition())}};g.ID="editor.contrib.messageController",g.MESSAGE_VISIBLE=new c.RawContextKey("messageVisible",!1), +g=a([l(1,c.IContextKeyService)],g),t.MessageController=g;const p=d.EditorCommand.bindToContribution(g.get);d.registerEditorCommand(new p({id:"leaveEditorMessage",precondition:g.MESSAGE_VISIBLE,handler:e=>e.closeMessage(),kbOpts:{weight:130,primary:9}}));class m{constructor(e,{lineNumber:t,column:i},n){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:i-1},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage");const o=document.createElement("div");o.classList.add("message"),o.textContent=n,this._domNode.appendChild(o);const s=document.createElement("div");s.classList.add("anchor"),this._domNode.appendChild(s),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}static fadeOut(e){let t;const i=()=>{e.dispose(),clearTimeout(t),e.getDomNode().removeEventListener("animationend",i)};return t=setTimeout(i,110), +e.getDomNode().addEventListener("animationend",i),e.getDomNode().classList.add("fadeOut"),{dispose:i}}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2]}}}d.registerEditorContribution(g.ID,g),h.registerThemingParticipant((e,t)=>{const i=e.getColor(u.inputValidationInfoBorder);if(i){let n=e.type===h.HIGH_CONTRAST?2:1;t.addRule(`.monaco-editor .monaco-editor-overlaymessage .anchor { border-top-color: ${i}; }`),t.addRule(`.monaco-editor .monaco-editor-overlaymessage .message { border: ${n}px solid ${i}; }`)}const n=e.getColor(u.inputValidationInfoBackground);n&&t.addRule(`.monaco-editor .monaco-editor-overlaymessage .message { background-color: ${n}; }`);const o=e.getColor(u.inputValidationInfoForeground);o&&t.addRule(`.monaco-editor .monaco-editor-overlaymessage .message { color: ${o}; }`)})})),define(t[614],i([0,1,12,144,2,140,10,561,601]),(function(e,t,i,n,o,s,d,c,h){"use strict" +;Object.defineProperty(t,"__esModule",{value:!0}),t.CodeActionUi=void 0;let u=class extends o.Disposable{constructor(e,t,i,s,a){super(),this._editor=e,this.delegate=s,this._activeCodeActions=this._register(new o.MutableDisposable),this._codeActionWidget=new n.Lazy(()=>this._register(a.createInstance(c.CodeActionMenu,this._editor,{onSelectCodeAction:e=>r(this,void 0,void 0,(function*(){this.delegate.applyCodeAction(e,!0)}))}))),this._lightBulbWidget=new n.Lazy(()=>{const e=this._register(a.createInstance(h.LightBulbWidget,this._editor,t,i));return this._register(e.onClick(e=>this.showCodeActionList(e.trigger,e.actions,e,{includeDisabledActions:!1}))),e})}update(e){var t,n,o;return r(this,void 0,void 0,(function*(){if(1!==e.type)return void(null===(t=this._lightBulbWidget.rawValue)||void 0===t||t.hide());let r;try{r=yield e.actions}catch(e){return void i.onUnexpectedError(e)}if(this._lightBulbWidget.getValue().update(r,e.trigger,e.position),2===e.trigger.type){ +if(null===(n=e.trigger.filter)||void 0===n?void 0:n.include){const t=this.tryGetValidActionToApply(e.trigger,r);if(t){try{yield this.delegate.applyCodeAction(t,!1)}finally{r.dispose()}return}if(e.trigger.context){const t=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,r);if(t&&t.disabled)return s.MessageController.get(this._editor).showMessage(t.disabled,e.trigger.context.position),void r.dispose()}}const t=!!(null===(o=e.trigger.filter)||void 0===o?void 0:o.include);if(e.trigger.context&&(!r.allActions.length||!t&&!r.validActions.length))return s.MessageController.get(this._editor).showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=r,void r.dispose();this._activeCodeActions.value=r,this._codeActionWidget.getValue().show(e.trigger,r,e.position,{includeDisabledActions:t})}else this._codeActionWidget.getValue().isVisible?r.dispose():this._activeCodeActions.value=r}))}getInvalidActionThatWouldHaveBeenApplied(e,t){ +if(t.allActions.length)return"first"===e.autoApply&&0===t.validActions.length||"ifSingle"===e.autoApply&&1===t.allActions.length?t.allActions.find(e=>e.disabled):void 0}tryGetValidActionToApply(e,t){if(t.validActions.length)return"first"===e.autoApply&&t.validActions.length>0||"ifSingle"===e.autoApply&&1===t.validActions.length?t.validActions[0]:void 0}showCodeActionList(e,t,i,n){return r(this,void 0,void 0,(function*(){this._codeActionWidget.getValue().show(e,t,i,n)}))}};u=a([l(4,d.IInstantiationService)],u),t.CodeActionUi=u})),define(t[253],i([0,1,144,2,8,11,127,22,136,614,140,450,28,17,10,82,32,56,84,562,124]),(function(e,t,i,n,o,s,d,c,h,u,g,p,m,f,_,v,C,b,S,w,y){"use strict";function E(e){return f.ContextKeyExpr.regex(w.SUPPORTED_CODE_ACTIONS.keys()[0],new RegExp("(\\s|^)"+o.escapeRegExpCharacters(e.value)+"\\b"))}Object.defineProperty(t,"__esModule",{value:!0}), +t.AutoFixAction=t.FixAllAction=t.OrganizeImportsAction=t.SourceAction=t.RefactorAction=t.CodeActionCommand=t.QuickFixAction=t.applyCodeAction=t.QuickFixController=void 0;const L={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:p.localize(0,null)},apply:{type:"string",description:p.localize(1,null),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[p.localize(2,null),p.localize(3,null),p.localize(4,null)]},preferred:{type:"boolean",default:!1,description:p.localize(5,null)}}};let x=class e extends n.Disposable{constructor(e,t,n,o,s){super(),this._instantiationService=s,this._editor=e,this._model=this._register(new w.CodeActionModel(this._editor,t,n,o)),this._register(this._model.onDidChangeState(e=>this.update(e))),this._ui=new i.Lazy(()=>this._register(new u.CodeActionUi(e,N.Id,A.Id,{applyCodeAction:(e,t)=>r(this,void 0,void 0,(function*(){try{yield this._applyCodeAction(e)}finally{t&&this._trigger({type:1,filter:{}})}})) +},this._instantiationService)))}static get(t){return t.getContribution(e.ID)}update(e){this._ui.getValue().update(e)}showCodeActions(e,t,i){return this._ui.getValue().showCodeActionList(e,t,i,{includeDisabledActions:!1})}manualTriggerAtCurrentPosition(e,t,i){if(!this._editor.hasModel())return;g.MessageController.get(this._editor).closeMessage();const n=this._editor.getPosition();this._trigger({type:2,filter:t,autoApply:i,context:{notAvailableMessage:e,position:n}})}_trigger(e){return this._model.trigger(e)}_applyCodeAction(e){return this._instantiationService.invokeFunction(D,e,this._editor)}};function D(e,t,i){return r(this,void 0,void 0,(function*(){const n=e.get(d.IBulkEditService),o=e.get(m.ICommandService),s=e.get(S.ITelemetryService),r=e.get(C.INotificationService);if(s.publicLog2("codeAction.applyCodeAction",{codeActionTitle:t.title,codeActionKind:t.kind,codeActionIsPreferred:!!t.isPreferred}),t.edit&&(yield n.apply(d.ResourceEdit.convert(t.edit),{editor:i,label:t.title})),t.command)try{ +yield o.executeCommand(t.command.id,...t.command.arguments||[])}catch(e){const t=function(e){return"string"==typeof e?e:e instanceof Error&&"string"==typeof e.message?e.message:void 0}(e);r.error("string"==typeof t?t:p.localize(6,null))}}))}function k(e,t,i,n){if(e.hasModel()){const o=x.get(e);o&&o.manualTriggerAtCurrentPosition(t,i,n)}}x.ID="editor.contrib.quickFixController",x=a([l(1,v.IMarkerService),l(2,f.IContextKeyService),l(3,b.IEditorProgressService),l(4,_.IInstantiationService)],x),t.QuickFixController=x,t.applyCodeAction=D;class N extends s.EditorAction{constructor(){super({id:N.Id,label:p.localize(7,null),alias:"Quick Fix...",precondition:f.ContextKeyExpr.and(c.EditorContextKeys.writable,c.EditorContextKeys.hasCodeActionsProvider),kbOpts:{kbExpr:c.EditorContextKeys.editorTextFocus,primary:2132,weight:100}})}run(e,t){return k(t,p.localize(8,null),void 0,void 0)}}t.QuickFixAction=N,N.Id="editor.action.quickFix";class I extends s.EditorCommand{constructor(){super({id:h.codeActionCommandId, +precondition:f.ContextKeyExpr.and(c.EditorContextKeys.writable,c.EditorContextKeys.hasCodeActionsProvider),description:{description:"Trigger a code action",args:[{name:"args",schema:L}]}})}runEditorCommand(e,t,i){const n=y.CodeActionCommandArgs.fromUser(i,{kind:y.CodeActionKind.Empty,apply:"ifSingle"});return k(t,"string"==typeof(null==i?void 0:i.kind)?n.preferred?p.localize(9,null,i.kind):p.localize(10,null,i.kind):n.preferred?p.localize(11,null):p.localize(12,null),{include:n.kind,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply)}}t.CodeActionCommand=I;class M extends s.EditorAction{constructor(){super({id:h.refactorCommandId,label:p.localize(13,null),alias:"Refactor...",precondition:f.ContextKeyExpr.and(c.EditorContextKeys.writable,c.EditorContextKeys.hasCodeActionsProvider),kbOpts:{kbExpr:c.EditorContextKeys.editorTextFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2, +when:f.ContextKeyExpr.and(c.EditorContextKeys.writable,E(y.CodeActionKind.Refactor))},description:{description:"Refactor...",args:[{name:"args",schema:L}]}})}run(e,t,i){const n=y.CodeActionCommandArgs.fromUser(i,{kind:y.CodeActionKind.Refactor,apply:"never"});return k(t,"string"==typeof(null==i?void 0:i.kind)?n.preferred?p.localize(14,null,i.kind):p.localize(15,null,i.kind):n.preferred?p.localize(16,null):p.localize(17,null),{include:y.CodeActionKind.Refactor.contains(n.kind)?n.kind:y.CodeActionKind.None,onlyIncludePreferredActions:n.preferred},n.apply)}}t.RefactorAction=M;class R extends s.EditorAction{constructor(){super({id:h.sourceActionCommandId,label:p.localize(18,null),alias:"Source Action...",precondition:f.ContextKeyExpr.and(c.EditorContextKeys.writable,c.EditorContextKeys.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:f.ContextKeyExpr.and(c.EditorContextKeys.writable,E(y.CodeActionKind.Source))},description:{description:"Source Action...",args:[{name:"args",schema:L}] +}})}run(e,t,i){const n=y.CodeActionCommandArgs.fromUser(i,{kind:y.CodeActionKind.Source,apply:"never"});return k(t,"string"==typeof(null==i?void 0:i.kind)?n.preferred?p.localize(19,null,i.kind):p.localize(20,null,i.kind):n.preferred?p.localize(21,null):p.localize(22,null),{include:y.CodeActionKind.Source.contains(n.kind)?n.kind:y.CodeActionKind.None,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply)}}t.SourceAction=R;class T extends s.EditorAction{constructor(){super({id:h.organizeImportsCommandId,label:p.localize(23,null),alias:"Organize Imports",precondition:f.ContextKeyExpr.and(c.EditorContextKeys.writable,E(y.CodeActionKind.SourceOrganizeImports)),kbOpts:{kbExpr:c.EditorContextKeys.editorTextFocus,primary:1581,weight:100}})}run(e,t){return k(t,p.localize(24,null),{include:y.CodeActionKind.SourceOrganizeImports,includeSourceActions:!0},"ifSingle")}}t.OrganizeImportsAction=T;class O extends s.EditorAction{constructor(){super({id:h.fixAllCommandId,label:p.localize(25,null), +alias:"Fix All",precondition:f.ContextKeyExpr.and(c.EditorContextKeys.writable,E(y.CodeActionKind.SourceFixAll))})}run(e,t){return k(t,p.localize(26,null),{include:y.CodeActionKind.SourceFixAll,includeSourceActions:!0},"ifSingle")}}t.FixAllAction=O;class A extends s.EditorAction{constructor(){super({id:A.Id,label:p.localize(27,null),alias:"Auto Fix...",precondition:f.ContextKeyExpr.and(c.EditorContextKeys.writable,E(y.CodeActionKind.QuickFix)),kbOpts:{kbExpr:c.EditorContextKeys.editorTextFocus,primary:1620,mac:{primary:2644},weight:100}})}run(e,t){return k(t,p.localize(28,null),{include:y.CodeActionKind.QuickFix,onlyIncludePreferredActions:!0},"ifSingle")}}t.AutoFixAction=A,A.Id="editor.action.autoFix"})),define(t[615],i([0,1,11,253]),(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),i.registerEditorContribution(n.QuickFixController.ID,n.QuickFixController),i.registerEditorAction(n.QuickFixAction),i.registerEditorAction(n.RefactorAction),i.registerEditorAction(n.SourceAction), +i.registerEditorAction(n.OrganizeImportsAction),i.registerEditorAction(n.AutoFixAction),i.registerEditorAction(n.FixAllAction),i.registerEditorCommand(new n.CodeActionCommand)})),define(t[616],i([0,1,7,57,48,65,4,2,73,134,176,481,17,55,21,14,575,8,26,23,339]),(function(e,t,i,n,o,s,r,d,c,h,u,g,p,m,f,_,v,C,b,S){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ParameterHintsWidget=void 0;const w=i.$,y=b.registerIcon("parameter-hints-next",b.Codicon.chevronDown),E=b.registerIcon("parameter-hints-previous",b.Codicon.chevronUp);let L=class e extends d.Disposable{constructor(e,t,i,n){super(),this.editor=e,this.renderDisposeables=this._register(new d.DisposableStore),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.markdownRenderer=this._register(new h.MarkdownRenderer(e,n,i)),this.model=this._register(new v.ParameterHintsModel(e)),this.keyVisible=u.Context.Visible.bindTo(t),this.keyMultipleSignatures=u.Context.MultipleSignatures.bindTo(t), +this._register(this.model.onChangedHints(e=>{e?(this.show(),this.render(e)):this.hide()}))}createParamaterHintDOMNodes(){const e=w(".editor-widget.parameter-hints-widget"),t=i.append(e,w(".wrapper"));t.tabIndex=-1;const o=i.append(t,w(".controls")),a=i.append(o,w(".button"+E.cssSelector)),l=i.append(o,w(".overloads")),d=i.append(o,w(".button"+y.cssSelector)),c=n.stop(n.domEvent(a,"click"));this._register(c(this.previous,this));const h=n.stop(n.domEvent(d,"click"));this._register(h(this.next,this));const u=w(".body"),g=new s.DomScrollableElement(u,{});this._register(g),t.appendChild(g.getDomNode());const p=i.append(u,w(".signature")),m=i.append(u,w(".docs"));e.style.userSelect="text",this.domNodes={element:e,signature:p,overloads:l,docs:m,scrollbar:g},this.editor.addContentWidget(this),this.hide(),this._register(this.editor.onDidChangeCursorSelection(e=>{this.visible&&this.editor.layoutContentWidget(this)}));const f=()=>{if(!this.domNodes)return;const e=this.editor.getOption(36) +;this.domNodes.element.style.fontSize=`${e.fontSize}px`};f(),this._register(r.Event.chain(this.editor.onDidChangeConfiguration.bind(this.editor)).filter(e=>e.hasChanged(36)).on(f,null)),this._register(this.editor.onDidLayoutChange(e=>this.updateMaxHeight())),this.updateMaxHeight()}show(){this.visible||(this.domNodes||this.createParamaterHintDOMNodes(),this.keyVisible.set(!0),this.visible=!0,setTimeout(()=>{this.domNodes&&i.addClass(this.domNodes.element,"visible")},100),this.editor.layoutContentWidget(this))}hide(){this.renderDisposeables.clear(),this.visible&&(this.keyVisible.reset(),this.visible=!1,this.announcedLabel=null,this.domNodes&&i.removeClass(this.domNodes.element,"visible"),this.editor.layoutContentWidget(this))}getPosition(){return this.visible?{position:this.editor.getPosition(),preference:[1,2]}:null}render(e){var t;if(this.renderDisposeables.clear(),!this.domNodes)return;const n=e.signatures.length>1;i.toggleClass(this.domNodes.element,"multiple",n),this.keyMultipleSignatures.set(n), +this.domNodes.signature.innerText="",this.domNodes.docs.innerText="";const s=e.signatures[e.activeSignature];if(!s)return;const r=i.append(this.domNodes.signature,w(".code")),a=this.editor.getOption(36);r.style.fontSize=`${a.fontSize}px`,r.style.fontFamily=a.fontFamily;const l=s.parameters.length>0,d=null!==(t=s.activeParameter)&&void 0!==t?t:e.activeParameter;if(l)this.renderParameters(r,s,d);else{i.append(r,w("span")).textContent=s.label}const c=s.parameters[d];if(null==c?void 0:c.documentation){const e=w("span.documentation");if("string"==typeof c.documentation)e.textContent=c.documentation;else{const t=this.renderDisposeables.add(this.markdownRenderer.render(c.documentation));i.addClass(t.element,"markdown-docs"),e.appendChild(t.element)}i.append(this.domNodes.docs,w("p",{},e))}if(void 0===s.documentation);else if("string"==typeof s.documentation)i.append(this.domNodes.docs,w("p",{},s.documentation));else{const e=this.renderDisposeables.add(this.markdownRenderer.render(s.documentation)) +;i.addClass(e.element,"markdown-docs"),i.append(this.domNodes.docs,e.element)}const h=this.hasDocs(s,c);if(i.toggleClass(this.domNodes.signature,"has-docs",h),i.toggleClass(this.domNodes.docs,"empty",!h),this.domNodes.overloads.textContent=C.pad(e.activeSignature+1,e.signatures.length.toString().length)+"/"+e.signatures.length,c){const e=this.getParameterLabel(s,d);this.announcedLabel!==e&&(o.alert(g.localize(0,null,e)),this.announcedLabel=e)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}hasDocs(e,t){return!!(t&&"string"==typeof t.documentation&&S.assertIsDefined(t.documentation).length>0)||(!!(t&&"object"==typeof t.documentation&&S.assertIsDefined(t.documentation).value.length>0)||(!!(e.documentation&&"string"==typeof e.documentation&&S.assertIsDefined(e.documentation).length>0)||!!(e.documentation&&"object"==typeof e.documentation&&S.assertIsDefined(e.documentation.value).length>0)))}renderParameters(e,t,n){ +const[o,s]=this.getParameterLabelOffsets(t,n),r=document.createElement("span");r.textContent=t.label.substring(0,o);const a=document.createElement("span");a.textContent=t.label.substring(o,s),a.className="parameter active";const l=document.createElement("span");l.textContent=t.label.substring(s),i.append(e,r,a,l)}getParameterLabel(e,t){const i=e.parameters[t];return Array.isArray(i.label)?e.label.substring(i.label[0],i.label[1]):i.label}getParameterLabelOffsets(e,t){const i=e.parameters[t];if(i){if(Array.isArray(i.label))return i.label;{const t=e.label.lastIndexOf(i.label);return t>=0?[t,t+i.label.length]:[0,0]}}return[0,0]}next(){this.editor.focus(),this.model.next()}previous(){this.editor.focus(),this.model.previous()}cancel(){this.model.cancel()}getDomNode(){return this.domNodes||this.createParamaterHintDOMNodes(),this.domNodes.element}getId(){return e.ID}trigger(e){this.model.trigger(e,0)}updateMaxHeight(){if(!this.domNodes)return;const e=`${Math.max(this.editor.getLayoutInfo().height/4,250)}px` +;this.domNodes.element.style.maxHeight=e;const t=this.domNodes.element.getElementsByClassName("wrapper");t.length&&(t[0].style.maxHeight=e)}};L.ID="editor.widget.parameterHintsWidget",L=a([l(1,p.IContextKeyService),l(2,m.IOpenerService),l(3,c.IModeService)],L),t.ParameterHintsWidget=L,_.registerThemingParticipant((e,t)=>{const i=e.getColor(f.editorHoverBorder);if(i){const n=e.type===_.HIGH_CONTRAST?2:1;t.addRule(`.monaco-editor .parameter-hints-widget { border: ${n}px solid ${i}; }`),t.addRule(`.monaco-editor .parameter-hints-widget.multiple .body { border-left: 1px solid ${i.transparent(.5)}; }`),t.addRule(`.monaco-editor .parameter-hints-widget .signature.has-docs { border-bottom: 1px solid ${i.transparent(.5)}; }`)}const n=e.getColor(f.editorHoverBackground);n&&t.addRule(`.monaco-editor .parameter-hints-widget { background-color: ${n}; }`);const o=e.getColor(f.textLinkForeground);o&&t.addRule(`.monaco-editor .parameter-hints-widget a { color: ${o}; }`);const s=e.getColor(f.editorHoverForeground) +;s&&t.addRule(`.monaco-editor .parameter-hints-widget { color: ${s}; }`);const r=e.getColor(f.textCodeBlockBackground);r&&t.addRule(`.monaco-editor .parameter-hints-widget code { background-color: ${r}; }`)})})),define(t[617],i([0,1,480,2,10,22,17,11,616,176,18]),(function(e,t,i,n,o,s,r,d,c,h,u){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TriggerParameterHintsAction=void 0;let g=class e extends n.Disposable{constructor(e,t){super(),this.editor=e,this.widget=this._register(t.createInstance(c.ParameterHintsWidget,this.editor))}static get(t){return t.getContribution(e.ID)}cancel(){this.widget.cancel()}previous(){this.widget.previous()}next(){this.widget.next()}trigger(e){this.widget.trigger(e)}};g.ID="editor.controller.parameterHints",g=a([l(1,o.IInstantiationService)],g);class p extends d.EditorAction{constructor(){super({id:"editor.action.triggerParameterHints",label:i.localize(0,null),alias:"Trigger Parameter Hints",precondition:s.EditorContextKeys.hasSignatureHelpProvider,kbOpts:{ +kbExpr:s.EditorContextKeys.editorTextFocus,primary:3082,weight:100}})}run(e,t){const i=g.get(t);i&&i.trigger({triggerKind:u.SignatureHelpTriggerKind.Invoke})}}t.TriggerParameterHintsAction=p,d.registerEditorContribution(g.ID,g),d.registerEditorAction(p);const m=d.EditorCommand.bindToContribution(g.get);d.registerEditorCommand(new m({id:"closeParameterHints",precondition:h.Context.Visible,handler:e=>e.cancel(),kbOpts:{weight:175,kbExpr:s.EditorContextKeys.focus,primary:9,secondary:[1033]}})),d.registerEditorCommand(new m({id:"showPrevParameterHint",precondition:r.ContextKeyExpr.and(h.Context.Visible,h.Context.MultipleSignatures),handler:e=>e.previous(),kbOpts:{weight:175,kbExpr:s.EditorContextKeys.focus,primary:16,secondary:[528],mac:{primary:16,secondary:[528,302]}}})),d.registerEditorCommand(new m({id:"showNextParameterHint",precondition:r.ContextKeyExpr.and(h.Context.Visible,h.Context.MultipleSignatures),handler:e=>e.next(),kbOpts:{weight:175,kbExpr:s.EditorContextKeys.focus,primary:18,secondary:[530],mac:{ +primary:18,secondary:[530,300]}}}))})),define(t[254],i([0,1,52,14,49,2,101,23,85]),(function(e,t,i,n,o,s,r,a,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractEditorNavigationQuickAccessProvider=void 0;t.AbstractEditorNavigationQuickAccessProvider=class{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t){var i;const n=new s.DisposableStore;e.canAcceptInBackground=!!(null===(i=this.options)||void 0===i?void 0:i.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const o=n.add(new s.MutableDisposable);return o.value=this.doProvide(e,t),n.add(this.onDidActiveTextEditorControlChange(()=>{o.value=void 0,o.value=this.doProvide(e,t)})),n}doProvide(e,t){const i=new s.DisposableStore,n=this.activeTextEditorControl;if(n&&this.canProvideWithTextEditor(n)){const o=r.getCodeEditor(n);if(o){let e=a.withNullAsUndefined(n.saveViewState());i.add(o.onDidChangeCursorPosition(()=>{e=a.withNullAsUndefined(n.saveViewState())})), +i.add(l.once(t.onCancellationRequested)(()=>{e&&n===this.activeTextEditorControl&&n.restoreViewState(e)}))}i.add(s.toDisposable(()=>this.clearDecorations(n))),i.add(this.provideWithTextEditor(n,e,t))}else i.add(this.provideWithoutTextEditor(e,t));return i}canProvideWithTextEditor(e){return!0}gotoLocation(e,t){e.setSelection(t.range),e.revealRangeInCenter(t.range,0),t.preserveFocus||e.focus()}getModel(e){var t;return r.isDiffEditor(e)?null===(t=e.getModel())||void 0===t?void 0:t.modified:e.getModel()}addDecorations(e,t){e.changeDecorations(e=>{const s=[];this.rangeHighlightDecorationId&&(s.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),s.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);const r=[{range:t,options:{className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{overviewRuler:{color:n.themeColorFromId(o.overviewRulerRangeHighlight),position:i.OverviewRulerLane.Full}}}],[a,l]=e.deltaDecorations(s,r);this.rangeHighlightDecorationId={ +rangeHighlightId:a,overviewRulerDecorationId:l}})}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations(e=>{e.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}}})),define(t[618],i([0,1,483,2,254,101]),(function(e,t,i,n,o,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractGotoLineQuickAccessProvider=void 0;class r extends o.AbstractEditorNavigationQuickAccessProvider{constructor(){super({canAcceptInBackground:!0})}provideWithoutTextEditor(e){const t=i.localize(0,null);return e.items=[{label:t}],e.ariaLabel=t,n.Disposable.None}provideWithTextEditor(e,t,i){const o=new n.DisposableStore;o.add(t.onDidAccept(i=>{const[n]=t.selectedItems;if(n){if(!this.isValidLineNumber(e,n.lineNumber))return;this.gotoLocation(e,{range:this.toRange(n.lineNumber,n.column),keyMods:t.keyMods,preserveFocus:i.inBackground}),i.inBackground||t.hide()}}));const a=()=>{ +const i=this.parsePosition(e,t.value.trim().substr(r.PREFIX.length)),n=this.getPickLabel(e,i.lineNumber,i.column);if(t.items=[{lineNumber:i.lineNumber,column:i.column,label:n}],t.ariaLabel=n,!this.isValidLineNumber(e,i.lineNumber))return void this.clearDecorations(e);const o=this.toRange(i.lineNumber,i.column);e.revealRangeInCenter(o,0),this.addDecorations(e,o)};a(),o.add(t.onDidChangeValue(()=>a()));const l=s.getCodeEditor(e);if(l){2===l.getOptions().get(52).renderType&&(l.updateOptions({lineNumbers:"on"}),o.add(n.toDisposable(()=>l.updateOptions({lineNumbers:"relative"}))))}return o}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){const i=t.split(/,|:|#/).map(e=>parseInt(e,10)).filter(e=>!isNaN(e)),n=this.lineCount(e)+1;return{lineNumber:i[0]>0?i[0]:n+i[0],column:i[1]}}getPickLabel(e,t,n){if(this.isValidLineNumber(e,t))return this.isValidColumn(e,t,n)?i.localize(1,null,t,n):i.localize(2,null,t);const o=e.getPosition()||{lineNumber:1,column:1 +},s=this.lineCount(e);return s>1?i.localize(3,null,o.lineNumber,o.column,s):i.localize(4,null,o.lineNumber,o.column)}isValidLineNumber(e,t){return!(!t||"number"!=typeof t)&&(t>0&&t<=this.lineCount(e))}isValidColumn(e,t,i){if(!i||"number"!=typeof i)return!1;const n=this.getModel(e);if(!n)return!1;const o={lineNumber:t,column:i};return n.validatePosition(o).equals(o)}lineCount(e){var t,i;return null!==(i=null===(t=this.getModel(e))||void 0===t?void 0:t.getLineCount())&&void 0!==i?i:0}}t.AbstractGotoLineQuickAccessProvider=r,r.PREFIX=":"})),define(t[619],i([0,1,484,25,2,3,254,18,237,8,278,50,26]),(function(e,t,i,n,o,s,a,l,d,c,h,u,g){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractGotoSymbolQuickAccessProvider=void 0;class p extends a.AbstractEditorNavigationQuickAccessProvider{constructor(e=Object.create(null)){super(e),this.options=e,e.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,i.localize(0,null)),o.Disposable.None}provideWithTextEditor(e,t,i){ +const n=this.getModel(e);return n?l.DocumentSymbolProviderRegistry.has(n)?this.doProvideWithEditorSymbols(e,n,t,i):this.doProvideWithoutEditorSymbols(e,n,t,i):o.Disposable.None}doProvideWithoutEditorSymbols(e,t,n,s){const a=new o.DisposableStore;return this.provideLabelPick(n,i.localize(1,null)),(()=>r(this,void 0,void 0,(function*(){(yield this.waitForLanguageSymbolRegistry(t,a))&&!s.isCancellationRequested&&a.add(this.doProvideWithEditorSymbols(e,t,n,s))})))(),a}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:14}],e.ariaLabel=t}waitForLanguageSymbolRegistry(e,t){return r(this,void 0,void 0,(function*(){if(l.DocumentSymbolProviderRegistry.has(e))return!0;let i;const n=new Promise(e=>i=e),s=t.add(l.DocumentSymbolProviderRegistry.onDidChange(()=>{l.DocumentSymbolProviderRegistry.has(e)&&(s.dispose(),i(!0))}));return t.add(o.toDisposable(()=>i(!1))),n}))}doProvideWithEditorSymbols(e,t,s,a){const l=new o.DisposableStore;l.add(s.onDidAccept(t=>{const[i]=s.selectedItems;i&&i.range&&(this.gotoLocation(e,{ +range:i.range.selection,keyMods:s.keyMods,preserveFocus:t.inBackground}),t.inBackground||s.hide())})),l.add(s.onDidTriggerItemButton(({item:t})=>{t&&t.range&&(this.gotoLocation(e,{range:t.range.selection,keyMods:s.keyMods,forceSideBySide:!0}),s.hide())}));const d=this.getDocumentSymbols(t,!0,a);let c=void 0;const u=()=>r(this,void 0,void 0,(function*(){null==c||c.dispose(!0),s.busy=!1,c=new n.CancellationTokenSource(a),s.busy=!0;try{const e=h.prepareQuery(s.value.substr(p.PREFIX.length).trim()),t=yield this.doGetSymbolPicks(d,e,void 0,c.token);if(a.isCancellationRequested)return;t.length>0?s.items=t:e.original.length>0?this.provideLabelPick(s,i.localize(2,null)):this.provideLabelPick(s,i.localize(3,null))}finally{a.isCancellationRequested||(s.busy=!1)}}));l.add(s.onDidChangeValue(()=>u())),u();let g=!0;return l.add(s.onDidChangeActive(()=>{const[t]=s.activeItems;if(t&&t.range){if(g)return void(g=!1);e.revealRangeInCenter(t.range.selection,0),this.addDecorations(e,t.range.decoration)}})),l} +doGetSymbolPicks(e,t,n,o){return r(this,void 0,void 0,(function*(){const r=yield e;if(o.isCancellationRequested)return[];const a=0===t.original.indexOf(p.SCOPE_PREFIX),d=a?1:0;let u,_;t.values&&t.values.length>1?(u=h.pieceToQuery(t.values[0]),_=h.pieceToQuery(t.values.slice(1))):u=t;const v=[];for(let e=0;ed){let e=!1;if(u!==t&&([C,b]=h.scoreFuzzy2(p,Object.assign(Object.assign({},t),{values:void 0}),d,m),"number"==typeof C&&(e=!0)),"number"!=typeof C&&([C,b]=h.scoreFuzzy2(p,u,d,m),"number"!=typeof C))continue;if(!e&&_){if(f&&_.original.length>0&&([S,w]=h.scoreFuzzy2(f,_)),"number"!=typeof S)continue;"number"==typeof C&&(C+=S)}}const y=o.tags&&o.tags.indexOf(1)>=0;v.push({index:e,kind:o.kind,score:C, +label:p,ariaLabel:a,description:f,highlights:y?void 0:{label:b,description:w},range:{selection:s.Range.collapseToStart(o.selectionRange),decoration:o.range},strikethrough:y,buttons:(()=>{var e,t;const n=(null===(e=this.options)||void 0===e?void 0:e.openSideBySideDirection)?null===(t=this.options)||void 0===t?void 0:t.openSideBySideDirection():void 0;if(n)return[{iconClass:"right"===n?g.Codicon.splitHorizontal.classNames:g.Codicon.splitVertical.classNames,tooltip:"right"===n?i.localize(4,null):i.localize(5,null)}]})()})}const C=v.sort((e,t)=>a?this.compareByKindAndScore(e,t):this.compareByScore(e,t));let b=[];if(a){let e=void 0,t=void 0,i=0;function S(){t&&"number"==typeof e&&i>0&&(t.label=c.format(f[e]||m,i))}for(const n of C)e!==n.kind?(S(),e=n.kind,i=1,t={type:"separator"},b.push(t)):i++,b.push(n);S()}else C.length>0&&(b=[{label:i.localize(6,null,v.length),type:"separator"},...C]);return b}))}compareByScore(e,t){if("number"!=typeof e.score&&"number"==typeof t.score)return 1 +;if("number"==typeof e.score&&"number"!=typeof t.score)return-1;if("number"==typeof e.score&&"number"==typeof t.score){if(e.score>t.score)return-1;if(e.scoret.index?1:0}compareByKindAndScore(e,t){const i=f[e.kind]||m,n=f[t.kind]||m,o=i.localeCompare(n);return 0===o?this.compareByScore(e,t):o}getDocumentSymbols(e,t,i){return r(this,void 0,void 0,(function*(){const n=yield d.OutlineModel.create(e,i);if(i.isCancellationRequested)return[];const o=[];for(const e of n.children.values())e instanceof d.OutlineElement?o.push(e.symbol):o.push(...u.Iterable.map(e.children.values(),e=>e.symbol));let r=[];return t?this.flattenDocumentSymbols(r,o,""):r=o,r.sort((e,t)=>s.Range.compareRangesUsingStarts(e.range,t.range))}))}flattenDocumentSymbols(e,t,i){for(const n of t)e.push({kind:n.kind,tags:n.tags,name:n.name,detail:n.detail,containerName:n.containerName||i,range:n.range,selectionRange:n.selectionRange,children:void 0}), +n.children&&this.flattenDocumentSymbols(e,n.children,n.name)}}t.AbstractGotoSymbolQuickAccessProvider=p,p.PREFIX="@",p.SCOPE_PREFIX=":",p.PREFIX_BY_CATEGORY=`${p.PREFIX}${p.SCOPE_PREFIX}`;const m=i.localize(7,null),f={5:i.localize(8,null),11:i.localize(9,null),8:i.localize(10,null),12:i.localize(11,null),4:i.localize(12,null),22:i.localize(13,null),23:i.localize(14,null),24:i.localize(15,null),10:i.localize(16,null),2:i.localize(17,null),3:i.localize(18,null),25:i.localize(19,null),1:i.localize(20,null),6:i.localize(21,null),9:i.localize(22,null),21:i.localize(23,null),14:i.localize(24,null),0:i.localize(25,null),17:i.localize(26,null),15:i.localize(27,null),16:i.localize(28,null),18:i.localize(29,null),19:i.localize(30,null),7:i.localize(31,null),13:i.localize(32,null)}})),define(t[620],i([0,1,485,11,19,2,13,25,3,18,15,31,17,22,24,27,12,8,21,14,29,42,341]),(function(e,t,i,n,o,s,d,c,h,u,g,p,m,f,_,v,C,b,S,w,y,E){"use strict";Object.defineProperty(t,"__esModule",{value:!0}), +t.editorOnTypeRenameBackground=t.getOnTypeRenameRanges=t.OnTypeRenameAction=t.OnTypeRenameContribution=t.CONTEXT_ONTYPE_RENAME_INPUT_VISIBLE=void 0,t.CONTEXT_ONTYPE_RENAME_INPUT_VISIBLE=new m.RawContextKey("onTypeRenameInputVisible",!1);let L=class e extends s.Disposable{constructor(e,i){super(),this._debounceDuration=200,this._localToDispose=this._register(new s.DisposableStore),this._editor=e,this._enabled=!1,this._visibleContextKey=t.CONTEXT_ONTYPE_RENAME_INPUT_VISIBLE.bindTo(i),this._currentDecorations=[],this._languageWordPattern=null,this._currentWordPattern=null,this._ignoreChangeEvent=!1,this._localToDispose=this._register(new s.DisposableStore),this._rangeUpdateTriggerPromise=null,this._rangeSyncTriggerPromise=null,this._currentRequest=null,this._currentRequestPosition=null,this._currentRequestModelVersion=null,this._register(this._editor.onDidChangeModel(()=>this.reinitialize())),this._register(this._editor.onDidChangeConfiguration(e=>{e.hasChanged(73)&&this.reinitialize()})), +this._register(u.OnTypeRenameProviderRegistry.onDidChange(()=>this.reinitialize())),this._register(this._editor.onDidChangeModelLanguage(()=>this.reinitialize())),this.reinitialize()}static get(t){return t.getContribution(e.ID)}reinitialize(){const e=this._editor.getModel(),t=null!==e&&this._editor.getOption(73)&&u.OnTypeRenameProviderRegistry.has(e);if(t===this._enabled)return;if(this._enabled=t,this.clearRanges(),this._localToDispose.clear(),!t||null===e)return;this._languageWordPattern=E.LanguageConfigurationRegistry.getWordDefinition(e.getLanguageIdentifier().id),this._localToDispose.add(e.onDidChangeLanguageConfiguration(()=>{this._languageWordPattern=E.LanguageConfigurationRegistry.getWordDefinition(e.getLanguageIdentifier().id)}));const i=new g.Delayer(this._debounceDuration),n=()=>{this._rangeUpdateTriggerPromise=i.trigger(()=>this.updateRanges(),this._debounceDuration)},o=new g.Delayer(0),s=e=>{this._rangeSyncTriggerPromise=o.trigger(()=>this._syncRanges(e))} +;this._localToDispose.add(this._editor.onDidChangeCursorPosition(()=>{n()})),this._localToDispose.add(this._editor.onDidChangeModelContent(t=>{if(!this._ignoreChangeEvent&&this._currentDecorations.length>0){const i=e.getDecorationRange(this._currentDecorations[0]);if(i&&t.changes.every(e=>i.intersectRanges(e.range)))return void s(this._currentDecorations)}n()})),this._localToDispose.add({dispose:()=>{i.cancel(),o.cancel()}}),this.updateRanges()}_syncRanges(e){if(!this._editor.hasModel()||e!==this._currentDecorations||0===e.length)return;const t=this._editor.getModel(),i=t.getDecorationRange(e[0]);if(!i||i.startLineNumber!==i.endLineNumber)return this.clearRanges();const n=t.getValueInRange(i);if(this._currentWordPattern){const e=n.match(this._currentWordPattern);if((e?e[0].length:0)!==n.length)return this.clearRanges()}let o=[];for(let i=1,s=e.length;i1)return void this.clearRanges();const n=this._editor.getModel(),o=n.getVersionId();if(this._currentRequestPosition&&this._currentRequestModelVersion===o){if(i.equals(this._currentRequestPosition))return;if(this._currentDecorations&&this._currentDecorations.length>0){const e=n.getDecorationRange(this._currentDecorations[0]);if(e&&e.containsPosition(i))return}}this._currentRequestPosition=i,this._currentRequestModelVersion=o;const s=g.createCancelablePromise(t=>r(this,void 0,void 0,(function*(){try{const r=yield k(n,i,t);if(s!==this._currentRequest)return;if(this._currentRequest=null,o!==n.getVersionId())return;let a=[];(null==r?void 0:r.ranges)&&(a=r.ranges),this._currentWordPattern=(null==r?void 0:r.wordPattern)||this._languageWordPattern;let l=!1;for(let e=0,t=a.length;e({range:t, +options:e.DECORATION}));this._visibleContextKey.set(!0),this._currentDecorations=this._editor.deltaDecorations(this._currentDecorations,d)}catch(e){C.isPromiseCanceledError(e)||C.onUnexpectedError(e),this._currentRequest!==s&&this._currentRequest||this.clearRanges()}})));return this._currentRequest=s,s}))}};L.ID="editor.contrib.onTypeRename",L.DECORATION=p.ModelDecorationOptions.register({stickiness:0,className:"on-type-rename-decoration"}),L=a([l(1,m.IContextKeyService)],L),t.OnTypeRenameContribution=L;class x extends n.EditorAction{constructor(){super({id:"editor.action.onTypeRename",label:i.localize(0,null),alias:"On Type Rename Symbol",precondition:m.ContextKeyExpr.and(f.EditorContextKeys.writable,f.EditorContextKeys.hasRenameProvider),kbOpts:{kbExpr:f.EditorContextKeys.editorTextFocus,primary:3132,weight:100}})}runCommand(e,t){const i=e.get(v.ICodeEditorService),[n,o]=Array.isArray(t)&&t||[void 0,void 0];return _.URI.isUri(n)&&d.Position.isIPosition(o)?i.openCodeEditor({resource:n +},i.getActiveCodeEditor()).then(e=>{e&&(e.setPosition(o),e.invokeWithinContext(t=>(this.reportTelemetry(t,e),this.run(t,e))))},C.onUnexpectedError):super.runCommand(e,t)}run(e,t){const i=L.get(t);return i?Promise.resolve(i.updateRanges(!0)):Promise.resolve()}}t.OnTypeRenameAction=x;const D=n.EditorCommand.bindToContribution(L.get);function k(e,t,i){const n=u.OnTypeRenameProviderRegistry.ordered(e);return g.first(n.map(n=>()=>Promise.resolve(n.provideOnTypeRenameRanges(e,t,i)).then(e=>{if(e)return{ranges:e.ranges,wordPattern:e.wordPattern||n.wordPattern}},e=>{C.onUnexpectedExternalError(e)})),e=>!!e&&o.isNonEmptyArray(null==e?void 0:e.ranges))}n.registerEditorCommand(new D({id:"cancelOnTypeRenameInput",precondition:t.CONTEXT_ONTYPE_RENAME_INPUT_VISIBLE,handler:e=>e.clearRanges(),kbOpts:{kbExpr:f.EditorContextKeys.editorTextFocus,weight:199,primary:9,secondary:[1033]}})),t.getOnTypeRenameRanges=k,t.editorOnTypeRenameBackground=S.registerColor("editor.onTypeRenameBackground",{ +dark:y.Color.fromHex("#f00").transparent(.3),light:y.Color.fromHex("#f00").transparent(.3),hc:y.Color.fromHex("#f00").transparent(.3)},i.localize(1,null)),w.registerThemingParticipant((e,i)=>{const n=e.getColor(t.editorOnTypeRenameBackground);n&&i.addRule(`.monaco-editor .on-type-rename-decoration { background: ${n}; border-left-color: ${n}; }`)}),n.registerModelAndPositionCommand("_executeRenameOnTypeProvider",(e,t)=>k(e,t,c.CancellationToken.None)),n.registerEditorContribution(L.ID,L),n.registerEditorAction(x)})),define(t[621],i([0,1,2,13,487,17,21,14,35,342]),(function(e,t,i,n,o,s,r,d,c){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RenameInputField=t.CONTEXT_RENAME_INPUT_VISIBLE=void 0,t.CONTEXT_RENAME_INPUT_VISIBLE=new s.RawContextKey("renameInputVisible",!1);let h=class{constructor(e,n,o,s,r){this._editor=e,this._acceptKeybindings=n,this._themeService=o,this._keybindingService=s,this._disposables=new i.DisposableStore,this.allowEditorOverflow=!0, +this._visibleContextKey=t.CONTEXT_RENAME_INPUT_VISIBLE.bindTo(r),this._editor.addContentWidget(this),this._disposables.add(this._editor.onDidChangeConfiguration(e=>{e.hasChanged(36)&&this._updateFont()})),this._disposables.add(o.onDidColorThemeChange(this._updateStyles,this))}dispose(){this._disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return"__renameInputWidget"}getDomNode(){if(!this._domNode){this._domNode=document.createElement("div"),this._domNode.className="monaco-editor rename-box",this._input=document.createElement("input"),this._input.className="rename-input",this._input.type="text",this._input.setAttribute("aria-label",o.localize(0,null)),this._domNode.appendChild(this._input),this._label=document.createElement("div"),this._label.className="rename-label",this._domNode.appendChild(this._label);const e=()=>{var e,t;const[i,n]=this._acceptKeybindings;this._keybindingService.lookupKeybinding(i), +this._label.innerText=o.localize(1,null,null===(e=this._keybindingService.lookupKeybinding(i))||void 0===e?void 0:e.getLabel(),null===(t=this._keybindingService.lookupKeybinding(n))||void 0===t?void 0:t.getLabel())};e(),this._disposables.add(this._keybindingService.onDidUpdateKeybindings(e)),this._updateFont(),this._updateStyles(this._themeService.getColorTheme())}return this._domNode}_updateStyles(e){var t,i,n,o;if(!this._input||!this._domNode)return;const s=e.getColor(r.widgetShadow);this._domNode.style.backgroundColor=String(null!==(t=e.getColor(r.editorWidgetBackground))&&void 0!==t?t:""),this._domNode.style.boxShadow=s?` 0 2px 8px ${s}`:"",this._domNode.style.color=String(null!==(i=e.getColor(r.inputForeground))&&void 0!==i?i:""),this._input.style.backgroundColor=String(null!==(n=e.getColor(r.inputBackground))&&void 0!==n?n:"");const a=e.getColor(r.inputBorder);this._input.style.borderWidth=a?"1px":"0px",this._input.style.borderStyle=a?"solid":"none", +this._input.style.borderColor=null!==(o=null==a?void 0:a.toString())&&void 0!==o?o:"none"}_updateFont(){if(!this._input||!this._label)return;const e=this._editor.getOption(36);this._input.style.fontFamily=e.fontFamily,this._input.style.fontWeight=e.fontWeight,this._input.style.fontSize=`${e.fontSize}px`,this._label.style.fontSize=`${.8*e.fontSize}px`}getPosition(){return this._visible?{position:this._position,preference:[2,1]}:null}acceptInput(e){this._currentAcceptInput&&this._currentAcceptInput(e)}cancelInput(e){this._currentCancelInput&&this._currentCancelInput(e)}getInput(e,t,o,s,r,a){this._domNode.classList.toggle("preview",r),this._position=new n.Position(e.startLineNumber,e.startColumn),this._input.value=t,this._input.setAttribute("selectionStart",o.toString()),this._input.setAttribute("selectionEnd",s.toString()),this._input.size=Math.max(1.1*(e.endColumn-e.startColumn),20);const l=new i.DisposableStore;return new Promise(e=>{this._currentCancelInput=t=>(this._currentAcceptInput=void 0, +this._currentCancelInput=void 0,e(t),!0),this._currentAcceptInput=i=>{0!==this._input.value.trim().length&&this._input.value!==t?(this._currentAcceptInput=void 0,this._currentCancelInput=void 0,e({newName:this._input.value,wantsPreview:r&&i})):this.cancelInput(!0)},a.onCancellationRequested(()=>this.cancelInput(!0)),l.add(this._editor.onDidBlurEditorWidget(()=>this.cancelInput(!1))),this._show()}).finally(()=>{l.dispose(),this._hide()})}_show(){this._editor.revealLineInCenterIfOutsideViewport(this._position.lineNumber,0),this._visible=!0,this._visibleContextKey.set(!0),this._editor.layoutContentWidget(this),setTimeout(()=>{this._input.focus(),this._input.setSelectionRange(parseInt(this._input.getAttribute("selectionStart")),parseInt(this._input.getAttribute("selectionEnd")))},100)}_hide(){this._visible=!1,this._visibleContextKey.reset(),this._editor.layoutContentWidget(this)}};h=a([l(2,d.IThemeService),l(3,c.IKeybindingService),l(4,s.IContextKeyService)],h),t.RenameInputField=h})), +define(t[622],i([0,1,486,12,17,56,11,22,621,18,13,48,3,140,68,32,127,24,27,25,2,15,81,10,34,93,130,23]),(function(e,t,i,n,o,s,d,c,h,u,g,p,m,f,_,v,C,b,S,w,y,E,L,x,D,k,N,I){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RenameAction=t.rename=void 0;class M{constructor(e,t){this.model=e,this.position=t,this._providerRenameIdx=0,this._providers=u.RenameProviderRegistry.ordered(e)}hasProvider(){return this._providers.length>0}resolveRenameLocation(e){return r(this,void 0,void 0,(function*(){const t=[];for(this._providerRenameIdx=0;this._providerRenameIdx0?t.join("\n"):void 0}:{range:m.Range.fromPositions(this.position),text:"",rejectReason:t.length>0?t.join("\n"):void 0}}))}provideRenameEdits(e,t){return r(this,void 0,void 0,(function*(){return this._provideRenameEdits(e,this._providerRenameIdx,[],t)}))}_provideRenameEdits(e,t,n,o){return r(this,void 0,void 0,(function*(){const s=this._providers[t];if(!s)return{edits:[],rejectReason:n.join("\n")};const r=yield s.provideRenameEdits(this.model,this.position,e,o);return r?r.rejectReason?this._provideRenameEdits(e,t+1,n.concat(r.rejectReason),o):r:this._provideRenameEdits(e,t+1,n.concat(i.localize(0,null)),o)}))}}function R(e,t,i){return r(this,void 0,void 0,(function*(){const n=new M(e,t),o=yield n.resolveRenameLocation(w.CancellationToken.None);return(null==o?void 0:o.rejectReason)?{edits:[],rejectReason:o.rejectReason}:n.provideRenameEdits(i,w.CancellationToken.None)}))}t.rename=R;let T=class e{constructor(e,t,i,n,o,s,r){this.editor=e,this._instaService=t,this._notificationService=i, +this._bulkEditService=n,this._progressService=o,this._logService=s,this._configService=r,this._dispoableStore=new y.DisposableStore,this._cts=new w.CancellationTokenSource,this._renameInputField=this._dispoableStore.add(new E.IdleValue(()=>this._dispoableStore.add(this._instaService.createInstance(h.RenameInputField,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))))}static get(t){return t.getContribution(e.ID)}dispose(){this._dispoableStore.dispose(),this._cts.dispose(!0)}run(){return r(this,void 0,void 0,(function*(){if(this._cts.dispose(!0),!this.editor.hasModel())return;const e=this.editor.getPosition(),t=new M(this.editor.getModel(),e);if(!t.hasProvider())return;let n;this._cts=new _.EditorStateCancellationTokenSource(this.editor,5);try{const e=t.resolveRenameLocation(this._cts.token);this._progressService.showWhile(e,250),n=yield e}catch(t){return void f.MessageController.get(this.editor).showMessage(t||i.localize(1,null),e)}if(!n)return +;if(n.rejectReason)return void f.MessageController.get(this.editor).showMessage(n.rejectReason,e);if(this._cts.token.isCancellationRequested)return;this._cts.dispose(),this._cts=new _.EditorStateCancellationTokenSource(this.editor,5,n.range);let o=this.editor.getSelection(),s=0,a=n.text.length;m.Range.isEmpty(o)||m.Range.spansMultipleLines(o)||!m.Range.containsRange(n.range,o)||(s=Math.max(0,o.startColumn-n.range.startColumn),a=Math.min(n.range.endColumn,o.endColumn)-n.range.startColumn);const l=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),d=yield this._renameInputField.value.getInput(n.range,n.text,s,a,l,this._cts.token);if("boolean"==typeof d)return void(d&&this.editor.focus());this.editor.focus();const c=E.raceCancellation(t.provideRenameEdits(d.newName,this._cts.token),this._cts.token).then(e=>r(this,void 0,void 0,(function*(){ +e&&this.editor.hasModel()&&(e.rejectReason?this._notificationService.info(e.rejectReason):this._bulkEditService.apply(C.ResourceEdit.convert(e),{editor:this.editor,showPreview:d.wantsPreview,label:i.localize(2,null,null==n?void 0:n.text),quotableLabel:i.localize(3,null,null==n?void 0:n.text)}).then(e=>{e.ariaSummary&&p.alert(i.localize(4,null,n.text,d.newName,e.ariaSummary))}).catch(e=>{this._notificationService.error(i.localize(5,null)),this._logService.error(e)}))})),e=>{this._notificationService.error(i.localize(6,null)),this._logService.error(e)});return this._progressService.showWhile(c,250),c}))}acceptRenameInput(e){this._renameInputField.value.acceptInput(e)}cancelRenameInput(){this._renameInputField.value.cancelInput(!0)}};T.ID="editor.contrib.renameController",T=a([l(1,x.IInstantiationService),l(2,v.INotificationService),l(3,C.IBulkEditService),l(4,s.IEditorProgressService),l(5,L.ILogService),l(6,N.ITextResourceConfigurationService)],T);class O extends d.EditorAction{constructor(){super({ +id:"editor.action.rename",label:i.localize(7,null),alias:"Rename Symbol",precondition:o.ContextKeyExpr.and(c.EditorContextKeys.writable,c.EditorContextKeys.hasRenameProvider),kbOpts:{kbExpr:c.EditorContextKeys.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const i=e.get(S.ICodeEditorService),[o,s]=Array.isArray(t)&&t||[void 0,void 0];return b.URI.isUri(o)&&g.Position.isIPosition(s)?i.openCodeEditor({resource:o},i.getActiveCodeEditor()).then(e=>{e&&(e.setPosition(s),e.invokeWithinContext(t=>(this.reportTelemetry(t,e),this.run(t,e))))},n.onUnexpectedError):super.runCommand(e,t)}run(e,t){const i=T.get(t);return i?i.run():Promise.resolve()}}t.RenameAction=O,d.registerEditorContribution(T.ID,T),d.registerEditorAction(O);const A=d.EditorCommand.bindToContribution(T.get);d.registerEditorCommand(new A({id:"acceptRenameInput",precondition:h.CONTEXT_RENAME_INPUT_VISIBLE,handler:e=>e.acceptRenameInput(!1),kbOpts:{weight:199,kbExpr:c.EditorContextKeys.focus, +primary:3}})),d.registerEditorCommand(new A({id:"acceptRenameInputWithPreview",precondition:o.ContextKeyExpr.and(h.CONTEXT_RENAME_INPUT_VISIBLE,o.ContextKeyExpr.has("config.editor.rename.enablePreview")),handler:e=>e.acceptRenameInput(!0),kbOpts:{weight:199,kbExpr:c.EditorContextKeys.focus,primary:1027}})),d.registerEditorCommand(new A({id:"cancelRenameInput",precondition:h.CONTEXT_RENAME_INPUT_VISIBLE,handler:e=>e.cancelRenameInput(),kbOpts:{weight:199,kbExpr:c.EditorContextKeys.focus,primary:9,secondary:[1033]}})),d.registerModelAndPositionCommand("_executeDocumentRenameProvider",(function(e,t,...i){const[n]=i;return I.assertType("string"==typeof n),R(e,t,n)})),D.Registry.as(k.Extensions.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:5,description:i.localize(8,null),default:!0,type:"boolean"}}})})), +define(t[623],i([0,1,491,64,8,4,12,2,7,118,65,35,17,137,84,107,14,21,76,134,73,55,15,18,153,541,44,24,10,229,78,19,33,79,26,91,344,345,115,605]),(function(e,t,i,n,o,s,d,c,h,u,g,p,m,f,_,v,C,b,S,w,y,E,L,x,D,k,N,I,M,R,T,O,A,P,F,W){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SuggestWidget=t.editorSuggestWidgetHighlightForeground=t.editorSuggestWidgetSelectedBackground=t.editorSuggestWidgetForeground=t.editorSuggestWidgetBorder=t.editorSuggestWidgetBackground=void 0;const B=F.registerIcon("suggest-more-info",F.Codicon.chevronRight);t.editorSuggestWidgetBackground=b.registerColor("editorSuggestWidget.background",{dark:b.editorWidgetBackground,light:b.editorWidgetBackground,hc:b.editorWidgetBackground},i.localize(0,null)),t.editorSuggestWidgetBorder=b.registerColor("editorSuggestWidget.border",{dark:b.editorWidgetBorder,light:b.editorWidgetBorder,hc:b.editorWidgetBorder},i.localize(1,null)),t.editorSuggestWidgetForeground=b.registerColor("editorSuggestWidget.foreground",{dark:b.editorForeground, +light:b.editorForeground,hc:b.editorForeground},i.localize(2,null)),t.editorSuggestWidgetSelectedBackground=b.registerColor("editorSuggestWidget.selectedBackground",{dark:b.listFocusBackground,light:b.listFocusBackground,hc:b.listFocusBackground},i.localize(3,null)),t.editorSuggestWidgetHighlightForeground=b.registerColor("editorSuggestWidget.highlightForeground",{dark:b.listHighlightForeground,light:b.listHighlightForeground,hc:b.listHighlightForeground},i.localize(4,null));const V=/^(#([\da-f]{3}){1,2}|(rgb|hsl)a\(\s*(\d{1,3}%?\s*,\s*){3}(1|0?\.\d+)\)|(rgb|hsl)\(\s*\d{1,3}%?(\s*,\s*\d{1,3}%?){2}\s*\))$/i;function z(e){if(!e)return!1;const t=e.completion;return!!t.documentation||t.detail&&t.detail!==t.label}function H(e){return`suggest-aria-id:${e}`}let K=class{constructor(e,t,i,n,o,s){this.widget=e,this.editor=t,this.triggerKeybindingLabel=i,this._modelService=n,this._modeService=o,this._themeService=s}get templateId(){return"suggestion"}renderTemplate(e){const t=Object.create(null) +;t.disposables=new c.DisposableStore,t.root=e,t.root.classList.add("show-file-icons"),t.icon=h.append(e,h.$(".icon")),t.colorspan=h.append(t.icon,h.$("span.colorspan"));const n=h.append(e,h.$(".contents")),o=h.append(n,h.$(".main"));t.iconContainer=h.append(o,h.$(".icon-label.codicon")),t.left=h.append(o,h.$("span.left")),t.right=h.append(o,h.$("span.right")),t.iconLabel=new D.IconLabel(t.left,{supportHighlights:!0,supportCodicons:!0}),t.disposables.add(t.iconLabel),t.parametersLabel=h.append(t.left,h.$("span.signature-label")),t.qualifierLabel=h.append(t.left,h.$("span.qualifier-label")),t.detailsLabel=h.append(t.right,h.$("span.details-label")),t.readMore=h.append(t.right,h.$("span.readMore"+B.cssSelector)),t.readMore.title=i.localize(5,null,this.triggerKeybindingLabel);const r=()=>{const e=this.editor.getOptions(),i=e.get(36),n=i.fontFamily,s=i.fontFeatureSettings,r=e.get(97)||i.fontSize,a=e.get(98)||i.lineHeight,l=i.fontWeight,d=`${r}px`,c=`${a}px`;t.root.style.fontSize=d,t.root.style.fontWeight=l, +o.style.fontFamily=n,o.style.fontFeatureSettings=s,o.style.lineHeight=c,t.icon.style.height=c,t.icon.style.width=c,t.readMore.style.height=c,t.readMore.style.width=c};return r(),t.disposables.add(s.Event.chain(this.editor.onDidChangeConfiguration.bind(this.editor)).filter(e=>e.hasChanged(36)||e.hasChanged(97)||e.hasChanged(98)).on(r,null)),t}renderElement(e,t,i){const o=i,s=e.completion,r="string"==typeof s.label?s.label:s.label.name;o.root.id=H(t),o.colorspan.style.backgroundColor="";const a={labelEscapeNewLines:!0,matches:n.createMatches(e.score)};let l=[];if(19===s.kind&&function(e,t){const i="string"==typeof e.completion.label?e.completion.label:e.completion.label.name;return i.match(V)?(t[0]=i,!0):!("string"!=typeof e.completion.documentation||!e.completion.documentation.match(V))&&(t[0]=e.completion.documentation,!0)}(e,l))o.icon.className="icon customcolor",o.iconContainer.className="icon hide", +o.colorspan.style.backgroundColor=l[0];else if(20===s.kind&&this._themeService.getFileIconTheme().hasFileIcons){o.icon.className="icon hide",o.iconContainer.className="icon hide";const e=k.getIconClasses(this._modelService,this._modeService,I.URI.from({scheme:"fake",path:r}),R.FileKind.FILE),t=k.getIconClasses(this._modelService,this._modeService,I.URI.from({scheme:"fake",path:s.detail}),R.FileKind.FILE);a.extraClasses=e.length>t.length?e:t}else 23===s.kind&&this._themeService.getFileIconTheme().hasFolderIcons?(o.icon.className="icon hide",o.iconContainer.className="icon hide",a.extraClasses=O.flatten([k.getIconClasses(this._modelService,this._modeService,I.URI.from({scheme:"fake",path:r}),R.FileKind.FOLDER),k.getIconClasses(this._modelService,this._modeService,I.URI.from({scheme:"fake",path:s.detail}),R.FileKind.FOLDER)])):(o.icon.className="icon hide",o.iconContainer.className="",h.addClasses(o.iconContainer,`suggest-icon ${x.completionKindToCssClass(s.kind)}`)) +;s.tags&&s.tags.indexOf(1)>=0&&(a.extraClasses=(a.extraClasses||[]).concat(["deprecated"]),a.matches=[]),o.iconLabel.setLabel(r,void 0,a),"string"==typeof s.label?(o.parametersLabel.textContent="",o.qualifierLabel.textContent="",o.detailsLabel.textContent=(s.detail||"").replace(/\n.*$/m,""),o.root.classList.add("string-label")):(o.parametersLabel.textContent=(s.label.parameters||"").replace(/\n.*$/m,""),o.qualifierLabel.textContent=(s.label.qualifier||"").replace(/\n.*$/m,""),o.detailsLabel.textContent=(s.label.type||"").replace(/\n.*$/m,""),o.root.classList.remove("string-label")),z(e)?(o.right.classList.add("can-expand-details"),h.show(o.readMore),o.readMore.onmousedown=e=>{e.stopPropagation(),e.preventDefault()},o.readMore.onclick=e=>{e.stopPropagation(),e.preventDefault(),this.widget.toggleDetails()}):(o.right.classList.remove("can-expand-details"),h.hide(o.readMore),o.readMore.onmousedown=null,o.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}} +;K=a([l(3,N.IModelService),l(4,y.IModeService),l(5,C.IThemeService)],K);class U{constructor(e,t,n,o,r){this.widget=t,this.editor=n,this.markdownRenderer=o,this.kbToggleDetails=r,this.borderWidth=1,this.disposables=new c.DisposableStore,this.el=h.append(e,h.$(".details")),this.disposables.add(c.toDisposable(()=>e.removeChild(this.el))),this.body=h.$(".body"),this.scrollbar=new g.DomScrollableElement(this.body,{}),h.append(this.el,this.scrollbar.getDomNode()),this.disposables.add(this.scrollbar),this.header=h.append(this.body,h.$(".header")),this.close=h.append(this.header,h.$("span"+F.Codicon.close.cssSelector)),this.close.title=i.localize(6,null,this.kbToggleDetails),this.type=h.append(this.header,h.$("p.type")),this.docs=h.append(this.body,h.$("p.docs")),this.configureFont(),s.Event.chain(this.editor.onDidChangeConfiguration.bind(this.editor)).filter(e=>e.hasChanged(36)).on(this.configureFont,this,this.disposables),o.onDidRenderCodeBlock(()=>this.scrollbar.scanDomNode(),this,this.disposables)}get element(){ +return this.el}renderLoading(){this.type.textContent=i.localize(7,null),this.docs.textContent=""}renderItem(e,t){c.dispose(this.renderDisposeable),this.renderDisposeable=void 0;let{documentation:i,detail:n}=e.completion;if(t){let t="";t+=`score: ${e.score[0]}${e.word?`, compared '${e.completion.filterText&&e.completion.filterText+" (filterText)"||e.completion.label}' with '${e.word}'`:" (no prefix)"}\n`,t+=`distance: ${e.distance}, see localityBonus-setting\n`,t+=`index: ${e.idx}, based on ${e.completion.sortText&&`sortText: "${e.completion.sortText}"`||"label"}\n`,i=(new T.MarkdownString).appendCodeblock("empty",t),n=`Provider: ${e.provider._debugDisplayName}`}if(!t&&!z(e))return this.type.textContent="",this.docs.textContent="",void this.el.classList.add("no-docs");if(this.el.classList.remove("no-docs"),"string"==typeof i)this.docs.classList.remove("markdown-docs"),this.docs.textContent=i;else{this.docs.classList.add("markdown-docs"),this.docs.innerText="";const e=this.markdownRenderer.render(i) +;this.renderDisposeable=e,this.docs.appendChild(e.element)}n?(this.type.innerText=n.length>1e5?`${n.substr(0,1e5)}…`:n,h.show(this.type)):(this.type.innerText="",h.hide(this.type)),this.el.style.height=this.header.offsetHeight+this.docs.offsetHeight+2*this.borderWidth+"px",this.el.style.userSelect="text",this.el.tabIndex=-1,this.close.onmousedown=e=>{e.preventDefault(),e.stopPropagation()},this.close.onclick=e=>{e.preventDefault(),e.stopPropagation(),this.widget.toggleDetails()},this.body.scrollTop=0,this.scrollbar.scanDomNode()}scrollDown(e=8){this.body.scrollTop+=e}scrollUp(e=8){this.body.scrollTop-=e}scrollTop(){this.body.scrollTop=0}scrollBottom(){this.body.scrollTop=this.body.scrollHeight}pageDown(){this.scrollDown(80)}pageUp(){this.scrollUp(80)}setBorderWidth(e){this.borderWidth=e}configureFont(){const e=this.editor.getOptions(),t=e.get(36),i=t.fontFamily,n=e.get(97)||t.fontSize,o=e.get(98)||t.lineHeight,s=t.fontWeight,r=`${n}px`,a=`${o}px`;this.el.style.fontSize=r,this.el.style.fontWeight=s, +this.el.style.fontFeatureSettings=t.fontFeatureSettings,this.type.style.fontFamily=i,this.close.style.height=a,this.close.style.width=a}dispose(){this.disposables.dispose(),c.dispose(this.renderDisposeable),this.renderDisposeable=void 0}}let $=class e{constructor(e,n,r,a,l,d,g,p,m,_){var C,S;this.editor=e,this.telemetryService=n,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.state=0,this.isAddedAsContentWidget=!1,this.isAuto=!1,this.loadingTimeout=c.Disposable.None,this.currentSuggestionDetails=null,this.ignoreFocusEvents=!1,this.completionModel=null,this.showTimeout=new L.TimeoutTimer,this.toDispose=new c.DisposableStore,this.onDidSelectEmitter=new s.Emitter,this.onDidFocusEmitter=new s.Emitter,this.onDidHideEmitter=new s.Emitter,this.onDidShowEmitter=new s.Emitter,this.onDidSelect=this.onDidSelectEmitter.event,this.onDidFocus=this.onDidFocusEmitter.event,this.onDidHide=this.onDidHideEmitter.event,this.onDidShow=this.onDidShowEmitter.event,this.maxWidgetWidth=660,this.listWidth=330, +this.firstFocusInCurrentList=!1,this.preferDocPositionTop=!1,this.docsPositionPreviousWidgetY=null,this.explainMode=!1,this._onDetailsKeydown=new s.Emitter,this.onDetailsKeyDown=this._onDetailsKeydown.event;const y=this.toDispose.add(new w.MarkdownRenderer(e,g,p)),E=null!==(S=null===(C=r.lookupKeybinding("toggleSuggestionDetails"))||void 0===C?void 0:C.getLabel())&&void 0!==S?S:"";this.isAuto=!1,this.focusedItem=null,this.storageService=d,this.element=h.$(".editor-widget.suggest-widget"),this.toDispose.add(h.addDisposableListener(this.element,"click",e=>{e.target===this.element&&this.hideWidget()})),this.messageElement=h.append(this.element,h.$(".message")),this.listElement=h.append(this.element,h.$(".tree"));const x=()=>this.element.classList.toggle("with-status-bar",this.editor.getOption(96).statusBar.visible);x(),this.statusBarElement=h.append(this.element,h.$(".suggest-status-bar"));const D=e=>{const t=r.lookupKeybindings(e.id);return new class extends W.ActionViewItem{constructor(){super(void 0,e,{ +label:!0,icon:!1})}updateLabel(){if(O.isFalsyOrEmpty(t)||!this.label)return super.updateLabel();const{label:e}=this.getAction();this.label.textContent=/{\d}/.test(e)?o.format(this.getAction().label,t[0].getLabel()):`${this.getAction().label} (${t[0].getLabel()})`}}},k=new P.ActionBar(this.statusBarElement,{actionViewItemProvider:D}),N=new P.ActionBar(this.statusBarElement,{actionViewItemProvider:D}),I=m.createMenu(f.suggestWidgetStatusbarMenu,a);this.toDispose.add(I.onDidChange(()=>(()=>{const e=[],t=[];for(let[i,n]of I.getActions())"left"===i?e.push(...n):t.push(...n);k.clear(),k.push(e),N.clear(),N.push(t)})())),this.toDispose.add(I),this.details=_.createInstance(U,this.element,this,this.editor,y,E);const M=()=>this.element.classList.toggle("no-icons",!this.editor.getOption(96).showIcons);M();let R=_.createInstance(K,this,this.editor,E);this.list=new u.List("SuggestWidget",this.listElement,this,[R],{useShadows:!1,mouseSupport:!1,accessibilityProvider:{getRole:()=>"option",getAriaLabel:e=>{ +const t="string"==typeof e.completion.label?e.completion.label:e.completion.label.name;if(e.isResolved&&this.expandDocsSettingFromStorage()){const{documentation:n,detail:s}=e.completion,r=o.format("{0}{1}",s||"",n?"string"==typeof n?n:n.value:"");return i.localize(10,null,t,r)}return t},getWidgetAriaLabel:()=>i.localize(11,null),getWidgetRole:()=>"listbox"}}),this.toDispose.add(v.attachListStyler(this.list,l,{listInactiveFocusBackground:t.editorSuggestWidgetSelectedBackground,listInactiveFocusOutline:b.activeContrastBorder})),this.toDispose.add(l.onDidColorThemeChange(e=>this.onThemeChange(e))),this.toDispose.add(e.onDidLayoutChange(()=>this.onEditorLayoutChange())),this.toDispose.add(this.list.onMouseDown(e=>this.onListMouseDownOrTap(e))),this.toDispose.add(this.list.onTap(e=>this.onListMouseDownOrTap(e))),this.toDispose.add(this.list.onDidChangeSelection(e=>this.onListSelection(e))),this.toDispose.add(this.list.onDidChangeFocus(e=>this.onListFocus(e))), +this.toDispose.add(this.editor.onDidChangeCursorSelection(()=>this.onCursorSelectionChanged())),this.toDispose.add(this.editor.onDidChangeConfiguration(e=>{e.hasChanged(96)&&(x(),M())})),this.ctxSuggestWidgetVisible=f.Context.Visible.bindTo(a),this.ctxSuggestWidgetDetailsVisible=f.Context.DetailsVisible.bindTo(a),this.ctxSuggestWidgetMultipleSuggestions=f.Context.MultipleSuggestions.bindTo(a),this.onThemeChange(l.getColorTheme()),this.toDispose.add(h.addStandardDisposableListener(this.details.element,"keydown",e=>{this._onDetailsKeydown.fire(e)})),this.toDispose.add(this.editor.onMouseDown(e=>this.onEditorMouseDown(e)))}onEditorMouseDown(e){this.details.element.contains(e.target.element)?this.details.element.focus():this.element.contains(e.target.element)&&this.editor.focus()}onCursorSelectionChanged(){0!==this.state&&this.editor.layoutContentWidget(this)}onEditorLayoutChange(){3!==this.state&&5!==this.state||!this.expandDocsSettingFromStorage()||this.expandSideOrBelow()}onListMouseDownOrTap(e){ +void 0!==e.element&&void 0!==e.index&&(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation(),this.select(e.element,e.index))}onListSelection(e){e.elements.length&&this.select(e.elements[0],e.indexes[0])}select(e,t){const i=this.completionModel;i&&(this.onDidSelectEmitter.fire({item:e,index:t,model:i}),this.editor.focus())}onThemeChange(e){const i=e.getColor(t.editorSuggestWidgetBackground);i&&(this.listElement.style.backgroundColor=i.toString(),this.statusBarElement.style.backgroundColor=i.toString(),this.details.element.style.backgroundColor=i.toString(),this.messageElement.style.backgroundColor=i.toString());const n=e.getColor(t.editorSuggestWidgetBorder);n&&(this.listElement.style.borderColor=n.toString(),this.statusBarElement.style.borderColor=n.toString(),this.details.element.style.borderColor=n.toString(),this.messageElement.style.borderColor=n.toString(),this.detailsBorderColor=n.toString());const o=e.getColor(b.focusBorder);o&&(this.detailsFocusBorderColor=o.toString()), +this.details.setBorderWidth("hc"===e.type?2:1)}onListFocus(e){if(this.ignoreFocusEvents)return;if(!e.elements.length)return this.currentSuggestionDetails&&(this.currentSuggestionDetails.cancel(),this.currentSuggestionDetails=null,this.focusedItem=null),void this.editor.setAriaOptions({activeDescendant:void 0});if(!this.completionModel)return;const t=e.elements[0],i=e.indexes[0];this.firstFocusInCurrentList=!this.focusedItem,t!==this.focusedItem&&(this.currentSuggestionDetails&&(this.currentSuggestionDetails.cancel(),this.currentSuggestionDetails=null),this.focusedItem=t,this.list.reveal(i),this.currentSuggestionDetails=L.createCancelablePromise(e=>r(this,void 0,void 0,(function*(){const i=L.disposableTimeout(()=>this.showDetails(!0),250);e.onCancellationRequested(()=>i.dispose());const n=yield t.resolve(e);return i.dispose(),n}))),this.currentSuggestionDetails.then(()=>{i>=this.list.length||t!==this.list.element(i)||(this.ignoreFocusEvents=!0,this.list.splice(i,1,[t]),this.list.setFocus([i]), +this.ignoreFocusEvents=!1,this.expandDocsSettingFromStorage()?this.showDetails(!1):this.element.classList.remove("docs-side"),this.editor.setAriaOptions({activeDescendant:H(i)}))}).catch(d.onUnexpectedError)),this.onDidFocusEmitter.fire({item:t,index:i,model:this.completionModel})}setState(t){if(!this.element)return;this.isAddedAsContentWidget||0===t||(this.isAddedAsContentWidget=!0,this.editor.addContentWidget(this));const i=this.state!==t;switch(this.state=t,this.element.classList.toggle("frozen",4===t),t){case 0:h.hide(this.messageElement,this.details.element,this.listElement,this.statusBarElement),this.hide(),this.listHeight=0,i&&this.list.splice(0,this.list.length),this.focusedItem=null;break;case 1:this.messageElement.textContent=e.LOADING_MESSAGE,h.hide(this.listElement,this.details.element,this.statusBarElement),h.show(this.messageElement),this.element.classList.remove("docs-side"),this.show(),this.focusedItem=null;break;case 2:this.messageElement.textContent=e.NO_SUGGESTIONS_MESSAGE, +h.hide(this.listElement,this.details.element,this.statusBarElement),h.show(this.messageElement),this.element.classList.remove("docs-side"),this.show(),this.focusedItem=null;break;case 3:h.hide(this.messageElement),h.show(this.listElement,this.statusBarElement),this.show();break;case 4:h.hide(this.messageElement),h.show(this.listElement),this.show();break;case 5:h.hide(this.messageElement),h.show(this.details.element,this.listElement,this.statusBarElement),this.show()}}showTriggered(e,t){0===this.state&&(this.isAuto=!!e,this.isAuto||(this.loadingTimeout=L.disposableTimeout(()=>this.setState(1),t)))}showSuggestions(e,t,i,n){if(this.preferDocPositionTop=!1,this.docsPositionPreviousWidgetY=null,this.loadingTimeout.dispose(),this.currentSuggestionDetails&&(this.currentSuggestionDetails.cancel(),this.currentSuggestionDetails=null),this.completionModel!==e&&(this.completionModel=e),i&&2!==this.state&&0!==this.state)return void this.setState(4);let o=this.completionModel.items.length;const s=0===o +;if(this.ctxSuggestWidgetMultipleSuggestions.set(o>1),s)n?this.setState(0):this.setState(2),this.completionModel=null;else{if(3!==this.state){const{stats:e}=this.completionModel;e.wasAutomaticallyTriggered=!!n,this.telemetryService.publicLog("suggestWidget",Object.assign({},e))}this.focusedItem=null,this.list.splice(0,this.list.length,this.completionModel.items),i?this.setState(4):this.setState(3),this.list.reveal(t,0),this.list.setFocus([t]),this.detailsBorderColor&&(this.details.element.style.borderColor=this.detailsBorderColor)}}selectNextPage(){switch(this.state){case 0:return!1;case 5:return this.details.pageDown(),!0;case 1:return!this.isAuto;default:return this.list.focusNextPage(),!0}}selectNext(){switch(this.state){case 0:return!1;case 1:return!this.isAuto;default:return this.list.focusNext(1,!0),!0}}selectLast(){switch(this.state){case 0:return!1;case 5:return this.details.scrollBottom(),!0;case 1:return!this.isAuto;default:return this.list.focusLast(),!0}}selectPreviousPage(){switch(this.state){ +case 0:return!1;case 5:return this.details.pageUp(),!0;case 1:return!this.isAuto;default:return this.list.focusPreviousPage(),!0}}selectPrevious(){switch(this.state){case 0:return!1;case 1:return!this.isAuto;default:return this.list.focusPrevious(1,!0),!1}}selectFirst(){switch(this.state){case 0:return!1;case 5:return this.details.scrollTop(),!0;case 1:return!this.isAuto;default:return this.list.focusFirst(),!0}}getFocusedItem(){if(0!==this.state&&2!==this.state&&1!==this.state&&this.completionModel)return{item:this.list.getFocusedElements()[0],index:this.list.getFocus()[0],model:this.completionModel}}toggleDetailsFocus(){5===this.state?(this.setState(3),this.detailsBorderColor&&(this.details.element.style.borderColor=this.detailsBorderColor)):3===this.state&&this.expandDocsSettingFromStorage()&&(this.setState(5),this.detailsFocusBorderColor&&(this.details.element.style.borderColor=this.detailsFocusBorderColor)),this.telemetryService.publicLog2("suggestWidget:toggleDetailsFocus")}toggleDetails(){ +if(z(this.list.getFocusedElements()[0]))if(this.expandDocsSettingFromStorage())this.ctxSuggestWidgetDetailsVisible.set(!1),this.updateExpandDocsSetting(!1),h.hide(this.details.element),this.element.classList.remove("docs-side","doc-below"),this.editor.layoutContentWidget(this),this.telemetryService.publicLog2("suggestWidget:collapseDetails");else{if(3!==this.state&&5!==this.state&&4!==this.state)return;this.ctxSuggestWidgetDetailsVisible.set(!0),this.updateExpandDocsSetting(!0),this.showDetails(!1),this.telemetryService.publicLog2("suggestWidget:expandDetails")}}showDetails(e){e||this.expandSideOrBelow(),h.show(this.details.element),this.details.element.style.maxHeight=this.maxWidgetHeight+"px",e?this.details.renderLoading():this.details.renderItem(this.list.getFocusedElements()[0],this.explainMode),this.listElement.style.marginTop="0px",this.editor.layoutContentWidget(this),this.adjustDocsPosition(),this.editor.focus()}toggleExplainMode(){ +this.list.getFocusedElements()[0]&&this.expandDocsSettingFromStorage()&&(this.explainMode=!this.explainMode,this.showDetails(!1))}show(){const e=this.updateListHeight();e!==this.listHeight&&(this.editor.layoutContentWidget(this),this.listHeight=e),this.ctxSuggestWidgetVisible.set(!0),this.showTimeout.cancelAndSet(()=>{this.element.classList.add("visible"),this.onDidShowEmitter.fire(this)},100)}hide(){this.editor.layoutContentWidget(this),this.ctxSuggestWidgetVisible.reset(),this.ctxSuggestWidgetMultipleSuggestions.reset(),this.element.classList.remove("visible")}hideWidget(){this.loadingTimeout.dispose(),this.setState(0),this.onDidHideEmitter.fire(this)}getPosition(){if(0===this.state)return null;let e=[2,1];return this.preferDocPositionTop&&(e=[1]),{position:this.editor.getPosition(),preference:e}}getDomNode(){return this.element}getId(){return e.ID}isFrozen(){return 4===this.state}updateListHeight(){let e=0;if(2===this.state||1===this.state)e=this.unfocusedHeight;else{ +const t=this.list.contentHeight/this.unfocusedHeight,{maxVisibleSuggestions:i}=this.editor.getOption(96);e=Math.min(t,i)*this.unfocusedHeight}return this.element.style.lineHeight=`${this.unfocusedHeight}px`,this.listElement.style.height=`${e}px`,this.statusBarElement.style.top=`${e}px`,this.list.layout(e),e}adjustDocsPosition(){if(!this.editor.hasModel())return;const e=this.editor.getOption(51),t=this.editor.getScrolledVisiblePosition(this.editor.getPosition()),i=h.getDomNodePagePosition(this.editor.getDomNode()),n=i.left+t.left,o=i.top+t.top+t.height,s=h.getDomNodePagePosition(this.element),r=s.left,a=s.top;if(this.docsPositionPreviousWidgetY&&this.docsPositionPreviousWidgetYa&&this.details.element.offsetHeight>this.listElement.offsetHeight&&(this.listElement.style.marginTop=`${this.details.element.offsetHeight-this.listElement.offsetHeight}px`)}expandSideOrBelow(){if(!z(this.focusedItem)&&this.firstFocusInCurrentList)return void this.element.classList.remove("docs-side","docs-below");let e=this.element.style.maxWidth.match(/(\d+)px/);!e||Number(e[1]){const n=e.getColor(t.editorSuggestWidgetHighlightForeground);n&&i.addRule(`.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-highlighted-label .highlight { color: ${n}; }`);const o=e.getColor(t.editorSuggestWidgetForeground);o&&i.addRule(`.monaco-editor .suggest-widget { color: ${o}; }`);const s=e.getColor(b.textLinkForeground) +;s&&i.addRule(`.monaco-editor .suggest-widget a { color: ${s}; }`);const r=e.getColor(b.textCodeBlockBackground);r&&i.addRule(`.monaco-editor .suggest-widget code { background-color: ${r}; }`)})})),define(t[624],i([0,1,495,19,15,25,12,2,11,3,22,52,31,18,17,21,14,48]),(function(e,t,i,n,o,s,r,d,c,h,u,g,p,m,f,_,v,C){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getOccurrencesAtPosition=void 0;const b=_.registerColor("editor.wordHighlightBackground",{dark:"#575757B8",light:"#57575740",hc:null},i.localize(0,null),!0),S=_.registerColor("editor.wordHighlightStrongBackground",{dark:"#004972B8",light:"#0e639c40",hc:null},i.localize(1,null),!0),w=_.registerColor("editor.wordHighlightBorder",{light:null,dark:null,hc:_.activeContrastBorder},i.localize(2,null)),y=_.registerColor("editor.wordHighlightStrongBorder",{light:null,dark:null,hc:_.activeContrastBorder},i.localize(3,null)),E=_.registerColor("editorOverviewRuler.wordHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hc:"#A0A0A0CC" +},i.localize(4,null),!0),L=_.registerColor("editorOverviewRuler.wordHighlightStrongForeground",{dark:"#C0A0C0CC",light:"#C0A0C0CC",hc:"#C0A0C0CC"},i.localize(5,null),!0),x=new f.RawContextKey("hasWordHighlights",!1);function D(e,t,i){const s=m.DocumentHighlightProviderRegistry.ordered(e);return o.first(s.map(n=>()=>Promise.resolve(n.provideDocumentHighlights(e,t,i)).then(void 0,r.onUnexpectedExternalError)),n.isNonEmptyArray)}t.getOccurrencesAtPosition=D;class k{constructor(e,t,i){this._wordRange=this._getCurrentWordRange(e,t),this.result=o.createCancelablePromise(n=>this._compute(e,t,i,n))}_getCurrentWordRange(e,t){const i=e.getWordAtPosition(t.getPosition());return i?new h.Range(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):null}isValid(e,t,i){const n=t.startLineNumber,o=t.startColumn,s=t.endColumn,r=this._getCurrentWordRange(e,t);let a=Boolean(this._wordRange&&this._wordRange.equalsRange(r));for(let t=0,r=i.length;!a&&t=s&&(a=!0)}return a}cancel(){this.result.cancel()}}class N extends k{_compute(e,t,i,n){return D(e,t.getPosition(),n).then(e=>e||[])}}class I extends k{constructor(e,t,i){super(e,t,i),this._selectionIsEmpty=t.isEmpty()}_compute(e,t,i,n){return o.timeout(250,n).then(()=>{if(!t.isEmpty())return[];const n=e.getWordAtPosition(t.getPosition());return!n||n.word.length>1e3?[]:e.findMatches(n.word,!0,!1,!0,i,!1).map(e=>({range:e.range,kind:m.DocumentHighlightKind.Text}))})}isValid(e,t,i){const n=t.isEmpty();return this._selectionIsEmpty===n&&super.isValid(e,t,i)}}c.registerModelAndPositionCommand("_executeDocumentHighlights",(e,t)=>D(e,t,s.CancellationToken.None));class M{constructor(e,t){this.toUnhook=new d.DisposableStore,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=[],this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.editor=e,this._hasWordHighlights=x.bindTo(t),this._ignorePositionChangeEvent=!1, +this.occurrencesHighlight=this.editor.getOption(63),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(e=>{this._ignorePositionChangeEvent||this.occurrencesHighlight&&this._onPositionChanged(e)})),this.toUnhook.add(e.onDidChangeModelContent(e=>{this._stopAll()})),this.toUnhook.add(e.onDidChangeConfiguration(e=>{let t=this.editor.getOption(63);this.occurrencesHighlight!==t&&(this.occurrencesHighlight=t,this._stopAll())})),this._decorationIds=[],this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1}hasDecorations(){return this._decorationIds.length>0}restore(){this.occurrencesHighlight&&this._run()}_getSortedHighlights(){return n.coalesce(this._decorationIds.map(e=>this.model.getDecorationRange(e)).sort(h.Range.compareRangesUsingStarts))}moveNext(){let e=this._getSortedHighlights(),t=(n.firstIndex(e,e=>e.containsPosition(this.editor.getPosition()))+1)%e.length,i=e[t];try{ +this._ignorePositionChangeEvent=!0,this.editor.setPosition(i.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(i);const n=this._getWord();if(n){const o=this.editor.getModel().getLineContent(i.startLineNumber);C.alert(`${o}, ${t+1} of ${e.length} for '${n.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){let e=this._getSortedHighlights(),t=(n.firstIndex(e,e=>e.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,i=e[t];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(i.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(i);const n=this._getWord();if(n){const o=this.editor.getModel().getLineContent(i.startLineNumber);C.alert(`${o}, ${t+1} of ${e.length} for '${n.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeDecorations(){this._decorationIds.length>0&&(this._decorationIds=this.editor.deltaDecorations(this._decorationIds,[]),this._hasWordHighlights.set(!1))}_stopAll(){this._removeDecorations(), +-1!==this.renderDecorationsTimer&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),null!==this.workerRequest&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_onPositionChanged(e){this.occurrencesHighlight&&3===e.reason?this._run():this._stopAll()}_getWord(){let e=this.editor.getSelection(),t=e.startLineNumber,i=e.startColumn;return this.model.getWordAtPosition({lineNumber:t,column:i})}_run(){let e=this.editor.getSelection();if(e.startLineNumber!==e.endLineNumber)return void this._stopAll();let t=e.startColumn,i=e.endColumn;const n=this._getWord();if(!n||n.startColumn>t||n.endColumn{e===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=t||[],this._beginRenderDecorations())},r.onUnexpectedError)}var s,a,l}_beginRenderDecorations(){let e=(new Date).getTime(),t=this.lastCursorPositionChangeTime+250;e>=t?(this.renderDecorationsTimer=-1,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(()=>{this.renderDecorations()},t-e)}renderDecorations(){this.renderDecorationsTimer=-1;let e=[];for(const t of this.workerRequestValue)t.range&&e.push({range:t.range,options:M._getDecorationOptions(t.kind)});this._decorationIds=this.editor.deltaDecorations(this._decorationIds,e), +this._hasWordHighlights.set(this.hasDecorations())}static _getDecorationOptions(e){return e===m.DocumentHighlightKind.Write?this._WRITE_OPTIONS:e===m.DocumentHighlightKind.Text?this._TEXT_OPTIONS:this._REGULAR_OPTIONS}dispose(){this._stopAll(),this.toUnhook.dispose()}}M._WRITE_OPTIONS=p.ModelDecorationOptions.register({stickiness:1,className:"wordHighlightStrong",overviewRuler:{color:v.themeColorFromId(L),position:g.OverviewRulerLane.Center}}),M._TEXT_OPTIONS=p.ModelDecorationOptions.register({stickiness:1,className:"selectionHighlight",overviewRuler:{color:v.themeColorFromId(_.overviewRulerSelectionHighlightForeground),position:g.OverviewRulerLane.Center}}),M._REGULAR_OPTIONS=p.ModelDecorationOptions.register({stickiness:1,className:"wordHighlight",overviewRuler:{color:v.themeColorFromId(E),position:g.OverviewRulerLane.Center}});let R=class e extends d.Disposable{constructor(e,t){super(),this.wordHighlighter=null;const i=()=>{e.hasModel()&&(this.wordHighlighter=new M(e,t))} +;this._register(e.onDidChangeModel(e=>{this.wordHighlighter&&(this.wordHighlighter.dispose(),this.wordHighlighter=null),i()})),i()}static get(t){return t.getContribution(e.ID)}saveViewState(){return!(!this.wordHighlighter||!this.wordHighlighter.hasDecorations())}moveNext(){this.wordHighlighter&&this.wordHighlighter.moveNext()}moveBack(){this.wordHighlighter&&this.wordHighlighter.moveBack()}restoreViewState(e){this.wordHighlighter&&e&&this.wordHighlighter.restore()}dispose(){this.wordHighlighter&&(this.wordHighlighter.dispose(),this.wordHighlighter=null),super.dispose()}};R.ID="editor.contrib.wordHighlighter",R=a([l(1,f.IContextKeyService)],R);class T extends c.EditorAction{constructor(e,t){super(t),this._isNext=e}run(e,t){const i=R.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}}class O extends c.EditorAction{constructor(){super({id:"editor.action.wordHighlight.trigger",label:i.localize(8,null),alias:"Trigger Symbol Highlight",precondition:x.toNegated(),kbOpts:{kbExpr:u.EditorContextKeys.editorTextFocus, +primary:0,weight:100}})}run(e,t,i){const n=R.get(t);n&&n.restoreViewState(!0)}}c.registerEditorContribution(R.ID,R),c.registerEditorAction(class extends T{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:i.localize(6,null),alias:"Go to Next Symbol Highlight",precondition:x,kbOpts:{kbExpr:u.EditorContextKeys.editorTextFocus,primary:65,weight:100}})}}),c.registerEditorAction(class extends T{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:i.localize(7,null),alias:"Go to Previous Symbol Highlight",precondition:x,kbOpts:{kbExpr:u.EditorContextKeys.editorTextFocus,primary:1089,weight:100}})}}),c.registerEditorAction(O),v.registerThemingParticipant((e,t)=>{const i=e.getColor(_.editorSelectionHighlight);i&&(t.addRule(`.monaco-editor .focused .selectionHighlight { background-color: ${i}; }`),t.addRule(`.monaco-editor .selectionHighlight { background-color: ${i.transparent(.5)}; }`));const n=e.getColor(b);n&&t.addRule(`.monaco-editor .wordHighlight { background-color: ${n}; }`) +;const o=e.getColor(S);o&&t.addRule(`.monaco-editor .wordHighlightStrong { background-color: ${o}; }`);const s=e.getColor(_.editorSelectionHighlightBorder);s&&t.addRule(`.monaco-editor .selectionHighlight { border: 1px ${"hc"===e.type?"dotted":"solid"} ${s}; box-sizing: border-box; }`);const r=e.getColor(w);r&&t.addRule(`.monaco-editor .wordHighlight { border: 1px ${"hc"===e.type?"dashed":"solid"} ${r}; box-sizing: border-box; }`);const a=e.getColor(y);a&&t.addRule(`.monaco-editor .wordHighlightStrong { border: 1px ${"hc"===e.type?"dashed":"solid"} ${a}; box-sizing: border-box; }`)})})),define(t[625],i([0,1,7,30,148,48,54,2,16,8,24,11,22,247,17,10,35,55,21,14,61,347]),(function(e,t,i,n,o,s,r,d,c,h,u,g,p,m,f,_,v,C,b,S,w){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const y=new f.RawContextKey("accessibilityHelpWidgetVisible",!1);let E=class e extends d.Disposable{constructor(e,t){super(),this._editor=e,this._widget=this._register(t.createInstance(L,this._editor))}static get(t){ +return t.getContribution(e.ID)}show(){this._widget.show()}hide(){this._widget.hide()}};E.ID="editor.contrib.accessibilityHelpController",E=a([l(1,_.IInstantiationService)],E);let L=class e extends r.Widget{constructor(e,t,o,r){super(),this._contextKeyService=t,this._keybindingService=o,this._openerService=r,this._editor=e,this._isVisibleKey=y.bindTo(this._contextKeyService),this._domNode=n.createFastDomNode(document.createElement("div")),this._domNode.setClassName("accessibilityHelpWidget"),this._domNode.setDisplay("none"),this._domNode.setAttribute("role","dialog"),this._domNode.setAttribute("aria-hidden","true"),this._contentDomNode=n.createFastDomNode(document.createElement("div")),this._contentDomNode.setAttribute("role","document"),this._domNode.appendChild(this._contentDomNode),this._isVisible=!1,this._register(this._editor.onDidLayoutChange(()=>{this._isVisible&&this._layout()})),this._register(i.addStandardDisposableListener(this._contentDomNode.domNode,"keydown",e=>{ +if(this._isVisible&&(e.equals(2083)&&(s.alert(w.AccessibilityHelpNLS.emergencyConfOn),this._editor.updateOptions({accessibilitySupport:"on"}),i.clearNode(this._contentDomNode.domNode),this._buildContent(),this._contentDomNode.domNode.focus(),e.preventDefault(),e.stopPropagation()),e.equals(2086))){s.alert(w.AccessibilityHelpNLS.openingDocs);let t=this._editor.getRawOptions().accessibilityHelpUrl;void 0===t&&(t="https://go.microsoft.com/fwlink/?linkid=852450"),this._openerService.open(u.URI.parse(t)),e.preventDefault(),e.stopPropagation()}})),this.onblur(this._contentDomNode.domNode,()=>{this.hide()}),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return e.ID}getDomNode(){return this._domNode.domNode}getPosition(){return{preference:null}}show(){this._isVisible||(this._isVisible=!0,this._isVisibleKey.set(!0),this._layout(),this._domNode.setDisplay("block"),this._domNode.setAttribute("aria-hidden","false"),this._contentDomNode.domNode.tabIndex=0, +this._buildContent(),this._contentDomNode.domNode.focus())}_descriptionForCommand(e,t,i){let n=this._keybindingService.lookupKeybinding(e);return n?h.format(t,n.getAriaLabel()):h.format(i,e)}_buildContent(){const e=this._editor.getOptions(),t=this._editor.getSelections();let i=0;if(t){const e=this._editor.getModel();e&&t.forEach(t=>{i+=e.getValueLengthInRange(t)})}let n=function(e,t){return e&&0!==e.length?1===e.length?t?h.format(w.AccessibilityHelpNLS.singleSelectionRange,e[0].positionLineNumber,e[0].positionColumn,t):h.format(w.AccessibilityHelpNLS.singleSelection,e[0].positionLineNumber,e[0].positionColumn):t?h.format(w.AccessibilityHelpNLS.multiSelectionRange,e.length,t):e.length>0?h.format(w.AccessibilityHelpNLS.multiSelection,e.length):"":w.AccessibilityHelpNLS.noSelection}(t,i);e.get(47)?e.get(72)?n+=w.AccessibilityHelpNLS.readonlyDiffEditor:n+=w.AccessibilityHelpNLS.editableDiffEditor:e.get(72)?n+=w.AccessibilityHelpNLS.readonlyEditor:n+=w.AccessibilityHelpNLS.editableEditor +;const s=c.isMacintosh?w.AccessibilityHelpNLS.changeConfigToOnMac:w.AccessibilityHelpNLS.changeConfigToOnWinLinux;switch(e.get(2)){case 0:n+="\n\n - "+s;break;case 2:n+="\n\n - "+w.AccessibilityHelpNLS.auto_on;break;case 1:n+="\n\n - "+w.AccessibilityHelpNLS.auto_off,n+=" "+s}e.get(116)?n+="\n\n - "+this._descriptionForCommand(m.ToggleTabFocusModeAction.ID,w.AccessibilityHelpNLS.tabFocusModeOnMsg,w.AccessibilityHelpNLS.tabFocusModeOnMsgNoKb):n+="\n\n - "+this._descriptionForCommand(m.ToggleTabFocusModeAction.ID,w.AccessibilityHelpNLS.tabFocusModeOffMsg,w.AccessibilityHelpNLS.tabFocusModeOffMsgNoKb),n+="\n\n - "+(c.isMacintosh?w.AccessibilityHelpNLS.openDocMac:w.AccessibilityHelpNLS.openDocWinLinux),n+="\n\n"+w.AccessibilityHelpNLS.outroMsg,this._contentDomNode.domNode.appendChild(o.renderFormattedText(n)),this._contentDomNode.domNode.setAttribute("aria-label",n)}hide(){this._isVisible&&(this._isVisible=!1,this._isVisibleKey.reset(),this._domNode.setDisplay("none"), +this._domNode.setAttribute("aria-hidden","true"),this._contentDomNode.domNode.tabIndex=-1,i.clearNode(this._contentDomNode.domNode),this._editor.focus())}_layout(){let t=this._editor.getLayoutInfo(),i=Math.max(5,Math.min(e.WIDTH,t.width-40)),n=Math.max(5,Math.min(e.HEIGHT,t.height-40));this._domNode.setWidth(i),this._domNode.setHeight(n);let o=Math.round((t.height-n)/2);this._domNode.setTop(o);let s=Math.round((t.width-i)/2);this._domNode.setLeft(s)}};L.ID="editor.contrib.accessibilityHelpWidget",L.WIDTH=500,L.HEIGHT=300,L=a([l(1,f.IContextKeyService),l(2,v.IKeybindingService),l(3,C.IOpenerService)],L);class x extends g.EditorAction{constructor(){super({id:"editor.action.showAccessibilityHelp",label:w.AccessibilityHelpNLS.showAccessibilityHelpAction,alias:"Show Accessibility Help",precondition:void 0,kbOpts:{kbExpr:p.EditorContextKeys.focus,primary:571,weight:100,linux:{primary:1595,secondary:[571]}}})}run(e,t){let i=E.get(t);i&&i.show()}}g.registerEditorContribution(E.ID,E),g.registerEditorAction(x) +;const D=g.EditorCommand.bindToContribution(E.get);g.registerEditorCommand(new D({id:"closeAccessibilityHelp",precondition:y,handler:e=>e.hide(),kbOpts:{weight:200,kbExpr:p.EditorContextKeys.focus,primary:9,secondary:[1033]}})),S.registerThemingParticipant((e,t)=>{const i=e.getColor(b.editorWidgetBackground);i&&t.addRule(`.monaco-editor .accessibilityHelpWidget { background-color: ${i}; }`);const n=e.getColor(b.editorWidgetForeground);n&&t.addRule(`.monaco-editor .accessibilityHelpWidget { color: ${n}; }`);const o=e.getColor(b.widgetShadow);o&&t.addRule(`.monaco-editor .accessibilityHelpWidget { box-shadow: 0 2px 8px ${o}; }`);const s=e.getColor(b.contrastBorder);s&&t.addRule(`.monaco-editor .accessibilityHelpWidget { border: 2px solid ${s}; }`)})})),define(t[626],i([0,1,7,29,2,11,18,74,73,106,21,14,61,349]),(function(e,t,i,n,o,s,r,d,c,h,u,g,p){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let m=class e extends o.Disposable{constructor(e,t,i){super(),this._editor=e,this._modeService=i, +this._widget=null,this._register(this._editor.onDidChangeModel(e=>this.stop())),this._register(this._editor.onDidChangeModelLanguage(e=>this.stop())),this._register(r.TokenizationRegistry.onDidChange(e=>this.stop())),this._register(this._editor.onKeyUp(e=>9===e.keyCode&&this.stop()))}static get(t){return t.getContribution(e.ID)}dispose(){this.stop(),super.dispose()}launch(){this._widget||this._editor.hasModel()&&(this._widget=new _(this._editor,this._modeService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}};m.ID="editor.contrib.inspectTokens",m=a([l(1,h.IStandaloneThemeService),l(2,c.IModeService)],m);class f extends s.EditorAction{constructor(){super({id:"editor.action.inspectTokens",label:p.InspectTokensNLS.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){let i=m.get(t);i&&i.launch()}}class _ extends o.Disposable{constructor(e,t){super(),this.allowEditorOverflow=!0,this._editor=e,this._modeService=t,this._model=this._editor.getModel(), +this._domNode=document.createElement("div"),this._domNode.className="tokens-inspect-widget",this._tokenizationSupport=function(e){let t=r.TokenizationRegistry.get(e.language);return t||{getInitialState:()=>d.NULL_STATE,tokenize:(t,i,n)=>d.nullTokenize(e.language,t,i,n),tokenize2:(t,i,n)=>d.nullTokenize2(e.id,t,i,n)}}(this._model.getLanguageIdentifier()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition(e=>this._compute(this._editor.getPosition()))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return _._ID}_compute(e){let t=this._getTokensAtLine(e.lineNumber),o=0;for(let i=t.tokens1.length-1;i>=0;i--){let n=t.tokens1[i];if(e.column-1>=n.offset){o=i;break}}let s=0;for(let i=t.tokens2.length>>>1;i>=0;i--)if(e.column-1>=t.tokens2[i<<1]){s=i;break}let r=this._model.getLineContent(e.lineNumber),a="";if(o{const i=e.getColor(u.editorHoverBorder);if(i){let n=e.type===g.HIGH_CONTRAST?2:1;t.addRule(`.monaco-editor .tokens-inspect-widget { border: ${n}px solid ${i}; }`),t.addRule(`.monaco-editor .tokens-inspect-widget .tokens-inspect-separator { background-color: ${i}; }`)}const n=e.getColor(u.editorHoverBackground);n&&t.addRule(`.monaco-editor .tokens-inspect-widget { background-color: ${n}; }`);const o=e.getColor(u.editorHoverForeground);o&&t.addRule(`.monaco-editor .tokens-inspect-widget { color: ${o}; }`)})})),define(t[627],i([0,1,618,34,94,27,23,61,4,11,22,75]),(function(e,t,i,n,o,s,r,d,c,h,u,g){"use strict";Object.defineProperty(t,"__esModule",{value:!0}), +t.GotoLineAction=t.StandaloneGotoLineQuickAccessProvider=void 0;let p=class extends i.AbstractGotoLineQuickAccessProvider{constructor(e){super(),this.editorService=e,this.onDidActiveTextEditorControlChange=c.Event.None}get activeTextEditorControl(){return r.withNullAsUndefined(this.editorService.getFocusedCodeEditor())}};p=a([l(0,s.ICodeEditorService)],p),t.StandaloneGotoLineQuickAccessProvider=p,n.Registry.as(o.Extensions.Quickaccess).registerQuickAccessProvider({ctor:p,prefix:p.PREFIX,helpEntries:[{description:d.GoToLineNLS.gotoLineActionLabel,needsEditor:!0}]});class m extends h.EditorAction{constructor(){super({id:"editor.action.gotoLine",label:d.GoToLineNLS.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:u.EditorContextKeys.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(g.IQuickInputService).quickAccess.show(p.PREFIX)}}t.GotoLineAction=m,h.registerEditorAction(m)})), +define(t[628],i([0,1,619,34,94,27,23,61,4,11,22,75]),(function(e,t,i,n,o,s,r,d,c,h,u,g){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GotoLineAction=t.StandaloneGotoSymbolQuickAccessProvider=void 0;let p=class extends i.AbstractGotoSymbolQuickAccessProvider{constructor(e){super(),this.editorService=e,this.onDidActiveTextEditorControlChange=c.Event.None}get activeTextEditorControl(){return r.withNullAsUndefined(this.editorService.getFocusedCodeEditor())}};p=a([l(0,s.ICodeEditorService)],p),t.StandaloneGotoSymbolQuickAccessProvider=p,n.Registry.as(o.Extensions.Quickaccess).registerQuickAccessProvider({ctor:p,prefix:i.AbstractGotoSymbolQuickAccessProvider.PREFIX,helpEntries:[{description:d.QuickOutlineNLS.quickOutlineActionLabel,prefix:i.AbstractGotoSymbolQuickAccessProvider.PREFIX,needsEditor:!0},{description:d.QuickOutlineNLS.quickOutlineByCategoryActionLabel,prefix:i.AbstractGotoSymbolQuickAccessProvider.PREFIX_BY_CATEGORY,needsEditor:!0}]});class m extends h.EditorAction{constructor(){ +super({id:"editor.action.quickOutline",label:d.QuickOutlineNLS.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:u.EditorContextKeys.hasDocumentSymbolProvider,kbOpts:{kbExpr:u.EditorContextKeys.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(g.IQuickInputService).quickAccess.show(i.AbstractGotoSymbolQuickAccessProvider.PREFIX)}}t.GotoLineAction=m,h.registerEditorAction(m)})),define(t[629],i([0,1,7,40,583]),(function(e,t,i,n,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StandaloneCodeEditorServiceImpl=void 0;class s extends o.CodeEditorServiceImpl{getActiveCodeEditor(){return null}openCodeEditor(e,t,i){return t?Promise.resolve(this.doOpenEditor(t,e)):Promise.resolve(null)}doOpenEditor(e,t){if(!this.findModel(e,t.resource)){if(t.resource){const o=t.resource.scheme;if(o===n.Schemas.http||o===n.Schemas.https)return i.windowOpenNoOpener(t.resource.toString()),e}return null}const o=t.options?t.options.selection:null +;if(o)if("number"==typeof o.endLineNumber&&"number"==typeof o.endColumn)e.setSelection(o),e.revealRangeInCenter(o,1);else{const t={lineNumber:o.startLineNumber,column:o.startColumn};e.setPosition(t),e.revealPositionInCenter(t,1)}return e}findModel(e,t){const i=e.getModel();return i&&i.uri.toString()!==t.toString()?null:i}}t.StandaloneCodeEditorServiceImpl=s})),define(t[630],i([0,1,49,21]),(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hc_black=t.vs_dark=t.vs=void 0,t.vs={base:"vs",inherit:!1,rules:[{token:"",foreground:"000000",background:"fffffe"},{token:"invalid",foreground:"cd3131"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"001188"},{token:"variable.predefined",foreground:"4864AA"},{token:"constant",foreground:"dd0000"},{token:"comment",foreground:"008000"},{token:"number",foreground:"098658"},{token:"number.hex",foreground:"3030c0"},{token:"regexp",foreground:"800000"},{token:"annotation",foreground:"808080"},{ +token:"type",foreground:"008080"},{token:"delimiter",foreground:"000000"},{token:"delimiter.html",foreground:"383838"},{token:"delimiter.xml",foreground:"0000FF"},{token:"tag",foreground:"800000"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"800000"},{token:"metatag",foreground:"e00000"},{token:"metatag.content.html",foreground:"FF0000"},{token:"metatag.html",foreground:"808080"},{token:"metatag.xml",foreground:"808080"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"863B00"},{token:"string.key.json",foreground:"A31515"},{token:"string.value.json",foreground:"0451A5"},{token:"attribute.name",foreground:"FF0000"},{token:"attribute.value",foreground:"0451A5"},{token:"attribute.value.number",foreground:"098658"},{token:"attribute.value.unit",foreground:"098658"},{token:"attribute.value.html",foreground:"0000FF"},{token:"attribute.value.xml",foreground:"0000FF"},{token:"string",foreground:"A31515"},{token:"string.html", +foreground:"0000FF"},{token:"string.sql",foreground:"FF0000"},{token:"string.yaml",foreground:"0451A5"},{token:"keyword",foreground:"0000FF"},{token:"keyword.json",foreground:"0451A5"},{token:"keyword.flow",foreground:"AF00DB"},{token:"keyword.flow.scss",foreground:"0000FF"},{token:"operator.scss",foreground:"666666"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"666666"},{token:"predefined.sql",foreground:"FF00FF"}],colors:{[n.editorBackground]:"#FFFFFE",[n.editorForeground]:"#000000",[n.editorInactiveSelection]:"#E5EBF1",[i.editorIndentGuides]:"#D3D3D3",[i.editorActiveIndentGuides]:"#939393",[n.editorSelectionHighlight]:"#ADD6FF4D"}},t.vs_dark={base:"vs-dark",inherit:!1,rules:[{token:"",foreground:"D4D4D4",background:"1E1E1E"},{token:"invalid",foreground:"f44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"74B0DF"},{token:"variable.predefined",foreground:"4864AA"},{token:"variable.parameter",foreground:"9CDCFE"},{ +token:"constant",foreground:"569CD6"},{token:"comment",foreground:"608B4E"},{token:"number",foreground:"B5CEA8"},{token:"number.hex",foreground:"5BB498"},{token:"regexp",foreground:"B46695"},{token:"annotation",foreground:"cc6666"},{token:"type",foreground:"3DC9B0"},{token:"delimiter",foreground:"DCDCDC"},{token:"delimiter.html",foreground:"808080"},{token:"delimiter.xml",foreground:"808080"},{token:"tag",foreground:"569CD6"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"A79873"},{token:"meta.tag",foreground:"CE9178"},{token:"metatag",foreground:"DD6A6F"},{token:"metatag.content.html",foreground:"9CDCFE"},{token:"metatag.html",foreground:"569CD6"},{token:"metatag.xml",foreground:"569CD6"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"9CDCFE"},{token:"string.key.json",foreground:"9CDCFE"},{token:"string.value.json",foreground:"CE9178"},{token:"attribute.name",foreground:"9CDCFE"},{token:"attribute.value",foreground:"CE9178" +},{token:"attribute.value.number.css",foreground:"B5CEA8"},{token:"attribute.value.unit.css",foreground:"B5CEA8"},{token:"attribute.value.hex.css",foreground:"D4D4D4"},{token:"string",foreground:"CE9178"},{token:"string.sql",foreground:"FF0000"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"keyword.json",foreground:"CE9178"},{token:"keyword.flow.scss",foreground:"569CD6"},{token:"operator.scss",foreground:"909090"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"909090"},{token:"predefined.sql",foreground:"FF00FF"}],colors:{[n.editorBackground]:"#1E1E1E",[n.editorForeground]:"#D4D4D4",[n.editorInactiveSelection]:"#3A3D41",[i.editorIndentGuides]:"#404040",[i.editorActiveIndentGuides]:"#707070",[n.editorSelectionHighlight]:"#ADD6FF26"}},t.hc_black={base:"hc-black",inherit:!1,rules:[{token:"",foreground:"FFFFFF",background:"000000"},{token:"invalid",foreground:"f44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold" +},{token:"variable",foreground:"1AEBFF"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"constant",foreground:"569CD6"},{token:"comment",foreground:"608B4E"},{token:"number",foreground:"FFFFFF"},{token:"regexp",foreground:"C0C0C0"},{token:"annotation",foreground:"569CD6"},{token:"type",foreground:"3DC9B0"},{token:"delimiter",foreground:"FFFF00"},{token:"delimiter.html",foreground:"FFFF00"},{token:"tag",foreground:"569CD6"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta",foreground:"D4D4D4"},{token:"meta.tag",foreground:"CE9178"},{token:"metatag",foreground:"569CD6"},{token:"metatag.content.html",foreground:"1AEBFF"},{token:"metatag.html",foreground:"569CD6"},{token:"metatag.xml",foreground:"569CD6"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"9CDCFE"},{token:"string.key",foreground:"9CDCFE"},{token:"string.value",foreground:"CE9178"},{token:"attribute.name",foreground:"569CD6"},{token:"attribute.value",foreground:"3FF23F"},{ +token:"string",foreground:"CE9178"},{token:"string.sql",foreground:"FF0000"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"909090"},{token:"predefined.sql",foreground:"FF00FF"}],colors:{[n.editorBackground]:"#000000",[n.editorForeground]:"#FFFFFF",[i.editorIndentGuides]:"#FFFFFF",[i.editorActiveIndentGuides]:"#FFFFFF"}}})),define(t[631],i([0,1,7,29,4,18,373,630,34,21,14,2,115]),(function(e,t,i,n,o,s,r,a,l,d,c,h,u){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StandaloneThemeServiceImpl=void 0;const g="vs",p="vs-dark",m="hc-black",f=l.Registry.as(d.Extensions.ColorContribution),_=l.Registry.as(c.Extensions.ThemingContribution);class v{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;let i=t.base;e.length>0?(this.id=i+" "+e,this.themeName=e):(this.id=i,this.themeName=i),this.colors=null,this.defaultColors=Object.create(null),this._tokenTheme=null}get base(){ +return this.themeData.base}notifyBaseUpdated(){this.themeData.inherit&&(this.colors=null,this._tokenTheme=null)}getColors(){if(!this.colors){const e=new Map;for(let t in this.themeData.colors)e.set(t,n.Color.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){let t=b(this.themeData.base);for(let i in t.colors)e.has(i)||e.set(i,n.Color.fromHex(t.colors[i]))}this.colors=e}return this.colors}getColor(e,t){const i=this.getColors().get(e);return i||(!1!==t?this.getDefault(e):void 0)}getDefault(e){let t=this.defaultColors[e];return t||(t=f.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return Object.prototype.hasOwnProperty.call(this.getColors(),e)}get type(){switch(this.base){case g:return"light";case m:return"hc";default:return"dark"}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){let i=b(this.themeData.base);e=i.rules,i.encodedTokensColors&&(t=i.encodedTokensColors)}e=e.concat(this.themeData.rules), +this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=r.TokenTheme.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const n=this.tokenTheme._match([e].concat(t).join(".")).metadata,o=s.TokenMetadata.getForeground(n),r=s.TokenMetadata.getFontStyle(n);return{foreground:o,italic:Boolean(1&r),bold:Boolean(2&r),underline:Boolean(4&r)}}}function C(e){return e===g||e===p||e===m}function b(e){switch(e){case g:return a.vs;case p:return a.vs_dark;case m:return a.hc_black}}function S(e){let t=b(e);return new v(e,t)}class w extends h.Disposable{constructor(){super(),this._onColorThemeChange=this._register(new o.Emitter),this.onDidColorThemeChange=this._onColorThemeChange.event,this._environment=Object.create(null),this._knownThemes=new Map,this._knownThemes.set(g,S(g)),this._knownThemes.set(p,S(p)),this._knownThemes.set(m,S(m)),this._codiconCSS=u.CodiconStyles.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS}\n${this._themeCSS}`, +this._globalStyleElement=null,this._styleElements=[],this.setTheme(g),u.CodiconStyles.onDidChange(()=>{this._codiconCSS=u.CodiconStyles.getCSS(),this._updateCSS()})}registerEditorContainer(e){return i.isInShadowDOM(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=i.createStyleSheet(),this._globalStyleElement.className="monaco-colors",this._globalStyleElement.innerHTML=this._allCSS,this._styleElements.push(this._globalStyleElement)),h.Disposable.None}_registerShadowDomContainer(e){const t=i.createStyleSheet(e);return t.className="monaco-colors",t.innerHTML=this._allCSS,this._styleElements.push(t),{dispose:()=>{for(let e=0;e{t.base===e&&t.notifyBaseUpdated()}),this._theme&&this._theme.themeName===e&&this.setTheme(e)}getColorTheme(){return this._theme}setTheme(e){let t;if(t=this._knownThemes.has(e)?this._knownThemes.get(e):this._knownThemes.get(g),this._theme===t)return t.id;this._theme=t;let i=[],n={},o={addRule:e=>{n[e]||(i.push(e),n[e]=!0)}};_.getThemingParticipants().forEach(e=>e(t,o,this._environment));let a=t.tokenTheme.getColorMap();return o.addRule(r.generateTokensCSSForColorMap(a)),this._themeCSS=i.join("\n"),this._updateCSS(),s.TokenizationRegistry.setColorMap(a),this._onColorThemeChange.fire(t),t.id}_updateCSS(){this._allCSS=`${this._codiconCSS}\n${this._themeCSS}`,this._styleElements.forEach(e=>e.innerHTML=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}}t.StandaloneThemeServiceImpl=w})),define(t[255],i([0,1,7,57,47,4,97,2,16,496,33,66,35,32,14,91,408]),(function(e,t,i,n,o,s,r,d,c,h,u,g,p,m,f,_,v){ +"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SubmenuEntryActionViewItem=t.MenuEntryActionViewItem=t.createAndFillInActionBarActions=void 0;class C extends s.Emitter{constructor(e){super(),this._subscriptions=new d.DisposableStore,this._isPressed=!1,this._suppressAltKeyUp=!1,this._subscriptions.add(n.domEvent(document.body,"keydown")(e=>{this.isPressed=e.altKey||(c.isWindows||c.isLinux)&&e.shiftKey})),this._subscriptions.add(n.domEvent(document.body,"keyup")(e=>{this.isPressed&&this._suppressAltKeyUp&&e.preventDefault(),this._suppressAltKeyUp=!1,this.isPressed=!1})),this._subscriptions.add(n.domEvent(document.body,"mouseleave")(e=>this.isPressed=!1)),this._subscriptions.add(n.domEvent(document.body,"blur")(e=>this.isPressed=!1)),this._subscriptions.add(e.onDidContextMenu(()=>this.isPressed=!1))}get isPressed(){return this._isPressed}set isPressed(e){this._isPressed=e,this.fire(this._isPressed)}suppressAltKeyUp(){this._suppressAltKeyUp=!0}static getInstance(e){ +return C.instance||(C.instance=new C(e)),C.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}t.createAndFillInActionBarActions=function(e,t,i,n){const s=e.getActions(t);return function(e,t,i,n=(e=>"navigation"===e)){for(let s of e){let[e,r]=s;if(i&&(r=r.map(e=>e instanceof u.MenuItemAction&&e.alt?e.alt:e)),n(e)){(Array.isArray(t)?t:t.primary).unshift(...r)}else{const e=Array.isArray(t)?t:t.secondary;e.length>0&&e.push(new o.Separator),e.push(...r)}}}(s,i,!1,n),function(e){const t=new d.DisposableStore;for(const[,i]of e)for(const e of i)t.add(e);return t}(s)};const b=new r.IdGenerator("menu-item-action-item-icon-"),S=new Map;let w=class extends _.ActionViewItem{constructor(e,t,i,n){super(void 0,e,{icon:!(!e.class&&!e.item.icon),label:!e.class&&!e.item.icon}),this._action=e,this._keybindingService=t,this._notificationService=i,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new d.MutableDisposable),this._altKey=C.getInstance(n)}get _commandAction(){ +return this._wantsAltCommand&&this._action.alt||this._action}onClick(e){e.preventDefault(),e.stopPropagation(),this._altKey.isPressed&&this._altKey.suppressAltKeyUp(),this.actionRunner.run(this._commandAction,this._context).then(void 0,e=>this._notificationService.error(e))}render(e){super.render(e),this._updateItemClass(this._action.item);let t=!1,i=this._altKey.isPressed;const o=()=>{const e=t&&i;e!==this._wantsAltCommand&&(this._wantsAltCommand=e,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._action.alt&&this._register(this._altKey.event(e=>{i=e,o()})),this._register(n.domEvent(e,"mouseleave")(e=>{t=!1,o()})),this._register(n.domEvent(e,"mouseenter")(e=>{t=!0,o()}))}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this._commandAction.label)}updateTooltip(){if(this.label){const e=this._keybindingService.lookupKeybinding(this._commandAction.id),t=e&&e.getLabel(),i=this._commandAction.tooltip||this._commandAction.label;this.label.title=t?h.localize(0,null,i,t):i}} +updateClass(){this.options.icon&&(this._commandAction!==this._action?this._action.alt&&this._updateItemClass(this._action.alt.item):this._action.alt&&this._updateItemClass(this._action.item))}_updateItemClass(e){var t,n;this._itemClassDispose.value=void 0;const o=this._commandAction.checked&&(null===(t=e.toggled)||void 0===t?void 0:t.icon)?e.toggled.icon:e.icon;if(f.ThemeIcon.isThemeIcon(o)){const e=f.ThemeIcon.asClassName(o);this.label&&e&&(i.addClasses(this.label,e),this._itemClassDispose.value=d.toDisposable(()=>{this.label&&i.removeClasses(this.label,e)}))}else if(o){let e;if(null===(n=o.dark)||void 0===n?void 0:n.scheme){const t=o.dark.toString();S.has(t)?e=S.get(t):(e=b.nextId(),i.createCSSRule(`.icon.${e}`,`background-image: ${i.asCSSUrl(o.light||o.dark)}`),i.createCSSRule(`.vs-dark .icon.${e}, .hc-black .icon.${e}`,`background-image: ${i.asCSSUrl(o.dark)}`),S.set(t,e)),this.label&&(i.addClasses(this.label,"icon",e),this._itemClassDispose.value=d.toDisposable(()=>{ +this.label&&i.removeClasses(this.label,"icon",e)}))}}}};w=a([l(1,p.IKeybindingService),l(2,m.INotificationService),l(3,g.IContextMenuService)],w),t.MenuEntryActionViewItem=w;let y=class extends v.DropdownMenuActionViewItem{constructor(e,t,n){var o;const s=[];if(e.item.icon)if(f.ThemeIcon.isThemeIcon(e.item.icon))s.push(f.ThemeIcon.asClassName(e.item.icon));else if(null===(o=e.item.icon.dark)||void 0===o?void 0:o.scheme){const t=e.item.icon.dark.toString();if(S.has(t))s.push("icon",S.get(t));else{const n=b.nextId();s.push("icon",n),i.createCSSRule(`.icon.${n}`,`background-image: ${i.asCSSUrl(e.item.icon.light||e.item.icon.dark)}`),i.createCSSRule(`.vs-dark .icon.${n}, .hc-black .icon.${n}`,`background-image: ${i.asCSSUrl(e.item.icon.dark)}`),S.set(t,n)}}super(e,e.actions,n,{classNames:s})}};y=a([l(1,m.INotificationService),l(2,g.IContextMenuService)],y),t.SubmenuEntryActionViewItem=y})), +define(t[108],i([0,1,7,79,47,29,4,37,27,178,522,482,17,10,71,11,21,26,33,255,340]),(function(e,t,i,n,o,s,r,d,c,h,u,g,p,m,f,_,v,C,b,S){"use strict";var w;Object.defineProperty(t,"__esModule",{value:!0}),t.peekViewEditorMatchHighlightBorder=t.peekViewEditorMatchHighlight=t.peekViewResultsMatchHighlight=t.peekViewEditorGutterBackground=t.peekViewEditorBackground=t.peekViewResultsSelectionForeground=t.peekViewResultsSelectionBackground=t.peekViewResultsFileForeground=t.peekViewResultsMatchForeground=t.peekViewResultsBackground=t.peekViewBorder=t.peekViewTitleInfoForeground=t.peekViewTitleForeground=t.peekViewTitleBackground=t.PeekViewWidget=t.getOuterEditor=t.PeekContext=t.IPeekViewService=void 0,t.IPeekViewService=m.createDecorator("IPeekViewService"),f.registerSingleton(t.IPeekViewService,class{constructor(){this._widgets=new Map}addExclusiveWidget(e,t){const i=this._widgets.get(e);i&&(i.listener.dispose(),i.widget.dispose());this._widgets.set(e,{widget:t,listener:t.onDidClose(()=>{const i=this._widgets.get(e) +;i&&i.widget===t&&(i.listener.dispose(),this._widgets.delete(e))})})}}),function(e){e.inPeekEditor=new p.RawContextKey("inReferenceSearchEditor",!0),e.notInPeekEditor=e.inPeekEditor.toNegated()}(w=t.PeekContext||(t.PeekContext={}));let y=class{constructor(e,t){e instanceof h.EmbeddedCodeEditorWidget&&w.inPeekEditor.bindTo(t)}dispose(){}};y.ID="editor.contrib.referenceController",y=a([l(1,p.IContextKeyService)],y),_.registerEditorContribution(y.ID,y),t.getOuterEditor=function(e){let t=e.get(c.ICodeEditorService).getFocusedCodeEditor();return t instanceof h.EmbeddedCodeEditorWidget?t.getParentEditor():t};const E={headerBackgroundColor:s.Color.white,primaryHeadingColor:s.Color.fromHex("#333333"),secondaryHeadingColor:s.Color.fromHex("#6c6c6cb3")};let L=class extends u.ZoneWidget{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new r.Emitter,this.onDidClose=this._onDidClose.event,d.mixin(this.options,E,!1)}dispose(){super.dispose(),this._onDidClose.fire(this)}style(e){let t=this.options +;e.headerBackgroundColor&&(t.headerBackgroundColor=e.headerBackgroundColor),e.primaryHeadingColor&&(t.primaryHeadingColor=e.primaryHeadingColor),e.secondaryHeadingColor&&(t.secondaryHeadingColor=e.secondaryHeadingColor),super.style(e)}_applyStyles(){super._applyStyles();let e=this.options;this._headElement&&e.headerBackgroundColor&&(this._headElement.style.backgroundColor=e.headerBackgroundColor.toString()),this._primaryHeading&&e.primaryHeadingColor&&(this._primaryHeading.style.color=e.primaryHeadingColor.toString()),this._secondaryHeading&&e.secondaryHeadingColor&&(this._secondaryHeading.style.color=e.secondaryHeadingColor.toString()),this._bodyElement&&e.frameColor&&(this._bodyElement.style.borderColor=e.frameColor.toString())}_fillContainer(e){this.setCssClass("peekview-widget"),this._headElement=i.$(".head"),this._bodyElement=i.$(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){ +const s=i.$(".peekview-title");i.append(this._headElement,s),i.addStandardDisposableListener(s,"click",e=>this._onTitleClick(e)),this._fillTitleIcon(s),this._primaryHeading=i.$("span.filename"),this._secondaryHeading=i.$("span.dirname"),this._metaHeading=i.$("span.meta"),i.append(s,this._primaryHeading,this._secondaryHeading,this._metaHeading);const r=i.$(".peekview-actions");i.append(this._headElement,r);const a=this._getActionBarOptions();this._actionbarWidget=new n.ActionBar(r,a),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new o.Action("peekview.close",g.localize(0,null),C.Codicon.close.classNames,!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:e=>e instanceof b.MenuItemAction?this.instantiationService.createInstance(S.MenuEntryActionViewItem,e):e instanceof b.SubmenuItemAction?this.instantiationService.createInstance(S.SubmenuEntryActionViewItem,e):void 0}}_onTitleClick(e){}setTitle(e,t){ +this._primaryHeading&&this._secondaryHeading&&(this._primaryHeading.innerText=e,this._primaryHeading.setAttribute("aria-label",e),t?this._secondaryHeading.innerText=t:i.clearNode(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,i.show(this._metaHeading)):i.hide(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0)return void this.dispose();const i=Math.ceil(1.2*this.editor.getOption(51)),n=Math.round(e-(i+2));this._doLayoutHead(i,t),this._doLayoutBody(n,t)}_doLayoutHead(e,t){this._headElement&&(this._headElement.style.height=`${e}px`,this._headElement.style.lineHeight=this._headElement.style.height)}_doLayoutBody(e,t){this._bodyElement&&(this._bodyElement.style.height=`${e}px`)}};L=a([l(2,m.IInstantiationService)],L),t.PeekViewWidget=L,t.peekViewTitleBackground=v.registerColor("peekViewTitle.background",{dark:"#1E1E1E",light:"#FFFFFF",hc:"#0C141F"},g.localize(1,null)),t.peekViewTitleForeground=v.registerColor("peekViewTitleLabel.foreground",{dark:"#FFFFFF", +light:"#333333",hc:"#FFFFFF"},g.localize(2,null)),t.peekViewTitleInfoForeground=v.registerColor("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161e6",hc:"#FFFFFF99"},g.localize(3,null)),t.peekViewBorder=v.registerColor("peekView.border",{dark:"#007acc",light:"#007acc",hc:v.contrastBorder},g.localize(4,null)),t.peekViewResultsBackground=v.registerColor("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hc:s.Color.black},g.localize(5,null)),t.peekViewResultsMatchForeground=v.registerColor("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hc:s.Color.white},g.localize(6,null)),t.peekViewResultsFileForeground=v.registerColor("peekViewResult.fileForeground",{dark:s.Color.white,light:"#1E1E1E",hc:s.Color.white},g.localize(7,null)),t.peekViewResultsSelectionBackground=v.registerColor("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hc:null},g.localize(8,null)),t.peekViewResultsSelectionForeground=v.registerColor("peekViewResult.selectionForeground",{ +dark:s.Color.white,light:"#6C6C6C",hc:s.Color.white},g.localize(9,null)),t.peekViewEditorBackground=v.registerColor("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hc:s.Color.black},g.localize(10,null)),t.peekViewEditorGutterBackground=v.registerColor("peekViewEditorGutter.background",{dark:t.peekViewEditorBackground,light:t.peekViewEditorBackground,hc:t.peekViewEditorBackground},g.localize(11,null)),t.peekViewResultsMatchHighlight=v.registerColor("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hc:null},g.localize(12,null)),t.peekViewEditorMatchHighlight=v.registerColor("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hc:null},g.localize(13,null)),t.peekViewEditorMatchHighlightBorder=v.registerColor("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hc:v.activeContrastBorder},g.localize(14,null))})),define(t[632],i([0,1,582,66,84,4,32,14,35,2]),(function(e,t,i,n,o,s,r,d,c,h){"use strict";Object.defineProperty(t,"__esModule",{ +value:!0}),t.ContextMenuService=void 0;let u=class extends h.Disposable{constructor(e,t,n,o,r){super(),this._onDidContextMenu=this._register(new s.Emitter),this.onDidContextMenu=this._onDidContextMenu.event,this.contextMenuHandler=new i.ContextMenuHandler(n,e,t,o,r)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){this.contextMenuHandler.showContextMenu(e),this._onDidContextMenu.fire()}};u=a([l(0,o.ITelemetryService),l(1,r.INotificationService),l(2,n.IContextViewService),l(3,c.IKeybindingService),l(4,d.IThemeService)],u),t.ContextMenuService=u})),define(t[141],i([0,1,7,302,118,4,2,499,46,93,17,10,35,34,107,14,506,226,421,420,62]),(function(e,t,i,n,o,s,r,d,c,h,u,g,p,m,f,_,v,C,b,S,w){"use strict";Object.defineProperty(t,"__esModule",{value:!0}), +t.WorkbenchCompressibleAsyncDataTree=t.WorkbenchAsyncDataTree=t.WorkbenchDataTree=t.WorkbenchCompressibleObjectTree=t.WorkbenchObjectTree=t.WorkbenchPagedList=t.WorkbenchList=t.automaticKeyboardNavigationSettingKey=t.keyboardNavigationSettingKey=t.horizontalScrollingKey=t.openModeSettingKey=t.multiSelectModifierSettingKey=t.didBindWorkbenchListAutomaticKeyboardNavigation=t.WorkbenchListAutomaticKeyboardNavigation=t.WorkbenchListAutomaticKeyboardNavigationKey=t.WorkbenchListSupportsKeyboardNavigation=t.WorkbenchListMultiSelection=t.WorkbenchListDoubleSelection=t.WorkbenchListHasSelectionOrFocus=t.WorkbenchListFocusContextKey=t.WorkbenchListSupportsMultiSelectContextKey=t.ListService=t.IListService=void 0,t.IListService=g.createDecorator("listService");let y=class{constructor(e){this._themeService=e,this.disposables=new r.DisposableStore,this.lists=[],this._lastFocusedWidget=void 0,this._hasCreatedStyleController=!1}get lastFocusedList(){return this._lastFocusedWidget}register(e,t){ +if(!this._hasCreatedStyleController){this._hasCreatedStyleController=!0;const e=new o.DefaultStyleController(i.createStyleSheet(),"");this.disposables.add(f.attachListStyler(e,this._themeService))}if(this.lists.some(t=>t.widget===e))throw new Error("Cannot register the same widget multiple times");const n={widget:e,extraContextKeys:t};return this.lists.push(n),e.getHTMLElement()===document.activeElement&&(this._lastFocusedWidget=e),r.combinedDisposable(e.onDidFocus(()=>this._lastFocusedWidget=e),r.toDisposable(()=>this.lists.splice(this.lists.indexOf(n),1)),e.onDidDispose(()=>{this.lists=this.lists.filter(e=>e!==n),this._lastFocusedWidget===e&&(this._lastFocusedWidget=void 0)}))}dispose(){this.disposables.dispose()}};y=a([l(0,_.IThemeService)],y),t.ListService=y;const E=new u.RawContextKey("listFocus",!0);function L(e,t){const i=e.createScoped(t.getHTMLElement());return E.bindTo(i),i}t.WorkbenchListSupportsMultiSelectContextKey=new u.RawContextKey("listSupportsMultiselect",!0), +t.WorkbenchListFocusContextKey=u.ContextKeyExpr.and(E,u.ContextKeyExpr.not(v.InputFocusedContextKey)),t.WorkbenchListHasSelectionOrFocus=new u.RawContextKey("listHasSelectionOrFocus",!1),t.WorkbenchListDoubleSelection=new u.RawContextKey("listDoubleSelection",!1),t.WorkbenchListMultiSelection=new u.RawContextKey("listMultiSelection",!1),t.WorkbenchListSupportsKeyboardNavigation=new u.RawContextKey("listSupportsKeyboardNavigation",!0),t.WorkbenchListAutomaticKeyboardNavigationKey="listAutomaticKeyboardNavigation",t.WorkbenchListAutomaticKeyboardNavigation=new u.RawContextKey(t.WorkbenchListAutomaticKeyboardNavigationKey,!0),t.didBindWorkbenchListAutomaticKeyboardNavigation=!1,t.multiSelectModifierSettingKey="workbench.list.multiSelectModifier",t.openModeSettingKey="workbench.list.openMode",t.horizontalScrollingKey="workbench.list.horizontalScrolling",t.keyboardNavigationSettingKey="workbench.list.keyboardNavigation",t.automaticKeyboardNavigationSettingKey="workbench.list.automaticKeyboardNavigation" +;const x="workbench.tree.indent",D="workbench.tree.renderIndentGuides",k="workbench.list.smoothScrolling";function N(e){return"alt"===e.getValue(t.multiSelectModifierSettingKey)}class I extends r.Disposable{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=N(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(t.multiSelectModifierSettingKey)&&(this.useAltAsMultipleSelectionModifier=N(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:o.isSelectionSingleChangeEvent(e)}isSelectionRangeChangeEvent(e){return o.isSelectionRangeChangeEvent(e)}}function M(e,t,i){const n=new r.DisposableStore,o=Object.assign({},e);if(!1!==e.multipleSelectionSupport&&!e.multipleSelectionController){const e=new I(t);o.multipleSelectionController=e,n.add(e)}return o.keyboardNavigationDelegate={ +mightProducePrintableCharacter:e=>i.mightProducePrintableCharacter(e)},o.smoothScrolling=t.getValue(k),[o,n]}let R=class extends o.List{constructor(e,i,n,o,s,r,a,l,d,c){const h=void 0!==s.horizontalScrolling?s.horizontalScrolling:d.getValue(t.horizontalScrollingKey),[u,g]=M(s,d,c);super(e,i,n,o,Object.assign(Object.assign(Object.assign({keyboardSupport:!1},f.computeStyles(l.getColorTheme(),f.defaultListStyles)),u),{horizontalScrolling:h})),this.disposables.add(g),this.contextKeyService=L(r,this),this.themeService=l,t.WorkbenchListSupportsMultiSelectContextKey.bindTo(this.contextKeyService).set(!(!1===s.multipleSelectionSupport)),this.listHasSelectionOrFocus=t.WorkbenchListHasSelectionOrFocus.bindTo(this.contextKeyService),this.listDoubleSelection=t.WorkbenchListDoubleSelection.bindTo(this.contextKeyService),this.listMultiSelection=t.WorkbenchListMultiSelection.bindTo(this.contextKeyService),this.horizontalScrolling=s.horizontalScrolling,this._useAltAsMultipleSelectionModifier=N(d), +this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),s.overrideStyles&&this.updateStyles(s.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const e=this.getSelection(),t=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(e.length>0||t.length>0),this.listMultiSelection.set(e.length>1),this.listDoubleSelection.set(2===e.length)})})),this.disposables.add(this.onDidChangeFocus(()=>{const e=this.getSelection(),t=this.getFocus();this.listHasSelectionOrFocus.set(e.length>0||t.length>0)})),this.disposables.add(d.onDidChangeConfiguration(e=>{e.affectsConfiguration(t.multiSelectModifierSettingKey)&&(this._useAltAsMultipleSelectionModifier=N(d));let i={};if(e.affectsConfiguration(t.horizontalScrollingKey)&&void 0===this.horizontalScrolling){const e=d.getValue(t.horizontalScrollingKey);i=Object.assign(Object.assign({},i),{horizontalScrolling:e})}if(e.affectsConfiguration(k)){const e=d.getValue(k) +;i=Object.assign(Object.assign({},i),{smoothScrolling:e})}Object.keys(i).length>0&&this.updateOptions(i)}))}updateOptions(e){super.updateOptions(e),e.overrideStyles&&this.updateStyles(e.overrideStyles)}dispose(){super.dispose(),this._styler&&this._styler.dispose()}updateStyles(e){this._styler&&this._styler.dispose(),this._styler=f.attachListStyler(this,this.themeService,e)}};R=a([l(5,u.IContextKeyService),l(6,t.IListService),l(7,_.IThemeService),l(8,c.IConfigurationService),l(9,p.IKeybindingService)],R),t.WorkbenchList=R;let T=class extends n.PagedList{constructor(e,i,n,o,s,a,l,d,c,h){const u=void 0!==s.horizontalScrolling?s.horizontalScrolling:c.getValue(t.horizontalScrollingKey),[g,p]=M(s,c,h);super(e,i,n,o,Object.assign(Object.assign(Object.assign({keyboardSupport:!1},f.computeStyles(d.getColorTheme(),f.defaultListStyles)),g),{horizontalScrolling:u})),this.disposables=new r.DisposableStore,this.disposables.add(p),this.contextKeyService=L(a,this),this.horizontalScrolling=s.horizontalScrolling, +t.WorkbenchListSupportsMultiSelectContextKey.bindTo(this.contextKeyService).set(!(!1===s.multipleSelectionSupport)),this._useAltAsMultipleSelectionModifier=N(c),this.disposables.add(this.contextKeyService),this.disposables.add(l.register(this)),s.overrideStyles&&this.disposables.add(f.attachListStyler(this,d,s.overrideStyles)),this.disposables.add(c.onDidChangeConfiguration(e=>{e.affectsConfiguration(t.multiSelectModifierSettingKey)&&(this._useAltAsMultipleSelectionModifier=N(c));let i={};if(e.affectsConfiguration(t.horizontalScrollingKey)&&void 0===this.horizontalScrolling){const e=c.getValue(t.horizontalScrollingKey);i=Object.assign(Object.assign({},i),{horizontalScrolling:e})}if(e.affectsConfiguration(k)){const e=c.getValue(k);i=Object.assign(Object.assign({},i),{smoothScrolling:e})}Object.keys(i).length>0&&this.updateOptions(i)}))}dispose(){super.dispose(),this.disposables.dispose()}} +;T=a([l(5,u.IContextKeyService),l(6,t.IListService),l(7,_.IThemeService),l(8,c.IConfigurationService),l(9,p.IKeybindingService)],T),t.WorkbenchPagedList=T;class O extends r.Disposable{constructor(e,i){var n,o;super(),this.widget=e,this._onDidOpen=new s.Emitter,this.onDidOpen=this._onDidOpen.event,this.openOnFocus=null!==(n=null==i?void 0:i.openOnFocus)&&void 0!==n&&n,this._register(s.Event.filter(this.widget.onDidChangeSelection,e=>e.browserEvent instanceof KeyboardEvent)(e=>this.onSelectionFromKeyboard(e))),this._register(this.widget.onPointer(e=>this.onPointer(e.browserEvent))),this._register(this.widget.onMouseDblClick(e=>this.onMouseDblClick(e.browserEvent))),this.openOnFocus&&this._register(s.Event.filter(this.widget.onDidChangeFocus,e=>e.browserEvent instanceof KeyboardEvent)(e=>this.onFocusFromKeyboard(e))), +"boolean"!=typeof(null==i?void 0:i.openOnSingleClick)&&(null==i?void 0:i.configurationService)?(this.openOnSingleClick="doubleClick"!==(null==i?void 0:i.configurationService.getValue(t.openModeSettingKey)),this._register(null==i?void 0:i.configurationService.onDidChangeConfiguration(()=>{this.openOnSingleClick="doubleClick"!==(null==i?void 0:i.configurationService.getValue(t.openModeSettingKey))}))):this.openOnSingleClick=null===(o=null==i?void 0:i.openOnSingleClick)||void 0===o||o}onFocusFromKeyboard(e){const t=this.widget.getFocus();this.widget.setSelection(t,e.browserEvent);const i="boolean"!=typeof e.browserEvent.preserveFocus||e.browserEvent.preserveFocus;this._open(i,!1,!1,e.browserEvent)}onSelectionFromKeyboard(e){if(1!==e.elements.length)return;const t="boolean"!=typeof e.browserEvent.preserveFocus||e.browserEvent.preserveFocus;this._open(t,!1,!1,e.browserEvent)}onPointer(e){if(!this.openOnSingleClick)return;if(2===e.detail)return;const t=1===e.button,i=e.ctrlKey||e.metaKey||e.altKey +;this._open(!0,t,i,e)}onMouseDblClick(e){if(!e)return;const t=e.ctrlKey||e.metaKey||e.altKey;this._open(!1,!0,t,e)}_open(e,t,i,n){this._onDidOpen.fire({editorOptions:{preserveFocus:e,pinned:t,revealIfVisible:!0},sideBySide:i,element:this.widget.getSelection()[0],browserEvent:n})}}class A extends O{constructor(e,t){super(e,t)}}function P(e,t){let i=!1;return n=>{if(i)return i=!1,!1;const o=t.softDispatch(n,e);return o&&o.enterChord?(i=!0,!1):(i=!1,!0)}}let F=class extends C.ObjectTree{constructor(e,t,i,n,o,s,r,a,l,d,c){const{options:h,getAutomaticKeyboardNavigation:u,disposable:g}=H(t,o,s,l,d,c);super(e,t,i,n,h),this.disposables.add(g),this.internals=new K(this,o,u,o.overrideStyles,s,r,a,l,c),this.disposables.add(this.internals)}};F=a([l(5,u.IContextKeyService),l(6,t.IListService),l(7,_.IThemeService),l(8,c.IConfigurationService),l(9,p.IKeybindingService),l(10,w.IAccessibilityService)],F),t.WorkbenchObjectTree=F;let W=class extends C.CompressibleObjectTree{constructor(e,t,i,n,o,s,r,a,l,d,c){ +const{options:h,getAutomaticKeyboardNavigation:u,disposable:g}=H(t,o,s,l,d,c);super(e,t,i,n,h),this.disposables.add(g),this.internals=new K(this,o,u,o.overrideStyles,s,r,a,l,c),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles)}};W=a([l(5,u.IContextKeyService),l(6,t.IListService),l(7,_.IThemeService),l(8,c.IConfigurationService),l(9,p.IKeybindingService),l(10,w.IAccessibilityService)],W),t.WorkbenchCompressibleObjectTree=W;let B=class extends S.DataTree{constructor(e,t,i,n,o,s,r,a,l,d,c,h){const{options:u,getAutomaticKeyboardNavigation:g,disposable:p}=H(t,s,r,d,c,h);super(e,t,i,n,o,u),this.disposables.add(p),this.internals=new K(this,s,g,s.overrideStyles,r,a,l,d,h),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles)}} +;B=a([l(6,u.IContextKeyService),l(7,t.IListService),l(8,_.IThemeService),l(9,c.IConfigurationService),l(10,p.IKeybindingService),l(11,w.IAccessibilityService)],B),t.WorkbenchDataTree=B;let V=class extends b.AsyncDataTree{constructor(e,t,i,n,o,s,r,a,l,d,c,h){const{options:u,getAutomaticKeyboardNavigation:g,disposable:p}=H(t,s,r,d,c,h);super(e,t,i,n,o,u),this.disposables.add(p),this.internals=new K(this,s,g,s.overrideStyles,r,a,l,d,h),this.disposables.add(this.internals)}get onDidOpen(){return this.internals.onDidOpen}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles)}};V=a([l(6,u.IContextKeyService),l(7,t.IListService),l(8,_.IThemeService),l(9,c.IConfigurationService),l(10,p.IKeybindingService),l(11,w.IAccessibilityService)],V),t.WorkbenchAsyncDataTree=V;let z=class extends b.CompressibleAsyncDataTree{constructor(e,t,i,n,o,s,r,a,l,d,c,h,u){const{options:g,getAutomaticKeyboardNavigation:p,disposable:m}=H(t,r,a,c,h,u);super(e,t,i,n,o,s,g), +this.disposables.add(m),this.internals=new K(this,r,p,r.overrideStyles,a,l,d,c,u),this.disposables.add(this.internals)}};function H(e,i,n,o,s,r){t.WorkbenchListSupportsKeyboardNavigation.bindTo(n),t.didBindWorkbenchListAutomaticKeyboardNavigation||(t.WorkbenchListAutomaticKeyboardNavigation.bindTo(n),t.didBindWorkbenchListAutomaticKeyboardNavigation=!0);const a=()=>{let e=n.getContextKeyValue(t.WorkbenchListAutomaticKeyboardNavigationKey);return e&&(e=o.getValue(t.automaticKeyboardNavigationSettingKey)),e},l=r.isScreenReaderOptimized()?"simple":o.getValue(t.keyboardNavigationSettingKey),d=void 0!==i.horizontalScrolling?i.horizontalScrolling:o.getValue(t.horizontalScrollingKey),[c,h]=M(i,o,s),u=i.additionalScrollHeight;return{getAutomaticKeyboardNavigation:a,disposable:h,options:Object.assign(Object.assign({keyboardSupport:!1},c),{indent:o.getValue(x),renderIndentGuides:o.getValue(D),smoothScrolling:o.getValue(k),automaticKeyboardNavigation:a(),simpleKeyboardNavigation:"simple"===l,filterOnType:"filter"===l, +horizontalScrolling:d,keyboardNavigationEventFilter:P(e,s),additionalScrollHeight:u,hideTwistiesOfChildlessElements:i.hideTwistiesOfChildlessElements,expandOnlyOnDoubleClick:"doubleClick"===o.getValue(t.openModeSettingKey)})}}z=a([l(7,u.IContextKeyService),l(8,t.IListService),l(9,_.IThemeService),l(10,c.IConfigurationService),l(11,p.IKeybindingService),l(12,w.IAccessibilityService)],z),t.WorkbenchCompressibleAsyncDataTree=z;let K=class{constructor(e,i,n,o,s,r,a,l,d){this.tree=e,this.themeService=a,this.disposables=[],this.contextKeyService=L(s,e),t.WorkbenchListSupportsMultiSelectContextKey.bindTo(this.contextKeyService).set(!(!1===i.multipleSelectionSupport)),this.hasSelectionOrFocus=t.WorkbenchListHasSelectionOrFocus.bindTo(this.contextKeyService),this.hasDoubleSelection=t.WorkbenchListDoubleSelection.bindTo(this.contextKeyService),this.hasMultiSelection=t.WorkbenchListMultiSelection.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=N(l);const c=new Set +;c.add(t.WorkbenchListAutomaticKeyboardNavigationKey);const h=()=>{const i=d.isScreenReaderOptimized()?"simple":l.getValue(t.keyboardNavigationSettingKey);e.updateOptions({simpleKeyboardNavigation:"simple"===i,filterOnType:"filter"===i})};this.updateStyleOverrides(o),this.disposables.push(this.contextKeyService,r.register(e),e.onDidChangeSelection(()=>{const t=e.getSelection(),i=e.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.hasSelectionOrFocus.set(t.length>0||i.length>0),this.hasMultiSelection.set(t.length>1),this.hasDoubleSelection.set(2===t.length)})}),e.onDidChangeFocus(()=>{const t=e.getSelection(),i=e.getFocus();this.hasSelectionOrFocus.set(t.length>0||i.length>0)}),l.onDidChangeConfiguration(o=>{let s={};if(o.affectsConfiguration(t.multiSelectModifierSettingKey)&&(this._useAltAsMultipleSelectionModifier=N(l)),o.affectsConfiguration(x)){const e=l.getValue(x);s=Object.assign(Object.assign({},s),{indent:e})}if(o.affectsConfiguration(D)){const e=l.getValue(D) +;s=Object.assign(Object.assign({},s),{renderIndentGuides:e})}if(o.affectsConfiguration(k)){const e=l.getValue(k);s=Object.assign(Object.assign({},s),{smoothScrolling:e})}if(o.affectsConfiguration(t.keyboardNavigationSettingKey)&&h(),o.affectsConfiguration(t.automaticKeyboardNavigationSettingKey)&&(s=Object.assign(Object.assign({},s),{automaticKeyboardNavigation:n()})),o.affectsConfiguration(t.horizontalScrollingKey)&&void 0===i.horizontalScrolling){const e=l.getValue(t.horizontalScrollingKey);s=Object.assign(Object.assign({},s),{horizontalScrolling:e})}o.affectsConfiguration(t.openModeSettingKey)&&(s=Object.assign(Object.assign({},s),{expandOnlyOnDoubleClick:"doubleClick"===l.getValue(t.openModeSettingKey)})),Object.keys(s).length>0&&e.updateOptions(s)}),this.contextKeyService.onDidChangeContext(t=>{t.affectsSome(c)&&e.updateOptions({automaticKeyboardNavigation:n()})}),d.onDidChangeScreenReaderOptimized(()=>h())),this.navigator=new A(e,Object.assign({configurationService:l},i)), +this.disposables.push(this.navigator)}get onDidOpen(){return this.navigator.onDidOpen}updateStyleOverrides(e){r.dispose(this.styler),this.styler=e?f.attachListStyler(this.tree,this.themeService,e):r.Disposable.None}dispose(){this.disposables=r.dispose(this.disposables),r.dispose(this.styler),this.styler=void 0}};K=a([l(4,u.IContextKeyService),l(5,t.IListService),l(6,_.IThemeService),l(7,c.IConfigurationService),l(8,w.IAccessibilityService)],K),m.Registry.as(h.Extensions.Configuration).registerConfiguration({id:"workbench",order:7,title:d.localize(0,null),type:"object",properties:{[t.multiSelectModifierSettingKey]:{type:"string",enum:["ctrlCmd","alt"],enumDescriptions:[d.localize(1,null),d.localize(2,null)],default:"ctrlCmd",description:d.localize(3,null)},[t.openModeSettingKey]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:d.localize(4,null)},[t.horizontalScrollingKey]:{type:"boolean",default:!1,description:d.localize(5,null)},[x]:{type:"number",default:8,minimum:0, +maximum:40,description:d.localize(6,null)},[D]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:d.localize(7,null)},[k]:{type:"boolean",default:!1,description:d.localize(8,null)},[t.keyboardNavigationSettingKey]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[d.localize(9,null),d.localize(10,null),d.localize(11,null)],default:"highlight",description:d.localize(12,null)},[t.automaticKeyboardNavigationSettingKey]:{type:"boolean",default:!0,markdownDescription:d.localize(13,null)}}})})),define(t[633],i([0,1,133,10,14,21,25,107,17,62,429,141,553]),(function(e,t,i,n,o,s,r,d,c,h,u,g,p){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QuickInputService=void 0;let m=class extends o.Themable{constructor(e,t,i,n,o){super(i),this.instantiationService=e,this.contextKeyService=t,this.accessibilityService=n,this.layoutService=o,this.contexts=new Map}get controller(){return this._controller||(this._controller=this._register(this.createController())), +this._controller}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(p.QuickAccessController))),this._quickAccess}createController(e=this.layoutService,t){var i,n;const o={idPrefix:"quickInput_",container:e.container,ignoreFocusOut:()=>!1,isScreenReaderOptimized:()=>this.accessibilityService.isScreenReaderOptimized(),backKeybindingLabel:()=>void 0,setContextKey:e=>this.setContextKey(e),returnFocus:()=>e.focus(),createList:(e,t,i,n,o)=>this.instantiationService.createInstance(g.WorkbenchList,e,t,i,n,o),styles:this.computeStyles()},s=this._register(new u.QuickInputController(Object.assign(Object.assign({},o),t)));return s.layout(e.dimension,null!==(n=null===(i=e.offset)||void 0===i?void 0:i.top)&&void 0!==n?n:0),this._register(e.onLayout(t=>{var i,n;return s.layout(t,null!==(n=null===(i=e.offset)||void 0===i?void 0:i.top)&&void 0!==n?n:0)})),this._register(s.onShow(()=>this.resetContextKeys())), +this._register(s.onHide(()=>this.resetContextKeys())),s}setContextKey(e){let t;e&&((t=this.contexts.get(e))||(t=new c.RawContextKey(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t))),t&&t.get()||(this.resetContextKeys(),t&&t.set(!0))}resetContextKeys(){this.contexts.forEach(e=>{e.get()&&e.reset()})}pick(e,t={},i=r.CancellationToken.None){return this.controller.pick(e,t,i)}createQuickPick(){return this.controller.createQuickPick()}updateStyles(){this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:Object.assign({},d.computeStyles(this.theme,{quickInputBackground:s.quickInputBackground,quickInputForeground:s.quickInputForeground,quickInputTitleBackground:s.quickInputTitleBackground,contrastBorder:s.contrastBorder,widgetShadow:s.widgetShadow})),inputBox:d.computeStyles(this.theme,{inputForeground:s.inputForeground,inputBackground:s.inputBackground,inputBorder:s.inputBorder,inputValidationInfoBackground:s.inputValidationInfoBackground, +inputValidationInfoForeground:s.inputValidationInfoForeground,inputValidationInfoBorder:s.inputValidationInfoBorder,inputValidationWarningBackground:s.inputValidationWarningBackground,inputValidationWarningForeground:s.inputValidationWarningForeground,inputValidationWarningBorder:s.inputValidationWarningBorder,inputValidationErrorBackground:s.inputValidationErrorBackground,inputValidationErrorForeground:s.inputValidationErrorForeground,inputValidationErrorBorder:s.inputValidationErrorBorder}),countBadge:d.computeStyles(this.theme,{badgeBackground:s.badgeBackground,badgeForeground:s.badgeForeground,badgeBorder:s.contrastBorder}),button:d.computeStyles(this.theme,{buttonForeground:s.buttonForeground,buttonBackground:s.buttonBackground,buttonHoverBackground:s.buttonHoverBackground,buttonBorder:s.contrastBorder}),progressBar:d.computeStyles(this.theme,{progressBarBackground:s.progressBarBackground}),list:d.computeStyles(this.theme,{listBackground:s.quickInputBackground, +listInactiveFocusForeground:s.listFocusForeground,listInactiveFocusBackground:s.listFocusBackground,listFocusOutline:s.activeContrastBorder,listInactiveFocusOutline:s.activeContrastBorder,pickerGroupBorder:s.pickerGroupBorder,pickerGroupForeground:s.pickerGroupForeground})}}};m=a([l(0,n.IInstantiationService),l(1,c.IContextKeyService),l(2,o.IThemeService),l(3,h.IAccessibilityService),l(4,i.ILayoutService)],m),t.QuickInputService=m})),define(t[634],i([0,1,11,14,25,10,17,62,133,27,633,85,350]),(function(e,t,i,n,o,s,r,d,c,h,u,g){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QuickInputEditorWidget=t.QuickInputEditorContribution=t.StandaloneQuickInputServiceImpl=t.EditorScopedQuickInputServiceImpl=void 0;let p=class extends u.QuickInputService{constructor(e,t,i,n,o,s){super(t,i,n,o,s),this.host=void 0;const r=f.get(e);this.host={_serviceBrand:void 0,get container(){return r.widget.getDomNode()},get dimension(){return e.getLayoutInfo()},get onLayout(){return e.onDidLayoutChange}, +focus:()=>e.focus()}}createController(){return super.createController(this.host)}};p=a([l(1,s.IInstantiationService),l(2,r.IContextKeyService),l(3,n.IThemeService),l(4,d.IAccessibilityService),l(5,c.ILayoutService)],p),t.EditorScopedQuickInputServiceImpl=p;let m=class{constructor(e,t){this.instantiationService=e,this.codeEditorService=t,this.mapEditorToService=new Map}get activeService(){const e=this.codeEditorService.getFocusedCodeEditor();if(!e)throw new Error("Quick input service needs a focused editor to work.");let t=this.mapEditorToService.get(e);if(!t){const i=t=this.instantiationService.createInstance(p,e);this.mapEditorToService.set(e,t),g.once(e.onDidDispose)(()=>{i.dispose(),this.mapEditorToService.delete(e)})}return t}get quickAccess(){return this.activeService.quickAccess}pick(e,t={},i=o.CancellationToken.None){return this.activeService.pick(e,t,i)}createQuickPick(){return this.activeService.createQuickPick()}};m=a([l(0,s.IInstantiationService),l(1,h.ICodeEditorService)],m), +t.StandaloneQuickInputServiceImpl=m;class f{constructor(e){this.editor=e,this.widget=new _(this.editor)}static get(e){return e.getContribution(f.ID)}dispose(){this.widget.dispose()}}t.QuickInputEditorContribution=f,f.ID="editor.controller.quickInput";class _{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return _.ID}getDomNode(){return this.domNode}getPosition(){return{preference:2}}dispose(){this.codeEditor.removeOverlayWidget(this)}}t.QuickInputEditorWidget=_,_.ID="editor.contrib.quickInputWidget",i.registerEditorContribution(f.ID,f)})),define(t[635],i([0,1,77,14,21,26]),(function(e,t,i,n,o,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SeverityIcon=void 0,function(e){e.className=function(e){switch(e){case i.default.Ignore:return"severity-ignore "+s.Codicon.info.classNames;case i.default.Info:return s.Codicon.info.classNames;case i.default.Warning:return s.Codicon.warning.classNames;case i.default.Error: +return s.Codicon.error.classNames;default:return""}}}(t.SeverityIcon||(t.SeverityIcon={})),n.registerThemingParticipant((e,t)=>{const i=e.getColor(o.problemsErrorIconForeground);if(i){const e=s.Codicon.error.cssSelector;t.addRule(`\n\t\t\t.monaco-editor .zone-widget ${e},\n\t\t\t.markers-panel .marker-icon${e},\n\t\t\t.extensions-viewlet > .extensions ${e} {\n\t\t\t\tcolor: ${i};\n\t\t\t}\n\t\t`)}const n=e.getColor(o.problemsWarningIconForeground);if(n){const e=s.Codicon.warning.cssSelector;t.addRule(`\n\t\t\t.monaco-editor .zone-widget ${e},\n\t\t\t.markers-panel .marker-icon${e},\n\t\t\t.extensions-viewlet > .extensions ${e},\n\t\t\t.extension-editor ${e} {\n\t\t\t\tcolor: ${n};\n\t\t\t}\n\t\t`)}const r=e.getColor(o.problemsInfoIconForeground);if(r){const e=s.Codicon.info.cssSelector;t.addRule(`\n\t\t\t.monaco-editor .zone-widget ${e},\n\t\t\t.markers-panel .marker-icon${e},\n\t\t\t.extensions-viewlet > .extensions ${e},\n\t\t\t.extension-editor ${e} {\n\t\t\t\tcolor: ${r};\n\t\t\t}\n\t\t`)}})})), +define(t[636],i([0,1,464,7,2,82,3,21,14,29,65,151,19,4,108,41,635,55,33,17,255,10,334]),(function(e,t,i,n,o,s,r,d,c,h,u,g,p,m,f,_,v,C,b,S,w,y){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.editorMarkerNavigationBackground=t.editorMarkerNavigationInfo=t.editorMarkerNavigationWarning=t.editorMarkerNavigationError=t.MarkerNavigationWidget=void 0;class E{constructor(e,t,i,s){this._openerService=s,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new o.DisposableStore,this._editor=t;const r=document.createElement("div");r.className="descriptioncontainer",this._messageBlock=document.createElement("div"),n.addClass(this._messageBlock,"message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),r.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),r.appendChild(this._relatedBlock),this._disposables.add(n.addStandardDisposableListener(this._relatedBlock,"click",e=>{ +e.preventDefault();const t=this._relatedDiagnostics.get(e.target);t&&i(t)})),this._scrollable=new u.ScrollableElement(r,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:3,verticalScrollbarSize:3}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(e=>{r.style.left=`-${e.scrollLeft}px`,r.style.top=`-${e.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){o.dispose(this._disposables)}update(e){const{source:t,message:i,relatedInformation:o,code:s}=e;let r=((null==t?void 0:t.length)||0)+"()".length;s&&(r+="string"==typeof s?s.length:s.value.length);const a=i.split(/\r\n|\r|\n/g);this._lines=a.length,this._longestLineLength=0;for(const e of a)this._longestLineLength=Math.max(e.length+r,this._longestLineLength);n.clearNode(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let l=this._messageBlock;for(const e of a)(l=document.createElement("div")).innerText=e, +""===e&&(l.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(l);if(t||s){const e=document.createElement("span");if(n.addClass(e,"details"),l.appendChild(e),t){const i=document.createElement("span");i.innerText=t,n.addClass(i,"source"),e.appendChild(i)}if(s)if("string"==typeof s){const t=document.createElement("span");t.innerText=`(${s})`,n.addClass(t,"code"),e.appendChild(t)}else{this._codeLink=n.$("a.code-link"),this._codeLink.setAttribute("href",`${s.target.toString()}`),this._codeLink.onclick=e=>{this._openerService.open(s.target),e.preventDefault(),e.stopPropagation()},n.append(this._codeLink,n.$("span")).innerText=s.value,e.appendChild(this._codeLink)}}if(n.clearNode(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),p.isNonEmptyArray(o)){const e=this._relatedBlock.appendChild(document.createElement("div"));e.style.paddingTop=`${Math.floor(.66*this._editor.getOption(51))}px`,this._lines+=1;for(const t of o){ +let i=document.createElement("div"),o=document.createElement("a");n.addClass(o,"filename"),o.innerText=`${g.getBaseLabel(t.resource)}(${t.startLineNumber}, ${t.startColumn}): `,o.title=g.getPathLabel(t.resource,void 0),this._relatedDiagnostics.set(o,t);let s=document.createElement("span");s.innerText=t.message,i.appendChild(o),i.appendChild(s),this._lines+=1,e.appendChild(i)}}const d=this._editor.getOption(36),c=Math.ceil(d.typicalFullwidthCharacterWidth*this._longestLineLength*.75),h=d.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:c,scrollHeight:h})}layout(e,t){this._scrollable.getDomNode().style.height=`${e}px`,this._scrollable.getDomNode().style.width=`${t}px`,this._scrollable.setScrollDimensions({width:t,height:e})}getHeightInLines(){return Math.min(17,this._lines)}getAriaLabel(e){let t="";switch(e.severity){case s.MarkerSeverity.Error:t=i.localize(0,null);break;case s.MarkerSeverity.Warning:t=i.localize(1,null);break;case s.MarkerSeverity.Info:t=i.localize(2,null);break +;case s.MarkerSeverity.Hint:t=i.localize(3,null)}let n=i.localize(4,null,t,e.startLineNumber+":"+e.startColumn);const o=this._editor.getModel();if(o&&e.startLineNumber<=o.getLineCount()&&e.startLineNumber>=1){n=`${o.getLineContent(e.startLineNumber)}, ${n}`}return n}}let L=class e extends f.PeekViewWidget{constructor(e,t,i,n,r,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0},r),this._themeService=t,this._openerService=i,this._menuService=n,this._contextKeyService=a,this._callOnDispose=new o.DisposableStore,this._onDidSelectRelatedInformation=new m.Emitter,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=s.MarkerSeverity.Warning,this._backgroundColor=h.Color.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(t.editorMarkerNavigationBackground);let i=t.editorMarkerNavigationError +;this._severity===s.MarkerSeverity.Warning?i=t.editorMarkerNavigationWarning:this._severity===s.MarkerSeverity.Info&&(i=t.editorMarkerNavigationInfo);const n=e.getColor(i);this.style({arrowColor:n,frameColor:n,headerBackgroundColor:this._backgroundColor,primaryHeadingColor:e.getColor(f.peekViewTitleForeground),secondaryHeadingColor:e.getColor(f.peekViewTitleInfoForeground)})}_applyStyles(){this._parentContainer&&(this._parentContainer.style.backgroundColor=this._backgroundColor?this._backgroundColor.toString():""),super._applyStyles()}dispose(){this._callOnDispose.dispose(),super.dispose()}_fillHead(t){super._fillHead(t),this._disposables.add(this._actionbarWidget.actionRunner.onDidBeforeRun(e=>this.editor.focus()));const i=[],n=this._menuService.createMenu(e.TitleMenu,this._contextKeyService);w.createAndFillInActionBarActions(n,void 0,i),this._actionbarWidget.push(i,{label:!1,icon:!0,index:0}),n.dispose()}_fillTitleIcon(e){this._icon=n.append(e,n.$(""))}_getActionBarOptions(){ +return Object.assign(Object.assign({},super._getActionBarOptions()),{orientation:0})}_fillBody(e){this._parentContainer=e,n.addClass(e,"marker-widget"),this._parentContainer.tabIndex=0,this._parentContainer.setAttribute("role","tooltip"),this._container=document.createElement("div"),e.appendChild(this._container),this._message=new E(this._container,this.editor,e=>this._onDidSelectRelatedInformation.fire(e),this._openerService),this._disposables.add(this._message)}show(){throw new Error("call showAtMarker")}showAtMarker(e,t,n){this._container.classList.remove("stale"),this._message.update(e),this._severity=e.severity,this._applyTheme(this._themeService.getColorTheme());let o=r.Range.lift(e);const a=this.editor.getPosition();let l=a&&o.containsPosition(a)?a:o.getStartPosition();super.show(l,this.computeRequiredHeight());const d=this.editor.getModel();if(d){const e=n>1?i.localize(5,null,t,n):i.localize(6,null,t,n);this.setTitle(_.basename(d.uri),e)} +this._icon.className=`codicon ${v.SeverityIcon.className(s.MarkerSeverity.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(l,0),this.editor.focus()}updateMarker(e){this._container.classList.remove("stale"),this._message.update(e)}showStale(){this._container.classList.add("stale"),this._relayout()}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._heightInPixel=e,this._message.layout(e,t),this._container.style.height=`${e}px`}_onWidth(e){this._message.layout(this._heightInPixel,e)}_relayout(){super._relayout(this.computeRequiredHeight())}computeRequiredHeight(){return 3+this._message.getHeightInLines()}};L.TitleMenu=new b.MenuId("gotoErrorTitleMenu"),L=a([l(1,c.IThemeService),l(2,C.IOpenerService),l(3,b.IMenuService),l(4,y.IInstantiationService),l(5,S.IContextKeyService)],L),t.MarkerNavigationWidget=L;let x=d.oneOf(d.editorErrorForeground,d.editorErrorBorder),D=d.oneOf(d.editorWarningForeground,d.editorWarningBorder),k=d.oneOf(d.editorInfoForeground,d.editorInfoBorder) +;t.editorMarkerNavigationError=d.registerColor("editorMarkerNavigationError.background",{dark:x,light:x,hc:x},i.localize(7,null)),t.editorMarkerNavigationWarning=d.registerColor("editorMarkerNavigationWarning.background",{dark:D,light:D,hc:D},i.localize(8,null)),t.editorMarkerNavigationInfo=d.registerColor("editorMarkerNavigationInfo.background",{dark:k,light:k,hc:k},i.localize(9,null)),t.editorMarkerNavigationBackground=d.registerColor("editorMarkerNavigation.background",{dark:"#2D2D30",light:h.Color.white,hc:"#0C141F"},i.localize(10,null)),c.registerThemingParticipant((e,t)=>{const i=e.getColor(d.textLinkForeground);i&&(t.addRule(`.monaco-editor .marker-widget a { color: ${i}; }`),t.addRule(`.monaco-editor .marker-widget a.code-link span:hover { color: ${i}; }`))})})),define(t[256],i([0,1,463,2,17,13,3,11,22,636,27,33,26,10,536]),(function(e,t,i,n,o,s,d,c,h,u,g,p,m,f,_){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NextMarkerAction=t.MarkerController=void 0;let v=class e{ +constructor(e,t,i,o,s){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=o,this._instantiationService=s,this._sessionDispoables=new n.DisposableStore,this._editor=e,this._widgetVisible=w.bindTo(this._contextKeyService)}static get(t){return t.getContribution(e.ID)}dispose(){this._cleanUp(),this._sessionDispoables.dispose()}_cleanUp(){this._widgetVisible.reset(),this._sessionDispoables.clear(),this._widget=void 0,this._model=void 0}_getOrCreateModel(e){if(this._model&&this._model.matches(e))return this._model;let t=!1;return this._model&&(t=!0,this._cleanUp()),this._model=this._markerNavigationService.getMarkerList(e),t&&this._model.move(!0,this._editor.getModel(),this._editor.getPosition()),this._widget=this._instantiationService.createInstance(u.MarkerNavigationWidget,this._editor),this._widget.onDidClose(()=>this.close(),this,this._sessionDispoables),this._widgetVisible.set(!0),this._sessionDispoables.add(this._model),this._sessionDispoables.add(this._widget), +this._sessionDispoables.add(this._editor.onDidChangeCursorPosition(e=>{var t,i,n;(null===(t=this._model)||void 0===t?void 0:t.selected)&&d.Range.containsPosition(null===(i=this._model)||void 0===i?void 0:i.selected.marker,e.position)||null===(n=this._model)||void 0===n||n.resetIndex()})),this._sessionDispoables.add(this._model.onDidChange(()=>{if(!this._widget||!this._widget.position||!this._model)return;const e=this._model.find(this._editor.getModel().uri,this._widget.position);e?this._widget.updateMarker(e.marker):this._widget.showStale()})),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(e=>{this._editorService.openCodeEditor({resource:e.resource,options:{pinned:!0,revealIfOpened:!0,selection:d.Range.lift(e).collapseToStart()}},this._editor),this.close(!1)})),this._sessionDispoables.add(this._editor.onDidChangeModel(()=>this._cleanUp())),this._model}close(e=!0){this._cleanUp(),e&&this._editor.focus()}showAtMarker(e){if(this._editor.hasModel()){ +const t=this._getOrCreateModel(this._editor.getModel().uri);t.resetIndex(),t.move(!0,this._editor.getModel(),new s.Position(e.startLineNumber,e.startColumn)),t.selected&&this._widget.showAtMarker(t.selected.marker,t.selected.index,t.selected.total)}}nagivate(t,i){return r(this,void 0,void 0,(function*(){if(this._editor.hasModel()){const n=this._getOrCreateModel(i?void 0:this._editor.getModel().uri);if(n.move(t,this._editor.getModel(),this._editor.getPosition()),!n.selected)return;if(n.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();const o=yield this._editorService.openCodeEditor({resource:n.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:n.selected.marker}},this._editor);o&&(e.get(o).close(),e.get(o).nagivate(t,i))}else this._widget.showAtMarker(n.selected.marker,n.selected.index,n.selected.total)}}))}};v.ID="editor.contrib.markerController", +v=a([l(1,_.IMarkerNavigationService),l(2,o.IContextKeyService),l(3,g.ICodeEditorService),l(4,f.IInstantiationService)],v),t.MarkerController=v;class C extends c.EditorAction{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}run(e,t){return r(this,void 0,void 0,(function*(){t.hasModel()&&v.get(t).nagivate(this._next,this._multiFile)}))}}class b extends C{constructor(){super(!0,!1,{id:b.ID,label:b.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:h.EditorContextKeys.focus,primary:578,weight:100},menuOpts:{menuId:u.MarkerNavigationWidget.TitleMenu,title:b.LABEL,icon:m.registerIcon("marker-navigation-next",m.Codicon.chevronDown),group:"navigation",order:1}})}}t.NextMarkerAction=b,b.ID="editor.action.marker.next",b.LABEL=i.localize(0,null);class S extends C{constructor(){super(!1,!1,{id:S.ID,label:S.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:h.EditorContextKeys.focus,primary:1602,weight:100},menuOpts:{ +menuId:u.MarkerNavigationWidget.TitleMenu,title:b.LABEL,icon:m.registerIcon("marker-navigation-previous",m.Codicon.chevronUp),group:"navigation",order:2}})}}S.ID="editor.action.marker.prev",S.LABEL=i.localize(1,null);c.registerEditorContribution(v.ID,v),c.registerEditorAction(b),c.registerEditorAction(S),c.registerEditorAction(class extends C{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:i.localize(2,null),alias:"Go to Next Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:h.EditorContextKeys.focus,primary:66,weight:100},menuOpts:{menuId:p.MenuId.MenubarGoMenu,title:i.localize(3,null),group:"6_problem_nav",order:1}})}}),c.registerEditorAction(class extends C{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:i.localize(4,null),alias:"Go to Previous Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:h.EditorContextKeys.focus,primary:1090,weight:100},menuOpts:{menuId:p.MenuId.MenubarGoMenu,title:i.localize(5,null), +group:"6_problem_nav",order:2}})}});const w=new o.RawContextKey("markersNavigationVisible",!1),y=c.EditorCommand.bindToContribution(v.get);c.registerEditorCommand(new y({id:"closeMarkersNavigation",precondition:w,handler:e=>e.close(),kbOpts:{weight:150,kbExpr:h.EditorContextKeys.focus,primary:9,secondary:[1033]}}))})),define(t[637],i([0,1,473,7,25,29,78,2,13,3,31,18,244,245,390,604,572,220,221,134,14,19,82,41,12,55,256,15,136,253,124,21,56]),(function(e,t,i,n,o,s,r,a,l,d,c,h,u,g,p,m,f,_,v,C,b,S,w,y,E,L,x,D,k,N,I,M,R){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ModesContentHoverWidget=void 0;const T=n.$;class O{constructor(e,t,i){this.range=e,this.color=t,this.provider=i}}class A{constructor(e,t){this.range=e,this.marker=t}}class P{constructor(e,t){this._markerDecorationsService=t,this._editor=e,this._result=[]}setRange(e){this._range=e,this._result=[]}clearResult(){this._result=[]}computeAsync(e){if(!this._editor.hasModel()||!this._range)return Promise.resolve([]) +;const t=this._editor.getModel();return h.HoverProviderRegistry.has(t)?f.getHover(t,new l.Position(this._range.startLineNumber,this._range.startColumn),e):Promise.resolve([])}computeSync(){if(!this._editor.hasModel()||!this._range)return[];const e=this._editor.getModel(),t=this._range.startLineNumber;if(t>this._editor.getModel().getLineCount())return[];const i=g.ColorDetector.get(this._editor),n=e.getLineMaxColumn(t),o=this._editor.getLineDecorations(t);let s=!1;const a=this._range,l=o.map(o=>{const l=o.range.startLineNumber===t?o.range.startColumn:1,c=o.range.endLineNumber===t?o.range.endColumn:n;if(l>a.startColumn||a.endColumn>c)return null;const h=new d.Range(a.startLineNumber,l,a.startLineNumber,c),u=this._markerDecorationsService.getMarker(e,o);if(u)return new A(h,u);const g=i.getColorData(o.range.getStartPosition());if(!s&&g){s=!0;const{color:e,range:t}=g.colorInfo;return new O(t,e,g.provider)}if(r.isEmptyMarkdownString(o.options.hoverMessage))return null;return{ +contents:o.options.hoverMessage?S.asArray(o.options.hoverMessage):[],range:h}});return S.coalesce(l)}onResult(e,t){this._result=t?e.concat(this._result.sort((e,t)=>e instanceof O?-1:t instanceof O?1:0)):this._result.concat(e)}getResult(){return this._result.slice(0)}getResultWithLoadingMessage(){return this._result.slice(0).concat([this._getLoadingMessage()])}_getLoadingMessage(){return{range:this._range,contents:[(new r.MarkdownString).appendText(i.localize(0,null))]}}}const F={type:2,filter:{include:I.CodeActionKind.QuickFix}};class W extends v.ContentHoverWidget{constructor(e,t,i,o,s,r,l=L.NullOpenerService){super(W.ID,e,t,o),this._themeService=s,this._modeService=r,this._openerService=l,this.renderDisposable=this._register(new a.MutableDisposable),this._messages=[],this._lastRange=null,this._computer=new P(this._editor,i),this._highlightDecorations=[],this._isChangingDecorations=!1,this._shouldFocus=!1,this._colorPicker=null, +this._hoverOperation=new _.HoverOperation(this._computer,e=>this._withResult(e,!0),null,e=>this._withResult(e,!1),this._editor.getOption(46).delay),this._register(n.addStandardDisposableListener(this.getDomNode(),n.EventType.FOCUS,()=>{this._colorPicker&&n.addClass(this.getDomNode(),"colorpicker-hover")})),this._register(n.addStandardDisposableListener(this.getDomNode(),n.EventType.BLUR,()=>{n.removeClass(this.getDomNode(),"colorpicker-hover")})),this._register(e.onDidChangeConfiguration(e=>{this._hoverOperation.setHoverTime(this._editor.getOption(46).delay)})),this._register(h.TokenizationRegistry.onDidChange(e=>{this.isVisible&&this._lastRange&&this._messages.length>0&&(this._hover.contentsDomNode.textContent="",this._renderMessages(this._lastRange,this._messages))}))}dispose(){this._hoverOperation.cancel(),super.dispose()}onModelDecorationsChanged(){this._isChangingDecorations||this.isVisible&&(this._hoverOperation.cancel(),this._computer.clearResult(),this._colorPicker||this._hoverOperation.start(0))} +startShowingAt(e,t,i){if(!this._lastRange||!this._lastRange.equalsRange(e)){if(this._hoverOperation.cancel(),this.isVisible)if(this._showAtPosition&&this._showAtPosition.lineNumber===e.startLineNumber){let t=[];for(let i=0,n=this._messages.length;i=e.endColumn&&t.push(n)}if(t.length>0){if(function(e,t){if(!e&&t||e&&!t||e.length!==t.length)return!1;for(let i=0;i0?this._renderMessages(this._lastRange,this._messages):t&&this.hide()}_renderMessages(e,t){this.renderDisposable.dispose(),this._colorPicker=null;let i=1073741824,c=t[0].range?d.Range.lift(t[0].range):null,h=document.createDocumentFragment(),g=!0,f=!1;const _=new a.DisposableStore,v=[];if(t.forEach(e=>{if(e.range)if(i=Math.min(i,e.range.startColumn),c=c?d.Range.plusRange(c,e.range):d.Range.lift(e.range),e instanceof O){f=!0;const{red:t,green:i,blue:n,alpha:r}=e.color,l=new s.RGBA(Math.round(255*t),Math.round(255*i),Math.round(255*n),r),c=new s.Color(l);if(!this._editor.hasModel())return;const g=this._editor.getModel() +;let v=new d.Range(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn),C={range:e.range,color:e.color};const b=new p.ColorPickerModel(c,[],0),S=new m.ColorPickerWidget(h,b,this._editor.getOption(115),this._themeService);u.getColorPresentations(g,C,e.provider,o.CancellationToken.None).then(t=>{if(b.colorPresentations=t||[],!this._editor.hasModel())return;const i=this._editor.getModel().getValueInRange(e.range);b.guessColorPresentation(c,i);const n=()=>{let e,t;b.presentation.textEdit?(e=[b.presentation.textEdit],t=(t=new d.Range(b.presentation.textEdit.range.startLineNumber,b.presentation.textEdit.range.startColumn,b.presentation.textEdit.range.endLineNumber,b.presentation.textEdit.range.endColumn)).setEndPosition(t.endLineNumber,t.startColumn+b.presentation.textEdit.text.length)):(e=[{identifier:null,range:v,text:b.presentation.label,forceMoveMarkers:!1}],t=v.setEndPosition(v.endLineNumber,v.startColumn+b.presentation.label.length)),this._editor.pushUndoStop(), +this._editor.executeEdits("colorpicker",e),b.presentation.additionalTextEdits&&(e=[...b.presentation.additionalTextEdits],this._editor.executeEdits("colorpicker",e),this.hide()),this._editor.pushUndoStop(),v=t},s=t=>u.getColorPresentations(g,{range:v,color:{red:t.rgba.r/255,green:t.rgba.g/255,blue:t.rgba.b/255,alpha:t.rgba.a}},e.provider,o.CancellationToken.None).then(e=>{b.colorPresentations=e||[]}),r=b.onColorFlushed(e=>{s(e).then(n)}),l=b.onDidChangeColor(s);this._colorPicker=S,this.showAt(v.getStartPosition(),v,this._shouldFocus),this.updateContents(h),this._colorPicker.layout(),this.renderDisposable.value=a.combinedDisposable(r,l,S,_)})}else e instanceof A?(v.push(e),g=!1):e.contents.filter(e=>!r.isEmptyMarkdownString(e)).forEach(e=>{const t=T("div.hover-row.markdown-hover"),i=n.append(t,T("div.hover-contents")),o=_.add(new C.MarkdownRenderer(this._editor,this._modeService,this._openerService));_.add(o.onDidRenderCodeBlock(()=>{i.className="hover-contents code-hover-contents", +this._hover.onContentsChanged()}));const s=_.add(o.render(e));i.appendChild(s.element),h.appendChild(t),g=!1})}),v.length){v.forEach(e=>h.appendChild(this.renderMarkerHover(e)));const e=1===v.length?v[0]:v.sort((e,t)=>w.MarkerSeverity.compare(e.marker.severity,t.marker.severity))[0];h.appendChild(this.renderMarkerStatusbar(e))}f||g||(this.showAt(new l.Position(e.startLineNumber,i),c,this._shouldFocus),this.updateContents(h)),this._isChangingDecorations=!0,this._highlightDecorations=this._editor.deltaDecorations(this._highlightDecorations,c?[{range:c,options:W._DECORATION_OPTIONS}]:[]),this._isChangingDecorations=!1}renderMarkerHover(e){const t=T("div.hover-row"),i=n.append(t,T("div.marker.hover-contents")),{source:o,message:s,code:r,relatedInformation:a}=e.marker;this._editor.applyFontInfo(i);const l=n.append(i,T("span"));if(l.style.whiteSpace="pre-wrap",l.innerText=s,o||r)if(r&&"string"!=typeof r){const e=T("span");if(o){n.append(e,T("span")).innerText=o}this._codeLink=n.append(e,T("a.code-link")), +this._codeLink.setAttribute("href",r.target.toString()),this._codeLink.onclick=e=>{this._openerService.open(r.target),e.preventDefault(),e.stopPropagation()},n.append(this._codeLink,T("span")).innerText=r.value;const t=n.append(i,e);t.style.opacity="0.6",t.style.paddingLeft="6px"}else{const e=n.append(i,T("span"));e.style.opacity="0.6",e.style.paddingLeft="6px",e.innerText=o&&r?`${o}(${r})`:o||`(${r})`}if(S.isNonEmptyArray(a))for(const{message:e,resource:t,startLineNumber:o,startColumn:s}of a){const r=n.append(i,T("div"));r.style.marginTop="8px";const a=n.append(r,T("a"));a.innerText=`${y.basename(t)}(${o}, ${s}): `,a.style.cursor="pointer",a.onclick=e=>{e.stopPropagation(),e.preventDefault(),this._openerService&&this._openerService.open(t.with({fragment:`${o},${s}`}),{fromUserGesture:!0}).catch(E.onUnexpectedError)};const l=n.append(r,T("span"));l.innerText=e,this._editor.applyFontInfo(l)}return t}renderMarkerStatusbar(e){ +const t=T("div.hover-row.status-bar"),o=new a.DisposableStore,s=n.append(t,T("div.actions"));if(e.marker.severity!==w.MarkerSeverity.Error&&e.marker.severity!==w.MarkerSeverity.Warning&&e.marker.severity!==w.MarkerSeverity.Info||o.add(this._renderAction(s,{label:i.localize(1,null),commandId:x.NextMarkerAction.ID,run:()=>{this.hide(),x.MarkerController.get(this._editor).showAtMarker(e.marker),this._editor.focus()}})),!this._editor.getOption(72)){const t=n.append(s,T("div"));t.style.opacity="0",t.style.transition="opacity 0.2s",setTimeout(()=>t.style.opacity="1",200),t.textContent=i.localize(2,null),o.add(a.toDisposable(()=>t.remove()));const r=this.getCodeActions(e.marker);o.add(a.toDisposable(()=>r.cancel())),r.then(e=>{if(t.style.transition="",t.style.opacity="1",!e.validActions.length)return e.dispose(),void(t.textContent=i.localize(3,null));t.remove();let r=!1;o.add(a.toDisposable(()=>{r||e.dispose()})),o.add(this._renderAction(s,{label:i.localize(4,null),commandId:N.QuickFixAction.Id,run:t=>{r=!0 +;const i=N.QuickFixController.get(this._editor),o=n.getDomNodePagePosition(t);this.hide(),i.showCodeActions(F,e,{x:o.left+6,y:o.top+o.height+6})}}))})}return this.renderDisposable.value=o,t}getCodeActions(e){return D.createCancelablePromise(t=>k.getCodeActions(this._editor.getModel(),new d.Range(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),F,R.Progress.None,t))}}t.ModesContentHoverWidget=W,W.ID="editor.contrib.modesContentHoverWidget",W._DECORATION_OPTIONS=c.ModelDecorationOptions.register({className:"hoverHighlight"}),b.registerThemingParticipant((e,t)=>{const i=e.getColor(M.textLinkForeground);i&&t.addRule(`.monaco-hover .hover-contents a.code-link span:hover { color: ${i}; }`)})})),define(t[142],i([0,1,10]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceEditStackSnapshot=t.IUndoRedoService=void 0,t.IUndoRedoService=i.createDecorator("undoRedoService");t.ResourceEditStackSnapshot=class{constructor(e,t){this.resource=e,this.elements=t}}})), +define(t[257],i([0,1,4,2,16,12,38,31,18,135,130,46,15,25,14,81,142,113,228,241]),(function(e,t,i,n,o,s,r,d,c,h,u,g,p,m,f,_,v,C,b,S){"use strict";function w(e){return e.toString()}Object.defineProperty(t,"__esModule",{value:!0}),t.isSemanticColoringEnabled=t.SEMANTIC_HIGHLIGHTING_SETTING_ID=t.ModelServiceImpl=void 0;class y{constructor(e,t,i){this._modelEventListeners=new n.DisposableStore,this.model=e,this._languageSelection=null,this._languageSelectionListener=null,this._modelEventListeners.add(e.onWillDispose(()=>t(e))),this._modelEventListeners.add(e.onDidChangeLanguage(t=>i(e,t)))}_disposeLanguageSelection(){this._languageSelectionListener&&(this._languageSelectionListener.dispose(),this._languageSelectionListener=null),this._languageSelection&&(this._languageSelection.dispose(),this._languageSelection=null)}dispose(){this._modelEventListeners.dispose(),this._disposeLanguageSelection()}setLanguage(e){this._disposeLanguageSelection(),this._languageSelection=e, +this._languageSelectionListener=this._languageSelection.onDidChange(()=>this.model.setMode(e.languageIdentifier)),this.model.setMode(e.languageIdentifier)}}const E=o.isLinux||o.isMacintosh?1:2;let L=class e extends n.Disposable{constructor(e,t,n,o,s){super(),this._configurationService=e,this._resourcePropertiesService=t,this._themeService=n,this._logService=o,this._undoRedoService=s,this._onModelAdded=this._register(new i.Emitter),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new i.Emitter),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new i.Emitter),this.onModelModeChanged=this._onModelModeChanged.event,this._modelCreationOptionsByLanguageAndResource=Object.create(null),this._models={},this._disposedModels=new Map,this._disposedModelsHeapSize=0,this._semanticStyling=this._register(new k(this._themeService,this._logService)),this._register(this._configurationService.onDidChangeConfiguration(()=>this._updateModelOptions())), +this._updateModelOptions(),this._register(new D(this,this._themeService,this._configurationService,this._semanticStyling))}static _readModelOptions(e,t){let i=r.EDITOR_MODEL_DEFAULTS.tabSize;if(e.editor&&void 0!==e.editor.tabSize){const t=parseInt(e.editor.tabSize,10);isNaN(t)||(i=t),i<1&&(i=1)}let n=i;if(e.editor&&void 0!==e.editor.indentSize&&"tabSize"!==e.editor.indentSize){const t=parseInt(e.editor.indentSize,10);isNaN(t)||(n=t),n<1&&(n=1)}let o=r.EDITOR_MODEL_DEFAULTS.insertSpaces;e.editor&&void 0!==e.editor.insertSpaces&&(o="false"!==e.editor.insertSpaces&&Boolean(e.editor.insertSpaces));let s=E;const a=e.eol;"\r\n"===a?s=2:"\n"===a&&(s=1);let l=r.EDITOR_MODEL_DEFAULTS.trimAutoWhitespace;e.editor&&void 0!==e.editor.trimAutoWhitespace&&(l="false"!==e.editor.trimAutoWhitespace&&Boolean(e.editor.trimAutoWhitespace));let d=r.EDITOR_MODEL_DEFAULTS.detectIndentation;e.editor&&void 0!==e.editor.detectIndentation&&(d="false"!==e.editor.detectIndentation&&Boolean(e.editor.detectIndentation)) +;let c=r.EDITOR_MODEL_DEFAULTS.largeFileOptimizations;return e.editor&&void 0!==e.editor.largeFileOptimizations&&(c="false"!==e.editor.largeFileOptimizations&&Boolean(e.editor.largeFileOptimizations)),{isForSimpleWidget:t,tabSize:i,indentSize:n,insertSpaces:o,detectIndentation:d,defaultEOL:s,trimAutoWhitespace:l,largeFileOptimizations:c}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);const i=this._configurationService.getValue("files.eol",{overrideIdentifier:t});return i&&"auto"!==i?i:3===o.OS||2===o.OS?"\n":"\r\n"}getCreationOptions(t,i,n){let o=this._modelCreationOptionsByLanguageAndResource[t+i];if(!o){const s=this._configurationService.getValue("editor",{overrideIdentifier:t,resource:i}),r=this._getEOL(i,t);o=e._readModelOptions({editor:s,eol:r},n),this._modelCreationOptionsByLanguageAndResource[t+i]=o}return o}_updateModelOptions(){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null) +;const i=Object.keys(this._models);for(let n=0,o=i.length;nb.isEditStackElement(e)&&e.matchesResource(i)),n&&(s._overwriteVersionId(e.versionId),s._overwriteAlternativeVersionId(e.alternativeVersionId),s._overwriteInitialUndoRedoSnapshot(e.initialUndoRedoSnapshot))}else null!==e.initialUndoRedoSnapshot&&this._undoRedoService.restoreSnapshot(e.initialUndoRedoSnapshot)}const r=w(s.uri);if(this._models[r])throw new Error("ModelService: Cannot add model because it already exists!") +;const a=new y(s,e=>this._onWillDispose(e),(e,t)=>this._onDidChangeLanguage(e,t));return this._models[r]=a,a}createModel(e,t,i,n=!1){let o;return t?(o=this._createModelData(e,t.languageIdentifier,i,n),this.setMode(o.model,t)):o=this._createModelData(e,h.PLAINTEXT_LANGUAGE_IDENTIFIER,i,n),this._onModelAdded.fire(o.model),o.model}setMode(e,t){if(!t)return;const i=this._models[w(e.uri)];i&&i.setLanguage(t)}getModels(){const e=[],t=Object.keys(this._models);for(let i=0,n=t.length;i{this._watchers[e.uri.toString()]=new I(e,i,this._semanticStyling)},r=(e,t)=>{t.dispose(), +delete this._watchers[e.uri.toString()]},a=()=>{for(let t of e.getModels()){const e=this._watchers[t.uri.toString()];x(t,i,n)?e||s(t):e&&r(t,e)}};this._register(e.onModelAdded(e=>{x(e,i,n)&&s(e)})),this._register(e.onModelRemoved(e=>{const t=this._watchers[e.uri.toString()];t&&r(e,t)})),this._register(n.onDidChangeConfiguration(e=>{e.affectsConfiguration(t.SEMANTIC_HIGHLIGHTING_SETTING_ID)&&a()})),this._register(i.onDidColorThemeChange(a))}}class k extends n.Disposable{constructor(e,t){super(),this._themeService=e,this._logService=t,this._caches=new WeakMap,this._register(this._themeService.onDidColorThemeChange(()=>{this._caches=new WeakMap}))}get(e){return this._caches.has(e)||this._caches.set(e,new S.SemanticTokensProviderStyling(e.getLegend(),this._themeService,this._logService)),this._caches.get(e)}}class N{constructor(e,t,i){this._provider=e,this.resultId=t,this.data=i}dispose(){this._provider.releaseDocumentSemanticTokens(this.resultId)}}class I extends n.Disposable{constructor(e,t,i){super(), +this._isDisposed=!1,this._model=e,this._semanticStyling=i,this._fetchDocumentSemanticTokens=this._register(new p.RunOnceScheduler(()=>this._fetchDocumentSemanticTokensNow(),300)),this._currentDocumentResponse=null,this._currentDocumentRequestCancellationTokenSource=null,this._documentProvidersChangeListeners=[],this._register(this._model.onDidChangeContent(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule()}));const o=()=>{n.dispose(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const t of c.DocumentSemanticTokensProviderRegistry.all(e))"function"==typeof t.onDidChange&&this._documentProvidersChangeListeners.push(t.onDidChange(()=>this._fetchDocumentSemanticTokens.schedule(0)))};o(),this._register(c.DocumentSemanticTokensProviderRegistry.onDidChange(()=>{o(),this._fetchDocumentSemanticTokens.schedule()})),this._register(t.onDidColorThemeChange(e=>{this._setDocumentSemanticTokens(null,null,null,[]), +this._fetchDocumentSemanticTokens.schedule()})),this._fetchDocumentSemanticTokens.schedule(0)}dispose(){this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;const e=this._getSemanticColoringProvider();if(!e)return;this._currentDocumentRequestCancellationTokenSource=new m.CancellationTokenSource;const t=[],i=this._model.onDidChangeContent(e=>{t.push(e)}),n=this._semanticStyling.get(e),o=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null;Promise.resolve(e.provideDocumentSemanticTokens(this._model,o,this._currentDocumentRequestCancellationTokenSource.token)).then(o=>{ +this._currentDocumentRequestCancellationTokenSource=null,i.dispose(),this._setDocumentSemanticTokens(e,o||null,n,t)},e=>{e&&"string"==typeof e.message&&-1!==e.message.indexOf("busy")||s.onUnexpectedError(e),this._currentDocumentRequestCancellationTokenSource=null,i.dispose(),t.length>0&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule())})}static _isSemanticTokens(e){return e&&!!e.data}static _isSemanticTokensEdits(e){return e&&Array.isArray(e.edits)}static _copy(e,t,i,n,o){for(let s=0;s=0;e--){const o=t.edits[e],a=s-(o.start+o.deleteCount);a>0&&(I._copy(i,s-a,n,r-a,a),r-=a),o.data&&(I._copy(o.data,0,n,r-o.data.length,o.data.length),r-=o.data.length),s=o.start}s>0&&I._copy(i,0,n,0,s),t={resultId:t.resultId,data:n}}}if(I._isSemanticTokens(t)){this._currentDocumentResponse=new N(e,t.resultId,t.data);const o=S.toMultilineTokens2(t,i,this._model.getLanguageIdentifier());if(n.length>0){for(const e of n)for(const t of o)for(const i of e.changes)t.applyEdit(i.range,i.text);this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule()}this._model.setSemanticTokens(o,!0)}else this._model.setSemanticTokens(null,!0)}else this._model.setSemanticTokens(null,!0);else this._model.setSemanticTokens(null,!1)}_getSemanticColoringProvider(){const e=c.DocumentSemanticTokensProviderRegistry.ordered(this._model) +;return e.length>0?e[0]:null}}})),define(t[638],i([0,1,7,29,4,2,40,41,178,3,31,92,611,469,10,132,141,21,14,108,126,304,142,35,336]),(function(e,t,i,n,o,s,d,c,h,u,g,p,m,f,_,v,C,b,S,w,y,E,L,x){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ReferenceWidget=t.LayoutData=void 0;class D{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new s.DisposableStore,this._callOnModelChange=new s.DisposableStore,this._callOnDispose.add(this._editor.onDidChangeModel(()=>this._onModelChanged())),this._onModelChanged()}dispose(){this._callOnModelChange.dispose(),this._callOnDispose.dispose(),this.removeDecorations()}_onModelChanged(){this._callOnModelChange.clear();const e=this._editor.getModel();if(e)for(let t of this._model.references)if(t.uri.toString()===e.uri.toString())return void this._addDecorations(t.parent)}_addDecorations(e){if(!this._editor.hasModel())return +;this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations(()=>this._onDecorationChanged()));const t=[],i=[];for(let n=0,o=e.children.length;n{e.equals(9)&&(this._keybindingService.dispatchEvent(e,e.target),e.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(k,"ReferencesWidget",this._treeContainer,new m.Delegate,[this._instantiationService.createInstance(m.FileReferencesRenderer),this._instantiationService.createInstance(m.OneReferenceRenderer)],this._instantiationService.createInstance(m.DataSource),t),this._splitView.addView({onDidChange:o.Event.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:e=>{this._preview.layout({ +height:this._dim.height,width:e})}},E.Sizing.Distribute),this._splitView.addView({onDidChange:o.Event.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:e=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${e}px`,this._tree.layout(this._dim.height,e)}},E.Sizing.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));let n=(e,t)=>{e instanceof y.OneReference&&("show"===t&&this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:t,source:"tree"}))};this._tree.onDidOpen(e=>{e.sideBySide?n(e.element,"side"):e.editorOptions.pinned?n(e.element,"goto"):n(e.element,"show")}),i.hide(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim={height:e,width:t}, +this.layoutData.heightInLines=this._viewZone?this._viewZone.heightInLines:this.layoutData.heightInLines,this._splitView.layout(t),this._splitView.resizeView(0,t*this.layoutData.ratio)}setSelection(e){return this._revealReference(e,!0).then(()=>{this._model&&(this._tree.setSelection([e]),this._tree.setFocus([e]))})}setModel(e){return this._disposeOnNewModel.clear(),this._model=e,this._model?this._onNewModel():Promise.resolve()}_onNewModel(){return this._model?this._model.isEmpty?(this.setTitle(""),this._messageContainer.innerText=f.localize(1,null),i.show(this._messageContainer),Promise.resolve(void 0)):(i.hide(this._messageContainer),this._decorationsManager=new D(this._preview,this._model),this._disposeOnNewModel.add(this._decorationsManager),this._disposeOnNewModel.add(this._model.onDidChangeReferenceRange(e=>this._tree.rerender(e))),this._disposeOnNewModel.add(this._preview.onMouseDown(e=>{const{event:t,target:i}=e;if(2!==t.detail)return;const n=this._getFocusedReference() +;n&&this._onDidSelectReference.fire({element:{uri:n.uri,range:i.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),i.show(this._treeContainer),i.show(this._previewContainer),this._splitView.layout(this._dim.width),this.focusOnReferenceTree(),this._tree.setInput(1===this._model.groups.length?this._model.groups[0]:this._model)):Promise.resolve(void 0)}_getFocusedReference(){const[e]=this._tree.getFocus();return e instanceof y.OneReference?e:e instanceof y.FileReferences&&e.children.length>0?e.children[0]:void 0}revealReference(e){return r(this,void 0,void 0,(function*(){yield this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})}))}_revealReference(e,t){return r(this,void 0,void 0,(function*(){if(this._revealedReference===e)return;this._revealedReference=e, +e.uri.scheme!==d.Schemas.inMemory?this.setTitle(c.basenameOrAuthority(e.uri),this._uriLabel.getUriLabel(c.dirname(e.uri))):this.setTitle(f.localize(2,null));const i=this._textModelResolverService.createModelReference(e.uri);this._tree.getInput()===e.parent?this._tree.reveal(e):(t&&this._tree.reveal(e.parent),yield this._tree.expand(e.parent),this._tree.reveal(e));const n=yield i;if(!this._model)return void n.dispose();s.dispose(this._previewModelReference);const o=n.object;if(o){const t=this._preview.getModel()===o.textEditorModel?0:1,i=u.Range.lift(e.range).collapseToStart();this._previewModelReference=n,this._preview.setModel(o.textEditorModel),this._preview.setSelection(i),this._preview.revealRangeInCenter(i,t)}else this._preview.setModel(this._previewNotAvailableMessage),n.dispose()}))}};N=a([l(3,S.IThemeService),l(4,p.ITextModelService),l(5,_.IInstantiationService),l(6,w.IPeekViewService),l(7,v.ILabelService),l(8,L.IUndoRedoService),l(9,x.IKeybindingService)],N),t.ReferenceWidget=N, +S.registerThemingParticipant((e,t)=>{const i=e.getColor(w.peekViewResultsMatchHighlight);i&&t.addRule(`.monaco-editor .reference-zone-widget .ref-tree .referenceMatch .highlight { background-color: ${i}; }`);const n=e.getColor(w.peekViewEditorMatchHighlight);n&&t.addRule(`.monaco-editor .reference-zone-widget .preview .reference-decoration { background-color: ${n}; }`);const o=e.getColor(w.peekViewEditorMatchHighlightBorder);o&&t.addRule(`.monaco-editor .reference-zone-widget .preview .reference-decoration { border: 2px solid ${o}; box-sizing: border-box; }`);const s=e.getColor(b.activeContrastBorder);s&&t.addRule(`.monaco-editor .reference-zone-widget .ref-tree .referenceMatch .highlight { border: 1px dotted ${s}; box-sizing: border-box; }`);const r=e.getColor(w.peekViewResultsBackground);r&&t.addRule(`.monaco-editor .reference-zone-widget .ref-tree { background-color: ${r}; }`);const a=e.getColor(w.peekViewResultsMatchForeground) +;a&&t.addRule(`.monaco-editor .reference-zone-widget .ref-tree { color: ${a}; }`);const l=e.getColor(w.peekViewResultsFileForeground);l&&t.addRule(`.monaco-editor .reference-zone-widget .ref-tree .reference-file { color: ${l}; }`);const d=e.getColor(w.peekViewResultsSelectionBackground);d&&t.addRule(`.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .monaco-list-rows > .monaco-list-row.selected:not(.highlighted) { background-color: ${d}; }`);const c=e.getColor(w.peekViewResultsSelectionForeground);c&&t.addRule(`.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .monaco-list-rows > .monaco-list-row.selected:not(.highlighted) { color: ${c} !important; }`);const h=e.getColor(w.peekViewEditorBackground);h&&t.addRule(".monaco-editor .reference-zone-widget .preview .monaco-editor .monaco-editor-background,.monaco-editor .reference-zone-widget .preview .monaco-editor .inputarea.ime-input {"+`\tbackground-color: ${h};`+"}");const u=e.getColor(w.peekViewEditorGutterBackground) +;u&&t.addRule(".monaco-editor .reference-zone-widget .preview .monaco-editor .margin {"+`\tbackground-color: ${u};`+"}")})})),define(t[258],i([0,1,467,12,2,27,10,17,46,76,126,638,3,13,32,15,108,141,83,39,28]),(function(e,t,i,n,o,s,d,c,h,u,g,p,m,f,_,v,C,b,S,w,y){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ReferencesController=t.ctxReferenceSearchVisible=void 0,t.ctxReferenceSearchVisible=new c.RawContextKey("referenceSearchVisible",!1);let E=class e{constructor(e,i,n,s,r,a,l,d){this._defaultTreeKeyboardSupport=e,this._editor=i,this._editorService=s,this._notificationService=r,this._instantiationService=a,this._storageService=l,this._configurationService=d,this._disposables=new o.DisposableStore,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=t.ctxReferenceSearchVisible.bindTo(n)}static get(t){return t.getContribution(e.ID)}dispose(){this._referenceSearchVisible.reset(),this._disposables.dispose(),o.dispose(this._widget),o.dispose(this._model), +this._widget=void 0,this._model=void 0}toggleWidget(e,t,n){let o;if(this._widget&&(o=this._widget.position),this.closeWidget(),o&&e.containsPosition(o))return;this._peekMode=n,this._referenceSearchVisible.set(!0),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>{this.closeWidget()})),this._disposables.add(this._editor.onDidChangeModel(()=>{this._ignoreModelChangeEvent||this.closeWidget()}));const s=p.LayoutData.fromJSON(this._storageService.get("peekViewLayout",0,"{}"));this._widget=this._instantiationService.createInstance(p.ReferenceWidget,this._editor,this._defaultTreeKeyboardSupport,s),this._widget.setTitle(i.localize(0,null)),this._widget.show(e),this._disposables.add(this._widget.onDidClose(()=>{t.cancel(),this._widget&&(this._storageService.store("peekViewLayout",JSON.stringify(this._widget.layoutData),0),this._widget=void 0),this.closeWidget()})),this._disposables.add(this._widget.onDidSelectReference(e=>{let{element:t,kind:i}=e;if(t)switch(i){case"open": +"editor"===e.source&&this._configurationService.getValue("editor.stablePeek")||this.openReference(t,!1);break;case"side":this.openReference(t,!0);break;case"goto":n?this._gotoReference(t):this.openReference(t,!1)}}));const r=++this._requestIdPool;t.then(t=>{if(r===this._requestIdPool&&this._widget)return this._model&&this._model.dispose(),this._model=t,this._widget.setModel(this._model).then(()=>{if(this._widget&&this._model&&this._editor.hasModel()){this._model.isEmpty?this._widget.setMetaTitle(""):this._widget.setMetaTitle(i.localize(1,null,this._model.title,this._model.references.length));let t=this._editor.getModel().uri,n=new f.Position(e.startLineNumber,e.startColumn),o=this._model.nearestReference(t,n);if(o)return this._widget.setSelection(o).then(()=>{this._widget&&"editor"===this._editor.getOption(68)&&this._widget.focusOnPreviewEditor()})}})},e=>{this._notificationService.error(e)})}changeFocusBetweenPreviewAndReferences(){ +this._widget&&(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}goToNextOrPreviousReference(e){return r(this,void 0,void 0,(function*(){if(!this._editor.hasModel()||!this._model||!this._widget)return;const t=this._widget.position;if(!t)return;const i=this._model.nearestReference(this._editor.getModel().uri,t);if(!i)return;const n=this._model.nextOrPreviousReference(i,e),o=this._editor.hasTextFocus(),s=this._widget.isPreviewEditorFocused();yield this._widget.setSelection(n),yield this._gotoReference(n),o?this._editor.focus():this._widget&&s&&this._widget.focusOnPreviewEditor()}))}revealReference(e){return r(this,void 0,void 0,(function*(){this._editor.hasModel()&&this._model&&this._widget&&(yield this._widget.revealReference(e))}))}closeWidget(e=!0){o.dispose(this._widget),o.dispose(this._model),this._referenceSearchVisible.reset(),this._disposables.clear(),this._widget=void 0,this._model=void 0,e&&this._editor.focus(),this._requestIdPool+=1} +_gotoReference(t){this._widget&&this._widget.hide(),this._ignoreModelChangeEvent=!0;const i=m.Range.lift(t.range).collapseToStart();return this._editorService.openCodeEditor({resource:t.uri,options:{selection:i}},this._editor).then(t=>{var n;if(this._ignoreModelChangeEvent=!1,t&&this._widget)if(this._editor===t)this._widget.show(i),this._widget.focusOnReferenceTree();else{const o=e.get(t),s=this._model.clone();this.closeWidget(),t.focus(),o.toggleWidget(i,v.createCancelablePromise(e=>Promise.resolve(s)),null!==(n=this._peekMode)&&void 0!==n&&n)}else this.closeWidget()},e=>{this._ignoreModelChangeEvent=!1,n.onUnexpectedError(e)})}openReference(e,t){t||this.closeWidget();const{uri:i,range:n}=e;this._editorService.openCodeEditor({resource:i,options:{selection:n}},this._editor,t)}};function L(e,t){const i=C.getOuterEditor(e);if(!i)return;let n=E.get(i);n&&t(n)}E.ID="editor.contrib.referencesController", +E=a([l(2,c.IContextKeyService),l(3,s.ICodeEditorService),l(4,_.INotificationService),l(5,d.IInstantiationService),l(6,u.IStorageService),l(7,h.IConfigurationService)],E),t.ReferencesController=E,S.KeybindingsRegistry.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:w.KeyChord(2089,60),when:c.ContextKeyExpr.or(t.ctxReferenceSearchVisible,C.PeekContext.inPeekEditor),handler(e){L(e,e=>{e.changeFocusBetweenPreviewAndReferences()})}}),S.KeybindingsRegistry.registerCommandAndKeybindingRule({id:"goToNextReference",weight:90,primary:62,secondary:[70],when:c.ContextKeyExpr.or(t.ctxReferenceSearchVisible,C.PeekContext.inPeekEditor),handler(e){L(e,e=>{e.goToNextOrPreviousReference(!0)})}}),S.KeybindingsRegistry.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:90,primary:1086,secondary:[1094],when:c.ContextKeyExpr.or(t.ctxReferenceSearchVisible,C.PeekContext.inPeekEditor),handler(e){L(e,e=>{e.goToNextOrPreviousReference(!1)})}}), +y.CommandsRegistry.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference"),y.CommandsRegistry.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference"),y.CommandsRegistry.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch"),y.CommandsRegistry.registerCommand("closeReferenceSearch",e=>L(e,e=>e.closeWidget())),S.KeybindingsRegistry.registerKeybindingRule({id:"closeReferenceSearch",weight:-1,primary:9,secondary:[1033],when:c.ContextKeyExpr.and(C.PeekContext.inPeekEditor,c.ContextKeyExpr.not("config.editor.stablePeek"))}),S.KeybindingsRegistry.registerKeybindingRule({id:"closeReferenceSearch",weight:250,primary:9,secondary:[1033],when:c.ContextKeyExpr.and(t.ctxReferenceSearchVisible,c.ContextKeyExpr.not("config.editor.stablePeek"))}),S.KeybindingsRegistry.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]}, +when:c.ContextKeyExpr.and(t.ctxReferenceSearchVisible,b.WorkbenchListFocusContextKey),handler(e){var t;const i=null===(t=e.get(b.IListService).lastFocusedList)||void 0===t?void 0:t.getFocus();Array.isArray(i)&&i[0]instanceof g.OneReference&&L(e,e=>e.revealReference(i[0]))}}),S.KeybindingsRegistry.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:c.ContextKeyExpr.and(t.ctxReferenceSearchVisible,b.WorkbenchListFocusContextKey),handler(e){var t;const i=null===(t=e.get(b.IListService).lastFocusedList)||void 0===t?void 0:t.getFocus();Array.isArray(i)&&i[0]instanceof g.OneReference&&L(e,e=>e.openReference(i[0],!0))}}),y.CommandsRegistry.registerCommand("openReference",e=>{var t;const i=null===(t=e.get(b.IListService).lastFocusedList)||void 0===t?void 0:t.getFocus();Array.isArray(i)&&i[0]instanceof g.OneReference&&L(e,e=>e.openReference(i[0],!1))})})), +define(t[259],i([0,1,48,15,39,16,101,11,27,13,3,22,18,140,108,258,126,465,33,17,32,56,246,28,68,571,36,24,10,23,178]),(function(e,t,i,n,o,s,a,l,d,c,h,u,g,p,m,f,_,v,C,b,S,w,y,E,L,x,D,k,N,I,M){"use strict";var R,T,O,A,P,F,W,B;Object.defineProperty(t,"__esModule",{value:!0}),t.DefinitionAction=void 0,C.MenuRegistry.appendMenuItem(C.MenuId.EditorContext,{submenu:C.MenuId.EditorContextPeek,title:v.localize(0,null),group:"navigation",order:100});class V extends l.EditorAction{constructor(e,t){super(t),this._configuration=e}run(e,t){if(!t.hasModel())return Promise.resolve(void 0);const o=e.get(S.INotificationService),s=e.get(d.ICodeEditorService),a=e.get(w.IEditorProgressService),l=e.get(x.ISymbolNavigationService),c=t.getModel(),h=t.getPosition(),u=new L.EditorStateCancellationTokenSource(t,5),g=n.raceCancellation(this._getLocationModel(c,h,u.token),u.token).then(e=>r(this,void 0,void 0,(function*(){if(!e||u.token.isCancellationRequested)return;let n;if(i.alert(e.ariaMessage),e.referenceAt(c.uri,h)){ +const e=this._getAlternativeCommand(t);e!==this.id&&(n=t.getAction(e))}const o=e.references.length;if(0===o){if(!this._configuration.muteMessage){const e=c.getWordAtPosition(h);p.MessageController.get(t).showMessage(this._getNoResultFoundMessage(e),h)}}else{if(1!==o||!n)return this._onResult(s,l,t,e);n.run()}})),e=>{o.error(e)}).finally(()=>{u.dispose()});return a.showWhile(g,250),g}_onResult(e,t,i,n){return r(this,void 0,void 0,(function*(){const o=this._getGoToPreference(i);if(i instanceof M.EmbeddedCodeEditorWidget||!(this._configuration.openInPeek||"peek"===o&&n.references.length>1)){const s=n.firstReference(),r=n.references.length>1&&"gotoAndPeek"===o,a=yield this._openReference(i,e,s,this._configuration.openToSide,!r);r&&a?this._openInPeek(a,n):n.dispose(),"goto"===o&&t.put(s)}else this._openInPeek(i,n)}))}_openReference(e,t,i,n,o){return r(this,void 0,void 0,(function*(){let s=void 0;g.isLocationLink(i)&&(s=i.targetSelectionRange),s||(s=i.range);const r=yield t.openCodeEditor({resource:i.uri,options:{ +selection:h.Range.collapseToStart(s),selectionRevealType:3}},e,n);if(r){if(o){const e=r.getModel(),t=r.deltaDecorations([],[{range:s,options:{className:"symbolHighlight"}}]);setTimeout(()=>{r.getModel()===e&&r.deltaDecorations(t,[])},350)}return r}}))}_openInPeek(e,t){let i=f.ReferencesController.get(e);i&&e.hasModel()?i.toggleWidget(e.getSelection(),n.createCancelablePromise(e=>Promise.resolve(t)),this._configuration.openInPeek):t.dispose()}}class z extends V{_getLocationModel(e,t,i){return r(this,void 0,void 0,(function*(){return new _.ReferencesModel(yield y.getDefinitionsAtPosition(e,t,i),v.localize(1,null))}))}_getNoResultFoundMessage(e){return e&&e.word?v.localize(2,null,e.word):v.localize(3,null)}_getAlternativeCommand(e){return e.getOption(43).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(43).multipleDefinitions}}t.DefinitionAction=z;const H=s.isWeb&&!D.isStandalone?2118:70;l.registerEditorAction(((R=class e extends z{constructor(){super({openToSide:!1,openInPeek:!1, +muteMessage:!1},{id:e.id,label:v.localize(4,null),alias:"Go to Definition",precondition:b.ContextKeyExpr.and(u.EditorContextKeys.hasDefinitionProvider,u.EditorContextKeys.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:u.EditorContextKeys.editorTextFocus,primary:H,weight:100},contextMenuOpts:{group:"navigation",order:1.1},menuOpts:{menuId:C.MenuId.MenubarGoMenu,group:"4_symbol_nav",order:2,title:v.localize(5,null)}}),E.CommandsRegistry.registerCommandAlias("editor.action.goToDeclaration",e.id)}}).id="editor.action.revealDefinition",R)),l.registerEditorAction(((T=class e extends z{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:e.id,label:v.localize(6,null),alias:"Open Definition to the Side",precondition:b.ContextKeyExpr.and(u.EditorContextKeys.hasDefinitionProvider,u.EditorContextKeys.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:u.EditorContextKeys.editorTextFocus,primary:o.KeyChord(2089,H),weight:100}}), +E.CommandsRegistry.registerCommandAlias("editor.action.openDeclarationToTheSide",e.id)}}).id="editor.action.revealDefinitionAside",T)),l.registerEditorAction(((O=class e extends z{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:e.id,label:v.localize(7,null),alias:"Peek Definition",precondition:b.ContextKeyExpr.and(u.EditorContextKeys.hasDefinitionProvider,m.PeekContext.notInPeekEditor,u.EditorContextKeys.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:u.EditorContextKeys.editorTextFocus,primary:582,linux:{primary:3140},weight:100},contextMenuOpts:{menuId:C.MenuId.EditorContextPeek,group:"peek",order:2}}),E.CommandsRegistry.registerCommandAlias("editor.action.previewDeclaration",e.id)}}).id="editor.action.peekDefinition",O));class K extends V{_getLocationModel(e,t,i){return r(this,void 0,void 0,(function*(){return new _.ReferencesModel(yield y.getDeclarationsAtPosition(e,t,i),v.localize(8,null))}))}_getNoResultFoundMessage(e){ +return e&&e.word?v.localize(9,null,e.word):v.localize(10,null)}_getAlternativeCommand(e){return e.getOption(43).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(43).multipleDeclarations}}l.registerEditorAction(((A=class e extends K{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:e.id,label:v.localize(11,null),alias:"Go to Declaration",precondition:b.ContextKeyExpr.and(u.EditorContextKeys.hasDeclarationProvider,u.EditorContextKeys.isInWalkThroughSnippet.toNegated()),contextMenuOpts:{group:"navigation",order:1.3},menuOpts:{menuId:C.MenuId.MenubarGoMenu,group:"4_symbol_nav",order:3,title:v.localize(12,null)}})}_getNoResultFoundMessage(e){return e&&e.word?v.localize(13,null,e.word):v.localize(14,null)}}).id="editor.action.revealDeclaration",A)),l.registerEditorAction(class extends K{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",label:v.localize(15,null),alias:"Peek Declaration", +precondition:b.ContextKeyExpr.and(u.EditorContextKeys.hasDeclarationProvider,m.PeekContext.notInPeekEditor,u.EditorContextKeys.isInWalkThroughSnippet.toNegated()),contextMenuOpts:{menuId:C.MenuId.EditorContextPeek,group:"peek",order:3}})}});class U extends V{_getLocationModel(e,t,i){return r(this,void 0,void 0,(function*(){return new _.ReferencesModel(yield y.getTypeDefinitionsAtPosition(e,t,i),v.localize(16,null))}))}_getNoResultFoundMessage(e){return e&&e.word?v.localize(17,null,e.word):v.localize(18,null)}_getAlternativeCommand(e){return e.getOption(43).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(43).multipleTypeDefinitions}}l.registerEditorAction(((P=class e extends U{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:e.ID,label:v.localize(19,null),alias:"Go to Type Definition",precondition:b.ContextKeyExpr.and(u.EditorContextKeys.hasTypeDefinitionProvider,u.EditorContextKeys.isInWalkThroughSnippet.toNegated()),kbOpts:{ +kbExpr:u.EditorContextKeys.editorTextFocus,primary:0,weight:100},contextMenuOpts:{group:"navigation",order:1.4},menuOpts:{menuId:C.MenuId.MenubarGoMenu,group:"4_symbol_nav",order:3,title:v.localize(20,null)}})}}).ID="editor.action.goToTypeDefinition",P)),l.registerEditorAction(((F=class e extends U{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:e.ID,label:v.localize(21,null),alias:"Peek Type Definition",precondition:b.ContextKeyExpr.and(u.EditorContextKeys.hasTypeDefinitionProvider,m.PeekContext.notInPeekEditor,u.EditorContextKeys.isInWalkThroughSnippet.toNegated()),contextMenuOpts:{menuId:C.MenuId.EditorContextPeek,group:"peek",order:4}})}}).ID="editor.action.peekTypeDefinition",F));class $ extends V{_getLocationModel(e,t,i){return r(this,void 0,void 0,(function*(){return new _.ReferencesModel(yield y.getImplementationsAtPosition(e,t,i),v.localize(22,null))}))}_getNoResultFoundMessage(e){return e&&e.word?v.localize(23,null,e.word):v.localize(24,null)}_getAlternativeCommand(e){ +return e.getOption(43).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(43).multipleImplementations}}l.registerEditorAction(((W=class e extends ${constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:e.ID,label:v.localize(25,null),alias:"Go to Implementations",precondition:b.ContextKeyExpr.and(u.EditorContextKeys.hasImplementationProvider,u.EditorContextKeys.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:u.EditorContextKeys.editorTextFocus,primary:2118,weight:100},menuOpts:{menuId:C.MenuId.MenubarGoMenu,group:"4_symbol_nav",order:4,title:v.localize(26,null)},contextMenuOpts:{group:"navigation",order:1.45}})}}).ID="editor.action.goToImplementation",W)),l.registerEditorAction(((B=class e extends ${constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:e.ID,label:v.localize(27,null),alias:"Peek Implementations", +precondition:b.ContextKeyExpr.and(u.EditorContextKeys.hasImplementationProvider,m.PeekContext.notInPeekEditor,u.EditorContextKeys.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:u.EditorContextKeys.editorTextFocus,primary:3142,weight:100},contextMenuOpts:{menuId:C.MenuId.EditorContextPeek,group:"peek",order:5}})}}).ID="editor.action.peekImplementation",B));class j extends V{_getNoResultFoundMessage(e){return e?v.localize(28,null,e.word):v.localize(29,null)}_getAlternativeCommand(e){return e.getOption(43).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(43).multipleReferences}}l.registerEditorAction(class extends j{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",label:v.localize(30,null),alias:"Go to References",precondition:b.ContextKeyExpr.and(u.EditorContextKeys.hasReferenceProvider,m.PeekContext.notInPeekEditor,u.EditorContextKeys.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:u.EditorContextKeys.editorTextFocus,primary:1094, +weight:100},contextMenuOpts:{group:"navigation",order:1.45},menuOpts:{menuId:C.MenuId.MenubarGoMenu,group:"4_symbol_nav",order:5,title:v.localize(31,null)}})}_getLocationModel(e,t,i){return r(this,void 0,void 0,(function*(){return new _.ReferencesModel(yield y.getReferencesAtPosition(e,t,!0,i),v.localize(32,null))}))}}),l.registerEditorAction(class extends j{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",label:v.localize(33,null),alias:"Peek References",precondition:b.ContextKeyExpr.and(u.EditorContextKeys.hasReferenceProvider,m.PeekContext.notInPeekEditor,u.EditorContextKeys.isInWalkThroughSnippet.toNegated()),contextMenuOpts:{menuId:C.MenuId.EditorContextPeek,group:"peek",order:6}})}_getLocationModel(e,t,i){return r(this,void 0,void 0,(function*(){return new _.ReferencesModel(yield y.getReferencesAtPosition(e,t,!1,i),v.localize(34,null))}))}});class q extends V{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",label:v.localize(35,null), +alias:"Go To Any Symbol",precondition:b.ContextKeyExpr.and(m.PeekContext.notInPeekEditor,u.EditorContextKeys.isInWalkThroughSnippet.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}_getLocationModel(e,t,i){return r(this,void 0,void 0,(function*(){return new _.ReferencesModel(this._references,v.localize(36,null))}))}_getNoResultFoundMessage(e){return e&&v.localize(37,null,e.word)||""}_getGoToPreference(e){var t;return null!==(t=this._gotoMultipleBehaviour)&&void 0!==t?t:e.getOption(43).multipleReferences}_getAlternativeCommand(){return""}}E.CommandsRegistry.registerCommand({id:"editor.action.goToLocations",description:{description:"Go to locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:k.URI},{name:"position",description:"The position at which to start",constraint:c.Position.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple", +description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"},{name:"noResultsMessage",description:"Human readable message that shows when locations is empty."}]},handler:(e,t,i,n,o,s,l)=>r(void 0,void 0,void 0,(function*(){I.assertType(k.URI.isUri(t)),I.assertType(c.Position.isIPosition(i)),I.assertType(Array.isArray(n)),I.assertType(void 0===o||"string"==typeof o),I.assertType(void 0===l||"boolean"==typeof l);const r=e.get(d.ICodeEditorService),h=yield r.openCodeEditor({resource:t},r.getFocusedCodeEditor());if(a.isCodeEditor(h))return h.setPosition(i),h.revealPositionInCenterIfOutsideViewport(i,0),h.invokeWithinContext(e=>{const t=new class extends q{_getNoResultFoundMessage(e){return s||super._getNoResultFoundMessage(e)}}({muteMessage:!Boolean(s),openInPeek:Boolean(l),openToSide:!1},n,o);e.get(N.IInstantiationService).invokeFunction(t.run.bind(t),h)})}))}),E.CommandsRegistry.registerCommand({id:"editor.action.peekLocations",description:{ +description:"Peek locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:k.URI},{name:"position",description:"The position at which to start",constraint:c.Position.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"}]},handler:(e,t,i,n,o)=>r(void 0,void 0,void 0,(function*(){e.get(E.ICommandService).executeCommand("editor.action.goToLocations",t,i,n,o,void 0,!0)}))}),E.CommandsRegistry.registerCommand({id:"editor.action.findReferences",handler:(e,t,i)=>{I.assertType(k.URI.isUri(t)),I.assertType(c.Position.isIPosition(i));const o=e.get(d.ICodeEditorService);return o.openCodeEditor({resource:t},o.getFocusedCodeEditor()).then(e=>{if(!a.isCodeEditor(e)||!e.hasModel())return;const t=f.ReferencesController.get(e);if(!t)return +;const o=n.createCancelablePromise(t=>y.getReferencesAtPosition(e.getModel(),c.Position.lift(i),!1,t).then(e=>new _.ReferencesModel(e,v.localize(38,null)))),s=new h.Range(i.lineNumber,i.column,i.lineNumber,i.column);return Promise.resolve(t.toggleWidget(s,o,!1))})}}),E.CommandsRegistry.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations")})),define(t[260],i([0,1,466,15,12,78,73,3,18,11,246,2,92,14,21,68,259,219,13,23,108,17,335]),(function(e,t,i,n,o,s,r,d,c,h,u,g,p,m,f,_,v,C,b,S,w,y){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GotoDefinitionAtPositionEditorContribution=void 0;let E=class e{constructor(e,t,i){this.textModelResolverService=t,this.modeService=i,this.toUnhook=new g.DisposableStore,this.toUnhookForKeyboard=new g.DisposableStore,this.linkDecorations=[],this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e;let n=new C.ClickLinkGesture(e);this.toUnhook.add(n),this.toUnhook.add(n.onMouseMoveOrRelevantKeyDown(([e,t])=>{ +this.startFindDefinitionFromMouse(e,S.withNullAsUndefined(t))})),this.toUnhook.add(n.onExecute(e=>{this.isEnabled(e)&&this.gotoDefinition(e.target.position,e.hasSideBySideModifier).then(()=>{this.removeLinkDecorations()},e=>{this.removeLinkDecorations(),o.onUnexpectedError(e)})})),this.toUnhook.add(n.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(t){return t.getContribution(e.ID)}startFindDefinitionFromCursor(e){return this.startFindDefinition(e).then(()=>{this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition(()=>{this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear()})),this.toUnhookForKeyboard.add(this.editor.onKeyDown(e=>{e&&(this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear())}))})}startFindDefinitionFromMouse(e,t){if(9===e.target.type&&this.linkDecorations.length>0)return;if(!this.editor.hasModel()||!this.isEnabled(e,t))return this.currentWordAtPosition=null, +void this.removeLinkDecorations();const i=e.target.position;this.startFindDefinition(i)}startFindDefinition(e){var t;this.toUnhookForKeyboard.clear();const r=e?null===(t=this.editor.getModel())||void 0===t?void 0:t.getWordAtPosition(e):null;if(!r)return this.currentWordAtPosition=null,this.removeLinkDecorations(),Promise.resolve(0);if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===r.startColumn&&this.currentWordAtPosition.endColumn===r.endColumn&&this.currentWordAtPosition.word===r.word)return Promise.resolve(0);this.currentWordAtPosition=r;let a=new _.EditorState(this.editor,15);return this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=n.createCancelablePromise(t=>this.findDefinition(e,t)),this.previousPromise.then(t=>{if(t&&t.length&&a.validate(this.editor))if(t.length>1)this.addDecoration(new d.Range(e.lineNumber,r.startColumn,e.lineNumber,r.endColumn),(new s.MarkdownString).appendText(i.localize(0,null,t.length)));else{let i=t[0] +;if(!i.uri)return;this.textModelResolverService.createModelReference(i.uri).then(t=>{if(!t.object||!t.object.textEditorModel)return void t.dispose();const{object:{textEditorModel:n}}=t,{startLineNumber:o}=i.range;if(o<1||o>n.getLineCount())return void t.dispose();const a=this.getPreviewValue(n,o,i);let l;l=i.originSelectionRange?d.Range.lift(i.originSelectionRange):new d.Range(e.lineNumber,r.startColumn,e.lineNumber,r.endColumn);const c=this.modeService.getModeIdByFilepathOrFirstLine(n.uri);this.addDecoration(l,(new s.MarkdownString).appendCodeblock(c||"",a)),t.dispose()})}else this.removeLinkDecorations()}).then(void 0,o.onUnexpectedError)}getPreviewValue(t,i,n){let o=n.targetSelectionRange?n.range:this.getPreviewRangeBasedOnBrackets(t,i);return o.endLineNumber-o.startLineNumber>=e.MAX_SOURCE_PREVIEW_LINES&&(o=this.getPreviewRangeBasedOnIndentation(t,i)),this.stripIndentationFromPreviewRange(t,i,o)}stripIndentationFromPreviewRange(e,t,i){let n=e.getLineFirstNonWhitespaceColumn(t) +;for(let o=t+1;on)return new d.Range(i,1,n+1,1);r=t.findNextBracket(new b.Position(a,l))}return new d.Range(i,1,n+1,1)} +addDecoration(e,t){const i={range:e,options:{inlineClassName:"goto-definition-link",hoverMessage:t}};this.linkDecorations=this.editor.deltaDecorations(this.linkDecorations,[i])}removeLinkDecorations(){this.linkDecorations.length>0&&(this.linkDecorations=this.editor.deltaDecorations(this.linkDecorations,[]))}isEnabled(e,t){return this.editor.hasModel()&&e.isNoneOrSingleMouseDown&&6===e.target.type&&(e.hasTriggerModifier||!!t&&t.keyCodeIsTriggerKey)&&c.DefinitionProviderRegistry.has(this.editor.getModel())}findDefinition(e,t){const i=this.editor.getModel();return i?u.getDefinitionsAtPosition(i,e,t):Promise.resolve(null)}gotoDefinition(e,t){return this.editor.setPosition(e),this.editor.invokeWithinContext(e=>{const i=!t&&this.editor.getOption(69)&&!this.isInPeekEditor(e);return new v.DefinitionAction({openToSide:t,openInPeek:i,muteMessage:!0},{alias:"",label:"",id:"",precondition:void 0}).run(e,this.editor)})}isInPeekEditor(e){const t=e.get(y.IContextKeyService);return w.PeekContext.inPeekEditor.getValue(t)} +dispose(){this.toUnhook.dispose()}};E.ID="editor.contrib.gotodefinitionatposition",E.MAX_SOURCE_PREVIEW_LINES=8,E=a([l(1,p.ITextModelService),l(2,r.IModeService)],E),t.GotoDefinitionAtPositionEditorContribution=E,h.registerEditorContribution(E.ID,E),m.registerThemingParticipant((e,t)=>{const i=e.getColor(f.editorActiveLinkForeground);i&&t.addRule(`.monaco-editor .goto-definition-link { color: ${i} !important; }`)})})),define(t[639],i([0,1,472,39,2,11,3,22,73,637,539,55,21,14,231,35,260,17]),(function(e,t,i,n,o,s,r,d,c,h,u,g,p,m,f,_,v,C){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ModesHoverController=void 0;let b=class e{constructor(e,t,i,n,s,r,a){this._editor=e,this._openerService=t,this._modeService=i,this._markerDecorationsService=n,this._keybindingService=s,this._themeService=r,this._toUnhook=new o.DisposableStore,this._contentWidget=new o.MutableDisposable,this._glyphWidget=new o.MutableDisposable,this._isMouseDown=!1,this._hoverClicked=!1,this._hookEvents(), +this._didChangeConfigurationHandler=this._editor.onDidChangeConfiguration(e=>{e.hasChanged(46)&&(this._hideWidgets(),this._unhookEvents(),this._hookEvents())}),this._hoverVisibleKey=d.EditorContextKeys.hoverVisible.bindTo(a)}get contentWidget(){return this._contentWidget.value||this._createHoverWidgets(),this._contentWidget.value}get glyphWidget(){return this._glyphWidget.value||this._createHoverWidgets(),this._glyphWidget.value}static get(t){return t.getContribution(e.ID)}_hookEvents(){const e=()=>this._hideWidgets(),t=this._editor.getOption(46);this._isHoverEnabled=t.enabled,this._isHoverSticky=t.sticky,this._isHoverEnabled?(this._toUnhook.add(this._editor.onMouseDown(e=>this._onEditorMouseDown(e))),this._toUnhook.add(this._editor.onMouseUp(e=>this._onEditorMouseUp(e))),this._toUnhook.add(this._editor.onMouseMove(e=>this._onEditorMouseMove(e))),this._toUnhook.add(this._editor.onKeyDown(e=>this._onKeyDown(e))), +this._toUnhook.add(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged()))):(this._toUnhook.add(this._editor.onMouseMove(e)),this._toUnhook.add(this._editor.onKeyDown(e=>this._onKeyDown(e)))),this._toUnhook.add(this._editor.onMouseLeave(e)),this._toUnhook.add(this._editor.onDidChangeModel(e)),this._toUnhook.add(this._editor.onDidScrollChange(e=>this._onEditorScrollChanged(e)))}_unhookEvents(){this._toUnhook.clear()}_onModelDecorationsChanged(){this.contentWidget.onModelDecorationsChanged(),this.glyphWidget.onModelDecorationsChanged()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this._hideWidgets()}_onEditorMouseDown(e){this._isMouseDown=!0;const t=e.target.type;9!==t||e.target.detail!==h.ModesContentHoverWidget.ID?12===t&&e.target.detail===u.ModesGlyphHoverWidget.ID||(12!==t&&e.target.detail!==u.ModesGlyphHoverWidget.ID&&(this._hoverClicked=!1),this._hideWidgets()):this._hoverClicked=!0}_onEditorMouseUp(e){this._isMouseDown=!1}_onEditorMouseMove(e){ +let t=e.target.type;if(!(this._isMouseDown&&this._hoverClicked&&this.contentWidget.isColorPickerVisible()||this._isHoverSticky&&9===t&&e.target.detail===h.ModesContentHoverWidget.ID||this._isHoverSticky&&12===t&&e.target.detail===u.ModesGlyphHoverWidget.ID)){if(7===t){const i=this._editor.getOption(36).typicalHalfwidthCharacterWidth/2,n=e.target.detail;n&&!n.isAfterLines&&"number"==typeof n.horizontalDistanceToText&&n.horizontalDistanceToText{i.showContentHover(o,1,!0)}):i.showContentHover(o,1,!0)}}s.registerEditorContribution(b.ID,b),s.registerEditorAction(S),s.registerEditorAction(w),m.registerThemingParticipant((e,t)=>{const i=e.getColor(p.editorHoverHighlight);i&&t.addRule(`.monaco-editor .hoverHighlight { background-color: ${i}; }`);const n=e.getColor(p.editorHoverBackground) +;n&&t.addRule(`.monaco-editor .monaco-hover { background-color: ${n}; }`);const o=e.getColor(p.editorHoverBorder);o&&(t.addRule(`.monaco-editor .monaco-hover { border: 1px solid ${o}; }`),t.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${o.transparent(.5)}; }`),t.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${o.transparent(.5)}; }`),t.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${o.transparent(.5)}; }`));const s=e.getColor(p.textLinkForeground);s&&t.addRule(`.monaco-editor .monaco-hover a { color: ${s}; }`);const r=e.getColor(p.editorHoverForeground);r&&t.addRule(`.monaco-editor .monaco-hover { color: ${r}; }`);const a=e.getColor(p.editorHoverStatusBarBackground);a&&t.addRule(`.monaco-editor .monaco-hover .hover-row .actions { background-color: ${a}; }`);const l=e.getColor(p.textCodeBlockBackground);l&&t.addRule(`.monaco-editor .monaco-hover code { background-color: ${l}; }`)})})), +define(t[640],i([0,1,15,2,11,18,44,241,14,46,257]),(function(e,t,i,n,o,s,r,d,c,h,u){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let g=class e extends n.Disposable{constructor(e,t,n,o){super(),this._modelService=t,this._themeService=n,this._configurationService=o,this._editor=e,this._tokenizeViewport=new i.RunOnceScheduler(()=>this._tokenizeViewportNow(),100),this._outstandingRequests=[],this._register(this._editor.onDidScrollChange(()=>{this._tokenizeViewport.schedule()})),this._register(this._editor.onDidChangeModel(()=>{this._cancelAll(),this._tokenizeViewport.schedule()})),this._register(this._editor.onDidChangeModelContent(e=>{this._cancelAll(),this._tokenizeViewport.schedule()})),this._register(s.DocumentRangeSemanticTokensProviderRegistry.onDidChange(()=>{this._cancelAll(),this._tokenizeViewport.schedule()})),this._register(this._configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(u.SEMANTIC_HIGHLIGHTING_SETTING_ID)&&(this._cancelAll(), +this._tokenizeViewport.schedule())})),this._register(this._themeService.onDidColorThemeChange(()=>{this._cancelAll(),this._tokenizeViewport.schedule()}))}static _getSemanticColoringProvider(e){const t=s.DocumentRangeSemanticTokensProviderRegistry.ordered(e);return t.length>0?t[0]:null}_cancelAll(){for(const e of this._outstandingRequests)e.cancel();this._outstandingRequests=[]}_removeOutstandingRequest(e){for(let t=0,i=this._outstandingRequests.length;tthis._requestRange(t,e,i,n)))}_requestRange(e,t,n,o){const s=e.getVersionId(),r=i.createCancelablePromise(i=>Promise.resolve(n.provideDocumentRangeSemanticTokens(e,t,i)));return r.then(i=>{i&&!e.isDisposed()&&e.getVersionId()===s&&e.setPartialSemanticTokens(t,d.toMultilineTokens2(i,o,e.getLanguageIdentifier()))}).then(()=>this._removeOutstandingRequest(r),()=>this._removeOutstandingRequest(r)),r}};g.ID="editor.contrib.viewportSemanticTokens",g=a([l(1,r.IModelService),l(2,c.IThemeService),l(3,h.IConfigurationService)],g),o.registerEditorContribution(g.ID,g)})),define(t[641],i([0,1,11,27,258,46,17,10,32,76]),(function(e,t,i,n,o,s,r,d,c,h){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StandaloneReferencesController=void 0;let u=class extends o.ReferencesController{constructor(e,t,i,n,o,s,r){super(!0,e,t,i,n,o,s,r)}} +;u=a([l(1,r.IContextKeyService),l(2,n.ICodeEditorService),l(3,c.INotificationService),l(4,d.IInstantiationService),l(5,h.IStorageService),l(6,s.IConfigurationService)],u),t.StandaloneReferencesController=u,i.registerEditorContribution(o.ReferencesController.ID,u)})),define(t[642],i([0,1,504,142,12,71,173,77,40,32,2]),(function(e,t,i,n,o,s,d,c,h,u,g){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UndoRedoService=void 0;function p(e){return e.scheme===h.Schemas.file?e.fsPath:e.path}let m=0;class f{constructor(e,t,i){this.id=++m,this.type=0,this.actual=e,this.label=e.label,this.resourceLabel=t,this.strResource=i,this.resourceLabels=[this.resourceLabel],this.strResources=[this.strResource],this.isValid=!0}setValid(e){this.isValid=e}toString(){return`[${this.id}] [${this.isValid?"VALID":"INVALID"}] ${this.actual}`}}class _{constructor(e,t){this.resourceLabel=e,this.reason=t}}class v{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,i]of this.elements){ +(0===i.reason?e:t).push(i.resourceLabel)}let n=[];return e.length>0&&n.push(i.localize(0,null,e.join(", "))),t.length>0&&n.push(i.localize(1,null,t.join(", "))),n.join("\n")}get size(){return this.elements.size}has(e){return this.elements.has(e)}set(e,t){this.elements.set(e,t)}delete(e){return this.elements.delete(e)}}class C{constructor(e,t,i){this.id=++m,this.type=1,this.actual=e,this.label=e.label,this.resourceLabels=t,this.strResources=i,this.removedResources=null,this.invalidatedResources=null}canSplit(){return"function"==typeof this.actual.split}removeResource(e,t,i){this.removedResources||(this.removedResources=new v),this.removedResources.has(t)||this.removedResources.set(t,new _(e,i))}setValid(e,t,i){i?this.invalidatedResources&&(this.invalidatedResources.delete(t),0===this.invalidatedResources.size&&(this.invalidatedResources=null)):(this.invalidatedResources||(this.invalidatedResources=new v),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new _(e,0)))}toString(){ +return`[${this.id}] [${this.invalidatedResources?"INVALID":"VALID"}] ${this.actual}`}}class b{constructor(e,t){this.resourceLabel=e,this.strResource=t,this._past=[],this._future=[],this.locked=!1,this.versionId=1}dispose(){for(const e of this._past)1===e.type&&e.removeResource(this.resourceLabel,this.strResource,0);for(const e of this._future)1===e.type&&e.removeResource(this.resourceLabel,this.strResource,0);this.versionId++}toString(){let e=[];e.push(`* ${this.strResource}:`);for(let t=0;t=0;t--)e.push(` * [REDO] ${this._future[t]}`);return e.join("\n")}flushAllElements(){this._past=[],this._future=[],this.versionId++}_setElementValidFlag(e,t){1===e.type?e.setValid(this.resourceLabel,this.strResource,t):e.setValid(t)}setElementsValidFlag(e,t){for(const i of this._past)t(i.actual)&&this._setElementValidFlag(i,e);for(const i of this._future)t(i.actual)&&this._setElementValidFlag(i,e)}pushElement(e){ +for(const e of this._future)1===e.type&&e.removeResource(this.resourceLabel,this.strResource,1);if(this._future=[],this._past.length>0){const e=this._past[this._past.length-1];0!==e.type||e.isValid||(this._past=[])}this._past.push(e),this.versionId++}createSnapshot(e){const t=[];for(let e=0,i=this._past.length;e=0;e--)t.push(this._future[e].id);return new n.ResourceEditStackSnapshot(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,n=0,o=-1;for(let s=0,r=this._past.length;s=t||r.id!==e.elements[n])&&(i=!1,o=0),i||1!==r.type||r.removeResource(this.resourceLabel,this.strResource,0)}let s=-1;for(let o=this._future.length-1;o>=0;o--,n++){const r=this._future[o];i&&(n>=t||r.id!==e.elements[n])&&(i=!1,s=o),i||1!==r.type||r.removeResource(this.resourceLabel,this.strResource,0)}-1!==o&&(this._past=this._past.slice(0,o)),-1!==s&&(this._future=this._future.slice(s+1)),this.versionId++}getElements(){ +const e=[],t=[];for(const t of this._past)e.push(t.actual);for(const e of this._future)t.push(e.actual);return{past:e,future:t}}getClosestPastElement(){return 0===this._past.length?null:this._past[this._past.length-1]}getClosestFutureElement(){return 0===this._future.length?null:this._future[this._future.length-1]}hasPastElements(){return this._past.length>0}hasFutureElements(){return this._future.length>0}splitPastWorkspaceElement(e,t){for(let i=this._past.length-1;i>=0;i--)if(this._past[i]===e){t.has(this.strResource)?this._past[i]=t.get(this.strResource):this._past.splice(i,1);break}this.versionId++}splitFutureWorkspaceElement(e,t){for(let i=this._future.length-1;i>=0;i--)if(this._future[i]===e){t.has(this.strResource)?this._future[i]=t.get(this.strResource):this._future.splice(i,1);break}this.versionId++}moveBackward(e){this._past.pop(),this._future.push(e),this.versionId++}moveForward(e){this._future.pop(),this._past.push(e),this.versionId++}}class S{constructor(e){this.editStacks=e,this._versionIds=[] +;for(let e=0,t=this.editStacks.length;e{for(const t of e.editStacks)t.locked=!1}}_safeInvokeWithLocks(e,t,i,n=g.Disposable.None){const o=this._acquireLocks(i);let s;try{s=t()}catch(t){return o(),n.dispose(),this._onError(t,e)}if(s)return s.then(()=>{o(),n.dispose()},t=>(o(),n.dispose(),this._onError(t,e)));o(),n.dispose()}_invokeWorkspacePrepare(e){return r(this,void 0,void 0,(function*(){if(void 0===e.actual.prepareUndoRedo)return g.Disposable.None;const t=e.actual.prepareUndoRedo();return void 0===t?g.Disposable.None:t}))}_invokeResourcePrepare(e,t){if(1!==e.actual.type||void 0===e.actual.prepareUndoRedo)return void t(g.Disposable.None);const i=e.actual.prepareUndoRedo();if(i){ +if(!g.isDisposable(i))return i.then(e=>{t(e)});t(i)}else t(g.Disposable.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||w);return new S(t)}_tryToSplitAndUndo(e,t,i,n){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.info(n),new E(this.undo(e));for(const e of t.strResources)this.removeElements(e);return this._notificationService.info(n),new E}_checkWorkspaceUndo(e,t,n,o){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,i.localize(2,null,t.label,t.removedResources.createMessage()));if(o&&t.invalidatedResources)return this._tryToSplitAndUndo(e,t,t.invalidatedResources,i.localize(3,null,t.label,t.invalidatedResources.createMessage()));const s=[];for(const e of n.editStacks)e.getClosestPastElement()!==t&&s.push(e.resourceLabel);if(s.length>0)return this._tryToSplitAndUndo(e,t,null,i.localize(4,null,t.label,s.join(", ")));const r=[];for(const e of n.editStacks)e.locked&&r.push(e.resourceLabel) +;return r.length>0?this._tryToSplitAndUndo(e,t,null,i.localize(5,null,t.label,r.join(", "))):n.isValid()?null:this._tryToSplitAndUndo(e,t,null,i.localize(6,null,t.label))}_workspaceUndo(e,t){const i=this._getAffectedEditStacks(t),n=this._checkWorkspaceUndo(e,t,i,!1);return n?n.returnValue:this._confirmAndExecuteWorkspaceUndo(e,t,i)}_confirmAndExecuteWorkspaceUndo(e,t,n){return r(this,void 0,void 0,(function*(){if(t.canSplit()){const o=yield this._dialogService.show(c.default.Info,i.localize(7,null,t.label),[i.localize(8,null,n.editStacks.length),i.localize(9,null),i.localize(10,null)],{cancelId:2});if(2===o.choice)return;if(1===o.choice)return this._splitPastWorkspaceElement(t,null),this.undo(e);const s=this._checkWorkspaceUndo(e,t,n,!1);if(s)return s.returnValue}let o;try{o=yield this._invokeWorkspacePrepare(t)}catch(e){return this._onError(e,t)}const s=this._checkWorkspaceUndo(e,t,n,!0);if(s)return o.dispose(),s.returnValue;for(const e of n.editStacks)e.moveBackward(t) +;return this._safeInvokeWithLocks(t,()=>t.actual.undo(),n,o)}))}_resourceUndo(e,t){if(t.isValid){if(!e.locked)return this._invokeResourcePrepare(t,i=>(e.moveBackward(t),this._safeInvokeWithLocks(t,()=>t.actual.undo(),new S([e]),i)));{const e=i.localize(11,null,t.label);this._notificationService.info(e)}}else e.flushAllElements()}undo(e){const t="string"==typeof e?e:this.getUriComparisonKey(e);if(!this._editStacks.has(t))return;const i=this._editStacks.get(t),n=i.getClosestPastElement();if(n)try{return 1===n.type?this._workspaceUndo(t,n):this._resourceUndo(i,n)}finally{0}}canRedo(e){const t=this.getUriComparisonKey(e);if(this._editStacks.has(t)){return this._editStacks.get(t).hasFutureElements()}return!1}_tryToSplitAndRedo(e,t,i,n){if(t.canSplit())return this._splitFutureWorkspaceElement(t,i),this._notificationService.info(n),new E(this.redo(e));for(const e of t.strResources)this.removeElements(e);return this._notificationService.info(n),new E}_checkWorkspaceRedo(e,t,n,o){ +if(t.removedResources)return this._tryToSplitAndRedo(e,t,t.removedResources,i.localize(12,null,t.label,t.removedResources.createMessage()));if(o&&t.invalidatedResources)return this._tryToSplitAndRedo(e,t,t.invalidatedResources,i.localize(13,null,t.label,t.invalidatedResources.createMessage()));const s=[];for(const e of n.editStacks)e.getClosestFutureElement()!==t&&s.push(e.resourceLabel);if(s.length>0)return this._tryToSplitAndRedo(e,t,null,i.localize(14,null,t.label,s.join(", ")));const r=[];for(const e of n.editStacks)e.locked&&r.push(e.resourceLabel);return r.length>0?this._tryToSplitAndRedo(e,t,null,i.localize(15,null,t.label,r.join(", "))):n.isValid()?null:this._tryToSplitAndRedo(e,t,null,i.localize(16,null,t.label))}_workspaceRedo(e,t){const i=this._getAffectedEditStacks(t),n=this._checkWorkspaceRedo(e,t,i,!1);return n?n.returnValue:this._executeWorkspaceRedo(e,t,i)}_executeWorkspaceRedo(e,t,i){return r(this,void 0,void 0,(function*(){let n;try{n=yield this._invokeWorkspacePrepare(t)}catch(e){ +return this._onError(e,t)}const o=this._checkWorkspaceRedo(e,t,i,!0);if(o)return n.dispose(),o.returnValue;for(const e of i.editStacks)e.moveForward(t);return this._safeInvokeWithLocks(t,()=>t.actual.redo(),i,n)}))}_resourceRedo(e,t){if(t.isValid){if(!e.locked)return this._invokeResourcePrepare(t,i=>(e.moveForward(t),this._safeInvokeWithLocks(t,()=>t.actual.redo(),new S([e]),i)));{const e=i.localize(17,null,t.label);this._notificationService.info(e)}}else e.flushAllElements()}redo(e){const t="string"==typeof e?e:this.getUriComparisonKey(e);if(!this._editStacks.has(t))return;const i=this._editStacks.get(t),n=i.getClosestFutureElement();if(n)try{return 1===n.type?this._workspaceRedo(t,n):this._resourceRedo(i,n)}finally{0}}};y=a([l(0,d.IDialogService),l(1,u.INotificationService)],y),t.UndoRedoService=y;class E{constructor(e){this.returnValue=e}}s.registerSingleton(n.IUndoRedoService,y)})),define(t[179],i([0,1,4,2,10]),(function(e,t,i,n,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}), +t.StorageKeysSyncRegistryService=t.IStorageKeysSyncRegistryService=void 0,t.IStorageKeysSyncRegistryService=o.createDecorator("IStorageKeysSyncRegistryService");class s extends n.Disposable{constructor(){super(),this._storageKeys=new Map,this._onDidChangeStorageKeys=this._register(new i.Emitter),this._register(n.toDisposable(()=>this._storageKeys.clear()))}get storageKeys(){return[...this._storageKeys.values()]}registerStorageKey(e){this._storageKeys.has(e.key)||(this._storageKeys.set(e.key,e),this._onDidChangeStorageKeys.fire(this.storageKeys))}}t.StorageKeysSyncRegistryService=s})),define(t[261],i([0,1,457,15,2,8,11,22,139,607,608,609,33,80,17,66,35,76,14,32,179]),(function(e,t,i,n,o,s,d,c,h,u,g,p,m,f,_,v,C,b,S,w,y){"use strict";Object.defineProperty(t,"__esModule",{value:!0}), +t.EditorStartFindReplaceAction=t.EditorStartFindAction=t.StartFindReplaceAction=t.PreviousSelectionMatchFindAction=t.NextSelectionMatchFindAction=t.SelectionMatchFindAction=t.PreviousMatchFindAction2=t.PreviousMatchFindAction=t.NextMatchFindAction2=t.NextMatchFindAction=t.MatchFindAction=t.StartFindWithSelectionAction=t.StartFindAction=t.FindController=t.CommonFindController=t.getSelectionSearchString=void 0;const E=524288;function L(e){if(!e.hasModel())return null;const t=e.getSelection();if(t.startLineNumber===t.endLineNumber)if(t.isEmpty()){const i=e.getConfiguredWordAtPosition(t.getStartPosition());if(i)return i.word}else if(e.getModel().getValueLengthInRange(t)this._onStateChanged(e))),this._model=null,this._register(this._editor.onDidChangeModel(()=>{let e=this._editor.getModel()&&this._state.isRevealed;this.disposeModel(),this._state.change({searchScope:null,matchCase:this._storageService.getBoolean("editor.matchCase",1,!1),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,!1),isRegex:this._storageService.getBoolean("editor.isRegex",1,!1),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,!1)},!1),e&&this._start({forceRevealReplace:!1,seedSearchStringFromSelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!1,updateSearchScope:!1,loop:this._editor.getOption(29).loop})}))}static get(t){return t.getContribution(e.ID)}dispose(){this.disposeModel(),super.dispose()}disposeModel(){this._model&&(this._model.dispose(),this._model=null)}_onStateChanged(e){this.saveQueryState(e), +e.isRevealed&&(this._state.isRevealed?this._findWidgetVisible.set(!0):(this._findWidgetVisible.reset(),this.disposeModel())),e.searchString&&this.setGlobalBufferTerm(this._state.searchString)}saveQueryState(e){e.isRegex&&this._storageService.store("editor.isRegex",this._state.actualIsRegex,1),e.wholeWord&&this._storageService.store("editor.wholeWord",this._state.actualWholeWord,1),e.matchCase&&this._storageService.store("editor.matchCase",this._state.actualMatchCase,1),e.preserveCase&&this._storageService.store("editor.preserveCase",this._state.actualPreserveCase,1)}loadQueryState(){this._state.change({matchCase:this._storageService.getBoolean("editor.matchCase",1,this._state.matchCase),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,this._state.wholeWord),isRegex:this._storageService.getBoolean("editor.isRegex",1,this._state.isRegex),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,this._state.preserveCase)},!1)}isFindInputFocused(){ +return!!h.CONTEXT_FIND_INPUT_FOCUSED.getValue(this._contextKeyService)}getState(){return this._state}closeFindWidget(){this._state.change({isRevealed:!1,searchScope:null},!1),this._editor.focus()}toggleCaseSensitive(){this._state.change({matchCase:!this._state.matchCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleWholeWords(){this._state.change({wholeWord:!this._state.wholeWord},!1),this._state.isRevealed||this.highlightFindOptions()}toggleRegex(){this._state.change({isRegex:!this._state.isRegex},!1),this._state.isRevealed||this.highlightFindOptions()}toggleSearchScope(){if(this._state.searchScope)this._state.change({searchScope:null},!0);else if(this._editor.hasModel()){let e=this._editor.getSelections();e.map(e=>(1===e.endColumn&&e.endLineNumber>e.startLineNumber&&(e=e.setEndPosition(e.endLineNumber-1,this._editor.getModel().getLineMaxColumn(e.endLineNumber-1))),e.isEmpty()?null:e)).filter(e=>!!e),e.length&&this._state.change({searchScope:e},!0)}}setSearchString(e){ +this._state.isRegex&&(e=s.escapeRegExpCharacters(e)),this._state.change({searchString:e},!1)}highlightFindOptions(){}_start(e){return r(this,void 0,void 0,(function*(){if(this.disposeModel(),!this._editor.hasModel())return;let t={isRevealed:!0};if(e.seedSearchStringFromSelection){let e=L(this._editor);e&&(this._state.isRegex?t.searchString=s.escapeRegExpCharacters(e):t.searchString=e)}if(!t.searchString&&e.seedSearchStringFromGlobalClipboard){let e=yield this.getGlobalBufferTerm();if(!this._editor.hasModel())return;e&&(t.searchString=e)}if(e.forceRevealReplace?t.isReplaceRevealed=!0:this._findWidgetVisible.get()||(t.isReplaceRevealed=!1),e.updateSearchScope){let e=this._editor.getSelections();e.some(e=>!e.isEmpty())&&(t.searchScope=e)}t.loop=e.loop,this._state.change(t,!1),this._model||(this._model=new h.FindModelBoundToEditorModel(this._editor,this._state))}))}start(e){return this._start(e)}moveToNextMatch(){return!!this._model&&(this._model.moveToNextMatch(),!0)}moveToPrevMatch(){ +return!!this._model&&(this._model.moveToPrevMatch(),!0)}replace(){return!!this._model&&(this._model.replace(),!0)}replaceAll(){return!!this._model&&(this._model.replaceAll(),!0)}selectAllMatches(){return!!this._model&&(this._model.selectAllMatches(),this._editor.focus(),!0)}getGlobalBufferTerm(){return r(this,void 0,void 0,(function*(){return this._editor.getOption(29).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()?this._clipboardService.readFindText():""}))}setGlobalBufferTerm(e){this._editor.getOption(29).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()&&this._clipboardService.writeFindText(e)}};x.ID="editor.contrib.findController",x=a([l(1,_.IContextKeyService),l(2,b.IStorageService),l(3,f.IClipboardService)],x),t.CommonFindController=x;let D=class extends x{constructor(e,t,i,n,o,s,r,a,l){super(e,i,r,l),this._contextViewService=t,this._keybindingService=n,this._themeService=o,this._notificationService=s, +this._storageKeysSyncRegistryService=a,this._widget=null,this._findOptionsWidget=null}_start(e){const t=Object.create(null,{_start:{get:()=>super._start}});return r(this,void 0,void 0,(function*(){this._widget||this._createFindWidget();const i=this._editor.getSelection();let n=!1;switch(this._editor.getOption(29).autoFindInSelection){case"always":n=!0;break;case"never":n=!1;break;case"multiline":n=!!i&&i.startLineNumber!==i.endLineNumber}e.updateSearchScope=n,yield t._start.call(this,e),this._widget&&(2===e.shouldFocus?this._widget.focusReplaceInput():1===e.shouldFocus&&this._widget.focusFindInput())}))}highlightFindOptions(){this._widget||this._createFindWidget(),this._state.isRevealed?this._widget.highlightFindOptions():this._findOptionsWidget.highlightFindOptions()}_createFindWidget(){ +this._widget=this._register(new p.FindWidget(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService,this._storageKeysSyncRegistryService)),this._findOptionsWidget=this._register(new u.FindOptionsWidget(this._editor,this._state,this._keybindingService,this._themeService))}};D=a([l(1,v.IContextViewService),l(2,_.IContextKeyService),l(3,C.IKeybindingService),l(4,S.IThemeService),l(5,w.INotificationService),l(6,b.IStorageService),l(7,y.IStorageKeysSyncRegistryService),l(8,f.IClipboardService)],D),t.FindController=D;class k extends d.MultiEditorAction{constructor(){super({id:h.FIND_IDS.StartFindAction,label:i.localize(0,null),alias:"Find",precondition:void 0,kbOpts:{kbExpr:null,primary:2084,weight:100},menuOpts:{menuId:m.MenuId.MenubarEditMenu,group:"3_find",title:i.localize(1,null),order:1}})}run(e,t){return r(this,void 0,void 0,(function*(){let e=x.get(t);e&&(yield e.start({forceRevealReplace:!1, +seedSearchStringFromSelection:t.getOption(29).seedSearchStringFromSelection,seedSearchStringFromGlobalClipboard:t.getOption(29).globalFindClipboard,shouldFocus:1,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(29).loop}))}))}}t.StartFindAction=k;class N extends d.EditorAction{constructor(){super({id:h.FIND_IDS.StartFindWithSelection,label:i.localize(2,null),alias:"Find With Selection",precondition:void 0,kbOpts:{kbExpr:null,primary:0,mac:{primary:2083},weight:100}})}run(e,t){return r(this,void 0,void 0,(function*(){let e=x.get(t);e&&(yield e.start({forceRevealReplace:!1,seedSearchStringFromSelection:!0,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(29).loop}),e.setGlobalBufferTerm(e.getState().searchString))}))}}t.StartFindWithSelectionAction=N;class I extends d.EditorAction{run(e,t){return r(this,void 0,void 0,(function*(){let e=x.get(t);e&&!this._run(e)&&(yield e.start({forceRevealReplace:!1, +seedSearchStringFromSelection:0===e.getState().searchString.length&&t.getOption(29).seedSearchStringFromSelection,seedSearchStringFromGlobalClipboard:!0,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(29).loop}),this._run(e))}))}}t.MatchFindAction=I;class M extends I{constructor(){super({id:h.FIND_IDS.NextMatchFindAction,label:i.localize(3,null),alias:"Find Next",precondition:void 0,kbOpts:{kbExpr:c.EditorContextKeys.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100}})}_run(e){return e.moveToNextMatch()}}t.NextMatchFindAction=M;class R extends I{constructor(){super({id:h.FIND_IDS.NextMatchFindAction,label:i.localize(4,null),alias:"Find Next",precondition:void 0,kbOpts:{kbExpr:_.ContextKeyExpr.and(c.EditorContextKeys.focus,h.CONTEXT_FIND_INPUT_FOCUSED),primary:3,weight:100}})}_run(e){return e.moveToNextMatch()}}t.NextMatchFindAction2=R;class T extends I{constructor(){super({id:h.FIND_IDS.PreviousMatchFindAction,label:i.localize(5,null),alias:"Find Previous",precondition:void 0, +kbOpts:{kbExpr:c.EditorContextKeys.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100}})}_run(e){return e.moveToPrevMatch()}}t.PreviousMatchFindAction=T;class O extends I{constructor(){super({id:h.FIND_IDS.PreviousMatchFindAction,label:i.localize(6,null),alias:"Find Previous",precondition:void 0,kbOpts:{kbExpr:_.ContextKeyExpr.and(c.EditorContextKeys.focus,h.CONTEXT_FIND_INPUT_FOCUSED),primary:1027,weight:100}})}_run(e){return e.moveToPrevMatch()}}t.PreviousMatchFindAction2=O;class A extends d.EditorAction{run(e,t){return r(this,void 0,void 0,(function*(){let e=x.get(t);if(!e)return;let i=L(t);i&&e.setSearchString(i),this._run(e)||(yield e.start({forceRevealReplace:!1,seedSearchStringFromSelection:t.getOption(29).seedSearchStringFromSelection,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(29).loop}),this._run(e))}))}}t.SelectionMatchFindAction=A;class P extends A{constructor(){super({id:h.FIND_IDS.NextSelectionMatchFindAction, +label:i.localize(7,null),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:c.EditorContextKeys.focus,primary:2109,weight:100}})}_run(e){return e.moveToNextMatch()}}t.NextSelectionMatchFindAction=P;class F extends A{constructor(){super({id:h.FIND_IDS.PreviousSelectionMatchFindAction,label:i.localize(8,null),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:c.EditorContextKeys.focus,primary:3133,weight:100}})}_run(e){return e.moveToPrevMatch()}}t.PreviousSelectionMatchFindAction=F;class W extends d.MultiEditorAction{constructor(){super({id:h.FIND_IDS.StartFindReplaceAction,label:i.localize(9,null),alias:"Replace",precondition:void 0,kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596},weight:100},menuOpts:{menuId:m.MenuId.MenubarEditMenu,group:"3_find",title:i.localize(10,null),order:2}})}run(e,t){return r(this,void 0,void 0,(function*(){if(!t.hasModel()||t.getOption(72))return +;let e=x.get(t),i=t.getSelection(),n=e.isFindInputFocused(),o=!i.isEmpty()&&i.startLineNumber===i.endLineNumber&&t.getOption(29).seedSearchStringFromSelection&&!n,s=n||o?2:1;e&&(yield e.start({forceRevealReplace:!0,seedSearchStringFromSelection:o,seedSearchStringFromGlobalClipboard:t.getOption(29).seedSearchStringFromSelection,shouldFocus:s,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(29).loop}))}))}}t.StartFindReplaceAction=W,d.registerEditorContribution(x.ID,D),t.EditorStartFindAction=new k,d.registerMultiEditorAction(t.EditorStartFindAction),d.registerEditorAction(N),d.registerEditorAction(M),d.registerEditorAction(R),d.registerEditorAction(T),d.registerEditorAction(O),d.registerEditorAction(P),d.registerEditorAction(F),t.EditorStartFindReplaceAction=new W,d.registerMultiEditorAction(t.EditorStartFindReplaceAction);const B=d.EditorCommand.bindToContribution(x.get);d.registerEditorCommand(new B({id:h.FIND_IDS.CloseFindWidgetCommand,precondition:h.CONTEXT_FIND_WIDGET_VISIBLE, +handler:e=>e.closeFindWidget(),kbOpts:{weight:105,kbExpr:c.EditorContextKeys.focus,primary:9,secondary:[1033]}})),d.registerEditorCommand(new B({id:h.FIND_IDS.ToggleCaseSensitiveCommand,precondition:void 0,handler:e=>e.toggleCaseSensitive(),kbOpts:{weight:105,kbExpr:c.EditorContextKeys.focus,primary:h.ToggleCaseSensitiveKeybinding.primary,mac:h.ToggleCaseSensitiveKeybinding.mac,win:h.ToggleCaseSensitiveKeybinding.win,linux:h.ToggleCaseSensitiveKeybinding.linux}})),d.registerEditorCommand(new B({id:h.FIND_IDS.ToggleWholeWordCommand,precondition:void 0,handler:e=>e.toggleWholeWords(),kbOpts:{weight:105,kbExpr:c.EditorContextKeys.focus,primary:h.ToggleWholeWordKeybinding.primary,mac:h.ToggleWholeWordKeybinding.mac,win:h.ToggleWholeWordKeybinding.win,linux:h.ToggleWholeWordKeybinding.linux}})),d.registerEditorCommand(new B({id:h.FIND_IDS.ToggleRegexCommand,precondition:void 0,handler:e=>e.toggleRegex(),kbOpts:{weight:105,kbExpr:c.EditorContextKeys.focus,primary:h.ToggleRegexKeybinding.primary, +mac:h.ToggleRegexKeybinding.mac,win:h.ToggleRegexKeybinding.win,linux:h.ToggleRegexKeybinding.linux}})),d.registerEditorCommand(new B({id:h.FIND_IDS.ToggleSearchScopeCommand,precondition:void 0,handler:e=>e.toggleSearchScope(),kbOpts:{weight:105,kbExpr:c.EditorContextKeys.focus,primary:h.ToggleSearchScopeKeybinding.primary,mac:h.ToggleSearchScopeKeybinding.mac,win:h.ToggleSearchScopeKeybinding.win,linux:h.ToggleSearchScopeKeybinding.linux}})),d.registerEditorCommand(new B({id:h.FIND_IDS.ReplaceOneAction,precondition:h.CONTEXT_FIND_WIDGET_VISIBLE,handler:e=>e.replace(),kbOpts:{weight:105,kbExpr:c.EditorContextKeys.focus,primary:3094}})),d.registerEditorCommand(new B({id:h.FIND_IDS.ReplaceOneAction,precondition:h.CONTEXT_FIND_WIDGET_VISIBLE,handler:e=>e.replace(),kbOpts:{weight:105,kbExpr:_.ContextKeyExpr.and(c.EditorContextKeys.focus,h.CONTEXT_REPLACE_INPUT_FOCUSED),primary:3}})),d.registerEditorCommand(new B({id:h.FIND_IDS.ReplaceAllAction,precondition:h.CONTEXT_FIND_WIDGET_VISIBLE,handler:e=>e.replaceAll(), +kbOpts:{weight:105,kbExpr:c.EditorContextKeys.focus,primary:2563}})),d.registerEditorCommand(new B({id:h.FIND_IDS.ReplaceAllAction,precondition:h.CONTEXT_FIND_WIDGET_VISIBLE,handler:e=>e.replaceAll(),kbOpts:{weight:105,kbExpr:_.ContextKeyExpr.and(c.EditorContextKeys.focus,h.CONTEXT_REPLACE_INPUT_FOCUSED),primary:void 0,mac:{primary:2051}}})),d.registerEditorCommand(new B({id:h.FIND_IDS.SelectAllMatchesAction,precondition:h.CONTEXT_FIND_WIDGET_VISIBLE,handler:e=>e.selectAllMatches(),kbOpts:{weight:105,kbExpr:c.EditorContextKeys.focus,primary:515}}))})),define(t[643],i([0,1,479,15,39,2,11,233,3,20,22,52,31,18,261,33,21,14,17]),(function(e,t,i,n,o,s,r,a,l,d,c,h,u,g,p,m,f,_,v){"use strict";Object.defineProperty(t,"__esModule",{value:!0}), +t.SelectionHighlighter=t.CompatChangeAll=t.SelectHighlightsAction=t.MoveSelectionToPreviousFindMatchAction=t.MoveSelectionToNextFindMatchAction=t.AddSelectionToPreviousFindMatchAction=t.AddSelectionToNextFindMatchAction=t.MultiCursorSelectionControllerAction=t.MultiCursorSelectionController=t.MultiCursorSession=t.MultiCursorSessionResult=t.InsertCursorBelow=t.InsertCursorAbove=void 0;class C extends r.EditorAction{constructor(){super({id:"editor.action.insertCursorAbove",label:i.localize(0,null),alias:"Add Cursor Above",precondition:void 0,kbOpts:{kbExpr:c.EditorContextKeys.editorTextFocus,primary:2576,linux:{primary:1552,secondary:[3088]},weight:100},menuOpts:{menuId:m.MenuId.MenubarSelectionMenu,group:"3_multi",title:i.localize(1,null),order:2}})}run(e,t,i){if(!t.hasModel())return;const n=i&&!0===i.logicalLine,o=t._getViewModel();o.cursorConfig.readOnly||(o.pushStackElement(),o.setCursorStates(i.source,3,a.CursorMoveCommands.addCursorUp(o,o.getCursorStates(),n)),o.revealTopMostCursor(i.source))}} +t.InsertCursorAbove=C;class b extends r.EditorAction{constructor(){super({id:"editor.action.insertCursorBelow",label:i.localize(2,null),alias:"Add Cursor Below",precondition:void 0,kbOpts:{kbExpr:c.EditorContextKeys.editorTextFocus,primary:2578,linux:{primary:1554,secondary:[3090]},weight:100},menuOpts:{menuId:m.MenuId.MenubarSelectionMenu,group:"3_multi",title:i.localize(3,null),order:3}})}run(e,t,i){if(!t.hasModel())return;const n=i&&!0===i.logicalLine,o=t._getViewModel();o.cursorConfig.readOnly||(o.pushStackElement(),o.setCursorStates(i.source,3,a.CursorMoveCommands.addCursorDown(o,o.getCursorStates(),n)),o.revealBottomMostCursor(i.source))}}t.InsertCursorBelow=b;class S extends r.EditorAction{constructor(){super({id:"editor.action.insertCursorAtEndOfEachLineSelected",label:i.localize(4,null),alias:"Add Cursors to Line Ends",precondition:void 0,kbOpts:{kbExpr:c.EditorContextKeys.editorTextFocus,primary:1575,weight:100},menuOpts:{menuId:m.MenuId.MenubarSelectionMenu,group:"3_multi",title:i.localize(5,null), +order:4}})}getCursorsForSelection(e,t,i){if(!e.isEmpty()){for(let n=e.startLineNumber;n1&&i.push(new d.Selection(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn))}}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=t.getSelections();let o=[];n.forEach(e=>this.getCursorsForSelection(e,i,o)),o.length>0&&t.setSelections(o)}}class w extends r.EditorAction{constructor(){super({id:"editor.action.addCursorsToBottom",label:i.localize(6,null),alias:"Add Cursors To Bottom",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections(),n=t.getModel().getLineCount();let o=[];for(let e=i[0].startLineNumber;e<=n;e++)o.push(new d.Selection(e,i[0].startColumn,e,i[0].endColumn));o.length>0&&t.setSelections(o)}}class y extends r.EditorAction{constructor(){super({id:"editor.action.addCursorsToTop",label:i.localize(7,null),alias:"Add Cursors To Top",precondition:void 0})}run(e,t){if(!t.hasModel())return +;const i=t.getSelections();let n=[];for(let e=i[0].startLineNumber;e>=1;e--)n.push(new d.Selection(e,i[0].startColumn,e,i[0].endColumn));n.length>0&&t.setSelections(n)}}class E{constructor(e,t,i){this.selections=e,this.revealRange=t,this.revealScrollType=i}}t.MultiCursorSessionResult=E;class L{constructor(e,t,i,n,o,s,r){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=i,this.searchText=n,this.wholeWord=o,this.matchCase=s,this.currentMatch=r}static create(e,t){if(!e.hasModel())return null;const i=t.getState();if(!e.hasTextFocus()&&i.isRevealed&&i.searchString.length>0)return new L(e,t,!1,i.searchString,i.wholeWord,i.matchCase,null);let n,o,s=!1;const r=e.getSelections();1===r.length&&r[0].isEmpty()?(s=!0,n=!0,o=!0):(n=i.wholeWord,o=i.matchCase);const a=e.getSelection();let l,c=null;if(a.isEmpty()){const t=e.getConfiguredWordAtPosition(a.getStartPosition());if(!t)return null;l=t.word,c=new d.Selection(a.startLineNumber,t.startColumn,a.startLineNumber,t.endColumn) +}else l=e.getModel().getValueInRange(a).replace(/\r\n/g,"\n");return new L(e,t,s,l,n,o,c)}addSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new E(t.concat(e),e,0)}moveSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new E(t.slice(0,t.length-1).concat(e),e,0)}_getNextMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const e=this.currentMatch;return this.currentMatch=null,e}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findNextMatch(this.searchText,t.getEndPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(105):null,!1);return i?new d.Selection(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}addSelectionToPreviousFindMatch(){ +if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new E(t.concat(e),e,0)}moveSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new E(t.slice(0,t.length-1).concat(e),e,0)}_getPreviousMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const e=this.currentMatch;return this.currentMatch=null,e}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findPreviousMatch(this.searchText,t.getStartPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(105):null,!1);return i?new d.Selection(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}selectAll(){return this._editor.hasModel()?(this.findController.highlightFindOptions(), +this._editor.getModel().findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(105):null,!1,1073741824)):[]}}t.MultiCursorSession=L;class x extends s.Disposable{constructor(e){super(),this._sessionDispose=this._register(new s.DisposableStore),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}static get(e){return e.getContribution(x.ID)}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=L.create(this._editor,e);if(!t)return;this._session=t;const i={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(i.wholeWordOverride=1,i.matchCaseOverride=1,i.isRegexOverride=2),e.getState().change(i,!1),this._sessionDispose.add(this._editor.onDidChangeCursorSelection(e=>{this._ignoreSelectionChange||this._endSession()})),this._sessionDispose.add(this._editor.onDidBlurEditorText(()=>{this._endSession()})),this._sessionDispose.add(e.getState().onFindReplaceStateChange(e=>{ +(e.matchCase||e.wholeWord)&&this._endSession()}))}}_endSession(){if(this._sessionDispose.clear(),this._session&&this._session.isDisconnectedFromFindController){const e={wholeWordOverride:0,matchCaseOverride:0,isRegexOverride:0};this._session.findController.getState().change(e,!1)}this._session=null}_setSelections(e){this._ignoreSelectionChange=!0,this._editor.setSelections(e),this._ignoreSelectionChange=!1}_expandEmptyToWord(e,t){if(!t.isEmpty())return t;const i=this._editor.getConfiguredWordAtPosition(t.getStartPosition());return i?new d.Selection(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):t}_applySessionResult(e){e&&(this._setSelections(e.selections),e.revealRange&&this._editor.revealRangeInCenterIfOutsideViewport(e.revealRange,e.revealScrollType))}getSession(e){return this._session}addSelectionToNextFindMatch(e){if(this._editor.hasModel()){if(!this._session){const t=this._editor.getSelections();if(t.length>1){const i=e.getState().matchCase;if(!P(this._editor.getModel(),t,i)){ +const e=this._editor.getModel();let i=[];for(let n=0,o=t.length;n0&&i.isRegex)t=this._editor.getModel().findMatches(i.searchString,!0,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(105):null,!1,1073741824);else{ +if(this._beginSessionIfNeeded(e),!this._session)return;t=this._session.selectAll()}if(i.searchScope){const e=i.searchScope;let n=[];t.forEach(t=>{e.forEach(e=>{t.range.endLineNumber<=e.endLineNumber&&t.range.startLineNumber>=e.startLineNumber&&n.push(t)})}),t=n}if(t.length>0){const e=this._editor.getSelection();for(let i=0,n=t.length;inew d.Selection(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn)))}}}t.MultiCursorSelectionController=x,x.ID="editor.contrib.multiCursorController";class D extends r.EditorAction{run(e,t){const i=x.get(t);if(!i)return;const n=p.CommonFindController.get(t);n&&this._run(i,n)}}t.MultiCursorSelectionControllerAction=D;class k extends D{constructor(){super({id:"editor.action.addSelectionToNextFindMatch",label:i.localize(8,null),alias:"Add Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:c.EditorContextKeys.focus,primary:2082, +weight:100},menuOpts:{menuId:m.MenuId.MenubarSelectionMenu,group:"3_multi",title:i.localize(9,null),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}}t.AddSelectionToNextFindMatchAction=k;class N extends D{constructor(){super({id:"editor.action.addSelectionToPreviousFindMatch",label:i.localize(10,null),alias:"Add Selection To Previous Find Match",precondition:void 0,menuOpts:{menuId:m.MenuId.MenubarSelectionMenu,group:"3_multi",title:i.localize(11,null),order:6}})}_run(e,t){e.addSelectionToPreviousFindMatch(t)}}t.AddSelectionToPreviousFindMatchAction=N;class I extends D{constructor(){super({id:"editor.action.moveSelectionToNextFindMatch",label:i.localize(12,null),alias:"Move Last Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:c.EditorContextKeys.focus,primary:o.KeyChord(2089,2082),weight:100}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}}t.MoveSelectionToNextFindMatchAction=I;class M extends D{constructor(){super({id:"editor.action.moveSelectionToPreviousFindMatch", +label:i.localize(13,null),alias:"Move Last Selection To Previous Find Match",precondition:void 0})}_run(e,t){e.moveSelectionToPreviousFindMatch(t)}}t.MoveSelectionToPreviousFindMatchAction=M;class R extends D{constructor(){super({id:"editor.action.selectHighlights",label:i.localize(14,null),alias:"Select All Occurrences of Find Match",precondition:void 0,kbOpts:{kbExpr:c.EditorContextKeys.focus,primary:3114,weight:100},menuOpts:{menuId:m.MenuId.MenubarSelectionMenu,group:"3_multi",title:i.localize(15,null),order:7}})}_run(e,t){e.selectAll(t)}}t.SelectHighlightsAction=R;class T extends D{constructor(){super({id:"editor.action.changeAll",label:i.localize(16,null),alias:"Change All Occurrences",precondition:v.ContextKeyExpr.and(c.EditorContextKeys.writable,c.EditorContextKeys.editorTextFocus),kbOpts:{kbExpr:c.EditorContextKeys.editorTextFocus,primary:2108,weight:100},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(e,t){e.selectAll(t)}}t.CompatChangeAll=T;class O{constructor(e,t,i,n){this.searchText=e, +this.matchCase=t,this.wordSeparators=i,this.modelVersionId=n}static softEquals(e,t){return!e&&!t||!(!e||!t)&&(e.searchText===t.searchText&&e.matchCase===t.matchCase&&e.wordSeparators===t.wordSeparators&&e.modelVersionId===t.modelVersionId)}}class A extends s.Disposable{constructor(e){super(),this.editor=e,this._isEnabled=e.getOption(89),this.decorations=[],this.updateSoon=this._register(new n.RunOnceScheduler(()=>this._update(),300)),this.state=null,this._register(e.onDidChangeConfiguration(t=>{this._isEnabled=e.getOption(89)})),this._register(e.onDidChangeCursorSelection(e=>{this._isEnabled&&(e.selection.isEmpty()?3===e.reason?(this.state&&this._setState(null),this.updateSoon.schedule()):this._setState(null):this._update())})),this._register(e.onDidChangeModel(e=>{this._setState(null)})),this._register(e.onDidChangeModelContent(e=>{this._isEnabled&&this.updateSoon.schedule()})),this._register(p.CommonFindController.get(e).getState().onFindReplaceStateChange(e=>{this._update()}))}_update(){ +this._setState(A._createState(this._isEnabled,this.editor))}static _createState(e,t){if(!e)return null;if(!t.hasModel())return null;const i=t.getSelection();if(i.startLineNumber!==i.endLineNumber)return null;const n=x.get(t);if(!n)return null;const o=p.CommonFindController.get(t);if(!o)return null;let s=n.getSession(o);if(!s){const e=t.getSelections();if(e.length>1){const i=o.getState().matchCase;if(!P(t.getModel(),e,i))return null}s=L.create(t,o)}if(!s)return null;if(s.currentMatch)return null;if(/^[ \t]+$/.test(s.searchText))return null;if(s.searchText.length>200)return null;const r=o.getState(),a=r.matchCase;if(r.isRevealed){let e=r.searchString;a||(e=e.toLowerCase());let t=s.searchText;if(a||(t=t.toLowerCase()),e===t&&s.matchCase===r.matchCase&&s.wholeWord===r.wholeWord&&!r.isRegex)return null}return new O(s.searchText,s.matchCase,s.wholeWord?t.getOption(105):null,t.getModel().getVersionId())}_setState(e){if(O.softEquals(this.state,e))return void(this.state=e);if(this.state=e, +!this.state)return void(this.decorations=this.editor.deltaDecorations(this.decorations,[]));if(!this.editor.hasModel())return;const t=this.editor.getModel();if(t.isTooLargeForTokenization())return;const i=g.DocumentHighlightProviderRegistry.has(t)&&this.editor.getOption(63);let n=t.findMatches(this.state.searchText,!0,!1,this.state.matchCase,this.state.wordSeparators,!1).map(e=>e.range);n.sort(l.Range.compareRangesUsingStarts);let o=this.editor.getSelections();o.sort(l.Range.compareRangesUsingStarts);let s=[];for(let e=0,t=0,i=n.length,r=o.length;e=r)s.push(i),e++;else{const n=l.Range.compareRangesUsingStarts(i,o[t]);n<0?(!o[t].isEmpty()&&l.Range.areIntersecting(i,o[t])||s.push(i),e++):n>0?t++:(e++,t++)}}const r=s.map(e=>({range:e,options:i?A._SELECTION_HIGHLIGHT:A._SELECTION_HIGHLIGHT_OVERVIEW}));this.decorations=this.editor.deltaDecorations(this.decorations,r)}dispose(){this._setState(null),super.dispose()}}function P(e,t,i){const n=F(e,t[0],!i);for(let o=1,s=t.length;o{const i=this.commandsHistory.peek(e.commandId),n=this.commandsHistory.peek(t.commandId);return i&&n?i>n?-1:1:i?-1:n?1:e.label.localeCompare(t.label)});const c=[];let h=!1;for(let e=0;er(this,void 0,void 0,(function*(){this.commandsHistory.push(t.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:t.commandId,from:"quick open"});try{yield this.commandService.executeCommand(t.commandId)}catch(e){ +_.isPromiseCanceledError(e)||this.notificationService.error(i.localize(3,null,t.label,C.toErrorMessage(e)))}}))}))}return c}))}};S.PREFIX=">",S.WORD_FILTER=s.or(s.matchesPrefix,s.matchesWords,s.matchesContiguousSubString),S=a([l(1,g.IInstantiationService),l(2,p.IKeybindingService),l(3,m.ICommandService),l(4,f.ITelemetryService),l(5,v.INotificationService)],S),t.AbstractCommandsQuickAccessProvider=S;let w=class e extends o.Disposable{constructor(t,i,n){super(),this.storageService=t,this.configurationService=i,this.configuredCommandsHistoryLength=0,n.registerStorageKey({key:e.PREF_KEY_CACHE,version:1}),n.registerStorageKey({key:e.PREF_KEY_COUNTER,version:1}),this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(()=>this.updateConfiguration()))}updateConfiguration(){this.configuredCommandsHistoryLength=e.getConfiguredCommandHistoryLength(this.configurationService), +e.cache&&e.cache.limit!==this.configuredCommandsHistoryLength&&(e.cache.limit=this.configuredCommandsHistoryLength,e.saveState(this.storageService))}load(){const t=this.storageService.get(e.PREF_KEY_CACHE,0);let i;if(t)try{i=JSON.parse(t)}catch(e){}const n=e.cache=new c.LRUCache(this.configuredCommandsHistoryLength,1);if(i){let e;(e=i.usesLRU?i.entries:i.entries.sort((e,t)=>e.value-t.value)).forEach(e=>n.set(e.key,e.value))}e.counter=this.storageService.getNumber(e.PREF_KEY_COUNTER,0,e.counter)}push(t){e.cache&&(e.cache.set(t,e.counter++),e.saveState(this.storageService))}peek(t){var i;return null===(i=e.cache)||void 0===i?void 0:i.peek(t)}static saveState(t){if(!e.cache)return;const i={usesLRU:!0,entries:[]};e.cache.forEach((e,t)=>i.entries.push({key:t,value:e})),t.store(e.PREF_KEY_CACHE,JSON.stringify(i),0),t.store(e.PREF_KEY_COUNTER,e.counter,0)}static getConfiguredCommandHistoryLength(t){var i,n +;const o=null===(n=null===(i=t.getValue().workbench)||void 0===i?void 0:i.commandPalette)||void 0===n?void 0:n.history;return"number"==typeof o?o:e.DEFAULT_COMMANDS_HISTORY_LENGTH}};w.DEFAULT_COMMANDS_HISTORY_LENGTH=50,w.PREF_KEY_CACHE="commandPalette.mru.cache",w.PREF_KEY_COUNTER="commandPalette.mru.counter",w.counter=1,w=a([l(0,h.IStorageService),l(1,u.IConfigurationService),l(2,b.IStorageKeysSyncRegistryService)],w),t.CommandsHistory=w})),define(t[645],i([0,1,644,26]),(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractEditorCommandsQuickAccessProvider=void 0;class o extends i.AbstractCommandsQuickAccessProvider{constructor(e,t,i,n,o,s){super(e,t,i,n,o,s)}getCodeEditorCommandPicks(){const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const i of e.getSupportedActions())t.push({commandId:i.id,commandAlias:i.alias,label:n.stripCodicons(i.label)||i.id});return t}}t.AbstractEditorCommandsQuickAccessProvider=o})), +define(t[646],i([0,1,34,94,61,27,645,23,10,35,28,84,32,11,22,75]),(function(e,t,i,n,o,s,d,c,h,u,g,p,m,f,_,v){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GotoLineAction=t.StandaloneCommandsQuickAccessProvider=void 0;let C=class extends d.AbstractEditorCommandsQuickAccessProvider{constructor(e,t,i,n,o,s){super({showAlias:!1},e,i,n,o,s),this.codeEditorService=t}get activeTextEditorControl(){return c.withNullAsUndefined(this.codeEditorService.getFocusedCodeEditor())}getCommandPicks(){return r(this,void 0,void 0,(function*(){return this.getCodeEditorCommandPicks()}))}};C=a([l(0,h.IInstantiationService),l(1,s.ICodeEditorService),l(2,u.IKeybindingService),l(3,g.ICommandService),l(4,p.ITelemetryService),l(5,m.INotificationService)],C),t.StandaloneCommandsQuickAccessProvider=C,i.Registry.as(n.Extensions.Quickaccess).registerQuickAccessProvider({ctor:C,prefix:C.PREFIX,helpEntries:[{description:o.QuickCommandNLS.quickCommandHelp,needsEditor:!0}]});class b extends f.EditorAction{constructor(){super({ +id:"editor.action.quickCommand",label:o.QuickCommandNLS.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:_.EditorContextKeys.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(v.IQuickInputService).quickAccess.show(C.PREFIX)}}t.GotoLineAction=b,f.registerEditorAction(b)})),define(t[180],i([0,1,24,41,10,59]),(function(e,t,i,n,o,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceFolder=t.Workspace=t.IWorkspaceFolder=t.IWorkspace=t.IWorkspaceContextService=void 0,t.IWorkspaceContextService=o.createDecorator("contextService"),function(e){e.isIWorkspace=function(e){return!(!e||"object"!=typeof e||"string"!=typeof e.id||!Array.isArray(e.folders))}}(t.IWorkspace||(t.IWorkspace={})),function(e){e.isIWorkspaceFolder=function(e){return!(!e||"object"!=typeof e||!i.URI.isUri(e.uri)||"string"!=typeof e.name||"function"!=typeof e.toResource)}}(t.IWorkspaceFolder||(t.IWorkspaceFolder={}));t.Workspace=class{ +constructor(e,t=[],i=null){this._id=e,this._configuration=i,this._foldersMap=s.TernarySearchTree.forUris(),this.folders=t}get folders(){return this._folders}set folders(e){this._folders=e,this.updateFoldersMap()}get id(){return this._id}get configuration(){return this._configuration}set configuration(e){this._configuration=e}getFolder(e){return e&&this._foldersMap.findSubstr(e.with({scheme:e.scheme,authority:e.authority,path:e.path}))||null}updateFoldersMap(){this._foldersMap=s.TernarySearchTree.forUris();for(const e of this.folders)this._foldersMap.set(e.uri,e)}toJSON(){return{id:this.id,folders:this.folders,configuration:this.configuration}}};t.WorkspaceFolder=class{constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toResource(e){return n.joinPath(this.uri,e)}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}}})), +define(t[181],i([0,1,8,7,53,4,39,2,16,77,24,101,127,174,60,13,3,44,28,46,548,530,239,83,532,533,32,180,61]),(function(e,t,i,n,o,s,d,c,h,u,g,p,m,f,_,v,C,b,S,w,y,E,L,x,D,k,N,I,M){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SimpleLayoutService=t.SimpleUriLabelService=t.SimpleBulkEditService=t.applyConfigurationValues=t.SimpleWorkspaceContextService=t.StandaloneTelemetryService=t.SimpleResourcePropertiesService=t.SimpleResourceConfigurationService=t.SimpleConfigurationService=t.StandaloneKeybindingService=t.StandaloneCommandService=t.SimpleNotificationService=t.SimpleDialogService=t.SimpleEditorProgressService=t.SimpleEditorModelResolverService=t.SimpleModel=void 0;class R{constructor(e){this.disposed=!1,this.model=e,this._onDispose=new s.Emitter}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onDispose.fire()}}t.SimpleModel=R;let T=class{constructor(e){this.modelService=e}setEditor(e){this.editor=e}createModelReference(e){let t=null;var i,n,o +;return this.editor&&(i=this.editor,n=t=>this.findModel(t,e),o=t=>this.findModel(t.getOriginalEditor(),e)||this.findModel(t.getModifiedEditor(),e),t=p.isCodeEditor(i)?n(i):o(i)),t?Promise.resolve(new c.ImmortalReference(new R(t))):Promise.reject(new Error("Model not found"))}findModel(e,t){let i=this.modelService.getModel(t);return i&&i.uri.toString()!==t.toString()?null:i}};T=a([l(0,b.IModelService)],T),t.SimpleEditorModelResolverService=T;class O{show(){return O.NULL_PROGRESS_RUNNER}showWhile(e,t){return Promise.resolve(void 0)}}t.SimpleEditorProgressService=O,O.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};t.SimpleDialogService=class{confirm(e){return this.doConfirm(e).then(e=>({confirmed:e,checkboxChecked:!1}))}doConfirm(e){let t=e.message;return e.detail&&(t=t+"\n\n"+e.detail),Promise.resolve(window.confirm(t))}show(e,t,i,n){return Promise.resolve({choice:0})}};class A{info(e){return this.notify({severity:u.default.Info,message:e})}warn(e){return this.notify({severity:u.default.Warning, +message:e})}error(e){return this.notify({severity:u.default.Error,message:e})}notify(e){switch(e.severity){case u.default.Error:console.error(e.message);break;case u.default.Warning:console.warn(e.message);break;default:console.log(e.message)}return A.NO_OP}status(e,t){return c.Disposable.None}}t.SimpleNotificationService=A,A.NO_OP=new N.NoOpNotification;t.StandaloneCommandService=class{constructor(e){this._onWillExecuteCommand=new s.Emitter,this._onDidExecuteCommand=new s.Emitter,this._instantiationService=e}executeCommand(e,...t){const i=S.CommandsRegistry.getCommand(e);if(!i)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});const n=this._instantiationService.invokeFunction.apply(this._instantiationService,[i.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(e){return Promise.reject(e)}}};class P extends E.AbstractKeybindingService{constructor(e,t,i,s,r,a){super(e,t,i,s,r), +this._cachedResolver=null,this._dynamicKeybindings=[],this._register(n.addDisposableListener(a,n.EventType.KEY_DOWN,e=>{let t=new o.StandardKeyboardEvent(e);this._dispatch(t,t.target)&&(t.preventDefault(),t.stopPropagation())}))}addDynamicKeybinding(e,t,i,n){const o=d.createKeybinding(t,h.OS),s=new c.DisposableStore;return o&&(this._dynamicKeybindings.push({keybinding:o,command:e,when:n,weight1:1e3,weight2:0,extensionId:null}),s.add(c.toDisposable(()=>{for(let t=0;tthis._log(e))}return this._cachedResolver}_documentHasFocus(){return document.hasFocus()}_toNormalizedKeybindingItems(e,t){let i=[],n=0;for(const o of e){const e=o.when||void 0,s=o.keybinding;if(s){const r=this.resolveKeybinding(s);for(const s of r)i[n++]=new D.ResolvedKeybindingItem(s,o.command,o.commandArgs,e,t,null)}else i[n++]=new D.ResolvedKeybindingItem(void 0,o.command,o.commandArgs,e,t,null)}return i}resolveKeybinding(e){return[new k.USLayoutResolvedKeybinding(e,h.OS)]}resolveKeyboardEvent(e){let t=new d.SimpleKeybinding(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode).toChord();return new k.USLayoutResolvedKeybinding(t,h.OS)}}function F(e){return e&&"object"==typeof e&&(!e.overrideIdentifier||"string"==typeof e.overrideIdentifier)&&(!e.resource||e.resource instanceof g.URI)}t.StandaloneKeybindingService=P;class W{constructor(){this._onDidChangeConfiguration=new s.Emitter,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event, +this._configuration=new y.Configuration(new y.DefaultConfigurationModel,new y.ConfigurationModel)}getValue(e,t){const i="string"==typeof e?e:void 0,n=F(e)?e:F(t)?t:{};return this._configuration.getValue(i,n,void 0)}updateValues(e){const t={data:this._configuration.toData()};let i=[];for(const t of e){const[e,n]=t;this.getValue(e)!==n&&(this._configuration.updateValue(e,n),i.push(e))}if(i.length>0){const e=new y.ConfigurationChangeEvent({keys:i,overrides:[]},t,this._configuration);e.source=7,e.sourceConfig=null,this._onDidChangeConfiguration.fire(e)}return Promise.resolve()}}t.SimpleConfigurationService=W;t.SimpleResourceConfigurationService=class{constructor(e){this.configurationService=e,this._onDidChangeConfiguration=new s.Emitter,this.configurationService.onDidChangeConfiguration(e=>{this._onDidChangeConfiguration.fire({affectedKeys:e.affectedKeys,affectsConfiguration:(t,i)=>e.affectsConfiguration(i)})})}getValue(e,t,i){ +const n=(v.Position.isIPosition(t)?t:null)?"string"==typeof i?i:void 0:"string"==typeof t?t:void 0;return void 0===n?this.configurationService.getValue():this.configurationService.getValue(n)}};let B=class{constructor(e){this.configurationService=e}getEOL(e,t){const i=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});return i&&"auto"!==i?i:h.isLinux||h.isMacintosh?"\n":"\r\n"}};B=a([l(0,w.IConfigurationService)],B),t.SimpleResourcePropertiesService=B;t.StandaloneTelemetryService=class{publicLog(e,t){return Promise.resolve(void 0)}publicLog2(e,t){return this.publicLog(e,t)}};class V{constructor(){const e=g.URI.from({scheme:V.SCHEME,authority:"model",path:"/"});this.workspace={id:"4064f6ec-cb38-4ad0-af64-ee6467e63c82",folders:[new I.WorkspaceFolder({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===V.SCHEME?this.workspace.folders[0]:null}}t.SimpleWorkspaceContextService=V,V.SCHEME="inmemory", +t.applyConfigurationValues=function(e,t,i){if(!t)return;if(!(e instanceof W))return;let n=[];Object.keys(t).forEach(e=>{f.isEditorConfigurationKey(e)&&n.push([`editor.${e}`,t[e]]),i&&f.isDiffEditorConfigurationKey(e)&&n.push([`diffEditor.${e}`,t[e]])}),n.length>0&&e.updateValues(n)};t.SimpleBulkEditService=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}apply(e,t){return r(this,void 0,void 0,(function*(){const t=new Map;for(let i of e){if(!(i instanceof m.ResourceTextEdit))throw new Error("bad edit - only text edits are supported");const e=this._modelService.getModel(i.resource);if(!e)throw new Error("bad edit - model not found");if("number"==typeof i.versionId&&e.getVersionId()!==i.versionId)throw new Error("bad state - model changed in the meantime");let n=t.get(e);n||(n=[],t.set(e,n)),n.push(_.EditOperation.replaceMove(C.Range.lift(i.textEdit.range),i.textEdit.text))}let n=0,o=0;for(const[e,i]of t)e.pushStackElement(),e.pushEditOperations([],i,()=>[]),e.pushStackElement(),o+=1, +n+=i.length;return{ariaSummary:i.format(M.SimpleServicesNLS.bulkEditServiceSummary,n,o)}}))}};t.SimpleUriLabelService=class{getUriLabel(e,t){return"file"===e.scheme?e.fsPath:e.path}};t.SimpleLayoutService=class{constructor(e,t){this._codeEditorService=e,this._container=t,this.onLayout=s.Event.None}get dimension(){return this._dimension||(this._dimension=n.getClientArea(window.document.body)),this._dimension}get container(){return this._container}focus(){var e;null===(e=this._codeEditorService.getFocusedCodeEditor())||void 0===e||e.focus()}}})),define(t[647],i([0,1,48,2,27,138,252,209,72,181,106,33,28,46,17,66,10,35,32,14,62,61,80,56]),(function(e,t,i,n,o,s,r,d,c,h,u,g,p,m,f,_,v,C,b,S,w,y,E,L){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StandaloneDiffEditor=t.StandaloneEditor=t.StandaloneCodeEditor=void 0;let x=0,D=!1;let k=class extends s.CodeEditorWidget{constructor(e,t,n,o,s,r,a,l,d,c){(t=t||{}).ariaLabel=t.ariaLabel||y.StandaloneCodeEditorNLS.editorViewAccessibleLabel, +t.ariaLabel=t.ariaLabel+";"+y.StandaloneCodeEditorNLS.accessibilityHelpMessage,super(e,t,{},n,o,s,r,l,d,c),a instanceof h.StandaloneKeybindingService?this._standaloneKeybindingService=a:this._standaloneKeybindingService=null,D||(D=!0,i.setARIAContainer(document.body))}addCommand(e,t,i){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;let n="DYNAMIC_"+ ++x,o=f.ContextKeyExpr.deserialize(i);return this._standaloneKeybindingService.addDynamicKeybinding(n,e,t,o),n}createContextKey(e,t){return this._contextKeyService.createKey(e,t)}addAction(e){if("string"!=typeof e.id||"string"!=typeof e.label||"function"!=typeof e.run)throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),n.Disposable.None +;const t=e.id,i=e.label,o=f.ContextKeyExpr.and(f.ContextKeyExpr.equals("editorId",this.getId()),f.ContextKeyExpr.deserialize(e.precondition)),s=e.keybindings,r=f.ContextKeyExpr.and(o,f.ContextKeyExpr.deserialize(e.keybindingContext)),a=e.contextMenuGroupId||null,l=e.contextMenuOrder||0,c=(t,...i)=>Promise.resolve(e.run(this,...i)),h=new n.DisposableStore,u=this.getId()+":"+t;if(h.add(p.CommandsRegistry.registerCommand(u,c)),a){let e={command:{id:u,title:i},when:o,group:a,order:l};h.add(g.MenuRegistry.appendMenuItem(g.MenuId.EditorContext,e))}if(Array.isArray(s))for(const e of s)h.add(this._standaloneKeybindingService.addDynamicKeybinding(u,e,c,r));let m=new d.InternalEditorAction(u,i,i,o,c,this._contextKeyService);return this._actions[t]=m,h.add(n.toDisposable(()=>{delete this._actions[t]})),h}};k=a([l(2,v.IInstantiationService),l(3,o.ICodeEditorService),l(4,p.ICommandService),l(5,f.IContextKeyService),l(6,C.IKeybindingService),l(7,S.IThemeService),l(8,b.INotificationService),l(9,w.IAccessibilityService)],k), +t.StandaloneCodeEditor=k;let N=class extends k{constructor(e,t,i,n,o,s,r,a,l,d,c,u,g){h.applyConfigurationValues(u,t,!1);const p=d.registerEditorContainer(e);"string"==typeof(t=t||{}).theme&&d.setTheme(t.theme);let m,f=t.model;if(delete t.model,super(e,t,n,o,s,r,a,d,c,g),this._contextViewService=l,this._configurationService=u,this._standaloneThemeService=d,this._register(i),this._register(p),void 0===f?(m=self.monaco.editor.createModel(t.value||"",t.language||"text/plain"),this._ownsModel=!0):(m=f,this._ownsModel=!1),this._attachModel(m),m){let e={oldModelUrl:null,newModelUrl:m.uri};this._onDidChangeModel.fire(e)}}dispose(){super.dispose()}updateOptions(e){h.applyConfigurationValues(this._configurationService,e,!1),"string"==typeof e.theme&&this._standaloneThemeService.setTheme(e.theme),super.updateOptions(e)}_attachModel(e){super._attachModel(e),this._modelData&&this._contextViewService.setContainer(this._modelData.view.domNode.domNode)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e), +e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};N=a([l(3,v.IInstantiationService),l(4,o.ICodeEditorService),l(5,p.ICommandService),l(6,f.IContextKeyService),l(7,C.IKeybindingService),l(8,_.IContextViewService),l(9,u.IStandaloneThemeService),l(10,b.INotificationService),l(11,m.IConfigurationService),l(12,w.IAccessibilityService)],N),t.StandaloneEditor=N;let I=class extends r.DiffEditorWidget{constructor(e,t,i,n,o,s,r,a,l,d,c,u,g,p,m){h.applyConfigurationValues(u,t,!0);const f=d.registerEditorContainer(e);"string"==typeof(t=t||{}).theme&&(t.theme=d.setTheme(t.theme)),super(e,t,m,a,o,n,l,d,c,g,p),this._contextViewService=r,this._configurationService=u,this._standaloneThemeService=d,this._register(i),this._register(f),this._contextViewService.setContainer(this._containerDomElement)}dispose(){super.dispose()}updateOptions(e){h.applyConfigurationValues(this._configurationService,e,!0),"string"==typeof e.theme&&this._standaloneThemeService.setTheme(e.theme),super.updateOptions(e)}_createInnerEditor(e,t,i){ +return e.createInstance(k,t,i)}getOriginalEditor(){return super.getOriginalEditor()}getModifiedEditor(){return super.getModifiedEditor()}addCommand(e,t,i){return this.getModifiedEditor().addCommand(e,t,i)}createContextKey(e,t){return this.getModifiedEditor().createContextKey(e,t)}addAction(e){return this.getModifiedEditor().addAction(e)}};I=a([l(3,v.IInstantiationService),l(4,f.IContextKeyService),l(5,C.IKeybindingService),l(6,_.IContextViewService),l(7,c.IEditorWorkerService),l(8,o.ICodeEditorService),l(9,u.IStandaloneThemeService),l(10,b.INotificationService),l(11,m.IConfigurationService),l(12,_.IContextMenuService),l(13,L.IEditorProgressService),l(14,E.IClipboardService)],I),t.StandaloneDiffEditor=I})), +define(t[262],i([0,1,2,127,27,72,240,73,546,44,257,130,181,629,631,106,33,28,46,549,17,632,66,534,173,10,529,131,35,132,141,81,537,82,32,56,76,84,14,180,528,231,599,62,133,71,547,80,505,142,642,634,75,179]),(function(e,t,i,n,o,s,r,a,l,d,c,h,u,g,p,m,f,_,v,C,b,S,w,y,E,L,x,D,k,N,I,M,R,T,O,A,P,F,W,B,V,z,H,K,U,$,j,q,G,Y,Z,X,Q,J){"use strict";var ee;Object.defineProperty(t,"__esModule",{value:!0}),t.DynamicStandaloneServices=t.StaticServices=void 0,function(e){const t=new D.ServiceCollection;class i{constructor(e,t){this._serviceId=e,this._factory=t,this._value=null}get id(){return this._serviceId}get(e){if(!this._value){if(e&&(this._value=e[this._serviceId.toString()]),this._value||(this._value=this._factory(e)),!this._value)throw new Error("Service "+this._serviceId+" is missing!");t.set(this._serviceId,this._value)}return this._value}}e.LazyStaticService=i;let n=[];function f(e,t){let o=new i(e,t);return n.push(o),o}e.init=function(e){let t=new D.ServiceCollection +;for(const[e,i]of $.getSingletonServiceDescriptors())t.set(e,i);for(let i in e)e.hasOwnProperty(i)&&t.set(L.createDecorator(i),e[i]);n.forEach(i=>t.set(i.id,i.get(e)));let i=new x.InstantiationService(t,!0);return t.set(L.IInstantiationService,i),[t,i]},e.instantiationService=f(L.IInstantiationService,()=>new x.InstantiationService(t,!0));const _=new u.SimpleConfigurationService;e.configurationService=f(v.IConfigurationService,()=>_),e.resourceConfigurationService=f(h.ITextResourceConfigurationService,()=>new u.SimpleResourceConfigurationService(_)),e.resourcePropertiesService=f(h.ITextResourcePropertiesService,()=>new u.SimpleResourcePropertiesService(_)),e.contextService=f(B.IWorkspaceContextService,()=>new u.SimpleWorkspaceContextService),e.labelService=f(N.ILabelService,()=>new u.SimpleUriLabelService),e.telemetryService=f(F.ITelemetryService,()=>new u.StandaloneTelemetryService),e.dialogService=f(E.IDialogService,()=>new u.SimpleDialogService), +e.notificationService=f(O.INotificationService,()=>new u.SimpleNotificationService),e.markerService=f(T.IMarkerService,()=>new R.MarkerService),e.modeService=f(a.IModeService,e=>new l.ModeServiceImpl),e.standaloneThemeService=f(m.IStandaloneThemeService,()=>new p.StandaloneThemeServiceImpl),e.logService=f(M.ILogService,()=>new M.ConsoleLogService),e.undoRedoService=f(Y.IUndoRedoService,t=>new Z.UndoRedoService(e.dialogService.get(t),e.notificationService.get(t))),e.modelService=f(d.IModelService,t=>new c.ModelServiceImpl(e.configurationService.get(t),e.resourcePropertiesService.get(t),e.standaloneThemeService.get(t),e.logService.get(t),e.undoRedoService.get(t))),e.markerDecorationsService=f(z.IMarkerDecorationsService,t=>new H.MarkerDecorationsService(e.modelService.get(t),e.markerService.get(t))),e.codeEditorService=f(o.ICodeEditorService,t=>new g.StandaloneCodeEditorServiceImpl(e.standaloneThemeService.get(t))),e.editorProgressService=f(A.IEditorProgressService,()=>new u.SimpleEditorProgressService), +e.storageService=f(P.IStorageService,()=>new P.InMemoryStorageService),e.storageSyncService=f(J.IStorageKeysSyncRegistryService,()=>new J.StorageKeysSyncRegistryService),e.editorWorkerService=f(s.IEditorWorkerService,t=>new r.EditorWorkerServiceImpl(e.modelService.get(t),e.resourceConfigurationService.get(t),e.logService.get(t)))}(ee=t.StaticServices||(t.StaticServices={}));class te extends i.Disposable{constructor(e,t){super();const[i,s]=ee.init(t);this._serviceCollection=i,this._instantiationService=s;const r=this.get(v.IConfigurationService),a=this.get(O.INotificationService),l=this.get(F.ITelemetryService),c=this.get(W.IThemeService),h=this.get(M.ILogService);let g=(e,i)=>{let n=null;return t&&(n=t[e.toString()]),n||(n=i()),this._serviceCollection.set(e,n),n},p=g(b.IContextKeyService,()=>this._register(new C.ContextKeyService(r)));g(K.IAccessibilityService,()=>new j.AccessibilityService(p,r)),g(I.IListService,()=>new I.ListService(c)) +;let m=g(_.ICommandService,()=>new u.StandaloneCommandService(this._instantiationService)),E=g(k.IKeybindingService,()=>this._register(new u.StandaloneKeybindingService(p,m,l,a,h,e))),L=g(U.ILayoutService,()=>new u.SimpleLayoutService(ee.codeEditorService.get(o.ICodeEditorService),e));g(Q.IQuickInputService,()=>new X.StandaloneQuickInputServiceImpl(s,ee.codeEditorService.get(o.ICodeEditorService)));let x=g(w.IContextViewService,()=>this._register(new y.ContextViewService(L)));g(q.IClipboardService,()=>new G.BrowserClipboardService),g(w.IContextMenuService,()=>{const e=new S.ContextMenuService(l,a,x,E,c);return e.configure({blockMouse:!1}),this._register(e)}),g(f.IMenuService,()=>new V.MenuService(m)),g(n.IBulkEditService,()=>new u.SimpleBulkEditService(ee.modelService.get(d.IModelService)))}get(e){let t=this._serviceCollection.get(e);if(!t)throw new Error("Missing service "+e);return t}set(e,t){this._serviceCollection.set(e,t)}has(e){return this._serviceCollection.has(e)}}t.DynamicStandaloneServices=te})), +define(t[648],i([0,1,27,538,206,38,156,100,52,18,74,72,92,535,161,523,181,647,262,106,28,46,17,66,10,35,32,55,62,67,56,80,351]),(function(e,t,i,n,o,s,r,a,l,d,c,h,u,g,p,m,f,_,v,C,b,S,w,y,E,L,x,D,k,N,I,M){"use strict";function R(e,t,o){let s=new v.DynamicStandaloneServices(e,t),r=null;s.has(u.ITextModelService)||(r=new f.SimpleEditorModelResolverService(v.StaticServices.modelService.get()),s.set(u.ITextModelService,r)),s.has(D.IOpenerService)||s.set(D.IOpenerService,new n.OpenerService(s.get(i.ICodeEditorService),s.get(b.ICommandService)));let a=o(s);return r&&r.setEditor(a),a}function T(e,t,n){return R(e,n||{},n=>new _.StandaloneEditor(e,t,n,n.get(E.IInstantiationService),n.get(i.ICodeEditorService),n.get(b.ICommandService),n.get(w.IContextKeyService),n.get(L.IKeybindingService),n.get(y.IContextViewService),n.get(C.IStandaloneThemeService),n.get(x.INotificationService),n.get(S.IConfigurationService),n.get(k.IAccessibilityService)))}function O(e){ +return v.StaticServices.codeEditorService.get().onCodeEditorAdd(t=>{e(t)})}function A(e,t,n){return R(e,n||{},n=>new _.StandaloneDiffEditor(e,t,n,n.get(E.IInstantiationService),n.get(w.IContextKeyService),n.get(L.IKeybindingService),n.get(y.IContextViewService),n.get(h.IEditorWorkerService),n.get(i.ICodeEditorService),n.get(C.IStandaloneThemeService),n.get(x.INotificationService),n.get(S.IConfigurationService),n.get(y.IContextMenuService),n.get(I.IEditorProgressService),n.get(M.IClipboardService)))}function P(e,t){return new o.DiffNavigator(e,t)}function F(e,t,i){return v.StaticServices.modelService.get().createModel(e,t,i)}function W(e,t,i){if(e=e||"",!t){let t=e.indexOf("\n"),n=e;return-1!==t&&(n=e.substring(0,t)),F(e,v.StaticServices.modeService.get().createByFilepathOrFirstLine(i||null,n),i)}return F(e,v.StaticServices.modeService.get().create(t),i)}function B(e,t){v.StaticServices.modelService.get().setMode(e,v.StaticServices.modeService.get().create(t))}function V(e,t,i){ +e&&v.StaticServices.markerService.get().changeOne(t,e.uri,i)}function z(e){return v.StaticServices.markerService.get().read(e)}function H(e){return v.StaticServices.modelService.get().getModel(e)}function K(){return v.StaticServices.modelService.get().getModels()}function U(e){return v.StaticServices.modelService.get().onModelAdded(e)}function $(e){return v.StaticServices.modelService.get().onModelRemoved(e)}function j(e){return v.StaticServices.modelService.get().onModelModeChanged(t=>{e({model:t.model,oldLanguage:t.oldModeId})})}function q(e){return g.createWebWorker(v.StaticServices.modelService.get(),e)}function G(e,t){const i=v.StaticServices.standaloneThemeService.get();return i.registerEditorContainer(e),m.Colorizer.colorizeElement(i,v.StaticServices.modeService.get(),e,t)}function Y(e,t,i){return v.StaticServices.standaloneThemeService.get().registerEditorContainer(document.body),m.Colorizer.colorize(v.StaticServices.modeService.get(),e,t,i)}function Z(e,t,i=4){ +return v.StaticServices.standaloneThemeService.get().registerEditorContainer(document.body),m.Colorizer.colorizeModelLine(e,t,i)}function X(e,t){v.StaticServices.modeService.get().triggerMode(t);let i=function(e){let t=d.TokenizationRegistry.get(e);return t||{getInitialState:()=>c.NULL_STATE,tokenize:(t,i,n)=>c.nullTokenize(e,t,i,n)}}(t),n=e.split(/\r\n|\r|\n/),o=[],s=i.getInitialState();for(let e=0,t=n.length;e{n.getId()===e&&(i.dispose(),t())});return i}function m(e,t){let i=l.StaticServices.modeService.get().getLanguageIdentifier(e);if(!i)throw new Error(`Cannot set configuration for unknown language ${e}`);return s.LanguageConfigurationRegistry.register(i,t)}Object.defineProperty(t,"__esModule",{value:!0}), +t.createMonacoLanguagesAPI=t.registerDocumentRangeSemanticTokensProvider=t.registerDocumentSemanticTokensProvider=t.registerSelectionRangeProvider=t.registerDeclarationProvider=t.registerFoldingRangeProvider=t.registerColorProvider=t.registerCompletionItemProvider=t.registerLinkProvider=t.registerOnTypeFormattingEditProvider=t.registerDocumentRangeFormattingEditProvider=t.registerDocumentFormattingEditProvider=t.registerCodeActionProvider=t.registerCodeLensProvider=t.registerTypeDefinitionProvider=t.registerImplementationProvider=t.registerDefinitionProvider=t.registerOnTypeRenameProvider=t.registerDocumentHighlightProvider=t.registerDocumentSymbolProvider=t.registerHoverProvider=t.registerSignatureHelpProvider=t.registerRenameProvider=t.registerReferenceProvider=t.setMonarchTokensProvider=t.setTokensProvider=t.TokenizationSupport2Adapter=t.EncodedTokenizationSupport2Adapter=t.setLanguageConfiguration=t.onLanguage=t.getEncodedLanguageId=t.getLanguages=t.register=void 0,t.register=h,t.getLanguages=u, +t.getEncodedLanguageId=g,t.onLanguage=p,t.setLanguageConfiguration=m;class f{constructor(e){this._actual=e}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i){throw new Error("Not supported!")}tokenize2(e,t){let i=this._actual.tokenizeEncoded(e,t);return new n.TokenizationResult2(i.tokens,i.endState)}}t.EncodedTokenizationSupport2Adapter=f;class _{constructor(e,t,i){this._standaloneThemeService=e,this._languageIdentifier=t,this._actual=i}getInitialState(){return this._actual.getInitialState()}_toClassicTokens(e,t,i){let o=[],s=0;for(let r=0,a=e.length;r0&&o[s-1]===d)continue;let c=l.startIndex;0===a?c=0:c(function(e){return"tokenizeEncoded"in e})(e)?new f(e):new _(l.StaticServices.standaloneThemeService.get(),i,e);return v(t)?o.TokenizationRegistry.registerPromise(e,t.then(e=>n(e))):o.TokenizationRegistry.register(e,n(t))}function b(e,t){const i=t=>c.createTokenizationSupport(l.StaticServices.modeService.get(),l.StaticServices.standaloneThemeService.get(),e,d.compile(e,t)) +;return v(t)?o.TokenizationRegistry.registerPromise(e,t.then(e=>i(e))):o.TokenizationRegistry.register(e,i(t))}function S(e,t){return o.ReferenceProviderRegistry.register(e,t)}function w(e,t){return o.RenameProviderRegistry.register(e,t)}function y(e,t){return o.SignatureHelpProviderRegistry.register(e,t)}function E(e,t){return o.HoverProviderRegistry.register(e,{provideHover:(e,n,o)=>{let s=e.getWordAtPosition(n);return Promise.resolve(t.provideHover(e,n,o)).then(e=>{if(e)return!e.range&&s&&(e.range=new i.Range(n.lineNumber,s.startColumn,n.lineNumber,s.endColumn)),e.range||(e.range=new i.Range(n.lineNumber,n.column,n.lineNumber,n.column)),e})}})}function L(e,t){return o.DocumentSymbolProviderRegistry.register(e,t)}function x(e,t){return o.DocumentHighlightProviderRegistry.register(e,t)}function D(e,t){return o.OnTypeRenameProviderRegistry.register(e,t)}function k(e,t){return o.DefinitionProviderRegistry.register(e,t)}function N(e,t){return o.ImplementationProviderRegistry.register(e,t)}function I(e,t){ +return o.TypeDefinitionProviderRegistry.register(e,t)}function M(e,t){return o.CodeLensProviderRegistry.register(e,t)}function R(e,t){return o.CodeActionProviderRegistry.register(e,{provideCodeActions:(e,n,o,s)=>{let r=l.StaticServices.markerService.get().read({resource:e.uri}).filter(e=>i.Range.areIntersectingOrTouching(e,n));return t.provideCodeActions(e,n,{markers:r,only:o.only},s)}})}function T(e,t){return o.DocumentFormattingEditProviderRegistry.register(e,t)}function O(e,t){return o.DocumentRangeFormattingEditProviderRegistry.register(e,t)}function A(e,t){return o.OnTypeFormattingEditProviderRegistry.register(e,t)}function P(e,t){return o.LinkProviderRegistry.register(e,t)}function F(e,t){return o.CompletionProviderRegistry.register(e,t)}function W(e,t){return o.ColorProviderRegistry.register(e,t)}function B(e,t){return o.FoldingRangeProviderRegistry.register(e,t)}function V(e,t){return o.DeclarationProviderRegistry.register(e,t)}function z(e,t){return o.SelectionRangeRegistry.register(e,t)} +function H(e,t){return o.DocumentSemanticTokensProviderRegistry.register(e,t)}function K(e,t){return o.DocumentRangeSemanticTokensProviderRegistry.register(e,t)}t.TokenizationSupport2Adapter=_,t.setTokensProvider=C,t.setMonarchTokensProvider=b,t.registerReferenceProvider=S,t.registerRenameProvider=w,t.registerSignatureHelpProvider=y,t.registerHoverProvider=E,t.registerDocumentSymbolProvider=L,t.registerDocumentHighlightProvider=x,t.registerOnTypeRenameProvider=D,t.registerDefinitionProvider=k,t.registerImplementationProvider=N,t.registerTypeDefinitionProvider=I,t.registerCodeLensProvider=M,t.registerCodeActionProvider=R,t.registerDocumentFormattingEditProvider=T,t.registerDocumentRangeFormattingEditProvider=O,t.registerOnTypeFormattingEditProvider=A,t.registerLinkProvider=P,t.registerCompletionItemProvider=F,t.registerColorProvider=W,t.registerFoldingRangeProvider=B,t.registerDeclarationProvider=V,t.registerSelectionRangeProvider=z,t.registerDocumentSemanticTokensProvider=H, +t.registerDocumentRangeSemanticTokensProvider=K,t.createMonacoLanguagesAPI=function(){return{register:h,getLanguages:u,onLanguage:p,getEncodedLanguageId:g,setLanguageConfiguration:m,setTokensProvider:C,setMonarchTokensProvider:b,registerReferenceProvider:S,registerRenameProvider:w,registerCompletionItemProvider:F,registerSignatureHelpProvider:y,registerHoverProvider:E,registerDocumentSymbolProvider:L,registerDocumentHighlightProvider:x,registerOnTypeRenameProvider:D,registerDefinitionProvider:k,registerImplementationProvider:N,registerTypeDefinitionProvider:I,registerCodeLensProvider:M,registerCodeActionProvider:R,registerDocumentFormattingEditProvider:T,registerDocumentRangeFormattingEditProvider:O,registerOnTypeFormattingEditProvider:A,registerLinkProvider:P,registerColorProvider:W,registerFoldingRangeProvider:B,registerDeclarationProvider:V,registerSelectionRangeProvider:z,registerDocumentSemanticTokensProvider:H,registerDocumentRangeSemanticTokensProvider:K,DocumentHighlightKind:a.DocumentHighlightKind, +CompletionItemKind:a.CompletionItemKind,CompletionItemTag:a.CompletionItemTag,CompletionItemInsertTextRule:a.CompletionItemInsertTextRule,SymbolKind:a.SymbolKind,SymbolTag:a.SymbolTag,IndentAction:a.IndentAction,CompletionTriggerKind:a.CompletionTriggerKind,SignatureHelpTriggerKind:a.SignatureHelpTriggerKind,FoldingRangeKind:o.FoldingRangeKind}}})),define(t[650],i([0,1,38,212,648,649]),(function(e,t,i,n,o,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.languages=t.editor=t.Token=t.Uri=t.MarkerTag=t.MarkerSeverity=t.SelectionDirection=t.Selection=t.Range=t.Position=t.KeyMod=t.KeyCode=t.Emitter=t.CancellationTokenSource=void 0;const r=self;i.EditorOptions.wrappingIndent.defaultValue=0,i.EditorOptions.glyphMargin.defaultValue=!1,i.EditorOptions.autoIndent.defaultValue=3,i.EditorOptions.overviewRulerLanes.defaultValue=2;const a=n.createMonacoBaseAPI();a.editor=o.createMonacoEditorAPI(),a.languages=s.createMonacoLanguagesAPI(),t.CancellationTokenSource=a.CancellationTokenSource, +t.Emitter=a.Emitter,t.KeyCode=a.KeyCode,t.KeyMod=a.KeyMod,t.Position=a.Position,t.Range=a.Range,t.Selection=a.Selection,t.SelectionDirection=a.SelectionDirection,t.MarkerSeverity=a.MarkerSeverity,t.MarkerTag=a.MarkerTag,t.Uri=a.Uri,t.Token=a.Token,t.editor=a.editor,t.languages=a.languages,r.monaco=a,void 0!==r.require&&"function"==typeof r.require.config&&r.require.config({ignoreDuplicateModules:["vscode-languageserver-types","vscode-languageserver-types/main","vscode-languageserver-textdocument","vscode-languageserver-textdocument/main","vscode-nls","vscode-nls/vscode-nls","jsonc-parser","jsonc-parser/main","vscode-uri","vscode-uri/index","vs/basic-languages/typescript/typescript"]})})),define(t[651],i([0,1,24]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toWorkspaceIdentifier=t.isSingleFolderWorkspaceIdentifier=t.WORKSPACE_EXTENSION=void 0,t.WORKSPACE_EXTENSION="code-workspace",t.isSingleFolderWorkspaceIdentifier=function(e){return e instanceof i.URI}, +t.toWorkspaceIdentifier=function(e){return e.configuration?{configPath:e.configuration,id:e.id}:1===e.folders.length?e.folders[0].uri:void 0}})),define(t[652],i([0,1,489,63,41,125,42,8,651,151]),(function(e,t,i,n,o,s,r,a,l,d){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RandomBasedVariableResolver=t.WorkspaceBasedVariableResolver=t.TimeBasedVariableResolver=t.CommentBasedVariableResolver=t.ClipboardBasedVariableResolver=t.ModelBasedVariableResolver=t.SelectionBasedVariableResolver=t.CompositeSnippetVariableResolver=void 0;t.CompositeSnippetVariableResolver=class{constructor(e){this._delegates=e}resolve(e){for(const t of this._delegates){let i=t.resolve(e);if(void 0!==i)return i}}};t.SelectionBasedVariableResolver=class{constructor(e,t,i,n){this._model=e,this._selection=t,this._selectionIdx=i,this._overtypingCapturer=n}resolve(e){const{name:t}=e;if("SELECTION"===t||"TM_SELECTED_TEXT"===t){ +let t=this._model.getValueInRange(this._selection)||void 0,i=this._selection.startLineNumber!==this._selection.endLineNumber;if(!t&&this._overtypingCapturer){const e=this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);e&&(t=e.value,i=e.multiline)}if(t&&i&&e.snippet){const i=this._model.getLineContent(this._selection.startLineNumber),n=a.getLeadingWhitespace(i,0,this._selection.startColumn-1);let o=n;e.snippet.walk(t=>t!==e&&(t instanceof s.Text&&(o=a.getLeadingWhitespace(t.value.split(/\r\n|\r|\n/).pop())),!0));const r=a.commonPrefixLength(o,n);t=t.replace(/(\r\n|\r|\n)(.*)/g,(e,t,i)=>`${t}${o.substr(r)}${i}`)}return t}if("TM_CURRENT_LINE"===t)return this._model.getLineContent(this._selection.positionLineNumber);if("TM_CURRENT_WORD"===t){const e=this._model.getWordAtPosition({lineNumber:this._selection.positionLineNumber,column:this._selection.positionColumn});return e&&e.word||void 0} +return"TM_LINE_INDEX"===t?String(this._selection.positionLineNumber-1):"TM_LINE_NUMBER"===t?String(this._selection.positionLineNumber):void 0}};t.ModelBasedVariableResolver=class{constructor(e,t){this._labelService=e,this._model=t}resolve(e){const{name:t}=e;if("TM_FILENAME"===t)return n.basename(this._model.uri.fsPath);if("TM_FILENAME_BASE"===t){const e=n.basename(this._model.uri.fsPath),t=e.lastIndexOf(".");return t<=0?e:e.slice(0,t)}return"TM_DIRECTORY"===t&&this._labelService?"."===n.dirname(this._model.uri.fsPath)?"":this._labelService.getUriLabel(o.dirname(this._model.uri)):"TM_FILEPATH"===t&&this._labelService?this._labelService.getUriLabel(this._model.uri):void 0}};t.ClipboardBasedVariableResolver=class{constructor(e,t,i,n){this._readClipboardText=e,this._selectionIdx=t,this._selectionCount=i,this._spread=n}resolve(e){if("CLIPBOARD"!==e.name)return;const t=this._readClipboardText();if(t){if(this._spread){const e=t.split(/\r\n|\n|\r/).filter(e=>!a.isFalsyOrWhitespace(e)) +;if(e.length===this._selectionCount)return e[this._selectionIdx]}return t}}};t.CommentBasedVariableResolver=class{constructor(e,t){this._model=e,this._selection=t}resolve(e){const{name:t}=e,i=this._model.getLanguageIdAtPosition(this._selection.selectionStartLineNumber,this._selection.selectionStartColumn),n=r.LanguageConfigurationRegistry.getComments(i);if(n)return"LINE_COMMENT"===t?n.lineCommentToken||void 0:"BLOCK_COMMENT_START"===t?n.blockCommentStartToken||void 0:"BLOCK_COMMENT_END"===t&&n.blockCommentEndToken||void 0}};class c{resolve(e){const{name:t}=e +;return"CURRENT_YEAR"===t?String((new Date).getFullYear()):"CURRENT_YEAR_SHORT"===t?String((new Date).getFullYear()).slice(-2):"CURRENT_MONTH"===t?String((new Date).getMonth().valueOf()+1).padStart(2,"0"):"CURRENT_DATE"===t?String((new Date).getDate().valueOf()).padStart(2,"0"):"CURRENT_HOUR"===t?String((new Date).getHours().valueOf()).padStart(2,"0"):"CURRENT_MINUTE"===t?String((new Date).getMinutes().valueOf()).padStart(2,"0"):"CURRENT_SECOND"===t?String((new Date).getSeconds().valueOf()).padStart(2,"0"):"CURRENT_DAY_NAME"===t?c.dayNames[(new Date).getDay()]:"CURRENT_DAY_NAME_SHORT"===t?c.dayNamesShort[(new Date).getDay()]:"CURRENT_MONTH_NAME"===t?c.monthNames[(new Date).getMonth()]:"CURRENT_MONTH_NAME_SHORT"===t?c.monthNamesShort[(new Date).getMonth()]:"CURRENT_SECONDS_UNIX"===t?String(Math.floor(Date.now()/1e3)):void 0}}t.TimeBasedVariableResolver=c,c.dayNames=[i.localize(0,null),i.localize(1,null),i.localize(2,null),i.localize(3,null),i.localize(4,null),i.localize(5,null),i.localize(6,null)], +c.dayNamesShort=[i.localize(7,null),i.localize(8,null),i.localize(9,null),i.localize(10,null),i.localize(11,null),i.localize(12,null),i.localize(13,null)],c.monthNames=[i.localize(14,null),i.localize(15,null),i.localize(16,null),i.localize(17,null),i.localize(18,null),i.localize(19,null),i.localize(20,null),i.localize(21,null),i.localize(22,null),i.localize(23,null),i.localize(24,null),i.localize(25,null)],c.monthNamesShort=[i.localize(26,null),i.localize(27,null),i.localize(28,null),i.localize(29,null),i.localize(30,null),i.localize(31,null),i.localize(32,null),i.localize(33,null),i.localize(34,null),i.localize(35,null),i.localize(36,null),i.localize(37,null)];t.WorkspaceBasedVariableResolver=class{constructor(e){this._workspaceService=e}resolve(e){if(!this._workspaceService)return;const t=l.toWorkspaceIdentifier(this._workspaceService.getWorkspace());return t?"WORKSPACE_NAME"===e.name?this._resolveWorkspaceName(t):"WORKSPACE_FOLDER"===e.name?this._resoveWorkspacePath(t):void 0:void 0} +_resolveWorkspaceName(e){if(l.isSingleFolderWorkspaceIdentifier(e))return n.basename(e.path);let t=n.basename(e.configPath.path);return t.endsWith(l.WORKSPACE_EXTENSION)&&(t=t.substr(0,t.length-l.WORKSPACE_EXTENSION.length-1)),t}_resoveWorkspacePath(e){if(l.isSingleFolderWorkspaceIdentifier(e))return d.normalizeDriveLetter(e.fsPath);let t=n.basename(e.configPath.path),i=e.configPath.fsPath;return i.endsWith(t)&&(i=i.substr(0,i.length-t.length-1)),i?d.normalizeDriveLetter(i):"/"}};t.RandomBasedVariableResolver=class{resolve(e){const{name:t}=e;return"RANDOM"===t?Math.random().toString().slice(-6):"RANDOM_HEX"===t?Math.random().toString(16).slice(-6):void 0}}})),define(t[653],i([0,1,19,2,8,60,3,20,31,180,10,125,652,14,21,132,343]),(function(e,t,i,n,o,s,r,a,l,d,c,h,u,g,p,m){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SnippetSession=t.OneSnippet=void 0,g.registerThemingParticipant((e,t)=>{function i(t){const i=e.getColor(t);return i?i.toString():"transparent"} +t.addRule(`.monaco-editor .snippet-placeholder { background-color: ${i(p.snippetTabstopHighlightBackground)}; outline-color: ${i(p.snippetTabstopHighlightBorder)}; }`),t.addRule(`.monaco-editor .finish-snippet-placeholder { background-color: ${i(p.snippetFinalTabstopHighlightBackground)}; outline-color: ${i(p.snippetFinalTabstopHighlightBorder)}; }`)});class f{constructor(e,t,n){this._nestingLevel=1,this._editor=e,this._snippet=t,this._offset=n,this._placeholderGroups=i.groupBy(t.placeholders,h.Placeholder.compareByIndex),this._placeholderGroupsIdx=-1}dispose(){this._placeholderDecorations&&this._editor.deltaDecorations([...this._placeholderDecorations.values()],[]),this._placeholderGroups.length=0}_initDecorations(){if(this._placeholderDecorations)return;this._placeholderDecorations=new Map;const e=this._editor.getModel();this._editor.changeDecorations(t=>{for(const i of this._snippet.placeholders){ +const n=this._snippet.offset(i),o=this._snippet.fullLen(i),s=r.Range.fromPositions(e.getPositionAt(this._offset+n),e.getPositionAt(this._offset+n+o)),a=i.isFinalTabstop?f._decor.inactiveFinal:f._decor.inactive,l=t.addDecoration(s,a);this._placeholderDecorations.set(i,l)}})}move(e){if(!this._editor.hasModel())return[];if(this._initDecorations(),this._placeholderGroupsIdx>=0){let e=[];for(const t of this._placeholderGroups[this._placeholderGroupsIdx])if(t.transform){const i=this._placeholderDecorations.get(t),n=this._editor.getModel().getDecorationRange(i),o=this._editor.getModel().getValueInRange(n);e.push(s.EditOperation.replaceMove(n,t.transform.resolve(o)))}e.length>0&&this._editor.executeEdits("snippet.placeholderTransform",e)}let t=!1;!0===e&&this._placeholderGroupsIdx0&&(this._placeholderGroupsIdx-=1,t=!0);const i=this._editor.getModel().changeDecorations(e=>{const i=new Set,n=[] +;for(const o of this._placeholderGroups[this._placeholderGroupsIdx]){const s=this._placeholderDecorations.get(o),r=this._editor.getModel().getDecorationRange(s);n.push(new a.Selection(r.startLineNumber,r.startColumn,r.endLineNumber,r.endColumn)),t=t&&this._hasPlaceholderBeenCollapsed(o),e.changeDecorationOptions(s,o.isFinalTabstop?f._decor.activeFinal:f._decor.active),i.add(o);for(const t of this._snippet.enclosingPlaceholders(o)){const n=this._placeholderDecorations.get(t);e.changeDecorationOptions(n,t.isFinalTabstop?f._decor.activeFinal:f._decor.active),i.add(t)}}for(const[t,n]of this._placeholderDecorations)i.has(t)||e.changeDecorationOptions(n,t.isFinalTabstop?f._decor.inactiveFinal:f._decor.inactive);return n});return t?this.move(e):null!=i?i:[]}_hasPlaceholderBeenCollapsed(e){let t=e;for(;t;){if(t instanceof h.Placeholder){const e=this._placeholderDecorations.get(t);if(this._editor.getModel().getDecorationRange(e).isEmpty()&&t.toString().length>0)return!0}t=t.parent}return!1}get isAtFirstPlaceholder(){ +return this._placeholderGroupsIdx<=0||0===this._placeholderGroups.length}get isAtLastPlaceholder(){return this._placeholderGroupsIdx===this._placeholderGroups.length-1}get hasPlaceholder(){return this._snippet.placeholders.length>0}computePossibleSelections(){const e=new Map;for(const t of this._placeholderGroups){let i;for(const n of t){if(n.isFinalTabstop)break;i||(i=[],e.set(n.index,i));const t=this._placeholderDecorations.get(n),o=this._editor.getModel().getDecorationRange(t);if(!o){e.delete(n.index);break}i.push(o)}}return e}get choice(){return this._placeholderGroups[this._placeholderGroupsIdx][0].choice}merge(e){const t=this._editor.getModel();this._nestingLevel*=10,this._editor.changeDecorations(n=>{for(const i of this._placeholderGroups[this._placeholderGroupsIdx]){const o=e.shift();console.assert(!o._placeholderDecorations);const s=o._snippet.placeholderInfo.last.index +;for(const e of o._snippet.placeholderInfo.all)e.isFinalTabstop?e.index=i.index+(s+1)/this._nestingLevel:e.index=i.index+e.index/this._nestingLevel;this._snippet.replace(i,o._snippet.children);const a=this._placeholderDecorations.get(i);n.removeDecoration(a),this._placeholderDecorations.delete(i);for(const e of o._snippet.placeholders){const i=o._snippet.offset(e),s=o._snippet.fullLen(e),a=r.Range.fromPositions(t.getPositionAt(o._offset+i),t.getPositionAt(o._offset+i+s)),l=n.addDecoration(a,f._decor.inactive);this._placeholderDecorations.set(e,l)}}this._placeholderGroups=i.groupBy(this._snippet.placeholders,h.Placeholder.compareByIndex)})}}t.OneSnippet=f,f._decor={active:l.ModelDecorationOptions.register({stickiness:0,className:"snippet-placeholder"}),inactive:l.ModelDecorationOptions.register({stickiness:1,className:"snippet-placeholder"}),activeFinal:l.ModelDecorationOptions.register({stickiness:1,className:"finish-snippet-placeholder"}),inactiveFinal:l.ModelDecorationOptions.register({stickiness:1, +className:"finish-snippet-placeholder"})};const _={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};class v{constructor(e,t,i=_){this._templateMerges=[],this._snippets=[],this._editor=e,this._template=t,this._options=i}static adjustWhitespace(e,t,i,n,s){const r=e.getLineContent(t.lineNumber),a=o.getLeadingWhitespace(r,0,t.column-1);i.walk(t=>{if(t instanceof h.Text&&!(t.parent instanceof h.Choice)){const i=t.value.split(/\r\n|\r|\n/);if(n)for(let t=1;te.get(d.IWorkspaceContextService,c.optional)),S=e.invokeWithinContext(e=>new u.ModelBasedVariableResolver(e.get(m.ILabelService,c.optional),C)),w=()=>l;let y=0,E=C.getValueInRange(v.adjustSelection(C,e.getSelection(),i,0)),L=C.getValueInRange(v.adjustSelection(C,e.getSelection(),0,n)),x=C.getLineFirstNonWhitespaceColumn(e.getSelection().positionLineNumber);const D=e.getSelections().map((e,t)=>({selection:e,idx:t})).sort((e,t)=>r.Range.compareRangesUsingStarts(e.selection,t.selection));for(const{selection:r,idx:l}of D){let d=v.adjustSelection(C,r,i,0),c=v.adjustSelection(C,r,0,n);E!==C.getValueInRange(d)&&(d=r),L!==C.getValueInRange(c)&&(c=r);const m=r.setStartPosition(d.startLineNumber,d.startColumn).setEndPosition(c.endLineNumber,c.endColumn),k=(new h.SnippetParser).parse(t,!0,o),N=m.getStartPosition() +;v.adjustWhitespace(C,N,k,a||l>0&&x!==C.getLineFirstNonWhitespaceColumn(r.positionLineNumber),!0),k.resolveVariables(new u.CompositeSnippetVariableResolver([S,new u.ClipboardBasedVariableResolver(w,l,D.length,"spread"===e.getOption(62)),new u.SelectionBasedVariableResolver(C,r,l,g),new u.CommentBasedVariableResolver(C,r),new u.TimeBasedVariableResolver,new u.WorkspaceBasedVariableResolver(b),new u.RandomBasedVariableResolver]));const I=C.getOffsetAt(N)+y;y+=k.toString().length-C.getValueLengthInRange(m),p[l]=s.EditOperation.replace(m,k.toString()),p[l].identifier={major:l,minor:0},_[l]=new f(e,k,I)}return{edits:p,snippets:_}}dispose(){n.dispose(this._snippets)}_logInfo(){return`template="${this._template}", merged_templates="${this._templateMerges.join(" -> ")}"`}insert(){if(!this._editor.hasModel())return +;const{edits:e,snippets:t}=v.createEditsAndSnippets(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer);this._snippets=t,this._editor.executeEdits("snippet",e,e=>this._snippets[0].hasPlaceholder?this._move(!0):e.filter(e=>!!e.identifier).map(e=>a.Selection.fromPositions(e.range.getEndPosition()))),this._editor.revealRange(this._editor.getSelections()[0])}merge(e,t=_){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,e]);const{edits:i,snippets:n}=v.createEditsAndSnippets(this._editor,e,t.overwriteBefore,t.overwriteAfter,!0,t.adjustWhitespace,t.clipboardText,t.overtypingCapturer);this._editor.executeEdits("snippet",i,e=>{for(const e of this._snippets)e.merge(n);return console.assert(0===n.length), +this._snippets[0].hasPlaceholder?this._move(void 0):e.filter(e=>!!e.identifier).map(e=>a.Selection.fromPositions(e.range.getEndPosition()))})}next(){const e=this._move(!0);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}prev(){const e=this._move(!1);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}_move(e){const t=[];for(const i of this._snippets){const n=i.move(e);t.push(...n)}return t}get isAtFirstPlaceholder(){return this._snippets[0].isAtFirstPlaceholder}get isAtLastPlaceholder(){return this._snippets[0].isAtLastPlaceholder}get hasPlaceholder(){return this._snippets[0].hasPlaceholder}get choice(){return this._snippets[0].choice}isSelectionWithinPlaceholders(){if(!this.hasPlaceholder)return!1;const e=this._editor.getSelections();if(e.length{e.push(...n.get(t))})}e.sort(r.Range.compareRangesUsingStarts);for(let[i,n]of t)if(n.length===e.length){n.sort(r.Range.compareRangesUsingStarts);for(let o=0;o0}}t.SnippetSession=v})),define(t[182],i([0,1,2,11,3,20,22,137,17,81,653]),(function(e,t,i,n,o,s,r,d,c,h,u){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SnippetController2=void 0;const g={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let p=class e{constructor(t,n,o){this._editor=t,this._logService=n,this._snippetListener=new i.DisposableStore,this._modelVersionId=-1,this._inSnippet=e.InSnippetMode.bindTo(o),this._hasNextTabstop=e.HasNextTabstop.bindTo(o),this._hasPrevTabstop=e.HasPrevTabstop.bindTo(o)}static get(t){ +return t.getContribution(e.ID)}dispose(){this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),i.dispose(this._session),this._snippetListener.dispose()}insert(e,t){try{this._doInsert(e,void 0===t?g:Object.assign(Object.assign({},g),t))}catch(t){this.cancel(),this._logService.error(t),this._logService.error("snippet_error"),this._logService.error("insert_template=",e),this._logService.error("existing_template=",this._session?this._session._logInfo():"")}}_doInsert(e,t){this._editor.hasModel()&&(this._snippetListener.clear(),t.undoStopBefore&&this._editor.getModel().pushStackElement(),this._session?this._session.merge(e,t):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new u.SnippetSession(this._editor,e,t),this._session.insert()),t.undoStopAfter&&this._editor.getModel().pushStackElement(),this._updateState(),this._snippetListener.add(this._editor.onDidChangeModelContent(e=>e.isFlush&&this.cancel())), +this._snippetListener.add(this._editor.onDidChangeModel(()=>this.cancel())),this._snippetListener.add(this._editor.onDidChangeCursorSelection(()=>this._updateState())))}_updateState(){if(this._session&&this._editor.hasModel()){if(this._modelVersionId===this._editor.getModel().getAlternativeVersionId())return this.cancel();if(!this._session.hasPlaceholder)return this.cancel();if(this._session.isAtLastPlaceholder||!this._session.isSelectionWithinPlaceholders())return this.cancel();this._inSnippet.set(!0),this._hasPrevTabstop.set(!this._session.isAtFirstPlaceholder),this._hasNextTabstop.set(!this._session.isAtLastPlaceholder),this._handleChoice()}}_handleChoice(){if(!this._session||!this._editor.hasModel())return void(this._currentChoice=void 0);const{choice:e}=this._session;if(e){if(this._currentChoice!==e){this._currentChoice=e,this._editor.setSelections(this._editor.getSelections().map(e=>s.Selection.fromPositions(e.getStartPosition())));const[t]=e.options +;d.showSimpleSuggestions(this._editor,e.options.map((e,i)=>({kind:13,label:e.value,insertText:e.value,sortText:"a".repeat(i+1),range:o.Range.fromPositions(this._editor.getPosition(),this._editor.getPosition().delta(0,t.value.length))})))}}else this._currentChoice=void 0}finish(){for(;this._inSnippet.get();)this.next()}cancel(e=!1){this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),this._snippetListener.clear(),i.dispose(this._session),this._session=void 0,this._modelVersionId=-1,e&&this._editor.setSelections([this._editor.getSelection()])}prev(){this._session&&this._session.prev(),this._updateState()}next(){this._session&&this._session.next(),this._updateState()}isInSnippet(){return Boolean(this._inSnippet.get())}};p.ID="snippetController2",p.InSnippetMode=new c.RawContextKey("inSnippetMode",!1),p.HasNextTabstop=new c.RawContextKey("hasNextTabstop",!1),p.HasPrevTabstop=new c.RawContextKey("hasPrevTabstop",!1),p=a([l(1,h.ILogService),l(2,c.IContextKeyService)],p), +t.SnippetController2=p,n.registerEditorContribution(p.ID,p);const m=n.EditorCommand.bindToContribution(p.get);n.registerEditorCommand(new m({id:"jumpToNextSnippetPlaceholder",precondition:c.ContextKeyExpr.and(p.InSnippetMode,p.HasNextTabstop),handler:e=>e.next(),kbOpts:{weight:130,kbExpr:r.EditorContextKeys.editorTextFocus,primary:2}})),n.registerEditorCommand(new m({id:"jumpToPrevSnippetPlaceholder",precondition:c.ContextKeyExpr.and(p.InSnippetMode,p.HasPrevTabstop),handler:e=>e.prev(),kbOpts:{weight:130,kbExpr:r.EditorContextKeys.editorTextFocus,primary:1026}})),n.registerEditorCommand(new m({id:"leaveSnippet",precondition:p.InSnippetMode,handler:e=>e.cancel(!0),kbOpts:{weight:130,kbExpr:r.EditorContextKeys.editorTextFocus,primary:9,secondary:[1033]}})),n.registerEditorCommand(new m({id:"acceptSnippet",precondition:p.InSnippetMode,handler:e=>e.finish()}))})),define(t[654],i([0,1,19,15,12,4,2,20,18,402,137,182,25,405,8]),(function(e,t,i,n,o,s,a,l,d,c,h,u,g,p,m){"use strict" +;Object.defineProperty(t,"__esModule",{value:!0}),t.SuggestModel=t.LineContext=void 0;class f{constructor(e,t,i,n){this.leadingLineContent=e.getLineContent(t.lineNumber).substr(0,t.column-1),this.leadingWord=e.getWordUntilPosition(t),this.lineNumber=t.lineNumber,this.column=t.column,this.auto=i,this.shy=n}static shouldAutoTrigger(e){if(!e.hasModel())return!1;const t=e.getModel(),i=e.getPosition();t.tokenizeIfCheap(i.lineNumber);const n=t.getWordAtPosition(i);return!!n&&(n.endColumn===i.column&&!!isNaN(Number(n.word)))}}t.LineContext=f;class _{constructor(e,t,i){this._editor=e,this._editorWorkerService=t,this._clipboardService=i,this._toDispose=new a.DisposableStore,this._quickSuggestDelay=10,this._triggerCharacterListener=new a.DisposableStore,this._triggerQuickSuggest=new n.TimeoutTimer,this._state=0,this._completionDisposables=new a.DisposableStore,this._onDidCancel=new s.Emitter,this._onDidTrigger=new s.Emitter,this._onDidSuggest=new s.Emitter,this.onDidCancel=this._onDidCancel.event, +this.onDidTrigger=this._onDidTrigger.event,this.onDidSuggest=this._onDidSuggest.event,this._currentSelection=this._editor.getSelection()||new l.Selection(1,1,1,1),this._toDispose.add(this._editor.onDidChangeModel(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeModelLanguage(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeConfiguration(()=>{this._updateTriggerCharacters(),this._updateQuickSuggest()})),this._toDispose.add(d.CompletionProviderRegistry.onDidChange(()=>{this._updateTriggerCharacters(),this._updateActiveSuggestSession()})),this._toDispose.add(this._editor.onDidChangeCursorSelection(e=>{this._onCursorChange(e)}));let o=!1;this._toDispose.add(this._editor.onDidCompositionStart(()=>{o=!0})),this._toDispose.add(this._editor.onDidCompositionEnd(()=>{o=!1,this._refilterCompletionItems()})),this._toDispose.add(this._editor.onDidChangeModelContent(()=>{o||this._refilterCompletionItems()})), +this._updateTriggerCharacters(),this._updateQuickSuggest()}dispose(){a.dispose(this._triggerCharacterListener),a.dispose([this._onDidCancel,this._onDidSuggest,this._onDidTrigger,this._triggerQuickSuggest]),this._toDispose.dispose(),this._completionDisposables.dispose(),this.cancel()}_updateQuickSuggest(){this._quickSuggestDelay=this._editor.getOption(71),(isNaN(this._quickSuggestDelay)||!this._quickSuggestDelay&&0!==this._quickSuggestDelay||this._quickSuggestDelay<0)&&(this._quickSuggestDelay=10)}_updateTriggerCharacters(){if(this._triggerCharacterListener.clear(),this._editor.getOption(72)||!this._editor.hasModel()||!this._editor.getOption(99))return;const e=new Map;for(const t of d.CompletionProviderRegistry.all(this._editor.getModel()))for(const i of t.triggerCharacters||[]){let n=e.get(i);n||((n=new Set).add(h.getSnippetSuggestSupport()),e.set(i,n)),n.add(t)}const t=t=>{var i;if(!t){const e=this._editor.getPosition();t=this._editor.getModel().getLineContent(e.lineNumber).substr(0,e.column-1)}let n="" +;m.isLowSurrogate(t.charCodeAt(t.length-1))?m.isHighSurrogate(t.charCodeAt(t.length-2))&&(n=t.substr(t.length-2)):n=t.charAt(t.length-1);const o=e.get(n);if(o){const e=null===(i=this._completionModel)||void 0===i?void 0:i.adopt(o);this.trigger({auto:!0,shy:!1,triggerCharacter:n},Boolean(this._completionModel),o,e)}};this._triggerCharacterListener.add(this._editor.onDidType(t)),this._triggerCharacterListener.add(this._editor.onDidCompositionEnd(t))}get state(){return this._state}cancel(e=!1){0!==this._state&&(this._triggerQuickSuggest.cancel(),this._requestToken&&(this._requestToken.cancel(),this._requestToken=void 0),this._state=0,this._completionModel=void 0,this._context=void 0,this._onDidCancel.fire({retrigger:e}))}clear(){this._completionDisposables.clear()}_updateActiveSuggestSession(){0!==this._state&&(this._editor.hasModel()&&d.CompletionProviderRegistry.has(this._editor.getModel())?this.trigger({auto:2===this._state,shy:!1},!0):this.cancel())}_onCursorChange(e){if(!this._editor.hasModel())return +;const t=this._editor.getModel(),i=this._currentSelection;if(this._currentSelection=this._editor.getSelection(),!e.selection.isEmpty()||0!==e.reason||"keyboard"!==e.source&&"deleteLeft"!==e.source)this.cancel();else if(d.CompletionProviderRegistry.has(t)&&0===this._state){if(!1===this._editor.getOption(70))return;if(!i.containsRange(this._currentSelection)&&!i.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition()))return;if(this._editor.getOption(96).snippetsPreventQuickSuggestions&&u.SnippetController2.get(this._editor).isInSnippet())return;this.cancel(),this._triggerQuickSuggest.cancelAndSet(()=>{if(0!==this._state)return;if(!f.shouldAutoTrigger(this._editor))return;if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getPosition(),i=this._editor.getOption(70);if(!1!==i){if(!0===i);else{e.tokenizeIfCheap(t.lineNumber);const n=e.getLineTokens(t.lineNumber),o=n.getStandardTokenType(n.findTokenIndexAtOffset(Math.max(t.column-1-1,0))) +;if(!(i.other&&0===o||i.comments&&1===o||i.strings&&2===o))return}this.trigger({auto:!0,shy:!1})}},this._quickSuggestDelay)}}_refilterCompletionItems(){Promise.resolve().then(()=>{if(0===this._state)return;if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getPosition(),i=new f(e,t,2===this._state,!1);this._onNewContext(i)})}trigger(e,t=!1,n,s){var l;if(!this._editor.hasModel())return;const d=this._editor.getModel(),u=e.auto,m=new f(d,this._editor.getPosition(),u,e.shy);this.cancel(t),this._state=u?2:1,this._onDidTrigger.fire({auto:u,shy:e.shy,position:this._editor.getPosition()}),this._context=m;let v={triggerKind:null!==(l=e.triggerKind)&&void 0!==l?l:0};e.triggerCharacter&&(v={triggerKind:1,triggerCharacter:e.triggerCharacter}),this._requestToken=new g.CancellationTokenSource;const C=this._editor.getOption(93);let b=1;switch(C){case"top":b=0;break;case"bottom":b=2} +let S=_._createItemKindFilter(this._editor),w=p.WordDistance.create(this._editorWorkerService,this._editor),y=h.provideSuggestionItems(d,this._editor.getPosition(),new h.CompletionOptions(b,S,n),v,this._requestToken.token);Promise.all([y,w]).then(([t,n])=>r(this,void 0,void 0,(function*(){if(a.dispose(this._requestToken),0===this._state)return;if(!this._editor.hasModel())return;let o;(t.needsClipboard||i.isNonEmptyArray(s))&&(o=yield this._clipboardService.readText());const r=this._editor.getModel();let l=t.items;if(i.isNonEmptyArray(s)){const e=h.getSuggestionComparator(b);l=l.concat(s).sort(e)}const d=new f(r,this._editor.getPosition(),u,e.shy);this._completionModel=new c.CompletionModel(l,this._context.column,{leadingLineContent:d.leadingLineContent,characterCountDelta:d.column-this._context.column},n,this._editor.getOption(96),this._editor.getOption(93),o),this._completionDisposables.add(t.dispoables),this._onNewContext(d)}))).catch(o.onUnexpectedError)}static _createItemKindFilter(e){const t=new Set +;"none"===e.getOption(93)&&t.add(27);const i=e.getOption(96);return i.showMethods||t.add(0),i.showFunctions||t.add(1),i.showConstructors||t.add(2),i.showFields||t.add(3),i.showVariables||t.add(4),i.showClasses||t.add(5),i.showStructs||t.add(6),i.showInterfaces||t.add(7),i.showModules||t.add(8),i.showProperties||t.add(9),i.showEvents||t.add(10),i.showOperators||t.add(11),i.showUnits||t.add(12),i.showValues||t.add(13),i.showConstants||t.add(14),i.showEnums||t.add(15),i.showEnumMembers||t.add(16),i.showKeywords||t.add(17),i.showWords||t.add(18),i.showColors||t.add(19),i.showFiles||t.add(20),i.showReferences||t.add(21),i.showColors||t.add(22),i.showFolders||t.add(23),i.showTypeParameters||t.add(24),i.showSnippets||t.add(27),i.showUsers||t.add(25),i.showIssues||t.add(26),t}_onNewContext(e){if(this._context)if(e.lineNumber===this._context.lineNumber){if(e.leadingWord.startColumnthis._context.leadingWord.startColumn){const e=new Set(d.CompletionProviderRegistry.all(this._editor.getModel()));this._completionModel.allProvider.forEach(t=>e.delete(t));const t=this._completionModel.adopt(new Set);this.trigger({auto:this._context.auto,shy:!1},!0,e,t)}else if(e.column>this._context.column&&this._completionModel.incomplete.size>0&&0!==e.leadingWord.word.length){const{incomplete:e}=this._completionModel,t=this._completionModel.adopt(e);this.trigger({auto:2===this._state,shy:!1,triggerKind:2},!0,e,t)}else{let t=this._completionModel.lineContext,i=!1;if(this._completionModel.lineContext={leadingLineContent:e.leadingLineContent,characterCountDelta:e.column-this._context.column},0===this._completionModel.items.length){if(f.shouldAutoTrigger(this._editor)&&this._context.leadingWord.endColumn0)&&0===e.leadingWord.word.length)return void this.cancel()}this._onDidSuggest.fire({completionModel:this._completionModel,auto:this._context.auto,shy:this._context.shy,isFrozen:i})}}else this.cancel()}}t.SuggestModel=_})),define(t[655],i([0,1,48,19,12,39,2,68,11,60,3,22,182,125,554,490,28,17,10,83,137,526,654,623,527,4,72,15,23,403,404,13,16,33,25,81,111,80]),(function(e,t,i,n,o,s,r,d,c,h,u,g,p,m,f,_,v,C,b,S,w,y,E,L,x,D,k,N,I,M,R,T,O,A,P,F,W,B){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TriggerSuggestAction=t.SuggestController=void 0;class V{constructor(e,t){if(this._model=e,this._position=t,e.getLineMaxColumn(t.lineNumber)!==t.column){const i=e.getOffsetAt(t),n=e.getPositionAt(i+1);this._marker=e.deltaDecorations([],[{range:u.Range.fromPositions(t,n),options:{stickiness:1}}])}}dispose(){ +this._marker&&!this._model.isDisposed()&&this._model.deltaDecorations(this._marker,[])}delta(e){if(this._model.isDisposed()||this._position.lineNumber!==e.lineNumber)return 0;if(this._marker){const t=this._model.getDecorationRange(this._marker[0]);return this._model.getOffsetAt(t.getStartPosition())-this._model.getOffsetAt(e)}return this._model.getLineMaxColumn(e.lineNumber)-e.column}}let z=class e{constructor(e,t,i,n,o,a,l,d){this._memoryService=i,this._commandService=n,this._contextKeyService=o,this._instantiationService=a,this._logService=l,this._lineSuffix=new r.MutableDisposable,this._toDispose=new r.DisposableStore,this.editor=e,this.model=new E.SuggestModel(this.editor,t,d),this.widget=this._toDispose.add(new N.IdleValue(()=>{const e=this._instantiationService.createInstance(L.SuggestWidget,this.editor);this._toDispose.add(e),this._toDispose.add(e.onDidSelect(e=>this._insertSuggestion(e,0),this));const t=new M.CommitCharacterController(this.editor,e,e=>this._insertSuggestion(e,2)) +;this._toDispose.add(t),this._toDispose.add(this.model.onDidSuggest(e=>{0===e.completionModel.items.length&&t.reset()}));const i=w.Context.MakesTextEdit.bindTo(this._contextKeyService),n=w.Context.HasInsertAndReplaceRange.bindTo(this._contextKeyService),o=w.Context.CanResolve.bindTo(this._contextKeyService);return this._toDispose.add(r.toDisposable(()=>{i.reset(),n.reset(),o.reset()})),this._toDispose.add(e.onDidFocus(({item:e})=>{const t=this.editor.getPosition(),s=e.editStart.column,r=t.column;let a=!0;if(!("smart"!==this.editor.getOption(1)||2!==this.model.state||e.completion.command||e.completion.additionalTextEdits||4&e.completion.insertTextRules||r-s!==e.completion.insertText.length)){a=this.editor.getModel().getValueInRange({startLineNumber:t.lineNumber,startColumn:s,endLineNumber:t.lineNumber,endColumn:r})!==e.completion.insertText}i.set(a),n.set(!T.Position.equals(e.editInsertEnd,e.editReplaceEnd)), +o.set(Boolean(e.provider.resolveCompletionItem)||Boolean(e.completion.documentation)||e.completion.detail!==e.completion.label)})),this._toDispose.add(e.onDetailsKeyDown(e=>{e.toKeybinding().equals(new s.SimpleKeybinding(!0,!1,!1,!1,33))||O.isMacintosh&&e.toKeybinding().equals(new s.SimpleKeybinding(!1,!1,!1,!0,33))?e.stopPropagation():e.toKeybinding().isModifierKey()||this.editor.focus()})),e})),this._overtypingCapturer=this._toDispose.add(new N.IdleValue(()=>this._toDispose.add(new R.OvertypingCapturer(this.editor,this.model)))),this._alternatives=this._toDispose.add(new N.IdleValue(()=>this._toDispose.add(new y.SuggestAlternatives(this.editor,this._contextKeyService)))),this._toDispose.add(a.createInstance(x.WordContextKey,e)),this._toDispose.add(this.model.onDidTrigger(e=>{this.widget.value.showTriggered(e.auto,e.shy?250:50),this._lineSuffix.value=new V(this.editor.getModel(),e.position)})),this._toDispose.add(this.model.onDidSuggest(e=>{if(!e.shy){ +let t=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),e.completionModel.items);this.widget.value.showSuggestions(e.completionModel,t,e.isFrozen,e.auto)}})),this._toDispose.add(this.model.onDidCancel(e=>{e.retrigger||this.widget.value.hideWidget()})),this._toDispose.add(this.editor.onDidBlurEditorWidget(()=>{this.model.cancel(),this.model.clear()}));let c=w.Context.AcceptSuggestionsOnEnter.bindTo(o),h=()=>{const e=this.editor.getOption(1);c.set("on"===e||"smart"===e)};this._toDispose.add(this.editor.onDidChangeConfiguration(()=>h())),h()}static get(t){return t.getContribution(e.ID)}dispose(){this._alternatives.dispose(),this._toDispose.dispose(),this.widget.dispose(),this.model.dispose(),this._lineSuffix.dispose()}_insertSuggestion(e,t){if(!e||!e.item)return this._alternatives.value.reset(),this.model.cancel(),void this.model.clear();if(!this.editor.hasModel())return;const i=this.editor.getModel(),n=i.getAlternativeVersionId(),{item:s}=e,r=[],a=new P.CancellationTokenSource +;1&t||this.editor.pushUndoStop();const l=this.getOverwriteInfo(s,Boolean(8&t));if(this._memoryService.memorize(i,this.editor.getPosition(),s),Array.isArray(s.completion.additionalTextEdits)){const e=d.StableEditorScrollState.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",s.completion.additionalTextEdits.map(e=>h.EditOperation.replace(u.Range.lift(e.range),e.text))),e.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!s.isResolved){const e=new W.StopWatch(!0);let n;const o=i.onDidChangeContent(e=>{if(e.isFlush)return a.cancel(),void o.dispose();for(let t of e.changes){const e=u.Range.getEndPosition(t.range);n&&!T.Position.isBefore(e,n)||(n=e)}});let l=t;t|=2;let c=!1,g=this.editor.onWillType(()=>{g.dispose(),c=!0,2&l||this.editor.pushUndoStop()});r.push(s.resolve(a.token).then(()=>{if(!s.completion.additionalTextEdits||a.token.isCancellationRequested)return!1 +;if(n&&s.completion.additionalTextEdits.some(e=>T.Position.isBefore(n,u.Range.getStartPosition(e.range))))return!1;c&&this.editor.pushUndoStop();const e=d.StableEditorScrollState.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",s.completion.additionalTextEdits.map(e=>h.EditOperation.replace(u.Range.lift(e.range),e.text))),e.restoreRelativeVerticalPositionOfCursor(this.editor),!c&&2&l||this.editor.pushUndoStop(),!0}).then(t=>{this._logService.trace("[suggest] async resolving of edits DONE (ms, applied?)",e.elapsed(),t),o.dispose(),g.dispose()}))}let{insertText:c}=s.completion;4&s.completion.insertTextRules||(c=m.SnippetParser.escape(c)),p.SnippetController2.get(this.editor).insert(c,{overwriteBefore:l.overwriteBefore,overwriteAfter:l.overwriteAfter,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(1&s.completion.insertTextRules),clipboardText:e.model.clipboardText,overtypingCapturer:this._overtypingCapturer.value}),2&t||this.editor.pushUndoStop(), +s.completion.command?s.completion.command.id===H.id?this.model.trigger({auto:!0,shy:!1},!0):(r.push(this._commandService.executeCommand(s.completion.command.id,...s.completion.command.arguments?[...s.completion.command.arguments]:[]).catch(o.onUnexpectedError)),this.model.cancel()):this.model.cancel(),4&t&&this._alternatives.value.set(e,e=>{for(a.cancel();i.canUndo();){n!==i.getAlternativeVersionId()&&i.undo(),this._insertSuggestion(e,3|(8&t?8:0));break}}),this._alertCompletionItem(s),Promise.all(r).finally(()=>{this.model.clear(),a.dispose()})}getOverwriteInfo(e,t){I.assertType(this.editor.hasModel());let i="replace"===this.editor.getOption(96).insertMode;t&&(i=!i);const n=e.position.column-e.editStart.column,o=(i?e.editReplaceEnd.column:e.editInsertEnd.column)-e.position.column;return{overwriteBefore:n+(this.editor.getPosition().column-e.position.column),overwriteAfter:o+(this._lineSuffix.value?this._lineSuffix.value.delta(this.editor.getPosition()):0)}}_alertCompletionItem({completion:e}){ +const t="string"==typeof e.label?e.label:e.label.name;if(n.isNonEmptyArray(e.additionalTextEdits)){let n=_.localize(0,null,t,e.additionalTextEdits.length);i.alert(n)}}triggerSuggest(e){this.editor.hasModel()&&(this.model.trigger({auto:!1,shy:!1},!1,e),this.editor.revealLine(this.editor.getPosition().lineNumber,0),this.editor.focus())}triggerSuggestAndAcceptBest(e){if(!this.editor.hasModel())return;const t=this.editor.getPosition(),i=()=>{t.equals(this.editor.getPosition())&&this._commandService.executeCommand(e.fallback)},n=e=>{if(4&e.completion.insertTextRules||e.completion.additionalTextEdits)return!0;const t=this.editor.getPosition(),i=e.editStart.column,n=t.column;return n-i!==e.completion.insertText.length||this.editor.getModel().getValueInRange({startLineNumber:t.lineNumber,startColumn:i,endLineNumber:t.lineNumber,endColumn:n})!==e.completion.insertText};D.Event.once(this.model.onDidTrigger)(e=>{let t=[];D.Event.any(this.model.onDidTrigger,this.model.onDidCancel)(()=>{r.dispose(t),i()},void 0,t), +this.model.onDidSuggest(({completionModel:e})=>{if(r.dispose(t),0===e.items.length)return void i();const o=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),e.items),s=e.items[o];n(s)?(this.editor.pushUndoStop(),this._insertSuggestion({index:o,item:s,model:e},7)):i()},void 0,t)}),this.model.trigger({auto:!1,shy:!0}),this.editor.revealLine(t.lineNumber,0),this.editor.focus()}acceptSelectedSuggestion(e,t){const i=this.widget.value.getFocusedItem();let n=0;e&&(n|=4),t&&(n|=8),this._insertSuggestion(i,n)}acceptNextSuggestion(){this._alternatives.value.next()}acceptPrevSuggestion(){this._alternatives.value.prev()}cancelSuggestWidget(){this.model.cancel(),this.model.clear(),this.widget.value.hideWidget()}selectNextSuggestion(){this.widget.value.selectNext()}selectNextPageSuggestion(){this.widget.value.selectNextPage()}selectLastSuggestion(){this.widget.value.selectLast()}selectPrevSuggestion(){this.widget.value.selectPrevious()}selectPrevPageSuggestion(){ +this.widget.value.selectPreviousPage()}selectFirstSuggestion(){this.widget.value.selectFirst()}toggleSuggestionDetails(){this.widget.value.toggleDetails()}toggleExplainMode(){this.widget.value.toggleExplainMode()}toggleSuggestionFocus(){this.widget.value.toggleDetailsFocus()}};z.ID="editor.contrib.suggestController",z=a([l(1,k.IEditorWorkerService),l(2,f.ISuggestMemoryService),l(3,v.ICommandService),l(4,C.IContextKeyService),l(5,b.IInstantiationService),l(6,F.ILogService),l(7,B.IClipboardService)],z),t.SuggestController=z;class H extends c.EditorAction{constructor(){super({id:H.id,label:_.localize(1,null),alias:"Trigger Suggest",precondition:C.ContextKeyExpr.and(g.EditorContextKeys.writable,g.EditorContextKeys.hasCompletionItemProvider),kbOpts:{kbExpr:g.EditorContextKeys.textInputFocus,primary:2058,mac:{primary:266,secondary:[521]},weight:100}})}run(e,t){const i=z.get(t);i&&i.triggerSuggest()}}t.TriggerSuggestAction=H,H.id="editor.action.triggerSuggest",c.registerEditorContribution(z.ID,z), +c.registerEditorAction(H);const K=c.EditorCommand.bindToContribution(z.get);c.registerEditorCommand(new K({id:"acceptSelectedSuggestion",precondition:w.Context.Visible,handler(e){e.acceptSelectedSuggestion(!0,!1)}})),S.KeybindingsRegistry.registerKeybindingRule({id:"acceptSelectedSuggestion",when:C.ContextKeyExpr.and(w.Context.Visible,g.EditorContextKeys.textInputFocus),primary:2,weight:190}),S.KeybindingsRegistry.registerKeybindingRule({id:"acceptSelectedSuggestion",when:C.ContextKeyExpr.and(w.Context.Visible,g.EditorContextKeys.textInputFocus,w.Context.AcceptSuggestionsOnEnter,w.Context.MakesTextEdit),primary:3,weight:190}),A.MenuRegistry.appendMenuItem(w.suggestWidgetStatusbarMenu,{command:{id:"acceptSelectedSuggestion",title:_.localize(2,null)},group:"left",order:1,when:w.Context.HasInsertAndReplaceRange.toNegated()}),A.MenuRegistry.appendMenuItem(w.suggestWidgetStatusbarMenu,{command:{id:"acceptSelectedSuggestion",title:_.localize(3,null)},group:"left",order:1, +when:C.ContextKeyExpr.and(w.Context.HasInsertAndReplaceRange,C.ContextKeyExpr.equals("config.editor.suggest.insertMode","insert"))}),A.MenuRegistry.appendMenuItem(w.suggestWidgetStatusbarMenu,{command:{id:"acceptSelectedSuggestion",title:_.localize(4,null)},group:"left",order:1,when:C.ContextKeyExpr.and(w.Context.HasInsertAndReplaceRange,C.ContextKeyExpr.equals("config.editor.suggest.insertMode","replace"))}),c.registerEditorCommand(new K({id:"acceptAlternativeSelectedSuggestion",precondition:C.ContextKeyExpr.and(w.Context.Visible,g.EditorContextKeys.textInputFocus),kbOpts:{weight:190,kbExpr:g.EditorContextKeys.textInputFocus,primary:1027,secondary:[1026]},handler(e){e.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:w.suggestWidgetStatusbarMenu,group:"left",order:2,when:C.ContextKeyExpr.and(w.Context.HasInsertAndReplaceRange,C.ContextKeyExpr.equals("config.editor.suggest.insertMode","insert")),title:_.localize(5,null)},{menuId:w.suggestWidgetStatusbarMenu,group:"left",order:2, +when:C.ContextKeyExpr.and(w.Context.HasInsertAndReplaceRange,C.ContextKeyExpr.equals("config.editor.suggest.insertMode","replace")),title:_.localize(6,null)}]})),v.CommandsRegistry.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion"),c.registerEditorCommand(new K({id:"hideSuggestWidget",precondition:w.Context.Visible,handler:e=>e.cancelSuggestWidget(),kbOpts:{weight:190,kbExpr:g.EditorContextKeys.textInputFocus,primary:9,secondary:[1033]}})),c.registerEditorCommand(new K({id:"selectNextSuggestion",precondition:C.ContextKeyExpr.and(w.Context.Visible,w.Context.MultipleSuggestions),handler:e=>e.selectNextSuggestion(),kbOpts:{weight:190,kbExpr:g.EditorContextKeys.textInputFocus,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})),c.registerEditorCommand(new K({id:"selectNextPageSuggestion",precondition:C.ContextKeyExpr.and(w.Context.Visible,w.Context.MultipleSuggestions),handler:e=>e.selectNextPageSuggestion(),kbOpts:{weight:190, +kbExpr:g.EditorContextKeys.textInputFocus,primary:12,secondary:[2060]}})),c.registerEditorCommand(new K({id:"selectLastSuggestion",precondition:C.ContextKeyExpr.and(w.Context.Visible,w.Context.MultipleSuggestions),handler:e=>e.selectLastSuggestion()})),c.registerEditorCommand(new K({id:"selectPrevSuggestion",precondition:C.ContextKeyExpr.and(w.Context.Visible,w.Context.MultipleSuggestions),handler:e=>e.selectPrevSuggestion(),kbOpts:{weight:190,kbExpr:g.EditorContextKeys.textInputFocus,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})),c.registerEditorCommand(new K({id:"selectPrevPageSuggestion",precondition:C.ContextKeyExpr.and(w.Context.Visible,w.Context.MultipleSuggestions),handler:e=>e.selectPrevPageSuggestion(),kbOpts:{weight:190,kbExpr:g.EditorContextKeys.textInputFocus,primary:11,secondary:[2059]}})),c.registerEditorCommand(new K({id:"selectFirstSuggestion",precondition:C.ContextKeyExpr.and(w.Context.Visible,w.Context.MultipleSuggestions),handler:e=>e.selectFirstSuggestion()})), +c.registerEditorCommand(new K({id:"toggleSuggestionDetails",precondition:w.Context.Visible,handler:e=>e.toggleSuggestionDetails(),kbOpts:{weight:190,kbExpr:g.EditorContextKeys.textInputFocus,primary:2058,mac:{primary:266}},menuOpts:[{menuId:w.suggestWidgetStatusbarMenu,group:"right",order:1,when:C.ContextKeyExpr.and(w.Context.DetailsVisible,w.Context.CanResolve),title:_.localize(7,null)},{menuId:w.suggestWidgetStatusbarMenu,group:"right",order:1,when:C.ContextKeyExpr.and(w.Context.DetailsVisible.toNegated(),w.Context.CanResolve),title:_.localize(8,null)}]})),c.registerEditorCommand(new K({id:"toggleExplainMode",precondition:w.Context.Visible,handler:e=>e.toggleExplainMode(),kbOpts:{weight:100,primary:2133}})),c.registerEditorCommand(new K({id:"toggleSuggestionFocus",precondition:w.Context.Visible,handler:e=>e.toggleSuggestionFocus(),kbOpts:{weight:190,kbExpr:g.EditorContextKeys.textInputFocus,primary:2570,mac:{primary:778}}})),c.registerEditorCommand(new K({id:"insertBestCompletion", +precondition:C.ContextKeyExpr.and(g.EditorContextKeys.textInputFocus,C.ContextKeyExpr.equals("config.editor.tabCompletion","on"),x.WordContextKey.AtEnd,w.Context.Visible.toNegated(),y.SuggestAlternatives.OtherSuggestions.toNegated(),p.SnippetController2.InSnippetMode.toNegated()),handler:(e,t)=>{e.triggerSuggestAndAcceptBest(I.isObject(t)?Object.assign({fallback:"tab"},t):{fallback:"tab"})},kbOpts:{weight:190,primary:2}})),c.registerEditorCommand(new K({id:"insertNextSuggestion",precondition:C.ContextKeyExpr.and(g.EditorContextKeys.textInputFocus,C.ContextKeyExpr.equals("config.editor.tabCompletion","on"),y.SuggestAlternatives.OtherSuggestions,w.Context.Visible.toNegated(),p.SnippetController2.InSnippetMode.toNegated()),handler:e=>e.acceptNextSuggestion(),kbOpts:{weight:190,kbExpr:g.EditorContextKeys.textInputFocus,primary:2}})),c.registerEditorCommand(new K({id:"insertPrevSuggestion", +precondition:C.ContextKeyExpr.and(g.EditorContextKeys.textInputFocus,C.ContextKeyExpr.equals("config.editor.tabCompletion","on"),y.SuggestAlternatives.OtherSuggestions,w.Context.Visible.toNegated(),p.SnippetController2.InSnippetMode.toNegated()),handler:e=>e.acceptPrevSuggestion(),kbOpts:{weight:190,kbExpr:g.EditorContextKeys.textInputFocus,primary:1026}}))})),define(t[656],i([0,1,175,138,252,206,557,600,558,559,560,615,603,245,564,565,566,567,261,610,568,570,524,259,260,256,639,573,612,574,613,643,617,620,622,576,182,655,577,247,578,640,624,248,579,61,115]),(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})}));d=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[i]}})}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),c=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||d(t,e,i)} +;define(t[659],i([0,1,650,656,625,580,626,552,627,628,646,641,581]),(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),c(i,t)}))}).call(this); + +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-typescript version: 4.1.1(2dcf85a5e8a63cb3a39a09a317fa99642a892088) + * Released under the MIT license + * https://github.com/Microsoft/monaco-typescript/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/language/typescript/lib/typescriptServicesMetadata",["require","exports"],(function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.typescriptVersion=void 0,e.typescriptVersion="4.0.3"})),define("vs/language/typescript/fillers/monaco-editor-core",['vs/editor/editor.api'],(function(){return self.monaco})),define("vs/language/typescript/monaco.contribution",["require","exports","./lib/typescriptServicesMetadata","./fillers/monaco-editor-core"],(function(t,e,i,n){"use strict";var r,o,s,a,c;Object.defineProperty(e,"__esModule",{value:!0}),e.getJavaScriptWorker=e.getTypeScriptWorker=e.javascriptDefaults=e.typescriptDefaults=e.typescriptVersion=e.ModuleResolutionKind=e.ScriptTarget=e.NewLineKind=e.JsxEmit=e.ModuleKind=void 0,function(t){t[t.None=0]="None",t[t.CommonJS=1]="CommonJS",t[t.AMD=2]="AMD",t[t.UMD=3]="UMD",t[t.System=4]="System",t[t.ES2015=5]="ES2015",t[t.ESNext=99]="ESNext"}(r=e.ModuleKind||(e.ModuleKind={})),function(t){t[t.None=0]="None",t[t.Preserve=1]="Preserve",t[t.React=2]="React",t[t.ReactNative=3]="ReactNative"}(o=e.JsxEmit||(e.JsxEmit={})),function(t){t[t.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",t[t.LineFeed=1]="LineFeed"}(s=e.NewLineKind||(e.NewLineKind={})),function(t){t[t.ES3=0]="ES3",t[t.ES5=1]="ES5",t[t.ES2015=2]="ES2015",t[t.ES2016=3]="ES2016",t[t.ES2017=4]="ES2017",t[t.ES2018=5]="ES2018",t[t.ES2019=6]="ES2019",t[t.ES2020=7]="ES2020",t[t.ESNext=99]="ESNext",t[t.JSON=100]="JSON",t[t.Latest=99]="Latest"}(a=e.ScriptTarget||(e.ScriptTarget={})),function(t){t[t.Classic=1]="Classic",t[t.NodeJs=2]="NodeJs"}(c=e.ModuleResolutionKind||(e.ModuleResolutionKind={}));var p=function(){function t(t,e,i){this._onDidChange=new n.Emitter,this._onDidExtraLibsChange=new n.Emitter,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(t),this.setDiagnosticsOptions(e),this.setWorkerOptions(i),this._onDidExtraLibsChangeTimeout=-1}return Object.defineProperty(t.prototype,"onDidChange",{get:function(){return this._onDidChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onDidExtraLibsChange",{get:function(){return this._onDidExtraLibsChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"workerOptions",{get:function(){return this._workerOptions},enumerable:!1,configurable:!0}),t.prototype.getExtraLibs=function(){return this._extraLibs},t.prototype.addExtraLib=function(t,e){var i,n=this;if(i=void 0===e?"ts:extralib-"+Math.random().toString(36).substring(2,15):e,this._extraLibs[i]&&this._extraLibs[i].content===t)return{dispose:function(){}};var r=1;return this._removedExtraLibs[i]&&(r=this._removedExtraLibs[i]+1),this._extraLibs[i]&&(r=this._extraLibs[i].version+1),this._extraLibs[i]={content:t,version:r},this._fireOnDidExtraLibsChangeSoon(),{dispose:function(){var t=n._extraLibs[i];t&&t.version===r&&(delete n._extraLibs[i],n._removedExtraLibs[i]=r,n._fireOnDidExtraLibsChangeSoon())}}},t.prototype.setExtraLibs=function(t){for(var e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),t&&t.length>0)for(var i=0,n=t;i console.log", weil "log" vor Kurzem abgeschlossen wurde.','Wählen Sie Vorschläge basierend auf früheren Präfixen aus, die diese Vorschläge abgeschlossen haben, z.B. "co -> console" und "con ->" const".',"Steuert, wie Vorschläge bei Anzeige der Vorschlagsliste vorab ausgewählt werden.","Die Tab-Vervollständigung fügt den passendsten Vorschlag ein, wenn auf Tab gedrückt wird.","Tab-Vervollständigungen deaktivieren.",'Codeausschnitte per Tab vervollständigen, wenn die Präfixe übereinstimmen. Funktioniert am besten, wenn "quickSuggestions" deaktiviert sind.',"Tab-Vervollständigungen aktivieren.","Ungewöhnliche Zeilenabschlusszeichen werden ignoriert.","Zum Entfernen ungewöhnlicher Zeilenabschlusszeichen wird eine Eingabeaufforderung angezeigt.","Ungewöhnliche Zeilenabschlusszeichen werden automatisch entfernt.","Entfernen Sie unübliche Zeilenabschlusszeichen, die Probleme verursachen können.","Das Einfügen und Löschen von Leerzeichen erfolgt nach Tabstopps.","Zeichen, die als Worttrennzeichen verwendet werden, wenn wortbezogene Navigationen oder Vorgänge ausgeführt werden.","Zeilenumbrüche erfolgen nie.","Der Zeilenumbruch erfolgt an der Breite des Anzeigebereichs.",'Der Zeilenumbruch erfolgt bei "#editor.wordWrapColumn#".','Der Zeilenumbruch erfolgt beim Mindestanzeigebereich und "#editor.wordWrapColumn".',"Steuert, wie der Zeilenumbruch durchgeführt werden soll.",'Steuert die umschließende Spalte des Editors, wenn "#editor.wordWrap#" den Wert "wordWrapColumn" oder "bounded" aufweist.',"Kein Einzug. Umbrochene Zeilen beginnen bei Spalte 1.","Umbrochene Zeilen erhalten den gleichen Einzug wie das übergeordnete Element.","Umbrochene Zeilen erhalten + 1 Einzug auf das übergeordnete Element.","Umgebrochene Zeilen werden im Vergleich zum übergeordneten Element +2 eingerückt.","Steuert die Einrückung der umbrochenen Zeilen.","Es wird angenommen, dass alle Zeichen gleich breit sind. Dies ist ein schneller Algorithmus, der für Festbreitenschriftarten und bestimmte Alphabete (wie dem lateinischen), bei denen die Glyphen gleich breit sind, korrekt funktioniert.","Delegiert die Berechnung von Umbruchpunkten an den Browser. Dies ist ein langsamer Algorithmus, der bei großen Dateien Code Freezes verursachen kann, aber in allen Fällen korrekt funktioniert.","Steuert den Algorithmus, der Umbruchpunkte berechnet."], +"vs/editor/common/model/editStack":["Eingabe..."],"vs/editor/common/modes/modesRegistry":["Nur-Text"], +"vs/editor/common/standaloneStrings":["Keine Auswahl","Zeile {0}, Spalte {1} ({2} ausgewählt)","Zeile {0}, Spalte {1}","{0} Auswahlen ({1} Zeichen ausgewählt)","{0} Auswahlen",'Die Einstellung "accessibilitySupport" wird jetzt in "on" geändert.',"Die Dokumentationsseite zur Barrierefreiheit des Editors wird geöffnet.","in einem schreibgeschützten Bereich eines Diff-Editors.","in einem Bereich eines Diff-Editors.","in einem schreibgeschützten Code-Editor","in einem Code-Editor","Drücken Sie BEFEHLSTASTE + E, um den Editor für eine optimierte Verwendung mit Sprachausgabe zu konfigurieren.","Drücken Sie STRG + E, um den Editor für eine optimierte Verwendung mit Sprachausgabe zu konfigurieren.","Der Editor ist auf eine optimale Verwendung mit Sprachausgabe konfiguriert.","Der Editor ist so konfiguriert, dass er nie auf die Verwendung mit Sprachausgabe hin optimiert wird. Dies ist zu diesem Zeitpunkt nicht der Fall.","Durch Drücken der TAB-TASTE im aktuellen Editor wird der Fokus in das nächste Element verschoben, das den Fokus erhalten kann. Schalten Sie dieses Verhalten um, indem Sie {0} drücken.","Durch Drücken der TAB-TASTE im aktuellen Editor wird der Fokus in das nächste Element verschoben, das den Fokus erhalten kann. Der {0}-Befehl kann zurzeit nicht durch eine Tastenzuordnung ausgelöst werden.","Durch Drücken der TAB-TASTE im aktuellen Editor wird das Tabstoppzeichen eingefügt. Schalten Sie dieses Verhalten um, indem Sie {0} drücken.","Durch Drücken der TAB-TASTE im aktuellen Editor wird das Tabstoppzeichen eingefügt. Der {0}-Befehl kann zurzeit nicht durch eine Tastenzuordnung ausgelöst werden.","Drücken Sie BEFEHLSTASTE + H, um ein Browserfenster mit weiteren Informationen zur Barrierefreiheit des Editors zu öffnen.","Drücken Sie STRG + H, um ein Browserfenster mit weiteren Informationen zur Barrierefreiheit des Editors zu öffnen.","Sie können diese QuickInfo schließen und durch Drücken von ESC oder UMSCHALT+ESC zum Editor zurückkehren.","Hilfe zur Barrierefreiheit anzeigen","Entwickler: Token überprüfen","Gehe zu Zeile/Spalte...","Alle Anbieter für den Schnellzugriff anzeigen","Befehlspalette","Befehle anzeigen und ausführen","Gehe zu Symbol...","Gehe zu Symbol nach Kategorie...","Editor-Inhalt","Drücken Sie ALT + F1, um die Barrierefreiheitsoptionen aufzurufen.","Zu Design mit hohem Kontrast umschalten","{0} Bearbeitungen in {1} Dateien durchgeführt"], +"vs/editor/common/view/editorColorRegistry":["Hintergrundfarbe zur Hervorhebung der Zeile an der Cursorposition.","Hintergrundfarbe für den Rahmen um die Zeile an der Cursorposition.","Hintergrundfarbe der markierten Bereiche, wie z.B. Quick Open oder die Suche. Die Farbe darf nicht deckend sein, weil sie sonst die zugrunde liegenden Dekorationen verdeckt.","Hintergrundfarbe für den Rahmen um hervorgehobene Bereiche.",'Hintergrundfarbe des hervorgehobenen Symbols, z. B. "Gehe zu Definition" oder "Gehe zu nächster/vorheriger". Die Farbe darf nicht undurchsichtig sein, um zugrunde liegende Dekorationen nicht zu verbergen.',"Hintergrundfarbe des Rahmens um hervorgehobene Symbole","Farbe des Cursors im Editor.","Hintergrundfarbe vom Editor-Cursor. Erlaubt die Anpassung der Farbe von einem Zeichen, welches von einem Block-Cursor überdeckt wird.","Farbe der Leerzeichen im Editor.","Farbe der Führungslinien für Einzüge im Editor.","Farbe der Führungslinien für Einzüge im aktiven Editor.","Zeilennummernfarbe im Editor.","Zeilennummernfarbe der aktiven Editorzeile.",'Die ID ist veraltet. Verwenden Sie stattdessen "editorLineNumber.activeForeground".',"Zeilennummernfarbe der aktiven Editorzeile.","Farbe des Editor-Lineals.","Vordergrundfarbe der CodeLens-Links im Editor","Hintergrundfarbe für zusammengehörige Klammern","Farbe für zusammengehörige Klammern","Farbe des Rahmens für das Übersicht-Lineal.","Hintergrundfarbe des Übersichtslineals im Editor. Wird nur verwendet, wenn die Minimap aktiviert ist und auf der rechten Seite des Editors platziert wird.","Hintergrundfarbe der Editorleiste. Die Leiste enthält die Glyphenränder und die Zeilennummern.","Rahmenfarbe unnötigen (nicht genutzten) Quellcodes im Editor.",'Deckkraft des unnötigen (nicht genutzten) Quellcodes im Editor. "#000000c0" rendert z.B. den Code mit einer Deckkraft von 75%. Verwenden Sie für Designs mit hohem Kontrast das Farbdesign "editorUnnecessaryCode.border", um unnötigen Code zu unterstreichen statt ihn abzublenden.',"Übersichtslinealmarkerfarbe für das Hervorheben von Bereichen. Die Farbe darf nicht deckend sein, weil sie sonst die zugrunde liegenden Dekorationen verdeckt.","Übersichtslineal-Markierungsfarbe für Fehler.","Übersichtslineal-Markierungsfarbe für Warnungen.","Übersichtslineal-Markierungsfarbe für Informationen."], +"vs/editor/contrib/anchorSelect/anchorSelect":["Auswahlanker",'Anker festgelegt bei "{0}:{1}"',"Auswahlanker festlegen","Zu Auswahlanker wechseln","Auswahl von Anker zu Cursor","Auswahlanker abbrechen"],"vs/editor/contrib/bracketMatching/bracketMatching":["Übersichtslineal-Markierungsfarbe für zusammengehörige Klammern.","Gehe zu Klammer","Auswählen bis Klammer","Gehe zu &&Klammer"],"vs/editor/contrib/caretOperations/caretOperations":["Ausgewählten Text nach links verschieben","Ausgewählten Text nach rechts verschieben"],"vs/editor/contrib/caretOperations/transpose":["Buchstaben austauschen"],"vs/editor/contrib/clipboard/clipboard":["&&Ausschneiden","Ausschneiden","Ausschneiden","&&Kopieren","Kopieren","Kopieren","&&Einfügen","Einfügen","Einfügen","Mit Syntaxhervorhebung kopieren"], +"vs/editor/contrib/codeAction/codeActionCommands":["Art der auszuführenden Codeaktion","Legt fest, wann die zurückgegebenen Aktionen angewendet werden","Die erste zurückgegebene Codeaktion immer anwenden","Die erste zurückgegebene Codeaktion anwenden, wenn nur eine vorhanden ist","Zurückgegebene Codeaktionen nicht anwenden","Legt fest, ob nur bevorzugte Codeaktionen zurückgegeben werden sollen","Beim Anwenden der Code-Aktion ist ein unbekannter Fehler aufgetreten","Schnelle Problembehebung …","Keine Codeaktionen verfügbar",'Keine bevorzugten Codeaktionen für "{0}" verfügbar','Keine Codeaktionen für "{0}" verfügbar',"Keine bevorzugten Codeaktionen verfügbar","Keine Codeaktionen verfügbar","Refactoring durchführen...",'Keine bevorzugten Refactorings für "{0}" verfügbar','Keine Refactorings für "{0}" verfügbar',"Keine bevorzugten Refactorings verfügbar","Keine Refactorings verfügbar","Quellaktion…",'Keine bevorzugten Quellaktionen für "{0}" verfügbar','Keine Quellaktionen für "{0}" verfügbar',"Keine bevorzugten Quellaktionen verfügbar","Keine Quellaktionen verfügbar","Importe organisieren","Keine Aktion zum Organisieren von Importen verfügbar","Alle korrigieren",'Aktion "Alle korrigieren" nicht verfügbar',"Automatisch korrigieren...","Keine automatischen Korrekturen verfügbar"], +"vs/editor/contrib/codeAction/lightBulbWidget":["Fixes anzeigen. Bevorzugter Fix verfügbar ({0})","Korrekturen anzeigen ({0})","Korrekturen anzeigen"],"vs/editor/contrib/codelens/codelensController":["CodeLens-Befehle für aktuelle Zeile anzeigen"],"vs/editor/contrib/comment/comment":["Zeilenkommentar umschalten","Zeilenkommen&&tar umschalten","Zeilenkommentar hinzufügen","Zeilenkommentar entfernen","Blockkommentar umschalten","&&Blockkommentar umschalten"],"vs/editor/contrib/contextmenu/contextmenu":["Editor-Kontextmenü anzeigen"],"vs/editor/contrib/cursorUndo/cursorUndo":["Mit Cursor rückgängig machen","Wiederholen mit Cursor"], +"vs/editor/contrib/documentSymbols/outlineTree":["Die Vordergrundfarbe für Arraysymbole. Diese Symbole werden in den Widgets für Gliederung, Breadcrumbs und Vorschläge angezeigt.","Die Vordergrundfarbe für boolesche Symbole. Diese Symbole werden in den Widgets für Gliederung, Breadcrumbs und Vorschläge angezeigt.","Die Vordergrundfarbe für Klassensymbole. Diese Symbole werden in den Widgets für Gliederung, Breadcrumbs und Vorschläge angezeigt.","Die Vordergrundfarbe für Farbsymbole. Diese Symbole werden in den Widgets für Gliederung, Breadcrumbs und Vorschläge angezeigt.","Die Vordergrundfarbe für konstante Symbole. Diese Symbole werden in den Widgets für Gliederung, Breadcrumbs und Vorschläge angezeigt.","Die Vordergrundfarbe für Konstruktorsymbole. Diese Symbole werden in den Widgets für Gliederung, Breadcrumbs und Vorschläge angezeigt.","Die Vordergrundfarbe für Enumeratorsymbole. Diese Symbole werden in den Widgets für Gliederung, Breadcrumbs und Vorschläge angezeigt.","Die Vordergrundfarbe für Enumeratormembersymbole. Diese Symbole werden in den Widgets für Gliederung, Breadcrumbs und Vorschläge angezeigt.","Die Vordergrundfarbe für Ereignissymbole. Diese Symbole werden in den Widgets für Gliederung, Breadcrumbs und Vorschläge angezeigt.","Die Vordergrundfarbe für Feldsymbole. Diese Symbole werden in den Widgets für Gliederung, Breadcrumbs und Vorschläge angezeigt.","Die Vordergrundfarbe für Dateisymbole. Diese Symbole werden in den Widgets für Gliederung, Breadcrumbs und Vorschläge angezeigt.","Die Vordergrundfarbe für Ordnersymbole. Diese Symbole werden in den Widgets für Gliederung, Breadcrumbs und Vorschläge angezeigt.","Die Vordergrundfarbe für Funktionssymbole. Diese Symbole werden in den Widgets für Gliederung, Breadcrumbs und Vorschläge angezeigt.","Die Vordergrundfarbe für Schnittstellensymbole. Diese Symbole werden in den Widgets für Gliederung, Breadcrumbs und Vorschläge angezeigt.","Die Vordergrundfarbe für Schlüsselsymbole. Diese Symbole werden in den Widgets für Gliederung, Breadcrumbs und Vorschläge angezeigt.","Die Vordergrundfarbe für Schlüsselwortsymbole. Diese Symbole werden in den Widgets für Gliederung, Breadcrumbs und Vorschläge angezeigt.","Die Vordergrundfarbe für Methodensymbole. Diese Symbole werden in den Widgets für Gliederung, Breadcrumbs und Vorschläge angezeigt.","Die Vordergrundfarbe für Modulsymbole. Diese Symbole werden in den Widgets für Gliederung, Breadcrumbs und Vorschläge angezeigt.","Die Vordergrundfarbe für Namespacesymbole. Diese Symbole werden in den Widgets für Gliederung, Breadcrumbs und Vorschläge angezeigt.","Die Vordergrundfarbe für NULL-Symbole. Diese Symbole werden in den Widgets für Gliederung, Breadcrumbs und Vorschläge angezeigt.","Die Vordergrundfarbe für Zahlensymbole. Diese Symbole werden in den Widgets für Gliederung, Breadcrumbs und Vorschläge angezeigt.","Die Vordergrundfarbe für Objektsymbole. Diese Symbole werden in den Widgets für Gliederung, Breadcrumbs und Vorschläge angezeigt.","Die Vordergrundfarbe für Operatorsymbole. Diese Symbole werden in den Widgets für Gliederung, Breadcrumbs und Vorschläge angezeigt.","Die Vordergrundfarbe für Paketsymbole. Diese Symbole werden in den Widgets für Gliederung, Breadcrumbs und Vorschläge angezeigt.","Die Vordergrundfarbe für Eigenschaftensymbole. Diese Symbole werden in den Widgets für Gliederung, Breadcrumbs und Vorschläge angezeigt.","Die Vordergrundfarbe für Referenzsymbole. Diese Symbole werden in den Widgets für Gliederung, Breadcrumbs und Vorschläge angezeigt.","Die Vordergrundfarbe für Codeausschnittsymbole. Diese Symbole werden in den Widgets für Gliederung, Breadcrumbs und Vorschläge angezeigt.","Die Vordergrundfarbe für Zeichenfolgensymbole. Diese Symbole werden in den Widgets für Gliederung, Breadcrumbs und Vorschläge angezeigt.","Die Vordergrundfarbe für Struktursymbole. Diese Symbole werden in den Widgets für Gliederung, Breadcrumbs und Vorschläge angezeigt.","Die Vordergrundfarbe für Textsymbole. Diese Symbole werden in den Widgets für Gliederung, Breadcrumbs und Vorschläge angezeigt.","Die Vordergrundfarbe für Typparametersymbole. Diese Symbole werden in den Widgets für Gliederung, Breadcrumbs und Vorschläge angezeigt.","Die Vordergrundfarbe für Einheitensymbole. Diese Symbole werden in den Widgets für Gliederung, Breadcrumbs und Vorschläge angezeigt.","Die Vordergrundfarbe für variable Symbole. Diese Symbole werden in den Widgets für Gliederung, Breadcrumbs und Vorschläge angezeigt."], +"vs/editor/contrib/find/findController":["Suchen","&&Suchen","Mit Auswahl suchen","Weitersuchen","Weitersuchen","Vorheriges Element suchen","Vorheriges Element suchen","Nächste Auswahl suchen","Vorherige Auswahl suchen","Ersetzen","&&Ersetzen"],"vs/editor/contrib/find/findWidget":["Suchen","Suchen","Vorheriger Treffer","Nächste Übereinstimmung","In Auswahl suchen","Schließen","Ersetzen","Ersetzen","Ersetzen","Alle ersetzen","Ersetzen-Modus wechseln","Nur die ersten {0} Ergebnisse wurden hervorgehoben, aber alle Suchoperationen werden auf dem gesamten Text durchgeführt.","{0} von {1}","Keine Ergebnisse","{0} gefunden",'{0} für "{1}" gefunden','{0} für "{1}" gefunden, bei {2}','{0} für "{1}" gefunden','STRG+EINGABE fügt jetzt einen Zeilenumbruch ein, statt alles zu ersetzen. Sie können die Tastenzuordnung für "editor.action.replaceAll" ändern, um dieses Verhalten außer Kraft zu setzen.'], +"vs/editor/contrib/folding/folding":["Auffalten","Faltung rekursiv aufheben","Falten","Einklappung umschalten","Rekursiv falten","Alle Blockkommentare falten","Alle Regionen falten","Alle Regionen auffalten","Alle falten","Alle auffalten","Faltebene {0}","Hintergrundfarbe hinter gefalteten Bereichen. Die Farbe darf nicht deckend sein, sodass zugrunde liegende Dekorationen nicht ausgeblendet werden.","Farbe des Faltsteuerelements im Editor-Bundsteg."],"vs/editor/contrib/fontZoom/fontZoom":["Editorschriftart vergrößern","Editorschriftart verkleinern","Editor Schriftart Vergrößerung zurücksetzen"],"vs/editor/contrib/format/format":["1 Formatierung in Zeile {0} vorgenommen","{0} Formatierungen in Zeile {1} vorgenommen","1 Formatierung zwischen Zeilen {0} und {1} vorgenommen","{0} Formatierungen zwischen Zeilen {1} und {2} vorgenommen"],"vs/editor/contrib/format/formatActions":["Dokument formatieren","Auswahl formatieren"], +"vs/editor/contrib/gotoError/gotoError":["Gehe zu nächstem Problem (Fehler, Warnung, Information)","Gehe zu vorigem Problem (Fehler, Warnung, Information)","Gehe zu dem nächsten Problem in den Dateien (Fehler, Warnung, Info)","Nächstes &&Problem","Gehe zu dem vorherigen Problem in den Dateien (Fehler, Warnung, Info)","Vorheriges &&Problem"],"vs/editor/contrib/gotoError/gotoErrorWidget":["Fehler","Warnung","Info","Hinweis","{0} bei {1}. ","{0} von {1} Problemen","{0} von {1} Problemen","Editormarkierung: Farbe bei Fehler des Navigationswidgets.","Editormarkierung: Farbe bei Warnung des Navigationswidgets.","Editormarkierung: Farbe bei Information des Navigationswidgets.","Editormarkierung: Hintergrund des Navigationswidgets."], +"vs/editor/contrib/gotoSymbol/goToCommands":["Vorschau","Definitionen",'Keine Definition gefunden für "{0}".',"Keine Definition gefunden","Gehe zu Definition","Gehe &&zu Definition","Definition an der Seite öffnen","Definition einsehen","Deklarationen",'Keine Deklaration für "{0}" gefunden.',"Keine Deklaration gefunden.","Zur Deklaration wechseln","Gehe zu &&Deklaration",'Keine Deklaration für "{0}" gefunden.',"Keine Deklaration gefunden.","Vorschau für Deklaration anzeigen","Typdefinitionen",'Keine Typendefinition gefunden für "{0}"',"Keine Typendefinition gefunden","Zur Typdefinition wechseln","Zur &&Typdefinition wechseln","Vorschau der Typdefinition anzeigen","Implementierungen",'Keine Implementierung gefunden für "{0}"',"Keine Implementierung gefunden","Gehe zu Implementierungen","Gehe zu &&Implementierungen","Vorschau für Implementierungen anzeigen",'Für "{0}" wurden keine Verweise gefunden.',"Keine Referenzen gefunden","Gehe zu Verweisen","Gehe zu &&Verweisen","Verweise","Vorschau für Verweise anzeigen","Verweise","Gehe zu beliebigem Symbol","Speicherorte",'Keine Ergebnisse für "{0}"',"Verweise"], +"vs/editor/contrib/gotoSymbol/link/goToDefinitionAtPosition":["Klicken Sie, um {0} Definitionen anzuzeigen."],"vs/editor/contrib/gotoSymbol/peek/referencesController":["Wird geladen...","{0} ({1})"],"vs/editor/contrib/gotoSymbol/peek/referencesTree":["{0} Verweise","{0} Verweis","Verweise"],"vs/editor/contrib/gotoSymbol/peek/referencesWidget":["Keine Vorschau verfügbar.","Keine Ergebnisse","Verweise"],"vs/editor/contrib/gotoSymbol/referencesModel":["Symbol in {0} in Zeile {1}, Spalte {2}","1 Symbol in {0}, vollständiger Pfad {1}","{0} Symbole in {1}, vollständiger Pfad {2}","Es wurden keine Ergebnisse gefunden.","1 Symbol in {0} gefunden","{0} Symbole in {1} gefunden","{0} Symbole in {1} Dateien gefunden"],"vs/editor/contrib/gotoSymbol/symbolNavigation":["Symbol {0} von {1}, {2} für nächstes","Symbol {0} von {1}"],"vs/editor/contrib/hover/hover":["Hovern anzeigen","Definitionsvorschauhover anzeigen"], +"vs/editor/contrib/hover/modesContentHover":["Wird geladen...","Vorschauproblem","Es wird nach Schnellkorrekturen gesucht...","Keine Schnellkorrekturen verfügbar","Schnelle Problembehebung …"],"vs/editor/contrib/inPlaceReplace/inPlaceReplace":["Durch vorherigen Wert ersetzen","Durch nächsten Wert ersetzen"],"vs/editor/contrib/indentation/indentation":["Einzug in Leerzeichen konvertieren","Einzug in Tabstopps konvertieren","Konfigurierte Tabulatorgröße","Tabulatorgröße für aktuelle Datei auswählen","Einzug mithilfe von Tabstopps","Einzug mithilfe von Leerzeichen","Einzug aus Inhalt erkennen","Neuen Einzug für Zeilen festlegen","Gewählte Zeilen zurückziehen"], +"vs/editor/contrib/linesOperations/linesOperations":["Zeile nach oben kopieren","Zeile nach oben &&kopieren","Zeile nach unten kopieren","Zeile nach unten ko&&pieren","Auswahl duplizieren","&&Auswahl duplizieren","Zeile nach oben verschieben","Zeile nach oben &&verschieben","Zeile nach unten verschieben","Zeile nach &&unten verschieben","Zeilen aufsteigend sortieren","Zeilen absteigend sortieren","Nachgestelltes Leerzeichen kürzen","Zeile löschen","Zeileneinzug","Zeile ausrücken","Zeile oben einfügen","Zeile unten einfügen","Alle übrigen löschen","Alle rechts löschen","Zeilen verknüpfen","Zeichen um den Cursor herum transponieren","In Großbuchstaben umwandeln","In Kleinbuchstaben umwandeln","In große Anfangsbuchstaben umwandeln"],"vs/editor/contrib/links/links":["Befehl ausführen","Link folgen","BEFEHL + Klicken","STRG + Klicken","OPTION + Klicken","alt + klicken","Fehler beim Öffnen dieses Links, weil er nicht wohlgeformt ist: {0}","Fehler beim Öffnen dieses Links, weil das Ziel fehlt.","Link öffnen"], +"vs/editor/contrib/message/messageController":["Ein Bearbeiten ist im schreibgeschützten Editor nicht möglich"],"vs/editor/contrib/multicursor/multicursor":["Cursor oberhalb hinzufügen","Cursor oberh&&alb hinzufügen","Cursor unterhalb hinzufügen","Cursor unterhal&&b hinzufügen","Cursor an Zeilenenden hinzufügen","C&&ursor an Zeilenenden hinzufügen","Cursor am Ende hinzufügen","Cursor am Anfang hinzufügen","Auswahl zur nächsten Übereinstimmungssuche hinzufügen","&&Nächstes Vorkommen hinzufügen","Letzte Auswahl zu vorheriger Übereinstimmungssuche hinzufügen","Vo&&rheriges Vorkommen hinzufügen","Letzte Auswahl in nächste Übereinstimmungssuche verschieben","Letzte Auswahl in vorherige Übereinstimmungssuche verschieben","Alle Vorkommen auswählen und Übereinstimmung suchen","Alle V&&orkommen auswählen","Alle Vorkommen ändern"],"vs/editor/contrib/parameterHints/parameterHints":["Parameterhinweise auslösen"],"vs/editor/contrib/parameterHints/parameterHintsWidget":["{0}, Hinweis"], +"vs/editor/contrib/peekView/peekView":["Schließen","Hintergrundfarbe des Titelbereichs der Peek-Ansicht.","Farbe des Titels in der Peek-Ansicht.","Farbe der Titelinformationen in der Peek-Ansicht.","Farbe der Peek-Ansichtsränder und des Pfeils.","Hintergrundfarbe der Ergebnisliste in der Peek-Ansicht.","Vordergrundfarbe für Zeilenknoten in der Ergebnisliste der Peek-Ansicht.","Vordergrundfarbe für Dateiknoten in der Ergebnisliste der Peek-Ansicht.","Hintergrundfarbe des ausgewählten Eintrags in der Ergebnisliste der Peek-Ansicht.","Vordergrundfarbe des ausgewählten Eintrags in der Ergebnisliste der Peek-Ansicht.","Hintergrundfarbe des Peek-Editors.","Hintergrundfarbe der Leiste im Peek-Editor.","Farbe für Übereinstimmungsmarkierungen in der Ergebnisliste der Peek-Ansicht.","Farbe für Übereinstimmungsmarkierungen im Peek-Editor.","Rahmen für Übereinstimmungsmarkierungen im Peek-Editor."], +"vs/editor/contrib/quickAccess/gotoLineQuickAccess":["Öffnen Sie zuerst einen Text-Editor, um zu einer Zeile zu wechseln.","Wechseln Sie zu Zeile {0} und Spalte {1}.","Zu Zeile {0} wechseln.","Aktuelle Zeile: {0}, Zeichen: {1}. Geben Sie eine Zeilennummer zwischen 1 und {2} ein, zu der Sie navigieren möchten.","Aktuelle Zeile: {0}, Zeichen: {1}. Geben Sie eine Zeilennummer ein, zu der Sie navigieren möchten."], +"vs/editor/contrib/quickAccess/gotoSymbolQuickAccess":["Öffnen Sie zunächst einen Text-Editor mit Symbolinformationen, um zu einem Symbol zu navigieren.","Der aktive Text-Editor stellt keine Symbolinformationen bereit.","Keine übereinstimmenden Editorsymbole.","Keine Editorsymbole.","An der Seite öffnen","Unten öffnen","Symbole ({0})","Eigenschaften ({0})","Methoden ({0})","Funktionen ({0})","Konstruktoren ({0})","Variablen ({0})","Klassen ({0})","Strukturen ({0})","Ereignisse ({0})","Operatoren ({0})","Schnittstellen ({0})","Namespaces ({0})","Pakete ({0})","Typparameter ({0})","Module ({0})","Eigenschaften ({0})","Enumerationen ({0})","Enumerationsmember ({0})","Zeichenfolgen ({0})","Dateien ({0})","Arrays ({0})","Zahlen ({0})","Boolesche Werte ({0})","Objekte ({0})","Schlüssel ({0})","Felder ({0})","Konstanten ({0})"],"vs/editor/contrib/rename/onTypeRename":["Symbol bei Eingabe umbenennen","Hintergrundfarbe, wenn der Editor automatisch nach Typ umbenennt."], +"vs/editor/contrib/rename/rename":["Kein Ergebnis.","Ein unbekannter Fehler ist beim Auflösen der Umbenennung eines Ortes aufgetreten.",'"{0}" wird umbenannt.',"{0} wird umbenannt.",'"{0}" erfolgreich in "{1}" umbenannt. Zusammenfassung: {2}',"Die rename-Funktion konnte die Änderungen nicht anwenden.","Die rename-Funktion konnte die Änderungen nicht berechnen.","Symbol umbenennen","Möglichkeit aktivieren/deaktivieren, Änderungen vor dem Umbenennen als Vorschau anzeigen zu lassen"],"vs/editor/contrib/rename/renameInputField":["Benennen Sie die Eingabe um. Geben Sie einen neuen Namen ein, und drücken Sie die EINGABETASTE, um den Commit auszuführen.","{0} zur Umbenennung, {1} zur Vorschau"],"vs/editor/contrib/smartSelect/smartSelect":["Auswahl aufklappen","Auswahl &&erweitern","Markierung verkleinern","Au&&swahl verkleinern"], +"vs/editor/contrib/snippet/snippetVariables":["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag","So","Mo","Di","Mi","Do","Fr","Sa","Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember","Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],"vs/editor/contrib/suggest/suggestController":['Das Akzeptieren von "{0}" ergab {1} zusätzliche Bearbeitungen.',"Vorschlag auslösen","{0} zum Einfügen","{0} zum Einfügen","{0} zum Ersetzen","{0} zum Ersetzen","{0} zum Einfügen","weniger anzeigen","mehr anzeigen"], +"vs/editor/contrib/suggest/suggestWidget":["Hintergrundfarbe des Vorschlagswidgets.","Rahmenfarbe des Vorschlagswidgets.","Vordergrundfarbe des Vorschlagswidgets.","Hintergrundfarbe des ausgewählten Eintrags im Vorschlagswidget.","Farbe der Trefferhervorhebung im Vorschlagswidget.","Weitere Informationen ({0})","Weniger lesen ({0})","Wird geladen...","Wird geladen...","Keine Vorschläge.","{0}, Dokumente: {1}","Vorschlagen"],"vs/editor/contrib/toggleTabFocusMode/toggleTabFocusMode":["TAB-Umschalttaste verschiebt Fokus","Beim Drücken auf Tab wird der Fokus jetzt auf das nächste fokussierbare Element verschoben","Beim Drücken von Tab wird jetzt das Tabulator-Zeichen eingefügt"],"vs/editor/contrib/tokenization/tokenization":["Entwickler: Force Retokenize"], +"vs/editor/contrib/unusualLineTerminators/unusualLineTerminators":["Ungewöhnliche Zeilentrennzeichen","Ungewöhnliche Zeilentrennzeichen erkannt",'Diese Datei enthält mindestens ein ungültiges Zeilenabschlusszeichen, z. B. Zeilentrennzeichen (LS) oder Absatztrennzeichen (PS).\r\n\r\nEs wird empfohlen, diese Zeichen aus der Datei zu entfernen. Die betreffende Einstellung kann über "editor.unusualLineTerminators" konfiguriert werden.',"Diese Datei korrigieren","Problem für diese Datei ignorieren"], +"vs/editor/contrib/wordHighlighter/wordHighlighter":["Hintergrundfarbe eines Symbols beim Lesezugriff, z.B. beim Lesen einer Variablen. Die Farbe darf nicht deckend sein, damit sie nicht die zugrunde liegenden Dekorationen verdeckt.","Hintergrundfarbe eines Symbols bei Schreibzugriff, z.B. beim Schreiben in eine Variable. Die Farbe darf nicht deckend sein, weil sie sonst die zugrunde liegenden Dekorationen verdeckt.","Randfarbe eines Symbols beim Lesezugriff, wie etwa beim Lesen einer Variablen.","Randfarbe eines Symbols beim Schreibzugriff, wie etwa beim Schreiben einer Variablen.","Übersichtslinealmarkerfarbd für das Hervorheben von Symbolen. Die Farbe darf nicht deckend sein, weil sie sonst die zugrunde liegenden Dekorationen verdeckt.","Übersichtslinealmarkerfarbe für Symbolhervorhebungen bei Schreibzugriff. Die Farbe darf nicht deckend sein, weil sie sonst die zugrunde liegenden Dekorationen verdeckt.","Gehe zur nächsten Symbolhervorhebungen","Gehe zur vorherigen Symbolhervorhebungen","Symbol-Hervorhebung ein-/ausschalten"], +"vs/platform/actions/browser/menuEntryActionViewItem":["{0} ({1})"],"vs/platform/configuration/common/configurationRegistry":["Außerkraftsetzungen für die Standardsprachkonfiguration","Zu überschreibende Editor-Einstellungen für eine Sprache konfigurieren.","Diese Einstellung unterstützt keine sprachspezifische Konfiguration.",'"{0}" kann nicht registriert werden. Stimmt mit dem Eigenschaftsmuster "\\\\[.*\\\\]$" zum Beschreiben sprachspezifischer Editor-Einstellungen überein. Verwenden Sie den Beitrag "configurationDefaults".','{0}" kann nicht registriert werden. Diese Eigenschaft ist bereits registriert.'],"vs/platform/keybinding/common/abstractKeybindingService":["({0}) wurde gedrückt. Es wird auf die zweite Taste in der Kombination gewartet...","Die Tastenkombination ({0}, {1}) ist kein Befehl."], +"vs/platform/list/browser/listService":["Workbench","Ist unter Windows und Linux der STRG-Taste und unter macOS der Befehlstaste zugeordnet.","Ist unter Windows und Linux der ALT-Taste und unter macOS der Wahltaste zugeordnet.",'Der Modifizierer zum Hinzufügen eines Elements in Bäumen und Listen zu einer Mehrfachauswahl mit der Maus (zum Beispiel im Explorer, in geöffneten Editoren und in der SCM-Ansicht). Die Mausbewegung "Seitlich öffnen" wird – sofern unterstützt – so angepasst, dass kein Konflikt mit dem Modifizierer für Mehrfachauswahl entsteht.',"Steuert, wie Elemente in Strukturen und Listen mithilfe der Maus geöffnet werden (sofern unterstützt). Bei übergeordneten Elementen, deren untergeordnete Elemente sich in Strukturen befinden, steuert diese Einstellung, ob ein Einfachklick oder ein Doppelklick das übergeordnete Elemente erweitert. Beachten Sie, dass einige Strukturen und Listen diese Einstellung ggf. ignorieren, wenn sie nicht zutrifft.","Steuert, ob Listen und Strukturen ein horizontales Scrollen in der Workbench unterstützen. Warnung: Das Aktivieren dieser Einstellung kann sich auf die Leistung auswirken.","Steuert den Struktureinzug in Pixeln.","Steuert, ob die Struktur Einzugsführungslinien rendern soll.","Steuert, ob Listen und Strukturen einen optimierten Bildlauf verwenden.","Bei der einfachen Tastaturnavigation werden Elemente in den Fokus genommen, die mit der Tastatureingabe übereinstimmen. Die Übereinstimmungen gelten nur für Präfixe.","Hervorheben von Tastaturnavigationshervorgebungselemente, die mit der Tastatureingabe übereinstimmen. Beim nach oben und nach unten Navigieren werden nur die hervorgehobenen Elemente durchlaufen.","Durch das Filtern der Tastaturnavigation werden alle Elemente herausgefiltert und ausgeblendet, die nicht mit der Tastatureingabe übereinstimmen.",'Steuert die Tastaturnavigation in Listen und Strukturen in der Workbench. Kann "simple" (einfach), "highlight" (hervorheben) und "filter" (filtern) sein.','Legt fest, ob die Tastaturnavigation in Listen und Strukturen automatisch durch Eingaben ausgelöst wird. Wenn der Wert auf "false" festgelegt ist, wird die Tastaturnavigation nur ausgelöst, wenn der Befehl "list.toggleKeyboardNavigation" ausgeführt wird. Diesem Befehl können Sie eine Tastenkombination zuweisen.'], +"vs/platform/markers/common/markers":["Fehler","Warnung","Info"],"vs/platform/quickinput/browser/commandsQuickAccess":["{0}, {1}","zuletzt verwendet","andere Befehle","Der Befehl {0} hat einen Fehler ausgelöst ({1})."],"vs/platform/quickinput/browser/helpQuickAccess":["Globale Befehle","Editor-Befehle","{0}, {1}"], +"vs/platform/theme/common/colorRegistry":["Allgemeine Vordergrundfarbe. Diese Farbe wird nur verwendet, wenn sie nicht durch eine Komponente überschrieben wird.","Allgemeine Vordergrundfarbe für Fehlermeldungen. Diese Farbe wird nur verwendet, wenn sie nicht durch eine Komponente überschrieben wird.","Die für Symbole in der Workbench verwendete Standardfarbe.","Allgemeine Rahmenfarbe für fokussierte Elemente. Diese Farbe wird nur verwendet, wenn sie nicht durch eine Komponente überschrieben wird.","Ein zusätzlicher Rahmen um Elemente, mit dem diese von anderen getrennt werden, um einen größeren Kontrast zu erreichen.","Ein zusätzlicher Rahmen um aktive Elemente, mit dem diese von anderen getrennt werden, um einen größeren Kontrast zu erreichen.","Vordergrundfarbe für Links im Text.","Hintergrundfarbe für Codeblöcke im Text.","Schattenfarbe von Widgets wie zum Beispiel Suchen/Ersetzen innerhalb des Editors.","Hintergrund für Eingabefeld.","Vordergrund für Eingabefeld.","Rahmen für Eingabefeld.","Rahmenfarbe für aktivierte Optionen in Eingabefeldern.","Hintergrundfarbe für aktivierte Optionen in Eingabefeldern.","Vordergrundfarbe für aktivierte Optionen in Eingabefeldern.","Hintergrundfarbe bei der Eingabevalidierung für den Schweregrad der Information.","Vordergrundfarbe bei der Eingabevalidierung für den Schweregrad der Information.","Rahmenfarbe bei der Eingabevalidierung für den Schweregrad der Information.","Hintergrundfarbe bei der Eingabevalidierung für den Schweregrad der Warnung.","Vordergrundfarbe bei der Eingabevalidierung für den Schweregrad der Warnung.","Rahmenfarbe bei der Eingabevalidierung für den Schweregrad der Warnung.","Hintergrundfarbe bei der Eingabevalidierung für den Schweregrad des Fehlers.","Vordergrundfarbe bei der Eingabevalidierung für den Schweregrad des Fehlers.","Rahmenfarbe bei der Eingabevalidierung für den Schweregrad des Fehlers.","Hintergrund für Dropdown.","Vordergrund für Dropdown.","Vordergrundfarbe der Schaltfläche.","Hintergrundfarbe der Schaltfläche.","Hintergrundfarbe der Schaltfläche, wenn darauf gezeigt wird.","Hintergrundfarbe für Badge. Badges sind kurze Info-Texte, z.B. für Anzahl Suchergebnisse.","Vordergrundfarbe für Badge. Badges sind kurze Info-Texte, z.B. für Anzahl Suchergebnisse.","Schatten der Scrollleiste, um anzuzeigen, dass die Ansicht gescrollt wird.","Hintergrundfarbe vom Scrollbar-Schieber","Hintergrundfarbe des Schiebereglers, wenn darauf gezeigt wird.","Hintergrundfarbe des Schiebereglers, wenn darauf geklickt wird.","Hintergrundfarbe des Fortschrittbalkens, der für zeitintensive Vorgänge angezeigt werden kann.","Vordergrundfarbe von Fehlerunterstreichungen im Editor.","Randfarbe von Fehlerfeldern im Editor.","Vordergrundfarbe von Warnungsunterstreichungen im Editor.","Randfarbe der Warnfelder im Editor.","Vordergrundfarbe von Informationsunterstreichungen im Editor.","Randfarbe der Infofelder im Editor.","Vordergrundfarbe der Hinweisunterstreichungen im Editor.","Randfarbe der Hinweisfelder im Editor.","Hintergrundfarbe des Editors.","Standardvordergrundfarbe des Editors.","Hintergrundfarbe von Editor-Widgets wie zum Beispiel Suchen/Ersetzen.","Vordergrundfarbe für Editorwidgets wie Suchen/Ersetzen.","Rahmenfarbe von Editorwigdets. Die Farbe wird nur verwendet, wenn für das Widget ein Rahmen verwendet wird und die Farbe nicht von einem Widget überschrieben wird.","Rahmenfarbe der Größenanpassungsleiste von Editorwigdets. Die Farbe wird nur verwendet, wenn für das Widget ein Größenanpassungsrahmen verwendet wird und die Farbe nicht von einem Widget außer Kraft gesetzt wird.","Schnellauswahl der Hintergrundfarbe. Im Widget für die Schnellauswahl sind Auswahlelemente wie die Befehlspalette enthalten.","Vordergrundfarbe der Schnellauswahl. Im Widget für die Schnellauswahl sind Auswahlelemente wie die Befehlspalette enthalten.","Hintergrundfarbe für den Titel der Schnellauswahl. Im Widget für die Schnellauswahl sind Auswahlelemente wie die Befehlspalette enthalten.","Schnellauswahlfarbe für das Gruppieren von Bezeichnungen.","Schnellauswahlfarbe für das Gruppieren von Rahmen.","Farbe der Editor-Auswahl.","Farbe des gewählten Text für einen hohen Kontrast","Die Farbe der Auswahl befindet sich in einem inaktiven Editor. Die Farbe darf nicht deckend sein, weil sie sonst die zugrunde liegende Dekorationen verdeckt.","Farbe für Bereiche mit dem gleichen Inhalt wie die Auswahl. Die Farbe darf nicht deckend sein, weil sie sonst die zugrunde liegenden Dekorationen verdeckt.","Randfarbe für Bereiche, deren Inhalt der Auswahl entspricht.","Farbe des aktuellen Suchergebnisses.","Farbe der anderen Suchergebnisse. Die Farbe darf nicht deckend sein, weil sie sonst die zugrunde liegenden Dekorationen verdeckt.","Farbe des Bereichs, der die Suche eingrenzt. Die Farbe darf nicht deckend sein, damit sie nicht die zugrunde liegenden Dekorationen verdeckt.","Randfarbe des aktuellen Suchergebnisses.","Randfarbe der anderen Suchtreffer.","Rahmenfarbe des Bereichs, der die Suche eingrenzt. Die Farbe darf nicht deckend sein, weil sie sonst die zugrunde liegenden Dekorationen verdeckt.","Hervorhebung unterhalb des Worts, für das ein Hoverelement angezeigt wird. Die Farbe darf nicht deckend sein, weil sie sonst die zugrunde liegenden Dekorationen verdeckt.","Hintergrundfarbe des Editor-Mauszeigers.","Vordergrundfarbe des Editor-Mauszeigers","Rahmenfarbe des Editor-Mauszeigers.","Hintergrundfarbe der Hoverstatusleiste des Editors.","Farbe der aktiven Links.",'Die für das Aktionssymbol "Glühbirne" verwendete Farbe.','Die für das Aktionssymbol "Automatische Glühbirnenkorrektur" verwendete Farbe.',"Hintergrundfarbe für eingefügten Text. Die Farbe darf nicht deckend sein, weil sie sonst die zugrunde liegenden Dekorationen verdeckt.","Hintergrundfarbe für Text, der entfernt wurde. Die Farbe darf nicht deckend sein, weil sie sonst die zugrunde liegenden Dekorationen verdeckt.","Konturfarbe für eingefügten Text.","Konturfarbe für entfernten Text.","Die Rahmenfarbe zwischen zwei Text-Editoren.","Farbe der diagonalen Füllung des Vergleichs-Editors. Die diagonale Füllung wird in Ansichten mit parallelem Vergleich verwendet.","Hintergrundfarbe der Liste/Struktur für das fokussierte Element, wenn die Liste/Struktur aktiv ist. Eine aktive Liste/Struktur hat Tastaturfokus, eine inaktive hingegen nicht.","Vordergrundfarbe der Liste/Struktur für das fokussierte Element, wenn die Liste/Struktur aktiv ist. Eine aktive Liste/Struktur hat Tastaturfokus, eine inaktive hingegen nicht.","Hintergrundfarbe der Liste/Struktur für das ausgewählte Element, wenn die Liste/Struktur aktiv ist. Eine aktive Liste/Struktur hat Tastaturfokus, eine inaktive hingegen nicht.","Vordergrundfarbe der Liste/Struktur für das ausgewählte Element, wenn die Liste/Struktur aktiv ist. Eine aktive Liste/Struktur hat Tastaturfokus, eine inaktive hingegen nicht.","Hintergrundfarbe der Liste/Struktur für das ausgewählte Element, wenn die Liste/Struktur inaktiv ist. Eine aktive Liste/Struktur hat Tastaturfokus, eine inaktive hingegen nicht.","Vordergrundfarbe der Liste/Struktur für das ausgewählte Element, wenn die Liste/Baumstruktur inaktiv ist. Eine aktive Liste/Baumstruktur hat Tastaturfokus, eine inaktive hingegen nicht.","Hintergrundfarbe der Liste/Struktur für das fokussierte Element, wenn die Liste/Struktur inaktiv ist. Eine aktive Liste/Struktur hat Tastaturfokus, eine inaktive hingegen nicht.","Hintergrund der Liste/Struktur, wenn mit der Maus auf Elemente gezeigt wird.","Vordergrund der Liste/Struktur, wenn mit der Maus auf Elemente gezeigt wird.","Drag & Drop-Hintergrund der Liste/Struktur, wenn Elemente mithilfe der Maus verschoben werden.","Vordergrundfarbe der Liste/Struktur zur Trefferhervorhebung beim Suchen innerhalb der Liste/Struktur.","Hintergrundfarbe des Typfilterwidgets in Listen und Strukturen.","Konturfarbe des Typfilterwidgets in Listen und Strukturen.","Konturfarbe des Typfilterwidgets in Listen und Strukturen, wenn es keine Übereinstimmungen gibt.","Strukturstrichfarbe für die Einzugsführungslinien.","Rahmenfarbe von Menüs.","Vordergrundfarbe von Menüelementen.","Hintergrundfarbe von Menüelementen.","Vordergrundfarbe des ausgewählten Menüelements im Menü.","Hintergrundfarbe des ausgewählten Menüelements im Menü.","Rahmenfarbe des ausgewählten Menüelements im Menü.","Farbe eines Trenner-Menüelements in Menüs.","Hervorhebungs-Hintergrundfarbe eines Codeausschnitt-Tabstopps.","Hervorhebungs-Rahmenfarbe eines Codeausschnitt-Tabstopps.","Hervorhebungs-Hintergrundfarbe des letzten Tabstopps eines Codeausschnitts.","Rahmenfarbe zur Hervorhebung des letzten Tabstopps eines Codeausschnitts.","Übersichtslinealmarkerfarbe für das Suchen von Übereinstimmungen. Die Farbe darf nicht deckend sein, weil sie sonst die zugrunde liegenden Dekorationen verdeckt.","Übersichtslinealmarkerfarbe für das Hervorheben der Auswahl. Die Farbe darf nicht deckend sein, weil sie sonst die zugrunde liegenden Dekorationen verdeckt.","Minimap-Markerfarbe für gefundene Übereinstimmungen.","Minimap-Markerfarbe für die Editorauswahl.","Minimapmarkerfarbe für Fehler","Minimapmarkerfarbe für Warnungen","Hintergrundfarbe der Minimap.","Hintergrundfarbe des Minimap-Schiebereglers.","Hintergrundfarbe des Minimap-Schiebereglers beim Daraufzeigen.","Hintergrundfarbe des Minimap-Schiebereglers, wenn darauf geklickt wird.","Die Farbe, die für das Problemfehlersymbol verwendet wird.","Die Farbe, die für das Problemwarnsymbol verwendet wird.","Die Farbe, die für das Probleminfosymbol verwendet wird."], +"vs/platform/undoRedo/common/undoRedoService":["Die folgenden Dateien wurden geschlossen und auf dem Datenträger geändert: {0}.","Die folgenden Dateien wurden auf inkompatible Weise geändert: {0}.",'"{0}" konnte nicht für alle Dateien rückgängig gemacht werden. {1}','"{0}" konnte nicht für alle Dateien rückgängig gemacht werden. {1}','"{0}" konnte nicht für alle Dateien rückgängig gemacht werden, da Änderungen an {1} vorgenommen wurden.','"{0}" konnte nicht für alle Dateien rückgängig gemacht werden, weil bereits ein Vorgang zum Rückgängigmachen oder Wiederholen für "{1}" durchgeführt wird.','"{0}" konnte nicht für alle Dateien rückgängig gemacht werden, weil in der Zwischenzeit bereits ein Vorgang zum Rückgängigmachen oder Wiederholen durchgeführt wurde.','Möchten Sie "{0}" für alle Dateien rückgängig machen?',"In {0} Dateien rückgängig machen","Datei rückgängig machen","Abbrechen",'"{0}" konnte nicht rückgängig gemacht werden, weil bereits ein Vorgang zum Rückgängigmachen oder Wiederholen durchgeführt wird.','"{0}" konnte nicht in allen Dateien wiederholt werden. {1}','"{0}" konnte nicht in allen Dateien wiederholt werden. {1}','"{0}" konnte nicht in allen Dateien wiederholt werden, da Änderungen an {1} vorgenommen wurden.','"{0}" konnte nicht für alle Dateien wiederholt werden, weil bereits ein Vorgang zum Rückgängigmachen oder Wiederholen für "{1}" durchgeführt wird.','"{0}" konnte nicht für alle Dateien wiederholt werden, weil in der Zwischenzeit bereits ein Vorgang zum Rückgängigmachen oder Wiederholen durchgeführt wurde.','"{0}" konnte nicht wiederholt werden, weil bereits ein Vorgang zum Rückgängigmachen oder Wiederholen durchgeführt wird.'] +}); +//# sourceMappingURL=../../../min-maps/vs/editor/editor.main.nls.de.js.map \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/editor/editor.main.nls.es.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/editor/editor.main.nls.es.js new file mode 100644 index 0000000..465b0be --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/editor/editor.main.nls.es.js @@ -0,0 +1,42 @@ +/*!----------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Version: 0.21.2(67b5a8116f3c0bace36b180e524e05bb750a16d8) + * Released under the MIT license + * https://github.com/Microsoft/vscode/blob/master/LICENSE.txt + *-----------------------------------------------------------*/ +define("vs/editor/editor.main.nls.es",{"vs/base/browser/ui/actionbar/actionViewItems":["{0} ({1})"],"vs/base/browser/ui/findinput/findInput":["entrada"],"vs/base/browser/ui/findinput/findInputCheckboxes":["Coincidir mayúsculas y minúsculas","Solo palabras completas","Usar expresión regular"],"vs/base/browser/ui/findinput/replaceInput":["entrada","Conservar may/min"],"vs/base/browser/ui/inputbox/inputBox":["Error: {0}","Advertencia: {0}","Información: {0}"],"vs/base/browser/ui/keybindingLabel/keybindingLabel":["Sin enlazar"],"vs/base/browser/ui/menu/menu":["{0} ({1})"],"vs/base/browser/ui/tree/abstractTree":["Borrar","Desactivar filtro en tipo","Activar filtro en el tipo","No se encontraron elementos","{0} de {1} elementos coincidentes"], +"vs/base/common/errorMessage":["{0}: {1}","Error del sistema ({0})","Se ha producido un error desconocido. Consulte el registro para obtener más detalles.","Se ha producido un error desconocido. Consulte el registro para obtener más detalles.","{0} ({1} errores en total)","Se ha producido un error desconocido. Consulte el registro para obtener más detalles."],"vs/base/common/keybindingLabels":["Ctrl","Mayús","Alt","Windows","Ctrl","Mayús","Alt","Super","Control","Mayús","Alt","Comando","Control","Mayús","Alt","Windows","Control","Mayús","Alt","Super"],"vs/base/parts/quickinput/browser/quickInput":["Atrás","{0} / {1}","Escriba para restringir los resultados.","{0} resultados","{0} seleccionados","Aceptar","Personalizado","Atrás ({0})","Atrás"],"vs/base/parts/quickinput/browser/quickInputList":["Entrada rápida"],"vs/editor/browser/controller/coreCommands":["Anclar al final incluso cuando se vayan a líneas más largas","Anclar al final incluso cuando se vayan a líneas más largas"], +"vs/editor/browser/controller/textAreaHandler":["editor","El editor no es accesible en este momento. Pulse {0} para ver las opciones."],"vs/editor/browser/editorExtensions":["&&Deshacer","Deshacer","&&Rehacer","Rehacer","&&Seleccionar todo","Seleccionar todo"],"vs/editor/browser/widget/codeEditorWidget":["El número de cursores se ha limitado a {0}."],"vs/editor/browser/widget/diffEditorWidget":["Los archivos no se pueden comparar porque uno de ellos es demasiado grande."],"vs/editor/browser/widget/diffReview":["Cerrar","no se han cambiado líneas","1 línea cambiada","{0} líneas cambiadas","Diferencia {0} de {1}: línea original {2}, {3}, línea modificada {4}, {5}","vacío","{0} línea sin cambios {1}","{0} línea original {1} línea modificada {2}","+ {0} línea modificada {1}","- {0} línea original {1}","Ir a la siguiente diferencia","Ir a la diferencia anterior"], +"vs/editor/browser/widget/inlineDiffMargin":["Copiar líneas eliminadas","Copiar línea eliminada","Copiar la línea eliminada ({0})","Revertir este cambio","Copiar la línea eliminada ({0})"], +"vs/editor/common/config/commonEditorConfig":["Editor",'El número de espacios a los que equivale una tabulación. Este valor se invalida en función del contenido del archivo cuando "#editor.detectIndentation#" está activado.','Insertar espacios al presionar "TAB". Este valor se invalida en función del contenido del archivo cuando "#editor.detectIndentation#" está activado. ','Controla si "#editor.tabSize#" y "#editor.insertSpaces#" se detectarán automáticamente al abrir un archivo en función del contenido de este.',"Quitar el espacio en blanco final autoinsertado.","Manejo especial para archivos grandes para desactivar ciertas funciones de memoria intensiva.","Habilita sugerencias basadas en palabras.","El resaltado semántico está habilitado para todos los temas de color.","El resaltado semántico está deshabilitado para todos los temas de color.",'El resaltado semántico está configurado con el valor "semanticHighlighting" del tema de color actual.',"Controla si se muestra semanticHighlighting para los idiomas que lo admiten.",'Mantiene abiertos los editores interactivos, incluso al hacer doble clic en su contenido o presionar "Escape".',"Las lineas por encima de esta longitud no se tokenizarán por razones de rendimiento.","Tiempo de espera en milisegundos después del cual se cancela el cálculo de diferencias. Utilice 0 para no usar tiempo de espera.","Controla si el editor de diferencias muestra las diferencias en paralelo o alineadas.","Cuando está habilitado, el editor de diferencias omite los cambios en los espacios en blanco iniciales o finales.","Controla si el editor de diferencias muestra los indicadores +/- para los cambios agregados o quitados.","Controla si el editor muestra CodeLens."], +"vs/editor/common/config/editorOptions":["El editor usará API de plataforma para detectar cuándo está conectado un lector de pantalla.","El editor se optimizará de forma permanente para su uso con un editor de pantalla.","El editor nunca se optimizará para su uso con un lector de pantalla.","Controla si el editor se debe ejecutar en un modo optimizado para lectores de pantalla.","Controla si se inserta un carácter de espacio al comentar.","Controla si las líneas vacías deben ignorarse con la opción de alternar, agregar o quitar acciones para los comentarios de línea.","Controla si al copiar sin selección se copia la línea actual.","Controla si el cursor debe saltar para buscar coincidencias mientras se escribe.","Controla si la cadena de búsqueda del widget de búsqueda se inicializa desde la selección del editor.","No activar nunca Buscar en la selección automáticamente (predeterminado)","Activar siempre automáticamente Buscar en la selección","Active Buscar en la selección automáticamente cuando se seleccionen varias líneas de contenido.","Controla la condición para activar la búsqueda en la selección de forma automática.","Controla si el widget de búsqueda debe leer o modificar el Portapapeles de búsqueda compartido en macOS.","Controla si Encontrar widget debe agregar más líneas en la parte superior del editor. Si es true, puede desplazarse más allá de la primera línea cuando Encontrar widget está visible.","Controla si la búsqueda se reinicia automáticamente desde el principio (o el final) cuando no se encuentran más coincidencias.","Habilita o deshabilita las ligaduras tipográficas.","Configuración explícita de las características de fuente.","Configura ligaduras de fuentes o entidades de fuente.","Controla el tamaño de fuente en píxeles.",'Solo se permiten las palabras clave "normal" y "negrita" o los números entre 1 y 1000.','Controla el grosor de la fuente. Acepta las palabras clave "normal" y "negrita" o los números entre 1 y 1000.',"Mostrar vista de inspección de los resultados (predeterminado)","Ir al resultado principal y mostrar una vista de inspección","Vaya al resultado principal y habilite la navegación sin peek para otros",'Esta configuración está en desuso. Use configuraciones separadas como "editor.editor.gotoLocation.multipleDefinitions" o "editor.editor.gotoLocation.multipleImplementations" en su lugar.','Controla el comportamiento del comando "Ir a definición" cuando existen varias ubicaciones de destino.','Controla el comportamiento del comando "Ir a definición de tipo" cuando existen varias ubicaciones de destino.','Controla el comportamiento del comando "Ir a declaración" cuando existen varias ubicaciones de destino.','Controla el comportamiento del comando "Ir a implementaciones" cuando existen varias ubicaciones de destino.','Controla el comportamiento del comando "Ir a referencias" cuando existen varias ubicaciones de destino.','Identificador de comando alternativo que se ejecuta cuando el resultado de "Ir a definición" es la ubicación actual.','Id. de comando alternativo que se está ejecutando cuando el resultado de "Ir a definición de tipo" es la ubicación actual.','Id. de comando alternativo que se está ejecutando cuando el resultado de "Ir a declaración" es la ubicación actual.','Id. de comando alternativo que se está ejecutando cuando el resultado de "Ir a implementación" es la ubicación actual.','Identificador de comando alternativo que se ejecuta cuando el resultado de "Ir a referencia" es la ubicación actual.',"Controla si se muestra la información al mantener el puntero sobre un elemento.","Controla el retardo en milisegundos después del cual se muestra la información al mantener el puntero sobre un elemento.","Controla si la información que aparece al mantener el puntero sobre un elemento permanece visible al mover el mouse sobre este.","Habilita la bombilla de acción de código en el editor.","Controla la altura de línea. Usa 0 para utilizar la altura del tamaño de fuente.","Controla si se muestra el minimapa.","El minimapa tiene el mismo tamaño que el contenido del editor (y podría desplazarse).","El minimapa se estirará o reducirá según sea necesario para ocupar la altura del editor (sin desplazamiento).","El minimapa se reducirá según sea necesario para no ser nunca más grande que el editor (sin desplazamiento).","Controla el tamaño del minimapa.","Controla en qué lado se muestra el minimapa.","Controla cuándo se muestra el control deslizante del minimapa.","Escala del contenido dibujado en el minimapa: 1, 2 o 3.","Represente los caracteres reales en una línea, por oposición a los bloques de color.","Limite el ancho del minimapa para representar como mucho un número de columnas determinado.","Controla la cantidad de espacio entre el borde superior del editor y la primera línea.","Controla el espacio entre el borde inferior del editor y la última línea.","Habilita un elemento emergente que muestra documentación de los parámetros e información de los tipos mientras escribe.","Controla si el menú de sugerencias de parámetros se cicla o se cierra al llegar al final de la lista.","Habilita sugerencias rápidas en las cadenas.","Habilita sugerencias rápidas en los comentarios.","Habilita sugerencias rápidas fuera de las cadenas y los comentarios.","Controla si deben mostrarse sugerencias automáticamente mientras se escribe.","Los números de línea no se muestran.","Los números de línea se muestran como un número absoluto.","Los números de línea se muestran como distancia en líneas a la posición del cursor.","Los números de línea se muestran cada 10 líneas.","Controla la visualización de los números de línea.","Número de caracteres monoespaciales en los que se representará esta regla del editor.","Color de esta regla del editor.","Muestra reglas verticales después de un cierto número de caracteres monoespaciados. Usa múltiples valores para mostrar múltiples reglas. Si la matriz está vacía, no se muestran reglas.","Inserte la sugerencia sin sobrescribir el texto a la derecha del cursor.","Inserte la sugerencia y sobrescriba el texto a la derecha del cursor.","Controla si las palabras se sobrescriben al aceptar la finalización. Tenga en cuenta que esto depende de las extensiones que participan en esta característica.","Controla si el filtrado y la ordenación de sugerencias se tienen en cuenta para los errores ortográficos pequeños.","Controla si la ordenación de palabras mejora lo que aparece cerca del cursor.",'Controla si las selecciones de sugerencias recordadas se comparten entre múltiples áreas de trabajo y ventanas (necesita "#editor.suggestSelection#").',"Controla si un fragmento de código activo impide sugerencias rápidas.","Controla si mostrar u ocultar iconos en sugerencias.","Controla cuántas sugerencias mostrará IntelliSense antes de que aparezca una barra de desplazamiento (máximo 15).",'Esta configuración está en desuso. Use configuraciones separadas como "editor.suggest.showKeyword" o "editor.suggest.showSnippets" en su lugar.','Cuando está habilitado, IntelliSense muestra sugerencias de tipo "method".','Cuando está habilitado, IntelliSense muestra sugerencias de "función".','Cuando está habilitado, IntelliSense muestra sugerencias de tipo "constructor".','Cuando está habilitado, IntelliSense muestra sugerencias de tipo "field".','Cuando está habilitado, IntelliSense muestra sugerencias de tipo "variable".','Cuando está habilitado, IntelliSense muestra sugerencias de tipo "class".','Cuando está habilitado, IntelliSense muestra sugerencias de tipo "struct".','Cuando está habilitado, IntelliSense muestra sugerencias de tipo "interface".','Cuando está habilitado, IntelliSense muestra sugerencias de tipo "module".','Cuando está habilitado, IntelliSense muestra sugerencias de tipo "property".','Cuando está habilitado, IntelliSense muestra sugerencias de tipo "event".','Cuando está habilitado, IntelliSense muestra sugerencias de tipo "operator".','Cuando está habilitado, IntelliSense muestra sugerencias de tipo "unit".','Cuando está habilitado, IntelliSense muestra sugerencias de "value".','Cuando está habilitado, IntelliSense muestra sugerencias de tipo "constant".','Cuando está habilitado, IntelliSense muestra sugerencias de tipo "enum".','Cuando está habilitado, IntelliSense muestra sugerencias de tipo "enumMember".','Cuando está habilitado, IntelliSense muestra sugerencias de tipo "keyword".','Si está habilitado, IntelliSense muestra sugerencias de tipo "text".','Cuando está habilitado, IntelliSense muestra sugerencias de "color".','Cuando está habilitado, IntelliSense muestra sugerencias de tipo "file".','Cuando está habilitado, IntelliSense muestra sugerencias de tipo "reference".','Cuando está habilitado, IntelliSense muestra sugerencias de tipo "customcolor".','Si está habilitado, IntelliSense muestra sugerencias de tipo "folder".','Cuando está habilitado, IntelliSense muestra sugerencias de tipo "typeParameter".','Cuando está habilitado, IntelliSense muestra sugerencias de tipo "snippet".',"Cuando está habilitado, IntelliSense muestra sugerencias del usuario.","Cuando está habilitado IntelliSense muestra sugerencias para problemas.","Controla la visibilidad de la barra de estado en la parte inferior del widget de sugerencias.",'Controla si se deben aceptar sugerencias en los caracteres de confirmación. Por ejemplo, en Javascript, el punto y coma (";") puede ser un carácter de confirmación que acepta una sugerencia y escribe ese carácter.','Aceptar solo una sugerencia con "Entrar" cuando realiza un cambio textual.','Controla si las sugerencias deben aceptarse con "Entrar", además de "TAB". Ayuda a evitar la ambigüedad entre insertar nuevas líneas o aceptar sugerencias.',"Controla el número de líneas en el editor que puede leer un lector de pantalla. Advertencia: Esto puede afectar al rendimiento de números superiores al predeterminado.","Contenido del editor","Utilizar las configuraciones del lenguaje para determinar cuándo cerrar los corchetes automáticamente.","Cerrar automáticamente los corchetes cuando el cursor esté a la izquierda de un espacio en blanco.","Controla si el editor debe cerrar automáticamente los corchetes después de que el usuario agregue un corchete de apertura.","Escriba en las comillas o los corchetes solo si se insertaron automáticamente.","Controla si el editor debe escribir entre comillas o corchetes.","Utilizar las configuraciones del lenguaje para determinar cuándo cerrar las comillas automáticamente. ","Cerrar automáticamente las comillas cuando el cursor esté a la izquierda de un espacio en blanco. ","Controla si el editor debe cerrar automáticamente las comillas después de que el usuario agrega uma comilla de apertura.","El editor no insertará la sangría automáticamente.","El editor mantendrá la sangría de la línea actual.","El editor respetará la sangría de la línea actual y los corchetes definidos por el idioma.","El editor mantendrá la sangría de la línea actual, respetará los corchetes definidos por el idioma e invocará onEnterRules especiales definidos por idiomas.","El editor respetará la sangría de la línea actual, los corchetes definidos por idiomas y las reglas indentationRules definidas por idiomas, además de invocar reglas onEnterRules especiales.","Controla si el editor debe ajustar automáticamente la sangría mientras los usuarios escriben, pegan, mueven o sangran líneas.","Use las configuraciones de idioma para determinar cuándo delimitar las selecciones automáticamente.","Envolver con comillas, pero no con corchetes.","Envolver con corchetes, pero no con comillas.","Controla si el editor debe delimitar automáticamente las selecciones.","Controla si el editor muestra CodeLens.","Controla si el editor debe representar el Selector de colores y los elementos Decorator de color en línea.","Habilite que la selección con el mouse y las teclas esté realizando la selección de columnas.","Controla si el resaltado de sintaxis debe ser copiado al portapapeles.","Controla el estilo de animación del cursor.","Controla si la animación suave del cursor debe estar habilitada.","Controla el estilo del cursor.",'Controla el número mínimo de líneas iniciales y finales visibles que rodean al cursor. Se conoce como "scrollOff" o "scrollOffset" en algunos otros editores.','Solo se aplica "cursorSurroundingLines" cuando se desencadena mediante el teclado o la API.','"cursorSurroundingLines" se aplica siempre.','Controla cuando se debe aplicar "cursorSurroundingLines".','Controla el ancho del cursor cuando "#editor.cursorStyle#" se establece en "line".',"Controla si el editor debe permitir mover las selecciones mediante arrastrar y colocar.",'Multiplicador de la velocidad de desplazamiento al presionar "Alt".',"Controla si el editor tiene el plegado de código habilitado.","Utilice una estrategia de plegado específica del idioma, si está disponible, de lo contrario la basada en sangría.","Utilice la estrategia de plegado basada en sangría.","Controla la estrategia para calcular rangos de plegado.","Controla si el editor debe destacar los rangos plegados.","Controla si al hacer clic en el contenido vacío después de una línea plegada se desplegará la línea.","Controla la familia de fuentes.","Controla si el editor debe dar formato automáticamente al contenido pegado. Debe haber disponible un formateador capaz de aplicar formato a un rango dentro de un documento. ","Controla si el editor debe dar formato a la línea automáticamente después de escribirla.","Controla si el editor debe representar el margen de glifo vertical. El margen de glifo se usa, principalmente, para depuración.","Controla si el cursor debe ocultarse en la regla de información general.","Controla si el editor debe resaltar la guía de sangría activa.","Controla el espacio entre letras en píxeles.","Controla si el editor debe detectar vínculos y hacerlos interactivos.","Resaltar paréntesis coincidentes.",'Se usará un multiplicador en los eventos de desplazamiento de la rueda del mouse "deltaX" y "deltaY". ','Ampliar la fuente del editor cuando se use la rueda del mouse mientras se presiona "Ctrl".',"Combinar varios cursores cuando se solapan.",'Se asigna a "Control" en Windows y Linux y a "Comando" en macOS.','Se asigna a "Alt" en Windows y Linux y a "Opción" en macOS.',"El modificador que se usará para agregar varios cursores con el mouse. Los gestos del mouse Ir a definición y Abrir vínculo se adaptarán de modo que no entren en conflicto con el modificador multicursor. [Más información](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).","Cada cursor pega una única línea del texto.","Cada cursor pega el texto completo.","Controla el pegado cuando el recuento de líneas del texto pegado coincide con el recuento de cursores.","Controla si el editor debe resaltar las apariciones de símbolos semánticos.","Controla si debe dibujarse un borde alrededor de la regla de información general.","Enfocar el árbol al abrir la inspección","Enfocar el editor al abrir la inspección","Controla si se debe enfocar el editor en línea o el árbol en el widget de vista.","Controla si el gesto del mouse Ir a definición siempre abre el widget interactivo.","Controla el retraso, en milisegundos, tras el cual aparecerán sugerencias rápidas.","Controla si el editor cambia el nombre automáticamente en el tipo.","Controla si el editor debe representar caracteres de control.","Controla si el editor debe representar guías de sangría.","Representar el número de la última línea cuando el archivo termina con un salto de línea.","Resalta el medianil y la línea actual.","Controla cómo debe representar el editor el resaltado de línea actual.","Controla si el editor debe representar el resaltado de la línea actual solo cuando el editor está enfocado","Representa caracteres de espacio en blanco, excepto los espacios individuales entre palabras.","Represente los caracteres de espacio en blanco solo en el texto seleccionado.","Representar solo los caracteres de espacio en blanco al final","Controla la forma en que el editor debe representar los caracteres de espacio en blanco.","Controla si las selecciones deberían tener las esquinas redondeadas.","Controla el número de caracteres adicionales a partir del cual el editor se desplazará horizontalmente.","Controla si el editor seguirá haciendo scroll después de la última línea.","Desplácese solo a lo largo del eje predominante cuando se desplace vertical y horizontalmente al mismo tiempo. Evita la deriva horizontal cuando se desplaza verticalmente en un trackpad.","Controla si el portapapeles principal de Linux debe admitirse.","Controla si el editor debe destacar las coincidencias similares a la selección.","Mostrar siempre los controles de plegado.","Mostrar solo los controles de plegado cuando el mouse está sobre el medianil.","Controla cuándo se muestran los controles de plegado en el medianil.","Controla el fundido de salida del código no usado.","Controla las variables en desuso tachadas.","Mostrar sugerencias de fragmentos de código por encima de otras sugerencias.","Mostrar sugerencias de fragmentos de código por debajo de otras sugerencias.","Mostrar sugerencias de fragmentos de código con otras sugerencias.","No mostrar sugerencias de fragmentos de código.","Controla si se muestran los fragmentos de código con otras sugerencias y cómo se ordenan.","Controla si el editor se desplazará con una animación.","Tamaño de la fuente para el widget de sugerencias. Cuando se establece a `0`, se utilizará el valor `#editor.fontSize#`.","Altura de la línea del widget de sugerencias. Cuando se establece a `0`, se utiliza el valor `#editor.lineHeight#`.","Controla si deben aparecer sugerencias de forma automática al escribir caracteres desencadenadores.","Seleccionar siempre la primera sugerencia.",'Seleccione sugerencias recientes a menos que al escribir más se seleccione una, por ejemplo, "console.| -> console.log" porque "log" se ha completado recientemente.','Seleccione sugerencias basadas en prefijos anteriores que han completado esas sugerencias, por ejemplo, "co -> console" y "con -> const".',"Controla cómo se preseleccionan las sugerencias cuando se muestra la lista,","La pestaña se completará insertando la mejor sugerencia de coincidencia encontrada al presionar la pestaña","Deshabilitar los complementos para pestañas.","La pestaña se completa con fragmentos de código cuando su prefijo coincide. Funciona mejor cuando las 'quickSuggestions' no están habilitadas.","Habilita completar pestañas.","Los terminadores de línea no habituales se omiten.","Advertencia de terminadores de línea inusuales que se quitarán.","Los terminadores de línea no habituales se quitan automáticamente.","Quite los terminadores de línea inusuales que podrían provocar problemas.","La inserción y eliminación del espacio en blanco sigue a las tabulaciones.","Caracteres que se usarán como separadores de palabras al realizar operaciones o navegaciones relacionadas con palabras.","Las líneas no se ajustarán nunca.","Las líneas se ajustarán en el ancho de la ventanilla.",'Las líneas se ajustarán al valor de "#editor.wordWrapColumn#". ','Las líneas se ajustarán al valor que sea inferior: el tamaño de la ventanilla o el valor de "#editor.wordWrapColumn#".',"Controla cómo deben ajustarse las líneas.",'Controla la columna de ajuste del editor cuando "#editor.wordWrap#" es "wordWrapColumn" o "bounded".',"No hay sangría. Las líneas ajustadas comienzan en la columna 1.","A las líneas ajustadas se les aplica la misma sangría que al elemento primario.","A las líneas ajustadas se les aplica una sangría de +1 respecto al elemento primario.","A las líneas ajustadas se les aplica una sangría de +2 respecto al elemento primario.","Controla la sangría de las líneas ajustadas.","Se supone que todos los caracteres son del mismo ancho. Este es un algoritmo rápido que funciona correctamente para fuentes monoespaciales y ciertos scripts (como caracteres latinos) donde los glifos tienen el mismo ancho.","Delega el cálculo de puntos de ajuste en el explorador. Es un algoritmo lento, que podría causar bloqueos para archivos grandes, pero funciona correctamente en todos los casos.","Controla el algoritmo que calcula los puntos de ajuste."], +"vs/editor/common/model/editStack":["Escribiendo"],"vs/editor/common/modes/modesRegistry":["Texto sin formato"], +"vs/editor/common/standaloneStrings":["Sin selección","Línea {0}, columna {1} ({2} seleccionadas)","Línea {0}, columna {1}","{0} selecciones ({1} caracteres seleccionados)","{0} selecciones",'Se cambiará ahora el valor "accessibilitySupport" a "activado".',"Se abrirá ahora la página de documentación de accesibilidad del editor.","en un panel de solo lectura de un editor de diferencias.","en un panel de un editor de diferencias.","en un editor de código de solo lectura"," en un editor de código","Para configurar el editor de forma que se optimice su uso con un lector de pantalla, presione ahora Comando+E.","Para configurar el editor de forma que se optimice su uso con un lector de pantalla, presione ahora Control+E.","El editor está configurado para optimizarse para su uso con un lector de pantalla.","El editor está configurado para que no se optimice nunca su uso con un lector de pantalla, que en este momento no es el caso.","Al presionar TAB en el editor actual, el foco se mueve al siguiente elemento activable. Presione {0} para activar o desactivar este comportamiento.","Al presionar TAB en el editor actual, el foco se mueve al siguiente elemento activable. El comando {0} no se puede desencadenar actualmente mediante un enlace de teclado.","Al presionar TAB en el editor actual, se insertará el carácter de tabulación. Presione {0} para activar o desactivar este comportamiento.","Al presionar TAB en el editor actual, se insertará el carácter de tabulación. El comando {0} no se puede desencadenar actualmente mediante un enlace de teclado.","Presione ahora Comando+H para abrir una ventana del explorador con más información relacionada con la accesibilidad del editor.","Presione ahora Control+H para abrir una ventana del explorador con más información relacionada con la accesibilidad del editor.","Para descartar esta información sobre herramientas y volver al editor, presione Esc o Mayús+Escape.","Mostrar ayuda de accesibilidad","Desarrollador: inspeccionar tokens","Vaya a Línea/Columna...","Mostrar todos los proveedores de acceso rápido","Paleta de comandos","Mostrar y ejecutar comandos","Ir a símbolo...","Ir a símbolo por categoría...","Contenido del editor","Presione Alt+F1 para ver las opciones de accesibilidad.","Alternar tema de contraste alto","{0} ediciones realizadas en {1} archivos"], +"vs/editor/common/view/editorColorRegistry":["Color de fondo para la línea resaltada en la posición del cursor.","Color de fondo del borde alrededor de la línea en la posición del cursor.","Color de fondo de rangos resaltados, como en abrir rápido y encontrar características. El color no debe ser opaco para no ocultar decoraciones subyacentes.","Color de fondo del borde alrededor de los intervalos resaltados.","Color de fondo del símbolo destacado, como Ir a definición o Ir al siguiente/anterior símbolo. El color no debe ser opaco para no ocultar la decoración subyacente.","Color de fondo del borde alrededor de los símbolos resaltados.","Color del cursor del editor.","Color de fondo del cursor de edición. Permite personalizar el color del caracter solapado por el bloque del cursor.","Color de los caracteres de espacio en blanco del editor.","Color de las guías de sangría del editor.","Color de las guías de sangría activas del editor.","Color de números de línea del editor.","Color del número de línea activa en el editor","ID es obsoleto. Usar en lugar 'editorLineNumber.activeForeground'. ","Color del número de línea activa en el editor","Color de las reglas del editor","Color principal de lentes de código en el editor","Color de fondo tras corchetes coincidentes","Color de bloques con corchetes coincidentes","Color del borde de la regla de visión general.","Color de fondo de la regla de información general del editor. Solo se usa cuando el minimapa está habilitado y está ubicado en el lado derecho del editor.","Color de fondo del margen del editor. Este espacio contiene los márgenes de glifos y los números de línea.","Color del borde de código fuente innecesario (sin usar) en el editor.","Opacidad de código fuente innecesario (sin usar) en el editor. Por ejemplo, \"#000000c0\" representará el código con un 75 % de opacidad. Para temas de alto contraste, utilice el color del tema 'editorUnnecessaryCode.border' para resaltar el código innecesario en vez de atenuarlo.","Color de marcador de regla general para los destacados de rango. El color no debe ser opaco para no ocultar las decoraciones subyacentes.","Color de marcador de regla de información general para errores. ","Color de marcador de regla de información general para advertencias.","Color de marcador de regla de información general para mensajes informativos. "], +"vs/editor/contrib/anchorSelect/anchorSelect":["Delimitador de la selección","Delimitador establecido en {0}:{1}","Establecer el delimitador de la selección","Ir al delimitador de la selección","Seleccionar desde el delimitador hasta el cursor","Cancelar el delimitador de la selección"],"vs/editor/contrib/bracketMatching/bracketMatching":["Resumen color de marcador de regla para corchetes.","Ir al corchete","Seleccionar para corchete","Ir al &&corchete"],"vs/editor/contrib/caretOperations/caretOperations":["Mover el texto seleccionado a la izquierda","Mover el texto seleccionado a la derecha"],"vs/editor/contrib/caretOperations/transpose":["Transponer letras"],"vs/editor/contrib/clipboard/clipboard":["Cor&&tar","Cortar","Cortar","C&&opiar","Copiar","Copiar","&&Pegar","Pegar","Pegar","Copiar con resaltado de sintaxis"], +"vs/editor/contrib/codeAction/codeActionCommands":["Tipo de la acción de código que se va a ejecutar.","Controla cuándo se aplican las acciones devueltas.","Aplicar siempre la primera acción de código devuelto.","Aplicar la primera acción de código devuelta si solo hay una.","No aplique las acciones de código devuelto.","Controla si solo se deben devolver las acciones de código preferidas.","Se ha producido un error desconocido al aplicar la acción de código","Corrección Rápida","No hay acciones de código disponibles",'No hay acciones de código preferidas para "{0}" disponibles','No hay ninguna acción de código para "{0}" disponible.',"No hay acciones de código preferidas disponibles","No hay acciones de código disponibles","Refactorizar...",'No hay refactorizaciones preferidas de "{0}" disponibles','No hay refactorizaciones de "{0}" disponibles',"No hay ninguna refactorización favorita disponible.","No hay refactorizaciones disponibles","Acción de Origen...",'No hay acciones de origen preferidas para "{0}" disponibles','No hay ninguna acción de origen para "{0}" disponible.',"No hay ninguna acción de origen favorita disponible.","No hay acciones de origen disponibles","Organizar Importaciones","No hay acciones de importación disponibles","Corregir todo","No está disponible la acción de corregir todo","Corregir automáticamente...","No hay autocorrecciones disponibles"], +"vs/editor/contrib/codeAction/lightBulbWidget":["Mostrar correcciones. Solución preferida disponible ({0})","Mostrar correcciones ({0})","Mostrar correcciones"],"vs/editor/contrib/codelens/codelensController":["Mostrar comandos de lente de código para la línea actual"],"vs/editor/contrib/comment/comment":["Alternar comentario de línea","&&Alternar comentario de línea","Agregar comentario de línea","Quitar comentario de línea","Alternar comentario de bloque","Alternar &&bloque de comentario"],"vs/editor/contrib/contextmenu/contextmenu":["Mostrar menú contextual del editor"],"vs/editor/contrib/cursorUndo/cursorUndo":["Cursor Deshacer","Cursor Rehacer"], +"vs/editor/contrib/documentSymbols/outlineTree":["Color de primer plano de los símbolos de matriz. Estos símbolos aparecen en el contorno, la ruta de navegación y el widget de sugerencias.","Color de primer plano de los símbolos booleanos. Estos símbolos aparecen en el contorno, la ruta de navegación y el widget de sugerencias.","Color de primer plano de los símbolos de clase. Estos símbolos aparecen en el contorno, la ruta de navegación y el widget de sugerencias.","Color de primer plano de los símbolos de color. Estos símbolos aparecen en el contorno, la ruta de navegación y el widget de sugerencias.","Color de primer plano de los símbolos constantes. Estos símbolos aparecen en el contorno, la ruta de navegación y el widget de sugerencias.","Color de primer plano de los símbolos de constructor. Estos símbolos aparecen en el contorno, la ruta de navegación y el widget de sugerencias.","Color de primer plano de los símbolos de enumerador. Estos símbolos aparecen en el contorno, la ruta de navegación y el widget de sugerencias.","Color de primer plano de los símbolos de miembro del enumerador. Estos símbolos aparecen en el contorno, la ruta de navegación y el widget de sugerencias.","Color de primer plano de los símbolos de evento. Estos símbolos aparecen en el contorno, la ruta de navegación y el widget de sugerencias.","Color de primer plano de los símbolos de campo. Estos símbolos aparecen en el contorno, la ruta de navegación y el widget de sugerencias.","Color de primer plano de los símbolos de archivo. Estos símbolos aparecen en el contorno, la ruta de navegación y el widget de sugerencias.","Color de primer plano de los símbolos de carpeta. Estos símbolos aparecen en el contorno, la ruta de navegación y el widget de sugerencias.","Color de primer plano de los símbolos de función. Estos símbolos aparecen en el contorno, la ruta de navegación y el widget de sugerencias.","Color de primer plano de los símbolos de interfaz. Estos símbolos aparecen en el contorno, la ruta de navegación y el widget de sugerencias.","Color de primer plano de los símbolos de claves. Estos símbolos aparecen en el contorno, la ruta de navegación y el widget de sugerencias.","Color de primer plano de los símbolos de palabra clave. Estos símbolos aparecen en el contorno, la ruta de navegación y el widget de sugerencias.","Color de primer plano de los símbolos de método. Estos símbolos aparecen en el contorno, la ruta de navegación y el widget de sugerencias.","Color de primer plano de los símbolos de módulo. Estos símbolos aparecen en el contorno, la ruta de navegación y el widget de sugerencias.","Color de primer plano de los símbolos de espacio de nombres. Estos símbolos aparecen en el contorno, la ruta de navegación y el widget de sugerencias.","Color de primer plano de los símbolos nulos. Estos símbolos aparecen en el contorno, la ruta de navegación y el widget de sugerencias.","Color de primer plano para los símbolos numéricos. Estos símbolos aparecen en el contorno, la ruta de navegación y el widget de sugerencias.","Color de primer plano de los símbolos de objeto. Estos símbolos aparecen en el contorno, la ruta de navegación y el widget de sugerencias.","Color de primer plano para los símbolos del operador. Estos símbolos aparecen en el contorno, la ruta de navegación y el widget de sugerencias.","Color de primer plano de los símbolos de paquete. Estos símbolos aparecen en el contorno, la ruta de navegación y el widget de sugerencias.","Color de primer plano de los símbolos de propiedad. Estos símbolos aparecen en el contorno, la ruta de navegación y el widget de sugerencias.","Color de primer plano de los símbolos de referencia. Estos símbolos aparecen en el contorno, la ruta de navegación y el widget de sugerencias.","Color de primer plano de los símbolos de fragmento de código. Estos símbolos aparecen en el contorno, la ruta de navegación y el widget de sugerencias.","Color de primer plano de los símbolos de cadena. Estos símbolos aparecen en el contorno, la ruta de navegación y el widget de sugerencias.","Color de primer plano de los símbolos de estructura. Estos símbolos aparecen en el contorno, la ruta de navegación y el widget de sugerencias.","Color de primer plano de los símbolos de texto. Estos símbolos aparecen en el contorno, la ruta de navegación y el widget de sugerencias.","Color de primer plano para los símbolos de parámetro de tipo. Estos símbolos aparecen en el contorno, la ruta de navegación y el widget de sugerencias.","Color de primer plano de los símbolos de unidad. Estos símbolos aparecen en el contorno, la ruta de navegación y el widget de sugerencias.","Color de primer plano de los símbolos variables. Estos símbolos aparecen en el contorno, la ruta de navegación y el widget de sugerencias."], +"vs/editor/contrib/find/findController":["Buscar","&&Buscar","Buscar con selección","Buscar siguiente","Buscar siguiente","Buscar anterior","Buscar anterior","Buscar selección siguiente","Buscar selección anterior","Reemplazar","&&Reemplazar"],"vs/editor/contrib/find/findWidget":["Buscar","Buscar","Coincidencia anterior","Próxima coincidencia","Buscar en selección","Cerrar","Reemplazar","Reemplazar","Reemplazar","Reemplazar todo","Alternar modo de reemplazar","Sólo los primeros {0} resultados son resaltados, pero todas las operaciones de búsqueda trabajan en todo el texto.","{0} de {1}","No hay resultados","Encontrados: {0}",'{0} encontrado para "{1}"','{0} encontrado para "{1}", en {2}','{0} encontrado para "{1}"',"Ctrl+Entrar ahora inserta un salto de línea en lugar de reemplazar todo. Puede modificar el enlace de claves para editor.action.replaceAll para invalidar este comportamiento."], +"vs/editor/contrib/folding/folding":["Desplegar","Desplegar de forma recursiva","Plegar","Alternar plegado","Plegar de forma recursiva","Cerrar todos los comentarios de bloque","Plegar todas las regiones","Desplegar Todas las Regiones","Plegar todo","Desplegar todo","Nivel de plegamiento {0}","Color de fondo detrás de los rangos plegados. El color no debe ser opaco para no ocultar las decoraciones subyacentes.","Color del control plegable en el medianil del editor."],"vs/editor/contrib/fontZoom/fontZoom":["Acercarse a la tipografía del editor","Alejarse de la tipografía del editor","Restablecer alejamiento de la tipografía del editor"],"vs/editor/contrib/format/format":["1 edición de formato en la línea {0}","{0} ediciones de formato en la línea {1}","1 edición de formato entre las líneas {0} y {1}","{0} ediciones de formato entre las líneas {1} y {2}"],"vs/editor/contrib/format/formatActions":["Dar formato al documento","Dar formato a la selección"], +"vs/editor/contrib/gotoError/gotoError":["Ir al siguiente problema (Error, Advertencia, Información)","Ir al problema anterior (Error, Advertencia, Información)","Ir al siguiente problema en Archivos (Error, Advertencia, Información)","Siguiente &&problema","Ir al problema anterior en Archivos (Error, Advertencia, Información)","Anterior &&problema"],"vs/editor/contrib/gotoError/gotoErrorWidget":["Error","Advertencia","Información","Sugerencia","{0} en {1}. ","{0} de {1} problemas","{0} de {1} problema","Color de los errores del widget de navegación de marcadores del editor.","Color de las advertencias del widget de navegación de marcadores del editor.","Color del widget informativo marcador de navegación en el editor.","Fondo del widget de navegación de marcadores del editor."], +"vs/editor/contrib/gotoSymbol/goToCommands":["Ver","Definiciones",'No se encontró ninguna definición para "{0}"',"No se encontró ninguna definición","Ir a definición","Ir a &&definición","Abrir definición en el lateral","Ver la definición sin salir","Declaraciones","No se encontró ninguna definición para '{0}'","No se encontró ninguna declaración","Ir a Definición","Ir a &&Declaración","No se encontró ninguna definición para '{0}'","No se encontró ninguna declaración","Inspeccionar Definición","Definiciones de tipo",'No se encontró ninguna definición de tipo para "{0}"',"No se encontró ninguna definición de tipo","Ir a la definición de tipo","Ir a la definición de &&tipo","Inspeccionar definición de tipo","Implementaciones",'No se encontró ninguna implementación para "{0}"',"No se encontró ninguna implementación","Ir a Implementaciones","Ir a &&Implementaciones","Inspeccionar implementaciones",'No se ha encontrado ninguna referencia para "{0}".',"No se encontraron referencias","Ir a Referencias","Ir a &&Referencias","Referencias","Inspeccionar Referencias","Referencias","Ir a cualquier símbolo","Ubicaciones",'No hay resultados para "{0}"',"Referencias"], +"vs/editor/contrib/gotoSymbol/link/goToDefinitionAtPosition":["Haga clic para mostrar {0} definiciones."],"vs/editor/contrib/gotoSymbol/peek/referencesController":["Cargando...","{0} ({1})"],"vs/editor/contrib/gotoSymbol/peek/referencesTree":["{0} referencias","{0} referencia","Referencias"],"vs/editor/contrib/gotoSymbol/peek/referencesWidget":["vista previa no disponible","No hay resultados","Referencias"],"vs/editor/contrib/gotoSymbol/referencesModel":["símbolo en {0} linea {1} en la columna {2}","1 símbolo en {0}, ruta de acceso completa {1}","{0} símbolos en {1}, ruta de acceso completa {2}","No se encontraron resultados","Encontró 1 símbolo en {0}","Encontró {0} símbolos en {1}","Encontró {0} símbolos en {1} archivos"],"vs/editor/contrib/gotoSymbol/symbolNavigation":["Símbolo {0} de {1}, {2} para el siguiente","Símbolo {0} de {1}"],"vs/editor/contrib/hover/hover":["Mostrar al mantener el puntero","Mostrar vista previa de la definición que aparece al mover el puntero"], +"vs/editor/contrib/hover/modesContentHover":["Cargando...","Ver problema","Buscando correcciones rápidas...","No hay correcciones rápidas disponibles","Corrección Rápida"],"vs/editor/contrib/inPlaceReplace/inPlaceReplace":["Reemplazar con el valor anterior","Reemplazar con el valor siguiente"],"vs/editor/contrib/indentation/indentation":["Convertir sangría en espacios","Convertir sangría en tabulaciones","Tamaño de tabulación configurado","Seleccionar tamaño de tabulación para el archivo actual","Aplicar sangría con tabulaciones","Aplicar sangría con espacios","Detectar sangría del contenido","Volver a aplicar sangría a líneas","Volver a aplicar sangría a líneas seleccionadas"], +"vs/editor/contrib/linesOperations/linesOperations":["Copiar línea arriba","&&Copiar línea arriba","Copiar línea abajo","Co&&piar línea abajo","Selección duplicada","&&Duplicar selección","Mover línea hacia arriba","Mo&&ver línea arriba","Mover línea hacia abajo","Mover &&línea abajo","Ordenar líneas en orden ascendente","Ordenar líneas en orden descendente","Recortar espacio final","Eliminar línea","Sangría de línea","Anular sangría de línea","Insertar línea arriba","Insertar línea debajo","Eliminar todo a la izquierda","Eliminar todo lo que está a la derecha","Unir líneas","Transponer caracteres alrededor del cursor","Transformar a mayúsculas","Transformar a minúsculas","Transformar en Title Case"],"vs/editor/contrib/links/links":["Ejecutar comando","Seguir vínculo","cmd + clic","ctrl + clic","opción + clic","alt + clic","No se pudo abrir este vínculo porque no tiene un formato correcto: {0}","No se pudo abrir este vínculo porque falta el destino.","Abrir vínculo"], +"vs/editor/contrib/message/messageController":["No se puede editar en un editor de sólo lectura"],"vs/editor/contrib/multicursor/multicursor":["Agregar cursor arriba","&&Agregar cursor arriba","Agregar cursor debajo","A&&gregar cursor abajo","Añadir cursores a finales de línea","Agregar c&&ursores a extremos de línea","Añadir cursores a la parte inferior","Añadir cursores a la parte superior","Agregar selección hasta la siguiente coincidencia de búsqueda","Agregar &&siguiente repetición","Agregar selección hasta la anterior coincidencia de búsqueda","Agregar r&&epetición anterior","Mover última selección hasta la siguiente coincidencia de búsqueda","Mover última selección hasta la anterior coincidencia de búsqueda","Seleccionar todas las repeticiones de coincidencia de búsqueda","Seleccionar todas las &&repeticiones","Cambiar todas las ocurrencias"],"vs/editor/contrib/parameterHints/parameterHints":["Sugerencias para parámetros Trigger"], +"vs/editor/contrib/parameterHints/parameterHintsWidget":["{0}, sugerencia"], +"vs/editor/contrib/peekView/peekView":["Cerrar","Color de fondo del área de título de la vista de inspección.","Color del título de la vista de inpección.","Color de la información del título de la vista de inspección.","Color de los bordes y la flecha de la vista de inspección.","Color de fondo de la lista de resultados de vista de inspección.","Color de primer plano de los nodos de inspección en la lista de resultados.","Color de primer plano de los archivos de inspección en la lista de resultados.","Color de fondo de la entrada seleccionada en la lista de resultados de vista de inspección.","Color de primer plano de la entrada seleccionada en la lista de resultados de vista de inspección.","Color de fondo del editor de vista de inspección.","Color de fondo del margen en el editor de vista de inspección.","Buscar coincidencia con el color de resaltado de la lista de resultados de vista de inspección.","Buscar coincidencia del color de resultado del editor de vista de inspección.","Hacer coincidir el borde resaltado en el editor de vista previa."], +"vs/editor/contrib/quickAccess/gotoLineQuickAccess":["Abra primero un editor de texto para ir a una línea.","Vaya a la línea {0} y a la columna {1}.","Ir a la línea {0}.","Línea actual: {0}, Carácter: {1}. Escriba un número de línea entre 1 y {2} a los que navegar.","Línea actual: {0}, Carácter: {1}. Escriba un número de línea al que navegar."], +"vs/editor/contrib/quickAccess/gotoSymbolQuickAccess":["Para ir a un símbolo, primero abra un editor de texto con información de símbolo.","El editor de texto activo no proporciona información de símbolos.","No hay ningún símbolo del editor coincidente.","No hay símbolos del editor.","Abrir en el lateral","Abrir en la parte inferior","símbolos ({0})","propiedades ({0})","métodos ({0})","funciones ({0})","constructores ({0})","variables ({0})","clases ({0})","estructuras ({0})","eventos ({0})","operadores ({0})","interfaces ({0})","espacios de nombres ({0})","paquetes ({0})","parámetros de tipo ({0})","módulos ({0})","propiedades ({0})","enumeraciones ({0})","miembros de enumeración ({0})","cadenas ({0})","archivos ({0})","matrices ({0})","números ({0})","booleanos ({0})","objetos ({0})","claves ({0})","campos ({0})","constantes ({0})"],"vs/editor/contrib/rename/onTypeRename":["Al escribir Cambiar nombre de símbolo","Color de fondo cuando el editor cambia el nombre automáticamente al escribir."], +"vs/editor/contrib/rename/rename":["No hay ningún resultado.","Error desconocido al resolver el cambio de nombre de la ubicación",'Cambiando el nombre de "{0}"',"Cambiar el nombre de {0}","Nombre cambiado correctamente de '{0}' a '{1}'. Resumen: {2}","No se pudo cambiar el nombre a las ediciones de aplicación","No se pudo cambiar el nombre de las ediciones de cálculo","Cambiar el nombre del símbolo","Activar/desactivar la capacidad de previsualizar los cambios antes de cambiar el nombre"],"vs/editor/contrib/rename/renameInputField":["Cambie el nombre de la entrada. Escriba el nuevo nombre y presione Entrar para confirmar.","{0} para cambiar de nombre, {1} para obtener una vista previa"],"vs/editor/contrib/smartSelect/smartSelect":["Expandir selección","&&Expandir selección","Reducir la selección","&&Reducir selección"], +"vs/editor/contrib/snippet/snippetVariables":["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado","Dom","Lun","Mar","Mié","Jue","Vie","Sáb","Enero","Febrero","Marzo","Abril","May","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre","Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],"vs/editor/contrib/suggest/suggestController":['Aceptando "{0}" ediciones adicionales de {1} realizadas',"Sugerencias para Trigger","{0} para insertar","{0} para insertar","{0} para reemplazar","{0} para reemplazar","{0} para insertar","mostrar menos","mostrar más"],"vs/editor/contrib/suggest/suggestWidget":["Color de fondo del widget sugerido.","Color de borde del widget sugerido.","Color de primer plano del widget sugerido.","Color de fondo de la entrada seleccionada del widget sugerido.","Color del resaltado coincidido en el widget sugerido.","Leer más ({0})","Leer menos ({0})","Cargando...","Cargando...","No hay sugerencias.","{0}, documentos: {1}","Sugerir"], +"vs/editor/contrib/toggleTabFocusMode/toggleTabFocusMode":["Alternar tecla de tabulación para mover el punto de atención","Presionando la pestaña ahora moverá el foco al siguiente elemento enfocable.","Presionando la pestaña ahora insertará el carácter de tabulación"],"vs/editor/contrib/tokenization/tokenization":["Desarrollador: forzar nueva aplicación de token"],"vs/editor/contrib/unusualLineTerminators/unusualLineTerminators":["Terminadores de línea inusuales","Se han detectado terminadores de línea inusuales",'Este archivo contiene uno o varios caracteres de terminador de línea inusuales, como Separador de líneas (LS) o Separador de párrafos (PS).\r\n\r\nSe recomienda quitarlos del archivo. Se puede configurar a través de "editor.unusualLineTerminators".',"Corregir este archivo","Ignorar problema para este archivo"], +"vs/editor/contrib/wordHighlighter/wordHighlighter":["Color de fondo de un símbolo durante el acceso de lectura, como la lectura de una variable. El color no debe ser opaco para no ocultar decoraciones subyacentes.","Color de fondo de un símbolo durante el acceso de escritura, como escribir en una variable. El color no debe ser opaco para no ocultar las decoraciones subyacentes.","Color de fondo de un símbolo durante el acceso de lectura; por ejemplo, cuando se lee una variable.","Color de fondo de un símbolo durante el acceso de escritura; por ejemplo, cuando se escribe una variable.","Color del marcador de regla general para destacados de símbolos. El color no debe ser opaco para no ocultar decoraciones subyacentes.","Color de marcador de regla general para destacados de símbolos de acceso de escritura. El color no debe ser opaco para no ocultar las decoraciones subyacentes.","Ir al siguiente símbolo destacado","Ir al símbolo destacado anterior","Desencadenar los símbolos destacados"], +"vs/platform/actions/browser/menuEntryActionViewItem":["{0} ({1})"],"vs/platform/configuration/common/configurationRegistry":["La configuración del lenguaje predeterminada se reemplaza","Establecer los valores de configuración que se reemplazarán para un lenguaje.","Esta configuración no admite la configuración por idioma.",'No se puede registrar "{0}". Coincide con el patrón de propiedad \'\\\\[.*\\\\]$\' para describir la configuración del editor específica del lenguaje. Utilice la contribución "configurationDefaults".','No se puede registrar "{0}". Esta propiedad ya está registrada.'],"vs/platform/keybinding/common/abstractKeybindingService":["Se presionó ({0}). Esperando la siguiente tecla...","La combinación de claves ({0}, {1}) no es un comando."], +"vs/platform/list/browser/listService":["Área de trabajo",'Se asigna a "Control" en Windows y Linux y a "Comando" en macOS.','Se asigna a "Alt" en Windows y Linux y a "Opción" en macOS.',"El modificador que se utilizará para agregar un elemento en los árboles y listas para una selección múltiple con el ratón (por ejemplo en el explorador, abiertos editores y vista de scm). Los gestos de ratón 'Abrir hacia' - si están soportados - se adaptarán de forma tal que no tenga conflicto con el modificador múltiple.","Controla cómo abrir elementos en árboles y listas usando el ratón (si está soportado). Para elementos padres con hijos en los árboles, esta configuración controlará si de un solo click o un doble click expande al elemento padre. Tenga en cuenta que algunos árboles y listas pueden optar por ignorar esta configuración si no se aplica.","Controla si las listas y los árboles admiten el desplazamiento horizontal en el área de trabajo. Advertencia: La activación de esta configuración repercute en el rendimiento.","Controla la sangría de árbol en píxeles.","Controla si el árbol debe representar guías de sangría.","Controla si las listas y los árboles tienen un desplazamiento suave.","La navegación simple del teclado se centra en elementos que coinciden con la entrada del teclado. El emparejamiento se hace solo en prefijos.","Destacar la navegación del teclado resalta los elementos que coinciden con la entrada del teclado. Más arriba y abajo la navegación atravesará solo los elementos destacados.","La navegación mediante el teclado de filtro filtrará y ocultará todos los elementos que no coincidan con la entrada del teclado.","Controla el estilo de navegación del teclado para listas y árboles en el área de trabajo. Puede ser simple, resaltar y filtrar.",'Controla si la navegación del teclado en listas y árboles se activa automáticamente simplemente escribiendo. Si se establece en "false", la navegación con el teclado solo se activa al ejecutar el comando "list.toggleKeyboardNavigation", para el cual puede asignar un método abreviado de teclado.'], +"vs/platform/markers/common/markers":["Error","Advertencia","Información"],"vs/platform/quickinput/browser/commandsQuickAccess":["{0}, {1}","usado recientemente","otros comandos",'El comando "{0}" dio lugar a un error ({1})'],"vs/platform/quickinput/browser/helpQuickAccess":["comandos globales","comandos del editor","{0}, {1}"], +"vs/platform/theme/common/colorRegistry":["Color de primer plano general. Este color solo se usa si un componente no lo invalida.","Color de primer plano general para los mensajes de erroe. Este color solo se usa si un componente no lo invalida.","El color predeterminado para los iconos en el área de trabajo.","Color de borde de los elementos con foco. Este color solo se usa si un componente no lo invalida.","Un borde adicional alrededor de los elementos para separarlos unos de otros y así mejorar el contraste.","Un borde adicional alrededor de los elementos activos para separarlos unos de otros y así mejorar el contraste.","Color de primer plano para los vínculos en el texto.","Color de fondo para los bloques de código en el texto.","Color de sombra de los widgets dentro del editor, como buscar/reemplazar","Fondo de cuadro de entrada.","Primer plano de cuadro de entrada.","Borde de cuadro de entrada.","Color de borde de opciones activadas en campos de entrada.","Color de fondo de las opciones activadas en los campos de entrada.","Color de primer plano de las opciones activadas en los campos de entrada.","Color de fondo de validación de entrada para gravedad de información.","Color de primer plano de validación de entrada para información de gravedad.","Color de borde de validación de entrada para gravedad de información.","Color de fondo de validación de entrada para gravedad de advertencia.","Color de primer plano de validación de entrada para información de advertencia.","Color de borde de validación de entrada para gravedad de advertencia.","Color de fondo de validación de entrada para gravedad de error.","Color de primer plano de validación de entrada para información de error.","Color de borde de valdación de entrada para gravedad de error.","Fondo de lista desplegable.","Primer plano de lista desplegable.","Color de primer plano del botón.","Color de fondo del botón.","Color de fondo del botón al mantener el puntero.","Color de fondo de la insignia. Las insignias son pequeñas etiquetas de información, por ejemplo los resultados de un número de resultados.","Color de primer plano de la insignia. Las insignias son pequeñas etiquetas de información, por ejemplo los resultados de un número de resultados.","Sombra de la barra de desplazamiento indica que la vista se ha despazado.","Color de fondo de control deslizante de barra de desplazamiento.","Color de fondo de barra de desplazamiento cursor cuando se pasar sobre el control.","Color de fondo de la barra de desplazamiento al hacer clic.","Color de fondo para la barra de progreso que se puede mostrar para las operaciones de larga duración.","Color de primer plano de squigglies de error en el editor.","Color del borde de los cuadros de error en el editor.","Color de primer plano de squigglies de advertencia en el editor.","Color del borde de los cuadros de advertencia en el editor.","Color de primer plano de los subrayados ondulados informativos en el editor.","Color del borde de los cuadros de información en el editor.","Color de primer plano de pista squigglies en el editor.","Color del borde de los cuadros de sugerencia en el editor.","Color de fondo del editor.","Color de primer plano predeterminado del editor.","Color de fondo del editor de widgets como buscar/reemplazar","Color de primer plano de los widgets del editor, como buscar y reemplazar.","Color de borde de los widgets del editor. El color solo se usa si el widget elige tener un borde y no invalida el color.","Color del borde de la barra de cambio de tamaño de los widgets del editor. El color se utiliza solo si el widget elige tener un borde de cambio de tamaño y si un widget no invalida el color.","Color de fondo del selector rápido. El widget del selector rápido es el contenedor para selectores como la paleta de comandos.","Color de primer plano del selector rápido. El widget del selector rápido es el contenedor para selectores como la paleta de comandos.","Color de fondo del título del selector rápido. El widget del selector rápido es el contenedor para selectores como la paleta de comandos.","Selector de color rápido para la agrupación de etiquetas.","Selector de color rápido para la agrupación de bordes.","Color de la selección del editor.","Color del texto seleccionado para alto contraste.","Color de la selección en un editor inactivo. El color no debe ser opaco para no ocultar decoraciones subyacentes.","Color en las regiones con el mismo contenido que la selección. El color no debe ser opaco para no ocultar decoraciones subyacentes.","Color de borde de las regiones con el mismo contenido que la selección.","Color de la coincidencia de búsqueda actual.","Color de los otros resultados de la búsqueda. El color no debe ser opaco para no ocultar las decoraciones subyacentes.","Color de la gama que limita la búsqueda. El color no debe ser opaco para no ocultar decoraciones subyacentes.","Color de borde de la coincidencia de búsqueda actual.","Color de borde de otra búsqueda que coincide.","Color del borde de la gama que limita la búsqueda. El color no debe ser opaco para no ocultar las decoraciones subyacentes.","Destacar debajo de la palabra para la que se muestra un mensaje al mantener el mouse. El color no debe ser opaco para no ocultar decoraciones subyacentes.","Color de fondo al mantener el puntero en el editor.","Color de primer plano al mantener el puntero en el editor.","Color del borde al mantener el puntero en el editor.","Color de fondo de la barra de estado al mantener el puntero en el editor.","Color de los vínculos activos.","El color utilizado para el icono de bombilla de acciones.","El color utilizado para el icono de la bombilla de acciones de corrección automática.","Color de fondo para el texto que se insertó. El color no debe ser opaco para no ocultar las decoraciones subyacentes.","Color de fondo para el texto que se eliminó. El color no debe ser opaco para no ocultar decoraciones subyacentes.","Color de contorno para el texto insertado.","Color de contorno para el texto quitado.","Color del borde entre ambos editores de texto.","Color de relleno diagonal del editor de diferencias. El relleno diagonal se usa en las vistas de diferencias en paralelo.","Color de fondo de la lista o el árbol del elemento con el foco cuando la lista o el árbol están activos. Una lista o un árbol tienen el foco del teclado cuando están activos, cuando están inactivos no.","Color de primer plano de la lista o el árbol del elemento con el foco cuando la lista o el árbol están activos. Una lista o un árbol tienen el foco del teclado cuando están activos, cuando están inactivos no.","Color de fondo de la lista o el árbol del elemento seleccionado cuando la lista o el árbol están activos. Una lista o un árbol tienen el foco del teclado cuando están activos, cuando están inactivos no.","Color de primer plano de la lista o el árbol del elemento seleccionado cuando la lista o el árbol están activos. Una lista o un árbol tienen el foco del teclado cuando están activos, cuando están inactivos no.","Color de fondo de la lista o el árbol del elemento seleccionado cuando la lista o el árbol están inactivos. Una lista o un árbol tienen el foco del teclado cuando están activos, cuando están inactivos no.","Color de primer plano de la lista o el árbol del elemento con el foco cuando la lista o el árbol esta inactiva. Una lista o un árbol tiene el foco del teclado cuando está activo, cuando esta inactiva no.","Color de fondo de la lista o el árbol del elemento con el foco cuando la lista o el árbol están inactivos. Una lista o un árbol tienen el foco del teclado cuando están activos, pero no cuando están inactivos.","Fondo de la lista o el árbol al mantener el mouse sobre los elementos.","Color de primer plano de la lista o el árbol al pasar por encima de los elementos con el ratón.","Fondo de arrastrar y colocar la lista o el árbol al mover los elementos con el mouse.","Color de primer plano de la lista o el árbol de las coincidencias resaltadas al buscar dentro de la lista o el ábol.","Color de fondo del widget de filtro de tipo en listas y árboles.","Color de contorno del widget de filtro de tipo en listas y árboles.","Color de contorno del widget de filtro de tipo en listas y árboles, cuando no hay coincidencias.","Color de trazo de árbol para las guías de sangría.","Color del borde de los menús.","Color de primer plano de los elementos de menú.","Color de fondo de los elementos de menú.","Color de primer plano del menu para el elemento del menú seleccionado.","Color de fondo del menu para el elemento del menú seleccionado.","Color del borde del elemento seleccionado en los menús.","Color del separador del menu para un elemento del menú.","Resaltado del color de fondo para una ficha de un fragmento de código.","Resaltado del color del borde para una ficha de un fragmento de código.","Resaltado del color de fondo para la última ficha de un fragmento de código.","Resaltado del color del borde para la última tabulación de un fragmento de código.","Color del marcador de regla general para buscar actualizaciones. El color no debe ser opaco para no ocultar las decoraciones subyacentes.","Color del marcador de la regla general para los destacados de la selección. El color no debe ser opaco para no ocultar las decoraciones subyacentes.","Color de marcador de minimapa para coincidencias de búsqueda.","Color del marcador de minimapa para la selección del editor.","Color del marcador de minimapa para errores.","Color del marcador de minimapa para advertencias.","Color de fondo del minimapa.","Color de fondo del deslizador del minimapa.","Color de fondo del deslizador del minimapa al pasar el puntero.","Color de fondo del deslizador de minimapa al hacer clic en él.","Color utilizado para el icono de error de problemas.","Color utilizado para el icono de advertencia de problemas.","Color utilizado para el icono de información de problemas."], +"vs/platform/undoRedo/common/undoRedoService":["Se han cerrado los siguientes archivos y se han modificado en el disco: {0}.","Los siguientes archivos se han modificado de forma incompatible: {0}.",'No se pudo deshacer "{0}" en todos los archivos. {1}','No se pudo deshacer "{0}" en todos los archivos. {1}','No se pudo deshacer "{0}" en todos los archivos porque se realizaron cambios en {1}','No se pudo deshacer "{0}" en todos los archivos porque ya hay una operación de deshacer o rehacer en ejecución en {1}','No se pudo deshacer "{0}" en todos los archivos porque se produjo una operación de deshacer o rehacer mientras tanto','¿Desea deshacer "{0}" en todos los archivos?',"Deshacer en {0} archivos","Deshacer este archivo","Cancelar",'No se pudo deshacer "{0}" porque ya hay una operación de deshacer o rehacer en ejecución.','No se pudo rehacer "{0}" en todos los archivos. {1}','No se pudo rehacer "{0}" en todos los archivos. {1}','No se pudo volver a hacer "{0}" en todos los archivos porque se realizaron cambios en {1}','No se pudo rehacer "{0}" en todos los archivos porque ya hay una operación de deshacer o rehacer en ejecución en {1}','No se pudo rehacer "{0}" en todos los archivos porque se produjo una operación de deshacer o rehacer mientras tanto','No se pudo rehacer "{0}" porque ya hay una operación de deshacer o rehacer en ejecución.'] +}); +//# sourceMappingURL=../../../min-maps/vs/editor/editor.main.nls.es.js.map \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/editor/editor.main.nls.fr.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/editor/editor.main.nls.fr.js new file mode 100644 index 0000000..37656f4 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/editor/editor.main.nls.fr.js @@ -0,0 +1,43 @@ +/*!----------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Version: 0.21.2(67b5a8116f3c0bace36b180e524e05bb750a16d8) + * Released under the MIT license + * https://github.com/Microsoft/vscode/blob/master/LICENSE.txt + *-----------------------------------------------------------*/ +define("vs/editor/editor.main.nls.fr",{"vs/base/browser/ui/actionbar/actionViewItems":["{0} ({1})"],"vs/base/browser/ui/findinput/findInput":["entrée"],"vs/base/browser/ui/findinput/findInputCheckboxes":["Respecter la casse","Mot entier","Utiliser une expression régulière"],"vs/base/browser/ui/findinput/replaceInput":["entrée","Préserver la casse"],"vs/base/browser/ui/inputbox/inputBox":["Erreur : {0}","Avertissement : {0}","Info : {0}"],"vs/base/browser/ui/keybindingLabel/keybindingLabel":["Indépendant"],"vs/base/browser/ui/menu/menu":["{0} ({1})"],"vs/base/browser/ui/tree/abstractTree":["Effacer","Désactiver le filtre sur le type","Activer le filtre sur le type","Aucun élément","{0} éléments sur {1} correspondants"], +"vs/base/common/errorMessage":["{0}: {1}","Une erreur système s'est produite ({0})","Une erreur inconnue s’est produite. Veuillez consulter le journal pour plus de détails.","Une erreur inconnue s’est produite. Veuillez consulter le journal pour plus de détails.","{0} ({1} erreurs au total)","Une erreur inconnue s’est produite. Veuillez consulter le journal pour plus de détails."],"vs/base/common/keybindingLabels":["Ctrl","Maj","Alt","Windows","Ctrl","Maj","Alt","Super","Contrôle","Maj","Alt","Commande","Contrôle","Maj","Alt","Windows","Contrôle","Maj","Alt","Super"],"vs/base/parts/quickinput/browser/quickInput":["Précédent","{0}/{1}","Taper pour affiner les résultats.","{0} résultats","{0} Sélectionnés","OK","Personnalisé","Précédent ({0})","Précédent"],"vs/base/parts/quickinput/browser/quickInputList":["Entrée rapide"], +"vs/editor/browser/controller/coreCommands":["Aligner par rapport à la fin même en cas de passage à des lignes plus longues","Aligner par rapport à la fin même en cas de passage à des lignes plus longues"],"vs/editor/browser/controller/textAreaHandler":["éditeur","L'éditeur n'est pas accessible pour le moment. Appuyez sur {0} pour voir les options."],"vs/editor/browser/editorExtensions":["Ann&&uler","Annuler","&&Rétablir","Rétablir","&&Sélectionner tout","Tout sélectionner"],"vs/editor/browser/widget/codeEditorWidget":["Le nombre de curseurs a été limité à {0}."],"vs/editor/browser/widget/diffEditorWidget":["Impossible de comparer les fichiers car l'un d'eux est trop volumineux."], +"vs/editor/browser/widget/diffReview":["Fermer","aucune ligne changée","1 ligne changée","{0} lignes changées","Différence {0} sur {1} : ligne d'origine {2}, {3}, ligne modifiée {4}, {5}","vide","{0} ligne inchangée {1}","{0} ligne d'origine {1} ligne modifiée {2}","+ {0} ligne modifiée {1}","- {0} ligne d'origine {1}","Accéder à la différence suivante","Accéder la différence précédente"],"vs/editor/browser/widget/inlineDiffMargin":["Copier les lignes supprimées","Copier la ligne supprimée","Copier la ligne supprimée ({0})","Annuler la modification","Copier la ligne supprimée ({0})"], +"vs/editor/common/config/commonEditorConfig":["Éditeur","Le nombre d'espaces auxquels une tabulation est égale. Ce paramètre est substitué basé sur le contenu du fichier lorsque `#editor.detectIndentation#` est à 'on'.","Espaces insérés quand vous appuyez sur la touche Tab. Ce paramètre est remplacé en fonction du contenu du fichier quand '#editor.detectIndentation#' est activé.","Contrôle si '#editor.tabSize#' et '#editor.insertSpaces#' sont automatiquement détectés lors de l’ouverture d’un fichier en fonction de son contenu.","Supprimer l'espace blanc de fin inséré automatiquement.","Traitement spécial des fichiers volumineux pour désactiver certaines fonctionnalités utilisant beaucoup de mémoire.","Contrôle si la saisie semi-automatique doit être calculée en fonction des mots présents dans le document.","Coloration sémantique activée pour tous les thèmes de couleur.","Coloration sémantique désactivée pour tous les thèmes de couleur.","La coloration sémantique est configurée par le paramètre 'semanticHighlighting' du thème de couleur actuel.","Contrôle si semanticHighlighting est affiché pour les langages qui le prennent en charge.","Garder les éditeurs d'aperçu ouverts même si l'utilisateur double-clique sur son contenu ou appuie sur la touche Échap. ","Les lignes plus longues que cette valeur ne sont pas tokenisées pour des raisons de performances","Délai d'expiration en millisecondes avant annulation du calcul de diff. Utilisez 0 pour supprimer le délai d'expiration.","Contrôle si l'éditeur de différences affiche les différences en mode côte à côte ou inline.","Quand il est activé, l'éditeur de différences ignore les changements d'espace blanc de début ou de fin.","Contrôle si l'éditeur de différences affiche les indicateurs +/- pour les changements ajoutés/supprimés .","Contrôle si l'éditeur affiche CodeLens."], +"vs/editor/common/config/editorOptions":["L'éditeur utilise les API de la plateforme pour détecter si un lecteur d'écran est attaché.","L'éditeur est optimisé en permanence pour une utilisation avec un lecteur d'écran.","L'éditeur n'est jamais optimisé pour une utilisation avec un lecteur d'écran.","Contrôle si l'éditeur doit s'exécuter dans un mode optimisé pour les lecteurs d'écran.","Contrôle si un espace est inséré pour les commentaires.","Contrôle si les lignes vides doivent être ignorées avec des actions d'activation/de désactivation, d'ajout ou de suppression des commentaires de ligne.","Contrôle si la copie sans sélection permet de copier la ligne actuelle.","Contrôle si le curseur doit sauter pour rechercher les correspondances lors de la saisie.","Détermine si la chaîne de recherche dans le Widget Recherche est initialisée avec la sélection de l’éditeur.","Ne jamais activer Rechercher automatiquement dans la sélection (par défaut)","Toujours activer Rechercher automatiquement dans la sélection","Activez Rechercher automatiquement dans la sélection quand plusieurs lignes de contenu sont sélectionnées.","Contrôle la condition d'activation automatique de la recherche dans la sélection.","Détermine si le Widget Recherche devrait lire ou modifier le presse-papiers de recherche partagé sur macOS.","Contrôle si le widget Recherche doit ajouter des lignes supplémentaires en haut de l'éditeur. Quand la valeur est true, vous pouvez faire défiler au-delà de la première ligne si le widget Recherche est visible.","Contrôle si la recherche redémarre automatiquement depuis le début (ou la fin) quand il n'existe aucune autre correspondance.","Active/désactive les ligatures de police.","Paramètres de fonctionnalité de police explicites.","Configure les ligatures de police ou les fonctionnalités de police.","Contrôle la taille de police en pixels.",'Seuls les mots clés "normal" et "bold", ou les nombres compris entre 1 et 1 000 sont autorisés.','Contrôle l\'épaisseur de police. Accepte les mots clés "normal" et "bold", ou les nombres compris entre 1 et 1 000.',"Montrer l'aperçu des résultats (par défaut)","Accéder au résultat principal et montrer un aperçu","Accéder au résultat principal et activer l'accès sans aperçu pour les autres","Ce paramètre est déprécié, utilisez des paramètres distincts comme 'editor.editor.gotoLocation.multipleDefinitions' ou 'editor.editor.gotoLocation.multipleImplementations' à la place.","Contrôle le comportement de la commande 'Atteindre la définition' quand plusieurs emplacements cibles existent.","Contrôle le comportement de la commande 'Atteindre la définition de type' quand plusieurs emplacements cibles existent.","Contrôle le comportement de la commande 'Atteindre la déclaration' quand plusieurs emplacements cibles existent.","Contrôle le comportement de la commande 'Atteindre les implémentations' quand plusieurs emplacements cibles existent.","Contrôle le comportement de la commande 'Atteindre les références' quand plusieurs emplacements cibles existent.","ID de commande alternatif exécuté quand le résultat de 'Atteindre la définition' est l'emplacement actuel.","ID de commande alternatif exécuté quand le résultat de 'Atteindre la définition de type' est l'emplacement actuel.","ID de commande alternatif exécuté quand le résultat de 'Atteindre la déclaration' est l'emplacement actuel.","ID de commande alternatif exécuté quand le résultat de 'Atteindre l'implémentation' est l'emplacement actuel.","ID de commande alternatif exécuté quand le résultat de 'Atteindre la référence' est l'emplacement actuel.","Contrôle si le pointage est affiché.","Contrôle le délai en millisecondes, après lequel le survol est affiché.","Contrôle si le pointage doit rester visible quand la souris est déplacée au-dessus.","Active l’ampoule d’action de code dans l’éditeur.","Contrôle la hauteur de ligne. Utilisez 0 pour calculer la hauteur de ligne de la taille de la police.","Contrôle si la minimap est affichée.","Le minimap a la même taille que le contenu de l'éditeur (défilement possible).","Le minimap s'agrandit ou se réduit selon les besoins pour remplir la hauteur de l'éditeur (pas de défilement).","Le minimap est réduit si nécessaire pour ne jamais dépasser la taille de l'éditeur (pas de défilement).","Contrôle la taille du minimap.","Contrôle le côté où afficher la minimap.","Contrôle quand afficher le curseur du minimap.","Échelle du contenu dessiné dans le minimap : 1, 2 ou 3.","Afficher les caractères réels sur une ligne par opposition aux blocs de couleur.","Limiter la largeur de la minimap pour afficher au plus un certain nombre de colonnes.","Contrôle la quantité d’espace entre le bord supérieur de l’éditeur et la première ligne.","Contrôle la quantité d'espace entre le bord inférieur de l'éditeur et la dernière ligne.","Active une fenêtre contextuelle qui affiche de la documentation sur les paramètres et des informations sur les types à mesure que vous tapez.","Détermine si le menu de suggestions de paramètres se ferme ou reviens au début lorsque la fin de la liste est atteinte.","Activez les suggestions rapides dans les chaînes.","Activez les suggestions rapides dans les commentaires.","Activez les suggestions rapides en dehors des chaînes et des commentaires.","Contrôle si les suggestions doivent apparaître automatiquement pendant la saisie.","Les numéros de ligne ne sont pas affichés.","Les numéros de ligne sont affichés en nombre absolu.","Les numéros de ligne sont affichés sous la forme de distance en lignes à la position du curseur.","Les numéros de ligne sont affichés toutes les 10 lignes.","Contrôle l'affichage des numéros de ligne.","Nombre de caractères monospace auxquels cette règle d'éditeur effectue le rendu.","Couleur de cette règle d'éditeur.","Rendre les règles verticales après un certain nombre de caractères à espacement fixe. Utiliser plusieurs valeurs pour plusieurs règles. Aucune règle n'est dessinée si le tableau est vide.","Insérez une suggestion sans remplacer le texte à droite du curseur.","Insérez une suggestion et remplacez le texte à droite du curseur.","Contrôle si les mots sont remplacés en cas d'acceptation de la saisie semi-automatique. Notez que cela dépend des extensions adhérant à cette fonctionnalité.","Détermine si le filtre et le tri des suggestions doivent prendre en compte les fautes de frappes mineures.","Contrôle si le tri favorise trier les mots qui apparaissent près du curseur.","Contrôle si les sélections de suggestion mémorisées sont partagées entre plusieurs espaces de travail et fenêtres (nécessite '#editor.suggestSelection#').","Contrôle si un extrait de code actif empêche les suggestions rapides.","Contrôle s'il faut montrer ou masquer les icônes dans les suggestions.","Contrôle le nombre de suggestions IntelliSense affichées avant de montrer une barre de défilement (15 maximum).","Ce paramètre est déprécié, veuillez utiliser des paramètres distincts comme 'editor.suggest.showKeywords' ou 'editor.suggest.showSnippets' à la place.","Si activé, IntelliSense montre des suggestions de type 'method'.","Si activé, IntelliSense montre des suggestions de type 'function'.","Si activé, IntelliSense montre des suggestions de type 'constructor'.","Si activé, IntelliSense montre des suggestions de type 'field'.","Si activé, IntelliSense montre des suggestions de type 'variable'.","Si activé, IntelliSense montre des suggestions de type 'class'.","Si activé, IntelliSense montre des suggestions de type 'struct'.","Si activé, IntelliSense montre des suggestions de type 'interface'.","Si activé, IntelliSense montre des suggestions de type 'module'.","Si activé, IntelliSense montre des suggestions de type 'property'.","Si activé, IntelliSense montre des suggestions de type 'event'.","Si activé, IntelliSense montre des suggestions de type 'operator'.","Si activé, IntelliSense montre des suggestions de type 'unit'.","Si activé, IntelliSense montre des suggestions de type 'value'.","Si activé, IntelliSense montre des suggestions de type 'constant'.","Si activé, IntelliSense montre des suggestions de type 'enum'.","Si activé, IntelliSense montre des suggestions de type 'enumMember'.","Si activé, IntelliSense montre des suggestions de type 'keyword'.","Si activé, IntelliSense montre des suggestions de type 'text'.","Si activé, IntelliSense montre des suggestions de type 'color'.","Si activé, IntelliSense montre des suggestions de type 'file'.","Si activé, IntelliSense montre des suggestions de type 'reference'.","Si activé, IntelliSense montre des suggestions de type 'customcolor'.","Si activé, IntelliSense montre des suggestions de type 'folder'.","Si activé, IntelliSense montre des suggestions de type 'typeParameter'.","Si activé, IntelliSense montre des suggestions de type 'snippet'.","Si activé, IntelliSense montre des suggestions de type 'utilisateur'.","Si activé, IntelliSense montre des suggestions de type 'problèmes'.","Contrôle la visibilité de la barre d'état en bas du widget de suggestion.","Contrôle si les suggestions doivent être acceptées sur les caractères de validation. Par exemple, en JavaScript, le point-virgule (`;`) peut être un caractère de validation qui accepte une suggestion et tape ce caractère.","Accepter uniquement une suggestion avec 'Entrée' quand elle effectue une modification textuelle.","Contrôle si les suggestions sont acceptées après appui sur 'Entrée', en plus de 'Tab'. Permet d’éviter toute ambiguïté entre l’insertion de nouvelles lignes et l'acceptation de suggestions.","Contrôle le nombre de lignes dans l'éditeur qui peuvent être lues par un lecteur d'écran. Avertissement : Ce paramètre a une incidence sur les performances quand le nombre est supérieur à la valeur par défaut.","Contenu de l'éditeur","Utilisez les configurations de langage pour déterminer quand fermer automatiquement les parenthèses.","Fermer automatiquement les parenthèses uniquement lorsque le curseur est à gauche de l’espace.","Contrôle si l’éditeur doit fermer automatiquement les parenthèses quand l’utilisateur ajoute une parenthèse ouvrante.","Tapez avant les guillemets ou les crochets fermants uniquement s'ils sont automatiquement insérés.","Contrôle si l'éditeur doit taper avant les guillemets ou crochets fermants.","Utilisez les configurations de langage pour déterminer quand fermer automatiquement les guillemets.","Fermer automatiquement les guillemets uniquement lorsque le curseur est à gauche de l’espace.","Contrôle si l’éditeur doit fermer automatiquement les guillemets après que l’utilisateur ajoute un guillemet ouvrant.","L'éditeur n'insère pas de retrait automatiquement.","L'éditeur conserve le retrait de la ligne actuelle.","L'éditeur conserve le retrait de la ligne actuelle et honore les crochets définis par le langage.","L'éditeur conserve le retrait de la ligne actuelle, honore les crochets définis par le langage et appelle des objets onEnterRules spéciaux définis par les langages.","L'éditeur conserve le retrait de la ligne actuelle, honore les crochets définis par le langage, appelle des objets onEnterRules spéciaux définis par les langages et honore les objets indentationRules définis par les langages.","Contrôle si l'éditeur doit ajuster automatiquement le retrait quand les utilisateurs tapent, collent, déplacent ou mettent en retrait des lignes.","Utilisez les configurations de langue pour déterminer quand entourer automatiquement les sélections.","Entourez avec des guillemets et non des crochets.","Entourez avec des crochets et non des guillemets.","Détermine si l'éditeur doit automatiquement entourer les sélections.","Contrôle si l'éditeur affiche CodeLens.","Contrôle si l'éditeur doit afficher les éléments décoratifs de couleurs inline et le sélecteur de couleurs.","Autoriser l'utilisation de la souris et des touches pour sélectionner des colonnes.","Contrôle si la coloration syntaxique doit être copiée dans le presse-papiers.","Contrôler le style d’animation du curseur.","Contrôle si l'animation du point d'insertion doit être activée.","Contrôle le style du curseur.","Contrôle le nombre minimum de lignes visibles avant et après le curseur. Appelé 'scrollOff' ou 'scrollOffset' dans d'autres éditeurs.","'cursorSurroundingLines' est appliqué seulement s'il est déclenché via le clavier ou une API.","'cursorSurroundingLines' est toujours appliqué.","Contrôle quand 'cursorSurroundingLines' doit être appliqué.","Détermine la largeur du curseur lorsque `#editor.cursorStyle#` est à `line`.","Contrôle si l’éditeur autorise le déplacement de sélections par glisser-déplacer.","Multiplicateur de vitesse de défilement quand vous appuyez sur 'Alt'.","Contrôle si l'éditeur a le pliage de code activé.","Utilisez une stratégie de pliage propre à la langue, si disponible, sinon utilisez la stratégie basée sur le retrait.","Utilisez la stratégie de pliage basée sur le retrait.","Contrôle la stratégie de calcul des plages de pliage.","Contrôle si l'éditeur doit mettre en évidence les plages pliées.","Contrôle si le fait de cliquer sur le contenu vide après une ligne pliée déplie la ligne.","Contrôle la famille de polices.","Détermine si l’éditeur doit automatiquement mettre en forme le contenu collé. Un formateur doit être disponible et être capable de mettre en forme une plage dans un document.","Contrôle si l’éditeur doit mettre automatiquement en forme la ligne après la saisie.","Contrôle si l'éditeur doit afficher la marge de glyphes verticale. La marge de glyphes sert principalement au débogage.","Contrôle si le curseur doit être masqué dans la règle de la vue d’ensemble.","Contrôle si l’éditeur doit mettre en surbrillance le guide de mise en retrait actif.","Contrôle l'espacement des lettres en pixels.","Contrôle si l’éditeur doit détecter les liens et les rendre cliquables.","Mettez en surbrillance les crochets correspondants.","Un multiplicateur à utiliser sur les `deltaX` et `deltaY` des événements de défilement de roulette de souris.","Faire un zoom sur la police de l'éditeur quand l'utilisateur fait tourner la roulette de la souris tout en maintenant la touche 'Ctrl' enfoncée.","Fusionnez plusieurs curseurs quand ils se chevauchent.","Mappe vers 'Contrôle' dans Windows et Linux, et vers 'Commande' dans macOS.","Mappe vers 'Alt' dans Windows et Linux, et vers 'Option' dans macOS.","Le modificateur à utiliser pour ajouter plusieurs curseurs avec la souris. Les gestes de souris Atteindre la définition et Ouvrir le lien s'adapteront tels qu’ils n’entrent pas en conflit avec le modificateur multicursor. [Lire la suite] (https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).","Chaque curseur colle une seule ligne de texte.","Chaque curseur colle le texte en entier.","Contrôle le collage quand le nombre de lignes du texte collé correspond au nombre de curseurs.","Contrôle si l'éditeur doit mettre en surbrillance les occurrences de symboles sémantiques.","Contrôle si une bordure doit être dessinée autour de la règle de la vue d'ensemble.","Focus sur l'arborescence à l'ouverture de l'aperçu","Placer le focus sur l'éditeur à l'ouverture de l'aperçu","Contrôle s'il faut mettre le focus sur l'éditeur inline ou sur l'arborescence dans le widget d'aperçu.","Contrôle si le geste de souris Accéder à la définition ouvre toujours le widget d'aperçu.","Contrôle le délai en millisecondes après lequel des suggestions rapides sont affichées.","Contrôle si l'éditeur renomme automatiquement selon le type.","Contrôle si l’éditeur doit afficher les caractères de contrôle.","Contrôle si l’éditeur doit afficher les guides de mise en retrait.","Affichez le dernier numéro de ligne quand le fichier se termine par un saut de ligne.","Met en surbrillance la gouttière et la ligne actuelle.","Contrôle la façon dont l’éditeur doit afficher la mise en surbrillance de la ligne actuelle.","Contrôle si l'éditeur doit afficher la mise en surbrillance de la ligne actuelle seulement quand l'éditeur a le focus","Affiche les espaces blancs à l'exception des espaces uniques entre les mots.","Afficher les espaces blancs uniquement sur le texte sélectionné.","Afficher uniquement les caractères correspondant aux espaces blancs de fin","Contrôle la façon dont l’éditeur doit restituer les caractères espaces.","Contrôle si les sélections doivent avoir des angles arrondis.","Contrôle le nombre de caractères supplémentaires, au-delà duquel l’éditeur défile horizontalement.","Contrôle si l’éditeur défile au-delà de la dernière ligne.","Faites défiler uniquement le long de l'axe prédominant quand le défilement est à la fois vertical et horizontal. Empêche la dérive horizontale en cas de défilement vertical sur un pavé tactile.","Contrôle si le presse-papiers principal Linux doit être pris en charge.","Contrôle si l'éditeur doit mettre en surbrillance les correspondances similaires à la sélection.","Affichez toujours les contrôles de pliage.","Affichez uniquement les contrôles de pliage quand la souris est au-dessus de la reliure.","Contrôle quand afficher les contrôles de pliage sur la reliure.","Contrôle la disparition du code inutile.","Contrôle les variables dépréciées barrées.","Afficher des suggestions d’extraits au-dessus d’autres suggestions.","Afficher des suggestions d’extraits en-dessous d’autres suggestions.","Afficher des suggestions d’extraits avec d’autres suggestions.","Ne pas afficher de suggestions d’extrait de code.","Contrôle si les extraits de code s'affichent en même temps que d'autres suggestions, ainsi que leur mode de tri.","Contrôle si l'éditeur défile en utilisant une animation.","Taille de la police pour le widget de suggestion. Lorsque la valeur est à `0`, la valeur de `#editor.fontSize` est utilisée.","Hauteur de ligne pour le widget de suggestion. Lorsque la valeur est à `0`, la valeur de `#editor.lineHeight#` est utilisée.","Contrôle si les suggestions devraient automatiquement s’afficher lorsque vous tapez les caractères de déclencheur.","Sélectionnez toujours la première suggestion.","Sélectionnez les suggestions récentes sauf si une entrée ultérieure en a sélectionné une, par ex., 'console.| -> console.log', car 'log' a été effectué récemment.","Sélectionnez des suggestions en fonction des préfixes précédents qui ont complété ces suggestions, par ex., 'co -> console' et 'con -> const'.","Contrôle comment les suggestions sont pré-sélectionnés lors de l’affichage de la liste de suggestion.","La complétion par tabulation insérera la meilleure suggestion lorsque vous appuyez sur tab.","Désactiver les complétions par tabulation.","Compléter les extraits de code par tabulation lorsque leur préfixe correspond. Fonctionne mieux quand les 'quickSuggestions' ne sont pas activées.","Active les complétions par tabulation","Les marques de fin de ligne inhabituelles sont ignorées.","Les marques de fin de ligne inhabituelles demandent à être supprimées.","Les marques de fin de ligne inhabituelles sont automatiquement supprimées.","Supprimez les marques de fin de ligne inhabituelles susceptibles de causer des problèmes.","L'insertion et la suppression des espaces blancs suit les taquets de tabulation.","Caractères utilisés comme séparateurs de mots durant la navigation ou les opérations basées sur les mots","Le retour automatique à la ligne n'est jamais effectué.","Le retour automatique à la ligne s'effectue en fonction de la largeur de la fenêtre d'affichage.","Les lignes seront terminées à `#editor.wordWrapColumn#`.","Les lignes seront terminées au minimum du viewport et `#editor.wordWrapColumn#`.","Contrôle comment les lignes doivent être limitées.","Contrôle la colonne de terminaison de l’éditeur lorsque `#editor.wordWrap#` est à `wordWrapColumn` ou `bounded`.","Aucune mise en retrait. Les lignes enveloppées commencent à la colonne 1.","Les lignes enveloppées obtiennent la même mise en retrait que le parent.","Les lignes justifiées obtiennent une mise en retrait +1 vers le parent.","Les lignes justifiées obtiennent une mise en retrait +2 vers le parent. ","Contrôle la mise en retrait des lignes justifiées.","Suppose que tous les caractères ont la même largeur. Il s'agit d'un algorithme rapide qui fonctionne correctement pour les polices à espacement fixe et certains scripts (comme les caractères latins) où les glyphes ont la même largeur.","Délègue le calcul des points de wrapping au navigateur. Il s'agit d'un algorithme lent qui peut provoquer le gel des grands fichiers, mais qui fonctionne correctement dans tous les cas.","Contrôle l'algorithme qui calcule les points de wrapping."], +"vs/editor/common/model/editStack":["Frappe en cours"],"vs/editor/common/modes/modesRegistry":["Texte brut"], +"vs/editor/common/standaloneStrings":["Aucune sélection","Ligne {0}, colonne {1} ({2} sélectionné)","Ligne {0}, colonne {1}","{0} sélections ({1} caractères sélectionnés)","{0} sélections","Remplacement du paramètre 'accessibilitySupport' par 'on'.","Ouverture de la page de documentation sur l'accessibilité de l'éditeur.","dans un volet en lecture seule d'un éditeur de différences.","dans un volet d'un éditeur de différences."," dans un éditeur de code en lecture seule"," dans un éditeur de code","Pour configurer l'éditeur de manière à être optimisé en cas d'utilisation d'un lecteur d'écran, appuyez sur Commande+E maintenant.","Pour configurer l'éditeur de manière à être optimisé en cas d'utilisation d'un lecteur d'écran, appuyez sur Contrôle+E maintenant.","L'éditeur est configuré pour être optimisé en cas d'utilisation avec un lecteur d'écran.","L'éditeur est configuré pour ne jamais être optimisé en cas d'utilisation avec un lecteur d'écran, ce qui n'est pas le cas pour le moment.","Appuyez sur Tab dans l'éditeur pour déplacer le focus vers le prochain élément pouvant être désigné comme élément actif. Activez ou désactivez ce comportement en appuyant sur {0}.","Appuyez sur Tab dans l'éditeur pour déplacer le focus vers le prochain élément pouvant être désigné comme élément actif. La commande {0} ne peut pas être déclenchée par une combinaison de touches.","Appuyez sur Tab dans l'éditeur pour insérer le caractère de tabulation. Activez ou désactivez ce comportement en appuyant sur {0}.","Appuyez sur Tab dans l'éditeur pour insérer le caractère de tabulation. La commande {0} ne peut pas être déclenchée par une combinaison de touches.","Appuyez sur Commande+H maintenant pour ouvrir une fenêtre de navigateur avec plus d'informations sur l'accessibilité de l'éditeur.","Appuyez sur Contrôle+H maintenant pour ouvrir une fenêtre de navigateur avec plus d'informations sur l'accessibilité de l'éditeur.","Vous pouvez masquer cette info-bulle et revenir à l'éditeur en appuyant sur Échap ou Maj+Échap.","Afficher l'aide sur l'accessibilité","Développeur : Inspecter les jetons","Accéder à la ligne/colonne...","Afficher tous les fournisseurs d'accès rapide","Palette de commandes","Commandes d'affichage et d'exécution","Accéder au symbole...","Accéder au symbole par catégorie...","Contenu de l'éditeur","Appuyez sur Alt+F1 pour voir les options d'accessibilité.","Activer/désactiver le thème à contraste élevé","{0} modifications dans {1} fichiers"], +"vs/editor/common/view/editorColorRegistry":["Couleur d'arrière-plan de la mise en surbrillance de la ligne à la position du curseur.","Couleur d'arrière-plan de la bordure autour de la ligne à la position du curseur.","Couleur d'arrière-plan des plages mises en surbrillance, comme par les fonctionnalités de recherche et Quick Open. La couleur ne doit pas être opaque pour ne pas masquer les ornements sous-jacents.","Couleur d'arrière-plan de la bordure autour des plages mises en surbrillance.","Couleur d'arrière-plan du symbole mis en surbrillance, comme le symbole Atteindre la définition ou Suivant/Précédent. La couleur ne doit pas être opaque pour ne pas masquer les décorations sous-jacentes.","Couleur d'arrière-plan de la bordure autour des symboles mis en surbrillance.","Couleur du curseur de l'éditeur.","La couleur de fond du curseur de l'éditeur. Permet de personnaliser la couleur d'un caractère survolé par un curseur de bloc.","Couleur des espaces blancs dans l'éditeur.","Couleur des repères de retrait de l'éditeur.","Couleur des guides d'indentation de l'éditeur actif","Couleur des numéros de ligne de l'éditeur.","Couleur des numéros de lignes actives de l'éditeur","L’ID est déprécié. Utilisez à la place 'editorLineNumber.activeForeground'.","Couleur des numéros de lignes actives de l'éditeur","Couleur des règles de l'éditeur","Couleur pour les indicateurs CodeLens","Couleur d'arrière-plan pour les accolades associées","Couleur pour le contour des accolades associées","Couleur de la bordure de la règle d'aperçu.","Couleur d'arrière-plan de la règle d'aperçu de l'éditeur. Utilisée uniquement quand la minimap est activée et placée sur le côté droit de l'éditeur.","Couleur de fond pour la bordure de l'éditeur. La bordure contient les marges pour les symboles et les numéros de ligne.","Couleur de bordure du code source inutile (non utilisé) dans l'éditeur.","Opacité du code source inutile (non utilisé) dans l'éditeur. Par exemple, '#000000c0' affiche le code avec une opacité de 75 %. Pour les thèmes à fort contraste, utilisez la couleur de thème 'editorUnnecessaryCode.border' pour souligner le code inutile au lieu d'utiliser la transparence.","Couleur de marqueur de la règle d'aperçu pour la mise en surbrillance des plages. La couleur ne doit pas être opaque pour ne pas masquer les ornements sous-jacents.","Couleur du marqueur de la règle d'aperçu pour les erreurs.","Couleur du marqueur de la règle d'aperçu pour les avertissements.","Couleur du marqueur de la règle d'aperçu pour les informations."], +"vs/editor/contrib/anchorSelect/anchorSelect":["Ancre de sélection","Ancre définie sur {0}:{1}","Définir l'ancre de sélection","Atteindre l'ancre de sélection","Sélectionner de l'ancre au curseur","Annuler l'ancre de sélection"],"vs/editor/contrib/bracketMatching/bracketMatching":["Couleur du marqueur de la règle d'aperçu pour rechercher des parenthèses.","Atteindre le crochet","Sélectionner jusqu'au crochet","Accéder au &&crochet"],"vs/editor/contrib/caretOperations/caretOperations":["Déplacer le texte sélectionné à gauche","Déplacer le texte sélectionné à droite"],"vs/editor/contrib/caretOperations/transpose":["Transposer les lettres"],"vs/editor/contrib/clipboard/clipboard":["Co&&uper","Couper","Couper","&&Copier","Copier","Copier","Co&&ller","Coller","Coller","Copier avec la coloration syntaxique"], +"vs/editor/contrib/codeAction/codeActionCommands":["Type d'action de code à exécuter.","Contrôle quand les actions retournées sont appliquées.","Appliquez toujours la première action de code retournée.","Appliquez la première action de code retournée si elle est la seule.","N'appliquez pas les actions de code retournées.","Contrôle si seules les actions de code par défaut doivent être retournées.","Une erreur inconnue s'est produite à l'application de l'action du code","Correction rapide...","Aucune action de code disponible","Aucune action de code préférée n'est disponible pour '{0}'","Aucune action de code disponible pour '{0}'","Aucune action de code par défaut disponible","Aucune action de code disponible","Remanier...","Aucune refactorisation par défaut disponible pour '{0}'","Aucune refactorisation disponible pour '{0}'","Aucune refactorisation par défaut disponible","Aucune refactorisation disponible","Action de la source","Aucune action source par défaut disponible pour '{0}'","Aucune action source disponible pour '{0}'","Aucune action source par défaut disponible","Aucune action n'est disponible","Organiser les importations","Aucune action organiser les imports disponible","Tout corriger","Aucune action Tout corriger disponible","Corriger automatiquement...","Aucun correctif automatique disponible"], +"vs/editor/contrib/codeAction/lightBulbWidget":["Affichez les corrections. Correction préférée disponible ({0})","Afficher les correctifs ({0})","Afficher les correctifs"],"vs/editor/contrib/codelens/codelensController":["Afficher les commandes Code Lens de la ligne actuelle"],"vs/editor/contrib/comment/comment":["Activer/désactiver le commentaire de ligne","Afficher/masquer le commen&&taire de ligne","Ajouter le commentaire de ligne","Supprimer le commentaire de ligne","Activer/désactiver le commentaire de bloc","Afficher/masquer le commentaire de &&bloc"],"vs/editor/contrib/contextmenu/contextmenu":["Afficher le menu contextuel de l'éditeur"],"vs/editor/contrib/cursorUndo/cursorUndo":["Annulation du curseur","Restauration du curseur"], +"vs/editor/contrib/documentSymbols/outlineTree":["Couleur de premier plan des symboles de tableau. Ces symboles apparaissent dans le plan, la barre de navigation et le widget de suggestion.","Couleur de premier plan des symboles booléens. Ces symboles apparaissent dans le plan, la barre de navigation et le widget de suggestion.","Couleur de premier plan des symboles de classe. Ces symboles apparaissent dans le plan, la barre de navigation et le widget de suggestion.","Couleur de premier plan des symboles de couleur. Ces symboles apparaissent dans le plan, la barre de navigation et le widget de suggestion.","Couleur de premier plan pour les symboles de constante. Ces symboles apparaissent dans le plan, la barre de navigation et le widget de suggestion.","Couleur de premier plan des symboles de constructeur. Ces symboles apparaissent dans le plan, la barre de navigation et le widget de suggestion.","Couleur de premier plan des symboles d'énumérateur. Ces symboles apparaissent dans le plan, la barre de navigation et le widget de suggestion.","Couleur de premier plan des symboles de membre d'énumérateur. Ces symboles apparaissent dans le plan, la barre de navigation et le widget de suggestion.","Couleur de premier plan des symboles d'événement. Ces symboles apparaissent dans le plan, la barre de navigation et le widget de suggestion.","Couleur de premier plan des symboles de champ. Ces symboles apparaissent dans le plan, la barre de navigation et le widget de suggestion.","Couleur de premier plan des symboles de fichier. Ces symboles apparaissent dans le plan, la barre de navigation et le widget de suggestion.","Couleur de premier plan des symboles de dossier. Ces symboles apparaissent dans le plan, la barre de navigation et le widget de suggestion.","Couleur de premier plan des symboles de fonction. Ces symboles apparaissent dans le plan, la barre de navigation et le widget de suggestion.","Couleur de premier plan des symboles d'interface. Ces symboles apparaissent dans le plan, la barre de navigation et le widget de suggestion.","Couleur de premier plan des symboles de clé. Ces symboles apparaissent dans le plan, la barre de navigation et le widget de suggestion.","Couleur de premier plan des symboles de mot clé. Ces symboles apparaissent dans le plan, la barre de navigation et le widget de suggestion.","Couleur de premier plan des symboles de méthode. Ces symboles apparaissent dans le plan, la barre de navigation et le widget de suggestion.","Couleur de premier plan des symboles de module. Ces symboles apparaissent dans le plan, la barre de navigation et le widget de suggestion.","Couleur de premier plan des symboles d'espace de noms. Ces symboles apparaissent dans le plan, la barre de navigation et le widget de suggestion.","Couleur de premier plan des symboles null. Ces symboles apparaissent dans le plan, la barre de navigation et le widget de suggestion.","Couleur de premier plan des symboles de nombre. Ces symboles apparaissent dans le plan, la barre de navigation et le widget de suggestion.","Couleur de premier plan des symboles d'objet. Ces symboles apparaissent dans le plan, la barre de navigation et le widget de suggestion.","Couleur de premier plan des symboles d'opérateur. Ces symboles apparaissent dans le plan, la barre de navigation et le widget de suggestion.","Couleur de premier plan des symboles de package. Ces symboles apparaissent dans le plan, la barre de navigation et le widget de suggestion.","Couleur de premier plan des symboles de propriété. Ces symboles apparaissent dans le plan, la barre de navigation et le widget de suggestion.","Couleur de premier plan des symboles de référence. Ces symboles apparaissent dans le plan, la barre de navigation et le widget de suggestion.","Couleur de premier plan des symboles d'extrait de code. Ces symboles apparaissent dans le plan, la barre de navigation et le widget de suggestion.","Couleur de premier plan des symboles de chaîne. Ces symboles apparaissent dans le plan, la barre de navigation et le widget de suggestion.","Couleur de premier plan des symboles de struct. Ces symboles apparaissent dans le plan, la barre de navigation et le widget de suggestion.","Couleur de premier plan des symboles de texte. Ces symboles apparaissent dans le plan, la barre de navigation et le widget de suggestion.","Couleur de premier plan des symboles de paramètre de type. Ces symboles apparaissent dans le plan, la barre de navigation et le widget de suggestion.","Couleur de premier plan des symboles d'unité. Ces symboles apparaissent dans le plan, la barre de navigation et le widget de suggestion.","Couleur de premier plan des symboles de variable. Ces symboles apparaissent dans le plan, la barre de navigation et le widget de suggestion."], +"vs/editor/contrib/find/findController":["Rechercher","&&Rechercher","Rechercher dans la sélection","Rechercher suivant","Rechercher suivant","Rechercher précédent","Rechercher précédent","Sélection suivante","Sélection précédente","Remplacer","&&Remplacer"],"vs/editor/contrib/find/findWidget":["Rechercher","Rechercher","Correspondance précédente","Prochaine correspondance","Rechercher dans la sélection","Fermer","Remplacer","Remplacer","Remplacer","Tout remplacer","Changer le mode de remplacement","Seuls les {0} premiers résultats sont mis en évidence, mais toutes les opérations de recherche fonctionnent sur l’ensemble du texte.","{0} sur {1}","Aucun résultat","{0} trouvé(s)","{0} trouvé pour '{1}'","{0} trouvé pour '{1}', sur {2}","{0} trouvé pour '{1}'","La combinaison Ctrl+Entrée permet désormais d'ajouter un saut de ligne au lieu de tout remplacer. Vous pouvez modifier le raccourci clavier de editor.action.replaceAll pour redéfinir le comportement."], +"vs/editor/contrib/folding/folding":["Déplier","Déplier de manière récursive","Plier","Activer/désactiver le pliage","Plier de manière récursive","Replier tous les commentaires de bloc","Replier toutes les régions","Déplier toutes les régions","Plier tout","Déplier tout","Niveau de pliage {0}","Couleur d'arrière-plan des gammes pliées. La couleur ne doit pas être opaque pour ne pas cacher les décorations sous-jacentes.","Couleur du contrôle de pliage dans la marge de l'éditeur."],"vs/editor/contrib/fontZoom/fontZoom":["Agrandissement de l'éditeur de polices de caractères","Rétrécissement de l'éditeur de polices de caractères","Remise à niveau du zoom de l'éditeur de polices de caractères"],"vs/editor/contrib/format/format":["1 modification de format effectuée à la ligne {0}","{0} modifications de format effectuées à la ligne {1}","1 modification de format effectuée entre les lignes {0} et {1}","{0} modifications de format effectuées entre les lignes {1} et {2}"], +"vs/editor/contrib/format/formatActions":["Mettre le document en forme","Mettre la sélection en forme"],"vs/editor/contrib/gotoError/gotoError":["Aller au problème suivant (Erreur, Avertissement, Info)","Aller au problème précédent (Erreur, Avertissement, Info)","Aller au problème suivant dans Fichiers (Erreur, Avertissement, Info)","&&Problème suivant","Aller au problème précédent dans Fichiers (Erreur, Avertissement, Info)","&&Problème précédent"],"vs/editor/contrib/gotoError/gotoErrorWidget":["Erreur","Avertissement","Info","Conseil","{0} à {1}. ","{0} problèmes sur {1}","{0} problème(s) sur {1}","Couleur d'erreur du widget de navigation dans les marqueurs de l'éditeur.","Couleur d'avertissement du widget de navigation dans les marqueurs de l'éditeur.","Couleur d’information du widget de navigation du marqueur de l'éditeur.","Arrière-plan du widget de navigation dans les marqueurs de l'éditeur."], +"vs/editor/contrib/gotoSymbol/goToCommands":["Aperçu","Définitions","Définition introuvable pour '{0}'","Définition introuvable","Atteindre la définition","Atteindre la &&définition","Ouvrir la définition sur le côté","Faire un Peek de la Définition","Déclarations","Aucune déclaration pour '{0}'","Aucune déclaration","Accéder à la déclaration","Atteindre la &&déclaration","Aucune déclaration pour '{0}'","Aucune déclaration","Aperçu de la déclaration","Définitions de type","Définition de type introuvable pour '{0}'","Définition de type introuvable","Atteindre la définition de type","Accéder à la définition de &&type","Aperçu de la définition du type","Implémentations","Implémentation introuvable pour '{0}'","Implémentation introuvable","Atteindre les implémentations","Atteindre les &&implémentations","Implémentations d'aperçu","Aucune référence pour '{0}'","Aucune référence","Atteindre les références","Atteindre les &&références","Références","Aperçu des références","Références","Atteindre un symbole","Emplacements","Aucun résultat pour « {0} »","Références"], +"vs/editor/contrib/gotoSymbol/link/goToDefinitionAtPosition":["Cliquez pour afficher {0} définitions."],"vs/editor/contrib/gotoSymbol/peek/referencesController":["Chargement en cours...","{0} ({1})"],"vs/editor/contrib/gotoSymbol/peek/referencesTree":["{0} références","{0} référence","Références"],"vs/editor/contrib/gotoSymbol/peek/referencesWidget":["aperçu non disponible","Aucun résultat","Références"],"vs/editor/contrib/gotoSymbol/referencesModel":["symbole dans {0} sur la ligne {1}, colonne {2}","1 symbole dans {0}, chemin complet {1}","{0} symboles dans {1}, chemin complet {2}","Résultats introuvables","1 symbole dans {0}","{0} symboles dans {1}","{0} symboles dans {1} fichiers"],"vs/editor/contrib/gotoSymbol/symbolNavigation":["Symbole {0} sur {1}, {2} pour le suivant","Symbole {0} sur {1}"],"vs/editor/contrib/hover/hover":["Afficher par pointage","Afficher le pointeur de l'aperçu de définition"], +"vs/editor/contrib/hover/modesContentHover":["Chargement en cours...","Aperçu du problème","Recherche de correctifs rapides...","Aucune solution disponible dans l'immédiat","Correction rapide..."],"vs/editor/contrib/inPlaceReplace/inPlaceReplace":["Remplacer par la valeur précédente","Remplacer par la valeur suivante"],"vs/editor/contrib/indentation/indentation":["Convertir les retraits en espaces","Convertir les retraits en tabulations","Taille des tabulations configurée","Sélectionner la taille des tabulations pour le fichier actuel","Mettre en retrait avec des tabulations","Mettre en retrait avec des espaces","Détecter la mise en retrait à partir du contenu","Remettre en retrait les lignes","Réindenter les lignes sélectionnées"], +"vs/editor/contrib/linesOperations/linesOperations":["Copier la ligne en haut","&&Copier la ligne en haut","Copier la ligne en bas","Co&&pier la ligne en bas","Dupliquer la sélection","&&Dupliquer la sélection","Déplacer la ligne vers le haut","Déplacer la ligne &&vers le haut","Déplacer la ligne vers le bas","Déplacer la &&ligne vers le bas","Trier les lignes dans l'ordre croissant","Trier les lignes dans l'ordre décroissant","Découper l'espace blanc de fin","Supprimer la ligne","Mettre en retrait la ligne","Ajouter un retrait négatif à la ligne","Insérer une ligne au-dessus","Insérer une ligne sous","Supprimer tout ce qui est à gauche","Supprimer tout ce qui est à droite","Joindre les lignes","Transposer les caractères autour du curseur","Transformer en majuscule","Transformer en minuscule",'Appliquer la casse "1re lettre des mots en majuscule"'], +"vs/editor/contrib/links/links":["Exécuter la commande","suivre le lien","cmd + clic","ctrl + clic","option + clic","alt + clic","Échec de l'ouverture de ce lien, car il n'est pas bien formé : {0}","Échec de l'ouverture de ce lien, car sa cible est manquante.","Ouvrir le lien"],"vs/editor/contrib/message/messageController":["Impossible de modifier dans l’éditeur en lecture seule"], +"vs/editor/contrib/multicursor/multicursor":["Ajouter un curseur au-dessus","&&Ajouter un curseur au-dessus","Ajouter un curseur en dessous","Aj&&outer un curseur en dessous","Ajouter des curseurs à la fin des lignes","Ajouter des c&&urseurs à la fin des lignes","Ajouter des curseurs en bas","Ajouter des curseurs en haut","Ajouter la sélection à la correspondance de recherche suivante","Ajouter l'occurrence suiva&&nte","Ajouter la sélection à la correspondance de recherche précédente","Ajouter l'occurrence p&&récédente","Déplacer la dernière sélection vers la correspondance de recherche suivante","Déplacer la dernière sélection à la correspondance de recherche précédente","Sélectionner toutes les occurrences des correspondances de la recherche","Sélectionner toutes les &&occurrences","Modifier toutes les occurrences"],"vs/editor/contrib/parameterHints/parameterHints":["Indicateurs des paramètres Trigger"],"vs/editor/contrib/parameterHints/parameterHintsWidget":["{0}, conseil"], +"vs/editor/contrib/peekView/peekView":["Fermer","Couleur d'arrière-plan de la zone de titre de l'affichage d'aperçu.","Couleur du titre de l'affichage d'aperçu.","Couleur des informations sur le titre de l'affichage d'aperçu.","Couleur des bordures et de la flèche de l'affichage d'aperçu.","Couleur d'arrière-plan de la liste des résultats de l'affichage d'aperçu.","Couleur de premier plan des noeuds de lignes dans la liste des résultats de l'affichage d'aperçu.","Couleur de premier plan des noeuds de fichiers dans la liste des résultats de l'affichage d'aperçu.","Couleur d'arrière-plan de l'entrée sélectionnée dans la liste des résultats de l'affichage d'aperçu.","Couleur de premier plan de l'entrée sélectionnée dans la liste des résultats de l'affichage d'aperçu.","Couleur d'arrière-plan de l'éditeur d'affichage d'aperçu.","Couleur d'arrière-plan de la bordure de l'éditeur d'affichage d'aperçu.","Couleur de mise en surbrillance d'une correspondance dans la liste des résultats de l'affichage d'aperçu.","Couleur de mise en surbrillance d'une correspondance dans l'éditeur de l'affichage d'aperçu.","Bordure de mise en surbrillance d'une correspondance dans l'éditeur de l'affichage d'aperçu."], +"vs/editor/contrib/quickAccess/gotoLineQuickAccess":["Ouvrez d'abord un éditeur de texte pour accéder à une ligne.","Allez à la ligne {0}, colonne {1}.","Accédez à la ligne {0}.","Ligne actuelle : {0}, caractère : {1}. Tapez un numéro de ligne entre 1 et {2} auquel accéder.","Ligne actuelle : {0}, caractère : {1}. Tapez un numéro de ligne auquel accéder."], +"vs/editor/contrib/quickAccess/gotoSymbolQuickAccess":["Pour accéder à un symbole, ouvrez d'abord un éditeur de texte avec des informations de symbole.","L'éditeur de texte actif ne fournit pas les informations de symbole.","Aucun symbole d'éditeur correspondant","Aucun symbole d'éditeur","Ouvrir sur le côté","Ouvrir en bas","symboles ({0})","propriétés ({0})","méthodes ({0})","fonctions ({0})","constructeurs ({0})","variables ({0})","classes ({0})","structs ({0})","événements ({0})","opérateurs ({0})","interfaces ({0})","espaces de noms ({0})","packages ({0})","paramètres de type ({0})","modules ({0})","propriétés ({0})","énumérations ({0})","membres d'énumération ({0})","chaînes ({0})","fichiers ({0})","tableaux ({0})","nombres ({0})","booléens ({0})","objets ({0})","clés ({0})","champs ({0})","constantes ({0})"],"vs/editor/contrib/rename/onTypeRename":["Symbole de renommage selon le type","Couleur d'arrière-plan quand l'éditeur renomme automatiquement le type."], +"vs/editor/contrib/rename/rename":["Aucun résultat.","Une erreur inconnue s’est produite lors de la résolution de l'emplacement de renommage : {0}","Renommage de '{0}'","Changement du nom de {0}","'{0}' renommé en '{1}'. Récapitulatif : {2}","Le renommage n'a pas pu appliquer les modifications","Le renommage n'a pas pu calculer les modifications","Renommer le symbole","Activer/désactiver la possibilité d'afficher un aperçu des changements avant le renommage"],"vs/editor/contrib/rename/renameInputField":["Renommez l'entrée. Tapez le nouveau nom et appuyez sur Entrée pour valider.","{0} pour renommer, {1} pour afficher un aperçu"],"vs/editor/contrib/smartSelect/smartSelect":["Étendre la sélection","Dév&&elopper la sélection","Réduire la sélection","&&Réduire la sélection"], +"vs/editor/contrib/snippet/snippetVariables":["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi","Dim","Lun","Mar","Mer","Jeu","Ven","Sam","Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre","Jan","Fév","Mar","Avr","Mai","Juin","Jul","Aoû","Sept","Oct","Nov","Déc"],"vs/editor/contrib/suggest/suggestController":["L'acceptation de '{0}' a entraîné {1} modifications supplémentaires","Suggestions pour Trigger","{0} pour insérer","{0} pour insérer","{0} pour remplacer","{0} pour remplacer","{0} pour insérer","afficher moins","afficher plus"], +"vs/editor/contrib/suggest/suggestWidget":["Couleur d'arrière-plan du widget de suggestion.","Couleur de bordure du widget de suggestion.","Couleur de premier plan du widget de suggestion.","Couleur d'arrière-plan de l'entrée sélectionnée dans le widget de suggestion.","Couleur de la surbrillance des correspondances dans le widget de suggestion.","En savoir plus ({0})","Lire moins ({0})","Chargement en cours...","Chargement en cours...","Pas de suggestions.","{0}, documents : {1}","Suggérer"],"vs/editor/contrib/toggleTabFocusMode/toggleTabFocusMode":["Activer/désactiver l'utilisation de la touche Tab pour déplacer le focus","Appuyer sur Tab déplacera le focus vers le prochain élément pouvant être désigné comme élément actif","Appuyer sur Tab insérera le caractère de tabulation"],"vs/editor/contrib/tokenization/tokenization":["Développeur : forcer la retokenisation"], +"vs/editor/contrib/unusualLineTerminators/unusualLineTerminators":["Marques de fin de ligne inhabituelles","Marques de fin de ligne inhabituelles détectées","Ce fichier contient un ou plusieurs caractères de fin de ligne inhabituels, par exemple le séparateur de ligne (LS) ou le séparateur de paragraphe (PS).\r\n\r\nIl est recommandé de les supprimer du fichier. Vous pouvez le configurer via 'editor.unusualLineTerminators'.","Corriger ce fichier","Ignorer le problème pour ce fichier"], +"vs/editor/contrib/wordHighlighter/wordHighlighter":["Couleur d'arrière-plan d'un symbole pendant l'accès en lecture, comme la lecture d'une variable. La couleur ne doit pas être opaque pour ne pas masquer les ornements sous-jacents.","Couleur d'arrière-plan d'un symbole pendant l'accès en écriture, comme l'écriture d'une variable. La couleur ne doit pas être opaque pour ne pas masquer les ornements sous-jacents.","Couleur de bordure d'un symbole durant l'accès en lecture, par exemple la lecture d'une variable.","Couleur de bordure d'un symbole durant l'accès en écriture, par exemple l'écriture dans une variable.","Couleur de marqueur de la règle d'aperçu pour la mise en surbrillance des symboles. La couleur ne doit pas être opaque pour ne pas masquer les ornements sous-jacents.","Couleur de marqueur de la règle d'aperçu pour la mise en surbrillance des symboles d'accès en écriture. La couleur ne doit pas être opaque pour ne pas masquer les ornements sous-jacents.","Aller à la prochaine mise en évidence de symbole","Aller à la mise en évidence de symbole précédente","Déclencher la mise en évidence de symbole"], +"vs/platform/actions/browser/menuEntryActionViewItem":["{0} ({1})"],"vs/platform/configuration/common/configurationRegistry":["Substitutions de configuration du langage par défaut","Configurez les paramètres d'éditeur à remplacer pour un langage.","Ce paramètre ne prend pas en charge la configuration par langage.","Impossible d'inscrire '{0}'. Ceci correspond au modèle de propriété '\\\\[.*\\\\]$' permettant de décrire les paramètres d'éditeur spécifiques à un langage. Utilisez la contribution 'configurationDefaults'.","Impossible d'inscrire '{0}'. Cette propriété est déjà inscrite."],"vs/platform/keybinding/common/abstractKeybindingService":["Touche ({0}) utilisée. En attente d'une seconde touche...","La combinaison de touches ({0}, {1}) n’est pas une commande."], +"vs/platform/list/browser/listService":["Banc d'essai","Mappe vers 'Contrôle' dans Windows et Linux, et vers 'Commande' dans macOS.","Mappe vers 'Alt' dans Windows et Linux, et vers 'Option' dans macOS.","Le modificateur à utiliser pour ajouter un élément dans les arbres et listes pour une sélection multiple avec la souris (par exemple dans l’Explorateur, les éditeurs ouverts et la vue scm). Les mouvements de la souris 'Ouvrir à côté' (si pris en charge) s'adapteront tels qu’ils n'entrent pas en conflit avec le modificateur multiselect.","Contrôle l’ouverture des éléments dans les arbres et listes à l’aide de la souris (si pris en charge). Pour les parents ayant des enfants dans les arbres, ce paramètre contrôlera si un simple clic déploie le parent ou un double-clic. Notez que certains arbres et listes peuvent choisir d’ignorer ce paramètre, si ce n’est pas applicable. ","Contrôle si les listes et les arborescences prennent en charge le défilement horizontal dans le banc d'essai. Avertissement : L'activation de ce paramètre a un impact sur les performances.","Contrôle la mise en retrait de l'arborescence, en pixels.","Contrôle si l'arborescence doit afficher les repères de mise en retrait.","Détermine si les listes et les arborescences ont un défilement fluide.","La navigation au clavier Simple place le focus sur les éléments qui correspondent à l'entrée de clavier. La mise en correspondance est effectuée sur les préfixes uniquement.","La navigation de mise en surbrillance au clavier met en surbrillance les éléments qui correspondent à l'entrée de clavier. La navigation ultérieure vers le haut ou vers le bas parcourt uniquement les éléments mis en surbrillance.","La navigation au clavier Filtrer filtre et masque tous les éléments qui ne correspondent pas à l'entrée de clavier.","Contrôle le style de navigation au clavier pour les listes et les arborescences dans le banc d'essai. Les options sont Simple, Mise en surbrillance et Filtrer.","Contrôle si la navigation au clavier dans les listes et les arborescences est automatiquement déclenchée simplement par la frappe. Si défini sur 'false', la navigation au clavier est seulement déclenchée avec l'exécution de la commande 'list.toggleKeyboardNavigation', à laquelle vous pouvez attribuer un raccourci clavier."], +"vs/platform/markers/common/markers":["Erreur","Avertissement","Info"],"vs/platform/quickinput/browser/commandsQuickAccess":["{0}, {1}","récemment utilisées","autres commandes","La commande '{0}' a entraîné une erreur ({1})"],"vs/platform/quickinput/browser/helpQuickAccess":["commandes globales","commandes de l'éditeur","{0}, {1}"], +"vs/platform/theme/common/colorRegistry":["Couleur de premier plan globale. Cette couleur est utilisée si elle n'est pas remplacée par un composant.","Couleur principale de premier plan pour les messages d'erreur. Cette couleur est utilisée uniquement si elle n'est pas redéfinie par un composant.","Couleur par défaut des icônes du banc d'essai.","Couleur de bordure globale des éléments ayant le focus. Cette couleur est utilisée si elle n'est pas remplacée par un composant.","Bordure supplémentaire autour des éléments pour les séparer des autres et obtenir un meilleur contraste.","Bordure supplémentaire autour des éléments actifs pour les séparer des autres et obtenir un meilleur contraste.","Couleur des liens dans le texte.","Couleur d'arrière-plan des blocs de code dans le texte.","Couleur de l'ombre des widgets, comme rechercher/remplacer, au sein de l'éditeur.","Arrière-plan de la zone d'entrée.","Premier plan de la zone d'entrée.","Bordure de la zone d'entrée.","Couleur de la bordure des options activées dans les champs d'entrée.","Couleur d'arrière-plan des options activées dans les champs d'entrée.","Couleur de premier plan des options activées dans les champs d'entrée.","Couleur d'arrière-plan de la validation d'entrée pour la gravité des informations.","Couleur de premier plan de validation de saisie pour la sévérité Information.","Couleur de bordure de la validation d'entrée pour la gravité des informations.","Couleur d'arrière-plan de la validation d'entrée pour la gravité de l'avertissement.","Couleur de premier plan de la validation de la saisie pour la sévérité Avertissement.","Couleur de bordure de la validation d'entrée pour la gravité de l'avertissement.","Couleur d'arrière-plan de la validation d'entrée pour la gravité de l'erreur.","Couleur de premier plan de la validation de saisie pour la sévérité Erreur.","Couleur de bordure de la validation d'entrée pour la gravité de l'erreur. ","Arrière-plan de la liste déroulante.","Premier plan de la liste déroulante.","Couleur de premier plan du bouton.","Couleur d'arrière-plan du bouton.","Couleur d'arrière-plan du bouton pendant le pointage.","Couleur de fond des badges. Les badges sont de courts libellés d'information, ex. le nombre de résultats de recherche.","Couleur des badges. Les badges sont de courts libellés d'information, ex. le nombre de résultats de recherche.","Ombre de la barre de défilement pour indiquer que la vue défile.","Couleur de fond du curseur de la barre de défilement.","Couleur de fond du curseur de la barre de défilement lors du survol.","Couleur d’arrière-plan de la barre de défilement lorsqu'on clique dessus.","Couleur de fond pour la barre de progression qui peut s'afficher lors d'opérations longues.","Couleur de premier plan de la ligne ondulée marquant les erreurs dans l'éditeur.","Couleur de bordure des zones d'erreur dans l'éditeur.","Couleur de premier plan de la ligne ondulée marquant les avertissements dans l'éditeur.","Couleur de bordure des zones d'avertissement dans l'éditeur.","Couleur de premier plan de la ligne ondulée marquant les informations dans l'éditeur.","Couleur de bordure des zones d'informations dans l'éditeur.","Couleur de premier plan de la ligne ondulée d'indication dans l'éditeur.","Couleur de bordure des zones d'indication dans l'éditeur.","Couleur d'arrière-plan de l'éditeur.","Couleur de premier plan par défaut de l'éditeur.","Couleur d'arrière-plan des gadgets de l'éditeur tels que rechercher/remplacer.","Couleur de premier plan des widgets de l'éditeur, notamment Rechercher/remplacer.","Couleur de bordure des widgets de l'éditeur. La couleur est utilisée uniquement si le widget choisit d'avoir une bordure et si la couleur n'est pas remplacée par un widget.","Couleur de bordure de la barre de redimensionnement des widgets de l'éditeur. La couleur est utilisée uniquement si le widget choisit une bordure de redimensionnement et si la couleur n'est pas remplacée par un widget.","Couleur d'arrière-plan du sélecteur rapide. Le widget de sélecteur rapide est le conteneur de sélecteurs comme la palette de commandes.","Couleur de premier plan du sélecteur rapide. Le widget de sélecteur rapide est le conteneur de sélecteurs comme la palette de commandes.","Couleur d'arrière-plan du titre du sélecteur rapide. Le widget de sélecteur rapide est le conteneur de sélecteurs comme la palette de commandes.","Couleur du sélecteur rapide pour les étiquettes de regroupement.","Couleur du sélecteur rapide pour les bordures de regroupement.","Couleur de la sélection de l'éditeur.","Couleur du texte sélectionné pour le contraste élevé.","Couleur de la sélection dans un éditeur inactif. La couleur ne doit pas être opaque pour ne pas masquer les ornements sous-jacents.","Couleur des régions dont le contenu est le même que celui de la sélection. La couleur ne doit pas être opaque pour ne pas masquer les ornements sous-jacents.","Couleur de bordure des régions dont le contenu est identique à la sélection.","Couleur du résultat de recherche actif.","Couleur des autres correspondances de recherche. La couleur ne doit pas être opaque pour ne pas masquer les ornements sous-jacents.","Couleur de la plage limitant la recherche. La couleur ne doit pas être opaque pour ne pas masquer les ornements sous-jacents.","Couleur de bordure du résultat de recherche actif.","Couleur de bordure des autres résultats de recherche.","Couleur de bordure de la plage limitant la recherche. La couleur ne doit pas être opaque pour ne pas masquer les ornements sous-jacents.","Surlignage sous le mot sélectionné par pointage. La couleur ne doit pas être opaque pour ne pas masquer les ornements sous-jacents.","Couleur d'arrière-plan du pointage de l'éditeur.","Couleur de premier plan du pointage de l'éditeur.","Couleur de bordure du pointage de l'éditeur.","Couleur d'arrière-plan de la barre d'état du pointage de l'éditeur.","Couleur des liens actifs.","Couleur utilisée pour l'icône d'ampoule suggérant des actions.","Couleur utilisée pour l'icône d'ampoule suggérant des actions de correction automatique.","Couleur d'arrière-plan du texte inséré. La couleur ne doit pas être opaque pour ne pas masquer les ornements sous-jacents.","Couleur d'arrière-plan du texte supprimé. La couleur ne doit pas être opaque pour ne pas masquer les ornements sous-jacents.","Couleur de contour du texte inséré.","Couleur de contour du texte supprimé.","Couleur de bordure entre les deux éditeurs de texte.","Couleur du remplissage diagonal de l'éditeur de différences. Le remplissage diagonal est utilisé dans les vues de différences côte à côte.","Couleur d'arrière-plan de la liste/l'arborescence pour l'élément ayant le focus quand la liste/l'arborescence est active. Une liste/arborescence active peut être sélectionnée au clavier, elle ne l'est pas quand elle est inactive.","Couleur de premier plan de la liste/l'arborescence pour l'élément ayant le focus quand la liste/l'arborescence est active. Une liste/arborescence active peut être sélectionnée au clavier, elle ne l'est pas quand elle est inactive.","Couleur d'arrière-plan de la liste/l'arborescence de l'élément sélectionné quand la liste/l'arborescence est active. Une liste/arborescence active peut être sélectionnée au clavier, elle ne l'est pas quand elle est inactive.","Couleur de premier plan de la liste/l'arborescence pour l'élément sélectionné quand la liste/l'arborescence est active. Une liste/arborescence active peut être sélectionnée au clavier, elle ne l'est pas quand elle est inactive.","Couleur d'arrière-plan de la liste/l'arborescence pour l'élément sélectionné quand la liste/l'arborescence est inactive. Une liste/arborescence active peut être sélectionnée au clavier, elle ne l'est pas quand elle est inactive.","Couleur de premier plan de la liste/l'arborescence pour l'élément sélectionné quand la liste/l'arborescence est inactive. Une liste/arborescence active peut être sélectionnée au clavier, elle ne l'est pas quand elle est inactive.","Couleur d'arrière-plan de la liste/l'arborescence pour l'élément ayant le focus quand la liste/l'arborescence est active. Une liste/arborescence active peut être sélectionnée au clavier (elle ne l'est pas quand elle est inactive).","Arrière-plan de la liste/l'arborescence pendant le pointage sur des éléments avec la souris.","Premier plan de la liste/l'arborescence pendant le pointage sur des éléments avec la souris.","Arrière-plan de l'opération de glisser-déplacer dans une liste/arborescence pendant le déplacement d'éléments avec la souris.","Couleur de premier plan dans la liste/l'arborescence pour la surbrillance des correspondances pendant la recherche dans une liste/arborescence.","Couleur d'arrière-plan du widget de filtre de type dans les listes et les arborescences.","Couleur de contour du widget de filtre de type dans les listes et les arborescences.","Couleur de contour du widget de filtre de type dans les listes et les arborescences, en l'absence de correspondance.","Couleur de trait de l'arborescence pour les repères de mise en retrait.","Couleur de bordure des menus.","Couleur de premier plan des éléments de menu.","Couleur d'arrière-plan des éléments de menu.","Couleur de premier plan de l'élément de menu sélectionné dans les menus.","Couleur d'arrière-plan de l'élément de menu sélectionné dans les menus.","Couleur de bordure de l'élément de menu sélectionné dans les menus.","Couleur d'un élément de menu séparateur dans les menus.","Couleur d’arrière-plan de mise en surbrillance d’un extrait tabstop.","Couleur de bordure de mise en surbrillance d’un extrait tabstop.","Couleur d’arrière-plan de mise en surbrillance du tabstop final d’un extrait.","Mettez en surbrillance la couleur de bordure du dernier taquet de tabulation d'un extrait de code.","Couleur de marqueur de la règle d'aperçu pour rechercher les correspondances. La couleur ne doit pas être opaque pour ne pas masquer les ornements sous-jacents.","Couleur de marqueur de la règle d'aperçu pour la mise en surbrillance des sélections. La couleur ne doit pas être opaque pour ne pas masquer les ornements sous-jacents.","Couleur de marqueur de la minimap pour les correspondances.","Couleur de marqueur du minimap pour la sélection de l'éditeur.","Couleur de marqueur de minimap pour les erreurs.","Couleur de marqueur de minimap pour les avertissements.","Couleur d'arrière-plan du minimap.","Couleur d'arrière-plan du curseur de minimap.","Couleur d'arrière-plan du curseur de minimap pendant le survol.","Couleur d'arrière-plan du curseur de minimap pendant un clic.","Couleur utilisée pour l'icône d'erreur des problèmes.","Couleur utilisée pour l'icône d'avertissement des problèmes.","Couleur utilisée pour l'icône d'informations des problèmes."], +"vs/platform/undoRedo/common/undoRedoService":["Les fichiers suivants ont été fermés et modifiés sur le disque : {0}.","Les fichiers suivants ont été modifiés de manière incompatible : {0}.","Impossible d'annuler '{0}' dans tous les fichiers. {1}","Impossible d'annuler '{0}' dans tous les fichiers. {1}","Impossible d'annuler '{0}' dans tous les fichiers, car des modifications ont été apportées à {1}","Impossible d'annuler '{0}' dans tous les fichiers, car une opération d'annulation ou de rétablissement est déjà en cours d'exécution sur {1}","Impossible d'annuler '{0}' dans tous les fichiers, car une opération d'annulation ou de rétablissement s'est produite dans l'intervalle","Souhaitez-vous annuler '{0}' dans tous les fichiers ?","Annuler dans {0} fichiers","Annuler ce fichier","Annuler","Impossible d'annuler '{0}', car une opération d'annulation ou de rétablissement est déjà en cours d'exécution.","Impossible de répéter '{0}' dans tous les fichiers. {1}","Impossible de répéter '{0}' dans tous les fichiers. {1}","Impossible de répéter '{0}' dans tous les fichiers, car des modifications ont été apportées à {1}","Impossible de rétablir '{0}' dans tous les fichiers, car une opération d'annulation ou de rétablissement est déjà en cours d'exécution sur {1}","Impossible de rétablir '{0}' dans tous les fichiers, car une opération d'annulation ou de rétablissement s'est produite dans l'intervalle","Impossible de rétablir '{0}', car une opération d'annulation ou de rétablissement est déjà en cours d'exécution."] +}); +//# sourceMappingURL=../../../min-maps/vs/editor/editor.main.nls.fr.js.map \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/editor/editor.main.nls.it.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/editor/editor.main.nls.it.js new file mode 100644 index 0000000..6164f44 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/editor/editor.main.nls.it.js @@ -0,0 +1,43 @@ +/*!----------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Version: 0.21.2(67b5a8116f3c0bace36b180e524e05bb750a16d8) + * Released under the MIT license + * https://github.com/Microsoft/vscode/blob/master/LICENSE.txt + *-----------------------------------------------------------*/ +define("vs/editor/editor.main.nls.it",{"vs/base/browser/ui/actionbar/actionViewItems":["{0} ({1})"],"vs/base/browser/ui/findinput/findInput":["input"],"vs/base/browser/ui/findinput/findInputCheckboxes":["Maiuscole/minuscole","Parola intera","Usa espressione regolare"],"vs/base/browser/ui/findinput/replaceInput":["input","Mantieni maiuscole/minuscole"],"vs/base/browser/ui/inputbox/inputBox":["Errore: {0}","Avviso: {0}","Info: {0}"],"vs/base/browser/ui/keybindingLabel/keybindingLabel":["Non associato"],"vs/base/browser/ui/menu/menu":["{0} ({1})"],"vs/base/browser/ui/tree/abstractTree":["Cancella","Disabilita filtro sul tipo","Abilita filtro sul tipo","Non sono stati trovati elementi","Abbinamento di {0} su {1} elementi"], +"vs/base/common/errorMessage":["{0}: {1}","Si è verificato un errore di sistema ({0})","Si è verificato un errore sconosciuto. Per altri dettagli, vedere il log.","Si è verificato un errore sconosciuto. Per altri dettagli, vedere il log.","{0} ({1} errori in totale)","Si è verificato un errore sconosciuto. Per altri dettagli, vedere il log."],"vs/base/common/keybindingLabels":["CTRL","MAIUSC","ALT","Windows","CTRL","MAIUSC","ALT","Super","CTRL","MAIUSC","ALT","Comando","CTRL","MAIUSC","ALT","Windows","CTRL","MAIUSC","ALT","Super"],"vs/base/parts/quickinput/browser/quickInput":["Indietro","{0}/{1}","Digitare per ridurre il numero di risultati.","{0} risultati","{0} selezionati","OK","Personalizzato","Indietro ({0})","Indietro"],"vs/base/parts/quickinput/browser/quickInputList":["Input rapido"],"vs/editor/browser/controller/coreCommands":["Si attiene alla fine anche quando si passa a righe più lunghe","Si attiene alla fine anche quando si passa a righe più lunghe"], +"vs/editor/browser/controller/textAreaHandler":["editor","L'editor non è accessibile in questo momento. Premere {0} per le opzioni."],"vs/editor/browser/editorExtensions":["&&Annulla","Annulla","&&Ripeti","Ripeti","&&Seleziona tutto","Seleziona tutto"],"vs/editor/browser/widget/codeEditorWidget":["Il numero di cursori è stato limitato a {0}."],"vs/editor/browser/widget/diffEditorWidget":["Non è possibile confrontare i file perché uno è troppo grande."],"vs/editor/browser/widget/diffReview":["Chiudi","nessuna riga modificata","1 riga modificata","{0} righe modificate","Differenza {0} di {1}: riga originale {2}, {3}, riga modificata {4}, {5}","vuota","{0} riga non modificata {1}","{0} riga originale {1} riga modificata {2}","+ {0} riga modificata {1}","- {0} riga originale {1}","Vai alla differenza successiva","Vai alla differenza precedente"], +"vs/editor/browser/widget/inlineDiffMargin":["Copia le righe eliminate","Copia la riga eliminata","Copia la riga eliminata ({0})","Ripristina questa modifica","Copia la riga eliminata ({0})"], +"vs/editor/common/config/commonEditorConfig":["Editor","Numero di spazi a cui equivale una tabulazione. Quando `#editor.detectIndentation#` è attivo, questa impostazione viene sostituita in base al contenuto del file.","Inserisce spazi quando viene premuto TAB. Quando `#editor.detectIndentation#` è attivo, questa impostazione viene sostituita in base al contenuto del file.","Controlla se `#editor.tabSize#` e `#editor.insertSpaces#` verranno rilevati automaticamente quando un file viene aperto in base al contenuto del file.","Rimuovi gli spazi finali inseriti automaticamente.","Gestione speciale dei file di grandi dimensioni per disabilitare alcune funzionalità che fanno un uso intensivo della memoria.","Controlla se calcolare i completamenti in base alle parole presenti nel documento.","L'evidenziazione semantica è abilitata per tutti i temi colore.","L'evidenziazione semantica è disabilitata per tutti i temi colore.","La configurazione dell'evidenziazione semantica è gestita tramite l'impostazione `semanticHighlighting` del tema colori corrente.","Controlla se l'evidenziazione semanticHighlighting è visualizzata per i linguaggi che la supportano.","Mantiene aperti gli editor rapidi anche quando si fa doppio clic sul contenuto o si preme 'ESC'.","Per motivi di prestazioni le righe di lunghezza superiore non verranno tokenizzate","Timeout in millisecondi dopo il quale il calcolo delle differenze viene annullato. Usare 0 per indicare nessun timeout.","Controlla se l'editor diff mostra le differenze affiancate o incorporate.","Se abilitato, l'editor differenze ignora le modifiche relative a spazi vuoti iniziali e finali.","Controlla se l'editor diff mostra gli indicatori +/- per le modifiche aggiunte/rimosse.","Controlla se l'editor visualizza CodeLens."], +"vs/editor/common/config/editorOptions":["L'editor userà le API della piattaforma per rilevare quando viene collegata un'utilità per la lettura dello schermo.","L'editor verrà definitivamente ottimizzato per l'utilizzo con un'utilità per la lettura dello schermo.","L'editor non verrà mai ottimizzato per l'utilizzo con un'utilità per la lettura dello schermo.","Controlla se l'editor deve essere eseguito in una modalità ottimizzata per le utilità per la lettura dello schermo.","Consente di controllare se viene inserito uno spazio quando si aggiungono commenti.","Controlla se ignorare le righe vuote con le opzioni per attivare/disattivare, aggiungere o rimuovere relative ai commenti di riga.","Controlla se, quando si copia senza aver effettuato una selezione, viene copiata la riga corrente.","Controlla se il cursore deve passare direttamente alla ricerca delle corrispondenze durante la digitazione.","Controlla se inizializzare la stringa di ricerca nel Widget Trova con il testo selezionato nell'editor","Non attivare mai automaticamente la funzione Trova nella selezione (impostazione predefinita)","Attiva sempre automaticamente la funzione Trova nella selezione","Attiva automaticamente la funzione Trova nella selezione quando sono selezionate più righe di contenuto.","Controlla la condizione per attivare automaticamente la funzione Trova nella selezione.","Controlla se il widget Trova deve leggere o modificare gli appunti di ricerca condivisi in macOS.","Controlla se il widget Trova deve aggiungere altre righe nella parte superiore dell'editor. Quando è true, è possibile scorrere oltre la prima riga quando il widget Trova è visibile.","Controlla se la ricerca viene riavviata automaticamente dall'inizio o dalla fine quando non è possibile trovare ulteriori corrispondenze.","Abilita/Disabilita i caratteri legatura.","Impostazioni esplicite delle funzionalità dei tipi di carattere.","Configura i caratteri legatura o le funzionalità dei tipi di carattere.","Controlla le dimensioni del carattere in pixel.",'Sono consentiti solo le parole chiave "normal" e "bold" o i numeri compresi tra 1 e 1000.','Controlla lo spessore del carattere. Accetta le parole chiave "normal" e "bold" o i numeri compresi tra 1 e 1000.',"Mostra la visualizzazione rapida dei risultati (impostazione predefinita)","Passa al risultato principale e mostra una visualizzazione rapida","Passa al risultato principale e abilita l'esplorazione senza anteprima per gli altri","Questa impostazione è deprecata. In alternativa, usare impostazioni diverse, come 'editor.editor.gotoLocation.multipleDefinitions' o 'editor.editor.gotoLocation.multipleImplementations'.","Controlla il comportamento del comando 'Vai alla definizione' quando esistono più posizioni di destinazione.","Controlla il comportamento del comando 'Vai alla definizione di tipo' quando esistono più posizioni di destinazione.","Controlla il comportamento del comando 'Vai a dichiarazione' quando esistono più posizioni di destinazione.","Controlla il comportamento del comando 'Vai a implementazioni' quando esistono più posizioni di destinazione.","Controlla il comportamento del comando 'Vai a riferimenti' quando esistono più posizioni di destinazione.","ID comando alternativo eseguito quando il risultato di 'Vai alla definizione' è la posizione corrente.","ID comando alternativo eseguito quando il risultato di 'Vai alla definizione di tipo' è la posizione corrente.","ID comando alternativo eseguito quando il risultato di 'Vai a dichiarazione' è la posizione corrente.","ID comando alternativo eseguito quando il risultato di 'Vai a implementazione' è la posizione corrente.","ID comando alternativo eseguito quando il risultato di 'Vai a riferimento' è la posizione corrente.","Controlla se mostrare l'area sensibile al passaggio del mouse.","Controlla il ritardo in millisecondi dopo il quale viene mostrato il passaggio del mouse.","Controlla se l'area sensibile al passaggio del mouse deve rimanere visibile quando vi si passa sopra con il puntatore del mouse","Abilita la lampadina delle azioni codice nell'editor.","Controlla l'altezza della riga. Usare 0 per calcolare l'altezza della riga dalle dimensioni del carattere.","Controlla se la minimappa è visualizzata.","La minimappa ha le stesse dimensioni del contenuto dell'editor (e potrebbe supportare lo scorrimento).","Se necessario, la minimappa si ridurrà o si ingrandirà in modo da adattarsi all'altezza dell'editor (nessuno scorrimento).","Se necessario, la minimappa si ridurrà in modo che la larghezza non superi mai quella dell'editor (nessuno scorrimento).","Controlla le dimensioni della minimappa.","Definisce il lato in cui eseguire il rendering della minimappa.","Controlla se il dispositivo di scorrimento della minimappa è visualizzato.","Scala del contenuto disegnato nella minimappa: 1, 2 o 3.","Esegue il rendering dei caratteri effettivi di una riga in contrapposizione ai blocchi colore.","Limita la larghezza della minimappa in modo da eseguire il rendering al massimo di un certo numero di colonne.","Controlla la quantità di spazio tra il bordo superiore dell'editor e la prima riga.","Controlla la quantità di spazio tra il bordo inferiore dell'editor e l'ultima riga.","Abilita un popup che mostra documentazione sui parametri e informazioni sui tipi mentre si digita.","Controlla se il menu dei suggerimenti per i parametri esegue un ciclo o si chiude quando viene raggiunta la fine dell'elenco.","Abilita i suggerimenti rapidi all'interno di stringhe.","Abilita i suggerimenti rapidi all'interno di commenti.","Abilita i suggerimenti rapidi all'esterno di stringhe e commenti.","Controlla se visualizzare automaticamente i suggerimenti durante la digitazione.","I numeri di riga non vengono visualizzati.","I numeri di riga vengono visualizzati come numeri assoluti.","I numeri di riga vengono visualizzati come distanza in linee alla posizione del cursore.","I numeri di riga vengono visualizzati ogni 10 righe.","Controlla la visualizzazione dei numeri di riga.","Numero di caratteri a spaziatura fissa in corrispondenza del quale verrà eseguito il rendering di questo righello dell'editor.","Colore di questo righello dell'editor.","Esegue il rendering dei righelli verticali dopo un certo numero di caratteri a spaziatura fissa. Usare più valori per più righelli. Se la matrice è vuota, non viene disegnato alcun righello.","Inserisce il suggerimento senza sovrascrivere il testo a destra del cursore.","Inserisce il suggerimento e sovrascrive il testo a destra del cursore.","Controlla se le parole vengono sovrascritte quando si accettano i completamenti. Tenere presente che questa opzione dipende dalle estensioni che accettano esplicitamente questa funzionalità.","Controlla se i suggerimenti di filtro e ordinamento valgono per piccoli errori di battitura","Controlla se l'ordinamento privilegia le parole che appaiono più vicine al cursore.","Controlla se condividere le selezioni dei suggerimenti memorizzati tra aree di lavoro e finestre (richiede `#editor.suggestSelection#`).","Controlla se un frammento attivo impedisce i suggerimenti rapidi.","Controlla se mostrare o nascondere le icone nei suggerimenti.","Controlla il numero di suggerimenti mostrati da IntelliSense prima di visualizzare una barra di scorrimento (massimo 15).","Questa impostazione è deprecata. In alternativa, usare impostazioni diverse, come 'editor.suggest.showKeywords' o 'editor.suggest.showSnippets'.","Se è abilitata, IntelliSense mostra i suggerimenti relativi a `method`.","Se è abilitata, IntelliSense mostra i suggerimenti relativi a `function`.","Se è abilitata, IntelliSense mostra i suggerimenti relativi a `constructor`.","Se è abilitata, IntelliSense mostra i suggerimenti relativi a `field`.","Se è abilitata, IntelliSense mostra i suggerimenti relativi a `variable`.","Se è abilitata, IntelliSense mostra i suggerimenti relativi a `class`.","Se è abilitata, IntelliSense mostra i suggerimenti relativi a `struct`.","Se è abilitata, IntelliSense mostra i suggerimenti relativi a `interface`.","Se è abilitata, IntelliSense mostra i suggerimenti relativi a `module`.","Se è abilitata, IntelliSense mostra i suggerimenti relativi a `property`.","Se è abilitata, IntelliSense mostra i suggerimenti relativi a `event`.","Se è abilitata, IntelliSense mostra i suggerimenti relativi a `operator`.","Se è abilitata, IntelliSense mostra i suggerimenti relativi a `unit`.","Se è abilitata, IntelliSense mostra i suggerimenti relativi a `value`.","Se è abilitata, IntelliSense mostra i suggerimenti relativi a `constant`.","Se è abilitata, IntelliSense mostra i suggerimenti relativi a `enum`.","Se è abilitata, IntelliSense mostra i suggerimenti relativi a `enumMember`.","Se è abilitata, IntelliSense mostra i suggerimenti relativi a `keyword`.","Se è abilitata, IntelliSense mostra i suggerimenti relativi a `text`.","Se è abilitata, IntelliSense mostra i suggerimenti relativi a `color`.","Se è abilitata, IntelliSense mostra i suggerimenti relativi a `file`.","Se è abilitata, IntelliSense mostra i suggerimenti relativi a `reference`.","Se è abilitata, IntelliSense mostra i suggerimenti relativi a `customcolor`.","Se è abilitata, IntelliSense mostra i suggerimenti relativi a `folder`.","Se è abilitata, IntelliSense mostra i suggerimenti relativi a `typeParameter`.","Se è abilitata, IntelliSense mostra i suggerimenti relativi a `snippet`.","Se è abilitata, IntelliSense mostra i suggerimenti relativi a `user`.","Se è abilitata, IntelliSense mostra i suggerimenti relativi a `issues`.","Controlla la visibilità della barra di stato nella parte inferiore del widget dei suggerimenti.","Controlla se accettare i suggerimenti con i caratteri di commit. Ad esempio, in JavaScript il punto e virgola (';') può essere un carattere di commit che accetta un suggerimento e digita tale carattere.","Accetta un suggerimento con 'Invio' solo quando si apporta una modifica al testo.","Controlla se i suggerimenti devono essere accettati con 'INVIO' in aggiunta a 'TAB'. In questo modo è possibile evitare ambiguità tra l'inserimento di nuove righe e l'accettazione di suggerimenti.","Controlla il numero di righe nell'editor che possono essere lette da un utilità per la lettura dello schermo. Avviso: questa opzione può influire sulle prestazioni se il numero di righe è superiore a quello predefinito.","Contenuto editor","Usa le configurazioni del linguaggio per determinare la chiusura automatica delle parentesi.","Chiudi automaticamente le parentesi solo quando il cursore si trova alla sinistra di uno spazio vuoto.","Controlla se l'editor deve chiudere automaticamente le parentesi quadre dopo che sono state aperte.","Digita sopra le virgolette o le parentesi quadre di chiusura solo se sono state inserite automaticamente.","Controlla se l'editor deve digitare su virgolette o parentesi quadre.","Usa le configurazioni del linguaggio per determinare la chiusura automatica delle virgolette.","Chiudi automaticamente le virgolette solo quando il cursore si trova alla sinistra di uno spazio vuoto.","Controlla se l'editor deve chiudere automaticamente le citazioni dopo che sono state aperte.","L'editor non inserirà automaticamente il rientro.","L'editor manterrà il rientro della riga corrente.","L'editor manterrà il rientro della riga corrente e rispetterà le parentesi definite dalla lingua.","L'editor manterrà il rientro della riga corrente, rispetterà le parentesi definite dalla lingua e richiamerà le regole onEnterRules speciali definite dalle lingue.","L'editor manterrà il rientro della riga corrente, rispetterà le parentesi definite dalla lingua, richiamerà le regole onEnterRules speciali definite dalle lingue e rispetterà le regole indentationRules definite dalle lingue.","Controlla se l'editor deve regolare automaticamente il rientro quando gli utenti digitano, incollano, spostano le righe o applicano il rientro.","Usa le configurazioni del linguaggio per determinare quando racchiudere automaticamente le selezioni tra parentesi quadre o virgolette.","Racchiude la selezione tra virgolette ma non tra parentesi quadre.","Racchiude la selezione tra parentesi quadre ma non tra virgolette.","Controlla se l'editor deve racchiudere automaticamente le selezioni tra parentesi quadre o virgolette.","Controlla se l'editor visualizza CodeLens.","Controlla se l'editor deve eseguire il rendering della selezione colori e degli elementi Decorator di tipo colore inline.","Abilita l'uso di mouse e tasti per la selezione delle colonne.","Controlla se l'evidenziazione della sintassi deve essere copiata negli Appunti.","Controllo dello stile di animazione del cursore.","Controlla se l'animazione del cursore con anti-aliasing deve essere abilitata.","Controlla lo stile del cursore.","Controlla il numero minimo di righe iniziali e finali visibili che circondano il cursore. Noto come `scrollOff` o `scrollOffset` in altri editor.","`cursorSurroundingLines` viene applicato solo quando è attivato tramite la tastiera o l'API.","`cursorSurroundingLines` viene sempre applicato.","Controlla quando deve essere applicato `cursorSurroundingLines`.","Controlla la larghezza del cursore quando `#editor.cursorStyle#` è impostato su `line`.","Controlla se l'editor deve consentire lo spostamento di selezioni tramite trascinamento della selezione.","Moltiplicatore della velocità di scorrimento quando si preme `Alt`.","Controlla se per l'editor è abilitata la riduzione del codice.","Usa una strategia di riduzione specifica della lingua, se disponibile; altrimenti ne usa una basata sui rientri.","Usa la strategia di riduzione basata sui rientri.","Controlla la strategia per il calcolo degli intervalli di riduzione.","Controlla se l'editor deve evidenziare gli intervalli con riduzione del codice.","Controlla se, facendo clic sul contenuto vuoto dopo una riga ridotta, la riga viene espansa.","Controlla la famiglia di caratteri.","Controlla se l'editor deve formattare automaticamente il contenuto incollato. Deve essere disponibile un formattatore che deve essere in grado di formattare un intervallo in un documento.","Controlla se l'editor deve formattare automaticamente la riga dopo la digitazione.","Controlla se l'editor deve eseguire il rendering del margine verticale del glifo. Il margine del glifo viene usato principalmente per il debug.","Controlla se il cursore deve essere nascosto nel righello delle annotazioni.","Controlla se l'editor deve evidenziare la guida con rientro attiva","Controlla la spaziatura tra le lettere in pixel.","Controlla se l'editor deve individuare i collegamenti e renderli selezionabili.","Evidenzia le parentesi graffe corrispondenti.","Moltiplicatore da usare sui valori `deltaX` e `deltaY` degli eventi di scorrimento della rotellina del mouse.","Ingrandisce il carattere dell'editor quando si usa la rotellina del mouse e si tiene premuto 'CTRL'.","Unire i cursori multipli se sovrapposti.","Rappresenta il tasto 'Control' in Windows e Linux e il tasto 'Comando' in macOS.","Rappresenta il tasto 'Alt' in Windows e Linux e il tasto 'Opzione' in macOS.","Modificatore da usare per aggiungere più cursori con il mouse. I gesti del mouse Vai alla definizione e Apri il collegamento si adatteranno in modo da non entrare in conflitto con il modificatore di selezione multipla. [Altre informazioni](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).","Ogni cursore incolla una singola riga del testo.","Ogni cursore incolla il testo completo.","Controlla l'operazione Incolla quando il conteggio delle righe del testo incollato corrisponde al conteggio dei cursori.","Controlla se l'editor deve evidenziare le occorrenze di simboli semantici.","Controlla se deve essere disegnato un bordo intorno al righello delle annotazioni.","Sposta lo stato attivo sull'albero quando si apre l'anteprima","Sposta lo stato attivo sull'editor quando si apre l'anteprima","Controlla se spostare lo stato attivo sull'editor inline o sull'albero nel widget di anteprima.","Controlla se il movimento del mouse Vai alla definizione consente sempre di aprire il widget di anteprima.","Controlla il ritardo in millisecondi dopo il quale verranno visualizzati i suggerimenti rapidi.","Controlla se l'editor viene rinominato automaticamente in base al tipo.","Controlla se l'editor deve eseguire il rendering dei caratteri di controllo.","Controlla se l'editor deve eseguire il rendering delle guide con rientro.","Esegue il rendering dell'ultimo numero di riga quando il file termina con un carattere di nuova riga.","Mette in evidenza sia la barra di navigazione sia la riga corrente.","Controlla in che modo l'editor deve eseguire il rendering dell'evidenziazione di riga corrente.","Controlla se l'editor deve eseguire il rendering dell'evidenziazione della riga corrente solo quando l'editor ha lo stato attivo","Esegue il rendering dei caratteri di spazio vuoto ad eccezione dei singoli spazi tra le parole.","Esegui il rendering dei caratteri di spazio vuoto solo nel testo selezionato.","Esegui il rendering solo dei caratteri di spazio vuoto finali","Controlla in che modo l'editor deve eseguire il rendering dei caratteri di spazio vuoto.","Controlla se le selezioni devono avere gli angoli arrotondati.","Controlla il numero di caratteri aggiuntivi oltre i quali l'editor scorrerà orizzontalmente.","Controlla se l'editor scorrerà oltre l'ultima riga.","Scorre solo lungo l'asse predominante durante lo scorrimento verticale e orizzontale simultaneo. Impedisce la deviazione orizzontale quando si scorre in verticale su un trackpad.","Controlla se gli appunti primari di Linux devono essere supportati.","Controlla se l'editor deve evidenziare gli elementi corrispondenti simili alla selezione.","Mostra sempre i comandi di riduzione.","Mostra i comandi di riduzione solo quando il mouse è posizionato sul margine della barra di scorrimento.","Controlla se i controlli di riduzione sul margine della barra di scorrimento vengono visualizzati.","Controllo dissolvenza del codice inutilizzato.","Controlla le variabili deprecate barrate.","Visualizza i suggerimenti del frammento prima degli altri suggerimenti.","Visualizza i suggerimenti del frammento dopo gli altri suggerimenti.","Visualizza i suggerimenti del frammento insieme agli altri suggerimenti.","Non mostrare i suggerimenti del frammento.","Controlla se i frammenti di codice sono visualizzati con altri suggerimenti e il modo in cui sono ordinati.","Controlla se per lo scorrimento dell'editor verrà usata un'animazione.","Dimensioni del carattere per il widget dei suggerimenti. Se impostato su `0`, viene usato il valore di `#editor.fontSize#`.","Altezza della riga per il widget dei suggerimenti. Se impostato su `0`, viene usato il valore `editor.lineHeight#`.","Controlla se i suggerimenti devono essere visualizzati automaticamente durante la digitazione dei caratteri trigger.","Consente di selezionare sempre il primo suggerimento.","Consente di selezionare suggerimenti recenti a meno che continuando a digitare non ne venga selezionato uno, ad esempio `console.| ->; console.log` perché `log` è stato completato di recente.","Consente di selezionare i suggerimenti in base a prefissi precedenti che hanno completato tali suggerimenti, ad esempio `co ->; console` e `con -> const`.","Controlla la modalità di preselezione dei suggerimenti durante la visualizzazione dell'elenco dei suggerimenti.","La funzionalità di completamento con tasto TAB inserirà il migliore suggerimento alla pressione del tasto TAB.","Disabilita le funzionalità di completamento con tasto TAB.","Completa i frammenti con il tasto TAB quando i rispettivi prefissi corrispondono. Funziona in modo ottimale quando 'quickSuggestions' non è abilitato.","Abilità la funzionalità di completamento con tasto TAB.","I caratteri di terminazione di riga insoliti vengono ignorati.","Prompt per i caratteri di terminazione di riga insoliti da rimuovere.","I caratteri di terminazione di riga insoliti vengono rimossi automaticamente.","Rimuovi caratteri di terminazione di riga insoliti che potrebbero causare problemi.","Inserimento ed eliminazione dello spazio vuoto dopo le tabulazioni.","Caratteri che verranno usati come separatori di parola quando si eseguono operazioni o spostamenti correlati a parole.","Il ritorno a capo automatico delle righe non viene mai applicato.","Il ritorno a capo automatico delle righe viene applicato in corrispondenza della larghezza del viewport.","Il ritorno a capo automatico delle righe viene applicato in corrispondenza di `#editor.wordWrapColumn#`.","Il ritorno a capo automatico delle righe viene applicato in corrispondenza della larghezza minima del viewport e di `#editor.wordWrapColumn#`.","Controlla il ritorno a capo automatico delle righe.","Controlla la colonna per il ritorno a capo automatico dell'editor quando il valore di `#editor.wordWrap#` è `wordWrapColumn` o `bounded`.","Nessun rientro. Le righe con ritorno a capo iniziano dalla colonna 1. ","Le righe con ritorno a capo hanno lo stesso rientro della riga padre.","Le righe con ritorno a capo hanno un rientro di +1 rispetto alla riga padre.","Le righe con ritorno a capo hanno un rientro di +2 rispetto alla riga padre.","Controlla il rientro delle righe con ritorno a capo.","Presuppone che la larghezza sia identica per tutti caratteri. Si tratta di un algoritmo veloce che funziona correttamente per i tipi di carattere a spaziatura fissa e determinati script (come i caratteri latini) in cui i glifi hanno larghezza identica.","Delega il calcolo dei punti di ritorno a capo al browser. Si tratta di un algoritmo lento che potrebbe causare blocchi con file di grandi dimensioni, ma funziona correttamente in tutti gli altri casi.","Controlla l'algoritmo che calcola i punti di ritorno a capo."], +"vs/editor/common/model/editStack":["Digitazione"],"vs/editor/common/modes/modesRegistry":["Testo normale"], +"vs/editor/common/standaloneStrings":["Nessuna selezione","Riga {0}, colonna {1} ({2} selezionate)","Riga {0}, colonna {1}","{0} selezioni ({1} caratteri selezionati)","{0} selezioni","Modifica dell'impostazione `accessibilitySupport` in `on`.","Apertura della pagina di documentazione sull'accessibilità dell'editor.","in un riquadro di sola lettura di un editor diff.","in un riquadro di un editor diff."," in un editor di codice di sola lettura"," in un editor di codice","Per configurare l'editor da ottimizzare per l'utilizzo con un'utilità per la lettura dello schermo, premere Comando+E.","Per configurare l'editor da ottimizzare per l'utilizzo con un'utilità per la lettura dello schermo, premere CTRL+E.","L'editor è configurato per essere ottimizzato per l'utilizzo con un'utilità per la lettura dello schermo.","L'editor è configurato per non essere ottimizzato per l'utilizzo con un'utilità per la lettura dello schermo, che non viene usata in questo momento.","Premere TAB nell'editor corrente per spostare lo stato attivo sull'elemento con stato attivabile successivo. Per attivare/disattivare questo comportamento, premere {0}.","Premere TAB nell'editor corrente per spostare lo stato attivo sull'elemento con stato attivabile successivo. Il comando {0} non può essere attualmente attivato con un tasto di scelta rapida.","Premere TAB nell'editor corrente per inserire il carattere di tabulazione. Per attivare/disattivare questo comportamento, premere {0}.","Premere TAB nell'editor corrente per inserire il carattere di tabulazione. Il comando {0} non può essere attualmente attivato con un tasto di scelta rapida.","Premere Comando+H per aprire una finestra del browser contenente maggiori informazioni correlate all'accessibilità dell'editor.","Premere CTRL+H per aprire una finestra del browser contenente maggiori informazioni correlate all'accessibilità dell'editor.","Per chiudere questa descrizione comando e tornare all'editor, premere ESC o MAIUSC+ESC.","Visualizza la Guida sull'accessibilità","Sviluppatore: Controlla token","Vai a Riga/Colonna...","Mostra tutti i provider di accesso rapido","Riquadro comandi","Mostra ed esegui comandi","Vai al simbolo...","Vai al simbolo per categoria...","Contenuto editor","Premere ALT+F1 per le opzioni di accessibilità.","Attiva/disattiva tema a contrasto elevato","Effettuate {0} modifiche in {1} file"], +"vs/editor/common/view/editorColorRegistry":["Colore di sfondo per l'evidenziazione della riga alla posizione del cursore.","Colore di sfondo per il bordo intorno alla riga alla posizione del cursore.","Colore di sfondo degli intervalli evidenziati, ad esempio dalle funzionalità Quick Open e Trova. Il colore non deve essere opaco per evitare di nascondere le decorazioni sottostanti.","Colore di sfondo del bordo intorno agli intervalli selezionati.","Colore di sfondo del simbolo evidenziato, ad esempio per passare alla definizione o al simbolo successivo/precedente. Il colore non deve essere opaco per evitare di nascondere le decorazioni sottostanti.","Colore di sfondo del bordo intorno ai simboli selezionati.","Colore del cursore dell'editor.","Colore di sfondo del cursore editor. Permette di personalizzare il colore di un carattere quando sovrapposto da un blocco cursore.","Colore dei caratteri di spazio vuoto nell'editor.","Colore delle guide per i rientri dell'editor.","Colore delle guide di indentazione dell'editor attivo","Colore dei numeri di riga dell'editor.","Colore del numero di riga attivo dell'editor","Id è deprecato. In alternativa usare 'editorLineNumber.activeForeground'.","Colore del numero di riga attivo dell'editor","Colore dei righelli dell'editor.","Colore primo piano delle finestre di CodeLens dell'editor","Colore di sfondo delle parentesi corrispondenti","Colore delle caselle di parentesi corrispondenti","Colore del bordo del righello delle annotazioni.","Colore di sfondo del righello delle annotazioni dell'editor. Viene usato solo quando la minimappa è abilitata e posizionata sul lato destro dell'editor.","Colore di sfondo della barra di navigazione dell'editor. La barra contiene i margini di glifo e i numeri di riga.","Colore del bordo del codice sorgente non necessario (non usato) nell'editor.","Opacità del codice sorgente non necessario (non usato) nell'editor. Ad esempio, con \"#000000c0\" il rendering del codice verrà eseguito con il 75% di opacità. Per i temi a contrasto elevato, usare il colore del tema 'editorUnnecessaryCode.border' per sottolineare il codice non necessario invece di opacizzarlo.","Colore del marcatore del righello delle annotazioni per le evidenziazioni degli intervalli. Il colore non deve essere opaco per evitare di nascondere le decorazioni sottostanti.","Colore del marcatore del righello delle annotazioni per gli errori.","Colore del marcatore del righello delle annotazioni per gli avvisi.","Colore del marcatore del righello delle annotazioni per i messaggi di tipo informativo."], +"vs/editor/contrib/anchorSelect/anchorSelect":["Ancoraggio della selezione","Ancoraggio impostato alla posizione {0}:{1}","Imposta ancoraggio della selezione","Vai ad ancoraggio della selezione","Seleziona da ancoraggio a cursore","Annulla ancoraggio della selezione"],"vs/editor/contrib/bracketMatching/bracketMatching":["Colore del marcatore del righello delle annotazioni per la corrispondenza delle parentesi.","Vai alla parentesi quadra","Seleziona fino alla parentesi","Vai alla parentesi &&quadra"],"vs/editor/contrib/caretOperations/caretOperations":["Sposta testo selezionato a sinistra","Sposta testo selezionato a destra"],"vs/editor/contrib/caretOperations/transpose":["Trasponi lettere"],"vs/editor/contrib/clipboard/clipboard":["&&Taglia","Taglia","Taglia","&&Copia","Copia","Copia","&&Incolla","Incolla","Incolla","Copia con evidenziazione sintassi"], +"vs/editor/contrib/codeAction/codeActionCommands":["Tipo dell'azione codice da eseguire.","Controlla quando vengono applicate le azioni restituite.","Applica sempre la prima azione codice restituita.","Applica la prima azione codice restituita se è l'unica.","Non applicare le azioni codice restituite.","Controlla se devono essere restituite solo le azioni codice preferite.","Si è verificato un errore sconosciuto durante l'applicazione dell'azione del codice","Correzione rapida...","Azioni codice non disponibili","Non sono disponibili azioni codice preferite per '{0}'","Non sono disponibili azioni codice per '{0}'","Non sono disponibili azioni codice preferite","Azioni codice non disponibili","Effettua refactoring...","Non sono disponibili refactoring preferiti per '{0}'","Non sono disponibili refactoring per '{0}'","Non sono disponibili refactoring preferiti","Refactoring non disponibili","Azione origine...","Non sono disponibili azioni origine preferite per '{0}'","Non sono disponibili azioni origine per '{0}'","Non sono disponibili azioni origine preferite","Azioni origine non disponibili","Organizza import","Azioni di organizzazione Imports non disponibili","Correggi tutto","Non è disponibile alcuna azione Correggi tutto","Correzione automatica...","Non sono disponibili correzioni automatiche"], +"vs/editor/contrib/codeAction/lightBulbWidget":["Mostra correzioni. Correzione preferita disponibile ({0})","Mostra correzioni ({0})","Mostra correzioni"],"vs/editor/contrib/codelens/codelensController":["Mostra comandi di CodeLens per la riga corrente"],"vs/editor/contrib/comment/comment":["Attiva/disattiva commento per la riga","Attiva/Disattiva commento per la &&riga","Aggiungi commento per la riga","Rimuovi commento per la riga","Attiva/Disattiva commento per il blocco","Attiva/Disattiva commento per il &&blocco"],"vs/editor/contrib/contextmenu/contextmenu":["Mostra il menu di scelta rapida editor"],"vs/editor/contrib/cursorUndo/cursorUndo":["Cursore - Annulla","Cursore - Ripeti"], +"vs/editor/contrib/documentSymbols/outlineTree":["Colore primo piano per i simboli di matrice. Questi simboli vengono visualizzati nella struttura, nell'elemento di navigazione e nel widget dei suggerimenti.","Colore primo piano per i simboli booleani. Questi simboli vengono visualizzati nella struttura, nell'elemento di navigazione e nel widget dei suggerimenti.","Colore primo piano per i simboli di classe. Questi simboli vengono visualizzati nella struttura, nell'elemento di navigazione e nel widget dei suggerimenti.","Colore primo piano per i simboli di colore. Questi simboli vengono visualizzati nella struttura, nell'elemento di navigazione e nel widget dei suggerimenti.","Colore primo piano per i simboli di costante. Questi simboli vengono visualizzati nella struttura, nell'elemento di navigazione e nel widget dei suggerimenti.","Colore primo piano per i simboli di costruttore. Questi simboli vengono visualizzati nella struttura, nell'elemento di navigazione e nel widget dei suggerimenti.","Colore primo piano per i simboli di enumeratore. Questi simboli vengono visualizzati nella struttura, nell'elemento di navigazione e nel widget dei suggerimenti.","Colore primo piano per i simboli di membro di enumeratore. Questi simboli vengono visualizzati nella struttura, nell'elemento di navigazione e nel widget dei suggerimenti.","Colore primo piano per i simboli di evento. Questi simboli vengono visualizzati nella struttura, nell'elemento di navigazione e nel widget dei suggerimenti.","Colore primo piano per i simboli di campo. Questi simboli vengono visualizzati nella struttura, nell'elemento di navigazione e nel widget dei suggerimenti.","Colore primo piano per i simboli di file. Questi simboli vengono visualizzati nella struttura, nell'elemento di navigazione e nel widget dei suggerimenti.","Colore primo piano per i simboli di cartella. Questi simboli vengono visualizzati nella struttura, nell'elemento di navigazione e nel widget dei suggerimenti.","Colore primo piano per i simboli di funzione. Questi simboli vengono visualizzati nella struttura, nell'elemento di navigazione e nel widget dei suggerimenti.","Colore primo piano per i simboli di interfaccia. Questi simboli vengono visualizzati nella struttura, nell'elemento di navigazione e nel widget dei suggerimenti.","Colore primo piano per i simboli di chiave. Questi simboli vengono visualizzati nella struttura, nell'elemento di navigazione e nel widget dei suggerimenti.","Colore primo piano per i simboli di parola chiave. Questi simboli vengono visualizzati nella struttura, nell'elemento di navigazione e nel widget dei suggerimenti.","Colore primo piano per i simboli di metodo. Questi simboli vengono visualizzati nella struttura, nell'elemento di navigazione e nel widget dei suggerimenti.","Colore primo piano per i simboli di modulo. Questi simboli vengono visualizzati nella struttura, nell'elemento di navigazione e nel widget dei suggerimenti.","Colore primo piano per i simboli di spazio dei nomi. Questi simboli vengono visualizzati nella struttura, nell'elemento di navigazione e nel widget dei suggerimenti.","Colore primo piano per i simboli Null. Questi simboli vengono visualizzati nella struttura, nell'elemento di navigazione e nel widget dei suggerimenti.","Colore primo piano per i simboli numerici. Questi simboli vengono visualizzati nella struttura, nell'elemento di navigazione e nel widget dei suggerimenti.","Colore primo piano per i simboli di oggetto. Questi simboli vengono visualizzati nella struttura, nell'elemento di navigazione e nel widget dei suggerimenti.","Colore primo piano per i simboli di operatore. Questi simboli vengono visualizzati nella struttura, nell'elemento di navigazione e nel widget dei suggerimenti.","Colore primo piano per i simboli di pacchetto. Questi simboli vengono visualizzati nella struttura, nell'elemento di navigazione e nel widget dei suggerimenti.","Colore primo piano per i simboli di proprietà. Questi simboli vengono visualizzati nella struttura, nell'elemento di navigazione e nel widget dei suggerimenti.","Colore primo piano per i simboli di riferimento. Questi simboli vengono visualizzati nella struttura, nell'elemento di navigazione e nel widget dei suggerimenti.","Colore primo piano per i simboli di frammento. Questi simboli vengono visualizzati nella struttura, nell'elemento di navigazione e nel widget dei suggerimenti.","Colore primo piano per i simboli di stringa. Questi simboli vengono visualizzati nella struttura, nell'elemento di navigazione e nel widget dei suggerimenti.","Colore primo piano per i simboli di struct. Questi simboli vengono visualizzati nella struttura, nell'elemento di navigazione e nel widget dei suggerimenti.","Colore primo piano per i simboli di testo. Questi simboli vengono visualizzati nella struttura, nell'elemento di navigazione e nel widget dei suggerimenti.","Colore primo piano per i simboli di parametro di tipo. Questi simboli vengono visualizzati nella struttura, nell'elemento di navigazione e nel widget dei suggerimenti.","Colore primo piano per i simboli di unità. Questi simboli vengono visualizzati nella struttura, nell'elemento di navigazione e nel widget dei suggerimenti.","Colore primo piano per i simboli di variabile. Questi simboli vengono visualizzati nella struttura, nell'elemento di navigazione e nel widget dei suggerimenti."], +"vs/editor/contrib/find/findController":["Trova","&&Trova","Trova con selezione","Trova successivo","Trova successivo","Trova precedente","Trova precedente","Trova selezione successiva","Trova selezione precedente","Sostituisci","&&Sostituisci"],"vs/editor/contrib/find/findWidget":["Trova","Trova","Corrispondenza precedente","Corrispondenza successiva","Trova nella selezione","Chiudi","Sostituisci","Sostituisci","Sostituisci","Sostituisci tutto","Attiva/Disattiva modalità sostituzione","Solo i primi {0} risultati vengono evidenziati, ma tutte le operazioni di ricerca funzionano su tutto il testo.","{0} di {1}","Nessun risultato","{0} trovato","{0} trovati per '{1}'","{0} trovati per '{1}' alla posizione {2}","{0} trovati per '{1}'","Il tasto di scelta rapida CTRL+INVIO ora consente di inserire l'interruzione di linea invece di sostituire tutto. Per eseguire l'override di questo comportamento, è possibile modificare il tasto di scelta rapida per editor.action.replaceAll."], +"vs/editor/contrib/folding/folding":["Espandi","Espandi in modo ricorsivo","Riduci","Attiva/Disattiva riduzione","Riduci in modo ricorsivo","Riduci tutti i blocchi commento","Riduci tutte le regioni","Espandi tutte le regioni","Riduci tutto","Espandi tutto","Livello riduzione {0}","Colore di sfondo degli intervalli con riduzione. Il colore non deve essere opaco per evitare di nascondere le decorazioni sottostanti.","Colore del controllo di riduzione nella barra di navigazione dell'editor."],"vs/editor/contrib/fontZoom/fontZoom":["Zoom avanti tipo di carattere editor","Zoom indietro tipo di carattere editor","Reimpostazione zoom tipo di carattere editor"],"vs/editor/contrib/format/format":["È stata apportata 1 modifica di formattazione a riga {0}","Sono state apportate {0} modifiche di formattazione a riga {1}","È stata apportata 1 modifica di formattazione tra le righe {0} e {1}","Sono state apportate {0} modifiche di formattazione tra le righe {1} e {2}"], +"vs/editor/contrib/format/formatActions":["Formatta documento","Formatta selezione"],"vs/editor/contrib/gotoError/gotoError":["Vai al problema successivo (Errore, Avviso, Informazioni)","Vai al problema precedente (Errore, Avviso, Informazioni)","Vai al problema successivo nei file (Errore, Avviso, Informazioni)","&&Problema successivo","Vai al problema precedente nei file (Errore, Avviso, Informazioni)","&&Problema precedente"],"vs/editor/contrib/gotoError/gotoErrorWidget":["Errore","Avviso","Info","Suggerimento","{0} a {1}. ","{0} di {1} problemi","{0} di {1} problema","Colore per gli errori del widget di spostamento tra marcatori dell'editor.","Colore per gli avvisi del widget di spostamento tra marcatori dell'editor.","Colore delle informazioni del widget di navigazione marcatori dell'editor.","Sfondo del widget di spostamento tra marcatori dell'editor."], +"vs/editor/contrib/gotoSymbol/goToCommands":["Anteprima","Definizioni","Non è stata trovata alcuna definizione per '{0}'","Non è stata trovata alcuna definizione","Vai alla definizione","Vai alla &&definizione","Apri definizione lateralmente","Visualizza in anteprima la definizione","Dichiarazioni","Non è stata trovata alcuna dichiarazione per '{0}'","Dichiarazione non trovata","Vai a dichiarazione","Vai a &&dichiarazione","Non è stata trovata alcuna dichiarazione per '{0}'","Dichiarazione non trovata","Anteprima dichiarazione","Definizioni di tipo","Non sono state trovate definizioni di tipi per '{0}'","Non sono state trovate definizioni di tipi","Vai alla definizione di tipo","Vai alla &&definizione di tipo","Anteprima definizione di tipo","Implementazioni","Non sono state trovate implementazioni per '{0}'","Non sono state trovate implementazioni","Vai a implementazioni","Vai a &&Implementazioni","Visualizza implementazioni","Non sono stati trovati riferimenti per '{0}'","Non sono stati trovati riferimenti","Vai a Riferimenti","Vai a &&riferimenti","Riferimenti","Anteprima riferimenti","Riferimenti","Vai a qualsiasi simbolo","Posizioni","Nessun risultato per '{0}'","Riferimenti"], +"vs/editor/contrib/gotoSymbol/link/goToDefinitionAtPosition":["Fare clic per visualizzare {0} definizioni."],"vs/editor/contrib/gotoSymbol/peek/referencesController":["Caricamento...","{0} ({1})"],"vs/editor/contrib/gotoSymbol/peek/referencesTree":["{0} riferimenti","{0} riferimento","Riferimenti"],"vs/editor/contrib/gotoSymbol/peek/referencesWidget":["anteprima non disponibile","Nessun risultato","Riferimenti"],"vs/editor/contrib/gotoSymbol/referencesModel":["simbolo in {0} alla riga {1} colonna {2}","1 simbolo in {0}, percorso completo {1}","{0} simboli in {1}, percorso completo {2}","Non sono stati trovati risultati","Trovato 1 simbolo in {0}","Trovati {0} simboli in {1}","Trovati {0} simboli in {1} file"],"vs/editor/contrib/gotoSymbol/symbolNavigation":["Simbolo {0} di {1}, {2} per il successivo","Simbolo {0} di {1}"],"vs/editor/contrib/hover/hover":["Visualizza passaggio del mouse","Mostra anteprima definizione al passaggio del mouse"], +"vs/editor/contrib/hover/modesContentHover":["Caricamento...","Posiziona puntatore sul problema","Verifica disponibilità correzioni rapide...","Non sono disponibili correzioni rapide","Correzione rapida..."],"vs/editor/contrib/inPlaceReplace/inPlaceReplace":["Sostituisci con il valore precedente","Sostituisci con il valore successivo"],"vs/editor/contrib/indentation/indentation":["Converti rientro in spazi","Converti rientro in tabulazioni","Dimensione tabulazione configurata","Seleziona dimensione tabulazione per il file corrente","Imposta rientro con tabulazioni","Imposta rientro con spazi","Rileva rientro dal contenuto","Imposta nuovo rientro per righe","Re-Indenta le Linee Selezionate"], +"vs/editor/contrib/linesOperations/linesOperations":["Copia la riga in alto","&&Copia la riga in alto","Copia la riga in basso","Co&&pia la riga in basso","Duplica selezione","&&Duplica selezione","Sposta la riga in alto","Sposta la riga in &&alto","Sposta la riga in basso","Sposta la riga in &&basso","Ordinamento righe crescente","Ordinamento righe decrescente","Taglia spazio vuoto finale","Elimina riga","Imposta un rientro per la riga","Riduci il rientro per la riga","Inserisci la riga sopra","Inserisci la riga sotto","Elimina tutto a sinistra","Elimina tutto a destra","Unisci righe","Trasponi caratteri intorno al cursore","Converti in maiuscolo","Converti in minuscolo","Trasforma in Tutte Iniziali Maiuscole"], +"vs/editor/contrib/links/links":["Esegui il comando","Visita il collegamento","CMD+clic","CTRL+clic","Opzione+clic","ALT+clic","Non è stato possibile aprire questo collegamento perché il formato non è valido: {0}","Non è stato possibile aprire questo collegamento perché manca la destinazione.","Apri collegamento"],"vs/editor/contrib/message/messageController":["Non è possibile modificare nell'editor di sola lettura"], +"vs/editor/contrib/multicursor/multicursor":["Aggiungi cursore sopra","&&Aggiungi cursore sopra","Aggiungi cursore sotto","A&&ggiungi cursore sotto","Aggiungi cursori a fine riga","Aggiungi c&&ursori a fine riga","Aggiungi cursori alla fine","Aggiungi cursori all'inizio","Aggiungi selezione a risultato ricerca successivo","Aggiungi &&occorrenza successiva","Aggiungi selezione a risultato ricerca precedente","Aggiungi occorrenza &&precedente","Sposta ultima selezione a risultato ricerca successivo","Sposta ultima selezione a risultato ricerca precedente","Seleziona tutte le occorrenze del risultato ricerca","Seleziona &&tutte le occorrenze","Cambia tutte le occorrenze"],"vs/editor/contrib/parameterHints/parameterHints":["Attiva i suggerimenti per i parametri"],"vs/editor/contrib/parameterHints/parameterHintsWidget":["{0}, suggerimento"], +"vs/editor/contrib/peekView/peekView":["Chiudi","Colore di sfondo dell'area del titolo della visualizzazione rapida.","Colore del titolo della visualizzazione rapida.","Colore delle informazioni del titolo della visualizzazione rapida.","Colore dei bordi e della freccia della visualizzazione rapida.","Colore di sfondo dell'elenco risultati della visualizzazione rapida.","Colore primo piano dei nodi riga nell'elenco risultati della visualizzazione rapida.","Colore primo piano dei nodi file nell'elenco risultati della visualizzazione rapida.","Colore di sfondo della voce selezionata nell'elenco risultati della visualizzazione rapida.","Colore primo piano della voce selezionata nell'elenco risultati della visualizzazione rapida.","Colore di sfondo dell'editor di visualizzazioni rapide.","Colore di sfondo della barra di navigazione nell'editor visualizzazione rapida.","Colore dell'evidenziazione delle corrispondenze nell'elenco risultati della visualizzazione rapida.","Colore dell'evidenziazione delle corrispondenze nell'editor di visualizzazioni rapide.","Bordo dell'evidenziazione delle corrispondenze nell'editor di visualizzazioni rapide."], +"vs/editor/contrib/quickAccess/gotoLineQuickAccess":["Aprire prima un editor di testo per passare a una riga.","Passa a riga {0} e colonna {1}.","Vai alla riga {0}.","Riga corrente: {0}, carattere: {1}. Digitare un numero di riga a cui passare compreso tra 1 e {2}.","Riga corrente: {0}, Carattere: {1}. Digitare un numero di riga a cui passare."], +"vs/editor/contrib/quickAccess/gotoSymbolQuickAccess":["Per passare a un simbolo, aprire prima un editor di testo con informazioni sui simboli.","L'editor di testo attivo non fornisce informazioni sui simboli.","Non ci sono simboli dell'editor corrispondenti","Non ci sono simboli dell'editor","Apri lateralmente","Apri in basso","simboli ({0})","proprietà ({0})","metodi ({0})","funzioni ({0})","costruttori ({0})","variabili ({0})","classi ({0})","struct ({0})","eventi ({0})","operatori ({0})","interfacce ({0})","spazi dei nomi ({0})","pacchetti ({0})","parametri di tipo ({0})","moduli ({0})","proprietà ({0})","enumerazioni ({0})","membri di enumerazione ({0})","stringhe ({0})","file ({0})","matrici ({0})","numeri ({0})","valori booleani ({0})","oggetti ({0})","chiavi ({0})","campi ({0})","costanti ({0})"],"vs/editor/contrib/rename/onTypeRename":["Rinomina simbolo in base al tipo","Colore di sfondo quando l'editor viene rinominato automaticamente in base al tipo."], +"vs/editor/contrib/rename/rename":["Nessun risultato.","Si è verificato un errore sconosciuto durante la risoluzione del percorso di ridenominazione","Ridenominazione di '{0}'","Ridenominazione di {0}","Correttamente rinominato '{0}' in '{1}'. Sommario: {2}","La ridenominazione non è riuscita ad applicare le modifiche","La ridenominazione non è riuscita a calcolare le modifiche","Rinomina simbolo","Abilita/Disabilita l'opzione per visualizzare le modifiche in anteprima prima della ridenominazione"],"vs/editor/contrib/rename/renameInputField":["Consente di rinominare l'input. Digitare il nuovo nome e premere INVIO per eseguire il commit.","{0} per rinominare, {1} per visualizzare in anteprima"],"vs/editor/contrib/smartSelect/smartSelect":["Espandi selezione","Espan&&di selezione","Riduci selezione","&&Riduci selezione"], +"vs/editor/contrib/snippet/snippetVariables":["Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato","Dom","Lun","Mar","Mer","Gio","Ven","Sab","Gennaio","Febbraio","Marzo","Aprile","Mag","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre","Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic"],"vs/editor/contrib/suggest/suggestController":["In seguito all'accettazione di '{0}' sono state apportate altre {1} modifiche","Attiva suggerimento","{0} per inserire","{0} per inserire","{0} per sostituire","{0} per sostituire","{0} per inserire","nascondi dettagli","mostra dettagli"], +"vs/editor/contrib/suggest/suggestWidget":["Colore di sfondo del widget dei suggerimenti.","Colore del bordo del widget dei suggerimenti.","Colore primo piano del widget dei suggerimenti.","Colore di sfondo della voce selezionata del widget dei suggerimenti.","Colore delle evidenziazioni corrispondenze nel widget dei suggerimenti.","Più informazioni ({0})","Meno informazioni ({0})","Caricamento...","Caricamento...","Non ci sono suggerimenti.","{0}, documenti: {1}","Suggerisci"],"vs/editor/contrib/toggleTabFocusMode/toggleTabFocusMode":["Attiva/Disattiva l'uso di TAB per spostare lo stato attivo","Se si preme TAB, lo stato attivo verrà spostato sull'elemento con stato attivabile successivo.","Se si preme TAB, verrà inserito il carattere di tabulazione"],"vs/editor/contrib/tokenization/tokenization":["Sviluppatore: Forza retokenizzazione"], +"vs/editor/contrib/unusualLineTerminators/unusualLineTerminators":["Caratteri di terminazione di riga insoliti","Sono stati rilevati caratteri di terminazione di riga insoliti","Questo file contiene uno o più caratteri di terminazione di riga insoliti, come separatore di riga (LS) o separatore di paragrafo (PS).\r\n\r\nÈ consigliabile rimuoverli dal file. È possibile configurare questa opzione tramite `editor.unusualLineTerminators`.","Correggi questo file","Ignora il problema per questo file"], +"vs/editor/contrib/wordHighlighter/wordHighlighter":["Colore di sfondo di un simbolo durante l'accesso in lettura, ad esempio durante la lettura di una variabile. Il colore non deve essere opaco per evitare di nascondere le decorazioni sottostanti.","Colore di sfondo di un simbolo durante l'accesso in scrittura, ad esempio durante la scrittura in una variabile. Il colore non deve essere opaco per evitare di nascondere le decorazioni sottostanti.","Colore del bordo di un simbolo durante l'accesso in lettura, ad esempio durante la lettura di una variabile.","Colore del bordo di un simbolo durante l'accesso in scrittura, ad esempio durante la scrittura in una variabile.","Colore del marcatore del righello delle annotazioni per le evidenziazioni dei simboli. Il colore non deve essere opaco per evitare di nascondere le decorazioni sottostanti.","Colore del marcatore del righello delle annotazioni per le evidenziazioni dei simboli di accesso in scrittura. Il colore non deve essere opaco per evitare di nascondere le decorazioni sottostanti.","Vai al prossimo simbolo evidenziato","Vai al precedente simbolo evidenziato","Attiva/disattiva evidenziazione simbolo"], +"vs/platform/actions/browser/menuEntryActionViewItem":["{0} ({1})"],"vs/platform/configuration/common/configurationRegistry":["Override configurazione predefinita del linguaggio","Consente di configurare le impostazioni dell'editor di cui eseguire l'override per un linguaggio.","Questa impostazione non supporta la configurazione per lingua.","Non è possibile registrare '{0}'. Corrisponde al criterio di proprietà '\\\\[.*\\\\]$' per la descrizione delle impostazioni dell'editor specifiche del linguaggio. Usare il contributo 'configurationDefaults'.","Non è possibile registrare '{0}'. Questa proprietà è già registrata."],"vs/platform/keybinding/common/abstractKeybindingService":["È stato premuto ({0}). In attesa del secondo tasto...","La combinazione di tasti ({0}, {1}) non è un comando."], +"vs/platform/list/browser/listService":["Workbench","Rappresenta il tasto 'Control' in Windows e Linux e il tasto 'Comando' in macOS.","Rappresenta il tasto 'Alt' in Windows e Linux e il tasto 'Opzione' in macOS.","Il modificatore da utilizzare per aggiungere un elemento di alberi e liste ad una selezione multipla con il mouse (ad esempio in Esplora Risorse, apre gli editor e le viste scm). Le gesture del mouse 'Apri a lato' - se supportate - si adatteranno in modo da non creare conflitti con il modificatore di selezione multipla.","Controlla l'apertura degli elementi di alberi ed elenchi tramite il mouse (se supportato). Per i nodi con figli, questa impostazione ne controlla l'apertura tramite singolo o doppio clic. Si noti che alcuni alberi ed elenchi potrebbero scegliere di ignorare questa impostazione se non applicabile.","Controlla se elenchi e alberi supportano lo scorrimento orizzontale nell'area di lavoro. Avviso: l'attivazione di questa impostazione può influire sulle prestazioni.","Controlla il rientro dell'albero in pixel.","Controlla se l'albero deve eseguire il rendering delle guide per i rientri.","Controlla se elenchi e alberi prevedono lo scorrimento uniforme.","Con lo stile di spostamento da tastiera simple lo stato attivo si trova sugli elementi che corrispondono all'input da tastiera. L'abbinamento viene effettuato solo in base ai prefissi.","Con lo stile di spostamento da tastiera highlight vengono evidenziati gli elementi corrispondenti all'input da tastiera. Spostandosi ulteriormente verso l'alto o verso il basso ci si sposterà solo negli elementi evidenziati.","Con lo stile di spostamento da tastiera filter verranno filtrati e nascosti tutti gli elementi che non corrispondono all'input da tastiera.","Controlla lo stile di spostamento da tastiera per elenchi e alberi nel workbench. Le opzioni sono: simple, highlight e filter.","Controlla se gli spostamenti da tastiera per elenchi e alberi vengono attivati semplicemente premendo un tasto. Se è impostato su `false`, gli spostamenti da tastiera vengono attivati solo durante l'esecuzione del comando `list.toggleKeyboardNavigation`, al quale è possibile assegnare un tasto di scelta rapida."], +"vs/platform/markers/common/markers":["Errore","Avviso","Info"],"vs/platform/quickinput/browser/commandsQuickAccess":["{0}, {1}","usate di recente","altri comandi","Il comando '{0}' ha restituito un errore ({1})"],"vs/platform/quickinput/browser/helpQuickAccess":["comandi globali","comandi dell'editor","{0}, {1}"], +"vs/platform/theme/common/colorRegistry":["Colore primo piano generale. Questo colore viene usato solo se non è sostituito da quello di un componente.","Colore primo piano globale per i messaggi di errore. Questo colore viene usato solo se non è sostituito da quello di un componente.","Colore predefinito per le icone nel workbench.","Colore del bordo globale per gli elementi evidenziati. Questo colore viene usato solo se non è sostituito da quello di un componente.","Un bordo supplementare attorno agli elementi per contrastarli maggiormente rispetto agli altri.","Un bordo supplementare intorno agli elementi attivi per contrastarli maggiormente rispetto agli altri.","Colore primo piano dei link nel testo.","Colore di sfondo per i blocchi di codice nel testo.","Colore ombreggiatura dei widget, ad es. Trova/Sostituisci all'interno dell'editor.","Sfondo della casella di input.","Primo piano della casella di input.","Bordo della casella di input.","Colore del bordo di opzioni attivate nei campi di input.","Colore di sfondo di opzioni attivate nei campi di input.","Colore primo piano di opzioni attivate nei campi di input.","Colore di sfondo di convalida dell'input di tipo Informazione.","Colore primo piano di convalida dell'input di tipo Informazione.","Colore del bordo della convalida dell'input di tipo Informazione.","Colore di sfondo di convalida dell'input di tipo Avviso.","Colore primo piano di convalida dell'input di tipo Avviso.","Colore del bordo della convalida dell'input di tipo Avviso.","Colore di sfondo di convalida dell'input di tipo Errore.","Colore primo piano di convalida dell'input di tipo Errore.","Colore del bordo della convalida dell'input di tipo Errore.","Sfondo dell'elenco a discesa.","Primo piano dell'elenco a discesa.","Colore primo piano del pulsante.","Colore di sfondo del pulsante.","Colore di sfondo del pulsante al passaggio del mouse.","Colore di sfondo del badge. I badge sono piccole etichette informative, ad esempio per mostrare il conteggio dei risultati della ricerca.","Colore primo piano del badge. I badge sono piccole etichette informative, ad esempio per mostrare il conteggio dei risultati di una ricerca.","Ombra della barra di scorrimento per indicare lo scorrimento della visualizzazione.","Colore di sfondo del cursore della barra di scorrimento.","Colore di sfondo del cursore della barra di scorrimento al passaggio del mouse.","Colore di sfondo del cursore della barra di scorrimento quando si fa clic con il mouse.","Colore di sfondo dell'indicatore di stato che può essere mostrato per operazioni a esecuzione prolungata.","Colore primo piano degli indicatori di errore nell'editor.","Colore del bordo delle caselle di errore nell'editor.","Colore primo piano degli indicatori di avviso nell'editor.","Colore del bordo delle caselle di avviso nell'editor.","Colore primo piano degli indicatori di informazioni nell'editor.","Colore del bordo delle caselle informative nell'editor.","Colore primo piano degli indicatori di suggerimento nell'editor.","Colore del bordo delle caselle dei suggerimenti nell'editor.","Colore di sfondo dell'editor.","Colore primo piano predefinito dell'editor.","Colore di sfondo dei widget dell'editor, ad esempio Trova/Sostituisci.","Colore primo piano dei widget dell'editor, ad esempio Trova/Sostituisci.","Colore del bordo dei widget dell'editor. Il colore viene usato solo se il widget sceglie di avere un bordo e se il colore non è sottoposto a override da un widget.","Colore del bordo della barra di ridimensionamento dei widget dell'editor. Il colore viene usato solo se il widget sceglie di avere un bordo di ridimensionamento e se il colore non è sostituito da quello di un widget.","Colore di sfondo di Selezione rapida. Il widget Selezione rapida è il contenitore di selezioni quali il riquadro comandi.","Colore primo piano di Selezione rapida. Il widget Selezione rapida è il contenitore di selezioni quali il riquadro comandi.","Colore di sfondo del titolo di Selezione rapida. Il widget Selezione rapida è il contenitore di selezioni quali il riquadro comandi.","Colore di selezione rapida per il raggruppamento delle etichette.","Colore di selezione rapida per il raggruppamento dei bordi.","Colore della selezione dell'editor.","Colore del testo selezionato per il contrasto elevato.","Colore della selezione in un editor inattivo. Il colore non deve essere opaco per evitare di nascondere le decorazioni sottostanti.","Colore delle aree con lo stesso contenuto della selezione. Il colore non deve essere opaco per evitare di nascondere le decorazioni sottostanti.","Colore del bordo delle regioni con lo stesso contenuto della selezione.","Colore della corrispondenza di ricerca corrente.","Colore degli altri risultati della ricerca. Il colore non deve essere opaco per evitare di nascondere le decorazioni sottostanti.","Colore dell'intervallo di limite della ricerca. Il colore non deve essere opaco per evitare di nascondere le decorazioni sottostanti.","Colore del bordo della corrispondenza della ricerca corrente.","Colore del bordo delle altre corrispondenze della ricerca.","Colore del bordo dell'intervallo che limita la ricerca. Il colore non deve essere opaco per evitare di nascondere le decorazioni sottostanti.","Evidenziazione sotto la parola per cui è visualizzata un'area sensibile al passaggio del mouse. Il colore non deve essere opaco per evitare di nascondere le decorazioni sottostanti.","Colore di sfondo dell'area sensibile al passaggio del mouse dell'editor.","Colore primo piano dell'area sensibile al passaggio del mouse dell'editor.","Colore del bordo dell'area sensibile al passaggio del mouse dell'editor.","Colore di sfondo della barra di stato sensibile al passaggio del mouse dell'editor.","Colore dei collegamenti attivi.","Colore usato per l'icona delle azioni con lampadina.","Colore usato per l'icona delle azioni di correzione automatica con lampadina.","Colore di sfondo per il testo che è stato inserito. Il colore non deve essere opaco per evitare di nascondere le decorazioni sottostanti.","Colore di sfondo per il testo che è stato rimosso. Il colore non deve essere opaco per evitare di nascondere le decorazioni sottostanti.","Colore del contorno del testo che è stato inserito.","Colore del contorno del testo che è stato rimosso.","Colore del bordo tra due editor di testo.","Colore del riempimento diagonale dell'editor diff. Il riempimento diagonale viene usato nelle visualizzazioni diff affiancate.","Colore di sfondo dell'elenco/albero per l'elemento con lo stato attivo quando l'elenco/albero è attivo. Un elenco/albero attivo ha lo stato attivo della tastiera, a differenza di uno inattivo.","Colore primo piano dell'elenco/albero per l'elemento con lo stato attivo quando l'elenco/albero è attivo. Un elenco/albero attivo ha lo stato attivo della tastiera, a differenza di uno inattivo.","Colore di sfondo dell'elenco/albero per l'elemento selezionato quando l'elenco/albero è attivo. Un elenco/albero attivo ha lo stato attivo della tastiera, a differenza di uno inattivo.","Colore primo piano dell'elenco/albero per l'elemento selezionato quando l'elenco/albero è attivo. Un elenco/albero attivo ha lo stato attivo della tastiera, a differenza di uno inattivo.","Colore di sfondo dell'elenco/albero per l'elemento selezionato quando l'elenco/albero è inattivo. Un elenco/albero attivo ha lo stato attivo della tastiera, a differenza di uno inattivo.","Colore primo piano dell'elenco/albero per l'elemento selezionato quando l'elenco/albero è inattivo. Un elenco/albero attivo ha lo stato attivo della tastiera, a differenza di uno inattivo.","Colore di sfondo dell'elenco/albero per l'elemento con lo stato attivo quando l'elenco/albero è inattivo. Un elenco/albero attivo ha lo stato attivo della tastiera, uno inattivo no.","Sfondo dell'elenco/albero al passaggio del mouse sugli elementi.","Primo piano dell'elenco/albero al passaggio del mouse sugli elementi.","Sfondo dell'elenco/albero durante il trascinamento degli elementi selezionati.","Colore primo piano Elenco/Struttura ad albero delle occorrenze trovate durante la ricerca nell'Elenco/Struttura ad albero.","Colore di sfondo del widget del filtro per tipo in elenchi e alberi.","Colore del contorno del widget del filtro per tipo in elenchi e alberi.","Colore del contorno del widget del filtro per tipo in elenchi e alberi quando non sono presenti corrispondenze.","Colore del tratto dell'albero per le guide per i rientri.","Colore del bordo del menu.","Colore primo piano delle voci di menu.","Colore di sfondo delle voci di menu.","Colore primo piano della voce di menu selezionata nei menu.","Colore di sfondo della voce di menu selezionata nei menu.","Colore del bordo della voce di menu selezionata nei menu.","Colore di un elemento separatore delle voci di menu.","Colore di sfondo dell'evidenziazione della tabulazione di un frammento.","Colore del bordo dell'evidenziazione della tabulazione di un frammento.","Colore di sfondo dell'evidenziazione della tabulazione finale di un frammento.","Colore del bordo dell'evidenziazione della tabulazione finale di un frammento.","Colore del marcatore del righello delle annotazioni per la ricerca di corrispondenze. Il colore non deve essere opaco per evitare di nascondere le decorazioni sottostanti.","Colore del marcatore del righello delle annotazioni per le evidenziazioni delle selezioni. Il colore non deve essere opaco per evitare di nascondere le decorazioni sottostanti.","Colore del marcatore della minimappa per la ricerca delle corrispondenze.","Colore del marcatore della minimappa per la selezione dell'editor.","Colore del marcatore della minimappa per gli errori.","Colore del marcatore della minimappa per gli avvisi.","Colore di sfondo della minimappa.","Colore di sfondo del dispositivo di scorrimento della minimappa.","Colore di sfondo del dispositivo di scorrimento della minimappa al passaggio del mouse.","Colore di sfondo del dispositivo di scorrimento della minimappa quando si fa clic con il mouse.","Colore usato per l'icona di errore dei problemi.","Colore usato per l'icona di avviso dei problemi.","Colore usato per l'icona informazioni dei problemi."], +"vs/platform/undoRedo/common/undoRedoService":["I file seguenti sono stati chiusi e modificati nel disco: {0}.","I file seguenti sono stati modificati in modo incompatibile: {0}.","Non è stato possibile annullare '{0}' in tutti i file. {1}","Non è stato possibile annullare '{0}' in tutti i file. {1}","Non è stato possibile annullare '{0}' in tutti i file perché sono state apportate modifiche a {1}","Non è stato possibile annullare '{0}' su tutti i file perché è già in esecuzione un'operazione di annullamento o ripetizione su {1}","Non è stato possibile annullare '{0}' su tutti i file perché nel frattempo è stata eseguita un'operazione di annullamento o ripetizione","Annullare '{0}' in tutti i file?","Annulla in {0} file","Annulla questo file","Annulla","Non è stato possibile annullare '{0}' perché è già in esecuzione un'operazione di annullamento o ripetizione.","Non è stato possibile ripetere '{0}' in tutti i file. {1}","Non è stato possibile ripetere '{0}' in tutti i file. {1}","Non è stato possibile ripetere '{0}' in tutti i file perché sono state apportate modifiche a {1}","Non è stato possibile ripetere '{0}' su tutti i file perché è già in esecuzione un'operazione di annullamento o ripetizione su {1}","Non è stato possibile ripetere '{0}' su tutti i file perché nel frattempo è stata eseguita un'operazione di annullamento o ripetizione","Non è stato possibile ripetere '{0}' perché è già in esecuzione un'operazione di annullamento o ripetizione."] +}); +//# sourceMappingURL=../../../min-maps/vs/editor/editor.main.nls.it.js.map \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/editor/editor.main.nls.ja.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/editor/editor.main.nls.ja.js new file mode 100644 index 0000000..b42a429 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/editor/editor.main.nls.ja.js @@ -0,0 +1,31 @@ +/*!----------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Version: 0.21.2(67b5a8116f3c0bace36b180e524e05bb750a16d8) + * Released under the MIT license + * https://github.com/Microsoft/vscode/blob/master/LICENSE.txt + *-----------------------------------------------------------*/ +define("vs/editor/editor.main.nls.ja",{"vs/base/browser/ui/actionbar/actionViewItems":["{0} ({1})"],"vs/base/browser/ui/findinput/findInput":["入力"],"vs/base/browser/ui/findinput/findInputCheckboxes":["大文字と小文字を区別する","単語単位で検索する","正規表現を使用する"],"vs/base/browser/ui/findinput/replaceInput":["入力","保持する"],"vs/base/browser/ui/inputbox/inputBox":["エラー: {0}","警告: {0}","情報: {0}"],"vs/base/browser/ui/keybindingLabel/keybindingLabel":["バインドなし"],"vs/base/browser/ui/menu/menu":["{0} ({1})"],"vs/base/browser/ui/tree/abstractTree":["クリア","型のフィルターを無効にする","型のフィルターを有効にする","要素が見つかりません","{1} 個の要素のうち {0} 個の要素が一致しました"],"vs/base/common/errorMessage":["{0}: {1}","システム エラーが発生しました ({0})","不明なエラーが発生しました。ログで詳細を確認してください。","不明なエラーが発生しました。ログで詳細を確認してください。","{0} (合計 {1} エラー)","不明なエラーが発生しました。ログで詳細を確認してください。"],"vs/base/common/keybindingLabels":["Ctrl","Shift","Alt","Windows","Ctrl","Shift","Alt","Super","Control","Shift","Alt","コマンド","Control","Shift","Alt","Windows","Control","Shift","Alt","Super"], +"vs/base/parts/quickinput/browser/quickInput":["戻る","{0}/{1}","入力すると結果が絞り込まれます。","{0} 件の結果","{0} 個選択済み","OK","カスタム","戻る ({0})","戻る"],"vs/base/parts/quickinput/browser/quickInputList":["クイック入力"],"vs/editor/browser/controller/coreCommands":["長い行に移動しても行末に位置します","長い行に移動しても行末に位置します"],"vs/editor/browser/controller/textAreaHandler":["エディター","この時点では、エディターにアクセスできません。オプションを表示するには、{0} を押します。"],"vs/editor/browser/editorExtensions":["元に戻す(&&U)","元に戻す","やり直し(&&R)","やり直し","すべて選択(&&S)","すべてを選択"],"vs/editor/browser/widget/codeEditorWidget":["カーソルの数は {0} 個に制限されています。"],"vs/editor/browser/widget/diffEditorWidget":["一方のファイルが大きすぎるため、ファイルを比較できません。"],"vs/editor/browser/widget/diffReview":["閉じる","変更された行はありません","1 行が変更されました","{0} 行が変更されました","相違 {0}/{1}: 元の行 {2}、{3}。変更された行 {4}、{5}","空白","{0} 変更されていない行 {1}","{0} 元の行 {1} 変更された行 {2}","+ {0} 変更された行 {1}","- {0} 元の行 {1}","次の差分に移動","前の差分に移動"],"vs/editor/browser/widget/inlineDiffMargin":["削除された行のコピー","削除された行のコピー","削除された行のコピー ({0})","この変更を元に戻す","削除された行のコピー ({0})"], +"vs/editor/common/config/commonEditorConfig":["エディター","1 つのタブに相当するスペースの数。`#editor.detectIndentation#` がオンの場合、この設定はファイル コンテンツに基づいて上書きされます。","`Tab` キーを押すとスペースが挿入されます。`#editor.detectIndentation#` がオンの場合、この設定はファイル コンテンツに基づいて上書きされます。","ファイルがファイルの内容に基づいて開かれる場合、`#editor.tabSize#` と `#editor.insertSpaces#` を自動的に検出するかどうかを制御します。","自動挿入された末尾の空白を削除します。","大きなファイルでメモリが集中する特定の機能を無効にするための特別な処理。","ドキュメント内の単語に基づいて入力候補を計算するかどうかを制御します。","セマンティックの強調表示がすべての配色テーマについて有効になりました。","セマンティックの強調表示がすべての配色テーマについて無効になりました。","セマンティックの強調表示は、現在の配色テーマの 'semanticHighlighting' 設定によって構成されています。","semanticHighlighting をサポートされる言語で表示するかどうかを制御します。","エディターのコンテンツをダブルクリックするか、`Escape` キーを押しても、ピーク エディターを開いたままにします。","この長さを越える行は、パフォーマンス上の理由によりトークン化されません。","差分計算が取り消された後のタイムアウト (ミリ秒単位)。タイムアウトなしには 0 を使用します。","差分エディターが差分を横に並べて表示するか、行内に表示するかを制御します。","有効にすると、差分エディターは先頭または末尾の空白文字の変更を無視します。","差分エディターが追加/削除された変更に +/- インジケーターを示すかどうかを制御します。","エディターで CodeLens を表示するかどうかを制御します。"], +"vs/editor/common/config/editorOptions":["エディターはスクリーン リーダーがいつ接続されたかを検出するためにプラットフォーム API を使用します。","エディターは永続的にスクリーン リーダー向けに最適化されます。","エディターはスクリーン リーダー向けに最適化されません。","エディターをスクリーン リーダーに最適化されたモードで実行するかどうかを制御します。","コメント時に空白文字を挿入するかどうかを制御します。","行コメントの追加または削除アクションの切り替えで、空の行を無視するかどうかを制御します。","選択範囲を指定しないでコピーする場合に現在の行をコピーするかどうかを制御します。","入力中に一致を検索するためにカーソルをジャンプさせるかどうかを制御します。","エディターの選択範囲から検索ウィジェット内の検索文字列を与えるかどうかを制御します。","[選択範囲を検索] を自動的にオンにしない (既定)","[選択範囲を検索] を常に自動的にオンにする","複数行のコンテンツが選択されている場合は、自動的に [選択範囲を検索] をオンにします。","[選択範囲を検索] を自動的にオンにする条件を制御します。","macOS で検索ウィジェットが共有の検索クリップボードを読み取りまたは変更するかどうかを制御します。","検索ウィジェットがエディターの上に行をさらに追加するかどうかを制御します。true の場合、検索ウィジェットが表示されているときに最初の行を超えてスクロールできます。","以降で一致が見つからない場合に、検索を先頭から (または末尾から) 自動的に再実行するかどうか制御します。","フォントの合字を有効/無効にします。","明示的なフォント機能設定。","フォントの合字またはフォントの機能を構成します。","フォント サイズ (ピクセル単位) を制御します。",'使用できるのは "標準" および "太字" のキーワードまたは 1 ~ 1000 の数字のみです。','フォントの太さを制御します。"標準" および "太字" のキーワードまたは 1 ~ 1000 の数字を受け入れます。',"結果のピーク ビューを表示 (既定)","主な結果に移動し、ピーク ビューを表示します","プライマリ結果に移動し、他のユーザーへのピークレス ナビゲーションを有効にします","この設定は非推奨です。代わりに、'editor.editor.gotoLocation.multipleDefinitions' や 'editor.editor.gotoLocation.multipleImplementations' などの個別の設定を使用してください。","複数のターゲットの場所があるときの '定義へ移動' コマンドの動作を制御します。","複数のターゲットの場所があるときの '型定義へ移動' コマンドの動作を制御します。","複数のターゲットの場所があるときの '宣言へ移動' コマンドの動作を制御します。","複数のターゲットの場所があるときの '実装に移動' コマンドの動作を制御します。","ターゲットの場所が複数存在する場合の '参照へ移動' コマンドの動作を制御します。","'定義へ移動' の結果が現在の場所である場合に実行される代替コマンド ID。","'型定義へ移動' の結果が現在の場所である場合に実行される代替コマンド ID。","'宣言へ移動' の結果が現在の場所である場合に実行される代替コマンド ID。","'実装へ移動' の結果が現在の場所である場合に実行される代替コマンド ID。","'参照へ移動' の結果が現在の場所である場合に実行される代替コマンド ID。","ホバーを表示するかどうかを制御します。","ホバーを表示後の待ち時間 (ミリ秒) を制御します。","ホバーにマウスを移動したときに、ホバーを表示し続けるかどうかを制御します。","エディターでコード アクションの電球を有効にします。","行の高さを制御します。フォント サイズに基づいて行の高さを計算する場合には、0 を使用します。","ミニマップを表示するかどうかを制御します。","ミニマップのサイズは、エディターのコンテンツと同じです (スクロールする場合があります)。","ミニマップは、必要に応じて、エディターの高さを埋めるため、拡大または縮小します (スクロールしません)。","ミニマップは必要に応じて縮小し、エディターより大きくなることはありません (スクロールしません)。","ミニマップのサイズを制御します。","ミニマップを表示する場所を制御します。","ミニマップ スライダーを表示するタイミングを制御します。","ミニマップに描画されるコンテンツのスケール: 1、2、または 3。","行にカラー ブロックではなく実際の文字を表示します。","表示するミニマップの最大幅を特定の列数に制限します。","エディターの上端と最初の行の間の余白の大きさを制御します。","エディターの下端と最後の行の間の余白の大きさを制御します。","入力時にパラメーター ドキュメントと型情報を表示するポップアップを有効にします。","パラメーター ヒント メニューを周回するか、リストの最後で閉じるかどうかを制御します。","文字列内でクイック候補を有効にします。","コメント内でクイック候補を有効にします。","文字列およびコメント外でクイック候補を有効にします。","入力中に候補を自動的に表示するかどうかを制御します。","行番号は表示されません。","行番号は、絶対値として表示されます。","行番号は、カーソル位置までの行数として表示されます。","行番号は 10 行ごとに表示されます。","行番号の表示を制御します。","このエディターのルーラーがレンダリングする単一領域の文字数。","このエディターのルーラーの色です。","特定の等幅文字数の後に垂直ルーラーを表示します。複数のルーラーには複数の値を使用します。配列が空の場合はルーラーを表示しません。","カーソルの右のテキストを上書きせずに候補を挿入します。","候補を挿入し、カーソルの右のテキストを上書きします。","入力候補を受け入れるときに単語を上書きするかどうかを制御します。これは、この機能の利用を選択する拡張機能に依存することにご注意ください。","候補のフィルター処理と並び替えでささいな入力ミスを考慮するかどうかを制御します。","並べ替えがカーソル付近に表示される単語を優先するかどうかを制御します。","保存された候補セクションを複数のワークプレースとウィンドウで共有するかどうかを制御します (`#editor.suggestSelection#` が必要)。","アクティブ スニペットがクイック候補を防止するかどうかを制御します。","提案のアイコンを表示するか、非表示にするかを制御します。","スクロール バーを表示する前に IntelliSense が表示する候補の数を制御します (最大 15 個)。","この設定は非推奨です。代わりに、'editor.suggest.showKeywords' や 'editor.suggest.showSnippets' などの個別の設定を使用してください。","有効にすると、IntelliSense に `メソッド` 候補が表示されます。","有効にすると、IntelliSense に `関数` 候補が表示されます。","有効にすると、IntelliSense に `コンストラクター` 候補が表示されます。","有効にすると、IntelliSense に `フィールド` 候補が表示されます。","有効にすると、IntelliSense に `変数` 候補が表示されます。","有効にすると、IntelliSense に 'クラス' 候補が表示されます。","有効にすると、IntelliSense に `構造体` 候補が表示されます。","有効にすると、IntelliSense に `インターフェイス` 候補が表示されます。","有効にすると、IntelliSense に `モジュール` 候補が表示されます。","有効にすると、IntelliSense に `プロパティ` 候補が表示されます。","有効にすると、IntelliSense に `イベント` 候補が表示されます。","有効にすると、IntelliSense に `演算子` 候補が表示されます。","有効にすると、IntelliSense に `ユニット` 候補が表示されます。","有効にすると、IntelliSense に `値` 候補が表示されます。","有効にすると、IntelliSense に `定数` 候補が表示されます。","有効にすると、IntelliSense に `列挙型` 候補が表示されます。","有効にすると、IntelliSense に `enumMember` 候補が表示されます。","有効にすると、IntelliSense に `キーワード` 候補が表示されます。","有効にすると、IntelliSense に 'テキスト' -候補が表示されます。","有効にすると、IntelliSense に `色` 候補が表示されます。","有効にすると、IntelliSense に 'ファイル' 候補が表示されます。","有効にすると、IntelliSense に `参照` 候補が表示されます。","有効にすると、IntelliSense に `customcolor` 候補が表示されます。","有効にすると、IntelliSense に `フォルダー` 候補が表示されます。","有効にすると、IntelliSense に `typeParameter` 候補が表示されます。","有効にすると、IntelliSense に `スニペット` 候補が表示されます。","有効な場合、IntelliSense によって 'ユーザー' 候補が示されます。","有効にすると、IntelliSense によって '問題' 候補が示されます。","候補ウィジェットの下部にあるステータス バーの表示を制御します。","コミット文字で候補を受け入れるかどうかを制御します。たとえば、JavaScript ではセミコロン (`;`) をコミット文字にして、候補を受け入れてその文字を入力することができます。","テキストの変更を行うとき、`Enter` を使用する場合にのみ候補を受け付けます。","`Tab` キーに加えて `Enter` キーで候補を受け入れるかどうかを制御します。改行の挿入や候補の反映の間であいまいさを解消するのに役立ちます。","スクリーン リーダーで読み上げることができるエディターの行数を制御します。警告: 既定値を上回る数を指定すると、パフォーマンスに影響を与えます。","エディターのコンテンツ","言語設定を使用して、いつかっこを自動クローズするか決定します。","カーソルが空白文字の左にあるときだけ、かっこを自動クローズします。","エディターで左角かっこを追加した後に自動的に右角かっこを挿入するかどうかを制御します。","終わり引用符または括弧が自動的に挿入された場合にのみ、それらを上書きします。","エディターで終わり引用符または括弧を上書きするかどうかを制御します。","言語設定を使用して、いつ引用符を自動クローズするか決定します。","カーソルが空白文字の左にあるときだけ、引用符を自動クローズします。","ユーザーが開始引用符を追加した後、エディター自動的に引用符を閉じるかどうかを制御します。","エディターはインデントを自動的に挿入しません。","エディターは、現在の行のインデントを保持します。","エディターは、現在の行のインデントを保持し、言語が定義されたかっこを優先します。","エディターは、現在の行のインデントを保持し、言語が定義されたかっこを優先し、言語で定義された特別な onEnterRules を呼び出します。","エディターは、現在の行のインデントを保持し、言語が定義されたかっこを優先し、言語で定義された特別な onEnterRules を呼び出し、言語で定義された indentationRules を優先します。","ユーザーが行を入力、貼り付け、移動、またはインデントするときに、エディターでインデントを自動的に調整するかどうかを制御します。","言語構成を使用して、選択範囲をいつ自動的に囲むかを判断します。","角かっこではなく、引用符で囲みます。","引用符ではなく、角かっこで囲みます。","エディターが自動的に選択範囲を囲む必要があるかどうかを制御します。","エディターで CodeLens を表示するかどうかを制御します。","エディターでインライン カラー デコレーターと色の選択を表示する必要があるかどうかを制御します。","マウスとキーでの選択により列の選択を実行できるようにします。","構文ハイライトをクリップボードにコピーするかどうかを制御します。","カーソルのアニメーション方式を制御します。","滑らかなキャレットアニメーションを有効にするかどうかを制御します。","カーソルのスタイルを制御します。","カーソル前後の表示可能な先頭と末尾の行の最小数を制御します。他の一部のエディターでは 'scrollOff' または `scrollOffset` と呼ばれます。","`cursorSurroundingLines` は、キーボードまたは API でトリガーされた場合にのみ強制されます。","`cursorSurroundingLines` は常に適用されます。","'カーソルの周囲の行' を適用するタイミングを制御します。","`#editor.cursorStyle#` が `line` に設定されている場合、カーソルの幅を制御します。","ドラッグ アンド ドロップによる選択範囲の移動をエディターが許可するかどうかを制御します。","`Alt` を押すと、スクロール速度が倍増します。","エディターでコードの折りたたみを有効にするかどうかを制御します。","利用可能な場合は言語固有の折りたたみ方法を使用し、利用可能ではない場合はインデントベースの方法を使用します。","インデントベースの折りたたみ方法を使用します。","折りたたみ範囲の計算方法を制御します。","エディターで折りたたまれた範囲を強調表示するかどうかをコントロールします。","折りたたまれた線の後の空のコンテンツをクリックすると線が展開されるかどうかを制御します。","フォント ファミリを制御します。","貼り付けた内容がエディターにより自動的にフォーマットされるかどうかを制御します。フォーマッタを使用可能にする必要があります。また、フォーマッタがドキュメント内の範囲をフォーマットできなければなりません。","エディターで入力後に自動的に行のフォーマットを行うかどうかを制御します。","エディターで縦のグリフ余白が表示されるかどうかを制御します。ほとんどの場合、グリフ余白はデバッグに使用されます。","概要ルーラーでカーソルを非表示にするかどうかを制御します。","エディターでアクティブなインデントのガイドを強調表示するかどうかを制御します。","文字間隔 (ピクセル単位) を制御します。","エディターがリンクを検出してクリック可能な状態にするかどうかを制御します。","対応するかっこを強調表示します。","マウス ホイール スクロール イベントの `deltaX` と `deltaY` で使用される乗数。","`Ctrl` キーを押しながらマウス ホイールを使用してエディターのフォントをズームします。","複数のカーソルが重なっているときは、マージします。","Windows および Linux 上の `Control` キーと macOS 上の `Command` キーに割り当てます。","Windows および Linux 上の `Alt` キーと macOS 上の `Option` キーに割り当てます。","マウスを使用して複数のカーソルを追加するときに使用する修飾キーです。「定義に移動」や「リンクを開く」のマウス操作は、マルチカーソルの修飾キーと競合しないように適用されます。[詳細](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier)","カーソルごとにテキストを 1 行ずつ貼り付けます。","各カーソルは全文を貼り付けます。","貼り付けたテキストの行数がカーソル数と一致する場合の貼り付けを制御します。","エディターでセマンティック シンボルの出現箇所を強調表示するかどうかを制御します。","概要ルーラーの周囲に境界線が描画されるかどうかを制御します。","ピークを開くときにツリーにフォーカスする","ピークを開くときにエディターにフォーカスする","ピーク ウィジェットのインライン エディターまたはツリーをフォーカスするかどうかを制御します。","[定義へ移動] マウス ジェスチャーで、常にピーク ウィジェットを開くかどうかを制御します。","クイック候補が表示されるまでのミリ秒を制御します。","エディターでの型の自動名前変更を制御します。","エディターで制御文字を表示するかどうかを制御します。","エディターでインデント ガイドを表示するかどうかを制御します。","ファイルの末尾が改行の場合は、最後の行番号を表示します。","余白と現在の行を強調表示します。","エディターが現在の行をどのように強調表示するかを制御します。","エディターにフォーカスがある場合にのみ現在の行をエディターで強調表示する必要があるかどうかを制御します","単語間の単一スペース以外の空白文字を表示します。","選択したテキストにのみ空白文字を表示します。","末尾の空白文字のみを表示する","エディターで空白文字を表示するかどうかを制御します。","選択範囲の角を丸くするかどうかを制御します。","エディターが水平方向に余分にスクロールする文字数を制御します。","エディターが最後の行を越えてスクロールするかどうかを制御します。","垂直および水平方向の両方に同時にスクロールする場合は、主要な軸に沿ってスクロールします。トラックパッド上で垂直方向にスクロールする場合は、水平ドリフトを防止します。","Linux の PRIMARY クリップボードをサポートするかどうかを制御します。","エディターが選択項目と類似の一致項目を強調表示するかどうかを制御します。","常に折りたたみコントロールを表示します。","マウスがとじしろの上にあるときにのみ、折りたたみコントロールを表示します。","とじしろのの折りたたみコントロールを表示するタイミングを制御します。","使用されていないコードのフェードアウトを制御します。","非推奨の変数の取り消し線を制御します。","他の候補の上にスニペットの候補を表示します。","他の候補の下にスニペットの候補を表示します。","他の候補と一緒にスニペットの候補を表示します。","スニペットの候補を表示しません。","他の修正候補と一緒にスニペットを表示するかどうか、およびその並び替えの方法を制御します。","アニメーションでエディターをスクロールするかどうかを制御します。","候補ウィジェットのフォント サイズ。`0` に設定すると、`#editor.fontSize#` の値が使用されます。","候補ウィジェットの行の高さ。`0` に設定すると、`#editor.lineHeight#` の値が使用されます。","トリガー文字の入力時に候補が自動的に表示されるようにするかどうかを制御します。","常に最初の候補を選択します。","`console.| -> console.log` などと選択対象に関して入力しない限りは、最近の候補を選択します。`log` は最近完了したためです。","これらの候補を完了した以前のプレフィックスに基づいて候補を選択します。例: `co -> console` および `con -> const`。","候補リストを表示するときに候補を事前に選択する方法を制御します。","タブ補完は、tab キーを押したときに最適な候補を挿入します。","タブ補完を無効にします。","プレフィックスが一致する場合に、タブでスニペットを補完します。'quickSuggestions' が無効な場合に最適です。","タブ補完を有効にします。","通常とは異なる行の終端文字は無視される。","通常とは異なる行の終端文字の削除プロンプトが表示される。","通常とは異なる行の終端文字は自動的に削除される。","問題を起こす可能性がある、普通ではない行終端記号は削除してください。","空白の挿入や削除はタブ位置に従って行われます。","単語に関連したナビゲーションまたは操作を実行するときに、単語の区切り文字として使用される文字。","行を折り返しません。","行をビューポートの幅で折り返します。","`#editor.wordWrapColumn#` で行を折り返します。","ビューポートと `#editor.wordWrapColumn#` の最小値で行を折り返します。","行の折り返し方法を制御します。","`#editor.wordWrap#` が `wordWrapColumn` または `bounded` の場合に、エディターの折り返し桁を制御します。","インデントしません。 折り返し行は列 1 から始まります。","折り返し行は、親と同じインデントになります。","折り返し行は、親 +1 のインデントになります。","折り返し行は、親 +2 のインデントになります。","折り返し行のインデントを制御します。","すべての文字の幅が同じであると仮定します。これは、モノスペース フォントや、グリフの幅が等しい特定のスクリプト (ラテン文字など) で正しく動作する高速アルゴリズムです。","折り返しポイントの計算をブラウザーにデリゲートします。これは、大きなファイルのフリーズを引き起こす可能性があるものの、すべてのケースで正しく動作する低速なアルゴリズムです。","折り返しポイントを計算するアルゴリズムを制御します。"], +"vs/editor/common/model/editStack":["入力しています"],"vs/editor/common/modes/modesRegistry":["プレーンテキスト"], +"vs/editor/common/standaloneStrings":["選択されていません","行 {0}、列 {1} ({2} 個選択済み)","行 {0}、列 {1}","{0} 個の選択項目 ({1} 文字を選択)","{0} 個の選択項目","`accessibilitySupport` 設定を 'on' に変更しています。","エディターのアクセシビリティに関連するドキュメント ページを開いています。","差分エディターの読み取り専用ウィンドウ内。","差分エディターのウィンドウ内。","読み取り専用コード エディター内","コード エディター内","エディターを構成してスクリーン エディターで使用するように最適化するには、Command+E を押してください。","エディターを構成してスクリーン リーダーで使用するように最適化するには、Control+E を押します。","エディターは、スクリーン リーダーで使用するよう最適化されるように構成されています。","エディターは、スクリーン リーダーで使用するよう最適化されないように構成されていますが、現時点でこの設定は当てはまりません。","現在のエディターで Tab キーを押すと、次のフォーカス可能な要素にフォーカスを移動します。{0} を押すと、この動作が切り替わります。","現在のエディターで Tab キーを押すと、次のフォーカス可能な要素にフォーカスを移動します。コマンド {0} は、キー バインドでは現在トリガーできません。","現在のエディターで Tab キーを押すと、タブ文字が挿入されます。{0} を押すと、この動作が切り替わります。","現在のエディターで Tab キーを押すと、タブ文字が挿入されます。コマンド {0} は、キー バインドでは現在トリガーできません。","エディターのアクセシビリティに関する詳細情報が記されたブラウザー ウィンドウを開くには、Command+H を押してください。","エディターのアクセシビリティに関する詳細情報が記されたブラウザー ウィンドウを開くには、Control+H を押してください。","Esc キー か Shift+Esc を押すと、ヒントを消してエディターに戻ることができます。","アクセシビリティのヘルプを表示します","開発者: トークンの検査","行/列に移動する...","すべてのクイック アクセス プロバイダーを表示","コマンド パレット","コマンドの表示と実行","シンボルに移動...","カテゴリ別のシンボルへ移動","エディターのコンテンツ","アクティビティ オプションを表示するには、Alt+F1 キーを押します。","ハイ コントラスト テーマの切り替え","{1} 個のファイルに {0} 個の編集が行われました"], +"vs/editor/common/view/editorColorRegistry":["カーソル位置の行を強調表示する背景色。","カーソル位置の行の境界線を強調表示する背景色。","(Quick Open や検出機能などにより) 強調表示されている範囲の色。この色は、基本装飾が非表示にならないよう不透明にすることはできません。","強調表示された範囲の境界線の背景色。","強調表示された記号の背景色 (定義へ移動、次または前の記号へ移動など)。基になる装飾が覆われないようにするため、色を不透明にすることはできません。","強調表示された記号の周りの境界線の背景色。","エディターのカーソルの色。","選択された文字列の背景色です。選択された文字列の背景色をカスタマイズ出来ます。","エディターのスペース文字の色。","エディター インデント ガイドの色。","アクティブなエディターのインデント ガイドの色。","エディターの行番号の色。","エディターのアクティブ行番号の色","id は使用しないでください。代わりに 'EditorLineNumber.activeForeground' を使用してください。","エディターのアクティブ行番号の色","エディター ルーラーの色。","CodeLens エディターの前景色。","一致するかっこの背景色","一致するかっこ内のボックスの色","概要ルーラーの境界色。","エディターの概要ルーラーの背景色です。ミニマップが有効で、エディターの右側に配置されている場合にのみ使用します。","エディターの余白の背景色。余白にはグリフ マージンと行番号が含まれます。","エディターでの不要な (未使用の) ソース コードの罫線の色。","エディター内の不要な (未使用の) ソース コードの不透明度。たとえば、\"#000000c0\" は不透明度 75% でコードを表示します。ハイ コントラストのテーマの場合、'editorUnnecessaryCode.border' テーマ色を使用して、不要なコードをフェードアウトするのではなく下線を付けます。","範囲強調表示のための概要ルーラー マーカーの色。この色は、基本装飾が非表示にならないよう不透明にすることはできません。","エラーを示す概要ルーラーのマーカー色。","警告を示す概要ルーラーのマーカー色。","情報を示す概要ルーラーのマーカー色。"], +"vs/editor/contrib/anchorSelect/anchorSelect":["選択アンカー","アンカーが {0}:{1} に設定されました","選択アンカーの設定","選択アンカーへ移動","アンカーからカーソルへ選択","選択アンカーの取り消し"],"vs/editor/contrib/bracketMatching/bracketMatching":["一致するブラケットを示す概要ルーラーのマーカー色。","ブラケットへ移動","ブラケットに選択","ブラケットに移動(&&B)"],"vs/editor/contrib/caretOperations/caretOperations":["選択したテキストを左に移動","選択したテキストを右に移動"],"vs/editor/contrib/caretOperations/transpose":["文字の入れ替え"],"vs/editor/contrib/clipboard/clipboard":["切り取り(&&T)","切り取り","切り取り","コピー(&&C)","コピー","コピー","貼り付け(&&P)","貼り付け","貼り付け","構文を強調表示してコピー"], +"vs/editor/contrib/codeAction/codeActionCommands":["実行するコード アクションの種類。","返されたアクションが適用されるタイミングを制御します。","最初に返されたコード アクションを常に適用します。","最初に返されたコード アクション以外に返されたコード アクションがない場合は、そのアクションを適用します。","返されたコード アクションは適用しないでください。","優先コード アクションのみを返すかどうかを制御します。","コード アクションの適用中に不明なエラーが発生しました","クイック フィックス...","利用可能なコード アクションはありません","'{0}' に対して使用できる優先コード アクションがありません","{0}' に対して使用できるコード アクションがありません","使用できる優先コード アクションがありません","利用可能なコード アクションはありません","リファクター...","'{0}' に対して使用できる優先リファクタリングがありません","'{0}' に対して使用できるリファクタリングがありません","使用できる優先リファクタリングがありません","利用可能なリファクタリングはありません","ソース アクション...","'{0}' に対して使用できる優先ソース アクションがありません","'{0}' に対して使用できるソース アクションがありません","使用できる優先ソース アクションがありません","利用可能なソース アクションはありません","インポートを整理","利用可能なインポートの整理アクションはありません","すべて修正","すべてを修正するアクションは利用できません","自動修正...","利用可能な自動修正はありません"],"vs/editor/contrib/codeAction/lightBulbWidget":["修正プログラムを表示します。推奨される利用可能な修正プログラム ({0})","修正プログラム ({0}) を表示する","修正プログラムを表示する"],"vs/editor/contrib/codelens/codelensController":["現在の行のコード レンズ コマンドを表示"], +"vs/editor/contrib/comment/comment":["行コメントの切り替え","行コメントの切り替え(&&T)","行コメントの追加","行コメントの削除","ブロック コメントの切り替え","ブロック コメントの切り替え(&&B)"],"vs/editor/contrib/contextmenu/contextmenu":["エディターのコンテキスト メニューの表示"],"vs/editor/contrib/cursorUndo/cursorUndo":["カーソルを元に戻す","カーソルのやり直し"], +"vs/editor/contrib/documentSymbols/outlineTree":["配列記号の前景色。これらの記号は、アウトライン、階層リンク、および候補のウィジェットに表示されます。","ブール値記号の前景色。これらの記号は、アウトライン、階層リンク、および候補のウィジェットに表示されます。","クラス記号の前景色。これらの記号は、アウトライン、階層リンク、および候補のウィジェットに表示されます。","色記号の前景色。これらの記号は、アウトライン、階層リンク、および候補のウィジェットに表示されます。","定数記号の前景色。これらの記号は、アウトライン、階層リンク、および候補のウィジェットに表示されます。","コンストラクター記号の前景色。これらの記号は、アウトライン、階層リンク、および候補のウィジェットに表示されます。","列挙子記号の前景色。これらの記号は、アウトライン、階層リンク、および候補のウィジェットに表示されます。","列挙子メンバー記号の前景色。これらの記号は、アウトライン、階層リンク、および候補のウィジェットに表示されます。","イベント記号の前景色。これらの記号は、アウトライン、階層リンク、および候補のウィジェットに表示されます。","フィールド記号の前景色。これらの記号は、アウトライン、階層リンク、および候補のウィジェットに表示されます。","ファイル記号の前景色。これらの記号は、アウトライン、階層リンク、および候補のウィジェットに表示されます。","フォルダー記号の前景色。これらの記号は、アウトライン、階層リンク、および候補のウィジェットに表示されます。","関数記号の前景色。これらの記号は、アウトライン、階層リンク、および候補のウィジェットに表示されます。","インターフェイス記号の前景色。これらの記号は、アウトライン、階層リンク、および候補のウィジェットに表示されます。","キー記号の前景色。これらの記号は、アウトライン、階層リンク、および候補のウィジェットに表示されます。","キーワード記号の前景色。これらの記号は、アウトライン、階層リンク、および候補のウィジェットに表示されます。","メソッド記号の前景色。これらの記号は、アウトライン、階層リンク、および候補のウィジェットに表示されます。","モジュール記号の前景色。これらの記号は、アウトライン、階層リンク、および候補のウィジェットに表示されます。","名前空間記号の前景色。これらの記号は、アウトライン、階層リンク、および候補のウィジェットに表示されます。","Null 記号の前景色。これらの記号は、アウトライン、階層リンク、および候補のウィジェットに表示されます。","数値記号の前景色。これらの記号は、アウトライン、階層リンク、および候補のウィジェットに表示されます。","オブジェクト記号の前景色。これらの記号は、アウトライン、階層リンク、および候補のウィジェットに表示されます。","演算子記号の前景色。これらの記号は、アウトライン、階層リンク、および候補のウィジェットに表示されます。","パッケージ記号の前景色。これらの記号は、アウトライン、階層リンク、および候補のウィジェットに表示されます。","プロパティ記号の前景色。これらの記号は、アウトライン、階層リンク、および候補のウィジェットに表示されます。","参照記号の前景色。これらの記号は、アウトライン、階層リンク、および候補のウィジェットに表示されます。","スニペット記号の前景色。これらの記号は、アウトライン、階層リンク、および候補のウィジェットに表示されます。","文字列記号の前景色。これらの記号は、アウトライン、階層リンク、および候補のウィジェットに表示されます。","構造体記号の前景色。これらの記号は、アウトライン、階層リンク、および候補のウィジェットに表示されます。","テキスト記号の前景色。これらの記号は、アウトライン、階層リンク、および候補のウィジェットに表示されます。","パラメーター記号の前景色。これらの記号は、アウトライン、階層リンク、および候補のウィジェットに表示されます。","単位記号の前景色。これらの記号は、アウトライン、階層リンク、および候補のウィジェットに表示されます。","変数記号の前景色。これらの記号は、アウトライン、階層リンク、および候補のウィジェットに表示されます。"], +"vs/editor/contrib/find/findController":["検索","検索(&&F)","選択範囲で検索","次を検索","次を検索","前を検索","前を検索","次の選択項目を検索","前の選択項目を検索","置換","置換(&&R)"],"vs/editor/contrib/find/findWidget":["検索","検索","前の検索結果","次の一致項目","選択範囲を検索","閉じる","置換","置換","置換","すべて置換","置換モードの切り替え","最初の {0} 件の結果だけが強調表示されますが、すべての検索操作はテキスト全体で機能します。","{0} / {1} 件","結果はありません。","{0} が見つかりました","{0} が '{1}' で見つかりました","{0} は '{1}' で {2} に見つかりました","{0} が '{1}' で見つかりました","Ctrl + Enter キーを押すと、すべて置換するのではなく、改行が挿入されるようになりました。editor.action.replaceAll のキーバインドを変更して、この動作をオーバーライドできます。"],"vs/editor/contrib/folding/folding":["展開","再帰的に展開する","折りたたみ","折りたたみの切り替え","再帰的に折りたたむ","すべてのブロック コメントの折りたたみ","すべての領域を折りたたむ","すべての領域を展開","すべて折りたたみ","すべて展開","レベル {0} で折りたたむ","折り曲げる範囲の背景色。基の装飾を隠さないように、色は不透明であってはなりません。","エディターの余白にある折りたたみコントロールの色。"],"vs/editor/contrib/fontZoom/fontZoom":["エディターのフォントを拡大","エディターのフォントを縮小","エディターのフォントのズームをリセット"],"vs/editor/contrib/format/format":["行 {0} で 1 つの書式設定を編集","行 {1} で {0} 個の書式設定を編集","行 {0} と {1} の間で 1 つの書式設定を編集","行 {1} と {2} の間で {0} 個の書式設定を編集"], +"vs/editor/contrib/format/formatActions":["ドキュメントのフォーマット","選択範囲のフォーマット"],"vs/editor/contrib/gotoError/gotoError":["次の問題 (エラー、警告、情報) へ移動","前の問題 (エラー、警告、情報) へ移動","ファイル内の次の問題 (エラー、警告、情報) へ移動","次の問題箇所(&&P)","ファイル内の前の問題 (エラー、警告、情報) へ移動","前の問題箇所(&&P)"],"vs/editor/contrib/gotoError/gotoErrorWidget":["エラー","警告","情報","ヒント","{0} ({1})。","{1} 件中 {0} 件の問題","問題 {0} / {1}","エディターのマーカー ナビゲーション ウィジェットのエラーの色。","エディターのマーカー ナビゲーション ウィジェットの警告の色。","エディターのマーカー ナビゲーション ウィジェットの情報の色。","エディターのマーカー ナビゲーション ウィジェットの背景。"],"vs/editor/contrib/gotoSymbol/goToCommands":["ピーク","定義","'{0}' の定義は見つかりません","定義が見つかりません","定義へ移動","定義に移動(&&D)","定義を横に開く","定義をここに表示","宣言","'{0}' の宣言が見つかりません","宣言が見つかりません","宣言へ移動","宣言へ移動(&&D)","'{0}' の宣言が見つかりません","宣言が見つかりません","宣言をここに表示","型定義","'{0}' の型定義が見つかりません","型定義が見つかりません","型定義へ移動","型定義に移動(&&T)","型定義を表示","実装","'{0}' の実装が見つかりません","実装が見つかりません","実装へ移動","実装箇所に移動(&&I)","実装のピーク","'{0}' の参照が見つかりません","参照が見つかりません","参照へ移動","参照へ移動(&&R)","参照設定","参照をここに表示","参照設定","任意の記号へ移動","場所","'{0}' に一致する結果は見つかりませんでした","参照設定"], +"vs/editor/contrib/gotoSymbol/link/goToDefinitionAtPosition":["クリックして、{0} の定義を表示します。"],"vs/editor/contrib/gotoSymbol/peek/referencesController":["読み込んでいます...","{0} ({1})"],"vs/editor/contrib/gotoSymbol/peek/referencesTree":["{0} 個の参照","{0} 個の参照","参照"],"vs/editor/contrib/gotoSymbol/peek/referencesWidget":["プレビューを表示できません","結果はありません。","参照設定"],"vs/editor/contrib/gotoSymbol/referencesModel":["列 {2} の {1} 行目に {0} つのシンボル","{0} に 1 個のシンボル、完全なパス {1}","{1} に {0} 個のシンボル、完全なパス {2}","一致する項目はありません","{0} に 1 個のシンボルが見つかりました","{1} に {0} 個のシンボルが見つかりました","{1} 個のファイルに {0} 個のシンボルが見つかりました"],"vs/editor/contrib/gotoSymbol/symbolNavigation":["{1} のシンボル {0}、次に {2}","シンボル {0}/{1}"],"vs/editor/contrib/hover/hover":["ホバーの表示","定義プレビューのホバーを表示する"],"vs/editor/contrib/hover/modesContentHover":["読み込んでいます...","問題を表示","クイックフィックスを確認しています...","利用できるクイックフィックスはありません","クイック フィックス..."],"vs/editor/contrib/inPlaceReplace/inPlaceReplace":["前の値に置換","次の値に置換"], +"vs/editor/contrib/indentation/indentation":["インデントをスペースに変換","インデントをタブに変換","構成されたタブのサイズ","現在のファイルのタブのサイズを選択","タブによるインデント","スペースによるインデント","内容からインデントを検出","行の再インデント","選択行を再インデント"],"vs/editor/contrib/linesOperations/linesOperations":["行を上へコピー","行を上へコピー(&&C)","行を下へコピー","行を下へコピー(&&P)","選択範囲の複製","選択範囲の複製(&&D)","行を上へ移動","行を上へ移動(&&V)","行を下へ移動","行を下へ移動(&&L)","行を昇順に並べ替え","行を降順に並べ替え","末尾の空白のトリミング","行の削除","行のインデント","行のインデント解除","行を上に挿入","行を下に挿入","左側をすべて削除","右側をすべて削除","行をつなげる","カーソルの周囲の文字を入れ替える","大文字に変換","小文字に変換","先頭文字を大文字に変換する"],"vs/editor/contrib/links/links":["コマンドの実行","リンク先を表示","cmd + クリック","ctrl + クリック","option + クリック","alt + クリック","このリンクは形式が正しくないため開くことができませんでした: {0}","このリンクはターゲットが存在しないため開くことができませんでした。","リンクを開く"],"vs/editor/contrib/message/messageController":["読み取り専用のエディターは編集できません"], +"vs/editor/contrib/multicursor/multicursor":["カーソルを上に挿入","カーソルを上に挿入(&&A)","カーソルを下に挿入","カーソルを下に挿入(&&D)","カーソルを行末に挿入","カーソルを行末に挿入(&&U)","カーソルを下に挿入","カーソルを上に挿入","選択した項目を次の一致項目に追加","次の出現個所を追加(&&N)","選択項目を次の一致項目に追加","前の出現箇所を追加(&&R)","最後に選択した項目を次の一致項目に移動","最後に選んだ項目を前の一致項目に移動する","一致するすべての出現箇所を選択します","すべての出現箇所を選択(&&O)","すべての出現箇所を変更"],"vs/editor/contrib/parameterHints/parameterHints":["パラメーター ヒントをトリガー"],"vs/editor/contrib/parameterHints/parameterHintsWidget":["{0}、ヒント"],"vs/editor/contrib/peekView/peekView":["閉じる","ピーク ビューのタイトル領域の背景色。","ピーク ビュー タイトルの色。","ピーク ビューのタイトル情報の色。","ピーク ビューの境界と矢印の色。","ピーク ビュー結果リストの背景色。","ピーク ビュー結果リストのライン ノードの前景色。","ピーク ビュー結果リストのファイル ノードの前景色。","ピーク ビュー結果リストの選択済みエントリの背景色。","ピーク ビュー結果リストの選択済みエントリの前景色。","ピーク ビュー エディターの背景色。","ピーク ビュー エディターの余白の背景色。","ピーク ビュー結果リストの一致した強調表示色。","ピーク ビュー エディターの一致した強調表示色。","ピーク ビュー エディターの一致した強調境界色。"], +"vs/editor/contrib/quickAccess/gotoLineQuickAccess":["最初にテキスト エディターを開いて、行に移動します。","行 {0}、列 {1} に移動します。","{0} 行に移動します。","現在の行: {0}、文字: {1}。移動先となる、1 から {2} までの行番号を入力します。","現在の行: {0}、文字: {1}。移動先の行番号を入力します。"],"vs/editor/contrib/quickAccess/gotoSymbolQuickAccess":["シンボルに移動するには、まずシンボル情報を含むテキスト エディターを開きます。","アクティブなテキスト エディターでは、シンボル情報は表示されません。","一致するエディター シンボルがありません","エディター シンボルがありません","横に並べて開く","一番下で開く","シンボル ({0})","プロパティ ({0})","メソッド ({0})","関数 ({0})","コンストラクター ({0})","変数 ({0})","クラス ({0})","構造体 ({0})","イベント ({0})","演算子 ({0})","インターフェイス ({0})","名前空間 ({0})","パッケージ ({0})","型パラメーター ({0})","モジュール ({0})","プロパティ ({0})","列挙型 ({0})","列挙型メンバー ({0})","文字列 ({0})","ファイル ({0})","配列 ({0})","数値 ({0})","ブール値 ({0})","オブジェクト ({0})","キー ({0})","フィールド ({0})","定数 ({0})"],"vs/editor/contrib/rename/onTypeRename":["シンボルの名前変更に入力時","エディターが型の名前の自動変更を行うときの背景色です。"], +"vs/editor/contrib/rename/rename":["結果がありません。","名前変更の場所を解決しようとして不明なエラーが発生しました","'{0}' の名前の変更中","{0} の名前を変更しています","'{0}' から '{1}' への名前変更が正常に完了しました。概要: {2}","名前の変更で編集を適用できませんでした","名前の変更によって編集の計算に失敗しました","シンボルの名前変更","名前を変更する前に変更をプレビューする機能を有効または無効にする"],"vs/editor/contrib/rename/renameInputField":["名前変更入力。新しい名前を入力し、Enter キーを押してコミットしてください。","名前を変更するには {0}、プレビューするには {1}"],"vs/editor/contrib/smartSelect/smartSelect":["選択範囲を拡張","選択範囲の展開(&&E)","選択範囲を縮小","選択範囲の縮小(&&S)"],"vs/editor/contrib/snippet/snippetVariables":["日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日","日","月","火","水","木","金","土","1 月","2 月","3 月","4 月","5 月","6 月","7 月","8 月","9 月","10 月","11 月","12 月","1 月","2 月","3 月","4 月","5 月","6 月","7 月","8 月","9 月","10 月","11 月","12 月"],"vs/editor/contrib/suggest/suggestController":["{1} が追加編集した '{0}' を受け入れる","候補をトリガー","挿入する {0}","{0}して挿入","{0}して置き換え","{0}して置き換え","{0}して挿入","表示を減らす","さらに表示"], +"vs/editor/contrib/suggest/suggestWidget":["候補のウィジェットの背景色。","候補ウィジェットの境界線色。","候補ウィジェットの前景色。","候補ウィジェット内で選択済みエントリの背景色。","候補のウィジェット内で一致したハイライトの色。","読み取り数を増やす ({0})","読み取り数を減らす ({0})","読み込んでいます...","読み込んでいます...","候補はありません。","{0}、ドキュメント: {1}","提案"],"vs/editor/contrib/toggleTabFocusMode/toggleTabFocusMode":["Tab キーを切り替えるとフォーカスが移動します","Tab キーを押すと、次のフォーカス可能な要素にフォーカスを移動します","Tab キーを押すと、タブ文字が挿入されます"],"vs/editor/contrib/tokenization/tokenization":["開発者: トークン再作成の強制"],"vs/editor/contrib/unusualLineTerminators/unusualLineTerminators":["普通ではない行終端記号","普通ではない行終端記号が検出されました","このファイルには、行区切り文字 (LS) や段落区切り記号 (PS) などの特殊な行の終端文字が 1 つ以上含まれています。\r\n\r\nそれらの終端文字はファイルから削除することをお勧めします。これは 'editor.unusualLineTerminators' を使用して構成できます。","このファイルを修正","このファイルでは問題を無視する"], +"vs/editor/contrib/wordHighlighter/wordHighlighter":["変数の読み取りなど、読み取りアクセス中のシンボルの背景色。下にある装飾を隠さないために、色は不透過であってはなりません。","変数への書き込みなど、書き込みアクセス中のシンボル背景色。下にある装飾を隠さないために、色は不透過であってはなりません。","変数の読み取りなど読み取りアクセス中のシンボルの境界線の色。","変数への書き込みなど書き込みアクセス中のシンボルの境界線の色。","シンボルによって強調表示される概要ルーラーのマーカーの色。マーカーの色は、基になる装飾を隠さないように不透明以外にします。","書き込みアクセス シンボルを強調表示する概要ルーラーのマーカー色。下にある装飾を隠さないために、色は不透過であってはなりません。","次のシンボル ハイライトに移動","前のシンボル ハイライトに移動","シンボル ハイライトをトリガー"],"vs/platform/actions/browser/menuEntryActionViewItem":["{0} ({1})"],"vs/platform/configuration/common/configurationRegistry":["既定の言語構成のオーバーライド","言語に対して上書きされるエディター設定を構成します。","この設定では、言語ごとの構成はサポートされていません。","'{0}' を登録できません。これは、言語固有のエディター設定を記述するプロパティ パターン '\\\\[.*\\\\]$' に一致しています。'configurationDefaults' コントリビューションを使用してください。","'{0}' を登録できません。このプロパティは既に登録されています。"],"vs/platform/keybinding/common/abstractKeybindingService":["({0}) が渡されました。2 番目のキーを待っています...","キーの組み合わせ ({0}、{1}) はコマンドではありません。"], +"vs/platform/list/browser/listService":["ワークベンチ","Windows および Linux 上の `Control` キーと macOS 上の `Command` キーに割り当てます。","Windows および Linux 上の `Alt` キーと macOS 上の `Option` キーに割り当てます。","マウスを使用して項目を複数選択するときに使用する修飾キーです (たとえば、エクスプローラーでエディターと scm ビューを開くなど)。'横に並べて開く' マウス ジェスチャー (がサポートされている場合) は、複数選択の修飾キーと競合しないように調整されます。","マウスを使用して、ツリー リスト内の項目を開く方法を制御します (サポートされている場合)。ツリー内の子を持つ親項目で、この設定は親項目をシングル クリックで展開するか、ダブル クリックで展開するかどうかを制御します。この設定の選択 (適応するかどうか) を無視するツリー リストがあることに注意してください。","リストとツリーがワークベンチで水平スクロールをサポートするかどうかを制御します。警告: この設定をオンにすると、パフォーマンスに影響があります。","ツリーのインデントをピクセル単位で制御します。","ツリーでインシデントのガイドを表示する必要があるかどうかを制御します。","リストとツリーでスムーズ スクロールを使用するかどうかを制御します。","簡単なキーボード ナビゲーションは、キーボード入力に一致する要素に焦点を当てます。一致処理はプレフィックスでのみ実行されます。","キーボード ナビゲーションの強調表示を使用すると、キーボード入力に一致する要素が強調表示されます。上および下への移動は、強調表示されている要素のみを移動します。","キーボード ナビゲーションのフィルターでは、キーボード入力に一致しないすべての要素がフィルター処理され、非表示になります。","ワークベンチのリストおよびツリーのキーボード ナビゲーション スタイルを制御します。単純、強調表示、フィルターを指定できます。","リストやツリーでのキーボード ナビゲーションを、単に入力するだけで自動的にトリガーするかどうかを制御します。`false` に設定した場合、キーボード ナビゲーションは `list.toggleKeyboardNavigation` コマンドを実行したときにのみトリガーされます。これに対してキーボード ショートカットを割り当てることができます。"], +"vs/platform/markers/common/markers":["エラー","警告","情報"],"vs/platform/quickinput/browser/commandsQuickAccess":["{0}, {1}","最近使用したもの","その他のコマンド","コマンド '{0}' でエラー ({1}) が発生しました"],"vs/platform/quickinput/browser/helpQuickAccess":["グローバル コマンド","エディター コマンド","{0}, {1}"], +"vs/platform/theme/common/colorRegistry":["全体の前景色。この色は、コンポーネントによってオーバーライドされていない場合にのみ使用されます。","エラー メッセージ全体の前景色。この色は、コンポーネントによって上書きされていない場合にのみ使用されます。","ワークベンチのアイコンの既定の色。","フォーカスされた要素の境界線全体の色。この色はコンポーネントによって上書きされていない場合にのみ使用されます。","コントラストを強めるために、他の要素と隔てる追加の境界線。","コントラストを強めるために、アクティブな他要素と隔てる追加の境界線。","テキスト内のリンクの前景色。","テキスト内のコード ブロックの背景色。","エディター内の検索/置換窓など、エディター ウィジェットの影の色。","入力ボックスの背景。","入力ボックスの前景。","入力ボックスの境界線。","入力フィールドのアクティブ オプションの境界線の色。","入力フィールドでアクティブ化されたオプションの背景色。","入力フィールドでアクティブ化されたオプションの前景色。","情報の重大度を示す入力検証の背景色。","情報の重大度を示す入力検証の前景色。","情報の重大度を示す入力検証の境界線色。","警告の重大度を示す入力検証の背景色。","警告の重大度を示す入力検証の前景色。","警告の重大度を示す入力検証の境界線色。","エラーの重大度を示す入力検証の背景色。","エラーの重大度を示す入力検証の前景色。","エラーの重大度を示す入力検証の境界線色。","ドロップダウンの背景。","ドロップダウンの前景。","ボタンの前景色。","ボタンの背景色。","ホバー時のボタン背景色。","バッジの背景色。バッジとは小さな情報ラベルのことです。例:検索結果の数","バッジの前景色。バッジとは小さな情報ラベルのことです。例:検索結果の数","ビューがスクロールされたことを示すスクロール バーの影。","スクロール バーのスライダーの背景色。","ホバー時のスクロール バー スライダー背景色。","クリック時のスクロール バー スライダー背景色。","時間のかかる操作で表示するプログレス バーの背景色。","エディターでエラーを示す波線の前景色。","エディター内のエラー ボックスの境界線の色です。","エディターで警告を示す波線の前景色。","エディターでの警告ボックスの境界線の色です。","エディターで情報を示す波線の前景色。","エディター内の情報ボックスの境界線の色です。","エディターでヒントを示す波線の前景色。","エディター内のヒント ボックスの境界線の色。","エディターの背景色。","エディターの既定の前景色。","検索/置換窓など、エディター ウィジェットの背景色。","検索/置換などを行うエディター ウィジェットの前景色。","エディター ウィジェットの境界線色。ウィジェットに境界線があり、ウィジェットによって配色を上書きされていない場合でのみこの配色は使用されます。","エディター ウィジェットのサイズ変更バーの境界線色。ウィジェットにサイズ変更の境界線があり、ウィジェットによって配色を上書きされていない場合でのみこの配色は使用されます。","クイック ピッカーの背景色。クイック ピッカー ウィジェットは、コマンド パレットのようなピッカーのコンテナーです。","クイック ピッカーの前景色。クイック ピッカー ウィジェットは、コマンド パレットのようなピッカーのコンテナーです。","クイック ピッカー のタイトルの背景色。クイック ピッカー ウィジェットは、コマンド パレットのようなピッカーのコンテナーです。","ラベルをグループ化するためのクリック選択の色。","境界線をグループ化するためのクイック選択の色。","エディターの選択範囲の色。","ハイ コントラストの選択済みテキストの色。","非アクティブなエディターの選択範囲の色。この色は、基本装飾が非表示にならないよう不透明にすることはできません。","選択範囲の同じコンテンツの領域の色。この色は、基本装飾が非表示にならないよう不透明にすることはできません。","選択範囲と同じコンテンツの境界線の色。","現在の検索一致項目の色。","その他の検索条件に一致する項目の色。この色は、基本装飾が非表示にならないよう不透明にすることはできません。","検索を制限する範囲の色。この色は、基本装飾が非表示にならないよう不透明にすることはできません。","現在の検索一致項目の境界線の色。","他の検索一致項目の境界線の色。","検索を制限する範囲の境界線色。この色は、基本装飾が非表示にならないよう不透明にすることはできません。","ホバーが表示されている語の下を強調表示します。この色は、基本装飾が非表示にならないよう不透明にすることはできません。","エディター ホバーの背景色。","エディター ホバーの前景色。","エディター ホバーの境界線の色。","エディターのホバーのステータス バーの背景色。","アクティブなリンクの色。","電球アクション アイコンに使用する色。","自動修正の電球アクション アイコンとして使用される色。","挿入されたテキストの背景色。この色は、基本装飾が非表示にならないよう不透明にすることはできません。","削除したテキストの背景色。この色は、基本装飾が非表示にならないよう不透明にすることはできません。","挿入されたテキストの輪郭の色。","削除されたテキストの輪郭の色。","2 つのテキスト エディターの間の境界線の色。","差分エディターの対角線の塗りつぶし色。対角線の塗りつぶしは、横に並べて比較するビューで使用されます。","ツリーリストがアクティブのとき、フォーカスされた項目のツリーリスト背景色。アクティブなツリーリストはキーボード フォーカスがあり、非アクティブではこれがありません。","ツリーリストがアクティブのとき、フォーカスされた項目のツリーリスト前景色。アクティブなツリーリストはキーボード フォーカスがあり、非アクティブではこれがありません。","ツリーリストが非アクティブのとき、選択された項目のツリーリスト背景色。アクティブなツリーリストはキーボード フォーカスがあり、非アクティブではこれがありません。","ツリーリストがアクティブのとき、選択された項目のツリーリスト前景色。アクティブなツリーリストはキーボード フォーカスがあり、非アクティブではこれがありません。","ツリーリストが非アクティブのとき、選択された項目のツリーリスト背景色。アクティブなツリーリストはキーボード フォーカスがあり、非アクティブではこれがありません。","ツリーリストが非アクティブのとき、選択された項目のツリーリスト前景色。アクティブなツリーリストはキーボード フォーカスがあり、非アクティブではこれがありません。","ツリーリストが非アクティブのとき、フォーカスされた項目のツリーリスト背景色。アクティブなツリーリストはキーボード フォーカスがあり、非アクティブではこれがありません。","マウス操作で項目をホバーするときのツリーリスト背景。","マウス操作で項目をホバーするときのツリーリスト前景。","マウス操作で項目を移動するときのツリーリスト ドラッグ アンド ドロップの背景。","ツリーリスト内を検索しているとき、一致した強調のツリーリスト前景色。","リストおよびツリーの型フィルター ウェジェットの背景色。","リストおよびツリーの型フィルター ウィジェットのアウトライン色。","一致項目がない場合の、リストおよびツリーの型フィルター ウィジェットのアウトライン色。","インデント ガイドのツリー ストロークの色。","メニューの境界線色。","メニュー項目の前景色。","メニュー項目の背景色。","メニューで選択されたメニュー項目の前景色。","メニューで選択されたメニュー項目の背景色。","メニューで選択されたメニュー項目の境界線色。","メニュー内のメニュー項目の境界線色。","スニペット tabstop の背景色を強調表示します。","スニペット tabstop の境界線の色を強調表示します。","スニペットの最後の tabstop の背景色を強調表示します。","スニペットの最後のタブストップで境界線の色を強調表示します。","検出された一致項目の概要ルーラー マーカーの色。この色は、基本装飾が非表示にならないよう不透明にすることはできません。","選択範囲を強調表示するための概要ルーラー マーカーの色。この色は、基本装飾が非表示にならないよう不透明にすることはできません。","一致を検索するためのミニマップ マーカーの色。","エディターの選択範囲のミニマップ マーカーの色。","エラーのミニマップ マーカーの色。","警告のミニマップ マーカーの色。","ミニマップの背景色。","ミニマップ スライダーの背景色。","ホバーリング時のミニマップ スライダーの背景色。","クリックしたときのミニマップ スライダーの背景色。","問題のエラー アイコンに使用される色。","問題の警告アイコンに使用される色。","問題情報アイコンに使用される色。"], +"vs/platform/undoRedo/common/undoRedoService":["次のファイルが閉じられ、ディスク上で変更されました: {0}。","以下のファイルは互換性のない方法で変更されました: {0}。","すべてのファイルで '{0}' を元に戻せませんでした。{1}","すべてのファイルで '{0}' を元に戻せませんでした。{1}","{1} に変更が加えられたため、すべてのファイルで '{0}' を元に戻せませんでした","{1} で元に戻すまたはやり直し操作が既に実行されているため、すべてのファイルに対して '{0}' を元に戻すことはできませんでした","元に戻すまたはやり直し操作がその期間に実行中であったため、すべてのファイルに対して '{0}' を元に戻すことはできませんでした","すべてのファイルで '{0}' を元に戻しますか?","{0} 個のファイルで元に戻す","このファイルを元に戻す","キャンセル","元に戻すまたはやり直し操作が既に実行されているため、'{0}' を元に戻すことはできませんでした。","すべてのファイルで '{0}' をやり直しできませんでした。{1}","すべてのファイルで '{0}' をやり直しできませんでした。{1}","{1} に変更が加えられたため、すべてのファイルで '{0}' を再実行できませんでした","{1} で元に戻すまたはやり直し操作が既に実行されているため、すべてのファイルに対して '{0}' をやり直すことはできませんでした","元に戻すまたはやり直し操作がその期間に実行中であったため、すべてのファイルに対して '{0}' をやり直すことはできませんでした","元に戻すまたはやり直し操作が既に実行されているため、'{0}' をやり直すことはできませんでした。"]}); +//# sourceMappingURL=../../../min-maps/vs/editor/editor.main.nls.ja.js.map \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/editor/editor.main.nls.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/editor/editor.main.nls.js new file mode 100644 index 0000000..54e795f --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/editor/editor.main.nls.js @@ -0,0 +1,39 @@ +/*!----------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Version: 0.21.2(67b5a8116f3c0bace36b180e524e05bb750a16d8) + * Released under the MIT license + * https://github.com/Microsoft/vscode/blob/master/LICENSE.txt + *-----------------------------------------------------------*/ +define("vs/editor/editor.main.nls",{"vs/base/browser/ui/actionbar/actionViewItems":["{0} ({1})"],"vs/base/browser/ui/findinput/findInput":["input"],"vs/base/browser/ui/findinput/findInputCheckboxes":["Match Case","Match Whole Word","Use Regular Expression"],"vs/base/browser/ui/findinput/replaceInput":["input","Preserve Case"],"vs/base/browser/ui/inputbox/inputBox":["Error: {0}","Warning: {0}","Info: {0}"],"vs/base/browser/ui/keybindingLabel/keybindingLabel":["Unbound"],"vs/base/browser/ui/menu/menu":["{0} ({1})"],"vs/base/browser/ui/tree/abstractTree":["Clear","Disable Filter on Type","Enable Filter on Type","No elements found","Matched {0} out of {1} elements"],"vs/base/common/errorMessage":["{0}: {1}","A system error occurred ({0})","An unknown error occurred. Please consult the log for more details.","An unknown error occurred. Please consult the log for more details.","{0} ({1} errors in total)","An unknown error occurred. Please consult the log for more details."], +"vs/base/common/keybindingLabels":["Ctrl","Shift","Alt","Windows","Ctrl","Shift","Alt","Super","Control","Shift","Alt","Command","Control","Shift","Alt","Windows","Control","Shift","Alt","Super"],"vs/base/parts/quickinput/browser/quickInput":["Back","{0}/{1}","Type to narrow down results.","{0} Results","{0} Selected","OK","Custom","Back ({0})","Back"],"vs/base/parts/quickinput/browser/quickInputList":["Quick Input"],"vs/editor/browser/controller/coreCommands":["Stick to the end even when going to longer lines","Stick to the end even when going to longer lines"],"vs/editor/browser/controller/textAreaHandler":["editor","The editor is not accessible at this time. Press {0} for options."],"vs/editor/browser/editorExtensions":["&&Undo","Undo","&&Redo","Redo","&&Select All","Select All"],"vs/editor/browser/widget/codeEditorWidget":["The number of cursors has been limited to {0}."],"vs/editor/browser/widget/diffEditorWidget":["Cannot compare files because one file is too large."], +"vs/editor/browser/widget/diffReview":["Close","no lines changed","1 line changed","{0} lines changed","Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}","blank","{0} unchanged line {1}","{0} original line {1} modified line {2}","+ {0} modified line {1}","- {0} original line {1}","Go to Next Difference","Go to Previous Difference"],"vs/editor/browser/widget/inlineDiffMargin":["Copy deleted lines","Copy deleted line","Copy deleted line ({0})","Revert this change","Copy deleted line ({0})"], +"vs/editor/common/config/commonEditorConfig":["Editor","The number of spaces a tab is equal to. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.","Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.","Controls whether `#editor.tabSize#` and `#editor.insertSpaces#` will be automatically detected when a file is opened based on the file contents.","Remove trailing auto inserted whitespace.","Special handling for large files to disable certain memory intensive features.","Controls whether completions should be computed based on words in the document.","Semantic highlighting enabled for all color themes.","Semantic highlighting disabled for all color themes.","Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.","Controls whether the semanticHighlighting is shown for the languages that support it.","Keep peek editors open even when double clicking their content or when hitting `Escape`.","Lines above this length will not be tokenized for performance reasons","Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.","Controls whether the diff editor shows the diff side by side or inline.","When enabled, the diff editor ignores changes in leading or trailing whitespace.","Controls whether the diff editor shows +/- indicators for added/removed changes.","Controls whether the editor shows CodeLens."], +"vs/editor/common/config/editorOptions":["The editor will use platform APIs to detect when a Screen Reader is attached.","The editor will be permanently optimized for usage with a Screen Reader.","The editor will never be optimized for usage with a Screen Reader.","Controls whether the editor should run in a mode where it is optimized for screen readers.","Controls whether a space character is inserted when commenting.","Controls if empty lines should be ignored with toggle, add or remove actions for line comments.","Controls whether copying without a selection copies the current line.","Controls whether the cursor should jump to find matches while typing.","Controls whether the search string in the Find Widget is seeded from the editor selection.","Never turn on Find in selection automatically (default)","Always turn on Find in selection automatically","Turn on Find in selection automatically when multiple lines of content are selected.","Controls the condition for turning on find in selection automatically.","Controls whether the Find Widget should read or modify the shared find clipboard on macOS.","Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.","Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.","Enables/Disables font ligatures.","Explicit font-feature-settings.","Configures font ligatures or font features.","Controls the font size in pixels.",'Only "normal" and "bold" keywords or numbers between 1 and 1000 are allowed.','Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.',"Show peek view of the results (default)","Go to the primary result and show a peek view","Go to the primary result and enable peek-less navigation to others","This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.","Controls the behavior the 'Go to Definition'-command when multiple target locations exist.","Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist.","Controls the behavior the 'Go to Declaration'-command when multiple target locations exist.","Controls the behavior the 'Go to Implementations'-command when multiple target locations exist.","Controls the behavior the 'Go to References'-command when multiple target locations exist.","Alternative command id that is being executed when the result of 'Go to Definition' is the current location.","Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.","Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.","Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.","Alternative command id that is being executed when the result of 'Go to Reference' is the current location.","Controls whether the hover is shown.","Controls the delay in milliseconds after which the hover is shown.","Controls whether the hover should remain visible when mouse is moved over it.","Enables the code action lightbulb in the editor.","Controls the line height. Use 0 to compute the line height from the font size.","Controls whether the minimap is shown.","The minimap has the same size as the editor contents (and might scroll).","The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling).","The minimap will shrink as necessary to never be larger than the editor (no scrolling).","Controls the size of the minimap.","Controls the side where to render the minimap.","Controls when the minimap slider is shown.","Scale of content drawn in the minimap: 1, 2 or 3.","Render the actual characters on a line as opposed to color blocks.","Limit the width of the minimap to render at most a certain number of columns.","Controls the amount of space between the top edge of the editor and the first line.","Controls the amount of space between the bottom edge of the editor and the last line.","Enables a pop-up that shows parameter documentation and type information as you type.","Controls whether the parameter hints menu cycles or closes when reaching the end of the list.","Enable quick suggestions inside strings.","Enable quick suggestions inside comments.","Enable quick suggestions outside of strings and comments.","Controls whether suggestions should automatically show up while typing.","Line numbers are not rendered.","Line numbers are rendered as absolute number.","Line numbers are rendered as distance in lines to cursor position.","Line numbers are rendered every 10 lines.","Controls the display of line numbers.","Number of monospace characters at which this editor ruler will render.","Color of this editor ruler.","Render vertical rulers after a certain number of monospace characters. Use multiple values for multiple rulers. No rulers are drawn if array is empty.","Insert suggestion without overwriting text right of the cursor.","Insert suggestion and overwrite text right of the cursor.","Controls whether words are overwritten when accepting completions. Note that this depends on extensions opting into this feature.","Controls whether filtering and sorting suggestions accounts for small typos.","Controls whether sorting favours words that appear close to the cursor.","Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).","Controls whether an active snippet prevents quick suggestions.","Controls whether to show or hide icons in suggestions.","Controls how many suggestions IntelliSense will show before showing a scrollbar (maximum 15).","This setting is deprecated, please use separate settings like 'editor.suggest.showKeywords' or 'editor.suggest.showSnippets' instead.","When enabled IntelliSense shows `method`-suggestions.","When enabled IntelliSense shows `function`-suggestions.","When enabled IntelliSense shows `constructor`-suggestions.","When enabled IntelliSense shows `field`-suggestions.","When enabled IntelliSense shows `variable`-suggestions.","When enabled IntelliSense shows `class`-suggestions.","When enabled IntelliSense shows `struct`-suggestions.","When enabled IntelliSense shows `interface`-suggestions.","When enabled IntelliSense shows `module`-suggestions.","When enabled IntelliSense shows `property`-suggestions.","When enabled IntelliSense shows `event`-suggestions.","When enabled IntelliSense shows `operator`-suggestions.","When enabled IntelliSense shows `unit`-suggestions.","When enabled IntelliSense shows `value`-suggestions.","When enabled IntelliSense shows `constant`-suggestions.","When enabled IntelliSense shows `enum`-suggestions.","When enabled IntelliSense shows `enumMember`-suggestions.","When enabled IntelliSense shows `keyword`-suggestions.","When enabled IntelliSense shows `text`-suggestions.","When enabled IntelliSense shows `color`-suggestions.","When enabled IntelliSense shows `file`-suggestions.","When enabled IntelliSense shows `reference`-suggestions.","When enabled IntelliSense shows `customcolor`-suggestions.","When enabled IntelliSense shows `folder`-suggestions.","When enabled IntelliSense shows `typeParameter`-suggestions.","When enabled IntelliSense shows `snippet`-suggestions.","When enabled IntelliSense shows `user`-suggestions.","When enabled IntelliSense shows `issues`-suggestions.","Controls the visibility of the status bar at the bottom of the suggest widget.","Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.","Only accept a suggestion with `Enter` when it makes a textual change.","Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.","Controls the number of lines in the editor that can be read out by a screen reader. Warning: this has a performance implication for numbers larger than the default.","Editor content","Use language configurations to determine when to autoclose brackets.","Autoclose brackets only when the cursor is to the left of whitespace.","Controls whether the editor should automatically close brackets after the user adds an opening bracket.","Type over closing quotes or brackets only if they were automatically inserted.","Controls whether the editor should type over closing quotes or brackets.","Use language configurations to determine when to autoclose quotes.","Autoclose quotes only when the cursor is to the left of whitespace.","Controls whether the editor should automatically close quotes after the user adds an opening quote.","The editor will not insert indentation automatically.","The editor will keep the current line's indentation.","The editor will keep the current line's indentation and honor language defined brackets.","The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages.","The editor will keep the current line's indentation, honor language defined brackets, invoke special onEnterRules defined by languages, and honor indentationRules defined by languages.","Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.","Use language configurations to determine when to automatically surround selections.","Surround with quotes but not brackets.","Surround with brackets but not quotes.","Controls whether the editor should automatically surround selections.","Controls whether the editor shows CodeLens.","Controls whether the editor should render the inline color decorators and color picker.","Enable that the selection with the mouse and keys is doing column selection.","Controls whether syntax highlighting should be copied into the clipboard.","Control the cursor animation style.","Controls whether the smooth caret animation should be enabled.","Controls the cursor style.","Controls the minimal number of visible leading and trailing lines surrounding the cursor. Known as 'scrollOff' or `scrollOffset` in some other editors.","`cursorSurroundingLines` is enforced only when triggered via the keyboard or API.","`cursorSurroundingLines` is enforced always.","Controls when `cursorSurroundingLines` should be enforced.","Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.","Controls whether the editor should allow moving selections via drag and drop.","Scrolling speed multiplier when pressing `Alt`.","Controls whether the editor has code folding enabled.","Use a language-specific folding strategy if available, else the indentation-based one.","Use the indentation-based folding strategy.","Controls the strategy for computing folding ranges.","Controls whether the editor should highlight folded ranges.","Controls whether clicking on the empty content after a folded line will unfold the line.","Controls the font family.","Controls whether the editor should automatically format the pasted content. A formatter must be available and the formatter should be able to format a range in a document.","Controls whether the editor should automatically format the line after typing.","Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.","Controls whether the cursor should be hidden in the overview ruler.","Controls whether the editor should highlight the active indent guide.","Controls the letter spacing in pixels.","Controls whether the editor should detect links and make them clickable.","Highlight matching brackets.","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.","Zoom the font of the editor when using mouse wheel and holding `Ctrl`.","Merge multiple cursors when they are overlapping.","Maps to `Control` on Windows and Linux and to `Command` on macOS.","Maps to `Alt` on Windows and Linux and to `Option` on macOS.","The modifier to be used to add multiple cursors with the mouse. The Go To Definition and Open Link mouse gestures will adapt such that they do not conflict with the multicursor modifier. [Read more](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).","Each cursor pastes a single line of the text.","Each cursor pastes the full text.","Controls pasting when the line count of the pasted text matches the cursor count.","Controls whether the editor should highlight semantic symbol occurrences.","Controls whether a border should be drawn around the overview ruler.","Focus the tree when opening peek","Focus the editor when opening peek","Controls whether to focus the inline editor or the tree in the peek widget.","Controls whether the Go to Definition mouse gesture always opens the peek widget.","Controls the delay in milliseconds after which quick suggestions will show up.","Controls whether the editor auto renames on type.","Controls whether the editor should render control characters.","Controls whether the editor should render indent guides.","Render last line number when the file ends with a newline.","Highlights both the gutter and the current line.","Controls how the editor should render the current line highlight.","Controls if the editor should render the current line highlight only when the editor is focused","Render whitespace characters except for single spaces between words.","Render whitespace characters only on selected text.","Render only trailing whitespace characters","Controls how the editor should render whitespace characters.","Controls whether selections should have rounded corners.","Controls the number of extra characters beyond which the editor will scroll horizontally.","Controls whether the editor will scroll beyond the last line.","Scroll only along the predominant axis when scrolling both vertically and horizontally at the same time. Prevents horizontal drift when scrolling vertically on a trackpad.","Controls whether the Linux primary clipboard should be supported.","Controls whether the editor should highlight matches similar to the selection.","Always show the folding controls.","Only show the folding controls when the mouse is over the gutter.","Controls when the folding controls on the gutter are shown.","Controls fading out of unused code.","Controls strikethrough deprecated variables.","Show snippet suggestions on top of other suggestions.","Show snippet suggestions below other suggestions.","Show snippets suggestions with other suggestions.","Do not show snippet suggestions.","Controls whether snippets are shown with other suggestions and how they are sorted.","Controls whether the editor will scroll using an animation.","Font size for the suggest widget. When set to `0`, the value of `#editor.fontSize#` is used.","Line height for the suggest widget. When set to `0`, the value of `#editor.lineHeight#` is used.","Controls whether suggestions should automatically show up when typing trigger characters.","Always select the first suggestion.","Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently.","Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.","Controls how suggestions are pre-selected when showing the suggest list.","Tab complete will insert the best matching suggestion when pressing tab.","Disable tab completions.","Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.","Enables tab completions.","Unusual line terminators are ignored.","Unusual line terminators prompt to be removed.","Unusual line terminators are automatically removed.","Remove unusual line terminators that might cause problems.","Inserting and deleting whitespace follows tab stops.","Characters that will be used as word separators when doing word related navigations or operations.","Lines will never wrap.","Lines will wrap at the viewport width.","Lines will wrap at `#editor.wordWrapColumn#`.","Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.","Controls how lines should wrap.","Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.","No indentation. Wrapped lines begin at column 1.","Wrapped lines get the same indentation as the parent.","Wrapped lines get +1 indentation toward the parent.","Wrapped lines get +2 indentation toward the parent.","Controls the indentation of wrapped lines.","Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width.","Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.","Controls the algorithm that computes wrapping points."], +"vs/editor/common/model/editStack":["Typing"],"vs/editor/common/modes/modesRegistry":["Plain Text"], +"vs/editor/common/standaloneStrings":["No selection","Line {0}, Column {1} ({2} selected)","Line {0}, Column {1}","{0} selections ({1} characters selected)","{0} selections","Now changing the setting `accessibilitySupport` to 'on'.","Now opening the Editor Accessibility documentation page."," in a read-only pane of a diff editor."," in a pane of a diff editor."," in a read-only code editor"," in a code editor","To configure the editor to be optimized for usage with a Screen Reader press Command+E now.","To configure the editor to be optimized for usage with a Screen Reader press Control+E now.","The editor is configured to be optimized for usage with a Screen Reader.","The editor is configured to never be optimized for usage with a Screen Reader, which is not the case at this time.","Pressing Tab in the current editor will move focus to the next focusable element. Toggle this behavior by pressing {0}.","Pressing Tab in the current editor will move focus to the next focusable element. The command {0} is currently not triggerable by a keybinding.","Pressing Tab in the current editor will insert the tab character. Toggle this behavior by pressing {0}.","Pressing Tab in the current editor will insert the tab character. The command {0} is currently not triggerable by a keybinding.","Press Command+H now to open a browser window with more information related to editor accessibility.","Press Control+H now to open a browser window with more information related to editor accessibility.","You can dismiss this tooltip and return to the editor by pressing Escape or Shift+Escape.","Show Accessibility Help","Developer: Inspect Tokens","Go to Line/Column...","Show all Quick Access Providers","Command Palette","Show And Run Commands","Go to Symbol...","Go to Symbol by Category...","Editor content","Press Alt+F1 for Accessibility Options.","Toggle High Contrast Theme","Made {0} edits in {1} files"], +"vs/editor/common/view/editorColorRegistry":["Background color for the highlight of line at the cursor position.","Background color for the border around the line at the cursor position.","Background color of highlighted ranges, like by quick open and find features. The color must not be opaque so as not to hide underlying decorations.","Background color of the border around highlighted ranges.","Background color of highlighted symbol, like for go to definition or go next/previous symbol. The color must not be opaque so as not to hide underlying decorations.","Background color of the border around highlighted symbols.","Color of the editor cursor.","The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.","Color of whitespace characters in the editor.","Color of the editor indentation guides.","Color of the active editor indentation guides.","Color of editor line numbers.","Color of editor active line number","Id is deprecated. Use 'editorLineNumber.activeForeground' instead.","Color of editor active line number","Color of the editor rulers.","Foreground color of editor CodeLens","Background color behind matching brackets","Color for matching brackets boxes","Color of the overview ruler border.","Background color of the editor overview ruler. Only used when the minimap is enabled and placed on the right side of the editor.","Background color of the editor gutter. The gutter contains the glyph margins and the line numbers.","Border color of unnecessary (unused) source code in the editor.","Opacity of unnecessary (unused) source code in the editor. For example, \"#000000c0\" will render the code with 75% opacity. For high contrast themes, use the 'editorUnnecessaryCode.border' theme color to underline unnecessary code instead of fading it out.","Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations.","Overview ruler marker color for errors.","Overview ruler marker color for warnings.","Overview ruler marker color for infos."], +"vs/editor/contrib/anchorSelect/anchorSelect":["Selection Anchor","Anchor set at {0}:{1}","Set Selection Anchor","Go to Selection Anchor","Select from Anchor to Cursor","Cancel Selection Anchor"],"vs/editor/contrib/bracketMatching/bracketMatching":["Overview ruler marker color for matching brackets.","Go to Bracket","Select to Bracket","Go to &&Bracket"],"vs/editor/contrib/caretOperations/caretOperations":["Move Selected Text Left","Move Selected Text Right"],"vs/editor/contrib/caretOperations/transpose":["Transpose Letters"],"vs/editor/contrib/clipboard/clipboard":["Cu&&t","Cut","Cut","&&Copy","Copy","Copy","&&Paste","Paste","Paste","Copy With Syntax Highlighting"], +"vs/editor/contrib/codeAction/codeActionCommands":["Kind of the code action to run.","Controls when the returned actions are applied.","Always apply the first returned code action.","Apply the first returned code action if it is the only one.","Do not apply the returned code actions.","Controls if only preferred code actions should be returned.","An unknown error occurred while applying the code action","Quick Fix...","No code actions available","No preferred code actions for '{0}' available","No code actions for '{0}' available","No preferred code actions available","No code actions available","Refactor...","No preferred refactorings for '{0}' available","No refactorings for '{0}' available","No preferred refactorings available","No refactorings available","Source Action...","No preferred source actions for '{0}' available","No source actions for '{0}' available","No preferred source actions available","No source actions available","Organize Imports","No organize imports action available","Fix All","No fix all action available","Auto Fix...","No auto fixes available"], +"vs/editor/contrib/codeAction/lightBulbWidget":["Show Fixes. Preferred Fix Available ({0})","Show Fixes ({0})","Show Fixes"],"vs/editor/contrib/codelens/codelensController":["Show CodeLens Commands For Current Line"],"vs/editor/contrib/comment/comment":["Toggle Line Comment","&&Toggle Line Comment","Add Line Comment","Remove Line Comment","Toggle Block Comment","Toggle &&Block Comment"],"vs/editor/contrib/contextmenu/contextmenu":["Show Editor Context Menu"],"vs/editor/contrib/cursorUndo/cursorUndo":["Cursor Undo","Cursor Redo"], +"vs/editor/contrib/documentSymbols/outlineTree":["The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget.","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget.","The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget.","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget.","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget.","The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget.","The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.","The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget.","The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget.","The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget.","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget.","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget.","The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget.","The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget.","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget.","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget.","The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget.","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget.","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget.","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget.","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget.","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget.","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget.","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget.","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget.","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget.","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget.","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget.","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget.","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget.","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget.","The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."], +"vs/editor/contrib/find/findController":["Find","&&Find","Find With Selection","Find Next","Find Next","Find Previous","Find Previous","Find Next Selection","Find Previous Selection","Replace","&&Replace"],"vs/editor/contrib/find/findWidget":["Find","Find","Previous match","Next match","Find in selection","Close","Replace","Replace","Replace","Replace All","Toggle Replace mode","Only the first {0} results are highlighted, but all find operations work on the entire text.","{0} of {1}","No results","{0} found","{0} found for '{1}'","{0} found for '{1}', at {2}","{0} found for '{1}'","Ctrl+Enter now inserts line break instead of replacing all. You can modify the keybinding for editor.action.replaceAll to override this behavior."], +"vs/editor/contrib/folding/folding":["Unfold","Unfold Recursively","Fold","Toggle Fold","Fold Recursively","Fold All Block Comments","Fold All Regions","Unfold All Regions","Fold All","Unfold All","Fold Level {0}","Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations.","Color of the folding control in the editor gutter."],"vs/editor/contrib/fontZoom/fontZoom":["Editor Font Zoom In","Editor Font Zoom Out","Editor Font Zoom Reset"],"vs/editor/contrib/format/format":["Made 1 formatting edit on line {0}","Made {0} formatting edits on line {1}","Made 1 formatting edit between lines {0} and {1}","Made {0} formatting edits between lines {1} and {2}"],"vs/editor/contrib/format/formatActions":["Format Document","Format Selection"], +"vs/editor/contrib/gotoError/gotoError":["Go to Next Problem (Error, Warning, Info)","Go to Previous Problem (Error, Warning, Info)","Go to Next Problem in Files (Error, Warning, Info)","Next &&Problem","Go to Previous Problem in Files (Error, Warning, Info)","Previous &&Problem"],"vs/editor/contrib/gotoError/gotoErrorWidget":["Error","Warning","Info","Hint","{0} at {1}. ","{0} of {1} problems","{0} of {1} problem","Editor marker navigation widget error color.","Editor marker navigation widget warning color.","Editor marker navigation widget info color.","Editor marker navigation widget background."], +"vs/editor/contrib/gotoSymbol/goToCommands":["Peek","Definitions","No definition found for '{0}'","No definition found","Go to Definition","Go to &&Definition","Open Definition to the Side","Peek Definition","Declarations","No declaration found for '{0}'","No declaration found","Go to Declaration","Go to &&Declaration","No declaration found for '{0}'","No declaration found","Peek Declaration","Type Definitions","No type definition found for '{0}'","No type definition found","Go to Type Definition","Go to &&Type Definition","Peek Type Definition","Implementations","No implementation found for '{0}'","No implementation found","Go to Implementations","Go to &&Implementations","Peek Implementations","No references found for '{0}'","No references found","Go to References","Go to &&References","References","Peek References","References","Go To Any Symbol","Locations","No results for '{0}'","References"],"vs/editor/contrib/gotoSymbol/link/goToDefinitionAtPosition":["Click to show {0} definitions."], +"vs/editor/contrib/gotoSymbol/peek/referencesController":["Loading...","{0} ({1})"],"vs/editor/contrib/gotoSymbol/peek/referencesTree":["{0} references","{0} reference","References"],"vs/editor/contrib/gotoSymbol/peek/referencesWidget":["no preview available","No results","References"],"vs/editor/contrib/gotoSymbol/referencesModel":["symbol in {0} on line {1} at column {2}","1 symbol in {0}, full path {1}","{0} symbols in {1}, full path {2}","No results found","Found 1 symbol in {0}","Found {0} symbols in {1}","Found {0} symbols in {1} files"],"vs/editor/contrib/gotoSymbol/symbolNavigation":["Symbol {0} of {1}, {2} for next","Symbol {0} of {1}"],"vs/editor/contrib/hover/hover":["Show Hover","Show Definition Preview Hover"],"vs/editor/contrib/hover/modesContentHover":["Loading...","Peek Problem","Checking for quick fixes...","No quick fixes available","Quick Fix..."],"vs/editor/contrib/inPlaceReplace/inPlaceReplace":["Replace with Previous Value","Replace with Next Value"], +"vs/editor/contrib/indentation/indentation":["Convert Indentation to Spaces","Convert Indentation to Tabs","Configured Tab Size","Select Tab Size for Current File","Indent Using Tabs","Indent Using Spaces","Detect Indentation from Content","Reindent Lines","Reindent Selected Lines"],"vs/editor/contrib/linesOperations/linesOperations":["Copy Line Up","&&Copy Line Up","Copy Line Down","Co&&py Line Down","Duplicate Selection","&&Duplicate Selection","Move Line Up","Mo&&ve Line Up","Move Line Down","Move &&Line Down","Sort Lines Ascending","Sort Lines Descending","Trim Trailing Whitespace","Delete Line","Indent Line","Outdent Line","Insert Line Above","Insert Line Below","Delete All Left","Delete All Right","Join Lines","Transpose characters around the cursor","Transform to Uppercase","Transform to Lowercase","Transform to Title Case"], +"vs/editor/contrib/links/links":["Execute command","Follow link","cmd + click","ctrl + click","option + click","alt + click","Failed to open this link because it is not well-formed: {0}","Failed to open this link because its target is missing.","Open Link"],"vs/editor/contrib/message/messageController":["Cannot edit in read-only editor"],"vs/editor/contrib/multicursor/multicursor":["Add Cursor Above","&&Add Cursor Above","Add Cursor Below","A&&dd Cursor Below","Add Cursors to Line Ends","Add C&&ursors to Line Ends","Add Cursors To Bottom","Add Cursors To Top","Add Selection To Next Find Match","Add &&Next Occurrence","Add Selection To Previous Find Match","Add P&&revious Occurrence","Move Last Selection To Next Find Match","Move Last Selection To Previous Find Match","Select All Occurrences of Find Match","Select All &&Occurrences","Change All Occurrences"],"vs/editor/contrib/parameterHints/parameterHints":["Trigger Parameter Hints"],"vs/editor/contrib/parameterHints/parameterHintsWidget":["{0}, hint"], +"vs/editor/contrib/peekView/peekView":["Close","Background color of the peek view title area.","Color of the peek view title.","Color of the peek view title info.","Color of the peek view borders and arrow.","Background color of the peek view result list.","Foreground color for line nodes in the peek view result list.","Foreground color for file nodes in the peek view result list.","Background color of the selected entry in the peek view result list.","Foreground color of the selected entry in the peek view result list.","Background color of the peek view editor.","Background color of the gutter in the peek view editor.","Match highlight color in the peek view result list.","Match highlight color in the peek view editor.","Match highlight border in the peek view editor."], +"vs/editor/contrib/quickAccess/gotoLineQuickAccess":["Open a text editor first to go to a line.","Go to line {0} and column {1}.","Go to line {0}.","Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.","Current Line: {0}, Character: {1}. Type a line number to navigate to."], +"vs/editor/contrib/quickAccess/gotoSymbolQuickAccess":["To go to a symbol, first open a text editor with symbol information.","The active text editor does not provide symbol information.","No matching editor symbols","No editor symbols","Open to the Side","Open to the Bottom","symbols ({0})","properties ({0})","methods ({0})","functions ({0})","constructors ({0})","variables ({0})","classes ({0})","structs ({0})","events ({0})","operators ({0})","interfaces ({0})","namespaces ({0})","packages ({0})","type parameters ({0})","modules ({0})","properties ({0})","enumerations ({0})","enumeration members ({0})","strings ({0})","files ({0})","arrays ({0})","numbers ({0})","booleans ({0})","objects ({0})","keys ({0})","fields ({0})","constants ({0})"],"vs/editor/contrib/rename/onTypeRename":["On Type Rename Symbol","Background color when the editor auto renames on type."], +"vs/editor/contrib/rename/rename":["No result.","An unknown error occurred while resolving rename location","Renaming '{0}'","Renaming {0}","Successfully renamed '{0}' to '{1}'. Summary: {2}","Rename failed to apply edits","Rename failed to compute edits","Rename Symbol","Enable/disable the ability to preview changes before renaming"],"vs/editor/contrib/rename/renameInputField":["Rename input. Type new name and press Enter to commit.","{0} to Rename, {1} to Preview"],"vs/editor/contrib/smartSelect/smartSelect":["Expand Selection","&&Expand Selection","Shrink Selection","&&Shrink Selection"],"vs/editor/contrib/snippet/snippetVariables":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sun","Mon","Tue","Wed","Thu","Fri","Sat","January","February","March","April","May","June","July","August","September","October","November","December","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"], +"vs/editor/contrib/suggest/suggestController":["Accepting '{0}' made {1} additional edits","Trigger Suggest","{0} to insert","{0} to insert","{0} to replace","{0} to replace","{0} to insert","show less","show more"],"vs/editor/contrib/suggest/suggestWidget":["Background color of the suggest widget.","Border color of the suggest widget.","Foreground color of the suggest widget.","Background color of the selected entry in the suggest widget.","Color of the match highlights in the suggest widget.","Read More ({0})","Read Less ({0})","Loading...","Loading...","No suggestions.","{0}, docs: {1}","Suggest"],"vs/editor/contrib/toggleTabFocusMode/toggleTabFocusMode":["Toggle Tab Key Moves Focus","Pressing Tab will now move focus to the next focusable element","Pressing Tab will now insert the tab character"],"vs/editor/contrib/tokenization/tokenization":["Developer: Force Retokenize"], +"vs/editor/contrib/unusualLineTerminators/unusualLineTerminators":["Unusual Line Terminators","Detected unusual line terminators","This file contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).\n\nIt is recommended to remove them from the file. This can be configured via `editor.unusualLineTerminators`.","Fix this file","Ignore problem for this file"], +"vs/editor/contrib/wordHighlighter/wordHighlighter":["Background color of a symbol during read-access, like reading a variable. The color must not be opaque so as not to hide underlying decorations.","Background color of a symbol during write-access, like writing to a variable. The color must not be opaque so as not to hide underlying decorations.","Border color of a symbol during read-access, like reading a variable.","Border color of a symbol during write-access, like writing to a variable.","Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations.","Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations.","Go to Next Symbol Highlight","Go to Previous Symbol Highlight","Trigger Symbol Highlight"],"vs/platform/actions/browser/menuEntryActionViewItem":["{0} ({1})"], +"vs/platform/configuration/common/configurationRegistry":["Default Language Configuration Overrides","Configure editor settings to be overridden for a language.","This setting does not support per-language configuration.","Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.","Cannot register '{0}'. This property is already registered."],"vs/platform/keybinding/common/abstractKeybindingService":["({0}) was pressed. Waiting for second key of chord...","The key combination ({0}, {1}) is not a command."], +"vs/platform/list/browser/listService":["Workbench","Maps to `Control` on Windows and Linux and to `Command` on macOS.","Maps to `Alt` on Windows and Linux and to `Option` on macOS.","The modifier to be used to add an item in trees and lists to a multi-selection with the mouse (for example in the explorer, open editors and scm view). The 'Open to Side' mouse gestures - if supported - will adapt such that they do not conflict with the multiselect modifier.","Controls how to open items in trees and lists using the mouse (if supported). For parents with children in trees, this setting will control if a single click expands the parent or a double click. Note that some trees and lists might choose to ignore this setting if it is not applicable. ","Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.","Controls tree indentation in pixels.","Controls whether the tree should render indent guides.","Controls whether lists and trees have smooth scrolling.","Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes.","Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements.","Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.","Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter.","Controls whether keyboard navigation in lists and trees is automatically triggered simply by typing. If set to `false`, keyboard navigation is only triggered when executing the `list.toggleKeyboardNavigation` command, for which you can assign a keyboard shortcut."], +"vs/platform/markers/common/markers":["Error","Warning","Info"],"vs/platform/quickinput/browser/commandsQuickAccess":["{0}, {1}","recently used","other commands","Command '{0}' resulted in an error ({1})"],"vs/platform/quickinput/browser/helpQuickAccess":["global commands","editor commands","{0}, {1}"], +"vs/platform/theme/common/colorRegistry":["Overall foreground color. This color is only used if not overridden by a component.","Overall foreground color for error messages. This color is only used if not overridden by a component.","The default color for icons in the workbench.","Overall border color for focused elements. This color is only used if not overridden by a component.","An extra border around elements to separate them from others for greater contrast.","An extra border around active elements to separate them from others for greater contrast.","Foreground color for links in text.","Background color for code blocks in text.","Shadow color of widgets such as find/replace inside the editor.","Input box background.","Input box foreground.","Input box border.","Border color of activated options in input fields.","Background color of activated options in input fields.","Foreground color of activated options in input fields.","Input validation background color for information severity.","Input validation foreground color for information severity.","Input validation border color for information severity.","Input validation background color for warning severity.","Input validation foreground color for warning severity.","Input validation border color for warning severity.","Input validation background color for error severity.","Input validation foreground color for error severity.","Input validation border color for error severity.","Dropdown background.","Dropdown foreground.","Button foreground color.","Button background color.","Button background color when hovering.","Badge background color. Badges are small information labels, e.g. for search results count.","Badge foreground color. Badges are small information labels, e.g. for search results count.","Scrollbar shadow to indicate that the view is scrolled.","Scrollbar slider background color.","Scrollbar slider background color when hovering.","Scrollbar slider background color when clicked on.","Background color of the progress bar that can show for long running operations.","Foreground color of error squigglies in the editor.","Border color of error boxes in the editor.","Foreground color of warning squigglies in the editor.","Border color of warning boxes in the editor.","Foreground color of info squigglies in the editor.","Border color of info boxes in the editor.","Foreground color of hint squigglies in the editor.","Border color of hint boxes in the editor.","Editor background color.","Editor default foreground color.","Background color of editor widgets, such as find/replace.","Foreground color of editor widgets, such as find/replace.","Border color of editor widgets. The color is only used if the widget chooses to have a border and if the color is not overridden by a widget.","Border color of the resize bar of editor widgets. The color is only used if the widget chooses to have a resize border and if the color is not overridden by a widget.","Quick picker background color. The quick picker widget is the container for pickers like the command palette.","Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.","Quick picker title background color. The quick picker widget is the container for pickers like the command palette.","Quick picker color for grouping labels.","Quick picker color for grouping borders.","Color of the editor selection.","Color of the selected text for high contrast.","Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations.","Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations.","Border color for regions with the same content as the selection.","Color of the current search match.","Color of the other search matches. The color must not be opaque so as not to hide underlying decorations.","Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations.","Border color of the current search match.","Border color of the other search matches.","Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations.","Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations.","Background color of the editor hover.","Foreground color of the editor hover.","Border color of the editor hover.","Background color of the editor hover status bar.","Color of active links.","The color used for the lightbulb actions icon.","The color used for the lightbulb auto fix actions icon.","Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations.","Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations.","Outline color for the text that got inserted.","Outline color for text that got removed.","Border color between the two text editors.","Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views.","List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.","List/Tree foreground color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.","List/Tree background color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.","List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.","List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.","List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.","List/Tree background color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.","List/Tree background when hovering over items using the mouse.","List/Tree foreground when hovering over items using the mouse.","List/Tree drag and drop background when moving items around using the mouse.","List/Tree foreground color of the match highlights when searching inside the list/tree.","Background color of the type filter widget in lists and trees.","Outline color of the type filter widget in lists and trees.","Outline color of the type filter widget in lists and trees, when there are no matches.","Tree stroke color for the indentation guides.","Border color of menus.","Foreground color of menu items.","Background color of menu items.","Foreground color of the selected menu item in menus.","Background color of the selected menu item in menus.","Border color of the selected menu item in menus.","Color of a separator menu item in menus.","Highlight background color of a snippet tabstop.","Highlight border color of a snippet tabstop.","Highlight background color of the final tabstop of a snippet.","Highlight border color of the final tabstop of a snippet.","Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations.","Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations.","Minimap marker color for find matches.","Minimap marker color for the editor selection.","Minimap marker color for errors.","Minimap marker color for warnings.","Minimap background color.","Minimap slider background color.","Minimap slider background color when hovering.","Minimap slider background color when clicked on.","The color used for the problems error icon.","The color used for the problems warning icon.","The color used for the problems info icon."], +"vs/platform/undoRedo/common/undoRedoService":["The following files have been closed and modified on disk: {0}.","The following files have been modified in an incompatible way: {0}.","Could not undo '{0}' across all files. {1}","Could not undo '{0}' across all files. {1}","Could not undo '{0}' across all files because changes were made to {1}","Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}","Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime","Would you like to undo '{0}' across all files?","Undo in {0} Files","Undo this File","Cancel","Could not undo '{0}' because there is already an undo or redo operation running.","Could not redo '{0}' across all files. {1}","Could not redo '{0}' across all files. {1}","Could not redo '{0}' across all files because changes were made to {1}","Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}","Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime","Could not redo '{0}' because there is already an undo or redo operation running."] +}); +//# sourceMappingURL=../../../min-maps/vs/editor/editor.main.nls.js.map \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/editor/editor.main.nls.ko.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/editor/editor.main.nls.ko.js new file mode 100644 index 0000000..84c8e7f --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/editor/editor.main.nls.ko.js @@ -0,0 +1,31 @@ +/*!----------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Version: 0.21.2(67b5a8116f3c0bace36b180e524e05bb750a16d8) + * Released under the MIT license + * https://github.com/Microsoft/vscode/blob/master/LICENSE.txt + *-----------------------------------------------------------*/ +define("vs/editor/editor.main.nls.ko",{"vs/base/browser/ui/actionbar/actionViewItems":["{0}({1})"],"vs/base/browser/ui/findinput/findInput":["입력"],"vs/base/browser/ui/findinput/findInputCheckboxes":["대/소문자 구분","단어 단위로","정규식 사용"],"vs/base/browser/ui/findinput/replaceInput":["입력","대/소문자 보존"],"vs/base/browser/ui/inputbox/inputBox":["오류: {0}","경고: {0}","정보: {0}"],"vs/base/browser/ui/keybindingLabel/keybindingLabel":["바인딩 안 됨"],"vs/base/browser/ui/menu/menu":["{0}({1})"],"vs/base/browser/ui/tree/abstractTree":["지우기","형식을 기준으로 필터링 사용 안 함","형식을 기준으로 필터링 사용","찾은 요소 없음","{1}개 요소 중 {0}개 일치"],"vs/base/common/errorMessage":["{0}: {1}","시스템 오류가 발생했습니다({0}).","알 수 없는 오류가 발생했습니다. 자세한 내용은 로그를 참조하세요.","알 수 없는 오류가 발생했습니다. 자세한 내용은 로그를 참조하세요.","{0}(총 {1}개의 오류)","알 수 없는 오류가 발생했습니다. 자세한 내용은 로그를 참조하세요."],"vs/base/common/keybindingLabels":["Ctrl","","","Windows","Ctrl","","","슈퍼","제어","","","명령","제어","","","Windows","제어","","","슈퍼"], +"vs/base/parts/quickinput/browser/quickInput":["뒤로","{0} / {1}","결과의 범위를 축소하려면 입력하세요.","{0}개 결과","{0} 선택됨","확인","사용자 지정","뒤로({0})","뒤로"],"vs/base/parts/quickinput/browser/quickInputList":["빠른 입력"],"vs/editor/browser/controller/coreCommands":["더 긴 줄로 이동하는 경우에도 끝에 고정","더 긴 줄로 이동하는 경우에도 끝에 고정"],"vs/editor/browser/controller/textAreaHandler":["편집기","현재 편집기에 액세스할 수 없습니다. 옵션을 보려면 {0}을(를) 누릅니다."],"vs/editor/browser/editorExtensions":["실행 취소(&&U)","실행 취소","다시 실행(&&R)","다시 실행","모두 선택(&&S)","모두 선택"],"vs/editor/browser/widget/codeEditorWidget":["커서 수는 {0}(으)로 제한되었습니다."],"vs/editor/browser/widget/diffEditorWidget":["파일 1개가 너무 커서 파일을 비교할 수 없습니다."],"vs/editor/browser/widget/diffReview":["닫기","변경된 줄 없음","선 1개 변경됨","줄 {0}개 변경됨","차이 {0}/{1}: 원래 줄 {2}, {3}, 수정된 줄 {4}, {5}","비어 있음","{0} 변경되지 않은 줄 {1}","{0} 원래 줄 {1} 수정된 줄 {2}","+ {0} 수정된 줄 {1}","- {0} 원래 줄 {1}","다음 다른 항목으로 이동","다음 다른 항목으로 이동"],"vs/editor/browser/widget/inlineDiffMargin":["삭제된 줄 복사","삭제된 줄 복사","삭제된 줄 복사({0})","이 변경 내용 되돌리기","삭제된 줄 복사({0})"], +"vs/editor/common/config/commonEditorConfig":["편집기","탭 한 개에 해당하는 공백 수입니다. `#editor.detectIndentation#`이 켜져 있는 경우 이 설정은 파일 콘텐츠에 따라 재정의됩니다.","'탭' 키를 누를 때 공백을 삽입합니다. `#editor.detectIndentation#`이 켜져 있는 경우 이 설정은 파일 콘텐츠에 따라 재정의됩니다.","파일을 열 때 파일 콘텐츠를 기반으로 `#editor.tabSize#`와 `#editor.insertSpaces#`가 자동으로 검색되는지 여부를 제어합니다.","끝에 자동 삽입된 공백을 제거합니다.","큰 파일에 대한 특수 처리로, 메모리를 많이 사용하는 특정 기능을 사용하지 않도록 설정합니다.","문서 내 단어를 기반으로 완성을 계산할지 여부를 제어합니다.","모든 색 테마에 대해 의미 체계 강조 표시를 사용합니다.","모든 색 테마에 대해 의미 체계 강조 표시를 사용하지 않습니다.","의미 체계 강조 표시는 현재 색 테마의 `semanticHighlighting` 설정에 따라 구성됩니다.","semanticHighlighting이 지원하는 언어에 대해 표시되는지 여부를 제어합니다.","해당 콘텐츠를 두 번 클릭하거나 'Esc' 키를 누르더라도 Peek 편집기를 열린 상태로 유지합니다.","이 길이를 초과하는 줄은 성능상의 이유로 토큰화되지 않습니다.","diff 계산이 취소된 후 밀리초 단위로 시간을 제한합니다. 제한 시간이 없는 경우 0을 사용합니다.","diff 편집기에서 diff를 나란히 표시할지 인라인으로 표시할지를 제어합니다.","사용하도록 설정하면 Diff 편집기가 선행 또는 후행 공백의 변경 내용을 무시합니다.","diff 편집기에서 추가/제거된 변경 내용에 대해 +/- 표시기를 표시하는지 여부를 제어합니다.","편집기에서 CodeLens를 표시할 것인지 여부를 제어합니다."], +"vs/editor/common/config/editorOptions":["편집기가 스크린 리더가 연결되면 플랫폼 API를 사용하여 감지합니다.","편집기가 스크린 리더 사용을 위해 영구적으로 최적화됩니다.","편집기가 스크린 리더 사용을 위해 최적화되지 않습니다.","편집기를 스크린 리더를 위해 최적화된 모드로 실행할지 결정합니다.","주석을 달 때 공백 문자를 삽입할지 여부를 제어합니다.","빈 줄을 줄 주석에 대한 토글, 추가 또는 제거 작업으로 무시해야 하는지를 제어합니다.","선택 영역 없이 현재 줄 복사 여부를 제어합니다.","입력하는 동안 일치 항목을 찾기 위한 커서 이동 여부를 제어합니다.","편집기 선택에서 Find Widget의 검색 문자열을 시딩할지 여부를 제어합니다.","선택 항목에서 찾기를 자동으로 켜지 않음(기본값)","선택 항목에서 자동으로 항상 찾기 켜기","여러 줄의 콘텐츠를 선택하면 선택 항목에서 찾기가 자동으로 켜집니다.","선택 영역에서 찾기를 자동으로 설정하는 조건을 제어합니다.","macOS에서 Find Widget이 공유 클립보드 찾기를 읽을지 수정할지 제어합니다.","위젯 찾기에서 편집기 맨 위에 줄을 추가해야 하는지 여부를 제어합니다. true인 경우 위젯 찾기가 표시되면 첫 번째 줄 위로 스크롤할 수 있습니다.","더 이상 일치하는 항목이 없을 때 검색을 처음이나 끝에서 자동으로 다시 시작할지 여부를 제어합니다.","글꼴 합자 사용하거나 사용하지 않도록 설정합니다.","명시적 글꼴 기능 설정입니다.","글꼴 합자 또는 글꼴 기능을 구성합니다.","글꼴 크기(픽셀)를 제어합니다.",'"표준" 및 "굵게" 키워드 또는 1~1000 사이의 숫자만 허용됩니다.','글꼴 두께를 제어합니다. "표준" 및 "굵게" 키워드 또는 1~1000 사이의 숫자를 허용합니다.',"결과 Peek 뷰 표시(기본)","기본 결과로 이동하여 Peek 보기를 표시합니다.","기본 결과로 이동하고 다른 항목에 대해 peek 없는 탐색을 사용하도록 설정","이 설정은 더 이상 사용되지 않습니다. 대신 'editor.editor.gotoLocation.multipleDefinitions' 또는 'editor.editor.gotoLocation.multipleImplementations'와 같은 별도의 설정을 사용하세요.","여러 대상 위치가 있는 경우 '정의로 이동' 명령 동작을 제어합니다.","여러 대상 위치가 있는 경우 '유형 정의로 이동' 명령 동작을 제어합니다.","여러 대상 위치가 있는 경우 'Go to Declaration' 명령 동작을 제어합니다.","여러 대상 위치가 있는 경우 '구현으로 이동' 명령 동작을 제어합니다.","여러 대상 위치가 있는 경우 '참조로 이동' 명령 동작을 제어합니다.","'정의로 이동'의 결과가 현재 위치일 때 실행되는 대체 명령 ID입니다.","'형식 정의로 이동'의 결과가 현재 위치일 때 실행되는 대체 명령 ID입니다.","'선언으로 이동'의 결과가 현재 위치일 때 실행되는 대체 명령 ID입니다.","'구현으로 이동'의 결과가 현재 위치일 때 실행되는 대체 명령 ID입니다.","'참조로 이동'의 결과가 현재 위치일 때 실행되는 대체 명령 ID입니다.","호버 표시 여부를 제어합니다.","호버가 표시되기 전까지의 지연 시간(밀리초)을 제어합니다.","마우스를 해당 항목 위로 이동할 때 호버를 계속 표시할지 여부를 제어합니다.","편집기에서 코드 동작 전구를 사용하도록 설정합니다.","줄 높이를 제어합니다. 글꼴 크기에서 줄 높이를 계산하려면 0을 사용합니다.","미니맵 표시 여부를 제어합니다.","미니맵의 크기는 편집기 내용과 동일하며 스크롤할 수 있습니다.","편집기의 높이를 맞추기 위해 필요에 따라 미니맵이 확장되거나 축소됩니다(스크롤 없음).","미니맵을 편집기보다 작게 유지할 수 있도록 필요에 따라 미니맵이 축소됩니다(스크롤 없음).","미니맵의 크기를 제어합니다.","미니맵을 렌더링할 측면을 제어합니다.","미니맵 슬라이더가 표시되는 시기를 제어합니다.","미니맵에 그려진 콘텐츠의 배율: 1, 2 또는 3.","줄의 실제 문자(색 블록 아님)를 렌더링합니다.","최대 특정 수의 열을 렌더링하도록 미니맵의 너비를 제한합니다.","편집기의 위쪽 가장자리와 첫 번째 줄 사이의 공백을 제어합니다.","편집기의 아래쪽 가장자리와 마지막 줄 사이의 공백을 제어합니다.","입력과 동시에 매개변수 문서와 유형 정보를 표시하는 팝업을 사용하도록 설정합니다."," 매개변수 힌트 메뉴의 주기 혹은 목록의 끝에 도달하였을때 종료할 것인지 여부를 결정합니다. ","문자열 내에서 빠른 제안을 사용합니다.","주석 내에서 빠른 제안을 사용합니다.","문자열 및 주석 외부에서 빠른 제안을 사용합니다.","입력하는 동안 제안을 자동으로 표시할지 여부를 제어합니다.","줄 번호는 렌더링되지 않습니다.","줄 번호는 절대값으로 렌더링 됩니다.","줄 번호는 커서 위치에서 줄 간격 거리로 렌더링 됩니다.","줄 번호는 매 10 줄마다 렌더링이 이루어집니다.","줄 번호의 표시 여부를 제어합니다.","이 편집기 눈금자에서 렌더링할 고정 폭 문자 수입니다.","이 편집기 눈금자의 색입니다.","특정 수의 고정 폭 문자 뒤에 세로 눈금자를 렌더링합니다. 여러 눈금자의 경우 여러 값을 사용합니다. 배열이 비어 있는 경우 눈금자가 그려지지 않습니다.","커서의 텍스트 오른쪽을 덮어 쓰지않고 제안을 삽입합니다.","제안을 삽입하고 커서의 오른쪽 텍스트를 덮어씁니다.","완료를 수락할 때 단어를 덮어쓸지 여부를 제어합니다. 이것은 이 기능을 선택하는 확장에 따라 다릅니다.","제안 필터링 및 정렬에서 작은 오타를 설명하는지 여부를 제어합니다.","정렬할 때 커서 근처에 표시되는 단어를 우선할지 여부를 제어합니다.","저장된 제안 사항 선택 항목을 여러 작업 영역 및 창에서 공유할 것인지 여부를 제어합니다(`#editor.suggestSelection#` 필요).","활성 코드 조각이 빠른 제안을 방지하는지 여부를 제어합니다.","제안의 아이콘을 표시할지 여부를 제어합니다.","스크롤바를 표시하기 전에 IntelliSense가 표시할 제안 수를 제어합니다(최대 15개).","이 설정은 더 이상 사용되지 않습니다. 대신 'editor.suggest.showKeywords'또는 'editor.suggest.showSnippets'와 같은 별도의 설정을 사용하세요.","사용하도록 설정되면 IntelliSense에 `메서드` 제안이 표시됩니다.","사용하도록 설정되면 IntelliSense에 '함수' 제안이 표시됩니다.","사용하도록 설정되면 IntelliSense에 '생성자' 제안이 표시됩니다.","사용하도록 설정되면 IntelliSense에 '필드' 제안이 표시됩니다.","사용하도록 설정되면 IntelliSense에 '변수' 제안이 표시됩니다.","사용하도록 설정되면 IntelliSense에 '클래스' 제안이 표시됩니다.","사용하도록 설정되면 IntelliSense에 '구조' 제안이 표시됩니다.","사용하도록 설정되면 IntelliSense에 '인터페이스' 제안이 표시됩니다.","사용하도록 설정되면 IntelliSense에 '모듈' 제안이 표시됩니다.","사용하도록 설정되면 IntelliSense에 '속성' 제안이 표시됩니다.","사용하도록 설정되면 IntelliSense에 '이벤트' 제안이 표시됩니다.","사용하도록 설정되면 IntelliSense에 `연산자` 제안이 표시됩니다.","사용하도록 설정되면 IntelliSense에 '단위' 제안이 표시됩니다.","사용하도록 설정되면 IntelliSense에 '값' 제안이 표시됩니다.","사용하도록 설정되면 IntelliSense에 '상수' 제안이 표시됩니다.","사용하도록 설정되면 IntelliSense에 '열거형' 제안이 표시됩니다.","사용하도록 설정되면 IntelliSense에 `enumMember` 제안이 표시됩니다.","사용하도록 설정되면 IntelliSense에 '키워드' 제안이 표시됩니다.","사용하도록 설정되면 IntelliSense에 '텍스트' 제안이 표시됩니다.","사용하도록 설정되면 IntelliSense에 '색' 제안이 표시됩니다.","사용하도록 설정되면 IntelliSense에 `파일` 제안이 표시됩니다.","사용하도록 설정되면 IntelliSense에 '참조' 제안이 표시됩니다.","사용하도록 설정되면 IntelliSense에 '사용자 지정 색' 제안이 표시됩니다.","사용하도록 설정되면 IntelliSense에 '폴더' 제안이 표시됩니다.","사용하도록 설정된 경우 IntelliSense에 'typeParameter' 제안이 표시됩니다.","사용하도록 설정되면 IntelliSense에 '코드 조각' 제안이 표시됩니다.","IntelliSense를 사용하도록 설정하면 `user`-제안이 표시됩니다.","IntelliSense를 사용하도록 설정한 경우 `issues`-제안을 표시합니다.","제안 위젯 하단의 상태 표시줄 가시성을 제어합니다.","커밋 문자에 대한 제안을 허용할지를 제어합니다. 예를 들어 JavaScript에서는 세미콜론(';')이 제안을 허용하고 해당 문자를 입력하는 커밋 문자일 수 있습니다.","텍스트를 변경할 때 `Enter` 키를 사용한 제안만 허용합니다.","'Tab' 키 외에 'Enter' 키에 대한 제안도 허용할지를 제어합니다. 새 줄을 삽입하는 동작과 제안을 허용하는 동작 간의 모호함을 없앨 수 있습니다.","화면 판독기가 읽을 수 있는 편집기의 줄 수를 제어합니다. 경고: 기본값보다 큰 숫자인 경우 성능에 영향을 미칩니다.","편집기 콘텐츠","언어 구성을 사용하여 대괄호를 자동으로 닫을 경우를 결정합니다.","커서가 공백의 왼쪽에 있는 경우에만 대괄호를 자동으로 닫습니다.","사용자가 여는 괄호를 추가한 후 편집기에서 괄호를 자동으로 닫을지 여부를 제어합니다.","닫기 따옴표 또는 대괄호가 자동으로 삽입된 경우에만 해당 항목 위에 입력합니다.","편집자가 닫는 따옴표 또는 대괄호 위에 입력할지 여부를 제어합니다.","언어 구성을 사용하여 따옴표를 자동으로 닫을 경우를 결정합니다.","커서가 공백의 왼쪽에 있는 경우에만 따옴표를 자동으로 닫습니다.","사용자가 여는 따옴표를 추가한 후 편집기에서 따옴표를 자동으로 닫을지 여부를 제어합니다.","편집기는 들여쓰기를 자동으로 삽입하지 않습니다.","편집기는 현재 줄의 들여쓰기를 유지합니다.","편집기는 현재 줄의 들여쓰기를 유지하고 언어 정의 대괄호를 사용합니다.","편집기는 현재 줄의 들여쓰기를 유지하고 언어 정의 대괄호를 존중하며 언어별로 정의된 특별 EnterRules를 호출합니다.","편집기는 현재 줄의 들여쓰기를 유지하고, 언어 정의 대괄호를 존중하고, 언어에 의해 정의된 특별 EnterRules를 호출하고, 언어에 의해 정의된 들여쓰기 규칙을 존중합니다.","사용자가 줄을 입력, 붙여넣기, 이동 또는 들여쓰기 할 때 편집기에서 들여쓰기를 자동으로 조정하도록 할지 여부를 제어합니다.","언어 구성을 사용하여 선택 항목을 자동으로 둘러쌀 경우를 결정합니다.","대괄호가 아닌 따옴표로 둘러쌉니다.","따옴표가 아닌 대괄호로 둘러쌉니다.","편집기에서 선택 항목을 자동으로 둘러쌀지 여부를 제어합니다.","편집기에서 CodeLens를 표시할 것인지 여부를 제어합니다.","편집기에서 인라인 색 데코레이터 및 색 선택을 렌더링할지를 제어합니다.","마우스와 키로 선택한 영역에서 열을 선택하도록 설정합니다.","터미널에서 선택한(블록 지정한) 텍스트가 클립보드로 자동 복사 여부를 제어합니다.\n'true'로 설정 할 시 선택할 때마다 클립보드로 복사 됩니다.","커서 애니메이션 스타일을 제어합니다.","매끄러운 캐럿 애니메이션의 사용 여부를 제어합니다.","커서 스타일을 제어합니다.","커서 주위에 표시되는 선행 및 후행 줄의 최소 수를 제어합니다. 다른 편집기에서는 'scrollOff' 또는 'scrollOffset'이라고 합니다.","'cursorSurroundingLines'는 키보드 나 API를 통해 트리거될 때만 적용됩니다.","`cursorSurroundingLines`는 항상 적용됩니다.","'cursorSurroundingLines'를 적용해야 하는 경우를 제어합니다.","`#editor.cursorStyle#` 설정이 'line'으로 설정되어 있을 때 커서의 넓이를 제어합니다.","편집기에서 끌어서 놓기로 선택 영역을 이동할 수 있는지 여부를 제어합니다.","'Alt' 키를 누를 때 스크롤 속도 승수입니다.","편집기에 코드 접기가 사용하도록 설정되는지 여부를 제어합니다.","사용 가능한 경우 언어별 접기 전략을 사용합니다. 그렇지 않은 경우 들여쓰기 기반 전략을 사용합니다.","들여쓰기 기반 접기 전략을 사용합니다.","접기 범위를 계산하기 위한 전략을 제어합니다.","편집기에서 접힌 범위를 강조 표시할지 여부를 제어합니다.","접힌 줄이 줄을 펼친 후 빈 콘텐츠를 클릭할지 여부를 제어합니다.","글꼴 패밀리를 제어합니다.","붙여넣은 콘텐츠의 서식을 편집기에서 자동으로 지정할지 여부를 제어합니다. 포맷터를 사용할 수 있어야 하며 포맷터가 문서에서 범위의 서식을 지정할 수 있어야 합니다.","입력 후 편집기에서 자동으로 줄의 서식을 지정할지 여부를 제어합니다.","편집기에서 세로 문자 모양 여백을 렌더링할지 여부를 제어합니다. 문자 모양 여백은 주로 디버깅에 사용됩니다.","커서가 개요 눈금자에서 가려져야 하는지 여부를 제어합니다.","편집기에서 활성 들여쓰기 가이드를 강조 표시할지 여부를 제어합니다.","문자 간격(픽셀)을 제어합니다.","편집기에서 링크를 감지하고 클릭할 수 있게 만들지 여부를 제어합니다.","일치하는 대괄호를 강조 표시합니다.","마우스 휠 스크롤 이벤트의 `deltaX` 및 `deltaY`에서 사용할 승수입니다.","마우스 휠을 사용할 때 'Ctrl' 키를 누르고 있으면 편집기의 글꼴을 확대/축소합니다.","여러 커서가 겹치는 경우 커서를 병합합니다.","Windows와 Linux의 'Control'을 macOS의 'Command'로 매핑합니다.","Windows와 Linux의 'Alt'를 macOS의 'Option'으로 매핑합니다.","마우스로 여러 커서를 추가할 때 사용할 수정자입니다. [정의로 이동] 및 [링크 열기] 마우스 제스처가 멀티커서 수정자와 충돌하지 않도록 조정됩니다. [자세한 정보](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).","각 커서는 텍스트 한 줄을 붙여넣습니다.","각 커서는 전체 텍스트를 붙여넣습니다.","붙여넣은 텍스트의 줄 수가 커서 수와 일치하는 경우 붙여넣기를 제어합니다.","편집기에서 의미 체계 기호 항목을 강조 표시할지 여부를 제어합니다.","개요 눈금자 주위에 테두리를 그릴지 여부를 제어합니다.","Peek를 여는 동안 트리에 포커스","미리 보기를 열 때 편집기에 포커스","미리 보기 위젯에서 인라인 편집기에 포커스를 둘지 또는 트리에 포커스를 둘지를 제어합니다.","이동 정의 마우스 제스처가 항상 미리 보기 위젯을 열지 여부를 제어합니다.","빠른 제안을 표시하기 전까지의 지연 시간(밀리초)을 제어합니다.","편집기가 유형에 따라 자동으로 이름을 바꿀지 여부를 제어합니다.","편집기에서 제어 문자를 렌더링할지를 제어합니다.","편집기에서 들여쓰기 가이드를 렌더링할지를 제어합니다.","파일이 줄 바꿈으로 끝나면 마지막 줄 번호를 렌더링합니다.","제본용 여백과 현재 줄을 모두 강조 표시합니다.","편집기가 현재 줄 강조 표시를 렌더링하는 방식을 제어합니다. ","편집기에 포커스가 있는 경우에만 편집기에서 현재 줄 강조 표시를 렌더링해야 하는지 제어합니다.","단어 사이의 공백 하나를 제외한 공백 문자를 렌더링합니다.","선택한 텍스트에서만 공백 문자를 렌더링합니다.","후행 공백 문자만 렌더링","편집기에서 공백 문자를 렌더링할 방법을 제어합니다.","선택 항목의 모서리를 둥글게 할지 여부를 제어합니다.","편집기에서 가로로 스크롤되는 범위를 벗어나는 추가 문자의 수를 제어합니다.","편집기에서 마지막 줄 이후로 스크롤할지 여부를 제어합니다.","세로와 가로로 동시에 스크롤할 때에만 주축을 따라서 스크롤합니다. 트랙패드에서 세로로 스크롤할 때 가로 드리프트를 방지합니다.","Linux 주 클립보드의 지원 여부를 제어합니다.","편집기가 선택 항목과 유사한 일치 항목을 강조 표시해야하는지 여부를 제어합니다.","접기 컨트롤을 항상 표시합니다.","마우스가 여백 위에 있을 때에만 접기 컨트롤을 표시합니다.","여백의 접기 컨트롤이 표시되는 시기를 제어합니다.","사용하지 않는 코드의 페이드 아웃을 제어합니다.","취소선 사용되지 않는 변수를 제어합니다.","다른 제안 위에 조각 제안을 표시합니다.","다른 제안 아래에 조각 제안을 표시합니다.","다른 제안과 함께 조각 제안을 표시합니다.","코드 조각 제안을 표시하지 않습니다.","코드 조각이 다른 추천과 함께 표시되는지 여부 및 정렬 방법을 제어합니다.","편집기에서 애니메이션을 사용하여 스크롤할지 여부를 제어합니다.","제안 위젯의 글꼴 크기입니다. '0'으로 설정하면 '#editor.fontSize#'의 값이 사용됩니다.","제안 위젯의 줄 높이입니다. '0'으로 설정하면 `#editor.lineHeight#`의 값이 사용됩니다.","트리거 문자를 입력할 때 제안을 자동으로 표시할지 여부를 제어합니다.","항상 첫 번째 제안을 선택합니다.","`log`가 최근에 완료되었으므로 추가 입력에서 제안을 선택하지 않은 경우 최근 제안을 선택하세요(예: `console.| -> console.log`).","해당 제안을 완료한 이전 접두사에 따라 제안을 선택합니다(예: `co -> console` 및 `con -> const`).","제안 목록을 표시할 때 제한이 미리 선택되는 방식을 제어합니다.","탭 완료는 탭을 누를 때 가장 일치하는 제안을 삽입합니다.","탭 완성을 사용하지 않도록 설정합니다.","접두사가 일치하는 경우 코드 조각을 탭 완료합니다. 'quickSuggestions'를 사용하지 않을 때 가장 잘 작동합니다.","탭 완성을 사용하도록 설정합니다.","비정상적인 줄 종결자가 무시됩니다.","제거할 비정상적인 줄 종결자 프롬프트입니다.","비정상적인 줄 종결자가 자동으로 제거됩니다.","문제를 일으킬 수 있는 비정상적인 줄 종결자를 제거합니다.","탭 정지 뒤에 공백을 삽입 및 삭제합니다.","단어 관련 탐색 또는 작업을 수행할 때 단어 구분 기호로 사용할 문자입니다.","줄이 바뀌지 않습니다.","뷰포트 너비에서 줄이 바뀝니다.","`#editor.wordWrapColumn#`에서 줄이 바뀝니다.","뷰포트의 최소값 및 `#editor.wordWrapColumn#`에서 줄이 바뀝니다.","줄 바꿈 여부를 제어합니다.","`#editor.wordWrap#`이 `wordWrapColumn` 또는 'bounded'인 경우 편집기의 열 줄 바꿈을 제어합니다.","들여쓰기가 없습니다. 줄 바꿈 행이 열 1에서 시작됩니다.","줄 바꿈 행의 들여쓰기가 부모와 동일합니다.","줄 바꿈 행이 부모 쪽으로 +1만큼 들여쓰기됩니다.","줄 바꿈 행이 부모 쪽으로 +2만큼 들여쓰기됩니다.","줄 바꿈 행의 들여쓰기를 제어합니다.","모든 문자가 동일한 너비라고 가정합니다. 이 알고리즘은 고정 폭 글꼴과 문자 모양의 너비가 같은 특정 스크립트(예: 라틴 문자)에 적절히 작동하는 빠른 알고리즘입니다.","래핑 점 계산을 브라우저에 위임합니다. 이 알고리즘은 매우 느려서 대용량 파일의 경우 중단될 수 있지만 모든 경우에 적절히 작동합니다.","래핑 점을 계산하는 알고리즘을 제어합니다."], +"vs/editor/common/model/editStack":["입력하는 중"],"vs/editor/common/modes/modesRegistry":["일반 텍스트"], +"vs/editor/common/standaloneStrings":["없음 선택","줄 {0}, 열 {1}({2} 선택됨)입니다.","행 {0}, 열 {1}","{0} 선택 항목({1}자 선택됨)","{0} 선택 항목","이제 'accessibilitySupport' 설정을 'on'으로 변경합니다.","지금 편집기 접근성 문서 페이지를 여세요.","차이 편집기의 읽기 전용 창에서.","diff 편집기 창에서."," 읽기 전용 코드 편집기에서"," 코드 편집기에서","화면 판독기 사용에 최적화되도록 편집기를 구성하려면 지금 Command+E를 누르세요.","화면 판독기에 사용할 수 있도록 편집기를 최적화하려면 지금 Ctrl+E를 누르세요.","에디터를 화면 판독기와 함께 사용하기에 적합하도록 구성했습니다.","편집기는 화면 판독기 사용을 위해 절대로 최적화되지 않도록 구성됩니다. 현재로서는 그렇지 않습니다.","현재 편집기에서 키를 누르면 포커스가 다음 포커스 가능한 요소로 이동합니다. {0}을(를) 눌러서 이 동작을 설정/해제합니다.","현재 편집기에서 키를 누르면 포커스가 다음 포커스 가능한 요소로 이동합니다. {0} 명령은 현재 키 바인딩으로 트리거할 수 없습니다.","현재 편집기에서 키를 누르면 탭 문자가 삽입됩니다. {0}을(를) 눌러서 이 동작을 설정/해제합니다.","현재 편집기에서 키를 누르면 탭 문자가 삽입됩니다. {0} 명령은 현재 키 바인딩으로 트리거할 수 없습니다.","Command+H를 눌러 편집기 접근성과 관련된 자세한 정보가 있는 브라우저 창을 여세요.","Ctrl+H를 눌러 편집기 접근성과 관련된 자세한 정보가 있는 브라우저 창을 엽니다.","이 도구 설명을 해제하고 Esc 키 또는 Shift+Esc를 눌러서 편집기로 돌아갈 수 있습니다.","접근성 도움말 표시","개발자: 검사 토큰","줄/열로 이동...","빠른 액세스 공급자 모두 표시","명령 팔레트","명령 표시 및 실행","기호로 가서...","범주별 기호로 이동...","편집기 콘텐츠","접근성 옵션은 Alt+F1을 눌러여 합니다.","고대비 테마로 전환","{1} 파일에서 편집을 {0}개 했습니다."], +"vs/editor/common/view/editorColorRegistry":["커서 위치의 줄 강조 표시에 대한 배경색입니다.","커서 위치의 줄 테두리에 대한 배경색입니다.","빠른 열기 및 찾기 기능 등을 통해 강조 표시된 영역의 배경색입니다. 기본 장식을 숨기지 않도록 색은 불투명하지 않아야 합니다.","강조 영역 주변의 테두리에 대한 배경색입니다","강조 표시된 기호(예: 정의로 이동 또는 다음/이전 기호로 이동)의 배경색입니다. 이 색상은 기본 장식을 숨기지 않도록 불투명하지 않아야 합니다.","강조 표시된 기호 주위의 테두리 배경색입니다.","편집기 커서 색입니다.","편집기 커서의 배경색입니다. 블록 커서와 겹치는 글자의 색상을 사용자 정의할 수 있습니다.","편집기의 공백 문자 색입니다.","편집기 들여쓰기 안내선 색입니다.","활성 편집기 들여쓰기 안내선 색입니다.","편집기 줄 번호 색입니다.","편집기 활성 영역 줄번호 색상","ID는 사용되지 않습니다. 대신 'editorLineNumber.activeForeground'를 사용하세요.","편집기 활성 영역 줄번호 색상","편집기 눈금의 색상입니다.","편집기 코드 렌즈의 전경색입니다.","일치하는 괄호 뒤의 배경색","일치하는 브래킷 박스의 색상","개요 눈금 경계의 색상입니다.","편집기 개요 눈금자의 배경색입니다. 미니맵이 사용하도록 설정되어 편집기의 오른쪽에 배치된 경우에만 사용됩니다.","편집기 거터의 배경색입니다. 거터에는 글리프 여백과 행 수가 있습니다.","편집기의 불필요한(사용하지 않는) 소스 코드 테두리 색입니다.","편집기의 불필요한(사용하지 않는) 소스 코드 불투명도입니다. 예를 들어 \"#000000c0\"은 75% 불투명도로 코드를 렌더링합니다. 고대비 테마의 경우 페이드 아웃하지 않고 'editorUnnecessaryCode.border' 테마 색을 사용하여 불필요한 코드에 밑줄을 그으세요.","범위의 개요 눈금자 표식 색이 강조 표시됩니다. 기본 장식을 숨기지 않도록 색은 불투명하지 않아야 합니다.","오류의 개요 눈금자 마커 색입니다.","경고의 개요 눈금자 마커 색입니다.","정보의 개요 눈금자 마커 색입니다."], +"vs/editor/contrib/anchorSelect/anchorSelect":["선택 앵커 지점","{0}에 설정된 앵커: {1}","선택 앵커 지점 설정","선택 앵커 지점으로 이동","앵커에서 커서로 선택","선택 앵커 지점 취소"],"vs/editor/contrib/bracketMatching/bracketMatching":["괄호에 해당하는 영역을 표시자에 채색하여 표시합니다.","대괄호로 이동","괄호까지 선택","대괄호로 이동(&&B)"],"vs/editor/contrib/caretOperations/caretOperations":["선택한 텍스트를 왼쪽으로 이동","선택한 텍스트를 오른쪽으로 이동"],"vs/editor/contrib/caretOperations/transpose":["문자 바꾸기"],"vs/editor/contrib/clipboard/clipboard":["잘라내기(&&T)","잘라내기","잘라내기","복사(&&C)","복사","복사","붙여넣기(&&P)","붙여넣기","붙여넣기","구문을 강조 표시하여 복사"], +"vs/editor/contrib/codeAction/codeActionCommands":["실행할 코드 작업의 종류입니다.","반환된 작업이 적용되는 경우를 제어합니다.","항상 반환된 첫 번째 코드 작업을 적용합니다.","첫 번째 반환된 코드 작업을 적용합니다(이 작업만 있는 경우).","반환된 코드 작업을 적용하지 마세요.","기본 코드 작업만 반환되도록 할지 여부를 제어합니다.","코드 작업을 적용하는 중 알 수 없는 오류가 발생했습니다.","빠른 수정...","사용 가능한 코드 동작이 없습니다.","'{0}'에 대한 기본 코드 작업을 사용할 수 없음","'{0}'에 대한 코드 작업을 사용할 수 없음","사용할 수 있는 기본 코드 작업 없음","사용 가능한 코드 동작이 없습니다.","리팩터링...","'{0}'에 대한 기본 리팩터링 없음","'{0}'에 대한 리팩터링 없음","기본 설정 리팩터링을 사용할 수 없음","사용 가능한 리펙터링이 없습니다.","소스 작업...","'{0}'에 대한 기본 소스 작업을 사용할 수 없음","'{0}'에 대한 소스 작업을 사용할 수 없음","사용할 수 있는 기본 원본 작업 없음","사용 가능한 소스 작업이 없습니다.","가져오기 구성","사용 가능한 가져오기 구성 작업이 없습니다.","모두 수정","모든 작업 수정 사용 불가","자동 수정...","사용할 수 있는 자동 수정 없음"],"vs/editor/contrib/codeAction/lightBulbWidget":["수정 사항을 표시합니다. 사용 가능한 기본 수정({0})","수정 사항 표시({0})","수정 사항 표시"],"vs/editor/contrib/codelens/codelensController":["현재 줄에 대한 코드 렌즈 명령 표시"],"vs/editor/contrib/comment/comment":["줄 주석 설정/해제","줄 주석 설정/해제(&&T)","줄 주석 추가","줄 주석 제거","블록 주석 설정/해제","블록 주석 설정/해제(&&B)"], +"vs/editor/contrib/contextmenu/contextmenu":["편집기 상황에 맞는 메뉴 표시"],"vs/editor/contrib/cursorUndo/cursorUndo":["커서 실행 취소","커서 다시 실행"], +"vs/editor/contrib/documentSymbols/outlineTree":["배열 기호의 전경색입니다. 이러한 기호는 개요, 이동 경로 및 제안 위젯에 나타납니다.","부울 기호의 전경색입니다. 이러한 기호는 개요, 이동 경로 및 제안 위젯에 나타납니다.","클래스 기호의 전경색입니다. 이러한 기호는 개요, 이동 경로 및 제안 위젯에 나타납니다.","색 기호의 전경색입니다. 이러한 기호는 개요, 이동 경로 및 제안에 표시됩니다.","상수 기호의 전경색입니다. 이러한 기호는 개요, 이동 경로 및 제안 위젯에 나타납니다.","생성자 기호의 전경색입니다. 이러한 기호는 개요, 이동 경로 및 제안 위젯에 표시됩니다.","열거자 기호의 전경색입니다. 이러한 기호는 개요, 이동 경로 및 제안 위젯에 표시됩니다.","열거자 멤버 기호의 전경색입니다. 이러한 기호는 개요, 이동 경로 및 제안 위젯에 나타납니다.","이벤트 기호의 전경색입니다. 이러한 기호는 개요, 이동 경로 및 제안 위젯에 나타납니다.","필드 기호의 전경색입니다. 이러한 기호는 개요, 이동 경로 및 제안 위젯에 표시됩니다.","파일 기호의 전경색입니다. 이러한 기호는 개요, 이동 경로 및 제안 위젯에 나타납니다.","폴더 기호의 전경색입니다. 이러한 기호는 개요, 이동 경로 및 제안 위젯에 나타납니다.","함수 기호의 전경색입니다. 이러한 기호는 개요, 이동 경로 및 제안 위젯에 나타납니다.","인터페이스 기호의 전경색입니다. 이러한 기호는 개요, 이동 경로 및 제안 위젯에 표시됩니다.","키 기호의 전경색입니다. 이러한 기호는 개요, 이동 경로 및 제안 위젯에 표시됩니다.","키워드 기호의 전경색입니다. 이러한 기호는 개요, 이동 경로 및 제안 위젯에 나타납니다.","메서드 기호의 전경색입니다. 이러한 기호는 개요, 이동 경로 및 제안 위젯에 표시됩니다.","모듈 기호의 전경색입니다. 이러한 기호는 개요, 이동 경로 및 제안 위젯에 나타납니다.","네임스페이스 기호의 전경색입니다. 이러한 기호는 개요, 이동 경로 및 제안 위젯에 나타납니다.","null 기호의 전경색입니다. 이러한 기호는 개요, 이동 경로 및 제안 위젯에 나타납니다.","숫자 기호의 전경색입니다. 이러한 기호는 개요, 이동 경로 및 제안 위젯에 표시됩니다.","개체 기호의 전경색입니다. 이러한 기호는 개요, 이동 경로 및 제안 위젯에 나타납니다.","연산자 기호의 전경색입니다. 이러한 기호는 개요, 이동 경로 및 제안 위젯에 나타납니다.","패키지 기호의 전경색입니다. 이러한 기호는 개요, 이동 경로 및 제안 위젯에 나타납니다.","속성 기호의 전경색입니다. 이러한 기호는 개요, 이동 경로 및 제안 위젯에 나타납니다.","참조 기호의 전경색입니다. 이러한 기호는 개요, 이동 경로 및 제안 위젯에 나타납니다.","코드 조각 기호의 전경색입니다. 이러한 기호는 개요, 이동 경로 및 제안 위젯에 표시됩니다.","문자열 기호의 전경색입니다. 이러한 기호는 개요, 이동 경로 및 제안 위젯에 표시됩니다.","구조 기호의 전경색입니다. 이러한 기호는 개요, 이동 경로 및 제안 위젯에 표시됩니다.","텍스트 기호의 전경색입니다. 이러한 기호는 개요, 이동 경로 및 제안 위젯에 나타납니다.","형식 매개변수 기호의 전경색입니다. 이러한 기호는 개요, 이동 경로 및 제안 위젯에 표시됩니다.","단위 기호의 전경색입니다. 이러한 기호는 개요, 이동 경로 및 제안 위젯에 표시됩니다.","변수 기호의 전경색입니다. 이러한 기호는 개요, 이동 경로 및 제안 위젯에 표시됩니다."], +"vs/editor/contrib/find/findController":["찾기","찾기(&&F)","선택 영역에서 찾기","다음 찾기","다음 찾기","이전 찾기","이전 찾기","다음 선택 찾기","이전 선택 찾기","바꾸기","바꾸기(&&R)"],"vs/editor/contrib/find/findWidget":["찾기","찾기","이전 일치","다음 일치 항목","선택 항목에서 찾기","닫기","바꾸기","바꾸기","바꾸기","모두 바꾸기","바꾸기 모드 설정/해제","처음 {0}개의 결과가 강조 표시되지만 모든 찾기 작업은 전체 텍스트에 대해 수행됩니다.","{1}의 {0}","결과 없음","{0}개 찾음","'{1}'에 대한 {0}을(를) 찾음","{2}에서 '{1}'에 대한 {0}을(를) 찾음","'{1}'에 대한 {0}을(를) 찾음","Ctrl+Enter를 누르면 이제 모든 항목을 바꾸지 않고 줄 바꿈을 삽입합니다. editor.action.replaceAll의 키 바인딩을 수정하여 이 동작을 재정의할 수 있습니다."],"vs/editor/contrib/folding/folding":["펼치기","재귀적으로 펼치기","접기","접기 전환","재귀적으로 접기","모든 블록 코멘트를 접기","모든 영역 접기","모든 영역 펼치기","모두 접기","모두 펼치기","수준 {0} 접기","접힌 범위의 배경색입니다. 색은 기본 장식을 숨기지 않기 위해 불투명해서는 안 됩니다.","편집기 여백의 접기 컨트롤 색입니다."],"vs/editor/contrib/fontZoom/fontZoom":["편집기 글꼴 확대","편집기 글꼴 축소","편집기 글꼴 확대/축소 다시 설정"],"vs/editor/contrib/format/format":["줄 {0}에서 1개 서식 편집을 수행했습니다.","줄 {1}에서 {0}개 서식 편집을 수행했습니다.","줄 {0}과(와) {1} 사이에서 1개 서식 편집을 수행했습니다.","줄 {1}과(와) {2} 사이에서 {0}개 서식 편집을 수행했습니다."], +"vs/editor/contrib/format/formatActions":["문서 서식","선택 영역 서식"],"vs/editor/contrib/gotoError/gotoError":["다음 문제로 이동 (오류, 경고, 정보)","이전 문제로 이동 (오류, 경고, 정보)","파일의 다음 문제로 이동 (오류, 경고, 정보)","다음 문제(&&P)","파일의 이전 문제로 이동 (오류, 경고, 정보)","이전 문제(&&P)"],"vs/editor/contrib/gotoError/gotoErrorWidget":["오류","경고","정보","힌트","{1}의 {0}입니다.","문제 {1}개 중 {0}개","문제 {1}개 중 {0}개","편집기 표식 탐색 위젯 오류 색입니다.","편집기 표식 탐색 위젯 경고 색입니다.","편집기 표식 탐색 위젯 정보 색입니다.","편집기 표식 탐색 위젯 배경입니다."],"vs/editor/contrib/gotoSymbol/goToCommands":["피킹","정의","'{0}'에 대한 정의를 찾을 수 없습니다.","정의를 찾을 수 없음","정의로 이동","정의로 이동(&&D)","측면에서 정의 열기","정의 피킹","선언","'{0}'에 대한 선언을 찾을 수 없음","선언을 찾을 수 없음","선언으로 이동","선언으로 이동(&&D)","'{0}'에 대한 선언을 찾을 수 없음","선언을 찾을 수 없음","선언 미리 보기","형식 정의","'{0}'에 대한 형식 정의를 찾을 수 없습니다.","형식 정의를 찾을 수 없습니다.","형식 정의로 이동","형식 정의로 이동(&&T)","형식 정의 미리 보기","구현","'{0}'에 대한 구현을 찾을 수 없습니다.","구현을 찾을 수 없습니다.","구현으로 이동","구현으로 이동(&&I)","피킹 구현","'{0}'에 대한 참조가 없습니다.","참조가 없습니다.","참조로 이동","참조로 이동(&&R)","참조","참조 미리 보기","참조","기호로 이동","위치","'{0}'에 대한 검색 결과가 없음","참조"], +"vs/editor/contrib/gotoSymbol/link/goToDefinitionAtPosition":["{0}개 정의를 표시하려면 클릭하세요."],"vs/editor/contrib/gotoSymbol/peek/referencesController":["로드 중...","{0}({1})"],"vs/editor/contrib/gotoSymbol/peek/referencesTree":["참조 {0}개","참조 {0}개","참조"],"vs/editor/contrib/gotoSymbol/peek/referencesWidget":["미리 보기를 사용할 수 없음","결과 없음","참조"],"vs/editor/contrib/gotoSymbol/referencesModel":["{2}열, {1}줄, {0}의 기호","{0}의 기호 1개, 전체 경로 {1}","{1}의 기호 {0}개, 전체 경로 {2}","결과 없음","{0}에서 기호 1개를 찾았습니다.","{1}에서 기호 {0}개를 찾았습니다.","{1}개 파일에서 기호 {0}개를 찾았습니다."],"vs/editor/contrib/gotoSymbol/symbolNavigation":["{1}의 {0} 기호, 다음의 경우 {2}","{1}의 기호 {0}"],"vs/editor/contrib/hover/hover":["가리키기 표시","정의 미리 보기 가리킨 항목 표시"],"vs/editor/contrib/hover/modesContentHover":["로드 중...","문제 보기","빠른 수정을 확인하는 중...","빠른 수정을 사용할 수 없음","빠른 수정..."],"vs/editor/contrib/inPlaceReplace/inPlaceReplace":["이전 값으로 바꾸기","다음 값으로 바꾸기"], +"vs/editor/contrib/indentation/indentation":["들여쓰기를 공백으로 변환","들여쓰기를 탭으로 변환","구성된 탭 크기","현재 파일의 탭 크기 선택","탭을 사용한 들여쓰기","공백을 사용한 들여쓰기","콘텐츠에서 들여쓰기 감지","줄 다시 들여쓰기","선택한 줄 다시 들여쓰기"],"vs/editor/contrib/linesOperations/linesOperations":["위에 줄 복사","위에 줄 복사(&&C)","아래에 줄 복사","아래에 줄 복사(&&P)","중복된 선택 영역","중복된 선택 영역(&&D)","줄 위로 이동","줄 위로 이동(&&V)","줄 아래로 이동","줄 아래로 이동(&&L)","줄을 오름차순 정렬","줄을 내림차순으로 정렬","후행 공백 자르기","줄 삭제","줄 들여쓰기","줄 내어쓰기","위에 줄 삽입","아래에 줄 삽입","왼쪽 모두 삭제","우측에 있는 항목 삭제","줄 연결","커서 주위 문자 바꾸기","대문자로 변환","소문자로 변환","단어의 첫 글자를 대문자로 변환"],"vs/editor/contrib/links/links":["명령 실행","링크로 이동","Cmd+클릭","Ctrl+클릭","Option+클릭","Alt+클릭","{0} 형식이 올바르지 않으므로 이 링크를 열지 못했습니다","대상이 없으므로 이 링크를 열지 못했습니다.","링크 열기"],"vs/editor/contrib/message/messageController":["읽기 전용 편집기에서는 편집할 수 없습니다."], +"vs/editor/contrib/multicursor/multicursor":["위에 커서 추가","위에 커서 추가(&&A)","아래에 커서 추가","아래에 커서 추가(&&D)","줄 끝에 커서 추가","줄 끝에 커서 추가(&&U)","맨 아래에 커서 추가","맨 위에 커서 추가","다음 일치 항목 찾기에 선택 항목 추가","다음 항목 추가(&&N)","이전 일치 항목 찾기에 선택 항목 추가","이전 항목 추가(&&R)","다음 일치 항목 찾기로 마지막 선택 항목 이동","마지막 선택 항목을 이전 일치 항목 찾기로 이동","일치 항목 찾기의 모든 항목 선택","모든 항목 선택(&&O)","모든 항목 변경"],"vs/editor/contrib/parameterHints/parameterHints":["매개 변수 힌트 트리거"],"vs/editor/contrib/parameterHints/parameterHintsWidget":["{0}, 힌트"],"vs/editor/contrib/peekView/peekView":["닫기","Peek 뷰 제목 영역의 배경색입니다.","Peek 뷰 제목 색입니다.","Peek 뷰 제목 정보 색입니다.","Peek 뷰 테두리 및 화살표 색입니다.","Peek 뷰 결과 목록의 배경색입니다.","Peek 뷰 결과 목록에서 라인 노드의 전경색입니다.","Peek 뷰 결과 목록에서 파일 노드의 전경색입니다.","Peek 뷰 결과 목록에서 선택된 항목의 배경색입니다.","Peek 뷰 결과 목록에서 선택된 항목의 전경색입니다.","Peek 뷰 편집기의 배경색입니다.","Peek 뷰 편집기의 거터 배경색입니다.","Peek 뷰 결과 목록의 일치 항목 강조 표시 색입니다.","Peek 뷰 편집기의 일치 항목 강조 표시 색입니다.","Peek 뷰 편집기의 일치 항목 강조 표시 테두리입니다."], +"vs/editor/contrib/quickAccess/gotoLineQuickAccess":["우선 텍스트 편집기를 열고 줄로 이동합니다.","{0} 줄 및 {1} 열로 이동합니다.","{0} 줄로 이동합니다.","현재 줄: {0}, 문자: {1} 이동할 줄 1~{2} 사이의 번호를 입력합니다.","현재 줄: {0}, 문자: {1}. 이동할 줄 번호를 입력합니다."],"vs/editor/contrib/quickAccess/gotoSymbolQuickAccess":["기호로 이동하려면 먼저 기호 정보가 있는 텍스트 편집기를 엽니다.","활성 상태의 텍스트 편집기는 기호 정보를 제공하지 않습니다.","일치하는 편집기 기호 없음","편집기 기호 없음","측면에서 열기","하단에 열기","기호({0})","속성({0})","메서드({0})","함수({0})","생성자({0})","변수({0})","클래스({0})","구조체({0})","이벤트({0})","연산자({0})","인터페이스({0})","네임스페이스({0})","패키지({0})","형식 매개 변수({0})","모듈({0})","속성({0})","열거형({0})","열거형 멤버({0})","문자열({0})","파일({0})","배열({0})","숫자({0})","부울({0})","개체({0})","키({0})","필드({0})","상수({0})"],"vs/editor/contrib/rename/onTypeRename":["유형별 이름 바꾸기 기호","형식의 편집기에서 자동으로 이름을 바꿀 때의 배경색입니다."], +"vs/editor/contrib/rename/rename":["결과가 없습니다.","위치 이름을 바꾸는 중 알 수 없는 오류가 발생했습니다.","'{0}'의 이름을 바꾸는 중","{0} 이름 바꾸기","'{0}'을(를) '{1}'(으)로 이름을 변경했습니다. 요약: {2}","이름 바꾸기를 통해 편집 내용을 적용하지 못했습니다.","이름 바꾸기를 통해 편집 내용을 계산하지 못했습니다.","기호 이름 바꾸기","이름을 바꾸기 전에 변경 내용을 미리 볼 수 있는 기능 사용/사용 안 함"],"vs/editor/contrib/rename/renameInputField":["입력 이름을 바꾸세요. 새 이름을 입력한 다음 [Enter] 키를 눌러 커밋하세요.","이름 바꾸기 {0}, 미리 보기 {1}"],"vs/editor/contrib/smartSelect/smartSelect":["선택 영역 확장","선택 영역 확장(&&E)","선택 영역 축소","선택 영역 축소(&&S)"],"vs/editor/contrib/snippet/snippetVariables":["일요일","월요일","화요일","수요일","목요일","금요일","토요일","일","월","화","수","목","금","토","1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월","1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],"vs/editor/contrib/suggest/suggestController":["{0}의 {1}개의 수정사항을 수락하는 중","제안 항목 트리거","삽입하려면 {0}","삽입하려면 {0}","교체하려면 {0}","교체하려면 {0}","삽입하려면 {0}","간단히 표시","더 보기"], +"vs/editor/contrib/suggest/suggestWidget":["제안 위젯의 배경색입니다.","제안 위젯의 테두리 색입니다.","제안 위젯의 전경색입니다.","제한 위젯에서 선택된 항목의 배경색입니다.","제안 위젯의 일치 항목 강조 표시 색입니다.","자세한 정보({0})","간단히 표시({0})","로드 중...","로드 중...","제안 항목이 없습니다.","{0}, 문서: {1}","제안"],"vs/editor/contrib/toggleTabFocusMode/toggleTabFocusMode":[" 키로 포커스 이동 설정/해제","이제 키를 누르면 포커스가 다음 포커스 가능한 요소로 이동합니다.","이제 키를 누르면 탭 문자가 삽입됩니다."],"vs/editor/contrib/tokenization/tokenization":["개발자: 강제로 다시 토큰화"],"vs/editor/contrib/unusualLineTerminators/unusualLineTerminators":["비정상적인 줄 종결자","비정상적인 줄 종결자가 검색됨","이 파일에 LS(줄 구분 기호) 또는 PS(단락 구분 기호) 같은 하나 이상의 비정상적인 줄 종결자 문자가 포함되어 있습니다.\r\n\r\n파일에서 제거하는 것이 좋습니다. `editor.unusualLineTerminators`를 통해 구성할 수 있습니다.","이 파일 수정","이 파일의 문제 무시"], +"vs/editor/contrib/wordHighlighter/wordHighlighter":["변수 읽기와 같은 읽기 액세스 중 기호의 배경색입니다. 기본 장식을 숨기지 않도록 색은 불투명하지 않아야 합니다.","변수에 쓰기와 같은 쓰기 액세스 중 기호의 배경색입니다. 기본 장식을 숨기지 않도록 색은 불투명하지 않아야 합니다.","변수 읽기와 같은 읽기 액세스 중 기호의 테두리 색입니다.","변수에 쓰기와 같은 쓰기 액세스 중 기호의 테두리 색입니다.","기호 강조 표시의 개요 눈금자 표식 색입니다. 기본 장식을 숨기지 않도록 색은 불투명하지 않아야 합니다.","쓰기 액세스 기호에 대한 개요 눈금자 표식 색이 강조 표시됩니다. 기본 장식을 숨기지 않도록 색은 불투명하지 않아야 합니다.","다음 강조 기호로 이동","이전 강조 기호로 이동","기호 강조 표시 트리거"],"vs/platform/actions/browser/menuEntryActionViewItem":["{0}({1})"],"vs/platform/configuration/common/configurationRegistry":["기본 언어 구성 재정의","언어에 대해 재정의할 편집기 설정을 구성합니다.","이 설정은 언어별 구성을 지원하지 않습니다.","'{0}'을(를) 등록할 수 없습니다. 이는 언어별 편집기 설정을 설명하는 속성 패턴인 '\\\\[.*\\\\]$'과(와) 일치합니다. 'configurationDefaults' 기여를 사용하세요.","'{0}'을(를) 등록할 수 없습니다. 이 속성은 이미 등록되어 있습니다."],"vs/platform/keybinding/common/abstractKeybindingService":["({0})을(를) 눌렀습니다. 둘째 키는 잠시 기다렸다가 누르십시오...","키 조합({0}, {1})은 명령이 아닙니다."], +"vs/platform/list/browser/listService":["워크벤치","Windows와 Linux의 'Control'을 macOS의 'Command'로 매핑합니다.","Windows와 Linux의 'Alt'를 macOS의 'Option'으로 매핑합니다.","마우스로 트리와 목록의 항목을 다중 선택에 추가할 때 사용할 한정자입니다(예를 들어 탐색기에서 편집기와 SCM 보기를 여는 경우). '옆에서 열기' 마우스 제스처(지원되는 경우)는 다중 선택 한정자와 충돌하지 않도록 조정됩니다.","트리와 목록에서 마우스를 사용하여 항목을 여는 방법을 제어합니다(지원되는 경우). 트리에서 자식 항목이 있는 부모 항목의 경우 이 설정은 부모 항목을 한 번 클릭으로 확장할지 또는 두 번 클릭으로 확장할지 여부를 제어합니다. 일부 트리와 목록에서는 이 설정을 적용할 수 없는 경우 무시하도록 선택할 수 있습니다. ","워크벤치에서 목록 및 트리의 가로 스크롤 여부를 제어합니다. 경고: 이 설정을 켜면 성능에 영향을 미칩니다.","트리 들여쓰기를 픽셀 단위로 제어합니다.","트리에서 들여쓰기 가이드를 렌더링할지 여부를 제어합니다.","목록과 트리에 부드러운 화면 이동 기능이 있는지를 제어합니다.","간단한 키보드 탐색에서는 키보드 입력과 일치하는 요소에 집중합니다. 일치는 접두사에서만 수행됩니다.","키보드 탐색 강조 표시에서는 키보드 입력과 일치하는 요소를 강조 표시합니다. 이후로 탐색에서 위 및 아래로 이동하는 경우 강조 표시된 요소만 트래버스합니다.","키보드 탐색 필터링에서는 키보드 입력과 일치하지 않는 요소를 모두 필터링하여 숨깁니다.","워크벤치의 목록 및 트리 키보드 탐색 스타일을 제어합니다. 간소화하고, 강조 표시하고, 필터링할 수 있습니다.","목록 및 트리에서 키보드 탐색이 입력만으로 자동 트리거되는지 여부를 제어합니다. 'false'로 설정하면 'list.toggleKeyboardNavigation' 명령을 실행할 때만 키보드 탐색이 트리거되어 바로 가기 키를 할당할 수 있습니다."], +"vs/platform/markers/common/markers":["오류","경고","정보"],"vs/platform/quickinput/browser/commandsQuickAccess":["{0}, {1}","최근에 사용한 항목","기타 명령","명령 '{0}'에서 오류({1})가 발생했습니다."],"vs/platform/quickinput/browser/helpQuickAccess":["전역 명령","편집기 명령","{0}, {1}"], +"vs/platform/theme/common/colorRegistry":["전체 전경색입니다. 이 색은 구성 요소에서 재정의하지 않은 경우에만 사용됩니다.","오류 메시지에 대한 전체 전경색입니다. 이 색은 구성 요소에서 재정의하지 않은 경우에만 사용됩니다.","워크벤치 아이콘의 기본 색상입니다.","포커스가 있는 요소의 전체 테두리 색입니다. 이 색은 구성 요소에서 재정의하지 않은 경우에만 사용됩니다.","더 뚜렷이 대비되도록 요소를 다른 요소와 구분하는 요소 주위의 추가 테두리입니다.","더 뚜렷이 대비되도록 요소를 다른 요소와 구분하는 활성 요소 주위의 추가 테두리입니다.","텍스트 내 링크의 전경색입니다.","텍스트 내 코드 블록의 전경색입니다.","편집기 내에서 찾기/바꾸기 같은 위젯의 그림자 색입니다.","입력 상자 배경입니다.","입력 상자 전경입니다.","입력 상자 테두리입니다.","입력 필드에서 활성화된 옵션의 테두리 색입니다.","입력 필드에서 활성화된 옵션의 배경색입니다.","입력 필드에서 활성화된 옵션의 전경색입니다.","정보 심각도의 입력 유효성 검사 배경색입니다.","정보 심각도의 입력 유효성 검사 전경색입니다.","정보 심각도의 입력 유효성 검사 테두리 색입니다.","경고 심각도의 입력 유효성 검사 배경색입니다.","경고 심각도의 입력 유효성 검사 전경색입니다.","경고 심각도의 입력 유효성 검사 테두리 색입니다.","오류 심각도의 입력 유효성 검사 배경색입니다.","오류 심각도의 입력 유효성 검사 전경색입니다.","오류 심각도의 입력 유효성 검사 테두리 색입니다.","드롭다운 배경입니다.","드롭다운 전경입니다.","단추 기본 전경색입니다.","단추 배경색입니다.","마우스로 가리킬 때 단추 배경색입니다.","배지 배경색입니다. 배지는 검색 결과 수와 같은 소량의 정보 레이블입니다.","배지 전경색입니다. 배지는 검색 결과 수와 같은 소량의 정보 레이블입니다.","스크롤되는 보기를 나타내는 스크롤 막대 그림자입니다.","스크롤 막대 슬라이버 배경색입니다.","마우스로 가리킬 때 스크롤 막대 슬라이더 배경색입니다.","클릭된 상태일 때 스크롤 막대 슬라이더 배경색입니다.","장기 작업을 대상으로 표시될 수 있는 진행률 표시줄의 배경색입니다.","편집기 내 오류 표시선의 전경색입니다.","편집기에서 오류 상자의 테두리 색입니다.","편집기 내 경고 표시선의 전경색입니다.","편집기에서 경고 상자의 테두리 색입니다.","편집기 내 정보 표시선의 전경색입니다.","편집기에서 정보 상자의 테두리 색입니다.","편집기에서 힌트 표시선의 전경색입니다.","편집기에서 힌트 상자의 테두리 색입니다.","편집기 배경색입니다.","편집기 기본 전경색입니다.","찾기/바꾸기 같은 편집기 위젯의 배경색입니다.","찾기/바꾸기와 같은 편집기 위젯의 전경색입니다.","편집기 위젯의 테두리 색입니다. 위젯에 테두리가 있고 위젯이 색상을 무시하지 않을 때만 사용됩니다.","편집기 위젯 크기 조정 막대의 테두리 색입니다. 이 색은 위젯에서 크기 조정 막대를 표시하도록 선택하고 위젯에서 색을 재지정하지 않는 경우에만 사용됩니다.","빠른 선택기 배경색. 빠른 선택기 위젯은 명령 팔레트와 같은 선택기를 위한 컨테이너입니다.","빠른 선택기 전경색. 이 빠른 선택기 위젯은 명령 팔레트와 같은 선택기를 위한 컨테이너입니다.","빠른 선택기 제목 배경색. 이 빠른 선택기 위젯은 명령 팔레트와 같은 선택기를 위한 컨테이너입니다.","그룹화 레이블에 대한 빠른 선택기 색입니다.","그룹화 테두리에 대한 빠른 선택기 색입니다.","편집기 선택 영역의 색입니다.","고대비를 위한 선택 텍스트의 색입니다.","비활성 편집기의 선택 항목 색입니다. 기본 장식을 숨기지 않도록 색은 불투명하지 않아야 합니다.","선택 영역과 동일한 콘텐츠가 있는 영역의 색입니다. 기본 장식을 숨기지 않도록 색은 불투명하지 않아야 합니다.","선택 영역과 동일한 콘텐츠가 있는 영역의 테두리 색입니다.","현재 검색 일치 항목의 색입니다.","기타 검색 일치 항목의 색입니다. 기본 장식을 숨기지 않도록 색은 불투명하지 않아야 합니다.","검색을 제한하는 범위의 색입니다. 기본 장식을 숨기지 않도록 색은 불투명하지 않아야 합니다.","현재 검색과 일치하는 테두리 색입니다.","다른 검색과 일치하는 테두리 색입니다.","검색을 제한하는 범위의 테두리 색입니다. 기본 장식을 숨기지 않도록 색은 불투명하지 않아야 합니다.","호버가 표시된 단어 아래를 강조 표시합니다. 기본 장식을 숨기지 않도록 색은 불투명하지 않아야 합니다.","편집기 호버의 배경색.","편집기 호버의 전경색입니다.","편집기 호버의 테두리 색입니다.","편집기 호버 상태 표시줄의 배경색입니다.","활성 링크의 색입니다.","전구 작업 아이콘에 사용되는 색상입니다.","전구 자동 수정 작업 아이콘에 사용되는 색상입니다.","삽입된 텍스트의 배경색입니다. 기본 장식을 숨기지 않도록 색은 불투명하지 않아야 합니다.","제거된 텍스트 배경색입니다. 기본 장식을 숨기지 않도록 색은 불투명하지 않아야 합니다.","삽입된 텍스트의 윤곽선 색입니다.","제거된 텍스트의 윤곽선 색입니다.","두 텍스트 편집기 사이의 테두리 색입니다.","diff 편집기의 대각선 채우기 색입니다. 대각선 채우기는 diff 나란히 보기에서 사용됩니다.","목록/트리가 활성 상태인 경우 포커스가 있는 항목의 목록/트리 배경색입니다. 목록/트리가 활성 상태이면 키보드 포커스를 가지며, 비활성 상태이면 포커스가 없습니다.","목록/트리가 활성 상태인 경우 포커스가 있는 항목의 목록/트리 전경색입니다. 목록/트리가 활성 상태이면 키보드 포커스를 가지며, 비활성 상태이면 포커스가 없습니다.","목록/트리가 활성 상태인 경우 선택한 항목의 목록/트리 배경색입니다. 목록/트리가 활성 상태이면 키보드 포커스를 가지며, 비활성 상태이면 포커스가 없습니다.","목록/트리가 활성 상태인 경우 선택한 항목의 목록/트리 전경색입니다. 목록/트리가 활성 상태이면 키보드 포커스를 가지며, 비활성 상태이면 포커스가 없습니다.","목록/트리가 비활성 상태인 경우 선택한 항목의 목록/트리 배경색입니다. 목록/트리가 활성 상태이면 키보드 포커스를 가지며, 비활성 상태이면 포커스가 없습니다.","목록/트리가 비활성 상태인 경우 선택한 항목의 목록/트리 전경색입니다. 목록/트리가 활성 상태이면 키보드 포커스를 가지며, 비활성 상태이면 포커스가 없습니다.","목록/트리가 비활성 상태인 경우 포커스가 있는 항목의 목록/트리 배경색입니다. 목록/트리가 활성 상태이면 키보드 포커스를 가지며, 비활성 상태이면 포커스가 없습니다.","마우스로 항목을 가리킬 때 목록/트리 배경입니다.","마우스로 항목을 가리킬 때 목록/트리 전경입니다.","마우스로 항목을 이동할 때 목록/트리 끌어서 놓기 배경입니다.","목록/트리 내에서 검색할 때 일치 항목 강조 표시의 목록/트리 전경색입니다.","목록 및 트리에서 형식 필터 위젯의 배경색입니다.","목록 및 트리에서 형식 필터 위젯의 윤곽선 색입니다.","일치하는 항목이 없을 때 목록 및 트리에서 표시되는 형식 필터 위젯의 윤곽선 색입니다.","들여쓰기 가이드의 트리 스트로크 색입니다.","메뉴 테두리 색입니다.","메뉴 항목 전경색입니다.","메뉴 항목 배경색입니다.","메뉴의 선택된 메뉴 항목 전경색입니다.","메뉴의 선택된 메뉴 항목 배경색입니다.","메뉴의 선택된 메뉴 항목 테두리 색입니다.","메뉴에서 구분 기호 메뉴 항목의 색입니다.","코드 조각 탭 정지의 강조 표시 배경색입니다.","코드 조각 탭 정지의 강조 표시 테두리 색입니다.","코드 조각 마지막 탭 정지의 강조 표시 배경색입니다.","코드 조각 마지막 탭 정지의 강조 표시 배경색입니다.","일치 항목 찾기의 개요 눈금자 표식 색입니다. 기본 장식을 숨기지 않도록 색은 불투명하지 않아야 합니다.","선택 항목의 개요 눈금자 표식 색이 강조 표시됩니다. 기본 장식을 숨기지 않도록 색은 불투명하지 않아야 합니다.","일치하는 항목을 찾기 위한 미니맵 표식 색입니다.","편집기 선택 작업을 위한 미니맵 마커 색입니다.","오류에 대한 미니맵 마커 색상입니다.","경고의 미니맵 마커 색상입니다.","미니맵 배경색입니다.","미니맵 슬라이더 배경색입니다.","마우스로 가리킬 때 미니맵 슬라이더 배경색입니다.","클릭했을 때 미니맵 슬라이더 배경색입니다.","문제 오류 아이콘에 사용되는 색입니다.","문제 경고 아이콘에 사용되는 색입니다.","문제 정보 아이콘에 사용되는 색입니다."], +"vs/platform/undoRedo/common/undoRedoService":["{0} 파일이 닫히고 디스크에서 수정되었습니다.","{0} 파일은 호환되지 않는 방식으로 수정되었습니다.","모든 파일에서 '{0}'을(를) 실행 취소할 수 없습니다. {1}","모든 파일에서 '{0}'을(를) 실행 취소할 수 없습니다. {1}","{1}에 변경 내용이 적용되었으므로 모든 파일에서 '{0}'을(를) 실행 취소할 수 없습니다.","{1}에서 실행 취소 또는 다시 실행 작업이 이미 실행 중이므로 모든 파일에서 '{0}'을(를) 실행 취소할 수 없습니다.","그동안 실행 취소 또는 다시 실행 작업이 발생했기 때문에 모든 파일에서 '{0}'을(를) 실행 취소할 수 없습니다.","모든 파일에서 '{0}'을(를) 실행 취소하시겠습니까?","{0}개 파일에서 실행 취소","이 파일 실행 취소","취소","실행 취소 또는 다시 실행 작업이 이미 실행 중이므로 '{0}'을(를) 실행 취소할 수 없습니다.","모든 파일에서 '{0}'을(를) 다시 실행할 수 없습니다. {1}","모든 파일에서 '{0}'을(를) 다시 실행할 수 없습니다. {1}","{1}에 변경 내용이 적용되었으므로 모든 파일에서 '{0}'을(를) 다시 실행할 수 없습니다.","{1}에서 실행 취소 또는 다시 실행 작업이 이미 실행 중이므로 모든 파일에서 '{0}'을(를) 다시 실행할 수 없습니다.","그동안 실행 취소 또는 다시 실행 작업이 발생했기 때문에 모든 파일에서 '{0}'을(를) 다시 실행할 수 없습니다.","실행 취소 또는 다시 실행 작업이 이미 실행 중이므로 '{0}'을(를) 다시 실행할 수 없습니다."]}); +//# sourceMappingURL=../../../min-maps/vs/editor/editor.main.nls.ko.js.map \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/editor/editor.main.nls.ru.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/editor/editor.main.nls.ru.js new file mode 100644 index 0000000..c9d89f4 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/editor/editor.main.nls.ru.js @@ -0,0 +1,42 @@ +/*!----------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Version: 0.21.2(67b5a8116f3c0bace36b180e524e05bb750a16d8) + * Released under the MIT license + * https://github.com/Microsoft/vscode/blob/master/LICENSE.txt + *-----------------------------------------------------------*/ +define("vs/editor/editor.main.nls.ru",{"vs/base/browser/ui/actionbar/actionViewItems":["{0} ({1})"],"vs/base/browser/ui/findinput/findInput":["входные данные"],"vs/base/browser/ui/findinput/findInputCheckboxes":["С учетом регистра","Слово целиком","Использовать регулярное выражение"],"vs/base/browser/ui/findinput/replaceInput":["входные данные","Сохранить регистр"],"vs/base/browser/ui/inputbox/inputBox":["Ошибка: {0}","Предупреждение: {0}","Информация: {0}"],"vs/base/browser/ui/keybindingLabel/keybindingLabel":["свободный"],"vs/base/browser/ui/menu/menu":["{0} ({1})"],"vs/base/browser/ui/tree/abstractTree":["Сброс","Отключить фильтр по типу","Включить фильтр по типу","Элементы не найдены","Сопоставлено элементов: {0} из {1}"], +"vs/base/common/errorMessage":["{0}: {1}","Произошла системная ошибка ({0})","Произошла неизвестная ошибка. Подробные сведения см. в журнале.","Произошла неизвестная ошибка. Подробные сведения см. в журнале.","{0} (всего ошибок: {1})","Произошла неизвестная ошибка. Подробные сведения см. в журнале."],"vs/base/common/keybindingLabels":["CTRL","SHIFT","ALT","Windows","CTRL","SHIFT","ALT","Превосходно","CTRL","SHIFT","ALT","Команда","CTRL","SHIFT","ALT","Windows","CTRL","SHIFT","ALT","Превосходно"],"vs/base/parts/quickinput/browser/quickInput":["Назад","{0} / {1}","Введите текст, чтобы уменьшить число результатов.","Результаты: {0}","{0} выбрано","OK","Другой","Назад ({0})","Назад"],"vs/base/parts/quickinput/browser/quickInputList":["Быстрый ввод"],"vs/editor/browser/controller/coreCommands":["Размещать на конце даже для более длинных строк","Размещать на конце даже для более длинных строк"], +"vs/editor/browser/controller/textAreaHandler":["редактор","Сейчас редактор недоступен. Нажмите {0} для отображения вариантов."],"vs/editor/browser/editorExtensions":["&&Отменить","Отменить","&&Повторить","Вернуть","&&Выделить все","Выбрать все"],"vs/editor/browser/widget/codeEditorWidget":["Количество курсоров ограничено {0}."],"vs/editor/browser/widget/diffEditorWidget":["Нельзя сравнить файлы, потому что один из файлов слишком большой."],"vs/editor/browser/widget/diffReview":["Закрыть","нет измененных строк","1 строка изменена","Строк изменено: {0}","Различие {0} из {1}: исходная строка {2}, {3}, измененная строка {4}, {5}","пустой","{0} неизмененная строка {1}","{0} исходная строка {1} измененная строка {2}","+ {0} измененная строка {1}","- {0} исходная строка {1}","Перейти к следующему различию","Перейти к предыдущему различию"], +"vs/editor/browser/widget/inlineDiffMargin":["Копировать удаленные строки","Копировать удаленную строку","Копировать удаленную строку ({0})","Отменить это изменение","Копировать удаленную строку ({0})"], +"vs/editor/common/config/commonEditorConfig":["Редактор",'Число пробелов в табуляции. Этот параметр переопределяется на основе содержимого файла, если установлен параметр "#editor.detectIndentation#".','Вставлять пробелы при нажатии клавиши TAB. Этот параметр переопределяется на основе содержимого файла, если установлен параметр "#editor.detectIndentation#". ','Управляет тем, будут ли параметры "#editor.tabSize#" и "#editor.insertSpaces#" определяться автоматически при открытии файла на основе содержимого файла.',"Удалить автоматически вставляемый конечный пробел.","Специальная обработка для больших файлов с отключением некоторых функций, которые интенсивно используют память.","Определяет, следует ли оценивать завершения на основе слов в документе.","Семантическое выделение включено для всех цветовых тем.","Семантическое выделение отключено для всех цветовых тем.",'Семантическое выделение настраивается с помощью параметра "semanticHighlighting" текущей цветовой темы.',"Определяет показ семантической подсветки для языков, поддерживающих ее.","Оставлять быстрый редактор открытым даже при двойном щелчке по его содержимому и при нажатии ESC.","Строки, длина которых превышает указанное значение, не будут размечены из соображений производительности","Время ожидания в миллисекундах, по истечении которого вычисление несовпадений отменяется. Укажите значение 0, чтобы не использовать время ожидания.","Определяет, как редактор несовпадений отображает отличия: рядом или в тексте.","Когда параметр включен, редактор несовпадений игнорирует изменения начального или конечного пробела.","Определяет, должны ли в редакторе отображаться индикаторы +/- для добавленных или удаленных изменений.","Определяет, отображается ли CodeLens в редакторе."], +"vs/editor/common/config/editorOptions":["Редактор будет определять, подключено ли средство чтения с экрана, с помощью API-интерфейсов платформы.","Редактор будет оптимизирован для использования со средством чтения с экрана в постоянном режиме.","Редактор никогда не будет оптимизироваться для использования со средством чтения с экрана.","Определяет, следует ли запустить редактор в режиме оптимизации для средства чтения с экрана.","Определяет, вставляется ли пробел при комментировании.","Определяет, должны ли пустые строки игнорироваться с помощью действий переключения, добавления или удаления для комментариев к строкам.","Управляет тем, копируется ли текущая строка при копировании без выделения.","Определяет, должен ли курсор перемещаться для поиска совпадений при вводе.","Определяет, можно ли передать строку поиска в мини-приложение поиска из текста, выделенного в редакторе.",'Никогда не включать функцию "Найти в выделении" автоматически (по умолчанию)','Всегда включать функцию "Найти в выделении" автоматически','Автоматическое включение функции "Найти в выделении" при выборе нескольких строк содержимого.',"Управляет условием автоматического включения поиска в выделенном фрагменте.","Определяет, должно ли мини-приложение поиска считывать или изменять общий буфер обмена поиска в macOS.","Определяет, должно ли мини-приложение поиска добавлять дополнительные строки в начале окна редактора. Если задано значение true, вы можете прокрутить первую строку при отображаемом мини-приложении поиска.","Определяет, будет ли поиск автоматически перезапускаться с начала (или с конца), если не найдено никаких других соответствий.","Включает/отключает лигатуры шрифта.","Явные параметры для функций шрифтов.","Настраивает лигатуры или функции шрифтов.","Определяет размер шрифта в пикселях.",'Допускаются только ключевые слова "normal" или "bold" и числа в диапазоне от 1 до 1000.','Управляет насыщенностью шрифта. Допустимые значения: ключевые слова "normal" или "bold", а также числа в диапазоне от 1 до 1000.',"Показать предварительные результаты (по умолчанию)","Перейти к основному результату и показать быстрый редактор","Перейдите к основному результату и включите быструю навигацию для остальных","Этот параметр устарел. Используйте вместо него отдельные параметры, например, 'editor.editor.gotoLocation.multipleDefinitions' или 'editor.editor.gotoLocation.multipleImplementations'.",'Управляет поведением команды "Перейти к определению" при наличии нескольких целевых расположений.','Управляет поведением команды "Перейти к определению типа" при наличии нескольких целевых расположений.','Управляет поведением команды "Перейти к объявлению" при наличии нескольких целевых расположений.','Управляет поведением команды "Перейти к реализациям" при наличии нескольких целевых расположений.','Управляет поведением команды "Перейти к ссылкам" при наличии нескольких целевых расположений.','Идентификатор альтернативной команды, выполняемой в том случае, когда результатом операции "Перейти к определению" является текущее расположение.','Идентификатор альтернативной команды, которая выполняется в том случае, если результатом операции "Перейти к определению типа" является текущее расположение.','Идентификатор альтернативный команды, выполняемой в том случае, когда результатом операции "Перейти к объявлению" является текущее расположение.','Идентификатор альтернативный команды, выполняемой, когда результатом команды "Перейти к реализации" является текущее расположение.','Идентификатор альтернативной команды, выполняемой в том случае, когда результатом выполнения операции "Перейти к ссылке" является текущее расположение.',"Управляет тем, отображается ли наведение.","Определяет время задержки в миллисекундах перед отображением наведения.","Управляет тем, должно ли наведение оставаться видимым при наведении на него курсора мыши.","Включает индикатор действия кода в редакторе.","Управляет высотой строк. Укажите 0 для вычисления высоты строки по размеру шрифта.","Определяет, отображается ли мини-карта.","Мини-карта имеет такой же размер, что и содержимое редактора (возможна прокрутка).","Мини-карта будет растягиваться или сжиматься по мере необходимости, чтобы заполнить редактор по высоте (без прокрутки).","Миникарта будет уменьшаться по мере необходимости, чтобы никогда не быть больше, чем редактор (без прокрутки).","Управляет размером миникарты.","Определяет, с какой стороны будет отображаться мини-карта.","Определяет, когда отображается ползунок мини-карты.","Масштаб содержимого, нарисованного на мини-карте: 1, 2 или 3.","Отображает фактические символы в строке вместо цветных блоков.","Ограничивает ширину мини-карты, чтобы количество отображаемых столбцов не превышало определенное количество.","Задает пространство между верхним краем редактора и первой строкой.","Задает пространство между нижним краем редактора и последней строкой.","Включает всплывающее окно с документацией по параметру и сведениями о типе, которое отображается во время набора.","Определяет, меню подсказок остается открытым или закроется при достижении конца списка.","Разрешение кратких предложений в строках.","Разрешение кратких предложений в комментариях.","Разрешение кратких предложений вне строк и комментариев.","Определяет, должны ли при вводе текста автоматически отображаться предложения.","Номера строк не отображаются.","Отображаются абсолютные номера строк.","Отображаемые номера строк вычисляются как расстояние в строках до положения курсора.","Номера строк отображаются каждые 10 строк.","Управляет отображением номеров строк.","Число моноширинных символов, при котором будет отрисовываться линейка этого редактора.","Цвет линейки этого редактора.","Отображать вертикальные линейки после определенного числа моноширинных символов. Для отображения нескольких линеек укажите несколько значений. Если не указано ни одного значения, вертикальные линейки отображаться не будут.","Вставить предложение без перезаписи текста справа от курсора.","Вставить предложение и перезаписать текст справа от курсора.","Определяет, будут ли перезаписываться слова при принятии вариантов завершения. Обратите внимание, что это зависит от расширений, использующих эту функцию.","Управляет тем, допускаются ли небольшие опечатки в предложениях фильтрации и сортировки.","Определяет, следует ли учитывать при сортировке слова, расположенные рядом с курсором.",'Определяет, используются ли сохраненные варианты выбора предложений совместно несколькими рабочими областями и окнами (требуется "#editor.suggestSelection#").',"Определяет, запрещает ли активный фрагмент кода экспресс-предложения.","Указывает, нужно ли отображать значки в предложениях.","Определяет, сколько предложений IntelliSense будет показано до отображения полосы прокрутки (максимум 15).","Этот параметр устарел. Используйте вместо него отдельные параметры, например, 'editor.suggest.showKeywords' или 'editor.suggest.showSnippets'.",'Когда параметр включен, в IntelliSense отображаются предложения "method".','Когда параметр включен, в IntelliSense отображаются предложения "function".','Когда параметр включен, в IntelliSense отображаются предложения "constructor".','Когда параметр включен, в IntelliSense отображаются предложения "field".','Когда параметр включен, в IntelliSense отображаются предложения "variable".','Когда параметр включен, в IntelliSense отображаются предложения "class".','Когда параметр включен, в IntelliSense отображаются предложения "struct".','Когда параметр включен, в IntelliSense отображаются предложения "interface".','Когда параметр включен, в IntelliSense отображаются предложения "module".','Когда параметр включен, в IntelliSense отображаются предложения "property".','Когда параметр включен, в IntelliSense отображаются предложения "event".','Когда параметр включен, в IntelliSense отображаются предложения "operator".','Когда параметр включен, в IntelliSense отображаются предложения "unit".','Когда параметр включен, в IntelliSense отображаются предложения "value".','Когда параметр включен, в IntelliSense отображаются предложения "constant".','Когда параметр включен, в IntelliSense отображаются предложения "enum".','Когда параметр включен, в IntelliSense отображаются предложения "enumMember".','Когда параметр включен, в IntelliSense отображаются предложения "keyword".','Когда параметр включен, в IntelliSense отображаются предложения "text".','Когда параметр включен, в IntelliSense отображаются предложения "color".','Когда параметр включен, в IntelliSense отображаются предложения "file".','Когда параметр включен, в IntelliSense отображаются предложения "reference".','Когда параметр включен, в IntelliSense отображаются предложения "customcolor".','Когда параметр включен, в IntelliSense отображаются предложения "folder".','Когда параметр включен, в IntelliSense отображаются предложения "typeParameter".','Когда параметр включен, в IntelliSense отображаются предложения "snippet".','Во включенном состоянии IntelliSense показывает предложения типа "пользователи".','Во включенном состоянии IntelliSense отображает предложения типа "проблемы".',"Определяет видимость строки состояния в нижней части виджета предложений.",'Определяет, будут ли предложения приниматься при вводе символов фиксации. Например, в JavaScript точка с запятой (";") может быть символом фиксации, при вводе которого предложение принимается.',"Принимать предложение при нажатии клавиши ВВОД только в том случае, если оно изменяет текст.","Определяет, будут ли предложения приниматься клавишей ВВОД в дополнение к клавише TAB. Это помогает избежать неоднозначности между вставкой новых строк и принятием предложений.","Задает количество строк в редакторе, которые могут быть прочитаны средством чтения с экрана. Предупреждение: из-за технических ограничений этот число не может превышать значение по умолчанию.","Содержимое редактора","Использовать конфигурации языка для автоматического закрытия скобок.","Автоматически закрывать скобки только в том случае, если курсор находится слева от пробела.","Определяет, должен ли редактор автоматически добавлять закрывающую скобку при вводе пользователем открывающей скобки.","Заменять закрывающие кавычки и скобки при вводе только в том случае, если кавычки или скобки были вставлены автоматически.","Определяет, должны ли в редакторе заменяться закрывающие кавычки или скобки при вводе.","Использовать конфигурации языка для автоматического закрытия кавычек.","Автоматически закрывать кавычки только в том случае, если курсор находится слева от пробела.","Определяет, должен ли редактор автоматически закрывать кавычки, если пользователь добавил открывающую кавычку.","Редактор не будет вставлять отступы автоматически.","Редактор будет сохранять отступ текущей строки.","Редактор будет сохранять отступы текущей строки и учитывать скобки в соответствии с синтаксисом языка.","Редактор будет сохранять отступ текущей строки, учитывать определенные языком скобки и вызывать специальные правила onEnterRules, определяемые языками.","Редактор будет сохранять отступ текущей строки, учитывать определенные языком скобки, вызывать специальные правила onEnterRules, определяемые языками и учитывать правила отступа indentationRules, определяемые языками.","Определяет, должен ли редактор автоматически изменять отступы, когда пользователи вводят, вставляют или перемещают текст или изменяют отступы строк.","Использовать конфигурации языка для автоматического обрамления выделений.","Обрамлять с помощью кавычек, а не скобок.","Обрамлять с помощью скобок, а не кавычек.","Определяет, должен ли редактор автоматически обрамлять выделения.","Определяет, отображается ли CodeLens в редакторе.","Определяет, должны ли в редакторе отображаться внутренние декораторы цвета и средство выбора цвета.","Включение того, что выбор с помощью клавиатуры и мыши приводит к выбору столбца.","Определяет, будет ли текст скопирован в буфер обмена с подсветкой синтаксиса.","Управляет стилем анимации курсора.","Управляет тем, следует ли включить плавную анимацию курсора.","Управляет стилем курсора.",'Определяет минимальное число видимых начальных и конечных линий, окружающих курсор. Этот параметр имеет название "scrollOff" или "scrollOffset" в некоторых других редакторах.','"cursorSurroundingLines" применяется только при запуске с помощью клавиатуры или API.','"cursorSurroundingLines" принудительно применяется во всех случаях.','Определяет, когда необходимо применять "cursorSurroundingLines".',"Управляет шириной курсора, когда для параметра \"#editor.cursorStyle#\" установлено значение 'line'","Определяет, следует ли редактору разрешить перемещение выделенных элементов с помощью перетаскивания.","Коэффициент увеличения скорости прокрутки при нажатии клавиши ALT.","Определяет, включено ли свертывание кода в редакторе.","Используйте стратегию свертывания для конкретного языка, если она доступна, в противном случае используйте стратегию на основе отступов.","Используйте стратегию свертывания на основе отступов.","Управляет стратегией для вычисления свертываемых диапазонов.","Определяет, должен ли редактор выделять сложенные диапазоны.","Определяет, будет ли щелчок пустого содержимого после свернутой строки развертывать ее.","Определяет семейство шрифтов.","Определяет, будет ли редактор автоматически форматировать вставленное содержимое. Модуль форматирования должен быть доступен и иметь возможность форматировать диапазон в документе.","Управляет параметром, определяющим, должен ли редактор автоматически форматировать строку после ввода.","Управляет отображением вертикальных полей глифа в редакторе. Поля глифа в основном используются для отладки.","Управляет скрытием курсора в обзорной линейке.","Управляет тем, должна ли выделяться активная направляющая отступа в редакторе.","Управляет интервалом между буквами в пикселях.","Определяет, должен ли редактор определять ссылки и делать их доступными для щелчка.","Выделять соответствующие скобки.","Множитель, используемый для параметров deltaX и deltaY событий прокрутки колесика мыши.","Изменение размера шрифта в редакторе при нажатой клавише CTRL и движении колесика мыши.","Объединить несколько курсоров, когда они перекрываются.","Соответствует клавише CTRL в Windows и Linux и клавише COMMAND в macOS.","Соответствует клавише ALT в Windows и Linux и клавише OPTION в macOS.",'Модификатор, который будет использоваться для добавления нескольких курсоров с помощью мыши. Жесты мыши "Перейти к определению" и "Открыть ссылку" будут изменены так, чтобы они не конфликтовали с несколькими курсорами. [Дополнительные сведения](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier). ',"Каждый курсор вставляет одну строку текста.","Каждый курсор вставляет полный текст.","Управляет вставкой, когда число вставляемых строк соответствует числу курсоров.","Определяет, должен ли редактор выделять экземпляры семантических символов.","Определяет, должна ли отображаться граница на обзорной линейке.","Фокусировка на дереве при открытии обзора","Фокусировка на редакторе при открытии обзора","Определяет, следует ли переключить фокус на встроенный редактор или дерево в виджете обзора.","Определяет, всегда ли жест мышью для перехода к определению открывает мини-приложение быстрого редактирования.","Управляет длительностью задержки (в мс) перед отображением кратких предложений.","Определяет, выполняет ли редактор автоматическое переименование по типу.","Определяет, должны ли в редакторе отображаться управляющие символы.","Определяет, должны ли в редакторе отображаться направляющие отступа.","Отображение номера последней строки, когда файл заканчивается новой строкой.","Выделяет поле и текущую строку.","Определяет, должен ли редактор выделять текущую строку.","Определяет, должен ли редактор отрисовывать выделение текущей строки, только когда он находится в фокусе","Отрисовка пробелов, кроме одиночных пробелов между словами.","Отображать пробелы только в выделенном тексте.","Отображать только конечные пробелы","Определяет, должны ли в редакторе отображаться пробелы.","Управляет тем, необходимо ли отображать скругленные углы для выделения.","Управляет количеством дополнительных символов, на которое содержимое редактора будет прокручиваться по горизонтали.","Определяет, будет ли содержимое редактора прокручиваться за последнюю строку.","Прокрутка только вдоль основной оси при прокрутке по вертикали и горизонтали одновременно. Предотвращает смещение по горизонтали при прокрутке по вертикали на трекпаде.","Контролирует, следует ли поддерживать первичный буфер обмена Linux.","Определяет, должен ли редактор выделять совпадения, аналогичные выбранному фрагменту.","Всегда показывать свертываемые элементы управления.","Показывать только элементы управления свертывания, когда указатель мыши находится над переплетом.","Определяет, когда элементы управления свертывания отображаются на переплете.","Управляет скрытием неиспользуемого кода.","Управляет перечеркиванием устаревших переменных.","Отображать предложения фрагментов поверх других предложений.","Отображать предложения фрагментов под другими предложениями.","Отображать предложения фрагментов рядом с другими предложениями.","Не отображать предложения фрагментов.","Управляет отображением фрагментов вместе с другими предложениями и их сортировкой.","Определяет, будет ли использоваться анимация при прокрутке содержимого редактора",'Размер шрифта мини-приложения с предложениями. Если установить значение "0", будет использовано значение "#editor.fontSize#".','Высота строки мини-приложения с предложениями. Если установить значение "0", будет использовано значение "#editor.lineHeight#".',"Определяет, должны ли при вводе триггерных символов автоматически отображаться предложения.","Всегда выбирать первое предложение.",'Выбор недавних предложений, если только дальнейший ввод не приводит к использованию одного из них, например "console.| -> console.log", так как "log" недавно использовался для завершения.','Выбор предложений с учетом предыдущих префиксов, использованных для завершения этих предложений, например "co -> console" и "con -> const".',"Управляет предварительным выбором предложений при отображении списка предложений.","При использовании дополнения по TAB будет добавляться наилучшее предложение при нажатии клавиши TAB.","Отключить дополнение по TAB.",'Вставка дополнений по TAB при совпадении их префиксов. Функция работает оптимально, если параметр "quickSuggestions" отключен.',"Включает дополнения по TAB.","Необычные символы завершения строки игнорируются.","Для необычных символов завершения строки запрашивается удаление.","Необычные символы завершения строки автоматически удаляются.","Удалите необычные символы завершения строки, которые могут вызвать проблемы.","Вставка и удаление пробелов после позиции табуляции","Символы, которые будут использоваться как разделители слов при выполнении навигации или других операций, связанных со словами.","Строки не будут переноситься никогда.","Строки будут переноситься по ширине окна просмотра.",'Строки будут переноситься по "#editor.wordWrapColumn#".','Строки будут перенесены по минимальному значению из двух: ширина окна просмотра и "#editor.wordWrapColumn#".',"Управляет тем, как следует переносить строки.",'Определяет столбец переноса редактора, если значение "#editor.wordWrap#" — "wordWrapColumn" или "bounded".',"Без отступа. Перенос строк начинается со столбца 1.","Перенесенные строки получат тот же отступ, что и родительская строка.","Перенесенные строки получат отступ, увеличенный на единицу по сравнению с родительской строкой. ","Перенесенные строки получат отступ, увеличенный на два по сравнению с родительской строкой.","Управляет отступом строк с переносом по словам.","Предполагает, что все символы имеют одинаковую ширину. Это быстрый алгоритм, который работает правильно для моноширинных шрифтов и некоторых скриптов (например, латинских символов), где глифы имеют одинаковую ширину.","Делегирует вычисление точек переноса браузеру. Это медленный алгоритм, который может привести к зависаниям при обработке больших файлов, но работает правильно во всех случаях.","Управляет алгоритмом, вычисляющим точки переноса."], +"vs/editor/common/model/editStack":["Ввод"],"vs/editor/common/modes/modesRegistry":["Простой текст"], +"vs/editor/common/standaloneStrings":["Ничего не выбрано","Строка {0}, столбец {1} (выбрано: {2})","Строка {0}, столбец {1}","Выделений: {0} (выделено символов: {1})","Выделений: {0}",'Теперь для параметра "accessibilitySupport" устанавливается значение "вкл".',"Открывается страница документации о специальных возможностях редактора.","в панели только для чтения редактора несовпадений.","на панели редактора несовпадений."," в редакторе кода только для чтения"," в редакторе кода","Чтобы оптимизировать редактор для использования со средством чтения с экрана, нажмите COMMAND+E.","Чтобы оптимизировать редактор для использования со средством чтения с экрана, нажмите CTRL+E.","Редактор настроен для оптимальной работы со средством чтения с экрана.","Редактор настроен без оптимизации для использования средства чтения с экрана, что не подходит в данной ситуации.","При нажатии клавиши TAB в текущем редакторе фокус ввода переместится на следующий элемент, способный его принять. Чтобы изменить это поведение, нажмите клавишу {0}.","При нажатии клавиши TAB в текущем редакторе фокус ввода переместится на следующий элемент, способный его принять. Команду {0} сейчас невозможно выполнить с помощью настраиваемого сочетания клавиш.","При нажатии клавиши TAB в текущем редакторе будет вставлен символ табуляции. Чтобы изменить это поведение, нажмите клавишу {0}.","При нажатии клавиши TAB в текущем редакторе будет вставлен символ табуляции. Команду {0} сейчас невозможно выполнить с помощью настраиваемого сочетания клавиш.","Нажмите COMMAND+H, чтобы открыть окно браузера с дополнительной информацией о специальных возможностях редактора.","Нажмите CTRL+H, чтобы открыть окно браузера с дополнительной информацией о специальных возможностях редактора.","Вы можете закрыть эту подсказку и вернуться в редактор, нажав клавиши ESCAPE или SHIFT+ESCAPE.","Показать справку по специальным возможностям","Разработчик: проверить токены","Перейти к строке/столбцу...","Показать всех поставщиков быстрого доступа","Палитра команд","Показать и выполнить команды","Перейти к символу...","Перейти к символу по категориям...","Содержимое редактора","Нажмите ALT+F1 для доступа к параметрам специальных возможностей.","Переключить высококонтрастную тему","Внесено изменений в файлах ({1}): {0}."], +"vs/editor/common/view/editorColorRegistry":["Цвет фона для выделения строки в позиции курсора.","Цвет фона границ вокруг строки в позиции курсора.","Цвет фона для выделенных диапазонов, например при использовании функций Quick Open или поиска. Цвет не должен быть непрозрачным, чтобы не скрыть расположенные ниже элементы оформления.","Цвет фона обводки выделения.",'Цвет фона выделенного символа, например, в функциях "Перейти к определению" или "Перейти к следующему/предыдущему символу". Цвет должен быть прозрачным, чтобы не скрывать оформление текста под ним.',"Цвет фона для границы вокруг выделенных символов.","Цвет курсора редактора.","Цвет фона курсора редактора. Позволяет настраивать цвет символа, перекрываемого прямоугольным курсором.","Цвет пробелов в редакторе.","Цвет направляющих для отступов редактора.","Цвет активных направляющих для отступов редактора.","Цвет номеров строк редактора.","Цвет номера активной строки редактора","Параметр 'Id' является устаревшим. Используйте вместо него параметр 'editorLineNumber.activeForeground'.","Цвет номера активной строки редактора","Цвет линейки редактора.","Цвет переднего плана элемента CodeLens в редакторе","Цвет фона парных скобок","Цвет прямоугольников парных скобок","Цвет границы для линейки в окне просмотра.","Цвет фона обзорной линейки редактора. Используется, только если мини-карта включена и размещена в правой части редактора.","Цвет фона поля в редакторе. В поле размещаются отступы глифов и номера строк.","Цвет границы для ненужного (неиспользуемого) исходного кода в редакторе.",'Непрозрачность ненужного (неиспользуемого) исходного кода в редакторе. Например, "#000000c0" отображает код с непрозрачностью 75 %. В высококонтрастных темах для выделения ненужного кода вместо затенения используйте цвет темы "editorUnnecessaryCode.border".',"Цвет маркера обзорной линейки для выделения диапазонов. Цвет не должен быть непрозрачным, чтобы не скрыть расположенные ниже элементы оформления.","Цвет метки линейки в окне просмотра для ошибок.","Цвет метки линейки в окне просмотра для предупреждений.","Цвет метки линейки в окне просмотра для информационных сообщений."], +"vs/editor/contrib/anchorSelect/anchorSelect":["Начальная точка выделения","Начальная точка установлена в {0}:{1}","Установить начальную точку выделения","Перейти к начальной точке выделения","Выделить текст от начальной точки выделения до курсора","Отменить начальную точку выделения"],"vs/editor/contrib/bracketMatching/bracketMatching":["Цвет метки линейки в окне просмотра для пар скобок.","Перейти к скобке","Выбрать скобку","Перейти к &&скобке"],"vs/editor/contrib/caretOperations/caretOperations":["Переместить выделенный текст влево","Переместить выделенный текст вправо"],"vs/editor/contrib/caretOperations/transpose":["Транспортировать буквы"],"vs/editor/contrib/clipboard/clipboard":["&&Вырезать","Вырезать","Вырезать","&&Копировать","Копирование","Копирование","&&Вставить","Вставить","Вставить","Копировать с выделением синтаксиса"], +"vs/editor/contrib/codeAction/codeActionCommands":["Тип запускаемого действия кода.","Определяет, когда применяются возвращенные действия.","Всегда применять первое возвращенное действие кода.","Применить первое действие возвращенного кода, если оно является единственным.","Не применять действия возвращенного кода.","Определяет, следует ли возвращать только предпочтительные действия кода.","При применении действия кода произошла неизвестная ошибка","Быстрое исправление...","Доступные действия кода отсутствуют",'Нет доступных предпочтительных действий кода для "{0}".','Действия кода для "{0}" недоступны',"Нет доступных предпочтительных действий кода","Доступные действия кода отсутствуют","Рефакторинг...",'Нет доступных предпочтительных рефакторингов для "{0}"','Нет доступного рефакторинга для "{0}"',"Нет доступных предпочтительных рефакторингов","Доступные операции рефакторинга отсутствуют","Действие с исходным кодом...","Нет доступных предпочтительных действий источника для '{0}'",'Нет доступных исходных действий для "{0}"',"Предпочтительные действия источника недоступны","Доступные исходные действия отсутствуют","Организация импортов","Действие для упорядочения импортов отсутствует","Исправить все","Нет доступного действия по общему исправлению","Автоисправление...","Нет доступных автоисправлений"], +"vs/editor/contrib/codeAction/lightBulbWidget":["Отображение исправлений. Доступно предпочитаемое исправление ({0})","Показать исправления ({0})","Показать исправления"],"vs/editor/contrib/codelens/codelensController":["Показать команды CodeLens для текущей строки"],"vs/editor/contrib/comment/comment":["Закомментировать или раскомментировать строку","Переключить комментарий &&строки","Закомментировать строку","Раскомментировать строку","Закомментировать или раскомментировать блок","Переключить комментарий &&блока"],"vs/editor/contrib/contextmenu/contextmenu":["Показать контекстное меню редактора"],"vs/editor/contrib/cursorUndo/cursorUndo":["Отмена действия курсора","Повтор действия курсора"], +"vs/editor/contrib/documentSymbols/outlineTree":["Цвет переднего плана для символов массива. Эти символы отображаются в структуре, элементе навигации и мини-приложении предложений.","Цвет переднего плана для логических символов. Эти символы отображаются в структуре, элементе навигации и мини-приложении предложений.","Цвет переднего плана для символов класса. Эти символы отображаются в структуре, элементе навигации и мини-приложении предложений.","Цвет переднего плана для символов цвета. Эти символы отображаются в структуре, элементе навигации и мини-приложении предложений.","Цвет переднего плана для символов константы. Эти символы отображаются в структуре, элементе навигации и мини-приложении предложений.","Цвет переднего плана для символов конструктора. Эти символы отображаются в структуре, элементе навигации и мини-приложении предложений.","Цвет переднего плана для символов перечислителя. Эти символы отображаются в структуре, элементе навигации и мини-приложении предложений.","Цвет переднего плана для символов члена перечислителя. Эти символы отображаются в структуре, элементе навигации и мини-приложении предложений.","Цвет переднего плана для символов события. Эти символы отображаются в структуре, элементе навигации и мини-приложении предложений.","Цвет переднего плана для символов поля. Эти символы отображаются в структуре, элементе навигации и мини-приложении предложений.","Цвет переднего плана для символов файла. Эти символы отображаются в структуре, элементе навигации и мини-приложении предложений.","Цвет переднего плана для символов папки. Эти символы отображаются в структуре, элементе навигации и мини-приложении предложений.","Цвет переднего плана для символов функции. Эти символы отображаются в структуре, элементе навигации и мини-приложении предложений.","Цвет переднего плана для символов интерфейса. Эти символы отображаются в структуре, элементе навигации и мини-приложении предложений.","Цвет переднего плана для символов ключа. Эти символы отображаются в структуре, элементе навигации и мини-приложении предложений.","Цвет переднего плана для символов ключевого слова. Эти символы отображаются в структуре, элементе навигации и мини-приложении предложений.","Цвет переднего плана для символов метода. Эти символы отображаются в структуре, элементе навигации и мини-приложении предложений.","Цвет переднего плана для символов модуля. Эти символы отображаются в структуре, элементе навигации и мини-приложении предложений.","Цвет переднего плана для символов пространства имен. Эти символы отображаются в структуре, элементе навигации и мини-приложении предложений.","Цвет переднего плана для символов NULL. Эти символы отображаются в структуре, элементе навигации и мини-приложении предложений.","Цвет переднего плана для символов числа. Эти символы отображаются в структуре, элементе навигации и мини-приложении предложений.","Цвет переднего плана для символов объекта. Эти символы отображаются в структуре, элементе навигации и мини-приложении предложений.","Цвет переднего плана для символов оператора. Эти символы отображаются в структуре, элементе навигации и мини-приложении предложений.","Цвет переднего плана для символов пакета. Эти символы отображаются в структуре, элементе навигации и мини-приложении предложений.","Цвет переднего плана для символов свойства. Эти символы отображаются в структуре, элементе навигации и мини-приложении предложений.","Цвет переднего плана для символов ссылки. Эти символы отображаются в структуре, элементе навигации и мини-приложении предложений.","Цвет переднего плана для символов фрагмента кода. Эти символы отображаются в структуре, элементе навигации и мини-приложении предложений.","Цвет переднего плана для символов строки. Эти символы отображаются в структуре, элементе навигации и мини-приложении предложений.","Цвет переднего плана для символов структуры. Эти символы отображаются в структуре, элементе навигации и мини-приложении предложений.","Цвет переднего плана для символов текста. Эти символы отображаются в структуре, элементе навигации и мини-приложении предложений.","Цвет переднего плана для символов типа параметров. Эти символы отображаются в структуре, элементе навигации и мини-приложении предложений.","Цвет переднего плана для символов единиц. Эти символы отображаются в структуре, элементе навигации и мини-приложении предложений.","Цвет переднего плана для символов переменной. Эти символы отображаются в структуре, элементе навигации и мини-приложении предложений."], +"vs/editor/contrib/find/findController":["Найти","&&Найти","Найти в выбранном","Найти далее","Найти далее","Найти ранее","Найти ранее","Найти следующее выделение","Найти предыдущее выделение","Заменить","&&Заменить"],"vs/editor/contrib/find/findWidget":["Найти","Найти","Предыдущее соответствие","Следующее соответствие","Найти в выделении","Закрыть","Заменить","Заменить","Заменить","Заменить все",'Режим "Переключение замены"',"Отображаются только первые {0} результатов, но все операции поиска выполняются со всем текстом.","{0} из {1}","Результаты отсутствуют","{0} обнаружено",'{0} найден для "{1}"','{0} найден для "{1}", в {2}','{0} найден для "{1}"',"Теперь при нажатии клавиш CTRL+ВВОД вставляется символ перехода на новую строку вместо замены всего текста. Вы можете изменить сочетание клавиш editor.action.replaceAll, чтобы переопределить это поведение."], +"vs/editor/contrib/folding/folding":["Развернуть","Развернуть рекурсивно","Свернуть","Переключить свертывание","Свернуть рекурсивно","Свернуть все блоки комментариев","Свернуть все регионы","Развернуть все регионы","Свернуть все","Развернуть все","Уровень папки {0}","Цвет фона за свернутыми диапазонами. Этот цвет не должен быть непрозрачным, чтобы не скрывать расположенные ниже декоративные элементы.","Цвет элемента управления свертыванием во внутреннем поле редактора."],"vs/editor/contrib/fontZoom/fontZoom":["Увеличить шрифт редактора","Уменьшить шрифт редактора","Сбросить масштаб шрифта редактора"],"vs/editor/contrib/format/format":["Внесена одна правка форматирования в строке {0}.","Внесены правки форматирования ({0}) в строке {1}.","Внесена одна правка форматирования между строками {0} и {1}.","Внесены правки форматирования ({0}) между строками {1} и {2}."],"vs/editor/contrib/format/formatActions":["Форматировать документ","Форматировать выделенный фрагмент"], +"vs/editor/contrib/gotoError/gotoError":["Перейти к Следующей Проблеме (Ошибке, Предупреждению, Информации)","Перейти к Предыдущей Проблеме (Ошибке, Предупреждению, Информации)","Перейти к следующей проблеме в файлах (ошибки, предупреждения, информационные сообщения)","Следующая &&проблема","Перейти к предыдущей проблеме в файлах (ошибки, предупреждения, информационные сообщения)","Предыдущая &&проблема"],"vs/editor/contrib/gotoError/gotoErrorWidget":["Ошибка","Предупреждение","Информация","Указание","{0} в {1}. ","Проблемы: {0} из {1}","Проблемы: {0} из {1}","Цвет ошибки в мини-приложении навигации по меткам редактора.","Цвет предупреждения в мини-приложении навигации по меткам редактора.","Цвет информационного сообщения в мини-приложении навигации по меткам редактора.","Фон мини-приложения навигации по меткам редактора."], +"vs/editor/contrib/gotoSymbol/goToCommands":["Обзор","Определения",'Определение для "{0}" не найдено.',"Определения не найдены.","Перейти к определению","Перейти к &&определению","Открыть определение сбоку","Показать определение","Объявления",'Объявление для "{0}" не найдено.',"Объявление не найдено","Перейти к объявлению","Перейти к &&объявлению",'Объявление для "{0}" не найдено.',"Объявление не найдено","Просмотреть объявление","Определения типов",'Не найдено определение типа для "{0}".',"Не найдено определение типа.","Перейти к определению типа","Перейти к &&определению типа","Показать определение типа","Реализации",'Не найдена реализация для "{0}".',"Не найдена реализация.","Перейти к реализациям","Перейти к &&реализациям","Просмотреть реализации",'Ссылки для "{0}" не найдены',"Ссылки не найдены","Перейти к ссылкам","Перейти к &&ссылкам","Ссылки","Показать ссылки","Ссылки","Перейти к любому символу","Расположения",'Нет результатов для "{0}"',"Ссылки"], +"vs/editor/contrib/gotoSymbol/link/goToDefinitionAtPosition":["Щелкните, чтобы отобразить определения ({0})."],"vs/editor/contrib/gotoSymbol/peek/referencesController":["Загрузка...","{0} ({1})"],"vs/editor/contrib/gotoSymbol/peek/referencesTree":["Ссылок: {0}","{0} ссылка","Ссылки"],"vs/editor/contrib/gotoSymbol/peek/referencesWidget":["предварительный просмотр недоступен","Результаты отсутствуют","Ссылки"],"vs/editor/contrib/gotoSymbol/referencesModel":["ссылка в {0} в строке {1} и символе {2}","1 символ в {0}, полный путь: {1}","{0} символов в {1}, полный путь: {2} ","Результаты не найдены","Обнаружен 1 символ в {0}","Обнаружено {0} символов в {1}","Обнаружено {0} символов в {1} файлах"],"vs/editor/contrib/gotoSymbol/symbolNavigation":["Символ {0} из {1}, {2} для следующего","Символ {0} из {1}"],"vs/editor/contrib/hover/hover":["Показать при наведении","Отображать предварительный просмотр определения при наведении курсора мыши"], +"vs/editor/contrib/hover/modesContentHover":["Загрузка...","Проблема при обзоре","Проверка наличия исправлений...","Исправления недоступны","Быстрое исправление..."],"vs/editor/contrib/inPlaceReplace/inPlaceReplace":["Заменить предыдущим значением","Заменить следующим значением"],"vs/editor/contrib/indentation/indentation":["Преобразовать отступ в пробелы","Преобразовать отступ в шаги табуляции","Настроенный размер шага табуляции","Выбрать размер шага табуляции для текущего файла","Отступ с использованием табуляции","Отступ с использованием пробелов","Определение отступа от содержимого","Повторно расставить отступы строк","Повторно расставить отступы для выбранных строк"], +"vs/editor/contrib/linesOperations/linesOperations":["Копировать строку сверху","&&Копировать на строку выше","Копировать строку снизу","Копировать на строку &&ниже","Дублировать выбранное","&&Дублировать выбранное","Переместить строку вверх","Переместить на с&&троку выше","Переместить строку вниз","&&Переместить на строку ниже","Сортировка строк по возрастанию","Сортировка строк по убыванию","Удалить конечные символы-разделители","Удалить строку","Увеличить отступ","Уменьшить отступ","Вставить строку выше","Вставить строку ниже","Удалить все слева","Удалить все справа","_Объединить строки","Транспонировать символы вокруг курсора","Преобразовать в верхний регистр","Преобразовать в нижний регистр","Преобразовать в заглавные буквы"], +"vs/editor/contrib/links/links":["Выполнить команду","перейти по ссылке","Кнопка OPTION и щелчок левой кнопкой мыши","Кнопка CTRL и щелчок левой кнопкой мыши","Кнопка OPTION и щелчок левой кнопкой мыши","Кнопка ALT и щелчок левой кнопкой мыши","Не удалось открыть ссылку, так как она имеет неправильный формат: {0}","Не удалось открыть ссылку, у нее отсутствует целевой объект.","Открыть ссылку"],"vs/editor/contrib/message/messageController":["Не удается выполнить изменение в редакторе только для чтения"], +"vs/editor/contrib/multicursor/multicursor":["Добавить курсор выше","Добавить курсор &&выше","Добавить курсор ниже","Добавить курсор &&ниже","Добавить курсоры к окончаниям строк","Добавить курсоры в &&окончания строк","Добавить курсоры ниже","Добавить курсоры выше","Добавить выделение в следующее найденное совпадение","Добавить &&следующее вхождение","Добавить выделенный фрагмент в предыдущее найденное совпадение","Добавить &&предыдущее вхождение","Переместить последнее выделение в следующее найденное совпадение","Переместить последний выделенный фрагмент в предыдущее найденное совпадение","Выбрать все вхождения найденных совпадений","Выбрать все &&вхождения","Изменить все вхождения"],"vs/editor/contrib/parameterHints/parameterHints":["Переключить подсказки к параметрам"],"vs/editor/contrib/parameterHints/parameterHintsWidget":["{0}, указание"], +"vs/editor/contrib/peekView/peekView":["Закрыть","Цвет фона области заголовка быстрого редактора.","Цвет заголовка быстрого редактора.","Цвет сведений о заголовке быстрого редактора.","Цвет границ быстрого редактора и массива.","Цвет фона в списке результатов представления быстрого редактора.","Цвет переднего плана узлов строки в списке результатов быстрого редактора.","Цвет переднего плана узлов файла в списке результатов быстрого редактора.","Цвет фона выбранной записи в списке результатов быстрого редактора.","Цвет переднего плана выбранной записи в списке результатов быстрого редактора.","Цвет фона быстрого редактора.","Цвет фона поля в окне быстрого редактора.","Цвет выделения совпадений в списке результатов быстрого редактора.","Цвет выделения совпадений в быстром редакторе.","Граница выделения совпадений в быстром редакторе."], +"vs/editor/contrib/quickAccess/gotoLineQuickAccess":["Чтобы перейти к строке, сначала откройте текстовый редактор.","Перейдите к строке {0} и столбцу {1}.","Перейти к строке {0}.","Текущая строка: {0}, символ: {1}. Введите номер строки между 1 и {2} для перехода.","Текущая строка: {0}, символ: {1}. Введите номер строки для перехода."], +"vs/editor/contrib/quickAccess/gotoSymbolQuickAccess":["Чтобы перейти к символу, сначала откройте текстовый редактор с символьной информацией.","Активный текстовый редактор не предоставляет символьную информацию.","Нет совпадающих символов редактора","Нет символов редактора","Открыть сбоку","Открыть внизу","символы ({0})","свойства ({0})","методы ({0})","функции ({0})","конструкторы ({0})","переменные ({0})","классы ({0})","структуры ({0})","события ({0})","операторы ({0})","интерфейсы ({0})","пространства имен ({0})","пакеты ({0})","параметры типа ({0})","модули ({0})","свойства ({0})","перечисления ({0})","элемента перечисления ({0})","строки ({0})","файлы ({0})","массивы ({0})","числа ({0})","логические значения ({0})","объекты ({0})","ключи ({0})","поля ({0})","константы ({0})"],"vs/editor/contrib/rename/onTypeRename":["На символе переименования типа","Цвет фона при автоматическом переименовании типа редактором."], +"vs/editor/contrib/rename/rename":["Результаты отсутствуют.","Произошла неизвестная ошибка при определении расположения после переименования",'Переименование "{0}"',"Переименование {0}","«{0}» успешно переименован в «{1}». Сводка: {2}","Операции переименования не удалось применить правки","Операции переименования не удалось вычислить правки","Переименовать символ","Включить/отключить возможность предварительного просмотра изменений перед переименованием"],"vs/editor/contrib/rename/renameInputField":["Введите новое имя для входных данных и нажмите клавишу ВВОД для подтверждения.","Нажмите {0} для переименования, {1} для просмотра."],"vs/editor/contrib/smartSelect/smartSelect":["Развернуть выбранный фрагмент","&&Развернуть выделение","Уменьшить выделенный фрагмент","&&Сжать выделение"], +"vs/editor/contrib/snippet/snippetVariables":["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота","Вс","Пн","Вт","Ср","Чт","Пт","Сб","Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь","Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],"vs/editor/contrib/suggest/suggestController":['Принятие "{0}" привело к внесению дополнительных правок ({1})',"Переключить предложение","{0} для вставки","{0} для вставки","{0} для замены","{0} для замены","{0} для вставки","показать меньше","показать больше"],"vs/editor/contrib/suggest/suggestWidget":["Цвет фона виджета подсказок.","Цвет границ виджета подсказок.","Цвет переднего плана мини-приложения предложений.","Фоновый цвет выбранной записи в мини-приложении предложений.","Цвет выделения соответствия в мини-приложении предложений.","Показать больше ({0})","Показать меньше ({0})","Загрузка...","Загрузка...","Предложения отсутствуют.","{0}, документы: {1}","Предложить"], +"vs/editor/contrib/toggleTabFocusMode/toggleTabFocusMode":["Переключение клавиши TAB перемещает фокус.","При нажатии клавиши TAB фокус перейдет на следующий элемент, который может получить фокус","Теперь при нажатии клавиши TAB будет вставлен символ табуляции"],"vs/editor/contrib/tokenization/tokenization":["Разработчик: принудительная повторная установка токенов"],"vs/editor/contrib/unusualLineTerminators/unusualLineTerminators":["Необычные символы завершения строки","Обнаружены необычные символы завершения строки",'Этот файл содержит один или несколько необычных символов завершения строки, таких как разделитель строк (LS) или разделитель абзацев (PS).\r\n\r\nРекомендуется удалить их из файла. Удаление этих символов можно настроить с помощью параметра "editor.unusualLineTerminators".',"Исправить этот файл","Игнорировать проблему для этого файла"], +"vs/editor/contrib/wordHighlighter/wordHighlighter":["Цвет фона символа при доступе на чтение, например, при чтении переменной. Цвет не должен быть непрозрачным, чтобы не скрыть расположенные ниже элементы оформления.","Цвет фона для символа во время доступа на запись, например при записи в переменную. Цвет не должен быть непрозрачным, чтобы не скрыть расположенные ниже элементы оформления.","Цвет границы символа при доступе на чтение, например, при считывании переменной.","Цвет границы символа при доступе на запись, например, при записи переменной. ","Цвет маркера обзорной линейки для выделения символов. Этот цвет не должен быть непрозрачным, чтобы не скрывать расположенные ниже элементы оформления.","Цвет маркера обзорной линейки для выделения символов доступа на запись. Цвет не должен быть непрозрачным, чтобы не скрыть расположенные ниже элементы оформления.","Перейти к следующему выделению символов","Перейти к предыдущему выделению символов","Включить или отключить выделение символов"], +"vs/platform/actions/browser/menuEntryActionViewItem":["{0} ({1})"],"vs/platform/configuration/common/configurationRegistry":["Переопределения конфигурации языка по умолчанию","Настройка параметров редактора, переопределяемых для языка.","Этот параметр не поддерживает настройку для отдельных языков.","Невозможно зарегистрировать \"{0}\". Оно соответствует шаблону свойства '\\\\[.*\\\\]$' для описания параметров редактора, определяемых языком. Используйте участие configurationDefaults.",'Невозможно зарегистрировать "{0}". Это свойство уже зарегистрировано.'],"vs/platform/keybinding/common/abstractKeybindingService":["Была нажата клавиша {0}. Ожидание нажатия второй клавиши сочетания...","Сочетание клавиш ({0} и {1}) не является командой."], +"vs/platform/list/browser/listService":["Рабочее место","Соответствует клавише CTRL в Windows и Linux и клавише COMMAND в macOS.","Соответствует клавише ALT в Windows и Linux и клавише OPTION в macOS.",'Модификатор, который будет использоваться для добавления элементов в деревьях и списках в элемент множественного выбора с помощью мыши (например, в проводнике, в открытых редакторах и в представлении scm). Жесты мыши "Открыть сбоку" (если они поддерживаются) будут изменены таким образом, чтобы они не конфликтовали с модификатором элемента множественного выбора.',"Управляет тем, как открывать элементы в деревьях и списках с помощью мыши (если поддерживается). Для родительских элементов с дочерними элементами в деревьях этот параметр управляет тем, будет ли родительский элемент разворачиваться по одинарному или по двойному щелчку мыши. Обратите внимание, что этот параметр может игнорироваться в некоторых деревьях и списках, если он не применяется к ним. ","Определяет, поддерживают ли горизонтальную прокрутку списки и деревья на рабочем месте. Предупреждение! Включение этого параметра может повлиять на производительность.","Определяет отступ для дерева в пикселях.","Определяет, нужно ли в дереве отображать направляющие отступа.","Управляет тем, используется ли плавная прокрутка для списков и деревьев.","Про простой навигации с клавиатуры выбираются элементы, соответствующие вводимым с клавиатуры данным. Сопоставление осуществляется только по префиксам.","Функция подсветки навигации с клавиатуры выделяет элементы, соответствующие вводимым с клавиатуры данным. При дальнейшей навигации вверх и вниз выполняется обход только выделенных элементов.","Фильтр навигации с клавиатуры позволяет отфильтровать и скрыть все элементы, не соответствующие вводимым с клавиатуры данным.","Управляет стилем навигации с клавиатуры для списков и деревьев в Workbench. Доступен простой режим, режим выделения и режим фильтрации.",'Указывает, активируется ли навигация с помощью клавиатуры в списках и деревьях автоматически простым вводом. Если задано значение "false", навигация с клавиатуры активируется только при выполнении команды "list.toggleKeyboardNavigation", для которой можно назначить сочетание клавиш.'], +"vs/platform/markers/common/markers":["Ошибка","Предупреждение","Информация"],"vs/platform/quickinput/browser/commandsQuickAccess":["{0}, {1}","недавно использованные","другие команды",'Команда "{0}" привела к ошибке ({1})'],"vs/platform/quickinput/browser/helpQuickAccess":["глобальные команды","команды редактора","{0}, {1}"], +"vs/platform/theme/common/colorRegistry":["Общий цвет переднего плана. Этот цвет используется, только если его не переопределит компонент.","Общий цвет переднего плана для сообщений об ошибках. Этот цвет используется только если его не переопределяет компонент.","Цвет по умолчанию для значков на рабочем месте.","Общий цвет границ для элементов с фокусом. Этот цвет используется только в том случае, если не переопределен в компоненте.","Дополнительная граница вокруг элементов, которая отделяет их от других элементов для улучшения контраста.","Дополнительная граница вокруг активных элементов, которая отделяет их от других элементов для улучшения контраста.","Цвет переднего плана для ссылок в тексте.","Цвет фона для программного кода в тексте.",'Цвет тени мини-приложений редактора, таких как "Найти/заменить".',"Фон поля ввода.","Передний план поля ввода.","Граница поля ввода.","Цвет границ активированных параметров в полях ввода.","Цвет фона активированных параметров в полях ввода.","Цвет переднего плана активированных параметров в полях ввода.",'Фоновый цвет проверки ввода для уровня серьезности "Сведения".','Цвет переднего плана области проверки ввода для уровня серьезности "Сведения".','Цвет границы проверки ввода для уровня серьезности "Сведения".','Фоновый цвет проверки ввода для уровня серьезности "Предупреждение".','Цвет переднего плана области проверки ввода для уровня серьезности "Предупреждение".','Цвет границы проверки ввода для уровня серьезности "Предупреждение".','Фоновый цвет проверки ввода для уровня серьезности "Ошибка".','Цвет переднего плана области проверки ввода для уровня серьезности "Ошибка".','Цвет границы проверки ввода для уровня серьезности "Ошибка".',"Фон раскрывающегося списка.","Передний план раскрывающегося списка.","Цвет переднего плана кнопки.","Цвет фона кнопки.","Цвет фона кнопки при наведении.","Цвет фона бэджа. Бэджи - небольшие информационные элементы, отображающие количество, например, результатов поиска.","Цвет текста бэджа. Бэджи - небольшие информационные элементы, отображающие количество, например, результатов поиска.","Цвет тени полосы прокрутки, которая свидетельствует о том, что содержимое прокручивается.","Цвет фона для ползунка полосы прокрутки.","Цвет фона ползунка полосы прокрутки при наведении курсора.","Цвет фона ползунка полосы прокрутки при щелчке по нему.","Цвет фона индикатора выполнения, который может отображаться для длительных операций.","Цвет волнистой линии для выделения ошибок в редакторе.","Цвет границы для окон ошибок в редакторе.","Цвет волнистой линии для выделения предупреждений в редакторе.","Цвет границы для окон предупреждений в редакторе.","Цвет волнистой линии для выделения информационных сообщений в редакторе.","Цвет границы для окон сведений в редакторе.","Цвет волнистой линии для выделения подсказок в редакторе.","Цвет границы для окон указаний в редакторе.","Цвет фона редактора.","Цвет переднего плана редактора по умолчанию.","Цвет фона виджетов редактора, таких как найти/заменить.",'Цвет переднего плана мини-приложений редактора, таких как "Поиск/замена".',"Цвет границы мини-приложений редактора. Этот цвет используется только в том случае, если у мини-приложения есть граница и если этот цвет не переопределен мини-приложением.","Цвет границы панели изменения размера мини-приложений редактора. Этот цвет используется только в том случае, если у мини-приложения есть граница для изменения размера и если этот цвет не переопределен мини-приложением.","Цвет фона для средства быстрого выбора. Мини-приложение быстрого выбора является контейнером для таких средств выбора, как палитра команд.","Цвет переднего плана для средства быстрого выбора. Мини-приложение быстрого выбора является контейнером для таких средств выбора, как палитра команд.","Цвет фона для заголовка средства быстрого выбора. Мини-приложение быстрого выбора является контейнером для таких средств выбора, как палитра команд.","Цвет средства быстрого выбора для группировки меток.","Цвет средства быстрого выбора для группировки границ.","Цвет выделения редактора.","Цвет выделенного текста в режиме высокого контраста.","Цвет выделения в неактивном редакторе. Цвет не должен быть непрозрачным, чтобы не скрыть расположенные ниже элементы оформления.","Цвет для областей, содержимое которых совпадает с выбранным фрагментом. Цвет не должен быть непрозрачным, чтобы не скрыть расположенные ниже элементы оформления.","Цвет границы регионов с тем же содержимым, что и в выделении.","Цвет текущего поиска совпадений.","Цвет других совпадений при поиске. Цвет не должен быть непрозрачным, чтобы не скрыть расположенные ниже элементы оформления.","Цвет диапазона, ограничивающего поиск. Цвет не должен быть непрозрачным, чтобы не скрыть расположенные ниже элементы оформления.","Цвет границы текущего результата поиска.","Цвет границы других результатов поиска.","Цвет границы для диапазона, ограничивающего поиск. Цвет не должен быть непрозрачным, чтобы не скрыть расположенные ниже элементы оформления.","Выделение под словом, для которого отображается меню при наведении курсора. Цвет не должен быть непрозрачным, чтобы не скрыть расположенные ниже элементы оформления.","Цвет фона при наведении указателя на редактор.","Цвет переднего плана для наведения указателя на редактор.","Цвет границ при наведении указателя на редактор.","Цвет фона строки состояния при наведении в редакторе.","Цвет активных ссылок.","Цвет, используемый для значка действий в меню лампочки.","Цвет, используемый для значка действий автоматического исправления в меню лампочки.","Цвет фона для вставленного текста. Цвет не должен быть непрозрачным, чтобы не скрыть расположенные ниже элементы оформления.","Цвет фона для удаленного текста. Цвет не должен быть непрозрачным, чтобы не скрыть расположенные ниже элементы оформления.","Цвет контура для добавленных строк.","Цвет контура для удаленных строк.","Цвет границы между двумя текстовыми редакторами.","Цвет диагональной заливки для редактора несовпадений. Диагональная заливка используется в размещаемых рядом представлениях несовпадений.","Фоновый цвет находящегося в фокусе элемента List/Tree, когда элемент List/Tree активен. На активном элементе List/Tree есть фокус клавиатуры, на неактивном — нет.","Цвет переднего плана находящегося в фокусе элемента List/Tree, когда элемент List/Tree активен. На активном элементе List/Tree есть фокус клавиатуры, на неактивном — нет.","Фоновый цвет выбранного элемента List/Tree, когда элемент List/Tree активен. На активном элементе List/Tree есть фокус клавиатуры, на неактивном — нет.","Цвет переднего плана выбранного элемента List/Tree, когда элемент List/Tree активен. На активном элементе List/Tree есть фокус клавиатуры, на неактивном — нет.","Фоновый цвет выбранного элемента List/Tree, когда элемент List/Tree неактивен. На активном элементе List/Tree есть фокус клавиатуры, на неактивном — нет.","Цвет текста выбранного элемента List/Tree, когда элемент List/Tree неактивен. На активном элементе List/Tree есть фокус клавиатуры, на неактивном — нет.","Фоновый цвет находящегося в фокусе элемента List/Tree, когда элемент List/Tree не активен. На активном элементе List/Tree есть фокус клавиатуры, на неактивном — нет.","Фоновый цвет элементов List/Tree при наведении курсора мыши.","Цвет переднего плана элементов List/Tree при наведении курсора мыши.","Фоновый цвет элементов List/Tree при перемещении с помощью мыши.","Цвет переднего плана для выделения соответствия при поиске по элементу List/Tree.","Цвет фона для мини-приложения фильтра типов в списках и деревьях.","Цвет контура для мини-приложения фильтра типов в списках и деревьях.","Цвет контура для мини-приложения фильтра типов в списках и деревьях при отсутствии совпадений.","Цвет штриха дерева для направляющих отступа.","Цвет границ меню.","Цвет переднего плана пунктов меню.","Цвет фона пунктов меню.","Цвет переднего плана выбранного пункта меню в меню.","Цвет фона для выбранного пункта в меню.","Цвет границы для выбранного пункта в меню.","Цвет разделителя меню в меню.","Цвет фона выделения в позиции табуляции фрагмента.","Цвет границы выделения в позиции табуляции фрагмента.","Цвет фона выделения в последней позиции табуляции фрагмента.","Выделение цветом границы в последней позиции табуляции фрагмента.","Цвет маркера обзорной линейки для совпадений при поиске. Цвет не должен быть непрозрачным, чтобы не скрыть расположенные ниже элементы оформления.","Маркер обзорной линейки для выделения выбранного фрагмента. Цвет не должен быть непрозрачным, чтобы не скрыть расположенные ниже элементы оформления.","Цвет маркера мини-карты для поиска совпадений.","Цвет маркера мини-карты для выбора редактора.","Цвет маркера миникарты для ошибок.","Цвет маркера миникарты для предупреждений.","Цвет фона мини-карты.","Цвет фона ползунка мини-карты.","Цвет фона ползунка мини-карты при наведении на него указателя.","Цвет фона ползунка мини-карты при его щелчке.","Цвет, используемый для значка ошибки, указывающего на наличие проблем.","Цвет, используемый для предупреждающего значка, указывающего на наличие проблем.","Цвет, используемый для информационного значка, указывающего на наличие проблем."], +"vs/platform/undoRedo/common/undoRedoService":["Следующие файлы были закрыты и изменены на диске: {0}.","Следующие файлы были изменены несовместимым образом: {0}.",'Не удалось отменить "{0}" для всех файлов. {1}','Не удалось отменить "{0}" для всех файлов. {1}','Не удалось отменить операцию "{0}" для всех файлов, так как были внесены изменения в {1}','Не удалось отменить действие "{0}" для всех файлов, так как в {1} уже выполняется операция отмены или повтора действия','Не удалось отменить действие "{0}" для всех файлов, так как уже выполнялась операция отмены или повтора действия','Вы хотите отменить "{0}" для всех файлов?',"Отменить действие в нескольких файлах ({0})","Отменить этот файл","Отмена",'Не удалось отменить действие "{0}", так как уже выполняется операция отмены или повтора действия','Не удалось повторить операцию "{0}" для всех файлов. {1}','Не удалось повторить операцию "{0}" для всех файлов. {1}','Не удалось повторить операцию "{0}" для всех файлов, так как были внесены изменения в {1}','Не удалось повторить действие "{0}" для всех файлов, так как в {1} уже выполняется операция отмены или повтора действия','Не удалось повторить действие "{0}" для всех файлов, так как уже выполнялась операция отмены или повтора действия','Не удалось повторить действие "{0}", так как уже выполняется операция отмены или повтора действия'] +}); +//# sourceMappingURL=../../../min-maps/vs/editor/editor.main.nls.ru.js.map \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/editor/editor.main.nls.zh-cn.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/editor/editor.main.nls.zh-cn.js new file mode 100644 index 0000000..1466a2d --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/editor/editor.main.nls.zh-cn.js @@ -0,0 +1,26 @@ +/*!----------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Version: 0.21.2(67b5a8116f3c0bace36b180e524e05bb750a16d8) + * Released under the MIT license + * https://github.com/Microsoft/vscode/blob/master/LICENSE.txt + *-----------------------------------------------------------*/ +define("vs/editor/editor.main.nls.zh-cn",{"vs/base/browser/ui/actionbar/actionViewItems":["{0} ({1})"],"vs/base/browser/ui/findinput/findInput":["输入"],"vs/base/browser/ui/findinput/findInputCheckboxes":["区分大小写","全字匹配","使用正则表达式"],"vs/base/browser/ui/findinput/replaceInput":["输入","保留大小写"],"vs/base/browser/ui/inputbox/inputBox":["错误: {0}","警告: {0}","信息: {0}"],"vs/base/browser/ui/keybindingLabel/keybindingLabel":["未绑定"],"vs/base/browser/ui/menu/menu":["{0} ({1})"],"vs/base/browser/ui/tree/abstractTree":["清除","禁用输入时筛选","启用输入时筛选","未找到元素","已匹配 {0} 个元素(共 {1} 个)"],"vs/base/common/errorMessage":["{0}: {1}","发生了系统错误 ({0})","出现未知错误。有关详细信息,请参阅日志。","出现未知错误。有关详细信息,请参阅日志。","{0} 个(共 {1} 个错误)","出现未知错误。有关详细信息,请参阅日志。"],"vs/base/common/keybindingLabels":["Ctrl","Shift","Alt","Windows","Ctrl","Shift","Alt","超键","Control","Shift","Alt","Command","Control","Shift","Alt","Windows","Control","Shift","Alt","超键"], +"vs/base/parts/quickinput/browser/quickInput":["上一步","{0}/{1}","在此输入可缩小结果范围。","{0} 个结果","已选 {0} 项","确定","自定义","后退 ({0})","上一步"],"vs/base/parts/quickinput/browser/quickInputList":["快速输入"],"vs/editor/browser/controller/coreCommands":["即使转到较长的行,也一直到末尾","即使转到较长的行,也一直到末尾"],"vs/editor/browser/controller/textAreaHandler":["编辑器","现在无法访问编辑器。按 {0} 获取选项。"],"vs/editor/browser/editorExtensions":["撤消(&&U)","撤消","恢复(&&R)","恢复","全选(&&S)","选择全部"],"vs/editor/browser/widget/codeEditorWidget":["光标数量被限制为 {0}。"],"vs/editor/browser/widget/diffEditorWidget":["文件过大,无法比较。"],"vs/editor/browser/widget/diffReview":["关闭","未更改行","更改了 1 行","更改了 {0} 行","差异 {0}/ {1}: 原始行 {2},{3},修改后的行 {4},{5}","空白","{0} 未更改的行 {1}","{0}原始行{1}修改的行{2}","+ {0}修改的行{1}","- {0}原始行{1}","转至下一个差异","转至上一个差异"],"vs/editor/browser/widget/inlineDiffMargin":["复制已删除的行","复制已删除的行","复制已删除的行({0})","还原此更改","复制已删除的行({0})"], +"vs/editor/common/config/commonEditorConfig":["编辑器","一个制表符等于的空格数。在 `#editor.detectIndentation#` 启用时,根据文件内容,该设置可能会被覆盖。","按 `Tab` 键时插入空格。该设置在 `#editor.detectIndentation#` 启用时根据文件内容可能会被覆盖。","控制是否在打开文件时,基于文件内容自动检测 `#editor.tabSize#` 和 `#editor.insertSpaces#`。","删除自动插入的尾随空白符号。","对大型文件进行特殊处理,禁用某些内存密集型功能。","控制是否根据文档中的文字计算自动完成列表。","对所有颜色主题启用语义突出显示。","对所有颜色主题禁用语义突出显示。",'语义突出显示是由当前颜色主题的 "semanticHighlighting" 设置配置的。',"控制是否为支持它的语言显示语义突出显示。","在速览编辑器中,即使双击其中的内容或者按 `Esc` 键,也保持其打开状态。","由于性能原因,超过这个长度的行将不会被标记","超时(以毫秒为单位),之后将取消差异计算。使用0表示没有超时。","控制差异编辑器的显示方式是并排还是内联。","启用后,差异编辑器将忽略前导空格或尾随空格中的更改。","控制差异编辑器是否为添加/删除的更改显示 +/- 指示符号。","控制是否在编辑器中显示 CodeLens。"], +"vs/editor/common/config/editorOptions":["编辑器将使用平台 API 以检测是否附加了屏幕阅读器。","编辑器将对屏幕阅读器的使用进行永久优化。","编辑器将不再对屏幕阅读器的使用进行优化。","控制编辑器是否应运行在对屏幕阅读器进行优化的模式。","控制在注释时是否插入空格字符。","控制在对行注释执行切换、添加或删除操作时,是否应忽略空行。","控制在没有选择内容时进行复制是否复制当前行。","控制在键入时光标是否应跳转以查找匹配项。","控制是否将编辑器选中内容作为搜索词填入到查找小组件中。","切勿自动打开“选择中查找”(默认)","始终自动打开“在选择中查找”","选择多行内容时,自动打开“在选择中查找”。","控制在所选内容中自动开启查找的条件。","控制“查找”小组件是否读取或修改 macOS 的共享查找剪贴板。",'控制 "查找小部件" 是否应在编辑器顶部添加额外的行。如果为 true, 则可以在 "查找小工具" 可见时滚动到第一行之外。',"控制在找不到其他匹配项时,是否自动从开头(或结尾)重新开始搜索。","启用或禁用字体连字。","显式字体功能设置。","配置字体连字或字体功能。","控制字体大小(像素)。","仅允许使用关键字“正常”和“加粗”,或使用介于 1 至 1000 之间的数字。","控制字体粗细。接受关键字“正常”和“加粗”,或者接受介于 1 至 1000 之间的数字。","显示结果的预览视图 (默认值)","转到主结果并显示预览视图","转到主结果,并对其他人启用防偷窥导航",'此设置已弃用,请改用单独的设置,如"editor.editor.gotoLocation.multipleDefinitions"或"editor.editor.gotoLocation.multipleImplementations"。','控制存在多个目标位置时"转到定义"命令的行为。','控制存在多个目标位置时"转到类型定义"命令的行为。','控制存在多个目标位置时"转到声明"命令的行为。','控制存在多个目标位置时"转到实现"命令的行为。','控制存在多个目标位置时"转到引用"命令的行为。','当"转到定义"的结果为当前位置时将要执行的替代命令的 ID。','当"转到类型定义"的结果是当前位置时正在执行的备用命令 ID。','当"转到声明"的结果为当前位置时将要执行的替代命令的 ID。','当"转到实现"的结果为当前位置时将要执行的替代命令的 ID。','当"转到引用"的结果是当前位置时正在执行的替代命令 ID。',"控制是否显示悬停提示。","控制显示悬停提示前的等待时间 (毫秒)。","控制当鼠标移动到悬停提示上时,其是否保持可见。","在编辑器中启用代码操作小灯泡提示。","控制行高。为 0 时则通过字体大小自动计算。","控制是否显示缩略图。","迷你地图的大小与编辑器内容相同(并且可能滚动)。","迷你地图将根据需要拉伸或缩小以填充编辑器的高度(不滚动)。","迷你地图将根据需要缩小,永远不会大于编辑器(不滚动)。","控制迷你地图的大小。","控制在哪一侧显示缩略图。","控制何时显示迷你地图滑块。","在迷你地图中绘制的内容比例: 1、2 或 3。","渲染每行的实际字符,而不是色块。","限制缩略图的宽度,控制其最多显示的列数。","控制编辑器的顶边和第一行之间的间距量。","控制编辑器的底边和最后一行之间的间距量。","在输入时显示含有参数文档和类型信息的小面板。","控制参数提示菜单在到达列表末尾时进行循环还是关闭。","在字符串内启用快速建议。","在注释内启用快速建议。","在字符串和注释外启用快速建议。","控制是否在键入时自动显示建议。","不显示行号。","将行号显示为绝对行数。","将行号显示为与光标相隔的行数。","每 10 行显示一次行号。","控制行号的显示。","此编辑器标尺将渲染的等宽字符数。","此编辑器标尺的颜色。","在一定数量的等宽字符后显示垂直标尺。输入多个值,显示多个标尺。若数组为空,则不绘制标尺。","插入建议而不覆盖光标右侧的文本。","插入建议并覆盖光标右侧的文本。","控制接受补全时是否覆盖单词。请注意,这取决于扩展选择使用此功能。","控制对建议的筛选和排序是否考虑小的拼写错误。","控制排序时是否提高靠近光标的词语的优先级。","控制是否在多个工作区和窗口间共享记忆的建议选项(需要 `#editor.suggestSelection#`)。","控制活动代码段是否阻止快速建议。","控制是否在建议中显示或隐藏图标。","控制在显示滚动条之前 IntelliSense 将显示的建议数 (最多 15个)。",'此设置已弃用,请改用单独的设置,如"editor.suggest.showKeywords"或"editor.suggest.showSnippets"。',"启用后,IntelliSense 将显示“方法”建议。","启用后,IntelliSense 将显示“函数”建议。","启用后,IntelliSense 将显示“构造函数”建议。","启用后,IntelliSense 将显示“字段”建议。","启用后,IntelliSense 将显示“变量”建议。","启用后,IntelliSense 将显示“类”建议。","启用后,IntelliSense 将显示“结构”建议。","启用后,IntelliSense 将显示“接口”建议。","启用后,IntelliSense 将显示“模块”建议。","启用后,IntelliSense 将显示“属性”建议。","启用后,IntelliSense 将显示“事件”建议。","启用后,IntelliSense 将显示“操作符”建议。","启用后,IntelliSense 将显示“单位”建议。","启用后,IntelliSense 将显示“值”建议。","启用后,IntelliSense 将显示“常量”建议。","启用后,IntelliSense 将显示“枚举”建议。",'启用后,IntelliSense 将显示 "enumMember" 建议。',"启用后,IntelliSense 将显示“关键字”建议。","启用后,IntelliSense 将显示“文本”建议。","启用后,IntelliSense 将显示“颜色”建议。","启用后,IntelliSense 将显示“文件”建议。","启用后,IntelliSense 将显示“参考”建议。","启用后,IntelliSense 将显示“自定义颜色”建议。","启用后,IntelliSense 将显示“文件夹”建议。",'启用后,IntelliSense 将显示 "typeParameter" 建议。',"启用后,IntelliSense 将显示“片段”建议。",'启用后,IntelliSense 将显示"用户"建议。','启用后,IntelliSense 将显示"问题"建议。',"控制建议小部件底部的状态栏的可见性。","控制是否应在遇到提交字符时接受建议。例如,在 JavaScript 中,半角分号 (`;`) 可以为提交字符,能够在接受建议的同时键入该字符。","仅当建议包含文本改动时才可使用 `Enter` 键进行接受。","控制除了 `Tab` 键以外, `Enter` 键是否同样可以接受建议。这能减少“插入新行”和“接受建议”命令之间的歧义。","控制编辑器中可由屏幕阅读器读取的行数。警告: 对于大于默认值的数字,这会影响性能。","编辑器内容","使用语言配置确定何时自动闭合括号。","仅当光标位于空白字符左侧时,才自动闭合括号。","控制编辑器是否在左括号后自动插入右括号。","仅在自动插入时才改写右引号或右括号。","控制编辑器是否应改写右引号或右括号。","使用语言配置确定何时自动闭合引号。","仅当光标位于空白字符左侧时,才自动闭合引号。","控制编辑器是否在左引号后自动插入右引号。","编辑器不会自动插入缩进。","编辑器将保留当前行的缩进。","编辑器将保留当前行的缩进并遵循语言定义的括号。","编辑器将保留当前行的缩进、使用语言定义的括号并调用语言定义的特定 onEnterRules。","编辑器将保留当前行的缩进,使用语言定义的括号,调用由语言定义的特殊输入规则,并遵循由语言定义的缩进规则。","控制编辑器是否应在用户键入、粘贴、移动或缩进行时自动调整缩进。","使用语言配置确定何时自动包住所选内容。","使用引号而非括号来包住所选内容。","使用括号而非引号来包住所选内容。","控制编辑器是否应自动包住所选内容。","控制是否在编辑器中显示 CodeLens。","控制编辑器是否显示内联颜色修饰器和颜色选取器。","启用使用鼠标和键进行列选择。","控制在复制时是否同时复制语法高亮。","控制光标的动画样式。","控制是否启用平滑插入动画。","控制光标样式。","控制光标周围可见的前置行和尾随行的最小数目。在其他一些编辑器中称为“scrollOff”或“scrollOffset”。",'仅当通过键盘或 API 触发时,才会强制执行"光标环绕行"。','始终强制执行 "cursorSurroundingLines"','控制何时应强制执行"光标环绕行"。',"当 `#editor.cursorStyle#` 设置为 `line` 时,控制光标的宽度。","控制在编辑器中是否允许通过拖放来移动选中内容。",'按下"Alt"时滚动速度倍增。',"控制编辑器是否启用了代码折叠。","使用特定于语言的折叠策略(如果可用),否则使用基于缩进的策略。","使用基于缩进的折叠策略。","控制计算折叠范围的策略。","控制编辑器是否应突出显示折叠范围。","控制单击已折叠的行后面的空内容是否会展开该行。","控制字体系列。","控制编辑器是否自动格式化粘贴的内容。格式化程序必须可用,并且能针对文档中的某一范围进行格式化。","控制编辑器在键入一行后是否自动格式化该行。","控制编辑器是否应呈现垂直字形边距。字形边距最常用于调试。","控制是否在概览标尺中隐藏光标。","控制是否突出显示编辑器中活动的缩进参考线。","控制字母间距(像素)。","控制是否在编辑器中检测链接并使其可被点击。","突出显示匹配的括号。","对鼠标滚轮滚动事件的 `deltaX` 和 `deltaY` 乘上的系数。","按住 `Ctrl` 键并滚动鼠标滚轮时对编辑器字体大小进行缩放。","当多个光标重叠时进行合并。","映射为 `Ctrl` (Windows 和 Linux) 或 `Command` (macOS)。","映射为 `Alt` (Windows 和 Linux) 或 `Option` (macOS)。","在通过鼠标添加多个光标时使用的修改键。“转到定义”和“打开链接”功能所需的鼠标动作将会相应调整,不与多光标修改键冲突。[阅读详细信息](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier)。","每个光标粘贴一行文本。","每个光标粘贴全文。","控制粘贴时粘贴文本的行计数与光标计数相匹配。","控制编辑器是否突出显示语义符号的匹配项。","控制是否在概览标尺周围绘制边框。","打开速览时聚焦树","打开预览时将焦点放在编辑器上","控制是将焦点放在内联编辑器上还是放在预览小部件中的树上。",'控制"转到定义"鼠标手势是否始终打开预览小部件。',"控制显示快速建议前的等待时间 (毫秒)。","控制是否在编辑器中输入时自动重命名。","控制编辑器是否显示控制字符。","控制编辑器是否显示缩进参考线。","当文件以换行符结束时, 呈现最后一行的行号。","同时突出显示导航线和当前行。","控制编辑器的当前行进行高亮显示的方式。","控制编辑器是否仅在焦点在编辑器时突出显示当前行","呈现空格字符(字词之间的单个空格除外)。","仅在选定文本上呈现空白字符。","仅呈现尾随空格字符","控制编辑器在空白字符上显示符号的方式。","控制选区是否有圆角。","控制编辑器水平滚动时可以超过范围的字符数。","控制编辑器是否可以滚动到最后一行之后。","同时垂直和水平滚动时,仅沿主轴滚动。在触控板上垂直滚动时,可防止水平漂移。","控制是否支持 Linux 主剪贴板。","控制编辑器是否应突出显示与所选内容类似的匹配项。","始终显示折叠控件。","仅在鼠标位于装订线上方时显示折叠控件。","控制何时显示行号槽上的折叠控件。","控制是否淡化未使用的代码。","控制加删除线被弃用的变量。","在其他建议上方显示代码片段建议。","在其他建议下方显示代码片段建议。","在其他建议中穿插显示代码片段建议。","不显示代码片段建议。","控制代码片段是否与其他建议一起显示及其排列的位置。","控制编辑器是否在滚动时使用动画。","建议小部件的字号。如果设置为 `0`,则使用 `#editor.fontSize#` 的值。","建议小部件的行高。如果设置为 `0`,则使用 `#editor.lineHeight#` 的值。","控制在键入触发字符后是否自动显示建议。","始终选择第一个建议。","选择最近的建议,除非进一步键入选择其他项。例如 `console. -> console.log`,因为最近补全过 `log`。","根据之前补全过的建议的前缀来进行选择。例如,`co -> console`、`con -> const`。","控制在建议列表中如何预先选择建议。","在按下 Tab 键时进行 Tab 补全,将插入最佳匹配建议。","禁用 Tab 补全。",'在前缀匹配时进行 Tab 补全。在 "quickSuggestions" 未启用时体验最好。',"启用 Tab 补全。","忽略异常的行终止符。","提示删除异常的行终止符。","自动删除异常的行终止符。","删除可能导致问题的异常行终止符。","根据制表位插入和删除空格。","执行单词相关的导航或操作时作为单词分隔符的字符。","永不换行。","将在视区宽度处换行。","在 `#editor.wordWrapColumn#` 处折行。","在视区宽度和 `#editor.wordWrapColumn#` 中的较小值处折行。","控制折行的方式。","在 `#editor.wordWrap#` 为 `wordWrapColumn` 或 `bounded` 时,控制编辑器的折行列。","没有缩进。折行从第 1 列开始。","折行的缩进量与其父级相同。","折行的缩进量比其父级多 1。","折行的缩进量比其父级多 2。","控制折行的缩进。","假定所有字符的宽度相同。这是一种快速算法,适用于等宽字体和某些字形宽度相等的文字(如拉丁字符)。","将包装点计算委托给浏览器。这是一个缓慢算法,可能会导致大型文件被冻结,但它在所有情况下都正常工作。","控制计算包裹点的算法。"], +"vs/editor/common/model/editStack":["输入"],"vs/editor/common/modes/modesRegistry":["纯文本"],"vs/editor/common/standaloneStrings":["无选择","行 {0}, 列 {1} (选中 {2})","行 {0}, 列 {1}","{0} 选择(已选择 {1} 个字符)","{0} 选择",'现在将 "辅助功能支持" 设置更改为 "打开"。',"现在正在打开“编辑器辅助功能”文档页。","在差异编辑器的只读窗格中。","在一个差异编辑器的窗格中。","在只读代码编辑器中","在代码编辑器中","若要配置编辑器,将其进行优化以最好地配合屏幕阅读器的使用,请立即按 Command+E。","若要配置编辑器,将其进行优化以最高效地配合屏幕阅读器的使用,按下 Ctrl+E。","配置编辑器,将其进行优化以最好地配合屏幕读取器的使用。","编辑器被配置为永远不进行优化以配合屏幕读取器的使用, 而当前不是这种情况。","在当前编辑器中按 Tab 会将焦点移动到下一个可聚焦的元素。通过按 {0} 切换此行为。","在当前编辑器中按 Tab 会将焦点移动到下一个可聚焦的元素。当前无法通过按键绑定触发命令 {0}。","在当前编辑器中按 Tab 将插入制表符。通过按 {0} 切换此行为。","在当前编辑器中按 Tab 会插入制表符。当前无法通过键绑定触发命令 {0}。","现在按 Command+H 打开一个浏览器窗口, 其中包含有关编辑器辅助功能的详细信息。","现在按 Ctrl+H 打开一个浏览器窗口, 其中包含有关编辑器辅助功能的更多信息。","你可以按 Esc 或 Shift+Esc 消除此工具提示并返回到编辑器。","显示辅助功能帮助","开发人员: 检查令牌","转到行/列...","显示所有快速访问提供程序","命令面板","显示并运行命令","转到符号...","按类别转到符号...","编辑器内容","按 Alt+F1 可打开辅助功能选项。","切换高对比度主题","在 {1} 个文件中进行了 {0} 次编辑"], +"vs/editor/common/view/editorColorRegistry":["光标所在行高亮内容的背景颜色。","光标所在行四周边框的背景颜色。","背景颜色的高亮范围,喜欢通过快速打开和查找功能。颜色不能不透明,以免隐藏底层装饰。","高亮区域边框的背景颜色。","高亮显示符号的背景颜色,例如转到定义或转到下一个/上一个符号。颜色不能是不透明的,以免隐藏底层装饰。","高亮显示符号周围的边框的背景颜色。","编辑器光标颜色。","编辑器光标的背景色。可以自定义块型光标覆盖字符的颜色。","编辑器中空白字符的颜色。","编辑器缩进参考线的颜色。","编辑器活动缩进参考线的颜色。","编辑器行号的颜色。","编辑器活动行号的颜色",'"Id" 已被弃用,请改用 "editorLineNumber.activeForeground"。',"编辑器活动行号的颜色","编辑器标尺的颜色。","编辑器 CodeLens 的前景色","匹配括号的背景色","匹配括号外框的颜色","概览标尺边框的颜色。","编辑器概述标尺的背景色。仅当缩略图已启用且置于编辑器右侧时才使用。","编辑器导航线的背景色。导航线包括边缘符号和行号。","编辑器中不必要(未使用)的源代码的边框颜色。",'非必须(未使用)代码的在编辑器中显示的不透明度。例如,"#000000c0" 将以 75% 的不透明度显示代码。对于高对比度主题,请使用 ”editorUnnecessaryCode.border“ 主题来为非必须代码添加下划线,以避免颜色淡化。',"用于突出显示范围的概述标尺标记颜色。颜色必须透明,以免隐藏下面的修饰效果。","概览标尺中错误标记的颜色。","概览标尺中警告标记的颜色。","概览标尺中信息标记的颜色。"],"vs/editor/contrib/anchorSelect/anchorSelect":["选择定位点","定位点设置为 {0}:{1}","设置选择定位点","转到选择定位点","选择从定位点到光标","取消选择定位点"],"vs/editor/contrib/bracketMatching/bracketMatching":["概览标尺上表示匹配括号的标记颜色。","转到括号","选择括号所有内容","转到括号(&&B)"], +"vs/editor/contrib/caretOperations/caretOperations":["向左移动所选文本","向右移动所选文本"],"vs/editor/contrib/caretOperations/transpose":["转置字母"],"vs/editor/contrib/clipboard/clipboard":["剪切(&&T)","剪切","剪切","复制(&&C)","复制","复制","粘贴(&&P)","粘贴","粘贴","复制并突出显示语法"],"vs/editor/contrib/codeAction/codeActionCommands":["要运行的代码操作的种类。","控制何时应用返回的操作。","始终应用第一个返回的代码操作。","如果仅返回的第一个代码操作,则应用该操作。","不要应用返回的代码操作。","如果只应返回首选代码操作,则应返回控件。","应用代码操作时发生未知错误","快速修复...","没有可用的代码操作",'没有适用于"{0}"的首选代码操作','没有适用于"{0}"的代码操作',"没有可用的首选代码操作","没有可用的代码操作","重构...",'没有适用于"{0}"的首选重构','没有可用的"{0}"重构',"没有可用的首选重构","没有可用的重构操作","源代码操作...",'没有适用于"{0}"的首选源操作',"没有适用于“ {0}”的源操作","没有可用的首选源操作","没有可用的源代码操作","整理 import 语句","没有可用的整理 import 语句操作","全部修复","没有可用的“全部修复”操作","自动修复...","没有可用的自动修复程序"],"vs/editor/contrib/codeAction/lightBulbWidget":["显示修复程序。首选可用修复程序 ({0})","显示修补程序({0})","显示修补程序"],"vs/editor/contrib/codelens/codelensController":["显示当前行的 Code Lens 命令"],"vs/editor/contrib/comment/comment":["切换行注释","切换行注释(&&T)","添加行注释","删除行注释","切换块注释","切换块注释(&&B)"], +"vs/editor/contrib/contextmenu/contextmenu":["显示编辑器上下文菜单"],"vs/editor/contrib/cursorUndo/cursorUndo":["光标撤消","光标重做"], +"vs/editor/contrib/documentSymbols/outlineTree":["数组符号的前景色。这些符号将显示在大纲、痕迹导航栏和建议小组件中。","布尔符号的前景颜色。这些符号出现在大纲、痕迹导航栏和建议小部件中。","类符号的前景颜色。这些符号出现在大纲、痕迹导航栏和建议小部件中。","颜色符号的前景颜色。这些符号出现在大纲、痕迹导航栏和建议小部件中。","常量符号的前景颜色。这些符号出现在大纲、痕迹导航栏和建议小部件中。","构造函数符号的前景颜色。这些符号出现在大纲、痕迹导航栏和建议小部件中。","枚举符号的前景颜色。这些符号出现在大纲、痕迹导航栏和建议小部件中。","枚举器成员符号的前景颜色。这些符号出现在大纲、痕迹导航栏和建议小部件中。","事件符号的前景颜色。这些符号出现在大纲、痕迹导航栏和建议小部件中。","字段符号的前景颜色。这些符号出现在大纲、痕迹导航栏和建议小部件中。","文件符号的前景颜色。这些符号出现在大纲、痕迹导航栏和建议小部件中。","文件夹符号的前景颜色。这些符号出现在大纲、痕迹导航栏和建议小部件中。","函数符号的前景颜色。这些符号出现在大纲、痕迹导航栏和建议小部件中。","接口符号的前景色。这些符号将显示在大纲、痕迹导航栏和建议小组件中。","键符号的前景颜色。这些符号出现在大纲、痕迹导航栏和建议小部件中。","关键字符号的前景颜色。这些符号出现在大纲、痕迹导航栏和建议小部件中。","方法符号的前景颜色。这些符号出现在大纲、痕迹导航栏和建议小部件中。","模块符号的前景颜色。这些符号出现在大纲、痕迹导航栏和建议小部件中。","命名空间符号的前景颜色。这些符号出现在轮廓、痕迹导航栏和建议小部件中。","空符号的前景颜色。这些符号出现在大纲、痕迹导航栏和建议小部件中。","数字符号的前景颜色。这些符号出现在大纲、痕迹导航栏和建议小部件中。","对象符号的前景颜色。这些符号出现在大纲、痕迹导航栏和建议小部件中。","运算符符号的前景颜色。这些符号出现在大纲、痕迹导航栏和建议小部件中。","包符号的前景颜色。这些符号出现在大纲、痕迹导航栏和建议小部件中。","属性符号的前景色。这些符号出现在大纲、痕迹导航栏和建议小组件中。","参考符号的前景颜色。这些符号出现在大纲、痕迹导航栏和建议小部件中。","片段符号的前景颜色。这些符号出现在大纲、痕迹导航栏和建议小部件中。","字符串符号的前景颜色。这些符号出现在轮廓、痕迹导航栏和建议小部件中。","结构符号的前景颜色。这些符号出现在大纲、痕迹导航栏和建议小部件中。","文本符号的前景颜色。这些符号出现在大纲、痕迹导航栏和建议小部件中。","类型参数符号的前景颜色。这些符号出现在大纲、痕迹导航栏和建议小部件中。","单位符号的前景颜色。这些符号出现在大纲、痕迹导航栏和建议小部件中。","变量符号的前景颜色。这些符号出现在大纲、痕迹导航栏和建议小部件中。"], +"vs/editor/contrib/find/findController":["查找","查找(&&F)","查找选定内容","查找下一个","查找下一个","查找上一个","查找上一个","查找下一个选择","查找上一个选择","替换","替换(&&R)"],"vs/editor/contrib/find/findWidget":["查找","查找","上一个匹配项","下一个匹配项","在选定内容中查找","关闭","替换","替换","替换","全部替换","切换替换模式","仅高亮了前 {0} 个结果,但所有查找操作均针对全文。","{1} 中的 {0}","无结果","找到 {0}","为“{1}”找到 {0}","在 {2} 处找到“{1}”的 {0}","为“{1}”找到 {0}","Ctrl+Enter 现在由全部替换改为插入换行。你可以修改editor.action.replaceAll 的按键绑定以覆盖此行为。"],"vs/editor/contrib/folding/folding":["展开","以递归方式展开","折叠","切换折叠","以递归方式折叠","折叠所有块注释","折叠所有区域","展开所有区域","全部折叠","全部展开","折叠级别 {0}","折叠范围后面的背景颜色。颜色必须设为透明,以免隐藏底层装饰。","编辑器装订线中折叠控件的颜色。"],"vs/editor/contrib/fontZoom/fontZoom":["放大编辑器字体","缩小编辑器字体","重置编辑器字体大小"],"vs/editor/contrib/format/format":["在第 {0} 行进行了 1 次格式编辑","在第 {1} 行进行了 {0} 次格式编辑","第 {0} 行到第 {1} 行间进行了 1 次格式编辑","第 {1} 行到第 {2} 行间进行了 {0} 次格式编辑"],"vs/editor/contrib/format/formatActions":["格式化文档","格式化选定内容"], +"vs/editor/contrib/gotoError/gotoError":["转到下一个问题 (错误、警告、信息)","转到上一个问题 (错误、警告、信息)","转到文件中的下一个问题 (错误、警告、信息)","下一个问题(&&P)","转到文件中的上一个问题 (错误、警告、信息)","上一个问题(&&P)"],"vs/editor/contrib/gotoError/gotoErrorWidget":["错误","警告","信息","提示","{1} 中的 {0}","{0} 个问题(共 {1} 个)","{0} 个问题(共 {1} 个)","编辑器标记导航小组件错误颜色。","编辑器标记导航小组件警告颜色。","编辑器标记导航小组件信息颜色。","编辑器标记导航小组件背景色。"],"vs/editor/contrib/gotoSymbol/goToCommands":["快速查看","定义","未找到“{0}”的任何定义","找不到定义","转到定义","转到定义(&&D)","打开侧边的定义","速览定义","声明","未找到“{0}”的声明","未找到声明","转到声明",'转到"声明"(&&D)',"未找到“{0}”的声明","未找到声明","查看声明","类型定义","未找到“{0}”的类型定义","未找到类型定义","转到类型定义","转到类型定义(&&T)","快速查看类型定义","实现","未找到“{0}”的实现","未找到实现","转到实现","跳转到实现(&&I)","查看实现",'未找到"{0}"的引用',"未找到引用","转到引用","转到引用(&&R)","引用","查看引用","引用","转到任何符号","位置","无“{0}”的结果","引用"],"vs/editor/contrib/gotoSymbol/link/goToDefinitionAtPosition":["单击显示 {0} 个定义。"],"vs/editor/contrib/gotoSymbol/peek/referencesController":["正在加载...","{0} ({1})"],"vs/editor/contrib/gotoSymbol/peek/referencesTree":["{0} 个引用","{0} 个引用","引用"], +"vs/editor/contrib/gotoSymbol/peek/referencesWidget":["无可用预览","无结果","引用"],"vs/editor/contrib/gotoSymbol/referencesModel":["在文件 {0} 的 {1} 行 {2} 列的符号","{0} 中有 1 个符号,完整路径: {1}","{1} 中有 {0} 个符号,完整路径: {2}","未找到结果","在 {0} 中找到 1 个符号","在 {1} 中找到 {0} 个符号","在 {1} 个文件中找到 {0} 个符号"],"vs/editor/contrib/gotoSymbol/symbolNavigation":["{1} 的符号 {0},下一个使用 {2}","{1} 的符号 {0}"],"vs/editor/contrib/hover/hover":["显示悬停","显示定义预览悬停"],"vs/editor/contrib/hover/modesContentHover":["正在加载...","速览问题","正在检查快速修复...","没有可用的快速修复","快速修复..."],"vs/editor/contrib/inPlaceReplace/inPlaceReplace":["替换为上一个值","替换为下一个值"],"vs/editor/contrib/indentation/indentation":["将缩进转换为空格","将缩进转换为制表符","已配置制表符大小","选择当前文件的制表符大小",'使用 "Tab" 缩进',"使用空格缩进","从内容中检测缩进方式","重新缩进行","重新缩进所选行"],"vs/editor/contrib/linesOperations/linesOperations":["向上复制行","向上复制行(&&C)","向下复制行","向下复制一行(&&P)","重复选择","重复选择(&&D)","向上移动行","向上移动一行(&&V)","向下移动行","向下移动一行(&&L)","按升序排列行","按降序排列行","裁剪尾随空格","删除行","行缩进","行减少缩进","在上面插入行","在下面插入行","删除左侧所有内容","删除右侧所有内容","合并行","转置光标处的字符","转换为大写","转换为小写","转换为词首字母大写"], +"vs/editor/contrib/links/links":["执行命令","关注链接","cmd + 单击","ctrl + 单击","option + 单击","alt + 单击","此链接格式不正确,无法打开: {0}","此链接目标已丢失,无法打开。","打开链接"],"vs/editor/contrib/message/messageController":["无法在只读编辑器中编辑"],"vs/editor/contrib/multicursor/multicursor":["在上面添加光标","在上面添加光标(&&A)","在下面添加光标","在下面添加光标(&&D)","在行尾添加光标","在行尾添加光标(&&U)","在底部添加光标","在顶部添加光标","将下一个查找匹配项添加到选择","添加下一个匹配项(&&N)","将选择内容添加到上一查找匹配项","添加上一个匹配项(&&R)","将上次选择移动到下一个查找匹配项","将上个选择内容移动到上一查找匹配项","选择所有找到的查找匹配项","选择所有匹配项(&&O)","更改所有匹配项"],"vs/editor/contrib/parameterHints/parameterHints":["触发参数提示"],"vs/editor/contrib/parameterHints/parameterHintsWidget":["{0},提示"],"vs/editor/contrib/peekView/peekView":["关闭","速览视图标题区域背景颜色。","速览视图标题颜色。","速览视图标题信息颜色。","速览视图边框和箭头颜色。","速览视图结果列表背景色。","速览视图结果列表中行节点的前景色。","速览视图结果列表中文件节点的前景色。","速览视图结果列表中所选条目的背景色。","速览视图结果列表中所选条目的前景色。","速览视图编辑器背景色。","速览视图编辑器中装订线的背景色。","在速览视图结果列表中匹配突出显示颜色。","在速览视图编辑器中匹配突出显示颜色。","在速览视图编辑器中匹配项的突出显示边框。"], +"vs/editor/contrib/quickAccess/gotoLineQuickAccess":["先打开文本编辑器然后跳转到行。","转到第 {0} 行、第 {1} 列。","转到行 {0}。","当前行: {0},字符: {1}。键入要导航到的行号(介于 1 至 {2} 之间)。","当前行: {0},字符: {1}。 键入要导航到的行号。"],"vs/editor/contrib/quickAccess/gotoSymbolQuickAccess":["要转到符号,首先打开具有符号信息的文本编辑器。","活动文本编辑器不提供符号信息。","没有匹配的编辑器符号","没有编辑器符号","在侧边打开","在底部打开","符号({0})","属性({0})","方法({0})","函数({0})","构造函数 ({0})","变量({0})","类({0})","结构({0})","事件({0})","运算符({0})","接口({0})","命名空间({0})","包({0})","类型参数({0})","模块({0})","属性({0})","枚举({0})","枚举成员({0})","字符串({0})","文件({0})","数组({0})","数字({0})","布尔值({0})","对象({0})","键({0})","字段({0})","常量({0})"],"vs/editor/contrib/rename/onTypeRename":["在键入时重命名符号","编辑器根据类型自动重命名时的背景色。"],"vs/editor/contrib/rename/rename":["无结果。","解析重命名位置时发生未知错误","正在重命名“{0}”","重命名 {0}","成功将“{0}”重命名为“{1}”。摘要: {2}","重命名无法应用修改","重命名无法计算修改","重命名符号","启用/禁用重命名之前预览更改的功能"],"vs/editor/contrib/rename/renameInputField":['重命名输入。键入新名称并按 "Enter" 提交。',"按 {0} 进行重命名,按 {1} 进行预览"],"vs/editor/contrib/smartSelect/smartSelect":["展开选择","展开选定内容(&&E)","收起选择","缩小选定范围(&&S)"], +"vs/editor/contrib/snippet/snippetVariables":["星期天","星期一","星期二","星期三","星期四","星期五","星期六","周日","周一","周二","周三","周四","周五","周六","一月","二月","三月","四月","5月","六月","七月","八月","九月","十月","十一月","十二月","1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11 月","12月"],"vs/editor/contrib/suggest/suggestController":["选择“{0}”后进行了其他 {1} 次编辑","触发建议","{0} 插入","{0} 插入","{0} 替换","{0} 替换","{0} 插入","显示更少","显示更多"],"vs/editor/contrib/suggest/suggestWidget":["建议小组件的背景色。","建议小组件的边框颜色。","建议小组件的前景色。","建议小组件中所选条目的背景色。","建议小组件中匹配内容的高亮颜色。","读取更多({0})","读取更少({0})","正在加载...","正在加载...","无建议。","{0},文档: {1}","建议"],"vs/editor/contrib/toggleTabFocusMode/toggleTabFocusMode":["切换 Tab 键移动焦点","Tab 键将移动到下一可聚焦的元素","Tab 键将插入制表符"],"vs/editor/contrib/tokenization/tokenization":["开发人员: 强制重新进行标记"],"vs/editor/contrib/unusualLineTerminators/unusualLineTerminators":["异常行终止符","检测到异常行终止符",'此文件包含一个或多个异常的行终止符,例如行分隔符(LS)或段落分隔符(PS)。\r\n\r\n建议从文件中删除它们。可通过 "editor.unusualLineTerminators" 进行配置。',"修复此文件","忽略此文件的问题"], +"vs/editor/contrib/wordHighlighter/wordHighlighter":["读取访问期间符号的背景色,例如读取变量时。颜色必须透明,以免隐藏下面的修饰效果。","写入访问过程中符号的背景色,例如写入变量时。颜色必须透明,以免隐藏下面的修饰效果。","符号在进行读取访问操作时的边框颜色,例如读取变量。","符号在进行写入访问操作时的边框颜色,例如写入变量。","用于突出显示符号的概述标尺标记颜色。颜色必须透明,以免隐藏下面的修饰效果。","用于突出显示写权限符号的概述标尺标记颜色。颜色必须透明,以免隐藏下面的修饰效果。","转到下一个突出显示的符号","转到上一个突出显示的符号","触发符号高亮"],"vs/platform/actions/browser/menuEntryActionViewItem":["{0} ({1})"],"vs/platform/configuration/common/configurationRegistry":["默认语言配置替代","针对某种语言,配置替代编辑器设置。","此设置不支持按语言配置。",'无法注册“{0}”。其符合描述特定语言编辑器设置的表达式 "\\\\[.*\\\\]$"。请使用 "configurationDefaults"。',"无法注册“{0}”。此属性已注册。"],"vs/platform/keybinding/common/abstractKeybindingService":["({0})已按下。正在等待按下第二个键...","组合键({0},{1})不是命令。"], +"vs/platform/list/browser/listService":["工作台","映射为 `Ctrl` (Windows 和 Linux) 或 `Command` (macOS)。","映射为 `Alt` (Windows 和 Linux) 或 `Option` (macOS)。","在通过鼠标多选树和列表条目时使用的修改键 (例如“资源管理器”、“打开的编辑器”和“源代码管理”视图)。“在侧边打开”功能所需的鼠标动作 (若可用) 将会相应调整,不与多选修改键冲突。","控制在树和列表中怎样使用鼠标来展开子项(若支持)。对于树中的父节点,此设置将控制是使用单击还是双击来展开。注意,某些不适用于此设置的树或列表可能会忽略此项。 ","控制列表和树是否支持工作台中的水平滚动。警告: 打开此设置影响会影响性能。","控制树缩进(以像素为单位)。","控制树是否应呈现缩进参考线。","控制列表和树是否具有平滑滚动。","简单键盘导航聚焦与键盘输入相匹配的元素。仅对前缀进行匹配。","高亮键盘导航会突出显示与键盘输入相匹配的元素。进一步向上和向下导航将仅遍历突出显示的元素。","筛选器键盘导航将筛选出并隐藏与键盘输入不匹配的所有元素。","控制工作台中的列表和树的键盘导航样式。它可为“简单”、“突出显示”或“筛选”。","控制列表和树中的键盘导航是否仅通过键入自动触发。如果设置为 `false` ,键盘导航只在执行 `list.toggleKeyboardNavigation` 命令时触发,您可以为该命令指定键盘快捷方式。"],"vs/platform/markers/common/markers":["错误","警告","信息"],"vs/platform/quickinput/browser/commandsQuickAccess":["{0}, {1}","最近使用","其他命令",'命令"{0}"导致错误 ({1})'],"vs/platform/quickinput/browser/helpQuickAccess":["全局命令","编辑器命令","{0}, {1}"], +"vs/platform/theme/common/colorRegistry":["整体前景色。此颜色仅在不被组件覆盖时适用。","错误信息的整体前景色。此颜色仅在不被组件覆盖时适用。","工作台中图标的默认颜色。","焦点元素的整体边框颜色。此颜色仅在不被其他组件覆盖时适用。","在元素周围额外的一层边框,用来提高对比度从而区别其他元素。","在活动元素周围额外的一层边框,用来提高对比度从而区别其他元素。","文本中链接的前景色。","文本中代码块的背景颜色。","编辑器内小组件(如查找/替换)的阴影颜色。","输入框背景色。","输入框前景色。","输入框边框。","输入字段中已激活选项的边框颜色。","输入字段中激活选项的背景颜色。","输入字段中已激活的选项的前景色。","输入验证结果为信息级别时的背景色。","输入验证结果为信息级别时的前景色。","严重性为信息时输入验证的边框颜色。","严重性为警告时输入验证的背景色。","输入验证结果为警告级别时的前景色。","严重性为警告时输入验证的边框颜色。","输入验证结果为错误级别时的背景色。","输入验证结果为错误级别时的前景色。","严重性为错误时输入验证的边框颜色。","下拉列表背景色。","下拉列表前景色。","按钮前景色。","按钮背景色。","按钮在悬停时的背景颜色。","Badge 背景色。Badge 是小型的信息标签,如表示搜索结果数量的标签。","Badge 前景色。Badge 是小型的信息标签,如表示搜索结果数量的标签。","表示视图被滚动的滚动条阴影。","滚动条滑块背景色","滚动条滑块在悬停时的背景色","滚动条滑块在被点击时的背景色。","表示长时间操作的进度条的背景色。","编辑器中错误波浪线的前景色。","编辑器中错误框的边框颜色。","编辑器中警告波浪线的前景色。","编辑器中警告框的边框颜色。","编辑器中信息波浪线的前景色。","编辑器中信息框的边框颜色。","编辑器中提示波浪线的前景色。","编辑器中提示框的边框颜色。","编辑器背景色。","编辑器默认前景色。","编辑器组件(如查找/替换)背景颜色。","编辑器小部件的前景色,如查找/替换。","编辑器小部件的边框颜色。此颜色仅在小部件有边框且不被小部件重写时适用。","编辑器小部件大小调整条的边框颜色。此颜色仅在小部件有调整边框且不被小部件颜色覆盖时使用。","背景颜色快速选取器。快速选取器小部件是选取器(如命令调色板)的容器。","前景颜色快速选取器。快速选取器小部件是命令调色板等选取器的容器。","标题背景颜色快速选取器。快速选取器小部件是命令调色板等选取器的容器。","快速选取器分组标签的颜色。","快速选取器分组边框的颜色。","编辑器所选内容的颜色。","用以彰显高对比度的所选文本的颜色。","非活动编辑器中所选内容的颜色,颜色必须透明,以免隐藏下面的装饰效果。","具有与所选项相关内容的区域的颜色。颜色必须透明,以免隐藏下面的修饰效果。","与所选项内容相同的区域的边框颜色。","当前搜索匹配项的颜色。","其他搜索匹配项的颜色。颜色必须透明,以免隐藏下面的修饰效果。","限制搜索范围的颜色。颜色不能不透明,以免隐藏底层装饰。","当前搜索匹配项的边框颜色。","其他搜索匹配项的边框颜色。","限制搜索的范围的边框颜色。颜色必须透明,以免隐藏下面的修饰效果。","在下面突出显示悬停的字词。颜色必须透明,以免隐藏下面的修饰效果。","编辑器悬停提示的背景颜色。","编辑器悬停的前景颜色。","光标悬停时编辑器的边框颜色。","编辑器悬停状态栏的背景色。","活动链接颜色。","用于灯泡操作图标的颜色。","用于灯泡自动修复操作图标的颜色。","已插入的文本的背景色。颜色必须透明,以免隐藏下面的修饰效果。","已删除的文本的背景色。颜色必须透明,以免隐藏下面的修饰效果。","插入的文本的轮廓颜色。","被删除文本的轮廓颜色。","两个文本编辑器之间的边框颜色。","差异编辑器的对角线填充颜色。对角线填充用于并排差异视图。","焦点项在列表或树活动时的背景颜色。活动的列表或树具有键盘焦点,非活动的没有。","焦点项在列表或树活动时的前景颜色。活动的列表或树具有键盘焦点,非活动的没有。","已选项在列表或树活动时的背景颜色。活动的列表或树具有键盘焦点,非活动的没有。","已选项在列表或树活动时的前景颜色。活动的列表或树具有键盘焦点,非活动的没有。","已选项在列表或树非活动时的背景颜色。活动的列表或树具有键盘焦点,非活动的没有。","已选项在列表或树非活动时的前景颜色。活动的列表或树具有键盘焦点,非活动的没有。","非活动的列表或树控件中焦点项的背景颜色。活动的列表或树具有键盘焦点,非活动的没有。","使用鼠标移动项目时,列表或树的背景颜色。","鼠标在项目上悬停时,列表或树的前景颜色。","使用鼠标移动项目时,列表或树进行拖放的背景颜色。","在列表或树中搜索时,其中匹配内容的高亮颜色。","列表和树中类型筛选器小组件的背景色。","列表和树中类型筛选器小组件的轮廓颜色。","当没有匹配项时,列表和树中类型筛选器小组件的轮廓颜色。","缩进参考线的树描边颜色。","菜单的边框颜色。","菜单项的前景颜色。","菜单项的背景颜色。","菜单中选定菜单项的前景色。","菜单中所选菜单项的背景色。","菜单中所选菜单项的边框颜色。","菜单中分隔线的颜色。","代码片段 Tab 位的高亮背景色。","代码片段 Tab 位的高亮边框颜色。","代码片段中最后的 Tab 位的高亮背景色。","代码片段中最后的制表位的高亮边框颜色。","用于查找匹配项的概述标尺标记颜色。颜色必须透明,以免隐藏下面的修饰效果。","用于突出显示所选内容的概述标尺标记颜色。颜色必须透明,以免隐藏下面的修饰效果。","用于查找匹配项的迷你地图标记颜色。","编辑器选区在迷你地图中对应的标记颜色。","用于错误的迷你地图标记颜色。","用于警告的迷你地图标记颜色。","迷你地图背景颜色。","迷你地图滑块背景颜色。","悬停时,迷你地图滑块的背景颜色。","单击时,迷你地图滑块的背景颜色。","用于问题错误图标的颜色。","用于问题警告图标的颜色。","用于问题信息图标的颜色。"], +"vs/platform/undoRedo/common/undoRedoService":["以下文件已关闭并且已在磁盘上修改: {0}。","以下文件已以不兼容的方式修改: {0}。","无法在所有文件中撤消“{0}”。{1}","无法在所有文件中撤消“{0}”。{1}","无法撤消所有文件的“{0}”,因为已更改 {1}","无法跨所有文件撤销“{0}”,因为 {1} 上已有一项撤消或重做操作正在运行","无法跨所有文件撤销“{0}”,因为同时发生了一项撤消或重做操作","是否要在所有文件中撤消“{0}”?","在 {0} 个文件中撤消","撤消此文件","取消","无法撤销“{0}”,因为已有一项撤消或重做操作正在运行。","无法在所有文件中重做“{0}”。{1}","无法在所有文件中重做“{0}”。{1}","无法对所有文件重做“{0}”,因为已更改 {1}","无法跨所有文件重做“{0}”,因为 {1} 上已有一项撤消或重做操作正在运行","无法跨所有文件重做“{0}”,因为同时发生了一项撤消或重做操作","无法重做“{0}”,因为已有一项撤消或重做操作正在运行。"]}); +//# sourceMappingURL=../../../min-maps/vs/editor/editor.main.nls.zh-cn.js.map \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/editor/editor.main.nls.zh-tw.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/editor/editor.main.nls.zh-tw.js new file mode 100644 index 0000000..0aedd5c --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/editor/editor.main.nls.zh-tw.js @@ -0,0 +1,27 @@ +/*!----------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Version: 0.21.2(67b5a8116f3c0bace36b180e524e05bb750a16d8) + * Released under the MIT license + * https://github.com/Microsoft/vscode/blob/master/LICENSE.txt + *-----------------------------------------------------------*/ +define("vs/editor/editor.main.nls.zh-tw",{"vs/base/browser/ui/actionbar/actionViewItems":["{0} ({1})"],"vs/base/browser/ui/findinput/findInput":["輸入"],"vs/base/browser/ui/findinput/findInputCheckboxes":["大小寫須相符","全字拼寫須相符","使用規則運算式"],"vs/base/browser/ui/findinput/replaceInput":["輸入","保留案例"],"vs/base/browser/ui/inputbox/inputBox":["錯誤: {0}","警告: {0}","資訊: {0}"],"vs/base/browser/ui/keybindingLabel/keybindingLabel":["未繫結"],"vs/base/browser/ui/menu/menu":["{0} ({1})"],"vs/base/browser/ui/tree/abstractTree":["清除","在類型上停用篩選","在類型上啟用篩選","找不到任何元素","{1} 項元素中有 {0} 項相符"],"vs/base/common/errorMessage":["{0}: {1}","發生系統錯誤 ({0})","發生未知的錯誤。如需詳細資訊,請參閱記錄檔。","發生未知的錯誤。如需詳細資訊,請參閱記錄檔。","{0} (總計 {1} 個錯誤)","發生未知的錯誤。如需詳細資訊,請參閱記錄檔。"],"vs/base/common/keybindingLabels":["Ctrl","Shift","Alt","Windows","Ctrl","Shift","Alt","超級鍵","Control","Shift","Alt","命令","Control","Shift","Alt","Windows","Control","Shift","Alt","超級鍵"], +"vs/base/parts/quickinput/browser/quickInput":["上一頁","{0}/{1}","輸入以縮小結果範圍。","{0} 個結果","已選擇 {0}","確定","自訂","背面 ({0})","上一頁"],"vs/base/parts/quickinput/browser/quickInputList":["快速輸入"],"vs/editor/browser/controller/coreCommands":["即使行的長度過長,仍要堅持至結尾","即使行的長度過長,仍要堅持至結尾"],"vs/editor/browser/controller/textAreaHandler":["編輯器","目前無法存取此編輯器。請按 {0} 取得選項。"],"vs/editor/browser/editorExtensions":["復原(&&U)","復原","取消復原(&&R)","重做","全選(&&S)","全選"],"vs/editor/browser/widget/codeEditorWidget":["游標數已限制為 {0} 個。"],"vs/editor/browser/widget/diffEditorWidget":["因其中一個檔案過大而無法比較。"],"vs/editor/browser/widget/diffReview":["關閉","未變更任一行","已變更 1 行","已變更 {0} 行","{1} 項差異中的第 {0} 項: 原始行 {2}、{3},修改行 {4}、{5}","空白","{0} 未變更行 {1}","{0} 原始行 {1} 修改的行 {2}","+ {0} 修改行 {1}","- {0} 原始行 {1}","移至下一個差異","移至上一個差異"],"vs/editor/browser/widget/inlineDiffMargin":["複製已刪除的行","複製已刪除的行","複製已刪除的行 ({0})","還原此變更","複製已刪除的行 ({0})"], +"vs/editor/common/config/commonEditorConfig":["編輯器","與 Tab 相等的空格數量。當 `#editor.detectIndentation#` 已開啟時,會根據檔案內容覆寫此設定。","在按 `Tab` 時插入空格。當 `#editor.detectIndentation#` 開啟時,會根據檔案內容覆寫此設定。","根據檔案內容,控制當檔案開啟時,是否自動偵測 `#editor.tabSize#` 和 `#editor.insertSpaces#`。","移除尾端自動插入的空白字元。","針對大型檔案停用部分高記憶體需求功能的特殊處理方式。","控制是否應根據文件中的單字計算自動完成。","所有彩色主題皆已啟用語意醒目提示。","所有彩色主題皆已停用語意醒目提示。","語意醒目提示由目前之彩色佈景主題的 'semanticHighlighting' 設定所設定。","控制 semanticHighlighting 是否會為支援的語言顯示。","即使按兩下內容或按 `Escape`,仍保持瞄孔編輯器開啟。","因效能的緣故,不會將超過此高度的行 Token 化","取消 Diff 計算前的逾時限制 (毫秒)。若無逾時,請使用 0。","控制 Diff 編輯器要並排或內嵌顯示 Diff。","啟用時,Diff 編輯器會忽略前置或後置空格的變更。","控制 Diff 編輯器是否要為新增/移除的變更顯示 +/- 標記。","控制編輯器是否顯示 codelens。"], +"vs/editor/common/config/editorOptions":["編輯器將使用平台 API 以偵測螢幕助讀程式附加。","編輯器將會為螢幕助讀程式的使用方式永久地最佳化。","編輯器不會為螢幕助讀程式的使用方式進行最佳化。","控制編輯器是否應於已為螢幕助讀程式最佳化的模式中執行。","控制是否要在註解時插入空白字元。","控制是否應以行註解的切換、新增或移除動作,忽略空白的行。","控制複製時不選取任何項目是否會複製目前程式行。","控制在輸入期間是否要跳過游標來尋找相符的項目。","控制 [尋找小工具] 中的搜尋字串是否來自編輯器選取項目。","永不自動開啟 [在選取範圍中尋找] (預設)","一律自動開啟 [在選取範圍中尋找]","選取多行內容時,自動開啟 [在選取範圍中尋找]。","控制自動開啟在選取範圍中尋找的條件。","控制尋找小工具是否在 macOS 上讀取或修改共用尋找剪貼簿。","控制尋找小工具是否應在編輯器頂端額外新增行。若為 true,當您可看到尋找小工具時,您的捲動範圍會超過第一行。","當再也找不到其他相符項目時,控制是否自動從開頭 (或結尾) 重新開始搜尋。","啟用/停用連字字型。","明確 font-feature-settings。","設定連字字型或字型功能。","控制字型大小 (像素)。","只允許「一般」及「粗體」關鍵字,或介於 1 到 1000 之間的數值。","控制字型粗細。接受「一般」及「粗體」關鍵字,或介於 1 到 1000 之間的數值。","顯示結果的預覽檢視 (預設)","移至主要結果並顯示預覽檢視","前往主要結果,並對其他人啟用無預覽瀏覽","此設定已淘汰,請改用 'editor.editor.gotoLocation.multipleDefinitions' 或 'editor.editor.gotoLocation.multipleImplementations' 等單獨設定。","控制 'Go to Definition' 命令在有多個目標位置存在時的行為。","控制 'Go to Type Definition' 命令在有多個目標位置存在時的行為。","控制 'Go to Declaration' 命令在有多個目標位置存在時的行為。","控制 'Go to Implementations' 命令在有多個目標位置存在時的行為。","控制 'Go to References' 命令在有多個目標位置存在時的行為。","當 'Go to Definition' 的結果為目前位置時,正在執行的替代命令識別碼。","當 'Go to Type Definition' 的結果為目前位置時,正在執行的替代命令識別碼。","當 'Go to Declaration' 的結果為目前位置時,正在執行的替代命令識別碼。","當 'Go to Implementation' 的結果為目前位置時,正在執行的替代命令識別碼。","當 'Go to Reference' 的結果為目前位置時,正在執行的替代命令識別碼。","控制是否顯示暫留。","控制暫留顯示的延遲時間 (以毫秒為單位)。","控制當滑鼠移過時,是否應保持顯示暫留。","在編輯器中啟用程式碼動作燈泡。","控制行高。使用 0 會從字型大小計算行高。","控制是否會顯示縮圖","縮圖大小與編輯器內容相同 (且可能會捲動)。","縮圖會視需要伸縮,以填滿該編輯器的高度 (無捲動)。","縮圖將視需要縮小,一律不會大於該編輯器 (無捲動)。","控制縮圖的大小。","控制要在哪端呈現縮圖。","控制何時顯示迷你地圖滑桿。","縮圖內所繪製的內容大小: 1、2 或 3。","顯示行中的實際字元,而不是色彩區塊。","限制縮圖的寬度,最多顯示某個數目的列。","控制編輯器上邊緣與第一行之間的空格數。","控制編輯器下邊緣與最後一行之間的空格數。","啟用快顯,在您鍵入的同時顯示參數文件和類型資訊。","控制提示功能表是否在清單結尾時循環或關閉。","允許在字串內顯示即時建議。","允許在註解中顯示即時建議。","允許在字串與註解以外之處顯示即時建議。","控制是否應在鍵入時自動顯示建議。","不顯示行號。","行號以絕對值顯示。","行號以目前游標的相對值顯示。","每 10 行顯示行號。","控制行號的顯示。","這個編輯器尺規會轉譯的等寬字元數。","此編輯器尺規的色彩。","在某個數目的等寬字元之後顯示垂直尺規。如有多個尺規,就會使用多個值。若陣列空白,就不會繪製任何尺規。","插入建議而不覆寫游標旁的文字。","插入建議並覆寫游標旁的文字。","控制是否要在接受完成時覆寫字組。請注意,這取決於加入此功能的延伸模組。","控制對於拚錯字是否進行篩選和排序其建議","控制排序是否會偏好游標附近出現的字組。","控制記錄的建議選取項目是否在多個工作區和視窗間共用 (需要 `#editor.suggestSelection#`)。","控制正在使用的程式碼片段是否會避免快速建議。","控制要在建議中顯示或隱藏圖示。","控制 IntelliSense 顯示捲軸前要顯示多少建議 (最多 15 個)。","此設定已淘汰,請改用 'editor.suggest.showKeywords' 或 'editor.suggest.showSnippets' 等單獨設定。","啟用時,IntelliSense 顯示「方法」建議。","啟用時,IntelliSense 顯示「函式」建議。","啟用時,IntelliSense 顯示「建構函式」建議。","啟用時,IntelliSense 顯示「欄位」建議。","啟用時,IntelliSense 顯示「變數」建議。","啟用時,IntelliSense 顯示「類別」建議。","啟用時,IntelliSense 顯示「結構」建議。","啟用時,IntelliSense 顯示「介面」建議。","啟用時,IntelliSense 顯示「模組」建議。","啟用時,IntelliSense 顯示「屬性」建議。","啟用時,IntelliSense 顯示「事件」建議。","啟用時,IntelliSense 顯示「運算子」建議。","啟用時,IntelliSense 顯示「單位」建議。","啟用時,IntelliSense 顯示「值」建議。","啟用時,IntelliSense 顯示「常數」建議。","啟用時,IntelliSense 顯示「列舉」建議。","啟用時,IntelliSense 顯示「enumMember」建議。","啟用時,IntelliSense 顯示「關鍵字」建議。","啟用時,IntelliSense 顯示「文字」建議。","啟用時,IntelliSense 顯示「色彩」建議。","啟用時,IntelliSense 顯示「檔案」建議。","啟用時,IntelliSense 顯示「參考」建議。","啟用時,IntelliSense 顯示「customcolor」建議。","啟用時,IntelliSense 顯示「資料夾」建議。","啟用時,IntelliSense 顯示「typeParameter」建議。","啟用時,IntelliSense 顯示「程式碼片段」建議。","啟用之後,IntelliSense 會顯示 `user`-suggestions。","啟用時,IntelliSense 會顯示 `issues`-suggestions。","控制建議小工具底下的狀態列可見度。","控制是否透過認可字元接受建議。例如在 JavaScript 中,分號 (';') 可以是接受建議並鍵入該字元的認可字元。","在建議進行文字變更時,僅透過 `Enter` 接受建議。","控制除了 'Tab' 外,是否也透過 'Enter' 接受建議。這有助於避免混淆要插入新行或接受建議。","控制編輯器中螢幕助讀程式可讀出的行數。警告: 大於預設的數目會對效能產生影響。","編輯器內容","使用語言配置確定何時自動關閉括號。","僅當游標位於空白的左側時自動關閉括號。","控制編輯器是否應在使用者新增左括弧後,自動加上右括弧。","僅在自動插入右引號或括號時,才在其上方鍵入。","控制編輯器是否應在右引號或括號上鍵入。","使用語言配置確定何時自動關閉引號。","僅當游標位於空白的左側時自動關閉引號。","控制編輯器是否應在使用者新增開始引號後,自動加上關閉引號。","編輯器不會自動插入縮排。","編輯器會保留目前行的縮排。","編輯器會保留目前行的縮排並接受語言定義的括號。","編輯器會目前行的縮排、接受語言定義的括號並叫用語言定義的特殊 onEnterRules。","編輯器會保留目前行的縮排、接受語言定義的括號並叫用語言定義的特殊 onEnterRules 並接受語言定義的 indentationRules。","控制編輯器是否應在使用者鍵入、貼上、移動或縮排行時自動調整縮排。","使用語言組態來決定何時自動環繞選取項目。","用引號括住,而非使用括弧。","用括弧括住,而非使用引號。 ","控制編輯器是否應自動環繞選取項目。","控制編輯器是否顯示 codelens。","控制編輯器是否應轉譯內嵌色彩裝飾項目與色彩選擇器。","啟用即可以滑鼠與按鍵選取進行資料行選取。","控制語法醒目提示是否應複製到剪貼簿。","控制資料指標動畫樣式。","控制是否應啟用平滑插入點動畫。 ","控制資料指標樣式。","控制游標上下周圍的最少可見行數。在某些編輯器中稱為 'scrollOff' 或 `scrollOffset`。","只有通過鍵盤或 API 觸發時,才會施行 `cursorSurroundingLines`。","一律強制執行 `cursorSurroundingLines`","控制應施行 `cursorSurroundingLines` 的時機。","控制游標寬度,當 `#editor.cursorStyle#` 設定為 `line` 時。","控制編輯器是否允許透過拖放來移動選取項目。","按下 `Alt` 時的捲動速度乘數。","控制編輯器是否啟用程式碼摺疊功能。","使用語言特定摺疊策略 (如果可用),否則使用縮排式策略。","使用縮排式摺疊策略。","控制計算資料夾範圍的策略。","控制編輯器是否應將折疊的範圍醒目提示。","控制按一下已折疊行後方的空白內容是否會展開行。","控制字型家族。","控制編輯器是否應自動為貼上的內容設定格式。必須有可用的格式器,而且格式器應能夠為文件中的一個範圍設定格式。","控制編輯器是否應自動在鍵入後設定行的格式。","控制編輯器是否應轉譯垂直字符邊界。字符邊界最常用來進行偵錯。","控制游標是否應隱藏在概觀尺規中。","控制編輯器是否應醒目提示使用中的縮排輔助線。","控制字母間距 (像素)。","控制編輯器是否應偵測連結並使其可供點選。","將符合的括號醒目提示。","要用於滑鼠滾輪捲動事件 `deltaX` 和 `deltaY` 的乘數。","使用滑鼠滾輪並按住 `Ctrl` 時,縮放編輯器的字型","在多個游標重疊時將其合併。","對應Windows和Linux的'Control'與對應 macOS 的'Command'。","對應Windows和Linux的'Alt'與對應macOS的'Option'。","用於在滑鼠新增多個游標的乘數。「移至定義」和「開啟連結」滑鼠手勢會加以適應,以避免與多個游標的乘數相衝突。[深入了解](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier)。","每個游標都會貼上一行文字。","每個游標都會貼上全文。","當已貼上文字的行數與游標數相符時控制貼上功能。","控制編輯器是否應醒目顯示出現的語意符號。","控制是否應在概觀尺規周圍繪製框線。","開啟預覽時焦點樹狀","開啟時聚焦編輯器","控制要聚焦內嵌編輯器或預覽小工具中的樹系。","控制「前往定義」滑鼠手勢,是否一律開啟瞄核小工具。","控制在快速建議顯示後的延遲 (以毫秒為單位)。","控制編輯器是否會自動依類型重新命名。","控制編輯器是否應顯示控制字元。","控制編輯器是否應顯示縮排輔助線。","在檔案結尾為新行時,呈現最後一行的號碼。","醒目提示裝訂邊和目前的行。","控制編輯器如何顯示目前行的醒目提示。","當焦點為該編輯器時,控制該編輯器是否僅應轉譯目前行的醒目提示","轉譯空白字元,但文字之間的單一空格除外。","只轉譯所選文字的空白字元。","只轉譯結尾空白字元","控制編輯器應如何轉譯空白字元。","控制選取範圍是否有圓角","控制編輯器水平捲動的額外字元數。","控制編輯器是否捲動到最後一行之外。","同時進行垂直與水平捲動時,僅沿主軸捲動。避免在軌跡板上進行垂直捲動時發生水平漂移。","控制是否支援 Linux 主要剪貼簿。","控制編輯器是否應醒目提示與選取項目類似的相符項目。","一律顯示摺疊控制項。","僅當滑鼠懸停在活動列上時,才顯示折疊功能。","控制摺疊控制項在裝訂邊上的顯示時機。","控制未使用程式碼的淡出。","控制已刪除的淘汰變數。","將程式碼片段建議顯示於其他建議的頂端。","將程式碼片段建議顯示於其他建議的下方。","將程式碼片段建議與其他建議一同顯示。","不顯示程式碼片段建議。","控制程式碼片段是否隨其他建議顯示,以及其排序方式。","控制編輯器是否會使用動畫捲動","建議小工具的字型大小。當設定為 `0` 時,則使用 `#editor.fontSize#` 值.","建議小工具的行高。當設定為 `0` 時,則使用 `#editor.lineHeight#` 值.","控制建議是否應在鍵入觸發字元時自動顯示。","一律選取第一個建議。","除非進一步鍵入選取了建議,否則選取最近的建議,例如 `console.| -> console.log`,原因是最近完成了 `log`。","根據先前已完成該建議的前置詞選取建議,例如 `co -> console` 和 `con -> const`。","控制在顯示建議清單時如何預先選取建議。","按 Tab 時,Tab 完成會插入最符合的建議。","停用 tab 鍵自動完成。","在程式碼片段的首碼相符時使用 Tab 完成。未啟用 'quickSuggestions' 時效果最佳。","啟用 tab 鍵自動完成。","忽略異常的行結束字元。","要移除之異常的行結束字元提示。","自動移除異常的行結束字元。","移除可能導致問題的異常行結束字元。","插入和刪除接在定位停駐點後的空白字元。","在執行文字相關導覽或作業時要用作文字分隔符號的字元","一律不換行。","依檢視區寬度換行。","於 '#editor.wordWrapColumn#' 換行。","當檢視區縮至最小並設定 '#editor.wordWrapColumn#' 時換行。","控制如何換行。","當 `#editor.wordWrap#` 為 `wordWrapColumn` 或 `bounded` 時,控制編輯器中的資料行換行。","無縮排。換行從第 1 列開始。","換行的縮排會與父行相同。","換行的縮排為父行 +1。","換行縮排為父行 +2。","控制換行的縮排。","假設所有字元的寬度均相同。這是一種快速的演算法,適用於等寬字型,以及字符寬度相同的部分指令碼 (例如拉丁文字元)。","將外圍點計算委派給瀏覽器。這是緩慢的演算法,如果檔案較大可能會導致凍結,但在所有情況下都正常運作。","控制計算外圍點的演算法。"], +"vs/editor/common/model/editStack":["正在鍵入"],"vs/editor/common/modes/modesRegistry":["純文字"],"vs/editor/common/standaloneStrings":["無選取項目","第 {0} 行,第 {1} 欄 (已選取 {2})","第 {0} 行,第 {1} 欄","{0} 個選取項目 (已選取 {1} 個字元)","{0} 個選取項目","立即將設定 `accessibilitySupport` 變更為 'on’。","立即開啟編輯器協助工具文件頁面。","在 Diff 編輯器的唯讀窗格中。","在 Diff 編輯器的窗格中。","在唯讀程式碼編輯器中","在程式碼編輯器中","若要為編輯器進行最能搭配螢幕助讀程式使用的設定,請立即按 Command+E。","若要將編輯器設定為針對搭配螢幕助讀程式使用最佳化,請立即按 Control+E。","編輯器已設定為針對搭配螢幕助讀程式使用最佳化。","已將此編輯器設定為永遠不針對搭配螢幕助讀程式使用最佳化,但目前不是此情況。","在目前的編輯器中按 Tab 鍵會將焦點移至下一個可設定焦點的元素。按 {0} 可切換此行為。","在目前的編輯器中按 Tab 鍵會將焦點移至下一個可設定焦點的元素。命令 {0} 目前無法由按鍵繫結關係觸發。","在目前的編輯器中按 Tab 鍵會插入定位字元。按 {0} 可切換此行為。","在目前的編輯器中按 Tab 鍵會插入定位字元。命令 {0} 目前無法由按鍵繫結關係觸發。","立即按 Command+H,以開啟提供編輯器協助工具相關詳細資訊的瀏覽器視窗。","立即按 Control+H,以開啟提供編輯器協助工具相關詳細資訊的瀏覽器視窗。","您可以按 Esc 鍵或 Shift+Esc 鍵來解除此工具提示並返回編輯器。","顯示協助工具說明","開發人員: 檢查權杖","前往行/欄...","顯示所有快速存取提供者","命令選擇區","顯示並執行命令","移至符號...","前往符號 (依類別)...","編輯器內容","按 Alt+F1 可取得協助工具選項。","切換高對比佈景主題","已在 {1} 檔案中進行 {0} 項編輯"], +"vs/editor/common/view/editorColorRegistry":["目前游標位置行的反白顯示背景色彩。","目前游標位置行之周圍框線的背景色彩。","醒目提示範圍的背景色彩,例如快速開啟並尋找功能。其不得為不透明色彩,以免隱藏底層裝飾。","反白顯示範圍周圍邊框的背景顏色。","醒目提示符號的背景色彩,相似於前往下一個定義或前往下一個/上一個符號。色彩必須透明,以免隱藏底層裝飾。","醒目提示周圍的邊界背景色彩。","編輯器游標的色彩。","編輯器游標的背景色彩。允許自訂區塊游標重疊的字元色彩。","編輯器中空白字元的色彩。","編輯器縮排輔助線的色彩。","使用中編輯器縮排輔助線的色彩。","編輯器行號的色彩。","編輯器使用中行號的色彩","Id 已取代。請改用 'editorLineNumber.activeForeground' 。","編輯器使用中行號的色彩","編輯器尺規的色彩","編輯器程式碼濾鏡的前景色彩","成對括號背景色彩","成對括號邊框色彩","預覽檢視編輯器尺規的邊框色彩.","編輯器概觀尺規的背景色彩。僅在啟用縮圖並將其置於編輯器右側時使用。","編輯器邊框的背景顏色,包含行號與字形圖示的邊框.","編輯器中不必要 (未使用) 原始程式碼的框線色彩。","編輯器中不必要 (未使用) 原始程式碼的不透明度。例如 \"#000000c0” 會以 75% 的不透明度轉譯程式碼。針對高對比主題,使用 'editorUnnecessaryCode.border' 主題色彩可為不必要的程式碼加上底線,而不是將其變淡。","範圍醒目提示的概觀尺規標記色彩。其不得為不透明色彩,以免隱藏底層裝飾。","錯誤的概觀尺規標記色彩。","警示的概觀尺規標記色彩。","資訊的概觀尺規標記色彩。"],"vs/editor/contrib/anchorSelect/anchorSelect":["選取範圍錨點","設定錨點為 {0}:{1}","設定選取範圍錨點","前往選取範圍錨點","選取從錨點到游標之間的範圍","取消選取範圍錨點"],"vs/editor/contrib/bracketMatching/bracketMatching":["成對括弧的概觀尺規標記色彩。","移至方括弧","選取至括弧","前往括弧(&&B)"], +"vs/editor/contrib/caretOperations/caretOperations":["將所選文字向左移動","將所選文字向右移動"],"vs/editor/contrib/caretOperations/transpose":["調換字母"],"vs/editor/contrib/clipboard/clipboard":["剪下(&&T)","剪下","剪下","複製(&&C)","複製","複製","貼上(&&P)","貼上","貼上","隨語法醒目提示複製"],"vs/editor/contrib/codeAction/codeActionCommands":["要執行程式碼動作的種類。","控制要套用傳回動作的時機。","一律套用第一個傳回的程式碼動作。","如果傳回的程式碼動作是唯一動作,則加以套用。","不要套用傳回的程式碼動作。","控制是否僅應傳回偏好的程式碼動作。","套用程式碼動作時發生未知的錯誤","快速修復...","沒有可用的程式碼操作",'沒有 "{0}" 的偏好程式碼動作','沒有 "{0}" 可用的程式碼動作',"沒有可用的偏好程式碼動作","沒有可用的程式碼操作","重構...","沒有適用於 '{0}' 的偏好重構。",'沒有可用的 "{0}" 重構',"沒有可用的偏好重構","沒有可用的重構","來源動作...","沒有適用於 '{0}' 的偏好來源動作",'沒有 "{0}" 可用的來源動作',"沒有可用的偏好來源動作","沒有可用的來源動作","組織匯入","沒有任何可用的組織匯入動作","全部修正","沒有全部修正動作可用","自動修正...","沒有可用的自動修正"],"vs/editor/contrib/codeAction/lightBulbWidget":["顯示修正程式。偏好的修正程式可用 ({0})","顯示修正 ({0})","顯示修正"],"vs/editor/contrib/codelens/codelensController":["顯示目前行的 Code Lens 命令"],"vs/editor/contrib/comment/comment":["切換行註解","切換行註解(&&T)","加入行註解","移除行註解","切換區塊註解","切換區塊註解(&&B)"], +"vs/editor/contrib/contextmenu/contextmenu":["顯示編輯器內容功能表"],"vs/editor/contrib/cursorUndo/cursorUndo":["游標復原","游標重做"], +"vs/editor/contrib/documentSymbols/outlineTree":["陣列符號的前景色彩。這些符號會出現在大綱、階層連結和建議小工具中。","布林值符號的前景色彩。這些符號會出現在大綱、階層連結和建議小工具中。","類別符號的前景色彩。這些符號會出現在大綱、階層連結和建議小工具中。","色彩符號的前景色彩。這些符號會出現在大綱、階層連結和建議小工具中。","常數符號的前景色彩。這些符號會出現在大綱、階層連結和建議小工具中。","建構函式符號的前景色彩。這些符號會出現在大綱、階層連結和建議小工具中。","列舉值符號的前景色彩。這些符號會出現在大綱、階層連結和建議小工具中。","列舉值成員符號的前景色彩。這些符號會出現在大綱、階層連結和建議小工具中。","事件符號的前景色彩。這些符號會出現在大綱、階層連結和建議小工具中。","欄位符號的前景色彩。這些符號會出現在大綱、階層連結和建議小工具中。","檔案符號的前景色彩。這些符號會出現在大綱、階層連結和建議小工具中。","資料夾符號的前景色彩。這些符號會出現在大綱、階層連結和建議小工具中。","函式符號的前景色彩。這些符號會出現在大綱、階層連結和建議小工具中。","介面符號的前景色彩。這些符號會出現在大綱、階層連結和建議小工具中。","索引鍵符號的前景色彩。這些符號會出現在大綱、階層連結和建議小工具中。","關鍵字符號的前景色彩。這些符號會出現在大綱、階層連結和建議小工具中。","方法符號的前景色彩。這些符號會出現在大綱、階層連結和建議小工具中。","模組符號的前景色彩。這些符號會出現在大綱、階層連結和建議小工具中。","命名空間符號的前景色彩。這些符號會出現在大綱、階層連結和建議小工具中。","Null 符號的前景色彩。這些符號會出現在大綱、階層連結和建議小工具中。","數字符號的前景色彩。這些符號會出現在大綱、階層連結和建議小工具中。","物件符號的前景色彩。這些符號會出現在大綱、階層連結和建議小工具中。","運算子符號的前景色彩。這些符號會出現在大綱、階層連結和建議小工具中。","套件符號的前景色彩。這些符號會出現在大綱、階層連結和建議小工具中。","屬性符號的前景色彩。這些符號會出現在大綱、階層連結和建議小工具中。","參考符號的前景色彩。這些符號會出現在大綱、階層連結和建議小工具中。","程式碼片段符號的前景色彩。這些符號會出現在大綱、階層連結和建議小工具中。","字串符號的前景色彩。這些符號會出現在大綱、階層連結和建議小工具中。","結構符號的前景色彩。這些符號會出現在大綱、階層連結和建議小工具中。","文字符號的前景色彩。這些符號會出現在大綱、階層連結和建議小工具中。","型別參數符號的前景色彩。這些符號會出現在大綱、階層連結和建議小工具中。","單位符號的前景色彩。這些符號會出現在大綱、階層連結和建議小工具中。","變數符號的前景色彩。這些符號會出現在大綱、階層連結和建議小工具中。"], +"vs/editor/contrib/find/findController":["尋找","尋找(&&F)","尋找選取項目","尋找下一個","尋找下一個","尋找上一個","尋找上一個","尋找下一個選取項目","尋找上一個選取項目","取代","取代(&&R)"],"vs/editor/contrib/find/findWidget":["尋找","尋找","上一個符合項目","下一個符合項目","在選取範圍中尋找","關閉","取代","取代","取代","全部取代","切換取代模式","僅反白顯示前 {0} 筆結果,但所有尋找作業會在完整文字上執行。","{1} 的 {0}","查無結果","找到 {0}","以 '{1}' 找到 {0}","以 '{1}' 找到 {0},位於 {2}","已以 '{1}' 找到 {0}","Ctrl+Enter 現在會插入分行符號,而不會全部取代。您可以修改 editor.action.replaceAll 的按鍵繫結關係,以覆寫此行為。"],"vs/editor/contrib/folding/folding":["展開","以遞迴方式展開","摺疊","切換摺疊","以遞迴方式摺疊","摺疊全部區塊註解","摺疊所有區域","展開所有區域","全部摺疊","全部展開","摺疊層級 {0}","已摺疊範圍後的背景色彩。色彩不得處於不透明狀態,以免隱藏底層裝飾。","編輯器裝訂邊的摺疊控制項色彩。"],"vs/editor/contrib/fontZoom/fontZoom":["編輯器字體放大","編輯器字型縮小","編輯器字體重設縮放"],"vs/editor/contrib/format/format":["在行 {0} 編輯了 1 項格式","在行 {1} 編輯了 {0} 項格式","在行 {0} 與行 {1} 之間編輯了 1 項格式","在行 {1} 與行 {2} 之間編輯了 {0} 項格式"],"vs/editor/contrib/format/formatActions":["格式化文件","格式化選取範圍"], +"vs/editor/contrib/gotoError/gotoError":["移至下一個問題 (錯誤, 警告, 資訊)","移至上一個問題 (錯誤, 警告, 資訊)","移至檔案裡面的下一個問題 (錯誤, 警告, 資訊)","下一個問題(&&P)","移至檔案裡面的上一個問題 (錯誤, 警告, 資訊)","前一個問題(&&P)"],"vs/editor/contrib/gotoError/gotoErrorWidget":["錯誤","警告","資訊","提示","{0} 於 {1}。","{0} 個問題 (共 {1} 個)","{0} 個問題 (共 {1} 個)","編輯器標記導覽小工具錯誤的色彩。","編輯器標記導覽小工具警告的色彩。","編輯器標記導覽小工具資訊的色彩","編輯器標記導覽小工具的背景。"],"vs/editor/contrib/gotoSymbol/goToCommands":["查看","定義","找不到 '{0}' 的定義","找不到任何定義","移至定義","移至定義(&&D)","在一側開啟定義","瞄核定義","宣告","找不到 '{0}' 的宣告 ","找不到任何宣告","移至宣告","前往宣告(&&D)","找不到 '{0}' 的宣告 ","找不到任何宣告","預覽宣告","類型定義","找不到 '{0}' 的任何類型定義","找不到任何類型定義","移至類型定義","前往類型定義(&&T)","預覽類型定義","實作","找不到 '{0}' 的任何實作","找不到任何實作","前往實作","前往實作(&&I)","查看實作",'未找到 "{0}" 的參考',"未找到參考","前往參考","前往參考(&&R)","參考","預覽參考","參考","移至任何符號","位置","'{0}' 沒有結果","參考"],"vs/editor/contrib/gotoSymbol/link/goToDefinitionAtPosition":["按一下以顯示 {0} 項定義。"],"vs/editor/contrib/gotoSymbol/peek/referencesController":["正在載入...","{0} ({1})"], +"vs/editor/contrib/gotoSymbol/peek/referencesTree":["{0} 個參考","{0} 個參考","參考"],"vs/editor/contrib/gotoSymbol/peek/referencesWidget":["無法預覽","查無結果","參考"],"vs/editor/contrib/gotoSymbol/referencesModel":["個符號位於 {0} 中的第 {1} 行第 {2} 欄","1 個符號位於 {0}, 完整路徑 {1}","{0} 個符號位於 {1}, 完整路徑 {2}","找不到結果","在 {0} 中找到 1 個符號","在 {1} 中找到 {0} 個符號","在 {1} 個檔案中找到 {0} 個符號"],"vs/editor/contrib/gotoSymbol/symbolNavigation":["{1} 的符號 {0},{2} 為下一個","{1} 的符號 {0}"],"vs/editor/contrib/hover/hover":["動態顯示","顯示定義預覽懸停"],"vs/editor/contrib/hover/modesContentHover":["正在載入...","瞄孔問題","正在檢查快速修正...","沒有可用的快速修正","快速修復..."],"vs/editor/contrib/inPlaceReplace/inPlaceReplace":["以上一個值取代","以下一個值取代"],"vs/editor/contrib/indentation/indentation":["將縮排轉換成空格","將縮排轉換成定位點","已設定的定位點大小","選取目前檔案的定位點大小","使用 Tab 進行縮排","使用空格鍵進行縮排","偵測內容中的縮排","重新將行縮排","重新將選取的行縮排"], +"vs/editor/contrib/linesOperations/linesOperations":["將行向上複製","將行向上複製(&&C)","將行向下複製","將行向下複製(&&P)","重複選取項目","重複選取項目(&&D)","上移一行","上移一行(&&V)","下移一行","下移一行(&&L)","遞增排序行","遞減排序行","修剪尾端空白","刪除行","縮排行","凸排行","在上方插入行","在下方插入行","左邊全部刪除","刪除所有右方項目","連接線","轉置游標周圍的字元數","轉換到大寫","轉換到小寫","轉換為字首大寫"],"vs/editor/contrib/links/links":["執行命令","追蹤連結","cmd + 按一下","ctrl + 按一下","選項 + 按一下","alt + 按一下","因為此連結的格式不正確,所以無法開啟: {0}","因為此連結目標遺失,所以無法開啟。","開啟連結"],"vs/editor/contrib/message/messageController":["無法在唯讀編輯器中編輯"],"vs/editor/contrib/multicursor/multicursor":["在上方加入游標","在上方新增游標(&&A)","在下方加入游標","在下方新增游標(&&D)","在行尾新增游標","在行尾新增游標(&&U)","將游標新增到底部 ","將游標新增到頂部","將選取項目加入下一個找到的相符項","新增下一個項目(&&N)","將選取項目加入前一個找到的相符項中","新增上一個項目(&&R)","將最後一個選擇項目移至下一個找到的相符項","將最後一個選擇項目移至前一個找到的相符項","選取所有找到的相符項目","選取所有項目(&&O)","變更所有發生次數"],"vs/editor/contrib/parameterHints/parameterHints":["觸發參數提示"],"vs/editor/contrib/parameterHints/parameterHintsWidget":["{0},提示"], +"vs/editor/contrib/peekView/peekView":["關閉","預覽檢視標題區域的背景色彩。","預覽檢視標題的色彩。","預覽檢視標題資訊的色彩。","預覽檢視之框線與箭頭的色彩。","預覽檢視中結果清單的背景色彩。","預覽檢視結果列表中行節點的前景色彩","預覽檢視結果列表中檔案節點的前景色彩","在預覽檢視之結果清單中選取項目時的背景色彩。","在預覽檢視之結果清單中選取項目時的前景色彩。","預覽檢視編輯器的背景色彩。","預覽檢視編輯器邊框(含行號或字形圖示)的背景色彩。","在預覽檢視編輯器中比對時的反白顯示色彩。","預覽檢視編輯器中比對時的反白顯示色彩。","在預覽檢視編輯器中比對時的反白顯示邊界。"],"vs/editor/contrib/quickAccess/gotoLineQuickAccess":["先開啟文字編輯器,前往某一行。","前往第 {0} 行和第 {1} 欄。","前往第 {0} 行。","目前行: {0},字元: {1}。請鍵入介於 1 到 {2} 之間行號,導覽至該行。","目前行: {0},字元: {1}。請鍵入要導覽至的行號。"],"vs/editor/contrib/quickAccess/gotoSymbolQuickAccess":["若要前往符號,請先開啟包含符號資訊的文字編輯器。","使用中的文字編輯器不提供符號資訊。","沒有相符的編輯器符號","沒有編輯器符號","開至側邊","開啟到底部","符號 ({0})","屬性 ({0})","方法 ({0})","函式 ({0})","建構函式 ({0})","變數 ({0})","類別 ({0})","結構 ({0})","事件 ({0})","運算子 ({0})","介面 ({0})","命名空間 ({0})","套件 ({0})","型別參數 ({0})","模組 ({0})","屬性 ({0})","列舉 ({0})","列舉成員 ({0})","字串 ({0})","檔案 ({0})","陣列 ({0})","數字 ({0})","布林值 ({0})","物件 ({0})","索引鍵 ({0})","欄位 ({0})","常數 ({0})"], +"vs/editor/contrib/rename/onTypeRename":["依類型重新命名符號","當編輯器自動重新命名類型時的背景色彩。"],"vs/editor/contrib/rename/rename":["沒有結果。","解析重新命名位置時發生未知的錯誤","正在為 '{0}' 重新命名","正在重新命名 {0}","已成功將 '{0}' 重新命名為 '{1}'。摘要: {2}","重命名無法套用編輯","重新命名無法計算編輯","重新命名符號","啟用/停用重新命名前先預覽變更的功能"],"vs/editor/contrib/rename/renameInputField":["為輸入重新命名。請鍵入新名稱,然後按 Enter 以認可。","按 {0} 進行重新命名,按 {1} 進行預覽"],"vs/editor/contrib/smartSelect/smartSelect":["展開選取項目","展開選取範圍(&&E)","縮小選取項目","壓縮選取範圍(&&S)"],"vs/editor/contrib/snippet/snippetVariables":["星期天","星期一","星期二","星期三","星期四","星期五","星期六","週日","週一","週二","週三","週四","週五","週六","一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月","1月","2月","3 月","4月","五月","6月","7 月","8 月","9 月","10 月","11 月","12 月"],"vs/editor/contrib/suggest/suggestController":["接受 ‘{0}’ 進行了其他 {1} 項編輯","觸發建議","{0} 以插入","{0} 以插入","{0} 以取代","{0} 以取代","{0} 以插入","顯示更少","顯示更多"], +"vs/editor/contrib/suggest/suggestWidget":["建議小工具的背景色彩。","建議小工具的邊界色彩。","建議小工具的前景色彩。","建議小工具中所選項目的背景色彩。","建議小工具中相符醒目提示的色彩。","閱讀較多 ({0})","閱讀較少 ({0})","正在載入...","正在載入...","無建議。","{0},文件: {1}","建議"],"vs/editor/contrib/toggleTabFocusMode/toggleTabFocusMode":["切換 TAB 鍵移動焦點","按 Tab 現在會將焦點移至下一個可設定焦點的元素。","按 Tab 現在會插入定位字元。"],"vs/editor/contrib/tokenization/tokenization":["開發人員: 強制重新置放"],"vs/editor/contrib/unusualLineTerminators/unusualLineTerminators":["異常的行結束字元","偵測到異常的行結束字元","此檔案包含一或多個異常的行結束字元,例如行分隔符號 (LS) 或段落分隔符號 (PS)。\r\n\r\n建議您將其從檔案中移除。這可以透過 `editor.unusualLineTerminators` 進行設定。","修正此檔案","忽略此檔案的問題"],"vs/editor/contrib/wordHighlighter/wordHighlighter":["讀取權限期間 (如讀取變數) 符號的背景色彩。其不得為不透明色彩,以免隱藏底層裝飾。","寫入權限期間 (如寫入變數) 符號的背景色彩。其不得為不透明色彩,以免隱藏底層裝飾。","讀取存取期間 (例如讀取變數時) 符號的邊框顏色。","寫入存取期間 (例如寫入變數時) 符號的邊框顏色。 ","符號醒目提示的概觀尺規標記色彩。其不得為不透明色彩,以免隱藏底層裝飾。","寫入權限符號醒目提示的概觀尺規標記色彩。其不得為不透明色彩,以免隱藏底層裝飾。","移至下一個反白符號","移至上一個反白符號","觸發符號反白顯示"],"vs/platform/actions/browser/menuEntryActionViewItem":["{0} ({1})"], +"vs/platform/configuration/common/configurationRegistry":["預設語言組態覆寫","設定要針對語言覆寫的編輯器設定。","這個設定不支援以語言為根據的組態。","無法註冊 '{0}'。這符合用於描述語言專用編輯器設定的屬性模式 '\\\\[.*\\\\]$'。請使用 'configurationDefaults' 貢獻。","無法註冊 '{0}'。此屬性已經註冊。"],"vs/platform/keybinding/common/abstractKeybindingService":["已按下 ({0})。等待第二個套索鍵...","按鍵組合 ({0}, {1}) 不是命令。"],"vs/platform/list/browser/listService":["工作台","對應Windows和Linux的'Control'與對應 macOS 的'Command'。","對應Windows和Linux的'Alt'與對應macOS的'Option'。","透過滑鼠多選,用於在樹狀目錄與清單中新增項目的輔助按鍵 (例如在總管中開啟編輯器 及 SCM 檢視)。'在側邊開啟' 滑鼠手勢 (若支援) 將會適應以避免和多選輔助按鍵衝突。","控制如何使用滑鼠在樹狀目錄與清單中開啟項目 (若有支援)。對於樹狀目錄中具子系的父系而言,此設定會控制應以滑鼠按一下或按兩下展開父系。注意,某些樹狀目錄或清單若不適用此設定則會予以忽略。","控制在工作台中,清單與樹狀結構是否支援水平捲動。警告: 開啟此設定將會影響效能。","控制樹狀結構縮排 (像素)。","控制樹系是否應轉譯縮排輔助線。","控制清單和樹狀結構是否具有平滑捲動。","比對按鍵輸入的簡易按鍵瀏覽焦點元素。僅比對前置詞。","醒目提示鍵盤瀏覽會醒目提示符合鍵盤輸入的元素。進一步向上或向下瀏覽只會周遊醒目提示的元素。","篩選鍵盤瀏覽會篩掉並隱藏不符合鍵盤輸入的所有元素。","控制 Workbench 中清單和樹狀結構的鍵盤瀏覽樣式。可以是簡易的、醒目提示和篩選。","控制是否只要鍵入即可自動觸發清單和樹狀結構中的鍵盤瀏覽。若設為 `false`,只有在執行 `list.toggleKeyboardNavigation` 命令時,才會觸發鍵盤瀏覽,您可為其指定鍵盤快速鍵。"], +"vs/platform/markers/common/markers":["錯誤","警告","資訊"],"vs/platform/quickinput/browser/commandsQuickAccess":["{0}, {1}","最近使用的","其他命令","命令 '{0}' 造成錯誤 ({1})"],"vs/platform/quickinput/browser/helpQuickAccess":["全域命令","編輯器命令","{0}, {1}"], +"vs/platform/theme/common/colorRegistry":["整體的前景色彩。僅當未被任何元件覆疊時,才會使用此色彩。","整體錯誤訊息的前景色彩。僅當未被任何元件覆蓋時,才會使用此色彩。","工作台中圖示的預設色彩。","焦點項目的整體框線色彩。只在沒有任何元件覆寫此色彩時,才會加以使用。","項目周圍的額外框線,可將項目從其他項目中區隔出來以提高對比。","使用中項目周圍的額外邊界,可將項目從其他項目中區隔出來以提高對比。","內文連結的前景色彩","文字區塊的背景顏色。","小工具的陰影色彩,例如編輯器中的尋找/取代。","輸入方塊的背景。","輸入方塊的前景。","輸入方塊的框線。","輸入欄位中可使用之項目的框線色彩。","在輸入欄位中所啟動選項的背景色彩。","在輸入欄位中所啟動選項的前景色彩。","資訊嚴重性的輸入驗證背景色彩。","資訊嚴重性的輸入驗證前景色彩。","資訊嚴重性的輸入驗證邊界色彩。","警告嚴重性的輸入驗證背景色彩。","警告嚴重性的輸入驗證前景色彩。","警告嚴重性的輸入驗證邊界色彩。","錯誤嚴重性的輸入驗證背景色彩。","錯誤嚴重性的輸入驗證前景色彩。","錯誤嚴重性的輸入驗證邊界色彩。","下拉式清單的背景。","下拉式清單的前景。","按鈕前景色彩。","按鈕背景色彩。","暫留時的按鈕背景色彩。","標記的背景顏色。標記為小型的訊息標籤,例如搜尋結果的數量。","標記的前景顏色。標記為小型的訊息標籤,例如搜尋結果的數量。","指出在捲動該檢視的捲軸陰影。","捲軸滑桿的背景顏色。","動態顯示時捲軸滑桿的背景顏色。","當點擊時捲軸滑桿的背景顏色。","長時間運行進度條的背景色彩.","編輯器內錯誤提示線的前景色彩.","編輯器中錯誤方塊的框線色彩。","編輯器內警告提示線的前景色彩.","編輯器中的警告方塊框線色彩。","編輯器內資訊提示線的前景色彩","編輯器中的資訊方塊框線色彩。","編輯器內提示訊息的提示線前景色彩","編輯器中的提示方塊框線色彩。","編輯器的背景色彩。","編輯器的預設前景色彩。","編輯器小工具的背景色彩,例如尋找/取代。","編輯器小工具 (例如尋找/取代) 的前景色彩。","編輯器小工具的邊界色彩。小工具選擇擁有邊界或色彩未被小工具覆寫時,才會使用色彩。","編輯器小工具之調整大小列的邊界色彩。只在小工具選擇具有調整大小邊界且未覆寫該色彩時,才使用該色彩。\r\n","快速選擇器背景色彩。該快速選擇器小工具是類似命令選擇區的選擇器容器。","快速選擇器前景色彩。快速選擇器小工具是類似命令選擇區等選擇器的容器。","快速選擇器標題背景色彩。快速選擇器小工具是類似命令選擇區的選擇器容器。","分組標籤的快速選擇器色彩。","分組邊界的快速選擇器色彩。","編輯器選取範圍的色彩。","為選取的文字顏色高對比化","非使用中編輯器內的選取項目色彩。其不得為不透明色彩,以免隱藏底層裝飾。","與選取項目內容相同之區域的色彩。其不得為不透明色彩,以免隱藏底層裝飾。","選取時,內容相同之區域的框線色彩。","符合目前搜尋的色彩。","其他搜尋相符項目的色彩。其不得為不透明色彩,以免隱藏底層裝飾。","限制搜尋之範圍的色彩。其不得為不透明色彩,以免隱藏底層裝飾。","符合目前搜尋的框線色彩。","符合其他搜尋的框線色彩。","限制搜尋之範圍的框線色彩。其不得為不透明色彩,以免隱藏底層裝飾。","在顯示動態顯示的文字下醒目提示。其不得為不透明色彩,以免隱藏底層裝飾。","編輯器動態顯示的背景色彩。","編輯器動態顯示的前景色彩。","編輯器動態顯示的框線色彩。","編輯器暫留狀態列的背景色彩。","使用中之連結的色彩。","用於燈泡動作圖示的色彩。","用於燈泡自動修正動作圖示的色彩。","已插入文字的背景色彩。其不得為不透明色彩,以免隱藏底層裝飾。","已移除文字的背景色彩。其不得為不透明色彩,以免隱藏底層裝飾。","插入的文字外框色彩。","移除的文字外框色彩。","兩個文字編輯器之間的框線色彩。","Diff 編輯器的斜紋填滿色彩。斜紋填滿用於並排 Diff 檢視。","當清單/樹狀為使用中狀態時,焦點項目的清單/樹狀背景色彩。使用中的清單/樹狀有鍵盤焦點,非使用中者則沒有。","當清單/樹狀為使用中狀態時,焦點項目的清單/樹狀前景色彩。使用中的清單/樹狀有鍵盤焦點,非使用中者則沒有。","當清單/樹狀為使用中狀態時,所選項目的清單/樹狀背景色彩。使用中的清單/樹狀有鍵盤焦點,非使用中者則沒有。","當清單/樹狀為使用中狀態時,所選項目的清單/樹狀前景色彩。使用中的清單/樹狀有鍵盤焦點,非使用中者則沒有。","當清單/樹狀為非使用中狀態時,所選項目的清單/樹狀背景色彩。使用中的清單/樹狀有鍵盤焦點,非使用中者則沒有。","當清單/樹狀為使用中狀態時,所選項目的清單/樹狀前景色彩。使用中的清單/樹狀有鍵盤焦點,非使用中則沒有。","當清單/樹狀為非使用中狀態時,焦點項目的清單/樹狀背景色彩。使用中的清單/樹狀有鍵盤焦點,非使用中者則沒有。","使用滑鼠暫留在項目時的清單/樹狀背景。","滑鼠暫留在項目時的清單/樹狀前景。","使用滑鼠四處移動項目時的清單/樹狀拖放背景。","在清單/樹狀內搜尋時,相符醒目提示的清單/樹狀前景色彩。","清單和樹狀結構中類型篩選小工具的背景色彩。","清單和樹狀結構中類型篩選小工具的大綱色彩。","在沒有相符項目時,清單和樹狀結構中類型篩選小工具的大綱色彩。","縮排輔助線的樹狀筆觸色彩。","功能表的邊框色彩。","功能表項目的前景色彩。","功能表項目的背景色彩。","功能表中所選功能表項目的前景色彩。","功能表中所選功能表項目的背景色彩。","功能表中所選功能表項目的框線色彩。","功能表中分隔線功能表項目的色彩。","程式碼片段定位停駐點的反白顯示背景色彩。","程式碼片段定位停駐點的反白顯示邊界色彩。","程式碼片段最終定位停駐點的反白顯示背景色彩。","程式碼片段最終定位停駐點的醒目提示框線色彩。","尋找相符項目的概觀尺規標記色彩。其不得為不透明色彩,以免隱藏底層裝飾。","選取項目醒目提示的概觀尺規標記。其不得為不透明色彩,以免隱藏底層裝飾。","用於尋找相符項目的縮圖標記色彩。","編輯器選取範圍的迷你地圖標記色彩。","錯誤的縮圖標記色彩。","警告的縮圖標記色彩。","縮圖背景色彩。","縮圖滑桿背景色彩。","暫留時的縮圖滑桿背景色彩。","按一下時的縮圖滑桿背景色彩。","用於問題錯誤圖示的色彩。","用於問題警告圖示的色彩。","用於問題資訊圖示的色彩。"], +"vs/platform/undoRedo/common/undoRedoService":["已在磁碟上關閉並修改以下檔案: {0}。","下列檔案已使用不相容的方式修改: {0}。","無法復原所有檔案的 '{0}'。{1}","無法復原所有檔案的 '{0}'。{1}","因為已對 {1} 進行變更,所以無法復原所有檔案的 '{0}'","因為 {1} 中已經有正在執行的復原或重做作業,所以無法為所有檔案復原 '{0}'","因為同時發生其他復原或重做作業,所以無法為所有檔案復原 '{0}'","要復原所有檔案的 '{0}' 嗎?","在 {0} 個檔案中復原","復原此檔案","取消","因為已經有正在執行的復原或重做作業,所以無法復原 '{0}'。","無法復原所有檔案的 '{0}'。{1}","無法復原所有檔案的 '{0}'。{1}","因為已對 {1} 進行變更,所以無法復原所有檔案的 '{0}'","因為 {1} 中已經有正在執行的復原或重做作業,所以無法為所有檔案重做 '{0}'","因為同時發生其他復原或重做作業,所以無法為所有檔案重做 '{0}'","因為已經有正在執行的復原或重做作業,所以無法重做 '{0}'。"]}); +//# sourceMappingURL=../../../min-maps/vs/editor/editor.main.nls.zh-tw.js.map \ No newline at end of file diff --git a/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/language/css/cssMode.js b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/language/css/cssMode.js new file mode 100644 index 0000000..3f201b4 --- /dev/null +++ b/jnpf-java-boot/jnpf-web/public/cdn/monaco-editor/language/css/cssMode.js @@ -0,0 +1,7 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * monaco-css version: 3.1.1(23bd524cc383945cb039c5b552c0b783c450f6d6) + * Released under the MIT license + * https://github.com/Microsoft/monaco-css/blob/master/LICENSE.md + *-----------------------------------------------------------------------------*/ +define("vs/language/css/workerManager",["require","exports","./fillers/monaco-editor-core"],(function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkerManager=void 0;var r=function(){function e(e){var t=this;this._defaults=e,this._worker=null,this._idleCheckInterval=window.setInterval((function(){return t._checkIfIdle()}),3e4),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange((function(){return t._stopWorker()}))}return e.prototype._stopWorker=function(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null},e.prototype.dispose=function(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()},e.prototype._checkIfIdle=function(){this._worker&&(Date.now()-this._lastUsedTime>12e4&&this._stopWorker())},e.prototype._getClient=function(){return this._lastUsedTime=Date.now(),this._client||(this._worker=n.editor.createWebWorker({moduleId:"vs/language/css/cssWorker",label:this._defaults.languageId,createData:{languageSettings:this._defaults.diagnosticsOptions,languageId:this._defaults.languageId}}),this._client=this._worker.getProxy()),this._client},e.prototype.getLanguageServiceWorker=function(){for(var e,t=this,n=[],r=0;rthis.source.length)return!1;for(var t=0;t=d&&e<=p&&(this.stream.advance(t+1),this.stream.advanceWhileChar((function(e){return e>=d&&e<=p||0===t&&e===K})),!0)},e.prototype._newline=function(e){var t=this.stream.peekChar();switch(t){case z:case _:case R:return this.stream.advance(1),e.push(String.fromCharCode(t)),t===z&&this.stream.advanceIfChar(R)&&e.push("\n"),!0}return!1},e.prototype._escape=function(e,t){var n=this.stream.peekChar();if(n===E){this.stream.advance(1),n=this.stream.peekChar();for(var r=0;r<6&&(n>=d&&n<=p||n>=i&&n<=o||n>=a&&n<=l);)this.stream.advance(1),n=this.stream.peekChar(),r++;if(r>0){try{var s=parseInt(this.stream.substring(this.stream.pos()-r),16);s&&e.push(String.fromCharCode(s))}catch(e){}return n===N||n===M?this.stream.advance(1):this._newline([]),!0}if(n!==z&&n!==_&&n!==R)return this.stream.advance(1),e.push(String.fromCharCode(n)),!0;if(t)return this._newline(e)}return!1},e.prototype._stringChar=function(e,t){var n=this.stream.peekChar();return 0!==n&&n!==e&&n!==E&&n!==z&&n!==_&&n!==R&&(this.stream.advance(1),t.push(String.fromCharCode(n)),!0)},e.prototype._string=function(e){if(this.stream.peekChar()===I||this.stream.peekChar()===P){var t=this.stream.nextChar();for(e.push(String.fromCharCode(t));this._stringChar(t,e)||this._escape(e,!0););return this.stream.peekChar()===t?(this.stream.nextChar(),e.push(String.fromCharCode(t)),n.String):n.BadString}return null},e.prototype._unquotedChar=function(e){var t=this.stream.peekChar();return 0!==t&&t!==E&&t!==I&&t!==P&&t!==w&&t!==x&&t!==N&&t!==M&&t!==R&&t!==_&&t!==z&&(this.stream.advance(1),e.push(String.fromCharCode(t)),!0)},e.prototype._unquotedString=function(e){for(var t=!1;this._unquotedChar(e)||this._escape(e);)t=!0;return t},e.prototype._whitespace=function(){return this.stream.advanceWhileChar((function(e){return e===N||e===M||e===R||e===_||e===z}))>0},e.prototype._name=function(e){for(var t=!1;this._identChar(e)||this._escape(e);)t=!0;return t},e.prototype.ident=function(e){var t=this.stream.pos();if(this._minus(e)&&this._minus(e)){if(this._identFirstChar(e)||this._escape(e)){for(;this._identChar(e)||this._escape(e););return!0}}else if(this._identFirstChar(e)||this._escape(e)){for(;this._identChar(e)||this._escape(e););return!0}return this.stream.goBackTo(t),!1},e.prototype._identFirstChar=function(e){var t=this.stream.peekChar();return(t===b||t>=i&&t<=s||t>=a&&t<=c||t>=128&&t<=65535)&&(this.stream.advance(1),e.push(String.fromCharCode(t)),!0)},e.prototype._minus=function(e){var t=this.stream.peekChar();return t===g&&(this.stream.advance(1),e.push(String.fromCharCode(t)),!0)},e.prototype._identChar=function(e){var t=this.stream.peekChar();return(t===b||t===g||t>=i&&t<=s||t>=a&&t<=c||t>=d&&t<=p||t>=128&&t<=65535)&&(this.stream.advance(1),e.push(String.fromCharCode(t)),!0)},e}();t.Scanner=G})),function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("vscode-css-languageservice/utils/strings",["require","exports"],e)}((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.startsWith=function(e,t){if(e.length0?e.lastIndexOf(t)===n:0===n&&e===t},t.difference=function(e,t,n){void 0===n&&(n=4);var r=Math.abs(e.length-t.length);if(r>n)return 0;var i,o,s=[],a=[];for(i=0;ie.end?null:(e.accept((function(e){return-1===e.offset&&-1===e.length||e.offset<=t&&e.end>=t&&(n?e.length<=n.length&&(n=e):n=e,!0)})),n)}!function(e){e[e.Undefined=0]="Undefined",e[e.Identifier=1]="Identifier",e[e.Stylesheet=2]="Stylesheet",e[e.Ruleset=3]="Ruleset",e[e.Selector=4]="Selector",e[e.SimpleSelector=5]="SimpleSelector",e[e.SelectorInterpolation=6]="SelectorInterpolation",e[e.SelectorCombinator=7]="SelectorCombinator",e[e.SelectorCombinatorParent=8]="SelectorCombinatorParent",e[e.SelectorCombinatorSibling=9]="SelectorCombinatorSibling",e[e.SelectorCombinatorAllSiblings=10]="SelectorCombinatorAllSiblings",e[e.SelectorCombinatorShadowPiercingDescendant=11]="SelectorCombinatorShadowPiercingDescendant",e[e.Page=12]="Page",e[e.PageBoxMarginBox=13]="PageBoxMarginBox",e[e.ClassSelector=14]="ClassSelector",e[e.IdentifierSelector=15]="IdentifierSelector",e[e.ElementNameSelector=16]="ElementNameSelector",e[e.PseudoSelector=17]="PseudoSelector",e[e.AttributeSelector=18]="AttributeSelector",e[e.Declaration=19]="Declaration",e[e.Declarations=20]="Declarations",e[e.Property=21]="Property",e[e.Expression=22]="Expression",e[e.BinaryExpression=23]="BinaryExpression",e[e.Term=24]="Term",e[e.Operator=25]="Operator",e[e.Value=26]="Value",e[e.StringLiteral=27]="StringLiteral",e[e.URILiteral=28]="URILiteral",e[e.EscapedValue=29]="EscapedValue",e[e.Function=30]="Function",e[e.NumericValue=31]="NumericValue",e[e.HexColorValue=32]="HexColorValue",e[e.MixinDeclaration=33]="MixinDeclaration",e[e.MixinReference=34]="MixinReference",e[e.VariableName=35]="VariableName",e[e.VariableDeclaration=36]="VariableDeclaration",e[e.Prio=37]="Prio",e[e.Interpolation=38]="Interpolation",e[e.NestedProperties=39]="NestedProperties",e[e.ExtendsReference=40]="ExtendsReference",e[e.SelectorPlaceholder=41]="SelectorPlaceholder",e[e.Debug=42]="Debug",e[e.If=43]="If",e[e.Else=44]="Else",e[e.For=45]="For",e[e.Each=46]="Each",e[e.While=47]="While",e[e.MixinContentReference=48]="MixinContentReference",e[e.MixinContentDeclaration=49]="MixinContentDeclaration",e[e.Media=50]="Media",e[e.Keyframe=51]="Keyframe",e[e.FontFace=52]="FontFace",e[e.Import=53]="Import",e[e.Namespace=54]="Namespace",e[e.Invocation=55]="Invocation",e[e.FunctionDeclaration=56]="FunctionDeclaration",e[e.ReturnStatement=57]="ReturnStatement",e[e.MediaQuery=58]="MediaQuery",e[e.FunctionParameter=59]="FunctionParameter",e[e.FunctionArgument=60]="FunctionArgument",e[e.KeyframeSelector=61]="KeyframeSelector",e[e.ViewPort=62]="ViewPort",e[e.Document=63]="Document",e[e.AtApplyRule=64]="AtApplyRule",e[e.CustomPropertyDeclaration=65]="CustomPropertyDeclaration",e[e.CustomPropertySet=66]="CustomPropertySet",e[e.ListEntry=67]="ListEntry",e[e.Supports=68]="Supports",e[e.SupportsCondition=69]="SupportsCondition",e[e.NamespacePrefix=70]="NamespacePrefix",e[e.GridLine=71]="GridLine",e[e.Plugin=72]="Plugin",e[e.UnknownAtRule=73]="UnknownAtRule",e[e.Use=74]="Use",e[e.ModuleConfiguration=75]="ModuleConfiguration",e[e.Forward=76]="Forward",e[e.ForwardVisibility=77]="ForwardVisibility",e[e.Module=78]="Module"}(n=t.NodeType||(t.NodeType={})),function(e){e[e.Mixin=0]="Mixin",e[e.Rule=1]="Rule",e[e.Variable=2]="Variable",e[e.Function=3]="Function",e[e.Keyframe=4]="Keyframe",e[e.Unknown=5]="Unknown",e[e.Module=6]="Module",e[e.Forward=7]="Forward",e[e.ForwardVisibility=8]="ForwardVisibility"}(t.ReferenceType||(t.ReferenceType={})),t.getNodeAtOffset=i,t.getNodePath=function(e,t){for(var n=i(e,t),r=[];n;)r.unshift(n),n=n.parent;return r},t.getParentDeclaration=function(e){var t=e.findParent(n.Declaration),r=t&&t.getValue();return r&&r.encloses(e)?t:null};var o=function(){function e(e,t,n){void 0===e&&(e=-1),void 0===t&&(t=-1),this.parent=null,this.offset=e,this.length=t,n&&(this.nodeType=n)}return Object.defineProperty(e.prototype,"end",{get:function(){return this.offset+this.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"type",{get:function(){return this.nodeType||n.Undefined},set:function(e){this.nodeType=e},enumerable:!0,configurable:!0}),e.prototype.getTextProvider=function(){for(var e=this;e&&!e.textProvider;)e=e.parent;return e?e.textProvider:function(){return"unknown"}},e.prototype.getText=function(){return this.getTextProvider()(this.offset,this.length)},e.prototype.matches=function(e){return this.length===e.length&&this.getTextProvider()(this.offset,this.length)===e},e.prototype.startsWith=function(e){return this.length>=e.length&&this.getTextProvider()(this.offset,e.length)===e},e.prototype.endsWith=function(e){return this.length>=e.length&&this.getTextProvider()(this.end-e.length,e.length)===e},e.prototype.accept=function(e){if(e(this)&&this.children)for(var t=0,n=this.children;t=0&&e.parent.children.splice(n,1)}e.parent=this;var r=this.children;return r||(r=this.children=[]),-1!==t?r.splice(t,0,e):r.push(e),e},e.prototype.attachTo=function(e,t){return void 0===t&&(t=-1),e&&e.adoptChild(this,t),this},e.prototype.collectIssues=function(e){this.issues&&e.push.apply(e,this.issues)},e.prototype.addIssue=function(e){this.issues||(this.issues=[]),this.issues.push(e)},e.prototype.hasIssue=function(e){return Array.isArray(this.issues)&&this.issues.some((function(t){return t.getRule()===e}))},e.prototype.isErroneous=function(e){return void 0===e&&(e=!1),!!(this.issues&&this.issues.length>0)||e&&Array.isArray(this.children)&&this.children.some((function(e){return e.isErroneous(!0)}))},e.prototype.setNode=function(e,t,n){return void 0===n&&(n=-1),!!t&&(t.attachTo(this,n),this[e]=t,!0)},e.prototype.addChild=function(e){return!!e&&(this.children||(this.children=[]),e.attachTo(this),this.updateOffsetAndLength(e),!0)},e.prototype.updateOffsetAndLength=function(e){(e.offsetthis.end||-1===this.length)&&(this.length=t-this.offset)},e.prototype.hasChildren=function(){return!!this.children&&this.children.length>0},e.prototype.getChildren=function(){return this.children?this.children.slice(0):[]},e.prototype.getChild=function(e){return this.children&&e=0;n--)if((t=this.children[n]).offset<=e)return t;return null},e.prototype.findChildAtOffset=function(e,t){var n=this.findFirstChildBeforeOffset(e);return n&&n.end>=e?t&&n.findChildAtOffset(e,!0)||n:null},e.prototype.encloses=function(e){return this.offset<=e.offset&&this.offset+this.length>=e.offset+e.length},e.prototype.getParent=function(){for(var e=this.parent;e instanceof s;)e=e.parent;return e},e.prototype.findParent=function(e){for(var t=this;t&&t.type!==e;)t=t.parent;return t},e.prototype.findAParent=function(){for(var e=[],t=0;t/g,">")}function i(e){if(!e.description||""===e.description)return"";if("string"!=typeof e.description)return e.description.value;var t="";e.status&&(t+=n(e.status)),t+=e.description;var r=s(e.browsers);return r&&(t+="\n("+r+")"),"syntax"in e&&(t+="\n\nSyntax: "+e.syntax),e.references&&e.references.length>0&&(t+="\n\n",t+=e.references.map((function(e){return e.name+": "+e.url})).join(" | ")),t}function o(e){if(!e.description||""===e.description)return"";var t="";e.status&&(t+=n(e.status)),t+=r("string"==typeof e.description?e.description:e.description.value);var i=s(e.browsers);return i&&(t+="\n\n("+r(i)+")"),"syntax"in e&&e.syntax&&(t+="\n\nSyntax: "+r(e.syntax)),e.references&&e.references.length>0&&(t+="\n\n",t+=e.references.map((function(e){return"["+e.name+"]("+e.url+")"})).join(" | ")),t}function s(e){return void 0===e&&(e=[]),0===e.length?null:e.map((function(e){var n="",r=e.match(/([A-Z]+)(\d+)?/),i=r[1],o=r[2];return i in t.browserNames&&(n+=t.browserNames[i]),o&&(n+=" "+o),n})).join(", ")}Object.defineProperty(t,"__esModule",{value:!0}),t.browserNames={E:"Edge",FF:"Firefox",S:"Safari",C:"Chrome",IE:"IE",O:"Opera"},t.getEntryDescription=function(e,t){var n;if(""!==(n=t?{kind:"markdown",value:o(e)}:{kind:"plaintext",value:i(e)}).value)return n},t.textToMarkedString=r,t.getBrowserLabel=s})),function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("vscode-css-languageservice/languageFacts/colors",["require","exports","../parser/cssNodes","vscode-nls"],e)}((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=e("../parser/cssNodes"),r=e("vscode-nls").loadMessageBundle();function i(e,t){var n=e.getText().match(/^([-+]?[0-9]*\.?[0-9]+)(%?)$/);if(n){n[2]&&(t=100);var r=parseFloat(n[1])/t;if(r>=0&&r<=1)return r}throw new Error}function o(e){var t=e.getName();return!!t&&/^(rgb|rgba|hsl|hsla)$/gi.test(t)}t.colorFunctions=[{func:"rgb($red, $green, $blue)",desc:r("css.builtin.rgb","Creates a Color from red, green, and blue values.")},{func:"rgba($red, $green, $blue, $alpha)",desc:r("css.builtin.rgba","Creates a Color from red, green, blue, and alpha values.")},{func:"hsl($hue, $saturation, $lightness)",desc:r("css.builtin.hsl","Creates a Color from hue, saturation, and lightness values.")},{func:"hsla($hue, $saturation, $lightness, $alpha)",desc:r("css.builtin.hsla","Creates a Color from hue, saturation, lightness, and alpha values.")}],t.colors={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rebeccapurple:"#663399",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},t.colorKeywords={currentColor:"The value of the 'color' property. The computed value of the 'currentColor' keyword is the computed value of the 'color' property. If the 'currentColor' keyword is set on the 'color' property itself, it is treated as 'color:inherit' at parse time.",transparent:"Fully transparent. This keyword can be considered a shorthand for rgba(0,0,0,0) which is its computed value."},t.isColorConstructor=o,t.isColorValue=function(e){if(e.type===n.NodeType.HexColorValue)return!0;if(e.type===n.NodeType.Function)return o(e);if(e.type===n.NodeType.Identifier){if(e.parent&&e.parent.type!==n.NodeType.Term)return!1;var r=e.getText().toLowerCase();if("none"===r)return!1;if(t.colors[r])return!0}return!1};function s(e){return e<48?0:e<=57?e-48:(e<97&&(e+=32),e>=97&&e<=102?e-97+10:0)}function a(e){if("#"!==e[0])return null;switch(e.length){case 4:return{red:17*s(e.charCodeAt(1))/255,green:17*s(e.charCodeAt(2))/255,blue:17*s(e.charCodeAt(3))/255,alpha:1};case 5:return{red:17*s(e.charCodeAt(1))/255,green:17*s(e.charCodeAt(2))/255,blue:17*s(e.charCodeAt(3))/255,alpha:17*s(e.charCodeAt(4))/255};case 7:return{red:(16*s(e.charCodeAt(1))+s(e.charCodeAt(2)))/255,green:(16*s(e.charCodeAt(3))+s(e.charCodeAt(4)))/255,blue:(16*s(e.charCodeAt(5))+s(e.charCodeAt(6)))/255,alpha:1};case 9:return{red:(16*s(e.charCodeAt(1))+s(e.charCodeAt(2)))/255,green:(16*s(e.charCodeAt(3))+s(e.charCodeAt(4)))/255,blue:(16*s(e.charCodeAt(5))+s(e.charCodeAt(6)))/255,alpha:(16*s(e.charCodeAt(7))+s(e.charCodeAt(8)))/255}}return null}function l(e,t,n,r){if(void 0===r&&(r=1),0===t)return{red:n,green:n,blue:n,alpha:r};var i=function(e,t,n){for(;n<0;)n+=6;for(;n>=6;)n-=6;return n<1?(t-e)*n+e:n<3?t:n<4?(t-e)*(4-n)+e:e},o=n<=.5?n*(t+1):n+t-n*t,s=2*n-o;return{red:i(s,o,(e/=60)+2),green:i(s,o,e),blue:i(s,o,e-2),alpha:r}}t.hexDigit=s,t.colorFromHex=a,t.colorFrom256RGB=function(e,t,n,r){return void 0===r&&(r=1),{red:e/255,green:t/255,blue:n/255,alpha:r}},t.colorFromHSL=l,t.hslFromColor=function(e){var t=e.red,n=e.green,r=e.blue,i=e.alpha,o=Math.max(t,n,r),s=Math.min(t,n,r),a=0,l=0,c=(s+o)/2,d=o-s;if(d>0){switch(l=Math.min(c<=.5?d/(2*c):d/(2-2*c),1),o){case t:a=(n-r)/d+(n4)return null;try{var c=4===s.length?i(s[3],1):1;if("rgb"===o||"rgba"===o)return{red:i(s[0],255),green:i(s[1],255),blue:i(s[2],255),alpha:c};if("hsl"===o||"hsla"===o)return l(function(e){var t=e.getText();if(t.match(/^([-+]?[0-9]*\.?[0-9]+)(deg)?$/))return parseFloat(t)%360;throw new Error}(s[0]),i(s[1],100),i(s[2],100),c)}catch(e){return null}}else if(e.type===n.NodeType.Identifier){if(e.parent&&e.parent.type!==n.NodeType.Term)return null;var d=e.parent;if(d&&d.parent&&d.parent.type===n.NodeType.BinaryExpression){var p=d.parent;if(p.parent&&p.parent.type===n.NodeType.ListEntry&&p.parent.key===p)return null}var h=e.getText().toLowerCase();if("none"===h)return null;var u=t.colors[h];if(u)return a(u)}return null}})),function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("vscode-css-languageservice/languageFacts/builtinData",["require","exports"],e)}((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.positionKeywords={bottom:"Computes to ‘100%’ for the vertical position if one or two values are given, otherwise specifies the bottom edge as the origin for the next offset.",center:"Computes to ‘50%’ (‘left 50%’) for the horizontal position if the horizontal position is not otherwise specified, or ‘50%’ (‘top 50%’) for the vertical position if it is.",left:"Computes to ‘0%’ for the horizontal position if one or two values are given, otherwise specifies the left edge as the origin for the next offset.",right:"Computes to ‘100%’ for the horizontal position if one or two values are given, otherwise specifies the right edge as the origin for the next offset.",top:"Computes to ‘0%’ for the vertical position if one or two values are given, otherwise specifies the top edge as the origin for the next offset."},t.repeatStyleKeywords={"no-repeat":"Placed once and not repeated in this direction.",repeat:"Repeated in this direction as often as needed to cover the background painting area.","repeat-x":"Computes to ‘repeat no-repeat’.","repeat-y":"Computes to ‘no-repeat repeat’.",round:"Repeated as often as will fit within the background positioning area. If it doesn’t fit a whole number of times, it is rescaled so that it does.",space:"Repeated as often as will fit within the background positioning area without being clipped and then the images are spaced out to fill the area."},t.lineStyleKeywords={dashed:"A series of square-ended dashes.",dotted:"A series of round dots.",double:"Two parallel solid lines with some space between them.",groove:"Looks as if it were carved in the canvas.",hidden:"Same as ‘none’, but has different behavior in the border conflict resolution rules for border-collapsed tables.",inset:"Looks as if the content on the inside of the border is sunken into the canvas.",none:"No border. Color and width are ignored.",outset:"Looks as if the content on the inside of the border is coming out of the canvas.",ridge:"Looks as if it were coming out of the canvas.",solid:"A single line segment."},t.lineWidthKeywords=["medium","thick","thin"],t.boxKeywords={"border-box":"The background is painted within (clipped to) the border box.","content-box":"The background is painted within (clipped to) the content box.","padding-box":"The background is painted within (clipped to) the padding box."},t.geometryBoxKeywords={"margin-box":"Uses the margin box as reference box.","fill-box":"Uses the object bounding box as reference box.","stroke-box":"Uses the stroke bounding box as reference box.","view-box":"Uses the nearest SVG viewport as reference box."},t.cssWideKeywords={initial:"Represents the value specified as the property’s initial value.",inherit:"Represents the computed value of the property on the element’s parent.",unset:"Acts as either `inherit` or `initial`, depending on whether the property is inherited or not."},t.imageFunctions={"url()":"Reference an image file by URL","image()":"Provide image fallbacks and annotations.","-webkit-image-set()":"Provide multiple resolutions. Remember to use unprefixed image-set() in addition.","image-set()":"Provide multiple resolutions of an image and const the UA decide which is most appropriate in a given situation.","-moz-element()":"Use an element in the document as an image. Remember to use unprefixed element() in addition.","element()":"Use an element in the document as an image.","cross-fade()":"Indicates the two images to be combined and how far along in the transition the combination is.","-webkit-gradient()":"Deprecated. Use modern linear-gradient() or radial-gradient() instead.","-webkit-linear-gradient()":"Linear gradient. Remember to use unprefixed version in addition.","-moz-linear-gradient()":"Linear gradient. Remember to use unprefixed version in addition.","-o-linear-gradient()":"Linear gradient. Remember to use unprefixed version in addition.","linear-gradient()":"A linear gradient is created by specifying a straight gradient line, and then several colors placed along that line.","-webkit-repeating-linear-gradient()":"Repeating Linear gradient. Remember to use unprefixed version in addition.","-moz-repeating-linear-gradient()":"Repeating Linear gradient. Remember to use unprefixed version in addition.","-o-repeating-linear-gradient()":"Repeating Linear gradient. Remember to use unprefixed version in addition.","repeating-linear-gradient()":"Same as linear-gradient, except the color-stops are repeated infinitely in both directions, with their positions shifted by multiples of the difference between the last specified color-stop’s position and the first specified color-stop’s position.","-webkit-radial-gradient()":"Radial gradient. Remember to use unprefixed version in addition.","-moz-radial-gradient()":"Radial gradient. Remember to use unprefixed version in addition.","radial-gradient()":"Colors emerge from a single point and smoothly spread outward in a circular or elliptical shape.","-webkit-repeating-radial-gradient()":"Repeating radial gradient. Remember to use unprefixed version in addition.","-moz-repeating-radial-gradient()":"Repeating radial gradient. Remember to use unprefixed version in addition.","repeating-radial-gradient()":"Same as radial-gradient, except the color-stops are repeated infinitely in both directions, with their positions shifted by multiples of the difference between the last specified color-stop’s position and the first specified color-stop’s position."},t.transitionTimingFunctions={ease:"Equivalent to cubic-bezier(0.25, 0.1, 0.25, 1.0).","ease-in":"Equivalent to cubic-bezier(0.42, 0, 1.0, 1.0).","ease-in-out":"Equivalent to cubic-bezier(0.42, 0, 0.58, 1.0).","ease-out":"Equivalent to cubic-bezier(0, 0, 0.58, 1.0).",linear:"Equivalent to cubic-bezier(0.0, 0.0, 1.0, 1.0).","step-end":"Equivalent to steps(1, end).","step-start":"Equivalent to steps(1, start).","steps()":"The first parameter specifies the number of intervals in the function. The second parameter, which is optional, is either the value “start” or “end”.","cubic-bezier()":"Specifies a cubic-bezier curve. The four values specify points P1 and P2 of the curve as (x1, y1, x2, y2).","cubic-bezier(0.6, -0.28, 0.735, 0.045)":"Ease-in Back. Overshoots.","cubic-bezier(0.68, -0.55, 0.265, 1.55)":"Ease-in-out Back. Overshoots.","cubic-bezier(0.175, 0.885, 0.32, 1.275)":"Ease-out Back. Overshoots.","cubic-bezier(0.6, 0.04, 0.98, 0.335)":"Ease-in Circular. Based on half circle.","cubic-bezier(0.785, 0.135, 0.15, 0.86)":"Ease-in-out Circular. Based on half circle.","cubic-bezier(0.075, 0.82, 0.165, 1)":"Ease-out Circular. Based on half circle.","cubic-bezier(0.55, 0.055, 0.675, 0.19)":"Ease-in Cubic. Based on power of three.","cubic-bezier(0.645, 0.045, 0.355, 1)":"Ease-in-out Cubic. Based on power of three.","cubic-bezier(0.215, 0.610, 0.355, 1)":"Ease-out Cubic. Based on power of three.","cubic-bezier(0.95, 0.05, 0.795, 0.035)":"Ease-in Exponential. Based on two to the power ten.","cubic-bezier(1, 0, 0, 1)":"Ease-in-out Exponential. Based on two to the power ten.","cubic-bezier(0.19, 1, 0.22, 1)":"Ease-out Exponential. Based on two to the power ten.","cubic-bezier(0.47, 0, 0.745, 0.715)":"Ease-in Sine.","cubic-bezier(0.445, 0.05, 0.55, 0.95)":"Ease-in-out Sine.","cubic-bezier(0.39, 0.575, 0.565, 1)":"Ease-out Sine.","cubic-bezier(0.55, 0.085, 0.68, 0.53)":"Ease-in Quadratic. Based on power of two.","cubic-bezier(0.455, 0.03, 0.515, 0.955)":"Ease-in-out Quadratic. Based on power of two.","cubic-bezier(0.25, 0.46, 0.45, 0.94)":"Ease-out Quadratic. Based on power of two.","cubic-bezier(0.895, 0.03, 0.685, 0.22)":"Ease-in Quartic. Based on power of four.","cubic-bezier(0.77, 0, 0.175, 1)":"Ease-in-out Quartic. Based on power of four.","cubic-bezier(0.165, 0.84, 0.44, 1)":"Ease-out Quartic. Based on power of four.","cubic-bezier(0.755, 0.05, 0.855, 0.06)":"Ease-in Quintic. Based on power of five.","cubic-bezier(0.86, 0, 0.07, 1)":"Ease-in-out Quintic. Based on power of five.","cubic-bezier(0.23, 1, 0.320, 1)":"Ease-out Quintic. Based on power of five."},t.basicShapeFunctions={"circle()":"Defines a circle.","ellipse()":"Defines an ellipse.","inset()":"Defines an inset rectangle.","polygon()":"Defines a polygon."},t.units={length:["em","rem","ex","px","cm","mm","in","pt","pc","ch","vw","vh","vmin","vmax"],angle:["deg","rad","grad","turn"],time:["ms","s"],frequency:["Hz","kHz"],resolution:["dpi","dpcm","dppx"],percentage:["%","fr"]},t.html5Tags=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rb","rp","rt","rtc","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","const","video","wbr"],t.svgElements=["circle","clipPath","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","hatch","hatchpath","image","line","linearGradient","marker","mask","mesh","meshpatch","meshrow","metadata","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","solidcolor","stop","svg","switch","symbol","text","textPath","tspan","use","view"],t.pageBoxDirectives=["@bottom-center","@bottom-left","@bottom-left-corner","@bottom-right","@bottom-right-corner","@left-bottom","@left-middle","@left-top","@right-bottom","@right-middle","@right-top","@top-center","@top-left","@top-left-corner","@top-right","@top-right-corner"]})),function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("vscode-css-languageservice/languageFacts/facts",["require","exports","./entry","./colors","./builtinData"],e)}((function(e,t){"use strict";function n(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),n(e("./entry")),n(e("./colors")),n(e("./builtinData"))})),function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("vscode-css-languageservice/utils/objects",["require","exports"],e)}((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.values=function(e){return Object.keys(e).map((function(t){return e[t]}))},t.isDefined=function(e){return void 0!==e}}));var __spreadArrays=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;te.offset?o-e.offset:0}return e},e.prototype.markError=function(e,t,n,i){this.token!==this.lastErrorToken&&(e.addIssue(new r.Marker(e,t,r.Level.Error,void 0,this.token.offset,this.token.len)),this.lastErrorToken=this.token),(n||i)&&this.resync(n,i)},e.prototype.parseStylesheet=function(e){var t=e.version,n=e.getText();return this.internalParse(n,this._parseStylesheet,(function(r,i){if(e.version!==t)throw new Error("Underlying model has changed, AST is no longer valid");return n.substr(r,i)}))},e.prototype.internalParse=function(e,t,n){this.scanner.setSource(e),this.token=this.scanner.scan();var r=t.bind(this)();return r&&(r.textProvider=n||function(t,n){return e.substr(t,n)}),r},e.prototype._parseStylesheet=function(){for(var e=this.create(r.Stylesheet);e.addChild(this._parseStylesheetStart()););var t=!1;do{var o=!1;do{o=!1;var s=this._parseStylesheetStatement();for(s&&(e.addChild(s),o=!0,t=!1,this.peek(n.TokenType.EOF)||!this._needsSemicolonAfter(s)||this.accept(n.TokenType.SemiColon)||this.markError(e,i.ParseError.SemiColonExpected));this.accept(n.TokenType.SemiColon)||this.accept(n.TokenType.CDO)||this.accept(n.TokenType.CDC);)o=!0,t=!1}while(o);if(this.peek(n.TokenType.EOF))break;t||(this.peek(n.TokenType.AtKeyword)?this.markError(e,i.ParseError.UnknownAtRule):this.markError(e,i.ParseError.RuleOrSelectorExpected),t=!0),this.consumeToken()}while(!this.peek(n.TokenType.EOF));return this.finish(e)},e.prototype._parseStylesheetStart=function(){return this._parseCharset()},e.prototype._parseStylesheetStatement=function(e){return void 0===e&&(e=!1),this.peek(n.TokenType.AtKeyword)?this._parseStylesheetAtStatement(e):this._parseRuleset(e)},e.prototype._parseStylesheetAtStatement=function(e){return void 0===e&&(e=!1),this._parseImport()||this._parseMedia(e)||this._parsePage()||this._parseFontFace()||this._parseKeyframe()||this._parseSupports(e)||this._parseViewPort()||this._parseNamespace()||this._parseDocument()||this._parseUnknownAtRule()},e.prototype._tryParseRuleset=function(e){var t=this.mark();if(this._parseSelector(e)){for(;this.accept(n.TokenType.Comma)&&this._parseSelector(e););if(this.accept(n.TokenType.CurlyL))return this.restoreAtMark(t),this._parseRuleset(e)}return this.restoreAtMark(t),null},e.prototype._parseRuleset=function(e){void 0===e&&(e=!1);var t=this.create(r.RuleSet),o=t.getSelectors();if(!o.addChild(this._parseSelector(e)))return null;for(;this.accept(n.TokenType.Comma);)if(!o.addChild(this._parseSelector(e)))return this.finish(t,i.ParseError.SelectorExpected);return this._parseBody(t,this._parseRuleSetDeclaration.bind(this))},e.prototype._parseRuleSetDeclarationAtStatement=function(){return this._parseAtApply()||this._parseUnknownAtRule()},e.prototype._parseRuleSetDeclaration=function(){return this.peek(n.TokenType.AtKeyword)?this._parseRuleSetDeclarationAtStatement():this._tryParseCustomPropertyDeclaration()||this._parseDeclaration()},e.prototype._parseAtApply=function(){if(!this.peekKeyword("@apply"))return null;var e=this.create(r.AtApplyRule);return this.consumeToken(),e.setIdentifier(this._parseIdent([r.ReferenceType.Variable]))?this.finish(e):this.finish(e,i.ParseError.IdentifierExpected)},e.prototype._needsSemicolonAfter=function(e){switch(e.type){case r.NodeType.Keyframe:case r.NodeType.ViewPort:case r.NodeType.Media:case r.NodeType.Ruleset:case r.NodeType.Namespace:case r.NodeType.If:case r.NodeType.For:case r.NodeType.Each:case r.NodeType.While:case r.NodeType.MixinDeclaration:case r.NodeType.FunctionDeclaration:case r.NodeType.MixinContentDeclaration:return!1;case r.NodeType.ExtendsReference:case r.NodeType.MixinContentReference:case r.NodeType.ReturnStatement:case r.NodeType.MediaQuery:case r.NodeType.Debug:case r.NodeType.Import:case r.NodeType.AtApplyRule:case r.NodeType.CustomPropertyDeclaration:return!0;case r.NodeType.VariableDeclaration:return e.needsSemicolon;case r.NodeType.MixinReference:return!e.getContent();case r.NodeType.Declaration:return!e.getNestedProperties()}return!1},e.prototype._parseDeclarations=function(e){var t=this.create(r.Declarations);if(!this.accept(n.TokenType.CurlyL))return null;for(var o=e();t.addChild(o)&&!this.peek(n.TokenType.CurlyR);){if(this._needsSemicolonAfter(o)&&!this.accept(n.TokenType.SemiColon))return this.finish(t,i.ParseError.SemiColonExpected,[n.TokenType.SemiColon,n.TokenType.CurlyR]);for(o&&this.prevToken&&this.prevToken.type===n.TokenType.SemiColon&&(o.semicolonPosition=this.prevToken.offset);this.accept(n.TokenType.SemiColon););o=e()}return this.accept(n.TokenType.CurlyR)?this.finish(t):this.finish(t,i.ParseError.RightCurlyExpected,[n.TokenType.CurlyR,n.TokenType.SemiColon])},e.prototype._parseBody=function(e,t){return e.setDeclarations(this._parseDeclarations(t))?this.finish(e):this.finish(e,i.ParseError.LeftCurlyExpected,[n.TokenType.CurlyR,n.TokenType.SemiColon])},e.prototype._parseSelector=function(e){var t=this.create(r.Selector),n=!1;for(e&&(n=t.addChild(this._parseCombinator()));t.addChild(this._parseSimpleSelector());)n=!0,t.addChild(this._parseCombinator());return n?this.finish(t):null},e.prototype._parseDeclaration=function(e){var t=this.create(r.Declaration);if(!t.setProperty(this._parseProperty()))return null;if(!this.accept(n.TokenType.Colon)){var o=e?__spreadArrays(e,[n.TokenType.SemiColon]):[n.TokenType.SemiColon];return this.finish(t,i.ParseError.ColonExpected,[n.TokenType.Colon],o)}return this.prevToken&&(t.colonPosition=this.prevToken.offset),t.setValue(this._parseExpr())?(t.addChild(this._parsePrio()),this.peek(n.TokenType.SemiColon)&&(t.semicolonPosition=this.token.offset),this.finish(t)):this.finish(t,i.ParseError.PropertyValueExpected)},e.prototype._tryParseCustomPropertyDeclaration=function(){if(!this.peekRegExp(n.TokenType.Ident,/^--/))return null;var e=this.create(r.CustomPropertyDeclaration);if(!e.setProperty(this._parseProperty()))return null;if(!this.accept(n.TokenType.Colon))return this.finish(e,i.ParseError.ColonExpected,[n.TokenType.Colon]);this.prevToken&&(e.colonPosition=this.prevToken.offset);var t=this.mark();if(this.peek(n.TokenType.CurlyL)){var o=this.create(r.CustomPropertySet),a=this._parseDeclarations(this._parseRuleSetDeclaration.bind(this));if(o.setDeclarations(a)&&!a.isErroneous(!0)&&(o.addChild(this._parsePrio()),this.peek(n.TokenType.SemiColon)))return this.finish(o),e.setPropertySet(o),e.semicolonPosition=this.token.offset,this.finish(e);this.restoreAtMark(t)}var l=this._parseExpr();return l&&!l.isErroneous(!0)&&(this._parsePrio(),this.peek(n.TokenType.SemiColon))?(e.setValue(l),e.semicolonPosition=this.token.offset,this.finish(e)):(this.restoreAtMark(t),e.addChild(this._parseCustomPropertyValue()),e.addChild(this._parsePrio()),s.isDefined(e.colonPosition)&&this.token.offset===e.colonPosition+1?this.finish(e,i.ParseError.PropertyValueExpected):this.finish(e))},e.prototype._parseCustomPropertyValue=function(){var e=this.create(r.Node),t=function(){return 0===o&&0===s&&0===a},o=0,s=0,a=0;e:for(;;){switch(this.token.type){case n.TokenType.SemiColon:case n.TokenType.Exclamation:if(t())break e;break;case n.TokenType.CurlyL:o++;break;case n.TokenType.CurlyR:if(--o<0){if(0===s&&0===a)break e;return this.finish(e,i.ParseError.LeftCurlyExpected)}break;case n.TokenType.ParenthesisL:s++;break;case n.TokenType.ParenthesisR:if(--s<0)return this.finish(e,i.ParseError.LeftParenthesisExpected);break;case n.TokenType.BracketL:a++;break;case n.TokenType.BracketR:if(--a<0)return this.finish(e,i.ParseError.LeftSquareBracketExpected);break;case n.TokenType.BadString:break e;case n.TokenType.EOF:var l=i.ParseError.RightCurlyExpected;return a>0?l=i.ParseError.RightSquareBracketExpected:s>0&&(l=i.ParseError.RightParenthesisExpected),this.finish(e,l)}this.consumeToken()}return this.finish(e)},e.prototype._tryToParseDeclaration=function(){var e=this.mark();return this._parseProperty()&&this.accept(n.TokenType.Colon)?(this.restoreAtMark(e),this._parseDeclaration()):(this.restoreAtMark(e),null)},e.prototype._parseProperty=function(){var e=this.create(r.Property),t=this.mark();return(this.acceptDelim("*")||this.acceptDelim("_"))&&this.hasWhitespace()?(this.restoreAtMark(t),null):e.setIdentifier(this._parsePropertyIdentifier())?this.finish(e):null},e.prototype._parsePropertyIdentifier=function(){return this._parseIdent()},e.prototype._parseCharset=function(){if(!this.peek(n.TokenType.Charset))return null;var e=this.create(r.Node);return this.consumeToken(),this.accept(n.TokenType.String)?this.accept(n.TokenType.SemiColon)?this.finish(e):this.finish(e,i.ParseError.SemiColonExpected):this.finish(e,i.ParseError.IdentifierExpected)},e.prototype._parseImport=function(){if(!this.peekKeyword("@import"))return null;var e=this.create(r.Import);return this.consumeToken(),e.addChild(this._parseURILiteral())||e.addChild(this._parseStringLiteral())?(this.peek(n.TokenType.SemiColon)||this.peek(n.TokenType.EOF)||e.setMedialist(this._parseMediaQueryList()),this.finish(e)):this.finish(e,i.ParseError.URIOrStringExpected)},e.prototype._parseNamespace=function(){if(!this.peekKeyword("@namespace"))return null;var e=this.create(r.Namespace);return this.consumeToken(),e.addChild(this._parseURILiteral())||(e.addChild(this._parseIdent()),e.addChild(this._parseURILiteral())||e.addChild(this._parseStringLiteral()))?this.accept(n.TokenType.SemiColon)?this.finish(e):this.finish(e,i.ParseError.SemiColonExpected):this.finish(e,i.ParseError.URIExpected,[n.TokenType.SemiColon])},e.prototype._parseFontFace=function(){if(!this.peekKeyword("@font-face"))return null;var e=this.create(r.FontFace);return this.consumeToken(),this._parseBody(e,this._parseRuleSetDeclaration.bind(this))},e.prototype._parseViewPort=function(){if(!this.peekKeyword("@-ms-viewport")&&!this.peekKeyword("@-o-viewport")&&!this.peekKeyword("@viewport"))return null;var e=this.create(r.ViewPort);return this.consumeToken(),this._parseBody(e,this._parseRuleSetDeclaration.bind(this))},e.prototype._parseKeyframe=function(){if(!this.peekRegExp(n.TokenType.AtKeyword,this.keyframeRegex))return null;var e=this.create(r.Keyframe),t=this.create(r.Node);return this.consumeToken(),e.setKeyword(this.finish(t)),t.matches("@-ms-keyframes")&&this.markError(t,i.ParseError.UnknownKeyword),e.setIdentifier(this._parseKeyframeIdent())?this._parseBody(e,this._parseKeyframeSelector.bind(this)):this.finish(e,i.ParseError.IdentifierExpected,[n.TokenType.CurlyR])},e.prototype._parseKeyframeIdent=function(){return this._parseIdent([r.ReferenceType.Keyframe])},e.prototype._parseKeyframeSelector=function(){var e=this.create(r.KeyframeSelector);if(!e.addChild(this._parseIdent())&&!this.accept(n.TokenType.Percentage))return null;for(;this.accept(n.TokenType.Comma);)if(!e.addChild(this._parseIdent())&&!this.accept(n.TokenType.Percentage))return this.finish(e,i.ParseError.PercentageExpected);return this._parseBody(e,this._parseRuleSetDeclaration.bind(this))},e.prototype._tryParseKeyframeSelector=function(){var e=this.create(r.KeyframeSelector),t=this.mark();if(!e.addChild(this._parseIdent())&&!this.accept(n.TokenType.Percentage))return null;for(;this.accept(n.TokenType.Comma);)if(!e.addChild(this._parseIdent())&&!this.accept(n.TokenType.Percentage))return this.restoreAtMark(t),null;return this.peek(n.TokenType.CurlyL)?this._parseBody(e,this._parseRuleSetDeclaration.bind(this)):(this.restoreAtMark(t),null)},e.prototype._parseSupports=function(e){if(void 0===e&&(e=!1),!this.peekKeyword("@supports"))return null;var t=this.create(r.Supports);return this.consumeToken(),t.addChild(this._parseSupportsCondition()),this._parseBody(t,this._parseSupportsDeclaration.bind(this,e))},e.prototype._parseSupportsDeclaration=function(e){return void 0===e&&(e=!1),e?this._tryParseRuleset(!0)||this._tryToParseDeclaration()||this._parseStylesheetStatement(!0):this._parseStylesheetStatement(!1)},e.prototype._parseSupportsCondition=function(){var e=this.create(r.SupportsCondition);if(this.acceptIdent("not"))e.addChild(this._parseSupportsConditionInParens());else if(e.addChild(this._parseSupportsConditionInParens()),this.peekRegExp(n.TokenType.Ident,/^(and|or)$/i))for(var t=this.token.text.toLowerCase();this.acceptIdent(t);)e.addChild(this._parseSupportsConditionInParens());return this.finish(e)},e.prototype._parseSupportsConditionInParens=function(){var e=this.create(r.SupportsCondition);if(this.accept(n.TokenType.ParenthesisL))return this.prevToken&&(e.lParent=this.prevToken.offset),e.addChild(this._tryToParseDeclaration())||this._parseSupportsCondition()?this.accept(n.TokenType.ParenthesisR)?(this.prevToken&&(e.rParent=this.prevToken.offset),this.finish(e)):this.finish(e,i.ParseError.RightParenthesisExpected,[n.TokenType.ParenthesisR],[]):this.finish(e,i.ParseError.ConditionExpected);if(this.peek(n.TokenType.Ident)){var t=this.mark();if(this.consumeToken(),!this.hasWhitespace()&&this.accept(n.TokenType.ParenthesisL)){for(var o=1;this.token.type!==n.TokenType.EOF&&0!==o;)this.token.type===n.TokenType.ParenthesisL?o++:this.token.type===n.TokenType.ParenthesisR&&o--,this.consumeToken();return this.finish(e)}this.restoreAtMark(t)}return this.finish(e,i.ParseError.LeftParenthesisExpected,[],[n.TokenType.ParenthesisL])},e.prototype._parseMediaDeclaration=function(e){return void 0===e&&(e=!1),e?this._tryParseRuleset(!0)||this._tryToParseDeclaration()||this._parseStylesheetStatement(!0):this._parseStylesheetStatement(!1)},e.prototype._parseMedia=function(e){if(void 0===e&&(e=!1),!this.peekKeyword("@media"))return null;var t=this.create(r.Media);return this.consumeToken(),t.addChild(this._parseMediaQueryList())?this._parseBody(t,this._parseMediaDeclaration.bind(this,e)):this.finish(t,i.ParseError.MediaQueryExpected)},e.prototype._parseMediaQueryList=function(){var e=this.create(r.Medialist);if(!e.addChild(this._parseMediaQuery([n.TokenType.CurlyL])))return this.finish(e,i.ParseError.MediaQueryExpected);for(;this.accept(n.TokenType.Comma);)if(!e.addChild(this._parseMediaQuery([n.TokenType.CurlyL])))return this.finish(e,i.ParseError.MediaQueryExpected);return this.finish(e)},e.prototype._parseMediaQuery=function(e){var t=this.create(r.MediaQuery),o=!0,s=!1;if(!this.peek(n.TokenType.ParenthesisL)){if(this.acceptIdent("only")||this.acceptIdent("not"),!t.addChild(this._parseIdent()))return null;s=!0,o=this.acceptIdent("and")}for(;o;)if(t.addChild(this._parseMediaContentStart()))o=this.acceptIdent("and");else{if(!this.accept(n.TokenType.ParenthesisL))return s?this.finish(t,i.ParseError.LeftParenthesisExpected,[],e):null;if(!t.addChild(this._parseMediaFeatureName()))return this.finish(t,i.ParseError.IdentifierExpected,[],e);if(this.accept(n.TokenType.Colon)&&!t.addChild(this._parseExpr()))return this.finish(t,i.ParseError.TermExpected,[],e);if(!this.accept(n.TokenType.ParenthesisR))return this.finish(t,i.ParseError.RightParenthesisExpected,[],e);o=this.acceptIdent("and")}return this.finish(t)},e.prototype._parseMediaContentStart=function(){return null},e.prototype._parseMediaFeatureName=function(){return this._parseIdent()},e.prototype._parseMedium=function(){var e=this.create(r.Node);return e.addChild(this._parseIdent())?this.finish(e):null},e.prototype._parsePageDeclaration=function(){return this._parsePageMarginBox()||this._parseRuleSetDeclaration()},e.prototype._parsePage=function(){if(!this.peekKeyword("@page"))return null;var e=this.create(r.Page);if(this.consumeToken(),e.addChild(this._parsePageSelector()))for(;this.accept(n.TokenType.Comma);)if(!e.addChild(this._parsePageSelector()))return this.finish(e,i.ParseError.IdentifierExpected);return this._parseBody(e,this._parsePageDeclaration.bind(this))},e.prototype._parsePageMarginBox=function(){if(!this.peek(n.TokenType.AtKeyword))return null;var e=this.create(r.PageBoxMarginBox);return this.acceptOneKeyword(o.pageBoxDirectives)||this.markError(e,i.ParseError.UnknownAtRule,[],[n.TokenType.CurlyL]),this._parseBody(e,this._parseRuleSetDeclaration.bind(this))},e.prototype._parsePageSelector=function(){if(!this.peek(n.TokenType.Ident)&&!this.peek(n.TokenType.Colon))return null;var e=this.create(r.Node);return e.addChild(this._parseIdent()),this.accept(n.TokenType.Colon)&&!e.addChild(this._parseIdent())?this.finish(e,i.ParseError.IdentifierExpected):this.finish(e)},e.prototype._parseDocument=function(){if(!this.peekKeyword("@-moz-document"))return null;var e=this.create(r.Document);return this.consumeToken(),this.resync([],[n.TokenType.CurlyL]),this._parseBody(e,this._parseStylesheetStatement.bind(this))},e.prototype._parseUnknownAtRule=function(){if(!this.peek(n.TokenType.AtKeyword))return null;var e=this.create(r.UnknownAtRule);e.addChild(this._parseUnknownAtRuleName());var t=0,o=0,s=0,a=0;e:for(;;){switch(this.token.type){case n.TokenType.SemiColon:if(0===o&&0===s&&0===a)break e;break;case n.TokenType.EOF:return o>0?this.finish(e,i.ParseError.RightCurlyExpected):a>0?this.finish(e,i.ParseError.RightSquareBracketExpected):s>0?this.finish(e,i.ParseError.RightParenthesisExpected):this.finish(e);case n.TokenType.CurlyL:t++,o++;break;case n.TokenType.CurlyR:if(o--,t>0&&0===o){if(this.consumeToken(),a>0)return this.finish(e,i.ParseError.RightSquareBracketExpected);if(s>0)return this.finish(e,i.ParseError.RightParenthesisExpected);break e}if(o<0){if(0===s&&0===a)break e;return this.finish(e,i.ParseError.LeftCurlyExpected)}break;case n.TokenType.ParenthesisL:s++;break;case n.TokenType.ParenthesisR:if(--s<0)return this.finish(e,i.ParseError.LeftParenthesisExpected);break;case n.TokenType.BracketL:a++;break;case n.TokenType.BracketR:if(--a<0)return this.finish(e,i.ParseError.LeftSquareBracketExpected)}this.consumeToken()}return e},e.prototype._parseUnknownAtRuleName=function(){var e=this.create(r.Node);return this.accept(n.TokenType.AtKeyword)?this.finish(e):e},e.prototype._parseOperator=function(){if(this.peekDelim("/")||this.peekDelim("*")||this.peekDelim("+")||this.peekDelim("-")||this.peek(n.TokenType.Dashmatch)||this.peek(n.TokenType.Includes)||this.peek(n.TokenType.SubstringOperator)||this.peek(n.TokenType.PrefixOperator)||this.peek(n.TokenType.SuffixOperator)||this.peekDelim("=")){var e=this.createNode(r.NodeType.Operator);return this.consumeToken(),this.finish(e)}return null},e.prototype._parseUnaryOperator=function(){if(!this.peekDelim("+")&&!this.peekDelim("-"))return null;var e=this.create(r.Node);return this.consumeToken(),this.finish(e)},e.prototype._parseCombinator=function(){if(this.peekDelim(">")){var e=this.create(r.Node);this.consumeToken();var t=this.mark();if(!this.hasWhitespace()&&this.acceptDelim(">")){if(!this.hasWhitespace()&&this.acceptDelim(">"))return e.type=r.NodeType.SelectorCombinatorShadowPiercingDescendant,this.finish(e);this.restoreAtMark(t)}return e.type=r.NodeType.SelectorCombinatorParent,this.finish(e)}if(this.peekDelim("+")){e=this.create(r.Node);return this.consumeToken(),e.type=r.NodeType.SelectorCombinatorSibling,this.finish(e)}if(this.peekDelim("~")){e=this.create(r.Node);return this.consumeToken(),e.type=r.NodeType.SelectorCombinatorAllSiblings,this.finish(e)}if(this.peekDelim("/")){e=this.create(r.Node);this.consumeToken();t=this.mark();if(!this.hasWhitespace()&&this.acceptIdent("deep")&&!this.hasWhitespace()&&this.acceptDelim("/"))return e.type=r.NodeType.SelectorCombinatorShadowPiercingDescendant,this.finish(e);this.restoreAtMark(t)}return null},e.prototype._parseSimpleSelector=function(){var e=this.create(r.SimpleSelector),t=0;for(e.addChild(this._parseElementName())&&t++;(0===t||!this.hasWhitespace())&&e.addChild(this._parseSimpleSelectorBody());)t++;return t>0?this.finish(e):null},e.prototype._parseSimpleSelectorBody=function(){return this._parsePseudo()||this._parseHash()||this._parseClass()||this._parseAttrib()},e.prototype._parseSelectorIdent=function(){return this._parseIdent()},e.prototype._parseHash=function(){if(!this.peek(n.TokenType.Hash)&&!this.peekDelim("#"))return null;var e=this.createNode(r.NodeType.IdentifierSelector);if(this.acceptDelim("#")){if(this.hasWhitespace()||!e.addChild(this._parseSelectorIdent()))return this.finish(e,i.ParseError.IdentifierExpected)}else this.consumeToken();return this.finish(e)},e.prototype._parseClass=function(){if(!this.peekDelim("."))return null;var e=this.createNode(r.NodeType.ClassSelector);return this.consumeToken(),this.hasWhitespace()||!e.addChild(this._parseSelectorIdent())?this.finish(e,i.ParseError.IdentifierExpected):this.finish(e)},e.prototype._parseElementName=function(){var e=this.mark(),t=this.createNode(r.NodeType.ElementNameSelector);return t.addChild(this._parseNamespacePrefix()),t.addChild(this._parseSelectorIdent())||this.acceptDelim("*")?this.finish(t):(this.restoreAtMark(e),null)},e.prototype._parseNamespacePrefix=function(){var e=this.mark(),t=this.createNode(r.NodeType.NamespacePrefix);return!t.addChild(this._parseIdent())&&this.acceptDelim("*"),this.acceptDelim("|")?this.finish(t):(this.restoreAtMark(e),null)},e.prototype._parseAttrib=function(){if(!this.peek(n.TokenType.BracketL))return null;var e=this.create(r.AttributeSelector);return this.consumeToken(),e.setNamespacePrefix(this._parseNamespacePrefix()),e.setIdentifier(this._parseIdent())?(e.setOperator(this._parseOperator())&&(e.setValue(this._parseBinaryExpr()),this.acceptIdent("i")),this.accept(n.TokenType.BracketR)?this.finish(e):this.finish(e,i.ParseError.RightSquareBracketExpected)):this.finish(e,i.ParseError.IdentifierExpected)},e.prototype._parsePseudo=function(){var e=this,t=this._tryParsePseudoIdentifier();if(t){if(!this.hasWhitespace()&&this.accept(n.TokenType.ParenthesisL)){if(t.addChild(this.try((function(){var t=e.create(r.Node);if(!t.addChild(e._parseSelector(!1)))return null;for(;e.accept(n.TokenType.Comma)&&t.addChild(e._parseSelector(!1)););return e.peek(n.TokenType.ParenthesisR)?e.finish(t):null}))||this._parseBinaryExpr()),!this.accept(n.TokenType.ParenthesisR))return this.finish(t,i.ParseError.RightParenthesisExpected)}return this.finish(t)}return null},e.prototype._tryParsePseudoIdentifier=function(){if(!this.peek(n.TokenType.Colon))return null;var e=this.mark(),t=this.createNode(r.NodeType.PseudoSelector);return this.consumeToken(),this.hasWhitespace()?(this.restoreAtMark(e),null):(this.accept(n.TokenType.Colon)&&this.hasWhitespace()&&this.markError(t,i.ParseError.IdentifierExpected),t.addChild(this._parseIdent())||this.markError(t,i.ParseError.IdentifierExpected),t)},e.prototype._tryParsePrio=function(){var e=this.mark(),t=this._parsePrio();return t||(this.restoreAtMark(e),null)},e.prototype._parsePrio=function(){if(!this.peek(n.TokenType.Exclamation))return null;var e=this.createNode(r.NodeType.Prio);return this.accept(n.TokenType.Exclamation)&&this.acceptIdent("important")?this.finish(e):null},e.prototype._parseExpr=function(e){void 0===e&&(e=!1);var t=this.create(r.Expression);if(!t.addChild(this._parseBinaryExpr()))return null;for(;;){if(this.peek(n.TokenType.Comma)){if(e)return this.finish(t);this.consumeToken()}if(!t.addChild(this._parseBinaryExpr()))break}return this.finish(t)},e.prototype._parseNamedLine=function(){if(!this.peek(n.TokenType.BracketL))return null;var e=this.createNode(r.NodeType.GridLine);for(this.consumeToken();e.addChild(this._parseIdent()););return this.accept(n.TokenType.BracketR)?this.finish(e):this.finish(e,i.ParseError.RightSquareBracketExpected)},e.prototype._parseBinaryExpr=function(e,t){var n=this.create(r.BinaryExpression);if(!n.setLeft(e||this._parseTerm()))return null;if(!n.setOperator(t||this._parseOperator()))return this.finish(n);if(!n.setRight(this._parseTerm()))return this.finish(n,i.ParseError.TermExpected);n=this.finish(n);var o=this._parseOperator();return o&&(n=this._parseBinaryExpr(n,o)),this.finish(n)},e.prototype._parseTerm=function(){var e=this.create(r.Term);return e.setOperator(this._parseUnaryOperator()),e.setExpression(this._parseTermExpression())?this.finish(e):null},e.prototype._parseTermExpression=function(){return this._parseURILiteral()||this._parseFunction()||this._parseIdent()||this._parseStringLiteral()||this._parseNumeric()||this._parseHexColor()||this._parseOperation()||this._parseNamedLine()},e.prototype._parseOperation=function(){if(!this.peek(n.TokenType.ParenthesisL))return null;var e=this.create(r.Node);return this.consumeToken(),e.addChild(this._parseExpr()),this.accept(n.TokenType.ParenthesisR)?this.finish(e):this.finish(e,i.ParseError.RightParenthesisExpected)},e.prototype._parseNumeric=function(){if(this.peek(n.TokenType.Num)||this.peek(n.TokenType.Percentage)||this.peek(n.TokenType.Resolution)||this.peek(n.TokenType.Length)||this.peek(n.TokenType.EMS)||this.peek(n.TokenType.EXS)||this.peek(n.TokenType.Angle)||this.peek(n.TokenType.Time)||this.peek(n.TokenType.Dimension)||this.peek(n.TokenType.Freq)){var e=this.create(r.NumericValue);return this.consumeToken(),this.finish(e)}return null},e.prototype._parseStringLiteral=function(){if(!this.peek(n.TokenType.String)&&!this.peek(n.TokenType.BadString))return null;var e=this.createNode(r.NodeType.StringLiteral);return this.consumeToken(),this.finish(e)},e.prototype._parseURILiteral=function(){if(!this.peekRegExp(n.TokenType.Ident,/^url(-prefix)?$/i))return null;var e=this.mark(),t=this.createNode(r.NodeType.URILiteral);return this.accept(n.TokenType.Ident),this.hasWhitespace()||!this.peek(n.TokenType.ParenthesisL)?(this.restoreAtMark(e),null):(this.scanner.inURL=!0,this.consumeToken(),t.addChild(this._parseURLArgument()),this.scanner.inURL=!1,this.accept(n.TokenType.ParenthesisR)?this.finish(t):this.finish(t,i.ParseError.RightParenthesisExpected))},e.prototype._parseURLArgument=function(){var e=this.create(r.Node);return this.accept(n.TokenType.String)||this.accept(n.TokenType.BadString)||this.acceptUnquotedString()?this.finish(e):null},e.prototype._parseIdent=function(e){if(!this.peek(n.TokenType.Ident))return null;var t=this.create(r.Identifier);return e&&(t.referenceTypes=e),t.isCustomProperty=this.peekRegExp(n.TokenType.Ident,/^--/),this.consumeToken(),this.finish(t)},e.prototype._parseFunction=function(){var e=this.mark(),t=this.create(r.Function);if(!t.setIdentifier(this._parseFunctionIdentifier()))return null;if(this.hasWhitespace()||!this.accept(n.TokenType.ParenthesisL))return this.restoreAtMark(e),null;if(t.getArguments().addChild(this._parseFunctionArgument()))for(;this.accept(n.TokenType.Comma)&&!this.peek(n.TokenType.ParenthesisR);)t.getArguments().addChild(this._parseFunctionArgument())||this.markError(t,i.ParseError.ExpressionExpected);return this.accept(n.TokenType.ParenthesisR)?this.finish(t):this.finish(t,i.ParseError.RightParenthesisExpected)},e.prototype._parseFunctionIdentifier=function(){if(!this.peek(n.TokenType.Ident))return null;var e=this.create(r.Identifier);if(e.referenceTypes=[r.ReferenceType.Function],this.acceptIdent("progid")){if(this.accept(n.TokenType.Colon))for(;this.accept(n.TokenType.Ident)&&this.acceptDelim("."););return this.finish(e)}return this.consumeToken(),this.finish(e)},e.prototype._parseFunctionArgument=function(){var e=this.create(r.FunctionArgument);return e.setValue(this._parseExpr(!0))?this.finish(e):null},e.prototype._parseHexColor=function(){if(this.peekRegExp(n.TokenType.Hash,/^#([A-Fa-f0-9]{3}|[A-Fa-f0-9]{4}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/g)){var e=this.create(r.HexColorValue);return this.consumeToken(),this.finish(e)}return null},e}();t.Parser=a})),function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("vscode-css-languageservice/utils/arrays",["require","exports"],e)}((function(e,t){"use strict";function n(e,t){return-1!==e.indexOf(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.findFirst=function(e,t){var n=0,r=e.length;if(0===r)return 0;for(;ne+t||this.offset===e&&this.length===t?this.findInScope(e,t):null},e.prototype.findInScope=function(e,t){void 0===t&&(t=0);var n=e+t,i=r.findFirst(this.children,(function(e){return e.offset>n}));if(0===i)return this;var o=this.children[i-1];return o.offset<=e&&o.offset+o.length>=e+t?o.findInScope(e,t):this},e.prototype.addSymbol=function(e){this.symbols.push(e)},e.prototype.getSymbol=function(e,t){for(var n=0;n0&&(i.arguments=n),i},e.is=function(e){var t=e;return x.defined(t)&&x.string(t.title)&&x.string(t.command)}}(l=t.Command||(t.Command={})),function(e){e.replace=function(e,t){return{range:e,newText:t}},e.insert=function(e,t){return{range:{start:e,end:e},newText:t}},e.del=function(e){return{range:e,newText:""}},e.is=function(e){var t=e;return x.objectLiteral(t)&&x.string(t.newText)&&r.is(t.range)}}(c=t.TextEdit||(t.TextEdit={})),function(e){e.create=function(e,t){return{textDocument:e,edits:t}},e.is=function(e){var t=e;return x.defined(t)&&f.is(t.textDocument)&&Array.isArray(t.edits)}}(d=t.TextDocumentEdit||(t.TextDocumentEdit={})),function(e){e.create=function(e,t){var n={kind:"create",uri:e};return void 0===t||void 0===t.overwrite&&void 0===t.ignoreIfExists||(n.options=t),n},e.is=function(e){var t=e;return t&&"create"===t.kind&&x.string(t.uri)&&(void 0===t.options||(void 0===t.options.overwrite||x.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||x.boolean(t.options.ignoreIfExists)))}}(p=t.CreateFile||(t.CreateFile={})),function(e){e.create=function(e,t,n){var r={kind:"rename",oldUri:e,newUri:t};return void 0===n||void 0===n.overwrite&&void 0===n.ignoreIfExists||(r.options=n),r},e.is=function(e){var t=e;return t&&"rename"===t.kind&&x.string(t.oldUri)&&x.string(t.newUri)&&(void 0===t.options||(void 0===t.options.overwrite||x.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||x.boolean(t.options.ignoreIfExists)))}}(h=t.RenameFile||(t.RenameFile={})),function(e){e.create=function(e,t){var n={kind:"delete",uri:e};return void 0===t||void 0===t.recursive&&void 0===t.ignoreIfNotExists||(n.options=t),n},e.is=function(e){var t=e;return t&&"delete"===t.kind&&x.string(t.uri)&&(void 0===t.options||(void 0===t.options.recursive||x.boolean(t.options.recursive))&&(void 0===t.options.ignoreIfNotExists||x.boolean(t.options.ignoreIfNotExists)))}}(u=t.DeleteFile||(t.DeleteFile={})),function(e){e.is=function(e){var t=e;return t&&(void 0!==t.changes||void 0!==t.documentChanges)&&(void 0===t.documentChanges||t.documentChanges.every((function(e){return x.string(e.kind)?p.is(e)||h.is(e)||u.is(e):d.is(e)})))}}(m=t.WorkspaceEdit||(t.WorkspaceEdit={}));var f,g,b,y,v=function(){function e(e){this.edits=e}return e.prototype.insert=function(e,t){this.edits.push(c.insert(e,t))},e.prototype.replace=function(e,t){this.edits.push(c.replace(e,t))},e.prototype.delete=function(e){this.edits.push(c.del(e))},e.prototype.add=function(e){this.edits.push(e)},e.prototype.all=function(){return this.edits},e.prototype.clear=function(){this.edits.splice(0,this.edits.length)},e}(),w=function(){function e(e){var t=this;this._textEditChanges=Object.create(null),e&&(this._workspaceEdit=e,e.documentChanges?e.documentChanges.forEach((function(e){if(d.is(e)){var n=new v(e.edits);t._textEditChanges[e.textDocument.uri]=n}})):e.changes&&Object.keys(e.changes).forEach((function(n){var r=new v(e.changes[n]);t._textEditChanges[n]=r})))}return Object.defineProperty(e.prototype,"edit",{get:function(){return this._workspaceEdit},enumerable:!0,configurable:!0}),e.prototype.getTextEditChange=function(e){if(f.is(e)){if(this._workspaceEdit||(this._workspaceEdit={documentChanges:[]}),!this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var t=e;if(!(r=this._textEditChanges[t.uri])){var n={textDocument:t,edits:i=[]};this._workspaceEdit.documentChanges.push(n),r=new v(i),this._textEditChanges[t.uri]=r}return r}if(this._workspaceEdit||(this._workspaceEdit={changes:Object.create(null)}),!this._workspaceEdit.changes)throw new Error("Workspace edit is not configured for normal text edit changes.");var r;if(!(r=this._textEditChanges[e])){var i=[];this._workspaceEdit.changes[e]=i,r=new v(i),this._textEditChanges[e]=r}return r},e.prototype.createFile=function(e,t){this.checkDocumentChanges(),this._workspaceEdit.documentChanges.push(p.create(e,t))},e.prototype.renameFile=function(e,t,n){this.checkDocumentChanges(),this._workspaceEdit.documentChanges.push(h.create(e,t,n))},e.prototype.deleteFile=function(e,t){this.checkDocumentChanges(),this._workspaceEdit.documentChanges.push(u.create(e,t))},e.prototype.checkDocumentChanges=function(){if(!this._workspaceEdit||!this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.")},e}();t.WorkspaceChange=w,function(e){e.create=function(e){return{uri:e}},e.is=function(e){var t=e;return x.defined(t)&&x.string(t.uri)}}(t.TextDocumentIdentifier||(t.TextDocumentIdentifier={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){var t=e;return x.defined(t)&&x.string(t.uri)&&(null===t.version||x.number(t.version))}}(f=t.VersionedTextDocumentIdentifier||(t.VersionedTextDocumentIdentifier={})),function(e){e.create=function(e,t,n,r){return{uri:e,languageId:t,version:n,text:r}},e.is=function(e){var t=e;return x.defined(t)&&x.string(t.uri)&&x.string(t.languageId)&&x.number(t.version)&&x.string(t.text)}}(t.TextDocumentItem||(t.TextDocumentItem={})),function(e){e.PlainText="plaintext",e.Markdown="markdown"}(g=t.MarkupKind||(t.MarkupKind={})),function(e){e.is=function(t){var n=t;return n===e.PlainText||n===e.Markdown}}(g=t.MarkupKind||(t.MarkupKind={})),function(e){e.is=function(e){var t=e;return x.objectLiteral(e)&&g.is(t.kind)&&x.string(t.value)}}(b=t.MarkupContent||(t.MarkupContent={})),function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25}(t.CompletionItemKind||(t.CompletionItemKind={})),function(e){e.PlainText=1,e.Snippet=2}(t.InsertTextFormat||(t.InsertTextFormat={})),function(e){e.Deprecated=1}(t.CompletionItemTag||(t.CompletionItemTag={})),function(e){e.create=function(e){return{label:e}}}(t.CompletionItem||(t.CompletionItem={})),function(e){e.create=function(e,t){return{items:e||[],isIncomplete:!!t}}}(t.CompletionList||(t.CompletionList={})),function(e){e.fromPlainText=function(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")},e.is=function(e){var t=e;return x.string(t)||x.objectLiteral(t)&&x.string(t.language)&&x.string(t.value)}}(y=t.MarkedString||(t.MarkedString={})),function(e){e.is=function(e){var t=e;return!!t&&x.objectLiteral(t)&&(b.is(t.contents)||y.is(t.contents)||x.typedArray(t.contents,y.is))&&(void 0===e.range||r.is(e.range))}}(t.Hover||(t.Hover={})),function(e){e.create=function(e,t){return t?{label:e,documentation:t}:{label:e}}}(t.ParameterInformation||(t.ParameterInformation={})),function(e){e.create=function(e,t){for(var n=[],r=2;r=0;s--){var a=i[s],l=e.offsetAt(a.range.start),c=e.offsetAt(a.range.end);if(!(c<=o))throw new Error("Overlapping edit");r=r.substring(0,l)+a.newText+r.substring(c,r.length),o=l}return r}}(t.TextDocument||(t.TextDocument={}));var x,S=function(){function e(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}return Object.defineProperty(e.prototype,"uri",{get:function(){return this._uri},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"languageId",{get:function(){return this._languageId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return this._version},enumerable:!0,configurable:!0}),e.prototype.getText=function(e){if(e){var t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content},e.prototype.update=function(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0},e.prototype.getLineOffsets=function(){if(void 0===this._lineOffsets){for(var e=[],t=this._content,n=!0,r=0;r0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets},e.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),r=0,i=t.length;if(0===i)return n.create(0,e);for(;re?i=o:r=o+1}var s=r-1;return n.create(s,e-t[s])},e.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var n=t[e.line],r=e.line+1e?r=i:n=i+1}var o=n-1;return{line:o,character:e-t[o]}},e.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var n=t[e.line],r=e.line+1n.line||t.line===n.line&&t.character>n.character?{start:n,end:t}:e}function s(e){var t=o(e.range);return t!==e.range?{newText:e.newText,range:t}:e}!function(e){e.create=function(e,t,r,i){return new n(e,t,r,i)},e.update=function(e,t,r){if(e instanceof n)return e.update(t,r),e;throw new Error("TextDocument.update: document must be created by TextDocument.create")},e.applyEdits=function(e,t){for(var n=e.getText(),i=0,o=[],a=0,l=r(t.map(s),(function(e,t){var n=e.range.start.line-t.range.start.line;return 0===n?e.range.start.character-t.range.start.character:n}));ai&&o.push(n.substring(i,d)),c.newText.length&&o.push(c.newText),i=e.offsetAt(c.range.end)}return o.push(n.substr(i)),o.join("")}}(t.TextDocument||(t.TextDocument={}))})),define("vscode-languageserver-textdocument",["vscode-languageserver-textdocument/main"],(function(e){return e})),function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("vscode-css-languageservice/cssLanguageTypes",["require","exports","vscode-languageserver-types","vscode-languageserver-textdocument","vscode-languageserver-types"],e)}((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=e("vscode-languageserver-types"),r=e("vscode-languageserver-textdocument");t.TextDocument=r.TextDocument,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(e("vscode-languageserver-types")),function(e){e.LATEST={textDocument:{completion:{completionItem:{documentationFormat:[n.MarkupKind.Markdown,n.MarkupKind.PlainText]}},hover:{contentFormat:[n.MarkupKind.Markdown,n.MarkupKind.PlainText]}}}}(t.ClientCapabilities||(t.ClientCapabilities={})),function(e){e[e.Unknown=0]="Unknown",e[e.File=1]="File",e[e.Directory=2]="Directory",e[e.SymbolicLink=64]="SymbolicLink"}(t.FileType||(t.FileType={}))}));__extends=this&&this.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();!function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("vscode-uri/index",["require","exports"],e)}((function(e,t){"use strict";var n,r;if(Object.defineProperty(t,"__esModule",{value:!0}),"object"==typeof process)r="win32"===process.platform;else if("object"==typeof navigator){var i=navigator.userAgent;r=i.indexOf("Windows")>=0}var o=/^\w[\w\d+.-]*$/,s=/^\//,a=/^\/\//;var l="",c="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,p=function(){function e(e,t,n,r,i,d){void 0===d&&(d=!1),"object"==typeof e?(this.scheme=e.scheme||l,this.authority=e.authority||l,this.path=e.path||l,this.query=e.query||l,this.fragment=e.fragment||l):(this.scheme=function(e,t){return e||t?e:"file"}(e,d),this.authority=t||l,this.path=function(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==c&&(t=c+t):t=c}return t}(this.scheme,n||l),this.query=r||l,this.fragment=i||l,function(e,t){if(!e.scheme&&t)throw new Error('[UriError]: Scheme is missing: {scheme: "", authority: "'+e.authority+'", path: "'+e.path+'", query: "'+e.query+'", fragment: "'+e.fragment+'"}');if(e.scheme&&!o.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){if(!s.test(e.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(a.test(e.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}(this,d))}return e.isUri=function(t){return t instanceof e||!!t&&("string"==typeof t.authority&&"string"==typeof t.fragment&&"string"==typeof t.path&&"string"==typeof t.query&&"string"==typeof t.scheme&&"function"==typeof t.fsPath&&"function"==typeof t.with&&"function"==typeof t.toString)},Object.defineProperty(e.prototype,"fsPath",{get:function(){return b(this,!1)},enumerable:!0,configurable:!0}),e.prototype.with=function(e){if(!e)return this;var t=e.scheme,n=e.authority,r=e.path,i=e.query,o=e.fragment;return void 0===t?t=this.scheme:null===t&&(t=l),void 0===n?n=this.authority:null===n&&(n=l),void 0===r?r=this.path:null===r&&(r=l),void 0===i?i=this.query:null===i&&(i=l),void 0===o?o=this.fragment:null===o&&(o=l),t===this.scheme&&n===this.authority&&r===this.path&&i===this.query&&o===this.fragment?this:new u(t,n,r,i,o)},e.parse=function(e,t){void 0===t&&(t=!1);var n=d.exec(e);return n?new u(n[2]||l,x(n[4]||l),x(n[5]||l),x(n[7]||l),x(n[9]||l),t):new u(l,l,l,l,l)},e.file=function(e){var t=l;if(r&&(e=e.replace(/\\/g,c)),e[0]===c&&e[1]===c){var n=e.indexOf(c,2);-1===n?(t=e.substring(2),e=c):(t=e.substring(2,n),e=e.substring(n)||c)}return new u("file",t,e,l,l)},e.from=function(e){return new u(e.scheme,e.authority,e.path,e.query,e.fragment)},e.prototype.toString=function(e){return void 0===e&&(e=!1),y(this,e)},e.prototype.toJSON=function(){return this},e.revive=function(t){if(t){if(t instanceof e)return t;var n=new u(t);return n._formatted=t.external,n._fsPath=t._sep===h?t.fsPath:null,n}return t},e}();t.URI=p;var h=r?1:void 0,u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._formatted=null,t._fsPath=null,t}return __extends(t,e),Object.defineProperty(t.prototype,"fsPath",{get:function(){return this._fsPath||(this._fsPath=b(this,!1)),this._fsPath},enumerable:!0,configurable:!0}),t.prototype.toString=function(e){return void 0===e&&(e=!1),e?y(this,!0):(this._formatted||(this._formatted=y(this,!1)),this._formatted)},t.prototype.toJSON=function(){var e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=h),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e},t}(p),m=((n={})[58]="%3A",n[47]="%2F",n[63]="%3F",n[35]="%23",n[91]="%5B",n[93]="%5D",n[64]="%40",n[33]="%21",n[36]="%24",n[38]="%26",n[39]="%27",n[40]="%28",n[41]="%29",n[42]="%2A",n[43]="%2B",n[44]="%2C",n[59]="%3B",n[61]="%3D",n[32]="%20",n);function f(e,t){for(var n=void 0,r=-1,i=0;i=97&&o<=122||o>=65&&o<=90||o>=48&&o<=57||45===o||46===o||95===o||126===o||t&&47===o)-1!==r&&(n+=encodeURIComponent(e.substring(r,i)),r=-1),void 0!==n&&(n+=e.charAt(i));else{void 0===n&&(n=e.substr(0,i));var s=m[o];void 0!==s?(-1!==r&&(n+=encodeURIComponent(e.substring(r,i)),r=-1),n+=s):-1===r&&(r=i)}}return-1!==r&&(n+=encodeURIComponent(e.substring(r))),void 0!==n?n:e}function g(e){for(var t=void 0,n=0;n1&&"file"===e.scheme?"//"+e.authority+e.path:47===e.path.charCodeAt(0)&&(e.path.charCodeAt(1)>=65&&e.path.charCodeAt(1)<=90||e.path.charCodeAt(1)>=97&&e.path.charCodeAt(1)<=122)&&58===e.path.charCodeAt(2)?t?e.path.substr(1):e.path[1].toLowerCase()+e.path.substr(2):e.path,r&&(n=n.replace(/\//g,"\\")),n}function y(e,t){var n=t?g:f,r="",i=e.scheme,o=e.authority,s=e.path,a=e.query,l=e.fragment;if(i&&(r+=i,r+=":"),(o||"file"===i)&&(r+=c,r+=c),o){var d=o.indexOf("@");if(-1!==d){var p=o.substr(0,d);o=o.substr(d+1),-1===(d=p.indexOf(":"))?r+=n(p,!1):(r+=n(p.substr(0,d),!1),r+=":",r+=n(p.substr(d+1),!1)),r+="@"}-1===(d=(o=o.toLowerCase()).indexOf(":"))?r+=n(o,!1):(r+=n(o.substr(0,d),!1),r+=o.substr(d))}if(s){if(s.length>=3&&47===s.charCodeAt(0)&&58===s.charCodeAt(2))(h=s.charCodeAt(1))>=65&&h<=90&&(s="/"+String.fromCharCode(h+32)+":"+s.substr(3));else if(s.length>=2&&58===s.charCodeAt(1)){var h;(h=s.charCodeAt(0))>=65&&h<=90&&(s=String.fromCharCode(h+32)+":"+s.substr(2))}r+=n(s,!0)}return a&&(r+="?",r+=n(a,!1)),l&&(r+="#",r+=t?l:f(l,!1)),r}function v(e){try{return decodeURIComponent(e)}catch(t){return e.length>3?e.substr(0,3)+v(e.substr(3)):e}}t.uriToFsPath=b;var w=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function x(e){return e.match(w)?e.replace(w,(function(e){return v(e)})):e}})),define("vscode-uri",["vscode-uri/index"],(function(e){return e})),function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("vscode-css-languageservice/utils/resources",["require","exports","vscode-uri"],e)}((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=e("vscode-uri"),r="/".charCodeAt(0),i=".".charCodeAt(0);function o(e){return e.charCodeAt(0)===r}function s(e){for(var t=[],n=0,r=e;n1&&0===e[e.length-1].length&&t.push("");var s=t.join("/");return 0===e[0].length&&(s="/"+s),s}function a(e){for(var t=[],r=1;r=0;t--){var n=e.charCodeAt(t);if(n===i){if(t>0&&e.charCodeAt(t-1)!==r)return e.substr(t);break}if(n===r)break}return""},t.resolvePath=function(e,t){if(o(t)){var r=n.URI.parse(e),i=t.split("/");return r.with({path:s(i)}).toString()}return a(e,t)},t.normalizePath=s,t.joinPath=a}));var __awaiter=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))},__generator=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=0&&-1===' \t\n\r":{[()]},*>+'.indexOf(r.charAt(n));)n--;return r.substring(n+1,t)}(e,this.offset),this.defaultReplaceRange=a.Range.create(a.Position.create(this.position.line,this.position.character-this.currentWord.length),this.position),this.textDocument=e,this.styleSheet=n;try{var i={isIncomplete:!1,items:[]};this.nodePath=r.getNodePath(this.styleSheet,this.offset);for(var o=this.nodePath.length-1;o>=0;o--){var s=this.nodePath[o];if(s instanceof r.Property)this.getCompletionsForDeclarationProperty(s.getParent(),i);else if(s instanceof r.Expression)s.parent instanceof r.Interpolation?this.getVariableProposals(null,i):this.getCompletionsForExpression(s,i);else if(s instanceof r.SimpleSelector){var l=s.findAParent(r.NodeType.ExtendsReference,r.NodeType.Ruleset);if(l)if(l.type===r.NodeType.ExtendsReference)this.getCompletionsForExtendsReference(l,s,i);else{var c=l;this.getCompletionsForSelector(c,c&&c.isNested(),i)}}else if(s instanceof r.FunctionArgument)this.getCompletionsForFunctionArgument(s,s.getParent(),i);else if(s instanceof r.Declarations)this.getCompletionsForDeclarations(s,i);else if(s instanceof r.VariableDeclaration)this.getCompletionsForVariableDeclaration(s,i);else if(s instanceof r.RuleSet)this.getCompletionsForRuleSet(s,i);else if(s instanceof r.Interpolation)this.getCompletionsForInterpolation(s,i);else if(s instanceof r.FunctionDeclaration)this.getCompletionsForFunctionDeclaration(s,i);else if(s instanceof r.MixinReference)this.getCompletionsForMixinReference(s,i);else if(s instanceof r.Function)this.getCompletionsForFunctionArgument(null,s,i);else if(s instanceof r.Supports)this.getCompletionsForSupports(s,i);else if(s instanceof r.SupportsCondition)this.getCompletionsForSupportsCondition(s,i);else if(s instanceof r.ExtendsReference)this.getCompletionsForExtendsReference(s,null,i);else if(s.type===r.NodeType.URILiteral)this.getCompletionForUriLiteralValue(s,i);else if(null===s.parent)this.getCompletionForTopLevel(i);else{if(s.type!==r.NodeType.StringLiteral||!this.isImportPathParent(s.parent.type))continue;this.getCompletionForImportPath(s,i)}if(i.items.length>0||this.offset>s.offset)return this.finalize(i)}return this.getCompletionsForStylesheet(i),0===i.items.length&&this.variablePrefix&&0===this.currentWord.indexOf(this.variablePrefix)&&this.getVariableProposals(null,i),this.finalize(i)}finally{this.position=null,this.currentWord=null,this.textDocument=null,this.styleSheet=null,this.symbolContext=null,this.defaultReplaceRange=null,this.nodePath=null}},e.prototype.isImportPathParent=function(e){return e===r.NodeType.Import},e.prototype.finalize=function(e){return e},e.prototype.findInNodePath=function(){for(var e=[],t=0;t=0;n--){var r=this.nodePath[n];if(-1!==e.indexOf(r.type))return r}return null},e.prototype.getCompletionsForDeclarationProperty=function(e,t){return this.getPropertyProposals(e,t)},e.prototype.getPropertyProposals=function(e,t){var r=this,i=this.isTriggerPropertyValueCompletionEnabled,l=this.isCompletePropertyWithSemicolonEnabled;return this.cssDataManager.getProperties().forEach((function(d){var p,h,u=!1;e?(p=r.getCompletionRange(e.getProperty()),h=d.name,c.isDefined(e.colonPosition)||(h+=": ",u=!0)):(p=r.getCompletionRange(null),h=d.name+": ",u=!0),!e&&l&&(h+="$0;"),e&&!e.semicolonPosition&&l&&r.offset>=r.textDocument.offsetAt(p.end)&&(h+="$0;");var f={label:d.name,documentation:o.getEntryDescription(d,r.doesSupportMarkdown()),tags:m(d)?[a.CompletionItemTag.Deprecated]:[],textEdit:a.TextEdit.replace(p,h),insertTextFormat:a.InsertTextFormat.Snippet,kind:a.CompletionItemKind.Property};d.restrictions||(u=!1),i&&u&&(f.command={title:"Suggest",command:"editor.action.triggerSuggest"});var g=(255-("number"==typeof d.relevance?Math.min(Math.max(d.relevance,0),99):50)).toString(16),b=s.startsWith(d.name,"-")?n.VendorPrefixed:n.Normal;f.sortText=b+"_"+g,t.items.push(f)})),this.completionParticipants.forEach((function(e){e.onCssProperty&&e.onCssProperty({propertyName:r.currentWord,range:r.defaultReplaceRange})})),t},Object.defineProperty(e.prototype,"isTriggerPropertyValueCompletionEnabled",{get:function(){return!this.settings||!this.settings.completion||void 0===this.settings.completion.triggerPropertyValueCompletion||this.settings.completion.triggerPropertyValueCompletion},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isCompletePropertyWithSemicolonEnabled",{get:function(){return!this.settings||!this.settings.completion||void 0===this.settings.completion.completePropertyWithSemicolon||this.settings.completion.completePropertyWithSemicolon},enumerable:!0,configurable:!0}),e.prototype.getCompletionsForDeclarationValue=function(e,t){for(var n=this,i=e.getFullPropertyName(),o=this.cssDataManager.getProperty(i),s=e.getValue()||null;s&&s.hasChildren();)s=s.findChildAtOffset(this.offset,!1);if(this.completionParticipants.forEach((function(e){e.onCssPropertyValue&&e.onCssPropertyValue({propertyName:i,propertyValue:n.currentWord,range:n.getCompletionRange(s)})})),o){if(o.restrictions)for(var l=0,c=o.restrictions;l=e.offset+2&&this.getVariableProposals(null,t),t},e.prototype.getVariableProposals=function(e,t){for(var i=0,o=this.getSymbolContext().findSymbolsAtOffset(this.offset,r.ReferenceType.Variable);i0){var s=this.currentWord.match(/^-?\d[\.\d+]*/);s&&(i=s[0],n.isIncomplete=i.length===this.currentWord.length)}else 0===this.currentWord.length&&(n.isIncomplete=!0);if(t&&t.parent&&t.parent.type===r.NodeType.Term&&(t=t.getParent()),e.restrictions)for(var l=0,c=e.restrictions;l=n.end?this.getCompletionForTopLevel(t):!n||this.offset<=n.offset?this.getCompletionsForSelector(e,e.isNested(),t):this.getCompletionsForDeclarations(e.getDeclarations(),t)},e.prototype.getCompletionsForSelector=function(e,t,i){var l=this,c=this.findInNodePath(r.NodeType.PseudoSelector,r.NodeType.IdentifierSelector,r.NodeType.ClassSelector,r.NodeType.ElementNameSelector);if(!c&&this.offset-this.currentWord.length>0&&":"===this.textDocument.getText()[this.offset-this.currentWord.length-1]&&(this.currentWord=":"+this.currentWord,this.defaultReplaceRange=a.Range.create(a.Position.create(this.position.line,this.position.character-this.currentWord.length),this.position)),this.cssDataManager.getPseudoClasses().forEach((function(e){var t=g(e.name),r={label:e.name,textEdit:a.TextEdit.replace(l.getCompletionRange(c),t),documentation:o.getEntryDescription(e,l.doesSupportMarkdown()),tags:m(e)?[a.CompletionItemTag.Deprecated]:[],kind:a.CompletionItemKind.Function,insertTextFormat:e.name!==t?h:void 0};s.startsWith(e.name,":-")&&(r.sortText=n.VendorPrefixed),i.items.push(r)})),this.cssDataManager.getPseudoElements().forEach((function(e){var t=g(e.name),r={label:e.name,textEdit:a.TextEdit.replace(l.getCompletionRange(c),t),documentation:o.getEntryDescription(e,l.doesSupportMarkdown()),tags:m(e)?[a.CompletionItemTag.Deprecated]:[],kind:a.CompletionItemKind.Function,insertTextFormat:e.name!==t?h:void 0};s.startsWith(e.name,"::-")&&(r.sortText=n.VendorPrefixed),i.items.push(r)})),!t){for(var d=0,p=o.html5Tags;d0){var t=v.substr(e.offset,e.length);return"."!==t.charAt(0)||y[t]||(y[t]=!0,i.items.push({label:t,textEdit:a.TextEdit.replace(l.getCompletionRange(c),t),kind:a.CompletionItemKind.Keyword})),!1}return!0})),e&&e.isNested()){var w=e.getSelectors().findFirstChildBeforeOffset(this.offset);w&&0===e.getSelectors().getChildren().indexOf(w)&&this.getPropertyProposals(null,i)}return i},e.prototype.getCompletionsForDeclarations=function(e,t){if(!e||this.offset===e.offset)return t;var n=e.findFirstChildBeforeOffset(this.offset);if(!n)return this.getCompletionsForDeclarationProperty(null,t);if(n instanceof r.AbstractDeclaration){var i=n;if(!c.isDefined(i.colonPosition)||this.offset<=i.colonPosition)return this.getCompletionsForDeclarationProperty(i,t);if(c.isDefined(i.semicolonPosition)&&i.semicolonPositione.colonPosition&&this.getVariableProposals(e.getValue(),t),t},e.prototype.getCompletionsForExpression=function(e,t){var n=e.getParent();if(n instanceof r.FunctionArgument)return this.getCompletionsForFunctionArgument(n,n.getParent(),t),t;var i=e.findParent(r.NodeType.Declaration);if(!i)return this.getTermProposals(void 0,null,t),t;var o=e.findChildAtOffset(this.offset,!0);return o?o instanceof r.NumericValue||o instanceof r.Identifier?this.getCompletionsForDeclarationValue(i,t):t:this.getCompletionsForDeclarationValue(i,t)},e.prototype.getCompletionsForFunctionArgument=function(e,t,n){var r=t.getIdentifier();return r&&r.matches("var")&&(t.getArguments().hasChildren()&&t.getArguments().getChild(0)!==e||this.getVariableProposalsForCSSVarFunction(n)),n},e.prototype.getCompletionsForFunctionDeclaration=function(e,t){var n=e.getDeclarations();return n&&this.offset>n.offset&&this.offsete.lParent&&(!c.isDefined(e.rParent)||this.offset<=e.rParent)?this.getCompletionsForDeclarationProperty(null,t):t},e.prototype.getCompletionsForSupports=function(e,t){var n=e.getDeclarations();if(!n||this.offset<=n.offset){var i=e.findFirstChildBeforeOffset(this.offset);return i instanceof r.SupportsCondition?this.getCompletionsForSupportsCondition(i,t):t}return this.getCompletionForTopLevel(t)},e.prototype.getCompletionsForExtendsReference=function(e,t,n){return n},e.prototype.getCompletionForUriLiteralValue=function(e,t){var n,r,i;if(e.hasChildren()){var o=e.getChild(0);n=o.getText(),r=this.position,i=this.getCompletionRange(o)}else{n="",r=this.position;var s=this.textDocument.positionAt(e.offset+"url(".length);i=a.Range.create(s,s)}return this.completionParticipants.forEach((function(e){e.onCssURILiteralValue&&e.onCssURILiteralValue({uriValue:n,position:r,range:i})})),t},e.prototype.getCompletionForImportPath=function(e,t){var n=this;return this.completionParticipants.forEach((function(t){t.onCssImportPath&&t.onCssImportPath({pathValue:e.getText(),position:n.position,range:n.getCompletionRange(e)})})),t},e.prototype.doesSupportMarkdown=function(){var e,t,n;if(!c.isDefined(this.supportsMarkdown)){if(!c.isDefined(this.lsOptions.clientCapabilities))return this.supportsMarkdown=!0,this.supportsMarkdown;var r=null===(n=null===(t=null===(e=this.lsOptions.clientCapabilities.textDocument)||void 0===e?void 0:e.completion)||void 0===t?void 0:t.completionItem)||void 0===n?void 0:n.documentationFormat;this.supportsMarkdown=Array.isArray(r)&&-1!==r.indexOf(a.MarkupKind.Markdown)}return this.supportsMarkdown},e}();function m(e){return!(!e.status||"nonstandard"!==e.status&&"obsolete"!==e.status)}t.CSSCompletion=u;var f=function(){function e(){this.entries={}}return e.prototype.add=function(e){this.entries[e]=!0},e.prototype.getEntries=function(){return Object.keys(this.entries)},e}();function g(e){return e.replace(/\(\)$/,"($1)")}var b=function(){function e(e,t){this.entries=e,this.currentOffset=t}return e.prototype.visitNode=function(e){return(e instanceof r.HexColorValue||e instanceof r.Function&&o.isColorConstructor(e))&&(this.currentOffset"),this.writeLine(t,r.join(""))}},e}();!function(e){function t(e){var t=e.match(/^['"](.*)["']$/);return t?t[1]:e}e.ensure=function(e,n){return n+t(e)+n},e.remove=t}(l||(l={}));var d=function(){this.id=0,this.attr=0,this.tag=0};function p(e,t){for(var r=new o,i=0,s=e.getChildren();i1){var p=t.cloneWithParent();r.addChild(p.findRoot()),r=p}r.append(c[d])}}break;case n.NodeType.SelectorPlaceholder:if(a.matches("@at-root"))return r;case n.NodeType.ElementNameSelector:var u=a.getText();r.addAttr("name","*"===u?"element":h(u));break;case n.NodeType.ClassSelector:r.addAttr("class",h(a.getText().substring(1)));break;case n.NodeType.IdentifierSelector:r.addAttr("id",h(a.getText().substring(1)));break;case n.NodeType.MixinDeclaration:r.addAttr("class",a.getName());break;case n.NodeType.PseudoSelector:r.addAttr(h(a.getText()),"");break;case n.NodeType.AttributeSelector:var m=a,f=m.getIdentifier();if(f){var g=m.getValue(),b=m.getOperator(),y=void 0;if(g&&b)switch(h(b.getText())){case"|=":y=l.remove(h(g.getText()))+"-…";break;case"^=":y=l.remove(h(g.getText()))+"…";break;case"$=":y="…"+l.remove(h(g.getText()));break;case"~=":y=" … "+l.remove(h(g.getText()))+" … ";break;case"*=":y="…"+l.remove(h(g.getText()))+"…";break;default:y=l.remove(h(g.getText()))}r.addAttr(h(f.getText()),y)}}}return r}function h(e){var t=new r.Scanner;t.setSource(e);var n=t.scanUnquotedString();return n?n.text:e}t.toElement=p;var u=function(){function e(e){this.cssDataManager=e}return e.prototype.selectorToMarkedString=function(e){var t=g(e);if(t){var n=new c('"').print(t);return n.push(this.selectorToSpecificityMarkedString(e)),n}return[]},e.prototype.simpleSelectorToMarkedString=function(e){var t=p(e),n=new c('"').print(t);return n.push(this.selectorToSpecificityMarkedString(e)),n},e.prototype.isPseudoElementIdentifier=function(e){var t=e.match(/^::?([\w-]+)/);return!!t&&!!this.cssDataManager.getPseudoElement("::"+t[1])},e.prototype.selectorToSpecificityMarkedString=function(e){var t=this,r=function(e){for(var i=0,s=e.getChildren();i0&&r(a)}},o=new d;return r(e),i("specificity","[Selector Specificity](https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity): ({0}, {1}, {2})",o.id,o.attr,o.tag)},e}();t.SelectorPrinting=u;var m=function(){function e(e){this.prev=null,this.element=e}return e.prototype.processSelector=function(e){var t=null;if(!(this.element instanceof s)&&e.getChildren().some((function(e){return e.hasChildren()&&e.getChild(0).type===n.NodeType.SelectorCombinator}))){var r=this.element.findRoot();r.parent instanceof s&&(t=this.element,this.element=r.parent,this.element.removeChild(r),this.prev=null)}for(var i=0,o=e.getChildren();i=0;l--){var c=r[l].getSelectors().getChild(0);c&&a.processSelector(c)}return a.processSelector(e),t}t.selectorToElement=g})),function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("vscode-css-languageservice/services/cssHover",["require","exports","../parser/cssNodes","../languageFacts/facts","./selectorPrinting","../utils/strings","../cssLanguageTypes","../utils/objects"],e)}((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=e("../parser/cssNodes"),r=e("../languageFacts/facts"),i=e("./selectorPrinting"),o=e("../utils/strings"),s=e("../cssLanguageTypes"),a=e("../utils/objects"),l=function(){function e(e,t){this.clientCapabilities=e,this.cssDataManager=t,this.selectorPrinting=new i.SelectorPrinting(t)}return e.prototype.doHover=function(e,t,i){function a(t){return s.Range.create(e.positionAt(t.offset),e.positionAt(t.end))}for(var l=e.offsetAt(t),c=n.getNodePath(i,l),d=null,p=0;p0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=a.length/2&&l.push({property:e.name,score:t})})),l.sort((function(e,t){return t.score-e.score||e.property.localeCompare(t.property)}));for(var c=3,d=0,p=l;d=0;c--){var d=l[c];if(d instanceof n.Declaration){var p=d.getProperty();if(p&&p.offset===s&&p.end===a)return void this.getFixesForUnknownProperty(e,p,r,o)}}},e}();t.CSSCodeActions=a})),function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("vscode-css-languageservice/services/lintUtil",["require","exports","../utils/arrays"],e)}((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=e("../utils/arrays"),r=function(e){this.fullPropertyName=e.getFullPropertyName().toLowerCase(),this.node=e};function i(e,t,r,i){var o=e[t];o.value=r,r&&(n.includes(o.properties,i)||o.properties.push(i))}function o(e,t,n,r){"top"===t||"right"===t||"bottom"===t||"left"===t?i(e,t,n,r):function(e,t,n){i(e,"top",t,n),i(e,"right",t,n),i(e,"bottom",t,n),i(e,"left",t,n)}(e,n,r)}function s(e,t,n){switch(t.length){case 1:o(e,void 0,t[0],n);break;case 2:o(e,"top",t[0],n),o(e,"bottom",t[0],n),o(e,"right",t[1],n),o(e,"left",t[1],n);break;case 3:o(e,"top",t[0],n),o(e,"right",t[1],n),o(e,"left",t[1],n),o(e,"bottom",t[2],n);break;case 4:o(e,"top",t[0],n),o(e,"right",t[1],n),o(e,"bottom",t[2],n),o(e,"left",t[3],n)}}function a(e,t){for(var n=0,r=t;n0)for(var w=0,x=["width","height","margin-top","margin-bottom","float"];w0)for(k=this.fetch(c,"float"),C=0;C0)for(k=this.fetch(c,"vertical-align"),C=0;C1)for(var P=0;P<_.length;P++){var I=_[P].node.getValue();I&&"-"!==this.documentText.charAt(I.offset)&&_[P]!==R&&this.addEntry(R.node,r.Rules.DuplicateDeclarations)}}}if(!t.getSelectors().matches(":export")){for(var N=new l,M=!1,A=0,O=c;A".charCodeAt(0),m=".".charCodeAt(0),f=("@".charCodeAt(0),n.TokenType.CustomToken);t.VariableName=f++,t.InterpolationFunction=f++,t.Default=f++,t.EqualsOperator=f++,t.NotEqualsOperator=f++,t.GreaterEqualsOperator=f++,t.SmallerEqualsOperator=f++,t.Ellipsis=f++,t.Module=f++;var g=function(e){function f(){return null!==e&&e.apply(this,arguments)||this}return __extends(f,e),f.prototype.scanNext=function(r){if(this.stream.advanceIfChar(a)){var i=["$"];if(this.ident(i))return this.finishToken(r,t.VariableName,i.join(""));this.stream.goBackTo(r)}return this.stream.advanceIfChars([l,c])?this.finishToken(r,t.InterpolationFunction):this.stream.advanceIfChars([d,d])?this.finishToken(r,t.EqualsOperator):this.stream.advanceIfChars([p,d])?this.finishToken(r,t.NotEqualsOperator):this.stream.advanceIfChar(h)?this.stream.advanceIfChar(d)?this.finishToken(r,t.SmallerEqualsOperator):this.finishToken(r,n.TokenType.Delim):this.stream.advanceIfChar(u)?this.stream.advanceIfChar(d)?this.finishToken(r,t.GreaterEqualsOperator):this.finishToken(r,n.TokenType.Delim):this.stream.advanceIfChars([m,m,m])?this.finishToken(r,t.Ellipsis):e.prototype.scanNext.call(this,r)},f.prototype.comment=function(){return!!e.prototype.comment.call(this)||!(this.inURL||!this.stream.advanceIfChars([r,r]))&&(this.stream.advanceWhileChar((function(e){switch(e){case i:case o:case s:return!1;default:return!0}})),!0)},f}(n.Scanner);t.SCSSScanner=g})),function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("vscode-css-languageservice/parser/scssErrors",["require","exports","vscode-nls"],e)}((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=e("vscode-nls").loadMessageBundle(),r=function(e,t){this.id=e,this.message=t};t.SCSSIssueType=r,t.SCSSParseError={FromExpected:new r("scss-fromexpected",n("expected.from","'from' expected")),ThroughOrToExpected:new r("scss-throughexpected",n("expected.through","'through' or 'to' expected")),InExpected:new r("scss-fromexpected",n("expected.in","'in' expected"))}}));__extends=this&&this.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();!function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("vscode-css-languageservice/parser/scssParser",["require","exports","./scssScanner","./cssScanner","./cssParser","./cssNodes","./scssErrors","./cssErrors"],e)}((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=e("./scssScanner"),r=e("./cssScanner"),i=e("./cssParser"),o=e("./cssNodes"),s=e("./scssErrors"),a=e("./cssErrors"),l=function(e){function t(){return e.call(this,new n.SCSSScanner)||this}return __extends(t,e),t.prototype._parseStylesheetStatement=function(t){return void 0===t&&(t=!1),this.peek(r.TokenType.AtKeyword)?this._parseWarnAndDebug()||this._parseControlStatement()||this._parseMixinDeclaration()||this._parseMixinContent()||this._parseMixinReference()||this._parseFunctionDeclaration()||this._parseForward()||this._parseUse()||this._parseRuleset(t)||e.prototype._parseStylesheetAtStatement.call(this,t):this._parseRuleset(!0)||this._parseVariableDeclaration()},t.prototype._parseImport=function(){if(!this.peekKeyword("@import"))return null;var e=this.create(o.Import);if(this.consumeToken(),!e.addChild(this._parseURILiteral())&&!e.addChild(this._parseStringLiteral()))return this.finish(e,a.ParseError.URIOrStringExpected);for(;this.accept(r.TokenType.Comma);)if(!e.addChild(this._parseURILiteral())&&!e.addChild(this._parseStringLiteral()))return this.finish(e,a.ParseError.URIOrStringExpected);return this.peek(r.TokenType.SemiColon)||this.peek(r.TokenType.EOF)||e.setMedialist(this._parseMediaQueryList()),this.finish(e)},t.prototype._parseVariableDeclaration=function(e){if(void 0===e&&(e=[]),!this.peek(n.VariableName))return null;var t=this.create(o.VariableDeclaration);if(!t.setVariable(this._parseVariable()))return null;if(!this.accept(r.TokenType.Colon))return this.finish(t,a.ParseError.ColonExpected);if(this.prevToken&&(t.colonPosition=this.prevToken.offset),!t.setValue(this._parseExpr()))return this.finish(t,a.ParseError.VariableValueExpected,[],e);for(;this.peek(r.TokenType.Exclamation);)if(t.addChild(this._tryParsePrio()));else{if(this.consumeToken(),!this.peekRegExp(r.TokenType.Ident,/^(default|global)$/))return this.finish(t,a.ParseError.UnknownKeyword);this.consumeToken()}return this.peek(r.TokenType.SemiColon)&&(t.semicolonPosition=this.token.offset),this.finish(t)},t.prototype._parseMediaContentStart=function(){return this._parseInterpolation()},t.prototype._parseMediaFeatureName=function(){return this._parseModuleMember()||this._parseFunction()||this._parseIdent()||this._parseVariable()},t.prototype._parseKeyframeSelector=function(){return this._tryParseKeyframeSelector()||this._parseControlStatement(this._parseKeyframeSelector.bind(this))||this._parseVariableDeclaration()||this._parseMixinContent()},t.prototype._parseVariable=function(){if(!this.peek(n.VariableName))return null;var e=this.create(o.Variable);return this.consumeToken(),e},t.prototype._parseModuleMember=function(){var e=this.mark(),t=this.create(o.Module);return t.setIdentifier(this._parseIdent([o.ReferenceType.Module]))?this.hasWhitespace()||!this.acceptDelim(".")||this.hasWhitespace()?(this.restoreAtMark(e),null):t.addChild(this._parseVariable()||this._parseFunction())?t:this.finish(t,a.ParseError.IdentifierOrVariableExpected):null},t.prototype._parseIdent=function(e){var t=this;if(!this.peek(r.TokenType.Ident)&&!this.peek(n.InterpolationFunction)&&!this.peekDelim("-"))return null;var i=this.create(o.Identifier);i.referenceTypes=e,i.isCustomProperty=this.peekRegExp(r.TokenType.Ident,/^--/);for(var s,a=!1;(this.accept(r.TokenType.Ident)||i.addChild((s=void 0,s=t.mark(),t.acceptDelim("-")&&(t.hasWhitespace()||t.acceptDelim("-"),t.hasWhitespace())?(t.restoreAtMark(s),null):t._parseInterpolation()))||a&&this.acceptRegexp(/[\w-]/))&&(a=!0,!this.hasWhitespace()););return a?this.finish(i):null},t.prototype._parseTermExpression=function(){return this._parseModuleMember()||this._parseVariable()||this._parseSelectorCombinator()||e.prototype._parseTermExpression.call(this)},t.prototype._parseInterpolation=function(){if(this.peek(n.InterpolationFunction)){var e=this.create(o.Interpolation);return this.consumeToken(),e.addChild(this._parseExpr())||this._parseSelectorCombinator()?this.accept(r.TokenType.CurlyR)?this.finish(e):this.finish(e,a.ParseError.RightCurlyExpected):this.accept(r.TokenType.CurlyR)?this.finish(e):this.finish(e,a.ParseError.ExpressionExpected)}return null},t.prototype._parseOperator=function(){if(this.peek(n.EqualsOperator)||this.peek(n.NotEqualsOperator)||this.peek(n.GreaterEqualsOperator)||this.peek(n.SmallerEqualsOperator)||this.peekDelim(">")||this.peekDelim("<")||this.peekIdent("and")||this.peekIdent("or")||this.peekDelim("%")){var t=this.createNode(o.NodeType.Operator);return this.consumeToken(),this.finish(t)}return e.prototype._parseOperator.call(this)},t.prototype._parseUnaryOperator=function(){if(this.peekIdent("not")){var t=this.create(o.Node);return this.consumeToken(),this.finish(t)}return e.prototype._parseUnaryOperator.call(this)},t.prototype._parseRuleSetDeclaration=function(){return this.peek(r.TokenType.AtKeyword)?this._parseKeyframe()||this._parseImport()||this._parseMedia(!0)||this._parseFontFace()||this._parseWarnAndDebug()||this._parseControlStatement()||this._parseFunctionDeclaration()||this._parseExtends()||this._parseMixinReference()||this._parseMixinContent()||this._parseMixinDeclaration()||this._parseRuleset(!0)||this._parseSupports(!0)||e.prototype._parseRuleSetDeclarationAtStatement.call(this):this._parseVariableDeclaration()||this._tryParseRuleset(!0)||e.prototype._parseRuleSetDeclaration.call(this)},t.prototype._parseDeclaration=function(e){var t=this.create(o.Declaration);if(!t.setProperty(this._parseProperty()))return null;if(!this.accept(r.TokenType.Colon))return this.finish(t,a.ParseError.ColonExpected,[r.TokenType.Colon],e);this.prevToken&&(t.colonPosition=this.prevToken.offset);var n=!1;if(t.setValue(this._parseExpr())&&(n=!0,t.addChild(this._parsePrio())),this.peek(r.TokenType.CurlyL))t.setNestedProperties(this._parseNestedProperties());else if(!n)return this.finish(t,a.ParseError.PropertyValueExpected);return this.peek(r.TokenType.SemiColon)&&(t.semicolonPosition=this.token.offset),this.finish(t)},t.prototype._parseNestedProperties=function(){var e=this.create(o.NestedProperties);return this._parseBody(e,this._parseDeclaration.bind(this))},t.prototype._parseExtends=function(){if(this.peekKeyword("@extend")){var e=this.create(o.ExtendsReference);if(this.consumeToken(),!e.getSelectors().addChild(this._parseSimpleSelector()))return this.finish(e,a.ParseError.SelectorExpected);for(;this.accept(r.TokenType.Comma);)e.getSelectors().addChild(this._parseSimpleSelector());return this.accept(r.TokenType.Exclamation)&&!this.acceptIdent("optional")?this.finish(e,a.ParseError.UnknownKeyword):this.finish(e)}return null},t.prototype._parseSimpleSelectorBody=function(){return this._parseSelectorCombinator()||this._parseSelectorPlaceholder()||e.prototype._parseSimpleSelectorBody.call(this)},t.prototype._parseSelectorCombinator=function(){if(this.peekDelim("&")){var e=this.createNode(o.NodeType.SelectorCombinator);for(this.consumeToken();!this.hasWhitespace()&&(this.acceptDelim("-")||this.accept(r.TokenType.Num)||this.accept(r.TokenType.Dimension)||e.addChild(this._parseIdent())||this.acceptDelim("&")););return this.finish(e)}return null},t.prototype._parseSelectorPlaceholder=function(){if(this.peekDelim("%")){var e=this.createNode(o.NodeType.SelectorPlaceholder);return this.consumeToken(),this._parseIdent(),this.finish(e)}if(this.peekKeyword("@at-root")){e=this.createNode(o.NodeType.SelectorPlaceholder);return this.consumeToken(),this.finish(e)}return null},t.prototype._parseElementName=function(){var t=this.mark(),n=e.prototype._parseElementName.call(this);return n&&!this.hasWhitespace()&&this.peek(r.TokenType.ParenthesisL)?(this.restoreAtMark(t),null):n},t.prototype._tryParsePseudoIdentifier=function(){return this._parseInterpolation()||e.prototype._tryParsePseudoIdentifier.call(this)},t.prototype._parseWarnAndDebug=function(){if(!this.peekKeyword("@debug")&&!this.peekKeyword("@warn")&&!this.peekKeyword("@error"))return null;var e=this.createNode(o.NodeType.Debug);return this.consumeToken(),e.addChild(this._parseExpr()),this.finish(e)},t.prototype._parseControlStatement=function(e){return void 0===e&&(e=this._parseRuleSetDeclaration.bind(this)),this.peek(r.TokenType.AtKeyword)?this._parseIfStatement(e)||this._parseForStatement(e)||this._parseEachStatement(e)||this._parseWhileStatement(e):null},t.prototype._parseIfStatement=function(e){return this.peekKeyword("@if")?this._internalParseIfStatement(e):null},t.prototype._internalParseIfStatement=function(e){var t=this.create(o.IfStatement);if(this.consumeToken(),!t.setExpression(this._parseExpr(!0)))return this.finish(t,a.ParseError.ExpressionExpected);if(this._parseBody(t,e),this.acceptKeyword("@else"))if(this.peekIdent("if"))t.setElseClause(this._internalParseIfStatement(e));else if(this.peek(r.TokenType.CurlyL)){var n=this.create(o.ElseStatement);this._parseBody(n,e),t.setElseClause(n)}return this.finish(t)},t.prototype._parseForStatement=function(e){if(!this.peekKeyword("@for"))return null;var t=this.create(o.ForStatement);return this.consumeToken(),t.setVariable(this._parseVariable())?this.acceptIdent("from")?t.addChild(this._parseBinaryExpr())?this.acceptIdent("to")||this.acceptIdent("through")?t.addChild(this._parseBinaryExpr())?this._parseBody(t,e):this.finish(t,a.ParseError.ExpressionExpected,[r.TokenType.CurlyR]):this.finish(t,s.SCSSParseError.ThroughOrToExpected,[r.TokenType.CurlyR]):this.finish(t,a.ParseError.ExpressionExpected,[r.TokenType.CurlyR]):this.finish(t,s.SCSSParseError.FromExpected,[r.TokenType.CurlyR]):this.finish(t,a.ParseError.VariableNameExpected,[r.TokenType.CurlyR])},t.prototype._parseEachStatement=function(e){if(!this.peekKeyword("@each"))return null;var t=this.create(o.EachStatement);this.consumeToken();var n=t.getVariables();if(!n.addChild(this._parseVariable()))return this.finish(t,a.ParseError.VariableNameExpected,[r.TokenType.CurlyR]);for(;this.accept(r.TokenType.Comma);)if(!n.addChild(this._parseVariable()))return this.finish(t,a.ParseError.VariableNameExpected,[r.TokenType.CurlyR]);return this.finish(n),this.acceptIdent("in")?t.addChild(this._parseExpr())?this._parseBody(t,e):this.finish(t,a.ParseError.ExpressionExpected,[r.TokenType.CurlyR]):this.finish(t,s.SCSSParseError.InExpected,[r.TokenType.CurlyR])},t.prototype._parseWhileStatement=function(e){if(!this.peekKeyword("@while"))return null;var t=this.create(o.WhileStatement);return this.consumeToken(),t.addChild(this._parseBinaryExpr())?this._parseBody(t,e):this.finish(t,a.ParseError.ExpressionExpected,[r.TokenType.CurlyR])},t.prototype._parseFunctionBodyDeclaration=function(){return this._parseVariableDeclaration()||this._parseReturnStatement()||this._parseWarnAndDebug()||this._parseControlStatement(this._parseFunctionBodyDeclaration.bind(this))},t.prototype._parseFunctionDeclaration=function(){if(!this.peekKeyword("@function"))return null;var e=this.create(o.FunctionDeclaration);if(this.consumeToken(),!e.setIdentifier(this._parseIdent([o.ReferenceType.Function])))return this.finish(e,a.ParseError.IdentifierExpected,[r.TokenType.CurlyR]);if(!this.accept(r.TokenType.ParenthesisL))return this.finish(e,a.ParseError.LeftParenthesisExpected,[r.TokenType.CurlyR]);if(e.getParameters().addChild(this._parseParameterDeclaration()))for(;this.accept(r.TokenType.Comma)&&!this.peek(r.TokenType.ParenthesisR);)if(!e.getParameters().addChild(this._parseParameterDeclaration()))return this.finish(e,a.ParseError.VariableNameExpected);return this.accept(r.TokenType.ParenthesisR)?this._parseBody(e,this._parseFunctionBodyDeclaration.bind(this)):this.finish(e,a.ParseError.RightParenthesisExpected,[r.TokenType.CurlyR])},t.prototype._parseReturnStatement=function(){if(!this.peekKeyword("@return"))return null;var e=this.createNode(o.NodeType.ReturnStatement);return this.consumeToken(),e.addChild(this._parseExpr())?this.finish(e):this.finish(e,a.ParseError.ExpressionExpected)},t.prototype._parseMixinDeclaration=function(){if(!this.peekKeyword("@mixin"))return null;var e=this.create(o.MixinDeclaration);if(this.consumeToken(),!e.setIdentifier(this._parseIdent([o.ReferenceType.Mixin])))return this.finish(e,a.ParseError.IdentifierExpected,[r.TokenType.CurlyR]);if(this.accept(r.TokenType.ParenthesisL)){if(e.getParameters().addChild(this._parseParameterDeclaration()))for(;this.accept(r.TokenType.Comma)&&!this.peek(r.TokenType.ParenthesisR);)if(!e.getParameters().addChild(this._parseParameterDeclaration()))return this.finish(e,a.ParseError.VariableNameExpected);if(!this.accept(r.TokenType.ParenthesisR))return this.finish(e,a.ParseError.RightParenthesisExpected,[r.TokenType.CurlyR])}return this._parseBody(e,this._parseRuleSetDeclaration.bind(this))},t.prototype._parseParameterDeclaration=function(){var e=this.create(o.FunctionParameter);return e.setIdentifier(this._parseVariable())?(this.accept(n.Ellipsis),this.accept(r.TokenType.Colon)&&!e.setDefaultValue(this._parseExpr(!0))?this.finish(e,a.ParseError.VariableValueExpected,[],[r.TokenType.Comma,r.TokenType.ParenthesisR]):this.finish(e)):null},t.prototype._parseMixinContent=function(){if(!this.peekKeyword("@content"))return null;var e=this.create(o.MixinContentReference);if(this.consumeToken(),this.accept(r.TokenType.ParenthesisL)){if(e.getArguments().addChild(this._parseFunctionArgument()))for(;this.accept(r.TokenType.Comma)&&!this.peek(r.TokenType.ParenthesisR);)if(!e.getArguments().addChild(this._parseFunctionArgument()))return this.finish(e,a.ParseError.ExpressionExpected);if(!this.accept(r.TokenType.ParenthesisR))return this.finish(e,a.ParseError.RightParenthesisExpected)}return this.finish(e)},t.prototype._parseMixinReference=function(){if(!this.peekKeyword("@include"))return null;var e=this.create(o.MixinReference);this.consumeToken();var t=this._parseIdent([o.ReferenceType.Mixin]);if(!e.setIdentifier(t))return this.finish(e,a.ParseError.IdentifierExpected,[r.TokenType.CurlyR]);if(!this.hasWhitespace()&&this.acceptDelim(".")&&!this.hasWhitespace()){var n=this._parseIdent([o.ReferenceType.Mixin]);if(!n)return this.finish(e,a.ParseError.IdentifierExpected,[r.TokenType.CurlyR]);var i=this.create(o.Module);t.referenceTypes=[o.ReferenceType.Module],i.setIdentifier(t),e.setIdentifier(n),e.addChild(i)}if(this.accept(r.TokenType.ParenthesisL)){if(e.getArguments().addChild(this._parseFunctionArgument()))for(;this.accept(r.TokenType.Comma)&&!this.peek(r.TokenType.ParenthesisR);)if(!e.getArguments().addChild(this._parseFunctionArgument()))return this.finish(e,a.ParseError.ExpressionExpected);if(!this.accept(r.TokenType.ParenthesisR))return this.finish(e,a.ParseError.RightParenthesisExpected)}return(this.peekIdent("using")||this.peek(r.TokenType.CurlyL))&&e.setContent(this._parseMixinContentDeclaration()),this.finish(e)},t.prototype._parseMixinContentDeclaration=function(){var e=this.create(o.MixinContentDeclaration);if(this.acceptIdent("using")){if(!this.accept(r.TokenType.ParenthesisL))return this.finish(e,a.ParseError.LeftParenthesisExpected,[r.TokenType.CurlyL]);if(e.getParameters().addChild(this._parseParameterDeclaration()))for(;this.accept(r.TokenType.Comma)&&!this.peek(r.TokenType.ParenthesisR);)if(!e.getParameters().addChild(this._parseParameterDeclaration()))return this.finish(e,a.ParseError.VariableNameExpected);if(!this.accept(r.TokenType.ParenthesisR))return this.finish(e,a.ParseError.RightParenthesisExpected,[r.TokenType.CurlyL])}return this.peek(r.TokenType.CurlyL)&&this._parseBody(e,this._parseMixinReferenceBodyStatement.bind(this)),this.finish(e)},t.prototype._parseMixinReferenceBodyStatement=function(){return this._tryParseKeyframeSelector()||this._parseRuleSetDeclaration()},t.prototype._parseFunctionArgument=function(){var e=this.create(o.FunctionArgument),t=this.mark(),i=this._parseVariable();if(i)if(this.accept(r.TokenType.Colon))e.setIdentifier(i);else{if(this.accept(n.Ellipsis))return e.setValue(i),this.finish(e);this.restoreAtMark(t)}return e.setValue(this._parseExpr(!0))?(this.accept(n.Ellipsis),e.addChild(this._parsePrio()),this.finish(e)):e.setValue(this._tryParsePrio())?this.finish(e):null},t.prototype._parseURLArgument=function(){var t=this.mark(),n=e.prototype._parseURLArgument.call(this);if(!n||!this.peek(r.TokenType.ParenthesisR)){this.restoreAtMark(t);var i=this.create(o.Node);return i.addChild(this._parseBinaryExpr()),this.finish(i)}return n},t.prototype._parseOperation=function(){if(!this.peek(r.TokenType.ParenthesisL))return null;var e=this.create(o.Node);for(this.consumeToken();e.addChild(this._parseListElement());)this.accept(r.TokenType.Comma);return this.accept(r.TokenType.ParenthesisR)?this.finish(e):this.finish(e,a.ParseError.RightParenthesisExpected)},t.prototype._parseListElement=function(){var e=this.create(o.ListEntry),t=this._parseBinaryExpr();if(!t)return null;if(this.accept(r.TokenType.Colon)){if(e.setKey(t),!e.setValue(this._parseBinaryExpr()))return this.finish(e,a.ParseError.ExpressionExpected)}else e.setValue(t);return this.finish(e)},t.prototype._parseUse=function(){if(!this.peekKeyword("@use"))return null;var e=this.create(o.Use);if(this.consumeToken(),!e.addChild(this._parseStringLiteral()))return this.finish(e,a.ParseError.StringLiteralExpected);if(!this.peek(r.TokenType.SemiColon)&&!this.peek(r.TokenType.EOF)){if(!this.peekRegExp(r.TokenType.Ident,/as|with/))return this.finish(e,a.ParseError.UnknownKeyword);if(this.acceptIdent("as")&&!e.setIdentifier(this._parseIdent([o.ReferenceType.Module]))&&!this.acceptDelim("*"))return this.finish(e,a.ParseError.IdentifierOrWildcardExpected);if(this.acceptIdent("with")){if(!this.accept(r.TokenType.ParenthesisL))return this.finish(e,a.ParseError.LeftParenthesisExpected,[r.TokenType.ParenthesisR]);if(!e.getParameters().addChild(this._parseModuleConfigDeclaration()))return this.finish(e,a.ParseError.VariableNameExpected);for(;this.accept(r.TokenType.Comma)&&!this.peek(r.TokenType.ParenthesisR);)if(!e.getParameters().addChild(this._parseModuleConfigDeclaration()))return this.finish(e,a.ParseError.VariableNameExpected);if(!this.accept(r.TokenType.ParenthesisR))return this.finish(e,a.ParseError.RightParenthesisExpected)}}return this.accept(r.TokenType.SemiColon)||this.accept(r.TokenType.EOF)?this.finish(e):this.finish(e,a.ParseError.SemiColonExpected)},t.prototype._parseModuleConfigDeclaration=function(){var e=this.create(o.ModuleConfiguration);return e.setIdentifier(this._parseVariable())?this.accept(r.TokenType.Colon)&&e.setValue(this._parseExpr(!0))?this.finish(e):this.finish(e,a.ParseError.VariableValueExpected,[],[r.TokenType.Comma,r.TokenType.ParenthesisR]):null},t.prototype._parseForward=function(){if(!this.peekKeyword("@forward"))return null;var e=this.create(o.Forward);if(this.consumeToken(),!e.addChild(this._parseStringLiteral()))return this.finish(e,a.ParseError.StringLiteralExpected);if(!this.peek(r.TokenType.SemiColon)&&!this.peek(r.TokenType.EOF)){if(!this.peekRegExp(r.TokenType.Ident,/as|hide|show/))return this.finish(e,a.ParseError.UnknownKeyword);if(this.acceptIdent("as")){var t=this._parseIdent([o.ReferenceType.Forward]);if(!e.setIdentifier(t))return this.finish(e,a.ParseError.IdentifierExpected);if(this.hasWhitespace()||!this.acceptDelim("*"))return this.finish(e,a.ParseError.WildcardExpected)}if((this.peekIdent("hide")||this.peekIdent("show"))&&!e.addChild(this._parseForwardVisibility()))return this.finish(e,a.ParseError.IdentifierOrVariableExpected)}return this.accept(r.TokenType.SemiColon)||this.accept(r.TokenType.EOF)?this.finish(e):this.finish(e,a.ParseError.SemiColonExpected)},t.prototype._parseForwardVisibility=function(){var e=this.create(o.ForwardVisibility);for(e.setIdentifier(this._parseIdent());e.addChild(this._parseVariable()||this._parseIdent()););return e.getChildren().length>1?e:null},t.prototype._parseSupportsCondition=function(){return this._parseInterpolation()||e.prototype._parseSupportsCondition.call(this)},t}(i.Parser);t.SCSSParser=l}));__extends=this&&this.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();!function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("vscode-css-languageservice/services/scssCompletion",["require","exports","./cssCompletion","../parser/cssNodes","../cssLanguageTypes","vscode-nls"],e)}((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=e("./cssCompletion"),r=e("../parser/cssNodes"),i=e("../cssLanguageTypes"),o=e("vscode-nls").loadMessageBundle(),s=function(e){function t(n,r){var i=e.call(this,"$",n,r)||this;return a(t.scssModuleLoaders),a(t.scssModuleBuiltIns),i}return __extends(t,e),t.prototype.isImportPathParent=function(t){return t===r.NodeType.Forward||t===r.NodeType.Use||e.prototype.isImportPathParent.call(this,t)},t.prototype.getCompletionForImportPath=function(n,o){var s=n.getParent().type;if(s===r.NodeType.Forward||s===r.NodeType.Use)for(var a=0,l=t.scssModuleBuiltIns;a0){var t="string"==typeof e.documentation?{kind:"markdown",value:e.documentation}:{kind:"markdown",value:e.documentation.value};t.value+="\n\n",t.value+=e.references.map((function(e){return"["+e.name+"]("+e.url+")"})).join(" | "),e.documentation=t}}))}t.SCSSCompletion=s}));__extends=this&&this.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();!function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("vscode-css-languageservice/parser/lessScanner",["require","exports","./cssScanner"],e)}((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=e("./cssScanner"),r="/".charCodeAt(0),i="\n".charCodeAt(0),o="\r".charCodeAt(0),s="\f".charCodeAt(0),a="`".charCodeAt(0),l=".".charCodeAt(0),c=n.TokenType.CustomToken;t.Ellipsis=c++;var d=function(e){function c(){return null!==e&&e.apply(this,arguments)||this}return __extends(c,e),c.prototype.scanNext=function(n){var r=this.escapedJavaScript();return null!==r?this.finishToken(n,r):this.stream.advanceIfChars([l,l,l])?this.finishToken(n,t.Ellipsis):e.prototype.scanNext.call(this,n)},c.prototype.comment=function(){return!!e.prototype.comment.call(this)||!(this.inURL||!this.stream.advanceIfChars([r,r]))&&(this.stream.advanceWhileChar((function(e){switch(e){case i:case o:case s:return!1;default:return!0}})),!0)},c.prototype.escapedJavaScript=function(){return this.stream.peekChar()===a?(this.stream.advance(1),this.stream.advanceWhileChar((function(e){return e!==a})),this.stream.advanceIfChar(a)?n.TokenType.EscapedJavaScript:n.TokenType.BadEscapedJavaScript):null},c}(n.Scanner);t.LESSScanner=d}));__extends=this&&this.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();!function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("vscode-css-languageservice/parser/lessParser",["require","exports","./lessScanner","./cssScanner","./cssParser","./cssNodes","./cssErrors"],e)}((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=e("./lessScanner"),r=e("./cssScanner"),i=e("./cssParser"),o=e("./cssNodes"),s=e("./cssErrors"),a=function(e){function t(){return e.call(this,new n.LESSScanner)||this}return __extends(t,e),t.prototype._parseStylesheetStatement=function(t){return void 0===t&&(t=!1),this.peek(r.TokenType.AtKeyword)?this._parseVariableDeclaration()||this._parsePlugin()||e.prototype._parseStylesheetAtStatement.call(this,t):this._tryParseMixinDeclaration()||this._tryParseMixinReference()||this._parseFunction()||this._parseRuleset(!0)},t.prototype._parseImport=function(){if(!this.peekKeyword("@import")&&!this.peekKeyword("@import-once"))return null;var e=this.create(o.Import);if(this.consumeToken(),this.accept(r.TokenType.ParenthesisL)){if(!this.accept(r.TokenType.Ident))return this.finish(e,s.ParseError.IdentifierExpected,[r.TokenType.SemiColon]);do{if(!this.accept(r.TokenType.Comma))break}while(this.accept(r.TokenType.Ident));if(!this.accept(r.TokenType.ParenthesisR))return this.finish(e,s.ParseError.RightParenthesisExpected,[r.TokenType.SemiColon])}return e.addChild(this._parseURILiteral())||e.addChild(this._parseStringLiteral())?(this.peek(r.TokenType.SemiColon)||this.peek(r.TokenType.EOF)||e.setMedialist(this._parseMediaQueryList()),this.finish(e)):this.finish(e,s.ParseError.URIOrStringExpected,[r.TokenType.SemiColon])},t.prototype._parsePlugin=function(){if(!this.peekKeyword("@plugin"))return null;var e=this.createNode(o.NodeType.Plugin);return this.consumeToken(),e.addChild(this._parseStringLiteral())?this.accept(r.TokenType.SemiColon)?this.finish(e):this.finish(e,s.ParseError.SemiColonExpected):this.finish(e,s.ParseError.StringLiteralExpected)},t.prototype._parseMediaQuery=function(t){var n=e.prototype._parseMediaQuery.call(this,t);if(!n){var r=this.create(o.MediaQuery);return r.addChild(this._parseVariable())?this.finish(r):null}return n},t.prototype._parseMediaDeclaration=function(e){return void 0===e&&(e=!1),this._tryParseRuleset(e)||this._tryToParseDeclaration()||this._tryParseMixinDeclaration()||this._tryParseMixinReference()||this._parseDetachedRuleSetMixin()||this._parseStylesheetStatement(e)},t.prototype._parseMediaFeatureName=function(){return this._parseIdent()||this._parseVariable()},t.prototype._parseVariableDeclaration=function(e){void 0===e&&(e=[]);var t=this.create(o.VariableDeclaration),n=this.mark();if(!t.setVariable(this._parseVariable(!0)))return null;if(!this.accept(r.TokenType.Colon))return this.restoreAtMark(n),null;if(this.prevToken&&(t.colonPosition=this.prevToken.offset),t.setValue(this._parseDetachedRuleSet()))t.needsSemicolon=!1;else if(!t.setValue(this._parseExpr()))return this.finish(t,s.ParseError.VariableValueExpected,[],e);return t.addChild(this._parsePrio()),this.peek(r.TokenType.SemiColon)&&(t.semicolonPosition=this.token.offset),this.finish(t)},t.prototype._parseDetachedRuleSet=function(){var e=this.mark();if(this.peekDelim("#")||this.peekDelim(".")){if(this.consumeToken(),this.hasWhitespace()||!this.accept(r.TokenType.ParenthesisL))return this.restoreAtMark(e),null;var t=this.create(o.MixinDeclaration);if(t.getParameters().addChild(this._parseMixinParameter()))for(;(this.accept(r.TokenType.Comma)||this.accept(r.TokenType.SemiColon))&&!this.peek(r.TokenType.ParenthesisR);)t.getParameters().addChild(this._parseMixinParameter())||this.markError(t,s.ParseError.IdentifierExpected,[],[r.TokenType.ParenthesisR]);if(!this.accept(r.TokenType.ParenthesisR))return this.restoreAtMark(e),null}if(!this.peek(r.TokenType.CurlyL))return null;var n=this.create(o.BodyDeclaration);return this._parseBody(n,this._parseDetachedRuleSetBody.bind(this)),this.finish(n)},t.prototype._parseDetachedRuleSetBody=function(){return this._tryParseKeyframeSelector()||this._parseRuleSetDeclaration()},t.prototype._addLookupChildren=function(e){if(!e.addChild(this._parseLookupValue()))return!1;for(var t=!1;this.peek(r.TokenType.BracketL)&&(t=!0),e.addChild(this._parseLookupValue());)t=!1;return!t},t.prototype._parseLookupValue=function(){var e=this.create(o.Node),t=this.mark();return this.accept(r.TokenType.BracketL)&&((e.addChild(this._parseVariable(!1,!0))||e.addChild(this._parsePropertyIdentifier()))&&this.accept(r.TokenType.BracketR)||this.accept(r.TokenType.BracketR))?e:(this.restoreAtMark(t),null)},t.prototype._parseVariable=function(e,t){void 0===e&&(e=!1),void 0===t&&(t=!1);var n=!e&&this.peekDelim("$");if(!this.peekDelim("@")&&!n&&!this.peek(r.TokenType.AtKeyword))return null;for(var i=this.create(o.Variable),s=this.mark();this.acceptDelim("@")||!e&&this.acceptDelim("$");)if(this.hasWhitespace())return this.restoreAtMark(s),null;return(this.accept(r.TokenType.AtKeyword)||this.accept(r.TokenType.Ident))&&(t||!this.peek(r.TokenType.BracketL)||this._addLookupChildren(i))?i:(this.restoreAtMark(s),null)},t.prototype._parseTermExpression=function(){return this._parseVariable()||this._parseEscaped()||e.prototype._parseTermExpression.call(this)||this._tryParseMixinReference(!1)},t.prototype._parseEscaped=function(){if(this.peek(r.TokenType.EscapedJavaScript)||this.peek(r.TokenType.BadEscapedJavaScript)){var e=this.createNode(o.NodeType.EscapedValue);return this.consumeToken(),this.finish(e)}if(this.peekDelim("~")){e=this.createNode(o.NodeType.EscapedValue);return this.consumeToken(),this.accept(r.TokenType.String)||this.accept(r.TokenType.EscapedJavaScript)?this.finish(e):this.finish(e,s.ParseError.TermExpected)}return null},t.prototype._parseOperator=function(){var t=this._parseGuardOperator();return t||e.prototype._parseOperator.call(this)},t.prototype._parseGuardOperator=function(){if(this.peekDelim(">")){var e=this.createNode(o.NodeType.Operator);return this.consumeToken(),this.acceptDelim("="),e}if(this.peekDelim("=")){e=this.createNode(o.NodeType.Operator);return this.consumeToken(),this.acceptDelim("<"),e}if(this.peekDelim("<")){e=this.createNode(o.NodeType.Operator);return this.consumeToken(),this.acceptDelim("="),e}return null},t.prototype._parseRuleSetDeclaration=function(){return this.peek(r.TokenType.AtKeyword)?this._parseKeyframe()||this._parseMedia(!0)||this._parseImport()||this._parseSupports(!0)||this._parseDetachedRuleSetMixin()||this._parseVariableDeclaration()||e.prototype._parseRuleSetDeclarationAtStatement.call(this):this._tryParseMixinDeclaration()||this._tryParseRuleset(!0)||this._tryParseMixinReference()||this._parseFunction()||this._parseExtend()||e.prototype._parseRuleSetDeclaration.call(this)},t.prototype._parseKeyframeIdent=function(){return this._parseIdent([o.ReferenceType.Keyframe])||this._parseVariable()},t.prototype._parseKeyframeSelector=function(){return this._parseDetachedRuleSetMixin()||e.prototype._parseKeyframeSelector.call(this)},t.prototype._parseSimpleSelectorBody=function(){return this._parseSelectorCombinator()||e.prototype._parseSimpleSelectorBody.call(this)},t.prototype._parseSelector=function(e){var t=this.create(o.Selector),n=!1;for(e&&(n=t.addChild(this._parseCombinator()));t.addChild(this._parseSimpleSelector());){n=!0;var i=this.mark();if(t.addChild(this._parseGuard())&&this.peek(r.TokenType.CurlyL))break;this.restoreAtMark(i),t.addChild(this._parseCombinator())}return n?this.finish(t):null},t.prototype._parseSelectorCombinator=function(){if(this.peekDelim("&")){var e=this.createNode(o.NodeType.SelectorCombinator);for(this.consumeToken();!this.hasWhitespace()&&(this.acceptDelim("-")||this.accept(r.TokenType.Num)||this.accept(r.TokenType.Dimension)||e.addChild(this._parseIdent())||this.acceptDelim("&")););return this.finish(e)}return null},t.prototype._parseSelectorIdent=function(){if(!this.peekInterpolatedIdent())return null;var e=this.createNode(o.NodeType.SelectorInterpolation);return this._acceptInterpolatedIdent(e)?this.finish(e):null},t.prototype._parsePropertyIdentifier=function(e){void 0===e&&(e=!1);var t=/^[\w-]+/;if(!this.peekInterpolatedIdent()&&!this.peekRegExp(this.token.type,t))return null;var n=this.mark(),r=this.create(o.Identifier);r.isCustomProperty=this.acceptDelim("-")&&this.acceptDelim("-");return(e?r.isCustomProperty?r.addChild(this._parseIdent()):r.addChild(this._parseRegexp(t)):r.isCustomProperty?this._acceptInterpolatedIdent(r):this._acceptInterpolatedIdent(r,t))?(e||this.hasWhitespace()||(this.acceptDelim("+"),this.hasWhitespace()||this.acceptIdent("_")),this.finish(r)):(this.restoreAtMark(n),null)},t.prototype.peekInterpolatedIdent=function(){return this.peek(r.TokenType.Ident)||this.peekDelim("@")||this.peekDelim("$")||this.peekDelim("-")},t.prototype._acceptInterpolatedIdent=function(e,t){for(var n=this,i=!1,o=function(){var e=n.mark();return n.acceptDelim("-")&&(n.hasWhitespace()||n.acceptDelim("-"),n.hasWhitespace())?(n.restoreAtMark(e),null):n._parseInterpolation()},s=t?function(){return n.acceptRegexp(t)}:function(){return n.accept(r.TokenType.Ident)};(s()||e.addChild(this._parseInterpolation()||this.try(o)))&&(i=!0,!this.hasWhitespace()););return i},t.prototype._parseInterpolation=function(){var e=this.mark();if(this.peekDelim("@")||this.peekDelim("$")){var t=this.createNode(o.NodeType.Interpolation);return this.consumeToken(),this.hasWhitespace()||!this.accept(r.TokenType.CurlyL)?(this.restoreAtMark(e),null):t.addChild(this._parseIdent())?this.accept(r.TokenType.CurlyR)?this.finish(t):this.finish(t,s.ParseError.RightCurlyExpected):this.finish(t,s.ParseError.IdentifierExpected)}return null},t.prototype._tryParseMixinDeclaration=function(){var e=this.mark(),t=this.create(o.MixinDeclaration);if(!t.setIdentifier(this._parseMixinDeclarationIdentifier())||!this.accept(r.TokenType.ParenthesisL))return this.restoreAtMark(e),null;if(t.getParameters().addChild(this._parseMixinParameter()))for(;(this.accept(r.TokenType.Comma)||this.accept(r.TokenType.SemiColon))&&!this.peek(r.TokenType.ParenthesisR);)t.getParameters().addChild(this._parseMixinParameter())||this.markError(t,s.ParseError.IdentifierExpected,[],[r.TokenType.ParenthesisR]);return this.accept(r.TokenType.ParenthesisR)?(t.setGuard(this._parseGuard()),this.peek(r.TokenType.CurlyL)?this._parseBody(t,this._parseMixInBodyDeclaration.bind(this)):(this.restoreAtMark(e),null)):(this.restoreAtMark(e),null)},t.prototype._parseMixInBodyDeclaration=function(){return this._parseFontFace()||this._parseRuleSetDeclaration()},t.prototype._parseMixinDeclarationIdentifier=function(){var e;if(this.peekDelim("#")||this.peekDelim(".")){if(e=this.create(o.Identifier),this.consumeToken(),this.hasWhitespace()||!e.addChild(this._parseIdent()))return null}else{if(!this.peek(r.TokenType.Hash))return null;e=this.create(o.Identifier),this.consumeToken()}return e.referenceTypes=[o.ReferenceType.Mixin],this.finish(e)},t.prototype._parsePseudo=function(){if(!this.peek(r.TokenType.Colon))return null;var t=this.mark(),n=this.create(o.ExtendsReference);return this.consumeToken(),this.acceptIdent("extend")?this._completeExtends(n):(this.restoreAtMark(t),e.prototype._parsePseudo.call(this))},t.prototype._parseExtend=function(){if(!this.peekDelim("&"))return null;var e=this.mark(),t=this.create(o.ExtendsReference);return this.consumeToken(),!this.hasWhitespace()&&this.accept(r.TokenType.Colon)&&this.acceptIdent("extend")?this._completeExtends(t):(this.restoreAtMark(e),null)},t.prototype._completeExtends=function(e){if(!this.accept(r.TokenType.ParenthesisL))return this.finish(e,s.ParseError.LeftParenthesisExpected);var t=e.getSelectors();if(!t.addChild(this._parseSelector(!0)))return this.finish(e,s.ParseError.SelectorExpected);for(;this.accept(r.TokenType.Comma);)if(!t.addChild(this._parseSelector(!0)))return this.finish(e,s.ParseError.SelectorExpected);return this.accept(r.TokenType.ParenthesisR)?this.finish(e):this.finish(e,s.ParseError.RightParenthesisExpected)},t.prototype._parseDetachedRuleSetMixin=function(){if(!this.peek(r.TokenType.AtKeyword))return null;var e=this.mark(),t=this.create(o.MixinReference);return!t.addChild(this._parseVariable(!0))||!this.hasWhitespace()&&this.accept(r.TokenType.ParenthesisL)?this.accept(r.TokenType.ParenthesisR)?this.finish(t):this.finish(t,s.ParseError.RightParenthesisExpected):(this.restoreAtMark(e),null)},t.prototype._tryParseMixinReference=function(e){void 0===e&&(e=!0);for(var t=this.mark(),n=this.create(o.MixinReference),i=this._parseMixinDeclarationIdentifier();i;){this.acceptDelim(">");var a=this._parseMixinDeclarationIdentifier();if(!a)break;n.getNamespaces().addChild(i),i=a}if(!n.setIdentifier(i))return this.restoreAtMark(t),null;var l=!1;if(this.accept(r.TokenType.ParenthesisL)){if(l=!0,n.getArguments().addChild(this._parseMixinArgument()))for(;(this.accept(r.TokenType.Comma)||this.accept(r.TokenType.SemiColon))&&!this.peek(r.TokenType.ParenthesisR);)if(!n.getArguments().addChild(this._parseMixinArgument()))return this.finish(n,s.ParseError.ExpressionExpected);if(!this.accept(r.TokenType.ParenthesisR))return this.finish(n,s.ParseError.RightParenthesisExpected);i.referenceTypes=[o.ReferenceType.Mixin]}else i.referenceTypes=[o.ReferenceType.Mixin,o.ReferenceType.Rule];return this.peek(r.TokenType.BracketL)?e||this._addLookupChildren(n):n.addChild(this._parsePrio()),l||this.peek(r.TokenType.SemiColon)||this.peek(r.TokenType.CurlyR)||this.peek(r.TokenType.EOF)?this.finish(n):(this.restoreAtMark(t),null)},t.prototype._parseMixinArgument=function(){var e=this.create(o.FunctionArgument),t=this.mark(),n=this._parseVariable();return n&&(this.accept(r.TokenType.Colon)?e.setIdentifier(n):this.restoreAtMark(t)),e.setValue(this._parseDetachedRuleSet()||this._parseExpr(!0))?this.finish(e):(this.restoreAtMark(t),null)},t.prototype._parseMixinParameter=function(){var e=this.create(o.FunctionParameter);if(this.peekKeyword("@rest")){var t=this.create(o.Node);return this.consumeToken(),this.accept(n.Ellipsis)?(e.setIdentifier(this.finish(t)),this.finish(e)):this.finish(e,s.ParseError.DotExpected,[],[r.TokenType.Comma,r.TokenType.ParenthesisR])}if(this.peek(n.Ellipsis)){var i=this.create(o.Node);return this.consumeToken(),e.setIdentifier(this.finish(i)),this.finish(e)}var a=!1;return e.setIdentifier(this._parseVariable())&&(this.accept(r.TokenType.Colon),a=!0),e.setDefaultValue(this._parseDetachedRuleSet()||this._parseExpr(!0))||a?this.finish(e):null},t.prototype._parseGuard=function(){if(!this.peekIdent("when"))return null;var e=this.create(o.LessGuard);if(this.consumeToken(),e.isNegated=this.acceptIdent("not"),!e.getConditions().addChild(this._parseGuardCondition()))return this.finish(e,s.ParseError.ConditionExpected);for(;this.acceptIdent("and")||this.accept(r.TokenType.Comma);)if(!e.getConditions().addChild(this._parseGuardCondition()))return this.finish(e,s.ParseError.ConditionExpected);return this.finish(e)},t.prototype._parseGuardCondition=function(){if(!this.peek(r.TokenType.ParenthesisL))return null;var e=this.create(o.GuardCondition);return this.consumeToken(),e.addChild(this._parseExpr()),this.accept(r.TokenType.ParenthesisR)?this.finish(e):this.finish(e,s.ParseError.RightParenthesisExpected)},t.prototype._parseFunction=function(){var e=this.mark(),t=this.create(o.Function);if(!t.setIdentifier(this._parseFunctionIdentifier()))return null;if(this.hasWhitespace()||!this.accept(r.TokenType.ParenthesisL))return this.restoreAtMark(e),null;if(t.getArguments().addChild(this._parseMixinArgument()))for(;(this.accept(r.TokenType.Comma)||this.accept(r.TokenType.SemiColon))&&!this.peek(r.TokenType.ParenthesisR);)if(!t.getArguments().addChild(this._parseMixinArgument()))return this.finish(t,s.ParseError.ExpressionExpected);return this.accept(r.TokenType.ParenthesisR)?this.finish(t):this.finish(t,s.ParseError.RightParenthesisExpected)},t.prototype._parseFunctionIdentifier=function(){if(this.peekDelim("%")){var t=this.create(o.Identifier);return t.referenceTypes=[o.ReferenceType.Function],this.consumeToken(),this.finish(t)}return e.prototype._parseFunctionIdentifier.call(this)},t.prototype._parseURLArgument=function(){var t=this.mark(),n=e.prototype._parseURLArgument.call(this);if(!n||!this.peek(r.TokenType.ParenthesisR)){this.restoreAtMark(t);var i=this.create(o.Node);return i.addChild(this._parseBinaryExpr()),this.finish(i)}return n},t}(i.Parser);t.LESSParser=a}));__extends=this&&this.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();!function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("vscode-css-languageservice/services/lessCompletion",["require","exports","./cssCompletion","../cssLanguageTypes","vscode-nls"],e)}((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=e("./cssCompletion"),r=e("../cssLanguageTypes"),i=e("vscode-nls").loadMessageBundle(),o=function(e){function t(t,n){return e.call(this,"@",t,n)||this}return __extends(t,e),t.prototype.createFunctionProposals=function(e,t,n,i){for(var o=0,s=e;o 50%"),example:"percentage(@number);",type:"percentage"},{name:"round",description:i("less.builtin.round","rounds a number to a number of places"),example:"round(number, [places: 0]);"},{name:"sqrt",description:i("less.builtin.sqrt","calculates square root of a number"),example:"sqrt(number);"},{name:"sin",description:i("less.builtin.sin","sine function"),example:"sin(number);"},{name:"tan",description:i("less.builtin.tan","tangent function"),example:"tan(number);"},{name:"atan",description:i("less.builtin.atan","arctangent - inverse of tangent function"),example:"atan(number);"},{name:"pi",description:i("less.builtin.pi","returns pi"),example:"pi();"},{name:"pow",description:i("less.builtin.pow","first argument raised to the power of the second argument"),example:"pow(@base, @exponent);"},{name:"mod",description:i("less.builtin.mod","first argument modulus second argument"),example:"mod(number, number);"},{name:"min",description:i("less.builtin.min","returns the lowest of one or more values"),example:"min(@x, @y);"},{name:"max",description:i("less.builtin.max","returns the lowest of one or more values"),example:"max(@x, @y);"}],t.colorProposals=[{name:"argb",example:"argb(@color);",description:i("less.builtin.argb","creates a #AARRGGBB")},{name:"hsl",example:"hsl(@hue, @saturation, @lightness);",description:i("less.builtin.hsl","creates a color")},{name:"hsla",example:"hsla(@hue, @saturation, @lightness, @alpha);",description:i("less.builtin.hsla","creates a color")},{name:"hsv",example:"hsv(@hue, @saturation, @value);",description:i("less.builtin.hsv","creates a color")},{name:"hsva",example:"hsva(@hue, @saturation, @value, @alpha);",description:i("less.builtin.hsva","creates a color")},{name:"hue",example:"hue(@color);",description:i("less.builtin.hue","returns the `hue` channel of `@color` in the HSL space")},{name:"saturation",example:"saturation(@color);",description:i("less.builtin.saturation","returns the `saturation` channel of `@color` in the HSL space")},{name:"lightness",example:"lightness(@color);",description:i("less.builtin.lightness","returns the `lightness` channel of `@color` in the HSL space")},{name:"hsvhue",example:"hsvhue(@color);",description:i("less.builtin.hsvhue","returns the `hue` channel of `@color` in the HSV space")},{name:"hsvsaturation",example:"hsvsaturation(@color);",description:i("less.builtin.hsvsaturation","returns the `saturation` channel of `@color` in the HSV space")},{name:"hsvvalue",example:"hsvvalue(@color);",description:i("less.builtin.hsvvalue","returns the `value` channel of `@color` in the HSV space")},{name:"red",example:"red(@color);",description:i("less.builtin.red","returns the `red` channel of `@color`")},{name:"green",example:"green(@color);",description:i("less.builtin.green","returns the `green` channel of `@color`")},{name:"blue",example:"blue(@color);",description:i("less.builtin.blue","returns the `blue` channel of `@color`")},{name:"alpha",example:"alpha(@color);",description:i("less.builtin.alpha","returns the `alpha` channel of `@color`")},{name:"luma",example:"luma(@color);",description:i("less.builtin.luma","returns the `luma` value (perceptual brightness) of `@color`")},{name:"saturate",example:"saturate(@color, 10%);",description:i("less.builtin.saturate","return `@color` 10% points more saturated")},{name:"desaturate",example:"desaturate(@color, 10%);",description:i("less.builtin.desaturate","return `@color` 10% points less saturated")},{name:"lighten",example:"lighten(@color, 10%);",description:i("less.builtin.lighten","return `@color` 10% points lighter")},{name:"darken",example:"darken(@color, 10%);",description:i("less.builtin.darken","return `@color` 10% points darker")},{name:"fadein",example:"fadein(@color, 10%);",description:i("less.builtin.fadein","return `@color` 10% points less transparent")},{name:"fadeout",example:"fadeout(@color, 10%);",description:i("less.builtin.fadeout","return `@color` 10% points more transparent")},{name:"fade",example:"fade(@color, 50%);",description:i("less.builtin.fade","return `@color` with 50% transparency")},{name:"spin",example:"spin(@color, 10);",description:i("less.builtin.spin","return `@color` with a 10 degree larger in hue")},{name:"mix",example:"mix(@color1, @color2, [@weight: 50%]);",description:i("less.builtin.mix","return a mix of `@color1` and `@color2`")},{name:"greyscale",example:"greyscale(@color);",description:i("less.builtin.greyscale","returns a grey, 100% desaturated color")},{name:"contrast",example:"contrast(@color1, [@darkcolor: black], [@lightcolor: white], [@threshold: 43%]);",description:i("less.builtin.contrast","return `@darkcolor` if `@color1 is> 43% luma` otherwise return `@lightcolor`, see notes")},{name:"multiply",example:"multiply(@color1, @color2);"},{name:"screen",example:"screen(@color1, @color2);"},{name:"overlay",example:"overlay(@color1, @color2);"},{name:"softlight",example:"softlight(@color1, @color2);"},{name:"hardlight",example:"hardlight(@color1, @color2);"},{name:"difference",example:"difference(@color1, @color2);"},{name:"exclusion",example:"exclusion(@color1, @color2);"},{name:"average",example:"average(@color1, @color2);"},{name:"negation",example:"negation(@color1, @color2);"}],t}(n.CSSCompletion);t.LESSCompletion=o})),function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("vscode-css-languageservice/services/cssFolding",["require","exports","../parser/cssScanner","../parser/scssScanner","../parser/lessScanner"],e)}((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=e("../parser/cssScanner"),r=e("../parser/scssScanner"),i=e("../parser/lessScanner");function o(e,t){if(0===e.length)return null;for(var n=e.length-1;n>=0;n--)if(e[n].type===t&&e[n].isStart)return e.splice(n,1)[0];return null}t.getFoldingRanges=function(e,t){return function(e,t){var n=t&&t.rangeLimit||Number.MAX_VALUE,r=e.sort((function(e,t){var n=e.startLine-t.startLine;return 0===n&&(n=e.endLine-t.endLine),n})),i=[],o=-1;return r.forEach((function(e){e.startLine && ]#",relevance:50,description:"@counter-style descriptor. Specifies the symbols used by the marker-construction algorithm specified by the system descriptor. Needs to be specified if the counter system is 'additive'.",restrictions:["integer","string","image","identifier"]},{name:"align-content",values:[{name:"center",description:"Lines are packed toward the center of the flex container."},{name:"flex-end",description:"Lines are packed toward the end of the flex container."},{name:"flex-start",description:"Lines are packed toward the start of the flex container."},{name:"space-around",description:"Lines are evenly distributed in the flex container, with half-size spaces on either end."},{name:"space-between",description:"Lines are evenly distributed in the flex container."},{name:"stretch",description:"Lines stretch to take up the remaining space."}],syntax:"normal | | | ? ",relevance:59,description:"Aligns a flex container’s lines within the flex container when there is extra space in the cross-axis, similar to how 'justify-content' aligns individual items within the main-axis.",restrictions:["enum"]},{name:"align-items",values:[{name:"baseline",description:"If the flex item’s inline axis is the same as the cross axis, this value is identical to 'flex-start'. Otherwise, it participates in baseline alignment."},{name:"center",description:"The flex item’s margin box is centered in the cross axis within the line."},{name:"flex-end",description:"The cross-end margin edge of the flex item is placed flush with the cross-end edge of the line."},{name:"flex-start",description:"The cross-start margin edge of the flex item is placed flush with the cross-start edge of the line."},{name:"stretch",description:"If the cross size property of the flex item computes to auto, and neither of the cross-axis margins are auto, the flex item is stretched."}],syntax:"normal | stretch | | [ ? ]",relevance:81,description:"Aligns flex items along the cross axis of the current line of the flex container.",restrictions:["enum"]},{name:"justify-items",values:[{name:"auto"},{name:"normal"},{name:"end"},{name:"start"},{name:"flex-end",description:'"Flex items are packed toward the end of the line."'},{name:"flex-start",description:'"Flex items are packed toward the start of the line."'},{name:"self-end",description:"The item is packed flush to the edge of the alignment container of the end side of the item, in the appropriate axis."},{name:"self-start",description:"The item is packed flush to the edge of the alignment container of the start side of the item, in the appropriate axis.."},{name:"center",description:"The items are packed flush to each other toward the center of the of the alignment container."},{name:"left"},{name:"right"},{name:"baseline"},{name:"first baseline"},{name:"last baseline"},{name:"stretch",description:"If the cross size property of the flex item computes to auto, and neither of the cross-axis margins are auto, the flex item is stretched."},{name:"save"},{name:"unsave"},{name:"legacy"}],syntax:"normal | stretch | | ? [ | left | right ] | legacy | legacy && [ left | right | center ]",relevance:50,description:"Defines the default justify-self for all items of the box, giving them the default way of justifying each box along the appropriate axis",restrictions:["enum"]},{name:"justify-self",browsers:["E16","FF45","S10.1","C57","O44"],values:[{name:"auto"},{name:"normal"},{name:"end"},{name:"start"},{name:"flex-end",description:'"Flex items are packed toward the end of the line."'},{name:"flex-start",description:'"Flex items are packed toward the start of the line."'},{name:"self-end",description:"The item is packed flush to the edge of the alignment container of the end side of the item, in the appropriate axis."},{name:"self-start",description:"The item is packed flush to the edge of the alignment container of the start side of the item, in the appropriate axis.."},{name:"center",description:"The items are packed flush to each other toward the center of the of the alignment container."},{name:"left"},{name:"right"},{name:"baseline"},{name:"first baseline"},{name:"last baseline"},{name:"stretch",description:"If the cross size property of the flex item computes to auto, and neither of the cross-axis margins are auto, the flex item is stretched."},{name:"save"},{name:"unsave"}],syntax:"auto | normal | stretch | | ? [ | left | right ]",relevance:52,description:"Defines the way of justifying a box inside its container along the appropriate axis.",restrictions:["enum"]},{name:"align-self",values:[{name:"auto",description:"Computes to the value of 'align-items' on the element’s parent, or 'stretch' if the element has no parent. On absolutely positioned elements, it computes to itself."},{name:"baseline",description:"If the flex item’s inline axis is the same as the cross axis, this value is identical to 'flex-start'. Otherwise, it participates in baseline alignment."},{name:"center",description:"The flex item’s margin box is centered in the cross axis within the line."},{name:"flex-end",description:"The cross-end margin edge of the flex item is placed flush with the cross-end edge of the line."},{name:"flex-start",description:"The cross-start margin edge of the flex item is placed flush with the cross-start edge of the line."},{name:"stretch",description:"If the cross size property of the flex item computes to auto, and neither of the cross-axis margins are auto, the flex item is stretched."}],syntax:"auto | normal | stretch | | ? ",relevance:69,description:"Allows the default alignment along the cross axis to be overridden for individual flex items.",restrictions:["enum"]},{name:"all",browsers:["E79","FF27","S9.1","C37","O24"],values:[],syntax:"initial | inherit | unset | revert",relevance:51,references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/all"}],description:"Shorthand that resets all properties except 'direction' and 'unicode-bidi'.",restrictions:["enum"]},{name:"alt",browsers:["S9"],values:[],relevance:50,references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/alt"}],description:"Provides alternative text for assistive technology to replace the generated content of a ::before or ::after element.",restrictions:["string","enum"]},{name:"animation",values:[{name:"alternate",description:"The animation cycle iterations that are odd counts are played in the normal direction, and the animation cycle iterations that are even counts are played in a reverse direction."},{name:"alternate-reverse",description:"The animation cycle iterations that are odd counts are played in the reverse direction, and the animation cycle iterations that are even counts are played in a normal direction."},{name:"backwards",description:"The beginning property value (as defined in the first @keyframes at-rule) is applied before the animation is displayed, during the period defined by 'animation-delay'."},{name:"both",description:"Both forwards and backwards fill modes are applied."},{name:"forwards",description:"The final property value (as defined in the last @keyframes at-rule) is maintained after the animation completes."},{name:"infinite",description:"Causes the animation to repeat forever."},{name:"none",description:"No animation is performed"},{name:"normal",description:"Normal playback."},{name:"reverse",description:"All iterations of the animation are played in the reverse direction from the way they were specified."}],syntax:"#",relevance:79,references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/animation"}],description:"Shorthand property combines six of the animation properties into a single property.",restrictions:["time","timing-function","enum","identifier","number"]},{name:"animation-delay",syntax:"